| Crates.io | rockusb |
| lib.rs | rockusb |
| version | 0.3.0 |
| created_at | 2023-02-20 08:56:12.486788+00 |
| updated_at | 2025-06-10 19:09:42.793446+00 |
| description | Rockchip usb protocol host implementation |
| homepage | https://github.com/collabora/rockchiprs |
| repository | https://github.com/collabora/rockchiprs |
| max_upload_size | |
| id | 789609 |
| size | 114,262 |
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:
# #[cfg(feature = "libusb")] {
# fn main() -> anyhow::Result<()> {
let devices = rockusb::libusb::Devices::new()?;
let mut device = devices.iter().next()
.ok_or_else(|| anyhow::anyhow!("No Device found"))??;
println!("Chip Info: {:0x?}", device.chip_info()?);
Ok(())
# }
# }
Printing chip info using nusb backend:
# #[cfg(feature = "nusb")] {
# #[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 device = rockusb::nusb::Device::from_usb_device_info(info)?;
println!("Chip Info: {:0x?}", device.chip_info().await?);
Ok(())
# }
# }