5 releases

0.2.0 Oct 19, 2024
0.1.3 Nov 19, 2023
0.1.2 Sep 21, 2023
0.1.1 Feb 21, 2023
0.1.0 Feb 20, 2023

#258 in Hardware support

Download history 21/week @ 2024-08-26 19/week @ 2024-09-02 205/week @ 2024-09-09 199/week @ 2024-09-16 123/week @ 2024-09-23 256/week @ 2024-09-30 493/week @ 2024-10-07 154/week @ 2024-10-14 48/week @ 2024-10-21 186/week @ 2024-10-28 78/week @ 2024-11-04 1/week @ 2024-11-11 5/week @ 2024-11-18 168/week @ 2024-11-25 194/week @ 2024-12-02 389/week @ 2024-12-09

756 downloads per month
Used in boardswarm

MIT/Apache

66KB
1.5K SLoC

Rockchip usb protocol host implementation

Rockchip bootroms and early loaders implement an USB protocol to help loader early firmware, flashing persistant storage etc. This crate contains a sans-io implementation of that protocol as well as an optional implementations of IO using libusb or nusb.

Printing chip info using libusb backend:

# fn main() -> anyhow::Result<()> {
let devices = rockusb::libusb::Devices::new()?;
let mut transport = devices.iter().next()
    .ok_or_else(|| anyhow::anyhow!("No Device found"))??;
println!("Chip Info: {:0x?}", transport.chip_info()?);
Ok(())
# }

Printing chip info using nusb backend:

# #[tokio::main]
# async fn main() -> anyhow::Result<()> {
let mut devices = rockusb::nusb::devices()?;
let info = devices.next()
    .ok_or_else(|| anyhow::anyhow!("No Device found"))?;
let mut transport = rockusb::nusb::Transport::from_usb_device_info(info)?;
println!("Chip Info: {:0x?}", transport.chip_info().await?);
Ok(())
# }

Dependencies

~0.5–13MB
~115K SLoC