1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #ifndef _CD1400_H
25 #define _CD1400_H
26
27
28
29
30
31 #define CD1400_PORTS 4
32
33
34
35
36 #define CD1400_TXFIFOSIZE 12
37 #define CD1400_RXFIFOSIZE 12
38
39
40
41
42
43 #define FIFO_RXTHRESHOLD 6
44 #define FIFO_RTSTHRESHOLD 7
45
46
47
48
49
50
51
52
53 #define GFRCR 0x40
54 #define CAR 0x68
55 #define GCR 0x4b
56 #define SVRR 0x67
57 #define RICR 0x44
58 #define TICR 0x45
59 #define MICR 0x46
60 #define RIR 0x6b
61 #define TIR 0x6a
62 #define MIR 0x69
63 #define PPR 0x7e
64
65 #define RIVR 0x43
66 #define TIVR 0x42
67 #define MIVR 0x41
68 #define TDR 0x63
69 #define RDSR 0x62
70 #define MISR 0x4c
71 #define EOSRR 0x60
72
73 #define LIVR 0x18
74 #define CCR 0x05
75 #define SRER 0x06
76 #define COR1 0x08
77 #define COR2 0x09
78 #define COR3 0x0a
79 #define COR4 0x1e
80 #define COR5 0x1f
81 #define CCSR 0x0b
82 #define RDCR 0x0e
83 #define SCHR1 0x1a
84 #define SCHR2 0x1b
85 #define SCHR3 0x1c
86 #define SCHR4 0x1d
87 #define SCRL 0x22
88 #define SCRH 0x23
89 #define LNC 0x24
90 #define MCOR1 0x15
91 #define MCOR2 0x16
92 #define RTPR 0x21
93 #define MSVR1 0x6c
94 #define MSVR2 0x6d
95 #define PSVR 0x6f
96 #define RBPR 0x78
97 #define RCOR 0x7c
98 #define TBPR 0x72
99 #define TCOR 0x76
100
101
102
103
104
105
106 #define CD1400_CLK0 8
107 #define CD1400_CLK1 32
108 #define CD1400_CLK2 128
109 #define CD1400_CLK3 512
110 #define CD1400_CLK4 2048
111
112 #define CD1400_NUMCLKS 5
113
114
115
116
117
118
119
120
121 #define PPR_SCALAR 244
122
123
124
125
126
127
128 #define COR1_CHL5 0x00
129 #define COR1_CHL6 0x01
130 #define COR1_CHL7 0x02
131 #define COR1_CHL8 0x03
132
133
134
135
136 #define COR1_STOP1 0x00
137 #define COR1_STOP15 0x04
138 #define COR1_STOP2 0x08
139
140
141
142
143 #define COR1_PARNONE 0x00
144 #define COR1_PARFORCE 0x20
145 #define COR1_PARENB 0x40
146 #define COR1_PARIGNORE 0x10
147
148 #define COR1_PARODD 0x80
149 #define COR1_PAREVEN 0x00
150
151 #define COR2_IXM 0x80
152 #define COR2_TXIBE 0x40
153 #define COR2_ETC 0x20
154 #define COR2_LLM 0x10
155 #define COR2_RLM 0x08
156 #define COR2_RTSAO 0x04
157 #define COR2_CTSAE 0x02
158
159 #define COR3_SCDRNG 0x80
160 #define COR3_SCD34 0x40
161 #define COR3_FCT 0x20
162 #define COR3_SCD12 0x10
163
164
165
166
167 #define COR4_BRKINT 0x08
168 #define COR4_IGNBRK 0x18
169
170
171
172
173
174
175
176
177 #define MSVR1_DTR 0x01
178 #define MSVR1_DSR 0x10
179 #define MSVR1_RI 0x20
180 #define MSVR1_CTS 0x40
181 #define MSVR1_DCD 0x80
182
183 #define MSVR2_RTS 0x02
184 #define MSVR2_DSR 0x10
185 #define MSVR2_RI 0x20
186 #define MSVR2_CTS 0x40
187 #define MSVR2_DCD 0x80
188
189 #define MCOR1_DCD 0x80
190 #define MCOR1_CTS 0x40
191 #define MCOR1_RI 0x20
192 #define MCOR1_DSR 0x10
193
194 #define MCOR2_DCD 0x80
195 #define MCOR2_CTS 0x40
196 #define MCOR2_RI 0x20
197 #define MCOR2_DSR 0x10
198
199
200
201
202
203
204 #define SRER_NNDT 0x01
205 #define SRER_TXEMPTY 0x02
206 #define SRER_TXDATA 0x04
207 #define SRER_RXDATA 0x10
208 #define SRER_MODEM 0x80
209
210
211
212
213
214
215 #define CCR_RESET 0x80
216 #define CCR_CORCHANGE 0x4e
217 #define CCR_SENDCH 0x20
218 #define CCR_CHANCTRL 0x10
219
220 #define CCR_TXENABLE (CCR_CHANCTRL | 0x08)
221 #define CCR_TXDISABLE (CCR_CHANCTRL | 0x04)
222 #define CCR_RXENABLE (CCR_CHANCTRL | 0x02)
223 #define CCR_RXDISABLE (CCR_CHANCTRL | 0x01)
224
225 #define CCR_SENDSCHR1 (CCR_SENDCH | 0x01)
226 #define CCR_SENDSCHR2 (CCR_SENDCH | 0x02)
227 #define CCR_SENDSCHR3 (CCR_SENDCH | 0x03)
228 #define CCR_SENDSCHR4 (CCR_SENDCH | 0x04)
229
230 #define CCR_RESETCHAN (CCR_RESET | 0x00)
231 #define CCR_RESETFULL (CCR_RESET | 0x01)
232 #define CCR_TXFLUSHFIFO (CCR_RESET | 0x02)
233
234 #define CCR_MAXWAIT 10000
235
236
237
238
239
240
241 #define ACK_TYPMASK 0x07
242 #define ACK_TYPTX 0x02
243 #define ACK_TYPMDM 0x01
244 #define ACK_TYPRXGOOD 0x03
245 #define ACK_TYPRXBAD 0x07
246
247 #define SVRR_RX 0x01
248 #define SVRR_TX 0x02
249 #define SVRR_MDM 0x04
250
251 #define ST_OVERRUN 0x01
252 #define ST_FRAMING 0x02
253 #define ST_PARITY 0x04
254 #define ST_BREAK 0x08
255 #define ST_SCHAR1 0x10
256 #define ST_SCHAR2 0x20
257 #define ST_SCHAR3 0x30
258 #define ST_SCHAR4 0x40
259 #define ST_RANGE 0x70
260 #define ST_SCHARMASK 0x70
261 #define ST_TIMEOUT 0x80
262
263 #define MISR_DCD 0x80
264 #define MISR_CTS 0x40
265 #define MISR_RI 0x20
266 #define MISR_DSR 0x10
267
268
269
270
271
272
273 #define CCSR_RXENABLED 0x80
274 #define CCSR_RXFLOWON 0x40
275 #define CCSR_RXFLOWOFF 0x20
276 #define CCSR_TXENABLED 0x08
277 #define CCSR_TXFLOWON 0x04
278 #define CCSR_TXFLOWOFF 0x02
279
280
281
282
283
284
285 #define ETC_CMD 0x00
286 #define ETC_STARTBREAK 0x81
287 #define ETC_DELAY 0x82
288 #define ETC_STOPBREAK 0x83
289
290
291 #endif