APM:Libraries
Functions
USB_CORE_Private_Functions
Collaboration diagram for USB_CORE_Private_Functions:

Functions

static void USB_OTG_EnableCommonInt (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_EnableCommonInt Initializes the commmon interrupts, used in both device and modes. More...
 
static USB_OTG_STS USB_OTG_CoreReset (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_CoreReset : Soft reset of the core. More...
 
USB_OTG_STS USB_OTG_WritePacket (USB_OTG_CORE_HANDLE *pdev, const 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. More...
 
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. More...
 
USB_OTG_STS USB_OTG_SelectCore (USB_OTG_CORE_HANDLE *pdev, USB_OTG_CORE_ID_TypeDef coreID)
 USB_OTG_SelectCore Initialize core registers address. More...
 
USB_OTG_STS USB_OTG_CoreInit (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_CoreInit Initializes the USB_OTG controller registers and prepares the core device mode or host mode operation. More...
 
USB_OTG_STS USB_OTG_EnableGlobalInt (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_EnableGlobalInt Enables the controller's Global Int in the AHB Config reg. More...
 
USB_OTG_STS USB_OTG_DisableGlobalInt (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_DisableGlobalInt Enables the controller's Global Int in the AHB Config reg. More...
 
USB_OTG_STS USB_OTG_FlushTxFifo (USB_OTG_CORE_HANDLE *pdev, uint32_t num)
 USB_OTG_FlushTxFifo : Flush a Tx FIFO. More...
 
USB_OTG_STS USB_OTG_FlushRxFifo (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_FlushRxFifo : Flush a Rx FIFO. More...
 
USB_OTG_STS USB_OTG_SetCurrentMode (USB_OTG_CORE_HANDLE *pdev, uint8_t mode)
 USB_OTG_SetCurrentMode : Set ID line. More...
 
uint32_t USB_OTG_GetMode (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_GetMode : Get current mode. More...
 
uint8_t USB_OTG_IsDeviceMode (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_IsDeviceMode : Check if it is device mode. More...
 
uint8_t USB_OTG_IsHostMode (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_IsHostMode : Check if it is host mode. More...
 
uint32_t USB_OTG_ReadCoreItr (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_ReadCoreItr : returns the Core Interrupt register. More...
 
uint32_t USB_OTG_ReadOtgItr (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_ReadOtgItr : returns the USB_OTG Interrupt register. More...
 
void USB_OTG_InitDevSpeed (USB_OTG_CORE_HANDLE *pdev, uint8_t speed)
 USB_OTG_InitDevSpeed :Initializes the DevSpd field of DCFG register depending the PHY type and the enumeration speed of the device. More...
 
USB_OTG_STS USB_OTG_CoreInitDev (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_CoreInitDev : Initializes the USB_OTG controller registers for device mode. More...
 
USB_OTG_STS USB_OTG_EnableDevInt (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_EnableDevInt : Enables the Device mode interrupts. More...
 
enum USB_OTG_SPEED USB_OTG_GetDeviceSpeed (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_GetDeviceSpeed Get the device speed from the device status register. More...
 
USB_OTG_STS USB_OTG_EP0Activate (USB_OTG_CORE_HANDLE *pdev)
 enables EP0 OUT to receive SETUP packets and configures EP0 for transmitting packets More...
 
USB_OTG_STS USB_OTG_EPActivate (USB_OTG_CORE_HANDLE *pdev, USB_OTG_EP *ep)
 USB_OTG_EPActivate : Activates an EP. More...
 
USB_OTG_STS USB_OTG_EPDeactivate (USB_OTG_CORE_HANDLE *pdev, USB_OTG_EP *ep)
 USB_OTG_EPDeactivate : Deactivates an EP. More...
 
USB_OTG_STS USB_OTG_EPStartXfer (USB_OTG_CORE_HANDLE *pdev, USB_OTG_EP *ep)
 USB_OTG_EPStartXfer : Handle the setup for data xfer for an EP and starts the xfer. More...
 
USB_OTG_STS USB_OTG_EP0StartXfer (USB_OTG_CORE_HANDLE *pdev, USB_OTG_EP *ep)
 USB_OTG_EP0StartXfer : Handle the setup for a data xfer for EP0 and starts the xfer. More...
 
USB_OTG_STS USB_OTG_EPSetStall (USB_OTG_CORE_HANDLE *pdev, USB_OTG_EP *ep)
 USB_OTG_EPSetStall : Set the EP STALL. More...
 
USB_OTG_STS USB_OTG_EPClearStall (USB_OTG_CORE_HANDLE *pdev, USB_OTG_EP *ep)
 Clear the EP STALL. More...
 
uint32_t USB_OTG_ReadDevAllOutEp_itr (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_ReadDevAllOutEp_itr : returns OUT endpoint interrupt bits. More...
 
uint32_t USB_OTG_ReadDevOutEP_itr (USB_OTG_CORE_HANDLE *pdev, uint8_t epnum)
 USB_OTG_ReadDevOutEP_itr : returns Device OUT EP Interrupt register. More...
 
uint32_t USB_OTG_ReadDevAllInEPItr (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_ReadDevAllInEPItr : Get int status register. More...
 
void USB_OTG_EP0_OutStart (USB_OTG_CORE_HANDLE *pdev)
 configures EPO to receive SETUP packets More...
 
void USB_OTG_ActiveRemoteWakeup (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_RemoteWakeup : active remote wakeup signalling. More...
 
void USB_OTG_UngateClock (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_UngateClock : active USB Core clock. More...
 
void USB_OTG_StopDevice (USB_OTG_CORE_HANDLE *pdev)
 Stop the device and clean up fifo's. More...
 
uint32_t USB_OTG_GetEPStatus (USB_OTG_CORE_HANDLE *pdev, USB_OTG_EP *ep)
 returns the EP Status More...
 
void USB_OTG_SetEPStatus (USB_OTG_CORE_HANDLE *pdev, USB_OTG_EP *ep, uint32_t Status)
 Set the EP Status. More...
 

Detailed Description

Function Documentation

◆ USB_OTG_ActiveRemoteWakeup()

void USB_OTG_ActiveRemoteWakeup ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_RemoteWakeup : active remote wakeup signalling.

Parameters
None
Return values
None

Definition at line 1946 of file usb_core.c.

Here is the call graph for this function:

◆ USB_OTG_CoreInit()

USB_OTG_STS USB_OTG_CoreInit ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_CoreInit Initializes the USB_OTG controller registers and prepares the core device mode or host mode operation.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 324 of file usb_core.c.

Referenced by DCD_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_OTG_CoreInitDev()

USB_OTG_STS USB_OTG_CoreInitDev ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_CoreInitDev : Initializes the USB_OTG controller registers for device mode.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 1191 of file usb_core.c.

Referenced by DCD_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_OTG_CoreReset()

static USB_OTG_STS USB_OTG_CoreReset ( USB_OTG_CORE_HANDLE pdev)
static

USB_OTG_CoreReset : Soft reset of the core.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 124 of file usb_core.c.

Referenced by USB_OTG_CoreInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_OTG_DisableGlobalInt()

USB_OTG_STS USB_OTG_DisableGlobalInt ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_DisableGlobalInt Enables the controller's Global Int in the AHB Config reg.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 444 of file usb_core.c.

Referenced by DCD_Init().

Here is the caller graph for this function:

◆ USB_OTG_EnableCommonInt()

static void USB_OTG_EnableCommonInt ( USB_OTG_CORE_HANDLE pdev)
static

USB_OTG_EnableCommonInt Initializes the commmon interrupts, used in both device and modes.

Parameters
pdev: Selected device
Return values
None

Definition at line 96 of file usb_core.c.

Referenced by USB_OTG_CoreInit(), USB_OTG_EnableDevInt(), and USB_OTG_ReadOtgItr().

Here is the caller graph for this function:

◆ USB_OTG_EnableDevInt()

USB_OTG_STS USB_OTG_EnableDevInt ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_EnableDevInt : Enables the Device mode interrupts.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 1370 of file usb_core.c.

Referenced by USB_OTG_CoreInitDev().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_OTG_EnableGlobalInt()

USB_OTG_STS USB_OTG_EnableGlobalInt ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_EnableGlobalInt Enables the controller's Global Int in the AHB Config reg.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 426 of file usb_core.c.

Referenced by DCD_Init().

Here is the caller graph for this function:

◆ USB_OTG_EP0_OutStart()

void USB_OTG_EP0_OutStart ( USB_OTG_CORE_HANDLE pdev)

configures EPO to receive SETUP packets

Parameters
None
Return values
None

Definition at line 1917 of file usb_core.c.

Referenced by DCD_HandleInEP_ISR(), DCD_HandleOutEP_ISR(), DCD_HandleUsbReset_ISR(), USBD_CtlError(), USBD_CtlReceiveStatus(), and USBD_CtlSendStatus().

Here is the caller graph for this function:

◆ USB_OTG_EP0Activate()

USB_OTG_STS USB_OTG_EP0Activate ( USB_OTG_CORE_HANDLE pdev)

enables EP0 OUT to receive SETUP packets and configures EP0 for transmitting packets

Parameters
None
Return values
USB_OTG_STS: status

Definition at line 1445 of file usb_core.c.

Referenced by DCD_HandleEnumDone_ISR().

Here is the caller graph for this function:

◆ USB_OTG_EP0StartXfer()

USB_OTG_STS USB_OTG_EP0StartXfer ( USB_OTG_CORE_HANDLE pdev,
USB_OTG_EP ep 
)

USB_OTG_EP0StartXfer : Handle the setup for a data xfer for EP0 and starts the xfer.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 1705 of file usb_core.c.

Referenced by DCD_EP_PrepareRx(), and DCD_EP_Tx().

Here is the caller graph for this function:

◆ USB_OTG_EPActivate()

USB_OTG_STS USB_OTG_EPActivate ( USB_OTG_CORE_HANDLE pdev,
USB_OTG_EP ep 
)

USB_OTG_EPActivate : Activates an EP.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 1480 of file usb_core.c.

Referenced by DCD_EP_Open().

Here is the caller graph for this function:

◆ USB_OTG_EPClearStall()

USB_OTG_STS USB_OTG_EPClearStall ( USB_OTG_CORE_HANDLE pdev,
USB_OTG_EP ep 
)

Clear the EP STALL.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 1842 of file usb_core.c.

Referenced by DCD_EP_ClrStall(), and USB_OTG_SetEPStatus().

Here is the caller graph for this function:

◆ USB_OTG_EPDeactivate()

USB_OTG_STS USB_OTG_EPDeactivate ( USB_OTG_CORE_HANDLE pdev,
USB_OTG_EP ep 
)

USB_OTG_EPDeactivate : Deactivates an EP.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 1531 of file usb_core.c.

Referenced by DCD_EP_Close().

Here is the caller graph for this function:

◆ USB_OTG_EPSetStall()

USB_OTG_STS USB_OTG_EPSetStall ( USB_OTG_CORE_HANDLE pdev,
USB_OTG_EP ep 
)

USB_OTG_EPSetStall : Set the EP STALL.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 1806 of file usb_core.c.

Referenced by DCD_EP_Stall(), and USB_OTG_SetEPStatus().

Here is the caller graph for this function:

◆ USB_OTG_EPStartXfer()

USB_OTG_STS USB_OTG_EPStartXfer ( USB_OTG_CORE_HANDLE pdev,
USB_OTG_EP ep 
)

USB_OTG_EPStartXfer : Handle the setup for data xfer for an EP and starts the xfer.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 1573 of file usb_core.c.

Referenced by DCD_EP_PrepareRx(), and DCD_EP_Tx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_OTG_FlushRxFifo()

USB_OTG_STS USB_OTG_FlushRxFifo ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_FlushRxFifo : Flush a Rx FIFO.

Parameters
pdev: Selected device
Return values
USB_OTG_STS: status

Definition at line 491 of file usb_core.c.

Referenced by DCD_EP_Flush(), USB_OTG_CoreInitDev(), USB_OTG_ReadOtgItr(), and USB_OTG_StopDevice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_OTG_FlushTxFifo()

USB_OTG_STS USB_OTG_FlushTxFifo ( USB_OTG_CORE_HANDLE pdev,
uint32_t  num 
)

USB_OTG_FlushTxFifo : Flush a Tx FIFO.

Parameters
pdev: Selected device
num: FO num
Return values
USB_OTG_STS: status

Definition at line 461 of file usb_core.c.

Referenced by DCD_EP_Flush(), DCD_HandleUsbReset_ISR(), USB_OTG_CoreInitDev(), USB_OTG_ReadOtgItr(), and USB_OTG_StopDevice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_OTG_GetDeviceSpeed()

enum USB_OTG_SPEED USB_OTG_GetDeviceSpeed ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_GetDeviceSpeed Get the device speed from the device status register.

Parameters
None
Return values
status

Definition at line 1414 of file usb_core.c.

Referenced by DCD_HandleEnumDone_ISR().

Here is the caller graph for this function:

◆ USB_OTG_GetEPStatus()

uint32_t USB_OTG_GetEPStatus ( USB_OTG_CORE_HANDLE pdev,
USB_OTG_EP ep 
)

returns the EP Status

Parameters
pdev: Selected device ep : endpoint structure
Return values
EP status

Definition at line 2038 of file usb_core.c.

Referenced by DCD_GetEPStatus().

Here is the caller graph for this function:

◆ USB_OTG_GetMode()

uint32_t USB_OTG_GetMode ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_GetMode : Get current mode.

Parameters
pdev: Selected device
Return values
currentmode

Definition at line 551 of file usb_core.c.

Referenced by USB_OTG_IsDeviceMode(), and USB_OTG_IsHostMode().

Here is the caller graph for this function:

◆ USB_OTG_InitDevSpeed()

void USB_OTG_InitDevSpeed ( USB_OTG_CORE_HANDLE pdev,
uint8_t  speed 
)

USB_OTG_InitDevSpeed :Initializes the DevSpd field of DCFG register depending the PHY type and the enumeration speed of the device.

Parameters
pdev: Selected device
Return values
None

Definition at line 1175 of file usb_core.c.

Referenced by USB_OTG_CoreInitDev().

Here is the caller graph for this function:

◆ USB_OTG_IsDeviceMode()

uint8_t USB_OTG_IsDeviceMode ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_IsDeviceMode : Check if it is device mode.

Parameters
pdev: Selected device
Return values
num_in_ep

Definition at line 562 of file usb_core.c.

Referenced by USBD_OTG_ISR_Handler().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_OTG_IsHostMode()

uint8_t USB_OTG_IsHostMode ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_IsHostMode : Check if it is host mode.

Parameters
pdev: Selected device
Return values
num_in_ep

Definition at line 573 of file usb_core.c.

Here is the call graph for this function:

◆ USB_OTG_ReadCoreItr()

uint32_t USB_OTG_ReadCoreItr ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_ReadCoreItr : returns the Core Interrupt register.

Parameters
pdev: Selected device
Return values
Status

Definition at line 584 of file usb_core.c.

Referenced by USBD_OTG_ISR_Handler().

Here is the caller graph for this function:

◆ USB_OTG_ReadDevAllInEPItr()

uint32_t USB_OTG_ReadDevAllInEPItr ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_ReadDevAllInEPItr : Get int status register.

Parameters
pdev: Selected device
Return values
intstatus register

Definition at line 1904 of file usb_core.c.

Referenced by DCD_HandleInEP_ISR().

Here is the caller graph for this function:

◆ USB_OTG_ReadDevAllOutEp_itr()

uint32_t USB_OTG_ReadDevAllOutEp_itr ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_ReadDevAllOutEp_itr : returns OUT endpoint interrupt bits.

Parameters
pdev: Selected device
Return values
OUTendpoint interrupt bits

Definition at line 1875 of file usb_core.c.

Referenced by DCD_HandleOutEP_ISR().

Here is the caller graph for this function:

◆ USB_OTG_ReadDevOutEP_itr()

uint32_t USB_OTG_ReadDevOutEP_itr ( USB_OTG_CORE_HANDLE pdev,
uint8_t  epnum 
)

USB_OTG_ReadDevOutEP_itr : returns Device OUT EP Interrupt register.

Parameters
pdev: Selected device
ep: end point number
Return values
DeviceOUT EP Interrupt register

Definition at line 1890 of file usb_core.c.

Referenced by DCD_HandleOutEP_ISR().

Here is the caller graph for this function:

◆ USB_OTG_ReadOtgItr()

uint32_t USB_OTG_ReadOtgItr ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_ReadOtgItr : returns the USB_OTG Interrupt register.

Parameters
pdev: Selected device
Return values
Status

Definition at line 598 of file usb_core.c.

Here is the call graph for this function:

◆ USB_OTG_ReadPacket()

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.

Parameters
pdev: Selected device
dest: Destination Pointer
bytes: No. of bytes
Return values
None

Definition at line 198 of file usb_core.c.

Referenced by DCD_HandleRxStatusQueueLevel_ISR().

Here is the caller graph for this function:

◆ USB_OTG_SelectCore()

USB_OTG_STS USB_OTG_SelectCore ( USB_OTG_CORE_HANDLE pdev,
USB_OTG_CORE_ID_TypeDef  coreID 
)

USB_OTG_SelectCore Initialize core registers address.

Parameters
pdev: Selected device
coreID: USB OTG Core ID
Return values
USB_OTG_STS: status

Definition at line 222 of file usb_core.c.

Referenced by DCD_Init().

Here is the caller graph for this function:

◆ USB_OTG_SetCurrentMode()

USB_OTG_STS USB_OTG_SetCurrentMode ( USB_OTG_CORE_HANDLE pdev,
uint8_t  mode 
)

USB_OTG_SetCurrentMode : Set ID line.

Parameters
pdev: Selected device
mode: (Host/device)
Return values
USB_OTG_STS: status

Definition at line 521 of file usb_core.c.

Referenced by DCD_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_OTG_SetEPStatus()

void USB_OTG_SetEPStatus ( USB_OTG_CORE_HANDLE pdev,
USB_OTG_EP ep,
uint32_t  Status 
)

Set the EP Status.

Parameters
pdev: Selected device Status : new Status ep : EP structure
Return values
None

Definition at line 2081 of file usb_core.c.

Referenced by DCD_SetEPStatus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_OTG_StopDevice()

void USB_OTG_StopDevice ( USB_OTG_CORE_HANDLE pdev)

Stop the device and clean up fifo's.

Parameters
None
Return values
None

Definition at line 2009 of file usb_core.c.

Referenced by usb_close().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_OTG_UngateClock()

void USB_OTG_UngateClock ( USB_OTG_CORE_HANDLE pdev)

USB_OTG_UngateClock : active USB Core clock.

Parameters
None
Return values
None

Definition at line 1982 of file usb_core.c.

Referenced by STORAGE_GetMaxLun().

Here is the caller graph for this function:

◆ USB_OTG_WritePacket()

USB_OTG_STS USB_OTG_WritePacket ( USB_OTG_CORE_HANDLE pdev,
const 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.

Parameters
pdev: Selected device
src: source pointer
ch_ep_num: end point number
bytes: No. of bytes
Return values
USB_OTG_STS: status

Definition at line 169 of file usb_core.c.

Referenced by DCD_WriteEmptyTxFifo(), USB_OTG_EPStartXfer(), and USB_OTG_ReadOtgItr().

Here is the caller graph for this function: