LEDs, single color or multicolor, driven by an LED controller.
More...
|
| | AW2016 |
| | Awinic AW2016 RGB LED controller, driving one multicolor LED on its three channels.
|
| |
|
| int | pbl_led_set (const struct pbl_led *led, uint8_t brightness, uint32_t rgb_color) |
| | Set an LED.
|
| |
| int | pbl_led_refresh (const struct pbl_led *led, uint8_t brightness, uint32_t rgb_color) |
| | Configure the controller of an LED again and set the LED, after the controller may have lost its configuration.
|
| |
LEDs, single color or multicolor, driven by an LED controller.
A multicolor LED mixes its channels after a color; a single color LED ignores it. Consumers, such as a backlight on an LED, keep the state and set it whole.
◆ pbl_led
◆ PBL_LED_BRIGHTNESS_MAX
| #define PBL_LED_BRIGHTNESS_MAX 255U |
◆ PBL_LED_INIT
| #define PBL_LED_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_init, |
|
|
|
_parent, |
|
|
|
_ops |
|
) |
| |
Value: { \
.ops = (_ops), \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _deps, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:145
Initialize a struct pbl_led.
- Parameters
-
| sym | Symbol of the instance, with its state defined by PBL_DEVICE_STATE_DEFINE(). |
| _name | Name. |
| _init | Device init function, or NULL. |
| _parent | Parent device, e.g. the bus of the controller, or NULL. |
| _ops | Driver operations. |
◆ pbl_led_refresh()
| int pbl_led_refresh |
( |
const struct pbl_led * |
led, |
|
|
uint8_t |
brightness, |
|
|
uint32_t |
rgb_color |
|
) |
| |
Configure the controller of an LED again and set the LED, after the controller may have lost its configuration.
- Parameters
-
| led | LED. |
| brightness | Brightness, 0 (off) to PBL_LED_BRIGHTNESS_MAX. |
| rgb_color | Color as 0xRRGGBB, for multicolor LEDs. |
- Returns
- 0,
-ENODEV if the LED is not ready, or another negative errno.
◆ pbl_led_set()
| int pbl_led_set |
( |
const struct pbl_led * |
led, |
|
|
uint8_t |
brightness, |
|
|
uint32_t |
rgb_color |
|
) |
| |
Set an LED.
- Parameters
-
| led | LED. |
| brightness | Brightness, 0 (off) to PBL_LED_BRIGHTNESS_MAX. |
| rgb_color | Color as 0xRRGGBB, for multicolor LEDs. |
- Returns
- 0,
-ENODEV if the LED is not ready, or another negative errno.