1 /*
2  * This declarations of the PIC18LF6527 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:24:06 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 __PIC18LF6527_H__
26 #define __PIC18LF6527_H__
27 
28 //==============================================================================
29 
30 //==============================================================================
31 //
32 //	Register Definitions
33 //
34 //==============================================================================
35 
36 
37 //==============================================================================
38 //        SSP2CON2 Bits
39 
40 extern __at(0x0F62) __sfr SSP2CON2;
41 
42 typedef union
43   {
44   struct
45     {
46     unsigned SEN                : 1;
47     unsigned RSEN               : 1;
48     unsigned PEN                : 1;
49     unsigned RCEN               : 1;
50     unsigned ACKEN              : 1;
51     unsigned ACKDT              : 1;
52     unsigned ACKSTAT            : 1;
53     unsigned GCEN               : 1;
54     };
55 
56   struct
57     {
58     unsigned SEN2               : 1;
59     unsigned RSEN2              : 1;
60     unsigned PEN2               : 1;
61     unsigned RCEN2              : 1;
62     unsigned ACKEN2             : 1;
63     unsigned ACKDT2             : 1;
64     unsigned ACKSTAT2           : 1;
65     unsigned GCEN2              : 1;
66     };
67   } __SSP2CON2bits_t;
68 
69 extern __at(0x0F62) volatile __SSP2CON2bits_t SSP2CON2bits;
70 
71 #define _SSP2CON2_SEN           0x01
72 #define _SSP2CON2_SEN2          0x01
73 #define _SSP2CON2_RSEN          0x02
74 #define _SSP2CON2_RSEN2         0x02
75 #define _SSP2CON2_PEN           0x04
76 #define _SSP2CON2_PEN2          0x04
77 #define _SSP2CON2_RCEN          0x08
78 #define _SSP2CON2_RCEN2         0x08
79 #define _SSP2CON2_ACKEN         0x10
80 #define _SSP2CON2_ACKEN2        0x10
81 #define _SSP2CON2_ACKDT         0x20
82 #define _SSP2CON2_ACKDT2        0x20
83 #define _SSP2CON2_ACKSTAT       0x40
84 #define _SSP2CON2_ACKSTAT2      0x40
85 #define _SSP2CON2_GCEN          0x80
86 #define _SSP2CON2_GCEN2         0x80
87 
88 //==============================================================================
89 
90 
91 //==============================================================================
92 //        SSP2CON1 Bits
93 
94 extern __at(0x0F63) __sfr SSP2CON1;
95 
96 typedef union
97   {
98   struct
99     {
100     unsigned SSPM0              : 1;
101     unsigned SSPM1              : 1;
102     unsigned SSPM2              : 1;
103     unsigned SSPM3              : 1;
104     unsigned CKP                : 1;
105     unsigned SSPEN              : 1;
106     unsigned SSPOV              : 1;
107     unsigned WCOL               : 1;
108     };
109 
110   struct
111     {
112     unsigned SSPM02             : 1;
113     unsigned SSPM12             : 1;
114     unsigned SSPM22             : 1;
115     unsigned SSPM32             : 1;
116     unsigned CKP2               : 1;
117     unsigned SSPEN2             : 1;
118     unsigned SSPOV2             : 1;
119     unsigned WCOL2              : 1;
120     };
121   } __SSP2CON1bits_t;
122 
123 extern __at(0x0F63) volatile __SSP2CON1bits_t SSP2CON1bits;
124 
125 #define _SSP2CON1_SSPM0         0x01
126 #define _SSP2CON1_SSPM02        0x01
127 #define _SSP2CON1_SSPM1         0x02
128 #define _SSP2CON1_SSPM12        0x02
129 #define _SSP2CON1_SSPM2         0x04
130 #define _SSP2CON1_SSPM22        0x04
131 #define _SSP2CON1_SSPM3         0x08
132 #define _SSP2CON1_SSPM32        0x08
133 #define _SSP2CON1_CKP           0x10
134 #define _SSP2CON1_CKP2          0x10
135 #define _SSP2CON1_SSPEN         0x20
136 #define _SSP2CON1_SSPEN2        0x20
137 #define _SSP2CON1_SSPOV         0x40
138 #define _SSP2CON1_SSPOV2        0x40
139 #define _SSP2CON1_WCOL          0x80
140 #define _SSP2CON1_WCOL2         0x80
141 
142 //==============================================================================
143 
144 
145 //==============================================================================
146 //        SSP2STAT Bits
147 
148 extern __at(0x0F64) __sfr SSP2STAT;
149 
150 typedef union
151   {
152   struct
153     {
154     unsigned BF                 : 1;
155     unsigned UA                 : 1;
156     unsigned R_NOT_W            : 1;
157     unsigned S                  : 1;
158     unsigned P                  : 1;
159     unsigned D_NOT_A            : 1;
160     unsigned CKE                : 1;
161     unsigned SMP                : 1;
162     };
163 
164   struct
165     {
166     unsigned BF2                : 1;
167     unsigned UA2                : 1;
168     unsigned R_W                : 1;
169     unsigned I2C_START          : 1;
170     unsigned I2C_STOP           : 1;
171     unsigned D_A                : 1;
172     unsigned CKE2               : 1;
173     unsigned SMP2               : 1;
174     };
175 
176   struct
177     {
178     unsigned                    : 1;
179     unsigned                    : 1;
180     unsigned I2C_READ           : 1;
181     unsigned START2             : 1;
182     unsigned STOP2              : 1;
183     unsigned I2C_DAT            : 1;
184     unsigned                    : 1;
185     unsigned                    : 1;
186     };
187 
188   struct
189     {
190     unsigned                    : 1;
191     unsigned                    : 1;
192     unsigned NOT_W              : 1;
193     unsigned                    : 1;
194     unsigned                    : 1;
195     unsigned NOT_A              : 1;
196     unsigned                    : 1;
197     unsigned                    : 1;
198     };
199 
200   struct
201     {
202     unsigned                    : 1;
203     unsigned                    : 1;
204     unsigned NOT_WRITE          : 1;
205     unsigned                    : 1;
206     unsigned                    : 1;
207     unsigned NOT_ADDRESS        : 1;
208     unsigned                    : 1;
209     unsigned                    : 1;
210     };
211 
212   struct
213     {
214     unsigned                    : 1;
215     unsigned                    : 1;
216     unsigned READ_WRITE         : 1;
217     unsigned                    : 1;
218     unsigned                    : 1;
219     unsigned DATA_ADDRESS       : 1;
220     unsigned                    : 1;
221     unsigned                    : 1;
222     };
223 
224   struct
225     {
226     unsigned                    : 1;
227     unsigned                    : 1;
228     unsigned R                  : 1;
229     unsigned                    : 1;
230     unsigned                    : 1;
231     unsigned D                  : 1;
232     unsigned                    : 1;
233     unsigned                    : 1;
234     };
235 
236   struct
237     {
238     unsigned                    : 1;
239     unsigned                    : 1;
240     unsigned RW2                : 1;
241     unsigned                    : 1;
242     unsigned                    : 1;
243     unsigned DA2                : 1;
244     unsigned                    : 1;
245     unsigned                    : 1;
246     };
247   } __SSP2STATbits_t;
248 
249 extern __at(0x0F64) volatile __SSP2STATbits_t SSP2STATbits;
250 
251 #define _SSP2STAT_BF            0x01
252 #define _SSP2STAT_BF2           0x01
253 #define _SSP2STAT_UA            0x02
254 #define _SSP2STAT_UA2           0x02
255 #define _SSP2STAT_R_NOT_W       0x04
256 #define _SSP2STAT_R_W           0x04
257 #define _SSP2STAT_I2C_READ      0x04
258 #define _SSP2STAT_NOT_W         0x04
259 #define _SSP2STAT_NOT_WRITE     0x04
260 #define _SSP2STAT_READ_WRITE    0x04
261 #define _SSP2STAT_R             0x04
262 #define _SSP2STAT_RW2           0x04
263 #define _SSP2STAT_S             0x08
264 #define _SSP2STAT_I2C_START     0x08
265 #define _SSP2STAT_START2        0x08
266 #define _SSP2STAT_P             0x10
267 #define _SSP2STAT_I2C_STOP      0x10
268 #define _SSP2STAT_STOP2         0x10
269 #define _SSP2STAT_D_NOT_A       0x20
270 #define _SSP2STAT_D_A           0x20
271 #define _SSP2STAT_I2C_DAT       0x20
272 #define _SSP2STAT_NOT_A         0x20
273 #define _SSP2STAT_NOT_ADDRESS   0x20
274 #define _SSP2STAT_DATA_ADDRESS  0x20
275 #define _SSP2STAT_D             0x20
276 #define _SSP2STAT_DA2           0x20
277 #define _SSP2STAT_CKE           0x40
278 #define _SSP2STAT_CKE2          0x40
279 #define _SSP2STAT_SMP           0x80
280 #define _SSP2STAT_SMP2          0x80
281 
282 //==============================================================================
283 
284 extern __at(0x0F65) __sfr SSP2ADD;
285 extern __at(0x0F66) __sfr SSP2BUF;
286 
287 //==============================================================================
288 //        ECCP2DEL Bits
289 
290 extern __at(0x0F67) __sfr ECCP2DEL;
291 
292 typedef union
293   {
294   struct
295     {
296     unsigned P2DC0              : 1;
297     unsigned P2DC1              : 1;
298     unsigned P2DC2              : 1;
299     unsigned P2DC3              : 1;
300     unsigned P2DC4              : 1;
301     unsigned P2DC5              : 1;
302     unsigned P2DC6              : 1;
303     unsigned P2RSEN             : 1;
304     };
305 
306   struct
307     {
308     unsigned PDC0               : 1;
309     unsigned PDC1               : 1;
310     unsigned PDC2               : 1;
311     unsigned PDC3               : 1;
312     unsigned PDC4               : 1;
313     unsigned PDC5               : 1;
314     unsigned PDC6               : 1;
315     unsigned PRSEN              : 1;
316     };
317 
318   struct
319     {
320     unsigned P2DC               : 7;
321     unsigned                    : 1;
322     };
323 
324   struct
325     {
326     unsigned PDC                : 7;
327     unsigned                    : 1;
328     };
329   } __ECCP2DELbits_t;
330 
331 extern __at(0x0F67) volatile __ECCP2DELbits_t ECCP2DELbits;
332 
333 #define _ECCP2DEL_P2DC0         0x01
334 #define _ECCP2DEL_PDC0          0x01
335 #define _ECCP2DEL_P2DC1         0x02
336 #define _ECCP2DEL_PDC1          0x02
337 #define _ECCP2DEL_P2DC2         0x04
338 #define _ECCP2DEL_PDC2          0x04
339 #define _ECCP2DEL_P2DC3         0x08
340 #define _ECCP2DEL_PDC3          0x08
341 #define _ECCP2DEL_P2DC4         0x10
342 #define _ECCP2DEL_PDC4          0x10
343 #define _ECCP2DEL_P2DC5         0x20
344 #define _ECCP2DEL_PDC5          0x20
345 #define _ECCP2DEL_P2DC6         0x40
346 #define _ECCP2DEL_PDC6          0x40
347 #define _ECCP2DEL_P2RSEN        0x80
348 #define _ECCP2DEL_PRSEN         0x80
349 
350 //==============================================================================
351 
352 
353 //==============================================================================
354 //        ECCP2AS Bits
355 
356 extern __at(0x0F68) __sfr ECCP2AS;
357 
358 typedef union
359   {
360   struct
361     {
362     unsigned PSS2BD0            : 1;
363     unsigned PSS2BD1            : 1;
364     unsigned PSS2AC0            : 1;
365     unsigned PSS2AC1            : 1;
366     unsigned ECCP2AS0           : 1;
367     unsigned ECCP2AS1           : 1;
368     unsigned ECCP2AS2           : 1;
369     unsigned ECCP2ASE           : 1;
370     };
371 
372   struct
373     {
374     unsigned PSSBD0             : 1;
375     unsigned PSSBD1             : 1;
376     unsigned PSSAC0             : 1;
377     unsigned PSSAC1             : 1;
378     unsigned ECCPAS0            : 1;
379     unsigned ECCPAS1            : 1;
380     unsigned ECCPAS2            : 1;
381     unsigned ECCPASE            : 1;
382     };
383 
384   struct
385     {
386     unsigned PSS2BD             : 2;
387     unsigned                    : 6;
388     };
389 
390   struct
391     {
392     unsigned PSSBD              : 2;
393     unsigned                    : 6;
394     };
395 
396   struct
397     {
398     unsigned                    : 2;
399     unsigned PSSAC              : 2;
400     unsigned                    : 4;
401     };
402 
403   struct
404     {
405     unsigned                    : 2;
406     unsigned PSS2AC             : 2;
407     unsigned                    : 4;
408     };
409 
410   struct
411     {
412     unsigned                    : 4;
413     unsigned ECCPAS             : 3;
414     unsigned                    : 1;
415     };
416 
417   struct
418     {
419     unsigned                    : 4;
420     unsigned ECCP2AS            : 3;
421     unsigned                    : 1;
422     };
423   } __ECCP2ASbits_t;
424 
425 extern __at(0x0F68) volatile __ECCP2ASbits_t ECCP2ASbits;
426 
427 #define _ECCP2AS_PSS2BD0        0x01
428 #define _ECCP2AS_PSSBD0         0x01
429 #define _ECCP2AS_PSS2BD1        0x02
430 #define _ECCP2AS_PSSBD1         0x02
431 #define _ECCP2AS_PSS2AC0        0x04
432 #define _ECCP2AS_PSSAC0         0x04
433 #define _ECCP2AS_PSS2AC1        0x08
434 #define _ECCP2AS_PSSAC1         0x08
435 #define _ECCP2AS_ECCP2AS0       0x10
436 #define _ECCP2AS_ECCPAS0        0x10
437 #define _ECCP2AS_ECCP2AS1       0x20
438 #define _ECCP2AS_ECCPAS1        0x20
439 #define _ECCP2AS_ECCP2AS2       0x40
440 #define _ECCP2AS_ECCPAS2        0x40
441 #define _ECCP2AS_ECCP2ASE       0x80
442 #define _ECCP2AS_ECCPASE        0x80
443 
444 //==============================================================================
445 
446 
447 //==============================================================================
448 //        ECCP3DEL Bits
449 
450 extern __at(0x0F69) __sfr ECCP3DEL;
451 
452 typedef union
453   {
454   struct
455     {
456     unsigned P3DC0              : 1;
457     unsigned P3DC1              : 1;
458     unsigned P3DC2              : 1;
459     unsigned P3DC3              : 1;
460     unsigned P3DC4              : 1;
461     unsigned P3DC5              : 1;
462     unsigned P3DC6              : 1;
463     unsigned P3RSEN             : 1;
464     };
465 
466   struct
467     {
468     unsigned PDC0               : 1;
469     unsigned PDC1               : 1;
470     unsigned PDC2               : 1;
471     unsigned PDC3               : 1;
472     unsigned PDC4               : 1;
473     unsigned PDC5               : 1;
474     unsigned PDC6               : 1;
475     unsigned PRSEN              : 1;
476     };
477 
478   struct
479     {
480     unsigned P3DC               : 7;
481     unsigned                    : 1;
482     };
483 
484   struct
485     {
486     unsigned PDC                : 7;
487     unsigned                    : 1;
488     };
489   } __ECCP3DELbits_t;
490 
491 extern __at(0x0F69) volatile __ECCP3DELbits_t ECCP3DELbits;
492 
493 #define _ECCP3DEL_P3DC0         0x01
494 #define _ECCP3DEL_PDC0          0x01
495 #define _ECCP3DEL_P3DC1         0x02
496 #define _ECCP3DEL_PDC1          0x02
497 #define _ECCP3DEL_P3DC2         0x04
498 #define _ECCP3DEL_PDC2          0x04
499 #define _ECCP3DEL_P3DC3         0x08
500 #define _ECCP3DEL_PDC3          0x08
501 #define _ECCP3DEL_P3DC4         0x10
502 #define _ECCP3DEL_PDC4          0x10
503 #define _ECCP3DEL_P3DC5         0x20
504 #define _ECCP3DEL_PDC5          0x20
505 #define _ECCP3DEL_P3DC6         0x40
506 #define _ECCP3DEL_PDC6          0x40
507 #define _ECCP3DEL_P3RSEN        0x80
508 #define _ECCP3DEL_PRSEN         0x80
509 
510 //==============================================================================
511 
512 
513 //==============================================================================
514 //        ECCP3AS Bits
515 
516 extern __at(0x0F6A) __sfr ECCP3AS;
517 
518 typedef union
519   {
520   struct
521     {
522     unsigned PSS3BD0            : 1;
523     unsigned PSS3BD1            : 1;
524     unsigned PSS3AC0            : 1;
525     unsigned PSS3AC1            : 1;
526     unsigned ECCP3AS0           : 1;
527     unsigned ECCP3AS1           : 1;
528     unsigned ECCP3AS2           : 1;
529     unsigned ECCP3ASE           : 1;
530     };
531 
532   struct
533     {
534     unsigned PSSBD0             : 1;
535     unsigned PSSBD1             : 1;
536     unsigned PSSAC0             : 1;
537     unsigned PSSAC1             : 1;
538     unsigned ECCPAS0            : 1;
539     unsigned ECCPAS1            : 1;
540     unsigned ECCPAS2            : 1;
541     unsigned ECCPASE            : 1;
542     };
543 
544   struct
545     {
546     unsigned PSS3BD             : 2;
547     unsigned                    : 6;
548     };
549 
550   struct
551     {
552     unsigned PSSBD              : 2;
553     unsigned                    : 6;
554     };
555 
556   struct
557     {
558     unsigned                    : 2;
559     unsigned PSS3AC             : 2;
560     unsigned                    : 4;
561     };
562 
563   struct
564     {
565     unsigned                    : 2;
566     unsigned PSSAC              : 2;
567     unsigned                    : 4;
568     };
569 
570   struct
571     {
572     unsigned                    : 4;
573     unsigned ECCP3AS            : 3;
574     unsigned                    : 1;
575     };
576 
577   struct
578     {
579     unsigned                    : 4;
580     unsigned ECCPAS             : 3;
581     unsigned                    : 1;
582     };
583   } __ECCP3ASbits_t;
584 
585 extern __at(0x0F6A) volatile __ECCP3ASbits_t ECCP3ASbits;
586 
587 #define _ECCP3AS_PSS3BD0        0x01
588 #define _ECCP3AS_PSSBD0         0x01
589 #define _ECCP3AS_PSS3BD1        0x02
590 #define _ECCP3AS_PSSBD1         0x02
591 #define _ECCP3AS_PSS3AC0        0x04
592 #define _ECCP3AS_PSSAC0         0x04
593 #define _ECCP3AS_PSS3AC1        0x08
594 #define _ECCP3AS_PSSAC1         0x08
595 #define _ECCP3AS_ECCP3AS0       0x10
596 #define _ECCP3AS_ECCPAS0        0x10
597 #define _ECCP3AS_ECCP3AS1       0x20
598 #define _ECCP3AS_ECCPAS1        0x20
599 #define _ECCP3AS_ECCP3AS2       0x40
600 #define _ECCP3AS_ECCPAS2        0x40
601 #define _ECCP3AS_ECCP3ASE       0x80
602 #define _ECCP3AS_ECCPASE        0x80
603 
604 //==============================================================================
605 
606 
607 //==============================================================================
608 //        RCSTA2 Bits
609 
610 extern __at(0x0F6B) __sfr RCSTA2;
611 
612 typedef union
613   {
614   struct
615     {
616     unsigned RX9D               : 1;
617     unsigned OERR               : 1;
618     unsigned FERR               : 1;
619     unsigned ADDEN              : 1;
620     unsigned CREN               : 1;
621     unsigned SREN               : 1;
622     unsigned RX9                : 1;
623     unsigned SPEN               : 1;
624     };
625 
626   struct
627     {
628     unsigned RCD8               : 1;
629     unsigned OERR2              : 1;
630     unsigned FERR2              : 1;
631     unsigned ADDEN2             : 1;
632     unsigned CREN2              : 1;
633     unsigned SREN2              : 1;
634     unsigned RC9                : 1;
635     unsigned SPEN2              : 1;
636     };
637 
638   struct
639     {
640     unsigned RX9D2              : 1;
641     unsigned                    : 1;
642     unsigned                    : 1;
643     unsigned                    : 1;
644     unsigned                    : 1;
645     unsigned                    : 1;
646     unsigned NOT_RC8            : 1;
647     unsigned                    : 1;
648     };
649 
650   struct
651     {
652     unsigned                    : 1;
653     unsigned                    : 1;
654     unsigned                    : 1;
655     unsigned                    : 1;
656     unsigned                    : 1;
657     unsigned                    : 1;
658     unsigned RC8_9              : 1;
659     unsigned                    : 1;
660     };
661 
662   struct
663     {
664     unsigned                    : 1;
665     unsigned                    : 1;
666     unsigned                    : 1;
667     unsigned                    : 1;
668     unsigned                    : 1;
669     unsigned                    : 1;
670     unsigned RX92               : 1;
671     unsigned                    : 1;
672     };
673   } __RCSTA2bits_t;
674 
675 extern __at(0x0F6B) volatile __RCSTA2bits_t RCSTA2bits;
676 
677 #define _RCSTA2_RX9D            0x01
678 #define _RCSTA2_RCD8            0x01
679 #define _RCSTA2_RX9D2           0x01
680 #define _RCSTA2_OERR            0x02
681 #define _RCSTA2_OERR2           0x02
682 #define _RCSTA2_FERR            0x04
683 #define _RCSTA2_FERR2           0x04
684 #define _RCSTA2_ADDEN           0x08
685 #define _RCSTA2_ADDEN2          0x08
686 #define _RCSTA2_CREN            0x10
687 #define _RCSTA2_CREN2           0x10
688 #define _RCSTA2_SREN            0x20
689 #define _RCSTA2_SREN2           0x20
690 #define _RCSTA2_RX9             0x40
691 #define _RCSTA2_RC9             0x40
692 #define _RCSTA2_NOT_RC8         0x40
693 #define _RCSTA2_RC8_9           0x40
694 #define _RCSTA2_RX92            0x40
695 #define _RCSTA2_SPEN            0x80
696 #define _RCSTA2_SPEN2           0x80
697 
698 //==============================================================================
699 
700 
701 //==============================================================================
702 //        TXSTA2 Bits
703 
704 extern __at(0x0F6C) __sfr TXSTA2;
705 
706 typedef union
707   {
708   struct
709     {
710     unsigned TX9D               : 1;
711     unsigned TRMT               : 1;
712     unsigned BRGH               : 1;
713     unsigned SENDB              : 1;
714     unsigned SYNC               : 1;
715     unsigned TXEN               : 1;
716     unsigned TX9                : 1;
717     unsigned CSRC               : 1;
718     };
719 
720   struct
721     {
722     unsigned TXD8               : 1;
723     unsigned TRMT2              : 1;
724     unsigned BRGH2              : 1;
725     unsigned SENDB2             : 1;
726     unsigned SYNC2              : 1;
727     unsigned TXEN2              : 1;
728     unsigned TX8_9              : 1;
729     unsigned CSRC2              : 1;
730     };
731 
732   struct
733     {
734     unsigned TX9D2              : 1;
735     unsigned                    : 1;
736     unsigned                    : 1;
737     unsigned                    : 1;
738     unsigned                    : 1;
739     unsigned                    : 1;
740     unsigned NOT_TX8            : 1;
741     unsigned                    : 1;
742     };
743 
744   struct
745     {
746     unsigned                    : 1;
747     unsigned                    : 1;
748     unsigned                    : 1;
749     unsigned                    : 1;
750     unsigned                    : 1;
751     unsigned                    : 1;
752     unsigned TX92               : 1;
753     unsigned                    : 1;
754     };
755   } __TXSTA2bits_t;
756 
757 extern __at(0x0F6C) volatile __TXSTA2bits_t TXSTA2bits;
758 
759 #define _TXSTA2_TX9D            0x01
760 #define _TXSTA2_TXD8            0x01
761 #define _TXSTA2_TX9D2           0x01
762 #define _TXSTA2_TRMT            0x02
763 #define _TXSTA2_TRMT2           0x02
764 #define _TXSTA2_BRGH            0x04
765 #define _TXSTA2_BRGH2           0x04
766 #define _TXSTA2_SENDB           0x08
767 #define _TXSTA2_SENDB2          0x08
768 #define _TXSTA2_SYNC            0x10
769 #define _TXSTA2_SYNC2           0x10
770 #define _TXSTA2_TXEN            0x20
771 #define _TXSTA2_TXEN2           0x20
772 #define _TXSTA2_TX9             0x40
773 #define _TXSTA2_TX8_9           0x40
774 #define _TXSTA2_NOT_TX8         0x40
775 #define _TXSTA2_TX92            0x40
776 #define _TXSTA2_CSRC            0x80
777 #define _TXSTA2_CSRC2           0x80
778 
779 //==============================================================================
780 
781 extern __at(0x0F6D) __sfr TXREG2;
782 extern __at(0x0F6E) __sfr RCREG2;
783 extern __at(0x0F6F) __sfr SPBRG2;
784 
785 //==============================================================================
786 //        CCP5CON Bits
787 
788 extern __at(0x0F70) __sfr CCP5CON;
789 
790 typedef union
791   {
792   struct
793     {
794     unsigned CCP5M0             : 1;
795     unsigned CCP5M1             : 1;
796     unsigned CCP5M2             : 1;
797     unsigned CCP5M3             : 1;
798     unsigned DCCP5Y             : 1;
799     unsigned DCCP5X             : 1;
800     unsigned                    : 1;
801     unsigned                    : 1;
802     };
803 
804   struct
805     {
806     unsigned                    : 1;
807     unsigned                    : 1;
808     unsigned                    : 1;
809     unsigned                    : 1;
810     unsigned DC5B0              : 1;
811     unsigned DC5B1              : 1;
812     unsigned                    : 1;
813     unsigned                    : 1;
814     };
815 
816   struct
817     {
818     unsigned CCP5M              : 4;
819     unsigned                    : 4;
820     };
821 
822   struct
823     {
824     unsigned                    : 4;
825     unsigned DC5B               : 2;
826     unsigned                    : 2;
827     };
828   } __CCP5CONbits_t;
829 
830 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits;
831 
832 #define _CCP5M0                 0x01
833 #define _CCP5M1                 0x02
834 #define _CCP5M2                 0x04
835 #define _CCP5M3                 0x08
836 #define _DCCP5Y                 0x10
837 #define _DC5B0                  0x10
838 #define _DCCP5X                 0x20
839 #define _DC5B1                  0x20
840 
841 //==============================================================================
842 
843 extern __at(0x0F71) __sfr CCPR5;
844 extern __at(0x0F71) __sfr CCPR5L;
845 extern __at(0x0F72) __sfr CCPR5H;
846 
847 //==============================================================================
848 //        CCP4CON Bits
849 
850 extern __at(0x0F73) __sfr CCP4CON;
851 
852 typedef union
853   {
854   struct
855     {
856     unsigned CCP4M0             : 1;
857     unsigned CCP4M1             : 1;
858     unsigned CCP4M2             : 1;
859     unsigned CCP4M3             : 1;
860     unsigned DCCP4Y             : 1;
861     unsigned DCCP4X             : 1;
862     unsigned                    : 1;
863     unsigned                    : 1;
864     };
865 
866   struct
867     {
868     unsigned                    : 1;
869     unsigned                    : 1;
870     unsigned                    : 1;
871     unsigned                    : 1;
872     unsigned DC4B0              : 1;
873     unsigned DC4B1              : 1;
874     unsigned                    : 1;
875     unsigned                    : 1;
876     };
877 
878   struct
879     {
880     unsigned CCP4M              : 4;
881     unsigned                    : 4;
882     };
883 
884   struct
885     {
886     unsigned                    : 4;
887     unsigned DC4B               : 2;
888     unsigned                    : 2;
889     };
890   } __CCP4CONbits_t;
891 
892 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits;
893 
894 #define _CCP4M0                 0x01
895 #define _CCP4M1                 0x02
896 #define _CCP4M2                 0x04
897 #define _CCP4M3                 0x08
898 #define _DCCP4Y                 0x10
899 #define _DC4B0                  0x10
900 #define _DCCP4X                 0x20
901 #define _DC4B1                  0x20
902 
903 //==============================================================================
904 
905 extern __at(0x0F74) __sfr CCPR4;
906 extern __at(0x0F74) __sfr CCPR4L;
907 extern __at(0x0F75) __sfr CCPR4H;
908 
909 //==============================================================================
910 //        T4CON Bits
911 
912 extern __at(0x0F76) __sfr T4CON;
913 
914 typedef union
915   {
916   struct
917     {
918     unsigned T4CKPS0            : 1;
919     unsigned T4CKPS1            : 1;
920     unsigned TMR4ON             : 1;
921     unsigned T4OUTPS0           : 1;
922     unsigned T4OUTPS1           : 1;
923     unsigned T4OUTPS2           : 1;
924     unsigned T4OUTPS3           : 1;
925     unsigned                    : 1;
926     };
927 
928   struct
929     {
930     unsigned T4CKPS             : 2;
931     unsigned                    : 6;
932     };
933 
934   struct
935     {
936     unsigned                    : 3;
937     unsigned T4OUTPS            : 4;
938     unsigned                    : 1;
939     };
940   } __T4CONbits_t;
941 
942 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
943 
944 #define _T4CKPS0                0x01
945 #define _T4CKPS1                0x02
946 #define _TMR4ON                 0x04
947 #define _T4OUTPS0               0x08
948 #define _T4OUTPS1               0x10
949 #define _T4OUTPS2               0x20
950 #define _T4OUTPS3               0x40
951 
952 //==============================================================================
953 
954 extern __at(0x0F77) __sfr PR4;
955 extern __at(0x0F78) __sfr TMR4;
956 
957 //==============================================================================
958 //        ECCP1DEL Bits
959 
960 extern __at(0x0F79) __sfr ECCP1DEL;
961 
962 typedef union
963   {
964   struct
965     {
966     unsigned P1DC0              : 1;
967     unsigned P1DC1              : 1;
968     unsigned P1DC2              : 1;
969     unsigned P1DC3              : 1;
970     unsigned P1DC4              : 1;
971     unsigned P1DC5              : 1;
972     unsigned P1DC6              : 1;
973     unsigned P1RSEN             : 1;
974     };
975 
976   struct
977     {
978     unsigned PDC0               : 1;
979     unsigned PDC1               : 1;
980     unsigned PDC2               : 1;
981     unsigned PDC3               : 1;
982     unsigned PDC4               : 1;
983     unsigned PDC5               : 1;
984     unsigned PDC6               : 1;
985     unsigned PRSEN              : 1;
986     };
987 
988   struct
989     {
990     unsigned PDC                : 7;
991     unsigned                    : 1;
992     };
993 
994   struct
995     {
996     unsigned P1DC               : 7;
997     unsigned                    : 1;
998     };
999   } __ECCP1DELbits_t;
1000 
1001 extern __at(0x0F79) volatile __ECCP1DELbits_t ECCP1DELbits;
1002 
1003 #define _P1DC0                  0x01
1004 #define _PDC0                   0x01
1005 #define _P1DC1                  0x02
1006 #define _PDC1                   0x02
1007 #define _P1DC2                  0x04
1008 #define _PDC2                   0x04
1009 #define _P1DC3                  0x08
1010 #define _PDC3                   0x08
1011 #define _P1DC4                  0x10
1012 #define _PDC4                   0x10
1013 #define _P1DC5                  0x20
1014 #define _PDC5                   0x20
1015 #define _P1DC6                  0x40
1016 #define _PDC6                   0x40
1017 #define _P1RSEN                 0x80
1018 #define _PRSEN                  0x80
1019 
1020 //==============================================================================
1021 
1022 
1023 //==============================================================================
1024 //        BAUDCON2 Bits
1025 
1026 extern __at(0x0F7C) __sfr BAUDCON2;
1027 
1028 typedef union
1029   {
1030   struct
1031     {
1032     unsigned ABDEN              : 1;
1033     unsigned WUE                : 1;
1034     unsigned                    : 1;
1035     unsigned BRG16              : 1;
1036     unsigned SCKP               : 1;
1037     unsigned                    : 1;
1038     unsigned RCIDL              : 1;
1039     unsigned ABDOVF             : 1;
1040     };
1041 
1042   struct
1043     {
1044     unsigned ABDEN2             : 1;
1045     unsigned WUE2               : 1;
1046     unsigned                    : 1;
1047     unsigned BRG162             : 1;
1048     unsigned SCKP2              : 1;
1049     unsigned                    : 1;
1050     unsigned RCMT               : 1;
1051     unsigned ABDOVF2            : 1;
1052     };
1053 
1054   struct
1055     {
1056     unsigned                    : 1;
1057     unsigned                    : 1;
1058     unsigned                    : 1;
1059     unsigned                    : 1;
1060     unsigned                    : 1;
1061     unsigned                    : 1;
1062     unsigned RCIDL2             : 1;
1063     unsigned                    : 1;
1064     };
1065   } __BAUDCON2bits_t;
1066 
1067 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
1068 
1069 #define _BAUDCON2_ABDEN         0x01
1070 #define _BAUDCON2_ABDEN2        0x01
1071 #define _BAUDCON2_WUE           0x02
1072 #define _BAUDCON2_WUE2          0x02
1073 #define _BAUDCON2_BRG16         0x08
1074 #define _BAUDCON2_BRG162        0x08
1075 #define _BAUDCON2_SCKP          0x10
1076 #define _BAUDCON2_SCKP2         0x10
1077 #define _BAUDCON2_RCIDL         0x40
1078 #define _BAUDCON2_RCMT          0x40
1079 #define _BAUDCON2_RCIDL2        0x40
1080 #define _BAUDCON2_ABDOVF        0x80
1081 #define _BAUDCON2_ABDOVF2       0x80
1082 
1083 //==============================================================================
1084 
1085 extern __at(0x0F7D) __sfr SPBRGH2;
1086 
1087 //==============================================================================
1088 //        BAUDCON Bits
1089 
1090 extern __at(0x0F7E) __sfr BAUDCON;
1091 
1092 typedef union
1093   {
1094   struct
1095     {
1096     unsigned ABDEN              : 1;
1097     unsigned WUE                : 1;
1098     unsigned                    : 1;
1099     unsigned BRG16              : 1;
1100     unsigned SCKP               : 1;
1101     unsigned                    : 1;
1102     unsigned RCIDL              : 1;
1103     unsigned ABDOVF             : 1;
1104     };
1105 
1106   struct
1107     {
1108     unsigned ABDEN1             : 1;
1109     unsigned WUE1               : 1;
1110     unsigned                    : 1;
1111     unsigned BRG161             : 1;
1112     unsigned SCKP1              : 1;
1113     unsigned                    : 1;
1114     unsigned RCMT               : 1;
1115     unsigned ABDOVF1            : 1;
1116     };
1117 
1118   struct
1119     {
1120     unsigned                    : 1;
1121     unsigned                    : 1;
1122     unsigned                    : 1;
1123     unsigned                    : 1;
1124     unsigned                    : 1;
1125     unsigned                    : 1;
1126     unsigned RCIDL1             : 1;
1127     unsigned                    : 1;
1128     };
1129   } __BAUDCONbits_t;
1130 
1131 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1132 
1133 #define _ABDEN                  0x01
1134 #define _ABDEN1                 0x01
1135 #define _WUE                    0x02
1136 #define _WUE1                   0x02
1137 #define _BRG16                  0x08
1138 #define _BRG161                 0x08
1139 #define _SCKP                   0x10
1140 #define _SCKP1                  0x10
1141 #define _RCIDL                  0x40
1142 #define _RCMT                   0x40
1143 #define _RCIDL1                 0x40
1144 #define _ABDOVF                 0x80
1145 #define _ABDOVF1                0x80
1146 
1147 //==============================================================================
1148 
1149 
1150 //==============================================================================
1151 //        BAUDCON1 Bits
1152 
1153 extern __at(0x0F7E) __sfr BAUDCON1;
1154 
1155 typedef union
1156   {
1157   struct
1158     {
1159     unsigned ABDEN              : 1;
1160     unsigned WUE                : 1;
1161     unsigned                    : 1;
1162     unsigned BRG16              : 1;
1163     unsigned SCKP               : 1;
1164     unsigned                    : 1;
1165     unsigned RCIDL              : 1;
1166     unsigned ABDOVF             : 1;
1167     };
1168 
1169   struct
1170     {
1171     unsigned ABDEN1             : 1;
1172     unsigned WUE1               : 1;
1173     unsigned                    : 1;
1174     unsigned BRG161             : 1;
1175     unsigned SCKP1              : 1;
1176     unsigned                    : 1;
1177     unsigned RCMT               : 1;
1178     unsigned ABDOVF1            : 1;
1179     };
1180 
1181   struct
1182     {
1183     unsigned                    : 1;
1184     unsigned                    : 1;
1185     unsigned                    : 1;
1186     unsigned                    : 1;
1187     unsigned                    : 1;
1188     unsigned                    : 1;
1189     unsigned RCIDL1             : 1;
1190     unsigned                    : 1;
1191     };
1192   } __BAUDCON1bits_t;
1193 
1194 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1195 
1196 #define _BAUDCON1_ABDEN         0x01
1197 #define _BAUDCON1_ABDEN1        0x01
1198 #define _BAUDCON1_WUE           0x02
1199 #define _BAUDCON1_WUE1          0x02
1200 #define _BAUDCON1_BRG16         0x08
1201 #define _BAUDCON1_BRG161        0x08
1202 #define _BAUDCON1_SCKP          0x10
1203 #define _BAUDCON1_SCKP1         0x10
1204 #define _BAUDCON1_RCIDL         0x40
1205 #define _BAUDCON1_RCMT          0x40
1206 #define _BAUDCON1_RCIDL1        0x40
1207 #define _BAUDCON1_ABDOVF        0x80
1208 #define _BAUDCON1_ABDOVF1       0x80
1209 
1210 //==============================================================================
1211 
1212 extern __at(0x0F7F) __sfr SPBRGH;
1213 extern __at(0x0F7F) __sfr SPBRGH1;
1214 
1215 //==============================================================================
1216 //        PORTA Bits
1217 
1218 extern __at(0x0F80) __sfr PORTA;
1219 
1220 typedef union
1221   {
1222   struct
1223     {
1224     unsigned RA0                : 1;
1225     unsigned RA1                : 1;
1226     unsigned RA2                : 1;
1227     unsigned RA3                : 1;
1228     unsigned RA4                : 1;
1229     unsigned RA5                : 1;
1230     unsigned RA6                : 1;
1231     unsigned RA7                : 1;
1232     };
1233 
1234   struct
1235     {
1236     unsigned AN0                : 1;
1237     unsigned AN1                : 1;
1238     unsigned VREFM              : 1;
1239     unsigned VREFP              : 1;
1240     unsigned T0CKI              : 1;
1241     unsigned LVDIN              : 1;
1242     unsigned                    : 1;
1243     unsigned                    : 1;
1244     };
1245 
1246   struct
1247     {
1248     unsigned                    : 1;
1249     unsigned                    : 1;
1250     unsigned AN2                : 1;
1251     unsigned AN3                : 1;
1252     unsigned                    : 1;
1253     unsigned AN4                : 1;
1254     unsigned                    : 1;
1255     unsigned                    : 1;
1256     };
1257 
1258   struct
1259     {
1260     unsigned                    : 1;
1261     unsigned                    : 1;
1262     unsigned                    : 1;
1263     unsigned                    : 1;
1264     unsigned                    : 1;
1265     unsigned HLVDIN             : 1;
1266     unsigned                    : 1;
1267     unsigned                    : 1;
1268     };
1269   } __PORTAbits_t;
1270 
1271 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1272 
1273 #define _PORTA_RA0              0x01
1274 #define _PORTA_AN0              0x01
1275 #define _PORTA_RA1              0x02
1276 #define _PORTA_AN1              0x02
1277 #define _PORTA_RA2              0x04
1278 #define _PORTA_VREFM            0x04
1279 #define _PORTA_AN2              0x04
1280 #define _PORTA_RA3              0x08
1281 #define _PORTA_VREFP            0x08
1282 #define _PORTA_AN3              0x08
1283 #define _PORTA_RA4              0x10
1284 #define _PORTA_T0CKI            0x10
1285 #define _PORTA_RA5              0x20
1286 #define _PORTA_LVDIN            0x20
1287 #define _PORTA_AN4              0x20
1288 #define _PORTA_HLVDIN           0x20
1289 #define _PORTA_RA6              0x40
1290 #define _PORTA_RA7              0x80
1291 
1292 //==============================================================================
1293 
1294 
1295 //==============================================================================
1296 //        PORTB Bits
1297 
1298 extern __at(0x0F81) __sfr PORTB;
1299 
1300 typedef union
1301   {
1302   struct
1303     {
1304     unsigned RB0                : 1;
1305     unsigned RB1                : 1;
1306     unsigned RB2                : 1;
1307     unsigned RB3                : 1;
1308     unsigned RB4                : 1;
1309     unsigned RB5                : 1;
1310     unsigned RB6                : 1;
1311     unsigned RB7                : 1;
1312     };
1313 
1314   struct
1315     {
1316     unsigned INT0               : 1;
1317     unsigned INT1               : 1;
1318     unsigned INT2               : 1;
1319     unsigned INT3               : 1;
1320     unsigned KBI0               : 1;
1321     unsigned KBI1               : 1;
1322     unsigned KBI2               : 1;
1323     unsigned KBI3               : 1;
1324     };
1325 
1326   struct
1327     {
1328     unsigned FLT0               : 1;
1329     unsigned                    : 1;
1330     unsigned                    : 1;
1331     unsigned                    : 1;
1332     unsigned                    : 1;
1333     unsigned                    : 1;
1334     unsigned                    : 1;
1335     unsigned                    : 1;
1336     };
1337 
1338   struct
1339     {
1340     unsigned INT                : 4;
1341     unsigned                    : 4;
1342     };
1343 
1344   struct
1345     {
1346     unsigned                    : 4;
1347     unsigned KBI                : 4;
1348     };
1349   } __PORTBbits_t;
1350 
1351 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1352 
1353 #define _PORTB_RB0              0x01
1354 #define _PORTB_INT0             0x01
1355 #define _PORTB_FLT0             0x01
1356 #define _PORTB_RB1              0x02
1357 #define _PORTB_INT1             0x02
1358 #define _PORTB_RB2              0x04
1359 #define _PORTB_INT2             0x04
1360 #define _PORTB_RB3              0x08
1361 #define _PORTB_INT3             0x08
1362 #define _PORTB_RB4              0x10
1363 #define _PORTB_KBI0             0x10
1364 #define _PORTB_RB5              0x20
1365 #define _PORTB_KBI1             0x20
1366 #define _PORTB_RB6              0x40
1367 #define _PORTB_KBI2             0x40
1368 #define _PORTB_RB7              0x80
1369 #define _PORTB_KBI3             0x80
1370 
1371 //==============================================================================
1372 
1373 
1374 //==============================================================================
1375 //        PORTC Bits
1376 
1377 extern __at(0x0F82) __sfr PORTC;
1378 
1379 typedef union
1380   {
1381   struct
1382     {
1383     unsigned RC0                : 1;
1384     unsigned RC1                : 1;
1385     unsigned RC2                : 1;
1386     unsigned RC3                : 1;
1387     unsigned RC4                : 1;
1388     unsigned RC5                : 1;
1389     unsigned RC6                : 1;
1390     unsigned RC7                : 1;
1391     };
1392 
1393   struct
1394     {
1395     unsigned T1OSO              : 1;
1396     unsigned T1OSI              : 1;
1397     unsigned ECCP1              : 1;
1398     unsigned SCK                : 1;
1399     unsigned SDI                : 1;
1400     unsigned SDO                : 1;
1401     unsigned TX                 : 1;
1402     unsigned RX                 : 1;
1403     };
1404 
1405   struct
1406     {
1407     unsigned T13CKI             : 1;
1408     unsigned ECCP2              : 1;
1409     unsigned CCP1               : 1;
1410     unsigned SCL                : 1;
1411     unsigned SDA                : 1;
1412     unsigned SDO1               : 1;
1413     unsigned CK                 : 1;
1414     unsigned DT1                : 1;
1415     };
1416 
1417   struct
1418     {
1419     unsigned                    : 1;
1420     unsigned CCP2               : 1;
1421     unsigned P1A                : 1;
1422     unsigned SCL1               : 1;
1423     unsigned SDA1               : 1;
1424     unsigned                    : 1;
1425     unsigned CK1                : 1;
1426     unsigned RX1                : 1;
1427     };
1428 
1429   struct
1430     {
1431     unsigned                    : 1;
1432     unsigned P2A                : 1;
1433     unsigned                    : 1;
1434     unsigned SCK1               : 1;
1435     unsigned SDI1               : 1;
1436     unsigned                    : 1;
1437     unsigned TX1                : 1;
1438     unsigned                    : 1;
1439     };
1440   } __PORTCbits_t;
1441 
1442 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1443 
1444 #define _PORTC_RC0              0x01
1445 #define _PORTC_T1OSO            0x01
1446 #define _PORTC_T13CKI           0x01
1447 #define _PORTC_RC1              0x02
1448 #define _PORTC_T1OSI            0x02
1449 #define _PORTC_ECCP2            0x02
1450 #define _PORTC_CCP2             0x02
1451 #define _PORTC_P2A              0x02
1452 #define _PORTC_RC2              0x04
1453 #define _PORTC_ECCP1            0x04
1454 #define _PORTC_CCP1             0x04
1455 #define _PORTC_P1A              0x04
1456 #define _PORTC_RC3              0x08
1457 #define _PORTC_SCK              0x08
1458 #define _PORTC_SCL              0x08
1459 #define _PORTC_SCL1             0x08
1460 #define _PORTC_SCK1             0x08
1461 #define _PORTC_RC4              0x10
1462 #define _PORTC_SDI              0x10
1463 #define _PORTC_SDA              0x10
1464 #define _PORTC_SDA1             0x10
1465 #define _PORTC_SDI1             0x10
1466 #define _PORTC_RC5              0x20
1467 #define _PORTC_SDO              0x20
1468 #define _PORTC_SDO1             0x20
1469 #define _PORTC_RC6              0x40
1470 #define _PORTC_TX               0x40
1471 #define _PORTC_CK               0x40
1472 #define _PORTC_CK1              0x40
1473 #define _PORTC_TX1              0x40
1474 #define _PORTC_RC7              0x80
1475 #define _PORTC_RX               0x80
1476 #define _PORTC_DT1              0x80
1477 #define _PORTC_RX1              0x80
1478 
1479 //==============================================================================
1480 
1481 
1482 //==============================================================================
1483 //        PORTD Bits
1484 
1485 extern __at(0x0F83) __sfr PORTD;
1486 
1487 typedef union
1488   {
1489   struct
1490     {
1491     unsigned RD0                : 1;
1492     unsigned RD1                : 1;
1493     unsigned RD2                : 1;
1494     unsigned RD3                : 1;
1495     unsigned RD4                : 1;
1496     unsigned RD5                : 1;
1497     unsigned RD6                : 1;
1498     unsigned RD7                : 1;
1499     };
1500 
1501   struct
1502     {
1503     unsigned PSP0               : 1;
1504     unsigned PSP1               : 1;
1505     unsigned PSP2               : 1;
1506     unsigned PSP3               : 1;
1507     unsigned PSP4               : 1;
1508     unsigned PSP5               : 1;
1509     unsigned PSP6               : 1;
1510     unsigned PSP7               : 1;
1511     };
1512 
1513   struct
1514     {
1515     unsigned                    : 1;
1516     unsigned                    : 1;
1517     unsigned                    : 1;
1518     unsigned                    : 1;
1519     unsigned SDO2               : 1;
1520     unsigned SDA2               : 1;
1521     unsigned SCL2               : 1;
1522     unsigned SS2                : 1;
1523     };
1524 
1525   struct
1526     {
1527     unsigned                    : 1;
1528     unsigned                    : 1;
1529     unsigned                    : 1;
1530     unsigned                    : 1;
1531     unsigned                    : 1;
1532     unsigned SDI2               : 1;
1533     unsigned SCK2               : 1;
1534     unsigned NOT_SS2            : 1;
1535     };
1536   } __PORTDbits_t;
1537 
1538 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1539 
1540 #define _PORTD_RD0              0x01
1541 #define _PORTD_PSP0             0x01
1542 #define _PORTD_RD1              0x02
1543 #define _PORTD_PSP1             0x02
1544 #define _PORTD_RD2              0x04
1545 #define _PORTD_PSP2             0x04
1546 #define _PORTD_RD3              0x08
1547 #define _PORTD_PSP3             0x08
1548 #define _PORTD_RD4              0x10
1549 #define _PORTD_PSP4             0x10
1550 #define _PORTD_SDO2             0x10
1551 #define _PORTD_RD5              0x20
1552 #define _PORTD_PSP5             0x20
1553 #define _PORTD_SDA2             0x20
1554 #define _PORTD_SDI2             0x20
1555 #define _PORTD_RD6              0x40
1556 #define _PORTD_PSP6             0x40
1557 #define _PORTD_SCL2             0x40
1558 #define _PORTD_SCK2             0x40
1559 #define _PORTD_RD7              0x80
1560 #define _PORTD_PSP7             0x80
1561 #define _PORTD_SS2              0x80
1562 #define _PORTD_NOT_SS2          0x80
1563 
1564 //==============================================================================
1565 
1566 
1567 //==============================================================================
1568 //        PORTE Bits
1569 
1570 extern __at(0x0F84) __sfr PORTE;
1571 
1572 typedef union
1573   {
1574   struct
1575     {
1576     unsigned RE0                : 1;
1577     unsigned RE1                : 1;
1578     unsigned RE2                : 1;
1579     unsigned RE3                : 1;
1580     unsigned RE4                : 1;
1581     unsigned RE5                : 1;
1582     unsigned RE6                : 1;
1583     unsigned RE7                : 1;
1584     };
1585 
1586   struct
1587     {
1588     unsigned RD                 : 1;
1589     unsigned WR                 : 1;
1590     unsigned CS                 : 1;
1591     unsigned P3C                : 1;
1592     unsigned P3B                : 1;
1593     unsigned P1C                : 1;
1594     unsigned P1B                : 1;
1595     unsigned ECCP2              : 1;
1596     };
1597 
1598   struct
1599     {
1600     unsigned NOT_RD             : 1;
1601     unsigned NOT_WR             : 1;
1602     unsigned NOT_CS             : 1;
1603     unsigned                    : 1;
1604     unsigned                    : 1;
1605     unsigned                    : 1;
1606     unsigned                    : 1;
1607     unsigned CCP2               : 1;
1608     };
1609 
1610   struct
1611     {
1612     unsigned P2D                : 1;
1613     unsigned P2C                : 1;
1614     unsigned P2B                : 1;
1615     unsigned                    : 1;
1616     unsigned                    : 1;
1617     unsigned                    : 1;
1618     unsigned                    : 1;
1619     unsigned P2A                : 1;
1620     };
1621   } __PORTEbits_t;
1622 
1623 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1624 
1625 #define _PORTE_RE0              0x01
1626 #define _PORTE_RD               0x01
1627 #define _PORTE_NOT_RD           0x01
1628 #define _PORTE_P2D              0x01
1629 #define _PORTE_RE1              0x02
1630 #define _PORTE_WR               0x02
1631 #define _PORTE_NOT_WR           0x02
1632 #define _PORTE_P2C              0x02
1633 #define _PORTE_RE2              0x04
1634 #define _PORTE_CS               0x04
1635 #define _PORTE_NOT_CS           0x04
1636 #define _PORTE_P2B              0x04
1637 #define _PORTE_RE3              0x08
1638 #define _PORTE_P3C              0x08
1639 #define _PORTE_RE4              0x10
1640 #define _PORTE_P3B              0x10
1641 #define _PORTE_RE5              0x20
1642 #define _PORTE_P1C              0x20
1643 #define _PORTE_RE6              0x40
1644 #define _PORTE_P1B              0x40
1645 #define _PORTE_RE7              0x80
1646 #define _PORTE_ECCP2            0x80
1647 #define _PORTE_CCP2             0x80
1648 #define _PORTE_P2A              0x80
1649 
1650 //==============================================================================
1651 
1652 
1653 //==============================================================================
1654 //        PORTF Bits
1655 
1656 extern __at(0x0F85) __sfr PORTF;
1657 
1658 typedef union
1659   {
1660   struct
1661     {
1662     unsigned RF0                : 1;
1663     unsigned RF1                : 1;
1664     unsigned RF2                : 1;
1665     unsigned RF3                : 1;
1666     unsigned RF4                : 1;
1667     unsigned RF5                : 1;
1668     unsigned RF6                : 1;
1669     unsigned RF7                : 1;
1670     };
1671 
1672   struct
1673     {
1674     unsigned AN5                : 1;
1675     unsigned AN6                : 1;
1676     unsigned AN7                : 1;
1677     unsigned AN8                : 1;
1678     unsigned AN9                : 1;
1679     unsigned AN10               : 1;
1680     unsigned AN11               : 1;
1681     unsigned SS1                : 1;
1682     };
1683 
1684   struct
1685     {
1686     unsigned                    : 1;
1687     unsigned C2OUT              : 1;
1688     unsigned C1OUT              : 1;
1689     unsigned                    : 1;
1690     unsigned                    : 1;
1691     unsigned CVREF              : 1;
1692     unsigned                    : 1;
1693     unsigned NOT_SS1            : 1;
1694     };
1695   } __PORTFbits_t;
1696 
1697 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
1698 
1699 #define _PORTF_RF0              0x01
1700 #define _PORTF_AN5              0x01
1701 #define _PORTF_RF1              0x02
1702 #define _PORTF_AN6              0x02
1703 #define _PORTF_C2OUT            0x02
1704 #define _PORTF_RF2              0x04
1705 #define _PORTF_AN7              0x04
1706 #define _PORTF_C1OUT            0x04
1707 #define _PORTF_RF3              0x08
1708 #define _PORTF_AN8              0x08
1709 #define _PORTF_RF4              0x10
1710 #define _PORTF_AN9              0x10
1711 #define _PORTF_RF5              0x20
1712 #define _PORTF_AN10             0x20
1713 #define _PORTF_CVREF            0x20
1714 #define _PORTF_RF6              0x40
1715 #define _PORTF_AN11             0x40
1716 #define _PORTF_RF7              0x80
1717 #define _PORTF_SS1              0x80
1718 #define _PORTF_NOT_SS1          0x80
1719 
1720 //==============================================================================
1721 
1722 
1723 //==============================================================================
1724 //        PORTG Bits
1725 
1726 extern __at(0x0F86) __sfr PORTG;
1727 
1728 typedef union
1729   {
1730   struct
1731     {
1732     unsigned RG0                : 1;
1733     unsigned RG1                : 1;
1734     unsigned RG2                : 1;
1735     unsigned RG3                : 1;
1736     unsigned RG4                : 1;
1737     unsigned RG5                : 1;
1738     unsigned                    : 1;
1739     unsigned                    : 1;
1740     };
1741 
1742   struct
1743     {
1744     unsigned ECCP3              : 1;
1745     unsigned TX2                : 1;
1746     unsigned RX2                : 1;
1747     unsigned CCP4               : 1;
1748     unsigned CCP5               : 1;
1749     unsigned MCLR               : 1;
1750     unsigned                    : 1;
1751     unsigned                    : 1;
1752     };
1753 
1754   struct
1755     {
1756     unsigned P3A                : 1;
1757     unsigned CK2                : 1;
1758     unsigned DT2                : 1;
1759     unsigned P3D                : 1;
1760     unsigned P1D                : 1;
1761     unsigned NOT_MCLR           : 1;
1762     unsigned                    : 1;
1763     unsigned                    : 1;
1764     };
1765 
1766   struct
1767     {
1768     unsigned CCP3               : 1;
1769     unsigned                    : 1;
1770     unsigned                    : 1;
1771     unsigned                    : 1;
1772     unsigned                    : 1;
1773     unsigned                    : 1;
1774     unsigned                    : 1;
1775     unsigned                    : 1;
1776     };
1777 
1778   struct
1779     {
1780     unsigned RG                 : 6;
1781     unsigned                    : 2;
1782     };
1783   } __PORTGbits_t;
1784 
1785 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
1786 
1787 #define _PORTG_RG0              0x01
1788 #define _PORTG_ECCP3            0x01
1789 #define _PORTG_P3A              0x01
1790 #define _PORTG_CCP3             0x01
1791 #define _PORTG_RG1              0x02
1792 #define _PORTG_TX2              0x02
1793 #define _PORTG_CK2              0x02
1794 #define _PORTG_RG2              0x04
1795 #define _PORTG_RX2              0x04
1796 #define _PORTG_DT2              0x04
1797 #define _PORTG_RG3              0x08
1798 #define _PORTG_CCP4             0x08
1799 #define _PORTG_P3D              0x08
1800 #define _PORTG_RG4              0x10
1801 #define _PORTG_CCP5             0x10
1802 #define _PORTG_P1D              0x10
1803 #define _PORTG_RG5              0x20
1804 #define _PORTG_MCLR             0x20
1805 #define _PORTG_NOT_MCLR         0x20
1806 
1807 //==============================================================================
1808 
1809 
1810 //==============================================================================
1811 //        LATA Bits
1812 
1813 extern __at(0x0F89) __sfr LATA;
1814 
1815 typedef struct
1816   {
1817   unsigned LATA0                : 1;
1818   unsigned LATA1                : 1;
1819   unsigned LATA2                : 1;
1820   unsigned LATA3                : 1;
1821   unsigned LATA4                : 1;
1822   unsigned LATA5                : 1;
1823   unsigned LATA6                : 1;
1824   unsigned LATA7                : 1;
1825   } __LATAbits_t;
1826 
1827 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1828 
1829 #define _LATA0                  0x01
1830 #define _LATA1                  0x02
1831 #define _LATA2                  0x04
1832 #define _LATA3                  0x08
1833 #define _LATA4                  0x10
1834 #define _LATA5                  0x20
1835 #define _LATA6                  0x40
1836 #define _LATA7                  0x80
1837 
1838 //==============================================================================
1839 
1840 
1841 //==============================================================================
1842 //        LATB Bits
1843 
1844 extern __at(0x0F8A) __sfr LATB;
1845 
1846 typedef struct
1847   {
1848   unsigned LATB0                : 1;
1849   unsigned LATB1                : 1;
1850   unsigned LATB2                : 1;
1851   unsigned LATB3                : 1;
1852   unsigned LATB4                : 1;
1853   unsigned LATB5                : 1;
1854   unsigned LATB6                : 1;
1855   unsigned LATB7                : 1;
1856   } __LATBbits_t;
1857 
1858 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1859 
1860 #define _LATB0                  0x01
1861 #define _LATB1                  0x02
1862 #define _LATB2                  0x04
1863 #define _LATB3                  0x08
1864 #define _LATB4                  0x10
1865 #define _LATB5                  0x20
1866 #define _LATB6                  0x40
1867 #define _LATB7                  0x80
1868 
1869 //==============================================================================
1870 
1871 
1872 //==============================================================================
1873 //        LATC Bits
1874 
1875 extern __at(0x0F8B) __sfr LATC;
1876 
1877 typedef struct
1878   {
1879   unsigned LATC0                : 1;
1880   unsigned LATC1                : 1;
1881   unsigned LATC2                : 1;
1882   unsigned LATC3                : 1;
1883   unsigned LATC4                : 1;
1884   unsigned LATC5                : 1;
1885   unsigned LATC6                : 1;
1886   unsigned LATC7                : 1;
1887   } __LATCbits_t;
1888 
1889 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1890 
1891 #define _LATC0                  0x01
1892 #define _LATC1                  0x02
1893 #define _LATC2                  0x04
1894 #define _LATC3                  0x08
1895 #define _LATC4                  0x10
1896 #define _LATC5                  0x20
1897 #define _LATC6                  0x40
1898 #define _LATC7                  0x80
1899 
1900 //==============================================================================
1901 
1902 
1903 //==============================================================================
1904 //        LATD Bits
1905 
1906 extern __at(0x0F8C) __sfr LATD;
1907 
1908 typedef struct
1909   {
1910   unsigned LATD0                : 1;
1911   unsigned LATD1                : 1;
1912   unsigned LATD2                : 1;
1913   unsigned LATD3                : 1;
1914   unsigned LATD4                : 1;
1915   unsigned LATD5                : 1;
1916   unsigned LATD6                : 1;
1917   unsigned LATD7                : 1;
1918   } __LATDbits_t;
1919 
1920 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1921 
1922 #define _LATD0                  0x01
1923 #define _LATD1                  0x02
1924 #define _LATD2                  0x04
1925 #define _LATD3                  0x08
1926 #define _LATD4                  0x10
1927 #define _LATD5                  0x20
1928 #define _LATD6                  0x40
1929 #define _LATD7                  0x80
1930 
1931 //==============================================================================
1932 
1933 
1934 //==============================================================================
1935 //        LATE Bits
1936 
1937 extern __at(0x0F8D) __sfr LATE;
1938 
1939 typedef struct
1940   {
1941   unsigned LATE0                : 1;
1942   unsigned LATE1                : 1;
1943   unsigned LATE2                : 1;
1944   unsigned LATE3                : 1;
1945   unsigned LATE4                : 1;
1946   unsigned LATE5                : 1;
1947   unsigned LATE6                : 1;
1948   unsigned LATE7                : 1;
1949   } __LATEbits_t;
1950 
1951 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1952 
1953 #define _LATE0                  0x01
1954 #define _LATE1                  0x02
1955 #define _LATE2                  0x04
1956 #define _LATE3                  0x08
1957 #define _LATE4                  0x10
1958 #define _LATE5                  0x20
1959 #define _LATE6                  0x40
1960 #define _LATE7                  0x80
1961 
1962 //==============================================================================
1963 
1964 
1965 //==============================================================================
1966 //        LATF Bits
1967 
1968 extern __at(0x0F8E) __sfr LATF;
1969 
1970 typedef struct
1971   {
1972   unsigned LATF0                : 1;
1973   unsigned LATF1                : 1;
1974   unsigned LATF2                : 1;
1975   unsigned LATF3                : 1;
1976   unsigned LATF4                : 1;
1977   unsigned LATF5                : 1;
1978   unsigned LATF6                : 1;
1979   unsigned LATF7                : 1;
1980   } __LATFbits_t;
1981 
1982 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
1983 
1984 #define _LATF0                  0x01
1985 #define _LATF1                  0x02
1986 #define _LATF2                  0x04
1987 #define _LATF3                  0x08
1988 #define _LATF4                  0x10
1989 #define _LATF5                  0x20
1990 #define _LATF6                  0x40
1991 #define _LATF7                  0x80
1992 
1993 //==============================================================================
1994 
1995 
1996 //==============================================================================
1997 //        LATG Bits
1998 
1999 extern __at(0x0F8F) __sfr LATG;
2000 
2001 typedef union
2002   {
2003   struct
2004     {
2005     unsigned LATG0              : 1;
2006     unsigned LATG1              : 1;
2007     unsigned LATG2              : 1;
2008     unsigned LATG3              : 1;
2009     unsigned LATG4              : 1;
2010     unsigned LATG5              : 1;
2011     unsigned                    : 1;
2012     unsigned                    : 1;
2013     };
2014 
2015   struct
2016     {
2017     unsigned LATG               : 6;
2018     unsigned                    : 2;
2019     };
2020   } __LATGbits_t;
2021 
2022 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2023 
2024 #define _LATG0                  0x01
2025 #define _LATG1                  0x02
2026 #define _LATG2                  0x04
2027 #define _LATG3                  0x08
2028 #define _LATG4                  0x10
2029 #define _LATG5                  0x20
2030 
2031 //==============================================================================
2032 
2033 
2034 //==============================================================================
2035 //        DDRA Bits
2036 
2037 extern __at(0x0F92) __sfr DDRA;
2038 
2039 typedef union
2040   {
2041   struct
2042     {
2043     unsigned TRISA0             : 1;
2044     unsigned TRISA1             : 1;
2045     unsigned TRISA2             : 1;
2046     unsigned TRISA3             : 1;
2047     unsigned TRISA4             : 1;
2048     unsigned TRISA5             : 1;
2049     unsigned TRISA6             : 1;
2050     unsigned TRISA7             : 1;
2051     };
2052 
2053   struct
2054     {
2055     unsigned RA0                : 1;
2056     unsigned RA1                : 1;
2057     unsigned RA2                : 1;
2058     unsigned RA3                : 1;
2059     unsigned RA4                : 1;
2060     unsigned RA5                : 1;
2061     unsigned RA6                : 1;
2062     unsigned RA7                : 1;
2063     };
2064   } __DDRAbits_t;
2065 
2066 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2067 
2068 #define _TRISA0                 0x01
2069 #define _RA0                    0x01
2070 #define _TRISA1                 0x02
2071 #define _RA1                    0x02
2072 #define _TRISA2                 0x04
2073 #define _RA2                    0x04
2074 #define _TRISA3                 0x08
2075 #define _RA3                    0x08
2076 #define _TRISA4                 0x10
2077 #define _RA4                    0x10
2078 #define _TRISA5                 0x20
2079 #define _RA5                    0x20
2080 #define _TRISA6                 0x40
2081 #define _RA6                    0x40
2082 #define _TRISA7                 0x80
2083 #define _RA7                    0x80
2084 
2085 //==============================================================================
2086 
2087 
2088 //==============================================================================
2089 //        TRISA Bits
2090 
2091 extern __at(0x0F92) __sfr TRISA;
2092 
2093 typedef union
2094   {
2095   struct
2096     {
2097     unsigned TRISA0             : 1;
2098     unsigned TRISA1             : 1;
2099     unsigned TRISA2             : 1;
2100     unsigned TRISA3             : 1;
2101     unsigned TRISA4             : 1;
2102     unsigned TRISA5             : 1;
2103     unsigned TRISA6             : 1;
2104     unsigned TRISA7             : 1;
2105     };
2106 
2107   struct
2108     {
2109     unsigned RA0                : 1;
2110     unsigned RA1                : 1;
2111     unsigned RA2                : 1;
2112     unsigned RA3                : 1;
2113     unsigned RA4                : 1;
2114     unsigned RA5                : 1;
2115     unsigned RA6                : 1;
2116     unsigned RA7                : 1;
2117     };
2118   } __TRISAbits_t;
2119 
2120 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2121 
2122 #define _TRISA_TRISA0           0x01
2123 #define _TRISA_RA0              0x01
2124 #define _TRISA_TRISA1           0x02
2125 #define _TRISA_RA1              0x02
2126 #define _TRISA_TRISA2           0x04
2127 #define _TRISA_RA2              0x04
2128 #define _TRISA_TRISA3           0x08
2129 #define _TRISA_RA3              0x08
2130 #define _TRISA_TRISA4           0x10
2131 #define _TRISA_RA4              0x10
2132 #define _TRISA_TRISA5           0x20
2133 #define _TRISA_RA5              0x20
2134 #define _TRISA_TRISA6           0x40
2135 #define _TRISA_RA6              0x40
2136 #define _TRISA_TRISA7           0x80
2137 #define _TRISA_RA7              0x80
2138 
2139 //==============================================================================
2140 
2141 
2142 //==============================================================================
2143 //        DDRB Bits
2144 
2145 extern __at(0x0F93) __sfr DDRB;
2146 
2147 typedef union
2148   {
2149   struct
2150     {
2151     unsigned TRISB0             : 1;
2152     unsigned TRISB1             : 1;
2153     unsigned TRISB2             : 1;
2154     unsigned TRISB3             : 1;
2155     unsigned TRISB4             : 1;
2156     unsigned TRISB5             : 1;
2157     unsigned TRISB6             : 1;
2158     unsigned TRISB7             : 1;
2159     };
2160 
2161   struct
2162     {
2163     unsigned RB0                : 1;
2164     unsigned RB1                : 1;
2165     unsigned RB2                : 1;
2166     unsigned RB3                : 1;
2167     unsigned RB4                : 1;
2168     unsigned RB5                : 1;
2169     unsigned RB6                : 1;
2170     unsigned RB7                : 1;
2171     };
2172   } __DDRBbits_t;
2173 
2174 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2175 
2176 #define _TRISB0                 0x01
2177 #define _RB0                    0x01
2178 #define _TRISB1                 0x02
2179 #define _RB1                    0x02
2180 #define _TRISB2                 0x04
2181 #define _RB2                    0x04
2182 #define _TRISB3                 0x08
2183 #define _RB3                    0x08
2184 #define _TRISB4                 0x10
2185 #define _RB4                    0x10
2186 #define _TRISB5                 0x20
2187 #define _RB5                    0x20
2188 #define _TRISB6                 0x40
2189 #define _RB6                    0x40
2190 #define _TRISB7                 0x80
2191 #define _RB7                    0x80
2192 
2193 //==============================================================================
2194 
2195 
2196 //==============================================================================
2197 //        TRISB Bits
2198 
2199 extern __at(0x0F93) __sfr TRISB;
2200 
2201 typedef union
2202   {
2203   struct
2204     {
2205     unsigned TRISB0             : 1;
2206     unsigned TRISB1             : 1;
2207     unsigned TRISB2             : 1;
2208     unsigned TRISB3             : 1;
2209     unsigned TRISB4             : 1;
2210     unsigned TRISB5             : 1;
2211     unsigned TRISB6             : 1;
2212     unsigned TRISB7             : 1;
2213     };
2214 
2215   struct
2216     {
2217     unsigned RB0                : 1;
2218     unsigned RB1                : 1;
2219     unsigned RB2                : 1;
2220     unsigned RB3                : 1;
2221     unsigned RB4                : 1;
2222     unsigned RB5                : 1;
2223     unsigned RB6                : 1;
2224     unsigned RB7                : 1;
2225     };
2226   } __TRISBbits_t;
2227 
2228 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2229 
2230 #define _TRISB_TRISB0           0x01
2231 #define _TRISB_RB0              0x01
2232 #define _TRISB_TRISB1           0x02
2233 #define _TRISB_RB1              0x02
2234 #define _TRISB_TRISB2           0x04
2235 #define _TRISB_RB2              0x04
2236 #define _TRISB_TRISB3           0x08
2237 #define _TRISB_RB3              0x08
2238 #define _TRISB_TRISB4           0x10
2239 #define _TRISB_RB4              0x10
2240 #define _TRISB_TRISB5           0x20
2241 #define _TRISB_RB5              0x20
2242 #define _TRISB_TRISB6           0x40
2243 #define _TRISB_RB6              0x40
2244 #define _TRISB_TRISB7           0x80
2245 #define _TRISB_RB7              0x80
2246 
2247 //==============================================================================
2248 
2249 
2250 //==============================================================================
2251 //        DDRC Bits
2252 
2253 extern __at(0x0F94) __sfr DDRC;
2254 
2255 typedef union
2256   {
2257   struct
2258     {
2259     unsigned TRISC0             : 1;
2260     unsigned TRISC1             : 1;
2261     unsigned TRISC2             : 1;
2262     unsigned TRISC3             : 1;
2263     unsigned TRISC4             : 1;
2264     unsigned TRISC5             : 1;
2265     unsigned TRISC6             : 1;
2266     unsigned TRISC7             : 1;
2267     };
2268 
2269   struct
2270     {
2271     unsigned RC0                : 1;
2272     unsigned RC1                : 1;
2273     unsigned RC2                : 1;
2274     unsigned RC3                : 1;
2275     unsigned RC4                : 1;
2276     unsigned RC5                : 1;
2277     unsigned RC6                : 1;
2278     unsigned RC7                : 1;
2279     };
2280   } __DDRCbits_t;
2281 
2282 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2283 
2284 #define _TRISC0                 0x01
2285 #define _RC0                    0x01
2286 #define _TRISC1                 0x02
2287 #define _RC1                    0x02
2288 #define _TRISC2                 0x04
2289 #define _RC2                    0x04
2290 #define _TRISC3                 0x08
2291 #define _RC3                    0x08
2292 #define _TRISC4                 0x10
2293 #define _RC4                    0x10
2294 #define _TRISC5                 0x20
2295 #define _RC5                    0x20
2296 #define _TRISC6                 0x40
2297 #define _RC6                    0x40
2298 #define _TRISC7                 0x80
2299 #define _RC7                    0x80
2300 
2301 //==============================================================================
2302 
2303 
2304 //==============================================================================
2305 //        TRISC Bits
2306 
2307 extern __at(0x0F94) __sfr TRISC;
2308 
2309 typedef union
2310   {
2311   struct
2312     {
2313     unsigned TRISC0             : 1;
2314     unsigned TRISC1             : 1;
2315     unsigned TRISC2             : 1;
2316     unsigned TRISC3             : 1;
2317     unsigned TRISC4             : 1;
2318     unsigned TRISC5             : 1;
2319     unsigned TRISC6             : 1;
2320     unsigned TRISC7             : 1;
2321     };
2322 
2323   struct
2324     {
2325     unsigned RC0                : 1;
2326     unsigned RC1                : 1;
2327     unsigned RC2                : 1;
2328     unsigned RC3                : 1;
2329     unsigned RC4                : 1;
2330     unsigned RC5                : 1;
2331     unsigned RC6                : 1;
2332     unsigned RC7                : 1;
2333     };
2334   } __TRISCbits_t;
2335 
2336 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2337 
2338 #define _TRISC_TRISC0           0x01
2339 #define _TRISC_RC0              0x01
2340 #define _TRISC_TRISC1           0x02
2341 #define _TRISC_RC1              0x02
2342 #define _TRISC_TRISC2           0x04
2343 #define _TRISC_RC2              0x04
2344 #define _TRISC_TRISC3           0x08
2345 #define _TRISC_RC3              0x08
2346 #define _TRISC_TRISC4           0x10
2347 #define _TRISC_RC4              0x10
2348 #define _TRISC_TRISC5           0x20
2349 #define _TRISC_RC5              0x20
2350 #define _TRISC_TRISC6           0x40
2351 #define _TRISC_RC6              0x40
2352 #define _TRISC_TRISC7           0x80
2353 #define _TRISC_RC7              0x80
2354 
2355 //==============================================================================
2356 
2357 
2358 //==============================================================================
2359 //        DDRD Bits
2360 
2361 extern __at(0x0F95) __sfr DDRD;
2362 
2363 typedef union
2364   {
2365   struct
2366     {
2367     unsigned TRISD0             : 1;
2368     unsigned TRISD1             : 1;
2369     unsigned TRISD2             : 1;
2370     unsigned TRISD3             : 1;
2371     unsigned TRISD4             : 1;
2372     unsigned TRISD5             : 1;
2373     unsigned TRISD6             : 1;
2374     unsigned TRISD7             : 1;
2375     };
2376 
2377   struct
2378     {
2379     unsigned RD0                : 1;
2380     unsigned RD1                : 1;
2381     unsigned RD2                : 1;
2382     unsigned RD3                : 1;
2383     unsigned RD4                : 1;
2384     unsigned RD5                : 1;
2385     unsigned RD6                : 1;
2386     unsigned RD7                : 1;
2387     };
2388   } __DDRDbits_t;
2389 
2390 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2391 
2392 #define _TRISD0                 0x01
2393 #define _RD0                    0x01
2394 #define _TRISD1                 0x02
2395 #define _RD1                    0x02
2396 #define _TRISD2                 0x04
2397 #define _RD2                    0x04
2398 #define _TRISD3                 0x08
2399 #define _RD3                    0x08
2400 #define _TRISD4                 0x10
2401 #define _RD4                    0x10
2402 #define _TRISD5                 0x20
2403 #define _RD5                    0x20
2404 #define _TRISD6                 0x40
2405 #define _RD6                    0x40
2406 #define _TRISD7                 0x80
2407 #define _RD7                    0x80
2408 
2409 //==============================================================================
2410 
2411 
2412 //==============================================================================
2413 //        TRISD Bits
2414 
2415 extern __at(0x0F95) __sfr TRISD;
2416 
2417 typedef union
2418   {
2419   struct
2420     {
2421     unsigned TRISD0             : 1;
2422     unsigned TRISD1             : 1;
2423     unsigned TRISD2             : 1;
2424     unsigned TRISD3             : 1;
2425     unsigned TRISD4             : 1;
2426     unsigned TRISD5             : 1;
2427     unsigned TRISD6             : 1;
2428     unsigned TRISD7             : 1;
2429     };
2430 
2431   struct
2432     {
2433     unsigned RD0                : 1;
2434     unsigned RD1                : 1;
2435     unsigned RD2                : 1;
2436     unsigned RD3                : 1;
2437     unsigned RD4                : 1;
2438     unsigned RD5                : 1;
2439     unsigned RD6                : 1;
2440     unsigned RD7                : 1;
2441     };
2442   } __TRISDbits_t;
2443 
2444 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2445 
2446 #define _TRISD_TRISD0           0x01
2447 #define _TRISD_RD0              0x01
2448 #define _TRISD_TRISD1           0x02
2449 #define _TRISD_RD1              0x02
2450 #define _TRISD_TRISD2           0x04
2451 #define _TRISD_RD2              0x04
2452 #define _TRISD_TRISD3           0x08
2453 #define _TRISD_RD3              0x08
2454 #define _TRISD_TRISD4           0x10
2455 #define _TRISD_RD4              0x10
2456 #define _TRISD_TRISD5           0x20
2457 #define _TRISD_RD5              0x20
2458 #define _TRISD_TRISD6           0x40
2459 #define _TRISD_RD6              0x40
2460 #define _TRISD_TRISD7           0x80
2461 #define _TRISD_RD7              0x80
2462 
2463 //==============================================================================
2464 
2465 
2466 //==============================================================================
2467 //        DDRE Bits
2468 
2469 extern __at(0x0F96) __sfr DDRE;
2470 
2471 typedef union
2472   {
2473   struct
2474     {
2475     unsigned TRISE0             : 1;
2476     unsigned TRISE1             : 1;
2477     unsigned TRISE2             : 1;
2478     unsigned TRISE3             : 1;
2479     unsigned TRISE4             : 1;
2480     unsigned TRISE5             : 1;
2481     unsigned TRISE6             : 1;
2482     unsigned TRISE7             : 1;
2483     };
2484 
2485   struct
2486     {
2487     unsigned RE0                : 1;
2488     unsigned RE1                : 1;
2489     unsigned RE2                : 1;
2490     unsigned RE3                : 1;
2491     unsigned RE4                : 1;
2492     unsigned RE5                : 1;
2493     unsigned RE6                : 1;
2494     unsigned RE7                : 1;
2495     };
2496   } __DDREbits_t;
2497 
2498 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2499 
2500 #define _TRISE0                 0x01
2501 #define _RE0                    0x01
2502 #define _TRISE1                 0x02
2503 #define _RE1                    0x02
2504 #define _TRISE2                 0x04
2505 #define _RE2                    0x04
2506 #define _TRISE3                 0x08
2507 #define _RE3                    0x08
2508 #define _TRISE4                 0x10
2509 #define _RE4                    0x10
2510 #define _TRISE5                 0x20
2511 #define _RE5                    0x20
2512 #define _TRISE6                 0x40
2513 #define _RE6                    0x40
2514 #define _TRISE7                 0x80
2515 #define _RE7                    0x80
2516 
2517 //==============================================================================
2518 
2519 
2520 //==============================================================================
2521 //        TRISE Bits
2522 
2523 extern __at(0x0F96) __sfr TRISE;
2524 
2525 typedef union
2526   {
2527   struct
2528     {
2529     unsigned TRISE0             : 1;
2530     unsigned TRISE1             : 1;
2531     unsigned TRISE2             : 1;
2532     unsigned TRISE3             : 1;
2533     unsigned TRISE4             : 1;
2534     unsigned TRISE5             : 1;
2535     unsigned TRISE6             : 1;
2536     unsigned TRISE7             : 1;
2537     };
2538 
2539   struct
2540     {
2541     unsigned RE0                : 1;
2542     unsigned RE1                : 1;
2543     unsigned RE2                : 1;
2544     unsigned RE3                : 1;
2545     unsigned RE4                : 1;
2546     unsigned RE5                : 1;
2547     unsigned RE6                : 1;
2548     unsigned RE7                : 1;
2549     };
2550   } __TRISEbits_t;
2551 
2552 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2553 
2554 #define _TRISE_TRISE0           0x01
2555 #define _TRISE_RE0              0x01
2556 #define _TRISE_TRISE1           0x02
2557 #define _TRISE_RE1              0x02
2558 #define _TRISE_TRISE2           0x04
2559 #define _TRISE_RE2              0x04
2560 #define _TRISE_TRISE3           0x08
2561 #define _TRISE_RE3              0x08
2562 #define _TRISE_TRISE4           0x10
2563 #define _TRISE_RE4              0x10
2564 #define _TRISE_TRISE5           0x20
2565 #define _TRISE_RE5              0x20
2566 #define _TRISE_TRISE6           0x40
2567 #define _TRISE_RE6              0x40
2568 #define _TRISE_TRISE7           0x80
2569 #define _TRISE_RE7              0x80
2570 
2571 //==============================================================================
2572 
2573 
2574 //==============================================================================
2575 //        DDRF Bits
2576 
2577 extern __at(0x0F97) __sfr DDRF;
2578 
2579 typedef union
2580   {
2581   struct
2582     {
2583     unsigned TRISF0             : 1;
2584     unsigned TRISF1             : 1;
2585     unsigned TRISF2             : 1;
2586     unsigned TRISF3             : 1;
2587     unsigned TRISF4             : 1;
2588     unsigned TRISF5             : 1;
2589     unsigned TRISF6             : 1;
2590     unsigned TRISF7             : 1;
2591     };
2592 
2593   struct
2594     {
2595     unsigned RF0                : 1;
2596     unsigned RF1                : 1;
2597     unsigned RF2                : 1;
2598     unsigned RF3                : 1;
2599     unsigned RF4                : 1;
2600     unsigned RF5                : 1;
2601     unsigned RF6                : 1;
2602     unsigned RF7                : 1;
2603     };
2604   } __DDRFbits_t;
2605 
2606 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
2607 
2608 #define _TRISF0                 0x01
2609 #define _RF0                    0x01
2610 #define _TRISF1                 0x02
2611 #define _RF1                    0x02
2612 #define _TRISF2                 0x04
2613 #define _RF2                    0x04
2614 #define _TRISF3                 0x08
2615 #define _RF3                    0x08
2616 #define _TRISF4                 0x10
2617 #define _RF4                    0x10
2618 #define _TRISF5                 0x20
2619 #define _RF5                    0x20
2620 #define _TRISF6                 0x40
2621 #define _RF6                    0x40
2622 #define _TRISF7                 0x80
2623 #define _RF7                    0x80
2624 
2625 //==============================================================================
2626 
2627 
2628 //==============================================================================
2629 //        TRISF Bits
2630 
2631 extern __at(0x0F97) __sfr TRISF;
2632 
2633 typedef union
2634   {
2635   struct
2636     {
2637     unsigned TRISF0             : 1;
2638     unsigned TRISF1             : 1;
2639     unsigned TRISF2             : 1;
2640     unsigned TRISF3             : 1;
2641     unsigned TRISF4             : 1;
2642     unsigned TRISF5             : 1;
2643     unsigned TRISF6             : 1;
2644     unsigned TRISF7             : 1;
2645     };
2646 
2647   struct
2648     {
2649     unsigned RF0                : 1;
2650     unsigned RF1                : 1;
2651     unsigned RF2                : 1;
2652     unsigned RF3                : 1;
2653     unsigned RF4                : 1;
2654     unsigned RF5                : 1;
2655     unsigned RF6                : 1;
2656     unsigned RF7                : 1;
2657     };
2658   } __TRISFbits_t;
2659 
2660 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
2661 
2662 #define _TRISF_TRISF0           0x01
2663 #define _TRISF_RF0              0x01
2664 #define _TRISF_TRISF1           0x02
2665 #define _TRISF_RF1              0x02
2666 #define _TRISF_TRISF2           0x04
2667 #define _TRISF_RF2              0x04
2668 #define _TRISF_TRISF3           0x08
2669 #define _TRISF_RF3              0x08
2670 #define _TRISF_TRISF4           0x10
2671 #define _TRISF_RF4              0x10
2672 #define _TRISF_TRISF5           0x20
2673 #define _TRISF_RF5              0x20
2674 #define _TRISF_TRISF6           0x40
2675 #define _TRISF_RF6              0x40
2676 #define _TRISF_TRISF7           0x80
2677 #define _TRISF_RF7              0x80
2678 
2679 //==============================================================================
2680 
2681 
2682 //==============================================================================
2683 //        DDRG Bits
2684 
2685 extern __at(0x0F98) __sfr DDRG;
2686 
2687 typedef union
2688   {
2689   struct
2690     {
2691     unsigned TRISG0             : 1;
2692     unsigned TRISG1             : 1;
2693     unsigned TRISG2             : 1;
2694     unsigned TRISG3             : 1;
2695     unsigned TRISG4             : 1;
2696     unsigned                    : 1;
2697     unsigned                    : 1;
2698     unsigned                    : 1;
2699     };
2700 
2701   struct
2702     {
2703     unsigned RG0                : 1;
2704     unsigned RG1                : 1;
2705     unsigned RG2                : 1;
2706     unsigned RG3                : 1;
2707     unsigned RG4                : 1;
2708     unsigned                    : 1;
2709     unsigned                    : 1;
2710     unsigned                    : 1;
2711     };
2712 
2713   struct
2714     {
2715     unsigned RG                 : 5;
2716     unsigned                    : 3;
2717     };
2718 
2719   struct
2720     {
2721     unsigned TRISG              : 5;
2722     unsigned                    : 3;
2723     };
2724   } __DDRGbits_t;
2725 
2726 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
2727 
2728 #define _TRISG0                 0x01
2729 #define _RG0                    0x01
2730 #define _TRISG1                 0x02
2731 #define _RG1                    0x02
2732 #define _TRISG2                 0x04
2733 #define _RG2                    0x04
2734 #define _TRISG3                 0x08
2735 #define _RG3                    0x08
2736 #define _TRISG4                 0x10
2737 #define _RG4                    0x10
2738 
2739 //==============================================================================
2740 
2741 
2742 //==============================================================================
2743 //        TRISG Bits
2744 
2745 extern __at(0x0F98) __sfr TRISG;
2746 
2747 typedef union
2748   {
2749   struct
2750     {
2751     unsigned TRISG0             : 1;
2752     unsigned TRISG1             : 1;
2753     unsigned TRISG2             : 1;
2754     unsigned TRISG3             : 1;
2755     unsigned TRISG4             : 1;
2756     unsigned                    : 1;
2757     unsigned                    : 1;
2758     unsigned                    : 1;
2759     };
2760 
2761   struct
2762     {
2763     unsigned RG0                : 1;
2764     unsigned RG1                : 1;
2765     unsigned RG2                : 1;
2766     unsigned RG3                : 1;
2767     unsigned RG4                : 1;
2768     unsigned                    : 1;
2769     unsigned                    : 1;
2770     unsigned                    : 1;
2771     };
2772 
2773   struct
2774     {
2775     unsigned TRISG              : 5;
2776     unsigned                    : 3;
2777     };
2778 
2779   struct
2780     {
2781     unsigned RG                 : 5;
2782     unsigned                    : 3;
2783     };
2784   } __TRISGbits_t;
2785 
2786 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
2787 
2788 #define _TRISG_TRISG0           0x01
2789 #define _TRISG_RG0              0x01
2790 #define _TRISG_TRISG1           0x02
2791 #define _TRISG_RG1              0x02
2792 #define _TRISG_TRISG2           0x04
2793 #define _TRISG_RG2              0x04
2794 #define _TRISG_TRISG3           0x08
2795 #define _TRISG_RG3              0x08
2796 #define _TRISG_TRISG4           0x10
2797 #define _TRISG_RG4              0x10
2798 
2799 //==============================================================================
2800 
2801 
2802 //==============================================================================
2803 //        OSCTUNE Bits
2804 
2805 extern __at(0x0F9B) __sfr OSCTUNE;
2806 
2807 typedef union
2808   {
2809   struct
2810     {
2811     unsigned TUN0               : 1;
2812     unsigned TUN1               : 1;
2813     unsigned TUN2               : 1;
2814     unsigned TUN3               : 1;
2815     unsigned TUN4               : 1;
2816     unsigned                    : 1;
2817     unsigned PLLEN              : 1;
2818     unsigned INTSRC             : 1;
2819     };
2820 
2821   struct
2822     {
2823     unsigned TUN                : 5;
2824     unsigned                    : 3;
2825     };
2826   } __OSCTUNEbits_t;
2827 
2828 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2829 
2830 #define _TUN0                   0x01
2831 #define _TUN1                   0x02
2832 #define _TUN2                   0x04
2833 #define _TUN3                   0x08
2834 #define _TUN4                   0x10
2835 #define _PLLEN                  0x40
2836 #define _INTSRC                 0x80
2837 
2838 //==============================================================================
2839 
2840 
2841 //==============================================================================
2842 //        PIE1 Bits
2843 
2844 extern __at(0x0F9D) __sfr PIE1;
2845 
2846 typedef union
2847   {
2848   struct
2849     {
2850     unsigned TMR1IE             : 1;
2851     unsigned TMR2IE             : 1;
2852     unsigned CCP1IE             : 1;
2853     unsigned SSP1IE             : 1;
2854     unsigned TX1IE              : 1;
2855     unsigned RC1IE              : 1;
2856     unsigned ADIE               : 1;
2857     unsigned PSPIE              : 1;
2858     };
2859 
2860   struct
2861     {
2862     unsigned                    : 1;
2863     unsigned                    : 1;
2864     unsigned                    : 1;
2865     unsigned SSPIE              : 1;
2866     unsigned TXIE               : 1;
2867     unsigned RCIE               : 1;
2868     unsigned                    : 1;
2869     unsigned                    : 1;
2870     };
2871   } __PIE1bits_t;
2872 
2873 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
2874 
2875 #define _TMR1IE                 0x01
2876 #define _TMR2IE                 0x02
2877 #define _CCP1IE                 0x04
2878 #define _SSP1IE                 0x08
2879 #define _SSPIE                  0x08
2880 #define _TX1IE                  0x10
2881 #define _TXIE                   0x10
2882 #define _RC1IE                  0x20
2883 #define _RCIE                   0x20
2884 #define _ADIE                   0x40
2885 #define _PSPIE                  0x80
2886 
2887 //==============================================================================
2888 
2889 
2890 //==============================================================================
2891 //        PIR1 Bits
2892 
2893 extern __at(0x0F9E) __sfr PIR1;
2894 
2895 typedef union
2896   {
2897   struct
2898     {
2899     unsigned TMR1IF             : 1;
2900     unsigned TMR2IF             : 1;
2901     unsigned CCP1IF             : 1;
2902     unsigned SSP1IF             : 1;
2903     unsigned TX1IF              : 1;
2904     unsigned RC1IF              : 1;
2905     unsigned ADIF               : 1;
2906     unsigned PSPIF              : 1;
2907     };
2908 
2909   struct
2910     {
2911     unsigned                    : 1;
2912     unsigned                    : 1;
2913     unsigned                    : 1;
2914     unsigned SSPIF              : 1;
2915     unsigned TXIF               : 1;
2916     unsigned RCIF               : 1;
2917     unsigned                    : 1;
2918     unsigned                    : 1;
2919     };
2920   } __PIR1bits_t;
2921 
2922 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2923 
2924 #define _TMR1IF                 0x01
2925 #define _TMR2IF                 0x02
2926 #define _CCP1IF                 0x04
2927 #define _SSP1IF                 0x08
2928 #define _SSPIF                  0x08
2929 #define _TX1IF                  0x10
2930 #define _TXIF                   0x10
2931 #define _RC1IF                  0x20
2932 #define _RCIF                   0x20
2933 #define _ADIF                   0x40
2934 #define _PSPIF                  0x80
2935 
2936 //==============================================================================
2937 
2938 
2939 //==============================================================================
2940 //        IPR1 Bits
2941 
2942 extern __at(0x0F9F) __sfr IPR1;
2943 
2944 typedef union
2945   {
2946   struct
2947     {
2948     unsigned TMR1IP             : 1;
2949     unsigned TMR2IP             : 1;
2950     unsigned CCP1IP             : 1;
2951     unsigned SSP1IP             : 1;
2952     unsigned TX1IP              : 1;
2953     unsigned RC1IP              : 1;
2954     unsigned ADIP               : 1;
2955     unsigned PSPIP              : 1;
2956     };
2957 
2958   struct
2959     {
2960     unsigned                    : 1;
2961     unsigned                    : 1;
2962     unsigned                    : 1;
2963     unsigned SSPIP              : 1;
2964     unsigned TXIP               : 1;
2965     unsigned RCIP               : 1;
2966     unsigned                    : 1;
2967     unsigned                    : 1;
2968     };
2969   } __IPR1bits_t;
2970 
2971 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2972 
2973 #define _TMR1IP                 0x01
2974 #define _TMR2IP                 0x02
2975 #define _CCP1IP                 0x04
2976 #define _SSP1IP                 0x08
2977 #define _SSPIP                  0x08
2978 #define _TX1IP                  0x10
2979 #define _TXIP                   0x10
2980 #define _RC1IP                  0x20
2981 #define _RCIP                   0x20
2982 #define _ADIP                   0x40
2983 #define _PSPIP                  0x80
2984 
2985 //==============================================================================
2986 
2987 
2988 //==============================================================================
2989 //        PIE2 Bits
2990 
2991 extern __at(0x0FA0) __sfr PIE2;
2992 
2993 typedef union
2994   {
2995   struct
2996     {
2997     unsigned CCP2IE             : 1;
2998     unsigned TMR3IE             : 1;
2999     unsigned HLVDIE             : 1;
3000     unsigned BCL1IE             : 1;
3001     unsigned EEIE               : 1;
3002     unsigned                    : 1;
3003     unsigned CMIE               : 1;
3004     unsigned OSCFIE             : 1;
3005     };
3006 
3007   struct
3008     {
3009     unsigned                    : 1;
3010     unsigned                    : 1;
3011     unsigned LVDIE              : 1;
3012     unsigned BCLIE              : 1;
3013     unsigned                    : 1;
3014     unsigned                    : 1;
3015     unsigned                    : 1;
3016     unsigned                    : 1;
3017     };
3018   } __PIE2bits_t;
3019 
3020 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3021 
3022 #define _CCP2IE                 0x01
3023 #define _TMR3IE                 0x02
3024 #define _HLVDIE                 0x04
3025 #define _LVDIE                  0x04
3026 #define _BCL1IE                 0x08
3027 #define _BCLIE                  0x08
3028 #define _EEIE                   0x10
3029 #define _CMIE                   0x40
3030 #define _OSCFIE                 0x80
3031 
3032 //==============================================================================
3033 
3034 
3035 //==============================================================================
3036 //        PIR2 Bits
3037 
3038 extern __at(0x0FA1) __sfr PIR2;
3039 
3040 typedef union
3041   {
3042   struct
3043     {
3044     unsigned CCP2IF             : 1;
3045     unsigned TMR3IF             : 1;
3046     unsigned HLVDIF             : 1;
3047     unsigned BCL1IF             : 1;
3048     unsigned EEIF               : 1;
3049     unsigned                    : 1;
3050     unsigned CMIF               : 1;
3051     unsigned OSCFIF             : 1;
3052     };
3053 
3054   struct
3055     {
3056     unsigned                    : 1;
3057     unsigned                    : 1;
3058     unsigned LVDIF              : 1;
3059     unsigned BCLIF              : 1;
3060     unsigned                    : 1;
3061     unsigned                    : 1;
3062     unsigned                    : 1;
3063     unsigned                    : 1;
3064     };
3065   } __PIR2bits_t;
3066 
3067 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3068 
3069 #define _CCP2IF                 0x01
3070 #define _TMR3IF                 0x02
3071 #define _HLVDIF                 0x04
3072 #define _LVDIF                  0x04
3073 #define _BCL1IF                 0x08
3074 #define _BCLIF                  0x08
3075 #define _EEIF                   0x10
3076 #define _CMIF                   0x40
3077 #define _OSCFIF                 0x80
3078 
3079 //==============================================================================
3080 
3081 
3082 //==============================================================================
3083 //        IPR2 Bits
3084 
3085 extern __at(0x0FA2) __sfr IPR2;
3086 
3087 typedef union
3088   {
3089   struct
3090     {
3091     unsigned CCP2IP             : 1;
3092     unsigned TMR3IP             : 1;
3093     unsigned HLVDIP             : 1;
3094     unsigned BCL1IP             : 1;
3095     unsigned EEIP               : 1;
3096     unsigned                    : 1;
3097     unsigned CMIP               : 1;
3098     unsigned OSCFIP             : 1;
3099     };
3100 
3101   struct
3102     {
3103     unsigned                    : 1;
3104     unsigned                    : 1;
3105     unsigned LVDIP              : 1;
3106     unsigned BCLIP              : 1;
3107     unsigned                    : 1;
3108     unsigned                    : 1;
3109     unsigned                    : 1;
3110     unsigned                    : 1;
3111     };
3112   } __IPR2bits_t;
3113 
3114 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3115 
3116 #define _CCP2IP                 0x01
3117 #define _TMR3IP                 0x02
3118 #define _HLVDIP                 0x04
3119 #define _LVDIP                  0x04
3120 #define _BCL1IP                 0x08
3121 #define _BCLIP                  0x08
3122 #define _EEIP                   0x10
3123 #define _CMIP                   0x40
3124 #define _OSCFIP                 0x80
3125 
3126 //==============================================================================
3127 
3128 
3129 //==============================================================================
3130 //        PIE3 Bits
3131 
3132 extern __at(0x0FA3) __sfr PIE3;
3133 
3134 typedef struct
3135   {
3136   unsigned CCP3IE               : 1;
3137   unsigned CCP4IE               : 1;
3138   unsigned CCP5IE               : 1;
3139   unsigned TMR4IE               : 1;
3140   unsigned TX2IE                : 1;
3141   unsigned RC2IE                : 1;
3142   unsigned BCL2IE               : 1;
3143   unsigned SSP2IE               : 1;
3144   } __PIE3bits_t;
3145 
3146 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3147 
3148 #define _CCP3IE                 0x01
3149 #define _CCP4IE                 0x02
3150 #define _CCP5IE                 0x04
3151 #define _TMR4IE                 0x08
3152 #define _TX2IE                  0x10
3153 #define _RC2IE                  0x20
3154 #define _BCL2IE                 0x40
3155 #define _SSP2IE                 0x80
3156 
3157 //==============================================================================
3158 
3159 
3160 //==============================================================================
3161 //        PIR3 Bits
3162 
3163 extern __at(0x0FA4) __sfr PIR3;
3164 
3165 typedef struct
3166   {
3167   unsigned CCP3IF               : 1;
3168   unsigned CCP4IF               : 1;
3169   unsigned CCP5IF               : 1;
3170   unsigned TMR4IF               : 1;
3171   unsigned TX2IF                : 1;
3172   unsigned RC2IF                : 1;
3173   unsigned BCL2IF               : 1;
3174   unsigned SSP2IF               : 1;
3175   } __PIR3bits_t;
3176 
3177 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3178 
3179 #define _CCP3IF                 0x01
3180 #define _CCP4IF                 0x02
3181 #define _CCP5IF                 0x04
3182 #define _TMR4IF                 0x08
3183 #define _TX2IF                  0x10
3184 #define _RC2IF                  0x20
3185 #define _BCL2IF                 0x40
3186 #define _SSP2IF                 0x80
3187 
3188 //==============================================================================
3189 
3190 
3191 //==============================================================================
3192 //        IPR3 Bits
3193 
3194 extern __at(0x0FA5) __sfr IPR3;
3195 
3196 typedef struct
3197   {
3198   unsigned CCP3IP               : 1;
3199   unsigned CCP4IP               : 1;
3200   unsigned CCP5IP               : 1;
3201   unsigned TMR4IP               : 1;
3202   unsigned TX2IP                : 1;
3203   unsigned RC2IP                : 1;
3204   unsigned BCL2IP               : 1;
3205   unsigned SSP2IP               : 1;
3206   } __IPR3bits_t;
3207 
3208 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3209 
3210 #define _CCP3IP                 0x01
3211 #define _CCP4IP                 0x02
3212 #define _CCP5IP                 0x04
3213 #define _TMR4IP                 0x08
3214 #define _TX2IP                  0x10
3215 #define _RC2IP                  0x20
3216 #define _BCL2IP                 0x40
3217 #define _SSP2IP                 0x80
3218 
3219 //==============================================================================
3220 
3221 
3222 //==============================================================================
3223 //        EECON1 Bits
3224 
3225 extern __at(0x0FA6) __sfr EECON1;
3226 
3227 typedef struct
3228   {
3229   unsigned RD                   : 1;
3230   unsigned WR                   : 1;
3231   unsigned WREN                 : 1;
3232   unsigned WRERR                : 1;
3233   unsigned FREE                 : 1;
3234   unsigned                      : 1;
3235   unsigned CFGS                 : 1;
3236   unsigned EEPGD                : 1;
3237   } __EECON1bits_t;
3238 
3239 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3240 
3241 #define _RD                     0x01
3242 #define _WR                     0x02
3243 #define _WREN                   0x04
3244 #define _WRERR                  0x08
3245 #define _FREE                   0x10
3246 #define _CFGS                   0x40
3247 #define _EEPGD                  0x80
3248 
3249 //==============================================================================
3250 
3251 extern __at(0x0FA7) __sfr EECON2;
3252 extern __at(0x0FA8) __sfr EEDATA;
3253 extern __at(0x0FA9) __sfr EEADR;
3254 extern __at(0x0FAA) __sfr EEADRH;
3255 
3256 //==============================================================================
3257 //        RCSTA Bits
3258 
3259 extern __at(0x0FAB) __sfr RCSTA;
3260 
3261 typedef union
3262   {
3263   struct
3264     {
3265     unsigned RX9D               : 1;
3266     unsigned OERR               : 1;
3267     unsigned FERR               : 1;
3268     unsigned ADDEN              : 1;
3269     unsigned CREN               : 1;
3270     unsigned SREN               : 1;
3271     unsigned RX9                : 1;
3272     unsigned SPEN               : 1;
3273     };
3274 
3275   struct
3276     {
3277     unsigned RCD8               : 1;
3278     unsigned OERR1              : 1;
3279     unsigned FERR1              : 1;
3280     unsigned ADDEN1             : 1;
3281     unsigned CREN1              : 1;
3282     unsigned SREN1              : 1;
3283     unsigned RC9                : 1;
3284     unsigned SPEN1              : 1;
3285     };
3286 
3287   struct
3288     {
3289     unsigned RX9D1              : 1;
3290     unsigned                    : 1;
3291     unsigned                    : 1;
3292     unsigned                    : 1;
3293     unsigned                    : 1;
3294     unsigned                    : 1;
3295     unsigned NOT_RC8            : 1;
3296     unsigned                    : 1;
3297     };
3298 
3299   struct
3300     {
3301     unsigned                    : 1;
3302     unsigned                    : 1;
3303     unsigned                    : 1;
3304     unsigned                    : 1;
3305     unsigned                    : 1;
3306     unsigned                    : 1;
3307     unsigned RC8_9              : 1;
3308     unsigned                    : 1;
3309     };
3310 
3311   struct
3312     {
3313     unsigned                    : 1;
3314     unsigned                    : 1;
3315     unsigned                    : 1;
3316     unsigned                    : 1;
3317     unsigned                    : 1;
3318     unsigned                    : 1;
3319     unsigned RX91               : 1;
3320     unsigned                    : 1;
3321     };
3322   } __RCSTAbits_t;
3323 
3324 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3325 
3326 #define _RX9D                   0x01
3327 #define _RCD8                   0x01
3328 #define _RX9D1                  0x01
3329 #define _OERR                   0x02
3330 #define _OERR1                  0x02
3331 #define _FERR                   0x04
3332 #define _FERR1                  0x04
3333 #define _ADDEN                  0x08
3334 #define _ADDEN1                 0x08
3335 #define _CREN                   0x10
3336 #define _CREN1                  0x10
3337 #define _SREN                   0x20
3338 #define _SREN1                  0x20
3339 #define _RX9                    0x40
3340 #define _RC9                    0x40
3341 #define _NOT_RC8                0x40
3342 #define _RC8_9                  0x40
3343 #define _RX91                   0x40
3344 #define _SPEN                   0x80
3345 #define _SPEN1                  0x80
3346 
3347 //==============================================================================
3348 
3349 
3350 //==============================================================================
3351 //        RCSTA1 Bits
3352 
3353 extern __at(0x0FAB) __sfr RCSTA1;
3354 
3355 typedef union
3356   {
3357   struct
3358     {
3359     unsigned RX9D               : 1;
3360     unsigned OERR               : 1;
3361     unsigned FERR               : 1;
3362     unsigned ADDEN              : 1;
3363     unsigned CREN               : 1;
3364     unsigned SREN               : 1;
3365     unsigned RX9                : 1;
3366     unsigned SPEN               : 1;
3367     };
3368 
3369   struct
3370     {
3371     unsigned RCD8               : 1;
3372     unsigned OERR1              : 1;
3373     unsigned FERR1              : 1;
3374     unsigned ADDEN1             : 1;
3375     unsigned CREN1              : 1;
3376     unsigned SREN1              : 1;
3377     unsigned RC9                : 1;
3378     unsigned SPEN1              : 1;
3379     };
3380 
3381   struct
3382     {
3383     unsigned RX9D1              : 1;
3384     unsigned                    : 1;
3385     unsigned                    : 1;
3386     unsigned                    : 1;
3387     unsigned                    : 1;
3388     unsigned                    : 1;
3389     unsigned NOT_RC8            : 1;
3390     unsigned                    : 1;
3391     };
3392 
3393   struct
3394     {
3395     unsigned                    : 1;
3396     unsigned                    : 1;
3397     unsigned                    : 1;
3398     unsigned                    : 1;
3399     unsigned                    : 1;
3400     unsigned                    : 1;
3401     unsigned RC8_9              : 1;
3402     unsigned                    : 1;
3403     };
3404 
3405   struct
3406     {
3407     unsigned                    : 1;
3408     unsigned                    : 1;
3409     unsigned                    : 1;
3410     unsigned                    : 1;
3411     unsigned                    : 1;
3412     unsigned                    : 1;
3413     unsigned RX91               : 1;
3414     unsigned                    : 1;
3415     };
3416   } __RCSTA1bits_t;
3417 
3418 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
3419 
3420 #define _RCSTA1_RX9D            0x01
3421 #define _RCSTA1_RCD8            0x01
3422 #define _RCSTA1_RX9D1           0x01
3423 #define _RCSTA1_OERR            0x02
3424 #define _RCSTA1_OERR1           0x02
3425 #define _RCSTA1_FERR            0x04
3426 #define _RCSTA1_FERR1           0x04
3427 #define _RCSTA1_ADDEN           0x08
3428 #define _RCSTA1_ADDEN1          0x08
3429 #define _RCSTA1_CREN            0x10
3430 #define _RCSTA1_CREN1           0x10
3431 #define _RCSTA1_SREN            0x20
3432 #define _RCSTA1_SREN1           0x20
3433 #define _RCSTA1_RX9             0x40
3434 #define _RCSTA1_RC9             0x40
3435 #define _RCSTA1_NOT_RC8         0x40
3436 #define _RCSTA1_RC8_9           0x40
3437 #define _RCSTA1_RX91            0x40
3438 #define _RCSTA1_SPEN            0x80
3439 #define _RCSTA1_SPEN1           0x80
3440 
3441 //==============================================================================
3442 
3443 
3444 //==============================================================================
3445 //        TXSTA Bits
3446 
3447 extern __at(0x0FAC) __sfr TXSTA;
3448 
3449 typedef union
3450   {
3451   struct
3452     {
3453     unsigned TX9D               : 1;
3454     unsigned TRMT               : 1;
3455     unsigned BRGH               : 1;
3456     unsigned SENDB              : 1;
3457     unsigned SYNC               : 1;
3458     unsigned TXEN               : 1;
3459     unsigned TX9                : 1;
3460     unsigned CSRC               : 1;
3461     };
3462 
3463   struct
3464     {
3465     unsigned TXD8               : 1;
3466     unsigned TRMT1              : 1;
3467     unsigned BRGH1              : 1;
3468     unsigned SENDB1             : 1;
3469     unsigned SYNC1              : 1;
3470     unsigned TXEN1              : 1;
3471     unsigned TX8_9              : 1;
3472     unsigned CSRC1              : 1;
3473     };
3474 
3475   struct
3476     {
3477     unsigned TX9D1              : 1;
3478     unsigned                    : 1;
3479     unsigned                    : 1;
3480     unsigned                    : 1;
3481     unsigned                    : 1;
3482     unsigned                    : 1;
3483     unsigned NOT_TX8            : 1;
3484     unsigned                    : 1;
3485     };
3486 
3487   struct
3488     {
3489     unsigned                    : 1;
3490     unsigned                    : 1;
3491     unsigned                    : 1;
3492     unsigned                    : 1;
3493     unsigned                    : 1;
3494     unsigned                    : 1;
3495     unsigned TX91               : 1;
3496     unsigned                    : 1;
3497     };
3498   } __TXSTAbits_t;
3499 
3500 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
3501 
3502 #define _TX9D                   0x01
3503 #define _TXD8                   0x01
3504 #define _TX9D1                  0x01
3505 #define _TRMT                   0x02
3506 #define _TRMT1                  0x02
3507 #define _BRGH                   0x04
3508 #define _BRGH1                  0x04
3509 #define _SENDB                  0x08
3510 #define _SENDB1                 0x08
3511 #define _SYNC                   0x10
3512 #define _SYNC1                  0x10
3513 #define _TXEN                   0x20
3514 #define _TXEN1                  0x20
3515 #define _TX9                    0x40
3516 #define _TX8_9                  0x40
3517 #define _NOT_TX8                0x40
3518 #define _TX91                   0x40
3519 #define _CSRC                   0x80
3520 #define _CSRC1                  0x80
3521 
3522 //==============================================================================
3523 
3524 
3525 //==============================================================================
3526 //        TXSTA1 Bits
3527 
3528 extern __at(0x0FAC) __sfr TXSTA1;
3529 
3530 typedef union
3531   {
3532   struct
3533     {
3534     unsigned TX9D               : 1;
3535     unsigned TRMT               : 1;
3536     unsigned BRGH               : 1;
3537     unsigned SENDB              : 1;
3538     unsigned SYNC               : 1;
3539     unsigned TXEN               : 1;
3540     unsigned TX9                : 1;
3541     unsigned CSRC               : 1;
3542     };
3543 
3544   struct
3545     {
3546     unsigned TXD8               : 1;
3547     unsigned TRMT1              : 1;
3548     unsigned BRGH1              : 1;
3549     unsigned SENDB1             : 1;
3550     unsigned SYNC1              : 1;
3551     unsigned TXEN1              : 1;
3552     unsigned TX8_9              : 1;
3553     unsigned CSRC1              : 1;
3554     };
3555 
3556   struct
3557     {
3558     unsigned TX9D1              : 1;
3559     unsigned                    : 1;
3560     unsigned                    : 1;
3561     unsigned                    : 1;
3562     unsigned                    : 1;
3563     unsigned                    : 1;
3564     unsigned NOT_TX8            : 1;
3565     unsigned                    : 1;
3566     };
3567 
3568   struct
3569     {
3570     unsigned                    : 1;
3571     unsigned                    : 1;
3572     unsigned                    : 1;
3573     unsigned                    : 1;
3574     unsigned                    : 1;
3575     unsigned                    : 1;
3576     unsigned TX91               : 1;
3577     unsigned                    : 1;
3578     };
3579   } __TXSTA1bits_t;
3580 
3581 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
3582 
3583 #define _TXSTA1_TX9D            0x01
3584 #define _TXSTA1_TXD8            0x01
3585 #define _TXSTA1_TX9D1           0x01
3586 #define _TXSTA1_TRMT            0x02
3587 #define _TXSTA1_TRMT1           0x02
3588 #define _TXSTA1_BRGH            0x04
3589 #define _TXSTA1_BRGH1           0x04
3590 #define _TXSTA1_SENDB           0x08
3591 #define _TXSTA1_SENDB1          0x08
3592 #define _TXSTA1_SYNC            0x10
3593 #define _TXSTA1_SYNC1           0x10
3594 #define _TXSTA1_TXEN            0x20
3595 #define _TXSTA1_TXEN1           0x20
3596 #define _TXSTA1_TX9             0x40
3597 #define _TXSTA1_TX8_9           0x40
3598 #define _TXSTA1_NOT_TX8         0x40
3599 #define _TXSTA1_TX91            0x40
3600 #define _TXSTA1_CSRC            0x80
3601 #define _TXSTA1_CSRC1           0x80
3602 
3603 //==============================================================================
3604 
3605 extern __at(0x0FAD) __sfr TXREG;
3606 extern __at(0x0FAD) __sfr TXREG1;
3607 extern __at(0x0FAE) __sfr RCREG;
3608 extern __at(0x0FAE) __sfr RCREG1;
3609 extern __at(0x0FAF) __sfr SPBRG;
3610 extern __at(0x0FAF) __sfr SPBRG1;
3611 
3612 //==============================================================================
3613 //        PSPCON Bits
3614 
3615 extern __at(0x0FB0) __sfr PSPCON;
3616 
3617 typedef struct
3618   {
3619   unsigned                      : 1;
3620   unsigned                      : 1;
3621   unsigned                      : 1;
3622   unsigned                      : 1;
3623   unsigned PSPMODE              : 1;
3624   unsigned IBOV                 : 1;
3625   unsigned OBF                  : 1;
3626   unsigned IBF                  : 1;
3627   } __PSPCONbits_t;
3628 
3629 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
3630 
3631 #define _PSPMODE                0x10
3632 #define _IBOV                   0x20
3633 #define _OBF                    0x40
3634 #define _IBF                    0x80
3635 
3636 //==============================================================================
3637 
3638 
3639 //==============================================================================
3640 //        T3CON Bits
3641 
3642 extern __at(0x0FB1) __sfr T3CON;
3643 
3644 typedef union
3645   {
3646   struct
3647     {
3648     unsigned TMR3ON             : 1;
3649     unsigned TMR3CS             : 1;
3650     unsigned NOT_T3SYNC         : 1;
3651     unsigned T3CCP1             : 1;
3652     unsigned T3CKPS0            : 1;
3653     unsigned T3CKPS1            : 1;
3654     unsigned T3CCP2             : 1;
3655     unsigned RD16               : 1;
3656     };
3657 
3658   struct
3659     {
3660     unsigned                    : 1;
3661     unsigned                    : 1;
3662     unsigned T3SYNC             : 1;
3663     unsigned                    : 1;
3664     unsigned                    : 1;
3665     unsigned                    : 1;
3666     unsigned                    : 1;
3667     unsigned                    : 1;
3668     };
3669 
3670   struct
3671     {
3672     unsigned                    : 1;
3673     unsigned                    : 1;
3674     unsigned T3INSYNC           : 1;
3675     unsigned                    : 1;
3676     unsigned                    : 1;
3677     unsigned                    : 1;
3678     unsigned                    : 1;
3679     unsigned                    : 1;
3680     };
3681 
3682   struct
3683     {
3684     unsigned                    : 4;
3685     unsigned T3CKPS             : 2;
3686     unsigned                    : 2;
3687     };
3688   } __T3CONbits_t;
3689 
3690 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
3691 
3692 #define _T3CON_TMR3ON           0x01
3693 #define _T3CON_TMR3CS           0x02
3694 #define _T3CON_NOT_T3SYNC       0x04
3695 #define _T3CON_T3SYNC           0x04
3696 #define _T3CON_T3INSYNC         0x04
3697 #define _T3CON_T3CCP1           0x08
3698 #define _T3CON_T3CKPS0          0x10
3699 #define _T3CON_T3CKPS1          0x20
3700 #define _T3CON_T3CCP2           0x40
3701 #define _T3CON_RD16             0x80
3702 
3703 //==============================================================================
3704 
3705 extern __at(0x0FB2) __sfr TMR3;
3706 extern __at(0x0FB2) __sfr TMR3L;
3707 extern __at(0x0FB3) __sfr TMR3H;
3708 
3709 //==============================================================================
3710 //        CMCON Bits
3711 
3712 extern __at(0x0FB4) __sfr CMCON;
3713 
3714 typedef union
3715   {
3716   struct
3717     {
3718     unsigned CM0                : 1;
3719     unsigned CM1                : 1;
3720     unsigned CM2                : 1;
3721     unsigned CIS                : 1;
3722     unsigned C1INV              : 1;
3723     unsigned C2INV              : 1;
3724     unsigned C1OUT              : 1;
3725     unsigned C2OUT              : 1;
3726     };
3727 
3728   struct
3729     {
3730     unsigned CM                 : 3;
3731     unsigned                    : 5;
3732     };
3733   } __CMCONbits_t;
3734 
3735 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
3736 
3737 #define _CM0                    0x01
3738 #define _CM1                    0x02
3739 #define _CM2                    0x04
3740 #define _CIS                    0x08
3741 #define _C1INV                  0x10
3742 #define _C2INV                  0x20
3743 #define _C1OUT                  0x40
3744 #define _C2OUT                  0x80
3745 
3746 //==============================================================================
3747 
3748 
3749 //==============================================================================
3750 //        CVRCON Bits
3751 
3752 extern __at(0x0FB5) __sfr CVRCON;
3753 
3754 typedef union
3755   {
3756   struct
3757     {
3758     unsigned CVR0               : 1;
3759     unsigned CVR1               : 1;
3760     unsigned CVR2               : 1;
3761     unsigned CVR3               : 1;
3762     unsigned CVRSS              : 1;
3763     unsigned CVRR               : 1;
3764     unsigned CVROE              : 1;
3765     unsigned CVREN              : 1;
3766     };
3767 
3768   struct
3769     {
3770     unsigned CVR                : 4;
3771     unsigned                    : 4;
3772     };
3773   } __CVRCONbits_t;
3774 
3775 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
3776 
3777 #define _CVR0                   0x01
3778 #define _CVR1                   0x02
3779 #define _CVR2                   0x04
3780 #define _CVR3                   0x08
3781 #define _CVRSS                  0x10
3782 #define _CVRR                   0x20
3783 #define _CVROE                  0x40
3784 #define _CVREN                  0x80
3785 
3786 //==============================================================================
3787 
3788 
3789 //==============================================================================
3790 //        ECCP1AS Bits
3791 
3792 extern __at(0x0FB6) __sfr ECCP1AS;
3793 
3794 typedef union
3795   {
3796   struct
3797     {
3798     unsigned PSS1BD0            : 1;
3799     unsigned PSS1BD1            : 1;
3800     unsigned PSS1AC0            : 1;
3801     unsigned PSS1AC1            : 1;
3802     unsigned ECCP1AS0           : 1;
3803     unsigned ECCP1AS1           : 1;
3804     unsigned ECCP1AS2           : 1;
3805     unsigned ECCP1ASE           : 1;
3806     };
3807 
3808   struct
3809     {
3810     unsigned PSSBD0             : 1;
3811     unsigned PSSBD1             : 1;
3812     unsigned PSSAC0             : 1;
3813     unsigned PSSAC1             : 1;
3814     unsigned ECCPAS0            : 1;
3815     unsigned ECCPAS1            : 1;
3816     unsigned ECCPAS2            : 1;
3817     unsigned ECCPASE            : 1;
3818     };
3819 
3820   struct
3821     {
3822     unsigned PSS1BD             : 2;
3823     unsigned                    : 6;
3824     };
3825 
3826   struct
3827     {
3828     unsigned PSSBD              : 2;
3829     unsigned                    : 6;
3830     };
3831 
3832   struct
3833     {
3834     unsigned                    : 2;
3835     unsigned PSSAC              : 2;
3836     unsigned                    : 4;
3837     };
3838 
3839   struct
3840     {
3841     unsigned                    : 2;
3842     unsigned PSS1AC             : 2;
3843     unsigned                    : 4;
3844     };
3845 
3846   struct
3847     {
3848     unsigned                    : 4;
3849     unsigned ECCPAS             : 3;
3850     unsigned                    : 1;
3851     };
3852 
3853   struct
3854     {
3855     unsigned                    : 4;
3856     unsigned ECCP1AS            : 3;
3857     unsigned                    : 1;
3858     };
3859   } __ECCP1ASbits_t;
3860 
3861 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
3862 
3863 #define _PSS1BD0                0x01
3864 #define _PSSBD0                 0x01
3865 #define _PSS1BD1                0x02
3866 #define _PSSBD1                 0x02
3867 #define _PSS1AC0                0x04
3868 #define _PSSAC0                 0x04
3869 #define _PSS1AC1                0x08
3870 #define _PSSAC1                 0x08
3871 #define _ECCP1AS0               0x10
3872 #define _ECCPAS0                0x10
3873 #define _ECCP1AS1               0x20
3874 #define _ECCPAS1                0x20
3875 #define _ECCP1AS2               0x40
3876 #define _ECCPAS2                0x40
3877 #define _ECCP1ASE               0x80
3878 #define _ECCPASE                0x80
3879 
3880 //==============================================================================
3881 
3882 
3883 //==============================================================================
3884 //        CCP3CON Bits
3885 
3886 extern __at(0x0FB7) __sfr CCP3CON;
3887 
3888 typedef union
3889   {
3890   struct
3891     {
3892     unsigned CCP3M0             : 1;
3893     unsigned CCP3M1             : 1;
3894     unsigned CCP3M2             : 1;
3895     unsigned CCP3M3             : 1;
3896     unsigned DC3B0              : 1;
3897     unsigned DC3B1              : 1;
3898     unsigned P3M0               : 1;
3899     unsigned P3M1               : 1;
3900     };
3901 
3902   struct
3903     {
3904     unsigned                    : 1;
3905     unsigned                    : 1;
3906     unsigned                    : 1;
3907     unsigned                    : 1;
3908     unsigned CCP3Y              : 1;
3909     unsigned CCP3X              : 1;
3910     unsigned                    : 1;
3911     unsigned                    : 1;
3912     };
3913 
3914   struct
3915     {
3916     unsigned CCP3M              : 4;
3917     unsigned                    : 4;
3918     };
3919 
3920   struct
3921     {
3922     unsigned                    : 4;
3923     unsigned DC3B               : 2;
3924     unsigned                    : 2;
3925     };
3926 
3927   struct
3928     {
3929     unsigned                    : 6;
3930     unsigned P3M                : 2;
3931     };
3932   } __CCP3CONbits_t;
3933 
3934 extern __at(0x0FB7) volatile __CCP3CONbits_t CCP3CONbits;
3935 
3936 #define _CCP3M0                 0x01
3937 #define _CCP3M1                 0x02
3938 #define _CCP3M2                 0x04
3939 #define _CCP3M3                 0x08
3940 #define _DC3B0                  0x10
3941 #define _CCP3Y                  0x10
3942 #define _DC3B1                  0x20
3943 #define _CCP3X                  0x20
3944 #define _P3M0                   0x40
3945 #define _P3M1                   0x80
3946 
3947 //==============================================================================
3948 
3949 
3950 //==============================================================================
3951 //        ECCP3CON Bits
3952 
3953 extern __at(0x0FB7) __sfr ECCP3CON;
3954 
3955 typedef union
3956   {
3957   struct
3958     {
3959     unsigned CCP3M0             : 1;
3960     unsigned CCP3M1             : 1;
3961     unsigned CCP3M2             : 1;
3962     unsigned CCP3M3             : 1;
3963     unsigned DC3B0              : 1;
3964     unsigned DC3B1              : 1;
3965     unsigned P3M0               : 1;
3966     unsigned P3M1               : 1;
3967     };
3968 
3969   struct
3970     {
3971     unsigned                    : 1;
3972     unsigned                    : 1;
3973     unsigned                    : 1;
3974     unsigned                    : 1;
3975     unsigned CCP3Y              : 1;
3976     unsigned CCP3X              : 1;
3977     unsigned                    : 1;
3978     unsigned                    : 1;
3979     };
3980 
3981   struct
3982     {
3983     unsigned CCP3M              : 4;
3984     unsigned                    : 4;
3985     };
3986 
3987   struct
3988     {
3989     unsigned                    : 4;
3990     unsigned DC3B               : 2;
3991     unsigned                    : 2;
3992     };
3993 
3994   struct
3995     {
3996     unsigned                    : 6;
3997     unsigned P3M                : 2;
3998     };
3999   } __ECCP3CONbits_t;
4000 
4001 extern __at(0x0FB7) volatile __ECCP3CONbits_t ECCP3CONbits;
4002 
4003 #define _ECCP3CON_CCP3M0        0x01
4004 #define _ECCP3CON_CCP3M1        0x02
4005 #define _ECCP3CON_CCP3M2        0x04
4006 #define _ECCP3CON_CCP3M3        0x08
4007 #define _ECCP3CON_DC3B0         0x10
4008 #define _ECCP3CON_CCP3Y         0x10
4009 #define _ECCP3CON_DC3B1         0x20
4010 #define _ECCP3CON_CCP3X         0x20
4011 #define _ECCP3CON_P3M0          0x40
4012 #define _ECCP3CON_P3M1          0x80
4013 
4014 //==============================================================================
4015 
4016 extern __at(0x0FB8) __sfr CCPR3;
4017 extern __at(0x0FB8) __sfr CCPR3L;
4018 extern __at(0x0FB9) __sfr CCPR3H;
4019 
4020 //==============================================================================
4021 //        CCP2CON Bits
4022 
4023 extern __at(0x0FBA) __sfr CCP2CON;
4024 
4025 typedef union
4026   {
4027   struct
4028     {
4029     unsigned CCP2M0             : 1;
4030     unsigned CCP2M1             : 1;
4031     unsigned CCP2M2             : 1;
4032     unsigned CCP2M3             : 1;
4033     unsigned DC2B0              : 1;
4034     unsigned DC2B1              : 1;
4035     unsigned P2M0               : 1;
4036     unsigned P2M1               : 1;
4037     };
4038 
4039   struct
4040     {
4041     unsigned                    : 1;
4042     unsigned                    : 1;
4043     unsigned                    : 1;
4044     unsigned                    : 1;
4045     unsigned CCP2Y              : 1;
4046     unsigned CCP2X              : 1;
4047     unsigned                    : 1;
4048     unsigned                    : 1;
4049     };
4050 
4051   struct
4052     {
4053     unsigned CCP2M              : 4;
4054     unsigned                    : 4;
4055     };
4056 
4057   struct
4058     {
4059     unsigned                    : 4;
4060     unsigned DC2B               : 2;
4061     unsigned                    : 2;
4062     };
4063 
4064   struct
4065     {
4066     unsigned                    : 6;
4067     unsigned P2M                : 2;
4068     };
4069   } __CCP2CONbits_t;
4070 
4071 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
4072 
4073 #define _CCP2M0                 0x01
4074 #define _CCP2M1                 0x02
4075 #define _CCP2M2                 0x04
4076 #define _CCP2M3                 0x08
4077 #define _DC2B0                  0x10
4078 #define _CCP2Y                  0x10
4079 #define _DC2B1                  0x20
4080 #define _CCP2X                  0x20
4081 #define _P2M0                   0x40
4082 #define _P2M1                   0x80
4083 
4084 //==============================================================================
4085 
4086 
4087 //==============================================================================
4088 //        ECCP2CON Bits
4089 
4090 extern __at(0x0FBA) __sfr ECCP2CON;
4091 
4092 typedef union
4093   {
4094   struct
4095     {
4096     unsigned CCP2M0             : 1;
4097     unsigned CCP2M1             : 1;
4098     unsigned CCP2M2             : 1;
4099     unsigned CCP2M3             : 1;
4100     unsigned DC2B0              : 1;
4101     unsigned DC2B1              : 1;
4102     unsigned P2M0               : 1;
4103     unsigned P2M1               : 1;
4104     };
4105 
4106   struct
4107     {
4108     unsigned                    : 1;
4109     unsigned                    : 1;
4110     unsigned                    : 1;
4111     unsigned                    : 1;
4112     unsigned CCP2Y              : 1;
4113     unsigned CCP2X              : 1;
4114     unsigned                    : 1;
4115     unsigned                    : 1;
4116     };
4117 
4118   struct
4119     {
4120     unsigned CCP2M              : 4;
4121     unsigned                    : 4;
4122     };
4123 
4124   struct
4125     {
4126     unsigned                    : 4;
4127     unsigned DC2B               : 2;
4128     unsigned                    : 2;
4129     };
4130 
4131   struct
4132     {
4133     unsigned                    : 6;
4134     unsigned P2M                : 2;
4135     };
4136   } __ECCP2CONbits_t;
4137 
4138 extern __at(0x0FBA) volatile __ECCP2CONbits_t ECCP2CONbits;
4139 
4140 #define _ECCP2CON_CCP2M0        0x01
4141 #define _ECCP2CON_CCP2M1        0x02
4142 #define _ECCP2CON_CCP2M2        0x04
4143 #define _ECCP2CON_CCP2M3        0x08
4144 #define _ECCP2CON_DC2B0         0x10
4145 #define _ECCP2CON_CCP2Y         0x10
4146 #define _ECCP2CON_DC2B1         0x20
4147 #define _ECCP2CON_CCP2X         0x20
4148 #define _ECCP2CON_P2M0          0x40
4149 #define _ECCP2CON_P2M1          0x80
4150 
4151 //==============================================================================
4152 
4153 extern __at(0x0FBB) __sfr CCPR2;
4154 extern __at(0x0FBB) __sfr CCPR2L;
4155 extern __at(0x0FBC) __sfr CCPR2H;
4156 
4157 //==============================================================================
4158 //        CCP1CON Bits
4159 
4160 extern __at(0x0FBD) __sfr CCP1CON;
4161 
4162 typedef union
4163   {
4164   struct
4165     {
4166     unsigned CCP1M0             : 1;
4167     unsigned CCP1M1             : 1;
4168     unsigned CCP1M2             : 1;
4169     unsigned CCP1M3             : 1;
4170     unsigned DC1B0              : 1;
4171     unsigned DC1B1              : 1;
4172     unsigned P1M0               : 1;
4173     unsigned P1M1               : 1;
4174     };
4175 
4176   struct
4177     {
4178     unsigned                    : 1;
4179     unsigned                    : 1;
4180     unsigned                    : 1;
4181     unsigned                    : 1;
4182     unsigned CCP1Y              : 1;
4183     unsigned CCP1X              : 1;
4184     unsigned                    : 1;
4185     unsigned                    : 1;
4186     };
4187 
4188   struct
4189     {
4190     unsigned CCP1M              : 4;
4191     unsigned                    : 4;
4192     };
4193 
4194   struct
4195     {
4196     unsigned                    : 4;
4197     unsigned DC1B               : 2;
4198     unsigned                    : 2;
4199     };
4200 
4201   struct
4202     {
4203     unsigned                    : 6;
4204     unsigned P1M                : 2;
4205     };
4206   } __CCP1CONbits_t;
4207 
4208 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
4209 
4210 #define _CCP1M0                 0x01
4211 #define _CCP1M1                 0x02
4212 #define _CCP1M2                 0x04
4213 #define _CCP1M3                 0x08
4214 #define _DC1B0                  0x10
4215 #define _CCP1Y                  0x10
4216 #define _DC1B1                  0x20
4217 #define _CCP1X                  0x20
4218 #define _P1M0                   0x40
4219 #define _P1M1                   0x80
4220 
4221 //==============================================================================
4222 
4223 
4224 //==============================================================================
4225 //        ECCP1CON Bits
4226 
4227 extern __at(0x0FBD) __sfr ECCP1CON;
4228 
4229 typedef union
4230   {
4231   struct
4232     {
4233     unsigned CCP1M0             : 1;
4234     unsigned CCP1M1             : 1;
4235     unsigned CCP1M2             : 1;
4236     unsigned CCP1M3             : 1;
4237     unsigned DC1B0              : 1;
4238     unsigned DC1B1              : 1;
4239     unsigned P1M0               : 1;
4240     unsigned P1M1               : 1;
4241     };
4242 
4243   struct
4244     {
4245     unsigned                    : 1;
4246     unsigned                    : 1;
4247     unsigned                    : 1;
4248     unsigned                    : 1;
4249     unsigned CCP1Y              : 1;
4250     unsigned CCP1X              : 1;
4251     unsigned                    : 1;
4252     unsigned                    : 1;
4253     };
4254 
4255   struct
4256     {
4257     unsigned CCP1M              : 4;
4258     unsigned                    : 4;
4259     };
4260 
4261   struct
4262     {
4263     unsigned                    : 4;
4264     unsigned DC1B               : 2;
4265     unsigned                    : 2;
4266     };
4267 
4268   struct
4269     {
4270     unsigned                    : 6;
4271     unsigned P1M                : 2;
4272     };
4273   } __ECCP1CONbits_t;
4274 
4275 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
4276 
4277 #define _ECCP1CON_CCP1M0        0x01
4278 #define _ECCP1CON_CCP1M1        0x02
4279 #define _ECCP1CON_CCP1M2        0x04
4280 #define _ECCP1CON_CCP1M3        0x08
4281 #define _ECCP1CON_DC1B0         0x10
4282 #define _ECCP1CON_CCP1Y         0x10
4283 #define _ECCP1CON_DC1B1         0x20
4284 #define _ECCP1CON_CCP1X         0x20
4285 #define _ECCP1CON_P1M0          0x40
4286 #define _ECCP1CON_P1M1          0x80
4287 
4288 //==============================================================================
4289 
4290 extern __at(0x0FBE) __sfr CCPR1;
4291 extern __at(0x0FBE) __sfr CCPR1L;
4292 extern __at(0x0FBF) __sfr CCPR1H;
4293 
4294 //==============================================================================
4295 //        ADCON2 Bits
4296 
4297 extern __at(0x0FC0) __sfr ADCON2;
4298 
4299 typedef union
4300   {
4301   struct
4302     {
4303     unsigned ADCS0              : 1;
4304     unsigned ADCS1              : 1;
4305     unsigned ADCS2              : 1;
4306     unsigned ACQT0              : 1;
4307     unsigned ACQT1              : 1;
4308     unsigned ACQT2              : 1;
4309     unsigned                    : 1;
4310     unsigned ADFM               : 1;
4311     };
4312 
4313   struct
4314     {
4315     unsigned ADCS               : 3;
4316     unsigned                    : 5;
4317     };
4318 
4319   struct
4320     {
4321     unsigned                    : 3;
4322     unsigned ACQT               : 3;
4323     unsigned                    : 2;
4324     };
4325   } __ADCON2bits_t;
4326 
4327 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4328 
4329 #define _ADCS0                  0x01
4330 #define _ADCS1                  0x02
4331 #define _ADCS2                  0x04
4332 #define _ACQT0                  0x08
4333 #define _ACQT1                  0x10
4334 #define _ACQT2                  0x20
4335 #define _ADFM                   0x80
4336 
4337 //==============================================================================
4338 
4339 
4340 //==============================================================================
4341 //        ADCON1 Bits
4342 
4343 extern __at(0x0FC1) __sfr ADCON1;
4344 
4345 typedef union
4346   {
4347   struct
4348     {
4349     unsigned PCFG0              : 1;
4350     unsigned PCFG1              : 1;
4351     unsigned PCFG2              : 1;
4352     unsigned PCFG3              : 1;
4353     unsigned VCFG0              : 1;
4354     unsigned VCFG1              : 1;
4355     unsigned                    : 1;
4356     unsigned                    : 1;
4357     };
4358 
4359   struct
4360     {
4361     unsigned PCFG               : 4;
4362     unsigned                    : 4;
4363     };
4364 
4365   struct
4366     {
4367     unsigned                    : 4;
4368     unsigned VCFG               : 2;
4369     unsigned                    : 2;
4370     };
4371   } __ADCON1bits_t;
4372 
4373 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4374 
4375 #define _PCFG0                  0x01
4376 #define _PCFG1                  0x02
4377 #define _PCFG2                  0x04
4378 #define _PCFG3                  0x08
4379 #define _VCFG0                  0x10
4380 #define _VCFG1                  0x20
4381 
4382 //==============================================================================
4383 
4384 
4385 //==============================================================================
4386 //        ADCON0 Bits
4387 
4388 extern __at(0x0FC2) __sfr ADCON0;
4389 
4390 typedef union
4391   {
4392   struct
4393     {
4394     unsigned ADON               : 1;
4395     unsigned GO_NOT_DONE        : 1;
4396     unsigned CHS0               : 1;
4397     unsigned CHS1               : 1;
4398     unsigned CHS2               : 1;
4399     unsigned CHS3               : 1;
4400     unsigned                    : 1;
4401     unsigned                    : 1;
4402     };
4403 
4404   struct
4405     {
4406     unsigned                    : 1;
4407     unsigned DONE               : 1;
4408     unsigned                    : 1;
4409     unsigned                    : 1;
4410     unsigned                    : 1;
4411     unsigned                    : 1;
4412     unsigned                    : 1;
4413     unsigned                    : 1;
4414     };
4415 
4416   struct
4417     {
4418     unsigned                    : 1;
4419     unsigned GO_DONE            : 1;
4420     unsigned                    : 1;
4421     unsigned                    : 1;
4422     unsigned                    : 1;
4423     unsigned                    : 1;
4424     unsigned                    : 1;
4425     unsigned                    : 1;
4426     };
4427 
4428   struct
4429     {
4430     unsigned                    : 1;
4431     unsigned GO                 : 1;
4432     unsigned                    : 1;
4433     unsigned                    : 1;
4434     unsigned                    : 1;
4435     unsigned                    : 1;
4436     unsigned                    : 1;
4437     unsigned                    : 1;
4438     };
4439 
4440   struct
4441     {
4442     unsigned                    : 1;
4443     unsigned NOT_DONE           : 1;
4444     unsigned                    : 1;
4445     unsigned                    : 1;
4446     unsigned                    : 1;
4447     unsigned                    : 1;
4448     unsigned                    : 1;
4449     unsigned                    : 1;
4450     };
4451 
4452   struct
4453     {
4454     unsigned                    : 2;
4455     unsigned CHS                : 4;
4456     unsigned                    : 2;
4457     };
4458   } __ADCON0bits_t;
4459 
4460 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4461 
4462 #define _ADON                   0x01
4463 #define _GO_NOT_DONE            0x02
4464 #define _DONE                   0x02
4465 #define _GO_DONE                0x02
4466 #define _GO                     0x02
4467 #define _NOT_DONE               0x02
4468 #define _CHS0                   0x04
4469 #define _CHS1                   0x08
4470 #define _CHS2                   0x10
4471 #define _CHS3                   0x20
4472 
4473 //==============================================================================
4474 
4475 extern __at(0x0FC3) __sfr ADRES;
4476 extern __at(0x0FC3) __sfr ADRESL;
4477 extern __at(0x0FC4) __sfr ADRESH;
4478 
4479 //==============================================================================
4480 //        SSP1CON2 Bits
4481 
4482 extern __at(0x0FC5) __sfr SSP1CON2;
4483 
4484 typedef struct
4485   {
4486   unsigned SEN                  : 1;
4487   unsigned RSEN                 : 1;
4488   unsigned PEN                  : 1;
4489   unsigned RCEN                 : 1;
4490   unsigned ACKEN                : 1;
4491   unsigned ACKDT                : 1;
4492   unsigned ACKSTAT              : 1;
4493   unsigned GCEN                 : 1;
4494   } __SSP1CON2bits_t;
4495 
4496 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4497 
4498 #define _SEN                    0x01
4499 #define _RSEN                   0x02
4500 #define _PEN                    0x04
4501 #define _RCEN                   0x08
4502 #define _ACKEN                  0x10
4503 #define _ACKDT                  0x20
4504 #define _ACKSTAT                0x40
4505 #define _GCEN                   0x80
4506 
4507 //==============================================================================
4508 
4509 
4510 //==============================================================================
4511 //        SSPCON2 Bits
4512 
4513 extern __at(0x0FC5) __sfr SSPCON2;
4514 
4515 typedef struct
4516   {
4517   unsigned SEN                  : 1;
4518   unsigned RSEN                 : 1;
4519   unsigned PEN                  : 1;
4520   unsigned RCEN                 : 1;
4521   unsigned ACKEN                : 1;
4522   unsigned ACKDT                : 1;
4523   unsigned ACKSTAT              : 1;
4524   unsigned GCEN                 : 1;
4525   } __SSPCON2bits_t;
4526 
4527 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4528 
4529 #define _SSPCON2_SEN            0x01
4530 #define _SSPCON2_RSEN           0x02
4531 #define _SSPCON2_PEN            0x04
4532 #define _SSPCON2_RCEN           0x08
4533 #define _SSPCON2_ACKEN          0x10
4534 #define _SSPCON2_ACKDT          0x20
4535 #define _SSPCON2_ACKSTAT        0x40
4536 #define _SSPCON2_GCEN           0x80
4537 
4538 //==============================================================================
4539 
4540 
4541 //==============================================================================
4542 //        SSP1CON1 Bits
4543 
4544 extern __at(0x0FC6) __sfr SSP1CON1;
4545 
4546 typedef union
4547   {
4548   struct
4549     {
4550     unsigned SSPM0              : 1;
4551     unsigned SSPM1              : 1;
4552     unsigned SSPM2              : 1;
4553     unsigned SSPM3              : 1;
4554     unsigned CKP                : 1;
4555     unsigned SSPEN              : 1;
4556     unsigned SSPOV              : 1;
4557     unsigned WCOL               : 1;
4558     };
4559 
4560   struct
4561     {
4562     unsigned SSPM               : 4;
4563     unsigned                    : 4;
4564     };
4565   } __SSP1CON1bits_t;
4566 
4567 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4568 
4569 #define _SSPM0                  0x01
4570 #define _SSPM1                  0x02
4571 #define _SSPM2                  0x04
4572 #define _SSPM3                  0x08
4573 #define _CKP                    0x10
4574 #define _SSPEN                  0x20
4575 #define _SSPOV                  0x40
4576 #define _WCOL                   0x80
4577 
4578 //==============================================================================
4579 
4580 
4581 //==============================================================================
4582 //        SSPCON1 Bits
4583 
4584 extern __at(0x0FC6) __sfr SSPCON1;
4585 
4586 typedef union
4587   {
4588   struct
4589     {
4590     unsigned SSPM0              : 1;
4591     unsigned SSPM1              : 1;
4592     unsigned SSPM2              : 1;
4593     unsigned SSPM3              : 1;
4594     unsigned CKP                : 1;
4595     unsigned SSPEN              : 1;
4596     unsigned SSPOV              : 1;
4597     unsigned WCOL               : 1;
4598     };
4599 
4600   struct
4601     {
4602     unsigned SSPM               : 4;
4603     unsigned                    : 4;
4604     };
4605   } __SSPCON1bits_t;
4606 
4607 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4608 
4609 #define _SSPCON1_SSPM0          0x01
4610 #define _SSPCON1_SSPM1          0x02
4611 #define _SSPCON1_SSPM2          0x04
4612 #define _SSPCON1_SSPM3          0x08
4613 #define _SSPCON1_CKP            0x10
4614 #define _SSPCON1_SSPEN          0x20
4615 #define _SSPCON1_SSPOV          0x40
4616 #define _SSPCON1_WCOL           0x80
4617 
4618 //==============================================================================
4619 
4620 
4621 //==============================================================================
4622 //        SSP1STAT Bits
4623 
4624 extern __at(0x0FC7) __sfr SSP1STAT;
4625 
4626 typedef union
4627   {
4628   struct
4629     {
4630     unsigned BF                 : 1;
4631     unsigned UA                 : 1;
4632     unsigned R_NOT_W            : 1;
4633     unsigned S                  : 1;
4634     unsigned P                  : 1;
4635     unsigned D_NOT_A            : 1;
4636     unsigned CKE                : 1;
4637     unsigned SMP                : 1;
4638     };
4639 
4640   struct
4641     {
4642     unsigned                    : 1;
4643     unsigned                    : 1;
4644     unsigned R_W                : 1;
4645     unsigned I2C_START          : 1;
4646     unsigned I2C_STOP           : 1;
4647     unsigned D_A                : 1;
4648     unsigned                    : 1;
4649     unsigned                    : 1;
4650     };
4651 
4652   struct
4653     {
4654     unsigned                    : 1;
4655     unsigned                    : 1;
4656     unsigned I2C_READ           : 1;
4657     unsigned                    : 1;
4658     unsigned                    : 1;
4659     unsigned I2C_DAT            : 1;
4660     unsigned                    : 1;
4661     unsigned                    : 1;
4662     };
4663 
4664   struct
4665     {
4666     unsigned                    : 1;
4667     unsigned                    : 1;
4668     unsigned NOT_W              : 1;
4669     unsigned                    : 1;
4670     unsigned                    : 1;
4671     unsigned NOT_A              : 1;
4672     unsigned                    : 1;
4673     unsigned                    : 1;
4674     };
4675 
4676   struct
4677     {
4678     unsigned                    : 1;
4679     unsigned                    : 1;
4680     unsigned NOT_WRITE          : 1;
4681     unsigned                    : 1;
4682     unsigned                    : 1;
4683     unsigned NOT_ADDRESS        : 1;
4684     unsigned                    : 1;
4685     unsigned                    : 1;
4686     };
4687 
4688   struct
4689     {
4690     unsigned                    : 1;
4691     unsigned                    : 1;
4692     unsigned READ_WRITE         : 1;
4693     unsigned                    : 1;
4694     unsigned                    : 1;
4695     unsigned DATA_ADDRESS       : 1;
4696     unsigned                    : 1;
4697     unsigned                    : 1;
4698     };
4699 
4700   struct
4701     {
4702     unsigned                    : 1;
4703     unsigned                    : 1;
4704     unsigned R                  : 1;
4705     unsigned                    : 1;
4706     unsigned                    : 1;
4707     unsigned D                  : 1;
4708     unsigned                    : 1;
4709     unsigned                    : 1;
4710     };
4711   } __SSP1STATbits_t;
4712 
4713 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4714 
4715 #define _BF                     0x01
4716 #define _UA                     0x02
4717 #define _R_NOT_W                0x04
4718 #define _R_W                    0x04
4719 #define _I2C_READ               0x04
4720 #define _NOT_W                  0x04
4721 #define _NOT_WRITE              0x04
4722 #define _READ_WRITE             0x04
4723 #define _R                      0x04
4724 #define _S                      0x08
4725 #define _I2C_START              0x08
4726 #define _P                      0x10
4727 #define _I2C_STOP               0x10
4728 #define _D_NOT_A                0x20
4729 #define _D_A                    0x20
4730 #define _I2C_DAT                0x20
4731 #define _NOT_A                  0x20
4732 #define _NOT_ADDRESS            0x20
4733 #define _DATA_ADDRESS           0x20
4734 #define _D                      0x20
4735 #define _CKE                    0x40
4736 #define _SMP                    0x80
4737 
4738 //==============================================================================
4739 
4740 
4741 //==============================================================================
4742 //        SSPSTAT Bits
4743 
4744 extern __at(0x0FC7) __sfr SSPSTAT;
4745 
4746 typedef union
4747   {
4748   struct
4749     {
4750     unsigned BF                 : 1;
4751     unsigned UA                 : 1;
4752     unsigned R_NOT_W            : 1;
4753     unsigned S                  : 1;
4754     unsigned P                  : 1;
4755     unsigned D_NOT_A            : 1;
4756     unsigned CKE                : 1;
4757     unsigned SMP                : 1;
4758     };
4759 
4760   struct
4761     {
4762     unsigned                    : 1;
4763     unsigned                    : 1;
4764     unsigned R_W                : 1;
4765     unsigned I2C_START          : 1;
4766     unsigned I2C_STOP           : 1;
4767     unsigned D_A                : 1;
4768     unsigned                    : 1;
4769     unsigned                    : 1;
4770     };
4771 
4772   struct
4773     {
4774     unsigned                    : 1;
4775     unsigned                    : 1;
4776     unsigned I2C_READ           : 1;
4777     unsigned                    : 1;
4778     unsigned                    : 1;
4779     unsigned I2C_DAT            : 1;
4780     unsigned                    : 1;
4781     unsigned                    : 1;
4782     };
4783 
4784   struct
4785     {
4786     unsigned                    : 1;
4787     unsigned                    : 1;
4788     unsigned NOT_W              : 1;
4789     unsigned                    : 1;
4790     unsigned                    : 1;
4791     unsigned NOT_A              : 1;
4792     unsigned                    : 1;
4793     unsigned                    : 1;
4794     };
4795 
4796   struct
4797     {
4798     unsigned                    : 1;
4799     unsigned                    : 1;
4800     unsigned NOT_WRITE          : 1;
4801     unsigned                    : 1;
4802     unsigned                    : 1;
4803     unsigned NOT_ADDRESS        : 1;
4804     unsigned                    : 1;
4805     unsigned                    : 1;
4806     };
4807 
4808   struct
4809     {
4810     unsigned                    : 1;
4811     unsigned                    : 1;
4812     unsigned READ_WRITE         : 1;
4813     unsigned                    : 1;
4814     unsigned                    : 1;
4815     unsigned DATA_ADDRESS       : 1;
4816     unsigned                    : 1;
4817     unsigned                    : 1;
4818     };
4819 
4820   struct
4821     {
4822     unsigned                    : 1;
4823     unsigned                    : 1;
4824     unsigned R                  : 1;
4825     unsigned                    : 1;
4826     unsigned                    : 1;
4827     unsigned D                  : 1;
4828     unsigned                    : 1;
4829     unsigned                    : 1;
4830     };
4831   } __SSPSTATbits_t;
4832 
4833 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
4834 
4835 #define _SSPSTAT_BF             0x01
4836 #define _SSPSTAT_UA             0x02
4837 #define _SSPSTAT_R_NOT_W        0x04
4838 #define _SSPSTAT_R_W            0x04
4839 #define _SSPSTAT_I2C_READ       0x04
4840 #define _SSPSTAT_NOT_W          0x04
4841 #define _SSPSTAT_NOT_WRITE      0x04
4842 #define _SSPSTAT_READ_WRITE     0x04
4843 #define _SSPSTAT_R              0x04
4844 #define _SSPSTAT_S              0x08
4845 #define _SSPSTAT_I2C_START      0x08
4846 #define _SSPSTAT_P              0x10
4847 #define _SSPSTAT_I2C_STOP       0x10
4848 #define _SSPSTAT_D_NOT_A        0x20
4849 #define _SSPSTAT_D_A            0x20
4850 #define _SSPSTAT_I2C_DAT        0x20
4851 #define _SSPSTAT_NOT_A          0x20
4852 #define _SSPSTAT_NOT_ADDRESS    0x20
4853 #define _SSPSTAT_DATA_ADDRESS   0x20
4854 #define _SSPSTAT_D              0x20
4855 #define _SSPSTAT_CKE            0x40
4856 #define _SSPSTAT_SMP            0x80
4857 
4858 //==============================================================================
4859 
4860 extern __at(0x0FC8) __sfr SSP1ADD;
4861 extern __at(0x0FC8) __sfr SSPADD;
4862 extern __at(0x0FC9) __sfr SSP1BUF;
4863 extern __at(0x0FC9) __sfr SSPBUF;
4864 
4865 //==============================================================================
4866 //        T2CON Bits
4867 
4868 extern __at(0x0FCA) __sfr T2CON;
4869 
4870 typedef union
4871   {
4872   struct
4873     {
4874     unsigned T2CKPS0            : 1;
4875     unsigned T2CKPS1            : 1;
4876     unsigned TMR2ON             : 1;
4877     unsigned T2OUTPS0           : 1;
4878     unsigned T2OUTPS1           : 1;
4879     unsigned T2OUTPS2           : 1;
4880     unsigned T2OUTPS3           : 1;
4881     unsigned                    : 1;
4882     };
4883 
4884   struct
4885     {
4886     unsigned T2CKPS             : 2;
4887     unsigned                    : 6;
4888     };
4889 
4890   struct
4891     {
4892     unsigned                    : 3;
4893     unsigned T2OUTPS            : 4;
4894     unsigned                    : 1;
4895     };
4896   } __T2CONbits_t;
4897 
4898 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
4899 
4900 #define _T2CKPS0                0x01
4901 #define _T2CKPS1                0x02
4902 #define _TMR2ON                 0x04
4903 #define _T2OUTPS0               0x08
4904 #define _T2OUTPS1               0x10
4905 #define _T2OUTPS2               0x20
4906 #define _T2OUTPS3               0x40
4907 
4908 //==============================================================================
4909 
4910 extern __at(0x0FCB) __sfr PR2;
4911 extern __at(0x0FCC) __sfr TMR2;
4912 
4913 //==============================================================================
4914 //        T1CON Bits
4915 
4916 extern __at(0x0FCD) __sfr T1CON;
4917 
4918 typedef union
4919   {
4920   struct
4921     {
4922     unsigned TMR1ON             : 1;
4923     unsigned TMR1CS             : 1;
4924     unsigned NOT_T1SYNC         : 1;
4925     unsigned T1OSCEN            : 1;
4926     unsigned T1CKPS0            : 1;
4927     unsigned T1CKPS1            : 1;
4928     unsigned T1RUN              : 1;
4929     unsigned RD16               : 1;
4930     };
4931 
4932   struct
4933     {
4934     unsigned                    : 1;
4935     unsigned                    : 1;
4936     unsigned T1SYNC             : 1;
4937     unsigned                    : 1;
4938     unsigned                    : 1;
4939     unsigned                    : 1;
4940     unsigned                    : 1;
4941     unsigned                    : 1;
4942     };
4943 
4944   struct
4945     {
4946     unsigned                    : 1;
4947     unsigned                    : 1;
4948     unsigned T1INSYNC           : 1;
4949     unsigned                    : 1;
4950     unsigned                    : 1;
4951     unsigned                    : 1;
4952     unsigned                    : 1;
4953     unsigned                    : 1;
4954     };
4955 
4956   struct
4957     {
4958     unsigned                    : 4;
4959     unsigned T1CKPS             : 2;
4960     unsigned                    : 2;
4961     };
4962   } __T1CONbits_t;
4963 
4964 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
4965 
4966 #define _TMR1ON                 0x01
4967 #define _TMR1CS                 0x02
4968 #define _NOT_T1SYNC             0x04
4969 #define _T1SYNC                 0x04
4970 #define _T1INSYNC               0x04
4971 #define _T1OSCEN                0x08
4972 #define _T1CKPS0                0x10
4973 #define _T1CKPS1                0x20
4974 #define _T1RUN                  0x40
4975 #define _RD16                   0x80
4976 
4977 //==============================================================================
4978 
4979 extern __at(0x0FCE) __sfr TMR1;
4980 extern __at(0x0FCE) __sfr TMR1L;
4981 extern __at(0x0FCF) __sfr TMR1H;
4982 
4983 //==============================================================================
4984 //        RCON Bits
4985 
4986 extern __at(0x0FD0) __sfr RCON;
4987 
4988 typedef union
4989   {
4990   struct
4991     {
4992     unsigned NOT_BOR            : 1;
4993     unsigned NOT_POR            : 1;
4994     unsigned NOT_PD             : 1;
4995     unsigned NOT_TO             : 1;
4996     unsigned NOT_RI             : 1;
4997     unsigned                    : 1;
4998     unsigned SBOREN             : 1;
4999     unsigned IPEN               : 1;
5000     };
5001 
5002   struct
5003     {
5004     unsigned BOR                : 1;
5005     unsigned POR                : 1;
5006     unsigned PD                 : 1;
5007     unsigned TO                 : 1;
5008     unsigned RI                 : 1;
5009     unsigned                    : 1;
5010     unsigned                    : 1;
5011     unsigned                    : 1;
5012     };
5013   } __RCONbits_t;
5014 
5015 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5016 
5017 #define _NOT_BOR                0x01
5018 #define _BOR                    0x01
5019 #define _NOT_POR                0x02
5020 #define _POR                    0x02
5021 #define _NOT_PD                 0x04
5022 #define _PD                     0x04
5023 #define _NOT_TO                 0x08
5024 #define _TO                     0x08
5025 #define _NOT_RI                 0x10
5026 #define _RI                     0x10
5027 #define _SBOREN                 0x40
5028 #define _IPEN                   0x80
5029 
5030 //==============================================================================
5031 
5032 
5033 //==============================================================================
5034 //        WDTCON Bits
5035 
5036 extern __at(0x0FD1) __sfr WDTCON;
5037 
5038 typedef union
5039   {
5040   struct
5041     {
5042     unsigned SWDTEN             : 1;
5043     unsigned                    : 1;
5044     unsigned                    : 1;
5045     unsigned                    : 1;
5046     unsigned                    : 1;
5047     unsigned                    : 1;
5048     unsigned                    : 1;
5049     unsigned                    : 1;
5050     };
5051 
5052   struct
5053     {
5054     unsigned SWDTE              : 1;
5055     unsigned                    : 1;
5056     unsigned                    : 1;
5057     unsigned                    : 1;
5058     unsigned                    : 1;
5059     unsigned                    : 1;
5060     unsigned                    : 1;
5061     unsigned                    : 1;
5062     };
5063   } __WDTCONbits_t;
5064 
5065 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5066 
5067 #define _SWDTEN                 0x01
5068 #define _SWDTE                  0x01
5069 
5070 //==============================================================================
5071 
5072 
5073 //==============================================================================
5074 //        HLVDCON Bits
5075 
5076 extern __at(0x0FD2) __sfr HLVDCON;
5077 
5078 typedef union
5079   {
5080   struct
5081     {
5082     unsigned HLVDL0             : 1;
5083     unsigned HLVDL1             : 1;
5084     unsigned HLVDL2             : 1;
5085     unsigned HLVDL3             : 1;
5086     unsigned HLVDEN             : 1;
5087     unsigned IRVST              : 1;
5088     unsigned                    : 1;
5089     unsigned VDIRMAG            : 1;
5090     };
5091 
5092   struct
5093     {
5094     unsigned LVV0               : 1;
5095     unsigned LVV1               : 1;
5096     unsigned LVV2               : 1;
5097     unsigned LVV3               : 1;
5098     unsigned LVDEN              : 1;
5099     unsigned IVRST              : 1;
5100     unsigned                    : 1;
5101     unsigned                    : 1;
5102     };
5103 
5104   struct
5105     {
5106     unsigned LVDL0              : 1;
5107     unsigned LVDL1              : 1;
5108     unsigned LVDL2              : 1;
5109     unsigned LVDL3              : 1;
5110     unsigned                    : 1;
5111     unsigned BGST               : 1;
5112     unsigned                    : 1;
5113     unsigned                    : 1;
5114     };
5115 
5116   struct
5117     {
5118     unsigned LVV                : 4;
5119     unsigned                    : 4;
5120     };
5121 
5122   struct
5123     {
5124     unsigned LVDL               : 4;
5125     unsigned                    : 4;
5126     };
5127 
5128   struct
5129     {
5130     unsigned HLVDL              : 4;
5131     unsigned                    : 4;
5132     };
5133   } __HLVDCONbits_t;
5134 
5135 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
5136 
5137 #define _HLVDL0                 0x01
5138 #define _LVV0                   0x01
5139 #define _LVDL0                  0x01
5140 #define _HLVDL1                 0x02
5141 #define _LVV1                   0x02
5142 #define _LVDL1                  0x02
5143 #define _HLVDL2                 0x04
5144 #define _LVV2                   0x04
5145 #define _LVDL2                  0x04
5146 #define _HLVDL3                 0x08
5147 #define _LVV3                   0x08
5148 #define _LVDL3                  0x08
5149 #define _HLVDEN                 0x10
5150 #define _LVDEN                  0x10
5151 #define _IRVST                  0x20
5152 #define _IVRST                  0x20
5153 #define _BGST                   0x20
5154 #define _VDIRMAG                0x80
5155 
5156 //==============================================================================
5157 
5158 
5159 //==============================================================================
5160 //        LVDCON Bits
5161 
5162 extern __at(0x0FD2) __sfr LVDCON;
5163 
5164 typedef union
5165   {
5166   struct
5167     {
5168     unsigned HLVDL0             : 1;
5169     unsigned HLVDL1             : 1;
5170     unsigned HLVDL2             : 1;
5171     unsigned HLVDL3             : 1;
5172     unsigned HLVDEN             : 1;
5173     unsigned IRVST              : 1;
5174     unsigned                    : 1;
5175     unsigned VDIRMAG            : 1;
5176     };
5177 
5178   struct
5179     {
5180     unsigned LVV0               : 1;
5181     unsigned LVV1               : 1;
5182     unsigned LVV2               : 1;
5183     unsigned LVV3               : 1;
5184     unsigned LVDEN              : 1;
5185     unsigned IVRST              : 1;
5186     unsigned                    : 1;
5187     unsigned                    : 1;
5188     };
5189 
5190   struct
5191     {
5192     unsigned LVDL0              : 1;
5193     unsigned LVDL1              : 1;
5194     unsigned LVDL2              : 1;
5195     unsigned LVDL3              : 1;
5196     unsigned                    : 1;
5197     unsigned BGST               : 1;
5198     unsigned                    : 1;
5199     unsigned                    : 1;
5200     };
5201 
5202   struct
5203     {
5204     unsigned LVV                : 4;
5205     unsigned                    : 4;
5206     };
5207 
5208   struct
5209     {
5210     unsigned HLVDL              : 4;
5211     unsigned                    : 4;
5212     };
5213 
5214   struct
5215     {
5216     unsigned LVDL               : 4;
5217     unsigned                    : 4;
5218     };
5219   } __LVDCONbits_t;
5220 
5221 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
5222 
5223 #define _LVDCON_HLVDL0          0x01
5224 #define _LVDCON_LVV0            0x01
5225 #define _LVDCON_LVDL0           0x01
5226 #define _LVDCON_HLVDL1          0x02
5227 #define _LVDCON_LVV1            0x02
5228 #define _LVDCON_LVDL1           0x02
5229 #define _LVDCON_HLVDL2          0x04
5230 #define _LVDCON_LVV2            0x04
5231 #define _LVDCON_LVDL2           0x04
5232 #define _LVDCON_HLVDL3          0x08
5233 #define _LVDCON_LVV3            0x08
5234 #define _LVDCON_LVDL3           0x08
5235 #define _LVDCON_HLVDEN          0x10
5236 #define _LVDCON_LVDEN           0x10
5237 #define _LVDCON_IRVST           0x20
5238 #define _LVDCON_IVRST           0x20
5239 #define _LVDCON_BGST            0x20
5240 #define _LVDCON_VDIRMAG         0x80
5241 
5242 //==============================================================================
5243 
5244 
5245 //==============================================================================
5246 //        OSCCON Bits
5247 
5248 extern __at(0x0FD3) __sfr OSCCON;
5249 
5250 typedef union
5251   {
5252   struct
5253     {
5254     unsigned SCS0               : 1;
5255     unsigned SCS1               : 1;
5256     unsigned IOFS               : 1;
5257     unsigned OSTS               : 1;
5258     unsigned IRCF0              : 1;
5259     unsigned IRCF1              : 1;
5260     unsigned IRCF2              : 1;
5261     unsigned IDLEN              : 1;
5262     };
5263 
5264   struct
5265     {
5266     unsigned                    : 1;
5267     unsigned                    : 1;
5268     unsigned FLTS               : 1;
5269     unsigned                    : 1;
5270     unsigned                    : 1;
5271     unsigned                    : 1;
5272     unsigned                    : 1;
5273     unsigned                    : 1;
5274     };
5275 
5276   struct
5277     {
5278     unsigned SCS                : 2;
5279     unsigned                    : 6;
5280     };
5281 
5282   struct
5283     {
5284     unsigned                    : 4;
5285     unsigned IRCF               : 3;
5286     unsigned                    : 1;
5287     };
5288   } __OSCCONbits_t;
5289 
5290 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5291 
5292 #define _SCS0                   0x01
5293 #define _SCS1                   0x02
5294 #define _IOFS                   0x04
5295 #define _FLTS                   0x04
5296 #define _OSTS                   0x08
5297 #define _IRCF0                  0x10
5298 #define _IRCF1                  0x20
5299 #define _IRCF2                  0x40
5300 #define _IDLEN                  0x80
5301 
5302 //==============================================================================
5303 
5304 
5305 //==============================================================================
5306 //        T0CON Bits
5307 
5308 extern __at(0x0FD5) __sfr T0CON;
5309 
5310 typedef union
5311   {
5312   struct
5313     {
5314     unsigned T0PS0              : 1;
5315     unsigned T0PS1              : 1;
5316     unsigned T0PS2              : 1;
5317     unsigned PSA                : 1;
5318     unsigned T0SE               : 1;
5319     unsigned T0CS               : 1;
5320     unsigned T08BIT             : 1;
5321     unsigned TMR0ON             : 1;
5322     };
5323 
5324   struct
5325     {
5326     unsigned                    : 1;
5327     unsigned                    : 1;
5328     unsigned                    : 1;
5329     unsigned T0PS3              : 1;
5330     unsigned                    : 1;
5331     unsigned                    : 1;
5332     unsigned                    : 1;
5333     unsigned                    : 1;
5334     };
5335 
5336   struct
5337     {
5338     unsigned T0PS               : 4;
5339     unsigned                    : 4;
5340     };
5341   } __T0CONbits_t;
5342 
5343 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5344 
5345 #define _T0PS0                  0x01
5346 #define _T0PS1                  0x02
5347 #define _T0PS2                  0x04
5348 #define _PSA                    0x08
5349 #define _T0PS3                  0x08
5350 #define _T0SE                   0x10
5351 #define _T0CS                   0x20
5352 #define _T08BIT                 0x40
5353 #define _TMR0ON                 0x80
5354 
5355 //==============================================================================
5356 
5357 extern __at(0x0FD6) __sfr TMR0;
5358 extern __at(0x0FD6) __sfr TMR0L;
5359 extern __at(0x0FD7) __sfr TMR0H;
5360 
5361 //==============================================================================
5362 //        STATUS Bits
5363 
5364 extern __at(0x0FD8) __sfr STATUS;
5365 
5366 typedef struct
5367   {
5368   unsigned C                    : 1;
5369   unsigned DC                   : 1;
5370   unsigned Z                    : 1;
5371   unsigned OV                   : 1;
5372   unsigned N                    : 1;
5373   unsigned                      : 1;
5374   unsigned                      : 1;
5375   unsigned                      : 1;
5376   } __STATUSbits_t;
5377 
5378 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5379 
5380 #define _C                      0x01
5381 #define _DC                     0x02
5382 #define _Z                      0x04
5383 #define _OV                     0x08
5384 #define _N                      0x10
5385 
5386 //==============================================================================
5387 
5388 extern __at(0x0FD9) __sfr FSR2L;
5389 extern __at(0x0FDA) __sfr FSR2H;
5390 extern __at(0x0FDB) __sfr PLUSW2;
5391 extern __at(0x0FDC) __sfr PREINC2;
5392 extern __at(0x0FDD) __sfr POSTDEC2;
5393 extern __at(0x0FDE) __sfr POSTINC2;
5394 extern __at(0x0FDF) __sfr INDF2;
5395 extern __at(0x0FE0) __sfr BSR;
5396 extern __at(0x0FE1) __sfr FSR1L;
5397 extern __at(0x0FE2) __sfr FSR1H;
5398 extern __at(0x0FE3) __sfr PLUSW1;
5399 extern __at(0x0FE4) __sfr PREINC1;
5400 extern __at(0x0FE5) __sfr POSTDEC1;
5401 extern __at(0x0FE6) __sfr POSTINC1;
5402 extern __at(0x0FE7) __sfr INDF1;
5403 extern __at(0x0FE8) __sfr WREG;
5404 extern __at(0x0FE9) __sfr FSR0L;
5405 extern __at(0x0FEA) __sfr FSR0H;
5406 extern __at(0x0FEB) __sfr PLUSW0;
5407 extern __at(0x0FEC) __sfr PREINC0;
5408 extern __at(0x0FED) __sfr POSTDEC0;
5409 extern __at(0x0FEE) __sfr POSTINC0;
5410 extern __at(0x0FEF) __sfr INDF0;
5411 
5412 //==============================================================================
5413 //        INTCON3 Bits
5414 
5415 extern __at(0x0FF0) __sfr INTCON3;
5416 
5417 typedef union
5418   {
5419   struct
5420     {
5421     unsigned INT1IF             : 1;
5422     unsigned INT2IF             : 1;
5423     unsigned INT3IF             : 1;
5424     unsigned INT1IE             : 1;
5425     unsigned INT2IE             : 1;
5426     unsigned INT3IE             : 1;
5427     unsigned INT1IP             : 1;
5428     unsigned INT2IP             : 1;
5429     };
5430 
5431   struct
5432     {
5433     unsigned INT1F              : 1;
5434     unsigned INT2F              : 1;
5435     unsigned INT3F              : 1;
5436     unsigned INT1E              : 1;
5437     unsigned INT2E              : 1;
5438     unsigned INT3E              : 1;
5439     unsigned INT1P              : 1;
5440     unsigned INT2P              : 1;
5441     };
5442   } __INTCON3bits_t;
5443 
5444 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5445 
5446 #define _INT1IF                 0x01
5447 #define _INT1F                  0x01
5448 #define _INT2IF                 0x02
5449 #define _INT2F                  0x02
5450 #define _INT3IF                 0x04
5451 #define _INT3F                  0x04
5452 #define _INT1IE                 0x08
5453 #define _INT1E                  0x08
5454 #define _INT2IE                 0x10
5455 #define _INT2E                  0x10
5456 #define _INT3IE                 0x20
5457 #define _INT3E                  0x20
5458 #define _INT1IP                 0x40
5459 #define _INT1P                  0x40
5460 #define _INT2IP                 0x80
5461 #define _INT2P                  0x80
5462 
5463 //==============================================================================
5464 
5465 
5466 //==============================================================================
5467 //        INTCON2 Bits
5468 
5469 extern __at(0x0FF1) __sfr INTCON2;
5470 
5471 typedef union
5472   {
5473   struct
5474     {
5475     unsigned RBIP               : 1;
5476     unsigned INT3IP             : 1;
5477     unsigned TMR0IP             : 1;
5478     unsigned INTEDG3            : 1;
5479     unsigned INTEDG2            : 1;
5480     unsigned INTEDG1            : 1;
5481     unsigned INTEDG0            : 1;
5482     unsigned NOT_RBPU           : 1;
5483     };
5484 
5485   struct
5486     {
5487     unsigned                    : 1;
5488     unsigned INT3P              : 1;
5489     unsigned T0IP               : 1;
5490     unsigned                    : 1;
5491     unsigned                    : 1;
5492     unsigned                    : 1;
5493     unsigned                    : 1;
5494     unsigned RBPU               : 1;
5495     };
5496   } __INTCON2bits_t;
5497 
5498 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5499 
5500 #define _RBIP                   0x01
5501 #define _INT3IP                 0x02
5502 #define _INT3P                  0x02
5503 #define _TMR0IP                 0x04
5504 #define _T0IP                   0x04
5505 #define _INTEDG3                0x08
5506 #define _INTEDG2                0x10
5507 #define _INTEDG1                0x20
5508 #define _INTEDG0                0x40
5509 #define _NOT_RBPU               0x80
5510 #define _RBPU                   0x80
5511 
5512 //==============================================================================
5513 
5514 
5515 //==============================================================================
5516 //        INTCON Bits
5517 
5518 extern __at(0x0FF2) __sfr INTCON;
5519 
5520 typedef union
5521   {
5522   struct
5523     {
5524     unsigned RBIF               : 1;
5525     unsigned INT0IF             : 1;
5526     unsigned TMR0IF             : 1;
5527     unsigned RBIE               : 1;
5528     unsigned INT0IE             : 1;
5529     unsigned TMR0IE             : 1;
5530     unsigned PEIE_GIEL          : 1;
5531     unsigned GIE_GIEH           : 1;
5532     };
5533 
5534   struct
5535     {
5536     unsigned                    : 1;
5537     unsigned INT0F              : 1;
5538     unsigned T0IF               : 1;
5539     unsigned                    : 1;
5540     unsigned INT0E              : 1;
5541     unsigned T0IE               : 1;
5542     unsigned PEIE               : 1;
5543     unsigned GIE                : 1;
5544     };
5545 
5546   struct
5547     {
5548     unsigned                    : 1;
5549     unsigned                    : 1;
5550     unsigned                    : 1;
5551     unsigned                    : 1;
5552     unsigned                    : 1;
5553     unsigned                    : 1;
5554     unsigned GIEL               : 1;
5555     unsigned GIEH               : 1;
5556     };
5557   } __INTCONbits_t;
5558 
5559 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5560 
5561 #define _RBIF                   0x01
5562 #define _INT0IF                 0x02
5563 #define _INT0F                  0x02
5564 #define _TMR0IF                 0x04
5565 #define _T0IF                   0x04
5566 #define _RBIE                   0x08
5567 #define _INT0IE                 0x10
5568 #define _INT0E                  0x10
5569 #define _TMR0IE                 0x20
5570 #define _T0IE                   0x20
5571 #define _PEIE_GIEL              0x40
5572 #define _PEIE                   0x40
5573 #define _GIEL                   0x40
5574 #define _GIE_GIEH               0x80
5575 #define _GIE                    0x80
5576 #define _GIEH                   0x80
5577 
5578 //==============================================================================
5579 
5580 extern __at(0x0FF3) __sfr PROD;
5581 extern __at(0x0FF3) __sfr PRODL;
5582 extern __at(0x0FF4) __sfr PRODH;
5583 extern __at(0x0FF5) __sfr TABLAT;
5584 extern __at(0x0FF6) __sfr TBLPTR;
5585 extern __at(0x0FF6) __sfr TBLPTRL;
5586 extern __at(0x0FF7) __sfr TBLPTRH;
5587 extern __at(0x0FF8) __sfr TBLPTRU;
5588 extern __at(0x0FF9) __sfr PC;
5589 extern __at(0x0FF9) __sfr PCL;
5590 extern __at(0x0FFA) __sfr PCLATH;
5591 extern __at(0x0FFB) __sfr PCLATU;
5592 
5593 //==============================================================================
5594 //        STKPTR Bits
5595 
5596 extern __at(0x0FFC) __sfr STKPTR;
5597 
5598 typedef union
5599   {
5600   struct
5601     {
5602     unsigned STKPTR0            : 1;
5603     unsigned STKPTR1            : 1;
5604     unsigned STKPTR2            : 1;
5605     unsigned STKPTR3            : 1;
5606     unsigned STKPTR4            : 1;
5607     unsigned                    : 1;
5608     unsigned STKUNF             : 1;
5609     unsigned STKFUL             : 1;
5610     };
5611 
5612   struct
5613     {
5614     unsigned SP0                : 1;
5615     unsigned SP1                : 1;
5616     unsigned SP2                : 1;
5617     unsigned SP3                : 1;
5618     unsigned SP4                : 1;
5619     unsigned                    : 1;
5620     unsigned                    : 1;
5621     unsigned STKOVF             : 1;
5622     };
5623 
5624   struct
5625     {
5626     unsigned SP                 : 5;
5627     unsigned                    : 3;
5628     };
5629 
5630   struct
5631     {
5632     unsigned STKPTR             : 5;
5633     unsigned                    : 3;
5634     };
5635   } __STKPTRbits_t;
5636 
5637 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5638 
5639 #define _STKPTR0                0x01
5640 #define _SP0                    0x01
5641 #define _STKPTR1                0x02
5642 #define _SP1                    0x02
5643 #define _STKPTR2                0x04
5644 #define _SP2                    0x04
5645 #define _STKPTR3                0x08
5646 #define _SP3                    0x08
5647 #define _STKPTR4                0x10
5648 #define _SP4                    0x10
5649 #define _STKUNF                 0x40
5650 #define _STKFUL                 0x80
5651 #define _STKOVF                 0x80
5652 
5653 //==============================================================================
5654 
5655 extern __at(0x0FFD) __sfr TOS;
5656 extern __at(0x0FFD) __sfr TOSL;
5657 extern __at(0x0FFE) __sfr TOSH;
5658 extern __at(0x0FFF) __sfr TOSU;
5659 
5660 //==============================================================================
5661 //
5662 //        Configuration Bits
5663 //
5664 //==============================================================================
5665 
5666 #define __CONFIG1H              0x300001
5667 #define __CONFIG2L              0x300002
5668 #define __CONFIG2H              0x300003
5669 #define __CONFIG3H              0x300005
5670 #define __CONFIG4L              0x300006
5671 #define __CONFIG5L              0x300008
5672 #define __CONFIG5H              0x300009
5673 #define __CONFIG6L              0x30000A
5674 #define __CONFIG6H              0x30000B
5675 #define __CONFIG7L              0x30000C
5676 #define __CONFIG7H              0x30000D
5677 
5678 //----------------------------- CONFIG1H Options -------------------------------
5679 
5680 #define _OSC_LP_1H              0xF0    // LP oscillator.
5681 #define _OSC_XT_1H              0xF1    // XT oscillator.
5682 #define _OSC_HS_1H              0xF2    // HS oscillator.
5683 #define _OSC_RC_1H              0xF3    // External RC oscillator, CLKO function on RA6.
5684 #define _OSC_EC_1H              0xF4    // EC oscillator, CLKO function on RA6.
5685 #define _OSC_ECIO6_1H           0xF5    // EC oscillator, port function on RA6.
5686 #define _OSC_HSPLL_1H           0xF6    // HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1).
5687 #define _OSC_RCIO6_1H           0xF7    // External RC oscillator, port function on RA6.
5688 #define _OSC_INTIO67_1H         0xF8    // Internal oscillator block, port function on RA6 and RA7.
5689 #define _OSC_INTIO7_1H          0xF9    // Internal oscillator block, CLKO function on RA6, port function on RA7.
5690 #define _FCMEN_OFF_1H           0xBF    // Fail-Safe Clock Monitor disabled.
5691 #define _FCMEN_ON_1H            0xFF    // Fail-Safe Clock Monitor enabled.
5692 #define _IESO_OFF_1H            0x7F    // Two-Speed Start-up disabled.
5693 #define _IESO_ON_1H             0xFF    // Two-Speed Start-up enabled.
5694 
5695 //----------------------------- CONFIG2L Options -------------------------------
5696 
5697 #define _PWRT_ON_2L             0xFE    // PWRT enabled.
5698 #define _PWRT_OFF_2L            0xFF    // PWRT disabled.
5699 #define _BOREN_OFF_2L           0xF9    // Brown-out Reset disabled in hardware and software.
5700 #define _BOREN_ON_2L            0xFB    // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
5701 #define _BOREN_NOSLP_2L         0xFD    // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
5702 #define _BOREN_SBORDIS_2L       0xFF    // Brown-out Reset enabled in hardware only (SBOREN is disabled).
5703 #define _BORV_0_2L              0xE7    // Maximum setting.
5704 #define _BORV_1_2L              0xEF
5705 #define _BORV_2_2L              0xF7
5706 #define _BORV_3_2L              0xFF    // Minimum setting.
5707 
5708 //----------------------------- CONFIG2H Options -------------------------------
5709 
5710 #define _WDT_OFF_2H             0xFE    // WDT disabled (control is placed on the SWDTEN bit).
5711 #define _WDT_ON_2H              0xFF    // WDT enabled.
5712 #define _WDTPS_1_2H             0xE1    // 1:1.
5713 #define _WDTPS_2_2H             0xE3    // 1:2.
5714 #define _WDTPS_4_2H             0xE5    // 1:4.
5715 #define _WDTPS_8_2H             0xE7    // 1:8.
5716 #define _WDTPS_16_2H            0xE9    // 1:16.
5717 #define _WDTPS_32_2H            0xEB    // 1:32.
5718 #define _WDTPS_64_2H            0xED    // 1:64.
5719 #define _WDTPS_128_2H           0xEF    // 1:128.
5720 #define _WDTPS_256_2H           0xF1    // 1:256.
5721 #define _WDTPS_512_2H           0xF3    // 1:512.
5722 #define _WDTPS_1024_2H          0xF5    // 1:1024.
5723 #define _WDTPS_2048_2H          0xF7    // 1:2048.
5724 #define _WDTPS_4096_2H          0xF9    // 1:4096.
5725 #define _WDTPS_8192_2H          0xFB    // 1:8192.
5726 #define _WDTPS_16384_2H         0xFD    // 1:16384.
5727 #define _WDTPS_32768_2H         0xFF    // 1:32768.
5728 
5729 //----------------------------- CONFIG3H Options -------------------------------
5730 
5731 #define _CCP2MX_PORTE_3H        0xFE    // ECCP2 input/output is multiplexed with RE7.
5732 #define _CCP2MX_PORTC_3H        0xFF    // ECCP2 input/output is multiplexed with RC1.
5733 #define _LPT1OSC_OFF_3H         0xFB    // Timer1 configured for higher power operation.
5734 #define _LPT1OSC_ON_3H          0xFF    // Timer1 configured for low-power operation.
5735 #define _MCLRE_OFF_3H           0x7F    // RG5 input pin enabled; MCLR disabled.
5736 #define _MCLRE_ON_3H            0xFF    // MCLR pin enabled; RG5 input pin disabled.
5737 
5738 //----------------------------- CONFIG4L Options -------------------------------
5739 
5740 #define _STVREN_OFF_4L          0xFE    // Stack full/underflow will not cause Reset.
5741 #define _STVREN_ON_4L           0xFF    // Stack full/underflow will cause Reset.
5742 #define _LVP_OFF_4L             0xFB    // Single-Supply ICSP disabled.
5743 #define _LVP_ON_4L              0xFF    // Single-Supply ICSP enabled.
5744 #define _BBSIZ_BB2K_4L          0xCF    // 1K word (2 Kbytes) Boot Block size.
5745 #define _BBSIZ_BB4K_4L          0xDF    // 2K words (4 Kbytes) Boot Block size.
5746 #define _BBSIZ_BB8K_4L          0xEF    // 4K words (8 Kbytes) Boot Block size.
5747 #define _XINST_OFF_4L           0xBF    // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
5748 #define _XINST_ON_4L            0xFF    // Instruction set extension and Indexed Addressing mode enabled.
5749 #define _DEBUG_ON_4L            0x7F    // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
5750 #define _DEBUG_OFF_4L           0xFF    // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
5751 
5752 //----------------------------- CONFIG5L Options -------------------------------
5753 
5754 #define _CP0_ON_5L              0xFE    // Block 0 (000800, 001000 or 002000-003FFFh) code-protected.
5755 #define _CP0_OFF_5L             0xFF    // Block 0 (000800, 001000 or 002000-003FFFh) not code-protected.
5756 #define _CP1_ON_5L              0xFD    // Block 1 (004000-007FFFh) code-protected.
5757 #define _CP1_OFF_5L             0xFF    // Block 1 (004000-007FFFh) not code-protected.
5758 #define _CP2_ON_5L              0xFB    // Block 2 (008000-00BFFFh) code-protected.
5759 #define _CP2_OFF_5L             0xFF    // Block 2 (008000-00BFFFh) not code-protected.
5760 
5761 //----------------------------- CONFIG5H Options -------------------------------
5762 
5763 #define _CPB_ON_5H              0xBF    // Boot Block (000000-0007FFh) code-protected.
5764 #define _CPB_OFF_5H             0xFF    // Boot Block (000000-0007FFh) not code-protected.
5765 #define _CPD_ON_5H              0x7F    // Data EEPROM code-protected.
5766 #define _CPD_OFF_5H             0xFF    // Data EEPROM not code-protected.
5767 
5768 //----------------------------- CONFIG6L Options -------------------------------
5769 
5770 #define _WRT0_ON_6L             0xFE    // Block 0 (000800, 001000 or 002000-003FFFh) write-protected.
5771 #define _WRT0_OFF_6L            0xFF    // Block 0 (000800, 001000 or 002000-003FFFh) not write-protected.
5772 #define _WRT1_ON_6L             0xFD    // Block 1 (004000-007FFFh) write-protected.
5773 #define _WRT1_OFF_6L            0xFF    // Block 1 (004000-007FFFh) not write-protected.
5774 #define _WRT2_ON_6L             0xFB    // Block 2 (008000-00BFFFh) write-protected.
5775 #define _WRT2_OFF_6L            0xFF    // Block 2 (008000-00BFFFh) not write-protected.
5776 
5777 //----------------------------- CONFIG6H Options -------------------------------
5778 
5779 #define _WRTC_ON_6H             0xDF    // Configuration registers (300000-3000FFh) write-protected.
5780 #define _WRTC_OFF_6H            0xFF    // Configuration registers (300000-3000FFh) not write-protected.
5781 #define _WRTB_ON_6H             0xBF    // Boot Block (000000-007FFF, 000FFF or 001FFFh) write-protected.
5782 #define _WRTB_OFF_6H            0xFF    // Boot Block (000000-007FFF, 000FFF or 001FFFh) not write-protected.
5783 #define _WRTD_ON_6H             0x7F    // Data EEPROM write-protected.
5784 #define _WRTD_OFF_6H            0xFF    // Data EEPROM not write-protected.
5785 
5786 //----------------------------- CONFIG7L Options -------------------------------
5787 
5788 #define _EBTR0_ON_7L            0xFE    // Block 0 (000800, 001000 or 002000-003FFFh) protected from table reads executed in other blocks.
5789 #define _EBTR0_OFF_7L           0xFF    // Block 0 (000800, 001000 or 002000-003FFFh) not protected from table reads executed in other blocks.
5790 #define _EBTR1_ON_7L            0xFD    // Block 1 (004000-007FFFh) protected from table reads executed in other blocks.
5791 #define _EBTR1_OFF_7L           0xFF    // Block 1 (004000-007FFFh) not protected from table reads executed in other blocks.
5792 #define _EBTR2_ON_7L            0xFB    // Block 2 (008000-00BFFFh) protected from table reads executed in other blocks.
5793 #define _EBTR2_OFF_7L           0xFF    // Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks.
5794 
5795 //----------------------------- CONFIG7H Options -------------------------------
5796 
5797 #define _EBTRB_ON_7H            0xBF    // Boot Block (000000-007FFF, 000FFF or 001FFFh) protected from table reads executed in other blocks.
5798 #define _EBTRB_OFF_7H           0xFF    // Boot Block (000000-007FFF, 000FFF or 001FFFh) not protected from table reads executed in other blocks.
5799 
5800 //==============================================================================
5801 
5802 #define __DEVID1                0x3FFFFE
5803 #define __DEVID2                0x3FFFFF
5804 
5805 #define __IDLOC0                0x200000
5806 #define __IDLOC1                0x200001
5807 #define __IDLOC2                0x200002
5808 #define __IDLOC3                0x200003
5809 #define __IDLOC4                0x200004
5810 #define __IDLOC5                0x200005
5811 #define __IDLOC6                0x200006
5812 #define __IDLOC7                0x200007
5813 
5814 #endif // #ifndef __PIC18LF6527_H__
5815