Go to the documentation of this file.
35 #if ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_ENABLE) || defined CO_DOXYGEN
42 #if ((CO_CONFIG_SDO_CLI) & CO_CONFIG_SDO_CLI_ENABLE) || defined CO_DOXYGEN
46 #if ((CO_CONFIG_SYNC) & CO_CONFIG_SYNC_ENABLE) || defined CO_DOXYGEN
50 #if ((CO_CONFIG_PDO) & (CO_CONFIG_RPDO_ENABLE | CO_CONFIG_TPDO_ENABLE)) || defined CO_DOXYGEN
54 #if ((CO_CONFIG_TIME) & CO_CONFIG_TIME_ENABLE) || defined CO_DOXYGEN
58 #if ((CO_CONFIG_LEDS) & CO_CONFIG_LEDS_ENABLE) || defined CO_DOXYGEN
62 #if ((CO_CONFIG_GFC) & CO_CONFIG_GFC_ENABLE) || defined CO_DOXYGEN
66 #if ((CO_CONFIG_SRDO) & CO_CONFIG_SRDO_ENABLE) || defined CO_DOXYGEN
70 #if ((CO_CONFIG_LSS) & CO_CONFIG_LSS_SLAVE) || defined CO_DOXYGEN
74 #if ((CO_CONFIG_LSS) & CO_CONFIG_LSS_MASTER) || defined CO_DOXYGEN
78 #if ((CO_CONFIG_GTW) & CO_CONFIG_GTW_ASCII) || defined CO_DOXYGEN
82 #if ((CO_CONFIG_TRACE) & CO_CONFIG_TRACE_ENABLE) || defined CO_DOXYGEN
207 #define CO_MULTIPLE_OD
216 #define CO_USE_GLOBALS
220 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
303 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
310 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
316 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
321 #if ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_ENABLE) || defined CO_DOXYGEN
324 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
330 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
336 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
340 #if ((CO_CONFIG_SDO_CLI) & CO_CONFIG_SDO_CLI_ENABLE) || defined CO_DOXYGEN
343 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
348 #if ((CO_CONFIG_TIME) & CO_CONFIG_TIME_ENABLE) || defined CO_DOXYGEN
351 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
356 #if ((CO_CONFIG_SYNC) & CO_CONFIG_SYNC_ENABLE) || defined CO_DOXYGEN
359 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
364 #if ((CO_CONFIG_PDO) & CO_CONFIG_RPDO_ENABLE) || defined CO_DOXYGEN
367 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
371 #if ((CO_CONFIG_PDO) & CO_CONFIG_TPDO_ENABLE) || defined CO_DOXYGEN
374 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
378 #if ((CO_CONFIG_LEDS) & CO_CONFIG_LEDS_ENABLE) || defined CO_DOXYGEN
382 #if ((CO_CONFIG_GFC) & CO_CONFIG_GFC_ENABLE) || defined CO_DOXYGEN
385 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
390 #if ((CO_CONFIG_SRDO) & CO_CONFIG_SRDO_ENABLE) || defined CO_DOXYGEN
396 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
401 #if ((CO_CONFIG_LSS) & CO_CONFIG_LSS_SLAVE) || defined CO_DOXYGEN
404 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
409 #if ((CO_CONFIG_LSS) & CO_CONFIG_LSS_MASTER) || defined CO_DOXYGEN
412 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
417 #if ((CO_CONFIG_GTW) & CO_CONFIG_GTW_ASCII) || defined CO_DOXYGEN
420 #if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
423 #if ((CO_CONFIG_TRACE) & CO_CONFIG_TRACE_ENABLE) || defined CO_DOXYGEN
484 #if ((CO_CONFIG_LSS) & CO_CONFIG_LSS_SLAVE) || defined CO_DOXYGEN
543 bool_t SDOclientBlockTransfer,
575 #if ((CO_CONFIG_SYNC) & CO_CONFIG_SYNC_ENABLE) || defined CO_DOXYGEN
596 #if ((CO_CONFIG_PDO) & CO_CONFIG_RPDO_ENABLE) || defined CO_DOXYGEN
612 #if ((CO_CONFIG_PDO) & CO_CONFIG_TPDO_ENABLE) || defined CO_DOXYGEN
634 #if ((CO_CONFIG_SRDO) & CO_CONFIG_SRDO_ENABLE) || defined CO_DOXYGEN
uint8_t CNT_GFC
Number of GFC objects, 0 or 1 (CANrx + CANtx).
Definition: CANopen.h:276
CO_t * CO_new(CO_config_t *config, uint32_t *heapMemoryUsed)
Create new CANopen object.
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
uint16_t TX_IDX_SDO_SRV
Start index in CANtx.
Definition: CANopen.h:338
CO_NMT_reset_cmd_t CO_process(CO_t *co, bool_t enableGateway, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process CANopen objects.
const OD_entry_t * ENTRY_H1006
OD entry for CO_SYNC_init()
Definition: CANopen.h:262
Interface between CAN hardware and CANopenNode.
CANopen trace object for recording variables over time.
uint16_t TX_IDX_GFC
Start index in CANtx.
Definition: CANopen.h:387
const OD_entry_t * ENTRY_H1014
OD entry for CO_EM_init()
Definition: CANopen.h:244
const OD_entry_t * ENTRY_H13FF
OD entry for CO_SRDOGuard_init()
Definition: CANopen.h:283
uint8_t CNT_EM
Number of Emergency objects, 0 or 1: optional producer (CANtx) + optional consumer (CANrx),...
Definition: CANopen.h:242
uint8_t CNT_SYNC
Number of SYNC objects, 0 or 1: consumer (CANrx) + optional producer (CANtx), configurable by CO_CONF...
Definition: CANopen.h:260
uint8_t CNT_HB_CONS
Number of Heartbeat consumer objects, 0 or 1: object uses from 1 to 127 internal consumers (CANrx),...
Definition: CANopen.h:237
uint16_t TX_IDX_SRDO
Start index in CANtx.
Definition: CANopen.h:398
SDO server object.
Definition: CO_SDOserver.h:439
const OD_entry_t * ENTRY_H1381
OD entry for CO_SRDO_init()
Definition: CANopen.h:281
RPDO object.
Definition: CO_PDO.h:179
CO_CANtx_t * CANtx
CAN transmit message objects.
Definition: CANopen.h:309
LEDs object, initialized by CO_LEDs_init()
Definition: CO_LEDs.h:93
const OD_entry_t * ENTRY_H13FE
OD entry for CO_SRDOGuard_init()
Definition: CANopen.h:282
Trace object.
Definition: CO_trace.h:93
uint16_t RX_IDX_EM_CONS
Start index in CANrx.
Definition: CANopen.h:331
const OD_entry_t * ENTRY_H1005
OD entry for CO_SYNC_init()
Definition: CANopen.h:261
uint16_t TX_IDX_NMT_MST
Start index in CANtx.
Definition: CANopen.h:318
SDO client object.
Definition: CO_SDOclient.h:67
uint16_t RX_IDX_RPDO
Start index in CANrx.
Definition: CANopen.h:368
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition: CO_driver.h:153
void CO_delete(CO_t *co)
Delete CANopen object and free memory.
CANopen Service Data Object - client protocol.
const OD_entry_t * ENTRY_H1015
OD entry for CO_EM_init()
Definition: CANopen.h:245
CO_CANmodule_t * CANmodule
One CAN module object, initialised by CO_CANmodule_init()
Definition: CANopen.h:307
const OD_entry_t * ENTRY_H1600
OD entry for CO_RPDO_init()
Definition: CANopen.h:268
GFC object.
Definition: CO_GFC.h:60
uint16_t TX_IDX_TPDO
Start index in CANtx.
Definition: CANopen.h:375
CO_ReturnError_t
Return values of some CANopen functions.
Definition: CO_driver.h:488
CANopen Heartbeat consumer protocol.
const OD_entry_t * ENTRY_H1800
OD entry for CO_TPDO_init()
Definition: CANopen.h:271
void CO_process_SRDO(CO_t *co, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process CANopen SRDO objects.
uint8_t CNT_LSS_SLV
Number of LSSslave objects, 0 or 1 (CANrx + CANtx).
Definition: CANopen.h:285
const OD_entry_t * ENTRY_H1007
OD entry for CO_SYNC_init()
Definition: CANopen.h:263
unsigned char bool_t
Boolean data type for general use.
Definition: CO_driver.h:141
uint8_t CNT_LEDS
Number of LEDs objects, 0 or 1.
Definition: CANopen.h:274
uint8_t CNT_SDO_SRV
Number of SDO server objects, from 0 to 128 (CANrx + CANtx).
Definition: CANopen.h:249
CANopen Layer Setting Service - master protocol.
uint16_t TX_IDX_SYNC
Start index in CANtx.
Definition: CANopen.h:361
CO_NMT_reset_cmd_t
Return code from CO_NMT_process() that tells application code what to reset.
Definition: CO_NMT_Heartbeat.h:112
const OD_entry_t * ENTRY_H1016
OD entry for CO_HBconsumer_init()
Definition: CANopen.h:238
CANopen configuration, used with CO_new()
Definition: CANopen.h:227
const OD_entry_t * ENTRY_H1019
OD entry for CO_SYNC_init()
Definition: CANopen.h:264
uint16_t RX_IDX_TIME
Start index in CANrx.
Definition: CANopen.h:352
CO_GFC_t * GFC
GFC object, initialised by CO_GFC_init()
Definition: CANopen.h:384
uint16_t RX_IDX_NMT_SLV
Start index in CANrx.
Definition: CANopen.h:317
CANopen Process Data Object protocol.
uint16_t RX_IDX_HB_CONS
Start index in CANrx.
Definition: CANopen.h:325
uint16_t TX_IDX_HB_PROD
Start index in CANtx.
Definition: CANopen.h:319
NMT consumer and Heartbeat producer object.
Definition: CO_NMT_Heartbeat.h:162
CANopen Service Data Object - server protocol.
bool_t CO_isLSSslaveEnabled(CO_t *co)
Test if LSS slave is enabled.
CANopen Synchronisation protocol.
CO_ReturnError_t CO_CANinit(CO_t *co, void *CANptr, uint16_t bitRate)
Initialize CAN driver.
const OD_entry_t * ENTRY_H1012
OD entry for CO_TIME_init()
Definition: CANopen.h:257
TIME producer and consumer object.
Definition: CO_TIME.h:99
CO_SRDOGuard_t * SRDOGuard
SRDO object, initialised by CO_SRDOGuard_init(), single SRDOGuard object is included inside all SRDO ...
Definition: CANopen.h:393
CO_NMT_t * NMT
NMT and heartbeat object, initialised by CO_NMT_init()
Definition: CANopen.h:315
CO_RPDO_t * RPDO
RPDO objects, initialised by CO_RPDO_init()
Definition: CANopen.h:366
uint16_t CNT_ALL_TX_MSGS
Number of all CAN transmit message objects.
Definition: CANopen.h:312
LSS slave object.
Definition: CO_LSSslave.h:90
Heartbeat consumer object.
Definition: CO_HBconsumer.h:138
uint8_t CNT_NMT
Number of NMT objects, 0 or 1: NMT slave (CANrx) + Heartbeat producer (CANtx) + optional NMT master (...
Definition: CANopen.h:232
CANopen Global fail-safe command protocol.
const OD_entry_t * ENTRY_H1A00
OD entry for CO_TPDO_init()
Definition: CANopen.h:272
CO_LSSmaster_t * LSSmaster
LSS master object, initialised by CO_LSSmaster_init().
Definition: CANopen.h:411
CANopen Time-stamp protocol.
const OD_entry_t * ENTRY_H1200
OD entry for CO_SDOserver_init()
Definition: CANopen.h:250
LSS master object.
Definition: CO_LSSmaster.h:108
uint16_t TX_IDX_LSS_MST
Start index in CANtx.
Definition: CANopen.h:414
CO_TPDO_t * TPDO
TPDO objects, initialised by CO_TPDO_init()
Definition: CANopen.h:373
uint16_t TX_IDX_LSS_SLV
Start index in CANtx.
Definition: CANopen.h:406
const OD_entry_t * ENTRY_H1301
OD entry for CO_SRDO_init()
Definition: CANopen.h:280
CO_trace_t * trace
Trace object, initialised by CO_trace_init().
Definition: CANopen.h:425
uint16_t RX_IDX_SYNC
Start index in CANrx.
Definition: CANopen.h:360
CO_SYNC_t * SYNC
SYNC object, initialised by CO_SYNC_init()
Definition: CANopen.h:358
CO_SRDO_t * SRDO
SRDO objects, initialised by CO_SRDO_init()
Definition: CANopen.h:395
uint16_t RX_IDX_LSS_SLV
Start index in CANrx.
Definition: CANopen.h:405
uint16_t RX_IDX_SRDO
Start index in CANrx.
Definition: CANopen.h:397
const OD_entry_t * ENTRY_H1017
OD entry for CO_NMT_init()
Definition: CANopen.h:233
uint16_t CNT_TRACE
Number of trace objects, 0 or more.
Definition: CANopen.h:291
Emergency object.
Definition: CO_Emergency.h:369
CO_CANrx_t * CANrx
CAN receive message objects.
Definition: CANopen.h:308
uint16_t RX_IDX_GFC
Start index in CANrx.
Definition: CANopen.h:386
const OD_entry_t * ENTRY_H1280
OD entry for CO_SDOclient_init()
Definition: CANopen.h:253
CANopen Network management and Heartbeat producer protocol.
uint16_t RX_IDX_SDO_SRV
Start index in CANrx.
Definition: CANopen.h:337
uint16_t CNT_ALL_RX_MSGS
Number of all CAN receive message objects.
Definition: CANopen.h:311
CANopen Object Dictionary interface.
bool_t CO_process_SYNC(CO_t *co, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process CANopen SYNC objects.
uint8_t CNT_LSS_MST
Number of LSSmaster objects, 0 or 1 (CANrx + CANtx).
Definition: CANopen.h:287
CANopen Emergency protocol.
CO_config_t * config
Remember the configuration parameters.
Definition: CANopen.h:304
uint16_t CNT_TPDO
Number of TPDO objects, from 0 to 512 producers (CANtx)
Definition: CANopen.h:270
Object Dictionary.
Definition: CO_ODinterface.h:352
CO_GTWA_t * gtwa
Gateway-ascii object, initialised by CO_GTWA_init().
Definition: CANopen.h:419
Configuration object for CAN received message for specific CANopenNode Object.
Definition: CO_driver.h:257
CO_EM_t * em
Emergency object, initialised by CO_EM_init()
Definition: CANopen.h:329
const OD_entry_t * ENTRY_H1001
OD entry for CO_EM_init()
Definition: CANopen.h:243
const OD_entry_t * ENTRY_H1400
OD entry for CO_RPDO_init()
Definition: CANopen.h:267
uint8_t CNT_SDO_CLI
Number of SDO client objects, from 0 to 128 (CANrx + CANtx).
Definition: CANopen.h:252
uint16_t TX_IDX_TIME
Start index in CANtx.
Definition: CANopen.h:353
uint16_t TX_IDX_SDO_CLI
Start index in CANtx.
Definition: CANopen.h:345
Complete CAN module object.
Definition: CO_driver.h:319
uint16_t TX_IDX_EM_PROD
Start index in CANtx.
Definition: CANopen.h:332
CANopen access from other networks - ASCII mapping (CiA 309-3 DS v3.0.0)
SRDO object.
Definition: CO_SRDO.h:124
const OD_entry_t * ENTRY_H1300
OD entry for CO_GFC_init()
Definition: CANopen.h:277
uint16_t RX_IDX_SDO_CLI
Start index in CANrx.
Definition: CANopen.h:344
Object Dictionary entry for one OD object.
Definition: CO_ODinterface.h:336
Gurad Object for SRDO monitors:
Definition: CO_SRDO.h:114
CO_SDOserver_t * SDOserver
SDO server objects, initialised by CO_SDOserver_init()
Definition: CANopen.h:335
CANopen object - collection of all CANopenNode objects.
Definition: CANopen.h:301
CANopen Safety Related Data Object protocol.
CANopen Indicator specification (CiA 303-3 v1.4.0)
CO_ReturnError_t CO_CANopenInit(CO_t *co, CO_NMT_t *NMT, CO_EM_t *em, const OD_t *od, const OD_entry_t *OD_statusBits, CO_NMT_control_t NMTcontrol, uint16_t firstHBTime_ms, uint16_t SDOserverTimeoutTime_ms, uint16_t SDOclientTimeoutTime_ms, bool_t SDOclientBlockTransfer, uint8_t nodeId)
Initialize CANopenNode.
SYNC producer and consumer object.
Definition: CO_SYNC.h:75
CO_LEDs_t * LEDs
LEDs object, initialised by CO_LEDs_init()
Definition: CANopen.h:380
bool_t nodeIdUnconfigured
True in un-configured LSS slave.
Definition: CANopen.h:302
CO_SDOclient_t * SDOclient
SDO client objects, initialised by CO_SDOclient_init()
Definition: CANopen.h:342
uint8_t CNT_GTWA
Number of gateway ascii objects, 0 or 1.
Definition: CANopen.h:289
CO_HBconsumer_t * HBcons
Heartbeat consumer object, initialised by CO_HBconsumer_init()
Definition: CANopen.h:323
uint16_t RX_IDX_LSS_MST
Start index in CANrx.
Definition: CANopen.h:413
CO_NMT_control_t
NMT control bitfield for NMT internal state.
Definition: CO_NMT_Heartbeat.h:135
CO_TIME_t * TIME
TIME object, initialised by CO_TIME_init()
Definition: CANopen.h:350
The LSS address is a 128 bit number, uniquely identifying each node.
Definition: CO_LSS.h:162
uint8_t CNT_SRDO
Number of SRDO objects, from 0 to 64 (2*CANrx + 2*CANtx).
Definition: CANopen.h:279
CO_LSSslave_t * LSSslave
LSS slave object, initialised by CO_LSSslave_init().
Definition: CANopen.h:403
void CO_process_RPDO(CO_t *co, bool_t syncWas)
Process CANopen RPDO objects.
CANopen Layer Setting Service - slave protocol.
const OD_entry_t * ENTRY_H1003
OD entry for CO_EM_init()
Definition: CANopen.h:246
Configuration object for CAN transmit message for specific CANopenNode Object.
Definition: CO_driver.h:299
TPDO object.
Definition: CO_PDO.h:220
void CO_process_TPDO(CO_t *co, bool_t syncWas, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process CANopen TPDO objects.
CANopen Gateway-ascii object.
Definition: CO_gateway_ascii.h:296
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition: CO_driver.h:151
CO_ReturnError_t CO_LSSinit(CO_t *co, CO_LSS_address_t *lssAddress, uint8_t *pendingNodeID, uint16_t *pendingBitRate)
Initialize CANopen LSS slave.
uint16_t CNT_RPDO
Number of RPDO objects, from 0 to 512 consumers (CANrx)
Definition: CANopen.h:266
uint8_t CNT_TIME
Number of TIME objects, 0 or 1: consumer (CANrx) + optional producer (CANtx), configurable by CO_CONF...
Definition: CANopen.h:256