1
0
Fork 0
forked from nuttx/nuttx-update

usbdev: add usb APIs for polling mode

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
This commit is contained in:
yangsong8 2024-08-09 19:03:22 +08:00 committed by Xiang Xiao
parent 6161b1ea84
commit 7d570182be

View file

@ -72,6 +72,13 @@
#define EP_STALL(ep) (ep)->ops->stall(ep,false)
#define EP_RESUME(ep) (ep)->ops->stall(ep,true)
/* Check the endpoint interrupt status, call interrupt handler
* if the transfer is done. This is used for polling mode.
*/
#define EP_POLL(ep) \
do { if ((ep)->ops->poll) (ep)->ops->poll(ep); } while (0)
/* USB Device Driver Helpers ************************************************/
/* Allocate an endpoint:
@ -297,6 +304,12 @@ struct usbdev_epops_s
/* Stall or resume an endpoint */
CODE int (*stall)(FAR struct usbdev_ep_s *ep, bool resume);
/* Check the endpoint interrupt status, call interrupt handler
* if the transfer is done. This is used for polling mode.
*/
CODE void (*poll)(FAR struct usbdev_ep_s *ep);
};
/* Representation of one USB endpoint */