手册中的GPIO功能表:
— Port A(GPA): 25-output port
— Port B(GPB): 11-input/out port
— Port C(GPC): 16-input/output port
— Port D(GPD): 16-input/output port
— Port E(GPE): 16-input/output port
— Port F(GPF): 8-input/output port
— Port G(GPG): 16-input/output port
— Port H(GPH): 9-input/output port
— Port J(GPJ): 13-input/output port
下面看看GPIO的寄存器是咋样的:
在CPU上访问寄存器可以直接访问如:R1 R2……
现在我们要访问的是外设GPIO控制器的寄存器,因为现在是使用的内存映射,所以我们是通过这些地址去间接访问寄存器。
GPXCON寄存器:
可以看到GPDCON就可以控制这组IO的输入输出模式或者设置为
外设功能。