Implementation example
●
I2S_CODEC_Play function
This function starts playing the audio file from a programmable position.
Table 6.
Function name
Prototype
Behavior description
Input parameter
Output parameter
Required preconditions
Called functions
●
I2S_CODEC_ControlVolume function
This function controls the digital volume level in accordance with the input parameters
(increases, decreases or sets a volume level).
Table 7.
Function name
Prototype
Behavior description
Input parameter
Output parameter
Required preconditions None
Called functions
14/26
I2S_CODEC_Play function
u32 I2S_CODEC_Play(u32 AudioStartPosition)
Sets the memory read address to AudioStartPosition and enables the I
interrupt to begin sending audio data to the codec. (Update the status of
the current audio file to playing).
AudioStartPosition: first address of the audio data to be played in the
current stream (relatively to the audio file, after the end of the audio file
header, and not relatively to the memory).
None
None
None.
I2S_CODEC_ControlVolume function
u32 I2S_CODEC_ControlVolume(u32 direction, u8 volume)
Depending on the direction value, increases, decreases or sets a volume
level defined by the volume variable.
– direction: VolumeDirection_HIGH or VolumeDirection_LOW,
respectively to increment/decrement the current volume by a step:
"volume" value. Or VolumeDirection_LEVEL to set the volume value
to "volume".
– volume: any step value (from 0xFF and 0x01) or any level value from
0xFF (Mute) and 0x00 (Max volume)
None
None.
I2S_CODEC_Play
I2S_CODEC_ControlVolume
AN2739
2
S
Need help?
Do you have a question about the STM32F103 Series and is the answer not in the manual?
Questions and answers