-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(example): add a USB HID keyboard example #50
feat(example): add a USB HID keyboard example #50
Conversation
@@ -206,6 +233,29 @@ async fn init_task(mut peripherals: arch::OptionalPeripherals) { | |||
|
|||
let spawner = Spawner::for_current_executor().await; | |||
|
|||
#[cfg(feature = "usb_hid")] | |||
{ | |||
let config = embassy_usb::class::hid::Config { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need something similar to 1092e7c to be able to override this USB HID configuration, in particular because it is currently specific to keyboards.
} | ||
|
||
#[cfg(feature = "usb_hid")] | ||
pub type UsbHidReader = hid::HidReader<'static, UsbDriver, 1>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both HidReader
and HidWriter
need their buffer size to be configured, to accommodate the maximum HID report size, which depends on the USB speed and the type of HID device; however it is unclear how this could be made configurable by users.
poll_ms: 60, | ||
max_packet_size: 64, | ||
}; | ||
// FIXME: use a proper USB HID configuration for the USB Builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would make sense to have a separate USB configuration for the HID and CDC-ECM classes.
This got merged with #87. |
No description provided.