|
enum | Interrupt : uint32_t { 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::TxEmpty = USART_SR_TXE,
InterruptFlag::TxComplete = USART_SR_TC,
InterruptFlag::RxNotEmpty = USART_SR_RXNE,
InterruptFlag::OverrunError = USART_SR_ORE,
InterruptFlag::FramingError = USART_SR_FE,
InterruptFlag::ParityError = USART_SR_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
} |
|
|
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 | 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) |
|
Universal asynchronous receiver transmitter (UartHal8)
Not available on the low- and medium density devices.
Very basic implementation that exposes more hardware features than the regular Usart classes.
- Author
- Kevin Laeufer