Backlight class.
More...
|
| | AW9364E |
| | Awinic AW9364E LED driver Backlight driver.
|
| |
| | LED backlight |
| | Backlight on an LED, its color mixed by multicolor LEDs.
|
| |
| | POSIX |
| | Backlight of a native build, which does nothing.
|
| |
| | PWM backlight |
| | Backlight driver driving the LED with a PWM output.
|
| |
| | QEMU |
| | QEMU backlight, driving the brightness (or RGB, with CONFIG_BACKLIGHT_QEMU_COLOR) registers of the QEMU display.
|
| |
Backlight class.
A backlight is a struct pbl_backlight device. The class keeps the brightness and color last applied, which drivers read from the state. Every call into the driver runs with the device lock held, a recursive mutex.
...
const struct pbl_backlight *const BACKLIGHT
The board's backlight.
int pbl_backlight_set_brightness(const struct pbl_backlight *bl, uint8_t brightness)
Set the brightness.
◆ pbl_backlight_state
| struct pbl_backlight_state |
◆ pbl_backlight
◆ BACKLIGHT_COLOR_BLACK
| #define BACKLIGHT_COLOR_BLACK 0x000000 |
◆ BACKLIGHT_COLOR_BLUE
| #define BACKLIGHT_COLOR_BLUE 0x0000FF |
◆ BACKLIGHT_COLOR_GREEN
| #define BACKLIGHT_COLOR_GREEN 0x00FF00 |
◆ BACKLIGHT_COLOR_RED
| #define BACKLIGHT_COLOR_RED 0xFF0000 |
◆ BACKLIGHT_COLOR_WARM_WHITE
| #define BACKLIGHT_COLOR_WARM_WHITE 0xFFBFA2 |
◆ BACKLIGHT_COLOR_WHITE
| #define BACKLIGHT_COLOR_WHITE 0xFFFFFF |
◆ PBL_BACKLIGHT_BRIGHTNESS_MAX
| #define PBL_BACKLIGHT_BRIGHTNESS_MAX 100U |
◆ PBL_BACKLIGHT_INIT
| #define PBL_BACKLIGHT_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_parent, |
|
|
|
_ops |
|
) |
| |
Value: { \
.dev = \
PBL_DEVICE_INIT_CLASS(sym, _name, pbl_backlight_dev_init, _parent, &pbl_backlight_class), \
.ops = (_ops), \
.state = &sym##_backlight_state, \
}
Initialize a struct pbl_backlight.
- Parameters
-
◆ PBL_BACKLIGHT_STATE_DEFINE
| #define PBL_BACKLIGHT_STATE_DEFINE |
( |
|
sym | ) |
|
Value:
}
struct pbl_mutex lock
Device lock.
Definition backlight.h:72
Backlight runtime state.
Definition backlight.h:70
#define BACKLIGHT_COLOR_WARM_WHITE
Warm white.
Definition backlight.h:44
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
#define PBL_MUTEX_INITIALIZER
Static initializer for an unlocked mutex.
Definition mutex.h:50
Define the class state of a backlight.
- Parameters
-
| sym | Symbol of the instance. |
◆ pbl_backlight_get_color()
| uint32_t pbl_backlight_get_color |
( |
const struct pbl_backlight * |
bl | ) |
|
Get the color.
- Parameters
-
- Returns
- Color as 0xRRGGBB.
◆ pbl_backlight_get_level()
| uint8_t pbl_backlight_get_level |
( |
const struct pbl_backlight * |
bl, |
|
|
uint8_t |
brightness |
|
) |
| |
Map a brightness to an opaque hardware level identifier.
Two brightness values with the same identifier produce identical output, which lets callers collapse steps the hardware cannot distinguish. Backlights with continuous control return the brightness unchanged.
- Parameters
-
- Returns
- Hardware level identifier.
◆ pbl_backlight_refresh()
Re-apply the brightness and color to the hardware.
A no-op while the backlight is off, or on drivers that cannot re-apply without a visible glitch.
- Parameters
-
- Returns
- 0, -ENODEV if the backlight is not ready, or a negative errno.
◆ pbl_backlight_set_brightness()
| int pbl_backlight_set_brightness |
( |
const struct pbl_backlight * |
bl, |
|
|
uint8_t |
brightness |
|
) |
| |
Set the brightness.
- Parameters
-
- Returns
- 0, -ENODEV if the backlight is not ready, or a negative errno.
◆ pbl_backlight_set_color()
| int pbl_backlight_set_color |
( |
const struct pbl_backlight * |
bl, |
|
|
uint32_t |
rgb_color |
|
) |
| |
Set the color.
- Parameters
-
| bl | Backlight. |
| rgb_color | Color as 0xRRGGBB, e.g. one of the BACKLIGHT_COLOR_* values. |
- Returns
- 0, -ENOTSUP if the backlight has no color, -ENODEV if it is not ready, or a negative errno.
◆ BACKLIGHT