UxTX, UxRX and UxBCLK pins are enabled and used; UxCTS is controlled by corresponding bits in the PORTx register 使能并使用 UxTX、 UxRX 和 UxBCLK 引脚; UxCTS 引脚由 PORTx 寄存器中的相应位控制
UxTX, UxRX , UxCTS and UxRTS pins are enabled and used 使能并使用 UxTX、 UxRX、 UxCTS 和 UxRTS 引脚
UxTX ,UxRX and UxRTS pins are enabled and used; UxCTS is controlled by corresponding bits in the PORTx register 使能并使用 UxTX、 UxRX 和 UxRTS 引脚; UxCTS 引脚由 PORTx 寄存器中的相应位控制
UxTX and UxRX pins are enabled and used; UxCTS and UxRTS/UxBCLK pins are controlled by corresponding bits in the PORTx register使能并使用UxTX和UxRX引脚;UxCTS和UxRTS/UxBCLK引脚由PORTx寄存器中的相应位控制
if(lBuffer != NULL)
{
/* Check if receive request is in progress */
if(uart1Obj.rxBusyStatus == false)
{
/* Clear error flags and flush out error data that may have been received when no active request was pending */
UART1_ErrorClear();
//串口读取中止
bool UART1_ReadAbort(void)
{
if (uart1Obj.rxBusyStatus == true)
{
/* Disable the fault interrupt */
IEC0CLR = _IEC0_U1EIE_MASK; //错误中断允许控制位
/* Disable the receive interrupt */
IEC0CLR = _IEC0_U1RXIE_MASK; //接收中断允许控制位
uart1Obj.rxBusyStatus = false;
/* If required application should read the num bytes processed prior to calling the read abort API */
uart1Obj.rxSize = uart1Obj.rxProcessedSize = 0;
}
/* Clear UART1TX Interrupt flag */
IFS0CLR = _IFS0_U1TXIF_MASK;
/* Check if the buffer is done */
if(uart1Obj.txProcessedSize >= uart1Obj.txSize)
{
uart1Obj.txBusyStatus = false;
/* Disable the transmit interrupt, to avoid calling ISR continuously */
IEC0CLR = _IEC0_U1TXIE_MASK; //发送中断标志状态位
if(uart1Obj.txCallback != NULL)
{
uart1Obj.txCallback(uart1Obj.txContext);
}
}
}
else
{
// Nothing to process
;
}
}
//串口服务函数
void UART_1_InterruptHandler (void)
{
/* Call Error handler if Error interrupt flag is set */
if ((IFS0 & _IFS0_U1EIF_MASK) && (IEC0 & _IEC0_U1EIE_MASK))
{
UART1_FAULT_InterruptHandler();
}
/* Call RX handler if RX interrupt flag is set */
if ((IFS0 & _IFS0_U1RXIF_MASK) && (IEC0 & _IEC0_U1RXIE_MASK))
{
UART1_RX_InterruptHandler();
}
/* Call TX handler if TX interrupt flag is set */
if ((IFS0 & _IFS0_U1TXIF_MASK) && (IEC0 & _IEC0_U1TXIE_MASK))
{
UART1_TX_InterruptHandler();
}
}