CANopenNode
CANopen protocol stack
|
Specified in standard CiA 303-3. More...
Topics | |
CO_LED bitmasks | |
Bitmasks for the LED indicators | |
Files | |
file | CO_LEDs.h |
CANopen Indicator specification (CiA 303-3 v1.4.0) | |
Data Structures | |
struct | CO_LEDs_t |
LEDs object, initialized by CO_LEDs_init() More... | |
Macros | |
#define | CO_LED_RED(LEDs, BITMASK) ((((LEDs)->LEDred & BITMASK) != 0U) ? 1U : 0U) |
Get on/off state for red led for one of the CO_LED bitmasks. | |
#define | CO_LED_GREEN(LEDs, BITMASK) ((((LEDs)->LEDgreen & BITMASK) != 0U) ? 1U : 0U) |
Get on/off state for green led for one of the CO_LED bitmasks. | |
Functions | |
CO_ReturnError_t | CO_LEDs_init (CO_LEDs_t *LEDs) |
Initialize LEDs object. | |
void | CO_LEDs_process (CO_LEDs_t *LEDs, uint32_t timeDifference_us, CO_NMT_internalState_t NMTstate, bool_t LSSconfig, bool_t ErrCANbusOff, bool_t ErrCANbusWarn, bool_t ErrRpdo, bool_t ErrSync, bool_t ErrHbCons, bool_t ErrOther, bool_t firmwareDownload, uint32_t *timerNext_us) |
Process indicator states. | |
Specified in standard CiA 303-3.
CIA 303-3 standard specifies indicator LED diodes, which reflects state of the CANopen device. Green and red leds or bi-color led can be used.
CANopen green led - run led:
CANopen red led - error led:
To apply on/off state to the led diode, use CO_LED_RED or CO_LED_GREEN macros with one of the CO_LED bitmasks. For CANopen leds use CO_LED_CANopen bitmask.
CO_ReturnError_t CO_LEDs_init | ( | CO_LEDs_t * | LEDs | ) |
Initialize LEDs object.
Function must be called in the communication reset section.
LEDs | This object will be initialized. |
void CO_LEDs_process | ( | CO_LEDs_t * | LEDs, |
uint32_t | timeDifference_us, | ||
CO_NMT_internalState_t | NMTstate, | ||
bool_t | LSSconfig, | ||
bool_t | ErrCANbusOff, | ||
bool_t | ErrCANbusWarn, | ||
bool_t | ErrRpdo, | ||
bool_t | ErrSync, | ||
bool_t | ErrHbCons, | ||
bool_t | ErrOther, | ||
bool_t | firmwareDownload, | ||
uint32_t * | timerNext_us ) |
Process indicator states.
Function must be called cyclically.
LEDs | This object. | |
timeDifference_us | Time difference from previous function call in [microseconds]. | |
NMTstate | NMT operating state. | |
LSSconfig | Node is in LSS configuration state indication. | |
ErrCANbusOff | CAN bus off indication (highest priority). | |
ErrCANbusWarn | CAN error warning limit reached indication. | |
ErrRpdo | RPDO event timer timeout indication. | |
ErrSync | Sync receive timeout indication. | |
ErrHbCons | Heartbeat consumer error (remote node) indication. | |
ErrOther | Other error indication (lowest priority). | |
firmwareDownload | Firmware download is in progress indication. | |
[out] | timerNext_us | info to OS - see CO_process(). |