CANopenNode
CO_ODinterface.h
Go to the documentation of this file.
1 
26 #ifndef CO_OD_INTERFACE_H
27 #define CO_OD_INTERFACE_H
28 
29 #include "301/CO_driver.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
42 #ifndef OD_size_t
43 
44 #define OD_size_t uint32_t
45 
46 #define OD_flagsPDO_t uint32_t
47 #endif
48 
50 #define OD_attr_t uint8_t
51 
52 
56 typedef enum {
57  OD_H1000_DEV_TYPE = 0x1000U,
58  OD_H1001_ERR_REG = 0x1001U,
61  OD_H1004_RSV = 0x1004U,
68  OD_H100B_RSV = 0x100BU,
71  OD_H100E_RSV = 0x100EU,
72  OD_H100F_RSV = 0x100FU,
84  OD_H1021_STORE_EDS = 0x1021U,
86  OD_H1023_OS_CMD = 0x1023U,
89  OD_H1026_OS_PROMPT = 0x1026U,
95  OD_H1300_GFC_PARAM = 0x1300U,
105 
106 
110 typedef enum {
111  ODA_SDO_R = 0x01,
112  ODA_SDO_W = 0x02,
113  ODA_SDO_RW = 0x03,
114  ODA_TPDO = 0x04,
115  ODA_RPDO = 0x08,
116  ODA_TRPDO = 0x0C,
117  ODA_TSRDO = 0x10,
118  ODA_RSRDO = 0x20,
119  ODA_TRSRDO = 0x30,
120  ODA_MB = 0x40,
121  ODA_STR = 0x80
125 
126 
132 typedef enum {
133 /* !!!! WARNING !!!!
134  * If changing these values, change also OD_getSDOabCode() function!
135  */
139  ODR_OK = 0,
159  ODR_HW = 10,
192 } ODR_t;
193 
194 
201 typedef struct {
233 } OD_subEntry_t;
234 
235 
240 typedef struct {
249  void *object;
255 } OD_stream_t;
256 
257 
263 typedef struct {
296  OD_size_t (*read)(OD_stream_t *stream, uint8_t subIndex,
297  void *buf, OD_size_t count, ODR_t *returnCode);
324  OD_size_t (*write)(OD_stream_t *stream, uint8_t subIndex,
325  const void *buf, OD_size_t count, ODR_t *returnCode);
326 } OD_IO_t;
327 
328 
336 typedef struct {
345  const void *odObject;
346 } OD_entry_t;
347 
348 
352 typedef struct {
356  const OD_entry_t *list;
357 } OD_t;
358 
359 
369 OD_size_t OD_readOriginal(OD_stream_t *stream, uint8_t subIndex,
370  void *buf, OD_size_t count, ODR_t *returnCode);
371 
372 
383  const void *buf, OD_size_t count, ODR_t *returnCode);
384 
385 
394 const OD_entry_t *OD_find(const OD_t *od, uint16_t index);
395 
396 
410 ODR_t OD_getSub(const OD_entry_t *entry, uint8_t subIndex,
411  OD_subEntry_t *subEntry, OD_IO_t *io, bool_t odOrig);
412 
413 
421 static inline uint16_t OD_getIndex(const OD_entry_t *entry) {
422  return entry->index;
423 }
424 
425 
435 static inline void OD_rwRestart(OD_stream_t *stream) {
436  stream->dataOffset = 0;
437 }
438 
439 
447 uint32_t OD_getSDOabCode(ODR_t returnCode);
448 
449 
486  void *object,
487  OD_size_t (*read)(OD_stream_t *stream,
488  uint8_t subIndex,
489  void *buf,
490  OD_size_t count,
491  ODR_t *returnCode),
492  OD_size_t (*write)(OD_stream_t *stream,
493  uint8_t subIndex,
494  const void *buf,
495  OD_size_t count,
496  ODR_t *returnCode));
497 
498 
519 ODR_t OD_get_i8(const OD_entry_t *entry, uint8_t subIndex,
520  int8_t *val, bool_t odOrig);
522 ODR_t OD_get_i16(const OD_entry_t *entry, uint8_t subIndex,
523  int16_t *val, bool_t odOrig);
525 ODR_t OD_get_i32(const OD_entry_t *entry, uint8_t subIndex,
526  int32_t *val, bool_t odOrig);
528 ODR_t OD_get_i64(const OD_entry_t *entry, uint8_t subIndex,
529  int64_t *val, bool_t odOrig);
531 ODR_t OD_get_u8(const OD_entry_t *entry, uint8_t subIndex,
532  uint8_t *val, bool_t odOrig);
534 ODR_t OD_get_u16(const OD_entry_t *entry, uint8_t subIndex,
535  uint16_t *val, bool_t odOrig);
537 ODR_t OD_get_u32(const OD_entry_t *entry, uint8_t subIndex,
538  uint32_t *val, bool_t odOrig);
540 ODR_t OD_get_u64(const OD_entry_t *entry, uint8_t subIndex,
541  uint64_t *val, bool_t odOrig);
543 ODR_t OD_get_r32(const OD_entry_t *entry, uint8_t subIndex,
544  float32_t *val, bool_t odOrig);
546 ODR_t OD_get_r64(const OD_entry_t *entry, uint8_t subIndex,
547  float64_t *val, bool_t odOrig);
548 
562 ODR_t OD_set_i8(const OD_entry_t *entry, uint8_t subIndex,
563  int8_t val, bool_t odOrig);
565 ODR_t OD_set_i16(const OD_entry_t *entry, uint8_t subIndex,
566  int16_t val, bool_t odOrig);
568 ODR_t OD_set_i32(const OD_entry_t *entry, uint8_t subIndex,
569  int32_t val, bool_t odOrig);
571 ODR_t OD_set_i64(const OD_entry_t *entry, uint8_t subIndex,
572  int64_t val, bool_t odOrig);
574 ODR_t OD_set_u8(const OD_entry_t *entry, uint8_t subIndex,
575  uint8_t val, bool_t odOrig);
577 ODR_t OD_set_u16(const OD_entry_t *entry, uint8_t subIndex,
578  uint16_t val, bool_t odOrig);
580 ODR_t OD_set_u32(const OD_entry_t *entry, uint8_t subIndex,
581  uint32_t val, bool_t odOrig);
583 ODR_t OD_set_u64(const OD_entry_t *entry, uint8_t subIndex,
584  uint64_t val, bool_t odOrig);
586 ODR_t OD_set_r32(const OD_entry_t *entry, uint8_t subIndex,
587  float32_t val, bool_t odOrig);
589 ODR_t OD_set_r64(const OD_entry_t *entry, uint8_t subIndex,
590  float64_t val, bool_t odOrig);
591 
607 ODR_t OD_getPtr_i8(const OD_entry_t *entry, uint8_t subIndex, int8_t **val);
609 ODR_t OD_getPtr_i16(const OD_entry_t *entry, uint8_t subIndex, int16_t **val);
611 ODR_t OD_getPtr_i32(const OD_entry_t *entry, uint8_t subIndex, int32_t **val);
613 ODR_t OD_getPtr_i64(const OD_entry_t *entry, uint8_t subIndex, int64_t **val);
615 ODR_t OD_getPtr_u8(const OD_entry_t *entry, uint8_t subIndex, uint8_t **val);
617 ODR_t OD_getPtr_u16(const OD_entry_t *entry, uint8_t subIndex, uint16_t **val);
619 ODR_t OD_getPtr_u32(const OD_entry_t *entry, uint8_t subIndex, uint32_t **val);
621 ODR_t OD_getPtr_u64(const OD_entry_t *entry, uint8_t subIndex, uint64_t **val);
623 ODR_t OD_getPtr_r32(const OD_entry_t *entry, uint8_t subIndex, float32_t **val);
625 ODR_t OD_getPtr_r64(const OD_entry_t *entry, uint8_t subIndex, float64_t **val);
643 ODR_t OD_getPtr_vs(const OD_entry_t *entry, uint8_t subIndex,
644  char **val, OD_size_t *dataLength);
646 ODR_t OD_getPtr_os(const OD_entry_t *entry, uint8_t subIndex,
647  uint8_t **val, OD_size_t *dataLength);
649 ODR_t OD_getPtr_us(const OD_entry_t *entry, uint8_t subIndex,
650  uint16_t **val, OD_size_t *dataLength); /* CO_ODgetSetters */
652 
653 
654 #if defined OD_DEFINITION || defined CO_DOXYGEN
655 
664 typedef enum {
669  ODT_VAR = 0x01,
675  ODT_ARR = 0x02,
682  ODT_REC = 0x03,
683 
686  ODT_EVAR = 0x11,
688  ODT_EARR = 0x12,
690  ODT_EREC = 0x13,
691 
697 
701 typedef struct {
702  void *data;
705 } OD_obj_var_t;
706 
710 typedef struct {
712  void *data;
719 
723 typedef struct {
724  void *data;
729 
734 typedef struct {
736  void *object;
738  OD_size_t (*read)(OD_stream_t *stream, uint8_t subIndex,
739  void *buf, OD_size_t count, ODR_t *returnCode);
741  OD_size_t (*write)(OD_stream_t *stream, uint8_t subIndex,
742  const void *buf, OD_size_t count, ODR_t *returnCode);
744 
749 typedef struct {
755  const void *odObjectOriginal;
757  /* CO_ODdefinition */
759 
760 #endif /* defined OD_DEFINITION */
761  /* CO_ODinterface */
763 
764 #ifdef __cplusplus
765 }
766 #endif /*__cplusplus*/
767 
768 #endif /* CO_OD_INTERFACE_H */
OD_stream_t::dataLength
OD_size_t dataLength
Data length in bytes or 0, if length is not specified.
Definition: CO_ODinterface.h:251
uint32_t
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
OD_rwRestart
static void OD_rwRestart(OD_stream_t *stream)
Restart read or write operation on OD variable.
Definition: CO_ODinterface.h:435
CO_driver.h
Interface between CAN hardware and CANopenNode.
OD_get_i64
ODR_t OD_get_i64(const OD_entry_t *entry, uint8_t subIndex, int64_t *val, bool_t odOrig)
Get int64_t variable from Object Dictionary, see OD_get_i8.
Definition: CO_ODinterface.c:400
ODR_DATA_DEV_STATE
@ ODR_DATA_DEV_STATE
SDO abort 0x08000022 - Data can't be transf.
Definition: CO_ODinterface.h:185
OD_H13FE_SRDO_VALID
@ OD_H13FE_SRDO_VALID
SRDO Configuration valid.
Definition: CO_ODinterface.h:98
ODR_READONLY
@ ODR_READONLY
SDO abort 0x06010002 - Attempt to write a read only object.
Definition: CO_ODinterface.h:147
OD_entry_t::odObject
const void * odObject
OD object of type indicated by odObjectType, from which OD_getSub() fetches the information.
Definition: CO_ODinterface.h:345
ODA_TRPDO
@ ODA_TRPDO
Variable is mappable into TPDO or RPDO.
Definition: CO_ODinterface.h:116
OD_H100F_RSV
@ OD_H100F_RSV
Reserved.
Definition: CO_ODinterface.h:72
OD_get_r32
ODR_t OD_get_r32(const OD_entry_t *entry, uint8_t subIndex, float32_t *val, bool_t odOrig)
Get float32_t variable from Object Dictionary, see OD_get_i8.
Definition: CO_ODinterface.c:460
ODR_OUT_OF_MEM
@ ODR_OUT_OF_MEM
SDO abort 0x05040005 - Out of memory.
Definition: CO_ODinterface.h:141
ODT_EXTENSION_MASK
@ ODT_EXTENSION_MASK
Mask for extension.
Definition: CO_ODinterface.h:695
ODR_VALUE_HIGH
@ ODR_VALUE_HIGH
SDO abort 0x06090031 - Value range of parameter written too high.
Definition: CO_ODinterface.h:171
OD_getPtr_r64
ODR_t OD_getPtr_r64(const OD_entry_t *entry, uint8_t subIndex, float64_t **val)
Get pointer to float64_t variable from OD, see OD_getPtr_i8.
Definition: CO_ODinterface.c:723
ODR_VALUE_LOW
@ ODR_VALUE_LOW
SDO abort 0x06090032 - Value range of parameter written too low.
Definition: CO_ODinterface.h:173
OD_H1301_SRDO_1_PARAM
@ OD_H1301_SRDO_1_PARAM
SRDO communication parameter.
Definition: CO_ODinterface.h:96
OD_stream_t::object
void * object
Pointer to object, passed by OD_extensionIO_init().
Definition: CO_ODinterface.h:249
OD_IO_t::stream
OD_stream_t stream
Object Dictionary stream object, passed to read or write.
Definition: CO_ODinterface.h:265
OD_H1200_SDO_SERVER_1_PARAM
@ OD_H1200_SDO_SERVER_1_PARAM
SDO server parameter.
Definition: CO_ODinterface.h:93
OD_getPtr_i8
ODR_t OD_getPtr_i8(const OD_entry_t *entry, uint8_t subIndex, int8_t **val)
Get pointer to int8_t variable from Object Dictionary.
Definition: CO_ODinterface.c:606
OD_set_r32
ODR_t OD_set_r32(const OD_entry_t *entry, uint8_t subIndex, float32_t val, bool_t odOrig)
Set float32_t variable in Object Dictionary, see OD_set_i8.
Definition: CO_ODinterface.c:581
OD_subEntry_t::flagsPDO
OD_flagsPDO_t * flagsPDO
Pointer to PDO flags bit-field.
Definition: CO_ODinterface.h:232
ODR_PAR_INCOMPAT
@ ODR_PAR_INCOMPAT
SDO abort 0x06040043 - General parameter incompatibility reasons.
Definition: CO_ODinterface.h:155
OD_get_i8
ODR_t OD_get_i8(const OD_entry_t *entry, uint8_t subIndex, int8_t *val, bool_t odOrig)
Get int8_t variable from Object Dictionary.
Definition: CO_ODinterface.c:364
OD_subEntry_t::subEntriesCount
uint8_t subEntriesCount
Number of sub-entries in OD object.
Definition: CO_ODinterface.h:209
ODR_DEV_INCOMPAT
@ ODR_DEV_INCOMPAT
SDO abort 0x06040047 - General internal incompatibility in device.
Definition: CO_ODinterface.h:157
OD_H1017_PRODUCER_HB_TIME
@ OD_H1017_PRODUCER_HB_TIME
Producer heartbeat time.
Definition: CO_ODinterface.h:80
OD_H100B_RSV
@ OD_H100B_RSV
Reserved.
Definition: CO_ODinterface.h:68
ODT_TYPE_MASK
@ ODT_TYPE_MASK
Mask for basic type.
Definition: CO_ODinterface.h:693
OD_H1014_COBID_EMERGENCY
@ OD_H1014_COBID_EMERGENCY
Emergency message cob-id.
Definition: CO_ODinterface.h:77
OD_getPtr_u64
ODR_t OD_getPtr_u64(const OD_entry_t *entry, uint8_t subIndex, uint64_t **val)
Get pointer to uint64_t variable from OD, see OD_getPtr_i8.
Definition: CO_ODinterface.c:697
OD_set_i64
ODR_t OD_set_i64(const OD_entry_t *entry, uint8_t subIndex, int64_t val, bool_t odOrig)
Set int16_t variable in Object Dictionary, see OD_set_i8.
Definition: CO_ODinterface.c:521
OD_H1003_PREDEF_ERR_FIELD
@ OD_H1003_PREDEF_ERR_FIELD
Predefined error field.
Definition: CO_ODinterface.h:60
int64_t
signed long long int int64_t
INTEGER64 in CANopen (0015h), 64-bit signed integer.
Definition: CO_driver.h:149
uint16_t
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition: CO_driver.h:153
OD_getPtr_us
ODR_t OD_getPtr_us(const OD_entry_t *entry, uint8_t subIndex, uint16_t **val, OD_size_t *dataLength)
Get pointer to "unicode string" variable from OD, see OD_getPtr_vs.
Definition: CO_ODinterface.c:772
ODA_TRSRDO
@ ODA_TRSRDO
Variable is mappable into tx or rx SRDO.
Definition: CO_ODinterface.h:119
ODR_NO_MAP
@ ODR_NO_MAP
SDO abort 0x06040041 - Object cannot be mapped to the PDO.
Definition: CO_ODinterface.h:151
ODA_RSRDO
@ ODA_RSRDO
Variable is mappable into receiving SRDO.
Definition: CO_ODinterface.h:118
ODR_NO_RESOURCE
@ ODR_NO_RESOURCE
SDO abort 0x060A0023 - Resource not available: SDO connection.
Definition: CO_ODinterface.h:177
OD_extensionIO_t
Object pointed by OD_obj_extended_t contains application specified parameters for extended OD object.
Definition: CO_ODinterface.h:734
OD_subEntry_t::attribute
OD_attr_t attribute
Attribute bit-field of the OD sub-object, see OD_attributes_t.
Definition: CO_ODinterface.h:211
OD_H1015_INHIBIT_TIME_EMCY
@ OD_H1015_INHIBIT_TIME_EMCY
Inhibit time emergency message.
Definition: CO_ODinterface.h:78
OD_getPtr_u16
ODR_t OD_getPtr_u16(const OD_entry_t *entry, uint8_t subIndex, uint16_t **val)
Get pointer to uint16_t variable from OD, see OD_getPtr_i8.
Definition: CO_ODinterface.c:671
OD_t::list
const OD_entry_t * list
List OD entries (table of contents), ordered by index.
Definition: CO_ODinterface.h:356
OD_H1002_MANUF_STATUS_REG
@ OD_H1002_MANUF_STATUS_REG
Manufacturer status register.
Definition: CO_ODinterface.h:59
OD_obj_array_t::dataElementSizeof
OD_size_t dataElementSizeof
Sizeof one array element in bytes.
Definition: CO_ODinterface.h:717
OD_H1020_VERIFY_CONFIG
@ OD_H1020_VERIFY_CONFIG
Verify configuration.
Definition: CO_ODinterface.h:83
OD_H1280_SDO_CLIENT_1_PARAM
@ OD_H1280_SDO_CLIENT_1_PARAM
SDO client parameter.
Definition: CO_ODinterface.h:94
bool_t
unsigned char bool_t
Boolean data type for general use.
Definition: CO_driver.h:141
OD_getPtr_i64
ODR_t OD_getPtr_i64(const OD_entry_t *entry, uint8_t subIndex, int64_t **val)
Get pointer to int64_t variable from OD, see OD_getPtr_i8.
Definition: CO_ODinterface.c:645
OD_getPtr_os
ODR_t OD_getPtr_os(const OD_entry_t *entry, uint8_t subIndex, uint8_t **val, OD_size_t *dataLength)
Get pointer to "octet string" variable from OD, see OD_getPtr_vs.
Definition: CO_ODinterface.c:754
ODT_REC
@ ODT_REC
This type corresponds to CANopen Object Dictionary object with object code equal to RECORD.
Definition: CO_ODinterface.h:682
ODT_VAR
@ ODT_VAR
This type corresponds to CANopen Object Dictionary object with object code equal to VAR.
Definition: CO_ODinterface.h:669
OD_set_u64
ODR_t OD_set_u64(const OD_entry_t *entry, uint8_t subIndex, uint64_t val, bool_t odOrig)
Set uint64_t variable in Object Dictionary, see OD_set_i8.
Definition: CO_ODinterface.c:569
int32_t
signed long int int32_t
INTEGER32 in CANopen (0004h), 32-bit signed integer.
Definition: CO_driver.h:147
OD_stream_t::dataObjectOriginal
void * dataObjectOriginal
Pointer to original data object, defined by Object Dictionary.
Definition: CO_ODinterface.h:245
uint64_t
unsigned long long int uint64_t
UNSIGNED64 in CANopen (001Bh), 64-bit unsigned integer.
Definition: CO_driver.h:157
OD_obj_array_t::dataElementLength
OD_size_t dataElementLength
Data length of array elements in bytes.
Definition: CO_ODinterface.h:716
ODR_INVALID_VALUE
@ ODR_INVALID_VALUE
SDO abort 0x06090030 - Invalid value for parameter (download only)
Definition: CO_ODinterface.h:169
ODA_SDO_W
@ ODA_SDO_W
SDO server may write to the variable.
Definition: CO_ODinterface.h:112
OD_obj_record_t::data
void * data
Pointer to data.
Definition: CO_ODinterface.h:724
OD_H100A_MANUF_SW_VERSION
@ OD_H100A_MANUF_SW_VERSION
Manufacturer software version.
Definition: CO_ODinterface.h:67
OD_H1005_COBID_SYNC
@ OD_H1005_COBID_SYNC
Sync message cob-id.
Definition: CO_ODinterface.h:62
OD_H1000_DEV_TYPE
@ OD_H1000_DEV_TYPE
Device type.
Definition: CO_ODinterface.h:57
ODT_EVAR
@ ODT_EVAR
Same as ODT_VAR, but extended with OD_obj_extended_t type.
Definition: CO_ODinterface.h:686
OD_set_u8
ODR_t OD_set_u8(const OD_entry_t *entry, uint8_t subIndex, uint8_t val, bool_t odOrig)
Set uint8_t variable in Object Dictionary, see OD_set_i8.
Definition: CO_ODinterface.c:533
int8_t
signed char int8_t
INTEGER8 in CANopen (0002h), 8-bit signed integer.
Definition: CO_driver.h:143
OD_stream_t::dataOffset
OD_size_t dataOffset
In case of large data, dataOffset indicates position of already transferred data.
Definition: CO_ODinterface.h:254
ODR_IDX_NOT_EXIST
@ ODR_IDX_NOT_EXIST
SDO abort 0x06020000 - Object does not exist in the object dict.
Definition: CO_ODinterface.h:149
ODA_MB
@ ODA_MB
Variable is multi-byte ((u)int16_t to (u)int64_t)
Definition: CO_ODinterface.h:120
OD_extensionIO_init
ODR_t OD_extensionIO_init(const OD_entry_t *entry, void *object, OD_size_t(*read)(OD_stream_t *stream, uint8_t subIndex, void *buf, OD_size_t count, ODR_t *returnCode), OD_size_t(*write)(OD_stream_t *stream, uint8_t subIndex, const void *buf, OD_size_t count, ODR_t *returnCode))
Initialise extended OD object with own read/write functions.
Definition: CO_ODinterface.c:332
OD_ObjDicId_30x_t
OD_ObjDicId_30x_t
Common DS301 object dictionary entries.
Definition: CO_ODinterface.h:56
OD_getPtr_i32
ODR_t OD_getPtr_i32(const OD_entry_t *entry, uint8_t subIndex, int32_t **val)
Get pointer to int32_t variable from OD, see OD_getPtr_i8.
Definition: CO_ODinterface.c:632
ODR_GENERAL
@ ODR_GENERAL
SDO abort 0x08000000 - General error.
Definition: CO_ODinterface.h:179
OD_H1026_OS_PROMPT
@ OD_H1026_OS_PROMPT
OS prompt.
Definition: CO_ODinterface.h:89
OD_find
const OD_entry_t * OD_find(const OD_t *od, uint16_t index)
Find OD entry in Object Dictionary.
Definition: CO_ODinterface.c:160
OD_set_i32
ODR_t OD_set_i32(const OD_entry_t *entry, uint8_t subIndex, int32_t val, bool_t odOrig)
Set int16_t variable in Object Dictionary, see OD_set_i8.
Definition: CO_ODinterface.c:509
OD_H1010_STORE_PARAM_FUNC
@ OD_H1010_STORE_PARAM_FUNC
Store params in persistent mem.
Definition: CO_ODinterface.h:73
OD_get_u16
ODR_t OD_get_u16(const OD_entry_t *entry, uint8_t subIndex, uint16_t *val, bool_t odOrig)
Get uint16_t variable from Object Dictionary, see OD_get_i8.
Definition: CO_ODinterface.c:424
OD_obj_record_t::attribute
OD_attr_t attribute
Attribute bitfield, see OD_attributes_t.
Definition: CO_ODinterface.h:726
ODR_PARTIAL
@ ODR_PARTIAL
Read/write is only partial, make more calls.
Definition: CO_ODinterface.h:137
OD_obj_var_t
Object for single OD variable, used for "VAR" type OD objects.
Definition: CO_ODinterface.h:701
float64_t
double float64_t
REAL64 in CANopen (0011h), double precision floating point value, 64-bit.
Definition: CO_driver.h:161
ODR_MAX_LESS_MIN
@ ODR_MAX_LESS_MIN
SDO abort 0x06090036 - Maximum value is less than minimum value.
Definition: CO_ODinterface.h:175
OD_getSDOabCode
uint32_t OD_getSDOabCode(ODR_t returnCode)
Get SDO abort code from returnCode.
Definition: CO_ODinterface.c:297
OD_entry_t::index
uint16_t index
Object Dictionary index.
Definition: CO_ODinterface.h:338
OD_H1007_SYNC_WINDOW_LEN
@ OD_H1007_SYNC_WINDOW_LEN
Sync windows length.
Definition: CO_ODinterface.h:64
OD_getIndex
static uint16_t OD_getIndex(const OD_entry_t *entry)
Return index from OD entry.
Definition: CO_ODinterface.h:421
OD_get_i32
ODR_t OD_get_i32(const OD_entry_t *entry, uint8_t subIndex, int32_t *val, bool_t odOrig)
Get int32_t variable from Object Dictionary, see OD_get_i8.
Definition: CO_ODinterface.c:388
float32_t
float float32_t
REAL32 in CANopen (0008h), single precision floating point value, 32-bit.
Definition: CO_driver.h:159
OD_H1600_RXPDO_1_MAPPING
@ OD_H1600_RXPDO_1_MAPPING
RXPDO mapping parameters.
Definition: CO_ODinterface.h:101
ODT_EREC
@ ODT_EREC
Same as ODT_REC, but extended with OD_obj_extended_t type.
Definition: CO_ODinterface.h:690
ODR_OD_MISSING
@ ODR_OD_MISSING
SDO abort 0x08000023 - Object dictionary not present.
Definition: CO_ODinterface.h:187
OD_getPtr_vs
ODR_t OD_getPtr_vs(const OD_entry_t *entry, uint8_t subIndex, char **val, OD_size_t *dataLength)
Get pointer to "visible string" variable from Object Dictionary.
Definition: CO_ODinterface.c:736
OD_get_u64
ODR_t OD_get_u64(const OD_entry_t *entry, uint8_t subIndex, uint64_t *val, bool_t odOrig)
Get uint64_t variable from Object Dictionary, see OD_get_i8.
Definition: CO_ODinterface.c:448
ODR_DATA_LONG
@ ODR_DATA_LONG
SDO abort 0x06070012 - Data type does not match, length too high.
Definition: CO_ODinterface.h:163
OD_objectTypes_t
OD_objectTypes_t
Types for OD object.
Definition: CO_ODinterface.h:664
ODR_SUB_NOT_EXIST
@ ODR_SUB_NOT_EXIST
SDO abort 0x06090011 - Sub index does not exist.
Definition: CO_ODinterface.h:167
OD_H1016_CONSUMER_HB_TIME
@ OD_H1016_CONSUMER_HB_TIME
Consumer heartbeat time.
Definition: CO_ODinterface.h:79
OD_writeOriginal
OD_size_t OD_writeOriginal(OD_stream_t *stream, uint8_t subIndex, const void *buf, OD_size_t count, ODR_t *returnCode)
Write value to original OD location.
Definition: CO_ODinterface.c:80
OD_entry_t::subEntriesCount
uint8_t subEntriesCount
Maximum sub-index in the OD object.
Definition: CO_ODinterface.h:340
OD_extensionIO_t::object
void * object
Object on which read and write will operate.
Definition: CO_ODinterface.h:736
OD_H1009_MANUF_HW_VERSION
@ OD_H1009_MANUF_HW_VERSION
Manufacturer hardware version.
Definition: CO_ODinterface.h:66
OD_H1011_REST_PARAM_FUNC
@ OD_H1011_REST_PARAM_FUNC
Restore default parameters.
Definition: CO_ODinterface.h:74
OD_H1381_SRDO_1_MAPPING
@ OD_H1381_SRDO_1_MAPPING
SRDO mapping parameter.
Definition: CO_ODinterface.h:97
OD_H1001_ERR_REG
@ OD_H1001_ERR_REG
Error register.
Definition: CO_ODinterface.h:58
ODR_UNSUPP_ACCESS
@ ODR_UNSUPP_ACCESS
SDO abort 0x06010000 - Unsupported access to an object.
Definition: CO_ODinterface.h:143
OD_getPtr_i16
ODR_t OD_getPtr_i16(const OD_entry_t *entry, uint8_t subIndex, int16_t **val)
Get pointer to int16_t variable from OD, see OD_getPtr_i8.
Definition: CO_ODinterface.c:619
OD_H1008_MANUF_DEV_NAME
@ OD_H1008_MANUF_DEV_NAME
Manufacturer device name.
Definition: CO_ODinterface.h:65
OD_get_u32
ODR_t OD_get_u32(const OD_entry_t *entry, uint8_t subIndex, uint32_t *val, bool_t odOrig)
Get uint32_t variable from Object Dictionary, see OD_get_i8.
Definition: CO_ODinterface.c:436
OD_subEntry_t::subIndex
uint8_t subIndex
Object Dictionary sub-index.
Definition: CO_ODinterface.h:205
OD_entry_t::odObjectType
uint8_t odObjectType
Type of the odObject, indicated by OD_objectTypes_t enumerator.
Definition: CO_ODinterface.h:342
OD_H100E_RSV
@ OD_H100E_RSV
Reserved.
Definition: CO_ODinterface.h:71
OD_obj_array_t::data0
uint8_t * data0
Pointer to data for sub-index 0.
Definition: CO_ODinterface.h:711
OD_H1400_RXPDO_1_PARAM
@ OD_H1400_RXPDO_1_PARAM
RXPDO communication parameter.
Definition: CO_ODinterface.h:100
ODR_DATA_TRANSF
@ ODR_DATA_TRANSF
SDO abort 0x08000020 - Data cannot be transferred or stored to app.
Definition: CO_ODinterface.h:181
OD_t::size
uint16_t size
Number of elements in the list, without last element, which is blank.
Definition: CO_ODinterface.h:354
OD_H1029_ERR_BEHAVIOR
@ OD_H1029_ERR_BEHAVIOR
Error behaviour.
Definition: CO_ODinterface.h:92
OD_getSub
ODR_t OD_getSub(const OD_entry_t *entry, uint8_t subIndex, OD_subEntry_t *subEntry, OD_IO_t *io, bool_t odOrig)
Find sub-object with specified sub-index on OD entry returned by OD_find.
Definition: CO_ODinterface.c:200
OD_H100D_LIFETIME_FACTOR
@ OD_H100D_LIFETIME_FACTOR
Life time factor.
Definition: CO_ODinterface.h:70
ODT_EARR
@ ODT_EARR
Same as ODT_ARR, but extended with OD_obj_extended_t type.
Definition: CO_ODinterface.h:688
OD_H1018_IDENTITY_OBJECT
@ OD_H1018_IDENTITY_OBJECT
Identity object.
Definition: CO_ODinterface.h:81
OD_flagsPDO_t
#define OD_flagsPDO_t
Type of flagsPDO variable from OD_subEntry_t.
Definition: CO_ODinterface.h:46
ODT_ARR
@ ODT_ARR
This type corresponds to CANopen Object Dictionary object with object code equal to ARRAY.
Definition: CO_ODinterface.h:675
OD_obj_record_t::dataLength
OD_size_t dataLength
Data length in bytes.
Definition: CO_ODinterface.h:727
OD_H1006_COMM_CYCL_PERIOD
@ OD_H1006_COMM_CYCL_PERIOD
Communication cycle period.
Definition: CO_ODinterface.h:63
OD_H13FF_SRDO_CHECKSUM
@ OD_H13FF_SRDO_CHECKSUM
SRDO configuration checksum.
Definition: CO_ODinterface.h:99
ODA_SDO_R
@ ODA_SDO_R
SDO server may read from the variable.
Definition: CO_ODinterface.h:111
ODR_MAP_LEN
@ ODR_MAP_LEN
SDO abort 0x06040042 - PDO length exceeded.
Definition: CO_ODinterface.h:153
OD_set_i16
ODR_t OD_set_i16(const OD_entry_t *entry, uint8_t subIndex, int16_t val, bool_t odOrig)
Set int16_t variable in Object Dictionary, see OD_set_i8.
Definition: CO_ODinterface.c:497
OD_H1013_HIGH_RES_TIMESTAMP
@ OD_H1013_HIGH_RES_TIMESTAMP
High resolution timestamp.
Definition: CO_ODinterface.h:76
OD_get_u8
ODR_t OD_get_u8(const OD_entry_t *entry, uint8_t subIndex, uint8_t *val, bool_t odOrig)
Get uint8_t variable from Object Dictionary, see OD_get_i8.
Definition: CO_ODinterface.c:412
OD_H1019_SYNC_CNT_OVERFLOW
@ OD_H1019_SYNC_CNT_OVERFLOW
Sync counter overflow value.
Definition: CO_ODinterface.h:82
OD_subEntry_t
Structure describing properties of a variable, located in specific index and sub-index inside the Obj...
Definition: CO_ODinterface.h:201
OD_H1023_OS_CMD
@ OD_H1023_OS_CMD
OS command.
Definition: CO_ODinterface.h:86
ODR_TYPE_MISMATCH
@ ODR_TYPE_MISMATCH
SDO abort 0x06070010 - Data type does not match.
Definition: CO_ODinterface.h:161
OD_obj_record_t::subIndex
uint8_t subIndex
Sub index of element.
Definition: CO_ODinterface.h:725
OD_obj_array_t
Object for OD array of variables, used for "ARRAY" type OD objects.
Definition: CO_ODinterface.h:710
OD_H1025_OS_DBG_INTERFACE
@ OD_H1025_OS_DBG_INTERFACE
OS debug interface.
Definition: CO_ODinterface.h:88
ODR_HW
@ ODR_HW
SDO abort 0x06060000 - Access failed due to hardware error.
Definition: CO_ODinterface.h:159
OD_H1800_TXPDO_1_PARAM
@ OD_H1800_TXPDO_1_PARAM
TXPDO communication parameter.
Definition: CO_ODinterface.h:102
OD_obj_extended_t
Object for extended type of OD variable, configurable by OD_extensionIO_init() function.
Definition: CO_ODinterface.h:749
int16_t
signed int int16_t
INTEGER16 in CANopen (0003h), 16-bit signed integer.
Definition: CO_driver.h:145
OD_stream_t
IO stream structure, used for read/write access to OD variable, part of OD_IO_t.
Definition: CO_ODinterface.h:240
ODA_TSRDO
@ ODA_TSRDO
Variable is mappable into transmitting SRDO.
Definition: CO_ODinterface.h:117
OD_H1300_GFC_PARAM
@ OD_H1300_GFC_PARAM
Global fail-safe command param.
Definition: CO_ODinterface.h:95
OD_get_r64
ODR_t OD_get_r64(const OD_entry_t *entry, uint8_t subIndex, float64_t *val, bool_t odOrig)
Get float64_t variable from Object Dictionary, see OD_get_i8.
Definition: CO_ODinterface.c:472
ODR_OK
@ ODR_OK
SDO abort 0x00000000 - Read/write successfully finished.
Definition: CO_ODinterface.h:139
ODR_t
ODR_t
Return codes from OD access functions.
Definition: CO_ODinterface.h:132
OD_t
Object Dictionary.
Definition: CO_ODinterface.h:352
OD_obj_var_t::dataLength
OD_size_t dataLength
Data length in bytes.
Definition: CO_ODinterface.h:704
ODA_TPDO
@ ODA_TPDO
Variable is mappable into TPDO (can be read)
Definition: CO_ODinterface.h:114
OD_attributes_t
OD_attributes_t
Attributes (bit masks) for OD sub-object.
Definition: CO_ODinterface.h:110
ODR_WRITEONLY
@ ODR_WRITEONLY
SDO abort 0x06010001 - Attempt to read a write only object.
Definition: CO_ODinterface.h:145
OD_getPtr_u8
ODR_t OD_getPtr_u8(const OD_entry_t *entry, uint8_t subIndex, uint8_t **val)
Get pointer to uint8_t variable from OD, see OD_getPtr_i8.
Definition: CO_ODinterface.c:658
OD_set_u16
ODR_t OD_set_u16(const OD_entry_t *entry, uint8_t subIndex, uint16_t val, bool_t odOrig)
Set uint16_t variable in Object Dictionary, see OD_set_i8.
Definition: CO_ODinterface.c:545
OD_H1A00_TXPDO_1_MAPPING
@ OD_H1A00_TXPDO_1_MAPPING
TXPDO mapping parameters.
Definition: CO_ODinterface.h:103
OD_set_u32
ODR_t OD_set_u32(const OD_entry_t *entry, uint8_t subIndex, uint32_t val, bool_t odOrig)
Set uint32_t variable in Object Dictionary, see OD_set_i8.
Definition: CO_ODinterface.c:557
ODA_STR
@ ODA_STR
Shorter value, than specified variable size, may be written to the variable.
Definition: CO_ODinterface.h:121
ODA_SDO_RW
@ ODA_SDO_RW
SDO server may read from or write to the variable.
Definition: CO_ODinterface.h:113
OD_IO_t
Structure for input / output on the OD variable.
Definition: CO_ODinterface.h:263
OD_H1028_EMCY_CONSUMER
@ OD_H1028_EMCY_CONSUMER
Emergency consumer object.
Definition: CO_ODinterface.h:91
OD_obj_record_t
Object for OD sub-elements, used in "RECORD" type OD objects.
Definition: CO_ODinterface.h:723
OD_set_i8
ODR_t OD_set_i8(const OD_entry_t *entry, uint8_t subIndex, int8_t val, bool_t odOrig)
Set int8_t variable in Object Dictionary.
Definition: CO_ODinterface.c:485
OD_H1012_COBID_TIME
@ OD_H1012_COBID_TIME
Timestamp message cob-id.
Definition: CO_ODinterface.h:75
OD_obj_extended_t::extIO
OD_extensionIO_t * extIO
Pointer to application specified IO extension, may be NULL.
Definition: CO_ODinterface.h:751
ODR_COUNT
@ ODR_COUNT
Last element, number of responses.
Definition: CO_ODinterface.h:191
OD_obj_array_t::attribute
OD_attr_t attribute
Attribute bitfield for array elements.
Definition: CO_ODinterface.h:715
OD_entry_t
Object Dictionary entry for one OD object.
Definition: CO_ODinterface.h:336
OD_subEntry_t::index
uint16_t index
Object Dictionary index.
Definition: CO_ODinterface.h:203
OD_H1024_OS_CMD_MODE
@ OD_H1024_OS_CMD_MODE
OS command mode.
Definition: CO_ODinterface.h:87
OD_H1027_MODULE_LIST
@ OD_H1027_MODULE_LIST
Module list.
Definition: CO_ODinterface.h:90
OD_obj_extended_t::flagsPDO
OD_flagsPDO_t * flagsPDO
Pointer to PDO flags bit-field, see OD_subEntry_t, may be NULL.
Definition: CO_ODinterface.h:753
ODR_DATA_LOC_CTRL
@ ODR_DATA_LOC_CTRL
SDO abort 0x08000021 - Data can't be transferred (local control)
Definition: CO_ODinterface.h:183
OD_get_i16
ODR_t OD_get_i16(const OD_entry_t *entry, uint8_t subIndex, int16_t *val, bool_t odOrig)
Get int16_t variable from Object Dictionary, see OD_get_i8.
Definition: CO_ODinterface.c:376
OD_getPtr_u32
ODR_t OD_getPtr_u32(const OD_entry_t *entry, uint8_t subIndex, uint32_t **val)
Get pointer to uint32_t variable from OD, see OD_getPtr_i8.
Definition: CO_ODinterface.c:684
OD_obj_array_t::data
void * data
Pointer to array of data.
Definition: CO_ODinterface.h:712
OD_obj_extended_t::odObjectOriginal
const void * odObjectOriginal
Pointer to original odObject, see OD_entry_t.
Definition: CO_ODinterface.h:755
OD_getPtr_r32
ODR_t OD_getPtr_r32(const OD_entry_t *entry, uint8_t subIndex, float32_t **val)
Get pointer to float32_t variable from OD, see OD_getPtr_i8.
Definition: CO_ODinterface.c:710
ODA_RPDO
@ ODA_RPDO
Variable is mappable into RPDO (can be written)
Definition: CO_ODinterface.h:115
OD_obj_var_t::attribute
OD_attr_t attribute
Attribute bitfield, see OD_attributes_t.
Definition: CO_ODinterface.h:703
OD_H1022_STORE_FORMAT
@ OD_H1022_STORE_FORMAT
Store format.
Definition: CO_ODinterface.h:85
OD_H1004_RSV
@ OD_H1004_RSV
Reserved.
Definition: CO_ODinterface.h:61
ODR_NO_DATA
@ ODR_NO_DATA
SDO abort 0x08000024 - No data available.
Definition: CO_ODinterface.h:189
OD_readOriginal
OD_size_t OD_readOriginal(OD_stream_t *stream, uint8_t subIndex, void *buf, OD_size_t count, ODR_t *returnCode)
Read value from original OD location.
Definition: CO_ODinterface.c:31
OD_obj_array_t::attribute0
OD_attr_t attribute0
Attribute bitfield for sub-index 0, see OD_attributes_t.
Definition: CO_ODinterface.h:713
ODR_DATA_SHORT
@ ODR_DATA_SHORT
SDO abort 0x06070013 - Data type does not match, length too short.
Definition: CO_ODinterface.h:165
OD_H1021_STORE_EDS
@ OD_H1021_STORE_EDS
Store EDS.
Definition: CO_ODinterface.h:84
uint8_t
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition: CO_driver.h:151
OD_size_t
#define OD_size_t
Variable of type OD_size_t contains data length in bytes of OD variable.
Definition: CO_ODinterface.h:44
OD_set_r64
ODR_t OD_set_r64(const OD_entry_t *entry, uint8_t subIndex, float64_t val, bool_t odOrig)
Set float64_t variable in Object Dictionary, see OD_set_i8.
Definition: CO_ODinterface.c:593
OD_H100C_GUARD_TIME
@ OD_H100C_GUARD_TIME
Guard time.
Definition: CO_ODinterface.h:69
OD_attr_t
#define OD_attr_t
Size of Object Dictionary attribute.
Definition: CO_ODinterface.h:50
OD_obj_var_t::data
void * data
Pointer to data.
Definition: CO_ODinterface.h:702