#ifndef USER_WS2812B_H__
#define USER_WS2812B_H__

#include <stdint.h>
#include <stdbool.h>
#include "define.h"
#include "ws2812b_spi.h"

#define USER_WS2812B_INTERVAL				            10

#define WS2812B_LOW                                     0xC0
#define WS2812B_HIGH                                    0xF0

typedef enum
{
    WS2812B_QUEUE_TIME        = 0,
    WS2812B_QUEUE_INT		  = 1,
}USER_WS2812B_QUEUE_TYPE;

typedef struct{
    bool change;                                        //是否有变化
    uint8_t bright;                                     //灯亮度
    uint8_t rValue;
    uint8_t gValue;
    uint8_t bValue;
}ws2812b_led_param_s;

typedef struct{
    bool txStat;                                        //数据写状态
    uint8_t count;                                      //灯的数量
    ws2812b_led_param_s *led_param;
    uint8_t *rgbValue;
}user_ws2812b_work_s;
    
void vUser_ws2812b_init(uint8_t count);
void vUser_ws2812b_task_start(void);
void vUser_ws2812b_set_tx_stat(bool stat);
void vUser_ws2812b_set_stat(uint8_t idx, uint8_t r, uint8_t g, uint8_t b, uint8_t bright);

#ifdef __cplusplus
}
#endif

#endif // USER_WS2812B_H__

/** @} */
