rešitev FRI-SMS
.equ PIOC_BASE, 0xFFFFF800 /* Zacetni naslov registrov za PIOC */
.equ PIO_PER, 0x00 /* Odmiki... */
.equ PIO_OER, 0x10
.equ PIO_SODR, 0x30
.equ PIO_CODR, 0x34
bl INIT_IO
VECNA: bl LED_ON
ldr r0,=500
bl DELAY
bl LED_OFF
ldr r0,=500
bl DELAY
b VECNA
/* end user code */
_wait_for_ever:
b _wait_for_ever
INIT_IO:
stmfd r13!, {r0, r2, r14}
ldr r2, =PIOC_BASE
mov r0, #1 << 1
str r0, [r2, #PIO_PER]
str r0, [r2, #PIO_OER]
ldmfd r13!, {r0, r2, pc}
LED_ON:
stmfd r13!, {r0, r2, r14}
ldr r2, =PIOC_BASE
mov r0, #1 << 1
str r0, [r2, #PIO_CODR]
ldmfd r13!, {r0, r2, pc}
LED_OFF:
stmfd r13!, {r0, r2, r14}
ldr r2, =PIOC_BASE
mov r0, #1 << 1
str r0, [r2, #PIO_SODR]
ldmfd r13!, {r0, r2, pc}
DELAY:
stmfd r13!, {r1, r14}
MSEC: ldr r1,=48000
LOOP: subs r1,r1,#1
bne LOOP
subs r0,r0,#1
bne MSEC
ldmfd r13!, {r1, pc}
.equ PIO_PER, 0x00 /* Odmiki... */
.equ PIO_OER, 0x10
.equ PIO_SODR, 0x30
.equ PIO_CODR, 0x34
bl INIT_IO
VECNA: bl LED_ON
ldr r0,=500
bl DELAY
bl LED_OFF
ldr r0,=500
bl DELAY
b VECNA
/* end user code */
_wait_for_ever:
b _wait_for_ever
INIT_IO:
stmfd r13!, {r0, r2, r14}
ldr r2, =PIOC_BASE
mov r0, #1 << 1
str r0, [r2, #PIO_PER]
str r0, [r2, #PIO_OER]
ldmfd r13!, {r0, r2, pc}
LED_ON:
stmfd r13!, {r0, r2, r14}
ldr r2, =PIOC_BASE
mov r0, #1 << 1
str r0, [r2, #PIO_CODR]
ldmfd r13!, {r0, r2, pc}
LED_OFF:
stmfd r13!, {r0, r2, r14}
ldr r2, =PIOC_BASE
mov r0, #1 << 1
str r0, [r2, #PIO_SODR]
ldmfd r13!, {r0, r2, pc}
DELAY:
stmfd r13!, {r1, r14}
MSEC: ldr r1,=48000
LOOP: subs r1,r1,#1
bne LOOP
subs r0,r0,#1
bne MSEC
ldmfd r13!, {r1, pc}
Zadnja sprememba: sreda, 23. november 2022, 16.35