Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GPIO_PORTF_DIR_R EQU 0x40025400
- GPIO_PORTF_DEN_R EQU 0x4002551C
- GPIO_PORTF_DATA_R EQU 0x400253FC
- SYSCTL_RCGCGPIO_R EQU 0x400FE608
- AREA |.text|, CODE, READONLY, ALIGN=2
- THUMB
- EXPORT GPIOF_INIT
- GPIOF_INIT
- LDR R1, =SYSCTL_RCGCGPIO_R ; R1 = &SYSCTL_RCGCGPIO_R
- LDR R0, [R1] ; R0 = [R1]
- ORR R0, R0, #0x20 ; Port F
- STR R0, [R1] ; [R1] = R0
- NOP
- NOP ; allow time to finish activating
- ; set direction register
- LDR R1, =GPIO_PORTF_DIR_R ; R1 = &GPIO_PORTF_DIR_R
- LDR R0, [R1] ; R0 = [R1]
- ORR R0, R0, #0x04 ; R0 = R0|0x04 (make PF2 output; PF2 built-in blue LED)
- STR R0, [R1] ; [R1] = R0
- ; enable digital port
- LDR R1, =GPIO_PORTF_DEN_R ; R1 = &GPIO_PORTF_DEN_R
- LDR R0, [R1] ; R0 = [R1]
- ORR R0, R0, #0x04 ; R0 = R0|0x04 (enable digital I/O on PF2)
- STR R0, [R1] ; [R1] = R0
- BX LR
- ALIGN ; make sure the end of this section is aligned
- END ; end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement