PebbleOS v4.47.0-512-g5285d4236
Loading...
Searching...
No Matches
display.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <pbl/device.h>
#include <pbl/drivers/ram.h>

Data Structures

struct  pbl_display_props
 Properties of a display. More...
 
struct  pbl_display_buffer
 Framebuffer handed to an update. More...
 
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.
 

Typedefs

typedef void(* pbl_display_callback_t) (int status, void *arg)
 Completion callback of pbl_display_update().
 

Enumerations

enum  pbl_display_format { PBL_DISPLAY_FORMAT_MONO , PBL_DISPLAY_FORMAT_ARGB2222 , PBL_DISPLAY_FORMAT_RGB565 }
 Pixel formats of the framebuffer. More...
 

Functions

static const struct pbl_display_props * pbl_display_get_props (const struct pbl_display *disp)
 Get the properties of a display.
 
static uint16_t pbl_display_round_inset (const struct pbl_display *disp, uint16_t y)
 Get the pixels hidden at each end of a row of a round panel.
 
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.
 
int pbl_display_enable (const struct pbl_display *disp)
 Turn the panel on.
 
int pbl_display_disable (const struct pbl_display *disp)
 Turn the panel off.
 
int pbl_display_set_rotated (const struct pbl_display *disp, bool rotated)
 Turn the image by 180 degrees, on top of the mounting rotation, from the next update.
 
int pbl_display_clear (const struct pbl_display *disp)
 Clear the image held by the panel, if the display supports it.
 
int pbl_display_update (const struct pbl_display *disp, const struct pbl_display_buffer *buf, uint16_t y0, uint16_t y1, pbl_display_callback_t cb, void *arg)
 Send rows of a framebuffer to the panel, returning once the update has started.
 
int pbl_display_get_framebuffer (const struct pbl_display *disp, struct pbl_display_buffer *buf)
 Get the framebuffer the board reserves for a display.
 
int pbl_display_update_sync (const struct pbl_display *disp, const struct pbl_display_buffer *buf, uint16_t y0, uint16_t y1)
 Send rows of a framebuffer to the panel and wait for the update to end.
 
bool pbl_display_update_in_progress (const struct pbl_display *disp)
 Check whether an update is in progress.
 

Variables

const struct pbl_device_class pbl_display_class
 Class of the displays.
 
const struct pbl_display *const DISPLAY
 The display, defined by the board.