OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [arm/] [snds/] [v2_0/] [src/] [ks32c5000.h] - Blame information for rev 307

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
//==========================================================================
2
//
3
//      ks32c5000.h
4
//
5
//      
6
//
7
//==========================================================================
8
//####ECOSGPLCOPYRIGHTBEGIN####
9
// -------------------------------------------
10
// This file is part of eCos, the Embedded Configurable Operating System.
11
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12
//
13
// eCos is free software; you can redistribute it and/or modify it under
14
// the terms of the GNU General Public License as published by the Free
15
// Software Foundation; either version 2 or (at your option) any later version.
16
//
17
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20
// for more details.
21
//
22
// You should have received a copy of the GNU General Public License along
23
// with eCos; if not, write to the Free Software Foundation, Inc.,
24
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25
//
26
// As a special exception, if other files instantiate templates or use macros
27
// or inline functions from this file, or you compile this file and link it
28
// with other works to produce a work based on this file, this file does not
29
// by itself cause the resulting work to be covered by the GNU General Public
30
// License. However the source code for this file must still be made available
31
// in accordance with section (3) of the GNU General Public License.
32
//
33
// This exception does not invalidate any other reasons why a work based on
34
// this file might be covered by the GNU General Public License.
35
//
36
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37
// at http://sources.redhat.com/ecos/ecos-license/
38
// -------------------------------------------
39
//####ECOSGPLCOPYRIGHTEND####
40
//==========================================================================
41
//#####DESCRIPTIONBEGIN####
42
//
43
// Author(s):    gthomas
44
// Contributors: gthomas, jskov
45
//               Grant Edwards <grante@visi.com>
46
// Date:         2001-07-31
47
// Purpose:      
48
// Description:  
49
//
50
//####DESCRIPTIONEND####
51
//
52
//========================================================================*/
53
 
54
/*
55
 * structure definitions for Samsung KS32C5000 peripheral registers
56
 */
57
 
58
typedef volatile unsigned int reg;
59
 
60
#define Bit(n) (1<<(n))
61
 
62
 
63
/*
64
 * Interrupt Controller
65
 */
66
 
67
typedef struct
68
{
69
  reg intmod;          // Interrupt mode register
70
  reg intpnd;          // Interrupt pending register
71
  reg intmsk;          // Interrupt mask register
72
  reg intpri0;         // Interrupt priority register
73
  reg intpri1;
74
  reg intpri2;
75
  reg intpri3;
76
  reg intpri4;
77
  reg intpri5;
78
  reg intoffset;       // Interrupt offset register
79
} tInterruptController;
80
 
81
 
82
/* The following bit masks are for use in the intmod, intpnd, and
83
 * intmsk registers
84
 */
85
 
86
#define IntMaskExt0     Bit(0)
87
#define IntMaskExt1     Bit(1)
88
#define IntMaskExt2     Bit(2)
89
#define IntMaskExt3     Bit(3)
90
#define IntMaskUart0Tx  Bit(4)
91
#define IntMaskUart0Rx  Bit(5)
92
#if defined(CYG_HAL_CPUTYPE_KS32C5000A)
93
#define IntMaskUart0Err Bit(6)
94
#define IntMaskUart1Tx  Bit(7)
95
#define IntMaskUart1Rx  Bit(8)
96
#define IntMaskUart1Err Bit(9)
97
#define IntMaskDma0     Bit(10)
98
#define IntMaskDma1     Bit(11)
99
#define IntMaskTimer0   Bit(12)
100
#define IntMaskTimer1   Bit(13)
101
#define IntMaskHDLCA    Bit(14)
102
#define IntMaskHDLCB    Bit(15)
103
#else
104
#define IntMaskUart1Tx  Bit(6)
105
#define IntMaskUart1Rx  Bit(7)
106
#define IntMaskDma0     Bit(8)
107
#define IntMaskDma1     Bit(9)
108
#define IntMaskTimer0   Bit(10)
109
#define IntMaskTimer1   Bit(11)
110
#define IntMaskHDLCATx  Bit(12)
111
#define IntMaskHDLCARx  Bit(13)
112
#define IntMaskHDLCBTx  Bit(14)
113
#define IntMaskHDLCBRx  Bit(15)
114
#endif
115
#define IntMaskEtherBDMATx  Bit(16)
116
#define IntMaskEtherBDMARx  Bit(17)
117
#define IntMaskEtherMacTx   Bit(18)
118
#define IntMaskEtherMacRx   Bit(19)
119
#define IntMaskI2C      Bit(20)
120
#define IntMaskGlobal   Bit(21)
121
 
122
/*
123
 * Timers
124
 */
125
 
126
typedef struct
127
{
128
  reg tmod;      // Timer mode
129
  reg tdata0;    // Timer 0 Data
130
  reg tdata1;    // Timer 1 Data
131
  reg tcnt0;     // Timer 0 Count
132
  reg tcnt1;     // Timer 1 Count
133
}tTimers;
134
 
135
#define TimerModeEnable0  Bit(0)
136
#define TimerModeToggle0  Bit(1)
137
#define TimerModeInitOut0 Bit(2)
138
#define TimerModeEnable1  Bit(3)
139
#define TimerModeToggle1  Bit(4)
140
#define TimerModeInitOut1 Bit(5)
141
 
142
 
143
/*
144
 * UART
145
 */
146
 
147
typedef struct
148
{
149
  reg ulcon;   // UART Line Control
150
  reg ucon;    // UART Control
151
  reg ustat;   // UART Status
152
  reg utxbuf;  // UART Tx Buffer
153
  reg urxbuf;  // UART Rx Buffer
154
  reg brdiv;   // UART Baud Rate Divisor
155
  reg brdcnt;  // UART Baud Rate Counter
156
  reg brdclk;  // UART Baud Rate Clock
157
}tUart;
158
 
159
/* UART Line Control */
160
 
161
#define UartLineWordLenMask 0x03
162
#define UartLineWordLen5       0
163
#define UartLineWordLen6       1
164
#define UartLineWordLen7       2
165
#define UartLineWordLen8       3
166
 
167
#define UartLineStopMask    (1 << 2)
168
#define UartLineStop1       (0 << 2)
169
#define UartLineStop2       (1 << 2)
170
 
171
#define UartLineParityMask  (0x07 << 3)
172
#define UartLineParityNone   (0 << 3)
173
#define UartLineParityOdd    (4 << 3)
174
#define UartLineParityEven   (5 << 3)
175
#define UartLineParityMark   (6 << 3)
176
#define UartLineParitySpace  (7 << 3)
177
 
178
#define UartLineInfraRedEnable Bit(7)
179
 
180
 
181
/* UART Control */
182
 
183
 
184
#define UartControlRxModeMask      3
185
#define UartControlRxModeDisabled  0
186
#define UartControlRxModeInterrupt 1
187
#define UartControlRxModeDma0      2
188
#define UartControlRxModeDma1      3
189
 
190
#define UartControlRxStatusIntEnable Bit(2)
191
 
192
#define UartControlTxModeMask      (0x3 <<3)
193
#define UartControlTxModeDisable   (0 <<3)
194
#define UartControlTxModeInterrupt (1 <<3)
195
#define UartControlTxModeDma0      (2 <<3)
196
#define UartControlTxModeDma1      (3 <<3)
197
 
198
#define UartControlDSR             Bit(5)
199
 
200
#define UartControlSendBreak       Bit(6)
201
 
202
#define UartControlLoopback        Bit(7)
203
 
204
 
205
/* UART Status */
206
 
207
#define UartStatusRxOverrunError  Bit(0)
208
#define UartStatusRxParityError   Bit(1)
209
#define UartStatusRxFrameError    Bit(2)
210
#define UartStatusRxBreak         Bit(3)
211
#define UartStatusDTR             Bit(4)
212
#define UartStatusRxDataAvail     Bit(5)
213
#define UartStatusTxBufEmpty      Bit(6)
214
#define UartStatusTxDone          Bit(7)
215
 
216
 
217
 
218
 
219
 
220
// macros for external timing control registers
221
 
222
#define Tcos0(n) (((n)&7)<<0)
223
#define Tacs0(n) (((n)&7)<<3)
224
#define Tcoh0(n) (((n)&7)<<6)
225
#define Tacc0(n) (((n)&7)<<9)
226
 
227
#define Tcos1(n) (((n)&7)<<16)
228
#define Tacs1(n) (((n)&7)<<19)
229
#define Tcoh1(n) (((n)&7)<<22)
230
#define Tacc1(n) (((n)&7)<<25)
231
 
232
#define Tcos2(n) (((n)&7)<<0)
233
#define Tacs2(n) (((n)&7)<<3)
234
#define Tcoh2(n) (((n)&7)<<6)
235
#define Tacc2(n) (((n)&7)<<9)
236
 
237
#define Tcos3(n) (((n)&7)<<16)
238
#define Tacs3(n) (((n)&7)<<19)
239
#define Tcoh3(n) (((n)&7)<<22)
240
#define Tacc3(n) (((n)&7)<<25)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.