![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
dongyanzhi gps
Fork of Nucleo_printf_test by
Diff: usart.c
- Revision:
- 0:3ba942901d6e
diff -r 000000000000 -r 3ba942901d6e usart.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usart.c Fri Jun 09 02:45:45 2017 +0000 @@ -0,0 +1,28 @@ +#include "usart.h" + +void UsartConfig() +{ + USART_InitTypeDef UsartInitStruct; + USART_HandleTypeDef UsartHandleStruct; + + UsartInitStruct.BaudRate = 9600; + UsartInitStruct.CLKLastBit = USART_LASTBIT_DISABLE; + UsartInitStruct.CLKPhase = USART_PHASE_1EDGE; + UsartInitStruct.CLKPolarity = USART_PHASE_1EDGE; + UsartInitStruct.Mode = USART_MODE_TX_RX; + UsartInitStruct.Parity = USART_PARITY_NONE; + UsartInitStruct.StopBits = USART_STOPBITS_1; + UsartInitStruct.WordLength = USART_WORDLENGTH_8B; + + UsartHandleStruct.Init = UsartInitStruct; + UsartHandleStruct.Instance = USART2; + UsartHandleStruct.Lock = HAL_LOCKED; + UsartHandleStruct.pRxBuffPtr =NULL ; + UsartHandleStruct.pTxBuffPtr =NULL; + UsartHandleStruct.RxXferCount =NULL ; + UsartHandleStruct.RxXferSize =NULL ; + UsartHandleStruct.TxXferCount =NULL ; + UsartHandleStruct.TxXferSize =NULL ; + UsartHandleStruct.State = HAL_USART_STATE_READY; + +} \ No newline at end of file