| Summary |
#include <RTL.h>
#include <rl_usb.h>
int usbd_hid_get_report (
U8 rtype, // Report type
U8 rid, // Report ID
U8* buf, // Pointer to the buffer to report data
U8 req // Request type
);
|
| Description | The function usbd_hid_get_report prepares data that will be returned to the USB Host. The function is called on any of following events; after previous report was sent, if idle period has expired or if report was requested through control endpoint. Arguments: - rtype: report type
| Value | Description |
|---|
| HID_REPORT_INPUT | Input report requested. | | HID_REPORT_FEATURE | Feature report requested. |
- 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 | Request came from control endpoint. | | USBD_HID_REQ_PERIOD_UPDATE | Request came from idle period expiration. | | USBD_HID_REQ_EP_INT | Request came from previously sent report on interrupt endpoint. |
The function usbd_hid_get_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 | Loaded report size in bytes. |
| See Also | usbd_hid_get_protocol, usbd_hid_get_report_trigger, usbd_hid_init, usbd_hid_set_protocol, usbd_hid_set_report |
| Example |
#include <RTL.h>
#include <rl_usb.h>
U8 feat;
int usbd_hid_get_report (U8 rtype, U8 rid, U8 *buf, U8 req) {
switch (rtype) {
case HID_REPORT_INPUT:
switch (rid) {
case 0:
switch (req) {
case USBD_HID_REQ_EP_CTRL:
case USBD_HID_REQ_PERIOD_UPDATE:
buf[0] = 1;
return (1);
case USBD_HID_REQ_EP_INT:
break;
}
break;
}
break;
case HID_REPORT_FEATURE:
buf[0] = feat;
return (1);
}
return (0);
}
|