MIPI-DSI

API Reference

group mipi_dsi_interface

MIPI-DSI driver APIs.

MIPI-DSI DCS (Display Command Set)

MIPI_DCS_NOP
MIPI_DCS_SOFT_RESET
MIPI_DCS_GET_COMPRESSION_MODE
MIPI_DCS_GET_DISPLAY_ID
MIPI_DCS_GET_RED_CHANNEL
MIPI_DCS_GET_GREEN_CHANNEL
MIPI_DCS_GET_BLUE_CHANNEL
MIPI_DCS_GET_DISPLAY_STATUS
MIPI_DCS_GET_POWER_MODE
MIPI_DCS_GET_ADDRESS_MODE
MIPI_DCS_GET_PIXEL_FORMAT
MIPI_DCS_GET_DISPLAY_MODE
MIPI_DCS_GET_SIGNAL_MODE
MIPI_DCS_GET_DIAGNOSTIC_RESULT
MIPI_DCS_ENTER_SLEEP_MODE
MIPI_DCS_EXIT_SLEEP_MODE
MIPI_DCS_ENTER_PARTIAL_MODE
MIPI_DCS_ENTER_NORMAL_MODE
MIPI_DCS_EXIT_INVERT_MODE
MIPI_DCS_ENTER_INVERT_MODE
MIPI_DCS_SET_GAMMA_CURVE
MIPI_DCS_SET_DISPLAY_OFF
MIPI_DCS_SET_DISPLAY_ON
MIPI_DCS_SET_COLUMN_ADDRESS
MIPI_DCS_SET_PAGE_ADDRESS
MIPI_DCS_WRITE_MEMORY_START
MIPI_DCS_WRITE_LUT
MIPI_DCS_READ_MEMORY_START
MIPI_DCS_SET_PARTIAL_ROWS
MIPI_DCS_SET_PARTIAL_COLUMNS
MIPI_DCS_SET_SCROLL_AREA
MIPI_DCS_SET_TEAR_OFF
MIPI_DCS_SET_TEAR_ON
MIPI_DCS_SET_ADDRESS_MODE
MIPI_DCS_SET_SCROLL_START
MIPI_DCS_EXIT_IDLE_MODE
MIPI_DCS_ENTER_IDLE_MODE
MIPI_DCS_SET_PIXEL_FORMAT
MIPI_DCS_WRITE_MEMORY_CONTINUE
MIPI_DCS_SET_3D_CONTROL
MIPI_DCS_READ_MEMORY_CONTINUE
MIPI_DCS_GET_3D_CONTROL
MIPI_DCS_SET_VSYNC_TIMING
MIPI_DCS_SET_TEAR_SCANLINE
MIPI_DCS_GET_SCANLINE
MIPI_DCS_SET_DISPLAY_BRIGHTNESS
MIPI_DCS_GET_DISPLAY_BRIGHTNESS
MIPI_DCS_WRITE_CONTROL_DISPLAY
MIPI_DCS_GET_CONTROL_DISPLAY
MIPI_DCS_WRITE_POWER_SAVE
MIPI_DCS_GET_POWER_SAVE
MIPI_DCS_SET_CABC_MIN_BRIGHTNESS
MIPI_DCS_GET_CABC_MIN_BRIGHTNESS
MIPI_DCS_READ_DDB_START
MIPI_DCS_READ_DDB_CONTINUE
MIPI_DCS_PIXEL_FORMAT_24BIT
MIPI_DCS_PIXEL_FORMAT_18BIT
MIPI_DCS_PIXEL_FORMAT_16BIT
MIPI_DCS_PIXEL_FORMAT_12BIT
MIPI_DCS_PIXEL_FORMAT_8BIT
MIPI_DCS_PIXEL_FORMAT_3BIT

MIPI-DSI Address mode register fields.

MIPI_DCS_ADDRESS_MODE_MIRROR_Y
MIPI_DCS_ADDRESS_MODE_MIRROR_X
MIPI_DCS_ADDRESS_MODE_SWAP_XY
MIPI_DCS_ADDRESS_MODE_REFRESH_BT
MIPI_DCS_ADDRESS_MODE_BGR
MIPI_DCS_ADDRESS_MODE_LATCH_RL
MIPI_DCS_ADDRESS_MODE_FLIP_X
MIPI_DCS_ADDRESS_MODE_FLIP_Y

MIPI-DSI Processor-to-Peripheral transaction types.

MIPI_DSI_V_SYNC_START
MIPI_DSI_V_SYNC_END
MIPI_DSI_H_SYNC_START
MIPI_DSI_H_SYNC_END
MIPI_DSI_COLOR_MODE_OFF
MIPI_DSI_COLOR_MODE_ON
MIPI_DSI_SHUTDOWN_PERIPHERAL
MIPI_DSI_TURN_ON_PERIPHERAL
MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM
MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM
MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM
MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM
MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM
MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM
MIPI_DSI_DCS_SHORT_WRITE
MIPI_DSI_DCS_SHORT_WRITE_PARAM
MIPI_DSI_DCS_READ
MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE
MIPI_DSI_END_OF_TRANSMISSION
MIPI_DSI_NULL_PACKET
MIPI_DSI_BLANKING_PACKET
MIPI_DSI_GENERIC_LONG_WRITE
MIPI_DSI_DCS_LONG_WRITE
MIPI_DSI_LOOSELY_PACKED_PIXEL_STREAM_YCBCR20
MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR24
MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16
MIPI_DSI_PACKED_PIXEL_STREAM_30
MIPI_DSI_PACKED_PIXEL_STREAM_36
MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12
MIPI_DSI_PACKED_PIXEL_STREAM_16
MIPI_DSI_PACKED_PIXEL_STREAM_18
MIPI_DSI_PIXEL_STREAM_3BYTE_18
MIPI_DSI_PACKED_PIXEL_STREAM_24

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).

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.

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.