-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcode.asm
More file actions
58 lines (53 loc) · 1.09 KB
/
code.asm
File metadata and controls
58 lines (53 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.equ GPIO, 2
.equ GPSEL, 0x7E200000 + (GPIO/10)*4
.equ GPSET, 0x7E20001C + (GPIO>>5)*4
.equ GPCLR, 0x7E200028 + (GPIO>>5)*4
mov r1, GPSEL
ld r0, (r1)
and r0, ~(0b111<<((GPIO%10)*3)) #set our GPIO as output
or r0, 1<<((GPIO%10)*3)
st r0, (r1)
mov r1, GPSET
mov r2, GPCLR
mov r3, 1<<(GPIO%32) #our GPIO's bit
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
st r3, (r2) #low
st r3, (r1) #high
rts