diff --git a/firmware/export/usb_drv.h b/firmware/export/usb_drv.h index ea048a3cd1..76cba9d82b 100644 --- a/firmware/export/usb_drv.h +++ b/firmware/export/usb_drv.h @@ -109,6 +109,27 @@ int usb_drv_deinit_endpoint(int endpoint); int usb_drv_get_frame_number(void); #endif +#if USB_BATCH_SLOTS > 0 + +/* batched request api is for workloads that perform very high-frequency, + * performance-sensitive isochronous transactions continuously. + * this api allows multiple transaction requests to be buffered in udc driver. + * so that it can maximize the controller's performance. */ + +/* called when usb system requires more buffer */ +typedef void(*usb_drv_batch_get_more)(const void** ptr, size_t* len); + +/* prepare request queue */ +int usb_drv_batch_init(int ep, usb_drv_batch_get_more get_more); +/* destroy request queue */ +int usb_drv_batch_deinit(void); +/* start processing */ +int usb_drv_batch_start(void); +/* stop processing */ +int usb_drv_batch_stop(void); + +#endif + /* USB_STRING_INITIALIZER(u"Example String") */ #define USB_STRING_INITIALIZER(S) { \ sizeof(struct usb_string_descriptor) + sizeof(S) - sizeof(*S), \