1 /*
2  * This declarations of the PIC18LF26J53 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:55 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 __PIC18LF26J53_H__
26 #define __PIC18LF26J53_H__
27 
28 //==============================================================================
29 
30 //==============================================================================
31 //
32 //	Register Definitions
33 //
34 //==============================================================================
35 
36 
37 //==============================================================================
38 //        ADCTRIG Bits
39 
40 extern __at(0x0EB8) __sfr ADCTRIG;
41 
42 typedef union
43   {
44   struct
45     {
46     unsigned SRC0               : 1;
47     unsigned SRC1               : 1;
48     unsigned                    : 1;
49     unsigned                    : 1;
50     unsigned                    : 1;
51     unsigned                    : 1;
52     unsigned                    : 1;
53     unsigned                    : 1;
54     };
55 
56   struct
57     {
58     unsigned TRIGSEL0           : 1;
59     unsigned TRIGSEL1           : 1;
60     unsigned                    : 1;
61     unsigned                    : 1;
62     unsigned                    : 1;
63     unsigned                    : 1;
64     unsigned                    : 1;
65     unsigned                    : 1;
66     };
67 
68   struct
69     {
70     unsigned TRIGSEL            : 2;
71     unsigned                    : 6;
72     };
73 
74   struct
75     {
76     unsigned SRC                : 2;
77     unsigned                    : 6;
78     };
79   } __ADCTRIGbits_t;
80 
81 extern __at(0x0EB8) volatile __ADCTRIGbits_t ADCTRIGbits;
82 
83 #define _SRC0                   0x01
84 #define _TRIGSEL0               0x01
85 #define _SRC1                   0x02
86 #define _TRIGSEL1               0x02
87 
88 //==============================================================================
89 
90 
91 //==============================================================================
92 //        PD0 Bits
93 
94 extern __at(0x0EB9) __sfr PD0;
95 
96 typedef union
97   {
98   struct
99     {
100     unsigned ADCMD              : 1;
101     unsigned SPI1MD             : 1;
102     unsigned SPI2MD             : 1;
103     unsigned UART1MD            : 1;
104     unsigned UART2MD            : 1;
105     unsigned ECCP1MD            : 1;
106     unsigned ECCP2MD            : 1;
107     unsigned ECCP3MD            : 1;
108     };
109 
110   struct
111     {
112     unsigned PMDADC             : 1;
113     unsigned PMDMSSP1           : 1;
114     unsigned PMDMSSP2           : 1;
115     unsigned PMDUART1           : 1;
116     unsigned PMDUART2           : 1;
117     unsigned PMDECCP1           : 1;
118     unsigned PMDECCP2           : 1;
119     unsigned PMDECCP3           : 1;
120     };
121   } __PD0bits_t;
122 
123 extern __at(0x0EB9) volatile __PD0bits_t PD0bits;
124 
125 #define _ADCMD                  0x01
126 #define _PMDADC                 0x01
127 #define _SPI1MD                 0x02
128 #define _PMDMSSP1               0x02
129 #define _SPI2MD                 0x04
130 #define _PMDMSSP2               0x04
131 #define _UART1MD                0x08
132 #define _PMDUART1               0x08
133 #define _UART2MD                0x10
134 #define _PMDUART2               0x10
135 #define _ECCP1MD                0x20
136 #define _PMDECCP1               0x20
137 #define _ECCP2MD                0x40
138 #define _PMDECCP2               0x40
139 #define _ECCP3MD                0x80
140 #define _PMDECCP3               0x80
141 
142 //==============================================================================
143 
144 
145 //==============================================================================
146 //        PMDIS0 Bits
147 
148 extern __at(0x0EB9) __sfr PMDIS0;
149 
150 typedef union
151   {
152   struct
153     {
154     unsigned ADCMD              : 1;
155     unsigned SPI1MD             : 1;
156     unsigned SPI2MD             : 1;
157     unsigned UART1MD            : 1;
158     unsigned UART2MD            : 1;
159     unsigned ECCP1MD            : 1;
160     unsigned ECCP2MD            : 1;
161     unsigned ECCP3MD            : 1;
162     };
163 
164   struct
165     {
166     unsigned PMDADC             : 1;
167     unsigned PMDMSSP1           : 1;
168     unsigned PMDMSSP2           : 1;
169     unsigned PMDUART1           : 1;
170     unsigned PMDUART2           : 1;
171     unsigned PMDECCP1           : 1;
172     unsigned PMDECCP2           : 1;
173     unsigned PMDECCP3           : 1;
174     };
175   } __PMDIS0bits_t;
176 
177 extern __at(0x0EB9) volatile __PMDIS0bits_t PMDIS0bits;
178 
179 #define _PMDIS0_ADCMD           0x01
180 #define _PMDIS0_PMDADC          0x01
181 #define _PMDIS0_SPI1MD          0x02
182 #define _PMDIS0_PMDMSSP1        0x02
183 #define _PMDIS0_SPI2MD          0x04
184 #define _PMDIS0_PMDMSSP2        0x04
185 #define _PMDIS0_UART1MD         0x08
186 #define _PMDIS0_PMDUART1        0x08
187 #define _PMDIS0_UART2MD         0x10
188 #define _PMDIS0_PMDUART2        0x10
189 #define _PMDIS0_ECCP1MD         0x20
190 #define _PMDIS0_PMDECCP1        0x20
191 #define _PMDIS0_ECCP2MD         0x40
192 #define _PMDIS0_PMDECCP2        0x40
193 #define _PMDIS0_ECCP3MD         0x80
194 #define _PMDIS0_PMDECCP3        0x80
195 
196 //==============================================================================
197 
198 
199 //==============================================================================
200 //        PD1 Bits
201 
202 extern __at(0x0EBA) __sfr PD1;
203 
204 typedef union
205   {
206   struct
207     {
208     unsigned                    : 1;
209     unsigned TMR1MD             : 1;
210     unsigned TMR2MD             : 1;
211     unsigned TMR3MD             : 1;
212     unsigned TMR4MD             : 1;
213     unsigned RTCCMD             : 1;
214     unsigned CTMUMD             : 1;
215     unsigned                    : 1;
216     };
217 
218   struct
219     {
220     unsigned                    : 1;
221     unsigned PMDTMR1            : 1;
222     unsigned PMDTMR2            : 1;
223     unsigned PMDTMR3            : 1;
224     unsigned PMDTMR4            : 1;
225     unsigned PMDRTCC            : 1;
226     unsigned PMDCTMU            : 1;
227     unsigned                    : 1;
228     };
229   } __PD1bits_t;
230 
231 extern __at(0x0EBA) volatile __PD1bits_t PD1bits;
232 
233 #define _TMR1MD                 0x02
234 #define _PMDTMR1                0x02
235 #define _TMR2MD                 0x04
236 #define _PMDTMR2                0x04
237 #define _TMR3MD                 0x08
238 #define _PMDTMR3                0x08
239 #define _TMR4MD                 0x10
240 #define _PMDTMR4                0x10
241 #define _RTCCMD                 0x20
242 #define _PMDRTCC                0x20
243 #define _CTMUMD                 0x40
244 #define _PMDCTMU                0x40
245 
246 //==============================================================================
247 
248 
249 //==============================================================================
250 //        PMDIS1 Bits
251 
252 extern __at(0x0EBA) __sfr PMDIS1;
253 
254 typedef union
255   {
256   struct
257     {
258     unsigned                    : 1;
259     unsigned TMR1MD             : 1;
260     unsigned TMR2MD             : 1;
261     unsigned TMR3MD             : 1;
262     unsigned TMR4MD             : 1;
263     unsigned RTCCMD             : 1;
264     unsigned CTMUMD             : 1;
265     unsigned                    : 1;
266     };
267 
268   struct
269     {
270     unsigned                    : 1;
271     unsigned PMDTMR1            : 1;
272     unsigned PMDTMR2            : 1;
273     unsigned PMDTMR3            : 1;
274     unsigned PMDTMR4            : 1;
275     unsigned PMDRTCC            : 1;
276     unsigned PMDCTMU            : 1;
277     unsigned                    : 1;
278     };
279   } __PMDIS1bits_t;
280 
281 extern __at(0x0EBA) volatile __PMDIS1bits_t PMDIS1bits;
282 
283 #define _PMDIS1_TMR1MD          0x02
284 #define _PMDIS1_PMDTMR1         0x02
285 #define _PMDIS1_TMR2MD          0x04
286 #define _PMDIS1_PMDTMR2         0x04
287 #define _PMDIS1_TMR3MD          0x08
288 #define _PMDIS1_PMDTMR3         0x08
289 #define _PMDIS1_TMR4MD          0x10
290 #define _PMDIS1_PMDTMR4         0x10
291 #define _PMDIS1_RTCCMD          0x20
292 #define _PMDIS1_PMDRTCC         0x20
293 #define _PMDIS1_CTMUMD          0x40
294 #define _PMDIS1_PMDCTMU         0x40
295 
296 //==============================================================================
297 
298 
299 //==============================================================================
300 //        PD2 Bits
301 
302 extern __at(0x0EBB) __sfr PD2;
303 
304 typedef union
305   {
306   struct
307     {
308     unsigned CMP1MD             : 1;
309     unsigned CMP2MD             : 1;
310     unsigned CMP3MD             : 1;
311     unsigned TMR5MD             : 1;
312     unsigned TMR6MD             : 1;
313     unsigned                    : 1;
314     unsigned TMR8MD             : 1;
315     unsigned                    : 1;
316     };
317 
318   struct
319     {
320     unsigned PMDCMP1            : 1;
321     unsigned PMDCMP2            : 1;
322     unsigned PMDCMP3            : 1;
323     unsigned PMDTMR5            : 1;
324     unsigned PMDTMR6            : 1;
325     unsigned                    : 1;
326     unsigned PMDTMR8            : 1;
327     unsigned                    : 1;
328     };
329   } __PD2bits_t;
330 
331 extern __at(0x0EBB) volatile __PD2bits_t PD2bits;
332 
333 #define _CMP1MD                 0x01
334 #define _PMDCMP1                0x01
335 #define _CMP2MD                 0x02
336 #define _PMDCMP2                0x02
337 #define _CMP3MD                 0x04
338 #define _PMDCMP3                0x04
339 #define _TMR5MD                 0x08
340 #define _PMDTMR5                0x08
341 #define _TMR6MD                 0x10
342 #define _PMDTMR6                0x10
343 #define _TMR8MD                 0x40
344 #define _PMDTMR8                0x40
345 
346 //==============================================================================
347 
348 
349 //==============================================================================
350 //        PMDIS2 Bits
351 
352 extern __at(0x0EBB) __sfr PMDIS2;
353 
354 typedef union
355   {
356   struct
357     {
358     unsigned CMP1MD             : 1;
359     unsigned CMP2MD             : 1;
360     unsigned CMP3MD             : 1;
361     unsigned TMR5MD             : 1;
362     unsigned TMR6MD             : 1;
363     unsigned                    : 1;
364     unsigned TMR8MD             : 1;
365     unsigned                    : 1;
366     };
367 
368   struct
369     {
370     unsigned PMDCMP1            : 1;
371     unsigned PMDCMP2            : 1;
372     unsigned PMDCMP3            : 1;
373     unsigned PMDTMR5            : 1;
374     unsigned PMDTMR6            : 1;
375     unsigned                    : 1;
376     unsigned PMDTMR8            : 1;
377     unsigned                    : 1;
378     };
379   } __PMDIS2bits_t;
380 
381 extern __at(0x0EBB) volatile __PMDIS2bits_t PMDIS2bits;
382 
383 #define _PMDIS2_CMP1MD          0x01
384 #define _PMDIS2_PMDCMP1         0x01
385 #define _PMDIS2_CMP2MD          0x02
386 #define _PMDIS2_PMDCMP2         0x02
387 #define _PMDIS2_CMP3MD          0x04
388 #define _PMDIS2_PMDCMP3         0x04
389 #define _PMDIS2_TMR5MD          0x08
390 #define _PMDIS2_PMDTMR5         0x08
391 #define _PMDIS2_TMR6MD          0x10
392 #define _PMDIS2_PMDTMR6         0x10
393 #define _PMDIS2_TMR8MD          0x40
394 #define _PMDIS2_PMDTMR8         0x40
395 
396 //==============================================================================
397 
398 
399 //==============================================================================
400 //        PD3 Bits
401 
402 extern __at(0x0EBC) __sfr PD3;
403 
404 typedef union
405   {
406   struct
407     {
408     unsigned                    : 1;
409     unsigned CCP4MD             : 1;
410     unsigned CCP5MD             : 1;
411     unsigned CCP6MD             : 1;
412     unsigned CCP7MD             : 1;
413     unsigned CCP8MD             : 1;
414     unsigned CCP9MD             : 1;
415     unsigned CCP10MD            : 1;
416     };
417 
418   struct
419     {
420     unsigned                    : 1;
421     unsigned PMDCCP4            : 1;
422     unsigned PMDCCP5            : 1;
423     unsigned PMDCCP6            : 1;
424     unsigned PMDCCP7            : 1;
425     unsigned PMDCCP8            : 1;
426     unsigned PMDCCP9            : 1;
427     unsigned PMDCCP10           : 1;
428     };
429   } __PD3bits_t;
430 
431 extern __at(0x0EBC) volatile __PD3bits_t PD3bits;
432 
433 #define _CCP4MD                 0x02
434 #define _PMDCCP4                0x02
435 #define _CCP5MD                 0x04
436 #define _PMDCCP5                0x04
437 #define _CCP6MD                 0x08
438 #define _PMDCCP6                0x08
439 #define _CCP7MD                 0x10
440 #define _PMDCCP7                0x10
441 #define _CCP8MD                 0x20
442 #define _PMDCCP8                0x20
443 #define _CCP9MD                 0x40
444 #define _PMDCCP9                0x40
445 #define _CCP10MD                0x80
446 #define _PMDCCP10               0x80
447 
448 //==============================================================================
449 
450 
451 //==============================================================================
452 //        PMDIS3 Bits
453 
454 extern __at(0x0EBC) __sfr PMDIS3;
455 
456 typedef union
457   {
458   struct
459     {
460     unsigned                    : 1;
461     unsigned CCP4MD             : 1;
462     unsigned CCP5MD             : 1;
463     unsigned CCP6MD             : 1;
464     unsigned CCP7MD             : 1;
465     unsigned CCP8MD             : 1;
466     unsigned CCP9MD             : 1;
467     unsigned CCP10MD            : 1;
468     };
469 
470   struct
471     {
472     unsigned                    : 1;
473     unsigned PMDCCP4            : 1;
474     unsigned PMDCCP5            : 1;
475     unsigned PMDCCP6            : 1;
476     unsigned PMDCCP7            : 1;
477     unsigned PMDCCP8            : 1;
478     unsigned PMDCCP9            : 1;
479     unsigned PMDCCP10           : 1;
480     };
481   } __PMDIS3bits_t;
482 
483 extern __at(0x0EBC) volatile __PMDIS3bits_t PMDIS3bits;
484 
485 #define _PMDIS3_CCP4MD          0x02
486 #define _PMDIS3_PMDCCP4         0x02
487 #define _PMDIS3_CCP5MD          0x04
488 #define _PMDIS3_PMDCCP5         0x04
489 #define _PMDIS3_CCP6MD          0x08
490 #define _PMDIS3_PMDCCP6         0x08
491 #define _PMDIS3_CCP7MD          0x10
492 #define _PMDIS3_PMDCCP7         0x10
493 #define _PMDIS3_CCP8MD          0x20
494 #define _PMDIS3_PMDCCP8         0x20
495 #define _PMDIS3_CCP9MD          0x40
496 #define _PMDIS3_PMDCCP9         0x40
497 #define _PMDIS3_CCP10MD         0x80
498 #define _PMDIS3_PMDCCP10        0x80
499 
500 //==============================================================================
501 
502 
503 //==============================================================================
504 //        PPSCON Bits
505 
506 extern __at(0x0EBF) __sfr PPSCON;
507 
508 typedef struct
509   {
510   unsigned IOLOCK               : 1;
511   unsigned                      : 1;
512   unsigned                      : 1;
513   unsigned                      : 1;
514   unsigned                      : 1;
515   unsigned                      : 1;
516   unsigned                      : 1;
517   unsigned                      : 1;
518   } __PPSCONbits_t;
519 
520 extern __at(0x0EBF) volatile __PPSCONbits_t PPSCONbits;
521 
522 #define _IOLOCK                 0x01
523 
524 //==============================================================================
525 
526 extern __at(0x0EC0) __sfr RPOR0;
527 extern __at(0x0EC1) __sfr RPOR1;
528 extern __at(0x0EC2) __sfr RPOR2;
529 extern __at(0x0EC3) __sfr RPOR3;
530 extern __at(0x0EC4) __sfr RPOR4;
531 extern __at(0x0EC5) __sfr RPOR5;
532 extern __at(0x0EC6) __sfr RPOR6;
533 extern __at(0x0EC7) __sfr RPOR7;
534 extern __at(0x0EC8) __sfr RPOR8;
535 extern __at(0x0EC9) __sfr RPOR9;
536 extern __at(0x0ECA) __sfr RPOR10;
537 extern __at(0x0ECB) __sfr RPOR11;
538 extern __at(0x0ECC) __sfr RPOR12;
539 extern __at(0x0ECD) __sfr RPOR13;
540 extern __at(0x0ED1) __sfr RPOR17;
541 extern __at(0x0ED2) __sfr RPOR18;
542 extern __at(0x0EE1) __sfr RPINR1;
543 extern __at(0x0EE2) __sfr RPINR2;
544 extern __at(0x0EE3) __sfr RPINR3;
545 extern __at(0x0EE4) __sfr RPINR4;
546 extern __at(0x0EE6) __sfr RPINR6;
547 extern __at(0x0EE7) __sfr RPINR15;
548 extern __at(0x0EE8) __sfr RPINR7;
549 extern __at(0x0EE9) __sfr RPINR8;
550 extern __at(0x0EEA) __sfr RPINR9;
551 extern __at(0x0EF2) __sfr RPINR12;
552 extern __at(0x0EF3) __sfr RPINR13;
553 extern __at(0x0EF4) __sfr RPINR14;
554 extern __at(0x0EF7) __sfr RPINR16;
555 extern __at(0x0EF8) __sfr RPINR17;
556 extern __at(0x0EFC) __sfr RPINR21;
557 extern __at(0x0EFD) __sfr RPINR22;
558 extern __at(0x0EFE) __sfr RPINR23;
559 extern __at(0x0EFF) __sfr RPINR24;
560 
561 //==============================================================================
562 //        CCP10CON Bits
563 
564 extern __at(0x0F00) __sfr CCP10CON;
565 
566 typedef union
567   {
568   struct
569     {
570     unsigned CCP10M0            : 1;
571     unsigned CCP10M1            : 1;
572     unsigned CCP10M2            : 1;
573     unsigned CCP10M3            : 1;
574     unsigned DC10B0             : 1;
575     unsigned DC10B1             : 1;
576     unsigned                    : 1;
577     unsigned                    : 1;
578     };
579 
580   struct
581     {
582     unsigned CCP10M             : 4;
583     unsigned                    : 4;
584     };
585 
586   struct
587     {
588     unsigned                    : 4;
589     unsigned DC10B              : 2;
590     unsigned                    : 2;
591     };
592   } __CCP10CONbits_t;
593 
594 extern __at(0x0F00) volatile __CCP10CONbits_t CCP10CONbits;
595 
596 #define _CCP10M0                0x01
597 #define _CCP10M1                0x02
598 #define _CCP10M2                0x04
599 #define _CCP10M3                0x08
600 #define _DC10B0                 0x10
601 #define _DC10B1                 0x20
602 
603 //==============================================================================
604 
605 extern __at(0x0F01) __sfr CCPR10L;
606 extern __at(0x0F02) __sfr CCPR10H;
607 
608 //==============================================================================
609 //        CCP9CON Bits
610 
611 extern __at(0x0F03) __sfr CCP9CON;
612 
613 typedef union
614   {
615   struct
616     {
617     unsigned CCP9M0             : 1;
618     unsigned CCP9M1             : 1;
619     unsigned CCP9M2             : 1;
620     unsigned CCP9M3             : 1;
621     unsigned DC9B0              : 1;
622     unsigned DC9B1              : 1;
623     unsigned                    : 1;
624     unsigned                    : 1;
625     };
626 
627   struct
628     {
629     unsigned CCP9M              : 4;
630     unsigned                    : 4;
631     };
632 
633   struct
634     {
635     unsigned                    : 4;
636     unsigned DC9B               : 2;
637     unsigned                    : 2;
638     };
639   } __CCP9CONbits_t;
640 
641 extern __at(0x0F03) volatile __CCP9CONbits_t CCP9CONbits;
642 
643 #define _CCP9M0                 0x01
644 #define _CCP9M1                 0x02
645 #define _CCP9M2                 0x04
646 #define _CCP9M3                 0x08
647 #define _DC9B0                  0x10
648 #define _DC9B1                  0x20
649 
650 //==============================================================================
651 
652 extern __at(0x0F04) __sfr CCPR9L;
653 extern __at(0x0F05) __sfr CCPR9H;
654 
655 //==============================================================================
656 //        CCP8CON Bits
657 
658 extern __at(0x0F06) __sfr CCP8CON;
659 
660 typedef union
661   {
662   struct
663     {
664     unsigned CCP8M0             : 1;
665     unsigned CCP8M1             : 1;
666     unsigned CCP8M2             : 1;
667     unsigned CCP8M3             : 1;
668     unsigned DC8B0              : 1;
669     unsigned DC8B1              : 1;
670     unsigned                    : 1;
671     unsigned                    : 1;
672     };
673 
674   struct
675     {
676     unsigned CCP8M              : 4;
677     unsigned                    : 4;
678     };
679 
680   struct
681     {
682     unsigned                    : 4;
683     unsigned DC8B               : 2;
684     unsigned                    : 2;
685     };
686   } __CCP8CONbits_t;
687 
688 extern __at(0x0F06) volatile __CCP8CONbits_t CCP8CONbits;
689 
690 #define _CCP8M0                 0x01
691 #define _CCP8M1                 0x02
692 #define _CCP8M2                 0x04
693 #define _CCP8M3                 0x08
694 #define _DC8B0                  0x10
695 #define _DC8B1                  0x20
696 
697 //==============================================================================
698 
699 extern __at(0x0F07) __sfr CCPR8L;
700 extern __at(0x0F08) __sfr CCPR8H;
701 
702 //==============================================================================
703 //        CCP7CON Bits
704 
705 extern __at(0x0F09) __sfr CCP7CON;
706 
707 typedef union
708   {
709   struct
710     {
711     unsigned CCP7M0             : 1;
712     unsigned CCP7M1             : 1;
713     unsigned CCP7M2             : 1;
714     unsigned CCP7M3             : 1;
715     unsigned DC7B0              : 1;
716     unsigned DC7B1              : 1;
717     unsigned                    : 1;
718     unsigned                    : 1;
719     };
720 
721   struct
722     {
723     unsigned CCP7M              : 4;
724     unsigned                    : 4;
725     };
726 
727   struct
728     {
729     unsigned                    : 4;
730     unsigned DC7B               : 2;
731     unsigned                    : 2;
732     };
733   } __CCP7CONbits_t;
734 
735 extern __at(0x0F09) volatile __CCP7CONbits_t CCP7CONbits;
736 
737 #define _CCP7M0                 0x01
738 #define _CCP7M1                 0x02
739 #define _CCP7M2                 0x04
740 #define _CCP7M3                 0x08
741 #define _DC7B0                  0x10
742 #define _DC7B1                  0x20
743 
744 //==============================================================================
745 
746 extern __at(0x0F0A) __sfr CCPR7L;
747 extern __at(0x0F0B) __sfr CCPR7H;
748 
749 //==============================================================================
750 //        CCP6CON Bits
751 
752 extern __at(0x0F0C) __sfr CCP6CON;
753 
754 typedef union
755   {
756   struct
757     {
758     unsigned CCP6M0             : 1;
759     unsigned CCP6M1             : 1;
760     unsigned CCP6M2             : 1;
761     unsigned CCP6M3             : 1;
762     unsigned DC6B0              : 1;
763     unsigned DC6B1              : 1;
764     unsigned                    : 1;
765     unsigned                    : 1;
766     };
767 
768   struct
769     {
770     unsigned CCP6M              : 4;
771     unsigned                    : 4;
772     };
773 
774   struct
775     {
776     unsigned                    : 4;
777     unsigned DC6B               : 2;
778     unsigned                    : 2;
779     };
780   } __CCP6CONbits_t;
781 
782 extern __at(0x0F0C) volatile __CCP6CONbits_t CCP6CONbits;
783 
784 #define _CCP6M0                 0x01
785 #define _CCP6M1                 0x02
786 #define _CCP6M2                 0x04
787 #define _CCP6M3                 0x08
788 #define _DC6B0                  0x10
789 #define _DC6B1                  0x20
790 
791 //==============================================================================
792 
793 extern __at(0x0F0D) __sfr CCPR6L;
794 extern __at(0x0F0E) __sfr CCPR6H;
795 
796 //==============================================================================
797 //        CCP5CON Bits
798 
799 extern __at(0x0F0F) __sfr CCP5CON;
800 
801 typedef union
802   {
803   struct
804     {
805     unsigned CCP5M0             : 1;
806     unsigned CCP5M1             : 1;
807     unsigned CCP5M2             : 1;
808     unsigned CCP5M3             : 1;
809     unsigned DC5B0              : 1;
810     unsigned DC5B1              : 1;
811     unsigned                    : 1;
812     unsigned                    : 1;
813     };
814 
815   struct
816     {
817     unsigned CCP5M              : 4;
818     unsigned                    : 4;
819     };
820 
821   struct
822     {
823     unsigned                    : 4;
824     unsigned DC5B               : 2;
825     unsigned                    : 2;
826     };
827   } __CCP5CONbits_t;
828 
829 extern __at(0x0F0F) volatile __CCP5CONbits_t CCP5CONbits;
830 
831 #define _CCP5M0                 0x01
832 #define _CCP5M1                 0x02
833 #define _CCP5M2                 0x04
834 #define _CCP5M3                 0x08
835 #define _DC5B0                  0x10
836 #define _DC5B1                  0x20
837 
838 //==============================================================================
839 
840 extern __at(0x0F10) __sfr CCPR5L;
841 extern __at(0x0F11) __sfr CCPR5H;
842 
843 //==============================================================================
844 //        CCP4CON Bits
845 
846 extern __at(0x0F12) __sfr CCP4CON;
847 
848 typedef union
849   {
850   struct
851     {
852     unsigned CCP4M0             : 1;
853     unsigned CCP4M1             : 1;
854     unsigned CCP4M2             : 1;
855     unsigned CCP4M3             : 1;
856     unsigned DC4B0              : 1;
857     unsigned DC4B1              : 1;
858     unsigned                    : 1;
859     unsigned                    : 1;
860     };
861 
862   struct
863     {
864     unsigned CCP4M              : 4;
865     unsigned                    : 4;
866     };
867 
868   struct
869     {
870     unsigned                    : 4;
871     unsigned DC4B               : 2;
872     unsigned                    : 2;
873     };
874   } __CCP4CONbits_t;
875 
876 extern __at(0x0F12) volatile __CCP4CONbits_t CCP4CONbits;
877 
878 #define _CCP4M0                 0x01
879 #define _CCP4M1                 0x02
880 #define _CCP4M2                 0x04
881 #define _CCP4M3                 0x08
882 #define _DC4B0                  0x10
883 #define _DC4B1                  0x20
884 
885 //==============================================================================
886 
887 extern __at(0x0F13) __sfr CCPR4L;
888 extern __at(0x0F14) __sfr CCPR4H;
889 
890 //==============================================================================
891 //        CCP3CON Bits
892 
893 extern __at(0x0F15) __sfr CCP3CON;
894 
895 typedef union
896   {
897   struct
898     {
899     unsigned CCP3M0             : 1;
900     unsigned CCP3M1             : 1;
901     unsigned CCP3M2             : 1;
902     unsigned CCP3M3             : 1;
903     unsigned DC3B0              : 1;
904     unsigned DC3B1              : 1;
905     unsigned P3M0               : 1;
906     unsigned P3M1               : 1;
907     };
908 
909   struct
910     {
911     unsigned CCP3M              : 4;
912     unsigned                    : 4;
913     };
914 
915   struct
916     {
917     unsigned                    : 4;
918     unsigned DC3B               : 2;
919     unsigned                    : 2;
920     };
921 
922   struct
923     {
924     unsigned                    : 6;
925     unsigned P3M                : 2;
926     };
927   } __CCP3CONbits_t;
928 
929 extern __at(0x0F15) volatile __CCP3CONbits_t CCP3CONbits;
930 
931 #define _CCP3M0                 0x01
932 #define _CCP3M1                 0x02
933 #define _CCP3M2                 0x04
934 #define _CCP3M3                 0x08
935 #define _DC3B0                  0x10
936 #define _DC3B1                  0x20
937 #define _P3M0                   0x40
938 #define _P3M1                   0x80
939 
940 //==============================================================================
941 
942 extern __at(0x0F16) __sfr CCPR3L;
943 extern __at(0x0F17) __sfr CCPR3H;
944 
945 //==============================================================================
946 //        ECCP3DEL Bits
947 
948 extern __at(0x0F18) __sfr ECCP3DEL;
949 
950 typedef union
951   {
952   struct
953     {
954     unsigned P3DC0              : 1;
955     unsigned P3DC1              : 1;
956     unsigned P3DC2              : 1;
957     unsigned P3DC3              : 1;
958     unsigned P3DC4              : 1;
959     unsigned P3DC5              : 1;
960     unsigned P3DC6              : 1;
961     unsigned P3RSEN             : 1;
962     };
963 
964   struct
965     {
966     unsigned P3DC               : 7;
967     unsigned                    : 1;
968     };
969   } __ECCP3DELbits_t;
970 
971 extern __at(0x0F18) volatile __ECCP3DELbits_t ECCP3DELbits;
972 
973 #define _P3DC0                  0x01
974 #define _P3DC1                  0x02
975 #define _P3DC2                  0x04
976 #define _P3DC3                  0x08
977 #define _P3DC4                  0x10
978 #define _P3DC5                  0x20
979 #define _P3DC6                  0x40
980 #define _P3RSEN                 0x80
981 
982 //==============================================================================
983 
984 
985 //==============================================================================
986 //        ECCP3AS Bits
987 
988 extern __at(0x0F19) __sfr ECCP3AS;
989 
990 typedef union
991   {
992   struct
993     {
994     unsigned PSS3BD0            : 1;
995     unsigned PSS3BD1            : 1;
996     unsigned PSS3AC0            : 1;
997     unsigned PSS3AC1            : 1;
998     unsigned ECCP3AS0           : 1;
999     unsigned ECCP3AS1           : 1;
1000     unsigned ECCP3AS2           : 1;
1001     unsigned ECCP3ASE           : 1;
1002     };
1003 
1004   struct
1005     {
1006     unsigned PSS3BD             : 2;
1007     unsigned                    : 6;
1008     };
1009 
1010   struct
1011     {
1012     unsigned                    : 2;
1013     unsigned PSS3AC             : 2;
1014     unsigned                    : 4;
1015     };
1016 
1017   struct
1018     {
1019     unsigned                    : 4;
1020     unsigned ECCP3AS            : 3;
1021     unsigned                    : 1;
1022     };
1023   } __ECCP3ASbits_t;
1024 
1025 extern __at(0x0F19) volatile __ECCP3ASbits_t ECCP3ASbits;
1026 
1027 #define _PSS3BD0                0x01
1028 #define _PSS3BD1                0x02
1029 #define _PSS3AC0                0x04
1030 #define _PSS3AC1                0x08
1031 #define _ECCP3AS0               0x10
1032 #define _ECCP3AS1               0x20
1033 #define _ECCP3AS2               0x40
1034 #define _ECCP3ASE               0x80
1035 
1036 //==============================================================================
1037 
1038 
1039 //==============================================================================
1040 //        PSTR3CON Bits
1041 
1042 extern __at(0x0F1A) __sfr PSTR3CON;
1043 
1044 typedef union
1045   {
1046   struct
1047     {
1048     unsigned STRA               : 1;
1049     unsigned STRB               : 1;
1050     unsigned STRC               : 1;
1051     unsigned STRD               : 1;
1052     unsigned STRSYNC            : 1;
1053     unsigned                    : 1;
1054     unsigned CMPL0              : 1;
1055     unsigned CMPL1              : 1;
1056     };
1057 
1058   struct
1059     {
1060     unsigned                    : 6;
1061     unsigned CMPL               : 2;
1062     };
1063   } __PSTR3CONbits_t;
1064 
1065 extern __at(0x0F1A) volatile __PSTR3CONbits_t PSTR3CONbits;
1066 
1067 #define _PSTR3CON_STRA          0x01
1068 #define _PSTR3CON_STRB          0x02
1069 #define _PSTR3CON_STRC          0x04
1070 #define _PSTR3CON_STRD          0x08
1071 #define _PSTR3CON_STRSYNC       0x10
1072 #define _PSTR3CON_CMPL0         0x40
1073 #define _PSTR3CON_CMPL1         0x80
1074 
1075 //==============================================================================
1076 
1077 
1078 //==============================================================================
1079 //        T8CON Bits
1080 
1081 extern __at(0x0F1B) __sfr T8CON;
1082 
1083 typedef union
1084   {
1085   struct
1086     {
1087     unsigned T8CKPS0            : 1;
1088     unsigned T8CKPS1            : 1;
1089     unsigned TMR8ON             : 1;
1090     unsigned T8OUTPS0           : 1;
1091     unsigned T8OUTPS1           : 1;
1092     unsigned T8OUTPS2           : 1;
1093     unsigned T8OUTPS3           : 1;
1094     unsigned                    : 1;
1095     };
1096 
1097   struct
1098     {
1099     unsigned T8CKPS             : 2;
1100     unsigned                    : 6;
1101     };
1102 
1103   struct
1104     {
1105     unsigned                    : 3;
1106     unsigned T8OUTPS            : 4;
1107     unsigned                    : 1;
1108     };
1109   } __T8CONbits_t;
1110 
1111 extern __at(0x0F1B) volatile __T8CONbits_t T8CONbits;
1112 
1113 #define _T8CKPS0                0x01
1114 #define _T8CKPS1                0x02
1115 #define _TMR8ON                 0x04
1116 #define _T8OUTPS0               0x08
1117 #define _T8OUTPS1               0x10
1118 #define _T8OUTPS2               0x20
1119 #define _T8OUTPS3               0x40
1120 
1121 //==============================================================================
1122 
1123 extern __at(0x0F1C) __sfr PR8;
1124 extern __at(0x0F1D) __sfr TMR8;
1125 
1126 //==============================================================================
1127 //        T6CON Bits
1128 
1129 extern __at(0x0F1E) __sfr T6CON;
1130 
1131 typedef union
1132   {
1133   struct
1134     {
1135     unsigned T6CKPS0            : 1;
1136     unsigned T6CKPS1            : 1;
1137     unsigned TMR6ON             : 1;
1138     unsigned T6OUTPS0           : 1;
1139     unsigned T6OUTPS1           : 1;
1140     unsigned T6OUTPS2           : 1;
1141     unsigned T6OUTPS3           : 1;
1142     unsigned                    : 1;
1143     };
1144 
1145   struct
1146     {
1147     unsigned T6CKPS             : 2;
1148     unsigned                    : 6;
1149     };
1150 
1151   struct
1152     {
1153     unsigned                    : 3;
1154     unsigned T6OUTPS            : 4;
1155     unsigned                    : 1;
1156     };
1157   } __T6CONbits_t;
1158 
1159 extern __at(0x0F1E) volatile __T6CONbits_t T6CONbits;
1160 
1161 #define _T6CKPS0                0x01
1162 #define _T6CKPS1                0x02
1163 #define _TMR6ON                 0x04
1164 #define _T6OUTPS0               0x08
1165 #define _T6OUTPS1               0x10
1166 #define _T6OUTPS2               0x20
1167 #define _T6OUTPS3               0x40
1168 
1169 //==============================================================================
1170 
1171 extern __at(0x0F1F) __sfr PR6;
1172 extern __at(0x0F20) __sfr TMR6;
1173 
1174 //==============================================================================
1175 //        T5GCON Bits
1176 
1177 extern __at(0x0F21) __sfr T5GCON;
1178 
1179 typedef union
1180   {
1181   struct
1182     {
1183     unsigned T5GSS0             : 1;
1184     unsigned T5GSS1             : 1;
1185     unsigned T5GVAL             : 1;
1186     unsigned T5GGO_NOT_T5DONE   : 1;
1187     unsigned T5GSPM             : 1;
1188     unsigned T5GTM              : 1;
1189     unsigned T5GPOL             : 1;
1190     unsigned TMR5GE             : 1;
1191     };
1192 
1193   struct
1194     {
1195     unsigned                    : 1;
1196     unsigned                    : 1;
1197     unsigned                    : 1;
1198     unsigned T5GGO              : 1;
1199     unsigned                    : 1;
1200     unsigned                    : 1;
1201     unsigned                    : 1;
1202     unsigned                    : 1;
1203     };
1204 
1205   struct
1206     {
1207     unsigned                    : 1;
1208     unsigned                    : 1;
1209     unsigned                    : 1;
1210     unsigned NOT_T5DONE         : 1;
1211     unsigned                    : 1;
1212     unsigned                    : 1;
1213     unsigned                    : 1;
1214     unsigned                    : 1;
1215     };
1216 
1217   struct
1218     {
1219     unsigned                    : 1;
1220     unsigned                    : 1;
1221     unsigned                    : 1;
1222     unsigned T5DONE             : 1;
1223     unsigned                    : 1;
1224     unsigned                    : 1;
1225     unsigned                    : 1;
1226     unsigned                    : 1;
1227     };
1228 
1229   struct
1230     {
1231     unsigned T5GSS              : 2;
1232     unsigned                    : 6;
1233     };
1234   } __T5GCONbits_t;
1235 
1236 extern __at(0x0F21) volatile __T5GCONbits_t T5GCONbits;
1237 
1238 #define _T5GSS0                 0x01
1239 #define _T5GSS1                 0x02
1240 #define _T5GVAL                 0x04
1241 #define _T5GGO_NOT_T5DONE       0x08
1242 #define _T5GGO                  0x08
1243 #define _NOT_T5DONE             0x08
1244 #define _T5DONE                 0x08
1245 #define _T5GSPM                 0x10
1246 #define _T5GTM                  0x20
1247 #define _T5GPOL                 0x40
1248 #define _TMR5GE                 0x80
1249 
1250 //==============================================================================
1251 
1252 
1253 //==============================================================================
1254 //        T5CON Bits
1255 
1256 extern __at(0x0F22) __sfr T5CON;
1257 
1258 typedef union
1259   {
1260   struct
1261     {
1262     unsigned TMR5ON             : 1;
1263     unsigned RD16               : 1;
1264     unsigned NOT_T5SYNC         : 1;
1265     unsigned T5OSCEN            : 1;
1266     unsigned T5CKPS0            : 1;
1267     unsigned T5CKPS1            : 1;
1268     unsigned TMR5CS0            : 1;
1269     unsigned TMR5CS1            : 1;
1270     };
1271 
1272   struct
1273     {
1274     unsigned                    : 4;
1275     unsigned T5CKPS             : 2;
1276     unsigned                    : 2;
1277     };
1278 
1279   struct
1280     {
1281     unsigned                    : 6;
1282     unsigned TMR5CS             : 2;
1283     };
1284   } __T5CONbits_t;
1285 
1286 extern __at(0x0F22) volatile __T5CONbits_t T5CONbits;
1287 
1288 #define _T5CON_TMR5ON           0x01
1289 #define _T5CON_RD16             0x02
1290 #define _T5CON_NOT_T5SYNC       0x04
1291 #define _T5CON_T5OSCEN          0x08
1292 #define _T5CON_T5CKPS0          0x10
1293 #define _T5CON_T5CKPS1          0x20
1294 #define _T5CON_TMR5CS0          0x40
1295 #define _T5CON_TMR5CS1          0x80
1296 
1297 //==============================================================================
1298 
1299 extern __at(0x0F23) __sfr TMR5L;
1300 extern __at(0x0F24) __sfr TMR5H;
1301 
1302 //==============================================================================
1303 //        CM3CON Bits
1304 
1305 extern __at(0x0F25) __sfr CM3CON;
1306 
1307 typedef union
1308   {
1309   struct
1310     {
1311     unsigned CCH0               : 1;
1312     unsigned CCH1               : 1;
1313     unsigned CREF               : 1;
1314     unsigned EVPOL0             : 1;
1315     unsigned EVPOL1             : 1;
1316     unsigned CPOL               : 1;
1317     unsigned COE                : 1;
1318     unsigned CON                : 1;
1319     };
1320 
1321   struct
1322     {
1323     unsigned CCH                : 2;
1324     unsigned                    : 6;
1325     };
1326 
1327   struct
1328     {
1329     unsigned                    : 3;
1330     unsigned EVPOL              : 2;
1331     unsigned                    : 3;
1332     };
1333   } __CM3CONbits_t;
1334 
1335 extern __at(0x0F25) volatile __CM3CONbits_t CM3CONbits;
1336 
1337 #define _CM3CON_CCH0            0x01
1338 #define _CM3CON_CCH1            0x02
1339 #define _CM3CON_CREF            0x04
1340 #define _CM3CON_EVPOL0          0x08
1341 #define _CM3CON_EVPOL1          0x10
1342 #define _CM3CON_CPOL            0x20
1343 #define _CM3CON_COE             0x40
1344 #define _CM3CON_CON             0x80
1345 
1346 //==============================================================================
1347 
1348 
1349 //==============================================================================
1350 //        UEP0 Bits
1351 
1352 extern __at(0x0F26) __sfr UEP0;
1353 
1354 typedef struct
1355   {
1356   unsigned EPSTALL              : 1;
1357   unsigned EPINEN               : 1;
1358   unsigned EPOUTEN              : 1;
1359   unsigned EPCONDIS             : 1;
1360   unsigned EPHSHK               : 1;
1361   unsigned                      : 1;
1362   unsigned                      : 1;
1363   unsigned                      : 1;
1364   } __UEP0bits_t;
1365 
1366 extern __at(0x0F26) volatile __UEP0bits_t UEP0bits;
1367 
1368 #define _EPSTALL                0x01
1369 #define _EPINEN                 0x02
1370 #define _EPOUTEN                0x04
1371 #define _EPCONDIS               0x08
1372 #define _EPHSHK                 0x10
1373 
1374 //==============================================================================
1375 
1376 
1377 //==============================================================================
1378 //        UEP1 Bits
1379 
1380 extern __at(0x0F27) __sfr UEP1;
1381 
1382 typedef struct
1383   {
1384   unsigned EPSTALL              : 1;
1385   unsigned EPINEN               : 1;
1386   unsigned EPOUTEN              : 1;
1387   unsigned EPCONDIS             : 1;
1388   unsigned EPHSHK               : 1;
1389   unsigned                      : 1;
1390   unsigned                      : 1;
1391   unsigned                      : 1;
1392   } __UEP1bits_t;
1393 
1394 extern __at(0x0F27) volatile __UEP1bits_t UEP1bits;
1395 
1396 #define _UEP1_EPSTALL           0x01
1397 #define _UEP1_EPINEN            0x02
1398 #define _UEP1_EPOUTEN           0x04
1399 #define _UEP1_EPCONDIS          0x08
1400 #define _UEP1_EPHSHK            0x10
1401 
1402 //==============================================================================
1403 
1404 
1405 //==============================================================================
1406 //        UEP2 Bits
1407 
1408 extern __at(0x0F28) __sfr UEP2;
1409 
1410 typedef struct
1411   {
1412   unsigned EPSTALL              : 1;
1413   unsigned EPINEN               : 1;
1414   unsigned EPOUTEN              : 1;
1415   unsigned EPCONDIS             : 1;
1416   unsigned EPHSHK               : 1;
1417   unsigned                      : 1;
1418   unsigned                      : 1;
1419   unsigned                      : 1;
1420   } __UEP2bits_t;
1421 
1422 extern __at(0x0F28) volatile __UEP2bits_t UEP2bits;
1423 
1424 #define _UEP2_EPSTALL           0x01
1425 #define _UEP2_EPINEN            0x02
1426 #define _UEP2_EPOUTEN           0x04
1427 #define _UEP2_EPCONDIS          0x08
1428 #define _UEP2_EPHSHK            0x10
1429 
1430 //==============================================================================
1431 
1432 
1433 //==============================================================================
1434 //        UEP3 Bits
1435 
1436 extern __at(0x0F29) __sfr UEP3;
1437 
1438 typedef struct
1439   {
1440   unsigned EPSTALL              : 1;
1441   unsigned EPINEN               : 1;
1442   unsigned EPOUTEN              : 1;
1443   unsigned EPCONDIS             : 1;
1444   unsigned EPHSHK               : 1;
1445   unsigned                      : 1;
1446   unsigned                      : 1;
1447   unsigned                      : 1;
1448   } __UEP3bits_t;
1449 
1450 extern __at(0x0F29) volatile __UEP3bits_t UEP3bits;
1451 
1452 #define _UEP3_EPSTALL           0x01
1453 #define _UEP3_EPINEN            0x02
1454 #define _UEP3_EPOUTEN           0x04
1455 #define _UEP3_EPCONDIS          0x08
1456 #define _UEP3_EPHSHK            0x10
1457 
1458 //==============================================================================
1459 
1460 
1461 //==============================================================================
1462 //        UEP4 Bits
1463 
1464 extern __at(0x0F2A) __sfr UEP4;
1465 
1466 typedef struct
1467   {
1468   unsigned EPSTALL              : 1;
1469   unsigned EPINEN               : 1;
1470   unsigned EPOUTEN              : 1;
1471   unsigned EPCONDIS             : 1;
1472   unsigned EPHSHK               : 1;
1473   unsigned                      : 1;
1474   unsigned                      : 1;
1475   unsigned                      : 1;
1476   } __UEP4bits_t;
1477 
1478 extern __at(0x0F2A) volatile __UEP4bits_t UEP4bits;
1479 
1480 #define _UEP4_EPSTALL           0x01
1481 #define _UEP4_EPINEN            0x02
1482 #define _UEP4_EPOUTEN           0x04
1483 #define _UEP4_EPCONDIS          0x08
1484 #define _UEP4_EPHSHK            0x10
1485 
1486 //==============================================================================
1487 
1488 
1489 //==============================================================================
1490 //        UEP5 Bits
1491 
1492 extern __at(0x0F2B) __sfr UEP5;
1493 
1494 typedef struct
1495   {
1496   unsigned EPSTALL              : 1;
1497   unsigned EPINEN               : 1;
1498   unsigned EPOUTEN              : 1;
1499   unsigned EPCONDIS             : 1;
1500   unsigned EPHSHK               : 1;
1501   unsigned                      : 1;
1502   unsigned                      : 1;
1503   unsigned                      : 1;
1504   } __UEP5bits_t;
1505 
1506 extern __at(0x0F2B) volatile __UEP5bits_t UEP5bits;
1507 
1508 #define _UEP5_EPSTALL           0x01
1509 #define _UEP5_EPINEN            0x02
1510 #define _UEP5_EPOUTEN           0x04
1511 #define _UEP5_EPCONDIS          0x08
1512 #define _UEP5_EPHSHK            0x10
1513 
1514 //==============================================================================
1515 
1516 
1517 //==============================================================================
1518 //        UEP6 Bits
1519 
1520 extern __at(0x0F2C) __sfr UEP6;
1521 
1522 typedef struct
1523   {
1524   unsigned EPSTALL              : 1;
1525   unsigned EPINEN               : 1;
1526   unsigned EPOUTEN              : 1;
1527   unsigned EPCONDIS             : 1;
1528   unsigned EPHSHK               : 1;
1529   unsigned                      : 1;
1530   unsigned                      : 1;
1531   unsigned                      : 1;
1532   } __UEP6bits_t;
1533 
1534 extern __at(0x0F2C) volatile __UEP6bits_t UEP6bits;
1535 
1536 #define _UEP6_EPSTALL           0x01
1537 #define _UEP6_EPINEN            0x02
1538 #define _UEP6_EPOUTEN           0x04
1539 #define _UEP6_EPCONDIS          0x08
1540 #define _UEP6_EPHSHK            0x10
1541 
1542 //==============================================================================
1543 
1544 
1545 //==============================================================================
1546 //        UEP7 Bits
1547 
1548 extern __at(0x0F2D) __sfr UEP7;
1549 
1550 typedef struct
1551   {
1552   unsigned EPSTALL              : 1;
1553   unsigned EPINEN               : 1;
1554   unsigned EPOUTEN              : 1;
1555   unsigned EPCONDIS             : 1;
1556   unsigned EPHSHK               : 1;
1557   unsigned                      : 1;
1558   unsigned                      : 1;
1559   unsigned                      : 1;
1560   } __UEP7bits_t;
1561 
1562 extern __at(0x0F2D) volatile __UEP7bits_t UEP7bits;
1563 
1564 #define _UEP7_EPSTALL           0x01
1565 #define _UEP7_EPINEN            0x02
1566 #define _UEP7_EPOUTEN           0x04
1567 #define _UEP7_EPCONDIS          0x08
1568 #define _UEP7_EPHSHK            0x10
1569 
1570 //==============================================================================
1571 
1572 
1573 //==============================================================================
1574 //        UEP8 Bits
1575 
1576 extern __at(0x0F2E) __sfr UEP8;
1577 
1578 typedef struct
1579   {
1580   unsigned EPSTALL              : 1;
1581   unsigned EPINEN               : 1;
1582   unsigned EPOUTEN              : 1;
1583   unsigned EPCONDIS             : 1;
1584   unsigned EPHSHK               : 1;
1585   unsigned                      : 1;
1586   unsigned                      : 1;
1587   unsigned                      : 1;
1588   } __UEP8bits_t;
1589 
1590 extern __at(0x0F2E) volatile __UEP8bits_t UEP8bits;
1591 
1592 #define _UEP8_EPSTALL           0x01
1593 #define _UEP8_EPINEN            0x02
1594 #define _UEP8_EPOUTEN           0x04
1595 #define _UEP8_EPCONDIS          0x08
1596 #define _UEP8_EPHSHK            0x10
1597 
1598 //==============================================================================
1599 
1600 
1601 //==============================================================================
1602 //        UEP9 Bits
1603 
1604 extern __at(0x0F2F) __sfr UEP9;
1605 
1606 typedef struct
1607   {
1608   unsigned EPSTALL              : 1;
1609   unsigned EPINEN               : 1;
1610   unsigned EPOUTEN              : 1;
1611   unsigned EPCONDIS             : 1;
1612   unsigned EPHSHK               : 1;
1613   unsigned                      : 1;
1614   unsigned                      : 1;
1615   unsigned                      : 1;
1616   } __UEP9bits_t;
1617 
1618 extern __at(0x0F2F) volatile __UEP9bits_t UEP9bits;
1619 
1620 #define _UEP9_EPSTALL           0x01
1621 #define _UEP9_EPINEN            0x02
1622 #define _UEP9_EPOUTEN           0x04
1623 #define _UEP9_EPCONDIS          0x08
1624 #define _UEP9_EPHSHK            0x10
1625 
1626 //==============================================================================
1627 
1628 
1629 //==============================================================================
1630 //        UEP10 Bits
1631 
1632 extern __at(0x0F30) __sfr UEP10;
1633 
1634 typedef struct
1635   {
1636   unsigned EPSTALL              : 1;
1637   unsigned EPINEN               : 1;
1638   unsigned EPOUTEN              : 1;
1639   unsigned EPCONDIS             : 1;
1640   unsigned EPHSHK               : 1;
1641   unsigned                      : 1;
1642   unsigned                      : 1;
1643   unsigned                      : 1;
1644   } __UEP10bits_t;
1645 
1646 extern __at(0x0F30) volatile __UEP10bits_t UEP10bits;
1647 
1648 #define _UEP10_EPSTALL          0x01
1649 #define _UEP10_EPINEN           0x02
1650 #define _UEP10_EPOUTEN          0x04
1651 #define _UEP10_EPCONDIS         0x08
1652 #define _UEP10_EPHSHK           0x10
1653 
1654 //==============================================================================
1655 
1656 
1657 //==============================================================================
1658 //        UEP11 Bits
1659 
1660 extern __at(0x0F31) __sfr UEP11;
1661 
1662 typedef struct
1663   {
1664   unsigned EPSTALL              : 1;
1665   unsigned EPINEN               : 1;
1666   unsigned EPOUTEN              : 1;
1667   unsigned EPCONDIS             : 1;
1668   unsigned EPHSHK               : 1;
1669   unsigned                      : 1;
1670   unsigned                      : 1;
1671   unsigned                      : 1;
1672   } __UEP11bits_t;
1673 
1674 extern __at(0x0F31) volatile __UEP11bits_t UEP11bits;
1675 
1676 #define _UEP11_EPSTALL          0x01
1677 #define _UEP11_EPINEN           0x02
1678 #define _UEP11_EPOUTEN          0x04
1679 #define _UEP11_EPCONDIS         0x08
1680 #define _UEP11_EPHSHK           0x10
1681 
1682 //==============================================================================
1683 
1684 
1685 //==============================================================================
1686 //        UEP12 Bits
1687 
1688 extern __at(0x0F32) __sfr UEP12;
1689 
1690 typedef struct
1691   {
1692   unsigned EPSTALL              : 1;
1693   unsigned EPINEN               : 1;
1694   unsigned EPOUTEN              : 1;
1695   unsigned EPCONDIS             : 1;
1696   unsigned EPHSHK               : 1;
1697   unsigned                      : 1;
1698   unsigned                      : 1;
1699   unsigned                      : 1;
1700   } __UEP12bits_t;
1701 
1702 extern __at(0x0F32) volatile __UEP12bits_t UEP12bits;
1703 
1704 #define _UEP12_EPSTALL          0x01
1705 #define _UEP12_EPINEN           0x02
1706 #define _UEP12_EPOUTEN          0x04
1707 #define _UEP12_EPCONDIS         0x08
1708 #define _UEP12_EPHSHK           0x10
1709 
1710 //==============================================================================
1711 
1712 
1713 //==============================================================================
1714 //        UEP13 Bits
1715 
1716 extern __at(0x0F33) __sfr UEP13;
1717 
1718 typedef struct
1719   {
1720   unsigned EPSTALL              : 1;
1721   unsigned EPINEN               : 1;
1722   unsigned EPOUTEN              : 1;
1723   unsigned EPCONDIS             : 1;
1724   unsigned EPHSHK               : 1;
1725   unsigned                      : 1;
1726   unsigned                      : 1;
1727   unsigned                      : 1;
1728   } __UEP13bits_t;
1729 
1730 extern __at(0x0F33) volatile __UEP13bits_t UEP13bits;
1731 
1732 #define _UEP13_EPSTALL          0x01
1733 #define _UEP13_EPINEN           0x02
1734 #define _UEP13_EPOUTEN          0x04
1735 #define _UEP13_EPCONDIS         0x08
1736 #define _UEP13_EPHSHK           0x10
1737 
1738 //==============================================================================
1739 
1740 
1741 //==============================================================================
1742 //        UEP14 Bits
1743 
1744 extern __at(0x0F34) __sfr UEP14;
1745 
1746 typedef struct
1747   {
1748   unsigned EPSTALL              : 1;
1749   unsigned EPINEN               : 1;
1750   unsigned EPOUTEN              : 1;
1751   unsigned EPCONDIS             : 1;
1752   unsigned EPHSHK               : 1;
1753   unsigned                      : 1;
1754   unsigned                      : 1;
1755   unsigned                      : 1;
1756   } __UEP14bits_t;
1757 
1758 extern __at(0x0F34) volatile __UEP14bits_t UEP14bits;
1759 
1760 #define _UEP14_EPSTALL          0x01
1761 #define _UEP14_EPINEN           0x02
1762 #define _UEP14_EPOUTEN          0x04
1763 #define _UEP14_EPCONDIS         0x08
1764 #define _UEP14_EPHSHK           0x10
1765 
1766 //==============================================================================
1767 
1768 
1769 //==============================================================================
1770 //        UEP15 Bits
1771 
1772 extern __at(0x0F35) __sfr UEP15;
1773 
1774 typedef struct
1775   {
1776   unsigned EPSTALL              : 1;
1777   unsigned EPINEN               : 1;
1778   unsigned EPOUTEN              : 1;
1779   unsigned EPCONDIS             : 1;
1780   unsigned EPHSHK               : 1;
1781   unsigned                      : 1;
1782   unsigned                      : 1;
1783   unsigned                      : 1;
1784   } __UEP15bits_t;
1785 
1786 extern __at(0x0F35) volatile __UEP15bits_t UEP15bits;
1787 
1788 #define _UEP15_EPSTALL          0x01
1789 #define _UEP15_EPINEN           0x02
1790 #define _UEP15_EPOUTEN          0x04
1791 #define _UEP15_EPCONDIS         0x08
1792 #define _UEP15_EPHSHK           0x10
1793 
1794 //==============================================================================
1795 
1796 
1797 //==============================================================================
1798 //        UIE Bits
1799 
1800 extern __at(0x0F36) __sfr UIE;
1801 
1802 typedef struct
1803   {
1804   unsigned URSTIE               : 1;
1805   unsigned UERRIE               : 1;
1806   unsigned ACTVIE               : 1;
1807   unsigned TRNIE                : 1;
1808   unsigned IDLEIE               : 1;
1809   unsigned STALLIE              : 1;
1810   unsigned SOFIE                : 1;
1811   unsigned                      : 1;
1812   } __UIEbits_t;
1813 
1814 extern __at(0x0F36) volatile __UIEbits_t UIEbits;
1815 
1816 #define _URSTIE                 0x01
1817 #define _UERRIE                 0x02
1818 #define _ACTVIE                 0x04
1819 #define _TRNIE                  0x08
1820 #define _IDLEIE                 0x10
1821 #define _STALLIE                0x20
1822 #define _SOFIE                  0x40
1823 
1824 //==============================================================================
1825 
1826 
1827 //==============================================================================
1828 //        UEIE Bits
1829 
1830 extern __at(0x0F37) __sfr UEIE;
1831 
1832 typedef struct
1833   {
1834   unsigned PIDEE                : 1;
1835   unsigned CRC5EE               : 1;
1836   unsigned CRC16EE              : 1;
1837   unsigned DFN8EE               : 1;
1838   unsigned BTOEE                : 1;
1839   unsigned                      : 1;
1840   unsigned                      : 1;
1841   unsigned BTSEE                : 1;
1842   } __UEIEbits_t;
1843 
1844 extern __at(0x0F37) volatile __UEIEbits_t UEIEbits;
1845 
1846 #define _PIDEE                  0x01
1847 #define _CRC5EE                 0x02
1848 #define _CRC16EE                0x04
1849 #define _DFN8EE                 0x08
1850 #define _BTOEE                  0x10
1851 #define _BTSEE                  0x80
1852 
1853 //==============================================================================
1854 
1855 
1856 //==============================================================================
1857 //        UADDR Bits
1858 
1859 extern __at(0x0F38) __sfr UADDR;
1860 
1861 typedef union
1862   {
1863   struct
1864     {
1865     unsigned ADDR0              : 1;
1866     unsigned ADDR1              : 1;
1867     unsigned ADDR2              : 1;
1868     unsigned ADDR3              : 1;
1869     unsigned ADDR4              : 1;
1870     unsigned ADDR5              : 1;
1871     unsigned ADDR6              : 1;
1872     unsigned                    : 1;
1873     };
1874 
1875   struct
1876     {
1877     unsigned ADDR               : 7;
1878     unsigned                    : 1;
1879     };
1880   } __UADDRbits_t;
1881 
1882 extern __at(0x0F38) volatile __UADDRbits_t UADDRbits;
1883 
1884 #define _ADDR0                  0x01
1885 #define _ADDR1                  0x02
1886 #define _ADDR2                  0x04
1887 #define _ADDR3                  0x08
1888 #define _ADDR4                  0x10
1889 #define _ADDR5                  0x20
1890 #define _ADDR6                  0x40
1891 
1892 //==============================================================================
1893 
1894 
1895 //==============================================================================
1896 //        UCFG Bits
1897 
1898 extern __at(0x0F39) __sfr UCFG;
1899 
1900 typedef union
1901   {
1902   struct
1903     {
1904     unsigned PPB0               : 1;
1905     unsigned PPB1               : 1;
1906     unsigned FSEN               : 1;
1907     unsigned UTRDIS             : 1;
1908     unsigned UPUEN              : 1;
1909     unsigned                    : 1;
1910     unsigned UOEMON             : 1;
1911     unsigned UTEYE              : 1;
1912     };
1913 
1914   struct
1915     {
1916     unsigned PPB                : 2;
1917     unsigned                    : 6;
1918     };
1919   } __UCFGbits_t;
1920 
1921 extern __at(0x0F39) volatile __UCFGbits_t UCFGbits;
1922 
1923 #define _PPB0                   0x01
1924 #define _PPB1                   0x02
1925 #define _FSEN                   0x04
1926 #define _UTRDIS                 0x08
1927 #define _UPUEN                  0x10
1928 #define _UOEMON                 0x40
1929 #define _UTEYE                  0x80
1930 
1931 //==============================================================================
1932 
1933 extern __at(0x0F3A) __sfr RTCVALL;
1934 extern __at(0x0F3B) __sfr RTCVALH;
1935 
1936 //==============================================================================
1937 //        PADCFG1 Bits
1938 
1939 extern __at(0x0F3C) __sfr PADCFG1;
1940 
1941 typedef union
1942   {
1943   struct
1944     {
1945     unsigned                    : 1;
1946     unsigned RTSECSEL0          : 1;
1947     unsigned RTSECSEL1          : 1;
1948     unsigned                    : 1;
1949     unsigned                    : 1;
1950     unsigned                    : 1;
1951     unsigned                    : 1;
1952     unsigned                    : 1;
1953     };
1954 
1955   struct
1956     {
1957     unsigned                    : 1;
1958     unsigned RTSECSEL           : 2;
1959     unsigned                    : 5;
1960     };
1961   } __PADCFG1bits_t;
1962 
1963 extern __at(0x0F3C) volatile __PADCFG1bits_t PADCFG1bits;
1964 
1965 #define _RTSECSEL0              0x02
1966 #define _RTSECSEL1              0x04
1967 
1968 //==============================================================================
1969 
1970 
1971 //==============================================================================
1972 //        REFOCON Bits
1973 
1974 extern __at(0x0F3D) __sfr REFOCON;
1975 
1976 typedef union
1977   {
1978   struct
1979     {
1980     unsigned RODIV0             : 1;
1981     unsigned RODIV1             : 1;
1982     unsigned RODIV2             : 1;
1983     unsigned RODIV3             : 1;
1984     unsigned ROSEL              : 1;
1985     unsigned ROSSLP             : 1;
1986     unsigned                    : 1;
1987     unsigned ROON               : 1;
1988     };
1989 
1990   struct
1991     {
1992     unsigned RODIV              : 4;
1993     unsigned                    : 4;
1994     };
1995   } __REFOCONbits_t;
1996 
1997 extern __at(0x0F3D) volatile __REFOCONbits_t REFOCONbits;
1998 
1999 #define _RODIV0                 0x01
2000 #define _RODIV1                 0x02
2001 #define _RODIV2                 0x04
2002 #define _RODIV3                 0x08
2003 #define _ROSEL                  0x10
2004 #define _ROSSLP                 0x20
2005 #define _ROON                   0x80
2006 
2007 //==============================================================================
2008 
2009 
2010 //==============================================================================
2011 //        RTCCAL Bits
2012 
2013 extern __at(0x0F3E) __sfr RTCCAL;
2014 
2015 typedef struct
2016   {
2017   unsigned CAL0                 : 1;
2018   unsigned CAL1                 : 1;
2019   unsigned CAL2                 : 1;
2020   unsigned CAL3                 : 1;
2021   unsigned CAL4                 : 1;
2022   unsigned CAL5                 : 1;
2023   unsigned CAL6                 : 1;
2024   unsigned CAL7                 : 1;
2025   } __RTCCALbits_t;
2026 
2027 extern __at(0x0F3E) volatile __RTCCALbits_t RTCCALbits;
2028 
2029 #define _CAL0                   0x01
2030 #define _CAL1                   0x02
2031 #define _CAL2                   0x04
2032 #define _CAL3                   0x08
2033 #define _CAL4                   0x10
2034 #define _CAL5                   0x20
2035 #define _CAL6                   0x40
2036 #define _CAL7                   0x80
2037 
2038 //==============================================================================
2039 
2040 
2041 //==============================================================================
2042 //        RTCCFG Bits
2043 
2044 extern __at(0x0F3F) __sfr RTCCFG;
2045 
2046 typedef union
2047   {
2048   struct
2049     {
2050     unsigned RTCPTR0            : 1;
2051     unsigned RTCPTR1            : 1;
2052     unsigned RTCOE              : 1;
2053     unsigned HALFSEC            : 1;
2054     unsigned RTCSYNC            : 1;
2055     unsigned RTCWREN            : 1;
2056     unsigned                    : 1;
2057     unsigned RTCEN              : 1;
2058     };
2059 
2060   struct
2061     {
2062     unsigned RTCPTR             : 2;
2063     unsigned                    : 6;
2064     };
2065   } __RTCCFGbits_t;
2066 
2067 extern __at(0x0F3F) volatile __RTCCFGbits_t RTCCFGbits;
2068 
2069 #define _RTCPTR0                0x01
2070 #define _RTCPTR1                0x02
2071 #define _RTCOE                  0x04
2072 #define _HALFSEC                0x08
2073 #define _RTCSYNC                0x10
2074 #define _RTCWREN                0x20
2075 #define _RTCEN                  0x80
2076 
2077 //==============================================================================
2078 
2079 
2080 //==============================================================================
2081 //        ODCON3 Bits
2082 
2083 extern __at(0x0F40) __sfr ODCON3;
2084 
2085 typedef struct
2086   {
2087   unsigned SPI1OD               : 1;
2088   unsigned SPI2OD               : 1;
2089   unsigned                      : 1;
2090   unsigned                      : 1;
2091   unsigned                      : 1;
2092   unsigned                      : 1;
2093   unsigned                      : 1;
2094   unsigned                      : 1;
2095   } __ODCON3bits_t;
2096 
2097 extern __at(0x0F40) volatile __ODCON3bits_t ODCON3bits;
2098 
2099 #define _SPI1OD                 0x01
2100 #define _SPI2OD                 0x02
2101 
2102 //==============================================================================
2103 
2104 
2105 //==============================================================================
2106 //        ODCON2 Bits
2107 
2108 extern __at(0x0F41) __sfr ODCON2;
2109 
2110 typedef struct
2111   {
2112   unsigned U1OD                 : 1;
2113   unsigned U2OD                 : 1;
2114   unsigned CCP9OD               : 1;
2115   unsigned CCP10OD              : 1;
2116   unsigned                      : 1;
2117   unsigned                      : 1;
2118   unsigned                      : 1;
2119   unsigned                      : 1;
2120   } __ODCON2bits_t;
2121 
2122 extern __at(0x0F41) volatile __ODCON2bits_t ODCON2bits;
2123 
2124 #define _U1OD                   0x01
2125 #define _U2OD                   0x02
2126 #define _CCP9OD                 0x04
2127 #define _CCP10OD                0x08
2128 
2129 //==============================================================================
2130 
2131 
2132 //==============================================================================
2133 //        ODCON1 Bits
2134 
2135 extern __at(0x0F42) __sfr ODCON1;
2136 
2137 typedef struct
2138   {
2139   unsigned ECCP1OD              : 1;
2140   unsigned ECCP2OD              : 1;
2141   unsigned ECCP3OD              : 1;
2142   unsigned CCP4OD               : 1;
2143   unsigned CCP5OD               : 1;
2144   unsigned CCP6OD               : 1;
2145   unsigned CCP7OD               : 1;
2146   unsigned CCP8OD               : 1;
2147   } __ODCON1bits_t;
2148 
2149 extern __at(0x0F42) volatile __ODCON1bits_t ODCON1bits;
2150 
2151 #define _ECCP1OD                0x01
2152 #define _ECCP2OD                0x02
2153 #define _ECCP3OD                0x04
2154 #define _CCP4OD                 0x08
2155 #define _CCP5OD                 0x10
2156 #define _CCP6OD                 0x20
2157 #define _CCP7OD                 0x40
2158 #define _CCP8OD                 0x80
2159 
2160 //==============================================================================
2161 
2162 extern __at(0x0F44) __sfr ALRMVALL;
2163 extern __at(0x0F45) __sfr ALRMVALH;
2164 
2165 //==============================================================================
2166 //        ALRMRPT Bits
2167 
2168 extern __at(0x0F46) __sfr ALRMRPT;
2169 
2170 typedef struct
2171   {
2172   unsigned ARPT0                : 1;
2173   unsigned ARPT1                : 1;
2174   unsigned ARPT2                : 1;
2175   unsigned ARPT3                : 1;
2176   unsigned ARPT4                : 1;
2177   unsigned ARPT5                : 1;
2178   unsigned ARPT6                : 1;
2179   unsigned ARPT7                : 1;
2180   } __ALRMRPTbits_t;
2181 
2182 extern __at(0x0F46) volatile __ALRMRPTbits_t ALRMRPTbits;
2183 
2184 #define _ARPT0                  0x01
2185 #define _ARPT1                  0x02
2186 #define _ARPT2                  0x04
2187 #define _ARPT3                  0x08
2188 #define _ARPT4                  0x10
2189 #define _ARPT5                  0x20
2190 #define _ARPT6                  0x40
2191 #define _ARPT7                  0x80
2192 
2193 //==============================================================================
2194 
2195 
2196 //==============================================================================
2197 //        ALRMCFG Bits
2198 
2199 extern __at(0x0F47) __sfr ALRMCFG;
2200 
2201 typedef union
2202   {
2203   struct
2204     {
2205     unsigned ALRMPTR0           : 1;
2206     unsigned ALRMPTR1           : 1;
2207     unsigned AMASK0             : 1;
2208     unsigned AMASK1             : 1;
2209     unsigned AMASK2             : 1;
2210     unsigned AMASK3             : 1;
2211     unsigned CHIME              : 1;
2212     unsigned ALRMEN             : 1;
2213     };
2214 
2215   struct
2216     {
2217     unsigned ALRMPTR            : 2;
2218     unsigned                    : 6;
2219     };
2220 
2221   struct
2222     {
2223     unsigned                    : 2;
2224     unsigned AMASK              : 4;
2225     unsigned                    : 2;
2226     };
2227   } __ALRMCFGbits_t;
2228 
2229 extern __at(0x0F47) volatile __ALRMCFGbits_t ALRMCFGbits;
2230 
2231 #define _ALRMPTR0               0x01
2232 #define _ALRMPTR1               0x02
2233 #define _AMASK0                 0x04
2234 #define _AMASK1                 0x08
2235 #define _AMASK2                 0x10
2236 #define _AMASK3                 0x20
2237 #define _CHIME                  0x40
2238 #define _ALRMEN                 0x80
2239 
2240 //==============================================================================
2241 
2242 
2243 //==============================================================================
2244 //        ANCON0 Bits
2245 
2246 extern __at(0x0F48) __sfr ANCON0;
2247 
2248 typedef union
2249   {
2250   struct
2251     {
2252     unsigned PCFG0              : 1;
2253     unsigned PCFG1              : 1;
2254     unsigned PCFG2              : 1;
2255     unsigned PCFG3              : 1;
2256     unsigned PCFG4              : 1;
2257     unsigned                    : 1;
2258     unsigned                    : 1;
2259     unsigned                    : 1;
2260     };
2261 
2262   struct
2263     {
2264     unsigned PCFG               : 5;
2265     unsigned                    : 3;
2266     };
2267   } __ANCON0bits_t;
2268 
2269 extern __at(0x0F48) volatile __ANCON0bits_t ANCON0bits;
2270 
2271 #define _PCFG0                  0x01
2272 #define _PCFG1                  0x02
2273 #define _PCFG2                  0x04
2274 #define _PCFG3                  0x08
2275 #define _PCFG4                  0x10
2276 
2277 //==============================================================================
2278 
2279 
2280 //==============================================================================
2281 //        ANCON1 Bits
2282 
2283 extern __at(0x0F49) __sfr ANCON1;
2284 
2285 typedef struct
2286   {
2287   unsigned PCFG8                : 1;
2288   unsigned PCFG9                : 1;
2289   unsigned PCFG10               : 1;
2290   unsigned PCFG11               : 1;
2291   unsigned PCFG12               : 1;
2292   unsigned                      : 1;
2293   unsigned                      : 1;
2294   unsigned VBGEN                : 1;
2295   } __ANCON1bits_t;
2296 
2297 extern __at(0x0F49) volatile __ANCON1bits_t ANCON1bits;
2298 
2299 #define _PCFG8                  0x01
2300 #define _PCFG9                  0x02
2301 #define _PCFG10                 0x04
2302 #define _PCFG11                 0x08
2303 #define _PCFG12                 0x10
2304 #define _VBGEN                  0x80
2305 
2306 //==============================================================================
2307 
2308 
2309 //==============================================================================
2310 //        DSWAKEL Bits
2311 
2312 extern __at(0x0F4A) __sfr DSWAKEL;
2313 
2314 typedef struct
2315   {
2316   unsigned DSPOR                : 1;
2317   unsigned                      : 1;
2318   unsigned DSMCLR               : 1;
2319   unsigned DSRTC                : 1;
2320   unsigned DSWDT                : 1;
2321   unsigned DSULP                : 1;
2322   unsigned                      : 1;
2323   unsigned DSFLT                : 1;
2324   } __DSWAKELbits_t;
2325 
2326 extern __at(0x0F4A) volatile __DSWAKELbits_t DSWAKELbits;
2327 
2328 #define _DSPOR                  0x01
2329 #define _DSMCLR                 0x04
2330 #define _DSRTC                  0x08
2331 #define _DSWDT                  0x10
2332 #define _DSULP                  0x20
2333 #define _DSFLT                  0x80
2334 
2335 //==============================================================================
2336 
2337 
2338 //==============================================================================
2339 //        DSWAKEH Bits
2340 
2341 extern __at(0x0F4B) __sfr DSWAKEH;
2342 
2343 typedef struct
2344   {
2345   unsigned DSINT0               : 1;
2346   unsigned                      : 1;
2347   unsigned                      : 1;
2348   unsigned                      : 1;
2349   unsigned                      : 1;
2350   unsigned                      : 1;
2351   unsigned                      : 1;
2352   unsigned                      : 1;
2353   } __DSWAKEHbits_t;
2354 
2355 extern __at(0x0F4B) volatile __DSWAKEHbits_t DSWAKEHbits;
2356 
2357 #define _DSINT0                 0x01
2358 
2359 //==============================================================================
2360 
2361 
2362 //==============================================================================
2363 //        DSCONL Bits
2364 
2365 extern __at(0x0F4C) __sfr DSCONL;
2366 
2367 typedef struct
2368   {
2369   unsigned RELEASE              : 1;
2370   unsigned DSBOR                : 1;
2371   unsigned ULPWDIS              : 1;
2372   unsigned                      : 1;
2373   unsigned                      : 1;
2374   unsigned                      : 1;
2375   unsigned                      : 1;
2376   unsigned                      : 1;
2377   } __DSCONLbits_t;
2378 
2379 extern __at(0x0F4C) volatile __DSCONLbits_t DSCONLbits;
2380 
2381 #define _RELEASE                0x01
2382 #define _DSBOR                  0x02
2383 #define _ULPWDIS                0x04
2384 
2385 //==============================================================================
2386 
2387 
2388 //==============================================================================
2389 //        DSCONH Bits
2390 
2391 extern __at(0x0F4D) __sfr DSCONH;
2392 
2393 typedef struct
2394   {
2395   unsigned RTCWDIS              : 1;
2396   unsigned DSULPEN              : 1;
2397   unsigned                      : 1;
2398   unsigned                      : 1;
2399   unsigned                      : 1;
2400   unsigned                      : 1;
2401   unsigned                      : 1;
2402   unsigned DSEN                 : 1;
2403   } __DSCONHbits_t;
2404 
2405 extern __at(0x0F4D) volatile __DSCONHbits_t DSCONHbits;
2406 
2407 #define _RTCWDIS                0x01
2408 #define _DSULPEN                0x02
2409 #define _DSEN                   0x80
2410 
2411 //==============================================================================
2412 
2413 extern __at(0x0F4E) __sfr DSGPR0;
2414 extern __at(0x0F4F) __sfr DSGPR1;
2415 
2416 //==============================================================================
2417 //        CCPTMRS2 Bits
2418 
2419 extern __at(0x0F50) __sfr CCPTMRS2;
2420 
2421 typedef union
2422   {
2423   struct
2424     {
2425     unsigned C8TSEL0            : 1;
2426     unsigned C8TSEL1            : 1;
2427     unsigned C9TSEL0            : 1;
2428     unsigned                    : 1;
2429     unsigned C10TSEL0           : 1;
2430     unsigned                    : 1;
2431     unsigned                    : 1;
2432     unsigned                    : 1;
2433     };
2434 
2435   struct
2436     {
2437     unsigned C8TSEL             : 2;
2438     unsigned                    : 6;
2439     };
2440   } __CCPTMRS2bits_t;
2441 
2442 extern __at(0x0F50) volatile __CCPTMRS2bits_t CCPTMRS2bits;
2443 
2444 #define _C8TSEL0                0x01
2445 #define _C8TSEL1                0x02
2446 #define _C9TSEL0                0x04
2447 #define _C10TSEL0               0x10
2448 
2449 //==============================================================================
2450 
2451 
2452 //==============================================================================
2453 //        CCPTMRS1 Bits
2454 
2455 extern __at(0x0F51) __sfr CCPTMRS1;
2456 
2457 typedef union
2458   {
2459   struct
2460     {
2461     unsigned C4TSEL0            : 1;
2462     unsigned C4TSEL1            : 1;
2463     unsigned C5TSEL0            : 1;
2464     unsigned                    : 1;
2465     unsigned C6TSEL0            : 1;
2466     unsigned                    : 1;
2467     unsigned C7TSEL0            : 1;
2468     unsigned C7TSEL1            : 1;
2469     };
2470 
2471   struct
2472     {
2473     unsigned C4TSEL             : 2;
2474     unsigned                    : 6;
2475     };
2476 
2477   struct
2478     {
2479     unsigned                    : 6;
2480     unsigned C7TSEL             : 2;
2481     };
2482   } __CCPTMRS1bits_t;
2483 
2484 extern __at(0x0F51) volatile __CCPTMRS1bits_t CCPTMRS1bits;
2485 
2486 #define _C4TSEL0                0x01
2487 #define _C4TSEL1                0x02
2488 #define _C5TSEL0                0x04
2489 #define _C6TSEL0                0x10
2490 #define _C7TSEL0                0x40
2491 #define _C7TSEL1                0x80
2492 
2493 //==============================================================================
2494 
2495 
2496 //==============================================================================
2497 //        CCPTMRS0 Bits
2498 
2499 extern __at(0x0F52) __sfr CCPTMRS0;
2500 
2501 typedef union
2502   {
2503   struct
2504     {
2505     unsigned C1TSEL0            : 1;
2506     unsigned C1TSEL1            : 1;
2507     unsigned C1TSEL2            : 1;
2508     unsigned C2TSEL0            : 1;
2509     unsigned C2TSEL1            : 1;
2510     unsigned C2TSEL2            : 1;
2511     unsigned C3TSEL0            : 1;
2512     unsigned C3TSEL1            : 1;
2513     };
2514 
2515   struct
2516     {
2517     unsigned C1TSEL             : 3;
2518     unsigned                    : 5;
2519     };
2520 
2521   struct
2522     {
2523     unsigned                    : 3;
2524     unsigned C2TSEL             : 3;
2525     unsigned                    : 2;
2526     };
2527 
2528   struct
2529     {
2530     unsigned                    : 6;
2531     unsigned C3TSEL             : 2;
2532     };
2533   } __CCPTMRS0bits_t;
2534 
2535 extern __at(0x0F52) volatile __CCPTMRS0bits_t CCPTMRS0bits;
2536 
2537 #define _C1TSEL0                0x01
2538 #define _C1TSEL1                0x02
2539 #define _C1TSEL2                0x04
2540 #define _C2TSEL0                0x08
2541 #define _C2TSEL1                0x10
2542 #define _C2TSEL2                0x20
2543 #define _C3TSEL0                0x40
2544 #define _C3TSEL1                0x80
2545 
2546 //==============================================================================
2547 
2548 
2549 //==============================================================================
2550 //        CVRCON Bits
2551 
2552 extern __at(0x0F53) __sfr CVRCON;
2553 
2554 typedef union
2555   {
2556   struct
2557     {
2558     unsigned CVR0               : 1;
2559     unsigned CVR1               : 1;
2560     unsigned CVR2               : 1;
2561     unsigned CVR3               : 1;
2562     unsigned CVRSS              : 1;
2563     unsigned CVRR               : 1;
2564     unsigned CVROE              : 1;
2565     unsigned CVREN              : 1;
2566     };
2567 
2568   struct
2569     {
2570     unsigned CVR                : 4;
2571     unsigned                    : 4;
2572     };
2573   } __CVRCONbits_t;
2574 
2575 extern __at(0x0F53) volatile __CVRCONbits_t CVRCONbits;
2576 
2577 #define _CVR0                   0x01
2578 #define _CVR1                   0x02
2579 #define _CVR2                   0x04
2580 #define _CVR3                   0x08
2581 #define _CVRSS                  0x10
2582 #define _CVRR                   0x20
2583 #define _CVROE                  0x40
2584 #define _CVREN                  0x80
2585 
2586 //==============================================================================
2587 
2588 extern __at(0x0F60) __sfr UFRM;
2589 
2590 //==============================================================================
2591 //        UFRML Bits
2592 
2593 extern __at(0x0F60) __sfr UFRML;
2594 
2595 typedef struct
2596   {
2597   unsigned FRM0                 : 1;
2598   unsigned FRM1                 : 1;
2599   unsigned FRM2                 : 1;
2600   unsigned FRM3                 : 1;
2601   unsigned FRM4                 : 1;
2602   unsigned FRM5                 : 1;
2603   unsigned FRM6                 : 1;
2604   unsigned FRM7                 : 1;
2605   } __UFRMLbits_t;
2606 
2607 extern __at(0x0F60) volatile __UFRMLbits_t UFRMLbits;
2608 
2609 #define _FRM0                   0x01
2610 #define _FRM1                   0x02
2611 #define _FRM2                   0x04
2612 #define _FRM3                   0x08
2613 #define _FRM4                   0x10
2614 #define _FRM5                   0x20
2615 #define _FRM6                   0x40
2616 #define _FRM7                   0x80
2617 
2618 //==============================================================================
2619 
2620 
2621 //==============================================================================
2622 //        UFRMH Bits
2623 
2624 extern __at(0x0F61) __sfr UFRMH;
2625 
2626 typedef struct
2627   {
2628   unsigned FRM8                 : 1;
2629   unsigned FRM9                 : 1;
2630   unsigned FRM10                : 1;
2631   unsigned                      : 1;
2632   unsigned                      : 1;
2633   unsigned                      : 1;
2634   unsigned                      : 1;
2635   unsigned                      : 1;
2636   } __UFRMHbits_t;
2637 
2638 extern __at(0x0F61) volatile __UFRMHbits_t UFRMHbits;
2639 
2640 #define _FRM8                   0x01
2641 #define _FRM9                   0x02
2642 #define _FRM10                  0x04
2643 
2644 //==============================================================================
2645 
2646 
2647 //==============================================================================
2648 //        UIR Bits
2649 
2650 extern __at(0x0F62) __sfr UIR;
2651 
2652 typedef struct
2653   {
2654   unsigned URSTIF               : 1;
2655   unsigned UERRIF               : 1;
2656   unsigned ACTVIF               : 1;
2657   unsigned TRNIF                : 1;
2658   unsigned IDLEIF               : 1;
2659   unsigned STALLIF              : 1;
2660   unsigned SOFIF                : 1;
2661   unsigned                      : 1;
2662   } __UIRbits_t;
2663 
2664 extern __at(0x0F62) volatile __UIRbits_t UIRbits;
2665 
2666 #define _URSTIF                 0x01
2667 #define _UERRIF                 0x02
2668 #define _ACTVIF                 0x04
2669 #define _TRNIF                  0x08
2670 #define _IDLEIF                 0x10
2671 #define _STALLIF                0x20
2672 #define _SOFIF                  0x40
2673 
2674 //==============================================================================
2675 
2676 
2677 //==============================================================================
2678 //        UEIR Bits
2679 
2680 extern __at(0x0F63) __sfr UEIR;
2681 
2682 typedef struct
2683   {
2684   unsigned PIDEF                : 1;
2685   unsigned CRC5EF               : 1;
2686   unsigned CRC16EF              : 1;
2687   unsigned DFN8EF               : 1;
2688   unsigned BTOEF                : 1;
2689   unsigned                      : 1;
2690   unsigned                      : 1;
2691   unsigned BTSEF                : 1;
2692   } __UEIRbits_t;
2693 
2694 extern __at(0x0F63) volatile __UEIRbits_t UEIRbits;
2695 
2696 #define _PIDEF                  0x01
2697 #define _CRC5EF                 0x02
2698 #define _CRC16EF                0x04
2699 #define _DFN8EF                 0x08
2700 #define _BTOEF                  0x10
2701 #define _BTSEF                  0x80
2702 
2703 //==============================================================================
2704 
2705 
2706 //==============================================================================
2707 //        USTAT Bits
2708 
2709 extern __at(0x0F64) __sfr USTAT;
2710 
2711 typedef union
2712   {
2713   struct
2714     {
2715     unsigned                    : 1;
2716     unsigned PPBI               : 1;
2717     unsigned DIR                : 1;
2718     unsigned ENDP0              : 1;
2719     unsigned ENDP1              : 1;
2720     unsigned ENDP2              : 1;
2721     unsigned ENDP3              : 1;
2722     unsigned                    : 1;
2723     };
2724 
2725   struct
2726     {
2727     unsigned                    : 3;
2728     unsigned ENDP               : 4;
2729     unsigned                    : 1;
2730     };
2731   } __USTATbits_t;
2732 
2733 extern __at(0x0F64) volatile __USTATbits_t USTATbits;
2734 
2735 #define _PPBI                   0x02
2736 #define _DIR                    0x04
2737 #define _ENDP0                  0x08
2738 #define _ENDP1                  0x10
2739 #define _ENDP2                  0x20
2740 #define _ENDP3                  0x40
2741 
2742 //==============================================================================
2743 
2744 
2745 //==============================================================================
2746 //        UCON Bits
2747 
2748 extern __at(0x0F65) __sfr UCON;
2749 
2750 typedef struct
2751   {
2752   unsigned                      : 1;
2753   unsigned SUSPND               : 1;
2754   unsigned RESUME               : 1;
2755   unsigned USBEN                : 1;
2756   unsigned PKTDIS               : 1;
2757   unsigned SE0                  : 1;
2758   unsigned PPBRST               : 1;
2759   unsigned                      : 1;
2760   } __UCONbits_t;
2761 
2762 extern __at(0x0F65) volatile __UCONbits_t UCONbits;
2763 
2764 #define _SUSPND                 0x02
2765 #define _RESUME                 0x04
2766 #define _USBEN                  0x08
2767 #define _PKTDIS                 0x10
2768 #define _SE0                    0x20
2769 #define _PPBRST                 0x40
2770 
2771 //==============================================================================
2772 
2773 extern __at(0x0F66) __sfr DMABCH;
2774 extern __at(0x0F67) __sfr DMABCL;
2775 extern __at(0x0F68) __sfr RXADDRH;
2776 extern __at(0x0F69) __sfr RXADDRL;
2777 extern __at(0x0F6A) __sfr TXADDRH;
2778 extern __at(0x0F6B) __sfr TXADDRL;
2779 
2780 //==============================================================================
2781 //        CMSTAT Bits
2782 
2783 extern __at(0x0F70) __sfr CMSTAT;
2784 
2785 typedef struct
2786   {
2787   unsigned COUT1                : 1;
2788   unsigned COUT2                : 1;
2789   unsigned COUT3                : 1;
2790   unsigned                      : 1;
2791   unsigned                      : 1;
2792   unsigned                      : 1;
2793   unsigned                      : 1;
2794   unsigned                      : 1;
2795   } __CMSTATbits_t;
2796 
2797 extern __at(0x0F70) volatile __CMSTATbits_t CMSTATbits;
2798 
2799 #define _COUT1                  0x01
2800 #define _COUT2                  0x02
2801 #define _COUT3                  0x04
2802 
2803 //==============================================================================
2804 
2805 
2806 //==============================================================================
2807 //        CMSTATUS Bits
2808 
2809 extern __at(0x0F70) __sfr CMSTATUS;
2810 
2811 typedef struct
2812   {
2813   unsigned COUT1                : 1;
2814   unsigned COUT2                : 1;
2815   unsigned COUT3                : 1;
2816   unsigned                      : 1;
2817   unsigned                      : 1;
2818   unsigned                      : 1;
2819   unsigned                      : 1;
2820   unsigned                      : 1;
2821   } __CMSTATUSbits_t;
2822 
2823 extern __at(0x0F70) volatile __CMSTATUSbits_t CMSTATUSbits;
2824 
2825 #define _CMSTATUS_COUT1         0x01
2826 #define _CMSTATUS_COUT2         0x02
2827 #define _CMSTATUS_COUT3         0x04
2828 
2829 //==============================================================================
2830 
2831 
2832 //==============================================================================
2833 //        SSP2CON2 Bits
2834 
2835 extern __at(0x0F71) __sfr SSP2CON2;
2836 
2837 typedef union
2838   {
2839   struct
2840     {
2841     unsigned SEN                : 1;
2842     unsigned RSEN               : 1;
2843     unsigned PEN                : 1;
2844     unsigned RCEN               : 1;
2845     unsigned ACKEN              : 1;
2846     unsigned ACKDT              : 1;
2847     unsigned ACKSTAT            : 1;
2848     unsigned GCEN               : 1;
2849     };
2850 
2851   struct
2852     {
2853     unsigned                    : 1;
2854     unsigned ADMSK1             : 1;
2855     unsigned ADMSK2             : 1;
2856     unsigned ADMSK3             : 1;
2857     unsigned ADMSK4             : 1;
2858     unsigned ADMSK5             : 1;
2859     unsigned                    : 1;
2860     unsigned                    : 1;
2861     };
2862   } __SSP2CON2bits_t;
2863 
2864 extern __at(0x0F71) volatile __SSP2CON2bits_t SSP2CON2bits;
2865 
2866 #define _SSP2CON2_SEN           0x01
2867 #define _SSP2CON2_RSEN          0x02
2868 #define _SSP2CON2_ADMSK1        0x02
2869 #define _SSP2CON2_PEN           0x04
2870 #define _SSP2CON2_ADMSK2        0x04
2871 #define _SSP2CON2_RCEN          0x08
2872 #define _SSP2CON2_ADMSK3        0x08
2873 #define _SSP2CON2_ACKEN         0x10
2874 #define _SSP2CON2_ADMSK4        0x10
2875 #define _SSP2CON2_ACKDT         0x20
2876 #define _SSP2CON2_ADMSK5        0x20
2877 #define _SSP2CON2_ACKSTAT       0x40
2878 #define _SSP2CON2_GCEN          0x80
2879 
2880 //==============================================================================
2881 
2882 
2883 //==============================================================================
2884 //        SSP2CON1 Bits
2885 
2886 extern __at(0x0F72) __sfr SSP2CON1;
2887 
2888 typedef union
2889   {
2890   struct
2891     {
2892     unsigned SSPM0              : 1;
2893     unsigned SSPM1              : 1;
2894     unsigned SSPM2              : 1;
2895     unsigned SSPM3              : 1;
2896     unsigned CKP                : 1;
2897     unsigned SSPEN              : 1;
2898     unsigned SSPOV              : 1;
2899     unsigned WCOL               : 1;
2900     };
2901 
2902   struct
2903     {
2904     unsigned SSPM               : 4;
2905     unsigned                    : 4;
2906     };
2907   } __SSP2CON1bits_t;
2908 
2909 extern __at(0x0F72) volatile __SSP2CON1bits_t SSP2CON1bits;
2910 
2911 #define _SSP2CON1_SSPM0         0x01
2912 #define _SSP2CON1_SSPM1         0x02
2913 #define _SSP2CON1_SSPM2         0x04
2914 #define _SSP2CON1_SSPM3         0x08
2915 #define _SSP2CON1_CKP           0x10
2916 #define _SSP2CON1_SSPEN         0x20
2917 #define _SSP2CON1_SSPOV         0x40
2918 #define _SSP2CON1_WCOL          0x80
2919 
2920 //==============================================================================
2921 
2922 
2923 //==============================================================================
2924 //        SSP2STAT Bits
2925 
2926 extern __at(0x0F73) __sfr SSP2STAT;
2927 
2928 typedef struct
2929   {
2930   unsigned BF                   : 1;
2931   unsigned UA                   : 1;
2932   unsigned R_NOT_W              : 1;
2933   unsigned S                    : 1;
2934   unsigned P                    : 1;
2935   unsigned D_NOT_A              : 1;
2936   unsigned CKE                  : 1;
2937   unsigned SMP                  : 1;
2938   } __SSP2STATbits_t;
2939 
2940 extern __at(0x0F73) volatile __SSP2STATbits_t SSP2STATbits;
2941 
2942 #define _SSP2STAT_BF            0x01
2943 #define _SSP2STAT_UA            0x02
2944 #define _SSP2STAT_R_NOT_W       0x04
2945 #define _SSP2STAT_S             0x08
2946 #define _SSP2STAT_P             0x10
2947 #define _SSP2STAT_D_NOT_A       0x20
2948 #define _SSP2STAT_CKE           0x40
2949 #define _SSP2STAT_SMP           0x80
2950 
2951 //==============================================================================
2952 
2953 extern __at(0x0F74) __sfr SSP2ADD;
2954 
2955 //==============================================================================
2956 //        SSP2MSK Bits
2957 
2958 extern __at(0x0F74) __sfr SSP2MSK;
2959 
2960 typedef struct
2961   {
2962   unsigned MSK0                 : 1;
2963   unsigned MSK1                 : 1;
2964   unsigned MSK2                 : 1;
2965   unsigned MSK3                 : 1;
2966   unsigned MSK4                 : 1;
2967   unsigned MSK5                 : 1;
2968   unsigned MSK6                 : 1;
2969   unsigned MSK7                 : 1;
2970   } __SSP2MSKbits_t;
2971 
2972 extern __at(0x0F74) volatile __SSP2MSKbits_t SSP2MSKbits;
2973 
2974 #define _SSP2MSK_MSK0           0x01
2975 #define _SSP2MSK_MSK1           0x02
2976 #define _SSP2MSK_MSK2           0x04
2977 #define _SSP2MSK_MSK3           0x08
2978 #define _SSP2MSK_MSK4           0x10
2979 #define _SSP2MSK_MSK5           0x20
2980 #define _SSP2MSK_MSK6           0x40
2981 #define _SSP2MSK_MSK7           0x80
2982 
2983 //==============================================================================
2984 
2985 extern __at(0x0F75) __sfr SSP2BUF;
2986 
2987 //==============================================================================
2988 //        T4CON Bits
2989 
2990 extern __at(0x0F76) __sfr T4CON;
2991 
2992 typedef union
2993   {
2994   struct
2995     {
2996     unsigned T4CKPS0            : 1;
2997     unsigned T4CKPS1            : 1;
2998     unsigned TMR4ON             : 1;
2999     unsigned T4OUTPS0           : 1;
3000     unsigned T4OUTPS1           : 1;
3001     unsigned T4OUTPS2           : 1;
3002     unsigned T4OUTPS3           : 1;
3003     unsigned                    : 1;
3004     };
3005 
3006   struct
3007     {
3008     unsigned T4CKPS             : 2;
3009     unsigned                    : 6;
3010     };
3011 
3012   struct
3013     {
3014     unsigned                    : 3;
3015     unsigned T4OUTPS            : 4;
3016     unsigned                    : 1;
3017     };
3018   } __T4CONbits_t;
3019 
3020 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
3021 
3022 #define _T4CKPS0                0x01
3023 #define _T4CKPS1                0x02
3024 #define _TMR4ON                 0x04
3025 #define _T4OUTPS0               0x08
3026 #define _T4OUTPS1               0x10
3027 #define _T4OUTPS2               0x20
3028 #define _T4OUTPS3               0x40
3029 
3030 //==============================================================================
3031 
3032 extern __at(0x0F77) __sfr PR4;
3033 extern __at(0x0F78) __sfr TMR4;
3034 
3035 //==============================================================================
3036 //        T3CON Bits
3037 
3038 extern __at(0x0F79) __sfr T3CON;
3039 
3040 typedef union
3041   {
3042   struct
3043     {
3044     unsigned TMR3ON             : 1;
3045     unsigned RD16               : 1;
3046     unsigned NOT_T3SYNC         : 1;
3047     unsigned T3OSCEN            : 1;
3048     unsigned T3CKPS0            : 1;
3049     unsigned T3CKPS1            : 1;
3050     unsigned TMR3CS0            : 1;
3051     unsigned TMR3CS1            : 1;
3052     };
3053 
3054   struct
3055     {
3056     unsigned                    : 4;
3057     unsigned T3CKPS             : 2;
3058     unsigned                    : 2;
3059     };
3060 
3061   struct
3062     {
3063     unsigned                    : 6;
3064     unsigned TMR3CS             : 2;
3065     };
3066   } __T3CONbits_t;
3067 
3068 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits;
3069 
3070 #define _T3CON_TMR3ON           0x01
3071 #define _T3CON_RD16             0x02
3072 #define _T3CON_NOT_T3SYNC       0x04
3073 #define _T3CON_T3OSCEN          0x08
3074 #define _T3CON_T3CKPS0          0x10
3075 #define _T3CON_T3CKPS1          0x20
3076 #define _T3CON_TMR3CS0          0x40
3077 #define _T3CON_TMR3CS1          0x80
3078 
3079 //==============================================================================
3080 
3081 extern __at(0x0F7A) __sfr TMR3;
3082 extern __at(0x0F7A) __sfr TMR3L;
3083 extern __at(0x0F7B) __sfr TMR3H;
3084 
3085 //==============================================================================
3086 //        BAUDCON2 Bits
3087 
3088 extern __at(0x0F7C) __sfr BAUDCON2;
3089 
3090 typedef struct
3091   {
3092   unsigned ABDEN                : 1;
3093   unsigned WUE                  : 1;
3094   unsigned                      : 1;
3095   unsigned BRG16                : 1;
3096   unsigned TXCKP                : 1;
3097   unsigned RXDTP                : 1;
3098   unsigned RCIDL                : 1;
3099   unsigned ABDOVF               : 1;
3100   } __BAUDCON2bits_t;
3101 
3102 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
3103 
3104 #define _BAUDCON2_ABDEN         0x01
3105 #define _BAUDCON2_WUE           0x02
3106 #define _BAUDCON2_BRG16         0x08
3107 #define _BAUDCON2_TXCKP         0x10
3108 #define _BAUDCON2_RXDTP         0x20
3109 #define _BAUDCON2_RCIDL         0x40
3110 #define _BAUDCON2_ABDOVF        0x80
3111 
3112 //==============================================================================
3113 
3114 extern __at(0x0F7D) __sfr SPBRGH2;
3115 
3116 //==============================================================================
3117 //        BAUDCON Bits
3118 
3119 extern __at(0x0F7E) __sfr BAUDCON;
3120 
3121 typedef struct
3122   {
3123   unsigned ABDEN                : 1;
3124   unsigned WUE                  : 1;
3125   unsigned                      : 1;
3126   unsigned BRG16                : 1;
3127   unsigned TXCKP                : 1;
3128   unsigned RXDTP                : 1;
3129   unsigned RCIDL                : 1;
3130   unsigned ABDOVF               : 1;
3131   } __BAUDCONbits_t;
3132 
3133 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
3134 
3135 #define _ABDEN                  0x01
3136 #define _WUE                    0x02
3137 #define _BRG16                  0x08
3138 #define _TXCKP                  0x10
3139 #define _RXDTP                  0x20
3140 #define _RCIDL                  0x40
3141 #define _ABDOVF                 0x80
3142 
3143 //==============================================================================
3144 
3145 
3146 //==============================================================================
3147 //        BAUDCON1 Bits
3148 
3149 extern __at(0x0F7E) __sfr BAUDCON1;
3150 
3151 typedef struct
3152   {
3153   unsigned ABDEN                : 1;
3154   unsigned WUE                  : 1;
3155   unsigned                      : 1;
3156   unsigned BRG16                : 1;
3157   unsigned TXCKP                : 1;
3158   unsigned RXDTP                : 1;
3159   unsigned RCIDL                : 1;
3160   unsigned ABDOVF               : 1;
3161   } __BAUDCON1bits_t;
3162 
3163 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
3164 
3165 #define _BAUDCON1_ABDEN         0x01
3166 #define _BAUDCON1_WUE           0x02
3167 #define _BAUDCON1_BRG16         0x08
3168 #define _BAUDCON1_TXCKP         0x10
3169 #define _BAUDCON1_RXDTP         0x20
3170 #define _BAUDCON1_RCIDL         0x40
3171 #define _BAUDCON1_ABDOVF        0x80
3172 
3173 //==============================================================================
3174 
3175 
3176 //==============================================================================
3177 //        BAUDCTL Bits
3178 
3179 extern __at(0x0F7E) __sfr BAUDCTL;
3180 
3181 typedef struct
3182   {
3183   unsigned ABDEN                : 1;
3184   unsigned WUE                  : 1;
3185   unsigned                      : 1;
3186   unsigned BRG16                : 1;
3187   unsigned TXCKP                : 1;
3188   unsigned RXDTP                : 1;
3189   unsigned RCIDL                : 1;
3190   unsigned ABDOVF               : 1;
3191   } __BAUDCTLbits_t;
3192 
3193 extern __at(0x0F7E) volatile __BAUDCTLbits_t BAUDCTLbits;
3194 
3195 #define _BAUDCTL_ABDEN          0x01
3196 #define _BAUDCTL_WUE            0x02
3197 #define _BAUDCTL_BRG16          0x08
3198 #define _BAUDCTL_TXCKP          0x10
3199 #define _BAUDCTL_RXDTP          0x20
3200 #define _BAUDCTL_RCIDL          0x40
3201 #define _BAUDCTL_ABDOVF         0x80
3202 
3203 //==============================================================================
3204 
3205 extern __at(0x0F7F) __sfr SPBRGH;
3206 extern __at(0x0F7F) __sfr SPBRGH1;
3207 
3208 //==============================================================================
3209 //        PORTA Bits
3210 
3211 extern __at(0x0F80) __sfr PORTA;
3212 
3213 typedef union
3214   {
3215   struct
3216     {
3217     unsigned RA0                : 1;
3218     unsigned RA1                : 1;
3219     unsigned RA2                : 1;
3220     unsigned RA3                : 1;
3221     unsigned                    : 1;
3222     unsigned RA5                : 1;
3223     unsigned RA6                : 1;
3224     unsigned RA7                : 1;
3225     };
3226 
3227   struct
3228     {
3229     unsigned AN0                : 1;
3230     unsigned AN1                : 1;
3231     unsigned AN2                : 1;
3232     unsigned AN3                : 1;
3233     unsigned                    : 1;
3234     unsigned AN4                : 1;
3235     unsigned OSC2               : 1;
3236     unsigned OSC1               : 1;
3237     };
3238 
3239   struct
3240     {
3241     unsigned C1INA              : 1;
3242     unsigned C2INA              : 1;
3243     unsigned VREF_MINUS         : 1;
3244     unsigned VREF_PLUS          : 1;
3245     unsigned                    : 1;
3246     unsigned NOT_SS1            : 1;
3247     unsigned CLKO               : 1;
3248     unsigned CLKI               : 1;
3249     };
3250 
3251   struct
3252     {
3253     unsigned RP0                : 1;
3254     unsigned RP1                : 1;
3255     unsigned CVREF              : 1;
3256     unsigned C1INB              : 1;
3257     unsigned                    : 1;
3258     unsigned HLVDIN             : 1;
3259     unsigned                    : 1;
3260     unsigned                    : 1;
3261     };
3262 
3263   struct
3264     {
3265     unsigned ULPWU              : 1;
3266     unsigned VBG                : 1;
3267     unsigned C2INB              : 1;
3268     unsigned                    : 1;
3269     unsigned                    : 1;
3270     unsigned RCV                : 1;
3271     unsigned                    : 1;
3272     unsigned                    : 1;
3273     };
3274 
3275   struct
3276     {
3277     unsigned                    : 1;
3278     unsigned                    : 1;
3279     unsigned C1IND              : 1;
3280     unsigned                    : 1;
3281     unsigned                    : 1;
3282     unsigned RP2                : 1;
3283     unsigned                    : 1;
3284     unsigned                    : 1;
3285     };
3286 
3287   struct
3288     {
3289     unsigned                    : 1;
3290     unsigned                    : 1;
3291     unsigned C3INB              : 1;
3292     unsigned                    : 1;
3293     unsigned                    : 1;
3294     unsigned C1INC              : 1;
3295     unsigned                    : 1;
3296     unsigned                    : 1;
3297     };
3298   } __PORTAbits_t;
3299 
3300 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
3301 
3302 #define _RA0                    0x01
3303 #define _AN0                    0x01
3304 #define _C1INA                  0x01
3305 #define _RP0                    0x01
3306 #define _ULPWU                  0x01
3307 #define _RA1                    0x02
3308 #define _AN1                    0x02
3309 #define _C2INA                  0x02
3310 #define _RP1                    0x02
3311 #define _VBG                    0x02
3312 #define _RA2                    0x04
3313 #define _AN2                    0x04
3314 #define _VREF_MINUS             0x04
3315 #define _CVREF                  0x04
3316 #define _C2INB                  0x04
3317 #define _C1IND                  0x04
3318 #define _C3INB                  0x04
3319 #define _RA3                    0x08
3320 #define _AN3                    0x08
3321 #define _VREF_PLUS              0x08
3322 #define _C1INB                  0x08
3323 #define _RA5                    0x20
3324 #define _AN4                    0x20
3325 #define _NOT_SS1                0x20
3326 #define _HLVDIN                 0x20
3327 #define _RCV                    0x20
3328 #define _RP2                    0x20
3329 #define _C1INC                  0x20
3330 #define _RA6                    0x40
3331 #define _OSC2                   0x40
3332 #define _CLKO                   0x40
3333 #define _RA7                    0x80
3334 #define _OSC1                   0x80
3335 #define _CLKI                   0x80
3336 
3337 //==============================================================================
3338 
3339 
3340 //==============================================================================
3341 //        PORTB Bits
3342 
3343 extern __at(0x0F81) __sfr PORTB;
3344 
3345 typedef union
3346   {
3347   struct
3348     {
3349     unsigned RB0                : 1;
3350     unsigned RB1                : 1;
3351     unsigned RB2                : 1;
3352     unsigned RB3                : 1;
3353     unsigned RB4                : 1;
3354     unsigned RB5                : 1;
3355     unsigned RB6                : 1;
3356     unsigned RB7                : 1;
3357     };
3358 
3359   struct
3360     {
3361     unsigned AN12               : 1;
3362     unsigned AN10               : 1;
3363     unsigned AN8                : 1;
3364     unsigned AN9                : 1;
3365     unsigned KBI0               : 1;
3366     unsigned KBI1               : 1;
3367     unsigned KBI2               : 1;
3368     unsigned KBI3               : 1;
3369     };
3370 
3371   struct
3372     {
3373     unsigned INT0               : 1;
3374     unsigned RTCC               : 1;
3375     unsigned CTED1              : 1;
3376     unsigned CTED2              : 1;
3377     unsigned SCK1               : 1;
3378     unsigned SDI1               : 1;
3379     unsigned PGC                : 1;
3380     unsigned PGD                : 1;
3381     };
3382 
3383   struct
3384     {
3385     unsigned RP3                : 1;
3386     unsigned RP4                : 1;
3387     unsigned VMO                : 1;
3388     unsigned VPO                : 1;
3389     unsigned SCL1               : 1;
3390     unsigned SDA1               : 1;
3391     unsigned RP9                : 1;
3392     unsigned RP10               : 1;
3393     };
3394 
3395   struct
3396     {
3397     unsigned C3IND              : 1;
3398     unsigned C3INC              : 1;
3399     unsigned REFO               : 1;
3400     unsigned RP6                : 1;
3401     unsigned RP7                : 1;
3402     unsigned RP8                : 1;
3403     unsigned CCP6               : 1;
3404     unsigned CCP7               : 1;
3405     };
3406 
3407   struct
3408     {
3409     unsigned                    : 1;
3410     unsigned                    : 1;
3411     unsigned RP5                : 1;
3412     unsigned C3INA              : 1;
3413     unsigned CCP4               : 1;
3414     unsigned CCP5               : 1;
3415     unsigned                    : 1;
3416     unsigned                    : 1;
3417     };
3418 
3419   struct
3420     {
3421     unsigned                    : 1;
3422     unsigned                    : 1;
3423     unsigned C2INC              : 1;
3424     unsigned                    : 1;
3425     unsigned                    : 1;
3426     unsigned                    : 1;
3427     unsigned                    : 1;
3428     unsigned                    : 1;
3429     };
3430 
3431   struct
3432     {
3433     unsigned                    : 4;
3434     unsigned KBI                : 4;
3435     };
3436   } __PORTBbits_t;
3437 
3438 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
3439 
3440 #define _RB0                    0x01
3441 #define _AN12                   0x01
3442 #define _INT0                   0x01
3443 #define _RP3                    0x01
3444 #define _C3IND                  0x01
3445 #define _RB1                    0x02
3446 #define _AN10                   0x02
3447 #define _RTCC                   0x02
3448 #define _RP4                    0x02
3449 #define _C3INC                  0x02
3450 #define _RB2                    0x04
3451 #define _AN8                    0x04
3452 #define _CTED1                  0x04
3453 #define _VMO                    0x04
3454 #define _REFO                   0x04
3455 #define _RP5                    0x04
3456 #define _C2INC                  0x04
3457 #define _RB3                    0x08
3458 #define _AN9                    0x08
3459 #define _CTED2                  0x08
3460 #define _VPO                    0x08
3461 #define _RP6                    0x08
3462 #define _C3INA                  0x08
3463 #define _RB4                    0x10
3464 #define _KBI0                   0x10
3465 #define _SCK1                   0x10
3466 #define _SCL1                   0x10
3467 #define _RP7                    0x10
3468 #define _CCP4                   0x10
3469 #define _RB5                    0x20
3470 #define _KBI1                   0x20
3471 #define _SDI1                   0x20
3472 #define _SDA1                   0x20
3473 #define _RP8                    0x20
3474 #define _CCP5                   0x20
3475 #define _RB6                    0x40
3476 #define _KBI2                   0x40
3477 #define _PGC                    0x40
3478 #define _RP9                    0x40
3479 #define _CCP6                   0x40
3480 #define _RB7                    0x80
3481 #define _KBI3                   0x80
3482 #define _PGD                    0x80
3483 #define _RP10                   0x80
3484 #define _CCP7                   0x80
3485 
3486 //==============================================================================
3487 
3488 
3489 //==============================================================================
3490 //        PORTC Bits
3491 
3492 extern __at(0x0F82) __sfr PORTC;
3493 
3494 typedef union
3495   {
3496   struct
3497     {
3498     unsigned RC0                : 1;
3499     unsigned RC1                : 1;
3500     unsigned RC2                : 1;
3501     unsigned                    : 1;
3502     unsigned RC4                : 1;
3503     unsigned RC5                : 1;
3504     unsigned RC6                : 1;
3505     unsigned RC7                : 1;
3506     };
3507 
3508   struct
3509     {
3510     unsigned T1OSO              : 1;
3511     unsigned T1OSI              : 1;
3512     unsigned AN11               : 1;
3513     unsigned                    : 1;
3514     unsigned D_MINUS            : 1;
3515     unsigned D_PLUS             : 1;
3516     unsigned TX1                : 1;
3517     unsigned RX1                : 1;
3518     };
3519 
3520   struct
3521     {
3522     unsigned T1CKI              : 1;
3523     unsigned NOT_UOE            : 1;
3524     unsigned CTPLS              : 1;
3525     unsigned                    : 1;
3526     unsigned VM                 : 1;
3527     unsigned VP                 : 1;
3528     unsigned CK1                : 1;
3529     unsigned DT1                : 1;
3530     };
3531 
3532   struct
3533     {
3534     unsigned RP11               : 1;
3535     unsigned RP12               : 1;
3536     unsigned RP13               : 1;
3537     unsigned                    : 1;
3538     unsigned                    : 1;
3539     unsigned                    : 1;
3540     unsigned RP17               : 1;
3541     unsigned SDO1               : 1;
3542     };
3543 
3544   struct
3545     {
3546     unsigned                    : 1;
3547     unsigned CCP8               : 1;
3548     unsigned C2IND              : 1;
3549     unsigned                    : 1;
3550     unsigned                    : 1;
3551     unsigned                    : 1;
3552     unsigned CCP9               : 1;
3553     unsigned RP18               : 1;
3554     };
3555 
3556   struct
3557     {
3558     unsigned                    : 1;
3559     unsigned                    : 1;
3560     unsigned                    : 1;
3561     unsigned                    : 1;
3562     unsigned                    : 1;
3563     unsigned                    : 1;
3564     unsigned                    : 1;
3565     unsigned CCP10              : 1;
3566     };
3567   } __PORTCbits_t;
3568 
3569 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
3570 
3571 #define _RC0                    0x01
3572 #define _T1OSO                  0x01
3573 #define _T1CKI                  0x01
3574 #define _RP11                   0x01
3575 #define _RC1                    0x02
3576 #define _T1OSI                  0x02
3577 #define _NOT_UOE                0x02
3578 #define _RP12                   0x02
3579 #define _CCP8                   0x02
3580 #define _RC2                    0x04
3581 #define _AN11                   0x04
3582 #define _CTPLS                  0x04
3583 #define _RP13                   0x04
3584 #define _C2IND                  0x04
3585 #define _RC4                    0x10
3586 #define _D_MINUS                0x10
3587 #define _VM                     0x10
3588 #define _RC5                    0x20
3589 #define _D_PLUS                 0x20
3590 #define _VP                     0x20
3591 #define _RC6                    0x40
3592 #define _TX1                    0x40
3593 #define _CK1                    0x40
3594 #define _RP17                   0x40
3595 #define _CCP9                   0x40
3596 #define _RC7                    0x80
3597 #define _RX1                    0x80
3598 #define _DT1                    0x80
3599 #define _SDO1                   0x80
3600 #define _RP18                   0x80
3601 #define _CCP10                  0x80
3602 
3603 //==============================================================================
3604 
3605 
3606 //==============================================================================
3607 //        HLVDCON Bits
3608 
3609 extern __at(0x0F85) __sfr HLVDCON;
3610 
3611 typedef union
3612   {
3613   struct
3614     {
3615     unsigned HLVDL0             : 1;
3616     unsigned HLVDL1             : 1;
3617     unsigned HLVDL2             : 1;
3618     unsigned HLVDL3             : 1;
3619     unsigned HLVDEN             : 1;
3620     unsigned IRVST              : 1;
3621     unsigned BGVST              : 1;
3622     unsigned VDIRMAG            : 1;
3623     };
3624 
3625   struct
3626     {
3627     unsigned HLVDL              : 4;
3628     unsigned                    : 4;
3629     };
3630   } __HLVDCONbits_t;
3631 
3632 extern __at(0x0F85) volatile __HLVDCONbits_t HLVDCONbits;
3633 
3634 #define _HLVDL0                 0x01
3635 #define _HLVDL1                 0x02
3636 #define _HLVDL2                 0x04
3637 #define _HLVDL3                 0x08
3638 #define _HLVDEN                 0x10
3639 #define _IRVST                  0x20
3640 #define _BGVST                  0x40
3641 #define _VDIRMAG                0x80
3642 
3643 //==============================================================================
3644 
3645 
3646 //==============================================================================
3647 //        DMACON2 Bits
3648 
3649 extern __at(0x0F86) __sfr DMACON2;
3650 
3651 typedef union
3652   {
3653   struct
3654     {
3655     unsigned INTLVL0            : 1;
3656     unsigned INTLVL1            : 1;
3657     unsigned INTLVL2            : 1;
3658     unsigned INTLVL3            : 1;
3659     unsigned DLYCYC0            : 1;
3660     unsigned DLYCYC1            : 1;
3661     unsigned DLYCYC2            : 1;
3662     unsigned DLYCYC3            : 1;
3663     };
3664 
3665   struct
3666     {
3667     unsigned INTLVL             : 4;
3668     unsigned                    : 4;
3669     };
3670 
3671   struct
3672     {
3673     unsigned                    : 4;
3674     unsigned DLYCYC             : 4;
3675     };
3676   } __DMACON2bits_t;
3677 
3678 extern __at(0x0F86) volatile __DMACON2bits_t DMACON2bits;
3679 
3680 #define _INTLVL0                0x01
3681 #define _INTLVL1                0x02
3682 #define _INTLVL2                0x04
3683 #define _INTLVL3                0x08
3684 #define _DLYCYC0                0x10
3685 #define _DLYCYC1                0x20
3686 #define _DLYCYC2                0x40
3687 #define _DLYCYC3                0x80
3688 
3689 //==============================================================================
3690 
3691 
3692 //==============================================================================
3693 //        OSCCON2 Bits
3694 
3695 extern __at(0x0F87) __sfr OSCCON2;
3696 
3697 typedef struct
3698   {
3699   unsigned                      : 1;
3700   unsigned                      : 1;
3701   unsigned PRISD                : 1;
3702   unsigned SOSCGO               : 1;
3703   unsigned SOSCDRV              : 1;
3704   unsigned                      : 1;
3705   unsigned SOSCRUN              : 1;
3706   unsigned                      : 1;
3707   } __OSCCON2bits_t;
3708 
3709 extern __at(0x0F87) volatile __OSCCON2bits_t OSCCON2bits;
3710 
3711 #define _PRISD                  0x04
3712 #define _SOSCGO                 0x08
3713 #define _SOSCDRV                0x10
3714 #define _SOSCRUN                0x40
3715 
3716 //==============================================================================
3717 
3718 
3719 //==============================================================================
3720 //        DMACON1 Bits
3721 
3722 extern __at(0x0F88) __sfr DMACON1;
3723 
3724 typedef union
3725   {
3726   struct
3727     {
3728     unsigned DMAEN              : 1;
3729     unsigned DLYINTEN           : 1;
3730     unsigned DUPLEX0            : 1;
3731     unsigned DUPLEX1            : 1;
3732     unsigned RXINC              : 1;
3733     unsigned TXINC              : 1;
3734     unsigned SSCON0             : 1;
3735     unsigned SSCON1             : 1;
3736     };
3737 
3738   struct
3739     {
3740     unsigned                    : 2;
3741     unsigned DUPLEX             : 2;
3742     unsigned                    : 4;
3743     };
3744 
3745   struct
3746     {
3747     unsigned                    : 6;
3748     unsigned SSCON              : 2;
3749     };
3750   } __DMACON1bits_t;
3751 
3752 extern __at(0x0F88) volatile __DMACON1bits_t DMACON1bits;
3753 
3754 #define _DMAEN                  0x01
3755 #define _DLYINTEN               0x02
3756 #define _DUPLEX0                0x04
3757 #define _DUPLEX1                0x08
3758 #define _RXINC                  0x10
3759 #define _TXINC                  0x20
3760 #define _SSCON0                 0x40
3761 #define _SSCON1                 0x80
3762 
3763 //==============================================================================
3764 
3765 
3766 //==============================================================================
3767 //        LATA Bits
3768 
3769 extern __at(0x0F89) __sfr LATA;
3770 
3771 typedef struct
3772   {
3773   unsigned LATA0                : 1;
3774   unsigned LATA1                : 1;
3775   unsigned LATA2                : 1;
3776   unsigned LATA3                : 1;
3777   unsigned                      : 1;
3778   unsigned LATA5                : 1;
3779   unsigned LATA6                : 1;
3780   unsigned LATA7                : 1;
3781   } __LATAbits_t;
3782 
3783 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
3784 
3785 #define _LATA0                  0x01
3786 #define _LATA1                  0x02
3787 #define _LATA2                  0x04
3788 #define _LATA3                  0x08
3789 #define _LATA5                  0x20
3790 #define _LATA6                  0x40
3791 #define _LATA7                  0x80
3792 
3793 //==============================================================================
3794 
3795 
3796 //==============================================================================
3797 //        LATB Bits
3798 
3799 extern __at(0x0F8A) __sfr LATB;
3800 
3801 typedef struct
3802   {
3803   unsigned LATB0                : 1;
3804   unsigned LATB1                : 1;
3805   unsigned LATB2                : 1;
3806   unsigned LATB3                : 1;
3807   unsigned LATB4                : 1;
3808   unsigned LATB5                : 1;
3809   unsigned LATB6                : 1;
3810   unsigned LATB7                : 1;
3811   } __LATBbits_t;
3812 
3813 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
3814 
3815 #define _LATB0                  0x01
3816 #define _LATB1                  0x02
3817 #define _LATB2                  0x04
3818 #define _LATB3                  0x08
3819 #define _LATB4                  0x10
3820 #define _LATB5                  0x20
3821 #define _LATB6                  0x40
3822 #define _LATB7                  0x80
3823 
3824 //==============================================================================
3825 
3826 
3827 //==============================================================================
3828 //        LATC Bits
3829 
3830 extern __at(0x0F8B) __sfr LATC;
3831 
3832 typedef struct
3833   {
3834   unsigned LATC0                : 1;
3835   unsigned LATC1                : 1;
3836   unsigned LATC2                : 1;
3837   unsigned                      : 1;
3838   unsigned                      : 1;
3839   unsigned                      : 1;
3840   unsigned LATC6                : 1;
3841   unsigned LATC7                : 1;
3842   } __LATCbits_t;
3843 
3844 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
3845 
3846 #define _LATC0                  0x01
3847 #define _LATC1                  0x02
3848 #define _LATC2                  0x04
3849 #define _LATC6                  0x40
3850 #define _LATC7                  0x80
3851 
3852 //==============================================================================
3853 
3854 
3855 //==============================================================================
3856 //        PIE4 Bits
3857 
3858 extern __at(0x0F8E) __sfr PIE4;
3859 
3860 typedef struct
3861   {
3862   unsigned CCP3IE               : 1;
3863   unsigned CCP4IE               : 1;
3864   unsigned CCP5IE               : 1;
3865   unsigned CCP6IE               : 1;
3866   unsigned CCP7IE               : 1;
3867   unsigned CCP8IE               : 1;
3868   unsigned CCP9IE               : 1;
3869   unsigned CCP10IE              : 1;
3870   } __PIE4bits_t;
3871 
3872 extern __at(0x0F8E) volatile __PIE4bits_t PIE4bits;
3873 
3874 #define _CCP3IE                 0x01
3875 #define _CCP4IE                 0x02
3876 #define _CCP5IE                 0x04
3877 #define _CCP6IE                 0x08
3878 #define _CCP7IE                 0x10
3879 #define _CCP8IE                 0x20
3880 #define _CCP9IE                 0x40
3881 #define _CCP10IE                0x80
3882 
3883 //==============================================================================
3884 
3885 
3886 //==============================================================================
3887 //        PIR4 Bits
3888 
3889 extern __at(0x0F8F) __sfr PIR4;
3890 
3891 typedef struct
3892   {
3893   unsigned CCP3IF               : 1;
3894   unsigned CCP4IF               : 1;
3895   unsigned CCP5IF               : 1;
3896   unsigned CCP6IF               : 1;
3897   unsigned CCP7IF               : 1;
3898   unsigned CCP8IF               : 1;
3899   unsigned CCP9IF               : 1;
3900   unsigned CCP10IF              : 1;
3901   } __PIR4bits_t;
3902 
3903 extern __at(0x0F8F) volatile __PIR4bits_t PIR4bits;
3904 
3905 #define _CCP3IF                 0x01
3906 #define _CCP4IF                 0x02
3907 #define _CCP5IF                 0x04
3908 #define _CCP6IF                 0x08
3909 #define _CCP7IF                 0x10
3910 #define _CCP8IF                 0x20
3911 #define _CCP9IF                 0x40
3912 #define _CCP10IF                0x80
3913 
3914 //==============================================================================
3915 
3916 
3917 //==============================================================================
3918 //        IPR4 Bits
3919 
3920 extern __at(0x0F90) __sfr IPR4;
3921 
3922 typedef struct
3923   {
3924   unsigned CCP3IP               : 1;
3925   unsigned CCP4IP               : 1;
3926   unsigned CCP5IP               : 1;
3927   unsigned CCP6IP               : 1;
3928   unsigned CCP7IP               : 1;
3929   unsigned CCP8IP               : 1;
3930   unsigned CCP9IP               : 1;
3931   unsigned CCP10IP              : 1;
3932   } __IPR4bits_t;
3933 
3934 extern __at(0x0F90) volatile __IPR4bits_t IPR4bits;
3935 
3936 #define _CCP3IP                 0x01
3937 #define _CCP4IP                 0x02
3938 #define _CCP5IP                 0x04
3939 #define _CCP6IP                 0x08
3940 #define _CCP7IP                 0x10
3941 #define _CCP8IP                 0x20
3942 #define _CCP9IP                 0x40
3943 #define _CCP10IP                0x80
3944 
3945 //==============================================================================
3946 
3947 
3948 //==============================================================================
3949 //        PIE5 Bits
3950 
3951 extern __at(0x0F91) __sfr PIE5;
3952 
3953 typedef struct
3954   {
3955   unsigned TMR1GIE              : 1;
3956   unsigned TMR5GIE              : 1;
3957   unsigned TMR5IE               : 1;
3958   unsigned TMR6IE               : 1;
3959   unsigned TMR8IE               : 1;
3960   unsigned CM3IE                : 1;
3961   unsigned                      : 1;
3962   unsigned                      : 1;
3963   } __PIE5bits_t;
3964 
3965 extern __at(0x0F91) volatile __PIE5bits_t PIE5bits;
3966 
3967 #define _TMR1GIE                0x01
3968 #define _TMR5GIE                0x02
3969 #define _TMR5IE                 0x04
3970 #define _TMR6IE                 0x08
3971 #define _TMR8IE                 0x10
3972 #define _CM3IE                  0x20
3973 
3974 //==============================================================================
3975 
3976 
3977 //==============================================================================
3978 //        TRISA Bits
3979 
3980 extern __at(0x0F92) __sfr TRISA;
3981 
3982 typedef struct
3983   {
3984   unsigned TRISA0               : 1;
3985   unsigned TRISA1               : 1;
3986   unsigned TRISA2               : 1;
3987   unsigned TRISA3               : 1;
3988   unsigned                      : 1;
3989   unsigned TRISA5               : 1;
3990   unsigned TRISA6               : 1;
3991   unsigned TRISA7               : 1;
3992   } __TRISAbits_t;
3993 
3994 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
3995 
3996 #define _TRISA0                 0x01
3997 #define _TRISA1                 0x02
3998 #define _TRISA2                 0x04
3999 #define _TRISA3                 0x08
4000 #define _TRISA5                 0x20
4001 #define _TRISA6                 0x40
4002 #define _TRISA7                 0x80
4003 
4004 //==============================================================================
4005 
4006 
4007 //==============================================================================
4008 //        TRISB Bits
4009 
4010 extern __at(0x0F93) __sfr TRISB;
4011 
4012 typedef struct
4013   {
4014   unsigned TRISB0               : 1;
4015   unsigned TRISB1               : 1;
4016   unsigned TRISB2               : 1;
4017   unsigned TRISB3               : 1;
4018   unsigned TRISB4               : 1;
4019   unsigned TRISB5               : 1;
4020   unsigned TRISB6               : 1;
4021   unsigned TRISB7               : 1;
4022   } __TRISBbits_t;
4023 
4024 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
4025 
4026 #define _TRISB0                 0x01
4027 #define _TRISB1                 0x02
4028 #define _TRISB2                 0x04
4029 #define _TRISB3                 0x08
4030 #define _TRISB4                 0x10
4031 #define _TRISB5                 0x20
4032 #define _TRISB6                 0x40
4033 #define _TRISB7                 0x80
4034 
4035 //==============================================================================
4036 
4037 
4038 //==============================================================================
4039 //        TRISC Bits
4040 
4041 extern __at(0x0F94) __sfr TRISC;
4042 
4043 typedef struct
4044   {
4045   unsigned TRISC0               : 1;
4046   unsigned TRISC1               : 1;
4047   unsigned TRISC2               : 1;
4048   unsigned                      : 1;
4049   unsigned                      : 1;
4050   unsigned                      : 1;
4051   unsigned TRISC6               : 1;
4052   unsigned TRISC7               : 1;
4053   } __TRISCbits_t;
4054 
4055 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
4056 
4057 #define _TRISC0                 0x01
4058 #define _TRISC1                 0x02
4059 #define _TRISC2                 0x04
4060 #define _TRISC6                 0x40
4061 #define _TRISC7                 0x80
4062 
4063 //==============================================================================
4064 
4065 
4066 //==============================================================================
4067 //        T3GCON Bits
4068 
4069 extern __at(0x0F97) __sfr T3GCON;
4070 
4071 typedef union
4072   {
4073   struct
4074     {
4075     unsigned T3GSS0             : 1;
4076     unsigned T3GSS1             : 1;
4077     unsigned T3GVAL             : 1;
4078     unsigned T3GGO_T3DONE       : 1;
4079     unsigned T3GSPM             : 1;
4080     unsigned T3GTM              : 1;
4081     unsigned T3GPOL             : 1;
4082     unsigned TMR3GE             : 1;
4083     };
4084 
4085   struct
4086     {
4087     unsigned                    : 1;
4088     unsigned                    : 1;
4089     unsigned                    : 1;
4090     unsigned T3GGO              : 1;
4091     unsigned                    : 1;
4092     unsigned                    : 1;
4093     unsigned                    : 1;
4094     unsigned                    : 1;
4095     };
4096 
4097   struct
4098     {
4099     unsigned                    : 1;
4100     unsigned                    : 1;
4101     unsigned                    : 1;
4102     unsigned NOT_T3DONE         : 1;
4103     unsigned                    : 1;
4104     unsigned                    : 1;
4105     unsigned                    : 1;
4106     unsigned                    : 1;
4107     };
4108 
4109   struct
4110     {
4111     unsigned T3GSS              : 2;
4112     unsigned                    : 6;
4113     };
4114   } __T3GCONbits_t;
4115 
4116 extern __at(0x0F97) volatile __T3GCONbits_t T3GCONbits;
4117 
4118 #define _T3GSS0                 0x01
4119 #define _T3GSS1                 0x02
4120 #define _T3GVAL                 0x04
4121 #define _T3GGO_T3DONE           0x08
4122 #define _T3GGO                  0x08
4123 #define _NOT_T3DONE             0x08
4124 #define _T3GSPM                 0x10
4125 #define _T3GTM                  0x20
4126 #define _T3GPOL                 0x40
4127 #define _TMR3GE                 0x80
4128 
4129 //==============================================================================
4130 
4131 
4132 //==============================================================================
4133 //        PIR5 Bits
4134 
4135 extern __at(0x0F98) __sfr PIR5;
4136 
4137 typedef struct
4138   {
4139   unsigned TMR1GIF              : 1;
4140   unsigned TMR5GIF              : 1;
4141   unsigned TMR5IF               : 1;
4142   unsigned TMR6IF               : 1;
4143   unsigned TMR8IF               : 1;
4144   unsigned CM3IF                : 1;
4145   unsigned                      : 1;
4146   unsigned                      : 1;
4147   } __PIR5bits_t;
4148 
4149 extern __at(0x0F98) volatile __PIR5bits_t PIR5bits;
4150 
4151 #define _TMR1GIF                0x01
4152 #define _TMR5GIF                0x02
4153 #define _TMR5IF                 0x04
4154 #define _TMR6IF                 0x08
4155 #define _TMR8IF                 0x10
4156 #define _CM3IF                  0x20
4157 
4158 //==============================================================================
4159 
4160 
4161 //==============================================================================
4162 //        IPR5 Bits
4163 
4164 extern __at(0x0F99) __sfr IPR5;
4165 
4166 typedef struct
4167   {
4168   unsigned TMR1GIP              : 1;
4169   unsigned TMR5GIP              : 1;
4170   unsigned TMR5IP               : 1;
4171   unsigned TMR6IP               : 1;
4172   unsigned TMR8IP               : 1;
4173   unsigned CM3IP                : 1;
4174   unsigned                      : 1;
4175   unsigned                      : 1;
4176   } __IPR5bits_t;
4177 
4178 extern __at(0x0F99) volatile __IPR5bits_t IPR5bits;
4179 
4180 #define _TMR1GIP                0x01
4181 #define _TMR5GIP                0x02
4182 #define _TMR5IP                 0x04
4183 #define _TMR6IP                 0x08
4184 #define _TMR8IP                 0x10
4185 #define _CM3IP                  0x20
4186 
4187 //==============================================================================
4188 
4189 
4190 //==============================================================================
4191 //        T1GCON Bits
4192 
4193 extern __at(0x0F9A) __sfr T1GCON;
4194 
4195 typedef union
4196   {
4197   struct
4198     {
4199     unsigned T1GSS0             : 1;
4200     unsigned T1GSS1             : 1;
4201     unsigned T1GVAL             : 1;
4202     unsigned T1GGO_NOT_T1DONE   : 1;
4203     unsigned T1GSPM             : 1;
4204     unsigned T1GTM              : 1;
4205     unsigned T1GPOL             : 1;
4206     unsigned TMR1GE             : 1;
4207     };
4208 
4209   struct
4210     {
4211     unsigned                    : 1;
4212     unsigned                    : 1;
4213     unsigned                    : 1;
4214     unsigned T1GGO              : 1;
4215     unsigned                    : 1;
4216     unsigned                    : 1;
4217     unsigned                    : 1;
4218     unsigned                    : 1;
4219     };
4220 
4221   struct
4222     {
4223     unsigned                    : 1;
4224     unsigned                    : 1;
4225     unsigned                    : 1;
4226     unsigned NOT_T1DONE         : 1;
4227     unsigned                    : 1;
4228     unsigned                    : 1;
4229     unsigned                    : 1;
4230     unsigned                    : 1;
4231     };
4232 
4233   struct
4234     {
4235     unsigned                    : 1;
4236     unsigned                    : 1;
4237     unsigned                    : 1;
4238     unsigned T1DONE             : 1;
4239     unsigned                    : 1;
4240     unsigned                    : 1;
4241     unsigned                    : 1;
4242     unsigned                    : 1;
4243     };
4244 
4245   struct
4246     {
4247     unsigned T1GSS              : 2;
4248     unsigned                    : 6;
4249     };
4250   } __T1GCONbits_t;
4251 
4252 extern __at(0x0F9A) volatile __T1GCONbits_t T1GCONbits;
4253 
4254 #define _T1GSS0                 0x01
4255 #define _T1GSS1                 0x02
4256 #define _T1GVAL                 0x04
4257 #define _T1GGO_NOT_T1DONE       0x08
4258 #define _T1GGO                  0x08
4259 #define _NOT_T1DONE             0x08
4260 #define _T1DONE                 0x08
4261 #define _T1GSPM                 0x10
4262 #define _T1GTM                  0x20
4263 #define _T1GPOL                 0x40
4264 #define _TMR1GE                 0x80
4265 
4266 //==============================================================================
4267 
4268 
4269 //==============================================================================
4270 //        OSCTUNE Bits
4271 
4272 extern __at(0x0F9B) __sfr OSCTUNE;
4273 
4274 typedef union
4275   {
4276   struct
4277     {
4278     unsigned TUN0               : 1;
4279     unsigned TUN1               : 1;
4280     unsigned TUN2               : 1;
4281     unsigned TUN3               : 1;
4282     unsigned TUN4               : 1;
4283     unsigned TUN5               : 1;
4284     unsigned PLLEN              : 1;
4285     unsigned INTSRC             : 1;
4286     };
4287 
4288   struct
4289     {
4290     unsigned TUN                : 6;
4291     unsigned                    : 2;
4292     };
4293   } __OSCTUNEbits_t;
4294 
4295 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
4296 
4297 #define _TUN0                   0x01
4298 #define _TUN1                   0x02
4299 #define _TUN2                   0x04
4300 #define _TUN3                   0x08
4301 #define _TUN4                   0x10
4302 #define _TUN5                   0x20
4303 #define _PLLEN                  0x40
4304 #define _INTSRC                 0x80
4305 
4306 //==============================================================================
4307 
4308 
4309 //==============================================================================
4310 //        RCSTA2 Bits
4311 
4312 extern __at(0x0F9C) __sfr RCSTA2;
4313 
4314 typedef union
4315   {
4316   struct
4317     {
4318     unsigned RX9D               : 1;
4319     unsigned OERR               : 1;
4320     unsigned FERR               : 1;
4321     unsigned ADDEN              : 1;
4322     unsigned CREN               : 1;
4323     unsigned SREN               : 1;
4324     unsigned RX9                : 1;
4325     unsigned SPEN               : 1;
4326     };
4327 
4328   struct
4329     {
4330     unsigned RX9D2              : 1;
4331     unsigned OERR2              : 1;
4332     unsigned FERR2              : 1;
4333     unsigned ADDEN2             : 1;
4334     unsigned CREN2              : 1;
4335     unsigned SREN2              : 1;
4336     unsigned RX92               : 1;
4337     unsigned SPEN2              : 1;
4338     };
4339   } __RCSTA2bits_t;
4340 
4341 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
4342 
4343 #define _RCSTA2_RX9D            0x01
4344 #define _RCSTA2_RX9D2           0x01
4345 #define _RCSTA2_OERR            0x02
4346 #define _RCSTA2_OERR2           0x02
4347 #define _RCSTA2_FERR            0x04
4348 #define _RCSTA2_FERR2           0x04
4349 #define _RCSTA2_ADDEN           0x08
4350 #define _RCSTA2_ADDEN2          0x08
4351 #define _RCSTA2_CREN            0x10
4352 #define _RCSTA2_CREN2           0x10
4353 #define _RCSTA2_SREN            0x20
4354 #define _RCSTA2_SREN2           0x20
4355 #define _RCSTA2_RX9             0x40
4356 #define _RCSTA2_RX92            0x40
4357 #define _RCSTA2_SPEN            0x80
4358 #define _RCSTA2_SPEN2           0x80
4359 
4360 //==============================================================================
4361 
4362 
4363 //==============================================================================
4364 //        PIE1 Bits
4365 
4366 extern __at(0x0F9D) __sfr PIE1;
4367 
4368 typedef union
4369   {
4370   struct
4371     {
4372     unsigned TMR1IE             : 1;
4373     unsigned TMR2IE             : 1;
4374     unsigned CCP1IE             : 1;
4375     unsigned SSP1IE             : 1;
4376     unsigned TX1IE              : 1;
4377     unsigned RC1IE              : 1;
4378     unsigned ADIE               : 1;
4379     unsigned                    : 1;
4380     };
4381 
4382   struct
4383     {
4384     unsigned                    : 1;
4385     unsigned                    : 1;
4386     unsigned                    : 1;
4387     unsigned SSPIE              : 1;
4388     unsigned TXIE               : 1;
4389     unsigned RCIE               : 1;
4390     unsigned                    : 1;
4391     unsigned                    : 1;
4392     };
4393   } __PIE1bits_t;
4394 
4395 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
4396 
4397 #define _TMR1IE                 0x01
4398 #define _TMR2IE                 0x02
4399 #define _CCP1IE                 0x04
4400 #define _SSP1IE                 0x08
4401 #define _SSPIE                  0x08
4402 #define _TX1IE                  0x10
4403 #define _TXIE                   0x10
4404 #define _RC1IE                  0x20
4405 #define _RCIE                   0x20
4406 #define _ADIE                   0x40
4407 
4408 //==============================================================================
4409 
4410 
4411 //==============================================================================
4412 //        PIR1 Bits
4413 
4414 extern __at(0x0F9E) __sfr PIR1;
4415 
4416 typedef union
4417   {
4418   struct
4419     {
4420     unsigned TMR1IF             : 1;
4421     unsigned TMR2IF             : 1;
4422     unsigned CCP1IF             : 1;
4423     unsigned SSP1IF             : 1;
4424     unsigned TX1IF              : 1;
4425     unsigned RC1IF              : 1;
4426     unsigned ADIF               : 1;
4427     unsigned                    : 1;
4428     };
4429 
4430   struct
4431     {
4432     unsigned                    : 1;
4433     unsigned                    : 1;
4434     unsigned                    : 1;
4435     unsigned SSPIF              : 1;
4436     unsigned TXIF               : 1;
4437     unsigned RCIF               : 1;
4438     unsigned                    : 1;
4439     unsigned                    : 1;
4440     };
4441   } __PIR1bits_t;
4442 
4443 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4444 
4445 #define _TMR1IF                 0x01
4446 #define _TMR2IF                 0x02
4447 #define _CCP1IF                 0x04
4448 #define _SSP1IF                 0x08
4449 #define _SSPIF                  0x08
4450 #define _TX1IF                  0x10
4451 #define _TXIF                   0x10
4452 #define _RC1IF                  0x20
4453 #define _RCIF                   0x20
4454 #define _ADIF                   0x40
4455 
4456 //==============================================================================
4457 
4458 
4459 //==============================================================================
4460 //        IPR1 Bits
4461 
4462 extern __at(0x0F9F) __sfr IPR1;
4463 
4464 typedef union
4465   {
4466   struct
4467     {
4468     unsigned TMR1IP             : 1;
4469     unsigned TMR2IP             : 1;
4470     unsigned CCP1IP             : 1;
4471     unsigned SSP1IP             : 1;
4472     unsigned TX1IP              : 1;
4473     unsigned RC1IP              : 1;
4474     unsigned ADIP               : 1;
4475     unsigned                    : 1;
4476     };
4477 
4478   struct
4479     {
4480     unsigned                    : 1;
4481     unsigned                    : 1;
4482     unsigned                    : 1;
4483     unsigned SSPIP              : 1;
4484     unsigned TXIP               : 1;
4485     unsigned RCIP               : 1;
4486     unsigned                    : 1;
4487     unsigned                    : 1;
4488     };
4489   } __IPR1bits_t;
4490 
4491 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4492 
4493 #define _TMR1IP                 0x01
4494 #define _TMR2IP                 0x02
4495 #define _CCP1IP                 0x04
4496 #define _SSP1IP                 0x08
4497 #define _SSPIP                  0x08
4498 #define _TX1IP                  0x10
4499 #define _TXIP                   0x10
4500 #define _RC1IP                  0x20
4501 #define _RCIP                   0x20
4502 #define _ADIP                   0x40
4503 
4504 //==============================================================================
4505 
4506 
4507 //==============================================================================
4508 //        PIE2 Bits
4509 
4510 extern __at(0x0FA0) __sfr PIE2;
4511 
4512 typedef union
4513   {
4514   struct
4515     {
4516     unsigned CCP2IE             : 1;
4517     unsigned TMR3IE             : 1;
4518     unsigned LVDIE              : 1;
4519     unsigned BCL1IE             : 1;
4520     unsigned USBIE              : 1;
4521     unsigned CM1IE              : 1;
4522     unsigned CM2IE              : 1;
4523     unsigned OSCFIE             : 1;
4524     };
4525 
4526   struct
4527     {
4528     unsigned                    : 1;
4529     unsigned                    : 1;
4530     unsigned HLVDIE             : 1;
4531     unsigned BCLIE              : 1;
4532     unsigned                    : 1;
4533     unsigned                    : 1;
4534     unsigned                    : 1;
4535     unsigned                    : 1;
4536     };
4537   } __PIE2bits_t;
4538 
4539 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4540 
4541 #define _CCP2IE                 0x01
4542 #define _TMR3IE                 0x02
4543 #define _LVDIE                  0x04
4544 #define _HLVDIE                 0x04
4545 #define _BCL1IE                 0x08
4546 #define _BCLIE                  0x08
4547 #define _USBIE                  0x10
4548 #define _CM1IE                  0x20
4549 #define _CM2IE                  0x40
4550 #define _OSCFIE                 0x80
4551 
4552 //==============================================================================
4553 
4554 
4555 //==============================================================================
4556 //        PIR2 Bits
4557 
4558 extern __at(0x0FA1) __sfr PIR2;
4559 
4560 typedef union
4561   {
4562   struct
4563     {
4564     unsigned CCP2IF             : 1;
4565     unsigned TMR3IF             : 1;
4566     unsigned LVDIF              : 1;
4567     unsigned BCL1IF             : 1;
4568     unsigned USBIF              : 1;
4569     unsigned CM1IF              : 1;
4570     unsigned CM2IF              : 1;
4571     unsigned OSCFIF             : 1;
4572     };
4573 
4574   struct
4575     {
4576     unsigned                    : 1;
4577     unsigned                    : 1;
4578     unsigned HLVDIF             : 1;
4579     unsigned BCLIF              : 1;
4580     unsigned                    : 1;
4581     unsigned                    : 1;
4582     unsigned                    : 1;
4583     unsigned                    : 1;
4584     };
4585   } __PIR2bits_t;
4586 
4587 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4588 
4589 #define _CCP2IF                 0x01
4590 #define _TMR3IF                 0x02
4591 #define _LVDIF                  0x04
4592 #define _HLVDIF                 0x04
4593 #define _BCL1IF                 0x08
4594 #define _BCLIF                  0x08
4595 #define _USBIF                  0x10
4596 #define _CM1IF                  0x20
4597 #define _CM2IF                  0x40
4598 #define _OSCFIF                 0x80
4599 
4600 //==============================================================================
4601 
4602 
4603 //==============================================================================
4604 //        IPR2 Bits
4605 
4606 extern __at(0x0FA2) __sfr IPR2;
4607 
4608 typedef union
4609   {
4610   struct
4611     {
4612     unsigned CCP2IP             : 1;
4613     unsigned TMR3IP             : 1;
4614     unsigned LVDIP              : 1;
4615     unsigned BCL1IP             : 1;
4616     unsigned USBIP              : 1;
4617     unsigned CM1IP              : 1;
4618     unsigned CM2IP              : 1;
4619     unsigned OSCFIP             : 1;
4620     };
4621 
4622   struct
4623     {
4624     unsigned                    : 1;
4625     unsigned                    : 1;
4626     unsigned HLVDIP             : 1;
4627     unsigned BCLIP              : 1;
4628     unsigned                    : 1;
4629     unsigned                    : 1;
4630     unsigned                    : 1;
4631     unsigned                    : 1;
4632     };
4633   } __IPR2bits_t;
4634 
4635 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4636 
4637 #define _CCP2IP                 0x01
4638 #define _TMR3IP                 0x02
4639 #define _LVDIP                  0x04
4640 #define _HLVDIP                 0x04
4641 #define _BCL1IP                 0x08
4642 #define _BCLIP                  0x08
4643 #define _USBIP                  0x10
4644 #define _CM1IP                  0x20
4645 #define _CM2IP                  0x40
4646 #define _OSCFIP                 0x80
4647 
4648 //==============================================================================
4649 
4650 
4651 //==============================================================================
4652 //        PIE3 Bits
4653 
4654 extern __at(0x0FA3) __sfr PIE3;
4655 
4656 typedef struct
4657   {
4658   unsigned RTCCIE               : 1;
4659   unsigned TMR3GIE              : 1;
4660   unsigned CTMUIE               : 1;
4661   unsigned TMR4IE               : 1;
4662   unsigned TX2IE                : 1;
4663   unsigned RC2IE                : 1;
4664   unsigned BCL2IE               : 1;
4665   unsigned SSP2IE               : 1;
4666   } __PIE3bits_t;
4667 
4668 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4669 
4670 #define _RTCCIE                 0x01
4671 #define _TMR3GIE                0x02
4672 #define _CTMUIE                 0x04
4673 #define _TMR4IE                 0x08
4674 #define _TX2IE                  0x10
4675 #define _RC2IE                  0x20
4676 #define _BCL2IE                 0x40
4677 #define _SSP2IE                 0x80
4678 
4679 //==============================================================================
4680 
4681 
4682 //==============================================================================
4683 //        PIR3 Bits
4684 
4685 extern __at(0x0FA4) __sfr PIR3;
4686 
4687 typedef struct
4688   {
4689   unsigned RTCCIF               : 1;
4690   unsigned TMR3GIF              : 1;
4691   unsigned CTMUIF               : 1;
4692   unsigned TMR4IF               : 1;
4693   unsigned TX2IF                : 1;
4694   unsigned RC2IF                : 1;
4695   unsigned BCL2IF               : 1;
4696   unsigned SSP2IF               : 1;
4697   } __PIR3bits_t;
4698 
4699 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
4700 
4701 #define _RTCCIF                 0x01
4702 #define _TMR3GIF                0x02
4703 #define _CTMUIF                 0x04
4704 #define _TMR4IF                 0x08
4705 #define _TX2IF                  0x10
4706 #define _RC2IF                  0x20
4707 #define _BCL2IF                 0x40
4708 #define _SSP2IF                 0x80
4709 
4710 //==============================================================================
4711 
4712 
4713 //==============================================================================
4714 //        IPR3 Bits
4715 
4716 extern __at(0x0FA5) __sfr IPR3;
4717 
4718 typedef struct
4719   {
4720   unsigned RTCCIP               : 1;
4721   unsigned TMR3GIP              : 1;
4722   unsigned CTMUIP               : 1;
4723   unsigned TMR4IP               : 1;
4724   unsigned TX2IP                : 1;
4725   unsigned RC2IP                : 1;
4726   unsigned BCL2IP               : 1;
4727   unsigned SSP2IP               : 1;
4728   } __IPR3bits_t;
4729 
4730 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4731 
4732 #define _RTCCIP                 0x01
4733 #define _TMR3GIP                0x02
4734 #define _CTMUIP                 0x04
4735 #define _TMR4IP                 0x08
4736 #define _TX2IP                  0x10
4737 #define _RC2IP                  0x20
4738 #define _BCL2IP                 0x40
4739 #define _SSP2IP                 0x80
4740 
4741 //==============================================================================
4742 
4743 
4744 //==============================================================================
4745 //        EECON1 Bits
4746 
4747 extern __at(0x0FA6) __sfr EECON1;
4748 
4749 typedef struct
4750   {
4751   unsigned                      : 1;
4752   unsigned WR                   : 1;
4753   unsigned WREN                 : 1;
4754   unsigned WRERR                : 1;
4755   unsigned FREE                 : 1;
4756   unsigned WPROG                : 1;
4757   unsigned                      : 1;
4758   unsigned                      : 1;
4759   } __EECON1bits_t;
4760 
4761 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
4762 
4763 #define _WR                     0x02
4764 #define _WREN                   0x04
4765 #define _WRERR                  0x08
4766 #define _FREE                   0x10
4767 #define _WPROG                  0x20
4768 
4769 //==============================================================================
4770 
4771 extern __at(0x0FA7) __sfr EECON2;
4772 
4773 //==============================================================================
4774 //        TXSTA2 Bits
4775 
4776 extern __at(0x0FA8) __sfr TXSTA2;
4777 
4778 typedef union
4779   {
4780   struct
4781     {
4782     unsigned TX9D               : 1;
4783     unsigned TRMT               : 1;
4784     unsigned BRGH               : 1;
4785     unsigned SENDB              : 1;
4786     unsigned SYNC               : 1;
4787     unsigned TXEN               : 1;
4788     unsigned TX9                : 1;
4789     unsigned CSRC               : 1;
4790     };
4791 
4792   struct
4793     {
4794     unsigned TX9D2              : 1;
4795     unsigned TRMT2              : 1;
4796     unsigned BRGH2              : 1;
4797     unsigned SENDB2             : 1;
4798     unsigned SYNC2              : 1;
4799     unsigned TXEN2              : 1;
4800     unsigned TX92               : 1;
4801     unsigned CSRC2              : 1;
4802     };
4803   } __TXSTA2bits_t;
4804 
4805 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
4806 
4807 #define _TXSTA2_TX9D            0x01
4808 #define _TXSTA2_TX9D2           0x01
4809 #define _TXSTA2_TRMT            0x02
4810 #define _TXSTA2_TRMT2           0x02
4811 #define _TXSTA2_BRGH            0x04
4812 #define _TXSTA2_BRGH2           0x04
4813 #define _TXSTA2_SENDB           0x08
4814 #define _TXSTA2_SENDB2          0x08
4815 #define _TXSTA2_SYNC            0x10
4816 #define _TXSTA2_SYNC2           0x10
4817 #define _TXSTA2_TXEN            0x20
4818 #define _TXSTA2_TXEN2           0x20
4819 #define _TXSTA2_TX9             0x40
4820 #define _TXSTA2_TX92            0x40
4821 #define _TXSTA2_CSRC            0x80
4822 #define _TXSTA2_CSRC2           0x80
4823 
4824 //==============================================================================
4825 
4826 extern __at(0x0FA9) __sfr TXREG2;
4827 extern __at(0x0FAA) __sfr RCREG2;
4828 extern __at(0x0FAB) __sfr SPBRG2;
4829 
4830 //==============================================================================
4831 //        RCSTA Bits
4832 
4833 extern __at(0x0FAC) __sfr RCSTA;
4834 
4835 typedef union
4836   {
4837   struct
4838     {
4839     unsigned RX9D               : 1;
4840     unsigned OERR               : 1;
4841     unsigned FERR               : 1;
4842     unsigned ADDEN              : 1;
4843     unsigned CREN               : 1;
4844     unsigned SREN               : 1;
4845     unsigned RX9                : 1;
4846     unsigned SPEN               : 1;
4847     };
4848 
4849   struct
4850     {
4851     unsigned RCD8               : 1;
4852     unsigned OERR1              : 1;
4853     unsigned FERR1              : 1;
4854     unsigned ADEN               : 1;
4855     unsigned CREN1              : 1;
4856     unsigned SREN1              : 1;
4857     unsigned RC9                : 1;
4858     unsigned SPEN1              : 1;
4859     };
4860 
4861   struct
4862     {
4863     unsigned RX9D1              : 1;
4864     unsigned                    : 1;
4865     unsigned                    : 1;
4866     unsigned ADDEN1             : 1;
4867     unsigned                    : 1;
4868     unsigned                    : 1;
4869     unsigned NOT_RC8            : 1;
4870     unsigned                    : 1;
4871     };
4872 
4873   struct
4874     {
4875     unsigned                    : 1;
4876     unsigned                    : 1;
4877     unsigned                    : 1;
4878     unsigned                    : 1;
4879     unsigned                    : 1;
4880     unsigned                    : 1;
4881     unsigned RC8_9              : 1;
4882     unsigned                    : 1;
4883     };
4884 
4885   struct
4886     {
4887     unsigned                    : 1;
4888     unsigned                    : 1;
4889     unsigned                    : 1;
4890     unsigned                    : 1;
4891     unsigned                    : 1;
4892     unsigned                    : 1;
4893     unsigned RX91               : 1;
4894     unsigned                    : 1;
4895     };
4896   } __RCSTAbits_t;
4897 
4898 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
4899 
4900 #define _RX9D                   0x01
4901 #define _RCD8                   0x01
4902 #define _RX9D1                  0x01
4903 #define _OERR                   0x02
4904 #define _OERR1                  0x02
4905 #define _FERR                   0x04
4906 #define _FERR1                  0x04
4907 #define _ADDEN                  0x08
4908 #define _ADEN                   0x08
4909 #define _ADDEN1                 0x08
4910 #define _CREN                   0x10
4911 #define _CREN1                  0x10
4912 #define _SREN                   0x20
4913 #define _SREN1                  0x20
4914 #define _RX9                    0x40
4915 #define _RC9                    0x40
4916 #define _NOT_RC8                0x40
4917 #define _RC8_9                  0x40
4918 #define _RX91                   0x40
4919 #define _SPEN                   0x80
4920 #define _SPEN1                  0x80
4921 
4922 //==============================================================================
4923 
4924 
4925 //==============================================================================
4926 //        RCSTA1 Bits
4927 
4928 extern __at(0x0FAC) __sfr RCSTA1;
4929 
4930 typedef union
4931   {
4932   struct
4933     {
4934     unsigned RX9D               : 1;
4935     unsigned OERR               : 1;
4936     unsigned FERR               : 1;
4937     unsigned ADDEN              : 1;
4938     unsigned CREN               : 1;
4939     unsigned SREN               : 1;
4940     unsigned RX9                : 1;
4941     unsigned SPEN               : 1;
4942     };
4943 
4944   struct
4945     {
4946     unsigned RCD8               : 1;
4947     unsigned OERR1              : 1;
4948     unsigned FERR1              : 1;
4949     unsigned ADEN               : 1;
4950     unsigned CREN1              : 1;
4951     unsigned SREN1              : 1;
4952     unsigned RC9                : 1;
4953     unsigned SPEN1              : 1;
4954     };
4955 
4956   struct
4957     {
4958     unsigned RX9D1              : 1;
4959     unsigned                    : 1;
4960     unsigned                    : 1;
4961     unsigned ADDEN1             : 1;
4962     unsigned                    : 1;
4963     unsigned                    : 1;
4964     unsigned NOT_RC8            : 1;
4965     unsigned                    : 1;
4966     };
4967 
4968   struct
4969     {
4970     unsigned                    : 1;
4971     unsigned                    : 1;
4972     unsigned                    : 1;
4973     unsigned                    : 1;
4974     unsigned                    : 1;
4975     unsigned                    : 1;
4976     unsigned RC8_9              : 1;
4977     unsigned                    : 1;
4978     };
4979 
4980   struct
4981     {
4982     unsigned                    : 1;
4983     unsigned                    : 1;
4984     unsigned                    : 1;
4985     unsigned                    : 1;
4986     unsigned                    : 1;
4987     unsigned                    : 1;
4988     unsigned RX91               : 1;
4989     unsigned                    : 1;
4990     };
4991   } __RCSTA1bits_t;
4992 
4993 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
4994 
4995 #define _RCSTA1_RX9D            0x01
4996 #define _RCSTA1_RCD8            0x01
4997 #define _RCSTA1_RX9D1           0x01
4998 #define _RCSTA1_OERR            0x02
4999 #define _RCSTA1_OERR1           0x02
5000 #define _RCSTA1_FERR            0x04
5001 #define _RCSTA1_FERR1           0x04
5002 #define _RCSTA1_ADDEN           0x08
5003 #define _RCSTA1_ADEN            0x08
5004 #define _RCSTA1_ADDEN1          0x08
5005 #define _RCSTA1_CREN            0x10
5006 #define _RCSTA1_CREN1           0x10
5007 #define _RCSTA1_SREN            0x20
5008 #define _RCSTA1_SREN1           0x20
5009 #define _RCSTA1_RX9             0x40
5010 #define _RCSTA1_RC9             0x40
5011 #define _RCSTA1_NOT_RC8         0x40
5012 #define _RCSTA1_RC8_9           0x40
5013 #define _RCSTA1_RX91            0x40
5014 #define _RCSTA1_SPEN            0x80
5015 #define _RCSTA1_SPEN1           0x80
5016 
5017 //==============================================================================
5018 
5019 
5020 //==============================================================================
5021 //        TXSTA Bits
5022 
5023 extern __at(0x0FAD) __sfr TXSTA;
5024 
5025 typedef union
5026   {
5027   struct
5028     {
5029     unsigned TX9D               : 1;
5030     unsigned TRMT               : 1;
5031     unsigned BRGH               : 1;
5032     unsigned SENDB              : 1;
5033     unsigned SYNC               : 1;
5034     unsigned TXEN               : 1;
5035     unsigned TX9                : 1;
5036     unsigned CSRC               : 1;
5037     };
5038 
5039   struct
5040     {
5041     unsigned TXD8               : 1;
5042     unsigned TRMT1              : 1;
5043     unsigned BRGH1              : 1;
5044     unsigned SENDB1             : 1;
5045     unsigned SYNC1              : 1;
5046     unsigned TXEN1              : 1;
5047     unsigned TX8_9              : 1;
5048     unsigned CSRC1              : 1;
5049     };
5050 
5051   struct
5052     {
5053     unsigned TX9D1              : 1;
5054     unsigned                    : 1;
5055     unsigned                    : 1;
5056     unsigned                    : 1;
5057     unsigned                    : 1;
5058     unsigned                    : 1;
5059     unsigned NOT_TX8            : 1;
5060     unsigned                    : 1;
5061     };
5062 
5063   struct
5064     {
5065     unsigned                    : 1;
5066     unsigned                    : 1;
5067     unsigned                    : 1;
5068     unsigned                    : 1;
5069     unsigned                    : 1;
5070     unsigned                    : 1;
5071     unsigned TX91               : 1;
5072     unsigned                    : 1;
5073     };
5074   } __TXSTAbits_t;
5075 
5076 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
5077 
5078 #define _TX9D                   0x01
5079 #define _TXD8                   0x01
5080 #define _TX9D1                  0x01
5081 #define _TRMT                   0x02
5082 #define _TRMT1                  0x02
5083 #define _BRGH                   0x04
5084 #define _BRGH1                  0x04
5085 #define _SENDB                  0x08
5086 #define _SENDB1                 0x08
5087 #define _SYNC                   0x10
5088 #define _SYNC1                  0x10
5089 #define _TXEN                   0x20
5090 #define _TXEN1                  0x20
5091 #define _TX9                    0x40
5092 #define _TX8_9                  0x40
5093 #define _NOT_TX8                0x40
5094 #define _TX91                   0x40
5095 #define _CSRC                   0x80
5096 #define _CSRC1                  0x80
5097 
5098 //==============================================================================
5099 
5100 
5101 //==============================================================================
5102 //        TXSTA1 Bits
5103 
5104 extern __at(0x0FAD) __sfr TXSTA1;
5105 
5106 typedef union
5107   {
5108   struct
5109     {
5110     unsigned TX9D               : 1;
5111     unsigned TRMT               : 1;
5112     unsigned BRGH               : 1;
5113     unsigned SENDB              : 1;
5114     unsigned SYNC               : 1;
5115     unsigned TXEN               : 1;
5116     unsigned TX9                : 1;
5117     unsigned CSRC               : 1;
5118     };
5119 
5120   struct
5121     {
5122     unsigned TXD8               : 1;
5123     unsigned TRMT1              : 1;
5124     unsigned BRGH1              : 1;
5125     unsigned SENDB1             : 1;
5126     unsigned SYNC1              : 1;
5127     unsigned TXEN1              : 1;
5128     unsigned TX8_9              : 1;
5129     unsigned CSRC1              : 1;
5130     };
5131 
5132   struct
5133     {
5134     unsigned TX9D1              : 1;
5135     unsigned                    : 1;
5136     unsigned                    : 1;
5137     unsigned                    : 1;
5138     unsigned                    : 1;
5139     unsigned                    : 1;
5140     unsigned NOT_TX8            : 1;
5141     unsigned                    : 1;
5142     };
5143 
5144   struct
5145     {
5146     unsigned                    : 1;
5147     unsigned                    : 1;
5148     unsigned                    : 1;
5149     unsigned                    : 1;
5150     unsigned                    : 1;
5151     unsigned                    : 1;
5152     unsigned TX91               : 1;
5153     unsigned                    : 1;
5154     };
5155   } __TXSTA1bits_t;
5156 
5157 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
5158 
5159 #define _TXSTA1_TX9D            0x01
5160 #define _TXSTA1_TXD8            0x01
5161 #define _TXSTA1_TX9D1           0x01
5162 #define _TXSTA1_TRMT            0x02
5163 #define _TXSTA1_TRMT1           0x02
5164 #define _TXSTA1_BRGH            0x04
5165 #define _TXSTA1_BRGH1           0x04
5166 #define _TXSTA1_SENDB           0x08
5167 #define _TXSTA1_SENDB1          0x08
5168 #define _TXSTA1_SYNC            0x10
5169 #define _TXSTA1_SYNC1           0x10
5170 #define _TXSTA1_TXEN            0x20
5171 #define _TXSTA1_TXEN1           0x20
5172 #define _TXSTA1_TX9             0x40
5173 #define _TXSTA1_TX8_9           0x40
5174 #define _TXSTA1_NOT_TX8         0x40
5175 #define _TXSTA1_TX91            0x40
5176 #define _TXSTA1_CSRC            0x80
5177 #define _TXSTA1_CSRC1           0x80
5178 
5179 //==============================================================================
5180 
5181 extern __at(0x0FAE) __sfr TXREG;
5182 extern __at(0x0FAE) __sfr TXREG1;
5183 extern __at(0x0FAF) __sfr RCREG;
5184 extern __at(0x0FAF) __sfr RCREG1;
5185 extern __at(0x0FB0) __sfr SPBRG;
5186 extern __at(0x0FB0) __sfr SPBRG1;
5187 
5188 //==============================================================================
5189 //        CTMUICON Bits
5190 
5191 extern __at(0x0FB1) __sfr CTMUICON;
5192 
5193 typedef union
5194   {
5195   struct
5196     {
5197     unsigned IRNG0              : 1;
5198     unsigned IRNG1              : 1;
5199     unsigned ITRIM0             : 1;
5200     unsigned ITRIM1             : 1;
5201     unsigned ITRIM2             : 1;
5202     unsigned ITRIM3             : 1;
5203     unsigned ITRIM4             : 1;
5204     unsigned ITRIM5             : 1;
5205     };
5206 
5207   struct
5208     {
5209     unsigned IRNG               : 2;
5210     unsigned                    : 6;
5211     };
5212 
5213   struct
5214     {
5215     unsigned                    : 2;
5216     unsigned ITRIM              : 6;
5217     };
5218   } __CTMUICONbits_t;
5219 
5220 extern __at(0x0FB1) volatile __CTMUICONbits_t CTMUICONbits;
5221 
5222 #define _IRNG0                  0x01
5223 #define _IRNG1                  0x02
5224 #define _ITRIM0                 0x04
5225 #define _ITRIM1                 0x08
5226 #define _ITRIM2                 0x10
5227 #define _ITRIM3                 0x20
5228 #define _ITRIM4                 0x40
5229 #define _ITRIM5                 0x80
5230 
5231 //==============================================================================
5232 
5233 
5234 //==============================================================================
5235 //        CTMUCONL Bits
5236 
5237 extern __at(0x0FB2) __sfr CTMUCONL;
5238 
5239 typedef union
5240   {
5241   struct
5242     {
5243     unsigned EDG1STAT           : 1;
5244     unsigned EDG2STAT           : 1;
5245     unsigned EDG1SEL0           : 1;
5246     unsigned EDG1SEL1           : 1;
5247     unsigned EDG1POL            : 1;
5248     unsigned EDG2SEL0           : 1;
5249     unsigned EDG2SEL1           : 1;
5250     unsigned EDG2POL            : 1;
5251     };
5252 
5253   struct
5254     {
5255     unsigned                    : 2;
5256     unsigned EDG1SEL            : 2;
5257     unsigned                    : 4;
5258     };
5259 
5260   struct
5261     {
5262     unsigned                    : 5;
5263     unsigned EDG2SEL            : 2;
5264     unsigned                    : 1;
5265     };
5266   } __CTMUCONLbits_t;
5267 
5268 extern __at(0x0FB2) volatile __CTMUCONLbits_t CTMUCONLbits;
5269 
5270 #define _EDG1STAT               0x01
5271 #define _EDG2STAT               0x02
5272 #define _EDG1SEL0               0x04
5273 #define _EDG1SEL1               0x08
5274 #define _EDG1POL                0x10
5275 #define _EDG2SEL0               0x20
5276 #define _EDG2SEL1               0x40
5277 #define _EDG2POL                0x80
5278 
5279 //==============================================================================
5280 
5281 
5282 //==============================================================================
5283 //        CTMUCONH Bits
5284 
5285 extern __at(0x0FB3) __sfr CTMUCONH;
5286 
5287 typedef struct
5288   {
5289   unsigned CTTRIG               : 1;
5290   unsigned IDISSEN              : 1;
5291   unsigned EDGSEQEN             : 1;
5292   unsigned EDGEN                : 1;
5293   unsigned TGEN                 : 1;
5294   unsigned CTMUSIDL             : 1;
5295   unsigned                      : 1;
5296   unsigned CTMUEN               : 1;
5297   } __CTMUCONHbits_t;
5298 
5299 extern __at(0x0FB3) volatile __CTMUCONHbits_t CTMUCONHbits;
5300 
5301 #define _CTTRIG                 0x01
5302 #define _IDISSEN                0x02
5303 #define _EDGSEQEN               0x04
5304 #define _EDGEN                  0x08
5305 #define _TGEN                   0x10
5306 #define _CTMUSIDL               0x20
5307 #define _CTMUEN                 0x80
5308 
5309 //==============================================================================
5310 
5311 
5312 //==============================================================================
5313 //        CCP2CON Bits
5314 
5315 extern __at(0x0FB4) __sfr CCP2CON;
5316 
5317 typedef union
5318   {
5319   struct
5320     {
5321     unsigned CCP2M0             : 1;
5322     unsigned CCP2M1             : 1;
5323     unsigned CCP2M2             : 1;
5324     unsigned CCP2M3             : 1;
5325     unsigned DC2B0              : 1;
5326     unsigned DC2B1              : 1;
5327     unsigned P2M0               : 1;
5328     unsigned P2M1               : 1;
5329     };
5330 
5331   struct
5332     {
5333     unsigned                    : 1;
5334     unsigned                    : 1;
5335     unsigned                    : 1;
5336     unsigned                    : 1;
5337     unsigned CCP2Y              : 1;
5338     unsigned CCP2X              : 1;
5339     unsigned                    : 1;
5340     unsigned                    : 1;
5341     };
5342 
5343   struct
5344     {
5345     unsigned CCP2M              : 4;
5346     unsigned                    : 4;
5347     };
5348 
5349   struct
5350     {
5351     unsigned                    : 4;
5352     unsigned DC2B               : 2;
5353     unsigned                    : 2;
5354     };
5355 
5356   struct
5357     {
5358     unsigned                    : 6;
5359     unsigned P2M                : 2;
5360     };
5361   } __CCP2CONbits_t;
5362 
5363 extern __at(0x0FB4) volatile __CCP2CONbits_t CCP2CONbits;
5364 
5365 #define _CCP2M0                 0x01
5366 #define _CCP2M1                 0x02
5367 #define _CCP2M2                 0x04
5368 #define _CCP2M3                 0x08
5369 #define _DC2B0                  0x10
5370 #define _CCP2Y                  0x10
5371 #define _DC2B1                  0x20
5372 #define _CCP2X                  0x20
5373 #define _P2M0                   0x40
5374 #define _P2M1                   0x80
5375 
5376 //==============================================================================
5377 
5378 
5379 //==============================================================================
5380 //        ECCP2CON Bits
5381 
5382 extern __at(0x0FB4) __sfr ECCP2CON;
5383 
5384 typedef union
5385   {
5386   struct
5387     {
5388     unsigned CCP2M0             : 1;
5389     unsigned CCP2M1             : 1;
5390     unsigned CCP2M2             : 1;
5391     unsigned CCP2M3             : 1;
5392     unsigned DC2B0              : 1;
5393     unsigned DC2B1              : 1;
5394     unsigned P2M0               : 1;
5395     unsigned P2M1               : 1;
5396     };
5397 
5398   struct
5399     {
5400     unsigned                    : 1;
5401     unsigned                    : 1;
5402     unsigned                    : 1;
5403     unsigned                    : 1;
5404     unsigned CCP2Y              : 1;
5405     unsigned CCP2X              : 1;
5406     unsigned                    : 1;
5407     unsigned                    : 1;
5408     };
5409 
5410   struct
5411     {
5412     unsigned CCP2M              : 4;
5413     unsigned                    : 4;
5414     };
5415 
5416   struct
5417     {
5418     unsigned                    : 4;
5419     unsigned DC2B               : 2;
5420     unsigned                    : 2;
5421     };
5422 
5423   struct
5424     {
5425     unsigned                    : 6;
5426     unsigned P2M                : 2;
5427     };
5428   } __ECCP2CONbits_t;
5429 
5430 extern __at(0x0FB4) volatile __ECCP2CONbits_t ECCP2CONbits;
5431 
5432 #define _ECCP2CON_CCP2M0        0x01
5433 #define _ECCP2CON_CCP2M1        0x02
5434 #define _ECCP2CON_CCP2M2        0x04
5435 #define _ECCP2CON_CCP2M3        0x08
5436 #define _ECCP2CON_DC2B0         0x10
5437 #define _ECCP2CON_CCP2Y         0x10
5438 #define _ECCP2CON_DC2B1         0x20
5439 #define _ECCP2CON_CCP2X         0x20
5440 #define _ECCP2CON_P2M0          0x40
5441 #define _ECCP2CON_P2M1          0x80
5442 
5443 //==============================================================================
5444 
5445 extern __at(0x0FB5) __sfr CCPR2;
5446 extern __at(0x0FB5) __sfr CCPR2L;
5447 extern __at(0x0FB6) __sfr CCPR2H;
5448 
5449 //==============================================================================
5450 //        ECCP2DEL Bits
5451 
5452 extern __at(0x0FB7) __sfr ECCP2DEL;
5453 
5454 typedef union
5455   {
5456   struct
5457     {
5458     unsigned P2DC0              : 1;
5459     unsigned P2DC1              : 1;
5460     unsigned P2DC2              : 1;
5461     unsigned P2DC3              : 1;
5462     unsigned P2DC4              : 1;
5463     unsigned P2DC5              : 1;
5464     unsigned P2DC6              : 1;
5465     unsigned P2RSEN             : 1;
5466     };
5467 
5468   struct
5469     {
5470     unsigned P2DC               : 7;
5471     unsigned                    : 1;
5472     };
5473   } __ECCP2DELbits_t;
5474 
5475 extern __at(0x0FB7) volatile __ECCP2DELbits_t ECCP2DELbits;
5476 
5477 #define _P2DC0                  0x01
5478 #define _P2DC1                  0x02
5479 #define _P2DC2                  0x04
5480 #define _P2DC3                  0x08
5481 #define _P2DC4                  0x10
5482 #define _P2DC5                  0x20
5483 #define _P2DC6                  0x40
5484 #define _P2RSEN                 0x80
5485 
5486 //==============================================================================
5487 
5488 
5489 //==============================================================================
5490 //        PWM2CON Bits
5491 
5492 extern __at(0x0FB7) __sfr PWM2CON;
5493 
5494 typedef union
5495   {
5496   struct
5497     {
5498     unsigned P2DC0              : 1;
5499     unsigned P2DC1              : 1;
5500     unsigned P2DC2              : 1;
5501     unsigned P2DC3              : 1;
5502     unsigned P2DC4              : 1;
5503     unsigned P2DC5              : 1;
5504     unsigned P2DC6              : 1;
5505     unsigned P2RSEN             : 1;
5506     };
5507 
5508   struct
5509     {
5510     unsigned P2DC               : 7;
5511     unsigned                    : 1;
5512     };
5513   } __PWM2CONbits_t;
5514 
5515 extern __at(0x0FB7) volatile __PWM2CONbits_t PWM2CONbits;
5516 
5517 #define _PWM2CON_P2DC0          0x01
5518 #define _PWM2CON_P2DC1          0x02
5519 #define _PWM2CON_P2DC2          0x04
5520 #define _PWM2CON_P2DC3          0x08
5521 #define _PWM2CON_P2DC4          0x10
5522 #define _PWM2CON_P2DC5          0x20
5523 #define _PWM2CON_P2DC6          0x40
5524 #define _PWM2CON_P2RSEN         0x80
5525 
5526 //==============================================================================
5527 
5528 
5529 //==============================================================================
5530 //        ECCP2AS Bits
5531 
5532 extern __at(0x0FB8) __sfr ECCP2AS;
5533 
5534 typedef union
5535   {
5536   struct
5537     {
5538     unsigned PSS2BD0            : 1;
5539     unsigned PSS2BD1            : 1;
5540     unsigned PSS2AC0            : 1;
5541     unsigned PSS2AC1            : 1;
5542     unsigned ECCP2AS0           : 1;
5543     unsigned ECCP2AS1           : 1;
5544     unsigned ECCP2AS2           : 1;
5545     unsigned ECCP2ASE           : 1;
5546     };
5547 
5548   struct
5549     {
5550     unsigned PSS2BD             : 2;
5551     unsigned                    : 6;
5552     };
5553 
5554   struct
5555     {
5556     unsigned                    : 2;
5557     unsigned PSS2AC             : 2;
5558     unsigned                    : 4;
5559     };
5560 
5561   struct
5562     {
5563     unsigned                    : 4;
5564     unsigned ECCP2AS            : 3;
5565     unsigned                    : 1;
5566     };
5567   } __ECCP2ASbits_t;
5568 
5569 extern __at(0x0FB8) volatile __ECCP2ASbits_t ECCP2ASbits;
5570 
5571 #define _PSS2BD0                0x01
5572 #define _PSS2BD1                0x02
5573 #define _PSS2AC0                0x04
5574 #define _PSS2AC1                0x08
5575 #define _ECCP2AS0               0x10
5576 #define _ECCP2AS1               0x20
5577 #define _ECCP2AS2               0x40
5578 #define _ECCP2ASE               0x80
5579 
5580 //==============================================================================
5581 
5582 
5583 //==============================================================================
5584 //        PSTR2CON Bits
5585 
5586 extern __at(0x0FB9) __sfr PSTR2CON;
5587 
5588 typedef union
5589   {
5590   struct
5591     {
5592     unsigned STRA               : 1;
5593     unsigned STRB               : 1;
5594     unsigned STRC               : 1;
5595     unsigned STRD               : 1;
5596     unsigned STRSYNC            : 1;
5597     unsigned P2DC5              : 1;
5598     unsigned CMPL0              : 1;
5599     unsigned CMPL1              : 1;
5600     };
5601 
5602   struct
5603     {
5604     unsigned P2DC0              : 1;
5605     unsigned P2DC1              : 1;
5606     unsigned P2DC2              : 1;
5607     unsigned P2DC3              : 1;
5608     unsigned P2DC4              : 1;
5609     unsigned                    : 1;
5610     unsigned P2DC6              : 1;
5611     unsigned                    : 1;
5612     };
5613 
5614   struct
5615     {
5616     unsigned P2DC               : 7;
5617     unsigned                    : 1;
5618     };
5619 
5620   struct
5621     {
5622     unsigned                    : 6;
5623     unsigned CMPL               : 2;
5624     };
5625   } __PSTR2CONbits_t;
5626 
5627 extern __at(0x0FB9) volatile __PSTR2CONbits_t PSTR2CONbits;
5628 
5629 #define _PSTR2CON_STRA          0x01
5630 #define _PSTR2CON_P2DC0         0x01
5631 #define _PSTR2CON_STRB          0x02
5632 #define _PSTR2CON_P2DC1         0x02
5633 #define _PSTR2CON_STRC          0x04
5634 #define _PSTR2CON_P2DC2         0x04
5635 #define _PSTR2CON_STRD          0x08
5636 #define _PSTR2CON_P2DC3         0x08
5637 #define _PSTR2CON_STRSYNC       0x10
5638 #define _PSTR2CON_P2DC4         0x10
5639 #define _PSTR2CON_P2DC5         0x20
5640 #define _PSTR2CON_CMPL0         0x40
5641 #define _PSTR2CON_P2DC6         0x40
5642 #define _PSTR2CON_CMPL1         0x80
5643 
5644 //==============================================================================
5645 
5646 
5647 //==============================================================================
5648 //        CCP1CON Bits
5649 
5650 extern __at(0x0FBA) __sfr CCP1CON;
5651 
5652 typedef union
5653   {
5654   struct
5655     {
5656     unsigned CCP1M0             : 1;
5657     unsigned CCP1M1             : 1;
5658     unsigned CCP1M2             : 1;
5659     unsigned CCP1M3             : 1;
5660     unsigned DC1B0              : 1;
5661     unsigned DC1B1              : 1;
5662     unsigned P1M0               : 1;
5663     unsigned P1M1               : 1;
5664     };
5665 
5666   struct
5667     {
5668     unsigned                    : 1;
5669     unsigned                    : 1;
5670     unsigned                    : 1;
5671     unsigned                    : 1;
5672     unsigned CCP1Y              : 1;
5673     unsigned CCP1X              : 1;
5674     unsigned                    : 1;
5675     unsigned                    : 1;
5676     };
5677 
5678   struct
5679     {
5680     unsigned CCP1M              : 4;
5681     unsigned                    : 4;
5682     };
5683 
5684   struct
5685     {
5686     unsigned                    : 4;
5687     unsigned DC1B               : 2;
5688     unsigned                    : 2;
5689     };
5690 
5691   struct
5692     {
5693     unsigned                    : 6;
5694     unsigned P1M                : 2;
5695     };
5696   } __CCP1CONbits_t;
5697 
5698 extern __at(0x0FBA) volatile __CCP1CONbits_t CCP1CONbits;
5699 
5700 #define _CCP1M0                 0x01
5701 #define _CCP1M1                 0x02
5702 #define _CCP1M2                 0x04
5703 #define _CCP1M3                 0x08
5704 #define _DC1B0                  0x10
5705 #define _CCP1Y                  0x10
5706 #define _DC1B1                  0x20
5707 #define _CCP1X                  0x20
5708 #define _P1M0                   0x40
5709 #define _P1M1                   0x80
5710 
5711 //==============================================================================
5712 
5713 
5714 //==============================================================================
5715 //        ECCP1CON Bits
5716 
5717 extern __at(0x0FBA) __sfr ECCP1CON;
5718 
5719 typedef union
5720   {
5721   struct
5722     {
5723     unsigned CCP1M0             : 1;
5724     unsigned CCP1M1             : 1;
5725     unsigned CCP1M2             : 1;
5726     unsigned CCP1M3             : 1;
5727     unsigned DC1B0              : 1;
5728     unsigned DC1B1              : 1;
5729     unsigned P1M0               : 1;
5730     unsigned P1M1               : 1;
5731     };
5732 
5733   struct
5734     {
5735     unsigned                    : 1;
5736     unsigned                    : 1;
5737     unsigned                    : 1;
5738     unsigned                    : 1;
5739     unsigned CCP1Y              : 1;
5740     unsigned CCP1X              : 1;
5741     unsigned                    : 1;
5742     unsigned                    : 1;
5743     };
5744 
5745   struct
5746     {
5747     unsigned CCP1M              : 4;
5748     unsigned                    : 4;
5749     };
5750 
5751   struct
5752     {
5753     unsigned                    : 4;
5754     unsigned DC1B               : 2;
5755     unsigned                    : 2;
5756     };
5757 
5758   struct
5759     {
5760     unsigned                    : 6;
5761     unsigned P1M                : 2;
5762     };
5763   } __ECCP1CONbits_t;
5764 
5765 extern __at(0x0FBA) volatile __ECCP1CONbits_t ECCP1CONbits;
5766 
5767 #define _ECCP1CON_CCP1M0        0x01
5768 #define _ECCP1CON_CCP1M1        0x02
5769 #define _ECCP1CON_CCP1M2        0x04
5770 #define _ECCP1CON_CCP1M3        0x08
5771 #define _ECCP1CON_DC1B0         0x10
5772 #define _ECCP1CON_CCP1Y         0x10
5773 #define _ECCP1CON_DC1B1         0x20
5774 #define _ECCP1CON_CCP1X         0x20
5775 #define _ECCP1CON_P1M0          0x40
5776 #define _ECCP1CON_P1M1          0x80
5777 
5778 //==============================================================================
5779 
5780 extern __at(0x0FBB) __sfr CCPR1;
5781 extern __at(0x0FBB) __sfr CCPR1L;
5782 extern __at(0x0FBC) __sfr CCPR1H;
5783 
5784 //==============================================================================
5785 //        ECCP1DEL Bits
5786 
5787 extern __at(0x0FBD) __sfr ECCP1DEL;
5788 
5789 typedef union
5790   {
5791   struct
5792     {
5793     unsigned P1DC0              : 1;
5794     unsigned P1DC1              : 1;
5795     unsigned P1DC2              : 1;
5796     unsigned P1DC3              : 1;
5797     unsigned P1DC4              : 1;
5798     unsigned P1DC5              : 1;
5799     unsigned P1DC6              : 1;
5800     unsigned P1RSEN             : 1;
5801     };
5802 
5803   struct
5804     {
5805     unsigned P1DC               : 7;
5806     unsigned                    : 1;
5807     };
5808   } __ECCP1DELbits_t;
5809 
5810 extern __at(0x0FBD) volatile __ECCP1DELbits_t ECCP1DELbits;
5811 
5812 #define _P1DC0                  0x01
5813 #define _P1DC1                  0x02
5814 #define _P1DC2                  0x04
5815 #define _P1DC3                  0x08
5816 #define _P1DC4                  0x10
5817 #define _P1DC5                  0x20
5818 #define _P1DC6                  0x40
5819 #define _P1RSEN                 0x80
5820 
5821 //==============================================================================
5822 
5823 
5824 //==============================================================================
5825 //        PWM1CON Bits
5826 
5827 extern __at(0x0FBD) __sfr PWM1CON;
5828 
5829 typedef union
5830   {
5831   struct
5832     {
5833     unsigned P1DC0              : 1;
5834     unsigned P1DC1              : 1;
5835     unsigned P1DC2              : 1;
5836     unsigned P1DC3              : 1;
5837     unsigned P1DC4              : 1;
5838     unsigned P1DC5              : 1;
5839     unsigned P1DC6              : 1;
5840     unsigned P1RSEN             : 1;
5841     };
5842 
5843   struct
5844     {
5845     unsigned P1DC               : 7;
5846     unsigned                    : 1;
5847     };
5848   } __PWM1CONbits_t;
5849 
5850 extern __at(0x0FBD) volatile __PWM1CONbits_t PWM1CONbits;
5851 
5852 #define _PWM1CON_P1DC0          0x01
5853 #define _PWM1CON_P1DC1          0x02
5854 #define _PWM1CON_P1DC2          0x04
5855 #define _PWM1CON_P1DC3          0x08
5856 #define _PWM1CON_P1DC4          0x10
5857 #define _PWM1CON_P1DC5          0x20
5858 #define _PWM1CON_P1DC6          0x40
5859 #define _PWM1CON_P1RSEN         0x80
5860 
5861 //==============================================================================
5862 
5863 
5864 //==============================================================================
5865 //        ECCP1AS Bits
5866 
5867 extern __at(0x0FBE) __sfr ECCP1AS;
5868 
5869 typedef union
5870   {
5871   struct
5872     {
5873     unsigned PSS1BD0            : 1;
5874     unsigned PSS1BD1            : 1;
5875     unsigned PSS1AC0            : 1;
5876     unsigned PSS1AC1            : 1;
5877     unsigned ECCP1AS0           : 1;
5878     unsigned ECCP1AS1           : 1;
5879     unsigned ECCP1AS2           : 1;
5880     unsigned ECCP1ASE           : 1;
5881     };
5882 
5883   struct
5884     {
5885     unsigned PSS1BD             : 2;
5886     unsigned                    : 6;
5887     };
5888 
5889   struct
5890     {
5891     unsigned                    : 2;
5892     unsigned PSS1AC             : 2;
5893     unsigned                    : 4;
5894     };
5895 
5896   struct
5897     {
5898     unsigned                    : 4;
5899     unsigned ECCP1AS            : 3;
5900     unsigned                    : 1;
5901     };
5902   } __ECCP1ASbits_t;
5903 
5904 extern __at(0x0FBE) volatile __ECCP1ASbits_t ECCP1ASbits;
5905 
5906 #define _PSS1BD0                0x01
5907 #define _PSS1BD1                0x02
5908 #define _PSS1AC0                0x04
5909 #define _PSS1AC1                0x08
5910 #define _ECCP1AS0               0x10
5911 #define _ECCP1AS1               0x20
5912 #define _ECCP1AS2               0x40
5913 #define _ECCP1ASE               0x80
5914 
5915 //==============================================================================
5916 
5917 
5918 //==============================================================================
5919 //        PSTR1CON Bits
5920 
5921 extern __at(0x0FBF) __sfr PSTR1CON;
5922 
5923 typedef union
5924   {
5925   struct
5926     {
5927     unsigned STRA               : 1;
5928     unsigned STRB               : 1;
5929     unsigned STRC               : 1;
5930     unsigned STRD               : 1;
5931     unsigned STRSYNC            : 1;
5932     unsigned                    : 1;
5933     unsigned CMPL0              : 1;
5934     unsigned CMPL1              : 1;
5935     };
5936 
5937   struct
5938     {
5939     unsigned                    : 6;
5940     unsigned CMPL               : 2;
5941     };
5942   } __PSTR1CONbits_t;
5943 
5944 extern __at(0x0FBF) volatile __PSTR1CONbits_t PSTR1CONbits;
5945 
5946 #define _STRA                   0x01
5947 #define _STRB                   0x02
5948 #define _STRC                   0x04
5949 #define _STRD                   0x08
5950 #define _STRSYNC                0x10
5951 #define _CMPL0                  0x40
5952 #define _CMPL1                  0x80
5953 
5954 //==============================================================================
5955 
5956 
5957 //==============================================================================
5958 //        WDTCON Bits
5959 
5960 extern __at(0x0FC0) __sfr WDTCON;
5961 
5962 typedef union
5963   {
5964   struct
5965     {
5966     unsigned SWDTEN             : 1;
5967     unsigned ULPSINK            : 1;
5968     unsigned ULPEN              : 1;
5969     unsigned DS                 : 1;
5970     unsigned VBGOE              : 1;
5971     unsigned ULPLVL             : 1;
5972     unsigned LVDSTAT            : 1;
5973     unsigned REGSLP             : 1;
5974     };
5975 
5976   struct
5977     {
5978     unsigned SWDTE              : 1;
5979     unsigned                    : 1;
5980     unsigned                    : 1;
5981     unsigned                    : 1;
5982     unsigned                    : 1;
5983     unsigned                    : 1;
5984     unsigned                    : 1;
5985     unsigned                    : 1;
5986     };
5987   } __WDTCONbits_t;
5988 
5989 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
5990 
5991 #define _SWDTEN                 0x01
5992 #define _SWDTE                  0x01
5993 #define _ULPSINK                0x02
5994 #define _ULPEN                  0x04
5995 #define _DS                     0x08
5996 #define _VBGOE                  0x10
5997 #define _ULPLVL                 0x20
5998 #define _LVDSTAT                0x40
5999 #define _REGSLP                 0x80
6000 
6001 //==============================================================================
6002 
6003 
6004 //==============================================================================
6005 //        ADCON1 Bits
6006 
6007 extern __at(0x0FC1) __sfr ADCON1;
6008 
6009 typedef union
6010   {
6011   struct
6012     {
6013     unsigned ADCS0              : 1;
6014     unsigned ADCS1              : 1;
6015     unsigned ADCS2              : 1;
6016     unsigned ACQT0              : 1;
6017     unsigned ACQT1              : 1;
6018     unsigned ACQT2              : 1;
6019     unsigned ADCAL              : 1;
6020     unsigned ADFM               : 1;
6021     };
6022 
6023   struct
6024     {
6025     unsigned ADCS               : 3;
6026     unsigned                    : 5;
6027     };
6028 
6029   struct
6030     {
6031     unsigned                    : 3;
6032     unsigned ACQT               : 3;
6033     unsigned                    : 2;
6034     };
6035   } __ADCON1bits_t;
6036 
6037 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
6038 
6039 #define _ADCS0                  0x01
6040 #define _ADCS1                  0x02
6041 #define _ADCS2                  0x04
6042 #define _ACQT0                  0x08
6043 #define _ACQT1                  0x10
6044 #define _ACQT2                  0x20
6045 #define _ADCAL                  0x40
6046 #define _ADFM                   0x80
6047 
6048 //==============================================================================
6049 
6050 
6051 //==============================================================================
6052 //        ADCON0 Bits
6053 
6054 extern __at(0x0FC2) __sfr ADCON0;
6055 
6056 typedef union
6057   {
6058   struct
6059     {
6060     unsigned ADON               : 1;
6061     unsigned GO_NOT_DONE        : 1;
6062     unsigned CHS0               : 1;
6063     unsigned CHS1               : 1;
6064     unsigned CHS2               : 1;
6065     unsigned CHS3               : 1;
6066     unsigned VCFG0              : 1;
6067     unsigned VCFG1              : 1;
6068     };
6069 
6070   struct
6071     {
6072     unsigned                    : 1;
6073     unsigned GO_DONE            : 1;
6074     unsigned                    : 1;
6075     unsigned                    : 1;
6076     unsigned                    : 1;
6077     unsigned                    : 1;
6078     unsigned                    : 1;
6079     unsigned                    : 1;
6080     };
6081 
6082   struct
6083     {
6084     unsigned                    : 1;
6085     unsigned DONE               : 1;
6086     unsigned                    : 1;
6087     unsigned                    : 1;
6088     unsigned                    : 1;
6089     unsigned                    : 1;
6090     unsigned                    : 1;
6091     unsigned                    : 1;
6092     };
6093 
6094   struct
6095     {
6096     unsigned                    : 1;
6097     unsigned GO                 : 1;
6098     unsigned                    : 1;
6099     unsigned                    : 1;
6100     unsigned                    : 1;
6101     unsigned                    : 1;
6102     unsigned                    : 1;
6103     unsigned                    : 1;
6104     };
6105 
6106   struct
6107     {
6108     unsigned                    : 1;
6109     unsigned NOT_DONE           : 1;
6110     unsigned                    : 1;
6111     unsigned                    : 1;
6112     unsigned                    : 1;
6113     unsigned                    : 1;
6114     unsigned                    : 1;
6115     unsigned                    : 1;
6116     };
6117 
6118   struct
6119     {
6120     unsigned                    : 2;
6121     unsigned CHS                : 4;
6122     unsigned                    : 2;
6123     };
6124 
6125   struct
6126     {
6127     unsigned                    : 6;
6128     unsigned VCFG               : 2;
6129     };
6130   } __ADCON0bits_t;
6131 
6132 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
6133 
6134 #define _ADON                   0x01
6135 #define _GO_NOT_DONE            0x02
6136 #define _GO_DONE                0x02
6137 #define _DONE                   0x02
6138 #define _GO                     0x02
6139 #define _NOT_DONE               0x02
6140 #define _CHS0                   0x04
6141 #define _CHS1                   0x08
6142 #define _CHS2                   0x10
6143 #define _CHS3                   0x20
6144 #define _VCFG0                  0x40
6145 #define _VCFG1                  0x80
6146 
6147 //==============================================================================
6148 
6149 extern __at(0x0FC3) __sfr ADRES;
6150 extern __at(0x0FC3) __sfr ADRESL;
6151 extern __at(0x0FC4) __sfr ADRESH;
6152 
6153 //==============================================================================
6154 //        SSP1CON2 Bits
6155 
6156 extern __at(0x0FC5) __sfr SSP1CON2;
6157 
6158 typedef union
6159   {
6160   struct
6161     {
6162     unsigned SEN                : 1;
6163     unsigned RSEN               : 1;
6164     unsigned PEN                : 1;
6165     unsigned RCEN               : 1;
6166     unsigned ACKEN              : 1;
6167     unsigned ACKDT              : 1;
6168     unsigned ACKSTAT            : 1;
6169     unsigned GCEN               : 1;
6170     };
6171 
6172   struct
6173     {
6174     unsigned                    : 1;
6175     unsigned ADMSK1             : 1;
6176     unsigned ADMSK2             : 1;
6177     unsigned ADMSK3             : 1;
6178     unsigned ADMSK4             : 1;
6179     unsigned ADMSK5             : 1;
6180     unsigned                    : 1;
6181     unsigned                    : 1;
6182     };
6183   } __SSP1CON2bits_t;
6184 
6185 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
6186 
6187 #define _SEN                    0x01
6188 #define _RSEN                   0x02
6189 #define _ADMSK1                 0x02
6190 #define _PEN                    0x04
6191 #define _ADMSK2                 0x04
6192 #define _RCEN                   0x08
6193 #define _ADMSK3                 0x08
6194 #define _ACKEN                  0x10
6195 #define _ADMSK4                 0x10
6196 #define _ACKDT                  0x20
6197 #define _ADMSK5                 0x20
6198 #define _ACKSTAT                0x40
6199 #define _GCEN                   0x80
6200 
6201 //==============================================================================
6202 
6203 
6204 //==============================================================================
6205 //        SSPCON2 Bits
6206 
6207 extern __at(0x0FC5) __sfr SSPCON2;
6208 
6209 typedef union
6210   {
6211   struct
6212     {
6213     unsigned SEN                : 1;
6214     unsigned RSEN               : 1;
6215     unsigned PEN                : 1;
6216     unsigned RCEN               : 1;
6217     unsigned ACKEN              : 1;
6218     unsigned ACKDT              : 1;
6219     unsigned ACKSTAT            : 1;
6220     unsigned GCEN               : 1;
6221     };
6222 
6223   struct
6224     {
6225     unsigned                    : 1;
6226     unsigned ADMSK1             : 1;
6227     unsigned ADMSK2             : 1;
6228     unsigned ADMSK3             : 1;
6229     unsigned ADMSK4             : 1;
6230     unsigned ADMSK5             : 1;
6231     unsigned                    : 1;
6232     unsigned                    : 1;
6233     };
6234   } __SSPCON2bits_t;
6235 
6236 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
6237 
6238 #define _SSPCON2_SEN            0x01
6239 #define _SSPCON2_RSEN           0x02
6240 #define _SSPCON2_ADMSK1         0x02
6241 #define _SSPCON2_PEN            0x04
6242 #define _SSPCON2_ADMSK2         0x04
6243 #define _SSPCON2_RCEN           0x08
6244 #define _SSPCON2_ADMSK3         0x08
6245 #define _SSPCON2_ACKEN          0x10
6246 #define _SSPCON2_ADMSK4         0x10
6247 #define _SSPCON2_ACKDT          0x20
6248 #define _SSPCON2_ADMSK5         0x20
6249 #define _SSPCON2_ACKSTAT        0x40
6250 #define _SSPCON2_GCEN           0x80
6251 
6252 //==============================================================================
6253 
6254 
6255 //==============================================================================
6256 //        SSP1CON1 Bits
6257 
6258 extern __at(0x0FC6) __sfr SSP1CON1;
6259 
6260 typedef union
6261   {
6262   struct
6263     {
6264     unsigned SSPM0              : 1;
6265     unsigned SSPM1              : 1;
6266     unsigned SSPM2              : 1;
6267     unsigned SSPM3              : 1;
6268     unsigned CKP                : 1;
6269     unsigned SSPEN              : 1;
6270     unsigned SSPOV              : 1;
6271     unsigned WCOL               : 1;
6272     };
6273 
6274   struct
6275     {
6276     unsigned SSPM               : 4;
6277     unsigned                    : 4;
6278     };
6279   } __SSP1CON1bits_t;
6280 
6281 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
6282 
6283 #define _SSPM0                  0x01
6284 #define _SSPM1                  0x02
6285 #define _SSPM2                  0x04
6286 #define _SSPM3                  0x08
6287 #define _CKP                    0x10
6288 #define _SSPEN                  0x20
6289 #define _SSPOV                  0x40
6290 #define _WCOL                   0x80
6291 
6292 //==============================================================================
6293 
6294 
6295 //==============================================================================
6296 //        SSPCON1 Bits
6297 
6298 extern __at(0x0FC6) __sfr SSPCON1;
6299 
6300 typedef union
6301   {
6302   struct
6303     {
6304     unsigned SSPM0              : 1;
6305     unsigned SSPM1              : 1;
6306     unsigned SSPM2              : 1;
6307     unsigned SSPM3              : 1;
6308     unsigned CKP                : 1;
6309     unsigned SSPEN              : 1;
6310     unsigned SSPOV              : 1;
6311     unsigned WCOL               : 1;
6312     };
6313 
6314   struct
6315     {
6316     unsigned SSPM               : 4;
6317     unsigned                    : 4;
6318     };
6319   } __SSPCON1bits_t;
6320 
6321 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
6322 
6323 #define _SSPCON1_SSPM0          0x01
6324 #define _SSPCON1_SSPM1          0x02
6325 #define _SSPCON1_SSPM2          0x04
6326 #define _SSPCON1_SSPM3          0x08
6327 #define _SSPCON1_CKP            0x10
6328 #define _SSPCON1_SSPEN          0x20
6329 #define _SSPCON1_SSPOV          0x40
6330 #define _SSPCON1_WCOL           0x80
6331 
6332 //==============================================================================
6333 
6334 
6335 //==============================================================================
6336 //        SSP1STAT Bits
6337 
6338 extern __at(0x0FC7) __sfr SSP1STAT;
6339 
6340 typedef union
6341   {
6342   struct
6343     {
6344     unsigned BF                 : 1;
6345     unsigned UA                 : 1;
6346     unsigned R_NOT_W            : 1;
6347     unsigned S                  : 1;
6348     unsigned P                  : 1;
6349     unsigned D_NOT_A            : 1;
6350     unsigned CKE                : 1;
6351     unsigned SMP                : 1;
6352     };
6353 
6354   struct
6355     {
6356     unsigned                    : 1;
6357     unsigned                    : 1;
6358     unsigned R                  : 1;
6359     unsigned I2C_START          : 1;
6360     unsigned I2C_STOP           : 1;
6361     unsigned D                  : 1;
6362     unsigned                    : 1;
6363     unsigned                    : 1;
6364     };
6365 
6366   struct
6367     {
6368     unsigned                    : 1;
6369     unsigned                    : 1;
6370     unsigned R_W                : 1;
6371     unsigned                    : 1;
6372     unsigned                    : 1;
6373     unsigned D_A                : 1;
6374     unsigned                    : 1;
6375     unsigned                    : 1;
6376     };
6377 
6378   struct
6379     {
6380     unsigned                    : 1;
6381     unsigned                    : 1;
6382     unsigned NOT_W              : 1;
6383     unsigned                    : 1;
6384     unsigned                    : 1;
6385     unsigned NOT_A              : 1;
6386     unsigned                    : 1;
6387     unsigned                    : 1;
6388     };
6389 
6390   struct
6391     {
6392     unsigned                    : 1;
6393     unsigned                    : 1;
6394     unsigned NOT_WRITE          : 1;
6395     unsigned                    : 1;
6396     unsigned                    : 1;
6397     unsigned NOT_ADDRESS        : 1;
6398     unsigned                    : 1;
6399     unsigned                    : 1;
6400     };
6401 
6402   struct
6403     {
6404     unsigned                    : 1;
6405     unsigned                    : 1;
6406     unsigned READ_WRITE         : 1;
6407     unsigned                    : 1;
6408     unsigned                    : 1;
6409     unsigned DATA_ADDRESS       : 1;
6410     unsigned                    : 1;
6411     unsigned                    : 1;
6412     };
6413 
6414   struct
6415     {
6416     unsigned                    : 1;
6417     unsigned                    : 1;
6418     unsigned I2C_READ           : 1;
6419     unsigned                    : 1;
6420     unsigned                    : 1;
6421     unsigned I2C_DAT            : 1;
6422     unsigned                    : 1;
6423     unsigned                    : 1;
6424     };
6425   } __SSP1STATbits_t;
6426 
6427 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
6428 
6429 #define _BF                     0x01
6430 #define _UA                     0x02
6431 #define _R_NOT_W                0x04
6432 #define _R                      0x04
6433 #define _R_W                    0x04
6434 #define _NOT_W                  0x04
6435 #define _NOT_WRITE              0x04
6436 #define _READ_WRITE             0x04
6437 #define _I2C_READ               0x04
6438 #define _S                      0x08
6439 #define _I2C_START              0x08
6440 #define _P                      0x10
6441 #define _I2C_STOP               0x10
6442 #define _D_NOT_A                0x20
6443 #define _D                      0x20
6444 #define _D_A                    0x20
6445 #define _NOT_A                  0x20
6446 #define _NOT_ADDRESS            0x20
6447 #define _DATA_ADDRESS           0x20
6448 #define _I2C_DAT                0x20
6449 #define _CKE                    0x40
6450 #define _SMP                    0x80
6451 
6452 //==============================================================================
6453 
6454 
6455 //==============================================================================
6456 //        SSPSTAT Bits
6457 
6458 extern __at(0x0FC7) __sfr SSPSTAT;
6459 
6460 typedef union
6461   {
6462   struct
6463     {
6464     unsigned BF                 : 1;
6465     unsigned UA                 : 1;
6466     unsigned R_NOT_W            : 1;
6467     unsigned S                  : 1;
6468     unsigned P                  : 1;
6469     unsigned D_NOT_A            : 1;
6470     unsigned CKE                : 1;
6471     unsigned SMP                : 1;
6472     };
6473 
6474   struct
6475     {
6476     unsigned                    : 1;
6477     unsigned                    : 1;
6478     unsigned R                  : 1;
6479     unsigned I2C_START          : 1;
6480     unsigned I2C_STOP           : 1;
6481     unsigned D                  : 1;
6482     unsigned                    : 1;
6483     unsigned                    : 1;
6484     };
6485 
6486   struct
6487     {
6488     unsigned                    : 1;
6489     unsigned                    : 1;
6490     unsigned R_W                : 1;
6491     unsigned                    : 1;
6492     unsigned                    : 1;
6493     unsigned D_A                : 1;
6494     unsigned                    : 1;
6495     unsigned                    : 1;
6496     };
6497 
6498   struct
6499     {
6500     unsigned                    : 1;
6501     unsigned                    : 1;
6502     unsigned NOT_W              : 1;
6503     unsigned                    : 1;
6504     unsigned                    : 1;
6505     unsigned NOT_A              : 1;
6506     unsigned                    : 1;
6507     unsigned                    : 1;
6508     };
6509 
6510   struct
6511     {
6512     unsigned                    : 1;
6513     unsigned                    : 1;
6514     unsigned NOT_WRITE          : 1;
6515     unsigned                    : 1;
6516     unsigned                    : 1;
6517     unsigned NOT_ADDRESS        : 1;
6518     unsigned                    : 1;
6519     unsigned                    : 1;
6520     };
6521 
6522   struct
6523     {
6524     unsigned                    : 1;
6525     unsigned                    : 1;
6526     unsigned READ_WRITE         : 1;
6527     unsigned                    : 1;
6528     unsigned                    : 1;
6529     unsigned DATA_ADDRESS       : 1;
6530     unsigned                    : 1;
6531     unsigned                    : 1;
6532     };
6533 
6534   struct
6535     {
6536     unsigned                    : 1;
6537     unsigned                    : 1;
6538     unsigned I2C_READ           : 1;
6539     unsigned                    : 1;
6540     unsigned                    : 1;
6541     unsigned I2C_DAT            : 1;
6542     unsigned                    : 1;
6543     unsigned                    : 1;
6544     };
6545   } __SSPSTATbits_t;
6546 
6547 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
6548 
6549 #define _SSPSTAT_BF             0x01
6550 #define _SSPSTAT_UA             0x02
6551 #define _SSPSTAT_R_NOT_W        0x04
6552 #define _SSPSTAT_R              0x04
6553 #define _SSPSTAT_R_W            0x04
6554 #define _SSPSTAT_NOT_W          0x04
6555 #define _SSPSTAT_NOT_WRITE      0x04
6556 #define _SSPSTAT_READ_WRITE     0x04
6557 #define _SSPSTAT_I2C_READ       0x04
6558 #define _SSPSTAT_S              0x08
6559 #define _SSPSTAT_I2C_START      0x08
6560 #define _SSPSTAT_P              0x10
6561 #define _SSPSTAT_I2C_STOP       0x10
6562 #define _SSPSTAT_D_NOT_A        0x20
6563 #define _SSPSTAT_D              0x20
6564 #define _SSPSTAT_D_A            0x20
6565 #define _SSPSTAT_NOT_A          0x20
6566 #define _SSPSTAT_NOT_ADDRESS    0x20
6567 #define _SSPSTAT_DATA_ADDRESS   0x20
6568 #define _SSPSTAT_I2C_DAT        0x20
6569 #define _SSPSTAT_CKE            0x40
6570 #define _SSPSTAT_SMP            0x80
6571 
6572 //==============================================================================
6573 
6574 extern __at(0x0FC8) __sfr SSP1ADD;
6575 
6576 //==============================================================================
6577 //        SSP1MSK Bits
6578 
6579 extern __at(0x0FC8) __sfr SSP1MSK;
6580 
6581 typedef struct
6582   {
6583   unsigned MSK0                 : 1;
6584   unsigned MSK1                 : 1;
6585   unsigned MSK2                 : 1;
6586   unsigned MSK3                 : 1;
6587   unsigned MSK4                 : 1;
6588   unsigned MSK5                 : 1;
6589   unsigned MSK6                 : 1;
6590   unsigned MSK7                 : 1;
6591   } __SSP1MSKbits_t;
6592 
6593 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
6594 
6595 #define _MSK0                   0x01
6596 #define _MSK1                   0x02
6597 #define _MSK2                   0x04
6598 #define _MSK3                   0x08
6599 #define _MSK4                   0x10
6600 #define _MSK5                   0x20
6601 #define _MSK6                   0x40
6602 #define _MSK7                   0x80
6603 
6604 //==============================================================================
6605 
6606 extern __at(0x0FC8) __sfr SSPADD;
6607 extern __at(0x0FC9) __sfr SSP1BUF;
6608 extern __at(0x0FC9) __sfr SSPBUF;
6609 
6610 //==============================================================================
6611 //        T2CON Bits
6612 
6613 extern __at(0x0FCA) __sfr T2CON;
6614 
6615 typedef union
6616   {
6617   struct
6618     {
6619     unsigned T2CKPS0            : 1;
6620     unsigned T2CKPS1            : 1;
6621     unsigned TMR2ON             : 1;
6622     unsigned T2OUTPS0           : 1;
6623     unsigned T2OUTPS1           : 1;
6624     unsigned T2OUTPS2           : 1;
6625     unsigned T2OUTPS3           : 1;
6626     unsigned                    : 1;
6627     };
6628 
6629   struct
6630     {
6631     unsigned T2CKPS             : 2;
6632     unsigned                    : 6;
6633     };
6634 
6635   struct
6636     {
6637     unsigned                    : 3;
6638     unsigned T2OUTPS            : 4;
6639     unsigned                    : 1;
6640     };
6641   } __T2CONbits_t;
6642 
6643 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
6644 
6645 #define _T2CKPS0                0x01
6646 #define _T2CKPS1                0x02
6647 #define _TMR2ON                 0x04
6648 #define _T2OUTPS0               0x08
6649 #define _T2OUTPS1               0x10
6650 #define _T2OUTPS2               0x20
6651 #define _T2OUTPS3               0x40
6652 
6653 //==============================================================================
6654 
6655 extern __at(0x0FCB) __sfr PR2;
6656 extern __at(0x0FCC) __sfr TMR2;
6657 
6658 //==============================================================================
6659 //        T1CON Bits
6660 
6661 extern __at(0x0FCD) __sfr T1CON;
6662 
6663 typedef union
6664   {
6665   struct
6666     {
6667     unsigned TMR1ON             : 1;
6668     unsigned RD16               : 1;
6669     unsigned NOT_T1SYNC         : 1;
6670     unsigned T1OSCEN            : 1;
6671     unsigned T1CKPS0            : 1;
6672     unsigned T1CKPS1            : 1;
6673     unsigned TMR1CS0            : 1;
6674     unsigned TMR1CS1            : 1;
6675     };
6676 
6677   struct
6678     {
6679     unsigned                    : 4;
6680     unsigned T1CKPS             : 2;
6681     unsigned                    : 2;
6682     };
6683 
6684   struct
6685     {
6686     unsigned                    : 6;
6687     unsigned TMR1CS             : 2;
6688     };
6689   } __T1CONbits_t;
6690 
6691 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6692 
6693 #define _TMR1ON                 0x01
6694 #define _RD16                   0x02
6695 #define _NOT_T1SYNC             0x04
6696 #define _T1OSCEN                0x08
6697 #define _T1CKPS0                0x10
6698 #define _T1CKPS1                0x20
6699 #define _TMR1CS0                0x40
6700 #define _TMR1CS1                0x80
6701 
6702 //==============================================================================
6703 
6704 extern __at(0x0FCE) __sfr TMR1;
6705 extern __at(0x0FCE) __sfr TMR1L;
6706 extern __at(0x0FCF) __sfr TMR1H;
6707 
6708 //==============================================================================
6709 //        RCON Bits
6710 
6711 extern __at(0x0FD0) __sfr RCON;
6712 
6713 typedef union
6714   {
6715   struct
6716     {
6717     unsigned NOT_BOR            : 1;
6718     unsigned NOT_POR            : 1;
6719     unsigned NOT_PD             : 1;
6720     unsigned NOT_TO             : 1;
6721     unsigned NOT_RI             : 1;
6722     unsigned NOT_CM             : 1;
6723     unsigned                    : 1;
6724     unsigned IPEN               : 1;
6725     };
6726 
6727   struct
6728     {
6729     unsigned BOR                : 1;
6730     unsigned POR                : 1;
6731     unsigned PD                 : 1;
6732     unsigned TO                 : 1;
6733     unsigned RI                 : 1;
6734     unsigned CM                 : 1;
6735     unsigned                    : 1;
6736     unsigned                    : 1;
6737     };
6738   } __RCONbits_t;
6739 
6740 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6741 
6742 #define _NOT_BOR                0x01
6743 #define _BOR                    0x01
6744 #define _NOT_POR                0x02
6745 #define _POR                    0x02
6746 #define _NOT_PD                 0x04
6747 #define _PD                     0x04
6748 #define _NOT_TO                 0x08
6749 #define _TO                     0x08
6750 #define _NOT_RI                 0x10
6751 #define _RI                     0x10
6752 #define _NOT_CM                 0x20
6753 #define _CM                     0x20
6754 #define _IPEN                   0x80
6755 
6756 //==============================================================================
6757 
6758 
6759 //==============================================================================
6760 //        CM2CON Bits
6761 
6762 extern __at(0x0FD1) __sfr CM2CON;
6763 
6764 typedef union
6765   {
6766   struct
6767     {
6768     unsigned CCH0               : 1;
6769     unsigned CCH1               : 1;
6770     unsigned CREF               : 1;
6771     unsigned EVPOL0             : 1;
6772     unsigned EVPOL1             : 1;
6773     unsigned CPOL               : 1;
6774     unsigned COE                : 1;
6775     unsigned CON                : 1;
6776     };
6777 
6778   struct
6779     {
6780     unsigned CCH                : 2;
6781     unsigned                    : 6;
6782     };
6783 
6784   struct
6785     {
6786     unsigned                    : 3;
6787     unsigned EVPOL              : 2;
6788     unsigned                    : 3;
6789     };
6790   } __CM2CONbits_t;
6791 
6792 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
6793 
6794 #define _CM2CON_CCH0            0x01
6795 #define _CM2CON_CCH1            0x02
6796 #define _CM2CON_CREF            0x04
6797 #define _CM2CON_EVPOL0          0x08
6798 #define _CM2CON_EVPOL1          0x10
6799 #define _CM2CON_CPOL            0x20
6800 #define _CM2CON_COE             0x40
6801 #define _CM2CON_CON             0x80
6802 
6803 //==============================================================================
6804 
6805 
6806 //==============================================================================
6807 //        CM2CON1 Bits
6808 
6809 extern __at(0x0FD1) __sfr CM2CON1;
6810 
6811 typedef union
6812   {
6813   struct
6814     {
6815     unsigned CCH0               : 1;
6816     unsigned CCH1               : 1;
6817     unsigned CREF               : 1;
6818     unsigned EVPOL0             : 1;
6819     unsigned EVPOL1             : 1;
6820     unsigned CPOL               : 1;
6821     unsigned COE                : 1;
6822     unsigned CON                : 1;
6823     };
6824 
6825   struct
6826     {
6827     unsigned CCH                : 2;
6828     unsigned                    : 6;
6829     };
6830 
6831   struct
6832     {
6833     unsigned                    : 3;
6834     unsigned EVPOL              : 2;
6835     unsigned                    : 3;
6836     };
6837   } __CM2CON1bits_t;
6838 
6839 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
6840 
6841 #define _CM2CON1_CCH0           0x01
6842 #define _CM2CON1_CCH1           0x02
6843 #define _CM2CON1_CREF           0x04
6844 #define _CM2CON1_EVPOL0         0x08
6845 #define _CM2CON1_EVPOL1         0x10
6846 #define _CM2CON1_CPOL           0x20
6847 #define _CM2CON1_COE            0x40
6848 #define _CM2CON1_CON            0x80
6849 
6850 //==============================================================================
6851 
6852 
6853 //==============================================================================
6854 //        CM1CON Bits
6855 
6856 extern __at(0x0FD2) __sfr CM1CON;
6857 
6858 typedef union
6859   {
6860   struct
6861     {
6862     unsigned CCH0               : 1;
6863     unsigned CCH1               : 1;
6864     unsigned CREF               : 1;
6865     unsigned EVPOL0             : 1;
6866     unsigned EVPOL1             : 1;
6867     unsigned CPOL               : 1;
6868     unsigned COE                : 1;
6869     unsigned CON                : 1;
6870     };
6871 
6872   struct
6873     {
6874     unsigned CCH                : 2;
6875     unsigned                    : 6;
6876     };
6877 
6878   struct
6879     {
6880     unsigned                    : 3;
6881     unsigned EVPOL              : 2;
6882     unsigned                    : 3;
6883     };
6884   } __CM1CONbits_t;
6885 
6886 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
6887 
6888 #define _CCH0                   0x01
6889 #define _CCH1                   0x02
6890 #define _CREF                   0x04
6891 #define _EVPOL0                 0x08
6892 #define _EVPOL1                 0x10
6893 #define _CPOL                   0x20
6894 #define _COE                    0x40
6895 #define _CON                    0x80
6896 
6897 //==============================================================================
6898 
6899 
6900 //==============================================================================
6901 //        CM1CON1 Bits
6902 
6903 extern __at(0x0FD2) __sfr CM1CON1;
6904 
6905 typedef union
6906   {
6907   struct
6908     {
6909     unsigned CCH0               : 1;
6910     unsigned CCH1               : 1;
6911     unsigned CREF               : 1;
6912     unsigned EVPOL0             : 1;
6913     unsigned EVPOL1             : 1;
6914     unsigned CPOL               : 1;
6915     unsigned COE                : 1;
6916     unsigned CON                : 1;
6917     };
6918 
6919   struct
6920     {
6921     unsigned CCH                : 2;
6922     unsigned                    : 6;
6923     };
6924 
6925   struct
6926     {
6927     unsigned                    : 3;
6928     unsigned EVPOL              : 2;
6929     unsigned                    : 3;
6930     };
6931   } __CM1CON1bits_t;
6932 
6933 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
6934 
6935 #define _CM1CON1_CCH0           0x01
6936 #define _CM1CON1_CCH1           0x02
6937 #define _CM1CON1_CREF           0x04
6938 #define _CM1CON1_EVPOL0         0x08
6939 #define _CM1CON1_EVPOL1         0x10
6940 #define _CM1CON1_CPOL           0x20
6941 #define _CM1CON1_COE            0x40
6942 #define _CM1CON1_CON            0x80
6943 
6944 //==============================================================================
6945 
6946 
6947 //==============================================================================
6948 //        OSCCON Bits
6949 
6950 extern __at(0x0FD3) __sfr OSCCON;
6951 
6952 typedef union
6953   {
6954   struct
6955     {
6956     unsigned SCS0               : 1;
6957     unsigned SCS1               : 1;
6958     unsigned FLTS               : 1;
6959     unsigned OSTS               : 1;
6960     unsigned IRCF0              : 1;
6961     unsigned IRCF1              : 1;
6962     unsigned IRCF2              : 1;
6963     unsigned IDLEN              : 1;
6964     };
6965 
6966   struct
6967     {
6968     unsigned SCS                : 2;
6969     unsigned                    : 6;
6970     };
6971 
6972   struct
6973     {
6974     unsigned                    : 4;
6975     unsigned IRCF               : 3;
6976     unsigned                    : 1;
6977     };
6978   } __OSCCONbits_t;
6979 
6980 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6981 
6982 #define _SCS0                   0x01
6983 #define _SCS1                   0x02
6984 #define _FLTS                   0x04
6985 #define _OSTS                   0x08
6986 #define _IRCF0                  0x10
6987 #define _IRCF1                  0x20
6988 #define _IRCF2                  0x40
6989 #define _IDLEN                  0x80
6990 
6991 //==============================================================================
6992 
6993 
6994 //==============================================================================
6995 //        T0CON Bits
6996 
6997 extern __at(0x0FD5) __sfr T0CON;
6998 
6999 typedef union
7000   {
7001   struct
7002     {
7003     unsigned T0PS0              : 1;
7004     unsigned T0PS1              : 1;
7005     unsigned T0PS2              : 1;
7006     unsigned PSA                : 1;
7007     unsigned T0SE               : 1;
7008     unsigned T0CS               : 1;
7009     unsigned T08BIT             : 1;
7010     unsigned TMR0ON             : 1;
7011     };
7012 
7013   struct
7014     {
7015     unsigned T0PS               : 3;
7016     unsigned                    : 5;
7017     };
7018   } __T0CONbits_t;
7019 
7020 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
7021 
7022 #define _T0PS0                  0x01
7023 #define _T0PS1                  0x02
7024 #define _T0PS2                  0x04
7025 #define _PSA                    0x08
7026 #define _T0SE                   0x10
7027 #define _T0CS                   0x20
7028 #define _T08BIT                 0x40
7029 #define _TMR0ON                 0x80
7030 
7031 //==============================================================================
7032 
7033 extern __at(0x0FD6) __sfr TMR0;
7034 extern __at(0x0FD6) __sfr TMR0L;
7035 extern __at(0x0FD7) __sfr TMR0H;
7036 
7037 //==============================================================================
7038 //        STATUS Bits
7039 
7040 extern __at(0x0FD8) __sfr STATUS;
7041 
7042 typedef struct
7043   {
7044   unsigned C                    : 1;
7045   unsigned DC                   : 1;
7046   unsigned Z                    : 1;
7047   unsigned OV                   : 1;
7048   unsigned N                    : 1;
7049   unsigned                      : 1;
7050   unsigned                      : 1;
7051   unsigned                      : 1;
7052   } __STATUSbits_t;
7053 
7054 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
7055 
7056 #define _C                      0x01
7057 #define _DC                     0x02
7058 #define _Z                      0x04
7059 #define _OV                     0x08
7060 #define _N                      0x10
7061 
7062 //==============================================================================
7063 
7064 extern __at(0x0FD9) __sfr FSR2L;
7065 extern __at(0x0FDA) __sfr FSR2H;
7066 extern __at(0x0FDB) __sfr PLUSW2;
7067 extern __at(0x0FDC) __sfr PREINC2;
7068 extern __at(0x0FDD) __sfr POSTDEC2;
7069 extern __at(0x0FDE) __sfr POSTINC2;
7070 extern __at(0x0FDF) __sfr INDF2;
7071 extern __at(0x0FE0) __sfr BSR;
7072 extern __at(0x0FE1) __sfr FSR1L;
7073 extern __at(0x0FE2) __sfr FSR1H;
7074 extern __at(0x0FE3) __sfr PLUSW1;
7075 extern __at(0x0FE4) __sfr PREINC1;
7076 extern __at(0x0FE5) __sfr POSTDEC1;
7077 extern __at(0x0FE6) __sfr POSTINC1;
7078 extern __at(0x0FE7) __sfr INDF1;
7079 extern __at(0x0FE8) __sfr WREG;
7080 extern __at(0x0FE9) __sfr FSR0L;
7081 extern __at(0x0FEA) __sfr FSR0H;
7082 extern __at(0x0FEB) __sfr PLUSW0;
7083 extern __at(0x0FEC) __sfr PREINC0;
7084 extern __at(0x0FED) __sfr POSTDEC0;
7085 extern __at(0x0FEE) __sfr POSTINC0;
7086 extern __at(0x0FEF) __sfr INDF0;
7087 
7088 //==============================================================================
7089 //        INTCON3 Bits
7090 
7091 extern __at(0x0FF0) __sfr INTCON3;
7092 
7093 typedef union
7094   {
7095   struct
7096     {
7097     unsigned INT1IF             : 1;
7098     unsigned INT2IF             : 1;
7099     unsigned INT3IF             : 1;
7100     unsigned INT1IE             : 1;
7101     unsigned INT2IE             : 1;
7102     unsigned INT3IE             : 1;
7103     unsigned INT1IP             : 1;
7104     unsigned INT2IP             : 1;
7105     };
7106 
7107   struct
7108     {
7109     unsigned INT1F              : 1;
7110     unsigned INT2F              : 1;
7111     unsigned INT3F              : 1;
7112     unsigned INT1E              : 1;
7113     unsigned INT2E              : 1;
7114     unsigned INT3E              : 1;
7115     unsigned INT1P              : 1;
7116     unsigned INT2P              : 1;
7117     };
7118   } __INTCON3bits_t;
7119 
7120 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
7121 
7122 #define _INT1IF                 0x01
7123 #define _INT1F                  0x01
7124 #define _INT2IF                 0x02
7125 #define _INT2F                  0x02
7126 #define _INT3IF                 0x04
7127 #define _INT3F                  0x04
7128 #define _INT1IE                 0x08
7129 #define _INT1E                  0x08
7130 #define _INT2IE                 0x10
7131 #define _INT2E                  0x10
7132 #define _INT3IE                 0x20
7133 #define _INT3E                  0x20
7134 #define _INT1IP                 0x40
7135 #define _INT1P                  0x40
7136 #define _INT2IP                 0x80
7137 #define _INT2P                  0x80
7138 
7139 //==============================================================================
7140 
7141 
7142 //==============================================================================
7143 //        INTCON2 Bits
7144 
7145 extern __at(0x0FF1) __sfr INTCON2;
7146 
7147 typedef union
7148   {
7149   struct
7150     {
7151     unsigned RBIP               : 1;
7152     unsigned INT3IP             : 1;
7153     unsigned TMR0IP             : 1;
7154     unsigned INTEDG3            : 1;
7155     unsigned INTEDG2            : 1;
7156     unsigned INTEDG1            : 1;
7157     unsigned INTEDG0            : 1;
7158     unsigned NOT_RBPU           : 1;
7159     };
7160 
7161   struct
7162     {
7163     unsigned                    : 1;
7164     unsigned INT3P              : 1;
7165     unsigned T0IP               : 1;
7166     unsigned                    : 1;
7167     unsigned                    : 1;
7168     unsigned                    : 1;
7169     unsigned                    : 1;
7170     unsigned RBPU               : 1;
7171     };
7172   } __INTCON2bits_t;
7173 
7174 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
7175 
7176 #define _RBIP                   0x01
7177 #define _INT3IP                 0x02
7178 #define _INT3P                  0x02
7179 #define _TMR0IP                 0x04
7180 #define _T0IP                   0x04
7181 #define _INTEDG3                0x08
7182 #define _INTEDG2                0x10
7183 #define _INTEDG1                0x20
7184 #define _INTEDG0                0x40
7185 #define _NOT_RBPU               0x80
7186 #define _RBPU                   0x80
7187 
7188 //==============================================================================
7189 
7190 
7191 //==============================================================================
7192 //        INTCON Bits
7193 
7194 extern __at(0x0FF2) __sfr INTCON;
7195 
7196 typedef union
7197   {
7198   struct
7199     {
7200     unsigned RBIF               : 1;
7201     unsigned INT0IF             : 1;
7202     unsigned TMR0IF             : 1;
7203     unsigned RBIE               : 1;
7204     unsigned INT0IE             : 1;
7205     unsigned TMR0IE             : 1;
7206     unsigned PEIE_GIEL          : 1;
7207     unsigned GIE_GIEH           : 1;
7208     };
7209 
7210   struct
7211     {
7212     unsigned                    : 1;
7213     unsigned INT0F              : 1;
7214     unsigned T0IF               : 1;
7215     unsigned                    : 1;
7216     unsigned INT0E              : 1;
7217     unsigned T0IE               : 1;
7218     unsigned PEIE               : 1;
7219     unsigned GIE                : 1;
7220     };
7221 
7222   struct
7223     {
7224     unsigned                    : 1;
7225     unsigned                    : 1;
7226     unsigned                    : 1;
7227     unsigned                    : 1;
7228     unsigned                    : 1;
7229     unsigned                    : 1;
7230     unsigned GIEL               : 1;
7231     unsigned GIEH               : 1;
7232     };
7233   } __INTCONbits_t;
7234 
7235 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
7236 
7237 #define _RBIF                   0x01
7238 #define _INT0IF                 0x02
7239 #define _INT0F                  0x02
7240 #define _TMR0IF                 0x04
7241 #define _T0IF                   0x04
7242 #define _RBIE                   0x08
7243 #define _INT0IE                 0x10
7244 #define _INT0E                  0x10
7245 #define _TMR0IE                 0x20
7246 #define _T0IE                   0x20
7247 #define _PEIE_GIEL              0x40
7248 #define _PEIE                   0x40
7249 #define _GIEL                   0x40
7250 #define _GIE_GIEH               0x80
7251 #define _GIE                    0x80
7252 #define _GIEH                   0x80
7253 
7254 //==============================================================================
7255 
7256 extern __at(0x0FF3) __sfr PROD;
7257 extern __at(0x0FF3) __sfr PRODL;
7258 extern __at(0x0FF4) __sfr PRODH;
7259 extern __at(0x0FF5) __sfr TABLAT;
7260 extern __at(0x0FF6) __sfr TBLPTR;
7261 extern __at(0x0FF6) __sfr TBLPTRL;
7262 extern __at(0x0FF7) __sfr TBLPTRH;
7263 extern __at(0x0FF8) __sfr TBLPTRU;
7264 extern __at(0x0FF9) __sfr PC;
7265 extern __at(0x0FF9) __sfr PCL;
7266 extern __at(0x0FFA) __sfr PCLATH;
7267 extern __at(0x0FFB) __sfr PCLATU;
7268 
7269 //==============================================================================
7270 //        STKPTR Bits
7271 
7272 extern __at(0x0FFC) __sfr STKPTR;
7273 
7274 typedef union
7275   {
7276   struct
7277     {
7278     unsigned SP0                : 1;
7279     unsigned SP1                : 1;
7280     unsigned SP2                : 1;
7281     unsigned SP3                : 1;
7282     unsigned SP4                : 1;
7283     unsigned                    : 1;
7284     unsigned STKUNF             : 1;
7285     unsigned STKFUL             : 1;
7286     };
7287 
7288   struct
7289     {
7290     unsigned                    : 1;
7291     unsigned                    : 1;
7292     unsigned                    : 1;
7293     unsigned                    : 1;
7294     unsigned                    : 1;
7295     unsigned                    : 1;
7296     unsigned                    : 1;
7297     unsigned STKOVF             : 1;
7298     };
7299 
7300   struct
7301     {
7302     unsigned SP                 : 5;
7303     unsigned                    : 3;
7304     };
7305   } __STKPTRbits_t;
7306 
7307 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
7308 
7309 #define _SP0                    0x01
7310 #define _SP1                    0x02
7311 #define _SP2                    0x04
7312 #define _SP3                    0x08
7313 #define _SP4                    0x10
7314 #define _STKUNF                 0x40
7315 #define _STKFUL                 0x80
7316 #define _STKOVF                 0x80
7317 
7318 //==============================================================================
7319 
7320 extern __at(0x0FFD) __sfr TOS;
7321 extern __at(0x0FFD) __sfr TOSL;
7322 extern __at(0x0FFE) __sfr TOSH;
7323 extern __at(0x0FFF) __sfr TOSU;
7324 
7325 //==============================================================================
7326 //
7327 //        Configuration Addresses
7328 //
7329 //==============================================================================
7330 
7331 #define __CONFIG1L              0x00FFF8
7332 #define __CONFIG1H              0x00FFF9
7333 #define __CONFIG2L              0x00FFFA
7334 #define __CONFIG2H              0x00FFFB
7335 #define __CONFIG3L              0x00FFFC
7336 #define __CONFIG3H              0x00FFFD
7337 #define __CONFIG4L              0x00FFFE
7338 #define __CONFIG4H              0x00FFFF
7339 
7340 //==============================================================================
7341 
7342 #endif // #ifndef __PIC18LF26J53_H__
7343