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