I'm interested in implementing high speed support and can make a PR but am not sure how best how to do it. The way I'm thinking is to make these two changes.
- Add method to
UsbBus trait to read the current speed of bus.
pub enum UsbSpeed{
LowSpeed,
FullSpeed,
HighSpeed,
SuperSpeed,
}
pub trait UsbBus: Sync + Sized {
// ...
fn get_speed(&mut self) -> UsbSpeed;
// ...
}
- Change method in
UsbClass trait to use the UsbSpeed when making the usb descriptors. UsbSpeed would then get read at runtime and passed for each enumeration.
pub trait UsbClass<B: UsbBus> {
//...
fn get_configuration_descriptors(&self, writer: &mut DescriptorWriter, speed: UsbSpeed) -> Result<()>;
//...
}
Problem with (2) is it would be a breaking change for existing classes, although a pretty easy fix.
What do you think? Does this look okay?
I'm interested in implementing high speed support and can make a PR but am not sure how best how to do it. The way I'm thinking is to make these two changes.
UsbBustrait to read the current speed of bus.UsbClasstrait to use the UsbSpeed when making the usb descriptors. UsbSpeed would then get read at runtime and passed for each enumeration.Problem with (2) is it would be a breaking change for existing classes, although a pretty easy fix.
What do you think? Does this look okay?