include/ecrt.h
changeset 1512 388901f44a5e
parent 1510 88b608a1a7f3
child 1513 60ca68d853b8
equal deleted inserted replaced
1511:53bf35f7b6ea 1512:388901f44a5e
    61  *   about the currently connected slaves and the PDO entries provided.
    61  *   about the currently connected slaves and the PDO entries provided.
    62  * - Added ecrt_master_sdo_download() and ecrt_master_sdo_upload()
    62  * - Added ecrt_master_sdo_download() and ecrt_master_sdo_upload()
    63  *   methods to let an application transfer SDOs before activating the master.
    63  *   methods to let an application transfer SDOs before activating the master.
    64  * - Changed the meaning of the negative return values of
    64  * - Changed the meaning of the negative return values of
    65  *   ecrt_slave_config_reg_pdo_entry() and ecrt_slave_config_sdo*().
    65  *   ecrt_slave_config_reg_pdo_entry() and ecrt_slave_config_sdo*().
    66  * - Imlemented the Vendor-specific over EtherCAT mailbox protocol. See
    66  * - Implemented the Vendor-specific over EtherCAT mailbox protocol. See
    67  *   ecrt_slave_config_create_voe_handler().
    67  *   ecrt_slave_config_create_voe_handler().
    68  * - Renamed ec_sdo_request_state_t to #ec_request_state_t, because it is also
    68  * - Renamed ec_sdo_request_state_t to #ec_request_state_t, because it is also
    69  *   used by VoE handlers.
    69  *   used by VoE handlers.
    70  * - Removed 'const' from argument of ecrt_sdo_request_state(), because the
    70  * - Removed 'const' from argument of ecrt_sdo_request_state(), because the
    71  *   userspace library has to modify object internals.
    71  *   userspace library has to modify object internals.
   127  */
   127  */
   128 #define EC_MAX_STRING_LENGTH 64
   128 #define EC_MAX_STRING_LENGTH 64
   129 
   129 
   130 /** Timeval to nanoseconds conversion.
   130 /** Timeval to nanoseconds conversion.
   131  *
   131  *
   132  * This macro converts a unix epoch time to EtherCAT DC time.
   132  * This macro converts a Unix epoch time to EtherCAT DC time.
   133  *
   133  *
   134  * \see void ecrt_master_application_time()
   134  * \see void ecrt_master_application_time()
   135  *
   135  *
   136  * \param TV struct timeval containing epoch time.
   136  * \param TV struct timeval containing epoch time.
   137  */
   137  */
   234     uint16_t alias; /**< The slaves alias if not equal to 0. */
   234     uint16_t alias; /**< The slaves alias if not equal to 0. */
   235     int16_t current_on_ebus; /**< Used current in mA. */
   235     int16_t current_on_ebus; /**< Used current in mA. */
   236     uint8_t al_state; /**< Current state of the slave. */
   236     uint8_t al_state; /**< Current state of the slave. */
   237     uint8_t error_flag; /**< Error flag for that slave. */
   237     uint8_t error_flag; /**< Error flag for that slave. */
   238     uint8_t sync_count; /**< Number of sync managers. */
   238     uint8_t sync_count; /**< Number of sync managers. */
   239     uint16_t sdo_count; /**< Number of SDO's. */
   239     uint16_t sdo_count; /**< Number of SDOs. */
   240     char name[EC_MAX_STRING_LENGTH]; /**< Name of the slave. */
   240     char name[EC_MAX_STRING_LENGTH]; /**< Name of the slave. */
   241 } ec_slave_info_t;
   241 } ec_slave_info_t;
   242 
   242 
   243 #endif // #ifndef __KERNEL__
   243 #endif // #ifndef __KERNEL__
   244 
   244 
   466  * want to send and receive datagrams on the bus, the application has to
   466  * want to send and receive datagrams on the bus, the application has to
   467  * provide a callback mechanism. This method takes two function pointers as
   467  * provide a callback mechanism. This method takes two function pointers as
   468  * its parameters. Asynchronous master access (like EoE processing) is only
   468  * its parameters. Asynchronous master access (like EoE processing) is only
   469  * possible if the callbacks have been set.
   469  * possible if the callbacks have been set.
   470  *
   470  *
   471  * The task of the send callback (\a request_cb) is to decide, if the bus is
   471  * The task of the send callback (\a send_cb) is to decide, if the bus is
   472  * currently accessible. In this case, it can call the ecrt_master_send_ext()
   472  * currently accessible and whether or not to call the ecrt_master_send_ext()
   473  * method.
   473  * method.
   474  *
   474  *
   475  * The task of the receive callback (\a receive_cb) is to decide, if a call to
   475  * The task of the receive callback (\a receive_cb) is to decide, if a call to
   476  * ecrt_master_receive() is allowed and to execute it respectively.
   476  * ecrt_master_receive() is allowed and to execute it respectively.
   477  */
   477  */
   641  * activation of the master, these requests are processed by the master state
   641  * activation of the master, these requests are processed by the master state
   642  * machine itself. After activation the user have to ensure cyclic
   642  * machine itself. After activation the user have to ensure cyclic
   643  * processing.
   643  * processing.
   644  *
   644  *
   645  * \retval  0 Success.
   645  * \retval  0 Success.
   646  * \retval -1 Error occured.
   646  * \retval -1 Error occurred.
   647  */
   647  */
   648 int ecrt_master_sdo_upload(
   648 int ecrt_master_sdo_upload(
   649         ec_master_t *master, /**< EtherCAT master. */
   649         ec_master_t *master, /**< EtherCAT master. */
   650         uint16_t slave_position, /**< Slave position. */
   650         uint16_t slave_position, /**< Slave position. */
   651         uint16_t index, /**< Index of the SDO. */
   651         uint16_t index, /**< Index of the SDO. */