STM32 串口通信使用奇偶校验

  • STM32串口通信如果使用奇偶校验,需要设置数据位长度为9bit
	
USART_InitStructure.USART_BaudRate = 9600;             
USART_InitStructure.USART_WordLength = USART_WordLength_9b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_Odd;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
USART_Init( USART3, &USART_InitStructure);			
posted @ 2017-08-05 18:44  mr-xbt  阅读(3439)  评论(0编辑  收藏  举报