CANopenNode
CO_Emergency.h
Go to the documentation of this file.
1 
26 #ifndef CO_EMERGENCY_H
27 #define CO_EMERGENCY_H
28 
29 #include "301/CO_driver.h"
30 #include "301/CO_ODinterface.h"
31 
32 /* default configuration, see CO_config.h */
33 #ifndef CO_CONFIG_EM
34 #define CO_CONFIG_EM (CO_CONFIG_EM_PRODUCER | \
35  CO_CONFIG_EM_HISTORY)
36 #endif
37 #ifndef CO_CONFIG_EM_ERR_STATUS_BITS_COUNT
38 #define CO_CONFIG_EM_ERR_STATUS_BITS_COUNT (10*8)
39 #endif
40 #ifndef CO_CONFIG_EM_BUFFER_SIZE
41 #define CO_CONFIG_EM_BUFFER_SIZE 16
42 #endif
43 #ifndef CO_CONFIG_ERR_CONDITION_GENERIC
44 #define CO_CONFIG_ERR_CONDITION_GENERIC (em->errorStatusBits[5] != 0)
45 #endif
46 #ifndef CO_CONFIG_ERR_CONDITION_COMMUNICATION
47 #define CO_CONFIG_ERR_CONDITION_COMMUNICATION (em->errorStatusBits[2] \
48  || em->errorStatusBits[3])
49 #endif
50 #ifndef CO_CONFIG_ERR_CONDITION_MANUFACTURER
51 #define CO_CONFIG_ERR_CONDITION_MANUFACTURER (em->errorStatusBits[8] \
52  || em->errorStatusBits[9])
53 #endif
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
119 typedef enum {
129 
130 
136 typedef enum {
138  CO_EMC_NO_ERROR = 0x0000U,
140  CO_EMC_GENERIC = 0x1000U,
142  CO_EMC_CURRENT = 0x2000U,
150  CO_EMC_VOLTAGE = 0x3000U,
164  CO_EMC_HARDWARE = 0x5000U,
172  CO_EMC_DATA_SET = 0x6300U,
176  CO_EMC_MONITORING = 0x8000U,
184  CO_EMC_HEARTBEAT = 0x8130U,
192  CO_EMC_PDO_LENGTH = 0x8210U,
196  CO_EMC_DAM_MPDO = 0x8230U,
209 
229 
230 
247 typedef enum {
249  CO_EM_NO_ERROR = 0x00U,
282 
317 
335 
353 
364 
365 
369 typedef struct {
376 
377 #if ((CO_CONFIG_EM) & (CO_CONFIG_EM_PRODUCER | CO_CONFIG_EM_HISTORY)) \
378  || defined CO_DOXYGEN
379 
383 #if ((CO_CONFIG_EM) & CO_CONFIG_EM_PRODUCER) || defined CO_DOXYGEN
385 #else
386  uint32_t fifo[CO_CONFIG_EM_BUFFER_SIZE + 1][1];
387 #endif
388 
399 #endif /* (CO_CONFIG_EM) & (CO_CONFIG_EM_PRODUCER | CO_CONFIG_EM_HISTORY) */
400 
401 #if ((CO_CONFIG_EM) & CO_CONFIG_EM_PRODUCER) || defined CO_DOXYGEN
402 
410 #if ((CO_CONFIG_EM) & CO_CONFIG_EM_PROD_CONFIGURABLE) || defined CO_DOXYGEN
411 
415 #endif
416 #if ((CO_CONFIG_EM) & CO_CONFIG_EM_PROD_INHIBIT) || defined CO_DOXYGEN
417 
420  uint32_t inhibitEmTimer;
421 #endif
422 #endif /* (CO_CONFIG_EM) & CO_CONFIG_EM_PRODUCER */
423 
424 #if ((CO_CONFIG_EM) & CO_CONFIG_EM_CONSUMER) || defined CO_DOXYGEN
425 
426  void (*pFunctSignalRx)(const uint16_t ident,
427  const uint16_t errorCode,
428  const uint8_t errorRegister,
429  const uint8_t errorBit,
430  const uint32_t infoCode);
431 #endif
432 
433 #if ((CO_CONFIG_EM) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
434 
435  void (*pFunctSignalPre)(void *object);
438 #endif
439 } CO_EM_t;
440 
441 
471  const OD_entry_t *OD_1001_errReg,
472 #if ((CO_CONFIG_EM) & CO_CONFIG_EM_PRODUCER) || defined CO_DOXYGEN
473  const OD_entry_t *OD_1014_cobIdEm,
474  CO_CANmodule_t *CANdevTx,
475  uint16_t CANdevTxIdx,
476  #if ((CO_CONFIG_EM) & CO_CONFIG_EM_PROD_INHIBIT) || defined CO_DOXYGEN
477  const OD_entry_t *OD_1015_InhTime,
478  #endif
479 #endif
480 #if ((CO_CONFIG_EM) & CO_CONFIG_EM_HISTORY) || defined CO_DOXYGEN
481  const OD_entry_t *OD_1003_preDefErr,
482 #endif
483 #if ((CO_CONFIG_EM) & CO_CONFIG_EM_STATUS_BITS) || defined CO_DOXYGEN
484  const OD_entry_t *OD_statusBits,
485 #endif
486 #if ((CO_CONFIG_EM) & CO_CONFIG_EM_CONSUMER) || defined CO_DOXYGEN
487  CO_CANmodule_t *CANdevRx,
488  uint16_t CANdevRxIdx,
489 #endif
490  const uint8_t nodeId);
491 
492 
493 #if ((CO_CONFIG_EM) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
494 
509  void *object,
510  void (*pFunctSignal)(void *object));
511 #endif
512 
513 
514 #if ((CO_CONFIG_EM) & CO_CONFIG_EM_CONSUMER) || defined CO_DOXYGEN
515 
531  void (*pFunctSignalRx)(const uint16_t ident,
532  const uint16_t errorCode,
533  const uint8_t errorRegister,
534  const uint8_t errorBit,
535  const uint32_t infoCode));
536 #endif
537 
538 
553 void CO_EM_process(CO_EM_t *em,
554  bool_t NMTisPreOrOperational,
555  uint32_t timeDifference_us,
556  uint32_t *timerNext_us);
557 
558 
577 void CO_error(CO_EM_t *em, bool_t setError, const uint8_t errorBit,
578  uint16_t errorCode, uint32_t infoCode);
579 
580 
584 #define CO_errorReport(em, errorBit, errorCode, infoCode) \
585  CO_error(em, true, errorBit, errorCode, infoCode)
586 
587 
591 #define CO_errorReset(em, errorBit, infoCode) \
592  CO_error(em, false, errorBit, CO_EMC_NO_ERROR, infoCode)
593 
594 
605 static inline bool_t CO_isError(CO_EM_t *em, const uint8_t errorBit) {
606  uint8_t index = errorBit >> 3;
607  uint8_t bitmask = 1 << (errorBit & 0x7);
608 
609  return (em == NULL || index >= (CO_CONFIG_EM_ERR_STATUS_BITS_COUNT / 8)
610  || (em->errorStatusBits[index] & bitmask) != 0) ? true : false;
611 }
612 
620 static inline uint8_t CO_getErrorRegister(CO_EM_t *em) {
621  return (em == NULL || em->errorRegister == NULL) ? 0 : *em->errorRegister;
622 }
623  /* CO_Emergency */
625 
626 #ifdef __cplusplus
627 }
628 #endif /*__cplusplus*/
629 
630 #endif /* CO_EMERGENCY_H */
uint32_t
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
CO_EM_CALCULATION_OF_PARAMETERS
@ CO_EM_CALCULATION_OF_PARAMETERS
0x2E, generic, critical, Error in calculation of device parameters
Definition: CO_Emergency.h:349
CO_EM_t::producerCanId
uint16_t producerCanId
COB ID of emergency message, from Object dictionary.
Definition: CO_Emergency.h:412
CO_CONFIG_EM_ERR_STATUS_BITS_COUNT
#define CO_CONFIG_EM_ERR_STATUS_BITS_COUNT
Maximum number of CO_EM_errorStatusBits_t.
Definition: CO_config.h:214
CO_driver.h
Interface between CAN hardware and CANopenNode.
CO_EMC_HEARTBEAT
@ CO_EMC_HEARTBEAT
0x8130, Life Guard Error or Heartbeat Error
Definition: CO_Emergency.h:184
CO_EM_CAN_RX_BUS_PASSIVE
@ CO_EM_CAN_RX_BUS_PASSIVE
0x06, communication, info, CAN receive bus is passive
Definition: CO_Emergency.h:263
CO_EM_21_unused
@ CO_EM_21_unused
0x21, generic, info, (unused)
Definition: CO_Emergency.h:322
CO_EMC_MONITORING
@ CO_EMC_MONITORING
0x80xx, Monitoring
Definition: CO_Emergency.h:176
CO_EM_errorStatusBits_t
CO_EM_errorStatusBits_t
Error status bits.
Definition: CO_Emergency.h:247
CO_EM_GENERIC_ERROR
@ CO_EM_GENERIC_ERROR
0x2B, generic, critical, Generic error, test usage
Definition: CO_Emergency.h:343
CO_EMC401_OUT_LOAD_DUMP
@ CO_EMC401_OUT_LOAD_DUMP
0x2330, DS401, Load dump at outputs
Definition: CO_Emergency.h:215
CO_ERR_REG_VOLTAGE
@ CO_ERR_REG_VOLTAGE
bit 2, voltage
Definition: CO_Emergency.h:122
true
#define true
Logical true, for general use.
Definition: CO_driver.h:137
CO_EM_24_unused
@ CO_EM_24_unused
0x24, generic, info, (unused)
Definition: CO_Emergency.h:328
CO_EMC_ADDITIONAL_FUNC
@ CO_EMC_ADDITIONAL_FUNC
0xF0xx, Additional Functions
Definition: CO_Emergency.h:206
CO_error
void CO_error(CO_EM_t *em, bool_t setError, const uint8_t errorBit, uint16_t errorCode, uint32_t infoCode)
Set or reset error condition.
Definition: CO_Emergency.c:686
uint16_t
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition: CO_driver.h:153
CO_EM_TPDO_OUTSIDE_WINDOW
@ CO_EM_TPDO_OUTSIDE_WINDOW
0x15, communication, critical, TPDO is outside SYNC window
Definition: CO_Emergency.h:295
CO_EM_t::CANdevTxIdx
uint16_t CANdevTxIdx
From CO_EM_init()
Definition: CO_Emergency.h:414
CO_EM_t::CANerrorStatusOld
uint16_t CANerrorStatusOld
Old CAN error status bitfield.
Definition: CO_Emergency.h:375
CO_EM_t::producerEnabled
bool_t producerEnabled
True, if emergency producer is enabled, from Object dictionary.
Definition: CO_Emergency.h:403
CO_EMC_CAN_ID_COLLISION
@ CO_EMC_CAN_ID_COLLISION
0x8150, CAN-ID collision
Definition: CO_Emergency.h:188
CO_EM_t::CANtxBuff
CO_CANtx_t * CANtxBuff
CAN transmit buffer.
Definition: CO_Emergency.h:409
CO_ReturnError_t
CO_ReturnError_t
Return values of some CANopen functions.
Definition: CO_driver.h:488
CO_EMC_GENERIC
@ CO_EMC_GENERIC
0x10xx, Generic Error
Definition: CO_Emergency.h:140
CO_EM_RXMSG_WRONG_LENGTH
@ CO_EM_RXMSG_WRONG_LENGTH
0x02, communication, info, Wrong data length of the received CAN message
Definition: CO_Emergency.h:254
CO_EM_SYNC_TIME_OUT
@ CO_EM_SYNC_TIME_OUT
0x18, communication, critical, SYNC message timeout
Definition: CO_Emergency.h:301
CO_ERR_REG_COMMUNICATION
@ CO_ERR_REG_COMMUNICATION
bit 4, communication error
Definition: CO_Emergency.h:124
CO_EMC401_INTERN_VOLT_HI
@ CO_EMC401_INTERN_VOLT_HI
0x3210, DS401, Internal voltage too high
Definition: CO_Emergency.h:221
CO_EMC_COMMUNICATION
@ CO_EMC_COMMUNICATION
0x81xx, Communication
Definition: CO_Emergency.h:178
bool_t
unsigned char bool_t
Boolean data type for general use.
Definition: CO_driver.h:141
CO_ERR_REG_RESERVED
@ CO_ERR_REG_RESERVED
bit 6, reserved (always 0)
Definition: CO_Emergency.h:126
CO_EMC_PDO_LENGTH
@ CO_EMC_PDO_LENGTH
0x8210, PDO not processed due to length error
Definition: CO_Emergency.h:192
CO_ERR_REG_GENERIC_ERR
@ CO_ERR_REG_GENERIC_ERR
bit 0, generic error
Definition: CO_Emergency.h:120
CO_EM_0F_unused
@ CO_EM_0F_unused
0x0F, communication, info, (unused)
Definition: CO_Emergency.h:281
CO_EM_1D_unused
@ CO_EM_1D_unused
0x1D, communication, critical, (unused)
Definition: CO_Emergency.h:312
CO_EMC_DAM_MPDO
@ CO_EMC_DAM_MPDO
0x8230, DAM MPDO not processed, destination object not available
Definition: CO_Emergency.h:196
CO_EM_MICROCONTROLLER_RESET
@ CO_EM_MICROCONTROLLER_RESET
0x22, generic, info, Microcontroller has just started
Definition: CO_Emergency.h:324
CO_ERR_REG_CURRENT
@ CO_ERR_REG_CURRENT
bit 1, current
Definition: CO_Emergency.h:121
CO_EMC_ADDITIONAL_MODUL
@ CO_EMC_ADDITIONAL_MODUL
0x70xx, Additional Modules
Definition: CO_Emergency.h:174
CO_EM_WRONG_ERROR_REPORT
@ CO_EM_WRONG_ERROR_REPORT
0x28, generic, critical, Wrong parameters to CO_errorReport() function
Definition: CO_Emergency.h:337
CO_EMC_PROTOCOL_ERROR
@ CO_EMC_PROTOCOL_ERROR
0x82xx, Protocol Error
Definition: CO_Emergency.h:190
CO_EM_27_unused
@ CO_EM_27_unused
0x27, generic, info, (unused)
Definition: CO_Emergency.h:334
CO_EMC_BUS_OFF_RECOVERED
@ CO_EMC_BUS_OFF_RECOVERED
0x8140, recovered from bus off
Definition: CO_Emergency.h:186
CO_EM_NON_VOLATILE_MEMORY
@ CO_EM_NON_VOLATILE_MEMORY
0x2F, generic, critical, Error with access to non volatile device memory
Definition: CO_Emergency.h:352
CO_EM_SYNC_LENGTH
@ CO_EM_SYNC_LENGTH
0x19, communication, critical, Unexpected SYNC data length
Definition: CO_Emergency.h:303
CO_EM_GENERIC_SOFTWARE_ERROR
@ CO_EM_GENERIC_SOFTWARE_ERROR
0x2C, generic, critical, Software error
Definition: CO_Emergency.h:345
CO_ERR_REG_DEV_PROFILE
@ CO_ERR_REG_DEV_PROFILE
bit 5, device profile specific
Definition: CO_Emergency.h:125
CO_EM_10_unused
@ CO_EM_10_unused
0x10, communication, critical, (unused)
Definition: CO_Emergency.h:284
CO_EM_EMERGENCY_BUFFER_FULL
@ CO_EM_EMERGENCY_BUFFER_FULL
0x20, generic, info, Emergency buffer is full, Emergency message wasn't sent
Definition: CO_Emergency.h:320
CO_EMC_DATA_SET
@ CO_EMC_DATA_SET
0x63xx, Data Set
Definition: CO_Emergency.h:172
CO_EM_0B_unused
@ CO_EM_0B_unused
0x0B, communication, info, (unused)
Definition: CO_Emergency.h:273
CO_EMC401_OUT_CUR_HI
@ CO_EMC401_OUT_CUR_HI
0x2310, DS401, Current at outputs too high (overload)
Definition: CO_Emergency.h:211
CO_EMC_SOFTWARE_INTERNAL
@ CO_EMC_SOFTWARE_INTERNAL
0x61xx, Internal Software
Definition: CO_Emergency.h:168
CO_EM_MANUFACTURER_END
@ CO_EM_MANUFACTURER_END
(CO_CONFIG_EM_ERR_STATUS_BITS_COUNT - 1), largest value of the Error status bit.
Definition: CO_Emergency.h:362
CO_EMC_CURRENT
@ CO_EMC_CURRENT
0x20xx, Current
Definition: CO_Emergency.h:142
CO_EM_1E_unused
@ CO_EM_1E_unused
0x1E, communication, critical, (unused)
Definition: CO_Emergency.h:314
CO_EM_CAN_RXB_OVERFLOW
@ CO_EM_CAN_RXB_OVERFLOW
0x13, communication, critical, CAN module receive buffer has overflowed
Definition: CO_Emergency.h:291
CO_EMC_SOFTWARE_DEVICE
@ CO_EMC_SOFTWARE_DEVICE
0x60xx, Device Software
Definition: CO_Emergency.h:166
CO_EM_NMT_WRONG_COMMAND
@ CO_EM_NMT_WRONG_COMMAND
0x08, communication, info, Wrong NMT command received
Definition: CO_Emergency.h:267
CO_EM_INCONSISTENT_OBJECT_DICT
@ CO_EM_INCONSISTENT_OBJECT_DICT
0x2D, generic, critical, Object dictionary does not match the software
Definition: CO_Emergency.h:347
CO_EMC401_OUT_SHORTED
@ CO_EMC401_OUT_SHORTED
0x2320, DS401, Short circuit at outputs
Definition: CO_Emergency.h:213
CO_EMC_CURRENT_OUTPUT
@ CO_EMC_CURRENT_OUTPUT
0x23xx, Current, device output side
Definition: CO_Emergency.h:148
CO_EMC_VOLTAGE_OUTPUT
@ CO_EMC_VOLTAGE_OUTPUT
0x33xx, Output Voltage
Definition: CO_Emergency.h:156
CO_EM_t::CANdevTx
CO_CANmodule_t * CANdevTx
From CO_EM_init()
Definition: CO_Emergency.h:407
CO_EM_CAN_TX_BUS_PASSIVE
@ CO_EM_CAN_TX_BUS_PASSIVE
0x07, communication, info, CAN transmit bus is passive
Definition: CO_Emergency.h:265
CO_EM_CAN_TX_BUS_OFF
@ CO_EM_CAN_TX_BUS_OFF
0x12, communication, critical, CAN transmit bus is off
Definition: CO_Emergency.h:288
CO_EM_CAN_TX_OVERFLOW
@ CO_EM_CAN_TX_OVERFLOW
0x14, communication, critical, CAN transmit buffer has overflowed
Definition: CO_Emergency.h:293
CO_EM_MANUFACTURER_START
@ CO_EM_MANUFACTURER_START
0x30+, manufacturer, info or critical, Error status buts, free to use by manufacturer.
Definition: CO_Emergency.h:359
CO_EM_RPDO_OVERFLOW
@ CO_EM_RPDO_OVERFLOW
0x05, communication, info, Previous received PDO wasn't processed yet
Definition: CO_Emergency.h:261
CO_EMC_DEVICE_SPECIFIC
@ CO_EMC_DEVICE_SPECIFIC
0xFFxx, Device specific
Definition: CO_Emergency.h:208
CO_EMC401_OUT_VOLT_LOW
@ CO_EMC401_OUT_VOLT_LOW
0x3320, DS401, Output voltage too low
Definition: CO_Emergency.h:227
CO_EM_errorCode_t
CO_EM_errorCode_t
CANopen Error code.
Definition: CO_Emergency.h:136
CO_EMC_VOLTAGE_INSIDE
@ CO_EMC_VOLTAGE_INSIDE
0x32xx, Voltage inside the device
Definition: CO_Emergency.h:154
CO_EMC401_INTERN_VOLT_LO
@ CO_EMC401_INTERN_VOLT_LO
0x3220, DS401, Internal voltage too low
Definition: CO_Emergency.h:223
CO_EMC_HARDWARE
@ CO_EMC_HARDWARE
0x50xx, Device Hardware
Definition: CO_Emergency.h:164
CO_EM_t::nodeId
uint8_t nodeId
Copy of CANopen node ID, from CO_EM_init()
Definition: CO_Emergency.h:405
CO_EM_t::fifoCount
uint8_t fifoCount
Count of emergency messages in fifo, used for OD object 0x1003.
Definition: CO_Emergency.h:398
CO_EM_NO_ERROR
@ CO_EM_NO_ERROR
0x00, Error Reset or No Error
Definition: CO_Emergency.h:249
CO_CONFIG_EM_BUFFER_SIZE
#define CO_CONFIG_EM_BUFFER_SIZE
Size of the internal buffer, where emergencies are stored after error indication with CO_error() func...
Definition: CO_config.h:228
CO_errorRegister_t
CO_errorRegister_t
CANopen Error register.
Definition: CO_Emergency.h:119
CO_EM_HB_CONSUMER_REMOTE_RESET
@ CO_EM_HB_CONSUMER_REMOTE_RESET
0x1C, communication, critical, Heartbeat consumer detected remote node reset
Definition: CO_Emergency.h:310
CO_EM_t::errorRegister
uint8_t * errorRegister
Pointer to error register in object dictionary at 0x1001,00.
Definition: CO_Emergency.h:373
CO_EM_initCallbackPre
void CO_EM_initCallbackPre(CO_EM_t *em, void *object, void(*pFunctSignal)(void *object))
Initialize Emergency callback function.
CO_EM_t::fifoOverflow
uint8_t fifoOverflow
Indication of overflow - messages in buffer are not post-processed.
Definition: CO_Emergency.h:396
CO_EM_HEARTBEAT_CONSUMER
@ CO_EM_HEARTBEAT_CONSUMER
0x1B, communication, critical, Heartbeat consumer timeout
Definition: CO_Emergency.h:307
CO_EMC_TEMP_AMBIENT
@ CO_EMC_TEMP_AMBIENT
0x41xx, Ambient Temperature
Definition: CO_Emergency.h:160
CO_EM_CAN_BUS_WARNING
@ CO_EM_CAN_BUS_WARNING
0x01, communication, info, CAN bus warning limit reached
Definition: CO_Emergency.h:251
CO_getErrorRegister
static uint8_t CO_getErrorRegister(CO_EM_t *em)
Get error register.
Definition: CO_Emergency.h:620
CO_EM_t::fifoPpPtr
uint8_t fifoPpPtr
Pointer for the fifo, where next emergency message has to be post-processed by CO_EM_process() functi...
Definition: CO_Emergency.h:394
CO_EM_11_unused
@ CO_EM_11_unused
0x11, communication, critical, (unused)
Definition: CO_Emergency.h:286
CO_EM_t
Emergency object.
Definition: CO_Emergency.h:369
CO_EM_23_unused
@ CO_EM_23_unused
0x23, generic, info, (unused)
Definition: CO_Emergency.h:326
CO_EMC401_IN_VOLT_HI
@ CO_EMC401_IN_VOLT_HI
0x3110, DS401, Input voltage too high
Definition: CO_Emergency.h:217
CO_EM_t::fifoWrPtr
uint8_t fifoWrPtr
Pointer for the fifo buffer, where next emergency message will be written by CO_error() function.
Definition: CO_Emergency.h:390
CO_CONFIG_EM
#define CO_CONFIG_EM
Configuration of Emergency.
Definition: CO_config.h:197
CO_EMC_CAN_PASSIVE
@ CO_EMC_CAN_PASSIVE
0x8120, CAN in Error Passive Mode
Definition: CO_Emergency.h:182
CO_EM_1F_unused
@ CO_EM_1F_unused
0x1F, communication, critical, (unused)
Definition: CO_Emergency.h:316
CO_EMC_SYNC_DATA_LENGTH
@ CO_EMC_SYNC_DATA_LENGTH
0x8240, Unexpected SYNC data length
Definition: CO_Emergency.h:198
CO_EM_t::errorStatusBits
uint8_t errorStatusBits[CO_CONFIG_EM_ERR_STATUS_BITS_COUNT/8]
Bitfield for the internal indication of the error condition.
Definition: CO_Emergency.h:371
CO_ODinterface.h
CANopen Object Dictionary interface.
CO_EM_t::functSignalObjectPre
void * functSignalObjectPre
From CO_EM_initCallbackPre() or NULL.
Definition: CO_Emergency.h:437
CO_EM_25_unused
@ CO_EM_25_unused
0x25, generic, info, (unused)
Definition: CO_Emergency.h:330
CO_EMC_TIME_DATA_LENGTH
@ CO_EMC_TIME_DATA_LENGTH
0x8260, Unexpected TIME data length
Definition: CO_Emergency.h:202
CO_EMC_PDO_LENGTH_EXC
@ CO_EMC_PDO_LENGTH_EXC
0x8220, PDO length exceeded
Definition: CO_Emergency.h:194
CO_EM_init
CO_ReturnError_t CO_EM_init(CO_EM_t *em, const OD_entry_t *OD_1001_errReg, const OD_entry_t *OD_1014_cobIdEm, CO_CANmodule_t *CANdevTx, uint16_t CANdevTxIdx, const OD_entry_t *OD_1015_InhTime, const OD_entry_t *OD_1003_preDefErr, const OD_entry_t *OD_statusBits, CO_CANmodule_t *CANdevRx, uint16_t CANdevRxIdx, const uint8_t nodeId)
Initialize Emergency object.
CO_EMC_EXTERNAL_ERROR
@ CO_EMC_EXTERNAL_ERROR
0x90xx, External Error
Definition: CO_Emergency.h:204
CO_EM_0C_unused
@ CO_EM_0C_unused
0x0C, communication, info, (unused)
Definition: CO_Emergency.h:275
CO_EM_TIME_LENGTH
@ CO_EM_TIME_LENGTH
0x0A, communication, info, Unexpected TIME data length
Definition: CO_Emergency.h:271
CO_EMC401_OUT_VOLT_HIGH
@ CO_EMC401_OUT_VOLT_HIGH
0x3310, DS401, Output voltage too high
Definition: CO_Emergency.h:225
CO_EMC_VOLTAGE_MAINS
@ CO_EMC_VOLTAGE_MAINS
0x31xx, Mains Voltage
Definition: CO_Emergency.h:152
CO_EM_17_unused
@ CO_EM_17_unused
0x17, communication, critical, (unused)
Definition: CO_Emergency.h:299
CO_EMC_TEMP_DEVICE
@ CO_EMC_TEMP_DEVICE
0x42xx, Device Temperature
Definition: CO_Emergency.h:162
CO_EM_0E_unused
@ CO_EM_0E_unused
0x0E, communication, info, (unused)
Definition: CO_Emergency.h:279
CO_EM_initCallbackRx
void CO_EM_initCallbackRx(CO_EM_t *em, void(*pFunctSignalRx)(const uint16_t ident, const uint16_t errorCode, const uint8_t errorRegister, const uint8_t errorBit, const uint32_t infoCode))
Initialize Emergency received callback function.
CO_isError
static bool_t CO_isError(CO_EM_t *em, const uint8_t errorBit)
Check specific error condition.
Definition: CO_Emergency.h:605
CO_EM_0D_unused
@ CO_EM_0D_unused
0x0D, communication, info, (unused)
Definition: CO_Emergency.h:277
CO_ERR_REG_MANUFACTURER
@ CO_ERR_REG_MANUFACTURER
bit 7, manufacturer specific
Definition: CO_Emergency.h:127
CO_EMC_RPDO_TIMEOUT
@ CO_EMC_RPDO_TIMEOUT
0x8250, RPDO timeout
Definition: CO_Emergency.h:200
NULL
#define NULL
NULL, for general usage.
Definition: CO_driver.h:135
CO_EM_RXMSG_OVERFLOW
@ CO_EM_RXMSG_OVERFLOW
0x03, communication, info, Previous received CAN message wasn't processed yet
Definition: CO_Emergency.h:257
CO_EMC_CAN_OVERRUN
@ CO_EMC_CAN_OVERRUN
0x8110, CAN Overrun (Objects lost)
Definition: CO_Emergency.h:180
CO_CANmodule_t
Complete CAN module object.
Definition: CO_driver.h:319
CO_EM_ISR_TIMER_OVERFLOW
@ CO_EM_ISR_TIMER_OVERFLOW
0x29, generic, critical, Timer task has overflowed
Definition: CO_Emergency.h:339
CO_EM_process
void CO_EM_process(CO_EM_t *em, bool_t NMTisPreOrOperational, uint32_t timeDifference_us, uint32_t *timerNext_us)
Process Error control and Emergency object.
Definition: CO_Emergency.c:538
CO_EMC401_IN_VOLT_LOW
@ CO_EMC401_IN_VOLT_LOW
0x3120, DS401, Input voltage too low
Definition: CO_Emergency.h:219
CO_EM_TIME_TIMEOUT
@ CO_EM_TIME_TIMEOUT
0x09, communication, info, TIME message timeout
Definition: CO_Emergency.h:269
OD_entry_t
Object Dictionary entry for one OD object.
Definition: CO_ODinterface.h:336
CO_EMC_SOFTWARE_USER
@ CO_EMC_SOFTWARE_USER
0x62xx, User Software
Definition: CO_Emergency.h:170
CO_EM_MEMORY_ALLOCATION_ERROR
@ CO_EM_MEMORY_ALLOCATION_ERROR
0x2A, generic, critical, Unable to allocate memory for objects
Definition: CO_Emergency.h:341
CO_EMC_VOLTAGE
@ CO_EMC_VOLTAGE
0x30xx, Voltage
Definition: CO_Emergency.h:150
CO_EM_16_unused
@ CO_EM_16_unused
0x16, communication, critical, (unused)
Definition: CO_Emergency.h:297
CO_EM_PDO_WRONG_MAPPING
@ CO_EM_PDO_WRONG_MAPPING
0x1A, communication, critical, Error with PDO mapping
Definition: CO_Emergency.h:305
CO_EMC_TEMPERATURE
@ CO_EMC_TEMPERATURE
0x40xx, Temperature
Definition: CO_Emergency.h:158
CO_ERR_REG_TEMPERATURE
@ CO_ERR_REG_TEMPERATURE
bit 3, temperature
Definition: CO_Emergency.h:123
CO_EMC_CURRENT_INSIDE
@ CO_EMC_CURRENT_INSIDE
0x22xx, Current inside the device
Definition: CO_Emergency.h:146
CO_EMC_CURRENT_INPUT
@ CO_EMC_CURRENT_INPUT
0x21xx, Current, device input side
Definition: CO_Emergency.h:144
CO_CANtx_t
Configuration object for CAN transmit message for specific CANopenNode Object.
Definition: CO_driver.h:299
CO_EMC_NO_ERROR
@ CO_EMC_NO_ERROR
0x00xx, error Reset or No Error
Definition: CO_Emergency.h:138
CO_EM_t::inhibitEmTime_us
uint32_t inhibitEmTime_us
Inhibit time for emergency message, from Object dictionary.
Definition: CO_Emergency.h:418
CO_EM_26_unused
@ CO_EM_26_unused
0x26, generic, info, (unused)
Definition: CO_Emergency.h:332
uint8_t
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition: CO_driver.h:151
CO_EM_RPDO_WRONG_LENGTH
@ CO_EM_RPDO_WRONG_LENGTH
0x04, communication, info, Wrong data length of received PDO
Definition: CO_Emergency.h:259