Imported Upstream version 2.9.0
[debian/cc1111] / device / include / hc08 / mc68hc908gp32.h
1 /*-------------------------------------------------------------------------
2   Register Declarations for Motorola MC68HC908GP32
3
4   Copyright (c) 2004, Juan Gonzalez <juan@iearobotics.com>
5
6   Based on mc68hc908qy.h,
7    Written By - Erik Petrich
8     epetrich@users.sourceforge.net (2003)
9
10    This program is free software; you can redistribute it and/or modify it
11    under the terms of the GNU General Public License as published by the
12    Free Software Foundation; either version 2, or (at your option) any
13    later version.
14
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24    In other words, you are welcome to use, share and improve this program.
25    You are forbidden to forbid anyone else to use, share and improve
26    what you give them.   Help stamp out software-hoarding!
27 -------------------------------------------------------------------------*/
28
29 #ifndef _MC68HC908GP32_H
30 #define _MC68HC908GP32_H
31
32 #ifndef _UINT8
33  #define _UINT8 unsigned char
34 #endif
35 #ifndef _UINT16
36  #define _UINT16 unsigned int
37 #endif
38 #ifndef _VOLDATA
39  #define _VOLDATA volatile __data
40 #endif
41 #ifndef _VOLXDATA
42  #define _VOLXDATA volatile __xdata
43 #endif
44
45 struct __hc08_bits
46 {
47   unsigned int bit0:1;
48   unsigned int bit1:1;
49   unsigned int bit2:1;
50   unsigned int bit3:1;
51   unsigned int bit4:1;
52   unsigned int bit5:1;
53   unsigned int bit6:1;
54   unsigned int bit7:1;
55 };
56
57
58 _VOLDATA _UINT8 __at 0x00 PTA;     /* Port A Data Register */
59 #define PORTA PTA                /* Alias for PTA        */
60   #define PTA0 ((struct __hc08_bits *)(&PTA))->bit0
61   #define PTA1 ((struct __hc08_bits *)(&PTA))->bit1
62   #define PTA2 ((struct __hc08_bits *)(&PTA))->bit2
63   #define PTA3 ((struct __hc08_bits *)(&PTA))->bit3
64   #define PTA4 ((struct __hc08_bits *)(&PTA))->bit4
65   #define PTA5 ((struct __hc08_bits *)(&PTA))->bit5
66   #define PTA6 ((struct __hc08_bits *)(&PTA))->bit6
67   #define PTA7 ((struct __hc08_bits *)(&PTA))->bit7
68
69 _VOLDATA _UINT8 __at 0x01 PTB;     /* Port B Data Register */
70 #define PORTB PTB              /* Alias for PTB        */
71   #define PTB0 ((struct __hc08_bits *)(&PTB))->bit0
72   #define PTB1 ((struct __hc08_bits *)(&PTB))->bit1
73   #define PTB2 ((struct __hc08_bits *)(&PTB))->bit2
74   #define PTB3 ((struct __hc08_bits *)(&PTB))->bit3
75   #define PTB4 ((struct __hc08_bits *)(&PTB))->bit4
76   #define PTB5 ((struct __hc08_bits *)(&PTB))->bit5
77   #define PTB6 ((struct __hc08_bits *)(&PTB))->bit6
78   #define PTB7 ((struct __hc08_bits *)(&PTB))->bit7
79
80 _VOLDATA _UINT8 __at 0x02 PTC;     /* Port C Data Register */
81 #define PORTC PTC              /* Alias for PTC        */
82   #define PTC0 ((struct __hc08_bits *)(&PTC))->bit0
83   #define PTC1 ((struct __hc08_bits *)(&PTC))->bit1
84   #define PTC2 ((struct __hc08_bits *)(&PTC))->bit2
85   #define PTC3 ((struct __hc08_bits *)(&PTC))->bit3
86   #define PTC4 ((struct __hc08_bits *)(&PTC))->bit4
87   #define PTC5 ((struct __hc08_bits *)(&PTC))->bit5
88   #define PTC6 ((struct __hc08_bits *)(&PTC))->bit6
89   #define PTC7 ((struct __hc08_bits *)(&PTC))->bit7
90
91 _VOLDATA _UINT8 __at 0x03 PTD;     /* Port D Data Register */
92 #define PORTD PTD              /* Alias for PTD        */
93   #define PTD0 ((struct __hc08_bits *)(&PTD))->bit0
94   #define PTD1 ((struct __hc08_bits *)(&PTD))->bit1
95   #define PTD2 ((struct __hc08_bits *)(&PTD))->bit2
96   #define PTD3 ((struct __hc08_bits *)(&PTD))->bit3
97   #define PTD4 ((struct __hc08_bits *)(&PTD))->bit4
98   #define PTD5 ((struct __hc08_bits *)(&PTD))->bit5
99   #define PTD6 ((struct __hc08_bits *)(&PTD))->bit6
100   #define PTD7 ((struct __hc08_bits *)(&PTD))->bit7
101
102 _VOLDATA _UINT8 __at 0x04 DDRA;    /* Data Direction Register A */
103   #define DDRA0 ((struct __hc08_bits *)(&DDRA))->bit0
104   #define DDRA1 ((struct __hc08_bits *)(&DDRA))->bit1
105   #define DDRA2 ((struct __hc08_bits *)(&DDRA))->bit2
106   #define DDRA3 ((struct __hc08_bits *)(&DDRA))->bit3
107   #define DDRA4 ((struct __hc08_bits *)(&DDRA))->bit4
108   #define DDRA5 ((struct __hc08_bits *)(&DDRA))->bit5
109   #define DDRA6 ((struct __hc08_bits *)(&DDRA))->bit6
110   #define DDRA7 ((struct __hc08_bits *)(&DDRA))->bit7
111
112 _VOLDATA _UINT8 __at 0x05 DDRB;    /* Data Direction Register B */
113   #define DDRB0 ((struct __hc08_bits *)(&DDRB))->bit0
114   #define DDRB1 ((struct __hc08_bits *)(&DDRB))->bit1
115   #define DDRB2 ((struct __hc08_bits *)(&DDRB))->bit2
116   #define DDRB3 ((struct __hc08_bits *)(&DDRB))->bit3
117   #define DDRB4 ((struct __hc08_bits *)(&DDRB))->bit4
118   #define DDRB5 ((struct __hc08_bits *)(&DDRB))->bit5
119   #define DDRB6 ((struct __hc08_bits *)(&DDRB))->bit6
120   #define DDRB7 ((struct __hc08_bits *)(&DDRB))->bit7
121
122 _VOLDATA _UINT8 __at 0x06 DDRC;    /* Data Direction Register C */
123   #define DDRC0 ((struct __hc08_bits *)(&DDRC))->bit0
124   #define DDRC1 ((struct __hc08_bits *)(&DDRC))->bit1
125   #define DDRC2 ((struct __hc08_bits *)(&DDRC))->bit2
126   #define DDRC3 ((struct __hc08_bits *)(&DDRC))->bit3
127   #define DDRC4 ((struct __hc08_bits *)(&DDRC))->bit4
128   #define DDRC5 ((struct __hc08_bits *)(&DDRC))->bit5
129   #define DDRC6 ((struct __hc08_bits *)(&DDRC))->bit6
130   #define DDRC7 ((struct __hc08_bits *)(&DDRC))->bit7
131
132 _VOLDATA _UINT8 __at 0x07 DDRD;    /* Data Direction Register D */
133   #define DDRD0 ((struct __hc08_bits *)(&DDRD))->bit0
134   #define DDRD1 ((struct __hc08_bits *)(&DDRD))->bit1
135   #define DDRD2 ((struct __hc08_bits *)(&DDRD))->bit2
136   #define DDRD3 ((struct __hc08_bits *)(&DDRD))->bit3
137   #define DDRD4 ((struct __hc08_bits *)(&DDRD))->bit4
138   #define DDRD5 ((struct __hc08_bits *)(&DDRD))->bit5
139   #define DDRD6 ((struct __hc08_bits *)(&DDRD))->bit6
140   #define DDRD7 ((struct __hc08_bits *)(&DDRD))->bit7
141
142 _VOLDATA _UINT8 __at 0x08 PTE;     /* Port E Data Register */
143 #define PORTE PTE              /* Alias for PTE        */
144   #define PTE0 ((struct __hc08_bits *)(&PTE))->bit0
145   #define PTE1 ((struct __hc08_bits *)(&PTE))->bit1
146   #define PTE2 ((struct __hc08_bits *)(&PTE))->bit2
147   #define PTE3 ((struct __hc08_bits *)(&PTE))->bit3
148   #define PTE4 ((struct __hc08_bits *)(&PTE))->bit4
149   #define PTE5 ((struct __hc08_bits *)(&PTE))->bit5
150   #define PTE6 ((struct __hc08_bits *)(&PTE))->bit6
151   #define PTE7 ((struct __hc08_bits *)(&PTE))->bit7
152
153 _VOLDATA _UINT8 __at 0x0C DDRE;    /* Data Direction Register E */
154   #define DDRE0 ((struct __hc08_bits *)(&DDRE))->bit0
155   #define DDRE1 ((struct __hc08_bits *)(&DDRE))->bit1
156   #define DDRE2 ((struct __hc08_bits *)(&DDRE))->bit2
157   #define DDRE3 ((struct __hc08_bits *)(&DDRE))->bit3
158   #define DDRE4 ((struct __hc08_bits *)(&DDRE))->bit4
159   #define DDRE5 ((struct __hc08_bits *)(&DDRE))->bit5
160   #define DDRE6 ((struct __hc08_bits *)(&DDRE))->bit6
161   #define DDRE7 ((struct __hc08_bits *)(&DDRE))->bit7
162
163 _VOLDATA _UINT8 __at 0x0D PTAPUE;  /* Port A pull-up enables */
164         #define PTAPUE0 ((struct __hc08_bits *)(&PTAPUE))->bit0
165         #define PTAPUE1 ((struct __hc08_bits *)(&PTAPUE))->bit1
166         #define PTAPUE2 ((struct __hc08_bits *)(&PTAPUE))->bit2
167         #define PTAPUE3 ((struct __hc08_bits *)(&PTAPUE))->bit3
168   #define PTAPUE4 ((struct __hc08_bits *)(&PTAPUE))->bit4
169         #define PTAPUE5 ((struct __hc08_bits *)(&PTAPUE))->bit5
170         #define PTAPUE6 ((struct __hc08_bits *)(&PTAPUE))->bit6
171         #define PTAPUE7 ((struct __hc08_bits *)(&PTAPUE))->bit7
172
173 _VOLDATA _UINT8 __at 0x0E PTCPUE;        /* Port C pull-up enables */
174         #define PTCPUE0 ((struct __hc08_bits *)(&PTCPUE))->bit0
175         #define PTCPUE1 ((struct __hc08_bits *)(&PTCPUE))->bit1
176         #define PTCPUE2 ((struct __hc08_bits *)(&PTCPUE))->bit2
177         #define PTCPUE3 ((struct __hc08_bits *)(&PTCPUE))->bit3
178         #define PTCPUE4 ((struct __hc08_bits *)(&PTCPUE))->bit4
179         #define PTCPUE5 ((struct __hc08_bits *)(&PTCPUE))->bit5
180         #define PTCPUE6 ((struct __hc08_bits *)(&PTCPUE))->bit6
181         /* PTCPUE7 does not exit! */
182
183 _VOLDATA _UINT8 __at 0x0F PTDPUE;  /* port D pull-up enables */
184         #define PTDPUE0 ((struct __hc08_bits *)(&PTDPUE))->bit0
185         #define PTDPUE1 ((struct __hc08_bits *)(&PTDPUE))->bit1
186   #define PTDPUE2 ((struct __hc08_bits *)(&PTDPUE))->bit2
187         #define PTDPUE3 ((struct __hc08_bits *)(&PTDPUE))->bit3
188         #define PTDPUE4 ((struct __hc08_bits *)(&PTDPUE))->bit4
189         #define PTDPUE5 ((struct __hc08_bits *)(&PTDPUE))->bit5
190   #define PTDPUE6 ((struct __hc08_bits *)(&PTDPUE))->bit6
191         #define PTDPUE7 ((struct __hc08_bits *)(&PTDPUE))->bit7
192
193 _VOLDATA _UINT8 __at 0x10 SPCR;   /* SPI Control Register */
194         #define SPRIE  ((struct __hc08_bits *)(&SPCR))->bit7
195         #define DMAS   ((struct __hc08_bits *)(&SPCR))->bit6
196         #define SPMSTR ((struct __hc08_bits *)(&SPCR))->bit5
197         #define CPOL   ((struct __hc08_bits *)(&SPCR))->bit4
198         #define CPHA   ((struct __hc08_bits *)(&SPCR))->bit3
199   #define SPWOM  ((struct __hc08_bits *)(&SPCR))->bit2
200         #define SPE    ((struct __hc08_bits *)(&SPCR))->bit1
201   #define SPTIE  ((struct __hc08_bits *)(&SPCR))->bit0
202
203 _VOLDATA _UINT8 __at 0x11 SPSCR;  /* SPI Status and Control Register */
204         #define SPRF   ((struct __hc08_bits *)(&SPSCR))->bit7
205         #define ERRIE  ((struct __hc08_bits *)(&SPSCR))->bit6
206         #define OVRF   ((struct __hc08_bits *)(&SPSCR))->bit5
207         #define MODF   ((struct __hc08_bits *)(&SPSCR))->bit4
208         #define SPTE   ((struct __hc08_bits *)(&SPSCR))->bit3
209         #define MODFEN ((struct __hc08_bits *)(&SPSCR))->bit2
210         #define SPR1   ((struct __hc08_bits *)(&SPSCR))->bit1
211         #define SPR0   ((struct __hc08_bits *)(&SPSCR))->bit0
212
213 _VOLDATA _UINT8 __at 0x12 SPDR;   /* SPI Data Register */
214
215 _VOLDATA _UINT8 __at 0x13 SCC1;  /* SCI Control Register 1 */
216         #define LOOPS  ((struct __hc08_bits *)(&SCC1))->bit7
217   #define ENSCI  ((struct __hc08_bits *)(&SCC1))->bit6
218         #define TXINV  ((struct __hc08_bits *)(&SCC1))->bit5
219   #define M      ((struct __hc08_bits *)(&SCC1))->bit4
220         #define WAKE   ((struct __hc08_bits *)(&SCC1))->bit3
221   #define ILTY   ((struct __hc08_bits *)(&SCC1))->bit2
222         #define PEN    ((struct __hc08_bits *)(&SCC1))->bit1
223   #define PTY    ((struct __hc08_bits *)(&SCC1))->bit0
224
225
226 _VOLDATA _UINT8 __at 0x14 SCC2;  /* SCI Control Register 2 */
227         #define SCTIE  ((struct __hc08_bits *)(&SCC2))->bit7
228         #define TCIE   ((struct __hc08_bits *)(&SCC2))->bit6
229         #define SCRIE  ((struct __hc08_bits *)(&SCC2))->bit5
230         #define ILIE   ((struct __hc08_bits *)(&SCC2))->bit4
231         #define TE     ((struct __hc08_bits *)(&SCC2))->bit3
232         #define RE     ((struct __hc08_bits *)(&SCC2))->bit2
233         #define WRU    ((struct __hc08_bits *)(&SCC2))->bit1
234         #define SBK    ((struct __hc08_bits *)(&SCC2))->bit0
235
236 _VOLDATA _UINT8 __at 0x15 SCC3;  /* SCI Control Register 3 */
237         #define SCC3_R8 ((struct __hc08_bits *)(&SCC3))->bit7
238         #define SCC3_TB ((struct __hc08_bits *)(&SCC3))->bit6
239   #define DMARE   ((struct __hc08_bits *)(&SCC3))->bit5
240         #define DMATE   ((struct __hc08_bits *)(&SCC3))->bit4
241         #define ORIE    ((struct __hc08_bits *)(&SCC3))->bit3
242         #define NEIE    ((struct __hc08_bits *)(&SCC3))->bit2
243   #define FEIE    ((struct __hc08_bits *)(&SCC3))->bit1
244         #define PEIE    ((struct __hc08_bits *)(&SCC3))->bit0
245
246 _VOLDATA _UINT8 __at 0x16 SCS1;  /* SCI Status Register 1 */
247         #define SCTE  ((struct __hc08_bits *)(&SCS1))->bit7
248         #define TC    ((struct __hc08_bits *)(&SCS1))->bit6
249         #define SCRF  ((struct __hc08_bits *)(&SCS1))->bit5
250         #define IDLE  ((struct __hc08_bits *)(&SCS1))->bit4
251         #define OR    ((struct __hc08_bits *)(&SCS1))->bit3
252         #define NF    ((struct __hc08_bits *)(&SCS1))->bit2
253         #define FE    ((struct __hc08_bits *)(&SCS1))->bit1
254         #define PE    ((struct __hc08_bits *)(&SCS1))->bit0
255
256 _VOLDATA _UINT8 __at 0x17 SCS2;  /* SCI Status Register 2 */
257         #define RPF  ((struct __hc08_bits *)(&SCS2))->bit0
258         #define BKF  ((struct __hc08_bits *)(&SCS2))->bit1
259   /*  Bits 2-7 not implemented  */
260
261 _VOLDATA _UINT8 __at 0x18 SCDR;  /* SCI Data Register */
262
263 _VOLDATA _UINT8 __at 0x19 SCBR;  /* SCI Baud Rate Register */
264         #define SCP1  ((struct __hc08_bits *)(&SCBR))->bit5
265         #define SCP0  ((struct __hc08_bits *)(&SCBR))->bit4
266   #define R     ((struct __hc08_bits *)(&SCBR))->bit3
267   #define SCR2  ((struct __hc08_bits *)(&SCBR))->bit2
268   #define SCR1  ((struct __hc08_bits *)(&SCBR))->bit1
269   #define SCR0  ((struct __hc08_bits *)(&SCBR))->bit0
270         /*-- Bits 6 and 7 do not exist */
271
272 _VOLDATA _UINT8 __at 0x1a INTKBSCR; /* Keyboard Status and Control Register */
273         #define KEYF   ((struct __hc08_bits *)(&INTKBSCR))->bit3
274         #define ACKK   ((struct __hc08_bits *)(&INTKBSCR))->bit2
275         #define IMASKK ((struct __hc08_bits *)(&INTKBSCR))->bit1
276         #define MODEK  ((struct __hc08_bits *)(&INTKBSCR))->bit0
277         /*-- Bits 4-7 do not exist  */
278
279 _VOLDATA _UINT8 __at 0x1b INTKBIER; /* Keyboard Interrupt Enable Register */
280   #define KBIE7  ((struct __hc08_bits *)(&INTKBIER))->bit7
281         #define KBIE6  ((struct __hc08_bits *)(&INTKBIER))->bit6
282         #define KBIE5  ((struct __hc08_bits *)(&INTKBIER))->bit5
283         #define KBIE4  ((struct __hc08_bits *)(&INTKBIER))->bit4
284         #define KBIE3  ((struct __hc08_bits *)(&INTKBIER))->bit3
285         #define KBIE2  ((struct __hc08_bits *)(&INTKBIER))->bit2
286         #define KBIE1  ((struct __hc08_bits *)(&INTKBIER))->bit1
287         #define KBIE0  ((struct __hc08_bits *)(&INTKBIER))->bit0
288
289 _VOLDATA _UINT8 __at 0x1C TBCR;    /* Time Base Module Control */
290         #define TBIF   ((struct __hc08_bits *)(&TBCR))->bit7
291         #define TBR2   ((struct __hc08_bits *)(&TBCR))->bit6
292         #define TBR1   ((struct __hc08_bits *)(&TBCR))->bit5
293         #define TBR0   ((struct __hc08_bits *)(&TBCR))->bit4
294         #define TACK   ((struct __hc08_bits *)(&TBCR))->bit3
295         #define TBIE   ((struct __hc08_bits *)(&TBCR))->bit2
296         #define TBON   ((struct __hc08_bits *)(&TBCR))->bit1
297         /* Bit 0 Reserved */
298
299 _VOLDATA _UINT8 __at 0x1D INTSCR;       /* IRQ status/control       */
300         #define IRQF1  ((struct __hc08_bits *)(&INTSCR))->bit3
301         #define ACK1   ((struct __hc08_bits *)(&INTSCR))->bit2
302         #define IMASK1 ((struct __hc08_bits *)(&INTSCR))->bit1
303         #define MODE1  ((struct __hc08_bits *)(&INTSCR))->bit0
304         /* Bits 4-7 unimplemented */
305
306 _VOLDATA _UINT8 __at 0x1e CONFIG2; /* Configuration Register 2 */
307 /* CONFIG2 is one-time writeble, so can't use bitfields  */
308
309 _VOLDATA _UINT8 __at 0x1f CONFIG1; /* Configuration Register 1 */
310 /* CONFIG1 is one-time writeable, so can't use bitfields */
311
312 _VOLDATA _UINT8 __at 0x20 T1SC;     /* TIM 1 Status and Control */
313   #define PS0   ((struct __hc08_bits *)(&T1SC))->bit0
314   #define PS1   ((struct __hc08_bits *)(&T1SC))->bit1
315   #define PS2   ((struct __hc08_bits *)(&T1SC))->bit2
316   #define TRST  ((struct __hc08_bits *)(&T1SC))->bit4
317   #define TSTOP ((struct __hc08_bits *)(&T1SC))->bit5
318   #define TOIE  ((struct __hc08_bits *)(&T1SC))->bit6
319   #define TOF   ((struct __hc08_bits *)(&T1SC))->bit7
320
321 _VOLDATA _UINT16 __at 0x21 T1CNT;    /* TIM1 Counter High & Low Registers */
322 _VOLDATA _UINT8  __at 0x21  T1CNTH;  /* TIM1 Counter Register High */
323 _VOLDATA _UINT8  __at 0x22  T1CNTL;  /* TIM1 Counter Register Low */
324
325 _VOLDATA _UINT16 __at 0x23 T1MOD;    /* TIM1 Counter Modulo High & Low Registers */
326 _VOLDATA _UINT8  __at 0x23 T1MODH;   /* TIM1 Counter Modulo Register High */
327 _VOLDATA _UINT8  __at 0x24 T1MODL;   /* TIM1 Counter Modulo Register Low */
328
329 _VOLDATA _UINT8 __at 0x25 T1SC0;    /* TIM1 Channel 0 Status and Control Register */
330   #define CH0MAX ((struct __hc08_bits *)(&T1SC0))->bit0
331   #define TOV0   ((struct __hc08_bits *)(&T1SC0))->bit1
332   #define ELS0A  ((struct __hc08_bits *)(&T1SC0))->bit2
333   #define ELS0B  ((struct __hc08_bits *)(&T1SC0))->bit3
334   #define MS0A   ((struct __hc08_bits *)(&T1SC0))->bit4
335   #define MS0B   ((struct __hc08_bits *)(&T1SC0))->bit5
336   #define CH0IE  ((struct __hc08_bits *)(&T1SC0))->bit6
337   #define CH0F   ((struct __hc08_bits *)(&T1SC0))->bit7
338
339 _VOLDATA _UINT16 __at 0x26 T1CH0;   /* TIM1 Channel 0 High & Low Registers */
340 _VOLDATA _UINT8 __at 0x26 T1CH0H;   /* TIM1 Channel 0 Register High */
341 _VOLDATA _UINT8 __at 0x27 T1CH0L;   /* TIM1 Channel 0 Register Low */
342
343 _VOLDATA _UINT8 __at 0x28 T1SC1;    /* TIM1 Channel 1 Status and Control Register */
344   #define CH1MAX ((struct __hc08_bits *)(&T1SC1))->bit0
345   #define TOV1   ((struct __hc08_bits *)(&T1SC1))->bit1
346   #define ELS1A  ((struct __hc08_bits *)(&T1SC1))->bit2
347   #define ELS1B  ((struct __hc08_bits *)(&T1SC1))->bit3
348   #define MS1A   ((struct __hc08_bits *)(&T1SC1))->bit4
349   #define CH1IE  ((struct __hc08_bits *)(&T1SC1))->bit6
350   #define CH1F   ((struct __hc08_bits *)(&T1SC1))->bit7
351
352 _VOLDATA _UINT16 __at 0x29 T1CH1;    /* TIM1 Channel 1 High & Low Registers */
353 _VOLDATA _UINT8  __at 0x29  T1CH1H;  /* TIM1 Channel 1 Register High */
354 _VOLDATA _UINT8  __at 0x2A  T1CH1L;  /* TIM1 Channel 1 Register Low */
355
356 /*------------------*/
357 /* TIM 2 REGISTERS  */
358 /*------------------*/
359
360 _VOLDATA _UINT8 __at 0x2B T2SC;     /* TIM 2 Status and Control */
361   #define PS0_2   ((struct __hc08_bits *)(&T2SC))->bit0
362   #define PS1_2   ((struct __hc08_bits *)(&T2SC))->bit1
363   #define PS2_2   ((struct __hc08_bits *)(&T2SC))->bit2
364   #define TRST_2  ((struct __hc08_bits *)(&T2SC))->bit4
365   #define TSTOP_2 ((struct __hc08_bits *)(&T2SC))->bit5
366   #define TOIE_2  ((struct __hc08_bits *)(&T2SC))->bit6
367   #define TOF_2   ((struct __hc08_bits *)(&T2SC))->bit7
368
369 _VOLDATA _UINT16 __at 0x2C T2CNT;   /* TIM2 Counter High & Low Registers */
370 _VOLDATA _UINT8  __at 0x2C T2CNTH;  /* TIM2 Counter Register High */
371 _VOLDATA _UINT8  __at 0x2D T2CNTL;  /* TIM2 Counter Register Low */
372
373 _VOLDATA _UINT16 __at 0x2E T2MOD;    /* TIM2 Counter Modulo High & Low Registers */
374 _VOLDATA _UINT8  __at 0x2E T2MODH;   /* TIM2 Counter Modulo Register High */
375 _VOLDATA _UINT8  __at 0x2F T2MODL;   /* TIM2 Counter Modulo Register Low */
376
377 _VOLDATA _UINT8 __at 0x30 T2SC0;    /* TIM2 Channel 0 Status and Control Register */
378   #define CH0MAX_2 ((struct __hc08_bits *)(&T2SC0))->bit0
379   #define TOV0_2   ((struct __hc08_bits *)(&T2SC0))->bit1
380   #define ELS0A_2  ((struct __hc08_bits *)(&T2SC0))->bit2
381   #define ELS0B_2  ((struct __hc08_bits *)(&T2SC0))->bit3
382   #define MS0A_2   ((struct __hc08_bits *)(&T2SC0))->bit4
383   #define MS0B_2   ((struct __hc08_bits *)(&T2SC0))->bit5
384   #define CH0IE_2  ((struct __hc08_bits *)(&T2SC0))->bit6
385   #define CH0F_2   ((struct __hc08_bits *)(&T2SC0))->bit7
386
387 _VOLDATA _UINT16 __at 0x31 T2CH0;    /* TIM2 Channel 0 High & Low Registers */
388 _VOLDATA _UINT8  __at 0x31 T2CH0H;   /* TIM2 Channel 0 Register High */
389 _VOLDATA _UINT8  __at 0x32 T2CH0L;   /* TIM2 Channel 0 Register Low */
390
391 _VOLDATA _UINT8 __at 0x33 T2SC1;    /* TIM2 Channel 1 Status and Control Register */
392   #define CH1MAX_2 ((struct __hc08_bits *)(&T2SC1))->bit0
393   #define TOV1_2   ((struct __hc08_bits *)(&T2SC1))->bit1
394   #define ELS1A_2  ((struct __hc08_bits *)(&T2SC1))->bit2
395   #define ELS1B_2  ((struct __hc08_bits *)(&T2SC1))->bit3
396   #define MS1A_2   ((struct __hc08_bits *)(&T2SC1))->bit4
397   #define CH1IE_2  ((struct __hc08_bits *)(&T2SC1))->bit6
398   #define CH1F_2   ((struct __hc08_bits *)(&T2SC1))->bit7
399
400 _VOLDATA _UINT16 __at 0x34  T2CH1;   /* TIM2 Channel 1 High & Low Registers */
401 _VOLDATA _UINT8  __at 0x34  T2CH1H;  /* TIM2 Channel 1 Register High */
402 _VOLDATA _UINT8  __at 0x35  T2CH1L;  /* TIM2 Channel 1 Register Low */
403
404 _VOLDATA _UINT8 __at 0x36 PCTL;  /* PLL Control Register */
405         #define PLLIE ((struct __hc08_bits *)(&PCTL))->bit7
406         #define PLLF  ((struct __hc08_bits *)(&PCTL))->bit6
407         #define PLLON ((struct __hc08_bits *)(&PCTL))->bit5
408         #define BCS   ((struct __hc08_bits *)(&PCTL))->bit4
409         #define PRE1  ((struct __hc08_bits *)(&PCTL))->bit3
410         #define PRE0  ((struct __hc08_bits *)(&PCTL))->bit2
411         #define VPR1  ((struct __hc08_bits *)(&PCTL))->bit1
412         #define VPR0  ((struct __hc08_bits *)(&PCTL))->bit0
413
414 _VOLDATA        _UINT8 __at 0x37 PBWC;  /* PLL Bandwidth Control Register */
415         #define AUTO ((struct __hc08_bits *)(&PBWC))->bit7
416         #define LOCK ((struct __hc08_bits *)(&PBWC))->bit6
417         #define ACQ  ((struct __hc08_bits *)(&PBWC))->bit5
418         /* Bits 1-4, Unimplemented */
419         /* Bit 0, Reserved         */
420
421 _VOLDATA _UINT8 __at 0x38 PMSH;  /* PLL Multiplier Select High */
422         #define MUL11 ((struct __hc08_bits *)(&PMSH))->bit3
423         #define MUL10 ((struct __hc08_bits *)(&PMSH))->bit2
424         #define MUL9  ((struct __hc08_bits *)(&PMSH))->bit1
425         #define MUL8  ((struct __hc08_bits *)(&PMSH))->bit0
426         /* Bits 4-7 unimplemented */
427
428 _VOLDATA _UINT8 __at 0x39 PMSL;  /* PLL Multiplir Select Low */
429         #define MUL7 ((struct __hc08_bits *)(&PMSL))->bit7
430         #define MUL6 ((struct __hc08_bits *)(&PMSL))->bit6
431         #define MUL5 ((struct __hc08_bits *)(&PMSL))->bit5
432         #define MUL4 ((struct __hc08_bits *)(&PMSL))->bit4
433         #define MUL3 ((struct __hc08_bits *)(&PMSL))->bit3
434         #define MUL2 ((struct __hc08_bits *)(&PMSL))->bit2
435         #define MUL1 ((struct __hc08_bits *)(&PMSL))->bit1
436         #define MUL0 ((struct __hc08_bits *)(&PMSL))->bit0
437
438 _VOLDATA _UINT8 __at 0x3a PMRS;  /* PLL VCO Select Range  */
439         #define VRS7 ((struct __hc08_bits *)(&PMRS))->bit7
440         #define VRS6 ((struct __hc08_bits *)(&PMRS))->bit6
441         #define VRS5 ((struct __hc08_bits *)(&PMRS))->bit5
442         #define VRS4 ((struct __hc08_bits *)(&PMRS))->bit4
443         #define VRS3 ((struct __hc08_bits *)(&PMRS))->bit3
444         #define VRS2 ((struct __hc08_bits *)(&PMRS))->bit2
445         #define VRS1 ((struct __hc08_bits *)(&PMRS))->bit1
446         #define VRS0 ((struct __hc08_bits *)(&PMRS))->bit0
447
448 _VOLDATA _UINT8 __at 0x3b PMDS;  /* PLL Reference Divider Select Register */
449         #define RDS3 ((struct __hc08_bits *)(&PMDS))->bit3
450         #define RDS2 ((struct __hc08_bits *)(&PMDS))->bit2
451         #define RDS1 ((struct __hc08_bits *)(&PMDS))->bit1
452         #define RDS0 ((struct __hc08_bits *)(&PMDS))->bit0
453         /* Bits 4-7 unimplemented */
454
455 _VOLDATA _UINT8 __at 0x3c ADSCR; /* Analog-to-Digital Status and Control Reg. */
456         #define COCO  ((struct __hc08_bits *)(&ADSCR))->bit7
457         #define AIEN  ((struct __hc08_bits *)(&ADSCR))->bit6
458         #define ADCO  ((struct __hc08_bits *)(&ADSCR))->bit5
459         #define ADCH4 ((struct __hc08_bits *)(&ADSCR))->bit4
460         #define ADCH3 ((struct __hc08_bits *)(&ADSCR))->bit3
461         #define ADCH2 ((struct __hc08_bits *)(&ADSCR))->bit2
462         #define ADCH1 ((struct __hc08_bits *)(&ADSCR))->bit1
463         #define ADCH0 ((struct __hc08_bits *)(&ADSCR))->bit0
464
465 _VOLDATA _UINT8 __at 0x3d ADR;   /* Analog-to-Digital Data Register  */
466
467 _VOLDATA _UINT8 __at 0x3e ADCLK; /* Analog-to-Digital Clock */
468         #define ADIV2  ((struct __hc08_bits *)(&ADCLK))->bit7
469         #define ADIV1  ((struct __hc08_bits *)(&ADCLK))->bit6
470         #define ADIV0  ((struct __hc08_bits *)(&ADCLK))->bit5
471         #define ADICLK ((struct __hc08_bits *)(&ADCLK))->bit4
472         /* Bits 0-3 unimplemented */
473
474 _VOLXDATA _UINT8 __at 0xfe00 SBSR;     /* SIM Break Status Register */
475   #define SBSW ((struct __hc08_bits *)(&SBSR))->bit1
476
477 _VOLXDATA _UINT8 __at 0xfe01 SRSR;    /* SIM Reset Status Register */
478   #define LVI    ((struct __hc08_bits *)(&SRSR))->bit1
479   #define MODRST ((struct __hc08_bits *)(&SRSR))->bit2
480   #define ILAD   ((struct __hc08_bits *)(&SRSR))->bit3
481   #define ILOP   ((struct __hc08_bits *)(&SRSR))->bit4
482   #define COP    ((struct __hc08_bits *)(&SRSR))->bit5
483   #define PIN    ((struct __hc08_bits *)(&SRSR))->bit6
484   #define POR    ((struct __hc08_bits *)(&SRSR))->bit7
485   /* Bit 0 unimplemented */
486
487 _VOLXDATA _UINT8 __at 0xfe02 SUBAR;  /* SIM Upper Byte Address */
488
489 _VOLXDATA _UINT8 __at 0xfe03 SBFCR;    /* SIM Break Flag Control Register */
490   #define BFCE ((struct __hc08_bits *)(&BFCR))->bit7
491
492 _VOLXDATA _UINT8 __at 0xfe04 INT1;    /* Interrupt Status Register 1 */
493   #define IF1 ((struct __hc08_bits *)(&INT1))->bit2
494   #define IF2 ((struct __hc08_bits *)(&INT1))->bit3
495   #define IF3 ((struct __hc08_bits *)(&INT1))->bit4
496   #define IF4 ((struct __hc08_bits *)(&INT1))->bit5
497   #define IF5 ((struct __hc08_bits *)(&INT1))->bit6
498   #define IF6 ((struct __hc08_bits *)(&INT1))->bit7
499         /* Bits 0-1 Reserved */
500
501 _VOLXDATA _UINT8 __at 0xfe05 INT2;  /* Interrupt Status Register 2 */
502   #define IF14 ((struct __hc08_bits *)(&INT2))->bit7
503         #define IF13 ((struct __hc08_bits *)(&INT2))->bit6
504         #define IF12 ((struct __hc08_bits *)(&INT2))->bit5
505         #define IF11 ((struct __hc08_bits *)(&INT2))->bit4
506         #define IF10 ((struct __hc08_bits *)(&INT2))->bit3
507         #define IF9 ((struct __hc08_bits *)(&INT2))->bit2
508         #define IF8 ((struct __hc08_bits *)(&INT2))->bit1
509         #define IF7 ((struct __hc08_bits *)(&INT2))->bit0
510
511 _VOLXDATA _UINT8 __at 0xfe06 INT3;  /* Interrupt Status Register 3 */
512   #define IF16 ((struct __hc08_bits *)(&INT3))->bit1
513         #define IF15 ((struct __hc08_bits *)(&INT3))->bit0
514
515 _VOLXDATA _UINT8 __at 0xfe07 FLCTR;  /* Flash test/programming */
516
517 _VOLXDATA _UINT8 __at 0xfe08 FLCR;    /* FLASH Control Register */
518   #define PGM   ((struct __hc08_bits *)(&FLCR))->bit0
519   #define ERASE ((struct __hc08_bits *)(&FLCR))->bit1
520   #define MASS  ((struct __hc08_bits *)(&FLCR))->bit2
521   #define HVEN  ((struct __hc08_bits *)(&FLCR))->bit3
522
523 _VOLXDATA _UINT16 __at 0xfe09 BRK;    /* Break Address High & Low Registers */
524 _VOLXDATA _UINT8 __at 0xfe09 BRKH;    /* Break Address High Register */
525 _VOLXDATA _UINT8 __at 0xfe0a BRKL;    /* Break Address Low Register */
526
527 _VOLXDATA _UINT8 __at 0xfe0b BRKSCR;  /* Break Status and Control Register */
528   #define BRKA ((struct __hc08_bits *)(&BRKSCR))->bit6
529   #define BRKE ((struct __hc08_bits *)(&BRKSCR))->bit7
530
531 _VOLXDATA _UINT8 __at 0xfe0c LVISR;   /* Low voltage detect */
532         #define LVIOUT ((struct __hc08_bits *)(&LVISR))->bit7
533
534
535 _VOLXDATA _UINT8 __at 0xfe7e FLBPR;    /* FLASH Block Protect Register */
536   #define BPR0 ((struct __hc08_bits *)(&FLBPR))->bit0
537   #define BPR1 ((struct __hc08_bits *)(&FLBPR))->bit1
538   #define BPR2 ((struct __hc08_bits *)(&FLBPR))->bit2
539   #define BPR3 ((struct __hc08_bits *)(&FLBPR))->bit3
540   #define BPR4 ((struct __hc08_bits *)(&FLBPR))->bit4
541   #define BPR5 ((struct __hc08_bits *)(&FLBPR))->bit5
542   #define BPR6 ((struct __hc08_bits *)(&FLBPR))->bit6
543   #define BPR7 ((struct __hc08_bits *)(&FLBPR))->bit7
544
545 _VOLXDATA _UINT8 __at 0xffff COPCTL;  /* COP Control Register */
546
547 #endif