Guide For Writing Applications; Relevant Apis For Sensor Applications; Initialization - ST STM32 Nucleo Application Note

Getting started with sensor expansion board
Hide thumbs Also See for STM32 Nucleo:
Table of Contents

Advertisement

Guide for writing applications

4
Guide for writing applications
This chapter describes how to write applications which use sensors, based on the STM32
Nucleo board equipped with the sensor expansion board.
4.1

Relevant APIs for sensor applications

This section describes generic initialization and setup for writing sensor expansion board
applications.
4.1.1

Initialization

Every application must first execute the following basic initialization steps in order to
configure and set up the STM32 Nucleo with the sensor expansion board hardware and the
software stack for correct operation.
Initializing STM32Cube HAL
The STM32Cube HAL library must be initialized so that the necessary hardware
components are correctly configured.
HAL_Init();
This API initializes the HAL library: it configures Flash prefetch, Flash preread and
Buffer Cache0; it also configures the time base source, vectored interrupt controller
and low-level hardware.
Initializing Nucleo board peripherals and sensor expansion board
Some of the Nucleo on-board peripherals, hardware and the sensor expansion board must
be configured before they are used. The functions to do this are:
BSP_LED_Init(Led_TypeDef Led);
This API configures the LED on the Nucleo.
BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
This API configures the user button in GPIO mode or in external interrupt (EXTI) mode.
BSP_HUM_TEMP_isInitialized()
This API configures the temperature sensor (hts221) on the sensor expansion board.
BSP_PRESSURE_isInitialized()
This API configures the pressure sensor (lps25h) on the sensor expansion board.
BSP_IMU_6AXES_isInitialized()
This API configures accelerometer and gyroscope sensor (LSM6DS0) on the sensor
expansion board.
BSP_MAGNETO_isInitialized
This API configures magnetometer sensor (LIS3MDL) on the sensor expansion board.
10/16
DocID026958 Rev 1
AN4594

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32 Nucleo and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

X-nucleo-iks01a1Stm32f401re nucleo

Table of Contents