/** * @brief Resumes playing on the audio codec. * @param DeviceAddr: Device address on communication Bus. * @retval 0 if correct communication, else wrong communication */ uint32_t cs43l22_Resume(uint16_t DeviceAddr) { uint32_t counter = 0; volatile uint32_t index = 0x00; /* Resumes the audio file playing */ /* Unmute the output first */ counter += cs43l22_SetMute(DeviceAddr, AUDIO_MUTE_OFF); for(index = 0x00; index < 0xFF; index++); counter += CODEC_IO_Write(DeviceAddr,0x04, OutputDev); /* Exit the Power save mode */ counter += CODEC_IO_Write(DeviceAddr,0x02, 0x9E); return counter; }
/** * @brief Start the audio Codec play feature. * @note For this codec no Play options are required. * @param DeviceAddr: Device address on communication Bus. * @retval 0 if correct communication, else wrong communication */ uint32_t cs43l22_Play(uint16_t DeviceAddr, uint16_t* pBuffer, uint16_t Size) { uint32_t counter = 0; if(Is_cs43l22_Stop == 1) { /* Enable Output device */ counter += cs43l22_SetMute(DeviceAddr, AUDIO_MUTE_OFF); /* Power on the Codec */ counter += CODEC_IO_Write(DeviceAddr, 0x02, 0x9E); Is_cs43l22_Stop = 0; } /* Return communication control value */ return counter; }
/** * @brief Start the audio Codec play feature. * @note For this codec no Play options are required. * @param DeviceAddr: Device address on communication Bus. * @retval 0 if correct communication, else wrong communication */ uint32_t cs43l22_Play(uint16_t DeviceAddr, uint16_t* pBuffer, uint16_t Size) { uint32_t counter = 0; if(Is_cs43l22_Stop == 1) { /* Enable the digital soft ramp */ counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_MISC_CTL, 0x06); /* Enable Output device */ counter += cs43l22_SetMute(DeviceAddr, AUDIO_MUTE_OFF); /* Power on the Codec */ counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL1, 0x9E); Is_cs43l22_Stop = 0; } /* Return communication control value */ return counter; }