/* param base UART peripheral base address. param handle UART handle pointer. param ringBuffer Start address of the ring buffer for background receiving. Pass NULL to disable the ring buffer. param ringBufferSize Size of the ring buffer.  */
void UART_TransferStartRingBuffer(UART_Type *base, uart_handle_t *handle, uint8_t *ringBuffer, size_t ringBufferSize)
/* param base UART peripheral base address. param handle UART handle pointer. param ringBuffer Start address of the ring buffer for background receiving. Pass NULL to disable the ring buffer. param ringBufferSize Size of the ring buffer.  */
void UART_TransferStartRingBuffer(UART_Type *base, uart_handle_t *handle, uint8_t *ringBuffer, size_t ringBufferSize)
{
    assert(handle);
    assert(ringBuffer);
    handle->rxRingBuffer = ringBuffer;
    handle->rxRingBufferSize = ringBufferSize;
    handle->rxRingBufferHead = 0U;
    handle->rxRingBufferTail = 0U;
    UART_EnableInterrupts(
        base, kUART_RxDataRegFullInterruptEnable | kUART_RxOverrunInterruptEnable | kUART_FramingErrorInterruptEnable);
    if (UART_C1_PE_MASK & base->C1)
    {
        UART_EnableInterrupts(base, kUART_ParityErrorInterruptEnable);
    }
}