|
Internal Interface Wrap
API reference
|
#include <EspUsbSerialJtag.h>
Public Member Functions | |
| EspUsbSerialJtag (const hf_usb_serial_jtag_config_t &cfg) noexcept | |
| EspUsbSerialJtag () noexcept | |
| Construct with library defaults (256-byte TX/RX rings). | |
| ~EspUsbSerialJtag () noexcept override | |
| bool | Initialize () noexcept override |
Install the platform driver according to config_. Returns true on success. | |
| bool | Deinitialize () noexcept override |
| Tear down the platform driver. Returns true on success. | |
| hf_uart_err_t | Write (const hf_u8_t *data, hf_u32_t length, hf_u32_t timeout_ms=0) noexcept override |
Push length bytes to the host PC. | |
| 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 override |
Pull up to length bytes from the host PC. | |
| hf_uart_err_t | FlushTx (hf_u32_t timeout_ms=0) noexcept override |
Block until the TX ring is fully drained to the host (or timeout_ms). | |
| bool | IsHostConnected () const noexcept override |
| hf_uart_statistics_t | GetStatistics () const noexcept override |
| Snapshot byte counters (default: zeroed). Implementations may override. | |
Public Member Functions inherited from BaseUsbSerialJtag | |
| 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 |
| 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_diagnostics_t | GetDiagnostics () const noexcept |
| Snapshot diagnostic state (default: minimally populated). | |
Static Public Member Functions | |
| static EspUsbSerialJtag & | Default (const hf_usb_serial_jtag_config_t &cfg={}) noexcept |
| Get-or-create a process-wide shared instance. | |
Private Attributes | |
| bool | owns_driver_ {false} |
| hf_uart_statistics_t | statistics_ {} |
Additional Inherited Members | |
Protected Member Functions inherited from BaseUsbSerialJtag | |
| BaseUsbSerialJtag (const hf_usb_serial_jtag_config_t &cfg) noexcept | |
Protected Attributes inherited from BaseUsbSerialJtag | |
| 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(). | |
|
explicitnoexcept |
Construct with explicit configuration (driver is NOT installed yet — call EnsureInitialized() or Initialize() to install).
|
noexcept |
Construct with library defaults (256-byte TX/RX rings).
|
overridenoexcept |
|
staticnoexcept |
Get-or-create a process-wide shared instance.
The first call configures the singleton with cfg. Subsequent calls ignore cfg and return the same instance. This matches the underlying hardware: the USB Serial/JTAG block is global.
| cfg | Configuration applied on first call only. |
|
overridevirtualnoexcept |
Tear down the platform driver. Returns true on success.
Implements BaseUsbSerialJtag.
|
overridevirtualnoexcept |
Block until the TX ring is fully drained to the host (or timeout_ms).
Implements BaseUsbSerialJtag.
|
inlineoverridevirtualnoexcept |
Snapshot byte counters (default: zeroed). Implementations may override.
Reimplemented from BaseUsbSerialJtag.
|
overridevirtualnoexcept |
Install the platform driver according to config_. Returns true on success.
Implements BaseUsbSerialJtag.
|
overridevirtualnoexcept |
True iff the host PC is currently enumerating / receiving SOF packets. Returns false when only powered (e.g. plugged into a power bank).
Implements BaseUsbSerialJtag.
|
overridevirtualnoexcept |
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. Implements BaseUsbSerialJtag.
|
overridevirtualnoexcept |
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. Implements BaseUsbSerialJtag.
True when this wrapper called usb_serial_jtag_driver_install() itself (vs. discovering an already-installed IDF console driver). Controls whether Deinitialize() calls usb_serial_jtag_driver_uninstall().
|
private |