2018-07-17 15:15:58 +02:00
|
|
|
#ifndef _LED_H
|
|
|
|
#define _LED_H
|
2018-07-15 14:28:05 +02:00
|
|
|
|
|
|
|
#ifdef HAS_RGB_LED
|
|
|
|
#include <SmartLeds.h>
|
2020-03-21 08:38:42 +01:00
|
|
|
|
|
|
|
#ifndef RGB_LED_COUNT
|
|
|
|
#define RGB_LED_COUNT 1
|
|
|
|
#endif
|
|
|
|
|
2018-07-15 14:28:05 +02:00
|
|
|
#endif
|
2018-03-31 23:04:26 +02:00
|
|
|
|
|
|
|
// value for HSL color
|
|
|
|
// see http://www.workwithcolor.com/blue-color-hue-range-01.htm
|
2018-06-12 19:57:30 +02:00
|
|
|
#define COLOR_RED 0
|
|
|
|
#define COLOR_ORANGE 30
|
|
|
|
#define COLOR_ORANGE_YELLOW 45
|
|
|
|
#define COLOR_YELLOW 60
|
|
|
|
#define COLOR_YELLOW_GREEN 90
|
|
|
|
#define COLOR_GREEN 120
|
|
|
|
#define COLOR_GREEN_CYAN 165
|
|
|
|
#define COLOR_CYAN 180
|
|
|
|
#define COLOR_CYAN_BLUE 210
|
|
|
|
#define COLOR_BLUE 240
|
|
|
|
#define COLOR_BLUE_MAGENTA 275
|
|
|
|
#define COLOR_MAGENTA 300
|
|
|
|
#define COLOR_PINK 350
|
|
|
|
#define COLOR_WHITE 360
|
|
|
|
#define COLOR_NONE 999
|
2018-03-31 23:04:26 +02:00
|
|
|
|
2018-06-12 19:57:30 +02:00
|
|
|
struct RGBColor {
|
|
|
|
uint8_t R;
|
|
|
|
uint8_t G;
|
|
|
|
uint8_t B;
|
2018-03-31 23:04:26 +02:00
|
|
|
};
|
|
|
|
|
2018-07-15 14:28:05 +02:00
|
|
|
enum led_states { LED_OFF, LED_ON };
|
|
|
|
|
2018-10-03 23:07:22 +02:00
|
|
|
extern TaskHandle_t ledLoopTask;
|
|
|
|
|
2018-03-31 23:04:26 +02:00
|
|
|
// Exported Functions
|
|
|
|
void rgb_set_color(uint16_t hue);
|
2018-07-15 14:28:05 +02:00
|
|
|
void blink_LED(uint16_t set_color, uint16_t set_blinkduration);
|
2018-10-03 00:25:05 +02:00
|
|
|
void ledLoop(void *parameter);
|
2018-10-24 18:07:41 +02:00
|
|
|
void switch_LED(uint8_t state);
|
2019-03-24 01:05:13 +01:00
|
|
|
void switch_LED1(uint8_t state);
|
2018-07-17 11:53:43 +02:00
|
|
|
|
|
|
|
#endif
|