没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
1166页
STM32F1系列Hal&LL库使用手册(英文原档) STM32F1系列Hal&LL库使用手册(英文原档) https://download.csdn.net/download/qq_35953617/87374686 STM32F1系列Hal&LL库使用手册(中英文对照) https://download.csdn.net/download/qq_35953617/87374673 STM32F1系列Hal&LL库使用手册(中文翻译) https://download.csdn.net/download/qq_35953617/87374670
资源推荐
资源详情
资源评论
April 2017
DocID027328 Rev 2
1/1166
www.st.com
UM1850
User manual
Description of STM32F1 HAL and Low-layer drivers
Introduction
STMCube
TM
is an STMicroelectronics original initiative to make developers' lives easier by reducing
development efforts, time and cost. STM32Cube covers the whole STM32 portfolio.
STM32Cube Version 1.x 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 STM32CubeF1 for
STM32F1 series)
The STM32Cube HAL, STM32 abstraction layer embedded software ensuring maximized
portability across the STM32 portfolio
Low Layer APIs (LL) offering a fast light-weight expert-oriented layer which is closer to the
hardware than the HAL. LL APIs are available only for a set of peripherals.
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 generic multi-instance simple set of APIs (application programming
interfaces) to interact with the upper layer (application, libraries and stacks).
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 line or part number. 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, manage data transfers in polling mode, handle interrupts
or DMA, and manage communication errors.
The HAL drivers are feature-oriented instead of IP-oriented. As an example, the timer APIs are split into
several categories following the IP functions: basic timer, capture, pulse width modulation (PWM), etc..
The HAL driver layer implements run-time failure detection by checking the input values of all functions.
Such dynamic checking contributes to enhance the firmware robustness. Run-time detection is also
suitable for user application development and debugging.
The LL drivers offer hardware services based on the available features of the STM32 peripherals. These
services reflect exactly the hardware capabilities and provide atomic operations that must be called
following the programming model described in the product line reference manual. As a result, the LL
services are not based on standalone processes and do not require any additional memory resources to
save their states, counter or data pointers: all operations are performed by changing the associated
peripheral registers content. Contrary to the HAL, the LL APIs are not provided for peripherals for which
optimized access is not a key feature, or for those requiring heavy software configuration and/or
complex upper level stack (such as FSMC, USB, SDMMC).
The HAL and LL are complementary and cover a wide range of applications requirements:
The HAL offers high-level and feature-oriented APIs, with a high-portability level. They hide the
MCU and peripheral complexity to end-user.
The LL offers low-level APIs at registers level, with better optimization but less portability. They
require deep knowledge of the MCU and peripherals specifications.
The source code of HAL and LL drivers is developed in Strict ANSI-C which makes it independent from
the development tools. It is checked with CodeSonar™ static analysis tool. It is fully documented and is
MISRA-C 2004 compliant.
Contents
UM1850
2/1166
DocID027328 Rev 2
Contents
1 Acronyms and definitions ............................................................. 24
2 Overview of HAL drivers ............................................................... 26
2.1 HAL and user-application files......................................................... 26
2.1.1 HAL driver files ................................................................................. 26
2.1.2 User-application files ........................................................................ 27
2.2 HAL data structures ........................................................................ 29
2.2.1 Peripheral handle structures ............................................................ 29
2.2.2 Initialization and configuration structure ........................................... 30
2.2.3 Specific process structures .............................................................. 31
2.3 API classification ............................................................................. 31
2.4 Devices supported by HAL drivers .................................................. 32
2.5 HAL driver rules .............................................................................. 38
2.5.1 HAL API naming rules ...................................................................... 38
2.5.2 HAL general naming rules ................................................................ 39
2.5.3 HAL interrupt handler and callback functions ................................... 40
2.6 HAL generic APIs ............................................................................ 41
2.7 HAL extension APIs ........................................................................ 42
2.7.1 HAL extension model overview ........................................................ 42
2.7.2 HAL extension model cases ............................................................. 42
2.8 File inclusion model ......................................................................... 45
2.9 HAL common resources .................................................................. 46
2.10 HAL configuration ............................................................................ 46
2.11 HAL system peripheral handling ..................................................... 47
2.11.1 Clock ................................................................................................. 47
2.11.2 GPIOs ............................................................................................... 48
2.11.3 Cortex NVIC and SysTick timer ........................................................ 50
2.11.4 PWR ................................................................................................. 50
2.11.5 EXTI .................................................................................................. 50
2.11.6 DMA .................................................................................................. 52
2.12 How to use HAL drivers .................................................................. 53
2.12.1 HAL usage models ........................................................................... 53
2.12.2 HAL initialization ............................................................................... 54
2.12.3 HAL IO operation process ................................................................ 56
2.12.4 Timeout and error management ....................................................... 59
UM1850
Contents
DocID027328 Rev 2
3/1166
3 Overview of Low Layer drivers ..................................................... 63
3.1 Low Layer files ................................................................................ 63
3.2 Overview of Low Layer APIs and naming rules ............................... 65
3.2.1 Peripheral initialization functions ...................................................... 65
3.2.2 Peripheral register-level configuration functions .............................. 69
4 Cohabiting of HAL and LL ............................................................ 71
4.1 Low Layer driver used in standalone mode ..................................... 71
4.2 Mixed use of Low Layer APIs and HAL drivers ............................... 71
5 HAL System Driver ........................................................................ 72
5.1 HAL Firmware driver API description .............................................. 72
5.1.1 How to use this driver ....................................................................... 72
5.1.2 Initialization and de-initialization functions ....................................... 72
5.1.3 HAL Control functions....................................................................... 72
5.1.4 Detailed description of functions ...................................................... 73
5.2 HAL Firmware driver defines ........................................................... 77
5.2.1 HAL ................................................................................................... 77
6 HAL ADC Generic Driver ............................................................... 79
6.1 ADC Firmware driver registers structures ....................................... 79
6.1.1 ADC_InitTypeDef .............................................................................. 79
6.1.2 ADC_ChannelConfTypeDef ............................................................. 80
6.1.3 ADC_AnalogWDGConfTypeDef ....................................................... 80
6.1.4 ADC_HandleTypeDef ....................................................................... 81
6.2 ADC Firmware driver API description .............................................. 81
6.2.1 ADC peripheral features ................................................................... 81
6.2.2 How to use this driver ....................................................................... 82
6.2.3 Initialization and de-initialization functions ....................................... 84
6.2.4 IO operation functions ...................................................................... 85
6.2.5 Peripheral Control functions ............................................................. 85
6.2.6 Peripheral State and Errors functions .............................................. 85
6.2.7 Detailed description of functions ...................................................... 86
6.3 ADC Firmware driver defines .......................................................... 92
6.3.1 ADC .................................................................................................. 92
7 HAL ADC Extension Driver ......................................................... 100
7.1 ADCEx Firmware driver registers structures ................................. 100
7.1.1 ADC_InjectionConfTypeDef ........................................................... 100
7.1.2 ADC_MultiModeTypeDef ................................................................ 101
Contents
UM1850
4/1166
DocID027328 Rev 2
7.2 ADCEx Firmware driver API description ....................................... 102
7.2.1 IO operation functions .................................................................... 102
7.2.2 Peripheral Control functions ........................................................... 102
7.2.3 Detailed description of functions .................................................... 103
7.3 ADCEx Firmware driver defines .................................................... 106
7.3.1 ADCEx ............................................................................................ 106
8 HAL CAN Generic Driver ............................................................. 110
8.1 CAN Firmware driver registers structures ..................................... 110
8.1.1 CAN_InitTypeDef ............................................................................ 110
8.1.2 CanTxMsgTypeDef ......................................................................... 111
8.1.3 CanRxMsgTypeDef ........................................................................ 111
8.1.4 CAN_HandleTypeDef ..................................................................... 112
8.2 CAN Firmware driver API description ............................................ 112
8.2.1 How to use this driver ..................................................................... 112
8.2.2 Initialization and de-initialization functions ..................................... 113
8.2.3 IO operation functions .................................................................... 114
8.2.4 Peripheral State and Error functions .............................................. 114
8.2.5 Detailed description of functions .................................................... 114
8.3 CAN Firmware driver defines ........................................................ 118
8.3.1 CAN ................................................................................................ 118
9 HAL CAN Extension Driver ......................................................... 127
9.1 CANEx Firmware driver registers structures ................................. 127
9.1.1 CAN_FilterConfTypeDef ................................................................. 127
10 HAL CEC Generic Driver ............................................................. 128
10.1 CEC Firmware driver registers structures ..................................... 128
10.1.1 CEC_InitTypeDef ............................................................................ 128
10.1.2 CEC_HandleTypeDef ..................................................................... 128
10.2 CEC Firmware driver API description ............................................ 129
10.2.1 How to use this driver ..................................................................... 129
10.2.2 Initialization and Configuration functions ........................................ 129
10.2.3 IO operation functions .................................................................... 130
10.2.4 Peripheral Control function ............................................................. 130
10.2.5 Detailed description of functions .................................................... 131
10.3 CEC Firmware driver defines ........................................................ 133
10.3.1 CEC ................................................................................................ 133
11 HAL CORTEX Generic Driver ...................................................... 139
UM1850
Contents
DocID027328 Rev 2
5/1166
11.1 CORTEX Firmware driver registers structures .............................. 139
11.1.1 MPU_Region_InitTypeDef .............................................................. 139
11.2 CORTEX Firmware driver API description .................................... 140
11.2.1 How to use this driver ..................................................................... 140
11.2.2 Initialization and de-initialization functions ..................................... 140
11.2.3 Peripheral Control functions ........................................................... 141
11.2.4 Detailed description of functions .................................................... 141
11.3 CORTEX Firmware driver defines ................................................. 146
11.3.1 CORTEX ......................................................................................... 146
12 HAL CRC Generic Driver ............................................................. 149
12.1 CRC Firmware driver registers structures ..................................... 149
12.1.1 CRC_HandleTypeDef ..................................................................... 149
12.2 CRC Firmware driver API description ........................................... 149
12.2.1 How to use this driver ..................................................................... 149
12.2.2 Initialization and de-initialization functions ..................................... 149
12.2.3 Peripheral Control functions ........................................................... 149
12.2.4 Peripheral State functions .............................................................. 150
12.2.5 Detailed description of functions .................................................... 150
12.3 CRC Firmware driver defines ........................................................ 151
12.3.1 CRC ................................................................................................ 151
13 HAL DAC Generic Driver ............................................................. 153
13.1 DAC Firmware driver registers structures ..................................... 153
13.1.1 DAC_HandleTypeDef ..................................................................... 153
13.1.2 DAC_ChannelConfTypeDef ........................................................... 153
13.2 DAC Firmware driver API description ............................................ 153
13.2.1 DAC Peripheral features................................................................. 153
13.2.2 How to use this driver ..................................................................... 155
13.2.3 Initialization and de-initialization functions ..................................... 156
13.2.4 IO operation functions .................................................................... 156
13.2.5 Peripheral Control functions ........................................................... 157
13.2.6 Peripheral State and Errors functions ............................................ 157
13.2.7 Detailed description of functions .................................................... 157
13.3 DAC Firmware driver defines ........................................................ 162
13.3.1 DAC ................................................................................................ 162
14 HAL DAC Extension Driver ......................................................... 164
14.1 DACEx Firmware driver API description ....................................... 164
剩余1165页未读,继续阅读
资源评论
王拉图
- 粉丝: 6897
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 下载安装这个软件.apk
- 【数据集详细解释及案例分析】数据集详细解释及案例分析
- 基于SHT71温湿度传感器、STM32F103C8T6、LCD1602温湿度采集显示系统proteus仿真设计
- 基于TH02温湿度传感器、STM32F103C8T6、LCD1602、FREERTOS的温湿度采集系统proteus仿真设计
- 【TCP-IP协议详细解释及案例分析】TCP-IP协议详细解释及案例分析
- 一文搞懂 LSTM(长短期记忆网络).rar
- 【autosar简介及基本案例解析】autosar简介及基本案例解析
- java模拟斗地主洗牌发牌
- springboot+vue登录系统 vue部分
- 常用常见 SQL语句语法
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功