169 GPIO_InitTypeDef GPIO_InitStruct;
171 if (huart->Instance == USART1) {
173 __USART1_CLK_ENABLE();
184 GPIO_InitStruct.Pin = ZYNQ_CONSOLE_TX_Pin|ZYNQ_CONSOLE_RX_Pin;
185 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
186 GPIO_InitStruct.Pull = GPIO_PULLUP;
187 GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
188 GPIO_InitStruct.Alternate = GPIO_AF0_USART1;
189 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
192 HAL_NVIC_SetPriority(USART1_IRQn, 1, 0);
193 HAL_NVIC_EnableIRQ(USART1_IRQn);
195 }
else if (huart->Instance == USART2) {
197 __USART2_CLK_ENABLE();
209 GPIO_InitStruct.Pin = BT_HCI_RX_Pin|BT_HCI_TX_Pin;
210 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
211 GPIO_InitStruct.Pull = GPIO_PULLUP;
212 GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
213 GPIO_InitStruct.Alternate = GPIO_AF0_USART2;
214 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
216 GPIO_InitStruct.Pin = BT_HCI_CTS_Pin|BT_HCI_RTS_Pin;
217 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
218 GPIO_InitStruct.Pull = GPIO_NOPULL;
219 GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
220 GPIO_InitStruct.Alternate = GPIO_AF0_USART2;
221 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
224 HAL_NVIC_SetPriority(USART2_IRQn, 0, 0);
225 HAL_NVIC_EnableIRQ(USART2_IRQn);
227 }
else if (huart->Instance == USART3) {
229 __USART3_CLK_ENABLE();
239 GPIO_InitStruct.Pin = WL_RS232_TX_Pin | WL_RS232_RX_Pin;
240 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
241 GPIO_InitStruct.Pull = GPIO_PULLUP;
242 GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
243 GPIO_InitStruct.Alternate = GPIO_AF0_USART3;
244 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
247 HAL_NVIC_SetPriority(USART3_4_IRQn, 0, 0);
248 HAL_NVIC_EnableIRQ(USART3_4_IRQn);