|
Internal Interface Wrap
API reference
|
Abstract base class for UART driver implementations. More...
#include <BaseUart.h>
Public Member Functions | |
| virtual | ~BaseUart () noexcept=default |
| Virtual destructor ensures proper cleanup in derived classes. | |
| BaseUart (const BaseUart &)=delete | |
| BaseUart & | operator= (const BaseUart &)=delete |
| BaseUart (BaseUart &&)=delete | |
| BaseUart & | operator= (BaseUart &&)=delete |
| bool | EnsureInitialized () noexcept |
| Ensures that the UART is initialized (lazy initialization). | |
| bool | EnsureDeinitialized () noexcept |
| Ensures that the UART is deinitialized (lazy deinitialization). | |
| bool | IsInitialized () const noexcept |
| Checks if the driver is initialized. | |
| hf_port_num_t | GetPort () const noexcept |
| Get the UART port number. | |
| virtual bool | Initialize () noexcept=0 |
| Initialize the UART driver. | |
| virtual bool | Deinitialize () noexcept=0 |
| Deinitialize the UART driver. | |
| virtual hf_uart_err_t | Write (const hf_u8_t *data, hf_u16_t length, hf_u32_t timeout_ms=0) noexcept=0 |
| Write data to the UART. | |
| virtual hf_uart_err_t | Read (hf_u8_t *data, hf_u16_t length, hf_u32_t timeout_ms=0) noexcept=0 |
| Read data from the UART. | |
| virtual hf_u16_t | BytesAvailable () noexcept=0 |
| Get the number of bytes available to read. | |
| virtual hf_uart_err_t | FlushTx () noexcept=0 |
| Flush the transmit buffer. | |
| virtual hf_uart_err_t | FlushRx () noexcept=0 |
| Flush the receive buffer. | |
| virtual int | Printf (const char *format,...) noexcept=0 |
| Printf-style formatted output. | |
| virtual bool | Open () noexcept |
| Open the UART (alias for Initialize). | |
| virtual bool | Close () noexcept |
| Close the UART (alias for Deinitialize). | |
| virtual bool | WriteString (const char *str) noexcept |
| Write a string to the UART. | |
| virtual bool | WriteByte (hf_u8_t byte) noexcept |
| Write a single byte to the UART. | |
| virtual hf_uart_err_t | ResetStatistics () noexcept |
| Reset UART operation statistics. | |
| virtual hf_uart_err_t | ResetDiagnostics () noexcept |
| Reset UART diagnostic information. | |
| virtual hf_uart_err_t | GetStatistics (hf_uart_statistics_t &statistics) const noexcept |
| Get UART operation statistics. | |
| virtual hf_uart_err_t | GetDiagnostics (hf_uart_diagnostics_t &diagnostics) const noexcept |
| Get UART diagnostic information. | |
Protected Member Functions | |
| BaseUart (hf_port_num_t port) noexcept | |
| Protected constructor with port. | |
Protected Attributes | |
| hf_port_num_t | port_ |
| UART port number. | |
| bool | initialized_ |
| Initialization status. | |
| hf_uart_statistics_t | statistics_ |
| UART operation statistics. | |
| hf_uart_diagnostics_t | diagnostics_ |
| UART diagnostic information. | |
Abstract base class for UART driver implementations.
This class provides a comprehensive UART driver abstraction that serves as the base for all UART implementations in the HardFOC system. It supports:
Derived classes implement platform-specific details such as:
|
virtualdefaultnoexcept |
Virtual destructor ensures proper cleanup in derived classes.
|
delete |
|
inlineprotectednoexcept |
Protected constructor with port.
| port | UART port number |
Close the UART (alias for Deinitialize).
|
inlinenoexcept |
Ensures that the UART is deinitialized (lazy deinitialization).
|
inlinenoexcept |
Ensures that the UART is initialized (lazy initialization).
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
inlinevirtualnoexcept |
Get UART diagnostic information.
| diagnostics | Reference to store diagnostics data |
Reimplemented in EspUart.
|
inlinenoexcept |
Get the UART port number.
|
inlinevirtualnoexcept |
Get UART operation statistics.
| statistics | Reference to store statistics data |
Reimplemented in EspUart.
|
inlinenoexcept |
Checks if the driver is initialized.
Open the UART (alias for Initialize).
|
pure virtualnoexcept |
|
inlinevirtualnoexcept |
Reset UART diagnostic information.
|
inlinevirtualnoexcept |
Reset UART operation statistics.
Write a single byte to the UART.
| byte | Byte to write |
Reimplemented in EspUart.
Write a string to the UART.
| str | String to write |
|
protected |
UART diagnostic information.
|
protected |
Initialization status.
|
protected |
UART port number.
|
protected |
UART operation statistics.