RT1062 >> Assembly
Button
參考資訊:
1. ds_pdf
2. pm_pdf
3. baremetal-blinky.teensy
4. MCUX_Flashloader_Reference_Manual
按鍵連接到B1_09
GPIO Select
GPIO Direction
GPIO Input/Output
GPIO Pull-up
main.s
.equiv IOMUXC_SW_PAD_CTL_PAD_GPIO_BASE, 0x401f8000 .equiv SW_PAD_CTL_PAD_GPIO_AD_B1_09, 0x310 .equiv IOMUXC_GPR_BASE, 0x400ac000 .equiv GPR_GPR26, 0x68 .equiv GPR_GPR27, 0x6c .equiv IMXRT_GPIO6_BASE, 0x42000000 .equiv IMXRT_GPIO7_BASE, 0x42004000 .equiv GPIO_DR, 0x00 .equiv GPIO_GDIR, 0x04 .thumb .cpu cortex-m7 .syntax unified .global _start .text _flashconfig: .word 0x42464346 .word 0x56010000 .word 0 .word 0x20101 .word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 .word 0x30401 .word 0, 0 .word 0x200000 .word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 .word 0xa1804eb .word 0x26043206 .word 0, 0 .word 0x24040405 .word 0, 0, 0, 0, 0, 0, 0 .word 0x406 .word 0, 0, 0, 0, 0, 0, 0 .word 0x8180420 .word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 .word 0x81804d8 .word 0, 0, 0 .word 0x8180402 .word 0x2004 .word 0, 0, 0, 0, 0, 0 .word 0x460 .word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 .word 0x100 .word 0x1000 .word 1 .word 0 .word 0x10000 .word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 .org 0x1000 .text _ivt: .word 0x402000d1 .word _start .word 0 .word 0 .word _bootdata .word _ivt .word 0 .word 0 .text _bootdata: .word 0x60000000 .word flashimagelen .word 0 .text _start: .word 0x20010000 .word reset .section .text .thumb_func reset: ldr r0, =IOMUXC_GPR_BASE ldr r1, =0xffffffff str r1, [r0, #GPR_GPR26] str r1, [r0, #GPR_GPR27] ldr r0, =IOMUXC_SW_PAD_CTL_PAD_GPIO_BASE ldr r1, [r0, #SW_PAD_CTL_PAD_GPIO_AD_B1_09] orr r1, #(1 << 14) | (1 << 13) str r1, [r0, #SW_PAD_CTL_PAD_GPIO_AD_B1_09] ldr r0, =IMXRT_GPIO6_BASE ldr r1, [r0, #GPIO_GDIR] bic r1, #(1 << 25) str r1, [r0, #GPIO_GDIR] ldr r0, =IMXRT_GPIO7_BASE ldr r1, [r0, #GPIO_GDIR] orr r1, #(1 << 3) str r1, [r0, #GPIO_GDIR] 0: ldr r0, =IMXRT_GPIO6_BASE ldr r1, [r0, #GPIO_DR] lsr r1, #22 eor r1, #0xff ldr r0, =IMXRT_GPIO7_BASE str r1, [r0, #GPIO_DR] b 0b .end
完成