没有合适的资源?快使用搜索试试~ 我知道了~
STM ISP API
5星 · 超过95%的资源 需积分: 14 79 下载量 12 浏览量
2015-12-30
17:30:16
上传
评论
收藏 15.42MB PDF 举报
温馨提示
试读
900页
STM32 ISP API Bootloader STM32硬件bootloader烧写API
资源推荐
资源详情
资源评论
April 2015
DOCID025834 Rev 2
1/900
www.st.com
UM1725
User Manual
Description of STM32F4xx HAL drivers
Introduction
STM32Cube
TM
is an STMicroelectronics original initiative to ease developers life by reducing
development efforts, time and cost. STM32Cube
TM
covers STM32 portfolio.
STM32Cube
TM
Version 1.x includes:
The STM32CubeMX, a graphical software configuration tool that allows generating C initialization
code using graphical wizards.
A comprehensive embedded software platform, delivered per series (such as STM32CubeF4 for
STM32F4 series)
The STM32Cube HAL, an STM32 abstraction layer embedded software, ensuring maximized
portability across STM32 portfolio
A consistent set of middleware components such as RTOS, USB, TCP/IP, Graphics
All embedded software utilities coming with a full set of examples.
The HAL drivers layer provides a generic multi instance simple 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 knowing in-depth how to use the
MCU. This structure improves the library code reusability and guarantees an easy portability on 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 drivers 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), etc..
The drivers source code is developed in Strict ANSI-C which makes it independent from the
development tools. It is checked with CodeSonar
TM
static analysis tool. It is fully documented and is
MISRA-C 2004 compliant.
The HAL drivers 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.
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.
Contents
UM1725
2/900
DOCID025834 Rev 2
Contents
1 Acronyms and definitions ............................................................. 53
2 Overview of HAL drivers ............................................................... 55
2.1 HAL and user-application files......................................................... 55
2.1.1 HAL driver files ................................................................................. 55
2.1.2 User-application files ........................................................................ 57
2.2 HAL data structures ........................................................................ 59
2.2.1 Peripheral handle structures ............................................................ 59
2.2.2 Initialization and configuration structure ........................................... 60
2.2.3 Specific process structures .............................................................. 60
2.3 API classification ............................................................................. 61
2.4 Devices supported by HAL drivers .................................................. 62
2.5 HAL drivers rules ............................................................................. 66
2.5.1 HAL API naming rules ...................................................................... 66
2.5.2 HAL general naming rules ................................................................ 67
2.5.3 HAL interrupt handler and callback functions ................................... 68
2.6 HAL generic APIs ............................................................................ 69
2.7 HAL extension APIs ........................................................................ 70
2.7.1 HAL extension model overview ........................................................ 70
2.7.2 HAL extension model cases ............................................................. 71
2.8 File inclusion model ......................................................................... 73
2.9 HAL common resources .................................................................. 73
2.10 HAL configuration ............................................................................ 74
2.11 HAL system peripheral handling ..................................................... 76
2.11.1 Clock ................................................................................................. 76
2.11.2 GPIOs ............................................................................................... 76
2.11.3 Cortex NVIC and SysTick timer ........................................................ 78
2.11.4 PWR ................................................................................................. 79
2.11.5 EXTI .................................................................................................. 79
2.11.6 DMA .................................................................................................. 80
2.12 How to use HAL drivers .................................................................. 81
2.12.1 HAL usage models ........................................................................... 81
2.12.2 HAL initialization ............................................................................... 82
2.12.3 HAL IO operation process ................................................................ 84
2.12.4 Timeout and error management ....................................................... 87
3 HAL System Driver ........................................................................ 92
UM1725
Contents
DOCID025834 Rev 2
3/900
3.1 HAL Firmware driver API description .............................................. 92
3.1.1 How to use this driver ....................................................................... 92
3.1.2 Initialization and de-initialization functions ....................................... 92
3.1.3 HAL Control functions....................................................................... 92
3.1.4 HAL_Init ............................................................................................ 93
3.1.5 HAL_DeInit ....................................................................................... 93
3.1.6 HAL_MspInit ..................................................................................... 93
3.1.7 HAL_MspDeInit ................................................................................ 93
3.1.8 HAL_InitTick ..................................................................................... 94
3.1.9 HAL_IncTick ..................................................................................... 94
3.1.10 HAL_GetTick .................................................................................... 94
3.1.11 HAL_Delay ....................................................................................... 94
3.1.12 HAL_SuspendTick ............................................................................ 95
3.1.13 HAL_ResumeTick ............................................................................. 95
3.1.14 HAL_GetHalVersion ......................................................................... 95
3.1.15 HAL_GetREVID ................................................................................ 95
3.1.16 HAL_GetDEVID ................................................................................ 95
3.1.17 HAL_DBGMCU_EnableDBGSleepMode ......................................... 96
3.1.18 HAL_DBGMCU_DisableDBGSleepMode ........................................ 96
3.1.19 HAL_DBGMCU_EnableDBGStopMode ........................................... 96
3.1.20 HAL_DBGMCU_DisableDBGStopMode .......................................... 96
3.1.21 HAL_DBGMCU_EnableDBGStandbyMode ..................................... 96
3.1.22 HAL_DBGMCU_DisableDBGStandbyMode .................................... 96
3.1.23 HAL_EnableCompensationCell ........................................................ 96
3.1.24 HAL_DisableCompensationCell ....................................................... 97
3.2 HAL Firmware driver defines ........................................................... 97
3.2.1 HAL ................................................................................................... 97
4 HAL ADC Generic Driver ............................................................. 100
4.1 ADC Firmware driver registers structures ..................................... 100
4.1.1 ADC_InitTypeDef ............................................................................ 100
4.1.2 ADC_HandleTypeDef ..................................................................... 101
4.1.3 ADC_ChannelConfTypeDef ........................................................... 101
4.1.4 ADC_AnalogWDGConfTypeDef ..................................................... 102
4.2 ADC Firmware driver API description ............................................ 103
4.2.1 ADC Peripheral features................................................................. 103
4.2.2 How to use this driver ..................................................................... 103
4.2.3 Initialization and de-initialization functions ..................................... 105
4.2.4 IO operation functions .................................................................... 105
Contents
UM1725
4/900
DOCID025834 Rev 2
4.2.5 Peripheral Control functions ........................................................... 106
4.2.6 Peripheral State and errors functions ............................................. 106
4.2.7 HAL_ADC_Init ................................................................................ 106
4.2.8 HAL_ADC_DeInit ............................................................................ 107
4.2.9 HAL_ADC_MspInit ......................................................................... 107
4.2.10 HAL_ADC_MspDeInit ..................................................................... 107
4.2.11 HAL_ADC_Start ............................................................................. 107
4.2.12 HAL_ADC_Stop .............................................................................. 107
4.2.13 HAL_ADC_PollForConversion ....................................................... 108
4.2.14 HAL_ADC_PollForEvent ................................................................ 108
4.2.15 HAL_ADC_Start_IT ........................................................................ 108
4.2.16 HAL_ADC_Stop_IT ........................................................................ 109
4.2.17 HAL_ADC_IRQHandler .................................................................. 109
4.2.18 HAL_ADC_Start_DMA ................................................................... 109
4.2.19 HAL_ADC_Stop_DMA.................................................................... 109
4.2.20 HAL_ADC_GetValue ...................................................................... 110
4.2.21 HAL_ADC_ConvCpltCallback ........................................................ 110
4.2.22 HAL_ADC_ConvHalfCpltCallback .................................................. 110
4.2.23 HAL_ADC_LevelOutOfWindowCallback ........................................ 110
4.2.24 HAL_ADC_ErrorCallback ............................................................... 110
4.2.25 HAL_ADC_ConfigChannel ............................................................. 110
4.2.26 HAL_ADC_AnalogWDGConfig ...................................................... 111
4.2.27 HAL_ADC_GetState ....................................................................... 111
4.2.28 HAL_ADC_GetError ....................................................................... 111
4.3 ADC Firmware driver defines ........................................................ 111
4.3.1 ADC ................................................................................................ 111
5 HAL ADC Extension Driver ......................................................... 120
5.1 ADCEx Firmware driver registers structures ................................. 120
5.1.1 ADC_InjectionConfTypeDef ........................................................... 120
5.1.2 ADC_MultiModeTypeDef ................................................................ 121
5.2 ADCEx Firmware driver API description ....................................... 121
5.2.1 How to use this driver ..................................................................... 121
5.2.2 Extended features functions ........................................................... 122
5.2.3 HAL_ADCEx_InjectedStart ............................................................ 123
5.2.4 HAL_ADCEx_InjectedStart_IT ....................................................... 123
5.2.5 HAL_ADCEx_InjectedStop ............................................................. 123
5.2.6 HAL_ADCEx_InjectedPollForConversion ...................................... 124
5.2.7 HAL_ADCEx_InjectedStop_IT ....................................................... 124
UM1725
Contents
DOCID025834 Rev 2
5/900
5.2.8 HAL_ADCEx_InjectedGetValue ..................................................... 124
5.2.9 HAL_ADCEx_MultiModeStart_DMA .............................................. 124
5.2.10 HAL_ADCEx_MultiModeStop_DMA ............................................... 125
5.2.11 HAL_ADCEx_MultiModeGetValue ................................................. 125
5.2.12 HAL_ADCEx_InjectedConvCpltCallback ....................................... 125
5.2.13 HAL_ADCEx_InjectedConfigChannel ............................................ 125
5.2.14 HAL_ADCEx_MultiModeConfigChannel ........................................ 126
5.3 ADCEx Firmware driver defines .................................................... 126
5.3.1 ADCEx ............................................................................................ 126
6 HAL CAN Generic Driver ............................................................. 129
6.1 CAN Firmware driver registers structures ..................................... 129
6.1.1 CAN_InitTypeDef ............................................................................ 129
6.1.2 CAN_FilterConfTypeDef ................................................................. 130
6.1.3 CanTxMsgTypeDef ......................................................................... 131
6.1.4 CanRxMsgTypeDef ........................................................................ 131
6.1.5 CAN_HandleTypeDef ..................................................................... 132
6.2 CAN Firmware driver API description ............................................ 133
6.2.1 How to use this driver ..................................................................... 133
6.2.2 Initialization and de-initialization functions ..................................... 134
6.2.3 IO operation functions .................................................................... 134
6.2.4 Peripheral State and Error functions .............................................. 134
6.2.5 HAL_CAN_Init ................................................................................ 135
6.2.6 HAL_CAN_ConfigFilter................................................................... 135
6.2.7 HAL_CAN_DeInit ............................................................................ 135
6.2.8 HAL_CAN_MspInit ......................................................................... 135
6.2.9 HAL_CAN_MspDeInit ..................................................................... 135
6.2.10 HAL_CAN_Transmit ....................................................................... 136
6.2.11 HAL_CAN_Transmit_IT .................................................................. 136
6.2.12 HAL_CAN_Receive ........................................................................ 136
6.2.13 HAL_CAN_Receive_IT ................................................................... 136
6.2.14 HAL_CAN_Sleep ............................................................................ 136
6.2.15 HAL_CAN_WakeUp ....................................................................... 137
6.2.16 HAL_CAN_IRQHandler .................................................................. 137
6.2.17 HAL_CAN_TxCpltCallback ............................................................. 137
6.2.18 HAL_CAN_RxCpltCallback ............................................................ 137
6.2.19 HAL_CAN_ErrorCallback ............................................................... 137
6.2.20 HAL_CAN_GetState ....................................................................... 138
6.2.21 HAL_CAN_GetError ....................................................................... 138
剩余899页未读,继续阅读
资源评论
- yuanbai1002018-05-28有用,谢谢!
kuaileing5
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功