modm API documentation
Universal Asynchronous Receiver Transmitter (UART)

Modules

 Instance 1
 
 Instance 2
 
 Instance 3
 
 Instance 4
 
 Instance 5
 
 Instance 6
 
 Instance 7
 
 Instance 8
 

Classes

struct  modm::platform::BufferedUart< Hal, Buffers >
 
class  modm::platform::FreeRtosBuffer< SIZE >
 
class  modm::platform::UartBase
 
class  modm::platform::UartHal4
 
class  modm::platform::UartHal5
 
class  modm::platform::UartHal7
 
class  modm::platform::UartHal8
 
class  modm::platform::UartRxBuffer< SIZE >
 
class  modm::platform::UsartHal1
 
class  modm::platform::UsartHal2
 
class  modm::platform::UsartHal3
 
class  modm::platform::UsartHal6
 

Detailed Description

lbuild module: modm:platform:uart

The UART buffer configuration is implemented as C++ template arguments:

using namespace modm::platform;
// Using only hardware buffers for Tx and Rx (both 1 symbol)
using UartN = BufferedUart<U(s)artHalN>;
// using only TX software buffer
using UartN = BufferedUart<U(s)artHalN, UartTxBuffer<512>>;
// using only RX software buffer
using UartN = BufferedUart<U(s)artHalN, UartRxBuffer<256>>;
// using both TX and RX software buffers
using UartN = BufferedUart<U(s)artHalN, UartTxBuffer<512>, UartRxBuffer<256>>;

Using FreeRTOS buffers

A special buffer implementation is available for FreeRTOS that uses the proper queue implementation to sleep and wake up the calling thread:

// using both TX and RX software buffers
using UartTxRxN = BufferedUart<U(s)artHalN, UartTxBufferFreeRtos<512>, UartRxBufferFreeRtos<256>>;