/* USART 1 配置
使用奇数校验或者偶数校验时,需要把数据长度定位9bit!
*/
USART_InitStructure.USART_BaudRate =115200;
USART_InitStructure.USART_WordLength =USART_WordLength_9b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_Even;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
STM_EVAL_COMInit(COM1, &USART_InitStructure);
/*使能USART1的接收中断*/
USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);
/* USART 1 配置
使用奇数校验或者偶数校验时,需要把数据长度定位9bit!
*/
USART_InitStructure.USART_BaudRate =115200;
USART_InitStructure.USART_WordLength =USART_WordLength_9b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_Even;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
STM_EVAL_COMInit(COM1, &USART_InitStructure);
/*使能USART1的接收中断*/
USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);
举报