28#ifndef LELY_CO_SDO_INLINE
29#define LELY_CO_SDO_INLINE static inline
33#define CO_SDO_COBID_VALID UINT32_C(0x80000000)
39#define CO_SDO_COBID_FRAME UINT32_C(0x20000000)
42#define CO_DEFSTRUCT_SDO_PAR 0x0022
57#define CO_SDO_PAR_INIT \
59 3, CO_SDO_COBID_VALID, CO_SDO_COBID_VALID, 0 \
63#define CO_SDO_AC_TOGGLE UINT32_C(0x05030000)
66#define CO_SDO_AC_TIMEOUT UINT32_C(0x05040000)
69#define CO_SDO_AC_NO_CS UINT32_C(0x05040001)
72#define CO_SDO_AC_BLK_SIZE UINT32_C(0x05040002)
75#define CO_SDO_AC_BLK_SEQ UINT32_C(0x05040003)
78#define CO_SDO_AC_BLK_CRC UINT32_C(0x05040004)
81#define CO_SDO_AC_NO_MEM UINT32_C(0x05040005)
84#define CO_SDO_AC_NO_ACCESS UINT32_C(0x06010000)
87#define CO_SDO_AC_NO_READ UINT32_C(0x06010001)
90#define CO_SDO_AC_NO_WRITE UINT32_C(0x06010002)
93#define CO_SDO_AC_NO_OBJ UINT32_C(0x06020000)
96#define CO_SDO_AC_NO_PDO UINT32_C(0x06040041)
102#define CO_SDO_AC_PDO_LEN UINT32_C(0x06040042)
105#define CO_SDO_AC_PARAM UINT32_C(0x06040043)
108#define CO_SDO_AC_COMPAT UINT32_C(0x06040047)
111#define CO_SDO_AC_HARDWARE UINT32_C(0x06060000)
117#define CO_SDO_AC_TYPE_LEN UINT32_C(0x06070010)
123#define CO_SDO_AC_TYPE_LEN_HI UINT32_C(0x06070012)
129#define CO_SDO_AC_TYPE_LEN_LO UINT32_C(0x06070013)
132#define CO_SDO_AC_NO_SUB UINT32_C(0x06090011)
135#define CO_SDO_AC_PARAM_VAL UINT32_C(0x06090030)
138#define CO_SDO_AC_PARAM_HI UINT32_C(0x06090031)
141#define CO_SDO_AC_PARAM_LO UINT32_C(0x06090032)
144#define CO_SDO_AC_PARAM_RANGE UINT32_C(0x06090036)
147#define CO_SDO_AC_NO_SDO UINT32_C(0x060a0023)
150#define CO_SDO_AC_ERROR UINT32_C(0x08000000)
153#define CO_SDO_AC_DATA UINT32_C(0x08000020)
159#define CO_SDO_AC_DATA_CTL UINT32_C(0x08000021)
165#define CO_SDO_AC_DATA_DEV UINT32_C(0x08000022)
172#define CO_SDO_AC_NO_OD UINT32_C(0x08000023)
175#define CO_SDO_AC_NO_DATA UINT32_C(0x08000024)
178#define CO_NUM_SDOS 128
206#define CO_SDO_REQ_INIT \
208 0, NULL, 0, 0, MEMBUF_INIT \
256 co_unsigned32_t *pac);
275 co_unsigned32_t *pac);
292 co_unsigned32_t *pac);
308 co_unsigned32_t *pac);
325 const void *val, co_unsigned32_t *pac);
340 co_unsigned32_t *pac);
342LELY_CO_SDO_INLINE
int
348LELY_CO_SDO_INLINE
int
int co_sdo_req_first(const struct co_sdo_req *req)
Returns 1 if the specified request includes the first segment, and 0 otherwise.
int co_sdo_req_dn_val(struct co_sdo_req *req, co_unsigned16_t type, void *val, co_unsigned32_t *pac)
Copies the next segment of the specified CANopen SDO download request to the internal buffer and,...
int co_sdo_req_up_val(struct co_sdo_req *req, co_unsigned16_t type, const void *val, co_unsigned32_t *pac)
Writes the specified value to a buffer and constructs a CANopen SDO upload request.
int co_sdo_req_up(struct co_sdo_req *req, const void *ptr, size_t n, co_unsigned32_t *pac)
Writes the specified bytes to a buffer and constructs a CANopen SDO upload request.
void co_sdo_req_fini(struct co_sdo_req *req)
Finalizes a CANopen SDO upload/download request.
int co_sdo_req_dn_file(struct co_sdo_req *req, const char *filename, co_unsigned32_t *pac)
Copies the next segment of the specified CANopen SDO download request to the internal buffer and,...
int co_sdo_req_up_file(struct co_sdo_req *req, const char *filename, co_unsigned32_t *pac)
Loads the specified file into a buffer and constructs a CANopen SDO upload request.
void co_sdo_req_clear(struct co_sdo_req *req)
Clears a CANopen SDO upload/download request, including its buffer.
const char * co_sdo_ac2str(co_unsigned32_t ac)
Returns a string describing an SDO abort code.
int co_sdo_req_last(const struct co_sdo_req *req)
Returns 1 if the specified request includes the last segment, and 0 otherwise.
void co_sdo_req_init(struct co_sdo_req *req)
Initializes a CANopen SDO upload/download request.
int co_sdo_req_dn(struct co_sdo_req *req, const void **pptr, size_t *pnbyte, co_unsigned32_t *pac)
Copies the next segment of the specified CANopen SDO download request to the internal buffer and,...
This header file is part of the utilities library; it contains the memory buffer declarations.
co_unsigned32_t cobid_res
COB-ID server -> client.
co_unsigned8_t n
Highest sub-index supported.
co_unsigned32_t cobid_req
COB-ID client -> server.
co_unsigned8_t id
Node-ID of SDO's client resp. server.
A CANopen SDO upload/download request.
size_t offset
The offset of the bytes at buf.
size_t size
The total size (in bytes) of the value to be uploaded/downloaded.
const void * buf
A pointer to the next bytes to be uploaded/downloaded.
size_t nbyte
The number of bytes available at buf.
This header file is part of the CANopen library; it contains the CANopen type definitions.