-
Notifications
You must be signed in to change notification settings - Fork 105
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 #293 from espressif/bsp/default_lvgl_version
Bsp default lvgl version + runtime buffer size set
- Loading branch information
Showing
135 changed files
with
2,833 additions
and
4,569 deletions.
There are no files selected for viewing
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
3 changes: 2 additions & 1 deletion
3
SquareLine/boards/custom_waveshare_7inch/components/ws_7inch/idf_component.yml
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
version: "1.0.1" | ||
version: "1.0.2" | ||
description: Board Support Package for WaveShare 7inch | ||
url: https://github.com/espressif/esp-bsp/SquareLine/boards/custom_waveshare_7inch/components/ws_7inch | ||
|
||
dependencies: | ||
idf: ">=5.0" | ||
esp_lcd_ra8875: "^1" | ||
esp_lcd_touch_gt911: "^1" | ||
lvgl/lvgl: "^8" | ||
|
||
esp_lvgl_port: | ||
version: ^1 |
110 changes: 110 additions & 0 deletions
110
SquareLine/boards/custom_waveshare_7inch/components/ws_7inch/include/bsp/display.h
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,110 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 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 "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 */ | ||
#define BSP_LCD_COLOR_SPACE (ESP_LCD_COLOR_SPACE_BGR) | ||
/* LCD definition */ | ||
#define BSP_LCD_H_RES (800) | ||
#define BSP_LCD_V_RES (480) | ||
|
||
#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); | ||
|
||
/** | ||
* @brief Set display's brightness | ||
* | ||
* Brightness is controlled with PWM signal to a pin controlling backlight. | ||
* Display must be already initialized by calling bsp_display_new() | ||
* | ||
* @param[in] brightness_percent Brightness in [%] | ||
* @return | ||
* - ESP_OK On success | ||
* - ESP_ERR_INVALID_ARG Parameter error | ||
*/ | ||
esp_err_t bsp_display_brightness_set(int brightness_percent); | ||
|
||
/** | ||
* @brief Turn on display backlight | ||
* | ||
* Display must be already initialized by calling bsp_display_new() | ||
* | ||
* @return | ||
* - ESP_OK On success | ||
* - ESP_ERR_INVALID_ARG Parameter error | ||
*/ | ||
esp_err_t bsp_display_backlight_on(void); | ||
|
||
/** | ||
* @brief Turn off display backlight | ||
* | ||
* Display must be already initialized by calling bsp_display_new() | ||
* | ||
* @return | ||
* - ESP_OK On success | ||
* - ESP_ERR_INVALID_ARG Parameter error | ||
*/ | ||
esp_err_t bsp_display_backlight_off(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
51 changes: 51 additions & 0 deletions
51
SquareLine/boards/custom_waveshare_7inch/components/ws_7inch/include/bsp/touch.h
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,51 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/** | ||
* @file | ||
* @brief BSP Touchscreen | ||
* | ||
* This file offers API for basic touchscreen initialization. | ||
* It is useful for users who want to use the touchscreen 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 "esp_lcd_touch.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief BSP touch configuration structure | ||
* | ||
*/ | ||
typedef struct { | ||
void *dummy; /*!< Prepared for future use. */ | ||
} bsp_touch_config_t; | ||
|
||
/** | ||
* @brief Create new touchscreen | ||
* | ||
* If you want to free resources allocated by this function, you can use esp_lcd_touch API, ie.: | ||
* | ||
* \code{.c} | ||
* esp_lcd_touch_del(tp); | ||
* \endcode | ||
* | ||
* @param[in] config touch configuration | ||
* @param[out] ret_touch esp_lcd_touch touchscreen handle | ||
* @return | ||
* - ESP_OK On success | ||
* - Else esp_lcd_touch failure | ||
*/ | ||
esp_err_t bsp_touch_new(const bsp_touch_config_t *config, esp_lcd_touch_handle_t *ret_touch); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
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
Oops, something went wrong.