1 /*
2  * This declarations of the PIC16LF1458 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:04 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 __PIC16LF1458_H__
26 #define __PIC16LF1458_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 TMR0_ADDR               0x0015
56 #define TMR1_ADDR               0x0016
57 #define TMR1L_ADDR              0x0016
58 #define TMR1H_ADDR              0x0017
59 #define T1CON_ADDR              0x0018
60 #define T1GCON_ADDR             0x0019
61 #define TMR2_ADDR               0x001A
62 #define PR2_ADDR                0x001B
63 #define T2CON_ADDR              0x001C
64 #define TRISA_ADDR              0x008C
65 #define TRISB_ADDR              0x008D
66 #define TRISC_ADDR              0x008E
67 #define PIE1_ADDR               0x0091
68 #define PIE2_ADDR               0x0092
69 #define OPTION_REG_ADDR         0x0095
70 #define PCON_ADDR               0x0096
71 #define WDTCON_ADDR             0x0097
72 #define OSCTUNE_ADDR            0x0098
73 #define OSCCON_ADDR             0x0099
74 #define OSCSTAT_ADDR            0x009A
75 #define ADRES_ADDR              0x009B
76 #define ADRESL_ADDR             0x009B
77 #define ADRESH_ADDR             0x009C
78 #define ADCON0_ADDR             0x009D
79 #define ADCON1_ADDR             0x009E
80 #define ADCON2_ADDR             0x009F
81 #define LATA_ADDR               0x010C
82 #define LATB_ADDR               0x010D
83 #define LATC_ADDR               0x010E
84 #define CM1CON0_ADDR            0x0111
85 #define CM1CON1_ADDR            0x0112
86 #define CM2CON0_ADDR            0x0113
87 #define CM2CON1_ADDR            0x0114
88 #define CMOUT_ADDR              0x0115
89 #define BORCON_ADDR             0x0116
90 #define FVRCON_ADDR             0x0117
91 #define DACCON0_ADDR            0x0118
92 #define DACCON1_ADDR            0x0119
93 #define APFCON_ADDR             0x011D
94 #define ANSELA_ADDR             0x018C
95 #define ANSELB_ADDR             0x018D
96 #define ANSELC_ADDR             0x018E
97 #define PMADR_ADDR              0x0191
98 #define PMADRL_ADDR             0x0191
99 #define PMADRH_ADDR             0x0192
100 #define PMDAT_ADDR              0x0193
101 #define PMDATL_ADDR             0x0193
102 #define PMDATH_ADDR             0x0194
103 #define PMCON1_ADDR             0x0195
104 #define PMCON2_ADDR             0x0196
105 #define RCREG_ADDR              0x0199
106 #define TXREG_ADDR              0x019A
107 #define SPBRGL_ADDR             0x019B
108 #define SPBRGH_ADDR             0x019C
109 #define RCSTA_ADDR              0x019D
110 #define TXSTA_ADDR              0x019E
111 #define BAUDCON_ADDR            0x019F
112 #define WPUA_ADDR               0x020C
113 #define WPUB_ADDR               0x020D
114 #define SSP1BUF_ADDR            0x0211
115 #define SSPBUF_ADDR             0x0211
116 #define SSP1ADD_ADDR            0x0212
117 #define SSPADD_ADDR             0x0212
118 #define SSP1MSK_ADDR            0x0213
119 #define SSPMSK_ADDR             0x0213
120 #define SSP1STAT_ADDR           0x0214
121 #define SSPSTAT_ADDR            0x0214
122 #define SSP1CON1_ADDR           0x0215
123 #define SSPCON_ADDR             0x0215
124 #define SSPCON1_ADDR            0x0215
125 #define SSP1CON2_ADDR           0x0216
126 #define SSPCON2_ADDR            0x0216
127 #define SSP1CON3_ADDR           0x0217
128 #define SSPCON3_ADDR            0x0217
129 #define IOCAP_ADDR              0x0391
130 #define IOCAN_ADDR              0x0392
131 #define IOCAF_ADDR              0x0393
132 #define IOCBP_ADDR              0x0394
133 #define IOCBN_ADDR              0x0395
134 #define IOCBF_ADDR              0x0396
135 #define CLKRCON_ADDR            0x039A
136 #define CRCON_ADDR              0x039B
137 #define PWM1DCL_ADDR            0x0611
138 #define PWM1DCH_ADDR            0x0612
139 #define PWM1CON_ADDR            0x0613
140 #define PWM1CON0_ADDR           0x0613
141 #define PWM2DCL_ADDR            0x0614
142 #define PWM2DCH_ADDR            0x0615
143 #define PWM2CON_ADDR            0x0616
144 #define CWG1DBR_ADDR            0x0691
145 #define CWG1DBF_ADDR            0x0692
146 #define CWG1CON0_ADDR           0x0693
147 #define CWG1CON1_ADDR           0x0694
148 #define CWG1CON2_ADDR           0x0695
149 #define CRRC_ADDR               0x0E10
150 #define TST_CRRCL_ADDR          0x0E10
151 #define TST_CRRCH_ADDR          0x0E11
152 #define TST_CRLT_ADDR           0x0E12
153 #define UCON_ADDR               0x0E8E
154 #define USTAT_ADDR              0x0E8F
155 #define UIR_ADDR                0x0E90
156 #define UCFG_ADDR               0x0E91
157 #define UIE_ADDR                0x0E92
158 #define UEIR_ADDR               0x0E93
159 #define UFRM_ADDR               0x0E94
160 #define UFRMH_ADDR              0x0E94
161 #define UFRML_ADDR              0x0E95
162 #define UADDR_ADDR              0x0E96
163 #define UEIE_ADDR               0x0E97
164 #define UEP0_ADDR               0x0E98
165 #define UEP1_ADDR               0x0E99
166 #define UEP2_ADDR               0x0E9A
167 #define UEP3_ADDR               0x0E9B
168 #define UEP4_ADDR               0x0E9C
169 #define UEP5_ADDR               0x0E9D
170 #define UEP6_ADDR               0x0E9E
171 #define UEP7_ADDR               0x0E9F
172 #define ICDIO_ADDR              0x0F8C
173 #define ICDCON0_ADDR            0x0F8D
174 #define ICDSTAT_ADDR            0x0F91
175 #define DEVSEL_ADDR             0x0F95
176 #define ICDINSTL_ADDR           0x0F96
177 #define ICDINSTH_ADDR           0x0F97
178 #define ICDBK0CON_ADDR          0x0F9C
179 #define ICDBK0L_ADDR            0x0F9D
180 #define ICDBK0H_ADDR            0x0F9E
181 #define BSRICDSHAD_ADDR         0x0FE3
182 #define STATUS_SHAD_ADDR        0x0FE4
183 #define WREG_SHAD_ADDR          0x0FE5
184 #define BSR_SHAD_ADDR           0x0FE6
185 #define PCLATH_SHAD_ADDR        0x0FE7
186 #define FSR0L_SHAD_ADDR         0x0FE8
187 #define FSR0H_SHAD_ADDR         0x0FE9
188 #define FSR1L_SHAD_ADDR         0x0FEA
189 #define FSR1H_SHAD_ADDR         0x0FEB
190 #define STKPTR_ADDR             0x0FED
191 #define TOSL_ADDR               0x0FEE
192 #define TOSH_ADDR               0x0FEF
193 
194 #endif // #ifndef NO_ADDR_DEFINES
195 
196 //==============================================================================
197 //
198 //	Register Definitions
199 //
200 //==============================================================================
201 
202 extern __at(0x0000) __sfr INDF0;
203 extern __at(0x0001) __sfr INDF1;
204 extern __at(0x0002) __sfr PCL;
205 
206 //==============================================================================
207 //        STATUS Bits
208 
209 extern __at(0x0003) __sfr STATUS;
210 
211 typedef struct
212   {
213   unsigned C                    : 1;
214   unsigned DC                   : 1;
215   unsigned Z                    : 1;
216   unsigned NOT_PD               : 1;
217   unsigned NOT_TO               : 1;
218   unsigned                      : 1;
219   unsigned                      : 1;
220   unsigned                      : 1;
221   } __STATUSbits_t;
222 
223 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
224 
225 #define _C                      0x01
226 #define _DC                     0x02
227 #define _Z                      0x04
228 #define _NOT_PD                 0x08
229 #define _NOT_TO                 0x10
230 
231 //==============================================================================
232 
233 extern __at(0x0004) __sfr FSR0;
234 extern __at(0x0004) __sfr FSR0L;
235 extern __at(0x0005) __sfr FSR0H;
236 extern __at(0x0006) __sfr FSR1;
237 extern __at(0x0006) __sfr FSR1L;
238 extern __at(0x0007) __sfr FSR1H;
239 
240 //==============================================================================
241 //        BSR Bits
242 
243 extern __at(0x0008) __sfr BSR;
244 
245 typedef union
246   {
247   struct
248     {
249     unsigned BSR0               : 1;
250     unsigned BSR1               : 1;
251     unsigned BSR2               : 1;
252     unsigned BSR3               : 1;
253     unsigned BSR4               : 1;
254     unsigned                    : 1;
255     unsigned                    : 1;
256     unsigned                    : 1;
257     };
258 
259   struct
260     {
261     unsigned BSR                : 5;
262     unsigned                    : 3;
263     };
264   } __BSRbits_t;
265 
266 extern __at(0x0008) volatile __BSRbits_t BSRbits;
267 
268 #define _BSR0                   0x01
269 #define _BSR1                   0x02
270 #define _BSR2                   0x04
271 #define _BSR3                   0x08
272 #define _BSR4                   0x10
273 
274 //==============================================================================
275 
276 extern __at(0x0009) __sfr WREG;
277 extern __at(0x000A) __sfr PCLATH;
278 
279 //==============================================================================
280 //        INTCON Bits
281 
282 extern __at(0x000B) __sfr INTCON;
283 
284 typedef union
285   {
286   struct
287     {
288     unsigned IOCIF              : 1;
289     unsigned INTF               : 1;
290     unsigned TMR0IF             : 1;
291     unsigned IOCIE              : 1;
292     unsigned INTE               : 1;
293     unsigned TMR0IE             : 1;
294     unsigned PEIE               : 1;
295     unsigned GIE                : 1;
296     };
297 
298   struct
299     {
300     unsigned                    : 1;
301     unsigned                    : 1;
302     unsigned T0IF               : 1;
303     unsigned                    : 1;
304     unsigned                    : 1;
305     unsigned T0IE               : 1;
306     unsigned                    : 1;
307     unsigned                    : 1;
308     };
309   } __INTCONbits_t;
310 
311 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
312 
313 #define _IOCIF                  0x01
314 #define _INTF                   0x02
315 #define _TMR0IF                 0x04
316 #define _T0IF                   0x04
317 #define _IOCIE                  0x08
318 #define _INTE                   0x10
319 #define _TMR0IE                 0x20
320 #define _T0IE                   0x20
321 #define _PEIE                   0x40
322 #define _GIE                    0x80
323 
324 //==============================================================================
325 
326 
327 //==============================================================================
328 //        PORTA Bits
329 
330 extern __at(0x000C) __sfr PORTA;
331 
332 typedef struct
333   {
334   unsigned RA0                  : 1;
335   unsigned RA1                  : 1;
336   unsigned                      : 1;
337   unsigned RA3                  : 1;
338   unsigned RA4                  : 1;
339   unsigned RA5                  : 1;
340   unsigned                      : 1;
341   unsigned                      : 1;
342   } __PORTAbits_t;
343 
344 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
345 
346 #define _RA0                    0x01
347 #define _RA1                    0x02
348 #define _RA3                    0x08
349 #define _RA4                    0x10
350 #define _RA5                    0x20
351 
352 //==============================================================================
353 
354 
355 //==============================================================================
356 //        PORTB Bits
357 
358 extern __at(0x000D) __sfr PORTB;
359 
360 typedef struct
361   {
362   unsigned                      : 1;
363   unsigned                      : 1;
364   unsigned                      : 1;
365   unsigned                      : 1;
366   unsigned RB4                  : 1;
367   unsigned RB5                  : 1;
368   unsigned RB6                  : 1;
369   unsigned RB7                  : 1;
370   } __PORTBbits_t;
371 
372 extern __at(0x000D) volatile __PORTBbits_t PORTBbits;
373 
374 #define _RB4                    0x10
375 #define _RB5                    0x20
376 #define _RB6                    0x40
377 #define _RB7                    0x80
378 
379 //==============================================================================
380 
381 
382 //==============================================================================
383 //        PORTC Bits
384 
385 extern __at(0x000E) __sfr PORTC;
386 
387 typedef struct
388   {
389   unsigned RC0                  : 1;
390   unsigned RC1                  : 1;
391   unsigned RC2                  : 1;
392   unsigned RC3                  : 1;
393   unsigned RC4                  : 1;
394   unsigned RC5                  : 1;
395   unsigned RC6                  : 1;
396   unsigned RC7                  : 1;
397   } __PORTCbits_t;
398 
399 extern __at(0x000E) volatile __PORTCbits_t PORTCbits;
400 
401 #define _RC0                    0x01
402 #define _RC1                    0x02
403 #define _RC2                    0x04
404 #define _RC3                    0x08
405 #define _RC4                    0x10
406 #define _RC5                    0x20
407 #define _RC6                    0x40
408 #define _RC7                    0x80
409 
410 //==============================================================================
411 
412 
413 //==============================================================================
414 //        PIR1 Bits
415 
416 extern __at(0x0011) __sfr PIR1;
417 
418 typedef struct
419   {
420   unsigned TMR1IF               : 1;
421   unsigned TMR2IF               : 1;
422   unsigned                      : 1;
423   unsigned SSP1IF               : 1;
424   unsigned TXIF                 : 1;
425   unsigned RCIF                 : 1;
426   unsigned ADIF                 : 1;
427   unsigned TMR1GIF              : 1;
428   } __PIR1bits_t;
429 
430 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
431 
432 #define _TMR1IF                 0x01
433 #define _TMR2IF                 0x02
434 #define _SSP1IF                 0x08
435 #define _TXIF                   0x10
436 #define _RCIF                   0x20
437 #define _ADIF                   0x40
438 #define _TMR1GIF                0x80
439 
440 //==============================================================================
441 
442 
443 //==============================================================================
444 //        PIR2 Bits
445 
446 extern __at(0x0012) __sfr PIR2;
447 
448 typedef struct
449   {
450   unsigned                      : 1;
451   unsigned CRIF                 : 1;
452   unsigned USBIF                : 1;
453   unsigned BCL1IF               : 1;
454   unsigned                      : 1;
455   unsigned C1IF                 : 1;
456   unsigned C2IF                 : 1;
457   unsigned OSFIF                : 1;
458   } __PIR2bits_t;
459 
460 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
461 
462 #define _CRIF                   0x02
463 #define _USBIF                  0x04
464 #define _BCL1IF                 0x08
465 #define _C1IF                   0x20
466 #define _C2IF                   0x40
467 #define _OSFIF                  0x80
468 
469 //==============================================================================
470 
471 extern __at(0x0015) __sfr TMR0;
472 extern __at(0x0016) __sfr TMR1;
473 extern __at(0x0016) __sfr TMR1L;
474 extern __at(0x0017) __sfr TMR1H;
475 
476 //==============================================================================
477 //        T1CON Bits
478 
479 extern __at(0x0018) __sfr T1CON;
480 
481 typedef union
482   {
483   struct
484     {
485     unsigned TMR1ON             : 1;
486     unsigned                    : 1;
487     unsigned NOT_T1SYNC         : 1;
488     unsigned T1OSCEN            : 1;
489     unsigned T1CKPS0            : 1;
490     unsigned T1CKPS1            : 1;
491     unsigned TMR1CS0            : 1;
492     unsigned TMR1CS1            : 1;
493     };
494 
495   struct
496     {
497     unsigned                    : 4;
498     unsigned T1CKPS             : 2;
499     unsigned                    : 2;
500     };
501 
502   struct
503     {
504     unsigned                    : 6;
505     unsigned TMR1CS             : 2;
506     };
507   } __T1CONbits_t;
508 
509 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
510 
511 #define _TMR1ON                 0x01
512 #define _NOT_T1SYNC             0x04
513 #define _T1OSCEN                0x08
514 #define _T1CKPS0                0x10
515 #define _T1CKPS1                0x20
516 #define _TMR1CS0                0x40
517 #define _TMR1CS1                0x80
518 
519 //==============================================================================
520 
521 
522 //==============================================================================
523 //        T1GCON Bits
524 
525 extern __at(0x0019) __sfr T1GCON;
526 
527 typedef union
528   {
529   struct
530     {
531     unsigned T1GSS0             : 1;
532     unsigned T1GSS1             : 1;
533     unsigned T1GVAL             : 1;
534     unsigned T1GGO_NOT_DONE     : 1;
535     unsigned T1GSPM             : 1;
536     unsigned T1GTM              : 1;
537     unsigned T1GPOL             : 1;
538     unsigned TMR1GE             : 1;
539     };
540 
541   struct
542     {
543     unsigned T1GSS              : 2;
544     unsigned                    : 6;
545     };
546   } __T1GCONbits_t;
547 
548 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
549 
550 #define _T1GSS0                 0x01
551 #define _T1GSS1                 0x02
552 #define _T1GVAL                 0x04
553 #define _T1GGO_NOT_DONE         0x08
554 #define _T1GSPM                 0x10
555 #define _T1GTM                  0x20
556 #define _T1GPOL                 0x40
557 #define _TMR1GE                 0x80
558 
559 //==============================================================================
560 
561 extern __at(0x001A) __sfr TMR2;
562 extern __at(0x001B) __sfr PR2;
563 
564 //==============================================================================
565 //        T2CON Bits
566 
567 extern __at(0x001C) __sfr T2CON;
568 
569 typedef union
570   {
571   struct
572     {
573     unsigned T2CKPS0            : 1;
574     unsigned T2CKPS1            : 1;
575     unsigned TMR2ON             : 1;
576     unsigned TOUTPS0            : 1;
577     unsigned TOUTPS1            : 1;
578     unsigned TOUTPS2            : 1;
579     unsigned TOUTPS3            : 1;
580     unsigned                    : 1;
581     };
582 
583   struct
584     {
585     unsigned T2CKPS             : 2;
586     unsigned                    : 6;
587     };
588 
589   struct
590     {
591     unsigned                    : 3;
592     unsigned TOUTPS             : 4;
593     unsigned                    : 1;
594     };
595   } __T2CONbits_t;
596 
597 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
598 
599 #define _T2CKPS0                0x01
600 #define _T2CKPS1                0x02
601 #define _TMR2ON                 0x04
602 #define _TOUTPS0                0x08
603 #define _TOUTPS1                0x10
604 #define _TOUTPS2                0x20
605 #define _TOUTPS3                0x40
606 
607 //==============================================================================
608 
609 
610 //==============================================================================
611 //        TRISA Bits
612 
613 extern __at(0x008C) __sfr TRISA;
614 
615 typedef struct
616   {
617   unsigned                      : 1;
618   unsigned                      : 1;
619   unsigned                      : 1;
620   unsigned                      : 1;
621   unsigned TRISA4               : 1;
622   unsigned TRISA5               : 1;
623   unsigned                      : 1;
624   unsigned                      : 1;
625   } __TRISAbits_t;
626 
627 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
628 
629 #define _TRISA4                 0x10
630 #define _TRISA5                 0x20
631 
632 //==============================================================================
633 
634 
635 //==============================================================================
636 //        TRISB Bits
637 
638 extern __at(0x008D) __sfr TRISB;
639 
640 typedef struct
641   {
642   unsigned                      : 1;
643   unsigned                      : 1;
644   unsigned                      : 1;
645   unsigned                      : 1;
646   unsigned TRISB4               : 1;
647   unsigned TRISB5               : 1;
648   unsigned TRISB6               : 1;
649   unsigned TRISB7               : 1;
650   } __TRISBbits_t;
651 
652 extern __at(0x008D) volatile __TRISBbits_t TRISBbits;
653 
654 #define _TRISB4                 0x10
655 #define _TRISB5                 0x20
656 #define _TRISB6                 0x40
657 #define _TRISB7                 0x80
658 
659 //==============================================================================
660 
661 
662 //==============================================================================
663 //        TRISC Bits
664 
665 extern __at(0x008E) __sfr TRISC;
666 
667 typedef struct
668   {
669   unsigned TRISC0               : 1;
670   unsigned TRISC1               : 1;
671   unsigned TRISC2               : 1;
672   unsigned TRISC3               : 1;
673   unsigned TRISC4               : 1;
674   unsigned TRISC5               : 1;
675   unsigned TRISC6               : 1;
676   unsigned TRISC7               : 1;
677   } __TRISCbits_t;
678 
679 extern __at(0x008E) volatile __TRISCbits_t TRISCbits;
680 
681 #define _TRISC0                 0x01
682 #define _TRISC1                 0x02
683 #define _TRISC2                 0x04
684 #define _TRISC3                 0x08
685 #define _TRISC4                 0x10
686 #define _TRISC5                 0x20
687 #define _TRISC6                 0x40
688 #define _TRISC7                 0x80
689 
690 //==============================================================================
691 
692 
693 //==============================================================================
694 //        PIE1 Bits
695 
696 extern __at(0x0091) __sfr PIE1;
697 
698 typedef struct
699   {
700   unsigned TMR1IE               : 1;
701   unsigned TMR2IE               : 1;
702   unsigned                      : 1;
703   unsigned SSP1IE               : 1;
704   unsigned TXIE                 : 1;
705   unsigned RCIE                 : 1;
706   unsigned ADIE                 : 1;
707   unsigned TMR1GIE              : 1;
708   } __PIE1bits_t;
709 
710 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
711 
712 #define _TMR1IE                 0x01
713 #define _TMR2IE                 0x02
714 #define _SSP1IE                 0x08
715 #define _TXIE                   0x10
716 #define _RCIE                   0x20
717 #define _ADIE                   0x40
718 #define _TMR1GIE                0x80
719 
720 //==============================================================================
721 
722 
723 //==============================================================================
724 //        PIE2 Bits
725 
726 extern __at(0x0092) __sfr PIE2;
727 
728 typedef struct
729   {
730   unsigned                      : 1;
731   unsigned CRIE                 : 1;
732   unsigned USBIE                : 1;
733   unsigned BCL1IE               : 1;
734   unsigned                      : 1;
735   unsigned C1IE                 : 1;
736   unsigned C2IE                 : 1;
737   unsigned OSFIE                : 1;
738   } __PIE2bits_t;
739 
740 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
741 
742 #define _CRIE                   0x02
743 #define _USBIE                  0x04
744 #define _BCL1IE                 0x08
745 #define _C1IE                   0x20
746 #define _C2IE                   0x40
747 #define _OSFIE                  0x80
748 
749 //==============================================================================
750 
751 
752 //==============================================================================
753 //        OPTION_REG Bits
754 
755 extern __at(0x0095) __sfr OPTION_REG;
756 
757 typedef union
758   {
759   struct
760     {
761     unsigned PS0                : 1;
762     unsigned PS1                : 1;
763     unsigned PS2                : 1;
764     unsigned PSA                : 1;
765     unsigned TMR0SE             : 1;
766     unsigned TMR0CS             : 1;
767     unsigned INTEDG             : 1;
768     unsigned NOT_WPUEN          : 1;
769     };
770 
771   struct
772     {
773     unsigned                    : 1;
774     unsigned                    : 1;
775     unsigned                    : 1;
776     unsigned                    : 1;
777     unsigned T0SE               : 1;
778     unsigned T0CS               : 1;
779     unsigned                    : 1;
780     unsigned                    : 1;
781     };
782 
783   struct
784     {
785     unsigned PS                 : 3;
786     unsigned                    : 5;
787     };
788   } __OPTION_REGbits_t;
789 
790 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
791 
792 #define _PS0                    0x01
793 #define _PS1                    0x02
794 #define _PS2                    0x04
795 #define _PSA                    0x08
796 #define _TMR0SE                 0x10
797 #define _T0SE                   0x10
798 #define _TMR0CS                 0x20
799 #define _T0CS                   0x20
800 #define _INTEDG                 0x40
801 #define _NOT_WPUEN              0x80
802 
803 //==============================================================================
804 
805 
806 //==============================================================================
807 //        PCON Bits
808 
809 extern __at(0x0096) __sfr PCON;
810 
811 typedef struct
812   {
813   unsigned NOT_BOR              : 1;
814   unsigned NOT_POR              : 1;
815   unsigned NOT_RI               : 1;
816   unsigned NOT_RMCLR            : 1;
817   unsigned NOT_RWDT             : 1;
818   unsigned                      : 1;
819   unsigned STKUNF               : 1;
820   unsigned STKOVF               : 1;
821   } __PCONbits_t;
822 
823 extern __at(0x0096) volatile __PCONbits_t PCONbits;
824 
825 #define _NOT_BOR                0x01
826 #define _NOT_POR                0x02
827 #define _NOT_RI                 0x04
828 #define _NOT_RMCLR              0x08
829 #define _NOT_RWDT               0x10
830 #define _STKUNF                 0x40
831 #define _STKOVF                 0x80
832 
833 //==============================================================================
834 
835 
836 //==============================================================================
837 //        WDTCON Bits
838 
839 extern __at(0x0097) __sfr WDTCON;
840 
841 typedef union
842   {
843   struct
844     {
845     unsigned SWDTEN             : 1;
846     unsigned WDTPS0             : 1;
847     unsigned WDTPS1             : 1;
848     unsigned WDTPS2             : 1;
849     unsigned WDTPS3             : 1;
850     unsigned WDTPS4             : 1;
851     unsigned                    : 1;
852     unsigned                    : 1;
853     };
854 
855   struct
856     {
857     unsigned                    : 1;
858     unsigned WDTPS              : 5;
859     unsigned                    : 2;
860     };
861   } __WDTCONbits_t;
862 
863 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
864 
865 #define _SWDTEN                 0x01
866 #define _WDTPS0                 0x02
867 #define _WDTPS1                 0x04
868 #define _WDTPS2                 0x08
869 #define _WDTPS3                 0x10
870 #define _WDTPS4                 0x20
871 
872 //==============================================================================
873 
874 
875 //==============================================================================
876 //        OSCTUNE Bits
877 
878 extern __at(0x0098) __sfr OSCTUNE;
879 
880 typedef union
881   {
882   struct
883     {
884     unsigned TUN0               : 1;
885     unsigned TUN1               : 1;
886     unsigned TUN2               : 1;
887     unsigned TUN3               : 1;
888     unsigned TUN4               : 1;
889     unsigned TUN5               : 1;
890     unsigned TUN6               : 1;
891     unsigned                    : 1;
892     };
893 
894   struct
895     {
896     unsigned TUN                : 7;
897     unsigned                    : 1;
898     };
899   } __OSCTUNEbits_t;
900 
901 extern __at(0x0098) volatile __OSCTUNEbits_t OSCTUNEbits;
902 
903 #define _TUN0                   0x01
904 #define _TUN1                   0x02
905 #define _TUN2                   0x04
906 #define _TUN3                   0x08
907 #define _TUN4                   0x10
908 #define _TUN5                   0x20
909 #define _TUN6                   0x40
910 
911 //==============================================================================
912 
913 
914 //==============================================================================
915 //        OSCCON Bits
916 
917 extern __at(0x0099) __sfr OSCCON;
918 
919 typedef union
920   {
921   struct
922     {
923     unsigned SCS0               : 1;
924     unsigned SCS1               : 1;
925     unsigned IRCF0              : 1;
926     unsigned IRCF1              : 1;
927     unsigned IRCF2              : 1;
928     unsigned IRCF3              : 1;
929     unsigned SPLLMULT           : 1;
930     unsigned SPLLEN             : 1;
931     };
932 
933   struct
934     {
935     unsigned SCS                : 2;
936     unsigned                    : 6;
937     };
938 
939   struct
940     {
941     unsigned                    : 2;
942     unsigned IRCF               : 4;
943     unsigned                    : 2;
944     };
945   } __OSCCONbits_t;
946 
947 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
948 
949 #define _SCS0                   0x01
950 #define _SCS1                   0x02
951 #define _IRCF0                  0x04
952 #define _IRCF1                  0x08
953 #define _IRCF2                  0x10
954 #define _IRCF3                  0x20
955 #define _SPLLMULT               0x40
956 #define _SPLLEN                 0x80
957 
958 //==============================================================================
959 
960 
961 //==============================================================================
962 //        OSCSTAT Bits
963 
964 extern __at(0x009A) __sfr OSCSTAT;
965 
966 typedef struct
967   {
968   unsigned HFIOFS               : 1;
969   unsigned LFIOFR               : 1;
970   unsigned                      : 1;
971   unsigned                      : 1;
972   unsigned HFIOFR               : 1;
973   unsigned OSTS                 : 1;
974   unsigned PLLRDY               : 1;
975   unsigned SOSCR                : 1;
976   } __OSCSTATbits_t;
977 
978 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
979 
980 #define _HFIOFS                 0x01
981 #define _LFIOFR                 0x02
982 #define _HFIOFR                 0x10
983 #define _OSTS                   0x20
984 #define _PLLRDY                 0x40
985 #define _SOSCR                  0x80
986 
987 //==============================================================================
988 
989 extern __at(0x009B) __sfr ADRES;
990 extern __at(0x009B) __sfr ADRESL;
991 extern __at(0x009C) __sfr ADRESH;
992 
993 //==============================================================================
994 //        ADCON0 Bits
995 
996 extern __at(0x009D) __sfr ADCON0;
997 
998 typedef union
999   {
1000   struct
1001     {
1002     unsigned ADON               : 1;
1003     unsigned GO_NOT_DONE        : 1;
1004     unsigned CHS0               : 1;
1005     unsigned CHS1               : 1;
1006     unsigned CHS2               : 1;
1007     unsigned CHS3               : 1;
1008     unsigned CHS4               : 1;
1009     unsigned                    : 1;
1010     };
1011 
1012   struct
1013     {
1014     unsigned                    : 1;
1015     unsigned ADGO               : 1;
1016     unsigned                    : 1;
1017     unsigned                    : 1;
1018     unsigned                    : 1;
1019     unsigned                    : 1;
1020     unsigned                    : 1;
1021     unsigned                    : 1;
1022     };
1023 
1024   struct
1025     {
1026     unsigned                    : 1;
1027     unsigned GO                 : 1;
1028     unsigned                    : 1;
1029     unsigned                    : 1;
1030     unsigned                    : 1;
1031     unsigned                    : 1;
1032     unsigned                    : 1;
1033     unsigned                    : 1;
1034     };
1035 
1036   struct
1037     {
1038     unsigned                    : 2;
1039     unsigned CHS                : 5;
1040     unsigned                    : 1;
1041     };
1042   } __ADCON0bits_t;
1043 
1044 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1045 
1046 #define _ADON                   0x01
1047 #define _GO_NOT_DONE            0x02
1048 #define _ADGO                   0x02
1049 #define _GO                     0x02
1050 #define _CHS0                   0x04
1051 #define _CHS1                   0x08
1052 #define _CHS2                   0x10
1053 #define _CHS3                   0x20
1054 #define _CHS4                   0x40
1055 
1056 //==============================================================================
1057 
1058 
1059 //==============================================================================
1060 //        ADCON1 Bits
1061 
1062 extern __at(0x009E) __sfr ADCON1;
1063 
1064 typedef union
1065   {
1066   struct
1067     {
1068     unsigned ADPREF0            : 1;
1069     unsigned ADPREF1            : 1;
1070     unsigned                    : 1;
1071     unsigned                    : 1;
1072     unsigned ADCS0              : 1;
1073     unsigned ADCS1              : 1;
1074     unsigned ADCS2              : 1;
1075     unsigned ADFM               : 1;
1076     };
1077 
1078   struct
1079     {
1080     unsigned ADPREF             : 2;
1081     unsigned                    : 6;
1082     };
1083 
1084   struct
1085     {
1086     unsigned                    : 4;
1087     unsigned ADCS               : 3;
1088     unsigned                    : 1;
1089     };
1090   } __ADCON1bits_t;
1091 
1092 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1093 
1094 #define _ADPREF0                0x01
1095 #define _ADPREF1                0x02
1096 #define _ADCS0                  0x10
1097 #define _ADCS1                  0x20
1098 #define _ADCS2                  0x40
1099 #define _ADFM                   0x80
1100 
1101 //==============================================================================
1102 
1103 
1104 //==============================================================================
1105 //        ADCON2 Bits
1106 
1107 extern __at(0x009F) __sfr ADCON2;
1108 
1109 typedef union
1110   {
1111   struct
1112     {
1113     unsigned                    : 1;
1114     unsigned                    : 1;
1115     unsigned                    : 1;
1116     unsigned                    : 1;
1117     unsigned TRIGSEL0           : 1;
1118     unsigned TRIGSEL1           : 1;
1119     unsigned TRIGSEL2           : 1;
1120     unsigned                    : 1;
1121     };
1122 
1123   struct
1124     {
1125     unsigned                    : 4;
1126     unsigned TRIGSEL            : 3;
1127     unsigned                    : 1;
1128     };
1129   } __ADCON2bits_t;
1130 
1131 extern __at(0x009F) volatile __ADCON2bits_t ADCON2bits;
1132 
1133 #define _TRIGSEL0               0x10
1134 #define _TRIGSEL1               0x20
1135 #define _TRIGSEL2               0x40
1136 
1137 //==============================================================================
1138 
1139 
1140 //==============================================================================
1141 //        LATA Bits
1142 
1143 extern __at(0x010C) __sfr LATA;
1144 
1145 typedef struct
1146   {
1147   unsigned                      : 1;
1148   unsigned                      : 1;
1149   unsigned                      : 1;
1150   unsigned                      : 1;
1151   unsigned LATA4                : 1;
1152   unsigned LATA5                : 1;
1153   unsigned                      : 1;
1154   unsigned                      : 1;
1155   } __LATAbits_t;
1156 
1157 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1158 
1159 #define _LATA4                  0x10
1160 #define _LATA5                  0x20
1161 
1162 //==============================================================================
1163 
1164 
1165 //==============================================================================
1166 //        LATB Bits
1167 
1168 extern __at(0x010D) __sfr LATB;
1169 
1170 typedef struct
1171   {
1172   unsigned                      : 1;
1173   unsigned                      : 1;
1174   unsigned                      : 1;
1175   unsigned                      : 1;
1176   unsigned LATB4                : 1;
1177   unsigned LATB5                : 1;
1178   unsigned LATB6                : 1;
1179   unsigned LATB7                : 1;
1180   } __LATBbits_t;
1181 
1182 extern __at(0x010D) volatile __LATBbits_t LATBbits;
1183 
1184 #define _LATB4                  0x10
1185 #define _LATB5                  0x20
1186 #define _LATB6                  0x40
1187 #define _LATB7                  0x80
1188 
1189 //==============================================================================
1190 
1191 
1192 //==============================================================================
1193 //        LATC Bits
1194 
1195 extern __at(0x010E) __sfr LATC;
1196 
1197 typedef struct
1198   {
1199   unsigned LATC0                : 1;
1200   unsigned LATC1                : 1;
1201   unsigned LATC2                : 1;
1202   unsigned LATC3                : 1;
1203   unsigned LATC4                : 1;
1204   unsigned LATC5                : 1;
1205   unsigned LATC6                : 1;
1206   unsigned LATC7                : 1;
1207   } __LATCbits_t;
1208 
1209 extern __at(0x010E) volatile __LATCbits_t LATCbits;
1210 
1211 #define _LATC0                  0x01
1212 #define _LATC1                  0x02
1213 #define _LATC2                  0x04
1214 #define _LATC3                  0x08
1215 #define _LATC4                  0x10
1216 #define _LATC5                  0x20
1217 #define _LATC6                  0x40
1218 #define _LATC7                  0x80
1219 
1220 //==============================================================================
1221 
1222 
1223 //==============================================================================
1224 //        CM1CON0 Bits
1225 
1226 extern __at(0x0111) __sfr CM1CON0;
1227 
1228 typedef struct
1229   {
1230   unsigned C1SYNC               : 1;
1231   unsigned C1HYS                : 1;
1232   unsigned C1SP                 : 1;
1233   unsigned                      : 1;
1234   unsigned C1POL                : 1;
1235   unsigned C1OE                 : 1;
1236   unsigned C1OUT                : 1;
1237   unsigned C1ON                 : 1;
1238   } __CM1CON0bits_t;
1239 
1240 extern __at(0x0111) volatile __CM1CON0bits_t CM1CON0bits;
1241 
1242 #define _C1SYNC                 0x01
1243 #define _C1HYS                  0x02
1244 #define _C1SP                   0x04
1245 #define _C1POL                  0x10
1246 #define _C1OE                   0x20
1247 #define _C1OUT                  0x40
1248 #define _C1ON                   0x80
1249 
1250 //==============================================================================
1251 
1252 
1253 //==============================================================================
1254 //        CM1CON1 Bits
1255 
1256 extern __at(0x0112) __sfr CM1CON1;
1257 
1258 typedef union
1259   {
1260   struct
1261     {
1262     unsigned C1NCH0             : 1;
1263     unsigned C1NCH1             : 1;
1264     unsigned C1NCH2             : 1;
1265     unsigned                    : 1;
1266     unsigned C1PCH0             : 1;
1267     unsigned C1PCH1             : 1;
1268     unsigned C1INTN             : 1;
1269     unsigned C1INTP             : 1;
1270     };
1271 
1272   struct
1273     {
1274     unsigned C1NCH              : 3;
1275     unsigned                    : 5;
1276     };
1277 
1278   struct
1279     {
1280     unsigned                    : 4;
1281     unsigned C1PCH              : 2;
1282     unsigned                    : 2;
1283     };
1284   } __CM1CON1bits_t;
1285 
1286 extern __at(0x0112) volatile __CM1CON1bits_t CM1CON1bits;
1287 
1288 #define _C1NCH0                 0x01
1289 #define _C1NCH1                 0x02
1290 #define _C1NCH2                 0x04
1291 #define _C1PCH0                 0x10
1292 #define _C1PCH1                 0x20
1293 #define _C1INTN                 0x40
1294 #define _C1INTP                 0x80
1295 
1296 //==============================================================================
1297 
1298 
1299 //==============================================================================
1300 //        CM2CON0 Bits
1301 
1302 extern __at(0x0113) __sfr CM2CON0;
1303 
1304 typedef struct
1305   {
1306   unsigned C2SYNC               : 1;
1307   unsigned C2HYS                : 1;
1308   unsigned C2SP                 : 1;
1309   unsigned                      : 1;
1310   unsigned C2POL                : 1;
1311   unsigned C2OE                 : 1;
1312   unsigned C2OUT                : 1;
1313   unsigned C2ON                 : 1;
1314   } __CM2CON0bits_t;
1315 
1316 extern __at(0x0113) volatile __CM2CON0bits_t CM2CON0bits;
1317 
1318 #define _C2SYNC                 0x01
1319 #define _C2HYS                  0x02
1320 #define _C2SP                   0x04
1321 #define _C2POL                  0x10
1322 #define _C2OE                   0x20
1323 #define _C2OUT                  0x40
1324 #define _C2ON                   0x80
1325 
1326 //==============================================================================
1327 
1328 
1329 //==============================================================================
1330 //        CM2CON1 Bits
1331 
1332 extern __at(0x0114) __sfr CM2CON1;
1333 
1334 typedef union
1335   {
1336   struct
1337     {
1338     unsigned C2NCH0             : 1;
1339     unsigned C2NCH1             : 1;
1340     unsigned C2NCH2             : 1;
1341     unsigned                    : 1;
1342     unsigned C2PCH0             : 1;
1343     unsigned C2PCH1             : 1;
1344     unsigned C2INTN             : 1;
1345     unsigned C2INTP             : 1;
1346     };
1347 
1348   struct
1349     {
1350     unsigned C2NCH              : 3;
1351     unsigned                    : 5;
1352     };
1353 
1354   struct
1355     {
1356     unsigned                    : 4;
1357     unsigned C2PCH              : 2;
1358     unsigned                    : 2;
1359     };
1360   } __CM2CON1bits_t;
1361 
1362 extern __at(0x0114) volatile __CM2CON1bits_t CM2CON1bits;
1363 
1364 #define _C2NCH0                 0x01
1365 #define _C2NCH1                 0x02
1366 #define _C2NCH2                 0x04
1367 #define _C2PCH0                 0x10
1368 #define _C2PCH1                 0x20
1369 #define _C2INTN                 0x40
1370 #define _C2INTP                 0x80
1371 
1372 //==============================================================================
1373 
1374 
1375 //==============================================================================
1376 //        CMOUT Bits
1377 
1378 extern __at(0x0115) __sfr CMOUT;
1379 
1380 typedef struct
1381   {
1382   unsigned MC1OUT               : 1;
1383   unsigned MC2OUT               : 1;
1384   unsigned                      : 1;
1385   unsigned                      : 1;
1386   unsigned                      : 1;
1387   unsigned                      : 1;
1388   unsigned                      : 1;
1389   unsigned                      : 1;
1390   } __CMOUTbits_t;
1391 
1392 extern __at(0x0115) volatile __CMOUTbits_t CMOUTbits;
1393 
1394 #define _MC1OUT                 0x01
1395 #define _MC2OUT                 0x02
1396 
1397 //==============================================================================
1398 
1399 
1400 //==============================================================================
1401 //        BORCON Bits
1402 
1403 extern __at(0x0116) __sfr BORCON;
1404 
1405 typedef struct
1406   {
1407   unsigned BORRDY               : 1;
1408   unsigned                      : 1;
1409   unsigned                      : 1;
1410   unsigned                      : 1;
1411   unsigned                      : 1;
1412   unsigned                      : 1;
1413   unsigned BORFS                : 1;
1414   unsigned SBOREN               : 1;
1415   } __BORCONbits_t;
1416 
1417 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1418 
1419 #define _BORRDY                 0x01
1420 #define _BORFS                  0x40
1421 #define _SBOREN                 0x80
1422 
1423 //==============================================================================
1424 
1425 
1426 //==============================================================================
1427 //        FVRCON Bits
1428 
1429 extern __at(0x0117) __sfr FVRCON;
1430 
1431 typedef union
1432   {
1433   struct
1434     {
1435     unsigned ADFVR0             : 1;
1436     unsigned ADFVR1             : 1;
1437     unsigned CDAFVR0            : 1;
1438     unsigned CDAFVR1            : 1;
1439     unsigned                    : 1;
1440     unsigned                    : 1;
1441     unsigned FVRRDY             : 1;
1442     unsigned FVREN              : 1;
1443     };
1444 
1445   struct
1446     {
1447     unsigned ADFVR              : 2;
1448     unsigned                    : 6;
1449     };
1450 
1451   struct
1452     {
1453     unsigned                    : 2;
1454     unsigned CDAFVR             : 2;
1455     unsigned                    : 4;
1456     };
1457   } __FVRCONbits_t;
1458 
1459 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1460 
1461 #define _ADFVR0                 0x01
1462 #define _ADFVR1                 0x02
1463 #define _CDAFVR0                0x04
1464 #define _CDAFVR1                0x08
1465 #define _FVRRDY                 0x40
1466 #define _FVREN                  0x80
1467 
1468 //==============================================================================
1469 
1470 
1471 //==============================================================================
1472 //        DACCON0 Bits
1473 
1474 extern __at(0x0118) __sfr DACCON0;
1475 
1476 typedef union
1477   {
1478   struct
1479     {
1480     unsigned                    : 1;
1481     unsigned                    : 1;
1482     unsigned D1PSS0             : 1;
1483     unsigned D1PSS1             : 1;
1484     unsigned DACOE2             : 1;
1485     unsigned DACOE1             : 1;
1486     unsigned                    : 1;
1487     unsigned DACEN              : 1;
1488     };
1489 
1490   struct
1491     {
1492     unsigned                    : 2;
1493     unsigned D1PSS              : 2;
1494     unsigned                    : 4;
1495     };
1496   } __DACCON0bits_t;
1497 
1498 extern __at(0x0118) volatile __DACCON0bits_t DACCON0bits;
1499 
1500 #define _D1PSS0                 0x04
1501 #define _D1PSS1                 0x08
1502 #define _DACOE2                 0x10
1503 #define _DACOE1                 0x20
1504 #define _DACEN                  0x80
1505 
1506 //==============================================================================
1507 
1508 
1509 //==============================================================================
1510 //        DACCON1 Bits
1511 
1512 extern __at(0x0119) __sfr DACCON1;
1513 
1514 typedef union
1515   {
1516   struct
1517     {
1518     unsigned DACR0              : 1;
1519     unsigned DACR1              : 1;
1520     unsigned DACR2              : 1;
1521     unsigned DACR3              : 1;
1522     unsigned DACR4              : 1;
1523     unsigned                    : 1;
1524     unsigned                    : 1;
1525     unsigned                    : 1;
1526     };
1527 
1528   struct
1529     {
1530     unsigned DACR               : 5;
1531     unsigned                    : 3;
1532     };
1533   } __DACCON1bits_t;
1534 
1535 extern __at(0x0119) volatile __DACCON1bits_t DACCON1bits;
1536 
1537 #define _DACR0                  0x01
1538 #define _DACR1                  0x02
1539 #define _DACR2                  0x04
1540 #define _DACR3                  0x08
1541 #define _DACR4                  0x10
1542 
1543 //==============================================================================
1544 
1545 
1546 //==============================================================================
1547 //        APFCON Bits
1548 
1549 extern __at(0x011D) __sfr APFCON;
1550 
1551 typedef struct
1552   {
1553   unsigned                      : 1;
1554   unsigned                      : 1;
1555   unsigned                      : 1;
1556   unsigned T1GSEL               : 1;
1557   unsigned                      : 1;
1558   unsigned SSSEL                : 1;
1559   unsigned                      : 1;
1560   unsigned CLKRSEL              : 1;
1561   } __APFCONbits_t;
1562 
1563 extern __at(0x011D) volatile __APFCONbits_t APFCONbits;
1564 
1565 #define _T1GSEL                 0x08
1566 #define _SSSEL                  0x20
1567 #define _CLKRSEL                0x80
1568 
1569 //==============================================================================
1570 
1571 
1572 //==============================================================================
1573 //        ANSELA Bits
1574 
1575 extern __at(0x018C) __sfr ANSELA;
1576 
1577 typedef struct
1578   {
1579   unsigned                      : 1;
1580   unsigned                      : 1;
1581   unsigned                      : 1;
1582   unsigned                      : 1;
1583   unsigned ANSA4                : 1;
1584   unsigned                      : 1;
1585   unsigned                      : 1;
1586   unsigned                      : 1;
1587   } __ANSELAbits_t;
1588 
1589 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1590 
1591 #define _ANSA4                  0x10
1592 
1593 //==============================================================================
1594 
1595 
1596 //==============================================================================
1597 //        ANSELB Bits
1598 
1599 extern __at(0x018D) __sfr ANSELB;
1600 
1601 typedef struct
1602   {
1603   unsigned                      : 1;
1604   unsigned                      : 1;
1605   unsigned                      : 1;
1606   unsigned                      : 1;
1607   unsigned ANSB4                : 1;
1608   unsigned ANSB5                : 1;
1609   unsigned                      : 1;
1610   unsigned                      : 1;
1611   } __ANSELBbits_t;
1612 
1613 extern __at(0x018D) volatile __ANSELBbits_t ANSELBbits;
1614 
1615 #define _ANSB4                  0x10
1616 #define _ANSB5                  0x20
1617 
1618 //==============================================================================
1619 
1620 
1621 //==============================================================================
1622 //        ANSELC Bits
1623 
1624 extern __at(0x018E) __sfr ANSELC;
1625 
1626 typedef struct
1627   {
1628   unsigned ANSC0                : 1;
1629   unsigned ANSC1                : 1;
1630   unsigned ANSC2                : 1;
1631   unsigned ANSC3                : 1;
1632   unsigned                      : 1;
1633   unsigned                      : 1;
1634   unsigned ANSC6                : 1;
1635   unsigned ANSC7                : 1;
1636   } __ANSELCbits_t;
1637 
1638 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits;
1639 
1640 #define _ANSC0                  0x01
1641 #define _ANSC1                  0x02
1642 #define _ANSC2                  0x04
1643 #define _ANSC3                  0x08
1644 #define _ANSC6                  0x40
1645 #define _ANSC7                  0x80
1646 
1647 //==============================================================================
1648 
1649 extern __at(0x0191) __sfr PMADR;
1650 extern __at(0x0191) __sfr PMADRL;
1651 extern __at(0x0192) __sfr PMADRH;
1652 extern __at(0x0193) __sfr PMDAT;
1653 extern __at(0x0193) __sfr PMDATL;
1654 extern __at(0x0194) __sfr PMDATH;
1655 
1656 //==============================================================================
1657 //        PMCON1 Bits
1658 
1659 extern __at(0x0195) __sfr PMCON1;
1660 
1661 typedef struct
1662   {
1663   unsigned RD                   : 1;
1664   unsigned WR                   : 1;
1665   unsigned WREN                 : 1;
1666   unsigned WRERR                : 1;
1667   unsigned FREE                 : 1;
1668   unsigned LWLO                 : 1;
1669   unsigned CFGS                 : 1;
1670   unsigned                      : 1;
1671   } __PMCON1bits_t;
1672 
1673 extern __at(0x0195) volatile __PMCON1bits_t PMCON1bits;
1674 
1675 #define _RD                     0x01
1676 #define _WR                     0x02
1677 #define _WREN                   0x04
1678 #define _WRERR                  0x08
1679 #define _FREE                   0x10
1680 #define _LWLO                   0x20
1681 #define _CFGS                   0x40
1682 
1683 //==============================================================================
1684 
1685 extern __at(0x0196) __sfr PMCON2;
1686 extern __at(0x0199) __sfr RCREG;
1687 extern __at(0x019A) __sfr TXREG;
1688 extern __at(0x019B) __sfr SPBRGL;
1689 extern __at(0x019C) __sfr SPBRGH;
1690 
1691 //==============================================================================
1692 //        RCSTA Bits
1693 
1694 extern __at(0x019D) __sfr RCSTA;
1695 
1696 typedef struct
1697   {
1698   unsigned RX9D                 : 1;
1699   unsigned OERR                 : 1;
1700   unsigned FERR                 : 1;
1701   unsigned ADDEN                : 1;
1702   unsigned CREN                 : 1;
1703   unsigned SREN                 : 1;
1704   unsigned RX9                  : 1;
1705   unsigned SPEN                 : 1;
1706   } __RCSTAbits_t;
1707 
1708 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
1709 
1710 #define _RX9D                   0x01
1711 #define _OERR                   0x02
1712 #define _FERR                   0x04
1713 #define _ADDEN                  0x08
1714 #define _CREN                   0x10
1715 #define _SREN                   0x20
1716 #define _RX9                    0x40
1717 #define _SPEN                   0x80
1718 
1719 //==============================================================================
1720 
1721 
1722 //==============================================================================
1723 //        TXSTA Bits
1724 
1725 extern __at(0x019E) __sfr TXSTA;
1726 
1727 typedef struct
1728   {
1729   unsigned TX9D                 : 1;
1730   unsigned TRMT                 : 1;
1731   unsigned BRGH                 : 1;
1732   unsigned SENDB                : 1;
1733   unsigned SYNC                 : 1;
1734   unsigned TXEN                 : 1;
1735   unsigned TX9                  : 1;
1736   unsigned CSRC                 : 1;
1737   } __TXSTAbits_t;
1738 
1739 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
1740 
1741 #define _TX9D                   0x01
1742 #define _TRMT                   0x02
1743 #define _BRGH                   0x04
1744 #define _SENDB                  0x08
1745 #define _SYNC                   0x10
1746 #define _TXEN                   0x20
1747 #define _TX9                    0x40
1748 #define _CSRC                   0x80
1749 
1750 //==============================================================================
1751 
1752 
1753 //==============================================================================
1754 //        BAUDCON Bits
1755 
1756 extern __at(0x019F) __sfr BAUDCON;
1757 
1758 typedef struct
1759   {
1760   unsigned ABDEN                : 1;
1761   unsigned WUE                  : 1;
1762   unsigned                      : 1;
1763   unsigned BRG16                : 1;
1764   unsigned SCKP                 : 1;
1765   unsigned                      : 1;
1766   unsigned RCIDL                : 1;
1767   unsigned ABDOVF               : 1;
1768   } __BAUDCONbits_t;
1769 
1770 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
1771 
1772 #define _ABDEN                  0x01
1773 #define _WUE                    0x02
1774 #define _BRG16                  0x08
1775 #define _SCKP                   0x10
1776 #define _RCIDL                  0x40
1777 #define _ABDOVF                 0x80
1778 
1779 //==============================================================================
1780 
1781 
1782 //==============================================================================
1783 //        WPUA Bits
1784 
1785 extern __at(0x020C) __sfr WPUA;
1786 
1787 typedef struct
1788   {
1789   unsigned                      : 1;
1790   unsigned                      : 1;
1791   unsigned                      : 1;
1792   unsigned WPUA3                : 1;
1793   unsigned WPUA4                : 1;
1794   unsigned WPUA5                : 1;
1795   unsigned                      : 1;
1796   unsigned                      : 1;
1797   } __WPUAbits_t;
1798 
1799 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
1800 
1801 #define _WPUA3                  0x08
1802 #define _WPUA4                  0x10
1803 #define _WPUA5                  0x20
1804 
1805 //==============================================================================
1806 
1807 
1808 //==============================================================================
1809 //        WPUB Bits
1810 
1811 extern __at(0x020D) __sfr WPUB;
1812 
1813 typedef struct
1814   {
1815   unsigned                      : 1;
1816   unsigned                      : 1;
1817   unsigned                      : 1;
1818   unsigned                      : 1;
1819   unsigned WPUB4                : 1;
1820   unsigned WPUB5                : 1;
1821   unsigned WPUB6                : 1;
1822   unsigned WPUB7                : 1;
1823   } __WPUBbits_t;
1824 
1825 extern __at(0x020D) volatile __WPUBbits_t WPUBbits;
1826 
1827 #define _WPUB4                  0x10
1828 #define _WPUB5                  0x20
1829 #define _WPUB6                  0x40
1830 #define _WPUB7                  0x80
1831 
1832 //==============================================================================
1833 
1834 extern __at(0x0211) __sfr SSP1BUF;
1835 extern __at(0x0211) __sfr SSPBUF;
1836 extern __at(0x0212) __sfr SSP1ADD;
1837 extern __at(0x0212) __sfr SSPADD;
1838 extern __at(0x0213) __sfr SSP1MSK;
1839 extern __at(0x0213) __sfr SSPMSK;
1840 
1841 //==============================================================================
1842 //        SSP1STAT Bits
1843 
1844 extern __at(0x0214) __sfr SSP1STAT;
1845 
1846 typedef struct
1847   {
1848   unsigned BF                   : 1;
1849   unsigned UA                   : 1;
1850   unsigned R_NOT_W              : 1;
1851   unsigned S                    : 1;
1852   unsigned P                    : 1;
1853   unsigned D_NOT_A              : 1;
1854   unsigned CKE                  : 1;
1855   unsigned SMP                  : 1;
1856   } __SSP1STATbits_t;
1857 
1858 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
1859 
1860 #define _BF                     0x01
1861 #define _UA                     0x02
1862 #define _R_NOT_W                0x04
1863 #define _S                      0x08
1864 #define _P                      0x10
1865 #define _D_NOT_A                0x20
1866 #define _CKE                    0x40
1867 #define _SMP                    0x80
1868 
1869 //==============================================================================
1870 
1871 
1872 //==============================================================================
1873 //        SSPSTAT Bits
1874 
1875 extern __at(0x0214) __sfr SSPSTAT;
1876 
1877 typedef struct
1878   {
1879   unsigned BF                   : 1;
1880   unsigned UA                   : 1;
1881   unsigned R_NOT_W              : 1;
1882   unsigned S                    : 1;
1883   unsigned P                    : 1;
1884   unsigned D_NOT_A              : 1;
1885   unsigned CKE                  : 1;
1886   unsigned SMP                  : 1;
1887   } __SSPSTATbits_t;
1888 
1889 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
1890 
1891 #define _SSPSTAT_BF             0x01
1892 #define _SSPSTAT_UA             0x02
1893 #define _SSPSTAT_R_NOT_W        0x04
1894 #define _SSPSTAT_S              0x08
1895 #define _SSPSTAT_P              0x10
1896 #define _SSPSTAT_D_NOT_A        0x20
1897 #define _SSPSTAT_CKE            0x40
1898 #define _SSPSTAT_SMP            0x80
1899 
1900 //==============================================================================
1901 
1902 
1903 //==============================================================================
1904 //        SSP1CON1 Bits
1905 
1906 extern __at(0x0215) __sfr SSP1CON1;
1907 
1908 typedef union
1909   {
1910   struct
1911     {
1912     unsigned SSP1M0             : 1;
1913     unsigned SSP1M1             : 1;
1914     unsigned SSP1M2             : 1;
1915     unsigned SSP1M3             : 1;
1916     unsigned CKP                : 1;
1917     unsigned SSP1EN             : 1;
1918     unsigned SSP1OV             : 1;
1919     unsigned WCOL               : 1;
1920     };
1921 
1922   struct
1923     {
1924     unsigned SSP1M              : 4;
1925     unsigned                    : 4;
1926     };
1927   } __SSP1CON1bits_t;
1928 
1929 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
1930 
1931 #define _SSP1M0                 0x01
1932 #define _SSP1M1                 0x02
1933 #define _SSP1M2                 0x04
1934 #define _SSP1M3                 0x08
1935 #define _CKP                    0x10
1936 #define _SSP1EN                 0x20
1937 #define _SSP1OV                 0x40
1938 #define _WCOL                   0x80
1939 
1940 //==============================================================================
1941 
1942 
1943 //==============================================================================
1944 //        SSPCON Bits
1945 
1946 extern __at(0x0215) __sfr SSPCON;
1947 
1948 typedef union
1949   {
1950   struct
1951     {
1952     unsigned SSP1M0             : 1;
1953     unsigned SSP1M1             : 1;
1954     unsigned SSP1M2             : 1;
1955     unsigned SSP1M3             : 1;
1956     unsigned CKP                : 1;
1957     unsigned SSP1EN             : 1;
1958     unsigned SSP1OV             : 1;
1959     unsigned WCOL               : 1;
1960     };
1961 
1962   struct
1963     {
1964     unsigned SSP1M              : 4;
1965     unsigned                    : 4;
1966     };
1967   } __SSPCONbits_t;
1968 
1969 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
1970 
1971 #define _SSPCON_SSP1M0          0x01
1972 #define _SSPCON_SSP1M1          0x02
1973 #define _SSPCON_SSP1M2          0x04
1974 #define _SSPCON_SSP1M3          0x08
1975 #define _SSPCON_CKP             0x10
1976 #define _SSPCON_SSP1EN          0x20
1977 #define _SSPCON_SSP1OV          0x40
1978 #define _SSPCON_WCOL            0x80
1979 
1980 //==============================================================================
1981 
1982 
1983 //==============================================================================
1984 //        SSPCON1 Bits
1985 
1986 extern __at(0x0215) __sfr SSPCON1;
1987 
1988 typedef union
1989   {
1990   struct
1991     {
1992     unsigned SSP1M0             : 1;
1993     unsigned SSP1M1             : 1;
1994     unsigned SSP1M2             : 1;
1995     unsigned SSP1M3             : 1;
1996     unsigned CKP                : 1;
1997     unsigned SSP1EN             : 1;
1998     unsigned SSP1OV             : 1;
1999     unsigned WCOL               : 1;
2000     };
2001 
2002   struct
2003     {
2004     unsigned SSP1M              : 4;
2005     unsigned                    : 4;
2006     };
2007   } __SSPCON1bits_t;
2008 
2009 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
2010 
2011 #define _SSPCON1_SSP1M0         0x01
2012 #define _SSPCON1_SSP1M1         0x02
2013 #define _SSPCON1_SSP1M2         0x04
2014 #define _SSPCON1_SSP1M3         0x08
2015 #define _SSPCON1_CKP            0x10
2016 #define _SSPCON1_SSP1EN         0x20
2017 #define _SSPCON1_SSP1OV         0x40
2018 #define _SSPCON1_WCOL           0x80
2019 
2020 //==============================================================================
2021 
2022 
2023 //==============================================================================
2024 //        SSP1CON2 Bits
2025 
2026 extern __at(0x0216) __sfr SSP1CON2;
2027 
2028 typedef struct
2029   {
2030   unsigned SEN                  : 1;
2031   unsigned RSEN                 : 1;
2032   unsigned PEN                  : 1;
2033   unsigned RCEN                 : 1;
2034   unsigned ACKEN                : 1;
2035   unsigned ACKDT                : 1;
2036   unsigned ACKSTAT              : 1;
2037   unsigned GCEN                 : 1;
2038   } __SSP1CON2bits_t;
2039 
2040 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
2041 
2042 #define _SEN                    0x01
2043 #define _RSEN                   0x02
2044 #define _PEN                    0x04
2045 #define _RCEN                   0x08
2046 #define _ACKEN                  0x10
2047 #define _ACKDT                  0x20
2048 #define _ACKSTAT                0x40
2049 #define _GCEN                   0x80
2050 
2051 //==============================================================================
2052 
2053 
2054 //==============================================================================
2055 //        SSPCON2 Bits
2056 
2057 extern __at(0x0216) __sfr SSPCON2;
2058 
2059 typedef struct
2060   {
2061   unsigned SEN                  : 1;
2062   unsigned RSEN                 : 1;
2063   unsigned PEN                  : 1;
2064   unsigned RCEN                 : 1;
2065   unsigned ACKEN                : 1;
2066   unsigned ACKDT                : 1;
2067   unsigned ACKSTAT              : 1;
2068   unsigned GCEN                 : 1;
2069   } __SSPCON2bits_t;
2070 
2071 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
2072 
2073 #define _SSPCON2_SEN            0x01
2074 #define _SSPCON2_RSEN           0x02
2075 #define _SSPCON2_PEN            0x04
2076 #define _SSPCON2_RCEN           0x08
2077 #define _SSPCON2_ACKEN          0x10
2078 #define _SSPCON2_ACKDT          0x20
2079 #define _SSPCON2_ACKSTAT        0x40
2080 #define _SSPCON2_GCEN           0x80
2081 
2082 //==============================================================================
2083 
2084 
2085 //==============================================================================
2086 //        SSP1CON3 Bits
2087 
2088 extern __at(0x0217) __sfr SSP1CON3;
2089 
2090 typedef struct
2091   {
2092   unsigned DHEN                 : 1;
2093   unsigned AHEN                 : 1;
2094   unsigned SBCDE                : 1;
2095   unsigned SDAHT                : 1;
2096   unsigned BOEN                 : 1;
2097   unsigned SCIE                 : 1;
2098   unsigned PCIE                 : 1;
2099   unsigned ACKTIM               : 1;
2100   } __SSP1CON3bits_t;
2101 
2102 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
2103 
2104 #define _DHEN                   0x01
2105 #define _AHEN                   0x02
2106 #define _SBCDE                  0x04
2107 #define _SDAHT                  0x08
2108 #define _BOEN                   0x10
2109 #define _SCIE                   0x20
2110 #define _PCIE                   0x40
2111 #define _ACKTIM                 0x80
2112 
2113 //==============================================================================
2114 
2115 
2116 //==============================================================================
2117 //        SSPCON3 Bits
2118 
2119 extern __at(0x0217) __sfr SSPCON3;
2120 
2121 typedef struct
2122   {
2123   unsigned DHEN                 : 1;
2124   unsigned AHEN                 : 1;
2125   unsigned SBCDE                : 1;
2126   unsigned SDAHT                : 1;
2127   unsigned BOEN                 : 1;
2128   unsigned SCIE                 : 1;
2129   unsigned PCIE                 : 1;
2130   unsigned ACKTIM               : 1;
2131   } __SSPCON3bits_t;
2132 
2133 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
2134 
2135 #define _SSPCON3_DHEN           0x01
2136 #define _SSPCON3_AHEN           0x02
2137 #define _SSPCON3_SBCDE          0x04
2138 #define _SSPCON3_SDAHT          0x08
2139 #define _SSPCON3_BOEN           0x10
2140 #define _SSPCON3_SCIE           0x20
2141 #define _SSPCON3_PCIE           0x40
2142 #define _SSPCON3_ACKTIM         0x80
2143 
2144 //==============================================================================
2145 
2146 
2147 //==============================================================================
2148 //        IOCAP Bits
2149 
2150 extern __at(0x0391) __sfr IOCAP;
2151 
2152 typedef struct
2153   {
2154   unsigned IOCAP0               : 1;
2155   unsigned IOCAP1               : 1;
2156   unsigned                      : 1;
2157   unsigned IOCAP3               : 1;
2158   unsigned IOCAP4               : 1;
2159   unsigned IOCAP5               : 1;
2160   unsigned                      : 1;
2161   unsigned                      : 1;
2162   } __IOCAPbits_t;
2163 
2164 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits;
2165 
2166 #define _IOCAP0                 0x01
2167 #define _IOCAP1                 0x02
2168 #define _IOCAP3                 0x08
2169 #define _IOCAP4                 0x10
2170 #define _IOCAP5                 0x20
2171 
2172 //==============================================================================
2173 
2174 
2175 //==============================================================================
2176 //        IOCAN Bits
2177 
2178 extern __at(0x0392) __sfr IOCAN;
2179 
2180 typedef struct
2181   {
2182   unsigned IOCAN0               : 1;
2183   unsigned IOCAN1               : 1;
2184   unsigned                      : 1;
2185   unsigned IOCAN3               : 1;
2186   unsigned IOCAN4               : 1;
2187   unsigned IOCAN5               : 1;
2188   unsigned                      : 1;
2189   unsigned                      : 1;
2190   } __IOCANbits_t;
2191 
2192 extern __at(0x0392) volatile __IOCANbits_t IOCANbits;
2193 
2194 #define _IOCAN0                 0x01
2195 #define _IOCAN1                 0x02
2196 #define _IOCAN3                 0x08
2197 #define _IOCAN4                 0x10
2198 #define _IOCAN5                 0x20
2199 
2200 //==============================================================================
2201 
2202 
2203 //==============================================================================
2204 //        IOCAF Bits
2205 
2206 extern __at(0x0393) __sfr IOCAF;
2207 
2208 typedef struct
2209   {
2210   unsigned IOCAF0               : 1;
2211   unsigned IOCAF1               : 1;
2212   unsigned                      : 1;
2213   unsigned IOCAF3               : 1;
2214   unsigned IOCAF4               : 1;
2215   unsigned IOCAF5               : 1;
2216   unsigned                      : 1;
2217   unsigned                      : 1;
2218   } __IOCAFbits_t;
2219 
2220 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits;
2221 
2222 #define _IOCAF0                 0x01
2223 #define _IOCAF1                 0x02
2224 #define _IOCAF3                 0x08
2225 #define _IOCAF4                 0x10
2226 #define _IOCAF5                 0x20
2227 
2228 //==============================================================================
2229 
2230 
2231 //==============================================================================
2232 //        IOCBP Bits
2233 
2234 extern __at(0x0394) __sfr IOCBP;
2235 
2236 typedef struct
2237   {
2238   unsigned                      : 1;
2239   unsigned                      : 1;
2240   unsigned                      : 1;
2241   unsigned                      : 1;
2242   unsigned IOCBP4               : 1;
2243   unsigned IOCBP5               : 1;
2244   unsigned IOCBP6               : 1;
2245   unsigned IOCBP7               : 1;
2246   } __IOCBPbits_t;
2247 
2248 extern __at(0x0394) volatile __IOCBPbits_t IOCBPbits;
2249 
2250 #define _IOCBP4                 0x10
2251 #define _IOCBP5                 0x20
2252 #define _IOCBP6                 0x40
2253 #define _IOCBP7                 0x80
2254 
2255 //==============================================================================
2256 
2257 
2258 //==============================================================================
2259 //        IOCBN Bits
2260 
2261 extern __at(0x0395) __sfr IOCBN;
2262 
2263 typedef struct
2264   {
2265   unsigned                      : 1;
2266   unsigned                      : 1;
2267   unsigned                      : 1;
2268   unsigned                      : 1;
2269   unsigned IOCBN4               : 1;
2270   unsigned IOCBN5               : 1;
2271   unsigned IOCBN6               : 1;
2272   unsigned IOCBN7               : 1;
2273   } __IOCBNbits_t;
2274 
2275 extern __at(0x0395) volatile __IOCBNbits_t IOCBNbits;
2276 
2277 #define _IOCBN4                 0x10
2278 #define _IOCBN5                 0x20
2279 #define _IOCBN6                 0x40
2280 #define _IOCBN7                 0x80
2281 
2282 //==============================================================================
2283 
2284 
2285 //==============================================================================
2286 //        IOCBF Bits
2287 
2288 extern __at(0x0396) __sfr IOCBF;
2289 
2290 typedef struct
2291   {
2292   unsigned                      : 1;
2293   unsigned                      : 1;
2294   unsigned                      : 1;
2295   unsigned                      : 1;
2296   unsigned IOCBF4               : 1;
2297   unsigned IOCBF5               : 1;
2298   unsigned IOCBF6               : 1;
2299   unsigned IOCBF7               : 1;
2300   } __IOCBFbits_t;
2301 
2302 extern __at(0x0396) volatile __IOCBFbits_t IOCBFbits;
2303 
2304 #define _IOCBF4                 0x10
2305 #define _IOCBF5                 0x20
2306 #define _IOCBF6                 0x40
2307 #define _IOCBF7                 0x80
2308 
2309 //==============================================================================
2310 
2311 
2312 //==============================================================================
2313 //        CLKRCON Bits
2314 
2315 extern __at(0x039A) __sfr CLKRCON;
2316 
2317 typedef union
2318   {
2319   struct
2320     {
2321     unsigned CLKRDIV0           : 1;
2322     unsigned CLKRDIV1           : 1;
2323     unsigned CLKRDIV2           : 1;
2324     unsigned CLKRCD0            : 1;
2325     unsigned CLKRCD1            : 1;
2326     unsigned CLKRSLR            : 1;
2327     unsigned CLKROE             : 1;
2328     unsigned CLKREN             : 1;
2329     };
2330 
2331   struct
2332     {
2333     unsigned CLKRDIV            : 3;
2334     unsigned                    : 5;
2335     };
2336 
2337   struct
2338     {
2339     unsigned                    : 3;
2340     unsigned CLKRCD             : 2;
2341     unsigned                    : 3;
2342     };
2343   } __CLKRCONbits_t;
2344 
2345 extern __at(0x039A) volatile __CLKRCONbits_t CLKRCONbits;
2346 
2347 #define _CLKRDIV0               0x01
2348 #define _CLKRDIV1               0x02
2349 #define _CLKRDIV2               0x04
2350 #define _CLKRCD0                0x08
2351 #define _CLKRCD1                0x10
2352 #define _CLKRSLR                0x20
2353 #define _CLKROE                 0x40
2354 #define _CLKREN                 0x80
2355 
2356 //==============================================================================
2357 
2358 
2359 //==============================================================================
2360 //        CRCON Bits
2361 
2362 extern __at(0x039B) __sfr CRCON;
2363 
2364 typedef struct
2365   {
2366   unsigned                      : 1;
2367   unsigned CPFAIL               : 1;
2368   unsigned                      : 1;
2369   unsigned CRLOCK               : 1;
2370   unsigned CRSRC                : 1;
2371   unsigned                      : 1;
2372   unsigned CRUPDIS              : 1;
2373   unsigned CRON                 : 1;
2374   } __CRCONbits_t;
2375 
2376 extern __at(0x039B) volatile __CRCONbits_t CRCONbits;
2377 
2378 #define _CPFAIL                 0x02
2379 #define _CRLOCK                 0x08
2380 #define _CRSRC                  0x10
2381 #define _CRUPDIS                0x40
2382 #define _CRON                   0x80
2383 
2384 //==============================================================================
2385 
2386 
2387 //==============================================================================
2388 //        PWM1DCL Bits
2389 
2390 extern __at(0x0611) __sfr PWM1DCL;
2391 
2392 typedef union
2393   {
2394   struct
2395     {
2396     unsigned                    : 1;
2397     unsigned                    : 1;
2398     unsigned                    : 1;
2399     unsigned                    : 1;
2400     unsigned                    : 1;
2401     unsigned                    : 1;
2402     unsigned PWM1DCL0           : 1;
2403     unsigned PWM1DCL1           : 1;
2404     };
2405 
2406   struct
2407     {
2408     unsigned                    : 6;
2409     unsigned PWM1DCL            : 2;
2410     };
2411   } __PWM1DCLbits_t;
2412 
2413 extern __at(0x0611) volatile __PWM1DCLbits_t PWM1DCLbits;
2414 
2415 #define _PWM1DCL0               0x40
2416 #define _PWM1DCL1               0x80
2417 
2418 //==============================================================================
2419 
2420 
2421 //==============================================================================
2422 //        PWM1DCH Bits
2423 
2424 extern __at(0x0612) __sfr PWM1DCH;
2425 
2426 typedef struct
2427   {
2428   unsigned PWM1DCH0             : 1;
2429   unsigned PWM1DCH1             : 1;
2430   unsigned PWM1DCH2             : 1;
2431   unsigned PWM1DCH3             : 1;
2432   unsigned PWM1DCH4             : 1;
2433   unsigned PWM1DCH5             : 1;
2434   unsigned PWM1DCH6             : 1;
2435   unsigned PWM1DCH7             : 1;
2436   } __PWM1DCHbits_t;
2437 
2438 extern __at(0x0612) volatile __PWM1DCHbits_t PWM1DCHbits;
2439 
2440 #define _PWM1DCH0               0x01
2441 #define _PWM1DCH1               0x02
2442 #define _PWM1DCH2               0x04
2443 #define _PWM1DCH3               0x08
2444 #define _PWM1DCH4               0x10
2445 #define _PWM1DCH5               0x20
2446 #define _PWM1DCH6               0x40
2447 #define _PWM1DCH7               0x80
2448 
2449 //==============================================================================
2450 
2451 
2452 //==============================================================================
2453 //        PWM1CON Bits
2454 
2455 extern __at(0x0613) __sfr PWM1CON;
2456 
2457 typedef struct
2458   {
2459   unsigned                      : 1;
2460   unsigned                      : 1;
2461   unsigned                      : 1;
2462   unsigned                      : 1;
2463   unsigned PWM1POL              : 1;
2464   unsigned PWM1OUT              : 1;
2465   unsigned PWM1OE               : 1;
2466   unsigned PWM1EN               : 1;
2467   } __PWM1CONbits_t;
2468 
2469 extern __at(0x0613) volatile __PWM1CONbits_t PWM1CONbits;
2470 
2471 #define _PWM1POL                0x10
2472 #define _PWM1OUT                0x20
2473 #define _PWM1OE                 0x40
2474 #define _PWM1EN                 0x80
2475 
2476 //==============================================================================
2477 
2478 
2479 //==============================================================================
2480 //        PWM1CON0 Bits
2481 
2482 extern __at(0x0613) __sfr PWM1CON0;
2483 
2484 typedef struct
2485   {
2486   unsigned                      : 1;
2487   unsigned                      : 1;
2488   unsigned                      : 1;
2489   unsigned                      : 1;
2490   unsigned PWM1POL              : 1;
2491   unsigned PWM1OUT              : 1;
2492   unsigned PWM1OE               : 1;
2493   unsigned PWM1EN               : 1;
2494   } __PWM1CON0bits_t;
2495 
2496 extern __at(0x0613) volatile __PWM1CON0bits_t PWM1CON0bits;
2497 
2498 #define _PWM1CON0_PWM1POL       0x10
2499 #define _PWM1CON0_PWM1OUT       0x20
2500 #define _PWM1CON0_PWM1OE        0x40
2501 #define _PWM1CON0_PWM1EN        0x80
2502 
2503 //==============================================================================
2504 
2505 
2506 //==============================================================================
2507 //        PWM2DCL Bits
2508 
2509 extern __at(0x0614) __sfr PWM2DCL;
2510 
2511 typedef union
2512   {
2513   struct
2514     {
2515     unsigned                    : 1;
2516     unsigned                    : 1;
2517     unsigned                    : 1;
2518     unsigned                    : 1;
2519     unsigned                    : 1;
2520     unsigned                    : 1;
2521     unsigned PWM2DCL0           : 1;
2522     unsigned PWM2DCL1           : 1;
2523     };
2524 
2525   struct
2526     {
2527     unsigned                    : 6;
2528     unsigned PWM2DCL            : 2;
2529     };
2530   } __PWM2DCLbits_t;
2531 
2532 extern __at(0x0614) volatile __PWM2DCLbits_t PWM2DCLbits;
2533 
2534 #define _PWM2DCL0               0x40
2535 #define _PWM2DCL1               0x80
2536 
2537 //==============================================================================
2538 
2539 
2540 //==============================================================================
2541 //        PWM2DCH Bits
2542 
2543 extern __at(0x0615) __sfr PWM2DCH;
2544 
2545 typedef struct
2546   {
2547   unsigned PWM2DCH0             : 1;
2548   unsigned PWM2DCH1             : 1;
2549   unsigned PWM2DCH2             : 1;
2550   unsigned PWM2DCH3             : 1;
2551   unsigned PWM2DCH4             : 1;
2552   unsigned PWM2DCH5             : 1;
2553   unsigned PWM2DCH6             : 1;
2554   unsigned PWM2DCH7             : 1;
2555   } __PWM2DCHbits_t;
2556 
2557 extern __at(0x0615) volatile __PWM2DCHbits_t PWM2DCHbits;
2558 
2559 #define _PWM2DCH0               0x01
2560 #define _PWM2DCH1               0x02
2561 #define _PWM2DCH2               0x04
2562 #define _PWM2DCH3               0x08
2563 #define _PWM2DCH4               0x10
2564 #define _PWM2DCH5               0x20
2565 #define _PWM2DCH6               0x40
2566 #define _PWM2DCH7               0x80
2567 
2568 //==============================================================================
2569 
2570 
2571 //==============================================================================
2572 //        PWM2CON Bits
2573 
2574 extern __at(0x0616) __sfr PWM2CON;
2575 
2576 typedef struct
2577   {
2578   unsigned                      : 1;
2579   unsigned                      : 1;
2580   unsigned                      : 1;
2581   unsigned                      : 1;
2582   unsigned PWM2POL              : 1;
2583   unsigned PWM2OUT              : 1;
2584   unsigned PWM2OE               : 1;
2585   unsigned PWM2EN               : 1;
2586   } __PWM2CONbits_t;
2587 
2588 extern __at(0x0616) volatile __PWM2CONbits_t PWM2CONbits;
2589 
2590 #define _PWM2POL                0x10
2591 #define _PWM2OUT                0x20
2592 #define _PWM2OE                 0x40
2593 #define _PWM2EN                 0x80
2594 
2595 //==============================================================================
2596 
2597 
2598 //==============================================================================
2599 //        CWG1DBR Bits
2600 
2601 extern __at(0x0691) __sfr CWG1DBR;
2602 
2603 typedef union
2604   {
2605   struct
2606     {
2607     unsigned CWG1DBR0           : 1;
2608     unsigned CWG1DBR1           : 1;
2609     unsigned CWG1DBR2           : 1;
2610     unsigned CWG1DBR3           : 1;
2611     unsigned CWG1DBR4           : 1;
2612     unsigned CWG1DBR5           : 1;
2613     unsigned                    : 1;
2614     unsigned                    : 1;
2615     };
2616 
2617   struct
2618     {
2619     unsigned CWG1DBR            : 6;
2620     unsigned                    : 2;
2621     };
2622   } __CWG1DBRbits_t;
2623 
2624 extern __at(0x0691) volatile __CWG1DBRbits_t CWG1DBRbits;
2625 
2626 #define _CWG1DBR0               0x01
2627 #define _CWG1DBR1               0x02
2628 #define _CWG1DBR2               0x04
2629 #define _CWG1DBR3               0x08
2630 #define _CWG1DBR4               0x10
2631 #define _CWG1DBR5               0x20
2632 
2633 //==============================================================================
2634 
2635 
2636 //==============================================================================
2637 //        CWG1DBF Bits
2638 
2639 extern __at(0x0692) __sfr CWG1DBF;
2640 
2641 typedef union
2642   {
2643   struct
2644     {
2645     unsigned CWG1DBF0           : 1;
2646     unsigned CWG1DBF1           : 1;
2647     unsigned CWG1DBF2           : 1;
2648     unsigned CWG1DBF3           : 1;
2649     unsigned CWG1DBF4           : 1;
2650     unsigned CWG1DBF5           : 1;
2651     unsigned                    : 1;
2652     unsigned                    : 1;
2653     };
2654 
2655   struct
2656     {
2657     unsigned CWG1DBF            : 6;
2658     unsigned                    : 2;
2659     };
2660   } __CWG1DBFbits_t;
2661 
2662 extern __at(0x0692) volatile __CWG1DBFbits_t CWG1DBFbits;
2663 
2664 #define _CWG1DBF0               0x01
2665 #define _CWG1DBF1               0x02
2666 #define _CWG1DBF2               0x04
2667 #define _CWG1DBF3               0x08
2668 #define _CWG1DBF4               0x10
2669 #define _CWG1DBF5               0x20
2670 
2671 //==============================================================================
2672 
2673 
2674 //==============================================================================
2675 //        CWG1CON0 Bits
2676 
2677 extern __at(0x0693) __sfr CWG1CON0;
2678 
2679 typedef struct
2680   {
2681   unsigned G1CS0                : 1;
2682   unsigned                      : 1;
2683   unsigned                      : 1;
2684   unsigned G1POLA               : 1;
2685   unsigned G1POLB               : 1;
2686   unsigned G1OEA                : 1;
2687   unsigned G1OEB                : 1;
2688   unsigned G1EN                 : 1;
2689   } __CWG1CON0bits_t;
2690 
2691 extern __at(0x0693) volatile __CWG1CON0bits_t CWG1CON0bits;
2692 
2693 #define _G1CS0                  0x01
2694 #define _G1POLA                 0x08
2695 #define _G1POLB                 0x10
2696 #define _G1OEA                  0x20
2697 #define _G1OEB                  0x40
2698 #define _G1EN                   0x80
2699 
2700 //==============================================================================
2701 
2702 
2703 //==============================================================================
2704 //        CWG1CON1 Bits
2705 
2706 extern __at(0x0694) __sfr CWG1CON1;
2707 
2708 typedef union
2709   {
2710   struct
2711     {
2712     unsigned G1IS0              : 1;
2713     unsigned G1IS1              : 1;
2714     unsigned                    : 1;
2715     unsigned                    : 1;
2716     unsigned G1ASDLA0           : 1;
2717     unsigned G1ASDLA1           : 1;
2718     unsigned G1ASDLB0           : 1;
2719     unsigned G1ASDLB1           : 1;
2720     };
2721 
2722   struct
2723     {
2724     unsigned G1IS               : 2;
2725     unsigned                    : 6;
2726     };
2727 
2728   struct
2729     {
2730     unsigned                    : 4;
2731     unsigned G1ASDLA            : 2;
2732     unsigned                    : 2;
2733     };
2734 
2735   struct
2736     {
2737     unsigned                    : 6;
2738     unsigned G1ASDLB            : 2;
2739     };
2740   } __CWG1CON1bits_t;
2741 
2742 extern __at(0x0694) volatile __CWG1CON1bits_t CWG1CON1bits;
2743 
2744 #define _G1IS0                  0x01
2745 #define _G1IS1                  0x02
2746 #define _G1ASDLA0               0x10
2747 #define _G1ASDLA1               0x20
2748 #define _G1ASDLB0               0x40
2749 #define _G1ASDLB1               0x80
2750 
2751 //==============================================================================
2752 
2753 
2754 //==============================================================================
2755 //        CWG1CON2 Bits
2756 
2757 extern __at(0x0695) __sfr CWG1CON2;
2758 
2759 typedef struct
2760   {
2761   unsigned                      : 1;
2762   unsigned G1ASDSFLT            : 1;
2763   unsigned G1ASDSC1             : 1;
2764   unsigned G1ASDSC2             : 1;
2765   unsigned                      : 1;
2766   unsigned                      : 1;
2767   unsigned G1ARSEN              : 1;
2768   unsigned G1ASE                : 1;
2769   } __CWG1CON2bits_t;
2770 
2771 extern __at(0x0695) volatile __CWG1CON2bits_t CWG1CON2bits;
2772 
2773 #define _G1ASDSFLT              0x02
2774 #define _G1ASDSC1               0x04
2775 #define _G1ASDSC2               0x08
2776 #define _G1ARSEN                0x40
2777 #define _G1ASE                  0x80
2778 
2779 //==============================================================================
2780 
2781 extern __at(0x0E10) __sfr CRRC;
2782 extern __at(0x0E10) __sfr TST_CRRCL;
2783 extern __at(0x0E11) __sfr TST_CRRCH;
2784 extern __at(0x0E12) __sfr TST_CRLT;
2785 
2786 //==============================================================================
2787 //        UCON Bits
2788 
2789 extern __at(0x0E8E) __sfr UCON;
2790 
2791 typedef struct
2792   {
2793   unsigned                      : 1;
2794   unsigned SUSPND               : 1;
2795   unsigned RESUME               : 1;
2796   unsigned USBEN                : 1;
2797   unsigned PKTDIS               : 1;
2798   unsigned SE0                  : 1;
2799   unsigned PPBRST               : 1;
2800   unsigned                      : 1;
2801   } __UCONbits_t;
2802 
2803 extern __at(0x0E8E) volatile __UCONbits_t UCONbits;
2804 
2805 #define _SUSPND                 0x02
2806 #define _RESUME                 0x04
2807 #define _USBEN                  0x08
2808 #define _PKTDIS                 0x10
2809 #define _SE0                    0x20
2810 #define _PPBRST                 0x40
2811 
2812 //==============================================================================
2813 
2814 
2815 //==============================================================================
2816 //        USTAT Bits
2817 
2818 extern __at(0x0E8F) __sfr USTAT;
2819 
2820 typedef union
2821   {
2822   struct
2823     {
2824     unsigned                    : 1;
2825     unsigned PPBI               : 1;
2826     unsigned DIR                : 1;
2827     unsigned ENDP0              : 1;
2828     unsigned ENDP1              : 1;
2829     unsigned ENDP2              : 1;
2830     unsigned ENDP3              : 1;
2831     unsigned                    : 1;
2832     };
2833 
2834   struct
2835     {
2836     unsigned                    : 3;
2837     unsigned ENDP               : 4;
2838     unsigned                    : 1;
2839     };
2840   } __USTATbits_t;
2841 
2842 extern __at(0x0E8F) volatile __USTATbits_t USTATbits;
2843 
2844 #define _PPBI                   0x02
2845 #define _DIR                    0x04
2846 #define _ENDP0                  0x08
2847 #define _ENDP1                  0x10
2848 #define _ENDP2                  0x20
2849 #define _ENDP3                  0x40
2850 
2851 //==============================================================================
2852 
2853 
2854 //==============================================================================
2855 //        UIR Bits
2856 
2857 extern __at(0x0E90) __sfr UIR;
2858 
2859 typedef struct
2860   {
2861   unsigned URSTIF               : 1;
2862   unsigned UERRIF               : 1;
2863   unsigned ACTVIF               : 1;
2864   unsigned TRNIF                : 1;
2865   unsigned IDLEIF               : 1;
2866   unsigned STALLIF              : 1;
2867   unsigned SOFIF                : 1;
2868   unsigned                      : 1;
2869   } __UIRbits_t;
2870 
2871 extern __at(0x0E90) volatile __UIRbits_t UIRbits;
2872 
2873 #define _URSTIF                 0x01
2874 #define _UERRIF                 0x02
2875 #define _ACTVIF                 0x04
2876 #define _TRNIF                  0x08
2877 #define _IDLEIF                 0x10
2878 #define _STALLIF                0x20
2879 #define _SOFIF                  0x40
2880 
2881 //==============================================================================
2882 
2883 
2884 //==============================================================================
2885 //        UCFG Bits
2886 
2887 extern __at(0x0E91) __sfr UCFG;
2888 
2889 typedef union
2890   {
2891   struct
2892     {
2893     unsigned PPB0               : 1;
2894     unsigned PPB1               : 1;
2895     unsigned FSEN               : 1;
2896     unsigned                    : 1;
2897     unsigned UPUEN              : 1;
2898     unsigned                    : 1;
2899     unsigned                    : 1;
2900     unsigned UTEYE              : 1;
2901     };
2902 
2903   struct
2904     {
2905     unsigned PPB                : 2;
2906     unsigned                    : 6;
2907     };
2908   } __UCFGbits_t;
2909 
2910 extern __at(0x0E91) volatile __UCFGbits_t UCFGbits;
2911 
2912 #define _PPB0                   0x01
2913 #define _PPB1                   0x02
2914 #define _FSEN                   0x04
2915 #define _UPUEN                  0x10
2916 #define _UTEYE                  0x80
2917 
2918 //==============================================================================
2919 
2920 
2921 //==============================================================================
2922 //        UIE Bits
2923 
2924 extern __at(0x0E92) __sfr UIE;
2925 
2926 typedef struct
2927   {
2928   unsigned URSTIE               : 1;
2929   unsigned UERRIE               : 1;
2930   unsigned ACTVIE               : 1;
2931   unsigned TRNIE                : 1;
2932   unsigned IDLEIE               : 1;
2933   unsigned STALLIE              : 1;
2934   unsigned SOFIE                : 1;
2935   unsigned                      : 1;
2936   } __UIEbits_t;
2937 
2938 extern __at(0x0E92) volatile __UIEbits_t UIEbits;
2939 
2940 #define _URSTIE                 0x01
2941 #define _UERRIE                 0x02
2942 #define _ACTVIE                 0x04
2943 #define _TRNIE                  0x08
2944 #define _IDLEIE                 0x10
2945 #define _STALLIE                0x20
2946 #define _SOFIE                  0x40
2947 
2948 //==============================================================================
2949 
2950 
2951 //==============================================================================
2952 //        UEIR Bits
2953 
2954 extern __at(0x0E93) __sfr UEIR;
2955 
2956 typedef struct
2957   {
2958   unsigned PIDEF                : 1;
2959   unsigned CRC5EF               : 1;
2960   unsigned CRC16EF              : 1;
2961   unsigned DFN8EF               : 1;
2962   unsigned BTOEF                : 1;
2963   unsigned                      : 1;
2964   unsigned                      : 1;
2965   unsigned BTSEF                : 1;
2966   } __UEIRbits_t;
2967 
2968 extern __at(0x0E93) volatile __UEIRbits_t UEIRbits;
2969 
2970 #define _PIDEF                  0x01
2971 #define _CRC5EF                 0x02
2972 #define _CRC16EF                0x04
2973 #define _DFN8EF                 0x08
2974 #define _BTOEF                  0x10
2975 #define _BTSEF                  0x80
2976 
2977 //==============================================================================
2978 
2979 extern __at(0x0E94) __sfr UFRM;
2980 
2981 //==============================================================================
2982 //        UFRMH Bits
2983 
2984 extern __at(0x0E94) __sfr UFRMH;
2985 
2986 typedef struct
2987   {
2988   unsigned FRM8                 : 1;
2989   unsigned FRM9                 : 1;
2990   unsigned FRM10                : 1;
2991   unsigned                      : 1;
2992   unsigned                      : 1;
2993   unsigned                      : 1;
2994   unsigned                      : 1;
2995   unsigned                      : 1;
2996   } __UFRMHbits_t;
2997 
2998 extern __at(0x0E94) volatile __UFRMHbits_t UFRMHbits;
2999 
3000 #define _FRM8                   0x01
3001 #define _FRM9                   0x02
3002 #define _FRM10                  0x04
3003 
3004 //==============================================================================
3005 
3006 
3007 //==============================================================================
3008 //        UFRML Bits
3009 
3010 extern __at(0x0E95) __sfr UFRML;
3011 
3012 typedef struct
3013   {
3014   unsigned FRM0                 : 1;
3015   unsigned FRM1                 : 1;
3016   unsigned FRM2                 : 1;
3017   unsigned FRM3                 : 1;
3018   unsigned FRM4                 : 1;
3019   unsigned FRM5                 : 1;
3020   unsigned FRM6                 : 1;
3021   unsigned FRM7                 : 1;
3022   } __UFRMLbits_t;
3023 
3024 extern __at(0x0E95) volatile __UFRMLbits_t UFRMLbits;
3025 
3026 #define _FRM0                   0x01
3027 #define _FRM1                   0x02
3028 #define _FRM2                   0x04
3029 #define _FRM3                   0x08
3030 #define _FRM4                   0x10
3031 #define _FRM5                   0x20
3032 #define _FRM6                   0x40
3033 #define _FRM7                   0x80
3034 
3035 //==============================================================================
3036 
3037 
3038 //==============================================================================
3039 //        UADDR Bits
3040 
3041 extern __at(0x0E96) __sfr UADDR;
3042 
3043 typedef union
3044   {
3045   struct
3046     {
3047     unsigned ADDR0              : 1;
3048     unsigned ADDR1              : 1;
3049     unsigned ADDR2              : 1;
3050     unsigned ADDR3              : 1;
3051     unsigned ADDR4              : 1;
3052     unsigned ADDR5              : 1;
3053     unsigned ADDR6              : 1;
3054     unsigned                    : 1;
3055     };
3056 
3057   struct
3058     {
3059     unsigned ADDR               : 7;
3060     unsigned                    : 1;
3061     };
3062   } __UADDRbits_t;
3063 
3064 extern __at(0x0E96) volatile __UADDRbits_t UADDRbits;
3065 
3066 #define _ADDR0                  0x01
3067 #define _ADDR1                  0x02
3068 #define _ADDR2                  0x04
3069 #define _ADDR3                  0x08
3070 #define _ADDR4                  0x10
3071 #define _ADDR5                  0x20
3072 #define _ADDR6                  0x40
3073 
3074 //==============================================================================
3075 
3076 
3077 //==============================================================================
3078 //        UEIE Bits
3079 
3080 extern __at(0x0E97) __sfr UEIE;
3081 
3082 typedef struct
3083   {
3084   unsigned PIDEE                : 1;
3085   unsigned CRC5EE               : 1;
3086   unsigned CRC16EE              : 1;
3087   unsigned DFN8EE               : 1;
3088   unsigned BTOEE                : 1;
3089   unsigned                      : 1;
3090   unsigned                      : 1;
3091   unsigned BTSEE                : 1;
3092   } __UEIEbits_t;
3093 
3094 extern __at(0x0E97) volatile __UEIEbits_t UEIEbits;
3095 
3096 #define _PIDEE                  0x01
3097 #define _CRC5EE                 0x02
3098 #define _CRC16EE                0x04
3099 #define _DFN8EE                 0x08
3100 #define _BTOEE                  0x10
3101 #define _BTSEE                  0x80
3102 
3103 //==============================================================================
3104 
3105 
3106 //==============================================================================
3107 //        UEP0 Bits
3108 
3109 extern __at(0x0E98) __sfr UEP0;
3110 
3111 typedef struct
3112   {
3113   unsigned EPSTALL              : 1;
3114   unsigned EPINEN               : 1;
3115   unsigned EPOUTEN              : 1;
3116   unsigned EPCONDIS             : 1;
3117   unsigned EPHSHK               : 1;
3118   unsigned                      : 1;
3119   unsigned                      : 1;
3120   unsigned                      : 1;
3121   } __UEP0bits_t;
3122 
3123 extern __at(0x0E98) volatile __UEP0bits_t UEP0bits;
3124 
3125 #define _EPSTALL                0x01
3126 #define _EPINEN                 0x02
3127 #define _EPOUTEN                0x04
3128 #define _EPCONDIS               0x08
3129 #define _EPHSHK                 0x10
3130 
3131 //==============================================================================
3132 
3133 
3134 //==============================================================================
3135 //        UEP1 Bits
3136 
3137 extern __at(0x0E99) __sfr UEP1;
3138 
3139 typedef struct
3140   {
3141   unsigned EPSTALL              : 1;
3142   unsigned EPINEN               : 1;
3143   unsigned EPOUTEN              : 1;
3144   unsigned EPCONDIS             : 1;
3145   unsigned EPHSHK               : 1;
3146   unsigned                      : 1;
3147   unsigned                      : 1;
3148   unsigned                      : 1;
3149   } __UEP1bits_t;
3150 
3151 extern __at(0x0E99) volatile __UEP1bits_t UEP1bits;
3152 
3153 #define _UEP1_EPSTALL           0x01
3154 #define _UEP1_EPINEN            0x02
3155 #define _UEP1_EPOUTEN           0x04
3156 #define _UEP1_EPCONDIS          0x08
3157 #define _UEP1_EPHSHK            0x10
3158 
3159 //==============================================================================
3160 
3161 
3162 //==============================================================================
3163 //        UEP2 Bits
3164 
3165 extern __at(0x0E9A) __sfr UEP2;
3166 
3167 typedef struct
3168   {
3169   unsigned EPSTALL              : 1;
3170   unsigned EPINEN               : 1;
3171   unsigned EPOUTEN              : 1;
3172   unsigned EPCONDIS             : 1;
3173   unsigned EPHSHK               : 1;
3174   unsigned                      : 1;
3175   unsigned                      : 1;
3176   unsigned                      : 1;
3177   } __UEP2bits_t;
3178 
3179 extern __at(0x0E9A) volatile __UEP2bits_t UEP2bits;
3180 
3181 #define _UEP2_EPSTALL           0x01
3182 #define _UEP2_EPINEN            0x02
3183 #define _UEP2_EPOUTEN           0x04
3184 #define _UEP2_EPCONDIS          0x08
3185 #define _UEP2_EPHSHK            0x10
3186 
3187 //==============================================================================
3188 
3189 
3190 //==============================================================================
3191 //        UEP3 Bits
3192 
3193 extern __at(0x0E9B) __sfr UEP3;
3194 
3195 typedef struct
3196   {
3197   unsigned EPSTALL              : 1;
3198   unsigned EPINEN               : 1;
3199   unsigned EPOUTEN              : 1;
3200   unsigned EPCONDIS             : 1;
3201   unsigned EPHSHK               : 1;
3202   unsigned                      : 1;
3203   unsigned                      : 1;
3204   unsigned                      : 1;
3205   } __UEP3bits_t;
3206 
3207 extern __at(0x0E9B) volatile __UEP3bits_t UEP3bits;
3208 
3209 #define _UEP3_EPSTALL           0x01
3210 #define _UEP3_EPINEN            0x02
3211 #define _UEP3_EPOUTEN           0x04
3212 #define _UEP3_EPCONDIS          0x08
3213 #define _UEP3_EPHSHK            0x10
3214 
3215 //==============================================================================
3216 
3217 
3218 //==============================================================================
3219 //        UEP4 Bits
3220 
3221 extern __at(0x0E9C) __sfr UEP4;
3222 
3223 typedef struct
3224   {
3225   unsigned EPSTALL              : 1;
3226   unsigned EPINEN               : 1;
3227   unsigned EPOUTEN              : 1;
3228   unsigned EPCONDIS             : 1;
3229   unsigned EPHSHK               : 1;
3230   unsigned                      : 1;
3231   unsigned                      : 1;
3232   unsigned                      : 1;
3233   } __UEP4bits_t;
3234 
3235 extern __at(0x0E9C) volatile __UEP4bits_t UEP4bits;
3236 
3237 #define _UEP4_EPSTALL           0x01
3238 #define _UEP4_EPINEN            0x02
3239 #define _UEP4_EPOUTEN           0x04
3240 #define _UEP4_EPCONDIS          0x08
3241 #define _UEP4_EPHSHK            0x10
3242 
3243 //==============================================================================
3244 
3245 
3246 //==============================================================================
3247 //        UEP5 Bits
3248 
3249 extern __at(0x0E9D) __sfr UEP5;
3250 
3251 typedef struct
3252   {
3253   unsigned EPSTALL              : 1;
3254   unsigned EPINEN               : 1;
3255   unsigned EPOUTEN              : 1;
3256   unsigned EPCONDIS             : 1;
3257   unsigned EPHSHK               : 1;
3258   unsigned                      : 1;
3259   unsigned                      : 1;
3260   unsigned                      : 1;
3261   } __UEP5bits_t;
3262 
3263 extern __at(0x0E9D) volatile __UEP5bits_t UEP5bits;
3264 
3265 #define _UEP5_EPSTALL           0x01
3266 #define _UEP5_EPINEN            0x02
3267 #define _UEP5_EPOUTEN           0x04
3268 #define _UEP5_EPCONDIS          0x08
3269 #define _UEP5_EPHSHK            0x10
3270 
3271 //==============================================================================
3272 
3273 
3274 //==============================================================================
3275 //        UEP6 Bits
3276 
3277 extern __at(0x0E9E) __sfr UEP6;
3278 
3279 typedef struct
3280   {
3281   unsigned EPSTALL              : 1;
3282   unsigned EPINEN               : 1;
3283   unsigned EPOUTEN              : 1;
3284   unsigned EPCONDIS             : 1;
3285   unsigned EPHSHK               : 1;
3286   unsigned                      : 1;
3287   unsigned                      : 1;
3288   unsigned                      : 1;
3289   } __UEP6bits_t;
3290 
3291 extern __at(0x0E9E) volatile __UEP6bits_t UEP6bits;
3292 
3293 #define _UEP6_EPSTALL           0x01
3294 #define _UEP6_EPINEN            0x02
3295 #define _UEP6_EPOUTEN           0x04
3296 #define _UEP6_EPCONDIS          0x08
3297 #define _UEP6_EPHSHK            0x10
3298 
3299 //==============================================================================
3300 
3301 
3302 //==============================================================================
3303 //        UEP7 Bits
3304 
3305 extern __at(0x0E9F) __sfr UEP7;
3306 
3307 typedef struct
3308   {
3309   unsigned EPSTALL              : 1;
3310   unsigned EPINEN               : 1;
3311   unsigned EPOUTEN              : 1;
3312   unsigned EPCONDIS             : 1;
3313   unsigned EPHSHK               : 1;
3314   unsigned                      : 1;
3315   unsigned                      : 1;
3316   unsigned                      : 1;
3317   } __UEP7bits_t;
3318 
3319 extern __at(0x0E9F) volatile __UEP7bits_t UEP7bits;
3320 
3321 #define _UEP7_EPSTALL           0x01
3322 #define _UEP7_EPINEN            0x02
3323 #define _UEP7_EPOUTEN           0x04
3324 #define _UEP7_EPCONDIS          0x08
3325 #define _UEP7_EPHSHK            0x10
3326 
3327 //==============================================================================
3328 
3329 
3330 //==============================================================================
3331 //        ICDIO Bits
3332 
3333 extern __at(0x0F8C) __sfr ICDIO;
3334 
3335 typedef struct
3336   {
3337   unsigned                      : 1;
3338   unsigned                      : 1;
3339   unsigned TRIS_ICDCLK          : 1;
3340   unsigned TRIS_ICDDAT          : 1;
3341   unsigned LAT_ICDCLK           : 1;
3342   unsigned LAT_ICDDAT           : 1;
3343   unsigned PORT_ICDCLK          : 1;
3344   unsigned PORT_ICDDAT          : 1;
3345   } __ICDIObits_t;
3346 
3347 extern __at(0x0F8C) volatile __ICDIObits_t ICDIObits;
3348 
3349 #define _TRIS_ICDCLK            0x04
3350 #define _TRIS_ICDDAT            0x08
3351 #define _LAT_ICDCLK             0x10
3352 #define _LAT_ICDDAT             0x20
3353 #define _PORT_ICDCLK            0x40
3354 #define _PORT_ICDDAT            0x80
3355 
3356 //==============================================================================
3357 
3358 
3359 //==============================================================================
3360 //        ICDCON0 Bits
3361 
3362 extern __at(0x0F8D) __sfr ICDCON0;
3363 
3364 typedef struct
3365   {
3366   unsigned RSTVEC               : 1;
3367   unsigned                      : 1;
3368   unsigned                      : 1;
3369   unsigned DBGINEX              : 1;
3370   unsigned                      : 1;
3371   unsigned SSTEP                : 1;
3372   unsigned FREEZ                : 1;
3373   unsigned INBUG                : 1;
3374   } __ICDCON0bits_t;
3375 
3376 extern __at(0x0F8D) volatile __ICDCON0bits_t ICDCON0bits;
3377 
3378 #define _RSTVEC                 0x01
3379 #define _DBGINEX                0x08
3380 #define _SSTEP                  0x20
3381 #define _FREEZ                  0x40
3382 #define _INBUG                  0x80
3383 
3384 //==============================================================================
3385 
3386 
3387 //==============================================================================
3388 //        ICDSTAT Bits
3389 
3390 extern __at(0x0F91) __sfr ICDSTAT;
3391 
3392 typedef struct
3393   {
3394   unsigned                      : 1;
3395   unsigned USRHLTF              : 1;
3396   unsigned                      : 1;
3397   unsigned                      : 1;
3398   unsigned                      : 1;
3399   unsigned                      : 1;
3400   unsigned TRP0HLTF             : 1;
3401   unsigned TRP1HLTF             : 1;
3402   } __ICDSTATbits_t;
3403 
3404 extern __at(0x0F91) volatile __ICDSTATbits_t ICDSTATbits;
3405 
3406 #define _USRHLTF                0x02
3407 #define _TRP0HLTF               0x40
3408 #define _TRP1HLTF               0x80
3409 
3410 //==============================================================================
3411 
3412 
3413 //==============================================================================
3414 //        DEVSEL Bits
3415 
3416 extern __at(0x0F95) __sfr DEVSEL;
3417 
3418 typedef union
3419   {
3420   struct
3421     {
3422     unsigned DEVSEL0            : 1;
3423     unsigned DEVSEL1            : 1;
3424     unsigned DEVSEL2            : 1;
3425     unsigned                    : 1;
3426     unsigned                    : 1;
3427     unsigned                    : 1;
3428     unsigned                    : 1;
3429     unsigned                    : 1;
3430     };
3431 
3432   struct
3433     {
3434     unsigned DEVSEL             : 3;
3435     unsigned                    : 5;
3436     };
3437   } __DEVSELbits_t;
3438 
3439 extern __at(0x0F95) volatile __DEVSELbits_t DEVSELbits;
3440 
3441 #define _DEVSEL0                0x01
3442 #define _DEVSEL1                0x02
3443 #define _DEVSEL2                0x04
3444 
3445 //==============================================================================
3446 
3447 
3448 //==============================================================================
3449 //        ICDINSTL Bits
3450 
3451 extern __at(0x0F96) __sfr ICDINSTL;
3452 
3453 typedef struct
3454   {
3455   unsigned DBGIN0               : 1;
3456   unsigned DBGIN1               : 1;
3457   unsigned DBGIN2               : 1;
3458   unsigned DBGIN3               : 1;
3459   unsigned DBGIN4               : 1;
3460   unsigned DBGIN5               : 1;
3461   unsigned DBGIN6               : 1;
3462   unsigned DBGIN7               : 1;
3463   } __ICDINSTLbits_t;
3464 
3465 extern __at(0x0F96) volatile __ICDINSTLbits_t ICDINSTLbits;
3466 
3467 #define _DBGIN0                 0x01
3468 #define _DBGIN1                 0x02
3469 #define _DBGIN2                 0x04
3470 #define _DBGIN3                 0x08
3471 #define _DBGIN4                 0x10
3472 #define _DBGIN5                 0x20
3473 #define _DBGIN6                 0x40
3474 #define _DBGIN7                 0x80
3475 
3476 //==============================================================================
3477 
3478 
3479 //==============================================================================
3480 //        ICDINSTH Bits
3481 
3482 extern __at(0x0F97) __sfr ICDINSTH;
3483 
3484 typedef struct
3485   {
3486   unsigned DBGIN8               : 1;
3487   unsigned DBGIN9               : 1;
3488   unsigned DBGIN10              : 1;
3489   unsigned DBGIN11              : 1;
3490   unsigned DBGIN12              : 1;
3491   unsigned DBGIN13              : 1;
3492   unsigned                      : 1;
3493   unsigned                      : 1;
3494   } __ICDINSTHbits_t;
3495 
3496 extern __at(0x0F97) volatile __ICDINSTHbits_t ICDINSTHbits;
3497 
3498 #define _DBGIN8                 0x01
3499 #define _DBGIN9                 0x02
3500 #define _DBGIN10                0x04
3501 #define _DBGIN11                0x08
3502 #define _DBGIN12                0x10
3503 #define _DBGIN13                0x20
3504 
3505 //==============================================================================
3506 
3507 
3508 //==============================================================================
3509 //        ICDBK0CON Bits
3510 
3511 extern __at(0x0F9C) __sfr ICDBK0CON;
3512 
3513 typedef struct
3514   {
3515   unsigned BKHLT                : 1;
3516   unsigned                      : 1;
3517   unsigned                      : 1;
3518   unsigned                      : 1;
3519   unsigned                      : 1;
3520   unsigned                      : 1;
3521   unsigned                      : 1;
3522   unsigned BKEN                 : 1;
3523   } __ICDBK0CONbits_t;
3524 
3525 extern __at(0x0F9C) volatile __ICDBK0CONbits_t ICDBK0CONbits;
3526 
3527 #define _BKHLT                  0x01
3528 #define _BKEN                   0x80
3529 
3530 //==============================================================================
3531 
3532 
3533 //==============================================================================
3534 //        ICDBK0L Bits
3535 
3536 extern __at(0x0F9D) __sfr ICDBK0L;
3537 
3538 typedef struct
3539   {
3540   unsigned BKA0                 : 1;
3541   unsigned BKA1                 : 1;
3542   unsigned BKA2                 : 1;
3543   unsigned BKA3                 : 1;
3544   unsigned BKA4                 : 1;
3545   unsigned BKA5                 : 1;
3546   unsigned BKA6                 : 1;
3547   unsigned BKA7                 : 1;
3548   } __ICDBK0Lbits_t;
3549 
3550 extern __at(0x0F9D) volatile __ICDBK0Lbits_t ICDBK0Lbits;
3551 
3552 #define _BKA0                   0x01
3553 #define _BKA1                   0x02
3554 #define _BKA2                   0x04
3555 #define _BKA3                   0x08
3556 #define _BKA4                   0x10
3557 #define _BKA5                   0x20
3558 #define _BKA6                   0x40
3559 #define _BKA7                   0x80
3560 
3561 //==============================================================================
3562 
3563 
3564 //==============================================================================
3565 //        ICDBK0H Bits
3566 
3567 extern __at(0x0F9E) __sfr ICDBK0H;
3568 
3569 typedef struct
3570   {
3571   unsigned BKA8                 : 1;
3572   unsigned BKA9                 : 1;
3573   unsigned BKA10                : 1;
3574   unsigned BKA11                : 1;
3575   unsigned BKA12                : 1;
3576   unsigned BKA13                : 1;
3577   unsigned BKA14                : 1;
3578   unsigned                      : 1;
3579   } __ICDBK0Hbits_t;
3580 
3581 extern __at(0x0F9E) volatile __ICDBK0Hbits_t ICDBK0Hbits;
3582 
3583 #define _BKA8                   0x01
3584 #define _BKA9                   0x02
3585 #define _BKA10                  0x04
3586 #define _BKA11                  0x08
3587 #define _BKA12                  0x10
3588 #define _BKA13                  0x20
3589 #define _BKA14                  0x40
3590 
3591 //==============================================================================
3592 
3593 extern __at(0x0FE3) __sfr BSRICDSHAD;
3594 
3595 //==============================================================================
3596 //        STATUS_SHAD Bits
3597 
3598 extern __at(0x0FE4) __sfr STATUS_SHAD;
3599 
3600 typedef struct
3601   {
3602   unsigned C                    : 1;
3603   unsigned DC                   : 1;
3604   unsigned Z                    : 1;
3605   unsigned                      : 1;
3606   unsigned                      : 1;
3607   unsigned                      : 1;
3608   unsigned                      : 1;
3609   unsigned                      : 1;
3610   } __STATUS_SHADbits_t;
3611 
3612 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
3613 
3614 #define _STATUS_SHAD_C          0x01
3615 #define _STATUS_SHAD_DC         0x02
3616 #define _STATUS_SHAD_Z          0x04
3617 
3618 //==============================================================================
3619 
3620 extern __at(0x0FE5) __sfr WREG_SHAD;
3621 extern __at(0x0FE6) __sfr BSR_SHAD;
3622 extern __at(0x0FE7) __sfr PCLATH_SHAD;
3623 extern __at(0x0FE8) __sfr FSR0L_SHAD;
3624 extern __at(0x0FE9) __sfr FSR0H_SHAD;
3625 extern __at(0x0FEA) __sfr FSR1L_SHAD;
3626 extern __at(0x0FEB) __sfr FSR1H_SHAD;
3627 extern __at(0x0FED) __sfr STKPTR;
3628 extern __at(0x0FEE) __sfr TOSL;
3629 extern __at(0x0FEF) __sfr TOSH;
3630 
3631 //==============================================================================
3632 //
3633 //        Configuration Bits
3634 //
3635 //==============================================================================
3636 
3637 #define _CONFIG1                0x8007
3638 #define _CONFIG2                0x8008
3639 
3640 //----------------------------- CONFIG1 Options -------------------------------
3641 
3642 #define _FOSC_LP                0xFFF8  // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins.
3643 #define _FOSC_XT                0xFFF9  // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins.
3644 #define _FOSC_HS                0xFFFA  // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins.
3645 #define _FOSC_EXTRC             0xFFFB  // EXTRC oscillator: External RC circuit connected to CLKIN pin.
3646 #define _FOSC_INTOSC            0xFFFC  // INTOSC oscillator: I/O function on CLKIN pin.
3647 #define _FOSC_ECL               0xFFFD  // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pins.
3648 #define _FOSC_ECM               0xFFFE  // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pins.
3649 #define _FOSC_ECH               0xFFFF  // ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins.
3650 #define _WDTE_OFF               0xFFE7  // WDT disabled.
3651 #define _WDTE_SWDTEN            0xFFEF  // WDT controlled by the SWDTEN bit in the WDTCON register.
3652 #define _WDTE_NSLEEP            0xFFF7  // WDT enabled while running and disabled in Sleep.
3653 #define _WDTE_ON                0xFFFF  // WDT enabled.
3654 #define _PWRTE_ON               0xFFDF  // PWRT enabled.
3655 #define _PWRTE_OFF              0xFFFF  // PWRT disabled.
3656 #define _MCLRE_OFF              0xFFBF  // MCLR/VPP pin function is digital input.
3657 #define _MCLRE_ON               0xFFFF  // MCLR/VPP pin function is MCLR.
3658 #define _CP_ON                  0xFF7F  // Program memory code protection is enabled.
3659 #define _CP_OFF                 0xFFFF  // Program memory code protection is disabled.
3660 #define _BOREN_OFF              0xF9FF  // Brown-out Reset disabled.
3661 #define _BOREN_SBODEN           0xFBFF  // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
3662 #define _BOREN_NSLEEP           0xFDFF  // Brown-out Reset enabled while running and disabled in Sleep.
3663 #define _BOREN_ON               0xFFFF  // Brown-out Reset enabled.
3664 #define _CLKOUTEN_ON            0xF7FF  // CLKOUT function is enabled on the CLKOUT pin.
3665 #define _CLKOUTEN_OFF           0xFFFF  // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
3666 #define _IESO_OFF               0xEFFF  // Internal/External Switchover Mode is disabled.
3667 #define _IESO_ON                0xFFFF  // Internal/External Switchover Mode is enabled.
3668 #define _FCMEN_OFF              0xDFFF  // Fail-Safe Clock Monitor is disabled.
3669 #define _FCMEN_ON               0xFFFF  // Fail-Safe Clock Monitor is enabled.
3670 
3671 //----------------------------- CONFIG2 Options -------------------------------
3672 
3673 #define _WRT_ALL                0xFFFC  // 000h to 1FFFh write protected, no addresses may be modified by PMCON control.
3674 #define _WRT_HALF               0xFFFD  // 000h to 0FFFh write protected, 1000h to 1FFFh may be modified by PMCON control.
3675 #define _WRT_BOOT               0xFFFE  // 000h to 1FFh write protected, 200h to 1FFFh may be modified by PMCON control.
3676 #define _WRT_OFF                0xFFFF  // Write protection off.
3677 #define _CPUDIV_NOCLKDIV        0xFFCF  // NO CPU system divide.
3678 #define _CPUDIV_CLKDIV2         0xFFDF  // CPU system clock divided by 2.
3679 #define _CPUDIV_CLKDIV3         0xFFEF  // CPU system clock divided by 3.
3680 #define _CPUDIV_CLKDIV6         0xFFFF  // CPU system clock divided by 6.
3681 #define _USBLSCLK_24MHz         0xFFBF  // System clock expects 24 MHz, FS/LS USB CLKENs divide-by is set to 4.
3682 #define _USBLSCLK_48MHz         0xFFFF  // System clock expects 48 MHz, FS/LS USB CLKENs divide-by is set to 8.
3683 #define _PLLMULT_4x             0xFF7F  // 4x Output Frequency Selected.
3684 #define _PLLMULT_3x             0xFFFF  // 3x Output Frequency Selected.
3685 #define _PLLEN_DISABLED         0xFEFF  // 3x or 4x PLL Disabled.
3686 #define _PLLEN_ENABLED          0xFFFF  // 3x or 4x PLL Enabled.
3687 #define _STVREN_OFF             0xFDFF  // Stack Overflow or Underflow will not cause a Reset.
3688 #define _STVREN_ON              0xFFFF  // Stack Overflow or Underflow will cause a Reset.
3689 #define _BORV_HI                0xFBFF  // Brown-out Reset Voltage (Vbor), high trip point selected.
3690 #define _BORV_LO                0xFFFF  // Brown-out Reset Voltage (Vbor), low trip point selected.
3691 #define _LPBOR_ON               0xF7FF  // Low-Power BOR is enabled.
3692 #define _LPBOR_OFF              0xFFFF  // Low-Power BOR is disabled.
3693 #define _DEBUG_ON               0x2FFF  // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
3694 #define _DEBUG_OFF              0x3FFF  // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
3695 #define _LVP_OFF                0xDFFF  // High-voltage on MCLR/VPP must be used for programming.
3696 #define _LVP_ON                 0xFFFF  // Low-voltage programming enabled.
3697 
3698 //==============================================================================
3699 
3700 #define _DEVID1                 0x8006
3701 
3702 #define _IDLOC0                 0x8000
3703 #define _IDLOC1                 0x8001
3704 #define _IDLOC2                 0x8002
3705 #define _IDLOC3                 0x8003
3706 
3707 //==============================================================================
3708 
3709 #ifndef NO_BIT_DEFINES
3710 
3711 #define ADON                    ADCON0bits.ADON                 // bit 0
3712 #define GO_NOT_DONE             ADCON0bits.GO_NOT_DONE          // bit 1, shadows bit in ADCON0bits
3713 #define ADGO                    ADCON0bits.ADGO                 // bit 1, shadows bit in ADCON0bits
3714 #define GO                      ADCON0bits.GO                   // bit 1, shadows bit in ADCON0bits
3715 #define CHS0                    ADCON0bits.CHS0                 // bit 2
3716 #define CHS1                    ADCON0bits.CHS1                 // bit 3
3717 #define CHS2                    ADCON0bits.CHS2                 // bit 4
3718 #define CHS3                    ADCON0bits.CHS3                 // bit 5
3719 #define CHS4                    ADCON0bits.CHS4                 // bit 6
3720 
3721 #define ADPREF0                 ADCON1bits.ADPREF0              // bit 0
3722 #define ADPREF1                 ADCON1bits.ADPREF1              // bit 1
3723 #define ADCS0                   ADCON1bits.ADCS0                // bit 4
3724 #define ADCS1                   ADCON1bits.ADCS1                // bit 5
3725 #define ADCS2                   ADCON1bits.ADCS2                // bit 6
3726 #define ADFM                    ADCON1bits.ADFM                 // bit 7
3727 
3728 #define TRIGSEL0                ADCON2bits.TRIGSEL0             // bit 4
3729 #define TRIGSEL1                ADCON2bits.TRIGSEL1             // bit 5
3730 #define TRIGSEL2                ADCON2bits.TRIGSEL2             // bit 6
3731 
3732 #define ANSA4                   ANSELAbits.ANSA4                // bit 4
3733 
3734 #define ANSB4                   ANSELBbits.ANSB4                // bit 4
3735 #define ANSB5                   ANSELBbits.ANSB5                // bit 5
3736 
3737 #define ANSC0                   ANSELCbits.ANSC0                // bit 0
3738 #define ANSC1                   ANSELCbits.ANSC1                // bit 1
3739 #define ANSC2                   ANSELCbits.ANSC2                // bit 2
3740 #define ANSC3                   ANSELCbits.ANSC3                // bit 3
3741 #define ANSC6                   ANSELCbits.ANSC6                // bit 6
3742 #define ANSC7                   ANSELCbits.ANSC7                // bit 7
3743 
3744 #define T1GSEL                  APFCONbits.T1GSEL               // bit 3
3745 #define SSSEL                   APFCONbits.SSSEL                // bit 5
3746 #define CLKRSEL                 APFCONbits.CLKRSEL              // bit 7
3747 
3748 #define ABDEN                   BAUDCONbits.ABDEN               // bit 0
3749 #define WUE                     BAUDCONbits.WUE                 // bit 1
3750 #define BRG16                   BAUDCONbits.BRG16               // bit 3
3751 #define SCKP                    BAUDCONbits.SCKP                // bit 4
3752 #define RCIDL                   BAUDCONbits.RCIDL               // bit 6
3753 #define ABDOVF                  BAUDCONbits.ABDOVF              // bit 7
3754 
3755 #define BORRDY                  BORCONbits.BORRDY               // bit 0
3756 #define BORFS                   BORCONbits.BORFS                // bit 6
3757 #define SBOREN                  BORCONbits.SBOREN               // bit 7
3758 
3759 #define BSR0                    BSRbits.BSR0                    // bit 0
3760 #define BSR1                    BSRbits.BSR1                    // bit 1
3761 #define BSR2                    BSRbits.BSR2                    // bit 2
3762 #define BSR3                    BSRbits.BSR3                    // bit 3
3763 #define BSR4                    BSRbits.BSR4                    // bit 4
3764 
3765 #define CLKRDIV0                CLKRCONbits.CLKRDIV0            // bit 0
3766 #define CLKRDIV1                CLKRCONbits.CLKRDIV1            // bit 1
3767 #define CLKRDIV2                CLKRCONbits.CLKRDIV2            // bit 2
3768 #define CLKRCD0                 CLKRCONbits.CLKRCD0             // bit 3
3769 #define CLKRCD1                 CLKRCONbits.CLKRCD1             // bit 4
3770 #define CLKRSLR                 CLKRCONbits.CLKRSLR             // bit 5
3771 #define CLKROE                  CLKRCONbits.CLKROE              // bit 6
3772 #define CLKREN                  CLKRCONbits.CLKREN              // bit 7
3773 
3774 #define C1SYNC                  CM1CON0bits.C1SYNC              // bit 0
3775 #define C1HYS                   CM1CON0bits.C1HYS               // bit 1
3776 #define C1SP                    CM1CON0bits.C1SP                // bit 2
3777 #define C1POL                   CM1CON0bits.C1POL               // bit 4
3778 #define C1OE                    CM1CON0bits.C1OE                // bit 5
3779 #define C1OUT                   CM1CON0bits.C1OUT               // bit 6
3780 #define C1ON                    CM1CON0bits.C1ON                // bit 7
3781 
3782 #define C1NCH0                  CM1CON1bits.C1NCH0              // bit 0
3783 #define C1NCH1                  CM1CON1bits.C1NCH1              // bit 1
3784 #define C1NCH2                  CM1CON1bits.C1NCH2              // bit 2
3785 #define C1PCH0                  CM1CON1bits.C1PCH0              // bit 4
3786 #define C1PCH1                  CM1CON1bits.C1PCH1              // bit 5
3787 #define C1INTN                  CM1CON1bits.C1INTN              // bit 6
3788 #define C1INTP                  CM1CON1bits.C1INTP              // bit 7
3789 
3790 #define C2SYNC                  CM2CON0bits.C2SYNC              // bit 0
3791 #define C2HYS                   CM2CON0bits.C2HYS               // bit 1
3792 #define C2SP                    CM2CON0bits.C2SP                // bit 2
3793 #define C2POL                   CM2CON0bits.C2POL               // bit 4
3794 #define C2OE                    CM2CON0bits.C2OE                // bit 5
3795 #define C2OUT                   CM2CON0bits.C2OUT               // bit 6
3796 #define C2ON                    CM2CON0bits.C2ON                // bit 7
3797 
3798 #define C2NCH0                  CM2CON1bits.C2NCH0              // bit 0
3799 #define C2NCH1                  CM2CON1bits.C2NCH1              // bit 1
3800 #define C2NCH2                  CM2CON1bits.C2NCH2              // bit 2
3801 #define C2PCH0                  CM2CON1bits.C2PCH0              // bit 4
3802 #define C2PCH1                  CM2CON1bits.C2PCH1              // bit 5
3803 #define C2INTN                  CM2CON1bits.C2INTN              // bit 6
3804 #define C2INTP                  CM2CON1bits.C2INTP              // bit 7
3805 
3806 #define MC1OUT                  CMOUTbits.MC1OUT                // bit 0
3807 #define MC2OUT                  CMOUTbits.MC2OUT                // bit 1
3808 
3809 #define CPFAIL                  CRCONbits.CPFAIL                // bit 1
3810 #define CRLOCK                  CRCONbits.CRLOCK                // bit 3
3811 #define CRSRC                   CRCONbits.CRSRC                 // bit 4
3812 #define CRUPDIS                 CRCONbits.CRUPDIS               // bit 6
3813 #define CRON                    CRCONbits.CRON                  // bit 7
3814 
3815 #define G1CS0                   CWG1CON0bits.G1CS0              // bit 0
3816 #define G1POLA                  CWG1CON0bits.G1POLA             // bit 3
3817 #define G1POLB                  CWG1CON0bits.G1POLB             // bit 4
3818 #define G1OEA                   CWG1CON0bits.G1OEA              // bit 5
3819 #define G1OEB                   CWG1CON0bits.G1OEB              // bit 6
3820 #define G1EN                    CWG1CON0bits.G1EN               // bit 7
3821 
3822 #define G1IS0                   CWG1CON1bits.G1IS0              // bit 0
3823 #define G1IS1                   CWG1CON1bits.G1IS1              // bit 1
3824 #define G1ASDLA0                CWG1CON1bits.G1ASDLA0           // bit 4
3825 #define G1ASDLA1                CWG1CON1bits.G1ASDLA1           // bit 5
3826 #define G1ASDLB0                CWG1CON1bits.G1ASDLB0           // bit 6
3827 #define G1ASDLB1                CWG1CON1bits.G1ASDLB1           // bit 7
3828 
3829 #define G1ASDSFLT               CWG1CON2bits.G1ASDSFLT          // bit 1
3830 #define G1ASDSC1                CWG1CON2bits.G1ASDSC1           // bit 2
3831 #define G1ASDSC2                CWG1CON2bits.G1ASDSC2           // bit 3
3832 #define G1ARSEN                 CWG1CON2bits.G1ARSEN            // bit 6
3833 #define G1ASE                   CWG1CON2bits.G1ASE              // bit 7
3834 
3835 #define CWG1DBF0                CWG1DBFbits.CWG1DBF0            // bit 0
3836 #define CWG1DBF1                CWG1DBFbits.CWG1DBF1            // bit 1
3837 #define CWG1DBF2                CWG1DBFbits.CWG1DBF2            // bit 2
3838 #define CWG1DBF3                CWG1DBFbits.CWG1DBF3            // bit 3
3839 #define CWG1DBF4                CWG1DBFbits.CWG1DBF4            // bit 4
3840 #define CWG1DBF5                CWG1DBFbits.CWG1DBF5            // bit 5
3841 
3842 #define CWG1DBR0                CWG1DBRbits.CWG1DBR0            // bit 0
3843 #define CWG1DBR1                CWG1DBRbits.CWG1DBR1            // bit 1
3844 #define CWG1DBR2                CWG1DBRbits.CWG1DBR2            // bit 2
3845 #define CWG1DBR3                CWG1DBRbits.CWG1DBR3            // bit 3
3846 #define CWG1DBR4                CWG1DBRbits.CWG1DBR4            // bit 4
3847 #define CWG1DBR5                CWG1DBRbits.CWG1DBR5            // bit 5
3848 
3849 #define D1PSS0                  DACCON0bits.D1PSS0              // bit 2
3850 #define D1PSS1                  DACCON0bits.D1PSS1              // bit 3
3851 #define DACOE2                  DACCON0bits.DACOE2              // bit 4
3852 #define DACOE1                  DACCON0bits.DACOE1              // bit 5
3853 #define DACEN                   DACCON0bits.DACEN               // bit 7
3854 
3855 #define DACR0                   DACCON1bits.DACR0               // bit 0
3856 #define DACR1                   DACCON1bits.DACR1               // bit 1
3857 #define DACR2                   DACCON1bits.DACR2               // bit 2
3858 #define DACR3                   DACCON1bits.DACR3               // bit 3
3859 #define DACR4                   DACCON1bits.DACR4               // bit 4
3860 
3861 #define DEVSEL0                 DEVSELbits.DEVSEL0              // bit 0
3862 #define DEVSEL1                 DEVSELbits.DEVSEL1              // bit 1
3863 #define DEVSEL2                 DEVSELbits.DEVSEL2              // bit 2
3864 
3865 #define ADFVR0                  FVRCONbits.ADFVR0               // bit 0
3866 #define ADFVR1                  FVRCONbits.ADFVR1               // bit 1
3867 #define CDAFVR0                 FVRCONbits.CDAFVR0              // bit 2
3868 #define CDAFVR1                 FVRCONbits.CDAFVR1              // bit 3
3869 #define FVRRDY                  FVRCONbits.FVRRDY               // bit 6
3870 #define FVREN                   FVRCONbits.FVREN                // bit 7
3871 
3872 #define BKHLT                   ICDBK0CONbits.BKHLT             // bit 0
3873 #define BKEN                    ICDBK0CONbits.BKEN              // bit 7
3874 
3875 #define BKA8                    ICDBK0Hbits.BKA8                // bit 0
3876 #define BKA9                    ICDBK0Hbits.BKA9                // bit 1
3877 #define BKA10                   ICDBK0Hbits.BKA10               // bit 2
3878 #define BKA11                   ICDBK0Hbits.BKA11               // bit 3
3879 #define BKA12                   ICDBK0Hbits.BKA12               // bit 4
3880 #define BKA13                   ICDBK0Hbits.BKA13               // bit 5
3881 #define BKA14                   ICDBK0Hbits.BKA14               // bit 6
3882 
3883 #define BKA0                    ICDBK0Lbits.BKA0                // bit 0
3884 #define BKA1                    ICDBK0Lbits.BKA1                // bit 1
3885 #define BKA2                    ICDBK0Lbits.BKA2                // bit 2
3886 #define BKA3                    ICDBK0Lbits.BKA3                // bit 3
3887 #define BKA4                    ICDBK0Lbits.BKA4                // bit 4
3888 #define BKA5                    ICDBK0Lbits.BKA5                // bit 5
3889 #define BKA6                    ICDBK0Lbits.BKA6                // bit 6
3890 #define BKA7                    ICDBK0Lbits.BKA7                // bit 7
3891 
3892 #define RSTVEC                  ICDCON0bits.RSTVEC              // bit 0
3893 #define DBGINEX                 ICDCON0bits.DBGINEX             // bit 3
3894 #define SSTEP                   ICDCON0bits.SSTEP               // bit 5
3895 #define FREEZ                   ICDCON0bits.FREEZ               // bit 6
3896 #define INBUG                   ICDCON0bits.INBUG               // bit 7
3897 
3898 #define DBGIN8                  ICDINSTHbits.DBGIN8             // bit 0
3899 #define DBGIN9                  ICDINSTHbits.DBGIN9             // bit 1
3900 #define DBGIN10                 ICDINSTHbits.DBGIN10            // bit 2
3901 #define DBGIN11                 ICDINSTHbits.DBGIN11            // bit 3
3902 #define DBGIN12                 ICDINSTHbits.DBGIN12            // bit 4
3903 #define DBGIN13                 ICDINSTHbits.DBGIN13            // bit 5
3904 
3905 #define DBGIN0                  ICDINSTLbits.DBGIN0             // bit 0
3906 #define DBGIN1                  ICDINSTLbits.DBGIN1             // bit 1
3907 #define DBGIN2                  ICDINSTLbits.DBGIN2             // bit 2
3908 #define DBGIN3                  ICDINSTLbits.DBGIN3             // bit 3
3909 #define DBGIN4                  ICDINSTLbits.DBGIN4             // bit 4
3910 #define DBGIN5                  ICDINSTLbits.DBGIN5             // bit 5
3911 #define DBGIN6                  ICDINSTLbits.DBGIN6             // bit 6
3912 #define DBGIN7                  ICDINSTLbits.DBGIN7             // bit 7
3913 
3914 #define TRIS_ICDCLK             ICDIObits.TRIS_ICDCLK           // bit 2
3915 #define TRIS_ICDDAT             ICDIObits.TRIS_ICDDAT           // bit 3
3916 #define LAT_ICDCLK              ICDIObits.LAT_ICDCLK            // bit 4
3917 #define LAT_ICDDAT              ICDIObits.LAT_ICDDAT            // bit 5
3918 #define PORT_ICDCLK             ICDIObits.PORT_ICDCLK           // bit 6
3919 #define PORT_ICDDAT             ICDIObits.PORT_ICDDAT           // bit 7
3920 
3921 #define USRHLTF                 ICDSTATbits.USRHLTF             // bit 1
3922 #define TRP0HLTF                ICDSTATbits.TRP0HLTF            // bit 6
3923 #define TRP1HLTF                ICDSTATbits.TRP1HLTF            // bit 7
3924 
3925 #define IOCIF                   INTCONbits.IOCIF                // bit 0
3926 #define INTF                    INTCONbits.INTF                 // bit 1
3927 #define TMR0IF                  INTCONbits.TMR0IF               // bit 2, shadows bit in INTCONbits
3928 #define T0IF                    INTCONbits.T0IF                 // bit 2, shadows bit in INTCONbits
3929 #define IOCIE                   INTCONbits.IOCIE                // bit 3
3930 #define INTE                    INTCONbits.INTE                 // bit 4
3931 #define TMR0IE                  INTCONbits.TMR0IE               // bit 5, shadows bit in INTCONbits
3932 #define T0IE                    INTCONbits.T0IE                 // bit 5, shadows bit in INTCONbits
3933 #define PEIE                    INTCONbits.PEIE                 // bit 6
3934 #define GIE                     INTCONbits.GIE                  // bit 7
3935 
3936 #define IOCAF0                  IOCAFbits.IOCAF0                // bit 0
3937 #define IOCAF1                  IOCAFbits.IOCAF1                // bit 1
3938 #define IOCAF3                  IOCAFbits.IOCAF3                // bit 3
3939 #define IOCAF4                  IOCAFbits.IOCAF4                // bit 4
3940 #define IOCAF5                  IOCAFbits.IOCAF5                // bit 5
3941 
3942 #define IOCAN0                  IOCANbits.IOCAN0                // bit 0
3943 #define IOCAN1                  IOCANbits.IOCAN1                // bit 1
3944 #define IOCAN3                  IOCANbits.IOCAN3                // bit 3
3945 #define IOCAN4                  IOCANbits.IOCAN4                // bit 4
3946 #define IOCAN5                  IOCANbits.IOCAN5                // bit 5
3947 
3948 #define IOCAP0                  IOCAPbits.IOCAP0                // bit 0
3949 #define IOCAP1                  IOCAPbits.IOCAP1                // bit 1
3950 #define IOCAP3                  IOCAPbits.IOCAP3                // bit 3
3951 #define IOCAP4                  IOCAPbits.IOCAP4                // bit 4
3952 #define IOCAP5                  IOCAPbits.IOCAP5                // bit 5
3953 
3954 #define IOCBF4                  IOCBFbits.IOCBF4                // bit 4
3955 #define IOCBF5                  IOCBFbits.IOCBF5                // bit 5
3956 #define IOCBF6                  IOCBFbits.IOCBF6                // bit 6
3957 #define IOCBF7                  IOCBFbits.IOCBF7                // bit 7
3958 
3959 #define IOCBN4                  IOCBNbits.IOCBN4                // bit 4
3960 #define IOCBN5                  IOCBNbits.IOCBN5                // bit 5
3961 #define IOCBN6                  IOCBNbits.IOCBN6                // bit 6
3962 #define IOCBN7                  IOCBNbits.IOCBN7                // bit 7
3963 
3964 #define IOCBP4                  IOCBPbits.IOCBP4                // bit 4
3965 #define IOCBP5                  IOCBPbits.IOCBP5                // bit 5
3966 #define IOCBP6                  IOCBPbits.IOCBP6                // bit 6
3967 #define IOCBP7                  IOCBPbits.IOCBP7                // bit 7
3968 
3969 #define LATA4                   LATAbits.LATA4                  // bit 4
3970 #define LATA5                   LATAbits.LATA5                  // bit 5
3971 
3972 #define LATB4                   LATBbits.LATB4                  // bit 4
3973 #define LATB5                   LATBbits.LATB5                  // bit 5
3974 #define LATB6                   LATBbits.LATB6                  // bit 6
3975 #define LATB7                   LATBbits.LATB7                  // bit 7
3976 
3977 #define LATC0                   LATCbits.LATC0                  // bit 0
3978 #define LATC1                   LATCbits.LATC1                  // bit 1
3979 #define LATC2                   LATCbits.LATC2                  // bit 2
3980 #define LATC3                   LATCbits.LATC3                  // bit 3
3981 #define LATC4                   LATCbits.LATC4                  // bit 4
3982 #define LATC5                   LATCbits.LATC5                  // bit 5
3983 #define LATC6                   LATCbits.LATC6                  // bit 6
3984 #define LATC7                   LATCbits.LATC7                  // bit 7
3985 
3986 #define PS0                     OPTION_REGbits.PS0              // bit 0
3987 #define PS1                     OPTION_REGbits.PS1              // bit 1
3988 #define PS2                     OPTION_REGbits.PS2              // bit 2
3989 #define PSA                     OPTION_REGbits.PSA              // bit 3
3990 #define TMR0SE                  OPTION_REGbits.TMR0SE           // bit 4, shadows bit in OPTION_REGbits
3991 #define T0SE                    OPTION_REGbits.T0SE             // bit 4, shadows bit in OPTION_REGbits
3992 #define TMR0CS                  OPTION_REGbits.TMR0CS           // bit 5, shadows bit in OPTION_REGbits
3993 #define T0CS                    OPTION_REGbits.T0CS             // bit 5, shadows bit in OPTION_REGbits
3994 #define INTEDG                  OPTION_REGbits.INTEDG           // bit 6
3995 #define NOT_WPUEN               OPTION_REGbits.NOT_WPUEN        // bit 7
3996 
3997 #define SCS0                    OSCCONbits.SCS0                 // bit 0
3998 #define SCS1                    OSCCONbits.SCS1                 // bit 1
3999 #define IRCF0                   OSCCONbits.IRCF0                // bit 2
4000 #define IRCF1                   OSCCONbits.IRCF1                // bit 3
4001 #define IRCF2                   OSCCONbits.IRCF2                // bit 4
4002 #define IRCF3                   OSCCONbits.IRCF3                // bit 5
4003 #define SPLLMULT                OSCCONbits.SPLLMULT             // bit 6
4004 #define SPLLEN                  OSCCONbits.SPLLEN               // bit 7
4005 
4006 #define HFIOFS                  OSCSTATbits.HFIOFS              // bit 0
4007 #define LFIOFR                  OSCSTATbits.LFIOFR              // bit 1
4008 #define HFIOFR                  OSCSTATbits.HFIOFR              // bit 4
4009 #define OSTS                    OSCSTATbits.OSTS                // bit 5
4010 #define PLLRDY                  OSCSTATbits.PLLRDY              // bit 6
4011 #define SOSCR                   OSCSTATbits.SOSCR               // bit 7
4012 
4013 #define TUN0                    OSCTUNEbits.TUN0                // bit 0
4014 #define TUN1                    OSCTUNEbits.TUN1                // bit 1
4015 #define TUN2                    OSCTUNEbits.TUN2                // bit 2
4016 #define TUN3                    OSCTUNEbits.TUN3                // bit 3
4017 #define TUN4                    OSCTUNEbits.TUN4                // bit 4
4018 #define TUN5                    OSCTUNEbits.TUN5                // bit 5
4019 #define TUN6                    OSCTUNEbits.TUN6                // bit 6
4020 
4021 #define NOT_BOR                 PCONbits.NOT_BOR                // bit 0
4022 #define NOT_POR                 PCONbits.NOT_POR                // bit 1
4023 #define NOT_RI                  PCONbits.NOT_RI                 // bit 2
4024 #define NOT_RMCLR               PCONbits.NOT_RMCLR              // bit 3
4025 #define NOT_RWDT                PCONbits.NOT_RWDT               // bit 4
4026 #define STKUNF                  PCONbits.STKUNF                 // bit 6
4027 #define STKOVF                  PCONbits.STKOVF                 // bit 7
4028 
4029 #define TMR1IE                  PIE1bits.TMR1IE                 // bit 0
4030 #define TMR2IE                  PIE1bits.TMR2IE                 // bit 1
4031 #define SSP1IE                  PIE1bits.SSP1IE                 // bit 3
4032 #define TXIE                    PIE1bits.TXIE                   // bit 4
4033 #define RCIE                    PIE1bits.RCIE                   // bit 5
4034 #define ADIE                    PIE1bits.ADIE                   // bit 6
4035 #define TMR1GIE                 PIE1bits.TMR1GIE                // bit 7
4036 
4037 #define CRIE                    PIE2bits.CRIE                   // bit 1
4038 #define USBIE                   PIE2bits.USBIE                  // bit 2
4039 #define BCL1IE                  PIE2bits.BCL1IE                 // bit 3
4040 #define C1IE                    PIE2bits.C1IE                   // bit 5
4041 #define C2IE                    PIE2bits.C2IE                   // bit 6
4042 #define OSFIE                   PIE2bits.OSFIE                  // bit 7
4043 
4044 #define TMR1IF                  PIR1bits.TMR1IF                 // bit 0
4045 #define TMR2IF                  PIR1bits.TMR2IF                 // bit 1
4046 #define SSP1IF                  PIR1bits.SSP1IF                 // bit 3
4047 #define TXIF                    PIR1bits.TXIF                   // bit 4
4048 #define RCIF                    PIR1bits.RCIF                   // bit 5
4049 #define ADIF                    PIR1bits.ADIF                   // bit 6
4050 #define TMR1GIF                 PIR1bits.TMR1GIF                // bit 7
4051 
4052 #define CRIF                    PIR2bits.CRIF                   // bit 1
4053 #define USBIF                   PIR2bits.USBIF                  // bit 2
4054 #define BCL1IF                  PIR2bits.BCL1IF                 // bit 3
4055 #define C1IF                    PIR2bits.C1IF                   // bit 5
4056 #define C2IF                    PIR2bits.C2IF                   // bit 6
4057 #define OSFIF                   PIR2bits.OSFIF                  // bit 7
4058 
4059 #define RD                      PMCON1bits.RD                   // bit 0
4060 #define WR                      PMCON1bits.WR                   // bit 1
4061 #define WREN                    PMCON1bits.WREN                 // bit 2
4062 #define WRERR                   PMCON1bits.WRERR                // bit 3
4063 #define FREE                    PMCON1bits.FREE                 // bit 4
4064 #define LWLO                    PMCON1bits.LWLO                 // bit 5
4065 #define CFGS                    PMCON1bits.CFGS                 // bit 6
4066 
4067 #define RA0                     PORTAbits.RA0                   // bit 0
4068 #define RA1                     PORTAbits.RA1                   // bit 1
4069 #define RA3                     PORTAbits.RA3                   // bit 3
4070 #define RA4                     PORTAbits.RA4                   // bit 4
4071 #define RA5                     PORTAbits.RA5                   // bit 5
4072 
4073 #define RB4                     PORTBbits.RB4                   // bit 4
4074 #define RB5                     PORTBbits.RB5                   // bit 5
4075 #define RB6                     PORTBbits.RB6                   // bit 6
4076 #define RB7                     PORTBbits.RB7                   // bit 7
4077 
4078 #define RC0                     PORTCbits.RC0                   // bit 0
4079 #define RC1                     PORTCbits.RC1                   // bit 1
4080 #define RC2                     PORTCbits.RC2                   // bit 2
4081 #define RC3                     PORTCbits.RC3                   // bit 3
4082 #define RC4                     PORTCbits.RC4                   // bit 4
4083 #define RC5                     PORTCbits.RC5                   // bit 5
4084 #define RC6                     PORTCbits.RC6                   // bit 6
4085 #define RC7                     PORTCbits.RC7                   // bit 7
4086 
4087 #define PWM1POL                 PWM1CONbits.PWM1POL             // bit 4
4088 #define PWM1OUT                 PWM1CONbits.PWM1OUT             // bit 5
4089 #define PWM1OE                  PWM1CONbits.PWM1OE              // bit 6
4090 #define PWM1EN                  PWM1CONbits.PWM1EN              // bit 7
4091 
4092 #define PWM1DCH0                PWM1DCHbits.PWM1DCH0            // bit 0
4093 #define PWM1DCH1                PWM1DCHbits.PWM1DCH1            // bit 1
4094 #define PWM1DCH2                PWM1DCHbits.PWM1DCH2            // bit 2
4095 #define PWM1DCH3                PWM1DCHbits.PWM1DCH3            // bit 3
4096 #define PWM1DCH4                PWM1DCHbits.PWM1DCH4            // bit 4
4097 #define PWM1DCH5                PWM1DCHbits.PWM1DCH5            // bit 5
4098 #define PWM1DCH6                PWM1DCHbits.PWM1DCH6            // bit 6
4099 #define PWM1DCH7                PWM1DCHbits.PWM1DCH7            // bit 7
4100 
4101 #define PWM1DCL0                PWM1DCLbits.PWM1DCL0            // bit 6
4102 #define PWM1DCL1                PWM1DCLbits.PWM1DCL1            // bit 7
4103 
4104 #define PWM2POL                 PWM2CONbits.PWM2POL             // bit 4
4105 #define PWM2OUT                 PWM2CONbits.PWM2OUT             // bit 5
4106 #define PWM2OE                  PWM2CONbits.PWM2OE              // bit 6
4107 #define PWM2EN                  PWM2CONbits.PWM2EN              // bit 7
4108 
4109 #define PWM2DCH0                PWM2DCHbits.PWM2DCH0            // bit 0
4110 #define PWM2DCH1                PWM2DCHbits.PWM2DCH1            // bit 1
4111 #define PWM2DCH2                PWM2DCHbits.PWM2DCH2            // bit 2
4112 #define PWM2DCH3                PWM2DCHbits.PWM2DCH3            // bit 3
4113 #define PWM2DCH4                PWM2DCHbits.PWM2DCH4            // bit 4
4114 #define PWM2DCH5                PWM2DCHbits.PWM2DCH5            // bit 5
4115 #define PWM2DCH6                PWM2DCHbits.PWM2DCH6            // bit 6
4116 #define PWM2DCH7                PWM2DCHbits.PWM2DCH7            // bit 7
4117 
4118 #define PWM2DCL0                PWM2DCLbits.PWM2DCL0            // bit 6
4119 #define PWM2DCL1                PWM2DCLbits.PWM2DCL1            // bit 7
4120 
4121 #define RX9D                    RCSTAbits.RX9D                  // bit 0
4122 #define OERR                    RCSTAbits.OERR                  // bit 1
4123 #define FERR                    RCSTAbits.FERR                  // bit 2
4124 #define ADDEN                   RCSTAbits.ADDEN                 // bit 3
4125 #define CREN                    RCSTAbits.CREN                  // bit 4
4126 #define SREN                    RCSTAbits.SREN                  // bit 5
4127 #define RX9                     RCSTAbits.RX9                   // bit 6
4128 #define SPEN                    RCSTAbits.SPEN                  // bit 7
4129 
4130 #define SSP1M0                  SSP1CON1bits.SSP1M0             // bit 0
4131 #define SSP1M1                  SSP1CON1bits.SSP1M1             // bit 1
4132 #define SSP1M2                  SSP1CON1bits.SSP1M2             // bit 2
4133 #define SSP1M3                  SSP1CON1bits.SSP1M3             // bit 3
4134 #define CKP                     SSP1CON1bits.CKP                // bit 4
4135 #define SSP1EN                  SSP1CON1bits.SSP1EN             // bit 5
4136 #define SSP1OV                  SSP1CON1bits.SSP1OV             // bit 6
4137 #define WCOL                    SSP1CON1bits.WCOL               // bit 7
4138 
4139 #define SEN                     SSP1CON2bits.SEN                // bit 0
4140 #define RSEN                    SSP1CON2bits.RSEN               // bit 1
4141 #define PEN                     SSP1CON2bits.PEN                // bit 2
4142 #define RCEN                    SSP1CON2bits.RCEN               // bit 3
4143 #define ACKEN                   SSP1CON2bits.ACKEN              // bit 4
4144 #define ACKDT                   SSP1CON2bits.ACKDT              // bit 5
4145 #define ACKSTAT                 SSP1CON2bits.ACKSTAT            // bit 6
4146 #define GCEN                    SSP1CON2bits.GCEN               // bit 7
4147 
4148 #define DHEN                    SSP1CON3bits.DHEN               // bit 0
4149 #define AHEN                    SSP1CON3bits.AHEN               // bit 1
4150 #define SBCDE                   SSP1CON3bits.SBCDE              // bit 2
4151 #define SDAHT                   SSP1CON3bits.SDAHT              // bit 3
4152 #define BOEN                    SSP1CON3bits.BOEN               // bit 4
4153 #define SCIE                    SSP1CON3bits.SCIE               // bit 5
4154 #define PCIE                    SSP1CON3bits.PCIE               // bit 6
4155 #define ACKTIM                  SSP1CON3bits.ACKTIM             // bit 7
4156 
4157 #define BF                      SSP1STATbits.BF                 // bit 0
4158 #define UA                      SSP1STATbits.UA                 // bit 1
4159 #define R_NOT_W                 SSP1STATbits.R_NOT_W            // bit 2
4160 #define S                       SSP1STATbits.S                  // bit 3
4161 #define P                       SSP1STATbits.P                  // bit 4
4162 #define D_NOT_A                 SSP1STATbits.D_NOT_A            // bit 5
4163 #define CKE                     SSP1STATbits.CKE                // bit 6
4164 #define SMP                     SSP1STATbits.SMP                // bit 7
4165 
4166 #define C                       STATUSbits.C                    // bit 0
4167 #define DC                      STATUSbits.DC                   // bit 1
4168 #define Z                       STATUSbits.Z                    // bit 2
4169 #define NOT_PD                  STATUSbits.NOT_PD               // bit 3
4170 #define NOT_TO                  STATUSbits.NOT_TO               // bit 4
4171 
4172 #define TMR1ON                  T1CONbits.TMR1ON                // bit 0
4173 #define NOT_T1SYNC              T1CONbits.NOT_T1SYNC            // bit 2
4174 #define T1OSCEN                 T1CONbits.T1OSCEN               // bit 3
4175 #define T1CKPS0                 T1CONbits.T1CKPS0               // bit 4
4176 #define T1CKPS1                 T1CONbits.T1CKPS1               // bit 5
4177 #define TMR1CS0                 T1CONbits.TMR1CS0               // bit 6
4178 #define TMR1CS1                 T1CONbits.TMR1CS1               // bit 7
4179 
4180 #define T1GSS0                  T1GCONbits.T1GSS0               // bit 0
4181 #define T1GSS1                  T1GCONbits.T1GSS1               // bit 1
4182 #define T1GVAL                  T1GCONbits.T1GVAL               // bit 2
4183 #define T1GGO_NOT_DONE          T1GCONbits.T1GGO_NOT_DONE       // bit 3
4184 #define T1GSPM                  T1GCONbits.T1GSPM               // bit 4
4185 #define T1GTM                   T1GCONbits.T1GTM                // bit 5
4186 #define T1GPOL                  T1GCONbits.T1GPOL               // bit 6
4187 #define TMR1GE                  T1GCONbits.TMR1GE               // bit 7
4188 
4189 #define T2CKPS0                 T2CONbits.T2CKPS0               // bit 0
4190 #define T2CKPS1                 T2CONbits.T2CKPS1               // bit 1
4191 #define TMR2ON                  T2CONbits.TMR2ON                // bit 2
4192 #define TOUTPS0                 T2CONbits.TOUTPS0               // bit 3
4193 #define TOUTPS1                 T2CONbits.TOUTPS1               // bit 4
4194 #define TOUTPS2                 T2CONbits.TOUTPS2               // bit 5
4195 #define TOUTPS3                 T2CONbits.TOUTPS3               // bit 6
4196 
4197 #define TRISA4                  TRISAbits.TRISA4                // bit 4
4198 #define TRISA5                  TRISAbits.TRISA5                // bit 5
4199 
4200 #define TRISB4                  TRISBbits.TRISB4                // bit 4
4201 #define TRISB5                  TRISBbits.TRISB5                // bit 5
4202 #define TRISB6                  TRISBbits.TRISB6                // bit 6
4203 #define TRISB7                  TRISBbits.TRISB7                // bit 7
4204 
4205 #define TRISC0                  TRISCbits.TRISC0                // bit 0
4206 #define TRISC1                  TRISCbits.TRISC1                // bit 1
4207 #define TRISC2                  TRISCbits.TRISC2                // bit 2
4208 #define TRISC3                  TRISCbits.TRISC3                // bit 3
4209 #define TRISC4                  TRISCbits.TRISC4                // bit 4
4210 #define TRISC5                  TRISCbits.TRISC5                // bit 5
4211 #define TRISC6                  TRISCbits.TRISC6                // bit 6
4212 #define TRISC7                  TRISCbits.TRISC7                // bit 7
4213 
4214 #define TX9D                    TXSTAbits.TX9D                  // bit 0
4215 #define TRMT                    TXSTAbits.TRMT                  // bit 1
4216 #define BRGH                    TXSTAbits.BRGH                  // bit 2
4217 #define SENDB                   TXSTAbits.SENDB                 // bit 3
4218 #define SYNC                    TXSTAbits.SYNC                  // bit 4
4219 #define TXEN                    TXSTAbits.TXEN                  // bit 5
4220 #define TX9                     TXSTAbits.TX9                   // bit 6
4221 #define CSRC                    TXSTAbits.CSRC                  // bit 7
4222 
4223 #define ADDR0                   UADDRbits.ADDR0                 // bit 0
4224 #define ADDR1                   UADDRbits.ADDR1                 // bit 1
4225 #define ADDR2                   UADDRbits.ADDR2                 // bit 2
4226 #define ADDR3                   UADDRbits.ADDR3                 // bit 3
4227 #define ADDR4                   UADDRbits.ADDR4                 // bit 4
4228 #define ADDR5                   UADDRbits.ADDR5                 // bit 5
4229 #define ADDR6                   UADDRbits.ADDR6                 // bit 6
4230 
4231 #define PPB0                    UCFGbits.PPB0                   // bit 0
4232 #define PPB1                    UCFGbits.PPB1                   // bit 1
4233 #define FSEN                    UCFGbits.FSEN                   // bit 2
4234 #define UPUEN                   UCFGbits.UPUEN                  // bit 4
4235 #define UTEYE                   UCFGbits.UTEYE                  // bit 7
4236 
4237 #define SUSPND                  UCONbits.SUSPND                 // bit 1
4238 #define RESUME                  UCONbits.RESUME                 // bit 2
4239 #define USBEN                   UCONbits.USBEN                  // bit 3
4240 #define PKTDIS                  UCONbits.PKTDIS                 // bit 4
4241 #define SE0                     UCONbits.SE0                    // bit 5
4242 #define PPBRST                  UCONbits.PPBRST                 // bit 6
4243 
4244 #define PIDEE                   UEIEbits.PIDEE                  // bit 0
4245 #define CRC5EE                  UEIEbits.CRC5EE                 // bit 1
4246 #define CRC16EE                 UEIEbits.CRC16EE                // bit 2
4247 #define DFN8EE                  UEIEbits.DFN8EE                 // bit 3
4248 #define BTOEE                   UEIEbits.BTOEE                  // bit 4
4249 #define BTSEE                   UEIEbits.BTSEE                  // bit 7
4250 
4251 #define PIDEF                   UEIRbits.PIDEF                  // bit 0
4252 #define CRC5EF                  UEIRbits.CRC5EF                 // bit 1
4253 #define CRC16EF                 UEIRbits.CRC16EF                // bit 2
4254 #define DFN8EF                  UEIRbits.DFN8EF                 // bit 3
4255 #define BTOEF                   UEIRbits.BTOEF                  // bit 4
4256 #define BTSEF                   UEIRbits.BTSEF                  // bit 7
4257 
4258 #define EPSTALL                 UEP0bits.EPSTALL                // bit 0
4259 #define EPINEN                  UEP0bits.EPINEN                 // bit 1
4260 #define EPOUTEN                 UEP0bits.EPOUTEN                // bit 2
4261 #define EPCONDIS                UEP0bits.EPCONDIS               // bit 3
4262 #define EPHSHK                  UEP0bits.EPHSHK                 // bit 4
4263 
4264 #define FRM8                    UFRMHbits.FRM8                  // bit 0
4265 #define FRM9                    UFRMHbits.FRM9                  // bit 1
4266 #define FRM10                   UFRMHbits.FRM10                 // bit 2
4267 
4268 #define FRM0                    UFRMLbits.FRM0                  // bit 0
4269 #define FRM1                    UFRMLbits.FRM1                  // bit 1
4270 #define FRM2                    UFRMLbits.FRM2                  // bit 2
4271 #define FRM3                    UFRMLbits.FRM3                  // bit 3
4272 #define FRM4                    UFRMLbits.FRM4                  // bit 4
4273 #define FRM5                    UFRMLbits.FRM5                  // bit 5
4274 #define FRM6                    UFRMLbits.FRM6                  // bit 6
4275 #define FRM7                    UFRMLbits.FRM7                  // bit 7
4276 
4277 #define URSTIE                  UIEbits.URSTIE                  // bit 0
4278 #define UERRIE                  UIEbits.UERRIE                  // bit 1
4279 #define ACTVIE                  UIEbits.ACTVIE                  // bit 2
4280 #define TRNIE                   UIEbits.TRNIE                   // bit 3
4281 #define IDLEIE                  UIEbits.IDLEIE                  // bit 4
4282 #define STALLIE                 UIEbits.STALLIE                 // bit 5
4283 #define SOFIE                   UIEbits.SOFIE                   // bit 6
4284 
4285 #define URSTIF                  UIRbits.URSTIF                  // bit 0
4286 #define UERRIF                  UIRbits.UERRIF                  // bit 1
4287 #define ACTVIF                  UIRbits.ACTVIF                  // bit 2
4288 #define TRNIF                   UIRbits.TRNIF                   // bit 3
4289 #define IDLEIF                  UIRbits.IDLEIF                  // bit 4
4290 #define STALLIF                 UIRbits.STALLIF                 // bit 5
4291 #define SOFIF                   UIRbits.SOFIF                   // bit 6
4292 
4293 #define PPBI                    USTATbits.PPBI                  // bit 1
4294 #define DIR                     USTATbits.DIR                   // bit 2
4295 #define ENDP0                   USTATbits.ENDP0                 // bit 3
4296 #define ENDP1                   USTATbits.ENDP1                 // bit 4
4297 #define ENDP2                   USTATbits.ENDP2                 // bit 5
4298 #define ENDP3                   USTATbits.ENDP3                 // bit 6
4299 
4300 #define SWDTEN                  WDTCONbits.SWDTEN               // bit 0
4301 #define WDTPS0                  WDTCONbits.WDTPS0               // bit 1
4302 #define WDTPS1                  WDTCONbits.WDTPS1               // bit 2
4303 #define WDTPS2                  WDTCONbits.WDTPS2               // bit 3
4304 #define WDTPS3                  WDTCONbits.WDTPS3               // bit 4
4305 #define WDTPS4                  WDTCONbits.WDTPS4               // bit 5
4306 
4307 #define WPUA3                   WPUAbits.WPUA3                  // bit 3
4308 #define WPUA4                   WPUAbits.WPUA4                  // bit 4
4309 #define WPUA5                   WPUAbits.WPUA5                  // bit 5
4310 
4311 #define WPUB4                   WPUBbits.WPUB4                  // bit 4
4312 #define WPUB5                   WPUBbits.WPUB5                  // bit 5
4313 #define WPUB6                   WPUBbits.WPUB6                  // bit 6
4314 #define WPUB7                   WPUBbits.WPUB7                  // bit 7
4315 
4316 #endif // #ifndef NO_BIT_DEFINES
4317 
4318 #endif // #ifndef __PIC16LF1458_H__
4319