void app_uart_init() { //tx fifo and tx fifo //The buffer length should be a power of 2 app_drv_fifo_init(&app_uart_tx_fifo, app_uart_tx_buffer, APP_UART_TX_BUFFER_LENGTH); app_drv_fifo_init(&app_uart_rx_fifo, app_uart_rx_buffer, APP_UART_RX_BUFFER_LENGTH); //uart tx io GPIOB_SetBits(bTXD0); GPIOB_ModeCfg(bTXD0, GPIO_ModeOut_PP_5mA); //uart rx io GPIOB_SetBits(bRXD0); GPIOB_ModeCfg(bRXD0, GPIO_ModeIN_PU); //uart0 init UART0_DefInit(); R8_UART0_MCR = RB_MCR_HALF; PRINT("R8_UART0_MCR:%x\r\n", R8_UART0_MCR); //enable interupt UART0_INTCfg(ENABLE, RB_IER_RECV_RDY | RB_IER_LINE_STAT); PFIC_EnableIRQ(UART0_IRQn); PRINT("R8_UART0_MCR:%x\r\n", R8_UART0_MCR); }
将UART0设置为RB_MCR_HALF 半双工模式(RX跟TX连接在一起,使用PB4和PB7),发送数据后,对方返回数据不会触发UART0_IRQHandler中断,而同样的代码和硬件连接CH583F却可以呢?
热门产品 :
USB3.0 HUB控制器:CH634