没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
1514页
STM32H7 HAL驱动库英文版的用户手册; STMCubeTM 可降低开发人员的开发工作量、开发时间还有开发成本,使开发人员的生活更轻松; HAL驱动层提供了一组简单的通用多实例api来与上层(应用程序、库和堆栈)交互。 它由泛型和扩展api组成。它直接建造在通用体系结构,并允许构建在层(如中间件层)上的 了解如何使用单片机。这种结构提高了库代码的可重用性,并保证了易于移植到其他库代码 设备。HAL驱动程序包括一整套现成的api,这些api简化了用户应用程序的实现。
资源推荐
资源详情
资源评论
Introduction
STMCube
TM
is an STMicroelectronics original initiative to make developers' lives easier by reducing development effort, time
and cost. STM32Cube covers the whole STM32 portfolio.
STM32Cube includes:
• STM32CubeMX, a graphical software configuration tool that allows the generation of C initialization code using graphical
wizards.
• A comprehensive embedded software platform, delivered per Series (such as STM32CubeH7 for STM32H7 Series)
– The STM32Cube HAL, STM32 abstraction layer embedded software ensuring maximized portability across the STM32
portfolio
– A consistent set of middleware components such as RTOS, USB, TCP/IP, Graphics
– All embedded software utilities delivered with a full set of examples.
The HAL driver layer provides a simple generic multi-instance set of APIs (application programming interfaces) to interact with
the upper layer (application, libraries and stacks). It is composed of generic and extension APIs. It is directly built around a
generic architecture and allows the built-upon layers, such as the middleware layer, to implement their functions without in-depth
knowledge how to use the MCU. This structure improves the library code reusability and guarantees easy portability to other
devices.
The HAL drivers include a complete set of ready-to-use APIs which simplify the user application implementation. As an
example, the communication peripherals contain APIs to initialize and configure the peripheral, to manage data transfers based
on polling, to handle interrupts or DMA, and to manage communication errors.
The HAL driver APIs are split into two categories: generic APIs which provide common and generic functions for all the STM32
series and extension APIs which include specific and customized functions for a given family or part number.
The HAL drivers are feature-oriented instead of IP-oriented. As an example, the timer APIs are split into several categories
following the functions offered by the IP: basic timer, capture, pulse width modulation (PWM), and so on.
The driver source code is developed in Strict ANSI-C which makes it independent from the development tools. It is checked with
the CodeSonar
TM
static analysis tool. It is fully documented and is MISRA-C 2004 compliant.
The HAL driver layer implements run-time failure detection by checking the input values of all functions. Such dynamic checking
contributes to enhanced firmware robustness. Run-time detection is also suitable for user application development and
debugging.
This user manual is structured as follows:
• Overview of the HAL drivers
• Detailed description of each peripheral driver: configuration structures, functions, and how to use the given API to build your
application.
Description of STM32H7 HAL drivers
UM2217
User Manual
UM2217 - Rev 2 - January 2018
For further information contact your local STMicroelectronics sales office.
www.st.com/
1 General information
The STM32Cube MCU Package runs on STM32 32-bit microcontrollers based on the Arm® Cortex®-M
processors.
UM2217
General information
UM2217 - Rev 2
page 2/1514
2 Acronyms and definitions
Table 1. Acronyms and definitions
Acronym Definition
ADC Analog-to-digital converter
ANSI American National Standards Institute
API Application Programming Interface
BSP Board Support Package
CAN Controller area network
CEC Consumer electronic controller
CMSIS Cortex Microcontroller Software Interface Standard
COMP Comparator
CPU Central Processing Unit
CRC CRC calculation unit
CRYP Cryptographic processor
DAC Digital to analog converter
DLYB Delay block
DCMI Digital camera interface
DFSDM Digital filter sigma delta modulators
DMA Direct Memory Access
ETH Ethernet controller
EXTI External interrupt/event controller
FDCAN FD Controller Area Network
FLASH Flash memory
FMC Flexible memory controller
GPIO General purpose I/Os
HAL Hardware abstraction layer
HASH Hash processor
HCD USB Host Controller Driver
HRTIM High-resolution timer
HSEM Hardware semaphore
I2C Inter-integrated circuit
I2S Inter-integrated sound
IRDA InfraRed Data Association
IWDG Independent watchdog
LCD Liquid Crystal Display Controler
LTDC LCD TFT Display Controller
MDIOS Management data input/output (MDIO) slave
MDMA Master direct memory access
MMC MultiMediaCard
MSP MCU Specific Package
UM2217
Acronyms and definitions
UM2217 - Rev 2
page 3/1514
Acronym Definition
NAND NAND Flash memory
NOR Nor Flash memory
NVIC Nested Vectored Interrupt Controller
OPAMP Operational amplifier
PCD USB Peripheral Controller Driver
PWR Power controller
QSPI Quad-SPI Flash memory Interface
RCC Reset and clock controller
RTC Real-time clock
SAI Serial Audio Interface
SD Secure Digital
SMARTCARD Smartcard IC
SMBUS System management bus
SPI Serial Peripheral interface
SPDIFRX SPDIF-RX Receiver interface
SRAM SRAM external memory
SysTick System tick timer
SWPMI Single wire protocol master interface
TIM Advanced-control, general-purpose or basic timer
UART Universal asynchronous receiver/transmitter
USART Universal synchronous receiver/transmitter
WWDG Window watchdog
USB Universal Serial Bus
PPP STM32 peripheral or block
UM2217
Acronyms and definitions
UM2217 - Rev 2
page 4/1514
3 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 inlcude 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 of 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.
3.1
HAL and user-application files
3.1.1 HAL driver files
A HAL drivers are composed of the following set of files:
Table 2. HAL driver files
File Description
stm32h7xx_hal_ppp.c Main peripheral/module driver file.
It includes the APIs that are common to all STM32 devices.
Example: stm32h7xx_hal_adc.c, stm32h7xx_hal_irda.c, …
stm32h7xx_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: stm32h7xx_hal_adc.h,stm32h7xx_hal_irda.h, …
stm32h7xx_hal_ppp_ex.c Extension file of a peripheral/module driver. It includes the specific APIs for a given part
number or family, as well as the newly defined APIs that overwrite the default generic APIs if
the internal process is implemented in different way.
Example: stm32h7xx_hal_adc_ex.c,stm32h7xx_hal_dma_ex.c, …
UM2217
Overview of HAL drivers
UM2217 - Rev 2
page 5/1514
剩余1513页未读,继续阅读
资源评论
jackinglin
- 粉丝: 3
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功