This commit is contained in:
Diego Ismirlian 2017-10-29 17:22:24 -03:00
commit bfc5805886
3 changed files with 29 additions and 4 deletions

View File

@ -52,7 +52,9 @@
#define HAL_USBH_USE_ADDITIONAL_CLASS_DRIVERS FALSE
#endif
#ifndef HAL_USBH_USE_IAD
#define HAL_USBH_USE_IAD HAL_USBH_USE_UVC
#endif
#if (HAL_USE_USBH == TRUE) || defined(__DOXYGEN__)
@ -299,6 +301,12 @@ extern "C" {
}
/* Synchronous API */
usbh_urbstatus_t usbhSynchronousTransfer(usbh_ep_t *ep,
void *data,
uint32_t len,
uint32_t *actual_len,
systime_t timeout);
usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep,
void *data,
uint32_t len,

View File

@ -1172,9 +1172,17 @@ static inline void _nptxfe_int(USBHDriver *host) {
}
static inline void _ptxfe_int(USBHDriver *host) {
//TODO: implement
(void)host;
uinfo("PTXFE");
uint32_t rem;
stm32_otg_t *const otg = host->otg;
rem = _write_packet(&host->ep_active_lists[USBH_EPTYPE_ISO],
otg->HPTXSTS & HPTXSTS_PTXFSAVL_MASK);
rem += _write_packet(&host->ep_active_lists[USBH_EPTYPE_INT],
otg->HPTXSTS & HPTXSTS_PTXFSAVL_MASK);
if (!rem)
otg->GINTMSK &= ~GINTMSK_PTXFEM;
}
static void _disable(USBHDriver *host) {

View File

@ -335,10 +335,19 @@ usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep,
uint32_t len,
uint32_t *actual_len,
systime_t timeout) {
osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep");
return usbhSynchronousTransfer(ep,data,len,actual_len,timeout);
}
usbh_urbstatus_t usbhSynchronousTransfer(usbh_ep_t *ep,
void *data,
uint32_t len,
uint32_t *actual_len,
systime_t timeout) {
osalDbgCheck(ep != NULL);
osalDbgCheck((data != NULL) || (len == 0));
osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep");
usbh_urb_t urb;
usbhURBObjectInit(&urb, ep, 0, 0, data, len);