2022-05-14 21:37:43 +08:00
|
|
|
#include "usbd_core.h"
|
|
|
|
|
#include "usbd_xxx.h"
|
|
|
|
|
|
2024-02-06 19:51:50 +08:00
|
|
|
static int xxx_class_interface_request_handler(uint8_t busid, struct usb_setup_packet *setup, uint8_t **data, uint32_t *len)
|
2022-05-14 21:37:43 +08:00
|
|
|
{
|
|
|
|
|
USB_LOG_WRN("XXX Class request: "
|
|
|
|
|
"bRequest 0x%02x\r\n",
|
|
|
|
|
setup->bRequest);
|
|
|
|
|
|
|
|
|
|
switch (setup->bRequest) {
|
|
|
|
|
default:
|
|
|
|
|
USB_LOG_WRN("Unhandled XXX Class bRequest 0x%02x\r\n", setup->bRequest);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-06 19:51:50 +08:00
|
|
|
static void xxx_notify_handler(uint8_t busid, uint8_t event, void *arg)
|
2022-05-14 21:37:43 +08:00
|
|
|
{
|
|
|
|
|
switch (event) {
|
|
|
|
|
case USBD_EVENT_RESET:
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-06 19:51:50 +08:00
|
|
|
struct usbd_interface *usbd_xxx_init_intf(uint8_t busid, struct usbd_interface *intf)
|
2022-05-14 21:37:43 +08:00
|
|
|
{
|
2022-09-08 21:08:39 +08:00
|
|
|
intf->class_interface_handler = xxx_class_interface_request_handler;
|
|
|
|
|
intf->class_endpoint_handler = NULL;
|
2022-05-14 21:37:43 +08:00
|
|
|
intf->vendor_handler = NULL;
|
|
|
|
|
intf->notify_handler = xxx_notify_handler;
|
|
|
|
|
|
2023-12-05 21:34:51 +08:00
|
|
|
return intf;
|
2022-05-14 21:37:43 +08:00
|
|
|
}
|