Hello all,
I'd like to use my PyBoard as a SPI slave. I'd like the master to send commands to the PyBoard and this one answers.
My problem is that it looks like I need to know how long the command gonna be and I don't. :/
As some of the first bytes of the frame give me the information, I thought about fetching bytes individually. But looks like that when I do it, the end of the frame is lost.
I also thought about using the receive command with a timeout but problems occur if I receive more than one frame in it. For example, I got a buffer of 20 and I try to receive 2 frames of 15 bytes -> The last 10 bytes are lost.
So here are my questions:
-> Is it possible to receive bytes and parse them on the fly?
-> Is it possible to fully manage SPI on interrupt (I haven't found any interrupt triggered when some data are in the Rx buffer?)
Thanks in advance,
Harold