Data Structures | Macros | Typedefs | Enumerations | Functions
usb_soc_defines.h File Reference

This file defines APIs dictated by the SOC specific implementation of the USB system. For example the USB wrapper is implemenation specific and APIs specific to the wrapper is declared here. The defintion of the same would be done in the respective SOC wrapper file. More...

Data Structures

struct  usbWrapParams
 Structure holding the details of the wrapper implementation. More...
 
struct  usbWrapIntrObj
 Structure detailing HW ISR - Reason for HW interrupt and the source. More...
 
struct  usbWrapper
 Structure holding the details of the wrapper implementation. More...
 

Macros

#define USB_WRAP_INTR_SOURCE_MAIN   (0x1)
 USB wrapper main interrupt source .
 
#define USB_WRAP_INTR_SOURCE_MISC   (0x2)
 USB wrapper misc interrupt source .
 

Typedefs

typedef struct usbWrapParams usbWrapParams_t
 Structure holding the details of the wrapper implementation.
 
typedef struct usbWrapIntrObj usbWrapIntrObj_t
 Structure detailing HW ISR - Reason for HW interrupt and the source.
 
typedef struct usbWrapper usbWrapper_t
 Structure holding the details of the wrapper implementation.
 
typedef enum usbwrapIntrMisc usbwrapIntrMisc_t
 Enumerates the fields of wrapper MISC interrupts.
 
typedef enum usbwrapIntrMain usbwrapIntrMain_t
 Enumerates the fields of wrapper MAIN interrupts.
 
typedef enum usbwrapIntrMask usbwrapIntrMask_t
 Enumerates the possible interrupts that can be generated.
 

Enumerations

enum  usbwrapIntrMisc {
  USBWRAP_INTR_MISC_IDPULLUP_FALL_EN = 0U, USBWRAP_INTR_MISC_DISCHRGVBUS_FALL_EN = 3U, USBWRAP_INTR_MISC_CHRGVBUS_FALL_EN = 4U, USBWRAP_INTR_MISC_DRVVBUS_FALL_EN = 5U,
  USBWRAP_INTR_MISC_IDPULLUP_RISE_EN = 8U, USBWRAP_INTR_MISC_DISCHRGVBUS_RISE_EN = 11U, USBWRAP_INTR_MISC_CHRGVBUS_RISE_EN = 12U, USBWRAP_INTR_MISC_DRVVBUS_RISE_EN = 13U,
  USBWRAP_INTR_MISC_OEVT_EN = 16U, USBWRAP_INTR_MISC_DMADISABLECLR_EN = 17U
}
 Enumerates the fields of wrapper MISC interrupts. More...
 
enum  usbwrapIntrMain {
  USBWRAP_INTR_MAIN_PORT_CHANGE_DETECT = 1U, USBWRAP_INTR_MAIN_DEVICE_CONNECT = 2U, USBWRAP_INTR_MAIN_DEVICE_DISCONNECT = 3U, USBWRAP_INTR_MAIN_PORT_OVERCURRENT_ACTIVE = 4U,
  USBWRAP_INTR_MAIN_EP_EVENT = 5U, USBWRAP_INTR_MAIN_SOF = 6U, USBWRAP_INTR_MAIN_VBUS_ERROR = 7U, USBWRAP_INTR_MAIN_BABBLE = 8U,
  USBWRAP_INTR_MAIN_SUSPEND = 9U, USBWRAP_INTR_MAIN_RESUME = 10U, USBWRAP_INTR_MAIN_SESSION = 11U
}
 Enumerates the fields of wrapper MAIN interrupts. More...
 
enum  usbwrapIntrMask {
  USBWRAP_INTR_MASK_MAIN_0 = 0x81U, USBWRAP_INTR_MASK_MAIN_1 = 0x82U, USBWRAP_INTR_MASK_MAIN_2 = 0x83U, USBWRAP_INTR_MASK_MAIN_3 = 0x84U,
  USBWRAP_INTR_MASK_RAW_MAIN_0 = 0x8100U, USBWRAP_INTR_MASK_RAW_MAIN_1 = 0x8200U, USBWRAP_INTR_MASK_RAW_MAIN_2 = 0x8300U, USBWRAP_INTR_MASK_RAW_MAIN_3 = 0x8400U,
  USBWRAP_INTR_MASK_MISC = 0x810000U, USBWRAP_INTR_MASK_MISC_RAW = 0x820000U
}
 Enumerates the possible interrupts that can be generated. More...
 

Functions

usbWrapper_tUSBWrapperInit (usbWrapper_t *pWrapperObj, uint32_t instNum)
 This API returns the address of the required wrapper/controller instance .This is the first API that needs to be called as the address of the instance gets populated by this function.It also populates the params structure with the necessary param values which would be implemented by specific drivers. More...
 
usbWrapper_tUSBWrapperGetRevision (usbWrapper_t *pWrapperObj)
 This API populates the revision number of the USB wrapper implement-. More...
 
uint32_t USBWrapperSysConfig (usbWrapper_t *pWrapperObj, uint32_t mode, uint32_t ops)
 This API configures the wrapper master slave interface parameters. PM mode configuration in master(initiator) and slave (local target) is done using this API. More...
 
void USBWrapperIntrClear (usbWrapper_t *pWrapperObj, uint32_t intrMask)
 This function flags the end of interrupt for all interrupts coming outof the wrapper. Note1: wrapper implementation need to take care to handle all possible interrupts, specifically USB core and miscelleous interrupts. More...
 
uint32_t USBWrapperIntrStatus (usbWrapper_t *pWrapperObj, uint32_t intrMask)
 This function returns the status (whether it has occured or not) for all interrupts coming outof the wrapper. Note1: wrapper implementation need to take care to handle all possible interrupts, specifically USB core and miscelleous interrupts. More...
 
void USBWrapperIntrEnable (usbWrapper_t *pWrapperObj, uint32_t intrMask, uint32_t intrSpecific)
 This API enables interrupts coming out of the USB wrapper. More...
 
void USBWrapperIntrDisable (usbWrapper_t *pWrapperObj, uint32_t intrMask, uint32_t intrSpecific)
 This API disables interrupts coming out of the USB wrapper. More...
 
uint32_t USBWrapperIntrEnableStatus (usbWrapper_t *pWrapperObj, uint32_t intrMask, uint32_t intrSpecific)
 This API returns the enable status of all interrupts coming out of the wrapper. Note1: wrapper implementations have 2 kinds of interrupts - Core interrupts and wrapper interrupts. More...
 
void USBWrapperTriggerIntr (usbWrapper_t *pWrapperObj, uint32_t intrMask, uint32_t intrSpecific)
 This API triggers all interrupts coming out of the wrapper. More...
 
uint32_t USBWrapperGetUtmiState (usbWrapper_t *pWrapperObj, uint32_t utmiField)
 This API returns the current state of the UTMI phy. More...
 
void USBWrapperSetUtmiFeature (usbWrapper_t *pWrapperObj, uint32_t utmiField)
 This API sets a particular UTMI feature. More...
 
uint32_t USBWrapperGetUtmiFeature (usbWrapper_t *pWrapperObj, uint32_t utmiField)
 This API configures the wrapper. More...
 
void USBWrapperClearUtmiFeature (usbWrapper_t *pWrapperObj, uint32_t utmiField)
 This API clears a particular UTMI feature. More...
 

Detailed Description

This file defines APIs dictated by the SOC specific implementation of the USB system. For example the USB wrapper is implemenation specific and APIs specific to the wrapper is declared here. The defintion of the same would be done in the respective SOC wrapper file.

Enumeration Type Documentation

Enumerates the fields of wrapper MAIN interrupts.

Enumerator
USBWRAP_INTR_MAIN_PORT_CHANGE_DETECT 

. A port change event has occured .

USBWRAP_INTR_MAIN_DEVICE_CONNECT 

. device connect event.

USBWRAP_INTR_MAIN_DEVICE_DISCONNECT 

. device disconnect event.

USBWRAP_INTR_MAIN_PORT_OVERCURRENT_ACTIVE 

. overcurrent active on this port.

USBWRAP_INTR_MAIN_EP_EVENT 

. Transfer complete interrupt.

USBWRAP_INTR_MAIN_SOF 

. SOF interrupt received.

USBWRAP_INTR_MAIN_VBUS_ERROR 

. VBUS error interrupt .

USBWRAP_INTR_MAIN_BABBLE 

. BABBLE error.

USBWRAP_INTR_MAIN_SUSPEND 

. BUS suspend Interrupt.

USBWRAP_INTR_MAIN_RESUME 

. Resume Interrupt.

USBWRAP_INTR_MAIN_SESSION 

. Session Start interrupt.

Enumerates the possible interrupts that can be generated.

Enumerator
USBWRAP_INTR_MASK_MAIN_0 

. USB CORE interrupt 0.

USBWRAP_INTR_MASK_MAIN_1 

. USB CORE interrupt 1.

USBWRAP_INTR_MASK_MAIN_2 

. USB CORE interrupt 2.

USBWRAP_INTR_MASK_MAIN_3 

. USB CORE interrupt 3.

USBWRAP_INTR_MASK_RAW_MAIN_0 

. USB CORE raw interrupt 0.

USBWRAP_INTR_MASK_RAW_MAIN_1 

. USB CORE raw interrupt 1.

USBWRAP_INTR_MASK_RAW_MAIN_2 

. USB CORE raw interrupt 2.

USBWRAP_INTR_MASK_RAW_MAIN_3 

. USB CORE raw interrupt 3.

USBWRAP_INTR_MASK_MISC 

. USB WRAPPER misc interrupt.

USBWRAP_INTR_MASK_MISC_RAW 

. USB WRAPPER misc RAW interrupt.

Enumerates the fields of wrapper MISC interrupts.

Enumerator
USBWRAP_INTR_MISC_IDPULLUP_FALL_EN 

. ID pullup control fall IRQ enable.

USBWRAP_INTR_MISC_DISCHRGVBUS_FALL_EN 

. Discharge VBUS control fall IRQ enable.

USBWRAP_INTR_MISC_CHRGVBUS_FALL_EN 

. Charge VBUS control fall IRQ enable.

USBWRAP_INTR_MISC_DRVVBUS_FALL_EN 

. Drive VBUS control fall IRQ enable.

USBWRAP_INTR_MISC_IDPULLUP_RISE_EN 

. ID pullup control rise IRQ enable.

USBWRAP_INTR_MISC_DISCHRGVBUS_RISE_EN 

. Discharge VBUS control rise IRQ enable.

USBWRAP_INTR_MISC_CHRGVBUS_RISE_EN 

. Charge VBUS control rise IRQ enable.

USBWRAP_INTR_MISC_DRVVBUS_RISE_EN 

. Drive VBUS control rise IRQ enable.

USBWRAP_INTR_MISC_OEVT_EN 

. OTG event in core, IRQ enable.

USBWRAP_INTR_MISC_DMADISABLECLR_EN 

. DMA-disable self-clear, IRQ enable.

Function Documentation

void USBWrapperClearUtmiFeature ( usbWrapper_t pWrapperObj,
uint32_t  utmiField 
)

This API clears a particular UTMI feature.

Parameters
pWrapperObjpointer to the wrapper object
utmiFieldUTMI feature which needs to be cleared. This is platform dependent would be implemented by the wrapper driver. As an example in the case of AM43xx it is -#usbwrapUtmiCfg_t.
usbWrapper_t* USBWrapperGetRevision ( usbWrapper_t pWrapperObj)

This API populates the revision number of the USB wrapper implement-.

  • ation in the required SOC.

Note1: wrapper implementations can implement hard checks for a revison match.

Parameters
pWrapperObjpointer to the wrapper object
Return values
pWrapperObjpointer to the wrapper object
uint32_t USBWrapperGetUtmiFeature ( usbWrapper_t pWrapperObj,
uint32_t  utmiField 
)

This API configures the wrapper.

Note1: wrapper implementations can implement hard checks for a revison match.

Parameters
pWrapperObjpointer to the wrapper object
utmiFieldUTMI feature which needs to be enabled. This is platform dependent would be implemented by the wrapper driver. As an example in the case of AM43xx it is -#usbwrapUtmiCfg_t.
Return values
regVal1or 0 standing for set or cleared.
uint32_t USBWrapperGetUtmiState ( usbWrapper_t pWrapperObj,
uint32_t  utmiField 
)

This API returns the current state of the UTMI phy.

Parameters
pWrapperObjpointer to the wrapper object
utmiFieldUTMI field whose status needs to be queried. This is platform dependent would be implemented by the wrapper driver. As an example in the case of AM43xx it is -#usbwrapUtmiCtrl_t.
Return values
Value1or 0 standing for set or cleared.
usbWrapper_t* USBWrapperInit ( usbWrapper_t pWrapperObj,
uint32_t  instNum 
)

This API returns the address of the required wrapper/controller instance .This is the first API that needs to be called as the address of the instance gets populated by this function.It also populates the params structure with the necessary param values which would be implemented by specific drivers.

Parameters
pWrapperObjpointer to the wrapper object
instNuminstance number of the controller/wrapper instance whose address is to be returned.
Return values
pWrapperObjpointer to the wrapper object
void USBWrapperIntrClear ( usbWrapper_t pWrapperObj,
uint32_t  intrMask 
)

This function flags the end of interrupt for all interrupts coming outof the wrapper. Note1: wrapper implementation need to take care to handle all possible interrupts, specifically USB core and miscelleous interrupts.

Parameters
pWrapperObjpointer to the wrapper object
intrMaskInterrupt that needs to be marked clear (EOI). This is platform dependent would be implemented by the wrapper driver. As an example in the case of AM43xx it is -usbwrapIntrMask_t.
void USBWrapperIntrDisable ( usbWrapper_t pWrapperObj,
uint32_t  intrMask,
uint32_t  intrSpecific 
)

This API disables interrupts coming out of the USB wrapper.

Note1: wrapper implementations have 2 kinds of interrupts - Core interrupts and wrapper interrupts.

Parameters
pWrapperObjpointer to the wrapper object
intrMaskInterrupt that needs to be marked clear (EOI). This is platform dependent would be implemented by the wrapper driver. As an example in the case of AM43xx it is -usbwrapIntrMask_t.
intrSpecificdetails of the interrupt which need to be modified
void USBWrapperIntrEnable ( usbWrapper_t pWrapperObj,
uint32_t  intrMask,
uint32_t  intrSpecific 
)

This API enables interrupts coming out of the USB wrapper.

Note1: wrapper implementations have 2 kinds of interrupts - Core interrupts and wrapper interrupts.

Parameters
pWrapperObjpointer to the wrapper object
intrMaskInterrupt that needs to be enabled. This is platform dependent would be implemented by the wrapper driver. As an example in the case of AM43xx it is -usbwrapIntrMask_t.
intrSpecificdetails of the interrupt which need to be modified
uint32_t USBWrapperIntrEnableStatus ( usbWrapper_t pWrapperObj,
uint32_t  intrMask,
uint32_t  intrSpecific 
)

This API returns the enable status of all interrupts coming out of the wrapper. Note1: wrapper implementations have 2 kinds of interrupts - Core interrupts and wrapper interrupts.

Parameters
pWrapperObjpointer to the wrapper object
intrMaskInterrupt that needs to be checked for enable/disable status. This is platform dependent would be implemented by the wrapper driver. As an example in the case of AM43xx it is -usbwrapIntrMask_t.
intrSpecificdetails of the interrupt which need to be probed
Return values
Value1or 0 standing for set or cleared.
uint32_t USBWrapperIntrStatus ( usbWrapper_t pWrapperObj,
uint32_t  intrMask 
)

This function returns the status (whether it has occured or not) for all interrupts coming outof the wrapper. Note1: wrapper implementation need to take care to handle all possible interrupts, specifically USB core and miscelleous interrupts.

Parameters
pWrapperObjpointer to the wrapper object
intrMaskInterrupt whose status needs to be returned. This is platform dependent would be implemented by the wrapper driver. As an example in the case of AM43xx it is -usbwrapIntrMask_t.
Return values
Value1or 0 standing for set or cleared.
void USBWrapperSetUtmiFeature ( usbWrapper_t pWrapperObj,
uint32_t  utmiField 
)

This API sets a particular UTMI feature.

Parameters
pWrapperObjpointer to the wrapper object
utmiFieldUTMI feature which needs to be enabled. This is platform dependent would be implemented by the wrapper driver. As an example in the case of AM43xx it is -#usbwrapUtmiCfg_t.
uint32_t USBWrapperSysConfig ( usbWrapper_t pWrapperObj,
uint32_t  mode,
uint32_t  ops 
)

This API configures the wrapper master slave interface parameters. PM mode configuration in master(initiator) and slave (local target) is done using this API.

Parameters
pWrapperObjpointer to the wrapper object
modeValue determining the System configuration field which would be read or written to. Values taken would be implementation specifc. As an example in the case of AM43xx -#usbwrapSyscfg_t.
opsOperations possible on the register fields Possible values are :
  • USB_SET_VALUE
  • USB_GET_VALUE
  • USB_CLEAR_VALUE
Return values
regValValue depends on the operation performed. As in if ops is USB_SET_VALUE - regVal has no significance USB_GET_VALUE - returns the value of the field asked for USB_CLEAR_VALUE - regVal has no significance
void USBWrapperTriggerIntr ( usbWrapper_t pWrapperObj,
uint32_t  intrMask,
uint32_t  intrSpecific 
)

This API triggers all interrupts coming out of the wrapper.

Note1: wrapper implementations have 2 kinds of interrupts - Core interrupts and wrapper interrupts.

Parameters
pWrapperObjpointer to the wrapper object
intrMaskInterrupt that needs to be triggered. This is platform dependent would be implemented by the wrapper driver. As an example in the case of AM43xx it is -usbwrapIntrMask_t.
intrSpecificdetails of the interrupt which need to be probed

Copyright 2016, Texas Instruments Incorporated