Skip to content
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

Conversation

ROMemories
Copy link
Collaborator

No description provided.

@@ -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 {
Copy link
Collaborator Author

@ROMemories ROMemories Jan 12, 2024

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>;
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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.

@kaspar030
Copy link
Collaborator

This got merged with #87.

@kaspar030 kaspar030 closed this Feb 22, 2024
@ROMemories ROMemories added the USB label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants