About stm32f10x_conf.h in the peripheral V3.4 version is the use of instructions

Publisher:星尘散落Latest update time:2016-09-26 Source: eefocusKeywords:stm32f10x Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
        Let's talk about this question first. As we all know, when we choose which peripherals to use, we change lines 27-48 of the stm32f10x_conf.h file copied from the official template, include the header files of the peripherals we want to use, and comment out the header files of the peripherals we don't use. But have you noticed that we don't include the stm32f10x_conf.h file in the user main program file at all? So how do we modify this file to enter the main program file? There is only one answer. It is included in the file stm32f10x.h, because in the user main file, we use #include "stm32f10x.h" in the first sentence, so it should be that the stm32f10x.h file includes stm32f10x_conf.h, and is indirectly included in the user main program file. (In fact, if you look at the file structure diagram of the firmware library, you will understand that this is indeed the case. Our speculation is correct, see Figure 1 below)
Regarding stm32f10x_conf.h in the peripheral V3.4 version is the use of instructions - ╄→ wind, blow not scattered - ╄→ wind, blow not scattered

Figure 1. STM32F10xxx Standard Peripheral Library architecture

 

 

  2. With the above understanding, we open stm32f10x_conf.h and search for "stm32f10x_conf.h". We see the following code in lines 8291-8293:
    #ifdef USE_STDPERIPH_DRIVER
      #include "stm32f10x_conf.h"
    #endif
  Do you see the problem? This conditional compilation means: if the USE_STDPERIPH_DRIVER tag is defined, then stm32f10x_conf.h is included, and if it is not defined, it is not included. Needless to say, we want to use the firmware library, so we should predefine the USE_STDPERIPH_DRIVER tag. KEIL provides a way to predefine tags before compiling, which is mentioned above in the project settings "option for target" => "C/C++" tab => "define" to add USE_STDPERIPH_DRIVER. As shown in Figure 2 below:

Regarding stm32f10x_conf.h in the peripheral V3.4 version is the use of instructions - ╄→ wind, blow not scattered - ╄→ wind, blow not scattered

Figure 2. Keil development environment (C/C++ preset window)

 

 

  3. You must have noticed that I added another tag STM32F10X_HD in the preset area above, because you will find that lines 49-58 require us to specify the model of the period
 #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_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


Keywords:stm32f10x Reference address:About stm32f10x_conf.h in the peripheral V3.4 version is the use of instructions

Previous article:Use of callback functions in STM32 USB firmware library
Next article:STM32 USB-HID communication migration steps

Recommended ReadingLatest update time:2024-11-15 11:59

STM32F10x Study Notes 2 (SysTick Timer)
The SysTick timer is integrated into the NVIC. Therefore, any microcontroller with a Cortex-M3 core has it. This study note uses the SysTick timer to implement the revolving lantern function.   The SysTick timer is very simple, with only four registers. The meaning of these four registers is very clear in the book "
[Microcontroller]
Some professional terms in STM32F10x
GPIO (General Purpose Input Output) is a general-purpose input/output port; each GPIO port can be configured as input or output through software; the output is divided into push-pull and open-drain. USART (Universal Synchronous/Asynchronous Receiver/Transmitter) is a universal synchronous/asynchronous serial receive
[Microcontroller]
STM32f10x_type.h file--variable type
/* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F10x_TYPE_H #define __STM32F10x_TYPE_H /* Includes ------------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/ typedef signed lo
[Microcontroller]
About STM32F10X_CONF
I searched the code and found that from: main header file #include "stm32f10x.h" 8296 lines  #ifdef USE_STDPERIPH_DRIVER   #include "stm32f10x_conf.h" #endif The above is about how to locate "stm32f10x_conf.h" ------------------------------------------------------------------------------------ Here is how "stm32f10x_c
[Microcontroller]
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号