mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-11 16:37:45 -04:00
usb: introduce batched request api
in order to implement iap digital audio interface, we have to send a pcm packet every usb frame i.e. 1000 packets per second. this rate can't be achieved with current standard request-response design, even with fast_completion_handler. this is why this new api is needed. Change-Id: Id3d7dd037660871e2bdb69656f63ff13280c3804
This commit is contained in:
parent
3f4d5a527b
commit
d2b76a99f3
1 changed files with 21 additions and 0 deletions
|
|
@ -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), \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue