Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Functions

static bool udi_hid_reqstdifaceget_descriptor (uint8_t *report_desc)
 Send the specific descriptors requested by SETUP request. More...
 
bool udi_hid_setup (uint8_t *rate, uint8_t *protocol, uint8_t *report_desc, bool(*setup_report)(void))
 Decode HID setup request. More...
 

static bool udi_hid_reqstdifaceget_descriptor ( uint8_t *  report_desc)
static

Send the specific descriptors requested by SETUP request.

Return values
trueif the descriptor is supported

References le16_to_cpu, min, udd_ctrl_request_t::payload, udd_ctrl_request_t::payload_size, udd_ctrl_request_t::req, UDC_DESC_STORAGE, udc_get_interface_desc(), udd_g_ctrlreq, USB_DT_HID, usb_setup_req_t::wLength, and usb_setup_req_t::wValue.

Referenced by udi_hid_setup().

bool udi_hid_setup ( uint8_t *  rate,
uint8_t *  protocol,
uint8_t *  report_desc,
bool(*)(void)  setup_report 
)

Decode HID setup request.

Parameters
ratePointer on rate of current HID interface
protocolPointer on protocol of current HID interface
report_descPointer on report descriptor of current HID interface
set_reportPointer on set_report callback of current HID interface
Returns
1 if function was successfully done, otherwise 0.

References usb_setup_req_t::bRequest, udd_ctrl_request_t::payload, udd_ctrl_request_t::payload_size, udd_ctrl_request_t::req, udd_g_ctrlreq, Udd_setup_is_in, Udd_setup_is_out, Udd_setup_type, udi_hid_reqstdifaceget_descriptor(), USB_REQ_GET_DESCRIPTOR, USB_REQ_HID_GET_IDLE, USB_REQ_HID_GET_PROTOCOL, USB_REQ_HID_GET_REPORT, USB_REQ_HID_SET_IDLE, USB_REQ_HID_SET_PROTOCOL, USB_REQ_HID_SET_REPORT, USB_REQ_TYPE_CLASS, USB_REQ_TYPE_STANDARD, usb_setup_req_t::wLength, and usb_setup_req_t::wValue.

Referenced by udi_hid_mouse_setup().