73 * - Renamed ec_sdo_request_state_t to #ec_request_state_t, because it is also |
73 * - Renamed ec_sdo_request_state_t to #ec_request_state_t, because it is also |
74 * used by VoE handlers. |
74 * used by VoE handlers. |
75 * - Removed 'const' from argument of ecrt_sdo_request_state(), because the |
75 * - Removed 'const' from argument of ecrt_sdo_request_state(), because the |
76 * userspace library has to modify object internals. |
76 * userspace library has to modify object internals. |
77 * - Added 64-bit data access macros. |
77 * - Added 64-bit data access macros. |
78 * - Added ecrt_slave_config_idn() method for storing SoE IDN configurations. |
78 * - Added ecrt_slave_config_idn() method for storing SoE IDN configurations, |
|
79 * and ecrt_master_read_idn() and ecrt_master_write_idn() to read/write IDNs |
|
80 * ad-hoc via the user-space library. |
79 * |
81 * |
80 * @{ |
82 * @{ |
81 */ |
83 */ |
82 |
84 |
83 /*****************************************************************************/ |
85 /*****************************************************************************/ |
657 uint8_t subindex, /**< Subindex of the SDO. */ |
659 uint8_t subindex, /**< Subindex of the SDO. */ |
658 uint8_t *target, /**< Target buffer for the upload. */ |
660 uint8_t *target, /**< Target buffer for the upload. */ |
659 size_t target_size, /**< Size of the target buffer. */ |
661 size_t target_size, /**< Size of the target buffer. */ |
660 size_t *result_size, /**< Uploaded data size. */ |
662 size_t *result_size, /**< Uploaded data size. */ |
661 uint32_t *abort_code /**< Abort code of the SDO upload. */ |
663 uint32_t *abort_code /**< Abort code of the SDO upload. */ |
|
664 ); |
|
665 |
|
666 /** Executes an SoE write request. |
|
667 * |
|
668 * Starts writing an IDN and blocks until the request was processed, or an |
|
669 * error occurred. |
|
670 * |
|
671 * \retval 0 Success. |
|
672 * \retval -1 An error occured. |
|
673 */ |
|
674 int ecrt_master_write_idn( |
|
675 ec_master_t *master, /**< EtherCAT master. */ |
|
676 uint16_t slave_position, /**< Slave position. */ |
|
677 uint16_t idn, /**< SoE IDN (see ecrt_slave_config_idn()). */ |
|
678 uint8_t *data, /**< Pointer to data to write. */ |
|
679 size_t data_size, /**< Size of data to write. */ |
|
680 uint32_t *error_code /**< Pointer to variable, where an SoE error code |
|
681 can be stored. */ |
|
682 ); |
|
683 |
|
684 /** Executes an SoE read request. |
|
685 * |
|
686 * Starts reading an IDN and blocks until the request was processed, or an |
|
687 * error occurred. |
|
688 * |
|
689 * \retval 0 Success. |
|
690 * \retval -1 An error occured. |
|
691 */ |
|
692 int ecrt_master_read_idn( |
|
693 ec_master_t *master, /**< EtherCAT master. */ |
|
694 uint16_t slave_position, /**< Slave position. */ |
|
695 uint16_t idn, /**< SoE IDN (see ecrt_slave_config_idn()). */ |
|
696 uint8_t *target, /**< Pointer to memory where the read data can be |
|
697 stored. */ |
|
698 size_t target_size, /**< Size of the memory \a target points to. */ |
|
699 size_t *result_size, /**< Actual size of the received data. */ |
|
700 uint32_t *error_code /**< Pointer to variable, where an SoE error code |
|
701 can be stored. */ |
662 ); |
702 ); |
663 |
703 |
664 #endif /* #ifndef __KERNEL__ */ |
704 #endif /* #ifndef __KERNEL__ */ |
665 |
705 |
666 /** Finishes the configuration phase and prepares for cyclic operation. |
706 /** Finishes the configuration phase and prepares for cyclic operation. |
1138 size_t size /**< Data size to reserve. */ |
1178 size_t size /**< Data size to reserve. */ |
1139 ); |
1179 ); |
1140 |
1180 |
1141 /** Outputs the state of the slave configuration. |
1181 /** Outputs the state of the slave configuration. |
1142 * |
1182 * |
1143 * Stores the state information in the given \a state structure. |
1183 * Stores the state information in the given \a state structure. The state |
|
1184 * information is updated by the master state machine, so it may take a few |
|
1185 * cycles, until it changes. |
|
1186 * |
|
1187 * \attention If the state of process data exchange shall be monitored in |
|
1188 * realtime, ecrt_domain_state() should be used. |
1144 */ |
1189 */ |
1145 void ecrt_slave_config_state( |
1190 void ecrt_slave_config_state( |
1146 const ec_slave_config_t *sc, /**< Slave configuration */ |
1191 const ec_slave_config_t *sc, /**< Slave configuration */ |
1147 ec_slave_config_state_t *state /**< State object to write to. */ |
1192 ec_slave_config_state_t *state /**< State object to write to. */ |
1148 ); |
1193 ); |
1254 ); |
1299 ); |
1255 |
1300 |
1256 /** Reads the state of a domain. |
1301 /** Reads the state of a domain. |
1257 * |
1302 * |
1258 * Stores the domain state in the given \a state structure. |
1303 * Stores the domain state in the given \a state structure. |
|
1304 * |
|
1305 * Using this method, the process data exchange can be monitored in realtime. |
1259 */ |
1306 */ |
1260 void ecrt_domain_state( |
1307 void ecrt_domain_state( |
1261 const ec_domain_t *domain, /**< Domain. */ |
1308 const ec_domain_t *domain, /**< Domain. */ |
1262 ec_domain_state_t *state /**< Pointer to a state object to store the |
1309 ec_domain_state_t *state /**< Pointer to a state object to store the |
1263 information. */ |
1310 information. */ |