|
楼主 |
发表于 2011-7-21 20:11:16
|
显示全部楼层
附代码
PUBLIC void TV_SwitchAudioPA(BOOLEAN OnOff)
{
if(currAudioType != TV_Audio_Analog)
{
return;
}
if( OnOff )
{
VB_ARM_SetLineInBypassout( TRUE );
VB_ARM_SetLineInPGA(0, 0x160);
VB_ARM_SetLineInPGA(1, 0x160);
LDO_AutoCloseInDeepSleep(SLP_LDO_VBO, FALSE);
if( GPIO_CheckHeadsetStatus( ) )
{
VB_ARM_SetHeadsetMode(1);
VB_ARM_HPOutputEnable(1);
TV_VB_ARM_SetStero(0);
TV_VB_ARM_SetStero(1);
GPIO_EnableAmplifier( FALSE );
}
else
{
VB_ARM_SetHeadsetMode(0);
VB_ARM_HPOutputEnable(0);
TV_VB_ARM_SetStero(0);
TV_VB_ARM_SetStero(1);
GPIO_EnableAmplifier( TRUE );
}
GPIO_TVAudioPAEn( TRUE );
}
else
{
GPIO_TVAudioPAEn( FALSE );
GPIO_EnableAmplifier( FALSE );
VB_ARM_SetLineInBypassout( FALSE );
LDO_AutoCloseInDeepSleep(SLP_LDO_VBO, TRUE);
}
}
PUBLIC void FM_ConfigOutPutPath(FM_OUTPUT_MODE_E fm_outpath)
{
switch(fm_outpath){
case FM_OUTPUT_HEADSET:
GPIO_EnableAmplifier(FALSE);
VB_ARM_SetHeadsetMode(1);
VB_ARM_SetStero(1);
VB_ARM_HPOutputEnable(1);
fm_audio_mode = 0;
break;
case FM_OUTPUT_SPEAKER:
VB_ARM_SetHeadsetMode(1);
VB_ARM_SetStero(1);
VB_ARM_HPOutputEnable(1);
GPIO_EnableAmplifier(TRUE);
fm_audio_mode = 1;
break;
case FM_OUTPUT_MUTE:
break;
default :
break;
}
}
ATV和FM 一进去听筒也有声音出来,设置耳机模式后然后切换外放就没了 |
|