Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 6 months ago.
SPI buffered communication - LPC1768
I need a buffered SPI communication where you have a FIFO buffer for tx and you can check whether buffer is full or not. I do not understand why the member function transfer() does not work for me, the IDE states that such member function is not found. Is that related to the hardware, i.e. LPC1768? Any other suggestion to get similar library for buffered SPI communication?
If you are using an rtos you can use a queue or mail and handle writes one at a time. You have one thread dedicated to writing to spi and it blocks waiting for a new mail message. Helper function in the same module is called by other threads to put items into the mailbox. Mailbox can contain as many slots as you need. Here's 16. I'm writing to an sd card here, so need file name and message string to put into the mailbox.
Also, I've not used it, but you can take a look at the CircularBuffer class in mbed.
posted by Graham S. 31 May 2017