Interface for display drivers.
More...
|
| #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.
|
| |
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().
◆ pbl_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. |
◆ PBL_DISPLAY_INIT
| #define PBL_DISPLAY_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_parent, |
|
|
|
_ops, |
|
|
|
_width, |
|
|
|
_height, |
|
|
|
_format, |
|
|
|
_rotated, |
|
|
|
... |
|
) |
| |
Value:
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
-
| sym | Symbol of the display instance, with its state defined by PBL_DISPLAY_STATE_DEFINE(). |
| _name | Name. |
| _parent | Parent device, or NULL. |
| _ops | Driver operations. |
| _width | Width, in pixels. |
| _height | Height, in pixels. |
| _format | Framebuffer format. |
| _rotated | Panel 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: { \
.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
-
| sym | Symbol of the display instance, with its state defined by PBL_DISPLAY_STATE_DEFINE(). |
| _name | Name. |
| _parent | Parent device, or NULL. |
| _ops | Driver operations. |
| _width | Width, in pixels. |
| _height | Height, in pixels. |
| _format | Framebuffer format. |
| _rotated | Panel mounted upside down. |
| _fb | Memory reserved for the framebuffer, or 0. |
| _fb_size | Its size, in bytes, at least a frame. |
| _fb_ram | RAM 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
-
| sym | Symbol of the display instance. |
◆ 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
-
| disp | Display. |
| status | 0 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
-
- Returns
- 0 or a negative errno.