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