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