ESP32 SPI pin initialization in the slave mode,

Mehrdad
Posts: 1
Joined: Mon Nov 28, 2016 7:00 am

ESP32 SPI pin initialization in the slave mode,

Postby Mehrdad » Mon Nov 28, 2016 7:51 am

Hi Gents,

I would like to know if someone can respond my questions about HSPI in the slave mode using DMA. If someone know the response I am appreciated if share the answer with me also.

Questions are :

1. If I want to use the original alternative pins for Slave SPI, is the following pin initialization is correct?

//CLK
gpio_pad_select_gpio(GPIO_NUM_14);
gpio_set_direction(GPIO_NUM_14, GPIO_MODE_INPUT);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, 1); //gpio_matrix_in(GPIO_NUM_14, HSPICLK_IN_IDX,0);

//MISO
gpio_pad_select_gpio(GPIO_NUM_12);
gpio_set_direction(GPIO_NUM_12, GPIO_MODE_OUTPUT);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, 1); //gpio_matrix_out(GPIO_NUM_12, HSPIQ_OUT_IDX,0,0);

//MOSI
gpio_pad_select_gpio(GPIO_NUM_13);
gpio_set_direction(GPIO_NUM_13, GPIO_MODE_INPUT);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U, 1); //gpio_matrix_in(GPIO_NUM_13, HSPID_IN_IDX,0);

//CSS
gpio_pad_select_gpio(GPIO_NUM_15);
gpio_set_direction(GPIO_NUM_15, GPIO_MODE_INPUT);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, 1); //gpio_matrix_in(GPIO_NUM_15, HSPICS0_IN_IDX,0);

2. When data is being sent by Host MCU (which is set in SPI master mode) the ESP32 doesn't assert the DMA_ISR! Do you guys know if ESP32's SPI slave mode with DMA needs any special command/address in the beginning or it can work completely transparent (just pure data) without any command and address?

3. For SPI in the slave or master mode should I use special channel of DMA or any of existed channels could be workable?

Thanks in advance~~
Mehrdad F.

Who is online

Users browsing this forum: No registered users and 30 guests