| Crates.io | musb |
| lib.rs | musb |
| version | 0.3.0 |
| created_at | 2024-12-06 11:05:28.231611+00 |
| updated_at | 2025-09-14 06:29:05.968888+00 |
| description | musb(Mentor USB) regs and `embassy-usb-driver`, `usb-device` impl |
| homepage | https://github.com/decaday/musb |
| repository | https://github.com/decaday/musb |
| max_upload_size | |
| id | 1474129 |
| size | 421,428 |
musb(Mentor USB) Registers and embassy-usb-driver , usb-device Implementation.
The MUSBMHDRC (musb) is a USB 2.0 Multi-Point, Dual-Role Controller designed by Mentor Graphics Corp. It is widely used by various manufacturers in microcontrollers and SoCs, including companies like TI, MediaTek, Puya, Allwinner, and others.
These built-in profiles are used via Cargo features (see below), with only one selectable:
builtin-py32f07x (py32m070, py32f071, py32f072)
builtin-py32f403
builtin-sf32lb52x
builtin-std-8bep-2048 (8 bidirectional endpoints, 2048K FIFO size in total, without instance)
Add musb to your Cargo.toml:
[dependencies]
musb = { version = "0.3.0", features = ["builtin-std-8bep-2048"] }
You can use the std profile by enabling the builtin-std-xxx feature. This profile doesn't include a base_address, so it won't generate a UsbInstance (explained in Porting Guide).
If your chip is not included, you'll need to create a new profile. Refer to the Porting Guide for more details.
embassy-usb-driver-impl: Enables embassy-usb-driver implementation.
usb-device-impl: Enables usb-device implementation.
Note: Only one of these two implementations can be enabled at a time.
prebuild(on by default): Uses pre-generated PAC (Peripheral Access Crate).
builtin-xxxx : Uses builtin profile.
defmt, log: Enables debug logging.
hal example: py32-hal/src/usb.rs , sifli-rs/sifli-hal/src/usb.rs
embassy-usb: py32-hal/examples/py32f072 , sifli-rs/examples/sf32lb52x
usb-device: py32-hal/examples/usbd-f072
Refer to the Porting Guide for more details.
You can also refer to this blog (in Chinese): PY32的musb(Mentor USB)的Rust支持 - Decaday
If you have any questions or uncertainties, feel free to create an Issue or start a Discussion.
This project is under Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).
This repo references the MUSB port implementation in CherryUSB for certain aspects.