HPM SDK
HPMicro Software Development Kit
hpm_mipi_dsi_drv.c File Reference
#include "hpm_mipi_dsi_drv.h"

Data Structures

struct  mipi_dsi_packet
 

Macros

#define MIPI_WAIT_COND(cond, timeout_us)
 

Typedefs

typedef struct mipi_dsi_packet mipi_dsi_packet_t
 

Functions

static bool mipi_dsi_packet_format_is_short (uint8_t type)
 
static bool mipi_dsi_packet_format_is_long (uint8_t type)
 
static bool mipi_dsi_create_packet (mipi_dsi_packet_t *packet, const mipi_dsi_msg_t *msg)
 
static void mipi_dsi_config_format (MIPI_DSI_Type *ptr, mipi_dsi_pixel_format_t format)
 
static int mipi_dsi_get_hcomponent_lbcc (uint32_t lane_mbps, uint32_t pixel_clock_khz, uint32_t hcomponent)
 
static void mipi_dsi_video_para_config (MIPI_DSI_Type *ptr, mipi_dsi_config_t *cfg)
 
static bool mipi_dsi_genif_wait_w_pld_fifo_not_full (MIPI_DSI_Type *ptr)
 
static bool mipi_dsi_genif_wait_cmd_fifo_not_full (MIPI_DSI_Type *ptr)
 
static bool mipi_dsi_genif_wait_write_fifo_empty (MIPI_DSI_Type *ptr)
 
static bool dw_mipi_dsi_read_from_fifo (MIPI_DSI_Type *ptr, const struct mipi_dsi_msg *msg)
 
static uint32_t get_le32 (const uint8_t *p)
 
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...
 

Macro Definition Documentation

◆ MIPI_WAIT_COND

#define MIPI_WAIT_COND (   cond,
  timeout_us 
)
Value:
({ \
volatile uint32_t timeout_cycle = 1000UL * (timeout_us); \
for (;;) { \
if (cond) \
break; \
if (timeout_us && timeout_cycle == 0) { \
break; \
} \
timeout_cycle--; \
} \
(cond) ? true : false; \
})

Typedef Documentation

◆ mipi_dsi_packet_t

Function Documentation

◆ dw_mipi_dsi_read_from_fifo()

static bool dw_mipi_dsi_read_from_fifo ( MIPI_DSI_Type ptr,
const struct mipi_dsi_msg msg 
)
static

◆ get_le32()

static uint32_t get_le32 ( const uint8_t *  p)
static

◆ mipi_dsi_config_format()

static void mipi_dsi_config_format ( MIPI_DSI_Type ptr,
mipi_dsi_pixel_format_t  format 
)
static

◆ mipi_dsi_create_packet()

static bool mipi_dsi_create_packet ( mipi_dsi_packet_t packet,
const mipi_dsi_msg_t msg 
)
static

mipi_dsi_create_packet - create a packet from a message according to the DSI protocol

Parameters
packetpointer to a DSI packet structure
msgmessage to translate into a packet
Returns
: true on success or false on failure.

◆ mipi_dsi_genif_wait_cmd_fifo_not_full()

static bool mipi_dsi_genif_wait_cmd_fifo_not_full ( MIPI_DSI_Type ptr)
static

◆ mipi_dsi_genif_wait_w_pld_fifo_not_full()

static bool mipi_dsi_genif_wait_w_pld_fifo_not_full ( MIPI_DSI_Type ptr)
static

◆ mipi_dsi_genif_wait_write_fifo_empty()

static bool mipi_dsi_genif_wait_write_fifo_empty ( MIPI_DSI_Type ptr)
static

◆ mipi_dsi_get_hcomponent_lbcc()

static int mipi_dsi_get_hcomponent_lbcc ( uint32_t  lane_mbps,
uint32_t  pixel_clock_khz,
uint32_t  hcomponent 
)
static

◆ mipi_dsi_packet_format_is_long()

static bool mipi_dsi_packet_format_is_long ( uint8_t  type)
static

mipi_dsi_packet_format_is_long - check if a packet is of the long format

Parameters
typeMIPI DSI data type of the packet
Returns
: true if the packet for the given data type is a long packet, false otherwise.

◆ mipi_dsi_packet_format_is_short()

static bool mipi_dsi_packet_format_is_short ( uint8_t  type)
static

mipi_dsi_packet_format_is_short - check if a packet is of the short format

Parameters
typeMIPI DSI data type of the packet
Returns
: true if the packet for the given data type is a short packet, false otherwise.

◆ mipi_dsi_video_para_config()

static void mipi_dsi_video_para_config ( MIPI_DSI_Type ptr,
mipi_dsi_config_t cfg 
)
static