当我初始化串口时,因为对库函数不熟,没有找到
对CR2操作的函数或方式,只有这样USART->CR2 |= 0xAC;
但是我在寄存器窗口看,没有变化啊!!!
请老师指点一下。
void UartInit(void) { // Initial RST stat USART_DeInit(); USART_Cmd(ENABLE); // 9600,1,0 RX TX Interrupt Enable USART_Init((u32)9600, USART_WORDLENGTH_8D, USART_STOPBITS_1, USART_PARITY_NO, USART_SYNCMODE_CLOCK_DISABLE, (USART_MODE_TX_DISABLE | USART_MODE_RX_ENABLE)); USART->CR2 |= 0xAC;
// Enable the USART Receive interrupt: this interrupt is generated when the USART receive data register is not empty USART_ITConfig(USART_IT_RXNE_OR, ENABLE); } |