display.h
Generated from display.h in platform-idf. Edit the header’s doxygen comments to change this page.
BSP LCD.
Functions
Section titled “Functions”bsp_display_new
Section titled “bsp_display_new”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 configurationret_panel— esp_lcd panel handleret_io— esp_lcd IO handle
Returns
- ESP_OK On success
- Else esp_lcd failure
Declared in display.h:75.
bsp_display_brightness_init
Section titled “bsp_display_brightness_init”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.
bsp_display_brightness_set
Section titled “bsp_display_brightness_set”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.
bsp_display_backlight_on
Section titled “bsp_display_backlight_on”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.
bsp_display_backlight_off
Section titled “bsp_display_backlight_off”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_config_t
Section titled “bsp_display_config_t”BSP display configuration structure.
| Field | Type | Description |
|---|---|---|
max_transfer_sz | int | Maximum transfer size, in bytes. |
Declared in display.h:48.
Macros
Section titled “Macros”| Macro | Value | Description |
|---|---|---|
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) |