30#define CO_CONFIG_PDO \
31 (CO_CONFIG_RPDO_ENABLE | CO_CONFIG_TPDO_ENABLE | CO_CONFIG_RPDO_TIMERS_ENABLE | CO_CONFIG_TPDO_TIMERS_ENABLE \
32 | CO_CONFIG_PDO_SYNC_ENABLE | CO_CONFIG_PDO_OD_IO_ACCESS | CO_CONFIG_GLOBAL_RT_FLAG_CALLBACK_PRE \
33 | CO_CONFIG_GLOBAL_FLAG_TIMERNEXT | CO_CONFIG_GLOBAL_FLAG_OD_DYNAMIC)
36#if (((CO_CONFIG_PDO) & (CO_CONFIG_RPDO_ENABLE | CO_CONFIG_TPDO_ENABLE)) != 0) || defined CO_DOXYGEN
107#ifndef CO_PDO_MAX_SIZE
108#define CO_PDO_MAX_SIZE 8U
112#ifndef CO_PDO_MAX_MAPPED_ENTRIES
113#define CO_PDO_MAX_MAPPED_ENTRIES 8U
121#ifndef CO_RPDO_DEFAULT_CANID_COUNT
122#define CO_RPDO_DEFAULT_CANID_COUNT 4U
128#ifndef CO_TPDO_DEFAULT_CANID_COUNT
129#define CO_TPDO_DEFAULT_CANID_COUNT 4U
132#ifndef CO_PDO_OWN_TYPES
158#if (((CO_CONFIG_PDO)&CO_CONFIG_PDO_OD_IO_ACCESS) != 0) || defined CO_DOXYGEN
166#if OD_FLAGS_PDO_SIZE > 0
174#if OD_FLAGS_PDO_SIZE > 0
179#if (((CO_CONFIG_PDO)&CO_CONFIG_FLAG_OD_DYNAMIC) != 0) || defined CO_DOXYGEN
193#if (((CO_CONFIG_PDO)&CO_CONFIG_RPDO_ENABLE) != 0) || defined CO_DOXYGEN
197#if (((CO_CONFIG_PDO)&CO_CONFIG_PDO_SYNC_ENABLE) != 0) || defined CO_DOXYGEN
198#define CO_RPDO_CAN_BUFFERS_COUNT 2
200#define CO_RPDO_CAN_BUFFERS_COUNT 1
212#if (((CO_CONFIG_PDO)&CO_CONFIG_PDO_SYNC_ENABLE) != 0) || defined CO_DOXYGEN
216#if (((CO_CONFIG_PDO)&CO_CONFIG_RPDO_TIMERS_ENABLE) != 0) || defined CO_DOXYGEN
221#if (((CO_CONFIG_PDO)&CO_CONFIG_FLAG_CALLBACK_PRE) != 0) || defined CO_DOXYGEN
222 void (*pFunctSignalPre)(
void* object);
248#
if (((CO_CONFIG_PDO)&CO_CONFIG_PDO_SYNC_ENABLE) != 0) || defined CO_DOXYGEN
254#if (((CO_CONFIG_PDO)&CO_CONFIG_FLAG_CALLBACK_PRE) != 0) || defined CO_DOXYGEN
282#
if (((CO_CONFIG_PDO)&CO_CONFIG_RPDO_TIMERS_ENABLE) != 0) || defined CO_DOXYGEN
291#if (((CO_CONFIG_PDO)&CO_CONFIG_TPDO_ENABLE) != 0) || defined CO_DOXYGEN
301#if (((CO_CONFIG_PDO)&CO_CONFIG_PDO_SYNC_ENABLE) != 0) || defined CO_DOXYGEN
306#if (((CO_CONFIG_PDO)&CO_CONFIG_TPDO_TIMERS_ENABLE) != 0) || defined CO_DOXYGEN
335#
if (((CO_CONFIG_PDO)&CO_CONFIG_PDO_SYNC_ENABLE) != 0) || defined CO_DOXYGEN
368#
if (((CO_CONFIG_PDO)&CO_CONFIG_TPDO_TIMERS_ENABLE) != 0) || defined CO_DOXYGEN
CANopen Emergency protocol.
CANopen Object Dictionary interface.
CANopen Synchronisation protocol.
CO_PDO_transmissionTypes_t
PDO transmission Types.
Definition CO_PDO.h:140
#define CO_PDO_MAX_SIZE
Maximum size of PDO message, 8 for standard CAN.
Definition CO_PDO.h:108
CO_ReturnError_t CO_RPDO_init(CO_RPDO_t *RPDO, OD_t *OD, CO_EM_t *em, CO_SYNC_t *SYNC, uint16_t preDefinedCanId, OD_entry_t *OD_14xx_RPDOCommPar, OD_entry_t *OD_16xx_RPDOMapPar, CO_CANmodule_t *CANdevRx, uint16_t CANdevRxIdx, uint32_t *errInfo)
Initialize RPDO object.
void CO_TPDO_process(CO_TPDO_t *TPDO, uint32_t timeDifference_us, uint32_t *timerNext_us, bool_t NMTisOperational, bool_t syncWas)
Process transmitting PDO messages.
void CO_RPDO_initCallbackPre(CO_RPDO_t *RPDO, void *object, void(*pFunctSignalPre)(void *object))
Initialize RPDO callback function.
static void CO_TPDOsendRequest(CO_TPDO_t *TPDO)
Request transmission of TPDO message.
Definition CO_PDO.h:350
CO_ReturnError_t CO_TPDO_init(CO_TPDO_t *TPDO, OD_t *OD, CO_EM_t *em, CO_SYNC_t *SYNC, uint16_t preDefinedCanId, OD_entry_t *OD_18xx_TPDOCommPar, OD_entry_t *OD_1Axx_TPDOMapPar, CO_CANmodule_t *CANdevTx, uint16_t CANdevTxIdx, uint32_t *errInfo)
Initialize TPDO object.
#define CO_PDO_MAX_MAPPED_ENTRIES
Maximum number of entries, which can be mapped to PDO, 8 for standard CAN, may be less to preserve RA...
Definition CO_PDO.h:113
uint8_t CO_PDO_size_t
Variable of type CO_PDO_size_t contains data length in bytes of PDO.
Definition CO_PDO.h:134
void CO_RPDO_process(CO_RPDO_t *RPDO, uint32_t timeDifference_us, uint32_t *timerNext_us, bool_t NMTisOperational, bool_t syncWas)
Process received PDO messages.
#define CO_RPDO_CAN_BUFFERS_COUNT
Number of buffers for received CAN message for RPDO.
Definition CO_PDO.h:198
@ CO_PDO_TRANSM_TYPE_SYNC_EVENT_HI
event-driven, higher value (device profile and application profile specific)
Definition CO_PDO.h:145
@ CO_PDO_TRANSM_TYPE_SYNC_ACYCLIC
synchronous (acyclic)
Definition CO_PDO.h:141
@ CO_PDO_TRANSM_TYPE_SYNC_1
synchronous (cyclic every sync)
Definition CO_PDO.h:142
@ CO_PDO_TRANSM_TYPE_SYNC_EVENT_LO
event-driven, lower value (manufacturer specific),
Definition CO_PDO.h:144
@ CO_PDO_TRANSM_TYPE_SYNC_240
synchronous (cyclic every 240-th sync)
Definition CO_PDO.h:143
#define NULL
NULL, for general usage.
Definition CO_driver.h:123
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition CO_driver.h:132
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition CO_driver.h:133
uint_fast8_t bool_t
Boolean data type for general use.
Definition CO_driver.h:126
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition CO_driver.h:131
CO_ReturnError_t
Return values of some CANopen functions.
Definition CO_driver.h:449
Complete CAN module object.
Definition CO_driver.h:268
Configuration object for CAN transmit message for specific CANopenNode Object.
Definition CO_driver.h:250
Emergency object.
Definition CO_Emergency.h:259
PDO object, common properties.
Definition CO_PDO.h:152
CO_CANmodule_t * CANdev
From CO_xPDO_init()
Definition CO_PDO.h:154
bool_t isRPDO
True for RPDO, false for TPDO.
Definition CO_PDO.h:180
OD_extension_t OD_communicationParam_ext
Extension for OD object.
Definition CO_PDO.h:185
uint16_t configuredCanId
Currently configured CAN identifier.
Definition CO_PDO.h:184
CO_PDO_size_t dataLength
Data length of the received PDO message.
Definition CO_PDO.h:156
OD_t * OD
From CO_xPDO_init()
Definition CO_PDO.h:181
uint8_t mappedObjectsCount
Number of mapped objects in PDO.
Definition CO_PDO.h:157
OD_extension_t OD_mappingParam_extension
Extension for OD object.
Definition CO_PDO.h:186
uint16_t preDefinedCanId
From CO_xPDO_init()
Definition CO_PDO.h:183
bool_t valid
True, if PDO is enabled and valid.
Definition CO_PDO.h:155
CO_EM_t * em
From CO_xPDO_init()
Definition CO_PDO.h:153
uint16_t CANdevIdx
From CO_xPDO_init()
Definition CO_PDO.h:182
RPDO object.
Definition CO_PDO.h:206
bool_t synchronous
True if transmissionType <= 240.
Definition CO_PDO.h:214
uint8_t receiveError
Indication of RPDO length errors, use with CO_PDO_receiveErrors_t.
Definition CO_PDO.h:211
CO_SYNC_t * SYNC
From CO_RPDO_init()
Definition CO_PDO.h:213
uint32_t timeoutTime_us
Maximum timeout time between received PDOs in microseconds.
Definition CO_PDO.h:217
uint32_t timeoutTimer
Timeout timer variable in microseconds.
Definition CO_PDO.h:219
CO_PDO_common_t PDO_common
PDO common properties, must be first element in this object.
Definition CO_PDO.h:207
void * functSignalObjectPre
From CO_RPDO_initCallbackPre() or NULL.
Definition CO_PDO.h:223
SYNC producer and consumer object.
Definition CO_SYNC.h:67
TPDO object.
Definition CO_PDO.h:295
uint8_t syncStartValue
Copy of the variable from object dictionary.
Definition CO_PDO.h:303
CO_CANtx_t * CANtxBuff
CAN transmit buffer inside CANdev.
Definition CO_PDO.h:297
uint8_t transmissionType
Copy of the variable from object dictionary.
Definition CO_PDO.h:298
uint32_t eventTime_us
Event time from object dictionary translated to microseconds.
Definition CO_PDO.h:308
uint8_t syncCounter
SYNC counter used for PDO sending.
Definition CO_PDO.h:304
CO_PDO_common_t PDO_common
PDO common properties, must be first element in this object.
Definition CO_PDO.h:296
uint32_t inhibitTimer
Inhibit timer variable in microseconds.
Definition CO_PDO.h:309
bool_t sendRequest
If this flag is set and TPDO is event driven (transmission type is 0, 254 or 255),...
Definition CO_PDO.h:299
uint32_t inhibitTime_us
Inhibit time from object dictionary translated to microseconds.
Definition CO_PDO.h:307
CO_SYNC_t * SYNC
From CO_TPDO_init()
Definition CO_PDO.h:302
uint32_t eventTimer
Event timer variable in microseconds.
Definition CO_PDO.h:310
Structure for input / output on the OD variable.
Definition CO_ODinterface.h:181
Object Dictionary entry for one OD object.
Definition CO_ODinterface.h:272
Extension of OD object, which can optionally be specified by application in initialization phase with...
Definition CO_ODinterface.h:245
Object Dictionary.
Definition CO_ODinterface.h:284