How is the calling code designed?

What is the intended design of higher-level code using the driver? Will it operate on individual characters or bytes as they come in? Or does it make more sense for the higher-level code to batch transfers into blocks/frames of bytes? 

Queue-based drivers are very useful when dealing with unknown amounts (or streams) of data that can come in at any point in time. They are also a very natural fit for code that processes individual bytes—uartPrintOutTask was a good example of this:

 while(1) {     xQueueReceive(uart2_BytesReceived, &nextByte, portMAX_DELAY);    //do something with the byte received     SEGGER_SYSVIEW_PrintfHost("%c", nextByte); }

While ring-buffer implementations (such as the one in the preceding code) ...

Get Hands-On RTOS with Microcontrollers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.