|
template<class... Signals> |
static void | connect () |
|
static void | reset () |
|
static void | unreset () |
|
static void | setFormat (Parity parity, WordLength length, StopBits stop) |
|
template<class SystemClock , baudrate_t baudrate, percent_t tolerance = pct(1)> |
static baudrate_t | setBaudrate () |
|
template<class SystemClock , baudrate_t baudrate, percent_t tolerance = pct(1)> |
static void | initialize (Parity parity=Parity::Disabled, WordLength length=WordLength::Bit8, StopBits stop=StopBits::Bit1) |
|
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 () |
|
Universal asynchronous receiver transmitter (UART)
This implementation uses the hardware buffer and the software buffer. A software buffer is only used if more than 32 bytes of buffering is requested.
There is no FIFO-not-full flag. It's only possible to check if the FIFO is completely empty. This makes it impossible to add data to the FIFO after the first byte is put into the FIFO.
After detecting that the FIFO is empty (THRE interrupt) the charsLeft variable is set to 32 (= size of FIFO) and some accounting is done in this class.
- Author
- Andrey Kunitsyn