161#define CO_MULTIPLE_OD
170#define CO_USE_GLOBALS
173#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
242#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
248#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
253#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
258#if (((CO_CONFIG_HB_CONS)&CO_CONFIG_HB_CONS_ENABLE) != 0) || defined CO_DOXYGEN
261#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
265#if (((CO_CONFIG_NODE_GUARDING)&CO_CONFIG_NODE_GUARDING_SLAVE_ENABLE) != 0) || defined CO_DOXYGEN
267#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
272#if (((CO_CONFIG_NODE_GUARDING)&CO_CONFIG_NODE_GUARDING_MASTER_ENABLE) != 0) || defined CO_DOXYGEN
275#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
281#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
285#if (((CO_CONFIG_EM) & (CO_CONFIG_EM_PRODUCER | CO_CONFIG_EM_HISTORY)) != 0) || defined CO_DOXYGEN
289#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
293#if (((CO_CONFIG_SDO_CLI)&CO_CONFIG_SDO_CLI_ENABLE) != 0) || defined CO_DOXYGEN
295#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
300#if (((CO_CONFIG_TIME)&CO_CONFIG_TIME_ENABLE) != 0) || defined CO_DOXYGEN
302#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
307#if (((CO_CONFIG_SYNC)&CO_CONFIG_SYNC_ENABLE) != 0) || defined CO_DOXYGEN
309#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
314#if (((CO_CONFIG_PDO)&CO_CONFIG_RPDO_ENABLE) != 0) || defined CO_DOXYGEN
316#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
320#if (((CO_CONFIG_PDO)&CO_CONFIG_TPDO_ENABLE) != 0) || defined CO_DOXYGEN
322#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
326#if (((CO_CONFIG_LEDS)&CO_CONFIG_LEDS_ENABLE) != 0) || defined CO_DOXYGEN
329#if (((CO_CONFIG_GFC)&CO_CONFIG_GFC_ENABLE) != 0) || defined CO_DOXYGEN
331#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
336#if (((CO_CONFIG_SRDO)&CO_CONFIG_SRDO_ENABLE) != 0) || defined CO_DOXYGEN
340#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
345#if (((CO_CONFIG_LSS)&CO_CONFIG_LSS_SLAVE) != 0) || defined CO_DOXYGEN
347#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
352#if (((CO_CONFIG_LSS)&CO_CONFIG_LSS_MASTER) != 0) || defined CO_DOXYGEN
354#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
359#if (((CO_CONFIG_GTW)&CO_CONFIG_GTW_ASCII) != 0) || defined CO_DOXYGEN
361#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
364#if ((CO_CONFIG_TRACE)&CO_CONFIG_TRACE_ENABLE) || defined CO_DOXYGEN
414#if (((CO_CONFIG_LSS)&CO_CONFIG_LSS_SLAVE) != 0) || defined CO_DOXYGEN
496#if (((CO_CONFIG_GFC)&CO_CONFIG_GFC_ENABLE) != 0) || (((CO_CONFIG_SRDO)&CO_CONFIG_SRDO_ENABLE) != 0) \
497 || defined CO_DOXYGEN
520#if (((CO_CONFIG_SYNC)&CO_CONFIG_SYNC_ENABLE) != 0) || defined CO_DOXYGEN
536#if (((CO_CONFIG_PDO)&CO_CONFIG_RPDO_ENABLE) != 0) || defined CO_DOXYGEN
551#if (((CO_CONFIG_PDO)&CO_CONFIG_TPDO_ENABLE) != 0) || defined CO_DOXYGEN
566#if (((CO_CONFIG_SRDO)&CO_CONFIG_SRDO_ENABLE) != 0) || defined CO_DOXYGEN
CANopen Emergency protocol.
CANopen Global fail-safe command protocol.
CANopen Heartbeat consumer protocol.
CANopen Indicator specification (CiA 303-3 v1.4.0)
CANopen Layer Setting Service - master protocol.
CANopen Layer Setting Service - slave protocol.
CANopen Network management and Heartbeat producer protocol.
CANopen Node Guarding slave and master objects.
CANopen Object Dictionary interface.
CANopen Process Data Object protocol.
CANopen Service Data Object - client protocol.
CANopen Service Data Object - server protocol.
CANopen Safety Related Data Object protocol.
CANopen Synchronisation protocol.
CANopen Time-stamp protocol.
Interface between CAN hardware and CANopenNode.
CANopen access from other networks - ASCII mapping (CiA 309-3 DS v3.0.0)
CANopen trace object for recording variables over time.
CO_ReturnError_t CO_LSSinit(CO_t *co, CO_LSS_address_t *lssAddress, uint8_t *pendingNodeID, uint16_t *pendingBitRate)
Initialize CANopen LSS slave.
void CO_process_RPDO(CO_t *co, bool_t syncWas, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process CANopen RPDO objects.
CO_SRDO_state_t CO_process_SRDO(CO_t *co, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process CANopen SRDO objects.
CO_ReturnError_t CO_CANopenInitSRDO(CO_t *co, CO_EM_t *em, OD_t *od, uint8_t nodeId, uint32_t *errInfo)
Initialize Safety related Data Objects.
bool_t CO_isLSSslaveEnabled(CO_t *co)
Test if LSS slave is enabled.
CO_ReturnError_t CO_CANinit(CO_t *co, void *CANptr, uint16_t bitRate)
Initialize CAN driver.
void CO_delete(CO_t *co)
Delete CANopen object and free memory.
CO_NMT_reset_cmd_t CO_process(CO_t *co, bool_t enableGateway, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process CANopen objects.
void CO_process_TPDO(CO_t *co, bool_t syncWas, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process CANopen TPDO objects.
CO_ReturnError_t CO_CANopenInit(CO_t *co, CO_NMT_t *NMT, CO_EM_t *em, OD_t *od, OD_entry_t *OD_statusBits, uint16_t NMTcontrol, uint16_t firstHBTime_ms, uint16_t SDOserverTimeoutTime_ms, uint16_t SDOclientTimeoutTime_ms, bool_t SDOclientBlockTransfer, uint8_t nodeId, uint32_t *errInfo)
Initialize CANopenNode except PDO objects.
bool_t CO_process_SYNC(CO_t *co, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process CANopen SYNC objects.
CO_ReturnError_t CO_CANopenInitPDO(CO_t *co, CO_EM_t *em, OD_t *od, uint8_t nodeId, uint32_t *errInfo)
Initialize CANopenNode PDO objects.
CO_t * CO_new(CO_config_t *config, uint32_t *heapMemoryUsed)
Create new CANopen object.
CO_NMT_reset_cmd_t
Return code from CO_NMT_process() that tells application code what to reset.
Definition CO_NMT_Heartbeat.h:93
CO_SRDO_state_t
SRDO internal state.
Definition CO_SRDO.h:93
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 received message for specific CANopenNode Object.
Definition CO_driver.h:218
Configuration object for CAN transmit message for specific CANopenNode Object.
Definition CO_driver.h:250
Fifo buffer for emergency producer and error history.
Definition CO_Emergency.h:248
Emergency object.
Definition CO_Emergency.h:259
GFC object.
Definition CO_GFC.h:53
CANopen Gateway-ascii object.
Definition CO_gateway_ascii.h:228
One monitored node inside CO_HBconsumer_t.
Definition CO_HBconsumer.h:72
Heartbeat consumer object.
Definition CO_HBconsumer.h:109
LEDs object, initialized by CO_LEDs_init()
Definition CO_LEDs.h:90
LSS master object.
Definition CO_LSSmaster.h:95
LSS slave object.
Definition CO_LSSslave.h:76
NMT consumer and Heartbeat producer object.
Definition CO_NMT_Heartbeat.h:136
RPDO object.
Definition CO_PDO.h:206
SDO client object.
Definition CO_SDOclient.h:151
SDO server object.
Definition CO_SDOserver.h:359
Guard Object for SRDO.
Definition CO_SRDO.h:118
SRDO object.
Definition CO_SRDO.h:133
SYNC producer and consumer object.
Definition CO_SYNC.h:67
TIME producer and consumer object.
Definition CO_TIME.h:67
TPDO object.
Definition CO_PDO.h:295
CANopen configuration, used with CO_new()
Definition CANopen.h:180
uint8_t CNT_HB_CONS
Number of Heartbeat consumer objects, 0 or 1.
Definition CANopen.h:185
uint8_t CNT_LSS_SLV
Number of LSSslave objects, 0 or 1 (CANrx + CANtx).
Definition CANopen.h:228
OD_entry_t * ENTRY_H1017
OD entry for CO_NMT_init()
Definition CANopen.h:184
OD_entry_t * ENTRY_H1014
OD entry for CO_EM_init()
Definition CANopen.h:193
uint8_t CNT_ARR_1003
Size of the fifo buffer, which is used for intermediate storage of emergency messages.
Definition CANopen.h:195
OD_entry_t * ENTRY_H1016
OD entry for CO_HBconsumer_init()
Definition CANopen.h:187
uint16_t CNT_TPDO
Number of TPDO objects, from 0 to 512 producers (CANtx)
Definition CANopen.h:217
uint8_t CNT_SDO_CLI
Number of SDO client objects, from 0 to 128 (CANrx + CANtx).
Definition CANopen.h:203
OD_entry_t * ENTRY_H1006
OD entry for CO_SYNC_init()
Definition CANopen.h:211
OD_entry_t * ENTRY_H1300
OD entry for CO_GFC_init()
Definition CANopen.h:222
OD_entry_t * ENTRY_H1005
OD entry for CO_SYNC_init()
Definition CANopen.h:210
OD_entry_t * ENTRY_H1381
OD entry for CO_SRDO_init()
Definition CANopen.h:225
OD_entry_t * ENTRY_H13FE
OD entry for CO_SRDO_init()
Definition CANopen.h:226
OD_entry_t * ENTRY_H13FF
OD entry for CO_SRDO_init()
Definition CANopen.h:227
uint8_t CNT_EM
Number of Emergency objects, 0 or 1: optional producer (CANtx) + optional consumer (CANrx),...
Definition CANopen.h:190
OD_entry_t * ENTRY_H1200
OD entry for CO_SDOserver_init()
Definition CANopen.h:202
OD_entry_t * ENTRY_H1007
OD entry for CO_SYNC_init()
Definition CANopen.h:212
OD_entry_t * ENTRY_H1012
OD entry for CO_TIME_init()
Definition CANopen.h:207
uint8_t CNT_LEDS
Number of LEDs objects, 0 or 1.
Definition CANopen.h:220
uint8_t CNT_GTWA
Number of gateway ascii objects, 0 or 1.
Definition CANopen.h:230
OD_entry_t * ENTRY_H1280
OD entry for CO_SDOclient_init()
Definition CANopen.h:204
const OD_entry_t * ENTRY_H1001
OD entry for CO_EM_init()
Definition CANopen.h:192
OD_entry_t * ENTRY_H1003
OD entry for CO_EM_init()
Definition CANopen.h:199
OD_entry_t * ENTRY_H1301
OD entry for CO_SRDO_init()
Definition CANopen.h:224
uint16_t CNT_RPDO
Number of RPDO objects, from 0 to 512 consumers (CANrx)
Definition CANopen.h:214
OD_entry_t * ENTRY_H1015
OD entry for CO_EM_init()
Definition CANopen.h:194
OD_entry_t * ENTRY_H1A00
OD entry for CO_TPDO_init()
Definition CANopen.h:219
OD_entry_t * ENTRY_H1400
OD entry for CO_RPDO_init()
Definition CANopen.h:215
uint8_t CNT_ARR_1016
Number of internal consumers (CANrx), used inside Heartbeat consumer object, 1 to 127.
Definition CANopen.h:186
uint16_t CNT_TRACE
Number of trace objects, 0 or more.
Definition CANopen.h:231
uint8_t CNT_SDO_SRV
Number of SDO server objects, from 0 to 128 (CANrx + CANtx).
Definition CANopen.h:200
OD_entry_t * ENTRY_H1600
OD entry for CO_RPDO_init()
Definition CANopen.h:216
uint8_t CNT_LSS_MST
Number of LSSmaster objects, 0 or 1 (CANrx + CANtx).
Definition CANopen.h:229
OD_entry_t * ENTRY_H100C
OD entry for CO_nodeGuardingSlave_init()
Definition CANopen.h:188
uint8_t CNT_TIME
Number of TIME objects, 0 or 1: consumer (CANrx) + optional producer (CANtx), configurable by CO_CONF...
Definition CANopen.h:205
uint8_t CNT_GFC
Number of GFC objects, 0 or 1 (CANrx + CANtx).
Definition CANopen.h:221
OD_entry_t * ENTRY_H1800
OD entry for CO_TPDO_init()
Definition CANopen.h:218
uint8_t CNT_SRDO
Number of SRDO objects, from 0 to 64 (2*CANrx + 2*CANtx).
Definition CANopen.h:223
OD_entry_t * ENTRY_H1019
OD entry for CO_SYNC_init()
Definition CANopen.h:213
uint8_t CNT_NMT
Number of NMT objects, 0 or 1: NMT slave (CANrx) + Heartbeat producer (CANtx) + optional NMT master (...
Definition CANopen.h:181
OD_entry_t * ENTRY_H100D
OD entry for CO_nodeGuardingSlave_init()
Definition CANopen.h:189
uint8_t CNT_SYNC
Number of SYNC objects, 0 or 1: consumer (CANrx) + optional producer (CANtx), configurable by CO_CONF...
Definition CANopen.h:208
Node Guarding master object.
Definition CO_Node_Guarding.h:181
Node Guarding slave object.
Definition CO_Node_Guarding.h:74
CANopen object - collection of all CANopenNode objects.
Definition CANopen.h:240
CO_SRDOGuard_t * SRDOGuard
SRDO guard object, initialised by CO_SRDOGuard_init(), single SRDOGuard object is included inside all...
Definition CANopen.h:337
uint16_t RX_IDX_TIME
Start index in CANrx.
Definition CANopen.h:303
CO_LSSslave_t * LSSslave
LSS slave object, initialised by CO_LSSslave_init().
Definition CANopen.h:346
bool_t nodeIdUnconfigured
True in un-configured LSS slave.
Definition CANopen.h:241
CO_SRDO_t * SRDO
SRDO objects, initialised by CO_SRDO_init()
Definition CANopen.h:339
uint16_t RX_IDX_LSS_SLV
Start index in CANrx.
Definition CANopen.h:348
uint16_t TX_IDX_NG_SLV
Start index in CANtx.
Definition CANopen.h:269
uint16_t TX_IDX_SYNC
Start index in CANtx.
Definition CANopen.h:311
CO_RPDO_t * RPDO
RPDO objects, initialised by CO_RPDO_init()
Definition CANopen.h:315
uint16_t TX_IDX_LSS_MST
Start index in CANtx.
Definition CANopen.h:356
uint16_t TX_IDX_EM_PROD
Start index in CANtx.
Definition CANopen.h:283
uint16_t TX_IDX_SRDO
Start index in CANtx.
Definition CANopen.h:342
uint16_t RX_IDX_NG_SLV
Start index in CANrx.
Definition CANopen.h:268
uint16_t RX_IDX_EM_CONS
Start index in CANrx.
Definition CANopen.h:282
CO_LEDs_t * LEDs
LEDs object, initialised by CO_LEDs_init()
Definition CANopen.h:327
CO_trace_t * trace
Trace object, initialised by CO_trace_init().
Definition CANopen.h:365
CO_config_t * config
Remember the configuration parameters.
Definition CANopen.h:243
uint16_t CNT_ALL_RX_MSGS
Number of all CAN receive message objects.
Definition CANopen.h:249
CO_HBconsNode_t * HBconsMonitoredNodes
Object for monitored nodes, initialised by CO_HBconsumer_init()
Definition CANopen.h:260
CO_HBconsumer_t * HBcons
Heartbeat consumer object, initialised by CO_HBconsumer_init()
Definition CANopen.h:259
CO_CANmodule_t * CANmodule
One CAN module object, initialised by CO_CANmodule_init()
Definition CANopen.h:245
CO_EM_t * em
Emergency object, initialised by CO_EM_init()
Definition CANopen.h:280
CO_NMT_t * NMT
NMT and heartbeat object, initialised by CO_NMT_init()
Definition CANopen.h:252
uint16_t TX_IDX_GFC
Start index in CANtx.
Definition CANopen.h:333
uint16_t RX_IDX_SYNC
Start index in CANrx.
Definition CANopen.h:310
uint16_t TX_IDX_NMT_MST
Start index in CANtx.
Definition CANopen.h:255
uint16_t RX_IDX_HB_CONS
Start index in CANrx.
Definition CANopen.h:262
uint16_t RX_IDX_RPDO
Start index in CANrx.
Definition CANopen.h:317
uint16_t TX_IDX_LSS_SLV
Start index in CANtx.
Definition CANopen.h:349
CO_TIME_t * TIME
TIME object, initialised by CO_TIME_init()
Definition CANopen.h:301
uint16_t RX_IDX_SDO_CLI
Start index in CANrx.
Definition CANopen.h:296
uint16_t RX_IDX_NG_MST
Start index in CANrx.
Definition CANopen.h:276
CO_EM_fifo_t * em_fifo
FIFO for emergency object, initialised by CO_EM_init()
Definition CANopen.h:286
uint16_t RX_IDX_SDO_SRV
Start index in CANrx.
Definition CANopen.h:290
uint16_t RX_IDX_SRDO
Start index in CANrx.
Definition CANopen.h:341
uint16_t TX_IDX_SDO_SRV
Start index in CANtx.
Definition CANopen.h:291
uint16_t TX_IDX_TPDO
Start index in CANtx.
Definition CANopen.h:323
CO_CANrx_t * CANrx
CAN receive message objects.
Definition CANopen.h:246
CO_CANtx_t * CANtx
CAN transmit message objects.
Definition CANopen.h:247
CO_GFC_t * GFC
GFC object, initialised by CO_GFC_init()
Definition CANopen.h:330
CO_SYNC_t * SYNC
SYNC object, initialised by CO_SYNC_init()
Definition CANopen.h:308
uint16_t CNT_ALL_TX_MSGS
Number of all CAN transmit message objects.
Definition CANopen.h:250
uint16_t RX_IDX_LSS_MST
Start index in CANrx.
Definition CANopen.h:355
CO_SDOserver_t * SDOserver
SDO server objects, initialised by CO_SDOserver_init()
Definition CANopen.h:288
CO_TPDO_t * TPDO
TPDO objects, initialised by CO_TPDO_init()
Definition CANopen.h:321
CO_nodeGuardingSlave_t * NGslave
Node guarding slave object, initialised by CO_nodeGuardingSlave_init()
Definition CANopen.h:266
uint16_t TX_IDX_HB_PROD
Start index in CANtx.
Definition CANopen.h:256
uint16_t TX_IDX_TIME
Start index in CANtx.
Definition CANopen.h:304
uint16_t TX_IDX_SDO_CLI
Start index in CANtx.
Definition CANopen.h:297
uint16_t RX_IDX_GFC
Start index in CANrx.
Definition CANopen.h:332
CO_SDOclient_t * SDOclient
SDO client objects, initialised by CO_SDOclient_init()
Definition CANopen.h:294
CO_LSSmaster_t * LSSmaster
LSS master object, initialised by CO_LSSmaster_init().
Definition CANopen.h:353
uint16_t RX_IDX_NMT_SLV
Start index in CANrx.
Definition CANopen.h:254
CO_GTWA_t * gtwa
Gateway-ascii object, initialised by CO_GTWA_init().
Definition CANopen.h:360
CO_nodeGuardingMaster_t * NGmaster
Node guarding master object, initialised by CO_nodeGuardingMaster_init()
Definition CANopen.h:274
uint16_t TX_IDX_NG_MST
Start index in CANtx.
Definition CANopen.h:277
Trace object.
Definition CO_trace.h:87
Object Dictionary entry for one OD object.
Definition CO_ODinterface.h:272
Object Dictionary.
Definition CO_ODinterface.h:284
The LSS address is a 128 bit number, uniquely identifying each node.
Definition CO_LSS.h:150