/* param base UART peripheral base address. param handle UART handle pointer. param xfer UART transfer structure. See #uart_transfer_t. retval kStatus_Success Successfully start the data transmission. retval kStatus_UART_TxBusy Previous transmission still not finished; data not all written to TX register yet. retval kStatus_InvalidArgument Invalid argument.  */
status_t UART_TransferSendNonBlocking(UART_Type *base, uart_handle_t *handle, uart_transfer_t *xfer)
/* param base UART peripheral base address. param handle UART handle pointer. param xfer UART transfer structure. See #uart_transfer_t. retval kStatus_Success Successfully start the data transmission. retval kStatus_UART_TxBusy Previous transmission still not finished; data not all written to TX register yet. retval kStatus_InvalidArgument Invalid argument.  */
status_t UART_TransferSendNonBlocking(UART_Type *base, uart_handle_t *handle, uart_transfer_t *xfer)
{
    assert(handle);
    assert(xfer);
    assert(xfer->dataSize);
    assert(xfer->data);
    status_t status;
    if (kUART_TxBusy == handle->txState)
    {
        status = kStatus_UART_TxBusy;
    }
    else
    {
        handle->txData = xfer->data;
        handle->txDataSize = xfer->dataSize;
        handle->txDataSizeAll = xfer->dataSize;
        handle->txState = kUART_TxBusy;
        UART_EnableInterrupts(base, kUART_TxDataRegEmptyInterruptEnable);
        status = kStatus_Success;
    }
    return status;
}