FX3 SPI port in register, non-burst, mode, are the calls blocking until completition ? | Cypress Semiconductor
FX3 SPI port in register, non-burst, mode, are the calls blocking until completition ?
Hello all, I need to use the SPI port configured for 32bit words in register, non-burst, non-block mode, one 32bit word (4 bytes) transfer at a time. No call-back function is used.
Looking at the cyfxusbspiregmode.c example, that is relatively similar with what I need, it seems that the calls to CyU3PSpiTransmitWords() and CyU3PSpiReceiveWords() functions are treated like blocking calls, that is when the call returns, the operation is completed. This is what we need but on the other side, on the API specification there is the function CyU3PSpiWaitForBlockXfer() that is not clear if it has to be used or not in my above described situation.
Also, another important question: do I need to call explicitly the function CyU3PSpiDisableBlockXfer() to be able to use the SPI block in register mode ? The example cyfxusbspiregmode.c does not use this function, but the API documentation states:
"This function disables DMA transfers through the SPI block in the TX and/or RX directions. It is possible to disable
only the RX or the TX operation, and leave the transfer in the other direction running.
Both TX and RX transfers need to be disabled through this API before register mode transfers can be used."
If someone from Cypress could shed a bit of light over these issues, that will be really appreciated.