kopia lustrzana https://github.com/espressif/esp-idf
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!20663pull/10244/head
commit
70bb00afac
|
@ -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/`
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue