AM64x MCU+ SDK  08.02.00
usb_init.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
47 #ifndef INCLUDE_USB_INIT_PARAMS_H_
48 #define INCLUDE_USB_INIT_PARAMS_H_
49 
50 /* ========================================================================== */
51 /* Include Files */
52 /* ========================================================================== */
53 #include <stdint.h>
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 /* ========================================================================== */
60 /* Macros & Typedefs */
61 /* ========================================================================== */
62 
69 #define USB_INSTANCE_0 (0x00U)
70 
78 #define USB_CLK_SEL_HFOSC0_CLKOUT (0x00U)
79 
80 #define USB_CLK_SEL_HFOSC1_CLKOUT (0x01U)
81 
82 #define USB_MAIN_PLL3_HSDIV4_CLKOUT (0x02U)
83 
84 #define USB_MAIN_PLL2_HSDIV4_CLKOUT (0x03U)
85 
93 #define USB_PLL_REF_CLK_9P6MHZ (0x00)
94 
95 #define USB_PLL_REF_CLK_10MHZ (0x01)
96 
97 #define USB_PLL_REF_CLK_12MHZ (0x02)
98 
99 #define USB_PLL_REF_CLK_19P2MHZ (0x03)
100 
101 #define USB_PLL_REF_CLK_20MHZ (0x04)
102 
103 #define USB_PLL_REF_CLK_24MHZ (0x05)
104 
105 #define USB_PLL_REF_CLK_25MHZ (0x06)
106 
107 #define USB_PLL_REF_CLK_26MHZ (0x07)
108 
109 #define USB_PLL_REF_CLK_38P4MHZ (0x08)
110 
111 #define USB_PLL_REF_CLK_40MHZ (0x09)
112 
113 #define USB_PLL_REF_CLK_48MHZ (0x0A)
114 
115 #define USB_PLL_REF_CLK_50MHZ (0x0B)
116 
117 #define USB_PLL_REF_CLK_52MHZ (0x0C)
118 
126 #define USB_MODE_3P0 (0x0)
127 
128 #define USB_MODE_2P0 (0x1)
129 
137 #define USB_PIPE_RX_INVERT_POLARITY_DISABLED (0x0)
138 
139 #define USB_PIPE_RX_INVERT_POLARITY_ENABLED (0x1)
140 
148 #define USB_VBUS_EXT_DIV3_INACTIVE (0x0)
149 
150 #define USB_VBUS_EXT_DIV3_ACTIVE (0x1)
151 
159 #define USB_HOST_MODE_DISABLED (0x0)
160 
161 #define USB_HOST_MODE_ENABLED (0x1)
162 
164 /* ========================================================================== */
165 /* Structures and Enums */
166 /* ========================================================================== */
167 
169 typedef struct usb_init_param_s {
170  uint32_t instanceNum;
172  uint32_t clkSrcSel;
174  uint32_t pllRefSel;
176  uint32_t usb2Enable;
178  uint32_t invertPolarity;
180  uint32_t vbusSel;
182  uint32_t isHostMode;
185 
186 /* ========================================================================== */
187 /* Function Declarations */
188 /* ========================================================================== */
189 
201 void usb_init(usb_init_param_t *usbInitParamPtr);
202 
203 #ifdef __cplusplus
204 }
205 #endif /* __cplusplus */
206 
207 #endif /* INCLUDE_USB_INIT_PARAMS_H_ */
208 
usb_init_param_t::usb2Enable
uint32_t usb2Enable
Definition: usb_init.h:176
usb_init_param_t::vbusSel
uint32_t vbusSel
Definition: usb_init.h:180
usb_init_param_t::clkSrcSel
uint32_t clkSrcSel
Definition: usb_init.h:172
usb_init
void usb_init(usb_init_param_t *usbInitParamPtr)
USB Initialization function.
usb_init_param_t
USB intialization parameter block.
Definition: usb_init.h:169
usb_init_param_t::isHostMode
uint32_t isHostMode
Definition: usb_init.h:182
usb_init_param_t::instanceNum
uint32_t instanceNum
Definition: usb_init.h:170
usb_init_param_t::pllRefSel
uint32_t pllRefSel
Definition: usb_init.h:174
usb_init_param_t::invertPolarity
uint32_t invertPolarity
Definition: usb_init.h:178