FreeCalypso > hg > freecalypso-sw
comparison loadagent/serio.S @ 1:da98dc08f575
loadagent: beginning to lay the foundation
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 29 Apr 2013 03:21:00 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:9beb566ded04 | 1:da98dc08f575 |
---|---|
1 #include "ns16550.h" | |
2 | |
3 @ this module implements the elementary serial I/O operations | |
4 | |
5 .text | |
6 .code 32 | |
7 .global serial_out | |
8 serial_out: | |
9 ldr r1, =uart_base | |
10 ldr r2, [r1] | |
11 1: ldrb r3, [r2, #NS16550_LSR] | |
12 tst r3, #NS16550_LSR_THRE | |
13 beq 1b | |
14 strb r0, [r2, #NS16550_THR] | |
15 bx lr | |
16 | |
17 .global serial_in_poll | |
18 serial_in_poll: | |
19 ldr r1, =uart_base | |
20 ldr r2, [r1] | |
21 ldrb r3, [r2, #NS16550_LSR] | |
22 tst r3, #NS16550_LSR_DR | |
23 mvneq r0, #1 | |
24 bxeq lr | |
25 ldrb r0, [r2, #NS16550_RBR] | |
26 bx lr |