This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640: does cc2640 i2s could work at slave mode

Part Number: CC2640
Other Parts Discussed in Thread: PCM1808, , PLL1708

hi,i use pll1708+pcm1808 to sample audio and BCLK,WCLK output from pcm1808,does cc2640 i2s wokk at slave mode,and how to config BCLK pin,WCLK pin if it can.

i set initialize i2s as follow but it seem not work

    pll1707Init();

    PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH);
    while(PRCM_DOMAIN_POWER_ON != PRCMPowerDomainStatus(PRCM_DOMAIN_PERIPH));

    PRCMPeripheralRunEnable(PRCM_PERIPH_I2S);
    PRCMPeripheralRunEnable(PRCM_PERIPH_GPIO);
    HWREG(PRCM_BASE + PRCM_O_I2SBCLKSEL) = 0;   // BCLK use external clock
    PRCMLoadSet();
    while(0 == PRCMLoadGet());

    IOCPortConfigureSet(i2sWclkPin,IOC_PORT_MCU_I2S_WCLK,IOC_STD_INPUT);
    IOCPortConfigureSet(i2sBclkPin,IOC_PORT_MCU_I2S_BCLK,IOC_STD_INPUT);
    IOCPortConfigureSet(i2sAd0Pin,IOC_PORT_MCU_I2S_AD0,IOC_STD_INPUT);

    HWREG(I2S0_BASE + I2S_O_AIFDMACFG) = 0x0;   // disable i2s
    HWREG(I2S0_BASE + I2S_O_AIFWCLKSRC) = I2S_EXT_WCLK;  // WCLK use external clock
    HWREG(I2S0_BASE + I2S_O_AIFFMTCFG) = I2S_MEM_LENGTH_16 | I2S_POS_EDGE | I2S_DUAL_PHASE_FMT | I2S_WORD_LENGTH_16 | (1 << I2S_AIFFMTCFG_DATA_DELAY_S);
    HWREG(I2S0_BASE + I2S_O_AIFDIRCFG) = (I2S_AIFDIRCFG_AD0_IN << I2S_AIFDIRCFG_AD0_M); // enable AD0 and set it as input
    HWREG(I2S0_BASE + I2S_O_AIFWMASK0) = I2S_CHAN0_ACT; // enable AD0 channel_0
    HWREG(I2S0_BASE + I2S_O_AIFINPTRNEXT) = (unsigned long)i2sSampleBuffer;
    HWREG(I2S0_BASE + I2S_O_AIFOUTPTRNEXT) = NULL;
    HWREG(I2S0_BASE + I2S_O_IRQMASK) = I2S_INT_ALL;
    IntRegister(INT_I2S_IRQ,i2sIsr);
    IntEnable(INT_I2S_IRQ);
    HWREG(I2S0_BASE + I2S_O_AIFDMACFG) = IMA_ADPCM_PCM_RAW_LEN - 1; // enable I2S
    HWREG(I2S0_BASE + I2S_O_AIFINPTRNEXT) = (unsigned long)(i2sSampleBuffer + IMA_ADPCM_PCM_RAW_LEN);