mirror of
https://github.com/rvtr/twl_wrapsdk.git
synced 2025-10-31 06:11:10 -04:00
add API to set I2S sampling rate.
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@84 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
parent
0789a26744
commit
b3f9ded42a
@ -41,6 +41,10 @@ static void SNDi_I2SInit(void)
|
|||||||
if (isInitialized == FALSE)
|
if (isInitialized == FALSE)
|
||||||
{
|
{
|
||||||
isInitialized = TRUE;
|
isInitialized = TRUE;
|
||||||
|
if ((reg_CFG_CLK & REG_CFG_CLK_SND_MASK) == 0)
|
||||||
|
{
|
||||||
|
CDC_Init();
|
||||||
|
}
|
||||||
reg_SND_POWCNT |= REG_SND_POWCNT_SPE_MASK;
|
reg_SND_POWCNT |= REG_SND_POWCNT_SPE_MASK;
|
||||||
reg_CFG_TWL_EX |= REG_CFG_TWL_EX_I2S_MASK;
|
reg_CFG_TWL_EX |= REG_CFG_TWL_EX_I2S_MASK;
|
||||||
if (reg_CFG_TWL_EX & REG_CFG_TWL_EX_I2S_MASK)
|
if (reg_CFG_TWL_EX & REG_CFG_TWL_EX_I2S_MASK)
|
||||||
@ -71,10 +75,6 @@ void SND_I2SEnable(void)
|
|||||||
|
|
||||||
if (isTwl)
|
if (isTwl)
|
||||||
{
|
{
|
||||||
if ((reg_CFG_CLK & REG_CFG_CLK_SND_MASK) == 0)
|
|
||||||
{
|
|
||||||
CDC_Init();
|
|
||||||
}
|
|
||||||
reg_SND_I2SCNT |= REG_SND_I2SCNT_E_MASK;
|
reg_SND_I2SCNT |= REG_SND_I2SCNT_E_MASK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -170,10 +170,11 @@ void SND_I2SMute(BOOL isMute)
|
|||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: SND_I2SSetMixingRatio
|
Name: SND_I2SSetMixingRatio
|
||||||
|
|
||||||
Description: Set output selector
|
Description: Set mixing ratio
|
||||||
|
|
||||||
Arguments: nitroRatio : NITRO / (NITRO + DSP) ratio. (0-8)
|
Arguments: nitroRatio : NITRO : DSP ratio. (0-8)
|
||||||
if 8, nitro sound is all.
|
if 8, nitro sound is all.
|
||||||
|
if 0, DSP sound is all.
|
||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
@ -189,4 +190,28 @@ void SND_I2SSetMixingRatio(int nitroRatio)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Name: SND_I2SSetSamplingRatio
|
||||||
|
|
||||||
|
Description: Set I2S sampling ratio
|
||||||
|
|
||||||
|
Arguments: is47kHz : set 48 kHz if TRUE. set 32kHz if FALSE.
|
||||||
|
|
||||||
|
Returns: None
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
void SND_I2SSetSamplingRatio(BOOL is47kHz)
|
||||||
|
{
|
||||||
|
if (isTwl)
|
||||||
|
{
|
||||||
|
if (is47kHz)
|
||||||
|
{
|
||||||
|
reg_SND_I2SCNT |= REG_SND_I2SCNT_CODEC_SMP_MASK;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reg_SND_I2SCNT &= ~REG_SND_I2SCNT_CODEC_SMP_MASK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*====== End of snd_i2s.c ======*/
|
/*====== End of snd_i2s.c ======*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user