5d068d0571f2af4ad7ae0654262c5d7a12a79328
[fw/sdcc] / 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 V1.6
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 __data __at (INDF_ADDR) volatile char      INDF;
107 extern __sfr  __at (TMR0_ADDR)                    TMR0;
108 extern __data __at (PCL_ADDR) volatile char       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 #define CM0                  CMCON_bits.CM0
197 #define CM1                  CMCON_bits.CM1
198 #define CM2                  CMCON_bits.CM2
199 #define CIS                  CMCON_bits.CIS
200 #define C1OUT                CMCON_bits.C1OUT
201 #define C2OUT                CMCON_bits.C2OUT
202
203 // ----- INTCON bits --------------------
204 typedef union {
205   struct {
206     unsigned char RBIF:1;
207     unsigned char INTF:1;
208     unsigned char T0IF:1;
209     unsigned char RBIE:1;
210     unsigned char INTE:1;
211     unsigned char T0IE:1;
212     unsigned char PEIE:1;
213     unsigned char GIE:1;
214   };
215 } __INTCON_bits_t;
216 extern volatile __INTCON_bits_t __at(INTCON_ADDR) INTCON_bits;
217
218 #define RBIF                 INTCON_bits.RBIF
219 #define INTF                 INTCON_bits.INTF
220 #define T0IF                 INTCON_bits.T0IF
221 #define RBIE                 INTCON_bits.RBIE
222 #define INTE                 INTCON_bits.INTE
223 #define T0IE                 INTCON_bits.T0IE
224 #define PEIE                 INTCON_bits.PEIE
225 #define GIE                  INTCON_bits.GIE
226
227 // ----- OPTION_REG bits --------------------
228 typedef union {
229   struct {
230     unsigned char PS0:1;
231     unsigned char PS1:1;
232     unsigned char PS2:1;
233     unsigned char PSA:1;
234     unsigned char T0SE:1;
235     unsigned char T0CS:1;
236     unsigned char INTEDG:1;
237     unsigned char NOT_RBPU:1;
238   };
239 } __OPTION_REG_bits_t;
240 extern volatile __OPTION_REG_bits_t __at(OPTION_REG_ADDR) OPTION_REG_bits;
241
242 #define PS0                  OPTION_REG_bits.PS0
243 #define PS1                  OPTION_REG_bits.PS1
244 #define PS2                  OPTION_REG_bits.PS2
245 #define PSA                  OPTION_REG_bits.PSA
246 #define T0SE                 OPTION_REG_bits.T0SE
247 #define T0CS                 OPTION_REG_bits.T0CS
248 #define INTEDG               OPTION_REG_bits.INTEDG
249 #define NOT_RBPU             OPTION_REG_bits.NOT_RBPU
250
251 // ----- PCON bits --------------------
252 typedef union {
253   struct {
254     unsigned char NOT_BO:1;
255     unsigned char NOT_POR:1;
256     unsigned char :1;
257     unsigned char :1;
258     unsigned char :1;
259     unsigned char :1;
260     unsigned char :1;
261     unsigned char :1;
262   };
263   struct {
264     unsigned char NOT_BOR:1;
265     unsigned char :1;
266     unsigned char :1;
267     unsigned char :1;
268     unsigned char :1;
269     unsigned char :1;
270     unsigned char :1;
271     unsigned char :1;
272   };
273 } __PCON_bits_t;
274 extern volatile __PCON_bits_t __at(PCON_ADDR) PCON_bits;
275
276 #define NOT_BO               PCON_bits.NOT_BO
277 #define NOT_BOR              PCON_bits.NOT_BOR
278 #define NOT_POR              PCON_bits.NOT_POR
279
280 // ----- PIE1 bits --------------------
281 typedef union {
282   struct {
283     unsigned char :1;
284     unsigned char :1;
285     unsigned char :1;
286     unsigned char :1;
287     unsigned char :1;
288     unsigned char :1;
289     unsigned char CMIE:1;
290     unsigned char :1;
291   };
292 } __PIE1_bits_t;
293 extern volatile __PIE1_bits_t __at(PIE1_ADDR) PIE1_bits;
294
295 #define CMIE                 PIE1_bits.CMIE
296
297 // ----- PIR1 bits --------------------
298 typedef union {
299   struct {
300     unsigned char :1;
301     unsigned char :1;
302     unsigned char :1;
303     unsigned char :1;
304     unsigned char :1;
305     unsigned char :1;
306     unsigned char CMIF:1;
307     unsigned char :1;
308   };
309 } __PIR1_bits_t;
310 extern volatile __PIR1_bits_t __at(PIR1_ADDR) PIR1_bits;
311
312 #define CMIF                 PIR1_bits.CMIF
313
314 // ----- STATUS bits --------------------
315 typedef union {
316   struct {
317     unsigned char C:1;
318     unsigned char DC:1;
319     unsigned char Z:1;
320     unsigned char NOT_PD:1;
321     unsigned char NOT_TO:1;
322     unsigned char RP0:1;
323     unsigned char RP1:1;
324     unsigned char IRP:1;
325   };
326 } __STATUS_bits_t;
327 extern volatile __STATUS_bits_t __at(STATUS_ADDR) STATUS_bits;
328
329 #define C                    STATUS_bits.C
330 #define DC                   STATUS_bits.DC
331 #define Z                    STATUS_bits.Z
332 #define NOT_PD               STATUS_bits.NOT_PD
333 #define NOT_TO               STATUS_bits.NOT_TO
334 #define RP0                  STATUS_bits.RP0
335 #define RP1                  STATUS_bits.RP1
336 #define IRP                  STATUS_bits.IRP
337
338 // ----- VRCON bits --------------------
339 typedef union {
340   struct {
341     unsigned char VR0:1;
342     unsigned char VR1:1;
343     unsigned char VR2:1;
344     unsigned char VR3:1;
345     unsigned char :1;
346     unsigned char VRR:1;
347     unsigned char VROE:1;
348     unsigned char VREN:1;
349   };
350 } __VRCON_bits_t;
351 extern volatile __VRCON_bits_t __at(VRCON_ADDR) VRCON_bits;
352
353 #define VR0                  VRCON_bits.VR0
354 #define VR1                  VRCON_bits.VR1
355 #define VR2                  VRCON_bits.VR2
356 #define VR3                  VRCON_bits.VR3
357 #define VRR                  VRCON_bits.VRR
358 #define VROE                 VRCON_bits.VROE
359 #define VREN                 VRCON_bits.VREN
360
361 #endif