#no-std #embedded #usb

no-std usb-device

Experimental device-side USB stack for embedded devices

8 releases

0.2.7 Oct 3, 2020
0.2.6 Sep 22, 2020
0.2.5 Feb 10, 2020
0.2.3 Aug 27, 2019
0.1.0 Dec 24, 2018

#11 in Embedded development

Download history 203/week @ 2020-07-09 705/week @ 2020-07-16 817/week @ 2020-07-23 491/week @ 2020-07-30 828/week @ 2020-08-06 521/week @ 2020-08-13 488/week @ 2020-08-20 759/week @ 2020-08-27 1065/week @ 2020-09-03 844/week @ 2020-09-10 862/week @ 2020-09-17 1636/week @ 2020-09-24 915/week @ 2020-10-01 1185/week @ 2020-10-08 1164/week @ 2020-10-15 3494/week @ 2020-10-22

3,190 downloads per month
Used in 43 crates (40 directly)

MIT license

97KB
1.5K SLoC

usb-device

Experimental device-side USB stack for embedded devices in Rust.

This crate is still under development and should not be considered production ready or even USB compliant.

The UsbDevice object represents a composite USB device and is the most important object for application implementors. The UsbDevice combines a number of UsbClasses (either custom ones, or pre-existing ones provided by other crates) and a UsbBus device drives to implement the USB device.

The UsbClass trait can be used to implemented USB classes such as a HID device or a serial port. An implementation may also use a custom class if the required functionality isn't covered by a standard class.

The UsbBus trait is intended to be implemented by device-specific crates to provide a driver for each device's USB peripheral.

Hardware driver crates

  • stm32-usbd - device-driver implementation for multiple STM32 microcontroller families. Examples can be found in stm32-usbd-examples.

  • atsamd - device-driver implementation for samd21 & samd51 microcontrollers. An example for the itsybitsy_m4 board from Adafruit can be found here.

Class crates

TODO

Features planned but not implemented yet:

  • Interface alternate settings
  • Multilingual string descriptors
  • Isochronous endpoints

Features not planning to support at the moment:

  • More than one configuration descriptor (uncommon in practice)

No runtime deps