cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 GPIO with STM32F10x_StdPeriph_Lib_V3.2.0

danielviksporre9
Associate II
Posted on April 13, 2010 at 02:45

STM32 GPIO with STM32F10x_StdPeriph_Lib_V3.2.0

3 REPLIES 3
danielviksporre9
Associate II
Posted on May 17, 2011 at 13:46

 In the example bellow, will the first 3 rows create code for the MCU? or will the precompiler take care of them?

  GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 ;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_Init(GPIOE, &GPIO_InitStructure); /* Configure PE.08 to PE.11 as outputs push-pull */

daviddavid92
Associate II
Posted on May 17, 2011 at 13:46

Yes, that is certainly what I do.

My GPIO init routine is pretty long as a result. I guess you could make it smaller but it would obfuscate it somewhat.

Chris.

yagov
Associate II
Posted on May 17, 2011 at 13:46

  GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6  | GPIO_Pin_7 ;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;

  GPIO_Init(GPIOE, &GPIO_InitStructure);

Yes. It creates code for MCU. If you lln't write it the GPIO will be in ''GPIO_Mode_AIN'' - mode (after reset)