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