This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPI Manager, Multiple Transfers, and begin_callback

I'm using the SPI manager to talk to an ILI9342 graphics IC. I need to toggle an IO line during a transaction or in between transfers. For the first byte the line will be low, for the following bytes it will be high. I know I can use begin_callback to trigger code that will run before the first byte goes out but I need another callback before the second byte goes out as well. I figure I may be able to do this by putting multiple transfers in the same transaction. I put the first byte in the first transfer and the remaining bytes in the second transfer. That would work if the begin_callback was triggered before each transfer in the transaction. Does anyone know for sure if the begin_callback call happens just once, before the first transfer of a transaction? Or does it fire before every transfer of the transaction?

If it only fires once (before the first transfer of the transaction), does anyone know of a way to get a callback before each transfer of a transaction?

The CS needs to stay low when switching the IO line. One work around would be to set the CS line and the IO line in begin_callback and using multiple transactions but that seems clunky.  I'm hoping someone can tell me a way to get a callback after each transfer in a transaction.

Thanks

.

Related