CANopen Bootloader Documentation
Version 4.10.00
|
The LED module supports two types of LEDs: a Module LED and a Network LED. The Module LED displays the state of the hardware, e.g. power supply, driver stage, etc. The Network LED displays the state of the CAN connection and the CANopen NMT state. Both LEDs should be bi-color LEDs. If not, the patterns for the blinking code may need to be adopted.
In the implementation, each LED gets two patterns - one for the red LED and one for the green LED (bi-color LED). Both patterns have a length of 32 bit. With a given default pattern shift rate of 50 ms (defined by the symbol CBL_LED_PERIOD) the total pattern length can be 1,6 seconds.
Please note that this implementation is not fully compliant to DR-303-3.
The LED functionality is only compiled when the symbol CBL_LED_SUPPORT (see cbl_conf.h) is set to a value greater 0.
The Network LED is autonomously run by the CANopen stack, i.e. no function has to be called by the user application. The following functions must be adopted to the target hardware for Network LED support:
The Module LED must be driven by the user application, i.e. you have to call the CblLedModuleStatus() function somewhere. The following functions must be adopted to the target hardware for Module LED support:
Enumerations | |
enum | CblLedMod_e { eCblLedMod_OK = 0 , eCblLedMod_FAIL_BAUD , eCblLedMod_FAIL_ADDR , eCblLedMod_RECOVER , eCblLedMod_APP1 , eCblLedMod_APP2 } |
enum | CblLedNet_e { eCblLedNet_STOPPED = 0 , eCblLedNet_PREOPERATIONAL , eCblLedNet_OPERATIONAL , eCblLedNet_INIT } |
enum | CblLedErr_e { eCblLedErr_NONE = 0 , eCblLedErr_BUS_WARN , eCblLedErr_BUS_PASSIVE , eCblLedErr_BUS_OFF , eCblLedErr_RESERVED } |
Functions | |
void | CblLedModGreen (bool_t btSwitchOnV) |
void | CblLedModRed (bool_t btSwitchOnV) |
void | CblLedModuleStatus (uint8_t ubStatusV) |
void | CblLedNetGreen (bool_t btSwitchOnV) |
void | CblLedNetRed (bool_t btSwitchOnV) |
enum CblLedErr_e |
Network LED - error states.
This enumeration defines the CAN error states for the red network LED. The definitions are used by the function CblLedNetworkError().
enum CblLedMod_e |
Module LED states.
This enumeration defines all states for the module LED. The optional module LED displays the state of the hardware, not the network (i.e. CAN) state.
enum CblLedNet_e |
Network LED - NMT states.
This enumeration defines the NMT states for the green network LED. The definitions are used by the function CblLedNetworkStatus().
void CblLedModGreen | ( | bool_t | btSwitchOnV | ) |
[in] | btSwitchOnV | state of green module LED |
cbl_user.c
. The function is called by the protocol stack only if the symbol CBL_LED_SUPPORT is set to 2.Depending on the parameter btSwitchOnV the function switches the green module LED on or off.
btSwitchOnV
= 0: LED is switched off btSwitchOnV
= 1: LED is switched on void CblLedModRed | ( | bool_t | btSwitchOnV | ) |
[in] | btSwitchOnV | state of red module LED |
cbl_user.c
. The function is called by the protocol stack only if the symbol CBL_LED_SUPPORT is set to 2.Depending on the parameter btSwitchOnV the function switches the red module LED on or off.
btSwitchOnV
= 0: LED is switched off btSwitchOnV
= 1: LED is switched on void CblLedModuleStatus | ( | uint8_t | ubStatusV | ) |
[in] | ubStatusV | Module Status |
This function sets the pattern for the Module Status LED. Valid values for the parameter ubStatusV are given in the enumeration CblLedMod_e.
void CblLedNetGreen | ( | bool_t | btSwitchOnV | ) |
[in] | btSwitchOnV | state of green network LED |
cbl_user.c
. The function is called by the protocol stack only if the symbol CBL_LED_SUPPORT is set to 1 or 2.Depending on the parameter btSwitchOnV the function switches the green network LED on or off.
btSwitchOnV
= 0: LED is switched off btSwitchOnV
= 1: LED is switched on void CblLedNetRed | ( | bool_t | btSwitchOnV | ) |
[in] | btSwitchOnV | state of red network LED |
cbl_user.c
. The function is called by the protocol stack only if the symbol CBL_LED_SUPPORT is set to 1 or 2.Depending on the parameter btSwitchOnV the function switches the red network LED on or off.
btSwitchOnV
= 0: LED is switched off btSwitchOnV
= 1: LED is switched on