-
Notifications
You must be signed in to change notification settings - Fork 7.8k
usb: device_next: hid: allow to set polling period at runtime #94518
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
base: main
Are you sure you want to change the base?
usb: device_next: hid: allow to set polling period at runtime #94518
Conversation
Fail on initialization if no HID device is registered. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Allow to set input or output report polling period at runtime. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add an example of how to set the polling period at runtime. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
|
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.
I tried to spot any bug and compared with the USB HID standard (which I am new to) and did not spot any issue.
* @param[in] dev Pointer to HID device | ||
* @param[in] period Polling period in microseconds | ||
* | ||
* @return 0 on success, negative errno code on fail. |
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.
Simillar to above.
* @return 0 on success, negative errno code on fail. | |
* @return 0 on success, negative errno code on failure. |
* @param[in] dev Pointer to HID device | ||
* @param[in] period Polling period in microseconds | ||
* | ||
* @return 0 on success, negative errno code on fail. |
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 is probably just me who read the sentence wrong.
* @return 0 on success, negative errno code on fail. | |
* @return 0 on success, negative errno code on failure. |
* different polling periods at runtime. Depends on Kconfig options | ||
* USBD_HID_SET_POLLING_PERIOD. |
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.
* different polling periods at runtime. Depends on Kconfig options | |
* USBD_HID_SET_POLLING_PERIOD. | |
* different polling periods at runtime. | |
* | |
* @kconfig_dep{CONFIG_USBD_HID_SET_POLLING_PERIOD} |
* different polling periods at runtime. Depends on Kconfig options | ||
* USBD_HID_SET_POLLING_PERIOD. |
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.
* different polling periods at runtime. Depends on Kconfig options | |
* USBD_HID_SET_POLLING_PERIOD. | |
* different polling periods at runtime. | |
* | |
* @kconfig_dep{CONFIG_USBD_HID_SET_POLLING_PERIOD} |
@@ -212,6 +212,36 @@ int hid_device_register(const struct device *dev, | |||
int hid_device_submit_report(const struct device *dev, | |||
const uint16_t size, const uint8_t *const report); | |||
|
|||
/** | |||
* @brief Set intput report polling period |
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.
* @brief Set intput report polling period | |
* @brief Set input report polling period |
Allow to set input or output report polling period at runtime.