Page 1 of 1

SPI Slave mode amount of received data

Posted: Mon May 28, 2018 10:06 am
by almaz1c
Hello!
I use ESP32 as SPI Slave device.
I use following code:

Code: Select all

	    
	    memset(spi_recvbuf, 0x00, sizeof(spi_recvbuf));
	    ret1 = spi_slave_queue_trans(HSPI_HOST, &t, 1);
	    ret2 = spi_slave_get_trans_result(HSPI_HOST, &t2, portMAX_DELAY);
	    if(t2->trans_len > 8)
	    	spi_2_printf("spi rcv %d of %d bytes\r\n", t2->trans_len / 8, t2->length / 8);

Code: Select all

trans_len
contain amount of data sent from ESP32.
My problem is that I can't to check for amount of received data.
How can I do that?

Re: SPI Slave mode amount of received data

Posted: Fri Jan 31, 2020 12:49 am
by rosenrot
Hey, did you solve it? Can you give me a hint how you are using it?

I'm a little bit stuck at how you get out the data. Do you need an array of rx_buffers?

Any hint is welcome.