- No category
advertisement
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
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
advertisement
Table of contents
- 8 Reference information
- 8 Glossary
- 9 USB host and device library overview
- 9 Main features
- 10 USB host and device library folder structure
- 11 USB OTG core
- 11 USB OTG full speed core
- 11 OTG_FS interface main features
- 11 USB OTG high speed core
- 13 USB OTG low level driver
- 13 USB OTG low level driver architecture
- 13 USB OTG low level driver files
- 14 USB OTG low level driver configuration
- 15 USB OTG driver programming manual
- 15 Low level driver structures
- 15 Programming considerations when using internal DMA
- 17 Selecting USB physical interface
- 17 Programming device drivers
- 20 Programming host drivers
- 23 USB device library
- 23 USB device library overview
- 24 USB device library files
- 24 USB device library description
- 24 USB device library flow
- 27 USB device library process
- 28 USB device data flow
- 29 USB device library configuration
- 29 USB data transfer handling
- 30 Using the multi-packet feature
- 30 USB control functions
- 30 FIFO size customization
- 32 USB device library functions
- 35 USB device class interface
- 36 USB device user interface
- 38 USB device classes
- 39 HID class
- 40 Mass storage class
- 45 Device firmware upgrade (DFU) class
- 52 Audio class
- 56 Communication device class (CDC)
- 61 Adding a custom class
- 62 Application layer description
- 63 Starting the USB device library
- 64 USB device examples
- 64 USB mass storage device example
- 65 USB human interface device example
- 67 Dual core USB device example
- 68 USB device firmware upgrade example
- 70 USB virtual com port (VCP) device example
- 73 USB audio device example
- 74 Known limitations
- 75 USB host library
- 75 Overview
- 76 USB host library files
- 77 USB host library description
- 77 Host core state machine
- 78 Device enumeration
- 79 Control transfer state machine
- 79 USB I/O request module
- 79 Host channel control module
- 79 USB host library configuration
- 79 USB host library functions
- 81 USB host class interface
- 81 USB host classes
- 81 Mass storage class
- 85 HID class
- 88 USB host user interface
- 88 Library user API
- 88 User callback functions
- 88 Class callback functions
- 92 Application layer description
- 93 Starting the USB host library
- 94 USB host examples
- 95 USB mass storage host example
- 98 USB HID Host example
- 99 USB dual core host example
- 100 USB manual dual role device example
- 102 Frequently-asked questions
- 105 Troubleshooting
- 106 Revision history