annotate src/gpf2/tst/drv/usart.h @ 512:1edb0615c439

README: state more clearly that the handset fw work is paused until FC handset hardware
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 25 Jun 2018 19:09:07 +0000
parents cd37d228dae0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
294
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 +------------------------------------------------------------------------------
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 | File: usart.h
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 +------------------------------------------------------------------------------
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 | Copyright 2002 Texas Instruments Berlin, AG
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 | All rights reserved.
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 |
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 | This file is confidential and a trade secret of Texas
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 | Instruments Berlin, AG
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 | The receipt of or possession of this file does not convey
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 | any rights to reproduce or disclose its contents or to
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 | manufacture, use, or sell anything it may describe, in
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 | whole, or in part, without the specific written consent of
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 | Texas Instruments Berlin, AG.
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 +-----------------------------------------------------------------------------
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 | Purpose : This Modul defines functions for actual or simulated
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 | USART comunication between two PS-Frames.
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 | Use US_set_mode() to select actual USART under windows95 or
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 | under windowsNT, or to select simulated USART under win95/NT
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 +-----------------------------------------------------------------------------
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #ifndef USART_H
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #define USART_H
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 /*
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 * Device addresses
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #define USART_DC (USART_BASE + 0x00) /* Data Channel */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #define USART_CC (USART_BASE + 0x04) /* Control Channel */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #define USART_CLK (USART_BASE + 0x08) /* Clock */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 #define USART_CTL (USART_BASE + 0x0C) /* FIFO control */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 #define USART_FSTAT (USART_BASE + 0x10) /* FIFO status */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #define USART_FTHR (USART_BASE + 0x14) /* FIFO threshold */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 /*
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 * USART_CLK bit definitions
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 #define US_CLK_CLK_SEL 0x0001
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 #define US_CLK_TXC_SEL 0x0002
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #define US_CLK_RXC_SEL 0x0004
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 #define US_CLK_TXC_CTL 0x0100
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 #define US_CLK_RXC_CTL 0x0200
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 #define US_CLK_RESET 0x0400
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 /*
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 * USART_MODE bit definitions
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 /* Sync/Async and Baud rate */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 #define US_MODE_SYNC 0x00
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 #define US_MODE_ASYNC 0x01
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 #define US_MODE_ASYNC16 0x02
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #define US_MODE_SYNC64 0x03
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 /* Character length */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 #define US_MODE_CHAR5 (0x00 << 2)
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 #define US_MODE_CHAR6 (0x01 << 2)
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 #define US_MODE_CHAR7 (0x02 << 2)
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 #define US_MODE_CHAR8 (0x03 << 2)
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 /* Parity */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 #define US_MODE_PEN 0x10
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 #define US_MODE_EP 0x20
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 /* Stop bits */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 #define US_MODE_STOP1 (0x01 << 6)
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 #define US_MODE_STOP15 (0x02 << 6)
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 #define US_MODE_STOP2 (0x03 << 6)
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 /* Baud rates */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 #define US_BAUD_115200 0
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 #define US_BAUD_57600 1
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 #define US_BAUD_38400 2
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 #define US_BAUD_33900 3
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 #define US_BAUD_28800 4
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 #define US_BAUD_19200 5
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 #define US_BAUD_14400 6
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 #define US_BAUD_9600 7
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 #define US_BAUD_4800 8
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 #define US_BAUD_2400 9
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 #define US_BAUD_1200 10
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 #define US_BAUD_600 11
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 #define US_BAUD_300 12
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 #define US_BAUD_150 13
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 #define US_BAUD_75 14
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 #define US_BAUD_128000 15
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 #define US_BAUD_256000 16
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 /*
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 * USART COMMAND bit definitions
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 #define US_CMD_TXEN 0x01
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 #define US_CMD_DTR 0x02
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 #define US_CMD_RXE 0x04
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 #define US_CMD_SBRK 0x08
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 #define US_CMD_ER 0x10
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 #define US_CMD_RTS 0x20
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 #define US_CMD_IR 0x40
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 #define US_CMD_EH 0x80
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 /*
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 * USART STATUS bit definitions
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 #define US_STAT_TXRDY 0x01
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 #define US_STAT_RXRDY 0x02
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 #define US_STAT_TXEMPTY 0x04
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 #define US_STAT_PE 0x08
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 #define US_STAT_OE 0x10
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 #define US_STAT_FE 0x20
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 #define US_STAT_SBDET 0x40
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 #define US_STAT_DSR 0x80
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 /*
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 * FIFO control
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 #define US_CTL_RST_FIFO 0x0001
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 #define US_CTL_FIFOBYPASS 0x0002
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 #define US_CTL_AUTOFC 0x0004
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 #define US_CTL_MS_MSK 0x0008
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 #define US_CTL_RDRY_MSK 0x0100
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 #define US_CTL_TO_MSK 0x0200
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 #define US_CTL_TDRY_MSK 0x1000
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 #define US_CTL_TXE_MSK 0x2000
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 #define US_FSTAT_GFE 0x0001
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 #define US_FSTAT_GPE 0x0002
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 #define US_FSTAT_MODSTAT 0x0008
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 #define US_FSTAT_RXOE 0x0020
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 #define US_FSTAT_RXFULL 0x0040
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 #define US_FSTAT_RXEMPTY 0x0080
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 #define US_FSTAT_RDRY 0x0100
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 #define US_FSTAT_TIMEOUT 0x0200
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 #define US_FSTAT_TXFULL 0x0800
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 #define US_FSTAT_TDRY 0x1000
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 #define US_FSTAT_TXE 0x2000
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 #define US_FSTAT_TXEMPTY 0x4000
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 /*
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 * mode constants
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 #define US_MODE_95 1
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 #define US_MODE_NT 2
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 #define US_MODE_SIM 3
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 #define US_MODE_FILE 4
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 /*
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 * Prototypes
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 void US_set_mode(int mode);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 int US_get_mode(void);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 int US_Init(unsigned int baudRate, int fifoSize, char flow_ctrl, void (func(void)), const char* fname );
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 BOOL US_Close(void);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 BYTE US_ReadChar(void);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 void US_Handler(void);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 void US_WriteChar(int usart_id, char ch);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 void US_WriteNChars(int usart_id, BYTE *s, unsigned int n);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 int US_IsChar(void);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 void US_WriteString(int usart_id, char *s);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 void US_Handler(void);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 void US_SetFlowCtrl (char flowCtrl);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 /*
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 int US_InitBlk(int baudRate, int fifoSize, NU_HISR *hP );
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 ULONG US_ReadNChars(int usart_id, BYTE *s, ULONG n);
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 /*
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 defines for name_change US -> UT
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 */
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 #ifndef _TARGET_
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 #define UT_DEVICE_0 (0)
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 #define UT_BAUD_256000 US_BAUD_256000
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 #define UT_BAUD_128000 US_BAUD_128000
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 #define UT_BAUD_115200 US_BAUD_115200
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 #define UT_BAUD_57600 US_BAUD_57600
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 #define UT_BAUD_38400 US_BAUD_38400
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 #define UT_BAUD_33900 US_BAUD_33900
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 #define UT_BAUD_28800 US_BAUD_28800
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 #define UT_BAUD_19200 US_BAUD_19200
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 #define UT_BAUD_14400 US_BAUD_14400
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 #define UT_BAUD_9600 US_BAUD_9600
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 #define UT_BAUD_4800 US_BAUD_4800
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 #define UT_BAUD_2400 US_BAUD_2400
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 #define UT_BAUD_1200 US_BAUD_1200
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 #define UT_BAUD_600 US_BAUD_600
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 #define UT_BAUD_300 US_BAUD_300
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 #define UT_BAUD_150 US_BAUD_150
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 #define UT_BAUD_75 US_BAUD_75
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 #define UT_MODE_95 US_MODE_95
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 #define UT_MODE_NT US_MODE_NT
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 #define UT_MODE_SIM US_MODE_SIM
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 #define UT_MODE_FILE US_MODE_FILE
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 #define UT_set_mode US_set_mode
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 #define UT_get_mode US_get_mode
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 #define UT_Init US_Init
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 #define UT_Close US_Close
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 #define UT_ReadChar US_ReadChar
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 #define UT_ReadNChars US_ReadNChars
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 #define UT_Handler US_Handler
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 #define UT_WriteChar US_WriteChar
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 #define UT_WriteNChars US_WriteNChars
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 #define UT_IsChar US_IsChar
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 #define UT_WriteString US_WriteString
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 #define UT_SetFlowCtrl US_SetFlowCtrl
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 #endif
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214
cd37d228dae0 src/gpf2/{misc,tst}: import from TCS211 semi-src
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 #endif