modm API documentation for NUCLEO-G071RB
|
#include <modm/platform/uart/uart_hal_3.hpp>
Public Types | |
enum | Interrupt : uint32_t { Interrupt::CharacterMatch = USART_CR1_CMIE, Interrupt::ParityError = USART_CR1_PEIE, Interrupt::TxEmpty = USART_CR1_TXEIE, Interrupt::TxComplete = USART_CR1_TCIE, Interrupt::RxNotEmpty = USART_CR1_RXNEIE } |
enum | InterruptFlag : uint32_t { InterruptFlag::CharacterMatch = USART_ISR_CMF, InterruptFlag::TxEmpty = USART_ISR_TXE, InterruptFlag::TxComplete = USART_ISR_TC, InterruptFlag::RxNotEmpty = USART_ISR_RXNE, InterruptFlag::OverrunError = USART_ISR_ORE, InterruptFlag::FramingError = USART_ISR_FE, InterruptFlag::ParityError = USART_ISR_PE } |
enum | LastBitClockPulse : uint32_t { DoNotOutput = 0b0, Output = USART_CR2_LBCL } |
enum | Parity : uint32_t { Disabled = 0, Even = USART_CR1_PCE, Odd = USART_CR1_PCE | USART_CR1_PS } |
enum | SpiClock : uint32_t { Disabled = 0b0, Enabled = USART_CR2_CLKEN } |
enum | SpiDataMode : uint32_t { Mode0 = 0b00, Mode1 = USART_CR2_CPHA, Mode2 = USART_CR2_CPOL, Mode3 = USART_CR2_CPOL | USART_CR2_CPHA } |
enum | WordLength : uint32_t { Bit8 = 0, Bit9 = USART_CR1_M } |
Public Member Functions | |
MODM_FLAGS32 (Interrupt) | |
MODM_FLAGS32 (InterruptFlag) | |
Static Public Member Functions | |
static void | enable () |
static void | disable () |
Disables the hw module (by disabling its clock line) | |
static void | enableOperation () |
Set the UE (USART enable) bit. | |
static void | disableOperation () |
Clear the UE (USART enable) bit. | |
template<class SystemClock , baudrate_t baudrate, percent_t tolerance> | |
static void | initialize (Parity parity, WordLength length) |
static void | setSpiClock (SpiClock clk, LastBitClockPulse pulse) |
static void | setSpiDataMode (SpiDataMode mode) |
static void | write (uint16_t data) |
Write a single byte to the transmit register. More... | |
static void | read (uint8_t &data) |
static void | read (uint16_t &data) |
static void | setTransmitterEnable (bool enable) |
static void | setReceiverEnable (bool enable) |
static bool | isReceiveRegisterNotEmpty () |
Returns true if data has been received. | |
static bool | isTransmitRegisterEmpty () |
Returns true if data can be written. | |
static bool | isTransmissionComplete () |
Returns true if the transmission of a frame containing data is complete. | |
static void | enableInterruptVector (bool enable, uint32_t priority) |
static void | enableInterrupt (Interrupt_t interrupt) |
static void | disableInterrupt (Interrupt_t interrupt) |
static void | setInterruptPriority (uint32_t priority) |
static InterruptFlag_t | getInterruptFlags () |
static void | acknowledgeInterruptFlags (InterruptFlag_t flags) |
Static Public Attributes | |
static constexpr bool | isExtended = true |
static const Peripheral | UartPeripheral = Peripheral::Usart3 |
static modm::inplace_function< bool (bool)> | InterruptCallback |
Universal asynchronous receiver transmitter (UsartHal3)
Not available on the low- and medium density devices.
Very basic implementation that exposes more hardware features than the regular Usart classes.
|
inheritedstrong |
|
inheritedstrong |
|
inlinestatic |
Enables the clock, resets the hardware
enableOperation()
to start the peripheral!
|
inlinestatic |
enableOperation()
after this to start the peripheral!
|
inlinestatic |
Saves the value of the receive register to data
|
inlinestatic |
disableOperations()
before this function!
|
inlinestatic |
disableOperations()
before this function!
|
inlinestatic |
Write a single byte to the transmit register.