usbd_xxx.c 961 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "usbd_core.h"
  2. #include "usbd_xxx.h"
  3. static int xxx_class_interface_request_handler(uint8_t busid, struct usb_setup_packet *setup, uint8_t **data, uint32_t *len)
  4. {
  5. USB_LOG_WRN("XXX Class request: "
  6. "bRequest 0x%02x\r\n",
  7. setup->bRequest);
  8. switch (setup->bRequest) {
  9. default:
  10. USB_LOG_WRN("Unhandled XXX Class bRequest 0x%02x\r\n", setup->bRequest);
  11. return -1;
  12. }
  13. return 0;
  14. }
  15. static void xxx_notify_handler(uint8_t busid, uint8_t event, void *arg)
  16. {
  17. switch (event) {
  18. case USBD_EVENT_RESET:
  19. break;
  20. default:
  21. break;
  22. }
  23. }
  24. struct usbd_interface *usbd_xxx_init_intf(uint8_t busid, struct usbd_interface *intf)
  25. {
  26. intf->class_interface_handler = xxx_class_interface_request_handler;
  27. intf->class_endpoint_handler = NULL;
  28. intf->vendor_handler = NULL;
  29. intf->notify_handler = xxx_notify_handler;
  30. return intf;
  31. }