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

Interface for display drivers. More...

Data Structures

struct  pbl_display_ops
 Display driver operations. More...
 
struct  pbl_display
 A display. More...
 

Macros

#define PBL_DISPLAY_STATE_DEFINE(sym)
 Define the class state of display sym, for the PBL_*_DEFINE() macro of a driver.
 
#define PBL_DISPLAY_INIT_FRAMEBUFFER(sym, _name, _parent, _ops, _width, _height, _format, _rotated, _fb, _fb_size, _fb_ram, ...)
 Initializer for the struct pbl_display of display sym, with the memory the board reserves for its framebuffer.
 
#define PBL_DISPLAY_INIT(sym, _name, _parent, _ops, _width, _height, _format, _rotated, ...)
 Initializer for the struct pbl_display of display sym.
 

Functions

int pbl_display_dev_init (const struct pbl_device *dev)
 Device init of every display: sets the class state up, then calls the driver's init.
 
void pbl_display_complete (const struct pbl_display *disp, int status)
 Report the end of the update in flight.
 

Detailed Description

Interface for display drivers.

A driver embeds a struct pbl_display in its instance, sets it up with PBL_DISPLAY_STATE_DEFINE() and PBL_DISPLAY_INIT() or PBL_DISPLAY_INIT_FRAMEBUFFER(), implements the struct pbl_display_ops the class calls and reports the end of an update with pbl_display_complete().


Data Structure Documentation

◆ pbl_display

struct pbl_display

A display.

Data Fields
struct pbl_device dev Device.
uint8_t * framebuffer Memory the board reserves for the framebuffer, or NULL.
const struct pbl_ram * framebuffer_ram RAM device the memory is in, or NULL when it is always powered.
size_t framebuffer_size Its size, in bytes.
const struct pbl_display_ops * ops Driver operations.
struct pbl_display_props props Properties.
struct pbl_display_state * state Runtime state.

Macro Definition Documentation

◆ PBL_DISPLAY_INIT

#define PBL_DISPLAY_INIT (   sym,
  _name,
  _parent,
  _ops,
  _width,
  _height,
  _format,
  _rotated,
  ... 
)
Value:
PBL_DISPLAY_INIT_FRAMEBUFFER(sym, _name, _parent, _ops, _width, _height, _format, _rotated, 0U, \
0U, nullptr, __VA_ARGS__)
#define PBL_DISPLAY_INIT_FRAMEBUFFER(sym, _name, _parent, _ops, _width, _height, _format, _rotated, _fb, _fb_size, _fb_ram,...)
Initializer for the struct pbl_display of display sym, with the memory the board reserves for its fra...
Definition driver.h:121

Initializer for the struct pbl_display of display sym.

Parameters
symSymbol of the display instance, with its state defined by PBL_DISPLAY_STATE_DEFINE().
_nameName.
_parentParent device, or NULL.
_opsDriver operations.
_widthWidth, in pixels.
_heightHeight, in pixels.
_formatFramebuffer format.
_rotatedPanel mounted upside down.
...Other properties, designated initializers of struct pbl_display_props.

◆ PBL_DISPLAY_INIT_FRAMEBUFFER

#define PBL_DISPLAY_INIT_FRAMEBUFFER (   sym,
  _name,
  _parent,
  _ops,
  _width,
  _height,
  _format,
  _rotated,
  _fb,
  _fb_size,
  _fb_ram,
  ... 
)
Value:
{ \
.dev = PBL_DEVICE_INIT_CLASS(sym, _name, pbl_display_dev_init, _parent, &pbl_display_class), \
.ops = (_ops), \
.state = &sym##_display_state, \
.props = \
{.width = (_width), \
.height = (_height), \
.format = (_format), \
.rotated = (_rotated), \
__VA_ARGS__}, \
.framebuffer = (uint8_t *)(uintptr_t)(_fb), \
.framebuffer_size = (_fb_size), \
.framebuffer_ram = (_fb_ram), \
}
#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
int pbl_display_dev_init(const struct pbl_device *dev)
Device init of every display: sets the class state up, then calls the driver's init.

Initializer for the struct pbl_display of display sym, with the memory the board reserves for its framebuffer.

Parameters
symSymbol of the display instance, with its state defined by PBL_DISPLAY_STATE_DEFINE().
_nameName.
_parentParent device, or NULL.
_opsDriver operations.
_widthWidth, in pixels.
_heightHeight, in pixels.
_formatFramebuffer format.
_rotatedPanel mounted upside down.
_fbMemory reserved for the framebuffer, or 0.
_fb_sizeIts size, in bytes, at least a frame.
_fb_ramRAM device the memory is in, kept powered by the display, or NULL.
...Other properties, designated initializers of struct pbl_display_props.

◆ PBL_DISPLAY_STATE_DEFINE

#define PBL_DISPLAY_STATE_DEFINE (   sym)
Value:
static struct pbl_display_state sym##_display_state
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132

Define the class state of display sym, for the PBL_*_DEFINE() macro of a driver.

Parameters
symSymbol of the display instance.

Function Documentation

◆ pbl_display_complete()

void pbl_display_complete ( const struct pbl_display *  disp,
int  status 
)

Report the end of the update in flight.

Called by the display driver, typically from its interrupt handler.

Parameters
dispDisplay.
status0 or a negative errno.

◆ pbl_display_dev_init()

int pbl_display_dev_init ( const struct pbl_device *  dev)

Device init of every display: sets the class state up, then calls the driver's init.

Parameters
devDisplay device.
Returns
0 or a negative errno.