Skip to content

Universal Asynchronous Receiver Transmitter (UART)

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>>;

This module is only available for stm32.

Dependencies

modm:platform:uart modm_platform_uart modm: platform: uart modm_architecture_atomic modm: architecture: atomic modm_platform_uart->modm_architecture_atomic modm_architecture_interrupt modm: architecture: interrupt modm_platform_uart->modm_architecture_interrupt modm_architecture_register modm: architecture: register modm_platform_uart->modm_architecture_register modm_architecture_uart modm: architecture: uart modm_platform_uart->modm_architecture_uart modm_cmsis_device modm: cmsis: device modm_platform_uart->modm_cmsis_device modm_math_algorithm modm: math: algorithm modm_platform_uart->modm_math_algorithm modm_platform_gpio modm: platform: gpio modm_platform_uart->modm_platform_gpio modm_platform_rcc modm: platform: rcc modm_platform_uart->modm_platform_rcc modm_utils modm: utils modm_platform_uart->modm_utils

Limited availability: Check with 'lbuild discover' if this module is available for your target!