Hi,kbrafford wrote: ↑Thu Feb 22, 2018 12:59 amI need to implement a SPI slave capability that works in the following way:
1) You set up your SPI port as a slave, with the polarity and phase of your configuration, and with a slave select pin
2) You provide an outbound buffer to be pulled from. This will be the MISO bytes that are shifted out the next time the master executes a transfer
3) You register a callback that gets called once there is a transfer
--callback is called after chip-deselect of the spi transfer--
4) The callback gets the byte buffer that came in the MOSI line on the transfer. The length _n_ of this buffer also tells you that the first _n_ bytes of the outbound buffer were sent to the master during the transfer
5) The callback submits its next "send these bytes next" buffer and is done
Does this type of interface make sense? If I wanted to do this, how would I go about starting? Would I need to basically implement my own "fork" of the SPI driver and change the parts I need, or is there a clean way to just modify the slave performance to do what I need?
Do you have the SPI.c code example for those changes? I'm looking into do the same in my side
Statistics: Posted by roiz — Tue Apr 16, 2024 3:30 am