SPI Slave mode amount of received data

almaz1c
Posts: 2
Joined: Thu Mar 22, 2018 10:18 am

SPI Slave mode amount of received data

Postby almaz1c » Mon May 28, 2018 10:06 am

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?

rosenrot
Posts: 25
Joined: Wed Jan 01, 2020 9:28 pm

Re: SPI Slave mode amount of received data

Postby rosenrot » Fri Jan 31, 2020 12:49 am

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.

Who is online

Users browsing this forum: No registered users and 154 guests