This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3220S: SPI slave driver with ring buffer

Part Number: CC3220S

Is there a way to configure the SimpleLink TI SPI driver such that the receive path automatically fills a ring buffer like the UART ring buffer driver? My application requires this functionality on SPI but the SPI driver documentation doesn't include it. Maybe wishful thinking on my part but I'm hoping the feature is there. Please advise.

In the worst case, I'm thinking I could use driverlib along with the ring buffer utility to make my own interrupt based SPI receiver that calls RingBuf_put() in the ISR. My application would then call RingBuf_get() to consume the data from the ring buffer. Let me know if there is any limitation to consider for implementing something like that.

Thanks  

  • Hi,

    This functionality is not currently within the SPI driver included in the CC3220 SDK. The way it is currently setup requires you to pass in a specified finite buffer that it will fill directly in one SPI transfer. There is no way to get it to automatically allocate and use a ring buffer that will be used for low-level transfers.

    Your idea for using driverlib and the RingBuf APIs is possible. However, using the RingBuf will probably result in some loss of efficiency, especially since you won't be taking advantage of DMA. Furthermore, the ring buffering scheme provided by TI drivers seems to be optimized for character-by-character data transfers. This might result in excessive CPU cycle usage in the ISR depending on how much data comes in at once. Thus, you may be restrained on the max SPI transfer speed.

    Let me know if you need more clarification on the SPI driver or if you have further questions on this topic.

    Regards,
    Michael
  • Thanks for the quick and helpful reply. I will try this and will test the CPU loading versus achievable SPI clock frequency.