21#ifndef ZEPHYR_INCLUDE_DRIVERS_MIPI_DBI_H_
22#define ZEPHYR_INCLUDE_DRIVERS_MIPI_DBI_H_
54#define MIPI_DBI_SPI_CONFIG_DT(node_id, operation_, delay_) \
56 .frequency = DT_PROP(node_id, mipi_max_frequency), \
57 .operation = (operation_) | \
58 DT_PROP_OR(node_id, duplex, 0) | \
59 COND_CODE_1(DT_PROP(node_id, mipi_cpol), SPI_MODE_CPOL, (0)) | \
60 COND_CODE_1(DT_PROP(node_id, mipi_cpha), SPI_MODE_CPHA, (0)) | \
61 COND_CODE_1(DT_PROP(node_id, mipi_hold_cs), SPI_HOLD_ON_CS, (0)), \
62 .slave = DT_REG_ADDR(node_id), \
64 .gpio = GPIO_DT_SPEC_GET_BY_IDX_OR(DT_PHANDLE(DT_PARENT(node_id), \
66 DT_REG_ADDR(node_id), \
82#define MIPI_DBI_SPI_CONFIG_DT_INST(inst, operation_, delay_) \
83 MIPI_DBI_SPI_CONFIG_DT(DT_DRV_INST(inst), operation_, delay_)
97#define MIPI_DBI_CONFIG_DT(node_id, operation_, delay_) \
99 .mode = DT_PROP(node_id, mipi_mode), \
100 .config = MIPI_DBI_SPI_CONFIG_DT(node_id, operation_, delay_), \
112#define MIPI_DBI_CONFIG_DT_INST(inst, operation_, delay_) \
113 MIPI_DBI_CONFIG_DT(DT_DRV_INST(inst), operation_, delay_)
135 size_t num_cmds,
uint8_t *response,
size_t len);
208 return api->
command_read(dev, config, cmds, num_cmd, response, len);
242 return api->
write_display(dev, config, framebuf, desc, pixfmt);
261 if (api->
reset == NULL) {
264 return api->
reset(dev, delay);
293 return api->
release(dev, config);
Public API for display drivers and applications.
Public API for SPI drivers and applications.
display_pixel_format
Display pixel formats.
Definition display.h:42
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition ft8xx_reference_api.h:153
static int mipi_dbi_reset(const struct device *dev, uint32_t delay)
Resets attached display controller.
Definition mipi_dbi.h:256
static int mipi_dbi_write_display(const struct device *dev, const struct mipi_dbi_config *config, const uint8_t *framebuf, struct display_buffer_descriptor *desc, enum display_pixel_format pixfmt)
Write a display buffer to the display controller.
Definition mipi_dbi.h:230
static int mipi_dbi_command_write(const struct device *dev, const struct mipi_dbi_config *config, uint8_t cmd, const uint8_t *data, size_t len)
Write a command to the display controller.
Definition mipi_dbi.h:166
static int mipi_dbi_release(const struct device *dev, const struct mipi_dbi_config *config)
Releases a locked MIPI DBI device.
Definition mipi_dbi.h:284
static int mipi_dbi_command_read(const struct device *dev, const struct mipi_dbi_config *config, uint8_t *cmds, size_t num_cmd, uint8_t *response, size_t len)
Read a command response from the display controller.
Definition mipi_dbi.h:197
#define ENOSYS
Function not implemented.
Definition errno.h:82
Display definitions for MIPI devices.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:409
Structure to describe display data buffer layout.
Definition display.h:121
MIPI DBI controller configuration.
Definition mipi_dbi.h:120
uint8_t mode
MIPI DBI mode (SPI 3 wire or 4 wire)
Definition mipi_dbi.h:122
struct spi_config config
SPI configuration.
Definition mipi_dbi.h:124
MIPI-DBI host driver API.
Definition mipi_dbi.h:129
int(* reset)(const struct device *dev, uint32_t delay)
Definition mipi_dbi.h:141
int(* release)(const struct device *dev, const struct mipi_dbi_config *config)
Definition mipi_dbi.h:142
int(* command_read)(const struct device *dev, const struct mipi_dbi_config *config, uint8_t *cmds, size_t num_cmds, uint8_t *response, size_t len)
Definition mipi_dbi.h:133
int(* command_write)(const struct device *dev, const struct mipi_dbi_config *config, uint8_t cmd, const uint8_t *data, size_t len)
Definition mipi_dbi.h:130
int(* write_display)(const struct device *dev, const struct mipi_dbi_config *config, const uint8_t *framebuf, struct display_buffer_descriptor *desc, enum display_pixel_format pixfmt)
Definition mipi_dbi.h:136
SPI controller configuration structure.
Definition spi.h:301
static fdata_t data[2]
Definition test_fifo_contexts.c:15