44 lines
654 B
C
Executable File
44 lines
654 B
C
Executable File
#pragma once
|
|
|
|
#include "main.h"
|
|
|
|
#pragma pack(push, 1)
|
|
|
|
typedef struct{
|
|
uint8_t R;
|
|
uint8_t G;
|
|
uint8_t B;
|
|
|
|
}RGB_t;
|
|
|
|
typedef struct{
|
|
RGB_t Color1;
|
|
uint8_t Tr; //20ms/step, 5.1s max
|
|
uint8_t Th; //20ms/step, 5.1s max
|
|
uint8_t Tf; //20ms/step, 5.1s max
|
|
uint8_t Tl; //20ms/step, 5.1s max
|
|
RGB_t Color2;
|
|
//uint8_t rsvd[6]; // 6 bytes reserved
|
|
}RGB_Cycle_t;
|
|
|
|
#pragma pack(pop)
|
|
|
|
typedef enum{
|
|
LED_RISING,
|
|
LED_HIGH,
|
|
LED_FALLING,
|
|
LED_LOW,
|
|
}RGB_Phase_t;
|
|
|
|
typedef struct{
|
|
uint8_t state; // 0 1 2 3
|
|
uint16_t tick;
|
|
RGB_t color;
|
|
uint8_t phasesync;
|
|
}RGB_State_t;
|
|
|
|
void LED_Task();
|
|
void LED_Write();
|
|
void LED_Init();
|
|
void LED_SetColor(RGB_Cycle_t *color);
|