Пример #1
0
void Sound_Headset_Turnon(void)
{
#if defined(ENABLE_2_IN_1_SPK)
#if defined(AMP_CLASS_D)
        hwSPKClassABInit();
#endif
        hw2in1SpeakerSetting(1,1);//0=>spk mode; 1=>receiver mode
        hwSPKClassABTurnOn();
#endif
}
void Sound_Earpiece_Turnon(void)
{
#if defined(ENABLE_2_IN_1_SPK)
#if defined(AMP_CLASS_D)
        hwSPKClassABInit();
#endif
        hw2in1SpeakerSetting(1,1);//0=>spk mode; 1=>receiver mode
        hwSPKClassABVoiceBypassAnalogGain(RCV_AMP_GAIN);
        hwSPKClassABTurnOn(SPK_L_ENABLE,SPK_R_ENABLE);
#endif
}
bool Speaker_Init(void)
{
   PRINTK("+Speaker_Init Success");
#if defined(AMP_CLASS_AB)
   hwSPKClassABInit();
   hwSPKClassABVolumeControl(SPK_AMP_GAIN,SPK_AMP_GAIN);//4:15dB, 6:21dB
#elif defined(AMP_CLASS_D)
   hwSPKClassDInit();
   hwSPKClassDVolumeControl(SPK_AMP_GAIN,SPK_AMP_GAIN);//4:15dB, 6:21dB
#endif
   hwSPKClassABVoiceBypassAnalogGain(RCV_AMP_GAIN);
   PRINTK("-Speaker_Init Success");
   return true;
}