USB device
Header File
Classes
-
class DeviceDescriptor
Interface to handle device descriptor.
Subclassed by esptinyusb::USBdevice
-
class esptinyusb::StringDescriptor
USB device strings descriptor.
Header File
Classes
-
class USBEndpoint
Header File
Classes
-
class USBInterface
Header File
Enumerations
Classes
-
class esptinyusb::USBdevice : private virtual esptinyusb::DeviceDescriptor
Subclassed by esptinyusb::BaseDevice
Public Functions
-
virtual uint8_t *getConfigDescriptor() final
Get the Config Descriptor.
- Returns
uint8_t*
-
virtual uint8_t *getDeviceDescriptor() final
Get the Device Descriptor.
- Returns
uint8_t*
-
const uint16_t *getStringDescriptor(uint8_t index, uint16_t langid)
Get the String Descriptor.
- Parameters
index –
langid –
- Returns
const uint16_t*
-
virtual uint8_t addString(const char *pointer, int8_t id = -1)
Add the string for device descriptor and device class.
- Parameters
pointer –
id –
- Returns
uint8_t
-
inline virtual void setDescriptor(tusb_desc_device_t &&src)
Set the device descriptor.
- Parameters
src –
-
inline virtual void setClass(uint16_t _class, uint16_t subclass, uint16_t protocol) final
Set the USB device descriptor class, subclass and protocol.
- Parameters
_class –
subclass –
protocol –
-
inline virtual void setVidPid(uint16_t vid, uint16_t pid) final
Set the vid and pid.
- Parameters
vid –
pid –
-
inline virtual void setVersion(uint16_t device = 0x100, uint16_t usb = 0x200) final
Set the device and usb version in BCD.
- Parameters
device –
usb –
-
inline virtual void mfgStringId(uint8_t id) final
Set the manufacturer string id.
- Parameters
id –
-
inline virtual void productStringId(uint8_t id) final
Set the product string id.
- Parameters
id –
-
inline virtual void serialStringId(uint8_t id) final
Set the serial number string id.
- Parameters
id –
-
virtual uint8_t *getConfigDescriptor() final
-
class esptinyusb::BaseDevice : public esptinyusb::USBdevice
Base class for all USB class devices, which will inherit from it.
Subclassed by esptinyusb::HIDdevice, esptinyusb::USBWebSerial, esptinyusb::USBcdc, esptinyusb::USBdfu, esptinyusb::USBmsc
Public Functions
-
virtual bool begin(uint8_t _eps = 1) = 0
begin should add device descriptor and initialize interfaces
- Parameters
_eps –
- Returns
true
- Returns
false
-
virtual bool begin(uint8_t _eps = 1) = 0