Demonstration firmware package
UM1784
DocID026524 Rev 2
2. Media: the media files (*.bmp) required to run the demonstration are available under
the FW package Utilities\Media\Images folder
3. Inc: contains the demonstration header files
4. Src: contains the demonstration source files
5. Project settings: a folder per toolchain containing the project settings and the linker
files.
3.2
Nucleo board BSP
For each board, a set of Button, LED and Joystick drivers is available within the
stm32f3xx_nucleo.c/.h files, implementing the board capabilities and the bus link
mechanism.
Figure 6. Nucleo BSP architecture
3.2.1 Joystick
The 5-way joystick on the shield is based on a resistor trick to permit all the switches to
share one analog pin. Each movement of the joystick control connects a different resistor
and results in a different voltage reading.
The ADC peripheral is configured within the stm32f3xx_nucleo.c/.h driver in order to get
analog voltage values through the analog I/O pin 3.
The
BSP_JOY_GetState()
function reads the analog pin and compares the result with 5
different ranges to determine which (if any) direction the stick has been moved (left, right,
up, down, select).