83 /*****************************************************************************/ |
83 /*****************************************************************************/ |
84 |
84 |
85 /** EtherCAT datagram. |
85 /** EtherCAT datagram. |
86 */ |
86 */ |
87 typedef struct { |
87 typedef struct { |
88 struct list_head list; /**< Needed by domain datagram lists. */ |
|
89 struct list_head queue; /**< Master datagram queue item. */ |
88 struct list_head queue; /**< Master datagram queue item. */ |
90 struct list_head sent; /**< Master list item for sent datagrams. */ |
89 struct list_head sent; /**< Master list item for sent datagrams. */ |
|
90 ec_device_index_t device_index; /**< Device via which the datagram shall |
|
91 be / was sent. */ |
91 ec_datagram_type_t type; /**< Datagram type (APRD, BWR, etc.). */ |
92 ec_datagram_type_t type; /**< Datagram type (APRD, BWR, etc.). */ |
92 uint8_t address[EC_ADDR_LEN]; /**< Recipient address. */ |
93 uint8_t address[EC_ADDR_LEN]; /**< Recipient address. */ |
93 uint8_t *data; /**< Datagram payload. */ |
94 uint8_t *data; /**< Datagram payload. */ |
94 ec_origin_t data_origin; /**< Origin of the \a data memory. */ |
95 ec_origin_t data_origin; /**< Origin of the \a data memory. */ |
95 size_t mem_size; /**< Datagram \a data memory size. */ |
96 size_t mem_size; /**< Datagram \a data memory size. */ |
128 int ec_datagram_fprw(ec_datagram_t *, uint16_t, uint16_t, size_t); |
129 int ec_datagram_fprw(ec_datagram_t *, uint16_t, uint16_t, size_t); |
129 int ec_datagram_frmw(ec_datagram_t *, uint16_t, uint16_t, size_t); |
130 int ec_datagram_frmw(ec_datagram_t *, uint16_t, uint16_t, size_t); |
130 int ec_datagram_brd(ec_datagram_t *, uint16_t, size_t); |
131 int ec_datagram_brd(ec_datagram_t *, uint16_t, size_t); |
131 int ec_datagram_bwr(ec_datagram_t *, uint16_t, size_t); |
132 int ec_datagram_bwr(ec_datagram_t *, uint16_t, size_t); |
132 int ec_datagram_brw(ec_datagram_t *, uint16_t, size_t); |
133 int ec_datagram_brw(ec_datagram_t *, uint16_t, size_t); |
133 int ec_datagram_lrd(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
134 int ec_datagram_lrd(ec_datagram_t *, uint32_t, size_t); |
134 int ec_datagram_lwr(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
135 int ec_datagram_lwr(ec_datagram_t *, uint32_t, size_t); |
135 int ec_datagram_lrw(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
136 int ec_datagram_lrw(ec_datagram_t *, uint32_t, size_t); |
|
137 int ec_datagram_lrd_ext(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
|
138 int ec_datagram_lwr_ext(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
|
139 int ec_datagram_lrw_ext(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
136 |
140 |
137 void ec_datagram_print_state(const ec_datagram_t *); |
141 void ec_datagram_print_state(const ec_datagram_t *); |
138 void ec_datagram_print_wc_error(const ec_datagram_t *); |
142 void ec_datagram_print_wc_error(const ec_datagram_t *); |
139 void ec_datagram_output_stats(ec_datagram_t *); |
143 void ec_datagram_output_stats(ec_datagram_t *); |
140 const char *ec_datagram_type_string(const ec_datagram_t *); |
144 const char *ec_datagram_type_string(const ec_datagram_t *); |