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

spi_slave circular FIFO on NRF51822 S110 7.0

Are there any common solutions to the issue of spi_slave.c using an array as its buffer? I would like to setup a circular FIFO, but I am not sure if there is any way to do this without rewriting some of spi_slave.c.

I will need to place an arbitrary amount of data in the MISO buffer and need to wrap around to the front, should the end be reached.

Thanks for any advice!

Edit: I may be asking an elementary C question, so I will close this if I come to a solution on my own. Thanks.

Parents
  • The way the SPI slave works now is that you set buffers before each RX/TX transaction. You must define the length of your RX buffer and the length of your outgoing data in the TX buffer. The SPI master controls when transaction begins and when it ends. After each transaction, you could perhaps consider to extract data from the SPIS buffers and insert into a circular buffer, if that is what you want to do? Have you examined the SPIS slave example in the nRF51 SDK?

Reply
  • The way the SPI slave works now is that you set buffers before each RX/TX transaction. You must define the length of your RX buffer and the length of your outgoing data in the TX buffer. The SPI master controls when transaction begins and when it ends. After each transaction, you could perhaps consider to extract data from the SPIS buffers and insert into a circular buffer, if that is what you want to do? Have you examined the SPIS slave example in the nRF51 SDK?

Children
Related