Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
display.h File Reference

Main header file for display driver API. More...

#include <zephyr/device.h>
#include <errno.h>
#include <stddef.h>
#include <zephyr/types.h>
#include <zephyr/dt-bindings/display/panel.h>

Go to the source code of this file.

Data Structures

struct  display_capabilities
 Structure holding display capabilities. More...
struct  display_buffer_descriptor
 Structure to describe display data buffer layout. More...
struct  display_event_data
 Display event payload. More...
struct  display_driver_api
  Driver Operations Display driver operations More...

Macros

#define DISPLAY_BITS_PER_PIXEL(fmt)
 Bits required per pixel for display format.

Typedefs

typedef enum display_event_result(* display_event_cb_t) (const struct device *dev, uint32_t evt, const struct display_event_data *data, void *user_data)
 Called either in ISR context (if arg in_isr=true at register time, see display_register_event_cb ) or in thread context (if in_isr=false, driver will schedule work to call it).
typedef int(* display_blanking_on_api) (const struct device *dev)
 Callback API to turn on display blanking.
typedef int(* display_blanking_off_api) (const struct device *dev)
 Callback API to turn off display blanking.
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.
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.
typedef int(* display_clear_api) (const struct device *dev)
 Callback API for clearing the screen of the display.
typedef void *(* display_get_framebuffer_api) (const struct device *dev)
 Callback API to get framebuffer pointer.
typedef int(* display_set_brightness_api) (const struct device *dev, const uint8_t brightness)
 Callback API to set display brightness.
typedef int(* display_set_contrast_api) (const struct device *dev, const uint8_t contrast)
 Callback API to set display contrast.
typedef void(* display_get_capabilities_api) (const struct device *dev, struct display_capabilities *capabilities)
 Callback API to get display capabilities.
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.
typedef int(* display_set_orientation_api) (const struct device *dev, const enum display_orientation orientation)
 Callback API to set orientation used by the display.
typedef int(* display_register_event_cb_api) (const struct device *dev, display_event_cb_t cb, void *user_data, uint32_t event_mask, bool in_isr, uint32_t *out_reg_handle)
 Callback API to register display event callback.
typedef int(* display_unregister_event_cb_api) (const struct device *dev, uint32_t reg_handle)
 Callback API to unregister display event callback.

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_RGB_565X = BIT(5) , PIXEL_FORMAT_L_8 = BIT(6) , PIXEL_FORMAT_AL_88 = BIT(7) ,
  PIXEL_FORMAT_XRGB_8888 = BIT(8) , PIXEL_FORMAT_BGR_888 = BIT(9) , PIXEL_FORMAT_ABGR_8888 = BIT(10) , PIXEL_FORMAT_RGBA_8888 = BIT(11) ,
  PIXEL_FORMAT_BGRA_8888 = BIT(12) , PIXEL_FORMAT_PRIV_START = (PIXEL_FORMAT_BGRA_8888 << 1)
}
 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)
}
 Display screen information. More...
enum  display_orientation { DISPLAY_ORIENTATION_NORMAL , DISPLAY_ORIENTATION_ROTATED_90 , DISPLAY_ORIENTATION_ROTATED_180 , DISPLAY_ORIENTATION_ROTATED_270 }
 Enumeration with possible display orientation. More...
enum  display_event { DISPLAY_EVENT_LINE_INT = BIT(0) , DISPLAY_EVENT_VSYNC = BIT(1) , DISPLAY_EVENT_FRAME_DONE = BIT(2) }
 Display event types. More...
enum  display_event_result { DISPLAY_EVENT_RESULT_CONTINUE = 0 , DISPLAY_EVENT_RESULT_HANDLED = 1 }
 Display event callback return flags. 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.
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.
static int display_clear (const struct device *dev)
 Clear the screen of the display device.
static void * display_get_framebuffer (const struct device *dev)
 Get pointer to framebuffer for direct access.
static int display_blanking_on (const struct device *dev)
 Turn display blanking on.
static int display_blanking_off (const struct device *dev)
 Turn display blanking off.
static int display_set_brightness (const struct device *dev, uint8_t brightness)
 Set the brightness of the display.
static int display_set_contrast (const struct device *dev, uint8_t contrast)
 Set the contrast of the display.
static void display_get_capabilities (const struct device *dev, struct display_capabilities *capabilities)
 Get display capabilities.
static int display_set_pixel_format (const struct device *dev, const enum display_pixel_format pixel_format)
 Set pixel format used by the display.
static int display_set_orientation (const struct device *dev, const enum display_orientation orientation)
 Set display orientation.
static int display_register_event_cb (const struct device *dev, display_event_cb_t cb, void *user_data, uint32_t event_mask, bool in_isr, uint32_t *out_reg_handle)
 Register event callback for a display device.
static int display_unregister_event_cb (const struct device *dev, uint32_t reg_handle)
 Unregister event callback for a display device.

Detailed Description

Main header file for display driver API.