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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [arm/] [snds/] [current/] [src/] [ks32c5000.h] - Blame information for rev 786

Details | Compare with Previous | View Log

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