Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16lf1827.h
blob33c626491934606caba50fedda24db0418a72fbf
1 /*
2 * This declarations of the PIC16LF1827 MCU.
4 * This file is part of the GNU PIC library for SDCC, originally
5 * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
7 * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:20 UTC.
9 * SDCC is licensed under the GNU Public license (GPL) v2. Note that
10 * this license covers the code to the compiler and other executables,
11 * but explicitly does not cover any code or objects generated by sdcc.
13 * For pic device libraries and header files which are derived from
14 * Microchip header (.inc) and linker script (.lkr) files Microchip
15 * requires that "The header files should state that they are only to be
16 * used with authentic Microchip devices" which makes them incompatible
17 * with the GPL. Pic device libraries and header files are located at
18 * non-free/lib and non-free/include directories respectively.
19 * Sdcc should be run with the --use-non-free command line option in
20 * order to include non-free header files and libraries.
22 * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
25 #ifndef __PIC16LF1827_H__
26 #define __PIC16LF1827_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 PORTB_ADDR 0x000D
52 #define PIR1_ADDR 0x0011
53 #define PIR2_ADDR 0x0012
54 #define PIR3_ADDR 0x0013
55 #define PIR4_ADDR 0x0014
56 #define TMR0_ADDR 0x0015
57 #define TMR1_ADDR 0x0016
58 #define TMR1L_ADDR 0x0016
59 #define TMR1H_ADDR 0x0017
60 #define T1CON_ADDR 0x0018
61 #define T1GCON_ADDR 0x0019
62 #define TMR2_ADDR 0x001A
63 #define PR2_ADDR 0x001B
64 #define T2CON_ADDR 0x001C
65 #define CPSCON0_ADDR 0x001E
66 #define CPSCON1_ADDR 0x001F
67 #define TRISA_ADDR 0x008C
68 #define TRISB_ADDR 0x008D
69 #define PIE1_ADDR 0x0091
70 #define PIE2_ADDR 0x0092
71 #define PIE3_ADDR 0x0093
72 #define PIE4_ADDR 0x0094
73 #define OPTION_REG_ADDR 0x0095
74 #define PCON_ADDR 0x0096
75 #define WDTCON_ADDR 0x0097
76 #define OSCTUNE_ADDR 0x0098
77 #define OSCCON_ADDR 0x0099
78 #define OSCSTAT_ADDR 0x009A
79 #define ADRES_ADDR 0x009B
80 #define ADRESL_ADDR 0x009B
81 #define ADRESH_ADDR 0x009C
82 #define ADCON0_ADDR 0x009D
83 #define ADCON1_ADDR 0x009E
84 #define LATA_ADDR 0x010C
85 #define LATB_ADDR 0x010D
86 #define CM1CON0_ADDR 0x0111
87 #define CM1CON1_ADDR 0x0112
88 #define CM2CON0_ADDR 0x0113
89 #define CM2CON1_ADDR 0x0114
90 #define CMOUT_ADDR 0x0115
91 #define BORCON_ADDR 0x0116
92 #define FVRCON_ADDR 0x0117
93 #define DACCON0_ADDR 0x0118
94 #define DACCON1_ADDR 0x0119
95 #define SRCON0_ADDR 0x011A
96 #define SRCON1_ADDR 0x011B
97 #define APFCON0_ADDR 0x011D
98 #define APFCON1_ADDR 0x011E
99 #define ANSELA_ADDR 0x018C
100 #define ANSELB_ADDR 0x018D
101 #define EEADR_ADDR 0x0191
102 #define EEADRL_ADDR 0x0191
103 #define EEADRH_ADDR 0x0192
104 #define EEDAT_ADDR 0x0193
105 #define EEDATL_ADDR 0x0193
106 #define EEDATH_ADDR 0x0194
107 #define EECON1_ADDR 0x0195
108 #define EECON2_ADDR 0x0196
109 #define RCREG_ADDR 0x0199
110 #define TXREG_ADDR 0x019A
111 #define SP1BRG_ADDR 0x019B
112 #define SP1BRGL_ADDR 0x019B
113 #define SPBRG_ADDR 0x019B
114 #define SPBRGL_ADDR 0x019B
115 #define SP1BRGH_ADDR 0x019C
116 #define SPBRGH_ADDR 0x019C
117 #define RCSTA_ADDR 0x019D
118 #define TXSTA_ADDR 0x019E
119 #define BAUDCON_ADDR 0x019F
120 #define WPUA_ADDR 0x020C
121 #define WPUB_ADDR 0x020D
122 #define SSP1BUF_ADDR 0x0211
123 #define SSPBUF_ADDR 0x0211
124 #define SSP1ADD_ADDR 0x0212
125 #define SSPADD_ADDR 0x0212
126 #define SSP1MSK_ADDR 0x0213
127 #define SSPMSK_ADDR 0x0213
128 #define SSP1STAT_ADDR 0x0214
129 #define SSPSTAT_ADDR 0x0214
130 #define SSP1CON1_ADDR 0x0215
131 #define SSPCON_ADDR 0x0215
132 #define SSPCON1_ADDR 0x0215
133 #define SSP1CON2_ADDR 0x0216
134 #define SSPCON2_ADDR 0x0216
135 #define SSP1CON3_ADDR 0x0217
136 #define SSPCON3_ADDR 0x0217
137 #define SSP2BUF_ADDR 0x0219
138 #define SSP2ADD_ADDR 0x021A
139 #define SSP2MSK_ADDR 0x021B
140 #define SSP2STAT_ADDR 0x021C
141 #define SSP2CON1_ADDR 0x021D
142 #define SSP2CON2_ADDR 0x021E
143 #define SSP2CON3_ADDR 0x021F
144 #define CCPR1_ADDR 0x0291
145 #define CCPR1L_ADDR 0x0291
146 #define CCPR1H_ADDR 0x0292
147 #define CCP1CON_ADDR 0x0293
148 #define PWM1CON_ADDR 0x0294
149 #define CCP1AS_ADDR 0x0295
150 #define ECCP1AS_ADDR 0x0295
151 #define PSTR1CON_ADDR 0x0296
152 #define CCPR2_ADDR 0x0298
153 #define CCPR2L_ADDR 0x0298
154 #define CCPR2H_ADDR 0x0299
155 #define CCP2CON_ADDR 0x029A
156 #define PWM2CON_ADDR 0x029B
157 #define CCP2AS_ADDR 0x029C
158 #define ECCP2AS_ADDR 0x029C
159 #define PSTR2CON_ADDR 0x029D
160 #define CCPTMRS_ADDR 0x029E
161 #define CCPTMRS0_ADDR 0x029E
162 #define CCPR3_ADDR 0x0311
163 #define CCPR3L_ADDR 0x0311
164 #define CCPR3H_ADDR 0x0312
165 #define CCP3CON_ADDR 0x0313
166 #define CCPR4_ADDR 0x0318
167 #define CCPR4L_ADDR 0x0318
168 #define CCPR4H_ADDR 0x0319
169 #define CCP4CON_ADDR 0x031A
170 #define IOCBP_ADDR 0x0394
171 #define IOCBN_ADDR 0x0395
172 #define IOCBF_ADDR 0x0396
173 #define CLKRCON_ADDR 0x039A
174 #define MDCON_ADDR 0x039C
175 #define MDSRC_ADDR 0x039D
176 #define MDCARL_ADDR 0x039E
177 #define MDCARH_ADDR 0x039F
178 #define TMR4_ADDR 0x0415
179 #define PR4_ADDR 0x0416
180 #define T4CON_ADDR 0x0417
181 #define TMR6_ADDR 0x041C
182 #define PR6_ADDR 0x041D
183 #define T6CON_ADDR 0x041E
184 #define STATUS_SHAD_ADDR 0x0FE4
185 #define WREG_SHAD_ADDR 0x0FE5
186 #define BSR_SHAD_ADDR 0x0FE6
187 #define PCLATH_SHAD_ADDR 0x0FE7
188 #define FSR0L_SHAD_ADDR 0x0FE8
189 #define FSR0H_SHAD_ADDR 0x0FE9
190 #define FSR1L_SHAD_ADDR 0x0FEA
191 #define FSR1H_SHAD_ADDR 0x0FEB
192 #define STKPTR_ADDR 0x0FED
193 #define TOSL_ADDR 0x0FEE
194 #define TOSH_ADDR 0x0FEF
196 #endif // #ifndef NO_ADDR_DEFINES
198 //==============================================================================
200 // Register Definitions
202 //==============================================================================
204 extern __at(0x0000) __sfr INDF0;
205 extern __at(0x0001) __sfr INDF1;
206 extern __at(0x0002) __sfr PCL;
208 //==============================================================================
209 // STATUS Bits
211 extern __at(0x0003) __sfr STATUS;
213 typedef struct
215 unsigned C : 1;
216 unsigned DC : 1;
217 unsigned Z : 1;
218 unsigned NOT_PD : 1;
219 unsigned NOT_TO : 1;
220 unsigned : 1;
221 unsigned : 1;
222 unsigned : 1;
223 } __STATUSbits_t;
225 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
227 #define _C 0x01
228 #define _DC 0x02
229 #define _Z 0x04
230 #define _NOT_PD 0x08
231 #define _NOT_TO 0x10
233 //==============================================================================
235 extern __at(0x0004) __sfr FSR0;
236 extern __at(0x0004) __sfr FSR0L;
237 extern __at(0x0005) __sfr FSR0H;
238 extern __at(0x0006) __sfr FSR1;
239 extern __at(0x0006) __sfr FSR1L;
240 extern __at(0x0007) __sfr FSR1H;
242 //==============================================================================
243 // BSR Bits
245 extern __at(0x0008) __sfr BSR;
247 typedef union
249 struct
251 unsigned BSR0 : 1;
252 unsigned BSR1 : 1;
253 unsigned BSR2 : 1;
254 unsigned BSR3 : 1;
255 unsigned BSR4 : 1;
256 unsigned : 1;
257 unsigned : 1;
258 unsigned : 1;
261 struct
263 unsigned BSR : 5;
264 unsigned : 3;
266 } __BSRbits_t;
268 extern __at(0x0008) volatile __BSRbits_t BSRbits;
270 #define _BSR0 0x01
271 #define _BSR1 0x02
272 #define _BSR2 0x04
273 #define _BSR3 0x08
274 #define _BSR4 0x10
276 //==============================================================================
278 extern __at(0x0009) __sfr WREG;
279 extern __at(0x000A) __sfr PCLATH;
281 //==============================================================================
282 // INTCON Bits
284 extern __at(0x000B) __sfr INTCON;
286 typedef union
288 struct
290 unsigned IOCIF : 1;
291 unsigned INTF : 1;
292 unsigned TMR0IF : 1;
293 unsigned IOCIE : 1;
294 unsigned INTE : 1;
295 unsigned TMR0IE : 1;
296 unsigned PEIE : 1;
297 unsigned GIE : 1;
300 struct
302 unsigned : 1;
303 unsigned : 1;
304 unsigned T0IF : 1;
305 unsigned : 1;
306 unsigned : 1;
307 unsigned T0IE : 1;
308 unsigned : 1;
309 unsigned : 1;
311 } __INTCONbits_t;
313 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
315 #define _IOCIF 0x01
316 #define _INTF 0x02
317 #define _TMR0IF 0x04
318 #define _T0IF 0x04
319 #define _IOCIE 0x08
320 #define _INTE 0x10
321 #define _TMR0IE 0x20
322 #define _T0IE 0x20
323 #define _PEIE 0x40
324 #define _GIE 0x80
326 //==============================================================================
329 //==============================================================================
330 // PORTA Bits
332 extern __at(0x000C) __sfr PORTA;
334 typedef struct
336 unsigned RA0 : 1;
337 unsigned RA1 : 1;
338 unsigned RA2 : 1;
339 unsigned RA3 : 1;
340 unsigned RA4 : 1;
341 unsigned RA5 : 1;
342 unsigned RA6 : 1;
343 unsigned RA7 : 1;
344 } __PORTAbits_t;
346 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
348 #define _RA0 0x01
349 #define _RA1 0x02
350 #define _RA2 0x04
351 #define _RA3 0x08
352 #define _RA4 0x10
353 #define _RA5 0x20
354 #define _RA6 0x40
355 #define _RA7 0x80
357 //==============================================================================
360 //==============================================================================
361 // PORTB Bits
363 extern __at(0x000D) __sfr PORTB;
365 typedef struct
367 unsigned RB0 : 1;
368 unsigned RB1 : 1;
369 unsigned RB2 : 1;
370 unsigned RB3 : 1;
371 unsigned RB4 : 1;
372 unsigned RB5 : 1;
373 unsigned RB6 : 1;
374 unsigned RB7 : 1;
375 } __PORTBbits_t;
377 extern __at(0x000D) volatile __PORTBbits_t PORTBbits;
379 #define _RB0 0x01
380 #define _RB1 0x02
381 #define _RB2 0x04
382 #define _RB3 0x08
383 #define _RB4 0x10
384 #define _RB5 0x20
385 #define _RB6 0x40
386 #define _RB7 0x80
388 //==============================================================================
391 //==============================================================================
392 // PIR1 Bits
394 extern __at(0x0011) __sfr PIR1;
396 typedef struct
398 unsigned TMR1IF : 1;
399 unsigned TMR2IF : 1;
400 unsigned CCP1IF : 1;
401 unsigned SSP1IF : 1;
402 unsigned TXIF : 1;
403 unsigned RCIF : 1;
404 unsigned ADIF : 1;
405 unsigned TMR1GIF : 1;
406 } __PIR1bits_t;
408 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
410 #define _TMR1IF 0x01
411 #define _TMR2IF 0x02
412 #define _CCP1IF 0x04
413 #define _SSP1IF 0x08
414 #define _TXIF 0x10
415 #define _RCIF 0x20
416 #define _ADIF 0x40
417 #define _TMR1GIF 0x80
419 //==============================================================================
422 //==============================================================================
423 // PIR2 Bits
425 extern __at(0x0012) __sfr PIR2;
427 typedef struct
429 unsigned CCP2IF : 1;
430 unsigned : 1;
431 unsigned : 1;
432 unsigned BCL1IF : 1;
433 unsigned EEIF : 1;
434 unsigned C1IF : 1;
435 unsigned C2IF : 1;
436 unsigned OSFIF : 1;
437 } __PIR2bits_t;
439 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
441 #define _CCP2IF 0x01
442 #define _BCL1IF 0x08
443 #define _EEIF 0x10
444 #define _C1IF 0x20
445 #define _C2IF 0x40
446 #define _OSFIF 0x80
448 //==============================================================================
451 //==============================================================================
452 // PIR3 Bits
454 extern __at(0x0013) __sfr PIR3;
456 typedef struct
458 unsigned : 1;
459 unsigned TMR4IF : 1;
460 unsigned : 1;
461 unsigned TMR6IF : 1;
462 unsigned CCP3IF : 1;
463 unsigned CCP4IF : 1;
464 unsigned : 1;
465 unsigned : 1;
466 } __PIR3bits_t;
468 extern __at(0x0013) volatile __PIR3bits_t PIR3bits;
470 #define _TMR4IF 0x02
471 #define _TMR6IF 0x08
472 #define _CCP3IF 0x10
473 #define _CCP4IF 0x20
475 //==============================================================================
478 //==============================================================================
479 // PIR4 Bits
481 extern __at(0x0014) __sfr PIR4;
483 typedef struct
485 unsigned SSP2IF : 1;
486 unsigned BCL2IF : 1;
487 unsigned : 1;
488 unsigned : 1;
489 unsigned : 1;
490 unsigned : 1;
491 unsigned : 1;
492 unsigned : 1;
493 } __PIR4bits_t;
495 extern __at(0x0014) volatile __PIR4bits_t PIR4bits;
497 #define _SSP2IF 0x01
498 #define _BCL2IF 0x02
500 //==============================================================================
502 extern __at(0x0015) __sfr TMR0;
503 extern __at(0x0016) __sfr TMR1;
504 extern __at(0x0016) __sfr TMR1L;
505 extern __at(0x0017) __sfr TMR1H;
507 //==============================================================================
508 // T1CON Bits
510 extern __at(0x0018) __sfr T1CON;
512 typedef union
514 struct
516 unsigned TMR1ON : 1;
517 unsigned : 1;
518 unsigned NOT_T1SYNC : 1;
519 unsigned T1OSCEN : 1;
520 unsigned T1CKPS0 : 1;
521 unsigned T1CKPS1 : 1;
522 unsigned TMR1CS0 : 1;
523 unsigned TMR1CS1 : 1;
526 struct
528 unsigned : 4;
529 unsigned T1CKPS : 2;
530 unsigned : 2;
533 struct
535 unsigned : 6;
536 unsigned TMR1CS : 2;
538 } __T1CONbits_t;
540 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
542 #define _TMR1ON 0x01
543 #define _NOT_T1SYNC 0x04
544 #define _T1OSCEN 0x08
545 #define _T1CKPS0 0x10
546 #define _T1CKPS1 0x20
547 #define _TMR1CS0 0x40
548 #define _TMR1CS1 0x80
550 //==============================================================================
553 //==============================================================================
554 // T1GCON Bits
556 extern __at(0x0019) __sfr T1GCON;
558 typedef union
560 struct
562 unsigned T1GSS0 : 1;
563 unsigned T1GSS1 : 1;
564 unsigned T1GVAL : 1;
565 unsigned T1GGO : 1;
566 unsigned T1GSPM : 1;
567 unsigned T1GTM : 1;
568 unsigned T1GPOL : 1;
569 unsigned TMR1GE : 1;
572 struct
574 unsigned T1GSS : 2;
575 unsigned : 6;
577 } __T1GCONbits_t;
579 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
581 #define _T1GSS0 0x01
582 #define _T1GSS1 0x02
583 #define _T1GVAL 0x04
584 #define _T1GGO 0x08
585 #define _T1GSPM 0x10
586 #define _T1GTM 0x20
587 #define _T1GPOL 0x40
588 #define _TMR1GE 0x80
590 //==============================================================================
592 extern __at(0x001A) __sfr TMR2;
593 extern __at(0x001B) __sfr PR2;
595 //==============================================================================
596 // T2CON Bits
598 extern __at(0x001C) __sfr T2CON;
600 typedef union
602 struct
604 unsigned T2CKPS0 : 1;
605 unsigned T2CKPS1 : 1;
606 unsigned TMR2ON : 1;
607 unsigned T2OUTPS0 : 1;
608 unsigned T2OUTPS1 : 1;
609 unsigned T2OUTPS2 : 1;
610 unsigned T2OUTPS3 : 1;
611 unsigned : 1;
614 struct
616 unsigned T2CKPS : 2;
617 unsigned : 6;
620 struct
622 unsigned : 3;
623 unsigned T2OUTPS : 4;
624 unsigned : 1;
626 } __T2CONbits_t;
628 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
630 #define _T2CKPS0 0x01
631 #define _T2CKPS1 0x02
632 #define _TMR2ON 0x04
633 #define _T2OUTPS0 0x08
634 #define _T2OUTPS1 0x10
635 #define _T2OUTPS2 0x20
636 #define _T2OUTPS3 0x40
638 //==============================================================================
641 //==============================================================================
642 // CPSCON0 Bits
644 extern __at(0x001E) __sfr CPSCON0;
646 typedef union
648 struct
650 unsigned T0XCS : 1;
651 unsigned CPSOUT : 1;
652 unsigned CPSRNG0 : 1;
653 unsigned CPSRNG1 : 1;
654 unsigned : 1;
655 unsigned : 1;
656 unsigned : 1;
657 unsigned CPSON : 1;
660 struct
662 unsigned : 2;
663 unsigned CPSRNG : 2;
664 unsigned : 4;
666 } __CPSCON0bits_t;
668 extern __at(0x001E) volatile __CPSCON0bits_t CPSCON0bits;
670 #define _T0XCS 0x01
671 #define _CPSOUT 0x02
672 #define _CPSRNG0 0x04
673 #define _CPSRNG1 0x08
674 #define _CPSON 0x80
676 //==============================================================================
679 //==============================================================================
680 // CPSCON1 Bits
682 extern __at(0x001F) __sfr CPSCON1;
684 typedef union
686 struct
688 unsigned CPSCH0 : 1;
689 unsigned CPSCH1 : 1;
690 unsigned CPSCH2 : 1;
691 unsigned CPSCH3 : 1;
692 unsigned : 1;
693 unsigned : 1;
694 unsigned : 1;
695 unsigned : 1;
698 struct
700 unsigned CPSCH : 4;
701 unsigned : 4;
703 } __CPSCON1bits_t;
705 extern __at(0x001F) volatile __CPSCON1bits_t CPSCON1bits;
707 #define _CPSCH0 0x01
708 #define _CPSCH1 0x02
709 #define _CPSCH2 0x04
710 #define _CPSCH3 0x08
712 //==============================================================================
715 //==============================================================================
716 // TRISA Bits
718 extern __at(0x008C) __sfr TRISA;
720 typedef struct
722 unsigned TRISA0 : 1;
723 unsigned TRISA1 : 1;
724 unsigned TRISA2 : 1;
725 unsigned TRISA3 : 1;
726 unsigned TRISA4 : 1;
727 unsigned TRISA5 : 1;
728 unsigned TRISA6 : 1;
729 unsigned TRISA7 : 1;
730 } __TRISAbits_t;
732 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
734 #define _TRISA0 0x01
735 #define _TRISA1 0x02
736 #define _TRISA2 0x04
737 #define _TRISA3 0x08
738 #define _TRISA4 0x10
739 #define _TRISA5 0x20
740 #define _TRISA6 0x40
741 #define _TRISA7 0x80
743 //==============================================================================
746 //==============================================================================
747 // TRISB Bits
749 extern __at(0x008D) __sfr TRISB;
751 typedef struct
753 unsigned TRISB0 : 1;
754 unsigned TRISB1 : 1;
755 unsigned TRISB2 : 1;
756 unsigned TRISB3 : 1;
757 unsigned TRISB4 : 1;
758 unsigned TRISB5 : 1;
759 unsigned TRISB6 : 1;
760 unsigned TRISB7 : 1;
761 } __TRISBbits_t;
763 extern __at(0x008D) volatile __TRISBbits_t TRISBbits;
765 #define _TRISB0 0x01
766 #define _TRISB1 0x02
767 #define _TRISB2 0x04
768 #define _TRISB3 0x08
769 #define _TRISB4 0x10
770 #define _TRISB5 0x20
771 #define _TRISB6 0x40
772 #define _TRISB7 0x80
774 //==============================================================================
777 //==============================================================================
778 // PIE1 Bits
780 extern __at(0x0091) __sfr PIE1;
782 typedef struct
784 unsigned TMR1IE : 1;
785 unsigned TMR2IE : 1;
786 unsigned CCP1IE : 1;
787 unsigned SSP1IE : 1;
788 unsigned TXIE : 1;
789 unsigned RCIE : 1;
790 unsigned ADIE : 1;
791 unsigned TMR1GIE : 1;
792 } __PIE1bits_t;
794 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
796 #define _TMR1IE 0x01
797 #define _TMR2IE 0x02
798 #define _CCP1IE 0x04
799 #define _SSP1IE 0x08
800 #define _TXIE 0x10
801 #define _RCIE 0x20
802 #define _ADIE 0x40
803 #define _TMR1GIE 0x80
805 //==============================================================================
808 //==============================================================================
809 // PIE2 Bits
811 extern __at(0x0092) __sfr PIE2;
813 typedef struct
815 unsigned CCP2IE : 1;
816 unsigned : 1;
817 unsigned : 1;
818 unsigned BCL1IE : 1;
819 unsigned EEIE : 1;
820 unsigned C1IE : 1;
821 unsigned C2IE : 1;
822 unsigned OSFIE : 1;
823 } __PIE2bits_t;
825 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
827 #define _CCP2IE 0x01
828 #define _BCL1IE 0x08
829 #define _EEIE 0x10
830 #define _C1IE 0x20
831 #define _C2IE 0x40
832 #define _OSFIE 0x80
834 //==============================================================================
837 //==============================================================================
838 // PIE3 Bits
840 extern __at(0x0093) __sfr PIE3;
842 typedef struct
844 unsigned : 1;
845 unsigned TMR4IE : 1;
846 unsigned : 1;
847 unsigned TMR6IE : 1;
848 unsigned CCP3IE : 1;
849 unsigned CCP4IE : 1;
850 unsigned : 1;
851 unsigned : 1;
852 } __PIE3bits_t;
854 extern __at(0x0093) volatile __PIE3bits_t PIE3bits;
856 #define _TMR4IE 0x02
857 #define _TMR6IE 0x08
858 #define _CCP3IE 0x10
859 #define _CCP4IE 0x20
861 //==============================================================================
864 //==============================================================================
865 // PIE4 Bits
867 extern __at(0x0094) __sfr PIE4;
869 typedef struct
871 unsigned SSP2IE : 1;
872 unsigned BCL2IE : 1;
873 unsigned : 1;
874 unsigned : 1;
875 unsigned : 1;
876 unsigned : 1;
877 unsigned : 1;
878 unsigned : 1;
879 } __PIE4bits_t;
881 extern __at(0x0094) volatile __PIE4bits_t PIE4bits;
883 #define _SSP2IE 0x01
884 #define _BCL2IE 0x02
886 //==============================================================================
889 //==============================================================================
890 // OPTION_REG Bits
892 extern __at(0x0095) __sfr OPTION_REG;
894 typedef union
896 struct
898 unsigned PS0 : 1;
899 unsigned PS1 : 1;
900 unsigned PS2 : 1;
901 unsigned PSA : 1;
902 unsigned TMR0SE : 1;
903 unsigned TMR0CS : 1;
904 unsigned INTEDG : 1;
905 unsigned NOT_WPUEN : 1;
908 struct
910 unsigned : 1;
911 unsigned : 1;
912 unsigned : 1;
913 unsigned : 1;
914 unsigned T0SE : 1;
915 unsigned T0CS : 1;
916 unsigned : 1;
917 unsigned : 1;
920 struct
922 unsigned PS : 3;
923 unsigned : 5;
925 } __OPTION_REGbits_t;
927 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
929 #define _PS0 0x01
930 #define _PS1 0x02
931 #define _PS2 0x04
932 #define _PSA 0x08
933 #define _TMR0SE 0x10
934 #define _T0SE 0x10
935 #define _TMR0CS 0x20
936 #define _T0CS 0x20
937 #define _INTEDG 0x40
938 #define _NOT_WPUEN 0x80
940 //==============================================================================
943 //==============================================================================
944 // PCON Bits
946 extern __at(0x0096) __sfr PCON;
948 typedef struct
950 unsigned NOT_BOR : 1;
951 unsigned NOT_POR : 1;
952 unsigned NOT_RI : 1;
953 unsigned NOT_RMCLR : 1;
954 unsigned : 1;
955 unsigned : 1;
956 unsigned STKUNF : 1;
957 unsigned STKOVF : 1;
958 } __PCONbits_t;
960 extern __at(0x0096) volatile __PCONbits_t PCONbits;
962 #define _NOT_BOR 0x01
963 #define _NOT_POR 0x02
964 #define _NOT_RI 0x04
965 #define _NOT_RMCLR 0x08
966 #define _STKUNF 0x40
967 #define _STKOVF 0x80
969 //==============================================================================
972 //==============================================================================
973 // WDTCON Bits
975 extern __at(0x0097) __sfr WDTCON;
977 typedef union
979 struct
981 unsigned SWDTEN : 1;
982 unsigned WDTPS0 : 1;
983 unsigned WDTPS1 : 1;
984 unsigned WDTPS2 : 1;
985 unsigned WDTPS3 : 1;
986 unsigned WDTPS4 : 1;
987 unsigned : 1;
988 unsigned : 1;
991 struct
993 unsigned : 1;
994 unsigned WDTPS : 5;
995 unsigned : 2;
997 } __WDTCONbits_t;
999 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
1001 #define _SWDTEN 0x01
1002 #define _WDTPS0 0x02
1003 #define _WDTPS1 0x04
1004 #define _WDTPS2 0x08
1005 #define _WDTPS3 0x10
1006 #define _WDTPS4 0x20
1008 //==============================================================================
1011 //==============================================================================
1012 // OSCTUNE Bits
1014 extern __at(0x0098) __sfr OSCTUNE;
1016 typedef union
1018 struct
1020 unsigned TUN0 : 1;
1021 unsigned TUN1 : 1;
1022 unsigned TUN2 : 1;
1023 unsigned TUN3 : 1;
1024 unsigned TUN4 : 1;
1025 unsigned TUN5 : 1;
1026 unsigned : 1;
1027 unsigned : 1;
1030 struct
1032 unsigned TUN : 6;
1033 unsigned : 2;
1035 } __OSCTUNEbits_t;
1037 extern __at(0x0098) volatile __OSCTUNEbits_t OSCTUNEbits;
1039 #define _TUN0 0x01
1040 #define _TUN1 0x02
1041 #define _TUN2 0x04
1042 #define _TUN3 0x08
1043 #define _TUN4 0x10
1044 #define _TUN5 0x20
1046 //==============================================================================
1049 //==============================================================================
1050 // OSCCON Bits
1052 extern __at(0x0099) __sfr OSCCON;
1054 typedef union
1056 struct
1058 unsigned SCS0 : 1;
1059 unsigned SCS1 : 1;
1060 unsigned : 1;
1061 unsigned IRCF0 : 1;
1062 unsigned IRCF1 : 1;
1063 unsigned IRCF2 : 1;
1064 unsigned IRCF3 : 1;
1065 unsigned SPLLEN : 1;
1068 struct
1070 unsigned SCS : 2;
1071 unsigned : 6;
1074 struct
1076 unsigned : 3;
1077 unsigned IRCF : 4;
1078 unsigned : 1;
1080 } __OSCCONbits_t;
1082 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
1084 #define _SCS0 0x01
1085 #define _SCS1 0x02
1086 #define _IRCF0 0x08
1087 #define _IRCF1 0x10
1088 #define _IRCF2 0x20
1089 #define _IRCF3 0x40
1090 #define _SPLLEN 0x80
1092 //==============================================================================
1095 //==============================================================================
1096 // OSCSTAT Bits
1098 extern __at(0x009A) __sfr OSCSTAT;
1100 typedef struct
1102 unsigned HFIOFS : 1;
1103 unsigned LFIOFR : 1;
1104 unsigned MFIOFR : 1;
1105 unsigned HFIOFL : 1;
1106 unsigned HFIOFR : 1;
1107 unsigned OSTS : 1;
1108 unsigned PLLR : 1;
1109 unsigned T1OSCR : 1;
1110 } __OSCSTATbits_t;
1112 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
1114 #define _HFIOFS 0x01
1115 #define _LFIOFR 0x02
1116 #define _MFIOFR 0x04
1117 #define _HFIOFL 0x08
1118 #define _HFIOFR 0x10
1119 #define _OSTS 0x20
1120 #define _PLLR 0x40
1121 #define _T1OSCR 0x80
1123 //==============================================================================
1125 extern __at(0x009B) __sfr ADRES;
1126 extern __at(0x009B) __sfr ADRESL;
1127 extern __at(0x009C) __sfr ADRESH;
1129 //==============================================================================
1130 // ADCON0 Bits
1132 extern __at(0x009D) __sfr ADCON0;
1134 typedef union
1136 struct
1138 unsigned ADON : 1;
1139 unsigned GO_NOT_DONE : 1;
1140 unsigned CHS0 : 1;
1141 unsigned CHS1 : 1;
1142 unsigned CHS2 : 1;
1143 unsigned CHS3 : 1;
1144 unsigned CHS4 : 1;
1145 unsigned : 1;
1148 struct
1150 unsigned : 1;
1151 unsigned ADGO : 1;
1152 unsigned : 1;
1153 unsigned : 1;
1154 unsigned : 1;
1155 unsigned : 1;
1156 unsigned : 1;
1157 unsigned : 1;
1160 struct
1162 unsigned : 1;
1163 unsigned GO : 1;
1164 unsigned : 1;
1165 unsigned : 1;
1166 unsigned : 1;
1167 unsigned : 1;
1168 unsigned : 1;
1169 unsigned : 1;
1172 struct
1174 unsigned : 2;
1175 unsigned CHS : 5;
1176 unsigned : 1;
1178 } __ADCON0bits_t;
1180 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1182 #define _ADON 0x01
1183 #define _GO_NOT_DONE 0x02
1184 #define _ADGO 0x02
1185 #define _GO 0x02
1186 #define _CHS0 0x04
1187 #define _CHS1 0x08
1188 #define _CHS2 0x10
1189 #define _CHS3 0x20
1190 #define _CHS4 0x40
1192 //==============================================================================
1195 //==============================================================================
1196 // ADCON1 Bits
1198 extern __at(0x009E) __sfr ADCON1;
1200 typedef union
1202 struct
1204 unsigned ADPREF0 : 1;
1205 unsigned ADPREF1 : 1;
1206 unsigned ADNREF : 1;
1207 unsigned : 1;
1208 unsigned ADCS0 : 1;
1209 unsigned ADCS1 : 1;
1210 unsigned ADCS2 : 1;
1211 unsigned ADFM : 1;
1214 struct
1216 unsigned ADPREF : 2;
1217 unsigned : 6;
1220 struct
1222 unsigned : 4;
1223 unsigned ADCS : 3;
1224 unsigned : 1;
1226 } __ADCON1bits_t;
1228 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1230 #define _ADPREF0 0x01
1231 #define _ADPREF1 0x02
1232 #define _ADNREF 0x04
1233 #define _ADCS0 0x10
1234 #define _ADCS1 0x20
1235 #define _ADCS2 0x40
1236 #define _ADFM 0x80
1238 //==============================================================================
1241 //==============================================================================
1242 // LATA Bits
1244 extern __at(0x010C) __sfr LATA;
1246 typedef struct
1248 unsigned LATA0 : 1;
1249 unsigned LATA1 : 1;
1250 unsigned LATA2 : 1;
1251 unsigned LATA3 : 1;
1252 unsigned LATA4 : 1;
1253 unsigned : 1;
1254 unsigned LATA6 : 1;
1255 unsigned LATA7 : 1;
1256 } __LATAbits_t;
1258 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1260 #define _LATA0 0x01
1261 #define _LATA1 0x02
1262 #define _LATA2 0x04
1263 #define _LATA3 0x08
1264 #define _LATA4 0x10
1265 #define _LATA6 0x40
1266 #define _LATA7 0x80
1268 //==============================================================================
1271 //==============================================================================
1272 // LATB Bits
1274 extern __at(0x010D) __sfr LATB;
1276 typedef struct
1278 unsigned LATB0 : 1;
1279 unsigned LATB1 : 1;
1280 unsigned LATB2 : 1;
1281 unsigned LATB3 : 1;
1282 unsigned LATB4 : 1;
1283 unsigned LATB5 : 1;
1284 unsigned LATB6 : 1;
1285 unsigned LATB7 : 1;
1286 } __LATBbits_t;
1288 extern __at(0x010D) volatile __LATBbits_t LATBbits;
1290 #define _LATB0 0x01
1291 #define _LATB1 0x02
1292 #define _LATB2 0x04
1293 #define _LATB3 0x08
1294 #define _LATB4 0x10
1295 #define _LATB5 0x20
1296 #define _LATB6 0x40
1297 #define _LATB7 0x80
1299 //==============================================================================
1302 //==============================================================================
1303 // CM1CON0 Bits
1305 extern __at(0x0111) __sfr CM1CON0;
1307 typedef struct
1309 unsigned C1SYNC : 1;
1310 unsigned C1HYS : 1;
1311 unsigned C1SP : 1;
1312 unsigned : 1;
1313 unsigned C1POL : 1;
1314 unsigned C1OE : 1;
1315 unsigned C1OUT : 1;
1316 unsigned C1ON : 1;
1317 } __CM1CON0bits_t;
1319 extern __at(0x0111) volatile __CM1CON0bits_t CM1CON0bits;
1321 #define _C1SYNC 0x01
1322 #define _C1HYS 0x02
1323 #define _C1SP 0x04
1324 #define _C1POL 0x10
1325 #define _C1OE 0x20
1326 #define _C1OUT 0x40
1327 #define _C1ON 0x80
1329 //==============================================================================
1332 //==============================================================================
1333 // CM1CON1 Bits
1335 extern __at(0x0112) __sfr CM1CON1;
1337 typedef union
1339 struct
1341 unsigned C1NCH0 : 1;
1342 unsigned C1NCH1 : 1;
1343 unsigned : 1;
1344 unsigned : 1;
1345 unsigned C1PCH0 : 1;
1346 unsigned C1PCH1 : 1;
1347 unsigned C1INTN : 1;
1348 unsigned C1INTP : 1;
1351 struct
1353 unsigned C1NCH : 2;
1354 unsigned : 6;
1357 struct
1359 unsigned : 4;
1360 unsigned C1PCH : 2;
1361 unsigned : 2;
1363 } __CM1CON1bits_t;
1365 extern __at(0x0112) volatile __CM1CON1bits_t CM1CON1bits;
1367 #define _C1NCH0 0x01
1368 #define _C1NCH1 0x02
1369 #define _C1PCH0 0x10
1370 #define _C1PCH1 0x20
1371 #define _C1INTN 0x40
1372 #define _C1INTP 0x80
1374 //==============================================================================
1377 //==============================================================================
1378 // CM2CON0 Bits
1380 extern __at(0x0113) __sfr CM2CON0;
1382 typedef struct
1384 unsigned C2SYNC : 1;
1385 unsigned C2HYS : 1;
1386 unsigned C2SP : 1;
1387 unsigned : 1;
1388 unsigned C2POL : 1;
1389 unsigned C2OE : 1;
1390 unsigned C2OUT : 1;
1391 unsigned C2ON : 1;
1392 } __CM2CON0bits_t;
1394 extern __at(0x0113) volatile __CM2CON0bits_t CM2CON0bits;
1396 #define _C2SYNC 0x01
1397 #define _C2HYS 0x02
1398 #define _C2SP 0x04
1399 #define _C2POL 0x10
1400 #define _C2OE 0x20
1401 #define _C2OUT 0x40
1402 #define _C2ON 0x80
1404 //==============================================================================
1407 //==============================================================================
1408 // CM2CON1 Bits
1410 extern __at(0x0114) __sfr CM2CON1;
1412 typedef union
1414 struct
1416 unsigned C2NCH0 : 1;
1417 unsigned C2NCH1 : 1;
1418 unsigned : 1;
1419 unsigned : 1;
1420 unsigned C2PCH0 : 1;
1421 unsigned C2PCH1 : 1;
1422 unsigned C2INTN : 1;
1423 unsigned C2INTP : 1;
1426 struct
1428 unsigned C2NCH : 2;
1429 unsigned : 6;
1432 struct
1434 unsigned : 4;
1435 unsigned C2PCH : 2;
1436 unsigned : 2;
1438 } __CM2CON1bits_t;
1440 extern __at(0x0114) volatile __CM2CON1bits_t CM2CON1bits;
1442 #define _C2NCH0 0x01
1443 #define _C2NCH1 0x02
1444 #define _C2PCH0 0x10
1445 #define _C2PCH1 0x20
1446 #define _C2INTN 0x40
1447 #define _C2INTP 0x80
1449 //==============================================================================
1452 //==============================================================================
1453 // CMOUT Bits
1455 extern __at(0x0115) __sfr CMOUT;
1457 typedef struct
1459 unsigned MC1OUT : 1;
1460 unsigned MC2OUT : 1;
1461 unsigned : 1;
1462 unsigned : 1;
1463 unsigned : 1;
1464 unsigned : 1;
1465 unsigned : 1;
1466 unsigned : 1;
1467 } __CMOUTbits_t;
1469 extern __at(0x0115) volatile __CMOUTbits_t CMOUTbits;
1471 #define _MC1OUT 0x01
1472 #define _MC2OUT 0x02
1474 //==============================================================================
1477 //==============================================================================
1478 // BORCON Bits
1480 extern __at(0x0116) __sfr BORCON;
1482 typedef struct
1484 unsigned BORRDY : 1;
1485 unsigned : 1;
1486 unsigned : 1;
1487 unsigned : 1;
1488 unsigned : 1;
1489 unsigned : 1;
1490 unsigned : 1;
1491 unsigned SBOREN : 1;
1492 } __BORCONbits_t;
1494 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1496 #define _BORRDY 0x01
1497 #define _SBOREN 0x80
1499 //==============================================================================
1502 //==============================================================================
1503 // FVRCON Bits
1505 extern __at(0x0117) __sfr FVRCON;
1507 typedef union
1509 struct
1511 unsigned ADFVR0 : 1;
1512 unsigned ADFVR1 : 1;
1513 unsigned CDAFVR0 : 1;
1514 unsigned CDAFVR1 : 1;
1515 unsigned TSRNG : 1;
1516 unsigned TSEN : 1;
1517 unsigned FVRRDY : 1;
1518 unsigned FVREN : 1;
1521 struct
1523 unsigned ADFVR : 2;
1524 unsigned : 6;
1527 struct
1529 unsigned : 2;
1530 unsigned CDAFVR : 2;
1531 unsigned : 4;
1533 } __FVRCONbits_t;
1535 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1537 #define _ADFVR0 0x01
1538 #define _ADFVR1 0x02
1539 #define _CDAFVR0 0x04
1540 #define _CDAFVR1 0x08
1541 #define _TSRNG 0x10
1542 #define _TSEN 0x20
1543 #define _FVRRDY 0x40
1544 #define _FVREN 0x80
1546 //==============================================================================
1549 //==============================================================================
1550 // DACCON0 Bits
1552 extern __at(0x0118) __sfr DACCON0;
1554 typedef union
1556 struct
1558 unsigned DACNSS : 1;
1559 unsigned : 1;
1560 unsigned DACPSS0 : 1;
1561 unsigned DACPSS1 : 1;
1562 unsigned : 1;
1563 unsigned DACOE : 1;
1564 unsigned DACLPS : 1;
1565 unsigned DACEN : 1;
1568 struct
1570 unsigned : 2;
1571 unsigned DACPSS : 2;
1572 unsigned : 4;
1574 } __DACCON0bits_t;
1576 extern __at(0x0118) volatile __DACCON0bits_t DACCON0bits;
1578 #define _DACNSS 0x01
1579 #define _DACPSS0 0x04
1580 #define _DACPSS1 0x08
1581 #define _DACOE 0x20
1582 #define _DACLPS 0x40
1583 #define _DACEN 0x80
1585 //==============================================================================
1588 //==============================================================================
1589 // DACCON1 Bits
1591 extern __at(0x0119) __sfr DACCON1;
1593 typedef union
1595 struct
1597 unsigned DACR0 : 1;
1598 unsigned DACR1 : 1;
1599 unsigned DACR2 : 1;
1600 unsigned DACR3 : 1;
1601 unsigned DACR4 : 1;
1602 unsigned : 1;
1603 unsigned : 1;
1604 unsigned : 1;
1607 struct
1609 unsigned DACR : 5;
1610 unsigned : 3;
1612 } __DACCON1bits_t;
1614 extern __at(0x0119) volatile __DACCON1bits_t DACCON1bits;
1616 #define _DACR0 0x01
1617 #define _DACR1 0x02
1618 #define _DACR2 0x04
1619 #define _DACR3 0x08
1620 #define _DACR4 0x10
1622 //==============================================================================
1625 //==============================================================================
1626 // SRCON0 Bits
1628 extern __at(0x011A) __sfr SRCON0;
1630 typedef union
1632 struct
1634 unsigned SRPR : 1;
1635 unsigned SRPS : 1;
1636 unsigned SRNQEN : 1;
1637 unsigned SRQEN : 1;
1638 unsigned SRCLK0 : 1;
1639 unsigned SRCLK1 : 1;
1640 unsigned SRCLK2 : 1;
1641 unsigned SRLEN : 1;
1644 struct
1646 unsigned : 4;
1647 unsigned SRCLK : 3;
1648 unsigned : 1;
1650 } __SRCON0bits_t;
1652 extern __at(0x011A) volatile __SRCON0bits_t SRCON0bits;
1654 #define _SRPR 0x01
1655 #define _SRPS 0x02
1656 #define _SRNQEN 0x04
1657 #define _SRQEN 0x08
1658 #define _SRCLK0 0x10
1659 #define _SRCLK1 0x20
1660 #define _SRCLK2 0x40
1661 #define _SRLEN 0x80
1663 //==============================================================================
1666 //==============================================================================
1667 // SRCON1 Bits
1669 extern __at(0x011B) __sfr SRCON1;
1671 typedef struct
1673 unsigned SRRC1E : 1;
1674 unsigned SRRC2E : 1;
1675 unsigned SRRCKE : 1;
1676 unsigned SRRPE : 1;
1677 unsigned SRSC1E : 1;
1678 unsigned SRSC2E : 1;
1679 unsigned SRSCKE : 1;
1680 unsigned SRSPE : 1;
1681 } __SRCON1bits_t;
1683 extern __at(0x011B) volatile __SRCON1bits_t SRCON1bits;
1685 #define _SRRC1E 0x01
1686 #define _SRRC2E 0x02
1687 #define _SRRCKE 0x04
1688 #define _SRRPE 0x08
1689 #define _SRSC1E 0x10
1690 #define _SRSC2E 0x20
1691 #define _SRSCKE 0x40
1692 #define _SRSPE 0x80
1694 //==============================================================================
1697 //==============================================================================
1698 // APFCON0 Bits
1700 extern __at(0x011D) __sfr APFCON0;
1702 typedef struct
1704 unsigned CCP1SEL : 1;
1705 unsigned P1CSEL : 1;
1706 unsigned P1DSEL : 1;
1707 unsigned CCP2SEL : 1;
1708 unsigned P2BSEL : 1;
1709 unsigned SS1SEL : 1;
1710 unsigned SDO1SEL : 1;
1711 unsigned RXDTSEL : 1;
1712 } __APFCON0bits_t;
1714 extern __at(0x011D) volatile __APFCON0bits_t APFCON0bits;
1716 #define _CCP1SEL 0x01
1717 #define _P1CSEL 0x02
1718 #define _P1DSEL 0x04
1719 #define _CCP2SEL 0x08
1720 #define _P2BSEL 0x10
1721 #define _SS1SEL 0x20
1722 #define _SDO1SEL 0x40
1723 #define _RXDTSEL 0x80
1725 //==============================================================================
1728 //==============================================================================
1729 // APFCON1 Bits
1731 extern __at(0x011E) __sfr APFCON1;
1733 typedef struct
1735 unsigned TXCKSEL : 1;
1736 unsigned : 1;
1737 unsigned : 1;
1738 unsigned : 1;
1739 unsigned : 1;
1740 unsigned : 1;
1741 unsigned : 1;
1742 unsigned : 1;
1743 } __APFCON1bits_t;
1745 extern __at(0x011E) volatile __APFCON1bits_t APFCON1bits;
1747 #define _TXCKSEL 0x01
1749 //==============================================================================
1752 //==============================================================================
1753 // ANSELA Bits
1755 extern __at(0x018C) __sfr ANSELA;
1757 typedef union
1759 struct
1761 unsigned ANSA0 : 1;
1762 unsigned ANSA1 : 1;
1763 unsigned ANSA2 : 1;
1764 unsigned ANSA3 : 1;
1765 unsigned ANSA4 : 1;
1766 unsigned : 1;
1767 unsigned : 1;
1768 unsigned : 1;
1771 struct
1773 unsigned ANSA : 5;
1774 unsigned : 3;
1776 } __ANSELAbits_t;
1778 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1780 #define _ANSA0 0x01
1781 #define _ANSA1 0x02
1782 #define _ANSA2 0x04
1783 #define _ANSA3 0x08
1784 #define _ANSA4 0x10
1786 //==============================================================================
1789 //==============================================================================
1790 // ANSELB Bits
1792 extern __at(0x018D) __sfr ANSELB;
1794 typedef struct
1796 unsigned : 1;
1797 unsigned ANSB1 : 1;
1798 unsigned ANSB2 : 1;
1799 unsigned ANSB3 : 1;
1800 unsigned ANSB4 : 1;
1801 unsigned ANSB5 : 1;
1802 unsigned ANSB6 : 1;
1803 unsigned ANSB7 : 1;
1804 } __ANSELBbits_t;
1806 extern __at(0x018D) volatile __ANSELBbits_t ANSELBbits;
1808 #define _ANSB1 0x02
1809 #define _ANSB2 0x04
1810 #define _ANSB3 0x08
1811 #define _ANSB4 0x10
1812 #define _ANSB5 0x20
1813 #define _ANSB6 0x40
1814 #define _ANSB7 0x80
1816 //==============================================================================
1818 extern __at(0x0191) __sfr EEADR;
1819 extern __at(0x0191) __sfr EEADRL;
1820 extern __at(0x0192) __sfr EEADRH;
1821 extern __at(0x0193) __sfr EEDAT;
1822 extern __at(0x0193) __sfr EEDATL;
1823 extern __at(0x0194) __sfr EEDATH;
1825 //==============================================================================
1826 // EECON1 Bits
1828 extern __at(0x0195) __sfr EECON1;
1830 typedef struct
1832 unsigned RD : 1;
1833 unsigned WR : 1;
1834 unsigned WREN : 1;
1835 unsigned WRERR : 1;
1836 unsigned FREE : 1;
1837 unsigned LWLO : 1;
1838 unsigned CFGS : 1;
1839 unsigned EEPGD : 1;
1840 } __EECON1bits_t;
1842 extern __at(0x0195) volatile __EECON1bits_t EECON1bits;
1844 #define _RD 0x01
1845 #define _WR 0x02
1846 #define _WREN 0x04
1847 #define _WRERR 0x08
1848 #define _FREE 0x10
1849 #define _LWLO 0x20
1850 #define _CFGS 0x40
1851 #define _EEPGD 0x80
1853 //==============================================================================
1855 extern __at(0x0196) __sfr EECON2;
1856 extern __at(0x0199) __sfr RCREG;
1857 extern __at(0x019A) __sfr TXREG;
1858 extern __at(0x019B) __sfr SP1BRG;
1859 extern __at(0x019B) __sfr SP1BRGL;
1860 extern __at(0x019B) __sfr SPBRG;
1861 extern __at(0x019B) __sfr SPBRGL;
1862 extern __at(0x019C) __sfr SP1BRGH;
1863 extern __at(0x019C) __sfr SPBRGH;
1865 //==============================================================================
1866 // RCSTA Bits
1868 extern __at(0x019D) __sfr RCSTA;
1870 typedef struct
1872 unsigned RX9D : 1;
1873 unsigned OERR : 1;
1874 unsigned FERR : 1;
1875 unsigned ADDEN : 1;
1876 unsigned CREN : 1;
1877 unsigned SREN : 1;
1878 unsigned RX9 : 1;
1879 unsigned SPEN : 1;
1880 } __RCSTAbits_t;
1882 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
1884 #define _RX9D 0x01
1885 #define _OERR 0x02
1886 #define _FERR 0x04
1887 #define _ADDEN 0x08
1888 #define _CREN 0x10
1889 #define _SREN 0x20
1890 #define _RX9 0x40
1891 #define _SPEN 0x80
1893 //==============================================================================
1896 //==============================================================================
1897 // TXSTA Bits
1899 extern __at(0x019E) __sfr TXSTA;
1901 typedef struct
1903 unsigned TX9D : 1;
1904 unsigned TRMT : 1;
1905 unsigned BRGH : 1;
1906 unsigned SENDB : 1;
1907 unsigned SYNC : 1;
1908 unsigned TXEN : 1;
1909 unsigned TX9 : 1;
1910 unsigned CSRC : 1;
1911 } __TXSTAbits_t;
1913 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
1915 #define _TX9D 0x01
1916 #define _TRMT 0x02
1917 #define _BRGH 0x04
1918 #define _SENDB 0x08
1919 #define _SYNC 0x10
1920 #define _TXEN 0x20
1921 #define _TX9 0x40
1922 #define _CSRC 0x80
1924 //==============================================================================
1927 //==============================================================================
1928 // BAUDCON Bits
1930 extern __at(0x019F) __sfr BAUDCON;
1932 typedef struct
1934 unsigned ABDEN : 1;
1935 unsigned WUE : 1;
1936 unsigned : 1;
1937 unsigned BRG16 : 1;
1938 unsigned SCKP : 1;
1939 unsigned : 1;
1940 unsigned RCIDL : 1;
1941 unsigned ABDOVF : 1;
1942 } __BAUDCONbits_t;
1944 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
1946 #define _ABDEN 0x01
1947 #define _WUE 0x02
1948 #define _BRG16 0x08
1949 #define _SCKP 0x10
1950 #define _RCIDL 0x40
1951 #define _ABDOVF 0x80
1953 //==============================================================================
1956 //==============================================================================
1957 // WPUA Bits
1959 extern __at(0x020C) __sfr WPUA;
1961 typedef struct
1963 unsigned : 1;
1964 unsigned : 1;
1965 unsigned : 1;
1966 unsigned : 1;
1967 unsigned : 1;
1968 unsigned WPUA5 : 1;
1969 unsigned : 1;
1970 unsigned : 1;
1971 } __WPUAbits_t;
1973 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
1975 #define _WPUA5 0x20
1977 //==============================================================================
1980 //==============================================================================
1981 // WPUB Bits
1983 extern __at(0x020D) __sfr WPUB;
1985 typedef struct
1987 unsigned WPUB0 : 1;
1988 unsigned WPUB1 : 1;
1989 unsigned WPUB2 : 1;
1990 unsigned WPUB3 : 1;
1991 unsigned WPUB4 : 1;
1992 unsigned WPUB5 : 1;
1993 unsigned WPUB6 : 1;
1994 unsigned WPUB7 : 1;
1995 } __WPUBbits_t;
1997 extern __at(0x020D) volatile __WPUBbits_t WPUBbits;
1999 #define _WPUB0 0x01
2000 #define _WPUB1 0x02
2001 #define _WPUB2 0x04
2002 #define _WPUB3 0x08
2003 #define _WPUB4 0x10
2004 #define _WPUB5 0x20
2005 #define _WPUB6 0x40
2006 #define _WPUB7 0x80
2008 //==============================================================================
2010 extern __at(0x0211) __sfr SSP1BUF;
2011 extern __at(0x0211) __sfr SSPBUF;
2012 extern __at(0x0212) __sfr SSP1ADD;
2013 extern __at(0x0212) __sfr SSPADD;
2014 extern __at(0x0213) __sfr SSP1MSK;
2015 extern __at(0x0213) __sfr SSPMSK;
2017 //==============================================================================
2018 // SSP1STAT Bits
2020 extern __at(0x0214) __sfr SSP1STAT;
2022 typedef struct
2024 unsigned BF : 1;
2025 unsigned UA : 1;
2026 unsigned R_NOT_W : 1;
2027 unsigned S : 1;
2028 unsigned P : 1;
2029 unsigned D_NOT_A : 1;
2030 unsigned CKE : 1;
2031 unsigned SMP : 1;
2032 } __SSP1STATbits_t;
2034 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
2036 #define _BF 0x01
2037 #define _UA 0x02
2038 #define _R_NOT_W 0x04
2039 #define _S 0x08
2040 #define _P 0x10
2041 #define _D_NOT_A 0x20
2042 #define _CKE 0x40
2043 #define _SMP 0x80
2045 //==============================================================================
2048 //==============================================================================
2049 // SSPSTAT Bits
2051 extern __at(0x0214) __sfr SSPSTAT;
2053 typedef struct
2055 unsigned BF : 1;
2056 unsigned UA : 1;
2057 unsigned R_NOT_W : 1;
2058 unsigned S : 1;
2059 unsigned P : 1;
2060 unsigned D_NOT_A : 1;
2061 unsigned CKE : 1;
2062 unsigned SMP : 1;
2063 } __SSPSTATbits_t;
2065 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
2067 #define _SSPSTAT_BF 0x01
2068 #define _SSPSTAT_UA 0x02
2069 #define _SSPSTAT_R_NOT_W 0x04
2070 #define _SSPSTAT_S 0x08
2071 #define _SSPSTAT_P 0x10
2072 #define _SSPSTAT_D_NOT_A 0x20
2073 #define _SSPSTAT_CKE 0x40
2074 #define _SSPSTAT_SMP 0x80
2076 //==============================================================================
2079 //==============================================================================
2080 // SSP1CON1 Bits
2082 extern __at(0x0215) __sfr SSP1CON1;
2084 typedef union
2086 struct
2088 unsigned SSPM0 : 1;
2089 unsigned SSPM1 : 1;
2090 unsigned SSPM2 : 1;
2091 unsigned SSPM3 : 1;
2092 unsigned CKP : 1;
2093 unsigned SSPEN : 1;
2094 unsigned SSPOV : 1;
2095 unsigned WCOL : 1;
2098 struct
2100 unsigned SSPM : 4;
2101 unsigned : 4;
2103 } __SSP1CON1bits_t;
2105 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
2107 #define _SSPM0 0x01
2108 #define _SSPM1 0x02
2109 #define _SSPM2 0x04
2110 #define _SSPM3 0x08
2111 #define _CKP 0x10
2112 #define _SSPEN 0x20
2113 #define _SSPOV 0x40
2114 #define _WCOL 0x80
2116 //==============================================================================
2119 //==============================================================================
2120 // SSPCON Bits
2122 extern __at(0x0215) __sfr SSPCON;
2124 typedef union
2126 struct
2128 unsigned SSPM0 : 1;
2129 unsigned SSPM1 : 1;
2130 unsigned SSPM2 : 1;
2131 unsigned SSPM3 : 1;
2132 unsigned CKP : 1;
2133 unsigned SSPEN : 1;
2134 unsigned SSPOV : 1;
2135 unsigned WCOL : 1;
2138 struct
2140 unsigned SSPM : 4;
2141 unsigned : 4;
2143 } __SSPCONbits_t;
2145 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
2147 #define _SSPCON_SSPM0 0x01
2148 #define _SSPCON_SSPM1 0x02
2149 #define _SSPCON_SSPM2 0x04
2150 #define _SSPCON_SSPM3 0x08
2151 #define _SSPCON_CKP 0x10
2152 #define _SSPCON_SSPEN 0x20
2153 #define _SSPCON_SSPOV 0x40
2154 #define _SSPCON_WCOL 0x80
2156 //==============================================================================
2159 //==============================================================================
2160 // SSPCON1 Bits
2162 extern __at(0x0215) __sfr SSPCON1;
2164 typedef union
2166 struct
2168 unsigned SSPM0 : 1;
2169 unsigned SSPM1 : 1;
2170 unsigned SSPM2 : 1;
2171 unsigned SSPM3 : 1;
2172 unsigned CKP : 1;
2173 unsigned SSPEN : 1;
2174 unsigned SSPOV : 1;
2175 unsigned WCOL : 1;
2178 struct
2180 unsigned SSPM : 4;
2181 unsigned : 4;
2183 } __SSPCON1bits_t;
2185 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
2187 #define _SSPCON1_SSPM0 0x01
2188 #define _SSPCON1_SSPM1 0x02
2189 #define _SSPCON1_SSPM2 0x04
2190 #define _SSPCON1_SSPM3 0x08
2191 #define _SSPCON1_CKP 0x10
2192 #define _SSPCON1_SSPEN 0x20
2193 #define _SSPCON1_SSPOV 0x40
2194 #define _SSPCON1_WCOL 0x80
2196 //==============================================================================
2199 //==============================================================================
2200 // SSP1CON2 Bits
2202 extern __at(0x0216) __sfr SSP1CON2;
2204 typedef struct
2206 unsigned SEN : 1;
2207 unsigned RSEN : 1;
2208 unsigned PEN : 1;
2209 unsigned RCEN : 1;
2210 unsigned ACKEN : 1;
2211 unsigned ACKDT : 1;
2212 unsigned ACKSTAT : 1;
2213 unsigned GCEN : 1;
2214 } __SSP1CON2bits_t;
2216 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
2218 #define _SEN 0x01
2219 #define _RSEN 0x02
2220 #define _PEN 0x04
2221 #define _RCEN 0x08
2222 #define _ACKEN 0x10
2223 #define _ACKDT 0x20
2224 #define _ACKSTAT 0x40
2225 #define _GCEN 0x80
2227 //==============================================================================
2230 //==============================================================================
2231 // SSPCON2 Bits
2233 extern __at(0x0216) __sfr SSPCON2;
2235 typedef struct
2237 unsigned SEN : 1;
2238 unsigned RSEN : 1;
2239 unsigned PEN : 1;
2240 unsigned RCEN : 1;
2241 unsigned ACKEN : 1;
2242 unsigned ACKDT : 1;
2243 unsigned ACKSTAT : 1;
2244 unsigned GCEN : 1;
2245 } __SSPCON2bits_t;
2247 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
2249 #define _SSPCON2_SEN 0x01
2250 #define _SSPCON2_RSEN 0x02
2251 #define _SSPCON2_PEN 0x04
2252 #define _SSPCON2_RCEN 0x08
2253 #define _SSPCON2_ACKEN 0x10
2254 #define _SSPCON2_ACKDT 0x20
2255 #define _SSPCON2_ACKSTAT 0x40
2256 #define _SSPCON2_GCEN 0x80
2258 //==============================================================================
2261 //==============================================================================
2262 // SSP1CON3 Bits
2264 extern __at(0x0217) __sfr SSP1CON3;
2266 typedef struct
2268 unsigned DHEN : 1;
2269 unsigned AHEN : 1;
2270 unsigned SBCDE : 1;
2271 unsigned SDAHT : 1;
2272 unsigned BOEN : 1;
2273 unsigned SCIE : 1;
2274 unsigned PCIE : 1;
2275 unsigned ACKTIM : 1;
2276 } __SSP1CON3bits_t;
2278 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
2280 #define _DHEN 0x01
2281 #define _AHEN 0x02
2282 #define _SBCDE 0x04
2283 #define _SDAHT 0x08
2284 #define _BOEN 0x10
2285 #define _SCIE 0x20
2286 #define _PCIE 0x40
2287 #define _ACKTIM 0x80
2289 //==============================================================================
2292 //==============================================================================
2293 // SSPCON3 Bits
2295 extern __at(0x0217) __sfr SSPCON3;
2297 typedef struct
2299 unsigned DHEN : 1;
2300 unsigned AHEN : 1;
2301 unsigned SBCDE : 1;
2302 unsigned SDAHT : 1;
2303 unsigned BOEN : 1;
2304 unsigned SCIE : 1;
2305 unsigned PCIE : 1;
2306 unsigned ACKTIM : 1;
2307 } __SSPCON3bits_t;
2309 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
2311 #define _SSPCON3_DHEN 0x01
2312 #define _SSPCON3_AHEN 0x02
2313 #define _SSPCON3_SBCDE 0x04
2314 #define _SSPCON3_SDAHT 0x08
2315 #define _SSPCON3_BOEN 0x10
2316 #define _SSPCON3_SCIE 0x20
2317 #define _SSPCON3_PCIE 0x40
2318 #define _SSPCON3_ACKTIM 0x80
2320 //==============================================================================
2322 extern __at(0x0219) __sfr SSP2BUF;
2323 extern __at(0x021A) __sfr SSP2ADD;
2324 extern __at(0x021B) __sfr SSP2MSK;
2326 //==============================================================================
2327 // SSP2STAT Bits
2329 extern __at(0x021C) __sfr SSP2STAT;
2331 typedef struct
2333 unsigned BF : 1;
2334 unsigned UA : 1;
2335 unsigned R_NOT_W : 1;
2336 unsigned S : 1;
2337 unsigned P : 1;
2338 unsigned D_NOT_A : 1;
2339 unsigned CKE : 1;
2340 unsigned SMP : 1;
2341 } __SSP2STATbits_t;
2343 extern __at(0x021C) volatile __SSP2STATbits_t SSP2STATbits;
2345 #define _SSP2STAT_BF 0x01
2346 #define _SSP2STAT_UA 0x02
2347 #define _SSP2STAT_R_NOT_W 0x04
2348 #define _SSP2STAT_S 0x08
2349 #define _SSP2STAT_P 0x10
2350 #define _SSP2STAT_D_NOT_A 0x20
2351 #define _SSP2STAT_CKE 0x40
2352 #define _SSP2STAT_SMP 0x80
2354 //==============================================================================
2357 //==============================================================================
2358 // SSP2CON1 Bits
2360 extern __at(0x021D) __sfr SSP2CON1;
2362 typedef union
2364 struct
2366 unsigned SSPM0 : 1;
2367 unsigned SSPM1 : 1;
2368 unsigned SSPM2 : 1;
2369 unsigned SSPM3 : 1;
2370 unsigned CKP : 1;
2371 unsigned SSPEN : 1;
2372 unsigned SSPOV : 1;
2373 unsigned WCOL : 1;
2376 struct
2378 unsigned SSPM : 4;
2379 unsigned : 4;
2381 } __SSP2CON1bits_t;
2383 extern __at(0x021D) volatile __SSP2CON1bits_t SSP2CON1bits;
2385 #define _SSP2CON1_SSPM0 0x01
2386 #define _SSP2CON1_SSPM1 0x02
2387 #define _SSP2CON1_SSPM2 0x04
2388 #define _SSP2CON1_SSPM3 0x08
2389 #define _SSP2CON1_CKP 0x10
2390 #define _SSP2CON1_SSPEN 0x20
2391 #define _SSP2CON1_SSPOV 0x40
2392 #define _SSP2CON1_WCOL 0x80
2394 //==============================================================================
2397 //==============================================================================
2398 // SSP2CON2 Bits
2400 extern __at(0x021E) __sfr SSP2CON2;
2402 typedef struct
2404 unsigned SEN : 1;
2405 unsigned RSEN : 1;
2406 unsigned PEN : 1;
2407 unsigned RCEN : 1;
2408 unsigned ACKEN : 1;
2409 unsigned ACKDT : 1;
2410 unsigned ACKSTAT : 1;
2411 unsigned GCEN : 1;
2412 } __SSP2CON2bits_t;
2414 extern __at(0x021E) volatile __SSP2CON2bits_t SSP2CON2bits;
2416 #define _SSP2CON2_SEN 0x01
2417 #define _SSP2CON2_RSEN 0x02
2418 #define _SSP2CON2_PEN 0x04
2419 #define _SSP2CON2_RCEN 0x08
2420 #define _SSP2CON2_ACKEN 0x10
2421 #define _SSP2CON2_ACKDT 0x20
2422 #define _SSP2CON2_ACKSTAT 0x40
2423 #define _SSP2CON2_GCEN 0x80
2425 //==============================================================================
2428 //==============================================================================
2429 // SSP2CON3 Bits
2431 extern __at(0x021F) __sfr SSP2CON3;
2433 typedef struct
2435 unsigned DHEN : 1;
2436 unsigned AHEN : 1;
2437 unsigned SBCDE : 1;
2438 unsigned SDAHT : 1;
2439 unsigned BOEN : 1;
2440 unsigned SCIE : 1;
2441 unsigned PCIE : 1;
2442 unsigned ACKTIM : 1;
2443 } __SSP2CON3bits_t;
2445 extern __at(0x021F) volatile __SSP2CON3bits_t SSP2CON3bits;
2447 #define _SSP2CON3_DHEN 0x01
2448 #define _SSP2CON3_AHEN 0x02
2449 #define _SSP2CON3_SBCDE 0x04
2450 #define _SSP2CON3_SDAHT 0x08
2451 #define _SSP2CON3_BOEN 0x10
2452 #define _SSP2CON3_SCIE 0x20
2453 #define _SSP2CON3_PCIE 0x40
2454 #define _SSP2CON3_ACKTIM 0x80
2456 //==============================================================================
2458 extern __at(0x0291) __sfr CCPR1;
2459 extern __at(0x0291) __sfr CCPR1L;
2460 extern __at(0x0292) __sfr CCPR1H;
2462 //==============================================================================
2463 // CCP1CON Bits
2465 extern __at(0x0293) __sfr CCP1CON;
2467 typedef union
2469 struct
2471 unsigned CCP1M0 : 1;
2472 unsigned CCP1M1 : 1;
2473 unsigned CCP1M2 : 1;
2474 unsigned CCP1M3 : 1;
2475 unsigned DC1B0 : 1;
2476 unsigned DC1B1 : 1;
2477 unsigned P1M0 : 1;
2478 unsigned P1M1 : 1;
2481 struct
2483 unsigned CCP1M : 4;
2484 unsigned : 4;
2487 struct
2489 unsigned : 4;
2490 unsigned DC1B : 2;
2491 unsigned : 2;
2494 struct
2496 unsigned : 6;
2497 unsigned P1M : 2;
2499 } __CCP1CONbits_t;
2501 extern __at(0x0293) volatile __CCP1CONbits_t CCP1CONbits;
2503 #define _CCP1M0 0x01
2504 #define _CCP1M1 0x02
2505 #define _CCP1M2 0x04
2506 #define _CCP1M3 0x08
2507 #define _DC1B0 0x10
2508 #define _DC1B1 0x20
2509 #define _P1M0 0x40
2510 #define _P1M1 0x80
2512 //==============================================================================
2515 //==============================================================================
2516 // PWM1CON Bits
2518 extern __at(0x0294) __sfr PWM1CON;
2520 typedef union
2522 struct
2524 unsigned P1DC0 : 1;
2525 unsigned P1DC1 : 1;
2526 unsigned P1DC2 : 1;
2527 unsigned P1DC3 : 1;
2528 unsigned P1DC4 : 1;
2529 unsigned P1DC5 : 1;
2530 unsigned P1DC6 : 1;
2531 unsigned P1RSEN : 1;
2534 struct
2536 unsigned P1DC : 7;
2537 unsigned : 1;
2539 } __PWM1CONbits_t;
2541 extern __at(0x0294) volatile __PWM1CONbits_t PWM1CONbits;
2543 #define _P1DC0 0x01
2544 #define _P1DC1 0x02
2545 #define _P1DC2 0x04
2546 #define _P1DC3 0x08
2547 #define _P1DC4 0x10
2548 #define _P1DC5 0x20
2549 #define _P1DC6 0x40
2550 #define _P1RSEN 0x80
2552 //==============================================================================
2555 //==============================================================================
2556 // CCP1AS Bits
2558 extern __at(0x0295) __sfr CCP1AS;
2560 typedef union
2562 struct
2564 unsigned PSS1BD0 : 1;
2565 unsigned PSS1BD1 : 1;
2566 unsigned PSS1AC0 : 1;
2567 unsigned PSS1AC1 : 1;
2568 unsigned CCP1AS0 : 1;
2569 unsigned CCP1AS1 : 1;
2570 unsigned CCP1AS2 : 1;
2571 unsigned CCP1ASE : 1;
2574 struct
2576 unsigned PSS1BD : 2;
2577 unsigned : 6;
2580 struct
2582 unsigned : 2;
2583 unsigned PSS1AC : 2;
2584 unsigned : 4;
2587 struct
2589 unsigned : 4;
2590 unsigned CCP1AS : 3;
2591 unsigned : 1;
2593 } __CCP1ASbits_t;
2595 extern __at(0x0295) volatile __CCP1ASbits_t CCP1ASbits;
2597 #define _PSS1BD0 0x01
2598 #define _PSS1BD1 0x02
2599 #define _PSS1AC0 0x04
2600 #define _PSS1AC1 0x08
2601 #define _CCP1AS0 0x10
2602 #define _CCP1AS1 0x20
2603 #define _CCP1AS2 0x40
2604 #define _CCP1ASE 0x80
2606 //==============================================================================
2609 //==============================================================================
2610 // ECCP1AS Bits
2612 extern __at(0x0295) __sfr ECCP1AS;
2614 typedef union
2616 struct
2618 unsigned PSS1BD0 : 1;
2619 unsigned PSS1BD1 : 1;
2620 unsigned PSS1AC0 : 1;
2621 unsigned PSS1AC1 : 1;
2622 unsigned CCP1AS0 : 1;
2623 unsigned CCP1AS1 : 1;
2624 unsigned CCP1AS2 : 1;
2625 unsigned CCP1ASE : 1;
2628 struct
2630 unsigned PSS1BD : 2;
2631 unsigned : 6;
2634 struct
2636 unsigned : 2;
2637 unsigned PSS1AC : 2;
2638 unsigned : 4;
2641 struct
2643 unsigned : 4;
2644 unsigned CCP1AS : 3;
2645 unsigned : 1;
2647 } __ECCP1ASbits_t;
2649 extern __at(0x0295) volatile __ECCP1ASbits_t ECCP1ASbits;
2651 #define _ECCP1AS_PSS1BD0 0x01
2652 #define _ECCP1AS_PSS1BD1 0x02
2653 #define _ECCP1AS_PSS1AC0 0x04
2654 #define _ECCP1AS_PSS1AC1 0x08
2655 #define _ECCP1AS_CCP1AS0 0x10
2656 #define _ECCP1AS_CCP1AS1 0x20
2657 #define _ECCP1AS_CCP1AS2 0x40
2658 #define _ECCP1AS_CCP1ASE 0x80
2660 //==============================================================================
2663 //==============================================================================
2664 // PSTR1CON Bits
2666 extern __at(0x0296) __sfr PSTR1CON;
2668 typedef struct
2670 unsigned STR1A : 1;
2671 unsigned STR1B : 1;
2672 unsigned STR1C : 1;
2673 unsigned STR1D : 1;
2674 unsigned STR1SYNC : 1;
2675 unsigned : 1;
2676 unsigned : 1;
2677 unsigned : 1;
2678 } __PSTR1CONbits_t;
2680 extern __at(0x0296) volatile __PSTR1CONbits_t PSTR1CONbits;
2682 #define _STR1A 0x01
2683 #define _STR1B 0x02
2684 #define _STR1C 0x04
2685 #define _STR1D 0x08
2686 #define _STR1SYNC 0x10
2688 //==============================================================================
2690 extern __at(0x0298) __sfr CCPR2;
2691 extern __at(0x0298) __sfr CCPR2L;
2692 extern __at(0x0299) __sfr CCPR2H;
2694 //==============================================================================
2695 // CCP2CON Bits
2697 extern __at(0x029A) __sfr CCP2CON;
2699 typedef union
2701 struct
2703 unsigned CCP2M0 : 1;
2704 unsigned CCP2M1 : 1;
2705 unsigned CCP2M2 : 1;
2706 unsigned CCP2M3 : 1;
2707 unsigned DC2B0 : 1;
2708 unsigned DC2B1 : 1;
2709 unsigned P2M0 : 1;
2710 unsigned P2M1 : 1;
2713 struct
2715 unsigned CCP2M : 4;
2716 unsigned : 4;
2719 struct
2721 unsigned : 4;
2722 unsigned DC2B : 2;
2723 unsigned : 2;
2726 struct
2728 unsigned : 6;
2729 unsigned P2M : 2;
2731 } __CCP2CONbits_t;
2733 extern __at(0x029A) volatile __CCP2CONbits_t CCP2CONbits;
2735 #define _CCP2M0 0x01
2736 #define _CCP2M1 0x02
2737 #define _CCP2M2 0x04
2738 #define _CCP2M3 0x08
2739 #define _DC2B0 0x10
2740 #define _DC2B1 0x20
2741 #define _P2M0 0x40
2742 #define _P2M1 0x80
2744 //==============================================================================
2747 //==============================================================================
2748 // PWM2CON Bits
2750 extern __at(0x029B) __sfr PWM2CON;
2752 typedef union
2754 struct
2756 unsigned P2DC0 : 1;
2757 unsigned P2DC1 : 1;
2758 unsigned P2DC2 : 1;
2759 unsigned P2DC3 : 1;
2760 unsigned P2DC4 : 1;
2761 unsigned P2DC5 : 1;
2762 unsigned P2DC6 : 1;
2763 unsigned P2RSEN : 1;
2766 struct
2768 unsigned P2DC : 7;
2769 unsigned : 1;
2771 } __PWM2CONbits_t;
2773 extern __at(0x029B) volatile __PWM2CONbits_t PWM2CONbits;
2775 #define _P2DC0 0x01
2776 #define _P2DC1 0x02
2777 #define _P2DC2 0x04
2778 #define _P2DC3 0x08
2779 #define _P2DC4 0x10
2780 #define _P2DC5 0x20
2781 #define _P2DC6 0x40
2782 #define _P2RSEN 0x80
2784 //==============================================================================
2787 //==============================================================================
2788 // CCP2AS Bits
2790 extern __at(0x029C) __sfr CCP2AS;
2792 typedef union
2794 struct
2796 unsigned PSS2BD0 : 1;
2797 unsigned PSS2BD1 : 1;
2798 unsigned PSS2AC0 : 1;
2799 unsigned PSS2AC1 : 1;
2800 unsigned CCP2AS0 : 1;
2801 unsigned CCP2AS1 : 1;
2802 unsigned CCP2AS2 : 1;
2803 unsigned CCP2ASE : 1;
2806 struct
2808 unsigned PSS2BD : 2;
2809 unsigned : 6;
2812 struct
2814 unsigned : 2;
2815 unsigned PSS2AC : 2;
2816 unsigned : 4;
2819 struct
2821 unsigned : 4;
2822 unsigned CCP2AS : 3;
2823 unsigned : 1;
2825 } __CCP2ASbits_t;
2827 extern __at(0x029C) volatile __CCP2ASbits_t CCP2ASbits;
2829 #define _PSS2BD0 0x01
2830 #define _PSS2BD1 0x02
2831 #define _PSS2AC0 0x04
2832 #define _PSS2AC1 0x08
2833 #define _CCP2AS0 0x10
2834 #define _CCP2AS1 0x20
2835 #define _CCP2AS2 0x40
2836 #define _CCP2ASE 0x80
2838 //==============================================================================
2841 //==============================================================================
2842 // ECCP2AS Bits
2844 extern __at(0x029C) __sfr ECCP2AS;
2846 typedef union
2848 struct
2850 unsigned PSS2BD0 : 1;
2851 unsigned PSS2BD1 : 1;
2852 unsigned PSS2AC0 : 1;
2853 unsigned PSS2AC1 : 1;
2854 unsigned CCP2AS0 : 1;
2855 unsigned CCP2AS1 : 1;
2856 unsigned CCP2AS2 : 1;
2857 unsigned CCP2ASE : 1;
2860 struct
2862 unsigned PSS2BD : 2;
2863 unsigned : 6;
2866 struct
2868 unsigned : 2;
2869 unsigned PSS2AC : 2;
2870 unsigned : 4;
2873 struct
2875 unsigned : 4;
2876 unsigned CCP2AS : 3;
2877 unsigned : 1;
2879 } __ECCP2ASbits_t;
2881 extern __at(0x029C) volatile __ECCP2ASbits_t ECCP2ASbits;
2883 #define _ECCP2AS_PSS2BD0 0x01
2884 #define _ECCP2AS_PSS2BD1 0x02
2885 #define _ECCP2AS_PSS2AC0 0x04
2886 #define _ECCP2AS_PSS2AC1 0x08
2887 #define _ECCP2AS_CCP2AS0 0x10
2888 #define _ECCP2AS_CCP2AS1 0x20
2889 #define _ECCP2AS_CCP2AS2 0x40
2890 #define _ECCP2AS_CCP2ASE 0x80
2892 //==============================================================================
2895 //==============================================================================
2896 // PSTR2CON Bits
2898 extern __at(0x029D) __sfr PSTR2CON;
2900 typedef struct
2902 unsigned STR2A : 1;
2903 unsigned STR2B : 1;
2904 unsigned STR2C : 1;
2905 unsigned STR2D : 1;
2906 unsigned STR2SYNC : 1;
2907 unsigned : 1;
2908 unsigned : 1;
2909 unsigned : 1;
2910 } __PSTR2CONbits_t;
2912 extern __at(0x029D) volatile __PSTR2CONbits_t PSTR2CONbits;
2914 #define _STR2A 0x01
2915 #define _STR2B 0x02
2916 #define _STR2C 0x04
2917 #define _STR2D 0x08
2918 #define _STR2SYNC 0x10
2920 //==============================================================================
2923 //==============================================================================
2924 // CCPTMRS Bits
2926 extern __at(0x029E) __sfr CCPTMRS;
2928 typedef union
2930 struct
2932 unsigned C1TSEL0 : 1;
2933 unsigned C1TSEL1 : 1;
2934 unsigned C2TSEL0 : 1;
2935 unsigned C2TSEL1 : 1;
2936 unsigned C3TSEL0 : 1;
2937 unsigned C3TSEL1 : 1;
2938 unsigned C4TSEL0 : 1;
2939 unsigned C4TSEL1 : 1;
2942 struct
2944 unsigned C1TSEL : 2;
2945 unsigned : 6;
2948 struct
2950 unsigned : 2;
2951 unsigned C2TSEL : 2;
2952 unsigned : 4;
2955 struct
2957 unsigned : 4;
2958 unsigned C3TSEL : 2;
2959 unsigned : 2;
2962 struct
2964 unsigned : 6;
2965 unsigned C4TSEL : 2;
2967 } __CCPTMRSbits_t;
2969 extern __at(0x029E) volatile __CCPTMRSbits_t CCPTMRSbits;
2971 #define _C1TSEL0 0x01
2972 #define _C1TSEL1 0x02
2973 #define _C2TSEL0 0x04
2974 #define _C2TSEL1 0x08
2975 #define _C3TSEL0 0x10
2976 #define _C3TSEL1 0x20
2977 #define _C4TSEL0 0x40
2978 #define _C4TSEL1 0x80
2980 //==============================================================================
2983 //==============================================================================
2984 // CCPTMRS0 Bits
2986 extern __at(0x029E) __sfr CCPTMRS0;
2988 typedef union
2990 struct
2992 unsigned C1TSEL0 : 1;
2993 unsigned C1TSEL1 : 1;
2994 unsigned C2TSEL0 : 1;
2995 unsigned C2TSEL1 : 1;
2996 unsigned C3TSEL0 : 1;
2997 unsigned C3TSEL1 : 1;
2998 unsigned C4TSEL0 : 1;
2999 unsigned C4TSEL1 : 1;
3002 struct
3004 unsigned C1TSEL : 2;
3005 unsigned : 6;
3008 struct
3010 unsigned : 2;
3011 unsigned C2TSEL : 2;
3012 unsigned : 4;
3015 struct
3017 unsigned : 4;
3018 unsigned C3TSEL : 2;
3019 unsigned : 2;
3022 struct
3024 unsigned : 6;
3025 unsigned C4TSEL : 2;
3027 } __CCPTMRS0bits_t;
3029 extern __at(0x029E) volatile __CCPTMRS0bits_t CCPTMRS0bits;
3031 #define _CCPTMRS0_C1TSEL0 0x01
3032 #define _CCPTMRS0_C1TSEL1 0x02
3033 #define _CCPTMRS0_C2TSEL0 0x04
3034 #define _CCPTMRS0_C2TSEL1 0x08
3035 #define _CCPTMRS0_C3TSEL0 0x10
3036 #define _CCPTMRS0_C3TSEL1 0x20
3037 #define _CCPTMRS0_C4TSEL0 0x40
3038 #define _CCPTMRS0_C4TSEL1 0x80
3040 //==============================================================================
3042 extern __at(0x0311) __sfr CCPR3;
3043 extern __at(0x0311) __sfr CCPR3L;
3044 extern __at(0x0312) __sfr CCPR3H;
3046 //==============================================================================
3047 // CCP3CON Bits
3049 extern __at(0x0313) __sfr CCP3CON;
3051 typedef union
3053 struct
3055 unsigned CCP3M0 : 1;
3056 unsigned CCP3M1 : 1;
3057 unsigned CCP3M2 : 1;
3058 unsigned CCP3M3 : 1;
3059 unsigned DC3B0 : 1;
3060 unsigned DC3B1 : 1;
3061 unsigned : 1;
3062 unsigned : 1;
3065 struct
3067 unsigned CCP3M : 4;
3068 unsigned : 4;
3071 struct
3073 unsigned : 4;
3074 unsigned DC3B : 2;
3075 unsigned : 2;
3077 } __CCP3CONbits_t;
3079 extern __at(0x0313) volatile __CCP3CONbits_t CCP3CONbits;
3081 #define _CCP3M0 0x01
3082 #define _CCP3M1 0x02
3083 #define _CCP3M2 0x04
3084 #define _CCP3M3 0x08
3085 #define _DC3B0 0x10
3086 #define _DC3B1 0x20
3088 //==============================================================================
3090 extern __at(0x0318) __sfr CCPR4;
3091 extern __at(0x0318) __sfr CCPR4L;
3092 extern __at(0x0319) __sfr CCPR4H;
3094 //==============================================================================
3095 // CCP4CON Bits
3097 extern __at(0x031A) __sfr CCP4CON;
3099 typedef union
3101 struct
3103 unsigned CCP4M0 : 1;
3104 unsigned CCP4M1 : 1;
3105 unsigned CCP4M2 : 1;
3106 unsigned CCP4M3 : 1;
3107 unsigned DC4B0 : 1;
3108 unsigned DC4B1 : 1;
3109 unsigned : 1;
3110 unsigned : 1;
3113 struct
3115 unsigned CCP4M : 4;
3116 unsigned : 4;
3119 struct
3121 unsigned : 4;
3122 unsigned DC4B : 2;
3123 unsigned : 2;
3125 } __CCP4CONbits_t;
3127 extern __at(0x031A) volatile __CCP4CONbits_t CCP4CONbits;
3129 #define _CCP4M0 0x01
3130 #define _CCP4M1 0x02
3131 #define _CCP4M2 0x04
3132 #define _CCP4M3 0x08
3133 #define _DC4B0 0x10
3134 #define _DC4B1 0x20
3136 //==============================================================================
3139 //==============================================================================
3140 // IOCBP Bits
3142 extern __at(0x0394) __sfr IOCBP;
3144 typedef struct
3146 unsigned IOCBP0 : 1;
3147 unsigned IOCBP1 : 1;
3148 unsigned IOCBP2 : 1;
3149 unsigned IOCBP3 : 1;
3150 unsigned IOCBP4 : 1;
3151 unsigned IOCBP5 : 1;
3152 unsigned IOCBP6 : 1;
3153 unsigned IOCBP7 : 1;
3154 } __IOCBPbits_t;
3156 extern __at(0x0394) volatile __IOCBPbits_t IOCBPbits;
3158 #define _IOCBP0 0x01
3159 #define _IOCBP1 0x02
3160 #define _IOCBP2 0x04
3161 #define _IOCBP3 0x08
3162 #define _IOCBP4 0x10
3163 #define _IOCBP5 0x20
3164 #define _IOCBP6 0x40
3165 #define _IOCBP7 0x80
3167 //==============================================================================
3170 //==============================================================================
3171 // IOCBN Bits
3173 extern __at(0x0395) __sfr IOCBN;
3175 typedef struct
3177 unsigned IOCBN0 : 1;
3178 unsigned IOCBN1 : 1;
3179 unsigned IOCBN2 : 1;
3180 unsigned IOCBN3 : 1;
3181 unsigned IOCBN4 : 1;
3182 unsigned IOCBN5 : 1;
3183 unsigned IOCBN6 : 1;
3184 unsigned IOCBN7 : 1;
3185 } __IOCBNbits_t;
3187 extern __at(0x0395) volatile __IOCBNbits_t IOCBNbits;
3189 #define _IOCBN0 0x01
3190 #define _IOCBN1 0x02
3191 #define _IOCBN2 0x04
3192 #define _IOCBN3 0x08
3193 #define _IOCBN4 0x10
3194 #define _IOCBN5 0x20
3195 #define _IOCBN6 0x40
3196 #define _IOCBN7 0x80
3198 //==============================================================================
3201 //==============================================================================
3202 // IOCBF Bits
3204 extern __at(0x0396) __sfr IOCBF;
3206 typedef struct
3208 unsigned IOCBF0 : 1;
3209 unsigned IOCBF1 : 1;
3210 unsigned IOCBF2 : 1;
3211 unsigned IOCBF3 : 1;
3212 unsigned IOCBF4 : 1;
3213 unsigned IOCBF5 : 1;
3214 unsigned IOCBF6 : 1;
3215 unsigned IOCBF7 : 1;
3216 } __IOCBFbits_t;
3218 extern __at(0x0396) volatile __IOCBFbits_t IOCBFbits;
3220 #define _IOCBF0 0x01
3221 #define _IOCBF1 0x02
3222 #define _IOCBF2 0x04
3223 #define _IOCBF3 0x08
3224 #define _IOCBF4 0x10
3225 #define _IOCBF5 0x20
3226 #define _IOCBF6 0x40
3227 #define _IOCBF7 0x80
3229 //==============================================================================
3232 //==============================================================================
3233 // CLKRCON Bits
3235 extern __at(0x039A) __sfr CLKRCON;
3237 typedef union
3239 struct
3241 unsigned CLKRDIV0 : 1;
3242 unsigned CLKRDIV1 : 1;
3243 unsigned CLKRDIV2 : 1;
3244 unsigned CLKRDC0 : 1;
3245 unsigned CLKRDC1 : 1;
3246 unsigned CLKRSLR : 1;
3247 unsigned CLKROE : 1;
3248 unsigned CLKREN : 1;
3251 struct
3253 unsigned CLKRDIV : 3;
3254 unsigned : 5;
3257 struct
3259 unsigned : 3;
3260 unsigned CLKRDC : 2;
3261 unsigned : 3;
3263 } __CLKRCONbits_t;
3265 extern __at(0x039A) volatile __CLKRCONbits_t CLKRCONbits;
3267 #define _CLKRDIV0 0x01
3268 #define _CLKRDIV1 0x02
3269 #define _CLKRDIV2 0x04
3270 #define _CLKRDC0 0x08
3271 #define _CLKRDC1 0x10
3272 #define _CLKRSLR 0x20
3273 #define _CLKROE 0x40
3274 #define _CLKREN 0x80
3276 //==============================================================================
3279 //==============================================================================
3280 // MDCON Bits
3282 extern __at(0x039C) __sfr MDCON;
3284 typedef struct
3286 unsigned MDBIT : 1;
3287 unsigned : 1;
3288 unsigned : 1;
3289 unsigned MDOUT : 1;
3290 unsigned MDOPOL : 1;
3291 unsigned MDSLR : 1;
3292 unsigned MDOE : 1;
3293 unsigned MDEN : 1;
3294 } __MDCONbits_t;
3296 extern __at(0x039C) volatile __MDCONbits_t MDCONbits;
3298 #define _MDBIT 0x01
3299 #define _MDOUT 0x08
3300 #define _MDOPOL 0x10
3301 #define _MDSLR 0x20
3302 #define _MDOE 0x40
3303 #define _MDEN 0x80
3305 //==============================================================================
3308 //==============================================================================
3309 // MDSRC Bits
3311 extern __at(0x039D) __sfr MDSRC;
3313 typedef union
3315 struct
3317 unsigned MDMS0 : 1;
3318 unsigned MDMS1 : 1;
3319 unsigned MDMS2 : 1;
3320 unsigned MDMS3 : 1;
3321 unsigned : 1;
3322 unsigned : 1;
3323 unsigned : 1;
3324 unsigned MDMSODIS : 1;
3327 struct
3329 unsigned MDMS : 4;
3330 unsigned : 4;
3332 } __MDSRCbits_t;
3334 extern __at(0x039D) volatile __MDSRCbits_t MDSRCbits;
3336 #define _MDMS0 0x01
3337 #define _MDMS1 0x02
3338 #define _MDMS2 0x04
3339 #define _MDMS3 0x08
3340 #define _MDMSODIS 0x80
3342 //==============================================================================
3345 //==============================================================================
3346 // MDCARL Bits
3348 extern __at(0x039E) __sfr MDCARL;
3350 typedef union
3352 struct
3354 unsigned MDCL0 : 1;
3355 unsigned MDCL1 : 1;
3356 unsigned MDCL2 : 1;
3357 unsigned MDCL3 : 1;
3358 unsigned : 1;
3359 unsigned MDCLSYNC : 1;
3360 unsigned MDCLPOL : 1;
3361 unsigned MDCLODIS : 1;
3364 struct
3366 unsigned MDCL : 4;
3367 unsigned : 4;
3369 } __MDCARLbits_t;
3371 extern __at(0x039E) volatile __MDCARLbits_t MDCARLbits;
3373 #define _MDCL0 0x01
3374 #define _MDCL1 0x02
3375 #define _MDCL2 0x04
3376 #define _MDCL3 0x08
3377 #define _MDCLSYNC 0x20
3378 #define _MDCLPOL 0x40
3379 #define _MDCLODIS 0x80
3381 //==============================================================================
3384 //==============================================================================
3385 // MDCARH Bits
3387 extern __at(0x039F) __sfr MDCARH;
3389 typedef union
3391 struct
3393 unsigned MDCH0 : 1;
3394 unsigned MDCH1 : 1;
3395 unsigned MDCH2 : 1;
3396 unsigned MDCH3 : 1;
3397 unsigned : 1;
3398 unsigned MDCHSYNC : 1;
3399 unsigned MDCHPOL : 1;
3400 unsigned MDCHODIS : 1;
3403 struct
3405 unsigned MDCH : 4;
3406 unsigned : 4;
3408 } __MDCARHbits_t;
3410 extern __at(0x039F) volatile __MDCARHbits_t MDCARHbits;
3412 #define _MDCH0 0x01
3413 #define _MDCH1 0x02
3414 #define _MDCH2 0x04
3415 #define _MDCH3 0x08
3416 #define _MDCHSYNC 0x20
3417 #define _MDCHPOL 0x40
3418 #define _MDCHODIS 0x80
3420 //==============================================================================
3422 extern __at(0x0415) __sfr TMR4;
3423 extern __at(0x0416) __sfr PR4;
3425 //==============================================================================
3426 // T4CON Bits
3428 extern __at(0x0417) __sfr T4CON;
3430 typedef union
3432 struct
3434 unsigned T4CKPS0 : 1;
3435 unsigned T4CKPS1 : 1;
3436 unsigned TMR4ON : 1;
3437 unsigned T4OUTPS0 : 1;
3438 unsigned T4OUTPS1 : 1;
3439 unsigned T4OUTPS2 : 1;
3440 unsigned T4OUTPS3 : 1;
3441 unsigned : 1;
3444 struct
3446 unsigned T4CKPS : 2;
3447 unsigned : 6;
3450 struct
3452 unsigned : 3;
3453 unsigned T4OUTPS : 4;
3454 unsigned : 1;
3456 } __T4CONbits_t;
3458 extern __at(0x0417) volatile __T4CONbits_t T4CONbits;
3460 #define _T4CKPS0 0x01
3461 #define _T4CKPS1 0x02
3462 #define _TMR4ON 0x04
3463 #define _T4OUTPS0 0x08
3464 #define _T4OUTPS1 0x10
3465 #define _T4OUTPS2 0x20
3466 #define _T4OUTPS3 0x40
3468 //==============================================================================
3470 extern __at(0x041C) __sfr TMR6;
3471 extern __at(0x041D) __sfr PR6;
3473 //==============================================================================
3474 // T6CON Bits
3476 extern __at(0x041E) __sfr T6CON;
3478 typedef union
3480 struct
3482 unsigned T6CKPS0 : 1;
3483 unsigned T6CKPS1 : 1;
3484 unsigned TMR6ON : 1;
3485 unsigned T6OUTPS0 : 1;
3486 unsigned T6OUTPS1 : 1;
3487 unsigned T6OUTPS2 : 1;
3488 unsigned T6OUTPS3 : 1;
3489 unsigned : 1;
3492 struct
3494 unsigned T6CKPS : 2;
3495 unsigned : 6;
3498 struct
3500 unsigned : 3;
3501 unsigned T6OUTPS : 4;
3502 unsigned : 1;
3504 } __T6CONbits_t;
3506 extern __at(0x041E) volatile __T6CONbits_t T6CONbits;
3508 #define _T6CKPS0 0x01
3509 #define _T6CKPS1 0x02
3510 #define _TMR6ON 0x04
3511 #define _T6OUTPS0 0x08
3512 #define _T6OUTPS1 0x10
3513 #define _T6OUTPS2 0x20
3514 #define _T6OUTPS3 0x40
3516 //==============================================================================
3519 //==============================================================================
3520 // STATUS_SHAD Bits
3522 extern __at(0x0FE4) __sfr STATUS_SHAD;
3524 typedef struct
3526 unsigned C_SHAD : 1;
3527 unsigned DC_SHAD : 1;
3528 unsigned Z_SHAD : 1;
3529 unsigned : 1;
3530 unsigned : 1;
3531 unsigned : 1;
3532 unsigned : 1;
3533 unsigned : 1;
3534 } __STATUS_SHADbits_t;
3536 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
3538 #define _C_SHAD 0x01
3539 #define _DC_SHAD 0x02
3540 #define _Z_SHAD 0x04
3542 //==============================================================================
3544 extern __at(0x0FE5) __sfr WREG_SHAD;
3545 extern __at(0x0FE6) __sfr BSR_SHAD;
3546 extern __at(0x0FE7) __sfr PCLATH_SHAD;
3547 extern __at(0x0FE8) __sfr FSR0L_SHAD;
3548 extern __at(0x0FE9) __sfr FSR0H_SHAD;
3549 extern __at(0x0FEA) __sfr FSR1L_SHAD;
3550 extern __at(0x0FEB) __sfr FSR1H_SHAD;
3551 extern __at(0x0FED) __sfr STKPTR;
3552 extern __at(0x0FEE) __sfr TOSL;
3553 extern __at(0x0FEF) __sfr TOSH;
3555 //==============================================================================
3557 // Configuration Bits
3559 //==============================================================================
3561 #define _CONFIG1 0x8007
3562 #define _CONFIG2 0x8008
3564 //----------------------------- CONFIG1 Options -------------------------------
3566 #define _FOSC_LP 0x3FF8 // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins.
3567 #define _FOSC_XT 0x3FF9 // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins.
3568 #define _FOSC_HS 0x3FFA // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins.
3569 #define _FOSC_EXTRC 0x3FFB // EXTRC oscillator: External RC circuit connected to CLKIN pin.
3570 #define _FOSC_INTOSC 0x3FFC // INTOSC oscillator: I/O function on CLKIN pin.
3571 #define _FOSC_ECL 0x3FFD // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin.
3572 #define _FOSC_ECM 0x3FFE // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin.
3573 #define _FOSC_ECH 0x3FFF // ECH, External Clock, High Power Mode (4-32 MHz): device clock supplied to CLKIN pin.
3574 #define _WDTE_OFF 0x3FE7 // WDT disabled.
3575 #define _WDTE_SWDTEN 0x3FEF // WDT controlled by the SWDTEN bit in the WDTCON register.
3576 #define _WDTE_NSLEEP 0x3FF7 // WDT enabled while running and disabled in Sleep.
3577 #define _WDTE_ON 0x3FFF // WDT enabled.
3578 #define _PWRTE_ON 0x3FDF // PWRT enabled.
3579 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
3580 #define _MCLRE_OFF 0x3FBF // MCLR/VPP pin function is digital input.
3581 #define _MCLRE_ON 0x3FFF // MCLR/VPP pin function is MCLR.
3582 #define _CP_ON 0x3F7F // Program memory code protection is enabled.
3583 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
3584 #define _CPD_ON 0x3EFF // Data memory code protection is enabled.
3585 #define _CPD_OFF 0x3FFF // Data memory code protection is disabled.
3586 #define _BOREN_OFF 0x39FF // Brown-out Reset disabled.
3587 #define _BOREN_SBODEN 0x3BFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
3588 #define _BOREN_NSLEEP 0x3DFF // Brown-out Reset enabled while running and disabled in Sleep.
3589 #define _BOREN_ON 0x3FFF // Brown-out Reset enabled.
3590 #define _CLKOUTEN_ON 0x37FF // CLKOUT function is enabled on the CLKOUT pin.
3591 #define _CLKOUTEN_OFF 0x3FFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
3592 #define _IESO_OFF 0x2FFF // Internal/External Switchover mode is disabled.
3593 #define _IESO_ON 0x3FFF // Internal/External Switchover mode is enabled.
3594 #define _FCMEN_OFF 0x1FFF // Fail-Safe Clock Monitor is disabled.
3595 #define _FCMEN_ON 0x3FFF // Fail-Safe Clock Monitor is enabled.
3597 //----------------------------- CONFIG2 Options -------------------------------
3599 #define _WRT_ALL 0x3FFC // 000h to FFFh write protected, no addresses may be modified by EECON control.
3600 #define _WRT_HALF 0x3FFD // 000h to 7FFh write protected, 800h to FFFh may be modified by EECON control.
3601 #define _WRT_BOOT 0x3FFE // 000h to 1FFh write protected, 200h to FFFh may be modified by EECON control.
3602 #define _WRT_OFF 0x3FFF // Write protection off.
3603 #define _PLLEN_OFF 0x3EFF // 4x PLL disabled.
3604 #define _PLLEN_ON 0x3FFF // 4x PLL enabled.
3605 #define _STVREN_OFF 0x3DFF // Stack Overflow or Underflow will not cause a Reset.
3606 #define _STVREN_ON 0x3FFF // Stack Overflow or Underflow will cause a Reset.
3607 #define _BORV_HI 0x3BFF // Brown-out Reset Voltage (Vbor), high trip point selected.
3608 #define _BORV_LO 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
3609 #define _BORV_19 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
3610 #define _DEBUG_ON 0x2FFF // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
3611 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
3612 #define _LVP_OFF 0x1FFF // High-voltage on MCLR/VPP must be used for programming.
3613 #define _LVP_ON 0x3FFF // Low-voltage programming enabled.
3615 //==============================================================================
3617 #define _DEVID1 0x8006
3619 #define _IDLOC0 0x8000
3620 #define _IDLOC1 0x8001
3621 #define _IDLOC2 0x8002
3622 #define _IDLOC3 0x8003
3624 //==============================================================================
3626 #ifndef NO_BIT_DEFINES
3628 #define ADON ADCON0bits.ADON // bit 0
3629 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
3630 #define ADGO ADCON0bits.ADGO // bit 1, shadows bit in ADCON0bits
3631 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
3632 #define CHS0 ADCON0bits.CHS0 // bit 2
3633 #define CHS1 ADCON0bits.CHS1 // bit 3
3634 #define CHS2 ADCON0bits.CHS2 // bit 4
3635 #define CHS3 ADCON0bits.CHS3 // bit 5
3636 #define CHS4 ADCON0bits.CHS4 // bit 6
3638 #define ADPREF0 ADCON1bits.ADPREF0 // bit 0
3639 #define ADPREF1 ADCON1bits.ADPREF1 // bit 1
3640 #define ADNREF ADCON1bits.ADNREF // bit 2
3641 #define ADCS0 ADCON1bits.ADCS0 // bit 4
3642 #define ADCS1 ADCON1bits.ADCS1 // bit 5
3643 #define ADCS2 ADCON1bits.ADCS2 // bit 6
3644 #define ADFM ADCON1bits.ADFM // bit 7
3646 #define ANSA0 ANSELAbits.ANSA0 // bit 0
3647 #define ANSA1 ANSELAbits.ANSA1 // bit 1
3648 #define ANSA2 ANSELAbits.ANSA2 // bit 2
3649 #define ANSA3 ANSELAbits.ANSA3 // bit 3
3650 #define ANSA4 ANSELAbits.ANSA4 // bit 4
3652 #define ANSB1 ANSELBbits.ANSB1 // bit 1
3653 #define ANSB2 ANSELBbits.ANSB2 // bit 2
3654 #define ANSB3 ANSELBbits.ANSB3 // bit 3
3655 #define ANSB4 ANSELBbits.ANSB4 // bit 4
3656 #define ANSB5 ANSELBbits.ANSB5 // bit 5
3657 #define ANSB6 ANSELBbits.ANSB6 // bit 6
3658 #define ANSB7 ANSELBbits.ANSB7 // bit 7
3660 #define CCP1SEL APFCON0bits.CCP1SEL // bit 0
3661 #define P1CSEL APFCON0bits.P1CSEL // bit 1
3662 #define P1DSEL APFCON0bits.P1DSEL // bit 2
3663 #define CCP2SEL APFCON0bits.CCP2SEL // bit 3
3664 #define P2BSEL APFCON0bits.P2BSEL // bit 4
3665 #define SS1SEL APFCON0bits.SS1SEL // bit 5
3666 #define SDO1SEL APFCON0bits.SDO1SEL // bit 6
3667 #define RXDTSEL APFCON0bits.RXDTSEL // bit 7
3669 #define TXCKSEL APFCON1bits.TXCKSEL // bit 0
3671 #define ABDEN BAUDCONbits.ABDEN // bit 0
3672 #define WUE BAUDCONbits.WUE // bit 1
3673 #define BRG16 BAUDCONbits.BRG16 // bit 3
3674 #define SCKP BAUDCONbits.SCKP // bit 4
3675 #define RCIDL BAUDCONbits.RCIDL // bit 6
3676 #define ABDOVF BAUDCONbits.ABDOVF // bit 7
3678 #define BORRDY BORCONbits.BORRDY // bit 0
3679 #define SBOREN BORCONbits.SBOREN // bit 7
3681 #define BSR0 BSRbits.BSR0 // bit 0
3682 #define BSR1 BSRbits.BSR1 // bit 1
3683 #define BSR2 BSRbits.BSR2 // bit 2
3684 #define BSR3 BSRbits.BSR3 // bit 3
3685 #define BSR4 BSRbits.BSR4 // bit 4
3687 #define PSS1BD0 CCP1ASbits.PSS1BD0 // bit 0
3688 #define PSS1BD1 CCP1ASbits.PSS1BD1 // bit 1
3689 #define PSS1AC0 CCP1ASbits.PSS1AC0 // bit 2
3690 #define PSS1AC1 CCP1ASbits.PSS1AC1 // bit 3
3691 #define CCP1AS0 CCP1ASbits.CCP1AS0 // bit 4
3692 #define CCP1AS1 CCP1ASbits.CCP1AS1 // bit 5
3693 #define CCP1AS2 CCP1ASbits.CCP1AS2 // bit 6
3694 #define CCP1ASE CCP1ASbits.CCP1ASE // bit 7
3696 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
3697 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
3698 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
3699 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
3700 #define DC1B0 CCP1CONbits.DC1B0 // bit 4
3701 #define DC1B1 CCP1CONbits.DC1B1 // bit 5
3702 #define P1M0 CCP1CONbits.P1M0 // bit 6
3703 #define P1M1 CCP1CONbits.P1M1 // bit 7
3705 #define PSS2BD0 CCP2ASbits.PSS2BD0 // bit 0
3706 #define PSS2BD1 CCP2ASbits.PSS2BD1 // bit 1
3707 #define PSS2AC0 CCP2ASbits.PSS2AC0 // bit 2
3708 #define PSS2AC1 CCP2ASbits.PSS2AC1 // bit 3
3709 #define CCP2AS0 CCP2ASbits.CCP2AS0 // bit 4
3710 #define CCP2AS1 CCP2ASbits.CCP2AS1 // bit 5
3711 #define CCP2AS2 CCP2ASbits.CCP2AS2 // bit 6
3712 #define CCP2ASE CCP2ASbits.CCP2ASE // bit 7
3714 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
3715 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
3716 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
3717 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
3718 #define DC2B0 CCP2CONbits.DC2B0 // bit 4
3719 #define DC2B1 CCP2CONbits.DC2B1 // bit 5
3720 #define P2M0 CCP2CONbits.P2M0 // bit 6
3721 #define P2M1 CCP2CONbits.P2M1 // bit 7
3723 #define CCP3M0 CCP3CONbits.CCP3M0 // bit 0
3724 #define CCP3M1 CCP3CONbits.CCP3M1 // bit 1
3725 #define CCP3M2 CCP3CONbits.CCP3M2 // bit 2
3726 #define CCP3M3 CCP3CONbits.CCP3M3 // bit 3
3727 #define DC3B0 CCP3CONbits.DC3B0 // bit 4
3728 #define DC3B1 CCP3CONbits.DC3B1 // bit 5
3730 #define CCP4M0 CCP4CONbits.CCP4M0 // bit 0
3731 #define CCP4M1 CCP4CONbits.CCP4M1 // bit 1
3732 #define CCP4M2 CCP4CONbits.CCP4M2 // bit 2
3733 #define CCP4M3 CCP4CONbits.CCP4M3 // bit 3
3734 #define DC4B0 CCP4CONbits.DC4B0 // bit 4
3735 #define DC4B1 CCP4CONbits.DC4B1 // bit 5
3737 #define C1TSEL0 CCPTMRSbits.C1TSEL0 // bit 0
3738 #define C1TSEL1 CCPTMRSbits.C1TSEL1 // bit 1
3739 #define C2TSEL0 CCPTMRSbits.C2TSEL0 // bit 2
3740 #define C2TSEL1 CCPTMRSbits.C2TSEL1 // bit 3
3741 #define C3TSEL0 CCPTMRSbits.C3TSEL0 // bit 4
3742 #define C3TSEL1 CCPTMRSbits.C3TSEL1 // bit 5
3743 #define C4TSEL0 CCPTMRSbits.C4TSEL0 // bit 6
3744 #define C4TSEL1 CCPTMRSbits.C4TSEL1 // bit 7
3746 #define CLKRDIV0 CLKRCONbits.CLKRDIV0 // bit 0
3747 #define CLKRDIV1 CLKRCONbits.CLKRDIV1 // bit 1
3748 #define CLKRDIV2 CLKRCONbits.CLKRDIV2 // bit 2
3749 #define CLKRDC0 CLKRCONbits.CLKRDC0 // bit 3
3750 #define CLKRDC1 CLKRCONbits.CLKRDC1 // bit 4
3751 #define CLKRSLR CLKRCONbits.CLKRSLR // bit 5
3752 #define CLKROE CLKRCONbits.CLKROE // bit 6
3753 #define CLKREN CLKRCONbits.CLKREN // bit 7
3755 #define C1SYNC CM1CON0bits.C1SYNC // bit 0
3756 #define C1HYS CM1CON0bits.C1HYS // bit 1
3757 #define C1SP CM1CON0bits.C1SP // bit 2
3758 #define C1POL CM1CON0bits.C1POL // bit 4
3759 #define C1OE CM1CON0bits.C1OE // bit 5
3760 #define C1OUT CM1CON0bits.C1OUT // bit 6
3761 #define C1ON CM1CON0bits.C1ON // bit 7
3763 #define C1NCH0 CM1CON1bits.C1NCH0 // bit 0
3764 #define C1NCH1 CM1CON1bits.C1NCH1 // bit 1
3765 #define C1PCH0 CM1CON1bits.C1PCH0 // bit 4
3766 #define C1PCH1 CM1CON1bits.C1PCH1 // bit 5
3767 #define C1INTN CM1CON1bits.C1INTN // bit 6
3768 #define C1INTP CM1CON1bits.C1INTP // bit 7
3770 #define C2SYNC CM2CON0bits.C2SYNC // bit 0
3771 #define C2HYS CM2CON0bits.C2HYS // bit 1
3772 #define C2SP CM2CON0bits.C2SP // bit 2
3773 #define C2POL CM2CON0bits.C2POL // bit 4
3774 #define C2OE CM2CON0bits.C2OE // bit 5
3775 #define C2OUT CM2CON0bits.C2OUT // bit 6
3776 #define C2ON CM2CON0bits.C2ON // bit 7
3778 #define C2NCH0 CM2CON1bits.C2NCH0 // bit 0
3779 #define C2NCH1 CM2CON1bits.C2NCH1 // bit 1
3780 #define C2PCH0 CM2CON1bits.C2PCH0 // bit 4
3781 #define C2PCH1 CM2CON1bits.C2PCH1 // bit 5
3782 #define C2INTN CM2CON1bits.C2INTN // bit 6
3783 #define C2INTP CM2CON1bits.C2INTP // bit 7
3785 #define MC1OUT CMOUTbits.MC1OUT // bit 0
3786 #define MC2OUT CMOUTbits.MC2OUT // bit 1
3788 #define T0XCS CPSCON0bits.T0XCS // bit 0
3789 #define CPSOUT CPSCON0bits.CPSOUT // bit 1
3790 #define CPSRNG0 CPSCON0bits.CPSRNG0 // bit 2
3791 #define CPSRNG1 CPSCON0bits.CPSRNG1 // bit 3
3792 #define CPSON CPSCON0bits.CPSON // bit 7
3794 #define CPSCH0 CPSCON1bits.CPSCH0 // bit 0
3795 #define CPSCH1 CPSCON1bits.CPSCH1 // bit 1
3796 #define CPSCH2 CPSCON1bits.CPSCH2 // bit 2
3797 #define CPSCH3 CPSCON1bits.CPSCH3 // bit 3
3799 #define DACNSS DACCON0bits.DACNSS // bit 0
3800 #define DACPSS0 DACCON0bits.DACPSS0 // bit 2
3801 #define DACPSS1 DACCON0bits.DACPSS1 // bit 3
3802 #define DACOE DACCON0bits.DACOE // bit 5
3803 #define DACLPS DACCON0bits.DACLPS // bit 6
3804 #define DACEN DACCON0bits.DACEN // bit 7
3806 #define DACR0 DACCON1bits.DACR0 // bit 0
3807 #define DACR1 DACCON1bits.DACR1 // bit 1
3808 #define DACR2 DACCON1bits.DACR2 // bit 2
3809 #define DACR3 DACCON1bits.DACR3 // bit 3
3810 #define DACR4 DACCON1bits.DACR4 // bit 4
3812 #define RD EECON1bits.RD // bit 0
3813 #define WR EECON1bits.WR // bit 1
3814 #define WREN EECON1bits.WREN // bit 2
3815 #define WRERR EECON1bits.WRERR // bit 3
3816 #define FREE EECON1bits.FREE // bit 4
3817 #define LWLO EECON1bits.LWLO // bit 5
3818 #define CFGS EECON1bits.CFGS // bit 6
3819 #define EEPGD EECON1bits.EEPGD // bit 7
3821 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
3822 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
3823 #define CDAFVR0 FVRCONbits.CDAFVR0 // bit 2
3824 #define CDAFVR1 FVRCONbits.CDAFVR1 // bit 3
3825 #define TSRNG FVRCONbits.TSRNG // bit 4
3826 #define TSEN FVRCONbits.TSEN // bit 5
3827 #define FVRRDY FVRCONbits.FVRRDY // bit 6
3828 #define FVREN FVRCONbits.FVREN // bit 7
3830 #define IOCIF INTCONbits.IOCIF // bit 0
3831 #define INTF INTCONbits.INTF // bit 1
3832 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
3833 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
3834 #define IOCIE INTCONbits.IOCIE // bit 3
3835 #define INTE INTCONbits.INTE // bit 4
3836 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
3837 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
3838 #define PEIE INTCONbits.PEIE // bit 6
3839 #define GIE INTCONbits.GIE // bit 7
3841 #define IOCBF0 IOCBFbits.IOCBF0 // bit 0
3842 #define IOCBF1 IOCBFbits.IOCBF1 // bit 1
3843 #define IOCBF2 IOCBFbits.IOCBF2 // bit 2
3844 #define IOCBF3 IOCBFbits.IOCBF3 // bit 3
3845 #define IOCBF4 IOCBFbits.IOCBF4 // bit 4
3846 #define IOCBF5 IOCBFbits.IOCBF5 // bit 5
3847 #define IOCBF6 IOCBFbits.IOCBF6 // bit 6
3848 #define IOCBF7 IOCBFbits.IOCBF7 // bit 7
3850 #define IOCBN0 IOCBNbits.IOCBN0 // bit 0
3851 #define IOCBN1 IOCBNbits.IOCBN1 // bit 1
3852 #define IOCBN2 IOCBNbits.IOCBN2 // bit 2
3853 #define IOCBN3 IOCBNbits.IOCBN3 // bit 3
3854 #define IOCBN4 IOCBNbits.IOCBN4 // bit 4
3855 #define IOCBN5 IOCBNbits.IOCBN5 // bit 5
3856 #define IOCBN6 IOCBNbits.IOCBN6 // bit 6
3857 #define IOCBN7 IOCBNbits.IOCBN7 // bit 7
3859 #define IOCBP0 IOCBPbits.IOCBP0 // bit 0
3860 #define IOCBP1 IOCBPbits.IOCBP1 // bit 1
3861 #define IOCBP2 IOCBPbits.IOCBP2 // bit 2
3862 #define IOCBP3 IOCBPbits.IOCBP3 // bit 3
3863 #define IOCBP4 IOCBPbits.IOCBP4 // bit 4
3864 #define IOCBP5 IOCBPbits.IOCBP5 // bit 5
3865 #define IOCBP6 IOCBPbits.IOCBP6 // bit 6
3866 #define IOCBP7 IOCBPbits.IOCBP7 // bit 7
3868 #define LATA0 LATAbits.LATA0 // bit 0
3869 #define LATA1 LATAbits.LATA1 // bit 1
3870 #define LATA2 LATAbits.LATA2 // bit 2
3871 #define LATA3 LATAbits.LATA3 // bit 3
3872 #define LATA4 LATAbits.LATA4 // bit 4
3873 #define LATA6 LATAbits.LATA6 // bit 6
3874 #define LATA7 LATAbits.LATA7 // bit 7
3876 #define LATB0 LATBbits.LATB0 // bit 0
3877 #define LATB1 LATBbits.LATB1 // bit 1
3878 #define LATB2 LATBbits.LATB2 // bit 2
3879 #define LATB3 LATBbits.LATB3 // bit 3
3880 #define LATB4 LATBbits.LATB4 // bit 4
3881 #define LATB5 LATBbits.LATB5 // bit 5
3882 #define LATB6 LATBbits.LATB6 // bit 6
3883 #define LATB7 LATBbits.LATB7 // bit 7
3885 #define MDCH0 MDCARHbits.MDCH0 // bit 0
3886 #define MDCH1 MDCARHbits.MDCH1 // bit 1
3887 #define MDCH2 MDCARHbits.MDCH2 // bit 2
3888 #define MDCH3 MDCARHbits.MDCH3 // bit 3
3889 #define MDCHSYNC MDCARHbits.MDCHSYNC // bit 5
3890 #define MDCHPOL MDCARHbits.MDCHPOL // bit 6
3891 #define MDCHODIS MDCARHbits.MDCHODIS // bit 7
3893 #define MDCL0 MDCARLbits.MDCL0 // bit 0
3894 #define MDCL1 MDCARLbits.MDCL1 // bit 1
3895 #define MDCL2 MDCARLbits.MDCL2 // bit 2
3896 #define MDCL3 MDCARLbits.MDCL3 // bit 3
3897 #define MDCLSYNC MDCARLbits.MDCLSYNC // bit 5
3898 #define MDCLPOL MDCARLbits.MDCLPOL // bit 6
3899 #define MDCLODIS MDCARLbits.MDCLODIS // bit 7
3901 #define MDBIT MDCONbits.MDBIT // bit 0
3902 #define MDOUT MDCONbits.MDOUT // bit 3
3903 #define MDOPOL MDCONbits.MDOPOL // bit 4
3904 #define MDSLR MDCONbits.MDSLR // bit 5
3905 #define MDOE MDCONbits.MDOE // bit 6
3906 #define MDEN MDCONbits.MDEN // bit 7
3908 #define MDMS0 MDSRCbits.MDMS0 // bit 0
3909 #define MDMS1 MDSRCbits.MDMS1 // bit 1
3910 #define MDMS2 MDSRCbits.MDMS2 // bit 2
3911 #define MDMS3 MDSRCbits.MDMS3 // bit 3
3912 #define MDMSODIS MDSRCbits.MDMSODIS // bit 7
3914 #define PS0 OPTION_REGbits.PS0 // bit 0
3915 #define PS1 OPTION_REGbits.PS1 // bit 1
3916 #define PS2 OPTION_REGbits.PS2 // bit 2
3917 #define PSA OPTION_REGbits.PSA // bit 3
3918 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
3919 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
3920 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
3921 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
3922 #define INTEDG OPTION_REGbits.INTEDG // bit 6
3923 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7
3925 #define SCS0 OSCCONbits.SCS0 // bit 0
3926 #define SCS1 OSCCONbits.SCS1 // bit 1
3927 #define IRCF0 OSCCONbits.IRCF0 // bit 3
3928 #define IRCF1 OSCCONbits.IRCF1 // bit 4
3929 #define IRCF2 OSCCONbits.IRCF2 // bit 5
3930 #define IRCF3 OSCCONbits.IRCF3 // bit 6
3931 #define SPLLEN OSCCONbits.SPLLEN // bit 7
3933 #define HFIOFS OSCSTATbits.HFIOFS // bit 0
3934 #define LFIOFR OSCSTATbits.LFIOFR // bit 1
3935 #define MFIOFR OSCSTATbits.MFIOFR // bit 2
3936 #define HFIOFL OSCSTATbits.HFIOFL // bit 3
3937 #define HFIOFR OSCSTATbits.HFIOFR // bit 4
3938 #define OSTS OSCSTATbits.OSTS // bit 5
3939 #define PLLR OSCSTATbits.PLLR // bit 6
3940 #define T1OSCR OSCSTATbits.T1OSCR // bit 7
3942 #define TUN0 OSCTUNEbits.TUN0 // bit 0
3943 #define TUN1 OSCTUNEbits.TUN1 // bit 1
3944 #define TUN2 OSCTUNEbits.TUN2 // bit 2
3945 #define TUN3 OSCTUNEbits.TUN3 // bit 3
3946 #define TUN4 OSCTUNEbits.TUN4 // bit 4
3947 #define TUN5 OSCTUNEbits.TUN5 // bit 5
3949 #define NOT_BOR PCONbits.NOT_BOR // bit 0
3950 #define NOT_POR PCONbits.NOT_POR // bit 1
3951 #define NOT_RI PCONbits.NOT_RI // bit 2
3952 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3
3953 #define STKUNF PCONbits.STKUNF // bit 6
3954 #define STKOVF PCONbits.STKOVF // bit 7
3956 #define TMR1IE PIE1bits.TMR1IE // bit 0
3957 #define TMR2IE PIE1bits.TMR2IE // bit 1
3958 #define CCP1IE PIE1bits.CCP1IE // bit 2
3959 #define SSP1IE PIE1bits.SSP1IE // bit 3
3960 #define TXIE PIE1bits.TXIE // bit 4
3961 #define RCIE PIE1bits.RCIE // bit 5
3962 #define ADIE PIE1bits.ADIE // bit 6
3963 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
3965 #define CCP2IE PIE2bits.CCP2IE // bit 0
3966 #define BCL1IE PIE2bits.BCL1IE // bit 3
3967 #define EEIE PIE2bits.EEIE // bit 4
3968 #define C1IE PIE2bits.C1IE // bit 5
3969 #define C2IE PIE2bits.C2IE // bit 6
3970 #define OSFIE PIE2bits.OSFIE // bit 7
3972 #define TMR4IE PIE3bits.TMR4IE // bit 1
3973 #define TMR6IE PIE3bits.TMR6IE // bit 3
3974 #define CCP3IE PIE3bits.CCP3IE // bit 4
3975 #define CCP4IE PIE3bits.CCP4IE // bit 5
3977 #define SSP2IE PIE4bits.SSP2IE // bit 0
3978 #define BCL2IE PIE4bits.BCL2IE // bit 1
3980 #define TMR1IF PIR1bits.TMR1IF // bit 0
3981 #define TMR2IF PIR1bits.TMR2IF // bit 1
3982 #define CCP1IF PIR1bits.CCP1IF // bit 2
3983 #define SSP1IF PIR1bits.SSP1IF // bit 3
3984 #define TXIF PIR1bits.TXIF // bit 4
3985 #define RCIF PIR1bits.RCIF // bit 5
3986 #define ADIF PIR1bits.ADIF // bit 6
3987 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
3989 #define CCP2IF PIR2bits.CCP2IF // bit 0
3990 #define BCL1IF PIR2bits.BCL1IF // bit 3
3991 #define EEIF PIR2bits.EEIF // bit 4
3992 #define C1IF PIR2bits.C1IF // bit 5
3993 #define C2IF PIR2bits.C2IF // bit 6
3994 #define OSFIF PIR2bits.OSFIF // bit 7
3996 #define TMR4IF PIR3bits.TMR4IF // bit 1
3997 #define TMR6IF PIR3bits.TMR6IF // bit 3
3998 #define CCP3IF PIR3bits.CCP3IF // bit 4
3999 #define CCP4IF PIR3bits.CCP4IF // bit 5
4001 #define SSP2IF PIR4bits.SSP2IF // bit 0
4002 #define BCL2IF PIR4bits.BCL2IF // bit 1
4004 #define RA0 PORTAbits.RA0 // bit 0
4005 #define RA1 PORTAbits.RA1 // bit 1
4006 #define RA2 PORTAbits.RA2 // bit 2
4007 #define RA3 PORTAbits.RA3 // bit 3
4008 #define RA4 PORTAbits.RA4 // bit 4
4009 #define RA5 PORTAbits.RA5 // bit 5
4010 #define RA6 PORTAbits.RA6 // bit 6
4011 #define RA7 PORTAbits.RA7 // bit 7
4013 #define RB0 PORTBbits.RB0 // bit 0
4014 #define RB1 PORTBbits.RB1 // bit 1
4015 #define RB2 PORTBbits.RB2 // bit 2
4016 #define RB3 PORTBbits.RB3 // bit 3
4017 #define RB4 PORTBbits.RB4 // bit 4
4018 #define RB5 PORTBbits.RB5 // bit 5
4019 #define RB6 PORTBbits.RB6 // bit 6
4020 #define RB7 PORTBbits.RB7 // bit 7
4022 #define STR1A PSTR1CONbits.STR1A // bit 0
4023 #define STR1B PSTR1CONbits.STR1B // bit 1
4024 #define STR1C PSTR1CONbits.STR1C // bit 2
4025 #define STR1D PSTR1CONbits.STR1D // bit 3
4026 #define STR1SYNC PSTR1CONbits.STR1SYNC // bit 4
4028 #define STR2A PSTR2CONbits.STR2A // bit 0
4029 #define STR2B PSTR2CONbits.STR2B // bit 1
4030 #define STR2C PSTR2CONbits.STR2C // bit 2
4031 #define STR2D PSTR2CONbits.STR2D // bit 3
4032 #define STR2SYNC PSTR2CONbits.STR2SYNC // bit 4
4034 #define P1DC0 PWM1CONbits.P1DC0 // bit 0
4035 #define P1DC1 PWM1CONbits.P1DC1 // bit 1
4036 #define P1DC2 PWM1CONbits.P1DC2 // bit 2
4037 #define P1DC3 PWM1CONbits.P1DC3 // bit 3
4038 #define P1DC4 PWM1CONbits.P1DC4 // bit 4
4039 #define P1DC5 PWM1CONbits.P1DC5 // bit 5
4040 #define P1DC6 PWM1CONbits.P1DC6 // bit 6
4041 #define P1RSEN PWM1CONbits.P1RSEN // bit 7
4043 #define P2DC0 PWM2CONbits.P2DC0 // bit 0
4044 #define P2DC1 PWM2CONbits.P2DC1 // bit 1
4045 #define P2DC2 PWM2CONbits.P2DC2 // bit 2
4046 #define P2DC3 PWM2CONbits.P2DC3 // bit 3
4047 #define P2DC4 PWM2CONbits.P2DC4 // bit 4
4048 #define P2DC5 PWM2CONbits.P2DC5 // bit 5
4049 #define P2DC6 PWM2CONbits.P2DC6 // bit 6
4050 #define P2RSEN PWM2CONbits.P2RSEN // bit 7
4052 #define RX9D RCSTAbits.RX9D // bit 0
4053 #define OERR RCSTAbits.OERR // bit 1
4054 #define FERR RCSTAbits.FERR // bit 2
4055 #define ADDEN RCSTAbits.ADDEN // bit 3
4056 #define CREN RCSTAbits.CREN // bit 4
4057 #define SREN RCSTAbits.SREN // bit 5
4058 #define RX9 RCSTAbits.RX9 // bit 6
4059 #define SPEN RCSTAbits.SPEN // bit 7
4061 #define SRPR SRCON0bits.SRPR // bit 0
4062 #define SRPS SRCON0bits.SRPS // bit 1
4063 #define SRNQEN SRCON0bits.SRNQEN // bit 2
4064 #define SRQEN SRCON0bits.SRQEN // bit 3
4065 #define SRCLK0 SRCON0bits.SRCLK0 // bit 4
4066 #define SRCLK1 SRCON0bits.SRCLK1 // bit 5
4067 #define SRCLK2 SRCON0bits.SRCLK2 // bit 6
4068 #define SRLEN SRCON0bits.SRLEN // bit 7
4070 #define SRRC1E SRCON1bits.SRRC1E // bit 0
4071 #define SRRC2E SRCON1bits.SRRC2E // bit 1
4072 #define SRRCKE SRCON1bits.SRRCKE // bit 2
4073 #define SRRPE SRCON1bits.SRRPE // bit 3
4074 #define SRSC1E SRCON1bits.SRSC1E // bit 4
4075 #define SRSC2E SRCON1bits.SRSC2E // bit 5
4076 #define SRSCKE SRCON1bits.SRSCKE // bit 6
4077 #define SRSPE SRCON1bits.SRSPE // bit 7
4079 #define SSPM0 SSP1CON1bits.SSPM0 // bit 0
4080 #define SSPM1 SSP1CON1bits.SSPM1 // bit 1
4081 #define SSPM2 SSP1CON1bits.SSPM2 // bit 2
4082 #define SSPM3 SSP1CON1bits.SSPM3 // bit 3
4083 #define CKP SSP1CON1bits.CKP // bit 4
4084 #define SSPEN SSP1CON1bits.SSPEN // bit 5
4085 #define SSPOV SSP1CON1bits.SSPOV // bit 6
4086 #define WCOL SSP1CON1bits.WCOL // bit 7
4088 #define SEN SSP1CON2bits.SEN // bit 0
4089 #define RSEN SSP1CON2bits.RSEN // bit 1
4090 #define PEN SSP1CON2bits.PEN // bit 2
4091 #define RCEN SSP1CON2bits.RCEN // bit 3
4092 #define ACKEN SSP1CON2bits.ACKEN // bit 4
4093 #define ACKDT SSP1CON2bits.ACKDT // bit 5
4094 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6
4095 #define GCEN SSP1CON2bits.GCEN // bit 7
4097 #define DHEN SSP1CON3bits.DHEN // bit 0
4098 #define AHEN SSP1CON3bits.AHEN // bit 1
4099 #define SBCDE SSP1CON3bits.SBCDE // bit 2
4100 #define SDAHT SSP1CON3bits.SDAHT // bit 3
4101 #define BOEN SSP1CON3bits.BOEN // bit 4
4102 #define SCIE SSP1CON3bits.SCIE // bit 5
4103 #define PCIE SSP1CON3bits.PCIE // bit 6
4104 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7
4106 #define BF SSP1STATbits.BF // bit 0
4107 #define UA SSP1STATbits.UA // bit 1
4108 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2
4109 #define S SSP1STATbits.S // bit 3
4110 #define P SSP1STATbits.P // bit 4
4111 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5
4112 #define CKE SSP1STATbits.CKE // bit 6
4113 #define SMP SSP1STATbits.SMP // bit 7
4115 #define C STATUSbits.C // bit 0
4116 #define DC STATUSbits.DC // bit 1
4117 #define Z STATUSbits.Z // bit 2
4118 #define NOT_PD STATUSbits.NOT_PD // bit 3
4119 #define NOT_TO STATUSbits.NOT_TO // bit 4
4121 #define C_SHAD STATUS_SHADbits.C_SHAD // bit 0
4122 #define DC_SHAD STATUS_SHADbits.DC_SHAD // bit 1
4123 #define Z_SHAD STATUS_SHADbits.Z_SHAD // bit 2
4125 #define TMR1ON T1CONbits.TMR1ON // bit 0
4126 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
4127 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
4128 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
4129 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
4130 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6
4131 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7
4133 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0
4134 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1
4135 #define T1GVAL T1GCONbits.T1GVAL // bit 2
4136 #define T1GGO T1GCONbits.T1GGO // bit 3
4137 #define T1GSPM T1GCONbits.T1GSPM // bit 4
4138 #define T1GTM T1GCONbits.T1GTM // bit 5
4139 #define T1GPOL T1GCONbits.T1GPOL // bit 6
4140 #define TMR1GE T1GCONbits.TMR1GE // bit 7
4142 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
4143 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
4144 #define TMR2ON T2CONbits.TMR2ON // bit 2
4145 #define T2OUTPS0 T2CONbits.T2OUTPS0 // bit 3
4146 #define T2OUTPS1 T2CONbits.T2OUTPS1 // bit 4
4147 #define T2OUTPS2 T2CONbits.T2OUTPS2 // bit 5
4148 #define T2OUTPS3 T2CONbits.T2OUTPS3 // bit 6
4150 #define T4CKPS0 T4CONbits.T4CKPS0 // bit 0
4151 #define T4CKPS1 T4CONbits.T4CKPS1 // bit 1
4152 #define TMR4ON T4CONbits.TMR4ON // bit 2
4153 #define T4OUTPS0 T4CONbits.T4OUTPS0 // bit 3
4154 #define T4OUTPS1 T4CONbits.T4OUTPS1 // bit 4
4155 #define T4OUTPS2 T4CONbits.T4OUTPS2 // bit 5
4156 #define T4OUTPS3 T4CONbits.T4OUTPS3 // bit 6
4158 #define T6CKPS0 T6CONbits.T6CKPS0 // bit 0
4159 #define T6CKPS1 T6CONbits.T6CKPS1 // bit 1
4160 #define TMR6ON T6CONbits.TMR6ON // bit 2
4161 #define T6OUTPS0 T6CONbits.T6OUTPS0 // bit 3
4162 #define T6OUTPS1 T6CONbits.T6OUTPS1 // bit 4
4163 #define T6OUTPS2 T6CONbits.T6OUTPS2 // bit 5
4164 #define T6OUTPS3 T6CONbits.T6OUTPS3 // bit 6
4166 #define TRISA0 TRISAbits.TRISA0 // bit 0
4167 #define TRISA1 TRISAbits.TRISA1 // bit 1
4168 #define TRISA2 TRISAbits.TRISA2 // bit 2
4169 #define TRISA3 TRISAbits.TRISA3 // bit 3
4170 #define TRISA4 TRISAbits.TRISA4 // bit 4
4171 #define TRISA5 TRISAbits.TRISA5 // bit 5
4172 #define TRISA6 TRISAbits.TRISA6 // bit 6
4173 #define TRISA7 TRISAbits.TRISA7 // bit 7
4175 #define TRISB0 TRISBbits.TRISB0 // bit 0
4176 #define TRISB1 TRISBbits.TRISB1 // bit 1
4177 #define TRISB2 TRISBbits.TRISB2 // bit 2
4178 #define TRISB3 TRISBbits.TRISB3 // bit 3
4179 #define TRISB4 TRISBbits.TRISB4 // bit 4
4180 #define TRISB5 TRISBbits.TRISB5 // bit 5
4181 #define TRISB6 TRISBbits.TRISB6 // bit 6
4182 #define TRISB7 TRISBbits.TRISB7 // bit 7
4184 #define TX9D TXSTAbits.TX9D // bit 0
4185 #define TRMT TXSTAbits.TRMT // bit 1
4186 #define BRGH TXSTAbits.BRGH // bit 2
4187 #define SENDB TXSTAbits.SENDB // bit 3
4188 #define SYNC TXSTAbits.SYNC // bit 4
4189 #define TXEN TXSTAbits.TXEN // bit 5
4190 #define TX9 TXSTAbits.TX9 // bit 6
4191 #define CSRC TXSTAbits.CSRC // bit 7
4193 #define SWDTEN WDTCONbits.SWDTEN // bit 0
4194 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
4195 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
4196 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
4197 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
4198 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5
4200 #define WPUA5 WPUAbits.WPUA5 // bit 5
4202 #define WPUB0 WPUBbits.WPUB0 // bit 0
4203 #define WPUB1 WPUBbits.WPUB1 // bit 1
4204 #define WPUB2 WPUBbits.WPUB2 // bit 2
4205 #define WPUB3 WPUBbits.WPUB3 // bit 3
4206 #define WPUB4 WPUBbits.WPUB4 // bit 4
4207 #define WPUB5 WPUBbits.WPUB5 // bit 5
4208 #define WPUB6 WPUBbits.WPUB6 // bit 6
4209 #define WPUB7 WPUBbits.WPUB7 // bit 7
4211 #endif // #ifndef NO_BIT_DEFINES
4213 #endif // #ifndef __PIC16LF1827_H__