12#ifndef ZEPHYR_INCLUDE_DRIVERS_DISPLAY_H_
13#define ZEPHYR_INCLUDE_DRIVERS_DISPLAY_H_
58#define DISPLAY_BITS_PER_PIXEL(fmt) \
59 ((((fmt & PIXEL_FORMAT_RGB_888) >> 0) * 24U) + \
60 (((fmt & PIXEL_FORMAT_MONO01) >> 1) * 1U) + \
61 (((fmt & PIXEL_FORMAT_MONO10) >> 2) * 1U) + \
62 (((fmt & PIXEL_FORMAT_ARGB_8888) >> 3) * 32U) + \
63 (((fmt & PIXEL_FORMAT_RGB_565) >> 4) * 16U) + \
64 (((fmt & PIXEL_FORMAT_BGR_565) >> 5) * 16U))
173typedef void *(*display_get_framebuffer_api)(
const struct device *dev);
254 return api->
write(dev, x, y, desc, buf);
277 if (api->
read == NULL) {
281 return api->
read(dev, x, y, desc, buf);
display_screen_info
Display screen information.
Definition display.h:69
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 desc...
Definition display.h:205
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.
Definition display.h:246
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.
Definition display.h:269
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.
Definition display.h:196
static void * display_get_framebuffer(const struct device *dev)
Get pointer to framebuffer for direct access.
Definition display.h:293
static int display_blanking_off(const struct device *dev)
Turn display blanking off.
Definition display.h:348
static int display_set_orientation(const struct device *dev, const enum display_orientation orientation)
Set display orientation.
Definition display.h:457
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.
Definition display.h:153
static void display_get_capabilities(const struct device *dev, struct display_capabilities *capabilities)
Get display capabilities.
Definition display.h:415
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.
Definition display.h:180
void *(* display_get_framebuffer_api)(const struct device *dev)
Callback API to get framebuffer pointer See display_get_framebuffer() for argument description.
Definition display.h:173
static int display_set_pixel_format(const struct device *dev, const enum display_pixel_format pixel_format)
Set pixel format used by the display.
Definition display.h:435
static int display_set_contrast(const struct device *dev, uint8_t contrast)
Set the contrast of the display.
Definition display.h:397
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.
Definition display.h:163
int(* display_blanking_off_api)(const struct device *dev)
Callback API to turn off display blanking See display_blanking_off() for argument description.
Definition display.h:146
display_pixel_format
Display pixel formats.
Definition display.h:42
display_orientation
Enumeration with possible display orientation.
Definition display.h:97
static int display_blanking_on(const struct device *dev)
Turn display blanking on.
Definition display.h:324
int(* display_blanking_on_api)(const struct device *dev)
Callback API to turn on display blanking See display_blanking_on() for argument description.
Definition display.h:139
static int display_set_brightness(const struct device *dev, uint8_t brightness)
Set the brightness of the display.
Definition display.h:372
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.
Definition display.h:188
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 descri...
Definition display.h:214
@ SCREEN_INFO_X_ALIGNMENT_WIDTH
Screen has x alignment constrained to width.
Definition display.h:91
@ SCREEN_INFO_EPD
Electrophoretic Display.
Definition display.h:83
@ SCREEN_INFO_DOUBLE_BUFFER
Screen has two alternating ram buffers.
Definition display.h:87
@ SCREEN_INFO_MONO_VTILED
If selected, one octet represents 8 pixels ordered vertically, otherwise ordered horizontally.
Definition display.h:74
@ SCREEN_INFO_MONO_MSB_FIRST
If selected, the MSB represents the first pixel, otherwise MSB represents the last pixel.
Definition display.h:79
@ PIXEL_FORMAT_MONO10
Monochrome (1=Black 0=White)
Definition display.h:45
@ PIXEL_FORMAT_ARGB_8888
32-bit ARGB
Definition display.h:46
@ PIXEL_FORMAT_MONO01
Monochrome (0=Black 1=White)
Definition display.h:44
@ PIXEL_FORMAT_RGB_565
16-bit RGB
Definition display.h:47
@ PIXEL_FORMAT_RGB_888
24-bit RGB
Definition display.h:43
@ PIXEL_FORMAT_BGR_565
16-bit BGR
Definition display.h:48
@ DISPLAY_ORIENTATION_ROTATED_90
Rotated 90 degrees clockwise.
Definition display.h:99
@ DISPLAY_ORIENTATION_ROTATED_180
Rotated 180 degrees clockwise.
Definition display.h:100
@ DISPLAY_ORIENTATION_NORMAL
No rotation.
Definition display.h:98
@ DISPLAY_ORIENTATION_ROTATED_270
Rotated 270 degrees clockwise.
Definition display.h:101
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
#define ENOSYS
Function not implemented.
Definition errno.h:82
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:411
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:417
Structure to describe display data buffer layout.
Definition display.h:121
uint16_t pitch
Number of pixels between consecutive rows in the data buffer.
Definition display.h:129
bool frame_incomplete
Indicates that this is not the last write buffer of the frame.
Definition display.h:131
uint16_t height
Data buffer column height in pixels.
Definition display.h:127
uint16_t width
Data buffer row width in pixels.
Definition display.h:125
uint32_t buf_size
Data buffer size in bytes.
Definition display.h:123
Structure holding display capabilities.
Definition display.h:105
uint32_t supported_pixel_formats
Bitwise or of pixel formats supported by the display.
Definition display.h:111
uint16_t x_resolution
Display resolution in the X direction.
Definition display.h:107
enum display_orientation current_orientation
Current display orientation.
Definition display.h:117
uint16_t y_resolution
Display resolution in the Y direction.
Definition display.h:109
uint32_t screen_info
Information about display panel.
Definition display.h:113
enum display_pixel_format current_pixel_format
Currently active pixel format for the display.
Definition display.h:115
Display driver API API which a display driver should expose.
Definition display.h:222
display_blanking_off_api blanking_off
Definition display.h:224
display_set_pixel_format_api set_pixel_format
Definition display.h:231
display_read_api read
Definition display.h:226
display_set_orientation_api set_orientation
Definition display.h:232
display_write_api write
Definition display.h:225
display_set_brightness_api set_brightness
Definition display.h:228
display_get_framebuffer_api get_framebuffer
Definition display.h:227
display_blanking_on_api blanking_on
Definition display.h:223
display_get_capabilities_api get_capabilities
Definition display.h:230
display_set_contrast_api set_contrast
Definition display.h:229