usbd_pvt.h 848 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include <Adafruit_TinyUSB.h>
  3. struct usbd_class_driver_t {
  4. void (*init)();
  5. bool (*deinit)();
  6. void (*reset)(uint8_t rhport);
  7. uint16_t (*open)(uint8_t rhport, const tusb_desc_interface_t *interface,
  8. uint16_t max_len);
  9. bool (*control_xfer_cb)(uint8_t rhport, uint8_t stage,
  10. const tusb_control_request_t *request);
  11. bool (*xfer_cb)(uint8_t rhport, uint8_t ep, xfer_result_t result,
  12. uint32_t length);
  13. void (*sof)(uint8_t rhport, uint32_t frame_count);
  14. };
  15. bool usbd_edpt_open(uint8_t rhport, const tusb_desc_endpoint_t *descriptor);
  16. void usbd_edpt_close(uint8_t rhport, uint8_t ep);
  17. bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep, uint8_t *buffer,
  18. uint16_t length);
  19. bool usbd_edpt_busy(uint8_t rhport, uint8_t ep);
  20. bool usbd_edpt_claim(uint8_t rhport, uint8_t ep);
  21. bool usbd_edpt_release(uint8_t rhport, uint8_t ep);