Electronic Load  1.0
Programmable Constant Current Sink
led.h
Go to the documentation of this file.
1 
51 #ifndef LED_H_
52 #define LED_H_
53 
54 #include "Eload.h"
55 #include "spi.h"
56 
57 #define LED_USE_TIMER
58 static const uint8_t LED_TIMER_SLOWDOWN=20;
59 
60 #define LEDREDPORT PORTC
61 #define LEDREDMASK 0b00000001
62 
68 typedef uint8_t LED_FLASH_t;
69 
74 static const LED_FLASH_t LED_BLINK_ON = 0b11111111;
75 static const LED_FLASH_t LED_BLINK_OFF = 0b00000000;
76 static const LED_FLASH_t LED_BLINK_SLOW = 0b00001111;
77 static const LED_FLASH_t LED_BLINK_NORMAL = 0b00110011;
78 static const LED_FLASH_t LED_BLINK_FAST = 0b01010101;
79 static const LED_FLASH_t LED_BLINK_BEACON = 0b00000001;
80 
81 typedef union
82 {
83  struct
84  {
93  } named;
94  LED_FLASH_t array[8];
95 } LED_DATA_t;
96 extern LED_DATA_t ledData;
97 
99 static inline void LEDRedOn(void)
100 {
102 }
103 
105 static inline void LEDRedOff(void)
106 {
108 }
109 
111 static inline void SetSOAError(void)
112 {
114  eflags|=EFLAG_SOA;
115 }
116 
118 static inline void ClearSOAError(void)
119 {
121  eflags&= ~EFLAG_SOA;
122 }
123 
125 static inline void SetOvertempError(void)
126 {
129 }
130 
132 static inline void ClearOvertempError(void)
133 {
135  eflags&= ~EFLAG_TEMP;
136 }
137 
138 extern LED_FLASH_t ledRedData;
139 void LedTimerCallback(void);
140 
141 
142 #endif /* LED_H_ */
volatile uint8_t eflags
Error Flags.
Definition: Eload.c:64
struct LED_DATA_t::@1 named
static const LED_FLASH_t LED_BLINK_SLOW
slow blinking, period=1.6s
Definition: led.h:76
static const uint8_t EFLAG_TEMP
Heat Sink Overtemp.
Definition: Eload.h:60
static void LEDRedOff(void)
Switches the red LED off.
Definition: led.h:105
static const LED_FLASH_t LED_BLINK_NORMAL
normal speed blinking, period=0.8s
Definition: led.h:77
static void ClearOvertempError(void)
Clears the Overtemp Error Flag and the LED.
Definition: led.h:132
Definition: led.h:81
#define LEDREDMASK
Definition: led.h:61
LED_FLASH_t overTemp
Definition: led.h:89
LED_FLASH_t fuse
Definition: led.h:91
#define LEDREDPORT
Definition: led.h:60
static const uint8_t EFLAG_SOA
Indicates Limits caused by the SOA of the Transistor. Should be somehow displayed!
Definition: Eload.h:59
static void ClearSOAError(void)
Clears the SOA Error Flag and the LED.
Definition: led.h:118
static const LED_FLASH_t LED_BLINK_ON
always on
Definition: led.h:74
static void SetSOAError(void)
Sets the SOA Error Flag and the LED.
Definition: led.h:111
LED_FLASH_t powerRed
Definition: led.h:86
static void LEDRedOn(void)
Switches the red LED on.
Definition: led.h:99
void LedTimerCallback(void)
Timer Callback Function.
Definition: led.c:29
static const LED_FLASH_t LED_BLINK_OFF
always off
Definition: led.h:75
static void SetOvertempError(void)
Sets the Overtemp Error Flag and the LED.
Definition: led.h:125
LED_FLASH_t spare
Definition: led.h:92
uint8_t LED_FLASH_t
Typedef for LED flashing.
Definition: led.h:68
static const LED_FLASH_t LED_BLINK_FAST
fast blinking, period=0.4s
Definition: led.h:78
static const LED_FLASH_t LED_BLINK_BEACON
short pulse, 200ms on, 1.4s off
Definition: led.h:79
LED_FLASH_t rangeBlue
Definition: led.h:88
LED_DATA_t ledData
This is the pattern the eight leds should blink. Every '1'-bit means the LED is on....
Definition: Eload.c:71
LED_FLASH_t powerGreen
Definition: led.h:85
LED_FLASH_t rangeGreen
Definition: led.h:87
LED_FLASH_t ledRedData
This is the pattern the debug led should blink.
Definition: Eload.c:70
LED_FLASH_t SOA
Definition: led.h:90