hal_gdc_mipi.h File Reference
#include "hal_gfx_sys_defs.h"

Go to the source code of this file.

Macros

#define MIPICFG_DBI_EN   (1U<<31U)
 
#define MIPICFG_FRC_CSX_0   (1U<<30U)
 
#define MIPICFG_FRC_CSX_1   ((1U<<30U)|(1U<<29U))
 
#define MIPICFG_SPI_CSX_V   (1U<<29U)
 
#define MIPICFG_DIS_TE   (1U<<28U)
 
#define MIPICFG_SPIDC_DQSPI   (1U<<27U)
 
#define MIPICFG_RSTN_DBI_SPI   (1U<<26U)
 
#define MIPICFG_RESX   (1U<<25U)
 
#define MIPICFG_DMA   (1U<<24U)
 
#define MIPICFG_SPI3   (1U<<23U)
 
#define MIPICFG_SPI4   (1U<<22U)
 
#define MIPICFG_GPI   ((1U<<23U)|(1U<<22U))
 
#define MIPICFG_EN_STALL   (1U<<21U)
 
#define MIPICFG_SPI_CPHA   (1U<<20U)
 
#define MIPICFG_SPI_CPOL   (1U<<19U)
 
#define MIPICFG_SPI_JDI   (1U<<18U)
 
#define MIPICFG_EN_DVALID   (1U<<18U)
 
#define MIPICFG_SPI_HOLD   (1U<<17U)
 
#define MIPICFG_INV_ADDR   (1U<<16U)
 
#define MIPICFG_SCAN_ADDR   (1U<<15U)
 
#define MIPICFG_PIXCLK_OUT_EN   (1U<<14U)
 
#define MIPICFG_EXT_CTRL   (1U<<13U)
 
#define MIPICFG_BLANKING_EN   (1U<<12U)
 
#define MIPICFG_DSPI_SPIX   (1U<<11U)
 
#define MIPICFG_QSPI   (1U<<10U)
 
#define MIPICFG_QSPI_DDR   ((1U<<10U)|(1U<<9U))
 
#define MIPICFG_DSPI   (1U<< 9U)
 
#define MIPICFG_SPI   (0U<< 9U)
 
#define MIPICFG_NULL   (0x00U)
 
#define MIPI_DCS_RGB111   (1U)
 
#define MIPI_DCS_RGB332   (2U)
 
#define MIPI_DCS_RGB444   (3U)
 
#define MIPI_DCS_RGB565   (5U)
 
#define MIPI_DCS_RGB666   (6U)
 
#define MIPI_DCS_RGB888   (7U)
 
#define MIPICFG_PF_SPI   (3U<<6U)
 
#define MIPICFG_PF_DSPI   (4U<<6U)
 
#define MIPICFG_PF_QSPI   (5U<<6U)
 
#define MIPICFG_PF_DBI8   (0U<<6U)
 
#define MIPICFG_PF_DBI9   (1U<<6U)
 
#define MIPICFG_PF_DBI16   (2U<<6U)
 
#define MIPICFG_PF_GPI   (6U<<6U)
 
#define MIPICFG_PF_OPT0   (0U<<3U)
 
#define MIPICFG_PF_OPT1   (1U<<3U)
 
#define MIPICFG_PF_OPT2   (2U<<3U)
 
#define MIPICFG_PF_OPT3   (3U<<3U)
 
#define MIPICFG_PF_OPT4   (4U<<3U)
 
#define MIPICFG_1RGB111_OPT0   (MIPICFG_PF_SPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB111)
 
#define MIPICFG_1RGB111_OPT1   (MIPICFG_PF_SPI|MIPICFG_PF_OPT1|MIPI_DCS_RGB111)
 
#define MIPICFG_1RGB111_OPT2   (MIPICFG_PF_SPI|MIPICFG_PF_OPT2|MIPI_DCS_RGB111)
 
#define MIPICFG_1RGB111_OPT3   (MIPICFG_PF_SPI|MIPICFG_PF_OPT3|MIPI_DCS_RGB111)
 
#define MIPICFG_1RGB111_OPT4   (MIPICFG_PF_SPI|MIPICFG_PF_OPT4|MIPI_DCS_RGB111)
 
#define MIPICFG_1RGB332_OPT0   (MIPICFG_PF_SPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB332)
 
#define MIPICFG_1RGB444_OPT0   (MIPICFG_PF_SPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB444)
 
#define MIPICFG_1RGB565_OPT0   (MIPICFG_PF_SPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB565)
 
#define MIPICFG_1RGB666_OPT0   (MIPICFG_PF_SPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB666)
 
#define MIPICFG_1RGB888_OPT0   (MIPICFG_PF_SPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB888)
 
#define MIPICFG_2RGB332_OPT0   (MIPICFG_PF_DSPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB332)
 
#define MIPICFG_2RGB444_OPT0   (MIPICFG_PF_DSPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB444)
 
#define MIPICFG_2RGB444_OPT1   (MIPICFG_PF_DSPI|MIPICFG_PF_OPT1|MIPI_DCS_RGB444)
 
#define MIPICFG_2RGB565_OPT0   (MIPICFG_PF_DSPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB565)
 
#define MIPICFG_2RGB666_OPT0   (MIPICFG_PF_DSPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB666)
 
#define MIPICFG_2RGB666_OPT1   (MIPICFG_PF_DSPI|MIPICFG_PF_OPT1|MIPI_DCS_RGB666)
 
#define MIPICFG_2RGB888_OPT0   (MIPICFG_PF_DSPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB888)
 
#define MIPICFG_2RGB888_OPT1   (MIPICFG_PF_DSPI|MIPICFG_PF_OPT1|MIPI_DCS_RGB888)
 
#define MIPICFG_4RGB111_OPT0   (MIPICFG_PF_QSPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB111)
 
#define MIPICFG_4RGB332_OPT0   (MIPICFG_PF_QSPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB332)
 
#define MIPICFG_4RGB444_OPT0   (MIPICFG_PF_QSPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB444)
 
#define MIPICFG_4RGB565_OPT0   (MIPICFG_PF_QSPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB565)
 
#define MIPICFG_4RGB666_OPT0   (MIPICFG_PF_QSPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB666)
 
#define MIPICFG_4RGB888_OPT0   (MIPICFG_PF_QSPI|MIPICFG_PF_OPT0|MIPI_DCS_RGB888)
 
#define MIPICFG_8RGB332_OPT0   (MIPICFG_PF_DBI8|MIPICFG_PF_OPT0|MIPI_DCS_RGB332)
 
#define MIPICFG_8RGB444_OPT0   (MIPICFG_PF_DBI8|MIPICFG_PF_OPT0|MIPI_DCS_RGB444)
 
#define MIPICFG_8RGB565_OPT0   (MIPICFG_PF_DBI8|MIPICFG_PF_OPT0|MIPI_DCS_RGB565)
 
#define MIPICFG_8RGB666_OPT0   (MIPICFG_PF_DBI8|MIPICFG_PF_OPT0|MIPI_DCS_RGB666)
 
#define MIPICFG_8RGB888_OPT0   (MIPICFG_PF_DBI8|MIPICFG_PF_OPT0|MIPI_DCS_RGB888)
 
#define MIPICFG_16RGB332_OPT0   (MIPICFG_PF_DBI16|MIPICFG_PF_OPT0|MIPI_DCS_RGB332)
 
#define MIPICFG_16RGB444_OPT0   (MIPICFG_PF_DBI16|MIPICFG_PF_OPT0|MIPI_DCS_RGB444)
 
#define MIPICFG_16RGB565_OPT0   (MIPICFG_PF_DBI16|MIPICFG_PF_OPT0|MIPI_DCS_RGB565)
 
#define MIPICFG_16RGB666_OPT0   (MIPICFG_PF_DBI16|MIPICFG_PF_OPT0|MIPI_DCS_RGB666)
 
#define MIPICFG_16RGB666_OPT1   (MIPICFG_PF_DBI16|MIPICFG_PF_OPT1|MIPI_DCS_RGB666)
 
#define MIPICFG_16RGB888_OPT0   (MIPICFG_PF_DBI16|MIPICFG_PF_OPT0|MIPI_DCS_RGB888)
 
#define MIPICFG_16RGB888_OPT1   (MIPICFG_PF_DBI16|MIPICFG_PF_OPT1|MIPI_DCS_RGB888)
 
#define MIPICFG_9RGB666_OPT0   (MIPICFG_PF_DBI9|MIPICFG_PF_OPT0|MIPI_DCS_RGB666)
 
#define MIPICFG_32RGB332_OPT0   (MIPICFG_PF_GPI |MIPICFG_PF_OPT0|MIPI_DCS_RGB332)
 
#define MIPICFG_32RGB444_OPT0   (MIPICFG_PF_GPI |MIPICFG_PF_OPT0|MIPI_DCS_RGB444)
 
#define MIPICFG_32RGB565_OPT0   (MIPICFG_PF_GPI |MIPICFG_PF_OPT0|MIPI_DCS_RGB565)
 
#define MIPICFG_32RGB666_OPT0   (MIPICFG_PF_GPI |MIPICFG_PF_OPT0|MIPI_DCS_RGB666)
 
#define MIPICFG_32RGB666_OPT1   (MIPICFG_PF_GPI |MIPICFG_PF_OPT1|MIPI_DCS_RGB666)
 
#define MIPICFG_32RGB888_OPT0   (MIPICFG_PF_GPI |MIPICFG_PF_OPT0|MIPI_DCS_RGB888)
 
#define hal_gdc_MIPI_set_mode   hal_gdc_MIPI_set_pixel_format
 

Enumerations

enum  hal_gdc_mipi_cmd_t {
  MIPI_enter_idle_mode = 0x39,
  MIPI_enter_invert_mode = 0x21,
  MIPI_enter_normal_mode = 0x13,
  MIPI_enter_partial_mode = 0x12,
  MIPI_enter_sleep_mode = 0x10,
  MIPI_exit_idle_mode = 0x38,
  MIPI_exit_invert_mode = 0x20,
  MIPI_exit_sleep_mode = 0x11,
  MIPI_get_3D_control = 0x3f,
  MIPI_get_address_mode = 0x0b,
  MIPI_get_blue_channel = 0x08,
  MIPI_get_diagnostic_result = 0x0f,
  MIPI_get_display_mode = 0x0d,
  MIPI_get_green_channel = 0x07,
  MIPI_get_pixel_format = 0x0c,
  MIPI_get_power_mode = 0x0a,
  MIPI_get_red_channel = 0x06,
  MIPI_get_scanline = 0x45,
  MIPI_get_signal_mode = 0x0e,
  MIPI_nop = 0x00,
  MIPI_read_DDB_continue = 0xa8,
  MIPI_read_DDB_start = 0xa1,
  MIPI_read_memory_continue = 0x3e,
  MIPI_read_memory_start = 0x2e,
  MIPI_set_3D_control = 0x3d,
  MIPI_set_address_mode = 0x36,
  MIPI_set_column_address = 0x2a,
  MIPI_set_display_off = 0x28,
  MIPI_set_display_on = 0x29,
  MIPI_set_gamma_curve = 0x26,
  MIPI_set_page_address = 0x2b,
  MIPI_set_partial_columns = 0x31,
  MIPI_set_partial_rows = 0x30,
  MIPI_set_pixel_format = 0x3a,
  MIPI_set_scroll_area = 0x33,
  MIPI_set_scroll_start = 0x37,
  MIPI_set_tear_off = 0x34,
  MIPI_set_tear_on = 0x35,
  MIPI_set_tear_scanline = 0x44,
  MIPI_set_vsync_timing = 0x40,
  MIPI_soft_reset = 0x01,
  MIPI_write_LUT = 0x2d,
  MIPI_write_memory_continue = 0x3c,
  MIPI_write_memory_start = 0x2c,
  MIPI_snapshot = 0xff,
  MIPI_DBIB_STORE_BASE_ADDR = (1 <<31),
  MIPI_DBIB_CMD = (1U<<30),
  MIPI_CMD08 = (0U<<28),
  MIPI_CMD16 = (1U<<28),
  MIPI_CMD24 = (1U<<29),
  MIPI_MASK_QSPI = (1U<<27)
}
 MIPI Command List definition. More...
 

Functions

void hal_gdc_MIPI_out (int cmd)
 Send command or data to MIPI Interface. More...
 
void hal_gdc_MIPI_CFG_out (int cfg)
 Configure hal_gdc's serial interace. More...
 
int hal_gdc_MIPI_in (void)
 Read data from MIPI interface. More...
 
unsigned hal_gdc_MIPI_read (int cmd, int n_params)
 Read MIPI DBI Type-B parameters. More...
 
void hal_gdc_MIPI_cmd (int cmd)
 Send DCS command to display over the physical interface. More...
 
void hal_gdc_MIPI_cmd_params (int cmd, int n_params,...)
 Similar to hal_gdc_MIPI_cmd, with command parameters. More...
 
int hal_gdc_MIPI_updateregion (int start_x, int start_y, int end_x, int end_y)
 Does Partial Update in MIPI. More...
 
void hal_gdc_MIPI_enable (void)
 Convenience function. Sends exit_sleep and display_on commands. More...
 
void hal_gdc_MIPI_disable (void)
 Convenience function. Sends display_off and enter_sleep_mode commands. More...
 
void hal_gdc_MIPI_set_pixel_format (int pixel_format)
 Set the display pixel format. Sends set_pixel_format command to the display. More...
 
void hal_gdc_MIPI_set_position (int minx, int miny, int maxx, int maxy)
 Set the frame position. Sends set_column_address and set_page_address commands. More...
 
void hal_gdc_MIPI_set_partial_mode (int minx, int miny, int maxx, int maxy)
 Set the display partial area and enter Partial Display Mode. More...
 
void hal_gdc_MIPI_start_frame_transfer (void)
 Convenience function. Send a write_memory_start command in order to start transfering the frame to the display. More...