/* param base CSI peripheral base address. param fifo The FIFO to clear.  */
void CSI_ClearFifo(CSI_Type *base, csi_fifo_t fifo)
/* param base CSI peripheral base address. param fifo The FIFO to clear.  */
void CSI_ClearFifo(CSI_Type *base, csi_fifo_t fifo)
{
    uint32_t cr1;
    uint32_t mask = 0U;
    cr1 = base->CSICR1;
    base->CSICR1 = (cr1 & ~CSI_CSICR1_FCC_MASK);
    if ((uint32_t)fifo & (uint32_t)kCSI_RxFifo)
    {
        mask |= CSI_CSICR1_CLR_RXFIFO_MASK;
    }
    if ((uint32_t)fifo & (uint32_t)kCSI_StatFifo)
    {
        mask |= CSI_CSICR1_CLR_STATFIFO_MASK;
    }
    base->CSICR1 = (cr1 & ~CSI_CSICR1_FCC_MASK) | mask;
    while (base->CSICR1 & mask)
    {
    }
    base->CSICR1 = cr1;
}