| Summary |
#include <RTL.h>
#include <rl_usb.h>
void usbd_hid_set_report (
U8 rtype, // Report type
U8 rid, // Report ID
U8* buf, // Pointer to the buffer to report data
int len, // Length of report (in bytes)
U8 req // Request type
);
|
| Description | The function usbd_hid_set_report handles data that was received from the USB Host. The function is called when report was received. Arguments: - rtype: report type
| Value | Description |
|---|
| HID_REPORT_OUTPUT | Output report received. | | HID_REPORT_FEATURE | Feature report received. |
- rid: report ID (0 - if only one report exists in system)
- buf: pointer to the buffer to report data
- req:
| Value | Description |
|---|
| USBD_HID_REQ_EP_CTRL | Report came through control endpoint. | | USBD_HID_REQ_EP_INT | Report came through interrupt endpoint. |
The function usbd_hid_set_report is part of the USB Device Function Driver layer of the RL-USB Device Software Stack. Modify this function to the application needs. |
| Return Value | None. |
| See Also | usbd_hid_get_protocol, usbd_hid_get_report, usbd_hid_get_report_trigger, usbd_hid_init, usbd_hid_set_protocol |
| Example |
#include <RTL.h>
#include <rl_usb.h>
U8 feat;
U8 set;
void usbd_hid_set_report (U8 rtype, U8 rid, U8 *buf, int len, U8 req) {
switch (rtype) {
case HID_REPORT_INPUT:
break;
case HID_REPORT_OUTPUT:
set = *buf;
break;
case HID_REPORT_FEATURE:
feat = buf[0];
break;
}
}
|