配置如下: if(2400 == DEBUG_UART_BAUDRATE) { uint16_t baud_divisor = 4;
cpm_set_clock(CPM_UART1_CLK,baud_divisor*DEBUG_UART_BAUDRATE*16); /* Baud rate setting.*/ HS_UART1->LCR = UART_LCR_DLAB; HS_UART1->DLL = baud_divisor & 0xff; HS_UART1->DLH = (baud_divisor >> 8) & 0xff; /* 8 data, 1 stop, no parity */ HS_UART1->LCR = UART_LCR_8N1; } |