Crates.io | embassy-usb |
lib.rs | embassy-usb |
version | 0.3.0 |
source | src |
created_at | 2021-04-21 18:39:38.840033 |
updated_at | 2024-08-05 07:24:34.615546 |
description | Async USB device stack for embedded devices in Rust. |
homepage | |
repository | https://github.com/embassy-rs/embassy |
max_upload_size | |
id | 387800 |
size | 180,760 |
Async USB device stack for embedded devices in Rust.
To add embassy-usb
support for new hardware (i.e. a new MCU chip), you have to write a driver that implements
the embassy-usb-driver
traits.
Driver crates should depend only on embassy-usb-driver
, not on the main embassy-usb
crate.
This allows existing drivers to continue working for newer embassy-usb
major versions, without needing an update, if the driver
trait has not had breaking changes.
embassy-usb
has some configuration settings that are set at compile time, affecting sizes
and counts of buffers.
They can be set in two ways:
<name>-<value>
. name
must be in lowercase and
use dashes instead of underscores. For example. max-interface-count-3
. Only a selection of values
is available, check Cargo.toml
for the list.EMBASSY_USB_<value>
. For example
EMBASSY_USB_MAX_INTERFACE_COUNT=3 cargo build
. You can also set them in the [env]
section of .cargo/config.toml
.
Any value can be set, unlike with Cargo features.Environment variables take precedence over Cargo features. If two Cargo features are enabled for the same setting with different values, compilation fails.
MAX_INTERFACE_COUNT
Max amount of interfaces that can be created in one device. Default: 4.
This crate can run on any executor.