37#ifndef DRIVER_WS2812B_H
38#define DRIVER_WS2812B_H
62#ifndef WS2812B_EACH_RESET_BIT_FRAME_LEN
63 #define WS2812B_EACH_RESET_BIT_FRAME_LEN 512
112#define DRIVER_WS2812B_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
120#define DRIVER_WS2812B_LINK_SPI_10MHZ_INIT(HANDLE, FUC) (HANDLE)->spi_10mhz_init = FUC
128#define DRIVER_WS2812B_LINK_SPI_DEINIT(HANDLE, FUC) (HANDLE)->spi_deinit = FUC
136#define DRIVER_WS2812B_LINK_SPI_WRITE_COMMAND(HANDLE, FUC) (HANDLE)->spi_write_cmd = FUC
144#define DRIVER_WS2812B_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
152#define DRIVER_WS2812B_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
uint8_t ws2812b_info(ws2812b_info_t *info)
get chip's information
struct ws2812b_info_s ws2812b_info_t
ws2812b information structure definition
uint8_t ws2812b_write(ws2812b_handle_t *handle, uint32_t *rgb, uint32_t len, uint8_t *temp, uint32_t temp_len)
write reset and color frame
uint8_t ws2812b_deinit(ws2812b_handle_t *handle)
close the chip
struct ws2812b_handle_s ws2812b_handle_t
ws2812b handle structure definition
uint8_t ws2812b_write_only_reset(ws2812b_handle_t *handle, uint32_t len, uint8_t *temp, uint32_t temp_len)
write the reset frame
uint8_t ws2812b_write_only_color(ws2812b_handle_t *handle, uint32_t *rgb, uint32_t len, uint8_t *temp, uint32_t temp_len)
write the color frame
uint8_t ws2812b_init(ws2812b_handle_t *handle)
initialize the chip
uint8_t ws2812b_set_reg(ws2812b_handle_t *handle, uint8_t *buf, uint16_t len)
set the chip register
ws2812b handle structure definition
void(* delay_ms)(uint32_t ms)
void(* debug_print)(const char *const fmt,...)
uint8_t(* spi_deinit)(void)
uint8_t(* spi_10mhz_init)(void)
uint8_t(* spi_write_cmd)(uint8_t *buf, uint16_t len)
ws2812b information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v