Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Display Interface

Display Interface. More...

Data Structures

struct  display_capabilities
 Structure holding display capabilities. More...
 
struct  display_buffer_descriptor
 Structure to describe display data buffer layout. More...
 
struct  display_driver_api
 Display driver API API which a display driver should expose. More...
 

Typedefs

typedef int(* display_blanking_on_api) (const struct device *dev)
 Callback API to turn on display blanking See display_blanking_on() for argument description. More...
 
typedef int(* display_blanking_off_api) (const struct device *dev)
 Callback API to turn off display blanking See display_blanking_off() for argument description. More...
 
typedef int(* display_write_api) (const struct device *dev, const uint16_t x, const uint16_t y, const struct display_buffer_descriptor *desc, const void *buf)
 Callback API for writing data to the display See display_write() for argument description. More...
 
typedef int(* display_read_api) (const struct device *dev, const uint16_t x, const uint16_t y, const struct display_buffer_descriptor *desc, void *buf)
 Callback API for reading data from the display See display_read() for argument description. More...
 
typedef void *(* display_get_framebuffer_api) (const struct device *dev)
 Callback API to get framebuffer pointer See display_get_framebuffer() for argument description. More...
 
typedef int(* display_set_brightness_api) (const struct device *dev, const uint8_t brightness)
 Callback API to set display brightness See display_set_brightness() for argument description. More...
 
typedef int(* display_set_contrast_api) (const struct device *dev, const uint8_t contrast)
 Callback API to set display contrast See display_set_contrast() for argument description. More...
 
typedef void(* display_get_capabilities_api) (const struct device *dev, struct display_capabilities *capabilities)
 Callback API to get display capabilities See display_get_capabilities() for argument description. More...
 
typedef int(* display_set_pixel_format_api) (const struct device *dev, const enum display_pixel_format pixel_format)
 Callback API to set pixel format used by the display See display_set_pixel_format() for argument description. More...
 
typedef int(* display_set_orientation_api) (const struct device *dev, const enum display_orientation orientation)
 Callback API to set orientation used by the display See display_set_orientation() for argument description. More...
 

Enumerations

enum  display_pixel_format {
  PIXEL_FORMAT_RGB_888 = BIT(0) , PIXEL_FORMAT_MONO01 = BIT(1) , PIXEL_FORMAT_MONO10 = BIT(2) , PIXEL_FORMAT_ARGB_8888 = BIT(3) ,
  PIXEL_FORMAT_RGB_565 = BIT(4) , PIXEL_FORMAT_BGR_565 = BIT(5)
}
 Display pixel formats. More...
 
enum  display_screen_info {
  SCREEN_INFO_MONO_VTILED = BIT(0) , SCREEN_INFO_MONO_MSB_FIRST = BIT(1) , SCREEN_INFO_EPD = BIT(2) , SCREEN_INFO_DOUBLE_BUFFER = BIT(3) ,
  SCREEN_INFO_X_ALIGNMENT_WIDTH = BIT(4)
}
 
enum  display_orientation { DISPLAY_ORIENTATION_NORMAL , DISPLAY_ORIENTATION_ROTATED_90 , DISPLAY_ORIENTATION_ROTATED_180 , DISPLAY_ORIENTATION_ROTATED_270 }
 Enumeration with possible display orientation. More...
 

Functions

static int display_write (const struct device *dev, const uint16_t x, const uint16_t y, const struct display_buffer_descriptor *desc, const void *buf)
 Write data to display. More...
 
static int display_read (const struct device *dev, const uint16_t x, const uint16_t y, const struct display_buffer_descriptor *desc, void *buf)
 Read data from display. More...
 
static voiddisplay_get_framebuffer (const struct device *dev)
 Get pointer to framebuffer for direct access. More...
 
static int display_blanking_on (const struct device *dev)
 Turn display blanking on. More...
 
static int display_blanking_off (const struct device *dev)
 Turn display blanking off. More...
 
static int display_set_brightness (const struct device *dev, uint8_t brightness)
 Set the brightness of the display. More...
 
static int display_set_contrast (const struct device *dev, uint8_t contrast)
 Set the contrast of the display. More...
 
static void display_get_capabilities (const struct device *dev, struct display_capabilities *capabilities)
 Get display capabilities. More...
 
static int display_set_pixel_format (const struct device *dev, const enum display_pixel_format pixel_format)
 Set pixel format used by the display. More...
 
static int display_set_orientation (const struct device *dev, const enum display_orientation orientation)
 Set display orientation. More...
 

Detailed Description

Display Interface.

Typedef Documentation

◆ display_blanking_off_api

display_blanking_off_api

#include <include/drivers/display.h>

Callback API to turn off display blanking See display_blanking_off() for argument description.

◆ display_blanking_on_api

display_blanking_on_api

#include <include/drivers/display.h>

Callback API to turn on display blanking See display_blanking_on() for argument description.

◆ display_get_capabilities_api

display_get_capabilities_api

#include <include/drivers/display.h>

Callback API to get display capabilities See display_get_capabilities() for argument description.

◆ display_get_framebuffer_api

display_get_framebuffer_api

#include <include/drivers/display.h>

Callback API to get framebuffer pointer See display_get_framebuffer() for argument description.

◆ display_read_api

display_read_api

#include <include/drivers/display.h>

Callback API for reading data from the display See display_read() for argument description.

◆ display_set_brightness_api

display_set_brightness_api

#include <include/drivers/display.h>

Callback API to set display brightness See display_set_brightness() for argument description.

◆ display_set_contrast_api

display_set_contrast_api

#include <include/drivers/display.h>

Callback API to set display contrast See display_set_contrast() for argument description.

◆ display_set_orientation_api

display_set_orientation_api

#include <include/drivers/display.h>

Callback API to set orientation used by the display See display_set_orientation() for argument description.

◆ display_set_pixel_format_api

display_set_pixel_format_api

#include <include/drivers/display.h>

Callback API to set pixel format used by the display See display_set_pixel_format() for argument description.

◆ display_write_api

display_write_api

#include <include/drivers/display.h>

Callback API for writing data to the display See display_write() for argument description.

Enumeration Type Documentation

◆ display_orientation

#include <include/drivers/display.h>

Enumeration with possible display orientation.

Enumerator
DISPLAY_ORIENTATION_NORMAL 
DISPLAY_ORIENTATION_ROTATED_90 
DISPLAY_ORIENTATION_ROTATED_180 
DISPLAY_ORIENTATION_ROTATED_270 

◆ display_pixel_format

#include <include/drivers/display.h>

Display pixel formats.

Display pixel format enumeration.

In case a pixel format consists out of multiple bytes the byte order is big endian.

Enumerator
PIXEL_FORMAT_RGB_888 
PIXEL_FORMAT_MONO01 
PIXEL_FORMAT_MONO10 
PIXEL_FORMAT_ARGB_8888 
PIXEL_FORMAT_RGB_565 
PIXEL_FORMAT_BGR_565 

◆ display_screen_info

#include <include/drivers/display.h>

Enumerator
SCREEN_INFO_MONO_VTILED 

If selected, one octet represents 8 pixels ordered vertically, otherwise ordered horizontally.

SCREEN_INFO_MONO_MSB_FIRST 

If selected, the MSB represents the first pixel, otherwise MSB represents the last pixel.

SCREEN_INFO_EPD 

Electrophoretic Display.

SCREEN_INFO_DOUBLE_BUFFER 

Screen has two alternating ram buffers

SCREEN_INFO_X_ALIGNMENT_WIDTH 

Screen has x alignment constrained to width.

Function Documentation

◆ display_blanking_off()

static int display_blanking_off ( const struct device dev)
inlinestatic

#include <include/drivers/display.h>

Turn display blanking off.

Restore the frame buffer content to the display. In case backlight control is supported by the driver the backlight configuration is restored.

Parameters
devPointer to device structure
Return values
0on success else negative errno code.

◆ display_blanking_on()

static int display_blanking_on ( const struct device dev)
inlinestatic

#include <include/drivers/display.h>

Turn display blanking on.

This function blanks the complete display. The content of the frame buffer will be retained while blanking is enabled and the frame buffer will be accessible for read and write operations.

In case backlight control is supported by the driver the backlight is turned off. The backlight configuration is retained and accessible for configuration.

In case the driver supports display blanking the initial state of the driver would be the same as if this function was called.

Parameters
devPointer to device structure
Return values
0on success else negative errno code.

◆ display_get_capabilities()

static void display_get_capabilities ( const struct device dev,
struct display_capabilities capabilities 
)
inlinestatic

#include <include/drivers/display.h>

Get display capabilities.

Parameters
devPointer to device structure
capabilitiesPointer to capabilities structure to populate

◆ display_get_framebuffer()

static void * display_get_framebuffer ( const struct device dev)
inlinestatic

#include <include/drivers/display.h>

Get pointer to framebuffer for direct access.

Parameters
devPointer to device structure
Return values
Pointerto frame buffer or NULL if direct framebuffer access is not supported

◆ display_read()

static int display_read ( const struct device dev,
const uint16_t  x,
const uint16_t  y,
const struct display_buffer_descriptor desc,
void buf 
)
inlinestatic

#include <include/drivers/display.h>

Read data from display.

Parameters
devPointer to device structure
xx Coordinate of the upper left corner where to read from
yy Coordinate of the upper left corner where to read from
descPointer to a structure describing the buffer layout
bufPointer to buffer array
Return values
0on success else negative errno code.

◆ display_set_brightness()

static int display_set_brightness ( const struct device dev,
uint8_t  brightness 
)
inlinestatic

#include <include/drivers/display.h>

Set the brightness of the display.

Set the brightness of the display in steps of 1/256, where 255 is full brightness and 0 is minimal.

Parameters
devPointer to device structure
brightnessBrightness in steps of 1/256
Return values
0on success else negative errno code.

◆ display_set_contrast()

static int display_set_contrast ( const struct device dev,
uint8_t  contrast 
)
inlinestatic

#include <include/drivers/display.h>

Set the contrast of the display.

Set the contrast of the display in steps of 1/256, where 255 is maximum difference and 0 is minimal.

Parameters
devPointer to device structure
contrastContrast in steps of 1/256
Return values
0on success else negative errno code.

◆ display_set_orientation()

static int display_set_orientation ( const struct device dev,
const enum display_orientation  orientation 
)
inlinestatic

#include <include/drivers/display.h>

Set display orientation.

Parameters
devPointer to device structure
orientationOrientation to be used by display
Return values
0on success else negative errno code.

◆ display_set_pixel_format()

static int display_set_pixel_format ( const struct device dev,
const enum display_pixel_format  pixel_format 
)
inlinestatic

#include <include/drivers/display.h>

Set pixel format used by the display.

Parameters
devPointer to device structure
pixel_formatPixel format to be used by display
Return values
0on success else negative errno code.

◆ display_write()

static int display_write ( const struct device dev,
const uint16_t  x,
const uint16_t  y,
const struct display_buffer_descriptor desc,
const void buf 
)
inlinestatic

#include <include/drivers/display.h>

Write data to display.

Parameters
devPointer to device structure
xx Coordinate of the upper left corner where to write the buffer
yy Coordinate of the upper left corner where to write the buffer
descPointer to a structure describing the buffer layout
bufPointer to buffer array
Return values
0on success else negative errno code.