1 /*
2  * This declarations of the PIC18LF46K22 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:57 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 __PIC18LF46K22_H__
26 #define __PIC18LF46K22_H__
27 
28 //==============================================================================
29 
30 //==============================================================================
31 //
32 //	Register Definitions
33 //
34 //==============================================================================
35 
36 
37 //==============================================================================
38 //        ANSELA Bits
39 
40 extern __at(0x0F38) __sfr ANSELA;
41 
42 typedef struct
43   {
44   unsigned ANSA0                : 1;
45   unsigned ANSA1                : 1;
46   unsigned ANSA2                : 1;
47   unsigned ANSA3                : 1;
48   unsigned                      : 1;
49   unsigned ANSA5                : 1;
50   unsigned                      : 1;
51   unsigned                      : 1;
52   } __ANSELAbits_t;
53 
54 extern __at(0x0F38) volatile __ANSELAbits_t ANSELAbits;
55 
56 #define _ANSA0                  0x01
57 #define _ANSA1                  0x02
58 #define _ANSA2                  0x04
59 #define _ANSA3                  0x08
60 #define _ANSA5                  0x20
61 
62 //==============================================================================
63 
64 
65 //==============================================================================
66 //        ANSELB Bits
67 
68 extern __at(0x0F39) __sfr ANSELB;
69 
70 typedef union
71   {
72   struct
73     {
74     unsigned ANSB0              : 1;
75     unsigned ANSB1              : 1;
76     unsigned ANSB2              : 1;
77     unsigned ANSB3              : 1;
78     unsigned ANSB4              : 1;
79     unsigned ANSB5              : 1;
80     unsigned                    : 1;
81     unsigned                    : 1;
82     };
83 
84   struct
85     {
86     unsigned ANSB               : 6;
87     unsigned                    : 2;
88     };
89   } __ANSELBbits_t;
90 
91 extern __at(0x0F39) volatile __ANSELBbits_t ANSELBbits;
92 
93 #define _ANSB0                  0x01
94 #define _ANSB1                  0x02
95 #define _ANSB2                  0x04
96 #define _ANSB3                  0x08
97 #define _ANSB4                  0x10
98 #define _ANSB5                  0x20
99 
100 //==============================================================================
101 
102 
103 //==============================================================================
104 //        ANSELC Bits
105 
106 extern __at(0x0F3A) __sfr ANSELC;
107 
108 typedef struct
109   {
110   unsigned                      : 1;
111   unsigned                      : 1;
112   unsigned ANSC2                : 1;
113   unsigned ANSC3                : 1;
114   unsigned ANSC4                : 1;
115   unsigned ANSC5                : 1;
116   unsigned ANSC6                : 1;
117   unsigned ANSC7                : 1;
118   } __ANSELCbits_t;
119 
120 extern __at(0x0F3A) volatile __ANSELCbits_t ANSELCbits;
121 
122 #define _ANSC2                  0x04
123 #define _ANSC3                  0x08
124 #define _ANSC4                  0x10
125 #define _ANSC5                  0x20
126 #define _ANSC6                  0x40
127 #define _ANSC7                  0x80
128 
129 //==============================================================================
130 
131 
132 //==============================================================================
133 //        ANSELD Bits
134 
135 extern __at(0x0F3B) __sfr ANSELD;
136 
137 typedef struct
138   {
139   unsigned ANSD0                : 1;
140   unsigned ANSD1                : 1;
141   unsigned ANSD2                : 1;
142   unsigned ANSD3                : 1;
143   unsigned ANSD4                : 1;
144   unsigned ANSD5                : 1;
145   unsigned ANSD6                : 1;
146   unsigned ANSD7                : 1;
147   } __ANSELDbits_t;
148 
149 extern __at(0x0F3B) volatile __ANSELDbits_t ANSELDbits;
150 
151 #define _ANSD0                  0x01
152 #define _ANSD1                  0x02
153 #define _ANSD2                  0x04
154 #define _ANSD3                  0x08
155 #define _ANSD4                  0x10
156 #define _ANSD5                  0x20
157 #define _ANSD6                  0x40
158 #define _ANSD7                  0x80
159 
160 //==============================================================================
161 
162 
163 //==============================================================================
164 //        ANSELE Bits
165 
166 extern __at(0x0F3C) __sfr ANSELE;
167 
168 typedef union
169   {
170   struct
171     {
172     unsigned ANSE0              : 1;
173     unsigned ANSE1              : 1;
174     unsigned ANSE2              : 1;
175     unsigned                    : 1;
176     unsigned                    : 1;
177     unsigned                    : 1;
178     unsigned                    : 1;
179     unsigned                    : 1;
180     };
181 
182   struct
183     {
184     unsigned ANSE               : 3;
185     unsigned                    : 5;
186     };
187   } __ANSELEbits_t;
188 
189 extern __at(0x0F3C) volatile __ANSELEbits_t ANSELEbits;
190 
191 #define _ANSE0                  0x01
192 #define _ANSE1                  0x02
193 #define _ANSE2                  0x04
194 
195 //==============================================================================
196 
197 
198 //==============================================================================
199 //        PMD2 Bits
200 
201 extern __at(0x0F3D) __sfr PMD2;
202 
203 typedef struct
204   {
205   unsigned ADCMD                : 1;
206   unsigned CMP1MD               : 1;
207   unsigned CMP2MD               : 1;
208   unsigned CTMUMD               : 1;
209   unsigned                      : 1;
210   unsigned                      : 1;
211   unsigned                      : 1;
212   unsigned                      : 1;
213   } __PMD2bits_t;
214 
215 extern __at(0x0F3D) volatile __PMD2bits_t PMD2bits;
216 
217 #define _ADCMD                  0x01
218 #define _CMP1MD                 0x02
219 #define _CMP2MD                 0x04
220 #define _CTMUMD                 0x08
221 
222 //==============================================================================
223 
224 
225 //==============================================================================
226 //        PMD1 Bits
227 
228 extern __at(0x0F3E) __sfr PMD1;
229 
230 typedef struct
231   {
232   unsigned CCP1MD               : 1;
233   unsigned CCP2MD               : 1;
234   unsigned CCP3MD               : 1;
235   unsigned CCP4MD               : 1;
236   unsigned CCP5MD               : 1;
237   unsigned                      : 1;
238   unsigned MSSP1MD              : 1;
239   unsigned MSSP2MD              : 1;
240   } __PMD1bits_t;
241 
242 extern __at(0x0F3E) volatile __PMD1bits_t PMD1bits;
243 
244 #define _CCP1MD                 0x01
245 #define _CCP2MD                 0x02
246 #define _CCP3MD                 0x04
247 #define _CCP4MD                 0x08
248 #define _CCP5MD                 0x10
249 #define _MSSP1MD                0x40
250 #define _MSSP2MD                0x80
251 
252 //==============================================================================
253 
254 
255 //==============================================================================
256 //        PMD0 Bits
257 
258 extern __at(0x0F3F) __sfr PMD0;
259 
260 typedef struct
261   {
262   unsigned TMR1MD               : 1;
263   unsigned TMR2MD               : 1;
264   unsigned TMR3MD               : 1;
265   unsigned TMR4MD               : 1;
266   unsigned TMR5MD               : 1;
267   unsigned TMR6MD               : 1;
268   unsigned UART1MD              : 1;
269   unsigned UART2MD              : 1;
270   } __PMD0bits_t;
271 
272 extern __at(0x0F3F) volatile __PMD0bits_t PMD0bits;
273 
274 #define _TMR1MD                 0x01
275 #define _TMR2MD                 0x02
276 #define _TMR3MD                 0x04
277 #define _TMR4MD                 0x08
278 #define _TMR5MD                 0x10
279 #define _TMR6MD                 0x20
280 #define _UART1MD                0x40
281 #define _UART2MD                0x80
282 
283 //==============================================================================
284 
285 
286 //==============================================================================
287 //        DACCON1 Bits
288 
289 extern __at(0x0F40) __sfr DACCON1;
290 
291 typedef union
292   {
293   struct
294     {
295     unsigned DACR0              : 1;
296     unsigned DACR1              : 1;
297     unsigned DACR2              : 1;
298     unsigned DACR3              : 1;
299     unsigned DACR4              : 1;
300     unsigned                    : 1;
301     unsigned                    : 1;
302     unsigned                    : 1;
303     };
304 
305   struct
306     {
307     unsigned DACR               : 5;
308     unsigned                    : 3;
309     };
310   } __DACCON1bits_t;
311 
312 extern __at(0x0F40) volatile __DACCON1bits_t DACCON1bits;
313 
314 #define _DACR0                  0x01
315 #define _DACR1                  0x02
316 #define _DACR2                  0x04
317 #define _DACR3                  0x08
318 #define _DACR4                  0x10
319 
320 //==============================================================================
321 
322 
323 //==============================================================================
324 //        VREFCON2 Bits
325 
326 extern __at(0x0F40) __sfr VREFCON2;
327 
328 typedef union
329   {
330   struct
331     {
332     unsigned DACR0              : 1;
333     unsigned DACR1              : 1;
334     unsigned DACR2              : 1;
335     unsigned DACR3              : 1;
336     unsigned DACR4              : 1;
337     unsigned                    : 1;
338     unsigned                    : 1;
339     unsigned                    : 1;
340     };
341 
342   struct
343     {
344     unsigned DACR               : 5;
345     unsigned                    : 3;
346     };
347   } __VREFCON2bits_t;
348 
349 extern __at(0x0F40) volatile __VREFCON2bits_t VREFCON2bits;
350 
351 #define _VREFCON2_DACR0         0x01
352 #define _VREFCON2_DACR1         0x02
353 #define _VREFCON2_DACR2         0x04
354 #define _VREFCON2_DACR3         0x08
355 #define _VREFCON2_DACR4         0x10
356 
357 //==============================================================================
358 
359 
360 //==============================================================================
361 //        DACCON0 Bits
362 
363 extern __at(0x0F41) __sfr DACCON0;
364 
365 typedef union
366   {
367   struct
368     {
369     unsigned DACNSS             : 1;
370     unsigned                    : 1;
371     unsigned DACPSS0            : 1;
372     unsigned DACPSS1            : 1;
373     unsigned                    : 1;
374     unsigned DACOE              : 1;
375     unsigned DACLPS             : 1;
376     unsigned DACEN              : 1;
377     };
378 
379   struct
380     {
381     unsigned                    : 2;
382     unsigned DACPSS             : 2;
383     unsigned                    : 4;
384     };
385   } __DACCON0bits_t;
386 
387 extern __at(0x0F41) volatile __DACCON0bits_t DACCON0bits;
388 
389 #define _DACNSS                 0x01
390 #define _DACPSS0                0x04
391 #define _DACPSS1                0x08
392 #define _DACOE                  0x20
393 #define _DACLPS                 0x40
394 #define _DACEN                  0x80
395 
396 //==============================================================================
397 
398 
399 //==============================================================================
400 //        VREFCON1 Bits
401 
402 extern __at(0x0F41) __sfr VREFCON1;
403 
404 typedef union
405   {
406   struct
407     {
408     unsigned DACNSS             : 1;
409     unsigned                    : 1;
410     unsigned DACPSS0            : 1;
411     unsigned DACPSS1            : 1;
412     unsigned                    : 1;
413     unsigned DACOE              : 1;
414     unsigned DACLPS             : 1;
415     unsigned DACEN              : 1;
416     };
417 
418   struct
419     {
420     unsigned                    : 2;
421     unsigned DACPSS             : 2;
422     unsigned                    : 4;
423     };
424   } __VREFCON1bits_t;
425 
426 extern __at(0x0F41) volatile __VREFCON1bits_t VREFCON1bits;
427 
428 #define _VREFCON1_DACNSS        0x01
429 #define _VREFCON1_DACPSS0       0x04
430 #define _VREFCON1_DACPSS1       0x08
431 #define _VREFCON1_DACOE         0x20
432 #define _VREFCON1_DACLPS        0x40
433 #define _VREFCON1_DACEN         0x80
434 
435 //==============================================================================
436 
437 
438 //==============================================================================
439 //        FVRCON Bits
440 
441 extern __at(0x0F42) __sfr FVRCON;
442 
443 typedef union
444   {
445   struct
446     {
447     unsigned                    : 1;
448     unsigned                    : 1;
449     unsigned                    : 1;
450     unsigned                    : 1;
451     unsigned FVRS0              : 1;
452     unsigned FVRS1              : 1;
453     unsigned FVRST              : 1;
454     unsigned FVREN              : 1;
455     };
456 
457   struct
458     {
459     unsigned                    : 4;
460     unsigned FVRS               : 2;
461     unsigned                    : 2;
462     };
463   } __FVRCONbits_t;
464 
465 extern __at(0x0F42) volatile __FVRCONbits_t FVRCONbits;
466 
467 #define _FVRS0                  0x10
468 #define _FVRS1                  0x20
469 #define _FVRST                  0x40
470 #define _FVREN                  0x80
471 
472 //==============================================================================
473 
474 
475 //==============================================================================
476 //        VREFCON0 Bits
477 
478 extern __at(0x0F42) __sfr VREFCON0;
479 
480 typedef union
481   {
482   struct
483     {
484     unsigned                    : 1;
485     unsigned                    : 1;
486     unsigned                    : 1;
487     unsigned                    : 1;
488     unsigned FVRS0              : 1;
489     unsigned FVRS1              : 1;
490     unsigned FVRST              : 1;
491     unsigned FVREN              : 1;
492     };
493 
494   struct
495     {
496     unsigned                    : 4;
497     unsigned FVRS               : 2;
498     unsigned                    : 2;
499     };
500   } __VREFCON0bits_t;
501 
502 extern __at(0x0F42) volatile __VREFCON0bits_t VREFCON0bits;
503 
504 #define _VREFCON0_FVRS0         0x10
505 #define _VREFCON0_FVRS1         0x20
506 #define _VREFCON0_FVRST         0x40
507 #define _VREFCON0_FVREN         0x80
508 
509 //==============================================================================
510 
511 
512 //==============================================================================
513 //        CTMUICON Bits
514 
515 extern __at(0x0F43) __sfr CTMUICON;
516 
517 typedef union
518   {
519   struct
520     {
521     unsigned IRNG0              : 1;
522     unsigned IRNG1              : 1;
523     unsigned ITRIM0             : 1;
524     unsigned ITRIM1             : 1;
525     unsigned ITRIM2             : 1;
526     unsigned ITRIM3             : 1;
527     unsigned ITRIM4             : 1;
528     unsigned ITRIM5             : 1;
529     };
530 
531   struct
532     {
533     unsigned IRNG               : 2;
534     unsigned                    : 6;
535     };
536 
537   struct
538     {
539     unsigned                    : 2;
540     unsigned ITRIM              : 6;
541     };
542   } __CTMUICONbits_t;
543 
544 extern __at(0x0F43) volatile __CTMUICONbits_t CTMUICONbits;
545 
546 #define _IRNG0                  0x01
547 #define _IRNG1                  0x02
548 #define _ITRIM0                 0x04
549 #define _ITRIM1                 0x08
550 #define _ITRIM2                 0x10
551 #define _ITRIM3                 0x20
552 #define _ITRIM4                 0x40
553 #define _ITRIM5                 0x80
554 
555 //==============================================================================
556 
557 
558 //==============================================================================
559 //        CTMUICONH Bits
560 
561 extern __at(0x0F43) __sfr CTMUICONH;
562 
563 typedef union
564   {
565   struct
566     {
567     unsigned IRNG0              : 1;
568     unsigned IRNG1              : 1;
569     unsigned ITRIM0             : 1;
570     unsigned ITRIM1             : 1;
571     unsigned ITRIM2             : 1;
572     unsigned ITRIM3             : 1;
573     unsigned ITRIM4             : 1;
574     unsigned ITRIM5             : 1;
575     };
576 
577   struct
578     {
579     unsigned IRNG               : 2;
580     unsigned                    : 6;
581     };
582 
583   struct
584     {
585     unsigned                    : 2;
586     unsigned ITRIM              : 6;
587     };
588   } __CTMUICONHbits_t;
589 
590 extern __at(0x0F43) volatile __CTMUICONHbits_t CTMUICONHbits;
591 
592 #define _CTMUICONH_IRNG0        0x01
593 #define _CTMUICONH_IRNG1        0x02
594 #define _CTMUICONH_ITRIM0       0x04
595 #define _CTMUICONH_ITRIM1       0x08
596 #define _CTMUICONH_ITRIM2       0x10
597 #define _CTMUICONH_ITRIM3       0x20
598 #define _CTMUICONH_ITRIM4       0x40
599 #define _CTMUICONH_ITRIM5       0x80
600 
601 //==============================================================================
602 
603 
604 //==============================================================================
605 //        CTMUCON1 Bits
606 
607 extern __at(0x0F44) __sfr CTMUCON1;
608 
609 typedef union
610   {
611   struct
612     {
613     unsigned EDG1STAT           : 1;
614     unsigned EDG2STAT           : 1;
615     unsigned EDG1SEL0           : 1;
616     unsigned EDG1SEL1           : 1;
617     unsigned EDG1POL            : 1;
618     unsigned EDG2SEL0           : 1;
619     unsigned EDG2SEL1           : 1;
620     unsigned EDG2POL            : 1;
621     };
622 
623   struct
624     {
625     unsigned                    : 2;
626     unsigned EDG1SEL            : 2;
627     unsigned                    : 4;
628     };
629 
630   struct
631     {
632     unsigned                    : 5;
633     unsigned EDG2SEL            : 2;
634     unsigned                    : 1;
635     };
636   } __CTMUCON1bits_t;
637 
638 extern __at(0x0F44) volatile __CTMUCON1bits_t CTMUCON1bits;
639 
640 #define _EDG1STAT               0x01
641 #define _EDG2STAT               0x02
642 #define _EDG1SEL0               0x04
643 #define _EDG1SEL1               0x08
644 #define _EDG1POL                0x10
645 #define _EDG2SEL0               0x20
646 #define _EDG2SEL1               0x40
647 #define _EDG2POL                0x80
648 
649 //==============================================================================
650 
651 
652 //==============================================================================
653 //        CTMUCONL Bits
654 
655 extern __at(0x0F44) __sfr CTMUCONL;
656 
657 typedef union
658   {
659   struct
660     {
661     unsigned EDG1STAT           : 1;
662     unsigned EDG2STAT           : 1;
663     unsigned EDG1SEL0           : 1;
664     unsigned EDG1SEL1           : 1;
665     unsigned EDG1POL            : 1;
666     unsigned EDG2SEL0           : 1;
667     unsigned EDG2SEL1           : 1;
668     unsigned EDG2POL            : 1;
669     };
670 
671   struct
672     {
673     unsigned                    : 2;
674     unsigned EDG1SEL            : 2;
675     unsigned                    : 4;
676     };
677 
678   struct
679     {
680     unsigned                    : 5;
681     unsigned EDG2SEL            : 2;
682     unsigned                    : 1;
683     };
684   } __CTMUCONLbits_t;
685 
686 extern __at(0x0F44) volatile __CTMUCONLbits_t CTMUCONLbits;
687 
688 #define _CTMUCONL_EDG1STAT      0x01
689 #define _CTMUCONL_EDG2STAT      0x02
690 #define _CTMUCONL_EDG1SEL0      0x04
691 #define _CTMUCONL_EDG1SEL1      0x08
692 #define _CTMUCONL_EDG1POL       0x10
693 #define _CTMUCONL_EDG2SEL0      0x20
694 #define _CTMUCONL_EDG2SEL1      0x40
695 #define _CTMUCONL_EDG2POL       0x80
696 
697 //==============================================================================
698 
699 
700 //==============================================================================
701 //        CTMUCON0 Bits
702 
703 extern __at(0x0F45) __sfr CTMUCON0;
704 
705 typedef struct
706   {
707   unsigned CTTRIG               : 1;
708   unsigned IDISSEN              : 1;
709   unsigned EDGSEQEN             : 1;
710   unsigned EDGEN                : 1;
711   unsigned TGEN                 : 1;
712   unsigned CTMUSIDL             : 1;
713   unsigned                      : 1;
714   unsigned CTMUEN               : 1;
715   } __CTMUCON0bits_t;
716 
717 extern __at(0x0F45) volatile __CTMUCON0bits_t CTMUCON0bits;
718 
719 #define _CTTRIG                 0x01
720 #define _IDISSEN                0x02
721 #define _EDGSEQEN               0x04
722 #define _EDGEN                  0x08
723 #define _TGEN                   0x10
724 #define _CTMUSIDL               0x20
725 #define _CTMUEN                 0x80
726 
727 //==============================================================================
728 
729 
730 //==============================================================================
731 //        CTMUCONH Bits
732 
733 extern __at(0x0F45) __sfr CTMUCONH;
734 
735 typedef struct
736   {
737   unsigned CTTRIG               : 1;
738   unsigned IDISSEN              : 1;
739   unsigned EDGSEQEN             : 1;
740   unsigned EDGEN                : 1;
741   unsigned TGEN                 : 1;
742   unsigned CTMUSIDL             : 1;
743   unsigned                      : 1;
744   unsigned CTMUEN               : 1;
745   } __CTMUCONHbits_t;
746 
747 extern __at(0x0F45) volatile __CTMUCONHbits_t CTMUCONHbits;
748 
749 #define _CTMUCONH_CTTRIG        0x01
750 #define _CTMUCONH_IDISSEN       0x02
751 #define _CTMUCONH_EDGSEQEN      0x04
752 #define _CTMUCONH_EDGEN         0x08
753 #define _CTMUCONH_TGEN          0x10
754 #define _CTMUCONH_CTMUSIDL      0x20
755 #define _CTMUCONH_CTMUEN        0x80
756 
757 //==============================================================================
758 
759 
760 //==============================================================================
761 //        SRCON1 Bits
762 
763 extern __at(0x0F46) __sfr SRCON1;
764 
765 typedef struct
766   {
767   unsigned SRRC1E               : 1;
768   unsigned SRRC2E               : 1;
769   unsigned SRRCKE               : 1;
770   unsigned SRRPE                : 1;
771   unsigned SRSC1E               : 1;
772   unsigned SRSC2E               : 1;
773   unsigned SRSCKE               : 1;
774   unsigned SRSPE                : 1;
775   } __SRCON1bits_t;
776 
777 extern __at(0x0F46) volatile __SRCON1bits_t SRCON1bits;
778 
779 #define _SRRC1E                 0x01
780 #define _SRRC2E                 0x02
781 #define _SRRCKE                 0x04
782 #define _SRRPE                  0x08
783 #define _SRSC1E                 0x10
784 #define _SRSC2E                 0x20
785 #define _SRSCKE                 0x40
786 #define _SRSPE                  0x80
787 
788 //==============================================================================
789 
790 
791 //==============================================================================
792 //        SRCON0 Bits
793 
794 extern __at(0x0F47) __sfr SRCON0;
795 
796 typedef union
797   {
798   struct
799     {
800     unsigned SRPR               : 1;
801     unsigned SRPS               : 1;
802     unsigned SRNQEN             : 1;
803     unsigned SRQEN              : 1;
804     unsigned SRCLK0             : 1;
805     unsigned SRCLK1             : 1;
806     unsigned SRCLK2             : 1;
807     unsigned SRLEN              : 1;
808     };
809 
810   struct
811     {
812     unsigned                    : 4;
813     unsigned SRCLK              : 3;
814     unsigned                    : 1;
815     };
816   } __SRCON0bits_t;
817 
818 extern __at(0x0F47) volatile __SRCON0bits_t SRCON0bits;
819 
820 #define _SRPR                   0x01
821 #define _SRPS                   0x02
822 #define _SRNQEN                 0x04
823 #define _SRQEN                  0x08
824 #define _SRCLK0                 0x10
825 #define _SRCLK1                 0x20
826 #define _SRCLK2                 0x40
827 #define _SRLEN                  0x80
828 
829 //==============================================================================
830 
831 
832 //==============================================================================
833 //        CCPTMRS1 Bits
834 
835 extern __at(0x0F48) __sfr CCPTMRS1;
836 
837 typedef union
838   {
839   struct
840     {
841     unsigned C4TSEL0            : 1;
842     unsigned C4TSEL1            : 1;
843     unsigned C5TSEL0            : 1;
844     unsigned C5TSEL1            : 1;
845     unsigned                    : 1;
846     unsigned                    : 1;
847     unsigned                    : 1;
848     unsigned                    : 1;
849     };
850 
851   struct
852     {
853     unsigned C4TSEL             : 2;
854     unsigned                    : 6;
855     };
856 
857   struct
858     {
859     unsigned                    : 2;
860     unsigned C5TSEL             : 2;
861     unsigned                    : 4;
862     };
863   } __CCPTMRS1bits_t;
864 
865 extern __at(0x0F48) volatile __CCPTMRS1bits_t CCPTMRS1bits;
866 
867 #define _C4TSEL0                0x01
868 #define _C4TSEL1                0x02
869 #define _C5TSEL0                0x04
870 #define _C5TSEL1                0x08
871 
872 //==============================================================================
873 
874 
875 //==============================================================================
876 //        CCPTMRS0 Bits
877 
878 extern __at(0x0F49) __sfr CCPTMRS0;
879 
880 typedef union
881   {
882   struct
883     {
884     unsigned C1TSEL0            : 1;
885     unsigned C1TSEL1            : 1;
886     unsigned                    : 1;
887     unsigned C2TSEL0            : 1;
888     unsigned C2TSEL1            : 1;
889     unsigned                    : 1;
890     unsigned C3TSEL0            : 1;
891     unsigned C3TSEL1            : 1;
892     };
893 
894   struct
895     {
896     unsigned C1TSEL             : 2;
897     unsigned                    : 6;
898     };
899 
900   struct
901     {
902     unsigned                    : 3;
903     unsigned C2TSEL             : 2;
904     unsigned                    : 3;
905     };
906 
907   struct
908     {
909     unsigned                    : 6;
910     unsigned C3TSEL             : 2;
911     };
912   } __CCPTMRS0bits_t;
913 
914 extern __at(0x0F49) volatile __CCPTMRS0bits_t CCPTMRS0bits;
915 
916 #define _C1TSEL0                0x01
917 #define _C1TSEL1                0x02
918 #define _C2TSEL0                0x08
919 #define _C2TSEL1                0x10
920 #define _C3TSEL0                0x40
921 #define _C3TSEL1                0x80
922 
923 //==============================================================================
924 
925 
926 //==============================================================================
927 //        T6CON Bits
928 
929 extern __at(0x0F4A) __sfr T6CON;
930 
931 typedef union
932   {
933   struct
934     {
935     unsigned T6CKPS0            : 1;
936     unsigned T6CKPS1            : 1;
937     unsigned TMR6ON             : 1;
938     unsigned T6OUTPS0           : 1;
939     unsigned T6OUTPS1           : 1;
940     unsigned T6OUTPS2           : 1;
941     unsigned T6OUTPS3           : 1;
942     unsigned                    : 1;
943     };
944 
945   struct
946     {
947     unsigned T6CKPS             : 2;
948     unsigned                    : 6;
949     };
950 
951   struct
952     {
953     unsigned                    : 3;
954     unsigned T6OUTPS            : 4;
955     unsigned                    : 1;
956     };
957   } __T6CONbits_t;
958 
959 extern __at(0x0F4A) volatile __T6CONbits_t T6CONbits;
960 
961 #define _T6CKPS0                0x01
962 #define _T6CKPS1                0x02
963 #define _TMR6ON                 0x04
964 #define _T6OUTPS0               0x08
965 #define _T6OUTPS1               0x10
966 #define _T6OUTPS2               0x20
967 #define _T6OUTPS3               0x40
968 
969 //==============================================================================
970 
971 extern __at(0x0F4B) __sfr PR6;
972 extern __at(0x0F4C) __sfr TMR6;
973 
974 //==============================================================================
975 //        T5GCON Bits
976 
977 extern __at(0x0F4D) __sfr T5GCON;
978 
979 typedef union
980   {
981   struct
982     {
983     unsigned T5GSS0             : 1;
984     unsigned T5GSS1             : 1;
985     unsigned T5GVAL             : 1;
986     unsigned T5GGO_NOT_DONE     : 1;
987     unsigned T5GSPM             : 1;
988     unsigned T5GTM              : 1;
989     unsigned T5GPOL             : 1;
990     unsigned TMR5GE             : 1;
991     };
992 
993   struct
994     {
995     unsigned                    : 1;
996     unsigned                    : 1;
997     unsigned                    : 1;
998     unsigned T5GGO              : 1;
999     unsigned                    : 1;
1000     unsigned                    : 1;
1001     unsigned                    : 1;
1002     unsigned                    : 1;
1003     };
1004 
1005   struct
1006     {
1007     unsigned                    : 1;
1008     unsigned                    : 1;
1009     unsigned                    : 1;
1010     unsigned T5G_DONE           : 1;
1011     unsigned                    : 1;
1012     unsigned                    : 1;
1013     unsigned                    : 1;
1014     unsigned                    : 1;
1015     };
1016 
1017   struct
1018     {
1019     unsigned T5GSS              : 2;
1020     unsigned                    : 6;
1021     };
1022   } __T5GCONbits_t;
1023 
1024 extern __at(0x0F4D) volatile __T5GCONbits_t T5GCONbits;
1025 
1026 #define _T5GSS0                 0x01
1027 #define _T5GSS1                 0x02
1028 #define _T5GVAL                 0x04
1029 #define _T5GGO_NOT_DONE         0x08
1030 #define _T5GGO                  0x08
1031 #define _T5G_DONE               0x08
1032 #define _T5GSPM                 0x10
1033 #define _T5GTM                  0x20
1034 #define _T5GPOL                 0x40
1035 #define _TMR5GE                 0x80
1036 
1037 //==============================================================================
1038 
1039 
1040 //==============================================================================
1041 //        T5CON Bits
1042 
1043 extern __at(0x0F4E) __sfr T5CON;
1044 
1045 typedef union
1046   {
1047   struct
1048     {
1049     unsigned TMR5ON             : 1;
1050     unsigned T5RD16             : 1;
1051     unsigned NOT_T5SYNC         : 1;
1052     unsigned T5SOSCEN           : 1;
1053     unsigned T5CKPS0            : 1;
1054     unsigned T5CKPS1            : 1;
1055     unsigned TMR5CS0            : 1;
1056     unsigned TMR5CS1            : 1;
1057     };
1058 
1059   struct
1060     {
1061     unsigned                    : 1;
1062     unsigned                    : 1;
1063     unsigned T5SYNC             : 1;
1064     unsigned                    : 1;
1065     unsigned                    : 1;
1066     unsigned                    : 1;
1067     unsigned                    : 1;
1068     unsigned                    : 1;
1069     };
1070 
1071   struct
1072     {
1073     unsigned                    : 4;
1074     unsigned T5CKPS             : 2;
1075     unsigned                    : 2;
1076     };
1077 
1078   struct
1079     {
1080     unsigned                    : 6;
1081     unsigned TMR5CS             : 2;
1082     };
1083   } __T5CONbits_t;
1084 
1085 extern __at(0x0F4E) volatile __T5CONbits_t T5CONbits;
1086 
1087 #define _TMR5ON                 0x01
1088 #define _T5RD16                 0x02
1089 #define _NOT_T5SYNC             0x04
1090 #define _T5SYNC                 0x04
1091 #define _T5SOSCEN               0x08
1092 #define _T5CKPS0                0x10
1093 #define _T5CKPS1                0x20
1094 #define _TMR5CS0                0x40
1095 #define _TMR5CS1                0x80
1096 
1097 //==============================================================================
1098 
1099 extern __at(0x0F4F) __sfr TMR5;
1100 extern __at(0x0F4F) __sfr TMR5L;
1101 extern __at(0x0F50) __sfr TMR5H;
1102 
1103 //==============================================================================
1104 //        T4CON Bits
1105 
1106 extern __at(0x0F51) __sfr T4CON;
1107 
1108 typedef union
1109   {
1110   struct
1111     {
1112     unsigned T4CKPS0            : 1;
1113     unsigned T4CKPS1            : 1;
1114     unsigned TMR4ON             : 1;
1115     unsigned T4OUTPS0           : 1;
1116     unsigned T4OUTPS1           : 1;
1117     unsigned T4OUTPS2           : 1;
1118     unsigned T4OUTPS3           : 1;
1119     unsigned                    : 1;
1120     };
1121 
1122   struct
1123     {
1124     unsigned T4CKPS             : 2;
1125     unsigned                    : 6;
1126     };
1127 
1128   struct
1129     {
1130     unsigned                    : 3;
1131     unsigned T4OUTPS            : 4;
1132     unsigned                    : 1;
1133     };
1134   } __T4CONbits_t;
1135 
1136 extern __at(0x0F51) volatile __T4CONbits_t T4CONbits;
1137 
1138 #define _T4CKPS0                0x01
1139 #define _T4CKPS1                0x02
1140 #define _TMR4ON                 0x04
1141 #define _T4OUTPS0               0x08
1142 #define _T4OUTPS1               0x10
1143 #define _T4OUTPS2               0x20
1144 #define _T4OUTPS3               0x40
1145 
1146 //==============================================================================
1147 
1148 extern __at(0x0F52) __sfr PR4;
1149 extern __at(0x0F53) __sfr TMR4;
1150 
1151 //==============================================================================
1152 //        CCP5CON Bits
1153 
1154 extern __at(0x0F54) __sfr CCP5CON;
1155 
1156 typedef union
1157   {
1158   struct
1159     {
1160     unsigned CCP5M0             : 1;
1161     unsigned CCP5M1             : 1;
1162     unsigned CCP5M2             : 1;
1163     unsigned CCP5M3             : 1;
1164     unsigned DC5B0              : 1;
1165     unsigned DC5B1              : 1;
1166     unsigned                    : 1;
1167     unsigned                    : 1;
1168     };
1169 
1170   struct
1171     {
1172     unsigned CCP5M              : 4;
1173     unsigned                    : 4;
1174     };
1175 
1176   struct
1177     {
1178     unsigned                    : 4;
1179     unsigned DC5B               : 2;
1180     unsigned                    : 2;
1181     };
1182   } __CCP5CONbits_t;
1183 
1184 extern __at(0x0F54) volatile __CCP5CONbits_t CCP5CONbits;
1185 
1186 #define _CCP5M0                 0x01
1187 #define _CCP5M1                 0x02
1188 #define _CCP5M2                 0x04
1189 #define _CCP5M3                 0x08
1190 #define _DC5B0                  0x10
1191 #define _DC5B1                  0x20
1192 
1193 //==============================================================================
1194 
1195 extern __at(0x0F55) __sfr CCPR5;
1196 extern __at(0x0F55) __sfr CCPR5L;
1197 extern __at(0x0F56) __sfr CCPR5H;
1198 
1199 //==============================================================================
1200 //        CCP4CON Bits
1201 
1202 extern __at(0x0F57) __sfr CCP4CON;
1203 
1204 typedef union
1205   {
1206   struct
1207     {
1208     unsigned CCP4M0             : 1;
1209     unsigned CCP4M1             : 1;
1210     unsigned CCP4M2             : 1;
1211     unsigned CCP4M3             : 1;
1212     unsigned DC4B0              : 1;
1213     unsigned DC4B1              : 1;
1214     unsigned                    : 1;
1215     unsigned                    : 1;
1216     };
1217 
1218   struct
1219     {
1220     unsigned CCP4M              : 4;
1221     unsigned                    : 4;
1222     };
1223 
1224   struct
1225     {
1226     unsigned                    : 4;
1227     unsigned DC4B               : 2;
1228     unsigned                    : 2;
1229     };
1230   } __CCP4CONbits_t;
1231 
1232 extern __at(0x0F57) volatile __CCP4CONbits_t CCP4CONbits;
1233 
1234 #define _CCP4M0                 0x01
1235 #define _CCP4M1                 0x02
1236 #define _CCP4M2                 0x04
1237 #define _CCP4M3                 0x08
1238 #define _DC4B0                  0x10
1239 #define _DC4B1                  0x20
1240 
1241 //==============================================================================
1242 
1243 extern __at(0x0F58) __sfr CCPR4;
1244 extern __at(0x0F58) __sfr CCPR4L;
1245 extern __at(0x0F59) __sfr CCPR4H;
1246 
1247 //==============================================================================
1248 //        PSTR3CON Bits
1249 
1250 extern __at(0x0F5A) __sfr PSTR3CON;
1251 
1252 typedef struct
1253   {
1254   unsigned STR3A                : 1;
1255   unsigned STR3B                : 1;
1256   unsigned STR3C                : 1;
1257   unsigned STR3D                : 1;
1258   unsigned STR3SYNC             : 1;
1259   unsigned                      : 1;
1260   unsigned                      : 1;
1261   unsigned                      : 1;
1262   } __PSTR3CONbits_t;
1263 
1264 extern __at(0x0F5A) volatile __PSTR3CONbits_t PSTR3CONbits;
1265 
1266 #define _STR3A                  0x01
1267 #define _STR3B                  0x02
1268 #define _STR3C                  0x04
1269 #define _STR3D                  0x08
1270 #define _STR3SYNC               0x10
1271 
1272 //==============================================================================
1273 
1274 
1275 //==============================================================================
1276 //        CCP3AS Bits
1277 
1278 extern __at(0x0F5B) __sfr CCP3AS;
1279 
1280 typedef union
1281   {
1282   struct
1283     {
1284     unsigned P3SSBD0            : 1;
1285     unsigned P3SSBD1            : 1;
1286     unsigned P3SSAC0            : 1;
1287     unsigned P3SSAC1            : 1;
1288     unsigned CCP3AS0            : 1;
1289     unsigned CCP3AS1            : 1;
1290     unsigned CCP3AS2            : 1;
1291     unsigned CCP3ASE            : 1;
1292     };
1293 
1294   struct
1295     {
1296     unsigned PSS3BD0            : 1;
1297     unsigned PSS3BD1            : 1;
1298     unsigned PSS3AC0            : 1;
1299     unsigned PSS3AC1            : 1;
1300     unsigned                    : 1;
1301     unsigned                    : 1;
1302     unsigned                    : 1;
1303     unsigned                    : 1;
1304     };
1305 
1306   struct
1307     {
1308     unsigned PSS3BD             : 2;
1309     unsigned                    : 6;
1310     };
1311 
1312   struct
1313     {
1314     unsigned P3SSBD             : 2;
1315     unsigned                    : 6;
1316     };
1317 
1318   struct
1319     {
1320     unsigned                    : 2;
1321     unsigned PSS3AC             : 2;
1322     unsigned                    : 4;
1323     };
1324 
1325   struct
1326     {
1327     unsigned                    : 2;
1328     unsigned P3SSAC             : 2;
1329     unsigned                    : 4;
1330     };
1331 
1332   struct
1333     {
1334     unsigned                    : 4;
1335     unsigned CCP3AS             : 3;
1336     unsigned                    : 1;
1337     };
1338   } __CCP3ASbits_t;
1339 
1340 extern __at(0x0F5B) volatile __CCP3ASbits_t CCP3ASbits;
1341 
1342 #define _P3SSBD0                0x01
1343 #define _PSS3BD0                0x01
1344 #define _P3SSBD1                0x02
1345 #define _PSS3BD1                0x02
1346 #define _P3SSAC0                0x04
1347 #define _PSS3AC0                0x04
1348 #define _P3SSAC1                0x08
1349 #define _PSS3AC1                0x08
1350 #define _CCP3AS0                0x10
1351 #define _CCP3AS1                0x20
1352 #define _CCP3AS2                0x40
1353 #define _CCP3ASE                0x80
1354 
1355 //==============================================================================
1356 
1357 
1358 //==============================================================================
1359 //        ECCP3AS Bits
1360 
1361 extern __at(0x0F5B) __sfr ECCP3AS;
1362 
1363 typedef union
1364   {
1365   struct
1366     {
1367     unsigned P3SSBD0            : 1;
1368     unsigned P3SSBD1            : 1;
1369     unsigned P3SSAC0            : 1;
1370     unsigned P3SSAC1            : 1;
1371     unsigned CCP3AS0            : 1;
1372     unsigned CCP3AS1            : 1;
1373     unsigned CCP3AS2            : 1;
1374     unsigned CCP3ASE            : 1;
1375     };
1376 
1377   struct
1378     {
1379     unsigned PSS3BD0            : 1;
1380     unsigned PSS3BD1            : 1;
1381     unsigned PSS3AC0            : 1;
1382     unsigned PSS3AC1            : 1;
1383     unsigned                    : 1;
1384     unsigned                    : 1;
1385     unsigned                    : 1;
1386     unsigned                    : 1;
1387     };
1388 
1389   struct
1390     {
1391     unsigned PSS3BD             : 2;
1392     unsigned                    : 6;
1393     };
1394 
1395   struct
1396     {
1397     unsigned P3SSBD             : 2;
1398     unsigned                    : 6;
1399     };
1400 
1401   struct
1402     {
1403     unsigned                    : 2;
1404     unsigned PSS3AC             : 2;
1405     unsigned                    : 4;
1406     };
1407 
1408   struct
1409     {
1410     unsigned                    : 2;
1411     unsigned P3SSAC             : 2;
1412     unsigned                    : 4;
1413     };
1414 
1415   struct
1416     {
1417     unsigned                    : 4;
1418     unsigned CCP3AS             : 3;
1419     unsigned                    : 1;
1420     };
1421   } __ECCP3ASbits_t;
1422 
1423 extern __at(0x0F5B) volatile __ECCP3ASbits_t ECCP3ASbits;
1424 
1425 #define _ECCP3AS_P3SSBD0        0x01
1426 #define _ECCP3AS_PSS3BD0        0x01
1427 #define _ECCP3AS_P3SSBD1        0x02
1428 #define _ECCP3AS_PSS3BD1        0x02
1429 #define _ECCP3AS_P3SSAC0        0x04
1430 #define _ECCP3AS_PSS3AC0        0x04
1431 #define _ECCP3AS_P3SSAC1        0x08
1432 #define _ECCP3AS_PSS3AC1        0x08
1433 #define _ECCP3AS_CCP3AS0        0x10
1434 #define _ECCP3AS_CCP3AS1        0x20
1435 #define _ECCP3AS_CCP3AS2        0x40
1436 #define _ECCP3AS_CCP3ASE        0x80
1437 
1438 //==============================================================================
1439 
1440 
1441 //==============================================================================
1442 //        PWM3CON Bits
1443 
1444 extern __at(0x0F5C) __sfr PWM3CON;
1445 
1446 typedef union
1447   {
1448   struct
1449     {
1450     unsigned P3DC0              : 1;
1451     unsigned P3DC1              : 1;
1452     unsigned P3DC2              : 1;
1453     unsigned P3DC3              : 1;
1454     unsigned P3DC4              : 1;
1455     unsigned P3DC5              : 1;
1456     unsigned P3DC6              : 1;
1457     unsigned P3RSEN             : 1;
1458     };
1459 
1460   struct
1461     {
1462     unsigned P3DC               : 7;
1463     unsigned                    : 1;
1464     };
1465   } __PWM3CONbits_t;
1466 
1467 extern __at(0x0F5C) volatile __PWM3CONbits_t PWM3CONbits;
1468 
1469 #define _P3DC0                  0x01
1470 #define _P3DC1                  0x02
1471 #define _P3DC2                  0x04
1472 #define _P3DC3                  0x08
1473 #define _P3DC4                  0x10
1474 #define _P3DC5                  0x20
1475 #define _P3DC6                  0x40
1476 #define _P3RSEN                 0x80
1477 
1478 //==============================================================================
1479 
1480 
1481 //==============================================================================
1482 //        CCP3CON Bits
1483 
1484 extern __at(0x0F5D) __sfr CCP3CON;
1485 
1486 typedef union
1487   {
1488   struct
1489     {
1490     unsigned CCP3M0             : 1;
1491     unsigned CCP3M1             : 1;
1492     unsigned CCP3M2             : 1;
1493     unsigned CCP3M3             : 1;
1494     unsigned DC3B0              : 1;
1495     unsigned DC3B1              : 1;
1496     unsigned P3M0               : 1;
1497     unsigned P3M1               : 1;
1498     };
1499 
1500   struct
1501     {
1502     unsigned CCP3M              : 4;
1503     unsigned                    : 4;
1504     };
1505 
1506   struct
1507     {
1508     unsigned                    : 4;
1509     unsigned DC3B               : 2;
1510     unsigned                    : 2;
1511     };
1512 
1513   struct
1514     {
1515     unsigned                    : 6;
1516     unsigned P3M                : 2;
1517     };
1518   } __CCP3CONbits_t;
1519 
1520 extern __at(0x0F5D) volatile __CCP3CONbits_t CCP3CONbits;
1521 
1522 #define _CCP3M0                 0x01
1523 #define _CCP3M1                 0x02
1524 #define _CCP3M2                 0x04
1525 #define _CCP3M3                 0x08
1526 #define _DC3B0                  0x10
1527 #define _DC3B1                  0x20
1528 #define _P3M0                   0x40
1529 #define _P3M1                   0x80
1530 
1531 //==============================================================================
1532 
1533 extern __at(0x0F5E) __sfr CCPR3;
1534 extern __at(0x0F5E) __sfr CCPR3L;
1535 extern __at(0x0F5F) __sfr CCPR3H;
1536 
1537 //==============================================================================
1538 //        SLRCON Bits
1539 
1540 extern __at(0x0F60) __sfr SLRCON;
1541 
1542 typedef struct
1543   {
1544   unsigned SLRA                 : 1;
1545   unsigned SLRB                 : 1;
1546   unsigned SLRC                 : 1;
1547   unsigned SLRD                 : 1;
1548   unsigned SLRE                 : 1;
1549   unsigned                      : 1;
1550   unsigned                      : 1;
1551   unsigned                      : 1;
1552   } __SLRCONbits_t;
1553 
1554 extern __at(0x0F60) volatile __SLRCONbits_t SLRCONbits;
1555 
1556 #define _SLRA                   0x01
1557 #define _SLRB                   0x02
1558 #define _SLRC                   0x04
1559 #define _SLRD                   0x08
1560 #define _SLRE                   0x10
1561 
1562 //==============================================================================
1563 
1564 
1565 //==============================================================================
1566 //        WPUB Bits
1567 
1568 extern __at(0x0F61) __sfr WPUB;
1569 
1570 typedef struct
1571   {
1572   unsigned WPUB0                : 1;
1573   unsigned WPUB1                : 1;
1574   unsigned WPUB2                : 1;
1575   unsigned WPUB3                : 1;
1576   unsigned WPUB4                : 1;
1577   unsigned WPUB5                : 1;
1578   unsigned WPUB6                : 1;
1579   unsigned WPUB7                : 1;
1580   } __WPUBbits_t;
1581 
1582 extern __at(0x0F61) volatile __WPUBbits_t WPUBbits;
1583 
1584 #define _WPUB0                  0x01
1585 #define _WPUB1                  0x02
1586 #define _WPUB2                  0x04
1587 #define _WPUB3                  0x08
1588 #define _WPUB4                  0x10
1589 #define _WPUB5                  0x20
1590 #define _WPUB6                  0x40
1591 #define _WPUB7                  0x80
1592 
1593 //==============================================================================
1594 
1595 
1596 //==============================================================================
1597 //        IOCB Bits
1598 
1599 extern __at(0x0F62) __sfr IOCB;
1600 
1601 typedef struct
1602   {
1603   unsigned                      : 1;
1604   unsigned                      : 1;
1605   unsigned                      : 1;
1606   unsigned                      : 1;
1607   unsigned IOCB4                : 1;
1608   unsigned IOCB5                : 1;
1609   unsigned IOCB6                : 1;
1610   unsigned IOCB7                : 1;
1611   } __IOCBbits_t;
1612 
1613 extern __at(0x0F62) volatile __IOCBbits_t IOCBbits;
1614 
1615 #define _IOCB4                  0x10
1616 #define _IOCB5                  0x20
1617 #define _IOCB6                  0x40
1618 #define _IOCB7                  0x80
1619 
1620 //==============================================================================
1621 
1622 
1623 //==============================================================================
1624 //        PSTR2CON Bits
1625 
1626 extern __at(0x0F63) __sfr PSTR2CON;
1627 
1628 typedef struct
1629   {
1630   unsigned STR2A                : 1;
1631   unsigned STR2B                : 1;
1632   unsigned STR2C                : 1;
1633   unsigned STR2D                : 1;
1634   unsigned STR2SYNC             : 1;
1635   unsigned                      : 1;
1636   unsigned                      : 1;
1637   unsigned                      : 1;
1638   } __PSTR2CONbits_t;
1639 
1640 extern __at(0x0F63) volatile __PSTR2CONbits_t PSTR2CONbits;
1641 
1642 #define _STR2A                  0x01
1643 #define _STR2B                  0x02
1644 #define _STR2C                  0x04
1645 #define _STR2D                  0x08
1646 #define _STR2SYNC               0x10
1647 
1648 //==============================================================================
1649 
1650 
1651 //==============================================================================
1652 //        CCP2AS Bits
1653 
1654 extern __at(0x0F64) __sfr CCP2AS;
1655 
1656 typedef union
1657   {
1658   struct
1659     {
1660     unsigned P2SSBD0            : 1;
1661     unsigned P2SSBD1            : 1;
1662     unsigned P2SSAC0            : 1;
1663     unsigned P2SSAC1            : 1;
1664     unsigned CCP2AS0            : 1;
1665     unsigned CCP2AS1            : 1;
1666     unsigned CCP2AS2            : 1;
1667     unsigned CCP2ASE            : 1;
1668     };
1669 
1670   struct
1671     {
1672     unsigned PSS2BD0            : 1;
1673     unsigned PSS2BD1            : 1;
1674     unsigned PSS2AC0            : 1;
1675     unsigned PSS2AC1            : 1;
1676     unsigned                    : 1;
1677     unsigned                    : 1;
1678     unsigned                    : 1;
1679     unsigned                    : 1;
1680     };
1681 
1682   struct
1683     {
1684     unsigned PSS2BD             : 2;
1685     unsigned                    : 6;
1686     };
1687 
1688   struct
1689     {
1690     unsigned P2SSBD             : 2;
1691     unsigned                    : 6;
1692     };
1693 
1694   struct
1695     {
1696     unsigned                    : 2;
1697     unsigned PSS2AC             : 2;
1698     unsigned                    : 4;
1699     };
1700 
1701   struct
1702     {
1703     unsigned                    : 2;
1704     unsigned P2SSAC             : 2;
1705     unsigned                    : 4;
1706     };
1707 
1708   struct
1709     {
1710     unsigned                    : 4;
1711     unsigned CCP2AS             : 3;
1712     unsigned                    : 1;
1713     };
1714   } __CCP2ASbits_t;
1715 
1716 extern __at(0x0F64) volatile __CCP2ASbits_t CCP2ASbits;
1717 
1718 #define _P2SSBD0                0x01
1719 #define _PSS2BD0                0x01
1720 #define _P2SSBD1                0x02
1721 #define _PSS2BD1                0x02
1722 #define _P2SSAC0                0x04
1723 #define _PSS2AC0                0x04
1724 #define _P2SSAC1                0x08
1725 #define _PSS2AC1                0x08
1726 #define _CCP2AS0                0x10
1727 #define _CCP2AS1                0x20
1728 #define _CCP2AS2                0x40
1729 #define _CCP2ASE                0x80
1730 
1731 //==============================================================================
1732 
1733 
1734 //==============================================================================
1735 //        ECCP2AS Bits
1736 
1737 extern __at(0x0F64) __sfr ECCP2AS;
1738 
1739 typedef union
1740   {
1741   struct
1742     {
1743     unsigned P2SSBD0            : 1;
1744     unsigned P2SSBD1            : 1;
1745     unsigned P2SSAC0            : 1;
1746     unsigned P2SSAC1            : 1;
1747     unsigned CCP2AS0            : 1;
1748     unsigned CCP2AS1            : 1;
1749     unsigned CCP2AS2            : 1;
1750     unsigned CCP2ASE            : 1;
1751     };
1752 
1753   struct
1754     {
1755     unsigned PSS2BD0            : 1;
1756     unsigned PSS2BD1            : 1;
1757     unsigned PSS2AC0            : 1;
1758     unsigned PSS2AC1            : 1;
1759     unsigned                    : 1;
1760     unsigned                    : 1;
1761     unsigned                    : 1;
1762     unsigned                    : 1;
1763     };
1764 
1765   struct
1766     {
1767     unsigned P2SSBD             : 2;
1768     unsigned                    : 6;
1769     };
1770 
1771   struct
1772     {
1773     unsigned PSS2BD             : 2;
1774     unsigned                    : 6;
1775     };
1776 
1777   struct
1778     {
1779     unsigned                    : 2;
1780     unsigned PSS2AC             : 2;
1781     unsigned                    : 4;
1782     };
1783 
1784   struct
1785     {
1786     unsigned                    : 2;
1787     unsigned P2SSAC             : 2;
1788     unsigned                    : 4;
1789     };
1790 
1791   struct
1792     {
1793     unsigned                    : 4;
1794     unsigned CCP2AS             : 3;
1795     unsigned                    : 1;
1796     };
1797   } __ECCP2ASbits_t;
1798 
1799 extern __at(0x0F64) volatile __ECCP2ASbits_t ECCP2ASbits;
1800 
1801 #define _ECCP2AS_P2SSBD0        0x01
1802 #define _ECCP2AS_PSS2BD0        0x01
1803 #define _ECCP2AS_P2SSBD1        0x02
1804 #define _ECCP2AS_PSS2BD1        0x02
1805 #define _ECCP2AS_P2SSAC0        0x04
1806 #define _ECCP2AS_PSS2AC0        0x04
1807 #define _ECCP2AS_P2SSAC1        0x08
1808 #define _ECCP2AS_PSS2AC1        0x08
1809 #define _ECCP2AS_CCP2AS0        0x10
1810 #define _ECCP2AS_CCP2AS1        0x20
1811 #define _ECCP2AS_CCP2AS2        0x40
1812 #define _ECCP2AS_CCP2ASE        0x80
1813 
1814 //==============================================================================
1815 
1816 
1817 //==============================================================================
1818 //        PWM2CON Bits
1819 
1820 extern __at(0x0F65) __sfr PWM2CON;
1821 
1822 typedef union
1823   {
1824   struct
1825     {
1826     unsigned P2DC0              : 1;
1827     unsigned P2DC1              : 1;
1828     unsigned P2DC2              : 1;
1829     unsigned P2DC3              : 1;
1830     unsigned P2DC4              : 1;
1831     unsigned P2DC5              : 1;
1832     unsigned P2DC6              : 1;
1833     unsigned P2RSEN             : 1;
1834     };
1835 
1836   struct
1837     {
1838     unsigned P2DC               : 7;
1839     unsigned                    : 1;
1840     };
1841   } __PWM2CONbits_t;
1842 
1843 extern __at(0x0F65) volatile __PWM2CONbits_t PWM2CONbits;
1844 
1845 #define _P2DC0                  0x01
1846 #define _P2DC1                  0x02
1847 #define _P2DC2                  0x04
1848 #define _P2DC3                  0x08
1849 #define _P2DC4                  0x10
1850 #define _P2DC5                  0x20
1851 #define _P2DC6                  0x40
1852 #define _P2RSEN                 0x80
1853 
1854 //==============================================================================
1855 
1856 
1857 //==============================================================================
1858 //        CCP2CON Bits
1859 
1860 extern __at(0x0F66) __sfr CCP2CON;
1861 
1862 typedef union
1863   {
1864   struct
1865     {
1866     unsigned CCP2M0             : 1;
1867     unsigned CCP2M1             : 1;
1868     unsigned CCP2M2             : 1;
1869     unsigned CCP2M3             : 1;
1870     unsigned DC2B0              : 1;
1871     unsigned DC2B1              : 1;
1872     unsigned P2M0               : 1;
1873     unsigned P2M1               : 1;
1874     };
1875 
1876   struct
1877     {
1878     unsigned CCP2M              : 4;
1879     unsigned                    : 4;
1880     };
1881 
1882   struct
1883     {
1884     unsigned                    : 4;
1885     unsigned DC2B               : 2;
1886     unsigned                    : 2;
1887     };
1888 
1889   struct
1890     {
1891     unsigned                    : 6;
1892     unsigned P2M                : 2;
1893     };
1894   } __CCP2CONbits_t;
1895 
1896 extern __at(0x0F66) volatile __CCP2CONbits_t CCP2CONbits;
1897 
1898 #define _CCP2M0                 0x01
1899 #define _CCP2M1                 0x02
1900 #define _CCP2M2                 0x04
1901 #define _CCP2M3                 0x08
1902 #define _DC2B0                  0x10
1903 #define _DC2B1                  0x20
1904 #define _P2M0                   0x40
1905 #define _P2M1                   0x80
1906 
1907 //==============================================================================
1908 
1909 extern __at(0x0F67) __sfr CCPR2;
1910 extern __at(0x0F67) __sfr CCPR2L;
1911 extern __at(0x0F68) __sfr CCPR2H;
1912 
1913 //==============================================================================
1914 //        SSP2CON3 Bits
1915 
1916 extern __at(0x0F69) __sfr SSP2CON3;
1917 
1918 typedef struct
1919   {
1920   unsigned DHEN                 : 1;
1921   unsigned AHEN                 : 1;
1922   unsigned SBCDE                : 1;
1923   unsigned SDAHT                : 1;
1924   unsigned BOEN                 : 1;
1925   unsigned SCIE                 : 1;
1926   unsigned PCIE                 : 1;
1927   unsigned ACKTIM               : 1;
1928   } __SSP2CON3bits_t;
1929 
1930 extern __at(0x0F69) volatile __SSP2CON3bits_t SSP2CON3bits;
1931 
1932 #define _SSP2CON3_DHEN          0x01
1933 #define _SSP2CON3_AHEN          0x02
1934 #define _SSP2CON3_SBCDE         0x04
1935 #define _SSP2CON3_SDAHT         0x08
1936 #define _SSP2CON3_BOEN          0x10
1937 #define _SSP2CON3_SCIE          0x20
1938 #define _SSP2CON3_PCIE          0x40
1939 #define _SSP2CON3_ACKTIM        0x80
1940 
1941 //==============================================================================
1942 
1943 
1944 //==============================================================================
1945 //        SSP2MSK Bits
1946 
1947 extern __at(0x0F6A) __sfr SSP2MSK;
1948 
1949 typedef struct
1950   {
1951   unsigned MSK0                 : 1;
1952   unsigned MSK1                 : 1;
1953   unsigned MSK2                 : 1;
1954   unsigned MSK3                 : 1;
1955   unsigned MSK4                 : 1;
1956   unsigned MSK5                 : 1;
1957   unsigned MSK6                 : 1;
1958   unsigned MSK7                 : 1;
1959   } __SSP2MSKbits_t;
1960 
1961 extern __at(0x0F6A) volatile __SSP2MSKbits_t SSP2MSKbits;
1962 
1963 #define _SSP2MSK_MSK0           0x01
1964 #define _SSP2MSK_MSK1           0x02
1965 #define _SSP2MSK_MSK2           0x04
1966 #define _SSP2MSK_MSK3           0x08
1967 #define _SSP2MSK_MSK4           0x10
1968 #define _SSP2MSK_MSK5           0x20
1969 #define _SSP2MSK_MSK6           0x40
1970 #define _SSP2MSK_MSK7           0x80
1971 
1972 //==============================================================================
1973 
1974 
1975 //==============================================================================
1976 //        SSP2CON2 Bits
1977 
1978 extern __at(0x0F6B) __sfr SSP2CON2;
1979 
1980 typedef struct
1981   {
1982   unsigned SEN                  : 1;
1983   unsigned RSEN                 : 1;
1984   unsigned PEN                  : 1;
1985   unsigned RCEN                 : 1;
1986   unsigned ACKEN                : 1;
1987   unsigned ACKDT                : 1;
1988   unsigned ACKSTAT              : 1;
1989   unsigned GCEN                 : 1;
1990   } __SSP2CON2bits_t;
1991 
1992 extern __at(0x0F6B) volatile __SSP2CON2bits_t SSP2CON2bits;
1993 
1994 #define _SSP2CON2_SEN           0x01
1995 #define _SSP2CON2_RSEN          0x02
1996 #define _SSP2CON2_PEN           0x04
1997 #define _SSP2CON2_RCEN          0x08
1998 #define _SSP2CON2_ACKEN         0x10
1999 #define _SSP2CON2_ACKDT         0x20
2000 #define _SSP2CON2_ACKSTAT       0x40
2001 #define _SSP2CON2_GCEN          0x80
2002 
2003 //==============================================================================
2004 
2005 
2006 //==============================================================================
2007 //        SSP2CON1 Bits
2008 
2009 extern __at(0x0F6C) __sfr SSP2CON1;
2010 
2011 typedef union
2012   {
2013   struct
2014     {
2015     unsigned SSPM0              : 1;
2016     unsigned SSPM1              : 1;
2017     unsigned SSPM2              : 1;
2018     unsigned SSPM3              : 1;
2019     unsigned CKP                : 1;
2020     unsigned SSPEN              : 1;
2021     unsigned SSPOV              : 1;
2022     unsigned WCOL               : 1;
2023     };
2024 
2025   struct
2026     {
2027     unsigned SSPM               : 4;
2028     unsigned                    : 4;
2029     };
2030   } __SSP2CON1bits_t;
2031 
2032 extern __at(0x0F6C) volatile __SSP2CON1bits_t SSP2CON1bits;
2033 
2034 #define _SSP2CON1_SSPM0         0x01
2035 #define _SSP2CON1_SSPM1         0x02
2036 #define _SSP2CON1_SSPM2         0x04
2037 #define _SSP2CON1_SSPM3         0x08
2038 #define _SSP2CON1_CKP           0x10
2039 #define _SSP2CON1_SSPEN         0x20
2040 #define _SSP2CON1_SSPOV         0x40
2041 #define _SSP2CON1_WCOL          0x80
2042 
2043 //==============================================================================
2044 
2045 
2046 //==============================================================================
2047 //        SSP2STAT Bits
2048 
2049 extern __at(0x0F6D) __sfr SSP2STAT;
2050 
2051 typedef union
2052   {
2053   struct
2054     {
2055     unsigned BF                 : 1;
2056     unsigned UA                 : 1;
2057     unsigned R_NOT_W            : 1;
2058     unsigned S                  : 1;
2059     unsigned P                  : 1;
2060     unsigned D_NOT_A            : 1;
2061     unsigned CKE                : 1;
2062     unsigned SMP                : 1;
2063     };
2064 
2065   struct
2066     {
2067     unsigned                    : 1;
2068     unsigned                    : 1;
2069     unsigned R                  : 1;
2070     unsigned                    : 1;
2071     unsigned                    : 1;
2072     unsigned D                  : 1;
2073     unsigned                    : 1;
2074     unsigned                    : 1;
2075     };
2076 
2077   struct
2078     {
2079     unsigned                    : 1;
2080     unsigned                    : 1;
2081     unsigned NOT_W              : 1;
2082     unsigned                    : 1;
2083     unsigned                    : 1;
2084     unsigned NOT_A              : 1;
2085     unsigned                    : 1;
2086     unsigned                    : 1;
2087     };
2088 
2089   struct
2090     {
2091     unsigned                    : 1;
2092     unsigned                    : 1;
2093     unsigned R_W                : 1;
2094     unsigned                    : 1;
2095     unsigned                    : 1;
2096     unsigned D_A                : 1;
2097     unsigned                    : 1;
2098     unsigned                    : 1;
2099     };
2100 
2101   struct
2102     {
2103     unsigned                    : 1;
2104     unsigned                    : 1;
2105     unsigned NOT_WRITE          : 1;
2106     unsigned                    : 1;
2107     unsigned                    : 1;
2108     unsigned NOT_ADDRESS        : 1;
2109     unsigned                    : 1;
2110     unsigned                    : 1;
2111     };
2112   } __SSP2STATbits_t;
2113 
2114 extern __at(0x0F6D) volatile __SSP2STATbits_t SSP2STATbits;
2115 
2116 #define _SSP2STAT_BF            0x01
2117 #define _SSP2STAT_UA            0x02
2118 #define _SSP2STAT_R_NOT_W       0x04
2119 #define _SSP2STAT_R             0x04
2120 #define _SSP2STAT_NOT_W         0x04
2121 #define _SSP2STAT_R_W           0x04
2122 #define _SSP2STAT_NOT_WRITE     0x04
2123 #define _SSP2STAT_S             0x08
2124 #define _SSP2STAT_P             0x10
2125 #define _SSP2STAT_D_NOT_A       0x20
2126 #define _SSP2STAT_D             0x20
2127 #define _SSP2STAT_NOT_A         0x20
2128 #define _SSP2STAT_D_A           0x20
2129 #define _SSP2STAT_NOT_ADDRESS   0x20
2130 #define _SSP2STAT_CKE           0x40
2131 #define _SSP2STAT_SMP           0x80
2132 
2133 //==============================================================================
2134 
2135 extern __at(0x0F6E) __sfr SSP2ADD;
2136 extern __at(0x0F6F) __sfr SSP2BUF;
2137 
2138 //==============================================================================
2139 //        BAUD2CON Bits
2140 
2141 extern __at(0x0F70) __sfr BAUD2CON;
2142 
2143 typedef union
2144   {
2145   struct
2146     {
2147     unsigned ABDEN              : 1;
2148     unsigned WUE                : 1;
2149     unsigned                    : 1;
2150     unsigned BRG16              : 1;
2151     unsigned CKTXP              : 1;
2152     unsigned DTRXP              : 1;
2153     unsigned RCIDL              : 1;
2154     unsigned ABDOVF             : 1;
2155     };
2156 
2157   struct
2158     {
2159     unsigned                    : 1;
2160     unsigned                    : 1;
2161     unsigned                    : 1;
2162     unsigned                    : 1;
2163     unsigned SCKP               : 1;
2164     unsigned                    : 1;
2165     unsigned                    : 1;
2166     unsigned                    : 1;
2167     };
2168   } __BAUD2CONbits_t;
2169 
2170 extern __at(0x0F70) volatile __BAUD2CONbits_t BAUD2CONbits;
2171 
2172 #define _BAUD2CON_ABDEN         0x01
2173 #define _BAUD2CON_WUE           0x02
2174 #define _BAUD2CON_BRG16         0x08
2175 #define _BAUD2CON_CKTXP         0x10
2176 #define _BAUD2CON_SCKP          0x10
2177 #define _BAUD2CON_DTRXP         0x20
2178 #define _BAUD2CON_RCIDL         0x40
2179 #define _BAUD2CON_ABDOVF        0x80
2180 
2181 //==============================================================================
2182 
2183 
2184 //==============================================================================
2185 //        BAUDCON2 Bits
2186 
2187 extern __at(0x0F70) __sfr BAUDCON2;
2188 
2189 typedef union
2190   {
2191   struct
2192     {
2193     unsigned ABDEN              : 1;
2194     unsigned WUE                : 1;
2195     unsigned                    : 1;
2196     unsigned BRG16              : 1;
2197     unsigned CKTXP              : 1;
2198     unsigned DTRXP              : 1;
2199     unsigned RCIDL              : 1;
2200     unsigned ABDOVF             : 1;
2201     };
2202 
2203   struct
2204     {
2205     unsigned                    : 1;
2206     unsigned                    : 1;
2207     unsigned                    : 1;
2208     unsigned                    : 1;
2209     unsigned SCKP               : 1;
2210     unsigned                    : 1;
2211     unsigned                    : 1;
2212     unsigned                    : 1;
2213     };
2214   } __BAUDCON2bits_t;
2215 
2216 extern __at(0x0F70) volatile __BAUDCON2bits_t BAUDCON2bits;
2217 
2218 #define _BAUDCON2_ABDEN         0x01
2219 #define _BAUDCON2_WUE           0x02
2220 #define _BAUDCON2_BRG16         0x08
2221 #define _BAUDCON2_CKTXP         0x10
2222 #define _BAUDCON2_SCKP          0x10
2223 #define _BAUDCON2_DTRXP         0x20
2224 #define _BAUDCON2_RCIDL         0x40
2225 #define _BAUDCON2_ABDOVF        0x80
2226 
2227 //==============================================================================
2228 
2229 
2230 //==============================================================================
2231 //        RC2STA Bits
2232 
2233 extern __at(0x0F71) __sfr RC2STA;
2234 
2235 typedef union
2236   {
2237   struct
2238     {
2239     unsigned RX9D               : 1;
2240     unsigned OERR               : 1;
2241     unsigned FERR               : 1;
2242     unsigned ADDEN              : 1;
2243     unsigned CREN               : 1;
2244     unsigned SREN               : 1;
2245     unsigned RX9                : 1;
2246     unsigned SPEN               : 1;
2247     };
2248 
2249   struct
2250     {
2251     unsigned RX9D2              : 1;
2252     unsigned OERR2              : 1;
2253     unsigned FERR2              : 1;
2254     unsigned ADEN               : 1;
2255     unsigned CREN2              : 1;
2256     unsigned SREN2              : 1;
2257     unsigned RX92               : 1;
2258     unsigned SPEN2              : 1;
2259     };
2260 
2261   struct
2262     {
2263     unsigned                    : 1;
2264     unsigned                    : 1;
2265     unsigned                    : 1;
2266     unsigned ADDEN2             : 1;
2267     unsigned                    : 1;
2268     unsigned                    : 1;
2269     unsigned                    : 1;
2270     unsigned                    : 1;
2271     };
2272   } __RC2STAbits_t;
2273 
2274 extern __at(0x0F71) volatile __RC2STAbits_t RC2STAbits;
2275 
2276 #define _RC2STA_RX9D            0x01
2277 #define _RC2STA_RX9D2           0x01
2278 #define _RC2STA_OERR            0x02
2279 #define _RC2STA_OERR2           0x02
2280 #define _RC2STA_FERR            0x04
2281 #define _RC2STA_FERR2           0x04
2282 #define _RC2STA_ADDEN           0x08
2283 #define _RC2STA_ADEN            0x08
2284 #define _RC2STA_ADDEN2          0x08
2285 #define _RC2STA_CREN            0x10
2286 #define _RC2STA_CREN2           0x10
2287 #define _RC2STA_SREN            0x20
2288 #define _RC2STA_SREN2           0x20
2289 #define _RC2STA_RX9             0x40
2290 #define _RC2STA_RX92            0x40
2291 #define _RC2STA_SPEN            0x80
2292 #define _RC2STA_SPEN2           0x80
2293 
2294 //==============================================================================
2295 
2296 
2297 //==============================================================================
2298 //        RCSTA2 Bits
2299 
2300 extern __at(0x0F71) __sfr RCSTA2;
2301 
2302 typedef union
2303   {
2304   struct
2305     {
2306     unsigned RX9D               : 1;
2307     unsigned OERR               : 1;
2308     unsigned FERR               : 1;
2309     unsigned ADDEN              : 1;
2310     unsigned CREN               : 1;
2311     unsigned SREN               : 1;
2312     unsigned RX9                : 1;
2313     unsigned SPEN               : 1;
2314     };
2315 
2316   struct
2317     {
2318     unsigned RX9D2              : 1;
2319     unsigned OERR2              : 1;
2320     unsigned FERR2              : 1;
2321     unsigned ADEN               : 1;
2322     unsigned CREN2              : 1;
2323     unsigned SREN2              : 1;
2324     unsigned RX92               : 1;
2325     unsigned SPEN2              : 1;
2326     };
2327 
2328   struct
2329     {
2330     unsigned                    : 1;
2331     unsigned                    : 1;
2332     unsigned                    : 1;
2333     unsigned ADDEN2             : 1;
2334     unsigned                    : 1;
2335     unsigned                    : 1;
2336     unsigned                    : 1;
2337     unsigned                    : 1;
2338     };
2339   } __RCSTA2bits_t;
2340 
2341 extern __at(0x0F71) volatile __RCSTA2bits_t RCSTA2bits;
2342 
2343 #define _RCSTA2_RX9D            0x01
2344 #define _RCSTA2_RX9D2           0x01
2345 #define _RCSTA2_OERR            0x02
2346 #define _RCSTA2_OERR2           0x02
2347 #define _RCSTA2_FERR            0x04
2348 #define _RCSTA2_FERR2           0x04
2349 #define _RCSTA2_ADDEN           0x08
2350 #define _RCSTA2_ADEN            0x08
2351 #define _RCSTA2_ADDEN2          0x08
2352 #define _RCSTA2_CREN            0x10
2353 #define _RCSTA2_CREN2           0x10
2354 #define _RCSTA2_SREN            0x20
2355 #define _RCSTA2_SREN2           0x20
2356 #define _RCSTA2_RX9             0x40
2357 #define _RCSTA2_RX92            0x40
2358 #define _RCSTA2_SPEN            0x80
2359 #define _RCSTA2_SPEN2           0x80
2360 
2361 //==============================================================================
2362 
2363 
2364 //==============================================================================
2365 //        TX2STA Bits
2366 
2367 extern __at(0x0F72) __sfr TX2STA;
2368 
2369 typedef union
2370   {
2371   struct
2372     {
2373     unsigned TX9D               : 1;
2374     unsigned TRMT               : 1;
2375     unsigned BRGH               : 1;
2376     unsigned SENDB              : 1;
2377     unsigned SYNC               : 1;
2378     unsigned TXEN               : 1;
2379     unsigned TX9                : 1;
2380     unsigned CSRC               : 1;
2381     };
2382 
2383   struct
2384     {
2385     unsigned TX9D2              : 1;
2386     unsigned TRMT2              : 1;
2387     unsigned BRGH2              : 1;
2388     unsigned SENDB2             : 1;
2389     unsigned SYNC2              : 1;
2390     unsigned TXEN2              : 1;
2391     unsigned TX92               : 1;
2392     unsigned CSRC2              : 1;
2393     };
2394   } __TX2STAbits_t;
2395 
2396 extern __at(0x0F72) volatile __TX2STAbits_t TX2STAbits;
2397 
2398 #define _TX2STA_TX9D            0x01
2399 #define _TX2STA_TX9D2           0x01
2400 #define _TX2STA_TRMT            0x02
2401 #define _TX2STA_TRMT2           0x02
2402 #define _TX2STA_BRGH            0x04
2403 #define _TX2STA_BRGH2           0x04
2404 #define _TX2STA_SENDB           0x08
2405 #define _TX2STA_SENDB2          0x08
2406 #define _TX2STA_SYNC            0x10
2407 #define _TX2STA_SYNC2           0x10
2408 #define _TX2STA_TXEN            0x20
2409 #define _TX2STA_TXEN2           0x20
2410 #define _TX2STA_TX9             0x40
2411 #define _TX2STA_TX92            0x40
2412 #define _TX2STA_CSRC            0x80
2413 #define _TX2STA_CSRC2           0x80
2414 
2415 //==============================================================================
2416 
2417 
2418 //==============================================================================
2419 //        TXSTA2 Bits
2420 
2421 extern __at(0x0F72) __sfr TXSTA2;
2422 
2423 typedef union
2424   {
2425   struct
2426     {
2427     unsigned TX9D               : 1;
2428     unsigned TRMT               : 1;
2429     unsigned BRGH               : 1;
2430     unsigned SENDB              : 1;
2431     unsigned SYNC               : 1;
2432     unsigned TXEN               : 1;
2433     unsigned TX9                : 1;
2434     unsigned CSRC               : 1;
2435     };
2436 
2437   struct
2438     {
2439     unsigned TX9D2              : 1;
2440     unsigned TRMT2              : 1;
2441     unsigned BRGH2              : 1;
2442     unsigned SENDB2             : 1;
2443     unsigned SYNC2              : 1;
2444     unsigned TXEN2              : 1;
2445     unsigned TX92               : 1;
2446     unsigned CSRC2              : 1;
2447     };
2448   } __TXSTA2bits_t;
2449 
2450 extern __at(0x0F72) volatile __TXSTA2bits_t TXSTA2bits;
2451 
2452 #define _TXSTA2_TX9D            0x01
2453 #define _TXSTA2_TX9D2           0x01
2454 #define _TXSTA2_TRMT            0x02
2455 #define _TXSTA2_TRMT2           0x02
2456 #define _TXSTA2_BRGH            0x04
2457 #define _TXSTA2_BRGH2           0x04
2458 #define _TXSTA2_SENDB           0x08
2459 #define _TXSTA2_SENDB2          0x08
2460 #define _TXSTA2_SYNC            0x10
2461 #define _TXSTA2_SYNC2           0x10
2462 #define _TXSTA2_TXEN            0x20
2463 #define _TXSTA2_TXEN2           0x20
2464 #define _TXSTA2_TX9             0x40
2465 #define _TXSTA2_TX92            0x40
2466 #define _TXSTA2_CSRC            0x80
2467 #define _TXSTA2_CSRC2           0x80
2468 
2469 //==============================================================================
2470 
2471 extern __at(0x0F73) __sfr TX2REG;
2472 extern __at(0x0F73) __sfr TXREG2;
2473 extern __at(0x0F74) __sfr RC2REG;
2474 extern __at(0x0F74) __sfr RCREG2;
2475 extern __at(0x0F75) __sfr SP2BRG;
2476 extern __at(0x0F75) __sfr SPBRG2;
2477 extern __at(0x0F76) __sfr SP2BRGH;
2478 extern __at(0x0F76) __sfr SPBRGH2;
2479 
2480 //==============================================================================
2481 //        CM12CON Bits
2482 
2483 extern __at(0x0F77) __sfr CM12CON;
2484 
2485 typedef struct
2486   {
2487   unsigned C2SYNC               : 1;
2488   unsigned C1SYNC               : 1;
2489   unsigned C2HYS                : 1;
2490   unsigned C1HYS                : 1;
2491   unsigned C2RSEL               : 1;
2492   unsigned C1RSEL               : 1;
2493   unsigned MC2OUT               : 1;
2494   unsigned MC1OUT               : 1;
2495   } __CM12CONbits_t;
2496 
2497 extern __at(0x0F77) volatile __CM12CONbits_t CM12CONbits;
2498 
2499 #define _CM12CON_C2SYNC         0x01
2500 #define _CM12CON_C1SYNC         0x02
2501 #define _CM12CON_C2HYS          0x04
2502 #define _CM12CON_C1HYS          0x08
2503 #define _CM12CON_C2RSEL         0x10
2504 #define _CM12CON_C1RSEL         0x20
2505 #define _CM12CON_MC2OUT         0x40
2506 #define _CM12CON_MC1OUT         0x80
2507 
2508 //==============================================================================
2509 
2510 
2511 //==============================================================================
2512 //        CM2CON1 Bits
2513 
2514 extern __at(0x0F77) __sfr CM2CON1;
2515 
2516 typedef struct
2517   {
2518   unsigned C2SYNC               : 1;
2519   unsigned C1SYNC               : 1;
2520   unsigned C2HYS                : 1;
2521   unsigned C1HYS                : 1;
2522   unsigned C2RSEL               : 1;
2523   unsigned C1RSEL               : 1;
2524   unsigned MC2OUT               : 1;
2525   unsigned MC1OUT               : 1;
2526   } __CM2CON1bits_t;
2527 
2528 extern __at(0x0F77) volatile __CM2CON1bits_t CM2CON1bits;
2529 
2530 #define _C2SYNC                 0x01
2531 #define _C1SYNC                 0x02
2532 #define _C2HYS                  0x04
2533 #define _C1HYS                  0x08
2534 #define _C2RSEL                 0x10
2535 #define _C1RSEL                 0x20
2536 #define _MC2OUT                 0x40
2537 #define _MC1OUT                 0x80
2538 
2539 //==============================================================================
2540 
2541 
2542 //==============================================================================
2543 //        CM2CON Bits
2544 
2545 extern __at(0x0F78) __sfr CM2CON;
2546 
2547 typedef union
2548   {
2549   struct
2550     {
2551     unsigned C2CH0              : 1;
2552     unsigned C2CH1              : 1;
2553     unsigned C2R                : 1;
2554     unsigned C2SP               : 1;
2555     unsigned C2POL              : 1;
2556     unsigned C2OE               : 1;
2557     unsigned C2OUT              : 1;
2558     unsigned C2ON               : 1;
2559     };
2560 
2561   struct
2562     {
2563     unsigned C2CH               : 2;
2564     unsigned                    : 6;
2565     };
2566   } __CM2CONbits_t;
2567 
2568 extern __at(0x0F78) volatile __CM2CONbits_t CM2CONbits;
2569 
2570 #define _C2CH0                  0x01
2571 #define _C2CH1                  0x02
2572 #define _C2R                    0x04
2573 #define _C2SP                   0x08
2574 #define _C2POL                  0x10
2575 #define _C2OE                   0x20
2576 #define _C2OUT                  0x40
2577 #define _C2ON                   0x80
2578 
2579 //==============================================================================
2580 
2581 
2582 //==============================================================================
2583 //        CM2CON0 Bits
2584 
2585 extern __at(0x0F78) __sfr CM2CON0;
2586 
2587 typedef union
2588   {
2589   struct
2590     {
2591     unsigned C2CH0              : 1;
2592     unsigned C2CH1              : 1;
2593     unsigned C2R                : 1;
2594     unsigned C2SP               : 1;
2595     unsigned C2POL              : 1;
2596     unsigned C2OE               : 1;
2597     unsigned C2OUT              : 1;
2598     unsigned C2ON               : 1;
2599     };
2600 
2601   struct
2602     {
2603     unsigned C2CH               : 2;
2604     unsigned                    : 6;
2605     };
2606   } __CM2CON0bits_t;
2607 
2608 extern __at(0x0F78) volatile __CM2CON0bits_t CM2CON0bits;
2609 
2610 #define _CM2CON0_C2CH0          0x01
2611 #define _CM2CON0_C2CH1          0x02
2612 #define _CM2CON0_C2R            0x04
2613 #define _CM2CON0_C2SP           0x08
2614 #define _CM2CON0_C2POL          0x10
2615 #define _CM2CON0_C2OE           0x20
2616 #define _CM2CON0_C2OUT          0x40
2617 #define _CM2CON0_C2ON           0x80
2618 
2619 //==============================================================================
2620 
2621 
2622 //==============================================================================
2623 //        CM1CON Bits
2624 
2625 extern __at(0x0F79) __sfr CM1CON;
2626 
2627 typedef union
2628   {
2629   struct
2630     {
2631     unsigned C1CH0              : 1;
2632     unsigned C1CH1              : 1;
2633     unsigned C1R                : 1;
2634     unsigned C1SP               : 1;
2635     unsigned C1POL              : 1;
2636     unsigned C1OE               : 1;
2637     unsigned C1OUT              : 1;
2638     unsigned C1ON               : 1;
2639     };
2640 
2641   struct
2642     {
2643     unsigned C1CH               : 2;
2644     unsigned                    : 6;
2645     };
2646   } __CM1CONbits_t;
2647 
2648 extern __at(0x0F79) volatile __CM1CONbits_t CM1CONbits;
2649 
2650 #define _C1CH0                  0x01
2651 #define _C1CH1                  0x02
2652 #define _C1R                    0x04
2653 #define _C1SP                   0x08
2654 #define _C1POL                  0x10
2655 #define _C1OE                   0x20
2656 #define _C1OUT                  0x40
2657 #define _C1ON                   0x80
2658 
2659 //==============================================================================
2660 
2661 
2662 //==============================================================================
2663 //        CM1CON0 Bits
2664 
2665 extern __at(0x0F79) __sfr CM1CON0;
2666 
2667 typedef union
2668   {
2669   struct
2670     {
2671     unsigned C1CH0              : 1;
2672     unsigned C1CH1              : 1;
2673     unsigned C1R                : 1;
2674     unsigned C1SP               : 1;
2675     unsigned C1POL              : 1;
2676     unsigned C1OE               : 1;
2677     unsigned C1OUT              : 1;
2678     unsigned C1ON               : 1;
2679     };
2680 
2681   struct
2682     {
2683     unsigned C1CH               : 2;
2684     unsigned                    : 6;
2685     };
2686   } __CM1CON0bits_t;
2687 
2688 extern __at(0x0F79) volatile __CM1CON0bits_t CM1CON0bits;
2689 
2690 #define _CM1CON0_C1CH0          0x01
2691 #define _CM1CON0_C1CH1          0x02
2692 #define _CM1CON0_C1R            0x04
2693 #define _CM1CON0_C1SP           0x08
2694 #define _CM1CON0_C1POL          0x10
2695 #define _CM1CON0_C1OE           0x20
2696 #define _CM1CON0_C1OUT          0x40
2697 #define _CM1CON0_C1ON           0x80
2698 
2699 //==============================================================================
2700 
2701 
2702 //==============================================================================
2703 //        PIE4 Bits
2704 
2705 extern __at(0x0F7A) __sfr PIE4;
2706 
2707 typedef struct
2708   {
2709   unsigned CCP3IE               : 1;
2710   unsigned CCP4IE               : 1;
2711   unsigned CCP5IE               : 1;
2712   unsigned                      : 1;
2713   unsigned                      : 1;
2714   unsigned                      : 1;
2715   unsigned                      : 1;
2716   unsigned                      : 1;
2717   } __PIE4bits_t;
2718 
2719 extern __at(0x0F7A) volatile __PIE4bits_t PIE4bits;
2720 
2721 #define _CCP3IE                 0x01
2722 #define _CCP4IE                 0x02
2723 #define _CCP5IE                 0x04
2724 
2725 //==============================================================================
2726 
2727 
2728 //==============================================================================
2729 //        PIR4 Bits
2730 
2731 extern __at(0x0F7B) __sfr PIR4;
2732 
2733 typedef struct
2734   {
2735   unsigned CCP3IF               : 1;
2736   unsigned CCP4IF               : 1;
2737   unsigned CCP5IF               : 1;
2738   unsigned                      : 1;
2739   unsigned                      : 1;
2740   unsigned                      : 1;
2741   unsigned                      : 1;
2742   unsigned                      : 1;
2743   } __PIR4bits_t;
2744 
2745 extern __at(0x0F7B) volatile __PIR4bits_t PIR4bits;
2746 
2747 #define _CCP3IF                 0x01
2748 #define _CCP4IF                 0x02
2749 #define _CCP5IF                 0x04
2750 
2751 //==============================================================================
2752 
2753 
2754 //==============================================================================
2755 //        IPR4 Bits
2756 
2757 extern __at(0x0F7C) __sfr IPR4;
2758 
2759 typedef struct
2760   {
2761   unsigned CCP3IP               : 1;
2762   unsigned CCP4IP               : 1;
2763   unsigned CCP5IP               : 1;
2764   unsigned                      : 1;
2765   unsigned                      : 1;
2766   unsigned                      : 1;
2767   unsigned                      : 1;
2768   unsigned                      : 1;
2769   } __IPR4bits_t;
2770 
2771 extern __at(0x0F7C) volatile __IPR4bits_t IPR4bits;
2772 
2773 #define _CCP3IP                 0x01
2774 #define _CCP4IP                 0x02
2775 #define _CCP5IP                 0x04
2776 
2777 //==============================================================================
2778 
2779 
2780 //==============================================================================
2781 //        PIE5 Bits
2782 
2783 extern __at(0x0F7D) __sfr PIE5;
2784 
2785 typedef struct
2786   {
2787   unsigned TMR4IE               : 1;
2788   unsigned TMR5IE               : 1;
2789   unsigned TMR6IE               : 1;
2790   unsigned                      : 1;
2791   unsigned                      : 1;
2792   unsigned                      : 1;
2793   unsigned                      : 1;
2794   unsigned                      : 1;
2795   } __PIE5bits_t;
2796 
2797 extern __at(0x0F7D) volatile __PIE5bits_t PIE5bits;
2798 
2799 #define _TMR4IE                 0x01
2800 #define _TMR5IE                 0x02
2801 #define _TMR6IE                 0x04
2802 
2803 //==============================================================================
2804 
2805 
2806 //==============================================================================
2807 //        PIR5 Bits
2808 
2809 extern __at(0x0F7E) __sfr PIR5;
2810 
2811 typedef struct
2812   {
2813   unsigned TMR4IF               : 1;
2814   unsigned TMR5IF               : 1;
2815   unsigned TMR6IF               : 1;
2816   unsigned                      : 1;
2817   unsigned                      : 1;
2818   unsigned                      : 1;
2819   unsigned                      : 1;
2820   unsigned                      : 1;
2821   } __PIR5bits_t;
2822 
2823 extern __at(0x0F7E) volatile __PIR5bits_t PIR5bits;
2824 
2825 #define _TMR4IF                 0x01
2826 #define _TMR5IF                 0x02
2827 #define _TMR6IF                 0x04
2828 
2829 //==============================================================================
2830 
2831 
2832 //==============================================================================
2833 //        IPR5 Bits
2834 
2835 extern __at(0x0F7F) __sfr IPR5;
2836 
2837 typedef struct
2838   {
2839   unsigned TMR4IP               : 1;
2840   unsigned TMR5IP               : 1;
2841   unsigned TMR6IP               : 1;
2842   unsigned                      : 1;
2843   unsigned                      : 1;
2844   unsigned                      : 1;
2845   unsigned                      : 1;
2846   unsigned                      : 1;
2847   } __IPR5bits_t;
2848 
2849 extern __at(0x0F7F) volatile __IPR5bits_t IPR5bits;
2850 
2851 #define _TMR4IP                 0x01
2852 #define _TMR5IP                 0x02
2853 #define _TMR6IP                 0x04
2854 
2855 //==============================================================================
2856 
2857 
2858 //==============================================================================
2859 //        PORTA Bits
2860 
2861 extern __at(0x0F80) __sfr PORTA;
2862 
2863 typedef union
2864   {
2865   struct
2866     {
2867     unsigned RA0                : 1;
2868     unsigned RA1                : 1;
2869     unsigned RA2                : 1;
2870     unsigned RA3                : 1;
2871     unsigned RA4                : 1;
2872     unsigned RA5                : 1;
2873     unsigned RA6                : 1;
2874     unsigned RA7                : 1;
2875     };
2876 
2877   struct
2878     {
2879     unsigned AN0                : 1;
2880     unsigned AN1                : 1;
2881     unsigned AN2                : 1;
2882     unsigned AN3                : 1;
2883     unsigned C1OUT              : 1;
2884     unsigned AN4                : 1;
2885     unsigned                    : 1;
2886     unsigned                    : 1;
2887     };
2888 
2889   struct
2890     {
2891     unsigned C12IN0M            : 1;
2892     unsigned C12IN1M            : 1;
2893     unsigned C2INP              : 1;
2894     unsigned C1INP              : 1;
2895     unsigned T0CKI              : 1;
2896     unsigned C2OUT              : 1;
2897     unsigned                    : 1;
2898     unsigned                    : 1;
2899     };
2900 
2901   struct
2902     {
2903     unsigned C12IN0N            : 1;
2904     unsigned C12IN1N            : 1;
2905     unsigned VREFM              : 1;
2906     unsigned VREFP              : 1;
2907     unsigned SRQ                : 1;
2908     unsigned SS                 : 1;
2909     unsigned                    : 1;
2910     unsigned                    : 1;
2911     };
2912 
2913   struct
2914     {
2915     unsigned                    : 1;
2916     unsigned                    : 1;
2917     unsigned VREFN              : 1;
2918     unsigned                    : 1;
2919     unsigned                    : 1;
2920     unsigned NOT_SS             : 1;
2921     unsigned                    : 1;
2922     unsigned                    : 1;
2923     };
2924 
2925   struct
2926     {
2927     unsigned                    : 1;
2928     unsigned                    : 1;
2929     unsigned CVREF              : 1;
2930     unsigned                    : 1;
2931     unsigned                    : 1;
2932     unsigned LVDIN              : 1;
2933     unsigned                    : 1;
2934     unsigned                    : 1;
2935     };
2936 
2937   struct
2938     {
2939     unsigned                    : 1;
2940     unsigned                    : 1;
2941     unsigned DACOUT             : 1;
2942     unsigned                    : 1;
2943     unsigned                    : 1;
2944     unsigned HLVDIN             : 1;
2945     unsigned                    : 1;
2946     unsigned                    : 1;
2947     };
2948 
2949   struct
2950     {
2951     unsigned                    : 1;
2952     unsigned                    : 1;
2953     unsigned                    : 1;
2954     unsigned                    : 1;
2955     unsigned                    : 1;
2956     unsigned SS1                : 1;
2957     unsigned                    : 1;
2958     unsigned                    : 1;
2959     };
2960 
2961   struct
2962     {
2963     unsigned                    : 1;
2964     unsigned                    : 1;
2965     unsigned                    : 1;
2966     unsigned                    : 1;
2967     unsigned                    : 1;
2968     unsigned NOT_SS1            : 1;
2969     unsigned                    : 1;
2970     unsigned                    : 1;
2971     };
2972 
2973   struct
2974     {
2975     unsigned                    : 1;
2976     unsigned                    : 1;
2977     unsigned                    : 1;
2978     unsigned                    : 1;
2979     unsigned                    : 1;
2980     unsigned SRNQ               : 1;
2981     unsigned                    : 1;
2982     unsigned                    : 1;
2983     };
2984   } __PORTAbits_t;
2985 
2986 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
2987 
2988 #define _PORTA_RA0              0x01
2989 #define _PORTA_AN0              0x01
2990 #define _PORTA_C12IN0M          0x01
2991 #define _PORTA_C12IN0N          0x01
2992 #define _PORTA_RA1              0x02
2993 #define _PORTA_AN1              0x02
2994 #define _PORTA_C12IN1M          0x02
2995 #define _PORTA_C12IN1N          0x02
2996 #define _PORTA_RA2              0x04
2997 #define _PORTA_AN2              0x04
2998 #define _PORTA_C2INP            0x04
2999 #define _PORTA_VREFM            0x04
3000 #define _PORTA_VREFN            0x04
3001 #define _PORTA_CVREF            0x04
3002 #define _PORTA_DACOUT           0x04
3003 #define _PORTA_RA3              0x08
3004 #define _PORTA_AN3              0x08
3005 #define _PORTA_C1INP            0x08
3006 #define _PORTA_VREFP            0x08
3007 #define _PORTA_RA4              0x10
3008 #define _PORTA_C1OUT            0x10
3009 #define _PORTA_T0CKI            0x10
3010 #define _PORTA_SRQ              0x10
3011 #define _PORTA_RA5              0x20
3012 #define _PORTA_AN4              0x20
3013 #define _PORTA_C2OUT            0x20
3014 #define _PORTA_SS               0x20
3015 #define _PORTA_NOT_SS           0x20
3016 #define _PORTA_LVDIN            0x20
3017 #define _PORTA_HLVDIN           0x20
3018 #define _PORTA_SS1              0x20
3019 #define _PORTA_NOT_SS1          0x20
3020 #define _PORTA_SRNQ             0x20
3021 #define _PORTA_RA6              0x40
3022 #define _PORTA_RA7              0x80
3023 
3024 //==============================================================================
3025 
3026 
3027 //==============================================================================
3028 //        PORTB Bits
3029 
3030 extern __at(0x0F81) __sfr PORTB;
3031 
3032 typedef union
3033   {
3034   struct
3035     {
3036     unsigned RB0                : 1;
3037     unsigned RB1                : 1;
3038     unsigned RB2                : 1;
3039     unsigned RB3                : 1;
3040     unsigned RB4                : 1;
3041     unsigned RB5                : 1;
3042     unsigned RB6                : 1;
3043     unsigned RB7                : 1;
3044     };
3045 
3046   struct
3047     {
3048     unsigned INT0               : 1;
3049     unsigned INT1               : 1;
3050     unsigned INT2               : 1;
3051     unsigned CCP2               : 1;
3052     unsigned KBI0               : 1;
3053     unsigned KBI1               : 1;
3054     unsigned KBI2               : 1;
3055     unsigned KBI3               : 1;
3056     };
3057 
3058   struct
3059     {
3060     unsigned AN12               : 1;
3061     unsigned AN10               : 1;
3062     unsigned AN8                : 1;
3063     unsigned AN9                : 1;
3064     unsigned AN11               : 1;
3065     unsigned AN13               : 1;
3066     unsigned PGC                : 1;
3067     unsigned PGD                : 1;
3068     };
3069 
3070   struct
3071     {
3072     unsigned FLT0               : 1;
3073     unsigned C12IN3M            : 1;
3074     unsigned CTED1              : 1;
3075     unsigned C12IN2M            : 1;
3076     unsigned T5G                : 1;
3077     unsigned T1G                : 1;
3078     unsigned                    : 1;
3079     unsigned                    : 1;
3080     };
3081 
3082   struct
3083     {
3084     unsigned SRI                : 1;
3085     unsigned C12IN3N            : 1;
3086     unsigned                    : 1;
3087     unsigned C12IN2N            : 1;
3088     unsigned                    : 1;
3089     unsigned CCP3               : 1;
3090     unsigned                    : 1;
3091     unsigned                    : 1;
3092     };
3093 
3094   struct
3095     {
3096     unsigned                    : 1;
3097     unsigned                    : 1;
3098     unsigned                    : 1;
3099     unsigned CTED2              : 1;
3100     unsigned                    : 1;
3101     unsigned T3CKI              : 1;
3102     unsigned                    : 1;
3103     unsigned                    : 1;
3104     };
3105 
3106   struct
3107     {
3108     unsigned                    : 1;
3109     unsigned                    : 1;
3110     unsigned                    : 1;
3111     unsigned P2A                : 1;
3112     unsigned                    : 1;
3113     unsigned P3A                : 1;
3114     unsigned                    : 1;
3115     unsigned                    : 1;
3116     };
3117 
3118   struct
3119     {
3120     unsigned INT                : 3;
3121     unsigned                    : 5;
3122     };
3123 
3124   struct
3125     {
3126     unsigned                    : 4;
3127     unsigned KBI                : 4;
3128     };
3129   } __PORTBbits_t;
3130 
3131 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
3132 
3133 #define _PORTB_RB0              0x01
3134 #define _PORTB_INT0             0x01
3135 #define _PORTB_AN12             0x01
3136 #define _PORTB_FLT0             0x01
3137 #define _PORTB_SRI              0x01
3138 #define _PORTB_RB1              0x02
3139 #define _PORTB_INT1             0x02
3140 #define _PORTB_AN10             0x02
3141 #define _PORTB_C12IN3M          0x02
3142 #define _PORTB_C12IN3N          0x02
3143 #define _PORTB_RB2              0x04
3144 #define _PORTB_INT2             0x04
3145 #define _PORTB_AN8              0x04
3146 #define _PORTB_CTED1            0x04
3147 #define _PORTB_RB3              0x08
3148 #define _PORTB_CCP2             0x08
3149 #define _PORTB_AN9              0x08
3150 #define _PORTB_C12IN2M          0x08
3151 #define _PORTB_C12IN2N          0x08
3152 #define _PORTB_CTED2            0x08
3153 #define _PORTB_P2A              0x08
3154 #define _PORTB_RB4              0x10
3155 #define _PORTB_KBI0             0x10
3156 #define _PORTB_AN11             0x10
3157 #define _PORTB_T5G              0x10
3158 #define _PORTB_RB5              0x20
3159 #define _PORTB_KBI1             0x20
3160 #define _PORTB_AN13             0x20
3161 #define _PORTB_T1G              0x20
3162 #define _PORTB_CCP3             0x20
3163 #define _PORTB_T3CKI            0x20
3164 #define _PORTB_P3A              0x20
3165 #define _PORTB_RB6              0x40
3166 #define _PORTB_KBI2             0x40
3167 #define _PORTB_PGC              0x40
3168 #define _PORTB_RB7              0x80
3169 #define _PORTB_KBI3             0x80
3170 #define _PORTB_PGD              0x80
3171 
3172 //==============================================================================
3173 
3174 
3175 //==============================================================================
3176 //        PORTC Bits
3177 
3178 extern __at(0x0F82) __sfr PORTC;
3179 
3180 typedef union
3181   {
3182   struct
3183     {
3184     unsigned RC0                : 1;
3185     unsigned RC1                : 1;
3186     unsigned RC2                : 1;
3187     unsigned RC3                : 1;
3188     unsigned RC4                : 1;
3189     unsigned RC5                : 1;
3190     unsigned RC6                : 1;
3191     unsigned RC7                : 1;
3192     };
3193 
3194   struct
3195     {
3196     unsigned T1OSO              : 1;
3197     unsigned T1OSI              : 1;
3198     unsigned T5CKI              : 1;
3199     unsigned SCK                : 1;
3200     unsigned SDI                : 1;
3201     unsigned SDO                : 1;
3202     unsigned TX                 : 1;
3203     unsigned RX                 : 1;
3204     };
3205 
3206   struct
3207     {
3208     unsigned P2B                : 1;
3209     unsigned P2A                : 1;
3210     unsigned P1A                : 1;
3211     unsigned SCL                : 1;
3212     unsigned SDA                : 1;
3213     unsigned SDO1               : 1;
3214     unsigned CK                 : 1;
3215     unsigned RX1                : 1;
3216     };
3217 
3218   struct
3219     {
3220     unsigned T1CKI              : 1;
3221     unsigned CCP2               : 1;
3222     unsigned CCP1               : 1;
3223     unsigned SCK1               : 1;
3224     unsigned SDI1               : 1;
3225     unsigned AN17               : 1;
3226     unsigned TX1                : 1;
3227     unsigned DT1                : 1;
3228     };
3229 
3230   struct
3231     {
3232     unsigned T3CKI              : 1;
3233     unsigned                    : 1;
3234     unsigned CTPLS              : 1;
3235     unsigned SCL1               : 1;
3236     unsigned SDA1               : 1;
3237     unsigned                    : 1;
3238     unsigned CK1                : 1;
3239     unsigned AN19               : 1;
3240     };
3241 
3242   struct
3243     {
3244     unsigned T3G                : 1;
3245     unsigned                    : 1;
3246     unsigned AN14               : 1;
3247     unsigned AN15               : 1;
3248     unsigned AN16               : 1;
3249     unsigned                    : 1;
3250     unsigned AN18               : 1;
3251     unsigned                    : 1;
3252     };
3253   } __PORTCbits_t;
3254 
3255 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
3256 
3257 #define _PORTC_RC0              0x01
3258 #define _PORTC_T1OSO            0x01
3259 #define _PORTC_P2B              0x01
3260 #define _PORTC_T1CKI            0x01
3261 #define _PORTC_T3CKI            0x01
3262 #define _PORTC_T3G              0x01
3263 #define _PORTC_RC1              0x02
3264 #define _PORTC_T1OSI            0x02
3265 #define _PORTC_P2A              0x02
3266 #define _PORTC_CCP2             0x02
3267 #define _PORTC_RC2              0x04
3268 #define _PORTC_T5CKI            0x04
3269 #define _PORTC_P1A              0x04
3270 #define _PORTC_CCP1             0x04
3271 #define _PORTC_CTPLS            0x04
3272 #define _PORTC_AN14             0x04
3273 #define _PORTC_RC3              0x08
3274 #define _PORTC_SCK              0x08
3275 #define _PORTC_SCL              0x08
3276 #define _PORTC_SCK1             0x08
3277 #define _PORTC_SCL1             0x08
3278 #define _PORTC_AN15             0x08
3279 #define _PORTC_RC4              0x10
3280 #define _PORTC_SDI              0x10
3281 #define _PORTC_SDA              0x10
3282 #define _PORTC_SDI1             0x10
3283 #define _PORTC_SDA1             0x10
3284 #define _PORTC_AN16             0x10
3285 #define _PORTC_RC5              0x20
3286 #define _PORTC_SDO              0x20
3287 #define _PORTC_SDO1             0x20
3288 #define _PORTC_AN17             0x20
3289 #define _PORTC_RC6              0x40
3290 #define _PORTC_TX               0x40
3291 #define _PORTC_CK               0x40
3292 #define _PORTC_TX1              0x40
3293 #define _PORTC_CK1              0x40
3294 #define _PORTC_AN18             0x40
3295 #define _PORTC_RC7              0x80
3296 #define _PORTC_RX               0x80
3297 #define _PORTC_RX1              0x80
3298 #define _PORTC_DT1              0x80
3299 #define _PORTC_AN19             0x80
3300 
3301 //==============================================================================
3302 
3303 
3304 //==============================================================================
3305 //        PORTD Bits
3306 
3307 extern __at(0x0F83) __sfr PORTD;
3308 
3309 typedef union
3310   {
3311   struct
3312     {
3313     unsigned RD0                : 1;
3314     unsigned RD1                : 1;
3315     unsigned RD2                : 1;
3316     unsigned RD3                : 1;
3317     unsigned RD4                : 1;
3318     unsigned RD5                : 1;
3319     unsigned RD6                : 1;
3320     unsigned RD7                : 1;
3321     };
3322 
3323   struct
3324     {
3325     unsigned SCK2               : 1;
3326     unsigned CCP4               : 1;
3327     unsigned P2B                : 1;
3328     unsigned P2C                : 1;
3329     unsigned P2D                : 1;
3330     unsigned P1B                : 1;
3331     unsigned P1C                : 1;
3332     unsigned P1D                : 1;
3333     };
3334 
3335   struct
3336     {
3337     unsigned SCL2               : 1;
3338     unsigned SDI2               : 1;
3339     unsigned AN22               : 1;
3340     unsigned NOT_SS2            : 1;
3341     unsigned SDO2               : 1;
3342     unsigned AN25               : 1;
3343     unsigned TX2                : 1;
3344     unsigned RX2                : 1;
3345     };
3346 
3347   struct
3348     {
3349     unsigned AN20               : 1;
3350     unsigned SDA2               : 1;
3351     unsigned                    : 1;
3352     unsigned SS2                : 1;
3353     unsigned AN24               : 1;
3354     unsigned                    : 1;
3355     unsigned CK2                : 1;
3356     unsigned DT2                : 1;
3357     };
3358 
3359   struct
3360     {
3361     unsigned                    : 1;
3362     unsigned AN21               : 1;
3363     unsigned                    : 1;
3364     unsigned AN23               : 1;
3365     unsigned                    : 1;
3366     unsigned                    : 1;
3367     unsigned AN26               : 1;
3368     unsigned AN27               : 1;
3369     };
3370   } __PORTDbits_t;
3371 
3372 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
3373 
3374 #define _PORTD_RD0              0x01
3375 #define _PORTD_SCK2             0x01
3376 #define _PORTD_SCL2             0x01
3377 #define _PORTD_AN20             0x01
3378 #define _PORTD_RD1              0x02
3379 #define _PORTD_CCP4             0x02
3380 #define _PORTD_SDI2             0x02
3381 #define _PORTD_SDA2             0x02
3382 #define _PORTD_AN21             0x02
3383 #define _PORTD_RD2              0x04
3384 #define _PORTD_P2B              0x04
3385 #define _PORTD_AN22             0x04
3386 #define _PORTD_RD3              0x08
3387 #define _PORTD_P2C              0x08
3388 #define _PORTD_NOT_SS2          0x08
3389 #define _PORTD_SS2              0x08
3390 #define _PORTD_AN23             0x08
3391 #define _PORTD_RD4              0x10
3392 #define _PORTD_P2D              0x10
3393 #define _PORTD_SDO2             0x10
3394 #define _PORTD_AN24             0x10
3395 #define _PORTD_RD5              0x20
3396 #define _PORTD_P1B              0x20
3397 #define _PORTD_AN25             0x20
3398 #define _PORTD_RD6              0x40
3399 #define _PORTD_P1C              0x40
3400 #define _PORTD_TX2              0x40
3401 #define _PORTD_CK2              0x40
3402 #define _PORTD_AN26             0x40
3403 #define _PORTD_RD7              0x80
3404 #define _PORTD_P1D              0x80
3405 #define _PORTD_RX2              0x80
3406 #define _PORTD_DT2              0x80
3407 #define _PORTD_AN27             0x80
3408 
3409 //==============================================================================
3410 
3411 
3412 //==============================================================================
3413 //        PORTE Bits
3414 
3415 extern __at(0x0F84) __sfr PORTE;
3416 
3417 typedef union
3418   {
3419   struct
3420     {
3421     unsigned RE0                : 1;
3422     unsigned RE1                : 1;
3423     unsigned RE2                : 1;
3424     unsigned RE3                : 1;
3425     unsigned                    : 1;
3426     unsigned                    : 1;
3427     unsigned                    : 1;
3428     unsigned                    : 1;
3429     };
3430 
3431   struct
3432     {
3433     unsigned AN5                : 1;
3434     unsigned AN6                : 1;
3435     unsigned AN7                : 1;
3436     unsigned MCLR               : 1;
3437     unsigned                    : 1;
3438     unsigned                    : 1;
3439     unsigned                    : 1;
3440     unsigned                    : 1;
3441     };
3442 
3443   struct
3444     {
3445     unsigned P3A                : 1;
3446     unsigned P3B                : 1;
3447     unsigned CCP5               : 1;
3448     unsigned NOT_MCLR           : 1;
3449     unsigned                    : 1;
3450     unsigned                    : 1;
3451     unsigned                    : 1;
3452     unsigned                    : 1;
3453     };
3454 
3455   struct
3456     {
3457     unsigned CCP3               : 1;
3458     unsigned                    : 1;
3459     unsigned                    : 1;
3460     unsigned VPP                : 1;
3461     unsigned                    : 1;
3462     unsigned                    : 1;
3463     unsigned                    : 1;
3464     unsigned                    : 1;
3465     };
3466 
3467   struct
3468     {
3469     unsigned RE                 : 4;
3470     unsigned                    : 4;
3471     };
3472   } __PORTEbits_t;
3473 
3474 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
3475 
3476 #define _PORTE_RE0              0x01
3477 #define _PORTE_AN5              0x01
3478 #define _PORTE_P3A              0x01
3479 #define _PORTE_CCP3             0x01
3480 #define _PORTE_RE1              0x02
3481 #define _PORTE_AN6              0x02
3482 #define _PORTE_P3B              0x02
3483 #define _PORTE_RE2              0x04
3484 #define _PORTE_AN7              0x04
3485 #define _PORTE_CCP5             0x04
3486 #define _PORTE_RE3              0x08
3487 #define _PORTE_MCLR             0x08
3488 #define _PORTE_NOT_MCLR         0x08
3489 #define _PORTE_VPP              0x08
3490 
3491 //==============================================================================
3492 
3493 
3494 //==============================================================================
3495 //        LATA Bits
3496 
3497 extern __at(0x0F89) __sfr LATA;
3498 
3499 typedef struct
3500   {
3501   unsigned LATA0                : 1;
3502   unsigned LATA1                : 1;
3503   unsigned LATA2                : 1;
3504   unsigned LATA3                : 1;
3505   unsigned LATA4                : 1;
3506   unsigned LATA5                : 1;
3507   unsigned LATA6                : 1;
3508   unsigned LATA7                : 1;
3509   } __LATAbits_t;
3510 
3511 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
3512 
3513 #define _LATA0                  0x01
3514 #define _LATA1                  0x02
3515 #define _LATA2                  0x04
3516 #define _LATA3                  0x08
3517 #define _LATA4                  0x10
3518 #define _LATA5                  0x20
3519 #define _LATA6                  0x40
3520 #define _LATA7                  0x80
3521 
3522 //==============================================================================
3523 
3524 
3525 //==============================================================================
3526 //        LATB Bits
3527 
3528 extern __at(0x0F8A) __sfr LATB;
3529 
3530 typedef struct
3531   {
3532   unsigned LATB0                : 1;
3533   unsigned LATB1                : 1;
3534   unsigned LATB2                : 1;
3535   unsigned LATB3                : 1;
3536   unsigned LATB4                : 1;
3537   unsigned LATB5                : 1;
3538   unsigned LATB6                : 1;
3539   unsigned LATB7                : 1;
3540   } __LATBbits_t;
3541 
3542 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
3543 
3544 #define _LATB0                  0x01
3545 #define _LATB1                  0x02
3546 #define _LATB2                  0x04
3547 #define _LATB3                  0x08
3548 #define _LATB4                  0x10
3549 #define _LATB5                  0x20
3550 #define _LATB6                  0x40
3551 #define _LATB7                  0x80
3552 
3553 //==============================================================================
3554 
3555 
3556 //==============================================================================
3557 //        LATC Bits
3558 
3559 extern __at(0x0F8B) __sfr LATC;
3560 
3561 typedef struct
3562   {
3563   unsigned LATC0                : 1;
3564   unsigned LATC1                : 1;
3565   unsigned LATC2                : 1;
3566   unsigned LATC3                : 1;
3567   unsigned LATC4                : 1;
3568   unsigned LATC5                : 1;
3569   unsigned LATC6                : 1;
3570   unsigned LATC7                : 1;
3571   } __LATCbits_t;
3572 
3573 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
3574 
3575 #define _LATC0                  0x01
3576 #define _LATC1                  0x02
3577 #define _LATC2                  0x04
3578 #define _LATC3                  0x08
3579 #define _LATC4                  0x10
3580 #define _LATC5                  0x20
3581 #define _LATC6                  0x40
3582 #define _LATC7                  0x80
3583 
3584 //==============================================================================
3585 
3586 
3587 //==============================================================================
3588 //        LATD Bits
3589 
3590 extern __at(0x0F8C) __sfr LATD;
3591 
3592 typedef struct
3593   {
3594   unsigned LATD0                : 1;
3595   unsigned LATD1                : 1;
3596   unsigned LATD2                : 1;
3597   unsigned LATD3                : 1;
3598   unsigned LATD4                : 1;
3599   unsigned LATD5                : 1;
3600   unsigned LATD6                : 1;
3601   unsigned LATD7                : 1;
3602   } __LATDbits_t;
3603 
3604 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
3605 
3606 #define _LATD0                  0x01
3607 #define _LATD1                  0x02
3608 #define _LATD2                  0x04
3609 #define _LATD3                  0x08
3610 #define _LATD4                  0x10
3611 #define _LATD5                  0x20
3612 #define _LATD6                  0x40
3613 #define _LATD7                  0x80
3614 
3615 //==============================================================================
3616 
3617 
3618 //==============================================================================
3619 //        LATE Bits
3620 
3621 extern __at(0x0F8D) __sfr LATE;
3622 
3623 typedef union
3624   {
3625   struct
3626     {
3627     unsigned LATE0              : 1;
3628     unsigned LATE1              : 1;
3629     unsigned LATE2              : 1;
3630     unsigned                    : 1;
3631     unsigned                    : 1;
3632     unsigned                    : 1;
3633     unsigned                    : 1;
3634     unsigned                    : 1;
3635     };
3636 
3637   struct
3638     {
3639     unsigned LATE               : 3;
3640     unsigned                    : 5;
3641     };
3642   } __LATEbits_t;
3643 
3644 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
3645 
3646 #define _LATE0                  0x01
3647 #define _LATE1                  0x02
3648 #define _LATE2                  0x04
3649 
3650 //==============================================================================
3651 
3652 
3653 //==============================================================================
3654 //        DDRA Bits
3655 
3656 extern __at(0x0F92) __sfr DDRA;
3657 
3658 typedef union
3659   {
3660   struct
3661     {
3662     unsigned TRISA0             : 1;
3663     unsigned TRISA1             : 1;
3664     unsigned TRISA2             : 1;
3665     unsigned TRISA3             : 1;
3666     unsigned TRISA4             : 1;
3667     unsigned TRISA5             : 1;
3668     unsigned TRISA6             : 1;
3669     unsigned TRISA7             : 1;
3670     };
3671 
3672   struct
3673     {
3674     unsigned RA0                : 1;
3675     unsigned RA1                : 1;
3676     unsigned RA2                : 1;
3677     unsigned RA3                : 1;
3678     unsigned RA4                : 1;
3679     unsigned RA5                : 1;
3680     unsigned RA6                : 1;
3681     unsigned RA7                : 1;
3682     };
3683   } __DDRAbits_t;
3684 
3685 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
3686 
3687 #define _TRISA0                 0x01
3688 #define _RA0                    0x01
3689 #define _TRISA1                 0x02
3690 #define _RA1                    0x02
3691 #define _TRISA2                 0x04
3692 #define _RA2                    0x04
3693 #define _TRISA3                 0x08
3694 #define _RA3                    0x08
3695 #define _TRISA4                 0x10
3696 #define _RA4                    0x10
3697 #define _TRISA5                 0x20
3698 #define _RA5                    0x20
3699 #define _TRISA6                 0x40
3700 #define _RA6                    0x40
3701 #define _TRISA7                 0x80
3702 #define _RA7                    0x80
3703 
3704 //==============================================================================
3705 
3706 
3707 //==============================================================================
3708 //        TRISA Bits
3709 
3710 extern __at(0x0F92) __sfr TRISA;
3711 
3712 typedef union
3713   {
3714   struct
3715     {
3716     unsigned TRISA0             : 1;
3717     unsigned TRISA1             : 1;
3718     unsigned TRISA2             : 1;
3719     unsigned TRISA3             : 1;
3720     unsigned TRISA4             : 1;
3721     unsigned TRISA5             : 1;
3722     unsigned TRISA6             : 1;
3723     unsigned TRISA7             : 1;
3724     };
3725 
3726   struct
3727     {
3728     unsigned RA0                : 1;
3729     unsigned RA1                : 1;
3730     unsigned RA2                : 1;
3731     unsigned RA3                : 1;
3732     unsigned RA4                : 1;
3733     unsigned RA5                : 1;
3734     unsigned RA6                : 1;
3735     unsigned RA7                : 1;
3736     };
3737   } __TRISAbits_t;
3738 
3739 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
3740 
3741 #define _TRISA_TRISA0           0x01
3742 #define _TRISA_RA0              0x01
3743 #define _TRISA_TRISA1           0x02
3744 #define _TRISA_RA1              0x02
3745 #define _TRISA_TRISA2           0x04
3746 #define _TRISA_RA2              0x04
3747 #define _TRISA_TRISA3           0x08
3748 #define _TRISA_RA3              0x08
3749 #define _TRISA_TRISA4           0x10
3750 #define _TRISA_RA4              0x10
3751 #define _TRISA_TRISA5           0x20
3752 #define _TRISA_RA5              0x20
3753 #define _TRISA_TRISA6           0x40
3754 #define _TRISA_RA6              0x40
3755 #define _TRISA_TRISA7           0x80
3756 #define _TRISA_RA7              0x80
3757 
3758 //==============================================================================
3759 
3760 
3761 //==============================================================================
3762 //        DDRB Bits
3763 
3764 extern __at(0x0F93) __sfr DDRB;
3765 
3766 typedef union
3767   {
3768   struct
3769     {
3770     unsigned TRISB0             : 1;
3771     unsigned TRISB1             : 1;
3772     unsigned TRISB2             : 1;
3773     unsigned TRISB3             : 1;
3774     unsigned TRISB4             : 1;
3775     unsigned TRISB5             : 1;
3776     unsigned TRISB6             : 1;
3777     unsigned TRISB7             : 1;
3778     };
3779 
3780   struct
3781     {
3782     unsigned RB0                : 1;
3783     unsigned RB1                : 1;
3784     unsigned RB2                : 1;
3785     unsigned RB3                : 1;
3786     unsigned RB4                : 1;
3787     unsigned RB5                : 1;
3788     unsigned RB6                : 1;
3789     unsigned RB7                : 1;
3790     };
3791   } __DDRBbits_t;
3792 
3793 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
3794 
3795 #define _TRISB0                 0x01
3796 #define _RB0                    0x01
3797 #define _TRISB1                 0x02
3798 #define _RB1                    0x02
3799 #define _TRISB2                 0x04
3800 #define _RB2                    0x04
3801 #define _TRISB3                 0x08
3802 #define _RB3                    0x08
3803 #define _TRISB4                 0x10
3804 #define _RB4                    0x10
3805 #define _TRISB5                 0x20
3806 #define _RB5                    0x20
3807 #define _TRISB6                 0x40
3808 #define _RB6                    0x40
3809 #define _TRISB7                 0x80
3810 #define _RB7                    0x80
3811 
3812 //==============================================================================
3813 
3814 
3815 //==============================================================================
3816 //        TRISB Bits
3817 
3818 extern __at(0x0F93) __sfr TRISB;
3819 
3820 typedef union
3821   {
3822   struct
3823     {
3824     unsigned TRISB0             : 1;
3825     unsigned TRISB1             : 1;
3826     unsigned TRISB2             : 1;
3827     unsigned TRISB3             : 1;
3828     unsigned TRISB4             : 1;
3829     unsigned TRISB5             : 1;
3830     unsigned TRISB6             : 1;
3831     unsigned TRISB7             : 1;
3832     };
3833 
3834   struct
3835     {
3836     unsigned RB0                : 1;
3837     unsigned RB1                : 1;
3838     unsigned RB2                : 1;
3839     unsigned RB3                : 1;
3840     unsigned RB4                : 1;
3841     unsigned RB5                : 1;
3842     unsigned RB6                : 1;
3843     unsigned RB7                : 1;
3844     };
3845   } __TRISBbits_t;
3846 
3847 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3848 
3849 #define _TRISB_TRISB0           0x01
3850 #define _TRISB_RB0              0x01
3851 #define _TRISB_TRISB1           0x02
3852 #define _TRISB_RB1              0x02
3853 #define _TRISB_TRISB2           0x04
3854 #define _TRISB_RB2              0x04
3855 #define _TRISB_TRISB3           0x08
3856 #define _TRISB_RB3              0x08
3857 #define _TRISB_TRISB4           0x10
3858 #define _TRISB_RB4              0x10
3859 #define _TRISB_TRISB5           0x20
3860 #define _TRISB_RB5              0x20
3861 #define _TRISB_TRISB6           0x40
3862 #define _TRISB_RB6              0x40
3863 #define _TRISB_TRISB7           0x80
3864 #define _TRISB_RB7              0x80
3865 
3866 //==============================================================================
3867 
3868 
3869 //==============================================================================
3870 //        DDRC Bits
3871 
3872 extern __at(0x0F94) __sfr DDRC;
3873 
3874 typedef union
3875   {
3876   struct
3877     {
3878     unsigned TRISC0             : 1;
3879     unsigned TRISC1             : 1;
3880     unsigned TRISC2             : 1;
3881     unsigned TRISC3             : 1;
3882     unsigned TRISC4             : 1;
3883     unsigned TRISC5             : 1;
3884     unsigned TRISC6             : 1;
3885     unsigned TRISC7             : 1;
3886     };
3887 
3888   struct
3889     {
3890     unsigned RC0                : 1;
3891     unsigned RC1                : 1;
3892     unsigned RC2                : 1;
3893     unsigned RC3                : 1;
3894     unsigned RC4                : 1;
3895     unsigned RC5                : 1;
3896     unsigned RC6                : 1;
3897     unsigned RC7                : 1;
3898     };
3899   } __DDRCbits_t;
3900 
3901 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
3902 
3903 #define _TRISC0                 0x01
3904 #define _RC0                    0x01
3905 #define _TRISC1                 0x02
3906 #define _RC1                    0x02
3907 #define _TRISC2                 0x04
3908 #define _RC2                    0x04
3909 #define _TRISC3                 0x08
3910 #define _RC3                    0x08
3911 #define _TRISC4                 0x10
3912 #define _RC4                    0x10
3913 #define _TRISC5                 0x20
3914 #define _RC5                    0x20
3915 #define _TRISC6                 0x40
3916 #define _RC6                    0x40
3917 #define _TRISC7                 0x80
3918 #define _RC7                    0x80
3919 
3920 //==============================================================================
3921 
3922 
3923 //==============================================================================
3924 //        TRISC Bits
3925 
3926 extern __at(0x0F94) __sfr TRISC;
3927 
3928 typedef union
3929   {
3930   struct
3931     {
3932     unsigned TRISC0             : 1;
3933     unsigned TRISC1             : 1;
3934     unsigned TRISC2             : 1;
3935     unsigned TRISC3             : 1;
3936     unsigned TRISC4             : 1;
3937     unsigned TRISC5             : 1;
3938     unsigned TRISC6             : 1;
3939     unsigned TRISC7             : 1;
3940     };
3941 
3942   struct
3943     {
3944     unsigned RC0                : 1;
3945     unsigned RC1                : 1;
3946     unsigned RC2                : 1;
3947     unsigned RC3                : 1;
3948     unsigned RC4                : 1;
3949     unsigned RC5                : 1;
3950     unsigned RC6                : 1;
3951     unsigned RC7                : 1;
3952     };
3953   } __TRISCbits_t;
3954 
3955 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3956 
3957 #define _TRISC_TRISC0           0x01
3958 #define _TRISC_RC0              0x01
3959 #define _TRISC_TRISC1           0x02
3960 #define _TRISC_RC1              0x02
3961 #define _TRISC_TRISC2           0x04
3962 #define _TRISC_RC2              0x04
3963 #define _TRISC_TRISC3           0x08
3964 #define _TRISC_RC3              0x08
3965 #define _TRISC_TRISC4           0x10
3966 #define _TRISC_RC4              0x10
3967 #define _TRISC_TRISC5           0x20
3968 #define _TRISC_RC5              0x20
3969 #define _TRISC_TRISC6           0x40
3970 #define _TRISC_RC6              0x40
3971 #define _TRISC_TRISC7           0x80
3972 #define _TRISC_RC7              0x80
3973 
3974 //==============================================================================
3975 
3976 
3977 //==============================================================================
3978 //        DDRD Bits
3979 
3980 extern __at(0x0F95) __sfr DDRD;
3981 
3982 typedef union
3983   {
3984   struct
3985     {
3986     unsigned TRISD0             : 1;
3987     unsigned TRISD1             : 1;
3988     unsigned TRISD2             : 1;
3989     unsigned TRISD3             : 1;
3990     unsigned TRISD4             : 1;
3991     unsigned TRISD5             : 1;
3992     unsigned TRISD6             : 1;
3993     unsigned TRISD7             : 1;
3994     };
3995 
3996   struct
3997     {
3998     unsigned RD0                : 1;
3999     unsigned RD1                : 1;
4000     unsigned RD2                : 1;
4001     unsigned RD3                : 1;
4002     unsigned RD4                : 1;
4003     unsigned RD5                : 1;
4004     unsigned RD6                : 1;
4005     unsigned RD7                : 1;
4006     };
4007   } __DDRDbits_t;
4008 
4009 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
4010 
4011 #define _TRISD0                 0x01
4012 #define _RD0                    0x01
4013 #define _TRISD1                 0x02
4014 #define _RD1                    0x02
4015 #define _TRISD2                 0x04
4016 #define _RD2                    0x04
4017 #define _TRISD3                 0x08
4018 #define _RD3                    0x08
4019 #define _TRISD4                 0x10
4020 #define _RD4                    0x10
4021 #define _TRISD5                 0x20
4022 #define _RD5                    0x20
4023 #define _TRISD6                 0x40
4024 #define _RD6                    0x40
4025 #define _TRISD7                 0x80
4026 #define _RD7                    0x80
4027 
4028 //==============================================================================
4029 
4030 
4031 //==============================================================================
4032 //        TRISD Bits
4033 
4034 extern __at(0x0F95) __sfr TRISD;
4035 
4036 typedef union
4037   {
4038   struct
4039     {
4040     unsigned TRISD0             : 1;
4041     unsigned TRISD1             : 1;
4042     unsigned TRISD2             : 1;
4043     unsigned TRISD3             : 1;
4044     unsigned TRISD4             : 1;
4045     unsigned TRISD5             : 1;
4046     unsigned TRISD6             : 1;
4047     unsigned TRISD7             : 1;
4048     };
4049 
4050   struct
4051     {
4052     unsigned RD0                : 1;
4053     unsigned RD1                : 1;
4054     unsigned RD2                : 1;
4055     unsigned RD3                : 1;
4056     unsigned RD4                : 1;
4057     unsigned RD5                : 1;
4058     unsigned RD6                : 1;
4059     unsigned RD7                : 1;
4060     };
4061   } __TRISDbits_t;
4062 
4063 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
4064 
4065 #define _TRISD_TRISD0           0x01
4066 #define _TRISD_RD0              0x01
4067 #define _TRISD_TRISD1           0x02
4068 #define _TRISD_RD1              0x02
4069 #define _TRISD_TRISD2           0x04
4070 #define _TRISD_RD2              0x04
4071 #define _TRISD_TRISD3           0x08
4072 #define _TRISD_RD3              0x08
4073 #define _TRISD_TRISD4           0x10
4074 #define _TRISD_RD4              0x10
4075 #define _TRISD_TRISD5           0x20
4076 #define _TRISD_RD5              0x20
4077 #define _TRISD_TRISD6           0x40
4078 #define _TRISD_RD6              0x40
4079 #define _TRISD_TRISD7           0x80
4080 #define _TRISD_RD7              0x80
4081 
4082 //==============================================================================
4083 
4084 
4085 //==============================================================================
4086 //        DDRE Bits
4087 
4088 extern __at(0x0F96) __sfr DDRE;
4089 
4090 typedef union
4091   {
4092   struct
4093     {
4094     unsigned TRISE0             : 1;
4095     unsigned TRISE1             : 1;
4096     unsigned TRISE2             : 1;
4097     unsigned                    : 1;
4098     unsigned                    : 1;
4099     unsigned                    : 1;
4100     unsigned                    : 1;
4101     unsigned WPUE3              : 1;
4102     };
4103 
4104   struct
4105     {
4106     unsigned RE0                : 1;
4107     unsigned RE1                : 1;
4108     unsigned RE2                : 1;
4109     unsigned                    : 1;
4110     unsigned                    : 1;
4111     unsigned                    : 1;
4112     unsigned                    : 1;
4113     unsigned                    : 1;
4114     };
4115 
4116   struct
4117     {
4118     unsigned RE                 : 3;
4119     unsigned                    : 5;
4120     };
4121 
4122   struct
4123     {
4124     unsigned TRISE              : 3;
4125     unsigned                    : 5;
4126     };
4127   } __DDREbits_t;
4128 
4129 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
4130 
4131 #define _TRISE0                 0x01
4132 #define _RE0                    0x01
4133 #define _TRISE1                 0x02
4134 #define _RE1                    0x02
4135 #define _TRISE2                 0x04
4136 #define _RE2                    0x04
4137 #define _WPUE3                  0x80
4138 
4139 //==============================================================================
4140 
4141 
4142 //==============================================================================
4143 //        TRISE Bits
4144 
4145 extern __at(0x0F96) __sfr TRISE;
4146 
4147 typedef union
4148   {
4149   struct
4150     {
4151     unsigned TRISE0             : 1;
4152     unsigned TRISE1             : 1;
4153     unsigned TRISE2             : 1;
4154     unsigned                    : 1;
4155     unsigned                    : 1;
4156     unsigned                    : 1;
4157     unsigned                    : 1;
4158     unsigned WPUE3              : 1;
4159     };
4160 
4161   struct
4162     {
4163     unsigned RE0                : 1;
4164     unsigned RE1                : 1;
4165     unsigned RE2                : 1;
4166     unsigned                    : 1;
4167     unsigned                    : 1;
4168     unsigned                    : 1;
4169     unsigned                    : 1;
4170     unsigned                    : 1;
4171     };
4172 
4173   struct
4174     {
4175     unsigned TRISE              : 3;
4176     unsigned                    : 5;
4177     };
4178 
4179   struct
4180     {
4181     unsigned RE                 : 3;
4182     unsigned                    : 5;
4183     };
4184   } __TRISEbits_t;
4185 
4186 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
4187 
4188 #define _TRISE_TRISE0           0x01
4189 #define _TRISE_RE0              0x01
4190 #define _TRISE_TRISE1           0x02
4191 #define _TRISE_RE1              0x02
4192 #define _TRISE_TRISE2           0x04
4193 #define _TRISE_RE2              0x04
4194 #define _TRISE_WPUE3            0x80
4195 
4196 //==============================================================================
4197 
4198 
4199 //==============================================================================
4200 //        OSCTUNE Bits
4201 
4202 extern __at(0x0F9B) __sfr OSCTUNE;
4203 
4204 typedef union
4205   {
4206   struct
4207     {
4208     unsigned TUN0               : 1;
4209     unsigned TUN1               : 1;
4210     unsigned TUN2               : 1;
4211     unsigned TUN3               : 1;
4212     unsigned TUN4               : 1;
4213     unsigned TUN5               : 1;
4214     unsigned PLLEN              : 1;
4215     unsigned INTSRC             : 1;
4216     };
4217 
4218   struct
4219     {
4220     unsigned TUN                : 6;
4221     unsigned                    : 2;
4222     };
4223   } __OSCTUNEbits_t;
4224 
4225 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
4226 
4227 #define _TUN0                   0x01
4228 #define _TUN1                   0x02
4229 #define _TUN2                   0x04
4230 #define _TUN3                   0x08
4231 #define _TUN4                   0x10
4232 #define _TUN5                   0x20
4233 #define _PLLEN                  0x40
4234 #define _INTSRC                 0x80
4235 
4236 //==============================================================================
4237 
4238 
4239 //==============================================================================
4240 //        HLVDCON Bits
4241 
4242 extern __at(0x0F9C) __sfr HLVDCON;
4243 
4244 typedef union
4245   {
4246   struct
4247     {
4248     unsigned HLVDL0             : 1;
4249     unsigned HLVDL1             : 1;
4250     unsigned HLVDL2             : 1;
4251     unsigned HLVDL3             : 1;
4252     unsigned HLVDEN             : 1;
4253     unsigned IRVST              : 1;
4254     unsigned BGVST              : 1;
4255     unsigned VDIRMAG            : 1;
4256     };
4257 
4258   struct
4259     {
4260     unsigned LVDL0              : 1;
4261     unsigned LVDL1              : 1;
4262     unsigned LVDL2              : 1;
4263     unsigned LVDL3              : 1;
4264     unsigned LVDEN              : 1;
4265     unsigned IVRST              : 1;
4266     unsigned                    : 1;
4267     unsigned                    : 1;
4268     };
4269 
4270   struct
4271     {
4272     unsigned LVV0               : 1;
4273     unsigned LVV1               : 1;
4274     unsigned LVV2               : 1;
4275     unsigned LVV3               : 1;
4276     unsigned                    : 1;
4277     unsigned BGST               : 1;
4278     unsigned                    : 1;
4279     unsigned                    : 1;
4280     };
4281 
4282   struct
4283     {
4284     unsigned HLVDL              : 4;
4285     unsigned                    : 4;
4286     };
4287 
4288   struct
4289     {
4290     unsigned LVV                : 4;
4291     unsigned                    : 4;
4292     };
4293 
4294   struct
4295     {
4296     unsigned LVDL               : 4;
4297     unsigned                    : 4;
4298     };
4299   } __HLVDCONbits_t;
4300 
4301 extern __at(0x0F9C) volatile __HLVDCONbits_t HLVDCONbits;
4302 
4303 #define _HLVDL0                 0x01
4304 #define _LVDL0                  0x01
4305 #define _LVV0                   0x01
4306 #define _HLVDL1                 0x02
4307 #define _LVDL1                  0x02
4308 #define _LVV1                   0x02
4309 #define _HLVDL2                 0x04
4310 #define _LVDL2                  0x04
4311 #define _LVV2                   0x04
4312 #define _HLVDL3                 0x08
4313 #define _LVDL3                  0x08
4314 #define _LVV3                   0x08
4315 #define _HLVDEN                 0x10
4316 #define _LVDEN                  0x10
4317 #define _IRVST                  0x20
4318 #define _IVRST                  0x20
4319 #define _BGST                   0x20
4320 #define _BGVST                  0x40
4321 #define _VDIRMAG                0x80
4322 
4323 //==============================================================================
4324 
4325 
4326 //==============================================================================
4327 //        LVDCON Bits
4328 
4329 extern __at(0x0F9C) __sfr LVDCON;
4330 
4331 typedef union
4332   {
4333   struct
4334     {
4335     unsigned HLVDL0             : 1;
4336     unsigned HLVDL1             : 1;
4337     unsigned HLVDL2             : 1;
4338     unsigned HLVDL3             : 1;
4339     unsigned HLVDEN             : 1;
4340     unsigned IRVST              : 1;
4341     unsigned BGVST              : 1;
4342     unsigned VDIRMAG            : 1;
4343     };
4344 
4345   struct
4346     {
4347     unsigned LVDL0              : 1;
4348     unsigned LVDL1              : 1;
4349     unsigned LVDL2              : 1;
4350     unsigned LVDL3              : 1;
4351     unsigned LVDEN              : 1;
4352     unsigned IVRST              : 1;
4353     unsigned                    : 1;
4354     unsigned                    : 1;
4355     };
4356 
4357   struct
4358     {
4359     unsigned LVV0               : 1;
4360     unsigned LVV1               : 1;
4361     unsigned LVV2               : 1;
4362     unsigned LVV3               : 1;
4363     unsigned                    : 1;
4364     unsigned BGST               : 1;
4365     unsigned                    : 1;
4366     unsigned                    : 1;
4367     };
4368 
4369   struct
4370     {
4371     unsigned HLVDL              : 4;
4372     unsigned                    : 4;
4373     };
4374 
4375   struct
4376     {
4377     unsigned LVDL               : 4;
4378     unsigned                    : 4;
4379     };
4380 
4381   struct
4382     {
4383     unsigned LVV                : 4;
4384     unsigned                    : 4;
4385     };
4386   } __LVDCONbits_t;
4387 
4388 extern __at(0x0F9C) volatile __LVDCONbits_t LVDCONbits;
4389 
4390 #define _LVDCON_HLVDL0          0x01
4391 #define _LVDCON_LVDL0           0x01
4392 #define _LVDCON_LVV0            0x01
4393 #define _LVDCON_HLVDL1          0x02
4394 #define _LVDCON_LVDL1           0x02
4395 #define _LVDCON_LVV1            0x02
4396 #define _LVDCON_HLVDL2          0x04
4397 #define _LVDCON_LVDL2           0x04
4398 #define _LVDCON_LVV2            0x04
4399 #define _LVDCON_HLVDL3          0x08
4400 #define _LVDCON_LVDL3           0x08
4401 #define _LVDCON_LVV3            0x08
4402 #define _LVDCON_HLVDEN          0x10
4403 #define _LVDCON_LVDEN           0x10
4404 #define _LVDCON_IRVST           0x20
4405 #define _LVDCON_IVRST           0x20
4406 #define _LVDCON_BGST            0x20
4407 #define _LVDCON_BGVST           0x40
4408 #define _LVDCON_VDIRMAG         0x80
4409 
4410 //==============================================================================
4411 
4412 
4413 //==============================================================================
4414 //        PIE1 Bits
4415 
4416 extern __at(0x0F9D) __sfr PIE1;
4417 
4418 typedef union
4419   {
4420   struct
4421     {
4422     unsigned TMR1IE             : 1;
4423     unsigned TMR2IE             : 1;
4424     unsigned CCP1IE             : 1;
4425     unsigned SSP1IE             : 1;
4426     unsigned TX1IE              : 1;
4427     unsigned RC1IE              : 1;
4428     unsigned ADIE               : 1;
4429     unsigned                    : 1;
4430     };
4431 
4432   struct
4433     {
4434     unsigned                    : 1;
4435     unsigned                    : 1;
4436     unsigned                    : 1;
4437     unsigned SSPIE              : 1;
4438     unsigned TXIE               : 1;
4439     unsigned RCIE               : 1;
4440     unsigned                    : 1;
4441     unsigned                    : 1;
4442     };
4443   } __PIE1bits_t;
4444 
4445 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
4446 
4447 #define _TMR1IE                 0x01
4448 #define _TMR2IE                 0x02
4449 #define _CCP1IE                 0x04
4450 #define _SSP1IE                 0x08
4451 #define _SSPIE                  0x08
4452 #define _TX1IE                  0x10
4453 #define _TXIE                   0x10
4454 #define _RC1IE                  0x20
4455 #define _RCIE                   0x20
4456 #define _ADIE                   0x40
4457 
4458 //==============================================================================
4459 
4460 
4461 //==============================================================================
4462 //        PIR1 Bits
4463 
4464 extern __at(0x0F9E) __sfr PIR1;
4465 
4466 typedef union
4467   {
4468   struct
4469     {
4470     unsigned TMR1IF             : 1;
4471     unsigned TMR2IF             : 1;
4472     unsigned CCP1IF             : 1;
4473     unsigned SSP1IF             : 1;
4474     unsigned TX1IF              : 1;
4475     unsigned RC1IF              : 1;
4476     unsigned ADIF               : 1;
4477     unsigned                    : 1;
4478     };
4479 
4480   struct
4481     {
4482     unsigned                    : 1;
4483     unsigned                    : 1;
4484     unsigned                    : 1;
4485     unsigned SSPIF              : 1;
4486     unsigned TXIF               : 1;
4487     unsigned RCIF               : 1;
4488     unsigned                    : 1;
4489     unsigned                    : 1;
4490     };
4491   } __PIR1bits_t;
4492 
4493 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4494 
4495 #define _TMR1IF                 0x01
4496 #define _TMR2IF                 0x02
4497 #define _CCP1IF                 0x04
4498 #define _SSP1IF                 0x08
4499 #define _SSPIF                  0x08
4500 #define _TX1IF                  0x10
4501 #define _TXIF                   0x10
4502 #define _RC1IF                  0x20
4503 #define _RCIF                   0x20
4504 #define _ADIF                   0x40
4505 
4506 //==============================================================================
4507 
4508 
4509 //==============================================================================
4510 //        IPR1 Bits
4511 
4512 extern __at(0x0F9F) __sfr IPR1;
4513 
4514 typedef union
4515   {
4516   struct
4517     {
4518     unsigned TMR1IP             : 1;
4519     unsigned TMR2IP             : 1;
4520     unsigned CCP1IP             : 1;
4521     unsigned SSP1IP             : 1;
4522     unsigned TX1IP              : 1;
4523     unsigned RC1IP              : 1;
4524     unsigned ADIP               : 1;
4525     unsigned                    : 1;
4526     };
4527 
4528   struct
4529     {
4530     unsigned                    : 1;
4531     unsigned                    : 1;
4532     unsigned                    : 1;
4533     unsigned SSPIP              : 1;
4534     unsigned TXIP               : 1;
4535     unsigned RCIP               : 1;
4536     unsigned                    : 1;
4537     unsigned                    : 1;
4538     };
4539   } __IPR1bits_t;
4540 
4541 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4542 
4543 #define _TMR1IP                 0x01
4544 #define _TMR2IP                 0x02
4545 #define _CCP1IP                 0x04
4546 #define _SSP1IP                 0x08
4547 #define _SSPIP                  0x08
4548 #define _TX1IP                  0x10
4549 #define _TXIP                   0x10
4550 #define _RC1IP                  0x20
4551 #define _RCIP                   0x20
4552 #define _ADIP                   0x40
4553 
4554 //==============================================================================
4555 
4556 
4557 //==============================================================================
4558 //        PIE2 Bits
4559 
4560 extern __at(0x0FA0) __sfr PIE2;
4561 
4562 typedef union
4563   {
4564   struct
4565     {
4566     unsigned CCP2IE             : 1;
4567     unsigned TMR3IE             : 1;
4568     unsigned HLVDIE             : 1;
4569     unsigned BCL1IE             : 1;
4570     unsigned EEIE               : 1;
4571     unsigned C2IE               : 1;
4572     unsigned C1IE               : 1;
4573     unsigned OSCFIE             : 1;
4574     };
4575 
4576   struct
4577     {
4578     unsigned                    : 1;
4579     unsigned                    : 1;
4580     unsigned LVDIE              : 1;
4581     unsigned BCLIE              : 1;
4582     unsigned                    : 1;
4583     unsigned                    : 1;
4584     unsigned                    : 1;
4585     unsigned                    : 1;
4586     };
4587   } __PIE2bits_t;
4588 
4589 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4590 
4591 #define _CCP2IE                 0x01
4592 #define _TMR3IE                 0x02
4593 #define _HLVDIE                 0x04
4594 #define _LVDIE                  0x04
4595 #define _BCL1IE                 0x08
4596 #define _BCLIE                  0x08
4597 #define _EEIE                   0x10
4598 #define _C2IE                   0x20
4599 #define _C1IE                   0x40
4600 #define _OSCFIE                 0x80
4601 
4602 //==============================================================================
4603 
4604 
4605 //==============================================================================
4606 //        PIR2 Bits
4607 
4608 extern __at(0x0FA1) __sfr PIR2;
4609 
4610 typedef union
4611   {
4612   struct
4613     {
4614     unsigned CCP2IF             : 1;
4615     unsigned TMR3IF             : 1;
4616     unsigned HLVDIF             : 1;
4617     unsigned BCL1IF             : 1;
4618     unsigned EEIF               : 1;
4619     unsigned C2IF               : 1;
4620     unsigned C1IF               : 1;
4621     unsigned OSCFIF             : 1;
4622     };
4623 
4624   struct
4625     {
4626     unsigned                    : 1;
4627     unsigned                    : 1;
4628     unsigned LVDIF              : 1;
4629     unsigned BCLIF              : 1;
4630     unsigned                    : 1;
4631     unsigned                    : 1;
4632     unsigned                    : 1;
4633     unsigned                    : 1;
4634     };
4635   } __PIR2bits_t;
4636 
4637 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4638 
4639 #define _CCP2IF                 0x01
4640 #define _TMR3IF                 0x02
4641 #define _HLVDIF                 0x04
4642 #define _LVDIF                  0x04
4643 #define _BCL1IF                 0x08
4644 #define _BCLIF                  0x08
4645 #define _EEIF                   0x10
4646 #define _C2IF                   0x20
4647 #define _C1IF                   0x40
4648 #define _OSCFIF                 0x80
4649 
4650 //==============================================================================
4651 
4652 
4653 //==============================================================================
4654 //        IPR2 Bits
4655 
4656 extern __at(0x0FA2) __sfr IPR2;
4657 
4658 typedef union
4659   {
4660   struct
4661     {
4662     unsigned CCP2IP             : 1;
4663     unsigned TMR3IP             : 1;
4664     unsigned HLVDIP             : 1;
4665     unsigned BCL1IP             : 1;
4666     unsigned EEIP               : 1;
4667     unsigned C2IP               : 1;
4668     unsigned C1IP               : 1;
4669     unsigned OSCFIP             : 1;
4670     };
4671 
4672   struct
4673     {
4674     unsigned                    : 1;
4675     unsigned                    : 1;
4676     unsigned LVDIP              : 1;
4677     unsigned BCLIP              : 1;
4678     unsigned                    : 1;
4679     unsigned                    : 1;
4680     unsigned                    : 1;
4681     unsigned                    : 1;
4682     };
4683   } __IPR2bits_t;
4684 
4685 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4686 
4687 #define _CCP2IP                 0x01
4688 #define _TMR3IP                 0x02
4689 #define _HLVDIP                 0x04
4690 #define _LVDIP                  0x04
4691 #define _BCL1IP                 0x08
4692 #define _BCLIP                  0x08
4693 #define _EEIP                   0x10
4694 #define _C2IP                   0x20
4695 #define _C1IP                   0x40
4696 #define _OSCFIP                 0x80
4697 
4698 //==============================================================================
4699 
4700 
4701 //==============================================================================
4702 //        PIE3 Bits
4703 
4704 extern __at(0x0FA3) __sfr PIE3;
4705 
4706 typedef struct
4707   {
4708   unsigned TMR1GIE              : 1;
4709   unsigned TMR3GIE              : 1;
4710   unsigned TMR5GIE              : 1;
4711   unsigned CTMUIE               : 1;
4712   unsigned TX2IE                : 1;
4713   unsigned RC2IE                : 1;
4714   unsigned BCL2IE               : 1;
4715   unsigned SSP2IE               : 1;
4716   } __PIE3bits_t;
4717 
4718 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4719 
4720 #define _TMR1GIE                0x01
4721 #define _TMR3GIE                0x02
4722 #define _TMR5GIE                0x04
4723 #define _CTMUIE                 0x08
4724 #define _TX2IE                  0x10
4725 #define _RC2IE                  0x20
4726 #define _BCL2IE                 0x40
4727 #define _SSP2IE                 0x80
4728 
4729 //==============================================================================
4730 
4731 
4732 //==============================================================================
4733 //        PIR3 Bits
4734 
4735 extern __at(0x0FA4) __sfr PIR3;
4736 
4737 typedef struct
4738   {
4739   unsigned TMR1GIF              : 1;
4740   unsigned TMR3GIF              : 1;
4741   unsigned TMR5GIF              : 1;
4742   unsigned CTMUIF               : 1;
4743   unsigned TX2IF                : 1;
4744   unsigned RC2IF                : 1;
4745   unsigned BCL2IF               : 1;
4746   unsigned SSP2IF               : 1;
4747   } __PIR3bits_t;
4748 
4749 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
4750 
4751 #define _TMR1GIF                0x01
4752 #define _TMR3GIF                0x02
4753 #define _TMR5GIF                0x04
4754 #define _CTMUIF                 0x08
4755 #define _TX2IF                  0x10
4756 #define _RC2IF                  0x20
4757 #define _BCL2IF                 0x40
4758 #define _SSP2IF                 0x80
4759 
4760 //==============================================================================
4761 
4762 
4763 //==============================================================================
4764 //        IPR3 Bits
4765 
4766 extern __at(0x0FA5) __sfr IPR3;
4767 
4768 typedef struct
4769   {
4770   unsigned TMR1GIP              : 1;
4771   unsigned TMR3GIP              : 1;
4772   unsigned TMR5GIP              : 1;
4773   unsigned CTMUIP               : 1;
4774   unsigned TX2IP                : 1;
4775   unsigned RC2IP                : 1;
4776   unsigned BCL2IP               : 1;
4777   unsigned SSP2IP               : 1;
4778   } __IPR3bits_t;
4779 
4780 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4781 
4782 #define _TMR1GIP                0x01
4783 #define _TMR3GIP                0x02
4784 #define _TMR5GIP                0x04
4785 #define _CTMUIP                 0x08
4786 #define _TX2IP                  0x10
4787 #define _RC2IP                  0x20
4788 #define _BCL2IP                 0x40
4789 #define _SSP2IP                 0x80
4790 
4791 //==============================================================================
4792 
4793 
4794 //==============================================================================
4795 //        EECON1 Bits
4796 
4797 extern __at(0x0FA6) __sfr EECON1;
4798 
4799 typedef struct
4800   {
4801   unsigned RD                   : 1;
4802   unsigned WR                   : 1;
4803   unsigned WREN                 : 1;
4804   unsigned WRERR                : 1;
4805   unsigned FREE                 : 1;
4806   unsigned                      : 1;
4807   unsigned CFGS                 : 1;
4808   unsigned EEPGD                : 1;
4809   } __EECON1bits_t;
4810 
4811 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
4812 
4813 #define _RD                     0x01
4814 #define _WR                     0x02
4815 #define _WREN                   0x04
4816 #define _WRERR                  0x08
4817 #define _FREE                   0x10
4818 #define _CFGS                   0x40
4819 #define _EEPGD                  0x80
4820 
4821 //==============================================================================
4822 
4823 extern __at(0x0FA7) __sfr EECON2;
4824 extern __at(0x0FA8) __sfr EEDATA;
4825 
4826 //==============================================================================
4827 //        EEADR Bits
4828 
4829 extern __at(0x0FA9) __sfr EEADR;
4830 
4831 typedef struct
4832   {
4833   unsigned EEADR0               : 1;
4834   unsigned EEADR1               : 1;
4835   unsigned EEADR2               : 1;
4836   unsigned EEADR3               : 1;
4837   unsigned EEADR4               : 1;
4838   unsigned EEADR5               : 1;
4839   unsigned EEADR6               : 1;
4840   unsigned EEADR7               : 1;
4841   } __EEADRbits_t;
4842 
4843 extern __at(0x0FA9) volatile __EEADRbits_t EEADRbits;
4844 
4845 #define _EEADR0                 0x01
4846 #define _EEADR1                 0x02
4847 #define _EEADR2                 0x04
4848 #define _EEADR3                 0x08
4849 #define _EEADR4                 0x10
4850 #define _EEADR5                 0x20
4851 #define _EEADR6                 0x40
4852 #define _EEADR7                 0x80
4853 
4854 //==============================================================================
4855 
4856 
4857 //==============================================================================
4858 //        EEADRH Bits
4859 
4860 extern __at(0x0FAA) __sfr EEADRH;
4861 
4862 typedef struct
4863   {
4864   unsigned EEADR8               : 1;
4865   unsigned EEADR9               : 1;
4866   unsigned                      : 1;
4867   unsigned                      : 1;
4868   unsigned                      : 1;
4869   unsigned                      : 1;
4870   unsigned                      : 1;
4871   unsigned                      : 1;
4872   } __EEADRHbits_t;
4873 
4874 extern __at(0x0FAA) volatile __EEADRHbits_t EEADRHbits;
4875 
4876 #define _EEADR8                 0x01
4877 #define _EEADR9                 0x02
4878 
4879 //==============================================================================
4880 
4881 
4882 //==============================================================================
4883 //        RC1STA Bits
4884 
4885 extern __at(0x0FAB) __sfr RC1STA;
4886 
4887 typedef union
4888   {
4889   struct
4890     {
4891     unsigned RX9D               : 1;
4892     unsigned OERR               : 1;
4893     unsigned FERR               : 1;
4894     unsigned ADDEN              : 1;
4895     unsigned CREN               : 1;
4896     unsigned SREN               : 1;
4897     unsigned RX9                : 1;
4898     unsigned SPEN               : 1;
4899     };
4900 
4901   struct
4902     {
4903     unsigned RX9D1              : 1;
4904     unsigned OERR1              : 1;
4905     unsigned FERR1              : 1;
4906     unsigned ADEN               : 1;
4907     unsigned CREN1              : 1;
4908     unsigned SREN1              : 1;
4909     unsigned RX91               : 1;
4910     unsigned SPEN1              : 1;
4911     };
4912 
4913   struct
4914     {
4915     unsigned                    : 1;
4916     unsigned                    : 1;
4917     unsigned                    : 1;
4918     unsigned ADDEN1             : 1;
4919     unsigned                    : 1;
4920     unsigned                    : 1;
4921     unsigned                    : 1;
4922     unsigned                    : 1;
4923     };
4924   } __RC1STAbits_t;
4925 
4926 extern __at(0x0FAB) volatile __RC1STAbits_t RC1STAbits;
4927 
4928 #define _RX9D                   0x01
4929 #define _RX9D1                  0x01
4930 #define _OERR                   0x02
4931 #define _OERR1                  0x02
4932 #define _FERR                   0x04
4933 #define _FERR1                  0x04
4934 #define _ADDEN                  0x08
4935 #define _ADEN                   0x08
4936 #define _ADDEN1                 0x08
4937 #define _CREN                   0x10
4938 #define _CREN1                  0x10
4939 #define _SREN                   0x20
4940 #define _SREN1                  0x20
4941 #define _RX9                    0x40
4942 #define _RX91                   0x40
4943 #define _SPEN                   0x80
4944 #define _SPEN1                  0x80
4945 
4946 //==============================================================================
4947 
4948 
4949 //==============================================================================
4950 //        RCSTA Bits
4951 
4952 extern __at(0x0FAB) __sfr RCSTA;
4953 
4954 typedef union
4955   {
4956   struct
4957     {
4958     unsigned RX9D               : 1;
4959     unsigned OERR               : 1;
4960     unsigned FERR               : 1;
4961     unsigned ADDEN              : 1;
4962     unsigned CREN               : 1;
4963     unsigned SREN               : 1;
4964     unsigned RX9                : 1;
4965     unsigned SPEN               : 1;
4966     };
4967 
4968   struct
4969     {
4970     unsigned RX9D1              : 1;
4971     unsigned OERR1              : 1;
4972     unsigned FERR1              : 1;
4973     unsigned ADEN               : 1;
4974     unsigned CREN1              : 1;
4975     unsigned SREN1              : 1;
4976     unsigned RX91               : 1;
4977     unsigned SPEN1              : 1;
4978     };
4979 
4980   struct
4981     {
4982     unsigned                    : 1;
4983     unsigned                    : 1;
4984     unsigned                    : 1;
4985     unsigned ADDEN1             : 1;
4986     unsigned                    : 1;
4987     unsigned                    : 1;
4988     unsigned                    : 1;
4989     unsigned                    : 1;
4990     };
4991   } __RCSTAbits_t;
4992 
4993 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
4994 
4995 #define _RCSTA_RX9D             0x01
4996 #define _RCSTA_RX9D1            0x01
4997 #define _RCSTA_OERR             0x02
4998 #define _RCSTA_OERR1            0x02
4999 #define _RCSTA_FERR             0x04
5000 #define _RCSTA_FERR1            0x04
5001 #define _RCSTA_ADDEN            0x08
5002 #define _RCSTA_ADEN             0x08
5003 #define _RCSTA_ADDEN1           0x08
5004 #define _RCSTA_CREN             0x10
5005 #define _RCSTA_CREN1            0x10
5006 #define _RCSTA_SREN             0x20
5007 #define _RCSTA_SREN1            0x20
5008 #define _RCSTA_RX9              0x40
5009 #define _RCSTA_RX91             0x40
5010 #define _RCSTA_SPEN             0x80
5011 #define _RCSTA_SPEN1            0x80
5012 
5013 //==============================================================================
5014 
5015 
5016 //==============================================================================
5017 //        RCSTA1 Bits
5018 
5019 extern __at(0x0FAB) __sfr RCSTA1;
5020 
5021 typedef union
5022   {
5023   struct
5024     {
5025     unsigned RX9D               : 1;
5026     unsigned OERR               : 1;
5027     unsigned FERR               : 1;
5028     unsigned ADDEN              : 1;
5029     unsigned CREN               : 1;
5030     unsigned SREN               : 1;
5031     unsigned RX9                : 1;
5032     unsigned SPEN               : 1;
5033     };
5034 
5035   struct
5036     {
5037     unsigned RX9D1              : 1;
5038     unsigned OERR1              : 1;
5039     unsigned FERR1              : 1;
5040     unsigned ADEN               : 1;
5041     unsigned CREN1              : 1;
5042     unsigned SREN1              : 1;
5043     unsigned RX91               : 1;
5044     unsigned SPEN1              : 1;
5045     };
5046 
5047   struct
5048     {
5049     unsigned                    : 1;
5050     unsigned                    : 1;
5051     unsigned                    : 1;
5052     unsigned ADDEN1             : 1;
5053     unsigned                    : 1;
5054     unsigned                    : 1;
5055     unsigned                    : 1;
5056     unsigned                    : 1;
5057     };
5058   } __RCSTA1bits_t;
5059 
5060 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
5061 
5062 #define _RCSTA1_RX9D            0x01
5063 #define _RCSTA1_RX9D1           0x01
5064 #define _RCSTA1_OERR            0x02
5065 #define _RCSTA1_OERR1           0x02
5066 #define _RCSTA1_FERR            0x04
5067 #define _RCSTA1_FERR1           0x04
5068 #define _RCSTA1_ADDEN           0x08
5069 #define _RCSTA1_ADEN            0x08
5070 #define _RCSTA1_ADDEN1          0x08
5071 #define _RCSTA1_CREN            0x10
5072 #define _RCSTA1_CREN1           0x10
5073 #define _RCSTA1_SREN            0x20
5074 #define _RCSTA1_SREN1           0x20
5075 #define _RCSTA1_RX9             0x40
5076 #define _RCSTA1_RX91            0x40
5077 #define _RCSTA1_SPEN            0x80
5078 #define _RCSTA1_SPEN1           0x80
5079 
5080 //==============================================================================
5081 
5082 
5083 //==============================================================================
5084 //        TX1STA Bits
5085 
5086 extern __at(0x0FAC) __sfr TX1STA;
5087 
5088 typedef union
5089   {
5090   struct
5091     {
5092     unsigned TX9D               : 1;
5093     unsigned TRMT               : 1;
5094     unsigned BRGH               : 1;
5095     unsigned SENDB              : 1;
5096     unsigned SYNC               : 1;
5097     unsigned TXEN               : 1;
5098     unsigned TX9                : 1;
5099     unsigned CSRC               : 1;
5100     };
5101 
5102   struct
5103     {
5104     unsigned TX9D1              : 1;
5105     unsigned TRMT1              : 1;
5106     unsigned BRGH1              : 1;
5107     unsigned SENDB1             : 1;
5108     unsigned SYNC1              : 1;
5109     unsigned TXEN1              : 1;
5110     unsigned TX91               : 1;
5111     unsigned CSRC1              : 1;
5112     };
5113   } __TX1STAbits_t;
5114 
5115 extern __at(0x0FAC) volatile __TX1STAbits_t TX1STAbits;
5116 
5117 #define _TX9D                   0x01
5118 #define _TX9D1                  0x01
5119 #define _TRMT                   0x02
5120 #define _TRMT1                  0x02
5121 #define _BRGH                   0x04
5122 #define _BRGH1                  0x04
5123 #define _SENDB                  0x08
5124 #define _SENDB1                 0x08
5125 #define _SYNC                   0x10
5126 #define _SYNC1                  0x10
5127 #define _TXEN                   0x20
5128 #define _TXEN1                  0x20
5129 #define _TX9                    0x40
5130 #define _TX91                   0x40
5131 #define _CSRC                   0x80
5132 #define _CSRC1                  0x80
5133 
5134 //==============================================================================
5135 
5136 
5137 //==============================================================================
5138 //        TXSTA Bits
5139 
5140 extern __at(0x0FAC) __sfr TXSTA;
5141 
5142 typedef union
5143   {
5144   struct
5145     {
5146     unsigned TX9D               : 1;
5147     unsigned TRMT               : 1;
5148     unsigned BRGH               : 1;
5149     unsigned SENDB              : 1;
5150     unsigned SYNC               : 1;
5151     unsigned TXEN               : 1;
5152     unsigned TX9                : 1;
5153     unsigned CSRC               : 1;
5154     };
5155 
5156   struct
5157     {
5158     unsigned TX9D1              : 1;
5159     unsigned TRMT1              : 1;
5160     unsigned BRGH1              : 1;
5161     unsigned SENDB1             : 1;
5162     unsigned SYNC1              : 1;
5163     unsigned TXEN1              : 1;
5164     unsigned TX91               : 1;
5165     unsigned CSRC1              : 1;
5166     };
5167   } __TXSTAbits_t;
5168 
5169 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
5170 
5171 #define _TXSTA_TX9D             0x01
5172 #define _TXSTA_TX9D1            0x01
5173 #define _TXSTA_TRMT             0x02
5174 #define _TXSTA_TRMT1            0x02
5175 #define _TXSTA_BRGH             0x04
5176 #define _TXSTA_BRGH1            0x04
5177 #define _TXSTA_SENDB            0x08
5178 #define _TXSTA_SENDB1           0x08
5179 #define _TXSTA_SYNC             0x10
5180 #define _TXSTA_SYNC1            0x10
5181 #define _TXSTA_TXEN             0x20
5182 #define _TXSTA_TXEN1            0x20
5183 #define _TXSTA_TX9              0x40
5184 #define _TXSTA_TX91             0x40
5185 #define _TXSTA_CSRC             0x80
5186 #define _TXSTA_CSRC1            0x80
5187 
5188 //==============================================================================
5189 
5190 
5191 //==============================================================================
5192 //        TXSTA1 Bits
5193 
5194 extern __at(0x0FAC) __sfr TXSTA1;
5195 
5196 typedef union
5197   {
5198   struct
5199     {
5200     unsigned TX9D               : 1;
5201     unsigned TRMT               : 1;
5202     unsigned BRGH               : 1;
5203     unsigned SENDB              : 1;
5204     unsigned SYNC               : 1;
5205     unsigned TXEN               : 1;
5206     unsigned TX9                : 1;
5207     unsigned CSRC               : 1;
5208     };
5209 
5210   struct
5211     {
5212     unsigned TX9D1              : 1;
5213     unsigned TRMT1              : 1;
5214     unsigned BRGH1              : 1;
5215     unsigned SENDB1             : 1;
5216     unsigned SYNC1              : 1;
5217     unsigned TXEN1              : 1;
5218     unsigned TX91               : 1;
5219     unsigned CSRC1              : 1;
5220     };
5221   } __TXSTA1bits_t;
5222 
5223 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
5224 
5225 #define _TXSTA1_TX9D            0x01
5226 #define _TXSTA1_TX9D1           0x01
5227 #define _TXSTA1_TRMT            0x02
5228 #define _TXSTA1_TRMT1           0x02
5229 #define _TXSTA1_BRGH            0x04
5230 #define _TXSTA1_BRGH1           0x04
5231 #define _TXSTA1_SENDB           0x08
5232 #define _TXSTA1_SENDB1          0x08
5233 #define _TXSTA1_SYNC            0x10
5234 #define _TXSTA1_SYNC1           0x10
5235 #define _TXSTA1_TXEN            0x20
5236 #define _TXSTA1_TXEN1           0x20
5237 #define _TXSTA1_TX9             0x40
5238 #define _TXSTA1_TX91            0x40
5239 #define _TXSTA1_CSRC            0x80
5240 #define _TXSTA1_CSRC1           0x80
5241 
5242 //==============================================================================
5243 
5244 extern __at(0x0FAD) __sfr TX1REG;
5245 extern __at(0x0FAD) __sfr TXREG;
5246 extern __at(0x0FAD) __sfr TXREG1;
5247 extern __at(0x0FAE) __sfr RC1REG;
5248 extern __at(0x0FAE) __sfr RCREG;
5249 extern __at(0x0FAE) __sfr RCREG1;
5250 extern __at(0x0FAF) __sfr SP1BRG;
5251 extern __at(0x0FAF) __sfr SPBRG;
5252 extern __at(0x0FAF) __sfr SPBRG1;
5253 extern __at(0x0FB0) __sfr SP1BRGH;
5254 extern __at(0x0FB0) __sfr SPBRGH;
5255 extern __at(0x0FB0) __sfr SPBRGH1;
5256 
5257 //==============================================================================
5258 //        T3CON Bits
5259 
5260 extern __at(0x0FB1) __sfr T3CON;
5261 
5262 typedef union
5263   {
5264   struct
5265     {
5266     unsigned TMR3ON             : 1;
5267     unsigned T3RD16             : 1;
5268     unsigned NOT_T3SYNC         : 1;
5269     unsigned T3SOSCEN           : 1;
5270     unsigned T3CKPS0            : 1;
5271     unsigned T3CKPS1            : 1;
5272     unsigned TMR3CS0            : 1;
5273     unsigned TMR3CS1            : 1;
5274     };
5275 
5276   struct
5277     {
5278     unsigned                    : 1;
5279     unsigned                    : 1;
5280     unsigned                    : 1;
5281     unsigned T3OSCEN            : 1;
5282     unsigned                    : 1;
5283     unsigned                    : 1;
5284     unsigned                    : 1;
5285     unsigned                    : 1;
5286     };
5287 
5288   struct
5289     {
5290     unsigned                    : 4;
5291     unsigned T3CKPS             : 2;
5292     unsigned                    : 2;
5293     };
5294 
5295   struct
5296     {
5297     unsigned                    : 6;
5298     unsigned TMR3CS             : 2;
5299     };
5300   } __T3CONbits_t;
5301 
5302 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
5303 
5304 #define _TMR3ON                 0x01
5305 #define _T3RD16                 0x02
5306 #define _NOT_T3SYNC             0x04
5307 #define _T3SOSCEN               0x08
5308 #define _T3OSCEN                0x08
5309 #define _T3CKPS0                0x10
5310 #define _T3CKPS1                0x20
5311 #define _TMR3CS0                0x40
5312 #define _TMR3CS1                0x80
5313 
5314 //==============================================================================
5315 
5316 extern __at(0x0FB2) __sfr TMR3;
5317 extern __at(0x0FB2) __sfr TMR3L;
5318 extern __at(0x0FB3) __sfr TMR3H;
5319 
5320 //==============================================================================
5321 //        T3GCON Bits
5322 
5323 extern __at(0x0FB4) __sfr T3GCON;
5324 
5325 typedef union
5326   {
5327   struct
5328     {
5329     unsigned T3GSS0             : 1;
5330     unsigned T3GSS1             : 1;
5331     unsigned T3GVAL             : 1;
5332     unsigned T3GGO_NOT_DONE     : 1;
5333     unsigned T3GSPM             : 1;
5334     unsigned T3GTM              : 1;
5335     unsigned T3GPOL             : 1;
5336     unsigned TMR3GE             : 1;
5337     };
5338 
5339   struct
5340     {
5341     unsigned                    : 1;
5342     unsigned                    : 1;
5343     unsigned                    : 1;
5344     unsigned T3G_DONE           : 1;
5345     unsigned                    : 1;
5346     unsigned                    : 1;
5347     unsigned                    : 1;
5348     unsigned                    : 1;
5349     };
5350 
5351   struct
5352     {
5353     unsigned                    : 1;
5354     unsigned                    : 1;
5355     unsigned                    : 1;
5356     unsigned T3GGO              : 1;
5357     unsigned                    : 1;
5358     unsigned                    : 1;
5359     unsigned                    : 1;
5360     unsigned                    : 1;
5361     };
5362 
5363   struct
5364     {
5365     unsigned T3GSS              : 2;
5366     unsigned                    : 6;
5367     };
5368   } __T3GCONbits_t;
5369 
5370 extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits;
5371 
5372 #define _T3GSS0                 0x01
5373 #define _T3GSS1                 0x02
5374 #define _T3GVAL                 0x04
5375 #define _T3GGO_NOT_DONE         0x08
5376 #define _T3G_DONE               0x08
5377 #define _T3GGO                  0x08
5378 #define _T3GSPM                 0x10
5379 #define _T3GTM                  0x20
5380 #define _T3GPOL                 0x40
5381 #define _TMR3GE                 0x80
5382 
5383 //==============================================================================
5384 
5385 
5386 //==============================================================================
5387 //        ECCP1AS Bits
5388 
5389 extern __at(0x0FB6) __sfr ECCP1AS;
5390 
5391 typedef union
5392   {
5393   struct
5394     {
5395     unsigned P1SSBD0            : 1;
5396     unsigned P1SSBD1            : 1;
5397     unsigned P1SSAC0            : 1;
5398     unsigned P1SSAC1            : 1;
5399     unsigned CCP1AS0            : 1;
5400     unsigned CCP1AS1            : 1;
5401     unsigned CCP1AS2            : 1;
5402     unsigned CCP1ASE            : 1;
5403     };
5404 
5405   struct
5406     {
5407     unsigned PSS1BD0            : 1;
5408     unsigned PSS1BD1            : 1;
5409     unsigned PSS1AC0            : 1;
5410     unsigned PSS1AC1            : 1;
5411     unsigned ECCPAS0            : 1;
5412     unsigned ECCPAS1            : 1;
5413     unsigned ECCPAS2            : 1;
5414     unsigned ECCPASE            : 1;
5415     };
5416 
5417   struct
5418     {
5419     unsigned PSSBD0             : 1;
5420     unsigned PSSBD1             : 1;
5421     unsigned PSSAC0             : 1;
5422     unsigned PSSAC1             : 1;
5423     unsigned                    : 1;
5424     unsigned                    : 1;
5425     unsigned                    : 1;
5426     unsigned                    : 1;
5427     };
5428 
5429   struct
5430     {
5431     unsigned PSS1BD             : 2;
5432     unsigned                    : 6;
5433     };
5434 
5435   struct
5436     {
5437     unsigned P1SSBD             : 2;
5438     unsigned                    : 6;
5439     };
5440 
5441   struct
5442     {
5443     unsigned PSSBD              : 2;
5444     unsigned                    : 6;
5445     };
5446 
5447   struct
5448     {
5449     unsigned                    : 2;
5450     unsigned PSSAC              : 2;
5451     unsigned                    : 4;
5452     };
5453 
5454   struct
5455     {
5456     unsigned                    : 2;
5457     unsigned PSS1AC             : 2;
5458     unsigned                    : 4;
5459     };
5460 
5461   struct
5462     {
5463     unsigned                    : 2;
5464     unsigned P1SSAC             : 2;
5465     unsigned                    : 4;
5466     };
5467 
5468   struct
5469     {
5470     unsigned                    : 4;
5471     unsigned ECCPAS             : 3;
5472     unsigned                    : 1;
5473     };
5474 
5475   struct
5476     {
5477     unsigned                    : 4;
5478     unsigned CCP1AS             : 3;
5479     unsigned                    : 1;
5480     };
5481   } __ECCP1ASbits_t;
5482 
5483 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
5484 
5485 #define _P1SSBD0                0x01
5486 #define _PSS1BD0                0x01
5487 #define _PSSBD0                 0x01
5488 #define _P1SSBD1                0x02
5489 #define _PSS1BD1                0x02
5490 #define _PSSBD1                 0x02
5491 #define _P1SSAC0                0x04
5492 #define _PSS1AC0                0x04
5493 #define _PSSAC0                 0x04
5494 #define _P1SSAC1                0x08
5495 #define _PSS1AC1                0x08
5496 #define _PSSAC1                 0x08
5497 #define _CCP1AS0                0x10
5498 #define _ECCPAS0                0x10
5499 #define _CCP1AS1                0x20
5500 #define _ECCPAS1                0x20
5501 #define _CCP1AS2                0x40
5502 #define _ECCPAS2                0x40
5503 #define _CCP1ASE                0x80
5504 #define _ECCPASE                0x80
5505 
5506 //==============================================================================
5507 
5508 
5509 //==============================================================================
5510 //        ECCPAS Bits
5511 
5512 extern __at(0x0FB6) __sfr ECCPAS;
5513 
5514 typedef union
5515   {
5516   struct
5517     {
5518     unsigned P1SSBD0            : 1;
5519     unsigned P1SSBD1            : 1;
5520     unsigned P1SSAC0            : 1;
5521     unsigned P1SSAC1            : 1;
5522     unsigned CCP1AS0            : 1;
5523     unsigned CCP1AS1            : 1;
5524     unsigned CCP1AS2            : 1;
5525     unsigned CCP1ASE            : 1;
5526     };
5527 
5528   struct
5529     {
5530     unsigned PSS1BD0            : 1;
5531     unsigned PSS1BD1            : 1;
5532     unsigned PSS1AC0            : 1;
5533     unsigned PSS1AC1            : 1;
5534     unsigned ECCPAS0            : 1;
5535     unsigned ECCPAS1            : 1;
5536     unsigned ECCPAS2            : 1;
5537     unsigned ECCPASE            : 1;
5538     };
5539 
5540   struct
5541     {
5542     unsigned PSSBD0             : 1;
5543     unsigned PSSBD1             : 1;
5544     unsigned PSSAC0             : 1;
5545     unsigned PSSAC1             : 1;
5546     unsigned                    : 1;
5547     unsigned                    : 1;
5548     unsigned                    : 1;
5549     unsigned                    : 1;
5550     };
5551 
5552   struct
5553     {
5554     unsigned PSSBD              : 2;
5555     unsigned                    : 6;
5556     };
5557 
5558   struct
5559     {
5560     unsigned PSS1BD             : 2;
5561     unsigned                    : 6;
5562     };
5563 
5564   struct
5565     {
5566     unsigned P1SSBD             : 2;
5567     unsigned                    : 6;
5568     };
5569 
5570   struct
5571     {
5572     unsigned                    : 2;
5573     unsigned PSS1AC             : 2;
5574     unsigned                    : 4;
5575     };
5576 
5577   struct
5578     {
5579     unsigned                    : 2;
5580     unsigned P1SSAC             : 2;
5581     unsigned                    : 4;
5582     };
5583 
5584   struct
5585     {
5586     unsigned                    : 2;
5587     unsigned PSSAC              : 2;
5588     unsigned                    : 4;
5589     };
5590 
5591   struct
5592     {
5593     unsigned                    : 4;
5594     unsigned CCP1AS             : 3;
5595     unsigned                    : 1;
5596     };
5597 
5598   struct
5599     {
5600     unsigned                    : 4;
5601     unsigned ECCPAS             : 3;
5602     unsigned                    : 1;
5603     };
5604   } __ECCPASbits_t;
5605 
5606 extern __at(0x0FB6) volatile __ECCPASbits_t ECCPASbits;
5607 
5608 #define _ECCPAS_P1SSBD0         0x01
5609 #define _ECCPAS_PSS1BD0         0x01
5610 #define _ECCPAS_PSSBD0          0x01
5611 #define _ECCPAS_P1SSBD1         0x02
5612 #define _ECCPAS_PSS1BD1         0x02
5613 #define _ECCPAS_PSSBD1          0x02
5614 #define _ECCPAS_P1SSAC0         0x04
5615 #define _ECCPAS_PSS1AC0         0x04
5616 #define _ECCPAS_PSSAC0          0x04
5617 #define _ECCPAS_P1SSAC1         0x08
5618 #define _ECCPAS_PSS1AC1         0x08
5619 #define _ECCPAS_PSSAC1          0x08
5620 #define _ECCPAS_CCP1AS0         0x10
5621 #define _ECCPAS_ECCPAS0         0x10
5622 #define _ECCPAS_CCP1AS1         0x20
5623 #define _ECCPAS_ECCPAS1         0x20
5624 #define _ECCPAS_CCP1AS2         0x40
5625 #define _ECCPAS_ECCPAS2         0x40
5626 #define _ECCPAS_CCP1ASE         0x80
5627 #define _ECCPAS_ECCPASE         0x80
5628 
5629 //==============================================================================
5630 
5631 
5632 //==============================================================================
5633 //        PWM1CON Bits
5634 
5635 extern __at(0x0FB7) __sfr PWM1CON;
5636 
5637 typedef union
5638   {
5639   struct
5640     {
5641     unsigned P1DC0              : 1;
5642     unsigned P1DC1              : 1;
5643     unsigned P1DC2              : 1;
5644     unsigned P1DC3              : 1;
5645     unsigned P1DC4              : 1;
5646     unsigned P1DC5              : 1;
5647     unsigned P1DC6              : 1;
5648     unsigned P1RSEN             : 1;
5649     };
5650 
5651   struct
5652     {
5653     unsigned PDC0               : 1;
5654     unsigned PDC1               : 1;
5655     unsigned PDC2               : 1;
5656     unsigned PDC3               : 1;
5657     unsigned PDC4               : 1;
5658     unsigned PDC5               : 1;
5659     unsigned PDC6               : 1;
5660     unsigned PRSEN              : 1;
5661     };
5662 
5663   struct
5664     {
5665     unsigned P1DC               : 7;
5666     unsigned                    : 1;
5667     };
5668 
5669   struct
5670     {
5671     unsigned PDC                : 7;
5672     unsigned                    : 1;
5673     };
5674   } __PWM1CONbits_t;
5675 
5676 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
5677 
5678 #define _P1DC0                  0x01
5679 #define _PDC0                   0x01
5680 #define _P1DC1                  0x02
5681 #define _PDC1                   0x02
5682 #define _P1DC2                  0x04
5683 #define _PDC2                   0x04
5684 #define _P1DC3                  0x08
5685 #define _PDC3                   0x08
5686 #define _P1DC4                  0x10
5687 #define _PDC4                   0x10
5688 #define _P1DC5                  0x20
5689 #define _PDC5                   0x20
5690 #define _P1DC6                  0x40
5691 #define _PDC6                   0x40
5692 #define _P1RSEN                 0x80
5693 #define _PRSEN                  0x80
5694 
5695 //==============================================================================
5696 
5697 
5698 //==============================================================================
5699 //        PWMCON Bits
5700 
5701 extern __at(0x0FB7) __sfr PWMCON;
5702 
5703 typedef union
5704   {
5705   struct
5706     {
5707     unsigned P1DC0              : 1;
5708     unsigned P1DC1              : 1;
5709     unsigned P1DC2              : 1;
5710     unsigned P1DC3              : 1;
5711     unsigned P1DC4              : 1;
5712     unsigned P1DC5              : 1;
5713     unsigned P1DC6              : 1;
5714     unsigned P1RSEN             : 1;
5715     };
5716 
5717   struct
5718     {
5719     unsigned PDC0               : 1;
5720     unsigned PDC1               : 1;
5721     unsigned PDC2               : 1;
5722     unsigned PDC3               : 1;
5723     unsigned PDC4               : 1;
5724     unsigned PDC5               : 1;
5725     unsigned PDC6               : 1;
5726     unsigned PRSEN              : 1;
5727     };
5728 
5729   struct
5730     {
5731     unsigned PDC                : 7;
5732     unsigned                    : 1;
5733     };
5734 
5735   struct
5736     {
5737     unsigned P1DC               : 7;
5738     unsigned                    : 1;
5739     };
5740   } __PWMCONbits_t;
5741 
5742 extern __at(0x0FB7) volatile __PWMCONbits_t PWMCONbits;
5743 
5744 #define _PWMCON_P1DC0           0x01
5745 #define _PWMCON_PDC0            0x01
5746 #define _PWMCON_P1DC1           0x02
5747 #define _PWMCON_PDC1            0x02
5748 #define _PWMCON_P1DC2           0x04
5749 #define _PWMCON_PDC2            0x04
5750 #define _PWMCON_P1DC3           0x08
5751 #define _PWMCON_PDC3            0x08
5752 #define _PWMCON_P1DC4           0x10
5753 #define _PWMCON_PDC4            0x10
5754 #define _PWMCON_P1DC5           0x20
5755 #define _PWMCON_PDC5            0x20
5756 #define _PWMCON_P1DC6           0x40
5757 #define _PWMCON_PDC6            0x40
5758 #define _PWMCON_P1RSEN          0x80
5759 #define _PWMCON_PRSEN           0x80
5760 
5761 //==============================================================================
5762 
5763 
5764 //==============================================================================
5765 //        BAUD1CON Bits
5766 
5767 extern __at(0x0FB8) __sfr BAUD1CON;
5768 
5769 typedef union
5770   {
5771   struct
5772     {
5773     unsigned ABDEN              : 1;
5774     unsigned WUE                : 1;
5775     unsigned                    : 1;
5776     unsigned BRG16              : 1;
5777     unsigned CKTXP              : 1;
5778     unsigned DTRXP              : 1;
5779     unsigned RCIDL              : 1;
5780     unsigned ABDOVF             : 1;
5781     };
5782 
5783   struct
5784     {
5785     unsigned                    : 1;
5786     unsigned                    : 1;
5787     unsigned                    : 1;
5788     unsigned                    : 1;
5789     unsigned SCKP               : 1;
5790     unsigned                    : 1;
5791     unsigned                    : 1;
5792     unsigned                    : 1;
5793     };
5794   } __BAUD1CONbits_t;
5795 
5796 extern __at(0x0FB8) volatile __BAUD1CONbits_t BAUD1CONbits;
5797 
5798 #define _ABDEN                  0x01
5799 #define _WUE                    0x02
5800 #define _BRG16                  0x08
5801 #define _CKTXP                  0x10
5802 #define _SCKP                   0x10
5803 #define _DTRXP                  0x20
5804 #define _RCIDL                  0x40
5805 #define _ABDOVF                 0x80
5806 
5807 //==============================================================================
5808 
5809 
5810 //==============================================================================
5811 //        BAUDCON Bits
5812 
5813 extern __at(0x0FB8) __sfr BAUDCON;
5814 
5815 typedef union
5816   {
5817   struct
5818     {
5819     unsigned ABDEN              : 1;
5820     unsigned WUE                : 1;
5821     unsigned                    : 1;
5822     unsigned BRG16              : 1;
5823     unsigned CKTXP              : 1;
5824     unsigned DTRXP              : 1;
5825     unsigned RCIDL              : 1;
5826     unsigned ABDOVF             : 1;
5827     };
5828 
5829   struct
5830     {
5831     unsigned                    : 1;
5832     unsigned                    : 1;
5833     unsigned                    : 1;
5834     unsigned                    : 1;
5835     unsigned SCKP               : 1;
5836     unsigned                    : 1;
5837     unsigned                    : 1;
5838     unsigned                    : 1;
5839     };
5840   } __BAUDCONbits_t;
5841 
5842 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
5843 
5844 #define _BAUDCON_ABDEN          0x01
5845 #define _BAUDCON_WUE            0x02
5846 #define _BAUDCON_BRG16          0x08
5847 #define _BAUDCON_CKTXP          0x10
5848 #define _BAUDCON_SCKP           0x10
5849 #define _BAUDCON_DTRXP          0x20
5850 #define _BAUDCON_RCIDL          0x40
5851 #define _BAUDCON_ABDOVF         0x80
5852 
5853 //==============================================================================
5854 
5855 
5856 //==============================================================================
5857 //        BAUDCON1 Bits
5858 
5859 extern __at(0x0FB8) __sfr BAUDCON1;
5860 
5861 typedef union
5862   {
5863   struct
5864     {
5865     unsigned ABDEN              : 1;
5866     unsigned WUE                : 1;
5867     unsigned                    : 1;
5868     unsigned BRG16              : 1;
5869     unsigned CKTXP              : 1;
5870     unsigned DTRXP              : 1;
5871     unsigned RCIDL              : 1;
5872     unsigned ABDOVF             : 1;
5873     };
5874 
5875   struct
5876     {
5877     unsigned                    : 1;
5878     unsigned                    : 1;
5879     unsigned                    : 1;
5880     unsigned                    : 1;
5881     unsigned SCKP               : 1;
5882     unsigned                    : 1;
5883     unsigned                    : 1;
5884     unsigned                    : 1;
5885     };
5886   } __BAUDCON1bits_t;
5887 
5888 extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits;
5889 
5890 #define _BAUDCON1_ABDEN         0x01
5891 #define _BAUDCON1_WUE           0x02
5892 #define _BAUDCON1_BRG16         0x08
5893 #define _BAUDCON1_CKTXP         0x10
5894 #define _BAUDCON1_SCKP          0x10
5895 #define _BAUDCON1_DTRXP         0x20
5896 #define _BAUDCON1_RCIDL         0x40
5897 #define _BAUDCON1_ABDOVF        0x80
5898 
5899 //==============================================================================
5900 
5901 
5902 //==============================================================================
5903 //        BAUDCTL Bits
5904 
5905 extern __at(0x0FB8) __sfr BAUDCTL;
5906 
5907 typedef union
5908   {
5909   struct
5910     {
5911     unsigned ABDEN              : 1;
5912     unsigned WUE                : 1;
5913     unsigned                    : 1;
5914     unsigned BRG16              : 1;
5915     unsigned CKTXP              : 1;
5916     unsigned DTRXP              : 1;
5917     unsigned RCIDL              : 1;
5918     unsigned ABDOVF             : 1;
5919     };
5920 
5921   struct
5922     {
5923     unsigned                    : 1;
5924     unsigned                    : 1;
5925     unsigned                    : 1;
5926     unsigned                    : 1;
5927     unsigned SCKP               : 1;
5928     unsigned                    : 1;
5929     unsigned                    : 1;
5930     unsigned                    : 1;
5931     };
5932   } __BAUDCTLbits_t;
5933 
5934 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
5935 
5936 #define _BAUDCTL_ABDEN          0x01
5937 #define _BAUDCTL_WUE            0x02
5938 #define _BAUDCTL_BRG16          0x08
5939 #define _BAUDCTL_CKTXP          0x10
5940 #define _BAUDCTL_SCKP           0x10
5941 #define _BAUDCTL_DTRXP          0x20
5942 #define _BAUDCTL_RCIDL          0x40
5943 #define _BAUDCTL_ABDOVF         0x80
5944 
5945 //==============================================================================
5946 
5947 
5948 //==============================================================================
5949 //        PSTR1CON Bits
5950 
5951 extern __at(0x0FB9) __sfr PSTR1CON;
5952 
5953 typedef struct
5954   {
5955   unsigned STR1A                : 1;
5956   unsigned STR1B                : 1;
5957   unsigned STR1C                : 1;
5958   unsigned STR1D                : 1;
5959   unsigned STR1SYNC             : 1;
5960   unsigned                      : 1;
5961   unsigned                      : 1;
5962   unsigned                      : 1;
5963   } __PSTR1CONbits_t;
5964 
5965 extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits;
5966 
5967 #define _STR1A                  0x01
5968 #define _STR1B                  0x02
5969 #define _STR1C                  0x04
5970 #define _STR1D                  0x08
5971 #define _STR1SYNC               0x10
5972 
5973 //==============================================================================
5974 
5975 
5976 //==============================================================================
5977 //        PSTRCON Bits
5978 
5979 extern __at(0x0FB9) __sfr PSTRCON;
5980 
5981 typedef struct
5982   {
5983   unsigned STR1A                : 1;
5984   unsigned STR1B                : 1;
5985   unsigned STR1C                : 1;
5986   unsigned STR1D                : 1;
5987   unsigned STR1SYNC             : 1;
5988   unsigned                      : 1;
5989   unsigned                      : 1;
5990   unsigned                      : 1;
5991   } __PSTRCONbits_t;
5992 
5993 extern __at(0x0FB9) volatile __PSTRCONbits_t PSTRCONbits;
5994 
5995 #define _PSTRCON_STR1A          0x01
5996 #define _PSTRCON_STR1B          0x02
5997 #define _PSTRCON_STR1C          0x04
5998 #define _PSTRCON_STR1D          0x08
5999 #define _PSTRCON_STR1SYNC       0x10
6000 
6001 //==============================================================================
6002 
6003 
6004 //==============================================================================
6005 //        T2CON Bits
6006 
6007 extern __at(0x0FBA) __sfr T2CON;
6008 
6009 typedef union
6010   {
6011   struct
6012     {
6013     unsigned T2CKPS0            : 1;
6014     unsigned T2CKPS1            : 1;
6015     unsigned TMR2ON             : 1;
6016     unsigned T2OUTPS0           : 1;
6017     unsigned T2OUTPS1           : 1;
6018     unsigned T2OUTPS2           : 1;
6019     unsigned T2OUTPS3           : 1;
6020     unsigned                    : 1;
6021     };
6022 
6023   struct
6024     {
6025     unsigned T2CKPS             : 2;
6026     unsigned                    : 6;
6027     };
6028 
6029   struct
6030     {
6031     unsigned                    : 3;
6032     unsigned T2OUTPS            : 4;
6033     unsigned                    : 1;
6034     };
6035   } __T2CONbits_t;
6036 
6037 extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits;
6038 
6039 #define _T2CKPS0                0x01
6040 #define _T2CKPS1                0x02
6041 #define _TMR2ON                 0x04
6042 #define _T2OUTPS0               0x08
6043 #define _T2OUTPS1               0x10
6044 #define _T2OUTPS2               0x20
6045 #define _T2OUTPS3               0x40
6046 
6047 //==============================================================================
6048 
6049 extern __at(0x0FBB) __sfr PR2;
6050 extern __at(0x0FBC) __sfr TMR2;
6051 
6052 //==============================================================================
6053 //        CCP1CON Bits
6054 
6055 extern __at(0x0FBD) __sfr CCP1CON;
6056 
6057 typedef union
6058   {
6059   struct
6060     {
6061     unsigned CCP1M0             : 1;
6062     unsigned CCP1M1             : 1;
6063     unsigned CCP1M2             : 1;
6064     unsigned CCP1M3             : 1;
6065     unsigned DC1B0              : 1;
6066     unsigned DC1B1              : 1;
6067     unsigned P1M0               : 1;
6068     unsigned P1M1               : 1;
6069     };
6070 
6071   struct
6072     {
6073     unsigned CCP1M              : 4;
6074     unsigned                    : 4;
6075     };
6076 
6077   struct
6078     {
6079     unsigned                    : 4;
6080     unsigned DC1B               : 2;
6081     unsigned                    : 2;
6082     };
6083 
6084   struct
6085     {
6086     unsigned                    : 6;
6087     unsigned P1M                : 2;
6088     };
6089   } __CCP1CONbits_t;
6090 
6091 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
6092 
6093 #define _CCP1M0                 0x01
6094 #define _CCP1M1                 0x02
6095 #define _CCP1M2                 0x04
6096 #define _CCP1M3                 0x08
6097 #define _DC1B0                  0x10
6098 #define _DC1B1                  0x20
6099 #define _P1M0                   0x40
6100 #define _P1M1                   0x80
6101 
6102 //==============================================================================
6103 
6104 extern __at(0x0FBE) __sfr CCPR1;
6105 extern __at(0x0FBE) __sfr CCPR1L;
6106 extern __at(0x0FBF) __sfr CCPR1H;
6107 
6108 //==============================================================================
6109 //        ADCON2 Bits
6110 
6111 extern __at(0x0FC0) __sfr ADCON2;
6112 
6113 typedef union
6114   {
6115   struct
6116     {
6117     unsigned ADCS0              : 1;
6118     unsigned ADCS1              : 1;
6119     unsigned ADCS2              : 1;
6120     unsigned ACQT0              : 1;
6121     unsigned ACQT1              : 1;
6122     unsigned ACQT2              : 1;
6123     unsigned                    : 1;
6124     unsigned ADFM               : 1;
6125     };
6126 
6127   struct
6128     {
6129     unsigned ADCS               : 3;
6130     unsigned                    : 5;
6131     };
6132 
6133   struct
6134     {
6135     unsigned                    : 3;
6136     unsigned ACQT               : 3;
6137     unsigned                    : 2;
6138     };
6139   } __ADCON2bits_t;
6140 
6141 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
6142 
6143 #define _ADCS0                  0x01
6144 #define _ADCS1                  0x02
6145 #define _ADCS2                  0x04
6146 #define _ACQT0                  0x08
6147 #define _ACQT1                  0x10
6148 #define _ACQT2                  0x20
6149 #define _ADFM                   0x80
6150 
6151 //==============================================================================
6152 
6153 
6154 //==============================================================================
6155 //        ADCON1 Bits
6156 
6157 extern __at(0x0FC1) __sfr ADCON1;
6158 
6159 typedef union
6160   {
6161   struct
6162     {
6163     unsigned NVCFG0             : 1;
6164     unsigned NVCFG1             : 1;
6165     unsigned PVCFG0             : 1;
6166     unsigned PVCFG1             : 1;
6167     unsigned                    : 1;
6168     unsigned                    : 1;
6169     unsigned                    : 1;
6170     unsigned TRIGSEL            : 1;
6171     };
6172 
6173   struct
6174     {
6175     unsigned NVCFG              : 2;
6176     unsigned                    : 6;
6177     };
6178 
6179   struct
6180     {
6181     unsigned                    : 2;
6182     unsigned PVCFG              : 2;
6183     unsigned                    : 4;
6184     };
6185   } __ADCON1bits_t;
6186 
6187 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
6188 
6189 #define _NVCFG0                 0x01
6190 #define _NVCFG1                 0x02
6191 #define _PVCFG0                 0x04
6192 #define _PVCFG1                 0x08
6193 #define _TRIGSEL                0x80
6194 
6195 //==============================================================================
6196 
6197 
6198 //==============================================================================
6199 //        ADCON0 Bits
6200 
6201 extern __at(0x0FC2) __sfr ADCON0;
6202 
6203 typedef union
6204   {
6205   struct
6206     {
6207     unsigned ADON               : 1;
6208     unsigned GO_NOT_DONE        : 1;
6209     unsigned CHS0               : 1;
6210     unsigned CHS1               : 1;
6211     unsigned CHS2               : 1;
6212     unsigned CHS3               : 1;
6213     unsigned CHS4               : 1;
6214     unsigned                    : 1;
6215     };
6216 
6217   struct
6218     {
6219     unsigned                    : 1;
6220     unsigned GO                 : 1;
6221     unsigned                    : 1;
6222     unsigned                    : 1;
6223     unsigned                    : 1;
6224     unsigned                    : 1;
6225     unsigned                    : 1;
6226     unsigned                    : 1;
6227     };
6228 
6229   struct
6230     {
6231     unsigned                    : 1;
6232     unsigned DONE               : 1;
6233     unsigned                    : 1;
6234     unsigned                    : 1;
6235     unsigned                    : 1;
6236     unsigned                    : 1;
6237     unsigned                    : 1;
6238     unsigned                    : 1;
6239     };
6240 
6241   struct
6242     {
6243     unsigned                    : 1;
6244     unsigned NOT_DONE           : 1;
6245     unsigned                    : 1;
6246     unsigned                    : 1;
6247     unsigned                    : 1;
6248     unsigned                    : 1;
6249     unsigned                    : 1;
6250     unsigned                    : 1;
6251     };
6252 
6253   struct
6254     {
6255     unsigned                    : 1;
6256     unsigned GO_DONE            : 1;
6257     unsigned                    : 1;
6258     unsigned                    : 1;
6259     unsigned                    : 1;
6260     unsigned                    : 1;
6261     unsigned                    : 1;
6262     unsigned                    : 1;
6263     };
6264 
6265   struct
6266     {
6267     unsigned                    : 2;
6268     unsigned CHS                : 5;
6269     unsigned                    : 1;
6270     };
6271   } __ADCON0bits_t;
6272 
6273 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
6274 
6275 #define _ADON                   0x01
6276 #define _GO_NOT_DONE            0x02
6277 #define _GO                     0x02
6278 #define _DONE                   0x02
6279 #define _NOT_DONE               0x02
6280 #define _GO_DONE                0x02
6281 #define _CHS0                   0x04
6282 #define _CHS1                   0x08
6283 #define _CHS2                   0x10
6284 #define _CHS3                   0x20
6285 #define _CHS4                   0x40
6286 
6287 //==============================================================================
6288 
6289 extern __at(0x0FC3) __sfr ADRES;
6290 extern __at(0x0FC3) __sfr ADRESL;
6291 extern __at(0x0FC4) __sfr ADRESH;
6292 
6293 //==============================================================================
6294 //        SSP1CON2 Bits
6295 
6296 extern __at(0x0FC5) __sfr SSP1CON2;
6297 
6298 typedef struct
6299   {
6300   unsigned SEN                  : 1;
6301   unsigned RSEN                 : 1;
6302   unsigned PEN                  : 1;
6303   unsigned RCEN                 : 1;
6304   unsigned ACKEN                : 1;
6305   unsigned ACKDT                : 1;
6306   unsigned ACKSTAT              : 1;
6307   unsigned GCEN                 : 1;
6308   } __SSP1CON2bits_t;
6309 
6310 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
6311 
6312 #define _SEN                    0x01
6313 #define _RSEN                   0x02
6314 #define _PEN                    0x04
6315 #define _RCEN                   0x08
6316 #define _ACKEN                  0x10
6317 #define _ACKDT                  0x20
6318 #define _ACKSTAT                0x40
6319 #define _GCEN                   0x80
6320 
6321 //==============================================================================
6322 
6323 
6324 //==============================================================================
6325 //        SSPCON2 Bits
6326 
6327 extern __at(0x0FC5) __sfr SSPCON2;
6328 
6329 typedef struct
6330   {
6331   unsigned SEN                  : 1;
6332   unsigned RSEN                 : 1;
6333   unsigned PEN                  : 1;
6334   unsigned RCEN                 : 1;
6335   unsigned ACKEN                : 1;
6336   unsigned ACKDT                : 1;
6337   unsigned ACKSTAT              : 1;
6338   unsigned GCEN                 : 1;
6339   } __SSPCON2bits_t;
6340 
6341 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
6342 
6343 #define _SSPCON2_SEN            0x01
6344 #define _SSPCON2_RSEN           0x02
6345 #define _SSPCON2_PEN            0x04
6346 #define _SSPCON2_RCEN           0x08
6347 #define _SSPCON2_ACKEN          0x10
6348 #define _SSPCON2_ACKDT          0x20
6349 #define _SSPCON2_ACKSTAT        0x40
6350 #define _SSPCON2_GCEN           0x80
6351 
6352 //==============================================================================
6353 
6354 
6355 //==============================================================================
6356 //        SSP1CON1 Bits
6357 
6358 extern __at(0x0FC6) __sfr SSP1CON1;
6359 
6360 typedef union
6361   {
6362   struct
6363     {
6364     unsigned SSPM0              : 1;
6365     unsigned SSPM1              : 1;
6366     unsigned SSPM2              : 1;
6367     unsigned SSPM3              : 1;
6368     unsigned CKP                : 1;
6369     unsigned SSPEN              : 1;
6370     unsigned SSPOV              : 1;
6371     unsigned WCOL               : 1;
6372     };
6373 
6374   struct
6375     {
6376     unsigned SSPM               : 4;
6377     unsigned                    : 4;
6378     };
6379   } __SSP1CON1bits_t;
6380 
6381 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
6382 
6383 #define _SSPM0                  0x01
6384 #define _SSPM1                  0x02
6385 #define _SSPM2                  0x04
6386 #define _SSPM3                  0x08
6387 #define _CKP                    0x10
6388 #define _SSPEN                  0x20
6389 #define _SSPOV                  0x40
6390 #define _WCOL                   0x80
6391 
6392 //==============================================================================
6393 
6394 
6395 //==============================================================================
6396 //        SSPCON1 Bits
6397 
6398 extern __at(0x0FC6) __sfr SSPCON1;
6399 
6400 typedef union
6401   {
6402   struct
6403     {
6404     unsigned SSPM0              : 1;
6405     unsigned SSPM1              : 1;
6406     unsigned SSPM2              : 1;
6407     unsigned SSPM3              : 1;
6408     unsigned CKP                : 1;
6409     unsigned SSPEN              : 1;
6410     unsigned SSPOV              : 1;
6411     unsigned WCOL               : 1;
6412     };
6413 
6414   struct
6415     {
6416     unsigned SSPM               : 4;
6417     unsigned                    : 4;
6418     };
6419   } __SSPCON1bits_t;
6420 
6421 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
6422 
6423 #define _SSPCON1_SSPM0          0x01
6424 #define _SSPCON1_SSPM1          0x02
6425 #define _SSPCON1_SSPM2          0x04
6426 #define _SSPCON1_SSPM3          0x08
6427 #define _SSPCON1_CKP            0x10
6428 #define _SSPCON1_SSPEN          0x20
6429 #define _SSPCON1_SSPOV          0x40
6430 #define _SSPCON1_WCOL           0x80
6431 
6432 //==============================================================================
6433 
6434 
6435 //==============================================================================
6436 //        SSP1STAT Bits
6437 
6438 extern __at(0x0FC7) __sfr SSP1STAT;
6439 
6440 typedef union
6441   {
6442   struct
6443     {
6444     unsigned BF                 : 1;
6445     unsigned UA                 : 1;
6446     unsigned R_NOT_W            : 1;
6447     unsigned S                  : 1;
6448     unsigned P                  : 1;
6449     unsigned D_NOT_A            : 1;
6450     unsigned CKE                : 1;
6451     unsigned SMP                : 1;
6452     };
6453 
6454   struct
6455     {
6456     unsigned                    : 1;
6457     unsigned                    : 1;
6458     unsigned R                  : 1;
6459     unsigned                    : 1;
6460     unsigned                    : 1;
6461     unsigned D                  : 1;
6462     unsigned                    : 1;
6463     unsigned                    : 1;
6464     };
6465 
6466   struct
6467     {
6468     unsigned                    : 1;
6469     unsigned                    : 1;
6470     unsigned NOT_W              : 1;
6471     unsigned                    : 1;
6472     unsigned                    : 1;
6473     unsigned NOT_A              : 1;
6474     unsigned                    : 1;
6475     unsigned                    : 1;
6476     };
6477 
6478   struct
6479     {
6480     unsigned                    : 1;
6481     unsigned                    : 1;
6482     unsigned R_W                : 1;
6483     unsigned                    : 1;
6484     unsigned                    : 1;
6485     unsigned D_A                : 1;
6486     unsigned                    : 1;
6487     unsigned                    : 1;
6488     };
6489 
6490   struct
6491     {
6492     unsigned                    : 1;
6493     unsigned                    : 1;
6494     unsigned NOT_WRITE          : 1;
6495     unsigned                    : 1;
6496     unsigned                    : 1;
6497     unsigned NOT_ADDRESS        : 1;
6498     unsigned                    : 1;
6499     unsigned                    : 1;
6500     };
6501   } __SSP1STATbits_t;
6502 
6503 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
6504 
6505 #define _BF                     0x01
6506 #define _UA                     0x02
6507 #define _R_NOT_W                0x04
6508 #define _R                      0x04
6509 #define _NOT_W                  0x04
6510 #define _R_W                    0x04
6511 #define _NOT_WRITE              0x04
6512 #define _S                      0x08
6513 #define _P                      0x10
6514 #define _D_NOT_A                0x20
6515 #define _D                      0x20
6516 #define _NOT_A                  0x20
6517 #define _D_A                    0x20
6518 #define _NOT_ADDRESS            0x20
6519 #define _CKE                    0x40
6520 #define _SMP                    0x80
6521 
6522 //==============================================================================
6523 
6524 
6525 //==============================================================================
6526 //        SSPSTAT Bits
6527 
6528 extern __at(0x0FC7) __sfr SSPSTAT;
6529 
6530 typedef union
6531   {
6532   struct
6533     {
6534     unsigned BF                 : 1;
6535     unsigned UA                 : 1;
6536     unsigned R_NOT_W            : 1;
6537     unsigned S                  : 1;
6538     unsigned P                  : 1;
6539     unsigned D_NOT_A            : 1;
6540     unsigned CKE                : 1;
6541     unsigned SMP                : 1;
6542     };
6543 
6544   struct
6545     {
6546     unsigned                    : 1;
6547     unsigned                    : 1;
6548     unsigned R                  : 1;
6549     unsigned                    : 1;
6550     unsigned                    : 1;
6551     unsigned D                  : 1;
6552     unsigned                    : 1;
6553     unsigned                    : 1;
6554     };
6555 
6556   struct
6557     {
6558     unsigned                    : 1;
6559     unsigned                    : 1;
6560     unsigned NOT_W              : 1;
6561     unsigned                    : 1;
6562     unsigned                    : 1;
6563     unsigned NOT_A              : 1;
6564     unsigned                    : 1;
6565     unsigned                    : 1;
6566     };
6567 
6568   struct
6569     {
6570     unsigned                    : 1;
6571     unsigned                    : 1;
6572     unsigned R_W                : 1;
6573     unsigned                    : 1;
6574     unsigned                    : 1;
6575     unsigned D_A                : 1;
6576     unsigned                    : 1;
6577     unsigned                    : 1;
6578     };
6579 
6580   struct
6581     {
6582     unsigned                    : 1;
6583     unsigned                    : 1;
6584     unsigned NOT_WRITE          : 1;
6585     unsigned                    : 1;
6586     unsigned                    : 1;
6587     unsigned NOT_ADDRESS        : 1;
6588     unsigned                    : 1;
6589     unsigned                    : 1;
6590     };
6591   } __SSPSTATbits_t;
6592 
6593 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
6594 
6595 #define _SSPSTAT_BF             0x01
6596 #define _SSPSTAT_UA             0x02
6597 #define _SSPSTAT_R_NOT_W        0x04
6598 #define _SSPSTAT_R              0x04
6599 #define _SSPSTAT_NOT_W          0x04
6600 #define _SSPSTAT_R_W            0x04
6601 #define _SSPSTAT_NOT_WRITE      0x04
6602 #define _SSPSTAT_S              0x08
6603 #define _SSPSTAT_P              0x10
6604 #define _SSPSTAT_D_NOT_A        0x20
6605 #define _SSPSTAT_D              0x20
6606 #define _SSPSTAT_NOT_A          0x20
6607 #define _SSPSTAT_D_A            0x20
6608 #define _SSPSTAT_NOT_ADDRESS    0x20
6609 #define _SSPSTAT_CKE            0x40
6610 #define _SSPSTAT_SMP            0x80
6611 
6612 //==============================================================================
6613 
6614 extern __at(0x0FC8) __sfr SSP1ADD;
6615 extern __at(0x0FC8) __sfr SSPADD;
6616 extern __at(0x0FC9) __sfr SSP1BUF;
6617 extern __at(0x0FC9) __sfr SSPBUF;
6618 
6619 //==============================================================================
6620 //        SSP1MSK Bits
6621 
6622 extern __at(0x0FCA) __sfr SSP1MSK;
6623 
6624 typedef struct
6625   {
6626   unsigned MSK0                 : 1;
6627   unsigned MSK1                 : 1;
6628   unsigned MSK2                 : 1;
6629   unsigned MSK3                 : 1;
6630   unsigned MSK4                 : 1;
6631   unsigned MSK5                 : 1;
6632   unsigned MSK6                 : 1;
6633   unsigned MSK7                 : 1;
6634   } __SSP1MSKbits_t;
6635 
6636 extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits;
6637 
6638 #define _MSK0                   0x01
6639 #define _MSK1                   0x02
6640 #define _MSK2                   0x04
6641 #define _MSK3                   0x08
6642 #define _MSK4                   0x10
6643 #define _MSK5                   0x20
6644 #define _MSK6                   0x40
6645 #define _MSK7                   0x80
6646 
6647 //==============================================================================
6648 
6649 
6650 //==============================================================================
6651 //        SSPMSK Bits
6652 
6653 extern __at(0x0FCA) __sfr SSPMSK;
6654 
6655 typedef struct
6656   {
6657   unsigned MSK0                 : 1;
6658   unsigned MSK1                 : 1;
6659   unsigned MSK2                 : 1;
6660   unsigned MSK3                 : 1;
6661   unsigned MSK4                 : 1;
6662   unsigned MSK5                 : 1;
6663   unsigned MSK6                 : 1;
6664   unsigned MSK7                 : 1;
6665   } __SSPMSKbits_t;
6666 
6667 extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits;
6668 
6669 #define _SSPMSK_MSK0            0x01
6670 #define _SSPMSK_MSK1            0x02
6671 #define _SSPMSK_MSK2            0x04
6672 #define _SSPMSK_MSK3            0x08
6673 #define _SSPMSK_MSK4            0x10
6674 #define _SSPMSK_MSK5            0x20
6675 #define _SSPMSK_MSK6            0x40
6676 #define _SSPMSK_MSK7            0x80
6677 
6678 //==============================================================================
6679 
6680 
6681 //==============================================================================
6682 //        SSP1CON3 Bits
6683 
6684 extern __at(0x0FCB) __sfr SSP1CON3;
6685 
6686 typedef struct
6687   {
6688   unsigned DHEN                 : 1;
6689   unsigned AHEN                 : 1;
6690   unsigned SBCDE                : 1;
6691   unsigned SDAHT                : 1;
6692   unsigned BOEN                 : 1;
6693   unsigned SCIE                 : 1;
6694   unsigned PCIE                 : 1;
6695   unsigned ACKTIM               : 1;
6696   } __SSP1CON3bits_t;
6697 
6698 extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits;
6699 
6700 #define _DHEN                   0x01
6701 #define _AHEN                   0x02
6702 #define _SBCDE                  0x04
6703 #define _SDAHT                  0x08
6704 #define _BOEN                   0x10
6705 #define _SCIE                   0x20
6706 #define _PCIE                   0x40
6707 #define _ACKTIM                 0x80
6708 
6709 //==============================================================================
6710 
6711 
6712 //==============================================================================
6713 //        SSPCON3 Bits
6714 
6715 extern __at(0x0FCB) __sfr SSPCON3;
6716 
6717 typedef struct
6718   {
6719   unsigned DHEN                 : 1;
6720   unsigned AHEN                 : 1;
6721   unsigned SBCDE                : 1;
6722   unsigned SDAHT                : 1;
6723   unsigned BOEN                 : 1;
6724   unsigned SCIE                 : 1;
6725   unsigned PCIE                 : 1;
6726   unsigned ACKTIM               : 1;
6727   } __SSPCON3bits_t;
6728 
6729 extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits;
6730 
6731 #define _SSPCON3_DHEN           0x01
6732 #define _SSPCON3_AHEN           0x02
6733 #define _SSPCON3_SBCDE          0x04
6734 #define _SSPCON3_SDAHT          0x08
6735 #define _SSPCON3_BOEN           0x10
6736 #define _SSPCON3_SCIE           0x20
6737 #define _SSPCON3_PCIE           0x40
6738 #define _SSPCON3_ACKTIM         0x80
6739 
6740 //==============================================================================
6741 
6742 
6743 //==============================================================================
6744 //        T1GCON Bits
6745 
6746 extern __at(0x0FCC) __sfr T1GCON;
6747 
6748 typedef union
6749   {
6750   struct
6751     {
6752     unsigned T1GSS0             : 1;
6753     unsigned T1GSS1             : 1;
6754     unsigned T1GVAL             : 1;
6755     unsigned T1GGO_NOT_DONE     : 1;
6756     unsigned T1GSPM             : 1;
6757     unsigned T1GTM              : 1;
6758     unsigned T1GPOL             : 1;
6759     unsigned TMR1GE             : 1;
6760     };
6761 
6762   struct
6763     {
6764     unsigned                    : 1;
6765     unsigned                    : 1;
6766     unsigned                    : 1;
6767     unsigned T1G_DONE           : 1;
6768     unsigned                    : 1;
6769     unsigned                    : 1;
6770     unsigned                    : 1;
6771     unsigned                    : 1;
6772     };
6773 
6774   struct
6775     {
6776     unsigned                    : 1;
6777     unsigned                    : 1;
6778     unsigned                    : 1;
6779     unsigned T1GGO              : 1;
6780     unsigned                    : 1;
6781     unsigned                    : 1;
6782     unsigned                    : 1;
6783     unsigned                    : 1;
6784     };
6785 
6786   struct
6787     {
6788     unsigned T1GSS              : 2;
6789     unsigned                    : 6;
6790     };
6791   } __T1GCONbits_t;
6792 
6793 extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits;
6794 
6795 #define _T1GSS0                 0x01
6796 #define _T1GSS1                 0x02
6797 #define _T1GVAL                 0x04
6798 #define _T1GGO_NOT_DONE         0x08
6799 #define _T1G_DONE               0x08
6800 #define _T1GGO                  0x08
6801 #define _T1GSPM                 0x10
6802 #define _T1GTM                  0x20
6803 #define _T1GPOL                 0x40
6804 #define _TMR1GE                 0x80
6805 
6806 //==============================================================================
6807 
6808 
6809 //==============================================================================
6810 //        T1CON Bits
6811 
6812 extern __at(0x0FCD) __sfr T1CON;
6813 
6814 typedef union
6815   {
6816   struct
6817     {
6818     unsigned TMR1ON             : 1;
6819     unsigned T1RD16             : 1;
6820     unsigned NOT_T1SYNC         : 1;
6821     unsigned T1SOSCEN           : 1;
6822     unsigned T1CKPS0            : 1;
6823     unsigned T1CKPS1            : 1;
6824     unsigned TMR1CS0            : 1;
6825     unsigned TMR1CS1            : 1;
6826     };
6827 
6828   struct
6829     {
6830     unsigned                    : 1;
6831     unsigned RD16               : 1;
6832     unsigned T1SYNC             : 1;
6833     unsigned T1OSCEN            : 1;
6834     unsigned                    : 1;
6835     unsigned                    : 1;
6836     unsigned                    : 1;
6837     unsigned                    : 1;
6838     };
6839 
6840   struct
6841     {
6842     unsigned                    : 4;
6843     unsigned T1CKPS             : 2;
6844     unsigned                    : 2;
6845     };
6846 
6847   struct
6848     {
6849     unsigned                    : 6;
6850     unsigned TMR1CS             : 2;
6851     };
6852   } __T1CONbits_t;
6853 
6854 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6855 
6856 #define _TMR1ON                 0x01
6857 #define _T1RD16                 0x02
6858 #define _RD16                   0x02
6859 #define _NOT_T1SYNC             0x04
6860 #define _T1SYNC                 0x04
6861 #define _T1SOSCEN               0x08
6862 #define _T1OSCEN                0x08
6863 #define _T1CKPS0                0x10
6864 #define _T1CKPS1                0x20
6865 #define _TMR1CS0                0x40
6866 #define _TMR1CS1                0x80
6867 
6868 //==============================================================================
6869 
6870 extern __at(0x0FCE) __sfr TMR1;
6871 extern __at(0x0FCE) __sfr TMR1L;
6872 extern __at(0x0FCF) __sfr TMR1H;
6873 
6874 //==============================================================================
6875 //        RCON Bits
6876 
6877 extern __at(0x0FD0) __sfr RCON;
6878 
6879 typedef union
6880   {
6881   struct
6882     {
6883     unsigned NOT_BOR            : 1;
6884     unsigned NOT_POR            : 1;
6885     unsigned NOT_PD             : 1;
6886     unsigned NOT_TO             : 1;
6887     unsigned NOT_RI             : 1;
6888     unsigned                    : 1;
6889     unsigned SBOREN             : 1;
6890     unsigned IPEN               : 1;
6891     };
6892 
6893   struct
6894     {
6895     unsigned BOR                : 1;
6896     unsigned POR                : 1;
6897     unsigned PD                 : 1;
6898     unsigned TO                 : 1;
6899     unsigned RI                 : 1;
6900     unsigned                    : 1;
6901     unsigned                    : 1;
6902     unsigned                    : 1;
6903     };
6904   } __RCONbits_t;
6905 
6906 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6907 
6908 #define _NOT_BOR                0x01
6909 #define _BOR                    0x01
6910 #define _NOT_POR                0x02
6911 #define _POR                    0x02
6912 #define _NOT_PD                 0x04
6913 #define _PD                     0x04
6914 #define _NOT_TO                 0x08
6915 #define _TO                     0x08
6916 #define _NOT_RI                 0x10
6917 #define _RI                     0x10
6918 #define _SBOREN                 0x40
6919 #define _IPEN                   0x80
6920 
6921 //==============================================================================
6922 
6923 
6924 //==============================================================================
6925 //        WDTCON Bits
6926 
6927 extern __at(0x0FD1) __sfr WDTCON;
6928 
6929 typedef union
6930   {
6931   struct
6932     {
6933     unsigned SWDTEN             : 1;
6934     unsigned                    : 1;
6935     unsigned                    : 1;
6936     unsigned                    : 1;
6937     unsigned                    : 1;
6938     unsigned                    : 1;
6939     unsigned                    : 1;
6940     unsigned                    : 1;
6941     };
6942 
6943   struct
6944     {
6945     unsigned SWDTE              : 1;
6946     unsigned                    : 1;
6947     unsigned                    : 1;
6948     unsigned                    : 1;
6949     unsigned                    : 1;
6950     unsigned                    : 1;
6951     unsigned                    : 1;
6952     unsigned                    : 1;
6953     };
6954   } __WDTCONbits_t;
6955 
6956 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
6957 
6958 #define _SWDTEN                 0x01
6959 #define _SWDTE                  0x01
6960 
6961 //==============================================================================
6962 
6963 
6964 //==============================================================================
6965 //        OSCCON2 Bits
6966 
6967 extern __at(0x0FD2) __sfr OSCCON2;
6968 
6969 typedef struct
6970   {
6971   unsigned LFIOFS               : 1;
6972   unsigned MFIOFS               : 1;
6973   unsigned PRISD                : 1;
6974   unsigned SOSCGO               : 1;
6975   unsigned MFIOSEL              : 1;
6976   unsigned                      : 1;
6977   unsigned SOSCRUN              : 1;
6978   unsigned PLLRDY               : 1;
6979   } __OSCCON2bits_t;
6980 
6981 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
6982 
6983 #define _LFIOFS                 0x01
6984 #define _MFIOFS                 0x02
6985 #define _PRISD                  0x04
6986 #define _SOSCGO                 0x08
6987 #define _MFIOSEL                0x10
6988 #define _SOSCRUN                0x40
6989 #define _PLLRDY                 0x80
6990 
6991 //==============================================================================
6992 
6993 
6994 //==============================================================================
6995 //        OSCCON Bits
6996 
6997 extern __at(0x0FD3) __sfr OSCCON;
6998 
6999 typedef union
7000   {
7001   struct
7002     {
7003     unsigned SCS0               : 1;
7004     unsigned SCS1               : 1;
7005     unsigned HFIOFS             : 1;
7006     unsigned OSTS               : 1;
7007     unsigned IRCF0              : 1;
7008     unsigned IRCF1              : 1;
7009     unsigned IRCF2              : 1;
7010     unsigned IDLEN              : 1;
7011     };
7012 
7013   struct
7014     {
7015     unsigned                    : 1;
7016     unsigned                    : 1;
7017     unsigned IOFS               : 1;
7018     unsigned                    : 1;
7019     unsigned                    : 1;
7020     unsigned                    : 1;
7021     unsigned                    : 1;
7022     unsigned                    : 1;
7023     };
7024 
7025   struct
7026     {
7027     unsigned SCS                : 2;
7028     unsigned                    : 6;
7029     };
7030 
7031   struct
7032     {
7033     unsigned                    : 4;
7034     unsigned IRCF               : 3;
7035     unsigned                    : 1;
7036     };
7037   } __OSCCONbits_t;
7038 
7039 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
7040 
7041 #define _SCS0                   0x01
7042 #define _SCS1                   0x02
7043 #define _HFIOFS                 0x04
7044 #define _IOFS                   0x04
7045 #define _OSTS                   0x08
7046 #define _IRCF0                  0x10
7047 #define _IRCF1                  0x20
7048 #define _IRCF2                  0x40
7049 #define _IDLEN                  0x80
7050 
7051 //==============================================================================
7052 
7053 
7054 //==============================================================================
7055 //        T0CON Bits
7056 
7057 extern __at(0x0FD5) __sfr T0CON;
7058 
7059 typedef union
7060   {
7061   struct
7062     {
7063     unsigned T0PS0              : 1;
7064     unsigned T0PS1              : 1;
7065     unsigned T0PS2              : 1;
7066     unsigned PSA                : 1;
7067     unsigned T0SE               : 1;
7068     unsigned T0CS               : 1;
7069     unsigned T08BIT             : 1;
7070     unsigned TMR0ON             : 1;
7071     };
7072 
7073   struct
7074     {
7075     unsigned T0PS               : 3;
7076     unsigned                    : 5;
7077     };
7078   } __T0CONbits_t;
7079 
7080 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
7081 
7082 #define _T0PS0                  0x01
7083 #define _T0PS1                  0x02
7084 #define _T0PS2                  0x04
7085 #define _PSA                    0x08
7086 #define _T0SE                   0x10
7087 #define _T0CS                   0x20
7088 #define _T08BIT                 0x40
7089 #define _TMR0ON                 0x80
7090 
7091 //==============================================================================
7092 
7093 extern __at(0x0FD6) __sfr TMR0;
7094 extern __at(0x0FD6) __sfr TMR0L;
7095 extern __at(0x0FD7) __sfr TMR0H;
7096 
7097 //==============================================================================
7098 //        STATUS Bits
7099 
7100 extern __at(0x0FD8) __sfr STATUS;
7101 
7102 typedef struct
7103   {
7104   unsigned C                    : 1;
7105   unsigned DC                   : 1;
7106   unsigned Z                    : 1;
7107   unsigned OV                   : 1;
7108   unsigned N                    : 1;
7109   unsigned                      : 1;
7110   unsigned                      : 1;
7111   unsigned                      : 1;
7112   } __STATUSbits_t;
7113 
7114 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
7115 
7116 #define _C                      0x01
7117 #define _DC                     0x02
7118 #define _Z                      0x04
7119 #define _OV                     0x08
7120 #define _N                      0x10
7121 
7122 //==============================================================================
7123 
7124 extern __at(0x0FD9) __sfr FSR2L;
7125 extern __at(0x0FDA) __sfr FSR2H;
7126 extern __at(0x0FDB) __sfr PLUSW2;
7127 extern __at(0x0FDC) __sfr PREINC2;
7128 extern __at(0x0FDD) __sfr POSTDEC2;
7129 extern __at(0x0FDE) __sfr POSTINC2;
7130 extern __at(0x0FDF) __sfr INDF2;
7131 extern __at(0x0FE0) __sfr BSR;
7132 extern __at(0x0FE1) __sfr FSR1L;
7133 extern __at(0x0FE2) __sfr FSR1H;
7134 extern __at(0x0FE3) __sfr PLUSW1;
7135 extern __at(0x0FE4) __sfr PREINC1;
7136 extern __at(0x0FE5) __sfr POSTDEC1;
7137 extern __at(0x0FE6) __sfr POSTINC1;
7138 extern __at(0x0FE7) __sfr INDF1;
7139 extern __at(0x0FE8) __sfr WREG;
7140 extern __at(0x0FE9) __sfr FSR0L;
7141 extern __at(0x0FEA) __sfr FSR0H;
7142 extern __at(0x0FEB) __sfr PLUSW0;
7143 extern __at(0x0FEC) __sfr PREINC0;
7144 extern __at(0x0FED) __sfr POSTDEC0;
7145 extern __at(0x0FEE) __sfr POSTINC0;
7146 extern __at(0x0FEF) __sfr INDF0;
7147 
7148 //==============================================================================
7149 //        INTCON3 Bits
7150 
7151 extern __at(0x0FF0) __sfr INTCON3;
7152 
7153 typedef union
7154   {
7155   struct
7156     {
7157     unsigned INT1IF             : 1;
7158     unsigned INT2IF             : 1;
7159     unsigned                    : 1;
7160     unsigned INT1IE             : 1;
7161     unsigned INT2IE             : 1;
7162     unsigned                    : 1;
7163     unsigned INT1IP             : 1;
7164     unsigned INT2IP             : 1;
7165     };
7166 
7167   struct
7168     {
7169     unsigned INT1F              : 1;
7170     unsigned INT2F              : 1;
7171     unsigned                    : 1;
7172     unsigned INT1E              : 1;
7173     unsigned INT2E              : 1;
7174     unsigned                    : 1;
7175     unsigned INT1P              : 1;
7176     unsigned INT2P              : 1;
7177     };
7178   } __INTCON3bits_t;
7179 
7180 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
7181 
7182 #define _INT1IF                 0x01
7183 #define _INT1F                  0x01
7184 #define _INT2IF                 0x02
7185 #define _INT2F                  0x02
7186 #define _INT1IE                 0x08
7187 #define _INT1E                  0x08
7188 #define _INT2IE                 0x10
7189 #define _INT2E                  0x10
7190 #define _INT1IP                 0x40
7191 #define _INT1P                  0x40
7192 #define _INT2IP                 0x80
7193 #define _INT2P                  0x80
7194 
7195 //==============================================================================
7196 
7197 
7198 //==============================================================================
7199 //        INTCON2 Bits
7200 
7201 extern __at(0x0FF1) __sfr INTCON2;
7202 
7203 typedef union
7204   {
7205   struct
7206     {
7207     unsigned RBIP               : 1;
7208     unsigned                    : 1;
7209     unsigned TMR0IP             : 1;
7210     unsigned                    : 1;
7211     unsigned INTEDG2            : 1;
7212     unsigned INTEDG1            : 1;
7213     unsigned INTEDG0            : 1;
7214     unsigned NOT_RBPU           : 1;
7215     };
7216 
7217   struct
7218     {
7219     unsigned                    : 1;
7220     unsigned                    : 1;
7221     unsigned                    : 1;
7222     unsigned                    : 1;
7223     unsigned                    : 1;
7224     unsigned                    : 1;
7225     unsigned                    : 1;
7226     unsigned RBPU               : 1;
7227     };
7228   } __INTCON2bits_t;
7229 
7230 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
7231 
7232 #define _RBIP                   0x01
7233 #define _TMR0IP                 0x04
7234 #define _INTEDG2                0x10
7235 #define _INTEDG1                0x20
7236 #define _INTEDG0                0x40
7237 #define _NOT_RBPU               0x80
7238 #define _RBPU                   0x80
7239 
7240 //==============================================================================
7241 
7242 
7243 //==============================================================================
7244 //        INTCON Bits
7245 
7246 extern __at(0x0FF2) __sfr INTCON;
7247 
7248 typedef union
7249   {
7250   struct
7251     {
7252     unsigned RBIF               : 1;
7253     unsigned INT0IF             : 1;
7254     unsigned TMR0IF             : 1;
7255     unsigned RBIE               : 1;
7256     unsigned INT0IE             : 1;
7257     unsigned TMR0IE             : 1;
7258     unsigned PEIE_GIEL          : 1;
7259     unsigned GIE_GIEH           : 1;
7260     };
7261 
7262   struct
7263     {
7264     unsigned                    : 1;
7265     unsigned INT0F              : 1;
7266     unsigned T0IF               : 1;
7267     unsigned                    : 1;
7268     unsigned INT0E              : 1;
7269     unsigned T0IE               : 1;
7270     unsigned PEIE               : 1;
7271     unsigned GIE                : 1;
7272     };
7273 
7274   struct
7275     {
7276     unsigned                    : 1;
7277     unsigned                    : 1;
7278     unsigned                    : 1;
7279     unsigned                    : 1;
7280     unsigned                    : 1;
7281     unsigned                    : 1;
7282     unsigned GIEL               : 1;
7283     unsigned GIEH               : 1;
7284     };
7285   } __INTCONbits_t;
7286 
7287 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
7288 
7289 #define _RBIF                   0x01
7290 #define _INT0IF                 0x02
7291 #define _INT0F                  0x02
7292 #define _TMR0IF                 0x04
7293 #define _T0IF                   0x04
7294 #define _RBIE                   0x08
7295 #define _INT0IE                 0x10
7296 #define _INT0E                  0x10
7297 #define _TMR0IE                 0x20
7298 #define _T0IE                   0x20
7299 #define _PEIE_GIEL              0x40
7300 #define _PEIE                   0x40
7301 #define _GIEL                   0x40
7302 #define _GIE_GIEH               0x80
7303 #define _GIE                    0x80
7304 #define _GIEH                   0x80
7305 
7306 //==============================================================================
7307 
7308 extern __at(0x0FF3) __sfr PROD;
7309 extern __at(0x0FF3) __sfr PRODL;
7310 extern __at(0x0FF4) __sfr PRODH;
7311 extern __at(0x0FF5) __sfr TABLAT;
7312 extern __at(0x0FF6) __sfr TBLPTR;
7313 extern __at(0x0FF6) __sfr TBLPTRL;
7314 extern __at(0x0FF7) __sfr TBLPTRH;
7315 extern __at(0x0FF8) __sfr TBLPTRU;
7316 extern __at(0x0FF9) __sfr PC;
7317 extern __at(0x0FF9) __sfr PCL;
7318 extern __at(0x0FFA) __sfr PCLATH;
7319 extern __at(0x0FFB) __sfr PCLATU;
7320 
7321 //==============================================================================
7322 //        STKPTR Bits
7323 
7324 extern __at(0x0FFC) __sfr STKPTR;
7325 
7326 typedef union
7327   {
7328   struct
7329     {
7330     unsigned STKPTR0            : 1;
7331     unsigned STKPTR1            : 1;
7332     unsigned STKPTR2            : 1;
7333     unsigned STKPTR3            : 1;
7334     unsigned STKPTR4            : 1;
7335     unsigned                    : 1;
7336     unsigned STKUNF             : 1;
7337     unsigned STKFUL             : 1;
7338     };
7339 
7340   struct
7341     {
7342     unsigned SP0                : 1;
7343     unsigned SP1                : 1;
7344     unsigned SP2                : 1;
7345     unsigned SP3                : 1;
7346     unsigned SP4                : 1;
7347     unsigned                    : 1;
7348     unsigned                    : 1;
7349     unsigned STKOVF             : 1;
7350     };
7351 
7352   struct
7353     {
7354     unsigned SP                 : 5;
7355     unsigned                    : 3;
7356     };
7357 
7358   struct
7359     {
7360     unsigned STKPTR             : 5;
7361     unsigned                    : 3;
7362     };
7363   } __STKPTRbits_t;
7364 
7365 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
7366 
7367 #define _STKPTR0                0x01
7368 #define _SP0                    0x01
7369 #define _STKPTR1                0x02
7370 #define _SP1                    0x02
7371 #define _STKPTR2                0x04
7372 #define _SP2                    0x04
7373 #define _STKPTR3                0x08
7374 #define _SP3                    0x08
7375 #define _STKPTR4                0x10
7376 #define _SP4                    0x10
7377 #define _STKUNF                 0x40
7378 #define _STKFUL                 0x80
7379 #define _STKOVF                 0x80
7380 
7381 //==============================================================================
7382 
7383 extern __at(0x0FFD) __sfr TOS;
7384 extern __at(0x0FFD) __sfr TOSL;
7385 extern __at(0x0FFE) __sfr TOSH;
7386 extern __at(0x0FFF) __sfr TOSU;
7387 
7388 //==============================================================================
7389 //
7390 //        Configuration Bits
7391 //
7392 //==============================================================================
7393 
7394 #define __CONFIG1H              0x300001
7395 #define __CONFIG2L              0x300002
7396 #define __CONFIG2H              0x300003
7397 #define __CONFIG3H              0x300005
7398 #define __CONFIG4L              0x300006
7399 #define __CONFIG5L              0x300008
7400 #define __CONFIG5H              0x300009
7401 #define __CONFIG6L              0x30000A
7402 #define __CONFIG6H              0x30000B
7403 #define __CONFIG7L              0x30000C
7404 #define __CONFIG7H              0x30000D
7405 
7406 //----------------------------- CONFIG1H Options -------------------------------
7407 
7408 #define _FOSC_LP_1H             0xF0    // LP oscillator.
7409 #define _FOSC_XT_1H             0xF1    // XT oscillator.
7410 #define _FOSC_HSHP_1H           0xF2    // HS oscillator (high power > 16 MHz).
7411 #define _FOSC_HSMP_1H           0xF3    // HS oscillator (medium power 4-16 MHz).
7412 #define _FOSC_ECHP_1H           0xF4    // EC oscillator, CLKOUT function on OSC2 (high power, >16 MHz).
7413 #define _FOSC_ECHPIO6_1H        0xF5    // EC oscillator (high power, >16 MHz).
7414 #define _FOSC_RC_1H             0xF6    // External RC oscillator, CLKOUT function on OSC2.
7415 #define _FOSC_RCIO6_1H          0xF7    // External RC oscillator.
7416 #define _FOSC_INTIO67_1H        0xF8    // Internal oscillator block.
7417 #define _FOSC_INTIO7_1H         0xF9    // Internal oscillator block, CLKOUT function on OSC2.
7418 #define _FOSC_ECMP_1H           0xFA    // EC oscillator, CLKOUT function on OSC2 (medium power, 500 kHz-16 MHz).
7419 #define _FOSC_ECMPIO6_1H        0xFB    // EC oscillator (medium power, 500 kHz-16 MHz).
7420 #define _FOSC_ECLP_1H           0xFC    // EC oscillator, CLKOUT function on OSC2 (low power, <500 kHz).
7421 #define _FOSC_ECLPIO6_1H        0xFD    // EC oscillator (low power, <500 kHz).
7422 #define _PLLCFG_OFF_1H          0xEF    // Oscillator used directly.
7423 #define _PLLCFG_ON_1H           0xFF    // Oscillator multiplied by 4.
7424 #define _PRICLKEN_OFF_1H        0xDF    // Primary clock can be disabled by software.
7425 #define _PRICLKEN_ON_1H         0xFF    // Primary clock is always enabled.
7426 #define _FCMEN_OFF_1H           0xBF    // Fail-Safe Clock Monitor disabled.
7427 #define _FCMEN_ON_1H            0xFF    // Fail-Safe Clock Monitor enabled.
7428 #define _IESO_OFF_1H            0x7F    // Oscillator Switchover mode disabled.
7429 #define _IESO_ON_1H             0xFF    // Oscillator Switchover mode enabled.
7430 
7431 //----------------------------- CONFIG2L Options -------------------------------
7432 
7433 #define _PWRTEN_ON_2L           0xFE    // Power up timer enabled.
7434 #define _PWRTEN_OFF_2L          0xFF    // Power up timer disabled.
7435 #define _BOREN_OFF_2L           0xF9    // Brown-out Reset disabled in hardware and software.
7436 #define _BOREN_ON_2L            0xFB    // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
7437 #define _BOREN_NOSLP_2L         0xFD    // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
7438 #define _BOREN_SBORDIS_2L       0xFF    // Brown-out Reset enabled in hardware only (SBOREN is disabled).
7439 #define _BORV_285_2L            0xE7    // VBOR set to 2.85 V nominal.
7440 #define _BORV_250_2L            0xEF    // VBOR set to 2.50 V nominal.
7441 #define _BORV_220_2L            0xF7    // VBOR set to 2.20 V nominal.
7442 #define _BORV_190_2L            0xFF    // VBOR set to 1.90 V nominal.
7443 
7444 //----------------------------- CONFIG2H Options -------------------------------
7445 
7446 #define _WDTEN_OFF_2H           0xFC    // Watch dog timer is always disabled. SWDTEN has no effect.
7447 #define _WDTEN_NOSLP_2H         0xFD    // WDT is disabled in sleep, otherwise enabled. SWDTEN bit has no effect.
7448 #define _WDTEN_SWON_2H          0xFE    // WDT is controlled by SWDTEN bit of the WDTCON register.
7449 #define _WDTEN_ON_2H            0xFF    // WDT is always enabled. SWDTEN bit has no effect.
7450 #define _WDTPS_1_2H             0xC3    // 1:1.
7451 #define _WDTPS_2_2H             0xC7    // 1:2.
7452 #define _WDTPS_4_2H             0xCB    // 1:4.
7453 #define _WDTPS_8_2H             0xCF    // 1:8.
7454 #define _WDTPS_16_2H            0xD3    // 1:16.
7455 #define _WDTPS_32_2H            0xD7    // 1:32.
7456 #define _WDTPS_64_2H            0xDB    // 1:64.
7457 #define _WDTPS_128_2H           0xDF    // 1:128.
7458 #define _WDTPS_256_2H           0xE3    // 1:256.
7459 #define _WDTPS_512_2H           0xE7    // 1:512.
7460 #define _WDTPS_1024_2H          0xEB    // 1:1024.
7461 #define _WDTPS_2048_2H          0xEF    // 1:2048.
7462 #define _WDTPS_4096_2H          0xF3    // 1:4096.
7463 #define _WDTPS_8192_2H          0xF7    // 1:8192.
7464 #define _WDTPS_16384_2H         0xFB    // 1:16384.
7465 #define _WDTPS_32768_2H         0xFF    // 1:32768.
7466 
7467 //----------------------------- CONFIG3H Options -------------------------------
7468 
7469 #define _CCP2MX_PORTB3_3H       0xFE    // CCP2 input/output is multiplexed with RB3.
7470 #define _CCP2MX_PORTC1_3H       0xFF    // CCP2 input/output is multiplexed with RC1.
7471 #define _PBADEN_OFF_3H          0xFD    // PORTB<5:0> pins are configured as digital I/O on Reset.
7472 #define _PBADEN_ON_3H           0xFF    // PORTB<5:0> pins are configured as analog input channels on Reset.
7473 #define _CCP3MX_PORTE0_3H       0xFB    // P3A/CCP3 input/output is mulitplexed with RE0.
7474 #define _CCP3MX_PORTB5_3H       0xFF    // P3A/CCP3 input/output is multiplexed with RB5.
7475 #define _HFOFST_OFF_3H          0xF7    // HFINTOSC output and ready status are delayed by the oscillator stable status.
7476 #define _HFOFST_ON_3H           0xFF    // HFINTOSC output and ready status are not delayed by the oscillator stable status.
7477 #define _T3CMX_PORTB5_3H        0xEF    // T3CKI is on RB5.
7478 #define _T3CMX_PORTC0_3H        0xFF    // T3CKI is on RC0.
7479 #define _P2BMX_PORTC0_3H        0xDF    // P2B is on RC0.
7480 #define _P2BMX_PORTD2_3H        0xFF    // P2B is on RD2.
7481 #define _MCLRE_INTMCLR_3H       0x7F    // RE3 input pin enabled; MCLR disabled.
7482 #define _MCLRE_EXTMCLR_3H       0xFF    // MCLR pin enabled, RE3 input pin disabled.
7483 
7484 //----------------------------- CONFIG4L Options -------------------------------
7485 
7486 #define _STVREN_OFF_4L          0xFE    // Stack full/underflow will not cause Reset.
7487 #define _STVREN_ON_4L           0xFF    // Stack full/underflow will cause Reset.
7488 #define _LVP_OFF_4L             0xFB    // Single-Supply ICSP disabled.
7489 #define _LVP_ON_4L              0xFF    // Single-Supply ICSP enabled if MCLRE is also 1.
7490 #define _XINST_OFF_4L           0xBF    // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
7491 #define _XINST_ON_4L            0xFF    // Instruction set extension and Indexed Addressing mode enabled.
7492 #define _DEBUG_ON_4L            0x7F    // Enabled.
7493 #define _DEBUG_OFF_4L           0xFF    // Disabled.
7494 
7495 //----------------------------- CONFIG5L Options -------------------------------
7496 
7497 #define _CP0_ON_5L              0xFE    // Block 0 (000800-003FFFh) code-protected.
7498 #define _CP0_OFF_5L             0xFF    // Block 0 (000800-003FFFh) not code-protected.
7499 #define _CP1_ON_5L              0xFD    // Block 1 (004000-007FFFh) code-protected.
7500 #define _CP1_OFF_5L             0xFF    // Block 1 (004000-007FFFh) not code-protected.
7501 #define _CP2_ON_5L              0xFB    // Block 2 (008000-00BFFFh) code-protected.
7502 #define _CP2_OFF_5L             0xFF    // Block 2 (008000-00BFFFh) not code-protected.
7503 #define _CP3_ON_5L              0xF7    // Block 3 (00C000-00FFFFh) code-protected.
7504 #define _CP3_OFF_5L             0xFF    // Block 3 (00C000-00FFFFh) not code-protected.
7505 
7506 //----------------------------- CONFIG5H Options -------------------------------
7507 
7508 #define _CPB_ON_5H              0xBF    // Boot block (000000-0007FFh) code-protected.
7509 #define _CPB_OFF_5H             0xFF    // Boot block (000000-0007FFh) not code-protected.
7510 #define _CPD_ON_5H              0x7F    // Data EEPROM code-protected.
7511 #define _CPD_OFF_5H             0xFF    // Data EEPROM not code-protected.
7512 
7513 //----------------------------- CONFIG6L Options -------------------------------
7514 
7515 #define _WRT0_ON_6L             0xFE    // Block 0 (000800-003FFFh) write-protected.
7516 #define _WRT0_OFF_6L            0xFF    // Block 0 (000800-003FFFh) not write-protected.
7517 #define _WRT1_ON_6L             0xFD    // Block 1 (004000-007FFFh) write-protected.
7518 #define _WRT1_OFF_6L            0xFF    // Block 1 (004000-007FFFh) not write-protected.
7519 #define _WRT2_ON_6L             0xFB    // Block 2 (008000-00BFFFh) write-protected.
7520 #define _WRT2_OFF_6L            0xFF    // Block 2 (008000-00BFFFh) not write-protected.
7521 #define _WRT3_ON_6L             0xF7    // Block 3 (00C000-00FFFFh) write-protected.
7522 #define _WRT3_OFF_6L            0xFF    // Block 3 (00C000-00FFFFh) not write-protected.
7523 
7524 //----------------------------- CONFIG6H Options -------------------------------
7525 
7526 #define _WRTC_ON_6H             0xDF    // Configuration registers (300000-3000FFh) write-protected.
7527 #define _WRTC_OFF_6H            0xFF    // Configuration registers (300000-3000FFh) not write-protected.
7528 #define _WRTB_ON_6H             0xBF    // Boot Block (000000-0007FFh) write-protected.
7529 #define _WRTB_OFF_6H            0xFF    // Boot Block (000000-0007FFh) not write-protected.
7530 #define _WRTD_ON_6H             0x7F    // Data EEPROM write-protected.
7531 #define _WRTD_OFF_6H            0xFF    // Data EEPROM not write-protected.
7532 
7533 //----------------------------- CONFIG7L Options -------------------------------
7534 
7535 #define _EBTR0_ON_7L            0xFE    // Block 0 (000800-003FFFh) protected from table reads executed in other blocks.
7536 #define _EBTR0_OFF_7L           0xFF    // Block 0 (000800-003FFFh) not protected from table reads executed in other blocks.
7537 #define _EBTR1_ON_7L            0xFD    // Block 1 (004000-007FFFh) protected from table reads executed in other blocks.
7538 #define _EBTR1_OFF_7L           0xFF    // Block 1 (004000-007FFFh) not protected from table reads executed in other blocks.
7539 #define _EBTR2_ON_7L            0xFB    // Block 2 (008000-00BFFFh) protected from table reads executed in other blocks.
7540 #define _EBTR2_OFF_7L           0xFF    // Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks.
7541 #define _EBTR3_ON_7L            0xF7    // Block 3 (00C000-00FFFFh) protected from table reads executed in other blocks.
7542 #define _EBTR3_OFF_7L           0xFF    // Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks.
7543 
7544 //----------------------------- CONFIG7H Options -------------------------------
7545 
7546 #define _EBTRB_ON_7H            0xBF    // Boot Block (000000-0007FFh) protected from table reads executed in other blocks.
7547 #define _EBTRB_OFF_7H           0xFF    // Boot Block (000000-0007FFh) not protected from table reads executed in other blocks.
7548 
7549 //==============================================================================
7550 
7551 #define __DEVID1                0x3FFFFE
7552 #define __DEVID2                0x3FFFFF
7553 
7554 #define __IDLOC0                0x200000
7555 #define __IDLOC1                0x200001
7556 #define __IDLOC2                0x200002
7557 #define __IDLOC3                0x200003
7558 #define __IDLOC4                0x200004
7559 #define __IDLOC5                0x200005
7560 #define __IDLOC6                0x200006
7561 #define __IDLOC7                0x200007
7562 
7563 #endif // #ifndef __PIC18LF46K22_H__
7564