详解STM32F10x头文件
在stm32f10x_conf.h上右击鼠标,open “stm32f10x_conf.h”,打开stm32f10x_conf.h文件。
stm32f10x_conf.h文件是项目配置头文件,该头文件设置了所有用到的外设,没有用到的外设可以将其屏蔽掉,以节省编译时间。
提示:如果修改不了stm32f10x_conf.h文件时,是因为该文件是只读属性,在属性中修改即可。
注意到main函数中有
#ifdef DEBUG
debug();
#endif
还有,单片机的外部高速晶振HSE,不同的开发板可以有不同的值。那么HSE的值是在哪定义的呢?还是在stm32f10x_conf.h中。
/* Includes ------------------------------------------------------------------*/
#include "stm32f10x_type.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Uncomment the line below to compile the library in DEBUG mode, this will expanse
the "assert_param" macro in the firmware library code (see "Exported macro"
section below) */
/* #define DEBUG 1 */
/* Comment the line below to disable the specific peripheral inclusion */
/************************************* ADC ************************************/
//#define _ADC
//#define _ADC1
//#define _ADC2
/************************************* BKP ************************************/
//#define _BKP
/************************************* CAN ************************************/
//#define _CAN
/************************************* DMA ************************************/
//#define _DMA
//#define _DMA_Channel1
//#define _DMA_Channel2
//#define _DMA_Channel3
//#define _DMA_Channel4
//#define _DMA_Channel5
//#define _DMA_Channel6
//#define _DMA_Channel7
/************************************* EXTI ***********************************/
//#define _EXTI
/************************************* FLASH and Option Bytes *****************/
#define _FLASH
/* Uncomment the line below to enable FLASH program/erase/protections functions,
otherwise only FLASH configuration (latency, prefetch, half cycle) functions
are enabled */
/* #define _FLASH_PROG */
/************************************* GPIO ***********************************/
#define _GPIO
//#define _GPIOA
//#define _GPIOB
//#define _GPIOC
//#define _GPIOD
//#define _GPIOE
#define _AFIO
/************************************* I2C ************************************/
//#define _I2C
//#define _I2C1
//#define _I2C2
/************************************* IWDG ***********************************/
//#define _IWDG
/************************************* NVIC ***********************************/
#define _NVIC
/************************************* PWR ************************************/
//#define _PWR
/************************************* RCC ************************************/
#define _RCC
/************************************* RTC ************************************/
//#define _RTC
/************************************* SPI ************************************/
//#define _SPI
//#define _SPI1
//#define _SPI2
/************************************* SysTick ********************************/
//#define _SysTick
/************************************* TIM1 ***********************************/
//#define _TIM1
/************************************* TIM ************************************/
//#define _TIM
//#define _TIM2
//#define _TIM3
//#define _TIM4
/************************************* USART **********************************/
//#define _USART
//#define _USART1
//#define _USART2
//#define _USART3
/************************************* WWDG ***********************************/
//#define _WWDG
/* In the following line adjust the value of External High Speed oscillator (HSE)
used in your application */
#define HSE_Value ((u32)8000000) /* Value of the External oscillator in Hz*/
/* Exported macro ------------------------------------------------------------*/
#ifdef DEBUG
/*******************************************************************************
* Macro Name : assert_param
* Description : The assert_param macro is used for functions parameters check.
* It is used only if the library is compiled in DEBUG mode.
* Input : - expr: If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* If expr is true, it returns no value.
* Return : None
*******************************************************************************/
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((u8 *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(u8* file, u32 line);
#else
#define assert_param(expr) ((void)0)
#endif /* DEBUG */
STM32F10x头文 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)