//库函数配置 UART1_DeInit(); UART1_Init((u32)1000000, UART1_WORDLENGTH_8D, UART1_STOPBITS_1, UART1_PARITY_NO , UART1_SYNCMODE_CLOCK_DISABLE , UART1_MODE_TXRX_ENABLE); UART1_ITConfig(UART1_IT_RXNE_OR,ENABLE ); UART1_Cmd(ENABLE ); //寄存器配置 //UART1->CR1 |= 0X00; //UART1->CR3 |= 0X00; UART1->CR2 = 0X2C; UART1->BRR2 = 0x00; UART1->BRR1 = 0x01; //1Mbps UART1->CR1 &= (uint8_t)(~0X20);//enable uart1
时间: 2024-10-02 13:14:09