SPI Slave Mode

gawied
Posts: 3
Joined: Thu Oct 12, 2017 3:15 pm

SPI Slave Mode

Postby gawied » Thu Nov 16, 2017 3:18 pm

I am referring to the following docs:
https://esp-idf.readthedocs.io/en/lates ... slave.html

I am a bit confused how this works. My intention is to create a slave, so a master can send different commands (e.g. command indicating that a data transfer is to follow, a query command where the slave returns data, etc.). The slave then needs to respond with the requested data or saves the transferred data. Al this must happen in one transaction. I think this is how most spi slaves are implemented (?).

As far as I can see, the SPI Slave driver in the ESP-IDF is transaction based - i.e. I need to load a transaction in the queue and then wait for the master to start a comms session in which the previous loaded transaction will then be handled. So in order for me to respond to random commands from the master, I need to know up front what the master is going to do - which is not possible of course.

So, it seems that I won’t be able to create such a SPI slave with the current ESP-IDF SPI slave driver or am I missing something?

Thanks and any help/advice is greatly appreciated.

Who is online

Users browsing this forum: MicroController and 252 guests