Update WS2812FX lib
This commit is contained in:
parent
4881a0edcc
commit
ce2a07f9c2
File diff suppressed because it is too large
Load Diff
|
@ -38,6 +38,7 @@
|
|||
#define WS2812FX_h
|
||||
|
||||
#include "core/pio.h"
|
||||
#include "extdrv/ws2812.h"
|
||||
|
||||
#define FX_DEFAULT_BRIGHTNESS 50
|
||||
#define FX_DEFAULT_MODE 0
|
||||
|
@ -103,16 +104,11 @@ enum ModeFX {
|
|||
FX_MODE_COUNT
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct ws2812fx {
|
||||
struct ws2812_conf* wsconf;
|
||||
int _running;
|
||||
int _triggered;
|
||||
|
||||
uint8_t _mode_index;
|
||||
uint8_t _speed;
|
||||
uint8_t _brightness;
|
||||
|
||||
uint16_t _led_count;
|
||||
|
||||
uint32_t _color;
|
||||
uint32_t _counter_mode_call;
|
||||
uint32_t _counter_mode_step;
|
||||
|
@ -120,33 +116,39 @@ typedef struct {
|
|||
uint32_t _mode_delay;
|
||||
|
||||
unsigned long _mode_last_call_time;
|
||||
} ws2812fx_t;
|
||||
|
||||
void WS2812FX(ws2812fx_t *fx, uint16_t n, const struct pio *pin);
|
||||
uint16_t _led_count;
|
||||
|
||||
void FX_init(ws2812fx_t *fx);
|
||||
void FX_service(ws2812fx_t *fx);
|
||||
void FX_start(ws2812fx_t *fx);
|
||||
void FX_stop(ws2812fx_t *fx);
|
||||
void FX_setMode(ws2812fx_t *fx, uint8_t m);
|
||||
void FX_setSpeed(ws2812fx_t *fx, uint8_t s);
|
||||
void FX_increaseSpeed(ws2812fx_t *fx, uint8_t s);
|
||||
void FX_decreaseSpeed(ws2812fx_t *fx, uint8_t s);
|
||||
void FX_setRGBColor(ws2812fx_t *fx, uint8_t r, uint8_t g, uint8_t b);
|
||||
void FX_setColor(ws2812fx_t *fx, uint32_t c);
|
||||
void FX_trigger(ws2812fx_t *fx);
|
||||
void FX_setBrightness(ws2812fx_t *fx, uint8_t b);
|
||||
void FX_increaseBrightness(ws2812fx_t *fx, uint8_t s);
|
||||
void FX_decreaseBrightness(ws2812fx_t *fx, uint8_t s);
|
||||
uint8_t _mode_index;
|
||||
uint8_t _speed;
|
||||
uint8_t _brightness;
|
||||
};
|
||||
|
||||
int FX_isRunning(ws2812fx_t *fx);
|
||||
void WS2812FX(struct ws2812fx* fx, uint16_t n, const struct pio* pin);
|
||||
|
||||
uint8_t FX_getMode(ws2812fx_t *fx);
|
||||
uint8_t FX_getSpeed(ws2812fx_t *fx);
|
||||
uint8_t FX_getBrightness(ws2812fx_t *fx);
|
||||
uint8_t FX_getModeCount(ws2812fx_t *fx);
|
||||
void FX_init(struct ws2812fx* fx);
|
||||
void FX_service(struct ws2812fx* fx);
|
||||
void FX_start(struct ws2812fx* fx);
|
||||
void FX_stop(struct ws2812fx* fx);
|
||||
void FX_setMode(struct ws2812fx* fx, uint8_t m);
|
||||
void FX_setSpeed(struct ws2812fx* fx, uint8_t s);
|
||||
void FX_increaseSpeed(struct ws2812fx* fx, uint8_t s);
|
||||
void FX_decreaseSpeed(struct ws2812fx* fx, uint8_t s);
|
||||
void FX_setRGBColor(struct ws2812fx* fx, uint8_t r, uint8_t g, uint8_t b);
|
||||
void FX_setColor(struct ws2812fx* fx, uint32_t c);
|
||||
void FX_trigger(struct ws2812fx* fx);
|
||||
void FX_setBrightness(struct ws2812fx* fx, uint8_t b);
|
||||
void FX_increaseBrightness(struct ws2812fx* fx, uint8_t s);
|
||||
void FX_decreaseBrightness(struct ws2812fx* fx, uint8_t s);
|
||||
|
||||
uint32_t FX_getColor(ws2812fx_t *fx);
|
||||
int FX_isRunning(struct ws2812fx* fx);
|
||||
|
||||
uint8_t FX_getMode(struct ws2812fx* fx);
|
||||
uint8_t FX_getSpeed(struct ws2812fx* fx);
|
||||
uint8_t FX_getBrightness(struct ws2812fx* fx);
|
||||
uint8_t FX_getModeCount(struct ws2812fx* fx);
|
||||
|
||||
uint32_t FX_getColor(struct ws2812fx* fx);
|
||||
|
||||
const char* FX_getModeName(uint8_t m);
|
||||
|
||||
|
|
Loading…
Reference in New Issue