ws2812b base driver modules
More...
|
| uint8_t | ws2812b_info (ws2812b_info_t *info) |
| | get chip's information
|
| uint8_t | ws2812b_init (ws2812b_handle_t *handle) |
| | initialize the chip
|
| uint8_t | ws2812b_deinit (ws2812b_handle_t *handle) |
| | close the chip
|
| 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_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_set_reg (ws2812b_handle_t *handle, uint8_t *buf, uint16_t len) |
| | set the chip register
|
ws2812b base driver modules
◆ WS2812B_EACH_RESET_BIT_FRAME_LEN
| #define WS2812B_EACH_RESET_BIT_FRAME_LEN 512 |
ws2812b each reset bit frame length definition
512
Definition at line 63 of file driver_ws2812b.h.
◆ ws2812b_handle_t
ws2812b handle structure definition
◆ ws2812b_info_t
ws2812b information structure definition
◆ ws2812b_deinit()
close the chip
- Parameters
-
| [in] | *handle | pointer to a ws2812b handle structure |
- Returns
- status code
- 0 success
- 1 spi deinit failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 390 of file driver_ws2812b.c.
◆ ws2812b_info()
get chip's information
- Parameters
-
| [out] | *info | pointer to a ws2812b info structure |
- Returns
- status code
- 0 success
- 2 handle is NULL
- Note
- none
Definition at line 449 of file driver_ws2812b.c.
◆ ws2812b_init()
initialize the chip
- Parameters
-
| [in] | *handle | pointer to a ws2812b handle structure |
- Returns
- status code
- 0 success
- 1 spi initialization failed
- 2 handle is NULL
- 3 linked functions is NULL
- Note
- none
Definition at line 61 of file driver_ws2812b.c.
◆ ws2812b_set_reg()
| uint8_t ws2812b_set_reg |
( |
ws2812b_handle_t * | handle, |
|
|
uint8_t * | buf, |
|
|
uint16_t | len ) |
set the chip register
- Parameters
-
| [in] | *handle | pointer to a ws2812b handle structure |
| [in] | *buf | pointer to a data buffer |
| [in] | len | data length |
- Returns
- status code
- 0 success
- 1 write failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 427 of file driver_ws2812b.c.
◆ ws2812b_write()
| 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
- Parameters
-
| [in] | *handle | pointer to a ws2812b handle structure |
| [in] | *rgb | pointer to a rgb color buffer |
| [in] | len | rgb length |
| [in] | *temp | pointer to a temp buffer |
| [in] | temp_len | temp buffer length |
- Returns
- status code
- 0 success
- 1 write command failed
- 2 handle is NULL
- 3 handle is not initialized
- 4 rgb is null
- 5 temp is null
- 6 temp buffer is too small
- Note
- none
Definition at line 181 of file driver_ws2812b.c.
◆ ws2812b_write_only_color()
| 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
- Parameters
-
| [in] | *handle | pointer to a ws2812b handle structure |
| [in] | *rgb | pointer to a rgb color buffer |
| [in] | len | rgb length |
| [in] | *temp | pointer to a temp buffer |
| [in] | temp_len | temp buffer length |
- Returns
- status code
- 0 success
- 1 write command failed
- 2 handle is NULL
- 3 handle is not initialized
- 4 rgb is null
- 5 temp is null
- 6 temp buffer is too small
- Note
- none
Definition at line 329 of file driver_ws2812b.c.
◆ ws2812b_write_only_reset()
| uint8_t ws2812b_write_only_reset |
( |
ws2812b_handle_t * | handle, |
|
|
uint32_t | len, |
|
|
uint8_t * | temp, |
|
|
uint32_t | temp_len ) |
write the reset frame
- Parameters
-
| [in] | *handle | pointer to a ws2812b handle structure |
| [in] | len | rgb length |
| [in] | *temp | pointer to a temp buffer |
| [in] | temp_len | temp buffer length |
- Returns
- status code
- 0 success
- 1 write command failed
- 2 handle is NULL
- 3 handle is not initialized
- 4 temp is null
- 5 temp buffer is too small
- Note
- none
Definition at line 267 of file driver_ws2812b.c.