Implementation example
2.3.2
Demo firmware description
The demo uses the i2s_codec driver functions to control the audio stream. Other functions
are implemented to make the application interactive.
Two main functions are handled by the application:
●
Joystick and push-button input control
●
LCD display output (all LCD-related functionalities are enabled only when the USE_LCD
constant is defined in the main.h file by uncommenting the following line:
#define USE_LCD).
Joystick_Config function
The push-button-related GPIO and EXTI configuration is performed by the
Joystick_Config function (instantiated in the main.c file).
Table 10.
Function name
Prototype
Behavior description
Input parameter
Output parameter
Required preconditions
Called functions
The functionalities allowed by this configuration are explained in
Table 11.
Button
Key button
Joystick Up button
Joystick Down button
Joystick Left button
Joystick Right button Rewind and play: if the stream is Playing.
Joystick Select
button
18/26
Joystick_Config function
u32 Joystick_Config(void)
Configures and initializes the EXTI, NVIC and GPIOs related to the
Joystick and the Key push-buttons.
None
None
None
None.
Description of the Joystick functionalities
– Play: if the stream is paused.
– Pause: if the stream is Playing.
– Set Speaker as audio output device and begin
playing the file: if the stream is Paused or Stopped.
– Increase volume: if the stream is Playing.
– Set Headphone as audio output device and begin
playing the stream: if the stream is Paused or
Stopped.
– Decrease volume: if the stream is Playing.
Forward and play: if the stream is Playing.
Stop: if the stream is Playing.
Joystick_Config
Function
AN2739
Table 11.
Pin
EXTI
location
line
PG8
EXTI8
PG15
EXTI15
PD3
EXTI3
PG14
EXTI14
PG13
EXTI13
PG7
EXTI7
Need help?
Do you have a question about the STM32F103 Series and is the answer not in the manual?
Questions and answers