-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from espressif/bsp/generic_lcd
bsp: Add display and touch support to gerenic BSP.
- Loading branch information
Showing
9 changed files
with
1,124 additions
and
83 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/** | ||
* @file | ||
* @brief BSP LCD | ||
* | ||
* This file offers API for basic LCD control. | ||
* It is useful for users who want to use the LCD without the default Graphical Library LVGL. | ||
* | ||
* For standard LCD initialization with LVGL graphical library, you can call all-in-one function bsp_display_start(). | ||
*/ | ||
|
||
#pragma once | ||
#include "sdkconfig.h" | ||
#include "esp_lcd_types.h" | ||
|
||
/* LCD color formats */ | ||
#define ESP_LCD_COLOR_FORMAT_RGB565 (1) | ||
#define ESP_LCD_COLOR_FORMAT_RGB888 (2) | ||
|
||
/* LCD display color format */ | ||
#define BSP_LCD_COLOR_FORMAT (ESP_LCD_COLOR_FORMAT_RGB565) | ||
/* LCD display color bytes endianess */ | ||
#define BSP_LCD_BIGENDIAN (1) | ||
/* LCD display color bits */ | ||
#define BSP_LCD_BITS_PER_PIXEL (16) | ||
/* LCD display color space */ | ||
#if defined(CONFIG_BSP_DISPLAY_COLOR_SPACE_RGB) | ||
#define BSP_LCD_COLOR_SPACE (ESP_LCD_COLOR_SPACE_RGB) | ||
#elif defined(CONFIG_BSP_DISPLAY_COLOR_SPACE_BGR) | ||
#define BSP_LCD_COLOR_SPACE (ESP_LCD_COLOR_SPACE_BGR) | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief BSP display configuration structure | ||
* | ||
*/ | ||
typedef struct { | ||
int max_transfer_sz; /*!< Maximum transfer size, in bytes. */ | ||
} bsp_display_config_t; | ||
|
||
/** | ||
* @brief 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.: | ||
* | ||
* \code{.c} | ||
* esp_lcd_panel_del(panel); | ||
* esp_lcd_panel_io_del(io); | ||
* spi_bus_free(spi_num_from_configuration); | ||
* \endcode | ||
* | ||
* @param[in] config display configuration | ||
* @param[out] ret_panel esp_lcd panel handle | ||
* @param[out] ret_io esp_lcd IO handle | ||
* @return | ||
* - ESP_OK On success | ||
* - Else esp_lcd failure | ||
*/ | ||
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); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
Oops, something went wrong.