master/master.c
branchstable-1.5
changeset 2522 ec403cf308eb
parent 2498 9cdd7669dc0b
child 2529 c7e1f2616a9d
equal deleted inserted replaced
2521:3d68bb0047a1 2522:ec403cf308eb
   612 }
   612 }
   613 
   613 
   614 /*****************************************************************************/
   614 /*****************************************************************************/
   615 
   615 
   616 /** Transition function from ORPHANED to IDLE phase.
   616 /** Transition function from ORPHANED to IDLE phase.
       
   617  *
       
   618  * \return Zero on success, otherwise a negative error code.
   617  */
   619  */
   618 int ec_master_enter_idle_phase(
   620 int ec_master_enter_idle_phase(
   619         ec_master_t *master /**< EtherCAT master */
   621         ec_master_t *master /**< EtherCAT master */
   620         )
   622         )
   621 {
   623 {
   667 }
   669 }
   668 
   670 
   669 /*****************************************************************************/
   671 /*****************************************************************************/
   670 
   672 
   671 /** Transition function from IDLE to OPERATION phase.
   673 /** Transition function from IDLE to OPERATION phase.
       
   674  *
       
   675  * \return Zero on success, otherwise a negative error code.
   672  */
   676  */
   673 int ec_master_enter_operation_phase(
   677 int ec_master_enter_operation_phase(
   674         ec_master_t *master /**< EtherCAT master */
   678         ec_master_t *master /**< EtherCAT master */
   675         )
   679         )
   676 {
   680 {
   895 }
   899 }
   896 
   900 
   897 /*****************************************************************************/
   901 /*****************************************************************************/
   898 
   902 
   899 /** Searches for a free datagram in the external datagram ring.
   903 /** Searches for a free datagram in the external datagram ring.
       
   904  *
       
   905  * \return Next free datagram, or NULL.
   900  */
   906  */
   901 ec_datagram_t *ec_master_get_external_datagram(
   907 ec_datagram_t *ec_master_get_external_datagram(
   902         ec_master_t *master /**< EtherCAT master */
   908         ec_master_t *master /**< EtherCAT master */
   903         )
   909         )
   904 {
   910 {
  1777             return NULL; \
  1783             return NULL; \
  1778         } \
  1784         } \
  1779     } while (0)
  1785     } while (0)
  1780 
  1786 
  1781 /** Finds a slave in the bus, given the alias and position.
  1787 /** Finds a slave in the bus, given the alias and position.
       
  1788  *
       
  1789  * \return Search result, or NULL.
  1782  */
  1790  */
  1783 ec_slave_t *ec_master_find_slave(
  1791 ec_slave_t *ec_master_find_slave(
  1784         ec_master_t *master, /**< EtherCAT master. */
  1792         ec_master_t *master, /**< EtherCAT master. */
  1785         uint16_t alias, /**< Slave alias. */
  1793         uint16_t alias, /**< Slave alias. */
  1786         uint16_t position /**< Slave position. */
  1794         uint16_t position /**< Slave position. */
  1791 }
  1799 }
  1792 
  1800 
  1793 /** Finds a slave in the bus, given the alias and position.
  1801 /** Finds a slave in the bus, given the alias and position.
  1794  *
  1802  *
  1795  * Const version.
  1803  * Const version.
       
  1804  *
       
  1805  * \return Search result, or NULL.
  1796  */
  1806  */
  1797 const ec_slave_t *ec_master_find_slave_const(
  1807 const ec_slave_t *ec_master_find_slave_const(
  1798         const ec_master_t *master, /**< EtherCAT master. */
  1808         const ec_master_t *master, /**< EtherCAT master. */
  1799         uint16_t alias, /**< Slave alias. */
  1809         uint16_t alias, /**< Slave alias. */
  1800         uint16_t position /**< Slave position. */
  1810         uint16_t position /**< Slave position. */
  2066 }
  2076 }
  2067 
  2077 
  2068 /*****************************************************************************/
  2078 /*****************************************************************************/
  2069 
  2079 
  2070 /** Calculates the bus topology; recursion function.
  2080 /** Calculates the bus topology; recursion function.
       
  2081  *
       
  2082  * \return Zero on success, otherwise a negative error code.
  2071  */
  2083  */
  2072 int ec_master_calc_topology_rec(
  2084 int ec_master_calc_topology_rec(
  2073         ec_master_t *master, /**< EtherCAT master. */
  2085         ec_master_t *master, /**< EtherCAT master. */
  2074         ec_slave_t *port0_slave, /**< Slave at port 0. */
  2086         ec_slave_t *port0_slave, /**< Slave at port 0. */
  2075         unsigned int *slave_position /**< Slave position. */
  2087         unsigned int *slave_position /**< Slave position. */
  2197 /******************************************************************************
  2209 /******************************************************************************
  2198  *  Application interface
  2210  *  Application interface
  2199  *****************************************************************************/
  2211  *****************************************************************************/
  2200 
  2212 
  2201 /** Same as ecrt_master_create_domain(), but with ERR_PTR() return value.
  2213 /** Same as ecrt_master_create_domain(), but with ERR_PTR() return value.
       
  2214  *
       
  2215  * \return New domain, or ERR_PTR() return value.
  2202  */
  2216  */
  2203 ec_domain_t *ecrt_master_create_domain_err(
  2217 ec_domain_t *ecrt_master_create_domain_err(
  2204         ec_master_t *master /**< master */
  2218         ec_master_t *master /**< master */
  2205         )
  2219         )
  2206 {
  2220 {