1 /*
2  * This declarations of the PIC12F1822 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:19 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 __PIC12F1822_H__
26 #define __PIC12F1822_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 PIR1_ADDR               0x0011
52 #define PIR2_ADDR               0x0012
53 #define TMR0_ADDR               0x0015
54 #define TMR1_ADDR               0x0016
55 #define TMR1L_ADDR              0x0016
56 #define TMR1H_ADDR              0x0017
57 #define T1CON_ADDR              0x0018
58 #define T1GCON_ADDR             0x0019
59 #define TMR2_ADDR               0x001A
60 #define PR2_ADDR                0x001B
61 #define T2CON_ADDR              0x001C
62 #define CPSCON0_ADDR            0x001E
63 #define CPSCON1_ADDR            0x001F
64 #define TRISA_ADDR              0x008C
65 #define PIE1_ADDR               0x0091
66 #define PIE2_ADDR               0x0092
67 #define OPTION_REG_ADDR         0x0095
68 #define PCON_ADDR               0x0096
69 #define WDTCON_ADDR             0x0097
70 #define OSCTUNE_ADDR            0x0098
71 #define OSCCON_ADDR             0x0099
72 #define OSCSTAT_ADDR            0x009A
73 #define ADRES_ADDR              0x009B
74 #define ADRESL_ADDR             0x009B
75 #define ADRESH_ADDR             0x009C
76 #define ADCON0_ADDR             0x009D
77 #define ADCON1_ADDR             0x009E
78 #define LATA_ADDR               0x010C
79 #define CM1CON0_ADDR            0x0111
80 #define CM1CON1_ADDR            0x0112
81 #define CMOUT_ADDR              0x0115
82 #define BORCON_ADDR             0x0116
83 #define FVRCON_ADDR             0x0117
84 #define DACCON0_ADDR            0x0118
85 #define DACCON1_ADDR            0x0119
86 #define SRCON0_ADDR             0x011A
87 #define SRCON1_ADDR             0x011B
88 #define APFCON_ADDR             0x011D
89 #define APFCON0_ADDR            0x011D
90 #define ANSELA_ADDR             0x018C
91 #define EEADR_ADDR              0x0191
92 #define EEADRL_ADDR             0x0191
93 #define EEADRH_ADDR             0x0192
94 #define EEDAT_ADDR              0x0193
95 #define EEDATL_ADDR             0x0193
96 #define EEDATH_ADDR             0x0194
97 #define EECON1_ADDR             0x0195
98 #define EECON2_ADDR             0x0196
99 #define RCREG_ADDR              0x0199
100 #define TXREG_ADDR              0x019A
101 #define SP1BRG_ADDR             0x019B
102 #define SP1BRGL_ADDR            0x019B
103 #define SPBRG_ADDR              0x019B
104 #define SPBRGL_ADDR             0x019B
105 #define SP1BRGH_ADDR            0x019C
106 #define SPBRGH_ADDR             0x019C
107 #define RCSTA_ADDR              0x019D
108 #define TXSTA_ADDR              0x019E
109 #define BAUDCON_ADDR            0x019F
110 #define WPUA_ADDR               0x020C
111 #define SSP1BUF_ADDR            0x0211
112 #define SSPBUF_ADDR             0x0211
113 #define SSP1ADD_ADDR            0x0212
114 #define SSPADD_ADDR             0x0212
115 #define SSP1MSK_ADDR            0x0213
116 #define SSPMSK_ADDR             0x0213
117 #define SSP1STAT_ADDR           0x0214
118 #define SSPSTAT_ADDR            0x0214
119 #define SSP1CON1_ADDR           0x0215
120 #define SSPCON_ADDR             0x0215
121 #define SSPCON1_ADDR            0x0215
122 #define SSP1CON2_ADDR           0x0216
123 #define SSPCON2_ADDR            0x0216
124 #define SSP1CON3_ADDR           0x0217
125 #define SSPCON3_ADDR            0x0217
126 #define CCPR1_ADDR              0x0291
127 #define CCPR1L_ADDR             0x0291
128 #define CCPR1H_ADDR             0x0292
129 #define CCP1CON_ADDR            0x0293
130 #define PWM1CON_ADDR            0x0294
131 #define CCP1AS_ADDR             0x0295
132 #define ECCP1AS_ADDR            0x0295
133 #define PSTR1CON_ADDR           0x0296
134 #define IOCAP_ADDR              0x0391
135 #define IOCAN_ADDR              0x0392
136 #define IOCAF_ADDR              0x0393
137 #define CLKRCON_ADDR            0x039A
138 #define MDCON_ADDR              0x039C
139 #define MDSRC_ADDR              0x039D
140 #define MDCARL_ADDR             0x039E
141 #define MDCARH_ADDR             0x039F
142 #define STATUS_SHAD_ADDR        0x0FE4
143 #define WREG_SHAD_ADDR          0x0FE5
144 #define BSR_SHAD_ADDR           0x0FE6
145 #define PCLATH_SHAD_ADDR        0x0FE7
146 #define FSR0L_SHAD_ADDR         0x0FE8
147 #define FSR0H_SHAD_ADDR         0x0FE9
148 #define FSR1L_SHAD_ADDR         0x0FEA
149 #define FSR1H_SHAD_ADDR         0x0FEB
150 #define STKPTR_ADDR             0x0FED
151 #define TOSL_ADDR               0x0FEE
152 #define TOSH_ADDR               0x0FEF
153 
154 #endif // #ifndef NO_ADDR_DEFINES
155 
156 //==============================================================================
157 //
158 //	Register Definitions
159 //
160 //==============================================================================
161 
162 extern __at(0x0000) __sfr INDF0;
163 extern __at(0x0001) __sfr INDF1;
164 extern __at(0x0002) __sfr PCL;
165 
166 //==============================================================================
167 //        STATUS Bits
168 
169 extern __at(0x0003) __sfr STATUS;
170 
171 typedef struct
172   {
173   unsigned C                    : 1;
174   unsigned DC                   : 1;
175   unsigned Z                    : 1;
176   unsigned NOT_PD               : 1;
177   unsigned NOT_TO               : 1;
178   unsigned                      : 1;
179   unsigned                      : 1;
180   unsigned                      : 1;
181   } __STATUSbits_t;
182 
183 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
184 
185 #define _C                      0x01
186 #define _DC                     0x02
187 #define _Z                      0x04
188 #define _NOT_PD                 0x08
189 #define _NOT_TO                 0x10
190 
191 //==============================================================================
192 
193 extern __at(0x0004) __sfr FSR0;
194 extern __at(0x0004) __sfr FSR0L;
195 extern __at(0x0005) __sfr FSR0H;
196 extern __at(0x0006) __sfr FSR1;
197 extern __at(0x0006) __sfr FSR1L;
198 extern __at(0x0007) __sfr FSR1H;
199 
200 //==============================================================================
201 //        BSR Bits
202 
203 extern __at(0x0008) __sfr BSR;
204 
205 typedef union
206   {
207   struct
208     {
209     unsigned BSR0               : 1;
210     unsigned BSR1               : 1;
211     unsigned BSR2               : 1;
212     unsigned BSR3               : 1;
213     unsigned BSR4               : 1;
214     unsigned                    : 1;
215     unsigned                    : 1;
216     unsigned                    : 1;
217     };
218 
219   struct
220     {
221     unsigned BSR                : 5;
222     unsigned                    : 3;
223     };
224   } __BSRbits_t;
225 
226 extern __at(0x0008) volatile __BSRbits_t BSRbits;
227 
228 #define _BSR0                   0x01
229 #define _BSR1                   0x02
230 #define _BSR2                   0x04
231 #define _BSR3                   0x08
232 #define _BSR4                   0x10
233 
234 //==============================================================================
235 
236 extern __at(0x0009) __sfr WREG;
237 extern __at(0x000A) __sfr PCLATH;
238 
239 //==============================================================================
240 //        INTCON Bits
241 
242 extern __at(0x000B) __sfr INTCON;
243 
244 typedef union
245   {
246   struct
247     {
248     unsigned IOCIF              : 1;
249     unsigned INTF               : 1;
250     unsigned TMR0IF             : 1;
251     unsigned IOCIE              : 1;
252     unsigned INTE               : 1;
253     unsigned TMR0IE             : 1;
254     unsigned PEIE               : 1;
255     unsigned GIE                : 1;
256     };
257 
258   struct
259     {
260     unsigned                    : 1;
261     unsigned                    : 1;
262     unsigned T0IF               : 1;
263     unsigned                    : 1;
264     unsigned                    : 1;
265     unsigned T0IE               : 1;
266     unsigned                    : 1;
267     unsigned                    : 1;
268     };
269   } __INTCONbits_t;
270 
271 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
272 
273 #define _IOCIF                  0x01
274 #define _INTF                   0x02
275 #define _TMR0IF                 0x04
276 #define _T0IF                   0x04
277 #define _IOCIE                  0x08
278 #define _INTE                   0x10
279 #define _TMR0IE                 0x20
280 #define _T0IE                   0x20
281 #define _PEIE                   0x40
282 #define _GIE                    0x80
283 
284 //==============================================================================
285 
286 
287 //==============================================================================
288 //        PORTA Bits
289 
290 extern __at(0x000C) __sfr PORTA;
291 
292 typedef union
293   {
294   struct
295     {
296     unsigned RA0                : 1;
297     unsigned RA1                : 1;
298     unsigned RA2                : 1;
299     unsigned RA3                : 1;
300     unsigned RA4                : 1;
301     unsigned RA5                : 1;
302     unsigned                    : 1;
303     unsigned                    : 1;
304     };
305 
306   struct
307     {
308     unsigned AN0                : 1;
309     unsigned AN1                : 1;
310     unsigned AN2                : 1;
311     unsigned NOT_MCLR           : 1;
312     unsigned AN3                : 1;
313     unsigned SRNQ               : 1;
314     unsigned                    : 1;
315     unsigned                    : 1;
316     };
317 
318   struct
319     {
320     unsigned CPS0               : 1;
321     unsigned CPS1               : 1;
322     unsigned CPS2               : 1;
323     unsigned                    : 1;
324     unsigned CPS3               : 1;
325     unsigned T1CKI              : 1;
326     unsigned                    : 1;
327     unsigned                    : 1;
328     };
329 
330   struct
331     {
332     unsigned C1INP              : 1;
333     unsigned C1IN0N             : 1;
334     unsigned C1OUT              : 1;
335     unsigned                    : 1;
336     unsigned C1IN1N             : 1;
337     unsigned T1OSI              : 1;
338     unsigned                    : 1;
339     unsigned                    : 1;
340     };
341 
342   struct
343     {
344     unsigned DACOUT             : 1;
345     unsigned SRI                : 1;
346     unsigned SRQ                : 1;
347     unsigned                    : 1;
348     unsigned T1OSO              : 1;
349     unsigned OSC1               : 1;
350     unsigned                    : 1;
351     unsigned                    : 1;
352     };
353 
354   struct
355     {
356     unsigned MDOUT              : 1;
357     unsigned SCK                : 1;
358     unsigned T0CKI              : 1;
359     unsigned                    : 1;
360     unsigned CLKR               : 1;
361     unsigned CLKIN              : 1;
362     unsigned                    : 1;
363     unsigned                    : 1;
364     };
365 
366   struct
367     {
368     unsigned                    : 1;
369     unsigned SCL                : 1;
370     unsigned SDA                : 1;
371     unsigned                    : 1;
372     unsigned MDCIN2             : 1;
373     unsigned                    : 1;
374     unsigned                    : 1;
375     unsigned                    : 1;
376     };
377 
378   struct
379     {
380     unsigned                    : 1;
381     unsigned MDMIN              : 1;
382     unsigned MDCIN1             : 1;
383     unsigned                    : 1;
384     unsigned OSC2               : 1;
385     unsigned                    : 1;
386     unsigned                    : 1;
387     unsigned                    : 1;
388     };
389 
390   struct
391     {
392     unsigned                    : 1;
393     unsigned                    : 1;
394     unsigned SDI                : 1;
395     unsigned                    : 1;
396     unsigned CLKOUT             : 1;
397     unsigned                    : 1;
398     unsigned                    : 1;
399     unsigned                    : 1;
400     };
401 
402   struct
403     {
404     unsigned                    : 1;
405     unsigned                    : 1;
406     unsigned FLT0               : 1;
407     unsigned                    : 1;
408     unsigned                    : 1;
409     unsigned                    : 1;
410     unsigned                    : 1;
411     unsigned                    : 1;
412     };
413 
414   struct
415     {
416     unsigned RA                 : 6;
417     unsigned                    : 2;
418     };
419   } __PORTAbits_t;
420 
421 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
422 
423 #define _PORTA_RA0              0x01
424 #define _PORTA_AN0              0x01
425 #define _PORTA_CPS0             0x01
426 #define _PORTA_C1INP            0x01
427 #define _PORTA_DACOUT           0x01
428 #define _PORTA_MDOUT            0x01
429 #define _PORTA_RA1              0x02
430 #define _PORTA_AN1              0x02
431 #define _PORTA_CPS1             0x02
432 #define _PORTA_C1IN0N           0x02
433 #define _PORTA_SRI              0x02
434 #define _PORTA_SCK              0x02
435 #define _PORTA_SCL              0x02
436 #define _PORTA_MDMIN            0x02
437 #define _PORTA_RA2              0x04
438 #define _PORTA_AN2              0x04
439 #define _PORTA_CPS2             0x04
440 #define _PORTA_C1OUT            0x04
441 #define _PORTA_SRQ              0x04
442 #define _PORTA_T0CKI            0x04
443 #define _PORTA_SDA              0x04
444 #define _PORTA_MDCIN1           0x04
445 #define _PORTA_SDI              0x04
446 #define _PORTA_FLT0             0x04
447 #define _PORTA_RA3              0x08
448 #define _PORTA_NOT_MCLR         0x08
449 #define _PORTA_RA4              0x10
450 #define _PORTA_AN3              0x10
451 #define _PORTA_CPS3             0x10
452 #define _PORTA_C1IN1N           0x10
453 #define _PORTA_T1OSO            0x10
454 #define _PORTA_CLKR             0x10
455 #define _PORTA_MDCIN2           0x10
456 #define _PORTA_OSC2             0x10
457 #define _PORTA_CLKOUT           0x10
458 #define _PORTA_RA5              0x20
459 #define _PORTA_SRNQ             0x20
460 #define _PORTA_T1CKI            0x20
461 #define _PORTA_T1OSI            0x20
462 #define _PORTA_OSC1             0x20
463 #define _PORTA_CLKIN            0x20
464 
465 //==============================================================================
466 
467 
468 //==============================================================================
469 //        PIR1 Bits
470 
471 extern __at(0x0011) __sfr PIR1;
472 
473 typedef struct
474   {
475   unsigned TMR1IF               : 1;
476   unsigned TMR2IF               : 1;
477   unsigned CCP1IF               : 1;
478   unsigned SSP1IF               : 1;
479   unsigned TXIF                 : 1;
480   unsigned RCIF                 : 1;
481   unsigned ADIF                 : 1;
482   unsigned TMR1GIF              : 1;
483   } __PIR1bits_t;
484 
485 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
486 
487 #define _TMR1IF                 0x01
488 #define _TMR2IF                 0x02
489 #define _CCP1IF                 0x04
490 #define _SSP1IF                 0x08
491 #define _TXIF                   0x10
492 #define _RCIF                   0x20
493 #define _ADIF                   0x40
494 #define _TMR1GIF                0x80
495 
496 //==============================================================================
497 
498 
499 //==============================================================================
500 //        PIR2 Bits
501 
502 extern __at(0x0012) __sfr PIR2;
503 
504 typedef struct
505   {
506   unsigned                      : 1;
507   unsigned                      : 1;
508   unsigned                      : 1;
509   unsigned BCL1IF               : 1;
510   unsigned EEIF                 : 1;
511   unsigned C1IF                 : 1;
512   unsigned                      : 1;
513   unsigned OSFIF                : 1;
514   } __PIR2bits_t;
515 
516 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
517 
518 #define _BCL1IF                 0x08
519 #define _EEIF                   0x10
520 #define _C1IF                   0x20
521 #define _OSFIF                  0x80
522 
523 //==============================================================================
524 
525 extern __at(0x0015) __sfr TMR0;
526 extern __at(0x0016) __sfr TMR1;
527 extern __at(0x0016) __sfr TMR1L;
528 extern __at(0x0017) __sfr TMR1H;
529 
530 //==============================================================================
531 //        T1CON Bits
532 
533 extern __at(0x0018) __sfr T1CON;
534 
535 typedef union
536   {
537   struct
538     {
539     unsigned TMR1ON             : 1;
540     unsigned                    : 1;
541     unsigned NOT_T1SYNC         : 1;
542     unsigned T1OSCEN            : 1;
543     unsigned T1CKPS0            : 1;
544     unsigned T1CKPS1            : 1;
545     unsigned TMR1CS0            : 1;
546     unsigned TMR1CS1            : 1;
547     };
548 
549   struct
550     {
551     unsigned                    : 4;
552     unsigned T1CKPS             : 2;
553     unsigned                    : 2;
554     };
555 
556   struct
557     {
558     unsigned                    : 6;
559     unsigned TMR1CS             : 2;
560     };
561   } __T1CONbits_t;
562 
563 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
564 
565 #define _TMR1ON                 0x01
566 #define _NOT_T1SYNC             0x04
567 #define _T1OSCEN                0x08
568 #define _T1CKPS0                0x10
569 #define _T1CKPS1                0x20
570 #define _TMR1CS0                0x40
571 #define _TMR1CS1                0x80
572 
573 //==============================================================================
574 
575 
576 //==============================================================================
577 //        T1GCON Bits
578 
579 extern __at(0x0019) __sfr T1GCON;
580 
581 typedef union
582   {
583   struct
584     {
585     unsigned T1GSS0             : 1;
586     unsigned T1GSS1             : 1;
587     unsigned T1GVAL             : 1;
588     unsigned T1GGO_NOT_DONE     : 1;
589     unsigned T1GSPM             : 1;
590     unsigned T1GTM              : 1;
591     unsigned T1GPOL             : 1;
592     unsigned TMR1GE             : 1;
593     };
594 
595   struct
596     {
597     unsigned                    : 1;
598     unsigned                    : 1;
599     unsigned                    : 1;
600     unsigned T1GGO              : 1;
601     unsigned                    : 1;
602     unsigned                    : 1;
603     unsigned                    : 1;
604     unsigned                    : 1;
605     };
606 
607   struct
608     {
609     unsigned T1GSS              : 2;
610     unsigned                    : 6;
611     };
612   } __T1GCONbits_t;
613 
614 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
615 
616 #define _T1GSS0                 0x01
617 #define _T1GSS1                 0x02
618 #define _T1GVAL                 0x04
619 #define _T1GGO_NOT_DONE         0x08
620 #define _T1GGO                  0x08
621 #define _T1GSPM                 0x10
622 #define _T1GTM                  0x20
623 #define _T1GPOL                 0x40
624 #define _TMR1GE                 0x80
625 
626 //==============================================================================
627 
628 extern __at(0x001A) __sfr TMR2;
629 extern __at(0x001B) __sfr PR2;
630 
631 //==============================================================================
632 //        T2CON Bits
633 
634 extern __at(0x001C) __sfr T2CON;
635 
636 typedef union
637   {
638   struct
639     {
640     unsigned T2CKPS0            : 1;
641     unsigned T2CKPS1            : 1;
642     unsigned TMR2ON             : 1;
643     unsigned T2OUTPS0           : 1;
644     unsigned T2OUTPS1           : 1;
645     unsigned T2OUTPS2           : 1;
646     unsigned T2OUTPS3           : 1;
647     unsigned                    : 1;
648     };
649 
650   struct
651     {
652     unsigned T2CKPS             : 2;
653     unsigned                    : 6;
654     };
655 
656   struct
657     {
658     unsigned                    : 3;
659     unsigned T2OUTPS            : 4;
660     unsigned                    : 1;
661     };
662   } __T2CONbits_t;
663 
664 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
665 
666 #define _T2CKPS0                0x01
667 #define _T2CKPS1                0x02
668 #define _TMR2ON                 0x04
669 #define _T2OUTPS0               0x08
670 #define _T2OUTPS1               0x10
671 #define _T2OUTPS2               0x20
672 #define _T2OUTPS3               0x40
673 
674 //==============================================================================
675 
676 
677 //==============================================================================
678 //        CPSCON0 Bits
679 
680 extern __at(0x001E) __sfr CPSCON0;
681 
682 typedef union
683   {
684   struct
685     {
686     unsigned T0XCS              : 1;
687     unsigned CPSOUT             : 1;
688     unsigned CPSRNG0            : 1;
689     unsigned CPSRNG1            : 1;
690     unsigned                    : 1;
691     unsigned                    : 1;
692     unsigned CPSRM              : 1;
693     unsigned CPSON              : 1;
694     };
695 
696   struct
697     {
698     unsigned                    : 2;
699     unsigned CPSRNG             : 2;
700     unsigned                    : 4;
701     };
702   } __CPSCON0bits_t;
703 
704 extern __at(0x001E) volatile __CPSCON0bits_t CPSCON0bits;
705 
706 #define _T0XCS                  0x01
707 #define _CPSOUT                 0x02
708 #define _CPSRNG0                0x04
709 #define _CPSRNG1                0x08
710 #define _CPSRM                  0x40
711 #define _CPSON                  0x80
712 
713 //==============================================================================
714 
715 
716 //==============================================================================
717 //        CPSCON1 Bits
718 
719 extern __at(0x001F) __sfr CPSCON1;
720 
721 typedef union
722   {
723   struct
724     {
725     unsigned CPSCH0             : 1;
726     unsigned CPSCH1             : 1;
727     unsigned                    : 1;
728     unsigned                    : 1;
729     unsigned                    : 1;
730     unsigned                    : 1;
731     unsigned                    : 1;
732     unsigned                    : 1;
733     };
734 
735   struct
736     {
737     unsigned CPSCH              : 2;
738     unsigned                    : 6;
739     };
740   } __CPSCON1bits_t;
741 
742 extern __at(0x001F) volatile __CPSCON1bits_t CPSCON1bits;
743 
744 #define _CPSCH0                 0x01
745 #define _CPSCH1                 0x02
746 
747 //==============================================================================
748 
749 
750 //==============================================================================
751 //        TRISA Bits
752 
753 extern __at(0x008C) __sfr TRISA;
754 
755 typedef union
756   {
757   struct
758     {
759     unsigned TRISA0             : 1;
760     unsigned TRISA1             : 1;
761     unsigned TRISA2             : 1;
762     unsigned TRISA3             : 1;
763     unsigned TRISA4             : 1;
764     unsigned TRISA5             : 1;
765     unsigned                    : 1;
766     unsigned                    : 1;
767     };
768 
769   struct
770     {
771     unsigned TRISA              : 6;
772     unsigned                    : 2;
773     };
774   } __TRISAbits_t;
775 
776 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
777 
778 #define _TRISA0                 0x01
779 #define _TRISA1                 0x02
780 #define _TRISA2                 0x04
781 #define _TRISA3                 0x08
782 #define _TRISA4                 0x10
783 #define _TRISA5                 0x20
784 
785 //==============================================================================
786 
787 
788 //==============================================================================
789 //        PIE1 Bits
790 
791 extern __at(0x0091) __sfr PIE1;
792 
793 typedef struct
794   {
795   unsigned TMR1IE               : 1;
796   unsigned TMR2IE               : 1;
797   unsigned CCP1IE               : 1;
798   unsigned SSP1IE               : 1;
799   unsigned TXIE                 : 1;
800   unsigned RCIE                 : 1;
801   unsigned ADIE                 : 1;
802   unsigned TMR1GIE              : 1;
803   } __PIE1bits_t;
804 
805 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
806 
807 #define _TMR1IE                 0x01
808 #define _TMR2IE                 0x02
809 #define _CCP1IE                 0x04
810 #define _SSP1IE                 0x08
811 #define _TXIE                   0x10
812 #define _RCIE                   0x20
813 #define _ADIE                   0x40
814 #define _TMR1GIE                0x80
815 
816 //==============================================================================
817 
818 
819 //==============================================================================
820 //        PIE2 Bits
821 
822 extern __at(0x0092) __sfr PIE2;
823 
824 typedef struct
825   {
826   unsigned                      : 1;
827   unsigned                      : 1;
828   unsigned                      : 1;
829   unsigned BCL1IE               : 1;
830   unsigned EEIE                 : 1;
831   unsigned C1IE                 : 1;
832   unsigned                      : 1;
833   unsigned OSFIE                : 1;
834   } __PIE2bits_t;
835 
836 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
837 
838 #define _BCL1IE                 0x08
839 #define _EEIE                   0x10
840 #define _C1IE                   0x20
841 #define _OSFIE                  0x80
842 
843 //==============================================================================
844 
845 
846 //==============================================================================
847 //        OPTION_REG Bits
848 
849 extern __at(0x0095) __sfr OPTION_REG;
850 
851 typedef union
852   {
853   struct
854     {
855     unsigned PS0                : 1;
856     unsigned PS1                : 1;
857     unsigned PS2                : 1;
858     unsigned PSA                : 1;
859     unsigned TMR0SE             : 1;
860     unsigned TMR0CS             : 1;
861     unsigned INTEDG             : 1;
862     unsigned NOT_WPUEN          : 1;
863     };
864 
865   struct
866     {
867     unsigned                    : 1;
868     unsigned                    : 1;
869     unsigned                    : 1;
870     unsigned                    : 1;
871     unsigned T0SE               : 1;
872     unsigned T0CS               : 1;
873     unsigned                    : 1;
874     unsigned                    : 1;
875     };
876 
877   struct
878     {
879     unsigned PS                 : 3;
880     unsigned                    : 5;
881     };
882   } __OPTION_REGbits_t;
883 
884 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
885 
886 #define _PS0                    0x01
887 #define _PS1                    0x02
888 #define _PS2                    0x04
889 #define _PSA                    0x08
890 #define _TMR0SE                 0x10
891 #define _T0SE                   0x10
892 #define _TMR0CS                 0x20
893 #define _T0CS                   0x20
894 #define _INTEDG                 0x40
895 #define _NOT_WPUEN              0x80
896 
897 //==============================================================================
898 
899 
900 //==============================================================================
901 //        PCON Bits
902 
903 extern __at(0x0096) __sfr PCON;
904 
905 typedef struct
906   {
907   unsigned NOT_BOR              : 1;
908   unsigned NOT_POR              : 1;
909   unsigned NOT_RI               : 1;
910   unsigned NOT_RMCLR            : 1;
911   unsigned                      : 1;
912   unsigned                      : 1;
913   unsigned STKUNF               : 1;
914   unsigned STKOVF               : 1;
915   } __PCONbits_t;
916 
917 extern __at(0x0096) volatile __PCONbits_t PCONbits;
918 
919 #define _NOT_BOR                0x01
920 #define _NOT_POR                0x02
921 #define _NOT_RI                 0x04
922 #define _NOT_RMCLR              0x08
923 #define _STKUNF                 0x40
924 #define _STKOVF                 0x80
925 
926 //==============================================================================
927 
928 
929 //==============================================================================
930 //        WDTCON Bits
931 
932 extern __at(0x0097) __sfr WDTCON;
933 
934 typedef union
935   {
936   struct
937     {
938     unsigned SWDTEN             : 1;
939     unsigned WDTPS0             : 1;
940     unsigned WDTPS1             : 1;
941     unsigned WDTPS2             : 1;
942     unsigned WDTPS3             : 1;
943     unsigned WDTPS4             : 1;
944     unsigned                    : 1;
945     unsigned                    : 1;
946     };
947 
948   struct
949     {
950     unsigned                    : 1;
951     unsigned WDTPS              : 5;
952     unsigned                    : 2;
953     };
954   } __WDTCONbits_t;
955 
956 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
957 
958 #define _SWDTEN                 0x01
959 #define _WDTPS0                 0x02
960 #define _WDTPS1                 0x04
961 #define _WDTPS2                 0x08
962 #define _WDTPS3                 0x10
963 #define _WDTPS4                 0x20
964 
965 //==============================================================================
966 
967 
968 //==============================================================================
969 //        OSCTUNE Bits
970 
971 extern __at(0x0098) __sfr OSCTUNE;
972 
973 typedef union
974   {
975   struct
976     {
977     unsigned TUN0               : 1;
978     unsigned TUN1               : 1;
979     unsigned TUN2               : 1;
980     unsigned TUN3               : 1;
981     unsigned TUN4               : 1;
982     unsigned TUN5               : 1;
983     unsigned                    : 1;
984     unsigned                    : 1;
985     };
986 
987   struct
988     {
989     unsigned TUN                : 6;
990     unsigned                    : 2;
991     };
992   } __OSCTUNEbits_t;
993 
994 extern __at(0x0098) volatile __OSCTUNEbits_t OSCTUNEbits;
995 
996 #define _TUN0                   0x01
997 #define _TUN1                   0x02
998 #define _TUN2                   0x04
999 #define _TUN3                   0x08
1000 #define _TUN4                   0x10
1001 #define _TUN5                   0x20
1002 
1003 //==============================================================================
1004 
1005 
1006 //==============================================================================
1007 //        OSCCON Bits
1008 
1009 extern __at(0x0099) __sfr OSCCON;
1010 
1011 typedef union
1012   {
1013   struct
1014     {
1015     unsigned SCS0               : 1;
1016     unsigned SCS1               : 1;
1017     unsigned                    : 1;
1018     unsigned IRCF0              : 1;
1019     unsigned IRCF1              : 1;
1020     unsigned IRCF2              : 1;
1021     unsigned IRCF3              : 1;
1022     unsigned SPLLEN             : 1;
1023     };
1024 
1025   struct
1026     {
1027     unsigned SCS                : 2;
1028     unsigned                    : 6;
1029     };
1030 
1031   struct
1032     {
1033     unsigned                    : 3;
1034     unsigned IRCF               : 4;
1035     unsigned                    : 1;
1036     };
1037   } __OSCCONbits_t;
1038 
1039 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
1040 
1041 #define _SCS0                   0x01
1042 #define _SCS1                   0x02
1043 #define _IRCF0                  0x08
1044 #define _IRCF1                  0x10
1045 #define _IRCF2                  0x20
1046 #define _IRCF3                  0x40
1047 #define _SPLLEN                 0x80
1048 
1049 //==============================================================================
1050 
1051 
1052 //==============================================================================
1053 //        OSCSTAT Bits
1054 
1055 extern __at(0x009A) __sfr OSCSTAT;
1056 
1057 typedef struct
1058   {
1059   unsigned HFIOFS               : 1;
1060   unsigned LFIOFR               : 1;
1061   unsigned MFIOFR               : 1;
1062   unsigned HFIOFL               : 1;
1063   unsigned HFIOFR               : 1;
1064   unsigned OSTS                 : 1;
1065   unsigned PLLR                 : 1;
1066   unsigned T1OSCR               : 1;
1067   } __OSCSTATbits_t;
1068 
1069 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
1070 
1071 #define _HFIOFS                 0x01
1072 #define _LFIOFR                 0x02
1073 #define _MFIOFR                 0x04
1074 #define _HFIOFL                 0x08
1075 #define _HFIOFR                 0x10
1076 #define _OSTS                   0x20
1077 #define _PLLR                   0x40
1078 #define _T1OSCR                 0x80
1079 
1080 //==============================================================================
1081 
1082 extern __at(0x009B) __sfr ADRES;
1083 extern __at(0x009B) __sfr ADRESL;
1084 extern __at(0x009C) __sfr ADRESH;
1085 
1086 //==============================================================================
1087 //        ADCON0 Bits
1088 
1089 extern __at(0x009D) __sfr ADCON0;
1090 
1091 typedef union
1092   {
1093   struct
1094     {
1095     unsigned ADON               : 1;
1096     unsigned GO_NOT_DONE        : 1;
1097     unsigned CHS0               : 1;
1098     unsigned CHS1               : 1;
1099     unsigned CHS2               : 1;
1100     unsigned CHS3               : 1;
1101     unsigned CHS4               : 1;
1102     unsigned                    : 1;
1103     };
1104 
1105   struct
1106     {
1107     unsigned                    : 1;
1108     unsigned ADGO               : 1;
1109     unsigned                    : 1;
1110     unsigned                    : 1;
1111     unsigned                    : 1;
1112     unsigned                    : 1;
1113     unsigned                    : 1;
1114     unsigned                    : 1;
1115     };
1116 
1117   struct
1118     {
1119     unsigned                    : 1;
1120     unsigned GO                 : 1;
1121     unsigned                    : 1;
1122     unsigned                    : 1;
1123     unsigned                    : 1;
1124     unsigned                    : 1;
1125     unsigned                    : 1;
1126     unsigned                    : 1;
1127     };
1128 
1129   struct
1130     {
1131     unsigned                    : 1;
1132     unsigned NOT_DONE           : 1;
1133     unsigned                    : 1;
1134     unsigned                    : 1;
1135     unsigned                    : 1;
1136     unsigned                    : 1;
1137     unsigned                    : 1;
1138     unsigned                    : 1;
1139     };
1140 
1141   struct
1142     {
1143     unsigned                    : 2;
1144     unsigned CHS                : 5;
1145     unsigned                    : 1;
1146     };
1147   } __ADCON0bits_t;
1148 
1149 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1150 
1151 #define _ADON                   0x01
1152 #define _GO_NOT_DONE            0x02
1153 #define _ADGO                   0x02
1154 #define _GO                     0x02
1155 #define _NOT_DONE               0x02
1156 #define _CHS0                   0x04
1157 #define _CHS1                   0x08
1158 #define _CHS2                   0x10
1159 #define _CHS3                   0x20
1160 #define _CHS4                   0x40
1161 
1162 //==============================================================================
1163 
1164 
1165 //==============================================================================
1166 //        ADCON1 Bits
1167 
1168 extern __at(0x009E) __sfr ADCON1;
1169 
1170 typedef union
1171   {
1172   struct
1173     {
1174     unsigned ADPREF0            : 1;
1175     unsigned ADPREF1            : 1;
1176     unsigned                    : 1;
1177     unsigned                    : 1;
1178     unsigned ADCS0              : 1;
1179     unsigned ADCS1              : 1;
1180     unsigned ADCS2              : 1;
1181     unsigned ADFM               : 1;
1182     };
1183 
1184   struct
1185     {
1186     unsigned ADPREF             : 2;
1187     unsigned                    : 6;
1188     };
1189 
1190   struct
1191     {
1192     unsigned                    : 4;
1193     unsigned ADCS               : 3;
1194     unsigned                    : 1;
1195     };
1196   } __ADCON1bits_t;
1197 
1198 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1199 
1200 #define _ADPREF0                0x01
1201 #define _ADPREF1                0x02
1202 #define _ADCS0                  0x10
1203 #define _ADCS1                  0x20
1204 #define _ADCS2                  0x40
1205 #define _ADFM                   0x80
1206 
1207 //==============================================================================
1208 
1209 
1210 //==============================================================================
1211 //        LATA Bits
1212 
1213 extern __at(0x010C) __sfr LATA;
1214 
1215 typedef struct
1216   {
1217   unsigned LATA0                : 1;
1218   unsigned LATA1                : 1;
1219   unsigned LATA2                : 1;
1220   unsigned                      : 1;
1221   unsigned LATA4                : 1;
1222   unsigned LATA5                : 1;
1223   unsigned                      : 1;
1224   unsigned                      : 1;
1225   } __LATAbits_t;
1226 
1227 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1228 
1229 #define _LATA0                  0x01
1230 #define _LATA1                  0x02
1231 #define _LATA2                  0x04
1232 #define _LATA4                  0x10
1233 #define _LATA5                  0x20
1234 
1235 //==============================================================================
1236 
1237 
1238 //==============================================================================
1239 //        CM1CON0 Bits
1240 
1241 extern __at(0x0111) __sfr CM1CON0;
1242 
1243 typedef struct
1244   {
1245   unsigned C1SYNC               : 1;
1246   unsigned C1HYS                : 1;
1247   unsigned C1SP                 : 1;
1248   unsigned                      : 1;
1249   unsigned C1POL                : 1;
1250   unsigned C1OE                 : 1;
1251   unsigned C1OUT                : 1;
1252   unsigned C1ON                 : 1;
1253   } __CM1CON0bits_t;
1254 
1255 extern __at(0x0111) volatile __CM1CON0bits_t CM1CON0bits;
1256 
1257 #define _C1SYNC                 0x01
1258 #define _C1HYS                  0x02
1259 #define _C1SP                   0x04
1260 #define _C1POL                  0x10
1261 #define _C1OE                   0x20
1262 #define _C1OUT                  0x40
1263 #define _C1ON                   0x80
1264 
1265 //==============================================================================
1266 
1267 
1268 //==============================================================================
1269 //        CM1CON1 Bits
1270 
1271 extern __at(0x0112) __sfr CM1CON1;
1272 
1273 typedef union
1274   {
1275   struct
1276     {
1277     unsigned C1NCH0             : 1;
1278     unsigned                    : 1;
1279     unsigned                    : 1;
1280     unsigned                    : 1;
1281     unsigned C1PCH0             : 1;
1282     unsigned C1PCH1             : 1;
1283     unsigned C1INTN             : 1;
1284     unsigned C1INTP             : 1;
1285     };
1286 
1287   struct
1288     {
1289     unsigned                    : 4;
1290     unsigned C1PCH              : 2;
1291     unsigned                    : 2;
1292     };
1293   } __CM1CON1bits_t;
1294 
1295 extern __at(0x0112) volatile __CM1CON1bits_t CM1CON1bits;
1296 
1297 #define _C1NCH0                 0x01
1298 #define _C1PCH0                 0x10
1299 #define _C1PCH1                 0x20
1300 #define _C1INTN                 0x40
1301 #define _C1INTP                 0x80
1302 
1303 //==============================================================================
1304 
1305 
1306 //==============================================================================
1307 //        CMOUT Bits
1308 
1309 extern __at(0x0115) __sfr CMOUT;
1310 
1311 typedef struct
1312   {
1313   unsigned MC1OUT               : 1;
1314   unsigned                      : 1;
1315   unsigned                      : 1;
1316   unsigned                      : 1;
1317   unsigned                      : 1;
1318   unsigned                      : 1;
1319   unsigned                      : 1;
1320   unsigned                      : 1;
1321   } __CMOUTbits_t;
1322 
1323 extern __at(0x0115) volatile __CMOUTbits_t CMOUTbits;
1324 
1325 #define _MC1OUT                 0x01
1326 
1327 //==============================================================================
1328 
1329 
1330 //==============================================================================
1331 //        BORCON Bits
1332 
1333 extern __at(0x0116) __sfr BORCON;
1334 
1335 typedef struct
1336   {
1337   unsigned BORRDY               : 1;
1338   unsigned                      : 1;
1339   unsigned                      : 1;
1340   unsigned                      : 1;
1341   unsigned                      : 1;
1342   unsigned                      : 1;
1343   unsigned                      : 1;
1344   unsigned SBOREN               : 1;
1345   } __BORCONbits_t;
1346 
1347 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1348 
1349 #define _BORRDY                 0x01
1350 #define _SBOREN                 0x80
1351 
1352 //==============================================================================
1353 
1354 
1355 //==============================================================================
1356 //        FVRCON Bits
1357 
1358 extern __at(0x0117) __sfr FVRCON;
1359 
1360 typedef union
1361   {
1362   struct
1363     {
1364     unsigned ADFVR0             : 1;
1365     unsigned ADFVR1             : 1;
1366     unsigned CDAFVR0            : 1;
1367     unsigned CDAFVR1            : 1;
1368     unsigned TSRNG              : 1;
1369     unsigned TSEN               : 1;
1370     unsigned FVRRDY             : 1;
1371     unsigned FVREN              : 1;
1372     };
1373 
1374   struct
1375     {
1376     unsigned ADFVR              : 2;
1377     unsigned                    : 6;
1378     };
1379 
1380   struct
1381     {
1382     unsigned                    : 2;
1383     unsigned CDAFVR             : 2;
1384     unsigned                    : 4;
1385     };
1386   } __FVRCONbits_t;
1387 
1388 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1389 
1390 #define _ADFVR0                 0x01
1391 #define _ADFVR1                 0x02
1392 #define _CDAFVR0                0x04
1393 #define _CDAFVR1                0x08
1394 #define _TSRNG                  0x10
1395 #define _TSEN                   0x20
1396 #define _FVRRDY                 0x40
1397 #define _FVREN                  0x80
1398 
1399 //==============================================================================
1400 
1401 
1402 //==============================================================================
1403 //        DACCON0 Bits
1404 
1405 extern __at(0x0118) __sfr DACCON0;
1406 
1407 typedef union
1408   {
1409   struct
1410     {
1411     unsigned                    : 1;
1412     unsigned                    : 1;
1413     unsigned DACPSS0            : 1;
1414     unsigned DACPSS1            : 1;
1415     unsigned                    : 1;
1416     unsigned DACOE              : 1;
1417     unsigned DACLPS             : 1;
1418     unsigned DACEN              : 1;
1419     };
1420 
1421   struct
1422     {
1423     unsigned                    : 2;
1424     unsigned DACPSS             : 2;
1425     unsigned                    : 4;
1426     };
1427   } __DACCON0bits_t;
1428 
1429 extern __at(0x0118) volatile __DACCON0bits_t DACCON0bits;
1430 
1431 #define _DACPSS0                0x04
1432 #define _DACPSS1                0x08
1433 #define _DACOE                  0x20
1434 #define _DACLPS                 0x40
1435 #define _DACEN                  0x80
1436 
1437 //==============================================================================
1438 
1439 
1440 //==============================================================================
1441 //        DACCON1 Bits
1442 
1443 extern __at(0x0119) __sfr DACCON1;
1444 
1445 typedef union
1446   {
1447   struct
1448     {
1449     unsigned DACR0              : 1;
1450     unsigned DACR1              : 1;
1451     unsigned DACR2              : 1;
1452     unsigned DACR3              : 1;
1453     unsigned DACR4              : 1;
1454     unsigned                    : 1;
1455     unsigned                    : 1;
1456     unsigned                    : 1;
1457     };
1458 
1459   struct
1460     {
1461     unsigned DACR               : 5;
1462     unsigned                    : 3;
1463     };
1464   } __DACCON1bits_t;
1465 
1466 extern __at(0x0119) volatile __DACCON1bits_t DACCON1bits;
1467 
1468 #define _DACR0                  0x01
1469 #define _DACR1                  0x02
1470 #define _DACR2                  0x04
1471 #define _DACR3                  0x08
1472 #define _DACR4                  0x10
1473 
1474 //==============================================================================
1475 
1476 
1477 //==============================================================================
1478 //        SRCON0 Bits
1479 
1480 extern __at(0x011A) __sfr SRCON0;
1481 
1482 typedef union
1483   {
1484   struct
1485     {
1486     unsigned SRPR               : 1;
1487     unsigned SRPS               : 1;
1488     unsigned SRNQEN             : 1;
1489     unsigned SRQEN              : 1;
1490     unsigned SRCLK0             : 1;
1491     unsigned SRCLK1             : 1;
1492     unsigned SRCLK2             : 1;
1493     unsigned SRLEN              : 1;
1494     };
1495 
1496   struct
1497     {
1498     unsigned                    : 4;
1499     unsigned SRCLK              : 3;
1500     unsigned                    : 1;
1501     };
1502   } __SRCON0bits_t;
1503 
1504 extern __at(0x011A) volatile __SRCON0bits_t SRCON0bits;
1505 
1506 #define _SRPR                   0x01
1507 #define _SRPS                   0x02
1508 #define _SRNQEN                 0x04
1509 #define _SRQEN                  0x08
1510 #define _SRCLK0                 0x10
1511 #define _SRCLK1                 0x20
1512 #define _SRCLK2                 0x40
1513 #define _SRLEN                  0x80
1514 
1515 //==============================================================================
1516 
1517 
1518 //==============================================================================
1519 //        SRCON1 Bits
1520 
1521 extern __at(0x011B) __sfr SRCON1;
1522 
1523 typedef struct
1524   {
1525   unsigned SRRC1E               : 1;
1526   unsigned                      : 1;
1527   unsigned SRRCKE               : 1;
1528   unsigned SRRPE                : 1;
1529   unsigned SRSC1E               : 1;
1530   unsigned                      : 1;
1531   unsigned SRSCKE               : 1;
1532   unsigned SRSPE                : 1;
1533   } __SRCON1bits_t;
1534 
1535 extern __at(0x011B) volatile __SRCON1bits_t SRCON1bits;
1536 
1537 #define _SRRC1E                 0x01
1538 #define _SRRCKE                 0x04
1539 #define _SRRPE                  0x08
1540 #define _SRSC1E                 0x10
1541 #define _SRSCKE                 0x40
1542 #define _SRSPE                  0x80
1543 
1544 //==============================================================================
1545 
1546 
1547 //==============================================================================
1548 //        APFCON Bits
1549 
1550 extern __at(0x011D) __sfr APFCON;
1551 
1552 typedef union
1553   {
1554   struct
1555     {
1556     unsigned CCP1SEL            : 1;
1557     unsigned P1BSEL             : 1;
1558     unsigned TXCKSEL            : 1;
1559     unsigned T1GSEL             : 1;
1560     unsigned                    : 1;
1561     unsigned SSSEL              : 1;
1562     unsigned SDOSEL             : 1;
1563     unsigned RXDTSEL            : 1;
1564     };
1565 
1566   struct
1567     {
1568     unsigned                    : 1;
1569     unsigned                    : 1;
1570     unsigned                    : 1;
1571     unsigned                    : 1;
1572     unsigned                    : 1;
1573     unsigned SS1SEL             : 1;
1574     unsigned SDO1SEL            : 1;
1575     unsigned                    : 1;
1576     };
1577   } __APFCONbits_t;
1578 
1579 extern __at(0x011D) volatile __APFCONbits_t APFCONbits;
1580 
1581 #define _CCP1SEL                0x01
1582 #define _P1BSEL                 0x02
1583 #define _TXCKSEL                0x04
1584 #define _T1GSEL                 0x08
1585 #define _SSSEL                  0x20
1586 #define _SS1SEL                 0x20
1587 #define _SDOSEL                 0x40
1588 #define _SDO1SEL                0x40
1589 #define _RXDTSEL                0x80
1590 
1591 //==============================================================================
1592 
1593 
1594 //==============================================================================
1595 //        APFCON0 Bits
1596 
1597 extern __at(0x011D) __sfr APFCON0;
1598 
1599 typedef union
1600   {
1601   struct
1602     {
1603     unsigned CCP1SEL            : 1;
1604     unsigned P1BSEL             : 1;
1605     unsigned TXCKSEL            : 1;
1606     unsigned T1GSEL             : 1;
1607     unsigned                    : 1;
1608     unsigned SSSEL              : 1;
1609     unsigned SDOSEL             : 1;
1610     unsigned RXDTSEL            : 1;
1611     };
1612 
1613   struct
1614     {
1615     unsigned                    : 1;
1616     unsigned                    : 1;
1617     unsigned                    : 1;
1618     unsigned                    : 1;
1619     unsigned                    : 1;
1620     unsigned SS1SEL             : 1;
1621     unsigned SDO1SEL            : 1;
1622     unsigned                    : 1;
1623     };
1624   } __APFCON0bits_t;
1625 
1626 extern __at(0x011D) volatile __APFCON0bits_t APFCON0bits;
1627 
1628 #define _APFCON0_CCP1SEL        0x01
1629 #define _APFCON0_P1BSEL         0x02
1630 #define _APFCON0_TXCKSEL        0x04
1631 #define _APFCON0_T1GSEL         0x08
1632 #define _APFCON0_SSSEL          0x20
1633 #define _APFCON0_SS1SEL         0x20
1634 #define _APFCON0_SDOSEL         0x40
1635 #define _APFCON0_SDO1SEL        0x40
1636 #define _APFCON0_RXDTSEL        0x80
1637 
1638 //==============================================================================
1639 
1640 
1641 //==============================================================================
1642 //        ANSELA Bits
1643 
1644 extern __at(0x018C) __sfr ANSELA;
1645 
1646 typedef struct
1647   {
1648   unsigned ANSA0                : 1;
1649   unsigned ANSA1                : 1;
1650   unsigned ANSA2                : 1;
1651   unsigned                      : 1;
1652   unsigned ANSA4                : 1;
1653   unsigned                      : 1;
1654   unsigned                      : 1;
1655   unsigned                      : 1;
1656   } __ANSELAbits_t;
1657 
1658 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1659 
1660 #define _ANSA0                  0x01
1661 #define _ANSA1                  0x02
1662 #define _ANSA2                  0x04
1663 #define _ANSA4                  0x10
1664 
1665 //==============================================================================
1666 
1667 extern __at(0x0191) __sfr EEADR;
1668 extern __at(0x0191) __sfr EEADRL;
1669 extern __at(0x0192) __sfr EEADRH;
1670 extern __at(0x0193) __sfr EEDAT;
1671 extern __at(0x0193) __sfr EEDATL;
1672 extern __at(0x0194) __sfr EEDATH;
1673 
1674 //==============================================================================
1675 //        EECON1 Bits
1676 
1677 extern __at(0x0195) __sfr EECON1;
1678 
1679 typedef struct
1680   {
1681   unsigned RD                   : 1;
1682   unsigned WR                   : 1;
1683   unsigned WREN                 : 1;
1684   unsigned WRERR                : 1;
1685   unsigned FREE                 : 1;
1686   unsigned LWLO                 : 1;
1687   unsigned CFGS                 : 1;
1688   unsigned EEPGD                : 1;
1689   } __EECON1bits_t;
1690 
1691 extern __at(0x0195) volatile __EECON1bits_t EECON1bits;
1692 
1693 #define _RD                     0x01
1694 #define _WR                     0x02
1695 #define _WREN                   0x04
1696 #define _WRERR                  0x08
1697 #define _FREE                   0x10
1698 #define _LWLO                   0x20
1699 #define _CFGS                   0x40
1700 #define _EEPGD                  0x80
1701 
1702 //==============================================================================
1703 
1704 extern __at(0x0196) __sfr EECON2;
1705 extern __at(0x0199) __sfr RCREG;
1706 extern __at(0x019A) __sfr TXREG;
1707 extern __at(0x019B) __sfr SP1BRG;
1708 extern __at(0x019B) __sfr SP1BRGL;
1709 extern __at(0x019B) __sfr SPBRG;
1710 extern __at(0x019B) __sfr SPBRGL;
1711 extern __at(0x019C) __sfr SP1BRGH;
1712 extern __at(0x019C) __sfr SPBRGH;
1713 
1714 //==============================================================================
1715 //        RCSTA Bits
1716 
1717 extern __at(0x019D) __sfr RCSTA;
1718 
1719 typedef struct
1720   {
1721   unsigned RX9D                 : 1;
1722   unsigned OERR                 : 1;
1723   unsigned FERR                 : 1;
1724   unsigned ADDEN                : 1;
1725   unsigned CREN                 : 1;
1726   unsigned SREN                 : 1;
1727   unsigned RX9                  : 1;
1728   unsigned SPEN                 : 1;
1729   } __RCSTAbits_t;
1730 
1731 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
1732 
1733 #define _RX9D                   0x01
1734 #define _OERR                   0x02
1735 #define _FERR                   0x04
1736 #define _ADDEN                  0x08
1737 #define _CREN                   0x10
1738 #define _SREN                   0x20
1739 #define _RX9                    0x40
1740 #define _SPEN                   0x80
1741 
1742 //==============================================================================
1743 
1744 
1745 //==============================================================================
1746 //        TXSTA Bits
1747 
1748 extern __at(0x019E) __sfr TXSTA;
1749 
1750 typedef struct
1751   {
1752   unsigned TX9D                 : 1;
1753   unsigned TRMT                 : 1;
1754   unsigned BRGH                 : 1;
1755   unsigned SENDB                : 1;
1756   unsigned SYNC                 : 1;
1757   unsigned TXEN                 : 1;
1758   unsigned TX9                  : 1;
1759   unsigned CSRC                 : 1;
1760   } __TXSTAbits_t;
1761 
1762 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
1763 
1764 #define _TX9D                   0x01
1765 #define _TRMT                   0x02
1766 #define _BRGH                   0x04
1767 #define _SENDB                  0x08
1768 #define _SYNC                   0x10
1769 #define _TXEN                   0x20
1770 #define _TX9                    0x40
1771 #define _CSRC                   0x80
1772 
1773 //==============================================================================
1774 
1775 
1776 //==============================================================================
1777 //        BAUDCON Bits
1778 
1779 extern __at(0x019F) __sfr BAUDCON;
1780 
1781 typedef struct
1782   {
1783   unsigned ABDEN                : 1;
1784   unsigned WUE                  : 1;
1785   unsigned                      : 1;
1786   unsigned BRG16                : 1;
1787   unsigned SCKP                 : 1;
1788   unsigned                      : 1;
1789   unsigned RCIDL                : 1;
1790   unsigned ABDOVF               : 1;
1791   } __BAUDCONbits_t;
1792 
1793 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
1794 
1795 #define _ABDEN                  0x01
1796 #define _WUE                    0x02
1797 #define _BRG16                  0x08
1798 #define _SCKP                   0x10
1799 #define _RCIDL                  0x40
1800 #define _ABDOVF                 0x80
1801 
1802 //==============================================================================
1803 
1804 
1805 //==============================================================================
1806 //        WPUA Bits
1807 
1808 extern __at(0x020C) __sfr WPUA;
1809 
1810 typedef union
1811   {
1812   struct
1813     {
1814     unsigned WPUA0              : 1;
1815     unsigned WPUA1              : 1;
1816     unsigned WPUA2              : 1;
1817     unsigned WPUA3              : 1;
1818     unsigned WPUA4              : 1;
1819     unsigned WPUA5              : 1;
1820     unsigned                    : 1;
1821     unsigned                    : 1;
1822     };
1823 
1824   struct
1825     {
1826     unsigned WPUA               : 6;
1827     unsigned                    : 2;
1828     };
1829   } __WPUAbits_t;
1830 
1831 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
1832 
1833 #define _WPUA0                  0x01
1834 #define _WPUA1                  0x02
1835 #define _WPUA2                  0x04
1836 #define _WPUA3                  0x08
1837 #define _WPUA4                  0x10
1838 #define _WPUA5                  0x20
1839 
1840 //==============================================================================
1841 
1842 extern __at(0x0211) __sfr SSP1BUF;
1843 extern __at(0x0211) __sfr SSPBUF;
1844 extern __at(0x0212) __sfr SSP1ADD;
1845 extern __at(0x0212) __sfr SSPADD;
1846 extern __at(0x0213) __sfr SSP1MSK;
1847 extern __at(0x0213) __sfr SSPMSK;
1848 
1849 //==============================================================================
1850 //        SSP1STAT Bits
1851 
1852 extern __at(0x0214) __sfr SSP1STAT;
1853 
1854 typedef struct
1855   {
1856   unsigned BF                   : 1;
1857   unsigned UA                   : 1;
1858   unsigned R_NOT_W              : 1;
1859   unsigned S                    : 1;
1860   unsigned P                    : 1;
1861   unsigned D_NOT_A              : 1;
1862   unsigned CKE                  : 1;
1863   unsigned SMP                  : 1;
1864   } __SSP1STATbits_t;
1865 
1866 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
1867 
1868 #define _BF                     0x01
1869 #define _UA                     0x02
1870 #define _R_NOT_W                0x04
1871 #define _S                      0x08
1872 #define _P                      0x10
1873 #define _D_NOT_A                0x20
1874 #define _CKE                    0x40
1875 #define _SMP                    0x80
1876 
1877 //==============================================================================
1878 
1879 
1880 //==============================================================================
1881 //        SSPSTAT Bits
1882 
1883 extern __at(0x0214) __sfr SSPSTAT;
1884 
1885 typedef struct
1886   {
1887   unsigned BF                   : 1;
1888   unsigned UA                   : 1;
1889   unsigned R_NOT_W              : 1;
1890   unsigned S                    : 1;
1891   unsigned P                    : 1;
1892   unsigned D_NOT_A              : 1;
1893   unsigned CKE                  : 1;
1894   unsigned SMP                  : 1;
1895   } __SSPSTATbits_t;
1896 
1897 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
1898 
1899 #define _SSPSTAT_BF             0x01
1900 #define _SSPSTAT_UA             0x02
1901 #define _SSPSTAT_R_NOT_W        0x04
1902 #define _SSPSTAT_S              0x08
1903 #define _SSPSTAT_P              0x10
1904 #define _SSPSTAT_D_NOT_A        0x20
1905 #define _SSPSTAT_CKE            0x40
1906 #define _SSPSTAT_SMP            0x80
1907 
1908 //==============================================================================
1909 
1910 
1911 //==============================================================================
1912 //        SSP1CON1 Bits
1913 
1914 extern __at(0x0215) __sfr SSP1CON1;
1915 
1916 typedef union
1917   {
1918   struct
1919     {
1920     unsigned SSPM0              : 1;
1921     unsigned SSPM1              : 1;
1922     unsigned SSPM2              : 1;
1923     unsigned SSPM3              : 1;
1924     unsigned CKP                : 1;
1925     unsigned SSPEN              : 1;
1926     unsigned SSPOV              : 1;
1927     unsigned WCOL               : 1;
1928     };
1929 
1930   struct
1931     {
1932     unsigned SSPM               : 4;
1933     unsigned                    : 4;
1934     };
1935   } __SSP1CON1bits_t;
1936 
1937 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
1938 
1939 #define _SSPM0                  0x01
1940 #define _SSPM1                  0x02
1941 #define _SSPM2                  0x04
1942 #define _SSPM3                  0x08
1943 #define _CKP                    0x10
1944 #define _SSPEN                  0x20
1945 #define _SSPOV                  0x40
1946 #define _WCOL                   0x80
1947 
1948 //==============================================================================
1949 
1950 
1951 //==============================================================================
1952 //        SSPCON Bits
1953 
1954 extern __at(0x0215) __sfr SSPCON;
1955 
1956 typedef union
1957   {
1958   struct
1959     {
1960     unsigned SSPM0              : 1;
1961     unsigned SSPM1              : 1;
1962     unsigned SSPM2              : 1;
1963     unsigned SSPM3              : 1;
1964     unsigned CKP                : 1;
1965     unsigned SSPEN              : 1;
1966     unsigned SSPOV              : 1;
1967     unsigned WCOL               : 1;
1968     };
1969 
1970   struct
1971     {
1972     unsigned SSPM               : 4;
1973     unsigned                    : 4;
1974     };
1975   } __SSPCONbits_t;
1976 
1977 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
1978 
1979 #define _SSPCON_SSPM0           0x01
1980 #define _SSPCON_SSPM1           0x02
1981 #define _SSPCON_SSPM2           0x04
1982 #define _SSPCON_SSPM3           0x08
1983 #define _SSPCON_CKP             0x10
1984 #define _SSPCON_SSPEN           0x20
1985 #define _SSPCON_SSPOV           0x40
1986 #define _SSPCON_WCOL            0x80
1987 
1988 //==============================================================================
1989 
1990 
1991 //==============================================================================
1992 //        SSPCON1 Bits
1993 
1994 extern __at(0x0215) __sfr SSPCON1;
1995 
1996 typedef union
1997   {
1998   struct
1999     {
2000     unsigned SSPM0              : 1;
2001     unsigned SSPM1              : 1;
2002     unsigned SSPM2              : 1;
2003     unsigned SSPM3              : 1;
2004     unsigned CKP                : 1;
2005     unsigned SSPEN              : 1;
2006     unsigned SSPOV              : 1;
2007     unsigned WCOL               : 1;
2008     };
2009 
2010   struct
2011     {
2012     unsigned SSPM               : 4;
2013     unsigned                    : 4;
2014     };
2015   } __SSPCON1bits_t;
2016 
2017 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
2018 
2019 #define _SSPCON1_SSPM0          0x01
2020 #define _SSPCON1_SSPM1          0x02
2021 #define _SSPCON1_SSPM2          0x04
2022 #define _SSPCON1_SSPM3          0x08
2023 #define _SSPCON1_CKP            0x10
2024 #define _SSPCON1_SSPEN          0x20
2025 #define _SSPCON1_SSPOV          0x40
2026 #define _SSPCON1_WCOL           0x80
2027 
2028 //==============================================================================
2029 
2030 
2031 //==============================================================================
2032 //        SSP1CON2 Bits
2033 
2034 extern __at(0x0216) __sfr SSP1CON2;
2035 
2036 typedef struct
2037   {
2038   unsigned SEN                  : 1;
2039   unsigned RSEN                 : 1;
2040   unsigned PEN                  : 1;
2041   unsigned RCEN                 : 1;
2042   unsigned ACKEN                : 1;
2043   unsigned ACKDT                : 1;
2044   unsigned ACKSTAT              : 1;
2045   unsigned GCEN                 : 1;
2046   } __SSP1CON2bits_t;
2047 
2048 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
2049 
2050 #define _SEN                    0x01
2051 #define _RSEN                   0x02
2052 #define _PEN                    0x04
2053 #define _RCEN                   0x08
2054 #define _ACKEN                  0x10
2055 #define _ACKDT                  0x20
2056 #define _ACKSTAT                0x40
2057 #define _GCEN                   0x80
2058 
2059 //==============================================================================
2060 
2061 
2062 //==============================================================================
2063 //        SSPCON2 Bits
2064 
2065 extern __at(0x0216) __sfr SSPCON2;
2066 
2067 typedef struct
2068   {
2069   unsigned SEN                  : 1;
2070   unsigned RSEN                 : 1;
2071   unsigned PEN                  : 1;
2072   unsigned RCEN                 : 1;
2073   unsigned ACKEN                : 1;
2074   unsigned ACKDT                : 1;
2075   unsigned ACKSTAT              : 1;
2076   unsigned GCEN                 : 1;
2077   } __SSPCON2bits_t;
2078 
2079 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
2080 
2081 #define _SSPCON2_SEN            0x01
2082 #define _SSPCON2_RSEN           0x02
2083 #define _SSPCON2_PEN            0x04
2084 #define _SSPCON2_RCEN           0x08
2085 #define _SSPCON2_ACKEN          0x10
2086 #define _SSPCON2_ACKDT          0x20
2087 #define _SSPCON2_ACKSTAT        0x40
2088 #define _SSPCON2_GCEN           0x80
2089 
2090 //==============================================================================
2091 
2092 
2093 //==============================================================================
2094 //        SSP1CON3 Bits
2095 
2096 extern __at(0x0217) __sfr SSP1CON3;
2097 
2098 typedef struct
2099   {
2100   unsigned DHEN                 : 1;
2101   unsigned AHEN                 : 1;
2102   unsigned SBCDE                : 1;
2103   unsigned SDAHT                : 1;
2104   unsigned BOEN                 : 1;
2105   unsigned SCIE                 : 1;
2106   unsigned PCIE                 : 1;
2107   unsigned ACKTIM               : 1;
2108   } __SSP1CON3bits_t;
2109 
2110 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
2111 
2112 #define _DHEN                   0x01
2113 #define _AHEN                   0x02
2114 #define _SBCDE                  0x04
2115 #define _SDAHT                  0x08
2116 #define _BOEN                   0x10
2117 #define _SCIE                   0x20
2118 #define _PCIE                   0x40
2119 #define _ACKTIM                 0x80
2120 
2121 //==============================================================================
2122 
2123 
2124 //==============================================================================
2125 //        SSPCON3 Bits
2126 
2127 extern __at(0x0217) __sfr SSPCON3;
2128 
2129 typedef struct
2130   {
2131   unsigned DHEN                 : 1;
2132   unsigned AHEN                 : 1;
2133   unsigned SBCDE                : 1;
2134   unsigned SDAHT                : 1;
2135   unsigned BOEN                 : 1;
2136   unsigned SCIE                 : 1;
2137   unsigned PCIE                 : 1;
2138   unsigned ACKTIM               : 1;
2139   } __SSPCON3bits_t;
2140 
2141 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
2142 
2143 #define _SSPCON3_DHEN           0x01
2144 #define _SSPCON3_AHEN           0x02
2145 #define _SSPCON3_SBCDE          0x04
2146 #define _SSPCON3_SDAHT          0x08
2147 #define _SSPCON3_BOEN           0x10
2148 #define _SSPCON3_SCIE           0x20
2149 #define _SSPCON3_PCIE           0x40
2150 #define _SSPCON3_ACKTIM         0x80
2151 
2152 //==============================================================================
2153 
2154 extern __at(0x0291) __sfr CCPR1;
2155 extern __at(0x0291) __sfr CCPR1L;
2156 extern __at(0x0292) __sfr CCPR1H;
2157 
2158 //==============================================================================
2159 //        CCP1CON Bits
2160 
2161 extern __at(0x0293) __sfr CCP1CON;
2162 
2163 typedef union
2164   {
2165   struct
2166     {
2167     unsigned CCP1M0             : 1;
2168     unsigned CCP1M1             : 1;
2169     unsigned CCP1M2             : 1;
2170     unsigned CCP1M3             : 1;
2171     unsigned DC1B0              : 1;
2172     unsigned DC1B1              : 1;
2173     unsigned P1M0               : 1;
2174     unsigned P1M1               : 1;
2175     };
2176 
2177   struct
2178     {
2179     unsigned CCP1M              : 4;
2180     unsigned                    : 4;
2181     };
2182 
2183   struct
2184     {
2185     unsigned                    : 4;
2186     unsigned DC1B               : 2;
2187     unsigned                    : 2;
2188     };
2189 
2190   struct
2191     {
2192     unsigned                    : 6;
2193     unsigned P1M                : 2;
2194     };
2195   } __CCP1CONbits_t;
2196 
2197 extern __at(0x0293) volatile __CCP1CONbits_t CCP1CONbits;
2198 
2199 #define _CCP1M0                 0x01
2200 #define _CCP1M1                 0x02
2201 #define _CCP1M2                 0x04
2202 #define _CCP1M3                 0x08
2203 #define _DC1B0                  0x10
2204 #define _DC1B1                  0x20
2205 #define _P1M0                   0x40
2206 #define _P1M1                   0x80
2207 
2208 //==============================================================================
2209 
2210 
2211 //==============================================================================
2212 //        PWM1CON Bits
2213 
2214 extern __at(0x0294) __sfr PWM1CON;
2215 
2216 typedef union
2217   {
2218   struct
2219     {
2220     unsigned P1DC0              : 1;
2221     unsigned P1DC1              : 1;
2222     unsigned P1DC2              : 1;
2223     unsigned P1DC3              : 1;
2224     unsigned P1DC4              : 1;
2225     unsigned P1DC5              : 1;
2226     unsigned P1DC6              : 1;
2227     unsigned P1RSEN             : 1;
2228     };
2229 
2230   struct
2231     {
2232     unsigned P1DC               : 7;
2233     unsigned                    : 1;
2234     };
2235   } __PWM1CONbits_t;
2236 
2237 extern __at(0x0294) volatile __PWM1CONbits_t PWM1CONbits;
2238 
2239 #define _P1DC0                  0x01
2240 #define _P1DC1                  0x02
2241 #define _P1DC2                  0x04
2242 #define _P1DC3                  0x08
2243 #define _P1DC4                  0x10
2244 #define _P1DC5                  0x20
2245 #define _P1DC6                  0x40
2246 #define _P1RSEN                 0x80
2247 
2248 //==============================================================================
2249 
2250 
2251 //==============================================================================
2252 //        CCP1AS Bits
2253 
2254 extern __at(0x0295) __sfr CCP1AS;
2255 
2256 typedef union
2257   {
2258   struct
2259     {
2260     unsigned PSS1BD0            : 1;
2261     unsigned PSS1BD1            : 1;
2262     unsigned PSS1AC0            : 1;
2263     unsigned PSS1AC1            : 1;
2264     unsigned CCP1AS0            : 1;
2265     unsigned CCP1AS1            : 1;
2266     unsigned CCP1AS2            : 1;
2267     unsigned CCP1ASE            : 1;
2268     };
2269 
2270   struct
2271     {
2272     unsigned PSS1BD             : 2;
2273     unsigned                    : 6;
2274     };
2275 
2276   struct
2277     {
2278     unsigned                    : 2;
2279     unsigned PSS1AC             : 2;
2280     unsigned                    : 4;
2281     };
2282 
2283   struct
2284     {
2285     unsigned                    : 4;
2286     unsigned CCP1AS             : 3;
2287     unsigned                    : 1;
2288     };
2289   } __CCP1ASbits_t;
2290 
2291 extern __at(0x0295) volatile __CCP1ASbits_t CCP1ASbits;
2292 
2293 #define _PSS1BD0                0x01
2294 #define _PSS1BD1                0x02
2295 #define _PSS1AC0                0x04
2296 #define _PSS1AC1                0x08
2297 #define _CCP1AS0                0x10
2298 #define _CCP1AS1                0x20
2299 #define _CCP1AS2                0x40
2300 #define _CCP1ASE                0x80
2301 
2302 //==============================================================================
2303 
2304 
2305 //==============================================================================
2306 //        ECCP1AS Bits
2307 
2308 extern __at(0x0295) __sfr ECCP1AS;
2309 
2310 typedef union
2311   {
2312   struct
2313     {
2314     unsigned PSS1BD0            : 1;
2315     unsigned PSS1BD1            : 1;
2316     unsigned PSS1AC0            : 1;
2317     unsigned PSS1AC1            : 1;
2318     unsigned CCP1AS0            : 1;
2319     unsigned CCP1AS1            : 1;
2320     unsigned CCP1AS2            : 1;
2321     unsigned CCP1ASE            : 1;
2322     };
2323 
2324   struct
2325     {
2326     unsigned PSS1BD             : 2;
2327     unsigned                    : 6;
2328     };
2329 
2330   struct
2331     {
2332     unsigned                    : 2;
2333     unsigned PSS1AC             : 2;
2334     unsigned                    : 4;
2335     };
2336 
2337   struct
2338     {
2339     unsigned                    : 4;
2340     unsigned CCP1AS             : 3;
2341     unsigned                    : 1;
2342     };
2343   } __ECCP1ASbits_t;
2344 
2345 extern __at(0x0295) volatile __ECCP1ASbits_t ECCP1ASbits;
2346 
2347 #define _ECCP1AS_PSS1BD0        0x01
2348 #define _ECCP1AS_PSS1BD1        0x02
2349 #define _ECCP1AS_PSS1AC0        0x04
2350 #define _ECCP1AS_PSS1AC1        0x08
2351 #define _ECCP1AS_CCP1AS0        0x10
2352 #define _ECCP1AS_CCP1AS1        0x20
2353 #define _ECCP1AS_CCP1AS2        0x40
2354 #define _ECCP1AS_CCP1ASE        0x80
2355 
2356 //==============================================================================
2357 
2358 
2359 //==============================================================================
2360 //        PSTR1CON Bits
2361 
2362 extern __at(0x0296) __sfr PSTR1CON;
2363 
2364 typedef struct
2365   {
2366   unsigned STR1A                : 1;
2367   unsigned STR1B                : 1;
2368   unsigned STR1C                : 1;
2369   unsigned STR1D                : 1;
2370   unsigned STR1SYNC             : 1;
2371   unsigned                      : 1;
2372   unsigned                      : 1;
2373   unsigned                      : 1;
2374   } __PSTR1CONbits_t;
2375 
2376 extern __at(0x0296) volatile __PSTR1CONbits_t PSTR1CONbits;
2377 
2378 #define _STR1A                  0x01
2379 #define _STR1B                  0x02
2380 #define _STR1C                  0x04
2381 #define _STR1D                  0x08
2382 #define _STR1SYNC               0x10
2383 
2384 //==============================================================================
2385 
2386 
2387 //==============================================================================
2388 //        IOCAP Bits
2389 
2390 extern __at(0x0391) __sfr IOCAP;
2391 
2392 typedef union
2393   {
2394   struct
2395     {
2396     unsigned IOCAP0             : 1;
2397     unsigned IOCAP1             : 1;
2398     unsigned IOCAP2             : 1;
2399     unsigned IOCAP3             : 1;
2400     unsigned IOCAP4             : 1;
2401     unsigned IOCAP5             : 1;
2402     unsigned                    : 1;
2403     unsigned                    : 1;
2404     };
2405 
2406   struct
2407     {
2408     unsigned IOCAP              : 6;
2409     unsigned                    : 2;
2410     };
2411   } __IOCAPbits_t;
2412 
2413 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits;
2414 
2415 #define _IOCAP0                 0x01
2416 #define _IOCAP1                 0x02
2417 #define _IOCAP2                 0x04
2418 #define _IOCAP3                 0x08
2419 #define _IOCAP4                 0x10
2420 #define _IOCAP5                 0x20
2421 
2422 //==============================================================================
2423 
2424 
2425 //==============================================================================
2426 //        IOCAN Bits
2427 
2428 extern __at(0x0392) __sfr IOCAN;
2429 
2430 typedef union
2431   {
2432   struct
2433     {
2434     unsigned IOCAN0             : 1;
2435     unsigned IOCAN1             : 1;
2436     unsigned IOCAN2             : 1;
2437     unsigned IOCAN3             : 1;
2438     unsigned IOCAN4             : 1;
2439     unsigned IOCAN5             : 1;
2440     unsigned                    : 1;
2441     unsigned                    : 1;
2442     };
2443 
2444   struct
2445     {
2446     unsigned IOCAN              : 6;
2447     unsigned                    : 2;
2448     };
2449   } __IOCANbits_t;
2450 
2451 extern __at(0x0392) volatile __IOCANbits_t IOCANbits;
2452 
2453 #define _IOCAN0                 0x01
2454 #define _IOCAN1                 0x02
2455 #define _IOCAN2                 0x04
2456 #define _IOCAN3                 0x08
2457 #define _IOCAN4                 0x10
2458 #define _IOCAN5                 0x20
2459 
2460 //==============================================================================
2461 
2462 
2463 //==============================================================================
2464 //        IOCAF Bits
2465 
2466 extern __at(0x0393) __sfr IOCAF;
2467 
2468 typedef union
2469   {
2470   struct
2471     {
2472     unsigned IOCAF0             : 1;
2473     unsigned IOCAF1             : 1;
2474     unsigned IOCAF2             : 1;
2475     unsigned IOCAF3             : 1;
2476     unsigned IOCAF4             : 1;
2477     unsigned IOCAF5             : 1;
2478     unsigned                    : 1;
2479     unsigned                    : 1;
2480     };
2481 
2482   struct
2483     {
2484     unsigned IOCAF              : 6;
2485     unsigned                    : 2;
2486     };
2487   } __IOCAFbits_t;
2488 
2489 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits;
2490 
2491 #define _IOCAF0                 0x01
2492 #define _IOCAF1                 0x02
2493 #define _IOCAF2                 0x04
2494 #define _IOCAF3                 0x08
2495 #define _IOCAF4                 0x10
2496 #define _IOCAF5                 0x20
2497 
2498 //==============================================================================
2499 
2500 
2501 //==============================================================================
2502 //        CLKRCON Bits
2503 
2504 extern __at(0x039A) __sfr CLKRCON;
2505 
2506 typedef union
2507   {
2508   struct
2509     {
2510     unsigned CLKRDIV0           : 1;
2511     unsigned CLKRDIV1           : 1;
2512     unsigned CLKRDIV2           : 1;
2513     unsigned CLKRDC0            : 1;
2514     unsigned CLKRDC1            : 1;
2515     unsigned CLKRSLR            : 1;
2516     unsigned CLKROE             : 1;
2517     unsigned CLKREN             : 1;
2518     };
2519 
2520   struct
2521     {
2522     unsigned CLKRDIV            : 3;
2523     unsigned                    : 5;
2524     };
2525 
2526   struct
2527     {
2528     unsigned                    : 3;
2529     unsigned CLKRDC             : 2;
2530     unsigned                    : 3;
2531     };
2532   } __CLKRCONbits_t;
2533 
2534 extern __at(0x039A) volatile __CLKRCONbits_t CLKRCONbits;
2535 
2536 #define _CLKRDIV0               0x01
2537 #define _CLKRDIV1               0x02
2538 #define _CLKRDIV2               0x04
2539 #define _CLKRDC0                0x08
2540 #define _CLKRDC1                0x10
2541 #define _CLKRSLR                0x20
2542 #define _CLKROE                 0x40
2543 #define _CLKREN                 0x80
2544 
2545 //==============================================================================
2546 
2547 
2548 //==============================================================================
2549 //        MDCON Bits
2550 
2551 extern __at(0x039C) __sfr MDCON;
2552 
2553 typedef struct
2554   {
2555   unsigned MDBIT                : 1;
2556   unsigned                      : 1;
2557   unsigned                      : 1;
2558   unsigned MDOUT                : 1;
2559   unsigned MDOPOL               : 1;
2560   unsigned MDSLR                : 1;
2561   unsigned MDOE                 : 1;
2562   unsigned MDEN                 : 1;
2563   } __MDCONbits_t;
2564 
2565 extern __at(0x039C) volatile __MDCONbits_t MDCONbits;
2566 
2567 #define _MDBIT                  0x01
2568 #define _MDOUT                  0x08
2569 #define _MDOPOL                 0x10
2570 #define _MDSLR                  0x20
2571 #define _MDOE                   0x40
2572 #define _MDEN                   0x80
2573 
2574 //==============================================================================
2575 
2576 
2577 //==============================================================================
2578 //        MDSRC Bits
2579 
2580 extern __at(0x039D) __sfr MDSRC;
2581 
2582 typedef union
2583   {
2584   struct
2585     {
2586     unsigned MDMS0              : 1;
2587     unsigned MDMS1              : 1;
2588     unsigned MDMS2              : 1;
2589     unsigned MDMS3              : 1;
2590     unsigned                    : 1;
2591     unsigned                    : 1;
2592     unsigned                    : 1;
2593     unsigned MDMSODIS           : 1;
2594     };
2595 
2596   struct
2597     {
2598     unsigned MDMS               : 4;
2599     unsigned                    : 4;
2600     };
2601   } __MDSRCbits_t;
2602 
2603 extern __at(0x039D) volatile __MDSRCbits_t MDSRCbits;
2604 
2605 #define _MDMS0                  0x01
2606 #define _MDMS1                  0x02
2607 #define _MDMS2                  0x04
2608 #define _MDMS3                  0x08
2609 #define _MDMSODIS               0x80
2610 
2611 //==============================================================================
2612 
2613 
2614 //==============================================================================
2615 //        MDCARL Bits
2616 
2617 extern __at(0x039E) __sfr MDCARL;
2618 
2619 typedef union
2620   {
2621   struct
2622     {
2623     unsigned MDCL0              : 1;
2624     unsigned MDCL1              : 1;
2625     unsigned MDCL2              : 1;
2626     unsigned MDCL3              : 1;
2627     unsigned                    : 1;
2628     unsigned MDCLSYNC           : 1;
2629     unsigned MDCLPOL            : 1;
2630     unsigned MDCLODIS           : 1;
2631     };
2632 
2633   struct
2634     {
2635     unsigned MDCL               : 4;
2636     unsigned                    : 4;
2637     };
2638   } __MDCARLbits_t;
2639 
2640 extern __at(0x039E) volatile __MDCARLbits_t MDCARLbits;
2641 
2642 #define _MDCL0                  0x01
2643 #define _MDCL1                  0x02
2644 #define _MDCL2                  0x04
2645 #define _MDCL3                  0x08
2646 #define _MDCLSYNC               0x20
2647 #define _MDCLPOL                0x40
2648 #define _MDCLODIS               0x80
2649 
2650 //==============================================================================
2651 
2652 
2653 //==============================================================================
2654 //        MDCARH Bits
2655 
2656 extern __at(0x039F) __sfr MDCARH;
2657 
2658 typedef union
2659   {
2660   struct
2661     {
2662     unsigned MDCH0              : 1;
2663     unsigned MDCH1              : 1;
2664     unsigned MDCH2              : 1;
2665     unsigned MDCH3              : 1;
2666     unsigned                    : 1;
2667     unsigned MDCHSYNC           : 1;
2668     unsigned MDCHPOL            : 1;
2669     unsigned MDCHODIS           : 1;
2670     };
2671 
2672   struct
2673     {
2674     unsigned MDCH               : 4;
2675     unsigned                    : 4;
2676     };
2677   } __MDCARHbits_t;
2678 
2679 extern __at(0x039F) volatile __MDCARHbits_t MDCARHbits;
2680 
2681 #define _MDCH0                  0x01
2682 #define _MDCH1                  0x02
2683 #define _MDCH2                  0x04
2684 #define _MDCH3                  0x08
2685 #define _MDCHSYNC               0x20
2686 #define _MDCHPOL                0x40
2687 #define _MDCHODIS               0x80
2688 
2689 //==============================================================================
2690 
2691 
2692 //==============================================================================
2693 //        STATUS_SHAD Bits
2694 
2695 extern __at(0x0FE4) __sfr STATUS_SHAD;
2696 
2697 typedef struct
2698   {
2699   unsigned C_SHAD               : 1;
2700   unsigned DC_SHAD              : 1;
2701   unsigned Z_SHAD               : 1;
2702   unsigned                      : 1;
2703   unsigned                      : 1;
2704   unsigned                      : 1;
2705   unsigned                      : 1;
2706   unsigned                      : 1;
2707   } __STATUS_SHADbits_t;
2708 
2709 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
2710 
2711 #define _C_SHAD                 0x01
2712 #define _DC_SHAD                0x02
2713 #define _Z_SHAD                 0x04
2714 
2715 //==============================================================================
2716 
2717 extern __at(0x0FE5) __sfr WREG_SHAD;
2718 extern __at(0x0FE6) __sfr BSR_SHAD;
2719 extern __at(0x0FE7) __sfr PCLATH_SHAD;
2720 extern __at(0x0FE8) __sfr FSR0L_SHAD;
2721 extern __at(0x0FE9) __sfr FSR0H_SHAD;
2722 extern __at(0x0FEA) __sfr FSR1L_SHAD;
2723 extern __at(0x0FEB) __sfr FSR1H_SHAD;
2724 extern __at(0x0FED) __sfr STKPTR;
2725 extern __at(0x0FEE) __sfr TOSL;
2726 extern __at(0x0FEF) __sfr TOSH;
2727 
2728 //==============================================================================
2729 //
2730 //        Configuration Bits
2731 //
2732 //==============================================================================
2733 
2734 #define _CONFIG1                0x8007
2735 #define _CONFIG2                0x8008
2736 
2737 //----------------------------- CONFIG1 Options -------------------------------
2738 
2739 #define _FOSC_LP                0x3FF8  // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins.
2740 #define _FOSC_XT                0x3FF9  // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins.
2741 #define _FOSC_HS                0x3FFA  // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins.
2742 #define _FOSC_EXTRC             0x3FFB  // EXTRC oscillator: External RC circuit connected to CLKIN pin.
2743 #define _FOSC_INTOSC            0x3FFC  // INTOSC oscillator: I/O function on CLKIN pin.
2744 #define _FOSC_ECL               0x3FFD  // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin.
2745 #define _FOSC_ECM               0x3FFE  // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin.
2746 #define _FOSC_ECH               0x3FFF  // ECH, External Clock, High Power Mode (4-32 MHz): device clock supplied to CLKIN pin.
2747 #define _WDTE_OFF               0x3FE7  // WDT disabled.
2748 #define _WDTE_SWDTEN            0x3FEF  // WDT controlled by the SWDTEN bit in the WDTCON register.
2749 #define _WDTE_NSLEEP            0x3FF7  // WDT enabled while running and disabled in Sleep.
2750 #define _WDTE_ON                0x3FFF  // WDT enabled.
2751 #define _PWRTE_ON               0x3FDF  // PWRT enabled.
2752 #define _PWRTE_OFF              0x3FFF  // PWRT disabled.
2753 #define _MCLRE_OFF              0x3FBF  // MCLR/VPP pin function is digital input.
2754 #define _MCLRE_ON               0x3FFF  // MCLR/VPP pin function is MCLR.
2755 #define _CP_ON                  0x3F7F  // Program memory code protection is enabled.
2756 #define _CP_OFF                 0x3FFF  // Program memory code protection is disabled.
2757 #define _CPD_ON                 0x3EFF  // Data memory code protection is enabled.
2758 #define _CPD_OFF                0x3FFF  // Data memory code protection is disabled.
2759 #define _BOREN_OFF              0x39FF  // Brown-out Reset disabled.
2760 #define _BOREN_SBODEN           0x3BFF  // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
2761 #define _BOREN_NSLEEP           0x3DFF  // Brown-out Reset enabled while running and disabled in Sleep.
2762 #define _BOREN_ON               0x3FFF  // Brown-out Reset enabled.
2763 #define _CLKOUTEN_ON            0x37FF  // CLKOUT function is enabled on the CLKOUT pin.
2764 #define _CLKOUTEN_OFF           0x3FFF  // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
2765 #define _IESO_OFF               0x2FFF  // Internal/External Switchover mode is disabled.
2766 #define _IESO_ON                0x3FFF  // Internal/External Switchover mode is enabled.
2767 #define _FCMEN_OFF              0x1FFF  // Fail-Safe Clock Monitor is disabled.
2768 #define _FCMEN_ON               0x3FFF  // Fail-Safe Clock Monitor is enabled.
2769 
2770 //----------------------------- CONFIG2 Options -------------------------------
2771 
2772 #define _WRT_ALL                0x3FFC  // 000h to 7FFh write protected, no addresses may be modified by EECON control.
2773 #define _WRT_HALF               0x3FFD  // 000h to 3FFh write protected, 400h to 7FFh may be modified by EECON control.
2774 #define _WRT_BOOT               0x3FFE  // 000h to 1FFh write protected, 200h to 7FFh may be modified by EECON control.
2775 #define _WRT_OFF                0x3FFF  // Write protection off.
2776 #define _PLLEN_OFF              0x3EFF  // 4x PLL disabled.
2777 #define _PLLEN_ON               0x3FFF  // 4x PLL enabled.
2778 #define _STVREN_OFF             0x3DFF  // Stack Overflow or Underflow will not cause a Reset.
2779 #define _STVREN_ON              0x3FFF  // Stack Overflow or Underflow will cause a Reset.
2780 #define _BORV_HI                0x3BFF  // Brown-out Reset Voltage (Vbor), high trip point selected.
2781 #define _BORV_LO                0x3FFF  // Brown-out Reset Voltage (Vbor), low trip point selected.
2782 #define _BORV_19                0x3FFF  // Brown-out Reset Voltage (Vbor), low trip point selected.
2783 #define _DEBUG_ON               0x2FFF  // In-Circuit Debugger enabled.
2784 #define _DEBUG_OFF              0x3FFF  // In-Circuit Debugger disabled.
2785 #define _LVP_OFF                0x1FFF  // High-voltage on MCLR/VPP must be used for programming.
2786 #define _LVP_ON                 0x3FFF  // Low-voltage programming enabled.
2787 
2788 //==============================================================================
2789 
2790 #define _DEVID1                 0x8006
2791 
2792 #define _IDLOC0                 0x8000
2793 #define _IDLOC1                 0x8001
2794 #define _IDLOC2                 0x8002
2795 #define _IDLOC3                 0x8003
2796 
2797 //==============================================================================
2798 
2799 #ifndef NO_BIT_DEFINES
2800 
2801 #define ADON                    ADCON0bits.ADON                 // bit 0
2802 #define GO_NOT_DONE             ADCON0bits.GO_NOT_DONE          // bit 1, shadows bit in ADCON0bits
2803 #define ADGO                    ADCON0bits.ADGO                 // bit 1, shadows bit in ADCON0bits
2804 #define GO                      ADCON0bits.GO                   // bit 1, shadows bit in ADCON0bits
2805 #define NOT_DONE                ADCON0bits.NOT_DONE             // bit 1, shadows bit in ADCON0bits
2806 #define CHS0                    ADCON0bits.CHS0                 // bit 2
2807 #define CHS1                    ADCON0bits.CHS1                 // bit 3
2808 #define CHS2                    ADCON0bits.CHS2                 // bit 4
2809 #define CHS3                    ADCON0bits.CHS3                 // bit 5
2810 #define CHS4                    ADCON0bits.CHS4                 // bit 6
2811 
2812 #define ADPREF0                 ADCON1bits.ADPREF0              // bit 0
2813 #define ADPREF1                 ADCON1bits.ADPREF1              // bit 1
2814 #define ADCS0                   ADCON1bits.ADCS0                // bit 4
2815 #define ADCS1                   ADCON1bits.ADCS1                // bit 5
2816 #define ADCS2                   ADCON1bits.ADCS2                // bit 6
2817 #define ADFM                    ADCON1bits.ADFM                 // bit 7
2818 
2819 #define ANSA0                   ANSELAbits.ANSA0                // bit 0
2820 #define ANSA1                   ANSELAbits.ANSA1                // bit 1
2821 #define ANSA2                   ANSELAbits.ANSA2                // bit 2
2822 #define ANSA4                   ANSELAbits.ANSA4                // bit 4
2823 
2824 #define CCP1SEL                 APFCONbits.CCP1SEL              // bit 0
2825 #define P1BSEL                  APFCONbits.P1BSEL               // bit 1
2826 #define TXCKSEL                 APFCONbits.TXCKSEL              // bit 2
2827 #define T1GSEL                  APFCONbits.T1GSEL               // bit 3
2828 #define SSSEL                   APFCONbits.SSSEL                // bit 5, shadows bit in APFCONbits
2829 #define SS1SEL                  APFCONbits.SS1SEL               // bit 5, shadows bit in APFCONbits
2830 #define SDOSEL                  APFCONbits.SDOSEL               // bit 6, shadows bit in APFCONbits
2831 #define SDO1SEL                 APFCONbits.SDO1SEL              // bit 6, shadows bit in APFCONbits
2832 #define RXDTSEL                 APFCONbits.RXDTSEL              // bit 7
2833 
2834 #define ABDEN                   BAUDCONbits.ABDEN               // bit 0
2835 #define WUE                     BAUDCONbits.WUE                 // bit 1
2836 #define BRG16                   BAUDCONbits.BRG16               // bit 3
2837 #define SCKP                    BAUDCONbits.SCKP                // bit 4
2838 #define RCIDL                   BAUDCONbits.RCIDL               // bit 6
2839 #define ABDOVF                  BAUDCONbits.ABDOVF              // bit 7
2840 
2841 #define BORRDY                  BORCONbits.BORRDY               // bit 0
2842 #define SBOREN                  BORCONbits.SBOREN               // bit 7
2843 
2844 #define BSR0                    BSRbits.BSR0                    // bit 0
2845 #define BSR1                    BSRbits.BSR1                    // bit 1
2846 #define BSR2                    BSRbits.BSR2                    // bit 2
2847 #define BSR3                    BSRbits.BSR3                    // bit 3
2848 #define BSR4                    BSRbits.BSR4                    // bit 4
2849 
2850 #define PSS1BD0                 CCP1ASbits.PSS1BD0              // bit 0
2851 #define PSS1BD1                 CCP1ASbits.PSS1BD1              // bit 1
2852 #define PSS1AC0                 CCP1ASbits.PSS1AC0              // bit 2
2853 #define PSS1AC1                 CCP1ASbits.PSS1AC1              // bit 3
2854 #define CCP1AS0                 CCP1ASbits.CCP1AS0              // bit 4
2855 #define CCP1AS1                 CCP1ASbits.CCP1AS1              // bit 5
2856 #define CCP1AS2                 CCP1ASbits.CCP1AS2              // bit 6
2857 #define CCP1ASE                 CCP1ASbits.CCP1ASE              // bit 7
2858 
2859 #define CCP1M0                  CCP1CONbits.CCP1M0              // bit 0
2860 #define CCP1M1                  CCP1CONbits.CCP1M1              // bit 1
2861 #define CCP1M2                  CCP1CONbits.CCP1M2              // bit 2
2862 #define CCP1M3                  CCP1CONbits.CCP1M3              // bit 3
2863 #define DC1B0                   CCP1CONbits.DC1B0               // bit 4
2864 #define DC1B1                   CCP1CONbits.DC1B1               // bit 5
2865 #define P1M0                    CCP1CONbits.P1M0                // bit 6
2866 #define P1M1                    CCP1CONbits.P1M1                // bit 7
2867 
2868 #define CLKRDIV0                CLKRCONbits.CLKRDIV0            // bit 0
2869 #define CLKRDIV1                CLKRCONbits.CLKRDIV1            // bit 1
2870 #define CLKRDIV2                CLKRCONbits.CLKRDIV2            // bit 2
2871 #define CLKRDC0                 CLKRCONbits.CLKRDC0             // bit 3
2872 #define CLKRDC1                 CLKRCONbits.CLKRDC1             // bit 4
2873 #define CLKRSLR                 CLKRCONbits.CLKRSLR             // bit 5
2874 #define CLKROE                  CLKRCONbits.CLKROE              // bit 6
2875 #define CLKREN                  CLKRCONbits.CLKREN              // bit 7
2876 
2877 #define C1SYNC                  CM1CON0bits.C1SYNC              // bit 0
2878 #define C1HYS                   CM1CON0bits.C1HYS               // bit 1
2879 #define C1SP                    CM1CON0bits.C1SP                // bit 2
2880 #define C1POL                   CM1CON0bits.C1POL               // bit 4
2881 #define C1OE                    CM1CON0bits.C1OE                // bit 5
2882 #define C1OUT                   CM1CON0bits.C1OUT               // bit 6
2883 #define C1ON                    CM1CON0bits.C1ON                // bit 7
2884 
2885 #define C1NCH0                  CM1CON1bits.C1NCH0              // bit 0
2886 #define C1PCH0                  CM1CON1bits.C1PCH0              // bit 4
2887 #define C1PCH1                  CM1CON1bits.C1PCH1              // bit 5
2888 #define C1INTN                  CM1CON1bits.C1INTN              // bit 6
2889 #define C1INTP                  CM1CON1bits.C1INTP              // bit 7
2890 
2891 #define MC1OUT                  CMOUTbits.MC1OUT                // bit 0
2892 
2893 #define T0XCS                   CPSCON0bits.T0XCS               // bit 0
2894 #define CPSOUT                  CPSCON0bits.CPSOUT              // bit 1
2895 #define CPSRNG0                 CPSCON0bits.CPSRNG0             // bit 2
2896 #define CPSRNG1                 CPSCON0bits.CPSRNG1             // bit 3
2897 #define CPSRM                   CPSCON0bits.CPSRM               // bit 6
2898 #define CPSON                   CPSCON0bits.CPSON               // bit 7
2899 
2900 #define CPSCH0                  CPSCON1bits.CPSCH0              // bit 0
2901 #define CPSCH1                  CPSCON1bits.CPSCH1              // bit 1
2902 
2903 #define DACPSS0                 DACCON0bits.DACPSS0             // bit 2
2904 #define DACPSS1                 DACCON0bits.DACPSS1             // bit 3
2905 #define DACOE                   DACCON0bits.DACOE               // bit 5
2906 #define DACLPS                  DACCON0bits.DACLPS              // bit 6
2907 #define DACEN                   DACCON0bits.DACEN               // bit 7
2908 
2909 #define DACR0                   DACCON1bits.DACR0               // bit 0
2910 #define DACR1                   DACCON1bits.DACR1               // bit 1
2911 #define DACR2                   DACCON1bits.DACR2               // bit 2
2912 #define DACR3                   DACCON1bits.DACR3               // bit 3
2913 #define DACR4                   DACCON1bits.DACR4               // bit 4
2914 
2915 #define RD                      EECON1bits.RD                   // bit 0
2916 #define WR                      EECON1bits.WR                   // bit 1
2917 #define WREN                    EECON1bits.WREN                 // bit 2
2918 #define WRERR                   EECON1bits.WRERR                // bit 3
2919 #define FREE                    EECON1bits.FREE                 // bit 4
2920 #define LWLO                    EECON1bits.LWLO                 // bit 5
2921 #define CFGS                    EECON1bits.CFGS                 // bit 6
2922 #define EEPGD                   EECON1bits.EEPGD                // bit 7
2923 
2924 #define ADFVR0                  FVRCONbits.ADFVR0               // bit 0
2925 #define ADFVR1                  FVRCONbits.ADFVR1               // bit 1
2926 #define CDAFVR0                 FVRCONbits.CDAFVR0              // bit 2
2927 #define CDAFVR1                 FVRCONbits.CDAFVR1              // bit 3
2928 #define TSRNG                   FVRCONbits.TSRNG                // bit 4
2929 #define TSEN                    FVRCONbits.TSEN                 // bit 5
2930 #define FVRRDY                  FVRCONbits.FVRRDY               // bit 6
2931 #define FVREN                   FVRCONbits.FVREN                // bit 7
2932 
2933 #define IOCIF                   INTCONbits.IOCIF                // bit 0
2934 #define INTF                    INTCONbits.INTF                 // bit 1
2935 #define TMR0IF                  INTCONbits.TMR0IF               // bit 2, shadows bit in INTCONbits
2936 #define T0IF                    INTCONbits.T0IF                 // bit 2, shadows bit in INTCONbits
2937 #define IOCIE                   INTCONbits.IOCIE                // bit 3
2938 #define INTE                    INTCONbits.INTE                 // bit 4
2939 #define TMR0IE                  INTCONbits.TMR0IE               // bit 5, shadows bit in INTCONbits
2940 #define T0IE                    INTCONbits.T0IE                 // bit 5, shadows bit in INTCONbits
2941 #define PEIE                    INTCONbits.PEIE                 // bit 6
2942 #define GIE                     INTCONbits.GIE                  // bit 7
2943 
2944 #define IOCAF0                  IOCAFbits.IOCAF0                // bit 0
2945 #define IOCAF1                  IOCAFbits.IOCAF1                // bit 1
2946 #define IOCAF2                  IOCAFbits.IOCAF2                // bit 2
2947 #define IOCAF3                  IOCAFbits.IOCAF3                // bit 3
2948 #define IOCAF4                  IOCAFbits.IOCAF4                // bit 4
2949 #define IOCAF5                  IOCAFbits.IOCAF5                // bit 5
2950 
2951 #define IOCAN0                  IOCANbits.IOCAN0                // bit 0
2952 #define IOCAN1                  IOCANbits.IOCAN1                // bit 1
2953 #define IOCAN2                  IOCANbits.IOCAN2                // bit 2
2954 #define IOCAN3                  IOCANbits.IOCAN3                // bit 3
2955 #define IOCAN4                  IOCANbits.IOCAN4                // bit 4
2956 #define IOCAN5                  IOCANbits.IOCAN5                // bit 5
2957 
2958 #define IOCAP0                  IOCAPbits.IOCAP0                // bit 0
2959 #define IOCAP1                  IOCAPbits.IOCAP1                // bit 1
2960 #define IOCAP2                  IOCAPbits.IOCAP2                // bit 2
2961 #define IOCAP3                  IOCAPbits.IOCAP3                // bit 3
2962 #define IOCAP4                  IOCAPbits.IOCAP4                // bit 4
2963 #define IOCAP5                  IOCAPbits.IOCAP5                // bit 5
2964 
2965 #define LATA0                   LATAbits.LATA0                  // bit 0
2966 #define LATA1                   LATAbits.LATA1                  // bit 1
2967 #define LATA2                   LATAbits.LATA2                  // bit 2
2968 #define LATA4                   LATAbits.LATA4                  // bit 4
2969 #define LATA5                   LATAbits.LATA5                  // bit 5
2970 
2971 #define MDCH0                   MDCARHbits.MDCH0                // bit 0
2972 #define MDCH1                   MDCARHbits.MDCH1                // bit 1
2973 #define MDCH2                   MDCARHbits.MDCH2                // bit 2
2974 #define MDCH3                   MDCARHbits.MDCH3                // bit 3
2975 #define MDCHSYNC                MDCARHbits.MDCHSYNC             // bit 5
2976 #define MDCHPOL                 MDCARHbits.MDCHPOL              // bit 6
2977 #define MDCHODIS                MDCARHbits.MDCHODIS             // bit 7
2978 
2979 #define MDCL0                   MDCARLbits.MDCL0                // bit 0
2980 #define MDCL1                   MDCARLbits.MDCL1                // bit 1
2981 #define MDCL2                   MDCARLbits.MDCL2                // bit 2
2982 #define MDCL3                   MDCARLbits.MDCL3                // bit 3
2983 #define MDCLSYNC                MDCARLbits.MDCLSYNC             // bit 5
2984 #define MDCLPOL                 MDCARLbits.MDCLPOL              // bit 6
2985 #define MDCLODIS                MDCARLbits.MDCLODIS             // bit 7
2986 
2987 #define MDBIT                   MDCONbits.MDBIT                 // bit 0
2988 #define MDOUT                   MDCONbits.MDOUT                 // bit 3
2989 #define MDOPOL                  MDCONbits.MDOPOL                // bit 4
2990 #define MDSLR                   MDCONbits.MDSLR                 // bit 5
2991 #define MDOE                    MDCONbits.MDOE                  // bit 6
2992 #define MDEN                    MDCONbits.MDEN                  // bit 7
2993 
2994 #define MDMS0                   MDSRCbits.MDMS0                 // bit 0
2995 #define MDMS1                   MDSRCbits.MDMS1                 // bit 1
2996 #define MDMS2                   MDSRCbits.MDMS2                 // bit 2
2997 #define MDMS3                   MDSRCbits.MDMS3                 // bit 3
2998 #define MDMSODIS                MDSRCbits.MDMSODIS              // bit 7
2999 
3000 #define PS0                     OPTION_REGbits.PS0              // bit 0
3001 #define PS1                     OPTION_REGbits.PS1              // bit 1
3002 #define PS2                     OPTION_REGbits.PS2              // bit 2
3003 #define PSA                     OPTION_REGbits.PSA              // bit 3
3004 #define TMR0SE                  OPTION_REGbits.TMR0SE           // bit 4, shadows bit in OPTION_REGbits
3005 #define T0SE                    OPTION_REGbits.T0SE             // bit 4, shadows bit in OPTION_REGbits
3006 #define TMR0CS                  OPTION_REGbits.TMR0CS           // bit 5, shadows bit in OPTION_REGbits
3007 #define T0CS                    OPTION_REGbits.T0CS             // bit 5, shadows bit in OPTION_REGbits
3008 #define INTEDG                  OPTION_REGbits.INTEDG           // bit 6
3009 #define NOT_WPUEN               OPTION_REGbits.NOT_WPUEN        // bit 7
3010 
3011 #define SCS0                    OSCCONbits.SCS0                 // bit 0
3012 #define SCS1                    OSCCONbits.SCS1                 // bit 1
3013 #define IRCF0                   OSCCONbits.IRCF0                // bit 3
3014 #define IRCF1                   OSCCONbits.IRCF1                // bit 4
3015 #define IRCF2                   OSCCONbits.IRCF2                // bit 5
3016 #define IRCF3                   OSCCONbits.IRCF3                // bit 6
3017 #define SPLLEN                  OSCCONbits.SPLLEN               // bit 7
3018 
3019 #define HFIOFS                  OSCSTATbits.HFIOFS              // bit 0
3020 #define LFIOFR                  OSCSTATbits.LFIOFR              // bit 1
3021 #define MFIOFR                  OSCSTATbits.MFIOFR              // bit 2
3022 #define HFIOFL                  OSCSTATbits.HFIOFL              // bit 3
3023 #define HFIOFR                  OSCSTATbits.HFIOFR              // bit 4
3024 #define OSTS                    OSCSTATbits.OSTS                // bit 5
3025 #define PLLR                    OSCSTATbits.PLLR                // bit 6
3026 #define T1OSCR                  OSCSTATbits.T1OSCR              // bit 7
3027 
3028 #define TUN0                    OSCTUNEbits.TUN0                // bit 0
3029 #define TUN1                    OSCTUNEbits.TUN1                // bit 1
3030 #define TUN2                    OSCTUNEbits.TUN2                // bit 2
3031 #define TUN3                    OSCTUNEbits.TUN3                // bit 3
3032 #define TUN4                    OSCTUNEbits.TUN4                // bit 4
3033 #define TUN5                    OSCTUNEbits.TUN5                // bit 5
3034 
3035 #define NOT_BOR                 PCONbits.NOT_BOR                // bit 0
3036 #define NOT_POR                 PCONbits.NOT_POR                // bit 1
3037 #define NOT_RI                  PCONbits.NOT_RI                 // bit 2
3038 #define NOT_RMCLR               PCONbits.NOT_RMCLR              // bit 3
3039 #define STKUNF                  PCONbits.STKUNF                 // bit 6
3040 #define STKOVF                  PCONbits.STKOVF                 // bit 7
3041 
3042 #define TMR1IE                  PIE1bits.TMR1IE                 // bit 0
3043 #define TMR2IE                  PIE1bits.TMR2IE                 // bit 1
3044 #define CCP1IE                  PIE1bits.CCP1IE                 // bit 2
3045 #define SSP1IE                  PIE1bits.SSP1IE                 // bit 3
3046 #define TXIE                    PIE1bits.TXIE                   // bit 4
3047 #define RCIE                    PIE1bits.RCIE                   // bit 5
3048 #define ADIE                    PIE1bits.ADIE                   // bit 6
3049 #define TMR1GIE                 PIE1bits.TMR1GIE                // bit 7
3050 
3051 #define BCL1IE                  PIE2bits.BCL1IE                 // bit 3
3052 #define EEIE                    PIE2bits.EEIE                   // bit 4
3053 #define C1IE                    PIE2bits.C1IE                   // bit 5
3054 #define OSFIE                   PIE2bits.OSFIE                  // bit 7
3055 
3056 #define TMR1IF                  PIR1bits.TMR1IF                 // bit 0
3057 #define TMR2IF                  PIR1bits.TMR2IF                 // bit 1
3058 #define CCP1IF                  PIR1bits.CCP1IF                 // bit 2
3059 #define SSP1IF                  PIR1bits.SSP1IF                 // bit 3
3060 #define TXIF                    PIR1bits.TXIF                   // bit 4
3061 #define RCIF                    PIR1bits.RCIF                   // bit 5
3062 #define ADIF                    PIR1bits.ADIF                   // bit 6
3063 #define TMR1GIF                 PIR1bits.TMR1GIF                // bit 7
3064 
3065 #define BCL1IF                  PIR2bits.BCL1IF                 // bit 3
3066 #define EEIF                    PIR2bits.EEIF                   // bit 4
3067 #define C1IF                    PIR2bits.C1IF                   // bit 5
3068 #define OSFIF                   PIR2bits.OSFIF                  // bit 7
3069 
3070 #define STR1A                   PSTR1CONbits.STR1A              // bit 0
3071 #define STR1B                   PSTR1CONbits.STR1B              // bit 1
3072 #define STR1C                   PSTR1CONbits.STR1C              // bit 2
3073 #define STR1D                   PSTR1CONbits.STR1D              // bit 3
3074 #define STR1SYNC                PSTR1CONbits.STR1SYNC           // bit 4
3075 
3076 #define P1DC0                   PWM1CONbits.P1DC0               // bit 0
3077 #define P1DC1                   PWM1CONbits.P1DC1               // bit 1
3078 #define P1DC2                   PWM1CONbits.P1DC2               // bit 2
3079 #define P1DC3                   PWM1CONbits.P1DC3               // bit 3
3080 #define P1DC4                   PWM1CONbits.P1DC4               // bit 4
3081 #define P1DC5                   PWM1CONbits.P1DC5               // bit 5
3082 #define P1DC6                   PWM1CONbits.P1DC6               // bit 6
3083 #define P1RSEN                  PWM1CONbits.P1RSEN              // bit 7
3084 
3085 #define RX9D                    RCSTAbits.RX9D                  // bit 0
3086 #define OERR                    RCSTAbits.OERR                  // bit 1
3087 #define FERR                    RCSTAbits.FERR                  // bit 2
3088 #define ADDEN                   RCSTAbits.ADDEN                 // bit 3
3089 #define CREN                    RCSTAbits.CREN                  // bit 4
3090 #define SREN                    RCSTAbits.SREN                  // bit 5
3091 #define RX9                     RCSTAbits.RX9                   // bit 6
3092 #define SPEN                    RCSTAbits.SPEN                  // bit 7
3093 
3094 #define SRPR                    SRCON0bits.SRPR                 // bit 0
3095 #define SRPS                    SRCON0bits.SRPS                 // bit 1
3096 #define SRNQEN                  SRCON0bits.SRNQEN               // bit 2
3097 #define SRQEN                   SRCON0bits.SRQEN                // bit 3
3098 #define SRCLK0                  SRCON0bits.SRCLK0               // bit 4
3099 #define SRCLK1                  SRCON0bits.SRCLK1               // bit 5
3100 #define SRCLK2                  SRCON0bits.SRCLK2               // bit 6
3101 #define SRLEN                   SRCON0bits.SRLEN                // bit 7
3102 
3103 #define SRRC1E                  SRCON1bits.SRRC1E               // bit 0
3104 #define SRRCKE                  SRCON1bits.SRRCKE               // bit 2
3105 #define SRRPE                   SRCON1bits.SRRPE                // bit 3
3106 #define SRSC1E                  SRCON1bits.SRSC1E               // bit 4
3107 #define SRSCKE                  SRCON1bits.SRSCKE               // bit 6
3108 #define SRSPE                   SRCON1bits.SRSPE                // bit 7
3109 
3110 #define SSPM0                   SSP1CON1bits.SSPM0              // bit 0
3111 #define SSPM1                   SSP1CON1bits.SSPM1              // bit 1
3112 #define SSPM2                   SSP1CON1bits.SSPM2              // bit 2
3113 #define SSPM3                   SSP1CON1bits.SSPM3              // bit 3
3114 #define CKP                     SSP1CON1bits.CKP                // bit 4
3115 #define SSPEN                   SSP1CON1bits.SSPEN              // bit 5
3116 #define SSPOV                   SSP1CON1bits.SSPOV              // bit 6
3117 #define WCOL                    SSP1CON1bits.WCOL               // bit 7
3118 
3119 #define SEN                     SSP1CON2bits.SEN                // bit 0
3120 #define RSEN                    SSP1CON2bits.RSEN               // bit 1
3121 #define PEN                     SSP1CON2bits.PEN                // bit 2
3122 #define RCEN                    SSP1CON2bits.RCEN               // bit 3
3123 #define ACKEN                   SSP1CON2bits.ACKEN              // bit 4
3124 #define ACKDT                   SSP1CON2bits.ACKDT              // bit 5
3125 #define ACKSTAT                 SSP1CON2bits.ACKSTAT            // bit 6
3126 #define GCEN                    SSP1CON2bits.GCEN               // bit 7
3127 
3128 #define DHEN                    SSP1CON3bits.DHEN               // bit 0
3129 #define AHEN                    SSP1CON3bits.AHEN               // bit 1
3130 #define SBCDE                   SSP1CON3bits.SBCDE              // bit 2
3131 #define SDAHT                   SSP1CON3bits.SDAHT              // bit 3
3132 #define BOEN                    SSP1CON3bits.BOEN               // bit 4
3133 #define SCIE                    SSP1CON3bits.SCIE               // bit 5
3134 #define PCIE                    SSP1CON3bits.PCIE               // bit 6
3135 #define ACKTIM                  SSP1CON3bits.ACKTIM             // bit 7
3136 
3137 #define BF                      SSP1STATbits.BF                 // bit 0
3138 #define UA                      SSP1STATbits.UA                 // bit 1
3139 #define R_NOT_W                 SSP1STATbits.R_NOT_W            // bit 2
3140 #define S                       SSP1STATbits.S                  // bit 3
3141 #define P                       SSP1STATbits.P                  // bit 4
3142 #define D_NOT_A                 SSP1STATbits.D_NOT_A            // bit 5
3143 #define CKE                     SSP1STATbits.CKE                // bit 6
3144 #define SMP                     SSP1STATbits.SMP                // bit 7
3145 
3146 #define C                       STATUSbits.C                    // bit 0
3147 #define DC                      STATUSbits.DC                   // bit 1
3148 #define Z                       STATUSbits.Z                    // bit 2
3149 #define NOT_PD                  STATUSbits.NOT_PD               // bit 3
3150 #define NOT_TO                  STATUSbits.NOT_TO               // bit 4
3151 
3152 #define C_SHAD                  STATUS_SHADbits.C_SHAD          // bit 0
3153 #define DC_SHAD                 STATUS_SHADbits.DC_SHAD         // bit 1
3154 #define Z_SHAD                  STATUS_SHADbits.Z_SHAD          // bit 2
3155 
3156 #define TMR1ON                  T1CONbits.TMR1ON                // bit 0
3157 #define NOT_T1SYNC              T1CONbits.NOT_T1SYNC            // bit 2
3158 #define T1OSCEN                 T1CONbits.T1OSCEN               // bit 3
3159 #define T1CKPS0                 T1CONbits.T1CKPS0               // bit 4
3160 #define T1CKPS1                 T1CONbits.T1CKPS1               // bit 5
3161 #define TMR1CS0                 T1CONbits.TMR1CS0               // bit 6
3162 #define TMR1CS1                 T1CONbits.TMR1CS1               // bit 7
3163 
3164 #define T1GSS0                  T1GCONbits.T1GSS0               // bit 0
3165 #define T1GSS1                  T1GCONbits.T1GSS1               // bit 1
3166 #define T1GVAL                  T1GCONbits.T1GVAL               // bit 2
3167 #define T1GGO_NOT_DONE          T1GCONbits.T1GGO_NOT_DONE       // bit 3, shadows bit in T1GCONbits
3168 #define T1GGO                   T1GCONbits.T1GGO                // bit 3, shadows bit in T1GCONbits
3169 #define T1GSPM                  T1GCONbits.T1GSPM               // bit 4
3170 #define T1GTM                   T1GCONbits.T1GTM                // bit 5
3171 #define T1GPOL                  T1GCONbits.T1GPOL               // bit 6
3172 #define TMR1GE                  T1GCONbits.TMR1GE               // bit 7
3173 
3174 #define T2CKPS0                 T2CONbits.T2CKPS0               // bit 0
3175 #define T2CKPS1                 T2CONbits.T2CKPS1               // bit 1
3176 #define TMR2ON                  T2CONbits.TMR2ON                // bit 2
3177 #define T2OUTPS0                T2CONbits.T2OUTPS0              // bit 3
3178 #define T2OUTPS1                T2CONbits.T2OUTPS1              // bit 4
3179 #define T2OUTPS2                T2CONbits.T2OUTPS2              // bit 5
3180 #define T2OUTPS3                T2CONbits.T2OUTPS3              // bit 6
3181 
3182 #define TRISA0                  TRISAbits.TRISA0                // bit 0
3183 #define TRISA1                  TRISAbits.TRISA1                // bit 1
3184 #define TRISA2                  TRISAbits.TRISA2                // bit 2
3185 #define TRISA3                  TRISAbits.TRISA3                // bit 3
3186 #define TRISA4                  TRISAbits.TRISA4                // bit 4
3187 #define TRISA5                  TRISAbits.TRISA5                // bit 5
3188 
3189 #define TX9D                    TXSTAbits.TX9D                  // bit 0
3190 #define TRMT                    TXSTAbits.TRMT                  // bit 1
3191 #define BRGH                    TXSTAbits.BRGH                  // bit 2
3192 #define SENDB                   TXSTAbits.SENDB                 // bit 3
3193 #define SYNC                    TXSTAbits.SYNC                  // bit 4
3194 #define TXEN                    TXSTAbits.TXEN                  // bit 5
3195 #define TX9                     TXSTAbits.TX9                   // bit 6
3196 #define CSRC                    TXSTAbits.CSRC                  // bit 7
3197 
3198 #define SWDTEN                  WDTCONbits.SWDTEN               // bit 0
3199 #define WDTPS0                  WDTCONbits.WDTPS0               // bit 1
3200 #define WDTPS1                  WDTCONbits.WDTPS1               // bit 2
3201 #define WDTPS2                  WDTCONbits.WDTPS2               // bit 3
3202 #define WDTPS3                  WDTCONbits.WDTPS3               // bit 4
3203 #define WDTPS4                  WDTCONbits.WDTPS4               // bit 5
3204 
3205 #define WPUA0                   WPUAbits.WPUA0                  // bit 0
3206 #define WPUA1                   WPUAbits.WPUA1                  // bit 1
3207 #define WPUA2                   WPUAbits.WPUA2                  // bit 2
3208 #define WPUA3                   WPUAbits.WPUA3                  // bit 3
3209 #define WPUA4                   WPUAbits.WPUA4                  // bit 4
3210 #define WPUA5                   WPUAbits.WPUA5                  // bit 5
3211 
3212 #endif // #ifndef NO_BIT_DEFINES
3213 
3214 #endif // #ifndef __PIC12F1822_H__
3215