AN2739 Implementation example
19/26
LCD_Update function
The LCD configuration and the current audio stream information display operations are
performed by the LCD_Update function as detailed in Ta ble 1 2 .
The example program implements the i2s_codec driver in a basic application that consists
in the following:
● Initialize the LCD and the displayed information
● Configure the Joystick and Key push-button GPIOs and related EXTI.
● Wait for an interrupt to execute one of the actions described in Tab l e 1 1 .
● Every time an interrupt is generated by pushing one of the buttons, the dedicated
operation is executed and the LCD display is updated according to the changed
parameter.
● Every time ~1% of the playing stream elapses an interrupt is generated by the
SystemTick timer and the Progress bar is computed. The LCD-related information is
then updated.
Table 12. LCD_Update function
Function name LCD_Update
Prototype void LCDUpdate(u32 Status)
Behavior description
Updates the information displayed on the LCD according to the parameter
Status. The information is gathered from the audio stream status and the
codec driver variables.
Input parameter
Status: determines which information has to be updated (all other
information remains unchanged). It can be:
– STOP, PLAY, PAUSE to update the control button menu lines and the
status line menu.
– FRWRWD to update the progress bar in case of forward or rewind.
– VOL to update the volume bar.
– PROGRESS to update the progress bar periodically.
– ALL to initialize the LCD and update all the information at once.
These values are defined in the main.h file.
Output parameter None
Required preconditions None
Called functions
LCD_DisplayStringLine, GetVar_CurrentVolume,
GetVar_AudioDataIndex, I2S_CODEC_LCDConfig.