/*******************************************************************************
* Function Name: I2S_Wakeup
********************************************************************************
*
* Summary:
*  Prepares I2S to wake up.
*
* Parameters:
*  None.
*
* Return:
*  None.
*
* Global Variables:
*  I2S_backup - used when non-retention registers are restored.
*
* Reentrant:
*  Yes.
*
*******************************************************************************/
void I2S_Wakeup(void) 
{
    /* Restore registers values */
    I2S_RestoreConfig();

    if(0u != I2S_backup.enableState)
    {
        /* Enable component's operation */
        I2S_Enable();

        /* Enable Tx/Rx direction if they were enabled before sleep */
        #if(I2S_TX_DIRECTION_ENABLE)
            if(0u != (I2S_backup.CtrlReg & I2S_TX_EN))
            {
                I2S_EnableTx();
            }
        #endif /* (I2S_TX_DIRECTION_ENABLE) */
        
        #if(I2S_RX_DIRECTION_ENABLE)
            if(0u != (I2S_backup.CtrlReg & I2S_RX_EN))
            {
                I2S_EnableRx();
            }
        #endif /* (I2S_RX_DIRECTION_ENABLE) */
    }
}
Example #2
0
/*******************************************************************************
* Function Name: AuxDetection_Start
********************************************************************************
* Summary:
*       This routine starts the AUX detection process and enable I2S receive.
*
* Parameters:
*  void
*
* Return:
*  void
*
*******************************************************************************/
void AuxDetection_Start(void)
{
    isr_Aux_StartEx(Aux_Interrupt);

    CyDmaChEnable(I2SRxMDAChan, 1);
    I2S_ClearRxFIFO();  
    I2S_RX_AUX_CONTROL_REG = I2S_RX_AUX_CONTROL_REG & (~FIFO_HALF_EMPTY_MASK);
    I2S_EnableRx();
}