Skip to content

Instantly share code, notes, and snippets.

@kuro68k
Last active March 24, 2017 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuro68k/cf107b63d8a34b1cd4c65e5a9eae6d78 to your computer and use it in GitHub Desktop.
Save kuro68k/cf107b63d8a34b1cd4c65e5a9eae6d78 to your computer and use it in GitHub Desktop.
Atmel ASF HID stuff
HID descriptor locations:
src\ASF\common\services\usb\class\hid\device\generic\udi_hid_generic.c - contains 'udi_hid_generic_report_desc'
src\ASF\common\services\usb\class\hid\device\generic\udi_hid_generic.h - contains 'udi_hid_generic_report_desc_t'
To handle feature requests, add this to conf_usb.h:
#define UDI_HID_GENERIC_GET_FEATURE(payload, size) HID_get_feature_report_out(payload, size)
extern bool HID_get_feature_report_out(uint8_t **payload, uint16_t *size);
And this to udi_hid.c/udi_hid_setup:
case USB_REQ_HID_GET_REPORT:
// hack: not implemented in original code
return UDI_HID_GENERIC_GET_FEATURE(&udd_g_ctrlreq.payload, &udd_g_ctrlreq.payload_size);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment