mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-26 20:53:11 +00:00
spi: update examples to use the new GDMA driver
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
#define LCD_HOST HSPI_HOST
|
||||
#define DMA_CHAN 2
|
||||
|
||||
#define PIN_NUM_MISO 25
|
||||
#define PIN_NUM_MOSI 23
|
||||
@@ -42,7 +41,6 @@
|
||||
#define PIN_NUM_BCKL 5
|
||||
#elif defined CONFIG_IDF_TARGET_ESP32S2
|
||||
#define LCD_HOST SPI2_HOST
|
||||
#define DMA_CHAN LCD_HOST
|
||||
|
||||
#define PIN_NUM_MISO 37
|
||||
#define PIN_NUM_MOSI 35
|
||||
@@ -54,7 +52,6 @@
|
||||
#define PIN_NUM_BCKL 6
|
||||
#elif defined CONFIG_IDF_TARGET_ESP32C3
|
||||
#define LCD_HOST SPI2_HOST
|
||||
#define DMA_CHAN LCD_HOST
|
||||
|
||||
#define PIN_NUM_MISO 2
|
||||
#define PIN_NUM_MOSI 7
|
||||
@@ -62,8 +59,8 @@
|
||||
#define PIN_NUM_CS 10
|
||||
|
||||
#define PIN_NUM_DC 9
|
||||
#define PIN_NUM_RST 18
|
||||
#define PIN_NUM_BCKL 19
|
||||
#define PIN_NUM_RST 4
|
||||
#define PIN_NUM_BCKL 5
|
||||
#endif
|
||||
|
||||
//To speed up transfers, every SPI transfer sends a bunch of lines. This define specifies how many. More means more memory use,
|
||||
@@ -439,7 +436,7 @@ void app_main(void)
|
||||
.pre_cb=lcd_spi_pre_transfer_callback, //Specify pre-transfer callback to handle D/C line
|
||||
};
|
||||
//Initialize the SPI bus
|
||||
ret=spi_bus_initialize(LCD_HOST, &buscfg, DMA_CHAN);
|
||||
ret=spi_bus_initialize(LCD_HOST, &buscfg, SPI_DMA_CH_AUTO);
|
||||
ESP_ERROR_CHECK(ret);
|
||||
//Attach the LCD to the SPI bus
|
||||
ret=spi_bus_add_device(LCD_HOST, &devcfg, &spi);
|
||||
|
||||
Reference in New Issue
Block a user