Imported Upstream version 2.9.0
[debian/cc1111] / device / include / pic / pic16c620a.h
1 //
2 // Register Declarations for Microchip 16CR620A Processor
3 //
4 //
5 // This header file was automatically generated by:
6 //
7 //      inc2h.pl V4783
8 //
9 //      Copyright (c) 2002, Kevin L. Pauba, All Rights Reserved
10 //
11 //      SDCC is licensed under the GNU Public license (GPL) v2.  Note that
12 //      this license covers the code to the compiler and other executables,
13 //      but explicitly does not cover any code or objects generated by sdcc.
14 //      We have not yet decided on a license for the run time libraries, but
15 //      it will not put any requirements on code linked against it. See:
16 // 
17 //      http://www.gnu.org/copyleft/gpl/html
18 //
19 //      See http://sdcc.sourceforge.net/ for the latest information on sdcc.
20 //
21 // 
22 #ifndef P16CR620A_H
23 #define P16CR620A_H
24
25 //
26 // Register addresses.
27 //
28 #define INDF_ADDR       0x0000
29 #define TMR0_ADDR       0x0001
30 #define PCL_ADDR        0x0002
31 #define STATUS_ADDR     0x0003
32 #define FSR_ADDR        0x0004
33 #define PORTA_ADDR      0x0005
34 #define PORTB_ADDR      0x0006
35 #define PCLATH_ADDR     0x000A
36 #define INTCON_ADDR     0x000B
37 #define PIR1_ADDR       0x000C
38 #define CMCON_ADDR      0x001F
39 #define OPTION_REG_ADDR 0x0081
40 #define TRISA_ADDR      0x0085
41 #define TRISB_ADDR      0x0086
42 #define PIE1_ADDR       0x008C
43 #define PCON_ADDR       0x008E
44 #define VRCON_ADDR      0x009F
45
46 //
47 // Memory organization.
48 //
49
50
51
52 //         LIST
53 // P16C620A.INC  Standard Header File, Version 1.10    Microchip Technology, Inc.
54 //         NOLIST
55
56 // This header file defines configurations, registers, and other useful bits of
57 // information for the PIC16C620A and PIC16CR620A microcontrollers.  These names are taken to match 
58 // the data sheets as closely as possible.  
59
60 // Note that the processor must be selected before this file is 
61 // included.  The processor may be selected the following ways:
62
63 //       1. Command line switch:
64 //               C:\ MPASM MYFILE.ASM /PIC16C620A   or
65 //               C:\ MPASM MYFILE.ASM /PIC16CR620A
66 //       2. LIST directive in the source file
67 //               LIST   P=PIC16C620A   or
68 //               LIST   P=PIC16CR620A
69 //       3. Processor Type entry in the MPASM full-screen interface
70
71 //==========================================================================
72 //
73 //       Revision History
74 //
75 //==========================================================================
76
77 //Rev:   Date:    Reason:
78
79 //1.00   05/28/97 Initial Release
80 //1.10   16/08/99 Added unbanked RAM at 70-7F 
81 //1.20   06/12/02 Verification now includes the PIC16CR620A (pas)
82
83 //==========================================================================
84 //
85 //       Verify Processor
86 //
87 //==========================================================================
88
89 //        IFNDEF __16C620A
90 //      IFNDEF __16CR620A
91 //            MESSG "Processor-header file mismatch.  Verify selected processor."
92 //         ENDIF
93 //      ENDIF
94
95 //==========================================================================
96 //
97 //       Register Definitions
98 //
99 //==========================================================================
100
101 #define W                    0x0000
102 #define F                    0x0001
103
104 //----- Register Files------------------------------------------------------
105
106 extern __sfr  __at (INDF_ADDR)                    INDF;
107 extern __sfr  __at (TMR0_ADDR)                    TMR0;
108 extern __sfr  __at (PCL_ADDR)                     PCL;
109 extern __sfr  __at (STATUS_ADDR)                  STATUS;
110 extern __sfr  __at (FSR_ADDR)                     FSR;
111 extern __sfr  __at (PORTA_ADDR)                   PORTA;
112 extern __sfr  __at (PORTB_ADDR)                   PORTB;
113 extern __sfr  __at (PCLATH_ADDR)                  PCLATH;
114 extern __sfr  __at (INTCON_ADDR)                  INTCON;
115 extern __sfr  __at (PIR1_ADDR)                    PIR1;
116 extern __sfr  __at (CMCON_ADDR)                   CMCON;
117
118 extern __sfr  __at (OPTION_REG_ADDR)              OPTION_REG;
119 extern __sfr  __at (TRISA_ADDR)                   TRISA;
120 extern __sfr  __at (TRISB_ADDR)                   TRISB;
121 extern __sfr  __at (PIE1_ADDR)                    PIE1;
122 extern __sfr  __at (PCON_ADDR)                    PCON;
123 extern __sfr  __at (VRCON_ADDR)                   VRCON;
124
125 //----- STATUS Bits --------------------------------------------------------
126
127
128 //----- INTCON Bits --------------------------------------------------------
129
130
131 //----- PIR1 Bits ----------------------------------------------------------
132
133
134 //----- CMCON Bits ---------------------------------------------------------
135
136
137 //----- OPTION Bits --------------------------------------------------------
138
139
140 //----- PIE1 Bits ----------------------------------------------------------
141
142
143 //----- PCON Bits ----------------------------------------------------------
144
145
146 //----- VRCON Bits ---------------------------------------------------------
147
148
149 //==========================================================================
150 //
151 //       RAM Definition
152 //
153 //==========================================================================
154
155 //         __MAXRAM H'0FF'
156 //         __BADRAM H'07'-H'09', H'0D'-H'1E'
157 //         __BADRAM H'87'-H'89', H'8D', H'8F'-H'9E'
158 //      __BADRAM H'A0'-H'EF'
159
160 //==========================================================================
161 //
162 //       Configuration Bits
163 //
164 //==========================================================================
165
166 #define _BODEN_ON            0x3FFF
167 #define _BODEN_OFF           0x3FBF
168 #define _CP_ON               0x00CF
169 #define _CP_OFF              0x3FFF
170 #define _PWRTE_OFF           0x3FFF
171 #define _PWRTE_ON            0x3FF7
172 #define _WDT_ON              0x3FFF
173 #define _WDT_OFF             0x3FFB
174 #define _LP_OSC              0x3FFC
175 #define _XT_OSC              0x3FFD
176 #define _HS_OSC              0x3FFE
177 #define _RC_OSC              0x3FFF
178
179 //         LIST
180
181 // ----- CMCON bits --------------------
182 typedef union {
183   struct {
184     unsigned char CM0:1;
185     unsigned char CM1:1;
186     unsigned char CM2:1;
187     unsigned char CIS:1;
188     unsigned char :1;
189     unsigned char :1;
190     unsigned char C1OUT:1;
191     unsigned char C2OUT:1;
192   };
193 } __CMCON_bits_t;
194 extern volatile __CMCON_bits_t __at(CMCON_ADDR) CMCON_bits;
195
196 #ifndef NO_BIT_DEFINES
197 #define CM0                  CMCON_bits.CM0
198 #define CM1                  CMCON_bits.CM1
199 #define CM2                  CMCON_bits.CM2
200 #define CIS                  CMCON_bits.CIS
201 #define C1OUT                CMCON_bits.C1OUT
202 #define C2OUT                CMCON_bits.C2OUT
203 #endif /* NO_BIT_DEFINES */
204
205 // ----- INTCON bits --------------------
206 typedef union {
207   struct {
208     unsigned char RBIF:1;
209     unsigned char INTF:1;
210     unsigned char T0IF:1;
211     unsigned char RBIE:1;
212     unsigned char INTE:1;
213     unsigned char T0IE:1;
214     unsigned char PEIE:1;
215     unsigned char GIE:1;
216   };
217 } __INTCON_bits_t;
218 extern volatile __INTCON_bits_t __at(INTCON_ADDR) INTCON_bits;
219
220 #ifndef NO_BIT_DEFINES
221 #define RBIF                 INTCON_bits.RBIF
222 #define INTF                 INTCON_bits.INTF
223 #define T0IF                 INTCON_bits.T0IF
224 #define RBIE                 INTCON_bits.RBIE
225 #define INTE                 INTCON_bits.INTE
226 #define T0IE                 INTCON_bits.T0IE
227 #define PEIE                 INTCON_bits.PEIE
228 #define GIE                  INTCON_bits.GIE
229 #endif /* NO_BIT_DEFINES */
230
231 // ----- OPTION_REG bits --------------------
232 typedef union {
233   struct {
234     unsigned char PS0:1;
235     unsigned char PS1:1;
236     unsigned char PS2:1;
237     unsigned char PSA:1;
238     unsigned char T0SE:1;
239     unsigned char T0CS:1;
240     unsigned char INTEDG:1;
241     unsigned char NOT_RBPU:1;
242   };
243 } __OPTION_REG_bits_t;
244 extern volatile __OPTION_REG_bits_t __at(OPTION_REG_ADDR) OPTION_REG_bits;
245
246 #ifndef NO_BIT_DEFINES
247 #define PS0                  OPTION_REG_bits.PS0
248 #define PS1                  OPTION_REG_bits.PS1
249 #define PS2                  OPTION_REG_bits.PS2
250 #define PSA                  OPTION_REG_bits.PSA
251 #define T0SE                 OPTION_REG_bits.T0SE
252 #define T0CS                 OPTION_REG_bits.T0CS
253 #define INTEDG               OPTION_REG_bits.INTEDG
254 #define NOT_RBPU             OPTION_REG_bits.NOT_RBPU
255 #endif /* NO_BIT_DEFINES */
256
257 // ----- PCON bits --------------------
258 typedef union {
259   struct {
260     unsigned char NOT_BO:1;
261     unsigned char NOT_POR:1;
262     unsigned char :1;
263     unsigned char :1;
264     unsigned char :1;
265     unsigned char :1;
266     unsigned char :1;
267     unsigned char :1;
268   };
269   struct {
270     unsigned char NOT_BOR:1;
271     unsigned char :1;
272     unsigned char :1;
273     unsigned char :1;
274     unsigned char :1;
275     unsigned char :1;
276     unsigned char :1;
277     unsigned char :1;
278   };
279 } __PCON_bits_t;
280 extern volatile __PCON_bits_t __at(PCON_ADDR) PCON_bits;
281
282 #ifndef NO_BIT_DEFINES
283 #define NOT_BO               PCON_bits.NOT_BO
284 #define NOT_BOR              PCON_bits.NOT_BOR
285 #define NOT_POR              PCON_bits.NOT_POR
286 #endif /* NO_BIT_DEFINES */
287
288 // ----- PIE1 bits --------------------
289 typedef union {
290   struct {
291     unsigned char :1;
292     unsigned char :1;
293     unsigned char :1;
294     unsigned char :1;
295     unsigned char :1;
296     unsigned char :1;
297     unsigned char CMIE:1;
298     unsigned char :1;
299   };
300 } __PIE1_bits_t;
301 extern volatile __PIE1_bits_t __at(PIE1_ADDR) PIE1_bits;
302
303 #ifndef NO_BIT_DEFINES
304 #define CMIE                 PIE1_bits.CMIE
305 #endif /* NO_BIT_DEFINES */
306
307 // ----- PIR1 bits --------------------
308 typedef union {
309   struct {
310     unsigned char :1;
311     unsigned char :1;
312     unsigned char :1;
313     unsigned char :1;
314     unsigned char :1;
315     unsigned char :1;
316     unsigned char CMIF:1;
317     unsigned char :1;
318   };
319 } __PIR1_bits_t;
320 extern volatile __PIR1_bits_t __at(PIR1_ADDR) PIR1_bits;
321
322 #ifndef NO_BIT_DEFINES
323 #define CMIF                 PIR1_bits.CMIF
324 #endif /* NO_BIT_DEFINES */
325
326 // ----- PORTA bits --------------------
327 typedef union {
328   struct {
329     unsigned char RA0:1;
330     unsigned char RA1:1;
331     unsigned char RA2:1;
332     unsigned char RA3:1;
333     unsigned char RA4:1;
334     unsigned char RA5:1;
335     unsigned char :1;
336     unsigned char :1;
337   };
338 } __PORTA_bits_t;
339 extern volatile __PORTA_bits_t __at(PORTA_ADDR) PORTA_bits;
340
341 #ifndef NO_BIT_DEFINES
342 #define RA0                  PORTA_bits.RA0
343 #define RA1                  PORTA_bits.RA1
344 #define RA2                  PORTA_bits.RA2
345 #define RA3                  PORTA_bits.RA3
346 #define RA4                  PORTA_bits.RA4
347 #define RA5                  PORTA_bits.RA5
348 #endif /* NO_BIT_DEFINES */
349
350 // ----- PORTB bits --------------------
351 typedef union {
352   struct {
353     unsigned char RB0:1;
354     unsigned char RB1:1;
355     unsigned char RB2:1;
356     unsigned char RB3:1;
357     unsigned char RB4:1;
358     unsigned char RB5:1;
359     unsigned char RB6:1;
360     unsigned char RB7:1;
361   };
362 } __PORTB_bits_t;
363 extern volatile __PORTB_bits_t __at(PORTB_ADDR) PORTB_bits;
364
365 #ifndef NO_BIT_DEFINES
366 #define RB0                  PORTB_bits.RB0
367 #define RB1                  PORTB_bits.RB1
368 #define RB2                  PORTB_bits.RB2
369 #define RB3                  PORTB_bits.RB3
370 #define RB4                  PORTB_bits.RB4
371 #define RB5                  PORTB_bits.RB5
372 #define RB6                  PORTB_bits.RB6
373 #define RB7                  PORTB_bits.RB7
374 #endif /* NO_BIT_DEFINES */
375
376 // ----- STATUS bits --------------------
377 typedef union {
378   struct {
379     unsigned char C:1;
380     unsigned char DC:1;
381     unsigned char Z:1;
382     unsigned char NOT_PD:1;
383     unsigned char NOT_TO:1;
384     unsigned char RP0:1;
385     unsigned char RP1:1;
386     unsigned char IRP:1;
387   };
388 } __STATUS_bits_t;
389 extern volatile __STATUS_bits_t __at(STATUS_ADDR) STATUS_bits;
390
391 #ifndef NO_BIT_DEFINES
392 #define C                    STATUS_bits.C
393 #define DC                   STATUS_bits.DC
394 #define Z                    STATUS_bits.Z
395 #define NOT_PD               STATUS_bits.NOT_PD
396 #define NOT_TO               STATUS_bits.NOT_TO
397 #define RP0                  STATUS_bits.RP0
398 #define RP1                  STATUS_bits.RP1
399 #define IRP                  STATUS_bits.IRP
400 #endif /* NO_BIT_DEFINES */
401
402 // ----- TRISA bits --------------------
403 typedef union {
404   struct {
405     unsigned char TRISA0:1;
406     unsigned char TRISA1:1;
407     unsigned char TRISA2:1;
408     unsigned char TRISA3:1;
409     unsigned char TRISA4:1;
410     unsigned char TRISA5:1;
411     unsigned char :1;
412     unsigned char :1;
413   };
414 } __TRISA_bits_t;
415 extern volatile __TRISA_bits_t __at(TRISA_ADDR) TRISA_bits;
416
417 #ifndef NO_BIT_DEFINES
418 #define TRISA0               TRISA_bits.TRISA0
419 #define TRISA1               TRISA_bits.TRISA1
420 #define TRISA2               TRISA_bits.TRISA2
421 #define TRISA3               TRISA_bits.TRISA3
422 #define TRISA4               TRISA_bits.TRISA4
423 #define TRISA5               TRISA_bits.TRISA5
424 #endif /* NO_BIT_DEFINES */
425
426 // ----- TRISB bits --------------------
427 typedef union {
428   struct {
429     unsigned char TRISB0:1;
430     unsigned char TRISB1:1;
431     unsigned char TRISB2:1;
432     unsigned char TRISB3:1;
433     unsigned char TRISB4:1;
434     unsigned char TRISB5:1;
435     unsigned char TRISB6:1;
436     unsigned char TRISB7:1;
437   };
438 } __TRISB_bits_t;
439 extern volatile __TRISB_bits_t __at(TRISB_ADDR) TRISB_bits;
440
441 #ifndef NO_BIT_DEFINES
442 #define TRISB0               TRISB_bits.TRISB0
443 #define TRISB1               TRISB_bits.TRISB1
444 #define TRISB2               TRISB_bits.TRISB2
445 #define TRISB3               TRISB_bits.TRISB3
446 #define TRISB4               TRISB_bits.TRISB4
447 #define TRISB5               TRISB_bits.TRISB5
448 #define TRISB6               TRISB_bits.TRISB6
449 #define TRISB7               TRISB_bits.TRISB7
450 #endif /* NO_BIT_DEFINES */
451
452 // ----- VRCON bits --------------------
453 typedef union {
454   struct {
455     unsigned char VR0:1;
456     unsigned char VR1:1;
457     unsigned char VR2:1;
458     unsigned char VR3:1;
459     unsigned char :1;
460     unsigned char VRR:1;
461     unsigned char VROE:1;
462     unsigned char VREN:1;
463   };
464 } __VRCON_bits_t;
465 extern volatile __VRCON_bits_t __at(VRCON_ADDR) VRCON_bits;
466
467 #ifndef NO_BIT_DEFINES
468 #define VR0                  VRCON_bits.VR0
469 #define VR1                  VRCON_bits.VR1
470 #define VR2                  VRCON_bits.VR2
471 #define VR3                  VRCON_bits.VR3
472 #define VRR                  VRCON_bits.VRR
473 #define VROE                 VRCON_bits.VROE
474 #define VREN                 VRCON_bits.VREN
475 #endif /* NO_BIT_DEFINES */
476
477 #endif