HPM SDK
HPMicro Software Development Kit
MIPI_DSI driver APIs

MIPI_DSI APIs. More...

Data Structures

struct  mipi_dsi_msg
 
struct  mipi_video_para
 
struct  mipi_dsi_config
 

Typedefs

typedef enum mipi_dsi_tx_cmd mipi_dsi_tx_cmd_t
 
typedef enum mipi_dcs_cmd mipi_dcs_cmd_t
 
typedef enum mipi_dsi_pixel_format mipi_dsi_pixel_format_t
 
typedef enum mipi_dsi_video_mode mipi_dsi_video_mode_t
 
typedef struct mipi_dsi_msg mipi_dsi_msg_t
 
typedef struct mipi_video_para mipi_video_para_t
 
typedef struct mipi_dsi_config mipi_dsi_config_t
 

Enumerations

enum  mipi_dsi_tx_cmd {
  MIPI_DSI_SHUTDOWN_PERIPHERAL = 0x22 , MIPI_DSI_TURN_ON_PERIPHERAL = 0x32 , MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM = 0x03 , MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM = 0x13 ,
  MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM = 0x23 , MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM = 0x04 , MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM = 0x14 , MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM = 0x24 ,
  MIPI_DSI_DCS_SHORT_WRITE = 0x05 , MIPI_DSI_DCS_SHORT_WRITE_PARAM = 0x15 , MIPI_DSI_DCS_READ = 0x06 , MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE = 0x37 ,
  MIPI_DSI_GENERIC_LONG_WRITE = 0x29 , MIPI_DSI_DCS_LONG_WRITE = 0x39
}
 
enum  mipi_dcs_cmd {
  MIPI_DCS_NOP = 0x00 , MIPI_DCS_SOFT_RESET = 0x01 , MIPI_DCS_GET_DISPLAY_ID = 0x04 , MIPI_DCS_GET_RED_CHANNEL = 0x06 ,
  MIPI_DCS_GET_GREEN_CHANNEL = 0x07 , MIPI_DCS_GET_BLUE_CHANNEL = 0x08 , MIPI_DCS_GET_DISPLAY_STATUS = 0x09 , MIPI_DCS_GET_POWER_MODE = 0x0A ,
  MIPI_DCS_GET_ADDRESS_MODE = 0x0B , MIPI_DCS_GET_PIXEL_FORMAT = 0x0C , MIPI_DCS_GET_DISPLAY_MODE = 0x0D , MIPI_DCS_GET_SIGNAL_MODE = 0x0E ,
  MIPI_DCS_GET_DIAGNOSTIC_RESULT = 0x0F , MIPI_DCS_ENTER_SLEEP_MODE = 0x10 , MIPI_DCS_EXIT_SLEEP_MODE = 0x11 , MIPI_DCS_ENTER_PARTIAL_MODE = 0x12 ,
  MIPI_DCS_ENTER_NORMAL_MODE = 0x13 , MIPI_DCS_EXIT_INVERT_MODE = 0x20 , MIPI_DCS_ENTER_INVERT_MODE = 0x21 , MIPI_DCS_SET_GAMMA_CURVE = 0x26 ,
  MIPI_DCS_SET_DISPLAY_OFF = 0x28 , MIPI_DCS_SET_DISPLAY_ON = 0x29 , MIPI_DCS_SET_COLUMN_ADDRESS = 0x2A , MIPI_DCS_SET_PAGE_ADDRESS = 0x2B ,
  MIPI_DCS_WRITE_MEMORY_START = 0x2C , MIPI_DCS_WRITE_LUT = 0x2D , MIPI_DCS_READ_MEMORY_START = 0x2E , MIPI_DCS_SET_PARTIAL_AREA = 0x30 ,
  MIPI_DCS_SET_SCROLL_AREA = 0x33 , MIPI_DCS_SET_TEAR_OFF = 0x34 , MIPI_DCS_SET_TEAR_ON = 0x35 , MIPI_DCS_SET_ADDRESS_MODE = 0x36 ,
  MIPI_DCS_SET_SCROLL_START = 0x37 , MIPI_DCS_EXIT_IDLE_MODE = 0x38 , MIPI_DCS_ENTER_IDLE_MODE = 0x39 , MIPI_DCS_SET_PIXEL_FORMAT = 0x3A ,
  MIPI_DCS_WRITE_MEMORY_CONTINUE = 0x3C , MIPI_DCS_READ_MEMORY_CONTINUE = 0x3E , MIPI_DCS_SET_TEAR_SCANLINE = 0x44 , MIPI_DCS_GET_SCANLINE = 0x45 ,
  MIPI_DCS_SET_DISPLAY_BRIGHTNESS = 0x51 , MIPI_DCS_GET_DISPLAY_BRIGHTNESS = 0x52 , MIPI_DCS_WRITE_CONTROL_DISPLAY = 0x53 , MIPI_DCS_GET_CONTROL_DISPLAY = 0x54 ,
  MIPI_DCS_WRITE_POWER_SAVE = 0x55 , MIPI_DCS_GET_POWER_SAVE = 0x56 , MIPI_DCS_SET_CABC_MIN_BRIGHTNESS = 0x5E , MIPI_DCS_GET_CABC_MIN_BRIGHTNESS = 0x5F ,
  MIPI_DCS_READ_DDB_START = 0xA1 , MIPI_DCS_READ_DDB_CONTINUE = 0xA8
}
 
enum  mipi_dsi_pixel_format { MIPI_DSI_FMT_RGB888 , MIPI_DSI_FMT_RGB666 , MIPI_DSI_FMT_RGB666_PACKED , MIPI_DSI_FMT_RGB565 }
 
enum  mipi_dsi_video_mode { MIPI_DSI_VIDEO_MODE_SYNC_PULSE = 0x00 , MIPI_DSI_VIDEO_MODE_SYNC_EVENT = 0x01 , MIPI_DSI_VIDEO_MODE_BURST = 0x02 }
 

Functions

void mipi_dsi_get_defconfig_on_video (mipi_dsi_config_t *cfg)
 get MIPI_DSI default config on video mode More...
 
void mipi_dsi_init (MIPI_DSI_Type *ptr, mipi_dsi_config_t *cfg)
 MIPI_DSI init. More...
 
void mipi_dsi_phy_poweron (MIPI_DSI_Type *ptr)
 MIPI_DSI phy interface power on. More...
 
void mipi_dsi_phy_powerdown (MIPI_DSI_Type *ptr)
 MIPI_DSI phy interface power down. More...
 
void mipi_dsi_video_mode_hs_transfer_enable (MIPI_DSI_Type *ptr)
 MIPI_DSI hs transfer start. More...
 
void mipi_dsi_video_mode_hs_transfer_disable (MIPI_DSI_Type *ptr)
 MIPI_DSI hs transfer stop. More...
 
int mipi_dsi_lp_cmd_transfer (MIPI_DSI_Type *ptr, const mipi_dsi_msg_t *msg)
 transmit data using mipi dsi message in low power mode More...
 
int mipi_dsi_set_maximum_return_packet_size (MIPI_DSI_Type *ptr, uint8_t channel, uint16_t value)
 specify the maximum size of the the payload in a long packet transmitted from the peripheral back to the host processor More...
 
int mipi_dsi_generic_write (MIPI_DSI_Type *ptr, uint8_t channel, const void *payload, uint16_t size)
 transmit data using a generic write packet More...
 
int mipi_dsi_generic_read (MIPI_DSI_Type *ptr, uint8_t channel, const void *params, uint16_t num_params, void *data, uint16_t size)
 receive data using a generic read packet More...
 
int mipi_dsi_dcs_write_buffer (MIPI_DSI_Type *ptr, uint8_t channel, const void *data, uint16_t len)
 transmit a DCS command with payload More...
 
int mipi_dsi_dcs_write (MIPI_DSI_Type *ptr, uint8_t channel, uint8_t cmd, const void *data, uint16_t len)
 send DCS write command More...
 
int mipi_dsi_dcs_read (MIPI_DSI_Type *ptr, uint8_t channel, uint8_t cmd, void *data, uint16_t len)
 send DCS read request command More...
 

Detailed Description

MIPI_DSI APIs.

Typedef Documentation

◆ mipi_dcs_cmd_t

◆ mipi_dsi_config_t

◆ mipi_dsi_msg_t

typedef struct mipi_dsi_msg mipi_dsi_msg_t

#include <drivers/inc/hpm_mipi_dsi_drv.h>

mipi_dsi_msg_t - read/write DSI buffer

◆ mipi_dsi_pixel_format_t

◆ mipi_dsi_tx_cmd_t

◆ mipi_dsi_video_mode_t

◆ mipi_video_para_t

Enumeration Type Documentation

◆ mipi_dcs_cmd

#include <drivers/inc/hpm_mipi_dsi_drv.h>

Enumerator
MIPI_DCS_NOP 
MIPI_DCS_SOFT_RESET 
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_AREA 
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_READ_MEMORY_CONTINUE 
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_dsi_pixel_format

#include <drivers/inc/hpm_mipi_dsi_drv.h>

Enumerator
MIPI_DSI_FMT_RGB888 
MIPI_DSI_FMT_RGB666 
MIPI_DSI_FMT_RGB666_PACKED 
MIPI_DSI_FMT_RGB565 

◆ mipi_dsi_tx_cmd

#include <drivers/inc/hpm_mipi_dsi_drv.h>

Enumerator
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_GENERIC_LONG_WRITE 
MIPI_DSI_DCS_LONG_WRITE 

◆ mipi_dsi_video_mode

#include <drivers/inc/hpm_mipi_dsi_drv.h>

Enumerator
MIPI_DSI_VIDEO_MODE_SYNC_PULSE 
MIPI_DSI_VIDEO_MODE_SYNC_EVENT 
MIPI_DSI_VIDEO_MODE_BURST 

Function Documentation

◆ mipi_dsi_dcs_read()

int mipi_dsi_dcs_read ( MIPI_DSI_Type ptr,
uint8_t  channel,
uint8_t  cmd,
void *  data,
uint16_t  len 
)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

send DCS read request command

Parameters
ptrMIPI_DSI base address
channelvirtual channel
cmdDCS command
databuffer in which to receive data
lensize of receive buffer
Returns
: The number of bytes read or a negative error code on failure.

◆ mipi_dsi_dcs_write()

int mipi_dsi_dcs_write ( MIPI_DSI_Type ptr,
uint8_t  channel,
uint8_t  cmd,
const void *  data,
uint16_t  len 
)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

send DCS write command

Parameters
ptrMIPI_DSI base address
channelvirtual channel
cmdDCS command
databuffer containing the command payload
lencommand payload length

This function will automatically choose the right data type depending on the command payload length.

Returns
: The number of bytes successfully transmitted or a negative error code on failure.

◆ mipi_dsi_dcs_write_buffer()

int mipi_dsi_dcs_write_buffer ( MIPI_DSI_Type ptr,
uint8_t  channel,
const void *  data,
uint16_t  len 
)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

transmit a DCS command with payload

Parameters
ptrMIPI_DSI base address
channelvirtual channel
databuffer containing data to be transmitted
lensize of transmission buffer

This function will automatically choose the right data type depending on the command payload length.

Returns
: The number of bytes successfully transmitted or a negative error code on failure.

◆ mipi_dsi_generic_read()

int mipi_dsi_generic_read ( MIPI_DSI_Type ptr,
uint8_t  channel,
const void *  params,
uint16_t  num_params,
void *  data,
uint16_t  size 
)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

receive data using a generic read packet

Parameters
ptrMIPI_DSI base address
channelvirtual channel
paramsbuffer containing the request parameters
num_paramsnumber of request parameters
databuffer in which to return the received data
sizesize of receive buffer

This function will automatically choose the right data type depending on the number of parameters passed in.

Returns
: The number of bytes successfully read or a negative error code on failure.

◆ mipi_dsi_generic_write()

int mipi_dsi_generic_write ( MIPI_DSI_Type ptr,
uint8_t  channel,
const void *  payload,
uint16_t  size 
)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

transmit data using a generic write packet

Parameters
ptrMIPI_DSI base address
channelvirtual channel
payloadbuffer containing the payload
sizesize of payload buffer

This function will automatically choose the right data type depending on the payload length.

Returns
: The number of bytes transmitted on success or a negative error code on failure.

◆ mipi_dsi_get_defconfig_on_video()

void mipi_dsi_get_defconfig_on_video ( mipi_dsi_config_t cfg)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

get MIPI_DSI default config on video mode

Parameters
cfgMIPI_DSI default config

◆ mipi_dsi_init()

void mipi_dsi_init ( MIPI_DSI_Type ptr,
mipi_dsi_config_t cfg 
)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

MIPI_DSI init.

Parameters
ptrMIPI_DSI base address
cfgconfig of MIPI_DSI

◆ mipi_dsi_lp_cmd_transfer()

int mipi_dsi_lp_cmd_transfer ( MIPI_DSI_Type ptr,
const mipi_dsi_msg_t msg 
)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

transmit data using mipi dsi message in low power mode

Parameters
ptrMIPI_DSI base address
msgMPI_DSI message
Returns
The number of bytes transmitted on success or a negative error code on failure.

◆ mipi_dsi_phy_powerdown()

void mipi_dsi_phy_powerdown ( MIPI_DSI_Type ptr)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

MIPI_DSI phy interface power down.

Parameters
ptrMIPI_DSI base address

◆ mipi_dsi_phy_poweron()

void mipi_dsi_phy_poweron ( MIPI_DSI_Type ptr)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

MIPI_DSI phy interface power on.

Parameters
ptrMIPI_DSI base address

◆ mipi_dsi_set_maximum_return_packet_size()

int mipi_dsi_set_maximum_return_packet_size ( MIPI_DSI_Type ptr,
uint8_t  channel,
uint16_t  value 
)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

specify the maximum size of the the payload in a long packet transmitted from the peripheral back to the host processor

Parameters
ptrMIPI_DSI base address
channelvirtual channel
valuethe maximum size of the payload
Returns
: true on success or false on failure.

◆ mipi_dsi_video_mode_hs_transfer_disable()

void mipi_dsi_video_mode_hs_transfer_disable ( MIPI_DSI_Type ptr)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

MIPI_DSI hs transfer stop.

Parameters
ptrMIPI_DSI base address

◆ mipi_dsi_video_mode_hs_transfer_enable()

void mipi_dsi_video_mode_hs_transfer_enable ( MIPI_DSI_Type ptr)

#include <drivers/inc/hpm_mipi_dsi_drv.h>

MIPI_DSI hs transfer start.

Parameters
ptrMIPI_DSI base address