STM32标准库文件使用
2015-12-13 17:26
218 查看
1. stm32fxx.h
main.c 开头包含
#include "stm32f2xx.h"
#include "stm322xg_eval.h"
#include "stm322xg_eval_lcd.h"
#include <stdio.h>
stm32f2xx.h开头有
#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 /* USE_STDPERIPH_DRIVER */
stm32f2xx.h结尾有
#ifdef USE_STDPERIPH_DRIVER
#include "stm32f2xx_conf.h"
#endif /* USE_STDPERIPH_DRIVER */
如果想使用标准库只需要去掉 /*#define USE_STDPERIPH_DRIVER*/前后的注释
stm32f2xx_conf.h中包含了各个外设标准库的头文件
#include "stm32f2xx_adc.h"
#include "stm32f2xx_can.h"
#include "stm32f2xx_crc.h"
#include "stm32f2xx_cryp.h"
#include "stm32f2xx_dac.h"
。。。
main.c 开头包含
#include "stm32f2xx.h"
#include "stm322xg_eval.h"
#include "stm322xg_eval_lcd.h"
#include <stdio.h>
stm32f2xx.h开头有
#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 /* USE_STDPERIPH_DRIVER */
stm32f2xx.h结尾有
#ifdef USE_STDPERIPH_DRIVER
#include "stm32f2xx_conf.h"
#endif /* USE_STDPERIPH_DRIVER */
如果想使用标准库只需要去掉 /*#define USE_STDPERIPH_DRIVER*/前后的注释
stm32f2xx_conf.h中包含了各个外设标准库的头文件
#include "stm32f2xx_adc.h"
#include "stm32f2xx_can.h"
#include "stm32f2xx_crc.h"
#include "stm32f2xx_cryp.h"
#include "stm32f2xx_dac.h"
。。。
相关文章推荐
- 利用模板巧妙实现二级接口
- 玩转四旋翼无人机(DJI SDK 使用)
- 【Python】利用setdefault函数实现dict的转置(key与value对互换),统计value出现的次数
- Android菜单的使用
- Office 2016 for mac 的 word模板文件夹位置
- 第九章 虚拟存储器
- android开发之SnackBar的使用
- android开发之SnackBar的使用
- android开发之SnackBar的使用
- 关于IO流制作简单的复制张贴功能
- 【个人重构】数据库设计(3)
- android 读,写图片sd网卡资源
- android开发之SnackBar的使用
- 信道编码——线性分组码
- C/C++编译和链接过程详解 (重定向表,导出符号表,未解决符号表)
- Servlet3.0学习总结(一)——使用注解标注Servlet-2
- 数据结构与算法——字典序最小问题(用string类实现)
- mysql 存储过程
- 如何创建html文件
- 脑洞大开的自然语言验证码