MIPI DSI hosts.
More...
|
| int | pbl_mipi_dsi_attach (const struct pbl_mipi_dsi_device *dsi) |
| | Set the link up for a device and start it.
|
| |
| int | pbl_mipi_dsi_detach (const struct pbl_mipi_dsi_device *dsi) |
| | Stop the link of a device.
|
| |
| int | pbl_mipi_dsi_dcs_write (const struct pbl_mipi_dsi_device *dsi, uint8_t cmd, const uint8_t *data, size_t len) |
| | Send a DCS command with its parameters, as the shortest packet that holds them.
|
| |
| int | pbl_mipi_dsi_dcs_read (const struct pbl_mipi_dsi_device *dsi, uint8_t cmd, uint8_t *data, size_t len) |
| | Send a DCS command that reads, and read its response.
|
| |
| int | pbl_mipi_dsi_generic_write (const struct pbl_mipi_dsi_device *dsi, const uint8_t *data, size_t len) |
| | Send generic data, as the shortest packet that holds it.
|
| |
MIPI DSI hosts.
A host is the controller a panel is wired to over MIPI DSI. The driver of the panel, a child of the host, attaches to it with what the panel takes: its lanes, its pixel format, video or command mode, and its timing. It then sends its own commands through the host, those of its power sequence and its settings, as DCS or generic packets on its virtual channel. In video mode, the host streams the pixels a display controller feeds it. In command mode, the panel keeps the image in its frame memory, and the host, as the Display bridge of the display controller, sends it a frame on each refresh.
#define PBL_MIPI_DCS_EXIT_SLEEP_MODE
Definition mipi_dcs.h:16
int pbl_mipi_dsi_attach(const struct pbl_mipi_dsi_device *dsi)
Set the link up for a device and start it.
int pbl_mipi_dsi_dcs_write(const struct pbl_mipi_dsi_device *dsi, uint8_t cmd, const uint8_t *data, size_t len)
Send a DCS command with its parameters, as the shortest packet that holds them.
◆ pbl_mipi_dsi_device
| struct pbl_mipi_dsi_device |
| Data Fields |
|
uint8_t |
channel |
Virtual channel, 0 to 3. |
|
enum pbl_mipi_dsi_pixel_format |
format |
Pixel format. |
|
const struct pbl_mipi_dsi_host * |
host |
Host. |
|
uint8_t |
lanes |
Data lanes. |
|
uint32_t |
mode_flags |
Mode flags, PBL_MIPI_DSI_MODE_*. |
|
const struct pbl_panel_timing * |
timing |
Timing, the clock being the pixel clock. |
◆ pbl_mipi_dsi_msg
A packet to send, and what to read back.
| Data Fields |
|
uint8_t |
channel |
Virtual channel. |
|
bool |
lpm |
Send in low power. |
|
uint8_t * |
rx_buf |
Buffer for the response to a read, or NULL. |
|
size_t |
rx_len |
Bytes to read back. |
|
const uint8_t * |
tx_buf |
Payload, the parameters of a short packet or the data of a long one. |
|
size_t |
tx_len |
Payload length. |
|
uint8_t |
type |
Data type. |
◆ pbl_mipi_dsi_host
◆ PBL_MIPI_DSI_DCS_LONG_WRITE
| #define PBL_MIPI_DSI_DCS_LONG_WRITE 0x39U |
◆ PBL_MIPI_DSI_DCS_MAX_PARAMS
| #define PBL_MIPI_DSI_DCS_MAX_PARAMS 63U |
◆ PBL_MIPI_DSI_DCS_READ
| #define PBL_MIPI_DSI_DCS_READ 0x06U |
◆ PBL_MIPI_DSI_DCS_SHORT_WRITE
| #define PBL_MIPI_DSI_DCS_SHORT_WRITE 0x05U |
◆ PBL_MIPI_DSI_DCS_SHORT_WRITE_PARAM
| #define PBL_MIPI_DSI_DCS_SHORT_WRITE_PARAM 0x15U |
◆ PBL_MIPI_DSI_GENERIC_LONG_WRITE
| #define PBL_MIPI_DSI_GENERIC_LONG_WRITE 0x29U |
◆ PBL_MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM
| #define PBL_MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM 0x04U |
◆ PBL_MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM
| #define PBL_MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM 0x14U |
◆ PBL_MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM
| #define PBL_MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM 0x24U |
◆ PBL_MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM
| #define PBL_MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM 0x03U |
◆ PBL_MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM
| #define PBL_MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM 0x13U |
◆ PBL_MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM
| #define PBL_MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM 0x23U |
◆ PBL_MIPI_DSI_HOST_INIT
| #define PBL_MIPI_DSI_HOST_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_init, |
|
|
|
_parent, |
|
|
|
_ops |
|
) |
| |
Value: { \
.ops = (_ops), \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153
Initializer of a host.
- Parameters
-
| sym | Symbol of the host. |
| _name | Name. |
| _init | Device initialization function, or NULL. |
| _parent | Parent device, or NULL. |
| _ops | Driver operations. |
◆ PBL_MIPI_DSI_MODE_LPM
| #define PBL_MIPI_DSI_MODE_LPM PBL_BIT(3) |
Commands in low power, else at high speed.
◆ PBL_MIPI_DSI_MODE_VIDEO
| #define PBL_MIPI_DSI_MODE_VIDEO PBL_BIT(0) |
Video mode: the host streams pixels, else the panel has its own frame memory.
◆ PBL_MIPI_DSI_MODE_VIDEO_BURST
| #define PBL_MIPI_DSI_MODE_VIDEO_BURST PBL_BIT(1) |
In video mode, lines in bursts at the full rate of the link, low power in between.
◆ PBL_MIPI_DSI_MODE_VIDEO_SYNC_PULSE
| #define PBL_MIPI_DSI_MODE_VIDEO_SYNC_PULSE PBL_BIT(2) |
In video mode, sync pulses with their ends, else sync events.
◆ PBL_MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE
| #define PBL_MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE 0x37U |
◆ pbl_mipi_dsi_pixel_format
Pixel formats of the video stream.
| Enumerator |
|---|
| PBL_MIPI_DSI_FMT_RGB888 | 24 bits per pixel, 8 per color.
|
| PBL_MIPI_DSI_FMT_RGB666 | 18 bits per pixel, each in 3 bytes.
|
| PBL_MIPI_DSI_FMT_RGB666_PACKED | 18 bits per pixel, packed.
|
| PBL_MIPI_DSI_FMT_RGB565 | 16 bits per pixel.
|
◆ pbl_mipi_dsi_attach()
Set the link up for a device and start it.
- Parameters
-
- Returns
- 0,
-ENOTSUP for a setting the host cannot take, or another negative errno.
◆ pbl_mipi_dsi_dcs_read()
| int pbl_mipi_dsi_dcs_read |
( |
const struct pbl_mipi_dsi_device * |
dsi, |
|
|
uint8_t |
cmd, |
|
|
uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
Send a DCS command that reads, and read its response.
- Parameters
-
| dsi | Device. |
| cmd | Command. |
| data | Buffer for the response. |
| len | Bytes to read. |
- Returns
- 0,
-EIO for a shorter response, or another negative errno.
◆ pbl_mipi_dsi_dcs_write()
| int pbl_mipi_dsi_dcs_write |
( |
const struct pbl_mipi_dsi_device * |
dsi, |
|
|
uint8_t |
cmd, |
|
|
const uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
Send a DCS command with its parameters, as the shortest packet that holds them.
- Parameters
-
- Returns
- 0 or a negative errno.
◆ pbl_mipi_dsi_detach()
Stop the link of a device.
- Parameters
-
- Returns
- 0 or a negative errno.
◆ pbl_mipi_dsi_generic_write()
| int pbl_mipi_dsi_generic_write |
( |
const struct pbl_mipi_dsi_device * |
dsi, |
|
|
const uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
Send generic data, as the shortest packet that holds it.
- Parameters
-
| dsi | Device. |
| data | Data. |
| len | Its length. |
- Returns
- 0 or a negative errno.