UART_UART_INIT_STRUCT configUart;//定义一个全局的结构体变量
/******************************************************************************
* Function Name: ConfigUartInit
***************************************************************************//**
*
* UART配置初始化
*
* \return
* None
*
******************************************************************************/
void ConfigUartInit(void)
{
configUart.mode=UART_UART_MODE_STD; /* mode: Standard */
configUart.direction=UART_UART_TX_RX; /* direction: RX + TX */
configUart.dataBits=8; /* dataBits: 8 bits */
configUart.parity=UART_UART_PARITY_NONE; /* parity: None */
configUart.stopBits=UART_UART_STOP_BITS_1; /* stopBits: 1 bit */
configUart.oversample=16; /* oversample: 16u */
configUart.enableIrdaLowPower=0; /* enableIrdaLowPower: disable */
configUart.enableMedianFilter=1; /* enableMedianFilter: enable */
configUart.enableRetryNack=0; /* enableRetryNack: disable */
configUart.enableInvertedRx=0; /* enableInvertedRx: disable */
configUart.dropOnParityErr=0; /* dropOnParityErr: disable */
configUart.dropOnFrameErr=0; /* dropOnFrameErr: disable */
configUart.enableWake=0; /* enableWake: disable */
configUart.rxBufferSize=UART_BUFFER_SIZE; /* rxBufferSize: software buffer 10 bytes */
configUart.rxBuffer=bufferRx; /* rxBuffer: RX software buffer enable */
configUart.txBufferSize=UART_BUFFER_SIZE; /* txBufferSize: software buffer 10 bytes */
configUart.txBuffer=bufferTx; /* txBuffer: TX software buffer enable */
configUart.enableMultiproc=0; /* enableMultiproc: disable */
configUart.multiprocAcceptAddr=0; /* multiprocAcceptAddr: disable */
configUart.multiprocAddr=0; /* multiprocAddr: N/A for this configuration */
configUart.multiprocAddrMask=0; /* multiprocAddrMask: N/A for this configuration */
configUart.enableInterrupt=1; /* enableInterrupt: enable to process software buffer */
configUart.rxInterruptMask=UART_INTR_RX_NOT_EMPTY; /* rxInterruptMask: enable NOT_EMPTY for RX software buffer operations */
configUart.rxTriggerLevel=0; /* rxTriggerLevel: N/A for this configuration */
configUart.txInterruptMask=0; /* txInterruptMask: NOT_FULL is enabled when there is data to transmit */
configUart.txTriggerLevel=0; /* txTriggerLevel: N/A for this configuration */
}