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),發(fā)送數據后,對方返回數據不會觸發(fā)UART0_IRQHandler中斷,而同樣的代碼和硬件連接CH583F卻可以呢?
熱門產品 :
CH641: PD及無線充電專用MCU