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