38 |
38 |
39 #include "globals.h" |
39 #include "globals.h" |
40 |
40 |
41 /*****************************************************************************/ |
41 /*****************************************************************************/ |
42 |
42 |
43 /** CANopen Sdo request. |
43 /** CANopen SDO request. |
44 */ |
44 */ |
45 struct ec_sdo_request { |
45 struct ec_sdo_request { |
46 struct list_head list; /**< List item. */ |
46 struct list_head list; /**< List item. */ |
47 uint16_t index; /**< Sdo index. */ |
47 uint16_t index; /**< SDO index. */ |
48 uint8_t subindex; /**< Sdo subindex. */ |
48 uint8_t subindex; /**< SDO subindex. */ |
49 uint8_t *data; /**< Pointer to Sdo data. */ |
49 uint8_t *data; /**< Pointer to SDO data. */ |
50 size_t mem_size; /**< Size of Sdo data memory. */ |
50 size_t mem_size; /**< Size of SDO data memory. */ |
51 size_t data_size; /**< Size of Sdo data. */ |
51 size_t data_size; /**< Size of SDO data. */ |
52 uint32_t issue_timeout; /**< Maximum time in ms, the processing of the |
52 uint32_t issue_timeout; /**< Maximum time in ms, the processing of the |
53 request may take. */ |
53 request may take. */ |
54 uint32_t response_timeout; /**< Maximum time in ms, the transfer is |
54 uint32_t response_timeout; /**< Maximum time in ms, the transfer is |
55 retried, if the slave does not respond. */ |
55 retried, if the slave does not respond. */ |
56 ec_direction_t dir; /**< Direction. EC_DIR_OUTPUT means downloading to |
56 ec_direction_t dir; /**< Direction. EC_DIR_OUTPUT means downloading to |
57 the slave, EC_DIR_INPUT means uploading from the |
57 the slave, EC_DIR_INPUT means uploading from the |
58 slave. */ |
58 slave. */ |
59 ec_internal_request_state_t state; /**< Sdo request state. */ |
59 ec_internal_request_state_t state; /**< SDO request state. */ |
60 unsigned long jiffies_start; /**< Jiffies, when the request was issued. */ |
60 unsigned long jiffies_start; /**< Jiffies, when the request was issued. */ |
61 unsigned long jiffies_sent; /**< Jiffies, when the upload/download |
61 unsigned long jiffies_sent; /**< Jiffies, when the upload/download |
62 request was sent. */ |
62 request was sent. */ |
63 uint32_t abort_code; /**< Sdo request abort code. Zero on success. */ |
63 uint32_t abort_code; /**< SDO request abort code. Zero on success. */ |
64 }; |
64 }; |
65 |
65 |
66 /*****************************************************************************/ |
66 /*****************************************************************************/ |
67 |
67 |
68 void ec_sdo_request_init(ec_sdo_request_t *); |
68 void ec_sdo_request_init(ec_sdo_request_t *); |