struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16lf1824.h
blob66c750e3e4a897783f3cdf5c348a2f9c824d1f99
1 /*
2 * This declarations of the PIC16LF1824 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:19 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 __PIC16LF1824_H__
26 #define __PIC16LF1824_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 SP1BRG_ADDR 0x019B
110 #define SP1BRGL_ADDR 0x019B
111 #define SPBRG_ADDR 0x019B
112 #define SPBRGL_ADDR 0x019B
113 #define SP1BRGH_ADDR 0x019C
114 #define SPBRGH_ADDR 0x019C
115 #define RCSTA_ADDR 0x019D
116 #define TXSTA_ADDR 0x019E
117 #define BAUDCON_ADDR 0x019F
118 #define WPUA_ADDR 0x020C
119 #define WPUC_ADDR 0x020E
120 #define SSP1BUF_ADDR 0x0211
121 #define SSPBUF_ADDR 0x0211
122 #define SSP1ADD_ADDR 0x0212
123 #define SSPADD_ADDR 0x0212
124 #define SSP1MSK_ADDR 0x0213
125 #define SSPMSK_ADDR 0x0213
126 #define SSP1STAT_ADDR 0x0214
127 #define SSPSTAT_ADDR 0x0214
128 #define SSP1CON_ADDR 0x0215
129 #define SSP1CON1_ADDR 0x0215
130 #define SSPCON_ADDR 0x0215
131 #define SSPCON1_ADDR 0x0215
132 #define SSP1CON2_ADDR 0x0216
133 #define SSPCON2_ADDR 0x0216
134 #define SSP1CON3_ADDR 0x0217
135 #define SSPCON3_ADDR 0x0217
136 #define CCPR1_ADDR 0x0291
137 #define CCPR1L_ADDR 0x0291
138 #define CCPR1H_ADDR 0x0292
139 #define CCP1CON_ADDR 0x0293
140 #define PWM1CON_ADDR 0x0294
141 #define CCP1AS_ADDR 0x0295
142 #define ECCP1AS_ADDR 0x0295
143 #define PSTR1CON_ADDR 0x0296
144 #define CCPR2_ADDR 0x0298
145 #define CCPR2L_ADDR 0x0298
146 #define CCPR2H_ADDR 0x0299
147 #define CCP2CON_ADDR 0x029A
148 #define PWM2CON_ADDR 0x029B
149 #define CCP2AS_ADDR 0x029C
150 #define PSTR2CON_ADDR 0x029D
151 #define CCPTMRS_ADDR 0x029E
152 #define CCPTMRS0_ADDR 0x029E
153 #define CCPR3_ADDR 0x0311
154 #define CCPR3L_ADDR 0x0311
155 #define CCPR3H_ADDR 0x0312
156 #define CCP3CON_ADDR 0x0313
157 #define CCPR4_ADDR 0x0318
158 #define CCPR4L_ADDR 0x0318
159 #define CCPR4H_ADDR 0x0319
160 #define CCP4CON_ADDR 0x031A
161 #define INLVLA_ADDR 0x038C
162 #define INLVLC_ADDR 0x038E
163 #define IOCAP_ADDR 0x0391
164 #define IOCAN_ADDR 0x0392
165 #define IOCAF_ADDR 0x0393
166 #define CLKRCON_ADDR 0x039A
167 #define MDCON_ADDR 0x039C
168 #define MDSRC_ADDR 0x039D
169 #define MDCARL_ADDR 0x039E
170 #define MDCARH_ADDR 0x039F
171 #define TMR4_ADDR 0x0415
172 #define PR4_ADDR 0x0416
173 #define T4CON_ADDR 0x0417
174 #define TMR6_ADDR 0x041C
175 #define PR6_ADDR 0x041D
176 #define T6CON_ADDR 0x041E
177 #define STATUS_SHAD_ADDR 0x0FE4
178 #define WREG_SHAD_ADDR 0x0FE5
179 #define BSR_SHAD_ADDR 0x0FE6
180 #define PCLATH_SHAD_ADDR 0x0FE7
181 #define FSR0L_SHAD_ADDR 0x0FE8
182 #define FSR0H_SHAD_ADDR 0x0FE9
183 #define FSR1L_SHAD_ADDR 0x0FEA
184 #define FSR1H_SHAD_ADDR 0x0FEB
185 #define STKPTR_ADDR 0x0FED
186 #define TOSL_ADDR 0x0FEE
187 #define TOSH_ADDR 0x0FEF
189 #endif // #ifndef NO_ADDR_DEFINES
191 //==============================================================================
193 // Register Definitions
195 //==============================================================================
197 extern __at(0x0000) __sfr INDF0;
198 extern __at(0x0001) __sfr INDF1;
199 extern __at(0x0002) __sfr PCL;
201 //==============================================================================
202 // STATUS Bits
204 extern __at(0x0003) __sfr STATUS;
206 typedef struct
208 unsigned C : 1;
209 unsigned DC : 1;
210 unsigned Z : 1;
211 unsigned NOT_PD : 1;
212 unsigned NOT_TO : 1;
213 unsigned : 1;
214 unsigned : 1;
215 unsigned : 1;
216 } __STATUSbits_t;
218 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
220 #define _C 0x01
221 #define _DC 0x02
222 #define _Z 0x04
223 #define _NOT_PD 0x08
224 #define _NOT_TO 0x10
226 //==============================================================================
228 extern __at(0x0004) __sfr FSR0;
229 extern __at(0x0004) __sfr FSR0L;
230 extern __at(0x0005) __sfr FSR0H;
231 extern __at(0x0006) __sfr FSR1;
232 extern __at(0x0006) __sfr FSR1L;
233 extern __at(0x0007) __sfr FSR1H;
235 //==============================================================================
236 // BSR Bits
238 extern __at(0x0008) __sfr BSR;
240 typedef union
242 struct
244 unsigned BSR0 : 1;
245 unsigned BSR1 : 1;
246 unsigned BSR2 : 1;
247 unsigned BSR3 : 1;
248 unsigned BSR4 : 1;
249 unsigned : 1;
250 unsigned : 1;
251 unsigned : 1;
254 struct
256 unsigned BSR : 5;
257 unsigned : 3;
259 } __BSRbits_t;
261 extern __at(0x0008) volatile __BSRbits_t BSRbits;
263 #define _BSR0 0x01
264 #define _BSR1 0x02
265 #define _BSR2 0x04
266 #define _BSR3 0x08
267 #define _BSR4 0x10
269 //==============================================================================
271 extern __at(0x0009) __sfr WREG;
272 extern __at(0x000A) __sfr PCLATH;
274 //==============================================================================
275 // INTCON Bits
277 extern __at(0x000B) __sfr INTCON;
279 typedef union
281 struct
283 unsigned IOCIF : 1;
284 unsigned INTF : 1;
285 unsigned TMR0IF : 1;
286 unsigned IOCIE : 1;
287 unsigned INTE : 1;
288 unsigned TMR0IE : 1;
289 unsigned PEIE : 1;
290 unsigned GIE : 1;
293 struct
295 unsigned : 1;
296 unsigned : 1;
297 unsigned T0IF : 1;
298 unsigned : 1;
299 unsigned : 1;
300 unsigned T0IE : 1;
301 unsigned : 1;
302 unsigned : 1;
304 } __INTCONbits_t;
306 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
308 #define _IOCIF 0x01
309 #define _INTF 0x02
310 #define _TMR0IF 0x04
311 #define _T0IF 0x04
312 #define _IOCIE 0x08
313 #define _INTE 0x10
314 #define _TMR0IE 0x20
315 #define _T0IE 0x20
316 #define _PEIE 0x40
317 #define _GIE 0x80
319 //==============================================================================
322 //==============================================================================
323 // PORTA Bits
325 extern __at(0x000C) __sfr PORTA;
327 typedef union
329 struct
331 unsigned RA0 : 1;
332 unsigned RA1 : 1;
333 unsigned RA2 : 1;
334 unsigned RA3 : 1;
335 unsigned RA4 : 1;
336 unsigned RA5 : 1;
337 unsigned : 1;
338 unsigned : 1;
341 struct
343 unsigned RA : 6;
344 unsigned : 2;
346 } __PORTAbits_t;
348 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
350 #define _RA0 0x01
351 #define _RA1 0x02
352 #define _RA2 0x04
353 #define _RA3 0x08
354 #define _RA4 0x10
355 #define _RA5 0x20
357 //==============================================================================
360 //==============================================================================
361 // PORTC Bits
363 extern __at(0x000E) __sfr PORTC;
365 typedef union
367 struct
369 unsigned RC0 : 1;
370 unsigned RC1 : 1;
371 unsigned RC2 : 1;
372 unsigned RC3 : 1;
373 unsigned RC4 : 1;
374 unsigned RC5 : 1;
375 unsigned : 1;
376 unsigned : 1;
379 struct
381 unsigned RC : 6;
382 unsigned : 2;
384 } __PORTCbits_t;
386 extern __at(0x000E) volatile __PORTCbits_t PORTCbits;
388 #define _RC0 0x01
389 #define _RC1 0x02
390 #define _RC2 0x04
391 #define _RC3 0x08
392 #define _RC4 0x10
393 #define _RC5 0x20
395 //==============================================================================
398 //==============================================================================
399 // PIR1 Bits
401 extern __at(0x0011) __sfr PIR1;
403 typedef struct
405 unsigned TMR1IF : 1;
406 unsigned TMR2IF : 1;
407 unsigned CCP1IF : 1;
408 unsigned SSP1IF : 1;
409 unsigned TXIF : 1;
410 unsigned RCIF : 1;
411 unsigned ADIF : 1;
412 unsigned TMR1GIF : 1;
413 } __PIR1bits_t;
415 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
417 #define _TMR1IF 0x01
418 #define _TMR2IF 0x02
419 #define _CCP1IF 0x04
420 #define _SSP1IF 0x08
421 #define _TXIF 0x10
422 #define _RCIF 0x20
423 #define _ADIF 0x40
424 #define _TMR1GIF 0x80
426 //==============================================================================
429 //==============================================================================
430 // PIR2 Bits
432 extern __at(0x0012) __sfr PIR2;
434 typedef struct
436 unsigned CCP2IF : 1;
437 unsigned : 1;
438 unsigned : 1;
439 unsigned BCL1IF : 1;
440 unsigned EEIF : 1;
441 unsigned C1IF : 1;
442 unsigned C2IF : 1;
443 unsigned OSFIF : 1;
444 } __PIR2bits_t;
446 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
448 #define _CCP2IF 0x01
449 #define _BCL1IF 0x08
450 #define _EEIF 0x10
451 #define _C1IF 0x20
452 #define _C2IF 0x40
453 #define _OSFIF 0x80
455 //==============================================================================
458 //==============================================================================
459 // PIR3 Bits
461 extern __at(0x0013) __sfr PIR3;
463 typedef struct
465 unsigned : 1;
466 unsigned TMR4IF : 1;
467 unsigned : 1;
468 unsigned TMR6IF : 1;
469 unsigned CCP3IF : 1;
470 unsigned CCP4IF : 1;
471 unsigned : 1;
472 unsigned : 1;
473 } __PIR3bits_t;
475 extern __at(0x0013) volatile __PIR3bits_t PIR3bits;
477 #define _TMR4IF 0x02
478 #define _TMR6IF 0x08
479 #define _CCP3IF 0x10
480 #define _CCP4IF 0x20
482 //==============================================================================
484 extern __at(0x0015) __sfr TMR0;
485 extern __at(0x0016) __sfr TMR1;
486 extern __at(0x0016) __sfr TMR1L;
487 extern __at(0x0017) __sfr TMR1H;
489 //==============================================================================
490 // T1CON Bits
492 extern __at(0x0018) __sfr T1CON;
494 typedef union
496 struct
498 unsigned TMR1ON : 1;
499 unsigned : 1;
500 unsigned NOT_T1SYNC : 1;
501 unsigned T1OSCEN : 1;
502 unsigned T1CKPS0 : 1;
503 unsigned T1CKPS1 : 1;
504 unsigned TMR1CS0 : 1;
505 unsigned TMR1CS1 : 1;
508 struct
510 unsigned : 4;
511 unsigned T1CKPS : 2;
512 unsigned : 2;
515 struct
517 unsigned : 6;
518 unsigned TMR1CS : 2;
520 } __T1CONbits_t;
522 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
524 #define _TMR1ON 0x01
525 #define _NOT_T1SYNC 0x04
526 #define _T1OSCEN 0x08
527 #define _T1CKPS0 0x10
528 #define _T1CKPS1 0x20
529 #define _TMR1CS0 0x40
530 #define _TMR1CS1 0x80
532 //==============================================================================
535 //==============================================================================
536 // T1GCON Bits
538 extern __at(0x0019) __sfr T1GCON;
540 typedef union
542 struct
544 unsigned T1GSS0 : 1;
545 unsigned T1GSS1 : 1;
546 unsigned T1GVAL : 1;
547 unsigned T1GGO_NOT_DONE : 1;
548 unsigned T1GSPM : 1;
549 unsigned T1GTM : 1;
550 unsigned T1GPOL : 1;
551 unsigned TMR1GE : 1;
554 struct
556 unsigned : 1;
557 unsigned : 1;
558 unsigned : 1;
559 unsigned T1GGO : 1;
560 unsigned : 1;
561 unsigned : 1;
562 unsigned : 1;
563 unsigned : 1;
566 struct
568 unsigned T1GSS : 2;
569 unsigned : 6;
571 } __T1GCONbits_t;
573 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
575 #define _T1GSS0 0x01
576 #define _T1GSS1 0x02
577 #define _T1GVAL 0x04
578 #define _T1GGO_NOT_DONE 0x08
579 #define _T1GGO 0x08
580 #define _T1GSPM 0x10
581 #define _T1GTM 0x20
582 #define _T1GPOL 0x40
583 #define _TMR1GE 0x80
585 //==============================================================================
587 extern __at(0x001A) __sfr TMR2;
588 extern __at(0x001B) __sfr PR2;
590 //==============================================================================
591 // T2CON Bits
593 extern __at(0x001C) __sfr T2CON;
595 typedef union
597 struct
599 unsigned T2CKPS0 : 1;
600 unsigned T2CKPS1 : 1;
601 unsigned TMR2ON : 1;
602 unsigned T2OUTPS0 : 1;
603 unsigned T2OUTPS1 : 1;
604 unsigned T2OUTPS2 : 1;
605 unsigned T2OUTPS3 : 1;
606 unsigned : 1;
609 struct
611 unsigned T2CKPS : 2;
612 unsigned : 6;
615 struct
617 unsigned : 3;
618 unsigned T2OUTPS : 4;
619 unsigned : 1;
621 } __T2CONbits_t;
623 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
625 #define _T2CKPS0 0x01
626 #define _T2CKPS1 0x02
627 #define _TMR2ON 0x04
628 #define _T2OUTPS0 0x08
629 #define _T2OUTPS1 0x10
630 #define _T2OUTPS2 0x20
631 #define _T2OUTPS3 0x40
633 //==============================================================================
636 //==============================================================================
637 // CPSCON0 Bits
639 extern __at(0x001E) __sfr CPSCON0;
641 typedef union
643 struct
645 unsigned T0XCS : 1;
646 unsigned CPSOUT : 1;
647 unsigned CPSRNG0 : 1;
648 unsigned CPSRNG1 : 1;
649 unsigned : 1;
650 unsigned : 1;
651 unsigned CPSRM : 1;
652 unsigned CPSON : 1;
655 struct
657 unsigned : 2;
658 unsigned CPSRNG : 2;
659 unsigned : 4;
661 } __CPSCON0bits_t;
663 extern __at(0x001E) volatile __CPSCON0bits_t CPSCON0bits;
665 #define _T0XCS 0x01
666 #define _CPSOUT 0x02
667 #define _CPSRNG0 0x04
668 #define _CPSRNG1 0x08
669 #define _CPSRM 0x40
670 #define _CPSON 0x80
672 //==============================================================================
675 //==============================================================================
676 // CPSCON1 Bits
678 extern __at(0x001F) __sfr CPSCON1;
680 typedef union
682 struct
684 unsigned CPSCH0 : 1;
685 unsigned CPSCH1 : 1;
686 unsigned CPSCH2 : 1;
687 unsigned CPSCH3 : 1;
688 unsigned : 1;
689 unsigned : 1;
690 unsigned : 1;
691 unsigned : 1;
694 struct
696 unsigned CPSCH : 4;
697 unsigned : 4;
699 } __CPSCON1bits_t;
701 extern __at(0x001F) volatile __CPSCON1bits_t CPSCON1bits;
703 #define _CPSCH0 0x01
704 #define _CPSCH1 0x02
705 #define _CPSCH2 0x04
706 #define _CPSCH3 0x08
708 //==============================================================================
711 //==============================================================================
712 // TRISA Bits
714 extern __at(0x008C) __sfr TRISA;
716 typedef union
718 struct
720 unsigned TRISA0 : 1;
721 unsigned TRISA1 : 1;
722 unsigned TRISA2 : 1;
723 unsigned TRISA3 : 1;
724 unsigned TRISA4 : 1;
725 unsigned TRISA5 : 1;
726 unsigned : 1;
727 unsigned : 1;
730 struct
732 unsigned TRISA : 6;
733 unsigned : 2;
735 } __TRISAbits_t;
737 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
739 #define _TRISA0 0x01
740 #define _TRISA1 0x02
741 #define _TRISA2 0x04
742 #define _TRISA3 0x08
743 #define _TRISA4 0x10
744 #define _TRISA5 0x20
746 //==============================================================================
749 //==============================================================================
750 // TRISC Bits
752 extern __at(0x008E) __sfr TRISC;
754 typedef union
756 struct
758 unsigned TRISC0 : 1;
759 unsigned TRISC1 : 1;
760 unsigned TRISC2 : 1;
761 unsigned TRISC3 : 1;
762 unsigned TRISC4 : 1;
763 unsigned TRISC5 : 1;
764 unsigned : 1;
765 unsigned : 1;
768 struct
770 unsigned TRISC : 6;
771 unsigned : 2;
773 } __TRISCbits_t;
775 extern __at(0x008E) volatile __TRISCbits_t TRISCbits;
777 #define _TRISC0 0x01
778 #define _TRISC1 0x02
779 #define _TRISC2 0x04
780 #define _TRISC3 0x08
781 #define _TRISC4 0x10
782 #define _TRISC5 0x20
784 //==============================================================================
787 //==============================================================================
788 // PIE1 Bits
790 extern __at(0x0091) __sfr PIE1;
792 typedef struct
794 unsigned TMR1IE : 1;
795 unsigned TMR2IE : 1;
796 unsigned CCP1IE : 1;
797 unsigned SSP1IE : 1;
798 unsigned TXIE : 1;
799 unsigned RCIE : 1;
800 unsigned ADIE : 1;
801 unsigned TMR1GIE : 1;
802 } __PIE1bits_t;
804 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
806 #define _TMR1IE 0x01
807 #define _TMR2IE 0x02
808 #define _CCP1IE 0x04
809 #define _SSP1IE 0x08
810 #define _TXIE 0x10
811 #define _RCIE 0x20
812 #define _ADIE 0x40
813 #define _TMR1GIE 0x80
815 //==============================================================================
818 //==============================================================================
819 // PIE2 Bits
821 extern __at(0x0092) __sfr PIE2;
823 typedef struct
825 unsigned CCP2IE : 1;
826 unsigned : 1;
827 unsigned : 1;
828 unsigned BCL1IE : 1;
829 unsigned EEIE : 1;
830 unsigned C1IE : 1;
831 unsigned C2IE : 1;
832 unsigned OSFIE : 1;
833 } __PIE2bits_t;
835 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
837 #define _CCP2IE 0x01
838 #define _BCL1IE 0x08
839 #define _EEIE 0x10
840 #define _C1IE 0x20
841 #define _C2IE 0x40
842 #define _OSFIE 0x80
844 //==============================================================================
847 //==============================================================================
848 // PIE3 Bits
850 extern __at(0x0093) __sfr PIE3;
852 typedef struct
854 unsigned : 1;
855 unsigned TMR4IE : 1;
856 unsigned : 1;
857 unsigned TMR6IE : 1;
858 unsigned CCP3IE : 1;
859 unsigned CCP4IE : 1;
860 unsigned : 1;
861 unsigned : 1;
862 } __PIE3bits_t;
864 extern __at(0x0093) volatile __PIE3bits_t PIE3bits;
866 #define _TMR4IE 0x02
867 #define _TMR6IE 0x08
868 #define _CCP3IE 0x10
869 #define _CCP4IE 0x20
871 //==============================================================================
874 //==============================================================================
875 // OPTION_REG Bits
877 extern __at(0x0095) __sfr OPTION_REG;
879 typedef union
881 struct
883 unsigned PS0 : 1;
884 unsigned PS1 : 1;
885 unsigned PS2 : 1;
886 unsigned PSA : 1;
887 unsigned TMR0SE : 1;
888 unsigned TMR0CS : 1;
889 unsigned INTEDG : 1;
890 unsigned NOT_WPUEN : 1;
893 struct
895 unsigned : 1;
896 unsigned : 1;
897 unsigned : 1;
898 unsigned : 1;
899 unsigned T0SE : 1;
900 unsigned T0CS : 1;
901 unsigned : 1;
902 unsigned : 1;
905 struct
907 unsigned PS : 3;
908 unsigned : 5;
910 } __OPTION_REGbits_t;
912 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
914 #define _PS0 0x01
915 #define _PS1 0x02
916 #define _PS2 0x04
917 #define _PSA 0x08
918 #define _TMR0SE 0x10
919 #define _T0SE 0x10
920 #define _TMR0CS 0x20
921 #define _T0CS 0x20
922 #define _INTEDG 0x40
923 #define _NOT_WPUEN 0x80
925 //==============================================================================
928 //==============================================================================
929 // PCON Bits
931 extern __at(0x0096) __sfr PCON;
933 typedef struct
935 unsigned NOT_BOR : 1;
936 unsigned NOT_POR : 1;
937 unsigned NOT_RI : 1;
938 unsigned NOT_RMCLR : 1;
939 unsigned : 1;
940 unsigned : 1;
941 unsigned STKUNF : 1;
942 unsigned STKOVF : 1;
943 } __PCONbits_t;
945 extern __at(0x0096) volatile __PCONbits_t PCONbits;
947 #define _NOT_BOR 0x01
948 #define _NOT_POR 0x02
949 #define _NOT_RI 0x04
950 #define _NOT_RMCLR 0x08
951 #define _STKUNF 0x40
952 #define _STKOVF 0x80
954 //==============================================================================
957 //==============================================================================
958 // WDTCON Bits
960 extern __at(0x0097) __sfr WDTCON;
962 typedef union
964 struct
966 unsigned SWDTEN : 1;
967 unsigned WDTPS0 : 1;
968 unsigned WDTPS1 : 1;
969 unsigned WDTPS2 : 1;
970 unsigned WDTPS3 : 1;
971 unsigned WDTPS4 : 1;
972 unsigned : 1;
973 unsigned : 1;
976 struct
978 unsigned : 1;
979 unsigned WDTPS : 5;
980 unsigned : 2;
982 } __WDTCONbits_t;
984 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
986 #define _SWDTEN 0x01
987 #define _WDTPS0 0x02
988 #define _WDTPS1 0x04
989 #define _WDTPS2 0x08
990 #define _WDTPS3 0x10
991 #define _WDTPS4 0x20
993 //==============================================================================
996 //==============================================================================
997 // OSCTUNE Bits
999 extern __at(0x0098) __sfr OSCTUNE;
1001 typedef union
1003 struct
1005 unsigned TUN0 : 1;
1006 unsigned TUN1 : 1;
1007 unsigned TUN2 : 1;
1008 unsigned TUN3 : 1;
1009 unsigned TUN4 : 1;
1010 unsigned TUN5 : 1;
1011 unsigned : 1;
1012 unsigned : 1;
1015 struct
1017 unsigned TUN : 6;
1018 unsigned : 2;
1020 } __OSCTUNEbits_t;
1022 extern __at(0x0098) volatile __OSCTUNEbits_t OSCTUNEbits;
1024 #define _TUN0 0x01
1025 #define _TUN1 0x02
1026 #define _TUN2 0x04
1027 #define _TUN3 0x08
1028 #define _TUN4 0x10
1029 #define _TUN5 0x20
1031 //==============================================================================
1034 //==============================================================================
1035 // OSCCON Bits
1037 extern __at(0x0099) __sfr OSCCON;
1039 typedef union
1041 struct
1043 unsigned SCS0 : 1;
1044 unsigned SCS1 : 1;
1045 unsigned : 1;
1046 unsigned IRCF0 : 1;
1047 unsigned IRCF1 : 1;
1048 unsigned IRCF2 : 1;
1049 unsigned IRCF3 : 1;
1050 unsigned SPLLEN : 1;
1053 struct
1055 unsigned SCS : 2;
1056 unsigned : 6;
1059 struct
1061 unsigned : 3;
1062 unsigned IRCF : 4;
1063 unsigned : 1;
1065 } __OSCCONbits_t;
1067 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
1069 #define _SCS0 0x01
1070 #define _SCS1 0x02
1071 #define _IRCF0 0x08
1072 #define _IRCF1 0x10
1073 #define _IRCF2 0x20
1074 #define _IRCF3 0x40
1075 #define _SPLLEN 0x80
1077 //==============================================================================
1080 //==============================================================================
1081 // OSCSTAT Bits
1083 extern __at(0x009A) __sfr OSCSTAT;
1085 typedef struct
1087 unsigned HFIOFS : 1;
1088 unsigned LFIOFR : 1;
1089 unsigned MFIOFR : 1;
1090 unsigned HFIOFL : 1;
1091 unsigned HFIOFR : 1;
1092 unsigned OSTS : 1;
1093 unsigned PLLR : 1;
1094 unsigned T1OSCR : 1;
1095 } __OSCSTATbits_t;
1097 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
1099 #define _HFIOFS 0x01
1100 #define _LFIOFR 0x02
1101 #define _MFIOFR 0x04
1102 #define _HFIOFL 0x08
1103 #define _HFIOFR 0x10
1104 #define _OSTS 0x20
1105 #define _PLLR 0x40
1106 #define _T1OSCR 0x80
1108 //==============================================================================
1110 extern __at(0x009B) __sfr ADRES;
1111 extern __at(0x009B) __sfr ADRESL;
1112 extern __at(0x009C) __sfr ADRESH;
1114 //==============================================================================
1115 // ADCON0 Bits
1117 extern __at(0x009D) __sfr ADCON0;
1119 typedef union
1121 struct
1123 unsigned ADON : 1;
1124 unsigned GO_NOT_DONE : 1;
1125 unsigned CHS0 : 1;
1126 unsigned CHS1 : 1;
1127 unsigned CHS2 : 1;
1128 unsigned CHS3 : 1;
1129 unsigned CHS4 : 1;
1130 unsigned : 1;
1133 struct
1135 unsigned : 1;
1136 unsigned ADGO : 1;
1137 unsigned : 1;
1138 unsigned : 1;
1139 unsigned : 1;
1140 unsigned : 1;
1141 unsigned : 1;
1142 unsigned : 1;
1145 struct
1147 unsigned : 1;
1148 unsigned GO : 1;
1149 unsigned : 1;
1150 unsigned : 1;
1151 unsigned : 1;
1152 unsigned : 1;
1153 unsigned : 1;
1154 unsigned : 1;
1157 struct
1159 unsigned : 2;
1160 unsigned CHS : 5;
1161 unsigned : 1;
1163 } __ADCON0bits_t;
1165 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1167 #define _ADON 0x01
1168 #define _GO_NOT_DONE 0x02
1169 #define _ADGO 0x02
1170 #define _GO 0x02
1171 #define _CHS0 0x04
1172 #define _CHS1 0x08
1173 #define _CHS2 0x10
1174 #define _CHS3 0x20
1175 #define _CHS4 0x40
1177 //==============================================================================
1180 //==============================================================================
1181 // ADCON1 Bits
1183 extern __at(0x009E) __sfr ADCON1;
1185 typedef union
1187 struct
1189 unsigned ADPREF0 : 1;
1190 unsigned ADPREF1 : 1;
1191 unsigned ADNREF : 1;
1192 unsigned : 1;
1193 unsigned ADCS0 : 1;
1194 unsigned ADCS1 : 1;
1195 unsigned ADCS2 : 1;
1196 unsigned ADFM : 1;
1199 struct
1201 unsigned ADPREF : 2;
1202 unsigned : 6;
1205 struct
1207 unsigned : 4;
1208 unsigned ADCS : 3;
1209 unsigned : 1;
1211 } __ADCON1bits_t;
1213 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1215 #define _ADPREF0 0x01
1216 #define _ADPREF1 0x02
1217 #define _ADNREF 0x04
1218 #define _ADCS0 0x10
1219 #define _ADCS1 0x20
1220 #define _ADCS2 0x40
1221 #define _ADFM 0x80
1223 //==============================================================================
1226 //==============================================================================
1227 // LATA Bits
1229 extern __at(0x010C) __sfr LATA;
1231 typedef struct
1233 unsigned LATA0 : 1;
1234 unsigned LATA1 : 1;
1235 unsigned LATA2 : 1;
1236 unsigned : 1;
1237 unsigned LATA4 : 1;
1238 unsigned LATA5 : 1;
1239 unsigned : 1;
1240 unsigned : 1;
1241 } __LATAbits_t;
1243 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1245 #define _LATA0 0x01
1246 #define _LATA1 0x02
1247 #define _LATA2 0x04
1248 #define _LATA4 0x10
1249 #define _LATA5 0x20
1251 //==============================================================================
1254 //==============================================================================
1255 // LATC Bits
1257 extern __at(0x010E) __sfr LATC;
1259 typedef union
1261 struct
1263 unsigned LATC0 : 1;
1264 unsigned LATC1 : 1;
1265 unsigned LATC2 : 1;
1266 unsigned LATC3 : 1;
1267 unsigned LATC4 : 1;
1268 unsigned LATC5 : 1;
1269 unsigned : 1;
1270 unsigned : 1;
1273 struct
1275 unsigned LATC : 6;
1276 unsigned : 2;
1278 } __LATCbits_t;
1280 extern __at(0x010E) volatile __LATCbits_t LATCbits;
1282 #define _LATC0 0x01
1283 #define _LATC1 0x02
1284 #define _LATC2 0x04
1285 #define _LATC3 0x08
1286 #define _LATC4 0x10
1287 #define _LATC5 0x20
1289 //==============================================================================
1292 //==============================================================================
1293 // CM1CON0 Bits
1295 extern __at(0x0111) __sfr CM1CON0;
1297 typedef struct
1299 unsigned C1SYNC : 1;
1300 unsigned C1HYS : 1;
1301 unsigned C1SP : 1;
1302 unsigned : 1;
1303 unsigned C1POL : 1;
1304 unsigned C1OE : 1;
1305 unsigned C1OUT : 1;
1306 unsigned C1ON : 1;
1307 } __CM1CON0bits_t;
1309 extern __at(0x0111) volatile __CM1CON0bits_t CM1CON0bits;
1311 #define _C1SYNC 0x01
1312 #define _C1HYS 0x02
1313 #define _C1SP 0x04
1314 #define _C1POL 0x10
1315 #define _C1OE 0x20
1316 #define _C1OUT 0x40
1317 #define _C1ON 0x80
1319 //==============================================================================
1322 //==============================================================================
1323 // CM1CON1 Bits
1325 extern __at(0x0112) __sfr CM1CON1;
1327 typedef union
1329 struct
1331 unsigned C1NCH0 : 1;
1332 unsigned C1NCH1 : 1;
1333 unsigned : 1;
1334 unsigned : 1;
1335 unsigned C1PCH0 : 1;
1336 unsigned C1PCH1 : 1;
1337 unsigned C1INTN : 1;
1338 unsigned C1INTP : 1;
1341 struct
1343 unsigned C1NCH : 2;
1344 unsigned : 6;
1347 struct
1349 unsigned : 4;
1350 unsigned C1PCH : 2;
1351 unsigned : 2;
1353 } __CM1CON1bits_t;
1355 extern __at(0x0112) volatile __CM1CON1bits_t CM1CON1bits;
1357 #define _C1NCH0 0x01
1358 #define _C1NCH1 0x02
1359 #define _C1PCH0 0x10
1360 #define _C1PCH1 0x20
1361 #define _C1INTN 0x40
1362 #define _C1INTP 0x80
1364 //==============================================================================
1367 //==============================================================================
1368 // CM2CON0 Bits
1370 extern __at(0x0113) __sfr CM2CON0;
1372 typedef struct
1374 unsigned C2SYNC : 1;
1375 unsigned C2HYS : 1;
1376 unsigned C2SP : 1;
1377 unsigned : 1;
1378 unsigned C2POL : 1;
1379 unsigned C2OE : 1;
1380 unsigned C2OUT : 1;
1381 unsigned C2ON : 1;
1382 } __CM2CON0bits_t;
1384 extern __at(0x0113) volatile __CM2CON0bits_t CM2CON0bits;
1386 #define _C2SYNC 0x01
1387 #define _C2HYS 0x02
1388 #define _C2SP 0x04
1389 #define _C2POL 0x10
1390 #define _C2OE 0x20
1391 #define _C2OUT 0x40
1392 #define _C2ON 0x80
1394 //==============================================================================
1397 //==============================================================================
1398 // CM2CON1 Bits
1400 extern __at(0x0114) __sfr CM2CON1;
1402 typedef union
1404 struct
1406 unsigned C2NCH0 : 1;
1407 unsigned C2NCH1 : 1;
1408 unsigned : 1;
1409 unsigned : 1;
1410 unsigned C2PCH0 : 1;
1411 unsigned C2PCH1 : 1;
1412 unsigned C2INTN : 1;
1413 unsigned C2INTP : 1;
1416 struct
1418 unsigned C2NCH : 2;
1419 unsigned : 6;
1422 struct
1424 unsigned : 4;
1425 unsigned C2PCH : 2;
1426 unsigned : 2;
1428 } __CM2CON1bits_t;
1430 extern __at(0x0114) volatile __CM2CON1bits_t CM2CON1bits;
1432 #define _C2NCH0 0x01
1433 #define _C2NCH1 0x02
1434 #define _C2PCH0 0x10
1435 #define _C2PCH1 0x20
1436 #define _C2INTN 0x40
1437 #define _C2INTP 0x80
1439 //==============================================================================
1442 //==============================================================================
1443 // CMOUT Bits
1445 extern __at(0x0115) __sfr CMOUT;
1447 typedef struct
1449 unsigned MC1OUT : 1;
1450 unsigned MC2OUT : 1;
1451 unsigned : 1;
1452 unsigned : 1;
1453 unsigned : 1;
1454 unsigned : 1;
1455 unsigned : 1;
1456 unsigned : 1;
1457 } __CMOUTbits_t;
1459 extern __at(0x0115) volatile __CMOUTbits_t CMOUTbits;
1461 #define _MC1OUT 0x01
1462 #define _MC2OUT 0x02
1464 //==============================================================================
1467 //==============================================================================
1468 // BORCON Bits
1470 extern __at(0x0116) __sfr BORCON;
1472 typedef struct
1474 unsigned BORRDY : 1;
1475 unsigned : 1;
1476 unsigned : 1;
1477 unsigned : 1;
1478 unsigned : 1;
1479 unsigned : 1;
1480 unsigned : 1;
1481 unsigned SBOREN : 1;
1482 } __BORCONbits_t;
1484 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1486 #define _BORRDY 0x01
1487 #define _SBOREN 0x80
1489 //==============================================================================
1492 //==============================================================================
1493 // FVRCON Bits
1495 extern __at(0x0117) __sfr FVRCON;
1497 typedef union
1499 struct
1501 unsigned ADFVR0 : 1;
1502 unsigned ADFVR1 : 1;
1503 unsigned CDAFVR0 : 1;
1504 unsigned CDAFVR1 : 1;
1505 unsigned TSRNG : 1;
1506 unsigned TSEN : 1;
1507 unsigned FVRRDY : 1;
1508 unsigned FVREN : 1;
1511 struct
1513 unsigned ADFVR : 2;
1514 unsigned : 6;
1517 struct
1519 unsigned : 2;
1520 unsigned CDAFVR : 2;
1521 unsigned : 4;
1523 } __FVRCONbits_t;
1525 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1527 #define _ADFVR0 0x01
1528 #define _ADFVR1 0x02
1529 #define _CDAFVR0 0x04
1530 #define _CDAFVR1 0x08
1531 #define _TSRNG 0x10
1532 #define _TSEN 0x20
1533 #define _FVRRDY 0x40
1534 #define _FVREN 0x80
1536 //==============================================================================
1539 //==============================================================================
1540 // DACCON0 Bits
1542 extern __at(0x0118) __sfr DACCON0;
1544 typedef union
1546 struct
1548 unsigned DACNSS : 1;
1549 unsigned : 1;
1550 unsigned DACPSS0 : 1;
1551 unsigned DACPSS1 : 1;
1552 unsigned : 1;
1553 unsigned DACOE : 1;
1554 unsigned DACLPS : 1;
1555 unsigned DACEN : 1;
1558 struct
1560 unsigned : 2;
1561 unsigned DACPSS : 2;
1562 unsigned : 4;
1564 } __DACCON0bits_t;
1566 extern __at(0x0118) volatile __DACCON0bits_t DACCON0bits;
1568 #define _DACNSS 0x01
1569 #define _DACPSS0 0x04
1570 #define _DACPSS1 0x08
1571 #define _DACOE 0x20
1572 #define _DACLPS 0x40
1573 #define _DACEN 0x80
1575 //==============================================================================
1578 //==============================================================================
1579 // DACCON1 Bits
1581 extern __at(0x0119) __sfr DACCON1;
1583 typedef union
1585 struct
1587 unsigned DACR0 : 1;
1588 unsigned DACR1 : 1;
1589 unsigned DACR2 : 1;
1590 unsigned DACR3 : 1;
1591 unsigned DACR4 : 1;
1592 unsigned : 1;
1593 unsigned : 1;
1594 unsigned : 1;
1597 struct
1599 unsigned DACR : 5;
1600 unsigned : 3;
1602 } __DACCON1bits_t;
1604 extern __at(0x0119) volatile __DACCON1bits_t DACCON1bits;
1606 #define _DACR0 0x01
1607 #define _DACR1 0x02
1608 #define _DACR2 0x04
1609 #define _DACR3 0x08
1610 #define _DACR4 0x10
1612 //==============================================================================
1615 //==============================================================================
1616 // SRCON0 Bits
1618 extern __at(0x011A) __sfr SRCON0;
1620 typedef union
1622 struct
1624 unsigned SRPR : 1;
1625 unsigned SRPS : 1;
1626 unsigned SRNQEN : 1;
1627 unsigned SRQEN : 1;
1628 unsigned SRCLK0 : 1;
1629 unsigned SRCLK1 : 1;
1630 unsigned SRCLK2 : 1;
1631 unsigned SRLEN : 1;
1634 struct
1636 unsigned : 4;
1637 unsigned SRCLK : 3;
1638 unsigned : 1;
1640 } __SRCON0bits_t;
1642 extern __at(0x011A) volatile __SRCON0bits_t SRCON0bits;
1644 #define _SRPR 0x01
1645 #define _SRPS 0x02
1646 #define _SRNQEN 0x04
1647 #define _SRQEN 0x08
1648 #define _SRCLK0 0x10
1649 #define _SRCLK1 0x20
1650 #define _SRCLK2 0x40
1651 #define _SRLEN 0x80
1653 //==============================================================================
1656 //==============================================================================
1657 // SRCON1 Bits
1659 extern __at(0x011B) __sfr SRCON1;
1661 typedef struct
1663 unsigned SRRC1E : 1;
1664 unsigned SRRC2E : 1;
1665 unsigned SRRCKE : 1;
1666 unsigned SRRPE : 1;
1667 unsigned SRSC1E : 1;
1668 unsigned SRSC2E : 1;
1669 unsigned SRSCKE : 1;
1670 unsigned SRSPE : 1;
1671 } __SRCON1bits_t;
1673 extern __at(0x011B) volatile __SRCON1bits_t SRCON1bits;
1675 #define _SRRC1E 0x01
1676 #define _SRRC2E 0x02
1677 #define _SRRCKE 0x04
1678 #define _SRRPE 0x08
1679 #define _SRSC1E 0x10
1680 #define _SRSC2E 0x20
1681 #define _SRSCKE 0x40
1682 #define _SRSPE 0x80
1684 //==============================================================================
1687 //==============================================================================
1688 // APFCON0 Bits
1690 extern __at(0x011D) __sfr APFCON0;
1692 typedef union
1694 struct
1696 unsigned : 1;
1697 unsigned : 1;
1698 unsigned TXCKSEL : 1;
1699 unsigned T1GSEL : 1;
1700 unsigned : 1;
1701 unsigned SSSEL : 1;
1702 unsigned SDOSEL : 1;
1703 unsigned RXDTSEL : 1;
1706 struct
1708 unsigned : 1;
1709 unsigned : 1;
1710 unsigned : 1;
1711 unsigned : 1;
1712 unsigned : 1;
1713 unsigned SS1SEL : 1;
1714 unsigned SDO1SEL : 1;
1715 unsigned : 1;
1717 } __APFCON0bits_t;
1719 extern __at(0x011D) volatile __APFCON0bits_t APFCON0bits;
1721 #define _TXCKSEL 0x04
1722 #define _T1GSEL 0x08
1723 #define _SSSEL 0x20
1724 #define _SS1SEL 0x20
1725 #define _SDOSEL 0x40
1726 #define _SDO1SEL 0x40
1727 #define _RXDTSEL 0x80
1729 //==============================================================================
1732 //==============================================================================
1733 // APFCON1 Bits
1735 extern __at(0x011E) __sfr APFCON1;
1737 typedef struct
1739 unsigned CCP2SEL : 1;
1740 unsigned P2BSEL : 1;
1741 unsigned P1CSEL : 1;
1742 unsigned P1DSEL : 1;
1743 unsigned : 1;
1744 unsigned : 1;
1745 unsigned : 1;
1746 unsigned : 1;
1747 } __APFCON1bits_t;
1749 extern __at(0x011E) volatile __APFCON1bits_t APFCON1bits;
1751 #define _CCP2SEL 0x01
1752 #define _P2BSEL 0x02
1753 #define _P1CSEL 0x04
1754 #define _P1DSEL 0x08
1756 //==============================================================================
1759 //==============================================================================
1760 // ANSELA Bits
1762 extern __at(0x018C) __sfr ANSELA;
1764 typedef struct
1766 unsigned ANSA0 : 1;
1767 unsigned ANSA1 : 1;
1768 unsigned ANSA2 : 1;
1769 unsigned : 1;
1770 unsigned ANSA4 : 1;
1771 unsigned : 1;
1772 unsigned : 1;
1773 unsigned : 1;
1774 } __ANSELAbits_t;
1776 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1778 #define _ANSA0 0x01
1779 #define _ANSA1 0x02
1780 #define _ANSA2 0x04
1781 #define _ANSA4 0x10
1783 //==============================================================================
1786 //==============================================================================
1787 // ANSELC Bits
1789 extern __at(0x018E) __sfr ANSELC;
1791 typedef union
1793 struct
1795 unsigned ANSC0 : 1;
1796 unsigned ANSC1 : 1;
1797 unsigned ANSC2 : 1;
1798 unsigned ANSC3 : 1;
1799 unsigned : 1;
1800 unsigned : 1;
1801 unsigned : 1;
1802 unsigned : 1;
1805 struct
1807 unsigned ANSC : 4;
1808 unsigned : 4;
1810 } __ANSELCbits_t;
1812 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits;
1814 #define _ANSC0 0x01
1815 #define _ANSC1 0x02
1816 #define _ANSC2 0x04
1817 #define _ANSC3 0x08
1819 //==============================================================================
1821 extern __at(0x0191) __sfr EEADR;
1822 extern __at(0x0191) __sfr EEADRL;
1823 extern __at(0x0192) __sfr EEADRH;
1824 extern __at(0x0193) __sfr EEDAT;
1825 extern __at(0x0193) __sfr EEDATL;
1826 extern __at(0x0194) __sfr EEDATH;
1828 //==============================================================================
1829 // EECON1 Bits
1831 extern __at(0x0195) __sfr EECON1;
1833 typedef struct
1835 unsigned RD : 1;
1836 unsigned WR : 1;
1837 unsigned WREN : 1;
1838 unsigned WRERR : 1;
1839 unsigned FREE : 1;
1840 unsigned LWLO : 1;
1841 unsigned CFGS : 1;
1842 unsigned EEPGD : 1;
1843 } __EECON1bits_t;
1845 extern __at(0x0195) volatile __EECON1bits_t EECON1bits;
1847 #define _RD 0x01
1848 #define _WR 0x02
1849 #define _WREN 0x04
1850 #define _WRERR 0x08
1851 #define _FREE 0x10
1852 #define _LWLO 0x20
1853 #define _CFGS 0x40
1854 #define _EEPGD 0x80
1856 //==============================================================================
1858 extern __at(0x0196) __sfr EECON2;
1859 extern __at(0x0199) __sfr RCREG;
1860 extern __at(0x019A) __sfr TXREG;
1861 extern __at(0x019B) __sfr SP1BRG;
1862 extern __at(0x019B) __sfr SP1BRGL;
1863 extern __at(0x019B) __sfr SPBRG;
1864 extern __at(0x019B) __sfr SPBRGL;
1865 extern __at(0x019C) __sfr SP1BRGH;
1866 extern __at(0x019C) __sfr SPBRGH;
1868 //==============================================================================
1869 // RCSTA Bits
1871 extern __at(0x019D) __sfr RCSTA;
1873 typedef struct
1875 unsigned RX9D : 1;
1876 unsigned OERR : 1;
1877 unsigned FERR : 1;
1878 unsigned ADDEN : 1;
1879 unsigned CREN : 1;
1880 unsigned SREN : 1;
1881 unsigned RX9 : 1;
1882 unsigned SPEN : 1;
1883 } __RCSTAbits_t;
1885 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
1887 #define _RX9D 0x01
1888 #define _OERR 0x02
1889 #define _FERR 0x04
1890 #define _ADDEN 0x08
1891 #define _CREN 0x10
1892 #define _SREN 0x20
1893 #define _RX9 0x40
1894 #define _SPEN 0x80
1896 //==============================================================================
1899 //==============================================================================
1900 // TXSTA Bits
1902 extern __at(0x019E) __sfr TXSTA;
1904 typedef struct
1906 unsigned TX9D : 1;
1907 unsigned TRMT : 1;
1908 unsigned BRGH : 1;
1909 unsigned SENDB : 1;
1910 unsigned SYNC : 1;
1911 unsigned TXEN : 1;
1912 unsigned TX9 : 1;
1913 unsigned CSRC : 1;
1914 } __TXSTAbits_t;
1916 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
1918 #define _TX9D 0x01
1919 #define _TRMT 0x02
1920 #define _BRGH 0x04
1921 #define _SENDB 0x08
1922 #define _SYNC 0x10
1923 #define _TXEN 0x20
1924 #define _TX9 0x40
1925 #define _CSRC 0x80
1927 //==============================================================================
1930 //==============================================================================
1931 // BAUDCON Bits
1933 extern __at(0x019F) __sfr BAUDCON;
1935 typedef struct
1937 unsigned ABDEN : 1;
1938 unsigned WUE : 1;
1939 unsigned : 1;
1940 unsigned BRG16 : 1;
1941 unsigned SCKP : 1;
1942 unsigned : 1;
1943 unsigned RCIDL : 1;
1944 unsigned ABDOVF : 1;
1945 } __BAUDCONbits_t;
1947 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
1949 #define _ABDEN 0x01
1950 #define _WUE 0x02
1951 #define _BRG16 0x08
1952 #define _SCKP 0x10
1953 #define _RCIDL 0x40
1954 #define _ABDOVF 0x80
1956 //==============================================================================
1959 //==============================================================================
1960 // WPUA Bits
1962 extern __at(0x020C) __sfr WPUA;
1964 typedef union
1966 struct
1968 unsigned WPUA0 : 1;
1969 unsigned WPUA1 : 1;
1970 unsigned WPUA2 : 1;
1971 unsigned WPUA3 : 1;
1972 unsigned WPUA4 : 1;
1973 unsigned WPUA5 : 1;
1974 unsigned : 1;
1975 unsigned : 1;
1978 struct
1980 unsigned WPUA : 6;
1981 unsigned : 2;
1983 } __WPUAbits_t;
1985 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
1987 #define _WPUA0 0x01
1988 #define _WPUA1 0x02
1989 #define _WPUA2 0x04
1990 #define _WPUA3 0x08
1991 #define _WPUA4 0x10
1992 #define _WPUA5 0x20
1994 //==============================================================================
1997 //==============================================================================
1998 // WPUC Bits
2000 extern __at(0x020E) __sfr WPUC;
2002 typedef union
2004 struct
2006 unsigned WPUC0 : 1;
2007 unsigned WPUC1 : 1;
2008 unsigned WPUC2 : 1;
2009 unsigned WPUC3 : 1;
2010 unsigned WPUC4 : 1;
2011 unsigned WPUC5 : 1;
2012 unsigned : 1;
2013 unsigned : 1;
2016 struct
2018 unsigned WPUC : 6;
2019 unsigned : 2;
2021 } __WPUCbits_t;
2023 extern __at(0x020E) volatile __WPUCbits_t WPUCbits;
2025 #define _WPUC0 0x01
2026 #define _WPUC1 0x02
2027 #define _WPUC2 0x04
2028 #define _WPUC3 0x08
2029 #define _WPUC4 0x10
2030 #define _WPUC5 0x20
2032 //==============================================================================
2034 extern __at(0x0211) __sfr SSP1BUF;
2035 extern __at(0x0211) __sfr SSPBUF;
2036 extern __at(0x0212) __sfr SSP1ADD;
2037 extern __at(0x0212) __sfr SSPADD;
2038 extern __at(0x0213) __sfr SSP1MSK;
2039 extern __at(0x0213) __sfr SSPMSK;
2041 //==============================================================================
2042 // SSP1STAT Bits
2044 extern __at(0x0214) __sfr SSP1STAT;
2046 typedef struct
2048 unsigned BF : 1;
2049 unsigned UA : 1;
2050 unsigned R_NOT_W : 1;
2051 unsigned S : 1;
2052 unsigned P : 1;
2053 unsigned D_NOT_A : 1;
2054 unsigned CKE : 1;
2055 unsigned SMP : 1;
2056 } __SSP1STATbits_t;
2058 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
2060 #define _BF 0x01
2061 #define _UA 0x02
2062 #define _R_NOT_W 0x04
2063 #define _S 0x08
2064 #define _P 0x10
2065 #define _D_NOT_A 0x20
2066 #define _CKE 0x40
2067 #define _SMP 0x80
2069 //==============================================================================
2072 //==============================================================================
2073 // SSPSTAT Bits
2075 extern __at(0x0214) __sfr SSPSTAT;
2077 typedef struct
2079 unsigned BF : 1;
2080 unsigned UA : 1;
2081 unsigned R_NOT_W : 1;
2082 unsigned S : 1;
2083 unsigned P : 1;
2084 unsigned D_NOT_A : 1;
2085 unsigned CKE : 1;
2086 unsigned SMP : 1;
2087 } __SSPSTATbits_t;
2089 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
2091 #define _SSPSTAT_BF 0x01
2092 #define _SSPSTAT_UA 0x02
2093 #define _SSPSTAT_R_NOT_W 0x04
2094 #define _SSPSTAT_S 0x08
2095 #define _SSPSTAT_P 0x10
2096 #define _SSPSTAT_D_NOT_A 0x20
2097 #define _SSPSTAT_CKE 0x40
2098 #define _SSPSTAT_SMP 0x80
2100 //==============================================================================
2103 //==============================================================================
2104 // SSP1CON Bits
2106 extern __at(0x0215) __sfr SSP1CON;
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 } __SSP1CONbits_t;
2129 extern __at(0x0215) volatile __SSP1CONbits_t SSP1CONbits;
2131 #define _SSPM0 0x01
2132 #define _SSPM1 0x02
2133 #define _SSPM2 0x04
2134 #define _SSPM3 0x08
2135 #define _CKP 0x10
2136 #define _SSPEN 0x20
2137 #define _SSPOV 0x40
2138 #define _WCOL 0x80
2140 //==============================================================================
2143 //==============================================================================
2144 // SSP1CON1 Bits
2146 extern __at(0x0215) __sfr SSP1CON1;
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 } __SSP1CON1bits_t;
2169 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
2171 #define _SSP1CON1_SSPM0 0x01
2172 #define _SSP1CON1_SSPM1 0x02
2173 #define _SSP1CON1_SSPM2 0x04
2174 #define _SSP1CON1_SSPM3 0x08
2175 #define _SSP1CON1_CKP 0x10
2176 #define _SSP1CON1_SSPEN 0x20
2177 #define _SSP1CON1_SSPOV 0x40
2178 #define _SSP1CON1_WCOL 0x80
2180 //==============================================================================
2183 //==============================================================================
2184 // SSPCON Bits
2186 extern __at(0x0215) __sfr SSPCON;
2188 typedef union
2190 struct
2192 unsigned SSPM0 : 1;
2193 unsigned SSPM1 : 1;
2194 unsigned SSPM2 : 1;
2195 unsigned SSPM3 : 1;
2196 unsigned CKP : 1;
2197 unsigned SSPEN : 1;
2198 unsigned SSPOV : 1;
2199 unsigned WCOL : 1;
2202 struct
2204 unsigned SSPM : 4;
2205 unsigned : 4;
2207 } __SSPCONbits_t;
2209 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
2211 #define _SSPCON_SSPM0 0x01
2212 #define _SSPCON_SSPM1 0x02
2213 #define _SSPCON_SSPM2 0x04
2214 #define _SSPCON_SSPM3 0x08
2215 #define _SSPCON_CKP 0x10
2216 #define _SSPCON_SSPEN 0x20
2217 #define _SSPCON_SSPOV 0x40
2218 #define _SSPCON_WCOL 0x80
2220 //==============================================================================
2223 //==============================================================================
2224 // SSPCON1 Bits
2226 extern __at(0x0215) __sfr SSPCON1;
2228 typedef union
2230 struct
2232 unsigned SSPM0 : 1;
2233 unsigned SSPM1 : 1;
2234 unsigned SSPM2 : 1;
2235 unsigned SSPM3 : 1;
2236 unsigned CKP : 1;
2237 unsigned SSPEN : 1;
2238 unsigned SSPOV : 1;
2239 unsigned WCOL : 1;
2242 struct
2244 unsigned SSPM : 4;
2245 unsigned : 4;
2247 } __SSPCON1bits_t;
2249 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
2251 #define _SSPCON1_SSPM0 0x01
2252 #define _SSPCON1_SSPM1 0x02
2253 #define _SSPCON1_SSPM2 0x04
2254 #define _SSPCON1_SSPM3 0x08
2255 #define _SSPCON1_CKP 0x10
2256 #define _SSPCON1_SSPEN 0x20
2257 #define _SSPCON1_SSPOV 0x40
2258 #define _SSPCON1_WCOL 0x80
2260 //==============================================================================
2263 //==============================================================================
2264 // SSP1CON2 Bits
2266 extern __at(0x0216) __sfr SSP1CON2;
2268 typedef struct
2270 unsigned SEN : 1;
2271 unsigned RSEN : 1;
2272 unsigned PEN : 1;
2273 unsigned RCEN : 1;
2274 unsigned ACKEN : 1;
2275 unsigned ACKDT : 1;
2276 unsigned ACKSTAT : 1;
2277 unsigned GCEN : 1;
2278 } __SSP1CON2bits_t;
2280 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
2282 #define _SEN 0x01
2283 #define _RSEN 0x02
2284 #define _PEN 0x04
2285 #define _RCEN 0x08
2286 #define _ACKEN 0x10
2287 #define _ACKDT 0x20
2288 #define _ACKSTAT 0x40
2289 #define _GCEN 0x80
2291 //==============================================================================
2294 //==============================================================================
2295 // SSPCON2 Bits
2297 extern __at(0x0216) __sfr SSPCON2;
2299 typedef struct
2301 unsigned SEN : 1;
2302 unsigned RSEN : 1;
2303 unsigned PEN : 1;
2304 unsigned RCEN : 1;
2305 unsigned ACKEN : 1;
2306 unsigned ACKDT : 1;
2307 unsigned ACKSTAT : 1;
2308 unsigned GCEN : 1;
2309 } __SSPCON2bits_t;
2311 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
2313 #define _SSPCON2_SEN 0x01
2314 #define _SSPCON2_RSEN 0x02
2315 #define _SSPCON2_PEN 0x04
2316 #define _SSPCON2_RCEN 0x08
2317 #define _SSPCON2_ACKEN 0x10
2318 #define _SSPCON2_ACKDT 0x20
2319 #define _SSPCON2_ACKSTAT 0x40
2320 #define _SSPCON2_GCEN 0x80
2322 //==============================================================================
2325 //==============================================================================
2326 // SSP1CON3 Bits
2328 extern __at(0x0217) __sfr SSP1CON3;
2330 typedef struct
2332 unsigned DHEN : 1;
2333 unsigned AHEN : 1;
2334 unsigned SBCDE : 1;
2335 unsigned SDAHT : 1;
2336 unsigned BOEN : 1;
2337 unsigned SCIE : 1;
2338 unsigned PCIE : 1;
2339 unsigned ACKTIM : 1;
2340 } __SSP1CON3bits_t;
2342 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
2344 #define _DHEN 0x01
2345 #define _AHEN 0x02
2346 #define _SBCDE 0x04
2347 #define _SDAHT 0x08
2348 #define _BOEN 0x10
2349 #define _SCIE 0x20
2350 #define _PCIE 0x40
2351 #define _ACKTIM 0x80
2353 //==============================================================================
2356 //==============================================================================
2357 // SSPCON3 Bits
2359 extern __at(0x0217) __sfr SSPCON3;
2361 typedef struct
2363 unsigned DHEN : 1;
2364 unsigned AHEN : 1;
2365 unsigned SBCDE : 1;
2366 unsigned SDAHT : 1;
2367 unsigned BOEN : 1;
2368 unsigned SCIE : 1;
2369 unsigned PCIE : 1;
2370 unsigned ACKTIM : 1;
2371 } __SSPCON3bits_t;
2373 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
2375 #define _SSPCON3_DHEN 0x01
2376 #define _SSPCON3_AHEN 0x02
2377 #define _SSPCON3_SBCDE 0x04
2378 #define _SSPCON3_SDAHT 0x08
2379 #define _SSPCON3_BOEN 0x10
2380 #define _SSPCON3_SCIE 0x20
2381 #define _SSPCON3_PCIE 0x40
2382 #define _SSPCON3_ACKTIM 0x80
2384 //==============================================================================
2386 extern __at(0x0291) __sfr CCPR1;
2387 extern __at(0x0291) __sfr CCPR1L;
2388 extern __at(0x0292) __sfr CCPR1H;
2390 //==============================================================================
2391 // CCP1CON Bits
2393 extern __at(0x0293) __sfr CCP1CON;
2395 typedef union
2397 struct
2399 unsigned CCP1M0 : 1;
2400 unsigned CCP1M1 : 1;
2401 unsigned CCP1M2 : 1;
2402 unsigned CCP1M3 : 1;
2403 unsigned DC1B0 : 1;
2404 unsigned DC1B1 : 1;
2405 unsigned P1M0 : 1;
2406 unsigned P1M1 : 1;
2409 struct
2411 unsigned CCP1M : 4;
2412 unsigned : 4;
2415 struct
2417 unsigned : 4;
2418 unsigned DC1B : 2;
2419 unsigned : 2;
2422 struct
2424 unsigned : 6;
2425 unsigned P1M : 2;
2427 } __CCP1CONbits_t;
2429 extern __at(0x0293) volatile __CCP1CONbits_t CCP1CONbits;
2431 #define _CCP1M0 0x01
2432 #define _CCP1M1 0x02
2433 #define _CCP1M2 0x04
2434 #define _CCP1M3 0x08
2435 #define _DC1B0 0x10
2436 #define _DC1B1 0x20
2437 #define _P1M0 0x40
2438 #define _P1M1 0x80
2440 //==============================================================================
2443 //==============================================================================
2444 // PWM1CON Bits
2446 extern __at(0x0294) __sfr PWM1CON;
2448 typedef union
2450 struct
2452 unsigned P1DC0 : 1;
2453 unsigned P1DC1 : 1;
2454 unsigned P1DC2 : 1;
2455 unsigned P1DC3 : 1;
2456 unsigned P1DC4 : 1;
2457 unsigned P1DC5 : 1;
2458 unsigned P1DC6 : 1;
2459 unsigned P1RSEN : 1;
2462 struct
2464 unsigned P1DC : 7;
2465 unsigned : 1;
2467 } __PWM1CONbits_t;
2469 extern __at(0x0294) volatile __PWM1CONbits_t PWM1CONbits;
2471 #define _P1DC0 0x01
2472 #define _P1DC1 0x02
2473 #define _P1DC2 0x04
2474 #define _P1DC3 0x08
2475 #define _P1DC4 0x10
2476 #define _P1DC5 0x20
2477 #define _P1DC6 0x40
2478 #define _P1RSEN 0x80
2480 //==============================================================================
2483 //==============================================================================
2484 // CCP1AS Bits
2486 extern __at(0x0295) __sfr CCP1AS;
2488 typedef union
2490 struct
2492 unsigned PSS1BD0 : 1;
2493 unsigned PSS1BD1 : 1;
2494 unsigned PSS1AC0 : 1;
2495 unsigned PSS1AC1 : 1;
2496 unsigned CCP1AS0 : 1;
2497 unsigned CCP1AS1 : 1;
2498 unsigned CCP1AS2 : 1;
2499 unsigned CCP1ASE : 1;
2502 struct
2504 unsigned PSS1BD : 2;
2505 unsigned : 6;
2508 struct
2510 unsigned : 2;
2511 unsigned PSS1AC : 2;
2512 unsigned : 4;
2515 struct
2517 unsigned : 4;
2518 unsigned CCP1AS : 3;
2519 unsigned : 1;
2521 } __CCP1ASbits_t;
2523 extern __at(0x0295) volatile __CCP1ASbits_t CCP1ASbits;
2525 #define _PSS1BD0 0x01
2526 #define _PSS1BD1 0x02
2527 #define _PSS1AC0 0x04
2528 #define _PSS1AC1 0x08
2529 #define _CCP1AS0 0x10
2530 #define _CCP1AS1 0x20
2531 #define _CCP1AS2 0x40
2532 #define _CCP1ASE 0x80
2534 //==============================================================================
2537 //==============================================================================
2538 // ECCP1AS Bits
2540 extern __at(0x0295) __sfr ECCP1AS;
2542 typedef union
2544 struct
2546 unsigned PSS1BD0 : 1;
2547 unsigned PSS1BD1 : 1;
2548 unsigned PSS1AC0 : 1;
2549 unsigned PSS1AC1 : 1;
2550 unsigned CCP1AS0 : 1;
2551 unsigned CCP1AS1 : 1;
2552 unsigned CCP1AS2 : 1;
2553 unsigned CCP1ASE : 1;
2556 struct
2558 unsigned PSS1BD : 2;
2559 unsigned : 6;
2562 struct
2564 unsigned : 2;
2565 unsigned PSS1AC : 2;
2566 unsigned : 4;
2569 struct
2571 unsigned : 4;
2572 unsigned CCP1AS : 3;
2573 unsigned : 1;
2575 } __ECCP1ASbits_t;
2577 extern __at(0x0295) volatile __ECCP1ASbits_t ECCP1ASbits;
2579 #define _ECCP1AS_PSS1BD0 0x01
2580 #define _ECCP1AS_PSS1BD1 0x02
2581 #define _ECCP1AS_PSS1AC0 0x04
2582 #define _ECCP1AS_PSS1AC1 0x08
2583 #define _ECCP1AS_CCP1AS0 0x10
2584 #define _ECCP1AS_CCP1AS1 0x20
2585 #define _ECCP1AS_CCP1AS2 0x40
2586 #define _ECCP1AS_CCP1ASE 0x80
2588 //==============================================================================
2591 //==============================================================================
2592 // PSTR1CON Bits
2594 extern __at(0x0296) __sfr PSTR1CON;
2596 typedef struct
2598 unsigned STR1A : 1;
2599 unsigned STR1B : 1;
2600 unsigned STR1C : 1;
2601 unsigned STR1D : 1;
2602 unsigned STR1SYNC : 1;
2603 unsigned : 1;
2604 unsigned : 1;
2605 unsigned : 1;
2606 } __PSTR1CONbits_t;
2608 extern __at(0x0296) volatile __PSTR1CONbits_t PSTR1CONbits;
2610 #define _STR1A 0x01
2611 #define _STR1B 0x02
2612 #define _STR1C 0x04
2613 #define _STR1D 0x08
2614 #define _STR1SYNC 0x10
2616 //==============================================================================
2618 extern __at(0x0298) __sfr CCPR2;
2619 extern __at(0x0298) __sfr CCPR2L;
2620 extern __at(0x0299) __sfr CCPR2H;
2622 //==============================================================================
2623 // CCP2CON Bits
2625 extern __at(0x029A) __sfr CCP2CON;
2627 typedef union
2629 struct
2631 unsigned CCP2M0 : 1;
2632 unsigned CCP2M1 : 1;
2633 unsigned CCP2M2 : 1;
2634 unsigned CCP2M3 : 1;
2635 unsigned DC2B0 : 1;
2636 unsigned DC2B1 : 1;
2637 unsigned P2M0 : 1;
2638 unsigned P2M1 : 1;
2641 struct
2643 unsigned CCP2M : 4;
2644 unsigned : 4;
2647 struct
2649 unsigned : 4;
2650 unsigned DC2B : 2;
2651 unsigned : 2;
2654 struct
2656 unsigned : 6;
2657 unsigned P2M : 2;
2659 } __CCP2CONbits_t;
2661 extern __at(0x029A) volatile __CCP2CONbits_t CCP2CONbits;
2663 #define _CCP2M0 0x01
2664 #define _CCP2M1 0x02
2665 #define _CCP2M2 0x04
2666 #define _CCP2M3 0x08
2667 #define _DC2B0 0x10
2668 #define _DC2B1 0x20
2669 #define _P2M0 0x40
2670 #define _P2M1 0x80
2672 //==============================================================================
2675 //==============================================================================
2676 // PWM2CON Bits
2678 extern __at(0x029B) __sfr PWM2CON;
2680 typedef union
2682 struct
2684 unsigned P2DC0 : 1;
2685 unsigned P2DC1 : 1;
2686 unsigned P2DC2 : 1;
2687 unsigned P2DC3 : 1;
2688 unsigned P2DC4 : 1;
2689 unsigned P2DC5 : 1;
2690 unsigned P2DC6 : 1;
2691 unsigned P2RSEN : 1;
2694 struct
2696 unsigned P2DC : 7;
2697 unsigned : 1;
2699 } __PWM2CONbits_t;
2701 extern __at(0x029B) volatile __PWM2CONbits_t PWM2CONbits;
2703 #define _P2DC0 0x01
2704 #define _P2DC1 0x02
2705 #define _P2DC2 0x04
2706 #define _P2DC3 0x08
2707 #define _P2DC4 0x10
2708 #define _P2DC5 0x20
2709 #define _P2DC6 0x40
2710 #define _P2RSEN 0x80
2712 //==============================================================================
2715 //==============================================================================
2716 // CCP2AS Bits
2718 extern __at(0x029C) __sfr CCP2AS;
2720 typedef union
2722 struct
2724 unsigned PSS2BD0 : 1;
2725 unsigned PSS2BD1 : 1;
2726 unsigned PSS2AC0 : 1;
2727 unsigned PSS2AC1 : 1;
2728 unsigned CCP2AS0 : 1;
2729 unsigned CCP2AS1 : 1;
2730 unsigned CCP2AS2 : 1;
2731 unsigned CCP2ASE : 1;
2734 struct
2736 unsigned PSS2BD : 2;
2737 unsigned : 6;
2740 struct
2742 unsigned : 2;
2743 unsigned PSS2AC : 2;
2744 unsigned : 4;
2747 struct
2749 unsigned : 4;
2750 unsigned CCP2AS : 3;
2751 unsigned : 1;
2753 } __CCP2ASbits_t;
2755 extern __at(0x029C) volatile __CCP2ASbits_t CCP2ASbits;
2757 #define _PSS2BD0 0x01
2758 #define _PSS2BD1 0x02
2759 #define _PSS2AC0 0x04
2760 #define _PSS2AC1 0x08
2761 #define _CCP2AS0 0x10
2762 #define _CCP2AS1 0x20
2763 #define _CCP2AS2 0x40
2764 #define _CCP2ASE 0x80
2766 //==============================================================================
2769 //==============================================================================
2770 // PSTR2CON Bits
2772 extern __at(0x029D) __sfr PSTR2CON;
2774 typedef struct
2776 unsigned STR2A : 1;
2777 unsigned STR2B : 1;
2778 unsigned STR2C : 1;
2779 unsigned STR2D : 1;
2780 unsigned STR2SYNC : 1;
2781 unsigned : 1;
2782 unsigned : 1;
2783 unsigned : 1;
2784 } __PSTR2CONbits_t;
2786 extern __at(0x029D) volatile __PSTR2CONbits_t PSTR2CONbits;
2788 #define _STR2A 0x01
2789 #define _STR2B 0x02
2790 #define _STR2C 0x04
2791 #define _STR2D 0x08
2792 #define _STR2SYNC 0x10
2794 //==============================================================================
2797 //==============================================================================
2798 // CCPTMRS Bits
2800 extern __at(0x029E) __sfr CCPTMRS;
2802 typedef union
2804 struct
2806 unsigned C1TSEL0 : 1;
2807 unsigned C1TSEL1 : 1;
2808 unsigned C2TSEL0 : 1;
2809 unsigned C2TSEL1 : 1;
2810 unsigned C3TSEL0 : 1;
2811 unsigned C3TSEL1 : 1;
2812 unsigned C4TSEL0 : 1;
2813 unsigned C4TSEL1 : 1;
2816 struct
2818 unsigned C1TSEL : 2;
2819 unsigned : 6;
2822 struct
2824 unsigned : 2;
2825 unsigned C2TSEL : 2;
2826 unsigned : 4;
2829 struct
2831 unsigned : 4;
2832 unsigned C3TSEL : 2;
2833 unsigned : 2;
2836 struct
2838 unsigned : 6;
2839 unsigned C4TSEL : 2;
2841 } __CCPTMRSbits_t;
2843 extern __at(0x029E) volatile __CCPTMRSbits_t CCPTMRSbits;
2845 #define _C1TSEL0 0x01
2846 #define _C1TSEL1 0x02
2847 #define _C2TSEL0 0x04
2848 #define _C2TSEL1 0x08
2849 #define _C3TSEL0 0x10
2850 #define _C3TSEL1 0x20
2851 #define _C4TSEL0 0x40
2852 #define _C4TSEL1 0x80
2854 //==============================================================================
2857 //==============================================================================
2858 // CCPTMRS0 Bits
2860 extern __at(0x029E) __sfr CCPTMRS0;
2862 typedef union
2864 struct
2866 unsigned C1TSEL0 : 1;
2867 unsigned C1TSEL1 : 1;
2868 unsigned C2TSEL0 : 1;
2869 unsigned C2TSEL1 : 1;
2870 unsigned C3TSEL0 : 1;
2871 unsigned C3TSEL1 : 1;
2872 unsigned C4TSEL0 : 1;
2873 unsigned C4TSEL1 : 1;
2876 struct
2878 unsigned C1TSEL : 2;
2879 unsigned : 6;
2882 struct
2884 unsigned : 2;
2885 unsigned C2TSEL : 2;
2886 unsigned : 4;
2889 struct
2891 unsigned : 4;
2892 unsigned C3TSEL : 2;
2893 unsigned : 2;
2896 struct
2898 unsigned : 6;
2899 unsigned C4TSEL : 2;
2901 } __CCPTMRS0bits_t;
2903 extern __at(0x029E) volatile __CCPTMRS0bits_t CCPTMRS0bits;
2905 #define _CCPTMRS0_C1TSEL0 0x01
2906 #define _CCPTMRS0_C1TSEL1 0x02
2907 #define _CCPTMRS0_C2TSEL0 0x04
2908 #define _CCPTMRS0_C2TSEL1 0x08
2909 #define _CCPTMRS0_C3TSEL0 0x10
2910 #define _CCPTMRS0_C3TSEL1 0x20
2911 #define _CCPTMRS0_C4TSEL0 0x40
2912 #define _CCPTMRS0_C4TSEL1 0x80
2914 //==============================================================================
2916 extern __at(0x0311) __sfr CCPR3;
2917 extern __at(0x0311) __sfr CCPR3L;
2918 extern __at(0x0312) __sfr CCPR3H;
2920 //==============================================================================
2921 // CCP3CON Bits
2923 extern __at(0x0313) __sfr CCP3CON;
2925 typedef union
2927 struct
2929 unsigned CCP3M0 : 1;
2930 unsigned CCP3M1 : 1;
2931 unsigned CCP3M2 : 1;
2932 unsigned CCP3M3 : 1;
2933 unsigned DC3B0 : 1;
2934 unsigned DC3B1 : 1;
2935 unsigned : 1;
2936 unsigned : 1;
2939 struct
2941 unsigned CCP3M : 4;
2942 unsigned : 4;
2945 struct
2947 unsigned : 4;
2948 unsigned DC3B : 2;
2949 unsigned : 2;
2951 } __CCP3CONbits_t;
2953 extern __at(0x0313) volatile __CCP3CONbits_t CCP3CONbits;
2955 #define _CCP3M0 0x01
2956 #define _CCP3M1 0x02
2957 #define _CCP3M2 0x04
2958 #define _CCP3M3 0x08
2959 #define _DC3B0 0x10
2960 #define _DC3B1 0x20
2962 //==============================================================================
2964 extern __at(0x0318) __sfr CCPR4;
2965 extern __at(0x0318) __sfr CCPR4L;
2966 extern __at(0x0319) __sfr CCPR4H;
2968 //==============================================================================
2969 // CCP4CON Bits
2971 extern __at(0x031A) __sfr CCP4CON;
2973 typedef union
2975 struct
2977 unsigned CCP4M0 : 1;
2978 unsigned CCP4M1 : 1;
2979 unsigned CCP4M2 : 1;
2980 unsigned CCP4M3 : 1;
2981 unsigned DC4B0 : 1;
2982 unsigned DC4B1 : 1;
2983 unsigned : 1;
2984 unsigned : 1;
2987 struct
2989 unsigned CCP4M : 4;
2990 unsigned : 4;
2993 struct
2995 unsigned : 4;
2996 unsigned DC4B : 2;
2997 unsigned : 2;
2999 } __CCP4CONbits_t;
3001 extern __at(0x031A) volatile __CCP4CONbits_t CCP4CONbits;
3003 #define _CCP4M0 0x01
3004 #define _CCP4M1 0x02
3005 #define _CCP4M2 0x04
3006 #define _CCP4M3 0x08
3007 #define _DC4B0 0x10
3008 #define _DC4B1 0x20
3010 //==============================================================================
3013 //==============================================================================
3014 // INLVLA Bits
3016 extern __at(0x038C) __sfr INLVLA;
3018 typedef union
3020 struct
3022 unsigned INLVLA0 : 1;
3023 unsigned INLVLA1 : 1;
3024 unsigned INLVLA2 : 1;
3025 unsigned INLVLA3 : 1;
3026 unsigned INLVLA4 : 1;
3027 unsigned INLVLA5 : 1;
3028 unsigned : 1;
3029 unsigned : 1;
3032 struct
3034 unsigned INLVLA : 6;
3035 unsigned : 2;
3037 } __INLVLAbits_t;
3039 extern __at(0x038C) volatile __INLVLAbits_t INLVLAbits;
3041 #define _INLVLA0 0x01
3042 #define _INLVLA1 0x02
3043 #define _INLVLA2 0x04
3044 #define _INLVLA3 0x08
3045 #define _INLVLA4 0x10
3046 #define _INLVLA5 0x20
3048 //==============================================================================
3051 //==============================================================================
3052 // INLVLC Bits
3054 extern __at(0x038E) __sfr INLVLC;
3056 typedef union
3058 struct
3060 unsigned INLVLC0 : 1;
3061 unsigned INLVLC1 : 1;
3062 unsigned INLVLC2 : 1;
3063 unsigned INLVLC3 : 1;
3064 unsigned INLVLC4 : 1;
3065 unsigned INLVLC5 : 1;
3066 unsigned : 1;
3067 unsigned : 1;
3070 struct
3072 unsigned INLVLC : 6;
3073 unsigned : 2;
3075 } __INLVLCbits_t;
3077 extern __at(0x038E) volatile __INLVLCbits_t INLVLCbits;
3079 #define _INLVLC0 0x01
3080 #define _INLVLC1 0x02
3081 #define _INLVLC2 0x04
3082 #define _INLVLC3 0x08
3083 #define _INLVLC4 0x10
3084 #define _INLVLC5 0x20
3086 //==============================================================================
3089 //==============================================================================
3090 // IOCAP Bits
3092 extern __at(0x0391) __sfr IOCAP;
3094 typedef union
3096 struct
3098 unsigned IOCAP0 : 1;
3099 unsigned IOCAP1 : 1;
3100 unsigned IOCAP2 : 1;
3101 unsigned IOCAP3 : 1;
3102 unsigned IOCAP4 : 1;
3103 unsigned IOCAP5 : 1;
3104 unsigned : 1;
3105 unsigned : 1;
3108 struct
3110 unsigned IOCAP : 6;
3111 unsigned : 2;
3113 } __IOCAPbits_t;
3115 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits;
3117 #define _IOCAP0 0x01
3118 #define _IOCAP1 0x02
3119 #define _IOCAP2 0x04
3120 #define _IOCAP3 0x08
3121 #define _IOCAP4 0x10
3122 #define _IOCAP5 0x20
3124 //==============================================================================
3127 //==============================================================================
3128 // IOCAN Bits
3130 extern __at(0x0392) __sfr IOCAN;
3132 typedef union
3134 struct
3136 unsigned IOCAN0 : 1;
3137 unsigned IOCAN1 : 1;
3138 unsigned IOCAN2 : 1;
3139 unsigned IOCAN3 : 1;
3140 unsigned IOCAN4 : 1;
3141 unsigned IOCAN5 : 1;
3142 unsigned : 1;
3143 unsigned : 1;
3146 struct
3148 unsigned IOCAN : 6;
3149 unsigned : 2;
3151 } __IOCANbits_t;
3153 extern __at(0x0392) volatile __IOCANbits_t IOCANbits;
3155 #define _IOCAN0 0x01
3156 #define _IOCAN1 0x02
3157 #define _IOCAN2 0x04
3158 #define _IOCAN3 0x08
3159 #define _IOCAN4 0x10
3160 #define _IOCAN5 0x20
3162 //==============================================================================
3165 //==============================================================================
3166 // IOCAF Bits
3168 extern __at(0x0393) __sfr IOCAF;
3170 typedef union
3172 struct
3174 unsigned IOCAF0 : 1;
3175 unsigned IOCAF1 : 1;
3176 unsigned IOCAF2 : 1;
3177 unsigned IOCAF3 : 1;
3178 unsigned IOCAF4 : 1;
3179 unsigned IOCAF5 : 1;
3180 unsigned : 1;
3181 unsigned : 1;
3184 struct
3186 unsigned IOCAF : 6;
3187 unsigned : 2;
3189 } __IOCAFbits_t;
3191 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits;
3193 #define _IOCAF0 0x01
3194 #define _IOCAF1 0x02
3195 #define _IOCAF2 0x04
3196 #define _IOCAF3 0x08
3197 #define _IOCAF4 0x10
3198 #define _IOCAF5 0x20
3200 //==============================================================================
3203 //==============================================================================
3204 // CLKRCON Bits
3206 extern __at(0x039A) __sfr CLKRCON;
3208 typedef union
3210 struct
3212 unsigned CLKRDIV0 : 1;
3213 unsigned CLKRDIV1 : 1;
3214 unsigned CLKRDIV2 : 1;
3215 unsigned CLKRDC0 : 1;
3216 unsigned CLKRDC1 : 1;
3217 unsigned CLKRSLR : 1;
3218 unsigned CLKROE : 1;
3219 unsigned CLKREN : 1;
3222 struct
3224 unsigned CLKRDIV : 3;
3225 unsigned : 5;
3228 struct
3230 unsigned : 3;
3231 unsigned CLKRDC : 2;
3232 unsigned : 3;
3234 } __CLKRCONbits_t;
3236 extern __at(0x039A) volatile __CLKRCONbits_t CLKRCONbits;
3238 #define _CLKRDIV0 0x01
3239 #define _CLKRDIV1 0x02
3240 #define _CLKRDIV2 0x04
3241 #define _CLKRDC0 0x08
3242 #define _CLKRDC1 0x10
3243 #define _CLKRSLR 0x20
3244 #define _CLKROE 0x40
3245 #define _CLKREN 0x80
3247 //==============================================================================
3250 //==============================================================================
3251 // MDCON Bits
3253 extern __at(0x039C) __sfr MDCON;
3255 typedef struct
3257 unsigned MDBIT : 1;
3258 unsigned : 1;
3259 unsigned : 1;
3260 unsigned MDOUT : 1;
3261 unsigned MDOPOL : 1;
3262 unsigned MDSLR : 1;
3263 unsigned MDOE : 1;
3264 unsigned MDEN : 1;
3265 } __MDCONbits_t;
3267 extern __at(0x039C) volatile __MDCONbits_t MDCONbits;
3269 #define _MDBIT 0x01
3270 #define _MDOUT 0x08
3271 #define _MDOPOL 0x10
3272 #define _MDSLR 0x20
3273 #define _MDOE 0x40
3274 #define _MDEN 0x80
3276 //==============================================================================
3279 //==============================================================================
3280 // MDSRC Bits
3282 extern __at(0x039D) __sfr MDSRC;
3284 typedef union
3286 struct
3288 unsigned MDMS0 : 1;
3289 unsigned MDMS1 : 1;
3290 unsigned MDMS2 : 1;
3291 unsigned MDMS3 : 1;
3292 unsigned : 1;
3293 unsigned : 1;
3294 unsigned : 1;
3295 unsigned MDMSODIS : 1;
3298 struct
3300 unsigned MDMS : 4;
3301 unsigned : 4;
3303 } __MDSRCbits_t;
3305 extern __at(0x039D) volatile __MDSRCbits_t MDSRCbits;
3307 #define _MDMS0 0x01
3308 #define _MDMS1 0x02
3309 #define _MDMS2 0x04
3310 #define _MDMS3 0x08
3311 #define _MDMSODIS 0x80
3313 //==============================================================================
3316 //==============================================================================
3317 // MDCARL Bits
3319 extern __at(0x039E) __sfr MDCARL;
3321 typedef union
3323 struct
3325 unsigned MDCL0 : 1;
3326 unsigned MDCL1 : 1;
3327 unsigned MDCL2 : 1;
3328 unsigned MDCL3 : 1;
3329 unsigned : 1;
3330 unsigned MDCLSYNC : 1;
3331 unsigned MDCLPOL : 1;
3332 unsigned MDCLODIS : 1;
3335 struct
3337 unsigned MDCL : 4;
3338 unsigned : 4;
3340 } __MDCARLbits_t;
3342 extern __at(0x039E) volatile __MDCARLbits_t MDCARLbits;
3344 #define _MDCL0 0x01
3345 #define _MDCL1 0x02
3346 #define _MDCL2 0x04
3347 #define _MDCL3 0x08
3348 #define _MDCLSYNC 0x20
3349 #define _MDCLPOL 0x40
3350 #define _MDCLODIS 0x80
3352 //==============================================================================
3355 //==============================================================================
3356 // MDCARH Bits
3358 extern __at(0x039F) __sfr MDCARH;
3360 typedef union
3362 struct
3364 unsigned MDCH0 : 1;
3365 unsigned MDCH1 : 1;
3366 unsigned MDCH2 : 1;
3367 unsigned MDCH3 : 1;
3368 unsigned : 1;
3369 unsigned MDCHSYNC : 1;
3370 unsigned MDCHPOL : 1;
3371 unsigned MDCHODIS : 1;
3374 struct
3376 unsigned MDCH : 4;
3377 unsigned : 4;
3379 } __MDCARHbits_t;
3381 extern __at(0x039F) volatile __MDCARHbits_t MDCARHbits;
3383 #define _MDCH0 0x01
3384 #define _MDCH1 0x02
3385 #define _MDCH2 0x04
3386 #define _MDCH3 0x08
3387 #define _MDCHSYNC 0x20
3388 #define _MDCHPOL 0x40
3389 #define _MDCHODIS 0x80
3391 //==============================================================================
3393 extern __at(0x0415) __sfr TMR4;
3394 extern __at(0x0416) __sfr PR4;
3396 //==============================================================================
3397 // T4CON Bits
3399 extern __at(0x0417) __sfr T4CON;
3401 typedef union
3403 struct
3405 unsigned T4CKPS0 : 1;
3406 unsigned T4CKPS1 : 1;
3407 unsigned TMR4ON : 1;
3408 unsigned T4OUTPS0 : 1;
3409 unsigned T4OUTPS1 : 1;
3410 unsigned T4OUTPS2 : 1;
3411 unsigned T4OUTPS3 : 1;
3412 unsigned : 1;
3415 struct
3417 unsigned T4CKPS : 2;
3418 unsigned : 6;
3421 struct
3423 unsigned : 3;
3424 unsigned T4OUTPS : 4;
3425 unsigned : 1;
3427 } __T4CONbits_t;
3429 extern __at(0x0417) volatile __T4CONbits_t T4CONbits;
3431 #define _T4CKPS0 0x01
3432 #define _T4CKPS1 0x02
3433 #define _TMR4ON 0x04
3434 #define _T4OUTPS0 0x08
3435 #define _T4OUTPS1 0x10
3436 #define _T4OUTPS2 0x20
3437 #define _T4OUTPS3 0x40
3439 //==============================================================================
3441 extern __at(0x041C) __sfr TMR6;
3442 extern __at(0x041D) __sfr PR6;
3444 //==============================================================================
3445 // T6CON Bits
3447 extern __at(0x041E) __sfr T6CON;
3449 typedef union
3451 struct
3453 unsigned T6CKPS0 : 1;
3454 unsigned T6CKPS1 : 1;
3455 unsigned TMR6ON : 1;
3456 unsigned T6OUTPS0 : 1;
3457 unsigned T6OUTPS1 : 1;
3458 unsigned T6OUTPS2 : 1;
3459 unsigned T6OUTPS3 : 1;
3460 unsigned : 1;
3463 struct
3465 unsigned T6CKPS : 2;
3466 unsigned : 6;
3469 struct
3471 unsigned : 3;
3472 unsigned T6OUTPS : 4;
3473 unsigned : 1;
3475 } __T6CONbits_t;
3477 extern __at(0x041E) volatile __T6CONbits_t T6CONbits;
3479 #define _T6CKPS0 0x01
3480 #define _T6CKPS1 0x02
3481 #define _TMR6ON 0x04
3482 #define _T6OUTPS0 0x08
3483 #define _T6OUTPS1 0x10
3484 #define _T6OUTPS2 0x20
3485 #define _T6OUTPS3 0x40
3487 //==============================================================================
3490 //==============================================================================
3491 // STATUS_SHAD Bits
3493 extern __at(0x0FE4) __sfr STATUS_SHAD;
3495 typedef struct
3497 unsigned C_SHAD : 1;
3498 unsigned DC_SHAD : 1;
3499 unsigned Z_SHAD : 1;
3500 unsigned : 1;
3501 unsigned : 1;
3502 unsigned : 1;
3503 unsigned : 1;
3504 unsigned : 1;
3505 } __STATUS_SHADbits_t;
3507 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
3509 #define _C_SHAD 0x01
3510 #define _DC_SHAD 0x02
3511 #define _Z_SHAD 0x04
3513 //==============================================================================
3515 extern __at(0x0FE5) __sfr WREG_SHAD;
3516 extern __at(0x0FE6) __sfr BSR_SHAD;
3517 extern __at(0x0FE7) __sfr PCLATH_SHAD;
3518 extern __at(0x0FE8) __sfr FSR0L_SHAD;
3519 extern __at(0x0FE9) __sfr FSR0H_SHAD;
3520 extern __at(0x0FEA) __sfr FSR1L_SHAD;
3521 extern __at(0x0FEB) __sfr FSR1H_SHAD;
3522 extern __at(0x0FED) __sfr STKPTR;
3523 extern __at(0x0FEE) __sfr TOSL;
3524 extern __at(0x0FEF) __sfr TOSH;
3526 //==============================================================================
3528 // Configuration Bits
3530 //==============================================================================
3532 #define _CONFIG1 0x8007
3533 #define _CONFIG2 0x8008
3535 //----------------------------- CONFIG1 Options -------------------------------
3537 #define _FOSC_LP 0x3FF8 // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins.
3538 #define _FOSC_XT 0x3FF9 // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins.
3539 #define _FOSC_HS 0x3FFA // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins.
3540 #define _FOSC_EXTRC 0x3FFB // EXTRC oscillator: External RC circuit connected to CLKIN pin.
3541 #define _FOSC_INTOSC 0x3FFC // INTOSC oscillator: I/O function on CLKIN pin.
3542 #define _FOSC_ECL 0x3FFD // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin.
3543 #define _FOSC_ECM 0x3FFE // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin.
3544 #define _FOSC_ECH 0x3FFF // ECH, External Clock, High Power Mode (4-32 MHz): device clock supplied to CLKIN pin.
3545 #define _WDTE_OFF 0x3FE7 // WDT disabled.
3546 #define _WDTE_SWDTEN 0x3FEF // WDT controlled by the SWDTEN bit in the WDTCON register.
3547 #define _WDTE_NSLEEP 0x3FF7 // WDT enabled while running and disabled in Sleep.
3548 #define _WDTE_ON 0x3FFF // WDT enabled.
3549 #define _PWRTE_ON 0x3FDF // PWRT enabled.
3550 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
3551 #define _MCLRE_OFF 0x3FBF // MCLR/VPP pin function is digital input.
3552 #define _MCLRE_ON 0x3FFF // MCLR/VPP pin function is MCLR.
3553 #define _CP_ON 0x3F7F // Program memory code protection is enabled.
3554 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
3555 #define _CPD_ON 0x3EFF // Data memory code protection is enabled.
3556 #define _CPD_OFF 0x3FFF // Data memory code protection is disabled.
3557 #define _BOREN_OFF 0x39FF // Brown-out Reset disabled.
3558 #define _BOREN_SBODEN 0x3BFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
3559 #define _BOREN_NSLEEP 0x3DFF // Brown-out Reset enabled while running and disabled in Sleep.
3560 #define _BOREN_ON 0x3FFF // Brown-out Reset enabled.
3561 #define _CLKOUTEN_ON 0x37FF // CLKOUT function is enabled on the CLKOUT pin.
3562 #define _CLKOUTEN_OFF 0x3FFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
3563 #define _IESO_OFF 0x2FFF // Internal/External Switchover mode is disabled.
3564 #define _IESO_ON 0x3FFF // Internal/External Switchover mode is enabled.
3565 #define _FCMEN_OFF 0x1FFF // Fail-Safe Clock Monitor is disabled.
3566 #define _FCMEN_ON 0x3FFF // Fail-Safe Clock Monitor is enabled.
3568 //----------------------------- CONFIG2 Options -------------------------------
3570 #define _WRT_ALL 0x3FFC // 000h to FFFh write protected, no addresses may be modified by EECON control.
3571 #define _WRT_HALF 0x3FFD // 000h to 7FFh write protected, 800h to FFFh may be modified by EECON control.
3572 #define _WRT_BOOT 0x3FFE // 000h to 1FFh write protected, 200h to FFFh may be modified by EECON control.
3573 #define _WRT_OFF 0x3FFF // Write protection off.
3574 #define _PLLEN_OFF 0x3EFF // 4x PLL disabled.
3575 #define _PLLEN_ON 0x3FFF // 4x PLL enabled.
3576 #define _STVREN_OFF 0x3DFF // Stack Overflow or Underflow will not cause a Reset.
3577 #define _STVREN_ON 0x3FFF // Stack Overflow or Underflow will cause a Reset.
3578 #define _BORV_HI 0x3BFF // Brown-out Reset Voltage (Vbor), high trip point selected.
3579 #define _BORV_LO 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
3580 #define _BORV_19 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
3581 #define _DEBUG_ON 0x2FFF // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
3582 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
3583 #define _LVP_OFF 0x1FFF // High-voltage on MCLR/VPP must be used for programming.
3584 #define _LVP_ON 0x3FFF // Low-voltage programming enabled.
3586 //==============================================================================
3588 #define _DEVID1 0x8006
3590 #define _IDLOC0 0x8000
3591 #define _IDLOC1 0x8001
3592 #define _IDLOC2 0x8002
3593 #define _IDLOC3 0x8003
3595 //==============================================================================
3597 #ifndef NO_BIT_DEFINES
3599 #define ADON ADCON0bits.ADON // bit 0
3600 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
3601 #define ADGO ADCON0bits.ADGO // bit 1, shadows bit in ADCON0bits
3602 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
3603 #define CHS0 ADCON0bits.CHS0 // bit 2
3604 #define CHS1 ADCON0bits.CHS1 // bit 3
3605 #define CHS2 ADCON0bits.CHS2 // bit 4
3606 #define CHS3 ADCON0bits.CHS3 // bit 5
3607 #define CHS4 ADCON0bits.CHS4 // bit 6
3609 #define ADPREF0 ADCON1bits.ADPREF0 // bit 0
3610 #define ADPREF1 ADCON1bits.ADPREF1 // bit 1
3611 #define ADNREF ADCON1bits.ADNREF // bit 2
3612 #define ADCS0 ADCON1bits.ADCS0 // bit 4
3613 #define ADCS1 ADCON1bits.ADCS1 // bit 5
3614 #define ADCS2 ADCON1bits.ADCS2 // bit 6
3615 #define ADFM ADCON1bits.ADFM // bit 7
3617 #define ANSA0 ANSELAbits.ANSA0 // bit 0
3618 #define ANSA1 ANSELAbits.ANSA1 // bit 1
3619 #define ANSA2 ANSELAbits.ANSA2 // bit 2
3620 #define ANSA4 ANSELAbits.ANSA4 // bit 4
3622 #define ANSC0 ANSELCbits.ANSC0 // bit 0
3623 #define ANSC1 ANSELCbits.ANSC1 // bit 1
3624 #define ANSC2 ANSELCbits.ANSC2 // bit 2
3625 #define ANSC3 ANSELCbits.ANSC3 // bit 3
3627 #define TXCKSEL APFCON0bits.TXCKSEL // bit 2
3628 #define T1GSEL APFCON0bits.T1GSEL // bit 3
3629 #define SSSEL APFCON0bits.SSSEL // bit 5, shadows bit in APFCON0bits
3630 #define SS1SEL APFCON0bits.SS1SEL // bit 5, shadows bit in APFCON0bits
3631 #define SDOSEL APFCON0bits.SDOSEL // bit 6, shadows bit in APFCON0bits
3632 #define SDO1SEL APFCON0bits.SDO1SEL // bit 6, shadows bit in APFCON0bits
3633 #define RXDTSEL APFCON0bits.RXDTSEL // bit 7
3635 #define CCP2SEL APFCON1bits.CCP2SEL // bit 0
3636 #define P2BSEL APFCON1bits.P2BSEL // bit 1
3637 #define P1CSEL APFCON1bits.P1CSEL // bit 2
3638 #define P1DSEL APFCON1bits.P1DSEL // bit 3
3640 #define ABDEN BAUDCONbits.ABDEN // bit 0
3641 #define WUE BAUDCONbits.WUE // bit 1
3642 #define BRG16 BAUDCONbits.BRG16 // bit 3
3643 #define SCKP BAUDCONbits.SCKP // bit 4
3644 #define RCIDL BAUDCONbits.RCIDL // bit 6
3645 #define ABDOVF BAUDCONbits.ABDOVF // bit 7
3647 #define BORRDY BORCONbits.BORRDY // bit 0
3648 #define SBOREN BORCONbits.SBOREN // bit 7
3650 #define BSR0 BSRbits.BSR0 // bit 0
3651 #define BSR1 BSRbits.BSR1 // bit 1
3652 #define BSR2 BSRbits.BSR2 // bit 2
3653 #define BSR3 BSRbits.BSR3 // bit 3
3654 #define BSR4 BSRbits.BSR4 // bit 4
3656 #define PSS1BD0 CCP1ASbits.PSS1BD0 // bit 0
3657 #define PSS1BD1 CCP1ASbits.PSS1BD1 // bit 1
3658 #define PSS1AC0 CCP1ASbits.PSS1AC0 // bit 2
3659 #define PSS1AC1 CCP1ASbits.PSS1AC1 // bit 3
3660 #define CCP1AS0 CCP1ASbits.CCP1AS0 // bit 4
3661 #define CCP1AS1 CCP1ASbits.CCP1AS1 // bit 5
3662 #define CCP1AS2 CCP1ASbits.CCP1AS2 // bit 6
3663 #define CCP1ASE CCP1ASbits.CCP1ASE // bit 7
3665 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
3666 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
3667 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
3668 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
3669 #define DC1B0 CCP1CONbits.DC1B0 // bit 4
3670 #define DC1B1 CCP1CONbits.DC1B1 // bit 5
3671 #define P1M0 CCP1CONbits.P1M0 // bit 6
3672 #define P1M1 CCP1CONbits.P1M1 // bit 7
3674 #define PSS2BD0 CCP2ASbits.PSS2BD0 // bit 0
3675 #define PSS2BD1 CCP2ASbits.PSS2BD1 // bit 1
3676 #define PSS2AC0 CCP2ASbits.PSS2AC0 // bit 2
3677 #define PSS2AC1 CCP2ASbits.PSS2AC1 // bit 3
3678 #define CCP2AS0 CCP2ASbits.CCP2AS0 // bit 4
3679 #define CCP2AS1 CCP2ASbits.CCP2AS1 // bit 5
3680 #define CCP2AS2 CCP2ASbits.CCP2AS2 // bit 6
3681 #define CCP2ASE CCP2ASbits.CCP2ASE // bit 7
3683 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
3684 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
3685 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
3686 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
3687 #define DC2B0 CCP2CONbits.DC2B0 // bit 4
3688 #define DC2B1 CCP2CONbits.DC2B1 // bit 5
3689 #define P2M0 CCP2CONbits.P2M0 // bit 6
3690 #define P2M1 CCP2CONbits.P2M1 // bit 7
3692 #define CCP3M0 CCP3CONbits.CCP3M0 // bit 0
3693 #define CCP3M1 CCP3CONbits.CCP3M1 // bit 1
3694 #define CCP3M2 CCP3CONbits.CCP3M2 // bit 2
3695 #define CCP3M3 CCP3CONbits.CCP3M3 // bit 3
3696 #define DC3B0 CCP3CONbits.DC3B0 // bit 4
3697 #define DC3B1 CCP3CONbits.DC3B1 // bit 5
3699 #define CCP4M0 CCP4CONbits.CCP4M0 // bit 0
3700 #define CCP4M1 CCP4CONbits.CCP4M1 // bit 1
3701 #define CCP4M2 CCP4CONbits.CCP4M2 // bit 2
3702 #define CCP4M3 CCP4CONbits.CCP4M3 // bit 3
3703 #define DC4B0 CCP4CONbits.DC4B0 // bit 4
3704 #define DC4B1 CCP4CONbits.DC4B1 // bit 5
3706 #define C1TSEL0 CCPTMRSbits.C1TSEL0 // bit 0
3707 #define C1TSEL1 CCPTMRSbits.C1TSEL1 // bit 1
3708 #define C2TSEL0 CCPTMRSbits.C2TSEL0 // bit 2
3709 #define C2TSEL1 CCPTMRSbits.C2TSEL1 // bit 3
3710 #define C3TSEL0 CCPTMRSbits.C3TSEL0 // bit 4
3711 #define C3TSEL1 CCPTMRSbits.C3TSEL1 // bit 5
3712 #define C4TSEL0 CCPTMRSbits.C4TSEL0 // bit 6
3713 #define C4TSEL1 CCPTMRSbits.C4TSEL1 // bit 7
3715 #define CLKRDIV0 CLKRCONbits.CLKRDIV0 // bit 0
3716 #define CLKRDIV1 CLKRCONbits.CLKRDIV1 // bit 1
3717 #define CLKRDIV2 CLKRCONbits.CLKRDIV2 // bit 2
3718 #define CLKRDC0 CLKRCONbits.CLKRDC0 // bit 3
3719 #define CLKRDC1 CLKRCONbits.CLKRDC1 // bit 4
3720 #define CLKRSLR CLKRCONbits.CLKRSLR // bit 5
3721 #define CLKROE CLKRCONbits.CLKROE // bit 6
3722 #define CLKREN CLKRCONbits.CLKREN // bit 7
3724 #define C1SYNC CM1CON0bits.C1SYNC // bit 0
3725 #define C1HYS CM1CON0bits.C1HYS // bit 1
3726 #define C1SP CM1CON0bits.C1SP // bit 2
3727 #define C1POL CM1CON0bits.C1POL // bit 4
3728 #define C1OE CM1CON0bits.C1OE // bit 5
3729 #define C1OUT CM1CON0bits.C1OUT // bit 6
3730 #define C1ON CM1CON0bits.C1ON // bit 7
3732 #define C1NCH0 CM1CON1bits.C1NCH0 // bit 0
3733 #define C1NCH1 CM1CON1bits.C1NCH1 // bit 1
3734 #define C1PCH0 CM1CON1bits.C1PCH0 // bit 4
3735 #define C1PCH1 CM1CON1bits.C1PCH1 // bit 5
3736 #define C1INTN CM1CON1bits.C1INTN // bit 6
3737 #define C1INTP CM1CON1bits.C1INTP // bit 7
3739 #define C2SYNC CM2CON0bits.C2SYNC // bit 0
3740 #define C2HYS CM2CON0bits.C2HYS // bit 1
3741 #define C2SP CM2CON0bits.C2SP // bit 2
3742 #define C2POL CM2CON0bits.C2POL // bit 4
3743 #define C2OE CM2CON0bits.C2OE // bit 5
3744 #define C2OUT CM2CON0bits.C2OUT // bit 6
3745 #define C2ON CM2CON0bits.C2ON // bit 7
3747 #define C2NCH0 CM2CON1bits.C2NCH0 // bit 0
3748 #define C2NCH1 CM2CON1bits.C2NCH1 // bit 1
3749 #define C2PCH0 CM2CON1bits.C2PCH0 // bit 4
3750 #define C2PCH1 CM2CON1bits.C2PCH1 // bit 5
3751 #define C2INTN CM2CON1bits.C2INTN // bit 6
3752 #define C2INTP CM2CON1bits.C2INTP // bit 7
3754 #define MC1OUT CMOUTbits.MC1OUT // bit 0
3755 #define MC2OUT CMOUTbits.MC2OUT // bit 1
3757 #define T0XCS CPSCON0bits.T0XCS // bit 0
3758 #define CPSOUT CPSCON0bits.CPSOUT // bit 1
3759 #define CPSRNG0 CPSCON0bits.CPSRNG0 // bit 2
3760 #define CPSRNG1 CPSCON0bits.CPSRNG1 // bit 3
3761 #define CPSRM CPSCON0bits.CPSRM // bit 6
3762 #define CPSON CPSCON0bits.CPSON // bit 7
3764 #define CPSCH0 CPSCON1bits.CPSCH0 // bit 0
3765 #define CPSCH1 CPSCON1bits.CPSCH1 // bit 1
3766 #define CPSCH2 CPSCON1bits.CPSCH2 // bit 2
3767 #define CPSCH3 CPSCON1bits.CPSCH3 // bit 3
3769 #define DACNSS DACCON0bits.DACNSS // bit 0
3770 #define DACPSS0 DACCON0bits.DACPSS0 // bit 2
3771 #define DACPSS1 DACCON0bits.DACPSS1 // bit 3
3772 #define DACOE DACCON0bits.DACOE // bit 5
3773 #define DACLPS DACCON0bits.DACLPS // bit 6
3774 #define DACEN DACCON0bits.DACEN // bit 7
3776 #define DACR0 DACCON1bits.DACR0 // bit 0
3777 #define DACR1 DACCON1bits.DACR1 // bit 1
3778 #define DACR2 DACCON1bits.DACR2 // bit 2
3779 #define DACR3 DACCON1bits.DACR3 // bit 3
3780 #define DACR4 DACCON1bits.DACR4 // bit 4
3782 #define RD EECON1bits.RD // bit 0
3783 #define WR EECON1bits.WR // bit 1
3784 #define WREN EECON1bits.WREN // bit 2
3785 #define WRERR EECON1bits.WRERR // bit 3
3786 #define FREE EECON1bits.FREE // bit 4
3787 #define LWLO EECON1bits.LWLO // bit 5
3788 #define CFGS EECON1bits.CFGS // bit 6
3789 #define EEPGD EECON1bits.EEPGD // bit 7
3791 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
3792 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
3793 #define CDAFVR0 FVRCONbits.CDAFVR0 // bit 2
3794 #define CDAFVR1 FVRCONbits.CDAFVR1 // bit 3
3795 #define TSRNG FVRCONbits.TSRNG // bit 4
3796 #define TSEN FVRCONbits.TSEN // bit 5
3797 #define FVRRDY FVRCONbits.FVRRDY // bit 6
3798 #define FVREN FVRCONbits.FVREN // bit 7
3800 #define INLVLA0 INLVLAbits.INLVLA0 // bit 0
3801 #define INLVLA1 INLVLAbits.INLVLA1 // bit 1
3802 #define INLVLA2 INLVLAbits.INLVLA2 // bit 2
3803 #define INLVLA3 INLVLAbits.INLVLA3 // bit 3
3804 #define INLVLA4 INLVLAbits.INLVLA4 // bit 4
3805 #define INLVLA5 INLVLAbits.INLVLA5 // bit 5
3807 #define INLVLC0 INLVLCbits.INLVLC0 // bit 0
3808 #define INLVLC1 INLVLCbits.INLVLC1 // bit 1
3809 #define INLVLC2 INLVLCbits.INLVLC2 // bit 2
3810 #define INLVLC3 INLVLCbits.INLVLC3 // bit 3
3811 #define INLVLC4 INLVLCbits.INLVLC4 // bit 4
3812 #define INLVLC5 INLVLCbits.INLVLC5 // bit 5
3814 #define IOCIF INTCONbits.IOCIF // bit 0
3815 #define INTF INTCONbits.INTF // bit 1
3816 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
3817 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
3818 #define IOCIE INTCONbits.IOCIE // bit 3
3819 #define INTE INTCONbits.INTE // bit 4
3820 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
3821 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
3822 #define PEIE INTCONbits.PEIE // bit 6
3823 #define GIE INTCONbits.GIE // bit 7
3825 #define IOCAF0 IOCAFbits.IOCAF0 // bit 0
3826 #define IOCAF1 IOCAFbits.IOCAF1 // bit 1
3827 #define IOCAF2 IOCAFbits.IOCAF2 // bit 2
3828 #define IOCAF3 IOCAFbits.IOCAF3 // bit 3
3829 #define IOCAF4 IOCAFbits.IOCAF4 // bit 4
3830 #define IOCAF5 IOCAFbits.IOCAF5 // bit 5
3832 #define IOCAN0 IOCANbits.IOCAN0 // bit 0
3833 #define IOCAN1 IOCANbits.IOCAN1 // bit 1
3834 #define IOCAN2 IOCANbits.IOCAN2 // bit 2
3835 #define IOCAN3 IOCANbits.IOCAN3 // bit 3
3836 #define IOCAN4 IOCANbits.IOCAN4 // bit 4
3837 #define IOCAN5 IOCANbits.IOCAN5 // bit 5
3839 #define IOCAP0 IOCAPbits.IOCAP0 // bit 0
3840 #define IOCAP1 IOCAPbits.IOCAP1 // bit 1
3841 #define IOCAP2 IOCAPbits.IOCAP2 // bit 2
3842 #define IOCAP3 IOCAPbits.IOCAP3 // bit 3
3843 #define IOCAP4 IOCAPbits.IOCAP4 // bit 4
3844 #define IOCAP5 IOCAPbits.IOCAP5 // bit 5
3846 #define LATA0 LATAbits.LATA0 // bit 0
3847 #define LATA1 LATAbits.LATA1 // bit 1
3848 #define LATA2 LATAbits.LATA2 // bit 2
3849 #define LATA4 LATAbits.LATA4 // bit 4
3850 #define LATA5 LATAbits.LATA5 // bit 5
3852 #define LATC0 LATCbits.LATC0 // bit 0
3853 #define LATC1 LATCbits.LATC1 // bit 1
3854 #define LATC2 LATCbits.LATC2 // bit 2
3855 #define LATC3 LATCbits.LATC3 // bit 3
3856 #define LATC4 LATCbits.LATC4 // bit 4
3857 #define LATC5 LATCbits.LATC5 // bit 5
3859 #define MDCH0 MDCARHbits.MDCH0 // bit 0
3860 #define MDCH1 MDCARHbits.MDCH1 // bit 1
3861 #define MDCH2 MDCARHbits.MDCH2 // bit 2
3862 #define MDCH3 MDCARHbits.MDCH3 // bit 3
3863 #define MDCHSYNC MDCARHbits.MDCHSYNC // bit 5
3864 #define MDCHPOL MDCARHbits.MDCHPOL // bit 6
3865 #define MDCHODIS MDCARHbits.MDCHODIS // bit 7
3867 #define MDCL0 MDCARLbits.MDCL0 // bit 0
3868 #define MDCL1 MDCARLbits.MDCL1 // bit 1
3869 #define MDCL2 MDCARLbits.MDCL2 // bit 2
3870 #define MDCL3 MDCARLbits.MDCL3 // bit 3
3871 #define MDCLSYNC MDCARLbits.MDCLSYNC // bit 5
3872 #define MDCLPOL MDCARLbits.MDCLPOL // bit 6
3873 #define MDCLODIS MDCARLbits.MDCLODIS // bit 7
3875 #define MDBIT MDCONbits.MDBIT // bit 0
3876 #define MDOUT MDCONbits.MDOUT // bit 3
3877 #define MDOPOL MDCONbits.MDOPOL // bit 4
3878 #define MDSLR MDCONbits.MDSLR // bit 5
3879 #define MDOE MDCONbits.MDOE // bit 6
3880 #define MDEN MDCONbits.MDEN // bit 7
3882 #define MDMS0 MDSRCbits.MDMS0 // bit 0
3883 #define MDMS1 MDSRCbits.MDMS1 // bit 1
3884 #define MDMS2 MDSRCbits.MDMS2 // bit 2
3885 #define MDMS3 MDSRCbits.MDMS3 // bit 3
3886 #define MDMSODIS MDSRCbits.MDMSODIS // bit 7
3888 #define PS0 OPTION_REGbits.PS0 // bit 0
3889 #define PS1 OPTION_REGbits.PS1 // bit 1
3890 #define PS2 OPTION_REGbits.PS2 // bit 2
3891 #define PSA OPTION_REGbits.PSA // bit 3
3892 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
3893 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
3894 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
3895 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
3896 #define INTEDG OPTION_REGbits.INTEDG // bit 6
3897 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7
3899 #define SCS0 OSCCONbits.SCS0 // bit 0
3900 #define SCS1 OSCCONbits.SCS1 // bit 1
3901 #define IRCF0 OSCCONbits.IRCF0 // bit 3
3902 #define IRCF1 OSCCONbits.IRCF1 // bit 4
3903 #define IRCF2 OSCCONbits.IRCF2 // bit 5
3904 #define IRCF3 OSCCONbits.IRCF3 // bit 6
3905 #define SPLLEN OSCCONbits.SPLLEN // bit 7
3907 #define HFIOFS OSCSTATbits.HFIOFS // bit 0
3908 #define LFIOFR OSCSTATbits.LFIOFR // bit 1
3909 #define MFIOFR OSCSTATbits.MFIOFR // bit 2
3910 #define HFIOFL OSCSTATbits.HFIOFL // bit 3
3911 #define HFIOFR OSCSTATbits.HFIOFR // bit 4
3912 #define OSTS OSCSTATbits.OSTS // bit 5
3913 #define PLLR OSCSTATbits.PLLR // bit 6
3914 #define T1OSCR OSCSTATbits.T1OSCR // bit 7
3916 #define TUN0 OSCTUNEbits.TUN0 // bit 0
3917 #define TUN1 OSCTUNEbits.TUN1 // bit 1
3918 #define TUN2 OSCTUNEbits.TUN2 // bit 2
3919 #define TUN3 OSCTUNEbits.TUN3 // bit 3
3920 #define TUN4 OSCTUNEbits.TUN4 // bit 4
3921 #define TUN5 OSCTUNEbits.TUN5 // bit 5
3923 #define NOT_BOR PCONbits.NOT_BOR // bit 0
3924 #define NOT_POR PCONbits.NOT_POR // bit 1
3925 #define NOT_RI PCONbits.NOT_RI // bit 2
3926 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3
3927 #define STKUNF PCONbits.STKUNF // bit 6
3928 #define STKOVF PCONbits.STKOVF // bit 7
3930 #define TMR1IE PIE1bits.TMR1IE // bit 0
3931 #define TMR2IE PIE1bits.TMR2IE // bit 1
3932 #define CCP1IE PIE1bits.CCP1IE // bit 2
3933 #define SSP1IE PIE1bits.SSP1IE // bit 3
3934 #define TXIE PIE1bits.TXIE // bit 4
3935 #define RCIE PIE1bits.RCIE // bit 5
3936 #define ADIE PIE1bits.ADIE // bit 6
3937 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
3939 #define CCP2IE PIE2bits.CCP2IE // bit 0
3940 #define BCL1IE PIE2bits.BCL1IE // bit 3
3941 #define EEIE PIE2bits.EEIE // bit 4
3942 #define C1IE PIE2bits.C1IE // bit 5
3943 #define C2IE PIE2bits.C2IE // bit 6
3944 #define OSFIE PIE2bits.OSFIE // bit 7
3946 #define TMR4IE PIE3bits.TMR4IE // bit 1
3947 #define TMR6IE PIE3bits.TMR6IE // bit 3
3948 #define CCP3IE PIE3bits.CCP3IE // bit 4
3949 #define CCP4IE PIE3bits.CCP4IE // bit 5
3951 #define TMR1IF PIR1bits.TMR1IF // bit 0
3952 #define TMR2IF PIR1bits.TMR2IF // bit 1
3953 #define CCP1IF PIR1bits.CCP1IF // bit 2
3954 #define SSP1IF PIR1bits.SSP1IF // bit 3
3955 #define TXIF PIR1bits.TXIF // bit 4
3956 #define RCIF PIR1bits.RCIF // bit 5
3957 #define ADIF PIR1bits.ADIF // bit 6
3958 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
3960 #define CCP2IF PIR2bits.CCP2IF // bit 0
3961 #define BCL1IF PIR2bits.BCL1IF // bit 3
3962 #define EEIF PIR2bits.EEIF // bit 4
3963 #define C1IF PIR2bits.C1IF // bit 5
3964 #define C2IF PIR2bits.C2IF // bit 6
3965 #define OSFIF PIR2bits.OSFIF // bit 7
3967 #define TMR4IF PIR3bits.TMR4IF // bit 1
3968 #define TMR6IF PIR3bits.TMR6IF // bit 3
3969 #define CCP3IF PIR3bits.CCP3IF // bit 4
3970 #define CCP4IF PIR3bits.CCP4IF // bit 5
3972 #define RA0 PORTAbits.RA0 // bit 0
3973 #define RA1 PORTAbits.RA1 // bit 1
3974 #define RA2 PORTAbits.RA2 // bit 2
3975 #define RA3 PORTAbits.RA3 // bit 3
3976 #define RA4 PORTAbits.RA4 // bit 4
3977 #define RA5 PORTAbits.RA5 // bit 5
3979 #define RC0 PORTCbits.RC0 // bit 0
3980 #define RC1 PORTCbits.RC1 // bit 1
3981 #define RC2 PORTCbits.RC2 // bit 2
3982 #define RC3 PORTCbits.RC3 // bit 3
3983 #define RC4 PORTCbits.RC4 // bit 4
3984 #define RC5 PORTCbits.RC5 // bit 5
3986 #define STR1A PSTR1CONbits.STR1A // bit 0
3987 #define STR1B PSTR1CONbits.STR1B // bit 1
3988 #define STR1C PSTR1CONbits.STR1C // bit 2
3989 #define STR1D PSTR1CONbits.STR1D // bit 3
3990 #define STR1SYNC PSTR1CONbits.STR1SYNC // bit 4
3992 #define STR2A PSTR2CONbits.STR2A // bit 0
3993 #define STR2B PSTR2CONbits.STR2B // bit 1
3994 #define STR2C PSTR2CONbits.STR2C // bit 2
3995 #define STR2D PSTR2CONbits.STR2D // bit 3
3996 #define STR2SYNC PSTR2CONbits.STR2SYNC // bit 4
3998 #define P1DC0 PWM1CONbits.P1DC0 // bit 0
3999 #define P1DC1 PWM1CONbits.P1DC1 // bit 1
4000 #define P1DC2 PWM1CONbits.P1DC2 // bit 2
4001 #define P1DC3 PWM1CONbits.P1DC3 // bit 3
4002 #define P1DC4 PWM1CONbits.P1DC4 // bit 4
4003 #define P1DC5 PWM1CONbits.P1DC5 // bit 5
4004 #define P1DC6 PWM1CONbits.P1DC6 // bit 6
4005 #define P1RSEN PWM1CONbits.P1RSEN // bit 7
4007 #define P2DC0 PWM2CONbits.P2DC0 // bit 0
4008 #define P2DC1 PWM2CONbits.P2DC1 // bit 1
4009 #define P2DC2 PWM2CONbits.P2DC2 // bit 2
4010 #define P2DC3 PWM2CONbits.P2DC3 // bit 3
4011 #define P2DC4 PWM2CONbits.P2DC4 // bit 4
4012 #define P2DC5 PWM2CONbits.P2DC5 // bit 5
4013 #define P2DC6 PWM2CONbits.P2DC6 // bit 6
4014 #define P2RSEN PWM2CONbits.P2RSEN // bit 7
4016 #define RX9D RCSTAbits.RX9D // bit 0
4017 #define OERR RCSTAbits.OERR // bit 1
4018 #define FERR RCSTAbits.FERR // bit 2
4019 #define ADDEN RCSTAbits.ADDEN // bit 3
4020 #define CREN RCSTAbits.CREN // bit 4
4021 #define SREN RCSTAbits.SREN // bit 5
4022 #define RX9 RCSTAbits.RX9 // bit 6
4023 #define SPEN RCSTAbits.SPEN // bit 7
4025 #define SRPR SRCON0bits.SRPR // bit 0
4026 #define SRPS SRCON0bits.SRPS // bit 1
4027 #define SRNQEN SRCON0bits.SRNQEN // bit 2
4028 #define SRQEN SRCON0bits.SRQEN // bit 3
4029 #define SRCLK0 SRCON0bits.SRCLK0 // bit 4
4030 #define SRCLK1 SRCON0bits.SRCLK1 // bit 5
4031 #define SRCLK2 SRCON0bits.SRCLK2 // bit 6
4032 #define SRLEN SRCON0bits.SRLEN // bit 7
4034 #define SRRC1E SRCON1bits.SRRC1E // bit 0
4035 #define SRRC2E SRCON1bits.SRRC2E // bit 1
4036 #define SRRCKE SRCON1bits.SRRCKE // bit 2
4037 #define SRRPE SRCON1bits.SRRPE // bit 3
4038 #define SRSC1E SRCON1bits.SRSC1E // bit 4
4039 #define SRSC2E SRCON1bits.SRSC2E // bit 5
4040 #define SRSCKE SRCON1bits.SRSCKE // bit 6
4041 #define SRSPE SRCON1bits.SRSPE // bit 7
4043 #define SSPM0 SSP1CONbits.SSPM0 // bit 0
4044 #define SSPM1 SSP1CONbits.SSPM1 // bit 1
4045 #define SSPM2 SSP1CONbits.SSPM2 // bit 2
4046 #define SSPM3 SSP1CONbits.SSPM3 // bit 3
4047 #define CKP SSP1CONbits.CKP // bit 4
4048 #define SSPEN SSP1CONbits.SSPEN // bit 5
4049 #define SSPOV SSP1CONbits.SSPOV // bit 6
4050 #define WCOL SSP1CONbits.WCOL // bit 7
4052 #define SEN SSP1CON2bits.SEN // bit 0
4053 #define RSEN SSP1CON2bits.RSEN // bit 1
4054 #define PEN SSP1CON2bits.PEN // bit 2
4055 #define RCEN SSP1CON2bits.RCEN // bit 3
4056 #define ACKEN SSP1CON2bits.ACKEN // bit 4
4057 #define ACKDT SSP1CON2bits.ACKDT // bit 5
4058 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6
4059 #define GCEN SSP1CON2bits.GCEN // bit 7
4061 #define DHEN SSP1CON3bits.DHEN // bit 0
4062 #define AHEN SSP1CON3bits.AHEN // bit 1
4063 #define SBCDE SSP1CON3bits.SBCDE // bit 2
4064 #define SDAHT SSP1CON3bits.SDAHT // bit 3
4065 #define BOEN SSP1CON3bits.BOEN // bit 4
4066 #define SCIE SSP1CON3bits.SCIE // bit 5
4067 #define PCIE SSP1CON3bits.PCIE // bit 6
4068 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7
4070 #define BF SSP1STATbits.BF // bit 0
4071 #define UA SSP1STATbits.UA // bit 1
4072 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2
4073 #define S SSP1STATbits.S // bit 3
4074 #define P SSP1STATbits.P // bit 4
4075 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5
4076 #define CKE SSP1STATbits.CKE // bit 6
4077 #define SMP SSP1STATbits.SMP // bit 7
4079 #define C STATUSbits.C // bit 0
4080 #define DC STATUSbits.DC // bit 1
4081 #define Z STATUSbits.Z // bit 2
4082 #define NOT_PD STATUSbits.NOT_PD // bit 3
4083 #define NOT_TO STATUSbits.NOT_TO // bit 4
4085 #define C_SHAD STATUS_SHADbits.C_SHAD // bit 0
4086 #define DC_SHAD STATUS_SHADbits.DC_SHAD // bit 1
4087 #define Z_SHAD STATUS_SHADbits.Z_SHAD // bit 2
4089 #define TMR1ON T1CONbits.TMR1ON // bit 0
4090 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
4091 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
4092 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
4093 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
4094 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6
4095 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7
4097 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0
4098 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1
4099 #define T1GVAL T1GCONbits.T1GVAL // bit 2
4100 #define T1GGO_NOT_DONE T1GCONbits.T1GGO_NOT_DONE // bit 3, shadows bit in T1GCONbits
4101 #define T1GGO T1GCONbits.T1GGO // bit 3, shadows bit in T1GCONbits
4102 #define T1GSPM T1GCONbits.T1GSPM // bit 4
4103 #define T1GTM T1GCONbits.T1GTM // bit 5
4104 #define T1GPOL T1GCONbits.T1GPOL // bit 6
4105 #define TMR1GE T1GCONbits.TMR1GE // bit 7
4107 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
4108 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
4109 #define TMR2ON T2CONbits.TMR2ON // bit 2
4110 #define T2OUTPS0 T2CONbits.T2OUTPS0 // bit 3
4111 #define T2OUTPS1 T2CONbits.T2OUTPS1 // bit 4
4112 #define T2OUTPS2 T2CONbits.T2OUTPS2 // bit 5
4113 #define T2OUTPS3 T2CONbits.T2OUTPS3 // bit 6
4115 #define T4CKPS0 T4CONbits.T4CKPS0 // bit 0
4116 #define T4CKPS1 T4CONbits.T4CKPS1 // bit 1
4117 #define TMR4ON T4CONbits.TMR4ON // bit 2
4118 #define T4OUTPS0 T4CONbits.T4OUTPS0 // bit 3
4119 #define T4OUTPS1 T4CONbits.T4OUTPS1 // bit 4
4120 #define T4OUTPS2 T4CONbits.T4OUTPS2 // bit 5
4121 #define T4OUTPS3 T4CONbits.T4OUTPS3 // bit 6
4123 #define T6CKPS0 T6CONbits.T6CKPS0 // bit 0
4124 #define T6CKPS1 T6CONbits.T6CKPS1 // bit 1
4125 #define TMR6ON T6CONbits.TMR6ON // bit 2
4126 #define T6OUTPS0 T6CONbits.T6OUTPS0 // bit 3
4127 #define T6OUTPS1 T6CONbits.T6OUTPS1 // bit 4
4128 #define T6OUTPS2 T6CONbits.T6OUTPS2 // bit 5
4129 #define T6OUTPS3 T6CONbits.T6OUTPS3 // bit 6
4131 #define TRISA0 TRISAbits.TRISA0 // bit 0
4132 #define TRISA1 TRISAbits.TRISA1 // bit 1
4133 #define TRISA2 TRISAbits.TRISA2 // bit 2
4134 #define TRISA3 TRISAbits.TRISA3 // bit 3
4135 #define TRISA4 TRISAbits.TRISA4 // bit 4
4136 #define TRISA5 TRISAbits.TRISA5 // bit 5
4138 #define TRISC0 TRISCbits.TRISC0 // bit 0
4139 #define TRISC1 TRISCbits.TRISC1 // bit 1
4140 #define TRISC2 TRISCbits.TRISC2 // bit 2
4141 #define TRISC3 TRISCbits.TRISC3 // bit 3
4142 #define TRISC4 TRISCbits.TRISC4 // bit 4
4143 #define TRISC5 TRISCbits.TRISC5 // bit 5
4145 #define TX9D TXSTAbits.TX9D // bit 0
4146 #define TRMT TXSTAbits.TRMT // bit 1
4147 #define BRGH TXSTAbits.BRGH // bit 2
4148 #define SENDB TXSTAbits.SENDB // bit 3
4149 #define SYNC TXSTAbits.SYNC // bit 4
4150 #define TXEN TXSTAbits.TXEN // bit 5
4151 #define TX9 TXSTAbits.TX9 // bit 6
4152 #define CSRC TXSTAbits.CSRC // bit 7
4154 #define SWDTEN WDTCONbits.SWDTEN // bit 0
4155 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
4156 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
4157 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
4158 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
4159 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5
4161 #define WPUA0 WPUAbits.WPUA0 // bit 0
4162 #define WPUA1 WPUAbits.WPUA1 // bit 1
4163 #define WPUA2 WPUAbits.WPUA2 // bit 2
4164 #define WPUA3 WPUAbits.WPUA3 // bit 3
4165 #define WPUA4 WPUAbits.WPUA4 // bit 4
4166 #define WPUA5 WPUAbits.WPUA5 // bit 5
4168 #define WPUC0 WPUCbits.WPUC0 // bit 0
4169 #define WPUC1 WPUCbits.WPUC1 // bit 1
4170 #define WPUC2 WPUCbits.WPUC2 // bit 2
4171 #define WPUC3 WPUCbits.WPUC3 // bit 3
4172 #define WPUC4 WPUCbits.WPUC4 // bit 4
4173 #define WPUC5 WPUCbits.WPUC5 // bit 5
4175 #endif // #ifndef NO_BIT_DEFINES
4177 #endif // #ifndef __PIC16LF1824_H__