GPCON(1) ------ PORT A 0x56000000 GPCON(2) ------ PORT B 0x56000010 GPCON(3) ------ PORT C 0x56000020 …… GPCON(8) ------ PORT H 0x56000070
2.#define GPDAT(x) __REG2(0x56000004, (x) * 0x10)
这句是定义2410的GPIO的数据寄存器,定义方法同GPCON宏。
GPDAT(1) ------ PORT A 0x56000004 GPDAT(2) ------ PORT B 0x56000014 GPDAT(3) ------ PORT C 0x56000024 …… GPDAT(8) ------ PORT H 0x56000074
3.#define GPUP(x) __REG2(0x56000008, (x) * 0x10)
这句是定义2410的GPIO的上拉电阻屏蔽/激活寄存器,定义方法同GPCON宏。 GPUP(1) ------ PORT A 0x56000008 GPUP(2) ------ PORT B 0x56000018 GPUP(3) ------ PORT C 0x56000028 …… GPUP(8) ------ PORT H 0x56000078
— Port A (GPA): 23-output port #define PORTA_OFS 0 — Port B (GPB): 11-input/output port #define PORTB_OFS 1 — Port C (GPC): 16-input/output port #define PORTC_OFS 2 — Port D (GPD): 16-input/output port #define PORTD_OFS 3 — Port E (GPE): 16-input/output port #define PORTE_OFS 4 — Port F (GPF): 8-input/output port #define PORTF_OFS 5 — Port G (GPG): 16-input/output port #define PORTG_OFS 6 — Port H (GPH): 11-input/output port #define PORTH_OFS 7