921 |
921 |
922 /***************************************************************************** |
922 /***************************************************************************** |
923 * VoE handler methods. |
923 * VoE handler methods. |
924 ****************************************************************************/ |
924 ****************************************************************************/ |
925 |
925 |
|
926 /** Sets the VoE header containing vendor ID and vendor type. |
|
927 * |
|
928 * A VoE message shall contain a 4-byte vendor ID, followed by a 2-byte vendor |
|
929 * type at as header. These numbers can be set with this function. |
|
930 */ |
|
931 void ecrt_voe_handler_header( |
|
932 ec_voe_handler_t *voe, /**< VoE handler. */ |
|
933 uint32_t vendor_id, /**< Vendor ID. */ |
|
934 uint16_t vendor_type /**< Vendor-specific type. */ |
|
935 ); |
|
936 |
926 /** Access to the VoE handler's data. |
937 /** Access to the VoE handler's data. |
927 * |
938 * |
928 * This function returns a pointer to the handler's internal memory. |
939 * This function returns a pointer to the VoE handler's internal memory, after |
|
940 * the VoE header (see ecrt_voe_handler_header()). |
929 * |
941 * |
930 * - After a read operation was successful, the memory contains the received |
942 * - After a read operation was successful, the memory contains the received |
931 * data. The size of the received data can be determined via |
943 * data. The size of the received data can be determined via |
932 * ecrt_voe_handler_data_size(). |
944 * ecrt_voe_handler_data_size(). |
933 * - Before a write operation is triggered, the data have to be written to |
945 * - Before a write operation is triggered, the data have to be written to |
940 ec_voe_handler_t *voe /**< VoE handler. */ |
952 ec_voe_handler_t *voe /**< VoE handler. */ |
941 ); |
953 ); |
942 |
954 |
943 /** Returns the current data size. |
955 /** Returns the current data size. |
944 * |
956 * |
|
957 * The data size is the size of the VoE data without the header (see |
|
958 * ecrt_voe_handler_header()). |
|
959 * |
945 * When the VoE handler is created, the data size is set to the size of the |
960 * When the VoE handler is created, the data size is set to the size of the |
946 * reserved memory. At a write operation, the data size is set to the number |
961 * reserved memory. At a write operation, the data size is set to the number |
947 * of bytes to write. After a read operation the size is set to the size of |
962 * of bytes to write. After a read operation the size is set to the size of |
948 * the read data. The size is not modified in any other situation. |
963 * the read data. The size is not modified in any other situation. |
949 * |
964 * |
958 * After this function has been called, the ecrt_voe_handler_execute() method |
973 * After this function has been called, the ecrt_voe_handler_execute() method |
959 * must be called in every bus cycle as long as it returns EC_REQUEST_BUSY. |
974 * must be called in every bus cycle as long as it returns EC_REQUEST_BUSY. |
960 */ |
975 */ |
961 void ecrt_voe_handler_write( |
976 void ecrt_voe_handler_write( |
962 ec_voe_handler_t *voe, /**< VoE handler. */ |
977 ec_voe_handler_t *voe, /**< VoE handler. */ |
963 size_t size /**< Number of bytes to write. */ |
978 size_t size /**< Number of bytes to write (without the VoE header). */ |
964 ); |
979 ); |
965 |
980 |
966 /** Start a VoE read operation. |
981 /** Start a VoE read operation. |
967 * |
982 * |
968 * After this function has been called, the ecrt_voe_handler_execute() method |
983 * After this function has been called, the ecrt_voe_handler_execute() method |