Stream buffers combine the convenience of a queue-based system with the speed closer to that of the raw buffer implementations we created previously. They have some flexibility limitations that are similar to the limitations of task notification systems compared to semaphores. Stream buffers can only be used by one sender and one receiver at a time. Otherwise, they'll need external protection (such as a mutex), if they are to be used by multiple tasks.
The programming model for stream buffers is very similar to queues, except that instead of functions being limited to queueing one item at a time, they can queue multiple items at a time (which saves considerable CPU time when queuing blocks of data). In this example, we'll explore stream buffers through an efficient DMA-based circular buffer implementation for UART reception.
The goals of...