struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16f1825.h
blob5840bee04a94fb8f92a883cdf880d4e7aa13feda
1 /*
2 * This declarations of the PIC16F1825 MCU.
4 * This file is part of the GNU PIC library for SDCC, originally
5 * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
7 * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:20 UTC.
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.
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.
22 * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
25 #ifndef __PIC16F1825_H__
26 #define __PIC16F1825_H__
28 //==============================================================================
30 // Register Addresses
32 //==============================================================================
34 #ifndef NO_ADDR_DEFINES
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 PORTC_ADDR 0x000E
52 #define PIR1_ADDR 0x0011
53 #define PIR2_ADDR 0x0012
54 #define PIR3_ADDR 0x0013
55 #define TMR0_ADDR 0x0015
56 #define TMR1_ADDR 0x0016
57 #define TMR1L_ADDR 0x0016
58 #define TMR1H_ADDR 0x0017
59 #define T1CON_ADDR 0x0018
60 #define T1GCON_ADDR 0x0019
61 #define TMR2_ADDR 0x001A
62 #define PR2_ADDR 0x001B
63 #define T2CON_ADDR 0x001C
64 #define CPSCON0_ADDR 0x001E
65 #define CPSCON1_ADDR 0x001F
66 #define TRISA_ADDR 0x008C
67 #define TRISC_ADDR 0x008E
68 #define PIE1_ADDR 0x0091
69 #define PIE2_ADDR 0x0092
70 #define PIE3_ADDR 0x0093
71 #define OPTION_REG_ADDR 0x0095
72 #define PCON_ADDR 0x0096
73 #define WDTCON_ADDR 0x0097
74 #define OSCTUNE_ADDR 0x0098
75 #define OSCCON_ADDR 0x0099
76 #define OSCSTAT_ADDR 0x009A
77 #define ADRES_ADDR 0x009B
78 #define ADRESL_ADDR 0x009B
79 #define ADRESH_ADDR 0x009C
80 #define ADCON0_ADDR 0x009D
81 #define ADCON1_ADDR 0x009E
82 #define LATA_ADDR 0x010C
83 #define LATC_ADDR 0x010E
84 #define CM1CON0_ADDR 0x0111
85 #define CM1CON1_ADDR 0x0112
86 #define CM2CON0_ADDR 0x0113
87 #define CM2CON1_ADDR 0x0114
88 #define CMOUT_ADDR 0x0115
89 #define BORCON_ADDR 0x0116
90 #define FVRCON_ADDR 0x0117
91 #define DACCON0_ADDR 0x0118
92 #define DACCON1_ADDR 0x0119
93 #define SRCON0_ADDR 0x011A
94 #define SRCON1_ADDR 0x011B
95 #define APFCON0_ADDR 0x011D
96 #define APFCON1_ADDR 0x011E
97 #define ANSELA_ADDR 0x018C
98 #define ANSELC_ADDR 0x018E
99 #define EEADR_ADDR 0x0191
100 #define EEADRL_ADDR 0x0191
101 #define EEADRH_ADDR 0x0192
102 #define EEDAT_ADDR 0x0193
103 #define EEDATL_ADDR 0x0193
104 #define EEDATH_ADDR 0x0194
105 #define EECON1_ADDR 0x0195
106 #define EECON2_ADDR 0x0196
107 #define RCREG_ADDR 0x0199
108 #define TXREG_ADDR 0x019A
109 #define SPBRG_ADDR 0x019B
110 #define SPBRGL_ADDR 0x019B
111 #define SPBRGH_ADDR 0x019C
112 #define RCSTA_ADDR 0x019D
113 #define TXSTA_ADDR 0x019E
114 #define BAUDCON_ADDR 0x019F
115 #define WPUA_ADDR 0x020C
116 #define WPUC_ADDR 0x020E
117 #define SSP1BUF_ADDR 0x0211
118 #define SSPBUF_ADDR 0x0211
119 #define SSP1ADD_ADDR 0x0212
120 #define SSPADD_ADDR 0x0212
121 #define SSP1MSK_ADDR 0x0213
122 #define SSPMSK_ADDR 0x0213
123 #define SSP1STAT_ADDR 0x0214
124 #define SSPSTAT_ADDR 0x0214
125 #define SSP1CON1_ADDR 0x0215
126 #define SSPCON_ADDR 0x0215
127 #define SSPCON1_ADDR 0x0215
128 #define SSP1CON2_ADDR 0x0216
129 #define SSPCON2_ADDR 0x0216
130 #define SSP1CON3_ADDR 0x0217
131 #define SSPCON3_ADDR 0x0217
132 #define CCPR1_ADDR 0x0291
133 #define CCPR1L_ADDR 0x0291
134 #define CCPR1H_ADDR 0x0292
135 #define CCP1CON_ADDR 0x0293
136 #define PWM1CON_ADDR 0x0294
137 #define CCP1AS_ADDR 0x0295
138 #define ECCP1AS_ADDR 0x0295
139 #define PSTR1CON_ADDR 0x0296
140 #define CCPR2_ADDR 0x0298
141 #define CCPR2L_ADDR 0x0298
142 #define CCPR2H_ADDR 0x0299
143 #define CCP2CON_ADDR 0x029A
144 #define PWM2CON_ADDR 0x029B
145 #define CCP2AS_ADDR 0x029C
146 #define PSTR2CON_ADDR 0x029D
147 #define CCPTMRS_ADDR 0x029E
148 #define CCPR3_ADDR 0x0311
149 #define CCPR3L_ADDR 0x0311
150 #define CCPR3H_ADDR 0x0312
151 #define CCP3CON_ADDR 0x0313
152 #define CCPR4_ADDR 0x0318
153 #define CCPR4L_ADDR 0x0318
154 #define CCPR4H_ADDR 0x0319
155 #define CCP4CON_ADDR 0x031A
156 #define INLVLA_ADDR 0x038C
157 #define INLVLC_ADDR 0x038E
158 #define IOCAP_ADDR 0x0391
159 #define IOCAN_ADDR 0x0392
160 #define IOCAF_ADDR 0x0393
161 #define CLKRCON_ADDR 0x039A
162 #define MDCON_ADDR 0x039C
163 #define MDSRC_ADDR 0x039D
164 #define MDCARL_ADDR 0x039E
165 #define MDCARH_ADDR 0x039F
166 #define TMR4_ADDR 0x0415
167 #define PR4_ADDR 0x0416
168 #define T4CON_ADDR 0x0417
169 #define TMR6_ADDR 0x041C
170 #define PR6_ADDR 0x041D
171 #define T6CON_ADDR 0x041E
172 #define STATUS_SHAD_ADDR 0x0FE4
173 #define WREG_SHAD_ADDR 0x0FE5
174 #define BSR_SHAD_ADDR 0x0FE6
175 #define PCLATH_SHAD_ADDR 0x0FE7
176 #define FSR0L_SHAD_ADDR 0x0FE8
177 #define FSR0H_SHAD_ADDR 0x0FE9
178 #define FSR1L_SHAD_ADDR 0x0FEA
179 #define FSR1H_SHAD_ADDR 0x0FEB
180 #define STKPTR_ADDR 0x0FED
181 #define TOSL_ADDR 0x0FEE
182 #define TOSH_ADDR 0x0FEF
184 #endif // #ifndef NO_ADDR_DEFINES
186 //==============================================================================
188 // Register Definitions
190 //==============================================================================
192 extern __at(0x0000) __sfr INDF0;
193 extern __at(0x0001) __sfr INDF1;
194 extern __at(0x0002) __sfr PCL;
196 //==============================================================================
197 // STATUS Bits
199 extern __at(0x0003) __sfr STATUS;
201 typedef struct
203 unsigned C : 1;
204 unsigned DC : 1;
205 unsigned Z : 1;
206 unsigned NOT_PD : 1;
207 unsigned NOT_TO : 1;
208 unsigned : 1;
209 unsigned : 1;
210 unsigned : 1;
211 } __STATUSbits_t;
213 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
215 #define _C 0x01
216 #define _DC 0x02
217 #define _Z 0x04
218 #define _NOT_PD 0x08
219 #define _NOT_TO 0x10
221 //==============================================================================
223 extern __at(0x0004) __sfr FSR0;
224 extern __at(0x0004) __sfr FSR0L;
225 extern __at(0x0005) __sfr FSR0H;
226 extern __at(0x0006) __sfr FSR1;
227 extern __at(0x0006) __sfr FSR1L;
228 extern __at(0x0007) __sfr FSR1H;
230 //==============================================================================
231 // BSR Bits
233 extern __at(0x0008) __sfr BSR;
235 typedef union
237 struct
239 unsigned BSR0 : 1;
240 unsigned BSR1 : 1;
241 unsigned BSR2 : 1;
242 unsigned BSR3 : 1;
243 unsigned BSR4 : 1;
244 unsigned : 1;
245 unsigned : 1;
246 unsigned : 1;
249 struct
251 unsigned BSR : 5;
252 unsigned : 3;
254 } __BSRbits_t;
256 extern __at(0x0008) volatile __BSRbits_t BSRbits;
258 #define _BSR0 0x01
259 #define _BSR1 0x02
260 #define _BSR2 0x04
261 #define _BSR3 0x08
262 #define _BSR4 0x10
264 //==============================================================================
266 extern __at(0x0009) __sfr WREG;
267 extern __at(0x000A) __sfr PCLATH;
269 //==============================================================================
270 // INTCON Bits
272 extern __at(0x000B) __sfr INTCON;
274 typedef union
276 struct
278 unsigned IOCIF : 1;
279 unsigned INTF : 1;
280 unsigned TMR0IF : 1;
281 unsigned IOCIE : 1;
282 unsigned INTE : 1;
283 unsigned TMR0IE : 1;
284 unsigned PEIE : 1;
285 unsigned GIE : 1;
288 struct
290 unsigned : 1;
291 unsigned : 1;
292 unsigned T0IF : 1;
293 unsigned : 1;
294 unsigned : 1;
295 unsigned T0IE : 1;
296 unsigned : 1;
297 unsigned : 1;
299 } __INTCONbits_t;
301 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
303 #define _IOCIF 0x01
304 #define _INTF 0x02
305 #define _TMR0IF 0x04
306 #define _T0IF 0x04
307 #define _IOCIE 0x08
308 #define _INTE 0x10
309 #define _TMR0IE 0x20
310 #define _T0IE 0x20
311 #define _PEIE 0x40
312 #define _GIE 0x80
314 //==============================================================================
317 //==============================================================================
318 // PORTA Bits
320 extern __at(0x000C) __sfr PORTA;
322 typedef union
324 struct
326 unsigned RA0 : 1;
327 unsigned RA1 : 1;
328 unsigned RA2 : 1;
329 unsigned RA3 : 1;
330 unsigned RA4 : 1;
331 unsigned RA5 : 1;
332 unsigned : 1;
333 unsigned : 1;
336 struct
338 unsigned RA : 6;
339 unsigned : 2;
341 } __PORTAbits_t;
343 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
345 #define _RA0 0x01
346 #define _RA1 0x02
347 #define _RA2 0x04
348 #define _RA3 0x08
349 #define _RA4 0x10
350 #define _RA5 0x20
352 //==============================================================================
355 //==============================================================================
356 // PORTC Bits
358 extern __at(0x000E) __sfr PORTC;
360 typedef union
362 struct
364 unsigned RC0 : 1;
365 unsigned RC1 : 1;
366 unsigned RC2 : 1;
367 unsigned RC3 : 1;
368 unsigned RC4 : 1;
369 unsigned RC5 : 1;
370 unsigned : 1;
371 unsigned : 1;
374 struct
376 unsigned RC : 6;
377 unsigned : 2;
379 } __PORTCbits_t;
381 extern __at(0x000E) volatile __PORTCbits_t PORTCbits;
383 #define _RC0 0x01
384 #define _RC1 0x02
385 #define _RC2 0x04
386 #define _RC3 0x08
387 #define _RC4 0x10
388 #define _RC5 0x20
390 //==============================================================================
393 //==============================================================================
394 // PIR1 Bits
396 extern __at(0x0011) __sfr PIR1;
398 typedef struct
400 unsigned TMR1IF : 1;
401 unsigned TMR2IF : 1;
402 unsigned CCP1IF : 1;
403 unsigned SSP1IF : 1;
404 unsigned TXIF : 1;
405 unsigned RCIF : 1;
406 unsigned ADIF : 1;
407 unsigned TMR1GIF : 1;
408 } __PIR1bits_t;
410 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
412 #define _TMR1IF 0x01
413 #define _TMR2IF 0x02
414 #define _CCP1IF 0x04
415 #define _SSP1IF 0x08
416 #define _TXIF 0x10
417 #define _RCIF 0x20
418 #define _ADIF 0x40
419 #define _TMR1GIF 0x80
421 //==============================================================================
424 //==============================================================================
425 // PIR2 Bits
427 extern __at(0x0012) __sfr PIR2;
429 typedef struct
431 unsigned CCP2IF : 1;
432 unsigned : 1;
433 unsigned : 1;
434 unsigned BCL1IF : 1;
435 unsigned EEIF : 1;
436 unsigned C1IF : 1;
437 unsigned C2IF : 1;
438 unsigned OSFIF : 1;
439 } __PIR2bits_t;
441 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
443 #define _CCP2IF 0x01
444 #define _BCL1IF 0x08
445 #define _EEIF 0x10
446 #define _C1IF 0x20
447 #define _C2IF 0x40
448 #define _OSFIF 0x80
450 //==============================================================================
453 //==============================================================================
454 // PIR3 Bits
456 extern __at(0x0013) __sfr PIR3;
458 typedef struct
460 unsigned : 1;
461 unsigned TMR4IF : 1;
462 unsigned : 1;
463 unsigned TMR6IF : 1;
464 unsigned CCP3IF : 1;
465 unsigned CCP4IF : 1;
466 unsigned : 1;
467 unsigned : 1;
468 } __PIR3bits_t;
470 extern __at(0x0013) volatile __PIR3bits_t PIR3bits;
472 #define _TMR4IF 0x02
473 #define _TMR6IF 0x08
474 #define _CCP3IF 0x10
475 #define _CCP4IF 0x20
477 //==============================================================================
479 extern __at(0x0015) __sfr TMR0;
480 extern __at(0x0016) __sfr TMR1;
481 extern __at(0x0016) __sfr TMR1L;
482 extern __at(0x0017) __sfr TMR1H;
484 //==============================================================================
485 // T1CON Bits
487 extern __at(0x0018) __sfr T1CON;
489 typedef union
491 struct
493 unsigned TMR1ON : 1;
494 unsigned : 1;
495 unsigned NOT_T1SYNC : 1;
496 unsigned T1OSCEN : 1;
497 unsigned T1CKPS0 : 1;
498 unsigned T1CKPS1 : 1;
499 unsigned TMR1CS0 : 1;
500 unsigned TMR1CS1 : 1;
503 struct
505 unsigned : 4;
506 unsigned T1CKPS : 2;
507 unsigned : 2;
510 struct
512 unsigned : 6;
513 unsigned TMR1CS : 2;
515 } __T1CONbits_t;
517 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
519 #define _TMR1ON 0x01
520 #define _NOT_T1SYNC 0x04
521 #define _T1OSCEN 0x08
522 #define _T1CKPS0 0x10
523 #define _T1CKPS1 0x20
524 #define _TMR1CS0 0x40
525 #define _TMR1CS1 0x80
527 //==============================================================================
530 //==============================================================================
531 // T1GCON Bits
533 extern __at(0x0019) __sfr T1GCON;
535 typedef union
537 struct
539 unsigned T1GSS0 : 1;
540 unsigned T1GSS1 : 1;
541 unsigned T1GVAL : 1;
542 unsigned T1GGO : 1;
543 unsigned T1GSPM : 1;
544 unsigned T1GTM : 1;
545 unsigned T1GPOL : 1;
546 unsigned TMR1GE : 1;
549 struct
551 unsigned T1GSS : 2;
552 unsigned : 6;
554 } __T1GCONbits_t;
556 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
558 #define _T1GSS0 0x01
559 #define _T1GSS1 0x02
560 #define _T1GVAL 0x04
561 #define _T1GGO 0x08
562 #define _T1GSPM 0x10
563 #define _T1GTM 0x20
564 #define _T1GPOL 0x40
565 #define _TMR1GE 0x80
567 //==============================================================================
569 extern __at(0x001A) __sfr TMR2;
570 extern __at(0x001B) __sfr PR2;
572 //==============================================================================
573 // T2CON Bits
575 extern __at(0x001C) __sfr T2CON;
577 typedef union
579 struct
581 unsigned T2CKPS0 : 1;
582 unsigned T2CKPS1 : 1;
583 unsigned TMR2ON : 1;
584 unsigned T2OUTPS0 : 1;
585 unsigned T2OUTPS1 : 1;
586 unsigned T2OUTPS2 : 1;
587 unsigned T2OUTPS3 : 1;
588 unsigned : 1;
591 struct
593 unsigned T2CKPS : 2;
594 unsigned : 6;
597 struct
599 unsigned : 3;
600 unsigned T2OUTPS : 4;
601 unsigned : 1;
603 } __T2CONbits_t;
605 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
607 #define _T2CKPS0 0x01
608 #define _T2CKPS1 0x02
609 #define _TMR2ON 0x04
610 #define _T2OUTPS0 0x08
611 #define _T2OUTPS1 0x10
612 #define _T2OUTPS2 0x20
613 #define _T2OUTPS3 0x40
615 //==============================================================================
618 //==============================================================================
619 // CPSCON0 Bits
621 extern __at(0x001E) __sfr CPSCON0;
623 typedef union
625 struct
627 unsigned T0XCS : 1;
628 unsigned CPSOUT : 1;
629 unsigned CPSRNG0 : 1;
630 unsigned CPSRNG1 : 1;
631 unsigned : 1;
632 unsigned : 1;
633 unsigned CPSRM : 1;
634 unsigned CPSON : 1;
637 struct
639 unsigned : 2;
640 unsigned CPSRNG : 2;
641 unsigned : 4;
643 } __CPSCON0bits_t;
645 extern __at(0x001E) volatile __CPSCON0bits_t CPSCON0bits;
647 #define _T0XCS 0x01
648 #define _CPSOUT 0x02
649 #define _CPSRNG0 0x04
650 #define _CPSRNG1 0x08
651 #define _CPSRM 0x40
652 #define _CPSON 0x80
654 //==============================================================================
657 //==============================================================================
658 // CPSCON1 Bits
660 extern __at(0x001F) __sfr CPSCON1;
662 typedef union
664 struct
666 unsigned CPSCH0 : 1;
667 unsigned CPSCH1 : 1;
668 unsigned CPSCH2 : 1;
669 unsigned CPSCH3 : 1;
670 unsigned : 1;
671 unsigned : 1;
672 unsigned : 1;
673 unsigned : 1;
676 struct
678 unsigned CPSCH : 4;
679 unsigned : 4;
681 } __CPSCON1bits_t;
683 extern __at(0x001F) volatile __CPSCON1bits_t CPSCON1bits;
685 #define _CPSCH0 0x01
686 #define _CPSCH1 0x02
687 #define _CPSCH2 0x04
688 #define _CPSCH3 0x08
690 //==============================================================================
693 //==============================================================================
694 // TRISA Bits
696 extern __at(0x008C) __sfr TRISA;
698 typedef union
700 struct
702 unsigned TRISA0 : 1;
703 unsigned TRISA1 : 1;
704 unsigned TRISA2 : 1;
705 unsigned TRISA3 : 1;
706 unsigned TRISA4 : 1;
707 unsigned TRISA5 : 1;
708 unsigned : 1;
709 unsigned : 1;
712 struct
714 unsigned TRISA : 6;
715 unsigned : 2;
717 } __TRISAbits_t;
719 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
721 #define _TRISA0 0x01
722 #define _TRISA1 0x02
723 #define _TRISA2 0x04
724 #define _TRISA3 0x08
725 #define _TRISA4 0x10
726 #define _TRISA5 0x20
728 //==============================================================================
731 //==============================================================================
732 // TRISC Bits
734 extern __at(0x008E) __sfr TRISC;
736 typedef union
738 struct
740 unsigned TRISC0 : 1;
741 unsigned TRISC1 : 1;
742 unsigned TRISC2 : 1;
743 unsigned TRISC3 : 1;
744 unsigned TRISC4 : 1;
745 unsigned TRISC5 : 1;
746 unsigned : 1;
747 unsigned : 1;
750 struct
752 unsigned TRISC : 6;
753 unsigned : 2;
755 } __TRISCbits_t;
757 extern __at(0x008E) volatile __TRISCbits_t TRISCbits;
759 #define _TRISC0 0x01
760 #define _TRISC1 0x02
761 #define _TRISC2 0x04
762 #define _TRISC3 0x08
763 #define _TRISC4 0x10
764 #define _TRISC5 0x20
766 //==============================================================================
769 //==============================================================================
770 // PIE1 Bits
772 extern __at(0x0091) __sfr PIE1;
774 typedef struct
776 unsigned TMR1IE : 1;
777 unsigned TMR2IE : 1;
778 unsigned CCP1IE : 1;
779 unsigned SSP1IE : 1;
780 unsigned TXIE : 1;
781 unsigned RCIE : 1;
782 unsigned ADIE : 1;
783 unsigned TMR1GIE : 1;
784 } __PIE1bits_t;
786 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
788 #define _TMR1IE 0x01
789 #define _TMR2IE 0x02
790 #define _CCP1IE 0x04
791 #define _SSP1IE 0x08
792 #define _TXIE 0x10
793 #define _RCIE 0x20
794 #define _ADIE 0x40
795 #define _TMR1GIE 0x80
797 //==============================================================================
800 //==============================================================================
801 // PIE2 Bits
803 extern __at(0x0092) __sfr PIE2;
805 typedef struct
807 unsigned CCP2IE : 1;
808 unsigned : 1;
809 unsigned : 1;
810 unsigned BCL1IE : 1;
811 unsigned EEIE : 1;
812 unsigned C1IE : 1;
813 unsigned C2IE : 1;
814 unsigned OSFIE : 1;
815 } __PIE2bits_t;
817 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
819 #define _CCP2IE 0x01
820 #define _BCL1IE 0x08
821 #define _EEIE 0x10
822 #define _C1IE 0x20
823 #define _C2IE 0x40
824 #define _OSFIE 0x80
826 //==============================================================================
829 //==============================================================================
830 // PIE3 Bits
832 extern __at(0x0093) __sfr PIE3;
834 typedef struct
836 unsigned : 1;
837 unsigned TMR4IE : 1;
838 unsigned : 1;
839 unsigned TMR6IE : 1;
840 unsigned CCP3IE : 1;
841 unsigned CCP4IE : 1;
842 unsigned : 1;
843 unsigned : 1;
844 } __PIE3bits_t;
846 extern __at(0x0093) volatile __PIE3bits_t PIE3bits;
848 #define _TMR4IE 0x02
849 #define _TMR6IE 0x08
850 #define _CCP3IE 0x10
851 #define _CCP4IE 0x20
853 //==============================================================================
856 //==============================================================================
857 // OPTION_REG Bits
859 extern __at(0x0095) __sfr OPTION_REG;
861 typedef union
863 struct
865 unsigned PS0 : 1;
866 unsigned PS1 : 1;
867 unsigned PS2 : 1;
868 unsigned PSA : 1;
869 unsigned TMR0SE : 1;
870 unsigned TMR0CS : 1;
871 unsigned INTEDG : 1;
872 unsigned NOT_WPUEN : 1;
875 struct
877 unsigned : 1;
878 unsigned : 1;
879 unsigned : 1;
880 unsigned : 1;
881 unsigned T0SE : 1;
882 unsigned T0CS : 1;
883 unsigned : 1;
884 unsigned : 1;
887 struct
889 unsigned PS : 3;
890 unsigned : 5;
892 } __OPTION_REGbits_t;
894 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
896 #define _PS0 0x01
897 #define _PS1 0x02
898 #define _PS2 0x04
899 #define _PSA 0x08
900 #define _TMR0SE 0x10
901 #define _T0SE 0x10
902 #define _TMR0CS 0x20
903 #define _T0CS 0x20
904 #define _INTEDG 0x40
905 #define _NOT_WPUEN 0x80
907 //==============================================================================
910 //==============================================================================
911 // PCON Bits
913 extern __at(0x0096) __sfr PCON;
915 typedef struct
917 unsigned NOT_BOR : 1;
918 unsigned NOT_POR : 1;
919 unsigned NOT_RI : 1;
920 unsigned NOT_RMCLR : 1;
921 unsigned : 1;
922 unsigned : 1;
923 unsigned STKUNF : 1;
924 unsigned STKOVF : 1;
925 } __PCONbits_t;
927 extern __at(0x0096) volatile __PCONbits_t PCONbits;
929 #define _NOT_BOR 0x01
930 #define _NOT_POR 0x02
931 #define _NOT_RI 0x04
932 #define _NOT_RMCLR 0x08
933 #define _STKUNF 0x40
934 #define _STKOVF 0x80
936 //==============================================================================
939 //==============================================================================
940 // WDTCON Bits
942 extern __at(0x0097) __sfr WDTCON;
944 typedef union
946 struct
948 unsigned SWDTEN : 1;
949 unsigned WDTPS0 : 1;
950 unsigned WDTPS1 : 1;
951 unsigned WDTPS2 : 1;
952 unsigned WDTPS3 : 1;
953 unsigned WDTPS4 : 1;
954 unsigned : 1;
955 unsigned : 1;
958 struct
960 unsigned : 1;
961 unsigned WDTPS : 5;
962 unsigned : 2;
964 } __WDTCONbits_t;
966 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
968 #define _SWDTEN 0x01
969 #define _WDTPS0 0x02
970 #define _WDTPS1 0x04
971 #define _WDTPS2 0x08
972 #define _WDTPS3 0x10
973 #define _WDTPS4 0x20
975 //==============================================================================
978 //==============================================================================
979 // OSCTUNE Bits
981 extern __at(0x0098) __sfr OSCTUNE;
983 typedef union
985 struct
987 unsigned TUN0 : 1;
988 unsigned TUN1 : 1;
989 unsigned TUN2 : 1;
990 unsigned TUN3 : 1;
991 unsigned TUN4 : 1;
992 unsigned TUN5 : 1;
993 unsigned : 1;
994 unsigned : 1;
997 struct
999 unsigned TUN : 6;
1000 unsigned : 2;
1002 } __OSCTUNEbits_t;
1004 extern __at(0x0098) volatile __OSCTUNEbits_t OSCTUNEbits;
1006 #define _TUN0 0x01
1007 #define _TUN1 0x02
1008 #define _TUN2 0x04
1009 #define _TUN3 0x08
1010 #define _TUN4 0x10
1011 #define _TUN5 0x20
1013 //==============================================================================
1016 //==============================================================================
1017 // OSCCON Bits
1019 extern __at(0x0099) __sfr OSCCON;
1021 typedef union
1023 struct
1025 unsigned SCS0 : 1;
1026 unsigned SCS1 : 1;
1027 unsigned : 1;
1028 unsigned IRCF0 : 1;
1029 unsigned IRCF1 : 1;
1030 unsigned IRCF2 : 1;
1031 unsigned IRCF3 : 1;
1032 unsigned SPLLEN : 1;
1035 struct
1037 unsigned SCS : 2;
1038 unsigned : 6;
1041 struct
1043 unsigned : 3;
1044 unsigned IRCF : 4;
1045 unsigned : 1;
1047 } __OSCCONbits_t;
1049 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
1051 #define _SCS0 0x01
1052 #define _SCS1 0x02
1053 #define _IRCF0 0x08
1054 #define _IRCF1 0x10
1055 #define _IRCF2 0x20
1056 #define _IRCF3 0x40
1057 #define _SPLLEN 0x80
1059 //==============================================================================
1062 //==============================================================================
1063 // OSCSTAT Bits
1065 extern __at(0x009A) __sfr OSCSTAT;
1067 typedef struct
1069 unsigned HFIOFS : 1;
1070 unsigned LFIOFR : 1;
1071 unsigned MFIOFR : 1;
1072 unsigned HFIOFL : 1;
1073 unsigned HFIOFR : 1;
1074 unsigned OSTS : 1;
1075 unsigned PLLR : 1;
1076 unsigned T1OSCR : 1;
1077 } __OSCSTATbits_t;
1079 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
1081 #define _HFIOFS 0x01
1082 #define _LFIOFR 0x02
1083 #define _MFIOFR 0x04
1084 #define _HFIOFL 0x08
1085 #define _HFIOFR 0x10
1086 #define _OSTS 0x20
1087 #define _PLLR 0x40
1088 #define _T1OSCR 0x80
1090 //==============================================================================
1092 extern __at(0x009B) __sfr ADRES;
1093 extern __at(0x009B) __sfr ADRESL;
1094 extern __at(0x009C) __sfr ADRESH;
1096 //==============================================================================
1097 // ADCON0 Bits
1099 extern __at(0x009D) __sfr ADCON0;
1101 typedef union
1103 struct
1105 unsigned ADON : 1;
1106 unsigned GO_NOT_DONE : 1;
1107 unsigned CHS0 : 1;
1108 unsigned CHS1 : 1;
1109 unsigned CHS2 : 1;
1110 unsigned CHS3 : 1;
1111 unsigned CHS4 : 1;
1112 unsigned : 1;
1115 struct
1117 unsigned : 1;
1118 unsigned ADGO : 1;
1119 unsigned : 1;
1120 unsigned : 1;
1121 unsigned : 1;
1122 unsigned : 1;
1123 unsigned : 1;
1124 unsigned : 1;
1127 struct
1129 unsigned : 1;
1130 unsigned GO : 1;
1131 unsigned : 1;
1132 unsigned : 1;
1133 unsigned : 1;
1134 unsigned : 1;
1135 unsigned : 1;
1136 unsigned : 1;
1139 struct
1141 unsigned : 2;
1142 unsigned CHS : 5;
1143 unsigned : 1;
1145 } __ADCON0bits_t;
1147 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1149 #define _ADON 0x01
1150 #define _GO_NOT_DONE 0x02
1151 #define _ADGO 0x02
1152 #define _GO 0x02
1153 #define _CHS0 0x04
1154 #define _CHS1 0x08
1155 #define _CHS2 0x10
1156 #define _CHS3 0x20
1157 #define _CHS4 0x40
1159 //==============================================================================
1162 //==============================================================================
1163 // ADCON1 Bits
1165 extern __at(0x009E) __sfr ADCON1;
1167 typedef union
1169 struct
1171 unsigned ADPREF0 : 1;
1172 unsigned ADPREF1 : 1;
1173 unsigned ADNREF : 1;
1174 unsigned : 1;
1175 unsigned ADCS0 : 1;
1176 unsigned ADCS1 : 1;
1177 unsigned ADCS2 : 1;
1178 unsigned ADFM : 1;
1181 struct
1183 unsigned ADPREF : 2;
1184 unsigned : 6;
1187 struct
1189 unsigned : 4;
1190 unsigned ADCS : 3;
1191 unsigned : 1;
1193 } __ADCON1bits_t;
1195 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1197 #define _ADPREF0 0x01
1198 #define _ADPREF1 0x02
1199 #define _ADNREF 0x04
1200 #define _ADCS0 0x10
1201 #define _ADCS1 0x20
1202 #define _ADCS2 0x40
1203 #define _ADFM 0x80
1205 //==============================================================================
1208 //==============================================================================
1209 // LATA Bits
1211 extern __at(0x010C) __sfr LATA;
1213 typedef struct
1215 unsigned LATA0 : 1;
1216 unsigned LATA1 : 1;
1217 unsigned LATA2 : 1;
1218 unsigned : 1;
1219 unsigned LATA4 : 1;
1220 unsigned LATA5 : 1;
1221 unsigned : 1;
1222 unsigned : 1;
1223 } __LATAbits_t;
1225 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1227 #define _LATA0 0x01
1228 #define _LATA1 0x02
1229 #define _LATA2 0x04
1230 #define _LATA4 0x10
1231 #define _LATA5 0x20
1233 //==============================================================================
1236 //==============================================================================
1237 // LATC Bits
1239 extern __at(0x010E) __sfr LATC;
1241 typedef union
1243 struct
1245 unsigned LATC0 : 1;
1246 unsigned LATC1 : 1;
1247 unsigned LATC2 : 1;
1248 unsigned LATC3 : 1;
1249 unsigned LATC4 : 1;
1250 unsigned LATC5 : 1;
1251 unsigned : 1;
1252 unsigned : 1;
1255 struct
1257 unsigned LATC : 6;
1258 unsigned : 2;
1260 } __LATCbits_t;
1262 extern __at(0x010E) volatile __LATCbits_t LATCbits;
1264 #define _LATC0 0x01
1265 #define _LATC1 0x02
1266 #define _LATC2 0x04
1267 #define _LATC3 0x08
1268 #define _LATC4 0x10
1269 #define _LATC5 0x20
1271 //==============================================================================
1274 //==============================================================================
1275 // CM1CON0 Bits
1277 extern __at(0x0111) __sfr CM1CON0;
1279 typedef struct
1281 unsigned C1SYNC : 1;
1282 unsigned C1HYS : 1;
1283 unsigned C1SP : 1;
1284 unsigned : 1;
1285 unsigned C1POL : 1;
1286 unsigned C1OE : 1;
1287 unsigned C1OUT : 1;
1288 unsigned C1ON : 1;
1289 } __CM1CON0bits_t;
1291 extern __at(0x0111) volatile __CM1CON0bits_t CM1CON0bits;
1293 #define _C1SYNC 0x01
1294 #define _C1HYS 0x02
1295 #define _C1SP 0x04
1296 #define _C1POL 0x10
1297 #define _C1OE 0x20
1298 #define _C1OUT 0x40
1299 #define _C1ON 0x80
1301 //==============================================================================
1304 //==============================================================================
1305 // CM1CON1 Bits
1307 extern __at(0x0112) __sfr CM1CON1;
1309 typedef union
1311 struct
1313 unsigned C1NCH0 : 1;
1314 unsigned C1NCH1 : 1;
1315 unsigned : 1;
1316 unsigned : 1;
1317 unsigned C1PCH0 : 1;
1318 unsigned C1PCH1 : 1;
1319 unsigned C1INTN : 1;
1320 unsigned C1INTP : 1;
1323 struct
1325 unsigned C1NCH : 2;
1326 unsigned : 6;
1329 struct
1331 unsigned : 4;
1332 unsigned C1PCH : 2;
1333 unsigned : 2;
1335 } __CM1CON1bits_t;
1337 extern __at(0x0112) volatile __CM1CON1bits_t CM1CON1bits;
1339 #define _C1NCH0 0x01
1340 #define _C1NCH1 0x02
1341 #define _C1PCH0 0x10
1342 #define _C1PCH1 0x20
1343 #define _C1INTN 0x40
1344 #define _C1INTP 0x80
1346 //==============================================================================
1349 //==============================================================================
1350 // CM2CON0 Bits
1352 extern __at(0x0113) __sfr CM2CON0;
1354 typedef struct
1356 unsigned C2SYNC : 1;
1357 unsigned C2HYS : 1;
1358 unsigned C2SP : 1;
1359 unsigned : 1;
1360 unsigned C2POL : 1;
1361 unsigned C2OE : 1;
1362 unsigned C2OUT : 1;
1363 unsigned C2ON : 1;
1364 } __CM2CON0bits_t;
1366 extern __at(0x0113) volatile __CM2CON0bits_t CM2CON0bits;
1368 #define _C2SYNC 0x01
1369 #define _C2HYS 0x02
1370 #define _C2SP 0x04
1371 #define _C2POL 0x10
1372 #define _C2OE 0x20
1373 #define _C2OUT 0x40
1374 #define _C2ON 0x80
1376 //==============================================================================
1379 //==============================================================================
1380 // CM2CON1 Bits
1382 extern __at(0x0114) __sfr CM2CON1;
1384 typedef union
1386 struct
1388 unsigned C2NCH0 : 1;
1389 unsigned C2NCH1 : 1;
1390 unsigned : 1;
1391 unsigned : 1;
1392 unsigned C2PCH0 : 1;
1393 unsigned C2PCH1 : 1;
1394 unsigned C2INTN : 1;
1395 unsigned C2INTP : 1;
1398 struct
1400 unsigned C2NCH : 2;
1401 unsigned : 6;
1404 struct
1406 unsigned : 4;
1407 unsigned C2PCH : 2;
1408 unsigned : 2;
1410 } __CM2CON1bits_t;
1412 extern __at(0x0114) volatile __CM2CON1bits_t CM2CON1bits;
1414 #define _C2NCH0 0x01
1415 #define _C2NCH1 0x02
1416 #define _C2PCH0 0x10
1417 #define _C2PCH1 0x20
1418 #define _C2INTN 0x40
1419 #define _C2INTP 0x80
1421 //==============================================================================
1424 //==============================================================================
1425 // CMOUT Bits
1427 extern __at(0x0115) __sfr CMOUT;
1429 typedef struct
1431 unsigned MC1OUT : 1;
1432 unsigned MC2OUT : 1;
1433 unsigned : 1;
1434 unsigned : 1;
1435 unsigned : 1;
1436 unsigned : 1;
1437 unsigned : 1;
1438 unsigned : 1;
1439 } __CMOUTbits_t;
1441 extern __at(0x0115) volatile __CMOUTbits_t CMOUTbits;
1443 #define _MC1OUT 0x01
1444 #define _MC2OUT 0x02
1446 //==============================================================================
1449 //==============================================================================
1450 // BORCON Bits
1452 extern __at(0x0116) __sfr BORCON;
1454 typedef struct
1456 unsigned BORRDY : 1;
1457 unsigned : 1;
1458 unsigned : 1;
1459 unsigned : 1;
1460 unsigned : 1;
1461 unsigned : 1;
1462 unsigned : 1;
1463 unsigned SBOREN : 1;
1464 } __BORCONbits_t;
1466 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1468 #define _BORRDY 0x01
1469 #define _SBOREN 0x80
1471 //==============================================================================
1474 //==============================================================================
1475 // FVRCON Bits
1477 extern __at(0x0117) __sfr FVRCON;
1479 typedef union
1481 struct
1483 unsigned ADFVR0 : 1;
1484 unsigned ADFVR1 : 1;
1485 unsigned CDAFVR0 : 1;
1486 unsigned CDAFVR1 : 1;
1487 unsigned TSRNG : 1;
1488 unsigned TSEN : 1;
1489 unsigned FVRRDY : 1;
1490 unsigned FVREN : 1;
1493 struct
1495 unsigned ADFVR : 2;
1496 unsigned : 6;
1499 struct
1501 unsigned : 2;
1502 unsigned CDAFVR : 2;
1503 unsigned : 4;
1505 } __FVRCONbits_t;
1507 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1509 #define _ADFVR0 0x01
1510 #define _ADFVR1 0x02
1511 #define _CDAFVR0 0x04
1512 #define _CDAFVR1 0x08
1513 #define _TSRNG 0x10
1514 #define _TSEN 0x20
1515 #define _FVRRDY 0x40
1516 #define _FVREN 0x80
1518 //==============================================================================
1521 //==============================================================================
1522 // DACCON0 Bits
1524 extern __at(0x0118) __sfr DACCON0;
1526 typedef union
1528 struct
1530 unsigned DACNSS : 1;
1531 unsigned : 1;
1532 unsigned DACPSS0 : 1;
1533 unsigned DACPSS1 : 1;
1534 unsigned : 1;
1535 unsigned DACOE : 1;
1536 unsigned DACLPS : 1;
1537 unsigned DACEN : 1;
1540 struct
1542 unsigned : 2;
1543 unsigned DACPSS : 2;
1544 unsigned : 4;
1546 } __DACCON0bits_t;
1548 extern __at(0x0118) volatile __DACCON0bits_t DACCON0bits;
1550 #define _DACNSS 0x01
1551 #define _DACPSS0 0x04
1552 #define _DACPSS1 0x08
1553 #define _DACOE 0x20
1554 #define _DACLPS 0x40
1555 #define _DACEN 0x80
1557 //==============================================================================
1560 //==============================================================================
1561 // DACCON1 Bits
1563 extern __at(0x0119) __sfr DACCON1;
1565 typedef union
1567 struct
1569 unsigned DACR0 : 1;
1570 unsigned DACR1 : 1;
1571 unsigned DACR2 : 1;
1572 unsigned DACR3 : 1;
1573 unsigned DACR4 : 1;
1574 unsigned : 1;
1575 unsigned : 1;
1576 unsigned : 1;
1579 struct
1581 unsigned DACR : 5;
1582 unsigned : 3;
1584 } __DACCON1bits_t;
1586 extern __at(0x0119) volatile __DACCON1bits_t DACCON1bits;
1588 #define _DACR0 0x01
1589 #define _DACR1 0x02
1590 #define _DACR2 0x04
1591 #define _DACR3 0x08
1592 #define _DACR4 0x10
1594 //==============================================================================
1597 //==============================================================================
1598 // SRCON0 Bits
1600 extern __at(0x011A) __sfr SRCON0;
1602 typedef union
1604 struct
1606 unsigned SRPR : 1;
1607 unsigned SRPS : 1;
1608 unsigned SRNQEN : 1;
1609 unsigned SRQEN : 1;
1610 unsigned SRCLK0 : 1;
1611 unsigned SRCLK1 : 1;
1612 unsigned SRCLK2 : 1;
1613 unsigned SRLEN : 1;
1616 struct
1618 unsigned : 4;
1619 unsigned SRCLK : 3;
1620 unsigned : 1;
1622 } __SRCON0bits_t;
1624 extern __at(0x011A) volatile __SRCON0bits_t SRCON0bits;
1626 #define _SRPR 0x01
1627 #define _SRPS 0x02
1628 #define _SRNQEN 0x04
1629 #define _SRQEN 0x08
1630 #define _SRCLK0 0x10
1631 #define _SRCLK1 0x20
1632 #define _SRCLK2 0x40
1633 #define _SRLEN 0x80
1635 //==============================================================================
1638 //==============================================================================
1639 // SRCON1 Bits
1641 extern __at(0x011B) __sfr SRCON1;
1643 typedef struct
1645 unsigned SRRC1E : 1;
1646 unsigned : 1;
1647 unsigned SRRCKE : 1;
1648 unsigned SRRPE : 1;
1649 unsigned SRSC1E : 1;
1650 unsigned : 1;
1651 unsigned SRSCKE : 1;
1652 unsigned SRSPE : 1;
1653 } __SRCON1bits_t;
1655 extern __at(0x011B) volatile __SRCON1bits_t SRCON1bits;
1657 #define _SRRC1E 0x01
1658 #define _SRRCKE 0x04
1659 #define _SRRPE 0x08
1660 #define _SRSC1E 0x10
1661 #define _SRSCKE 0x40
1662 #define _SRSPE 0x80
1664 //==============================================================================
1667 //==============================================================================
1668 // APFCON0 Bits
1670 extern __at(0x011D) __sfr APFCON0;
1672 typedef struct
1674 unsigned : 1;
1675 unsigned : 1;
1676 unsigned TXCKSEL : 1;
1677 unsigned T1GSEL : 1;
1678 unsigned : 1;
1679 unsigned SSSEL : 1;
1680 unsigned SDOSEL : 1;
1681 unsigned RXDTSEL : 1;
1682 } __APFCON0bits_t;
1684 extern __at(0x011D) volatile __APFCON0bits_t APFCON0bits;
1686 #define _TXCKSEL 0x04
1687 #define _T1GSEL 0x08
1688 #define _SSSEL 0x20
1689 #define _SDOSEL 0x40
1690 #define _RXDTSEL 0x80
1692 //==============================================================================
1695 //==============================================================================
1696 // APFCON1 Bits
1698 extern __at(0x011E) __sfr APFCON1;
1700 typedef struct
1702 unsigned CCP2SEL : 1;
1703 unsigned P2BSEL : 1;
1704 unsigned P1CSEL : 1;
1705 unsigned P1DSEL : 1;
1706 unsigned : 1;
1707 unsigned : 1;
1708 unsigned : 1;
1709 unsigned : 1;
1710 } __APFCON1bits_t;
1712 extern __at(0x011E) volatile __APFCON1bits_t APFCON1bits;
1714 #define _CCP2SEL 0x01
1715 #define _P2BSEL 0x02
1716 #define _P1CSEL 0x04
1717 #define _P1DSEL 0x08
1719 //==============================================================================
1722 //==============================================================================
1723 // ANSELA Bits
1725 extern __at(0x018C) __sfr ANSELA;
1727 typedef struct
1729 unsigned ANSA0 : 1;
1730 unsigned ANSA1 : 1;
1731 unsigned ANSA2 : 1;
1732 unsigned : 1;
1733 unsigned ANSA4 : 1;
1734 unsigned : 1;
1735 unsigned : 1;
1736 unsigned : 1;
1737 } __ANSELAbits_t;
1739 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1741 #define _ANSA0 0x01
1742 #define _ANSA1 0x02
1743 #define _ANSA2 0x04
1744 #define _ANSA4 0x10
1746 //==============================================================================
1749 //==============================================================================
1750 // ANSELC Bits
1752 extern __at(0x018E) __sfr ANSELC;
1754 typedef union
1756 struct
1758 unsigned ANSC0 : 1;
1759 unsigned ANSC1 : 1;
1760 unsigned ANSC2 : 1;
1761 unsigned ANSC3 : 1;
1762 unsigned : 1;
1763 unsigned : 1;
1764 unsigned : 1;
1765 unsigned : 1;
1768 struct
1770 unsigned ANSC : 4;
1771 unsigned : 4;
1773 } __ANSELCbits_t;
1775 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits;
1777 #define _ANSC0 0x01
1778 #define _ANSC1 0x02
1779 #define _ANSC2 0x04
1780 #define _ANSC3 0x08
1782 //==============================================================================
1784 extern __at(0x0191) __sfr EEADR;
1785 extern __at(0x0191) __sfr EEADRL;
1786 extern __at(0x0192) __sfr EEADRH;
1787 extern __at(0x0193) __sfr EEDAT;
1788 extern __at(0x0193) __sfr EEDATL;
1789 extern __at(0x0194) __sfr EEDATH;
1791 //==============================================================================
1792 // EECON1 Bits
1794 extern __at(0x0195) __sfr EECON1;
1796 typedef struct
1798 unsigned RD : 1;
1799 unsigned WR : 1;
1800 unsigned WREN : 1;
1801 unsigned WRERR : 1;
1802 unsigned FREE : 1;
1803 unsigned LWLO : 1;
1804 unsigned CFGS : 1;
1805 unsigned EEPGD : 1;
1806 } __EECON1bits_t;
1808 extern __at(0x0195) volatile __EECON1bits_t EECON1bits;
1810 #define _RD 0x01
1811 #define _WR 0x02
1812 #define _WREN 0x04
1813 #define _WRERR 0x08
1814 #define _FREE 0x10
1815 #define _LWLO 0x20
1816 #define _CFGS 0x40
1817 #define _EEPGD 0x80
1819 //==============================================================================
1821 extern __at(0x0196) __sfr EECON2;
1822 extern __at(0x0199) __sfr RCREG;
1823 extern __at(0x019A) __sfr TXREG;
1824 extern __at(0x019B) __sfr SPBRG;
1825 extern __at(0x019B) __sfr SPBRGL;
1826 extern __at(0x019C) __sfr SPBRGH;
1828 //==============================================================================
1829 // RCSTA Bits
1831 extern __at(0x019D) __sfr RCSTA;
1833 typedef struct
1835 unsigned RX9D : 1;
1836 unsigned OERR : 1;
1837 unsigned FERR : 1;
1838 unsigned ADDEN : 1;
1839 unsigned CREN : 1;
1840 unsigned SREN : 1;
1841 unsigned RX9 : 1;
1842 unsigned SPEN : 1;
1843 } __RCSTAbits_t;
1845 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
1847 #define _RX9D 0x01
1848 #define _OERR 0x02
1849 #define _FERR 0x04
1850 #define _ADDEN 0x08
1851 #define _CREN 0x10
1852 #define _SREN 0x20
1853 #define _RX9 0x40
1854 #define _SPEN 0x80
1856 //==============================================================================
1859 //==============================================================================
1860 // TXSTA Bits
1862 extern __at(0x019E) __sfr TXSTA;
1864 typedef struct
1866 unsigned TX9D : 1;
1867 unsigned TRMT : 1;
1868 unsigned BRGH : 1;
1869 unsigned SENDB : 1;
1870 unsigned SYNC : 1;
1871 unsigned TXEN : 1;
1872 unsigned TX9 : 1;
1873 unsigned CSRC : 1;
1874 } __TXSTAbits_t;
1876 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
1878 #define _TX9D 0x01
1879 #define _TRMT 0x02
1880 #define _BRGH 0x04
1881 #define _SENDB 0x08
1882 #define _SYNC 0x10
1883 #define _TXEN 0x20
1884 #define _TX9 0x40
1885 #define _CSRC 0x80
1887 //==============================================================================
1890 //==============================================================================
1891 // BAUDCON Bits
1893 extern __at(0x019F) __sfr BAUDCON;
1895 typedef struct
1897 unsigned ABDEN : 1;
1898 unsigned WUE : 1;
1899 unsigned : 1;
1900 unsigned BRG16 : 1;
1901 unsigned SCKP : 1;
1902 unsigned : 1;
1903 unsigned RCIDL : 1;
1904 unsigned ABDOVF : 1;
1905 } __BAUDCONbits_t;
1907 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
1909 #define _ABDEN 0x01
1910 #define _WUE 0x02
1911 #define _BRG16 0x08
1912 #define _SCKP 0x10
1913 #define _RCIDL 0x40
1914 #define _ABDOVF 0x80
1916 //==============================================================================
1919 //==============================================================================
1920 // WPUA Bits
1922 extern __at(0x020C) __sfr WPUA;
1924 typedef union
1926 struct
1928 unsigned WPUA0 : 1;
1929 unsigned WPUA1 : 1;
1930 unsigned WPUA2 : 1;
1931 unsigned WPUA3 : 1;
1932 unsigned WPUA4 : 1;
1933 unsigned WPUA5 : 1;
1934 unsigned : 1;
1935 unsigned : 1;
1938 struct
1940 unsigned WPUA : 6;
1941 unsigned : 2;
1943 } __WPUAbits_t;
1945 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
1947 #define _WPUA0 0x01
1948 #define _WPUA1 0x02
1949 #define _WPUA2 0x04
1950 #define _WPUA3 0x08
1951 #define _WPUA4 0x10
1952 #define _WPUA5 0x20
1954 //==============================================================================
1957 //==============================================================================
1958 // WPUC Bits
1960 extern __at(0x020E) __sfr WPUC;
1962 typedef union
1964 struct
1966 unsigned WPUC0 : 1;
1967 unsigned WPUC1 : 1;
1968 unsigned WPUC2 : 1;
1969 unsigned WPUC3 : 1;
1970 unsigned WPUC4 : 1;
1971 unsigned WPUC5 : 1;
1972 unsigned : 1;
1973 unsigned : 1;
1976 struct
1978 unsigned WPUC : 6;
1979 unsigned : 2;
1981 } __WPUCbits_t;
1983 extern __at(0x020E) volatile __WPUCbits_t WPUCbits;
1985 #define _WPUC0 0x01
1986 #define _WPUC1 0x02
1987 #define _WPUC2 0x04
1988 #define _WPUC3 0x08
1989 #define _WPUC4 0x10
1990 #define _WPUC5 0x20
1992 //==============================================================================
1994 extern __at(0x0211) __sfr SSP1BUF;
1995 extern __at(0x0211) __sfr SSPBUF;
1996 extern __at(0x0212) __sfr SSP1ADD;
1997 extern __at(0x0212) __sfr SSPADD;
1998 extern __at(0x0213) __sfr SSP1MSK;
1999 extern __at(0x0213) __sfr SSPMSK;
2001 //==============================================================================
2002 // SSP1STAT Bits
2004 extern __at(0x0214) __sfr SSP1STAT;
2006 typedef struct
2008 unsigned BF : 1;
2009 unsigned UA : 1;
2010 unsigned R_NOT_W : 1;
2011 unsigned S : 1;
2012 unsigned P : 1;
2013 unsigned D_NOT_A : 1;
2014 unsigned CKE : 1;
2015 unsigned SMP : 1;
2016 } __SSP1STATbits_t;
2018 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
2020 #define _BF 0x01
2021 #define _UA 0x02
2022 #define _R_NOT_W 0x04
2023 #define _S 0x08
2024 #define _P 0x10
2025 #define _D_NOT_A 0x20
2026 #define _CKE 0x40
2027 #define _SMP 0x80
2029 //==============================================================================
2032 //==============================================================================
2033 // SSPSTAT Bits
2035 extern __at(0x0214) __sfr SSPSTAT;
2037 typedef struct
2039 unsigned BF : 1;
2040 unsigned UA : 1;
2041 unsigned R_NOT_W : 1;
2042 unsigned S : 1;
2043 unsigned P : 1;
2044 unsigned D_NOT_A : 1;
2045 unsigned CKE : 1;
2046 unsigned SMP : 1;
2047 } __SSPSTATbits_t;
2049 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
2051 #define _SSPSTAT_BF 0x01
2052 #define _SSPSTAT_UA 0x02
2053 #define _SSPSTAT_R_NOT_W 0x04
2054 #define _SSPSTAT_S 0x08
2055 #define _SSPSTAT_P 0x10
2056 #define _SSPSTAT_D_NOT_A 0x20
2057 #define _SSPSTAT_CKE 0x40
2058 #define _SSPSTAT_SMP 0x80
2060 //==============================================================================
2063 //==============================================================================
2064 // SSP1CON1 Bits
2066 extern __at(0x0215) __sfr SSP1CON1;
2068 typedef union
2070 struct
2072 unsigned SSPM0 : 1;
2073 unsigned SSPM1 : 1;
2074 unsigned SSPM2 : 1;
2075 unsigned SSPM3 : 1;
2076 unsigned CKP : 1;
2077 unsigned SSPEN : 1;
2078 unsigned SSPOV : 1;
2079 unsigned WCOL : 1;
2082 struct
2084 unsigned SSPM : 4;
2085 unsigned : 4;
2087 } __SSP1CON1bits_t;
2089 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
2091 #define _SSPM0 0x01
2092 #define _SSPM1 0x02
2093 #define _SSPM2 0x04
2094 #define _SSPM3 0x08
2095 #define _CKP 0x10
2096 #define _SSPEN 0x20
2097 #define _SSPOV 0x40
2098 #define _WCOL 0x80
2100 //==============================================================================
2103 //==============================================================================
2104 // SSPCON Bits
2106 extern __at(0x0215) __sfr SSPCON;
2108 typedef union
2110 struct
2112 unsigned SSPM0 : 1;
2113 unsigned SSPM1 : 1;
2114 unsigned SSPM2 : 1;
2115 unsigned SSPM3 : 1;
2116 unsigned CKP : 1;
2117 unsigned SSPEN : 1;
2118 unsigned SSPOV : 1;
2119 unsigned WCOL : 1;
2122 struct
2124 unsigned SSPM : 4;
2125 unsigned : 4;
2127 } __SSPCONbits_t;
2129 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
2131 #define _SSPCON_SSPM0 0x01
2132 #define _SSPCON_SSPM1 0x02
2133 #define _SSPCON_SSPM2 0x04
2134 #define _SSPCON_SSPM3 0x08
2135 #define _SSPCON_CKP 0x10
2136 #define _SSPCON_SSPEN 0x20
2137 #define _SSPCON_SSPOV 0x40
2138 #define _SSPCON_WCOL 0x80
2140 //==============================================================================
2143 //==============================================================================
2144 // SSPCON1 Bits
2146 extern __at(0x0215) __sfr SSPCON1;
2148 typedef union
2150 struct
2152 unsigned SSPM0 : 1;
2153 unsigned SSPM1 : 1;
2154 unsigned SSPM2 : 1;
2155 unsigned SSPM3 : 1;
2156 unsigned CKP : 1;
2157 unsigned SSPEN : 1;
2158 unsigned SSPOV : 1;
2159 unsigned WCOL : 1;
2162 struct
2164 unsigned SSPM : 4;
2165 unsigned : 4;
2167 } __SSPCON1bits_t;
2169 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
2171 #define _SSPCON1_SSPM0 0x01
2172 #define _SSPCON1_SSPM1 0x02
2173 #define _SSPCON1_SSPM2 0x04
2174 #define _SSPCON1_SSPM3 0x08
2175 #define _SSPCON1_CKP 0x10
2176 #define _SSPCON1_SSPEN 0x20
2177 #define _SSPCON1_SSPOV 0x40
2178 #define _SSPCON1_WCOL 0x80
2180 //==============================================================================
2183 //==============================================================================
2184 // SSP1CON2 Bits
2186 extern __at(0x0216) __sfr SSP1CON2;
2188 typedef struct
2190 unsigned SEN : 1;
2191 unsigned RSEN : 1;
2192 unsigned PEN : 1;
2193 unsigned RCEN : 1;
2194 unsigned ACKEN : 1;
2195 unsigned ACKDT : 1;
2196 unsigned ACKSTAT : 1;
2197 unsigned GCEN : 1;
2198 } __SSP1CON2bits_t;
2200 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
2202 #define _SEN 0x01
2203 #define _RSEN 0x02
2204 #define _PEN 0x04
2205 #define _RCEN 0x08
2206 #define _ACKEN 0x10
2207 #define _ACKDT 0x20
2208 #define _ACKSTAT 0x40
2209 #define _GCEN 0x80
2211 //==============================================================================
2214 //==============================================================================
2215 // SSPCON2 Bits
2217 extern __at(0x0216) __sfr SSPCON2;
2219 typedef struct
2221 unsigned SEN : 1;
2222 unsigned RSEN : 1;
2223 unsigned PEN : 1;
2224 unsigned RCEN : 1;
2225 unsigned ACKEN : 1;
2226 unsigned ACKDT : 1;
2227 unsigned ACKSTAT : 1;
2228 unsigned GCEN : 1;
2229 } __SSPCON2bits_t;
2231 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
2233 #define _SSPCON2_SEN 0x01
2234 #define _SSPCON2_RSEN 0x02
2235 #define _SSPCON2_PEN 0x04
2236 #define _SSPCON2_RCEN 0x08
2237 #define _SSPCON2_ACKEN 0x10
2238 #define _SSPCON2_ACKDT 0x20
2239 #define _SSPCON2_ACKSTAT 0x40
2240 #define _SSPCON2_GCEN 0x80
2242 //==============================================================================
2245 //==============================================================================
2246 // SSP1CON3 Bits
2248 extern __at(0x0217) __sfr SSP1CON3;
2250 typedef struct
2252 unsigned DHEN : 1;
2253 unsigned AHEN : 1;
2254 unsigned SBCDE : 1;
2255 unsigned SDAHT : 1;
2256 unsigned BOEN : 1;
2257 unsigned SCIE : 1;
2258 unsigned PCIE : 1;
2259 unsigned ACKTIM : 1;
2260 } __SSP1CON3bits_t;
2262 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
2264 #define _DHEN 0x01
2265 #define _AHEN 0x02
2266 #define _SBCDE 0x04
2267 #define _SDAHT 0x08
2268 #define _BOEN 0x10
2269 #define _SCIE 0x20
2270 #define _PCIE 0x40
2271 #define _ACKTIM 0x80
2273 //==============================================================================
2276 //==============================================================================
2277 // SSPCON3 Bits
2279 extern __at(0x0217) __sfr SSPCON3;
2281 typedef struct
2283 unsigned DHEN : 1;
2284 unsigned AHEN : 1;
2285 unsigned SBCDE : 1;
2286 unsigned SDAHT : 1;
2287 unsigned BOEN : 1;
2288 unsigned SCIE : 1;
2289 unsigned PCIE : 1;
2290 unsigned ACKTIM : 1;
2291 } __SSPCON3bits_t;
2293 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
2295 #define _SSPCON3_DHEN 0x01
2296 #define _SSPCON3_AHEN 0x02
2297 #define _SSPCON3_SBCDE 0x04
2298 #define _SSPCON3_SDAHT 0x08
2299 #define _SSPCON3_BOEN 0x10
2300 #define _SSPCON3_SCIE 0x20
2301 #define _SSPCON3_PCIE 0x40
2302 #define _SSPCON3_ACKTIM 0x80
2304 //==============================================================================
2306 extern __at(0x0291) __sfr CCPR1;
2307 extern __at(0x0291) __sfr CCPR1L;
2308 extern __at(0x0292) __sfr CCPR1H;
2310 //==============================================================================
2311 // CCP1CON Bits
2313 extern __at(0x0293) __sfr CCP1CON;
2315 typedef union
2317 struct
2319 unsigned CCP1M0 : 1;
2320 unsigned CCP1M1 : 1;
2321 unsigned CCP1M2 : 1;
2322 unsigned CCP1M3 : 1;
2323 unsigned DC1B0 : 1;
2324 unsigned DC1B1 : 1;
2325 unsigned P1M0 : 1;
2326 unsigned P1M1 : 1;
2329 struct
2331 unsigned CCP1M : 4;
2332 unsigned : 4;
2335 struct
2337 unsigned : 4;
2338 unsigned DC1B : 2;
2339 unsigned : 2;
2342 struct
2344 unsigned : 6;
2345 unsigned P1M : 2;
2347 } __CCP1CONbits_t;
2349 extern __at(0x0293) volatile __CCP1CONbits_t CCP1CONbits;
2351 #define _CCP1M0 0x01
2352 #define _CCP1M1 0x02
2353 #define _CCP1M2 0x04
2354 #define _CCP1M3 0x08
2355 #define _DC1B0 0x10
2356 #define _DC1B1 0x20
2357 #define _P1M0 0x40
2358 #define _P1M1 0x80
2360 //==============================================================================
2363 //==============================================================================
2364 // PWM1CON Bits
2366 extern __at(0x0294) __sfr PWM1CON;
2368 typedef union
2370 struct
2372 unsigned P1DC0 : 1;
2373 unsigned P1DC1 : 1;
2374 unsigned P1DC2 : 1;
2375 unsigned P1DC3 : 1;
2376 unsigned P1DC4 : 1;
2377 unsigned P1DC5 : 1;
2378 unsigned P1DC6 : 1;
2379 unsigned P1RSEN : 1;
2382 struct
2384 unsigned P1DC : 7;
2385 unsigned : 1;
2387 } __PWM1CONbits_t;
2389 extern __at(0x0294) volatile __PWM1CONbits_t PWM1CONbits;
2391 #define _P1DC0 0x01
2392 #define _P1DC1 0x02
2393 #define _P1DC2 0x04
2394 #define _P1DC3 0x08
2395 #define _P1DC4 0x10
2396 #define _P1DC5 0x20
2397 #define _P1DC6 0x40
2398 #define _P1RSEN 0x80
2400 //==============================================================================
2403 //==============================================================================
2404 // CCP1AS Bits
2406 extern __at(0x0295) __sfr CCP1AS;
2408 typedef union
2410 struct
2412 unsigned PSS1BD0 : 1;
2413 unsigned PSS1BD1 : 1;
2414 unsigned PSS1AC0 : 1;
2415 unsigned PSS1AC1 : 1;
2416 unsigned CCP1AS0 : 1;
2417 unsigned CCP1AS1 : 1;
2418 unsigned CCP1AS2 : 1;
2419 unsigned CCP1ASE : 1;
2422 struct
2424 unsigned PSS1BD : 2;
2425 unsigned : 6;
2428 struct
2430 unsigned : 2;
2431 unsigned PSS1AC : 2;
2432 unsigned : 4;
2435 struct
2437 unsigned : 4;
2438 unsigned CCP1AS : 3;
2439 unsigned : 1;
2441 } __CCP1ASbits_t;
2443 extern __at(0x0295) volatile __CCP1ASbits_t CCP1ASbits;
2445 #define _PSS1BD0 0x01
2446 #define _PSS1BD1 0x02
2447 #define _PSS1AC0 0x04
2448 #define _PSS1AC1 0x08
2449 #define _CCP1AS0 0x10
2450 #define _CCP1AS1 0x20
2451 #define _CCP1AS2 0x40
2452 #define _CCP1ASE 0x80
2454 //==============================================================================
2457 //==============================================================================
2458 // ECCP1AS Bits
2460 extern __at(0x0295) __sfr ECCP1AS;
2462 typedef union
2464 struct
2466 unsigned PSS1BD0 : 1;
2467 unsigned PSS1BD1 : 1;
2468 unsigned PSS1AC0 : 1;
2469 unsigned PSS1AC1 : 1;
2470 unsigned CCP1AS0 : 1;
2471 unsigned CCP1AS1 : 1;
2472 unsigned CCP1AS2 : 1;
2473 unsigned CCP1ASE : 1;
2476 struct
2478 unsigned PSS1BD : 2;
2479 unsigned : 6;
2482 struct
2484 unsigned : 2;
2485 unsigned PSS1AC : 2;
2486 unsigned : 4;
2489 struct
2491 unsigned : 4;
2492 unsigned CCP1AS : 3;
2493 unsigned : 1;
2495 } __ECCP1ASbits_t;
2497 extern __at(0x0295) volatile __ECCP1ASbits_t ECCP1ASbits;
2499 #define _ECCP1AS_PSS1BD0 0x01
2500 #define _ECCP1AS_PSS1BD1 0x02
2501 #define _ECCP1AS_PSS1AC0 0x04
2502 #define _ECCP1AS_PSS1AC1 0x08
2503 #define _ECCP1AS_CCP1AS0 0x10
2504 #define _ECCP1AS_CCP1AS1 0x20
2505 #define _ECCP1AS_CCP1AS2 0x40
2506 #define _ECCP1AS_CCP1ASE 0x80
2508 //==============================================================================
2511 //==============================================================================
2512 // PSTR1CON Bits
2514 extern __at(0x0296) __sfr PSTR1CON;
2516 typedef struct
2518 unsigned STR1A : 1;
2519 unsigned STR1B : 1;
2520 unsigned STR1C : 1;
2521 unsigned STR1D : 1;
2522 unsigned STR1SYNC : 1;
2523 unsigned : 1;
2524 unsigned : 1;
2525 unsigned : 1;
2526 } __PSTR1CONbits_t;
2528 extern __at(0x0296) volatile __PSTR1CONbits_t PSTR1CONbits;
2530 #define _STR1A 0x01
2531 #define _STR1B 0x02
2532 #define _STR1C 0x04
2533 #define _STR1D 0x08
2534 #define _STR1SYNC 0x10
2536 //==============================================================================
2538 extern __at(0x0298) __sfr CCPR2;
2539 extern __at(0x0298) __sfr CCPR2L;
2540 extern __at(0x0299) __sfr CCPR2H;
2542 //==============================================================================
2543 // CCP2CON Bits
2545 extern __at(0x029A) __sfr CCP2CON;
2547 typedef union
2549 struct
2551 unsigned CCP2M0 : 1;
2552 unsigned CCP2M1 : 1;
2553 unsigned CCP2M2 : 1;
2554 unsigned CCP2M3 : 1;
2555 unsigned DC2B0 : 1;
2556 unsigned DC2B1 : 1;
2557 unsigned P2M0 : 1;
2558 unsigned P2M1 : 1;
2561 struct
2563 unsigned CCP2M : 4;
2564 unsigned : 4;
2567 struct
2569 unsigned : 4;
2570 unsigned DC2B : 2;
2571 unsigned : 2;
2574 struct
2576 unsigned : 6;
2577 unsigned P2M : 2;
2579 } __CCP2CONbits_t;
2581 extern __at(0x029A) volatile __CCP2CONbits_t CCP2CONbits;
2583 #define _CCP2M0 0x01
2584 #define _CCP2M1 0x02
2585 #define _CCP2M2 0x04
2586 #define _CCP2M3 0x08
2587 #define _DC2B0 0x10
2588 #define _DC2B1 0x20
2589 #define _P2M0 0x40
2590 #define _P2M1 0x80
2592 //==============================================================================
2595 //==============================================================================
2596 // PWM2CON Bits
2598 extern __at(0x029B) __sfr PWM2CON;
2600 typedef union
2602 struct
2604 unsigned P2DC0 : 1;
2605 unsigned P2DC1 : 1;
2606 unsigned P2DC2 : 1;
2607 unsigned P2DC3 : 1;
2608 unsigned P2DC4 : 1;
2609 unsigned P2DC5 : 1;
2610 unsigned P2DC6 : 1;
2611 unsigned P2RSEN : 1;
2614 struct
2616 unsigned P2DC : 7;
2617 unsigned : 1;
2619 } __PWM2CONbits_t;
2621 extern __at(0x029B) volatile __PWM2CONbits_t PWM2CONbits;
2623 #define _P2DC0 0x01
2624 #define _P2DC1 0x02
2625 #define _P2DC2 0x04
2626 #define _P2DC3 0x08
2627 #define _P2DC4 0x10
2628 #define _P2DC5 0x20
2629 #define _P2DC6 0x40
2630 #define _P2RSEN 0x80
2632 //==============================================================================
2635 //==============================================================================
2636 // CCP2AS Bits
2638 extern __at(0x029C) __sfr CCP2AS;
2640 typedef union
2642 struct
2644 unsigned PSS2BD0 : 1;
2645 unsigned PSS2BD1 : 1;
2646 unsigned PSS2AC0 : 1;
2647 unsigned PSS2AC1 : 1;
2648 unsigned CCP2AS0 : 1;
2649 unsigned CCP2AS1 : 1;
2650 unsigned CCP2AS2 : 1;
2651 unsigned CCP2ASE : 1;
2654 struct
2656 unsigned PSS2BD : 2;
2657 unsigned : 6;
2660 struct
2662 unsigned : 2;
2663 unsigned PSS2AC : 2;
2664 unsigned : 4;
2667 struct
2669 unsigned : 4;
2670 unsigned CCP2AS : 3;
2671 unsigned : 1;
2673 } __CCP2ASbits_t;
2675 extern __at(0x029C) volatile __CCP2ASbits_t CCP2ASbits;
2677 #define _PSS2BD0 0x01
2678 #define _PSS2BD1 0x02
2679 #define _PSS2AC0 0x04
2680 #define _PSS2AC1 0x08
2681 #define _CCP2AS0 0x10
2682 #define _CCP2AS1 0x20
2683 #define _CCP2AS2 0x40
2684 #define _CCP2ASE 0x80
2686 //==============================================================================
2689 //==============================================================================
2690 // PSTR2CON Bits
2692 extern __at(0x029D) __sfr PSTR2CON;
2694 typedef struct
2696 unsigned STR2A : 1;
2697 unsigned STR2B : 1;
2698 unsigned STR2C : 1;
2699 unsigned STR2D : 1;
2700 unsigned STR2SYNC : 1;
2701 unsigned : 1;
2702 unsigned : 1;
2703 unsigned : 1;
2704 } __PSTR2CONbits_t;
2706 extern __at(0x029D) volatile __PSTR2CONbits_t PSTR2CONbits;
2708 #define _STR2A 0x01
2709 #define _STR2B 0x02
2710 #define _STR2C 0x04
2711 #define _STR2D 0x08
2712 #define _STR2SYNC 0x10
2714 //==============================================================================
2717 //==============================================================================
2718 // CCPTMRS Bits
2720 extern __at(0x029E) __sfr CCPTMRS;
2722 typedef union
2724 struct
2726 unsigned C1TSEL0 : 1;
2727 unsigned C1TSEL1 : 1;
2728 unsigned C2TSEL0 : 1;
2729 unsigned C2TSEL1 : 1;
2730 unsigned C3TSEL0 : 1;
2731 unsigned C3TSEL1 : 1;
2732 unsigned C4TSEL0 : 1;
2733 unsigned C4TSEL1 : 1;
2736 struct
2738 unsigned C1TSEL : 2;
2739 unsigned : 6;
2742 struct
2744 unsigned : 2;
2745 unsigned C2TSEL : 2;
2746 unsigned : 4;
2749 struct
2751 unsigned : 4;
2752 unsigned C3TSEL : 2;
2753 unsigned : 2;
2756 struct
2758 unsigned : 6;
2759 unsigned C4TSEL : 2;
2761 } __CCPTMRSbits_t;
2763 extern __at(0x029E) volatile __CCPTMRSbits_t CCPTMRSbits;
2765 #define _C1TSEL0 0x01
2766 #define _C1TSEL1 0x02
2767 #define _C2TSEL0 0x04
2768 #define _C2TSEL1 0x08
2769 #define _C3TSEL0 0x10
2770 #define _C3TSEL1 0x20
2771 #define _C4TSEL0 0x40
2772 #define _C4TSEL1 0x80
2774 //==============================================================================
2776 extern __at(0x0311) __sfr CCPR3;
2777 extern __at(0x0311) __sfr CCPR3L;
2778 extern __at(0x0312) __sfr CCPR3H;
2780 //==============================================================================
2781 // CCP3CON Bits
2783 extern __at(0x0313) __sfr CCP3CON;
2785 typedef union
2787 struct
2789 unsigned CCP3M0 : 1;
2790 unsigned CCP3M1 : 1;
2791 unsigned CCP3M2 : 1;
2792 unsigned CCP3M3 : 1;
2793 unsigned DC3B0 : 1;
2794 unsigned DC3B1 : 1;
2795 unsigned : 1;
2796 unsigned : 1;
2799 struct
2801 unsigned CCP3M : 4;
2802 unsigned : 4;
2805 struct
2807 unsigned : 4;
2808 unsigned DC3B : 2;
2809 unsigned : 2;
2811 } __CCP3CONbits_t;
2813 extern __at(0x0313) volatile __CCP3CONbits_t CCP3CONbits;
2815 #define _CCP3M0 0x01
2816 #define _CCP3M1 0x02
2817 #define _CCP3M2 0x04
2818 #define _CCP3M3 0x08
2819 #define _DC3B0 0x10
2820 #define _DC3B1 0x20
2822 //==============================================================================
2824 extern __at(0x0318) __sfr CCPR4;
2825 extern __at(0x0318) __sfr CCPR4L;
2826 extern __at(0x0319) __sfr CCPR4H;
2828 //==============================================================================
2829 // CCP4CON Bits
2831 extern __at(0x031A) __sfr CCP4CON;
2833 typedef union
2835 struct
2837 unsigned CCP4M0 : 1;
2838 unsigned CCP4M1 : 1;
2839 unsigned CCP4M2 : 1;
2840 unsigned CCP4M3 : 1;
2841 unsigned DC4B0 : 1;
2842 unsigned DC4B1 : 1;
2843 unsigned : 1;
2844 unsigned : 1;
2847 struct
2849 unsigned CCP4M : 4;
2850 unsigned : 4;
2853 struct
2855 unsigned : 4;
2856 unsigned DC4B : 2;
2857 unsigned : 2;
2859 } __CCP4CONbits_t;
2861 extern __at(0x031A) volatile __CCP4CONbits_t CCP4CONbits;
2863 #define _CCP4M0 0x01
2864 #define _CCP4M1 0x02
2865 #define _CCP4M2 0x04
2866 #define _CCP4M3 0x08
2867 #define _DC4B0 0x10
2868 #define _DC4B1 0x20
2870 //==============================================================================
2873 //==============================================================================
2874 // INLVLA Bits
2876 extern __at(0x038C) __sfr INLVLA;
2878 typedef union
2880 struct
2882 unsigned INLVLA0 : 1;
2883 unsigned INLVLA1 : 1;
2884 unsigned INLVLA2 : 1;
2885 unsigned INLVLA3 : 1;
2886 unsigned INLVLA4 : 1;
2887 unsigned INLVLA5 : 1;
2888 unsigned : 1;
2889 unsigned : 1;
2892 struct
2894 unsigned INLVLA : 6;
2895 unsigned : 2;
2897 } __INLVLAbits_t;
2899 extern __at(0x038C) volatile __INLVLAbits_t INLVLAbits;
2901 #define _INLVLA0 0x01
2902 #define _INLVLA1 0x02
2903 #define _INLVLA2 0x04
2904 #define _INLVLA3 0x08
2905 #define _INLVLA4 0x10
2906 #define _INLVLA5 0x20
2908 //==============================================================================
2911 //==============================================================================
2912 // INLVLC Bits
2914 extern __at(0x038E) __sfr INLVLC;
2916 typedef union
2918 struct
2920 unsigned INLVLC0 : 1;
2921 unsigned INLVLC1 : 1;
2922 unsigned INLVLC2 : 1;
2923 unsigned INLVLC3 : 1;
2924 unsigned INLVLC4 : 1;
2925 unsigned INLVLC5 : 1;
2926 unsigned : 1;
2927 unsigned : 1;
2930 struct
2932 unsigned INLVLC : 6;
2933 unsigned : 2;
2935 } __INLVLCbits_t;
2937 extern __at(0x038E) volatile __INLVLCbits_t INLVLCbits;
2939 #define _INLVLC0 0x01
2940 #define _INLVLC1 0x02
2941 #define _INLVLC2 0x04
2942 #define _INLVLC3 0x08
2943 #define _INLVLC4 0x10
2944 #define _INLVLC5 0x20
2946 //==============================================================================
2949 //==============================================================================
2950 // IOCAP Bits
2952 extern __at(0x0391) __sfr IOCAP;
2954 typedef union
2956 struct
2958 unsigned IOCAP0 : 1;
2959 unsigned IOCAP1 : 1;
2960 unsigned IOCAP2 : 1;
2961 unsigned IOCAP3 : 1;
2962 unsigned IOCAP4 : 1;
2963 unsigned IOCAP5 : 1;
2964 unsigned : 1;
2965 unsigned : 1;
2968 struct
2970 unsigned IOCAP : 6;
2971 unsigned : 2;
2973 } __IOCAPbits_t;
2975 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits;
2977 #define _IOCAP0 0x01
2978 #define _IOCAP1 0x02
2979 #define _IOCAP2 0x04
2980 #define _IOCAP3 0x08
2981 #define _IOCAP4 0x10
2982 #define _IOCAP5 0x20
2984 //==============================================================================
2987 //==============================================================================
2988 // IOCAN Bits
2990 extern __at(0x0392) __sfr IOCAN;
2992 typedef union
2994 struct
2996 unsigned IOCAN0 : 1;
2997 unsigned IOCAN1 : 1;
2998 unsigned IOCAN2 : 1;
2999 unsigned IOCAN3 : 1;
3000 unsigned IOCAN4 : 1;
3001 unsigned IOCAN5 : 1;
3002 unsigned : 1;
3003 unsigned : 1;
3006 struct
3008 unsigned IOCAN : 6;
3009 unsigned : 2;
3011 } __IOCANbits_t;
3013 extern __at(0x0392) volatile __IOCANbits_t IOCANbits;
3015 #define _IOCAN0 0x01
3016 #define _IOCAN1 0x02
3017 #define _IOCAN2 0x04
3018 #define _IOCAN3 0x08
3019 #define _IOCAN4 0x10
3020 #define _IOCAN5 0x20
3022 //==============================================================================
3025 //==============================================================================
3026 // IOCAF Bits
3028 extern __at(0x0393) __sfr IOCAF;
3030 typedef union
3032 struct
3034 unsigned IOCAF0 : 1;
3035 unsigned IOCAF1 : 1;
3036 unsigned IOCAF2 : 1;
3037 unsigned IOCAF3 : 1;
3038 unsigned IOCAF4 : 1;
3039 unsigned IOCAF5 : 1;
3040 unsigned : 1;
3041 unsigned : 1;
3044 struct
3046 unsigned IOCAF : 6;
3047 unsigned : 2;
3049 } __IOCAFbits_t;
3051 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits;
3053 #define _IOCAF0 0x01
3054 #define _IOCAF1 0x02
3055 #define _IOCAF2 0x04
3056 #define _IOCAF3 0x08
3057 #define _IOCAF4 0x10
3058 #define _IOCAF5 0x20
3060 //==============================================================================
3063 //==============================================================================
3064 // CLKRCON Bits
3066 extern __at(0x039A) __sfr CLKRCON;
3068 typedef union
3070 struct
3072 unsigned CLKRDIV0 : 1;
3073 unsigned CLKRDIV1 : 1;
3074 unsigned CLKRDIV2 : 1;
3075 unsigned CLKRDC0 : 1;
3076 unsigned CLKRDC1 : 1;
3077 unsigned CLKRSLR : 1;
3078 unsigned CLKROE : 1;
3079 unsigned CLKREN : 1;
3082 struct
3084 unsigned CLKRDIV : 3;
3085 unsigned : 5;
3088 struct
3090 unsigned : 3;
3091 unsigned CLKRDC : 2;
3092 unsigned : 3;
3094 } __CLKRCONbits_t;
3096 extern __at(0x039A) volatile __CLKRCONbits_t CLKRCONbits;
3098 #define _CLKRDIV0 0x01
3099 #define _CLKRDIV1 0x02
3100 #define _CLKRDIV2 0x04
3101 #define _CLKRDC0 0x08
3102 #define _CLKRDC1 0x10
3103 #define _CLKRSLR 0x20
3104 #define _CLKROE 0x40
3105 #define _CLKREN 0x80
3107 //==============================================================================
3110 //==============================================================================
3111 // MDCON Bits
3113 extern __at(0x039C) __sfr MDCON;
3115 typedef struct
3117 unsigned MDBIT : 1;
3118 unsigned : 1;
3119 unsigned : 1;
3120 unsigned MDOUT : 1;
3121 unsigned MDOPOL : 1;
3122 unsigned MDSLR : 1;
3123 unsigned MDOE : 1;
3124 unsigned MDEN : 1;
3125 } __MDCONbits_t;
3127 extern __at(0x039C) volatile __MDCONbits_t MDCONbits;
3129 #define _MDBIT 0x01
3130 #define _MDOUT 0x08
3131 #define _MDOPOL 0x10
3132 #define _MDSLR 0x20
3133 #define _MDOE 0x40
3134 #define _MDEN 0x80
3136 //==============================================================================
3139 //==============================================================================
3140 // MDSRC Bits
3142 extern __at(0x039D) __sfr MDSRC;
3144 typedef union
3146 struct
3148 unsigned MDMS0 : 1;
3149 unsigned MDMS1 : 1;
3150 unsigned MDMS2 : 1;
3151 unsigned MDMS3 : 1;
3152 unsigned : 1;
3153 unsigned : 1;
3154 unsigned : 1;
3155 unsigned MDMSODIS : 1;
3158 struct
3160 unsigned MDMS : 4;
3161 unsigned : 4;
3163 } __MDSRCbits_t;
3165 extern __at(0x039D) volatile __MDSRCbits_t MDSRCbits;
3167 #define _MDMS0 0x01
3168 #define _MDMS1 0x02
3169 #define _MDMS2 0x04
3170 #define _MDMS3 0x08
3171 #define _MDMSODIS 0x80
3173 //==============================================================================
3176 //==============================================================================
3177 // MDCARL Bits
3179 extern __at(0x039E) __sfr MDCARL;
3181 typedef union
3183 struct
3185 unsigned MDCL0 : 1;
3186 unsigned MDCL1 : 1;
3187 unsigned MDCL2 : 1;
3188 unsigned MDCL3 : 1;
3189 unsigned : 1;
3190 unsigned MDCLSYNC : 1;
3191 unsigned MDCLPOL : 1;
3192 unsigned MDCLODIS : 1;
3195 struct
3197 unsigned MDCL : 4;
3198 unsigned : 4;
3200 } __MDCARLbits_t;
3202 extern __at(0x039E) volatile __MDCARLbits_t MDCARLbits;
3204 #define _MDCL0 0x01
3205 #define _MDCL1 0x02
3206 #define _MDCL2 0x04
3207 #define _MDCL3 0x08
3208 #define _MDCLSYNC 0x20
3209 #define _MDCLPOL 0x40
3210 #define _MDCLODIS 0x80
3212 //==============================================================================
3215 //==============================================================================
3216 // MDCARH Bits
3218 extern __at(0x039F) __sfr MDCARH;
3220 typedef union
3222 struct
3224 unsigned MDCH0 : 1;
3225 unsigned MDCH1 : 1;
3226 unsigned MDCH2 : 1;
3227 unsigned MDCH3 : 1;
3228 unsigned : 1;
3229 unsigned MDCHSYNC : 1;
3230 unsigned MDCHPOL : 1;
3231 unsigned MDCHODIS : 1;
3234 struct
3236 unsigned MDCH : 4;
3237 unsigned : 4;
3239 } __MDCARHbits_t;
3241 extern __at(0x039F) volatile __MDCARHbits_t MDCARHbits;
3243 #define _MDCH0 0x01
3244 #define _MDCH1 0x02
3245 #define _MDCH2 0x04
3246 #define _MDCH3 0x08
3247 #define _MDCHSYNC 0x20
3248 #define _MDCHPOL 0x40
3249 #define _MDCHODIS 0x80
3251 //==============================================================================
3253 extern __at(0x0415) __sfr TMR4;
3254 extern __at(0x0416) __sfr PR4;
3256 //==============================================================================
3257 // T4CON Bits
3259 extern __at(0x0417) __sfr T4CON;
3261 typedef union
3263 struct
3265 unsigned T4CKPS0 : 1;
3266 unsigned T4CKPS1 : 1;
3267 unsigned TMR4ON : 1;
3268 unsigned T4OUTPS0 : 1;
3269 unsigned T4OUTPS1 : 1;
3270 unsigned T4OUTPS2 : 1;
3271 unsigned T4OUTPS3 : 1;
3272 unsigned : 1;
3275 struct
3277 unsigned T4CKPS : 2;
3278 unsigned : 6;
3281 struct
3283 unsigned : 3;
3284 unsigned T4OUTPS : 4;
3285 unsigned : 1;
3287 } __T4CONbits_t;
3289 extern __at(0x0417) volatile __T4CONbits_t T4CONbits;
3291 #define _T4CKPS0 0x01
3292 #define _T4CKPS1 0x02
3293 #define _TMR4ON 0x04
3294 #define _T4OUTPS0 0x08
3295 #define _T4OUTPS1 0x10
3296 #define _T4OUTPS2 0x20
3297 #define _T4OUTPS3 0x40
3299 //==============================================================================
3301 extern __at(0x041C) __sfr TMR6;
3302 extern __at(0x041D) __sfr PR6;
3304 //==============================================================================
3305 // T6CON Bits
3307 extern __at(0x041E) __sfr T6CON;
3309 typedef union
3311 struct
3313 unsigned T6CKPS0 : 1;
3314 unsigned T6CKPS1 : 1;
3315 unsigned TMR6ON : 1;
3316 unsigned T6OUTPS0 : 1;
3317 unsigned T6OUTPS1 : 1;
3318 unsigned T6OUTPS2 : 1;
3319 unsigned T6OUTPS3 : 1;
3320 unsigned : 1;
3323 struct
3325 unsigned T6CKPS : 2;
3326 unsigned : 6;
3329 struct
3331 unsigned : 3;
3332 unsigned T6OUTPS : 4;
3333 unsigned : 1;
3335 } __T6CONbits_t;
3337 extern __at(0x041E) volatile __T6CONbits_t T6CONbits;
3339 #define _T6CKPS0 0x01
3340 #define _T6CKPS1 0x02
3341 #define _TMR6ON 0x04
3342 #define _T6OUTPS0 0x08
3343 #define _T6OUTPS1 0x10
3344 #define _T6OUTPS2 0x20
3345 #define _T6OUTPS3 0x40
3347 //==============================================================================
3350 //==============================================================================
3351 // STATUS_SHAD Bits
3353 extern __at(0x0FE4) __sfr STATUS_SHAD;
3355 typedef struct
3357 unsigned C_SHAD : 1;
3358 unsigned DC_SHAD : 1;
3359 unsigned Z_SHAD : 1;
3360 unsigned : 1;
3361 unsigned : 1;
3362 unsigned : 1;
3363 unsigned : 1;
3364 unsigned : 1;
3365 } __STATUS_SHADbits_t;
3367 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
3369 #define _C_SHAD 0x01
3370 #define _DC_SHAD 0x02
3371 #define _Z_SHAD 0x04
3373 //==============================================================================
3375 extern __at(0x0FE5) __sfr WREG_SHAD;
3376 extern __at(0x0FE6) __sfr BSR_SHAD;
3377 extern __at(0x0FE7) __sfr PCLATH_SHAD;
3378 extern __at(0x0FE8) __sfr FSR0L_SHAD;
3379 extern __at(0x0FE9) __sfr FSR0H_SHAD;
3380 extern __at(0x0FEA) __sfr FSR1L_SHAD;
3381 extern __at(0x0FEB) __sfr FSR1H_SHAD;
3382 extern __at(0x0FED) __sfr STKPTR;
3383 extern __at(0x0FEE) __sfr TOSL;
3384 extern __at(0x0FEF) __sfr TOSH;
3386 //==============================================================================
3388 // Configuration Bits
3390 //==============================================================================
3392 #define _CONFIG1 0x8007
3393 #define _CONFIG2 0x8008
3395 //----------------------------- CONFIG1 Options -------------------------------
3397 #define _FOSC_LP 0x3FF8 // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins.
3398 #define _FOSC_XT 0x3FF9 // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins.
3399 #define _FOSC_HS 0x3FFA // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins.
3400 #define _FOSC_EXTRC 0x3FFB // EXTRC oscillator: External RC circuit connected to CLKIN pin.
3401 #define _FOSC_INTOSC 0x3FFC // INTOSC oscillator: I/O function on CLKIN pin.
3402 #define _FOSC_ECL 0x3FFD // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin.
3403 #define _FOSC_ECM 0x3FFE // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin.
3404 #define _FOSC_ECH 0x3FFF // ECH, External Clock, High Power Mode (4-32 MHz): device clock supplied to CLKIN pin.
3405 #define _WDTE_OFF 0x3FE7 // WDT disabled.
3406 #define _WDTE_SWDTEN 0x3FEF // WDT controlled by the SWDTEN bit in the WDTCON register.
3407 #define _WDTE_NSLEEP 0x3FF7 // WDT enabled while running and disabled in Sleep.
3408 #define _WDTE_ON 0x3FFF // WDT enabled.
3409 #define _PWRTE_ON 0x3FDF // PWRT enabled.
3410 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
3411 #define _MCLRE_OFF 0x3FBF // MCLR/VPP pin function is digital input.
3412 #define _MCLRE_ON 0x3FFF // MCLR/VPP pin function is MCLR.
3413 #define _CP_ON 0x3F7F // Program memory code protection is enabled.
3414 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
3415 #define _CPD_ON 0x3EFF // Data memory code protection is enabled.
3416 #define _CPD_OFF 0x3FFF // Data memory code protection is disabled.
3417 #define _BOREN_OFF 0x39FF // Brown-out Reset disabled.
3418 #define _BOREN_SBODEN 0x3BFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
3419 #define _BOREN_NSLEEP 0x3DFF // Brown-out Reset enabled while running and disabled in Sleep.
3420 #define _BOREN_ON 0x3FFF // Brown-out Reset enabled.
3421 #define _CLKOUTEN_ON 0x37FF // CLKOUT function is enabled on the CLKOUT pin.
3422 #define _CLKOUTEN_OFF 0x3FFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
3423 #define _IESO_OFF 0x2FFF // Internal/External Switchover mode is disabled.
3424 #define _IESO_ON 0x3FFF // Internal/External Switchover mode is enabled.
3425 #define _FCMEN_OFF 0x1FFF // Fail-Safe Clock Monitor is disabled.
3426 #define _FCMEN_ON 0x3FFF // Fail-Safe Clock Monitor is enabled.
3428 //----------------------------- CONFIG2 Options -------------------------------
3430 #define _WRT_ALL 0x3FFC // 000h to 1FFFh write protected, no addresses may be modified by EECON control.
3431 #define _WRT_HALF 0x3FFD // 000h to FFFh write protected, 1000h to 1FFFh may be modified by EECON control.
3432 #define _WRT_BOOT 0x3FFE // 000h to 1FFh write protected, 200h to 1FFFh may be modified by EECON control.
3433 #define _WRT_OFF 0x3FFF // Write protection off.
3434 #define _PLLEN_OFF 0x3EFF // 4x PLL disabled.
3435 #define _PLLEN_ON 0x3FFF // 4x PLL enabled.
3436 #define _STVREN_OFF 0x3DFF // Stack Overflow or Underflow will not cause a Reset.
3437 #define _STVREN_ON 0x3FFF // Stack Overflow or Underflow will cause a Reset.
3438 #define _BORV_HI 0x3BFF // Brown-out Reset Voltage (Vbor), high trip point selected.
3439 #define _BORV_LO 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
3440 #define _BORV_19 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
3441 #define _DEBUG_ON 0x2FFF // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
3442 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
3443 #define _LVP_OFF 0x1FFF // High-voltage on MCLR/VPP must be used for programming.
3444 #define _LVP_ON 0x3FFF // Low-voltage programming enabled.
3446 //==============================================================================
3448 #define _DEVID1 0x8006
3450 #define _IDLOC0 0x8000
3451 #define _IDLOC1 0x8001
3452 #define _IDLOC2 0x8002
3453 #define _IDLOC3 0x8003
3455 //==============================================================================
3457 #ifndef NO_BIT_DEFINES
3459 #define ADON ADCON0bits.ADON // bit 0
3460 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
3461 #define ADGO ADCON0bits.ADGO // bit 1, shadows bit in ADCON0bits
3462 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
3463 #define CHS0 ADCON0bits.CHS0 // bit 2
3464 #define CHS1 ADCON0bits.CHS1 // bit 3
3465 #define CHS2 ADCON0bits.CHS2 // bit 4
3466 #define CHS3 ADCON0bits.CHS3 // bit 5
3467 #define CHS4 ADCON0bits.CHS4 // bit 6
3469 #define ADPREF0 ADCON1bits.ADPREF0 // bit 0
3470 #define ADPREF1 ADCON1bits.ADPREF1 // bit 1
3471 #define ADNREF ADCON1bits.ADNREF // bit 2
3472 #define ADCS0 ADCON1bits.ADCS0 // bit 4
3473 #define ADCS1 ADCON1bits.ADCS1 // bit 5
3474 #define ADCS2 ADCON1bits.ADCS2 // bit 6
3475 #define ADFM ADCON1bits.ADFM // bit 7
3477 #define ANSA0 ANSELAbits.ANSA0 // bit 0
3478 #define ANSA1 ANSELAbits.ANSA1 // bit 1
3479 #define ANSA2 ANSELAbits.ANSA2 // bit 2
3480 #define ANSA4 ANSELAbits.ANSA4 // bit 4
3482 #define ANSC0 ANSELCbits.ANSC0 // bit 0
3483 #define ANSC1 ANSELCbits.ANSC1 // bit 1
3484 #define ANSC2 ANSELCbits.ANSC2 // bit 2
3485 #define ANSC3 ANSELCbits.ANSC3 // bit 3
3487 #define TXCKSEL APFCON0bits.TXCKSEL // bit 2
3488 #define T1GSEL APFCON0bits.T1GSEL // bit 3
3489 #define SSSEL APFCON0bits.SSSEL // bit 5
3490 #define SDOSEL APFCON0bits.SDOSEL // bit 6
3491 #define RXDTSEL APFCON0bits.RXDTSEL // bit 7
3493 #define CCP2SEL APFCON1bits.CCP2SEL // bit 0
3494 #define P2BSEL APFCON1bits.P2BSEL // bit 1
3495 #define P1CSEL APFCON1bits.P1CSEL // bit 2
3496 #define P1DSEL APFCON1bits.P1DSEL // bit 3
3498 #define ABDEN BAUDCONbits.ABDEN // bit 0
3499 #define WUE BAUDCONbits.WUE // bit 1
3500 #define BRG16 BAUDCONbits.BRG16 // bit 3
3501 #define SCKP BAUDCONbits.SCKP // bit 4
3502 #define RCIDL BAUDCONbits.RCIDL // bit 6
3503 #define ABDOVF BAUDCONbits.ABDOVF // bit 7
3505 #define BORRDY BORCONbits.BORRDY // bit 0
3506 #define SBOREN BORCONbits.SBOREN // bit 7
3508 #define BSR0 BSRbits.BSR0 // bit 0
3509 #define BSR1 BSRbits.BSR1 // bit 1
3510 #define BSR2 BSRbits.BSR2 // bit 2
3511 #define BSR3 BSRbits.BSR3 // bit 3
3512 #define BSR4 BSRbits.BSR4 // bit 4
3514 #define PSS1BD0 CCP1ASbits.PSS1BD0 // bit 0
3515 #define PSS1BD1 CCP1ASbits.PSS1BD1 // bit 1
3516 #define PSS1AC0 CCP1ASbits.PSS1AC0 // bit 2
3517 #define PSS1AC1 CCP1ASbits.PSS1AC1 // bit 3
3518 #define CCP1AS0 CCP1ASbits.CCP1AS0 // bit 4
3519 #define CCP1AS1 CCP1ASbits.CCP1AS1 // bit 5
3520 #define CCP1AS2 CCP1ASbits.CCP1AS2 // bit 6
3521 #define CCP1ASE CCP1ASbits.CCP1ASE // bit 7
3523 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
3524 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
3525 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
3526 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
3527 #define DC1B0 CCP1CONbits.DC1B0 // bit 4
3528 #define DC1B1 CCP1CONbits.DC1B1 // bit 5
3529 #define P1M0 CCP1CONbits.P1M0 // bit 6
3530 #define P1M1 CCP1CONbits.P1M1 // bit 7
3532 #define PSS2BD0 CCP2ASbits.PSS2BD0 // bit 0
3533 #define PSS2BD1 CCP2ASbits.PSS2BD1 // bit 1
3534 #define PSS2AC0 CCP2ASbits.PSS2AC0 // bit 2
3535 #define PSS2AC1 CCP2ASbits.PSS2AC1 // bit 3
3536 #define CCP2AS0 CCP2ASbits.CCP2AS0 // bit 4
3537 #define CCP2AS1 CCP2ASbits.CCP2AS1 // bit 5
3538 #define CCP2AS2 CCP2ASbits.CCP2AS2 // bit 6
3539 #define CCP2ASE CCP2ASbits.CCP2ASE // bit 7
3541 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
3542 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
3543 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
3544 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
3545 #define DC2B0 CCP2CONbits.DC2B0 // bit 4
3546 #define DC2B1 CCP2CONbits.DC2B1 // bit 5
3547 #define P2M0 CCP2CONbits.P2M0 // bit 6
3548 #define P2M1 CCP2CONbits.P2M1 // bit 7
3550 #define CCP3M0 CCP3CONbits.CCP3M0 // bit 0
3551 #define CCP3M1 CCP3CONbits.CCP3M1 // bit 1
3552 #define CCP3M2 CCP3CONbits.CCP3M2 // bit 2
3553 #define CCP3M3 CCP3CONbits.CCP3M3 // bit 3
3554 #define DC3B0 CCP3CONbits.DC3B0 // bit 4
3555 #define DC3B1 CCP3CONbits.DC3B1 // bit 5
3557 #define CCP4M0 CCP4CONbits.CCP4M0 // bit 0
3558 #define CCP4M1 CCP4CONbits.CCP4M1 // bit 1
3559 #define CCP4M2 CCP4CONbits.CCP4M2 // bit 2
3560 #define CCP4M3 CCP4CONbits.CCP4M3 // bit 3
3561 #define DC4B0 CCP4CONbits.DC4B0 // bit 4
3562 #define DC4B1 CCP4CONbits.DC4B1 // bit 5
3564 #define C1TSEL0 CCPTMRSbits.C1TSEL0 // bit 0
3565 #define C1TSEL1 CCPTMRSbits.C1TSEL1 // bit 1
3566 #define C2TSEL0 CCPTMRSbits.C2TSEL0 // bit 2
3567 #define C2TSEL1 CCPTMRSbits.C2TSEL1 // bit 3
3568 #define C3TSEL0 CCPTMRSbits.C3TSEL0 // bit 4
3569 #define C3TSEL1 CCPTMRSbits.C3TSEL1 // bit 5
3570 #define C4TSEL0 CCPTMRSbits.C4TSEL0 // bit 6
3571 #define C4TSEL1 CCPTMRSbits.C4TSEL1 // bit 7
3573 #define CLKRDIV0 CLKRCONbits.CLKRDIV0 // bit 0
3574 #define CLKRDIV1 CLKRCONbits.CLKRDIV1 // bit 1
3575 #define CLKRDIV2 CLKRCONbits.CLKRDIV2 // bit 2
3576 #define CLKRDC0 CLKRCONbits.CLKRDC0 // bit 3
3577 #define CLKRDC1 CLKRCONbits.CLKRDC1 // bit 4
3578 #define CLKRSLR CLKRCONbits.CLKRSLR // bit 5
3579 #define CLKROE CLKRCONbits.CLKROE // bit 6
3580 #define CLKREN CLKRCONbits.CLKREN // bit 7
3582 #define C1SYNC CM1CON0bits.C1SYNC // bit 0
3583 #define C1HYS CM1CON0bits.C1HYS // bit 1
3584 #define C1SP CM1CON0bits.C1SP // bit 2
3585 #define C1POL CM1CON0bits.C1POL // bit 4
3586 #define C1OE CM1CON0bits.C1OE // bit 5
3587 #define C1OUT CM1CON0bits.C1OUT // bit 6
3588 #define C1ON CM1CON0bits.C1ON // bit 7
3590 #define C1NCH0 CM1CON1bits.C1NCH0 // bit 0
3591 #define C1NCH1 CM1CON1bits.C1NCH1 // bit 1
3592 #define C1PCH0 CM1CON1bits.C1PCH0 // bit 4
3593 #define C1PCH1 CM1CON1bits.C1PCH1 // bit 5
3594 #define C1INTN CM1CON1bits.C1INTN // bit 6
3595 #define C1INTP CM1CON1bits.C1INTP // bit 7
3597 #define C2SYNC CM2CON0bits.C2SYNC // bit 0
3598 #define C2HYS CM2CON0bits.C2HYS // bit 1
3599 #define C2SP CM2CON0bits.C2SP // bit 2
3600 #define C2POL CM2CON0bits.C2POL // bit 4
3601 #define C2OE CM2CON0bits.C2OE // bit 5
3602 #define C2OUT CM2CON0bits.C2OUT // bit 6
3603 #define C2ON CM2CON0bits.C2ON // bit 7
3605 #define C2NCH0 CM2CON1bits.C2NCH0 // bit 0
3606 #define C2NCH1 CM2CON1bits.C2NCH1 // bit 1
3607 #define C2PCH0 CM2CON1bits.C2PCH0 // bit 4
3608 #define C2PCH1 CM2CON1bits.C2PCH1 // bit 5
3609 #define C2INTN CM2CON1bits.C2INTN // bit 6
3610 #define C2INTP CM2CON1bits.C2INTP // bit 7
3612 #define MC1OUT CMOUTbits.MC1OUT // bit 0
3613 #define MC2OUT CMOUTbits.MC2OUT // bit 1
3615 #define T0XCS CPSCON0bits.T0XCS // bit 0
3616 #define CPSOUT CPSCON0bits.CPSOUT // bit 1
3617 #define CPSRNG0 CPSCON0bits.CPSRNG0 // bit 2
3618 #define CPSRNG1 CPSCON0bits.CPSRNG1 // bit 3
3619 #define CPSRM CPSCON0bits.CPSRM // bit 6
3620 #define CPSON CPSCON0bits.CPSON // bit 7
3622 #define CPSCH0 CPSCON1bits.CPSCH0 // bit 0
3623 #define CPSCH1 CPSCON1bits.CPSCH1 // bit 1
3624 #define CPSCH2 CPSCON1bits.CPSCH2 // bit 2
3625 #define CPSCH3 CPSCON1bits.CPSCH3 // bit 3
3627 #define DACNSS DACCON0bits.DACNSS // bit 0
3628 #define DACPSS0 DACCON0bits.DACPSS0 // bit 2
3629 #define DACPSS1 DACCON0bits.DACPSS1 // bit 3
3630 #define DACOE DACCON0bits.DACOE // bit 5
3631 #define DACLPS DACCON0bits.DACLPS // bit 6
3632 #define DACEN DACCON0bits.DACEN // bit 7
3634 #define DACR0 DACCON1bits.DACR0 // bit 0
3635 #define DACR1 DACCON1bits.DACR1 // bit 1
3636 #define DACR2 DACCON1bits.DACR2 // bit 2
3637 #define DACR3 DACCON1bits.DACR3 // bit 3
3638 #define DACR4 DACCON1bits.DACR4 // bit 4
3640 #define RD EECON1bits.RD // bit 0
3641 #define WR EECON1bits.WR // bit 1
3642 #define WREN EECON1bits.WREN // bit 2
3643 #define WRERR EECON1bits.WRERR // bit 3
3644 #define FREE EECON1bits.FREE // bit 4
3645 #define LWLO EECON1bits.LWLO // bit 5
3646 #define CFGS EECON1bits.CFGS // bit 6
3647 #define EEPGD EECON1bits.EEPGD // bit 7
3649 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
3650 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
3651 #define CDAFVR0 FVRCONbits.CDAFVR0 // bit 2
3652 #define CDAFVR1 FVRCONbits.CDAFVR1 // bit 3
3653 #define TSRNG FVRCONbits.TSRNG // bit 4
3654 #define TSEN FVRCONbits.TSEN // bit 5
3655 #define FVRRDY FVRCONbits.FVRRDY // bit 6
3656 #define FVREN FVRCONbits.FVREN // bit 7
3658 #define INLVLA0 INLVLAbits.INLVLA0 // bit 0
3659 #define INLVLA1 INLVLAbits.INLVLA1 // bit 1
3660 #define INLVLA2 INLVLAbits.INLVLA2 // bit 2
3661 #define INLVLA3 INLVLAbits.INLVLA3 // bit 3
3662 #define INLVLA4 INLVLAbits.INLVLA4 // bit 4
3663 #define INLVLA5 INLVLAbits.INLVLA5 // bit 5
3665 #define INLVLC0 INLVLCbits.INLVLC0 // bit 0
3666 #define INLVLC1 INLVLCbits.INLVLC1 // bit 1
3667 #define INLVLC2 INLVLCbits.INLVLC2 // bit 2
3668 #define INLVLC3 INLVLCbits.INLVLC3 // bit 3
3669 #define INLVLC4 INLVLCbits.INLVLC4 // bit 4
3670 #define INLVLC5 INLVLCbits.INLVLC5 // bit 5
3672 #define IOCIF INTCONbits.IOCIF // bit 0
3673 #define INTF INTCONbits.INTF // bit 1
3674 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
3675 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
3676 #define IOCIE INTCONbits.IOCIE // bit 3
3677 #define INTE INTCONbits.INTE // bit 4
3678 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
3679 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
3680 #define PEIE INTCONbits.PEIE // bit 6
3681 #define GIE INTCONbits.GIE // bit 7
3683 #define IOCAF0 IOCAFbits.IOCAF0 // bit 0
3684 #define IOCAF1 IOCAFbits.IOCAF1 // bit 1
3685 #define IOCAF2 IOCAFbits.IOCAF2 // bit 2
3686 #define IOCAF3 IOCAFbits.IOCAF3 // bit 3
3687 #define IOCAF4 IOCAFbits.IOCAF4 // bit 4
3688 #define IOCAF5 IOCAFbits.IOCAF5 // bit 5
3690 #define IOCAN0 IOCANbits.IOCAN0 // bit 0
3691 #define IOCAN1 IOCANbits.IOCAN1 // bit 1
3692 #define IOCAN2 IOCANbits.IOCAN2 // bit 2
3693 #define IOCAN3 IOCANbits.IOCAN3 // bit 3
3694 #define IOCAN4 IOCANbits.IOCAN4 // bit 4
3695 #define IOCAN5 IOCANbits.IOCAN5 // bit 5
3697 #define IOCAP0 IOCAPbits.IOCAP0 // bit 0
3698 #define IOCAP1 IOCAPbits.IOCAP1 // bit 1
3699 #define IOCAP2 IOCAPbits.IOCAP2 // bit 2
3700 #define IOCAP3 IOCAPbits.IOCAP3 // bit 3
3701 #define IOCAP4 IOCAPbits.IOCAP4 // bit 4
3702 #define IOCAP5 IOCAPbits.IOCAP5 // bit 5
3704 #define LATA0 LATAbits.LATA0 // bit 0
3705 #define LATA1 LATAbits.LATA1 // bit 1
3706 #define LATA2 LATAbits.LATA2 // bit 2
3707 #define LATA4 LATAbits.LATA4 // bit 4
3708 #define LATA5 LATAbits.LATA5 // bit 5
3710 #define LATC0 LATCbits.LATC0 // bit 0
3711 #define LATC1 LATCbits.LATC1 // bit 1
3712 #define LATC2 LATCbits.LATC2 // bit 2
3713 #define LATC3 LATCbits.LATC3 // bit 3
3714 #define LATC4 LATCbits.LATC4 // bit 4
3715 #define LATC5 LATCbits.LATC5 // bit 5
3717 #define MDCH0 MDCARHbits.MDCH0 // bit 0
3718 #define MDCH1 MDCARHbits.MDCH1 // bit 1
3719 #define MDCH2 MDCARHbits.MDCH2 // bit 2
3720 #define MDCH3 MDCARHbits.MDCH3 // bit 3
3721 #define MDCHSYNC MDCARHbits.MDCHSYNC // bit 5
3722 #define MDCHPOL MDCARHbits.MDCHPOL // bit 6
3723 #define MDCHODIS MDCARHbits.MDCHODIS // bit 7
3725 #define MDCL0 MDCARLbits.MDCL0 // bit 0
3726 #define MDCL1 MDCARLbits.MDCL1 // bit 1
3727 #define MDCL2 MDCARLbits.MDCL2 // bit 2
3728 #define MDCL3 MDCARLbits.MDCL3 // bit 3
3729 #define MDCLSYNC MDCARLbits.MDCLSYNC // bit 5
3730 #define MDCLPOL MDCARLbits.MDCLPOL // bit 6
3731 #define MDCLODIS MDCARLbits.MDCLODIS // bit 7
3733 #define MDBIT MDCONbits.MDBIT // bit 0
3734 #define MDOUT MDCONbits.MDOUT // bit 3
3735 #define MDOPOL MDCONbits.MDOPOL // bit 4
3736 #define MDSLR MDCONbits.MDSLR // bit 5
3737 #define MDOE MDCONbits.MDOE // bit 6
3738 #define MDEN MDCONbits.MDEN // bit 7
3740 #define MDMS0 MDSRCbits.MDMS0 // bit 0
3741 #define MDMS1 MDSRCbits.MDMS1 // bit 1
3742 #define MDMS2 MDSRCbits.MDMS2 // bit 2
3743 #define MDMS3 MDSRCbits.MDMS3 // bit 3
3744 #define MDMSODIS MDSRCbits.MDMSODIS // bit 7
3746 #define PS0 OPTION_REGbits.PS0 // bit 0
3747 #define PS1 OPTION_REGbits.PS1 // bit 1
3748 #define PS2 OPTION_REGbits.PS2 // bit 2
3749 #define PSA OPTION_REGbits.PSA // bit 3
3750 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
3751 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
3752 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
3753 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
3754 #define INTEDG OPTION_REGbits.INTEDG // bit 6
3755 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7
3757 #define SCS0 OSCCONbits.SCS0 // bit 0
3758 #define SCS1 OSCCONbits.SCS1 // bit 1
3759 #define IRCF0 OSCCONbits.IRCF0 // bit 3
3760 #define IRCF1 OSCCONbits.IRCF1 // bit 4
3761 #define IRCF2 OSCCONbits.IRCF2 // bit 5
3762 #define IRCF3 OSCCONbits.IRCF3 // bit 6
3763 #define SPLLEN OSCCONbits.SPLLEN // bit 7
3765 #define HFIOFS OSCSTATbits.HFIOFS // bit 0
3766 #define LFIOFR OSCSTATbits.LFIOFR // bit 1
3767 #define MFIOFR OSCSTATbits.MFIOFR // bit 2
3768 #define HFIOFL OSCSTATbits.HFIOFL // bit 3
3769 #define HFIOFR OSCSTATbits.HFIOFR // bit 4
3770 #define OSTS OSCSTATbits.OSTS // bit 5
3771 #define PLLR OSCSTATbits.PLLR // bit 6
3772 #define T1OSCR OSCSTATbits.T1OSCR // bit 7
3774 #define TUN0 OSCTUNEbits.TUN0 // bit 0
3775 #define TUN1 OSCTUNEbits.TUN1 // bit 1
3776 #define TUN2 OSCTUNEbits.TUN2 // bit 2
3777 #define TUN3 OSCTUNEbits.TUN3 // bit 3
3778 #define TUN4 OSCTUNEbits.TUN4 // bit 4
3779 #define TUN5 OSCTUNEbits.TUN5 // bit 5
3781 #define NOT_BOR PCONbits.NOT_BOR // bit 0
3782 #define NOT_POR PCONbits.NOT_POR // bit 1
3783 #define NOT_RI PCONbits.NOT_RI // bit 2
3784 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3
3785 #define STKUNF PCONbits.STKUNF // bit 6
3786 #define STKOVF PCONbits.STKOVF // bit 7
3788 #define TMR1IE PIE1bits.TMR1IE // bit 0
3789 #define TMR2IE PIE1bits.TMR2IE // bit 1
3790 #define CCP1IE PIE1bits.CCP1IE // bit 2
3791 #define SSP1IE PIE1bits.SSP1IE // bit 3
3792 #define TXIE PIE1bits.TXIE // bit 4
3793 #define RCIE PIE1bits.RCIE // bit 5
3794 #define ADIE PIE1bits.ADIE // bit 6
3795 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
3797 #define CCP2IE PIE2bits.CCP2IE // bit 0
3798 #define BCL1IE PIE2bits.BCL1IE // bit 3
3799 #define EEIE PIE2bits.EEIE // bit 4
3800 #define C1IE PIE2bits.C1IE // bit 5
3801 #define C2IE PIE2bits.C2IE // bit 6
3802 #define OSFIE PIE2bits.OSFIE // bit 7
3804 #define TMR4IE PIE3bits.TMR4IE // bit 1
3805 #define TMR6IE PIE3bits.TMR6IE // bit 3
3806 #define CCP3IE PIE3bits.CCP3IE // bit 4
3807 #define CCP4IE PIE3bits.CCP4IE // bit 5
3809 #define TMR1IF PIR1bits.TMR1IF // bit 0
3810 #define TMR2IF PIR1bits.TMR2IF // bit 1
3811 #define CCP1IF PIR1bits.CCP1IF // bit 2
3812 #define SSP1IF PIR1bits.SSP1IF // bit 3
3813 #define TXIF PIR1bits.TXIF // bit 4
3814 #define RCIF PIR1bits.RCIF // bit 5
3815 #define ADIF PIR1bits.ADIF // bit 6
3816 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
3818 #define CCP2IF PIR2bits.CCP2IF // bit 0
3819 #define BCL1IF PIR2bits.BCL1IF // bit 3
3820 #define EEIF PIR2bits.EEIF // bit 4
3821 #define C1IF PIR2bits.C1IF // bit 5
3822 #define C2IF PIR2bits.C2IF // bit 6
3823 #define OSFIF PIR2bits.OSFIF // bit 7
3825 #define TMR4IF PIR3bits.TMR4IF // bit 1
3826 #define TMR6IF PIR3bits.TMR6IF // bit 3
3827 #define CCP3IF PIR3bits.CCP3IF // bit 4
3828 #define CCP4IF PIR3bits.CCP4IF // bit 5
3830 #define RA0 PORTAbits.RA0 // bit 0
3831 #define RA1 PORTAbits.RA1 // bit 1
3832 #define RA2 PORTAbits.RA2 // bit 2
3833 #define RA3 PORTAbits.RA3 // bit 3
3834 #define RA4 PORTAbits.RA4 // bit 4
3835 #define RA5 PORTAbits.RA5 // bit 5
3837 #define RC0 PORTCbits.RC0 // bit 0
3838 #define RC1 PORTCbits.RC1 // bit 1
3839 #define RC2 PORTCbits.RC2 // bit 2
3840 #define RC3 PORTCbits.RC3 // bit 3
3841 #define RC4 PORTCbits.RC4 // bit 4
3842 #define RC5 PORTCbits.RC5 // bit 5
3844 #define STR1A PSTR1CONbits.STR1A // bit 0
3845 #define STR1B PSTR1CONbits.STR1B // bit 1
3846 #define STR1C PSTR1CONbits.STR1C // bit 2
3847 #define STR1D PSTR1CONbits.STR1D // bit 3
3848 #define STR1SYNC PSTR1CONbits.STR1SYNC // bit 4
3850 #define STR2A PSTR2CONbits.STR2A // bit 0
3851 #define STR2B PSTR2CONbits.STR2B // bit 1
3852 #define STR2C PSTR2CONbits.STR2C // bit 2
3853 #define STR2D PSTR2CONbits.STR2D // bit 3
3854 #define STR2SYNC PSTR2CONbits.STR2SYNC // bit 4
3856 #define P1DC0 PWM1CONbits.P1DC0 // bit 0
3857 #define P1DC1 PWM1CONbits.P1DC1 // bit 1
3858 #define P1DC2 PWM1CONbits.P1DC2 // bit 2
3859 #define P1DC3 PWM1CONbits.P1DC3 // bit 3
3860 #define P1DC4 PWM1CONbits.P1DC4 // bit 4
3861 #define P1DC5 PWM1CONbits.P1DC5 // bit 5
3862 #define P1DC6 PWM1CONbits.P1DC6 // bit 6
3863 #define P1RSEN PWM1CONbits.P1RSEN // bit 7
3865 #define P2DC0 PWM2CONbits.P2DC0 // bit 0
3866 #define P2DC1 PWM2CONbits.P2DC1 // bit 1
3867 #define P2DC2 PWM2CONbits.P2DC2 // bit 2
3868 #define P2DC3 PWM2CONbits.P2DC3 // bit 3
3869 #define P2DC4 PWM2CONbits.P2DC4 // bit 4
3870 #define P2DC5 PWM2CONbits.P2DC5 // bit 5
3871 #define P2DC6 PWM2CONbits.P2DC6 // bit 6
3872 #define P2RSEN PWM2CONbits.P2RSEN // bit 7
3874 #define RX9D RCSTAbits.RX9D // bit 0
3875 #define OERR RCSTAbits.OERR // bit 1
3876 #define FERR RCSTAbits.FERR // bit 2
3877 #define ADDEN RCSTAbits.ADDEN // bit 3
3878 #define CREN RCSTAbits.CREN // bit 4
3879 #define SREN RCSTAbits.SREN // bit 5
3880 #define RX9 RCSTAbits.RX9 // bit 6
3881 #define SPEN RCSTAbits.SPEN // bit 7
3883 #define SRPR SRCON0bits.SRPR // bit 0
3884 #define SRPS SRCON0bits.SRPS // bit 1
3885 #define SRNQEN SRCON0bits.SRNQEN // bit 2
3886 #define SRQEN SRCON0bits.SRQEN // bit 3
3887 #define SRCLK0 SRCON0bits.SRCLK0 // bit 4
3888 #define SRCLK1 SRCON0bits.SRCLK1 // bit 5
3889 #define SRCLK2 SRCON0bits.SRCLK2 // bit 6
3890 #define SRLEN SRCON0bits.SRLEN // bit 7
3892 #define SRRC1E SRCON1bits.SRRC1E // bit 0
3893 #define SRRCKE SRCON1bits.SRRCKE // bit 2
3894 #define SRRPE SRCON1bits.SRRPE // bit 3
3895 #define SRSC1E SRCON1bits.SRSC1E // bit 4
3896 #define SRSCKE SRCON1bits.SRSCKE // bit 6
3897 #define SRSPE SRCON1bits.SRSPE // bit 7
3899 #define SSPM0 SSP1CON1bits.SSPM0 // bit 0
3900 #define SSPM1 SSP1CON1bits.SSPM1 // bit 1
3901 #define SSPM2 SSP1CON1bits.SSPM2 // bit 2
3902 #define SSPM3 SSP1CON1bits.SSPM3 // bit 3
3903 #define CKP SSP1CON1bits.CKP // bit 4
3904 #define SSPEN SSP1CON1bits.SSPEN // bit 5
3905 #define SSPOV SSP1CON1bits.SSPOV // bit 6
3906 #define WCOL SSP1CON1bits.WCOL // bit 7
3908 #define SEN SSP1CON2bits.SEN // bit 0
3909 #define RSEN SSP1CON2bits.RSEN // bit 1
3910 #define PEN SSP1CON2bits.PEN // bit 2
3911 #define RCEN SSP1CON2bits.RCEN // bit 3
3912 #define ACKEN SSP1CON2bits.ACKEN // bit 4
3913 #define ACKDT SSP1CON2bits.ACKDT // bit 5
3914 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6
3915 #define GCEN SSP1CON2bits.GCEN // bit 7
3917 #define DHEN SSP1CON3bits.DHEN // bit 0
3918 #define AHEN SSP1CON3bits.AHEN // bit 1
3919 #define SBCDE SSP1CON3bits.SBCDE // bit 2
3920 #define SDAHT SSP1CON3bits.SDAHT // bit 3
3921 #define BOEN SSP1CON3bits.BOEN // bit 4
3922 #define SCIE SSP1CON3bits.SCIE // bit 5
3923 #define PCIE SSP1CON3bits.PCIE // bit 6
3924 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7
3926 #define BF SSP1STATbits.BF // bit 0
3927 #define UA SSP1STATbits.UA // bit 1
3928 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2
3929 #define S SSP1STATbits.S // bit 3
3930 #define P SSP1STATbits.P // bit 4
3931 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5
3932 #define CKE SSP1STATbits.CKE // bit 6
3933 #define SMP SSP1STATbits.SMP // bit 7
3935 #define C STATUSbits.C // bit 0
3936 #define DC STATUSbits.DC // bit 1
3937 #define Z STATUSbits.Z // bit 2
3938 #define NOT_PD STATUSbits.NOT_PD // bit 3
3939 #define NOT_TO STATUSbits.NOT_TO // bit 4
3941 #define C_SHAD STATUS_SHADbits.C_SHAD // bit 0
3942 #define DC_SHAD STATUS_SHADbits.DC_SHAD // bit 1
3943 #define Z_SHAD STATUS_SHADbits.Z_SHAD // bit 2
3945 #define TMR1ON T1CONbits.TMR1ON // bit 0
3946 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
3947 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
3948 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
3949 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
3950 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6
3951 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7
3953 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0
3954 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1
3955 #define T1GVAL T1GCONbits.T1GVAL // bit 2
3956 #define T1GGO T1GCONbits.T1GGO // bit 3
3957 #define T1GSPM T1GCONbits.T1GSPM // bit 4
3958 #define T1GTM T1GCONbits.T1GTM // bit 5
3959 #define T1GPOL T1GCONbits.T1GPOL // bit 6
3960 #define TMR1GE T1GCONbits.TMR1GE // bit 7
3962 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
3963 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
3964 #define TMR2ON T2CONbits.TMR2ON // bit 2
3965 #define T2OUTPS0 T2CONbits.T2OUTPS0 // bit 3
3966 #define T2OUTPS1 T2CONbits.T2OUTPS1 // bit 4
3967 #define T2OUTPS2 T2CONbits.T2OUTPS2 // bit 5
3968 #define T2OUTPS3 T2CONbits.T2OUTPS3 // bit 6
3970 #define T4CKPS0 T4CONbits.T4CKPS0 // bit 0
3971 #define T4CKPS1 T4CONbits.T4CKPS1 // bit 1
3972 #define TMR4ON T4CONbits.TMR4ON // bit 2
3973 #define T4OUTPS0 T4CONbits.T4OUTPS0 // bit 3
3974 #define T4OUTPS1 T4CONbits.T4OUTPS1 // bit 4
3975 #define T4OUTPS2 T4CONbits.T4OUTPS2 // bit 5
3976 #define T4OUTPS3 T4CONbits.T4OUTPS3 // bit 6
3978 #define T6CKPS0 T6CONbits.T6CKPS0 // bit 0
3979 #define T6CKPS1 T6CONbits.T6CKPS1 // bit 1
3980 #define TMR6ON T6CONbits.TMR6ON // bit 2
3981 #define T6OUTPS0 T6CONbits.T6OUTPS0 // bit 3
3982 #define T6OUTPS1 T6CONbits.T6OUTPS1 // bit 4
3983 #define T6OUTPS2 T6CONbits.T6OUTPS2 // bit 5
3984 #define T6OUTPS3 T6CONbits.T6OUTPS3 // bit 6
3986 #define TRISA0 TRISAbits.TRISA0 // bit 0
3987 #define TRISA1 TRISAbits.TRISA1 // bit 1
3988 #define TRISA2 TRISAbits.TRISA2 // bit 2
3989 #define TRISA3 TRISAbits.TRISA3 // bit 3
3990 #define TRISA4 TRISAbits.TRISA4 // bit 4
3991 #define TRISA5 TRISAbits.TRISA5 // bit 5
3993 #define TRISC0 TRISCbits.TRISC0 // bit 0
3994 #define TRISC1 TRISCbits.TRISC1 // bit 1
3995 #define TRISC2 TRISCbits.TRISC2 // bit 2
3996 #define TRISC3 TRISCbits.TRISC3 // bit 3
3997 #define TRISC4 TRISCbits.TRISC4 // bit 4
3998 #define TRISC5 TRISCbits.TRISC5 // bit 5
4000 #define TX9D TXSTAbits.TX9D // bit 0
4001 #define TRMT TXSTAbits.TRMT // bit 1
4002 #define BRGH TXSTAbits.BRGH // bit 2
4003 #define SENDB TXSTAbits.SENDB // bit 3
4004 #define SYNC TXSTAbits.SYNC // bit 4
4005 #define TXEN TXSTAbits.TXEN // bit 5
4006 #define TX9 TXSTAbits.TX9 // bit 6
4007 #define CSRC TXSTAbits.CSRC // bit 7
4009 #define SWDTEN WDTCONbits.SWDTEN // bit 0
4010 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
4011 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
4012 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
4013 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
4014 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5
4016 #define WPUA0 WPUAbits.WPUA0 // bit 0
4017 #define WPUA1 WPUAbits.WPUA1 // bit 1
4018 #define WPUA2 WPUAbits.WPUA2 // bit 2
4019 #define WPUA3 WPUAbits.WPUA3 // bit 3
4020 #define WPUA4 WPUAbits.WPUA4 // bit 4
4021 #define WPUA5 WPUAbits.WPUA5 // bit 5
4023 #define WPUC0 WPUCbits.WPUC0 // bit 0
4024 #define WPUC1 WPUCbits.WPUC1 // bit 1
4025 #define WPUC2 WPUCbits.WPUC2 // bit 2
4026 #define WPUC3 WPUCbits.WPUC3 // bit 3
4027 #define WPUC4 WPUCbits.WPUC4 // bit 4
4028 #define WPUC5 WPUCbits.WPUC5 // bit 5
4030 #endif // #ifndef NO_BIT_DEFINES
4032 #endif // #ifndef __PIC16F1825_H__