原子的标准例程库函数版,使用的底层驱动是基于ST的固件库。
拿定时器Timer模块举例。如下图1,打开实验8,定时器中断。
此实验中使用到的文件是:stm32f4xx_tim.c
它被包含在固件外设库 STM32F4xx_DSP_StdPeriph_Lib_V1.7.0 当中(今天在ST下到的版本是1.7).
手里有另一个工程例子集STM32Cube_FW_F4_V1.11.0,而它里面用到的库文件是stm32f4xx_hal_tim.c
下图2.
stm32f4xx_tim.c 文件:
******************************************************************************
* @file stm32f4xx_tim.c
* @author MCD Application Team
* @version V1.4.0
* @date 04-August-2014
* @brief This file provides firmware functions to manage the following
* functionalities of the TIM peripheral:
* + TimeBase management
* + Output Compare management
* + Input Capture management
* + Advanced-control timers (TIM1 and TIM8) specific features
* + Interrupts, DMA and flags management
* + Clocks management
* + Synchronization management
* + Specific interface management
* + Specific remapping management
*
@verbatim
===============================================================================
...
...
...
stm32f4xx_hal_tim.c 文件:
******************************************************************************
* @file stm32f4xx_hal_tim.c
* @author MCD Application Team
* @version V1.4.4
* @date 22-January-2016
* @brief TIM HAL module driver.
* This file provides firmware functions to manage the following
* functionalities of the Timer (TIM) peripheral:
* + Time Base Initialization
* + Time Base Start
* + Time Base Start Interruption
* + Time Base Start DMA
* + Time Output Compare/PWM Initialization
* + Time Output Compare/PWM Channel Configuration
* + Time Output Compare/PWM Start
* + Time Output Compare/PWM Start Interruption
* + Time Output Compare/PWM Start DMA
* + Time Input Capture Initialization
* + Time Input Capture Channel Configuration
* + Time Input Capture Start
* + Time Input Capture Start Interruption
* + Time Input Capture Start DMA
* + Time One Pulse Initialization
* + Time One Pulse Channel Configuration
* + Time One Pulse Start
* + Time Encoder Interface Initialization
* + Time Encoder Interface Start
* + Time Encoder Interface Start Interruption
* + Time Encoder Interface Start DMA
* + Commutation Event configuration with Interruption and DMA
* + Time OCRef clear configuration
* + Time External Clock configuration
@verbatim
==============================================================================
请问,这两个文件的区别是什么?
十分困惑的,选择哪类的驱动库文件使用到自己的项目工程中去,谢谢解答!
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>