2 ******************************************************************************
4 * Description : This file provides code for the configuration
5 * of all used GPIO pins.
6 ******************************************************************************
9 * <h2><center>© Copyright (c) 2021 STMicroelectronics.
10 * All rights reserved.</center></h2>
12 * This software component is licensed by ST under Ultimate Liberty license
13 * SLA0044, the "License"; You may not use this file except in compliance with
14 * the License. You may obtain a copy of the License at:
17 ******************************************************************************
20 /* Includes ------------------------------------------------------------------*/
22 /* USER CODE BEGIN 0 */
26 /*----------------------------------------------------------------------------*/
28 /*----------------------------------------------------------------------------*/
29 /* USER CODE BEGIN 1 */
39 * Free pins are configured automatically as Analog (this feature is enabled through
40 * the Code Generation settings)
43 void MX_GPIO_Init(void)
46 GPIO_InitTypeDef GPIO_InitStruct = {0};
48 /* GPIO Ports Clock Enable */
49 __HAL_RCC_GPIOE_CLK_ENABLE();
50 __HAL_RCC_GPIOC_CLK_ENABLE();
51 __HAL_RCC_GPIOH_CLK_ENABLE();
52 __HAL_RCC_GPIOA_CLK_ENABLE();
53 __HAL_RCC_GPIOB_CLK_ENABLE();
54 __HAL_RCC_GPIOD_CLK_ENABLE();
56 /*Configure GPIO pin Output Level */
57 HAL_GPIO_WritePin(GPIOA, nULPI_RESET_Pin|nSPICFG_CS_Pin, GPIO_PIN_RESET);
59 /*Configure GPIO pin Output Level */
60 HAL_GPIO_WritePin(GPIOB, nTERM_EN_Pin|LED_IO_Pin, GPIO_PIN_RESET);
62 /*Configure GPIO pin Output Level */
63 HAL_GPIO_WritePin(FPGA_RST_GPIO_Port, FPGA_RST_Pin, GPIO_PIN_RESET);
65 /*Configure GPIO pins : PEPin PEPin */
66 GPIO_InitStruct.Pin = FPGA_GPIO2_Pin|UNUSED_PE6_Pin;
67 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
68 GPIO_InitStruct.Pull = GPIO_PULLDOWN;
69 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
71 /*Configure GPIO pin : PtPin */
72 GPIO_InitStruct.Pin = FPGA_GPIO3_Pin;
73 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
74 GPIO_InitStruct.Pull = GPIO_NOPULL;
75 HAL_GPIO_Init(FPGA_GPIO3_GPIO_Port, &GPIO_InitStruct);
77 /*Configure GPIO pin : PE4 */
78 GPIO_InitStruct.Pin = GPIO_PIN_4;
79 GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
80 GPIO_InitStruct.Pull = GPIO_NOPULL;
81 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
83 /*Configure GPIO pin : PtPin */
84 GPIO_InitStruct.Pin = USB_ID_PASSTHRU_Pin;
85 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
86 GPIO_InitStruct.Pull = GPIO_NOPULL;
87 HAL_GPIO_Init(USB_ID_PASSTHRU_GPIO_Port, &GPIO_InitStruct);
89 /*Configure GPIO pins : PC13 PC14 PC15 PC1 */
90 GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_1;
91 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
92 GPIO_InitStruct.Pull = GPIO_NOPULL;
93 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
95 /*Configure GPIO pins : PAPin PAPin */
96 GPIO_InitStruct.Pin = nULPI_RESET_Pin|nSPICFG_CS_Pin;
97 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
98 GPIO_InitStruct.Pull = GPIO_NOPULL;
99 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
100 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
102 /*Configure GPIO pins : PCPin PCPin */
103 GPIO_InitStruct.Pin = VER_ID1_Pin|VER_ID2_Pin;
104 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
105 GPIO_InitStruct.Pull = GPIO_PULLUP;
106 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
108 /*Configure GPIO pin : PtPin */
109 GPIO_InitStruct.Pin = nTERM_EN_Pin;
110 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
111 GPIO_InitStruct.Pull = GPIO_NOPULL;
112 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
113 HAL_GPIO_Init(nTERM_EN_GPIO_Port, &GPIO_InitStruct);
115 /*Configure GPIO pin : PtPin */
116 GPIO_InitStruct.Pin = LED_IO_Pin;
117 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
118 GPIO_InitStruct.Pull = GPIO_PULLDOWN;
119 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
120 HAL_GPIO_Init(LED_IO_GPIO_Port, &GPIO_InitStruct);
122 /*Configure GPIO pins : PD11 PDPin */
123 GPIO_InitStruct.Pin = GPIO_PIN_11|NWAIT_UNUSED_Pin;
124 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
125 GPIO_InitStruct.Pull = GPIO_NOPULL;
126 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
128 /*Configure GPIO pin : PtPin */
129 GPIO_InitStruct.Pin = FPGA_RST_Pin;
130 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
131 GPIO_InitStruct.Pull = GPIO_NOPULL;
132 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
133 HAL_GPIO_Init(FPGA_RST_GPIO_Port, &GPIO_InitStruct);
135 /*Configure GPIO pins : PCPin PCPin */
136 GPIO_InitStruct.Pin = nFGPA_CRESET_B_Pin|nFGPA_CDONE_Pin;
137 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
138 GPIO_InitStruct.Pull = GPIO_NOPULL;
139 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
141 /*Configure GPIO pin : PA8 */
142 GPIO_InitStruct.Pin = GPIO_PIN_8;
143 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
144 GPIO_InitStruct.Pull = GPIO_NOPULL;
145 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
146 GPIO_InitStruct.Alternate = GPIO_AF0_MCO;
147 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
149 /*Configure GPIO pin : PtPin */
150 GPIO_InitStruct.Pin = OTG_FS_VBUS_UNUSED_Pin;
151 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
152 GPIO_InitStruct.Pull = GPIO_NOPULL;
153 HAL_GPIO_Init(OTG_FS_VBUS_UNUSED_GPIO_Port, &GPIO_InitStruct);
155 /*Configure GPIO pin : PtPin */
156 GPIO_InitStruct.Pin = FMC_UNUSED_CLK_Pin;
157 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
158 GPIO_InitStruct.Pull = GPIO_PULLDOWN;
159 HAL_GPIO_Init(FMC_UNUSED_CLK_GPIO_Port, &GPIO_InitStruct);
161 /*Configure GPIO pin : PB6 */
162 GPIO_InitStruct.Pin = GPIO_PIN_6;
163 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
164 GPIO_InitStruct.Pull = GPIO_NOPULL;
165 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
167 /*Configure GPIO pins : PBPin PBPin */
168 GPIO_InitStruct.Pin = nSD_WP_Pin|nSD_CD_Pin;
169 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
170 GPIO_InitStruct.Pull = GPIO_PULLUP;
171 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
173 /* EXTI interrupt init*/
174 HAL_NVIC_SetPriority(EXTI4_IRQn, 10, 0);
175 HAL_NVIC_EnableIRQ(EXTI4_IRQn);
179 /* USER CODE BEGIN 2 */
181 /* USER CODE END 2 */
183 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/