-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Enhanced HID protocol support for Arduino Leonardo & Pro Micro #387
base: master
Are you sure you want to change the base?
Conversation
@facchinm This PR is ready for merge I believe :) Any issues please let know. |
Would you consider adding an example sketch that demonstrates these new features? Without documentation, code comments, or an example, it's likely that many folks will never discover or be able to use the new features you've added. (Also, is there anything that limits this to the Leonardo & Pro Micro? It ought it to work for any 32U4 device.) |
Hi Jesse, thanks for your interest. The usage of these features should be here ideally so I'm happy to extend this article with your kind advice how to do it (how to submit the changes properly). Currently there is only SendReport method, which limits the HID cases significantly. Basically, it only allows to "bombard" the host with HID reports regardless of the host state or intention to consume these messages. The proposed PR adds support of HID Feature, which is an essential part of HID protocol. With this PR, it will be possible to implement any HID compliant device on Arduino. I used it for my HIDPowerDevice project, which enables implementing HID-compliant UPS but this is only one of many possible scenarios. More details about this project are here. |
resolves #388
resolves #389
resolves #390
resolves #393
This pull request is to add new features to the USB API and HID API to extend its functionality.
The main idea of the implementation - a public variable is declared in the sketch and then its address is passed to the HID library via SetFeature function. The address is stored in the memory along with the feature ID. The value of the var can be updated in the sketch loop at any time and sent to host whenever the host invokes the GetFeature through the USB HID protocol. The host can also update the variable (R/W features also supported).
Changes are tested in the HID-Compliant UPS with Arduino project.