94 #ifdef VBUS_SENSING_ENABLED 109 #ifdef USB_OTG_HS_DEDICATED_EP1_ENABLED 133 pdev->dev.out_ep[1].xfer_count = pdev->dev.out_ep[1].xfer_len- \
162 uint32_t fifoemptymsk, msk, emp;
166 msk |= ((emp >> 1 ) & 0x1) << 7;
171 fifoemptymsk = 0x1 << 1;
215 if (!gintr_status.
d32)
280 #ifdef VBUS_SENSING_ENABLED 283 retval |= DCD_SessionRequest_ISR(pdev);
288 retval |= DCD_OTG_ISR(pdev);
295 #ifdef VBUS_SENSING_ENABLED 385 __IO uint8_t prev_status = 0;
387 prev_status = pdev->dev.device_status;
398 (pdev->dev.connection_status == 1) &&
427 uint32_t fifoemptymsk;
429 ep_intr = USB_OTG_ReadDevAllInEPItr(pdev);
433 if ((ep_intr & 0x1) == 0x01)
438 fifoemptymsk = 0x1 << epnum;
449 USB_OTG_EP0_OutStart(pdev);
497 ep_intr = USB_OTG_ReadDevAllOutEp_itr(pdev);
504 doepint.
d32 = USB_OTG_ReadDevOutEP_itr(pdev, epnum);
515 pdev->dev.out_ep[epnum].xfer_count = pdev->dev.out_ep[epnum].maxpacket - \
527 USB_OTG_EP0_OutStart(pdev);
594 ep = &pdev->dev.out_ep[status.
b.
epnum];
640 uint32_t fifoemptymsk;
642 ep = &pdev->dev.in_ep[epnum];
651 len32b = (len + 3) / 4;
665 len32b = (len + 3) / 4;
677 fifoemptymsk = 0x1 << ep->
num;
731 #ifdef USB_OTG_HS_DEDICATED_EP1_ENABLED 739 #ifdef USB_OTG_HS_DEDICATED_EP1_ENABLED 749 USB_OTG_EP0_OutStart(pdev);
769 uint32_t hclk = 168000000;
774 USB_OTG_EP0Activate(pdev);
804 if((hclk >= 15000000)&&(hclk < 16000000))
810 else if((hclk >= 16000000)&&(hclk < 17100000))
816 else if((hclk >= 17100000)&&(hclk < 18400000))
822 else if((hclk >= 18400000)&&(hclk < 20000000))
828 else if((hclk >= 20000000)&&(hclk < 21800000))
834 else if((hclk >= 21800000)&&(hclk < 24000000))
840 else if((hclk >= 24000000)&&(hclk < 26600000))
846 else if((hclk >= 26600000)&&(hclk < 30000000))
852 else if((hclk >= 30000000)&&(hclk < 34300000))
923 uint32_t v, msk, emp;
926 msk |= ((emp >> epnum) & 0x1) << 7;
uint8_t(* IsoOUTIncomplete)(USB_OTG_CORE_HANDLE *pdev)
#define USB_OTG_EP0_STATUS_IN
#define USB_OTG_HS_MAX_PACKET_SIZE
static uint32_t DCD_HandleUSBSuspend_ISR(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_HandleUSBSuspend_ISR Indicates that SUSPEND state has been detected on the USB...
#define SCB_SCR_SLEEPDEEP_Msk
uint8_t(* Reset)(USB_OTG_CORE_HANDLE *pdev)
uint8_t(* DevConnected)(USB_OTG_CORE_HANDLE *pdev)
uint8_t(* IsoINIncomplete)(USB_OTG_CORE_HANDLE *pdev)
static uint32_t DCD_ReadDevInEP(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
DCD_ReadDevInEP Reads ep flags.
#define USB_OTG_EP0_STATUS_OUT
struct _USB_OTG_GINTMSK_TypeDef::@64 b
static uint32_t DCD_HandleUsbReset_ISR(USB_OTG_CORE_HANDLE *pdev)
DCD_HandleUsbReset_ISR This interrupt occurs when a USB Reset is detected.
#define SCB_SCR_SLEEPONEXIT_Msk
static uint32_t DCD_WriteEmptyTxFifo(USB_OTG_CORE_HANDLE *pdev, uint32_t epnum)
DCD_WriteEmptyTxFifo check FIFO for the next packet to be loaded.
static uint32_t DCD_HandleInEP_ISR(USB_OTG_CORE_HANDLE *pdev)
DCD_HandleInEP_ISR Indicates that an IN EP has a pending Interrupt.
struct _USB_OTG_GINTSTS_TypeDef::@65 b
static uint32_t DCD_IsoINIncomplete_ISR(USB_OTG_CORE_HANDLE *pdev)
DCD_IsoINIncomplete_ISR handle the ISO IN incomplete interrupt.
#define CLEAR_OUT_EP_INTR(epnum, intr)
#define USB_OTG_SPEED_FULL
#define CLEAR_IN_EP_INTR(epnum, intr)
static volatile uint8_t * status
USB_OTG_INEPREGS * INEP_REGS[USB_OTG_MAX_TX_FIFOS]
USB_OTG_OUTEPREGS * OUTEP_REGS[USB_OTG_MAX_TX_FIFOS]
Peripheral Device Interface Layer.
#define USB_OTG_SPEED_HIGH
uint8_t(* DataInStage)(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
struct _USB_OTG_DOEPINTn_TypeDef::@77 b
#define USB_OTG_FS_MAX_PACKET_SIZE
static uint32_t DCD_HandleRxStatusQueueLevel_ISR(USB_OTG_CORE_HANDLE *pdev)
DCD_HandleRxStatusQueueLevel_ISR Handles the Rx Status Queue Level Interrupt.
#define USB_OTG_WRITE_REG32(reg, value)
uint8_t(* DevDisconnected)(USB_OTG_CORE_HANDLE *pdev)
struct _USB_OTG_GOTGINT_TypeDef::@60 b
static uint32_t DCD_HandleSof_ISR(USB_OTG_CORE_HANDLE *pdev)
DCD_HandleSof_ISR Handles the SOF Interrupts.
USB_OTG_STS USB_OTG_FlushTxFifo(USB_OTG_CORE_HANDLE *pdev, uint32_t num)
USB_OTG_FlushTxFifo : Flush a Tx FIFO.
#define USB_OTG_READ_REG32(reg)
struct _USB_OTG_GUSBCFG_TypeDef::@62 b
struct _USB_OTG_DAINT_TypeDef::@78 ep
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.
static uint32_t DCD_HandleResume_ISR(USB_OTG_CORE_HANDLE *pdev)
DCD_HandleResume_ISR Indicates that the USB_OTG controller has detected a resume or remote Wake-up se...
uint8_t(* DataOutStage)(USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
static uint32_t DCD_HandleOutEP_ISR(USB_OTG_CORE_HANDLE *pdev)
DCD_HandleOutEP_ISR Indicates that an OUT EP has a pending Interrupt.
uint32_t USB_OTG_ReadCoreItr(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_ReadCoreItr : returns the Core Interrupt register.
struct _USB_OTG_DTXFSTSn_TypeDef::@71 b
struct _USB_OTG_PCGCCTL_TypeDef::@96 b
uint8_t(* SOF)(USB_OTG_CORE_HANDLE *pdev)
static uint32_t DCD_IsoOUTIncomplete_ISR(USB_OTG_CORE_HANDLE *pdev)
DCD_IsoOUTIncomplete_ISR handle the ISO OUT incomplete interrupt.
uint8_t(* Suspend)(USB_OTG_CORE_HANDLE *pdev)
struct _USB_OTG_DIEPINTn_TypeDef::@76 b
static uint32_t DCD_HandleEnumDone_ISR(USB_OTG_CORE_HANDLE *pdev)
DCD_HandleEnumDone_ISR Read the device status register and set the device speed.
void RCC_GetClocksFreq(RCC_ClocksTypeDef *RCC_Clocks)
Returns the frequencies of different on chip clocks; SYSCLK, HCLK, PCLK1 and PCLK2.
uint32_t USBD_OTG_EP1IN_ISR_Handler(USB_OTG_CORE_HANDLE *pdev)
struct _USB_OTG_DSTS_TypeDef::@75 b
uint8_t(* SetupStage)(USB_OTG_CORE_HANDLE *pdev)
struct _USB_OTG_DRXSTS_TypeDef::@66 b
#define USB_OTG_CONFIGURED
uint8_t USB_OTG_IsDeviceMode(USB_OTG_CORE_HANDLE *pdev)
USB_OTG_IsDeviceMode : Check if it is device mode.
uint32_t USBD_OTG_ISR_Handler(USB_OTG_CORE_HANDLE *pdev)
STM32_USBF_OTG_ISR_Handler handles all USB Interrupts.
uint32_t USBD_OTG_EP1OUT_ISR_Handler(USB_OTG_CORE_HANDLE *pdev)
USBD_DCD_INT_cb_TypeDef * USBD_DCD_INT_fops
uint8_t(* Resume)(USB_OTG_CORE_HANDLE *pdev)
#define USB_OTG_MODIFY_REG32(reg, clear_mask, set_mask)
struct _USB_OTG_DCTL_TypeDef::@74 b
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.
struct _USB_OTG_DCFG_TypeDef::@73 b