forked from nuttx/nuttx-update
usbdev: add usb APIs for polling mode
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
This commit is contained in:
parent
6161b1ea84
commit
7d570182be
1 changed files with 13 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue