PebbleOS v4.47.0-1362-gd278268fe
Loading...
Searching...
No Matches
Backlight drivers

Interface for backlight drivers. More...

Data Structures

struct  pbl_backlight_ops
 Backlight driver operations, called with the device lock held. More...
 
struct  pbl_backlight_state
 Backlight runtime state. More...
 
struct  pbl_backlight
 Backlight. More...
 

Macros

#define PBL_BACKLIGHT_STATE_DEFINE(sym)
 Define the class state of a backlight.
 
#define PBL_BACKLIGHT_INIT(sym, _name, _parent, _ops)
 Initialize a struct pbl_backlight.
 

Detailed Description

Interface for backlight drivers.

A driver embeds a struct pbl_backlight in its instance, sets it up with PBL_BACKLIGHT_STATE_DEFINE() and PBL_BACKLIGHT_INIT(), and implements the struct pbl_backlight_ops the class calls.


Data Structure Documentation

◆ pbl_backlight_state

struct pbl_backlight_state

Backlight runtime state.

Data Fields
uint8_t brightness Brightness, 0 (off) to PBL_BACKLIGHT_BRIGHTNESS_MAX.
uint32_t color Color as 0xRRGGBB, on backlights with color.
struct pbl_mutex lock Device lock.

◆ pbl_backlight

struct pbl_backlight

Backlight.

Data Fields
struct pbl_device dev Device.
const struct pbl_backlight_ops * ops Driver operations.
struct pbl_backlight_state * state Runtime state.

Macro Definition Documentation

◆ 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
symSymbol of the instance, as passed to PBL_BACKLIGHT_STATE_DEFINE().
_nameDevice name.
_parentParent device.
_opsDriver operations.

◆ PBL_BACKLIGHT_STATE_DEFINE

#define PBL_BACKLIGHT_STATE_DEFINE (   sym)
Value:
static struct pbl_backlight_state sym##_backlight_state = { \
}
struct pbl_mutex lock
Device lock.
Definition driver.h:43
Backlight runtime state.
Definition driver.h:41
#define BACKLIGHT_COLOR_WARM_WHITE
Warm white.
Definition backlight.h:43
#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
symSymbol of the instance.