天使之吻 新生儿:AFIO时钟在什么情况下需要开启?

来源:百度文库 编辑:中财网 时间:2024/04/29 23:16:03
在使用引脚的重映射功能和外部中断时需要使用AFIO时钟。 那又是为什么需要启用RCC_APB2Periph_AFIO才可以正常中断?答:按照电路图和芯片手册,就知道需要打开PD3的复用功能。在参考手册 v9.0的176-177页: 9.2.5 External interrupt/event line mapping The 112 GPIOs are connected to the 16 external interrupt/event lines in the following manner: 图21中显示使用IO口中断时,需要打开对应的AFIO功能:

1. To configure the AFIO_EXTICRx for the mapping of external interrupt/event lines onto GPIOs, the AFIO clock should first be enabled. Refer to Section 6.3.7: APB2 peripheral clock enable register (RCC_APB2ENR) for low-, medium- and high-density devices and, to Section 7.3.7: APB2 peripheral clock

enable register (RCC_APB2ENR) for connectivity line devices.