Modules | |
Getters and setters | |
Getter and setter helper functions for accessing different types of Object Dictionary variables. | |
OD definition objects | |
Types and functions used only for definition of Object Dictionary. | |
Files | |
file | CO_ODinterface.h |
CANopen Object Dictionary interface. | |
Data Structures | |
struct | OD_subEntry_t |
Structure describing properties of a variable, located in specific index and sub-index inside the Object Dictionary. More... | |
struct | OD_stream_t |
IO stream structure, used for read/write access to OD variable, part of OD_IO_t. More... | |
struct | OD_IO_t |
Structure for input / output on the OD variable. More... | |
struct | OD_entry_t |
Object Dictionary entry for one OD object. More... | |
struct | OD_t |
Object Dictionary. More... | |
Macros | |
#define | OD_size_t uint32_t |
Variable of type OD_size_t contains data length in bytes of OD variable. | |
#define | OD_flagsPDO_t uint32_t |
Type of flagsPDO variable from OD_subEntry_t. | |
#define | OD_attr_t uint8_t |
Size of Object Dictionary attribute. | |
Functions | |
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. More... | |
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. More... | |
const OD_entry_t * | OD_find (const OD_t *od, uint16_t index) |
Find OD entry in Object Dictionary. More... | |
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. More... | |
static uint16_t | OD_getIndex (const OD_entry_t *entry) |
Return index from OD entry. More... | |
static void | OD_rwRestart (OD_stream_t *stream) |
Restart read or write operation on OD variable. More... | |
uint32_t | OD_getSDOabCode (ODR_t returnCode) |
Get SDO abort code from returnCode. More... | |
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. More... | |
enum OD_ObjDicId_30x_t |
Common DS301 object dictionary entries.
enum OD_attributes_t |
Attributes (bit masks) for OD sub-object.
enum ODR_t |
Return codes from OD access functions.
OD_getSDOabCode() can be used to retrieve corresponding SDO abort code.
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.
This function can be used inside read / write functions, specified by OD_extensionIO_init(). It reads data directly from memory location specified by Object dictionary. If no IO extension is used on OD entry, then io->read returned by OD_getSub() equals to this function. See also OD_IO_t.
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.
This function can be used inside read / write functions, specified by OD_extensionIO_init(). It writes data directly to memory location specified by Object dictionary. If no IO extension is used on OD entry, then io->write returned by OD_getSub() equals to this function. See also OD_IO_t.
const OD_entry_t* OD_find | ( | const OD_t * | od, |
uint16_t | index | ||
) |
Find OD entry in Object Dictionary.
od | Object Dictionary |
index | CANopen Object Dictionary index of object in Object Dictionary |
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.
Function populates subEntry and io structures with sub-object data.
entry | OD entry returned by OD_find(). | |
subIndex | Sub-index of the variable from the OD object. | |
[out] | subEntry | Structure will be populated on success, may be NULL. |
[out] | io | Structure will be populated on success. |
odOrig | If true, then potential IO extension on entry will be ignored and access to data entry in the original OD location will be returned |
|
inlinestatic |
|
inlinestatic |
Restart read or write operation on OD variable.
It is not necessary to call this function, if stream was initialised by OD_getSub(). It is also not necessary to call this function, if prevous read or write was successfully finished.
stream | Object Dictionary stream object. |
Get SDO abort code from returnCode.
returnCode | Returned from some OD access functions |
ODR_t OD_extensionIO_init | ( | const OD_entry_t * | entry, |
void * | object, | ||
OD_size_t(*)(OD_stream_t *stream, uint8_t subIndex, void *buf, OD_size_t count, ODR_t *returnCode) | read, | ||
OD_size_t(*)(OD_stream_t *stream, uint8_t subIndex, const void *buf, OD_size_t count, ODR_t *returnCode) | write | ||
) |
Initialise extended OD object with own read/write functions.
This function works on OD object, which has IO extension enabled. It gives application very powerful tool: definition of own IO access on own OD object. Structure and attributes are the same as defined in original OD object, but data are read directly from (or written directly to) application specified object via custom function calls.
If this function is not called yet, then normal access ("odOrig" argument is false) to OD entry is disabled.
entry | OD entry returned by OD_find(). |
object | Object, which will be passed to read or write function. |
read | Read function pointer. If NULL, then read will be disabled. OD_readOriginal can be used here to keep original read function. For function description see OD_IO_t. |
write | Write function pointer. If NULL, then write will be disabled. OD_writeOriginal can be used here to keep original write function. For function description see OD_IO_t. |