PebbleOS
Loading...
Searching...
No Matches
Modules | Functions
Backlight

Backlight driver interface. More...

Modules

 AW9364E
 Backlight implementation for the AW9364E LED driver.
 
 PWM backlight
 Backlight implementation driving the LED with a PWM output.
 

Functions

void backlight_init (void)
 Initialize the backlight.
 
void backlight_set_brightness (uint8_t brightness)
 Set the backlight brightness.
 
uint8_t backlight_get_level (uint8_t brightness)
 Map a brightness to an opaque hardware level identifier.
 
void backlight_refresh (void)
 Re-apply the cached driver state to the hardware.
 
void backlight_set_color (uint32_t rgb_color)
 Set the backlight color.
 
uint32_t backlight_get_color (void)
 Get the backlight color.
 

Backlight colors

Colors for backlight_set_color(), as 0xRRGGBB.

Not gamma-corrected.

#define BACKLIGHT_COLOR_RED   0xFF0000
 Red.
 
#define BACKLIGHT_COLOR_GREEN   0x00FF00
 Green.
 
#define BACKLIGHT_COLOR_BLUE   0x0000FF
 Blue.
 
#define BACKLIGHT_COLOR_BLACK   0x000000
 Black (off).
 
#define BACKLIGHT_COLOR_WHITE   0xFFFFFF
 White.
 
#define BACKLIGHT_COLOR_WARM_WHITE   0xFFBFA2
 Warm white.
 

Detailed Description

Backlight driver interface.

...
backlight_set_brightness(0);
void backlight_init(void)
Initialize the backlight.
void backlight_set_brightness(uint8_t brightness)
Set the backlight brightness.

Macro Definition Documentation

◆ BACKLIGHT_COLOR_BLACK

#define BACKLIGHT_COLOR_BLACK   0x000000

Black (off).

◆ BACKLIGHT_COLOR_BLUE

#define BACKLIGHT_COLOR_BLUE   0x0000FF

Blue.

◆ BACKLIGHT_COLOR_GREEN

#define BACKLIGHT_COLOR_GREEN   0x00FF00

Green.

◆ BACKLIGHT_COLOR_RED

#define BACKLIGHT_COLOR_RED   0xFF0000

Red.

◆ BACKLIGHT_COLOR_WARM_WHITE

#define BACKLIGHT_COLOR_WARM_WHITE   0xFFBFA2

Warm white.

◆ BACKLIGHT_COLOR_WHITE

#define BACKLIGHT_COLOR_WHITE   0xFFFFFF

White.

Function Documentation

◆ backlight_get_color()

uint32_t backlight_get_color ( void  )

Get the backlight color.

Only on boards with CONFIG_BACKLIGHT_HAS_COLOR.

Returns
Color as 0xRRGGBB.

◆ backlight_get_level()

uint8_t backlight_get_level ( 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. Drivers with continuous control return the input unchanged.

Parameters
brightnessBrightness from 0 to 100.
Returns
Hardware level identifier.

◆ backlight_init()

void backlight_init ( void  )

Initialize the backlight.

◆ backlight_refresh()

void backlight_refresh ( void  )

Re-apply the cached driver state to the hardware.

A no-op if the driver believes the backlight is off.

◆ backlight_set_brightness()

void backlight_set_brightness ( uint8_t  brightness)

Set the backlight brightness.

Parameters
brightnessBrightness from 0 (off) to 100.

◆ backlight_set_color()

void backlight_set_color ( uint32_t  rgb_color)

Set the backlight color.

Only on boards with CONFIG_BACKLIGHT_HAS_COLOR.

Parameters
rgb_colorColor as 0xRRGGBB, e.g. one of the BACKLIGHT_COLOR_* values.