summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/uart-coldfire.c
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-04-23 08:23:07 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-04-23 08:23:07 +0000
commit55a7a31ce3a742feea2ff47f6ec35356ebb0ba06 (patch)
tree046dbe8a4bbc816be2cc7ad5f9653006eceb0ccf /firmware/target/coldfire/uart-coldfire.c
parent0dfce1972b4ba781411b193b13d0c35c2b6769d7 (diff)
downloadrockbox-55a7a31ce3a742feea2ff47f6ec35356ebb0ba06.tar.gz
rockbox-55a7a31ce3a742feea2ff47f6ec35356ebb0ba06.zip
Split off target-specific parts from firmware/drivers/serial.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29768 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire/uart-coldfire.c')
-rw-r--r--firmware/target/coldfire/uart-coldfire.c60
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
30void 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
42int tx_rdy(void)
43{
44 if(USR0 & 0x04)
45 return 1;
46 else
47 return 0;
48}
49
50int rx_rdy(void)
51{
52 /* a dummy */
53 return 0;
54}
55
56void tx_writec(unsigned char c)
57{
58 UTB0 = c;
59}
60