CO_LEDs.h
Go to the documentation of this file.
#ifndef CO_LEDS_H
#define CO_LEDS_H
#include "301/CO_driver.h"
#include "301/CO_NMT_Heartbeat.h"
/* default configuration, see CO_config.h */
#ifndef CO_CONFIG_LEDS
#define CO_CONFIG_LEDS (CO_CONFIG_LEDS_ENABLE)
#endif
#if ((CO_CONFIG_LEDS) & CO_CONFIG_LEDS_ENABLE) || defined CO_DOXYGEN
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
CO_LED_flicker = 0x01,
CO_LED_blink = 0x02,
CO_LED_flash_1 = 0x04,
CO_LED_flash_2 = 0x08,
CO_LED_flash_3 = 0x10,
CO_LED_flash_4 = 0x20,
CO_LED_CANopen = 0x80
} CO_LED_BITFIELD_t;
#define CO_LED_RED(LEDs, BITFIELD) (((LEDs)->LEDred & BITFIELD) ? 1 : 0)
#define CO_LED_GREEN(LEDs, BITFIELD) (((LEDs)->LEDgreen & BITFIELD) ? 1 : 0)
typedef struct{
uint32_t LEDtmr50ms;
uint8_t LEDtmr200ms;
uint8_t LEDtmrflash_1;
uint8_t LEDtmrflash_2;
uint8_t LEDtmrflash_3;
uint8_t LEDtmrflash_4;
uint8_t LEDred;
uint8_t LEDgreen;
} CO_LEDs_t;
CO_ReturnError_t CO_LEDs_init(CO_LEDs_t *LEDs);
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);
/* CO_LEDs */
#ifdef __cplusplus
}
#endif /*__cplusplus*/
#endif /* (CO_CONFIG_LEDS) & CO_CONFIG_LEDS_ENABLE */
#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