diff options
Diffstat (limited to 'firmware/target/coldfire')
-rw-r--r-- | firmware/target/coldfire/uart-coldfire.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/firmware/target/coldfire/uart-coldfire.c b/firmware/target/coldfire/uart-coldfire.c new file mode 100644 index 0000000000..c5992a956c --- /dev/null +++ b/firmware/target/coldfire/uart-coldfire.c | |||
@@ -0,0 +1,60 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Alan Korr & Nick Robinson | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include <stdio.h> | ||
22 | #include <stdlib.h> | ||
23 | #include <stdarg.h> | ||
24 | |||
25 | #include "config.h" | ||
26 | #include "cpu.h" | ||
27 | #include "system.h" | ||
28 | #include "serial.h" | ||
29 | |||
30 | void serial_setup (void) | ||
31 | { | ||
32 | UCR0 = 0x30; /* Reset transmitter */ | ||
33 | UCSR0 = 0xdd; /* Timer mode */ | ||
34 | |||
35 | UCR0 = 0x10; /* Reset pointer */ | ||
36 | UMR0 = 0x13; /* No parity, 8 bits */ | ||
37 | UMR0 = 0x07; /* 1 stop bit */ | ||
38 | |||
39 | UCR0 = 0x04; /* Tx enable */ | ||
40 | } | ||
41 | |||
42 | int tx_rdy(void) | ||
43 | { | ||
44 | if(USR0 & 0x04) | ||
45 | return 1; | ||
46 | else | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | int rx_rdy(void) | ||
51 | { | ||
52 | /* a dummy */ | ||
53 | return 0; | ||
54 | } | ||
55 | |||
56 | void tx_writec(unsigned char c) | ||
57 | { | ||
58 | UTB0 = c; | ||
59 | } | ||
60 | |||