|
enum | DataMode : uint32_t { DataMode::Mode0 = 0b00,
DataMode::Mode1 = USART_CR2_CPHA,
DataMode::Mode2 = USART_CR2_CPOL,
DataMode::Mode3 = USART_CR2_CPOL | USART_CR2_CPHA
} |
|
enum | DataMode : uint8_t { DataMode::Mode0 = 0b00,
DataMode::Mode1 = 0b01,
DataMode::Mode2 = 0b10,
DataMode::Mode3 = 0b11
} |
| Spi Data Mode, Mode0 is the most common mode. More...
|
|
enum | DataOrder : uint8_t { MsbFirst = 0b0,
LsbFirst = 0b1
} |
| Spi Data Order, MsbFirst is the most common mode.
|
|
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
} |
|
|
template<class... Signals> |
static void | connect () |
|
template<class SystemClock , baudrate_t baudrate, percent_t tolerance = pct(5)> |
static void | initialize () |
|
static void | setDataMode (DataMode mode) |
|
static void | setDataOrder (DataOrder order) |
|
static uint8_t | transferBlocking (uint8_t data) |
|
static void | transferBlocking (const uint8_t *tx, uint8_t *rx, std::size_t length) |
|
static modm::ResumableResult< uint8_t > | transfer (uint8_t data) |
|
static modm::ResumableResult< void > | transfer (const uint8_t *tx, uint8_t *rx, std::size_t length) |
|
static void | acknowledgeInterruptFlag () |
|
static uint8_t | acquire (void *ctx, ConfigurationHandler handler=nullptr) |
|
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 | configurePurpose () |
| configures a peripheral for a specific purpose
|
|
template<class... Signals> |
static void | connect () |
|
static bool | getInterruptFlag () |
| Read an interrupt flag.
|
|
static void | getParameter () |
| returns a parameter
|
|
template<class SystemClock , baudrate_t baudrate, percent_t tolerance = 5_pct> |
static void | initialize () |
|
static void | initialize () |
| initializes the peripheral, must be called before use.
|
|
static uint8_t | release (void *ctx) |
|
static void | setDataMode (DataMode mode) |
| Sets a new data mode.
|
|
static void | setDataOrder (DataOrder order) |
| Sets a new data order.
|
|
static void | setParameter () |
| sets a parameter
|
|
static modm::ResumableResult< uint8_t > | transfer (uint8_t data) |
|
static modm::ResumableResult< void > | transfer (const uint8_t *tx, uint8_t *rx, std::size_t length) |
|
static uint8_t | transferBlocking (uint8_t data) |
|
static void | transferBlocking (const uint8_t *tx, uint8_t *rx, std::size_t length) |
|
static uint8_t | acquire (void *ctx, Spi::ConfigurationHandler handler) |
|
static uint8_t | release (void *ctx) |
|
Serial Peripheral Interface of the Uart module.
- Warning
- Be aware, that the UART module can send bytes only LSB first. Therefore the data is bit reversed in software for DataOrder::MsbFirst.
- Author
- Niklas Hauser