赞
踩
- @1使能GPIO的外设时钟
- ldr r0,=0x50000A28
- ldr r1,[r0]
- orr r1,r1,#(0x3<<4)//使能第4,5位
- str r1,[r0]
- @设置GPIOE10为输出模式
- ldr r0,=0x50006000
- ldr r1,[r0]
- bic r1,r1,#(0x3<<20)
- orr r1,r1,#(0x1<<20)
- str r1,[r0]
- @GPIOE8
- ldr r0,=0x50006000
- ldr r1,[r0]
- bic r1,r1,#(0x3<<16)
- orr r1,r1,#(0x1<<16)
- str r1,[r0]
- @GPIOF10
- ldr r0,=0x50007000
- ldr r1,[r0]
- bic r1,r1,#(0x3<<20)
- orr r1,r1,#(0x1<<20)
- str r1,[r0]
-
- @设置PE10为推挽输出
- ldr r0,=0x50006004
- ldr r1,[r0]
- bic r1,r1,#(0x1<<10)
- str r1,[r0]
-
- ldr r0,=0x50007004
- ldr r1,[r0]
- bic r1,r1,#(0x1<<10)
- str r1,[r0]
-
- ldr r0,=0x50006004
- ldr r1,[r0]
- bic r1,r1,#(0x1<<8)
- str r1,[r0]
- @设置PE10为低速输出
- ldr r0,=0x50006008
- ldr r1,[r0]
- bic r1,r1,#(0x3<<20)
- str r1,[r0]
-
- ldr r0,=0x50006008
- ldr r1,[r0]
- bic r1,r1,#(0x3<<16)
- str r1,[r0]
- @GPIOF10
- ldr r0,=0x50007008
- ldr r1,[r0]
- bic r1,r1,#(0x3<<20)
- str r1,[r0]
- light1_off:
- ldr r0,=0x50006014
- ldr r1,[r0]
- bic r1,r1,#(0x1<<10)
- str r1,[r0]
- mov pc,lr
-
- light2_up:
- @点亮灯
- ldr r0,=0x50006014
- ldr r1,[r0]
- orr r1,r1,#(0x1<<8)
- str r1,[r0]
- mov pc,lr
- light2_off:
- ldr r0,=0x50006014
- ldr r1,[r0]
- bic r1,r1,#(0x1<<8)
- str r1,[r0]
- mov pc,lr
-
- light3_up:
- @点亮灯
- ldr r0,=0x50007014
- ldr r1,[r0]
- orr r1,r1,#(0x1<<10)
- str r1,[r0]
- mov pc,lr
- light3_off:
- ldr r0,=0x50007014
- ldr r1,[r0]
- bic r1,r1,#(0x1<<10)
- str r1,[r0]
- mov pc,lr
- delay:
- ldr r3,=0x10000000
- delay1:
- cmp r3,#0
- subne r3,r3,#1
- bne delay1
- mov pc,lr
- bl loop
- loop:
- bl light3_off
- bl light1_up
- bl delay
- bl light1_off
- bl light2_up
- bl delay
- bl light2_off
- bl light3_up
- bl delay
-
- b loop
- .end
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。