/* Stops audio Codec playing. It powers down the codec.  */
static uint32_t Codec_Stop(uint32_t CodecPdwnMode)
/* Stops audio Codec playing. It powers down the codec.  */
static uint32_t Codec_Stop(uint32_t CodecPdwnMode)
{
  uint32_t counter = 0;
  Codec_Mute(AUDIO_MUTE_ON);
  if (CodecPdwnMode == CODEC_PDWN_SW)
  {
    counter += Codec_WriteRegister(0x02, 0x9F);
  }
  else
  {
    counter += Codec_WriteRegister(0x02, 0x9F);
    Delay(0xFFF);
    GPIO_WriteBit(AUDIO_RESET_GPIO, AUDIO_RESET_PIN, Bit_RESET);
  }
  return counter;    
}