mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-14 14:06:54 +00:00
spi: update examples to use the new GDMA driver
This commit is contained in:
@@ -69,15 +69,12 @@ Pins in use. The SPI Master can use the GPIO mux, so feel free to change these i
|
||||
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
#define SENDER_HOST HSPI_HOST
|
||||
#define DMA_CHAN 2
|
||||
|
||||
#elif defined CONFIG_IDF_TARGET_ESP32S2
|
||||
#define SENDER_HOST SPI2_HOST
|
||||
#define DMA_CHAN SENDER_HOST
|
||||
|
||||
#elif defined CONFIG_IDF_TARGET_ESP32C3
|
||||
#define SENDER_HOST SPI2_HOST
|
||||
#define DMA_CHAN SENDER_HOST
|
||||
#define SENDER_HOST SPI2_HOST
|
||||
|
||||
#endif
|
||||
|
||||
@@ -156,7 +153,7 @@ void app_main(void)
|
||||
gpio_isr_handler_add(GPIO_HANDSHAKE, gpio_handshake_isr_handler, NULL);
|
||||
|
||||
//Initialize the SPI bus and add the device we want to send stuff to.
|
||||
ret=spi_bus_initialize(SENDER_HOST, &buscfg, DMA_CHAN);
|
||||
ret=spi_bus_initialize(SENDER_HOST, &buscfg, SPI_DMA_CH_AUTO);
|
||||
assert(ret==ESP_OK);
|
||||
ret=spi_bus_add_device(SENDER_HOST, &devcfg, &handle);
|
||||
assert(ret==ESP_OK);
|
||||
|
Reference in New Issue
Block a user