image.png

    附:圈四:串口参数初始化:

    1. USART_InitTypeDef USART_InitStructure; //定义结构体
    2. USART_InitStructure.USART_BaudRate = bound;//串口波特率
    3. USART_InitStructure.USART_WordLength = USART_WordLength_8b;//字长为8位数据格式
    4. USART_InitStructure.USART_StopBits = USART_StopBits_1;//一个停止位
    5. USART_InitStructure.USART_Parity = USART_Parity_No;//无奇偶校验位
    6. USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//无硬件数据流控制
    7. USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //收发模式