AN2739 Implementation example
13/26
Ta bl e 4 lists all the parameters that have to be set in order to correctly configure the
application (some are automatically set by the I2S_CODEC_Init function, others are
constants defined in the driver files).
● I2S_CODEC_ReplayConfig function
This function sets the number of times the audio file stream will be repeated (replayed)
each time its end is reached.
Table 4. Configuration parameters list
Parameters Values Location Default value
OutputDevice
– OutputDevice_SPEAKER
– OutputDevice_HEADPHONE
I2S_CODEC_Init
function Input
OutputDevice_HEADPHONE
Address
Any value in respect to the
memory size.
I2S_CODEC_Init
function Input
AudioFileAddress =
0x6406 0000 (variable in
i2s_codec.c file)
I2S_STANDARD
– I2S_Standard_Phillips
– I2S_Standard_MSB
– I2S_Standard_LSB
Constant in i2s_codec.h
file:
I2S_Standard_Phillips
I2S_MCLKOUTPUT
– I2S_MCLKOUTPUT_Enable
– I2S_MCLKOUTPUT_Disable
Constant in i2s_codec.h
file
I2S_MCLKOUTPUT_Enable
DEFAULT_VOL
– Any value from 0xFF(Mute)
and 0x00 (Max volume).
Constant in i2s_codec.h
file.
0x48
I2S_AudioFreq
– 8000, 16000, 22050, 44100
or 48000.
Automatically detected: Set
by AudioFile_Init
function
--
AudioDataLength
– Total Length of the current
audio file stream.
Automatically detected: Set
by AudioFile_Init
function.
--
DataStartAddr
– First audio data offset into
the current audio file
(corresponds to the header
length).
Automatically detected: Set
by AudioFile_Init
function.
--
Table 5. I2S_CODEC_ReplayConfig function
Function name I2S_CODEC_ReplayConfig
Prototype void I2S_CODEC_ReplayConfig(u32 Repetions)
Behavior description Sets the number of current audio stream repetitions to Repetitions value (input).
Input parameter Repetitions: any number ≥ 1 or 0 for infinite replay.
Output parameter None
Required preconditions None
Called functions None