庫V3.5 main等源文件中不再直接包含stm32f10x_conf.h,而是stm32f10x.h,主程序第一句話就是#include“stm32f10x.h”。而stm32f10x_conf.h被包含在了stm32f10x.h中,間接包含進了用戶主程序文件。stm32f10x.h則定義了啟動設置,以及所有寄存器宏定義,此文件中需要注意的有:
設備(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)
#endif
判斷是否選擇了設備(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)
#endif
未選擇任何設備時,將會報錯,所以在這之前的地“open for targe->C++”中需要預定義設備,我自己的是STM32F10X_HD。
#if !defined USE_STDPERIPH_DRIVER
#endif
#ifdef USE_STDPERIPH_DRIVER
#endif
所以也要對USE_STDPERIPH_DRIVER進行預定義,否則我們將無法使用庫件庫