Driver for the Grove ledbar. More...
Driver for the Grove ledbar.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
Files | |
file | grove_ledbar_params.h |
Config for the Grove LED bar based on MY9221 LED controller. | |
file | grove_ledbar.h |
Interface for the Grove ledbar driver. | |
Macros | |
#define | GROVE_LEDBAR_MAX UINT8_MAX |
Maximum value for ledbar level. | |
Typedefs | |
typedef my9221_params_t | grove_ledbar_params_t |
Parameters needed for device initialization. | |
typedef my9221_t | grove_ledbar_t |
Device descriptor for grove ledbar, alias for MY9221 LED controller. | |
Functions | |
int | grove_ledbar_init (grove_ledbar_t *dev, const grove_ledbar_params_t *params) |
Initialize the given driver. More... | |
void | grove_ledbar_set (grove_ledbar_t *dev, uint8_t level) |
Set overall (brightness) level distributed over all LEDs. More... | |
void | grove_ledbar_clear (grove_ledbar_t *dev) |
Clear ledbar, i.e. More... | |
Ledbar direction, either red to green, or vice versa. | |
#define | GROVE_LEDBAR_R2G MY9221_DIR_FWD |
#define | GROVE_LEDBAR_G2R MY9221_DIR_REV |
void grove_ledbar_clear | ( | grove_ledbar_t * | dev | ) |
Clear ledbar, i.e.
set all LEDs off
dev != NULL
[in] | dev | device descriptor grove ledbar |
int grove_ledbar_init | ( | grove_ledbar_t * | dev, |
const grove_ledbar_params_t * | params | ||
) |
Initialize the given driver.
dev != NULL
and params != NULL
[out] | dev | device descriptor grove ledbar |
[in] | params | configuration parameters |
void grove_ledbar_set | ( | grove_ledbar_t * | dev, |
uint8_t | level | ||
) |
Set overall (brightness) level distributed over all LEDs.
dev != NULL
[in] | dev | device descriptor grove ledbar |
[in] | level | overall brightness level |