CANopenNode
CO_LEDs.h
Go to the documentation of this file.
1 
26 #ifndef CO_LEDS_H
27 #define CO_LEDS_H
28 
29 #include "301/CO_driver.h"
30 #include "301/CO_NMT_Heartbeat.h"
31 
32 /* default configuration, see CO_config.h */
33 #ifndef CO_CONFIG_LEDS
34 #define CO_CONFIG_LEDS (CO_CONFIG_LEDS_ENABLE)
35 #endif
36 
37 #if ((CO_CONFIG_LEDS) & CO_CONFIG_LEDS_ENABLE) || defined CO_DOXYGEN
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
74 typedef enum {
75  CO_LED_flicker = 0x01,
76  CO_LED_blink = 0x02,
77  CO_LED_flash_1 = 0x04,
78  CO_LED_flash_2 = 0x08,
79  CO_LED_flash_3 = 0x10,
80  CO_LED_flash_4 = 0x20,
83 
85 #define CO_LED_RED(LEDs, BITFIELD) (((LEDs)->LEDred & BITFIELD) ? 1 : 0)
86 
87 #define CO_LED_GREEN(LEDs, BITFIELD) (((LEDs)->LEDgreen & BITFIELD) ? 1 : 0)
88 
89 
93 typedef struct{
102 } CO_LEDs_t;
103 
104 
115 
116 
136 void CO_LEDs_process(CO_LEDs_t *LEDs,
137  uint32_t timeDifference_us,
138  CO_NMT_internalState_t NMTstate,
139  bool_t LSSconfig,
140  bool_t ErrCANbusOff,
141  bool_t ErrCANbusWarn,
142  bool_t ErrRpdo,
143  bool_t ErrSync,
144  bool_t ErrHbCons,
145  bool_t ErrOther,
146  bool_t firmwareDownload,
147  uint32_t *timerNext_us);
148  /* CO_LEDs */
150 
151 #ifdef __cplusplus
152 }
153 #endif /*__cplusplus*/
154 
155 #endif /* (CO_CONFIG_LEDS) & CO_CONFIG_LEDS_ENABLE */
156 
157 #endif /* CO_LEDS_H */
uint32_t
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
CO_driver.h
Interface between CAN hardware and CANopenNode.
CO_LEDs_t::LEDred
uint8_t LEDred
red led CO_LED_BITFIELD_t
Definition: CO_LEDs.h:100
CO_LEDs_init
CO_ReturnError_t CO_LEDs_init(CO_LEDs_t *LEDs)
Initialize LEDs object.
CO_LED_BITFIELD_t
CO_LED_BITFIELD_t
Bitfield for combining with red or green led.
Definition: CO_LEDs.h:74
CO_LED_flash_3
@ CO_LED_flash_3
LED triple flash.
Definition: CO_LEDs.h:79
CO_LEDs_t
LEDs object, initialized by CO_LEDs_init()
Definition: CO_LEDs.h:93
CO_ReturnError_t
CO_ReturnError_t
Return values of some CANopen functions.
Definition: CO_driver.h:488
CO_LED_blink
@ CO_LED_blink
LED blinking 2,5Hz.
Definition: CO_LEDs.h:76
bool_t
unsigned char bool_t
Boolean data type for general use.
Definition: CO_driver.h:141
CO_LEDs_t::LEDtmrflash_1
uint8_t LEDtmrflash_1
single flash led timer
Definition: CO_LEDs.h:96
CO_LEDs_t::LEDgreen
uint8_t LEDgreen
green led CO_LED_BITFIELD_t
Definition: CO_LEDs.h:101
CO_LEDs_t::LEDtmrflash_3
uint8_t LEDtmrflash_3
triple flash led timer
Definition: CO_LEDs.h:98
CO_LED_CANopen
@ CO_LED_CANopen
LED CANopen according to CiA 303-3.
Definition: CO_LEDs.h:81
CO_LEDs_process
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.
CO_LED_flash_4
@ CO_LED_flash_4
LED quadruple flash.
Definition: CO_LEDs.h:80
CO_LEDs_t::LEDtmrflash_2
uint8_t LEDtmrflash_2
double flash led timer
Definition: CO_LEDs.h:97
CO_LEDs_t::LEDtmrflash_4
uint8_t LEDtmrflash_4
quadruple flash led timer
Definition: CO_LEDs.h:99
CO_NMT_internalState_t
CO_NMT_internalState_t
Internal network state of the CANopen node.
Definition: CO_NMT_Heartbeat.h:77
CO_NMT_Heartbeat.h
CANopen Network management and Heartbeat producer protocol.
CO_LEDs_t::LEDtmr50ms
uint32_t LEDtmr50ms
50ms led timer
Definition: CO_LEDs.h:94
CO_LED_flicker
@ CO_LED_flicker
LED flickering 10Hz.
Definition: CO_LEDs.h:75
CO_LEDs_t::LEDtmr200ms
uint8_t LEDtmr200ms
200ms led timer
Definition: CO_LEDs.h:95
CO_LED_flash_2
@ CO_LED_flash_2
LED double flash.
Definition: CO_LEDs.h:78
CO_LED_flash_1
@ CO_LED_flash_1
LED single flash.
Definition: CO_LEDs.h:77
uint8_t
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition: CO_driver.h:151