commit c5f46fadc685f4d0e266b174678c44067aa90dd3
parent 0245619b46587b7d1b834254214e0ce03a23420d
Author: Matsuda Kenji <info@mtkn.jp>
Date: Thu, 16 Mar 2023 09:46:31 +0900
delete uart code
Diffstat:
M | main.s | | | 63 | +++------------------------------------------------------------ |
1 file changed, 3 insertions(+), 60 deletions(-)
diff --git a/main.s b/main.s
@@ -28,30 +28,6 @@ reset_chk:
add r0, r0, #0xc4
mov r1, #5
str r1, [r0, #0]
- // set gpio12 funct as uart_tx
- ldr r0, io_bank0_base
- mov r1, #2
- str r1, [r0, #0x64]
- // set gpio13 funct as uart_rx
- mov r1, #2
- str r1, [r0, #0x6c]
-
- // set baud rate for uart0
- ldr r0, uart0_base
- mov r1, #67
- str r1, [r0, #0x24]
- mov r1, #52
- str r1, [r0, #0x28]
-
- // set line control for uart0
- mov r1, #112
- str r1, [r0, #0x2c]
-
- // enable uart0
- mov r1, #0x3
- lsl r1, r1, #8
- add r1, r1, #0x1
- str r1, [r0, #0x30]
// enable output
ldr r0, gpio_oe_set
@@ -59,12 +35,9 @@ reset_chk:
lsl r1, r1, #24
str r1, [r0, #0]
-echo:
- bl uart0_recv
- b echo
-
-hault:
- b hault
+loop:
+ bl led_blink
+ b loop
led_blink:
push {lr}
@@ -89,36 +62,6 @@ del_loop:
bne del_loop
bx lr
-uart0_send:
- push {lr}
- // check if fifo is not full
- ldr r1, uart0_base
- ldr r2, [r1, #0x18]
- mov r3, #32
- and r2, r3
- bne uart0_send
-
- // send data
- mov r2, #255
- and r0, r0, r2
- str r0, [r1, #0]
-
- pop {pc}
-
-uart0_recv:
- push {lr}
- // check if fifo is empty
- ldr r1, uart0_base
- ldr r2, [r1, #0x18]
- mov r3, #16
- and r2, r3
- bne uart0_recv
-
- // recv data
- ldr r0, [r1, #0]
-
- pop {pc}
-
.align 2
clocks_base: