2010-04-12 05:45 PM
STM32 GPIO with STM32F10x_StdPeriph_Lib_V3.2.0
2011-05-17 04:46 AM
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 */2011-05-17 04:46 AM
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.2011-05-17 04:46 AM
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)