/* param base LPUART peripheral base address. param handle LPUART handle pointer. param xfer LPUART transfer structure, see #lpuart_transfer_t. retval kStatus_Success Successfully start the data transmission. retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. retval kStatus_InvalidArgument Invalid argument.  */
status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer)
/* param base LPUART peripheral base address. param handle LPUART handle pointer. param xfer LPUART transfer structure, see #lpuart_transfer_t. retval kStatus_Success Successfully start the data transmission. retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. retval kStatus_InvalidArgument Invalid argument.  */
status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer)
{
    assert(NULL != handle);
    assert(NULL != xfer);
    assert(NULL != xfer->txData);
    assert(0U != xfer->dataSize);
    status_t status;
    if ((uint8_t)kLPUART_TxBusy == handle->txState)
    {
        status = kStatus_LPUART_TxBusy;
    }
    else
    {
        handle->txData        = xfer->txData;
        handle->txDataSize    = xfer->dataSize;
        handle->txDataSizeAll = xfer->dataSize;
        handle->txState       = (uint8_t)kLPUART_TxBusy;
        uint32_t irqMask = DisableGlobalIRQ();
        base->CTRL |= (uint32_t)LPUART_CTRL_TIE_MASK;
        EnableGlobalIRQ(irqMask);
        status = kStatus_Success;
    }
    return status;
}