Imported Upstream version 2.9.0
[debian/cc1111] / device / include / hc08 / mc68hc908apxx.h
1 /*-------------------------------------------------------------------------
2   Register Declarations for Motorola MC68HC908AP16/32/64
3   
4   Copyright (c) 2004, Lucas Loizaga <lucas.loizaga@ingenieria-inversa.com.ar
5
6   Based on mc68hc908gp32.h,
7    Written By - Juan Gonzalez <juan@iearobotics.com>
8     
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 MC68HC908APXX_H
30 #define MC68HC908APXX_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 0x0C LEDA;    /* PORTA Led Control Register */
143   #define LEDA0 ((struct __hc08_bits *)(&LEDA))->bit0
144   #define LEDA1 ((struct __hc08_bits *)(&LEDA))->bit1
145   #define LEDA2 ((struct __hc08_bits *)(&LEDA))->bit2
146   #define LEDA3 ((struct __hc08_bits *)(&LEDA))->bit3
147   #define LEDA4 ((struct __hc08_bits *)(&LEDA))->bit4
148   #define LEDA5 ((struct __hc08_bits *)(&LEDA))->bit5
149   #define LEDA6 ((struct __hc08_bits *)(&LEDA))->bit6
150   #define LEDA7 ((struct __hc08_bits *)(&LEDA))->bit7
151                 
152 _VOLDATA _UINT8 __at 0x10 SPCR;   /* SPI Control Register */
153         #define SPRIE  ((struct __hc08_bits *)(&SPCR))->bit7
154         #define DMAS   ((struct __hc08_bits *)(&SPCR))->bit6
155         #define SPMSTR ((struct __hc08_bits *)(&SPCR))->bit5    
156         #define CPOL   ((struct __hc08_bits *)(&SPCR))->bit4
157         #define CPHA   ((struct __hc08_bits *)(&SPCR))->bit3    
158         #define SPWOM  ((struct __hc08_bits *)(&SPCR))->bit2
159         #define SPE    ((struct __hc08_bits *)(&SPCR))->bit1    
160         #define SPTIE  ((struct __hc08_bits *)(&SPCR))->bit0    
161         
162 _VOLDATA _UINT8 __at 0x11 SPSCR;  /* SPI Status and Control Register */
163         #define SPRF   ((struct __hc08_bits *)(&SPSCR))->bit7
164         #define ERRIE  ((struct __hc08_bits *)(&SPSCR))->bit6
165         #define OVRF   ((struct __hc08_bits *)(&SPSCR))->bit5
166         #define MODF   ((struct __hc08_bits *)(&SPSCR))->bit4
167         #define SPTE   ((struct __hc08_bits *)(&SPSCR))->bit3
168         #define MODFEN ((struct __hc08_bits *)(&SPSCR))->bit2
169         #define SPR1   ((struct __hc08_bits *)(&SPSCR))->bit1
170         #define SPR0   ((struct __hc08_bits *)(&SPSCR))->bit0   
171                 
172 _VOLDATA _UINT8 __at 0x12 SPDR;   /* SPI Data Register */
173
174
175 _VOLDATA _UINT8 __at 0x13 SCC1;  /* SCI Control Register 1 */ 
176         #define LOOPS  ((struct __hc08_bits *)(&SCC1))->bit7
177         #define ENSCI  ((struct __hc08_bits *)(&SCC1))->bit6    
178         #define TXINV  ((struct __hc08_bits *)(&SCC1))->bit5
179         #define M      ((struct __hc08_bits *)(&SCC1))->bit4            
180         #define WAKE   ((struct __hc08_bits *)(&SCC1))->bit3
181         #define ILTY   ((struct __hc08_bits *)(&SCC1))->bit2
182         #define PEN    ((struct __hc08_bits *)(&SCC1))->bit1
183         #define PTY    ((struct __hc08_bits *)(&SCC1))->bit0
184         
185                 
186 _VOLDATA _UINT8 __at 0x14 SCC2;  /* SCI Control Register 2 */ 
187         #define SCTIE  ((struct __hc08_bits *)(&SCC2))->bit7
188         #define TCIE   ((struct __hc08_bits *)(&SCC2))->bit6
189         #define SCRIE  ((struct __hc08_bits *)(&SCC2))->bit5
190         #define ILIE   ((struct __hc08_bits *)(&SCC2))->bit4
191         #define TE     ((struct __hc08_bits *)(&SCC2))->bit3
192         #define RE     ((struct __hc08_bits *)(&SCC2))->bit2
193         #define WRU    ((struct __hc08_bits *)(&SCC2))->bit1
194         #define SBK    ((struct __hc08_bits *)(&SCC2))->bit0
195         
196 _VOLDATA _UINT8 __at 0x15 SCC3;  /* SCI Control Register 3 */ 
197         #define SCC3_R8 ((struct __hc08_bits *)(&SCC3))->bit7
198         #define SCC3_T8 ((struct __hc08_bits *)(&SCC3))->bit6
199         #define DMARE   ((struct __hc08_bits *)(&SCC3))->bit5
200         #define DMATE   ((struct __hc08_bits *)(&SCC3))->bit4
201         #define ORIE    ((struct __hc08_bits *)(&SCC3))->bit3
202         #define NEIE    ((struct __hc08_bits *)(&SCC3))->bit2
203         #define FEIE    ((struct __hc08_bits *)(&SCC3))->bit1
204         #define PEIE    ((struct __hc08_bits *)(&SCC3))->bit0
205         
206 _VOLDATA _UINT8 __at 0x16 SCS1;  /* SCI Status Register 1 */
207         #define SCTE  ((struct __hc08_bits *)(&SCS1))->bit7
208         #define TC    ((struct __hc08_bits *)(&SCS1))->bit6
209         #define SCRF  ((struct __hc08_bits *)(&SCS1))->bit5
210         #define IDLE  ((struct __hc08_bits *)(&SCS1))->bit4
211         #define OR    ((struct __hc08_bits *)(&SCS1))->bit3
212         #define NF    ((struct __hc08_bits *)(&SCS1))->bit2
213         #define FE    ((struct __hc08_bits *)(&SCS1))->bit1
214         #define PE    ((struct __hc08_bits *)(&SCS1))->bit0     
215                 
216 _VOLDATA _UINT8 __at 0x17 SCS2;  /* SCI Status Register 2 */
217         #define RPF  ((struct __hc08_bits *)(&SCS2))->bit0
218         #define BKF  ((struct __hc08_bits *)(&SCS2))->bit1
219   /*  Bits 2-7 not implemented  */
220         
221 _VOLDATA _UINT8 __at 0x18 SCDR;  /* SCI Data Register */
222         
223 _VOLDATA _UINT8 __at 0x19 SCBR;  /* SCI Baud Rate Register */
224         #define SCP1  ((struct __hc08_bits *)(&SCBR))->bit5
225         #define SCP0  ((struct __hc08_bits *)(&SCBR))->bit4
226         #define R     ((struct __hc08_bits *)(&SCBR))->bit3
227         #define SCR2  ((struct __hc08_bits *)(&SCBR))->bit2
228         #define SCR1  ((struct __hc08_bits *)(&SCBR))->bit1
229         #define SCR0  ((struct __hc08_bits *)(&SCBR))->bit0
230         /*-- Bits 6 and 7 do not exist */
231                 
232 _VOLDATA _UINT8 __at 0x1a INTKBSCR; /* Keyboard Status and Control Register */
233         #define KEYF   ((struct __hc08_bits *)(&INTKBSCR))->bit3
234         #define ACKK   ((struct __hc08_bits *)(&INTKBSCR))->bit2
235         #define IMASKK ((struct __hc08_bits *)(&INTKBSCR))->bit1
236         #define MODEK  ((struct __hc08_bits *)(&INTKBSCR))->bit0
237         /*-- Bits 4-7 do not exist  */
238                 
239 _VOLDATA _UINT8 __at 0x1b INTKBIER; /* Keyboard Interrupt Enable Register */
240   #define KBIE7  ((struct __hc08_bits *)(&INTKBIER))->bit7      
241         #define KBIE6  ((struct __hc08_bits *)(&INTKBIER))->bit6
242         #define KBIE5  ((struct __hc08_bits *)(&INTKBIER))->bit5
243         #define KBIE4  ((struct __hc08_bits *)(&INTKBIER))->bit4
244         #define KBIE3  ((struct __hc08_bits *)(&INTKBIER))->bit3
245         #define KBIE2  ((struct __hc08_bits *)(&INTKBIER))->bit2
246         #define KBIE1  ((struct __hc08_bits *)(&INTKBIER))->bit1
247         #define KBIE0  ((struct __hc08_bits *)(&INTKBIER))->bit0
248
249 _VOLDATA _UINT8 __at 0x1C INTSCR2; /* Keyboard Status and Control Register */
250         #define PUC0ENB ((struct __hc08_bits *)(&INTSCR2))->bit6
251         #define IRQF2   ((struct __hc08_bits *)(&INTSCR2))->bit3
252         #define ACK2    ((struct __hc08_bits *)(&INTSCR2))->bit2
253         #define IMASK2  ((struct __hc08_bits *)(&INTSCR2))->bit1
254         #define MODE2   ((struct __hc08_bits *)(&INTSCR2))->bit0
255         
256 _VOLDATA _UINT8 __at 0x1D CONFIG2; /* Configuration Register 2 */
257 /* CONFIG2 is one-time writeble, so can't use bitfields  */     
258                 
259                 
260 _VOLDATA _UINT8 __at 0x1E INTSCR1;      /* IRQ status/control       */
261         #define IRQF1  ((struct __hc08_bits *)(&INTSCR1))->bit3
262         #define ACK1   ((struct __hc08_bits *)(&INTSCR1))->bit2
263         #define IMASK1 ((struct __hc08_bits *)(&INTSCR1))->bit1
264         #define MODE1  ((struct __hc08_bits *)(&INTSCR1))->bit0
265         /* Bits 4-7 unimplemented */
266         
267 _VOLDATA _UINT8 __at 0x1f CONFIG1; /* Configuration Register 1 */
268 /* CONFIG1 is one-time writeable, so can't use bitfields */     
269         
270 _VOLDATA _UINT8 __at 0x20 T1SC;     /* TIM 1 Status and Control */
271   #define PS0   ((struct __hc08_bits *)(&T1SC))->bit0
272   #define PS1   ((struct __hc08_bits *)(&T1SC))->bit1
273   #define PS2   ((struct __hc08_bits *)(&T1SC))->bit2
274   #define TRST  ((struct __hc08_bits *)(&T1SC))->bit4
275   #define TSTOP ((struct __hc08_bits *)(&T1SC))->bit5
276   #define TOIE  ((struct __hc08_bits *)(&T1SC))->bit6
277   #define TOF   ((struct __hc08_bits *)(&T1SC))->bit7   
278
279 _VOLDATA _UINT16 __at 0x21 T1CNT;    /* TIM1 Counter High & Low Registers */
280 _VOLDATA _UINT8  __at 0x21  T1CNTH;  /* TIM1 Counter Register High */
281 _VOLDATA _UINT8  __at 0x22  T1CNTL;  /* TIM1 Counter Register Low */
282
283 _VOLDATA _UINT16 __at 0x23 T1MOD;    /* TIM1 Counter Modulo High & Low Registers */
284 _VOLDATA _UINT8  __at 0x23 T1MODH;   /* TIM1 Counter Modulo Register High */
285 _VOLDATA _UINT8  __at 0x24 T1MODL;   /* TIM1 Counter Modulo Register Low */
286
287 _VOLDATA _UINT8 __at 0x25 T1SC0;    /* TIM1 Channel 0 Status and Control Register */
288   #define CH0MAX ((struct __hc08_bits *)(&T1SC0))->bit0
289   #define TOV0   ((struct __hc08_bits *)(&T1SC0))->bit1
290   #define ELS0A  ((struct __hc08_bits *)(&T1SC0))->bit2
291   #define ELS0B  ((struct __hc08_bits *)(&T1SC0))->bit3
292   #define MS0A   ((struct __hc08_bits *)(&T1SC0))->bit4
293   #define MS0B   ((struct __hc08_bits *)(&T1SC0))->bit5
294   #define CH0IE  ((struct __hc08_bits *)(&T1SC0))->bit6
295   #define CH0F   ((struct __hc08_bits *)(&T1SC0))->bit7
296                 
297 _VOLDATA _UINT16 __at 0x26 T1CH0;   /* TIM1 Channel 0 High & Low Registers */
298 _VOLDATA _UINT8 __at 0x26 T1CH0H;   /* TIM1 Channel 0 Register High */
299 _VOLDATA _UINT8 __at 0x27 T1CH0L;   /* TIM1 Channel 0 Register Low */
300
301 _VOLDATA _UINT8 __at 0x28 T1SC1;    /* TIM1 Channel 1 Status and Control Register */
302   #define CH1MAX ((struct __hc08_bits *)(&T1SC1))->bit0
303   #define TOV1   ((struct __hc08_bits *)(&T1SC1))->bit1
304   #define ELS1A  ((struct __hc08_bits *)(&T1SC1))->bit2
305   #define ELS1B  ((struct __hc08_bits *)(&T1SC1))->bit3
306   #define MS1A   ((struct __hc08_bits *)(&T1SC1))->bit4
307   #define CH1IE  ((struct __hc08_bits *)(&T1SC1))->bit6
308   #define CH1F   ((struct __hc08_bits *)(&T1SC1))->bit7
309
310 _VOLDATA _UINT16 __at 0x29 T1CH1;    /* TIM1 Channel 1 High & Low Registers */
311 _VOLDATA _UINT8  __at 0x29  T1CH1H;  /* TIM1 Channel 1 Register High */
312 _VOLDATA _UINT8  __at 0x2A  T1CH1L;  /* TIM1 Channel 1 Register Low */
313         
314 /*------------------*/
315 /* TIM 2 REGISTERS  */
316 /*------------------*/
317         
318 _VOLDATA _UINT8 __at 0x2B T2SC;     /* TIM 2 Status and Control */
319   #define PS0_2   ((struct __hc08_bits *)(&T2SC))->bit0
320   #define PS1_2   ((struct __hc08_bits *)(&T2SC))->bit1
321   #define PS2_2   ((struct __hc08_bits *)(&T2SC))->bit2
322   #define TRST_2  ((struct __hc08_bits *)(&T2SC))->bit4
323   #define TSTOP_2 ((struct __hc08_bits *)(&T2SC))->bit5
324   #define TOIE_2  ((struct __hc08_bits *)(&T2SC))->bit6
325   #define TOF_2   ((struct __hc08_bits *)(&T2SC))->bit7 
326                 
327 _VOLDATA _UINT16 __at 0x2C T2CNT;   /* TIM2 Counter High & Low Registers */
328 _VOLDATA _UINT8  __at 0x2C T2CNTH;  /* TIM2 Counter Register High */
329 _VOLDATA _UINT8  __at 0x2D T2CNTL;  /* TIM2 Counter Register Low */
330         
331 _VOLDATA _UINT16 __at 0x2E T2MOD;    /* TIM2 Counter Modulo High & Low Registers */
332 _VOLDATA _UINT8  __at 0x2E T2MODH;   /* TIM2 Counter Modulo Register High */
333 _VOLDATA _UINT8  __at 0x2F T2MODL;   /* TIM2 Counter Modulo Register Low */     
334         
335 _VOLDATA _UINT8 __at 0x30 T2SC0;    /* TIM2 Channel 0 Status and Control Register */
336   #define CH0MAX_2 ((struct __hc08_bits *)(&T2SC0))->bit0
337   #define TOV0_2   ((struct __hc08_bits *)(&T2SC0))->bit1
338   #define ELS0A_2  ((struct __hc08_bits *)(&T2SC0))->bit2
339   #define ELS0B_2  ((struct __hc08_bits *)(&T2SC0))->bit3
340   #define MS0A_2   ((struct __hc08_bits *)(&T2SC0))->bit4
341   #define MS0B_2   ((struct __hc08_bits *)(&T2SC0))->bit5
342   #define CH0IE_2  ((struct __hc08_bits *)(&T2SC0))->bit6
343   #define CH0F_2   ((struct __hc08_bits *)(&T2SC0))->bit7       
344         
345 _VOLDATA _UINT16 __at 0x31 T2CH0;    /* TIM2 Channel 0 High & Low Registers */
346 _VOLDATA _UINT8  __at 0x31 T2CH0H;   /* TIM2 Channel 0 Register High */
347 _VOLDATA _UINT8  __at 0x32 T2CH0L;   /* TIM2 Channel 0 Register Low */  
348         
349 _VOLDATA _UINT8 __at 0x33 T2SC1;    /* TIM2 Channel 1 Status and Control Register */
350   #define CH1MAX_2 ((struct __hc08_bits *)(&T2SC1))->bit0
351   #define TOV1_2   ((struct __hc08_bits *)(&T2SC1))->bit1
352   #define ELS1A_2  ((struct __hc08_bits *)(&T2SC1))->bit2
353   #define ELS1B_2  ((struct __hc08_bits *)(&T2SC1))->bit3
354   #define MS1A_2   ((struct __hc08_bits *)(&T2SC1))->bit4
355   #define CH1IE_2  ((struct __hc08_bits *)(&T2SC1))->bit6
356   #define CH1F_2   ((struct __hc08_bits *)(&T2SC1))->bit7
357
358 _VOLDATA _UINT16 __at 0x34  T2CH1;   /* TIM2 Channel 1 High & Low Registers */
359 _VOLDATA _UINT8  __at 0x34  T2CH1H;  /* TIM2 Channel 1 Register High */
360 _VOLDATA _UINT8  __at 0x35  T2CH1L;  /* TIM2 Channel 1 Register Low */  
361         
362 _VOLDATA _UINT8 __at 0x36 PCTL;  /* PLL Control Register */
363         #define PLLIE ((struct __hc08_bits *)(&PCTL))->bit7
364         #define PLLF  ((struct __hc08_bits *)(&PCTL))->bit6
365         #define PLLON ((struct __hc08_bits *)(&PCTL))->bit5
366         #define BCS   ((struct __hc08_bits *)(&PCTL))->bit4
367         #define PRE1  ((struct __hc08_bits *)(&PCTL))->bit3
368         #define PRE0  ((struct __hc08_bits *)(&PCTL))->bit2
369         #define VPR1  ((struct __hc08_bits *)(&PCTL))->bit1
370         #define VPR0  ((struct __hc08_bits *)(&PCTL))->bit0
371                 
372 _VOLDATA        _UINT8 __at 0x37 PBWC;  /* PLL Bandwidth Control Register */
373         #define AUTO ((struct __hc08_bits *)(&PBWC))->bit7
374         #define LOCK ((struct __hc08_bits *)(&PBWC))->bit6
375         #define ACQ  ((struct __hc08_bits *)(&PBWC))->bit5
376         /* Bits 1-4, Unimplemented */
377         /* Bit 0, Reserved         */
378         
379 _VOLDATA _UINT8 __at 0x38 PMSH;  /* PLL Multiplier Select High */
380         #define MUL11 ((struct __hc08_bits *)(&PMSH))->bit3
381         #define MUL10 ((struct __hc08_bits *)(&PMSH))->bit2
382         #define MUL9  ((struct __hc08_bits *)(&PMSH))->bit1
383         #define MUL8  ((struct __hc08_bits *)(&PMSH))->bit0
384         /* Bits 4-7 unimplemented */
385         
386 _VOLDATA _UINT8 __at 0x39 PMSL;  /* PLL Multiplir Select Low */
387         #define MUL7 ((struct __hc08_bits *)(&PMSL))->bit7
388         #define MUL6 ((struct __hc08_bits *)(&PMSL))->bit6
389         #define MUL5 ((struct __hc08_bits *)(&PMSL))->bit5
390         #define MUL4 ((struct __hc08_bits *)(&PMSL))->bit4
391         #define MUL3 ((struct __hc08_bits *)(&PMSL))->bit3
392         #define MUL2 ((struct __hc08_bits *)(&PMSL))->bit2
393         #define MUL1 ((struct __hc08_bits *)(&PMSL))->bit1
394         #define MUL0 ((struct __hc08_bits *)(&PMSL))->bit0
395         
396 _VOLDATA _UINT8 __at 0x3a PMRS;  /* PLL VCO Select Range  */
397         #define VRS7 ((struct __hc08_bits *)(&PMRS))->bit7
398         #define VRS6 ((struct __hc08_bits *)(&PMRS))->bit6
399         #define VRS5 ((struct __hc08_bits *)(&PMRS))->bit5
400         #define VRS4 ((struct __hc08_bits *)(&PMRS))->bit4
401         #define VRS3 ((struct __hc08_bits *)(&PMRS))->bit3
402         #define VRS2 ((struct __hc08_bits *)(&PMRS))->bit2
403         #define VRS1 ((struct __hc08_bits *)(&PMRS))->bit1
404         #define VRS0 ((struct __hc08_bits *)(&PMRS))->bit0
405                 
406 _VOLDATA _UINT8 __at 0x3b PMDS;  /* PLL Reference Divider Select Register */    
407         #define RDS3 ((struct __hc08_bits *)(&PMDS))->bit3
408         #define RDS2 ((struct __hc08_bits *)(&PMDS))->bit2
409         #define RDS1 ((struct __hc08_bits *)(&PMDS))->bit1
410         #define RDS0 ((struct __hc08_bits *)(&PMDS))->bit0
411         /* Bits 4-7 unimplemented */
412
413
414
415 _VOLDATA _UINT8 __at 0x40 IRSCC1;  /* SCI Control Register 1 */ 
416         #define LOOPS_IR  ((struct __hc08_bits *)(&IRSCC1))->bit7
417         #define ENSCI_IR  ((struct __hc08_bits *)(&IRSCC1))->bit6       
418         #define TXINV_IR  ((struct __hc08_bits *)(&IRSCC1))->bit5
419         #define M_IR      ((struct __hc08_bits *)(&IRSCC1))->bit4               
420         #define WAKE_IR   ((struct __hc08_bits *)(&IRSCC1))->bit3
421         #define ILTY_IR   ((struct __hc08_bits *)(&IRSCC1))->bit2
422         #define PEN_IR    ((struct __hc08_bits *)(&IRSCC1))->bit1
423         #define PTY_IR    ((struct __hc08_bits *)(&IRSCC1))->bit0
424         
425                 
426 _VOLDATA _UINT8 __at 0x41 IRSCC2;  /* SCI Control Register 2 */ 
427         #define SCTIE_IR  ((struct __hc08_bits *)(&IRSCC2))->bit7
428         #define TCIE_IR   ((struct __hc08_bits *)(&IRSCC2))->bit6
429         #define SCRIE_IR  ((struct __hc08_bits *)(&IRSCC2))->bit5
430         #define ILIE_IR   ((struct __hc08_bits *)(&IRSCC2))->bit4
431         #define TE_IR     ((struct __hc08_bits *)(&IRSCC2))->bit3
432         #define RE_IR     ((struct __hc08_bits *)(&IRSCC2))->bit2
433         #define WRU_IR    ((struct __hc08_bits *)(&IRSCC2))->bit1
434         #define SBK_IR    ((struct __hc08_bits *)(&IRSCC2))->bit0
435         
436 _VOLDATA _UINT8 __at 0x42 IRSCC3;  /* SCI Control Register 3 */ 
437         #define SCC3_R8_IR ((struct __hc08_bits *)(&IRSCC3))->bit7
438         #define SCC3_T8_IR ((struct __hc08_bits *)(&IRSCC3))->bit6
439         #define DMARE_IR   ((struct __hc08_bits *)(&IRSCC3))->bit5
440         #define DMATE_IR   ((struct __hc08_bits *)(&IRSCC3))->bit4
441         #define ORIE_IR    ((struct __hc08_bits *)(&IRSCC3))->bit3
442         #define NEIE_IR    ((struct __hc08_bits *)(&IRSCC3))->bit2
443         #define FEIE_IR    ((struct __hc08_bits *)(&IRSCC3))->bit1
444         #define PEIE_IR    ((struct __hc08_bits *)(&IRSCC3))->bit0
445         
446 _VOLDATA _UINT8 __at 0x43 IRSCS1;  /* SCI Status Register 1 */
447         #define SCTE_IR  ((struct __hc08_bits *)(&IRSCS1))->bit7
448         #define TC_IR    ((struct __hc08_bits *)(&IRSCS1))->bit6
449         #define SCRF_IR  ((struct __hc08_bits *)(&IRSCS1))->bit5
450         #define IDLE_IR  ((struct __hc08_bits *)(&IRSCS1))->bit4
451         #define OR_IR    ((struct __hc08_bits *)(&IRSCS1))->bit3
452         #define NF_IR    ((struct __hc08_bits *)(&IRSCS1))->bit2
453         #define FE_IR    ((struct __hc08_bits *)(&IRSCS1))->bit1
454         #define PE_IR    ((struct __hc08_bits *)(&IRSCS1))->bit0        
455                 
456 _VOLDATA _UINT8 __at 0x44 IRSCS2;  /* SCI Status Register 2 */
457         #define RPF_IR  ((struct __hc08_bits *)(&IRSCS2))->bit0
458         #define BKF_IR  ((struct __hc08_bits *)(&IRSCS2))->bit1
459   /*  Bits 2-7 not implemented  */
460         
461 _VOLDATA _UINT8 __at 0x45 IRSCDR;  /* SCI Data Register */
462         
463 _VOLDATA _UINT8 __at 0x46 IRSCBR;  /* SCI Baud Rate Register */
464         #define CKS_IR   ((struct __hc08_bits *)(&IRSCBR))->bit7
465         #define SCP1_IR  ((struct __hc08_bits *)(&IRSCBR))->bit5
466         #define SCP0_IR  ((struct __hc08_bits *)(&IRSCBR))->bit4
467         #define SCR2_IR  ((struct __hc08_bits *)(&IRSCBR))->bit2
468         #define SCR1_IR  ((struct __hc08_bits *)(&IRSCBR))->bit1
469         #define SCR0_IR  ((struct __hc08_bits *)(&IRSCBR))->bit0
470
471 _VOLDATA _UINT8 __at 0x47 IRSCIRCR;  /* SCI Baud Rate Register */
472         #define TNP1_IR  ((struct __hc08_bits *)(&IRSCIRCR))->bit2
473         #define TNP0_IR  ((struct __hc08_bits *)(&IRSCIRCR))->bit1
474         #define IREN_IR  ((struct __hc08_bits *)(&IRSCIRCR))->bit0
475
476
477
478 _VOLDATA _UINT8 __at 0x48 MMADR; /* MMIIC Address Register. */
479         #define MMAD7   ((struct __hc08_bits *)(&MMADR))->bit7
480         #define MMAD6   ((struct __hc08_bits *)(&MMADR))->bit6
481         #define MMAD5   ((struct __hc08_bits *)(&MMADR))->bit5
482         #define MMAD4   ((struct __hc08_bits *)(&MMADR))->bit4
483         #define MMAD3   ((struct __hc08_bits *)(&MMADR))->bit3
484         #define MMAD2   ((struct __hc08_bits *)(&MMADR))->bit2
485         #define MMAD1   ((struct __hc08_bits *)(&MMADR))->bit1
486         #define MMEXTAD ((struct __hc08_bits *)(&MMADR))->bit0
487         
488
489 _VOLDATA _UINT8 __at 0x49 MMCR1; /* MMIIC Control Register 1. */
490         #define MMEN      ((struct __hc08_bits *)(&MMCR1))->bit7
491         #define MMIEN     ((struct __hc08_bits *)(&MMCR1))->bit6
492         #define MMCLRBB   ((struct __hc08_bits *)(&MMCR1))->bit5
493         #define MMTXAK    ((struct __hc08_bits *)(&MMCR1))->bit3
494         #define REPSEN    ((struct __hc08_bits *)(&MMCR1))->bit2
495         #define MMCRCBYTE ((struct __hc08_bits *)(&MMCR1))->bit1
496         
497
498 _VOLDATA _UINT8 __at 0x4a MMCR2; /* MMIIC Control Register 2. */
499         #define MMALIF      ((struct __hc08_bits *)(&MMCR2))->bit7
500         #define MMNAKIF     ((struct __hc08_bits *)(&MMCR2))->bit6
501         #define MMBB        ((struct __hc08_bits *)(&MMCR2))->bit5
502         #define MMAST       ((struct __hc08_bits *)(&MMCR2))->bit4
503         #define MMRW        ((struct __hc08_bits *)(&MMCR2))->bit3
504         #define MMCRCEF     ((struct __hc08_bits *)(&MMCR2))->bit0
505         
506
507 _VOLDATA _UINT8 __at 0x4B MMSR; /* MMIIC Status Register. */
508         #define MMRXIF  ((struct __hc08_bits *)(&MMSR))->bit7
509         #define MMTXIF  ((struct __hc08_bits *)(&MMSR))->bit6
510         #define MMATCH  ((struct __hc08_bits *)(&MMSR))->bit5
511         #define MMSRW   ((struct __hc08_bits *)(&MMSR))->bit4
512         #define MMRXAK  ((struct __hc08_bits *)(&MMSR))->bit3
513         #define MMCRCBF ((struct __hc08_bits *)(&MMSR))->bit2
514         #define MMTXBE  ((struct __hc08_bits *)(&MMSR))->bit1
515         #define MMRXBF  ((struct __hc08_bits *)(&MMSR))->bit0
516         
517 _VOLDATA _UINT8 __at 0x4C MMDTR;  /* MMIIC Data Transmit Register */
518 _VOLDATA _UINT8 __at 0x4D MMDRR;  /* MMIIC Data Receive Register  */
519 _VOLDATA _UINT8 __at 0x4E MMCRDR; /* MMIIC CRC Data Register  */
520
521
522 _VOLDATA _UINT8 __at 0x4F MMFDR;  /* MMIIC Frecuency Divider Register */
523         #define MMBR2  ((struct __hc08_bits *)(&MMFDR))->bit2
524         #define MMBR1  ((struct __hc08_bits *)(&MMFDR))->bit1
525         #define MMBR0  ((struct __hc08_bits *)(&MMFDR))->bit0
526
527
528 _VOLDATA _UINT8 __at 0x51 TBCR;    /* Time Base Module Control */
529         #define TBIF   ((struct __hc08_bits *)(&TBCR))->bit7
530         #define TBR2   ((struct __hc08_bits *)(&TBCR))->bit6
531         #define TBR1   ((struct __hc08_bits *)(&TBCR))->bit5
532         #define TBR0   ((struct __hc08_bits *)(&TBCR))->bit4
533         #define TACK   ((struct __hc08_bits *)(&TBCR))->bit3
534         #define TBIE   ((struct __hc08_bits *)(&TBCR))->bit2
535         #define TBON   ((struct __hc08_bits *)(&TBCR))->bit1
536         /* Bit 0 Reserved */    
537
538
539
540 _VOLDATA _UINT8 __at 0x57 ADSCR; /* Analog-to-Digital Status and Control Reg. */
541         #define COCO  ((struct __hc08_bits *)(&ADSCR))->bit7
542         #define AIEN  ((struct __hc08_bits *)(&ADSCR))->bit6
543         #define ADCO  ((struct __hc08_bits *)(&ADSCR))->bit5
544         #define ADCH4 ((struct __hc08_bits *)(&ADSCR))->bit4
545         #define ADCH3 ((struct __hc08_bits *)(&ADSCR))->bit3
546         #define ADCH2 ((struct __hc08_bits *)(&ADSCR))->bit2
547         #define ADCH1 ((struct __hc08_bits *)(&ADSCR))->bit1
548         #define ADCH0 ((struct __hc08_bits *)(&ADSCR))->bit0
549         
550 _VOLDATA _UINT8 __at 0x58 ADCLK; /* Analog-to-Digital Clock */
551         #define ADIV2  ((struct __hc08_bits *)(&ADCLK))->bit7
552         #define ADIV1  ((struct __hc08_bits *)(&ADCLK))->bit6
553         #define ADIV0  ((struct __hc08_bits *)(&ADCLK))->bit5
554         #define ADICLK ((struct __hc08_bits *)(&ADCLK))->bit4
555         #define ADMODE1  ((struct __hc08_bits *)(&ADCLK))->bit3
556         #define ADMODE0  ((struct __hc08_bits *)(&ADCLK))->bit2
557         
558 _VOLDATA _UINT8 __at 0x59 ADRH0;   /* Analog-to-Digital Data Register  */
559 _VOLDATA _UINT8 __at 0x5a ADRL0;   /* Analog-to-Digital Data Register  */
560 _VOLDATA _UINT8 __at 0x5b ADRL1;   /* Analog-to-Digital Data Register  */
561 _VOLDATA _UINT8 __at 0x5c ADRL2;   /* Analog-to-Digital Data Register  */
562 _VOLDATA _UINT8 __at 0x5d ADRL3;   /* Analog-to-Digital Data Register  */
563
564 _VOLDATA _UINT8 __at 0x5e ADASCR; /* ADC Auto Scan Control */
565         #define ASCAN  ((struct __hc08_bits *)(&ADCLK))->bit0
566         #define AUTO0  ((struct __hc08_bits *)(&ADCLK))->bit1
567         #define AUTO1  ((struct __hc08_bits *)(&ADCLK))->bit2
568
569
570 _VOLXDATA _UINT8 __at 0xfe00 SBSR;     /* SIM Break Status Register */
571   #define SBSW ((struct __hc08_bits *)(&SBSR))->bit1
572
573 _VOLXDATA _UINT8 __at 0xfe01 SRSR;    /* SIM Reset Status Register */
574   #define LVI    ((struct __hc08_bits *)(&SRSR))->bit1
575   #define MODRST ((struct __hc08_bits *)(&SRSR))->bit2
576   #define ILAD   ((struct __hc08_bits *)(&SRSR))->bit3
577   #define ILOP   ((struct __hc08_bits *)(&SRSR))->bit4
578   #define COP    ((struct __hc08_bits *)(&SRSR))->bit5
579   #define PIN    ((struct __hc08_bits *)(&SRSR))->bit6
580   #define POR    ((struct __hc08_bits *)(&SRSR))->bit7
581   /* Bit 0 unimplemented */
582
583         
584 _VOLXDATA _UINT8 __at 0xfe03 SBFCR;    /* SIM Break Flag Control Register */
585   #define BFCE ((struct __hc08_bits *)(&BFCR))->bit7
586
587 _VOLXDATA _UINT8 __at 0xfe04 INT1;    /* Interrupt Status Register 1 */
588   #define IF1 ((struct __hc08_bits *)(&INT1))->bit2
589   #define IF2 ((struct __hc08_bits *)(&INT1))->bit3
590   #define IF3 ((struct __hc08_bits *)(&INT1))->bit4
591   #define IF4 ((struct __hc08_bits *)(&INT1))->bit5
592   #define IF5 ((struct __hc08_bits *)(&INT1))->bit6
593   #define IF6 ((struct __hc08_bits *)(&INT1))->bit7
594         /* Bits 0-1 Reserved */
595         
596 _VOLXDATA _UINT8 __at 0xfe05 INT2;  /* Interrupt Status Register 2 */
597         #define IF14 ((struct __hc08_bits *)(&INT2))->bit7
598         #define IF13 ((struct __hc08_bits *)(&INT2))->bit6      
599         #define IF12 ((struct __hc08_bits *)(&INT2))->bit5
600         #define IF11 ((struct __hc08_bits *)(&INT2))->bit4      
601         #define IF10 ((struct __hc08_bits *)(&INT2))->bit3
602         #define IF9 ((struct __hc08_bits *)(&INT2))->bit2
603         #define IF8 ((struct __hc08_bits *)(&INT2))->bit1
604         #define IF7 ((struct __hc08_bits *)(&INT2))->bit0       
605                 
606 _VOLXDATA _UINT8 __at 0xfe06 INT3;  /* Interrupt Status Register 3 */
607         #define IF21 ((struct __hc08_bits *)(&INT3))->bit6      
608         #define IF20 ((struct __hc08_bits *)(&INT3))->bit5      
609         #define IF19 ((struct __hc08_bits *)(&INT3))->bit4      
610         #define IF18 ((struct __hc08_bits *)(&INT3))->bit3      
611         #define IF17 ((struct __hc08_bits *)(&INT3))->bit2      
612         #define IF16 ((struct __hc08_bits *)(&INT3))->bit1      
613         #define IF15 ((struct __hc08_bits *)(&INT3))->bit0      
614         
615 _VOLXDATA _UINT8 __at 0xfe08 FLCR;    /* FLASH Control Register */
616   #define PGM   ((struct __hc08_bits *)(&FLCR))->bit0
617   #define ERASE ((struct __hc08_bits *)(&FLCR))->bit1
618   #define MASS  ((struct __hc08_bits *)(&FLCR))->bit2
619   #define HVEN  ((struct __hc08_bits *)(&FLCR))->bit3
620
621         
622 _VOLXDATA _UINT8 __at 0xfe09 FLBPR;    /* FLASH Block Protect Register */
623   #define BPR0 ((struct __hc08_bits *)(&FLBPR))->bit0
624   #define BPR1 ((struct __hc08_bits *)(&FLBPR))->bit1
625   #define BPR2 ((struct __hc08_bits *)(&FLBPR))->bit2
626   #define BPR3 ((struct __hc08_bits *)(&FLBPR))->bit3
627   #define BPR4 ((struct __hc08_bits *)(&FLBPR))->bit4
628   #define BPR5 ((struct __hc08_bits *)(&FLBPR))->bit5
629   #define BPR6 ((struct __hc08_bits *)(&FLBPR))->bit6
630   #define BPR7 ((struct __hc08_bits *)(&FLBPR))->bit7
631
632                 
633 _VOLXDATA _UINT16 __at 0xfe0C BRK;    /* Break Address High & Low Registers */
634 _VOLXDATA _UINT8 __at 0xfe0C BRKH;    /* Break Address High Register */
635 _VOLXDATA _UINT8 __at 0xfe0D BRKL;    /* Break Address Low Register */  
636         
637 _VOLXDATA _UINT8 __at 0xfe0b BRKSCR;  /* Break Status and Control Register */
638   #define BRKA ((struct __hc08_bits *)(&BRKSCR))->bit6
639   #define BRKE ((struct __hc08_bits *)(&BRKSCR))->bit7  
640
641 _VOLXDATA _UINT8 __at 0xfe0c LVISR;   /* Low voltage detect */
642         #define LVIOUT ((struct __hc08_bits *)(&LVISR))->bit7
643         
644
645 _VOLXDATA _UINT8 __at 0xffff COPCTL;  /* COP Control Register */
646
647 #endif