modm API documentation

#include <modm/platform/uart/uart_2.hpp>

Inheritance diagram for modm::platform::Uart2:
modm::platform::UartBase modm::Uart modm::PeripheralDriver

Public Types

enum  Parity : uint32_t { Even = 0, Odd = 1, Disabled = 2 }
 
enum  RxPinout : uint8_t { RxPad0 = 0, RxPad1 = 1, RxPad2 = 2, RxPad3 = 3 }
 
enum  TxPinout : uint8_t { TxPad0_XckPad1 = 0, TxPad2_XckPad3 = 1, TxPad0_RtsTePad2_CtsPad3 = 2 }
 

Static Public Member Functions

template<class... Pins>
static void connect ()
 
template<class SystemClock , baudrate_t baudrate, percent_t tolerance = pct(1)>
static void initialize (Parity parity=Parity::Disabled)
 
static void writeBlocking (uint8_t data)
 
static void writeBlocking (const uint8_t *data, std::size_t length)
 
static void flushWriteBuffer ()
 
static bool write (uint8_t data)
 
static std::size_t write (const uint8_t *data, std::size_t length)
 
static bool isWriteFinished ()
 
static std::size_t discardTransmitBuffer ()
 
static bool read (uint8_t &data)
 
static std::size_t read (uint8_t *buffer, std::size_t length)
 
static std::size_t discardReceiveBuffer ()
 
static void acknowledgeInterruptFlag ()
 
template<uint64_t available, uint64_t requested, percent_t tolerance>
static void assertBaudrateInTolerance ()
 
template<double available, double requested, percent_t tolerance>
static void assertDurationInTolerance ()
 
static void clearError ()
 Reset the sticky error indication.
 
static void configurePurpose ()
 configures a peripheral for a specific purpose
 
static bool getInterruptFlag ()
 Read an interrupt flag.
 
static void getParameter ()
 returns a parameter
 
static bool hasError ()
 
template<class SystemClock , baudrate_t baudrate, percent_t tolerance = 10_pct>
static void initialize ()
 
static std::size_t receiveBufferSize ()
 
static void setParameter ()
 sets a parameter
 
static std::size_t transmitBufferSize ()
 

Static Public Attributes

static constexpr size_t RxBufferSize = 16
 Size of the receive buffer.
 
static constexpr size_t TxBufferSize = 16
 Size of the transmit buffer.
 

Detailed Description

Universal asynchronous receiver transmitter (UART2)

Author
Erik Henriksson

Member Function Documentation

static void modm::PeripheralDriver::acknowledgeInterruptFlag ( )
inheritedstatic

Acknowledge an interrupt flag.

We use acknowledge here, since it describes the intention rather than the actual implementation.

template<uint64_t available, uint64_t requested, percent_t tolerance>
static void modm::PeripheralDriver::assertBaudrateInTolerance ( )
inheritedinlinestatic

Since baudrates are usually generated by prescaling a system clock, only several distinct values can be generated. This method checks if the user requested baudrate is within error tolerance of the system achievable baudrate.

static bool modm::Uart::hasError ( )
inheritedstatic
Returns
true if an error occured during any write or read
template<class SystemClock , baudrate_t baudrate, percent_t tolerance = 10_pct>
static void modm::Uart::initialize ( )
inheritedstatic

Initializes the hardware and sets the baudrate.

Template Parameters
SystemClockthe currently active system clock
baudratedesired baud rate in Hz
tolerancethe allowed absolute tolerance for the resulting baudrate
static std::size_t modm::Uart::receiveBufferSize ( )
inheritedstatic
Returns
the size of the receive FIFO queue.
static std::size_t modm::Uart::transmitBufferSize ( )
inheritedstatic
Returns
the size of the transmit FIFO queue.

The documentation for this class was generated from the following files: