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

Add Physical Descriptor Support #85

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

NZSmartie
Copy link

There are two parts to this PR, the first being the support for physical descriptors by providing structs and a couple of macros in LUFA/Drivers/USB/Class/Common/HIDClassCommon.h

The second part is a copied and modified joystick demo which:

  1. Adds two example physical descriptor sets
  2. Reports the designator minimum and maximum in the report descriptor
  3. Returns the descriptor in CALLBACK_USB_GetDescriptor

@abcminiuser
Copy link
Owner

Wow, fantastic work! This is wonderful and I'm sure others will appreciate it.

There's a few minor things for me to fix up, which I'll do some time this week before merging it in (you've done the bulk of the work, I'm happy to tidy things up). Notes for myself:

  • Fix spacing/tabs in the demo code
  • Use non-standard friendly name structs in the demo to match existing code
  • Fix code style to match LUFA style
  • Allocate new PID
  • Fix asf.xml to use a unique ID and update demo description

@NicoHood
Copy link
Contributor

May I ask why a physical descriptor is needed? I never used/saw that feature.

@NZSmartie
Copy link
Author

@NicoHood
May I ask why a physical descriptor is needed? I never used/saw that feature.

A lot of implementations of HID tend to use a fixed Report Descriptor that is well known to the end application. so all the reports a pre-mapped, or most likely hard coded.

There are multiple uses for Physical Descriptors. One case is with the Virtual Reality usage page (0x03), a Glove requires the inputs to have designators mapping to the physical descriptor so that the application can automatically map to.

An example I can think of is a generic game controller where the game can use the right hand thumb with 0 effort as the primary button, and a effort of 1 to be the secondary button. it seems like a weird concept. But from a game's perspective, it could help when a unknown controller is plugged in for the first time and needing to automatically map as many actions as possible that the user is familiar with. So they have minimal setup time and less effort adjusting to the new controller.

@abcminiuser
Copy link
Owner

abcminiuser commented Jan 25, 2017

Well I feel like a right muppet for completely forgetting about this; I'll look at it Saturday along with #91.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants