diff --git a/examples/peripherals/spi_master/lcd/README.md b/examples/peripherals/spi_master/lcd/README.md index d19418d534..2719a3b5ef 100644 --- a/examples/peripherals/spi_master/lcd/README.md +++ b/examples/peripherals/spi_master/lcd/README.md @@ -1,11 +1,11 @@ -| Supported Targets | ESP32 | ESP32-S2 | ESP32-C3 | -| ----------------- | ----- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C3 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | # SPI Host Driver Example (See the README.md file in the upper level 'examples' directory for more information about examples.) -This example aims to show how to use SPI Host driver API, like `spi_transaction_t` and spi_device_queue. +This example aims to show how to use SPI Host driver API, like `spi_transaction_t` and spi_device_queue. If you are looking for code to drive LCDs in general, rather than code that uses the SPI master, that may be a better example to look at as it uses ESP-IDFs built-in LCD support rather than doing all the low-level work itself, which can be found at `examples/peripherals/lcd/tjpgd/` diff --git a/examples/peripherals/spi_master/lcd/main/spi_master_example_main.c b/examples/peripherals/spi_master/lcd/main/spi_master_example_main.c index f25d0787f8..f65932b390 100644 --- a/examples/peripherals/spi_master/lcd/main/spi_master_example_main.c +++ b/examples/peripherals/spi_master/lcd/main/spi_master_example_main.c @@ -39,13 +39,13 @@ #define PIN_NUM_DC 21 #define PIN_NUM_RST 18 #define PIN_NUM_BCKL 5 -#elif defined CONFIG_IDF_TARGET_ESP32S2 +#elif defined CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 #define LCD_HOST SPI2_HOST #define PIN_NUM_MISO 37 #define PIN_NUM_MOSI 35 #define PIN_NUM_CLK 36 -#define PIN_NUM_CS 34 +#define PIN_NUM_CS 45 #define PIN_NUM_DC 4 #define PIN_NUM_RST 5 @@ -248,9 +248,11 @@ void lcd_init(spi_device_handle_t spi) const lcd_init_cmd_t* lcd_init_cmds; //Initialize non-SPI GPIOs - gpio_set_direction(PIN_NUM_DC, GPIO_MODE_OUTPUT); - gpio_set_direction(PIN_NUM_RST, GPIO_MODE_OUTPUT); - gpio_set_direction(PIN_NUM_BCKL, GPIO_MODE_OUTPUT); + gpio_config_t io_conf = {}; + io_conf.pin_bit_mask = ((1ULL<