STM32 GPIO with STM32F10x_StdPeriph_Lib_V3.2.0
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2010-04-12 5:45 PM
Posted on April 13, 2010 at 02:45
STM32 GPIO with STM32F10x_StdPeriph_Lib_V3.2.0
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:46 AM
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 */Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:46 AM
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.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:46 AM
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)