33 #if defined (__CC_ARM) 35 #elif defined (__GNUC__) 36 #pragma GCC optimize ("O0") 37 #elif defined (__TASKING__) 196 haint.
d32 = USB_OTG_ReadHostAllChannels_intr(pdev);
200 if (haint.
b.
chint & (1 << i))
258 #if defined ( __ICCARM__ ) 259 #pragma optimize = none 271 uint16_t len_words , len;
275 len_words = (pdev->host.hc[hnptxsts.
b.
nptxqtop.chnum].xfer_len + 3) / 4;
278 (pdev->host.hc[hnptxsts.
b.
nptxqtop.chnum].xfer_len != 0))
283 if (len > pdev->host.hc[hnptxsts.
b.
nptxqtop.chnum].xfer_len)
286 len = pdev->host.hc[hnptxsts.
b.
nptxqtop.chnum].xfer_len;
293 len_words = (pdev->host.hc[hnptxsts.
b.
nptxqtop.chnum].xfer_len + 3) / 4;
297 pdev->host.hc[hnptxsts.
b.
nptxqtop.chnum].xfer_buff += len;
298 pdev->host.hc[hnptxsts.
b.
nptxqtop.chnum].xfer_len -= len;
299 pdev->host.hc[hnptxsts.
b.
nptxqtop.chnum].xfer_count += len;
306 #if defined ( __ICCARM__ ) 307 #pragma optimize = none 319 uint16_t len_words , len;
323 len_words = (pdev->host.hc[hptxsts.
b.
ptxqtop.chnum].xfer_len + 3) / 4;
326 (pdev->host.hc[hptxsts.
b.
ptxqtop.chnum].xfer_len != 0))
331 if (len > pdev->host.hc[hptxsts.
b.
ptxqtop.chnum].xfer_len)
333 len = pdev->host.hc[hptxsts.
b.
ptxqtop.chnum].xfer_len;
340 len_words = (pdev->host.hc[hptxsts.
b.
ptxqtop.chnum].xfer_len + 3) / 4;
344 pdev->host.hc[hptxsts.
b.
ptxqtop.chnum].xfer_buff += len;
345 pdev->host.hc[hptxsts.
b.
ptxqtop.chnum].xfer_len -= len;
346 pdev->host.hc[hptxsts.
b.
ptxqtop.chnum].xfer_count += len;
360 #if defined ( __ICCARM__ ) 361 #pragma optimize = none 454 #if defined ( __ICCARM__ ) 455 #pragma optimize = none 484 else if (hcint.
b.
ack)
491 USB_OTG_HC_Halt(pdev, num);
496 pdev->host.ErrCnt[num] = 0;
498 USB_OTG_HC_Halt(pdev, num);
500 pdev->host.HC_Status[num] =
HC_XFRC;
507 USB_OTG_HC_Halt(pdev, num);
508 pdev->host.HC_Status[num] =
HC_STALL;
511 else if (hcint.
b.
nak)
513 pdev->host.ErrCnt[num] = 0;
517 USB_OTG_HC_Halt(pdev, num);
520 pdev->host.HC_Status[num] =
HC_NAK;
526 USB_OTG_HC_Halt(pdev, num);
530 else if (hcint.
b.
nyet)
532 pdev->host.ErrCnt[num] = 0;
536 USB_OTG_HC_Halt(pdev, num);
539 pdev->host.HC_Status[num] =
HC_NYET;
544 USB_OTG_HC_Halt(pdev, num);
554 if(pdev->host.HC_Status[num] ==
HC_XFRC)
556 pdev->host.URB_State[num] =
URB_DONE;
560 pdev->host.hc[num].toggle_out ^= 1;
563 else if(pdev->host.HC_Status[num] ==
HC_NAK)
567 else if(pdev->host.HC_Status[num] ==
HC_NYET)
569 if(pdev->host.hc[num].do_ping == 1)
571 USB_OTG_HC_DoPing(pdev, num);
575 else if(pdev->host.HC_Status[num] ==
HC_STALL)
579 else if(pdev->host.HC_Status[num] ==
HC_XACTERR)
591 #if defined ( __ICCARM__ ) 592 #pragma optimize = none 621 else if (hcint.
b.
ack)
629 pdev->host.HC_Status[num] =
HC_STALL;
635 USB_OTG_HC_Halt(pdev, num);
640 USB_OTG_HC_Halt(pdev, num);
649 USB_OTG_HC_Halt(pdev, num);
658 pdev->host.XferCnt[num] = pdev->host.hc[num].xfer_len - hctsiz.
b.
xfersize;
661 pdev->host.HC_Status[num] =
HC_XFRC;
662 pdev->host.ErrCnt [num]= 0;
669 USB_OTG_HC_Halt(pdev, num);
671 pdev->host.hc[num].toggle_in ^= 1;
678 pdev->host.URB_State[num] =
URB_DONE;
685 if(pdev->host.HC_Status[num] ==
HC_XFRC)
687 pdev->host.URB_State[num] =
URB_DONE;
690 else if (pdev->host.HC_Status[num] ==
HC_STALL)
695 else if((pdev->host.HC_Status[num] ==
HC_XACTERR) ||
698 pdev->host.ErrCnt[num] = 0;
704 pdev->host.hc[num].toggle_in ^= 1;
714 USB_OTG_HC_Halt(pdev, num);
717 else if (hcint.
b.
nak)
724 USB_OTG_HC_Halt(pdev, num);
728 pdev->host.HC_Status[num] =
HC_NAK;
752 #if defined ( __ICCARM__ ) 753 #pragma optimize = none 761 __IO uint8_t channelnum =0;
770 channelnum = grxsts.
b.
chnum;
777 if ((grxsts.
b.
bcnt > 0) && (pdev->host.hc[channelnum].xfer_buff != (
void *)0))
782 pdev->host.hc[grxsts.
b.
chnum].xfer_buff += grxsts.
b.
bcnt;
783 pdev->host.hc[grxsts.
b.
chnum].xfer_count += grxsts.
b.
bcnt;
786 count = pdev->host.hc[channelnum].xfer_count;
787 pdev->host.XferCnt[channelnum] = count;
820 #if defined ( __ICCARM__ ) 821 #pragma optimize = none
static uint32_t USB_OTG_USBH_handle_port_ISR(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_USBH_handle_port_ISR This function determines which interrupt conditions have occurred...
#define HPRT0_PRTSPD_FULL_SPEED
struct _USB_OTG_HPTXSTS_TypeDef::@86 b
struct _USB_OTG_HCFG_TypeDef::@83 b
struct _USB_OTG_HAINT_TypeDef::@89 b
USBH_HCD_INT_cb_TypeDef * USBH_HCD_INT_fops
uint8_t(* DevPortEnabled)(USB_OTG_CORE_HANDLE *pdev)
uint8_t(* SOF)(USB_OTG_CORE_HANDLE *pdev)
static uint32_t USB_OTG_USBH_handle_hc_n_Out_ISR(USB_OTG_CORE_HANDLE *pdev, uint32_t num)
USB_OTG_USBH_handle_hc_n_Out_ISR Handles interrupt for a specific Host Channel.
struct _USB_OTG_GINTMSK_TypeDef::@64 b
static uint32_t USB_OTG_USBH_handle_hc_ISR(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_USBH_handle_hc_ISR This function indicates that one or more host channels has a pending...
struct _USB_OTG_GINTSTS_TypeDef::@65 b
static uint32_t USB_OTG_USBH_handle_ptxfempty_ISR(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_USBH_handle_ptxfempty_ISR Handles periodic tx fifo empty.
uint8_t(* DevDisconnected)(USB_OTG_CORE_HANDLE *pdev)
static uint32_t USB_OTG_USBH_handle_sof_ISR(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_otg_hcd_handle_sof_intr Handles the start-of-frame interrupt in host mode.
static uint32_t USB_OTG_USBH_handle_IncompletePeriodicXfer_ISR(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_USBH_handle_IncompletePeriodicXfer_ISR Handles the incomplete Periodic transfer Interrupt...
struct _USB_OTG_HPRT0_TypeDef::@88 b
#define HPRT0_PRTSPD_LOW_SPEED
static uint32_t USB_OTG_USBH_handle_Disconnect_ISR(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_USBH_handle_Disconnect_ISR Handles disconnect event.
uint8_t(* DevConnected)(USB_OTG_CORE_HANDLE *pdev)
#define USB_OTG_WRITE_REG32(reg, value)
uint32_t USBH_OTG_ISR_Handler(USB_OTG_CORE_HANDLE *pdev)
HOST_Handle_ISR This function handles all USB Host Interrupts.
struct _USB_OTG_HCTSIZn_TypeDef::@94 b
#define MASK_HOST_INT_CHH(hc_num)
#define USB_OTG_READ_REG32(reg)
#define USB_OTG_EMBEDDED_PHY
uint8_t(* DevPortDisabled)(USB_OTG_CORE_HANDLE *pdev)
void * USB_OTG_ReadPacket(USB_OTG_CORE_HANDLE *pdev, uint8_t *dest, uint16_t len)
USB_OTG_ReadPacket : Reads a packet from the Rx FIFO.
Header of the Core Layer.
struct _USB_OTG_HNPTXSTS_TypeDef::@69 b
#define GRXSTS_PKTSTS_DATA_TOGGLE_ERR
#define CLEAR_HC_INT(HC_REGS, intr)
uint32_t USB_OTG_ReadCoreItr(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_ReadCoreItr : returns the Core Interrupt register.
struct _USB_OTG_HNPTXSTS_TypeDef::@69::@70 nptxqtop
struct _USB_OTG_HPTXSTS_TypeDef::@86::@87 ptxqtop
Header of the Core Layer.
Peripheral Device Interface Layer.
static uint32_t USB_OTG_USBH_handle_hc_n_In_ISR(USB_OTG_CORE_HANDLE *pdev, uint32_t num)
USB_OTG_USBH_handle_hc_n_In_ISR Handles interrupt for a specific Host Channel.
#define UNMASK_HOST_INT_CHH(hc_num)
#define GRXSTS_PKTSTS_IN_XFER_COMP
static uint32_t USB_OTG_USBH_handle_rx_qlvl_ISR(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_USBH_handle_rx_qlvl_ISR Handles the Rx Status Queue Level Interrupt.
struct _USB_OTG_GRXSTS_TypeDef::@67 b
uint8_t USB_OTG_IsHostMode(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_IsHostMode : Check if it is host mode.
#define GRXSTS_PKTSTS_CH_HALTED
USB_OTG_HC_REGS * HC_REGS[USB_OTG_MAX_TX_FIFOS]
#define USB_OTG_MODIFY_REG32(reg, clear_mask, set_mask)
USB_OTG_STS USB_OTG_WritePacket(USB_OTG_CORE_HANDLE *pdev, uint8_t *src, uint8_t ch_ep_num, uint16_t len)
USB_OTG_WritePacket : Writes a packet into the Tx FIFO associated with the EP.
static uint32_t USB_OTG_USBH_handle_nptxfempty_ISR(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_USBH_handle_nptxfempty_ISR Handles non periodic tx fifo empty.
struct _USB_OTG_HCCHAR_TypeDef::@91 b
struct _USB_OTG_HCINTn_TypeDef::@93 b