Content originally posted in LPCWare by tuong on Mon Mar 26 20:53:00 MST 2012
Dear Ticup,
For HID application, the PC host keep polling for device reports through interrupt pipe and perform SET/GET through control pipe. So for your purpose, you need to:
- Look into the HIDDeiviceClass.c, function void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo), check if there is a request fit your need, if not, add it in.
- Create a CALLBACK_HID_Device_xxxxxx function in your application layer, ex. Mouse.c or Keyboard.c, to implement your design task like turn on/off LEDs.
- Call this CALLBACK function in your request under HID_Device_ProcessControlRequest().
With best regards,
Tuong Nguyen