Skip to content

display.h

Generated from display.h in platform-idf. Edit the header’s doxygen comments to change this page.

BSP LCD.

esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_handle_t *ret_panel, esp_lcd_panel_io_handle_t *ret_io)

Create new display panel.

For maximum flexibility, this function performs only reset and initialization of the display. You must turn on the display explicitly by calling esp_lcd_panel_disp_on_off(). The display’s backlight is not turned on either. You can use bsp_display_backlight_on/off(), bsp_display_brightness_set() (on supported boards) or implement your own backlight control.

If you want to free resources allocated by this function, you can use esp_lcd API, ie.:

esp_lcd_panel_del(panel);
esp_lcd_panel_io_del(io);
spi_bus_free(spi_num_from_configuration);

Parameters

  • config — display configuration
  • ret_panel — esp_lcd panel handle
  • ret_io — esp_lcd IO handle

Returns

  • ESP_OK On success
  • Else esp_lcd failure

Declared in display.h:75.

esp_err_t bsp_display_brightness_init(void)

Initialize display’s brightness.

Brightness is controlled with PWM signal to a pin controlling backlight.

Returns

  • ESP_OK On success
  • ESP_ERR_INVALID_ARG Parameter error

Declared in display.h:86.

esp_err_t bsp_display_brightness_set(int brightness_percent)

Set display’s brightness.

Brightness is controlled with PWM signal to a pin controlling backlight. Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new()

Parameters

  • brightness_percent — Brightness in [%]

Returns

  • ESP_OK On success
  • ESP_ERR_INVALID_ARG Parameter error

Declared in display.h:99.

esp_err_t bsp_display_backlight_on(void)

Turn on display backlight.

Brightness is controlled with PWM signal to a pin controlling backlight. Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new()

Returns

  • ESP_OK On success
  • ESP_ERR_INVALID_ARG Parameter error

Declared in display.h:111.

esp_err_t bsp_display_backlight_off(void)

Turn off display backlight.

Brightness is controlled with PWM signal to a pin controlling backlight. Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new()

Returns

  • ESP_OK On success
  • ESP_ERR_INVALID_ARG Parameter error

Declared in display.h:123.

BSP display configuration structure.

FieldTypeDescription
max_transfer_szintMaximum transfer size, in bytes.

Declared in display.h:48.

MacroValueDescription
ESP_LCD_COLOR_FORMAT_RGB565(1)
ESP_LCD_COLOR_FORMAT_RGB888(2)
BSP_LCD_COLOR_FORMAT(ESP_LCD_COLOR_FORMAT_RGB565)
BSP_LCD_BIGENDIAN(1)
BSP_LCD_BITS_PER_PIXEL(16)
BSP_LCD_COLOR_SPACE(LCD_RGB_ELEMENT_ORDER_BGR)
BSP_LCD_H_RES(320)
BSP_LCD_V_RES(240)