Driver for the MY-Semi MY9221 LED controller.
More...
Driver for the MY-Semi MY9221 LED controller.
|
file | my9221.h |
| Interface for the MY9221 LED controller driver.
|
|
file | my9221_internal.h |
| Internal config and parameters for the MY9221 LED controller.
|
|
|
#define | MY9221_LED_MAX (12U) |
| Maximum number of distinct LEDs the controller can operate.
|
|
#define | MY9221_LED_ON (0xFF) |
| Max brightness value to turn LED full on.
|
|
#define | MY9221_LED_OFF (0x00) |
| Min brightness value to turn LED off.
|
|
◆ anonymous enum
Enumerator |
---|
MY9221_DIR_FWD | forward
|
MY9221_DIR_REV | backward
|
Definition at line 51 of file my9221.h.
◆ anonymous enum
Enumerator |
---|
MY9221_OK | success
|
MY9221_ERR | failure
|
Definition at line 61 of file my9221.h.
◆ my9221_init()
Initialize the given driver.
- Parameters
-
[out] | dev | device descriptor of MY9221 LED controller |
[in] | params | configuration parameters |
- Returns
- 0 on success, otherwise error
◆ my9221_set_led()
void my9221_set_led |
( |
my9221_t * |
dev, |
|
|
const uint8_t |
led, |
|
|
const uint8_t |
alpha |
|
) |
| |
Set brightness of distinct LED.
- Parameters
-
[in] | dev | device descriptor of MY9221 LED controller |
[in] | led | led number, start with 0 |
[in] | alpha | brightness level for led |
◆ my9221_set_state()
void my9221_set_state |
( |
my9221_t * |
dev, |
|
|
const uint8_t * |
state, |
|
|
uint8_t |
len |
|
) |
| |
Set device state.
- Note
- If
state
is NULL or len
is 0, current device state is set otherwise, current state is overwritten by state
.
- Parameters
-
[in] | dev | device descriptor of MY9221 LED controller |
[in] | state | new device state array |
[in] | len | length of state array |
◆ my9221_toggle_led()
void my9221_toggle_led |
( |
my9221_t * |
dev, |
|
|
const uint8_t |
led |
|
) |
| |
Toggle a distinct LED.
- Parameters
-
[in] | dev | device descriptor of MY9221 LED controller |
[in] | led | led number, start with 0 |