141 lines
2.7 KiB
C
141 lines
2.7 KiB
C
#pragma once
|
|
|
|
#include <Arduino.h>
|
|
#include <FastLED.h>
|
|
#include "ColorPalettes.h"
|
|
#include "PWM_Output.h"
|
|
|
|
#define SHIFT_INDEX -3
|
|
#define SOLID_COLOR_INDEX -2
|
|
#define OFF_INDEX -1
|
|
|
|
#define WITH_GAPS true
|
|
#define NO_GAPS false
|
|
|
|
enum CHIP_TYPE {
|
|
CHIP_WS2812B = 0,
|
|
CHIP_SK6812,
|
|
CHIP_WS2811,
|
|
CHIP_WS2815,
|
|
CHIP_UNKNOWN
|
|
};
|
|
|
|
extern uint32_t whiteTimeout;
|
|
|
|
typedef struct {
|
|
int AnimationIndex;
|
|
union {
|
|
struct {
|
|
uint8_t red;
|
|
uint8_t grn;
|
|
uint8_t blu;
|
|
uint8_t wht;
|
|
uint8_t extra[4]; // 4 extra bytes
|
|
};
|
|
uint8_t rgb[3]; // Access RGB only
|
|
uint8_t rgbw[4]; // Access RGBW
|
|
uint8_t data[8]; // Access all 8 bytes
|
|
} data;
|
|
} ANIM_EVENT;
|
|
|
|
typedef struct {
|
|
CRGB* leds;
|
|
bool enabled;
|
|
int size;
|
|
String chip;
|
|
String rgbOrder;
|
|
int shift;
|
|
int offset;
|
|
int powerDiv;
|
|
//int effSize;
|
|
uint8_t bright;
|
|
uint8_t i2sCh;
|
|
uint8_t core;
|
|
uint8_t pin;
|
|
}LEDSTRIP_SETTINGS;
|
|
|
|
typedef struct __attribute__((packed)) {
|
|
uint8_t cmd;
|
|
uint8_t limitedMode;
|
|
float temperature;
|
|
float vIn;
|
|
char profile[10];
|
|
|
|
uint8_t ledChipset1;
|
|
char rgbOrder1[4]; // 3 chars + null terminator
|
|
uint8_t ledCount1;
|
|
uint8_t ledShift1;
|
|
uint8_t ledBrightness1;
|
|
|
|
uint8_t ledChipset2;
|
|
char rgbOrder2[4]; // 3 chars + null terminator
|
|
uint8_t ledCount2;
|
|
uint8_t ledShift2;
|
|
uint8_t ledBrightness2;
|
|
|
|
uint8_t frontLightMin;
|
|
uint8_t frontLightMax;
|
|
uint8_t rearLightMin;
|
|
uint8_t rearLightMax;
|
|
uint8_t fanLowerTemp;
|
|
uint8_t fanUpperTemp;
|
|
} USER_SETTINGS;
|
|
|
|
enum BOOTH_PROFILE {
|
|
PROFILE_CUSTOM=0,
|
|
PROFILE_ROAMER,
|
|
PROFILE_STIK,
|
|
PROFILE_COUNT
|
|
};
|
|
|
|
extern LEDSTRIP_SETTINGS ledSettings[2];
|
|
|
|
|
|
void RGB_Lights_Control_Task(void *parameters);
|
|
|
|
void Init_RGB_Lights_Task(bool upgrade);
|
|
|
|
void Init_RGB_Strip(CRGB* leds, uint8_t pin, int size, const String& colorOrder, const String& chipType, uint8_t bright);
|
|
|
|
EOrder GetEOrderByString(const String& rgbStr);
|
|
|
|
void RGB_Lights_Set_Animation(int animIndex, uint8_t red, uint8_t grn, uint8_t blu);
|
|
|
|
void RGB_Animations_ON(void);
|
|
|
|
void RGB_Animations_OFF(void);
|
|
|
|
void RGB_Lights_Set_Brightness(uint8_t scale);
|
|
|
|
void Lights_Set_White(uint8_t val);
|
|
|
|
//void createFirePalette(CRGBPalette16& palette, COLOR_PACK& colorPack);
|
|
void createFirePalette(CRGBPalette16& palette, const COLOR_PACK& colorPack);
|
|
|
|
void loadColorPack(COLOR_PACK& dest, const COLOR_PACK& src);
|
|
|
|
void SetAndSaveUserSettings(USER_SETTINGS &userSettings);
|
|
|
|
|
|
//void Init_Ramp_Front_Light_Task(void);
|
|
|
|
//void Ramp_Front_Light_Control_Task(void *parameters);
|
|
|
|
//void Start_RampUp_Front_Light(int _rampTime=1000, int _startDelay=0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|