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

Interface for LED drivers. More...

Data Structures

struct  pbl_led_ops
 LED driver operations. More...
 
struct  pbl_led
 LED. More...
 

Macros

#define PBL_LED_INIT(sym, _name, _init, _parent, _ops)
 Initialize a struct pbl_led.
 

Detailed Description

Interface for LED drivers.

A driver embeds a struct pbl_led in its instance, sets it up with PBL_LED_INIT(), and implements the struct pbl_led_ops the class calls.


Data Structure Documentation

◆ pbl_led

struct pbl_led

LED.

Data Fields
struct pbl_device dev Device.
const struct pbl_led_ops * ops Driver operations.

Macro Definition Documentation

◆ PBL_LED_INIT

#define PBL_LED_INIT (   sym,
  _name,
  _init,
  _parent,
  _ops 
)
Value:
{ \
.dev = PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, &pbl_led_class), \
.ops = (_ops), \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153

Initialize a struct pbl_led.

Parameters
symSymbol of the instance, with its state defined by PBL_DEVICE_STATE_DEFINE().
_nameName.
_initDevice init function, or NULL.
_parentParent device, e.g. the bus of the controller, or NULL.
_opsDriver operations.