答:因为要对寄存器进行读写!而在STM32中对寄存器的读写都是要打开寄存器对应的时钟才可以的【就像人一样,有了跳动的脉搏手臂才能有能量才能进行各种动作】。 接下来:跟AFIO相关的寄存器有哪些呢? 应用:在usart1串口通信没有端口重映射时为什么不打开AFIO时钟?PA9、PA10作为通用I/O口也复用了,为什么不打开为什么不打开复用时钟? To optimize the number of peripherals available for the 64-pin or the 100-pin or the 144-pin package, it is possible to remap some alternate functions to some other pins. This is achieved by software, by programming the AF remap and debug I/O configuration register(AFIO_MAPR) on page 159. In this case, the alternate functions are no longer mapped to their original assignations.
可见AFIO就设计用来remap some alternate functions to some other pins的,所以根本就没有什么“复用”之说,看来都是翻译惹的祸!另外看一下I/O复用时的情况就更清楚了
|