modm API documentation
modm::platform::UartHal1 Class Reference

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

Inheritance diagram for modm::platform::UartHal1:
modm::platform::UartBase

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

static void enable ()
 Enables the hw module.
 
static void disable ()
 Disables the hw module.
 
static void reset ()
 RResets the hw module.
 
template<class SystemClock , baudrate_t baudrate, percent_t tolerance = pct(1)>
static void initialize (Parity parity=Parity::Disabled)
 
static void write (uint8_t data)
 Write a single byte to the transmit register. More...
 
static void read (uint8_t &data)
 
static void setTransmitterEnable (const bool enable)
 Enable/Disable Transmitter.
 
static void setReceiverEnable (bool enable)
 Enable/Disable Receiver.
 
static void enableOperation ()
 Set the UE (USART enable) bit.
 
static void disableOperation ()
 Clear the UE (USART enable) bit.
 
static bool isReceiveRegisterNotEmpty ()
 Returns true if data has been received.
 
static bool isTransmitRegisterEmpty ()
 Returns true if data can be written.
 
static void setRxPinout (RxPinout rxPinout)
 Configure mapping between rx pin functions and IO pads.
 
static void setTxPinout (TxPinout txPinout)
 Configure mapping between tx pin functions and IO pads.
 

Detailed Description

Universal asynchronous receiver transmitter (UartHal1)

Very basic implementation that exposes more hardware features than the regular Usart classes.

Author
Erik Henriksson

Member Function Documentation

template<class SystemClock , baudrate_t baudrate, percent_t tolerance = pct(1)>
static void modm::platform::UartHal1::initialize ( Parity  parity = Parity::Disabled)
static

Initialize Uart HAL Peripheral

Enables clocks, the UART peripheral (but neither TX nor RX) Sets baudrate and parity.

static void modm::platform::UartHal1::read ( uint8_t &  data)
inlinestatic

Saves the value of the receive register to data

Warning
This method does NOT do any sanity checks!! It is your responsibility to check if the register contains something useful!
static void modm::platform::UartHal1::write ( uint8_t  data)
inlinestatic

Write a single byte to the transmit register.

Warning
This method does NOT do any sanity checks!! It is your responsibility to check if the register is empty!

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