usb_gadget library

Classes

AcmFunction
Serial (CDC ACM) function (virtual serial port).
AlternateSetting
Type-safe alternate setting number (0-255).
BindEvent
Function has been bound to a UDC.
BurstSize
Type-safe SuperSpeed burst size (0-15).
BytesPerInterval
Type-safe bytes per interval (0-65535).
DescriptorGenerator
Descriptor generator for creating speed-specific descriptors.
DescriptorSet
A set of USB descriptors for a specific speed.
DeviceClass
Type-safe device class code.
DeviceProtocol
Type-safe device protocol code.
DeviceSubClass
Type-safe device subclass code.
DisableEvent
Function has been disabled.
EcmFunction
Ethernet (CDC ECM) function.
EcmSubsetFunction
Ethernet (CDC ECM Subset) function.
EemFunction
Ethernet (CDC EEM) function.
EnableEvent
Function has been enabled.
EndpointAddress
Endpoint address combining number and direction.
EndpointAttributes
Endpoint attributes (bmAttributes field).
EndpointConfig
Endpoint configuration consolidating transfer type, packet size, and polling interval.
EndpointControlFile
Manages the USB control endpoint (EP0) for FunctionFs.
EndpointCount
Type-safe endpoint count (0-30).
EndpointFile
Base class for FunctionFs endpoint file descriptors.
EndpointInFile
Manages a USB IN endpoint (device-to-host).
EndpointNumber
Endpoint number (0-15).
EndpointOutFile
Manages a USB OUT endpoint (host-to-device).
EndpointTemplate
Endpoint template for speed-independent endpoint definitions.
EthernetFunction
Base class for ethernet functions.
ExtendedBytesPerInterval
Type-safe extended bytes per interval for SuperSpeedPlus (0-4294967295).
FunctionFs
User Space FunctionFs Gadget Function.
FunctionFsDescriptors
FunctionFs descriptor data ready to be written to ep0.
FunctionFsDescriptorsBuilder
Builder for FunctionFs descriptor data.
FunctionFsEvent
Base class for FunctionFs events.
FunctionFsFlags
Flags for FunctionFs v2 descriptor format.
FunctionFsMount
Manages FunctionFs filesystem mounting and unmounting.
FunctionFsMountConfig
Configuration for FunctionFs mount behavior.
FunctionFsStrings
FunctionFs string data ready to be written to ep0.
FunctionFsStringsBuilder
Builder for FunctionFs string data.
Gadget
Creates and manages a USB gadget with the specified configuration.
GadgetConfiguration
A gadget configuration containing functions and attributes.
GadgetFunction
Core abstraction for all USB gadget functions.
GadgetMaxPower
Handles USB bMaxPower values for gadget configurations.
GadgetStrings
String descriptors for a gadget.
GenericSerialFunction
Generic serial function (non-CDC).
HIDFunction
HID function (keyboard, mouse, gamepad, etc.).
HIDFunctionFs
Enhanced HIDFunctionFs with simplified endpoint configuration.
HIDFunctionFsConfig
Configuration for HID endpoint topology and parameters.
InterfaceNumber
Type-safe interface number (0-255).
KernelFunction
Base class for kernel-implemented USB gadget functions.
LanguageStrings
String descriptors for a specific language.
LoopbackFunction
Loopback function (for USB testing).
LunConfig
Configuration for a mass storage LUN (Logical Unit Number).
MassStorageFunction
Mass storage function (USB flash drive emulation).
MaxPacketSize
Type-safe maximum packet size with speed-specific validation.
MidiFunction
MIDI function (Musical Instrument Digital Interface).
NcmFunction
Ethernet (CDC NCM) function.
PollingInterval
Type-safe polling interval (bInterval field).
PrinterFunction
Printer function (USB printer class).
RawUSBDescriptor
Raw USB descriptor wrapper.
RegisteredGadget
Lightweight representation of a registered USB gadget.
ResumeEvent
USB resume signaled.
RndisFunction
RNDIS function (Windows ethernet).
SetupEvent
Setup packet received.
SourceSinkFunction
Source/Sink function (for USB testing).
SSEndpointAttributes
Type-safe SuperSpeed endpoint companion attributes.
StringIndex
Type-safe string descriptor index (0-255).
SuspendEvent
USB suspend signaled.
Uac1Function
Audio (UAC1) function.
Uac2Function
Audio (UAC2) function.
Udc
USB Device Controller (UDC).
UnbindEvent
Function has been unbound from the UDC.
USBDescriptor
Base class for all USB descriptors.
USBEndpointDescriptor
USB Endpoint Descriptor (extended 9-byte version with audio fields).
USBEndpointDescriptorNoAudio
USB Endpoint Descriptor (standard 7-byte version).
USBHIDDescriptor
USB HID Descriptor.
USBInterfaceAssocDescriptor
USB Interface Association Descriptor.
USBInterfaceDescriptor
USB Interface Descriptor.
USBSSEPCompDescriptor
USB SuperSpeed Endpoint Companion Descriptor.
USBSSPIsocEndpointDescriptor
USB SuperSpeedPlus Isochronous Endpoint Companion Descriptor.
UvcFunction
UVC (USB Video Class) function for webcam emulation.

Enums

FunctionFsEventType
Event type constants.
FunctionFsMagic
Magic numbers for FunctionFs descriptor headers.
FunctionFsState
FunctionFs lifecycle states
GadgetAttributes
USB configuration attributes (bmAttributes field).
GadgetFunctionType
Type of gadget function.
HIDDescriptorType
HID descriptor type codes (bDescriptorType).
HIDProtocol
HID protocol codes (bInterfaceProtocol).
HIDReportType
HID report types.
HIDRequest
HID class-specific request codes (bRequest).
HIDSubclass
HID subclass codes (bInterfaceSubClass).
IsoSyncType
Isochronous synchronization type (bits 2-3 of bmAttributes).
IsoUsageType
Isochronous usage type (bits 4-5 of bmAttributes).
KernelFunctionType
Types of kernel-based USB gadget functions
Speed
USB speed levels.
TransferType
USB endpoint transfer types.
USBClass
USB device class codes.
USBDescriptorType
USB descriptor types.
USBDeviceState
USB Device Controller (UDC) states.
USBDirection
USB transfer direction.
USBFeature
Standard USB feature selectors.
USBLanguageId
USB Language IDs for string descriptors.
USBRecipient
USB recipients (bits 0-4 of bmRequestType).
USBRequest
Standard USB requests.
USBRequestType
USB request types (bits 5-6 of bmRequestType).

Functions

getDefaultUdc() Udc?
The default USB device controller (UDC) in the system by alphabetical sorting.
queryUdcs() List<Udc>
Gets the available USB device controllers (UDCs) in the system.

Typedefs

USBSpeed = Speed