1 /*
2  * This declarations of the PIC16F1828 MCU.
3  *
4  * This file is part of the GNU PIC library for SDCC, originally
5  * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
6  *
7  * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:20 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 __PIC16F1828_H__
26 #define __PIC16F1828_H__
27 
28 //==============================================================================
29 //
30 //	Register Addresses
31 //
32 //==============================================================================
33 
34 #ifndef NO_ADDR_DEFINES
35 
36 #define INDF0_ADDR              0x0000
37 #define INDF1_ADDR              0x0001
38 #define PCL_ADDR                0x0002
39 #define STATUS_ADDR             0x0003
40 #define FSR0_ADDR               0x0004
41 #define FSR0L_ADDR              0x0004
42 #define FSR0H_ADDR              0x0005
43 #define FSR1_ADDR               0x0006
44 #define FSR1L_ADDR              0x0006
45 #define FSR1H_ADDR              0x0007
46 #define BSR_ADDR                0x0008
47 #define WREG_ADDR               0x0009
48 #define PCLATH_ADDR             0x000A
49 #define INTCON_ADDR             0x000B
50 #define PORTA_ADDR              0x000C
51 #define PORTB_ADDR              0x000D
52 #define PORTC_ADDR              0x000E
53 #define PIR1_ADDR               0x0011
54 #define PIR2_ADDR               0x0012
55 #define PIR3_ADDR               0x0013
56 #define TMR0_ADDR               0x0015
57 #define TMR1_ADDR               0x0016
58 #define TMR1L_ADDR              0x0016
59 #define TMR1H_ADDR              0x0017
60 #define T1CON_ADDR              0x0018
61 #define T1GCON_ADDR             0x0019
62 #define TMR2_ADDR               0x001A
63 #define PR2_ADDR                0x001B
64 #define T2CON_ADDR              0x001C
65 #define CPSCON0_ADDR            0x001E
66 #define CPSCON1_ADDR            0x001F
67 #define TRISA_ADDR              0x008C
68 #define TRISB_ADDR              0x008D
69 #define TRISC_ADDR              0x008E
70 #define PIE1_ADDR               0x0091
71 #define PIE2_ADDR               0x0092
72 #define PIE3_ADDR               0x0093
73 #define OPTION_REG_ADDR         0x0095
74 #define PCON_ADDR               0x0096
75 #define WDTCON_ADDR             0x0097
76 #define OSCTUNE_ADDR            0x0098
77 #define OSCCON_ADDR             0x0099
78 #define OSCSTAT_ADDR            0x009A
79 #define ADRES_ADDR              0x009B
80 #define ADRESL_ADDR             0x009B
81 #define ADRESH_ADDR             0x009C
82 #define ADCON0_ADDR             0x009D
83 #define ADCON1_ADDR             0x009E
84 #define LATA_ADDR               0x010C
85 #define LATB_ADDR               0x010D
86 #define LATC_ADDR               0x010E
87 #define CM1CON0_ADDR            0x0111
88 #define CM1CON1_ADDR            0x0112
89 #define CM2CON0_ADDR            0x0113
90 #define CM2CON1_ADDR            0x0114
91 #define CMOUT_ADDR              0x0115
92 #define BORCON_ADDR             0x0116
93 #define FVRCON_ADDR             0x0117
94 #define DACCON0_ADDR            0x0118
95 #define DACCON1_ADDR            0x0119
96 #define SRCON0_ADDR             0x011A
97 #define SRCON1_ADDR             0x011B
98 #define APFCON0_ADDR            0x011D
99 #define APFCON1_ADDR            0x011E
100 #define ANSELA_ADDR             0x018C
101 #define ANSELB_ADDR             0x018D
102 #define ANSELC_ADDR             0x018E
103 #define EEADR_ADDR              0x0191
104 #define EEADRL_ADDR             0x0191
105 #define EEADRH_ADDR             0x0192
106 #define EEDAT_ADDR              0x0193
107 #define EEDATL_ADDR             0x0193
108 #define EEDATH_ADDR             0x0194
109 #define EECON1_ADDR             0x0195
110 #define EECON2_ADDR             0x0196
111 #define RCREG_ADDR              0x0199
112 #define TXREG_ADDR              0x019A
113 #define SP1BRG_ADDR             0x019B
114 #define SP1BRGL_ADDR            0x019B
115 #define SPBRG_ADDR              0x019B
116 #define SPBRGL_ADDR             0x019B
117 #define SP1BRGH_ADDR            0x019C
118 #define SPBRGH_ADDR             0x019C
119 #define RCSTA_ADDR              0x019D
120 #define TXSTA_ADDR              0x019E
121 #define BAUDCON_ADDR            0x019F
122 #define WPUA_ADDR               0x020C
123 #define WPUB_ADDR               0x020D
124 #define WPUC_ADDR               0x020E
125 #define SSP1BUF_ADDR            0x0211
126 #define SSPBUF_ADDR             0x0211
127 #define SSP1ADD_ADDR            0x0212
128 #define SSPADD_ADDR             0x0212
129 #define SSP1MSK_ADDR            0x0213
130 #define SSPMSK_ADDR             0x0213
131 #define SSP1STAT_ADDR           0x0214
132 #define SSPSTAT_ADDR            0x0214
133 #define SSP1CON_ADDR            0x0215
134 #define SSP1CON1_ADDR           0x0215
135 #define SSPCON_ADDR             0x0215
136 #define SSPCON1_ADDR            0x0215
137 #define SSP1CON2_ADDR           0x0216
138 #define SSPCON2_ADDR            0x0216
139 #define SSP1CON3_ADDR           0x0217
140 #define SSPCON3_ADDR            0x0217
141 #define CCPR1_ADDR              0x0291
142 #define CCPR1L_ADDR             0x0291
143 #define CCPR1H_ADDR             0x0292
144 #define CCP1CON_ADDR            0x0293
145 #define PWM1CON_ADDR            0x0294
146 #define CCP1AS_ADDR             0x0295
147 #define ECCP1AS_ADDR            0x0295
148 #define PSTR1CON_ADDR           0x0296
149 #define CCPR2_ADDR              0x0298
150 #define CCPR2L_ADDR             0x0298
151 #define CCPR2H_ADDR             0x0299
152 #define CCP2CON_ADDR            0x029A
153 #define PWM2CON_ADDR            0x029B
154 #define CCP2AS_ADDR             0x029C
155 #define PSTR2CON_ADDR           0x029D
156 #define CCPTMRS_ADDR            0x029E
157 #define CCPTMRS0_ADDR           0x029E
158 #define CCPR3_ADDR              0x0311
159 #define CCPR3L_ADDR             0x0311
160 #define CCPR3H_ADDR             0x0312
161 #define CCP3CON_ADDR            0x0313
162 #define CCPR4_ADDR              0x0318
163 #define CCPR4L_ADDR             0x0318
164 #define CCPR4H_ADDR             0x0319
165 #define CCP4CON_ADDR            0x031A
166 #define INLVLA_ADDR             0x038C
167 #define INLVLB_ADDR             0x038D
168 #define INLVLC_ADDR             0x038E
169 #define IOCAP_ADDR              0x0391
170 #define IOCAN_ADDR              0x0392
171 #define IOCAF_ADDR              0x0393
172 #define IOCBP_ADDR              0x0394
173 #define IOCBN_ADDR              0x0395
174 #define IOCBF_ADDR              0x0396
175 #define CLKRCON_ADDR            0x039A
176 #define MDCON_ADDR              0x039C
177 #define MDSRC_ADDR              0x039D
178 #define MDCARL_ADDR             0x039E
179 #define MDCARH_ADDR             0x039F
180 #define TMR4_ADDR               0x0415
181 #define PR4_ADDR                0x0416
182 #define T4CON_ADDR              0x0417
183 #define TMR6_ADDR               0x041C
184 #define PR6_ADDR                0x041D
185 #define T6CON_ADDR              0x041E
186 #define STATUS_SHAD_ADDR        0x0FE4
187 #define WREG_SHAD_ADDR          0x0FE5
188 #define BSR_SHAD_ADDR           0x0FE6
189 #define PCLATH_SHAD_ADDR        0x0FE7
190 #define FSR0L_SHAD_ADDR         0x0FE8
191 #define FSR0H_SHAD_ADDR         0x0FE9
192 #define FSR1L_SHAD_ADDR         0x0FEA
193 #define FSR1H_SHAD_ADDR         0x0FEB
194 #define STKPTR_ADDR             0x0FED
195 #define TOSL_ADDR               0x0FEE
196 #define TOSH_ADDR               0x0FEF
197 
198 #endif // #ifndef NO_ADDR_DEFINES
199 
200 //==============================================================================
201 //
202 //	Register Definitions
203 //
204 //==============================================================================
205 
206 extern __at(0x0000) __sfr INDF0;
207 extern __at(0x0001) __sfr INDF1;
208 extern __at(0x0002) __sfr PCL;
209 
210 //==============================================================================
211 //        STATUS Bits
212 
213 extern __at(0x0003) __sfr STATUS;
214 
215 typedef struct
216   {
217   unsigned C                    : 1;
218   unsigned DC                   : 1;
219   unsigned Z                    : 1;
220   unsigned NOT_PD               : 1;
221   unsigned NOT_TO               : 1;
222   unsigned                      : 1;
223   unsigned                      : 1;
224   unsigned                      : 1;
225   } __STATUSbits_t;
226 
227 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
228 
229 #define _C                      0x01
230 #define _DC                     0x02
231 #define _Z                      0x04
232 #define _NOT_PD                 0x08
233 #define _NOT_TO                 0x10
234 
235 //==============================================================================
236 
237 extern __at(0x0004) __sfr FSR0;
238 extern __at(0x0004) __sfr FSR0L;
239 extern __at(0x0005) __sfr FSR0H;
240 extern __at(0x0006) __sfr FSR1;
241 extern __at(0x0006) __sfr FSR1L;
242 extern __at(0x0007) __sfr FSR1H;
243 
244 //==============================================================================
245 //        BSR Bits
246 
247 extern __at(0x0008) __sfr BSR;
248 
249 typedef union
250   {
251   struct
252     {
253     unsigned BSR0               : 1;
254     unsigned BSR1               : 1;
255     unsigned BSR2               : 1;
256     unsigned BSR3               : 1;
257     unsigned BSR4               : 1;
258     unsigned                    : 1;
259     unsigned                    : 1;
260     unsigned                    : 1;
261     };
262 
263   struct
264     {
265     unsigned BSR                : 5;
266     unsigned                    : 3;
267     };
268   } __BSRbits_t;
269 
270 extern __at(0x0008) volatile __BSRbits_t BSRbits;
271 
272 #define _BSR0                   0x01
273 #define _BSR1                   0x02
274 #define _BSR2                   0x04
275 #define _BSR3                   0x08
276 #define _BSR4                   0x10
277 
278 //==============================================================================
279 
280 extern __at(0x0009) __sfr WREG;
281 extern __at(0x000A) __sfr PCLATH;
282 
283 //==============================================================================
284 //        INTCON Bits
285 
286 extern __at(0x000B) __sfr INTCON;
287 
288 typedef union
289   {
290   struct
291     {
292     unsigned IOCIF              : 1;
293     unsigned INTF               : 1;
294     unsigned TMR0IF             : 1;
295     unsigned IOCIE              : 1;
296     unsigned INTE               : 1;
297     unsigned TMR0IE             : 1;
298     unsigned PEIE               : 1;
299     unsigned GIE                : 1;
300     };
301 
302   struct
303     {
304     unsigned                    : 1;
305     unsigned                    : 1;
306     unsigned T0IF               : 1;
307     unsigned                    : 1;
308     unsigned                    : 1;
309     unsigned T0IE               : 1;
310     unsigned                    : 1;
311     unsigned                    : 1;
312     };
313   } __INTCONbits_t;
314 
315 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
316 
317 #define _IOCIF                  0x01
318 #define _INTF                   0x02
319 #define _TMR0IF                 0x04
320 #define _T0IF                   0x04
321 #define _IOCIE                  0x08
322 #define _INTE                   0x10
323 #define _TMR0IE                 0x20
324 #define _T0IE                   0x20
325 #define _PEIE                   0x40
326 #define _GIE                    0x80
327 
328 //==============================================================================
329 
330 
331 //==============================================================================
332 //        PORTA Bits
333 
334 extern __at(0x000C) __sfr PORTA;
335 
336 typedef union
337   {
338   struct
339     {
340     unsigned RA0                : 1;
341     unsigned RA1                : 1;
342     unsigned RA2                : 1;
343     unsigned RA3                : 1;
344     unsigned RA4                : 1;
345     unsigned RA5                : 1;
346     unsigned                    : 1;
347     unsigned                    : 1;
348     };
349 
350   struct
351     {
352     unsigned RA                 : 6;
353     unsigned                    : 2;
354     };
355   } __PORTAbits_t;
356 
357 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
358 
359 #define _RA0                    0x01
360 #define _RA1                    0x02
361 #define _RA2                    0x04
362 #define _RA3                    0x08
363 #define _RA4                    0x10
364 #define _RA5                    0x20
365 
366 //==============================================================================
367 
368 
369 //==============================================================================
370 //        PORTB Bits
371 
372 extern __at(0x000D) __sfr PORTB;
373 
374 typedef struct
375   {
376   unsigned                      : 1;
377   unsigned                      : 1;
378   unsigned                      : 1;
379   unsigned                      : 1;
380   unsigned RB4                  : 1;
381   unsigned RB5                  : 1;
382   unsigned RB6                  : 1;
383   unsigned RB7                  : 1;
384   } __PORTBbits_t;
385 
386 extern __at(0x000D) volatile __PORTBbits_t PORTBbits;
387 
388 #define _RB4                    0x10
389 #define _RB5                    0x20
390 #define _RB6                    0x40
391 #define _RB7                    0x80
392 
393 //==============================================================================
394 
395 
396 //==============================================================================
397 //        PORTC Bits
398 
399 extern __at(0x000E) __sfr PORTC;
400 
401 typedef struct
402   {
403   unsigned RC0                  : 1;
404   unsigned RC1                  : 1;
405   unsigned RC2                  : 1;
406   unsigned RC3                  : 1;
407   unsigned RC4                  : 1;
408   unsigned RC5                  : 1;
409   unsigned RC6                  : 1;
410   unsigned RC7                  : 1;
411   } __PORTCbits_t;
412 
413 extern __at(0x000E) volatile __PORTCbits_t PORTCbits;
414 
415 #define _RC0                    0x01
416 #define _RC1                    0x02
417 #define _RC2                    0x04
418 #define _RC3                    0x08
419 #define _RC4                    0x10
420 #define _RC5                    0x20
421 #define _RC6                    0x40
422 #define _RC7                    0x80
423 
424 //==============================================================================
425 
426 
427 //==============================================================================
428 //        PIR1 Bits
429 
430 extern __at(0x0011) __sfr PIR1;
431 
432 typedef struct
433   {
434   unsigned TMR1IF               : 1;
435   unsigned TMR2IF               : 1;
436   unsigned CCP1IF               : 1;
437   unsigned SSP1IF               : 1;
438   unsigned TXIF                 : 1;
439   unsigned RCIF                 : 1;
440   unsigned ADIF                 : 1;
441   unsigned TMR1GIF              : 1;
442   } __PIR1bits_t;
443 
444 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
445 
446 #define _TMR1IF                 0x01
447 #define _TMR2IF                 0x02
448 #define _CCP1IF                 0x04
449 #define _SSP1IF                 0x08
450 #define _TXIF                   0x10
451 #define _RCIF                   0x20
452 #define _ADIF                   0x40
453 #define _TMR1GIF                0x80
454 
455 //==============================================================================
456 
457 
458 //==============================================================================
459 //        PIR2 Bits
460 
461 extern __at(0x0012) __sfr PIR2;
462 
463 typedef struct
464   {
465   unsigned CCP2IF               : 1;
466   unsigned                      : 1;
467   unsigned                      : 1;
468   unsigned BCL1IF               : 1;
469   unsigned EEIF                 : 1;
470   unsigned C1IF                 : 1;
471   unsigned C2IF                 : 1;
472   unsigned OSFIF                : 1;
473   } __PIR2bits_t;
474 
475 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
476 
477 #define _CCP2IF                 0x01
478 #define _BCL1IF                 0x08
479 #define _EEIF                   0x10
480 #define _C1IF                   0x20
481 #define _C2IF                   0x40
482 #define _OSFIF                  0x80
483 
484 //==============================================================================
485 
486 
487 //==============================================================================
488 //        PIR3 Bits
489 
490 extern __at(0x0013) __sfr PIR3;
491 
492 typedef struct
493   {
494   unsigned                      : 1;
495   unsigned TMR4IF               : 1;
496   unsigned                      : 1;
497   unsigned TMR6IF               : 1;
498   unsigned CCP3IF               : 1;
499   unsigned CCP4IF               : 1;
500   unsigned                      : 1;
501   unsigned                      : 1;
502   } __PIR3bits_t;
503 
504 extern __at(0x0013) volatile __PIR3bits_t PIR3bits;
505 
506 #define _TMR4IF                 0x02
507 #define _TMR6IF                 0x08
508 #define _CCP3IF                 0x10
509 #define _CCP4IF                 0x20
510 
511 //==============================================================================
512 
513 extern __at(0x0015) __sfr TMR0;
514 extern __at(0x0016) __sfr TMR1;
515 extern __at(0x0016) __sfr TMR1L;
516 extern __at(0x0017) __sfr TMR1H;
517 
518 //==============================================================================
519 //        T1CON Bits
520 
521 extern __at(0x0018) __sfr T1CON;
522 
523 typedef union
524   {
525   struct
526     {
527     unsigned TMR1ON             : 1;
528     unsigned                    : 1;
529     unsigned NOT_T1SYNC         : 1;
530     unsigned T1OSCEN            : 1;
531     unsigned T1CKPS0            : 1;
532     unsigned T1CKPS1            : 1;
533     unsigned TMR1CS0            : 1;
534     unsigned TMR1CS1            : 1;
535     };
536 
537   struct
538     {
539     unsigned                    : 4;
540     unsigned T1CKPS             : 2;
541     unsigned                    : 2;
542     };
543 
544   struct
545     {
546     unsigned                    : 6;
547     unsigned TMR1CS             : 2;
548     };
549   } __T1CONbits_t;
550 
551 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
552 
553 #define _TMR1ON                 0x01
554 #define _NOT_T1SYNC             0x04
555 #define _T1OSCEN                0x08
556 #define _T1CKPS0                0x10
557 #define _T1CKPS1                0x20
558 #define _TMR1CS0                0x40
559 #define _TMR1CS1                0x80
560 
561 //==============================================================================
562 
563 
564 //==============================================================================
565 //        T1GCON Bits
566 
567 extern __at(0x0019) __sfr T1GCON;
568 
569 typedef union
570   {
571   struct
572     {
573     unsigned T1GSS0             : 1;
574     unsigned T1GSS1             : 1;
575     unsigned T1GVAL             : 1;
576     unsigned T1GGO_NOT_DONE     : 1;
577     unsigned T1GSPM             : 1;
578     unsigned T1GTM              : 1;
579     unsigned T1GPOL             : 1;
580     unsigned TMR1GE             : 1;
581     };
582 
583   struct
584     {
585     unsigned                    : 1;
586     unsigned                    : 1;
587     unsigned                    : 1;
588     unsigned T1GGO              : 1;
589     unsigned                    : 1;
590     unsigned                    : 1;
591     unsigned                    : 1;
592     unsigned                    : 1;
593     };
594 
595   struct
596     {
597     unsigned T1GSS              : 2;
598     unsigned                    : 6;
599     };
600   } __T1GCONbits_t;
601 
602 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
603 
604 #define _T1GSS0                 0x01
605 #define _T1GSS1                 0x02
606 #define _T1GVAL                 0x04
607 #define _T1GGO_NOT_DONE         0x08
608 #define _T1GGO                  0x08
609 #define _T1GSPM                 0x10
610 #define _T1GTM                  0x20
611 #define _T1GPOL                 0x40
612 #define _TMR1GE                 0x80
613 
614 //==============================================================================
615 
616 extern __at(0x001A) __sfr TMR2;
617 extern __at(0x001B) __sfr PR2;
618 
619 //==============================================================================
620 //        T2CON Bits
621 
622 extern __at(0x001C) __sfr T2CON;
623 
624 typedef union
625   {
626   struct
627     {
628     unsigned T2CKPS0            : 1;
629     unsigned T2CKPS1            : 1;
630     unsigned TMR2ON             : 1;
631     unsigned T2OUTPS0           : 1;
632     unsigned T2OUTPS1           : 1;
633     unsigned T2OUTPS2           : 1;
634     unsigned T2OUTPS3           : 1;
635     unsigned                    : 1;
636     };
637 
638   struct
639     {
640     unsigned T2CKPS             : 2;
641     unsigned                    : 6;
642     };
643 
644   struct
645     {
646     unsigned                    : 3;
647     unsigned T2OUTPS            : 4;
648     unsigned                    : 1;
649     };
650   } __T2CONbits_t;
651 
652 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
653 
654 #define _T2CKPS0                0x01
655 #define _T2CKPS1                0x02
656 #define _TMR2ON                 0x04
657 #define _T2OUTPS0               0x08
658 #define _T2OUTPS1               0x10
659 #define _T2OUTPS2               0x20
660 #define _T2OUTPS3               0x40
661 
662 //==============================================================================
663 
664 
665 //==============================================================================
666 //        CPSCON0 Bits
667 
668 extern __at(0x001E) __sfr CPSCON0;
669 
670 typedef union
671   {
672   struct
673     {
674     unsigned T0XCS              : 1;
675     unsigned CPSOUT             : 1;
676     unsigned CPSRNG0            : 1;
677     unsigned CPSRNG1            : 1;
678     unsigned                    : 1;
679     unsigned                    : 1;
680     unsigned CPSRM              : 1;
681     unsigned CPSON              : 1;
682     };
683 
684   struct
685     {
686     unsigned                    : 2;
687     unsigned CPSRNG             : 2;
688     unsigned                    : 4;
689     };
690   } __CPSCON0bits_t;
691 
692 extern __at(0x001E) volatile __CPSCON0bits_t CPSCON0bits;
693 
694 #define _T0XCS                  0x01
695 #define _CPSOUT                 0x02
696 #define _CPSRNG0                0x04
697 #define _CPSRNG1                0x08
698 #define _CPSRM                  0x40
699 #define _CPSON                  0x80
700 
701 //==============================================================================
702 
703 
704 //==============================================================================
705 //        CPSCON1 Bits
706 
707 extern __at(0x001F) __sfr CPSCON1;
708 
709 typedef union
710   {
711   struct
712     {
713     unsigned CPSCH0             : 1;
714     unsigned CPSCH1             : 1;
715     unsigned CPSCH2             : 1;
716     unsigned CPSCH3             : 1;
717     unsigned                    : 1;
718     unsigned                    : 1;
719     unsigned                    : 1;
720     unsigned                    : 1;
721     };
722 
723   struct
724     {
725     unsigned CPSCH              : 4;
726     unsigned                    : 4;
727     };
728   } __CPSCON1bits_t;
729 
730 extern __at(0x001F) volatile __CPSCON1bits_t CPSCON1bits;
731 
732 #define _CPSCH0                 0x01
733 #define _CPSCH1                 0x02
734 #define _CPSCH2                 0x04
735 #define _CPSCH3                 0x08
736 
737 //==============================================================================
738 
739 
740 //==============================================================================
741 //        TRISA Bits
742 
743 extern __at(0x008C) __sfr TRISA;
744 
745 typedef union
746   {
747   struct
748     {
749     unsigned TRISA0             : 1;
750     unsigned TRISA1             : 1;
751     unsigned TRISA2             : 1;
752     unsigned TRISA3             : 1;
753     unsigned TRISA4             : 1;
754     unsigned TRISA5             : 1;
755     unsigned                    : 1;
756     unsigned                    : 1;
757     };
758 
759   struct
760     {
761     unsigned TRISA              : 6;
762     unsigned                    : 2;
763     };
764   } __TRISAbits_t;
765 
766 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
767 
768 #define _TRISA0                 0x01
769 #define _TRISA1                 0x02
770 #define _TRISA2                 0x04
771 #define _TRISA3                 0x08
772 #define _TRISA4                 0x10
773 #define _TRISA5                 0x20
774 
775 //==============================================================================
776 
777 
778 //==============================================================================
779 //        TRISB Bits
780 
781 extern __at(0x008D) __sfr TRISB;
782 
783 typedef struct
784   {
785   unsigned                      : 1;
786   unsigned                      : 1;
787   unsigned                      : 1;
788   unsigned                      : 1;
789   unsigned TRISB4               : 1;
790   unsigned TRISB5               : 1;
791   unsigned TRISB6               : 1;
792   unsigned TRISB7               : 1;
793   } __TRISBbits_t;
794 
795 extern __at(0x008D) volatile __TRISBbits_t TRISBbits;
796 
797 #define _TRISB4                 0x10
798 #define _TRISB5                 0x20
799 #define _TRISB6                 0x40
800 #define _TRISB7                 0x80
801 
802 //==============================================================================
803 
804 
805 //==============================================================================
806 //        TRISC Bits
807 
808 extern __at(0x008E) __sfr TRISC;
809 
810 typedef struct
811   {
812   unsigned TRISC0               : 1;
813   unsigned TRISC1               : 1;
814   unsigned TRISC2               : 1;
815   unsigned TRISC3               : 1;
816   unsigned TRISC4               : 1;
817   unsigned TRISC5               : 1;
818   unsigned TRISC6               : 1;
819   unsigned TRISC7               : 1;
820   } __TRISCbits_t;
821 
822 extern __at(0x008E) volatile __TRISCbits_t TRISCbits;
823 
824 #define _TRISC0                 0x01
825 #define _TRISC1                 0x02
826 #define _TRISC2                 0x04
827 #define _TRISC3                 0x08
828 #define _TRISC4                 0x10
829 #define _TRISC5                 0x20
830 #define _TRISC6                 0x40
831 #define _TRISC7                 0x80
832 
833 //==============================================================================
834 
835 
836 //==============================================================================
837 //        PIE1 Bits
838 
839 extern __at(0x0091) __sfr PIE1;
840 
841 typedef struct
842   {
843   unsigned TMR1IE               : 1;
844   unsigned TMR2IE               : 1;
845   unsigned CCP1IE               : 1;
846   unsigned SSP1IE               : 1;
847   unsigned TXIE                 : 1;
848   unsigned RCIE                 : 1;
849   unsigned ADIE                 : 1;
850   unsigned TMR1GIE              : 1;
851   } __PIE1bits_t;
852 
853 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
854 
855 #define _TMR1IE                 0x01
856 #define _TMR2IE                 0x02
857 #define _CCP1IE                 0x04
858 #define _SSP1IE                 0x08
859 #define _TXIE                   0x10
860 #define _RCIE                   0x20
861 #define _ADIE                   0x40
862 #define _TMR1GIE                0x80
863 
864 //==============================================================================
865 
866 
867 //==============================================================================
868 //        PIE2 Bits
869 
870 extern __at(0x0092) __sfr PIE2;
871 
872 typedef struct
873   {
874   unsigned CCP2IE               : 1;
875   unsigned                      : 1;
876   unsigned                      : 1;
877   unsigned BCL1IE               : 1;
878   unsigned EEIE                 : 1;
879   unsigned C1IE                 : 1;
880   unsigned C2IE                 : 1;
881   unsigned OSFIE                : 1;
882   } __PIE2bits_t;
883 
884 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
885 
886 #define _CCP2IE                 0x01
887 #define _BCL1IE                 0x08
888 #define _EEIE                   0x10
889 #define _C1IE                   0x20
890 #define _C2IE                   0x40
891 #define _OSFIE                  0x80
892 
893 //==============================================================================
894 
895 
896 //==============================================================================
897 //        PIE3 Bits
898 
899 extern __at(0x0093) __sfr PIE3;
900 
901 typedef struct
902   {
903   unsigned                      : 1;
904   unsigned TMR4IE               : 1;
905   unsigned                      : 1;
906   unsigned TMR6IE               : 1;
907   unsigned CCP3IE               : 1;
908   unsigned CCP4IE               : 1;
909   unsigned                      : 1;
910   unsigned                      : 1;
911   } __PIE3bits_t;
912 
913 extern __at(0x0093) volatile __PIE3bits_t PIE3bits;
914 
915 #define _TMR4IE                 0x02
916 #define _TMR6IE                 0x08
917 #define _CCP3IE                 0x10
918 #define _CCP4IE                 0x20
919 
920 //==============================================================================
921 
922 
923 //==============================================================================
924 //        OPTION_REG Bits
925 
926 extern __at(0x0095) __sfr OPTION_REG;
927 
928 typedef union
929   {
930   struct
931     {
932     unsigned PS0                : 1;
933     unsigned PS1                : 1;
934     unsigned PS2                : 1;
935     unsigned PSA                : 1;
936     unsigned TMR0SE             : 1;
937     unsigned TMR0CS             : 1;
938     unsigned INTEDG             : 1;
939     unsigned NOT_WPUEN          : 1;
940     };
941 
942   struct
943     {
944     unsigned                    : 1;
945     unsigned                    : 1;
946     unsigned                    : 1;
947     unsigned                    : 1;
948     unsigned T0SE               : 1;
949     unsigned T0CS               : 1;
950     unsigned                    : 1;
951     unsigned                    : 1;
952     };
953 
954   struct
955     {
956     unsigned PS                 : 3;
957     unsigned                    : 5;
958     };
959   } __OPTION_REGbits_t;
960 
961 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
962 
963 #define _PS0                    0x01
964 #define _PS1                    0x02
965 #define _PS2                    0x04
966 #define _PSA                    0x08
967 #define _TMR0SE                 0x10
968 #define _T0SE                   0x10
969 #define _TMR0CS                 0x20
970 #define _T0CS                   0x20
971 #define _INTEDG                 0x40
972 #define _NOT_WPUEN              0x80
973 
974 //==============================================================================
975 
976 
977 //==============================================================================
978 //        PCON Bits
979 
980 extern __at(0x0096) __sfr PCON;
981 
982 typedef struct
983   {
984   unsigned NOT_BOR              : 1;
985   unsigned NOT_POR              : 1;
986   unsigned NOT_RI               : 1;
987   unsigned NOT_RMCLR            : 1;
988   unsigned                      : 1;
989   unsigned                      : 1;
990   unsigned STKUNF               : 1;
991   unsigned STKOVF               : 1;
992   } __PCONbits_t;
993 
994 extern __at(0x0096) volatile __PCONbits_t PCONbits;
995 
996 #define _NOT_BOR                0x01
997 #define _NOT_POR                0x02
998 #define _NOT_RI                 0x04
999 #define _NOT_RMCLR              0x08
1000 #define _STKUNF                 0x40
1001 #define _STKOVF                 0x80
1002 
1003 //==============================================================================
1004 
1005 
1006 //==============================================================================
1007 //        WDTCON Bits
1008 
1009 extern __at(0x0097) __sfr WDTCON;
1010 
1011 typedef union
1012   {
1013   struct
1014     {
1015     unsigned SWDTEN             : 1;
1016     unsigned WDTPS0             : 1;
1017     unsigned WDTPS1             : 1;
1018     unsigned WDTPS2             : 1;
1019     unsigned WDTPS3             : 1;
1020     unsigned WDTPS4             : 1;
1021     unsigned                    : 1;
1022     unsigned                    : 1;
1023     };
1024 
1025   struct
1026     {
1027     unsigned                    : 1;
1028     unsigned WDTPS              : 5;
1029     unsigned                    : 2;
1030     };
1031   } __WDTCONbits_t;
1032 
1033 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
1034 
1035 #define _SWDTEN                 0x01
1036 #define _WDTPS0                 0x02
1037 #define _WDTPS1                 0x04
1038 #define _WDTPS2                 0x08
1039 #define _WDTPS3                 0x10
1040 #define _WDTPS4                 0x20
1041 
1042 //==============================================================================
1043 
1044 
1045 //==============================================================================
1046 //        OSCTUNE Bits
1047 
1048 extern __at(0x0098) __sfr OSCTUNE;
1049 
1050 typedef union
1051   {
1052   struct
1053     {
1054     unsigned TUN0               : 1;
1055     unsigned TUN1               : 1;
1056     unsigned TUN2               : 1;
1057     unsigned TUN3               : 1;
1058     unsigned TUN4               : 1;
1059     unsigned TUN5               : 1;
1060     unsigned                    : 1;
1061     unsigned                    : 1;
1062     };
1063 
1064   struct
1065     {
1066     unsigned TUN                : 6;
1067     unsigned                    : 2;
1068     };
1069   } __OSCTUNEbits_t;
1070 
1071 extern __at(0x0098) volatile __OSCTUNEbits_t OSCTUNEbits;
1072 
1073 #define _TUN0                   0x01
1074 #define _TUN1                   0x02
1075 #define _TUN2                   0x04
1076 #define _TUN3                   0x08
1077 #define _TUN4                   0x10
1078 #define _TUN5                   0x20
1079 
1080 //==============================================================================
1081 
1082 
1083 //==============================================================================
1084 //        OSCCON Bits
1085 
1086 extern __at(0x0099) __sfr OSCCON;
1087 
1088 typedef union
1089   {
1090   struct
1091     {
1092     unsigned SCS0               : 1;
1093     unsigned SCS1               : 1;
1094     unsigned                    : 1;
1095     unsigned IRCF0              : 1;
1096     unsigned IRCF1              : 1;
1097     unsigned IRCF2              : 1;
1098     unsigned IRCF3              : 1;
1099     unsigned SPLLEN             : 1;
1100     };
1101 
1102   struct
1103     {
1104     unsigned SCS                : 2;
1105     unsigned                    : 6;
1106     };
1107 
1108   struct
1109     {
1110     unsigned                    : 3;
1111     unsigned IRCF               : 4;
1112     unsigned                    : 1;
1113     };
1114   } __OSCCONbits_t;
1115 
1116 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
1117 
1118 #define _SCS0                   0x01
1119 #define _SCS1                   0x02
1120 #define _IRCF0                  0x08
1121 #define _IRCF1                  0x10
1122 #define _IRCF2                  0x20
1123 #define _IRCF3                  0x40
1124 #define _SPLLEN                 0x80
1125 
1126 //==============================================================================
1127 
1128 
1129 //==============================================================================
1130 //        OSCSTAT Bits
1131 
1132 extern __at(0x009A) __sfr OSCSTAT;
1133 
1134 typedef struct
1135   {
1136   unsigned HFIOFS               : 1;
1137   unsigned LFIOFR               : 1;
1138   unsigned MFIOFR               : 1;
1139   unsigned HFIOFL               : 1;
1140   unsigned HFIOFR               : 1;
1141   unsigned OSTS                 : 1;
1142   unsigned PLLR                 : 1;
1143   unsigned T1OSCR               : 1;
1144   } __OSCSTATbits_t;
1145 
1146 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
1147 
1148 #define _HFIOFS                 0x01
1149 #define _LFIOFR                 0x02
1150 #define _MFIOFR                 0x04
1151 #define _HFIOFL                 0x08
1152 #define _HFIOFR                 0x10
1153 #define _OSTS                   0x20
1154 #define _PLLR                   0x40
1155 #define _T1OSCR                 0x80
1156 
1157 //==============================================================================
1158 
1159 extern __at(0x009B) __sfr ADRES;
1160 extern __at(0x009B) __sfr ADRESL;
1161 extern __at(0x009C) __sfr ADRESH;
1162 
1163 //==============================================================================
1164 //        ADCON0 Bits
1165 
1166 extern __at(0x009D) __sfr ADCON0;
1167 
1168 typedef union
1169   {
1170   struct
1171     {
1172     unsigned ADON               : 1;
1173     unsigned GO_NOT_DONE        : 1;
1174     unsigned CHS0               : 1;
1175     unsigned CHS1               : 1;
1176     unsigned CHS2               : 1;
1177     unsigned CHS3               : 1;
1178     unsigned CHS4               : 1;
1179     unsigned                    : 1;
1180     };
1181 
1182   struct
1183     {
1184     unsigned                    : 1;
1185     unsigned ADGO               : 1;
1186     unsigned                    : 1;
1187     unsigned                    : 1;
1188     unsigned                    : 1;
1189     unsigned                    : 1;
1190     unsigned                    : 1;
1191     unsigned                    : 1;
1192     };
1193 
1194   struct
1195     {
1196     unsigned                    : 1;
1197     unsigned GO                 : 1;
1198     unsigned                    : 1;
1199     unsigned                    : 1;
1200     unsigned                    : 1;
1201     unsigned                    : 1;
1202     unsigned                    : 1;
1203     unsigned                    : 1;
1204     };
1205 
1206   struct
1207     {
1208     unsigned                    : 2;
1209     unsigned CHS                : 5;
1210     unsigned                    : 1;
1211     };
1212   } __ADCON0bits_t;
1213 
1214 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1215 
1216 #define _ADON                   0x01
1217 #define _GO_NOT_DONE            0x02
1218 #define _ADGO                   0x02
1219 #define _GO                     0x02
1220 #define _CHS0                   0x04
1221 #define _CHS1                   0x08
1222 #define _CHS2                   0x10
1223 #define _CHS3                   0x20
1224 #define _CHS4                   0x40
1225 
1226 //==============================================================================
1227 
1228 
1229 //==============================================================================
1230 //        ADCON1 Bits
1231 
1232 extern __at(0x009E) __sfr ADCON1;
1233 
1234 typedef union
1235   {
1236   struct
1237     {
1238     unsigned ADPREF0            : 1;
1239     unsigned ADPREF1            : 1;
1240     unsigned ADNREF             : 1;
1241     unsigned                    : 1;
1242     unsigned ADCS0              : 1;
1243     unsigned ADCS1              : 1;
1244     unsigned ADCS2              : 1;
1245     unsigned ADFM               : 1;
1246     };
1247 
1248   struct
1249     {
1250     unsigned ADPREF             : 2;
1251     unsigned                    : 6;
1252     };
1253 
1254   struct
1255     {
1256     unsigned                    : 4;
1257     unsigned ADCS               : 3;
1258     unsigned                    : 1;
1259     };
1260   } __ADCON1bits_t;
1261 
1262 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1263 
1264 #define _ADPREF0                0x01
1265 #define _ADPREF1                0x02
1266 #define _ADNREF                 0x04
1267 #define _ADCS0                  0x10
1268 #define _ADCS1                  0x20
1269 #define _ADCS2                  0x40
1270 #define _ADFM                   0x80
1271 
1272 //==============================================================================
1273 
1274 
1275 //==============================================================================
1276 //        LATA Bits
1277 
1278 extern __at(0x010C) __sfr LATA;
1279 
1280 typedef struct
1281   {
1282   unsigned LATA0                : 1;
1283   unsigned LATA1                : 1;
1284   unsigned LATA2                : 1;
1285   unsigned                      : 1;
1286   unsigned LATA4                : 1;
1287   unsigned LATA5                : 1;
1288   unsigned                      : 1;
1289   unsigned                      : 1;
1290   } __LATAbits_t;
1291 
1292 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1293 
1294 #define _LATA0                  0x01
1295 #define _LATA1                  0x02
1296 #define _LATA2                  0x04
1297 #define _LATA4                  0x10
1298 #define _LATA5                  0x20
1299 
1300 //==============================================================================
1301 
1302 
1303 //==============================================================================
1304 //        LATB Bits
1305 
1306 extern __at(0x010D) __sfr LATB;
1307 
1308 typedef struct
1309   {
1310   unsigned                      : 1;
1311   unsigned                      : 1;
1312   unsigned                      : 1;
1313   unsigned                      : 1;
1314   unsigned LATB4                : 1;
1315   unsigned LATB5                : 1;
1316   unsigned LATB6                : 1;
1317   unsigned LATB7                : 1;
1318   } __LATBbits_t;
1319 
1320 extern __at(0x010D) volatile __LATBbits_t LATBbits;
1321 
1322 #define _LATB4                  0x10
1323 #define _LATB5                  0x20
1324 #define _LATB6                  0x40
1325 #define _LATB7                  0x80
1326 
1327 //==============================================================================
1328 
1329 
1330 //==============================================================================
1331 //        LATC Bits
1332 
1333 extern __at(0x010E) __sfr LATC;
1334 
1335 typedef struct
1336   {
1337   unsigned LATC0                : 1;
1338   unsigned LATC1                : 1;
1339   unsigned LATC2                : 1;
1340   unsigned LATC3                : 1;
1341   unsigned LATC4                : 1;
1342   unsigned LATC5                : 1;
1343   unsigned LATC6                : 1;
1344   unsigned LATC7                : 1;
1345   } __LATCbits_t;
1346 
1347 extern __at(0x010E) volatile __LATCbits_t LATCbits;
1348 
1349 #define _LATC0                  0x01
1350 #define _LATC1                  0x02
1351 #define _LATC2                  0x04
1352 #define _LATC3                  0x08
1353 #define _LATC4                  0x10
1354 #define _LATC5                  0x20
1355 #define _LATC6                  0x40
1356 #define _LATC7                  0x80
1357 
1358 //==============================================================================
1359 
1360 
1361 //==============================================================================
1362 //        CM1CON0 Bits
1363 
1364 extern __at(0x0111) __sfr CM1CON0;
1365 
1366 typedef struct
1367   {
1368   unsigned C1SYNC               : 1;
1369   unsigned C1HYS                : 1;
1370   unsigned C1SP                 : 1;
1371   unsigned                      : 1;
1372   unsigned C1POL                : 1;
1373   unsigned C1OE                 : 1;
1374   unsigned C1OUT                : 1;
1375   unsigned C1ON                 : 1;
1376   } __CM1CON0bits_t;
1377 
1378 extern __at(0x0111) volatile __CM1CON0bits_t CM1CON0bits;
1379 
1380 #define _C1SYNC                 0x01
1381 #define _C1HYS                  0x02
1382 #define _C1SP                   0x04
1383 #define _C1POL                  0x10
1384 #define _C1OE                   0x20
1385 #define _C1OUT                  0x40
1386 #define _C1ON                   0x80
1387 
1388 //==============================================================================
1389 
1390 
1391 //==============================================================================
1392 //        CM1CON1 Bits
1393 
1394 extern __at(0x0112) __sfr CM1CON1;
1395 
1396 typedef union
1397   {
1398   struct
1399     {
1400     unsigned C1NCH0             : 1;
1401     unsigned C1NCH1             : 1;
1402     unsigned                    : 1;
1403     unsigned                    : 1;
1404     unsigned C1PCH0             : 1;
1405     unsigned C1PCH1             : 1;
1406     unsigned C1INTN             : 1;
1407     unsigned C1INTP             : 1;
1408     };
1409 
1410   struct
1411     {
1412     unsigned C1NCH              : 2;
1413     unsigned                    : 6;
1414     };
1415 
1416   struct
1417     {
1418     unsigned                    : 4;
1419     unsigned C1PCH              : 2;
1420     unsigned                    : 2;
1421     };
1422   } __CM1CON1bits_t;
1423 
1424 extern __at(0x0112) volatile __CM1CON1bits_t CM1CON1bits;
1425 
1426 #define _C1NCH0                 0x01
1427 #define _C1NCH1                 0x02
1428 #define _C1PCH0                 0x10
1429 #define _C1PCH1                 0x20
1430 #define _C1INTN                 0x40
1431 #define _C1INTP                 0x80
1432 
1433 //==============================================================================
1434 
1435 
1436 //==============================================================================
1437 //        CM2CON0 Bits
1438 
1439 extern __at(0x0113) __sfr CM2CON0;
1440 
1441 typedef struct
1442   {
1443   unsigned C2SYNC               : 1;
1444   unsigned C2HYS                : 1;
1445   unsigned C2SP                 : 1;
1446   unsigned                      : 1;
1447   unsigned C2POL                : 1;
1448   unsigned C2OE                 : 1;
1449   unsigned C2OUT                : 1;
1450   unsigned C2ON                 : 1;
1451   } __CM2CON0bits_t;
1452 
1453 extern __at(0x0113) volatile __CM2CON0bits_t CM2CON0bits;
1454 
1455 #define _C2SYNC                 0x01
1456 #define _C2HYS                  0x02
1457 #define _C2SP                   0x04
1458 #define _C2POL                  0x10
1459 #define _C2OE                   0x20
1460 #define _C2OUT                  0x40
1461 #define _C2ON                   0x80
1462 
1463 //==============================================================================
1464 
1465 
1466 //==============================================================================
1467 //        CM2CON1 Bits
1468 
1469 extern __at(0x0114) __sfr CM2CON1;
1470 
1471 typedef union
1472   {
1473   struct
1474     {
1475     unsigned C2NCH0             : 1;
1476     unsigned C2NCH1             : 1;
1477     unsigned                    : 1;
1478     unsigned                    : 1;
1479     unsigned C2PCH0             : 1;
1480     unsigned C2PCH1             : 1;
1481     unsigned C2INTN             : 1;
1482     unsigned C2INTP             : 1;
1483     };
1484 
1485   struct
1486     {
1487     unsigned C2NCH              : 2;
1488     unsigned                    : 6;
1489     };
1490 
1491   struct
1492     {
1493     unsigned                    : 4;
1494     unsigned C2PCH              : 2;
1495     unsigned                    : 2;
1496     };
1497   } __CM2CON1bits_t;
1498 
1499 extern __at(0x0114) volatile __CM2CON1bits_t CM2CON1bits;
1500 
1501 #define _C2NCH0                 0x01
1502 #define _C2NCH1                 0x02
1503 #define _C2PCH0                 0x10
1504 #define _C2PCH1                 0x20
1505 #define _C2INTN                 0x40
1506 #define _C2INTP                 0x80
1507 
1508 //==============================================================================
1509 
1510 
1511 //==============================================================================
1512 //        CMOUT Bits
1513 
1514 extern __at(0x0115) __sfr CMOUT;
1515 
1516 typedef struct
1517   {
1518   unsigned MC1OUT               : 1;
1519   unsigned MC2OUT               : 1;
1520   unsigned                      : 1;
1521   unsigned                      : 1;
1522   unsigned                      : 1;
1523   unsigned                      : 1;
1524   unsigned                      : 1;
1525   unsigned                      : 1;
1526   } __CMOUTbits_t;
1527 
1528 extern __at(0x0115) volatile __CMOUTbits_t CMOUTbits;
1529 
1530 #define _MC1OUT                 0x01
1531 #define _MC2OUT                 0x02
1532 
1533 //==============================================================================
1534 
1535 
1536 //==============================================================================
1537 //        BORCON Bits
1538 
1539 extern __at(0x0116) __sfr BORCON;
1540 
1541 typedef struct
1542   {
1543   unsigned BORRDY               : 1;
1544   unsigned                      : 1;
1545   unsigned                      : 1;
1546   unsigned                      : 1;
1547   unsigned                      : 1;
1548   unsigned                      : 1;
1549   unsigned                      : 1;
1550   unsigned SBOREN               : 1;
1551   } __BORCONbits_t;
1552 
1553 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1554 
1555 #define _BORRDY                 0x01
1556 #define _SBOREN                 0x80
1557 
1558 //==============================================================================
1559 
1560 
1561 //==============================================================================
1562 //        FVRCON Bits
1563 
1564 extern __at(0x0117) __sfr FVRCON;
1565 
1566 typedef union
1567   {
1568   struct
1569     {
1570     unsigned ADFVR0             : 1;
1571     unsigned ADFVR1             : 1;
1572     unsigned CDAFVR0            : 1;
1573     unsigned CDAFVR1            : 1;
1574     unsigned TSRNG              : 1;
1575     unsigned TSEN               : 1;
1576     unsigned FVRRDY             : 1;
1577     unsigned FVREN              : 1;
1578     };
1579 
1580   struct
1581     {
1582     unsigned ADFVR              : 2;
1583     unsigned                    : 6;
1584     };
1585 
1586   struct
1587     {
1588     unsigned                    : 2;
1589     unsigned CDAFVR             : 2;
1590     unsigned                    : 4;
1591     };
1592   } __FVRCONbits_t;
1593 
1594 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1595 
1596 #define _ADFVR0                 0x01
1597 #define _ADFVR1                 0x02
1598 #define _CDAFVR0                0x04
1599 #define _CDAFVR1                0x08
1600 #define _TSRNG                  0x10
1601 #define _TSEN                   0x20
1602 #define _FVRRDY                 0x40
1603 #define _FVREN                  0x80
1604 
1605 //==============================================================================
1606 
1607 
1608 //==============================================================================
1609 //        DACCON0 Bits
1610 
1611 extern __at(0x0118) __sfr DACCON0;
1612 
1613 typedef union
1614   {
1615   struct
1616     {
1617     unsigned DACNSS             : 1;
1618     unsigned                    : 1;
1619     unsigned DACPSS0            : 1;
1620     unsigned DACPSS1            : 1;
1621     unsigned                    : 1;
1622     unsigned DACOE              : 1;
1623     unsigned DACLPS             : 1;
1624     unsigned DACEN              : 1;
1625     };
1626 
1627   struct
1628     {
1629     unsigned                    : 2;
1630     unsigned DACPSS             : 2;
1631     unsigned                    : 4;
1632     };
1633   } __DACCON0bits_t;
1634 
1635 extern __at(0x0118) volatile __DACCON0bits_t DACCON0bits;
1636 
1637 #define _DACNSS                 0x01
1638 #define _DACPSS0                0x04
1639 #define _DACPSS1                0x08
1640 #define _DACOE                  0x20
1641 #define _DACLPS                 0x40
1642 #define _DACEN                  0x80
1643 
1644 //==============================================================================
1645 
1646 
1647 //==============================================================================
1648 //        DACCON1 Bits
1649 
1650 extern __at(0x0119) __sfr DACCON1;
1651 
1652 typedef union
1653   {
1654   struct
1655     {
1656     unsigned DACR0              : 1;
1657     unsigned DACR1              : 1;
1658     unsigned DACR2              : 1;
1659     unsigned DACR3              : 1;
1660     unsigned DACR4              : 1;
1661     unsigned                    : 1;
1662     unsigned                    : 1;
1663     unsigned                    : 1;
1664     };
1665 
1666   struct
1667     {
1668     unsigned DACR               : 5;
1669     unsigned                    : 3;
1670     };
1671   } __DACCON1bits_t;
1672 
1673 extern __at(0x0119) volatile __DACCON1bits_t DACCON1bits;
1674 
1675 #define _DACR0                  0x01
1676 #define _DACR1                  0x02
1677 #define _DACR2                  0x04
1678 #define _DACR3                  0x08
1679 #define _DACR4                  0x10
1680 
1681 //==============================================================================
1682 
1683 
1684 //==============================================================================
1685 //        SRCON0 Bits
1686 
1687 extern __at(0x011A) __sfr SRCON0;
1688 
1689 typedef union
1690   {
1691   struct
1692     {
1693     unsigned SRPR               : 1;
1694     unsigned SRPS               : 1;
1695     unsigned SRNQEN             : 1;
1696     unsigned SRQEN              : 1;
1697     unsigned SRCLK0             : 1;
1698     unsigned SRCLK1             : 1;
1699     unsigned SRCLK2             : 1;
1700     unsigned SRLEN              : 1;
1701     };
1702 
1703   struct
1704     {
1705     unsigned                    : 4;
1706     unsigned SRCLK              : 3;
1707     unsigned                    : 1;
1708     };
1709   } __SRCON0bits_t;
1710 
1711 extern __at(0x011A) volatile __SRCON0bits_t SRCON0bits;
1712 
1713 #define _SRPR                   0x01
1714 #define _SRPS                   0x02
1715 #define _SRNQEN                 0x04
1716 #define _SRQEN                  0x08
1717 #define _SRCLK0                 0x10
1718 #define _SRCLK1                 0x20
1719 #define _SRCLK2                 0x40
1720 #define _SRLEN                  0x80
1721 
1722 //==============================================================================
1723 
1724 
1725 //==============================================================================
1726 //        SRCON1 Bits
1727 
1728 extern __at(0x011B) __sfr SRCON1;
1729 
1730 typedef struct
1731   {
1732   unsigned SRRC1E               : 1;
1733   unsigned SRRC2E               : 1;
1734   unsigned SRRCKE               : 1;
1735   unsigned SRRPE                : 1;
1736   unsigned SRSC1E               : 1;
1737   unsigned SRSC2E               : 1;
1738   unsigned SRSCKE               : 1;
1739   unsigned SRSPE                : 1;
1740   } __SRCON1bits_t;
1741 
1742 extern __at(0x011B) volatile __SRCON1bits_t SRCON1bits;
1743 
1744 #define _SRRC1E                 0x01
1745 #define _SRRC2E                 0x02
1746 #define _SRRCKE                 0x04
1747 #define _SRRPE                  0x08
1748 #define _SRSC1E                 0x10
1749 #define _SRSC2E                 0x20
1750 #define _SRSCKE                 0x40
1751 #define _SRSPE                  0x80
1752 
1753 //==============================================================================
1754 
1755 
1756 //==============================================================================
1757 //        APFCON0 Bits
1758 
1759 extern __at(0x011D) __sfr APFCON0;
1760 
1761 typedef struct
1762   {
1763   unsigned                      : 1;
1764   unsigned                      : 1;
1765   unsigned TXCKSEL              : 1;
1766   unsigned T1GSEL               : 1;
1767   unsigned                      : 1;
1768   unsigned                      : 1;
1769   unsigned                      : 1;
1770   unsigned RXDTSEL              : 1;
1771   } __APFCON0bits_t;
1772 
1773 extern __at(0x011D) volatile __APFCON0bits_t APFCON0bits;
1774 
1775 #define _TXCKSEL                0x04
1776 #define _T1GSEL                 0x08
1777 #define _RXDTSEL                0x80
1778 
1779 //==============================================================================
1780 
1781 
1782 //==============================================================================
1783 //        APFCON1 Bits
1784 
1785 extern __at(0x011E) __sfr APFCON1;
1786 
1787 typedef struct
1788   {
1789   unsigned CCP2SEL              : 1;
1790   unsigned P2BSEL               : 1;
1791   unsigned P1CSEL               : 1;
1792   unsigned P1DSEL               : 1;
1793   unsigned                      : 1;
1794   unsigned                      : 1;
1795   unsigned                      : 1;
1796   unsigned                      : 1;
1797   } __APFCON1bits_t;
1798 
1799 extern __at(0x011E) volatile __APFCON1bits_t APFCON1bits;
1800 
1801 #define _CCP2SEL                0x01
1802 #define _P2BSEL                 0x02
1803 #define _P1CSEL                 0x04
1804 #define _P1DSEL                 0x08
1805 
1806 //==============================================================================
1807 
1808 
1809 //==============================================================================
1810 //        ANSELA Bits
1811 
1812 extern __at(0x018C) __sfr ANSELA;
1813 
1814 typedef struct
1815   {
1816   unsigned ANSA0                : 1;
1817   unsigned ANSA1                : 1;
1818   unsigned ANSA2                : 1;
1819   unsigned                      : 1;
1820   unsigned ANSA4                : 1;
1821   unsigned                      : 1;
1822   unsigned                      : 1;
1823   unsigned                      : 1;
1824   } __ANSELAbits_t;
1825 
1826 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1827 
1828 #define _ANSA0                  0x01
1829 #define _ANSA1                  0x02
1830 #define _ANSA2                  0x04
1831 #define _ANSA4                  0x10
1832 
1833 //==============================================================================
1834 
1835 
1836 //==============================================================================
1837 //        ANSELB Bits
1838 
1839 extern __at(0x018D) __sfr ANSELB;
1840 
1841 typedef struct
1842   {
1843   unsigned                      : 1;
1844   unsigned                      : 1;
1845   unsigned                      : 1;
1846   unsigned                      : 1;
1847   unsigned ANSB4                : 1;
1848   unsigned ANSB5                : 1;
1849   unsigned                      : 1;
1850   unsigned                      : 1;
1851   } __ANSELBbits_t;
1852 
1853 extern __at(0x018D) volatile __ANSELBbits_t ANSELBbits;
1854 
1855 #define _ANSB4                  0x10
1856 #define _ANSB5                  0x20
1857 
1858 //==============================================================================
1859 
1860 
1861 //==============================================================================
1862 //        ANSELC Bits
1863 
1864 extern __at(0x018E) __sfr ANSELC;
1865 
1866 typedef struct
1867   {
1868   unsigned ANSC0                : 1;
1869   unsigned ANSC1                : 1;
1870   unsigned ANSC2                : 1;
1871   unsigned ANSC3                : 1;
1872   unsigned                      : 1;
1873   unsigned                      : 1;
1874   unsigned ANSC6                : 1;
1875   unsigned ANSC7                : 1;
1876   } __ANSELCbits_t;
1877 
1878 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits;
1879 
1880 #define _ANSC0                  0x01
1881 #define _ANSC1                  0x02
1882 #define _ANSC2                  0x04
1883 #define _ANSC3                  0x08
1884 #define _ANSC6                  0x40
1885 #define _ANSC7                  0x80
1886 
1887 //==============================================================================
1888 
1889 extern __at(0x0191) __sfr EEADR;
1890 extern __at(0x0191) __sfr EEADRL;
1891 extern __at(0x0192) __sfr EEADRH;
1892 extern __at(0x0193) __sfr EEDAT;
1893 extern __at(0x0193) __sfr EEDATL;
1894 extern __at(0x0194) __sfr EEDATH;
1895 
1896 //==============================================================================
1897 //        EECON1 Bits
1898 
1899 extern __at(0x0195) __sfr EECON1;
1900 
1901 typedef struct
1902   {
1903   unsigned RD                   : 1;
1904   unsigned WR                   : 1;
1905   unsigned WREN                 : 1;
1906   unsigned WRERR                : 1;
1907   unsigned FREE                 : 1;
1908   unsigned LWLO                 : 1;
1909   unsigned CFGS                 : 1;
1910   unsigned EEPGD                : 1;
1911   } __EECON1bits_t;
1912 
1913 extern __at(0x0195) volatile __EECON1bits_t EECON1bits;
1914 
1915 #define _RD                     0x01
1916 #define _WR                     0x02
1917 #define _WREN                   0x04
1918 #define _WRERR                  0x08
1919 #define _FREE                   0x10
1920 #define _LWLO                   0x20
1921 #define _CFGS                   0x40
1922 #define _EEPGD                  0x80
1923 
1924 //==============================================================================
1925 
1926 extern __at(0x0196) __sfr EECON2;
1927 extern __at(0x0199) __sfr RCREG;
1928 extern __at(0x019A) __sfr TXREG;
1929 extern __at(0x019B) __sfr SP1BRG;
1930 extern __at(0x019B) __sfr SP1BRGL;
1931 extern __at(0x019B) __sfr SPBRG;
1932 extern __at(0x019B) __sfr SPBRGL;
1933 extern __at(0x019C) __sfr SP1BRGH;
1934 extern __at(0x019C) __sfr SPBRGH;
1935 
1936 //==============================================================================
1937 //        RCSTA Bits
1938 
1939 extern __at(0x019D) __sfr RCSTA;
1940 
1941 typedef struct
1942   {
1943   unsigned RX9D                 : 1;
1944   unsigned OERR                 : 1;
1945   unsigned FERR                 : 1;
1946   unsigned ADDEN                : 1;
1947   unsigned CREN                 : 1;
1948   unsigned SREN                 : 1;
1949   unsigned RX9                  : 1;
1950   unsigned SPEN                 : 1;
1951   } __RCSTAbits_t;
1952 
1953 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
1954 
1955 #define _RX9D                   0x01
1956 #define _OERR                   0x02
1957 #define _FERR                   0x04
1958 #define _ADDEN                  0x08
1959 #define _CREN                   0x10
1960 #define _SREN                   0x20
1961 #define _RX9                    0x40
1962 #define _SPEN                   0x80
1963 
1964 //==============================================================================
1965 
1966 
1967 //==============================================================================
1968 //        TXSTA Bits
1969 
1970 extern __at(0x019E) __sfr TXSTA;
1971 
1972 typedef struct
1973   {
1974   unsigned TX9D                 : 1;
1975   unsigned TRMT                 : 1;
1976   unsigned BRGH                 : 1;
1977   unsigned SENDB                : 1;
1978   unsigned SYNC                 : 1;
1979   unsigned TXEN                 : 1;
1980   unsigned TX9                  : 1;
1981   unsigned CSRC                 : 1;
1982   } __TXSTAbits_t;
1983 
1984 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
1985 
1986 #define _TX9D                   0x01
1987 #define _TRMT                   0x02
1988 #define _BRGH                   0x04
1989 #define _SENDB                  0x08
1990 #define _SYNC                   0x10
1991 #define _TXEN                   0x20
1992 #define _TX9                    0x40
1993 #define _CSRC                   0x80
1994 
1995 //==============================================================================
1996 
1997 
1998 //==============================================================================
1999 //        BAUDCON Bits
2000 
2001 extern __at(0x019F) __sfr BAUDCON;
2002 
2003 typedef struct
2004   {
2005   unsigned ABDEN                : 1;
2006   unsigned WUE                  : 1;
2007   unsigned                      : 1;
2008   unsigned BRG16                : 1;
2009   unsigned SCKP                 : 1;
2010   unsigned                      : 1;
2011   unsigned RCIDL                : 1;
2012   unsigned ABDOVF               : 1;
2013   } __BAUDCONbits_t;
2014 
2015 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
2016 
2017 #define _ABDEN                  0x01
2018 #define _WUE                    0x02
2019 #define _BRG16                  0x08
2020 #define _SCKP                   0x10
2021 #define _RCIDL                  0x40
2022 #define _ABDOVF                 0x80
2023 
2024 //==============================================================================
2025 
2026 
2027 //==============================================================================
2028 //        WPUA Bits
2029 
2030 extern __at(0x020C) __sfr WPUA;
2031 
2032 typedef union
2033   {
2034   struct
2035     {
2036     unsigned WPUA0              : 1;
2037     unsigned WPUA1              : 1;
2038     unsigned WPUA2              : 1;
2039     unsigned WPUA3              : 1;
2040     unsigned WPUA4              : 1;
2041     unsigned WPUA5              : 1;
2042     unsigned                    : 1;
2043     unsigned                    : 1;
2044     };
2045 
2046   struct
2047     {
2048     unsigned WPUA               : 6;
2049     unsigned                    : 2;
2050     };
2051   } __WPUAbits_t;
2052 
2053 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
2054 
2055 #define _WPUA0                  0x01
2056 #define _WPUA1                  0x02
2057 #define _WPUA2                  0x04
2058 #define _WPUA3                  0x08
2059 #define _WPUA4                  0x10
2060 #define _WPUA5                  0x20
2061 
2062 //==============================================================================
2063 
2064 
2065 //==============================================================================
2066 //        WPUB Bits
2067 
2068 extern __at(0x020D) __sfr WPUB;
2069 
2070 typedef struct
2071   {
2072   unsigned                      : 1;
2073   unsigned                      : 1;
2074   unsigned                      : 1;
2075   unsigned                      : 1;
2076   unsigned WPUB4                : 1;
2077   unsigned WPUB5                : 1;
2078   unsigned WPUB6                : 1;
2079   unsigned WPUB7                : 1;
2080   } __WPUBbits_t;
2081 
2082 extern __at(0x020D) volatile __WPUBbits_t WPUBbits;
2083 
2084 #define _WPUB4                  0x10
2085 #define _WPUB5                  0x20
2086 #define _WPUB6                  0x40
2087 #define _WPUB7                  0x80
2088 
2089 //==============================================================================
2090 
2091 
2092 //==============================================================================
2093 //        WPUC Bits
2094 
2095 extern __at(0x020E) __sfr WPUC;
2096 
2097 typedef struct
2098   {
2099   unsigned WPUC0                : 1;
2100   unsigned WPUC1                : 1;
2101   unsigned WPUC2                : 1;
2102   unsigned WPUC3                : 1;
2103   unsigned WPUC4                : 1;
2104   unsigned WPUC5                : 1;
2105   unsigned WPUC6                : 1;
2106   unsigned WPUC7                : 1;
2107   } __WPUCbits_t;
2108 
2109 extern __at(0x020E) volatile __WPUCbits_t WPUCbits;
2110 
2111 #define _WPUC0                  0x01
2112 #define _WPUC1                  0x02
2113 #define _WPUC2                  0x04
2114 #define _WPUC3                  0x08
2115 #define _WPUC4                  0x10
2116 #define _WPUC5                  0x20
2117 #define _WPUC6                  0x40
2118 #define _WPUC7                  0x80
2119 
2120 //==============================================================================
2121 
2122 extern __at(0x0211) __sfr SSP1BUF;
2123 extern __at(0x0211) __sfr SSPBUF;
2124 extern __at(0x0212) __sfr SSP1ADD;
2125 extern __at(0x0212) __sfr SSPADD;
2126 extern __at(0x0213) __sfr SSP1MSK;
2127 extern __at(0x0213) __sfr SSPMSK;
2128 
2129 //==============================================================================
2130 //        SSP1STAT Bits
2131 
2132 extern __at(0x0214) __sfr SSP1STAT;
2133 
2134 typedef struct
2135   {
2136   unsigned BF                   : 1;
2137   unsigned UA                   : 1;
2138   unsigned R_NOT_W              : 1;
2139   unsigned S                    : 1;
2140   unsigned P                    : 1;
2141   unsigned D_NOT_A              : 1;
2142   unsigned CKE                  : 1;
2143   unsigned SMP                  : 1;
2144   } __SSP1STATbits_t;
2145 
2146 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
2147 
2148 #define _BF                     0x01
2149 #define _UA                     0x02
2150 #define _R_NOT_W                0x04
2151 #define _S                      0x08
2152 #define _P                      0x10
2153 #define _D_NOT_A                0x20
2154 #define _CKE                    0x40
2155 #define _SMP                    0x80
2156 
2157 //==============================================================================
2158 
2159 
2160 //==============================================================================
2161 //        SSPSTAT Bits
2162 
2163 extern __at(0x0214) __sfr SSPSTAT;
2164 
2165 typedef struct
2166   {
2167   unsigned BF                   : 1;
2168   unsigned UA                   : 1;
2169   unsigned R_NOT_W              : 1;
2170   unsigned S                    : 1;
2171   unsigned P                    : 1;
2172   unsigned D_NOT_A              : 1;
2173   unsigned CKE                  : 1;
2174   unsigned SMP                  : 1;
2175   } __SSPSTATbits_t;
2176 
2177 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
2178 
2179 #define _SSPSTAT_BF             0x01
2180 #define _SSPSTAT_UA             0x02
2181 #define _SSPSTAT_R_NOT_W        0x04
2182 #define _SSPSTAT_S              0x08
2183 #define _SSPSTAT_P              0x10
2184 #define _SSPSTAT_D_NOT_A        0x20
2185 #define _SSPSTAT_CKE            0x40
2186 #define _SSPSTAT_SMP            0x80
2187 
2188 //==============================================================================
2189 
2190 
2191 //==============================================================================
2192 //        SSP1CON Bits
2193 
2194 extern __at(0x0215) __sfr SSP1CON;
2195 
2196 typedef union
2197   {
2198   struct
2199     {
2200     unsigned SSPM0              : 1;
2201     unsigned SSPM1              : 1;
2202     unsigned SSPM2              : 1;
2203     unsigned SSPM3              : 1;
2204     unsigned CKP                : 1;
2205     unsigned SSPEN              : 1;
2206     unsigned SSPOV              : 1;
2207     unsigned WCOL               : 1;
2208     };
2209 
2210   struct
2211     {
2212     unsigned SSPM               : 4;
2213     unsigned                    : 4;
2214     };
2215   } __SSP1CONbits_t;
2216 
2217 extern __at(0x0215) volatile __SSP1CONbits_t SSP1CONbits;
2218 
2219 #define _SSPM0                  0x01
2220 #define _SSPM1                  0x02
2221 #define _SSPM2                  0x04
2222 #define _SSPM3                  0x08
2223 #define _CKP                    0x10
2224 #define _SSPEN                  0x20
2225 #define _SSPOV                  0x40
2226 #define _WCOL                   0x80
2227 
2228 //==============================================================================
2229 
2230 
2231 //==============================================================================
2232 //        SSP1CON1 Bits
2233 
2234 extern __at(0x0215) __sfr SSP1CON1;
2235 
2236 typedef union
2237   {
2238   struct
2239     {
2240     unsigned SSPM0              : 1;
2241     unsigned SSPM1              : 1;
2242     unsigned SSPM2              : 1;
2243     unsigned SSPM3              : 1;
2244     unsigned CKP                : 1;
2245     unsigned SSPEN              : 1;
2246     unsigned SSPOV              : 1;
2247     unsigned WCOL               : 1;
2248     };
2249 
2250   struct
2251     {
2252     unsigned SSPM               : 4;
2253     unsigned                    : 4;
2254     };
2255   } __SSP1CON1bits_t;
2256 
2257 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
2258 
2259 #define _SSP1CON1_SSPM0         0x01
2260 #define _SSP1CON1_SSPM1         0x02
2261 #define _SSP1CON1_SSPM2         0x04
2262 #define _SSP1CON1_SSPM3         0x08
2263 #define _SSP1CON1_CKP           0x10
2264 #define _SSP1CON1_SSPEN         0x20
2265 #define _SSP1CON1_SSPOV         0x40
2266 #define _SSP1CON1_WCOL          0x80
2267 
2268 //==============================================================================
2269 
2270 
2271 //==============================================================================
2272 //        SSPCON Bits
2273 
2274 extern __at(0x0215) __sfr SSPCON;
2275 
2276 typedef union
2277   {
2278   struct
2279     {
2280     unsigned SSPM0              : 1;
2281     unsigned SSPM1              : 1;
2282     unsigned SSPM2              : 1;
2283     unsigned SSPM3              : 1;
2284     unsigned CKP                : 1;
2285     unsigned SSPEN              : 1;
2286     unsigned SSPOV              : 1;
2287     unsigned WCOL               : 1;
2288     };
2289 
2290   struct
2291     {
2292     unsigned SSPM               : 4;
2293     unsigned                    : 4;
2294     };
2295   } __SSPCONbits_t;
2296 
2297 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
2298 
2299 #define _SSPCON_SSPM0           0x01
2300 #define _SSPCON_SSPM1           0x02
2301 #define _SSPCON_SSPM2           0x04
2302 #define _SSPCON_SSPM3           0x08
2303 #define _SSPCON_CKP             0x10
2304 #define _SSPCON_SSPEN           0x20
2305 #define _SSPCON_SSPOV           0x40
2306 #define _SSPCON_WCOL            0x80
2307 
2308 //==============================================================================
2309 
2310 
2311 //==============================================================================
2312 //        SSPCON1 Bits
2313 
2314 extern __at(0x0215) __sfr SSPCON1;
2315 
2316 typedef union
2317   {
2318   struct
2319     {
2320     unsigned SSPM0              : 1;
2321     unsigned SSPM1              : 1;
2322     unsigned SSPM2              : 1;
2323     unsigned SSPM3              : 1;
2324     unsigned CKP                : 1;
2325     unsigned SSPEN              : 1;
2326     unsigned SSPOV              : 1;
2327     unsigned WCOL               : 1;
2328     };
2329 
2330   struct
2331     {
2332     unsigned SSPM               : 4;
2333     unsigned                    : 4;
2334     };
2335   } __SSPCON1bits_t;
2336 
2337 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
2338 
2339 #define _SSPCON1_SSPM0          0x01
2340 #define _SSPCON1_SSPM1          0x02
2341 #define _SSPCON1_SSPM2          0x04
2342 #define _SSPCON1_SSPM3          0x08
2343 #define _SSPCON1_CKP            0x10
2344 #define _SSPCON1_SSPEN          0x20
2345 #define _SSPCON1_SSPOV          0x40
2346 #define _SSPCON1_WCOL           0x80
2347 
2348 //==============================================================================
2349 
2350 
2351 //==============================================================================
2352 //        SSP1CON2 Bits
2353 
2354 extern __at(0x0216) __sfr SSP1CON2;
2355 
2356 typedef struct
2357   {
2358   unsigned SEN                  : 1;
2359   unsigned RSEN                 : 1;
2360   unsigned PEN                  : 1;
2361   unsigned RCEN                 : 1;
2362   unsigned ACKEN                : 1;
2363   unsigned ACKDT                : 1;
2364   unsigned ACKSTAT              : 1;
2365   unsigned GCEN                 : 1;
2366   } __SSP1CON2bits_t;
2367 
2368 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
2369 
2370 #define _SEN                    0x01
2371 #define _RSEN                   0x02
2372 #define _PEN                    0x04
2373 #define _RCEN                   0x08
2374 #define _ACKEN                  0x10
2375 #define _ACKDT                  0x20
2376 #define _ACKSTAT                0x40
2377 #define _GCEN                   0x80
2378 
2379 //==============================================================================
2380 
2381 
2382 //==============================================================================
2383 //        SSPCON2 Bits
2384 
2385 extern __at(0x0216) __sfr SSPCON2;
2386 
2387 typedef struct
2388   {
2389   unsigned SEN                  : 1;
2390   unsigned RSEN                 : 1;
2391   unsigned PEN                  : 1;
2392   unsigned RCEN                 : 1;
2393   unsigned ACKEN                : 1;
2394   unsigned ACKDT                : 1;
2395   unsigned ACKSTAT              : 1;
2396   unsigned GCEN                 : 1;
2397   } __SSPCON2bits_t;
2398 
2399 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
2400 
2401 #define _SSPCON2_SEN            0x01
2402 #define _SSPCON2_RSEN           0x02
2403 #define _SSPCON2_PEN            0x04
2404 #define _SSPCON2_RCEN           0x08
2405 #define _SSPCON2_ACKEN          0x10
2406 #define _SSPCON2_ACKDT          0x20
2407 #define _SSPCON2_ACKSTAT        0x40
2408 #define _SSPCON2_GCEN           0x80
2409 
2410 //==============================================================================
2411 
2412 
2413 //==============================================================================
2414 //        SSP1CON3 Bits
2415 
2416 extern __at(0x0217) __sfr SSP1CON3;
2417 
2418 typedef struct
2419   {
2420   unsigned DHEN                 : 1;
2421   unsigned AHEN                 : 1;
2422   unsigned SBCDE                : 1;
2423   unsigned SDAHT                : 1;
2424   unsigned BOEN                 : 1;
2425   unsigned SCIE                 : 1;
2426   unsigned PCIE                 : 1;
2427   unsigned ACKTIM               : 1;
2428   } __SSP1CON3bits_t;
2429 
2430 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
2431 
2432 #define _DHEN                   0x01
2433 #define _AHEN                   0x02
2434 #define _SBCDE                  0x04
2435 #define _SDAHT                  0x08
2436 #define _BOEN                   0x10
2437 #define _SCIE                   0x20
2438 #define _PCIE                   0x40
2439 #define _ACKTIM                 0x80
2440 
2441 //==============================================================================
2442 
2443 
2444 //==============================================================================
2445 //        SSPCON3 Bits
2446 
2447 extern __at(0x0217) __sfr SSPCON3;
2448 
2449 typedef struct
2450   {
2451   unsigned DHEN                 : 1;
2452   unsigned AHEN                 : 1;
2453   unsigned SBCDE                : 1;
2454   unsigned SDAHT                : 1;
2455   unsigned BOEN                 : 1;
2456   unsigned SCIE                 : 1;
2457   unsigned PCIE                 : 1;
2458   unsigned ACKTIM               : 1;
2459   } __SSPCON3bits_t;
2460 
2461 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
2462 
2463 #define _SSPCON3_DHEN           0x01
2464 #define _SSPCON3_AHEN           0x02
2465 #define _SSPCON3_SBCDE          0x04
2466 #define _SSPCON3_SDAHT          0x08
2467 #define _SSPCON3_BOEN           0x10
2468 #define _SSPCON3_SCIE           0x20
2469 #define _SSPCON3_PCIE           0x40
2470 #define _SSPCON3_ACKTIM         0x80
2471 
2472 //==============================================================================
2473 
2474 extern __at(0x0291) __sfr CCPR1;
2475 extern __at(0x0291) __sfr CCPR1L;
2476 extern __at(0x0292) __sfr CCPR1H;
2477 
2478 //==============================================================================
2479 //        CCP1CON Bits
2480 
2481 extern __at(0x0293) __sfr CCP1CON;
2482 
2483 typedef union
2484   {
2485   struct
2486     {
2487     unsigned CCP1M0             : 1;
2488     unsigned CCP1M1             : 1;
2489     unsigned CCP1M2             : 1;
2490     unsigned CCP1M3             : 1;
2491     unsigned DC1B0              : 1;
2492     unsigned DC1B1              : 1;
2493     unsigned P1M0               : 1;
2494     unsigned P1M1               : 1;
2495     };
2496 
2497   struct
2498     {
2499     unsigned CCP1M              : 4;
2500     unsigned                    : 4;
2501     };
2502 
2503   struct
2504     {
2505     unsigned                    : 4;
2506     unsigned DC1B               : 2;
2507     unsigned                    : 2;
2508     };
2509 
2510   struct
2511     {
2512     unsigned                    : 6;
2513     unsigned P1M                : 2;
2514     };
2515   } __CCP1CONbits_t;
2516 
2517 extern __at(0x0293) volatile __CCP1CONbits_t CCP1CONbits;
2518 
2519 #define _CCP1M0                 0x01
2520 #define _CCP1M1                 0x02
2521 #define _CCP1M2                 0x04
2522 #define _CCP1M3                 0x08
2523 #define _DC1B0                  0x10
2524 #define _DC1B1                  0x20
2525 #define _P1M0                   0x40
2526 #define _P1M1                   0x80
2527 
2528 //==============================================================================
2529 
2530 
2531 //==============================================================================
2532 //        PWM1CON Bits
2533 
2534 extern __at(0x0294) __sfr PWM1CON;
2535 
2536 typedef union
2537   {
2538   struct
2539     {
2540     unsigned P1DC0              : 1;
2541     unsigned P1DC1              : 1;
2542     unsigned P1DC2              : 1;
2543     unsigned P1DC3              : 1;
2544     unsigned P1DC4              : 1;
2545     unsigned P1DC5              : 1;
2546     unsigned P1DC6              : 1;
2547     unsigned P1RSEN             : 1;
2548     };
2549 
2550   struct
2551     {
2552     unsigned P1DC               : 7;
2553     unsigned                    : 1;
2554     };
2555   } __PWM1CONbits_t;
2556 
2557 extern __at(0x0294) volatile __PWM1CONbits_t PWM1CONbits;
2558 
2559 #define _P1DC0                  0x01
2560 #define _P1DC1                  0x02
2561 #define _P1DC2                  0x04
2562 #define _P1DC3                  0x08
2563 #define _P1DC4                  0x10
2564 #define _P1DC5                  0x20
2565 #define _P1DC6                  0x40
2566 #define _P1RSEN                 0x80
2567 
2568 //==============================================================================
2569 
2570 
2571 //==============================================================================
2572 //        CCP1AS Bits
2573 
2574 extern __at(0x0295) __sfr CCP1AS;
2575 
2576 typedef union
2577   {
2578   struct
2579     {
2580     unsigned PSS1BD0            : 1;
2581     unsigned PSS1BD1            : 1;
2582     unsigned PSS1AC0            : 1;
2583     unsigned PSS1AC1            : 1;
2584     unsigned CCP1AS0            : 1;
2585     unsigned CCP1AS1            : 1;
2586     unsigned CCP1AS2            : 1;
2587     unsigned CCP1ASE            : 1;
2588     };
2589 
2590   struct
2591     {
2592     unsigned PSS1BD             : 2;
2593     unsigned                    : 6;
2594     };
2595 
2596   struct
2597     {
2598     unsigned                    : 2;
2599     unsigned PSS1AC             : 2;
2600     unsigned                    : 4;
2601     };
2602 
2603   struct
2604     {
2605     unsigned                    : 4;
2606     unsigned CCP1AS             : 3;
2607     unsigned                    : 1;
2608     };
2609   } __CCP1ASbits_t;
2610 
2611 extern __at(0x0295) volatile __CCP1ASbits_t CCP1ASbits;
2612 
2613 #define _PSS1BD0                0x01
2614 #define _PSS1BD1                0x02
2615 #define _PSS1AC0                0x04
2616 #define _PSS1AC1                0x08
2617 #define _CCP1AS0                0x10
2618 #define _CCP1AS1                0x20
2619 #define _CCP1AS2                0x40
2620 #define _CCP1ASE                0x80
2621 
2622 //==============================================================================
2623 
2624 
2625 //==============================================================================
2626 //        ECCP1AS Bits
2627 
2628 extern __at(0x0295) __sfr ECCP1AS;
2629 
2630 typedef union
2631   {
2632   struct
2633     {
2634     unsigned PSS1BD0            : 1;
2635     unsigned PSS1BD1            : 1;
2636     unsigned PSS1AC0            : 1;
2637     unsigned PSS1AC1            : 1;
2638     unsigned CCP1AS0            : 1;
2639     unsigned CCP1AS1            : 1;
2640     unsigned CCP1AS2            : 1;
2641     unsigned CCP1ASE            : 1;
2642     };
2643 
2644   struct
2645     {
2646     unsigned PSS1BD             : 2;
2647     unsigned                    : 6;
2648     };
2649 
2650   struct
2651     {
2652     unsigned                    : 2;
2653     unsigned PSS1AC             : 2;
2654     unsigned                    : 4;
2655     };
2656 
2657   struct
2658     {
2659     unsigned                    : 4;
2660     unsigned CCP1AS             : 3;
2661     unsigned                    : 1;
2662     };
2663   } __ECCP1ASbits_t;
2664 
2665 extern __at(0x0295) volatile __ECCP1ASbits_t ECCP1ASbits;
2666 
2667 #define _ECCP1AS_PSS1BD0        0x01
2668 #define _ECCP1AS_PSS1BD1        0x02
2669 #define _ECCP1AS_PSS1AC0        0x04
2670 #define _ECCP1AS_PSS1AC1        0x08
2671 #define _ECCP1AS_CCP1AS0        0x10
2672 #define _ECCP1AS_CCP1AS1        0x20
2673 #define _ECCP1AS_CCP1AS2        0x40
2674 #define _ECCP1AS_CCP1ASE        0x80
2675 
2676 //==============================================================================
2677 
2678 
2679 //==============================================================================
2680 //        PSTR1CON Bits
2681 
2682 extern __at(0x0296) __sfr PSTR1CON;
2683 
2684 typedef struct
2685   {
2686   unsigned STR1A                : 1;
2687   unsigned STR1B                : 1;
2688   unsigned STR1C                : 1;
2689   unsigned STR1D                : 1;
2690   unsigned STR1SYNC             : 1;
2691   unsigned                      : 1;
2692   unsigned                      : 1;
2693   unsigned                      : 1;
2694   } __PSTR1CONbits_t;
2695 
2696 extern __at(0x0296) volatile __PSTR1CONbits_t PSTR1CONbits;
2697 
2698 #define _STR1A                  0x01
2699 #define _STR1B                  0x02
2700 #define _STR1C                  0x04
2701 #define _STR1D                  0x08
2702 #define _STR1SYNC               0x10
2703 
2704 //==============================================================================
2705 
2706 extern __at(0x0298) __sfr CCPR2;
2707 extern __at(0x0298) __sfr CCPR2L;
2708 extern __at(0x0299) __sfr CCPR2H;
2709 
2710 //==============================================================================
2711 //        CCP2CON Bits
2712 
2713 extern __at(0x029A) __sfr CCP2CON;
2714 
2715 typedef union
2716   {
2717   struct
2718     {
2719     unsigned CCP2M0             : 1;
2720     unsigned CCP2M1             : 1;
2721     unsigned CCP2M2             : 1;
2722     unsigned CCP2M3             : 1;
2723     unsigned DC2B0              : 1;
2724     unsigned DC2B1              : 1;
2725     unsigned P2M0               : 1;
2726     unsigned P2M1               : 1;
2727     };
2728 
2729   struct
2730     {
2731     unsigned CCP2M              : 4;
2732     unsigned                    : 4;
2733     };
2734 
2735   struct
2736     {
2737     unsigned                    : 4;
2738     unsigned DC2B               : 2;
2739     unsigned                    : 2;
2740     };
2741 
2742   struct
2743     {
2744     unsigned                    : 6;
2745     unsigned P2M                : 2;
2746     };
2747   } __CCP2CONbits_t;
2748 
2749 extern __at(0x029A) volatile __CCP2CONbits_t CCP2CONbits;
2750 
2751 #define _CCP2M0                 0x01
2752 #define _CCP2M1                 0x02
2753 #define _CCP2M2                 0x04
2754 #define _CCP2M3                 0x08
2755 #define _DC2B0                  0x10
2756 #define _DC2B1                  0x20
2757 #define _P2M0                   0x40
2758 #define _P2M1                   0x80
2759 
2760 //==============================================================================
2761 
2762 
2763 //==============================================================================
2764 //        PWM2CON Bits
2765 
2766 extern __at(0x029B) __sfr PWM2CON;
2767 
2768 typedef union
2769   {
2770   struct
2771     {
2772     unsigned P2DC0              : 1;
2773     unsigned P2DC1              : 1;
2774     unsigned P2DC2              : 1;
2775     unsigned P2DC3              : 1;
2776     unsigned P2DC4              : 1;
2777     unsigned P2DC5              : 1;
2778     unsigned P2DC6              : 1;
2779     unsigned P2RSEN             : 1;
2780     };
2781 
2782   struct
2783     {
2784     unsigned P2DC               : 7;
2785     unsigned                    : 1;
2786     };
2787   } __PWM2CONbits_t;
2788 
2789 extern __at(0x029B) volatile __PWM2CONbits_t PWM2CONbits;
2790 
2791 #define _P2DC0                  0x01
2792 #define _P2DC1                  0x02
2793 #define _P2DC2                  0x04
2794 #define _P2DC3                  0x08
2795 #define _P2DC4                  0x10
2796 #define _P2DC5                  0x20
2797 #define _P2DC6                  0x40
2798 #define _P2RSEN                 0x80
2799 
2800 //==============================================================================
2801 
2802 
2803 //==============================================================================
2804 //        CCP2AS Bits
2805 
2806 extern __at(0x029C) __sfr CCP2AS;
2807 
2808 typedef union
2809   {
2810   struct
2811     {
2812     unsigned PSS2BD0            : 1;
2813     unsigned PSS2BD1            : 1;
2814     unsigned PSS2AC0            : 1;
2815     unsigned PSS2AC1            : 1;
2816     unsigned CCP2AS0            : 1;
2817     unsigned CCP2AS1            : 1;
2818     unsigned CCP2AS2            : 1;
2819     unsigned CCP2ASE            : 1;
2820     };
2821 
2822   struct
2823     {
2824     unsigned PSS2BD             : 2;
2825     unsigned                    : 6;
2826     };
2827 
2828   struct
2829     {
2830     unsigned                    : 2;
2831     unsigned PSS2AC             : 2;
2832     unsigned                    : 4;
2833     };
2834 
2835   struct
2836     {
2837     unsigned                    : 4;
2838     unsigned CCP2AS             : 3;
2839     unsigned                    : 1;
2840     };
2841   } __CCP2ASbits_t;
2842 
2843 extern __at(0x029C) volatile __CCP2ASbits_t CCP2ASbits;
2844 
2845 #define _PSS2BD0                0x01
2846 #define _PSS2BD1                0x02
2847 #define _PSS2AC0                0x04
2848 #define _PSS2AC1                0x08
2849 #define _CCP2AS0                0x10
2850 #define _CCP2AS1                0x20
2851 #define _CCP2AS2                0x40
2852 #define _CCP2ASE                0x80
2853 
2854 //==============================================================================
2855 
2856 
2857 //==============================================================================
2858 //        PSTR2CON Bits
2859 
2860 extern __at(0x029D) __sfr PSTR2CON;
2861 
2862 typedef struct
2863   {
2864   unsigned STR2A                : 1;
2865   unsigned STR2B                : 1;
2866   unsigned STR2C                : 1;
2867   unsigned STR2D                : 1;
2868   unsigned STR2SYNC             : 1;
2869   unsigned                      : 1;
2870   unsigned                      : 1;
2871   unsigned                      : 1;
2872   } __PSTR2CONbits_t;
2873 
2874 extern __at(0x029D) volatile __PSTR2CONbits_t PSTR2CONbits;
2875 
2876 #define _STR2A                  0x01
2877 #define _STR2B                  0x02
2878 #define _STR2C                  0x04
2879 #define _STR2D                  0x08
2880 #define _STR2SYNC               0x10
2881 
2882 //==============================================================================
2883 
2884 
2885 //==============================================================================
2886 //        CCPTMRS Bits
2887 
2888 extern __at(0x029E) __sfr CCPTMRS;
2889 
2890 typedef union
2891   {
2892   struct
2893     {
2894     unsigned C1TSEL0            : 1;
2895     unsigned C1TSEL1            : 1;
2896     unsigned C2TSEL0            : 1;
2897     unsigned C2TSEL1            : 1;
2898     unsigned C3TSEL0            : 1;
2899     unsigned C3TSEL1            : 1;
2900     unsigned C4TSEL0            : 1;
2901     unsigned C4TSEL1            : 1;
2902     };
2903 
2904   struct
2905     {
2906     unsigned C1TSEL             : 2;
2907     unsigned                    : 6;
2908     };
2909 
2910   struct
2911     {
2912     unsigned                    : 2;
2913     unsigned C2TSEL             : 2;
2914     unsigned                    : 4;
2915     };
2916 
2917   struct
2918     {
2919     unsigned                    : 4;
2920     unsigned C3TSEL             : 2;
2921     unsigned                    : 2;
2922     };
2923 
2924   struct
2925     {
2926     unsigned                    : 6;
2927     unsigned C4TSEL             : 2;
2928     };
2929   } __CCPTMRSbits_t;
2930 
2931 extern __at(0x029E) volatile __CCPTMRSbits_t CCPTMRSbits;
2932 
2933 #define _C1TSEL0                0x01
2934 #define _C1TSEL1                0x02
2935 #define _C2TSEL0                0x04
2936 #define _C2TSEL1                0x08
2937 #define _C3TSEL0                0x10
2938 #define _C3TSEL1                0x20
2939 #define _C4TSEL0                0x40
2940 #define _C4TSEL1                0x80
2941 
2942 //==============================================================================
2943 
2944 
2945 //==============================================================================
2946 //        CCPTMRS0 Bits
2947 
2948 extern __at(0x029E) __sfr CCPTMRS0;
2949 
2950 typedef union
2951   {
2952   struct
2953     {
2954     unsigned C1TSEL0            : 1;
2955     unsigned C1TSEL1            : 1;
2956     unsigned C2TSEL0            : 1;
2957     unsigned C2TSEL1            : 1;
2958     unsigned C3TSEL0            : 1;
2959     unsigned C3TSEL1            : 1;
2960     unsigned C4TSEL0            : 1;
2961     unsigned C4TSEL1            : 1;
2962     };
2963 
2964   struct
2965     {
2966     unsigned C1TSEL             : 2;
2967     unsigned                    : 6;
2968     };
2969 
2970   struct
2971     {
2972     unsigned                    : 2;
2973     unsigned C2TSEL             : 2;
2974     unsigned                    : 4;
2975     };
2976 
2977   struct
2978     {
2979     unsigned                    : 4;
2980     unsigned C3TSEL             : 2;
2981     unsigned                    : 2;
2982     };
2983 
2984   struct
2985     {
2986     unsigned                    : 6;
2987     unsigned C4TSEL             : 2;
2988     };
2989   } __CCPTMRS0bits_t;
2990 
2991 extern __at(0x029E) volatile __CCPTMRS0bits_t CCPTMRS0bits;
2992 
2993 #define _CCPTMRS0_C1TSEL0       0x01
2994 #define _CCPTMRS0_C1TSEL1       0x02
2995 #define _CCPTMRS0_C2TSEL0       0x04
2996 #define _CCPTMRS0_C2TSEL1       0x08
2997 #define _CCPTMRS0_C3TSEL0       0x10
2998 #define _CCPTMRS0_C3TSEL1       0x20
2999 #define _CCPTMRS0_C4TSEL0       0x40
3000 #define _CCPTMRS0_C4TSEL1       0x80
3001 
3002 //==============================================================================
3003 
3004 extern __at(0x0311) __sfr CCPR3;
3005 extern __at(0x0311) __sfr CCPR3L;
3006 extern __at(0x0312) __sfr CCPR3H;
3007 
3008 //==============================================================================
3009 //        CCP3CON Bits
3010 
3011 extern __at(0x0313) __sfr CCP3CON;
3012 
3013 typedef union
3014   {
3015   struct
3016     {
3017     unsigned CCP3M0             : 1;
3018     unsigned CCP3M1             : 1;
3019     unsigned CCP3M2             : 1;
3020     unsigned CCP3M3             : 1;
3021     unsigned DC3B0              : 1;
3022     unsigned DC3B1              : 1;
3023     unsigned                    : 1;
3024     unsigned                    : 1;
3025     };
3026 
3027   struct
3028     {
3029     unsigned CCP3M              : 4;
3030     unsigned                    : 4;
3031     };
3032 
3033   struct
3034     {
3035     unsigned                    : 4;
3036     unsigned DC3B               : 2;
3037     unsigned                    : 2;
3038     };
3039   } __CCP3CONbits_t;
3040 
3041 extern __at(0x0313) volatile __CCP3CONbits_t CCP3CONbits;
3042 
3043 #define _CCP3M0                 0x01
3044 #define _CCP3M1                 0x02
3045 #define _CCP3M2                 0x04
3046 #define _CCP3M3                 0x08
3047 #define _DC3B0                  0x10
3048 #define _DC3B1                  0x20
3049 
3050 //==============================================================================
3051 
3052 extern __at(0x0318) __sfr CCPR4;
3053 extern __at(0x0318) __sfr CCPR4L;
3054 extern __at(0x0319) __sfr CCPR4H;
3055 
3056 //==============================================================================
3057 //        CCP4CON Bits
3058 
3059 extern __at(0x031A) __sfr CCP4CON;
3060 
3061 typedef union
3062   {
3063   struct
3064     {
3065     unsigned CCP4M0             : 1;
3066     unsigned CCP4M1             : 1;
3067     unsigned CCP4M2             : 1;
3068     unsigned CCP4M3             : 1;
3069     unsigned DC4B0              : 1;
3070     unsigned DC4B1              : 1;
3071     unsigned                    : 1;
3072     unsigned                    : 1;
3073     };
3074 
3075   struct
3076     {
3077     unsigned CCP4M              : 4;
3078     unsigned                    : 4;
3079     };
3080 
3081   struct
3082     {
3083     unsigned                    : 4;
3084     unsigned DC4B               : 2;
3085     unsigned                    : 2;
3086     };
3087   } __CCP4CONbits_t;
3088 
3089 extern __at(0x031A) volatile __CCP4CONbits_t CCP4CONbits;
3090 
3091 #define _CCP4M0                 0x01
3092 #define _CCP4M1                 0x02
3093 #define _CCP4M2                 0x04
3094 #define _CCP4M3                 0x08
3095 #define _DC4B0                  0x10
3096 #define _DC4B1                  0x20
3097 
3098 //==============================================================================
3099 
3100 
3101 //==============================================================================
3102 //        INLVLA Bits
3103 
3104 extern __at(0x038C) __sfr INLVLA;
3105 
3106 typedef union
3107   {
3108   struct
3109     {
3110     unsigned INLVLA0            : 1;
3111     unsigned INLVLA1            : 1;
3112     unsigned INLVLA2            : 1;
3113     unsigned INLVLA3            : 1;
3114     unsigned INLVLA4            : 1;
3115     unsigned INLVLA5            : 1;
3116     unsigned                    : 1;
3117     unsigned                    : 1;
3118     };
3119 
3120   struct
3121     {
3122     unsigned INLVLA             : 6;
3123     unsigned                    : 2;
3124     };
3125   } __INLVLAbits_t;
3126 
3127 extern __at(0x038C) volatile __INLVLAbits_t INLVLAbits;
3128 
3129 #define _INLVLA0                0x01
3130 #define _INLVLA1                0x02
3131 #define _INLVLA2                0x04
3132 #define _INLVLA3                0x08
3133 #define _INLVLA4                0x10
3134 #define _INLVLA5                0x20
3135 
3136 //==============================================================================
3137 
3138 
3139 //==============================================================================
3140 //        INLVLB Bits
3141 
3142 extern __at(0x038D) __sfr INLVLB;
3143 
3144 typedef struct
3145   {
3146   unsigned                      : 1;
3147   unsigned                      : 1;
3148   unsigned                      : 1;
3149   unsigned                      : 1;
3150   unsigned INLVLB4              : 1;
3151   unsigned INLVLB5              : 1;
3152   unsigned INLVLB6              : 1;
3153   unsigned INLVLB7              : 1;
3154   } __INLVLBbits_t;
3155 
3156 extern __at(0x038D) volatile __INLVLBbits_t INLVLBbits;
3157 
3158 #define _INLVLB4                0x10
3159 #define _INLVLB5                0x20
3160 #define _INLVLB6                0x40
3161 #define _INLVLB7                0x80
3162 
3163 //==============================================================================
3164 
3165 
3166 //==============================================================================
3167 //        INLVLC Bits
3168 
3169 extern __at(0x038E) __sfr INLVLC;
3170 
3171 typedef struct
3172   {
3173   unsigned INLVLC0              : 1;
3174   unsigned INLVLC1              : 1;
3175   unsigned INLVLC2              : 1;
3176   unsigned INLVLC3              : 1;
3177   unsigned INLVLC4              : 1;
3178   unsigned INLVLC5              : 1;
3179   unsigned INLVLC6              : 1;
3180   unsigned INLVLC7              : 1;
3181   } __INLVLCbits_t;
3182 
3183 extern __at(0x038E) volatile __INLVLCbits_t INLVLCbits;
3184 
3185 #define _INLVLC0                0x01
3186 #define _INLVLC1                0x02
3187 #define _INLVLC2                0x04
3188 #define _INLVLC3                0x08
3189 #define _INLVLC4                0x10
3190 #define _INLVLC5                0x20
3191 #define _INLVLC6                0x40
3192 #define _INLVLC7                0x80
3193 
3194 //==============================================================================
3195 
3196 
3197 //==============================================================================
3198 //        IOCAP Bits
3199 
3200 extern __at(0x0391) __sfr IOCAP;
3201 
3202 typedef union
3203   {
3204   struct
3205     {
3206     unsigned IOCAP0             : 1;
3207     unsigned IOCAP1             : 1;
3208     unsigned IOCAP2             : 1;
3209     unsigned IOCAP3             : 1;
3210     unsigned IOCAP4             : 1;
3211     unsigned IOCAP5             : 1;
3212     unsigned                    : 1;
3213     unsigned                    : 1;
3214     };
3215 
3216   struct
3217     {
3218     unsigned IOCAP              : 6;
3219     unsigned                    : 2;
3220     };
3221   } __IOCAPbits_t;
3222 
3223 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits;
3224 
3225 #define _IOCAP0                 0x01
3226 #define _IOCAP1                 0x02
3227 #define _IOCAP2                 0x04
3228 #define _IOCAP3                 0x08
3229 #define _IOCAP4                 0x10
3230 #define _IOCAP5                 0x20
3231 
3232 //==============================================================================
3233 
3234 
3235 //==============================================================================
3236 //        IOCAN Bits
3237 
3238 extern __at(0x0392) __sfr IOCAN;
3239 
3240 typedef union
3241   {
3242   struct
3243     {
3244     unsigned IOCAN0             : 1;
3245     unsigned IOCAN1             : 1;
3246     unsigned IOCAN2             : 1;
3247     unsigned IOCAN3             : 1;
3248     unsigned IOCAN4             : 1;
3249     unsigned IOCAN5             : 1;
3250     unsigned                    : 1;
3251     unsigned                    : 1;
3252     };
3253 
3254   struct
3255     {
3256     unsigned IOCAN              : 6;
3257     unsigned                    : 2;
3258     };
3259   } __IOCANbits_t;
3260 
3261 extern __at(0x0392) volatile __IOCANbits_t IOCANbits;
3262 
3263 #define _IOCAN0                 0x01
3264 #define _IOCAN1                 0x02
3265 #define _IOCAN2                 0x04
3266 #define _IOCAN3                 0x08
3267 #define _IOCAN4                 0x10
3268 #define _IOCAN5                 0x20
3269 
3270 //==============================================================================
3271 
3272 
3273 //==============================================================================
3274 //        IOCAF Bits
3275 
3276 extern __at(0x0393) __sfr IOCAF;
3277 
3278 typedef union
3279   {
3280   struct
3281     {
3282     unsigned IOCAF0             : 1;
3283     unsigned IOCAF1             : 1;
3284     unsigned IOCAF2             : 1;
3285     unsigned IOCAF3             : 1;
3286     unsigned IOCAF4             : 1;
3287     unsigned IOCAF5             : 1;
3288     unsigned                    : 1;
3289     unsigned                    : 1;
3290     };
3291 
3292   struct
3293     {
3294     unsigned IOCAF              : 6;
3295     unsigned                    : 2;
3296     };
3297   } __IOCAFbits_t;
3298 
3299 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits;
3300 
3301 #define _IOCAF0                 0x01
3302 #define _IOCAF1                 0x02
3303 #define _IOCAF2                 0x04
3304 #define _IOCAF3                 0x08
3305 #define _IOCAF4                 0x10
3306 #define _IOCAF5                 0x20
3307 
3308 //==============================================================================
3309 
3310 
3311 //==============================================================================
3312 //        IOCBP Bits
3313 
3314 extern __at(0x0394) __sfr IOCBP;
3315 
3316 typedef struct
3317   {
3318   unsigned                      : 1;
3319   unsigned                      : 1;
3320   unsigned                      : 1;
3321   unsigned                      : 1;
3322   unsigned IOCBP4               : 1;
3323   unsigned IOCBP5               : 1;
3324   unsigned IOCBP6               : 1;
3325   unsigned IOCBP7               : 1;
3326   } __IOCBPbits_t;
3327 
3328 extern __at(0x0394) volatile __IOCBPbits_t IOCBPbits;
3329 
3330 #define _IOCBP4                 0x10
3331 #define _IOCBP5                 0x20
3332 #define _IOCBP6                 0x40
3333 #define _IOCBP7                 0x80
3334 
3335 //==============================================================================
3336 
3337 
3338 //==============================================================================
3339 //        IOCBN Bits
3340 
3341 extern __at(0x0395) __sfr IOCBN;
3342 
3343 typedef struct
3344   {
3345   unsigned                      : 1;
3346   unsigned                      : 1;
3347   unsigned                      : 1;
3348   unsigned                      : 1;
3349   unsigned IOCBN4               : 1;
3350   unsigned IOCBN5               : 1;
3351   unsigned IOCBN6               : 1;
3352   unsigned IOCBN7               : 1;
3353   } __IOCBNbits_t;
3354 
3355 extern __at(0x0395) volatile __IOCBNbits_t IOCBNbits;
3356 
3357 #define _IOCBN4                 0x10
3358 #define _IOCBN5                 0x20
3359 #define _IOCBN6                 0x40
3360 #define _IOCBN7                 0x80
3361 
3362 //==============================================================================
3363 
3364 
3365 //==============================================================================
3366 //        IOCBF Bits
3367 
3368 extern __at(0x0396) __sfr IOCBF;
3369 
3370 typedef struct
3371   {
3372   unsigned                      : 1;
3373   unsigned                      : 1;
3374   unsigned                      : 1;
3375   unsigned                      : 1;
3376   unsigned IOCBF4               : 1;
3377   unsigned IOCBF5               : 1;
3378   unsigned IOCBF6               : 1;
3379   unsigned IOCBF7               : 1;
3380   } __IOCBFbits_t;
3381 
3382 extern __at(0x0396) volatile __IOCBFbits_t IOCBFbits;
3383 
3384 #define _IOCBF4                 0x10
3385 #define _IOCBF5                 0x20
3386 #define _IOCBF6                 0x40
3387 #define _IOCBF7                 0x80
3388 
3389 //==============================================================================
3390 
3391 
3392 //==============================================================================
3393 //        CLKRCON Bits
3394 
3395 extern __at(0x039A) __sfr CLKRCON;
3396 
3397 typedef union
3398   {
3399   struct
3400     {
3401     unsigned CLKRDIV0           : 1;
3402     unsigned CLKRDIV1           : 1;
3403     unsigned CLKRDIV2           : 1;
3404     unsigned CLKRDC0            : 1;
3405     unsigned CLKRDC1            : 1;
3406     unsigned CLKRSLR            : 1;
3407     unsigned CLKROE             : 1;
3408     unsigned CLKREN             : 1;
3409     };
3410 
3411   struct
3412     {
3413     unsigned CLKRDIV            : 3;
3414     unsigned                    : 5;
3415     };
3416 
3417   struct
3418     {
3419     unsigned                    : 3;
3420     unsigned CLKRDC             : 2;
3421     unsigned                    : 3;
3422     };
3423   } __CLKRCONbits_t;
3424 
3425 extern __at(0x039A) volatile __CLKRCONbits_t CLKRCONbits;
3426 
3427 #define _CLKRDIV0               0x01
3428 #define _CLKRDIV1               0x02
3429 #define _CLKRDIV2               0x04
3430 #define _CLKRDC0                0x08
3431 #define _CLKRDC1                0x10
3432 #define _CLKRSLR                0x20
3433 #define _CLKROE                 0x40
3434 #define _CLKREN                 0x80
3435 
3436 //==============================================================================
3437 
3438 
3439 //==============================================================================
3440 //        MDCON Bits
3441 
3442 extern __at(0x039C) __sfr MDCON;
3443 
3444 typedef struct
3445   {
3446   unsigned MDBIT                : 1;
3447   unsigned                      : 1;
3448   unsigned                      : 1;
3449   unsigned MDOUT                : 1;
3450   unsigned MDOPOL               : 1;
3451   unsigned MDSLR                : 1;
3452   unsigned MDOE                 : 1;
3453   unsigned MDEN                 : 1;
3454   } __MDCONbits_t;
3455 
3456 extern __at(0x039C) volatile __MDCONbits_t MDCONbits;
3457 
3458 #define _MDBIT                  0x01
3459 #define _MDOUT                  0x08
3460 #define _MDOPOL                 0x10
3461 #define _MDSLR                  0x20
3462 #define _MDOE                   0x40
3463 #define _MDEN                   0x80
3464 
3465 //==============================================================================
3466 
3467 
3468 //==============================================================================
3469 //        MDSRC Bits
3470 
3471 extern __at(0x039D) __sfr MDSRC;
3472 
3473 typedef union
3474   {
3475   struct
3476     {
3477     unsigned MDMS0              : 1;
3478     unsigned MDMS1              : 1;
3479     unsigned MDMS2              : 1;
3480     unsigned MDMS3              : 1;
3481     unsigned                    : 1;
3482     unsigned                    : 1;
3483     unsigned                    : 1;
3484     unsigned MDMSODIS           : 1;
3485     };
3486 
3487   struct
3488     {
3489     unsigned MDMS               : 4;
3490     unsigned                    : 4;
3491     };
3492   } __MDSRCbits_t;
3493 
3494 extern __at(0x039D) volatile __MDSRCbits_t MDSRCbits;
3495 
3496 #define _MDMS0                  0x01
3497 #define _MDMS1                  0x02
3498 #define _MDMS2                  0x04
3499 #define _MDMS3                  0x08
3500 #define _MDMSODIS               0x80
3501 
3502 //==============================================================================
3503 
3504 
3505 //==============================================================================
3506 //        MDCARL Bits
3507 
3508 extern __at(0x039E) __sfr MDCARL;
3509 
3510 typedef union
3511   {
3512   struct
3513     {
3514     unsigned MDCL0              : 1;
3515     unsigned MDCL1              : 1;
3516     unsigned MDCL2              : 1;
3517     unsigned MDCL3              : 1;
3518     unsigned                    : 1;
3519     unsigned MDCLSYNC           : 1;
3520     unsigned MDCLPOL            : 1;
3521     unsigned MDCLODIS           : 1;
3522     };
3523 
3524   struct
3525     {
3526     unsigned MDCL               : 4;
3527     unsigned                    : 4;
3528     };
3529   } __MDCARLbits_t;
3530 
3531 extern __at(0x039E) volatile __MDCARLbits_t MDCARLbits;
3532 
3533 #define _MDCL0                  0x01
3534 #define _MDCL1                  0x02
3535 #define _MDCL2                  0x04
3536 #define _MDCL3                  0x08
3537 #define _MDCLSYNC               0x20
3538 #define _MDCLPOL                0x40
3539 #define _MDCLODIS               0x80
3540 
3541 //==============================================================================
3542 
3543 
3544 //==============================================================================
3545 //        MDCARH Bits
3546 
3547 extern __at(0x039F) __sfr MDCARH;
3548 
3549 typedef union
3550   {
3551   struct
3552     {
3553     unsigned MDCH0              : 1;
3554     unsigned MDCH1              : 1;
3555     unsigned MDCH2              : 1;
3556     unsigned MDCH3              : 1;
3557     unsigned                    : 1;
3558     unsigned MDCHSYNC           : 1;
3559     unsigned MDCHPOL            : 1;
3560     unsigned MDCHODIS           : 1;
3561     };
3562 
3563   struct
3564     {
3565     unsigned MDCH               : 4;
3566     unsigned                    : 4;
3567     };
3568   } __MDCARHbits_t;
3569 
3570 extern __at(0x039F) volatile __MDCARHbits_t MDCARHbits;
3571 
3572 #define _MDCH0                  0x01
3573 #define _MDCH1                  0x02
3574 #define _MDCH2                  0x04
3575 #define _MDCH3                  0x08
3576 #define _MDCHSYNC               0x20
3577 #define _MDCHPOL                0x40
3578 #define _MDCHODIS               0x80
3579 
3580 //==============================================================================
3581 
3582 extern __at(0x0415) __sfr TMR4;
3583 extern __at(0x0416) __sfr PR4;
3584 
3585 //==============================================================================
3586 //        T4CON Bits
3587 
3588 extern __at(0x0417) __sfr T4CON;
3589 
3590 typedef union
3591   {
3592   struct
3593     {
3594     unsigned T4CKPS0            : 1;
3595     unsigned T4CKPS1            : 1;
3596     unsigned TMR4ON             : 1;
3597     unsigned T4OUTPS0           : 1;
3598     unsigned T4OUTPS1           : 1;
3599     unsigned T4OUTPS2           : 1;
3600     unsigned T4OUTPS3           : 1;
3601     unsigned                    : 1;
3602     };
3603 
3604   struct
3605     {
3606     unsigned T4CKPS             : 2;
3607     unsigned                    : 6;
3608     };
3609 
3610   struct
3611     {
3612     unsigned                    : 3;
3613     unsigned T4OUTPS            : 4;
3614     unsigned                    : 1;
3615     };
3616   } __T4CONbits_t;
3617 
3618 extern __at(0x0417) volatile __T4CONbits_t T4CONbits;
3619 
3620 #define _T4CKPS0                0x01
3621 #define _T4CKPS1                0x02
3622 #define _TMR4ON                 0x04
3623 #define _T4OUTPS0               0x08
3624 #define _T4OUTPS1               0x10
3625 #define _T4OUTPS2               0x20
3626 #define _T4OUTPS3               0x40
3627 
3628 //==============================================================================
3629 
3630 extern __at(0x041C) __sfr TMR6;
3631 extern __at(0x041D) __sfr PR6;
3632 
3633 //==============================================================================
3634 //        T6CON Bits
3635 
3636 extern __at(0x041E) __sfr T6CON;
3637 
3638 typedef union
3639   {
3640   struct
3641     {
3642     unsigned T6CKPS0            : 1;
3643     unsigned T6CKPS1            : 1;
3644     unsigned TMR6ON             : 1;
3645     unsigned T6OUTPS0           : 1;
3646     unsigned T6OUTPS1           : 1;
3647     unsigned T6OUTPS2           : 1;
3648     unsigned T6OUTPS3           : 1;
3649     unsigned                    : 1;
3650     };
3651 
3652   struct
3653     {
3654     unsigned T6CKPS             : 2;
3655     unsigned                    : 6;
3656     };
3657 
3658   struct
3659     {
3660     unsigned                    : 3;
3661     unsigned T6OUTPS            : 4;
3662     unsigned                    : 1;
3663     };
3664   } __T6CONbits_t;
3665 
3666 extern __at(0x041E) volatile __T6CONbits_t T6CONbits;
3667 
3668 #define _T6CKPS0                0x01
3669 #define _T6CKPS1                0x02
3670 #define _TMR6ON                 0x04
3671 #define _T6OUTPS0               0x08
3672 #define _T6OUTPS1               0x10
3673 #define _T6OUTPS2               0x20
3674 #define _T6OUTPS3               0x40
3675 
3676 //==============================================================================
3677 
3678 
3679 //==============================================================================
3680 //        STATUS_SHAD Bits
3681 
3682 extern __at(0x0FE4) __sfr STATUS_SHAD;
3683 
3684 typedef struct
3685   {
3686   unsigned C_SHAD               : 1;
3687   unsigned DC_SHAD              : 1;
3688   unsigned Z_SHAD               : 1;
3689   unsigned                      : 1;
3690   unsigned                      : 1;
3691   unsigned                      : 1;
3692   unsigned                      : 1;
3693   unsigned                      : 1;
3694   } __STATUS_SHADbits_t;
3695 
3696 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
3697 
3698 #define _C_SHAD                 0x01
3699 #define _DC_SHAD                0x02
3700 #define _Z_SHAD                 0x04
3701 
3702 //==============================================================================
3703 
3704 extern __at(0x0FE5) __sfr WREG_SHAD;
3705 extern __at(0x0FE6) __sfr BSR_SHAD;
3706 extern __at(0x0FE7) __sfr PCLATH_SHAD;
3707 extern __at(0x0FE8) __sfr FSR0L_SHAD;
3708 extern __at(0x0FE9) __sfr FSR0H_SHAD;
3709 extern __at(0x0FEA) __sfr FSR1L_SHAD;
3710 extern __at(0x0FEB) __sfr FSR1H_SHAD;
3711 extern __at(0x0FED) __sfr STKPTR;
3712 extern __at(0x0FEE) __sfr TOSL;
3713 extern __at(0x0FEF) __sfr TOSH;
3714 
3715 //==============================================================================
3716 //
3717 //        Configuration Bits
3718 //
3719 //==============================================================================
3720 
3721 #define _CONFIG1                0x8007
3722 #define _CONFIG2                0x8008
3723 
3724 //----------------------------- CONFIG1 Options -------------------------------
3725 
3726 #define _FOSC_LP                0x3FF8  // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins.
3727 #define _FOSC_XT                0x3FF9  // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins.
3728 #define _FOSC_HS                0x3FFA  // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins.
3729 #define _FOSC_EXTRC             0x3FFB  // EXTRC oscillator: External RC circuit connected to CLKIN pin.
3730 #define _FOSC_INTOSC            0x3FFC  // INTOSC oscillator: I/O function on CLKIN pin.
3731 #define _FOSC_ECL               0x3FFD  // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin.
3732 #define _FOSC_ECM               0x3FFE  // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin.
3733 #define _FOSC_ECH               0x3FFF  // ECH, External Clock, High Power Mode (4-32 MHz): device clock supplied to CLKIN pin.
3734 #define _WDTE_OFF               0x3FE7  // WDT disabled.
3735 #define _WDTE_SWDTEN            0x3FEF  // WDT controlled by the SWDTEN bit in the WDTCON register.
3736 #define _WDTE_NSLEEP            0x3FF7  // WDT enabled while running and disabled in Sleep.
3737 #define _WDTE_ON                0x3FFF  // WDT enabled.
3738 #define _PWRTE_ON               0x3FDF  // PWRT enabled.
3739 #define _PWRTE_OFF              0x3FFF  // PWRT disabled.
3740 #define _MCLRE_OFF              0x3FBF  // MCLR/VPP pin function is digital input.
3741 #define _MCLRE_ON               0x3FFF  // MCLR/VPP pin function is MCLR.
3742 #define _CP_ON                  0x3F7F  // Program memory code protection is enabled.
3743 #define _CP_OFF                 0x3FFF  // Program memory code protection is disabled.
3744 #define _CPD_ON                 0x3EFF  // Data memory code protection is enabled.
3745 #define _CPD_OFF                0x3FFF  // Data memory code protection is disabled.
3746 #define _BOREN_OFF              0x39FF  // Brown-out Reset disabled.
3747 #define _BOREN_SBODEN           0x3BFF  // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
3748 #define _BOREN_NSLEEP           0x3DFF  // Brown-out Reset enabled while running and disabled in Sleep.
3749 #define _BOREN_ON               0x3FFF  // Brown-out Reset enabled.
3750 #define _CLKOUTEN_ON            0x37FF  // CLKOUT function is enabled on the CLKOUT pin.
3751 #define _CLKOUTEN_OFF           0x3FFF  // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
3752 #define _IESO_OFF               0x2FFF  // Internal/External Switchover mode is disabled.
3753 #define _IESO_ON                0x3FFF  // Internal/External Switchover mode is enabled.
3754 #define _FCMEN_OFF              0x1FFF  // Fail-Safe Clock Monitor is disabled.
3755 #define _FCMEN_ON               0x3FFF  // Fail-Safe Clock Monitor is enabled.
3756 
3757 //----------------------------- CONFIG2 Options -------------------------------
3758 
3759 #define _WRT_ALL                0x3FFC  // 000h to FFFh write protected, no addresses may be modified by EECON control.
3760 #define _WRT_HALF               0x3FFD  // 000h to 7FFh write protected, 800h to FFFh may be modified by EECON control.
3761 #define _WRT_BOOT               0x3FFE  // 000h to 1FFh write protected, 200h to FFFh may be modified by EECON control.
3762 #define _WRT_OFF                0x3FFF  // Write protection off.
3763 #define _PLLEN_OFF              0x3EFF  // 4x PLL disabled.
3764 #define _PLLEN_ON               0x3FFF  // 4x PLL enabled.
3765 #define _STVREN_OFF             0x3DFF  // Stack Overflow or Underflow will not cause a Reset.
3766 #define _STVREN_ON              0x3FFF  // Stack Overflow or Underflow will cause a Reset.
3767 #define _BORV_HI                0x3BFF  // Brown-out Reset Voltage (Vbor), high trip point selected.
3768 #define _BORV_LO                0x3FFF  // Brown-out Reset Voltage (Vbor), low trip point selected.
3769 #define _BORV_19                0x3FFF  // Brown-out Reset Voltage (Vbor), low trip point selected.
3770 #define _DEBUG_ON               0x2FFF  // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
3771 #define _DEBUG_OFF              0x3FFF  // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
3772 #define _LVP_OFF                0x1FFF  // High-voltage on MCLR/VPP must be used for programming.
3773 #define _LVP_ON                 0x3FFF  // Low-voltage programming enabled.
3774 
3775 //==============================================================================
3776 
3777 #define _DEVID1                 0x8006
3778 
3779 #define _IDLOC0                 0x8000
3780 #define _IDLOC1                 0x8001
3781 #define _IDLOC2                 0x8002
3782 #define _IDLOC3                 0x8003
3783 
3784 //==============================================================================
3785 
3786 #ifndef NO_BIT_DEFINES
3787 
3788 #define ADON                    ADCON0bits.ADON                 // bit 0
3789 #define GO_NOT_DONE             ADCON0bits.GO_NOT_DONE          // bit 1, shadows bit in ADCON0bits
3790 #define ADGO                    ADCON0bits.ADGO                 // bit 1, shadows bit in ADCON0bits
3791 #define GO                      ADCON0bits.GO                   // bit 1, shadows bit in ADCON0bits
3792 #define CHS0                    ADCON0bits.CHS0                 // bit 2
3793 #define CHS1                    ADCON0bits.CHS1                 // bit 3
3794 #define CHS2                    ADCON0bits.CHS2                 // bit 4
3795 #define CHS3                    ADCON0bits.CHS3                 // bit 5
3796 #define CHS4                    ADCON0bits.CHS4                 // bit 6
3797 
3798 #define ADPREF0                 ADCON1bits.ADPREF0              // bit 0
3799 #define ADPREF1                 ADCON1bits.ADPREF1              // bit 1
3800 #define ADNREF                  ADCON1bits.ADNREF               // bit 2
3801 #define ADCS0                   ADCON1bits.ADCS0                // bit 4
3802 #define ADCS1                   ADCON1bits.ADCS1                // bit 5
3803 #define ADCS2                   ADCON1bits.ADCS2                // bit 6
3804 #define ADFM                    ADCON1bits.ADFM                 // bit 7
3805 
3806 #define ANSA0                   ANSELAbits.ANSA0                // bit 0
3807 #define ANSA1                   ANSELAbits.ANSA1                // bit 1
3808 #define ANSA2                   ANSELAbits.ANSA2                // bit 2
3809 #define ANSA4                   ANSELAbits.ANSA4                // bit 4
3810 
3811 #define ANSB4                   ANSELBbits.ANSB4                // bit 4
3812 #define ANSB5                   ANSELBbits.ANSB5                // bit 5
3813 
3814 #define ANSC0                   ANSELCbits.ANSC0                // bit 0
3815 #define ANSC1                   ANSELCbits.ANSC1                // bit 1
3816 #define ANSC2                   ANSELCbits.ANSC2                // bit 2
3817 #define ANSC3                   ANSELCbits.ANSC3                // bit 3
3818 #define ANSC6                   ANSELCbits.ANSC6                // bit 6
3819 #define ANSC7                   ANSELCbits.ANSC7                // bit 7
3820 
3821 #define TXCKSEL                 APFCON0bits.TXCKSEL             // bit 2
3822 #define T1GSEL                  APFCON0bits.T1GSEL              // bit 3
3823 #define RXDTSEL                 APFCON0bits.RXDTSEL             // bit 7
3824 
3825 #define CCP2SEL                 APFCON1bits.CCP2SEL             // bit 0
3826 #define P2BSEL                  APFCON1bits.P2BSEL              // bit 1
3827 #define P1CSEL                  APFCON1bits.P1CSEL              // bit 2
3828 #define P1DSEL                  APFCON1bits.P1DSEL              // bit 3
3829 
3830 #define ABDEN                   BAUDCONbits.ABDEN               // bit 0
3831 #define WUE                     BAUDCONbits.WUE                 // bit 1
3832 #define BRG16                   BAUDCONbits.BRG16               // bit 3
3833 #define SCKP                    BAUDCONbits.SCKP                // bit 4
3834 #define RCIDL                   BAUDCONbits.RCIDL               // bit 6
3835 #define ABDOVF                  BAUDCONbits.ABDOVF              // bit 7
3836 
3837 #define BORRDY                  BORCONbits.BORRDY               // bit 0
3838 #define SBOREN                  BORCONbits.SBOREN               // bit 7
3839 
3840 #define BSR0                    BSRbits.BSR0                    // bit 0
3841 #define BSR1                    BSRbits.BSR1                    // bit 1
3842 #define BSR2                    BSRbits.BSR2                    // bit 2
3843 #define BSR3                    BSRbits.BSR3                    // bit 3
3844 #define BSR4                    BSRbits.BSR4                    // bit 4
3845 
3846 #define PSS1BD0                 CCP1ASbits.PSS1BD0              // bit 0
3847 #define PSS1BD1                 CCP1ASbits.PSS1BD1              // bit 1
3848 #define PSS1AC0                 CCP1ASbits.PSS1AC0              // bit 2
3849 #define PSS1AC1                 CCP1ASbits.PSS1AC1              // bit 3
3850 #define CCP1AS0                 CCP1ASbits.CCP1AS0              // bit 4
3851 #define CCP1AS1                 CCP1ASbits.CCP1AS1              // bit 5
3852 #define CCP1AS2                 CCP1ASbits.CCP1AS2              // bit 6
3853 #define CCP1ASE                 CCP1ASbits.CCP1ASE              // bit 7
3854 
3855 #define CCP1M0                  CCP1CONbits.CCP1M0              // bit 0
3856 #define CCP1M1                  CCP1CONbits.CCP1M1              // bit 1
3857 #define CCP1M2                  CCP1CONbits.CCP1M2              // bit 2
3858 #define CCP1M3                  CCP1CONbits.CCP1M3              // bit 3
3859 #define DC1B0                   CCP1CONbits.DC1B0               // bit 4
3860 #define DC1B1                   CCP1CONbits.DC1B1               // bit 5
3861 #define P1M0                    CCP1CONbits.P1M0                // bit 6
3862 #define P1M1                    CCP1CONbits.P1M1                // bit 7
3863 
3864 #define PSS2BD0                 CCP2ASbits.PSS2BD0              // bit 0
3865 #define PSS2BD1                 CCP2ASbits.PSS2BD1              // bit 1
3866 #define PSS2AC0                 CCP2ASbits.PSS2AC0              // bit 2
3867 #define PSS2AC1                 CCP2ASbits.PSS2AC1              // bit 3
3868 #define CCP2AS0                 CCP2ASbits.CCP2AS0              // bit 4
3869 #define CCP2AS1                 CCP2ASbits.CCP2AS1              // bit 5
3870 #define CCP2AS2                 CCP2ASbits.CCP2AS2              // bit 6
3871 #define CCP2ASE                 CCP2ASbits.CCP2ASE              // bit 7
3872 
3873 #define CCP2M0                  CCP2CONbits.CCP2M0              // bit 0
3874 #define CCP2M1                  CCP2CONbits.CCP2M1              // bit 1
3875 #define CCP2M2                  CCP2CONbits.CCP2M2              // bit 2
3876 #define CCP2M3                  CCP2CONbits.CCP2M3              // bit 3
3877 #define DC2B0                   CCP2CONbits.DC2B0               // bit 4
3878 #define DC2B1                   CCP2CONbits.DC2B1               // bit 5
3879 #define P2M0                    CCP2CONbits.P2M0                // bit 6
3880 #define P2M1                    CCP2CONbits.P2M1                // bit 7
3881 
3882 #define CCP3M0                  CCP3CONbits.CCP3M0              // bit 0
3883 #define CCP3M1                  CCP3CONbits.CCP3M1              // bit 1
3884 #define CCP3M2                  CCP3CONbits.CCP3M2              // bit 2
3885 #define CCP3M3                  CCP3CONbits.CCP3M3              // bit 3
3886 #define DC3B0                   CCP3CONbits.DC3B0               // bit 4
3887 #define DC3B1                   CCP3CONbits.DC3B1               // bit 5
3888 
3889 #define CCP4M0                  CCP4CONbits.CCP4M0              // bit 0
3890 #define CCP4M1                  CCP4CONbits.CCP4M1              // bit 1
3891 #define CCP4M2                  CCP4CONbits.CCP4M2              // bit 2
3892 #define CCP4M3                  CCP4CONbits.CCP4M3              // bit 3
3893 #define DC4B0                   CCP4CONbits.DC4B0               // bit 4
3894 #define DC4B1                   CCP4CONbits.DC4B1               // bit 5
3895 
3896 #define C1TSEL0                 CCPTMRSbits.C1TSEL0             // bit 0
3897 #define C1TSEL1                 CCPTMRSbits.C1TSEL1             // bit 1
3898 #define C2TSEL0                 CCPTMRSbits.C2TSEL0             // bit 2
3899 #define C2TSEL1                 CCPTMRSbits.C2TSEL1             // bit 3
3900 #define C3TSEL0                 CCPTMRSbits.C3TSEL0             // bit 4
3901 #define C3TSEL1                 CCPTMRSbits.C3TSEL1             // bit 5
3902 #define C4TSEL0                 CCPTMRSbits.C4TSEL0             // bit 6
3903 #define C4TSEL1                 CCPTMRSbits.C4TSEL1             // bit 7
3904 
3905 #define CLKRDIV0                CLKRCONbits.CLKRDIV0            // bit 0
3906 #define CLKRDIV1                CLKRCONbits.CLKRDIV1            // bit 1
3907 #define CLKRDIV2                CLKRCONbits.CLKRDIV2            // bit 2
3908 #define CLKRDC0                 CLKRCONbits.CLKRDC0             // bit 3
3909 #define CLKRDC1                 CLKRCONbits.CLKRDC1             // bit 4
3910 #define CLKRSLR                 CLKRCONbits.CLKRSLR             // bit 5
3911 #define CLKROE                  CLKRCONbits.CLKROE              // bit 6
3912 #define CLKREN                  CLKRCONbits.CLKREN              // bit 7
3913 
3914 #define C1SYNC                  CM1CON0bits.C1SYNC              // bit 0
3915 #define C1HYS                   CM1CON0bits.C1HYS               // bit 1
3916 #define C1SP                    CM1CON0bits.C1SP                // bit 2
3917 #define C1POL                   CM1CON0bits.C1POL               // bit 4
3918 #define C1OE                    CM1CON0bits.C1OE                // bit 5
3919 #define C1OUT                   CM1CON0bits.C1OUT               // bit 6
3920 #define C1ON                    CM1CON0bits.C1ON                // bit 7
3921 
3922 #define C1NCH0                  CM1CON1bits.C1NCH0              // bit 0
3923 #define C1NCH1                  CM1CON1bits.C1NCH1              // bit 1
3924 #define C1PCH0                  CM1CON1bits.C1PCH0              // bit 4
3925 #define C1PCH1                  CM1CON1bits.C1PCH1              // bit 5
3926 #define C1INTN                  CM1CON1bits.C1INTN              // bit 6
3927 #define C1INTP                  CM1CON1bits.C1INTP              // bit 7
3928 
3929 #define C2SYNC                  CM2CON0bits.C2SYNC              // bit 0
3930 #define C2HYS                   CM2CON0bits.C2HYS               // bit 1
3931 #define C2SP                    CM2CON0bits.C2SP                // bit 2
3932 #define C2POL                   CM2CON0bits.C2POL               // bit 4
3933 #define C2OE                    CM2CON0bits.C2OE                // bit 5
3934 #define C2OUT                   CM2CON0bits.C2OUT               // bit 6
3935 #define C2ON                    CM2CON0bits.C2ON                // bit 7
3936 
3937 #define C2NCH0                  CM2CON1bits.C2NCH0              // bit 0
3938 #define C2NCH1                  CM2CON1bits.C2NCH1              // bit 1
3939 #define C2PCH0                  CM2CON1bits.C2PCH0              // bit 4
3940 #define C2PCH1                  CM2CON1bits.C2PCH1              // bit 5
3941 #define C2INTN                  CM2CON1bits.C2INTN              // bit 6
3942 #define C2INTP                  CM2CON1bits.C2INTP              // bit 7
3943 
3944 #define MC1OUT                  CMOUTbits.MC1OUT                // bit 0
3945 #define MC2OUT                  CMOUTbits.MC2OUT                // bit 1
3946 
3947 #define T0XCS                   CPSCON0bits.T0XCS               // bit 0
3948 #define CPSOUT                  CPSCON0bits.CPSOUT              // bit 1
3949 #define CPSRNG0                 CPSCON0bits.CPSRNG0             // bit 2
3950 #define CPSRNG1                 CPSCON0bits.CPSRNG1             // bit 3
3951 #define CPSRM                   CPSCON0bits.CPSRM               // bit 6
3952 #define CPSON                   CPSCON0bits.CPSON               // bit 7
3953 
3954 #define CPSCH0                  CPSCON1bits.CPSCH0              // bit 0
3955 #define CPSCH1                  CPSCON1bits.CPSCH1              // bit 1
3956 #define CPSCH2                  CPSCON1bits.CPSCH2              // bit 2
3957 #define CPSCH3                  CPSCON1bits.CPSCH3              // bit 3
3958 
3959 #define DACNSS                  DACCON0bits.DACNSS              // bit 0
3960 #define DACPSS0                 DACCON0bits.DACPSS0             // bit 2
3961 #define DACPSS1                 DACCON0bits.DACPSS1             // bit 3
3962 #define DACOE                   DACCON0bits.DACOE               // bit 5
3963 #define DACLPS                  DACCON0bits.DACLPS              // bit 6
3964 #define DACEN                   DACCON0bits.DACEN               // bit 7
3965 
3966 #define DACR0                   DACCON1bits.DACR0               // bit 0
3967 #define DACR1                   DACCON1bits.DACR1               // bit 1
3968 #define DACR2                   DACCON1bits.DACR2               // bit 2
3969 #define DACR3                   DACCON1bits.DACR3               // bit 3
3970 #define DACR4                   DACCON1bits.DACR4               // bit 4
3971 
3972 #define RD                      EECON1bits.RD                   // bit 0
3973 #define WR                      EECON1bits.WR                   // bit 1
3974 #define WREN                    EECON1bits.WREN                 // bit 2
3975 #define WRERR                   EECON1bits.WRERR                // bit 3
3976 #define FREE                    EECON1bits.FREE                 // bit 4
3977 #define LWLO                    EECON1bits.LWLO                 // bit 5
3978 #define CFGS                    EECON1bits.CFGS                 // bit 6
3979 #define EEPGD                   EECON1bits.EEPGD                // bit 7
3980 
3981 #define ADFVR0                  FVRCONbits.ADFVR0               // bit 0
3982 #define ADFVR1                  FVRCONbits.ADFVR1               // bit 1
3983 #define CDAFVR0                 FVRCONbits.CDAFVR0              // bit 2
3984 #define CDAFVR1                 FVRCONbits.CDAFVR1              // bit 3
3985 #define TSRNG                   FVRCONbits.TSRNG                // bit 4
3986 #define TSEN                    FVRCONbits.TSEN                 // bit 5
3987 #define FVRRDY                  FVRCONbits.FVRRDY               // bit 6
3988 #define FVREN                   FVRCONbits.FVREN                // bit 7
3989 
3990 #define INLVLA0                 INLVLAbits.INLVLA0              // bit 0
3991 #define INLVLA1                 INLVLAbits.INLVLA1              // bit 1
3992 #define INLVLA2                 INLVLAbits.INLVLA2              // bit 2
3993 #define INLVLA3                 INLVLAbits.INLVLA3              // bit 3
3994 #define INLVLA4                 INLVLAbits.INLVLA4              // bit 4
3995 #define INLVLA5                 INLVLAbits.INLVLA5              // bit 5
3996 
3997 #define INLVLB4                 INLVLBbits.INLVLB4              // bit 4
3998 #define INLVLB5                 INLVLBbits.INLVLB5              // bit 5
3999 #define INLVLB6                 INLVLBbits.INLVLB6              // bit 6
4000 #define INLVLB7                 INLVLBbits.INLVLB7              // bit 7
4001 
4002 #define INLVLC0                 INLVLCbits.INLVLC0              // bit 0
4003 #define INLVLC1                 INLVLCbits.INLVLC1              // bit 1
4004 #define INLVLC2                 INLVLCbits.INLVLC2              // bit 2
4005 #define INLVLC3                 INLVLCbits.INLVLC3              // bit 3
4006 #define INLVLC4                 INLVLCbits.INLVLC4              // bit 4
4007 #define INLVLC5                 INLVLCbits.INLVLC5              // bit 5
4008 #define INLVLC6                 INLVLCbits.INLVLC6              // bit 6
4009 #define INLVLC7                 INLVLCbits.INLVLC7              // bit 7
4010 
4011 #define IOCIF                   INTCONbits.IOCIF                // bit 0
4012 #define INTF                    INTCONbits.INTF                 // bit 1
4013 #define TMR0IF                  INTCONbits.TMR0IF               // bit 2, shadows bit in INTCONbits
4014 #define T0IF                    INTCONbits.T0IF                 // bit 2, shadows bit in INTCONbits
4015 #define IOCIE                   INTCONbits.IOCIE                // bit 3
4016 #define INTE                    INTCONbits.INTE                 // bit 4
4017 #define TMR0IE                  INTCONbits.TMR0IE               // bit 5, shadows bit in INTCONbits
4018 #define T0IE                    INTCONbits.T0IE                 // bit 5, shadows bit in INTCONbits
4019 #define PEIE                    INTCONbits.PEIE                 // bit 6
4020 #define GIE                     INTCONbits.GIE                  // bit 7
4021 
4022 #define IOCAF0                  IOCAFbits.IOCAF0                // bit 0
4023 #define IOCAF1                  IOCAFbits.IOCAF1                // bit 1
4024 #define IOCAF2                  IOCAFbits.IOCAF2                // bit 2
4025 #define IOCAF3                  IOCAFbits.IOCAF3                // bit 3
4026 #define IOCAF4                  IOCAFbits.IOCAF4                // bit 4
4027 #define IOCAF5                  IOCAFbits.IOCAF5                // bit 5
4028 
4029 #define IOCAN0                  IOCANbits.IOCAN0                // bit 0
4030 #define IOCAN1                  IOCANbits.IOCAN1                // bit 1
4031 #define IOCAN2                  IOCANbits.IOCAN2                // bit 2
4032 #define IOCAN3                  IOCANbits.IOCAN3                // bit 3
4033 #define IOCAN4                  IOCANbits.IOCAN4                // bit 4
4034 #define IOCAN5                  IOCANbits.IOCAN5                // bit 5
4035 
4036 #define IOCAP0                  IOCAPbits.IOCAP0                // bit 0
4037 #define IOCAP1                  IOCAPbits.IOCAP1                // bit 1
4038 #define IOCAP2                  IOCAPbits.IOCAP2                // bit 2
4039 #define IOCAP3                  IOCAPbits.IOCAP3                // bit 3
4040 #define IOCAP4                  IOCAPbits.IOCAP4                // bit 4
4041 #define IOCAP5                  IOCAPbits.IOCAP5                // bit 5
4042 
4043 #define IOCBF4                  IOCBFbits.IOCBF4                // bit 4
4044 #define IOCBF5                  IOCBFbits.IOCBF5                // bit 5
4045 #define IOCBF6                  IOCBFbits.IOCBF6                // bit 6
4046 #define IOCBF7                  IOCBFbits.IOCBF7                // bit 7
4047 
4048 #define IOCBN4                  IOCBNbits.IOCBN4                // bit 4
4049 #define IOCBN5                  IOCBNbits.IOCBN5                // bit 5
4050 #define IOCBN6                  IOCBNbits.IOCBN6                // bit 6
4051 #define IOCBN7                  IOCBNbits.IOCBN7                // bit 7
4052 
4053 #define IOCBP4                  IOCBPbits.IOCBP4                // bit 4
4054 #define IOCBP5                  IOCBPbits.IOCBP5                // bit 5
4055 #define IOCBP6                  IOCBPbits.IOCBP6                // bit 6
4056 #define IOCBP7                  IOCBPbits.IOCBP7                // bit 7
4057 
4058 #define LATA0                   LATAbits.LATA0                  // bit 0
4059 #define LATA1                   LATAbits.LATA1                  // bit 1
4060 #define LATA2                   LATAbits.LATA2                  // bit 2
4061 #define LATA4                   LATAbits.LATA4                  // bit 4
4062 #define LATA5                   LATAbits.LATA5                  // bit 5
4063 
4064 #define LATB4                   LATBbits.LATB4                  // bit 4
4065 #define LATB5                   LATBbits.LATB5                  // bit 5
4066 #define LATB6                   LATBbits.LATB6                  // bit 6
4067 #define LATB7                   LATBbits.LATB7                  // bit 7
4068 
4069 #define LATC0                   LATCbits.LATC0                  // bit 0
4070 #define LATC1                   LATCbits.LATC1                  // bit 1
4071 #define LATC2                   LATCbits.LATC2                  // bit 2
4072 #define LATC3                   LATCbits.LATC3                  // bit 3
4073 #define LATC4                   LATCbits.LATC4                  // bit 4
4074 #define LATC5                   LATCbits.LATC5                  // bit 5
4075 #define LATC6                   LATCbits.LATC6                  // bit 6
4076 #define LATC7                   LATCbits.LATC7                  // bit 7
4077 
4078 #define MDCH0                   MDCARHbits.MDCH0                // bit 0
4079 #define MDCH1                   MDCARHbits.MDCH1                // bit 1
4080 #define MDCH2                   MDCARHbits.MDCH2                // bit 2
4081 #define MDCH3                   MDCARHbits.MDCH3                // bit 3
4082 #define MDCHSYNC                MDCARHbits.MDCHSYNC             // bit 5
4083 #define MDCHPOL                 MDCARHbits.MDCHPOL              // bit 6
4084 #define MDCHODIS                MDCARHbits.MDCHODIS             // bit 7
4085 
4086 #define MDCL0                   MDCARLbits.MDCL0                // bit 0
4087 #define MDCL1                   MDCARLbits.MDCL1                // bit 1
4088 #define MDCL2                   MDCARLbits.MDCL2                // bit 2
4089 #define MDCL3                   MDCARLbits.MDCL3                // bit 3
4090 #define MDCLSYNC                MDCARLbits.MDCLSYNC             // bit 5
4091 #define MDCLPOL                 MDCARLbits.MDCLPOL              // bit 6
4092 #define MDCLODIS                MDCARLbits.MDCLODIS             // bit 7
4093 
4094 #define MDBIT                   MDCONbits.MDBIT                 // bit 0
4095 #define MDOUT                   MDCONbits.MDOUT                 // bit 3
4096 #define MDOPOL                  MDCONbits.MDOPOL                // bit 4
4097 #define MDSLR                   MDCONbits.MDSLR                 // bit 5
4098 #define MDOE                    MDCONbits.MDOE                  // bit 6
4099 #define MDEN                    MDCONbits.MDEN                  // bit 7
4100 
4101 #define MDMS0                   MDSRCbits.MDMS0                 // bit 0
4102 #define MDMS1                   MDSRCbits.MDMS1                 // bit 1
4103 #define MDMS2                   MDSRCbits.MDMS2                 // bit 2
4104 #define MDMS3                   MDSRCbits.MDMS3                 // bit 3
4105 #define MDMSODIS                MDSRCbits.MDMSODIS              // bit 7
4106 
4107 #define PS0                     OPTION_REGbits.PS0              // bit 0
4108 #define PS1                     OPTION_REGbits.PS1              // bit 1
4109 #define PS2                     OPTION_REGbits.PS2              // bit 2
4110 #define PSA                     OPTION_REGbits.PSA              // bit 3
4111 #define TMR0SE                  OPTION_REGbits.TMR0SE           // bit 4, shadows bit in OPTION_REGbits
4112 #define T0SE                    OPTION_REGbits.T0SE             // bit 4, shadows bit in OPTION_REGbits
4113 #define TMR0CS                  OPTION_REGbits.TMR0CS           // bit 5, shadows bit in OPTION_REGbits
4114 #define T0CS                    OPTION_REGbits.T0CS             // bit 5, shadows bit in OPTION_REGbits
4115 #define INTEDG                  OPTION_REGbits.INTEDG           // bit 6
4116 #define NOT_WPUEN               OPTION_REGbits.NOT_WPUEN        // bit 7
4117 
4118 #define SCS0                    OSCCONbits.SCS0                 // bit 0
4119 #define SCS1                    OSCCONbits.SCS1                 // bit 1
4120 #define IRCF0                   OSCCONbits.IRCF0                // bit 3
4121 #define IRCF1                   OSCCONbits.IRCF1                // bit 4
4122 #define IRCF2                   OSCCONbits.IRCF2                // bit 5
4123 #define IRCF3                   OSCCONbits.IRCF3                // bit 6
4124 #define SPLLEN                  OSCCONbits.SPLLEN               // bit 7
4125 
4126 #define HFIOFS                  OSCSTATbits.HFIOFS              // bit 0
4127 #define LFIOFR                  OSCSTATbits.LFIOFR              // bit 1
4128 #define MFIOFR                  OSCSTATbits.MFIOFR              // bit 2
4129 #define HFIOFL                  OSCSTATbits.HFIOFL              // bit 3
4130 #define HFIOFR                  OSCSTATbits.HFIOFR              // bit 4
4131 #define OSTS                    OSCSTATbits.OSTS                // bit 5
4132 #define PLLR                    OSCSTATbits.PLLR                // bit 6
4133 #define T1OSCR                  OSCSTATbits.T1OSCR              // bit 7
4134 
4135 #define TUN0                    OSCTUNEbits.TUN0                // bit 0
4136 #define TUN1                    OSCTUNEbits.TUN1                // bit 1
4137 #define TUN2                    OSCTUNEbits.TUN2                // bit 2
4138 #define TUN3                    OSCTUNEbits.TUN3                // bit 3
4139 #define TUN4                    OSCTUNEbits.TUN4                // bit 4
4140 #define TUN5                    OSCTUNEbits.TUN5                // bit 5
4141 
4142 #define NOT_BOR                 PCONbits.NOT_BOR                // bit 0
4143 #define NOT_POR                 PCONbits.NOT_POR                // bit 1
4144 #define NOT_RI                  PCONbits.NOT_RI                 // bit 2
4145 #define NOT_RMCLR               PCONbits.NOT_RMCLR              // bit 3
4146 #define STKUNF                  PCONbits.STKUNF                 // bit 6
4147 #define STKOVF                  PCONbits.STKOVF                 // bit 7
4148 
4149 #define TMR1IE                  PIE1bits.TMR1IE                 // bit 0
4150 #define TMR2IE                  PIE1bits.TMR2IE                 // bit 1
4151 #define CCP1IE                  PIE1bits.CCP1IE                 // bit 2
4152 #define SSP1IE                  PIE1bits.SSP1IE                 // bit 3
4153 #define TXIE                    PIE1bits.TXIE                   // bit 4
4154 #define RCIE                    PIE1bits.RCIE                   // bit 5
4155 #define ADIE                    PIE1bits.ADIE                   // bit 6
4156 #define TMR1GIE                 PIE1bits.TMR1GIE                // bit 7
4157 
4158 #define CCP2IE                  PIE2bits.CCP2IE                 // bit 0
4159 #define BCL1IE                  PIE2bits.BCL1IE                 // bit 3
4160 #define EEIE                    PIE2bits.EEIE                   // bit 4
4161 #define C1IE                    PIE2bits.C1IE                   // bit 5
4162 #define C2IE                    PIE2bits.C2IE                   // bit 6
4163 #define OSFIE                   PIE2bits.OSFIE                  // bit 7
4164 
4165 #define TMR4IE                  PIE3bits.TMR4IE                 // bit 1
4166 #define TMR6IE                  PIE3bits.TMR6IE                 // bit 3
4167 #define CCP3IE                  PIE3bits.CCP3IE                 // bit 4
4168 #define CCP4IE                  PIE3bits.CCP4IE                 // bit 5
4169 
4170 #define TMR1IF                  PIR1bits.TMR1IF                 // bit 0
4171 #define TMR2IF                  PIR1bits.TMR2IF                 // bit 1
4172 #define CCP1IF                  PIR1bits.CCP1IF                 // bit 2
4173 #define SSP1IF                  PIR1bits.SSP1IF                 // bit 3
4174 #define TXIF                    PIR1bits.TXIF                   // bit 4
4175 #define RCIF                    PIR1bits.RCIF                   // bit 5
4176 #define ADIF                    PIR1bits.ADIF                   // bit 6
4177 #define TMR1GIF                 PIR1bits.TMR1GIF                // bit 7
4178 
4179 #define CCP2IF                  PIR2bits.CCP2IF                 // bit 0
4180 #define BCL1IF                  PIR2bits.BCL1IF                 // bit 3
4181 #define EEIF                    PIR2bits.EEIF                   // bit 4
4182 #define C1IF                    PIR2bits.C1IF                   // bit 5
4183 #define C2IF                    PIR2bits.C2IF                   // bit 6
4184 #define OSFIF                   PIR2bits.OSFIF                  // bit 7
4185 
4186 #define TMR4IF                  PIR3bits.TMR4IF                 // bit 1
4187 #define TMR6IF                  PIR3bits.TMR6IF                 // bit 3
4188 #define CCP3IF                  PIR3bits.CCP3IF                 // bit 4
4189 #define CCP4IF                  PIR3bits.CCP4IF                 // bit 5
4190 
4191 #define RA0                     PORTAbits.RA0                   // bit 0
4192 #define RA1                     PORTAbits.RA1                   // bit 1
4193 #define RA2                     PORTAbits.RA2                   // bit 2
4194 #define RA3                     PORTAbits.RA3                   // bit 3
4195 #define RA4                     PORTAbits.RA4                   // bit 4
4196 #define RA5                     PORTAbits.RA5                   // bit 5
4197 
4198 #define RB4                     PORTBbits.RB4                   // bit 4
4199 #define RB5                     PORTBbits.RB5                   // bit 5
4200 #define RB6                     PORTBbits.RB6                   // bit 6
4201 #define RB7                     PORTBbits.RB7                   // bit 7
4202 
4203 #define RC0                     PORTCbits.RC0                   // bit 0
4204 #define RC1                     PORTCbits.RC1                   // bit 1
4205 #define RC2                     PORTCbits.RC2                   // bit 2
4206 #define RC3                     PORTCbits.RC3                   // bit 3
4207 #define RC4                     PORTCbits.RC4                   // bit 4
4208 #define RC5                     PORTCbits.RC5                   // bit 5
4209 #define RC6                     PORTCbits.RC6                   // bit 6
4210 #define RC7                     PORTCbits.RC7                   // bit 7
4211 
4212 #define STR1A                   PSTR1CONbits.STR1A              // bit 0
4213 #define STR1B                   PSTR1CONbits.STR1B              // bit 1
4214 #define STR1C                   PSTR1CONbits.STR1C              // bit 2
4215 #define STR1D                   PSTR1CONbits.STR1D              // bit 3
4216 #define STR1SYNC                PSTR1CONbits.STR1SYNC           // bit 4
4217 
4218 #define STR2A                   PSTR2CONbits.STR2A              // bit 0
4219 #define STR2B                   PSTR2CONbits.STR2B              // bit 1
4220 #define STR2C                   PSTR2CONbits.STR2C              // bit 2
4221 #define STR2D                   PSTR2CONbits.STR2D              // bit 3
4222 #define STR2SYNC                PSTR2CONbits.STR2SYNC           // bit 4
4223 
4224 #define P1DC0                   PWM1CONbits.P1DC0               // bit 0
4225 #define P1DC1                   PWM1CONbits.P1DC1               // bit 1
4226 #define P1DC2                   PWM1CONbits.P1DC2               // bit 2
4227 #define P1DC3                   PWM1CONbits.P1DC3               // bit 3
4228 #define P1DC4                   PWM1CONbits.P1DC4               // bit 4
4229 #define P1DC5                   PWM1CONbits.P1DC5               // bit 5
4230 #define P1DC6                   PWM1CONbits.P1DC6               // bit 6
4231 #define P1RSEN                  PWM1CONbits.P1RSEN              // bit 7
4232 
4233 #define P2DC0                   PWM2CONbits.P2DC0               // bit 0
4234 #define P2DC1                   PWM2CONbits.P2DC1               // bit 1
4235 #define P2DC2                   PWM2CONbits.P2DC2               // bit 2
4236 #define P2DC3                   PWM2CONbits.P2DC3               // bit 3
4237 #define P2DC4                   PWM2CONbits.P2DC4               // bit 4
4238 #define P2DC5                   PWM2CONbits.P2DC5               // bit 5
4239 #define P2DC6                   PWM2CONbits.P2DC6               // bit 6
4240 #define P2RSEN                  PWM2CONbits.P2RSEN              // bit 7
4241 
4242 #define RX9D                    RCSTAbits.RX9D                  // bit 0
4243 #define OERR                    RCSTAbits.OERR                  // bit 1
4244 #define FERR                    RCSTAbits.FERR                  // bit 2
4245 #define ADDEN                   RCSTAbits.ADDEN                 // bit 3
4246 #define CREN                    RCSTAbits.CREN                  // bit 4
4247 #define SREN                    RCSTAbits.SREN                  // bit 5
4248 #define RX9                     RCSTAbits.RX9                   // bit 6
4249 #define SPEN                    RCSTAbits.SPEN                  // bit 7
4250 
4251 #define SRPR                    SRCON0bits.SRPR                 // bit 0
4252 #define SRPS                    SRCON0bits.SRPS                 // bit 1
4253 #define SRNQEN                  SRCON0bits.SRNQEN               // bit 2
4254 #define SRQEN                   SRCON0bits.SRQEN                // bit 3
4255 #define SRCLK0                  SRCON0bits.SRCLK0               // bit 4
4256 #define SRCLK1                  SRCON0bits.SRCLK1               // bit 5
4257 #define SRCLK2                  SRCON0bits.SRCLK2               // bit 6
4258 #define SRLEN                   SRCON0bits.SRLEN                // bit 7
4259 
4260 #define SRRC1E                  SRCON1bits.SRRC1E               // bit 0
4261 #define SRRC2E                  SRCON1bits.SRRC2E               // bit 1
4262 #define SRRCKE                  SRCON1bits.SRRCKE               // bit 2
4263 #define SRRPE                   SRCON1bits.SRRPE                // bit 3
4264 #define SRSC1E                  SRCON1bits.SRSC1E               // bit 4
4265 #define SRSC2E                  SRCON1bits.SRSC2E               // bit 5
4266 #define SRSCKE                  SRCON1bits.SRSCKE               // bit 6
4267 #define SRSPE                   SRCON1bits.SRSPE                // bit 7
4268 
4269 #define SSPM0                   SSP1CONbits.SSPM0               // bit 0
4270 #define SSPM1                   SSP1CONbits.SSPM1               // bit 1
4271 #define SSPM2                   SSP1CONbits.SSPM2               // bit 2
4272 #define SSPM3                   SSP1CONbits.SSPM3               // bit 3
4273 #define CKP                     SSP1CONbits.CKP                 // bit 4
4274 #define SSPEN                   SSP1CONbits.SSPEN               // bit 5
4275 #define SSPOV                   SSP1CONbits.SSPOV               // bit 6
4276 #define WCOL                    SSP1CONbits.WCOL                // bit 7
4277 
4278 #define SEN                     SSP1CON2bits.SEN                // bit 0
4279 #define RSEN                    SSP1CON2bits.RSEN               // bit 1
4280 #define PEN                     SSP1CON2bits.PEN                // bit 2
4281 #define RCEN                    SSP1CON2bits.RCEN               // bit 3
4282 #define ACKEN                   SSP1CON2bits.ACKEN              // bit 4
4283 #define ACKDT                   SSP1CON2bits.ACKDT              // bit 5
4284 #define ACKSTAT                 SSP1CON2bits.ACKSTAT            // bit 6
4285 #define GCEN                    SSP1CON2bits.GCEN               // bit 7
4286 
4287 #define DHEN                    SSP1CON3bits.DHEN               // bit 0
4288 #define AHEN                    SSP1CON3bits.AHEN               // bit 1
4289 #define SBCDE                   SSP1CON3bits.SBCDE              // bit 2
4290 #define SDAHT                   SSP1CON3bits.SDAHT              // bit 3
4291 #define BOEN                    SSP1CON3bits.BOEN               // bit 4
4292 #define SCIE                    SSP1CON3bits.SCIE               // bit 5
4293 #define PCIE                    SSP1CON3bits.PCIE               // bit 6
4294 #define ACKTIM                  SSP1CON3bits.ACKTIM             // bit 7
4295 
4296 #define BF                      SSP1STATbits.BF                 // bit 0
4297 #define UA                      SSP1STATbits.UA                 // bit 1
4298 #define R_NOT_W                 SSP1STATbits.R_NOT_W            // bit 2
4299 #define S                       SSP1STATbits.S                  // bit 3
4300 #define P                       SSP1STATbits.P                  // bit 4
4301 #define D_NOT_A                 SSP1STATbits.D_NOT_A            // bit 5
4302 #define CKE                     SSP1STATbits.CKE                // bit 6
4303 #define SMP                     SSP1STATbits.SMP                // bit 7
4304 
4305 #define C                       STATUSbits.C                    // bit 0
4306 #define DC                      STATUSbits.DC                   // bit 1
4307 #define Z                       STATUSbits.Z                    // bit 2
4308 #define NOT_PD                  STATUSbits.NOT_PD               // bit 3
4309 #define NOT_TO                  STATUSbits.NOT_TO               // bit 4
4310 
4311 #define C_SHAD                  STATUS_SHADbits.C_SHAD          // bit 0
4312 #define DC_SHAD                 STATUS_SHADbits.DC_SHAD         // bit 1
4313 #define Z_SHAD                  STATUS_SHADbits.Z_SHAD          // bit 2
4314 
4315 #define TMR1ON                  T1CONbits.TMR1ON                // bit 0
4316 #define NOT_T1SYNC              T1CONbits.NOT_T1SYNC            // bit 2
4317 #define T1OSCEN                 T1CONbits.T1OSCEN               // bit 3
4318 #define T1CKPS0                 T1CONbits.T1CKPS0               // bit 4
4319 #define T1CKPS1                 T1CONbits.T1CKPS1               // bit 5
4320 #define TMR1CS0                 T1CONbits.TMR1CS0               // bit 6
4321 #define TMR1CS1                 T1CONbits.TMR1CS1               // bit 7
4322 
4323 #define T1GSS0                  T1GCONbits.T1GSS0               // bit 0
4324 #define T1GSS1                  T1GCONbits.T1GSS1               // bit 1
4325 #define T1GVAL                  T1GCONbits.T1GVAL               // bit 2
4326 #define T1GGO_NOT_DONE          T1GCONbits.T1GGO_NOT_DONE       // bit 3, shadows bit in T1GCONbits
4327 #define T1GGO                   T1GCONbits.T1GGO                // bit 3, shadows bit in T1GCONbits
4328 #define T1GSPM                  T1GCONbits.T1GSPM               // bit 4
4329 #define T1GTM                   T1GCONbits.T1GTM                // bit 5
4330 #define T1GPOL                  T1GCONbits.T1GPOL               // bit 6
4331 #define TMR1GE                  T1GCONbits.TMR1GE               // bit 7
4332 
4333 #define T2CKPS0                 T2CONbits.T2CKPS0               // bit 0
4334 #define T2CKPS1                 T2CONbits.T2CKPS1               // bit 1
4335 #define TMR2ON                  T2CONbits.TMR2ON                // bit 2
4336 #define T2OUTPS0                T2CONbits.T2OUTPS0              // bit 3
4337 #define T2OUTPS1                T2CONbits.T2OUTPS1              // bit 4
4338 #define T2OUTPS2                T2CONbits.T2OUTPS2              // bit 5
4339 #define T2OUTPS3                T2CONbits.T2OUTPS3              // bit 6
4340 
4341 #define T4CKPS0                 T4CONbits.T4CKPS0               // bit 0
4342 #define T4CKPS1                 T4CONbits.T4CKPS1               // bit 1
4343 #define TMR4ON                  T4CONbits.TMR4ON                // bit 2
4344 #define T4OUTPS0                T4CONbits.T4OUTPS0              // bit 3
4345 #define T4OUTPS1                T4CONbits.T4OUTPS1              // bit 4
4346 #define T4OUTPS2                T4CONbits.T4OUTPS2              // bit 5
4347 #define T4OUTPS3                T4CONbits.T4OUTPS3              // bit 6
4348 
4349 #define T6CKPS0                 T6CONbits.T6CKPS0               // bit 0
4350 #define T6CKPS1                 T6CONbits.T6CKPS1               // bit 1
4351 #define TMR6ON                  T6CONbits.TMR6ON                // bit 2
4352 #define T6OUTPS0                T6CONbits.T6OUTPS0              // bit 3
4353 #define T6OUTPS1                T6CONbits.T6OUTPS1              // bit 4
4354 #define T6OUTPS2                T6CONbits.T6OUTPS2              // bit 5
4355 #define T6OUTPS3                T6CONbits.T6OUTPS3              // bit 6
4356 
4357 #define TRISA0                  TRISAbits.TRISA0                // bit 0
4358 #define TRISA1                  TRISAbits.TRISA1                // bit 1
4359 #define TRISA2                  TRISAbits.TRISA2                // bit 2
4360 #define TRISA3                  TRISAbits.TRISA3                // bit 3
4361 #define TRISA4                  TRISAbits.TRISA4                // bit 4
4362 #define TRISA5                  TRISAbits.TRISA5                // bit 5
4363 
4364 #define TRISB4                  TRISBbits.TRISB4                // bit 4
4365 #define TRISB5                  TRISBbits.TRISB5                // bit 5
4366 #define TRISB6                  TRISBbits.TRISB6                // bit 6
4367 #define TRISB7                  TRISBbits.TRISB7                // bit 7
4368 
4369 #define TRISC0                  TRISCbits.TRISC0                // bit 0
4370 #define TRISC1                  TRISCbits.TRISC1                // bit 1
4371 #define TRISC2                  TRISCbits.TRISC2                // bit 2
4372 #define TRISC3                  TRISCbits.TRISC3                // bit 3
4373 #define TRISC4                  TRISCbits.TRISC4                // bit 4
4374 #define TRISC5                  TRISCbits.TRISC5                // bit 5
4375 #define TRISC6                  TRISCbits.TRISC6                // bit 6
4376 #define TRISC7                  TRISCbits.TRISC7                // bit 7
4377 
4378 #define TX9D                    TXSTAbits.TX9D                  // bit 0
4379 #define TRMT                    TXSTAbits.TRMT                  // bit 1
4380 #define BRGH                    TXSTAbits.BRGH                  // bit 2
4381 #define SENDB                   TXSTAbits.SENDB                 // bit 3
4382 #define SYNC                    TXSTAbits.SYNC                  // bit 4
4383 #define TXEN                    TXSTAbits.TXEN                  // bit 5
4384 #define TX9                     TXSTAbits.TX9                   // bit 6
4385 #define CSRC                    TXSTAbits.CSRC                  // bit 7
4386 
4387 #define SWDTEN                  WDTCONbits.SWDTEN               // bit 0
4388 #define WDTPS0                  WDTCONbits.WDTPS0               // bit 1
4389 #define WDTPS1                  WDTCONbits.WDTPS1               // bit 2
4390 #define WDTPS2                  WDTCONbits.WDTPS2               // bit 3
4391 #define WDTPS3                  WDTCONbits.WDTPS3               // bit 4
4392 #define WDTPS4                  WDTCONbits.WDTPS4               // bit 5
4393 
4394 #define WPUA0                   WPUAbits.WPUA0                  // bit 0
4395 #define WPUA1                   WPUAbits.WPUA1                  // bit 1
4396 #define WPUA2                   WPUAbits.WPUA2                  // bit 2
4397 #define WPUA3                   WPUAbits.WPUA3                  // bit 3
4398 #define WPUA4                   WPUAbits.WPUA4                  // bit 4
4399 #define WPUA5                   WPUAbits.WPUA5                  // bit 5
4400 
4401 #define WPUB4                   WPUBbits.WPUB4                  // bit 4
4402 #define WPUB5                   WPUBbits.WPUB5                  // bit 5
4403 #define WPUB6                   WPUBbits.WPUB6                  // bit 6
4404 #define WPUB7                   WPUBbits.WPUB7                  // bit 7
4405 
4406 #define WPUC0                   WPUCbits.WPUC0                  // bit 0
4407 #define WPUC1                   WPUCbits.WPUC1                  // bit 1
4408 #define WPUC2                   WPUCbits.WPUC2                  // bit 2
4409 #define WPUC3                   WPUCbits.WPUC3                  // bit 3
4410 #define WPUC4                   WPUCbits.WPUC4                  // bit 4
4411 #define WPUC5                   WPUCbits.WPUC5                  // bit 5
4412 #define WPUC6                   WPUCbits.WPUC6                  // bit 6
4413 #define WPUC7                   WPUCbits.WPUC7                  // bit 7
4414 
4415 #endif // #ifndef NO_BIT_DEFINES
4416 
4417 #endif // #ifndef __PIC16F1828_H__
4418