1 /*
2  * This declarations of the PIC18LF8628 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:09 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 __PIC18LF8628_H__
26 #define __PIC18LF8628_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 PSS2AC             : 2;
400     unsigned                    : 4;
401     };
402 
403   struct
404     {
405     unsigned                    : 2;
406     unsigned PSSAC              : 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 PDC                : 7;
481     unsigned                    : 1;
482     };
483 
484   struct
485     {
486     unsigned P3DC               : 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 PSSBD              : 2;
547     unsigned                    : 6;
548     };
549 
550   struct
551     {
552     unsigned PSS3BD             : 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 ECCPAS             : 3;
574     unsigned                    : 1;
575     };
576 
577   struct
578     {
579     unsigned                    : 4;
580     unsigned ECCP3AS            : 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 P1DC               : 7;
991     unsigned                    : 1;
992     };
993 
994   struct
995     {
996     unsigned PDC                : 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 ECCP2              : 1;
1332     unsigned                    : 1;
1333     unsigned                    : 1;
1334     unsigned                    : 1;
1335     unsigned                    : 1;
1336     };
1337 
1338   struct
1339     {
1340     unsigned                    : 1;
1341     unsigned                    : 1;
1342     unsigned                    : 1;
1343     unsigned CCP2               : 1;
1344     unsigned                    : 1;
1345     unsigned                    : 1;
1346     unsigned                    : 1;
1347     unsigned                    : 1;
1348     };
1349 
1350   struct
1351     {
1352     unsigned                    : 1;
1353     unsigned                    : 1;
1354     unsigned                    : 1;
1355     unsigned P2A                : 1;
1356     unsigned                    : 1;
1357     unsigned                    : 1;
1358     unsigned                    : 1;
1359     unsigned                    : 1;
1360     };
1361 
1362   struct
1363     {
1364     unsigned INT                : 4;
1365     unsigned                    : 4;
1366     };
1367 
1368   struct
1369     {
1370     unsigned                    : 4;
1371     unsigned KBI                : 4;
1372     };
1373   } __PORTBbits_t;
1374 
1375 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1376 
1377 #define _PORTB_RB0              0x01
1378 #define _PORTB_INT0             0x01
1379 #define _PORTB_FLT0             0x01
1380 #define _PORTB_RB1              0x02
1381 #define _PORTB_INT1             0x02
1382 #define _PORTB_RB2              0x04
1383 #define _PORTB_INT2             0x04
1384 #define _PORTB_RB3              0x08
1385 #define _PORTB_INT3             0x08
1386 #define _PORTB_ECCP2            0x08
1387 #define _PORTB_CCP2             0x08
1388 #define _PORTB_P2A              0x08
1389 #define _PORTB_RB4              0x10
1390 #define _PORTB_KBI0             0x10
1391 #define _PORTB_RB5              0x20
1392 #define _PORTB_KBI1             0x20
1393 #define _PORTB_RB6              0x40
1394 #define _PORTB_KBI2             0x40
1395 #define _PORTB_RB7              0x80
1396 #define _PORTB_KBI3             0x80
1397 
1398 //==============================================================================
1399 
1400 
1401 //==============================================================================
1402 //        PORTC Bits
1403 
1404 extern __at(0x0F82) __sfr PORTC;
1405 
1406 typedef union
1407   {
1408   struct
1409     {
1410     unsigned RC0                : 1;
1411     unsigned RC1                : 1;
1412     unsigned RC2                : 1;
1413     unsigned RC3                : 1;
1414     unsigned RC4                : 1;
1415     unsigned RC5                : 1;
1416     unsigned RC6                : 1;
1417     unsigned RC7                : 1;
1418     };
1419 
1420   struct
1421     {
1422     unsigned T1OSO              : 1;
1423     unsigned T1OSI              : 1;
1424     unsigned ECCP1              : 1;
1425     unsigned SCK                : 1;
1426     unsigned SDI                : 1;
1427     unsigned SDO                : 1;
1428     unsigned TX                 : 1;
1429     unsigned RX                 : 1;
1430     };
1431 
1432   struct
1433     {
1434     unsigned T13CKI             : 1;
1435     unsigned ECCP2              : 1;
1436     unsigned CCP1               : 1;
1437     unsigned SCL                : 1;
1438     unsigned SDA                : 1;
1439     unsigned SDO1               : 1;
1440     unsigned CK                 : 1;
1441     unsigned DT1                : 1;
1442     };
1443 
1444   struct
1445     {
1446     unsigned                    : 1;
1447     unsigned CCP2               : 1;
1448     unsigned P1A                : 1;
1449     unsigned SCL1               : 1;
1450     unsigned SDA1               : 1;
1451     unsigned                    : 1;
1452     unsigned CK1                : 1;
1453     unsigned RX1                : 1;
1454     };
1455 
1456   struct
1457     {
1458     unsigned                    : 1;
1459     unsigned P2A                : 1;
1460     unsigned                    : 1;
1461     unsigned SCK1               : 1;
1462     unsigned SDI1               : 1;
1463     unsigned                    : 1;
1464     unsigned TX1                : 1;
1465     unsigned                    : 1;
1466     };
1467   } __PORTCbits_t;
1468 
1469 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1470 
1471 #define _PORTC_RC0              0x01
1472 #define _PORTC_T1OSO            0x01
1473 #define _PORTC_T13CKI           0x01
1474 #define _PORTC_RC1              0x02
1475 #define _PORTC_T1OSI            0x02
1476 #define _PORTC_ECCP2            0x02
1477 #define _PORTC_CCP2             0x02
1478 #define _PORTC_P2A              0x02
1479 #define _PORTC_RC2              0x04
1480 #define _PORTC_ECCP1            0x04
1481 #define _PORTC_CCP1             0x04
1482 #define _PORTC_P1A              0x04
1483 #define _PORTC_RC3              0x08
1484 #define _PORTC_SCK              0x08
1485 #define _PORTC_SCL              0x08
1486 #define _PORTC_SCL1             0x08
1487 #define _PORTC_SCK1             0x08
1488 #define _PORTC_RC4              0x10
1489 #define _PORTC_SDI              0x10
1490 #define _PORTC_SDA              0x10
1491 #define _PORTC_SDA1             0x10
1492 #define _PORTC_SDI1             0x10
1493 #define _PORTC_RC5              0x20
1494 #define _PORTC_SDO              0x20
1495 #define _PORTC_SDO1             0x20
1496 #define _PORTC_RC6              0x40
1497 #define _PORTC_TX               0x40
1498 #define _PORTC_CK               0x40
1499 #define _PORTC_CK1              0x40
1500 #define _PORTC_TX1              0x40
1501 #define _PORTC_RC7              0x80
1502 #define _PORTC_RX               0x80
1503 #define _PORTC_DT1              0x80
1504 #define _PORTC_RX1              0x80
1505 
1506 //==============================================================================
1507 
1508 
1509 //==============================================================================
1510 //        PORTD Bits
1511 
1512 extern __at(0x0F83) __sfr PORTD;
1513 
1514 typedef union
1515   {
1516   struct
1517     {
1518     unsigned RD0                : 1;
1519     unsigned RD1                : 1;
1520     unsigned RD2                : 1;
1521     unsigned RD3                : 1;
1522     unsigned RD4                : 1;
1523     unsigned RD5                : 1;
1524     unsigned RD6                : 1;
1525     unsigned RD7                : 1;
1526     };
1527 
1528   struct
1529     {
1530     unsigned PSP0               : 1;
1531     unsigned PSP1               : 1;
1532     unsigned PSP2               : 1;
1533     unsigned PSP3               : 1;
1534     unsigned PSP4               : 1;
1535     unsigned PSP5               : 1;
1536     unsigned PSP6               : 1;
1537     unsigned PSP7               : 1;
1538     };
1539 
1540   struct
1541     {
1542     unsigned AD0                : 1;
1543     unsigned AD1                : 1;
1544     unsigned AD2                : 1;
1545     unsigned AD3                : 1;
1546     unsigned AD4                : 1;
1547     unsigned AD5                : 1;
1548     unsigned AD6                : 1;
1549     unsigned AD7                : 1;
1550     };
1551 
1552   struct
1553     {
1554     unsigned                    : 1;
1555     unsigned                    : 1;
1556     unsigned                    : 1;
1557     unsigned                    : 1;
1558     unsigned SDO2               : 1;
1559     unsigned SDA2               : 1;
1560     unsigned SCL2               : 1;
1561     unsigned SS2                : 1;
1562     };
1563 
1564   struct
1565     {
1566     unsigned                    : 1;
1567     unsigned                    : 1;
1568     unsigned                    : 1;
1569     unsigned                    : 1;
1570     unsigned                    : 1;
1571     unsigned SDI2               : 1;
1572     unsigned SCK2               : 1;
1573     unsigned NOT_SS2            : 1;
1574     };
1575   } __PORTDbits_t;
1576 
1577 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1578 
1579 #define _PORTD_RD0              0x01
1580 #define _PORTD_PSP0             0x01
1581 #define _PORTD_AD0              0x01
1582 #define _PORTD_RD1              0x02
1583 #define _PORTD_PSP1             0x02
1584 #define _PORTD_AD1              0x02
1585 #define _PORTD_RD2              0x04
1586 #define _PORTD_PSP2             0x04
1587 #define _PORTD_AD2              0x04
1588 #define _PORTD_RD3              0x08
1589 #define _PORTD_PSP3             0x08
1590 #define _PORTD_AD3              0x08
1591 #define _PORTD_RD4              0x10
1592 #define _PORTD_PSP4             0x10
1593 #define _PORTD_AD4              0x10
1594 #define _PORTD_SDO2             0x10
1595 #define _PORTD_RD5              0x20
1596 #define _PORTD_PSP5             0x20
1597 #define _PORTD_AD5              0x20
1598 #define _PORTD_SDA2             0x20
1599 #define _PORTD_SDI2             0x20
1600 #define _PORTD_RD6              0x40
1601 #define _PORTD_PSP6             0x40
1602 #define _PORTD_AD6              0x40
1603 #define _PORTD_SCL2             0x40
1604 #define _PORTD_SCK2             0x40
1605 #define _PORTD_RD7              0x80
1606 #define _PORTD_PSP7             0x80
1607 #define _PORTD_AD7              0x80
1608 #define _PORTD_SS2              0x80
1609 #define _PORTD_NOT_SS2          0x80
1610 
1611 //==============================================================================
1612 
1613 
1614 //==============================================================================
1615 //        PORTE Bits
1616 
1617 extern __at(0x0F84) __sfr PORTE;
1618 
1619 typedef union
1620   {
1621   struct
1622     {
1623     unsigned RE0                : 1;
1624     unsigned RE1                : 1;
1625     unsigned RE2                : 1;
1626     unsigned RE3                : 1;
1627     unsigned RE4                : 1;
1628     unsigned RE5                : 1;
1629     unsigned RE6                : 1;
1630     unsigned RE7                : 1;
1631     };
1632 
1633   struct
1634     {
1635     unsigned RD                 : 1;
1636     unsigned WR                 : 1;
1637     unsigned CS                 : 1;
1638     unsigned AD11               : 1;
1639     unsigned AD12               : 1;
1640     unsigned AD13               : 1;
1641     unsigned AD14               : 1;
1642     unsigned ECCP2              : 1;
1643     };
1644 
1645   struct
1646     {
1647     unsigned NOT_RD             : 1;
1648     unsigned NOT_WR             : 1;
1649     unsigned NOT_CS             : 1;
1650     unsigned P3C                : 1;
1651     unsigned P3B                : 1;
1652     unsigned P1C                : 1;
1653     unsigned P1B                : 1;
1654     unsigned CCP2               : 1;
1655     };
1656 
1657   struct
1658     {
1659     unsigned AD8                : 1;
1660     unsigned AD9                : 1;
1661     unsigned AD10               : 1;
1662     unsigned                    : 1;
1663     unsigned                    : 1;
1664     unsigned                    : 1;
1665     unsigned                    : 1;
1666     unsigned AD15               : 1;
1667     };
1668 
1669   struct
1670     {
1671     unsigned P2D                : 1;
1672     unsigned P2C                : 1;
1673     unsigned P2B                : 1;
1674     unsigned                    : 1;
1675     unsigned                    : 1;
1676     unsigned                    : 1;
1677     unsigned                    : 1;
1678     unsigned P2A                : 1;
1679     };
1680   } __PORTEbits_t;
1681 
1682 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1683 
1684 #define _PORTE_RE0              0x01
1685 #define _PORTE_RD               0x01
1686 #define _PORTE_NOT_RD           0x01
1687 #define _PORTE_AD8              0x01
1688 #define _PORTE_P2D              0x01
1689 #define _PORTE_RE1              0x02
1690 #define _PORTE_WR               0x02
1691 #define _PORTE_NOT_WR           0x02
1692 #define _PORTE_AD9              0x02
1693 #define _PORTE_P2C              0x02
1694 #define _PORTE_RE2              0x04
1695 #define _PORTE_CS               0x04
1696 #define _PORTE_NOT_CS           0x04
1697 #define _PORTE_AD10             0x04
1698 #define _PORTE_P2B              0x04
1699 #define _PORTE_RE3              0x08
1700 #define _PORTE_AD11             0x08
1701 #define _PORTE_P3C              0x08
1702 #define _PORTE_RE4              0x10
1703 #define _PORTE_AD12             0x10
1704 #define _PORTE_P3B              0x10
1705 #define _PORTE_RE5              0x20
1706 #define _PORTE_AD13             0x20
1707 #define _PORTE_P1C              0x20
1708 #define _PORTE_RE6              0x40
1709 #define _PORTE_AD14             0x40
1710 #define _PORTE_P1B              0x40
1711 #define _PORTE_RE7              0x80
1712 #define _PORTE_ECCP2            0x80
1713 #define _PORTE_CCP2             0x80
1714 #define _PORTE_AD15             0x80
1715 #define _PORTE_P2A              0x80
1716 
1717 //==============================================================================
1718 
1719 
1720 //==============================================================================
1721 //        PORTF Bits
1722 
1723 extern __at(0x0F85) __sfr PORTF;
1724 
1725 typedef union
1726   {
1727   struct
1728     {
1729     unsigned RF0                : 1;
1730     unsigned RF1                : 1;
1731     unsigned RF2                : 1;
1732     unsigned RF3                : 1;
1733     unsigned RF4                : 1;
1734     unsigned RF5                : 1;
1735     unsigned RF6                : 1;
1736     unsigned RF7                : 1;
1737     };
1738 
1739   struct
1740     {
1741     unsigned AN5                : 1;
1742     unsigned AN6                : 1;
1743     unsigned AN7                : 1;
1744     unsigned AN8                : 1;
1745     unsigned AN9                : 1;
1746     unsigned AN10               : 1;
1747     unsigned AN11               : 1;
1748     unsigned SS1                : 1;
1749     };
1750 
1751   struct
1752     {
1753     unsigned                    : 1;
1754     unsigned C2OUT              : 1;
1755     unsigned C1OUT              : 1;
1756     unsigned                    : 1;
1757     unsigned                    : 1;
1758     unsigned CVREF              : 1;
1759     unsigned                    : 1;
1760     unsigned NOT_SS1            : 1;
1761     };
1762   } __PORTFbits_t;
1763 
1764 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
1765 
1766 #define _PORTF_RF0              0x01
1767 #define _PORTF_AN5              0x01
1768 #define _PORTF_RF1              0x02
1769 #define _PORTF_AN6              0x02
1770 #define _PORTF_C2OUT            0x02
1771 #define _PORTF_RF2              0x04
1772 #define _PORTF_AN7              0x04
1773 #define _PORTF_C1OUT            0x04
1774 #define _PORTF_RF3              0x08
1775 #define _PORTF_AN8              0x08
1776 #define _PORTF_RF4              0x10
1777 #define _PORTF_AN9              0x10
1778 #define _PORTF_RF5              0x20
1779 #define _PORTF_AN10             0x20
1780 #define _PORTF_CVREF            0x20
1781 #define _PORTF_RF6              0x40
1782 #define _PORTF_AN11             0x40
1783 #define _PORTF_RF7              0x80
1784 #define _PORTF_SS1              0x80
1785 #define _PORTF_NOT_SS1          0x80
1786 
1787 //==============================================================================
1788 
1789 
1790 //==============================================================================
1791 //        PORTG Bits
1792 
1793 extern __at(0x0F86) __sfr PORTG;
1794 
1795 typedef union
1796   {
1797   struct
1798     {
1799     unsigned RG0                : 1;
1800     unsigned RG1                : 1;
1801     unsigned RG2                : 1;
1802     unsigned RG3                : 1;
1803     unsigned RG4                : 1;
1804     unsigned RG5                : 1;
1805     unsigned                    : 1;
1806     unsigned                    : 1;
1807     };
1808 
1809   struct
1810     {
1811     unsigned ECCP3              : 1;
1812     unsigned TX2                : 1;
1813     unsigned RX2                : 1;
1814     unsigned CCP4               : 1;
1815     unsigned CCP5               : 1;
1816     unsigned MCLR               : 1;
1817     unsigned                    : 1;
1818     unsigned                    : 1;
1819     };
1820 
1821   struct
1822     {
1823     unsigned P3A                : 1;
1824     unsigned CK2                : 1;
1825     unsigned DT2                : 1;
1826     unsigned P3D                : 1;
1827     unsigned P1D                : 1;
1828     unsigned NOT_MCLR           : 1;
1829     unsigned                    : 1;
1830     unsigned                    : 1;
1831     };
1832 
1833   struct
1834     {
1835     unsigned CCP3               : 1;
1836     unsigned                    : 1;
1837     unsigned                    : 1;
1838     unsigned                    : 1;
1839     unsigned                    : 1;
1840     unsigned                    : 1;
1841     unsigned                    : 1;
1842     unsigned                    : 1;
1843     };
1844 
1845   struct
1846     {
1847     unsigned RG                 : 6;
1848     unsigned                    : 2;
1849     };
1850   } __PORTGbits_t;
1851 
1852 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
1853 
1854 #define _PORTG_RG0              0x01
1855 #define _PORTG_ECCP3            0x01
1856 #define _PORTG_P3A              0x01
1857 #define _PORTG_CCP3             0x01
1858 #define _PORTG_RG1              0x02
1859 #define _PORTG_TX2              0x02
1860 #define _PORTG_CK2              0x02
1861 #define _PORTG_RG2              0x04
1862 #define _PORTG_RX2              0x04
1863 #define _PORTG_DT2              0x04
1864 #define _PORTG_RG3              0x08
1865 #define _PORTG_CCP4             0x08
1866 #define _PORTG_P3D              0x08
1867 #define _PORTG_RG4              0x10
1868 #define _PORTG_CCP5             0x10
1869 #define _PORTG_P1D              0x10
1870 #define _PORTG_RG5              0x20
1871 #define _PORTG_MCLR             0x20
1872 #define _PORTG_NOT_MCLR         0x20
1873 
1874 //==============================================================================
1875 
1876 
1877 //==============================================================================
1878 //        PORTH Bits
1879 
1880 extern __at(0x0F87) __sfr PORTH;
1881 
1882 typedef union
1883   {
1884   struct
1885     {
1886     unsigned RH0                : 1;
1887     unsigned RH1                : 1;
1888     unsigned RH2                : 1;
1889     unsigned RH3                : 1;
1890     unsigned RH4                : 1;
1891     unsigned RH5                : 1;
1892     unsigned RH6                : 1;
1893     unsigned RH7                : 1;
1894     };
1895 
1896   struct
1897     {
1898     unsigned A16                : 1;
1899     unsigned A17                : 1;
1900     unsigned A18                : 1;
1901     unsigned A19                : 1;
1902     unsigned AN12               : 1;
1903     unsigned AN13               : 1;
1904     unsigned AN14               : 1;
1905     unsigned AN15               : 1;
1906     };
1907 
1908   struct
1909     {
1910     unsigned                    : 1;
1911     unsigned                    : 1;
1912     unsigned                    : 1;
1913     unsigned                    : 1;
1914     unsigned P3C                : 1;
1915     unsigned P3B                : 1;
1916     unsigned P1C                : 1;
1917     unsigned P1B                : 1;
1918     };
1919   } __PORTHbits_t;
1920 
1921 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
1922 
1923 #define _PORTH_RH0              0x01
1924 #define _PORTH_A16              0x01
1925 #define _PORTH_RH1              0x02
1926 #define _PORTH_A17              0x02
1927 #define _PORTH_RH2              0x04
1928 #define _PORTH_A18              0x04
1929 #define _PORTH_RH3              0x08
1930 #define _PORTH_A19              0x08
1931 #define _PORTH_RH4              0x10
1932 #define _PORTH_AN12             0x10
1933 #define _PORTH_P3C              0x10
1934 #define _PORTH_RH5              0x20
1935 #define _PORTH_AN13             0x20
1936 #define _PORTH_P3B              0x20
1937 #define _PORTH_RH6              0x40
1938 #define _PORTH_AN14             0x40
1939 #define _PORTH_P1C              0x40
1940 #define _PORTH_RH7              0x80
1941 #define _PORTH_AN15             0x80
1942 #define _PORTH_P1B              0x80
1943 
1944 //==============================================================================
1945 
1946 
1947 //==============================================================================
1948 //        PORTJ Bits
1949 
1950 extern __at(0x0F88) __sfr PORTJ;
1951 
1952 typedef union
1953   {
1954   struct
1955     {
1956     unsigned RJ0                : 1;
1957     unsigned RJ1                : 1;
1958     unsigned RJ2                : 1;
1959     unsigned RJ3                : 1;
1960     unsigned RJ4                : 1;
1961     unsigned RJ5                : 1;
1962     unsigned RJ6                : 1;
1963     unsigned RJ7                : 1;
1964     };
1965 
1966   struct
1967     {
1968     unsigned ALE                : 1;
1969     unsigned OE                 : 1;
1970     unsigned WRL                : 1;
1971     unsigned WRH                : 1;
1972     unsigned BA0                : 1;
1973     unsigned CE                 : 1;
1974     unsigned LB                 : 1;
1975     unsigned UB                 : 1;
1976     };
1977 
1978   struct
1979     {
1980     unsigned                    : 1;
1981     unsigned NOT_OE             : 1;
1982     unsigned NOT_WRL            : 1;
1983     unsigned NOT_WRH            : 1;
1984     unsigned                    : 1;
1985     unsigned NOT_CE             : 1;
1986     unsigned NOT_LB             : 1;
1987     unsigned NOT_UB             : 1;
1988     };
1989   } __PORTJbits_t;
1990 
1991 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
1992 
1993 #define _PORTJ_RJ0              0x01
1994 #define _PORTJ_ALE              0x01
1995 #define _PORTJ_RJ1              0x02
1996 #define _PORTJ_OE               0x02
1997 #define _PORTJ_NOT_OE           0x02
1998 #define _PORTJ_RJ2              0x04
1999 #define _PORTJ_WRL              0x04
2000 #define _PORTJ_NOT_WRL          0x04
2001 #define _PORTJ_RJ3              0x08
2002 #define _PORTJ_WRH              0x08
2003 #define _PORTJ_NOT_WRH          0x08
2004 #define _PORTJ_RJ4              0x10
2005 #define _PORTJ_BA0              0x10
2006 #define _PORTJ_RJ5              0x20
2007 #define _PORTJ_CE               0x20
2008 #define _PORTJ_NOT_CE           0x20
2009 #define _PORTJ_RJ6              0x40
2010 #define _PORTJ_LB               0x40
2011 #define _PORTJ_NOT_LB           0x40
2012 #define _PORTJ_RJ7              0x80
2013 #define _PORTJ_UB               0x80
2014 #define _PORTJ_NOT_UB           0x80
2015 
2016 //==============================================================================
2017 
2018 
2019 //==============================================================================
2020 //        LATA Bits
2021 
2022 extern __at(0x0F89) __sfr LATA;
2023 
2024 typedef struct
2025   {
2026   unsigned LATA0                : 1;
2027   unsigned LATA1                : 1;
2028   unsigned LATA2                : 1;
2029   unsigned LATA3                : 1;
2030   unsigned LATA4                : 1;
2031   unsigned LATA5                : 1;
2032   unsigned LATA6                : 1;
2033   unsigned LATA7                : 1;
2034   } __LATAbits_t;
2035 
2036 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2037 
2038 #define _LATA0                  0x01
2039 #define _LATA1                  0x02
2040 #define _LATA2                  0x04
2041 #define _LATA3                  0x08
2042 #define _LATA4                  0x10
2043 #define _LATA5                  0x20
2044 #define _LATA6                  0x40
2045 #define _LATA7                  0x80
2046 
2047 //==============================================================================
2048 
2049 
2050 //==============================================================================
2051 //        LATB Bits
2052 
2053 extern __at(0x0F8A) __sfr LATB;
2054 
2055 typedef struct
2056   {
2057   unsigned LATB0                : 1;
2058   unsigned LATB1                : 1;
2059   unsigned LATB2                : 1;
2060   unsigned LATB3                : 1;
2061   unsigned LATB4                : 1;
2062   unsigned LATB5                : 1;
2063   unsigned LATB6                : 1;
2064   unsigned LATB7                : 1;
2065   } __LATBbits_t;
2066 
2067 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2068 
2069 #define _LATB0                  0x01
2070 #define _LATB1                  0x02
2071 #define _LATB2                  0x04
2072 #define _LATB3                  0x08
2073 #define _LATB4                  0x10
2074 #define _LATB5                  0x20
2075 #define _LATB6                  0x40
2076 #define _LATB7                  0x80
2077 
2078 //==============================================================================
2079 
2080 
2081 //==============================================================================
2082 //        LATC Bits
2083 
2084 extern __at(0x0F8B) __sfr LATC;
2085 
2086 typedef struct
2087   {
2088   unsigned LATC0                : 1;
2089   unsigned LATC1                : 1;
2090   unsigned LATC2                : 1;
2091   unsigned LATC3                : 1;
2092   unsigned LATC4                : 1;
2093   unsigned LATC5                : 1;
2094   unsigned LATC6                : 1;
2095   unsigned LATC7                : 1;
2096   } __LATCbits_t;
2097 
2098 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2099 
2100 #define _LATC0                  0x01
2101 #define _LATC1                  0x02
2102 #define _LATC2                  0x04
2103 #define _LATC3                  0x08
2104 #define _LATC4                  0x10
2105 #define _LATC5                  0x20
2106 #define _LATC6                  0x40
2107 #define _LATC7                  0x80
2108 
2109 //==============================================================================
2110 
2111 
2112 //==============================================================================
2113 //        LATD Bits
2114 
2115 extern __at(0x0F8C) __sfr LATD;
2116 
2117 typedef struct
2118   {
2119   unsigned LATD0                : 1;
2120   unsigned LATD1                : 1;
2121   unsigned LATD2                : 1;
2122   unsigned LATD3                : 1;
2123   unsigned LATD4                : 1;
2124   unsigned LATD5                : 1;
2125   unsigned LATD6                : 1;
2126   unsigned LATD7                : 1;
2127   } __LATDbits_t;
2128 
2129 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2130 
2131 #define _LATD0                  0x01
2132 #define _LATD1                  0x02
2133 #define _LATD2                  0x04
2134 #define _LATD3                  0x08
2135 #define _LATD4                  0x10
2136 #define _LATD5                  0x20
2137 #define _LATD6                  0x40
2138 #define _LATD7                  0x80
2139 
2140 //==============================================================================
2141 
2142 
2143 //==============================================================================
2144 //        LATE Bits
2145 
2146 extern __at(0x0F8D) __sfr LATE;
2147 
2148 typedef struct
2149   {
2150   unsigned LATE0                : 1;
2151   unsigned LATE1                : 1;
2152   unsigned LATE2                : 1;
2153   unsigned LATE3                : 1;
2154   unsigned LATE4                : 1;
2155   unsigned LATE5                : 1;
2156   unsigned LATE6                : 1;
2157   unsigned LATE7                : 1;
2158   } __LATEbits_t;
2159 
2160 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2161 
2162 #define _LATE0                  0x01
2163 #define _LATE1                  0x02
2164 #define _LATE2                  0x04
2165 #define _LATE3                  0x08
2166 #define _LATE4                  0x10
2167 #define _LATE5                  0x20
2168 #define _LATE6                  0x40
2169 #define _LATE7                  0x80
2170 
2171 //==============================================================================
2172 
2173 
2174 //==============================================================================
2175 //        LATF Bits
2176 
2177 extern __at(0x0F8E) __sfr LATF;
2178 
2179 typedef struct
2180   {
2181   unsigned LATF0                : 1;
2182   unsigned LATF1                : 1;
2183   unsigned LATF2                : 1;
2184   unsigned LATF3                : 1;
2185   unsigned LATF4                : 1;
2186   unsigned LATF5                : 1;
2187   unsigned LATF6                : 1;
2188   unsigned LATF7                : 1;
2189   } __LATFbits_t;
2190 
2191 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
2192 
2193 #define _LATF0                  0x01
2194 #define _LATF1                  0x02
2195 #define _LATF2                  0x04
2196 #define _LATF3                  0x08
2197 #define _LATF4                  0x10
2198 #define _LATF5                  0x20
2199 #define _LATF6                  0x40
2200 #define _LATF7                  0x80
2201 
2202 //==============================================================================
2203 
2204 
2205 //==============================================================================
2206 //        LATG Bits
2207 
2208 extern __at(0x0F8F) __sfr LATG;
2209 
2210 typedef union
2211   {
2212   struct
2213     {
2214     unsigned LATG0              : 1;
2215     unsigned LATG1              : 1;
2216     unsigned LATG2              : 1;
2217     unsigned LATG3              : 1;
2218     unsigned LATG4              : 1;
2219     unsigned LATG5              : 1;
2220     unsigned                    : 1;
2221     unsigned                    : 1;
2222     };
2223 
2224   struct
2225     {
2226     unsigned LATG               : 6;
2227     unsigned                    : 2;
2228     };
2229   } __LATGbits_t;
2230 
2231 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2232 
2233 #define _LATG0                  0x01
2234 #define _LATG1                  0x02
2235 #define _LATG2                  0x04
2236 #define _LATG3                  0x08
2237 #define _LATG4                  0x10
2238 #define _LATG5                  0x20
2239 
2240 //==============================================================================
2241 
2242 
2243 //==============================================================================
2244 //        LATH Bits
2245 
2246 extern __at(0x0F90) __sfr LATH;
2247 
2248 typedef struct
2249   {
2250   unsigned LATH0                : 1;
2251   unsigned LATH1                : 1;
2252   unsigned LATH2                : 1;
2253   unsigned LATH3                : 1;
2254   unsigned LATH4                : 1;
2255   unsigned LATH5                : 1;
2256   unsigned LATH6                : 1;
2257   unsigned LATH7                : 1;
2258   } __LATHbits_t;
2259 
2260 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
2261 
2262 #define _LATH0                  0x01
2263 #define _LATH1                  0x02
2264 #define _LATH2                  0x04
2265 #define _LATH3                  0x08
2266 #define _LATH4                  0x10
2267 #define _LATH5                  0x20
2268 #define _LATH6                  0x40
2269 #define _LATH7                  0x80
2270 
2271 //==============================================================================
2272 
2273 
2274 //==============================================================================
2275 //        LATJ Bits
2276 
2277 extern __at(0x0F91) __sfr LATJ;
2278 
2279 typedef struct
2280   {
2281   unsigned LATJ0                : 1;
2282   unsigned LATJ1                : 1;
2283   unsigned LATJ2                : 1;
2284   unsigned LATJ3                : 1;
2285   unsigned LATJ4                : 1;
2286   unsigned LATJ5                : 1;
2287   unsigned LATJ6                : 1;
2288   unsigned LATJ7                : 1;
2289   } __LATJbits_t;
2290 
2291 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
2292 
2293 #define _LATJ0                  0x01
2294 #define _LATJ1                  0x02
2295 #define _LATJ2                  0x04
2296 #define _LATJ3                  0x08
2297 #define _LATJ4                  0x10
2298 #define _LATJ5                  0x20
2299 #define _LATJ6                  0x40
2300 #define _LATJ7                  0x80
2301 
2302 //==============================================================================
2303 
2304 
2305 //==============================================================================
2306 //        DDRA Bits
2307 
2308 extern __at(0x0F92) __sfr DDRA;
2309 
2310 typedef union
2311   {
2312   struct
2313     {
2314     unsigned TRISA0             : 1;
2315     unsigned TRISA1             : 1;
2316     unsigned TRISA2             : 1;
2317     unsigned TRISA3             : 1;
2318     unsigned TRISA4             : 1;
2319     unsigned TRISA5             : 1;
2320     unsigned TRISA6             : 1;
2321     unsigned TRISA7             : 1;
2322     };
2323 
2324   struct
2325     {
2326     unsigned RA0                : 1;
2327     unsigned RA1                : 1;
2328     unsigned RA2                : 1;
2329     unsigned RA3                : 1;
2330     unsigned RA4                : 1;
2331     unsigned RA5                : 1;
2332     unsigned RA6                : 1;
2333     unsigned RA7                : 1;
2334     };
2335   } __DDRAbits_t;
2336 
2337 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2338 
2339 #define _TRISA0                 0x01
2340 #define _RA0                    0x01
2341 #define _TRISA1                 0x02
2342 #define _RA1                    0x02
2343 #define _TRISA2                 0x04
2344 #define _RA2                    0x04
2345 #define _TRISA3                 0x08
2346 #define _RA3                    0x08
2347 #define _TRISA4                 0x10
2348 #define _RA4                    0x10
2349 #define _TRISA5                 0x20
2350 #define _RA5                    0x20
2351 #define _TRISA6                 0x40
2352 #define _RA6                    0x40
2353 #define _TRISA7                 0x80
2354 #define _RA7                    0x80
2355 
2356 //==============================================================================
2357 
2358 
2359 //==============================================================================
2360 //        TRISA Bits
2361 
2362 extern __at(0x0F92) __sfr TRISA;
2363 
2364 typedef union
2365   {
2366   struct
2367     {
2368     unsigned TRISA0             : 1;
2369     unsigned TRISA1             : 1;
2370     unsigned TRISA2             : 1;
2371     unsigned TRISA3             : 1;
2372     unsigned TRISA4             : 1;
2373     unsigned TRISA5             : 1;
2374     unsigned TRISA6             : 1;
2375     unsigned TRISA7             : 1;
2376     };
2377 
2378   struct
2379     {
2380     unsigned RA0                : 1;
2381     unsigned RA1                : 1;
2382     unsigned RA2                : 1;
2383     unsigned RA3                : 1;
2384     unsigned RA4                : 1;
2385     unsigned RA5                : 1;
2386     unsigned RA6                : 1;
2387     unsigned RA7                : 1;
2388     };
2389   } __TRISAbits_t;
2390 
2391 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2392 
2393 #define _TRISA_TRISA0           0x01
2394 #define _TRISA_RA0              0x01
2395 #define _TRISA_TRISA1           0x02
2396 #define _TRISA_RA1              0x02
2397 #define _TRISA_TRISA2           0x04
2398 #define _TRISA_RA2              0x04
2399 #define _TRISA_TRISA3           0x08
2400 #define _TRISA_RA3              0x08
2401 #define _TRISA_TRISA4           0x10
2402 #define _TRISA_RA4              0x10
2403 #define _TRISA_TRISA5           0x20
2404 #define _TRISA_RA5              0x20
2405 #define _TRISA_TRISA6           0x40
2406 #define _TRISA_RA6              0x40
2407 #define _TRISA_TRISA7           0x80
2408 #define _TRISA_RA7              0x80
2409 
2410 //==============================================================================
2411 
2412 
2413 //==============================================================================
2414 //        DDRB Bits
2415 
2416 extern __at(0x0F93) __sfr DDRB;
2417 
2418 typedef union
2419   {
2420   struct
2421     {
2422     unsigned TRISB0             : 1;
2423     unsigned TRISB1             : 1;
2424     unsigned TRISB2             : 1;
2425     unsigned TRISB3             : 1;
2426     unsigned TRISB4             : 1;
2427     unsigned TRISB5             : 1;
2428     unsigned TRISB6             : 1;
2429     unsigned TRISB7             : 1;
2430     };
2431 
2432   struct
2433     {
2434     unsigned RB0                : 1;
2435     unsigned RB1                : 1;
2436     unsigned RB2                : 1;
2437     unsigned RB3                : 1;
2438     unsigned RB4                : 1;
2439     unsigned RB5                : 1;
2440     unsigned RB6                : 1;
2441     unsigned RB7                : 1;
2442     };
2443   } __DDRBbits_t;
2444 
2445 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2446 
2447 #define _TRISB0                 0x01
2448 #define _RB0                    0x01
2449 #define _TRISB1                 0x02
2450 #define _RB1                    0x02
2451 #define _TRISB2                 0x04
2452 #define _RB2                    0x04
2453 #define _TRISB3                 0x08
2454 #define _RB3                    0x08
2455 #define _TRISB4                 0x10
2456 #define _RB4                    0x10
2457 #define _TRISB5                 0x20
2458 #define _RB5                    0x20
2459 #define _TRISB6                 0x40
2460 #define _RB6                    0x40
2461 #define _TRISB7                 0x80
2462 #define _RB7                    0x80
2463 
2464 //==============================================================================
2465 
2466 
2467 //==============================================================================
2468 //        TRISB Bits
2469 
2470 extern __at(0x0F93) __sfr TRISB;
2471 
2472 typedef union
2473   {
2474   struct
2475     {
2476     unsigned TRISB0             : 1;
2477     unsigned TRISB1             : 1;
2478     unsigned TRISB2             : 1;
2479     unsigned TRISB3             : 1;
2480     unsigned TRISB4             : 1;
2481     unsigned TRISB5             : 1;
2482     unsigned TRISB6             : 1;
2483     unsigned TRISB7             : 1;
2484     };
2485 
2486   struct
2487     {
2488     unsigned RB0                : 1;
2489     unsigned RB1                : 1;
2490     unsigned RB2                : 1;
2491     unsigned RB3                : 1;
2492     unsigned RB4                : 1;
2493     unsigned RB5                : 1;
2494     unsigned RB6                : 1;
2495     unsigned RB7                : 1;
2496     };
2497   } __TRISBbits_t;
2498 
2499 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2500 
2501 #define _TRISB_TRISB0           0x01
2502 #define _TRISB_RB0              0x01
2503 #define _TRISB_TRISB1           0x02
2504 #define _TRISB_RB1              0x02
2505 #define _TRISB_TRISB2           0x04
2506 #define _TRISB_RB2              0x04
2507 #define _TRISB_TRISB3           0x08
2508 #define _TRISB_RB3              0x08
2509 #define _TRISB_TRISB4           0x10
2510 #define _TRISB_RB4              0x10
2511 #define _TRISB_TRISB5           0x20
2512 #define _TRISB_RB5              0x20
2513 #define _TRISB_TRISB6           0x40
2514 #define _TRISB_RB6              0x40
2515 #define _TRISB_TRISB7           0x80
2516 #define _TRISB_RB7              0x80
2517 
2518 //==============================================================================
2519 
2520 
2521 //==============================================================================
2522 //        DDRC Bits
2523 
2524 extern __at(0x0F94) __sfr DDRC;
2525 
2526 typedef union
2527   {
2528   struct
2529     {
2530     unsigned TRISC0             : 1;
2531     unsigned TRISC1             : 1;
2532     unsigned TRISC2             : 1;
2533     unsigned TRISC3             : 1;
2534     unsigned TRISC4             : 1;
2535     unsigned TRISC5             : 1;
2536     unsigned TRISC6             : 1;
2537     unsigned TRISC7             : 1;
2538     };
2539 
2540   struct
2541     {
2542     unsigned RC0                : 1;
2543     unsigned RC1                : 1;
2544     unsigned RC2                : 1;
2545     unsigned RC3                : 1;
2546     unsigned RC4                : 1;
2547     unsigned RC5                : 1;
2548     unsigned RC6                : 1;
2549     unsigned RC7                : 1;
2550     };
2551   } __DDRCbits_t;
2552 
2553 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2554 
2555 #define _TRISC0                 0x01
2556 #define _RC0                    0x01
2557 #define _TRISC1                 0x02
2558 #define _RC1                    0x02
2559 #define _TRISC2                 0x04
2560 #define _RC2                    0x04
2561 #define _TRISC3                 0x08
2562 #define _RC3                    0x08
2563 #define _TRISC4                 0x10
2564 #define _RC4                    0x10
2565 #define _TRISC5                 0x20
2566 #define _RC5                    0x20
2567 #define _TRISC6                 0x40
2568 #define _RC6                    0x40
2569 #define _TRISC7                 0x80
2570 #define _RC7                    0x80
2571 
2572 //==============================================================================
2573 
2574 
2575 //==============================================================================
2576 //        TRISC Bits
2577 
2578 extern __at(0x0F94) __sfr TRISC;
2579 
2580 typedef union
2581   {
2582   struct
2583     {
2584     unsigned TRISC0             : 1;
2585     unsigned TRISC1             : 1;
2586     unsigned TRISC2             : 1;
2587     unsigned TRISC3             : 1;
2588     unsigned TRISC4             : 1;
2589     unsigned TRISC5             : 1;
2590     unsigned TRISC6             : 1;
2591     unsigned TRISC7             : 1;
2592     };
2593 
2594   struct
2595     {
2596     unsigned RC0                : 1;
2597     unsigned RC1                : 1;
2598     unsigned RC2                : 1;
2599     unsigned RC3                : 1;
2600     unsigned RC4                : 1;
2601     unsigned RC5                : 1;
2602     unsigned RC6                : 1;
2603     unsigned RC7                : 1;
2604     };
2605   } __TRISCbits_t;
2606 
2607 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2608 
2609 #define _TRISC_TRISC0           0x01
2610 #define _TRISC_RC0              0x01
2611 #define _TRISC_TRISC1           0x02
2612 #define _TRISC_RC1              0x02
2613 #define _TRISC_TRISC2           0x04
2614 #define _TRISC_RC2              0x04
2615 #define _TRISC_TRISC3           0x08
2616 #define _TRISC_RC3              0x08
2617 #define _TRISC_TRISC4           0x10
2618 #define _TRISC_RC4              0x10
2619 #define _TRISC_TRISC5           0x20
2620 #define _TRISC_RC5              0x20
2621 #define _TRISC_TRISC6           0x40
2622 #define _TRISC_RC6              0x40
2623 #define _TRISC_TRISC7           0x80
2624 #define _TRISC_RC7              0x80
2625 
2626 //==============================================================================
2627 
2628 
2629 //==============================================================================
2630 //        DDRD Bits
2631 
2632 extern __at(0x0F95) __sfr DDRD;
2633 
2634 typedef union
2635   {
2636   struct
2637     {
2638     unsigned TRISD0             : 1;
2639     unsigned TRISD1             : 1;
2640     unsigned TRISD2             : 1;
2641     unsigned TRISD3             : 1;
2642     unsigned TRISD4             : 1;
2643     unsigned TRISD5             : 1;
2644     unsigned TRISD6             : 1;
2645     unsigned TRISD7             : 1;
2646     };
2647 
2648   struct
2649     {
2650     unsigned RD0                : 1;
2651     unsigned RD1                : 1;
2652     unsigned RD2                : 1;
2653     unsigned RD3                : 1;
2654     unsigned RD4                : 1;
2655     unsigned RD5                : 1;
2656     unsigned RD6                : 1;
2657     unsigned RD7                : 1;
2658     };
2659   } __DDRDbits_t;
2660 
2661 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2662 
2663 #define _TRISD0                 0x01
2664 #define _RD0                    0x01
2665 #define _TRISD1                 0x02
2666 #define _RD1                    0x02
2667 #define _TRISD2                 0x04
2668 #define _RD2                    0x04
2669 #define _TRISD3                 0x08
2670 #define _RD3                    0x08
2671 #define _TRISD4                 0x10
2672 #define _RD4                    0x10
2673 #define _TRISD5                 0x20
2674 #define _RD5                    0x20
2675 #define _TRISD6                 0x40
2676 #define _RD6                    0x40
2677 #define _TRISD7                 0x80
2678 #define _RD7                    0x80
2679 
2680 //==============================================================================
2681 
2682 
2683 //==============================================================================
2684 //        TRISD Bits
2685 
2686 extern __at(0x0F95) __sfr TRISD;
2687 
2688 typedef union
2689   {
2690   struct
2691     {
2692     unsigned TRISD0             : 1;
2693     unsigned TRISD1             : 1;
2694     unsigned TRISD2             : 1;
2695     unsigned TRISD3             : 1;
2696     unsigned TRISD4             : 1;
2697     unsigned TRISD5             : 1;
2698     unsigned TRISD6             : 1;
2699     unsigned TRISD7             : 1;
2700     };
2701 
2702   struct
2703     {
2704     unsigned RD0                : 1;
2705     unsigned RD1                : 1;
2706     unsigned RD2                : 1;
2707     unsigned RD3                : 1;
2708     unsigned RD4                : 1;
2709     unsigned RD5                : 1;
2710     unsigned RD6                : 1;
2711     unsigned RD7                : 1;
2712     };
2713   } __TRISDbits_t;
2714 
2715 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2716 
2717 #define _TRISD_TRISD0           0x01
2718 #define _TRISD_RD0              0x01
2719 #define _TRISD_TRISD1           0x02
2720 #define _TRISD_RD1              0x02
2721 #define _TRISD_TRISD2           0x04
2722 #define _TRISD_RD2              0x04
2723 #define _TRISD_TRISD3           0x08
2724 #define _TRISD_RD3              0x08
2725 #define _TRISD_TRISD4           0x10
2726 #define _TRISD_RD4              0x10
2727 #define _TRISD_TRISD5           0x20
2728 #define _TRISD_RD5              0x20
2729 #define _TRISD_TRISD6           0x40
2730 #define _TRISD_RD6              0x40
2731 #define _TRISD_TRISD7           0x80
2732 #define _TRISD_RD7              0x80
2733 
2734 //==============================================================================
2735 
2736 
2737 //==============================================================================
2738 //        DDRE Bits
2739 
2740 extern __at(0x0F96) __sfr DDRE;
2741 
2742 typedef union
2743   {
2744   struct
2745     {
2746     unsigned TRISE0             : 1;
2747     unsigned TRISE1             : 1;
2748     unsigned TRISE2             : 1;
2749     unsigned TRISE3             : 1;
2750     unsigned TRISE4             : 1;
2751     unsigned TRISE5             : 1;
2752     unsigned TRISE6             : 1;
2753     unsigned TRISE7             : 1;
2754     };
2755 
2756   struct
2757     {
2758     unsigned RE0                : 1;
2759     unsigned RE1                : 1;
2760     unsigned RE2                : 1;
2761     unsigned RE3                : 1;
2762     unsigned RE4                : 1;
2763     unsigned RE5                : 1;
2764     unsigned RE6                : 1;
2765     unsigned RE7                : 1;
2766     };
2767   } __DDREbits_t;
2768 
2769 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2770 
2771 #define _TRISE0                 0x01
2772 #define _RE0                    0x01
2773 #define _TRISE1                 0x02
2774 #define _RE1                    0x02
2775 #define _TRISE2                 0x04
2776 #define _RE2                    0x04
2777 #define _TRISE3                 0x08
2778 #define _RE3                    0x08
2779 #define _TRISE4                 0x10
2780 #define _RE4                    0x10
2781 #define _TRISE5                 0x20
2782 #define _RE5                    0x20
2783 #define _TRISE6                 0x40
2784 #define _RE6                    0x40
2785 #define _TRISE7                 0x80
2786 #define _RE7                    0x80
2787 
2788 //==============================================================================
2789 
2790 
2791 //==============================================================================
2792 //        TRISE Bits
2793 
2794 extern __at(0x0F96) __sfr TRISE;
2795 
2796 typedef union
2797   {
2798   struct
2799     {
2800     unsigned TRISE0             : 1;
2801     unsigned TRISE1             : 1;
2802     unsigned TRISE2             : 1;
2803     unsigned TRISE3             : 1;
2804     unsigned TRISE4             : 1;
2805     unsigned TRISE5             : 1;
2806     unsigned TRISE6             : 1;
2807     unsigned TRISE7             : 1;
2808     };
2809 
2810   struct
2811     {
2812     unsigned RE0                : 1;
2813     unsigned RE1                : 1;
2814     unsigned RE2                : 1;
2815     unsigned RE3                : 1;
2816     unsigned RE4                : 1;
2817     unsigned RE5                : 1;
2818     unsigned RE6                : 1;
2819     unsigned RE7                : 1;
2820     };
2821   } __TRISEbits_t;
2822 
2823 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2824 
2825 #define _TRISE_TRISE0           0x01
2826 #define _TRISE_RE0              0x01
2827 #define _TRISE_TRISE1           0x02
2828 #define _TRISE_RE1              0x02
2829 #define _TRISE_TRISE2           0x04
2830 #define _TRISE_RE2              0x04
2831 #define _TRISE_TRISE3           0x08
2832 #define _TRISE_RE3              0x08
2833 #define _TRISE_TRISE4           0x10
2834 #define _TRISE_RE4              0x10
2835 #define _TRISE_TRISE5           0x20
2836 #define _TRISE_RE5              0x20
2837 #define _TRISE_TRISE6           0x40
2838 #define _TRISE_RE6              0x40
2839 #define _TRISE_TRISE7           0x80
2840 #define _TRISE_RE7              0x80
2841 
2842 //==============================================================================
2843 
2844 
2845 //==============================================================================
2846 //        DDRF Bits
2847 
2848 extern __at(0x0F97) __sfr DDRF;
2849 
2850 typedef union
2851   {
2852   struct
2853     {
2854     unsigned TRISF0             : 1;
2855     unsigned TRISF1             : 1;
2856     unsigned TRISF2             : 1;
2857     unsigned TRISF3             : 1;
2858     unsigned TRISF4             : 1;
2859     unsigned TRISF5             : 1;
2860     unsigned TRISF6             : 1;
2861     unsigned TRISF7             : 1;
2862     };
2863 
2864   struct
2865     {
2866     unsigned RF0                : 1;
2867     unsigned RF1                : 1;
2868     unsigned RF2                : 1;
2869     unsigned RF3                : 1;
2870     unsigned RF4                : 1;
2871     unsigned RF5                : 1;
2872     unsigned RF6                : 1;
2873     unsigned RF7                : 1;
2874     };
2875   } __DDRFbits_t;
2876 
2877 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
2878 
2879 #define _TRISF0                 0x01
2880 #define _RF0                    0x01
2881 #define _TRISF1                 0x02
2882 #define _RF1                    0x02
2883 #define _TRISF2                 0x04
2884 #define _RF2                    0x04
2885 #define _TRISF3                 0x08
2886 #define _RF3                    0x08
2887 #define _TRISF4                 0x10
2888 #define _RF4                    0x10
2889 #define _TRISF5                 0x20
2890 #define _RF5                    0x20
2891 #define _TRISF6                 0x40
2892 #define _RF6                    0x40
2893 #define _TRISF7                 0x80
2894 #define _RF7                    0x80
2895 
2896 //==============================================================================
2897 
2898 
2899 //==============================================================================
2900 //        TRISF Bits
2901 
2902 extern __at(0x0F97) __sfr TRISF;
2903 
2904 typedef union
2905   {
2906   struct
2907     {
2908     unsigned TRISF0             : 1;
2909     unsigned TRISF1             : 1;
2910     unsigned TRISF2             : 1;
2911     unsigned TRISF3             : 1;
2912     unsigned TRISF4             : 1;
2913     unsigned TRISF5             : 1;
2914     unsigned TRISF6             : 1;
2915     unsigned TRISF7             : 1;
2916     };
2917 
2918   struct
2919     {
2920     unsigned RF0                : 1;
2921     unsigned RF1                : 1;
2922     unsigned RF2                : 1;
2923     unsigned RF3                : 1;
2924     unsigned RF4                : 1;
2925     unsigned RF5                : 1;
2926     unsigned RF6                : 1;
2927     unsigned RF7                : 1;
2928     };
2929   } __TRISFbits_t;
2930 
2931 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
2932 
2933 #define _TRISF_TRISF0           0x01
2934 #define _TRISF_RF0              0x01
2935 #define _TRISF_TRISF1           0x02
2936 #define _TRISF_RF1              0x02
2937 #define _TRISF_TRISF2           0x04
2938 #define _TRISF_RF2              0x04
2939 #define _TRISF_TRISF3           0x08
2940 #define _TRISF_RF3              0x08
2941 #define _TRISF_TRISF4           0x10
2942 #define _TRISF_RF4              0x10
2943 #define _TRISF_TRISF5           0x20
2944 #define _TRISF_RF5              0x20
2945 #define _TRISF_TRISF6           0x40
2946 #define _TRISF_RF6              0x40
2947 #define _TRISF_TRISF7           0x80
2948 #define _TRISF_RF7              0x80
2949 
2950 //==============================================================================
2951 
2952 
2953 //==============================================================================
2954 //        DDRG Bits
2955 
2956 extern __at(0x0F98) __sfr DDRG;
2957 
2958 typedef union
2959   {
2960   struct
2961     {
2962     unsigned TRISG0             : 1;
2963     unsigned TRISG1             : 1;
2964     unsigned TRISG2             : 1;
2965     unsigned TRISG3             : 1;
2966     unsigned TRISG4             : 1;
2967     unsigned                    : 1;
2968     unsigned                    : 1;
2969     unsigned                    : 1;
2970     };
2971 
2972   struct
2973     {
2974     unsigned RG0                : 1;
2975     unsigned RG1                : 1;
2976     unsigned RG2                : 1;
2977     unsigned RG3                : 1;
2978     unsigned RG4                : 1;
2979     unsigned                    : 1;
2980     unsigned                    : 1;
2981     unsigned                    : 1;
2982     };
2983 
2984   struct
2985     {
2986     unsigned TRISG              : 5;
2987     unsigned                    : 3;
2988     };
2989 
2990   struct
2991     {
2992     unsigned RG                 : 5;
2993     unsigned                    : 3;
2994     };
2995   } __DDRGbits_t;
2996 
2997 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
2998 
2999 #define _TRISG0                 0x01
3000 #define _RG0                    0x01
3001 #define _TRISG1                 0x02
3002 #define _RG1                    0x02
3003 #define _TRISG2                 0x04
3004 #define _RG2                    0x04
3005 #define _TRISG3                 0x08
3006 #define _RG3                    0x08
3007 #define _TRISG4                 0x10
3008 #define _RG4                    0x10
3009 
3010 //==============================================================================
3011 
3012 
3013 //==============================================================================
3014 //        TRISG Bits
3015 
3016 extern __at(0x0F98) __sfr TRISG;
3017 
3018 typedef union
3019   {
3020   struct
3021     {
3022     unsigned TRISG0             : 1;
3023     unsigned TRISG1             : 1;
3024     unsigned TRISG2             : 1;
3025     unsigned TRISG3             : 1;
3026     unsigned TRISG4             : 1;
3027     unsigned                    : 1;
3028     unsigned                    : 1;
3029     unsigned                    : 1;
3030     };
3031 
3032   struct
3033     {
3034     unsigned RG0                : 1;
3035     unsigned RG1                : 1;
3036     unsigned RG2                : 1;
3037     unsigned RG3                : 1;
3038     unsigned RG4                : 1;
3039     unsigned                    : 1;
3040     unsigned                    : 1;
3041     unsigned                    : 1;
3042     };
3043 
3044   struct
3045     {
3046     unsigned TRISG              : 5;
3047     unsigned                    : 3;
3048     };
3049 
3050   struct
3051     {
3052     unsigned RG                 : 5;
3053     unsigned                    : 3;
3054     };
3055   } __TRISGbits_t;
3056 
3057 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
3058 
3059 #define _TRISG_TRISG0           0x01
3060 #define _TRISG_RG0              0x01
3061 #define _TRISG_TRISG1           0x02
3062 #define _TRISG_RG1              0x02
3063 #define _TRISG_TRISG2           0x04
3064 #define _TRISG_RG2              0x04
3065 #define _TRISG_TRISG3           0x08
3066 #define _TRISG_RG3              0x08
3067 #define _TRISG_TRISG4           0x10
3068 #define _TRISG_RG4              0x10
3069 
3070 //==============================================================================
3071 
3072 
3073 //==============================================================================
3074 //        DDRH Bits
3075 
3076 extern __at(0x0F99) __sfr DDRH;
3077 
3078 typedef union
3079   {
3080   struct
3081     {
3082     unsigned TRISH0             : 1;
3083     unsigned TRISH1             : 1;
3084     unsigned TRISH2             : 1;
3085     unsigned TRISH3             : 1;
3086     unsigned TRISH4             : 1;
3087     unsigned TRISH5             : 1;
3088     unsigned TRISH6             : 1;
3089     unsigned TRISH7             : 1;
3090     };
3091 
3092   struct
3093     {
3094     unsigned RH0                : 1;
3095     unsigned RH1                : 1;
3096     unsigned RH2                : 1;
3097     unsigned RH3                : 1;
3098     unsigned RH4                : 1;
3099     unsigned RH5                : 1;
3100     unsigned RH6                : 1;
3101     unsigned RH7                : 1;
3102     };
3103   } __DDRHbits_t;
3104 
3105 extern __at(0x0F99) volatile __DDRHbits_t DDRHbits;
3106 
3107 #define _TRISH0                 0x01
3108 #define _RH0                    0x01
3109 #define _TRISH1                 0x02
3110 #define _RH1                    0x02
3111 #define _TRISH2                 0x04
3112 #define _RH2                    0x04
3113 #define _TRISH3                 0x08
3114 #define _RH3                    0x08
3115 #define _TRISH4                 0x10
3116 #define _RH4                    0x10
3117 #define _TRISH5                 0x20
3118 #define _RH5                    0x20
3119 #define _TRISH6                 0x40
3120 #define _RH6                    0x40
3121 #define _TRISH7                 0x80
3122 #define _RH7                    0x80
3123 
3124 //==============================================================================
3125 
3126 
3127 //==============================================================================
3128 //        TRISH Bits
3129 
3130 extern __at(0x0F99) __sfr TRISH;
3131 
3132 typedef union
3133   {
3134   struct
3135     {
3136     unsigned TRISH0             : 1;
3137     unsigned TRISH1             : 1;
3138     unsigned TRISH2             : 1;
3139     unsigned TRISH3             : 1;
3140     unsigned TRISH4             : 1;
3141     unsigned TRISH5             : 1;
3142     unsigned TRISH6             : 1;
3143     unsigned TRISH7             : 1;
3144     };
3145 
3146   struct
3147     {
3148     unsigned RH0                : 1;
3149     unsigned RH1                : 1;
3150     unsigned RH2                : 1;
3151     unsigned RH3                : 1;
3152     unsigned RH4                : 1;
3153     unsigned RH5                : 1;
3154     unsigned RH6                : 1;
3155     unsigned RH7                : 1;
3156     };
3157   } __TRISHbits_t;
3158 
3159 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
3160 
3161 #define _TRISH_TRISH0           0x01
3162 #define _TRISH_RH0              0x01
3163 #define _TRISH_TRISH1           0x02
3164 #define _TRISH_RH1              0x02
3165 #define _TRISH_TRISH2           0x04
3166 #define _TRISH_RH2              0x04
3167 #define _TRISH_TRISH3           0x08
3168 #define _TRISH_RH3              0x08
3169 #define _TRISH_TRISH4           0x10
3170 #define _TRISH_RH4              0x10
3171 #define _TRISH_TRISH5           0x20
3172 #define _TRISH_RH5              0x20
3173 #define _TRISH_TRISH6           0x40
3174 #define _TRISH_RH6              0x40
3175 #define _TRISH_TRISH7           0x80
3176 #define _TRISH_RH7              0x80
3177 
3178 //==============================================================================
3179 
3180 
3181 //==============================================================================
3182 //        DDRJ Bits
3183 
3184 extern __at(0x0F9A) __sfr DDRJ;
3185 
3186 typedef union
3187   {
3188   struct
3189     {
3190     unsigned TRISJ0             : 1;
3191     unsigned TRISJ1             : 1;
3192     unsigned TRISJ2             : 1;
3193     unsigned TRISJ3             : 1;
3194     unsigned TRISJ4             : 1;
3195     unsigned TRISJ5             : 1;
3196     unsigned TRISJ6             : 1;
3197     unsigned TRISJ7             : 1;
3198     };
3199 
3200   struct
3201     {
3202     unsigned RJ0                : 1;
3203     unsigned RJ1                : 1;
3204     unsigned RJ2                : 1;
3205     unsigned RJ3                : 1;
3206     unsigned RJ4                : 1;
3207     unsigned RJ5                : 1;
3208     unsigned RJ6                : 1;
3209     unsigned RJ7                : 1;
3210     };
3211   } __DDRJbits_t;
3212 
3213 extern __at(0x0F9A) volatile __DDRJbits_t DDRJbits;
3214 
3215 #define _TRISJ0                 0x01
3216 #define _RJ0                    0x01
3217 #define _TRISJ1                 0x02
3218 #define _RJ1                    0x02
3219 #define _TRISJ2                 0x04
3220 #define _RJ2                    0x04
3221 #define _TRISJ3                 0x08
3222 #define _RJ3                    0x08
3223 #define _TRISJ4                 0x10
3224 #define _RJ4                    0x10
3225 #define _TRISJ5                 0x20
3226 #define _RJ5                    0x20
3227 #define _TRISJ6                 0x40
3228 #define _RJ6                    0x40
3229 #define _TRISJ7                 0x80
3230 #define _RJ7                    0x80
3231 
3232 //==============================================================================
3233 
3234 
3235 //==============================================================================
3236 //        TRISJ Bits
3237 
3238 extern __at(0x0F9A) __sfr TRISJ;
3239 
3240 typedef union
3241   {
3242   struct
3243     {
3244     unsigned TRISJ0             : 1;
3245     unsigned TRISJ1             : 1;
3246     unsigned TRISJ2             : 1;
3247     unsigned TRISJ3             : 1;
3248     unsigned TRISJ4             : 1;
3249     unsigned TRISJ5             : 1;
3250     unsigned TRISJ6             : 1;
3251     unsigned TRISJ7             : 1;
3252     };
3253 
3254   struct
3255     {
3256     unsigned RJ0                : 1;
3257     unsigned RJ1                : 1;
3258     unsigned RJ2                : 1;
3259     unsigned RJ3                : 1;
3260     unsigned RJ4                : 1;
3261     unsigned RJ5                : 1;
3262     unsigned RJ6                : 1;
3263     unsigned RJ7                : 1;
3264     };
3265   } __TRISJbits_t;
3266 
3267 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
3268 
3269 #define _TRISJ_TRISJ0           0x01
3270 #define _TRISJ_RJ0              0x01
3271 #define _TRISJ_TRISJ1           0x02
3272 #define _TRISJ_RJ1              0x02
3273 #define _TRISJ_TRISJ2           0x04
3274 #define _TRISJ_RJ2              0x04
3275 #define _TRISJ_TRISJ3           0x08
3276 #define _TRISJ_RJ3              0x08
3277 #define _TRISJ_TRISJ4           0x10
3278 #define _TRISJ_RJ4              0x10
3279 #define _TRISJ_TRISJ5           0x20
3280 #define _TRISJ_RJ5              0x20
3281 #define _TRISJ_TRISJ6           0x40
3282 #define _TRISJ_RJ6              0x40
3283 #define _TRISJ_TRISJ7           0x80
3284 #define _TRISJ_RJ7              0x80
3285 
3286 //==============================================================================
3287 
3288 
3289 //==============================================================================
3290 //        OSCTUNE Bits
3291 
3292 extern __at(0x0F9B) __sfr OSCTUNE;
3293 
3294 typedef union
3295   {
3296   struct
3297     {
3298     unsigned TUN0               : 1;
3299     unsigned TUN1               : 1;
3300     unsigned TUN2               : 1;
3301     unsigned TUN3               : 1;
3302     unsigned TUN4               : 1;
3303     unsigned                    : 1;
3304     unsigned PLLEN              : 1;
3305     unsigned INTSRC             : 1;
3306     };
3307 
3308   struct
3309     {
3310     unsigned TUN                : 5;
3311     unsigned                    : 3;
3312     };
3313   } __OSCTUNEbits_t;
3314 
3315 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3316 
3317 #define _TUN0                   0x01
3318 #define _TUN1                   0x02
3319 #define _TUN2                   0x04
3320 #define _TUN3                   0x08
3321 #define _TUN4                   0x10
3322 #define _PLLEN                  0x40
3323 #define _INTSRC                 0x80
3324 
3325 //==============================================================================
3326 
3327 
3328 //==============================================================================
3329 //        MEMCON Bits
3330 
3331 extern __at(0x0F9C) __sfr MEMCON;
3332 
3333 typedef union
3334   {
3335   struct
3336     {
3337     unsigned WM0                : 1;
3338     unsigned WM1                : 1;
3339     unsigned                    : 1;
3340     unsigned                    : 1;
3341     unsigned WAIT0              : 1;
3342     unsigned WAIT1              : 1;
3343     unsigned                    : 1;
3344     unsigned EBDIS              : 1;
3345     };
3346 
3347   struct
3348     {
3349     unsigned WM                 : 2;
3350     unsigned                    : 6;
3351     };
3352 
3353   struct
3354     {
3355     unsigned                    : 4;
3356     unsigned WAIT               : 2;
3357     unsigned                    : 2;
3358     };
3359   } __MEMCONbits_t;
3360 
3361 extern __at(0x0F9C) volatile __MEMCONbits_t MEMCONbits;
3362 
3363 #define _WM0                    0x01
3364 #define _WM1                    0x02
3365 #define _WAIT0                  0x10
3366 #define _WAIT1                  0x20
3367 #define _EBDIS                  0x80
3368 
3369 //==============================================================================
3370 
3371 
3372 //==============================================================================
3373 //        PIE1 Bits
3374 
3375 extern __at(0x0F9D) __sfr PIE1;
3376 
3377 typedef union
3378   {
3379   struct
3380     {
3381     unsigned TMR1IE             : 1;
3382     unsigned TMR2IE             : 1;
3383     unsigned CCP1IE             : 1;
3384     unsigned SSP1IE             : 1;
3385     unsigned TX1IE              : 1;
3386     unsigned RC1IE              : 1;
3387     unsigned ADIE               : 1;
3388     unsigned PSPIE              : 1;
3389     };
3390 
3391   struct
3392     {
3393     unsigned                    : 1;
3394     unsigned                    : 1;
3395     unsigned                    : 1;
3396     unsigned SSPIE              : 1;
3397     unsigned TXIE               : 1;
3398     unsigned RCIE               : 1;
3399     unsigned                    : 1;
3400     unsigned                    : 1;
3401     };
3402   } __PIE1bits_t;
3403 
3404 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3405 
3406 #define _TMR1IE                 0x01
3407 #define _TMR2IE                 0x02
3408 #define _CCP1IE                 0x04
3409 #define _SSP1IE                 0x08
3410 #define _SSPIE                  0x08
3411 #define _TX1IE                  0x10
3412 #define _TXIE                   0x10
3413 #define _RC1IE                  0x20
3414 #define _RCIE                   0x20
3415 #define _ADIE                   0x40
3416 #define _PSPIE                  0x80
3417 
3418 //==============================================================================
3419 
3420 
3421 //==============================================================================
3422 //        PIR1 Bits
3423 
3424 extern __at(0x0F9E) __sfr PIR1;
3425 
3426 typedef union
3427   {
3428   struct
3429     {
3430     unsigned TMR1IF             : 1;
3431     unsigned TMR2IF             : 1;
3432     unsigned CCP1IF             : 1;
3433     unsigned SSP1IF             : 1;
3434     unsigned TX1IF              : 1;
3435     unsigned RC1IF              : 1;
3436     unsigned ADIF               : 1;
3437     unsigned PSPIF              : 1;
3438     };
3439 
3440   struct
3441     {
3442     unsigned                    : 1;
3443     unsigned                    : 1;
3444     unsigned                    : 1;
3445     unsigned SSPIF              : 1;
3446     unsigned TXIF               : 1;
3447     unsigned RCIF               : 1;
3448     unsigned                    : 1;
3449     unsigned                    : 1;
3450     };
3451   } __PIR1bits_t;
3452 
3453 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3454 
3455 #define _TMR1IF                 0x01
3456 #define _TMR2IF                 0x02
3457 #define _CCP1IF                 0x04
3458 #define _SSP1IF                 0x08
3459 #define _SSPIF                  0x08
3460 #define _TX1IF                  0x10
3461 #define _TXIF                   0x10
3462 #define _RC1IF                  0x20
3463 #define _RCIF                   0x20
3464 #define _ADIF                   0x40
3465 #define _PSPIF                  0x80
3466 
3467 //==============================================================================
3468 
3469 
3470 //==============================================================================
3471 //        IPR1 Bits
3472 
3473 extern __at(0x0F9F) __sfr IPR1;
3474 
3475 typedef union
3476   {
3477   struct
3478     {
3479     unsigned TMR1IP             : 1;
3480     unsigned TMR2IP             : 1;
3481     unsigned CCP1IP             : 1;
3482     unsigned SSP1IP             : 1;
3483     unsigned TX1IP              : 1;
3484     unsigned RC1IP              : 1;
3485     unsigned ADIP               : 1;
3486     unsigned PSPIP              : 1;
3487     };
3488 
3489   struct
3490     {
3491     unsigned                    : 1;
3492     unsigned                    : 1;
3493     unsigned                    : 1;
3494     unsigned SSPIP              : 1;
3495     unsigned TXIP               : 1;
3496     unsigned RCIP               : 1;
3497     unsigned                    : 1;
3498     unsigned                    : 1;
3499     };
3500   } __IPR1bits_t;
3501 
3502 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3503 
3504 #define _TMR1IP                 0x01
3505 #define _TMR2IP                 0x02
3506 #define _CCP1IP                 0x04
3507 #define _SSP1IP                 0x08
3508 #define _SSPIP                  0x08
3509 #define _TX1IP                  0x10
3510 #define _TXIP                   0x10
3511 #define _RC1IP                  0x20
3512 #define _RCIP                   0x20
3513 #define _ADIP                   0x40
3514 #define _PSPIP                  0x80
3515 
3516 //==============================================================================
3517 
3518 
3519 //==============================================================================
3520 //        PIE2 Bits
3521 
3522 extern __at(0x0FA0) __sfr PIE2;
3523 
3524 typedef union
3525   {
3526   struct
3527     {
3528     unsigned CCP2IE             : 1;
3529     unsigned TMR3IE             : 1;
3530     unsigned HLVDIE             : 1;
3531     unsigned BCL1IE             : 1;
3532     unsigned EEIE               : 1;
3533     unsigned                    : 1;
3534     unsigned CMIE               : 1;
3535     unsigned OSCFIE             : 1;
3536     };
3537 
3538   struct
3539     {
3540     unsigned                    : 1;
3541     unsigned                    : 1;
3542     unsigned LVDIE              : 1;
3543     unsigned BCLIE              : 1;
3544     unsigned                    : 1;
3545     unsigned                    : 1;
3546     unsigned                    : 1;
3547     unsigned                    : 1;
3548     };
3549   } __PIE2bits_t;
3550 
3551 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3552 
3553 #define _CCP2IE                 0x01
3554 #define _TMR3IE                 0x02
3555 #define _HLVDIE                 0x04
3556 #define _LVDIE                  0x04
3557 #define _BCL1IE                 0x08
3558 #define _BCLIE                  0x08
3559 #define _EEIE                   0x10
3560 #define _CMIE                   0x40
3561 #define _OSCFIE                 0x80
3562 
3563 //==============================================================================
3564 
3565 
3566 //==============================================================================
3567 //        PIR2 Bits
3568 
3569 extern __at(0x0FA1) __sfr PIR2;
3570 
3571 typedef union
3572   {
3573   struct
3574     {
3575     unsigned CCP2IF             : 1;
3576     unsigned TMR3IF             : 1;
3577     unsigned HLVDIF             : 1;
3578     unsigned BCL1IF             : 1;
3579     unsigned EEIF               : 1;
3580     unsigned                    : 1;
3581     unsigned CMIF               : 1;
3582     unsigned OSCFIF             : 1;
3583     };
3584 
3585   struct
3586     {
3587     unsigned                    : 1;
3588     unsigned                    : 1;
3589     unsigned LVDIF              : 1;
3590     unsigned BCLIF              : 1;
3591     unsigned                    : 1;
3592     unsigned                    : 1;
3593     unsigned                    : 1;
3594     unsigned                    : 1;
3595     };
3596   } __PIR2bits_t;
3597 
3598 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3599 
3600 #define _CCP2IF                 0x01
3601 #define _TMR3IF                 0x02
3602 #define _HLVDIF                 0x04
3603 #define _LVDIF                  0x04
3604 #define _BCL1IF                 0x08
3605 #define _BCLIF                  0x08
3606 #define _EEIF                   0x10
3607 #define _CMIF                   0x40
3608 #define _OSCFIF                 0x80
3609 
3610 //==============================================================================
3611 
3612 
3613 //==============================================================================
3614 //        IPR2 Bits
3615 
3616 extern __at(0x0FA2) __sfr IPR2;
3617 
3618 typedef union
3619   {
3620   struct
3621     {
3622     unsigned CCP2IP             : 1;
3623     unsigned TMR3IP             : 1;
3624     unsigned HLVDIP             : 1;
3625     unsigned BCL1IP             : 1;
3626     unsigned EEIP               : 1;
3627     unsigned                    : 1;
3628     unsigned CMIP               : 1;
3629     unsigned OSCFIP             : 1;
3630     };
3631 
3632   struct
3633     {
3634     unsigned                    : 1;
3635     unsigned                    : 1;
3636     unsigned LVDIP              : 1;
3637     unsigned BCLIP              : 1;
3638     unsigned                    : 1;
3639     unsigned                    : 1;
3640     unsigned                    : 1;
3641     unsigned                    : 1;
3642     };
3643   } __IPR2bits_t;
3644 
3645 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3646 
3647 #define _CCP2IP                 0x01
3648 #define _TMR3IP                 0x02
3649 #define _HLVDIP                 0x04
3650 #define _LVDIP                  0x04
3651 #define _BCL1IP                 0x08
3652 #define _BCLIP                  0x08
3653 #define _EEIP                   0x10
3654 #define _CMIP                   0x40
3655 #define _OSCFIP                 0x80
3656 
3657 //==============================================================================
3658 
3659 
3660 //==============================================================================
3661 //        PIE3 Bits
3662 
3663 extern __at(0x0FA3) __sfr PIE3;
3664 
3665 typedef struct
3666   {
3667   unsigned CCP3IE               : 1;
3668   unsigned CCP4IE               : 1;
3669   unsigned CCP5IE               : 1;
3670   unsigned TMR4IE               : 1;
3671   unsigned TX2IE                : 1;
3672   unsigned RC2IE                : 1;
3673   unsigned BCL2IE               : 1;
3674   unsigned SSP2IE               : 1;
3675   } __PIE3bits_t;
3676 
3677 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3678 
3679 #define _CCP3IE                 0x01
3680 #define _CCP4IE                 0x02
3681 #define _CCP5IE                 0x04
3682 #define _TMR4IE                 0x08
3683 #define _TX2IE                  0x10
3684 #define _RC2IE                  0x20
3685 #define _BCL2IE                 0x40
3686 #define _SSP2IE                 0x80
3687 
3688 //==============================================================================
3689 
3690 
3691 //==============================================================================
3692 //        PIR3 Bits
3693 
3694 extern __at(0x0FA4) __sfr PIR3;
3695 
3696 typedef struct
3697   {
3698   unsigned CCP3IF               : 1;
3699   unsigned CCP4IF               : 1;
3700   unsigned CCP5IF               : 1;
3701   unsigned TMR4IF               : 1;
3702   unsigned TX2IF                : 1;
3703   unsigned RC2IF                : 1;
3704   unsigned BCL2IF               : 1;
3705   unsigned SSP2IF               : 1;
3706   } __PIR3bits_t;
3707 
3708 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3709 
3710 #define _CCP3IF                 0x01
3711 #define _CCP4IF                 0x02
3712 #define _CCP5IF                 0x04
3713 #define _TMR4IF                 0x08
3714 #define _TX2IF                  0x10
3715 #define _RC2IF                  0x20
3716 #define _BCL2IF                 0x40
3717 #define _SSP2IF                 0x80
3718 
3719 //==============================================================================
3720 
3721 
3722 //==============================================================================
3723 //        IPR3 Bits
3724 
3725 extern __at(0x0FA5) __sfr IPR3;
3726 
3727 typedef struct
3728   {
3729   unsigned CCP3IP               : 1;
3730   unsigned CCP4IP               : 1;
3731   unsigned CCP5IP               : 1;
3732   unsigned TMR4IP               : 1;
3733   unsigned TX2IP                : 1;
3734   unsigned RC2IP                : 1;
3735   unsigned BCL2IP               : 1;
3736   unsigned SSP2IP               : 1;
3737   } __IPR3bits_t;
3738 
3739 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3740 
3741 #define _CCP3IP                 0x01
3742 #define _CCP4IP                 0x02
3743 #define _CCP5IP                 0x04
3744 #define _TMR4IP                 0x08
3745 #define _TX2IP                  0x10
3746 #define _RC2IP                  0x20
3747 #define _BCL2IP                 0x40
3748 #define _SSP2IP                 0x80
3749 
3750 //==============================================================================
3751 
3752 
3753 //==============================================================================
3754 //        EECON1 Bits
3755 
3756 extern __at(0x0FA6) __sfr EECON1;
3757 
3758 typedef struct
3759   {
3760   unsigned RD                   : 1;
3761   unsigned WR                   : 1;
3762   unsigned WREN                 : 1;
3763   unsigned WRERR                : 1;
3764   unsigned FREE                 : 1;
3765   unsigned                      : 1;
3766   unsigned CFGS                 : 1;
3767   unsigned EEPGD                : 1;
3768   } __EECON1bits_t;
3769 
3770 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3771 
3772 #define _RD                     0x01
3773 #define _WR                     0x02
3774 #define _WREN                   0x04
3775 #define _WRERR                  0x08
3776 #define _FREE                   0x10
3777 #define _CFGS                   0x40
3778 #define _EEPGD                  0x80
3779 
3780 //==============================================================================
3781 
3782 extern __at(0x0FA7) __sfr EECON2;
3783 extern __at(0x0FA8) __sfr EEDATA;
3784 extern __at(0x0FA9) __sfr EEADR;
3785 extern __at(0x0FAA) __sfr EEADRH;
3786 
3787 //==============================================================================
3788 //        RCSTA Bits
3789 
3790 extern __at(0x0FAB) __sfr RCSTA;
3791 
3792 typedef union
3793   {
3794   struct
3795     {
3796     unsigned RX9D               : 1;
3797     unsigned OERR               : 1;
3798     unsigned FERR               : 1;
3799     unsigned ADDEN              : 1;
3800     unsigned CREN               : 1;
3801     unsigned SREN               : 1;
3802     unsigned RX9                : 1;
3803     unsigned SPEN               : 1;
3804     };
3805 
3806   struct
3807     {
3808     unsigned RCD8               : 1;
3809     unsigned OERR1              : 1;
3810     unsigned FERR1              : 1;
3811     unsigned ADDEN1             : 1;
3812     unsigned CREN1              : 1;
3813     unsigned SREN1              : 1;
3814     unsigned RC9                : 1;
3815     unsigned SPEN1              : 1;
3816     };
3817 
3818   struct
3819     {
3820     unsigned RX9D1              : 1;
3821     unsigned                    : 1;
3822     unsigned                    : 1;
3823     unsigned                    : 1;
3824     unsigned                    : 1;
3825     unsigned                    : 1;
3826     unsigned NOT_RC8            : 1;
3827     unsigned                    : 1;
3828     };
3829 
3830   struct
3831     {
3832     unsigned                    : 1;
3833     unsigned                    : 1;
3834     unsigned                    : 1;
3835     unsigned                    : 1;
3836     unsigned                    : 1;
3837     unsigned                    : 1;
3838     unsigned RC8_9              : 1;
3839     unsigned                    : 1;
3840     };
3841 
3842   struct
3843     {
3844     unsigned                    : 1;
3845     unsigned                    : 1;
3846     unsigned                    : 1;
3847     unsigned                    : 1;
3848     unsigned                    : 1;
3849     unsigned                    : 1;
3850     unsigned RX91               : 1;
3851     unsigned                    : 1;
3852     };
3853   } __RCSTAbits_t;
3854 
3855 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3856 
3857 #define _RX9D                   0x01
3858 #define _RCD8                   0x01
3859 #define _RX9D1                  0x01
3860 #define _OERR                   0x02
3861 #define _OERR1                  0x02
3862 #define _FERR                   0x04
3863 #define _FERR1                  0x04
3864 #define _ADDEN                  0x08
3865 #define _ADDEN1                 0x08
3866 #define _CREN                   0x10
3867 #define _CREN1                  0x10
3868 #define _SREN                   0x20
3869 #define _SREN1                  0x20
3870 #define _RX9                    0x40
3871 #define _RC9                    0x40
3872 #define _NOT_RC8                0x40
3873 #define _RC8_9                  0x40
3874 #define _RX91                   0x40
3875 #define _SPEN                   0x80
3876 #define _SPEN1                  0x80
3877 
3878 //==============================================================================
3879 
3880 
3881 //==============================================================================
3882 //        RCSTA1 Bits
3883 
3884 extern __at(0x0FAB) __sfr RCSTA1;
3885 
3886 typedef union
3887   {
3888   struct
3889     {
3890     unsigned RX9D               : 1;
3891     unsigned OERR               : 1;
3892     unsigned FERR               : 1;
3893     unsigned ADDEN              : 1;
3894     unsigned CREN               : 1;
3895     unsigned SREN               : 1;
3896     unsigned RX9                : 1;
3897     unsigned SPEN               : 1;
3898     };
3899 
3900   struct
3901     {
3902     unsigned RCD8               : 1;
3903     unsigned OERR1              : 1;
3904     unsigned FERR1              : 1;
3905     unsigned ADDEN1             : 1;
3906     unsigned CREN1              : 1;
3907     unsigned SREN1              : 1;
3908     unsigned RC9                : 1;
3909     unsigned SPEN1              : 1;
3910     };
3911 
3912   struct
3913     {
3914     unsigned RX9D1              : 1;
3915     unsigned                    : 1;
3916     unsigned                    : 1;
3917     unsigned                    : 1;
3918     unsigned                    : 1;
3919     unsigned                    : 1;
3920     unsigned NOT_RC8            : 1;
3921     unsigned                    : 1;
3922     };
3923 
3924   struct
3925     {
3926     unsigned                    : 1;
3927     unsigned                    : 1;
3928     unsigned                    : 1;
3929     unsigned                    : 1;
3930     unsigned                    : 1;
3931     unsigned                    : 1;
3932     unsigned RC8_9              : 1;
3933     unsigned                    : 1;
3934     };
3935 
3936   struct
3937     {
3938     unsigned                    : 1;
3939     unsigned                    : 1;
3940     unsigned                    : 1;
3941     unsigned                    : 1;
3942     unsigned                    : 1;
3943     unsigned                    : 1;
3944     unsigned RX91               : 1;
3945     unsigned                    : 1;
3946     };
3947   } __RCSTA1bits_t;
3948 
3949 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
3950 
3951 #define _RCSTA1_RX9D            0x01
3952 #define _RCSTA1_RCD8            0x01
3953 #define _RCSTA1_RX9D1           0x01
3954 #define _RCSTA1_OERR            0x02
3955 #define _RCSTA1_OERR1           0x02
3956 #define _RCSTA1_FERR            0x04
3957 #define _RCSTA1_FERR1           0x04
3958 #define _RCSTA1_ADDEN           0x08
3959 #define _RCSTA1_ADDEN1          0x08
3960 #define _RCSTA1_CREN            0x10
3961 #define _RCSTA1_CREN1           0x10
3962 #define _RCSTA1_SREN            0x20
3963 #define _RCSTA1_SREN1           0x20
3964 #define _RCSTA1_RX9             0x40
3965 #define _RCSTA1_RC9             0x40
3966 #define _RCSTA1_NOT_RC8         0x40
3967 #define _RCSTA1_RC8_9           0x40
3968 #define _RCSTA1_RX91            0x40
3969 #define _RCSTA1_SPEN            0x80
3970 #define _RCSTA1_SPEN1           0x80
3971 
3972 //==============================================================================
3973 
3974 
3975 //==============================================================================
3976 //        TXSTA Bits
3977 
3978 extern __at(0x0FAC) __sfr TXSTA;
3979 
3980 typedef union
3981   {
3982   struct
3983     {
3984     unsigned TX9D               : 1;
3985     unsigned TRMT               : 1;
3986     unsigned BRGH               : 1;
3987     unsigned SENDB              : 1;
3988     unsigned SYNC               : 1;
3989     unsigned TXEN               : 1;
3990     unsigned TX9                : 1;
3991     unsigned CSRC               : 1;
3992     };
3993 
3994   struct
3995     {
3996     unsigned TXD8               : 1;
3997     unsigned TRMT1              : 1;
3998     unsigned BRGH1              : 1;
3999     unsigned SENDB1             : 1;
4000     unsigned SYNC1              : 1;
4001     unsigned TXEN1              : 1;
4002     unsigned TX8_9              : 1;
4003     unsigned CSRC1              : 1;
4004     };
4005 
4006   struct
4007     {
4008     unsigned TX9D1              : 1;
4009     unsigned                    : 1;
4010     unsigned                    : 1;
4011     unsigned                    : 1;
4012     unsigned                    : 1;
4013     unsigned                    : 1;
4014     unsigned NOT_TX8            : 1;
4015     unsigned                    : 1;
4016     };
4017 
4018   struct
4019     {
4020     unsigned                    : 1;
4021     unsigned                    : 1;
4022     unsigned                    : 1;
4023     unsigned                    : 1;
4024     unsigned                    : 1;
4025     unsigned                    : 1;
4026     unsigned TX91               : 1;
4027     unsigned                    : 1;
4028     };
4029   } __TXSTAbits_t;
4030 
4031 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
4032 
4033 #define _TX9D                   0x01
4034 #define _TXD8                   0x01
4035 #define _TX9D1                  0x01
4036 #define _TRMT                   0x02
4037 #define _TRMT1                  0x02
4038 #define _BRGH                   0x04
4039 #define _BRGH1                  0x04
4040 #define _SENDB                  0x08
4041 #define _SENDB1                 0x08
4042 #define _SYNC                   0x10
4043 #define _SYNC1                  0x10
4044 #define _TXEN                   0x20
4045 #define _TXEN1                  0x20
4046 #define _TX9                    0x40
4047 #define _TX8_9                  0x40
4048 #define _NOT_TX8                0x40
4049 #define _TX91                   0x40
4050 #define _CSRC                   0x80
4051 #define _CSRC1                  0x80
4052 
4053 //==============================================================================
4054 
4055 
4056 //==============================================================================
4057 //        TXSTA1 Bits
4058 
4059 extern __at(0x0FAC) __sfr TXSTA1;
4060 
4061 typedef union
4062   {
4063   struct
4064     {
4065     unsigned TX9D               : 1;
4066     unsigned TRMT               : 1;
4067     unsigned BRGH               : 1;
4068     unsigned SENDB              : 1;
4069     unsigned SYNC               : 1;
4070     unsigned TXEN               : 1;
4071     unsigned TX9                : 1;
4072     unsigned CSRC               : 1;
4073     };
4074 
4075   struct
4076     {
4077     unsigned TXD8               : 1;
4078     unsigned TRMT1              : 1;
4079     unsigned BRGH1              : 1;
4080     unsigned SENDB1             : 1;
4081     unsigned SYNC1              : 1;
4082     unsigned TXEN1              : 1;
4083     unsigned TX8_9              : 1;
4084     unsigned CSRC1              : 1;
4085     };
4086 
4087   struct
4088     {
4089     unsigned TX9D1              : 1;
4090     unsigned                    : 1;
4091     unsigned                    : 1;
4092     unsigned                    : 1;
4093     unsigned                    : 1;
4094     unsigned                    : 1;
4095     unsigned NOT_TX8            : 1;
4096     unsigned                    : 1;
4097     };
4098 
4099   struct
4100     {
4101     unsigned                    : 1;
4102     unsigned                    : 1;
4103     unsigned                    : 1;
4104     unsigned                    : 1;
4105     unsigned                    : 1;
4106     unsigned                    : 1;
4107     unsigned TX91               : 1;
4108     unsigned                    : 1;
4109     };
4110   } __TXSTA1bits_t;
4111 
4112 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
4113 
4114 #define _TXSTA1_TX9D            0x01
4115 #define _TXSTA1_TXD8            0x01
4116 #define _TXSTA1_TX9D1           0x01
4117 #define _TXSTA1_TRMT            0x02
4118 #define _TXSTA1_TRMT1           0x02
4119 #define _TXSTA1_BRGH            0x04
4120 #define _TXSTA1_BRGH1           0x04
4121 #define _TXSTA1_SENDB           0x08
4122 #define _TXSTA1_SENDB1          0x08
4123 #define _TXSTA1_SYNC            0x10
4124 #define _TXSTA1_SYNC1           0x10
4125 #define _TXSTA1_TXEN            0x20
4126 #define _TXSTA1_TXEN1           0x20
4127 #define _TXSTA1_TX9             0x40
4128 #define _TXSTA1_TX8_9           0x40
4129 #define _TXSTA1_NOT_TX8         0x40
4130 #define _TXSTA1_TX91            0x40
4131 #define _TXSTA1_CSRC            0x80
4132 #define _TXSTA1_CSRC1           0x80
4133 
4134 //==============================================================================
4135 
4136 extern __at(0x0FAD) __sfr TXREG;
4137 extern __at(0x0FAD) __sfr TXREG1;
4138 extern __at(0x0FAE) __sfr RCREG;
4139 extern __at(0x0FAE) __sfr RCREG1;
4140 extern __at(0x0FAF) __sfr SPBRG;
4141 extern __at(0x0FAF) __sfr SPBRG1;
4142 
4143 //==============================================================================
4144 //        PSPCON Bits
4145 
4146 extern __at(0x0FB0) __sfr PSPCON;
4147 
4148 typedef struct
4149   {
4150   unsigned                      : 1;
4151   unsigned                      : 1;
4152   unsigned                      : 1;
4153   unsigned                      : 1;
4154   unsigned PSPMODE              : 1;
4155   unsigned IBOV                 : 1;
4156   unsigned OBF                  : 1;
4157   unsigned IBF                  : 1;
4158   } __PSPCONbits_t;
4159 
4160 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
4161 
4162 #define _PSPMODE                0x10
4163 #define _IBOV                   0x20
4164 #define _OBF                    0x40
4165 #define _IBF                    0x80
4166 
4167 //==============================================================================
4168 
4169 
4170 //==============================================================================
4171 //        T3CON Bits
4172 
4173 extern __at(0x0FB1) __sfr T3CON;
4174 
4175 typedef union
4176   {
4177   struct
4178     {
4179     unsigned TMR3ON             : 1;
4180     unsigned TMR3CS             : 1;
4181     unsigned NOT_T3SYNC         : 1;
4182     unsigned T3CCP1             : 1;
4183     unsigned T3CKPS0            : 1;
4184     unsigned T3CKPS1            : 1;
4185     unsigned T3CCP2             : 1;
4186     unsigned RD16               : 1;
4187     };
4188 
4189   struct
4190     {
4191     unsigned                    : 1;
4192     unsigned                    : 1;
4193     unsigned T3SYNC             : 1;
4194     unsigned                    : 1;
4195     unsigned                    : 1;
4196     unsigned                    : 1;
4197     unsigned                    : 1;
4198     unsigned                    : 1;
4199     };
4200 
4201   struct
4202     {
4203     unsigned                    : 1;
4204     unsigned                    : 1;
4205     unsigned T3INSYNC           : 1;
4206     unsigned                    : 1;
4207     unsigned                    : 1;
4208     unsigned                    : 1;
4209     unsigned                    : 1;
4210     unsigned                    : 1;
4211     };
4212 
4213   struct
4214     {
4215     unsigned                    : 4;
4216     unsigned T3CKPS             : 2;
4217     unsigned                    : 2;
4218     };
4219   } __T3CONbits_t;
4220 
4221 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
4222 
4223 #define _T3CON_TMR3ON           0x01
4224 #define _T3CON_TMR3CS           0x02
4225 #define _T3CON_NOT_T3SYNC       0x04
4226 #define _T3CON_T3SYNC           0x04
4227 #define _T3CON_T3INSYNC         0x04
4228 #define _T3CON_T3CCP1           0x08
4229 #define _T3CON_T3CKPS0          0x10
4230 #define _T3CON_T3CKPS1          0x20
4231 #define _T3CON_T3CCP2           0x40
4232 #define _T3CON_RD16             0x80
4233 
4234 //==============================================================================
4235 
4236 extern __at(0x0FB2) __sfr TMR3;
4237 extern __at(0x0FB2) __sfr TMR3L;
4238 extern __at(0x0FB3) __sfr TMR3H;
4239 
4240 //==============================================================================
4241 //        CMCON Bits
4242 
4243 extern __at(0x0FB4) __sfr CMCON;
4244 
4245 typedef union
4246   {
4247   struct
4248     {
4249     unsigned CM0                : 1;
4250     unsigned CM1                : 1;
4251     unsigned CM2                : 1;
4252     unsigned CIS                : 1;
4253     unsigned C1INV              : 1;
4254     unsigned C2INV              : 1;
4255     unsigned C1OUT              : 1;
4256     unsigned C2OUT              : 1;
4257     };
4258 
4259   struct
4260     {
4261     unsigned CM                 : 3;
4262     unsigned                    : 5;
4263     };
4264   } __CMCONbits_t;
4265 
4266 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
4267 
4268 #define _CM0                    0x01
4269 #define _CM1                    0x02
4270 #define _CM2                    0x04
4271 #define _CIS                    0x08
4272 #define _C1INV                  0x10
4273 #define _C2INV                  0x20
4274 #define _C1OUT                  0x40
4275 #define _C2OUT                  0x80
4276 
4277 //==============================================================================
4278 
4279 
4280 //==============================================================================
4281 //        CVRCON Bits
4282 
4283 extern __at(0x0FB5) __sfr CVRCON;
4284 
4285 typedef union
4286   {
4287   struct
4288     {
4289     unsigned CVR0               : 1;
4290     unsigned CVR1               : 1;
4291     unsigned CVR2               : 1;
4292     unsigned CVR3               : 1;
4293     unsigned CVRSS              : 1;
4294     unsigned CVRR               : 1;
4295     unsigned CVROE              : 1;
4296     unsigned CVREN              : 1;
4297     };
4298 
4299   struct
4300     {
4301     unsigned CVR                : 4;
4302     unsigned                    : 4;
4303     };
4304   } __CVRCONbits_t;
4305 
4306 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
4307 
4308 #define _CVR0                   0x01
4309 #define _CVR1                   0x02
4310 #define _CVR2                   0x04
4311 #define _CVR3                   0x08
4312 #define _CVRSS                  0x10
4313 #define _CVRR                   0x20
4314 #define _CVROE                  0x40
4315 #define _CVREN                  0x80
4316 
4317 //==============================================================================
4318 
4319 
4320 //==============================================================================
4321 //        ECCP1AS Bits
4322 
4323 extern __at(0x0FB6) __sfr ECCP1AS;
4324 
4325 typedef union
4326   {
4327   struct
4328     {
4329     unsigned PSS1BD0            : 1;
4330     unsigned PSS1BD1            : 1;
4331     unsigned PSS1AC0            : 1;
4332     unsigned PSS1AC1            : 1;
4333     unsigned ECCP1AS0           : 1;
4334     unsigned ECCP1AS1           : 1;
4335     unsigned ECCP1AS2           : 1;
4336     unsigned ECCP1ASE           : 1;
4337     };
4338 
4339   struct
4340     {
4341     unsigned PSSBD0             : 1;
4342     unsigned PSSBD1             : 1;
4343     unsigned PSSAC0             : 1;
4344     unsigned PSSAC1             : 1;
4345     unsigned ECCPAS0            : 1;
4346     unsigned ECCPAS1            : 1;
4347     unsigned ECCPAS2            : 1;
4348     unsigned ECCPASE            : 1;
4349     };
4350 
4351   struct
4352     {
4353     unsigned PSSBD              : 2;
4354     unsigned                    : 6;
4355     };
4356 
4357   struct
4358     {
4359     unsigned PSS1BD             : 2;
4360     unsigned                    : 6;
4361     };
4362 
4363   struct
4364     {
4365     unsigned                    : 2;
4366     unsigned PSS1AC             : 2;
4367     unsigned                    : 4;
4368     };
4369 
4370   struct
4371     {
4372     unsigned                    : 2;
4373     unsigned PSSAC              : 2;
4374     unsigned                    : 4;
4375     };
4376 
4377   struct
4378     {
4379     unsigned                    : 4;
4380     unsigned ECCP1AS            : 3;
4381     unsigned                    : 1;
4382     };
4383 
4384   struct
4385     {
4386     unsigned                    : 4;
4387     unsigned ECCPAS             : 3;
4388     unsigned                    : 1;
4389     };
4390   } __ECCP1ASbits_t;
4391 
4392 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
4393 
4394 #define _PSS1BD0                0x01
4395 #define _PSSBD0                 0x01
4396 #define _PSS1BD1                0x02
4397 #define _PSSBD1                 0x02
4398 #define _PSS1AC0                0x04
4399 #define _PSSAC0                 0x04
4400 #define _PSS1AC1                0x08
4401 #define _PSSAC1                 0x08
4402 #define _ECCP1AS0               0x10
4403 #define _ECCPAS0                0x10
4404 #define _ECCP1AS1               0x20
4405 #define _ECCPAS1                0x20
4406 #define _ECCP1AS2               0x40
4407 #define _ECCPAS2                0x40
4408 #define _ECCP1ASE               0x80
4409 #define _ECCPASE                0x80
4410 
4411 //==============================================================================
4412 
4413 
4414 //==============================================================================
4415 //        CCP3CON Bits
4416 
4417 extern __at(0x0FB7) __sfr CCP3CON;
4418 
4419 typedef union
4420   {
4421   struct
4422     {
4423     unsigned CCP3M0             : 1;
4424     unsigned CCP3M1             : 1;
4425     unsigned CCP3M2             : 1;
4426     unsigned CCP3M3             : 1;
4427     unsigned DC3B0              : 1;
4428     unsigned DC3B1              : 1;
4429     unsigned P3M0               : 1;
4430     unsigned P3M1               : 1;
4431     };
4432 
4433   struct
4434     {
4435     unsigned                    : 1;
4436     unsigned                    : 1;
4437     unsigned                    : 1;
4438     unsigned                    : 1;
4439     unsigned CCP3Y              : 1;
4440     unsigned CCP3X              : 1;
4441     unsigned                    : 1;
4442     unsigned                    : 1;
4443     };
4444 
4445   struct
4446     {
4447     unsigned CCP3M              : 4;
4448     unsigned                    : 4;
4449     };
4450 
4451   struct
4452     {
4453     unsigned                    : 4;
4454     unsigned DC3B               : 2;
4455     unsigned                    : 2;
4456     };
4457 
4458   struct
4459     {
4460     unsigned                    : 6;
4461     unsigned P3M                : 2;
4462     };
4463   } __CCP3CONbits_t;
4464 
4465 extern __at(0x0FB7) volatile __CCP3CONbits_t CCP3CONbits;
4466 
4467 #define _CCP3M0                 0x01
4468 #define _CCP3M1                 0x02
4469 #define _CCP3M2                 0x04
4470 #define _CCP3M3                 0x08
4471 #define _DC3B0                  0x10
4472 #define _CCP3Y                  0x10
4473 #define _DC3B1                  0x20
4474 #define _CCP3X                  0x20
4475 #define _P3M0                   0x40
4476 #define _P3M1                   0x80
4477 
4478 //==============================================================================
4479 
4480 
4481 //==============================================================================
4482 //        ECCP3CON Bits
4483 
4484 extern __at(0x0FB7) __sfr ECCP3CON;
4485 
4486 typedef union
4487   {
4488   struct
4489     {
4490     unsigned CCP3M0             : 1;
4491     unsigned CCP3M1             : 1;
4492     unsigned CCP3M2             : 1;
4493     unsigned CCP3M3             : 1;
4494     unsigned DC3B0              : 1;
4495     unsigned DC3B1              : 1;
4496     unsigned P3M0               : 1;
4497     unsigned P3M1               : 1;
4498     };
4499 
4500   struct
4501     {
4502     unsigned                    : 1;
4503     unsigned                    : 1;
4504     unsigned                    : 1;
4505     unsigned                    : 1;
4506     unsigned CCP3Y              : 1;
4507     unsigned CCP3X              : 1;
4508     unsigned                    : 1;
4509     unsigned                    : 1;
4510     };
4511 
4512   struct
4513     {
4514     unsigned CCP3M              : 4;
4515     unsigned                    : 4;
4516     };
4517 
4518   struct
4519     {
4520     unsigned                    : 4;
4521     unsigned DC3B               : 2;
4522     unsigned                    : 2;
4523     };
4524 
4525   struct
4526     {
4527     unsigned                    : 6;
4528     unsigned P3M                : 2;
4529     };
4530   } __ECCP3CONbits_t;
4531 
4532 extern __at(0x0FB7) volatile __ECCP3CONbits_t ECCP3CONbits;
4533 
4534 #define _ECCP3CON_CCP3M0        0x01
4535 #define _ECCP3CON_CCP3M1        0x02
4536 #define _ECCP3CON_CCP3M2        0x04
4537 #define _ECCP3CON_CCP3M3        0x08
4538 #define _ECCP3CON_DC3B0         0x10
4539 #define _ECCP3CON_CCP3Y         0x10
4540 #define _ECCP3CON_DC3B1         0x20
4541 #define _ECCP3CON_CCP3X         0x20
4542 #define _ECCP3CON_P3M0          0x40
4543 #define _ECCP3CON_P3M1          0x80
4544 
4545 //==============================================================================
4546 
4547 extern __at(0x0FB8) __sfr CCPR3;
4548 extern __at(0x0FB8) __sfr CCPR3L;
4549 extern __at(0x0FB9) __sfr CCPR3H;
4550 
4551 //==============================================================================
4552 //        CCP2CON Bits
4553 
4554 extern __at(0x0FBA) __sfr CCP2CON;
4555 
4556 typedef union
4557   {
4558   struct
4559     {
4560     unsigned CCP2M0             : 1;
4561     unsigned CCP2M1             : 1;
4562     unsigned CCP2M2             : 1;
4563     unsigned CCP2M3             : 1;
4564     unsigned DC2B0              : 1;
4565     unsigned DC2B1              : 1;
4566     unsigned P2M0               : 1;
4567     unsigned P2M1               : 1;
4568     };
4569 
4570   struct
4571     {
4572     unsigned                    : 1;
4573     unsigned                    : 1;
4574     unsigned                    : 1;
4575     unsigned                    : 1;
4576     unsigned CCP2Y              : 1;
4577     unsigned CCP2X              : 1;
4578     unsigned                    : 1;
4579     unsigned                    : 1;
4580     };
4581 
4582   struct
4583     {
4584     unsigned CCP2M              : 4;
4585     unsigned                    : 4;
4586     };
4587 
4588   struct
4589     {
4590     unsigned                    : 4;
4591     unsigned DC2B               : 2;
4592     unsigned                    : 2;
4593     };
4594 
4595   struct
4596     {
4597     unsigned                    : 6;
4598     unsigned P2M                : 2;
4599     };
4600   } __CCP2CONbits_t;
4601 
4602 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
4603 
4604 #define _CCP2M0                 0x01
4605 #define _CCP2M1                 0x02
4606 #define _CCP2M2                 0x04
4607 #define _CCP2M3                 0x08
4608 #define _DC2B0                  0x10
4609 #define _CCP2Y                  0x10
4610 #define _DC2B1                  0x20
4611 #define _CCP2X                  0x20
4612 #define _P2M0                   0x40
4613 #define _P2M1                   0x80
4614 
4615 //==============================================================================
4616 
4617 
4618 //==============================================================================
4619 //        ECCP2CON Bits
4620 
4621 extern __at(0x0FBA) __sfr ECCP2CON;
4622 
4623 typedef union
4624   {
4625   struct
4626     {
4627     unsigned CCP2M0             : 1;
4628     unsigned CCP2M1             : 1;
4629     unsigned CCP2M2             : 1;
4630     unsigned CCP2M3             : 1;
4631     unsigned DC2B0              : 1;
4632     unsigned DC2B1              : 1;
4633     unsigned P2M0               : 1;
4634     unsigned P2M1               : 1;
4635     };
4636 
4637   struct
4638     {
4639     unsigned                    : 1;
4640     unsigned                    : 1;
4641     unsigned                    : 1;
4642     unsigned                    : 1;
4643     unsigned CCP2Y              : 1;
4644     unsigned CCP2X              : 1;
4645     unsigned                    : 1;
4646     unsigned                    : 1;
4647     };
4648 
4649   struct
4650     {
4651     unsigned CCP2M              : 4;
4652     unsigned                    : 4;
4653     };
4654 
4655   struct
4656     {
4657     unsigned                    : 4;
4658     unsigned DC2B               : 2;
4659     unsigned                    : 2;
4660     };
4661 
4662   struct
4663     {
4664     unsigned                    : 6;
4665     unsigned P2M                : 2;
4666     };
4667   } __ECCP2CONbits_t;
4668 
4669 extern __at(0x0FBA) volatile __ECCP2CONbits_t ECCP2CONbits;
4670 
4671 #define _ECCP2CON_CCP2M0        0x01
4672 #define _ECCP2CON_CCP2M1        0x02
4673 #define _ECCP2CON_CCP2M2        0x04
4674 #define _ECCP2CON_CCP2M3        0x08
4675 #define _ECCP2CON_DC2B0         0x10
4676 #define _ECCP2CON_CCP2Y         0x10
4677 #define _ECCP2CON_DC2B1         0x20
4678 #define _ECCP2CON_CCP2X         0x20
4679 #define _ECCP2CON_P2M0          0x40
4680 #define _ECCP2CON_P2M1          0x80
4681 
4682 //==============================================================================
4683 
4684 extern __at(0x0FBB) __sfr CCPR2;
4685 extern __at(0x0FBB) __sfr CCPR2L;
4686 extern __at(0x0FBC) __sfr CCPR2H;
4687 
4688 //==============================================================================
4689 //        CCP1CON Bits
4690 
4691 extern __at(0x0FBD) __sfr CCP1CON;
4692 
4693 typedef union
4694   {
4695   struct
4696     {
4697     unsigned CCP1M0             : 1;
4698     unsigned CCP1M1             : 1;
4699     unsigned CCP1M2             : 1;
4700     unsigned CCP1M3             : 1;
4701     unsigned DC1B0              : 1;
4702     unsigned DC1B1              : 1;
4703     unsigned P1M0               : 1;
4704     unsigned P1M1               : 1;
4705     };
4706 
4707   struct
4708     {
4709     unsigned                    : 1;
4710     unsigned                    : 1;
4711     unsigned                    : 1;
4712     unsigned                    : 1;
4713     unsigned CCP1Y              : 1;
4714     unsigned CCP1X              : 1;
4715     unsigned                    : 1;
4716     unsigned                    : 1;
4717     };
4718 
4719   struct
4720     {
4721     unsigned CCP1M              : 4;
4722     unsigned                    : 4;
4723     };
4724 
4725   struct
4726     {
4727     unsigned                    : 4;
4728     unsigned DC1B               : 2;
4729     unsigned                    : 2;
4730     };
4731 
4732   struct
4733     {
4734     unsigned                    : 6;
4735     unsigned P1M                : 2;
4736     };
4737   } __CCP1CONbits_t;
4738 
4739 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
4740 
4741 #define _CCP1M0                 0x01
4742 #define _CCP1M1                 0x02
4743 #define _CCP1M2                 0x04
4744 #define _CCP1M3                 0x08
4745 #define _DC1B0                  0x10
4746 #define _CCP1Y                  0x10
4747 #define _DC1B1                  0x20
4748 #define _CCP1X                  0x20
4749 #define _P1M0                   0x40
4750 #define _P1M1                   0x80
4751 
4752 //==============================================================================
4753 
4754 
4755 //==============================================================================
4756 //        ECCP1CON Bits
4757 
4758 extern __at(0x0FBD) __sfr ECCP1CON;
4759 
4760 typedef union
4761   {
4762   struct
4763     {
4764     unsigned CCP1M0             : 1;
4765     unsigned CCP1M1             : 1;
4766     unsigned CCP1M2             : 1;
4767     unsigned CCP1M3             : 1;
4768     unsigned DC1B0              : 1;
4769     unsigned DC1B1              : 1;
4770     unsigned P1M0               : 1;
4771     unsigned P1M1               : 1;
4772     };
4773 
4774   struct
4775     {
4776     unsigned                    : 1;
4777     unsigned                    : 1;
4778     unsigned                    : 1;
4779     unsigned                    : 1;
4780     unsigned CCP1Y              : 1;
4781     unsigned CCP1X              : 1;
4782     unsigned                    : 1;
4783     unsigned                    : 1;
4784     };
4785 
4786   struct
4787     {
4788     unsigned CCP1M              : 4;
4789     unsigned                    : 4;
4790     };
4791 
4792   struct
4793     {
4794     unsigned                    : 4;
4795     unsigned DC1B               : 2;
4796     unsigned                    : 2;
4797     };
4798 
4799   struct
4800     {
4801     unsigned                    : 6;
4802     unsigned P1M                : 2;
4803     };
4804   } __ECCP1CONbits_t;
4805 
4806 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
4807 
4808 #define _ECCP1CON_CCP1M0        0x01
4809 #define _ECCP1CON_CCP1M1        0x02
4810 #define _ECCP1CON_CCP1M2        0x04
4811 #define _ECCP1CON_CCP1M3        0x08
4812 #define _ECCP1CON_DC1B0         0x10
4813 #define _ECCP1CON_CCP1Y         0x10
4814 #define _ECCP1CON_DC1B1         0x20
4815 #define _ECCP1CON_CCP1X         0x20
4816 #define _ECCP1CON_P1M0          0x40
4817 #define _ECCP1CON_P1M1          0x80
4818 
4819 //==============================================================================
4820 
4821 extern __at(0x0FBE) __sfr CCPR1;
4822 extern __at(0x0FBE) __sfr CCPR1L;
4823 extern __at(0x0FBF) __sfr CCPR1H;
4824 
4825 //==============================================================================
4826 //        ADCON2 Bits
4827 
4828 extern __at(0x0FC0) __sfr ADCON2;
4829 
4830 typedef union
4831   {
4832   struct
4833     {
4834     unsigned ADCS0              : 1;
4835     unsigned ADCS1              : 1;
4836     unsigned ADCS2              : 1;
4837     unsigned ACQT0              : 1;
4838     unsigned ACQT1              : 1;
4839     unsigned ACQT2              : 1;
4840     unsigned                    : 1;
4841     unsigned ADFM               : 1;
4842     };
4843 
4844   struct
4845     {
4846     unsigned ADCS               : 3;
4847     unsigned                    : 5;
4848     };
4849 
4850   struct
4851     {
4852     unsigned                    : 3;
4853     unsigned ACQT               : 3;
4854     unsigned                    : 2;
4855     };
4856   } __ADCON2bits_t;
4857 
4858 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4859 
4860 #define _ADCS0                  0x01
4861 #define _ADCS1                  0x02
4862 #define _ADCS2                  0x04
4863 #define _ACQT0                  0x08
4864 #define _ACQT1                  0x10
4865 #define _ACQT2                  0x20
4866 #define _ADFM                   0x80
4867 
4868 //==============================================================================
4869 
4870 
4871 //==============================================================================
4872 //        ADCON1 Bits
4873 
4874 extern __at(0x0FC1) __sfr ADCON1;
4875 
4876 typedef union
4877   {
4878   struct
4879     {
4880     unsigned PCFG0              : 1;
4881     unsigned PCFG1              : 1;
4882     unsigned PCFG2              : 1;
4883     unsigned PCFG3              : 1;
4884     unsigned VCFG0              : 1;
4885     unsigned VCFG1              : 1;
4886     unsigned                    : 1;
4887     unsigned                    : 1;
4888     };
4889 
4890   struct
4891     {
4892     unsigned PCFG               : 4;
4893     unsigned                    : 4;
4894     };
4895 
4896   struct
4897     {
4898     unsigned                    : 4;
4899     unsigned VCFG               : 2;
4900     unsigned                    : 2;
4901     };
4902   } __ADCON1bits_t;
4903 
4904 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4905 
4906 #define _PCFG0                  0x01
4907 #define _PCFG1                  0x02
4908 #define _PCFG2                  0x04
4909 #define _PCFG3                  0x08
4910 #define _VCFG0                  0x10
4911 #define _VCFG1                  0x20
4912 
4913 //==============================================================================
4914 
4915 
4916 //==============================================================================
4917 //        ADCON0 Bits
4918 
4919 extern __at(0x0FC2) __sfr ADCON0;
4920 
4921 typedef union
4922   {
4923   struct
4924     {
4925     unsigned ADON               : 1;
4926     unsigned GO_NOT_DONE        : 1;
4927     unsigned CHS0               : 1;
4928     unsigned CHS1               : 1;
4929     unsigned CHS2               : 1;
4930     unsigned CHS3               : 1;
4931     unsigned                    : 1;
4932     unsigned                    : 1;
4933     };
4934 
4935   struct
4936     {
4937     unsigned                    : 1;
4938     unsigned DONE               : 1;
4939     unsigned                    : 1;
4940     unsigned                    : 1;
4941     unsigned                    : 1;
4942     unsigned                    : 1;
4943     unsigned                    : 1;
4944     unsigned                    : 1;
4945     };
4946 
4947   struct
4948     {
4949     unsigned                    : 1;
4950     unsigned GO_DONE            : 1;
4951     unsigned                    : 1;
4952     unsigned                    : 1;
4953     unsigned                    : 1;
4954     unsigned                    : 1;
4955     unsigned                    : 1;
4956     unsigned                    : 1;
4957     };
4958 
4959   struct
4960     {
4961     unsigned                    : 1;
4962     unsigned GO                 : 1;
4963     unsigned                    : 1;
4964     unsigned                    : 1;
4965     unsigned                    : 1;
4966     unsigned                    : 1;
4967     unsigned                    : 1;
4968     unsigned                    : 1;
4969     };
4970 
4971   struct
4972     {
4973     unsigned                    : 1;
4974     unsigned NOT_DONE           : 1;
4975     unsigned                    : 1;
4976     unsigned                    : 1;
4977     unsigned                    : 1;
4978     unsigned                    : 1;
4979     unsigned                    : 1;
4980     unsigned                    : 1;
4981     };
4982 
4983   struct
4984     {
4985     unsigned                    : 2;
4986     unsigned CHS                : 4;
4987     unsigned                    : 2;
4988     };
4989   } __ADCON0bits_t;
4990 
4991 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4992 
4993 #define _ADON                   0x01
4994 #define _GO_NOT_DONE            0x02
4995 #define _DONE                   0x02
4996 #define _GO_DONE                0x02
4997 #define _GO                     0x02
4998 #define _NOT_DONE               0x02
4999 #define _CHS0                   0x04
5000 #define _CHS1                   0x08
5001 #define _CHS2                   0x10
5002 #define _CHS3                   0x20
5003 
5004 //==============================================================================
5005 
5006 extern __at(0x0FC3) __sfr ADRES;
5007 extern __at(0x0FC3) __sfr ADRESL;
5008 extern __at(0x0FC4) __sfr ADRESH;
5009 
5010 //==============================================================================
5011 //        SSP1CON2 Bits
5012 
5013 extern __at(0x0FC5) __sfr SSP1CON2;
5014 
5015 typedef struct
5016   {
5017   unsigned SEN                  : 1;
5018   unsigned RSEN                 : 1;
5019   unsigned PEN                  : 1;
5020   unsigned RCEN                 : 1;
5021   unsigned ACKEN                : 1;
5022   unsigned ACKDT                : 1;
5023   unsigned ACKSTAT              : 1;
5024   unsigned GCEN                 : 1;
5025   } __SSP1CON2bits_t;
5026 
5027 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5028 
5029 #define _SEN                    0x01
5030 #define _RSEN                   0x02
5031 #define _PEN                    0x04
5032 #define _RCEN                   0x08
5033 #define _ACKEN                  0x10
5034 #define _ACKDT                  0x20
5035 #define _ACKSTAT                0x40
5036 #define _GCEN                   0x80
5037 
5038 //==============================================================================
5039 
5040 
5041 //==============================================================================
5042 //        SSPCON2 Bits
5043 
5044 extern __at(0x0FC5) __sfr SSPCON2;
5045 
5046 typedef struct
5047   {
5048   unsigned SEN                  : 1;
5049   unsigned RSEN                 : 1;
5050   unsigned PEN                  : 1;
5051   unsigned RCEN                 : 1;
5052   unsigned ACKEN                : 1;
5053   unsigned ACKDT                : 1;
5054   unsigned ACKSTAT              : 1;
5055   unsigned GCEN                 : 1;
5056   } __SSPCON2bits_t;
5057 
5058 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5059 
5060 #define _SSPCON2_SEN            0x01
5061 #define _SSPCON2_RSEN           0x02
5062 #define _SSPCON2_PEN            0x04
5063 #define _SSPCON2_RCEN           0x08
5064 #define _SSPCON2_ACKEN          0x10
5065 #define _SSPCON2_ACKDT          0x20
5066 #define _SSPCON2_ACKSTAT        0x40
5067 #define _SSPCON2_GCEN           0x80
5068 
5069 //==============================================================================
5070 
5071 
5072 //==============================================================================
5073 //        SSP1CON1 Bits
5074 
5075 extern __at(0x0FC6) __sfr SSP1CON1;
5076 
5077 typedef union
5078   {
5079   struct
5080     {
5081     unsigned SSPM0              : 1;
5082     unsigned SSPM1              : 1;
5083     unsigned SSPM2              : 1;
5084     unsigned SSPM3              : 1;
5085     unsigned CKP                : 1;
5086     unsigned SSPEN              : 1;
5087     unsigned SSPOV              : 1;
5088     unsigned WCOL               : 1;
5089     };
5090 
5091   struct
5092     {
5093     unsigned SSPM               : 4;
5094     unsigned                    : 4;
5095     };
5096   } __SSP1CON1bits_t;
5097 
5098 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5099 
5100 #define _SSPM0                  0x01
5101 #define _SSPM1                  0x02
5102 #define _SSPM2                  0x04
5103 #define _SSPM3                  0x08
5104 #define _CKP                    0x10
5105 #define _SSPEN                  0x20
5106 #define _SSPOV                  0x40
5107 #define _WCOL                   0x80
5108 
5109 //==============================================================================
5110 
5111 
5112 //==============================================================================
5113 //        SSPCON1 Bits
5114 
5115 extern __at(0x0FC6) __sfr SSPCON1;
5116 
5117 typedef union
5118   {
5119   struct
5120     {
5121     unsigned SSPM0              : 1;
5122     unsigned SSPM1              : 1;
5123     unsigned SSPM2              : 1;
5124     unsigned SSPM3              : 1;
5125     unsigned CKP                : 1;
5126     unsigned SSPEN              : 1;
5127     unsigned SSPOV              : 1;
5128     unsigned WCOL               : 1;
5129     };
5130 
5131   struct
5132     {
5133     unsigned SSPM               : 4;
5134     unsigned                    : 4;
5135     };
5136   } __SSPCON1bits_t;
5137 
5138 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5139 
5140 #define _SSPCON1_SSPM0          0x01
5141 #define _SSPCON1_SSPM1          0x02
5142 #define _SSPCON1_SSPM2          0x04
5143 #define _SSPCON1_SSPM3          0x08
5144 #define _SSPCON1_CKP            0x10
5145 #define _SSPCON1_SSPEN          0x20
5146 #define _SSPCON1_SSPOV          0x40
5147 #define _SSPCON1_WCOL           0x80
5148 
5149 //==============================================================================
5150 
5151 
5152 //==============================================================================
5153 //        SSP1STAT Bits
5154 
5155 extern __at(0x0FC7) __sfr SSP1STAT;
5156 
5157 typedef union
5158   {
5159   struct
5160     {
5161     unsigned BF                 : 1;
5162     unsigned UA                 : 1;
5163     unsigned R_NOT_W            : 1;
5164     unsigned S                  : 1;
5165     unsigned P                  : 1;
5166     unsigned D_NOT_A            : 1;
5167     unsigned CKE                : 1;
5168     unsigned SMP                : 1;
5169     };
5170 
5171   struct
5172     {
5173     unsigned                    : 1;
5174     unsigned                    : 1;
5175     unsigned R_W                : 1;
5176     unsigned I2C_START          : 1;
5177     unsigned I2C_STOP           : 1;
5178     unsigned D_A                : 1;
5179     unsigned                    : 1;
5180     unsigned                    : 1;
5181     };
5182 
5183   struct
5184     {
5185     unsigned                    : 1;
5186     unsigned                    : 1;
5187     unsigned I2C_READ           : 1;
5188     unsigned                    : 1;
5189     unsigned                    : 1;
5190     unsigned I2C_DAT            : 1;
5191     unsigned                    : 1;
5192     unsigned                    : 1;
5193     };
5194 
5195   struct
5196     {
5197     unsigned                    : 1;
5198     unsigned                    : 1;
5199     unsigned NOT_W              : 1;
5200     unsigned                    : 1;
5201     unsigned                    : 1;
5202     unsigned NOT_A              : 1;
5203     unsigned                    : 1;
5204     unsigned                    : 1;
5205     };
5206 
5207   struct
5208     {
5209     unsigned                    : 1;
5210     unsigned                    : 1;
5211     unsigned NOT_WRITE          : 1;
5212     unsigned                    : 1;
5213     unsigned                    : 1;
5214     unsigned NOT_ADDRESS        : 1;
5215     unsigned                    : 1;
5216     unsigned                    : 1;
5217     };
5218 
5219   struct
5220     {
5221     unsigned                    : 1;
5222     unsigned                    : 1;
5223     unsigned READ_WRITE         : 1;
5224     unsigned                    : 1;
5225     unsigned                    : 1;
5226     unsigned DATA_ADDRESS       : 1;
5227     unsigned                    : 1;
5228     unsigned                    : 1;
5229     };
5230 
5231   struct
5232     {
5233     unsigned                    : 1;
5234     unsigned                    : 1;
5235     unsigned R                  : 1;
5236     unsigned                    : 1;
5237     unsigned                    : 1;
5238     unsigned D                  : 1;
5239     unsigned                    : 1;
5240     unsigned                    : 1;
5241     };
5242   } __SSP1STATbits_t;
5243 
5244 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5245 
5246 #define _BF                     0x01
5247 #define _UA                     0x02
5248 #define _R_NOT_W                0x04
5249 #define _R_W                    0x04
5250 #define _I2C_READ               0x04
5251 #define _NOT_W                  0x04
5252 #define _NOT_WRITE              0x04
5253 #define _READ_WRITE             0x04
5254 #define _R                      0x04
5255 #define _S                      0x08
5256 #define _I2C_START              0x08
5257 #define _P                      0x10
5258 #define _I2C_STOP               0x10
5259 #define _D_NOT_A                0x20
5260 #define _D_A                    0x20
5261 #define _I2C_DAT                0x20
5262 #define _NOT_A                  0x20
5263 #define _NOT_ADDRESS            0x20
5264 #define _DATA_ADDRESS           0x20
5265 #define _D                      0x20
5266 #define _CKE                    0x40
5267 #define _SMP                    0x80
5268 
5269 //==============================================================================
5270 
5271 
5272 //==============================================================================
5273 //        SSPSTAT Bits
5274 
5275 extern __at(0x0FC7) __sfr SSPSTAT;
5276 
5277 typedef union
5278   {
5279   struct
5280     {
5281     unsigned BF                 : 1;
5282     unsigned UA                 : 1;
5283     unsigned R_NOT_W            : 1;
5284     unsigned S                  : 1;
5285     unsigned P                  : 1;
5286     unsigned D_NOT_A            : 1;
5287     unsigned CKE                : 1;
5288     unsigned SMP                : 1;
5289     };
5290 
5291   struct
5292     {
5293     unsigned                    : 1;
5294     unsigned                    : 1;
5295     unsigned R_W                : 1;
5296     unsigned I2C_START          : 1;
5297     unsigned I2C_STOP           : 1;
5298     unsigned D_A                : 1;
5299     unsigned                    : 1;
5300     unsigned                    : 1;
5301     };
5302 
5303   struct
5304     {
5305     unsigned                    : 1;
5306     unsigned                    : 1;
5307     unsigned I2C_READ           : 1;
5308     unsigned                    : 1;
5309     unsigned                    : 1;
5310     unsigned I2C_DAT            : 1;
5311     unsigned                    : 1;
5312     unsigned                    : 1;
5313     };
5314 
5315   struct
5316     {
5317     unsigned                    : 1;
5318     unsigned                    : 1;
5319     unsigned NOT_W              : 1;
5320     unsigned                    : 1;
5321     unsigned                    : 1;
5322     unsigned NOT_A              : 1;
5323     unsigned                    : 1;
5324     unsigned                    : 1;
5325     };
5326 
5327   struct
5328     {
5329     unsigned                    : 1;
5330     unsigned                    : 1;
5331     unsigned NOT_WRITE          : 1;
5332     unsigned                    : 1;
5333     unsigned                    : 1;
5334     unsigned NOT_ADDRESS        : 1;
5335     unsigned                    : 1;
5336     unsigned                    : 1;
5337     };
5338 
5339   struct
5340     {
5341     unsigned                    : 1;
5342     unsigned                    : 1;
5343     unsigned READ_WRITE         : 1;
5344     unsigned                    : 1;
5345     unsigned                    : 1;
5346     unsigned DATA_ADDRESS       : 1;
5347     unsigned                    : 1;
5348     unsigned                    : 1;
5349     };
5350 
5351   struct
5352     {
5353     unsigned                    : 1;
5354     unsigned                    : 1;
5355     unsigned R                  : 1;
5356     unsigned                    : 1;
5357     unsigned                    : 1;
5358     unsigned D                  : 1;
5359     unsigned                    : 1;
5360     unsigned                    : 1;
5361     };
5362   } __SSPSTATbits_t;
5363 
5364 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5365 
5366 #define _SSPSTAT_BF             0x01
5367 #define _SSPSTAT_UA             0x02
5368 #define _SSPSTAT_R_NOT_W        0x04
5369 #define _SSPSTAT_R_W            0x04
5370 #define _SSPSTAT_I2C_READ       0x04
5371 #define _SSPSTAT_NOT_W          0x04
5372 #define _SSPSTAT_NOT_WRITE      0x04
5373 #define _SSPSTAT_READ_WRITE     0x04
5374 #define _SSPSTAT_R              0x04
5375 #define _SSPSTAT_S              0x08
5376 #define _SSPSTAT_I2C_START      0x08
5377 #define _SSPSTAT_P              0x10
5378 #define _SSPSTAT_I2C_STOP       0x10
5379 #define _SSPSTAT_D_NOT_A        0x20
5380 #define _SSPSTAT_D_A            0x20
5381 #define _SSPSTAT_I2C_DAT        0x20
5382 #define _SSPSTAT_NOT_A          0x20
5383 #define _SSPSTAT_NOT_ADDRESS    0x20
5384 #define _SSPSTAT_DATA_ADDRESS   0x20
5385 #define _SSPSTAT_D              0x20
5386 #define _SSPSTAT_CKE            0x40
5387 #define _SSPSTAT_SMP            0x80
5388 
5389 //==============================================================================
5390 
5391 extern __at(0x0FC8) __sfr SSP1ADD;
5392 extern __at(0x0FC8) __sfr SSPADD;
5393 extern __at(0x0FC9) __sfr SSP1BUF;
5394 extern __at(0x0FC9) __sfr SSPBUF;
5395 
5396 //==============================================================================
5397 //        T2CON Bits
5398 
5399 extern __at(0x0FCA) __sfr T2CON;
5400 
5401 typedef union
5402   {
5403   struct
5404     {
5405     unsigned T2CKPS0            : 1;
5406     unsigned T2CKPS1            : 1;
5407     unsigned TMR2ON             : 1;
5408     unsigned T2OUTPS0           : 1;
5409     unsigned T2OUTPS1           : 1;
5410     unsigned T2OUTPS2           : 1;
5411     unsigned T2OUTPS3           : 1;
5412     unsigned                    : 1;
5413     };
5414 
5415   struct
5416     {
5417     unsigned T2CKPS             : 2;
5418     unsigned                    : 6;
5419     };
5420 
5421   struct
5422     {
5423     unsigned                    : 3;
5424     unsigned T2OUTPS            : 4;
5425     unsigned                    : 1;
5426     };
5427   } __T2CONbits_t;
5428 
5429 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5430 
5431 #define _T2CKPS0                0x01
5432 #define _T2CKPS1                0x02
5433 #define _TMR2ON                 0x04
5434 #define _T2OUTPS0               0x08
5435 #define _T2OUTPS1               0x10
5436 #define _T2OUTPS2               0x20
5437 #define _T2OUTPS3               0x40
5438 
5439 //==============================================================================
5440 
5441 extern __at(0x0FCB) __sfr PR2;
5442 extern __at(0x0FCC) __sfr TMR2;
5443 
5444 //==============================================================================
5445 //        T1CON Bits
5446 
5447 extern __at(0x0FCD) __sfr T1CON;
5448 
5449 typedef union
5450   {
5451   struct
5452     {
5453     unsigned TMR1ON             : 1;
5454     unsigned TMR1CS             : 1;
5455     unsigned NOT_T1SYNC         : 1;
5456     unsigned T1OSCEN            : 1;
5457     unsigned T1CKPS0            : 1;
5458     unsigned T1CKPS1            : 1;
5459     unsigned T1RUN              : 1;
5460     unsigned RD16               : 1;
5461     };
5462 
5463   struct
5464     {
5465     unsigned                    : 1;
5466     unsigned                    : 1;
5467     unsigned T1SYNC             : 1;
5468     unsigned                    : 1;
5469     unsigned                    : 1;
5470     unsigned                    : 1;
5471     unsigned                    : 1;
5472     unsigned                    : 1;
5473     };
5474 
5475   struct
5476     {
5477     unsigned                    : 1;
5478     unsigned                    : 1;
5479     unsigned T1INSYNC           : 1;
5480     unsigned                    : 1;
5481     unsigned                    : 1;
5482     unsigned                    : 1;
5483     unsigned                    : 1;
5484     unsigned                    : 1;
5485     };
5486 
5487   struct
5488     {
5489     unsigned                    : 4;
5490     unsigned T1CKPS             : 2;
5491     unsigned                    : 2;
5492     };
5493   } __T1CONbits_t;
5494 
5495 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5496 
5497 #define _TMR1ON                 0x01
5498 #define _TMR1CS                 0x02
5499 #define _NOT_T1SYNC             0x04
5500 #define _T1SYNC                 0x04
5501 #define _T1INSYNC               0x04
5502 #define _T1OSCEN                0x08
5503 #define _T1CKPS0                0x10
5504 #define _T1CKPS1                0x20
5505 #define _T1RUN                  0x40
5506 #define _RD16                   0x80
5507 
5508 //==============================================================================
5509 
5510 extern __at(0x0FCE) __sfr TMR1;
5511 extern __at(0x0FCE) __sfr TMR1L;
5512 extern __at(0x0FCF) __sfr TMR1H;
5513 
5514 //==============================================================================
5515 //        RCON Bits
5516 
5517 extern __at(0x0FD0) __sfr RCON;
5518 
5519 typedef union
5520   {
5521   struct
5522     {
5523     unsigned NOT_BOR            : 1;
5524     unsigned NOT_POR            : 1;
5525     unsigned NOT_PD             : 1;
5526     unsigned NOT_TO             : 1;
5527     unsigned NOT_RI             : 1;
5528     unsigned                    : 1;
5529     unsigned SBOREN             : 1;
5530     unsigned IPEN               : 1;
5531     };
5532 
5533   struct
5534     {
5535     unsigned BOR                : 1;
5536     unsigned POR                : 1;
5537     unsigned PD                 : 1;
5538     unsigned TO                 : 1;
5539     unsigned RI                 : 1;
5540     unsigned                    : 1;
5541     unsigned                    : 1;
5542     unsigned                    : 1;
5543     };
5544   } __RCONbits_t;
5545 
5546 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5547 
5548 #define _NOT_BOR                0x01
5549 #define _BOR                    0x01
5550 #define _NOT_POR                0x02
5551 #define _POR                    0x02
5552 #define _NOT_PD                 0x04
5553 #define _PD                     0x04
5554 #define _NOT_TO                 0x08
5555 #define _TO                     0x08
5556 #define _NOT_RI                 0x10
5557 #define _RI                     0x10
5558 #define _SBOREN                 0x40
5559 #define _IPEN                   0x80
5560 
5561 //==============================================================================
5562 
5563 
5564 //==============================================================================
5565 //        WDTCON Bits
5566 
5567 extern __at(0x0FD1) __sfr WDTCON;
5568 
5569 typedef union
5570   {
5571   struct
5572     {
5573     unsigned SWDTEN             : 1;
5574     unsigned                    : 1;
5575     unsigned                    : 1;
5576     unsigned                    : 1;
5577     unsigned                    : 1;
5578     unsigned                    : 1;
5579     unsigned                    : 1;
5580     unsigned                    : 1;
5581     };
5582 
5583   struct
5584     {
5585     unsigned SWDTE              : 1;
5586     unsigned                    : 1;
5587     unsigned                    : 1;
5588     unsigned                    : 1;
5589     unsigned                    : 1;
5590     unsigned                    : 1;
5591     unsigned                    : 1;
5592     unsigned                    : 1;
5593     };
5594   } __WDTCONbits_t;
5595 
5596 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5597 
5598 #define _SWDTEN                 0x01
5599 #define _SWDTE                  0x01
5600 
5601 //==============================================================================
5602 
5603 
5604 //==============================================================================
5605 //        HLVDCON Bits
5606 
5607 extern __at(0x0FD2) __sfr HLVDCON;
5608 
5609 typedef union
5610   {
5611   struct
5612     {
5613     unsigned HLVDL0             : 1;
5614     unsigned HLVDL1             : 1;
5615     unsigned HLVDL2             : 1;
5616     unsigned HLVDL3             : 1;
5617     unsigned HLVDEN             : 1;
5618     unsigned IRVST              : 1;
5619     unsigned                    : 1;
5620     unsigned VDIRMAG            : 1;
5621     };
5622 
5623   struct
5624     {
5625     unsigned LVV0               : 1;
5626     unsigned LVV1               : 1;
5627     unsigned LVV2               : 1;
5628     unsigned LVV3               : 1;
5629     unsigned LVDEN              : 1;
5630     unsigned IVRST              : 1;
5631     unsigned                    : 1;
5632     unsigned                    : 1;
5633     };
5634 
5635   struct
5636     {
5637     unsigned LVDL0              : 1;
5638     unsigned LVDL1              : 1;
5639     unsigned LVDL2              : 1;
5640     unsigned LVDL3              : 1;
5641     unsigned                    : 1;
5642     unsigned BGST               : 1;
5643     unsigned                    : 1;
5644     unsigned                    : 1;
5645     };
5646 
5647   struct
5648     {
5649     unsigned HLVDL              : 4;
5650     unsigned                    : 4;
5651     };
5652 
5653   struct
5654     {
5655     unsigned LVV                : 4;
5656     unsigned                    : 4;
5657     };
5658 
5659   struct
5660     {
5661     unsigned LVDL               : 4;
5662     unsigned                    : 4;
5663     };
5664   } __HLVDCONbits_t;
5665 
5666 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
5667 
5668 #define _HLVDL0                 0x01
5669 #define _LVV0                   0x01
5670 #define _LVDL0                  0x01
5671 #define _HLVDL1                 0x02
5672 #define _LVV1                   0x02
5673 #define _LVDL1                  0x02
5674 #define _HLVDL2                 0x04
5675 #define _LVV2                   0x04
5676 #define _LVDL2                  0x04
5677 #define _HLVDL3                 0x08
5678 #define _LVV3                   0x08
5679 #define _LVDL3                  0x08
5680 #define _HLVDEN                 0x10
5681 #define _LVDEN                  0x10
5682 #define _IRVST                  0x20
5683 #define _IVRST                  0x20
5684 #define _BGST                   0x20
5685 #define _VDIRMAG                0x80
5686 
5687 //==============================================================================
5688 
5689 
5690 //==============================================================================
5691 //        LVDCON Bits
5692 
5693 extern __at(0x0FD2) __sfr LVDCON;
5694 
5695 typedef union
5696   {
5697   struct
5698     {
5699     unsigned HLVDL0             : 1;
5700     unsigned HLVDL1             : 1;
5701     unsigned HLVDL2             : 1;
5702     unsigned HLVDL3             : 1;
5703     unsigned HLVDEN             : 1;
5704     unsigned IRVST              : 1;
5705     unsigned                    : 1;
5706     unsigned VDIRMAG            : 1;
5707     };
5708 
5709   struct
5710     {
5711     unsigned LVV0               : 1;
5712     unsigned LVV1               : 1;
5713     unsigned LVV2               : 1;
5714     unsigned LVV3               : 1;
5715     unsigned LVDEN              : 1;
5716     unsigned IVRST              : 1;
5717     unsigned                    : 1;
5718     unsigned                    : 1;
5719     };
5720 
5721   struct
5722     {
5723     unsigned LVDL0              : 1;
5724     unsigned LVDL1              : 1;
5725     unsigned LVDL2              : 1;
5726     unsigned LVDL3              : 1;
5727     unsigned                    : 1;
5728     unsigned BGST               : 1;
5729     unsigned                    : 1;
5730     unsigned                    : 1;
5731     };
5732 
5733   struct
5734     {
5735     unsigned HLVDL              : 4;
5736     unsigned                    : 4;
5737     };
5738 
5739   struct
5740     {
5741     unsigned LVV                : 4;
5742     unsigned                    : 4;
5743     };
5744 
5745   struct
5746     {
5747     unsigned LVDL               : 4;
5748     unsigned                    : 4;
5749     };
5750   } __LVDCONbits_t;
5751 
5752 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
5753 
5754 #define _LVDCON_HLVDL0          0x01
5755 #define _LVDCON_LVV0            0x01
5756 #define _LVDCON_LVDL0           0x01
5757 #define _LVDCON_HLVDL1          0x02
5758 #define _LVDCON_LVV1            0x02
5759 #define _LVDCON_LVDL1           0x02
5760 #define _LVDCON_HLVDL2          0x04
5761 #define _LVDCON_LVV2            0x04
5762 #define _LVDCON_LVDL2           0x04
5763 #define _LVDCON_HLVDL3          0x08
5764 #define _LVDCON_LVV3            0x08
5765 #define _LVDCON_LVDL3           0x08
5766 #define _LVDCON_HLVDEN          0x10
5767 #define _LVDCON_LVDEN           0x10
5768 #define _LVDCON_IRVST           0x20
5769 #define _LVDCON_IVRST           0x20
5770 #define _LVDCON_BGST            0x20
5771 #define _LVDCON_VDIRMAG         0x80
5772 
5773 //==============================================================================
5774 
5775 
5776 //==============================================================================
5777 //        OSCCON Bits
5778 
5779 extern __at(0x0FD3) __sfr OSCCON;
5780 
5781 typedef union
5782   {
5783   struct
5784     {
5785     unsigned SCS0               : 1;
5786     unsigned SCS1               : 1;
5787     unsigned IOFS               : 1;
5788     unsigned OSTS               : 1;
5789     unsigned IRCF0              : 1;
5790     unsigned IRCF1              : 1;
5791     unsigned IRCF2              : 1;
5792     unsigned IDLEN              : 1;
5793     };
5794 
5795   struct
5796     {
5797     unsigned                    : 1;
5798     unsigned                    : 1;
5799     unsigned FLTS               : 1;
5800     unsigned                    : 1;
5801     unsigned                    : 1;
5802     unsigned                    : 1;
5803     unsigned                    : 1;
5804     unsigned                    : 1;
5805     };
5806 
5807   struct
5808     {
5809     unsigned SCS                : 2;
5810     unsigned                    : 6;
5811     };
5812 
5813   struct
5814     {
5815     unsigned                    : 4;
5816     unsigned IRCF               : 3;
5817     unsigned                    : 1;
5818     };
5819   } __OSCCONbits_t;
5820 
5821 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5822 
5823 #define _SCS0                   0x01
5824 #define _SCS1                   0x02
5825 #define _IOFS                   0x04
5826 #define _FLTS                   0x04
5827 #define _OSTS                   0x08
5828 #define _IRCF0                  0x10
5829 #define _IRCF1                  0x20
5830 #define _IRCF2                  0x40
5831 #define _IDLEN                  0x80
5832 
5833 //==============================================================================
5834 
5835 
5836 //==============================================================================
5837 //        T0CON Bits
5838 
5839 extern __at(0x0FD5) __sfr T0CON;
5840 
5841 typedef union
5842   {
5843   struct
5844     {
5845     unsigned T0PS0              : 1;
5846     unsigned T0PS1              : 1;
5847     unsigned T0PS2              : 1;
5848     unsigned PSA                : 1;
5849     unsigned T0SE               : 1;
5850     unsigned T0CS               : 1;
5851     unsigned T08BIT             : 1;
5852     unsigned TMR0ON             : 1;
5853     };
5854 
5855   struct
5856     {
5857     unsigned                    : 1;
5858     unsigned                    : 1;
5859     unsigned                    : 1;
5860     unsigned T0PS3              : 1;
5861     unsigned                    : 1;
5862     unsigned                    : 1;
5863     unsigned                    : 1;
5864     unsigned                    : 1;
5865     };
5866 
5867   struct
5868     {
5869     unsigned T0PS               : 4;
5870     unsigned                    : 4;
5871     };
5872   } __T0CONbits_t;
5873 
5874 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5875 
5876 #define _T0PS0                  0x01
5877 #define _T0PS1                  0x02
5878 #define _T0PS2                  0x04
5879 #define _PSA                    0x08
5880 #define _T0PS3                  0x08
5881 #define _T0SE                   0x10
5882 #define _T0CS                   0x20
5883 #define _T08BIT                 0x40
5884 #define _TMR0ON                 0x80
5885 
5886 //==============================================================================
5887 
5888 extern __at(0x0FD6) __sfr TMR0;
5889 extern __at(0x0FD6) __sfr TMR0L;
5890 extern __at(0x0FD7) __sfr TMR0H;
5891 
5892 //==============================================================================
5893 //        STATUS Bits
5894 
5895 extern __at(0x0FD8) __sfr STATUS;
5896 
5897 typedef struct
5898   {
5899   unsigned C                    : 1;
5900   unsigned DC                   : 1;
5901   unsigned Z                    : 1;
5902   unsigned OV                   : 1;
5903   unsigned N                    : 1;
5904   unsigned                      : 1;
5905   unsigned                      : 1;
5906   unsigned                      : 1;
5907   } __STATUSbits_t;
5908 
5909 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5910 
5911 #define _C                      0x01
5912 #define _DC                     0x02
5913 #define _Z                      0x04
5914 #define _OV                     0x08
5915 #define _N                      0x10
5916 
5917 //==============================================================================
5918 
5919 extern __at(0x0FD9) __sfr FSR2L;
5920 extern __at(0x0FDA) __sfr FSR2H;
5921 extern __at(0x0FDB) __sfr PLUSW2;
5922 extern __at(0x0FDC) __sfr PREINC2;
5923 extern __at(0x0FDD) __sfr POSTDEC2;
5924 extern __at(0x0FDE) __sfr POSTINC2;
5925 extern __at(0x0FDF) __sfr INDF2;
5926 extern __at(0x0FE0) __sfr BSR;
5927 extern __at(0x0FE1) __sfr FSR1L;
5928 extern __at(0x0FE2) __sfr FSR1H;
5929 extern __at(0x0FE3) __sfr PLUSW1;
5930 extern __at(0x0FE4) __sfr PREINC1;
5931 extern __at(0x0FE5) __sfr POSTDEC1;
5932 extern __at(0x0FE6) __sfr POSTINC1;
5933 extern __at(0x0FE7) __sfr INDF1;
5934 extern __at(0x0FE8) __sfr WREG;
5935 extern __at(0x0FE9) __sfr FSR0L;
5936 extern __at(0x0FEA) __sfr FSR0H;
5937 extern __at(0x0FEB) __sfr PLUSW0;
5938 extern __at(0x0FEC) __sfr PREINC0;
5939 extern __at(0x0FED) __sfr POSTDEC0;
5940 extern __at(0x0FEE) __sfr POSTINC0;
5941 extern __at(0x0FEF) __sfr INDF0;
5942 
5943 //==============================================================================
5944 //        INTCON3 Bits
5945 
5946 extern __at(0x0FF0) __sfr INTCON3;
5947 
5948 typedef union
5949   {
5950   struct
5951     {
5952     unsigned INT1IF             : 1;
5953     unsigned INT2IF             : 1;
5954     unsigned INT3IF             : 1;
5955     unsigned INT1IE             : 1;
5956     unsigned INT2IE             : 1;
5957     unsigned INT3IE             : 1;
5958     unsigned INT1IP             : 1;
5959     unsigned INT2IP             : 1;
5960     };
5961 
5962   struct
5963     {
5964     unsigned INT1F              : 1;
5965     unsigned INT2F              : 1;
5966     unsigned INT3F              : 1;
5967     unsigned INT1E              : 1;
5968     unsigned INT2E              : 1;
5969     unsigned INT3E              : 1;
5970     unsigned INT1P              : 1;
5971     unsigned INT2P              : 1;
5972     };
5973   } __INTCON3bits_t;
5974 
5975 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5976 
5977 #define _INT1IF                 0x01
5978 #define _INT1F                  0x01
5979 #define _INT2IF                 0x02
5980 #define _INT2F                  0x02
5981 #define _INT3IF                 0x04
5982 #define _INT3F                  0x04
5983 #define _INT1IE                 0x08
5984 #define _INT1E                  0x08
5985 #define _INT2IE                 0x10
5986 #define _INT2E                  0x10
5987 #define _INT3IE                 0x20
5988 #define _INT3E                  0x20
5989 #define _INT1IP                 0x40
5990 #define _INT1P                  0x40
5991 #define _INT2IP                 0x80
5992 #define _INT2P                  0x80
5993 
5994 //==============================================================================
5995 
5996 
5997 //==============================================================================
5998 //        INTCON2 Bits
5999 
6000 extern __at(0x0FF1) __sfr INTCON2;
6001 
6002 typedef union
6003   {
6004   struct
6005     {
6006     unsigned RBIP               : 1;
6007     unsigned INT3IP             : 1;
6008     unsigned TMR0IP             : 1;
6009     unsigned INTEDG3            : 1;
6010     unsigned INTEDG2            : 1;
6011     unsigned INTEDG1            : 1;
6012     unsigned INTEDG0            : 1;
6013     unsigned NOT_RBPU           : 1;
6014     };
6015 
6016   struct
6017     {
6018     unsigned                    : 1;
6019     unsigned INT3P              : 1;
6020     unsigned T0IP               : 1;
6021     unsigned                    : 1;
6022     unsigned                    : 1;
6023     unsigned                    : 1;
6024     unsigned                    : 1;
6025     unsigned RBPU               : 1;
6026     };
6027   } __INTCON2bits_t;
6028 
6029 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6030 
6031 #define _RBIP                   0x01
6032 #define _INT3IP                 0x02
6033 #define _INT3P                  0x02
6034 #define _TMR0IP                 0x04
6035 #define _T0IP                   0x04
6036 #define _INTEDG3                0x08
6037 #define _INTEDG2                0x10
6038 #define _INTEDG1                0x20
6039 #define _INTEDG0                0x40
6040 #define _NOT_RBPU               0x80
6041 #define _RBPU                   0x80
6042 
6043 //==============================================================================
6044 
6045 
6046 //==============================================================================
6047 //        INTCON Bits
6048 
6049 extern __at(0x0FF2) __sfr INTCON;
6050 
6051 typedef union
6052   {
6053   struct
6054     {
6055     unsigned RBIF               : 1;
6056     unsigned INT0IF             : 1;
6057     unsigned TMR0IF             : 1;
6058     unsigned RBIE               : 1;
6059     unsigned INT0IE             : 1;
6060     unsigned TMR0IE             : 1;
6061     unsigned PEIE_GIEL          : 1;
6062     unsigned GIE_GIEH           : 1;
6063     };
6064 
6065   struct
6066     {
6067     unsigned                    : 1;
6068     unsigned INT0F              : 1;
6069     unsigned T0IF               : 1;
6070     unsigned                    : 1;
6071     unsigned INT0E              : 1;
6072     unsigned T0IE               : 1;
6073     unsigned PEIE               : 1;
6074     unsigned GIE                : 1;
6075     };
6076 
6077   struct
6078     {
6079     unsigned                    : 1;
6080     unsigned                    : 1;
6081     unsigned                    : 1;
6082     unsigned                    : 1;
6083     unsigned                    : 1;
6084     unsigned                    : 1;
6085     unsigned GIEL               : 1;
6086     unsigned GIEH               : 1;
6087     };
6088   } __INTCONbits_t;
6089 
6090 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6091 
6092 #define _RBIF                   0x01
6093 #define _INT0IF                 0x02
6094 #define _INT0F                  0x02
6095 #define _TMR0IF                 0x04
6096 #define _T0IF                   0x04
6097 #define _RBIE                   0x08
6098 #define _INT0IE                 0x10
6099 #define _INT0E                  0x10
6100 #define _TMR0IE                 0x20
6101 #define _T0IE                   0x20
6102 #define _PEIE_GIEL              0x40
6103 #define _PEIE                   0x40
6104 #define _GIEL                   0x40
6105 #define _GIE_GIEH               0x80
6106 #define _GIE                    0x80
6107 #define _GIEH                   0x80
6108 
6109 //==============================================================================
6110 
6111 extern __at(0x0FF3) __sfr PROD;
6112 extern __at(0x0FF3) __sfr PRODL;
6113 extern __at(0x0FF4) __sfr PRODH;
6114 extern __at(0x0FF5) __sfr TABLAT;
6115 extern __at(0x0FF6) __sfr TBLPTR;
6116 extern __at(0x0FF6) __sfr TBLPTRL;
6117 extern __at(0x0FF7) __sfr TBLPTRH;
6118 extern __at(0x0FF8) __sfr TBLPTRU;
6119 extern __at(0x0FF9) __sfr PC;
6120 extern __at(0x0FF9) __sfr PCL;
6121 extern __at(0x0FFA) __sfr PCLATH;
6122 extern __at(0x0FFB) __sfr PCLATU;
6123 
6124 //==============================================================================
6125 //        STKPTR Bits
6126 
6127 extern __at(0x0FFC) __sfr STKPTR;
6128 
6129 typedef union
6130   {
6131   struct
6132     {
6133     unsigned STKPTR0            : 1;
6134     unsigned STKPTR1            : 1;
6135     unsigned STKPTR2            : 1;
6136     unsigned STKPTR3            : 1;
6137     unsigned STKPTR4            : 1;
6138     unsigned                    : 1;
6139     unsigned STKUNF             : 1;
6140     unsigned STKFUL             : 1;
6141     };
6142 
6143   struct
6144     {
6145     unsigned SP0                : 1;
6146     unsigned SP1                : 1;
6147     unsigned SP2                : 1;
6148     unsigned SP3                : 1;
6149     unsigned SP4                : 1;
6150     unsigned                    : 1;
6151     unsigned                    : 1;
6152     unsigned STKOVF             : 1;
6153     };
6154 
6155   struct
6156     {
6157     unsigned SP                 : 5;
6158     unsigned                    : 3;
6159     };
6160 
6161   struct
6162     {
6163     unsigned STKPTR             : 5;
6164     unsigned                    : 3;
6165     };
6166   } __STKPTRbits_t;
6167 
6168 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6169 
6170 #define _STKPTR0                0x01
6171 #define _SP0                    0x01
6172 #define _STKPTR1                0x02
6173 #define _SP1                    0x02
6174 #define _STKPTR2                0x04
6175 #define _SP2                    0x04
6176 #define _STKPTR3                0x08
6177 #define _SP3                    0x08
6178 #define _STKPTR4                0x10
6179 #define _SP4                    0x10
6180 #define _STKUNF                 0x40
6181 #define _STKFUL                 0x80
6182 #define _STKOVF                 0x80
6183 
6184 //==============================================================================
6185 
6186 extern __at(0x0FFD) __sfr TOS;
6187 extern __at(0x0FFD) __sfr TOSL;
6188 extern __at(0x0FFE) __sfr TOSH;
6189 extern __at(0x0FFF) __sfr TOSU;
6190 
6191 //==============================================================================
6192 //
6193 //        Configuration Bits
6194 //
6195 //==============================================================================
6196 
6197 #define __CONFIG1H              0x300001
6198 #define __CONFIG2L              0x300002
6199 #define __CONFIG2H              0x300003
6200 #define __CONFIG3L              0x300004
6201 #define __CONFIG3H              0x300005
6202 #define __CONFIG4L              0x300006
6203 #define __CONFIG5L              0x300008
6204 #define __CONFIG5H              0x300009
6205 #define __CONFIG6L              0x30000A
6206 #define __CONFIG6H              0x30000B
6207 #define __CONFIG7L              0x30000C
6208 #define __CONFIG7H              0x30000D
6209 
6210 //----------------------------- CONFIG1H Options -------------------------------
6211 
6212 #define _OSC_LP_1H              0xF0    // LP oscillator.
6213 #define _OSC_XT_1H              0xF1    // XT oscillator.
6214 #define _OSC_HS_1H              0xF2    // HS oscillator.
6215 #define _OSC_RC_1H              0xF3    // External RC oscillator, CLKO function on RA6.
6216 #define _OSC_EC_1H              0xF4    // EC oscillator, CLKO function on RA6.
6217 #define _OSC_ECIO6_1H           0xF5    // EC oscillator, port function on RA6.
6218 #define _OSC_HSPLL_1H           0xF6    // HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1).
6219 #define _OSC_RCIO6_1H           0xF7    // External RC oscillator, port function on RA6.
6220 #define _OSC_INTIO67_1H         0xF8    // Internal oscillator block, port function on RA6 and RA7.
6221 #define _OSC_INTIO7_1H          0xF9    // Internal oscillator block, CLKO function on RA6, port function on RA7.
6222 #define _FCMEN_OFF_1H           0xBF    // Fail-Safe Clock Monitor disabled.
6223 #define _FCMEN_ON_1H            0xFF    // Fail-Safe Clock Monitor enabled.
6224 #define _IESO_OFF_1H            0x7F    // Two-Speed Start-up disabled.
6225 #define _IESO_ON_1H             0xFF    // Two-Speed Start-up enabled.
6226 
6227 //----------------------------- CONFIG2L Options -------------------------------
6228 
6229 #define _PWRT_ON_2L             0xFE    // PWRT enabled.
6230 #define _PWRT_OFF_2L            0xFF    // PWRT disabled.
6231 #define _BOREN_OFF_2L           0xF9    // Brown-out Reset disabled in hardware and software.
6232 #define _BOREN_ON_2L            0xFB    // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
6233 #define _BOREN_NOSLP_2L         0xFD    // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
6234 #define _BOREN_SBORDIS_2L       0xFF    // Brown-out Reset enabled in hardware only (SBOREN is disabled).
6235 #define _BORV_0_2L              0xE7    // Maximum setting.
6236 #define _BORV_1_2L              0xEF
6237 #define _BORV_2_2L              0xF7
6238 #define _BORV_3_2L              0xFF    // Minimum setting.
6239 
6240 //----------------------------- CONFIG2H Options -------------------------------
6241 
6242 #define _WDT_OFF_2H             0xFE    // WDT disabled (control is placed on the SWDTEN bit).
6243 #define _WDT_ON_2H              0xFF    // WDT enabled.
6244 #define _WDTPS_1_2H             0xE1    // 1:1.
6245 #define _WDTPS_2_2H             0xE3    // 1:2.
6246 #define _WDTPS_4_2H             0xE5    // 1:4.
6247 #define _WDTPS_8_2H             0xE7    // 1:8.
6248 #define _WDTPS_16_2H            0xE9    // 1:16.
6249 #define _WDTPS_32_2H            0xEB    // 1:32.
6250 #define _WDTPS_64_2H            0xED    // 1:64.
6251 #define _WDTPS_128_2H           0xEF    // 1:128.
6252 #define _WDTPS_256_2H           0xF1    // 1:256.
6253 #define _WDTPS_512_2H           0xF3    // 1:512.
6254 #define _WDTPS_1024_2H          0xF5    // 1:1024.
6255 #define _WDTPS_2048_2H          0xF7    // 1:2048.
6256 #define _WDTPS_4096_2H          0xF9    // 1:4096.
6257 #define _WDTPS_8192_2H          0xFB    // 1:8192.
6258 #define _WDTPS_16384_2H         0xFD    // 1:16384.
6259 #define _WDTPS_32768_2H         0xFF    // 1:32768.
6260 
6261 //----------------------------- CONFIG3L Options -------------------------------
6262 
6263 #define _MODE_EM_3L             0xFC    // Extended Microcontroller mode.
6264 #define _MODE_MPB_3L            0xFD    // Microprocessor with Boot Block mode.
6265 #define _MODE_MP_3L             0xFE    // Microprocessor mode.
6266 #define _MODE_MC_3L             0xFF    // Microcontroller mode.
6267 #define _ADDRBW_ADDR8BIT_3L     0xCF    // 8-bit Address Bus.
6268 #define _ADDRBW_ADDR12BIT_3L    0xDF    // 12-bit Address Bus.
6269 #define _ADDRBW_ADDR16BIT_3L    0xEF    // 16-bit Address Bus.
6270 #define _ADDRBW_ADDR20BIT_3L    0xFF    // 20-bit Address Bus.
6271 #define _DATABW_DATA8BIT_3L     0xBF    // 8-bit External Bus mode.
6272 #define _DATABW_DATA16BIT_3L    0xFF    // 16-bit External Bus mode.
6273 #define _WAIT_ON_3L             0x7F    // Wait selections for table reads and table writes are determined by the WAIT1:WAIT0 bits.
6274 #define _WAIT_OFF_3L            0xFF    // Wait selections are unavailable for table reads and table writes.
6275 
6276 //----------------------------- CONFIG3H Options -------------------------------
6277 
6278 #define _CCP2MX_PORTBE_3H       0xFE    // ECCP2 is multiplexed with RB3 in Extended Microcontroller, Microprocessor or Microprocessor with Boot Block mode. Or with RE7 in Microcontroller mode.
6279 #define _CCP2MX_PORTC_3H        0xFF    // ECCP2 input/output is multiplexed with RC1.
6280 #define _ECCPMX_PORTH_3H        0xFD    // ECCP1/3 (P1B/P1C/P3B/P3C) are multiplexed onto RH7, RH6, RH5 and RH4 respectively.
6281 #define _ECCPMX_PORTE_3H        0xFF    // ECCP1/3 (P1B/P1C/P3B/P3C) are multiplexed onto RE6, RE5, RE4 and RE3 respectively.
6282 #define _LPT1OSC_OFF_3H         0xFB    // Timer1 configured for higher power operation.
6283 #define _LPT1OSC_ON_3H          0xFF    // Timer1 configured for low-power operation.
6284 #define _MCLRE_OFF_3H           0x7F    // RG5 input pin enabled; MCLR disabled.
6285 #define _MCLRE_ON_3H            0xFF    // MCLR pin enabled; RG5 input pin disabled.
6286 
6287 //----------------------------- CONFIG4L Options -------------------------------
6288 
6289 #define _STVREN_OFF_4L          0xFE    // Stack full/underflow will not cause Reset.
6290 #define _STVREN_ON_4L           0xFF    // Stack full/underflow will cause Reset.
6291 #define _LVP_OFF_4L             0xFB    // Single-Supply ICSP disabled.
6292 #define _LVP_ON_4L              0xFF    // Single-Supply ICSP enabled.
6293 #define _BBSIZ_BB2K_4L          0xCF    // 1K word (2 Kbytes) Boot Block size.
6294 #define _BBSIZ_BB4K_4L          0xDF    // 2K words (4 Kbytes) Boot Block size.
6295 #define _BBSIZ_BB8K_4L          0xEF    // 4K words (8 Kbytes) Boot Block size.
6296 #define _XINST_OFF_4L           0xBF    // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
6297 #define _XINST_ON_4L            0xFF    // Instruction set extension and Indexed Addressing mode enabled.
6298 #define _DEBUG_ON_4L            0x7F    // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
6299 #define _DEBUG_OFF_4L           0xFF    // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
6300 
6301 //----------------------------- CONFIG5L Options -------------------------------
6302 
6303 #define _CP0_ON_5L              0xFE    // Block 0 (000800, 001000 or 002000-003FFFh) code-protected.
6304 #define _CP0_OFF_5L             0xFF    // Block 0 (000800, 001000 or 002000-003FFFh) not code-protected.
6305 #define _CP1_ON_5L              0xFD    // Block 1 (004000-007FFFh) code-protected.
6306 #define _CP1_OFF_5L             0xFF    // Block 1 (004000-007FFFh) not code-protected.
6307 #define _CP2_ON_5L              0xFB    // Block 2 (008000-00BFFFh) code-protected.
6308 #define _CP2_OFF_5L             0xFF    // Block 2 (008000-00BFFFh) not code-protected.
6309 #define _CP3_ON_5L              0xF7    // Block 3 (00C000-00FFFFh) code-protected.
6310 #define _CP3_OFF_5L             0xFF    // Block 3 (00C000-00FFFFh) not code-protected.
6311 #define _CP4_ON_5L              0xEF    // Block 4 (010000-013FFFh) code-protected.
6312 #define _CP4_OFF_5L             0xFF    // Block 4 (010000-013FFFh) not code-protected.
6313 #define _CP5_ON_5L              0xDF    // Block 5 (014000-017FFFh) code-protected.
6314 #define _CP5_OFF_5L             0xFF    // Block 5 (014000-017FFFh) not code-protected.
6315 
6316 //----------------------------- CONFIG5H Options -------------------------------
6317 
6318 #define _CPB_ON_5H              0xBF    // Boot Block (000000-0007FFh) code-protected.
6319 #define _CPB_OFF_5H             0xFF    // Boot Block (000000-0007FFh) not code-protected.
6320 #define _CPD_ON_5H              0x7F    // Data EEPROM code-protected.
6321 #define _CPD_OFF_5H             0xFF    // Data EEPROM not code-protected.
6322 
6323 //----------------------------- CONFIG6L Options -------------------------------
6324 
6325 #define _WRT0_ON_6L             0xFE    // Block 0 (000800, 001000 or 002000-003FFFh) write-protected.
6326 #define _WRT0_OFF_6L            0xFF    // Block 0 (000800, 001000 or 002000-003FFFh) not write-protected.
6327 #define _WRT1_ON_6L             0xFD    // Block 1 (004000-007FFFh) write-protected.
6328 #define _WRT1_OFF_6L            0xFF    // Block 1 (004000-007FFFh) not write-protected.
6329 #define _WRT2_ON_6L             0xFB    // Block 2 (008000-00BFFFh) write-protected.
6330 #define _WRT2_OFF_6L            0xFF    // Block 2 (008000-00BFFFh) not write-protected.
6331 #define _WRT3_ON_6L             0xF7    // Block 3 (00C000-00FFFFh) write-protected.
6332 #define _WRT3_OFF_6L            0xFF    // Block 3 (00C000-00FFFFh) not write-protected.
6333 #define _WRT4_ON_6L             0xEF    // Block 4 (010000-013FFFh) write-protected.
6334 #define _WRT4_OFF_6L            0xFF    // Block 4 (010000-013FFFh) not write-protected.
6335 #define _WRT5_ON_6L             0xDF    // Block 5 (014000-017FFFh) write-protected.
6336 #define _WRT5_OFF_6L            0xFF    // Block 5 (014000-017FFFh) not write-protected.
6337 
6338 //----------------------------- CONFIG6H Options -------------------------------
6339 
6340 #define _WRTC_ON_6H             0xDF    // Configuration registers (300000-3000FFh) write-protected.
6341 #define _WRTC_OFF_6H            0xFF    // Configuration registers (300000-3000FFh) not write-protected.
6342 #define _WRTB_ON_6H             0xBF    // Boot Block (000000-007FFF, 000FFF or 001FFFh) write-protected.
6343 #define _WRTB_OFF_6H            0xFF    // Boot Block (000000-007FFF, 000FFF or 001FFFh) not write-protected.
6344 #define _WRTD_ON_6H             0x7F    // Data EEPROM write-protected.
6345 #define _WRTD_OFF_6H            0xFF    // Data EEPROM not write-protected.
6346 
6347 //----------------------------- CONFIG7L Options -------------------------------
6348 
6349 #define _EBTR0_ON_7L            0xFE    // Block 0 (000800, 001000 or 002000-003FFFh) protected from table reads executed in other blocks.
6350 #define _EBTR0_OFF_7L           0xFF    // Block 0 (000800, 001000 or 002000-003FFFh) not protected from table reads executed in other blocks.
6351 #define _EBTR1_ON_7L            0xFD    // Block 1 (004000-007FFFh) protected from table reads executed in other blocks.
6352 #define _EBTR1_OFF_7L           0xFF    // Block 1 (004000-007FFFh) not protected from table reads executed in other blocks.
6353 #define _EBTR2_ON_7L            0xFB    // Block 2 (008000-00BFFFh) protected from table reads executed in other blocks.
6354 #define _EBTR2_OFF_7L           0xFF    // Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks.
6355 #define _EBTR3_ON_7L            0xF7    // Block 3 (00C000-00FFFFh) protected from table reads executed in other blocks.
6356 #define _EBTR3_OFF_7L           0xFF    // Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks.
6357 #define _EBTR4_ON_7L            0xEF    // Block 4 (010000-013FFFh) protected from table reads executed in other blocks.
6358 #define _EBTR4_OFF_7L           0xFF    // Block 4 (010000-013FFFh) not protected from table reads executed in other blocks.
6359 #define _EBTR5_ON_7L            0xDF    // Block 5 (014000-017FFFh) protected from table reads executed in other blocks.
6360 #define _EBTR5_OFF_7L           0xFF    // Block 5 (014000-017FFFh) not protected from table reads executed in other blocks.
6361 
6362 //----------------------------- CONFIG7H Options -------------------------------
6363 
6364 #define _EBTRB_ON_7H            0xBF    // Boot Block (000000-007FFF, 000FFF or 001FFFh) protected from table reads executed in other blocks.
6365 #define _EBTRB_OFF_7H           0xFF    // Boot Block (000000-007FFF, 000FFF or 001FFFh) not protected from table reads executed in other blocks.
6366 
6367 //==============================================================================
6368 
6369 #define __DEVID1                0x3FFFFE
6370 #define __DEVID2                0x3FFFFF
6371 
6372 #define __IDLOC0                0x200000
6373 #define __IDLOC1                0x200001
6374 #define __IDLOC2                0x200002
6375 #define __IDLOC3                0x200003
6376 #define __IDLOC4                0x200004
6377 #define __IDLOC5                0x200005
6378 #define __IDLOC6                0x200006
6379 #define __IDLOC7                0x200007
6380 
6381 #endif // #ifndef __PIC18LF8628_H__
6382