|
TinyWifiDongle 0.1.0
Header-only USB WiFi dongle for Arduino
|
USB CDC-NCM network device for the ESP32-S2/S3 (TinyUSB). More...
#include <Esp32UsbNcm.h>


Classes | |
| struct | Stats |
| Counters since start: frames received from and sent to the host, frames dropped on the way out, polls that found the driver busy, and stall recoveries (USB re-enumerations). More... | |
Public Member Functions | |
| bool | begin (const char *productName) override |
| Registers the USB network interface (before the USB stack is started). | |
| bool | ready () override |
| The host has enumerated and configured the device. | |
| void | setReceiver (FrameReceiver *receiver) override |
| Frames coming from the host are passed to receiver. | |
| void | setHostMac (const uint8_t mac[6]) override |
| bool | send (const uint8_t *frame, uint16_t len) override |
| Runs in the caller's task: copy, enqueue, never block. | |
| void | setMaxFrame (uint16_t bytes) |
| Largest Ethernet frame announced to the host; call before begin(). | |
| void | setStallTimeout (uint32_t ms) |
| const uint8_t * | hostMac () const |
| MAC address of the adapter as the host sees it. | |
| Stats | stats () const |
| Current counters. | |
| void | logControllerState () |
| uint32_t | txQueued () const |
| Number of frames waiting to be sent to the host. | |
| void | onNcmReceive (const uint8_t *src, uint16_t size) |
| A frame from the host (TinyUSB task; must not block). | |
| Public Member Functions inherited from twd::UsbTransport | |
| virtual | ~UsbTransport ()=default |
Static Public Member Functions | |
| static Esp32UsbNcm * | instance_ () |
| The instance that receives the TinyUSB callbacks. | |
USB CDC-NCM network device for the ESP32-S2/S3 (TinyUSB).
Implements UsbTransport on top of the TinyUSB NCM class that the Arduino core ships:
The TinyUSB callbacks are C functions, so the class is a singleton in effect: the instance that ran begin() receives them.
Definition at line 38 of file Esp32UsbNcm.h.
|
inlineoverridevirtual |
Registers the USB network interface (before the USB stack is started).
Implements twd::UsbTransport.
Definition at line 51 of file Esp32UsbNcm.h.
|
inline |
MAC address of the adapter as the host sees it.
Definition at line 127 of file Esp32UsbNcm.h.
|
inlinestatic |
The instance that receives the TinyUSB callbacks.
Definition at line 156 of file Esp32UsbNcm.h.
|
inline |
Logs the USB controller's registers of the data IN endpoint: control, transfer size, interrupt flags, FIFO space, and the interrupt masks. A debugging aid for a stalled send path. Only available on the ESP32-S2/S3, where the controller sits at a known address; on other chips it only reports that.
Definition at line 136 of file Esp32UsbNcm.h.
|
inline |
A frame from the host (TinyUSB task; must not block).
Definition at line 159 of file Esp32UsbNcm.h.
|
inlineoverridevirtual |
The host has enumerated and configured the device.
Implements twd::UsbTransport.
Definition at line 83 of file Esp32UsbNcm.h.
|
inlineoverridevirtual |
Runs in the caller's task: copy, enqueue, never block.
Implements twd::UsbTransport.
Definition at line 93 of file Esp32UsbNcm.h.
|
inlineoverridevirtual |
MAC address of the adapter as the host sees it (default: derived from the chip id). Call before begin().
Implements twd::UsbTransport.
Definition at line 87 of file Esp32UsbNcm.h.
|
inline |
Largest Ethernet frame announced to the host; call before begin().
Definition at line 120 of file Esp32UsbNcm.h.
|
inlineoverridevirtual |
Frames coming from the host are passed to receiver.
Implements twd::UsbTransport.
Definition at line 85 of file Esp32UsbNcm.h.
|
inline |
Re-enumerate USB if sending makes no progress for ms milliseconds. 0 switches the watchdog off: a stalled send path then stays stalled.
Definition at line 124 of file Esp32UsbNcm.h.
|
inline |
Current counters.
Definition at line 130 of file Esp32UsbNcm.h.
|
inline |
Number of frames waiting to be sent to the host.
Definition at line 152 of file Esp32UsbNcm.h.