UM1021 - STMicroelectronics

Add to my manuals
107 Pages

advertisement

UM1021 - STMicroelectronics | Manualzz

UM1021 USB OTG low level driver

Table 3.

Core configurations (continued)

Define

TXH_NP_HS_FIFOSIZ

Description

Sets the non-periodic Transmit FIFO size for Host mode (High Speed core).

Sets the Periodic Transmit FIFO size for Host mode (Full Speed).

Sets the Periodic Transmit FIFO size for Host mode (High Speed core).

TXH_P_FS_FIFOSIZ

TXH_P_HS_FIFOSIZ

USB_OTG_ULPI_PHY_

ENABLED

USB_OTG_EMBEDDED_

PHY_ENABLED

USB_OTG_HS_LOW_PW

R_MGMT_SUPPORT

USB_OTG_FS_LOW_PW

R_MGMT_SUPPORT

USB_OTG_HS_INTERN

AL_DMA_ENABLED

USB_OTG_HS_DEDICA

TED_EP1_ENABLED

Enables the ULPI PHY for High Speed core.

Enables the embedded FS PHY for High Speed core.

Enables low power management for High Speed core (USB Core clock gating, etc.).

Enables low power management for Full Speed core (USB Core clock gating, etc.).

Enables the internal DMA feature for High Speed core.

Enables the dedicated Endpoint 1 feature for Device mode in High Speed core.

5.4

5.4.1

USB OTG driver programming manual

Low level driver structures

The low level driver does not have any exportable variables. A global structure

(USB_OTG_CORE_HANDLE) which keeps all the variables, state and buffers used by the core to handle its internal state and transfer flow, should be used to allocate in the application layer the handle instance for the core to be used.

This method allows the application to use the same low level driver for both high- and Full

Speed cores in the same project.

The global USB core structure is defined as follows: typedef struct USB_OTG_handle

{

USB_OTG_CORE_CFGS cfg;

USB_OTG_CORE_REGS regs;

#ifdef USE_DEVICE_MODE

DCD_DEV dev;

#endif

#ifdef USE_HOST_MODE

HCD_DEV host;

#endif

#ifdef USE_OTG_MODE

OTG_DEV otg;

#endif

}

USB_OTG_CORE_HANDLE, *PUSB_OTG_CORE_HANDLE;

When using the internal DMA with the USB OTG High Speed core, all structures dealing with the DMA (data buffer) during the transaction process should be 32-bit aligned.

Doc ID 18153 Rev 3 15/107

USB OTG low level driver UM1021

Consequently, the USB_OTG_handle structure is defined to keep all the internal buffers and variables used to hold the data to be transferred 32-bit aligned.

When the internal DMA is used, the global USB Core structure should be declared as follows:

Figure 5.

USB core structure

Note:

__ALIGN_BEGIN

and __ALIGN_END are compiler-specific keywords defined in the

usb_conf.h file and are used to align variables on a 32-bit boundary.

Figure 6.

C compiler-dependant keywords (defined in usb_conf.h file)

16/107 Doc ID 18153 Rev 3

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Download PDF

advertisement

Table of contents