MIPI Display Serial Interface (DSI)

API Reference

group mipi_dsi_interface

MIPI-DSI driver APIs.

Since

3.1

Version

0.1.0

MIPI-DSI Device mode flags.

MIPI_DSI_MODE_VIDEO

Video mode.

MIPI_DSI_MODE_VIDEO_BURST

Video burst mode.

MIPI_DSI_MODE_VIDEO_SYNC_PULSE

Video pulse mode.

MIPI_DSI_MODE_VIDEO_AUTO_VERT

Enable auto vertical count mode.

MIPI_DSI_MODE_VIDEO_HSE

Enable hsync-end packets in vsync-pulse and v-porch area.

MIPI_DSI_MODE_VIDEO_HFP

Disable hfront-porch area.

MIPI_DSI_MODE_VIDEO_HBP

Disable hback-porch area.

MIPI_DSI_MODE_VIDEO_HSA

Disable hsync-active area.

MIPI_DSI_MODE_VSYNC_FLUSH

Flush display FIFO on vsync pulse.

MIPI_DSI_MODE_EOT_PACKET

Disable EoT packets in HS mode.

MIPI_DSI_CLOCK_NON_CONTINUOUS

Device supports non-continuous clock behavior (DSI spec 5.6.1)

MIPI_DSI_MODE_LPM

Transmit data in low power.

MIPI-DSI Pixel formats.

MIPI_DSI_PIXFMT_RGB888

RGB888 (24bpp).

MIPI_DSI_PIXFMT_RGB666

RGB666 (24bpp).

MIPI_DSI_PIXFMT_RGB666_PACKED

Packed RGB666 (18bpp).

MIPI_DSI_PIXFMT_RGB565

RGB565 (16bpp).

Defines

MIPI_DSI_MSG_USE_LPM

Functions

static inline int mipi_dsi_attach(const struct device *dev, uint8_t channel, const struct mipi_dsi_device *mdev)

Attach a new device to the MIPI-DSI bus.

Parameters:
  • dev – MIPI-DSI host device.

  • channel – Device channel (VID).

  • mdev – MIPI-DSI device description.

Returns:

0 on success, negative on error

static inline ssize_t mipi_dsi_transfer(const struct device *dev, uint8_t channel, struct mipi_dsi_msg *msg)

Transfer data to/from a device attached to the MIPI-DSI bus.

Parameters:
  • dev – MIPI-DSI device.

  • channel – Device channel (VID).

  • msg – Message.

Returns:

Size of the transferred data on success, negative on error.

ssize_t mipi_dsi_generic_read(const struct device *dev, uint8_t channel, const void *params, size_t nparams, void *buf, size_t len)

MIPI-DSI generic read.

Parameters:
  • dev – MIPI-DSI host device.

  • channel – Device channel (VID).

  • params – Buffer containing request parameters.

  • nparams – Number of parameters.

  • buf – Buffer where read data will be stored.

  • len – Length of the reception buffer.

Returns:

Size of the read data on success, negative on error.

ssize_t mipi_dsi_generic_write(const struct device *dev, uint8_t channel, const void *buf, size_t len)

MIPI-DSI generic write.

Parameters:
  • dev – MIPI-DSI host device.

  • channel – Device channel (VID).

  • buf – Transmission buffer.

  • len – Length of the transmission buffer

Returns:

Size of the written data on success, negative on error.

ssize_t mipi_dsi_dcs_read(const struct device *dev, uint8_t channel, uint8_t cmd, void *buf, size_t len)

MIPI-DSI DCS read.

Parameters:
  • dev – MIPI-DSI host device.

  • channel – Device channel (VID).

  • cmd – DCS command.

  • buf – Buffer where read data will be stored.

  • len – Length of the reception buffer.

Returns:

Size of the read data on success, negative on error.

ssize_t mipi_dsi_dcs_write(const struct device *dev, uint8_t channel, uint8_t cmd, const void *buf, size_t len)

MIPI-DSI DCS write.

Parameters:
  • dev – MIPI-DSI host device.

  • channel – Device channel (VID).

  • cmd – DCS command.

  • buf – Transmission buffer.

  • len – Length of the transmission buffer

Returns:

Size of the written data on success, negative on error.

static inline int mipi_dsi_detach(const struct device *dev, uint8_t channel, const struct mipi_dsi_device *mdev)

Detach a device from the MIPI-DSI bus.

Parameters:
  • dev – MIPI-DSI host device.

  • channel – Device channel (VID).

  • mdev – MIPI-DSI device description.

Returns:

0 on success, negative on error

struct mipi_dsi_timings
#include <mipi_dsi.h>

MIPI-DSI display timings.

Public Members

uint32_t hactive

Horizontal active video.

uint32_t hfp

Horizontal front porch.

uint32_t hbp

Horizontal back porch.

uint32_t hsync

Horizontal sync length.

uint32_t vactive

Vertical active video.

uint32_t vfp

Vertical front porch.

uint32_t vbp

Vertical back porch.

uint32_t vsync

Vertical sync length.

struct mipi_dsi_device
#include <mipi_dsi.h>

MIPI-DSI device.

Public Members

uint8_t data_lanes

Number of data lanes.

struct mipi_dsi_timings timings

Display timings.

uint32_t pixfmt

Pixel format.

uint32_t mode_flags

Mode flags.

struct mipi_dsi_msg
#include <mipi_dsi.h>

MIPI-DSI read/write message.

Public Members

uint8_t type

Payload data type.

uint16_t flags

Flags controlling message transmission.

uint8_t cmd

Command (only for DCS)

size_t tx_len

Transmission buffer length.

const void *tx_buf

Transmission buffer.

size_t rx_len

Reception buffer length.

void *rx_buf

Reception buffer.

struct mipi_dsi_driver_api
#include <mipi_dsi.h>

MIPI-DSI host driver API.