/* retval kStatus_Success Started successfully. retval kStatus_CSI_NoFullBuffer There is no full frame buffer in queue.  */
status_t CSI_TransferGetFullBuffer(CSI_Type *base, csi_handle_t *handle, uint32_t *frameBuffer)
/* retval kStatus_Success Started successfully. retval kStatus_CSI_NoFullBuffer There is no full frame buffer in queue.  */
status_t CSI_TransferGetFullBuffer(CSI_Type *base, csi_handle_t *handle, uint32_t *frameBuffer)
{
    uint32_t csicr1;
    status_t status;
    uint8_t queueReadIdx;
    uint8_t queueWriteIdx;
    queueReadIdx  = handle->queueReadIdx;
    queueWriteIdx = handle->queueWriteIdx;
    if (queueReadIdx == queueWriteIdx)
    {
        status = kStatus_CSI_NoFullBuffer;
    }
    else
    {
        csicr1 = CSI_REG_CR1(base);
        CSI_REG_CR1(base) = (csicr1 & ~(CSI_CSICR1_FB2_DMA_DONE_INTEN_MASK | CSI_CSICR1_FB1_DMA_DONE_INTEN_MASK));
        *frameBuffer = handle->frameBufferQueue[handle->queueReadIdx];
        handle->queueReadIdx = CSI_TransferIncreaseQueueIdx(handle->queueReadIdx);
        CSI_REG_CR1(base) = csicr1;
        status = kStatus_Success;
    }
    return status;
}