- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12;
- GPIO_Init(GPIOA, &GPIO_InitStructure);
+ GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
+ GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
+ GPIO_Init(GPIOB, &GPIO_InitStructure);
+
+ /* Connect USART pins to AF */
+ GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_USART1); // USART1_TX
+ GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_USART1); // USART1_RX
+}
+
+/**************************************************************************************/
+
+void USART1_Configuration(void)
+{
+ USART_InitTypeDef USART_InitStructure;
+
+ /* USARTx configuration ------------------------------------------------------*/
+ /* USARTx configured as follow:
+ - BaudRate = 115200 baud
+ - Word Length = 8 Bits
+ - One Stop Bit
+ - No parity
+ - Hardware flow control disabled (RTS and CTS signals)
+ - Receive and transmit enabled
+ */
+ //USART_InitStructure.USART_BaudRate = 9600;
+ //USART_InitStructure.USART_BaudRate = 10000; //Close enough to 9600
+ //USART_InitStructure.USART_BaudRate = 115200;
+ //USART_InitStructure.USART_BaudRate = 125200; //Close enough to 115200