AnsweredAssumed Answered

Basic questions about Alternate Functions

Question asked by lao.jian on Aug 12, 2015
Latest reply on Aug 12, 2015 by lao.jian
Hi all,

I am a beginner of MCU, and right now is digging into STM32F1xx serial MCU, which is pretty old, but simple enough for beginner. 

I have spent a lot of time on some example codes, still with the confusion that how does alternate function of IO pins is defined, or activated? Or in other words, how does a pin know it is configured as AFIO, not default GPIO, and also know what AF it is configured to? Since it may have several alternate functions to choose.

For example, AFIO of pin PB7 of F103 is defined as I2C1_SDA/FSMC_NADV/TIM4_CH2. How can I enable FSMC function, but config PB7 as I2C1_SDA? 

Thanks for your time~~