more work on descriptor building, almost there

also added the very early beginnings of an example to document how to
get speed
This commit is contained in:
2026-04-21 00:45:03 -07:00
parent c27db15fe9
commit ac6618a162
6 changed files with 855 additions and 131 deletions
+20
View File
@@ -0,0 +1,20 @@
use lpc55_pac as pac;
use usbd_uac2::{self, UsbSpeed, UsbSpeedProvider};
struct Lpc55UsbSpeedProvider {}
impl UsbSpeedProvider for Lpc55UsbSpeedProvider {
fn speed(&self) -> usbd_uac2::UsbSpeed {
let regs = unsafe { &*pac::USB1::ptr() };
match regs.devcmdstat.read().speed().bits() {
1 => UsbSpeed::Full,
2 => UsbSpeed::High,
3 => UsbSpeed::Super,
_ => panic!("Unknown USB speed"),
}
}
}
fn main() {
println!("Hello, world!");
}