1 /*
2  * This declarations of the PIC16F777 MCU.
3  *
4  * This file is part of the GNU PIC library for SDCC, originally
5  * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
6  *
7  * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:22:59 UTC.
8  *
9  * SDCC is licensed under the GNU Public license (GPL) v2. Note that
10  * this license covers the code to the compiler and other executables,
11  * but explicitly does not cover any code or objects generated by sdcc.
12  *
13  * For pic device libraries and header files which are derived from
14  * Microchip header (.inc) and linker script (.lkr) files Microchip
15  * requires that "The header files should state that they are only to be
16  * used with authentic Microchip devices" which makes them incompatible
17  * with the GPL. Pic device libraries and header files are located at
18  * non-free/lib and non-free/include directories respectively.
19  * Sdcc should be run with the --use-non-free command line option in
20  * order to include non-free header files and libraries.
21  *
22  * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
23  */
24 
25 #ifndef __PIC16F777_H__
26 #define __PIC16F777_H__
27 
28 //==============================================================================
29 //
30 //	Register Addresses
31 //
32 //==============================================================================
33 
34 #ifndef NO_ADDR_DEFINES
35 
36 #define INDF_ADDR               0x0000
37 #define TMR0_ADDR               0x0001
38 #define PCL_ADDR                0x0002
39 #define STATUS_ADDR             0x0003
40 #define FSR_ADDR                0x0004
41 #define PORTA_ADDR              0x0005
42 #define PORTB_ADDR              0x0006
43 #define PORTC_ADDR              0x0007
44 #define PORTD_ADDR              0x0008
45 #define PORTE_ADDR              0x0009
46 #define PCLATH_ADDR             0x000A
47 #define INTCON_ADDR             0x000B
48 #define PIR1_ADDR               0x000C
49 #define PIR2_ADDR               0x000D
50 #define TMR1_ADDR               0x000E
51 #define TMR1L_ADDR              0x000E
52 #define TMR1H_ADDR              0x000F
53 #define T1CON_ADDR              0x0010
54 #define TMR2_ADDR               0x0011
55 #define T2CON_ADDR              0x0012
56 #define SSPBUF_ADDR             0x0013
57 #define SSPCON_ADDR             0x0014
58 #define CCPR1_ADDR              0x0015
59 #define CCPR1L_ADDR             0x0015
60 #define CCPR1H_ADDR             0x0016
61 #define CCP1CON_ADDR            0x0017
62 #define RCSTA_ADDR              0x0018
63 #define TXREG_ADDR              0x0019
64 #define RCREG_ADDR              0x001A
65 #define CCPR2_ADDR              0x001B
66 #define CCPR2L_ADDR             0x001B
67 #define CCPR2H_ADDR             0x001C
68 #define CCP2CON_ADDR            0x001D
69 #define ADRESH_ADDR             0x001E
70 #define ADCON0_ADDR             0x001F
71 #define OPTION_REG_ADDR         0x0081
72 #define TRISA_ADDR              0x0085
73 #define TRISB_ADDR              0x0086
74 #define TRISC_ADDR              0x0087
75 #define TRISD_ADDR              0x0088
76 #define TRISE_ADDR              0x0089
77 #define PIE1_ADDR               0x008C
78 #define PIE2_ADDR               0x008D
79 #define PCON_ADDR               0x008E
80 #define OSCCON_ADDR             0x008F
81 #define OSCTUNE_ADDR            0x0090
82 #define SSPCON2_ADDR            0x0091
83 #define PR2_ADDR                0x0092
84 #define SSPADD_ADDR             0x0093
85 #define SSPSTAT_ADDR            0x0094
86 #define CCPR3_ADDR              0x0095
87 #define CCPR3L_ADDR             0x0095
88 #define CCPR3H_ADDR             0x0096
89 #define CCP3CON_ADDR            0x0097
90 #define TXSTA_ADDR              0x0098
91 #define SPBRG_ADDR              0x0099
92 #define ADCON2_ADDR             0x009B
93 #define CMCON_ADDR              0x009C
94 #define CVRCON_ADDR             0x009D
95 #define ADRESL_ADDR             0x009E
96 #define ADCON1_ADDR             0x009F
97 #define WDTCON_ADDR             0x0105
98 #define LVDCON_ADDR             0x0109
99 #define PMDATA_ADDR             0x010C
100 #define PMADR_ADDR              0x010D
101 #define PMDATH_ADDR             0x010E
102 #define PMADRH_ADDR             0x010F
103 #define PMCON1_ADDR             0x018C
104 
105 #endif // #ifndef NO_ADDR_DEFINES
106 
107 //==============================================================================
108 //
109 //	Register Definitions
110 //
111 //==============================================================================
112 
113 extern __at(0x0000) __sfr INDF;
114 extern __at(0x0001) __sfr TMR0;
115 extern __at(0x0002) __sfr PCL;
116 
117 //==============================================================================
118 //        STATUS Bits
119 
120 extern __at(0x0003) __sfr STATUS;
121 
122 typedef union
123   {
124   struct
125     {
126     unsigned C                  : 1;
127     unsigned DC                 : 1;
128     unsigned Z                  : 1;
129     unsigned NOT_PD             : 1;
130     unsigned NOT_TO             : 1;
131     unsigned RP0                : 1;
132     unsigned RP1                : 1;
133     unsigned IRP                : 1;
134     };
135 
136   struct
137     {
138     unsigned                    : 5;
139     unsigned RP                 : 2;
140     unsigned                    : 1;
141     };
142   } __STATUSbits_t;
143 
144 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
145 
146 #define _C                      0x01
147 #define _DC                     0x02
148 #define _Z                      0x04
149 #define _NOT_PD                 0x08
150 #define _NOT_TO                 0x10
151 #define _RP0                    0x20
152 #define _RP1                    0x40
153 #define _IRP                    0x80
154 
155 //==============================================================================
156 
157 extern __at(0x0004) __sfr FSR;
158 
159 //==============================================================================
160 //        PORTA Bits
161 
162 extern __at(0x0005) __sfr PORTA;
163 
164 typedef struct
165   {
166   unsigned RA0                  : 1;
167   unsigned RA1                  : 1;
168   unsigned RA2                  : 1;
169   unsigned RA3                  : 1;
170   unsigned RA4                  : 1;
171   unsigned RA5                  : 1;
172   unsigned RA6                  : 1;
173   unsigned RA7                  : 1;
174   } __PORTAbits_t;
175 
176 extern __at(0x0005) volatile __PORTAbits_t PORTAbits;
177 
178 #define _RA0                    0x01
179 #define _RA1                    0x02
180 #define _RA2                    0x04
181 #define _RA3                    0x08
182 #define _RA4                    0x10
183 #define _RA5                    0x20
184 #define _RA6                    0x40
185 #define _RA7                    0x80
186 
187 //==============================================================================
188 
189 
190 //==============================================================================
191 //        PORTB Bits
192 
193 extern __at(0x0006) __sfr PORTB;
194 
195 typedef struct
196   {
197   unsigned RB0                  : 1;
198   unsigned RB1                  : 1;
199   unsigned RB2                  : 1;
200   unsigned RB3                  : 1;
201   unsigned RB4                  : 1;
202   unsigned RB5                  : 1;
203   unsigned RB6                  : 1;
204   unsigned RB7                  : 1;
205   } __PORTBbits_t;
206 
207 extern __at(0x0006) volatile __PORTBbits_t PORTBbits;
208 
209 #define _RB0                    0x01
210 #define _RB1                    0x02
211 #define _RB2                    0x04
212 #define _RB3                    0x08
213 #define _RB4                    0x10
214 #define _RB5                    0x20
215 #define _RB6                    0x40
216 #define _RB7                    0x80
217 
218 //==============================================================================
219 
220 
221 //==============================================================================
222 //        PORTC Bits
223 
224 extern __at(0x0007) __sfr PORTC;
225 
226 typedef struct
227   {
228   unsigned RC0                  : 1;
229   unsigned RC1                  : 1;
230   unsigned RC2                  : 1;
231   unsigned RC3                  : 1;
232   unsigned RC4                  : 1;
233   unsigned RC5                  : 1;
234   unsigned RC6                  : 1;
235   unsigned RC7                  : 1;
236   } __PORTCbits_t;
237 
238 extern __at(0x0007) volatile __PORTCbits_t PORTCbits;
239 
240 #define _RC0                    0x01
241 #define _RC1                    0x02
242 #define _RC2                    0x04
243 #define _RC3                    0x08
244 #define _RC4                    0x10
245 #define _RC5                    0x20
246 #define _RC6                    0x40
247 #define _RC7                    0x80
248 
249 //==============================================================================
250 
251 
252 //==============================================================================
253 //        PORTD Bits
254 
255 extern __at(0x0008) __sfr PORTD;
256 
257 typedef struct
258   {
259   unsigned RD0                  : 1;
260   unsigned RD1                  : 1;
261   unsigned RD2                  : 1;
262   unsigned RD3                  : 1;
263   unsigned RD4                  : 1;
264   unsigned RD5                  : 1;
265   unsigned RD6                  : 1;
266   unsigned RD7                  : 1;
267   } __PORTDbits_t;
268 
269 extern __at(0x0008) volatile __PORTDbits_t PORTDbits;
270 
271 #define _RD0                    0x01
272 #define _RD1                    0x02
273 #define _RD2                    0x04
274 #define _RD3                    0x08
275 #define _RD4                    0x10
276 #define _RD5                    0x20
277 #define _RD6                    0x40
278 #define _RD7                    0x80
279 
280 //==============================================================================
281 
282 
283 //==============================================================================
284 //        PORTE Bits
285 
286 extern __at(0x0009) __sfr PORTE;
287 
288 typedef union
289   {
290   struct
291     {
292     unsigned RE0                : 1;
293     unsigned RE1                : 1;
294     unsigned RE2                : 1;
295     unsigned RE3                : 1;
296     unsigned                    : 1;
297     unsigned                    : 1;
298     unsigned                    : 1;
299     unsigned                    : 1;
300     };
301 
302   struct
303     {
304     unsigned RE                 : 4;
305     unsigned                    : 4;
306     };
307   } __PORTEbits_t;
308 
309 extern __at(0x0009) volatile __PORTEbits_t PORTEbits;
310 
311 #define _RE0                    0x01
312 #define _RE1                    0x02
313 #define _RE2                    0x04
314 #define _RE3                    0x08
315 
316 //==============================================================================
317 
318 extern __at(0x000A) __sfr PCLATH;
319 
320 //==============================================================================
321 //        INTCON Bits
322 
323 extern __at(0x000B) __sfr INTCON;
324 
325 typedef union
326   {
327   struct
328     {
329     unsigned RBIF               : 1;
330     unsigned INTF               : 1;
331     unsigned TMR0IF             : 1;
332     unsigned RBIE               : 1;
333     unsigned INTE               : 1;
334     unsigned TMR0IE             : 1;
335     unsigned PEIE               : 1;
336     unsigned GIE                : 1;
337     };
338 
339   struct
340     {
341     unsigned                    : 1;
342     unsigned INT0IF             : 1;
343     unsigned T0IF               : 1;
344     unsigned                    : 1;
345     unsigned INT0IE             : 1;
346     unsigned T0IE               : 1;
347     unsigned                    : 1;
348     unsigned                    : 1;
349     };
350   } __INTCONbits_t;
351 
352 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
353 
354 #define _RBIF                   0x01
355 #define _INTF                   0x02
356 #define _INT0IF                 0x02
357 #define _TMR0IF                 0x04
358 #define _T0IF                   0x04
359 #define _RBIE                   0x08
360 #define _INTE                   0x10
361 #define _INT0IE                 0x10
362 #define _TMR0IE                 0x20
363 #define _T0IE                   0x20
364 #define _PEIE                   0x40
365 #define _GIE                    0x80
366 
367 //==============================================================================
368 
369 
370 //==============================================================================
371 //        PIR1 Bits
372 
373 extern __at(0x000C) __sfr PIR1;
374 
375 typedef struct
376   {
377   unsigned TMR1IF               : 1;
378   unsigned TMR2IF               : 1;
379   unsigned CCP1IF               : 1;
380   unsigned SSPIF                : 1;
381   unsigned TXIF                 : 1;
382   unsigned RCIF                 : 1;
383   unsigned ADIF                 : 1;
384   unsigned PSPIF                : 1;
385   } __PIR1bits_t;
386 
387 extern __at(0x000C) volatile __PIR1bits_t PIR1bits;
388 
389 #define _TMR1IF                 0x01
390 #define _TMR2IF                 0x02
391 #define _CCP1IF                 0x04
392 #define _SSPIF                  0x08
393 #define _TXIF                   0x10
394 #define _RCIF                   0x20
395 #define _ADIF                   0x40
396 #define _PSPIF                  0x80
397 
398 //==============================================================================
399 
400 
401 //==============================================================================
402 //        PIR2 Bits
403 
404 extern __at(0x000D) __sfr PIR2;
405 
406 typedef struct
407   {
408   unsigned CCP2IF               : 1;
409   unsigned CCP3IF               : 1;
410   unsigned                      : 1;
411   unsigned BCLIF                : 1;
412   unsigned                      : 1;
413   unsigned LVDIF                : 1;
414   unsigned CMIF                 : 1;
415   unsigned OSFIF                : 1;
416   } __PIR2bits_t;
417 
418 extern __at(0x000D) volatile __PIR2bits_t PIR2bits;
419 
420 #define _CCP2IF                 0x01
421 #define _CCP3IF                 0x02
422 #define _BCLIF                  0x08
423 #define _LVDIF                  0x20
424 #define _CMIF                   0x40
425 #define _OSFIF                  0x80
426 
427 //==============================================================================
428 
429 extern __at(0x000E) __sfr TMR1;
430 extern __at(0x000E) __sfr TMR1L;
431 extern __at(0x000F) __sfr TMR1H;
432 
433 //==============================================================================
434 //        T1CON Bits
435 
436 extern __at(0x0010) __sfr T1CON;
437 
438 typedef union
439   {
440   struct
441     {
442     unsigned TMR1ON             : 1;
443     unsigned TMR1CS             : 1;
444     unsigned NOT_T1SYNC         : 1;
445     unsigned T1OSCEN            : 1;
446     unsigned T1CKPS0            : 1;
447     unsigned T1CKPS1            : 1;
448     unsigned T1RUN              : 1;
449     unsigned                    : 1;
450     };
451 
452   struct
453     {
454     unsigned                    : 1;
455     unsigned                    : 1;
456     unsigned T1SYNC             : 1;
457     unsigned                    : 1;
458     unsigned                    : 1;
459     unsigned                    : 1;
460     unsigned                    : 1;
461     unsigned                    : 1;
462     };
463 
464   struct
465     {
466     unsigned                    : 1;
467     unsigned                    : 1;
468     unsigned T1INSYNC           : 1;
469     unsigned                    : 1;
470     unsigned                    : 1;
471     unsigned                    : 1;
472     unsigned                    : 1;
473     unsigned                    : 1;
474     };
475 
476   struct
477     {
478     unsigned                    : 4;
479     unsigned T1CKPS             : 2;
480     unsigned                    : 2;
481     };
482   } __T1CONbits_t;
483 
484 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
485 
486 #define _TMR1ON                 0x01
487 #define _TMR1CS                 0x02
488 #define _NOT_T1SYNC             0x04
489 #define _T1SYNC                 0x04
490 #define _T1INSYNC               0x04
491 #define _T1OSCEN                0x08
492 #define _T1CKPS0                0x10
493 #define _T1CKPS1                0x20
494 #define _T1RUN                  0x40
495 
496 //==============================================================================
497 
498 extern __at(0x0011) __sfr TMR2;
499 
500 //==============================================================================
501 //        T2CON Bits
502 
503 extern __at(0x0012) __sfr T2CON;
504 
505 typedef union
506   {
507   struct
508     {
509     unsigned T2CKPS0            : 1;
510     unsigned T2CKPS1            : 1;
511     unsigned TMR2ON             : 1;
512     unsigned TOUTPS0            : 1;
513     unsigned TOUTPS1            : 1;
514     unsigned TOUTPS2            : 1;
515     unsigned TOUTPS3            : 1;
516     unsigned                    : 1;
517     };
518 
519   struct
520     {
521     unsigned T2CKPS             : 2;
522     unsigned                    : 6;
523     };
524 
525   struct
526     {
527     unsigned                    : 3;
528     unsigned TOUTPS             : 4;
529     unsigned                    : 1;
530     };
531   } __T2CONbits_t;
532 
533 extern __at(0x0012) volatile __T2CONbits_t T2CONbits;
534 
535 #define _T2CKPS0                0x01
536 #define _T2CKPS1                0x02
537 #define _TMR2ON                 0x04
538 #define _TOUTPS0                0x08
539 #define _TOUTPS1                0x10
540 #define _TOUTPS2                0x20
541 #define _TOUTPS3                0x40
542 
543 //==============================================================================
544 
545 extern __at(0x0013) __sfr SSPBUF;
546 
547 //==============================================================================
548 //        SSPCON Bits
549 
550 extern __at(0x0014) __sfr SSPCON;
551 
552 typedef union
553   {
554   struct
555     {
556     unsigned SSPM0              : 1;
557     unsigned SSPM1              : 1;
558     unsigned SSPM2              : 1;
559     unsigned SSPM3              : 1;
560     unsigned CKP                : 1;
561     unsigned SSPEN              : 1;
562     unsigned SSPOV              : 1;
563     unsigned WCOL               : 1;
564     };
565 
566   struct
567     {
568     unsigned SSPM               : 4;
569     unsigned                    : 4;
570     };
571   } __SSPCONbits_t;
572 
573 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
574 
575 #define _SSPM0                  0x01
576 #define _SSPM1                  0x02
577 #define _SSPM2                  0x04
578 #define _SSPM3                  0x08
579 #define _CKP                    0x10
580 #define _SSPEN                  0x20
581 #define _SSPOV                  0x40
582 #define _WCOL                   0x80
583 
584 //==============================================================================
585 
586 extern __at(0x0015) __sfr CCPR1;
587 extern __at(0x0015) __sfr CCPR1L;
588 extern __at(0x0016) __sfr CCPR1H;
589 
590 //==============================================================================
591 //        CCP1CON Bits
592 
593 extern __at(0x0017) __sfr CCP1CON;
594 
595 typedef union
596   {
597   struct
598     {
599     unsigned CCP1M0             : 1;
600     unsigned CCP1M1             : 1;
601     unsigned CCP1M2             : 1;
602     unsigned CCP1M3             : 1;
603     unsigned CCP1Y              : 1;
604     unsigned CCP1X              : 1;
605     unsigned                    : 1;
606     unsigned                    : 1;
607     };
608 
609   struct
610     {
611     unsigned CCP1M              : 4;
612     unsigned                    : 4;
613     };
614   } __CCP1CONbits_t;
615 
616 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits;
617 
618 #define _CCP1M0                 0x01
619 #define _CCP1M1                 0x02
620 #define _CCP1M2                 0x04
621 #define _CCP1M3                 0x08
622 #define _CCP1Y                  0x10
623 #define _CCP1X                  0x20
624 
625 //==============================================================================
626 
627 
628 //==============================================================================
629 //        RCSTA Bits
630 
631 extern __at(0x0018) __sfr RCSTA;
632 
633 typedef union
634   {
635   struct
636     {
637     unsigned RX9D               : 1;
638     unsigned OERR               : 1;
639     unsigned FERR               : 1;
640     unsigned ADDEN              : 1;
641     unsigned CREN               : 1;
642     unsigned SREN               : 1;
643     unsigned RX9                : 1;
644     unsigned SPEN               : 1;
645     };
646 
647   struct
648     {
649     unsigned RCD8               : 1;
650     unsigned                    : 1;
651     unsigned                    : 1;
652     unsigned                    : 1;
653     unsigned                    : 1;
654     unsigned                    : 1;
655     unsigned RC9                : 1;
656     unsigned                    : 1;
657     };
658 
659   struct
660     {
661     unsigned                    : 1;
662     unsigned                    : 1;
663     unsigned                    : 1;
664     unsigned                    : 1;
665     unsigned                    : 1;
666     unsigned                    : 1;
667     unsigned NOT_RC8            : 1;
668     unsigned                    : 1;
669     };
670 
671   struct
672     {
673     unsigned                    : 1;
674     unsigned                    : 1;
675     unsigned                    : 1;
676     unsigned                    : 1;
677     unsigned                    : 1;
678     unsigned                    : 1;
679     unsigned RC8_9              : 1;
680     unsigned                    : 1;
681     };
682   } __RCSTAbits_t;
683 
684 extern __at(0x0018) volatile __RCSTAbits_t RCSTAbits;
685 
686 #define _RX9D                   0x01
687 #define _RCD8                   0x01
688 #define _OERR                   0x02
689 #define _FERR                   0x04
690 #define _ADDEN                  0x08
691 #define _CREN                   0x10
692 #define _SREN                   0x20
693 #define _RX9                    0x40
694 #define _RC9                    0x40
695 #define _NOT_RC8                0x40
696 #define _RC8_9                  0x40
697 #define _SPEN                   0x80
698 
699 //==============================================================================
700 
701 extern __at(0x0019) __sfr TXREG;
702 extern __at(0x001A) __sfr RCREG;
703 extern __at(0x001B) __sfr CCPR2;
704 extern __at(0x001B) __sfr CCPR2L;
705 extern __at(0x001C) __sfr CCPR2H;
706 
707 //==============================================================================
708 //        CCP2CON Bits
709 
710 extern __at(0x001D) __sfr CCP2CON;
711 
712 typedef union
713   {
714   struct
715     {
716     unsigned CCP2M0             : 1;
717     unsigned CCP2M1             : 1;
718     unsigned CCP2M2             : 1;
719     unsigned CCP2M3             : 1;
720     unsigned CCP2Y              : 1;
721     unsigned CCP2X              : 1;
722     unsigned                    : 1;
723     unsigned                    : 1;
724     };
725 
726   struct
727     {
728     unsigned CCP2M              : 4;
729     unsigned                    : 4;
730     };
731   } __CCP2CONbits_t;
732 
733 extern __at(0x001D) volatile __CCP2CONbits_t CCP2CONbits;
734 
735 #define _CCP2M0                 0x01
736 #define _CCP2M1                 0x02
737 #define _CCP2M2                 0x04
738 #define _CCP2M3                 0x08
739 #define _CCP2Y                  0x10
740 #define _CCP2X                  0x20
741 
742 //==============================================================================
743 
744 extern __at(0x001E) __sfr ADRESH;
745 
746 //==============================================================================
747 //        ADCON0 Bits
748 
749 extern __at(0x001F) __sfr ADCON0;
750 
751 typedef union
752   {
753   struct
754     {
755     unsigned ADON               : 1;
756     unsigned CHS3               : 1;
757     unsigned GO_NOT_DONE        : 1;
758     unsigned CHS0               : 1;
759     unsigned CHS1               : 1;
760     unsigned CHS2               : 1;
761     unsigned ADCS0              : 1;
762     unsigned ADCS1              : 1;
763     };
764 
765   struct
766     {
767     unsigned                    : 1;
768     unsigned                    : 1;
769     unsigned GO                 : 1;
770     unsigned                    : 1;
771     unsigned                    : 1;
772     unsigned                    : 1;
773     unsigned                    : 1;
774     unsigned                    : 1;
775     };
776 
777   struct
778     {
779     unsigned                    : 1;
780     unsigned                    : 1;
781     unsigned NOT_DONE           : 1;
782     unsigned                    : 1;
783     unsigned                    : 1;
784     unsigned                    : 1;
785     unsigned                    : 1;
786     unsigned                    : 1;
787     };
788 
789   struct
790     {
791     unsigned                    : 1;
792     unsigned                    : 1;
793     unsigned GO_DONE            : 1;
794     unsigned                    : 1;
795     unsigned                    : 1;
796     unsigned                    : 1;
797     unsigned                    : 1;
798     unsigned                    : 1;
799     };
800 
801   struct
802     {
803     unsigned                    : 6;
804     unsigned ADCS               : 2;
805     };
806   } __ADCON0bits_t;
807 
808 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits;
809 
810 #define _ADON                   0x01
811 #define _CHS3                   0x02
812 #define _GO_NOT_DONE            0x04
813 #define _GO                     0x04
814 #define _NOT_DONE               0x04
815 #define _GO_DONE                0x04
816 #define _CHS0                   0x08
817 #define _CHS1                   0x10
818 #define _CHS2                   0x20
819 #define _ADCS0                  0x40
820 #define _ADCS1                  0x80
821 
822 //==============================================================================
823 
824 
825 //==============================================================================
826 //        OPTION_REG Bits
827 
828 extern __at(0x0081) __sfr OPTION_REG;
829 
830 typedef union
831   {
832   struct
833     {
834     unsigned PS0                : 1;
835     unsigned PS1                : 1;
836     unsigned PS2                : 1;
837     unsigned PSA                : 1;
838     unsigned T0SE               : 1;
839     unsigned T0CS               : 1;
840     unsigned INTEDG             : 1;
841     unsigned NOT_RBPU           : 1;
842     };
843 
844   struct
845     {
846     unsigned PS                 : 3;
847     unsigned                    : 5;
848     };
849   } __OPTION_REGbits_t;
850 
851 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
852 
853 #define _PS0                    0x01
854 #define _PS1                    0x02
855 #define _PS2                    0x04
856 #define _PSA                    0x08
857 #define _T0SE                   0x10
858 #define _T0CS                   0x20
859 #define _INTEDG                 0x40
860 #define _NOT_RBPU               0x80
861 
862 //==============================================================================
863 
864 
865 //==============================================================================
866 //        TRISA Bits
867 
868 extern __at(0x0085) __sfr TRISA;
869 
870 typedef struct
871   {
872   unsigned TRISA0               : 1;
873   unsigned TRISA1               : 1;
874   unsigned TRISA2               : 1;
875   unsigned TRISA3               : 1;
876   unsigned TRISA4               : 1;
877   unsigned TRISA5               : 1;
878   unsigned TRISA6               : 1;
879   unsigned TRISA7               : 1;
880   } __TRISAbits_t;
881 
882 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
883 
884 #define _TRISA0                 0x01
885 #define _TRISA1                 0x02
886 #define _TRISA2                 0x04
887 #define _TRISA3                 0x08
888 #define _TRISA4                 0x10
889 #define _TRISA5                 0x20
890 #define _TRISA6                 0x40
891 #define _TRISA7                 0x80
892 
893 //==============================================================================
894 
895 
896 //==============================================================================
897 //        TRISB Bits
898 
899 extern __at(0x0086) __sfr TRISB;
900 
901 typedef struct
902   {
903   unsigned TRISB0               : 1;
904   unsigned TRISB1               : 1;
905   unsigned TRISB2               : 1;
906   unsigned TRISB3               : 1;
907   unsigned TRISB4               : 1;
908   unsigned TRISB5               : 1;
909   unsigned TRISB6               : 1;
910   unsigned TRISB7               : 1;
911   } __TRISBbits_t;
912 
913 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
914 
915 #define _TRISB0                 0x01
916 #define _TRISB1                 0x02
917 #define _TRISB2                 0x04
918 #define _TRISB3                 0x08
919 #define _TRISB4                 0x10
920 #define _TRISB5                 0x20
921 #define _TRISB6                 0x40
922 #define _TRISB7                 0x80
923 
924 //==============================================================================
925 
926 
927 //==============================================================================
928 //        TRISC Bits
929 
930 extern __at(0x0087) __sfr TRISC;
931 
932 typedef struct
933   {
934   unsigned TRISC0               : 1;
935   unsigned TRISC1               : 1;
936   unsigned TRISC2               : 1;
937   unsigned TRISC3               : 1;
938   unsigned TRISC4               : 1;
939   unsigned TRISC5               : 1;
940   unsigned TRISC6               : 1;
941   unsigned TRISC7               : 1;
942   } __TRISCbits_t;
943 
944 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
945 
946 #define _TRISC0                 0x01
947 #define _TRISC1                 0x02
948 #define _TRISC2                 0x04
949 #define _TRISC3                 0x08
950 #define _TRISC4                 0x10
951 #define _TRISC5                 0x20
952 #define _TRISC6                 0x40
953 #define _TRISC7                 0x80
954 
955 //==============================================================================
956 
957 
958 //==============================================================================
959 //        TRISD Bits
960 
961 extern __at(0x0088) __sfr TRISD;
962 
963 typedef struct
964   {
965   unsigned TRISD0               : 1;
966   unsigned TRISD1               : 1;
967   unsigned TRISD2               : 1;
968   unsigned TRISD3               : 1;
969   unsigned TRISD4               : 1;
970   unsigned TRISD5               : 1;
971   unsigned TRISD6               : 1;
972   unsigned TRISD7               : 1;
973   } __TRISDbits_t;
974 
975 extern __at(0x0088) volatile __TRISDbits_t TRISDbits;
976 
977 #define _TRISD0                 0x01
978 #define _TRISD1                 0x02
979 #define _TRISD2                 0x04
980 #define _TRISD3                 0x08
981 #define _TRISD4                 0x10
982 #define _TRISD5                 0x20
983 #define _TRISD6                 0x40
984 #define _TRISD7                 0x80
985 
986 //==============================================================================
987 
988 
989 //==============================================================================
990 //        TRISE Bits
991 
992 extern __at(0x0089) __sfr TRISE;
993 
994 typedef union
995   {
996   struct
997     {
998     unsigned TRISE0             : 1;
999     unsigned TRISE1             : 1;
1000     unsigned TRISE2             : 1;
1001     unsigned TRISE3             : 1;
1002     unsigned PSPMODE            : 1;
1003     unsigned IBOV               : 1;
1004     unsigned OBF                : 1;
1005     unsigned IBF                : 1;
1006     };
1007 
1008   struct
1009     {
1010     unsigned TRISE              : 4;
1011     unsigned                    : 4;
1012     };
1013   } __TRISEbits_t;
1014 
1015 extern __at(0x0089) volatile __TRISEbits_t TRISEbits;
1016 
1017 #define _TRISE0                 0x01
1018 #define _TRISE1                 0x02
1019 #define _TRISE2                 0x04
1020 #define _TRISE3                 0x08
1021 #define _PSPMODE                0x10
1022 #define _IBOV                   0x20
1023 #define _OBF                    0x40
1024 #define _IBF                    0x80
1025 
1026 //==============================================================================
1027 
1028 
1029 //==============================================================================
1030 //        PIE1 Bits
1031 
1032 extern __at(0x008C) __sfr PIE1;
1033 
1034 typedef struct
1035   {
1036   unsigned TMR1IE               : 1;
1037   unsigned TMR2IE               : 1;
1038   unsigned CCP1IE               : 1;
1039   unsigned SSPIE                : 1;
1040   unsigned TXIE                 : 1;
1041   unsigned RCIE                 : 1;
1042   unsigned ADIE                 : 1;
1043   unsigned PSPIE                : 1;
1044   } __PIE1bits_t;
1045 
1046 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
1047 
1048 #define _TMR1IE                 0x01
1049 #define _TMR2IE                 0x02
1050 #define _CCP1IE                 0x04
1051 #define _SSPIE                  0x08
1052 #define _TXIE                   0x10
1053 #define _RCIE                   0x20
1054 #define _ADIE                   0x40
1055 #define _PSPIE                  0x80
1056 
1057 //==============================================================================
1058 
1059 
1060 //==============================================================================
1061 //        PIE2 Bits
1062 
1063 extern __at(0x008D) __sfr PIE2;
1064 
1065 typedef struct
1066   {
1067   unsigned CCP2IE               : 1;
1068   unsigned CCP3IE               : 1;
1069   unsigned                      : 1;
1070   unsigned BCLIE                : 1;
1071   unsigned                      : 1;
1072   unsigned LVDIE                : 1;
1073   unsigned CMIE                 : 1;
1074   unsigned OSFIE                : 1;
1075   } __PIE2bits_t;
1076 
1077 extern __at(0x008D) volatile __PIE2bits_t PIE2bits;
1078 
1079 #define _CCP2IE                 0x01
1080 #define _CCP3IE                 0x02
1081 #define _BCLIE                  0x08
1082 #define _LVDIE                  0x20
1083 #define _CMIE                   0x40
1084 #define _OSFIE                  0x80
1085 
1086 //==============================================================================
1087 
1088 
1089 //==============================================================================
1090 //        PCON Bits
1091 
1092 extern __at(0x008E) __sfr PCON;
1093 
1094 typedef union
1095   {
1096   struct
1097     {
1098     unsigned NOT_BOR            : 1;
1099     unsigned NOT_POR            : 1;
1100     unsigned SBOREN             : 1;
1101     unsigned                    : 1;
1102     unsigned                    : 1;
1103     unsigned                    : 1;
1104     unsigned                    : 1;
1105     unsigned                    : 1;
1106     };
1107 
1108   struct
1109     {
1110     unsigned NOT_BO             : 1;
1111     unsigned                    : 1;
1112     unsigned                    : 1;
1113     unsigned                    : 1;
1114     unsigned                    : 1;
1115     unsigned                    : 1;
1116     unsigned                    : 1;
1117     unsigned                    : 1;
1118     };
1119   } __PCONbits_t;
1120 
1121 extern __at(0x008E) volatile __PCONbits_t PCONbits;
1122 
1123 #define _NOT_BOR                0x01
1124 #define _NOT_BO                 0x01
1125 #define _NOT_POR                0x02
1126 #define _SBOREN                 0x04
1127 
1128 //==============================================================================
1129 
1130 
1131 //==============================================================================
1132 //        OSCCON Bits
1133 
1134 extern __at(0x008F) __sfr OSCCON;
1135 
1136 typedef union
1137   {
1138   struct
1139     {
1140     unsigned SCS0               : 1;
1141     unsigned SCS1               : 1;
1142     unsigned IOFS               : 1;
1143     unsigned OSTS               : 1;
1144     unsigned IRCF0              : 1;
1145     unsigned IRCF1              : 1;
1146     unsigned IRCF2              : 1;
1147     unsigned                    : 1;
1148     };
1149 
1150   struct
1151     {
1152     unsigned SCS                : 2;
1153     unsigned                    : 6;
1154     };
1155 
1156   struct
1157     {
1158     unsigned                    : 4;
1159     unsigned IRCF               : 3;
1160     unsigned                    : 1;
1161     };
1162   } __OSCCONbits_t;
1163 
1164 extern __at(0x008F) volatile __OSCCONbits_t OSCCONbits;
1165 
1166 #define _SCS0                   0x01
1167 #define _SCS1                   0x02
1168 #define _IOFS                   0x04
1169 #define _OSTS                   0x08
1170 #define _IRCF0                  0x10
1171 #define _IRCF1                  0x20
1172 #define _IRCF2                  0x40
1173 
1174 //==============================================================================
1175 
1176 
1177 //==============================================================================
1178 //        OSCTUNE Bits
1179 
1180 extern __at(0x0090) __sfr OSCTUNE;
1181 
1182 typedef union
1183   {
1184   struct
1185     {
1186     unsigned TUN0               : 1;
1187     unsigned TUN1               : 1;
1188     unsigned TUN2               : 1;
1189     unsigned TUN3               : 1;
1190     unsigned TUN4               : 1;
1191     unsigned TUN5               : 1;
1192     unsigned                    : 1;
1193     unsigned                    : 1;
1194     };
1195 
1196   struct
1197     {
1198     unsigned TUN                : 6;
1199     unsigned                    : 2;
1200     };
1201   } __OSCTUNEbits_t;
1202 
1203 extern __at(0x0090) volatile __OSCTUNEbits_t OSCTUNEbits;
1204 
1205 #define _TUN0                   0x01
1206 #define _TUN1                   0x02
1207 #define _TUN2                   0x04
1208 #define _TUN3                   0x08
1209 #define _TUN4                   0x10
1210 #define _TUN5                   0x20
1211 
1212 //==============================================================================
1213 
1214 
1215 //==============================================================================
1216 //        SSPCON2 Bits
1217 
1218 extern __at(0x0091) __sfr SSPCON2;
1219 
1220 typedef struct
1221   {
1222   unsigned SEN                  : 1;
1223   unsigned RSEN                 : 1;
1224   unsigned PEN                  : 1;
1225   unsigned RCEN                 : 1;
1226   unsigned ACKEN                : 1;
1227   unsigned ACKDT                : 1;
1228   unsigned ACKSTAT              : 1;
1229   unsigned GCEN                 : 1;
1230   } __SSPCON2bits_t;
1231 
1232 extern __at(0x0091) volatile __SSPCON2bits_t SSPCON2bits;
1233 
1234 #define _SEN                    0x01
1235 #define _RSEN                   0x02
1236 #define _PEN                    0x04
1237 #define _RCEN                   0x08
1238 #define _ACKEN                  0x10
1239 #define _ACKDT                  0x20
1240 #define _ACKSTAT                0x40
1241 #define _GCEN                   0x80
1242 
1243 //==============================================================================
1244 
1245 extern __at(0x0092) __sfr PR2;
1246 extern __at(0x0093) __sfr SSPADD;
1247 
1248 //==============================================================================
1249 //        SSPSTAT Bits
1250 
1251 extern __at(0x0094) __sfr SSPSTAT;
1252 
1253 typedef union
1254   {
1255   struct
1256     {
1257     unsigned BF                 : 1;
1258     unsigned UA                 : 1;
1259     unsigned R_NOT_W            : 1;
1260     unsigned S                  : 1;
1261     unsigned P                  : 1;
1262     unsigned D_NOT_A            : 1;
1263     unsigned CKE                : 1;
1264     unsigned SMP                : 1;
1265     };
1266 
1267   struct
1268     {
1269     unsigned                    : 1;
1270     unsigned                    : 1;
1271     unsigned R                  : 1;
1272     unsigned I2C_START          : 1;
1273     unsigned I2C_STOP           : 1;
1274     unsigned D                  : 1;
1275     unsigned                    : 1;
1276     unsigned                    : 1;
1277     };
1278 
1279   struct
1280     {
1281     unsigned                    : 1;
1282     unsigned                    : 1;
1283     unsigned I2C_READ           : 1;
1284     unsigned                    : 1;
1285     unsigned                    : 1;
1286     unsigned I2C_DATA           : 1;
1287     unsigned                    : 1;
1288     unsigned                    : 1;
1289     };
1290 
1291   struct
1292     {
1293     unsigned                    : 1;
1294     unsigned                    : 1;
1295     unsigned NOT_W              : 1;
1296     unsigned                    : 1;
1297     unsigned                    : 1;
1298     unsigned NOT_A              : 1;
1299     unsigned                    : 1;
1300     unsigned                    : 1;
1301     };
1302 
1303   struct
1304     {
1305     unsigned                    : 1;
1306     unsigned                    : 1;
1307     unsigned NOT_WRITE          : 1;
1308     unsigned                    : 1;
1309     unsigned                    : 1;
1310     unsigned NOT_ADDRESS        : 1;
1311     unsigned                    : 1;
1312     unsigned                    : 1;
1313     };
1314 
1315   struct
1316     {
1317     unsigned                    : 1;
1318     unsigned                    : 1;
1319     unsigned R_W                : 1;
1320     unsigned                    : 1;
1321     unsigned                    : 1;
1322     unsigned D_A                : 1;
1323     unsigned                    : 1;
1324     unsigned                    : 1;
1325     };
1326 
1327   struct
1328     {
1329     unsigned                    : 1;
1330     unsigned                    : 1;
1331     unsigned READ_WRITE         : 1;
1332     unsigned                    : 1;
1333     unsigned                    : 1;
1334     unsigned DATA_ADDRESS       : 1;
1335     unsigned                    : 1;
1336     unsigned                    : 1;
1337     };
1338   } __SSPSTATbits_t;
1339 
1340 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
1341 
1342 #define _BF                     0x01
1343 #define _UA                     0x02
1344 #define _R_NOT_W                0x04
1345 #define _R                      0x04
1346 #define _I2C_READ               0x04
1347 #define _NOT_W                  0x04
1348 #define _NOT_WRITE              0x04
1349 #define _R_W                    0x04
1350 #define _READ_WRITE             0x04
1351 #define _S                      0x08
1352 #define _I2C_START              0x08
1353 #define _P                      0x10
1354 #define _I2C_STOP               0x10
1355 #define _D_NOT_A                0x20
1356 #define _D                      0x20
1357 #define _I2C_DATA               0x20
1358 #define _NOT_A                  0x20
1359 #define _NOT_ADDRESS            0x20
1360 #define _D_A                    0x20
1361 #define _DATA_ADDRESS           0x20
1362 #define _CKE                    0x40
1363 #define _SMP                    0x80
1364 
1365 //==============================================================================
1366 
1367 extern __at(0x0095) __sfr CCPR3;
1368 extern __at(0x0095) __sfr CCPR3L;
1369 extern __at(0x0096) __sfr CCPR3H;
1370 
1371 //==============================================================================
1372 //        CCP3CON Bits
1373 
1374 extern __at(0x0097) __sfr CCP3CON;
1375 
1376 typedef union
1377   {
1378   struct
1379     {
1380     unsigned CCP3M0             : 1;
1381     unsigned CCP3M1             : 1;
1382     unsigned CCP3M2             : 1;
1383     unsigned CCP3M3             : 1;
1384     unsigned CCP3Y              : 1;
1385     unsigned CCP3X              : 1;
1386     unsigned                    : 1;
1387     unsigned                    : 1;
1388     };
1389 
1390   struct
1391     {
1392     unsigned CCP3M              : 4;
1393     unsigned                    : 4;
1394     };
1395   } __CCP3CONbits_t;
1396 
1397 extern __at(0x0097) volatile __CCP3CONbits_t CCP3CONbits;
1398 
1399 #define _CCP3M0                 0x01
1400 #define _CCP3M1                 0x02
1401 #define _CCP3M2                 0x04
1402 #define _CCP3M3                 0x08
1403 #define _CCP3Y                  0x10
1404 #define _CCP3X                  0x20
1405 
1406 //==============================================================================
1407 
1408 
1409 //==============================================================================
1410 //        TXSTA Bits
1411 
1412 extern __at(0x0098) __sfr TXSTA;
1413 
1414 typedef union
1415   {
1416   struct
1417     {
1418     unsigned TX9D               : 1;
1419     unsigned TRMT               : 1;
1420     unsigned BRGH               : 1;
1421     unsigned                    : 1;
1422     unsigned SYNC               : 1;
1423     unsigned TXEN               : 1;
1424     unsigned TX9                : 1;
1425     unsigned CSRC               : 1;
1426     };
1427 
1428   struct
1429     {
1430     unsigned TXD8               : 1;
1431     unsigned                    : 1;
1432     unsigned                    : 1;
1433     unsigned                    : 1;
1434     unsigned                    : 1;
1435     unsigned                    : 1;
1436     unsigned NOT_TX8            : 1;
1437     unsigned                    : 1;
1438     };
1439 
1440   struct
1441     {
1442     unsigned                    : 1;
1443     unsigned                    : 1;
1444     unsigned                    : 1;
1445     unsigned                    : 1;
1446     unsigned                    : 1;
1447     unsigned                    : 1;
1448     unsigned TX8_9              : 1;
1449     unsigned                    : 1;
1450     };
1451   } __TXSTAbits_t;
1452 
1453 extern __at(0x0098) volatile __TXSTAbits_t TXSTAbits;
1454 
1455 #define _TX9D                   0x01
1456 #define _TXD8                   0x01
1457 #define _TRMT                   0x02
1458 #define _BRGH                   0x04
1459 #define _SYNC                   0x10
1460 #define _TXEN                   0x20
1461 #define _TX9                    0x40
1462 #define _NOT_TX8                0x40
1463 #define _TX8_9                  0x40
1464 #define _CSRC                   0x80
1465 
1466 //==============================================================================
1467 
1468 extern __at(0x0099) __sfr SPBRG;
1469 
1470 //==============================================================================
1471 //        ADCON2 Bits
1472 
1473 extern __at(0x009B) __sfr ADCON2;
1474 
1475 typedef union
1476   {
1477   struct
1478     {
1479     unsigned                    : 1;
1480     unsigned                    : 1;
1481     unsigned                    : 1;
1482     unsigned ACQT0              : 1;
1483     unsigned ACQT1              : 1;
1484     unsigned ACQT2              : 1;
1485     unsigned                    : 1;
1486     unsigned                    : 1;
1487     };
1488 
1489   struct
1490     {
1491     unsigned                    : 3;
1492     unsigned ACQT               : 3;
1493     unsigned                    : 2;
1494     };
1495   } __ADCON2bits_t;
1496 
1497 extern __at(0x009B) volatile __ADCON2bits_t ADCON2bits;
1498 
1499 #define _ACQT0                  0x08
1500 #define _ACQT1                  0x10
1501 #define _ACQT2                  0x20
1502 
1503 //==============================================================================
1504 
1505 
1506 //==============================================================================
1507 //        CMCON Bits
1508 
1509 extern __at(0x009C) __sfr CMCON;
1510 
1511 typedef union
1512   {
1513   struct
1514     {
1515     unsigned CM0                : 1;
1516     unsigned CM1                : 1;
1517     unsigned CM2                : 1;
1518     unsigned CIS                : 1;
1519     unsigned C1INV              : 1;
1520     unsigned C2INV              : 1;
1521     unsigned C1OUT              : 1;
1522     unsigned C2OUT              : 1;
1523     };
1524 
1525   struct
1526     {
1527     unsigned CM                 : 3;
1528     unsigned                    : 5;
1529     };
1530   } __CMCONbits_t;
1531 
1532 extern __at(0x009C) volatile __CMCONbits_t CMCONbits;
1533 
1534 #define _CM0                    0x01
1535 #define _CM1                    0x02
1536 #define _CM2                    0x04
1537 #define _CIS                    0x08
1538 #define _C1INV                  0x10
1539 #define _C2INV                  0x20
1540 #define _C1OUT                  0x40
1541 #define _C2OUT                  0x80
1542 
1543 //==============================================================================
1544 
1545 
1546 //==============================================================================
1547 //        CVRCON Bits
1548 
1549 extern __at(0x009D) __sfr CVRCON;
1550 
1551 typedef union
1552   {
1553   struct
1554     {
1555     unsigned CVR0               : 1;
1556     unsigned CVR1               : 1;
1557     unsigned CVR2               : 1;
1558     unsigned CVR3               : 1;
1559     unsigned                    : 1;
1560     unsigned CVRR               : 1;
1561     unsigned CVROE              : 1;
1562     unsigned CVREN              : 1;
1563     };
1564 
1565   struct
1566     {
1567     unsigned CVR                : 4;
1568     unsigned                    : 4;
1569     };
1570   } __CVRCONbits_t;
1571 
1572 extern __at(0x009D) volatile __CVRCONbits_t CVRCONbits;
1573 
1574 #define _CVR0                   0x01
1575 #define _CVR1                   0x02
1576 #define _CVR2                   0x04
1577 #define _CVR3                   0x08
1578 #define _CVRR                   0x20
1579 #define _CVROE                  0x40
1580 #define _CVREN                  0x80
1581 
1582 //==============================================================================
1583 
1584 extern __at(0x009E) __sfr ADRESL;
1585 
1586 //==============================================================================
1587 //        ADCON1 Bits
1588 
1589 extern __at(0x009F) __sfr ADCON1;
1590 
1591 typedef union
1592   {
1593   struct
1594     {
1595     unsigned PCFG0              : 1;
1596     unsigned PCFG1              : 1;
1597     unsigned PCFG2              : 1;
1598     unsigned PCFG3              : 1;
1599     unsigned VCFG0              : 1;
1600     unsigned VCFG1              : 1;
1601     unsigned ADCS2              : 1;
1602     unsigned ADFM               : 1;
1603     };
1604 
1605   struct
1606     {
1607     unsigned PCFG               : 4;
1608     unsigned                    : 4;
1609     };
1610 
1611   struct
1612     {
1613     unsigned                    : 4;
1614     unsigned VCFG               : 2;
1615     unsigned                    : 2;
1616     };
1617   } __ADCON1bits_t;
1618 
1619 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits;
1620 
1621 #define _PCFG0                  0x01
1622 #define _PCFG1                  0x02
1623 #define _PCFG2                  0x04
1624 #define _PCFG3                  0x08
1625 #define _VCFG0                  0x10
1626 #define _VCFG1                  0x20
1627 #define _ADCS2                  0x40
1628 #define _ADFM                   0x80
1629 
1630 //==============================================================================
1631 
1632 
1633 //==============================================================================
1634 //        WDTCON Bits
1635 
1636 extern __at(0x0105) __sfr WDTCON;
1637 
1638 typedef union
1639   {
1640   struct
1641     {
1642     unsigned SWDTEN             : 1;
1643     unsigned WDTPS0             : 1;
1644     unsigned WDTPS1             : 1;
1645     unsigned WDTPS2             : 1;
1646     unsigned WDTPS3             : 1;
1647     unsigned                    : 1;
1648     unsigned                    : 1;
1649     unsigned                    : 1;
1650     };
1651 
1652   struct
1653     {
1654     unsigned SWDTE              : 1;
1655     unsigned                    : 1;
1656     unsigned                    : 1;
1657     unsigned                    : 1;
1658     unsigned                    : 1;
1659     unsigned                    : 1;
1660     unsigned                    : 1;
1661     unsigned                    : 1;
1662     };
1663 
1664   struct
1665     {
1666     unsigned                    : 1;
1667     unsigned WDTPS              : 4;
1668     unsigned                    : 3;
1669     };
1670   } __WDTCONbits_t;
1671 
1672 extern __at(0x0105) volatile __WDTCONbits_t WDTCONbits;
1673 
1674 #define _SWDTEN                 0x01
1675 #define _SWDTE                  0x01
1676 #define _WDTPS0                 0x02
1677 #define _WDTPS1                 0x04
1678 #define _WDTPS2                 0x08
1679 #define _WDTPS3                 0x10
1680 
1681 //==============================================================================
1682 
1683 
1684 //==============================================================================
1685 //        LVDCON Bits
1686 
1687 extern __at(0x0109) __sfr LVDCON;
1688 
1689 typedef union
1690   {
1691   struct
1692     {
1693     unsigned LVDL0              : 1;
1694     unsigned LVDL1              : 1;
1695     unsigned LVDL2              : 1;
1696     unsigned LVDL3              : 1;
1697     unsigned LVDEN              : 1;
1698     unsigned IRVST              : 1;
1699     unsigned                    : 1;
1700     unsigned                    : 1;
1701     };
1702 
1703   struct
1704     {
1705     unsigned LVDL               : 4;
1706     unsigned                    : 4;
1707     };
1708   } __LVDCONbits_t;
1709 
1710 extern __at(0x0109) volatile __LVDCONbits_t LVDCONbits;
1711 
1712 #define _LVDL0                  0x01
1713 #define _LVDL1                  0x02
1714 #define _LVDL2                  0x04
1715 #define _LVDL3                  0x08
1716 #define _LVDEN                  0x10
1717 #define _IRVST                  0x20
1718 
1719 //==============================================================================
1720 
1721 extern __at(0x010C) __sfr PMDATA;
1722 extern __at(0x010D) __sfr PMADR;
1723 extern __at(0x010E) __sfr PMDATH;
1724 extern __at(0x010F) __sfr PMADRH;
1725 
1726 //==============================================================================
1727 //        PMCON1 Bits
1728 
1729 extern __at(0x018C) __sfr PMCON1;
1730 
1731 typedef struct
1732   {
1733   unsigned RD                   : 1;
1734   unsigned                      : 1;
1735   unsigned                      : 1;
1736   unsigned                      : 1;
1737   unsigned                      : 1;
1738   unsigned                      : 1;
1739   unsigned                      : 1;
1740   unsigned                      : 1;
1741   } __PMCON1bits_t;
1742 
1743 extern __at(0x018C) volatile __PMCON1bits_t PMCON1bits;
1744 
1745 #define _RD                     0x01
1746 
1747 //==============================================================================
1748 
1749 
1750 //==============================================================================
1751 //
1752 //        Configuration Bits
1753 //
1754 //==============================================================================
1755 
1756 #define _CONFIG1                0x2007
1757 #define _CONFIG2                0x2008
1758 
1759 //----------------------------- CONFIG1 Options -------------------------------
1760 
1761 #define _FOSC_LP                0x3FEC  // LP oscillator.
1762 #define _LP_OSC                 0x3FEC  // LP oscillator.
1763 #define _FOSC_XT                0x3FED  // XT oscillator.
1764 #define _XT_OSC                 0x3FED  // XT oscillator.
1765 #define _FOSC_HS                0x3FEE  // HS oscillator.
1766 #define _HS_OSC                 0x3FEE  // HS oscillator.
1767 #define _FOSC_EC                0x3FEF  // EXTCLK; port I/O function on OSC2/CLKO/RA6.
1768 #define _EXTCLK                 0x3FEF  // EXTCLK; port I/O function on OSC2/CLKO/RA6.
1769 #define _FOSC_INTOSCIO          0x3FFC  // INTRC oscillator; port I/O function on OSC1/CLKI/RA7 and OSC2/CLKO/RA6.
1770 #define _INTRC_IO               0x3FFC  // INTRC oscillator; port I/O function on OSC1/CLKI/RA7 and OSC2/CLKO/RA6.
1771 #define _FOSC_INTOSCCLK         0x3FFD  // INTRC oscillator; CLKO function on OSC2/CLKO/RA6 and port I/O function on OSC1/CLKI/RA7.
1772 #define _INTRC_CLKOUT           0x3FFD  // INTRC oscillator; CLKO function on OSC2/CLKO/RA6 and port I/O function on OSC1/CLKI/RA7.
1773 #define _FOSC_EXTRCIO           0x3FFE  // EXTRC oscillator; port I/O function on OSC2/CLKO/RA6.
1774 #define _EXTRC_IO               0x3FFE  // EXTRC oscillator; port I/O function on OSC2/CLKO/RA6.
1775 #define _FOSC_EXTRCCLK          0x3FFF  // EXTRC oscillator; CLKO function on OSC2/CLKO/RA6.
1776 #define _EXTRC_CLKOUT           0x3FFF  // EXTRC oscillator; CLKO function on OSC2/CLKO/RA6.
1777 #define _WDTE_OFF               0x3FFB  // WDT disabled.
1778 #define _WDT_OFF                0x3FFB  // WDT disabled.
1779 #define _WDTE_ON                0x3FFF  // WDT enabled.
1780 #define _WDT_ON                 0x3FFF  // WDT enabled.
1781 #define _PWRTE_ON               0x3FF7  // PWRT enabled.
1782 #define _PWRTE_OFF              0x3FFF  // PWRT disabled.
1783 #define _MCLRE_OFF              0x3FDF  // MCLR/VPP/RE3 pin function is digital input only, MCLR gated to '1'.
1784 #define _MCLR_OFF               0x3FDF  // MCLR/VPP/RE3 pin function is digital input only, MCLR gated to '1'.
1785 #define _MCLRE_ON               0x3FFF  // MCLR/VPP/RE3 pin function is MCLR.
1786 #define _MCLR_ON                0x3FFF  // MCLR/VPP/RE3 pin function is MCLR.
1787 #define _BOREN_OFF              0x3FBF  // Disabled.
1788 #define _BOREN_0                0x3FBF  // Disabled.
1789 #define _BOREN_ON               0x3FFF  // Enabled.
1790 #define _BOREN_1                0x3FFF  // Enabled.
1791 #define _BORV_45                0x3E7F  // VBOR set to 4.5V.
1792 #define _VBOR_4_5               0x3E7F  // VBOR set to 4.5V.
1793 #define _BORV_42                0x3EFF  // VBOR set to 4.2V.
1794 #define _VBOR_4_2               0x3EFF  // VBOR set to 4.2V.
1795 #define _BORV_27                0x3F7F  // VBOR set to 2.7V.
1796 #define _VBOR_2_7               0x3F7F  // VBOR set to 2.7V.
1797 #define _BORV_20                0x3FFF  // VBOR set to 2.0V.
1798 #define _VBOR_2_0               0x3FFF  // VBOR set to 2.0V.
1799 #define _DEBUG_ON               0x37FF  // In-Circuit Debugger enabled, RB6 and RB7 are dedicated to the debugger.
1800 #define _DEBUG_OFF              0x3FFF  // In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins.
1801 #define _CCP2MX_RB3             0x2FFF  // CCP2 is on RB3.
1802 #define _CCP2_RB3               0x2FFF  // CCP2 is on RB3.
1803 #define _CCP2MX_RC1             0x3FFF  // CCP2 is on RC1.
1804 #define _CCP2_RC1               0x3FFF  // CCP2 is on RC1.
1805 #define _CP_ON                  0x1FFF  // 0000h to 1FFFh code-protected.
1806 #define _CP_ALL                 0x1FFF  // 0000h to 1FFFh code-protected.
1807 #define _CP_OFF                 0x3FFF  // Code protection off.
1808 
1809 //----------------------------- CONFIG2 Options -------------------------------
1810 
1811 #define _FCMEN_OFF              0x3FFE  // Fail-Safe Clock Monitor disabled.
1812 #define _FCMEN_ON               0x3FFF  // Fail-Safe Clock Monitor enabled.
1813 #define _IESO_OFF               0x3FFD  // Internal External Switchover mode disabled.
1814 #define _IESO_ON                0x3FFF  // Internal External Switchover mode enabled.
1815 #define _BORSEN_OFF             0x3FBF  // Disabled.
1816 #define _BORSEN_0               0x3FBF  // Disabled.
1817 #define _BORSEN_ON              0x3FFF  // Enabled.
1818 #define _BORSEN_1               0x3FFF  // Enabled.
1819 
1820 //==============================================================================
1821 
1822 #define _DEVID1                 0x2006
1823 
1824 #define _IDLOC0                 0x2000
1825 #define _IDLOC1                 0x2001
1826 #define _IDLOC2                 0x2002
1827 #define _IDLOC3                 0x2003
1828 
1829 //==============================================================================
1830 
1831 #ifndef NO_BIT_DEFINES
1832 
1833 #define ADON                    ADCON0bits.ADON                 // bit 0
1834 #define CHS3                    ADCON0bits.CHS3                 // bit 1
1835 #define GO_NOT_DONE             ADCON0bits.GO_NOT_DONE          // bit 2, shadows bit in ADCON0bits
1836 #define GO                      ADCON0bits.GO                   // bit 2, shadows bit in ADCON0bits
1837 #define NOT_DONE                ADCON0bits.NOT_DONE             // bit 2, shadows bit in ADCON0bits
1838 #define GO_DONE                 ADCON0bits.GO_DONE              // bit 2, shadows bit in ADCON0bits
1839 #define CHS0                    ADCON0bits.CHS0                 // bit 3
1840 #define CHS1                    ADCON0bits.CHS1                 // bit 4
1841 #define CHS2                    ADCON0bits.CHS2                 // bit 5
1842 #define ADCS0                   ADCON0bits.ADCS0                // bit 6
1843 #define ADCS1                   ADCON0bits.ADCS1                // bit 7
1844 
1845 #define PCFG0                   ADCON1bits.PCFG0                // bit 0
1846 #define PCFG1                   ADCON1bits.PCFG1                // bit 1
1847 #define PCFG2                   ADCON1bits.PCFG2                // bit 2
1848 #define PCFG3                   ADCON1bits.PCFG3                // bit 3
1849 #define VCFG0                   ADCON1bits.VCFG0                // bit 4
1850 #define VCFG1                   ADCON1bits.VCFG1                // bit 5
1851 #define ADCS2                   ADCON1bits.ADCS2                // bit 6
1852 #define ADFM                    ADCON1bits.ADFM                 // bit 7
1853 
1854 #define ACQT0                   ADCON2bits.ACQT0                // bit 3
1855 #define ACQT1                   ADCON2bits.ACQT1                // bit 4
1856 #define ACQT2                   ADCON2bits.ACQT2                // bit 5
1857 
1858 #define CCP1M0                  CCP1CONbits.CCP1M0              // bit 0
1859 #define CCP1M1                  CCP1CONbits.CCP1M1              // bit 1
1860 #define CCP1M2                  CCP1CONbits.CCP1M2              // bit 2
1861 #define CCP1M3                  CCP1CONbits.CCP1M3              // bit 3
1862 #define CCP1Y                   CCP1CONbits.CCP1Y               // bit 4
1863 #define CCP1X                   CCP1CONbits.CCP1X               // bit 5
1864 
1865 #define CCP2M0                  CCP2CONbits.CCP2M0              // bit 0
1866 #define CCP2M1                  CCP2CONbits.CCP2M1              // bit 1
1867 #define CCP2M2                  CCP2CONbits.CCP2M2              // bit 2
1868 #define CCP2M3                  CCP2CONbits.CCP2M3              // bit 3
1869 #define CCP2Y                   CCP2CONbits.CCP2Y               // bit 4
1870 #define CCP2X                   CCP2CONbits.CCP2X               // bit 5
1871 
1872 #define CCP3M0                  CCP3CONbits.CCP3M0              // bit 0
1873 #define CCP3M1                  CCP3CONbits.CCP3M1              // bit 1
1874 #define CCP3M2                  CCP3CONbits.CCP3M2              // bit 2
1875 #define CCP3M3                  CCP3CONbits.CCP3M3              // bit 3
1876 #define CCP3Y                   CCP3CONbits.CCP3Y               // bit 4
1877 #define CCP3X                   CCP3CONbits.CCP3X               // bit 5
1878 
1879 #define CM0                     CMCONbits.CM0                   // bit 0
1880 #define CM1                     CMCONbits.CM1                   // bit 1
1881 #define CM2                     CMCONbits.CM2                   // bit 2
1882 #define CIS                     CMCONbits.CIS                   // bit 3
1883 #define C1INV                   CMCONbits.C1INV                 // bit 4
1884 #define C2INV                   CMCONbits.C2INV                 // bit 5
1885 #define C1OUT                   CMCONbits.C1OUT                 // bit 6
1886 #define C2OUT                   CMCONbits.C2OUT                 // bit 7
1887 
1888 #define CVR0                    CVRCONbits.CVR0                 // bit 0
1889 #define CVR1                    CVRCONbits.CVR1                 // bit 1
1890 #define CVR2                    CVRCONbits.CVR2                 // bit 2
1891 #define CVR3                    CVRCONbits.CVR3                 // bit 3
1892 #define CVRR                    CVRCONbits.CVRR                 // bit 5
1893 #define CVROE                   CVRCONbits.CVROE                // bit 6
1894 #define CVREN                   CVRCONbits.CVREN                // bit 7
1895 
1896 #define RBIF                    INTCONbits.RBIF                 // bit 0
1897 #define INTF                    INTCONbits.INTF                 // bit 1, shadows bit in INTCONbits
1898 #define INT0IF                  INTCONbits.INT0IF               // bit 1, shadows bit in INTCONbits
1899 #define TMR0IF                  INTCONbits.TMR0IF               // bit 2, shadows bit in INTCONbits
1900 #define T0IF                    INTCONbits.T0IF                 // bit 2, shadows bit in INTCONbits
1901 #define RBIE                    INTCONbits.RBIE                 // bit 3
1902 #define INTE                    INTCONbits.INTE                 // bit 4, shadows bit in INTCONbits
1903 #define INT0IE                  INTCONbits.INT0IE               // bit 4, shadows bit in INTCONbits
1904 #define TMR0IE                  INTCONbits.TMR0IE               // bit 5, shadows bit in INTCONbits
1905 #define T0IE                    INTCONbits.T0IE                 // bit 5, shadows bit in INTCONbits
1906 #define PEIE                    INTCONbits.PEIE                 // bit 6
1907 #define GIE                     INTCONbits.GIE                  // bit 7
1908 
1909 #define LVDL0                   LVDCONbits.LVDL0                // bit 0
1910 #define LVDL1                   LVDCONbits.LVDL1                // bit 1
1911 #define LVDL2                   LVDCONbits.LVDL2                // bit 2
1912 #define LVDL3                   LVDCONbits.LVDL3                // bit 3
1913 #define LVDEN                   LVDCONbits.LVDEN                // bit 4
1914 #define IRVST                   LVDCONbits.IRVST                // bit 5
1915 
1916 #define PS0                     OPTION_REGbits.PS0              // bit 0
1917 #define PS1                     OPTION_REGbits.PS1              // bit 1
1918 #define PS2                     OPTION_REGbits.PS2              // bit 2
1919 #define PSA                     OPTION_REGbits.PSA              // bit 3
1920 #define T0SE                    OPTION_REGbits.T0SE             // bit 4
1921 #define T0CS                    OPTION_REGbits.T0CS             // bit 5
1922 #define INTEDG                  OPTION_REGbits.INTEDG           // bit 6
1923 #define NOT_RBPU                OPTION_REGbits.NOT_RBPU         // bit 7
1924 
1925 #define SCS0                    OSCCONbits.SCS0                 // bit 0
1926 #define SCS1                    OSCCONbits.SCS1                 // bit 1
1927 #define IOFS                    OSCCONbits.IOFS                 // bit 2
1928 #define OSTS                    OSCCONbits.OSTS                 // bit 3
1929 #define IRCF0                   OSCCONbits.IRCF0                // bit 4
1930 #define IRCF1                   OSCCONbits.IRCF1                // bit 5
1931 #define IRCF2                   OSCCONbits.IRCF2                // bit 6
1932 
1933 #define TUN0                    OSCTUNEbits.TUN0                // bit 0
1934 #define TUN1                    OSCTUNEbits.TUN1                // bit 1
1935 #define TUN2                    OSCTUNEbits.TUN2                // bit 2
1936 #define TUN3                    OSCTUNEbits.TUN3                // bit 3
1937 #define TUN4                    OSCTUNEbits.TUN4                // bit 4
1938 #define TUN5                    OSCTUNEbits.TUN5                // bit 5
1939 
1940 #define NOT_BOR                 PCONbits.NOT_BOR                // bit 0, shadows bit in PCONbits
1941 #define NOT_BO                  PCONbits.NOT_BO                 // bit 0, shadows bit in PCONbits
1942 #define NOT_POR                 PCONbits.NOT_POR                // bit 1
1943 #define SBOREN                  PCONbits.SBOREN                 // bit 2
1944 
1945 #define TMR1IE                  PIE1bits.TMR1IE                 // bit 0
1946 #define TMR2IE                  PIE1bits.TMR2IE                 // bit 1
1947 #define CCP1IE                  PIE1bits.CCP1IE                 // bit 2
1948 #define SSPIE                   PIE1bits.SSPIE                  // bit 3
1949 #define TXIE                    PIE1bits.TXIE                   // bit 4
1950 #define RCIE                    PIE1bits.RCIE                   // bit 5
1951 #define ADIE                    PIE1bits.ADIE                   // bit 6
1952 #define PSPIE                   PIE1bits.PSPIE                  // bit 7
1953 
1954 #define CCP2IE                  PIE2bits.CCP2IE                 // bit 0
1955 #define CCP3IE                  PIE2bits.CCP3IE                 // bit 1
1956 #define BCLIE                   PIE2bits.BCLIE                  // bit 3
1957 #define LVDIE                   PIE2bits.LVDIE                  // bit 5
1958 #define CMIE                    PIE2bits.CMIE                   // bit 6
1959 #define OSFIE                   PIE2bits.OSFIE                  // bit 7
1960 
1961 #define TMR1IF                  PIR1bits.TMR1IF                 // bit 0
1962 #define TMR2IF                  PIR1bits.TMR2IF                 // bit 1
1963 #define CCP1IF                  PIR1bits.CCP1IF                 // bit 2
1964 #define SSPIF                   PIR1bits.SSPIF                  // bit 3
1965 #define TXIF                    PIR1bits.TXIF                   // bit 4
1966 #define RCIF                    PIR1bits.RCIF                   // bit 5
1967 #define ADIF                    PIR1bits.ADIF                   // bit 6
1968 #define PSPIF                   PIR1bits.PSPIF                  // bit 7
1969 
1970 #define CCP2IF                  PIR2bits.CCP2IF                 // bit 0
1971 #define CCP3IF                  PIR2bits.CCP3IF                 // bit 1
1972 #define BCLIF                   PIR2bits.BCLIF                  // bit 3
1973 #define LVDIF                   PIR2bits.LVDIF                  // bit 5
1974 #define CMIF                    PIR2bits.CMIF                   // bit 6
1975 #define OSFIF                   PIR2bits.OSFIF                  // bit 7
1976 
1977 #define RD                      PMCON1bits.RD                   // bit 0
1978 
1979 #define RA0                     PORTAbits.RA0                   // bit 0
1980 #define RA1                     PORTAbits.RA1                   // bit 1
1981 #define RA2                     PORTAbits.RA2                   // bit 2
1982 #define RA3                     PORTAbits.RA3                   // bit 3
1983 #define RA4                     PORTAbits.RA4                   // bit 4
1984 #define RA5                     PORTAbits.RA5                   // bit 5
1985 #define RA6                     PORTAbits.RA6                   // bit 6
1986 #define RA7                     PORTAbits.RA7                   // bit 7
1987 
1988 #define RB0                     PORTBbits.RB0                   // bit 0
1989 #define RB1                     PORTBbits.RB1                   // bit 1
1990 #define RB2                     PORTBbits.RB2                   // bit 2
1991 #define RB3                     PORTBbits.RB3                   // bit 3
1992 #define RB4                     PORTBbits.RB4                   // bit 4
1993 #define RB5                     PORTBbits.RB5                   // bit 5
1994 #define RB6                     PORTBbits.RB6                   // bit 6
1995 #define RB7                     PORTBbits.RB7                   // bit 7
1996 
1997 #define RC0                     PORTCbits.RC0                   // bit 0
1998 #define RC1                     PORTCbits.RC1                   // bit 1
1999 #define RC2                     PORTCbits.RC2                   // bit 2
2000 #define RC3                     PORTCbits.RC3                   // bit 3
2001 #define RC4                     PORTCbits.RC4                   // bit 4
2002 #define RC5                     PORTCbits.RC5                   // bit 5
2003 #define RC6                     PORTCbits.RC6                   // bit 6
2004 #define RC7                     PORTCbits.RC7                   // bit 7
2005 
2006 #define RD0                     PORTDbits.RD0                   // bit 0
2007 #define RD1                     PORTDbits.RD1                   // bit 1
2008 #define RD2                     PORTDbits.RD2                   // bit 2
2009 #define RD3                     PORTDbits.RD3                   // bit 3
2010 #define RD4                     PORTDbits.RD4                   // bit 4
2011 #define RD5                     PORTDbits.RD5                   // bit 5
2012 #define RD6                     PORTDbits.RD6                   // bit 6
2013 #define RD7                     PORTDbits.RD7                   // bit 7
2014 
2015 #define RE0                     PORTEbits.RE0                   // bit 0
2016 #define RE1                     PORTEbits.RE1                   // bit 1
2017 #define RE2                     PORTEbits.RE2                   // bit 2
2018 #define RE3                     PORTEbits.RE3                   // bit 3
2019 
2020 #define RX9D                    RCSTAbits.RX9D                  // bit 0, shadows bit in RCSTAbits
2021 #define RCD8                    RCSTAbits.RCD8                  // bit 0, shadows bit in RCSTAbits
2022 #define OERR                    RCSTAbits.OERR                  // bit 1
2023 #define FERR                    RCSTAbits.FERR                  // bit 2
2024 #define ADDEN                   RCSTAbits.ADDEN                 // bit 3
2025 #define CREN                    RCSTAbits.CREN                  // bit 4
2026 #define SREN                    RCSTAbits.SREN                  // bit 5
2027 #define RX9                     RCSTAbits.RX9                   // bit 6, shadows bit in RCSTAbits
2028 #define RC9                     RCSTAbits.RC9                   // bit 6, shadows bit in RCSTAbits
2029 #define NOT_RC8                 RCSTAbits.NOT_RC8               // bit 6, shadows bit in RCSTAbits
2030 #define RC8_9                   RCSTAbits.RC8_9                 // bit 6, shadows bit in RCSTAbits
2031 #define SPEN                    RCSTAbits.SPEN                  // bit 7
2032 
2033 #define SSPM0                   SSPCONbits.SSPM0                // bit 0
2034 #define SSPM1                   SSPCONbits.SSPM1                // bit 1
2035 #define SSPM2                   SSPCONbits.SSPM2                // bit 2
2036 #define SSPM3                   SSPCONbits.SSPM3                // bit 3
2037 #define CKP                     SSPCONbits.CKP                  // bit 4
2038 #define SSPEN                   SSPCONbits.SSPEN                // bit 5
2039 #define SSPOV                   SSPCONbits.SSPOV                // bit 6
2040 #define WCOL                    SSPCONbits.WCOL                 // bit 7
2041 
2042 #define SEN                     SSPCON2bits.SEN                 // bit 0
2043 #define RSEN                    SSPCON2bits.RSEN                // bit 1
2044 #define PEN                     SSPCON2bits.PEN                 // bit 2
2045 #define RCEN                    SSPCON2bits.RCEN                // bit 3
2046 #define ACKEN                   SSPCON2bits.ACKEN               // bit 4
2047 #define ACKDT                   SSPCON2bits.ACKDT               // bit 5
2048 #define ACKSTAT                 SSPCON2bits.ACKSTAT             // bit 6
2049 #define GCEN                    SSPCON2bits.GCEN                // bit 7
2050 
2051 #define BF                      SSPSTATbits.BF                  // bit 0
2052 #define UA                      SSPSTATbits.UA                  // bit 1
2053 #define R_NOT_W                 SSPSTATbits.R_NOT_W             // bit 2, shadows bit in SSPSTATbits
2054 #define R                       SSPSTATbits.R                   // bit 2, shadows bit in SSPSTATbits
2055 #define I2C_READ                SSPSTATbits.I2C_READ            // bit 2, shadows bit in SSPSTATbits
2056 #define NOT_W                   SSPSTATbits.NOT_W               // bit 2, shadows bit in SSPSTATbits
2057 #define NOT_WRITE               SSPSTATbits.NOT_WRITE           // bit 2, shadows bit in SSPSTATbits
2058 #define R_W                     SSPSTATbits.R_W                 // bit 2, shadows bit in SSPSTATbits
2059 #define READ_WRITE              SSPSTATbits.READ_WRITE          // bit 2, shadows bit in SSPSTATbits
2060 #define S                       SSPSTATbits.S                   // bit 3, shadows bit in SSPSTATbits
2061 #define I2C_START               SSPSTATbits.I2C_START           // bit 3, shadows bit in SSPSTATbits
2062 #define P                       SSPSTATbits.P                   // bit 4, shadows bit in SSPSTATbits
2063 #define I2C_STOP                SSPSTATbits.I2C_STOP            // bit 4, shadows bit in SSPSTATbits
2064 #define D_NOT_A                 SSPSTATbits.D_NOT_A             // bit 5, shadows bit in SSPSTATbits
2065 #define D                       SSPSTATbits.D                   // bit 5, shadows bit in SSPSTATbits
2066 #define I2C_DATA                SSPSTATbits.I2C_DATA            // bit 5, shadows bit in SSPSTATbits
2067 #define NOT_A                   SSPSTATbits.NOT_A               // bit 5, shadows bit in SSPSTATbits
2068 #define NOT_ADDRESS             SSPSTATbits.NOT_ADDRESS         // bit 5, shadows bit in SSPSTATbits
2069 #define D_A                     SSPSTATbits.D_A                 // bit 5, shadows bit in SSPSTATbits
2070 #define DATA_ADDRESS            SSPSTATbits.DATA_ADDRESS        // bit 5, shadows bit in SSPSTATbits
2071 #define CKE                     SSPSTATbits.CKE                 // bit 6
2072 #define SMP                     SSPSTATbits.SMP                 // bit 7
2073 
2074 #define C                       STATUSbits.C                    // bit 0
2075 #define DC                      STATUSbits.DC                   // bit 1
2076 #define Z                       STATUSbits.Z                    // bit 2
2077 #define NOT_PD                  STATUSbits.NOT_PD               // bit 3
2078 #define NOT_TO                  STATUSbits.NOT_TO               // bit 4
2079 #define RP0                     STATUSbits.RP0                  // bit 5
2080 #define RP1                     STATUSbits.RP1                  // bit 6
2081 #define IRP                     STATUSbits.IRP                  // bit 7
2082 
2083 #define TMR1ON                  T1CONbits.TMR1ON                // bit 0
2084 #define TMR1CS                  T1CONbits.TMR1CS                // bit 1
2085 #define NOT_T1SYNC              T1CONbits.NOT_T1SYNC            // bit 2, shadows bit in T1CONbits
2086 #define T1SYNC                  T1CONbits.T1SYNC                // bit 2, shadows bit in T1CONbits
2087 #define T1INSYNC                T1CONbits.T1INSYNC              // bit 2, shadows bit in T1CONbits
2088 #define T1OSCEN                 T1CONbits.T1OSCEN               // bit 3
2089 #define T1CKPS0                 T1CONbits.T1CKPS0               // bit 4
2090 #define T1CKPS1                 T1CONbits.T1CKPS1               // bit 5
2091 #define T1RUN                   T1CONbits.T1RUN                 // bit 6
2092 
2093 #define T2CKPS0                 T2CONbits.T2CKPS0               // bit 0
2094 #define T2CKPS1                 T2CONbits.T2CKPS1               // bit 1
2095 #define TMR2ON                  T2CONbits.TMR2ON                // bit 2
2096 #define TOUTPS0                 T2CONbits.TOUTPS0               // bit 3
2097 #define TOUTPS1                 T2CONbits.TOUTPS1               // bit 4
2098 #define TOUTPS2                 T2CONbits.TOUTPS2               // bit 5
2099 #define TOUTPS3                 T2CONbits.TOUTPS3               // bit 6
2100 
2101 #define TRISA0                  TRISAbits.TRISA0                // bit 0
2102 #define TRISA1                  TRISAbits.TRISA1                // bit 1
2103 #define TRISA2                  TRISAbits.TRISA2                // bit 2
2104 #define TRISA3                  TRISAbits.TRISA3                // bit 3
2105 #define TRISA4                  TRISAbits.TRISA4                // bit 4
2106 #define TRISA5                  TRISAbits.TRISA5                // bit 5
2107 #define TRISA6                  TRISAbits.TRISA6                // bit 6
2108 #define TRISA7                  TRISAbits.TRISA7                // bit 7
2109 
2110 #define TRISB0                  TRISBbits.TRISB0                // bit 0
2111 #define TRISB1                  TRISBbits.TRISB1                // bit 1
2112 #define TRISB2                  TRISBbits.TRISB2                // bit 2
2113 #define TRISB3                  TRISBbits.TRISB3                // bit 3
2114 #define TRISB4                  TRISBbits.TRISB4                // bit 4
2115 #define TRISB5                  TRISBbits.TRISB5                // bit 5
2116 #define TRISB6                  TRISBbits.TRISB6                // bit 6
2117 #define TRISB7                  TRISBbits.TRISB7                // bit 7
2118 
2119 #define TRISC0                  TRISCbits.TRISC0                // bit 0
2120 #define TRISC1                  TRISCbits.TRISC1                // bit 1
2121 #define TRISC2                  TRISCbits.TRISC2                // bit 2
2122 #define TRISC3                  TRISCbits.TRISC3                // bit 3
2123 #define TRISC4                  TRISCbits.TRISC4                // bit 4
2124 #define TRISC5                  TRISCbits.TRISC5                // bit 5
2125 #define TRISC6                  TRISCbits.TRISC6                // bit 6
2126 #define TRISC7                  TRISCbits.TRISC7                // bit 7
2127 
2128 #define TRISD0                  TRISDbits.TRISD0                // bit 0
2129 #define TRISD1                  TRISDbits.TRISD1                // bit 1
2130 #define TRISD2                  TRISDbits.TRISD2                // bit 2
2131 #define TRISD3                  TRISDbits.TRISD3                // bit 3
2132 #define TRISD4                  TRISDbits.TRISD4                // bit 4
2133 #define TRISD5                  TRISDbits.TRISD5                // bit 5
2134 #define TRISD6                  TRISDbits.TRISD6                // bit 6
2135 #define TRISD7                  TRISDbits.TRISD7                // bit 7
2136 
2137 #define TRISE0                  TRISEbits.TRISE0                // bit 0
2138 #define TRISE1                  TRISEbits.TRISE1                // bit 1
2139 #define TRISE2                  TRISEbits.TRISE2                // bit 2
2140 #define TRISE3                  TRISEbits.TRISE3                // bit 3
2141 #define PSPMODE                 TRISEbits.PSPMODE               // bit 4
2142 #define IBOV                    TRISEbits.IBOV                  // bit 5
2143 #define OBF                     TRISEbits.OBF                   // bit 6
2144 #define IBF                     TRISEbits.IBF                   // bit 7
2145 
2146 #define TX9D                    TXSTAbits.TX9D                  // bit 0, shadows bit in TXSTAbits
2147 #define TXD8                    TXSTAbits.TXD8                  // bit 0, shadows bit in TXSTAbits
2148 #define TRMT                    TXSTAbits.TRMT                  // bit 1
2149 #define BRGH                    TXSTAbits.BRGH                  // bit 2
2150 #define SYNC                    TXSTAbits.SYNC                  // bit 4
2151 #define TXEN                    TXSTAbits.TXEN                  // bit 5
2152 #define TX9                     TXSTAbits.TX9                   // bit 6, shadows bit in TXSTAbits
2153 #define NOT_TX8                 TXSTAbits.NOT_TX8               // bit 6, shadows bit in TXSTAbits
2154 #define TX8_9                   TXSTAbits.TX8_9                 // bit 6, shadows bit in TXSTAbits
2155 #define CSRC                    TXSTAbits.CSRC                  // bit 7
2156 
2157 #define SWDTEN                  WDTCONbits.SWDTEN               // bit 0, shadows bit in WDTCONbits
2158 #define SWDTE                   WDTCONbits.SWDTE                // bit 0, shadows bit in WDTCONbits
2159 #define WDTPS0                  WDTCONbits.WDTPS0               // bit 1
2160 #define WDTPS1                  WDTCONbits.WDTPS1               // bit 2
2161 #define WDTPS2                  WDTCONbits.WDTPS2               // bit 3
2162 #define WDTPS3                  WDTCONbits.WDTPS3               // bit 4
2163 
2164 #endif // #ifndef NO_BIT_DEFINES
2165 
2166 #endif // #ifndef __PIC16F777_H__
2167