Imported Upstream version 2.9.0
[debian/cc1111] / device / include / pic / pic16f88.h
1 //
2 // Register Declarations for Microchip 16F88 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 P16F88_H
23 #define P16F88_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 PIR2_ADDR       0x000D
39 #define TMR1L_ADDR      0x000E
40 #define TMR1H_ADDR      0x000F
41 #define T1CON_ADDR      0x0010
42 #define TMR2_ADDR       0x0011
43 #define T2CON_ADDR      0x0012
44 #define SSPBUF_ADDR     0x0013
45 #define SSPCON_ADDR     0x0014
46 #define CCPR1L_ADDR     0x0015
47 #define CCPR1H_ADDR     0x0016
48 #define CCP1CON_ADDR    0x0017
49 #define RCSTA_ADDR      0x0018
50 #define TXREG_ADDR      0x0019
51 #define RCREG_ADDR      0x001A
52 #define ADRESH_ADDR     0x001E
53 #define ADCON0_ADDR     0x001F
54 #define OPTION_REG_ADDR 0x0081
55 #define TRISA_ADDR      0x0085
56 #define TRISB_ADDR      0x0086
57 #define PIE1_ADDR       0x008C
58 #define PIE2_ADDR       0x008D
59 #define PCON_ADDR       0x008E
60 #define OSCCON_ADDR     0x008F
61 #define OSCTUNE_ADDR    0x0090
62 #define PR2_ADDR        0x0092
63 #define SSPADD_ADDR     0x0093
64 #define SSPSTAT_ADDR    0x0094
65 #define TXSTA_ADDR      0x0098
66 #define SPBRG_ADDR      0x0099
67 #define ANSEL_ADDR      0x009B
68 #define CMCON_ADDR      0x009C
69 #define CVRCON_ADDR     0x009D
70 #define ADRESL_ADDR     0x009E
71 #define ADCON1_ADDR     0x009F
72 #define WDTCON_ADDR     0x0105
73 #define EEDATA_ADDR     0x010C
74 #define EEADR_ADDR      0x010D
75 #define EEDATH_ADDR     0x010E
76 #define EEADRH_ADDR     0x010F
77 #define EECON1_ADDR     0x018C
78 #define EECON2_ADDR     0x018D
79
80 //
81 // Memory organization.
82 //
83
84
85
86 //         LIST
87 // P16F88.INC  Standard Header File, Version 1.00    Microchip Technology, Inc.
88 //         NOLIST
89
90 // This header file defines configurations, registers, and other useful bits of
91 // information for the PIC16F88 microcontroller.  These names are taken to match 
92 // the data sheets as closely as possible.  
93
94 // Note that the processor must be selected before this file is 
95 // included.  The processor may be selected the following ways:
96
97 //       1. Command line switch:
98 //               C:\ MPASM MYFILE.ASM /PIC16F88
99 //       2. LIST directive in the source file
100 //               LIST   P=PIC16F88
101 //       3. Processor Type entry in the MPASM full-screen interface
102
103 //==========================================================================
104 //
105 //       Revision History
106 //
107 //==========================================================================
108
109 //Rev:   Date:    Reason:
110
111 //1.00   07/29/02 Initial Release
112 //1.01  09/18/02 Changed name of bit-2 in the OSCCON register to IOFS
113 //1.02  01/10/03 Added bit names for TXSTA & RCSTA registers.
114 //1.03  01/24/03 Changed Config bit CCP1_RB2 to CCP1_RB0
115 //1.04  12/02/03 Modified the WRT1:WRT0 bit definition in Config Word 1.
116 //1.05  02/08/04 Changed bit in _CONFIG1 example from CCP1_RB2 to CCP1_RB0.
117
118 //==========================================================================
119 //
120 //       Verify Processor
121 //
122 //==========================================================================
123
124 //        IFNDEF __16F88
125 //            MESSG "Processor-header file mismatch.  Verify selected processor."
126 //         ENDIF
127
128 //==========================================================================
129 //
130 //       Register Definitions
131 //
132 //==========================================================================
133
134 #define W                    0x0000
135 #define F                    0x0001
136
137 //----- Register Files------------------------------------------------------
138
139 extern __sfr  __at (INDF_ADDR)                    INDF;
140 extern __sfr  __at (TMR0_ADDR)                    TMR0;
141 extern __sfr  __at (PCL_ADDR)                     PCL;
142 extern __sfr  __at (STATUS_ADDR)                  STATUS;
143 extern __sfr  __at (FSR_ADDR)                     FSR;
144 extern __sfr  __at (PORTA_ADDR)                   PORTA;
145 extern __sfr  __at (PORTB_ADDR)                   PORTB;
146 extern __sfr  __at (PCLATH_ADDR)                  PCLATH;
147 extern __sfr  __at (INTCON_ADDR)                  INTCON;
148 extern __sfr  __at (PIR1_ADDR)                    PIR1;
149 extern __sfr  __at (PIR2_ADDR)                    PIR2;
150 extern __sfr  __at (TMR1L_ADDR)                   TMR1L;
151 extern __sfr  __at (TMR1H_ADDR)                   TMR1H;
152 extern __sfr  __at (T1CON_ADDR)                   T1CON;
153 extern __sfr  __at (TMR2_ADDR)                    TMR2;
154 extern __sfr  __at (T2CON_ADDR)                   T2CON;
155 extern __sfr  __at (SSPBUF_ADDR)                  SSPBUF;
156 extern __sfr  __at (SSPCON_ADDR)                  SSPCON;
157 extern __sfr  __at (CCPR1L_ADDR)                  CCPR1L;
158 extern __sfr  __at (CCPR1H_ADDR)                  CCPR1H;
159 extern __sfr  __at (CCP1CON_ADDR)                 CCP1CON;
160 extern __sfr  __at (RCSTA_ADDR)                   RCSTA;
161 extern __sfr  __at (TXREG_ADDR)                   TXREG;
162 extern __sfr  __at (RCREG_ADDR)                   RCREG;
163 extern __sfr  __at (ADRESH_ADDR)                  ADRESH;
164 extern __sfr  __at (ADCON0_ADDR)                  ADCON0;
165
166 extern __sfr  __at (OPTION_REG_ADDR)              OPTION_REG;
167 extern __sfr  __at (TRISA_ADDR)                   TRISA;
168 extern __sfr  __at (TRISB_ADDR)                   TRISB;
169 extern __sfr  __at (PIE1_ADDR)                    PIE1;
170 extern __sfr  __at (PIE2_ADDR)                    PIE2;
171 extern __sfr  __at (PCON_ADDR)                    PCON;
172 extern __sfr  __at (OSCCON_ADDR)                  OSCCON;
173 extern __sfr  __at (OSCTUNE_ADDR)                 OSCTUNE;
174 extern __sfr  __at (PR2_ADDR)                     PR2;
175 extern __sfr  __at (SSPADD_ADDR)                  SSPADD;
176 extern __sfr  __at (SSPSTAT_ADDR)                 SSPSTAT;
177 extern __sfr  __at (TXSTA_ADDR)                   TXSTA;
178 extern __sfr  __at (SPBRG_ADDR)                   SPBRG;
179 extern __sfr  __at (ANSEL_ADDR)                   ANSEL;
180 extern __sfr  __at (CMCON_ADDR)                   CMCON;
181 extern __sfr  __at (CVRCON_ADDR)                  CVRCON;
182 extern __sfr  __at (ADRESL_ADDR)                  ADRESL;
183 extern __sfr  __at (ADCON1_ADDR)                  ADCON1;
184
185 extern __sfr  __at (WDTCON_ADDR)                  WDTCON;
186 extern __sfr  __at (EEDATA_ADDR)                  EEDATA;
187 extern __sfr  __at (EEADR_ADDR)                   EEADR;
188 extern __sfr  __at (EEDATH_ADDR)                  EEDATH;
189 extern __sfr  __at (EEADRH_ADDR)                  EEADRH;
190
191 extern __sfr  __at (EECON1_ADDR)                  EECON1;
192 extern __sfr  __at (EECON2_ADDR)                  EECON2;
193
194 //----- STATUS Bits --------------------------------------------------------
195
196 //----- INTCON Bits --------------------------------------------------------
197
198 //----- PIR1 Bits ----------------------------------------------------------
199
200 //----- PIR2 Bits ----------------------------------------------------------
201
202 //----- T1CON Bits ---------------------------------------------------------
203
204 //----- T2CON Bits ---------------------------------------------------------
205
206 //----- SSPCON Bits --------------------------------------------------------
207
208 //----- CCP1CON Bits -------------------------------------------------------
209
210 //----- RCSTA Bits ---------------------------------------------------------
211
212 //----- ADCON0 Bits --------------------------------------------------------
213
214 //----- OPTION_REG Bits -----------------------------------------------------
215
216 //----- PIE1 Bits ----------------------------------------------------------
217
218 //----- PIE2 Bits ----------------------------------------------------------
219
220 //----- PCON Bits ----------------------------------------------------------
221
222 //----- OSCCON Bits -------------------------------------------------------
223
224 //----- OSCTUNE Bits -------------------------------------------------------
225
226 //----- SSPSTAT Bits -------------------------------------------------------
227
228 //----- TXSTA Bits ---------------------------------------------------------
229
230 //----- ADCON1 Bits --------------------------------------------------------
231
232 //----- WDTCON Bits --------------------------------------------------------
233
234 //----- CMCON Bits ---------------------------------------------------------
235
236 //----- CVRCON Bits --------------------------------------------------------
237
238 //----- EECON1 Bits --------------------------------------------------------
239
240 //==========================================================================
241 //
242 //       RAM Definition
243 //
244 //==========================================================================
245
246 //         __MAXRAM H'1FF'
247 //         __BADRAM H'07'-H'09', H'1B'-H'1D'
248 //              __BADRAM H'87'-H'89', H'91', H'95'-H'97', H'9A'
249 //         __BADRAM H'107'-H'109'
250 //         __BADRAM H'185', H'187'-H'189', H'18E'-H'18F'
251
252 //==========================================================================
253 //
254 //       Configuration Bits
255 //
256 //==========================================================================
257
258 #define _CONFIG1             0x2007
259 #define _CONFIG2             0x2008
260
261 //Configuration Byte 1 Options
262 #define _CP_ALL              0x1FFF
263 #define _CP_OFF              0x3FFF
264 #define _CCP1_RB0            0x3FFF
265 #define _CCP1_RB3            0x2FFF
266 #define _DEBUG_OFF           0x3FFF
267 #define _DEBUG_ON            0x37FF
268 #define _WRT_PROTECT_OFF     0x3FFF     //No program memory write protection
269 #define _WRT_PROTECT_256     0x3DFF     //First 256 program memory protected
270 #define _WRT_PROTECT_2048    0x3BFF     //First 2048 program memory protected
271 #define _WRT_PROTECT_ALL     0x39FF     //All of program memory protected
272 #define _CPD_ON              0x3EFF
273 #define _CPD_OFF             0x3FFF
274 #define _LVP_ON              0x3FFF
275 #define _LVP_OFF             0x3F7F
276 #define _BODEN_ON            0x3FFF
277 #define _BODEN_OFF           0x3FBF
278 #define _MCLR_ON             0x3FFF
279 #define _MCLR_OFF            0x3FDF
280 #define _PWRTE_OFF           0x3FFF
281 #define _PWRTE_ON            0x3FF7
282 #define _WDT_ON              0x3FFF
283 #define _WDT_OFF             0x3FFB
284 #define _EXTRC_CLKOUT        0x3FFF
285 #define _EXTRC_IO            0x3FFE
286 #define _INTRC_CLKOUT        0x3FFD
287 #define _INTRC_IO            0x3FFC
288 #define _EXTCLK              0x3FEF
289 #define _HS_OSC              0x3FEE
290 #define _XT_OSC              0x3FED
291 #define _LP_OSC              0x3FEC
292
293 //Configuration Byte 2 Options
294 #define _IESO_ON             0x3FFF
295 #define _IESO_OFF            0x3FFD
296 #define _FCMEN_ON            0x3FFF
297 #define _FCMEN_OFF           0x3FFE
298
299
300
301 // To use the Configuration Bits, place the following lines in your source code
302 //  in the following format, and change the configuration value to the desired 
303 //  setting (such as CP_OFF to CP_ALL).  These are currently commented out here
304 //  and each __CONFIG line should have the preceding semicolon removed when
305 //  pasted into your source code.
306
307 //Program Configuration Register 1
308 //              __CONFIG    _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC
309
310 //Program Configuration Register 2
311 //              __CONFIG    _CONFIG2, _IESO_OFF & _FCMEN_OFF
312
313
314
315 //         LIST
316
317 // ----- ADCON0 bits --------------------
318 typedef union {
319   struct {
320     unsigned char ADON:1;
321     unsigned char :1;
322     unsigned char GO:1;
323     unsigned char CHS0:1;
324     unsigned char CHS1:1;
325     unsigned char CHS2:1;
326     unsigned char ADCS0:1;
327     unsigned char ADCS1:1;
328   };
329   struct {
330     unsigned char :1;
331     unsigned char :1;
332     unsigned char NOT_DONE:1;
333     unsigned char :1;
334     unsigned char :1;
335     unsigned char :1;
336     unsigned char :1;
337     unsigned char :1;
338   };
339   struct {
340     unsigned char :1;
341     unsigned char :1;
342     unsigned char GO_DONE:1;
343     unsigned char :1;
344     unsigned char :1;
345     unsigned char :1;
346     unsigned char :1;
347     unsigned char :1;
348   };
349 } __ADCON0_bits_t;
350 extern volatile __ADCON0_bits_t __at(ADCON0_ADDR) ADCON0_bits;
351
352 #ifndef NO_BIT_DEFINES
353 #define ADON                 ADCON0_bits.ADON
354 #define GO                   ADCON0_bits.GO
355 #define NOT_DONE             ADCON0_bits.NOT_DONE
356 #define GO_DONE              ADCON0_bits.GO_DONE
357 #define CHS0                 ADCON0_bits.CHS0
358 #define CHS1                 ADCON0_bits.CHS1
359 #define CHS2                 ADCON0_bits.CHS2
360 #define ADCS0                ADCON0_bits.ADCS0
361 #define ADCS1                ADCON0_bits.ADCS1
362 #endif /* NO_BIT_DEFINES */
363
364 // ----- ADCON1 bits --------------------
365 typedef union {
366   struct {
367     unsigned char :1;
368     unsigned char :1;
369     unsigned char :1;
370     unsigned char :1;
371     unsigned char VCFG0:1;
372     unsigned char VCFG1:1;
373     unsigned char ADCS2:1;
374     unsigned char ADFM:1;
375   };
376 } __ADCON1_bits_t;
377 extern volatile __ADCON1_bits_t __at(ADCON1_ADDR) ADCON1_bits;
378
379 #ifndef NO_BIT_DEFINES
380 #define VCFG0                ADCON1_bits.VCFG0
381 #define VCFG1                ADCON1_bits.VCFG1
382 #define ADCS2                ADCON1_bits.ADCS2
383 #define ADFM                 ADCON1_bits.ADFM
384 #endif /* NO_BIT_DEFINES */
385
386 // ----- CCP1CON bits --------------------
387 typedef union {
388   struct {
389     unsigned char CCP1M0:1;
390     unsigned char CCP1M1:1;
391     unsigned char CCP1M2:1;
392     unsigned char CCP1M3:1;
393     unsigned char CCP1Y:1;
394     unsigned char CCP1X:1;
395     unsigned char :1;
396     unsigned char :1;
397   };
398 } __CCP1CON_bits_t;
399 extern volatile __CCP1CON_bits_t __at(CCP1CON_ADDR) CCP1CON_bits;
400
401 #ifndef NO_BIT_DEFINES
402 #define CCP1M0               CCP1CON_bits.CCP1M0
403 #define CCP1M1               CCP1CON_bits.CCP1M1
404 #define CCP1M2               CCP1CON_bits.CCP1M2
405 #define CCP1M3               CCP1CON_bits.CCP1M3
406 #define CCP1Y                CCP1CON_bits.CCP1Y
407 #define CCP1X                CCP1CON_bits.CCP1X
408 #endif /* NO_BIT_DEFINES */
409
410 // ----- CMCON bits --------------------
411 typedef union {
412   struct {
413     unsigned char CM0:1;
414     unsigned char CM1:1;
415     unsigned char CM2:1;
416     unsigned char CIS:1;
417     unsigned char C1INV:1;
418     unsigned char C2INV:1;
419     unsigned char C1OUT:1;
420     unsigned char C2OUT:1;
421   };
422 } __CMCON_bits_t;
423 extern volatile __CMCON_bits_t __at(CMCON_ADDR) CMCON_bits;
424
425 #ifndef NO_BIT_DEFINES
426 #define CM0                  CMCON_bits.CM0
427 #define CM1                  CMCON_bits.CM1
428 #define CM2                  CMCON_bits.CM2
429 #define CIS                  CMCON_bits.CIS
430 #define C1INV                CMCON_bits.C1INV
431 #define C2INV                CMCON_bits.C2INV
432 #define C1OUT                CMCON_bits.C1OUT
433 #define C2OUT                CMCON_bits.C2OUT
434 #endif /* NO_BIT_DEFINES */
435
436 // ----- CVRCON bits --------------------
437 typedef union {
438   struct {
439     unsigned char CVR0:1;
440     unsigned char CVR1:1;
441     unsigned char CVR2:1;
442     unsigned char CVR3:1;
443     unsigned char :1;
444     unsigned char CVRR:1;
445     unsigned char CVROE:1;
446     unsigned char CVREN:1;
447   };
448 } __CVRCON_bits_t;
449 extern volatile __CVRCON_bits_t __at(CVRCON_ADDR) CVRCON_bits;
450
451 #ifndef NO_BIT_DEFINES
452 #define CVR0                 CVRCON_bits.CVR0
453 #define CVR1                 CVRCON_bits.CVR1
454 #define CVR2                 CVRCON_bits.CVR2
455 #define CVR3                 CVRCON_bits.CVR3
456 #define CVRR                 CVRCON_bits.CVRR
457 #define CVROE                CVRCON_bits.CVROE
458 #define CVREN                CVRCON_bits.CVREN
459 #endif /* NO_BIT_DEFINES */
460
461 // ----- EECON1 bits --------------------
462 typedef union {
463   struct {
464     unsigned char RD:1;
465     unsigned char WR:1;
466     unsigned char WREN:1;
467     unsigned char WRERR:1;
468     unsigned char FREE:1;
469     unsigned char :1;
470     unsigned char :1;
471     unsigned char EEPGD:1;
472   };
473 } __EECON1_bits_t;
474 extern volatile __EECON1_bits_t __at(EECON1_ADDR) EECON1_bits;
475
476 #ifndef NO_BIT_DEFINES
477 #define RD                   EECON1_bits.RD
478 #define WR                   EECON1_bits.WR
479 #define WREN                 EECON1_bits.WREN
480 #define WRERR                EECON1_bits.WRERR
481 #define FREE                 EECON1_bits.FREE
482 #define EEPGD                EECON1_bits.EEPGD
483 #endif /* NO_BIT_DEFINES */
484
485 // ----- INTCON bits --------------------
486 typedef union {
487   struct {
488     unsigned char RBIF:1;
489     unsigned char INTF:1;
490     unsigned char TMR0IF:1;
491     unsigned char RBIE:1;
492     unsigned char INTE:1;
493     unsigned char TMR0IE:1;
494     unsigned char PEIE:1;
495     unsigned char GIE:1;
496   };
497 } __INTCON_bits_t;
498 extern volatile __INTCON_bits_t __at(INTCON_ADDR) INTCON_bits;
499
500 #ifndef NO_BIT_DEFINES
501 #define RBIF                 INTCON_bits.RBIF
502 #define INTF                 INTCON_bits.INTF
503 #define TMR0IF               INTCON_bits.TMR0IF
504 #define RBIE                 INTCON_bits.RBIE
505 #define INTE                 INTCON_bits.INTE
506 #define TMR0IE               INTCON_bits.TMR0IE
507 #define PEIE                 INTCON_bits.PEIE
508 #define GIE                  INTCON_bits.GIE
509 #endif /* NO_BIT_DEFINES */
510
511 // ----- OPTION_REG bits --------------------
512 typedef union {
513   struct {
514     unsigned char PS0:1;
515     unsigned char PS1:1;
516     unsigned char PS2:1;
517     unsigned char PSA:1;
518     unsigned char T0SE:1;
519     unsigned char T0CS:1;
520     unsigned char INTEDG:1;
521     unsigned char NOT_RBPU:1;
522   };
523 } __OPTION_REG_bits_t;
524 extern volatile __OPTION_REG_bits_t __at(OPTION_REG_ADDR) OPTION_REG_bits;
525
526 #ifndef NO_BIT_DEFINES
527 #define PS0                  OPTION_REG_bits.PS0
528 #define PS1                  OPTION_REG_bits.PS1
529 #define PS2                  OPTION_REG_bits.PS2
530 #define PSA                  OPTION_REG_bits.PSA
531 #define T0SE                 OPTION_REG_bits.T0SE
532 #define T0CS                 OPTION_REG_bits.T0CS
533 #define INTEDG               OPTION_REG_bits.INTEDG
534 #define NOT_RBPU             OPTION_REG_bits.NOT_RBPU
535 #endif /* NO_BIT_DEFINES */
536
537 // ----- OSCCON bits --------------------
538 typedef union {
539   struct {
540     unsigned char SCS0:1;
541     unsigned char SCS1:1;
542     unsigned char IOFS:1;
543     unsigned char OSTS:1;
544     unsigned char IRCF0:1;
545     unsigned char IRCF1:1;
546     unsigned char IRCF2:1;
547     unsigned char :1;
548   };
549 } __OSCCON_bits_t;
550 extern volatile __OSCCON_bits_t __at(OSCCON_ADDR) OSCCON_bits;
551
552 #ifndef NO_BIT_DEFINES
553 #define SCS0                 OSCCON_bits.SCS0
554 #define SCS1                 OSCCON_bits.SCS1
555 #define IOFS                 OSCCON_bits.IOFS
556 #define OSTS                 OSCCON_bits.OSTS
557 #define IRCF0                OSCCON_bits.IRCF0
558 #define IRCF1                OSCCON_bits.IRCF1
559 #define IRCF2                OSCCON_bits.IRCF2
560 #endif /* NO_BIT_DEFINES */
561
562 // ----- OSCTUNE bits --------------------
563 typedef union {
564   struct {
565     unsigned char TUN0:1;
566     unsigned char TUN1:1;
567     unsigned char TUN2:1;
568     unsigned char TUN3:1;
569     unsigned char TUN4:1;
570     unsigned char TUN5:1;
571     unsigned char :1;
572     unsigned char :1;
573   };
574 } __OSCTUNE_bits_t;
575 extern volatile __OSCTUNE_bits_t __at(OSCTUNE_ADDR) OSCTUNE_bits;
576
577 #ifndef NO_BIT_DEFINES
578 #define TUN0                 OSCTUNE_bits.TUN0
579 #define TUN1                 OSCTUNE_bits.TUN1
580 #define TUN2                 OSCTUNE_bits.TUN2
581 #define TUN3                 OSCTUNE_bits.TUN3
582 #define TUN4                 OSCTUNE_bits.TUN4
583 #define TUN5                 OSCTUNE_bits.TUN5
584 #endif /* NO_BIT_DEFINES */
585
586 // ----- PCON bits --------------------
587 typedef union {
588   struct {
589     unsigned char NOT_BO:1;
590     unsigned char NOT_POR:1;
591     unsigned char :1;
592     unsigned char :1;
593     unsigned char :1;
594     unsigned char :1;
595     unsigned char :1;
596     unsigned char :1;
597   };
598   struct {
599     unsigned char NOT_BOR:1;
600     unsigned char :1;
601     unsigned char :1;
602     unsigned char :1;
603     unsigned char :1;
604     unsigned char :1;
605     unsigned char :1;
606     unsigned char :1;
607   };
608 } __PCON_bits_t;
609 extern volatile __PCON_bits_t __at(PCON_ADDR) PCON_bits;
610
611 #ifndef NO_BIT_DEFINES
612 #define NOT_BO               PCON_bits.NOT_BO
613 #define NOT_BOR              PCON_bits.NOT_BOR
614 #define NOT_POR              PCON_bits.NOT_POR
615 #endif /* NO_BIT_DEFINES */
616
617 // ----- PIE1 bits --------------------
618 typedef union {
619   struct {
620     unsigned char TMR1IE:1;
621     unsigned char TMR2IE:1;
622     unsigned char CCP1IE:1;
623     unsigned char SSPIE:1;
624     unsigned char TXIE:1;
625     unsigned char RCIE:1;
626     unsigned char ADIE:1;
627     unsigned char :1;
628   };
629 } __PIE1_bits_t;
630 extern volatile __PIE1_bits_t __at(PIE1_ADDR) PIE1_bits;
631
632 #ifndef NO_BIT_DEFINES
633 #define TMR1IE               PIE1_bits.TMR1IE
634 #define TMR2IE               PIE1_bits.TMR2IE
635 #define CCP1IE               PIE1_bits.CCP1IE
636 #define SSPIE                PIE1_bits.SSPIE
637 #define TXIE                 PIE1_bits.TXIE
638 #define RCIE                 PIE1_bits.RCIE
639 #define ADIE                 PIE1_bits.ADIE
640 #endif /* NO_BIT_DEFINES */
641
642 // ----- PIE2 bits --------------------
643 typedef union {
644   struct {
645     unsigned char :1;
646     unsigned char :1;
647     unsigned char :1;
648     unsigned char :1;
649     unsigned char EEIE:1;
650     unsigned char :1;
651     unsigned char CMIE:1;
652     unsigned char OSFIE:1;
653   };
654 } __PIE2_bits_t;
655 extern volatile __PIE2_bits_t __at(PIE2_ADDR) PIE2_bits;
656
657 #ifndef NO_BIT_DEFINES
658 #define EEIE                 PIE2_bits.EEIE
659 #define CMIE                 PIE2_bits.CMIE
660 #define OSFIE                PIE2_bits.OSFIE
661 #endif /* NO_BIT_DEFINES */
662
663 // ----- PIR1 bits --------------------
664 typedef union {
665   struct {
666     unsigned char TMR1IF:1;
667     unsigned char TMR2IF:1;
668     unsigned char CCP1IF:1;
669     unsigned char SSPIF:1;
670     unsigned char TXIF:1;
671     unsigned char RCIF:1;
672     unsigned char ADIF:1;
673     unsigned char :1;
674   };
675 } __PIR1_bits_t;
676 extern volatile __PIR1_bits_t __at(PIR1_ADDR) PIR1_bits;
677
678 #ifndef NO_BIT_DEFINES
679 #define TMR1IF               PIR1_bits.TMR1IF
680 #define TMR2IF               PIR1_bits.TMR2IF
681 #define CCP1IF               PIR1_bits.CCP1IF
682 #define SSPIF                PIR1_bits.SSPIF
683 #define TXIF                 PIR1_bits.TXIF
684 #define RCIF                 PIR1_bits.RCIF
685 #define ADIF                 PIR1_bits.ADIF
686 #endif /* NO_BIT_DEFINES */
687
688 // ----- PIR2 bits --------------------
689 typedef union {
690   struct {
691     unsigned char :1;
692     unsigned char :1;
693     unsigned char :1;
694     unsigned char :1;
695     unsigned char EEIF:1;
696     unsigned char :1;
697     unsigned char CMIF:1;
698     unsigned char OSFIF:1;
699   };
700 } __PIR2_bits_t;
701 extern volatile __PIR2_bits_t __at(PIR2_ADDR) PIR2_bits;
702
703 #ifndef NO_BIT_DEFINES
704 #define EEIF                 PIR2_bits.EEIF
705 #define CMIF                 PIR2_bits.CMIF
706 #define OSFIF                PIR2_bits.OSFIF
707 #endif /* NO_BIT_DEFINES */
708
709 // ----- PORTA bits --------------------
710 typedef union {
711   struct {
712     unsigned char RA0:1;
713     unsigned char RA1:1;
714     unsigned char RA2:1;
715     unsigned char RA3:1;
716     unsigned char RA4:1;
717     unsigned char RA5:1;
718     unsigned char RA6:1;
719     unsigned char RA7:1;
720   };
721 } __PORTA_bits_t;
722 extern volatile __PORTA_bits_t __at(PORTA_ADDR) PORTA_bits;
723
724 #ifndef NO_BIT_DEFINES
725 #define RA0                  PORTA_bits.RA0
726 #define RA1                  PORTA_bits.RA1
727 #define RA2                  PORTA_bits.RA2
728 #define RA3                  PORTA_bits.RA3
729 #define RA4                  PORTA_bits.RA4
730 #define RA5                  PORTA_bits.RA5
731 #define RA6                  PORTA_bits.RA6
732 #define RA7                  PORTA_bits.RA7
733 #endif /* NO_BIT_DEFINES */
734
735 // ----- PORTB bits --------------------
736 typedef union {
737   struct {
738     unsigned char RB0:1;
739     unsigned char RB1:1;
740     unsigned char RB2:1;
741     unsigned char RB3:1;
742     unsigned char RB4:1;
743     unsigned char RB5:1;
744     unsigned char RB6:1;
745     unsigned char RB7:1;
746   };
747 } __PORTB_bits_t;
748 extern volatile __PORTB_bits_t __at(PORTB_ADDR) PORTB_bits;
749
750 #ifndef NO_BIT_DEFINES
751 #define RB0                  PORTB_bits.RB0
752 #define RB1                  PORTB_bits.RB1
753 #define RB2                  PORTB_bits.RB2
754 #define RB3                  PORTB_bits.RB3
755 #define RB4                  PORTB_bits.RB4
756 #define RB5                  PORTB_bits.RB5
757 #define RB6                  PORTB_bits.RB6
758 #define RB7                  PORTB_bits.RB7
759 #endif /* NO_BIT_DEFINES */
760
761 // ----- RCSTA bits --------------------
762 typedef union {
763   struct {
764     unsigned char RX9D:1;
765     unsigned char OERR:1;
766     unsigned char FERR:1;
767     unsigned char ADDEN:1;
768     unsigned char CREN:1;
769     unsigned char SREN:1;
770     unsigned char RX9:1;
771     unsigned char SPEN:1;
772   };
773   struct {
774     unsigned char RCD8:1;
775     unsigned char :1;
776     unsigned char :1;
777     unsigned char :1;
778     unsigned char :1;
779     unsigned char :1;
780     unsigned char RC9:1;
781     unsigned char :1;
782   };
783   struct {
784     unsigned char :1;
785     unsigned char :1;
786     unsigned char :1;
787     unsigned char :1;
788     unsigned char :1;
789     unsigned char :1;
790     unsigned char NOT_RC8:1;
791     unsigned char :1;
792   };
793   struct {
794     unsigned char :1;
795     unsigned char :1;
796     unsigned char :1;
797     unsigned char :1;
798     unsigned char :1;
799     unsigned char :1;
800     unsigned char RC8_9:1;
801     unsigned char :1;
802   };
803 } __RCSTA_bits_t;
804 extern volatile __RCSTA_bits_t __at(RCSTA_ADDR) RCSTA_bits;
805
806 #ifndef NO_BIT_DEFINES
807 #define RX9D                 RCSTA_bits.RX9D
808 #define RCD8                 RCSTA_bits.RCD8
809 #define OERR                 RCSTA_bits.OERR
810 #define FERR                 RCSTA_bits.FERR
811 #define ADDEN                RCSTA_bits.ADDEN
812 #define CREN                 RCSTA_bits.CREN
813 #define SREN                 RCSTA_bits.SREN
814 #define RX9                  RCSTA_bits.RX9
815 #define RC9                  RCSTA_bits.RC9
816 #define NOT_RC8              RCSTA_bits.NOT_RC8
817 #define RC8_9                RCSTA_bits.RC8_9
818 #define SPEN                 RCSTA_bits.SPEN
819 #endif /* NO_BIT_DEFINES */
820
821 // ----- SSPCON bits --------------------
822 typedef union {
823   struct {
824     unsigned char SSPM0:1;
825     unsigned char SSPM1:1;
826     unsigned char SSPM2:1;
827     unsigned char SSPM3:1;
828     unsigned char CKP:1;
829     unsigned char SSPEN:1;
830     unsigned char SSPOV:1;
831     unsigned char WCOL:1;
832   };
833 } __SSPCON_bits_t;
834 extern volatile __SSPCON_bits_t __at(SSPCON_ADDR) SSPCON_bits;
835
836 #ifndef NO_BIT_DEFINES
837 #define SSPM0                SSPCON_bits.SSPM0
838 #define SSPM1                SSPCON_bits.SSPM1
839 #define SSPM2                SSPCON_bits.SSPM2
840 #define SSPM3                SSPCON_bits.SSPM3
841 #define CKP                  SSPCON_bits.CKP
842 #define SSPEN                SSPCON_bits.SSPEN
843 #define SSPOV                SSPCON_bits.SSPOV
844 #define WCOL                 SSPCON_bits.WCOL
845 #endif /* NO_BIT_DEFINES */
846
847 // ----- SSPSTAT bits --------------------
848 typedef union {
849   struct {
850     unsigned char BF:1;
851     unsigned char UA:1;
852     unsigned char R:1;
853     unsigned char S:1;
854     unsigned char P:1;
855     unsigned char D:1;
856     unsigned char CKE:1;
857     unsigned char SMP:1;
858   };
859   struct {
860     unsigned char :1;
861     unsigned char :1;
862     unsigned char I2C_READ:1;
863     unsigned char I2C_START:1;
864     unsigned char I2C_STOP:1;
865     unsigned char I2C_DATA:1;
866     unsigned char :1;
867     unsigned char :1;
868   };
869   struct {
870     unsigned char :1;
871     unsigned char :1;
872     unsigned char NOT_W:1;
873     unsigned char :1;
874     unsigned char :1;
875     unsigned char NOT_A:1;
876     unsigned char :1;
877     unsigned char :1;
878   };
879   struct {
880     unsigned char :1;
881     unsigned char :1;
882     unsigned char NOT_WRITE:1;
883     unsigned char :1;
884     unsigned char :1;
885     unsigned char NOT_ADDRESS:1;
886     unsigned char :1;
887     unsigned char :1;
888   };
889   struct {
890     unsigned char :1;
891     unsigned char :1;
892     unsigned char R_W:1;
893     unsigned char :1;
894     unsigned char :1;
895     unsigned char D_A:1;
896     unsigned char :1;
897     unsigned char :1;
898   };
899   struct {
900     unsigned char :1;
901     unsigned char :1;
902     unsigned char READ_WRITE:1;
903     unsigned char :1;
904     unsigned char :1;
905     unsigned char DATA_ADDRESS:1;
906     unsigned char :1;
907     unsigned char :1;
908   };
909 } __SSPSTAT_bits_t;
910 extern volatile __SSPSTAT_bits_t __at(SSPSTAT_ADDR) SSPSTAT_bits;
911
912 #ifndef NO_BIT_DEFINES
913 #define BF                   SSPSTAT_bits.BF
914 #define UA                   SSPSTAT_bits.UA
915 #define R                    SSPSTAT_bits.R
916 #define I2C_READ             SSPSTAT_bits.I2C_READ
917 #define NOT_W                SSPSTAT_bits.NOT_W
918 #define NOT_WRITE            SSPSTAT_bits.NOT_WRITE
919 #define R_W                  SSPSTAT_bits.R_W
920 #define READ_WRITE           SSPSTAT_bits.READ_WRITE
921 #define S                    SSPSTAT_bits.S
922 #define I2C_START            SSPSTAT_bits.I2C_START
923 #define P                    SSPSTAT_bits.P
924 #define I2C_STOP             SSPSTAT_bits.I2C_STOP
925 #define D                    SSPSTAT_bits.D
926 #define I2C_DATA             SSPSTAT_bits.I2C_DATA
927 #define NOT_A                SSPSTAT_bits.NOT_A
928 #define NOT_ADDRESS          SSPSTAT_bits.NOT_ADDRESS
929 #define D_A                  SSPSTAT_bits.D_A
930 #define DATA_ADDRESS         SSPSTAT_bits.DATA_ADDRESS
931 #define CKE                  SSPSTAT_bits.CKE
932 #define SMP                  SSPSTAT_bits.SMP
933 #endif /* NO_BIT_DEFINES */
934
935 // ----- STATUS bits --------------------
936 typedef union {
937   struct {
938     unsigned char C:1;
939     unsigned char DC:1;
940     unsigned char Z:1;
941     unsigned char NOT_PD:1;
942     unsigned char NOT_TO:1;
943     unsigned char RP0:1;
944     unsigned char RP1:1;
945     unsigned char IRP:1;
946   };
947 } __STATUS_bits_t;
948 extern volatile __STATUS_bits_t __at(STATUS_ADDR) STATUS_bits;
949
950 #ifndef NO_BIT_DEFINES
951 #define C                    STATUS_bits.C
952 #define DC                   STATUS_bits.DC
953 #define Z                    STATUS_bits.Z
954 #define NOT_PD               STATUS_bits.NOT_PD
955 #define NOT_TO               STATUS_bits.NOT_TO
956 #define RP0                  STATUS_bits.RP0
957 #define RP1                  STATUS_bits.RP1
958 #define IRP                  STATUS_bits.IRP
959 #endif /* NO_BIT_DEFINES */
960
961 // ----- T1CON bits --------------------
962 typedef union {
963   struct {
964     unsigned char TMR1ON:1;
965     unsigned char TMR1CS:1;
966     unsigned char NOT_T1SYNC:1;
967     unsigned char T1OSCEN:1;
968     unsigned char T1CKPS0:1;
969     unsigned char T1CKPS1:1;
970     unsigned char T1RUN:1;
971     unsigned char :1;
972   };
973   struct {
974     unsigned char :1;
975     unsigned char :1;
976     unsigned char T1INSYNC:1;
977     unsigned char :1;
978     unsigned char :1;
979     unsigned char :1;
980     unsigned char :1;
981     unsigned char :1;
982   };
983 } __T1CON_bits_t;
984 extern volatile __T1CON_bits_t __at(T1CON_ADDR) T1CON_bits;
985
986 #ifndef NO_BIT_DEFINES
987 #define TMR1ON               T1CON_bits.TMR1ON
988 #define TMR1CS               T1CON_bits.TMR1CS
989 #define NOT_T1SYNC           T1CON_bits.NOT_T1SYNC
990 #define T1INSYNC             T1CON_bits.T1INSYNC
991 #define T1OSCEN              T1CON_bits.T1OSCEN
992 #define T1CKPS0              T1CON_bits.T1CKPS0
993 #define T1CKPS1              T1CON_bits.T1CKPS1
994 #define T1RUN                T1CON_bits.T1RUN
995 #endif /* NO_BIT_DEFINES */
996
997 // ----- T2CON bits --------------------
998 typedef union {
999   struct {
1000     unsigned char T2CKPS0:1;
1001     unsigned char T2CKPS1:1;
1002     unsigned char TMR2ON:1;
1003     unsigned char TOUTPS0:1;
1004     unsigned char TOUTPS1:1;
1005     unsigned char TOUTPS2:1;
1006     unsigned char TOUTPS3:1;
1007     unsigned char :1;
1008   };
1009 } __T2CON_bits_t;
1010 extern volatile __T2CON_bits_t __at(T2CON_ADDR) T2CON_bits;
1011
1012 #ifndef NO_BIT_DEFINES
1013 #define T2CKPS0              T2CON_bits.T2CKPS0
1014 #define T2CKPS1              T2CON_bits.T2CKPS1
1015 #define TMR2ON               T2CON_bits.TMR2ON
1016 #define TOUTPS0              T2CON_bits.TOUTPS0
1017 #define TOUTPS1              T2CON_bits.TOUTPS1
1018 #define TOUTPS2              T2CON_bits.TOUTPS2
1019 #define TOUTPS3              T2CON_bits.TOUTPS3
1020 #endif /* NO_BIT_DEFINES */
1021
1022 // ----- TRISA bits --------------------
1023 typedef union {
1024   struct {
1025     unsigned char TRISA0:1;
1026     unsigned char TRISA1:1;
1027     unsigned char TRISA2:1;
1028     unsigned char TRISA3:1;
1029     unsigned char TRISA4:1;
1030     unsigned char TRISA5:1;
1031     unsigned char TRISA6:1;
1032     unsigned char TRISA7:1;
1033   };
1034 } __TRISA_bits_t;
1035 extern volatile __TRISA_bits_t __at(TRISA_ADDR) TRISA_bits;
1036
1037 #ifndef NO_BIT_DEFINES
1038 #define TRISA0               TRISA_bits.TRISA0
1039 #define TRISA1               TRISA_bits.TRISA1
1040 #define TRISA2               TRISA_bits.TRISA2
1041 #define TRISA3               TRISA_bits.TRISA3
1042 #define TRISA4               TRISA_bits.TRISA4
1043 #define TRISA5               TRISA_bits.TRISA5
1044 #define TRISA6               TRISA_bits.TRISA6
1045 #define TRISA7               TRISA_bits.TRISA7
1046 #endif /* NO_BIT_DEFINES */
1047
1048 // ----- TRISB bits --------------------
1049 typedef union {
1050   struct {
1051     unsigned char TRISB0:1;
1052     unsigned char TRISB1:1;
1053     unsigned char TRISB2:1;
1054     unsigned char TRISB3:1;
1055     unsigned char TRISB4:1;
1056     unsigned char TRISB5:1;
1057     unsigned char TRISB6:1;
1058     unsigned char TRISB7:1;
1059   };
1060 } __TRISB_bits_t;
1061 extern volatile __TRISB_bits_t __at(TRISB_ADDR) TRISB_bits;
1062
1063 #ifndef NO_BIT_DEFINES
1064 #define TRISB0               TRISB_bits.TRISB0
1065 #define TRISB1               TRISB_bits.TRISB1
1066 #define TRISB2               TRISB_bits.TRISB2
1067 #define TRISB3               TRISB_bits.TRISB3
1068 #define TRISB4               TRISB_bits.TRISB4
1069 #define TRISB5               TRISB_bits.TRISB5
1070 #define TRISB6               TRISB_bits.TRISB6
1071 #define TRISB7               TRISB_bits.TRISB7
1072 #endif /* NO_BIT_DEFINES */
1073
1074 // ----- TXSTA bits --------------------
1075 typedef union {
1076   struct {
1077     unsigned char TX9D:1;
1078     unsigned char TRMT:1;
1079     unsigned char BRGH:1;
1080     unsigned char :1;
1081     unsigned char SYNC:1;
1082     unsigned char TXEN:1;
1083     unsigned char TX9:1;
1084     unsigned char CSRC:1;
1085   };
1086   struct {
1087     unsigned char TXD8:1;
1088     unsigned char :1;
1089     unsigned char :1;
1090     unsigned char :1;
1091     unsigned char :1;
1092     unsigned char :1;
1093     unsigned char NOT_TX8:1;
1094     unsigned char :1;
1095   };
1096   struct {
1097     unsigned char :1;
1098     unsigned char :1;
1099     unsigned char :1;
1100     unsigned char :1;
1101     unsigned char :1;
1102     unsigned char :1;
1103     unsigned char TX8_9:1;
1104     unsigned char :1;
1105   };
1106 } __TXSTA_bits_t;
1107 extern volatile __TXSTA_bits_t __at(TXSTA_ADDR) TXSTA_bits;
1108
1109 #ifndef NO_BIT_DEFINES
1110 #define TX9D                 TXSTA_bits.TX9D
1111 #define TXD8                 TXSTA_bits.TXD8
1112 #define TRMT                 TXSTA_bits.TRMT
1113 #define BRGH                 TXSTA_bits.BRGH
1114 #define SYNC                 TXSTA_bits.SYNC
1115 #define TXEN                 TXSTA_bits.TXEN
1116 #define TX9                  TXSTA_bits.TX9
1117 #define NOT_TX8              TXSTA_bits.NOT_TX8
1118 #define TX8_9                TXSTA_bits.TX8_9
1119 #define CSRC                 TXSTA_bits.CSRC
1120 #endif /* NO_BIT_DEFINES */
1121
1122 // ----- WDTCON bits --------------------
1123 typedef union {
1124   struct {
1125     unsigned char SWDTEN:1;
1126     unsigned char WDTPS0:1;
1127     unsigned char WDTPS1:1;
1128     unsigned char WDTPS2:1;
1129     unsigned char WDTPS3:1;
1130     unsigned char :1;
1131     unsigned char :1;
1132     unsigned char :1;
1133   };
1134   struct {
1135     unsigned char SWDTE:1;
1136     unsigned char :1;
1137     unsigned char :1;
1138     unsigned char :1;
1139     unsigned char :1;
1140     unsigned char :1;
1141     unsigned char :1;
1142     unsigned char :1;
1143   };
1144 } __WDTCON_bits_t;
1145 extern volatile __WDTCON_bits_t __at(WDTCON_ADDR) WDTCON_bits;
1146
1147 #ifndef NO_BIT_DEFINES
1148 #define SWDTEN               WDTCON_bits.SWDTEN
1149 #define SWDTE                WDTCON_bits.SWDTE
1150 #define WDTPS0               WDTCON_bits.WDTPS0
1151 #define WDTPS1               WDTCON_bits.WDTPS1
1152 #define WDTPS2               WDTCON_bits.WDTPS2
1153 #define WDTPS3               WDTCON_bits.WDTPS3
1154 #endif /* NO_BIT_DEFINES */
1155
1156 #endif