本帖最后由 stjohn1650 于 2012-2-1 18:59 编辑
STR_UART_T uart_arg;
/*--------------------配置UART波特率、数据位等信息-------------------*/
uart_arg.u32BaudRate = 1200; //波特率9600,可配置
uart_arg.u8cDataBits = DRVUART_DATABITS_8; //数据位设定:8数据位
uart_arg.u8cStopBits = DRVUART_STOPBITS_1; //停止位设定:1停止位
uart_arg.u8cParity = DRVUART_PARITY_NONE; //无奇偶校验
uart_arg.u8cRxTriggerLevel = DRVUART_FIFO_1BYTES; //1字节触发接收中断
if(DrvUART_Open(UART_PORT0,&uart_arg) != E_SUCCESS)
{
return FALSE;
}
DrvUART_EnableInt(UART_PORT0, DRVUART_RDAINT,UART0_INT_HANDLE); //使能UART中断,单字节中断
|