6 const uint8_t constBufLen = 64;
7 uint8_t buf[constBufLen];
19 uint8_t
HID::SetReport( uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr )
21 return(
pUsb->
ctrlReq(
bAddress, ep,
bmREQ_HIDOUT,
HID_REQUEST_SET_REPORT, report_id, report_type, iface, nbytes, nbytes, dataptr, NULL ));
23 uint8_t
HID::GetReport( uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr )
25 return(
pUsb->
ctrlReq(
bAddress, ep,
bmREQ_HIDIN,
HID_REQUEST_GET_REPORT, report_id, report_type, iface, nbytes, nbytes, dataptr, NULL ));
27 uint8_t
HID::GetIdle( uint8_t iface, uint8_t reportID, uint8_t* dataptr )
29 return(
pUsb->
ctrlReq(
bAddress, 0,
bmREQ_HIDIN,
HID_REQUEST_GET_IDLE, reportID, 0, iface, 0x0001, 0x0001, dataptr, NULL ));
31 uint8_t
HID::SetIdle( uint8_t iface, uint8_t reportID, uint8_t duration )
33 return(
pUsb->
ctrlReq(
bAddress, 0,
bmREQ_HIDOUT,
HID_REQUEST_SET_IDLE, reportID, duration, iface, 0x0000, 0x0000, NULL, NULL ));
37 return(
pUsb->
ctrlReq(
bAddress, 0,
bmREQ_HIDOUT,
HID_REQUEST_SET_PROTOCOL, protocol, 0x00, iface, 0x0000, 0x0000, NULL, NULL ));
41 return(
pUsb->
ctrlReq(
bAddress, 0,
bmREQ_HIDIN,
HID_REQUEST_GET_PROTOCOL, 0x00, 0x00, iface, 0x0001, 0x0001, dataptr, NULL ));
46 Notify(PSTR(
"Endpoint descriptor:"));
47 Notify(PSTR(
"\r\nLength:\t\t"));
48 PrintHex<uint8_t>(ep_ptr->
bLength);
49 Notify(PSTR(
"\r\nType:\t\t"));
51 Notify(PSTR(
"\r\nAddress:\t"));
53 Notify(PSTR(
"\r\nAttributes:\t"));
55 Notify(PSTR(
"\r\nMaxPktSize:\t"));
57 Notify(PSTR(
"\r\nPoll Intrv:\t"));
63 Notify(PSTR(
"\r\n\r\nHID Descriptor:\r\n"));
64 Notify(PSTR(
"bDescLength:\t\t"));
65 PrintHex<uint8_t>(pDesc->
bLength);
67 Notify(PSTR(
"\r\nbDescriptorType:\t"));
70 Notify(PSTR(
"\r\nbcdHID:\t\t\t"));
71 PrintHex<uint16_t>(pDesc->
bcdHID);
73 Notify(PSTR(
"\r\nbCountryCode:\t\t"));
76 Notify(PSTR(
"\r\nbNumDescriptors:\t"));
79 Notify(PSTR(
"\r\nbDescrType:\t\t"));
82 Notify(PSTR(
"\r\nwDescriptorLength:\t"));