Display device generic API

Define the generic API of a display device. More...

Detailed Description

Define the generic API of a display device.

Warning
This feature is experimental!
This API is experimental and in an early state - expect changes!
Author
Alexandre Abadie alexa.nosp@m.ndre.nosp@m..abad.nosp@m.ie@i.nosp@m.nria..nosp@m.fr

Data Structures

struct  disp_dev_driver_t
 Generic type for a display driver. More...
 
struct  disp_dev
 Generic type for a display device. More...
 
struct  disp_dev_reg
 Disp dev registry entry. More...
 

Typedefs

typedef struct disp_dev disp_dev_t
 Forward declaration for display device struct.
 
typedef struct disp_dev_reg disp_dev_reg_t
 Disp dev registry entry.
 

Functions

int disp_dev_reg_add (disp_dev_reg_t *dev)
 Add pointer to a display device item to the list of display items. More...
 
disp_dev_reg_tdisp_dev_reg_find_screen (uint8_t screen_id)
 Find the display device that is attached to a given screen. More...
 
void disp_dev_map (const disp_dev_t *dev, uint16_t x1, uint16_t x2, uint16_t y1, uint16_t y2, const uint16_t *color)
 Map an area to display on the device. More...
 
uint16_t disp_dev_height (const disp_dev_t *dev)
 Get the height of the display device. More...
 
uint16_t disp_dev_width (const disp_dev_t *dev)
 Get the width of the display device. More...
 
uint8_t disp_dev_color_depth (const disp_dev_t *dev)
 Get the color depth of the display device. More...
 
void disp_dev_set_invert (const disp_dev_t *dev, bool invert)
 Invert the display device colors. More...
 
static void disp_dev_backlight_on (void)
 Enable the backlight pin.
 
static void disp_dev_backlight_off (void)
 Disable the backlight pin.
 

Variables

disp_dev_reg_tdisp_dev_reg
 Export the display device registry as global variable.
 

Function Documentation

◆ disp_dev_color_depth()

uint8_t disp_dev_color_depth ( const disp_dev_t dev)

Get the color depth of the display device.

Returns
The color depth

◆ disp_dev_height()

uint16_t disp_dev_height ( const disp_dev_t dev)

Get the height of the display device.

Parameters
[in]devPointer to the display device
Returns
Height in pixels

◆ disp_dev_map()

void disp_dev_map ( const disp_dev_t dev,
uint16_t  x1,
uint16_t  x2,
uint16_t  y1,
uint16_t  y2,
const uint16_t *  color 
)

Map an area to display on the device.

Parameters
[in]devPointer to the display device
[in]x1Left coordinate
[in]x2Right coordinate
[in]y1Top coordinate
[in]y2Bottom coordinate
[in]colorArray of color to map to the display

◆ disp_dev_reg_add()

int disp_dev_reg_add ( disp_dev_reg_t dev)

Add pointer to a display device item to the list of display items.

Parameters
[in]devPointer to the display device
Returns
0 on success
-ENODEV on invalid entry

◆ disp_dev_reg_find_screen()

disp_dev_reg_t* disp_dev_reg_find_screen ( uint8_t  screen_id)

Find the display device that is attached to a given screen.

Parameters
[in]screen_idIdentifier (number) of the screen
Returns
pointer to the display device in the registry
NULL if there's no match

◆ disp_dev_set_invert()

void disp_dev_set_invert ( const disp_dev_t dev,
bool  invert 
)

Invert the display device colors.

Parameters
[in]devPointer to the display device
[in]invertInvert mode (true if invert, false otherwise)

◆ disp_dev_width()

uint16_t disp_dev_width ( const disp_dev_t dev)

Get the width of the display device.

Parameters
[in]devPointer to the display device
Returns
Width in pixels