rockusb

Crates.iorockusb
lib.rsrockusb
version0.2.0
sourcesrc
created_at2023-02-20 08:56:12.486788
updated_at2024-10-19 19:26:44.424211
descriptionRockchip usb protocol host implementation
homepagehttps://github.com/collabora/rockchiprs
repositoryhttps://github.com/collabora/rockchiprs
max_upload_size
id789609
size119,252
Sjoerd Simons (sjoerdsimons)

documentation

README

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(())
# }
Commit count: 46

cargo fmt