Skip to content

Commit a8fb103

Browse files
Merge pull request #22 from Y1hsiaochunnn/master
Optimize the BSP of ESP32-S3-Touch-LCD-4, add IO to expand the functi…
2 parents d57beac + 417e321 commit a8fb103

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

bsp/esp32_s3_touch_lcd_4/esp32_s3_touch_lcd_4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "freertos/FreeRTOS.h"
1313
#include "freertos/task.h"
1414

15-
#include "esp_io_expander_tca9554.h"
1615

1716
#include "esp_lcd_st7701.h"
1817
#include "esp_lcd_touch_gt911.h"
@@ -373,6 +372,7 @@ esp_err_t bsp_touch_new(const bsp_touch_config_t *config, esp_lcd_touch_handle_t
373372
**************************************************************************************************/
374373
esp_io_expander_handle_t bsp_io_expander_init(void)
375374
{
375+
BSP_ERROR_CHECK_RETURN_ERR(bsp_i2c_init());
376376
if (!io_expander) {
377377
BSP_ERROR_CHECK_RETURN_NULL(esp_io_expander_new_i2c_tca9554(i2c_handle, BSP_IO_EXPANDER_I2C_ADDRESS, &io_expander));
378378
}

bsp/esp32_s3_touch_lcd_4/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ tags:
1515
targets:
1616
- esp32s3
1717
url: https://www.waveshare.com/esp32-s3-touch-lcd-4.htm
18-
version: 1.0.2
18+
version: 1.0.3

bsp/esp32_s3_touch_lcd_4/include/bsp/esp32_s3_touch_lcd_4.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "driver/gpio.h"
55
#include "driver/i2c_master.h"
66
#include "driver/sdmmc_host.h"
7+
#include "esp_io_expander_tca9554.h"
78
#include "bsp/config.h"
89
#include "bsp/display.h"
910

@@ -190,6 +191,18 @@ esp_err_t bsp_sdcard_mount(void);
190191
*/
191192
esp_err_t bsp_sdcard_unmount(void);
192193

194+
/**
195+
* @brief Init IO expander chip TCA9554
196+
*
197+
* @note If the device was already initialized, users can also use it to get handle.
198+
* @note This function will be called in `bsp_display_start()` when using LCD sub-board 2 with the resolution of 480x480.
199+
* @note This function will be called in `bsp_audio_init()`.
200+
*
201+
* @return Pointer to device handle or NULL when error occurred
202+
*/
203+
esp_io_expander_handle_t bsp_io_expander_init(void);
204+
205+
193206
/**************************************************************************************************
194207
*
195208
* LCD interface

0 commit comments

Comments
 (0)