Merge branch 'examples/fix_examples_spi_master_esp32cx_v4.4' into 'release/v4.4'

examples: fix spi master examples on esp32cxx (v4.4)

See merge request espressif/esp-idf!20663
This commit is contained in:
morris
2022-11-09 17:40:59 +08:00
2 changed files with 10 additions and 8 deletions

View File

@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-S2 | ESP32-C3 |
| ----------------- | ----- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C3 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- |
# SPI Host Driver Example

View File

@ -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<<PIN_NUM_DC) | (1ULL<<PIN_NUM_RST) | (1ULL<<PIN_NUM_BCKL));
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pull_up_en = true;
gpio_config(&io_conf);
//Reset the display
gpio_set_level(PIN_NUM_RST, 0);