Chapter 2. API Reference
• [in] swap_axes: Whether to swap the x and y axis
esp_err_t esp_lcd_panel_set_gap(esp_lcd_panel_handle_t panel, int x_gap, int y_gap)
Set extra gap in x and y axis.
The gap is the space (in pixels) between the left/top sides of the LCD panel and the first row/column respectively
of the actual contents displayed.
Note Setting a gap is useful when positioning or centering a frame that is smaller than the LCD.
Return
• ESP_OK on success
Parameters
• [in] panel: LCD panel handle, which is created by other factory API like
esp_lcd_new_panel_st7789()
• [in] x_gap: Extra gap on x axis, in pixels
• [in] y_gap: Extra gap on y axis, in pixels
esp_err_t esp_lcd_panel_invert_color(esp_lcd_panel_handle_t panel, bool invert_color_data)
Invert the color (bit-wise invert the color data line)
Return
• ESP_OK on success
Parameters
• [in] panel: LCD panel handle, which is created by other factory API like
esp_lcd_new_panel_st7789()
• [in] invert_color_data: Whether to invert the color data
esp_err_t esp_lcd_panel_disp_off(esp_lcd_panel_handle_t panel, bool off)
Turn off the display.
Return
• ESP_OK on success
• ESP_ERR_NOT_SUPPORTED if this function is not supported by the panel
Parameters
• [in] panel: LCD panel handle, which is created by other factory API like
esp_lcd_new_panel_st7789()
• [in] off: Whether to turn off the screen
Header File
• components/esp_lcd/include/esp_lcd_panel_rgb.h
Header File
• components/esp_lcd/include/esp_lcd_panel_vendor.h
Functions
esp_err_t esp_lcd_new_panel_st7789(const esp_lcd_panel_io_handle_t io, const
esp_lcd_panel_dev_config_t *panel_dev_config,
esp_lcd_panel_handle_t *ret_panel)
Create LCD panel for model ST7789.
Return
• ESP_ERR_INVALID_ARG if parameter is invalid
• ESP_ERR_NO_MEM if out of memory
• ESP_OK on success
Parameters
• [in] io: LCD panel IO handle
• [in] panel_dev_config: general panel device configuration
• [out] ret_panel: Returned LCD panel handle
Espressif Systems 314
Submit Document Feedback
Release v4.4