1 |
/* GXemul: $Id: epcomreg.h,v 1.1 2006/03/05 17:58:16 debug Exp $ */ |
2 |
/* $NetBSD: epcomreg.h,v 1.2 2005/12/11 12:16:45 christos Exp $ */ |
3 |
|
4 |
#ifndef _EPCOMREG_H_ |
5 |
#define _EPCOMREG_H_ |
6 |
|
7 |
/* |
8 |
* Copyright (c) 2004 Jesse Off |
9 |
* |
10 |
* Redistribution and use in source and binary forms, with or without |
11 |
* modification, are permitted provided that the following conditions |
12 |
* are met: |
13 |
* 1. Redistributions of source code must retain the above copyright |
14 |
* notice, this list of conditions and the following disclaimer. |
15 |
* 2. Redistributions in binary form must reproduce the above copyright |
16 |
* notice, this list of conditions and the following disclaimer in the |
17 |
* documentation and/or other materials provided with the distribution. |
18 |
* 3. All advertising materials mentioning features or use of this software |
19 |
* must display the following acknowledgement: |
20 |
* This product includes software developed by Ichiro FUKUHARA. |
21 |
* 4. Neither the name of the author nor the names of any co-contributors |
22 |
* may be used to endorse or promote products derived from this software |
23 |
* without specific prior written permission. |
24 |
* |
25 |
* THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA AND CONTRIBUTORS ``AS IS'' |
26 |
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
27 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
28 |
* ARE DISCLAIMED. IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS |
29 |
* HEAD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, |
30 |
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
31 |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
32 |
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
33 |
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
34 |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
35 |
* THE POSSIBILITY OF SUCH DAMAGE. |
36 |
*/ |
37 |
|
38 |
#define EPCOM_FREQ 7372800 |
39 |
#define EPCOMSPEED2BRD(b) ((EPCOM_FREQ / (16 * (b))) - 1) |
40 |
|
41 |
|
42 |
/* UART Data Register */ |
43 |
#define EPCOM_Data 0x00000000UL |
44 |
|
45 |
/* UART Receive Status/Error Clear Register */ |
46 |
#define EPCOM_RXSts 0x00000004UL |
47 |
#define RXSts_FE 0x01 |
48 |
#define RXSts_PE 0x02 |
49 |
#define RXSts_BE 0x04 |
50 |
#define RXSts_OE 0x08 |
51 |
|
52 |
/* UART Line Control Register High */ |
53 |
#define EPCOM_LinCtrlHigh 0x00000008UL |
54 |
#define LinCtrlHigh_BRK 0x01 |
55 |
#define LinCtrlHigh_PEN 0x02 |
56 |
#define LinCtrlHigh_EPS 0x04 |
57 |
#define LinCtrlHigh_STP2 0x08 |
58 |
#define LinCtrlHigh_FEN 0x10 |
59 |
#define LinCtrlHigh_WLEN 0x60 |
60 |
|
61 |
/* UART Line Control Register Middle */ |
62 |
#define EPCOM_LinCtrlMid 0x0000000cUL |
63 |
|
64 |
/* UART Line Control Register Low */ |
65 |
#define EPCOM_LinCtrlLow 0x00000010UL |
66 |
|
67 |
/* UART control register */ |
68 |
#define EPCOM_Ctrl 0x00000014UL |
69 |
#define Ctrl_UARTE 0x01 /* UART Enable */ |
70 |
#define Ctrl_MSIE 0x08 /* Modem Status Interrupt Enable */ |
71 |
#define Ctrl_RIE 0x10 /* Receive Interrupt Enable */ |
72 |
#define Ctrl_TIE 0x20 /* Transmit Interrupt Enable */ |
73 |
#define Ctrl_RTIE 0x40 /* Receive Timeout Enable */ |
74 |
#define Ctrl_LBE 0x80 /* Loopback Enable */ |
75 |
|
76 |
/* UART Flag register */ |
77 |
#define EPCOM_Flag 0x00000018UL |
78 |
#define Flag_CTS 0x01 /* Clear To Send status */ |
79 |
#define Flag_DSR 0x02 /* Data Set Ready status */ |
80 |
#define Flag_DCD 0x04 /* Data Carrier Detect status */ |
81 |
#define Flag_BUSY 0x08 /* UART Busy */ |
82 |
#define Flag_RXFE 0x10 /* Receive FIFO Empty */ |
83 |
#define Flag_TXFF 0x20 /* Transmit FIFO Full */ |
84 |
#define Flag_RXFF 0x40 /* Receive FIFO Full */ |
85 |
#define Flag_TXFE 0x80 /* Transmit FIFO Empty */ |
86 |
|
87 |
/* UART Interrupt Identification and Interrupt Clear Register */ |
88 |
#define EPCOM_IntIDIntClr 0x0000001cUL |
89 |
#define IntIDIntClr_MIS 0x01 /* Modem Interrupt Status */ |
90 |
#define IntIDIntClr_RIS 0x01 /* Receive Interrupt Status */ |
91 |
#define IntIDIntClr_TIS 0x01 /* Transmit Interrupt Status */ |
92 |
#define IntIDIntClr_RTIS 0x01 /* Receive Timeout Interrupt Status */ |
93 |
|
94 |
/* UART Modem Control Register */ |
95 |
#define EPCOM_ModemCtrl 0x00000100UL |
96 |
#define ModemCtrl_DTR 0x01 /* DTR output signal */ |
97 |
#define ModemCtrl_RTS 0x02 /* RTS output signal */ |
98 |
|
99 |
/* UART Modem Status Register */ |
100 |
#define EPCOM_ModemSts 0x00000104UL |
101 |
#define ModemSts_DCTS 0x01 /* Delta CTS */ |
102 |
#define ModemSts_DDSR 0x02 /* Delta DSR */ |
103 |
#define ModemSts_TERI 0x04 /* Trailing Edge Ring Indicator */ |
104 |
#define ModemSts_DDCD 0x08 /* Delta DCD */ |
105 |
#define ModemSts_CTS 0x10 /* Inverse CTSn input pin */ |
106 |
#define ModemSts_DSR 0x20 /* Inverse of the DSRn pin */ |
107 |
#define ModemSts_RI 0x40 /* Inverse of RI input pin */ |
108 |
#define ModemSts_DCD 0x80 /* Inverse of DCDn input pin */ |
109 |
|
110 |
#endif /* _EPCOMREG_H_ */ |