cancel
Showing results for 
Search instead for 
Did you mean: 

how stm32f0xx_conf.h file is supposed to be used

joemccarr
Senior
Posted on September 28, 2016 at 01:21

Does anyone know how stm32f0xx_conf.h file is supposed to be used.

I normally just put the header files I need in either the source file or other header files.

I went thru some of the example projects where this file was included but I did not see if used by any other header or source file.

Thx

#- #header-files #stm32f0xx #std-peripheral-lib
3 REPLIES 3
Posted on September 28, 2016 at 04:09

It is where project specific stuff lives, is pulled in via stm32f0xx.h when USE_STD_PERIPH is defined on the compile command line. This saves the need to individually pull the peripheral include files into other project files. You can also remove unused peripherals.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
joemccarr
Senior
Posted on September 28, 2016 at 18:22

Thanks for the reply Clive1

So I tried it out and what I saw was:

If I declare GPIO_InitTypeDef    GPIO_InitStructure; in Main.c  I have to ''#include

stm32f0xx_gpio.h'' in Main.c or the program doesn't compile.  I was thinking with

stm32f0xx_conf.h included in the project the type GPIO_InitTypeDef type would be known to the compiler.

I have stm32f0xx.rcc functions in main but it compiles fine without include that header file in Main. 

Is it supposed to work that way.

Thx

Posted on September 28, 2016 at 19:44

The mechanics as outlined in the project templates is to #include ''stm32f0xx.h''

STM32F0xx_StdPeriph_Lib_V1.5.0\Projects\STM32F0xx_StdPeriph_Templates

Where it has defines

USE_STDPERIPH_DRIVER,STM32F051,USE_STM320518_EVAL,USE_DEFAULT_TIMEOUT_CALLBACK

You shouldn't need to pull the individual GPIO and RCC files, as these would be collected via STM32F0xx_StdPeriph_Lib_V1.5.0\Projects\STM32F0xx_StdPeriph_Templates\stm32f0xx_conf.h

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..