EasyManuals Logo

ST STM32F2 User Manual

ST STM32F2
1371 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
Page #28 background imageLoading...
Page #28 background image
Overview of HAL drivers
UM1940
28/1371
DocID028236 Rev 2
2 Overview of HAL drivers
The HAL drivers were designed to offer a rich set of APIs and to interact easily with the
application upper layers.
Each driver consists of a set of functions covering the most common peripheral features.
The development of each driver is driven by a common API which standardizes the driver
structure, the functions and the parameter names.
The HAL drivers include a set of driver modules, each module being linked to a standalone
peripheral. However, in some cases, the module is linked to a peripheral functional mode.
As an example, several modules exist for the USART peripheral: UART driver module,
USART driver module, SMARTCARD driver module and IRDA driver module.
The HAL main features are the following:
Cross-family portable set of APIs covering the common peripheral features as well as
extension APIs in case of specific peripheral features.
Three API programming models: polling, interrupt and DMA.
APIs are RTOS compliant:
Fully reentrant APIs
Systematic usage of timeouts in polling mode.
Support for peripheral multi-instance allowing concurrent API calls for multiple
instances of a given peripheral (USART1, USART2...)
All HAL APIs implement user-callback functions mechanism:
Peripheral Init/DeInit HAL APIs can call user-callback functions to perform
peripheral system level Initialization/De-Initialization (clock, GPIOs, interrupt,
DMA)
Peripherals interrupt events
Error events.
Object locking mechanism: safe hardware access to prevent multiple spurious
accesses to shared resources.
Timeout used for all blocking processes: the timeout can be a simple counter or a
timebase.
2.1 HAL and user-application files
2.1.1 HAL driver files
A HAL drivers are composed of the following set of files:
Table 2: HAL driver files
File
Description
stm32f2xx_hal_ppp.c
Main peripheral/module driver file.
It includes the APIs that are common to all STM32 devices.
Example: stm32f2xx_hal_adc.c, stm32f2xx_hal_irda.c, …
stm32f2xx_hal_ppp.h
Header file of the main driver C file
It includes common data, handle and enumeration structures,
define statements and macros, as well as the exported generic
APIs.
Example: stm32f2xx_hal_adc.h, stm32f2xx_hal_irda.h, …

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F2 and is the answer not in the manual?

ST STM32F2 Specifications

General IconGeneral
BrandST
ModelSTM32F2
CategoryMicrocontrollers
LanguageEnglish

Related product manuals