lv_lcd_generic_mipi.h

API reference for lv_lcd_generic_mipi.h

Report on GitHub

Generic driver for controllers adhering to the MIPI DBI/DCS specification

Works with:

ST7735 ST7789 ST7796 ILI9341 ILI9488 (NOTE: in SPI mode ILI9488 only supports RGB666 mode, which is currently not supported)

any probably many more

Functions

lv_lcd_generic_mipi_set_gap

Set gap, i.e., the offset of the (0,0) pixel in the VRAM

 
void lv_lcd_generic_mipi_set_gap(lv_display_t *disp, uint16_t x, uint16_t y)
Parameters
NameTypeDescription
displv_display_t *display object
xuint16_tx offset
yuint16_ty offset

lv_lcd_generic_mipi_set_invert

Set color inversion

 
void lv_lcd_generic_mipi_set_invert(lv_display_t *disp, bool invert)
Parameters
NameTypeDescription
displv_display_t *display object
invertboolfalse: normal, true: invert

lv_lcd_generic_mipi_set_address_mode

Set address mode

 
void lv_lcd_generic_mipi_set_address_mode(lv_display_t *disp, bool mirror_x, bool mirror_y, bool swap_xy, bool bgr)
Parameters
NameTypeDescription
displv_display_t *display object
mirror_xboolhorizontal mirror (false: normal, true: mirrored)
mirror_yboolvertical mirror (false: normal, true: mirrored)
swap_xyboolswap axes (false: normal, true: swap)
bgrboolRGB/BGR order (false: RGB, true: BGR)

lv_lcd_generic_mipi_set_gamma_curve

Set gamma curve

 
void lv_lcd_generic_mipi_set_gamma_curve(lv_display_t *disp, uint8_t gamma)
Parameters
NameTypeDescription
displv_display_t *display object
gammauint8_tgamma curve

Structs

struct

lv_lcd_generic_mipi_driver_t

Generic MIPI compatible LCD driver

MemberTypeDescription
displv_display_t *
send_cmdlv_lcd_send_cmd_cb_t
send_colorlv_lcd_send_color_cb_t
x_gapuint16_t
y_gapuint16_t
madctl_reguint8_t
colmod_reguint8_t
mirror_xbool
mirror_ybool
swap_xybool

Typedefs

lv_lcd_flag_t

 
typedef uint32_t lv_lcd_flag_t

Configuration flags for lv_lcd_xxx_create()

Used by 6 functions
  • lv_ili9341_create — param flags
  • lv_lcd_generic_mipi_create — param flags
  • lv_nv3007_create — param flags
  • lv_st7735_create — param flags
  • lv_st7789_create — param flags
  • lv_st7796_create — param flags

lv_lcd_send_cmd_cb_t

 
typedef void(* lv_lcd_send_cmd_cb_t) (lv_display_t *disp, const uint8_t *cmd, size_t cmd_size, const uint8_t *param, size_t param_size)

Prototype of a platform-dependent callback to transfer commands and data to the LCD controller.

Used by 1 function
  • lv_lcd_generic_mipi_create — param send_cmd_cb

lv_lcd_send_color_cb_t

 
typedef void(* lv_lcd_send_color_cb_t) (lv_display_t *disp, const uint8_t *cmd, size_t cmd_size, uint8_t *param, size_t param_size)

Prototype of a platform-dependent callback to transfer pixel data to the LCD controller.

Used by 1 function
  • lv_lcd_generic_mipi_create — param send_color_cb

Macros

LV_LCD_CMD_NOP

 
#define LV_LCD_CMD_NOP 0x00    /* No Operation */

LV_LCD_CMD_SOFT_RESET

 
#define LV_LCD_CMD_SOFT_RESET 0x01    /* Software Reset */

LV_LCD_CMD_GET_POWER_MODE

 
#define LV_LCD_CMD_GET_POWER_MODE 0x0A    /* Get the current power mode */

LV_LCD_CMD_GET_ADDRESS_MODE

 
#define LV_LCD_CMD_GET_ADDRESS_MODE 0x0B    /* Get the data order for transfers from the Host to the display module and from the frame memory to the display device */

LV_LCD_CMD_GET_PIXEL_FORMAT

 
#define LV_LCD_CMD_GET_PIXEL_FORMAT 0x0C    /* Get the current pixel format */

LV_LCD_CMD_GET_DISPLAY_MODE

 
#define LV_LCD_CMD_GET_DISPLAY_MODE 0x0D    /* Get the current display mode from the peripheral */

LV_LCD_CMD_GET_SIGNAL_MODE

 
#define LV_LCD_CMD_GET_SIGNAL_MODE 0x0E    /* Get display module signaling mode */

LV_LCD_CMD_GET_DIAGNOSTIC_RESULT

 
#define LV_LCD_CMD_GET_DIAGNOSTIC_RESULT 0x0F    /* Get Peripheral Self-Diagnostic Result */

LV_LCD_CMD_ENTER_SLEEP_MODE

 
#define LV_LCD_CMD_ENTER_SLEEP_MODE 0x10    /* Power for the display panel is off */

LV_LCD_CMD_EXIT_SLEEP_MODE

 
#define LV_LCD_CMD_EXIT_SLEEP_MODE 0x11    /* Power for the display panel is on */

LV_LCD_CMD_ENTER_PARTIAL_MODE

 
#define LV_LCD_CMD_ENTER_PARTIAL_MODE 0x12    /* Part of the display area is used for image display */

LV_LCD_CMD_ENTER_NORMAL_MODE

 
#define LV_LCD_CMD_ENTER_NORMAL_MODE 0x13    /* The whole display area is used for image display */

LV_LCD_CMD_EXIT_INVERT_MODE

 
#define LV_LCD_CMD_EXIT_INVERT_MODE 0x20    /* Displayed image colors are not inverted */

LV_LCD_CMD_ENTER_INVERT_MODE

 
#define LV_LCD_CMD_ENTER_INVERT_MODE 0x21    /* Displayed image colors are inverted */

LV_LCD_CMD_SET_GAMMA_CURVE

 
#define LV_LCD_CMD_SET_GAMMA_CURVE 0x26    /* Selects the gamma curve used by the display device */

LV_LCD_CMD_SET_DISPLAY_OFF

 
#define LV_LCD_CMD_SET_DISPLAY_OFF 0x28    /* Blanks the display device */

LV_LCD_CMD_SET_DISPLAY_ON

 
#define LV_LCD_CMD_SET_DISPLAY_ON 0x29    /* Show the image on the display device */

LV_LCD_CMD_SET_COLUMN_ADDRESS

 
#define LV_LCD_CMD_SET_COLUMN_ADDRESS 0x2A    /* Set the column extent */

LV_LCD_CMD_SET_PAGE_ADDRESS

 
#define LV_LCD_CMD_SET_PAGE_ADDRESS 0x2B    /* Set the page extent */

LV_LCD_CMD_WRITE_MEMORY_START

 
#define LV_LCD_CMD_WRITE_MEMORY_START 0x2C    /* Transfer image data from the Host Processor to the peripheral starting at the location provided by set_column_address and set_page_address */

LV_LCD_CMD_READ_MEMORY_START

 
#define LV_LCD_CMD_READ_MEMORY_START 0x2E    /* Transfer image data from the peripheral to the Host Processor interface starting at the location provided by set_column_address and set_page_address */

LV_LCD_CMD_SET_PARTIAL_ROWS

 
#define LV_LCD_CMD_SET_PARTIAL_ROWS 0x30    /* Defines the number of rows in the partial display area on the display device */

LV_LCD_CMD_SET_PARTIAL_COLUMNS

 
#define LV_LCD_CMD_SET_PARTIAL_COLUMNS 0x31    /* Defines the number of columns in the partial display area on the display device */

LV_LCD_CMD_SET_SCROLL_AREA

 
#define LV_LCD_CMD_SET_SCROLL_AREA 0x33    /* Defines the vertical scrolling and fixed area on display device */

LV_LCD_CMD_SET_TEAR_OFF

 
#define LV_LCD_CMD_SET_TEAR_OFF 0x34    /* Synchronization information is not sent from the display module to the host processor */

LV_LCD_CMD_SET_TEAR_ON

 
#define LV_LCD_CMD_SET_TEAR_ON 0x35    /* Synchronization information is sent from the display module to the host processor at the start of VFP */

LV_LCD_CMD_SET_ADDRESS_MODE

 
#define LV_LCD_CMD_SET_ADDRESS_MODE 0x36    /* Set the data order for transfers from the Host to the display module and from the frame memory to the display device */

LV_LCD_CMD_SET_SCROLL_START

 
#define LV_LCD_CMD_SET_SCROLL_START 0x37    /* Defines the vertical scrolling starting point */

LV_LCD_CMD_EXIT_IDLE_MODE

 
#define LV_LCD_CMD_EXIT_IDLE_MODE 0x38    /* Full color depth is used on the display panel */

LV_LCD_CMD_ENTER_IDLE_MODE

 
#define LV_LCD_CMD_ENTER_IDLE_MODE 0x39    /* Reduced color depth is used on the display panel */

LV_LCD_CMD_SET_PIXEL_FORMAT

 
#define LV_LCD_CMD_SET_PIXEL_FORMAT 0x3A    /* Defines how many bits per pixel are used in the interface */

LV_LCD_CMD_WRITE_MEMORY_CONTINUE

 
#define LV_LCD_CMD_WRITE_MEMORY_CONTINUE 0x3C    /* Transfer image information from the Host Processor interface to the peripheral from the last written location */

LV_LCD_CMD_READ_MEMORY_CONTINUE

 
#define LV_LCD_CMD_READ_MEMORY_CONTINUE 0x3E    /* Read image data from the peripheral continuing after the last read_memory_continue or read_memory_start */

LV_LCD_CMD_SET_TEAR_SCANLINE

 
#define LV_LCD_CMD_SET_TEAR_SCANLINE 0x44    /* Synchronization information is sent from the display module to the host processor when the display device refresh reaches the provided scanline */

LV_LCD_CMD_GET_SCANLINE

 
#define LV_LCD_CMD_GET_SCANLINE 0x45    /* Get the current scanline */

LV_LCD_CMD_READ_DDB_CONTINUE

 
#define LV_LCD_CMD_READ_DDB_CONTINUE 0xA8    /* Continue reading the DDB from the last read location */

LV_LCD_CMD_READ_DDB_START

 
#define LV_LCD_CMD_READ_DDB_START 0xA1    /* Read the DDB from the provided location */

LV_LCD_MASK_FLIP_VERTICAL

 
#define LV_LCD_MASK_FLIP_VERTICAL (1 << 0)    /* This bit flips the image shown on the display device top to bottom. No change is made to the frame memory */

LV_LCD_MASK_FLIP_HORIZONTAL

 
#define LV_LCD_MASK_FLIP_HORIZONTAL (1 << 1)    /* This bit flips the image shown on the display device left to right. No change is made to the frame memory */

LV_LCD_MASK_DATA_LATCH_DATA_ORDER

 
#define LV_LCD_MASK_DATA_LATCH_DATA_ORDER (1 << 2)    /* Display Data Latch Order */

LV_LCD_MASK_RGB_ORDER

 
#define LV_LCD_MASK_RGB_ORDER (1 << 3)    /* RGB/BGR Order */

LV_LCD_MASK_LINE_ADDRESS_ORDER

 
#define LV_LCD_MASK_LINE_ADDRESS_ORDER (1 << 4)    /* Line Address Order */

LV_LCD_MASK_PAGE_COLUMN_ORDER

 
#define LV_LCD_MASK_PAGE_COLUMN_ORDER (1 << 5)    /* Page/Column Order */

LV_LCD_MASK_COLUMN_ADDRESS_ORDER

 
#define LV_LCD_MASK_COLUMN_ADDRESS_ORDER (1 << 6)    /* Column Address Order */

LV_LCD_MASK_PAGE_ADDRESS_ORDER

 
#define LV_LCD_MASK_PAGE_ADDRESS_ORDER (1 << 7)    /* Page Address Order */

LV_LCD_BIT_FLIP_VERTICAL__NOT_FLIPPED

 
#define LV_LCD_BIT_FLIP_VERTICAL__NOT_FLIPPED 0

LV_LCD_BIT_FLIP_VERTICAL__FLIPPED

 
#define LV_LCD_BIT_FLIP_VERTICAL__FLIPPED LV_LCD_MASK_FLIP_VERTICAL           /* This bit flips the image shown on the display device top to bottom. No change is made to the frame memory */

LV_LCD_BIT_FLIP_HORIZONTAL__NOT_FLIPPED

 
#define LV_LCD_BIT_FLIP_HORIZONTAL__NOT_FLIPPED 0

LV_LCD_BIT_FLIP_HORIZONTAL__FLIPPED

 
#define LV_LCD_BIT_FLIP_HORIZONTAL__FLIPPED LV_LCD_MASK_FLIP_HORIZONTAL         /* This bit flips the image shown on the display device left to right. No change is made to the frame memory */

LV_LCD_BIT_DATA_LATCH_DATA_ORDER__LTOR

 
#define LV_LCD_BIT_DATA_LATCH_DATA_ORDER__LTOR 0                                   /* Display Data Latch Order: LCD Refresh Left to Right */

LV_LCD_BIT_DATA_LATCH_DATA_ORDER__RTOL

 
#define LV_LCD_BIT_DATA_LATCH_DATA_ORDER__RTOL LV_LCD_MASK_DATA_LATCH_DATA_ORDER   /* Display Data Latch Order: LCD Refresh Right to Left */

LV_LCD_BIT_RGB_ORDER__RGB

 
#define LV_LCD_BIT_RGB_ORDER__RGB 0                                   /* RGB/BGR Order: RGB */

LV_LCD_BIT_RGB_ORDER__BGR

 
#define LV_LCD_BIT_RGB_ORDER__BGR LV_LCD_MASK_RGB_ORDER               /* RGB/BGR Order: BGR */

LV_LCD_BIT_LINE_ADDRESS_ORDER__TTOB

 
#define LV_LCD_BIT_LINE_ADDRESS_ORDER__TTOB 0                                   /* Line Address Order: LCD Refresh Top to Bottom */

LV_LCD_BIT_LINE_ADDRESS_ORDER__BTOT

 
#define LV_LCD_BIT_LINE_ADDRESS_ORDER__BTOT LV_LCD_MASK_LINE_ADDRESS_ORDER      /* Line Address Order: LCD Refresh Bottom to Top */

LV_LCD_BIT_PAGE_COLUMN_ORDER__NORMAL

 
#define LV_LCD_BIT_PAGE_COLUMN_ORDER__NORMAL 0                                   /* Page/Column Order: Normal Mode */

LV_LCD_BIT_PAGE_COLUMN_ORDER__REVERSE

 
#define LV_LCD_BIT_PAGE_COLUMN_ORDER__REVERSE LV_LCD_MASK_PAGE_COLUMN_ORDER       /* Page/Column Order: Reverse Mode */

LV_LCD_BIT_COLUMN_ADDRESS_ORDER__LTOR

 
#define LV_LCD_BIT_COLUMN_ADDRESS_ORDER__LTOR 0                                   /* Column Address Order: Left to Right */

LV_LCD_BIT_COLUMN_ADDRESS_ORDER__RTOL

 
#define LV_LCD_BIT_COLUMN_ADDRESS_ORDER__RTOL LV_LCD_MASK_COLUMN_ADDRESS_ORDER    /* Column Address Order: Right to Left */

LV_LCD_BIT_PAGE_ADDRESS_ORDER__TTOB

 
#define LV_LCD_BIT_PAGE_ADDRESS_ORDER__TTOB 0                                   /* Page Address Order: Top to Bottom */

LV_LCD_BIT_PAGE_ADDRESS_ORDER__BTOT

 
#define LV_LCD_BIT_PAGE_ADDRESS_ORDER__BTOT LV_LCD_MASK_PAGE_ADDRESS_ORDER      /* Page Address Order: Bottom to Top */

LV_LCD_GAMMA_2_2

 
#define LV_LCD_GAMMA_2_2 0x01    /* 2.2 */

LV_LCD_GAMMA_1_8

 
#define LV_LCD_GAMMA_1_8 0x02    /* 1.8 */

LV_LCD_GAMMA_2_5

 
#define LV_LCD_GAMMA_2_5 0x04    /* 2.5 */

LV_LCD_GAMMA_1_0

 
#define LV_LCD_GAMMA_1_0 0x08    /* 1.0 */

LV_LCD_PIXEL_FORMAT_RGB565

 
#define LV_LCD_PIXEL_FORMAT_RGB565 0x55    /* bus: 16 bits, pixel: 16 bits */

LV_LCD_PIXEL_FORMAT_RGB666

 
#define LV_LCD_PIXEL_FORMAT_RGB666 0x66    /* bus: 18 bits, pixel: 18 bits */

LV_LCD_FLAG_NONE

 
#define LV_LCD_FLAG_NONE 0x00000000UL

LV_LCD_FLAG_MIRROR_X

 
#define LV_LCD_FLAG_MIRROR_X 0x00000001UL

LV_LCD_FLAG_MIRROR_Y

 
#define LV_LCD_FLAG_MIRROR_Y 0x00000002UL

LV_LCD_FLAG_BGR

 
#define LV_LCD_FLAG_BGR 0x00000008UL

LV_LCD_FLAG_RGB666

 
#define LV_LCD_FLAG_RGB666 0x00000010UL

LV_LCD_CMD_DELAY_MS

 
#define LV_LCD_CMD_DELAY_MS 0xff

LV_LCD_CMD_EOF

 
#define LV_LCD_CMD_EOF 0xff

Dependencies

How is this guide?

Last updated on

On this page

Functionslv_lcd_generic_mipi_set_gaplv_lcd_generic_mipi_set_invertlv_lcd_generic_mipi_set_address_modelv_lcd_generic_mipi_set_gamma_curvelv_lcd_generic_mipi_createlv_lcd_generic_mipi_send_cmd_listStructslv_lcd_generic_mipi_driver_tTypedefslv_lcd_flag_tlv_lcd_send_cmd_cb_tlv_lcd_send_color_cb_tMacrosLV_LCD_CMD_NOPLV_LCD_CMD_SOFT_RESETLV_LCD_CMD_GET_POWER_MODELV_LCD_CMD_GET_ADDRESS_MODELV_LCD_CMD_GET_PIXEL_FORMATLV_LCD_CMD_GET_DISPLAY_MODELV_LCD_CMD_GET_SIGNAL_MODELV_LCD_CMD_GET_DIAGNOSTIC_RESULTLV_LCD_CMD_ENTER_SLEEP_MODELV_LCD_CMD_EXIT_SLEEP_MODELV_LCD_CMD_ENTER_PARTIAL_MODELV_LCD_CMD_ENTER_NORMAL_MODELV_LCD_CMD_EXIT_INVERT_MODELV_LCD_CMD_ENTER_INVERT_MODELV_LCD_CMD_SET_GAMMA_CURVELV_LCD_CMD_SET_DISPLAY_OFFLV_LCD_CMD_SET_DISPLAY_ONLV_LCD_CMD_SET_COLUMN_ADDRESSLV_LCD_CMD_SET_PAGE_ADDRESSLV_LCD_CMD_WRITE_MEMORY_STARTLV_LCD_CMD_READ_MEMORY_STARTLV_LCD_CMD_SET_PARTIAL_ROWSLV_LCD_CMD_SET_PARTIAL_COLUMNSLV_LCD_CMD_SET_SCROLL_AREALV_LCD_CMD_SET_TEAR_OFFLV_LCD_CMD_SET_TEAR_ONLV_LCD_CMD_SET_ADDRESS_MODELV_LCD_CMD_SET_SCROLL_STARTLV_LCD_CMD_EXIT_IDLE_MODELV_LCD_CMD_ENTER_IDLE_MODELV_LCD_CMD_SET_PIXEL_FORMATLV_LCD_CMD_WRITE_MEMORY_CONTINUELV_LCD_CMD_READ_MEMORY_CONTINUELV_LCD_CMD_SET_TEAR_SCANLINELV_LCD_CMD_GET_SCANLINELV_LCD_CMD_READ_DDB_CONTINUELV_LCD_CMD_READ_DDB_STARTLV_LCD_MASK_FLIP_VERTICALLV_LCD_MASK_FLIP_HORIZONTALLV_LCD_MASK_DATA_LATCH_DATA_ORDERLV_LCD_MASK_RGB_ORDERLV_LCD_MASK_LINE_ADDRESS_ORDERLV_LCD_MASK_PAGE_COLUMN_ORDERLV_LCD_MASK_COLUMN_ADDRESS_ORDERLV_LCD_MASK_PAGE_ADDRESS_ORDERLV_LCD_BIT_FLIP_VERTICAL__NOT_FLIPPEDLV_LCD_BIT_FLIP_VERTICAL__FLIPPEDLV_LCD_BIT_FLIP_HORIZONTAL__NOT_FLIPPEDLV_LCD_BIT_FLIP_HORIZONTAL__FLIPPEDLV_LCD_BIT_DATA_LATCH_DATA_ORDER__LTORLV_LCD_BIT_DATA_LATCH_DATA_ORDER__RTOLLV_LCD_BIT_RGB_ORDER__RGBLV_LCD_BIT_RGB_ORDER__BGRLV_LCD_BIT_LINE_ADDRESS_ORDER__TTOBLV_LCD_BIT_LINE_ADDRESS_ORDER__BTOTLV_LCD_BIT_PAGE_COLUMN_ORDER__NORMALLV_LCD_BIT_PAGE_COLUMN_ORDER__REVERSELV_LCD_BIT_COLUMN_ADDRESS_ORDER__LTORLV_LCD_BIT_COLUMN_ADDRESS_ORDER__RTOLLV_LCD_BIT_PAGE_ADDRESS_ORDER__TTOBLV_LCD_BIT_PAGE_ADDRESS_ORDER__BTOTLV_LCD_GAMMA_2_2LV_LCD_GAMMA_1_8LV_LCD_GAMMA_2_5LV_LCD_GAMMA_1_0LV_LCD_PIXEL_FORMAT_RGB565LV_LCD_PIXEL_FORMAT_RGB666LV_LCD_FLAG_NONELV_LCD_FLAG_MIRROR_XLV_LCD_FLAG_MIRROR_YLV_LCD_FLAG_BGRLV_LCD_FLAG_RGB666LV_LCD_CMD_DELAY_MSLV_LCD_CMD_EOFDependencies