stm32f10x_conf.h 与 stm32f10x.h
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注释相应部分,项目编译时就不会在编译去掉的外设。
转载:http://hi.baidu.com/ancient2008/blog/item/ea0ea30d4aa59cd53bc7638c.html
stm32f10x_conf.h 与 stm32f10x.h相关推荐
- stm32中stm32f10x_type.h(固件3.0以前)、stm32f10x.h(固件3.0以后)、stdint.h文件的关系
在stm32f10x的3.5固件库中stm32f10x.h有以下代码(第478行开始): /*** @}*/#include "core_cm3.h" #include " ...
- 详细分析stm32f10x.h
/**这里是STM32比较重要的头文件 ***************************************************************************** ...
- stm32f10x.h解析
/**这里是STM32比较重要的头文件 *************************************************************************** ...
- ..\USER\stm32f10x.h(428): error: #67: expected a “}“ ADC1_2_IRQn = 18, /*!<
MDK软件编译,出现如下错误: ..\USER\stm32f10x.h(428): error: #67: expected a "}"ADC1_2_IRQn = 18, /*!& ...
- error in include chain(stm32f10x.h)
用keil5,在cm3_core.h添加#include "stm32f10x.h"后,这里报错:error in include chain(stm32f10x.h).删除后就恢 ...
- #include Windows.h 和 Winsock2.h冲突的改进解决方案
#include <Windows.h> #include <Winsock2.h> 上面的代码会导致重定义错误, 原因就是 Windows.h 中包含了 Winsock.h( ...
- Linux的目录结构和头文件相关;哪里找- sys/types.h, sys/stat.h
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/qq_29757283/article/ ...
- C语言stdio.h与stdlib.h的区别
一.定位不同 1.stdlib.h是standard library标准库头文件,定位在通用工具函数. 2.stdio.h是standard input&output标准输入输出头文件,定位在 ...
- 最简单的基于librtmp的示例:发布H.264(H.264通过RTMP发布)
===================================================== 最简单的基于libRTMP的示例系列文章列表: 最简单的基于librtmp的示例:接收(RT ...
最新文章
- 论文,质量管理+进度管理(主质量)
- c语言坐标三角形判断,【C语言】判断三角形类型(示例代码)
- Electric device abnormal detection based on IoT and knowledge graph-学习笔记
- 关于gedit的编码问题
- datagridview 绑定list 不能刷新界面_人人都可写代码-H5零基础编程-首页界面实操06...
- websocket 发送图片_Netty(四)实现WebSocket
- Centos 7/linux 安装gcc 教程
- caxa明细表导入零件材质_caxa中如何使明细表风格应用到任一个图纸中
- mysql .idb_mysql.idb
- 利用akshare读取50EFF期权1
- 完美Zotero文件同步,Zotero+Koofr+OneDrive神器叠buff
- 用电脑远程给海信智能电视安装软件的办法
- java 检测u盘_java实现监听u盘示例分享
- 计算机组成原理 十套,计算机组成原理十套卷答案白中英(74页)-原创力文档...
- HDU-1278-逃离迷宫
- 如何用ps做故障艺术风格效果
- 金立android 7.1.1,金立K30Pro正式上市:运行安卓7.1.1系统,699元起
- 小傻蛋的妹妹跟随小甲鱼学习Python的第二节002
- Java Web项目开发灵感和知识点总结
- 传奇私服服务器移动玩家位置,传奇私服服务端里面哪个是玩家数据文件文件