1 /*
2  * This declarations of the PIC18LF6620 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:24:06 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 __PIC18LF6620_H__
26 #define __PIC18LF6620_H__
27 
28 //==============================================================================
29 
30 //==============================================================================
31 //
32 //	Register Definitions
33 //
34 //==============================================================================
35 
36 
37 //==============================================================================
38 //        RCSTA2 Bits
39 
40 extern __at(0x0F6B) __sfr RCSTA2;
41 
42 typedef union
43   {
44   struct
45     {
46     unsigned RX9D               : 1;
47     unsigned OERR               : 1;
48     unsigned FERR               : 1;
49     unsigned ADDEN              : 1;
50     unsigned CREN               : 1;
51     unsigned SREN               : 1;
52     unsigned RX9                : 1;
53     unsigned SPEN               : 1;
54     };
55 
56   struct
57     {
58     unsigned RCD8               : 1;
59     unsigned OERR2              : 1;
60     unsigned FERR2              : 1;
61     unsigned ADEN               : 1;
62     unsigned CREN2              : 1;
63     unsigned SREN2              : 1;
64     unsigned RC9                : 1;
65     unsigned SPEN2              : 1;
66     };
67 
68   struct
69     {
70     unsigned RX9D2              : 1;
71     unsigned                    : 1;
72     unsigned                    : 1;
73     unsigned ADDEN2             : 1;
74     unsigned                    : 1;
75     unsigned                    : 1;
76     unsigned NOT_RC8            : 1;
77     unsigned                    : 1;
78     };
79 
80   struct
81     {
82     unsigned                    : 1;
83     unsigned                    : 1;
84     unsigned                    : 1;
85     unsigned                    : 1;
86     unsigned                    : 1;
87     unsigned                    : 1;
88     unsigned RC8_9              : 1;
89     unsigned                    : 1;
90     };
91 
92   struct
93     {
94     unsigned                    : 1;
95     unsigned                    : 1;
96     unsigned                    : 1;
97     unsigned                    : 1;
98     unsigned                    : 1;
99     unsigned                    : 1;
100     unsigned RX92               : 1;
101     unsigned                    : 1;
102     };
103   } __RCSTA2bits_t;
104 
105 extern __at(0x0F6B) volatile __RCSTA2bits_t RCSTA2bits;
106 
107 #define _RCSTA2_RX9D            0x01
108 #define _RCSTA2_RCD8            0x01
109 #define _RCSTA2_RX9D2           0x01
110 #define _RCSTA2_OERR            0x02
111 #define _RCSTA2_OERR2           0x02
112 #define _RCSTA2_FERR            0x04
113 #define _RCSTA2_FERR2           0x04
114 #define _RCSTA2_ADDEN           0x08
115 #define _RCSTA2_ADEN            0x08
116 #define _RCSTA2_ADDEN2          0x08
117 #define _RCSTA2_CREN            0x10
118 #define _RCSTA2_CREN2           0x10
119 #define _RCSTA2_SREN            0x20
120 #define _RCSTA2_SREN2           0x20
121 #define _RCSTA2_RX9             0x40
122 #define _RCSTA2_RC9             0x40
123 #define _RCSTA2_NOT_RC8         0x40
124 #define _RCSTA2_RC8_9           0x40
125 #define _RCSTA2_RX92            0x40
126 #define _RCSTA2_SPEN            0x80
127 #define _RCSTA2_SPEN2           0x80
128 
129 //==============================================================================
130 
131 
132 //==============================================================================
133 //        TXSTA2 Bits
134 
135 extern __at(0x0F6C) __sfr TXSTA2;
136 
137 typedef union
138   {
139   struct
140     {
141     unsigned TX9D               : 1;
142     unsigned TRMT               : 1;
143     unsigned BRGH               : 1;
144     unsigned SENDB2             : 1;
145     unsigned SYNC               : 1;
146     unsigned TXEN               : 1;
147     unsigned TX9                : 1;
148     unsigned CSRC               : 1;
149     };
150 
151   struct
152     {
153     unsigned TXD8               : 1;
154     unsigned TRMT2              : 1;
155     unsigned BRGH2              : 1;
156     unsigned                    : 1;
157     unsigned SYNC2              : 1;
158     unsigned TXEN2              : 1;
159     unsigned TX8_9              : 1;
160     unsigned CSRC2              : 1;
161     };
162 
163   struct
164     {
165     unsigned TX9D2              : 1;
166     unsigned                    : 1;
167     unsigned                    : 1;
168     unsigned                    : 1;
169     unsigned                    : 1;
170     unsigned                    : 1;
171     unsigned NOT_TX8            : 1;
172     unsigned                    : 1;
173     };
174 
175   struct
176     {
177     unsigned                    : 1;
178     unsigned                    : 1;
179     unsigned                    : 1;
180     unsigned                    : 1;
181     unsigned                    : 1;
182     unsigned                    : 1;
183     unsigned TX92               : 1;
184     unsigned                    : 1;
185     };
186   } __TXSTA2bits_t;
187 
188 extern __at(0x0F6C) volatile __TXSTA2bits_t TXSTA2bits;
189 
190 #define _TXSTA2_TX9D            0x01
191 #define _TXSTA2_TXD8            0x01
192 #define _TXSTA2_TX9D2           0x01
193 #define _TXSTA2_TRMT            0x02
194 #define _TXSTA2_TRMT2           0x02
195 #define _TXSTA2_BRGH            0x04
196 #define _TXSTA2_BRGH2           0x04
197 #define _TXSTA2_SENDB2          0x08
198 #define _TXSTA2_SYNC            0x10
199 #define _TXSTA2_SYNC2           0x10
200 #define _TXSTA2_TXEN            0x20
201 #define _TXSTA2_TXEN2           0x20
202 #define _TXSTA2_TX9             0x40
203 #define _TXSTA2_TX8_9           0x40
204 #define _TXSTA2_NOT_TX8         0x40
205 #define _TXSTA2_TX92            0x40
206 #define _TXSTA2_CSRC            0x80
207 #define _TXSTA2_CSRC2           0x80
208 
209 //==============================================================================
210 
211 extern __at(0x0F6D) __sfr TXREG2;
212 extern __at(0x0F6E) __sfr RCREG2;
213 extern __at(0x0F6F) __sfr SPBRG2;
214 
215 //==============================================================================
216 //        CCP5CON Bits
217 
218 extern __at(0x0F70) __sfr CCP5CON;
219 
220 typedef union
221   {
222   struct
223     {
224     unsigned CCP5M0             : 1;
225     unsigned CCP5M1             : 1;
226     unsigned CCP5M2             : 1;
227     unsigned CCP5M3             : 1;
228     unsigned DC5B0              : 1;
229     unsigned DC5B1              : 1;
230     unsigned                    : 1;
231     unsigned                    : 1;
232     };
233 
234   struct
235     {
236     unsigned                    : 1;
237     unsigned                    : 1;
238     unsigned                    : 1;
239     unsigned                    : 1;
240     unsigned DCCP5Y             : 1;
241     unsigned DCCP5X             : 1;
242     unsigned                    : 1;
243     unsigned                    : 1;
244     };
245 
246   struct
247     {
248     unsigned CCP5M              : 4;
249     unsigned                    : 4;
250     };
251 
252   struct
253     {
254     unsigned                    : 4;
255     unsigned DC5B               : 2;
256     unsigned                    : 2;
257     };
258   } __CCP5CONbits_t;
259 
260 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits;
261 
262 #define _CCP5M0                 0x01
263 #define _CCP5M1                 0x02
264 #define _CCP5M2                 0x04
265 #define _CCP5M3                 0x08
266 #define _DC5B0                  0x10
267 #define _DCCP5Y                 0x10
268 #define _DC5B1                  0x20
269 #define _DCCP5X                 0x20
270 
271 //==============================================================================
272 
273 extern __at(0x0F71) __sfr CCPR5;
274 extern __at(0x0F71) __sfr CCPR5L;
275 extern __at(0x0F72) __sfr CCPR5H;
276 
277 //==============================================================================
278 //        CCP4CON Bits
279 
280 extern __at(0x0F73) __sfr CCP4CON;
281 
282 typedef union
283   {
284   struct
285     {
286     unsigned CCP4M0             : 1;
287     unsigned CCP4M1             : 1;
288     unsigned CCP4M2             : 1;
289     unsigned CCP4M3             : 1;
290     unsigned DC4B0              : 1;
291     unsigned DC4B1              : 1;
292     unsigned                    : 1;
293     unsigned                    : 1;
294     };
295 
296   struct
297     {
298     unsigned                    : 1;
299     unsigned                    : 1;
300     unsigned                    : 1;
301     unsigned                    : 1;
302     unsigned DCCP4Y             : 1;
303     unsigned DCCP4X             : 1;
304     unsigned                    : 1;
305     unsigned                    : 1;
306     };
307 
308   struct
309     {
310     unsigned CCP4M              : 4;
311     unsigned                    : 4;
312     };
313 
314   struct
315     {
316     unsigned                    : 4;
317     unsigned DC4B               : 2;
318     unsigned                    : 2;
319     };
320   } __CCP4CONbits_t;
321 
322 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits;
323 
324 #define _CCP4M0                 0x01
325 #define _CCP4M1                 0x02
326 #define _CCP4M2                 0x04
327 #define _CCP4M3                 0x08
328 #define _DC4B0                  0x10
329 #define _DCCP4Y                 0x10
330 #define _DC4B1                  0x20
331 #define _DCCP4X                 0x20
332 
333 //==============================================================================
334 
335 extern __at(0x0F74) __sfr CCPR4;
336 extern __at(0x0F74) __sfr CCPR4L;
337 extern __at(0x0F75) __sfr CCPR4H;
338 
339 //==============================================================================
340 //        T4CON Bits
341 
342 extern __at(0x0F76) __sfr T4CON;
343 
344 typedef union
345   {
346   struct
347     {
348     unsigned T4CKPS0            : 1;
349     unsigned T4CKPS1            : 1;
350     unsigned TMR4ON             : 1;
351     unsigned T4OUTPS0           : 1;
352     unsigned T4OUTPS1           : 1;
353     unsigned T4OUTPS2           : 1;
354     unsigned T4OUTPS3           : 1;
355     unsigned                    : 1;
356     };
357 
358   struct
359     {
360     unsigned T4CKPS             : 2;
361     unsigned                    : 6;
362     };
363 
364   struct
365     {
366     unsigned                    : 3;
367     unsigned T4OUTPS            : 4;
368     unsigned                    : 1;
369     };
370   } __T4CONbits_t;
371 
372 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
373 
374 #define _T4CKPS0                0x01
375 #define _T4CKPS1                0x02
376 #define _TMR4ON                 0x04
377 #define _T4OUTPS0               0x08
378 #define _T4OUTPS1               0x10
379 #define _T4OUTPS2               0x20
380 #define _T4OUTPS3               0x40
381 
382 //==============================================================================
383 
384 extern __at(0x0F77) __sfr PR4;
385 extern __at(0x0F78) __sfr TMR4;
386 
387 //==============================================================================
388 //        PORTA Bits
389 
390 extern __at(0x0F80) __sfr PORTA;
391 
392 typedef union
393   {
394   struct
395     {
396     unsigned RA0                : 1;
397     unsigned RA1                : 1;
398     unsigned RA2                : 1;
399     unsigned RA3                : 1;
400     unsigned RA4                : 1;
401     unsigned RA5                : 1;
402     unsigned RA6                : 1;
403     unsigned                    : 1;
404     };
405 
406   struct
407     {
408     unsigned AN0                : 1;
409     unsigned AN1                : 1;
410     unsigned AN2                : 1;
411     unsigned AN3                : 1;
412     unsigned T0CKI              : 1;
413     unsigned AN4                : 1;
414     unsigned OSC2               : 1;
415     unsigned                    : 1;
416     };
417 
418   struct
419     {
420     unsigned                    : 1;
421     unsigned                    : 1;
422     unsigned VREFM              : 1;
423     unsigned VREFP              : 1;
424     unsigned                    : 1;
425     unsigned LVDIN              : 1;
426     unsigned CLKO               : 1;
427     unsigned                    : 1;
428     };
429 
430   struct
431     {
432     unsigned RA                 : 7;
433     unsigned                    : 1;
434     };
435   } __PORTAbits_t;
436 
437 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
438 
439 #define _PORTA_RA0              0x01
440 #define _PORTA_AN0              0x01
441 #define _PORTA_RA1              0x02
442 #define _PORTA_AN1              0x02
443 #define _PORTA_RA2              0x04
444 #define _PORTA_AN2              0x04
445 #define _PORTA_VREFM            0x04
446 #define _PORTA_RA3              0x08
447 #define _PORTA_AN3              0x08
448 #define _PORTA_VREFP            0x08
449 #define _PORTA_RA4              0x10
450 #define _PORTA_T0CKI            0x10
451 #define _PORTA_RA5              0x20
452 #define _PORTA_AN4              0x20
453 #define _PORTA_LVDIN            0x20
454 #define _PORTA_RA6              0x40
455 #define _PORTA_OSC2             0x40
456 #define _PORTA_CLKO             0x40
457 
458 //==============================================================================
459 
460 
461 //==============================================================================
462 //        PORTB Bits
463 
464 extern __at(0x0F81) __sfr PORTB;
465 
466 typedef union
467   {
468   struct
469     {
470     unsigned RB0                : 1;
471     unsigned RB1                : 1;
472     unsigned RB2                : 1;
473     unsigned RB3                : 1;
474     unsigned RB4                : 1;
475     unsigned RB5                : 1;
476     unsigned RB6                : 1;
477     unsigned RB7                : 1;
478     };
479 
480   struct
481     {
482     unsigned INT0               : 1;
483     unsigned INT1               : 1;
484     unsigned INT2               : 1;
485     unsigned INT3               : 1;
486     unsigned KBI0               : 1;
487     unsigned KBI1               : 1;
488     unsigned KBI2               : 1;
489     unsigned KBI3               : 1;
490     };
491 
492   struct
493     {
494     unsigned                    : 1;
495     unsigned                    : 1;
496     unsigned                    : 1;
497     unsigned CCP2A              : 1;
498     unsigned                    : 1;
499     unsigned PGM                : 1;
500     unsigned PGC                : 1;
501     unsigned PGD                : 1;
502     };
503 
504   struct
505     {
506     unsigned INT                : 4;
507     unsigned                    : 4;
508     };
509 
510   struct
511     {
512     unsigned                    : 4;
513     unsigned KBI                : 4;
514     };
515   } __PORTBbits_t;
516 
517 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
518 
519 #define _PORTB_RB0              0x01
520 #define _PORTB_INT0             0x01
521 #define _PORTB_RB1              0x02
522 #define _PORTB_INT1             0x02
523 #define _PORTB_RB2              0x04
524 #define _PORTB_INT2             0x04
525 #define _PORTB_RB3              0x08
526 #define _PORTB_INT3             0x08
527 #define _PORTB_CCP2A            0x08
528 #define _PORTB_RB4              0x10
529 #define _PORTB_KBI0             0x10
530 #define _PORTB_RB5              0x20
531 #define _PORTB_KBI1             0x20
532 #define _PORTB_PGM              0x20
533 #define _PORTB_RB6              0x40
534 #define _PORTB_KBI2             0x40
535 #define _PORTB_PGC              0x40
536 #define _PORTB_RB7              0x80
537 #define _PORTB_KBI3             0x80
538 #define _PORTB_PGD              0x80
539 
540 //==============================================================================
541 
542 
543 //==============================================================================
544 //        PORTC Bits
545 
546 extern __at(0x0F82) __sfr PORTC;
547 
548 typedef union
549   {
550   struct
551     {
552     unsigned RC0                : 1;
553     unsigned RC1                : 1;
554     unsigned RC2                : 1;
555     unsigned RC3                : 1;
556     unsigned RC4                : 1;
557     unsigned RC5                : 1;
558     unsigned RC6                : 1;
559     unsigned RC7                : 1;
560     };
561 
562   struct
563     {
564     unsigned T1OSO              : 1;
565     unsigned T1OSI              : 1;
566     unsigned CCP1               : 1;
567     unsigned SCK                : 1;
568     unsigned SDI                : 1;
569     unsigned SDO                : 1;
570     unsigned TX                 : 1;
571     unsigned RX                 : 1;
572     };
573 
574   struct
575     {
576     unsigned T13CKI             : 1;
577     unsigned CCP2               : 1;
578     unsigned                    : 1;
579     unsigned SCL                : 1;
580     unsigned SDA                : 1;
581     unsigned                    : 1;
582     unsigned CK                 : 1;
583     unsigned                    : 1;
584     };
585   } __PORTCbits_t;
586 
587 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
588 
589 #define _PORTC_RC0              0x01
590 #define _PORTC_T1OSO            0x01
591 #define _PORTC_T13CKI           0x01
592 #define _PORTC_RC1              0x02
593 #define _PORTC_T1OSI            0x02
594 #define _PORTC_CCP2             0x02
595 #define _PORTC_RC2              0x04
596 #define _PORTC_CCP1             0x04
597 #define _PORTC_RC3              0x08
598 #define _PORTC_SCK              0x08
599 #define _PORTC_SCL              0x08
600 #define _PORTC_RC4              0x10
601 #define _PORTC_SDI              0x10
602 #define _PORTC_SDA              0x10
603 #define _PORTC_RC5              0x20
604 #define _PORTC_SDO              0x20
605 #define _PORTC_RC6              0x40
606 #define _PORTC_TX               0x40
607 #define _PORTC_CK               0x40
608 #define _PORTC_RC7              0x80
609 #define _PORTC_RX               0x80
610 
611 //==============================================================================
612 
613 
614 //==============================================================================
615 //        PORTD Bits
616 
617 extern __at(0x0F83) __sfr PORTD;
618 
619 typedef union
620   {
621   struct
622     {
623     unsigned RD0                : 1;
624     unsigned RD1                : 1;
625     unsigned RD2                : 1;
626     unsigned RD3                : 1;
627     unsigned RD4                : 1;
628     unsigned RD5                : 1;
629     unsigned RD6                : 1;
630     unsigned RD7                : 1;
631     };
632 
633   struct
634     {
635     unsigned PSP0               : 1;
636     unsigned PSP1               : 1;
637     unsigned PSP2               : 1;
638     unsigned PSP3               : 1;
639     unsigned PSP4               : 1;
640     unsigned PSP5               : 1;
641     unsigned PSP6               : 1;
642     unsigned PSP7               : 1;
643     };
644   } __PORTDbits_t;
645 
646 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
647 
648 #define _PORTD_RD0              0x01
649 #define _PORTD_PSP0             0x01
650 #define _PORTD_RD1              0x02
651 #define _PORTD_PSP1             0x02
652 #define _PORTD_RD2              0x04
653 #define _PORTD_PSP2             0x04
654 #define _PORTD_RD3              0x08
655 #define _PORTD_PSP3             0x08
656 #define _PORTD_RD4              0x10
657 #define _PORTD_PSP4             0x10
658 #define _PORTD_RD5              0x20
659 #define _PORTD_PSP5             0x20
660 #define _PORTD_RD6              0x40
661 #define _PORTD_PSP6             0x40
662 #define _PORTD_RD7              0x80
663 #define _PORTD_PSP7             0x80
664 
665 //==============================================================================
666 
667 
668 //==============================================================================
669 //        PORTE Bits
670 
671 extern __at(0x0F84) __sfr PORTE;
672 
673 typedef union
674   {
675   struct
676     {
677     unsigned RE0                : 1;
678     unsigned RE1                : 1;
679     unsigned RE2                : 1;
680     unsigned RE3                : 1;
681     unsigned RE4                : 1;
682     unsigned RE5                : 1;
683     unsigned RE6                : 1;
684     unsigned RE7                : 1;
685     };
686 
687   struct
688     {
689     unsigned RD                 : 1;
690     unsigned WR                 : 1;
691     unsigned CS                 : 1;
692     unsigned                    : 1;
693     unsigned                    : 1;
694     unsigned                    : 1;
695     unsigned                    : 1;
696     unsigned CCP2               : 1;
697     };
698 
699   struct
700     {
701     unsigned                    : 1;
702     unsigned                    : 1;
703     unsigned                    : 1;
704     unsigned                    : 1;
705     unsigned                    : 1;
706     unsigned                    : 1;
707     unsigned                    : 1;
708     unsigned CCP2C              : 1;
709     };
710   } __PORTEbits_t;
711 
712 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
713 
714 #define _PORTE_RE0              0x01
715 #define _PORTE_RD               0x01
716 #define _PORTE_RE1              0x02
717 #define _PORTE_WR               0x02
718 #define _PORTE_RE2              0x04
719 #define _PORTE_CS               0x04
720 #define _PORTE_RE3              0x08
721 #define _PORTE_RE4              0x10
722 #define _PORTE_RE5              0x20
723 #define _PORTE_RE6              0x40
724 #define _PORTE_RE7              0x80
725 #define _PORTE_CCP2             0x80
726 #define _PORTE_CCP2C            0x80
727 
728 //==============================================================================
729 
730 
731 //==============================================================================
732 //        PORTF Bits
733 
734 extern __at(0x0F85) __sfr PORTF;
735 
736 typedef union
737   {
738   struct
739     {
740     unsigned RF0                : 1;
741     unsigned RF1                : 1;
742     unsigned RF2                : 1;
743     unsigned RF3                : 1;
744     unsigned RF4                : 1;
745     unsigned RF5                : 1;
746     unsigned RF6                : 1;
747     unsigned RF7                : 1;
748     };
749 
750   struct
751     {
752     unsigned AN5                : 1;
753     unsigned AN6                : 1;
754     unsigned AN7                : 1;
755     unsigned AN8                : 1;
756     unsigned AN9                : 1;
757     unsigned AN10               : 1;
758     unsigned AN11               : 1;
759     unsigned SS                 : 1;
760     };
761 
762   struct
763     {
764     unsigned                    : 1;
765     unsigned C2OUT              : 1;
766     unsigned C1OUT              : 1;
767     unsigned                    : 1;
768     unsigned                    : 1;
769     unsigned CVREF              : 1;
770     unsigned                    : 1;
771     unsigned                    : 1;
772     };
773   } __PORTFbits_t;
774 
775 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
776 
777 #define _PORTF_RF0              0x01
778 #define _PORTF_AN5              0x01
779 #define _PORTF_RF1              0x02
780 #define _PORTF_AN6              0x02
781 #define _PORTF_C2OUT            0x02
782 #define _PORTF_RF2              0x04
783 #define _PORTF_AN7              0x04
784 #define _PORTF_C1OUT            0x04
785 #define _PORTF_RF3              0x08
786 #define _PORTF_AN8              0x08
787 #define _PORTF_RF4              0x10
788 #define _PORTF_AN9              0x10
789 #define _PORTF_RF5              0x20
790 #define _PORTF_AN10             0x20
791 #define _PORTF_CVREF            0x20
792 #define _PORTF_RF6              0x40
793 #define _PORTF_AN11             0x40
794 #define _PORTF_RF7              0x80
795 #define _PORTF_SS               0x80
796 
797 //==============================================================================
798 
799 
800 //==============================================================================
801 //        PORTG Bits
802 
803 extern __at(0x0F86) __sfr PORTG;
804 
805 typedef union
806   {
807   struct
808     {
809     unsigned RG0                : 1;
810     unsigned RG1                : 1;
811     unsigned RG2                : 1;
812     unsigned RG3                : 1;
813     unsigned RG4                : 1;
814     unsigned                    : 1;
815     unsigned                    : 1;
816     unsigned                    : 1;
817     };
818 
819   struct
820     {
821     unsigned CCP3               : 1;
822     unsigned TX2                : 1;
823     unsigned RX2                : 1;
824     unsigned CCP4               : 1;
825     unsigned CCP5               : 1;
826     unsigned                    : 1;
827     unsigned                    : 1;
828     unsigned                    : 1;
829     };
830 
831   struct
832     {
833     unsigned                    : 1;
834     unsigned CK2                : 1;
835     unsigned DT2                : 1;
836     unsigned                    : 1;
837     unsigned                    : 1;
838     unsigned                    : 1;
839     unsigned                    : 1;
840     unsigned                    : 1;
841     };
842 
843   struct
844     {
845     unsigned RG                 : 5;
846     unsigned                    : 3;
847     };
848   } __PORTGbits_t;
849 
850 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
851 
852 #define _PORTG_RG0              0x01
853 #define _PORTG_CCP3             0x01
854 #define _PORTG_RG1              0x02
855 #define _PORTG_TX2              0x02
856 #define _PORTG_CK2              0x02
857 #define _PORTG_RG2              0x04
858 #define _PORTG_RX2              0x04
859 #define _PORTG_DT2              0x04
860 #define _PORTG_RG3              0x08
861 #define _PORTG_CCP4             0x08
862 #define _PORTG_RG4              0x10
863 #define _PORTG_CCP5             0x10
864 
865 //==============================================================================
866 
867 
868 //==============================================================================
869 //        LATA Bits
870 
871 extern __at(0x0F89) __sfr LATA;
872 
873 typedef union
874   {
875   struct
876     {
877     unsigned LATA0              : 1;
878     unsigned LATA1              : 1;
879     unsigned LATA2              : 1;
880     unsigned LATA3              : 1;
881     unsigned LATA4              : 1;
882     unsigned LATA5              : 1;
883     unsigned LATA6              : 1;
884     unsigned                    : 1;
885     };
886 
887   struct
888     {
889     unsigned LATA               : 7;
890     unsigned                    : 1;
891     };
892   } __LATAbits_t;
893 
894 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
895 
896 #define _LATA0                  0x01
897 #define _LATA1                  0x02
898 #define _LATA2                  0x04
899 #define _LATA3                  0x08
900 #define _LATA4                  0x10
901 #define _LATA5                  0x20
902 #define _LATA6                  0x40
903 
904 //==============================================================================
905 
906 
907 //==============================================================================
908 //        LATB Bits
909 
910 extern __at(0x0F8A) __sfr LATB;
911 
912 typedef struct
913   {
914   unsigned LATB0                : 1;
915   unsigned LATB1                : 1;
916   unsigned LATB2                : 1;
917   unsigned LATB3                : 1;
918   unsigned LATB4                : 1;
919   unsigned LATB5                : 1;
920   unsigned LATB6                : 1;
921   unsigned LATB7                : 1;
922   } __LATBbits_t;
923 
924 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
925 
926 #define _LATB0                  0x01
927 #define _LATB1                  0x02
928 #define _LATB2                  0x04
929 #define _LATB3                  0x08
930 #define _LATB4                  0x10
931 #define _LATB5                  0x20
932 #define _LATB6                  0x40
933 #define _LATB7                  0x80
934 
935 //==============================================================================
936 
937 
938 //==============================================================================
939 //        LATC Bits
940 
941 extern __at(0x0F8B) __sfr LATC;
942 
943 typedef struct
944   {
945   unsigned LATC0                : 1;
946   unsigned LATC1                : 1;
947   unsigned LATC2                : 1;
948   unsigned LATC3                : 1;
949   unsigned LATC4                : 1;
950   unsigned LATC5                : 1;
951   unsigned LATC6                : 1;
952   unsigned LATC7                : 1;
953   } __LATCbits_t;
954 
955 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
956 
957 #define _LATC0                  0x01
958 #define _LATC1                  0x02
959 #define _LATC2                  0x04
960 #define _LATC3                  0x08
961 #define _LATC4                  0x10
962 #define _LATC5                  0x20
963 #define _LATC6                  0x40
964 #define _LATC7                  0x80
965 
966 //==============================================================================
967 
968 
969 //==============================================================================
970 //        LATD Bits
971 
972 extern __at(0x0F8C) __sfr LATD;
973 
974 typedef struct
975   {
976   unsigned LATD0                : 1;
977   unsigned LATD1                : 1;
978   unsigned LATD2                : 1;
979   unsigned LATD3                : 1;
980   unsigned LATD4                : 1;
981   unsigned LATD5                : 1;
982   unsigned LATD6                : 1;
983   unsigned LATD7                : 1;
984   } __LATDbits_t;
985 
986 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
987 
988 #define _LATD0                  0x01
989 #define _LATD1                  0x02
990 #define _LATD2                  0x04
991 #define _LATD3                  0x08
992 #define _LATD4                  0x10
993 #define _LATD5                  0x20
994 #define _LATD6                  0x40
995 #define _LATD7                  0x80
996 
997 //==============================================================================
998 
999 
1000 //==============================================================================
1001 //        LATE Bits
1002 
1003 extern __at(0x0F8D) __sfr LATE;
1004 
1005 typedef struct
1006   {
1007   unsigned LATE0                : 1;
1008   unsigned LATE1                : 1;
1009   unsigned LATE2                : 1;
1010   unsigned LATE3                : 1;
1011   unsigned LATE4                : 1;
1012   unsigned LATE5                : 1;
1013   unsigned LATE6                : 1;
1014   unsigned LATE7                : 1;
1015   } __LATEbits_t;
1016 
1017 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1018 
1019 #define _LATE0                  0x01
1020 #define _LATE1                  0x02
1021 #define _LATE2                  0x04
1022 #define _LATE3                  0x08
1023 #define _LATE4                  0x10
1024 #define _LATE5                  0x20
1025 #define _LATE6                  0x40
1026 #define _LATE7                  0x80
1027 
1028 //==============================================================================
1029 
1030 
1031 //==============================================================================
1032 //        LATF Bits
1033 
1034 extern __at(0x0F8E) __sfr LATF;
1035 
1036 typedef struct
1037   {
1038   unsigned LATF0                : 1;
1039   unsigned LATF1                : 1;
1040   unsigned LATF2                : 1;
1041   unsigned LATF3                : 1;
1042   unsigned LATF4                : 1;
1043   unsigned LATF5                : 1;
1044   unsigned LATF6                : 1;
1045   unsigned LATF7                : 1;
1046   } __LATFbits_t;
1047 
1048 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
1049 
1050 #define _LATF0                  0x01
1051 #define _LATF1                  0x02
1052 #define _LATF2                  0x04
1053 #define _LATF3                  0x08
1054 #define _LATF4                  0x10
1055 #define _LATF5                  0x20
1056 #define _LATF6                  0x40
1057 #define _LATF7                  0x80
1058 
1059 //==============================================================================
1060 
1061 
1062 //==============================================================================
1063 //        LATG Bits
1064 
1065 extern __at(0x0F8F) __sfr LATG;
1066 
1067 typedef union
1068   {
1069   struct
1070     {
1071     unsigned LATG0              : 1;
1072     unsigned LATG1              : 1;
1073     unsigned LATG2              : 1;
1074     unsigned LATG3              : 1;
1075     unsigned LATG4              : 1;
1076     unsigned                    : 1;
1077     unsigned                    : 1;
1078     unsigned                    : 1;
1079     };
1080 
1081   struct
1082     {
1083     unsigned LATG               : 5;
1084     unsigned                    : 3;
1085     };
1086   } __LATGbits_t;
1087 
1088 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
1089 
1090 #define _LATG0                  0x01
1091 #define _LATG1                  0x02
1092 #define _LATG2                  0x04
1093 #define _LATG3                  0x08
1094 #define _LATG4                  0x10
1095 
1096 //==============================================================================
1097 
1098 
1099 //==============================================================================
1100 //        DDRA Bits
1101 
1102 extern __at(0x0F92) __sfr DDRA;
1103 
1104 typedef union
1105   {
1106   struct
1107     {
1108     unsigned TRISA0             : 1;
1109     unsigned TRISA1             : 1;
1110     unsigned TRISA2             : 1;
1111     unsigned TRISA3             : 1;
1112     unsigned TRISA4             : 1;
1113     unsigned TRISA5             : 1;
1114     unsigned TRISA6             : 1;
1115     unsigned                    : 1;
1116     };
1117 
1118   struct
1119     {
1120     unsigned RA0                : 1;
1121     unsigned RA1                : 1;
1122     unsigned RA2                : 1;
1123     unsigned RA3                : 1;
1124     unsigned RA4                : 1;
1125     unsigned RA5                : 1;
1126     unsigned RA6                : 1;
1127     unsigned                    : 1;
1128     };
1129 
1130   struct
1131     {
1132     unsigned TRISA              : 7;
1133     unsigned                    : 1;
1134     };
1135 
1136   struct
1137     {
1138     unsigned RA                 : 7;
1139     unsigned                    : 1;
1140     };
1141   } __DDRAbits_t;
1142 
1143 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1144 
1145 #define _TRISA0                 0x01
1146 #define _RA0                    0x01
1147 #define _TRISA1                 0x02
1148 #define _RA1                    0x02
1149 #define _TRISA2                 0x04
1150 #define _RA2                    0x04
1151 #define _TRISA3                 0x08
1152 #define _RA3                    0x08
1153 #define _TRISA4                 0x10
1154 #define _RA4                    0x10
1155 #define _TRISA5                 0x20
1156 #define _RA5                    0x20
1157 #define _TRISA6                 0x40
1158 #define _RA6                    0x40
1159 
1160 //==============================================================================
1161 
1162 
1163 //==============================================================================
1164 //        TRISA Bits
1165 
1166 extern __at(0x0F92) __sfr TRISA;
1167 
1168 typedef union
1169   {
1170   struct
1171     {
1172     unsigned TRISA0             : 1;
1173     unsigned TRISA1             : 1;
1174     unsigned TRISA2             : 1;
1175     unsigned TRISA3             : 1;
1176     unsigned TRISA4             : 1;
1177     unsigned TRISA5             : 1;
1178     unsigned TRISA6             : 1;
1179     unsigned                    : 1;
1180     };
1181 
1182   struct
1183     {
1184     unsigned RA0                : 1;
1185     unsigned RA1                : 1;
1186     unsigned RA2                : 1;
1187     unsigned RA3                : 1;
1188     unsigned RA4                : 1;
1189     unsigned RA5                : 1;
1190     unsigned RA6                : 1;
1191     unsigned                    : 1;
1192     };
1193 
1194   struct
1195     {
1196     unsigned TRISA              : 7;
1197     unsigned                    : 1;
1198     };
1199 
1200   struct
1201     {
1202     unsigned RA                 : 7;
1203     unsigned                    : 1;
1204     };
1205   } __TRISAbits_t;
1206 
1207 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1208 
1209 #define _TRISA_TRISA0           0x01
1210 #define _TRISA_RA0              0x01
1211 #define _TRISA_TRISA1           0x02
1212 #define _TRISA_RA1              0x02
1213 #define _TRISA_TRISA2           0x04
1214 #define _TRISA_RA2              0x04
1215 #define _TRISA_TRISA3           0x08
1216 #define _TRISA_RA3              0x08
1217 #define _TRISA_TRISA4           0x10
1218 #define _TRISA_RA4              0x10
1219 #define _TRISA_TRISA5           0x20
1220 #define _TRISA_RA5              0x20
1221 #define _TRISA_TRISA6           0x40
1222 #define _TRISA_RA6              0x40
1223 
1224 //==============================================================================
1225 
1226 
1227 //==============================================================================
1228 //        DDRB Bits
1229 
1230 extern __at(0x0F93) __sfr DDRB;
1231 
1232 typedef union
1233   {
1234   struct
1235     {
1236     unsigned TRISB0             : 1;
1237     unsigned TRISB1             : 1;
1238     unsigned TRISB2             : 1;
1239     unsigned TRISB3             : 1;
1240     unsigned TRISB4             : 1;
1241     unsigned TRISB5             : 1;
1242     unsigned TRISB6             : 1;
1243     unsigned TRISB7             : 1;
1244     };
1245 
1246   struct
1247     {
1248     unsigned RB0                : 1;
1249     unsigned RB1                : 1;
1250     unsigned RB2                : 1;
1251     unsigned RB3                : 1;
1252     unsigned RB4                : 1;
1253     unsigned RB5                : 1;
1254     unsigned RB6                : 1;
1255     unsigned RB7                : 1;
1256     };
1257   } __DDRBbits_t;
1258 
1259 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1260 
1261 #define _TRISB0                 0x01
1262 #define _RB0                    0x01
1263 #define _TRISB1                 0x02
1264 #define _RB1                    0x02
1265 #define _TRISB2                 0x04
1266 #define _RB2                    0x04
1267 #define _TRISB3                 0x08
1268 #define _RB3                    0x08
1269 #define _TRISB4                 0x10
1270 #define _RB4                    0x10
1271 #define _TRISB5                 0x20
1272 #define _RB5                    0x20
1273 #define _TRISB6                 0x40
1274 #define _RB6                    0x40
1275 #define _TRISB7                 0x80
1276 #define _RB7                    0x80
1277 
1278 //==============================================================================
1279 
1280 
1281 //==============================================================================
1282 //        TRISB Bits
1283 
1284 extern __at(0x0F93) __sfr TRISB;
1285 
1286 typedef union
1287   {
1288   struct
1289     {
1290     unsigned TRISB0             : 1;
1291     unsigned TRISB1             : 1;
1292     unsigned TRISB2             : 1;
1293     unsigned TRISB3             : 1;
1294     unsigned TRISB4             : 1;
1295     unsigned TRISB5             : 1;
1296     unsigned TRISB6             : 1;
1297     unsigned TRISB7             : 1;
1298     };
1299 
1300   struct
1301     {
1302     unsigned RB0                : 1;
1303     unsigned RB1                : 1;
1304     unsigned RB2                : 1;
1305     unsigned RB3                : 1;
1306     unsigned RB4                : 1;
1307     unsigned RB5                : 1;
1308     unsigned RB6                : 1;
1309     unsigned RB7                : 1;
1310     };
1311   } __TRISBbits_t;
1312 
1313 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1314 
1315 #define _TRISB_TRISB0           0x01
1316 #define _TRISB_RB0              0x01
1317 #define _TRISB_TRISB1           0x02
1318 #define _TRISB_RB1              0x02
1319 #define _TRISB_TRISB2           0x04
1320 #define _TRISB_RB2              0x04
1321 #define _TRISB_TRISB3           0x08
1322 #define _TRISB_RB3              0x08
1323 #define _TRISB_TRISB4           0x10
1324 #define _TRISB_RB4              0x10
1325 #define _TRISB_TRISB5           0x20
1326 #define _TRISB_RB5              0x20
1327 #define _TRISB_TRISB6           0x40
1328 #define _TRISB_RB6              0x40
1329 #define _TRISB_TRISB7           0x80
1330 #define _TRISB_RB7              0x80
1331 
1332 //==============================================================================
1333 
1334 
1335 //==============================================================================
1336 //        DDRC Bits
1337 
1338 extern __at(0x0F94) __sfr DDRC;
1339 
1340 typedef union
1341   {
1342   struct
1343     {
1344     unsigned TRISC0             : 1;
1345     unsigned TRISC1             : 1;
1346     unsigned TRISC2             : 1;
1347     unsigned TRISC3             : 1;
1348     unsigned TRISC4             : 1;
1349     unsigned TRISC5             : 1;
1350     unsigned TRISC6             : 1;
1351     unsigned TRISC7             : 1;
1352     };
1353 
1354   struct
1355     {
1356     unsigned RC0                : 1;
1357     unsigned RC1                : 1;
1358     unsigned RC2                : 1;
1359     unsigned RC3                : 1;
1360     unsigned RC4                : 1;
1361     unsigned RC5                : 1;
1362     unsigned RC6                : 1;
1363     unsigned RC7                : 1;
1364     };
1365   } __DDRCbits_t;
1366 
1367 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1368 
1369 #define _TRISC0                 0x01
1370 #define _RC0                    0x01
1371 #define _TRISC1                 0x02
1372 #define _RC1                    0x02
1373 #define _TRISC2                 0x04
1374 #define _RC2                    0x04
1375 #define _TRISC3                 0x08
1376 #define _RC3                    0x08
1377 #define _TRISC4                 0x10
1378 #define _RC4                    0x10
1379 #define _TRISC5                 0x20
1380 #define _RC5                    0x20
1381 #define _TRISC6                 0x40
1382 #define _RC6                    0x40
1383 #define _TRISC7                 0x80
1384 #define _RC7                    0x80
1385 
1386 //==============================================================================
1387 
1388 
1389 //==============================================================================
1390 //        TRISC Bits
1391 
1392 extern __at(0x0F94) __sfr TRISC;
1393 
1394 typedef union
1395   {
1396   struct
1397     {
1398     unsigned TRISC0             : 1;
1399     unsigned TRISC1             : 1;
1400     unsigned TRISC2             : 1;
1401     unsigned TRISC3             : 1;
1402     unsigned TRISC4             : 1;
1403     unsigned TRISC5             : 1;
1404     unsigned TRISC6             : 1;
1405     unsigned TRISC7             : 1;
1406     };
1407 
1408   struct
1409     {
1410     unsigned RC0                : 1;
1411     unsigned RC1                : 1;
1412     unsigned RC2                : 1;
1413     unsigned RC3                : 1;
1414     unsigned RC4                : 1;
1415     unsigned RC5                : 1;
1416     unsigned RC6                : 1;
1417     unsigned RC7                : 1;
1418     };
1419   } __TRISCbits_t;
1420 
1421 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1422 
1423 #define _TRISC_TRISC0           0x01
1424 #define _TRISC_RC0              0x01
1425 #define _TRISC_TRISC1           0x02
1426 #define _TRISC_RC1              0x02
1427 #define _TRISC_TRISC2           0x04
1428 #define _TRISC_RC2              0x04
1429 #define _TRISC_TRISC3           0x08
1430 #define _TRISC_RC3              0x08
1431 #define _TRISC_TRISC4           0x10
1432 #define _TRISC_RC4              0x10
1433 #define _TRISC_TRISC5           0x20
1434 #define _TRISC_RC5              0x20
1435 #define _TRISC_TRISC6           0x40
1436 #define _TRISC_RC6              0x40
1437 #define _TRISC_TRISC7           0x80
1438 #define _TRISC_RC7              0x80
1439 
1440 //==============================================================================
1441 
1442 
1443 //==============================================================================
1444 //        DDRD Bits
1445 
1446 extern __at(0x0F95) __sfr DDRD;
1447 
1448 typedef union
1449   {
1450   struct
1451     {
1452     unsigned TRISD0             : 1;
1453     unsigned TRISD1             : 1;
1454     unsigned TRISD2             : 1;
1455     unsigned TRISD3             : 1;
1456     unsigned TRISD4             : 1;
1457     unsigned TRISD5             : 1;
1458     unsigned TRISD6             : 1;
1459     unsigned TRISD7             : 1;
1460     };
1461 
1462   struct
1463     {
1464     unsigned RD0                : 1;
1465     unsigned RD1                : 1;
1466     unsigned RD2                : 1;
1467     unsigned RD3                : 1;
1468     unsigned RD4                : 1;
1469     unsigned RD5                : 1;
1470     unsigned RD6                : 1;
1471     unsigned RD7                : 1;
1472     };
1473   } __DDRDbits_t;
1474 
1475 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
1476 
1477 #define _TRISD0                 0x01
1478 #define _RD0                    0x01
1479 #define _TRISD1                 0x02
1480 #define _RD1                    0x02
1481 #define _TRISD2                 0x04
1482 #define _RD2                    0x04
1483 #define _TRISD3                 0x08
1484 #define _RD3                    0x08
1485 #define _TRISD4                 0x10
1486 #define _RD4                    0x10
1487 #define _TRISD5                 0x20
1488 #define _RD5                    0x20
1489 #define _TRISD6                 0x40
1490 #define _RD6                    0x40
1491 #define _TRISD7                 0x80
1492 #define _RD7                    0x80
1493 
1494 //==============================================================================
1495 
1496 
1497 //==============================================================================
1498 //        TRISD Bits
1499 
1500 extern __at(0x0F95) __sfr TRISD;
1501 
1502 typedef union
1503   {
1504   struct
1505     {
1506     unsigned TRISD0             : 1;
1507     unsigned TRISD1             : 1;
1508     unsigned TRISD2             : 1;
1509     unsigned TRISD3             : 1;
1510     unsigned TRISD4             : 1;
1511     unsigned TRISD5             : 1;
1512     unsigned TRISD6             : 1;
1513     unsigned TRISD7             : 1;
1514     };
1515 
1516   struct
1517     {
1518     unsigned RD0                : 1;
1519     unsigned RD1                : 1;
1520     unsigned RD2                : 1;
1521     unsigned RD3                : 1;
1522     unsigned RD4                : 1;
1523     unsigned RD5                : 1;
1524     unsigned RD6                : 1;
1525     unsigned RD7                : 1;
1526     };
1527   } __TRISDbits_t;
1528 
1529 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
1530 
1531 #define _TRISD_TRISD0           0x01
1532 #define _TRISD_RD0              0x01
1533 #define _TRISD_TRISD1           0x02
1534 #define _TRISD_RD1              0x02
1535 #define _TRISD_TRISD2           0x04
1536 #define _TRISD_RD2              0x04
1537 #define _TRISD_TRISD3           0x08
1538 #define _TRISD_RD3              0x08
1539 #define _TRISD_TRISD4           0x10
1540 #define _TRISD_RD4              0x10
1541 #define _TRISD_TRISD5           0x20
1542 #define _TRISD_RD5              0x20
1543 #define _TRISD_TRISD6           0x40
1544 #define _TRISD_RD6              0x40
1545 #define _TRISD_TRISD7           0x80
1546 #define _TRISD_RD7              0x80
1547 
1548 //==============================================================================
1549 
1550 
1551 //==============================================================================
1552 //        DDRE Bits
1553 
1554 extern __at(0x0F96) __sfr DDRE;
1555 
1556 typedef union
1557   {
1558   struct
1559     {
1560     unsigned TRISE0             : 1;
1561     unsigned TRISE1             : 1;
1562     unsigned TRISE2             : 1;
1563     unsigned TRISE3             : 1;
1564     unsigned TRISE4             : 1;
1565     unsigned TRISE5             : 1;
1566     unsigned TRISE6             : 1;
1567     unsigned TRISE7             : 1;
1568     };
1569 
1570   struct
1571     {
1572     unsigned RE0                : 1;
1573     unsigned RE1                : 1;
1574     unsigned RE2                : 1;
1575     unsigned RE3                : 1;
1576     unsigned RE4                : 1;
1577     unsigned RE5                : 1;
1578     unsigned RE6                : 1;
1579     unsigned RE7                : 1;
1580     };
1581   } __DDREbits_t;
1582 
1583 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
1584 
1585 #define _TRISE0                 0x01
1586 #define _RE0                    0x01
1587 #define _TRISE1                 0x02
1588 #define _RE1                    0x02
1589 #define _TRISE2                 0x04
1590 #define _RE2                    0x04
1591 #define _TRISE3                 0x08
1592 #define _RE3                    0x08
1593 #define _TRISE4                 0x10
1594 #define _RE4                    0x10
1595 #define _TRISE5                 0x20
1596 #define _RE5                    0x20
1597 #define _TRISE6                 0x40
1598 #define _RE6                    0x40
1599 #define _TRISE7                 0x80
1600 #define _RE7                    0x80
1601 
1602 //==============================================================================
1603 
1604 
1605 //==============================================================================
1606 //        TRISE Bits
1607 
1608 extern __at(0x0F96) __sfr TRISE;
1609 
1610 typedef union
1611   {
1612   struct
1613     {
1614     unsigned TRISE0             : 1;
1615     unsigned TRISE1             : 1;
1616     unsigned TRISE2             : 1;
1617     unsigned TRISE3             : 1;
1618     unsigned TRISE4             : 1;
1619     unsigned TRISE5             : 1;
1620     unsigned TRISE6             : 1;
1621     unsigned TRISE7             : 1;
1622     };
1623 
1624   struct
1625     {
1626     unsigned RE0                : 1;
1627     unsigned RE1                : 1;
1628     unsigned RE2                : 1;
1629     unsigned RE3                : 1;
1630     unsigned RE4                : 1;
1631     unsigned RE5                : 1;
1632     unsigned RE6                : 1;
1633     unsigned RE7                : 1;
1634     };
1635   } __TRISEbits_t;
1636 
1637 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
1638 
1639 #define _TRISE_TRISE0           0x01
1640 #define _TRISE_RE0              0x01
1641 #define _TRISE_TRISE1           0x02
1642 #define _TRISE_RE1              0x02
1643 #define _TRISE_TRISE2           0x04
1644 #define _TRISE_RE2              0x04
1645 #define _TRISE_TRISE3           0x08
1646 #define _TRISE_RE3              0x08
1647 #define _TRISE_TRISE4           0x10
1648 #define _TRISE_RE4              0x10
1649 #define _TRISE_TRISE5           0x20
1650 #define _TRISE_RE5              0x20
1651 #define _TRISE_TRISE6           0x40
1652 #define _TRISE_RE6              0x40
1653 #define _TRISE_TRISE7           0x80
1654 #define _TRISE_RE7              0x80
1655 
1656 //==============================================================================
1657 
1658 
1659 //==============================================================================
1660 //        DDRF Bits
1661 
1662 extern __at(0x0F97) __sfr DDRF;
1663 
1664 typedef union
1665   {
1666   struct
1667     {
1668     unsigned TRISF0             : 1;
1669     unsigned TRISF1             : 1;
1670     unsigned TRISF2             : 1;
1671     unsigned TRISF3             : 1;
1672     unsigned TRISF4             : 1;
1673     unsigned TRISF5             : 1;
1674     unsigned TRISF6             : 1;
1675     unsigned TRISF7             : 1;
1676     };
1677 
1678   struct
1679     {
1680     unsigned RF0                : 1;
1681     unsigned RF1                : 1;
1682     unsigned RF2                : 1;
1683     unsigned RF3                : 1;
1684     unsigned RF4                : 1;
1685     unsigned RF5                : 1;
1686     unsigned RF6                : 1;
1687     unsigned RF7                : 1;
1688     };
1689   } __DDRFbits_t;
1690 
1691 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
1692 
1693 #define _TRISF0                 0x01
1694 #define _RF0                    0x01
1695 #define _TRISF1                 0x02
1696 #define _RF1                    0x02
1697 #define _TRISF2                 0x04
1698 #define _RF2                    0x04
1699 #define _TRISF3                 0x08
1700 #define _RF3                    0x08
1701 #define _TRISF4                 0x10
1702 #define _RF4                    0x10
1703 #define _TRISF5                 0x20
1704 #define _RF5                    0x20
1705 #define _TRISF6                 0x40
1706 #define _RF6                    0x40
1707 #define _TRISF7                 0x80
1708 #define _RF7                    0x80
1709 
1710 //==============================================================================
1711 
1712 
1713 //==============================================================================
1714 //        TRISF Bits
1715 
1716 extern __at(0x0F97) __sfr TRISF;
1717 
1718 typedef union
1719   {
1720   struct
1721     {
1722     unsigned TRISF0             : 1;
1723     unsigned TRISF1             : 1;
1724     unsigned TRISF2             : 1;
1725     unsigned TRISF3             : 1;
1726     unsigned TRISF4             : 1;
1727     unsigned TRISF5             : 1;
1728     unsigned TRISF6             : 1;
1729     unsigned TRISF7             : 1;
1730     };
1731 
1732   struct
1733     {
1734     unsigned RF0                : 1;
1735     unsigned RF1                : 1;
1736     unsigned RF2                : 1;
1737     unsigned RF3                : 1;
1738     unsigned RF4                : 1;
1739     unsigned RF5                : 1;
1740     unsigned RF6                : 1;
1741     unsigned RF7                : 1;
1742     };
1743   } __TRISFbits_t;
1744 
1745 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
1746 
1747 #define _TRISF_TRISF0           0x01
1748 #define _TRISF_RF0              0x01
1749 #define _TRISF_TRISF1           0x02
1750 #define _TRISF_RF1              0x02
1751 #define _TRISF_TRISF2           0x04
1752 #define _TRISF_RF2              0x04
1753 #define _TRISF_TRISF3           0x08
1754 #define _TRISF_RF3              0x08
1755 #define _TRISF_TRISF4           0x10
1756 #define _TRISF_RF4              0x10
1757 #define _TRISF_TRISF5           0x20
1758 #define _TRISF_RF5              0x20
1759 #define _TRISF_TRISF6           0x40
1760 #define _TRISF_RF6              0x40
1761 #define _TRISF_TRISF7           0x80
1762 #define _TRISF_RF7              0x80
1763 
1764 //==============================================================================
1765 
1766 
1767 //==============================================================================
1768 //        DDRG Bits
1769 
1770 extern __at(0x0F98) __sfr DDRG;
1771 
1772 typedef union
1773   {
1774   struct
1775     {
1776     unsigned TRISG0             : 1;
1777     unsigned TRISG1             : 1;
1778     unsigned TRISG2             : 1;
1779     unsigned TRISG3             : 1;
1780     unsigned TRISG4             : 1;
1781     unsigned                    : 1;
1782     unsigned                    : 1;
1783     unsigned                    : 1;
1784     };
1785 
1786   struct
1787     {
1788     unsigned RG0                : 1;
1789     unsigned RG1                : 1;
1790     unsigned RG2                : 1;
1791     unsigned RG3                : 1;
1792     unsigned RG4                : 1;
1793     unsigned                    : 1;
1794     unsigned                    : 1;
1795     unsigned                    : 1;
1796     };
1797 
1798   struct
1799     {
1800     unsigned RG                 : 5;
1801     unsigned                    : 3;
1802     };
1803 
1804   struct
1805     {
1806     unsigned TRISG              : 5;
1807     unsigned                    : 3;
1808     };
1809   } __DDRGbits_t;
1810 
1811 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
1812 
1813 #define _TRISG0                 0x01
1814 #define _RG0                    0x01
1815 #define _TRISG1                 0x02
1816 #define _RG1                    0x02
1817 #define _TRISG2                 0x04
1818 #define _RG2                    0x04
1819 #define _TRISG3                 0x08
1820 #define _RG3                    0x08
1821 #define _TRISG4                 0x10
1822 #define _RG4                    0x10
1823 
1824 //==============================================================================
1825 
1826 
1827 //==============================================================================
1828 //        TRISG Bits
1829 
1830 extern __at(0x0F98) __sfr TRISG;
1831 
1832 typedef union
1833   {
1834   struct
1835     {
1836     unsigned TRISG0             : 1;
1837     unsigned TRISG1             : 1;
1838     unsigned TRISG2             : 1;
1839     unsigned TRISG3             : 1;
1840     unsigned TRISG4             : 1;
1841     unsigned                    : 1;
1842     unsigned                    : 1;
1843     unsigned                    : 1;
1844     };
1845 
1846   struct
1847     {
1848     unsigned RG0                : 1;
1849     unsigned RG1                : 1;
1850     unsigned RG2                : 1;
1851     unsigned RG3                : 1;
1852     unsigned RG4                : 1;
1853     unsigned                    : 1;
1854     unsigned                    : 1;
1855     unsigned                    : 1;
1856     };
1857 
1858   struct
1859     {
1860     unsigned RG                 : 5;
1861     unsigned                    : 3;
1862     };
1863 
1864   struct
1865     {
1866     unsigned TRISG              : 5;
1867     unsigned                    : 3;
1868     };
1869   } __TRISGbits_t;
1870 
1871 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
1872 
1873 #define _TRISG_TRISG0           0x01
1874 #define _TRISG_RG0              0x01
1875 #define _TRISG_TRISG1           0x02
1876 #define _TRISG_RG1              0x02
1877 #define _TRISG_TRISG2           0x04
1878 #define _TRISG_RG2              0x04
1879 #define _TRISG_TRISG3           0x08
1880 #define _TRISG_RG3              0x08
1881 #define _TRISG_TRISG4           0x10
1882 #define _TRISG_RG4              0x10
1883 
1884 //==============================================================================
1885 
1886 
1887 //==============================================================================
1888 //        PIE1 Bits
1889 
1890 extern __at(0x0F9D) __sfr PIE1;
1891 
1892 typedef union
1893   {
1894   struct
1895     {
1896     unsigned TMR1IE             : 1;
1897     unsigned TMR2IE             : 1;
1898     unsigned CCP1IE             : 1;
1899     unsigned SSPIE              : 1;
1900     unsigned TXIE               : 1;
1901     unsigned RCIE               : 1;
1902     unsigned ADIE               : 1;
1903     unsigned PSPIE              : 1;
1904     };
1905 
1906   struct
1907     {
1908     unsigned                    : 1;
1909     unsigned                    : 1;
1910     unsigned                    : 1;
1911     unsigned                    : 1;
1912     unsigned TX1IE              : 1;
1913     unsigned RC1IE              : 1;
1914     unsigned                    : 1;
1915     unsigned                    : 1;
1916     };
1917   } __PIE1bits_t;
1918 
1919 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1920 
1921 #define _TMR1IE                 0x01
1922 #define _TMR2IE                 0x02
1923 #define _CCP1IE                 0x04
1924 #define _SSPIE                  0x08
1925 #define _TXIE                   0x10
1926 #define _TX1IE                  0x10
1927 #define _RCIE                   0x20
1928 #define _RC1IE                  0x20
1929 #define _ADIE                   0x40
1930 #define _PSPIE                  0x80
1931 
1932 //==============================================================================
1933 
1934 
1935 //==============================================================================
1936 //        PIR1 Bits
1937 
1938 extern __at(0x0F9E) __sfr PIR1;
1939 
1940 typedef union
1941   {
1942   struct
1943     {
1944     unsigned TMR1IF             : 1;
1945     unsigned TMR2IF             : 1;
1946     unsigned CCP1IF             : 1;
1947     unsigned SSPIF              : 1;
1948     unsigned TXIF               : 1;
1949     unsigned RCIF               : 1;
1950     unsigned ADIF               : 1;
1951     unsigned PSPIF              : 1;
1952     };
1953 
1954   struct
1955     {
1956     unsigned                    : 1;
1957     unsigned                    : 1;
1958     unsigned                    : 1;
1959     unsigned                    : 1;
1960     unsigned TX1IF              : 1;
1961     unsigned RC1IF              : 1;
1962     unsigned                    : 1;
1963     unsigned                    : 1;
1964     };
1965   } __PIR1bits_t;
1966 
1967 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1968 
1969 #define _TMR1IF                 0x01
1970 #define _TMR2IF                 0x02
1971 #define _CCP1IF                 0x04
1972 #define _SSPIF                  0x08
1973 #define _TXIF                   0x10
1974 #define _TX1IF                  0x10
1975 #define _RCIF                   0x20
1976 #define _RC1IF                  0x20
1977 #define _ADIF                   0x40
1978 #define _PSPIF                  0x80
1979 
1980 //==============================================================================
1981 
1982 
1983 //==============================================================================
1984 //        IPR1 Bits
1985 
1986 extern __at(0x0F9F) __sfr IPR1;
1987 
1988 typedef union
1989   {
1990   struct
1991     {
1992     unsigned TMR1IP             : 1;
1993     unsigned TMR2IP             : 1;
1994     unsigned CCP1IP             : 1;
1995     unsigned SSPIP              : 1;
1996     unsigned TXIP               : 1;
1997     unsigned RCIP               : 1;
1998     unsigned ADIP               : 1;
1999     unsigned PSPIP              : 1;
2000     };
2001 
2002   struct
2003     {
2004     unsigned                    : 1;
2005     unsigned                    : 1;
2006     unsigned                    : 1;
2007     unsigned                    : 1;
2008     unsigned TX1IP              : 1;
2009     unsigned RC1IP              : 1;
2010     unsigned                    : 1;
2011     unsigned                    : 1;
2012     };
2013   } __IPR1bits_t;
2014 
2015 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2016 
2017 #define _TMR1IP                 0x01
2018 #define _TMR2IP                 0x02
2019 #define _CCP1IP                 0x04
2020 #define _SSPIP                  0x08
2021 #define _TXIP                   0x10
2022 #define _TX1IP                  0x10
2023 #define _RCIP                   0x20
2024 #define _RC1IP                  0x20
2025 #define _ADIP                   0x40
2026 #define _PSPIP                  0x80
2027 
2028 //==============================================================================
2029 
2030 
2031 //==============================================================================
2032 //        PIE2 Bits
2033 
2034 extern __at(0x0FA0) __sfr PIE2;
2035 
2036 typedef struct
2037   {
2038   unsigned CCP2IE               : 1;
2039   unsigned TMR3IE               : 1;
2040   unsigned LVDIE                : 1;
2041   unsigned BCLIE                : 1;
2042   unsigned EEIE                 : 1;
2043   unsigned                      : 1;
2044   unsigned CMIE                 : 1;
2045   unsigned                      : 1;
2046   } __PIE2bits_t;
2047 
2048 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2049 
2050 #define _CCP2IE                 0x01
2051 #define _TMR3IE                 0x02
2052 #define _LVDIE                  0x04
2053 #define _BCLIE                  0x08
2054 #define _EEIE                   0x10
2055 #define _CMIE                   0x40
2056 
2057 //==============================================================================
2058 
2059 
2060 //==============================================================================
2061 //        PIR2 Bits
2062 
2063 extern __at(0x0FA1) __sfr PIR2;
2064 
2065 typedef struct
2066   {
2067   unsigned CCP2IF               : 1;
2068   unsigned TMR3IF               : 1;
2069   unsigned LVDIF                : 1;
2070   unsigned BCLIF                : 1;
2071   unsigned EEIF                 : 1;
2072   unsigned                      : 1;
2073   unsigned CMIF                 : 1;
2074   unsigned                      : 1;
2075   } __PIR2bits_t;
2076 
2077 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2078 
2079 #define _CCP2IF                 0x01
2080 #define _TMR3IF                 0x02
2081 #define _LVDIF                  0x04
2082 #define _BCLIF                  0x08
2083 #define _EEIF                   0x10
2084 #define _CMIF                   0x40
2085 
2086 //==============================================================================
2087 
2088 
2089 //==============================================================================
2090 //        IPR2 Bits
2091 
2092 extern __at(0x0FA2) __sfr IPR2;
2093 
2094 typedef struct
2095   {
2096   unsigned CCP2IP               : 1;
2097   unsigned TMR3IP               : 1;
2098   unsigned LVDIP                : 1;
2099   unsigned BCLIP                : 1;
2100   unsigned EEIP                 : 1;
2101   unsigned                      : 1;
2102   unsigned CMIP                 : 1;
2103   unsigned                      : 1;
2104   } __IPR2bits_t;
2105 
2106 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
2107 
2108 #define _CCP2IP                 0x01
2109 #define _TMR3IP                 0x02
2110 #define _LVDIP                  0x04
2111 #define _BCLIP                  0x08
2112 #define _EEIP                   0x10
2113 #define _CMIP                   0x40
2114 
2115 //==============================================================================
2116 
2117 
2118 //==============================================================================
2119 //        PIE3 Bits
2120 
2121 extern __at(0x0FA3) __sfr PIE3;
2122 
2123 typedef struct
2124   {
2125   unsigned CCP3IE               : 1;
2126   unsigned CCP4IE               : 1;
2127   unsigned CCP5IE               : 1;
2128   unsigned TMR4IE               : 1;
2129   unsigned TX2IE                : 1;
2130   unsigned RC2IE                : 1;
2131   unsigned                      : 1;
2132   unsigned                      : 1;
2133   } __PIE3bits_t;
2134 
2135 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
2136 
2137 #define _CCP3IE                 0x01
2138 #define _CCP4IE                 0x02
2139 #define _CCP5IE                 0x04
2140 #define _TMR4IE                 0x08
2141 #define _TX2IE                  0x10
2142 #define _RC2IE                  0x20
2143 
2144 //==============================================================================
2145 
2146 
2147 //==============================================================================
2148 //        PIR3 Bits
2149 
2150 extern __at(0x0FA4) __sfr PIR3;
2151 
2152 typedef struct
2153   {
2154   unsigned CCP3IF               : 1;
2155   unsigned CCP4IF               : 1;
2156   unsigned CCP5IF               : 1;
2157   unsigned TMR4IF               : 1;
2158   unsigned TX2IF                : 1;
2159   unsigned RC2IF                : 1;
2160   unsigned                      : 1;
2161   unsigned                      : 1;
2162   } __PIR3bits_t;
2163 
2164 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
2165 
2166 #define _CCP3IF                 0x01
2167 #define _CCP4IF                 0x02
2168 #define _CCP5IF                 0x04
2169 #define _TMR4IF                 0x08
2170 #define _TX2IF                  0x10
2171 #define _RC2IF                  0x20
2172 
2173 //==============================================================================
2174 
2175 
2176 //==============================================================================
2177 //        IPR3 Bits
2178 
2179 extern __at(0x0FA5) __sfr IPR3;
2180 
2181 typedef struct
2182   {
2183   unsigned CCP3IP               : 1;
2184   unsigned CCP4IP               : 1;
2185   unsigned CCP5IP               : 1;
2186   unsigned TMR4IP               : 1;
2187   unsigned TX2IP                : 1;
2188   unsigned RC2IP                : 1;
2189   unsigned                      : 1;
2190   unsigned                      : 1;
2191   } __IPR3bits_t;
2192 
2193 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
2194 
2195 #define _CCP3IP                 0x01
2196 #define _CCP4IP                 0x02
2197 #define _CCP5IP                 0x04
2198 #define _TMR4IP                 0x08
2199 #define _TX2IP                  0x10
2200 #define _RC2IP                  0x20
2201 
2202 //==============================================================================
2203 
2204 
2205 //==============================================================================
2206 //        EECON1 Bits
2207 
2208 extern __at(0x0FA6) __sfr EECON1;
2209 
2210 typedef union
2211   {
2212   struct
2213     {
2214     unsigned RD                 : 1;
2215     unsigned WR                 : 1;
2216     unsigned WREN               : 1;
2217     unsigned WRERR              : 1;
2218     unsigned FREE               : 1;
2219     unsigned                    : 1;
2220     unsigned CFGS               : 1;
2221     unsigned EEPGD              : 1;
2222     };
2223 
2224   struct
2225     {
2226     unsigned                    : 1;
2227     unsigned                    : 1;
2228     unsigned                    : 1;
2229     unsigned                    : 1;
2230     unsigned                    : 1;
2231     unsigned                    : 1;
2232     unsigned EEFS               : 1;
2233     unsigned                    : 1;
2234     };
2235   } __EECON1bits_t;
2236 
2237 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
2238 
2239 #define _RD                     0x01
2240 #define _WR                     0x02
2241 #define _WREN                   0x04
2242 #define _WRERR                  0x08
2243 #define _FREE                   0x10
2244 #define _CFGS                   0x40
2245 #define _EEFS                   0x40
2246 #define _EEPGD                  0x80
2247 
2248 //==============================================================================
2249 
2250 extern __at(0x0FA7) __sfr EECON2;
2251 extern __at(0x0FA8) __sfr EEDATA;
2252 extern __at(0x0FA9) __sfr EEADR;
2253 extern __at(0x0FAA) __sfr EEADRH;
2254 
2255 //==============================================================================
2256 //        RCSTA Bits
2257 
2258 extern __at(0x0FAB) __sfr RCSTA;
2259 
2260 typedef union
2261   {
2262   struct
2263     {
2264     unsigned RX9D               : 1;
2265     unsigned OERR               : 1;
2266     unsigned FERR               : 1;
2267     unsigned ADDEN              : 1;
2268     unsigned CREN               : 1;
2269     unsigned SREN               : 1;
2270     unsigned RX9                : 1;
2271     unsigned SPEN               : 1;
2272     };
2273 
2274   struct
2275     {
2276     unsigned RCD8               : 1;
2277     unsigned OERR1              : 1;
2278     unsigned FERR1              : 1;
2279     unsigned ADEN               : 1;
2280     unsigned CREN1              : 1;
2281     unsigned SREN1              : 1;
2282     unsigned RC9                : 1;
2283     unsigned SPEN1              : 1;
2284     };
2285 
2286   struct
2287     {
2288     unsigned RX9D1              : 1;
2289     unsigned                    : 1;
2290     unsigned                    : 1;
2291     unsigned ADDEN1             : 1;
2292     unsigned                    : 1;
2293     unsigned                    : 1;
2294     unsigned NOT_RC8            : 1;
2295     unsigned                    : 1;
2296     };
2297 
2298   struct
2299     {
2300     unsigned                    : 1;
2301     unsigned                    : 1;
2302     unsigned                    : 1;
2303     unsigned                    : 1;
2304     unsigned                    : 1;
2305     unsigned                    : 1;
2306     unsigned RC8_9              : 1;
2307     unsigned                    : 1;
2308     };
2309 
2310   struct
2311     {
2312     unsigned                    : 1;
2313     unsigned                    : 1;
2314     unsigned                    : 1;
2315     unsigned                    : 1;
2316     unsigned                    : 1;
2317     unsigned                    : 1;
2318     unsigned RX91               : 1;
2319     unsigned                    : 1;
2320     };
2321   } __RCSTAbits_t;
2322 
2323 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
2324 
2325 #define _RX9D                   0x01
2326 #define _RCD8                   0x01
2327 #define _RX9D1                  0x01
2328 #define _OERR                   0x02
2329 #define _OERR1                  0x02
2330 #define _FERR                   0x04
2331 #define _FERR1                  0x04
2332 #define _ADDEN                  0x08
2333 #define _ADEN                   0x08
2334 #define _ADDEN1                 0x08
2335 #define _CREN                   0x10
2336 #define _CREN1                  0x10
2337 #define _SREN                   0x20
2338 #define _SREN1                  0x20
2339 #define _RX9                    0x40
2340 #define _RC9                    0x40
2341 #define _NOT_RC8                0x40
2342 #define _RC8_9                  0x40
2343 #define _RX91                   0x40
2344 #define _SPEN                   0x80
2345 #define _SPEN1                  0x80
2346 
2347 //==============================================================================
2348 
2349 
2350 //==============================================================================
2351 //        RCSTA1 Bits
2352 
2353 extern __at(0x0FAB) __sfr RCSTA1;
2354 
2355 typedef union
2356   {
2357   struct
2358     {
2359     unsigned RX9D               : 1;
2360     unsigned OERR               : 1;
2361     unsigned FERR               : 1;
2362     unsigned ADDEN              : 1;
2363     unsigned CREN               : 1;
2364     unsigned SREN               : 1;
2365     unsigned RX9                : 1;
2366     unsigned SPEN               : 1;
2367     };
2368 
2369   struct
2370     {
2371     unsigned RCD8               : 1;
2372     unsigned OERR1              : 1;
2373     unsigned FERR1              : 1;
2374     unsigned ADEN               : 1;
2375     unsigned CREN1              : 1;
2376     unsigned SREN1              : 1;
2377     unsigned RC9                : 1;
2378     unsigned SPEN1              : 1;
2379     };
2380 
2381   struct
2382     {
2383     unsigned RX9D1              : 1;
2384     unsigned                    : 1;
2385     unsigned                    : 1;
2386     unsigned ADDEN1             : 1;
2387     unsigned                    : 1;
2388     unsigned                    : 1;
2389     unsigned NOT_RC8            : 1;
2390     unsigned                    : 1;
2391     };
2392 
2393   struct
2394     {
2395     unsigned                    : 1;
2396     unsigned                    : 1;
2397     unsigned                    : 1;
2398     unsigned                    : 1;
2399     unsigned                    : 1;
2400     unsigned                    : 1;
2401     unsigned RC8_9              : 1;
2402     unsigned                    : 1;
2403     };
2404 
2405   struct
2406     {
2407     unsigned                    : 1;
2408     unsigned                    : 1;
2409     unsigned                    : 1;
2410     unsigned                    : 1;
2411     unsigned                    : 1;
2412     unsigned                    : 1;
2413     unsigned RX91               : 1;
2414     unsigned                    : 1;
2415     };
2416   } __RCSTA1bits_t;
2417 
2418 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
2419 
2420 #define _RCSTA1_RX9D            0x01
2421 #define _RCSTA1_RCD8            0x01
2422 #define _RCSTA1_RX9D1           0x01
2423 #define _RCSTA1_OERR            0x02
2424 #define _RCSTA1_OERR1           0x02
2425 #define _RCSTA1_FERR            0x04
2426 #define _RCSTA1_FERR1           0x04
2427 #define _RCSTA1_ADDEN           0x08
2428 #define _RCSTA1_ADEN            0x08
2429 #define _RCSTA1_ADDEN1          0x08
2430 #define _RCSTA1_CREN            0x10
2431 #define _RCSTA1_CREN1           0x10
2432 #define _RCSTA1_SREN            0x20
2433 #define _RCSTA1_SREN1           0x20
2434 #define _RCSTA1_RX9             0x40
2435 #define _RCSTA1_RC9             0x40
2436 #define _RCSTA1_NOT_RC8         0x40
2437 #define _RCSTA1_RC8_9           0x40
2438 #define _RCSTA1_RX91            0x40
2439 #define _RCSTA1_SPEN            0x80
2440 #define _RCSTA1_SPEN1           0x80
2441 
2442 //==============================================================================
2443 
2444 
2445 //==============================================================================
2446 //        TXSTA Bits
2447 
2448 extern __at(0x0FAC) __sfr TXSTA;
2449 
2450 typedef union
2451   {
2452   struct
2453     {
2454     unsigned TX9D               : 1;
2455     unsigned TRMT               : 1;
2456     unsigned BRGH               : 1;
2457     unsigned SENDB1             : 1;
2458     unsigned SYNC               : 1;
2459     unsigned TXEN               : 1;
2460     unsigned TX9                : 1;
2461     unsigned CSRC               : 1;
2462     };
2463 
2464   struct
2465     {
2466     unsigned TXD8               : 1;
2467     unsigned TRMT1              : 1;
2468     unsigned BRGH1              : 1;
2469     unsigned                    : 1;
2470     unsigned SYNC1              : 1;
2471     unsigned TXEN1              : 1;
2472     unsigned TX8_9              : 1;
2473     unsigned CSRC1              : 1;
2474     };
2475 
2476   struct
2477     {
2478     unsigned TX9D1              : 1;
2479     unsigned                    : 1;
2480     unsigned                    : 1;
2481     unsigned                    : 1;
2482     unsigned                    : 1;
2483     unsigned                    : 1;
2484     unsigned NOT_TX8            : 1;
2485     unsigned                    : 1;
2486     };
2487 
2488   struct
2489     {
2490     unsigned                    : 1;
2491     unsigned                    : 1;
2492     unsigned                    : 1;
2493     unsigned                    : 1;
2494     unsigned                    : 1;
2495     unsigned                    : 1;
2496     unsigned TX91               : 1;
2497     unsigned                    : 1;
2498     };
2499   } __TXSTAbits_t;
2500 
2501 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
2502 
2503 #define _TX9D                   0x01
2504 #define _TXD8                   0x01
2505 #define _TX9D1                  0x01
2506 #define _TRMT                   0x02
2507 #define _TRMT1                  0x02
2508 #define _BRGH                   0x04
2509 #define _BRGH1                  0x04
2510 #define _SENDB1                 0x08
2511 #define _SYNC                   0x10
2512 #define _SYNC1                  0x10
2513 #define _TXEN                   0x20
2514 #define _TXEN1                  0x20
2515 #define _TX9                    0x40
2516 #define _TX8_9                  0x40
2517 #define _NOT_TX8                0x40
2518 #define _TX91                   0x40
2519 #define _CSRC                   0x80
2520 #define _CSRC1                  0x80
2521 
2522 //==============================================================================
2523 
2524 
2525 //==============================================================================
2526 //        TXSTA1 Bits
2527 
2528 extern __at(0x0FAC) __sfr TXSTA1;
2529 
2530 typedef union
2531   {
2532   struct
2533     {
2534     unsigned TX9D               : 1;
2535     unsigned TRMT               : 1;
2536     unsigned BRGH               : 1;
2537     unsigned SENDB1             : 1;
2538     unsigned SYNC               : 1;
2539     unsigned TXEN               : 1;
2540     unsigned TX9                : 1;
2541     unsigned CSRC               : 1;
2542     };
2543 
2544   struct
2545     {
2546     unsigned TXD8               : 1;
2547     unsigned TRMT1              : 1;
2548     unsigned BRGH1              : 1;
2549     unsigned                    : 1;
2550     unsigned SYNC1              : 1;
2551     unsigned TXEN1              : 1;
2552     unsigned TX8_9              : 1;
2553     unsigned CSRC1              : 1;
2554     };
2555 
2556   struct
2557     {
2558     unsigned TX9D1              : 1;
2559     unsigned                    : 1;
2560     unsigned                    : 1;
2561     unsigned                    : 1;
2562     unsigned                    : 1;
2563     unsigned                    : 1;
2564     unsigned NOT_TX8            : 1;
2565     unsigned                    : 1;
2566     };
2567 
2568   struct
2569     {
2570     unsigned                    : 1;
2571     unsigned                    : 1;
2572     unsigned                    : 1;
2573     unsigned                    : 1;
2574     unsigned                    : 1;
2575     unsigned                    : 1;
2576     unsigned TX91               : 1;
2577     unsigned                    : 1;
2578     };
2579   } __TXSTA1bits_t;
2580 
2581 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
2582 
2583 #define _TXSTA1_TX9D            0x01
2584 #define _TXSTA1_TXD8            0x01
2585 #define _TXSTA1_TX9D1           0x01
2586 #define _TXSTA1_TRMT            0x02
2587 #define _TXSTA1_TRMT1           0x02
2588 #define _TXSTA1_BRGH            0x04
2589 #define _TXSTA1_BRGH1           0x04
2590 #define _TXSTA1_SENDB1          0x08
2591 #define _TXSTA1_SYNC            0x10
2592 #define _TXSTA1_SYNC1           0x10
2593 #define _TXSTA1_TXEN            0x20
2594 #define _TXSTA1_TXEN1           0x20
2595 #define _TXSTA1_TX9             0x40
2596 #define _TXSTA1_TX8_9           0x40
2597 #define _TXSTA1_NOT_TX8         0x40
2598 #define _TXSTA1_TX91            0x40
2599 #define _TXSTA1_CSRC            0x80
2600 #define _TXSTA1_CSRC1           0x80
2601 
2602 //==============================================================================
2603 
2604 extern __at(0x0FAD) __sfr TXREG;
2605 extern __at(0x0FAD) __sfr TXREG1;
2606 extern __at(0x0FAE) __sfr RCREG;
2607 extern __at(0x0FAE) __sfr RCREG1;
2608 extern __at(0x0FAF) __sfr SPBRG;
2609 extern __at(0x0FAF) __sfr SPBRG1;
2610 
2611 //==============================================================================
2612 //        PSPCON Bits
2613 
2614 extern __at(0x0FB0) __sfr PSPCON;
2615 
2616 typedef struct
2617   {
2618   unsigned                      : 1;
2619   unsigned                      : 1;
2620   unsigned                      : 1;
2621   unsigned                      : 1;
2622   unsigned PSPMODE              : 1;
2623   unsigned IBOV                 : 1;
2624   unsigned OBF                  : 1;
2625   unsigned IBF                  : 1;
2626   } __PSPCONbits_t;
2627 
2628 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
2629 
2630 #define _PSPMODE                0x10
2631 #define _IBOV                   0x20
2632 #define _OBF                    0x40
2633 #define _IBF                    0x80
2634 
2635 //==============================================================================
2636 
2637 
2638 //==============================================================================
2639 //        T3CON Bits
2640 
2641 extern __at(0x0FB1) __sfr T3CON;
2642 
2643 typedef union
2644   {
2645   struct
2646     {
2647     unsigned TMR3ON             : 1;
2648     unsigned TMR3CS             : 1;
2649     unsigned NOT_T3SYNC         : 1;
2650     unsigned T3CCP1             : 1;
2651     unsigned T3CKPS0            : 1;
2652     unsigned T3CKPS1            : 1;
2653     unsigned T3CCP2             : 1;
2654     unsigned RD16               : 1;
2655     };
2656 
2657   struct
2658     {
2659     unsigned                    : 1;
2660     unsigned                    : 1;
2661     unsigned T3SYNC             : 1;
2662     unsigned                    : 1;
2663     unsigned                    : 1;
2664     unsigned                    : 1;
2665     unsigned                    : 1;
2666     unsigned                    : 1;
2667     };
2668 
2669   struct
2670     {
2671     unsigned                    : 1;
2672     unsigned                    : 1;
2673     unsigned T3INSYNC           : 1;
2674     unsigned                    : 1;
2675     unsigned                    : 1;
2676     unsigned                    : 1;
2677     unsigned                    : 1;
2678     unsigned                    : 1;
2679     };
2680 
2681   struct
2682     {
2683     unsigned                    : 1;
2684     unsigned                    : 1;
2685     unsigned T3NSYNC            : 1;
2686     unsigned                    : 1;
2687     unsigned                    : 1;
2688     unsigned                    : 1;
2689     unsigned                    : 1;
2690     unsigned                    : 1;
2691     };
2692 
2693   struct
2694     {
2695     unsigned                    : 4;
2696     unsigned T3CKPS             : 2;
2697     unsigned                    : 2;
2698     };
2699   } __T3CONbits_t;
2700 
2701 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
2702 
2703 #define _T3CON_TMR3ON           0x01
2704 #define _T3CON_TMR3CS           0x02
2705 #define _T3CON_NOT_T3SYNC       0x04
2706 #define _T3CON_T3SYNC           0x04
2707 #define _T3CON_T3INSYNC         0x04
2708 #define _T3CON_T3NSYNC          0x04
2709 #define _T3CON_T3CCP1           0x08
2710 #define _T3CON_T3CKPS0          0x10
2711 #define _T3CON_T3CKPS1          0x20
2712 #define _T3CON_T3CCP2           0x40
2713 #define _T3CON_RD16             0x80
2714 
2715 //==============================================================================
2716 
2717 extern __at(0x0FB2) __sfr TMR3;
2718 extern __at(0x0FB2) __sfr TMR3L;
2719 extern __at(0x0FB3) __sfr TMR3H;
2720 
2721 //==============================================================================
2722 //        CMCON Bits
2723 
2724 extern __at(0x0FB4) __sfr CMCON;
2725 
2726 typedef union
2727   {
2728   struct
2729     {
2730     unsigned CM0                : 1;
2731     unsigned CM1                : 1;
2732     unsigned CM2                : 1;
2733     unsigned CIS                : 1;
2734     unsigned C1INV              : 1;
2735     unsigned C2INV              : 1;
2736     unsigned C1OUT              : 1;
2737     unsigned C2OUT              : 1;
2738     };
2739 
2740   struct
2741     {
2742     unsigned CM                 : 3;
2743     unsigned                    : 5;
2744     };
2745   } __CMCONbits_t;
2746 
2747 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
2748 
2749 #define _CM0                    0x01
2750 #define _CM1                    0x02
2751 #define _CM2                    0x04
2752 #define _CIS                    0x08
2753 #define _C1INV                  0x10
2754 #define _C2INV                  0x20
2755 #define _C1OUT                  0x40
2756 #define _C2OUT                  0x80
2757 
2758 //==============================================================================
2759 
2760 
2761 //==============================================================================
2762 //        CVRCON Bits
2763 
2764 extern __at(0x0FB5) __sfr CVRCON;
2765 
2766 typedef union
2767   {
2768   struct
2769     {
2770     unsigned CVR0               : 1;
2771     unsigned CVR1               : 1;
2772     unsigned CVR2               : 1;
2773     unsigned CVR3               : 1;
2774     unsigned CVRSS              : 1;
2775     unsigned CVRR               : 1;
2776     unsigned CVROE              : 1;
2777     unsigned CVREN              : 1;
2778     };
2779 
2780   struct
2781     {
2782     unsigned                    : 1;
2783     unsigned                    : 1;
2784     unsigned                    : 1;
2785     unsigned                    : 1;
2786     unsigned CVREF              : 1;
2787     unsigned                    : 1;
2788     unsigned                    : 1;
2789     unsigned                    : 1;
2790     };
2791 
2792   struct
2793     {
2794     unsigned CVR                : 4;
2795     unsigned                    : 4;
2796     };
2797   } __CVRCONbits_t;
2798 
2799 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
2800 
2801 #define _CVR0                   0x01
2802 #define _CVR1                   0x02
2803 #define _CVR2                   0x04
2804 #define _CVR3                   0x08
2805 #define _CVRSS                  0x10
2806 #define _CVREF                  0x10
2807 #define _CVRR                   0x20
2808 #define _CVROE                  0x40
2809 #define _CVREN                  0x80
2810 
2811 //==============================================================================
2812 
2813 
2814 //==============================================================================
2815 //        CCP3CON Bits
2816 
2817 extern __at(0x0FB7) __sfr CCP3CON;
2818 
2819 typedef union
2820   {
2821   struct
2822     {
2823     unsigned CCP3M0             : 1;
2824     unsigned CCP3M1             : 1;
2825     unsigned CCP3M2             : 1;
2826     unsigned CCP3M3             : 1;
2827     unsigned DC3B0              : 1;
2828     unsigned DC3B1              : 1;
2829     unsigned                    : 1;
2830     unsigned                    : 1;
2831     };
2832 
2833   struct
2834     {
2835     unsigned                    : 1;
2836     unsigned                    : 1;
2837     unsigned                    : 1;
2838     unsigned                    : 1;
2839     unsigned DCCP3Y             : 1;
2840     unsigned DCCP3X             : 1;
2841     unsigned                    : 1;
2842     unsigned                    : 1;
2843     };
2844 
2845   struct
2846     {
2847     unsigned CCP3M              : 4;
2848     unsigned                    : 4;
2849     };
2850 
2851   struct
2852     {
2853     unsigned                    : 4;
2854     unsigned DC3B               : 2;
2855     unsigned                    : 2;
2856     };
2857   } __CCP3CONbits_t;
2858 
2859 extern __at(0x0FB7) volatile __CCP3CONbits_t CCP3CONbits;
2860 
2861 #define _CCP3M0                 0x01
2862 #define _CCP3M1                 0x02
2863 #define _CCP3M2                 0x04
2864 #define _CCP3M3                 0x08
2865 #define _DC3B0                  0x10
2866 #define _DCCP3Y                 0x10
2867 #define _DC3B1                  0x20
2868 #define _DCCP3X                 0x20
2869 
2870 //==============================================================================
2871 
2872 extern __at(0x0FB8) __sfr CCPR3;
2873 extern __at(0x0FB8) __sfr CCPR3L;
2874 extern __at(0x0FB9) __sfr CCPR3H;
2875 
2876 //==============================================================================
2877 //        CCP2CON Bits
2878 
2879 extern __at(0x0FBA) __sfr CCP2CON;
2880 
2881 typedef union
2882   {
2883   struct
2884     {
2885     unsigned CCP2M0             : 1;
2886     unsigned CCP2M1             : 1;
2887     unsigned CCP2M2             : 1;
2888     unsigned CCP2M3             : 1;
2889     unsigned DC2B0              : 1;
2890     unsigned DC2B1              : 1;
2891     unsigned                    : 1;
2892     unsigned                    : 1;
2893     };
2894 
2895   struct
2896     {
2897     unsigned                    : 1;
2898     unsigned                    : 1;
2899     unsigned                    : 1;
2900     unsigned                    : 1;
2901     unsigned CCP2Y              : 1;
2902     unsigned CCP2X              : 1;
2903     unsigned                    : 1;
2904     unsigned                    : 1;
2905     };
2906 
2907   struct
2908     {
2909     unsigned                    : 1;
2910     unsigned                    : 1;
2911     unsigned                    : 1;
2912     unsigned                    : 1;
2913     unsigned DCCP2Y             : 1;
2914     unsigned DCCP2X             : 1;
2915     unsigned                    : 1;
2916     unsigned                    : 1;
2917     };
2918 
2919   struct
2920     {
2921     unsigned CCP2M              : 4;
2922     unsigned                    : 4;
2923     };
2924 
2925   struct
2926     {
2927     unsigned                    : 4;
2928     unsigned DC2B               : 2;
2929     unsigned                    : 2;
2930     };
2931   } __CCP2CONbits_t;
2932 
2933 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
2934 
2935 #define _CCP2M0                 0x01
2936 #define _CCP2M1                 0x02
2937 #define _CCP2M2                 0x04
2938 #define _CCP2M3                 0x08
2939 #define _DC2B0                  0x10
2940 #define _CCP2Y                  0x10
2941 #define _DCCP2Y                 0x10
2942 #define _DC2B1                  0x20
2943 #define _CCP2X                  0x20
2944 #define _DCCP2X                 0x20
2945 
2946 //==============================================================================
2947 
2948 extern __at(0x0FBB) __sfr CCPR2;
2949 extern __at(0x0FBB) __sfr CCPR2L;
2950 extern __at(0x0FBC) __sfr CCPR2H;
2951 
2952 //==============================================================================
2953 //        CCP1CON Bits
2954 
2955 extern __at(0x0FBD) __sfr CCP1CON;
2956 
2957 typedef union
2958   {
2959   struct
2960     {
2961     unsigned CCP1M0             : 1;
2962     unsigned CCP1M1             : 1;
2963     unsigned CCP1M2             : 1;
2964     unsigned CCP1M3             : 1;
2965     unsigned DC1B0              : 1;
2966     unsigned DC1B1              : 1;
2967     unsigned                    : 1;
2968     unsigned                    : 1;
2969     };
2970 
2971   struct
2972     {
2973     unsigned                    : 1;
2974     unsigned                    : 1;
2975     unsigned                    : 1;
2976     unsigned                    : 1;
2977     unsigned CCP1Y              : 1;
2978     unsigned CCP1X              : 1;
2979     unsigned                    : 1;
2980     unsigned                    : 1;
2981     };
2982 
2983   struct
2984     {
2985     unsigned                    : 1;
2986     unsigned                    : 1;
2987     unsigned                    : 1;
2988     unsigned                    : 1;
2989     unsigned DCCP1Y             : 1;
2990     unsigned DCCP1X             : 1;
2991     unsigned                    : 1;
2992     unsigned                    : 1;
2993     };
2994 
2995   struct
2996     {
2997     unsigned CCP1M              : 4;
2998     unsigned                    : 4;
2999     };
3000 
3001   struct
3002     {
3003     unsigned                    : 4;
3004     unsigned DC1B               : 2;
3005     unsigned                    : 2;
3006     };
3007   } __CCP1CONbits_t;
3008 
3009 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
3010 
3011 #define _CCP1M0                 0x01
3012 #define _CCP1M1                 0x02
3013 #define _CCP1M2                 0x04
3014 #define _CCP1M3                 0x08
3015 #define _DC1B0                  0x10
3016 #define _CCP1Y                  0x10
3017 #define _DCCP1Y                 0x10
3018 #define _DC1B1                  0x20
3019 #define _CCP1X                  0x20
3020 #define _DCCP1X                 0x20
3021 
3022 //==============================================================================
3023 
3024 extern __at(0x0FBE) __sfr CCPR1;
3025 extern __at(0x0FBE) __sfr CCPR1L;
3026 extern __at(0x0FBF) __sfr CCPR1H;
3027 
3028 //==============================================================================
3029 //        ADCON2 Bits
3030 
3031 extern __at(0x0FC0) __sfr ADCON2;
3032 
3033 typedef union
3034   {
3035   struct
3036     {
3037     unsigned ADCS0              : 1;
3038     unsigned ADCS1              : 1;
3039     unsigned ADCS2              : 1;
3040     unsigned                    : 1;
3041     unsigned                    : 1;
3042     unsigned                    : 1;
3043     unsigned                    : 1;
3044     unsigned ADFM               : 1;
3045     };
3046 
3047   struct
3048     {
3049     unsigned ADCS               : 3;
3050     unsigned                    : 5;
3051     };
3052   } __ADCON2bits_t;
3053 
3054 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
3055 
3056 #define _ADCS0                  0x01
3057 #define _ADCS1                  0x02
3058 #define _ADCS2                  0x04
3059 #define _ADFM                   0x80
3060 
3061 //==============================================================================
3062 
3063 
3064 //==============================================================================
3065 //        ADCON1 Bits
3066 
3067 extern __at(0x0FC1) __sfr ADCON1;
3068 
3069 typedef union
3070   {
3071   struct
3072     {
3073     unsigned PCFG0              : 1;
3074     unsigned PCFG1              : 1;
3075     unsigned PCFG2              : 1;
3076     unsigned PCFG3              : 1;
3077     unsigned VCFG0              : 1;
3078     unsigned VCFG1              : 1;
3079     unsigned                    : 1;
3080     unsigned                    : 1;
3081     };
3082 
3083   struct
3084     {
3085     unsigned PCFG               : 4;
3086     unsigned                    : 4;
3087     };
3088 
3089   struct
3090     {
3091     unsigned                    : 4;
3092     unsigned VCFG               : 2;
3093     unsigned                    : 2;
3094     };
3095   } __ADCON1bits_t;
3096 
3097 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
3098 
3099 #define _PCFG0                  0x01
3100 #define _PCFG1                  0x02
3101 #define _PCFG2                  0x04
3102 #define _PCFG3                  0x08
3103 #define _VCFG0                  0x10
3104 #define _VCFG1                  0x20
3105 
3106 //==============================================================================
3107 
3108 
3109 //==============================================================================
3110 //        ADCON0 Bits
3111 
3112 extern __at(0x0FC2) __sfr ADCON0;
3113 
3114 typedef union
3115   {
3116   struct
3117     {
3118     unsigned ADON               : 1;
3119     unsigned GO_NOT_DONE        : 1;
3120     unsigned CHS0               : 1;
3121     unsigned CHS1               : 1;
3122     unsigned CHS2               : 1;
3123     unsigned CHS3               : 1;
3124     unsigned                    : 1;
3125     unsigned                    : 1;
3126     };
3127 
3128   struct
3129     {
3130     unsigned                    : 1;
3131     unsigned DONE               : 1;
3132     unsigned                    : 1;
3133     unsigned                    : 1;
3134     unsigned                    : 1;
3135     unsigned                    : 1;
3136     unsigned                    : 1;
3137     unsigned                    : 1;
3138     };
3139 
3140   struct
3141     {
3142     unsigned                    : 1;
3143     unsigned GO_DONE            : 1;
3144     unsigned                    : 1;
3145     unsigned                    : 1;
3146     unsigned                    : 1;
3147     unsigned                    : 1;
3148     unsigned                    : 1;
3149     unsigned                    : 1;
3150     };
3151 
3152   struct
3153     {
3154     unsigned                    : 1;
3155     unsigned GO                 : 1;
3156     unsigned                    : 1;
3157     unsigned                    : 1;
3158     unsigned                    : 1;
3159     unsigned                    : 1;
3160     unsigned                    : 1;
3161     unsigned                    : 1;
3162     };
3163 
3164   struct
3165     {
3166     unsigned                    : 1;
3167     unsigned NOT_DONE           : 1;
3168     unsigned                    : 1;
3169     unsigned                    : 1;
3170     unsigned                    : 1;
3171     unsigned                    : 1;
3172     unsigned                    : 1;
3173     unsigned                    : 1;
3174     };
3175 
3176   struct
3177     {
3178     unsigned                    : 1;
3179     unsigned GODONE             : 1;
3180     unsigned                    : 1;
3181     unsigned                    : 1;
3182     unsigned                    : 1;
3183     unsigned                    : 1;
3184     unsigned                    : 1;
3185     unsigned                    : 1;
3186     };
3187 
3188   struct
3189     {
3190     unsigned                    : 2;
3191     unsigned CHS                : 4;
3192     unsigned                    : 2;
3193     };
3194   } __ADCON0bits_t;
3195 
3196 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
3197 
3198 #define _ADON                   0x01
3199 #define _GO_NOT_DONE            0x02
3200 #define _DONE                   0x02
3201 #define _GO_DONE                0x02
3202 #define _GO                     0x02
3203 #define _NOT_DONE               0x02
3204 #define _GODONE                 0x02
3205 #define _CHS0                   0x04
3206 #define _CHS1                   0x08
3207 #define _CHS2                   0x10
3208 #define _CHS3                   0x20
3209 
3210 //==============================================================================
3211 
3212 extern __at(0x0FC3) __sfr ADRES;
3213 extern __at(0x0FC3) __sfr ADRESL;
3214 extern __at(0x0FC4) __sfr ADRESH;
3215 
3216 //==============================================================================
3217 //        SSPCON2 Bits
3218 
3219 extern __at(0x0FC5) __sfr SSPCON2;
3220 
3221 typedef struct
3222   {
3223   unsigned SEN                  : 1;
3224   unsigned RSEN                 : 1;
3225   unsigned PEN                  : 1;
3226   unsigned RCEN                 : 1;
3227   unsigned ACKEN                : 1;
3228   unsigned ACKDT                : 1;
3229   unsigned ACKSTAT              : 1;
3230   unsigned GCEN                 : 1;
3231   } __SSPCON2bits_t;
3232 
3233 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
3234 
3235 #define _SEN                    0x01
3236 #define _RSEN                   0x02
3237 #define _PEN                    0x04
3238 #define _RCEN                   0x08
3239 #define _ACKEN                  0x10
3240 #define _ACKDT                  0x20
3241 #define _ACKSTAT                0x40
3242 #define _GCEN                   0x80
3243 
3244 //==============================================================================
3245 
3246 
3247 //==============================================================================
3248 //        SSPCON1 Bits
3249 
3250 extern __at(0x0FC6) __sfr SSPCON1;
3251 
3252 typedef union
3253   {
3254   struct
3255     {
3256     unsigned SSPM0              : 1;
3257     unsigned SSPM1              : 1;
3258     unsigned SSPM2              : 1;
3259     unsigned SSPM3              : 1;
3260     unsigned CKP                : 1;
3261     unsigned SSPEN              : 1;
3262     unsigned SSPOV              : 1;
3263     unsigned WCOL               : 1;
3264     };
3265 
3266   struct
3267     {
3268     unsigned SSPM               : 4;
3269     unsigned                    : 4;
3270     };
3271   } __SSPCON1bits_t;
3272 
3273 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
3274 
3275 #define _SSPM0                  0x01
3276 #define _SSPM1                  0x02
3277 #define _SSPM2                  0x04
3278 #define _SSPM3                  0x08
3279 #define _CKP                    0x10
3280 #define _SSPEN                  0x20
3281 #define _SSPOV                  0x40
3282 #define _WCOL                   0x80
3283 
3284 //==============================================================================
3285 
3286 
3287 //==============================================================================
3288 //        SSPSTAT Bits
3289 
3290 extern __at(0x0FC7) __sfr SSPSTAT;
3291 
3292 typedef union
3293   {
3294   struct
3295     {
3296     unsigned BF                 : 1;
3297     unsigned UA                 : 1;
3298     unsigned R_NOT_W            : 1;
3299     unsigned S                  : 1;
3300     unsigned P                  : 1;
3301     unsigned D_NOT_A            : 1;
3302     unsigned CKE                : 1;
3303     unsigned SMP                : 1;
3304     };
3305 
3306   struct
3307     {
3308     unsigned                    : 1;
3309     unsigned                    : 1;
3310     unsigned R_W                : 1;
3311     unsigned I2C_START          : 1;
3312     unsigned I2C_STOP           : 1;
3313     unsigned D_A                : 1;
3314     unsigned                    : 1;
3315     unsigned                    : 1;
3316     };
3317 
3318   struct
3319     {
3320     unsigned                    : 1;
3321     unsigned                    : 1;
3322     unsigned I2C_READ           : 1;
3323     unsigned                    : 1;
3324     unsigned                    : 1;
3325     unsigned I2C_DAT            : 1;
3326     unsigned                    : 1;
3327     unsigned                    : 1;
3328     };
3329 
3330   struct
3331     {
3332     unsigned                    : 1;
3333     unsigned                    : 1;
3334     unsigned NOT_W              : 1;
3335     unsigned                    : 1;
3336     unsigned                    : 1;
3337     unsigned NOT_A              : 1;
3338     unsigned                    : 1;
3339     unsigned                    : 1;
3340     };
3341 
3342   struct
3343     {
3344     unsigned                    : 1;
3345     unsigned                    : 1;
3346     unsigned NOT_WRITE          : 1;
3347     unsigned                    : 1;
3348     unsigned                    : 1;
3349     unsigned NOT_ADDRESS        : 1;
3350     unsigned                    : 1;
3351     unsigned                    : 1;
3352     };
3353 
3354   struct
3355     {
3356     unsigned                    : 1;
3357     unsigned                    : 1;
3358     unsigned READ_WRITE         : 1;
3359     unsigned                    : 1;
3360     unsigned                    : 1;
3361     unsigned DATA_ADDRESS       : 1;
3362     unsigned                    : 1;
3363     unsigned                    : 1;
3364     };
3365 
3366   struct
3367     {
3368     unsigned                    : 1;
3369     unsigned                    : 1;
3370     unsigned R                  : 1;
3371     unsigned                    : 1;
3372     unsigned                    : 1;
3373     unsigned D                  : 1;
3374     unsigned                    : 1;
3375     unsigned                    : 1;
3376     };
3377   } __SSPSTATbits_t;
3378 
3379 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
3380 
3381 #define _BF                     0x01
3382 #define _UA                     0x02
3383 #define _R_NOT_W                0x04
3384 #define _R_W                    0x04
3385 #define _I2C_READ               0x04
3386 #define _NOT_W                  0x04
3387 #define _NOT_WRITE              0x04
3388 #define _READ_WRITE             0x04
3389 #define _R                      0x04
3390 #define _S                      0x08
3391 #define _I2C_START              0x08
3392 #define _P                      0x10
3393 #define _I2C_STOP               0x10
3394 #define _D_NOT_A                0x20
3395 #define _D_A                    0x20
3396 #define _I2C_DAT                0x20
3397 #define _NOT_A                  0x20
3398 #define _NOT_ADDRESS            0x20
3399 #define _DATA_ADDRESS           0x20
3400 #define _D                      0x20
3401 #define _CKE                    0x40
3402 #define _SMP                    0x80
3403 
3404 //==============================================================================
3405 
3406 extern __at(0x0FC8) __sfr SSPADD;
3407 extern __at(0x0FC9) __sfr SSPBUF;
3408 
3409 //==============================================================================
3410 //        T2CON Bits
3411 
3412 extern __at(0x0FCA) __sfr T2CON;
3413 
3414 typedef union
3415   {
3416   struct
3417     {
3418     unsigned T2CKPS0            : 1;
3419     unsigned T2CKPS1            : 1;
3420     unsigned TMR2ON             : 1;
3421     unsigned T2OUTPS0           : 1;
3422     unsigned T2OUTPS1           : 1;
3423     unsigned T2OUTPS2           : 1;
3424     unsigned T2OUTPS3           : 1;
3425     unsigned                    : 1;
3426     };
3427 
3428   struct
3429     {
3430     unsigned T2CKPS             : 2;
3431     unsigned                    : 6;
3432     };
3433 
3434   struct
3435     {
3436     unsigned                    : 3;
3437     unsigned T2OUTPS            : 4;
3438     unsigned                    : 1;
3439     };
3440   } __T2CONbits_t;
3441 
3442 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
3443 
3444 #define _T2CKPS0                0x01
3445 #define _T2CKPS1                0x02
3446 #define _TMR2ON                 0x04
3447 #define _T2OUTPS0               0x08
3448 #define _T2OUTPS1               0x10
3449 #define _T2OUTPS2               0x20
3450 #define _T2OUTPS3               0x40
3451 
3452 //==============================================================================
3453 
3454 extern __at(0x0FCB) __sfr PR2;
3455 extern __at(0x0FCC) __sfr TMR2;
3456 
3457 //==============================================================================
3458 //        T1CON Bits
3459 
3460 extern __at(0x0FCD) __sfr T1CON;
3461 
3462 typedef union
3463   {
3464   struct
3465     {
3466     unsigned TMR1ON             : 1;
3467     unsigned TMR1CS             : 1;
3468     unsigned NOT_T1SYNC         : 1;
3469     unsigned T1OSCEN            : 1;
3470     unsigned T1CKPS0            : 1;
3471     unsigned T1CKPS1            : 1;
3472     unsigned                    : 1;
3473     unsigned RD16               : 1;
3474     };
3475 
3476   struct
3477     {
3478     unsigned                    : 1;
3479     unsigned                    : 1;
3480     unsigned T1SYNC             : 1;
3481     unsigned                    : 1;
3482     unsigned                    : 1;
3483     unsigned                    : 1;
3484     unsigned                    : 1;
3485     unsigned                    : 1;
3486     };
3487 
3488   struct
3489     {
3490     unsigned                    : 1;
3491     unsigned                    : 1;
3492     unsigned T1INSYNC           : 1;
3493     unsigned                    : 1;
3494     unsigned                    : 1;
3495     unsigned                    : 1;
3496     unsigned                    : 1;
3497     unsigned                    : 1;
3498     };
3499 
3500   struct
3501     {
3502     unsigned                    : 4;
3503     unsigned T1CKPS             : 2;
3504     unsigned                    : 2;
3505     };
3506   } __T1CONbits_t;
3507 
3508 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
3509 
3510 #define _TMR1ON                 0x01
3511 #define _TMR1CS                 0x02
3512 #define _NOT_T1SYNC             0x04
3513 #define _T1SYNC                 0x04
3514 #define _T1INSYNC               0x04
3515 #define _T1OSCEN                0x08
3516 #define _T1CKPS0                0x10
3517 #define _T1CKPS1                0x20
3518 #define _RD16                   0x80
3519 
3520 //==============================================================================
3521 
3522 extern __at(0x0FCE) __sfr TMR1;
3523 extern __at(0x0FCE) __sfr TMR1L;
3524 extern __at(0x0FCF) __sfr TMR1H;
3525 
3526 //==============================================================================
3527 //        RCON Bits
3528 
3529 extern __at(0x0FD0) __sfr RCON;
3530 
3531 typedef union
3532   {
3533   struct
3534     {
3535     unsigned NOT_BOR            : 1;
3536     unsigned NOT_POR            : 1;
3537     unsigned NOT_PD             : 1;
3538     unsigned NOT_TO             : 1;
3539     unsigned NOT_RI             : 1;
3540     unsigned                    : 1;
3541     unsigned                    : 1;
3542     unsigned IPEN               : 1;
3543     };
3544 
3545   struct
3546     {
3547     unsigned BOR                : 1;
3548     unsigned POR                : 1;
3549     unsigned PD                 : 1;
3550     unsigned TO                 : 1;
3551     unsigned RI                 : 1;
3552     unsigned                    : 1;
3553     unsigned                    : 1;
3554     unsigned NOT_IPEN           : 1;
3555     };
3556   } __RCONbits_t;
3557 
3558 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
3559 
3560 #define _NOT_BOR                0x01
3561 #define _BOR                    0x01
3562 #define _NOT_POR                0x02
3563 #define _POR                    0x02
3564 #define _NOT_PD                 0x04
3565 #define _PD                     0x04
3566 #define _NOT_TO                 0x08
3567 #define _TO                     0x08
3568 #define _NOT_RI                 0x10
3569 #define _RI                     0x10
3570 #define _IPEN                   0x80
3571 #define _NOT_IPEN               0x80
3572 
3573 //==============================================================================
3574 
3575 
3576 //==============================================================================
3577 //        WDTCON Bits
3578 
3579 extern __at(0x0FD1) __sfr WDTCON;
3580 
3581 typedef union
3582   {
3583   struct
3584     {
3585     unsigned SWDTEN             : 1;
3586     unsigned                    : 1;
3587     unsigned                    : 1;
3588     unsigned                    : 1;
3589     unsigned                    : 1;
3590     unsigned                    : 1;
3591     unsigned                    : 1;
3592     unsigned                    : 1;
3593     };
3594 
3595   struct
3596     {
3597     unsigned SWDTE              : 1;
3598     unsigned                    : 1;
3599     unsigned                    : 1;
3600     unsigned                    : 1;
3601     unsigned                    : 1;
3602     unsigned                    : 1;
3603     unsigned                    : 1;
3604     unsigned                    : 1;
3605     };
3606   } __WDTCONbits_t;
3607 
3608 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
3609 
3610 #define _SWDTEN                 0x01
3611 #define _SWDTE                  0x01
3612 
3613 //==============================================================================
3614 
3615 
3616 //==============================================================================
3617 //        LVDCON Bits
3618 
3619 extern __at(0x0FD2) __sfr LVDCON;
3620 
3621 typedef union
3622   {
3623   struct
3624     {
3625     unsigned LVDL0              : 1;
3626     unsigned LVDL1              : 1;
3627     unsigned LVDL2              : 1;
3628     unsigned LVDL3              : 1;
3629     unsigned LVDEN              : 1;
3630     unsigned IRVST              : 1;
3631     unsigned                    : 1;
3632     unsigned                    : 1;
3633     };
3634 
3635   struct
3636     {
3637     unsigned LVV0               : 1;
3638     unsigned LVV1               : 1;
3639     unsigned LVV2               : 1;
3640     unsigned LVV3               : 1;
3641     unsigned                    : 1;
3642     unsigned BGST               : 1;
3643     unsigned                    : 1;
3644     unsigned                    : 1;
3645     };
3646 
3647   struct
3648     {
3649     unsigned LVV                : 4;
3650     unsigned                    : 4;
3651     };
3652 
3653   struct
3654     {
3655     unsigned LVDL               : 4;
3656     unsigned                    : 4;
3657     };
3658   } __LVDCONbits_t;
3659 
3660 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
3661 
3662 #define _LVDL0                  0x01
3663 #define _LVV0                   0x01
3664 #define _LVDL1                  0x02
3665 #define _LVV1                   0x02
3666 #define _LVDL2                  0x04
3667 #define _LVV2                   0x04
3668 #define _LVDL3                  0x08
3669 #define _LVV3                   0x08
3670 #define _LVDEN                  0x10
3671 #define _IRVST                  0x20
3672 #define _BGST                   0x20
3673 
3674 //==============================================================================
3675 
3676 
3677 //==============================================================================
3678 //        OSCCON Bits
3679 
3680 extern __at(0x0FD3) __sfr OSCCON;
3681 
3682 typedef struct
3683   {
3684   unsigned SCS                  : 1;
3685   unsigned                      : 1;
3686   unsigned                      : 1;
3687   unsigned                      : 1;
3688   unsigned                      : 1;
3689   unsigned                      : 1;
3690   unsigned                      : 1;
3691   unsigned                      : 1;
3692   } __OSCCONbits_t;
3693 
3694 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
3695 
3696 #define _SCS                    0x01
3697 
3698 //==============================================================================
3699 
3700 
3701 //==============================================================================
3702 //        T0CON Bits
3703 
3704 extern __at(0x0FD5) __sfr T0CON;
3705 
3706 typedef union
3707   {
3708   struct
3709     {
3710     unsigned T0PS0              : 1;
3711     unsigned T0PS1              : 1;
3712     unsigned T0PS2              : 1;
3713     unsigned PSA                : 1;
3714     unsigned T0SE               : 1;
3715     unsigned T0CS               : 1;
3716     unsigned T08BIT             : 1;
3717     unsigned TMR0ON             : 1;
3718     };
3719 
3720   struct
3721     {
3722     unsigned T0PS               : 3;
3723     unsigned                    : 5;
3724     };
3725   } __T0CONbits_t;
3726 
3727 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
3728 
3729 #define _T0PS0                  0x01
3730 #define _T0PS1                  0x02
3731 #define _T0PS2                  0x04
3732 #define _PSA                    0x08
3733 #define _T0SE                   0x10
3734 #define _T0CS                   0x20
3735 #define _T08BIT                 0x40
3736 #define _TMR0ON                 0x80
3737 
3738 //==============================================================================
3739 
3740 extern __at(0x0FD6) __sfr TMR0;
3741 extern __at(0x0FD6) __sfr TMR0L;
3742 extern __at(0x0FD7) __sfr TMR0H;
3743 
3744 //==============================================================================
3745 //        STATUS Bits
3746 
3747 extern __at(0x0FD8) __sfr STATUS;
3748 
3749 typedef struct
3750   {
3751   unsigned C                    : 1;
3752   unsigned DC                   : 1;
3753   unsigned Z                    : 1;
3754   unsigned OV                   : 1;
3755   unsigned N                    : 1;
3756   unsigned                      : 1;
3757   unsigned                      : 1;
3758   unsigned                      : 1;
3759   } __STATUSbits_t;
3760 
3761 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3762 
3763 #define _C                      0x01
3764 #define _DC                     0x02
3765 #define _Z                      0x04
3766 #define _OV                     0x08
3767 #define _N                      0x10
3768 
3769 //==============================================================================
3770 
3771 extern __at(0x0FD9) __sfr FSR2L;
3772 extern __at(0x0FDA) __sfr FSR2H;
3773 extern __at(0x0FDB) __sfr PLUSW2;
3774 extern __at(0x0FDC) __sfr PREINC2;
3775 extern __at(0x0FDD) __sfr POSTDEC2;
3776 extern __at(0x0FDE) __sfr POSTINC2;
3777 extern __at(0x0FDF) __sfr INDF2;
3778 extern __at(0x0FE0) __sfr BSR;
3779 extern __at(0x0FE1) __sfr FSR1L;
3780 extern __at(0x0FE2) __sfr FSR1H;
3781 extern __at(0x0FE3) __sfr PLUSW1;
3782 extern __at(0x0FE4) __sfr PREINC1;
3783 extern __at(0x0FE5) __sfr POSTDEC1;
3784 extern __at(0x0FE6) __sfr POSTINC1;
3785 extern __at(0x0FE7) __sfr INDF1;
3786 extern __at(0x0FE8) __sfr WREG;
3787 extern __at(0x0FE9) __sfr FSR0L;
3788 extern __at(0x0FEA) __sfr FSR0H;
3789 extern __at(0x0FEB) __sfr PLUSW0;
3790 extern __at(0x0FEC) __sfr PREINC0;
3791 extern __at(0x0FED) __sfr POSTDEC0;
3792 extern __at(0x0FEE) __sfr POSTINC0;
3793 extern __at(0x0FEF) __sfr INDF0;
3794 
3795 //==============================================================================
3796 //        INTCON3 Bits
3797 
3798 extern __at(0x0FF0) __sfr INTCON3;
3799 
3800 typedef union
3801   {
3802   struct
3803     {
3804     unsigned INT1IF             : 1;
3805     unsigned INT2IF             : 1;
3806     unsigned INT3IF             : 1;
3807     unsigned INT1IE             : 1;
3808     unsigned INT2IE             : 1;
3809     unsigned INT3IE             : 1;
3810     unsigned INT1IP             : 1;
3811     unsigned INT2IP             : 1;
3812     };
3813 
3814   struct
3815     {
3816     unsigned INT1F              : 1;
3817     unsigned INT2F              : 1;
3818     unsigned INT3F              : 1;
3819     unsigned INT1E              : 1;
3820     unsigned INT2E              : 1;
3821     unsigned INT3E              : 1;
3822     unsigned INT1P              : 1;
3823     unsigned INT2P              : 1;
3824     };
3825   } __INTCON3bits_t;
3826 
3827 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3828 
3829 #define _INT1IF                 0x01
3830 #define _INT1F                  0x01
3831 #define _INT2IF                 0x02
3832 #define _INT2F                  0x02
3833 #define _INT3IF                 0x04
3834 #define _INT3F                  0x04
3835 #define _INT1IE                 0x08
3836 #define _INT1E                  0x08
3837 #define _INT2IE                 0x10
3838 #define _INT2E                  0x10
3839 #define _INT3IE                 0x20
3840 #define _INT3E                  0x20
3841 #define _INT1IP                 0x40
3842 #define _INT1P                  0x40
3843 #define _INT2IP                 0x80
3844 #define _INT2P                  0x80
3845 
3846 //==============================================================================
3847 
3848 
3849 //==============================================================================
3850 //        INTCON2 Bits
3851 
3852 extern __at(0x0FF1) __sfr INTCON2;
3853 
3854 typedef union
3855   {
3856   struct
3857     {
3858     unsigned RBIP               : 1;
3859     unsigned INT3IP             : 1;
3860     unsigned TMR0IP             : 1;
3861     unsigned INTEDG3            : 1;
3862     unsigned INTEDG2            : 1;
3863     unsigned INTEDG1            : 1;
3864     unsigned INTEDG0            : 1;
3865     unsigned NOT_RBPU           : 1;
3866     };
3867 
3868   struct
3869     {
3870     unsigned                    : 1;
3871     unsigned INT3P              : 1;
3872     unsigned T0IP               : 1;
3873     unsigned                    : 1;
3874     unsigned                    : 1;
3875     unsigned                    : 1;
3876     unsigned                    : 1;
3877     unsigned RBPU               : 1;
3878     };
3879   } __INTCON2bits_t;
3880 
3881 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3882 
3883 #define _RBIP                   0x01
3884 #define _INT3IP                 0x02
3885 #define _INT3P                  0x02
3886 #define _TMR0IP                 0x04
3887 #define _T0IP                   0x04
3888 #define _INTEDG3                0x08
3889 #define _INTEDG2                0x10
3890 #define _INTEDG1                0x20
3891 #define _INTEDG0                0x40
3892 #define _NOT_RBPU               0x80
3893 #define _RBPU                   0x80
3894 
3895 //==============================================================================
3896 
3897 
3898 //==============================================================================
3899 //        INTCON Bits
3900 
3901 extern __at(0x0FF2) __sfr INTCON;
3902 
3903 typedef union
3904   {
3905   struct
3906     {
3907     unsigned RBIF               : 1;
3908     unsigned INT0IF             : 1;
3909     unsigned TMR0IF             : 1;
3910     unsigned RBIE               : 1;
3911     unsigned INT0IE             : 1;
3912     unsigned TMR0IE             : 1;
3913     unsigned PEIE_GIEL          : 1;
3914     unsigned GIE_GIEH           : 1;
3915     };
3916 
3917   struct
3918     {
3919     unsigned                    : 1;
3920     unsigned INT0F              : 1;
3921     unsigned T0IF               : 1;
3922     unsigned                    : 1;
3923     unsigned INT0E              : 1;
3924     unsigned T0IE               : 1;
3925     unsigned PEIE               : 1;
3926     unsigned GIE                : 1;
3927     };
3928 
3929   struct
3930     {
3931     unsigned                    : 1;
3932     unsigned                    : 1;
3933     unsigned                    : 1;
3934     unsigned                    : 1;
3935     unsigned                    : 1;
3936     unsigned                    : 1;
3937     unsigned GIEL               : 1;
3938     unsigned GIEH               : 1;
3939     };
3940   } __INTCONbits_t;
3941 
3942 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3943 
3944 #define _RBIF                   0x01
3945 #define _INT0IF                 0x02
3946 #define _INT0F                  0x02
3947 #define _TMR0IF                 0x04
3948 #define _T0IF                   0x04
3949 #define _RBIE                   0x08
3950 #define _INT0IE                 0x10
3951 #define _INT0E                  0x10
3952 #define _TMR0IE                 0x20
3953 #define _T0IE                   0x20
3954 #define _PEIE_GIEL              0x40
3955 #define _PEIE                   0x40
3956 #define _GIEL                   0x40
3957 #define _GIE_GIEH               0x80
3958 #define _GIE                    0x80
3959 #define _GIEH                   0x80
3960 
3961 //==============================================================================
3962 
3963 
3964 //==============================================================================
3965 //        INTCON1 Bits
3966 
3967 extern __at(0x0FF2) __sfr INTCON1;
3968 
3969 typedef union
3970   {
3971   struct
3972     {
3973     unsigned RBIF               : 1;
3974     unsigned INT0IF             : 1;
3975     unsigned TMR0IF             : 1;
3976     unsigned RBIE               : 1;
3977     unsigned INT0IE             : 1;
3978     unsigned TMR0IE             : 1;
3979     unsigned PEIE_GIEL          : 1;
3980     unsigned GIE_GIEH           : 1;
3981     };
3982 
3983   struct
3984     {
3985     unsigned                    : 1;
3986     unsigned INT0F              : 1;
3987     unsigned T0IF               : 1;
3988     unsigned                    : 1;
3989     unsigned INT0E              : 1;
3990     unsigned T0IE               : 1;
3991     unsigned PEIE               : 1;
3992     unsigned GIE                : 1;
3993     };
3994 
3995   struct
3996     {
3997     unsigned                    : 1;
3998     unsigned                    : 1;
3999     unsigned                    : 1;
4000     unsigned                    : 1;
4001     unsigned                    : 1;
4002     unsigned                    : 1;
4003     unsigned GIEL               : 1;
4004     unsigned GIEH               : 1;
4005     };
4006   } __INTCON1bits_t;
4007 
4008 extern __at(0x0FF2) volatile __INTCON1bits_t INTCON1bits;
4009 
4010 #define _INTCON1_RBIF           0x01
4011 #define _INTCON1_INT0IF         0x02
4012 #define _INTCON1_INT0F          0x02
4013 #define _INTCON1_TMR0IF         0x04
4014 #define _INTCON1_T0IF           0x04
4015 #define _INTCON1_RBIE           0x08
4016 #define _INTCON1_INT0IE         0x10
4017 #define _INTCON1_INT0E          0x10
4018 #define _INTCON1_TMR0IE         0x20
4019 #define _INTCON1_T0IE           0x20
4020 #define _INTCON1_PEIE_GIEL      0x40
4021 #define _INTCON1_PEIE           0x40
4022 #define _INTCON1_GIEL           0x40
4023 #define _INTCON1_GIE_GIEH       0x80
4024 #define _INTCON1_GIE            0x80
4025 #define _INTCON1_GIEH           0x80
4026 
4027 //==============================================================================
4028 
4029 extern __at(0x0FF3) __sfr PROD;
4030 extern __at(0x0FF3) __sfr PRODL;
4031 extern __at(0x0FF4) __sfr PRODH;
4032 extern __at(0x0FF5) __sfr TABLAT;
4033 extern __at(0x0FF6) __sfr TBLPTR;
4034 extern __at(0x0FF6) __sfr TBLPTRL;
4035 extern __at(0x0FF7) __sfr TBLPTRH;
4036 extern __at(0x0FF8) __sfr TBLPTRU;
4037 extern __at(0x0FF9) __sfr PC;
4038 extern __at(0x0FF9) __sfr PCL;
4039 extern __at(0x0FFA) __sfr PCLATH;
4040 extern __at(0x0FFB) __sfr PCLATU;
4041 
4042 //==============================================================================
4043 //        STKPTR Bits
4044 
4045 extern __at(0x0FFC) __sfr STKPTR;
4046 
4047 typedef union
4048   {
4049   struct
4050     {
4051     unsigned STKPTR0            : 1;
4052     unsigned STKPTR1            : 1;
4053     unsigned STKPTR2            : 1;
4054     unsigned STKPTR3            : 1;
4055     unsigned STKPTR4            : 1;
4056     unsigned                    : 1;
4057     unsigned STKUNF             : 1;
4058     unsigned STKFUL             : 1;
4059     };
4060 
4061   struct
4062     {
4063     unsigned SP0                : 1;
4064     unsigned SP1                : 1;
4065     unsigned SP2                : 1;
4066     unsigned SP3                : 1;
4067     unsigned SP4                : 1;
4068     unsigned                    : 1;
4069     unsigned                    : 1;
4070     unsigned STKOVF             : 1;
4071     };
4072 
4073   struct
4074     {
4075     unsigned SP                 : 5;
4076     unsigned                    : 3;
4077     };
4078 
4079   struct
4080     {
4081     unsigned STKPTR             : 5;
4082     unsigned                    : 3;
4083     };
4084   } __STKPTRbits_t;
4085 
4086 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
4087 
4088 #define _STKPTR0                0x01
4089 #define _SP0                    0x01
4090 #define _STKPTR1                0x02
4091 #define _SP1                    0x02
4092 #define _STKPTR2                0x04
4093 #define _SP2                    0x04
4094 #define _STKPTR3                0x08
4095 #define _SP3                    0x08
4096 #define _STKPTR4                0x10
4097 #define _SP4                    0x10
4098 #define _STKUNF                 0x40
4099 #define _STKFUL                 0x80
4100 #define _STKOVF                 0x80
4101 
4102 //==============================================================================
4103 
4104 extern __at(0x0FFD) __sfr TOS;
4105 extern __at(0x0FFD) __sfr TOSL;
4106 extern __at(0x0FFE) __sfr TOSH;
4107 extern __at(0x0FFF) __sfr TOSU;
4108 
4109 //==============================================================================
4110 //
4111 //        Configuration Bits
4112 //
4113 //==============================================================================
4114 
4115 #define __CONFIG1H              0x300001
4116 #define __CONFIG2L              0x300002
4117 #define __CONFIG2H              0x300003
4118 #define __CONFIG3L              0x300004
4119 #define __CONFIG3H              0x300005
4120 #define __CONFIG4L              0x300006
4121 #define __CONFIG5L              0x300008
4122 #define __CONFIG5H              0x300009
4123 #define __CONFIG6L              0x30000A
4124 #define __CONFIG6H              0x30000B
4125 #define __CONFIG7L              0x30000C
4126 #define __CONFIG7H              0x30000D
4127 
4128 //----------------------------- CONFIG1H Options -------------------------------
4129 
4130 #define _LP_OSC                 0xF8    // LP oscillator.
4131 #define _LP_OSC_1H              0xF8    // LP oscillator.
4132 #define _XT_OSC                 0xF9    // XT oscillator.
4133 #define _XT_OSC_1H              0xF9    // XT oscillator.
4134 #define _HS_OSC                 0xFA    // HS oscillator.
4135 #define _HS_OSC_1H              0xFA    // HS oscillator.
4136 #define _RC_OSC                 0xFB    // RC oscillator w/ OSC2 configured as divide-by-4 clock output.
4137 #define _RC_OSC_1H              0xFB    // RC oscillator w/ OSC2 configured as divide-by-4 clock output.
4138 #define _EC_OSC                 0xFC    // EC oscillator w/ OSC2 configured as divide-by-4 clock output.
4139 #define _EC_OSC_1H              0xFC    // EC oscillator w/ OSC2 configured as divide-by-4 clock output.
4140 #define _ECIO_OSC               0xFD    // EC oscillator w/ OSC2 configured as RA6.
4141 #define _ECIO_OSC_1H            0xFD    // EC oscillator w/ OSC2 configured as RA6.
4142 #define _HSPLL_OSC              0xFE    // HS oscillator with PLL enabled; clock frequency = (4 x FOSC).
4143 #define _HSPLL_OSC_1H           0xFE    // HS oscillator with PLL enabled; clock frequency = (4 x FOSC).
4144 #define _RCIO_OSC               0xFF    // RC oscillator w/ OSC2 configured as RA6.
4145 #define _RCIO_OSC_1H            0xFF    // RC oscillator w/ OSC2 configured as RA6.
4146 #define _OSCS_ON_1H             0xDF    // Timer1 Oscillator system clock switch option is enabled (oscillator switching is enabled).
4147 #define _OSCS_OFF_1H            0xFF    // Oscillator system clock switch option is disabled (main oscillator is source).
4148 
4149 //----------------------------- CONFIG2L Options -------------------------------
4150 
4151 #define _PWRT_ON_2L             0xFE    // PWRT enabled.
4152 #define _PWRT_OFF_2L            0xFF    // PWRT disabled.
4153 #define _BOR_OFF_2L             0xFD    // Brown-out Reset disabled.
4154 #define _BOR_ON_2L              0xFF    // Brown-out Reset enabled.
4155 #define _BORV_45_2L             0xF3    // VBOR set to 4.5V.
4156 #define _BORV_42_2L             0xF7    // VBOR set to 4.2V.
4157 #define _BORV_27_2L             0xFB    // VBOR set to 2.7V.
4158 #define _BORV_20                0xFF    // VBOR set to 2.5V.
4159 #define _BORV_20_2L             0xFF    // VBOR set to 2.5V.
4160 
4161 //----------------------------- CONFIG2H Options -------------------------------
4162 
4163 #define _WDT_OFF_2H             0xFE    // WDT disabled (control is placed on the SWDTEN bit).
4164 #define _WDT_ON_2H              0xFF    // WDT enabled.
4165 #define _WDTPS_1_2H             0xF1    // 1:1.
4166 #define _WDTPS_2_2H             0xF3    // 1:2.
4167 #define _WDTPS_4_2H             0xF5    // 1:4.
4168 #define _WDTPS_8_2H             0xF7    // 1:8.
4169 #define _WDTPS_16_2H            0xF9    // 1:16.
4170 #define _WDTPS_32_2H            0xFB    // 1:32.
4171 #define _WDTPS_64_2H            0xFD    // 1:64.
4172 #define _WDTPS_128_2H           0xFF    // 1:128.
4173 
4174 //----------------------------- CONFIG3L Options -------------------------------
4175 
4176 #define _CCP2MX_OFF             0xFE    // CCP2 input/output is multiplexed with RE7.
4177 #define _CCP2MX_OFF_3H          0xFE    // CCP2 input/output is multiplexed with RE7.
4178 #define _CCP2MX_ON              0xFF    // CCP2 input/output is multiplexed with RC1.
4179 #define _CCP2MX_ON_3H           0xFF    // CCP2 input/output is multiplexed with RC1.
4180 
4181 //----------------------------- CONFIG3H Options -------------------------------
4182 
4183 #define _CCP2MX_OFF             0xFE    // CCP2 input/output is multiplexed with RE7.
4184 #define _CCP2MX_OFF_3H          0xFE    // CCP2 input/output is multiplexed with RE7.
4185 #define _CCP2MX_ON              0xFF    // CCP2 input/output is multiplexed with RC1.
4186 #define _CCP2MX_ON_3H           0xFF    // CCP2 input/output is multiplexed with RC1.
4187 
4188 //----------------------------- CONFIG4L Options -------------------------------
4189 
4190 #define _STVR_OFF_4L            0xFE    // Stack full/underflow will not cause Reset.
4191 #define _STVR_ON_4L             0xFF    // Stack full/underflow will cause Reset.
4192 #define _LVP_OFF_4L             0xFB    // Low-voltage ICSP disabled.
4193 #define _LVP_ON_4L              0xFF    // Low-voltage ICSP enabled.
4194 #define _DEBUG_ON_4L            0x7F    // Background debugger enabled. RB6 and RB7 are dedicated to In-Circuit Debug.
4195 #define _DEBUG_OFF_4L           0xFF    // Background debugger disabled. RB6 and RB7 configured as general purpose I/O pins.
4196 
4197 //----------------------------- CONFIG5L Options -------------------------------
4198 
4199 #define _CP0_ON_5L              0xFE    // Block 0 (000200-003FFFh) code-protected.
4200 #define _CP0_OFF_5L             0xFF    // Block 0 (000200-003FFFh) not code-protected.
4201 #define _CP1_ON_5L              0xFD    // Block 1 (004000-007FFFh) code-protected.
4202 #define _CP1_OFF_5L             0xFF    // Block 1 (004000-007FFFh) not code-protected.
4203 #define _CP2_ON_5L              0xFB    // Block 2 (008000-00BFFFh) code-protected.
4204 #define _CP2_OFF_5L             0xFF    // Block 2 (008000-00BFFFh) not code-protected.
4205 #define _CP3_ON_5L              0xF7    // Block 3 (00C000-00FFFFh) code-protected.
4206 #define _CP3_OFF_5L             0xFF    // Block 3 (00C000-00FFFFh) not code-protected.
4207 
4208 //----------------------------- CONFIG5H Options -------------------------------
4209 
4210 #define _CPB_ON_5H              0xBF    // Boot Block (000000-0001FFh) code-protected.
4211 #define _CPB_OFF_5H             0xFF    // Boot Block (000000-0001FFh) not code-protected.
4212 #define _CPD_ON_5H              0x7F    // Data EEPROM code-protected.
4213 #define _CPD_OFF_5H             0xFF    // Data EEPROM not code-protected.
4214 
4215 //----------------------------- CONFIG6L Options -------------------------------
4216 
4217 #define _WRT0_ON_6L             0xFE    // Block 0 (000200-003FFFh) write-protected.
4218 #define _WRT0_OFF_6L            0xFF    // Block 0 (000200-003FFFh) not write-protected.
4219 #define _WRT1_ON_6L             0xFD    // Block 1 (004000-007FFFh) write-protected.
4220 #define _WRT1_OFF_6L            0xFF    // Block 1 (004000-007FFFh) not write-protected.
4221 #define _WRT2_ON_6L             0xFB    // Block 2 (008000-00BFFFh) write-protected.
4222 #define _WRT2_OFF_6L            0xFF    // Block 2 (008000-00BFFFh) not write-protected.
4223 #define _WRT3_ON_6L             0xF7    // Block 3 (00C000-00FFFFh) write-protected.
4224 #define _WRT3_OFF_6L            0xFF    // Block 3 (00C000-00FFFFh) not write-protected.
4225 
4226 //----------------------------- CONFIG6H Options -------------------------------
4227 
4228 #define _WRTC_ON_6H             0xDF    // Configuration registers (300000-3000FFh) write-protected.
4229 #define _WRTC_OFF_6H            0xFF    // Configuration registers (300000-3000FFh) not write-protected.
4230 #define _WRTB_ON_6H             0xBF    // Boot Block (000000-0001FFh) write-protected.
4231 #define _WRTB_OFF_6H            0xFF    // Boot Block (000000-0001FFh) not write-protected.
4232 #define _WRTD_ON_6H             0x7F    // Data EEPROM write-protected.
4233 #define _WRTD_OFF_6H            0xFF    // Data EEPROM not write-protected.
4234 
4235 //----------------------------- CONFIG7L Options -------------------------------
4236 
4237 #define _EBTR0_ON_7L            0xFE    // Block 0 (000200-003FFFh) protected from table reads executed in other blocks.
4238 #define _EBTR0_OFF_7L           0xFF    // Block 0 (000200-003FFFh) not protected from table reads executed in other blocks.
4239 #define _EBTR1_ON_7L            0xFD    // Block 1 (004000-007FFFh) protected from table reads executed in other blocks.
4240 #define _EBTR1_OFF_7L           0xFF    // Block 1 (004000-007FFFh) not protected from table reads executed in other blocks.
4241 #define _EBTR2_ON_7L            0xFB    // Block 2 (008000-00BFFFh) protected from table reads executed in other blocks.
4242 #define _EBTR2_OFF_7L           0xFF    // Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks.
4243 #define _EBTR3_ON_7L            0xF7    // Block 3 (00C000-00FFFFh) protected from table reads executed in other blocks.
4244 #define _EBTR3_OFF_7L           0xFF    // Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks.
4245 
4246 //----------------------------- CONFIG7H Options -------------------------------
4247 
4248 #define _EBTRB_ON_7H            0xBF    // Boot Block (000000-0001FFh) protected from table reads executed in other blocks.
4249 #define _EBTRB_OFF_7H           0xFF    // Boot Block (000000-0001FFh) not protected from table reads executed in other blocks.
4250 
4251 //==============================================================================
4252 
4253 #define __DEVID1                0x3FFFFE
4254 #define __DEVID2                0x3FFFFF
4255 
4256 #define __IDLOC0                0x200000
4257 #define __IDLOC1                0x200001
4258 #define __IDLOC2                0x200002
4259 #define __IDLOC3                0x200003
4260 #define __IDLOC4                0x200004
4261 #define __IDLOC5                0x200005
4262 #define __IDLOC6                0x200006
4263 #define __IDLOC7                0x200007
4264 
4265 #endif // #ifndef __PIC18LF6620_H__
4266