Zephyr API Documentation
3.6.0
A Scalable Open Source RTOS
|
|
3.6.0 |
MIPI-DBI driver APIs. More...
Data Structures | |
struct | mipi_dbi_config |
MIPI DBI controller configuration. More... | |
struct | mipi_dbi_driver_api |
MIPI-DBI host driver API. More... | |
Macros | |
#define | MIPI_DBI_MODE_SPI_3WIRE 0x1 |
SPI 3 wire (Type C1). | |
#define | MIPI_DBI_MODE_SPI_4WIRE 0x2 |
SPI 4 wire (Type C3). | |
#define | MIPI_DBI_SPI_CONFIG_DT(node_id, operation_, delay_) |
initialize a MIPI DBI SPI configuration struct from devicetree | |
Functions | |
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. | |
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. | |
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. | |
static int | mipi_dbi_reset (const struct device *dev, uint32_t delay) |
Resets attached display controller. | |
MIPI-DBI driver APIs.
#define MIPI_DBI_MODE_SPI_3WIRE 0x1 |
#include <zephyr/drivers/mipi_dbi.h>
SPI 3 wire (Type C1).
Uses 9 write clocks to send a byte of data. The bit sent on the 9th clock indicates whether the byte is a command or data byte
.---. .---. .---. .---. .---. .---. .---. .---. SCK -' '---' '---' '---' '---' '---' '---' '---' '--- -.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---. DOUT |D/C| D7| D6| D5| D4| D3| D2| D1| D0|D/C| D7| D6| D5| D4|...| -'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---' | Word 1 | Word n -. .-- CS '-----------------------------------------------------------'
#define MIPI_DBI_MODE_SPI_4WIRE 0x2 |
#include <zephyr/drivers/mipi_dbi.h>
SPI 4 wire (Type C3).
Uses 8 write clocks to send a byte of data. an additional C/D pin will be use to indicate whether the byte is a command or data byte
.---. .---. .---. .---. .---. .---. .---. .---. SCK -' '---' '---' '---' '---' '---' '---' '---' '--- -.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---. DOUT | D7| D6| D5| D4| D3| D2| D1| D0| D7| D6| D5| D4| D3| D2| D1| D0| -'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---' | Word 1 | Word n -. .-- CS '---------------------------------------------------------------' -.-------------------------------.-------------------------------.- CD | D/C | D/C | -'-------------------------------'-------------------------------'-
#define MIPI_DBI_SPI_CONFIG_DT | ( | node_id, | |
operation_, | |||
delay_ | |||
) |
#include <zephyr/drivers/mipi_dbi.h>
initialize a MIPI DBI SPI configuration struct from devicetree
This helper allows drivers to initialize a MIPI DBI SPI configuration structure using devicetree.
node_id | Devicetree node identifier for the MIPI DBI device whose struct spi_config to create an initializer for |
operation_ | the desired operation field in the struct spi_config |
delay_ | the desired delay field in the struct spi_config's spi_cs_control, if there is one |
|
inlinestatic |
#include <zephyr/drivers/mipi_dbi.h>
Read a command response from the display controller.
Reads a command response from the display controller.
dev | mipi dbi controller |
config | MIPI DBI configuration |
cmds | array of one byte commands to send to display controller |
num_cmd | number of commands to write to display controller |
response | response buffer, filled with display controller response |
len | size of response buffer in bytes. |
0 | command read succeeded |
-EIO | I/O error |
-ETIMEDOUT | transfer timed out |
-EBUSY | controller is busy |
-ENOSYS | not implemented |
|
inlinestatic |
#include <zephyr/drivers/mipi_dbi.h>
Write a command to the display controller.
Writes a command, along with an optional data buffer to the display. If data buffer and buffer length are NULL and 0 respectively, then only a command will be sent.
dev | mipi dbi controller |
config | MIPI DBI configuration |
cmd | command to write to display controller |
data | optional data buffer to write after command |
len | size of data buffer in bytes. Set to 0 to skip sending data. |
0 | command write succeeded |
-EIO | I/O error |
-ETIMEDOUT | transfer timed out |
-EBUSY | controller is busy |
-ENOSYS | not implemented |
#include <zephyr/drivers/mipi_dbi.h>
Resets attached display controller.
Resets the attached display controller.
dev | mipi dbi controller |
delay | duration to set reset signal for, in milliseconds |
0 | reset succeeded |
-EIO | I/O error |
-ENOSYS | not implemented |
-ENOTSUP | not supported |
|
inlinestatic |
#include <zephyr/drivers/mipi_dbi.h>
Write a display buffer to the display controller.
Writes a display buffer to the controller. If the controller requires a "Write memory" command before writing display data, this should be sent with mipi_dbi_command_write
dev | mipi dbi controller |
config | MIPI DBI configuration |
framebuf | framebuffer to write to display |
desc | descriptor of framebuffer to write. Note that the pitch must be equal to width. "buf_size" field determines how many bytes will be written. |
pixfmt | pixel format of framebuffer data |
0 | buffer write succeeded. |
-EIO | I/O error |
-ETIMEDOUT | transfer timed out |
-EBUSY | controller is busy |
-ENOSYS | not implemented |