EasyManua.ls Logo

ST STM32F103 series

ST STM32F103 series
26 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Implementation example AN2739
16/26
Low-level functions
Some low-level functions provide flexible management of the memory (SPI Flash/NOR,
etc.). Other types of memories can be supported simply by replacing the body of these low-
level functions by the corresponding functions for the memory.
Example: the Media_Init function should contain the entire memory initialization
procedure. The application can just call to corresponding memory driver function (that is the
NOR_Init() function).
Driver firmware flowcharts
Figure 5 and Figure 6 illustrate the driver functionality.
Figure 5. Driver’s functional flowchart 1
Table 9. I2S_CODEC low-level driver functions
Function name Description
Media_Init Calls the initialization procedure for the used memory medium.
Media_StartReadSequence Enables reading from the memory medium.
Media_ReadByte Reads and returns a byte from the memory medium.
Media_ReadHalfWord Reads and returns a half word from the memory medium.
Media_BufferRead
Reads a buffer of bytes from the memory medium (used to read
the wave file header).
I2S_CODEC_Init
Play Pause Stop
Initialize GPIOs
and memory
Read audio file header,
set audio parameters
Correct format
Read audio file header,
set audio parameters
Configure I
2
S, I
2
C
and codec
End
Audio file
Set the Playing
status variable
Enable SPI2 TXE
interrupt
End
Initialize medium
reading sequence
Disable SPI2 TXE
interrupt
Save indexes
End
Power down
codec
Set the Paused
status variable
Disable SPI2 TXE
interrupt
Reset indexes
End
Power down
codec
Set the Stopped
status variable
Ye s
ai15118
No

Other manuals for ST STM32F103 series

Related product manuals