使用STM32的库和示例工程时需要搞清楚的几个宏定义

1.关于是否使用外设驱动库
USE_STDPERIPH_DRIVER:定义该宏表示使用STM32库的驱动API,在使用时可以在编译器的Preprocessor中定义。

2. 器件类型选择宏
/* #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_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 */
/* Tip: To avoid modifying this file each time you need to switch between these

devices, you can define the device in your toolchain compiler preprocessor.

– Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
where the Flash memory density ranges between 16 and 32 Kbytes.
– Low-density value line devices are STM32F100xx microcontrollers where the Flash
memory density ranges between 16 and 32 Kbytes.
– Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
where the Flash memory density ranges between 64 and 128 Kbytes.
– Medium-density value line devices are STM32F100xx microcontrollers where the
Flash memory density ranges between 64 and 128 Kbytes.
– High-density devices are STM32F101xx and STM32F103xx microcontrollers where
the Flash memory density ranges between 256 and 512 Kbytes.
– High-density value line devices are STM32F100xx microcontrollers where the
Flash memory density ranges between 256 and 512 Kbytes.
– XL-density devices are STM32F101xx and STM32F103xx microcontrollers where
the Flash memory density ranges between 512 and 1024 Kbytes.
– Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.
*/

3.评估板选择宏
STM32100E-EVAL (High-density Value line) evaluation boards ,
STM32100B-EVAL (Medium-density Value line) evaluation boards ,
STM3210C-EVAL (Connectivity line) evaluation boards ,
STM3210E-EVAL (High-density and XL-density) evaluation boards
STM3210B-EVAL (Medium-density) evaluation boards
对应的宏为:USE_STM3210B_EVAL等

发表评论

电子邮件地址不会被公开。 必填项已用*标注