40 uint8_t bDescriptorType;
41 uint8_t bInterfaceNumber;
42 uint8_t bAlternateSetting;
43 uint8_t bNumEndpoints;
44 uint8_t bInterfaceClass;
45 uint8_t bInterfaceSubClass;
46 uint8_t bInterfaceProtocol;
52 uint8_t bDescriptorType;
53 uint8_t bEndpointAddress;
55 uint16_t wMaxPacketSize;
60 uint8_t bmRequestType;
87 void (*reset)(uint8_t rhport);
90 bool (*control_xfer_cb)(uint8_t rhport, uint8_t stage,
93 uint32_t xferred_bytes);
95 uint32_t xferred_bytes);
96 void (*sof)(uint8_t rhport, uint32_t frame_count);
122 void (*
pump)(
void *ref) =
nullptr;
149 b.openEndpoint = ep->bEndpointAddress;
150 b.openMaxPacketSize = ep->wMaxPacketSize;
151 b.claimed = b.busy =
false;
157 if (ep != b.openEndpoint || b.busy || b.claimed)
return false;
164 if (ep != b.openEndpoint)
return false;
173 if (ep != b.openEndpoint || b.busy)
return false;
174 if (b.failNextXfer) {
175 b.failNextXfer =
false;
185 void *buf, uint16_t len) {
188 b.ctrlBuf = (uint8_t *)buf;
tusb_control_request_t
Definition TinyUSBSim.h:65
usbd_class_driver_t const * usbd_app_driver_get_cb(uint8_t *driver_count)
TinyUSB asks for application class drivers once, in tud_init()
Definition UVCTinyUSB.h:197
@ CONTROL_STAGE_ACK
Definition TinyUSBSim.h:79
@ CONTROL_STAGE_IDLE
Definition TinyUSBSim.h:76
@ CONTROL_STAGE_DATA
Definition TinyUSBSim.h:78
@ CONTROL_STAGE_SETUP
Definition TinyUSBSim.h:77
tusb_desc_interface_t
Definition TinyUSBSim.h:48
bool tud_control_xfer(uint8_t, tusb_control_request_t const *, void *buf, uint16_t len)
Definition TinyUSBSim.h:184
bool usbd_edpt_open(uint8_t, tusb_desc_endpoint_t const *ep)
Definition TinyUSBSim.h:147
bool usbd_edpt_release(uint8_t, uint8_t ep)
Definition TinyUSBSim.h:162
bool usbd_edpt_xfer(uint8_t, uint8_t ep, uint8_t *buf, uint16_t len, bool is_isr)
Definition TinyUSBSim.h:169
xfer_result_t
Definition TinyUSBSim.h:67
@ XFER_RESULT_TIMEOUT
Definition TinyUSBSim.h:71
@ XFER_RESULT_FAILED
Definition TinyUSBSim.h:69
@ XFER_RESULT_SUCCESS
Definition TinyUSBSim.h:68
@ XFER_RESULT_INVALID
Definition TinyUSBSim.h:72
@ XFER_RESULT_STALLED
Definition TinyUSBSim.h:70
bool tud_control_status(uint8_t, tusb_control_request_t const *)
Definition TinyUSBSim.h:193
struct __attribute__((packed))
Definition TinyUSBSim.h:38
bool usbd_edpt_claim(uint8_t, uint8_t ep)
Definition TinyUSBSim.h:155
tusb_desc_endpoint_t
Definition TinyUSBSim.h:57
TinyUVC: USB Video Class (UVC) device for Arduino and the desktop.
UVCSimBus & simBus()
Definition TinyUSBSim.h:138
What the device side did, as seen by the simulated USB core.
Definition TinyUSBSim.h:106
void(* pump)(void *ref)
Definition TinyUSBSim.h:122
bool busy
Definition TinyUSBSim.h:111
void resetEndpoint()
Definition TinyUSBSim.h:130
bool claimed
Definition TinyUSBSim.h:110
bool failNextXfer
test hook: next usbd_edpt_xfer() fails
Definition TinyUSBSim.h:114
uint8_t openEndpoint
Definition TinyUSBSim.h:108
uint16_t xferLen
Definition TinyUSBSim.h:113
void resetControl()
Definition TinyUSBSim.h:125
uint8_t * ctrlBuf
Definition TinyUSBSim.h:118
uint16_t ctrlLen
Definition TinyUSBSim.h:119
bool ctrlXfer
Definition TinyUSBSim.h:116
uint8_t * xferBuf
Definition TinyUSBSim.h:112
uint16_t openMaxPacketSize
Definition TinyUSBSim.h:109
bool ctrlStatus
Definition TinyUSBSim.h:117
void * pumpRef
Definition TinyUSBSim.h:123
Desktop stand-in for TinyUSB's class driver table entry.
Definition TinyUSBSim.h:83
char const * name
Definition TinyUSBSim.h:84