Imported Upstream version 2.9.0
[debian/cc1111] / device / include / pic / pic16f818.h
1 //
2 // Register Declarations for Microchip 16F818 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 P16F818_H
23 #define P16F818_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 ADRESH_ADDR     0x001E
50 #define ADCON0_ADDR     0x001F
51 #define OPTION_REG_ADDR 0x0081
52 #define TRISA_ADDR      0x0085
53 #define TRISB_ADDR      0x0086
54 #define PIE1_ADDR       0x008C
55 #define PIE2_ADDR       0x008D
56 #define PCON_ADDR       0x008E
57 #define OSCCON_ADDR     0x008F
58 #define OSCTUNE_ADDR    0x0090
59 #define PR2_ADDR        0x0092
60 #define SSPADD_ADDR     0x0093
61 #define SSPSTAT_ADDR    0x0094
62 #define ADRESL_ADDR     0x009E
63 #define ADCON1_ADDR     0x009F
64 #define EEDATA_ADDR     0x010C
65 #define EEADR_ADDR      0x010D
66 #define EEDATH_ADDR     0x010E
67 #define EEADRH_ADDR     0x010F
68 #define EECON1_ADDR     0x018C
69 #define EECON2_ADDR     0x018D
70
71 //
72 // Memory organization.
73 //
74
75
76
77 //         LIST
78 // P16F818.INC  Standard Header File, Version 1.00    Microchip Technology, Inc.
79 //         NOLIST
80
81 // This header file defines configurations, registers, and other useful bits of
82 // information for the PIC16F818 microcontroller.  These names are taken to match 
83 // the data sheets as closely as possible.  
84
85 // Note that the processor must be selected before this file is 
86 // included.  The processor may be selected the following ways:
87
88 //       1. Command line switch:
89 //               C:\ MPASM MYFILE.ASM /PIC16F818
90 //       2. LIST directive in the source file
91 //               LIST   P=PIC16F818
92 //       3. Processor Type entry in the MPASM full-screen interface
93
94 //==========================================================================
95 //
96 //       Revision History
97 //
98 //==========================================================================
99
100 //Rev:   Date:    Reason:
101
102 //1.00   06/15/02 Initial Release
103 //1.01  09/18/02 Changed name of bit-2 in the OSCCON register to IOFS
104
105 //==========================================================================
106 //
107 //       Verify Processor
108 //
109 //==========================================================================
110
111 //        IFNDEF __16F818
112 //            MESSG "Processor-header file mismatch.  Verify selected processor."
113 //         ENDIF
114
115 //==========================================================================
116 //
117 //       Register Definitions
118 //
119 //==========================================================================
120
121 #define W                    0x0000
122 #define F                    0x0001
123
124 //----- Register Files------------------------------------------------------
125
126 extern __sfr  __at (INDF_ADDR)                    INDF;
127 extern __sfr  __at (TMR0_ADDR)                    TMR0;
128 extern __sfr  __at (PCL_ADDR)                     PCL;
129 extern __sfr  __at (STATUS_ADDR)                  STATUS;
130 extern __sfr  __at (FSR_ADDR)                     FSR;
131 extern __sfr  __at (PORTA_ADDR)                   PORTA;
132 extern __sfr  __at (PORTB_ADDR)                   PORTB;
133 extern __sfr  __at (PCLATH_ADDR)                  PCLATH;
134 extern __sfr  __at (INTCON_ADDR)                  INTCON;
135 extern __sfr  __at (PIR1_ADDR)                    PIR1;
136 extern __sfr  __at (PIR2_ADDR)                    PIR2;
137 extern __sfr  __at (TMR1L_ADDR)                   TMR1L;
138 extern __sfr  __at (TMR1H_ADDR)                   TMR1H;
139 extern __sfr  __at (T1CON_ADDR)                   T1CON;
140 extern __sfr  __at (TMR2_ADDR)                    TMR2;
141 extern __sfr  __at (T2CON_ADDR)                   T2CON;
142 extern __sfr  __at (SSPBUF_ADDR)                  SSPBUF;
143 extern __sfr  __at (SSPCON_ADDR)                  SSPCON;
144 extern __sfr  __at (CCPR1L_ADDR)                  CCPR1L;
145 extern __sfr  __at (CCPR1H_ADDR)                  CCPR1H;
146 extern __sfr  __at (CCP1CON_ADDR)                 CCP1CON;
147 extern __sfr  __at (ADRESH_ADDR)                  ADRESH;
148 extern __sfr  __at (ADCON0_ADDR)                  ADCON0;
149
150 extern __sfr  __at (OPTION_REG_ADDR)              OPTION_REG;
151 extern __sfr  __at (TRISA_ADDR)                   TRISA;
152 extern __sfr  __at (TRISB_ADDR)                   TRISB;
153 extern __sfr  __at (PIE1_ADDR)                    PIE1;
154 extern __sfr  __at (PIE2_ADDR)                    PIE2;
155 extern __sfr  __at (PCON_ADDR)                    PCON;
156 extern __sfr  __at (OSCCON_ADDR)                  OSCCON;
157 extern __sfr  __at (OSCTUNE_ADDR)                 OSCTUNE;
158 extern __sfr  __at (PR2_ADDR)                     PR2;
159 extern __sfr  __at (SSPADD_ADDR)                  SSPADD;
160 extern __sfr  __at (SSPSTAT_ADDR)                 SSPSTAT;
161 extern __sfr  __at (ADRESL_ADDR)                  ADRESL;
162 extern __sfr  __at (ADCON1_ADDR)                  ADCON1;
163
164 extern __sfr  __at (EEDATA_ADDR)                  EEDATA;
165 extern __sfr  __at (EEADR_ADDR)                   EEADR;
166 extern __sfr  __at (EEDATH_ADDR)                  EEDATH;
167 extern __sfr  __at (EEADRH_ADDR)                  EEADRH;
168
169 extern __sfr  __at (EECON1_ADDR)                  EECON1;
170 extern __sfr  __at (EECON2_ADDR)                  EECON2;
171
172 //----- STATUS Bits --------------------------------------------------------
173
174
175 //----- INTCON Bits --------------------------------------------------------
176
177
178 //----- PIR1 Bits ----------------------------------------------------------
179
180
181 //----- PIR2 Bits ----------------------------------------------------------
182
183
184 //----- T1CON Bits ---------------------------------------------------------
185
186
187 //----- T2CON Bits ---------------------------------------------------------
188
189
190 //----- SSPCON Bits --------------------------------------------------------
191
192
193 //----- CCP1CON Bits -------------------------------------------------------
194
195
196 //----- ADCON0 Bits --------------------------------------------------------
197
198
199 //----- OPTION_REG Bits -----------------------------------------------------
200
201
202 //----- PIE1 Bits ----------------------------------------------------------
203
204
205 //----- PIE2 Bits ----------------------------------------------------------
206
207
208 //----- PCON Bits ----------------------------------------------------------
209
210
211 //----- OSCCON Bits -------------------------------------------------------
212
213
214 //----- OSCTUNE Bits -------------------------------------------------------
215
216
217 //----- SSPSTAT Bits -------------------------------------------------------
218
219
220 //----- ADCON1 Bits --------------------------------------------------------
221
222
223 //----- EECON1 Bits --------------------------------------------------------
224
225
226 //==========================================================================
227 //
228 //       RAM Definition
229 //
230 //==========================================================================
231
232 //         __MAXRAM H'1FF'
233 //         __BADRAM H'07'-H'09', H'18'-H'1D'
234 //      __BADRAM H'87'-H'89', H'91', H'95'-H'9D'
235 //         __BADRAM H'105', H'107'-H'109', H'110'-H'11F'
236 //         __BADRAM H'185', H'187'-H'189', H'18E'-H'19F'
237
238 //==========================================================================
239 //
240 //       Configuration Bits
241 //
242 //==========================================================================
243
244 #define _CP_ALL              0x1FFF
245 #define _CP_OFF              0x3FFF
246 #define _CCP1_RB2            0x3FFF
247 #define _CCP1_RB3            0x2FFF
248 #define _DEBUG_OFF           0x3FFF
249 #define _DEBUG_ON            0x37FF
250 #define _WRT_ENABLE_OFF      0x3FFF
251 #define _WRT_ENABLE_512      0x3DFF
252 #define _WRT_ENABLE_1024     0x3BFF
253 #define _CPD_ON              0x3EFF
254 #define _CPD_OFF             0x3FFF
255 #define _LVP_ON              0x3FFF
256 #define _LVP_OFF             0x3F7F
257 #define _BODEN_ON            0x3FFF
258 #define _BODEN_OFF           0x3FBF
259 #define _MCLR_ON             0x3FFF
260 #define _MCLR_OFF            0x3FDF
261 #define _PWRTE_OFF           0x3FFF
262 #define _PWRTE_ON            0x3FF7
263 #define _WDT_ON              0x3FFF
264 #define _WDT_OFF             0x3FFB
265 #define _EXTRC_CLKOUT        0x3FFF
266 #define _EXTRC_IO            0x3FFE
267 #define _INTRC_CLKOUT        0x3FFD
268 #define _INTRC_IO            0x3FFC
269 #define _EXTCLK              0x3FEF
270 #define _HS_OSC              0x3FEE
271 #define _XT_OSC              0x3FED
272 #define _LP_OSC              0x3FEC
273
274 //         LIST
275
276 // ----- ADCON0 bits --------------------
277 typedef union {
278   struct {
279     unsigned char ADON:1;
280     unsigned char :1;
281     unsigned char GO:1;
282     unsigned char CHS0:1;
283     unsigned char CHS1:1;
284     unsigned char CHS2:1;
285     unsigned char ADCS0:1;
286     unsigned char ADCS1:1;
287   };
288   struct {
289     unsigned char :1;
290     unsigned char :1;
291     unsigned char NOT_DONE:1;
292     unsigned char :1;
293     unsigned char :1;
294     unsigned char :1;
295     unsigned char :1;
296     unsigned char :1;
297   };
298   struct {
299     unsigned char :1;
300     unsigned char :1;
301     unsigned char GO_DONE:1;
302     unsigned char :1;
303     unsigned char :1;
304     unsigned char :1;
305     unsigned char :1;
306     unsigned char :1;
307   };
308 } __ADCON0_bits_t;
309 extern volatile __ADCON0_bits_t __at(ADCON0_ADDR) ADCON0_bits;
310
311 #ifndef NO_BIT_DEFINES
312 #define ADON                 ADCON0_bits.ADON
313 #define GO                   ADCON0_bits.GO
314 #define NOT_DONE             ADCON0_bits.NOT_DONE
315 #define GO_DONE              ADCON0_bits.GO_DONE
316 #define CHS0                 ADCON0_bits.CHS0
317 #define CHS1                 ADCON0_bits.CHS1
318 #define CHS2                 ADCON0_bits.CHS2
319 #define ADCS0                ADCON0_bits.ADCS0
320 #define ADCS1                ADCON0_bits.ADCS1
321 #endif /* NO_BIT_DEFINES */
322
323 // ----- ADCON1 bits --------------------
324 typedef union {
325   struct {
326     unsigned char PCFG0:1;
327     unsigned char PCFG1:1;
328     unsigned char PCFG2:1;
329     unsigned char PCFG3:1;
330     unsigned char :1;
331     unsigned char :1;
332     unsigned char ADCS2:1;
333     unsigned char ADFM:1;
334   };
335 } __ADCON1_bits_t;
336 extern volatile __ADCON1_bits_t __at(ADCON1_ADDR) ADCON1_bits;
337
338 #ifndef NO_BIT_DEFINES
339 #define PCFG0                ADCON1_bits.PCFG0
340 #define PCFG1                ADCON1_bits.PCFG1
341 #define PCFG2                ADCON1_bits.PCFG2
342 #define PCFG3                ADCON1_bits.PCFG3
343 #define ADCS2                ADCON1_bits.ADCS2
344 #define ADFM                 ADCON1_bits.ADFM
345 #endif /* NO_BIT_DEFINES */
346
347 // ----- CCP1CON bits --------------------
348 typedef union {
349   struct {
350     unsigned char CCP1M0:1;
351     unsigned char CCP1M1:1;
352     unsigned char CCP1M2:1;
353     unsigned char CCP1M3:1;
354     unsigned char CCP1Y:1;
355     unsigned char CCP1X:1;
356     unsigned char :1;
357     unsigned char :1;
358   };
359 } __CCP1CON_bits_t;
360 extern volatile __CCP1CON_bits_t __at(CCP1CON_ADDR) CCP1CON_bits;
361
362 #ifndef NO_BIT_DEFINES
363 #define CCP1M0               CCP1CON_bits.CCP1M0
364 #define CCP1M1               CCP1CON_bits.CCP1M1
365 #define CCP1M2               CCP1CON_bits.CCP1M2
366 #define CCP1M3               CCP1CON_bits.CCP1M3
367 #define CCP1Y                CCP1CON_bits.CCP1Y
368 #define CCP1X                CCP1CON_bits.CCP1X
369 #endif /* NO_BIT_DEFINES */
370
371 // ----- EECON1 bits --------------------
372 typedef union {
373   struct {
374     unsigned char RD:1;
375     unsigned char WR:1;
376     unsigned char WREN:1;
377     unsigned char WRERR:1;
378     unsigned char FREE:1;
379     unsigned char :1;
380     unsigned char :1;
381     unsigned char EEPGD:1;
382   };
383 } __EECON1_bits_t;
384 extern volatile __EECON1_bits_t __at(EECON1_ADDR) EECON1_bits;
385
386 #ifndef NO_BIT_DEFINES
387 #define RD                   EECON1_bits.RD
388 #define WR                   EECON1_bits.WR
389 #define WREN                 EECON1_bits.WREN
390 #define WRERR                EECON1_bits.WRERR
391 #define FREE                 EECON1_bits.FREE
392 #define EEPGD                EECON1_bits.EEPGD
393 #endif /* NO_BIT_DEFINES */
394
395 // ----- INTCON bits --------------------
396 typedef union {
397   struct {
398     unsigned char RBIF:1;
399     unsigned char INTF:1;
400     unsigned char TMR0IF:1;
401     unsigned char RBIE:1;
402     unsigned char INTE:1;
403     unsigned char TMR0IE:1;
404     unsigned char PEIE:1;
405     unsigned char GIE:1;
406   };
407 } __INTCON_bits_t;
408 extern volatile __INTCON_bits_t __at(INTCON_ADDR) INTCON_bits;
409
410 #ifndef NO_BIT_DEFINES
411 #define RBIF                 INTCON_bits.RBIF
412 #define INTF                 INTCON_bits.INTF
413 #define TMR0IF               INTCON_bits.TMR0IF
414 #define RBIE                 INTCON_bits.RBIE
415 #define INTE                 INTCON_bits.INTE
416 #define TMR0IE               INTCON_bits.TMR0IE
417 #define PEIE                 INTCON_bits.PEIE
418 #define GIE                  INTCON_bits.GIE
419 #endif /* NO_BIT_DEFINES */
420
421 // ----- OPTION_REG bits --------------------
422 typedef union {
423   struct {
424     unsigned char PS0:1;
425     unsigned char PS1:1;
426     unsigned char PS2:1;
427     unsigned char PSA:1;
428     unsigned char T0SE:1;
429     unsigned char T0CS:1;
430     unsigned char INTEDG:1;
431     unsigned char NOT_RBPU:1;
432   };
433 } __OPTION_REG_bits_t;
434 extern volatile __OPTION_REG_bits_t __at(OPTION_REG_ADDR) OPTION_REG_bits;
435
436 #ifndef NO_BIT_DEFINES
437 #define PS0                  OPTION_REG_bits.PS0
438 #define PS1                  OPTION_REG_bits.PS1
439 #define PS2                  OPTION_REG_bits.PS2
440 #define PSA                  OPTION_REG_bits.PSA
441 #define T0SE                 OPTION_REG_bits.T0SE
442 #define T0CS                 OPTION_REG_bits.T0CS
443 #define INTEDG               OPTION_REG_bits.INTEDG
444 #define NOT_RBPU             OPTION_REG_bits.NOT_RBPU
445 #endif /* NO_BIT_DEFINES */
446
447 // ----- OSCCON bits --------------------
448 typedef union {
449   struct {
450     unsigned char :1;
451     unsigned char :1;
452     unsigned char IOFS:1;
453     unsigned char :1;
454     unsigned char IRCF0:1;
455     unsigned char IRCF1:1;
456     unsigned char IRCF2:1;
457     unsigned char :1;
458   };
459 } __OSCCON_bits_t;
460 extern volatile __OSCCON_bits_t __at(OSCCON_ADDR) OSCCON_bits;
461
462 #ifndef NO_BIT_DEFINES
463 #define IOFS                 OSCCON_bits.IOFS
464 #define IRCF0                OSCCON_bits.IRCF0
465 #define IRCF1                OSCCON_bits.IRCF1
466 #define IRCF2                OSCCON_bits.IRCF2
467 #endif /* NO_BIT_DEFINES */
468
469 // ----- OSCTUNE bits --------------------
470 typedef union {
471   struct {
472     unsigned char TUN0:1;
473     unsigned char TUN1:1;
474     unsigned char TUN2:1;
475     unsigned char TUN3:1;
476     unsigned char TUN4:1;
477     unsigned char TUN5:1;
478     unsigned char :1;
479     unsigned char :1;
480   };
481 } __OSCTUNE_bits_t;
482 extern volatile __OSCTUNE_bits_t __at(OSCTUNE_ADDR) OSCTUNE_bits;
483
484 #ifndef NO_BIT_DEFINES
485 #define TUN0                 OSCTUNE_bits.TUN0
486 #define TUN1                 OSCTUNE_bits.TUN1
487 #define TUN2                 OSCTUNE_bits.TUN2
488 #define TUN3                 OSCTUNE_bits.TUN3
489 #define TUN4                 OSCTUNE_bits.TUN4
490 #define TUN5                 OSCTUNE_bits.TUN5
491 #endif /* NO_BIT_DEFINES */
492
493 // ----- PCON bits --------------------
494 typedef union {
495   struct {
496     unsigned char NOT_BO:1;
497     unsigned char NOT_POR:1;
498     unsigned char :1;
499     unsigned char :1;
500     unsigned char :1;
501     unsigned char :1;
502     unsigned char :1;
503     unsigned char :1;
504   };
505   struct {
506     unsigned char NOT_BOR:1;
507     unsigned char :1;
508     unsigned char :1;
509     unsigned char :1;
510     unsigned char :1;
511     unsigned char :1;
512     unsigned char :1;
513     unsigned char :1;
514   };
515 } __PCON_bits_t;
516 extern volatile __PCON_bits_t __at(PCON_ADDR) PCON_bits;
517
518 #ifndef NO_BIT_DEFINES
519 #define NOT_BO               PCON_bits.NOT_BO
520 #define NOT_BOR              PCON_bits.NOT_BOR
521 #define NOT_POR              PCON_bits.NOT_POR
522 #endif /* NO_BIT_DEFINES */
523
524 // ----- PIE1 bits --------------------
525 typedef union {
526   struct {
527     unsigned char TMR1IE:1;
528     unsigned char TMR2IE:1;
529     unsigned char CCP1IE:1;
530     unsigned char SSPIE:1;
531     unsigned char :1;
532     unsigned char :1;
533     unsigned char ADIE:1;
534     unsigned char :1;
535   };
536 } __PIE1_bits_t;
537 extern volatile __PIE1_bits_t __at(PIE1_ADDR) PIE1_bits;
538
539 #ifndef NO_BIT_DEFINES
540 #define TMR1IE               PIE1_bits.TMR1IE
541 #define TMR2IE               PIE1_bits.TMR2IE
542 #define CCP1IE               PIE1_bits.CCP1IE
543 #define SSPIE                PIE1_bits.SSPIE
544 #define ADIE                 PIE1_bits.ADIE
545 #endif /* NO_BIT_DEFINES */
546
547 // ----- PIE2 bits --------------------
548 typedef union {
549   struct {
550     unsigned char :1;
551     unsigned char :1;
552     unsigned char :1;
553     unsigned char :1;
554     unsigned char EEIE:1;
555     unsigned char :1;
556     unsigned char :1;
557     unsigned char :1;
558   };
559 } __PIE2_bits_t;
560 extern volatile __PIE2_bits_t __at(PIE2_ADDR) PIE2_bits;
561
562 #ifndef NO_BIT_DEFINES
563 #define EEIE                 PIE2_bits.EEIE
564 #endif /* NO_BIT_DEFINES */
565
566 // ----- PIR1 bits --------------------
567 typedef union {
568   struct {
569     unsigned char TMR1IF:1;
570     unsigned char TMR2IF:1;
571     unsigned char CCP1IF:1;
572     unsigned char SSPIF:1;
573     unsigned char :1;
574     unsigned char :1;
575     unsigned char ADIF:1;
576     unsigned char :1;
577   };
578 } __PIR1_bits_t;
579 extern volatile __PIR1_bits_t __at(PIR1_ADDR) PIR1_bits;
580
581 #ifndef NO_BIT_DEFINES
582 #define TMR1IF               PIR1_bits.TMR1IF
583 #define TMR2IF               PIR1_bits.TMR2IF
584 #define CCP1IF               PIR1_bits.CCP1IF
585 #define SSPIF                PIR1_bits.SSPIF
586 #define ADIF                 PIR1_bits.ADIF
587 #endif /* NO_BIT_DEFINES */
588
589 // ----- PIR2 bits --------------------
590 typedef union {
591   struct {
592     unsigned char :1;
593     unsigned char :1;
594     unsigned char :1;
595     unsigned char :1;
596     unsigned char EEIF:1;
597     unsigned char :1;
598     unsigned char :1;
599     unsigned char :1;
600   };
601 } __PIR2_bits_t;
602 extern volatile __PIR2_bits_t __at(PIR2_ADDR) PIR2_bits;
603
604 #ifndef NO_BIT_DEFINES
605 #define EEIF                 PIR2_bits.EEIF
606 #endif /* NO_BIT_DEFINES */
607
608 // ----- PORTA bits --------------------
609 typedef union {
610   struct {
611     unsigned char RA0:1;
612     unsigned char RA1:1;
613     unsigned char RA2:1;
614     unsigned char RA3:1;
615     unsigned char RA4:1;
616     unsigned char RA5:1;
617     unsigned char :1;
618     unsigned char :1;
619   };
620 } __PORTA_bits_t;
621 extern volatile __PORTA_bits_t __at(PORTA_ADDR) PORTA_bits;
622
623 #ifndef NO_BIT_DEFINES
624 #define RA0                  PORTA_bits.RA0
625 #define RA1                  PORTA_bits.RA1
626 #define RA2                  PORTA_bits.RA2
627 #define RA3                  PORTA_bits.RA3
628 #define RA4                  PORTA_bits.RA4
629 #define RA5                  PORTA_bits.RA5
630 #endif /* NO_BIT_DEFINES */
631
632 // ----- PORTB bits --------------------
633 typedef union {
634   struct {
635     unsigned char RB0:1;
636     unsigned char RB1:1;
637     unsigned char RB2:1;
638     unsigned char RB3:1;
639     unsigned char RB4:1;
640     unsigned char RB5:1;
641     unsigned char RB6:1;
642     unsigned char RB7:1;
643   };
644 } __PORTB_bits_t;
645 extern volatile __PORTB_bits_t __at(PORTB_ADDR) PORTB_bits;
646
647 #ifndef NO_BIT_DEFINES
648 #define RB0                  PORTB_bits.RB0
649 #define RB1                  PORTB_bits.RB1
650 #define RB2                  PORTB_bits.RB2
651 #define RB3                  PORTB_bits.RB3
652 #define RB4                  PORTB_bits.RB4
653 #define RB5                  PORTB_bits.RB5
654 #define RB6                  PORTB_bits.RB6
655 #define RB7                  PORTB_bits.RB7
656 #endif /* NO_BIT_DEFINES */
657
658 // ----- SSPCON bits --------------------
659 typedef union {
660   struct {
661     unsigned char SSPM0:1;
662     unsigned char SSPM1:1;
663     unsigned char SSPM2:1;
664     unsigned char SSPM3:1;
665     unsigned char CKP:1;
666     unsigned char SSPEN:1;
667     unsigned char SSPOV:1;
668     unsigned char WCOL:1;
669   };
670 } __SSPCON_bits_t;
671 extern volatile __SSPCON_bits_t __at(SSPCON_ADDR) SSPCON_bits;
672
673 #ifndef NO_BIT_DEFINES
674 #define SSPM0                SSPCON_bits.SSPM0
675 #define SSPM1                SSPCON_bits.SSPM1
676 #define SSPM2                SSPCON_bits.SSPM2
677 #define SSPM3                SSPCON_bits.SSPM3
678 #define CKP                  SSPCON_bits.CKP
679 #define SSPEN                SSPCON_bits.SSPEN
680 #define SSPOV                SSPCON_bits.SSPOV
681 #define WCOL                 SSPCON_bits.WCOL
682 #endif /* NO_BIT_DEFINES */
683
684 // ----- SSPSTAT bits --------------------
685 typedef union {
686   struct {
687     unsigned char BF:1;
688     unsigned char UA:1;
689     unsigned char R:1;
690     unsigned char S:1;
691     unsigned char P:1;
692     unsigned char D:1;
693     unsigned char CKE:1;
694     unsigned char SMP:1;
695   };
696   struct {
697     unsigned char :1;
698     unsigned char :1;
699     unsigned char I2C_READ:1;
700     unsigned char I2C_START:1;
701     unsigned char I2C_STOP:1;
702     unsigned char I2C_DATA:1;
703     unsigned char :1;
704     unsigned char :1;
705   };
706   struct {
707     unsigned char :1;
708     unsigned char :1;
709     unsigned char NOT_W:1;
710     unsigned char :1;
711     unsigned char :1;
712     unsigned char NOT_A:1;
713     unsigned char :1;
714     unsigned char :1;
715   };
716   struct {
717     unsigned char :1;
718     unsigned char :1;
719     unsigned char NOT_WRITE:1;
720     unsigned char :1;
721     unsigned char :1;
722     unsigned char NOT_ADDRESS:1;
723     unsigned char :1;
724     unsigned char :1;
725   };
726   struct {
727     unsigned char :1;
728     unsigned char :1;
729     unsigned char R_W:1;
730     unsigned char :1;
731     unsigned char :1;
732     unsigned char D_A:1;
733     unsigned char :1;
734     unsigned char :1;
735   };
736   struct {
737     unsigned char :1;
738     unsigned char :1;
739     unsigned char READ_WRITE:1;
740     unsigned char :1;
741     unsigned char :1;
742     unsigned char DATA_ADDRESS:1;
743     unsigned char :1;
744     unsigned char :1;
745   };
746 } __SSPSTAT_bits_t;
747 extern volatile __SSPSTAT_bits_t __at(SSPSTAT_ADDR) SSPSTAT_bits;
748
749 #ifndef NO_BIT_DEFINES
750 #define BF                   SSPSTAT_bits.BF
751 #define UA                   SSPSTAT_bits.UA
752 #define R                    SSPSTAT_bits.R
753 #define I2C_READ             SSPSTAT_bits.I2C_READ
754 #define NOT_W                SSPSTAT_bits.NOT_W
755 #define NOT_WRITE            SSPSTAT_bits.NOT_WRITE
756 #define R_W                  SSPSTAT_bits.R_W
757 #define READ_WRITE           SSPSTAT_bits.READ_WRITE
758 #define S                    SSPSTAT_bits.S
759 #define I2C_START            SSPSTAT_bits.I2C_START
760 #define P                    SSPSTAT_bits.P
761 #define I2C_STOP             SSPSTAT_bits.I2C_STOP
762 #define D                    SSPSTAT_bits.D
763 #define I2C_DATA             SSPSTAT_bits.I2C_DATA
764 #define NOT_A                SSPSTAT_bits.NOT_A
765 #define NOT_ADDRESS          SSPSTAT_bits.NOT_ADDRESS
766 #define D_A                  SSPSTAT_bits.D_A
767 #define DATA_ADDRESS         SSPSTAT_bits.DATA_ADDRESS
768 #define CKE                  SSPSTAT_bits.CKE
769 #define SMP                  SSPSTAT_bits.SMP
770 #endif /* NO_BIT_DEFINES */
771
772 // ----- STATUS bits --------------------
773 typedef union {
774   struct {
775     unsigned char C:1;
776     unsigned char DC:1;
777     unsigned char Z:1;
778     unsigned char NOT_PD:1;
779     unsigned char NOT_TO:1;
780     unsigned char RP0:1;
781     unsigned char RP1:1;
782     unsigned char IRP:1;
783   };
784 } __STATUS_bits_t;
785 extern volatile __STATUS_bits_t __at(STATUS_ADDR) STATUS_bits;
786
787 #ifndef NO_BIT_DEFINES
788 #define C                    STATUS_bits.C
789 #define DC                   STATUS_bits.DC
790 #define Z                    STATUS_bits.Z
791 #define NOT_PD               STATUS_bits.NOT_PD
792 #define NOT_TO               STATUS_bits.NOT_TO
793 #define RP0                  STATUS_bits.RP0
794 #define RP1                  STATUS_bits.RP1
795 #define IRP                  STATUS_bits.IRP
796 #endif /* NO_BIT_DEFINES */
797
798 // ----- T1CON bits --------------------
799 typedef union {
800   struct {
801     unsigned char TMR1ON:1;
802     unsigned char TMR1CS:1;
803     unsigned char NOT_T1SYNC:1;
804     unsigned char T1OSCEN:1;
805     unsigned char T1CKPS0:1;
806     unsigned char T1CKPS1:1;
807     unsigned char :1;
808     unsigned char :1;
809   };
810   struct {
811     unsigned char :1;
812     unsigned char :1;
813     unsigned char T1INSYNC:1;
814     unsigned char :1;
815     unsigned char :1;
816     unsigned char :1;
817     unsigned char :1;
818     unsigned char :1;
819   };
820 } __T1CON_bits_t;
821 extern volatile __T1CON_bits_t __at(T1CON_ADDR) T1CON_bits;
822
823 #ifndef NO_BIT_DEFINES
824 #define TMR1ON               T1CON_bits.TMR1ON
825 #define TMR1CS               T1CON_bits.TMR1CS
826 #define NOT_T1SYNC           T1CON_bits.NOT_T1SYNC
827 #define T1INSYNC             T1CON_bits.T1INSYNC
828 #define T1OSCEN              T1CON_bits.T1OSCEN
829 #define T1CKPS0              T1CON_bits.T1CKPS0
830 #define T1CKPS1              T1CON_bits.T1CKPS1
831 #endif /* NO_BIT_DEFINES */
832
833 // ----- T2CON bits --------------------
834 typedef union {
835   struct {
836     unsigned char T2CKPS0:1;
837     unsigned char T2CKPS1:1;
838     unsigned char TMR2ON:1;
839     unsigned char TOUTPS0:1;
840     unsigned char TOUTPS1:1;
841     unsigned char TOUTPS2:1;
842     unsigned char TOUTPS3:1;
843     unsigned char :1;
844   };
845 } __T2CON_bits_t;
846 extern volatile __T2CON_bits_t __at(T2CON_ADDR) T2CON_bits;
847
848 #ifndef NO_BIT_DEFINES
849 #define T2CKPS0              T2CON_bits.T2CKPS0
850 #define T2CKPS1              T2CON_bits.T2CKPS1
851 #define TMR2ON               T2CON_bits.TMR2ON
852 #define TOUTPS0              T2CON_bits.TOUTPS0
853 #define TOUTPS1              T2CON_bits.TOUTPS1
854 #define TOUTPS2              T2CON_bits.TOUTPS2
855 #define TOUTPS3              T2CON_bits.TOUTPS3
856 #endif /* NO_BIT_DEFINES */
857
858 // ----- TRISA bits --------------------
859 typedef union {
860   struct {
861     unsigned char TRISA0:1;
862     unsigned char TRISA1:1;
863     unsigned char TRISA2:1;
864     unsigned char TRISA3:1;
865     unsigned char TRISA4:1;
866     unsigned char TRISA5:1;
867     unsigned char :1;
868     unsigned char :1;
869   };
870 } __TRISA_bits_t;
871 extern volatile __TRISA_bits_t __at(TRISA_ADDR) TRISA_bits;
872
873 #ifndef NO_BIT_DEFINES
874 #define TRISA0               TRISA_bits.TRISA0
875 #define TRISA1               TRISA_bits.TRISA1
876 #define TRISA2               TRISA_bits.TRISA2
877 #define TRISA3               TRISA_bits.TRISA3
878 #define TRISA4               TRISA_bits.TRISA4
879 #define TRISA5               TRISA_bits.TRISA5
880 #endif /* NO_BIT_DEFINES */
881
882 // ----- TRISB bits --------------------
883 typedef union {
884   struct {
885     unsigned char TRISB0:1;
886     unsigned char TRISB1:1;
887     unsigned char TRISB2:1;
888     unsigned char TRISB3:1;
889     unsigned char TRISB4:1;
890     unsigned char TRISB5:1;
891     unsigned char TRISB6:1;
892     unsigned char TRISB7:1;
893   };
894 } __TRISB_bits_t;
895 extern volatile __TRISB_bits_t __at(TRISB_ADDR) TRISB_bits;
896
897 #ifndef NO_BIT_DEFINES
898 #define TRISB0               TRISB_bits.TRISB0
899 #define TRISB1               TRISB_bits.TRISB1
900 #define TRISB2               TRISB_bits.TRISB2
901 #define TRISB3               TRISB_bits.TRISB3
902 #define TRISB4               TRISB_bits.TRISB4
903 #define TRISB5               TRISB_bits.TRISB5
904 #define TRISB6               TRISB_bits.TRISB6
905 #define TRISB7               TRISB_bits.TRISB7
906 #endif /* NO_BIT_DEFINES */
907
908 #endif