配置及程序: EMI_Base_addr EQU 0x6C000000; EMI base address BCON0_off_addr EQU 0x00 ; Bank 0 configuration register offset BCON1_off_addr EQU 0x04 ; Bank 1 configuration register offset BCON2_off_addr EQU 0x08 ; Bank 2 configuration register offset BCON3_off_addr EQU 0x0C ; Bank 3 configuration register offset
EMI_ENABLE EQU 0x8000 EMI_SIZE_16 EQU 0x0001
GPIO2_Base_addr EQU 0xE0005000; GPIO2 base address PC0_off_addr EQU 0x00 ; Port Configuration Register 0 offset PC1_off_addr EQU 0x04 ; Port Configuration Register 1 offset PC2_off_addr EQU 0x08 ; Port Configuration Register 2 offset PD_off_addr EQU 0x0C ; Port Data Register offset LDR r0, =GPIO2_Base_addr ; Configure P2.0 -> 7 in AF_PP LDR r2, [r0, #PC0_off_addr] ORR r2, r2,#0x000000FF STR r2, [r0, #PC0_off_addr] LDR r2, [r0, #PC1_off_addr] ORR r2, r2,#0x000000FF STR r2, [r0, #PC1_off_addr] LDR r2, [r0, #PC2_off_addr] ORR r2, r2,#0x000000FF STR r2, [r0, #PC2_off_addr] LDR r0, =EMI_Base_addr LDR r1, =0x18:OR:EMI_ENABLE:OR:EMI_SIZE_16 STR r1, [r0, #BCON1_off_addr] ; Enable bank 1 16-bit 7 这段程序是在官方网站上下载的71x_init.s启动文件 |