|
楼主 |
发表于 2024-11-13 15:57:07
|
显示全部楼层
uart_set_pin(UART0_TX_PIN,UART0_RX_PIN);
uart_cal_div_and_bwpc(115200, sys_clk.pclk*1000*1000, &div, &bwpc);
uart_init(UART_MODULE_SEL, div, bwpc, UART_PARITY_NONE, UART_STOP_BIT_ONE);
uart_tx_irq_trig_level(UART_MODULE_SEL, 0);
uart_rx_irq_trig_level(UART_MODULE_SEL, uart_rx_trig_level);
uart_set_irq_mask(UART_MODULE_SEL, UART_RX_IRQ_MASK|UART_ERR_IRQ_MASK);
uart_set_rx_timeout(UART_MODULE_SEL, bwpc, 12, UART_BW_MUL2); |
|