| Crates.io | usb-gadget |
| lib.rs | usb-gadget |
| version | 0.7.5 |
| created_at | 2023-09-29 20:34:56.562895+00 |
| updated_at | 2024-12-06 10:08:25.422291+00 |
| description | Expose standard or fully custom USB peripherals (gadgets) through a USB device controller (UDC) on Linux. |
| homepage | |
| repository | https://github.com/surban/usb-gadget |
| max_upload_size | |
| id | 987851 |
| size | 291,308 |
This library allows implementation of USB peripherals, so called USB gadgets, on Linux devices that have a USB device controller (UDC). Both, pre-defined USB functions and fully custom implementations of the USB interface are supported.
The following pre-defined USB functions, implemented by kernel drivers, are available:
In addition fully custom USB functions can be implemented in user-mode Rust code.
Support for OS-specific descriptors and WebUSB is also provided.
This crate provides the following optional features:
tokio: enables async support for custom USB functions on top of the Tokio runtime.The minimum support Rust version (MSRV) is 1.73.
A USB device controller (UDC) supported by Linux is required. Normally, standard PCs do not include an UDC. A Raspberry Pi 4 contains an UDC, which is connected to its USB-C port.
The following Linux kernel configuration options should be enabled for full functionality:
CONFIG_USB_GADGETCONFIG_USB_CONFIGFSCONFIG_USB_CONFIGFS_SERIALCONFIG_USB_CONFIGFS_ACMCONFIG_USB_CONFIGFS_NCMCONFIG_USB_CONFIGFS_ECMCONFIG_USB_CONFIGFS_ECM_SUBSETCONFIG_USB_CONFIGFS_RNDISCONFIG_USB_CONFIGFS_EEMCONFIG_USB_CONFIGFS_MASS_STORAGECONFIG_USB_CONFIGFS_F_FSCONFIG_USB_CONFIGFS_F_HIDCONFIG_USB_CONFIGFS_F_PRINTERCONFIG_USB_CONFIGFS_F_MIDICONFIG_USB_CONFIGFS_F_UAC2CONFIG_USB_CONFIGFS_F_UVCroot permissions are required to configure USB gadgets on Linux and
the configfs filesystem needs to be mounted.
usb-gadget is licensed under the Apache 2.0 license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in usb-gadget by you, shall be licensed as Apache 2.0, without any additional terms or conditions.