The software is based on the STM32CubeHAL hardware abstraction layer for the STM32 microcontroller and
extends STM32Cube with a board support package (BSP) for the low voltage dual brush DC motor driver
expansion board (
) and a BSP component driver for
The software layers used by the application software to access and use the dual brush DC motor driver
expansion board are:
•
STM32Cube HAL layer: provides a generic, multi-instance set of simple APIs (application programming
interfaces) to interact with the upper layers (application, libraries and stacks). These generic and extension
APIs are based on a common architecture and the layers above them like the middleware layer can function
without requiring specific hardware configuration data for a given microcontroller unit (MCU). This structure
improves the library code reusability and guarantees easy portability across other devices.
•
Board support package (BSP) layer: supports the peripherals on the STM32 Nucleo board, except for
the MCU. This limited set of APIs provides a programming interface for certain board specific peripherals
like the user button, the LED, etc, and helps in identifying the specific board version. In case of motor
control expansion boards, the motor control BSP provides a programming interface for various motor driver
components. The BSP in the
software provides the drivers to manage the
motor driver.
2.3
Folder structure
Figure 2.
X-CUBE-SPN12 package folder structure
The software is packaged in the following main folders:
•
Drivers
:
–
STM32Cube HAL driver files which directly derive from the
–
CMSIS folder with the CMSIS (Cortex
®
microcontroller software interface standard) files from ARM.
These files form a vendor-independent hardware abstraction layer for the Cortex-M processor series.
This folder is also unchanged from the
framework.
–
BSP folder with code files required for
driver and
the motor control API. (see
•
Projects
application using two bidirectional brush DC motors.
2.3.1
BSP folder
2.3.1.1
STM32F4XX-Nucleo/STM32F3XX-Nucleo/STM32F0XX-Nucleo/STM32L0XX-Nucleo BSPs
development board, these BSPs provide an interface to configure and use the
development board peripherals with the
expansion board.
Each subfolder (STM32F4XX-Nucleo/STM32F3XX-Nucleo/STM32F0XX-Nucleo/STM32L0XX-Nucleo) contains
two couples of .c/.h files:
•
stm32XXxx_nucleo.c/h
: these files derive from the
framework (with no modification) and
provide the functions to handle the related
board user button and LEDs.
•
stm32XXxx_nucleo_IHM12a1.c/h
: these files are dedicated to the configuration of the PWMs, the GPIOs
and the interrupt enabling/disabling.
UM2110
Folder structure
UM2110
-
Rev 2
page 4/14