gprs
Fork of Nucleo_printf_test by
usart.c
- Committer:
- dongyanzhi
- Date:
- 2017-06-09
- Revision:
- 0:3ba942901d6e
- Child:
- 1:78ed2d2c5af7
File content as of revision 0:3ba942901d6e:
#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; }