关于STM32标准外设库中的 USE_STDPERIPH_DRIVER, STM32F10X_MD
2017-08-17 21:16
447 查看
在用STM32开发项目中使用stm32标准外设库(STM32F10x Standard Peripherals Library)的时候,我们会在项目的选项(C/C++)中预定义两个宏定义:USE_STDPERIPH_DRIVER, STM32F10X_MD
1、 USE_STDPERIPH_DRIVER : to use or not the peripheral’s drivers in application code (i.e. code will be based on direct access to peripheral’s registers rather than drivers API) , this option is controlled by the #define USE_STDPERIPH_DRIVER
2、STM32F10X_MD:每种类别都有所区别,例如sram或者flash或者外设数量不一样,所以stm32标准外设库必须根据你使用的处理器来做相应的预处理。
This define will control the declaration of the following part of the Standard Peripherals library:
IRQ channel definition
Peripheral memory mapping and physical registers address definition
Peripheral pointer declaration and driver header file inclusion
Product miscellaneous configuration: external quartz (HSE) value…
Peripheral with Features w/ different/incompatible implementation across the family
Note : This define doesn’t apply to peripheral drivers, these drivers are always supporting features of the family’s superset.
User has only to select which device he will use by controlling preprocessor define declared in stm32f10x.h file ( No selected device by default) then the library will be configured accordingly。我们可以更改stm32f10x.h中的定义,这样,就不用在项目(C/C++)的定义中填写
1、 USE_STDPERIPH_DRIVER : to use or not the peripheral’s drivers in application code (i.e. code will be based on direct access to peripheral’s registers rather than drivers API) , this option is controlled by the #define USE_STDPERIPH_DRIVER
即这个定义控制了是否在应用中启用外设驱动。我们使用标准外设库本来就为了方便控制外设,所以要添加这个定义,以启用外设驱动。
2、STM32F10X_MD:每种类别都有所区别,例如sram或者flash或者外设数量不一样,所以stm32标准外设库必须根据你使用的处理器来做相应的预处理。
This define will control the declaration of the following part of the Standard Peripherals library:
IRQ channel definition
Peripheral memory mapping and physical registers address definition
Peripheral pointer declaration and driver header file inclusion
Product miscellaneous configuration: external quartz (HSE) value…
Peripheral with Features w/ different/incompatible implementation across the family
Note : This define doesn’t apply to peripheral drivers, these drivers are always supporting features of the family’s superset.
User has only to select which device he will use by controlling preprocessor define declared in stm32f10x.h file ( No selected device by default) then the library will be configured accordingly。我们可以更改stm32f10x.h中的定义,这样,就不用在项目(C/C++)的定义中填写
相关文章推荐
- 关于STM32 MDK中USE_STDPERIPH_DRIVER问题及 STM32F10X_LD STM32F10X_MD STM32F10X_HD STM32F10X_CL宏定义的选择
- STM32标准外设库中USE_STDPERIPH_DRIVER, STM32F10X_MD的含义
- stm32标准外设库中USE_STDPERIPH_DRIVER, STM32F10X_MD的含义
- STM32标准外设库中USE_STDPERIPH_DRIVER, STM32F10X_MD的含义
- STM32标准外设库中USE_STDPERIPH_DRIVER, STM32F10X_MD的含义
- MDK设置中USE_STDPERIPH_DRIVER,STM32F10X_HD含义
- 关于STM32 MDK中USE_STDPERIPH_DRIVER问题的解释
- 关于STM32 MDK中USE_STDPERIPH_DRIVER问题的解释
- stm32开发环境加入STM32F10X_HD和USE_STDPERIPH_DRIVER两个宏
- 关于STM32 MDK中USE_STDPERIPH_DRIVER问题的解释
- 关于STM32 MDK中USE_STDPERIPH_DRIVER问题的解释
- USE_STDPERIPH_DRIVER, STM32F10X_HD说明
- USE_STDPERIPH_DRIVER, STM32F10X_HD说明
- USE_STDPERIPH_DRIVER, STM32F10X_HD说明
- stm32 加入 USE_STDPERIPH_DRIVER、STM32F10X_HD的原因
- 【转载】keil5中加入STM32F10X_HD,USE_STDPERIPH_DRIVER的原因
- keil5以上版本开发stm32不需要定义STM32F10X_HD,USE_STDPERIPH_DRIVER
- stm32 加入 USE_STDPERIPH_DRIVER、STM32F10X_HD的原因
- stm32 加入 USE_STDPERIPH_DRIVER、STM32F10X_HD的原因
- 关于STM32 MDK中USE_STDPERIPH_DRIVER问题的解释