stm32f10x_conf.h 与 stm32f10x.h
来源:互联网 发布:网络最吃香的职业 编辑:程序博客网 时间:2024/05/07 12:18
1、device选择
#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL)
/* #define STM32F10X_LD */ /*!< STM32F10X_LD: STM32 Low density devices */
/* #define STM32F10X_LD_VL */ /*!< STM32F10X_LD_VL: STM32 Low density Value Line devices */
/* #define STM32F10X_MD */ /*!< STM32F10X_MD: STM32 Medium density devices */
#define STM32F10X_MD
/* #define STM32F10X_MD_VL */ /*!< STM32F10X_MD_VL: STM32 Medium density Value Line devices */
/* #define STM32F10X_HD */ /*!< STM32F10X_HD: STM32 High density devices */
/* #define STM32F10X_HD_VL */ /*!< STM32F10X_HD_VL: STM32 High density value line devices */
/* #define STM32F10X_XL */ /*!< STM32F10X_XL: STM32 XL-density devices */
/* #define STM32F10X_CL */ /*!< STM32F10X_CL: STM32 Connectivity line devices */
#endif
此段代码在stm32f10x.h的开始处,根据所用的器件 取消合适的注释。我常用的是stm32f103c8t6 属于Medium density Value Line devices.
2、外部时钟频率选择
#if !defined HSE_VALUE
#ifdef STM32F10X_CL
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
#else
#define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
#endif /* STM32F10X_CL */
#endif /* HSE_VALUE */
注意STM32F10X_CL,STM32F10X_CL是stm32f105 和stm32f107 互联型的device,用到此器件外部要选用25MHz的晶体,由于前面的代买没有取消 /* #define STM32F10X_CL */ /*!< STM32F10X_CL: STM32 Connectivity line devices */的注释,所以此处默认的外部8MHz的晶体
3、外设宏定义USE_STDPERIPH_DRIVER
#if !defined USE_STDPERIPH_DRIVER
/**
* @brief Comment the line below if you will not use the peripherals drivers.
In this case, these drivers will not be included and the application code will
be based on direct access to peripherals registers
*/
/*#define USE_STDPERIPH_DRIVER*/
#endif
如果不适用片内外设,则不要取消 /*#define USE_STDPERIPH_DRIVER*/的注释
注意stm32f10x.h文件的最后有这样的代码:
#ifdef USE_STDPERIPH_DRIVER
#include "stm32f10x_conf.h"
#endif
stm32f10x_conf.h中包含了所有外设的头文件,因此任意源文件只要包含了stm32f10x.h,就可以在源文件调用任意外设的函数。
若有外设未使用到,在stm32f10x_conf.h注释相应部分,项目编译时就不会在编译去掉的外设。
- stm32f10x_conf.h 与 stm32f10x.h
- stm32f10x_conf.h 与 stm32f10x.h
- stm32f10x_conf.h 与 stm32f10x.h
- stm32f10x_conf.h 与 stm32f10x.h(转载)
- stm32f10x_conf.h 与 stm32f10x.h USE_STDPERIPH_DRIVER
- stm32f10x.h阅读记录
- 简单解析stm32F10x.h
- stm32f10x.h解析
- stm32f10x.h 地址映射
- 详细分析stm32f10x.h
- 详细分析stm32f10x.h
- 详细分析stm32f10x.h
- stm32f10x.h 的 #ifdef __cplusplus
- STM32中stm32f10x.h解析
- stm32f10x.h 头文件解析
- stm32f10x_conf.h 的 #define assert_param(expr) ((void)0)
- 关于STM32F103 V3.5.0固件库stm32f10x_conf.h文件
- STM32 cannot open source input file "stm32f10x_conf.h"错误
- POI读取Excel(兼容Excel2003、Excel2007)
- JavaScript你所不知道的困惑(1)
- JS实现简单的图片轮转
- When and how should I use a ThreadLocal variable?
- sql的执行原理和执行顺序
- stm32f10x_conf.h 与 stm32f10x.h
- JS打开选择本地文件的对话框
- 多态
- 产品经理必备文档的介绍
- 什么是Page Objects(PageObjects 设计模式)
- 文字的布局
- Vim 常用命令总结
- Ubuntu下Apache、php、mysql默认安装路径
- 文件锁(Filelock)