include/ecrt.h
branchstable-1.5
changeset 2109 755e6ce823f0
parent 2009 b5391b329b5d
child 2124 c4afc5fede19
equal deleted inserted replaced
2108:6d3620f2328f 2109:755e6ce823f0
   633         uint16_t pdo_pos, /**< Zero-based PDO position. */
   633         uint16_t pdo_pos, /**< Zero-based PDO position. */
   634         uint16_t entry_pos, /**< Zero-based PDO entry position. */
   634         uint16_t entry_pos, /**< Zero-based PDO entry position. */
   635         ec_pdo_entry_info_t *entry /**< Pointer to output structure. */
   635         ec_pdo_entry_info_t *entry /**< Pointer to output structure. */
   636         );
   636         );
   637 
   637 
   638 /** Executes an SDO write request to download data.
   638 #endif /* #ifndef __KERNEL__ */
   639  *
   639 
   640  * This function operates aside of the normal way to request SDOs. Before the
   640 /** Executes an SDO download request to write data to a slave.
   641  * activation of the master, these requests are processed by the master state
   641  *
   642  * machine itself. After activation the user has to ensure cyclic processing.
   642  * This request is processed by the master state machine. This method blocks,
       
   643  * until the request has been processed and may not be called in realtime
       
   644  * context.
   643  *
   645  *
   644  * \retval  0 Success.
   646  * \retval  0 Success.
   645  * \retval -1 An error occured.
   647  * \retval <0 Error code.
   646  */
   648  */
   647 int ecrt_master_sdo_download(
   649 int ecrt_master_sdo_download(
   648         ec_master_t *master, /**< EtherCAT master. */
   650         ec_master_t *master, /**< EtherCAT master. */
   649         uint16_t slave_position, /**< Slave position. */
   651         uint16_t slave_position, /**< Slave position. */
   650         uint16_t index, /**< Index of the SDO. */
   652         uint16_t index, /**< Index of the SDO. */
   652         uint8_t *data, /**< Data buffer to download. */
   654         uint8_t *data, /**< Data buffer to download. */
   653         size_t data_size, /**< Size of the data buffer. */
   655         size_t data_size, /**< Size of the data buffer. */
   654         uint32_t *abort_code /**< Abort code of the SDO download. */
   656         uint32_t *abort_code /**< Abort code of the SDO download. */
   655         );
   657         );
   656 
   658 
   657 /** Executes a SDO read request to upload data.
   659 /** Executes an SDO upload request to read data from a slave.
   658  *
   660  *
   659  * This function operates aside of the normal way to request SDOs. Before the
   661  * This request is processed by the master state machine. This method blocks,
   660  * activation of the master, these requests are processed by the master state
   662  * until the request has been processed and may not be called in realtime
   661  * machine itself. After activation the user have to ensure cyclic
   663  * context.
   662  * processing.
       
   663  *
   664  *
   664  * \retval  0 Success.
   665  * \retval  0 Success.
   665  * \retval -1 Error occurred.
   666  * \retval <0 Error code.
   666  */
   667  */
   667 int ecrt_master_sdo_upload(
   668 int ecrt_master_sdo_upload(
   668         ec_master_t *master, /**< EtherCAT master. */
   669         ec_master_t *master, /**< EtherCAT master. */
   669         uint16_t slave_position, /**< Slave position. */
   670         uint16_t slave_position, /**< Slave position. */
   670         uint16_t index, /**< Index of the SDO. */
   671         uint16_t index, /**< Index of the SDO. */
   672         uint8_t *target, /**< Target buffer for the upload. */
   673         uint8_t *target, /**< Target buffer for the upload. */
   673         size_t target_size, /**< Size of the target buffer. */
   674         size_t target_size, /**< Size of the target buffer. */
   674         size_t *result_size, /**< Uploaded data size. */
   675         size_t *result_size, /**< Uploaded data size. */
   675         uint32_t *abort_code /**< Abort code of the SDO upload. */
   676         uint32_t *abort_code /**< Abort code of the SDO upload. */
   676         );
   677         );
   677 
       
   678 #endif /* #ifndef __KERNEL__ */
       
   679 
   678 
   680 /** Executes an SoE write request.
   679 /** Executes an SoE write request.
   681  *
   680  *
   682  * Starts writing an IDN and blocks until the request was processed, or an
   681  * Starts writing an IDN and blocks until the request was processed, or an
   683  * error occurred.
   682  * error occurred.