Imported Upstream version 2.9.0
[debian/cc1111] / device / include / pic / pic16c557.h
1 //
2 // Register Declarations for Microchip 16C557 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 P16C557_H
23 #define P16C557_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 PORTC_ADDR      0x0007
36 #define PCLATH_ADDR     0x000A
37 #define INTCON_ADDR     0x000B
38 #define OPTION_REG_ADDR 0x0081
39 #define TRISA_ADDR      0x0085
40 #define TRISB_ADDR      0x0086
41 #define TRISC_ADDR      0x0087
42 #define PCON_ADDR       0x008E
43
44 //
45 // Memory organization.
46 //
47
48
49
50 //         LIST
51 // P16C557.INC  Standard Header File, Version 1.00    Microchip Technology, Inc.
52 //         NOLIST
53
54 // This header file defines configurations, registers, and other useful bits of
55 // information for the PIC16C557 microcontroller.  These names are taken to match 
56 // the data sheets as closely as possible.  
57
58 // Note that the processor must be selected before this file is 
59 // included.  The processor may be selected the following ways:
60
61 //       1. Command line switch:
62 //               C:\ MPASM MYFILE.ASM /p=16C557
63 //       2. LIST directive in the source file
64 //               LIST   P=16C557
65 //       3. Processor Type entry in the MPASM full-screen interface
66
67 //==========================================================================
68 //
69 //       Revision History
70 //
71 //==========================================================================
72
73 //Rev:   Date:    Reason:
74
75 //1.00   08/29/01 Initial Release
76
77 //==========================================================================
78 //
79 //       Verify Processor
80 //
81 //==========================================================================
82
83 //        IFNDEF __16C557
84 //            MESSG "Processor-header file mismatch.  Verify selected processor."
85 //         ENDIF
86
87 //==========================================================================
88 //
89 //       Register Definitions
90 //
91 //==========================================================================
92
93 #define W                    0x0000
94 #define F                    0x0001
95
96 //----- Register Files------------------------------------------------------
97
98 extern __sfr  __at (INDF_ADDR)                    INDF;
99 extern __sfr  __at (TMR0_ADDR)                    TMR0;
100 extern __sfr  __at (PCL_ADDR)                     PCL;
101 extern __sfr  __at (STATUS_ADDR)                  STATUS;
102 extern __sfr  __at (FSR_ADDR)                     FSR;
103 extern __sfr  __at (PORTA_ADDR)                   PORTA;
104 extern __sfr  __at (PORTB_ADDR)                   PORTB;
105 extern __sfr  __at (PORTC_ADDR)                   PORTC;
106 extern __sfr  __at (PCLATH_ADDR)                  PCLATH;
107 extern __sfr  __at (INTCON_ADDR)                  INTCON;
108
109 extern __sfr  __at (OPTION_REG_ADDR)              OPTION_REG;
110 extern __sfr  __at (TRISA_ADDR)                   TRISA;
111 extern __sfr  __at (TRISB_ADDR)                   TRISB;
112 extern __sfr  __at (TRISC_ADDR)                   TRISC;
113 extern __sfr  __at (PCON_ADDR)                    PCON;
114
115 //----- STATUS Bits --------------------------------------------------------
116
117
118 //----- INTCON Bits --------------------------------------------------------
119
120
121 //----- OPTION Bits --------------------------------------------------------
122
123
124 //----- PCON Bits ----------------------------------------------------------
125
126
127 //==========================================================================
128 //
129 //       RAM Definition
130 //
131 //==========================================================================
132
133 //         __MAXRAM H'FF'
134 //         __BADRAM H'08'-H'09', H'0C'-H'1F'
135 //         __BADRAM H'88'-H'89', H'8C'-H'8D', H'8F'-H'9F', H'C0'-H'EF'
136
137 //==========================================================================
138 //
139 //       Configuration Bits
140 //
141 //==========================================================================
142
143 #define _CP_ALL              0x00CF
144 #define _CP_75               0x15DF
145 #define _CP_50               0x2AEF
146 #define _CP_OFF              0x3FFF
147 #define _PWRTE_OFF           0x3FFF
148 #define _PWRTE_ON            0x3FF7
149 #define _WDT_ON              0x3FFF
150 #define _WDT_OFF             0x3FFB
151 #define _LP_OSC              0x3FFC
152 #define _XT_OSC              0x3FFD
153 #define _HS_OSC              0x3FFE
154 #define _RC_OSC              0x3FFF
155
156 //         LIST
157
158 // ----- INTCON bits --------------------
159 typedef union {
160   struct {
161     unsigned char RBIF:1;
162     unsigned char INTF:1;
163     unsigned char T0IF:1;
164     unsigned char RBIE:1;
165     unsigned char INTE:1;
166     unsigned char T0IE:1;
167     unsigned char :1;
168     unsigned char GIE:1;
169   };
170 } __INTCON_bits_t;
171 extern volatile __INTCON_bits_t __at(INTCON_ADDR) INTCON_bits;
172
173 #ifndef NO_BIT_DEFINES
174 #define RBIF                 INTCON_bits.RBIF
175 #define INTF                 INTCON_bits.INTF
176 #define T0IF                 INTCON_bits.T0IF
177 #define RBIE                 INTCON_bits.RBIE
178 #define INTE                 INTCON_bits.INTE
179 #define T0IE                 INTCON_bits.T0IE
180 #define GIE                  INTCON_bits.GIE
181 #endif /* NO_BIT_DEFINES */
182
183 // ----- OPTION_REG bits --------------------
184 typedef union {
185   struct {
186     unsigned char PS0:1;
187     unsigned char PS1:1;
188     unsigned char PS2:1;
189     unsigned char PSA:1;
190     unsigned char T0SE:1;
191     unsigned char T0CS:1;
192     unsigned char INTEDG:1;
193     unsigned char NOT_RBPU:1;
194   };
195 } __OPTION_REG_bits_t;
196 extern volatile __OPTION_REG_bits_t __at(OPTION_REG_ADDR) OPTION_REG_bits;
197
198 #ifndef NO_BIT_DEFINES
199 #define PS0                  OPTION_REG_bits.PS0
200 #define PS1                  OPTION_REG_bits.PS1
201 #define PS2                  OPTION_REG_bits.PS2
202 #define PSA                  OPTION_REG_bits.PSA
203 #define T0SE                 OPTION_REG_bits.T0SE
204 #define T0CS                 OPTION_REG_bits.T0CS
205 #define INTEDG               OPTION_REG_bits.INTEDG
206 #define NOT_RBPU             OPTION_REG_bits.NOT_RBPU
207 #endif /* NO_BIT_DEFINES */
208
209 // ----- PCON bits --------------------
210 typedef union {
211   struct {
212     unsigned char :1;
213     unsigned char NOT_POR:1;
214     unsigned char :1;
215     unsigned char :1;
216     unsigned char :1;
217     unsigned char :1;
218     unsigned char :1;
219     unsigned char :1;
220   };
221 } __PCON_bits_t;
222 extern volatile __PCON_bits_t __at(PCON_ADDR) PCON_bits;
223
224 #ifndef NO_BIT_DEFINES
225 #define NOT_POR              PCON_bits.NOT_POR
226 #endif /* NO_BIT_DEFINES */
227
228 // ----- PORTA bits --------------------
229 typedef union {
230   struct {
231     unsigned char RA0:1;
232     unsigned char RA1:1;
233     unsigned char RA2:1;
234     unsigned char RA3:1;
235     unsigned char RA4:1;
236     unsigned char RA5:1;
237     unsigned char :1;
238     unsigned char :1;
239   };
240 } __PORTA_bits_t;
241 extern volatile __PORTA_bits_t __at(PORTA_ADDR) PORTA_bits;
242
243 #ifndef NO_BIT_DEFINES
244 #define RA0                  PORTA_bits.RA0
245 #define RA1                  PORTA_bits.RA1
246 #define RA2                  PORTA_bits.RA2
247 #define RA3                  PORTA_bits.RA3
248 #define RA4                  PORTA_bits.RA4
249 #define RA5                  PORTA_bits.RA5
250 #endif /* NO_BIT_DEFINES */
251
252 // ----- PORTB bits --------------------
253 typedef union {
254   struct {
255     unsigned char RB0:1;
256     unsigned char RB1:1;
257     unsigned char RB2:1;
258     unsigned char RB3:1;
259     unsigned char RB4:1;
260     unsigned char RB5:1;
261     unsigned char RB6:1;
262     unsigned char RB7:1;
263   };
264 } __PORTB_bits_t;
265 extern volatile __PORTB_bits_t __at(PORTB_ADDR) PORTB_bits;
266
267 #ifndef NO_BIT_DEFINES
268 #define RB0                  PORTB_bits.RB0
269 #define RB1                  PORTB_bits.RB1
270 #define RB2                  PORTB_bits.RB2
271 #define RB3                  PORTB_bits.RB3
272 #define RB4                  PORTB_bits.RB4
273 #define RB5                  PORTB_bits.RB5
274 #define RB6                  PORTB_bits.RB6
275 #define RB7                  PORTB_bits.RB7
276 #endif /* NO_BIT_DEFINES */
277
278 // ----- PORTC bits --------------------
279 typedef union {
280   struct {
281     unsigned char RC0:1;
282     unsigned char RC1:1;
283     unsigned char RC2:1;
284     unsigned char RC3:1;
285     unsigned char RC4:1;
286     unsigned char RC5:1;
287     unsigned char RC6:1;
288     unsigned char RC7:1;
289   };
290 } __PORTC_bits_t;
291 extern volatile __PORTC_bits_t __at(PORTC_ADDR) PORTC_bits;
292
293 #ifndef NO_BIT_DEFINES
294 #define RC0                  PORTC_bits.RC0
295 #define RC1                  PORTC_bits.RC1
296 #define RC2                  PORTC_bits.RC2
297 #define RC3                  PORTC_bits.RC3
298 #define RC4                  PORTC_bits.RC4
299 #define RC5                  PORTC_bits.RC5
300 #define RC6                  PORTC_bits.RC6
301 #define RC7                  PORTC_bits.RC7
302 #endif /* NO_BIT_DEFINES */
303
304 // ----- STATUS bits --------------------
305 typedef union {
306   struct {
307     unsigned char C:1;
308     unsigned char DC:1;
309     unsigned char Z:1;
310     unsigned char NOT_PD:1;
311     unsigned char NOT_TO:1;
312     unsigned char RP0:1;
313     unsigned char RP1:1;
314     unsigned char IRP:1;
315   };
316 } __STATUS_bits_t;
317 extern volatile __STATUS_bits_t __at(STATUS_ADDR) STATUS_bits;
318
319 #ifndef NO_BIT_DEFINES
320 #define C                    STATUS_bits.C
321 #define DC                   STATUS_bits.DC
322 #define Z                    STATUS_bits.Z
323 #define NOT_PD               STATUS_bits.NOT_PD
324 #define NOT_TO               STATUS_bits.NOT_TO
325 #define RP0                  STATUS_bits.RP0
326 #define RP1                  STATUS_bits.RP1
327 #define IRP                  STATUS_bits.IRP
328 #endif /* NO_BIT_DEFINES */
329
330 // ----- TRISA bits --------------------
331 typedef union {
332   struct {
333     unsigned char TRISA0:1;
334     unsigned char TRISA1:1;
335     unsigned char TRISA2:1;
336     unsigned char TRISA3:1;
337     unsigned char TRISA4:1;
338     unsigned char TRISA5:1;
339     unsigned char :1;
340     unsigned char :1;
341   };
342 } __TRISA_bits_t;
343 extern volatile __TRISA_bits_t __at(TRISA_ADDR) TRISA_bits;
344
345 #ifndef NO_BIT_DEFINES
346 #define TRISA0               TRISA_bits.TRISA0
347 #define TRISA1               TRISA_bits.TRISA1
348 #define TRISA2               TRISA_bits.TRISA2
349 #define TRISA3               TRISA_bits.TRISA3
350 #define TRISA4               TRISA_bits.TRISA4
351 #define TRISA5               TRISA_bits.TRISA5
352 #endif /* NO_BIT_DEFINES */
353
354 // ----- TRISB bits --------------------
355 typedef union {
356   struct {
357     unsigned char TRISB0:1;
358     unsigned char TRISB1:1;
359     unsigned char TRISB2:1;
360     unsigned char TRISB3:1;
361     unsigned char TRISB4:1;
362     unsigned char TRISB5:1;
363     unsigned char TRISB6:1;
364     unsigned char TRISB7:1;
365   };
366 } __TRISB_bits_t;
367 extern volatile __TRISB_bits_t __at(TRISB_ADDR) TRISB_bits;
368
369 #ifndef NO_BIT_DEFINES
370 #define TRISB0               TRISB_bits.TRISB0
371 #define TRISB1               TRISB_bits.TRISB1
372 #define TRISB2               TRISB_bits.TRISB2
373 #define TRISB3               TRISB_bits.TRISB3
374 #define TRISB4               TRISB_bits.TRISB4
375 #define TRISB5               TRISB_bits.TRISB5
376 #define TRISB6               TRISB_bits.TRISB6
377 #define TRISB7               TRISB_bits.TRISB7
378 #endif /* NO_BIT_DEFINES */
379
380 // ----- TRISC bits --------------------
381 typedef union {
382   struct {
383     unsigned char TRISC0:1;
384     unsigned char TRISC1:1;
385     unsigned char TRISC2:1;
386     unsigned char TRISC3:1;
387     unsigned char TRISC4:1;
388     unsigned char TRISC5:1;
389     unsigned char TRISC6:1;
390     unsigned char TRISC7:1;
391   };
392 } __TRISC_bits_t;
393 extern volatile __TRISC_bits_t __at(TRISC_ADDR) TRISC_bits;
394
395 #ifndef NO_BIT_DEFINES
396 #define TRISC0               TRISC_bits.TRISC0
397 #define TRISC1               TRISC_bits.TRISC1
398 #define TRISC2               TRISC_bits.TRISC2
399 #define TRISC3               TRISC_bits.TRISC3
400 #define TRISC4               TRISC_bits.TRISC4
401 #define TRISC5               TRISC_bits.TRISC5
402 #define TRISC6               TRISC_bits.TRISC6
403 #define TRISC7               TRISC_bits.TRISC7
404 #endif /* NO_BIT_DEFINES */
405
406 #endif