|
Internal Interface Wrap
API reference
|
Abstract base class for built-in USB Serial/JTAG controller wrappers. More...
#include <BaseUsbSerialJtag.h>
Public Member Functions | |
| virtual | ~BaseUsbSerialJtag () noexcept=default |
| BaseUsbSerialJtag (const BaseUsbSerialJtag &)=delete | |
| BaseUsbSerialJtag & | operator= (const BaseUsbSerialJtag &)=delete |
| BaseUsbSerialJtag (BaseUsbSerialJtag &&)=delete | |
| BaseUsbSerialJtag & | operator= (BaseUsbSerialJtag &&)=delete |
| bool | EnsureInitialized () noexcept |
| Install the underlying driver if not already installed. | |
| bool | EnsureDeinitialized () noexcept |
| Uninstall the underlying driver if previously installed. | |
| bool | IsInitialized () const noexcept |
| virtual bool | Initialize () noexcept=0 |
Install the platform driver according to config_. Returns true on success. | |
| virtual bool | Deinitialize () noexcept=0 |
| Tear down the platform driver. Returns true on success. | |
| virtual hf_uart_err_t | Write (const hf_u8_t *data, hf_u32_t length, hf_u32_t timeout_ms=0) noexcept=0 |
Push length bytes to the host PC. | |
| virtual hf_uart_err_t | Read (hf_u8_t *data, hf_u32_t length, hf_u32_t timeout_ms=0, hf_u32_t *out_read_count=nullptr) noexcept=0 |
Pull up to length bytes from the host PC. | |
| virtual hf_uart_err_t | FlushTx (hf_u32_t timeout_ms=0) noexcept=0 |
Block until the TX ring is fully drained to the host (or timeout_ms). | |
| virtual bool | IsHostConnected () const noexcept=0 |
| hf_uart_err_t | WriteString (const char *s, hf_u32_t timeout_ms=0) noexcept |
| Write a NUL-terminated string (no automatic newline). | |
| hf_uart_err_t | WriteLine (const char *s, hf_u32_t timeout_ms=0) noexcept |
| Write a NUL-terminated string then "\r\n". | |
| hf_uart_err_t | ReadByte (hf_u8_t &out, hf_u32_t timeout_ms=0) noexcept |
Read exactly one byte. Returns UART_ERR_TIMEOUT when nothing arrives. | |
| virtual hf_uart_statistics_t | GetStatistics () const noexcept |
| Snapshot byte counters (default: zeroed). Implementations may override. | |
| virtual hf_uart_diagnostics_t | GetDiagnostics () const noexcept |
| Snapshot diagnostic state (default: minimally populated). | |
Protected Member Functions | |
| BaseUsbSerialJtag (const hf_usb_serial_jtag_config_t &cfg) noexcept | |
Protected Attributes | |
| hf_usb_serial_jtag_config_t | config_ {} |
| Subclasses may consult / mutate the buffered config before Initialize(). | |
| bool | initialized_ {false} |
Lifecycle latch maintained by EnsureInitialized() / EnsureDeinitialized(). | |
Abstract base class for built-in USB Serial/JTAG controller wrappers.
Mirrors the lazy-initialise / Read / Write / Flush shape of BaseUart so a ConsoleSerialTransport can hold either a BaseUart* or a BaseUsbSerialJtag* behind a tiny adapter.
|
virtualdefaultnoexcept |
|
delete |
|
delete |
|
inlineexplicitprotectednoexcept |
Tear down the platform driver. Returns true on success.
Implemented in EspUsbSerialJtag.
|
inlinenoexcept |
Uninstall the underlying driver if previously installed.
|
inlinenoexcept |
Install the underlying driver if not already installed.
|
pure virtualnoexcept |
Block until the TX ring is fully drained to the host (or timeout_ms).
Implemented in EspUsbSerialJtag.
|
inlinevirtualnoexcept |
Snapshot diagnostic state (default: minimally populated).
|
inlinevirtualnoexcept |
Snapshot byte counters (default: zeroed). Implementations may override.
Reimplemented in EspUsbSerialJtag.
Install the platform driver according to config_. Returns true on success.
Implemented in EspUsbSerialJtag.
True iff the host PC is currently enumerating / receiving SOF packets. Returns false when only powered (e.g. plugged into a power bank).
Implemented in EspUsbSerialJtag.
|
inlinenoexcept |
|
delete |
|
delete |
|
pure virtualnoexcept |
Pull up to length bytes from the host PC.
| data | Destination buffer. | |
| length | Capacity of destination buffer. | |
| timeout_ms | Maximum time to wait for the first byte (0 = poll, no wait). | |
| [out] | out_read_count | Optional: number of bytes actually read. |
UART_SUCCESS when at least one byte was read, UART_ERR_TIMEOUT when no byte arrived in time, or another error code on failure. Implemented in EspUsbSerialJtag.
|
inlinenoexcept |
Read exactly one byte. Returns UART_ERR_TIMEOUT when nothing arrives.
|
pure virtualnoexcept |
Push length bytes to the host PC.
| data | Pointer to source buffer. |
| length | Number of bytes to push. |
| timeout_ms | Maximum time to wait if the TX ring buffer is full (0 = use the driver's default). |
UART_SUCCESS if all bytes were accepted into the TX ring, UART_ERR_TIMEOUT if only some were accepted, or one of the configuration / not-initialised errors otherwise. Implemented in EspUsbSerialJtag.
|
inlinenoexcept |
Write a NUL-terminated string then "\r\n".
|
inlinenoexcept |
Write a NUL-terminated string (no automatic newline).
|
protected |
Subclasses may consult / mutate the buffered config before Initialize().
Lifecycle latch maintained by EnsureInitialized() / EnsureDeinitialized().