struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16lf1703.h
blob44cef55b861d627f370a50ef6af946bd102334e9
1 /*
2 * This declarations of the PIC16LF1703 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:11 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 __PIC16LF1703_H__
26 #define __PIC16LF1703_H__
28 //==============================================================================
30 // Register Addresses
32 //==============================================================================
34 #ifndef NO_ADDR_DEFINES
36 #define INDF0_ADDR 0x0000
37 #define INDF1_ADDR 0x0001
38 #define PCL_ADDR 0x0002
39 #define STATUS_ADDR 0x0003
40 #define FSR0_ADDR 0x0004
41 #define FSR0L_ADDR 0x0004
42 #define FSR0H_ADDR 0x0005
43 #define FSR1_ADDR 0x0006
44 #define FSR1L_ADDR 0x0006
45 #define FSR1H_ADDR 0x0007
46 #define BSR_ADDR 0x0008
47 #define WREG_ADDR 0x0009
48 #define PCLATH_ADDR 0x000A
49 #define INTCON_ADDR 0x000B
50 #define PORTA_ADDR 0x000C
51 #define PORTC_ADDR 0x000E
52 #define PIR1_ADDR 0x0011
53 #define PIR2_ADDR 0x0012
54 #define PIR3_ADDR 0x0013
55 #define TMR0_ADDR 0x0015
56 #define TMR1_ADDR 0x0016
57 #define TMR1L_ADDR 0x0016
58 #define TMR1H_ADDR 0x0017
59 #define T1CON_ADDR 0x0018
60 #define T1GCON_ADDR 0x0019
61 #define TMR2_ADDR 0x001A
62 #define PR2_ADDR 0x001B
63 #define T2CON_ADDR 0x001C
64 #define TRISA_ADDR 0x008C
65 #define TRISC_ADDR 0x008E
66 #define PIE1_ADDR 0x0091
67 #define PIE2_ADDR 0x0092
68 #define PIE3_ADDR 0x0093
69 #define OPTION_REG_ADDR 0x0095
70 #define PCON_ADDR 0x0096
71 #define WDTCON_ADDR 0x0097
72 #define OSCTUNE_ADDR 0x0098
73 #define OSCCON_ADDR 0x0099
74 #define OSCSTAT_ADDR 0x009A
75 #define ADRES_ADDR 0x009B
76 #define ADRESL_ADDR 0x009B
77 #define ADRESH_ADDR 0x009C
78 #define ADCON0_ADDR 0x009D
79 #define ADCON1_ADDR 0x009E
80 #define ADCON2_ADDR 0x009F
81 #define LATA_ADDR 0x010C
82 #define LATC_ADDR 0x010E
83 #define BORCON_ADDR 0x0116
84 #define FVRCON_ADDR 0x0117
85 #define ZCD1CON_ADDR 0x011C
86 #define ANSELA_ADDR 0x018C
87 #define ANSELC_ADDR 0x018E
88 #define PMADR_ADDR 0x0191
89 #define PMADRL_ADDR 0x0191
90 #define PMADRH_ADDR 0x0192
91 #define PMDAT_ADDR 0x0193
92 #define PMDATL_ADDR 0x0193
93 #define PMDATH_ADDR 0x0194
94 #define PMCON1_ADDR 0x0195
95 #define PMCON2_ADDR 0x0196
96 #define WPUA_ADDR 0x020C
97 #define WPUC_ADDR 0x020E
98 #define SSP1BUF_ADDR 0x0211
99 #define SSPBUF_ADDR 0x0211
100 #define SSP1ADD_ADDR 0x0212
101 #define SSPADD_ADDR 0x0212
102 #define SSP1MSK_ADDR 0x0213
103 #define SSPMSK_ADDR 0x0213
104 #define SSP1STAT_ADDR 0x0214
105 #define SSPSTAT_ADDR 0x0214
106 #define SSP1CON_ADDR 0x0215
107 #define SSP1CON1_ADDR 0x0215
108 #define SSPCON_ADDR 0x0215
109 #define SSPCON1_ADDR 0x0215
110 #define SSP1CON2_ADDR 0x0216
111 #define SSPCON2_ADDR 0x0216
112 #define SSP1CON3_ADDR 0x0217
113 #define SSPCON3_ADDR 0x0217
114 #define ODCONA_ADDR 0x028C
115 #define ODCONC_ADDR 0x028E
116 #define CCPR1_ADDR 0x0291
117 #define CCPR1L_ADDR 0x0291
118 #define CCPR1H_ADDR 0x0292
119 #define CCP1CON_ADDR 0x0293
120 #define ECCP1CON_ADDR 0x0293
121 #define CCPR2_ADDR 0x0298
122 #define CCPR2L_ADDR 0x0298
123 #define CCPR2H_ADDR 0x0299
124 #define CCP2CON_ADDR 0x029A
125 #define ECCP2CON_ADDR 0x029A
126 #define SLRCONA_ADDR 0x030C
127 #define SLRCONC_ADDR 0x030E
128 #define INLVLA_ADDR 0x038C
129 #define INLVLC_ADDR 0x038E
130 #define IOCAP_ADDR 0x0391
131 #define IOCAN_ADDR 0x0392
132 #define IOCAF_ADDR 0x0393
133 #define IOCCP_ADDR 0x0397
134 #define IOCCN_ADDR 0x0398
135 #define IOCCF_ADDR 0x0399
136 #define OPA1CON_ADDR 0x0511
137 #define OPA2CON_ADDR 0x0515
138 #define PPSLOCK_ADDR 0x0E0F
139 #define INTPPS_ADDR 0x0E10
140 #define T0CKIPPS_ADDR 0x0E11
141 #define T1CKIPPS_ADDR 0x0E12
142 #define T1GPPS_ADDR 0x0E13
143 #define CCP1PPS_ADDR 0x0E14
144 #define CCP2PPS_ADDR 0x0E15
145 #define SSPCLKPPS_ADDR 0x0E20
146 #define SSPDATPPS_ADDR 0x0E21
147 #define SSPSSPPS_ADDR 0x0E22
148 #define RA0PPS_ADDR 0x0E90
149 #define RA1PPS_ADDR 0x0E91
150 #define RA2PPS_ADDR 0x0E92
151 #define RA4PPS_ADDR 0x0E94
152 #define RA5PPS_ADDR 0x0E95
153 #define RC0PPS_ADDR 0x0EA0
154 #define RC1PPS_ADDR 0x0EA1
155 #define RC2PPS_ADDR 0x0EA2
156 #define RC3PPS_ADDR 0x0EA3
157 #define RC4PPS_ADDR 0x0EA4
158 #define RC5PPS_ADDR 0x0EA5
159 #define ICDBK0H_ADDR 0x0F9E
160 #define STATUS_SHAD_ADDR 0x0FE4
161 #define WREG_SHAD_ADDR 0x0FE5
162 #define BSR_SHAD_ADDR 0x0FE6
163 #define PCLATH_SHAD_ADDR 0x0FE7
164 #define FSR0L_SHAD_ADDR 0x0FE8
165 #define FSR0H_SHAD_ADDR 0x0FE9
166 #define FSR1L_SHAD_ADDR 0x0FEA
167 #define FSR1H_SHAD_ADDR 0x0FEB
168 #define STKPTR_ADDR 0x0FED
169 #define TOSL_ADDR 0x0FEE
170 #define TOSH_ADDR 0x0FEF
172 #endif // #ifndef NO_ADDR_DEFINES
174 //==============================================================================
176 // Register Definitions
178 //==============================================================================
180 extern __at(0x0000) __sfr INDF0;
181 extern __at(0x0001) __sfr INDF1;
182 extern __at(0x0002) __sfr PCL;
184 //==============================================================================
185 // STATUS Bits
187 extern __at(0x0003) __sfr STATUS;
189 typedef struct
191 unsigned C : 1;
192 unsigned DC : 1;
193 unsigned Z : 1;
194 unsigned NOT_PD : 1;
195 unsigned NOT_TO : 1;
196 unsigned : 1;
197 unsigned : 1;
198 unsigned : 1;
199 } __STATUSbits_t;
201 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
203 #define _C 0x01
204 #define _DC 0x02
205 #define _Z 0x04
206 #define _NOT_PD 0x08
207 #define _NOT_TO 0x10
209 //==============================================================================
211 extern __at(0x0004) __sfr FSR0;
212 extern __at(0x0004) __sfr FSR0L;
213 extern __at(0x0005) __sfr FSR0H;
214 extern __at(0x0006) __sfr FSR1;
215 extern __at(0x0006) __sfr FSR1L;
216 extern __at(0x0007) __sfr FSR1H;
218 //==============================================================================
219 // BSR Bits
221 extern __at(0x0008) __sfr BSR;
223 typedef union
225 struct
227 unsigned BSR0 : 1;
228 unsigned BSR1 : 1;
229 unsigned BSR2 : 1;
230 unsigned BSR3 : 1;
231 unsigned BSR4 : 1;
232 unsigned : 1;
233 unsigned : 1;
234 unsigned : 1;
237 struct
239 unsigned BSR : 5;
240 unsigned : 3;
242 } __BSRbits_t;
244 extern __at(0x0008) volatile __BSRbits_t BSRbits;
246 #define _BSR0 0x01
247 #define _BSR1 0x02
248 #define _BSR2 0x04
249 #define _BSR3 0x08
250 #define _BSR4 0x10
252 //==============================================================================
254 extern __at(0x0009) __sfr WREG;
255 extern __at(0x000A) __sfr PCLATH;
257 //==============================================================================
258 // INTCON Bits
260 extern __at(0x000B) __sfr INTCON;
262 typedef union
264 struct
266 unsigned IOCIF : 1;
267 unsigned INTF : 1;
268 unsigned TMR0IF : 1;
269 unsigned IOCIE : 1;
270 unsigned INTE : 1;
271 unsigned TMR0IE : 1;
272 unsigned PEIE : 1;
273 unsigned GIE : 1;
276 struct
278 unsigned : 1;
279 unsigned : 1;
280 unsigned T0IF : 1;
281 unsigned : 1;
282 unsigned : 1;
283 unsigned T0IE : 1;
284 unsigned : 1;
285 unsigned : 1;
287 } __INTCONbits_t;
289 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
291 #define _IOCIF 0x01
292 #define _INTF 0x02
293 #define _TMR0IF 0x04
294 #define _T0IF 0x04
295 #define _IOCIE 0x08
296 #define _INTE 0x10
297 #define _TMR0IE 0x20
298 #define _T0IE 0x20
299 #define _PEIE 0x40
300 #define _GIE 0x80
302 //==============================================================================
305 //==============================================================================
306 // PORTA Bits
308 extern __at(0x000C) __sfr PORTA;
310 typedef union
312 struct
314 unsigned RA0 : 1;
315 unsigned RA1 : 1;
316 unsigned RA2 : 1;
317 unsigned RA3 : 1;
318 unsigned RA4 : 1;
319 unsigned RA5 : 1;
320 unsigned : 1;
321 unsigned : 1;
324 struct
326 unsigned RA : 6;
327 unsigned : 2;
329 } __PORTAbits_t;
331 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
333 #define _RA0 0x01
334 #define _RA1 0x02
335 #define _RA2 0x04
336 #define _RA3 0x08
337 #define _RA4 0x10
338 #define _RA5 0x20
340 //==============================================================================
343 //==============================================================================
344 // PORTC Bits
346 extern __at(0x000E) __sfr PORTC;
348 typedef union
350 struct
352 unsigned RC0 : 1;
353 unsigned RC1 : 1;
354 unsigned RC2 : 1;
355 unsigned RC3 : 1;
356 unsigned RC4 : 1;
357 unsigned RC5 : 1;
358 unsigned : 1;
359 unsigned : 1;
362 struct
364 unsigned RC : 6;
365 unsigned : 2;
367 } __PORTCbits_t;
369 extern __at(0x000E) volatile __PORTCbits_t PORTCbits;
371 #define _RC0 0x01
372 #define _RC1 0x02
373 #define _RC2 0x04
374 #define _RC3 0x08
375 #define _RC4 0x10
376 #define _RC5 0x20
378 //==============================================================================
381 //==============================================================================
382 // PIR1 Bits
384 extern __at(0x0011) __sfr PIR1;
386 typedef union
388 struct
390 unsigned TMR1IF : 1;
391 unsigned TMR2IF : 1;
392 unsigned CCP1IF : 1;
393 unsigned SSP1IF : 1;
394 unsigned : 1;
395 unsigned : 1;
396 unsigned ADIF : 1;
397 unsigned TMR1GIF : 1;
400 struct
402 unsigned : 1;
403 unsigned : 1;
404 unsigned CCPIF : 1;
405 unsigned : 1;
406 unsigned : 1;
407 unsigned : 1;
408 unsigned : 1;
409 unsigned : 1;
411 } __PIR1bits_t;
413 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
415 #define _TMR1IF 0x01
416 #define _TMR2IF 0x02
417 #define _CCP1IF 0x04
418 #define _CCPIF 0x04
419 #define _SSP1IF 0x08
420 #define _ADIF 0x40
421 #define _TMR1GIF 0x80
423 //==============================================================================
426 //==============================================================================
427 // PIR2 Bits
429 extern __at(0x0012) __sfr PIR2;
431 typedef struct
433 unsigned CCP2IF : 1;
434 unsigned : 1;
435 unsigned : 1;
436 unsigned BCL1IF : 1;
437 unsigned : 1;
438 unsigned : 1;
439 unsigned : 1;
440 unsigned : 1;
441 } __PIR2bits_t;
443 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
445 #define _CCP2IF 0x01
446 #define _BCL1IF 0x08
448 //==============================================================================
451 //==============================================================================
452 // PIR3 Bits
454 extern __at(0x0013) __sfr PIR3;
456 typedef struct
458 unsigned : 1;
459 unsigned : 1;
460 unsigned : 1;
461 unsigned : 1;
462 unsigned ZCDIF : 1;
463 unsigned : 1;
464 unsigned : 1;
465 unsigned : 1;
466 } __PIR3bits_t;
468 extern __at(0x0013) volatile __PIR3bits_t PIR3bits;
470 #define _ZCDIF 0x10
472 //==============================================================================
474 extern __at(0x0015) __sfr TMR0;
475 extern __at(0x0016) __sfr TMR1;
476 extern __at(0x0016) __sfr TMR1L;
477 extern __at(0x0017) __sfr TMR1H;
479 //==============================================================================
480 // T1CON Bits
482 extern __at(0x0018) __sfr T1CON;
484 typedef union
486 struct
488 unsigned TMR1ON : 1;
489 unsigned : 1;
490 unsigned NOT_T1SYNC : 1;
491 unsigned T1OSCEN : 1;
492 unsigned T1CKPS0 : 1;
493 unsigned T1CKPS1 : 1;
494 unsigned TMR1CS0 : 1;
495 unsigned TMR1CS1 : 1;
498 struct
500 unsigned : 4;
501 unsigned T1CKPS : 2;
502 unsigned : 2;
505 struct
507 unsigned : 6;
508 unsigned TMR1CS : 2;
510 } __T1CONbits_t;
512 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
514 #define _TMR1ON 0x01
515 #define _NOT_T1SYNC 0x04
516 #define _T1OSCEN 0x08
517 #define _T1CKPS0 0x10
518 #define _T1CKPS1 0x20
519 #define _TMR1CS0 0x40
520 #define _TMR1CS1 0x80
522 //==============================================================================
525 //==============================================================================
526 // T1GCON Bits
528 extern __at(0x0019) __sfr T1GCON;
530 typedef union
532 struct
534 unsigned T1GSS0 : 1;
535 unsigned T1GSS1 : 1;
536 unsigned T1GVAL : 1;
537 unsigned T1GGO_NOT_DONE : 1;
538 unsigned T1GSPM : 1;
539 unsigned T1GTM : 1;
540 unsigned T1GPOL : 1;
541 unsigned TMR1GE : 1;
544 struct
546 unsigned T1GSS : 2;
547 unsigned : 6;
549 } __T1GCONbits_t;
551 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
553 #define _T1GSS0 0x01
554 #define _T1GSS1 0x02
555 #define _T1GVAL 0x04
556 #define _T1GGO_NOT_DONE 0x08
557 #define _T1GSPM 0x10
558 #define _T1GTM 0x20
559 #define _T1GPOL 0x40
560 #define _TMR1GE 0x80
562 //==============================================================================
564 extern __at(0x001A) __sfr TMR2;
565 extern __at(0x001B) __sfr PR2;
567 //==============================================================================
568 // T2CON Bits
570 extern __at(0x001C) __sfr T2CON;
572 typedef union
574 struct
576 unsigned T2CKPS0 : 1;
577 unsigned T2CKPS1 : 1;
578 unsigned TMR2ON : 1;
579 unsigned T2OUTPS0 : 1;
580 unsigned T2OUTPS1 : 1;
581 unsigned T2OUTPS2 : 1;
582 unsigned T2OUTPS3 : 1;
583 unsigned : 1;
586 struct
588 unsigned T2CKPS : 2;
589 unsigned : 6;
592 struct
594 unsigned : 3;
595 unsigned T2OUTPS : 4;
596 unsigned : 1;
598 } __T2CONbits_t;
600 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
602 #define _T2CKPS0 0x01
603 #define _T2CKPS1 0x02
604 #define _TMR2ON 0x04
605 #define _T2OUTPS0 0x08
606 #define _T2OUTPS1 0x10
607 #define _T2OUTPS2 0x20
608 #define _T2OUTPS3 0x40
610 //==============================================================================
613 //==============================================================================
614 // TRISA Bits
616 extern __at(0x008C) __sfr TRISA;
618 typedef struct
620 unsigned TRISA0 : 1;
621 unsigned TRISA1 : 1;
622 unsigned TRISA2 : 1;
623 unsigned : 1;
624 unsigned TRISA4 : 1;
625 unsigned TRISA5 : 1;
626 unsigned : 1;
627 unsigned : 1;
628 } __TRISAbits_t;
630 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
632 #define _TRISA0 0x01
633 #define _TRISA1 0x02
634 #define _TRISA2 0x04
635 #define _TRISA4 0x10
636 #define _TRISA5 0x20
638 //==============================================================================
641 //==============================================================================
642 // TRISC Bits
644 extern __at(0x008E) __sfr TRISC;
646 typedef union
648 struct
650 unsigned TRISC0 : 1;
651 unsigned TRISC1 : 1;
652 unsigned TRISC2 : 1;
653 unsigned TRISC3 : 1;
654 unsigned TRISC4 : 1;
655 unsigned TRISC5 : 1;
656 unsigned : 1;
657 unsigned : 1;
660 struct
662 unsigned TRISC : 6;
663 unsigned : 2;
665 } __TRISCbits_t;
667 extern __at(0x008E) volatile __TRISCbits_t TRISCbits;
669 #define _TRISC0 0x01
670 #define _TRISC1 0x02
671 #define _TRISC2 0x04
672 #define _TRISC3 0x08
673 #define _TRISC4 0x10
674 #define _TRISC5 0x20
676 //==============================================================================
679 //==============================================================================
680 // PIE1 Bits
682 extern __at(0x0091) __sfr PIE1;
684 typedef union
686 struct
688 unsigned TMR1IE : 1;
689 unsigned TMR2IE : 1;
690 unsigned CCP1IE : 1;
691 unsigned SSP1IE : 1;
692 unsigned : 1;
693 unsigned : 1;
694 unsigned ADIE : 1;
695 unsigned TMR1GIE : 1;
698 struct
700 unsigned : 1;
701 unsigned : 1;
702 unsigned CCPIE : 1;
703 unsigned : 1;
704 unsigned : 1;
705 unsigned : 1;
706 unsigned : 1;
707 unsigned : 1;
709 } __PIE1bits_t;
711 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
713 #define _TMR1IE 0x01
714 #define _TMR2IE 0x02
715 #define _CCP1IE 0x04
716 #define _CCPIE 0x04
717 #define _SSP1IE 0x08
718 #define _ADIE 0x40
719 #define _TMR1GIE 0x80
721 //==============================================================================
724 //==============================================================================
725 // PIE2 Bits
727 extern __at(0x0092) __sfr PIE2;
729 typedef struct
731 unsigned CCP2IE : 1;
732 unsigned : 1;
733 unsigned : 1;
734 unsigned BCL1IE : 1;
735 unsigned : 1;
736 unsigned : 1;
737 unsigned : 1;
738 unsigned : 1;
739 } __PIE2bits_t;
741 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
743 #define _CCP2IE 0x01
744 #define _BCL1IE 0x08
746 //==============================================================================
749 //==============================================================================
750 // PIE3 Bits
752 extern __at(0x0093) __sfr PIE3;
754 typedef struct
756 unsigned : 1;
757 unsigned : 1;
758 unsigned : 1;
759 unsigned : 1;
760 unsigned ZCDIE : 1;
761 unsigned : 1;
762 unsigned : 1;
763 unsigned : 1;
764 } __PIE3bits_t;
766 extern __at(0x0093) volatile __PIE3bits_t PIE3bits;
768 #define _ZCDIE 0x10
770 //==============================================================================
773 //==============================================================================
774 // OPTION_REG Bits
776 extern __at(0x0095) __sfr OPTION_REG;
778 typedef union
780 struct
782 unsigned PS0 : 1;
783 unsigned PS1 : 1;
784 unsigned PS2 : 1;
785 unsigned PSA : 1;
786 unsigned TMR0SE : 1;
787 unsigned TMR0CS : 1;
788 unsigned INTEDG : 1;
789 unsigned NOT_WPUEN : 1;
792 struct
794 unsigned : 1;
795 unsigned : 1;
796 unsigned : 1;
797 unsigned : 1;
798 unsigned T0SE : 1;
799 unsigned T0CS : 1;
800 unsigned : 1;
801 unsigned : 1;
804 struct
806 unsigned PS : 3;
807 unsigned : 5;
809 } __OPTION_REGbits_t;
811 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
813 #define _PS0 0x01
814 #define _PS1 0x02
815 #define _PS2 0x04
816 #define _PSA 0x08
817 #define _TMR0SE 0x10
818 #define _T0SE 0x10
819 #define _TMR0CS 0x20
820 #define _T0CS 0x20
821 #define _INTEDG 0x40
822 #define _NOT_WPUEN 0x80
824 //==============================================================================
827 //==============================================================================
828 // PCON Bits
830 extern __at(0x0096) __sfr PCON;
832 typedef struct
834 unsigned NOT_BOR : 1;
835 unsigned NOT_POR : 1;
836 unsigned NOT_RI : 1;
837 unsigned NOT_RMCLR : 1;
838 unsigned NOT_RWDT : 1;
839 unsigned : 1;
840 unsigned STKUNF : 1;
841 unsigned STKOVF : 1;
842 } __PCONbits_t;
844 extern __at(0x0096) volatile __PCONbits_t PCONbits;
846 #define _NOT_BOR 0x01
847 #define _NOT_POR 0x02
848 #define _NOT_RI 0x04
849 #define _NOT_RMCLR 0x08
850 #define _NOT_RWDT 0x10
851 #define _STKUNF 0x40
852 #define _STKOVF 0x80
854 //==============================================================================
857 //==============================================================================
858 // WDTCON Bits
860 extern __at(0x0097) __sfr WDTCON;
862 typedef union
864 struct
866 unsigned SWDTEN : 1;
867 unsigned WDTPS0 : 1;
868 unsigned WDTPS1 : 1;
869 unsigned WDTPS2 : 1;
870 unsigned WDTPS3 : 1;
871 unsigned WDTPS4 : 1;
872 unsigned : 1;
873 unsigned : 1;
876 struct
878 unsigned : 1;
879 unsigned WDTPS : 5;
880 unsigned : 2;
882 } __WDTCONbits_t;
884 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
886 #define _SWDTEN 0x01
887 #define _WDTPS0 0x02
888 #define _WDTPS1 0x04
889 #define _WDTPS2 0x08
890 #define _WDTPS3 0x10
891 #define _WDTPS4 0x20
893 //==============================================================================
896 //==============================================================================
897 // OSCTUNE Bits
899 extern __at(0x0098) __sfr OSCTUNE;
901 typedef union
903 struct
905 unsigned TUN0 : 1;
906 unsigned TUN1 : 1;
907 unsigned TUN2 : 1;
908 unsigned TUN3 : 1;
909 unsigned TUN4 : 1;
910 unsigned TUN5 : 1;
911 unsigned : 1;
912 unsigned : 1;
915 struct
917 unsigned TUN : 6;
918 unsigned : 2;
920 } __OSCTUNEbits_t;
922 extern __at(0x0098) volatile __OSCTUNEbits_t OSCTUNEbits;
924 #define _TUN0 0x01
925 #define _TUN1 0x02
926 #define _TUN2 0x04
927 #define _TUN3 0x08
928 #define _TUN4 0x10
929 #define _TUN5 0x20
931 //==============================================================================
934 //==============================================================================
935 // OSCCON Bits
937 extern __at(0x0099) __sfr OSCCON;
939 typedef union
941 struct
943 unsigned SCS0 : 1;
944 unsigned SCS1 : 1;
945 unsigned : 1;
946 unsigned IRCF0 : 1;
947 unsigned IRCF1 : 1;
948 unsigned IRCF2 : 1;
949 unsigned IRCF3 : 1;
950 unsigned SPLLEN : 1;
953 struct
955 unsigned SCS : 2;
956 unsigned : 6;
959 struct
961 unsigned : 3;
962 unsigned IRCF : 4;
963 unsigned : 1;
965 } __OSCCONbits_t;
967 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
969 #define _SCS0 0x01
970 #define _SCS1 0x02
971 #define _IRCF0 0x08
972 #define _IRCF1 0x10
973 #define _IRCF2 0x20
974 #define _IRCF3 0x40
975 #define _SPLLEN 0x80
977 //==============================================================================
980 //==============================================================================
981 // OSCSTAT Bits
983 extern __at(0x009A) __sfr OSCSTAT;
985 typedef struct
987 unsigned HFIOFS : 1;
988 unsigned LFIOFR : 1;
989 unsigned MFIOFR : 1;
990 unsigned HFIOFL : 1;
991 unsigned HFIOFR : 1;
992 unsigned OSTS : 1;
993 unsigned PLLR : 1;
994 unsigned SOSCR : 1;
995 } __OSCSTATbits_t;
997 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
999 #define _HFIOFS 0x01
1000 #define _LFIOFR 0x02
1001 #define _MFIOFR 0x04
1002 #define _HFIOFL 0x08
1003 #define _HFIOFR 0x10
1004 #define _OSTS 0x20
1005 #define _PLLR 0x40
1006 #define _SOSCR 0x80
1008 //==============================================================================
1010 extern __at(0x009B) __sfr ADRES;
1011 extern __at(0x009B) __sfr ADRESL;
1012 extern __at(0x009C) __sfr ADRESH;
1014 //==============================================================================
1015 // ADCON0 Bits
1017 extern __at(0x009D) __sfr ADCON0;
1019 typedef union
1021 struct
1023 unsigned ADON : 1;
1024 unsigned GO_NOT_DONE : 1;
1025 unsigned CHS0 : 1;
1026 unsigned CHS1 : 1;
1027 unsigned CHS2 : 1;
1028 unsigned CHS3 : 1;
1029 unsigned CHS4 : 1;
1030 unsigned : 1;
1033 struct
1035 unsigned : 1;
1036 unsigned ADGO : 1;
1037 unsigned : 1;
1038 unsigned : 1;
1039 unsigned : 1;
1040 unsigned : 1;
1041 unsigned : 1;
1042 unsigned : 1;
1045 struct
1047 unsigned : 1;
1048 unsigned GO : 1;
1049 unsigned : 1;
1050 unsigned : 1;
1051 unsigned : 1;
1052 unsigned : 1;
1053 unsigned : 1;
1054 unsigned : 1;
1057 struct
1059 unsigned : 2;
1060 unsigned CHS : 5;
1061 unsigned : 1;
1063 } __ADCON0bits_t;
1065 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1067 #define _ADON 0x01
1068 #define _GO_NOT_DONE 0x02
1069 #define _ADGO 0x02
1070 #define _GO 0x02
1071 #define _CHS0 0x04
1072 #define _CHS1 0x08
1073 #define _CHS2 0x10
1074 #define _CHS3 0x20
1075 #define _CHS4 0x40
1077 //==============================================================================
1080 //==============================================================================
1081 // ADCON1 Bits
1083 extern __at(0x009E) __sfr ADCON1;
1085 typedef union
1087 struct
1089 unsigned ADPREF0 : 1;
1090 unsigned ADPREF1 : 1;
1091 unsigned ADNREF : 1;
1092 unsigned : 1;
1093 unsigned : 1;
1094 unsigned : 1;
1095 unsigned : 1;
1096 unsigned ADFM : 1;
1099 struct
1101 unsigned ADPREF : 2;
1102 unsigned : 6;
1104 } __ADCON1bits_t;
1106 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1108 #define _ADPREF0 0x01
1109 #define _ADPREF1 0x02
1110 #define _ADNREF 0x04
1111 #define _ADFM 0x80
1113 //==============================================================================
1116 //==============================================================================
1117 // ADCON2 Bits
1119 extern __at(0x009F) __sfr ADCON2;
1121 typedef union
1123 struct
1125 unsigned : 1;
1126 unsigned : 1;
1127 unsigned : 1;
1128 unsigned : 1;
1129 unsigned TRIGSEL0 : 1;
1130 unsigned TRIGSEL1 : 1;
1131 unsigned TRIGSEL2 : 1;
1132 unsigned TRIGSEL3 : 1;
1135 struct
1137 unsigned : 4;
1138 unsigned TRIGSEL : 4;
1140 } __ADCON2bits_t;
1142 extern __at(0x009F) volatile __ADCON2bits_t ADCON2bits;
1144 #define _TRIGSEL0 0x10
1145 #define _TRIGSEL1 0x20
1146 #define _TRIGSEL2 0x40
1147 #define _TRIGSEL3 0x80
1149 //==============================================================================
1152 //==============================================================================
1153 // LATA Bits
1155 extern __at(0x010C) __sfr LATA;
1157 typedef struct
1159 unsigned LATA0 : 1;
1160 unsigned LATA1 : 1;
1161 unsigned LATA2 : 1;
1162 unsigned : 1;
1163 unsigned LATA4 : 1;
1164 unsigned LATA5 : 1;
1165 unsigned : 1;
1166 unsigned : 1;
1167 } __LATAbits_t;
1169 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1171 #define _LATA0 0x01
1172 #define _LATA1 0x02
1173 #define _LATA2 0x04
1174 #define _LATA4 0x10
1175 #define _LATA5 0x20
1177 //==============================================================================
1180 //==============================================================================
1181 // LATC Bits
1183 extern __at(0x010E) __sfr LATC;
1185 typedef union
1187 struct
1189 unsigned LATC0 : 1;
1190 unsigned LATC1 : 1;
1191 unsigned LATC2 : 1;
1192 unsigned LATC3 : 1;
1193 unsigned LATC4 : 1;
1194 unsigned LATC5 : 1;
1195 unsigned : 1;
1196 unsigned : 1;
1199 struct
1201 unsigned LATC : 6;
1202 unsigned : 2;
1204 } __LATCbits_t;
1206 extern __at(0x010E) volatile __LATCbits_t LATCbits;
1208 #define _LATC0 0x01
1209 #define _LATC1 0x02
1210 #define _LATC2 0x04
1211 #define _LATC3 0x08
1212 #define _LATC4 0x10
1213 #define _LATC5 0x20
1215 //==============================================================================
1218 //==============================================================================
1219 // BORCON Bits
1221 extern __at(0x0116) __sfr BORCON;
1223 typedef struct
1225 unsigned BORRDY : 1;
1226 unsigned : 1;
1227 unsigned : 1;
1228 unsigned : 1;
1229 unsigned : 1;
1230 unsigned : 1;
1231 unsigned BORFS : 1;
1232 unsigned SBOREN : 1;
1233 } __BORCONbits_t;
1235 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1237 #define _BORRDY 0x01
1238 #define _BORFS 0x40
1239 #define _SBOREN 0x80
1241 //==============================================================================
1244 //==============================================================================
1245 // FVRCON Bits
1247 extern __at(0x0117) __sfr FVRCON;
1249 typedef union
1251 struct
1253 unsigned ADFVR0 : 1;
1254 unsigned ADFVR1 : 1;
1255 unsigned CDAFVR0 : 1;
1256 unsigned CDAFVR1 : 1;
1257 unsigned TSRNG : 1;
1258 unsigned TSEN : 1;
1259 unsigned FVRRDY : 1;
1260 unsigned FVREN : 1;
1263 struct
1265 unsigned ADFVR : 2;
1266 unsigned : 6;
1269 struct
1271 unsigned : 2;
1272 unsigned CDAFVR : 2;
1273 unsigned : 4;
1275 } __FVRCONbits_t;
1277 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1279 #define _ADFVR0 0x01
1280 #define _ADFVR1 0x02
1281 #define _CDAFVR0 0x04
1282 #define _CDAFVR1 0x08
1283 #define _TSRNG 0x10
1284 #define _TSEN 0x20
1285 #define _FVRRDY 0x40
1286 #define _FVREN 0x80
1288 //==============================================================================
1291 //==============================================================================
1292 // ZCD1CON Bits
1294 extern __at(0x011C) __sfr ZCD1CON;
1296 typedef struct
1298 unsigned ZCD1INTN : 1;
1299 unsigned ZCD1INTP : 1;
1300 unsigned : 1;
1301 unsigned : 1;
1302 unsigned ZCD1POL : 1;
1303 unsigned ZCD1OUT : 1;
1304 unsigned : 1;
1305 unsigned ZCD1EN : 1;
1306 } __ZCD1CONbits_t;
1308 extern __at(0x011C) volatile __ZCD1CONbits_t ZCD1CONbits;
1310 #define _ZCD1INTN 0x01
1311 #define _ZCD1INTP 0x02
1312 #define _ZCD1POL 0x10
1313 #define _ZCD1OUT 0x20
1314 #define _ZCD1EN 0x80
1316 //==============================================================================
1319 //==============================================================================
1320 // ANSELA Bits
1322 extern __at(0x018C) __sfr ANSELA;
1324 typedef struct
1326 unsigned ANSA0 : 1;
1327 unsigned ANSA1 : 1;
1328 unsigned ANSA2 : 1;
1329 unsigned : 1;
1330 unsigned ANSA4 : 1;
1331 unsigned : 1;
1332 unsigned : 1;
1333 unsigned : 1;
1334 } __ANSELAbits_t;
1336 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1338 #define _ANSA0 0x01
1339 #define _ANSA1 0x02
1340 #define _ANSA2 0x04
1341 #define _ANSA4 0x10
1343 //==============================================================================
1346 //==============================================================================
1347 // ANSELC Bits
1349 extern __at(0x018E) __sfr ANSELC;
1351 typedef union
1353 struct
1355 unsigned ANSC0 : 1;
1356 unsigned ANSC1 : 1;
1357 unsigned ANSC2 : 1;
1358 unsigned ANSC3 : 1;
1359 unsigned ANSC4 : 1;
1360 unsigned ANSC5 : 1;
1361 unsigned : 1;
1362 unsigned : 1;
1365 struct
1367 unsigned ANSC : 6;
1368 unsigned : 2;
1370 } __ANSELCbits_t;
1372 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits;
1374 #define _ANSC0 0x01
1375 #define _ANSC1 0x02
1376 #define _ANSC2 0x04
1377 #define _ANSC3 0x08
1378 #define _ANSC4 0x10
1379 #define _ANSC5 0x20
1381 //==============================================================================
1383 extern __at(0x0191) __sfr PMADR;
1384 extern __at(0x0191) __sfr PMADRL;
1385 extern __at(0x0192) __sfr PMADRH;
1386 extern __at(0x0193) __sfr PMDAT;
1387 extern __at(0x0193) __sfr PMDATL;
1388 extern __at(0x0194) __sfr PMDATH;
1390 //==============================================================================
1391 // PMCON1 Bits
1393 extern __at(0x0195) __sfr PMCON1;
1395 typedef struct
1397 unsigned RD : 1;
1398 unsigned WR : 1;
1399 unsigned WREN : 1;
1400 unsigned WRERR : 1;
1401 unsigned FREE : 1;
1402 unsigned LWLO : 1;
1403 unsigned CFGS : 1;
1404 unsigned : 1;
1405 } __PMCON1bits_t;
1407 extern __at(0x0195) volatile __PMCON1bits_t PMCON1bits;
1409 #define _RD 0x01
1410 #define _WR 0x02
1411 #define _WREN 0x04
1412 #define _WRERR 0x08
1413 #define _FREE 0x10
1414 #define _LWLO 0x20
1415 #define _CFGS 0x40
1417 //==============================================================================
1419 extern __at(0x0196) __sfr PMCON2;
1421 //==============================================================================
1422 // WPUA Bits
1424 extern __at(0x020C) __sfr WPUA;
1426 typedef union
1428 struct
1430 unsigned WPUA0 : 1;
1431 unsigned WPUA1 : 1;
1432 unsigned WPUA2 : 1;
1433 unsigned WPUA3 : 1;
1434 unsigned WPUA4 : 1;
1435 unsigned WPUA5 : 1;
1436 unsigned : 1;
1437 unsigned : 1;
1440 struct
1442 unsigned WPUA : 6;
1443 unsigned : 2;
1445 } __WPUAbits_t;
1447 extern __at(0x020C) volatile __WPUAbits_t WPUAbits;
1449 #define _WPUA0 0x01
1450 #define _WPUA1 0x02
1451 #define _WPUA2 0x04
1452 #define _WPUA3 0x08
1453 #define _WPUA4 0x10
1454 #define _WPUA5 0x20
1456 //==============================================================================
1459 //==============================================================================
1460 // WPUC Bits
1462 extern __at(0x020E) __sfr WPUC;
1464 typedef union
1466 struct
1468 unsigned WPUC0 : 1;
1469 unsigned WPUC1 : 1;
1470 unsigned WPUC2 : 1;
1471 unsigned WPUC3 : 1;
1472 unsigned WPUC4 : 1;
1473 unsigned WPUC5 : 1;
1474 unsigned : 1;
1475 unsigned : 1;
1478 struct
1480 unsigned WPUC : 6;
1481 unsigned : 2;
1483 } __WPUCbits_t;
1485 extern __at(0x020E) volatile __WPUCbits_t WPUCbits;
1487 #define _WPUC0 0x01
1488 #define _WPUC1 0x02
1489 #define _WPUC2 0x04
1490 #define _WPUC3 0x08
1491 #define _WPUC4 0x10
1492 #define _WPUC5 0x20
1494 //==============================================================================
1497 //==============================================================================
1498 // SSP1BUF Bits
1500 extern __at(0x0211) __sfr SSP1BUF;
1502 typedef union
1504 struct
1506 unsigned SSP1BUF0 : 1;
1507 unsigned SSP1BUF1 : 1;
1508 unsigned SSP1BUF2 : 1;
1509 unsigned SSP1BUF3 : 1;
1510 unsigned SSP1BUF4 : 1;
1511 unsigned SSP1BUF5 : 1;
1512 unsigned SSP1BUF6 : 1;
1513 unsigned SSP1BUF7 : 1;
1516 struct
1518 unsigned BUF0 : 1;
1519 unsigned BUF1 : 1;
1520 unsigned BUF2 : 1;
1521 unsigned BUF3 : 1;
1522 unsigned BUF4 : 1;
1523 unsigned BUF5 : 1;
1524 unsigned BUF6 : 1;
1525 unsigned BUF7 : 1;
1527 } __SSP1BUFbits_t;
1529 extern __at(0x0211) volatile __SSP1BUFbits_t SSP1BUFbits;
1531 #define _SSP1BUF0 0x01
1532 #define _BUF0 0x01
1533 #define _SSP1BUF1 0x02
1534 #define _BUF1 0x02
1535 #define _SSP1BUF2 0x04
1536 #define _BUF2 0x04
1537 #define _SSP1BUF3 0x08
1538 #define _BUF3 0x08
1539 #define _SSP1BUF4 0x10
1540 #define _BUF4 0x10
1541 #define _SSP1BUF5 0x20
1542 #define _BUF5 0x20
1543 #define _SSP1BUF6 0x40
1544 #define _BUF6 0x40
1545 #define _SSP1BUF7 0x80
1546 #define _BUF7 0x80
1548 //==============================================================================
1551 //==============================================================================
1552 // SSPBUF Bits
1554 extern __at(0x0211) __sfr SSPBUF;
1556 typedef union
1558 struct
1560 unsigned SSP1BUF0 : 1;
1561 unsigned SSP1BUF1 : 1;
1562 unsigned SSP1BUF2 : 1;
1563 unsigned SSP1BUF3 : 1;
1564 unsigned SSP1BUF4 : 1;
1565 unsigned SSP1BUF5 : 1;
1566 unsigned SSP1BUF6 : 1;
1567 unsigned SSP1BUF7 : 1;
1570 struct
1572 unsigned BUF0 : 1;
1573 unsigned BUF1 : 1;
1574 unsigned BUF2 : 1;
1575 unsigned BUF3 : 1;
1576 unsigned BUF4 : 1;
1577 unsigned BUF5 : 1;
1578 unsigned BUF6 : 1;
1579 unsigned BUF7 : 1;
1581 } __SSPBUFbits_t;
1583 extern __at(0x0211) volatile __SSPBUFbits_t SSPBUFbits;
1585 #define _SSPBUF_SSP1BUF0 0x01
1586 #define _SSPBUF_BUF0 0x01
1587 #define _SSPBUF_SSP1BUF1 0x02
1588 #define _SSPBUF_BUF1 0x02
1589 #define _SSPBUF_SSP1BUF2 0x04
1590 #define _SSPBUF_BUF2 0x04
1591 #define _SSPBUF_SSP1BUF3 0x08
1592 #define _SSPBUF_BUF3 0x08
1593 #define _SSPBUF_SSP1BUF4 0x10
1594 #define _SSPBUF_BUF4 0x10
1595 #define _SSPBUF_SSP1BUF5 0x20
1596 #define _SSPBUF_BUF5 0x20
1597 #define _SSPBUF_SSP1BUF6 0x40
1598 #define _SSPBUF_BUF6 0x40
1599 #define _SSPBUF_SSP1BUF7 0x80
1600 #define _SSPBUF_BUF7 0x80
1602 //==============================================================================
1605 //==============================================================================
1606 // SSP1ADD Bits
1608 extern __at(0x0212) __sfr SSP1ADD;
1610 typedef union
1612 struct
1614 unsigned SSP1ADD0 : 1;
1615 unsigned SSP1ADD1 : 1;
1616 unsigned SSP1ADD2 : 1;
1617 unsigned SSP1ADD3 : 1;
1618 unsigned SSP1ADD4 : 1;
1619 unsigned SSP1ADD5 : 1;
1620 unsigned SSP1ADD6 : 1;
1621 unsigned SSP1ADD7 : 1;
1624 struct
1626 unsigned ADD0 : 1;
1627 unsigned ADD1 : 1;
1628 unsigned ADD2 : 1;
1629 unsigned ADD3 : 1;
1630 unsigned ADD4 : 1;
1631 unsigned ADD5 : 1;
1632 unsigned ADD6 : 1;
1633 unsigned ADD7 : 1;
1635 } __SSP1ADDbits_t;
1637 extern __at(0x0212) volatile __SSP1ADDbits_t SSP1ADDbits;
1639 #define _SSP1ADD0 0x01
1640 #define _ADD0 0x01
1641 #define _SSP1ADD1 0x02
1642 #define _ADD1 0x02
1643 #define _SSP1ADD2 0x04
1644 #define _ADD2 0x04
1645 #define _SSP1ADD3 0x08
1646 #define _ADD3 0x08
1647 #define _SSP1ADD4 0x10
1648 #define _ADD4 0x10
1649 #define _SSP1ADD5 0x20
1650 #define _ADD5 0x20
1651 #define _SSP1ADD6 0x40
1652 #define _ADD6 0x40
1653 #define _SSP1ADD7 0x80
1654 #define _ADD7 0x80
1656 //==============================================================================
1659 //==============================================================================
1660 // SSPADD Bits
1662 extern __at(0x0212) __sfr SSPADD;
1664 typedef union
1666 struct
1668 unsigned SSP1ADD0 : 1;
1669 unsigned SSP1ADD1 : 1;
1670 unsigned SSP1ADD2 : 1;
1671 unsigned SSP1ADD3 : 1;
1672 unsigned SSP1ADD4 : 1;
1673 unsigned SSP1ADD5 : 1;
1674 unsigned SSP1ADD6 : 1;
1675 unsigned SSP1ADD7 : 1;
1678 struct
1680 unsigned ADD0 : 1;
1681 unsigned ADD1 : 1;
1682 unsigned ADD2 : 1;
1683 unsigned ADD3 : 1;
1684 unsigned ADD4 : 1;
1685 unsigned ADD5 : 1;
1686 unsigned ADD6 : 1;
1687 unsigned ADD7 : 1;
1689 } __SSPADDbits_t;
1691 extern __at(0x0212) volatile __SSPADDbits_t SSPADDbits;
1693 #define _SSPADD_SSP1ADD0 0x01
1694 #define _SSPADD_ADD0 0x01
1695 #define _SSPADD_SSP1ADD1 0x02
1696 #define _SSPADD_ADD1 0x02
1697 #define _SSPADD_SSP1ADD2 0x04
1698 #define _SSPADD_ADD2 0x04
1699 #define _SSPADD_SSP1ADD3 0x08
1700 #define _SSPADD_ADD3 0x08
1701 #define _SSPADD_SSP1ADD4 0x10
1702 #define _SSPADD_ADD4 0x10
1703 #define _SSPADD_SSP1ADD5 0x20
1704 #define _SSPADD_ADD5 0x20
1705 #define _SSPADD_SSP1ADD6 0x40
1706 #define _SSPADD_ADD6 0x40
1707 #define _SSPADD_SSP1ADD7 0x80
1708 #define _SSPADD_ADD7 0x80
1710 //==============================================================================
1713 //==============================================================================
1714 // SSP1MSK Bits
1716 extern __at(0x0213) __sfr SSP1MSK;
1718 typedef union
1720 struct
1722 unsigned SSP1MSK0 : 1;
1723 unsigned SSP1MSK1 : 1;
1724 unsigned SSP1MSK2 : 1;
1725 unsigned SSP1MSK3 : 1;
1726 unsigned SSP1MSK4 : 1;
1727 unsigned SSP1MSK5 : 1;
1728 unsigned SSP1MSK6 : 1;
1729 unsigned SSP1MSK7 : 1;
1732 struct
1734 unsigned MSK0 : 1;
1735 unsigned MSK1 : 1;
1736 unsigned MSK2 : 1;
1737 unsigned MSK3 : 1;
1738 unsigned MSK4 : 1;
1739 unsigned MSK5 : 1;
1740 unsigned MSK6 : 1;
1741 unsigned MSK7 : 1;
1743 } __SSP1MSKbits_t;
1745 extern __at(0x0213) volatile __SSP1MSKbits_t SSP1MSKbits;
1747 #define _SSP1MSK0 0x01
1748 #define _MSK0 0x01
1749 #define _SSP1MSK1 0x02
1750 #define _MSK1 0x02
1751 #define _SSP1MSK2 0x04
1752 #define _MSK2 0x04
1753 #define _SSP1MSK3 0x08
1754 #define _MSK3 0x08
1755 #define _SSP1MSK4 0x10
1756 #define _MSK4 0x10
1757 #define _SSP1MSK5 0x20
1758 #define _MSK5 0x20
1759 #define _SSP1MSK6 0x40
1760 #define _MSK6 0x40
1761 #define _SSP1MSK7 0x80
1762 #define _MSK7 0x80
1764 //==============================================================================
1767 //==============================================================================
1768 // SSPMSK Bits
1770 extern __at(0x0213) __sfr SSPMSK;
1772 typedef union
1774 struct
1776 unsigned SSP1MSK0 : 1;
1777 unsigned SSP1MSK1 : 1;
1778 unsigned SSP1MSK2 : 1;
1779 unsigned SSP1MSK3 : 1;
1780 unsigned SSP1MSK4 : 1;
1781 unsigned SSP1MSK5 : 1;
1782 unsigned SSP1MSK6 : 1;
1783 unsigned SSP1MSK7 : 1;
1786 struct
1788 unsigned MSK0 : 1;
1789 unsigned MSK1 : 1;
1790 unsigned MSK2 : 1;
1791 unsigned MSK3 : 1;
1792 unsigned MSK4 : 1;
1793 unsigned MSK5 : 1;
1794 unsigned MSK6 : 1;
1795 unsigned MSK7 : 1;
1797 } __SSPMSKbits_t;
1799 extern __at(0x0213) volatile __SSPMSKbits_t SSPMSKbits;
1801 #define _SSPMSK_SSP1MSK0 0x01
1802 #define _SSPMSK_MSK0 0x01
1803 #define _SSPMSK_SSP1MSK1 0x02
1804 #define _SSPMSK_MSK1 0x02
1805 #define _SSPMSK_SSP1MSK2 0x04
1806 #define _SSPMSK_MSK2 0x04
1807 #define _SSPMSK_SSP1MSK3 0x08
1808 #define _SSPMSK_MSK3 0x08
1809 #define _SSPMSK_SSP1MSK4 0x10
1810 #define _SSPMSK_MSK4 0x10
1811 #define _SSPMSK_SSP1MSK5 0x20
1812 #define _SSPMSK_MSK5 0x20
1813 #define _SSPMSK_SSP1MSK6 0x40
1814 #define _SSPMSK_MSK6 0x40
1815 #define _SSPMSK_SSP1MSK7 0x80
1816 #define _SSPMSK_MSK7 0x80
1818 //==============================================================================
1821 //==============================================================================
1822 // SSP1STAT Bits
1824 extern __at(0x0214) __sfr SSP1STAT;
1826 typedef struct
1828 unsigned BF : 1;
1829 unsigned UA : 1;
1830 unsigned R_NOT_W : 1;
1831 unsigned S : 1;
1832 unsigned P : 1;
1833 unsigned D_NOT_A : 1;
1834 unsigned CKE : 1;
1835 unsigned SMP : 1;
1836 } __SSP1STATbits_t;
1838 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
1840 #define _BF 0x01
1841 #define _UA 0x02
1842 #define _R_NOT_W 0x04
1843 #define _S 0x08
1844 #define _P 0x10
1845 #define _D_NOT_A 0x20
1846 #define _CKE 0x40
1847 #define _SMP 0x80
1849 //==============================================================================
1852 //==============================================================================
1853 // SSPSTAT Bits
1855 extern __at(0x0214) __sfr SSPSTAT;
1857 typedef struct
1859 unsigned BF : 1;
1860 unsigned UA : 1;
1861 unsigned R_NOT_W : 1;
1862 unsigned S : 1;
1863 unsigned P : 1;
1864 unsigned D_NOT_A : 1;
1865 unsigned CKE : 1;
1866 unsigned SMP : 1;
1867 } __SSPSTATbits_t;
1869 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
1871 #define _SSPSTAT_BF 0x01
1872 #define _SSPSTAT_UA 0x02
1873 #define _SSPSTAT_R_NOT_W 0x04
1874 #define _SSPSTAT_S 0x08
1875 #define _SSPSTAT_P 0x10
1876 #define _SSPSTAT_D_NOT_A 0x20
1877 #define _SSPSTAT_CKE 0x40
1878 #define _SSPSTAT_SMP 0x80
1880 //==============================================================================
1883 //==============================================================================
1884 // SSP1CON Bits
1886 extern __at(0x0215) __sfr SSP1CON;
1888 typedef union
1890 struct
1892 unsigned SSPM0 : 1;
1893 unsigned SSPM1 : 1;
1894 unsigned SSPM2 : 1;
1895 unsigned SSPM3 : 1;
1896 unsigned CKP : 1;
1897 unsigned SSPEN : 1;
1898 unsigned SSPOV : 1;
1899 unsigned WCOL : 1;
1902 struct
1904 unsigned SSPM : 4;
1905 unsigned : 4;
1907 } __SSP1CONbits_t;
1909 extern __at(0x0215) volatile __SSP1CONbits_t SSP1CONbits;
1911 #define _SSPM0 0x01
1912 #define _SSPM1 0x02
1913 #define _SSPM2 0x04
1914 #define _SSPM3 0x08
1915 #define _CKP 0x10
1916 #define _SSPEN 0x20
1917 #define _SSPOV 0x40
1918 #define _WCOL 0x80
1920 //==============================================================================
1923 //==============================================================================
1924 // SSP1CON1 Bits
1926 extern __at(0x0215) __sfr SSP1CON1;
1928 typedef union
1930 struct
1932 unsigned SSPM0 : 1;
1933 unsigned SSPM1 : 1;
1934 unsigned SSPM2 : 1;
1935 unsigned SSPM3 : 1;
1936 unsigned CKP : 1;
1937 unsigned SSPEN : 1;
1938 unsigned SSPOV : 1;
1939 unsigned WCOL : 1;
1942 struct
1944 unsigned SSPM : 4;
1945 unsigned : 4;
1947 } __SSP1CON1bits_t;
1949 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
1951 #define _SSP1CON1_SSPM0 0x01
1952 #define _SSP1CON1_SSPM1 0x02
1953 #define _SSP1CON1_SSPM2 0x04
1954 #define _SSP1CON1_SSPM3 0x08
1955 #define _SSP1CON1_CKP 0x10
1956 #define _SSP1CON1_SSPEN 0x20
1957 #define _SSP1CON1_SSPOV 0x40
1958 #define _SSP1CON1_WCOL 0x80
1960 //==============================================================================
1963 //==============================================================================
1964 // SSPCON Bits
1966 extern __at(0x0215) __sfr SSPCON;
1968 typedef union
1970 struct
1972 unsigned SSPM0 : 1;
1973 unsigned SSPM1 : 1;
1974 unsigned SSPM2 : 1;
1975 unsigned SSPM3 : 1;
1976 unsigned CKP : 1;
1977 unsigned SSPEN : 1;
1978 unsigned SSPOV : 1;
1979 unsigned WCOL : 1;
1982 struct
1984 unsigned SSPM : 4;
1985 unsigned : 4;
1987 } __SSPCONbits_t;
1989 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
1991 #define _SSPCON_SSPM0 0x01
1992 #define _SSPCON_SSPM1 0x02
1993 #define _SSPCON_SSPM2 0x04
1994 #define _SSPCON_SSPM3 0x08
1995 #define _SSPCON_CKP 0x10
1996 #define _SSPCON_SSPEN 0x20
1997 #define _SSPCON_SSPOV 0x40
1998 #define _SSPCON_WCOL 0x80
2000 //==============================================================================
2003 //==============================================================================
2004 // SSPCON1 Bits
2006 extern __at(0x0215) __sfr SSPCON1;
2008 typedef union
2010 struct
2012 unsigned SSPM0 : 1;
2013 unsigned SSPM1 : 1;
2014 unsigned SSPM2 : 1;
2015 unsigned SSPM3 : 1;
2016 unsigned CKP : 1;
2017 unsigned SSPEN : 1;
2018 unsigned SSPOV : 1;
2019 unsigned WCOL : 1;
2022 struct
2024 unsigned SSPM : 4;
2025 unsigned : 4;
2027 } __SSPCON1bits_t;
2029 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
2031 #define _SSPCON1_SSPM0 0x01
2032 #define _SSPCON1_SSPM1 0x02
2033 #define _SSPCON1_SSPM2 0x04
2034 #define _SSPCON1_SSPM3 0x08
2035 #define _SSPCON1_CKP 0x10
2036 #define _SSPCON1_SSPEN 0x20
2037 #define _SSPCON1_SSPOV 0x40
2038 #define _SSPCON1_WCOL 0x80
2040 //==============================================================================
2043 //==============================================================================
2044 // SSP1CON2 Bits
2046 extern __at(0x0216) __sfr SSP1CON2;
2048 typedef struct
2050 unsigned SEN : 1;
2051 unsigned RSEN : 1;
2052 unsigned PEN : 1;
2053 unsigned RCEN : 1;
2054 unsigned ACKEN : 1;
2055 unsigned ACKDT : 1;
2056 unsigned ACKSTAT : 1;
2057 unsigned GCEN : 1;
2058 } __SSP1CON2bits_t;
2060 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
2062 #define _SEN 0x01
2063 #define _RSEN 0x02
2064 #define _PEN 0x04
2065 #define _RCEN 0x08
2066 #define _ACKEN 0x10
2067 #define _ACKDT 0x20
2068 #define _ACKSTAT 0x40
2069 #define _GCEN 0x80
2071 //==============================================================================
2074 //==============================================================================
2075 // SSPCON2 Bits
2077 extern __at(0x0216) __sfr SSPCON2;
2079 typedef struct
2081 unsigned SEN : 1;
2082 unsigned RSEN : 1;
2083 unsigned PEN : 1;
2084 unsigned RCEN : 1;
2085 unsigned ACKEN : 1;
2086 unsigned ACKDT : 1;
2087 unsigned ACKSTAT : 1;
2088 unsigned GCEN : 1;
2089 } __SSPCON2bits_t;
2091 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
2093 #define _SSPCON2_SEN 0x01
2094 #define _SSPCON2_RSEN 0x02
2095 #define _SSPCON2_PEN 0x04
2096 #define _SSPCON2_RCEN 0x08
2097 #define _SSPCON2_ACKEN 0x10
2098 #define _SSPCON2_ACKDT 0x20
2099 #define _SSPCON2_ACKSTAT 0x40
2100 #define _SSPCON2_GCEN 0x80
2102 //==============================================================================
2105 //==============================================================================
2106 // SSP1CON3 Bits
2108 extern __at(0x0217) __sfr SSP1CON3;
2110 typedef struct
2112 unsigned DHEN : 1;
2113 unsigned AHEN : 1;
2114 unsigned SBCDE : 1;
2115 unsigned SDAHT : 1;
2116 unsigned BOEN : 1;
2117 unsigned SCIE : 1;
2118 unsigned PCIE : 1;
2119 unsigned ACKTIM : 1;
2120 } __SSP1CON3bits_t;
2122 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
2124 #define _DHEN 0x01
2125 #define _AHEN 0x02
2126 #define _SBCDE 0x04
2127 #define _SDAHT 0x08
2128 #define _BOEN 0x10
2129 #define _SCIE 0x20
2130 #define _PCIE 0x40
2131 #define _ACKTIM 0x80
2133 //==============================================================================
2136 //==============================================================================
2137 // SSPCON3 Bits
2139 extern __at(0x0217) __sfr SSPCON3;
2141 typedef struct
2143 unsigned DHEN : 1;
2144 unsigned AHEN : 1;
2145 unsigned SBCDE : 1;
2146 unsigned SDAHT : 1;
2147 unsigned BOEN : 1;
2148 unsigned SCIE : 1;
2149 unsigned PCIE : 1;
2150 unsigned ACKTIM : 1;
2151 } __SSPCON3bits_t;
2153 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
2155 #define _SSPCON3_DHEN 0x01
2156 #define _SSPCON3_AHEN 0x02
2157 #define _SSPCON3_SBCDE 0x04
2158 #define _SSPCON3_SDAHT 0x08
2159 #define _SSPCON3_BOEN 0x10
2160 #define _SSPCON3_SCIE 0x20
2161 #define _SSPCON3_PCIE 0x40
2162 #define _SSPCON3_ACKTIM 0x80
2164 //==============================================================================
2167 //==============================================================================
2168 // ODCONA Bits
2170 extern __at(0x028C) __sfr ODCONA;
2172 typedef struct
2174 unsigned ODA0 : 1;
2175 unsigned ODA1 : 1;
2176 unsigned ODA2 : 1;
2177 unsigned : 1;
2178 unsigned ODA4 : 1;
2179 unsigned ODA5 : 1;
2180 unsigned : 1;
2181 unsigned : 1;
2182 } __ODCONAbits_t;
2184 extern __at(0x028C) volatile __ODCONAbits_t ODCONAbits;
2186 #define _ODA0 0x01
2187 #define _ODA1 0x02
2188 #define _ODA2 0x04
2189 #define _ODA4 0x10
2190 #define _ODA5 0x20
2192 //==============================================================================
2195 //==============================================================================
2196 // ODCONC Bits
2198 extern __at(0x028E) __sfr ODCONC;
2200 typedef union
2202 struct
2204 unsigned ODC0 : 1;
2205 unsigned ODC1 : 1;
2206 unsigned ODC2 : 1;
2207 unsigned ODC3 : 1;
2208 unsigned ODC4 : 1;
2209 unsigned ODC5 : 1;
2210 unsigned : 1;
2211 unsigned : 1;
2214 struct
2216 unsigned ODC : 6;
2217 unsigned : 2;
2219 } __ODCONCbits_t;
2221 extern __at(0x028E) volatile __ODCONCbits_t ODCONCbits;
2223 #define _ODC0 0x01
2224 #define _ODC1 0x02
2225 #define _ODC2 0x04
2226 #define _ODC3 0x08
2227 #define _ODC4 0x10
2228 #define _ODC5 0x20
2230 //==============================================================================
2232 extern __at(0x0291) __sfr CCPR1;
2233 extern __at(0x0291) __sfr CCPR1L;
2234 extern __at(0x0292) __sfr CCPR1H;
2236 //==============================================================================
2237 // CCP1CON Bits
2239 extern __at(0x0293) __sfr CCP1CON;
2241 typedef union
2243 struct
2245 unsigned CCP1M0 : 1;
2246 unsigned CCP1M1 : 1;
2247 unsigned CCP1M2 : 1;
2248 unsigned CCP1M3 : 1;
2249 unsigned DC1B0 : 1;
2250 unsigned DC1B1 : 1;
2251 unsigned : 1;
2252 unsigned : 1;
2255 struct
2257 unsigned : 1;
2258 unsigned : 1;
2259 unsigned : 1;
2260 unsigned : 1;
2261 unsigned CCP1Y : 1;
2262 unsigned CCP1X : 1;
2263 unsigned : 1;
2264 unsigned : 1;
2267 struct
2269 unsigned CCP1M : 4;
2270 unsigned : 4;
2273 struct
2275 unsigned : 4;
2276 unsigned DC1B : 2;
2277 unsigned : 2;
2279 } __CCP1CONbits_t;
2281 extern __at(0x0293) volatile __CCP1CONbits_t CCP1CONbits;
2283 #define _CCP1M0 0x01
2284 #define _CCP1M1 0x02
2285 #define _CCP1M2 0x04
2286 #define _CCP1M3 0x08
2287 #define _DC1B0 0x10
2288 #define _CCP1Y 0x10
2289 #define _DC1B1 0x20
2290 #define _CCP1X 0x20
2292 //==============================================================================
2295 //==============================================================================
2296 // ECCP1CON Bits
2298 extern __at(0x0293) __sfr ECCP1CON;
2300 typedef union
2302 struct
2304 unsigned CCP1M0 : 1;
2305 unsigned CCP1M1 : 1;
2306 unsigned CCP1M2 : 1;
2307 unsigned CCP1M3 : 1;
2308 unsigned DC1B0 : 1;
2309 unsigned DC1B1 : 1;
2310 unsigned : 1;
2311 unsigned : 1;
2314 struct
2316 unsigned : 1;
2317 unsigned : 1;
2318 unsigned : 1;
2319 unsigned : 1;
2320 unsigned CCP1Y : 1;
2321 unsigned CCP1X : 1;
2322 unsigned : 1;
2323 unsigned : 1;
2326 struct
2328 unsigned CCP1M : 4;
2329 unsigned : 4;
2332 struct
2334 unsigned : 4;
2335 unsigned DC1B : 2;
2336 unsigned : 2;
2338 } __ECCP1CONbits_t;
2340 extern __at(0x0293) volatile __ECCP1CONbits_t ECCP1CONbits;
2342 #define _ECCP1CON_CCP1M0 0x01
2343 #define _ECCP1CON_CCP1M1 0x02
2344 #define _ECCP1CON_CCP1M2 0x04
2345 #define _ECCP1CON_CCP1M3 0x08
2346 #define _ECCP1CON_DC1B0 0x10
2347 #define _ECCP1CON_CCP1Y 0x10
2348 #define _ECCP1CON_DC1B1 0x20
2349 #define _ECCP1CON_CCP1X 0x20
2351 //==============================================================================
2353 extern __at(0x0298) __sfr CCPR2;
2354 extern __at(0x0298) __sfr CCPR2L;
2355 extern __at(0x0299) __sfr CCPR2H;
2357 //==============================================================================
2358 // CCP2CON Bits
2360 extern __at(0x029A) __sfr CCP2CON;
2362 typedef union
2364 struct
2366 unsigned CCP2M0 : 1;
2367 unsigned CCP2M1 : 1;
2368 unsigned CCP2M2 : 1;
2369 unsigned CCP2M3 : 1;
2370 unsigned DC2B0 : 1;
2371 unsigned DC2B1 : 1;
2372 unsigned : 1;
2373 unsigned : 1;
2376 struct
2378 unsigned : 1;
2379 unsigned : 1;
2380 unsigned : 1;
2381 unsigned : 1;
2382 unsigned CCP2Y : 1;
2383 unsigned CCP2X : 1;
2384 unsigned : 1;
2385 unsigned : 1;
2388 struct
2390 unsigned CCP2M : 4;
2391 unsigned : 4;
2394 struct
2396 unsigned : 4;
2397 unsigned DC2B : 2;
2398 unsigned : 2;
2400 } __CCP2CONbits_t;
2402 extern __at(0x029A) volatile __CCP2CONbits_t CCP2CONbits;
2404 #define _CCP2M0 0x01
2405 #define _CCP2M1 0x02
2406 #define _CCP2M2 0x04
2407 #define _CCP2M3 0x08
2408 #define _DC2B0 0x10
2409 #define _CCP2Y 0x10
2410 #define _DC2B1 0x20
2411 #define _CCP2X 0x20
2413 //==============================================================================
2416 //==============================================================================
2417 // ECCP2CON Bits
2419 extern __at(0x029A) __sfr ECCP2CON;
2421 typedef union
2423 struct
2425 unsigned CCP2M0 : 1;
2426 unsigned CCP2M1 : 1;
2427 unsigned CCP2M2 : 1;
2428 unsigned CCP2M3 : 1;
2429 unsigned DC2B0 : 1;
2430 unsigned DC2B1 : 1;
2431 unsigned : 1;
2432 unsigned : 1;
2435 struct
2437 unsigned : 1;
2438 unsigned : 1;
2439 unsigned : 1;
2440 unsigned : 1;
2441 unsigned CCP2Y : 1;
2442 unsigned CCP2X : 1;
2443 unsigned : 1;
2444 unsigned : 1;
2447 struct
2449 unsigned CCP2M : 4;
2450 unsigned : 4;
2453 struct
2455 unsigned : 4;
2456 unsigned DC2B : 2;
2457 unsigned : 2;
2459 } __ECCP2CONbits_t;
2461 extern __at(0x029A) volatile __ECCP2CONbits_t ECCP2CONbits;
2463 #define _ECCP2CON_CCP2M0 0x01
2464 #define _ECCP2CON_CCP2M1 0x02
2465 #define _ECCP2CON_CCP2M2 0x04
2466 #define _ECCP2CON_CCP2M3 0x08
2467 #define _ECCP2CON_DC2B0 0x10
2468 #define _ECCP2CON_CCP2Y 0x10
2469 #define _ECCP2CON_DC2B1 0x20
2470 #define _ECCP2CON_CCP2X 0x20
2472 //==============================================================================
2475 //==============================================================================
2476 // SLRCONA Bits
2478 extern __at(0x030C) __sfr SLRCONA;
2480 typedef struct
2482 unsigned SLRA0 : 1;
2483 unsigned SLRA1 : 1;
2484 unsigned SLRA2 : 1;
2485 unsigned : 1;
2486 unsigned SLRA4 : 1;
2487 unsigned SLRA5 : 1;
2488 unsigned : 1;
2489 unsigned : 1;
2490 } __SLRCONAbits_t;
2492 extern __at(0x030C) volatile __SLRCONAbits_t SLRCONAbits;
2494 #define _SLRA0 0x01
2495 #define _SLRA1 0x02
2496 #define _SLRA2 0x04
2497 #define _SLRA4 0x10
2498 #define _SLRA5 0x20
2500 //==============================================================================
2503 //==============================================================================
2504 // SLRCONC Bits
2506 extern __at(0x030E) __sfr SLRCONC;
2508 typedef union
2510 struct
2512 unsigned SLRC0 : 1;
2513 unsigned SLRC1 : 1;
2514 unsigned SLRC2 : 1;
2515 unsigned SLRC3 : 1;
2516 unsigned SLRC4 : 1;
2517 unsigned SLRC5 : 1;
2518 unsigned : 1;
2519 unsigned : 1;
2522 struct
2524 unsigned SLRC : 6;
2525 unsigned : 2;
2527 } __SLRCONCbits_t;
2529 extern __at(0x030E) volatile __SLRCONCbits_t SLRCONCbits;
2531 #define _SLRC0 0x01
2532 #define _SLRC1 0x02
2533 #define _SLRC2 0x04
2534 #define _SLRC3 0x08
2535 #define _SLRC4 0x10
2536 #define _SLRC5 0x20
2538 //==============================================================================
2541 //==============================================================================
2542 // INLVLA Bits
2544 extern __at(0x038C) __sfr INLVLA;
2546 typedef union
2548 struct
2550 unsigned INLVLA0 : 1;
2551 unsigned INLVLA1 : 1;
2552 unsigned INLVLA2 : 1;
2553 unsigned INLVLA3 : 1;
2554 unsigned INLVLA4 : 1;
2555 unsigned INLVLA5 : 1;
2556 unsigned : 1;
2557 unsigned : 1;
2560 struct
2562 unsigned INLVLA : 6;
2563 unsigned : 2;
2565 } __INLVLAbits_t;
2567 extern __at(0x038C) volatile __INLVLAbits_t INLVLAbits;
2569 #define _INLVLA0 0x01
2570 #define _INLVLA1 0x02
2571 #define _INLVLA2 0x04
2572 #define _INLVLA3 0x08
2573 #define _INLVLA4 0x10
2574 #define _INLVLA5 0x20
2576 //==============================================================================
2579 //==============================================================================
2580 // INLVLC Bits
2582 extern __at(0x038E) __sfr INLVLC;
2584 typedef union
2586 struct
2588 unsigned INLVLC0 : 1;
2589 unsigned INLVLC1 : 1;
2590 unsigned INLVLC2 : 1;
2591 unsigned INLVLC3 : 1;
2592 unsigned INLVLC4 : 1;
2593 unsigned INLVLC5 : 1;
2594 unsigned : 1;
2595 unsigned : 1;
2598 struct
2600 unsigned INLVLC : 6;
2601 unsigned : 2;
2603 } __INLVLCbits_t;
2605 extern __at(0x038E) volatile __INLVLCbits_t INLVLCbits;
2607 #define _INLVLC0 0x01
2608 #define _INLVLC1 0x02
2609 #define _INLVLC2 0x04
2610 #define _INLVLC3 0x08
2611 #define _INLVLC4 0x10
2612 #define _INLVLC5 0x20
2614 //==============================================================================
2617 //==============================================================================
2618 // IOCAP Bits
2620 extern __at(0x0391) __sfr IOCAP;
2622 typedef union
2624 struct
2626 unsigned IOCAP0 : 1;
2627 unsigned IOCAP1 : 1;
2628 unsigned IOCAP2 : 1;
2629 unsigned IOCAP3 : 1;
2630 unsigned IOCAP4 : 1;
2631 unsigned IOCAP5 : 1;
2632 unsigned : 1;
2633 unsigned : 1;
2636 struct
2638 unsigned IOCAP : 6;
2639 unsigned : 2;
2641 } __IOCAPbits_t;
2643 extern __at(0x0391) volatile __IOCAPbits_t IOCAPbits;
2645 #define _IOCAP0 0x01
2646 #define _IOCAP1 0x02
2647 #define _IOCAP2 0x04
2648 #define _IOCAP3 0x08
2649 #define _IOCAP4 0x10
2650 #define _IOCAP5 0x20
2652 //==============================================================================
2655 //==============================================================================
2656 // IOCAN Bits
2658 extern __at(0x0392) __sfr IOCAN;
2660 typedef union
2662 struct
2664 unsigned IOCAN0 : 1;
2665 unsigned IOCAN1 : 1;
2666 unsigned IOCAN2 : 1;
2667 unsigned IOCAN3 : 1;
2668 unsigned IOCAN4 : 1;
2669 unsigned IOCAN5 : 1;
2670 unsigned : 1;
2671 unsigned : 1;
2674 struct
2676 unsigned IOCAN : 6;
2677 unsigned : 2;
2679 } __IOCANbits_t;
2681 extern __at(0x0392) volatile __IOCANbits_t IOCANbits;
2683 #define _IOCAN0 0x01
2684 #define _IOCAN1 0x02
2685 #define _IOCAN2 0x04
2686 #define _IOCAN3 0x08
2687 #define _IOCAN4 0x10
2688 #define _IOCAN5 0x20
2690 //==============================================================================
2693 //==============================================================================
2694 // IOCAF Bits
2696 extern __at(0x0393) __sfr IOCAF;
2698 typedef union
2700 struct
2702 unsigned IOCAF0 : 1;
2703 unsigned IOCAF1 : 1;
2704 unsigned IOCAF2 : 1;
2705 unsigned IOCAF3 : 1;
2706 unsigned IOCAF4 : 1;
2707 unsigned IOCAF5 : 1;
2708 unsigned : 1;
2709 unsigned : 1;
2712 struct
2714 unsigned IOCAF : 6;
2715 unsigned : 2;
2717 } __IOCAFbits_t;
2719 extern __at(0x0393) volatile __IOCAFbits_t IOCAFbits;
2721 #define _IOCAF0 0x01
2722 #define _IOCAF1 0x02
2723 #define _IOCAF2 0x04
2724 #define _IOCAF3 0x08
2725 #define _IOCAF4 0x10
2726 #define _IOCAF5 0x20
2728 //==============================================================================
2731 //==============================================================================
2732 // IOCCP Bits
2734 extern __at(0x0397) __sfr IOCCP;
2736 typedef union
2738 struct
2740 unsigned IOCCP0 : 1;
2741 unsigned IOCCP1 : 1;
2742 unsigned IOCCP2 : 1;
2743 unsigned IOCCP3 : 1;
2744 unsigned IOCCP4 : 1;
2745 unsigned IOCCP5 : 1;
2746 unsigned : 1;
2747 unsigned : 1;
2750 struct
2752 unsigned IOCCP : 6;
2753 unsigned : 2;
2755 } __IOCCPbits_t;
2757 extern __at(0x0397) volatile __IOCCPbits_t IOCCPbits;
2759 #define _IOCCP0 0x01
2760 #define _IOCCP1 0x02
2761 #define _IOCCP2 0x04
2762 #define _IOCCP3 0x08
2763 #define _IOCCP4 0x10
2764 #define _IOCCP5 0x20
2766 //==============================================================================
2769 //==============================================================================
2770 // IOCCN Bits
2772 extern __at(0x0398) __sfr IOCCN;
2774 typedef union
2776 struct
2778 unsigned IOCCN0 : 1;
2779 unsigned IOCCN1 : 1;
2780 unsigned IOCCN2 : 1;
2781 unsigned IOCCN3 : 1;
2782 unsigned IOCCN4 : 1;
2783 unsigned IOCCN5 : 1;
2784 unsigned : 1;
2785 unsigned : 1;
2788 struct
2790 unsigned IOCCN : 6;
2791 unsigned : 2;
2793 } __IOCCNbits_t;
2795 extern __at(0x0398) volatile __IOCCNbits_t IOCCNbits;
2797 #define _IOCCN0 0x01
2798 #define _IOCCN1 0x02
2799 #define _IOCCN2 0x04
2800 #define _IOCCN3 0x08
2801 #define _IOCCN4 0x10
2802 #define _IOCCN5 0x20
2804 //==============================================================================
2807 //==============================================================================
2808 // IOCCF Bits
2810 extern __at(0x0399) __sfr IOCCF;
2812 typedef union
2814 struct
2816 unsigned IOCCF0 : 1;
2817 unsigned IOCCF1 : 1;
2818 unsigned IOCCF2 : 1;
2819 unsigned IOCCF3 : 1;
2820 unsigned IOCCF4 : 1;
2821 unsigned IOCCF5 : 1;
2822 unsigned : 1;
2823 unsigned : 1;
2826 struct
2828 unsigned IOCCF : 6;
2829 unsigned : 2;
2831 } __IOCCFbits_t;
2833 extern __at(0x0399) volatile __IOCCFbits_t IOCCFbits;
2835 #define _IOCCF0 0x01
2836 #define _IOCCF1 0x02
2837 #define _IOCCF2 0x04
2838 #define _IOCCF3 0x08
2839 #define _IOCCF4 0x10
2840 #define _IOCCF5 0x20
2842 //==============================================================================
2845 //==============================================================================
2846 // OPA1CON Bits
2848 extern __at(0x0511) __sfr OPA1CON;
2850 typedef union
2852 struct
2854 unsigned OPA1PCH0 : 1;
2855 unsigned OPA1PCH1 : 1;
2856 unsigned : 1;
2857 unsigned : 1;
2858 unsigned OPA1UG : 1;
2859 unsigned : 1;
2860 unsigned OPA1SP : 1;
2861 unsigned OPA1EN : 1;
2864 struct
2866 unsigned OPA1PCH : 2;
2867 unsigned : 6;
2869 } __OPA1CONbits_t;
2871 extern __at(0x0511) volatile __OPA1CONbits_t OPA1CONbits;
2873 #define _OPA1PCH0 0x01
2874 #define _OPA1PCH1 0x02
2875 #define _OPA1UG 0x10
2876 #define _OPA1SP 0x40
2877 #define _OPA1EN 0x80
2879 //==============================================================================
2882 //==============================================================================
2883 // OPA2CON Bits
2885 extern __at(0x0515) __sfr OPA2CON;
2887 typedef union
2889 struct
2891 unsigned OPA2PCH0 : 1;
2892 unsigned OPA2PCH1 : 1;
2893 unsigned : 1;
2894 unsigned : 1;
2895 unsigned OPA2UG : 1;
2896 unsigned : 1;
2897 unsigned OPA2SP : 1;
2898 unsigned OPA2EN : 1;
2901 struct
2903 unsigned OPA2PCH : 2;
2904 unsigned : 6;
2906 } __OPA2CONbits_t;
2908 extern __at(0x0515) volatile __OPA2CONbits_t OPA2CONbits;
2910 #define _OPA2PCH0 0x01
2911 #define _OPA2PCH1 0x02
2912 #define _OPA2UG 0x10
2913 #define _OPA2SP 0x40
2914 #define _OPA2EN 0x80
2916 //==============================================================================
2919 //==============================================================================
2920 // PPSLOCK Bits
2922 extern __at(0x0E0F) __sfr PPSLOCK;
2924 typedef struct
2926 unsigned PPSLOCKED : 1;
2927 unsigned : 1;
2928 unsigned : 1;
2929 unsigned : 1;
2930 unsigned : 1;
2931 unsigned : 1;
2932 unsigned : 1;
2933 unsigned : 1;
2934 } __PPSLOCKbits_t;
2936 extern __at(0x0E0F) volatile __PPSLOCKbits_t PPSLOCKbits;
2938 #define _PPSLOCKED 0x01
2940 //==============================================================================
2942 extern __at(0x0E10) __sfr INTPPS;
2943 extern __at(0x0E11) __sfr T0CKIPPS;
2944 extern __at(0x0E12) __sfr T1CKIPPS;
2945 extern __at(0x0E13) __sfr T1GPPS;
2946 extern __at(0x0E14) __sfr CCP1PPS;
2947 extern __at(0x0E15) __sfr CCP2PPS;
2948 extern __at(0x0E20) __sfr SSPCLKPPS;
2949 extern __at(0x0E21) __sfr SSPDATPPS;
2950 extern __at(0x0E22) __sfr SSPSSPPS;
2951 extern __at(0x0E90) __sfr RA0PPS;
2952 extern __at(0x0E91) __sfr RA1PPS;
2953 extern __at(0x0E92) __sfr RA2PPS;
2954 extern __at(0x0E94) __sfr RA4PPS;
2955 extern __at(0x0E95) __sfr RA5PPS;
2956 extern __at(0x0EA0) __sfr RC0PPS;
2957 extern __at(0x0EA1) __sfr RC1PPS;
2958 extern __at(0x0EA2) __sfr RC2PPS;
2959 extern __at(0x0EA3) __sfr RC3PPS;
2960 extern __at(0x0EA4) __sfr RC4PPS;
2961 extern __at(0x0EA5) __sfr RC5PPS;
2963 //==============================================================================
2964 // ICDBK0H Bits
2966 extern __at(0x0F9E) __sfr ICDBK0H;
2968 typedef struct
2970 unsigned BKA8 : 1;
2971 unsigned BKA9 : 1;
2972 unsigned BKA10 : 1;
2973 unsigned BKA11 : 1;
2974 unsigned BKA12 : 1;
2975 unsigned BKA13 : 1;
2976 unsigned BKA14 : 1;
2977 unsigned : 1;
2978 } __ICDBK0Hbits_t;
2980 extern __at(0x0F9E) volatile __ICDBK0Hbits_t ICDBK0Hbits;
2982 #define _BKA8 0x01
2983 #define _BKA9 0x02
2984 #define _BKA10 0x04
2985 #define _BKA11 0x08
2986 #define _BKA12 0x10
2987 #define _BKA13 0x20
2988 #define _BKA14 0x40
2990 //==============================================================================
2993 //==============================================================================
2994 // STATUS_SHAD Bits
2996 extern __at(0x0FE4) __sfr STATUS_SHAD;
2998 typedef struct
3000 unsigned C_SHAD : 1;
3001 unsigned DC_SHAD : 1;
3002 unsigned Z_SHAD : 1;
3003 unsigned : 1;
3004 unsigned : 1;
3005 unsigned : 1;
3006 unsigned : 1;
3007 unsigned : 1;
3008 } __STATUS_SHADbits_t;
3010 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
3012 #define _C_SHAD 0x01
3013 #define _DC_SHAD 0x02
3014 #define _Z_SHAD 0x04
3016 //==============================================================================
3018 extern __at(0x0FE5) __sfr WREG_SHAD;
3019 extern __at(0x0FE6) __sfr BSR_SHAD;
3020 extern __at(0x0FE7) __sfr PCLATH_SHAD;
3021 extern __at(0x0FE8) __sfr FSR0L_SHAD;
3022 extern __at(0x0FE9) __sfr FSR0H_SHAD;
3023 extern __at(0x0FEA) __sfr FSR1L_SHAD;
3024 extern __at(0x0FEB) __sfr FSR1H_SHAD;
3025 extern __at(0x0FED) __sfr STKPTR;
3026 extern __at(0x0FEE) __sfr TOSL;
3027 extern __at(0x0FEF) __sfr TOSH;
3029 //==============================================================================
3031 // Configuration Bits
3033 //==============================================================================
3035 #define _CONFIG1 0x8007
3036 #define _CONFIG2 0x8008
3038 //----------------------------- CONFIG1 Options -------------------------------
3040 #define _FOSC_INTOSC 0x3FFC // Internal HFINTOSC. I/O function on RA4 and RA5.
3041 #define _FOSC_ECL 0x3FFD // External oscillator, low power. I/O function on RA4.
3042 #define _FOSC_ECM 0x3FFE // External oscillator, medium power. I/O function on RA4.
3043 #define _FOSC_ECH 0x3FFF // External oscillator, high power. I/O function on RA4.
3044 #define _WDTE_OFF 0x3FE7 // WDT disabled.
3045 #define _WDTE_SWDTEN 0x3FEF // WDT controlled by the SWDTEN bit in the WDTCON register.
3046 #define _WDTE_NSLEEP 0x3FF7 // WDT enabled while running and disabled in Sleep.
3047 #define _WDTE_ON 0x3FFF // WDT enabled.
3048 #define _PWRTE_ON 0x3FDF // PWRT enabled.
3049 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
3050 #define _MCLRE_OFF 0x3FBF // MCLR/VPP pin function is digital input.
3051 #define _MCLRE_ON 0x3FFF // MCLR/VPP pin function is MCLR.
3052 #define _CP_ON 0x3F7F // Program memory code protection is enabled.
3053 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
3054 #define _BOREN_OFF 0x39FF // Brown-out Reset disabled.
3055 #define _BOREN_SBODEN 0x3BFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
3056 #define _BOREN_NSLEEP 0x3DFF // Brown-out Reset enabled while running and disabled in Sleep.
3057 #define _BOREN_ON 0x3FFF // Brown-out Reset enabled.
3058 #define _CLKOUTEN_ON 0x37FF // CLKOUT function is enabled on the CLKOUT pin.
3059 #define _CLKOUTEN_OFF 0x3FFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
3061 //----------------------------- CONFIG2 Options -------------------------------
3063 #define _WRT_ALL 0x3FFC // 000h to 1FFFh write protected, no addresses may be modified by EECON control.
3064 #define _WRT_HALF 0x3FFD // 000h to FFFh write protected, 1000h to 1FFFh may be modified by EECON control.
3065 #define _WRT_BOOT 0x3FFE // 000h to 1FFh write protected, 200h to 1FFFh may be modified by EECON control.
3066 #define _WRT_OFF 0x3FFF // Write protection off.
3067 #define _PPS1WAY_OFF 0x3FFB // The PPSLOCK bit can be set and cleared repeatedly by software.
3068 #define _PPS1WAY_ON 0x3FFF // The PPSLOCK bit cannot be cleared once it is set by software.
3069 #define _ZCDDIS_OFF 0x3F7F // Zero-cross detect circuit is enabled at POR.
3070 #define _ZCDDIS_ON 0x3FFF // Zero-cross detect circuit is disabled at POR.
3071 #define _PLLEN_OFF 0x3EFF // 4x PLL is enabled when software sets the SPLLEN bit.
3072 #define _PLLEN_ON 0x3FFF // 4x PLL is always enabled.
3073 #define _STVREN_OFF 0x3DFF // Stack Overflow or Underflow will not cause a Reset.
3074 #define _STVREN_ON 0x3FFF // Stack Overflow or Underflow will cause a Reset.
3075 #define _BORV_HI 0x3BFF // Brown-out Reset Voltage (Vbor), high trip point selected.
3076 #define _BORV_LO 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
3077 #define _LPBOR_ON 0x37FF // Low-Power BOR is enabled.
3078 #define _LPBOR_OFF 0x3FFF // Low-Power BOR is disabled.
3079 #define _DEBUG_ON 0x2FFF // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
3080 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
3081 #define _LVP_OFF 0x1FFF // High-voltage on MCLR/VPP must be used for programming.
3082 #define _LVP_ON 0x3FFF // Low-voltage programming enabled.
3084 //==============================================================================
3086 #define _DEVID1 0x8006
3088 #define _IDLOC0 0x8000
3089 #define _IDLOC1 0x8001
3090 #define _IDLOC2 0x8002
3091 #define _IDLOC3 0x8003
3093 //==============================================================================
3095 #ifndef NO_BIT_DEFINES
3097 #define ADON ADCON0bits.ADON // bit 0
3098 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
3099 #define ADGO ADCON0bits.ADGO // bit 1, shadows bit in ADCON0bits
3100 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
3101 #define CHS0 ADCON0bits.CHS0 // bit 2
3102 #define CHS1 ADCON0bits.CHS1 // bit 3
3103 #define CHS2 ADCON0bits.CHS2 // bit 4
3104 #define CHS3 ADCON0bits.CHS3 // bit 5
3105 #define CHS4 ADCON0bits.CHS4 // bit 6
3107 #define ADPREF0 ADCON1bits.ADPREF0 // bit 0
3108 #define ADPREF1 ADCON1bits.ADPREF1 // bit 1
3109 #define ADNREF ADCON1bits.ADNREF // bit 2
3110 #define ADFM ADCON1bits.ADFM // bit 7
3112 #define TRIGSEL0 ADCON2bits.TRIGSEL0 // bit 4
3113 #define TRIGSEL1 ADCON2bits.TRIGSEL1 // bit 5
3114 #define TRIGSEL2 ADCON2bits.TRIGSEL2 // bit 6
3115 #define TRIGSEL3 ADCON2bits.TRIGSEL3 // bit 7
3117 #define ANSA0 ANSELAbits.ANSA0 // bit 0
3118 #define ANSA1 ANSELAbits.ANSA1 // bit 1
3119 #define ANSA2 ANSELAbits.ANSA2 // bit 2
3120 #define ANSA4 ANSELAbits.ANSA4 // bit 4
3122 #define ANSC0 ANSELCbits.ANSC0 // bit 0
3123 #define ANSC1 ANSELCbits.ANSC1 // bit 1
3124 #define ANSC2 ANSELCbits.ANSC2 // bit 2
3125 #define ANSC3 ANSELCbits.ANSC3 // bit 3
3126 #define ANSC4 ANSELCbits.ANSC4 // bit 4
3127 #define ANSC5 ANSELCbits.ANSC5 // bit 5
3129 #define BORRDY BORCONbits.BORRDY // bit 0
3130 #define BORFS BORCONbits.BORFS // bit 6
3131 #define SBOREN BORCONbits.SBOREN // bit 7
3133 #define BSR0 BSRbits.BSR0 // bit 0
3134 #define BSR1 BSRbits.BSR1 // bit 1
3135 #define BSR2 BSRbits.BSR2 // bit 2
3136 #define BSR3 BSRbits.BSR3 // bit 3
3137 #define BSR4 BSRbits.BSR4 // bit 4
3139 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
3140 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
3141 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
3142 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
3143 #define DC1B0 CCP1CONbits.DC1B0 // bit 4, shadows bit in CCP1CONbits
3144 #define CCP1Y CCP1CONbits.CCP1Y // bit 4, shadows bit in CCP1CONbits
3145 #define DC1B1 CCP1CONbits.DC1B1 // bit 5, shadows bit in CCP1CONbits
3146 #define CCP1X CCP1CONbits.CCP1X // bit 5, shadows bit in CCP1CONbits
3148 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
3149 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
3150 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
3151 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
3152 #define DC2B0 CCP2CONbits.DC2B0 // bit 4, shadows bit in CCP2CONbits
3153 #define CCP2Y CCP2CONbits.CCP2Y // bit 4, shadows bit in CCP2CONbits
3154 #define DC2B1 CCP2CONbits.DC2B1 // bit 5, shadows bit in CCP2CONbits
3155 #define CCP2X CCP2CONbits.CCP2X // bit 5, shadows bit in CCP2CONbits
3157 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
3158 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
3159 #define CDAFVR0 FVRCONbits.CDAFVR0 // bit 2
3160 #define CDAFVR1 FVRCONbits.CDAFVR1 // bit 3
3161 #define TSRNG FVRCONbits.TSRNG // bit 4
3162 #define TSEN FVRCONbits.TSEN // bit 5
3163 #define FVRRDY FVRCONbits.FVRRDY // bit 6
3164 #define FVREN FVRCONbits.FVREN // bit 7
3166 #define BKA8 ICDBK0Hbits.BKA8 // bit 0
3167 #define BKA9 ICDBK0Hbits.BKA9 // bit 1
3168 #define BKA10 ICDBK0Hbits.BKA10 // bit 2
3169 #define BKA11 ICDBK0Hbits.BKA11 // bit 3
3170 #define BKA12 ICDBK0Hbits.BKA12 // bit 4
3171 #define BKA13 ICDBK0Hbits.BKA13 // bit 5
3172 #define BKA14 ICDBK0Hbits.BKA14 // bit 6
3174 #define INLVLA0 INLVLAbits.INLVLA0 // bit 0
3175 #define INLVLA1 INLVLAbits.INLVLA1 // bit 1
3176 #define INLVLA2 INLVLAbits.INLVLA2 // bit 2
3177 #define INLVLA3 INLVLAbits.INLVLA3 // bit 3
3178 #define INLVLA4 INLVLAbits.INLVLA4 // bit 4
3179 #define INLVLA5 INLVLAbits.INLVLA5 // bit 5
3181 #define INLVLC0 INLVLCbits.INLVLC0 // bit 0
3182 #define INLVLC1 INLVLCbits.INLVLC1 // bit 1
3183 #define INLVLC2 INLVLCbits.INLVLC2 // bit 2
3184 #define INLVLC3 INLVLCbits.INLVLC3 // bit 3
3185 #define INLVLC4 INLVLCbits.INLVLC4 // bit 4
3186 #define INLVLC5 INLVLCbits.INLVLC5 // bit 5
3188 #define IOCIF INTCONbits.IOCIF // bit 0
3189 #define INTF INTCONbits.INTF // bit 1
3190 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
3191 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
3192 #define IOCIE INTCONbits.IOCIE // bit 3
3193 #define INTE INTCONbits.INTE // bit 4
3194 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
3195 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
3196 #define PEIE INTCONbits.PEIE // bit 6
3197 #define GIE INTCONbits.GIE // bit 7
3199 #define IOCAF0 IOCAFbits.IOCAF0 // bit 0
3200 #define IOCAF1 IOCAFbits.IOCAF1 // bit 1
3201 #define IOCAF2 IOCAFbits.IOCAF2 // bit 2
3202 #define IOCAF3 IOCAFbits.IOCAF3 // bit 3
3203 #define IOCAF4 IOCAFbits.IOCAF4 // bit 4
3204 #define IOCAF5 IOCAFbits.IOCAF5 // bit 5
3206 #define IOCAN0 IOCANbits.IOCAN0 // bit 0
3207 #define IOCAN1 IOCANbits.IOCAN1 // bit 1
3208 #define IOCAN2 IOCANbits.IOCAN2 // bit 2
3209 #define IOCAN3 IOCANbits.IOCAN3 // bit 3
3210 #define IOCAN4 IOCANbits.IOCAN4 // bit 4
3211 #define IOCAN5 IOCANbits.IOCAN5 // bit 5
3213 #define IOCAP0 IOCAPbits.IOCAP0 // bit 0
3214 #define IOCAP1 IOCAPbits.IOCAP1 // bit 1
3215 #define IOCAP2 IOCAPbits.IOCAP2 // bit 2
3216 #define IOCAP3 IOCAPbits.IOCAP3 // bit 3
3217 #define IOCAP4 IOCAPbits.IOCAP4 // bit 4
3218 #define IOCAP5 IOCAPbits.IOCAP5 // bit 5
3220 #define IOCCF0 IOCCFbits.IOCCF0 // bit 0
3221 #define IOCCF1 IOCCFbits.IOCCF1 // bit 1
3222 #define IOCCF2 IOCCFbits.IOCCF2 // bit 2
3223 #define IOCCF3 IOCCFbits.IOCCF3 // bit 3
3224 #define IOCCF4 IOCCFbits.IOCCF4 // bit 4
3225 #define IOCCF5 IOCCFbits.IOCCF5 // bit 5
3227 #define IOCCN0 IOCCNbits.IOCCN0 // bit 0
3228 #define IOCCN1 IOCCNbits.IOCCN1 // bit 1
3229 #define IOCCN2 IOCCNbits.IOCCN2 // bit 2
3230 #define IOCCN3 IOCCNbits.IOCCN3 // bit 3
3231 #define IOCCN4 IOCCNbits.IOCCN4 // bit 4
3232 #define IOCCN5 IOCCNbits.IOCCN5 // bit 5
3234 #define IOCCP0 IOCCPbits.IOCCP0 // bit 0
3235 #define IOCCP1 IOCCPbits.IOCCP1 // bit 1
3236 #define IOCCP2 IOCCPbits.IOCCP2 // bit 2
3237 #define IOCCP3 IOCCPbits.IOCCP3 // bit 3
3238 #define IOCCP4 IOCCPbits.IOCCP4 // bit 4
3239 #define IOCCP5 IOCCPbits.IOCCP5 // bit 5
3241 #define LATA0 LATAbits.LATA0 // bit 0
3242 #define LATA1 LATAbits.LATA1 // bit 1
3243 #define LATA2 LATAbits.LATA2 // bit 2
3244 #define LATA4 LATAbits.LATA4 // bit 4
3245 #define LATA5 LATAbits.LATA5 // bit 5
3247 #define LATC0 LATCbits.LATC0 // bit 0
3248 #define LATC1 LATCbits.LATC1 // bit 1
3249 #define LATC2 LATCbits.LATC2 // bit 2
3250 #define LATC3 LATCbits.LATC3 // bit 3
3251 #define LATC4 LATCbits.LATC4 // bit 4
3252 #define LATC5 LATCbits.LATC5 // bit 5
3254 #define ODA0 ODCONAbits.ODA0 // bit 0
3255 #define ODA1 ODCONAbits.ODA1 // bit 1
3256 #define ODA2 ODCONAbits.ODA2 // bit 2
3257 #define ODA4 ODCONAbits.ODA4 // bit 4
3258 #define ODA5 ODCONAbits.ODA5 // bit 5
3260 #define ODC0 ODCONCbits.ODC0 // bit 0
3261 #define ODC1 ODCONCbits.ODC1 // bit 1
3262 #define ODC2 ODCONCbits.ODC2 // bit 2
3263 #define ODC3 ODCONCbits.ODC3 // bit 3
3264 #define ODC4 ODCONCbits.ODC4 // bit 4
3265 #define ODC5 ODCONCbits.ODC5 // bit 5
3267 #define OPA1PCH0 OPA1CONbits.OPA1PCH0 // bit 0
3268 #define OPA1PCH1 OPA1CONbits.OPA1PCH1 // bit 1
3269 #define OPA1UG OPA1CONbits.OPA1UG // bit 4
3270 #define OPA1SP OPA1CONbits.OPA1SP // bit 6
3271 #define OPA1EN OPA1CONbits.OPA1EN // bit 7
3273 #define OPA2PCH0 OPA2CONbits.OPA2PCH0 // bit 0
3274 #define OPA2PCH1 OPA2CONbits.OPA2PCH1 // bit 1
3275 #define OPA2UG OPA2CONbits.OPA2UG // bit 4
3276 #define OPA2SP OPA2CONbits.OPA2SP // bit 6
3277 #define OPA2EN OPA2CONbits.OPA2EN // bit 7
3279 #define PS0 OPTION_REGbits.PS0 // bit 0
3280 #define PS1 OPTION_REGbits.PS1 // bit 1
3281 #define PS2 OPTION_REGbits.PS2 // bit 2
3282 #define PSA OPTION_REGbits.PSA // bit 3
3283 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
3284 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
3285 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
3286 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
3287 #define INTEDG OPTION_REGbits.INTEDG // bit 6
3288 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7
3290 #define SCS0 OSCCONbits.SCS0 // bit 0
3291 #define SCS1 OSCCONbits.SCS1 // bit 1
3292 #define IRCF0 OSCCONbits.IRCF0 // bit 3
3293 #define IRCF1 OSCCONbits.IRCF1 // bit 4
3294 #define IRCF2 OSCCONbits.IRCF2 // bit 5
3295 #define IRCF3 OSCCONbits.IRCF3 // bit 6
3296 #define SPLLEN OSCCONbits.SPLLEN // bit 7
3298 #define HFIOFS OSCSTATbits.HFIOFS // bit 0
3299 #define LFIOFR OSCSTATbits.LFIOFR // bit 1
3300 #define MFIOFR OSCSTATbits.MFIOFR // bit 2
3301 #define HFIOFL OSCSTATbits.HFIOFL // bit 3
3302 #define HFIOFR OSCSTATbits.HFIOFR // bit 4
3303 #define OSTS OSCSTATbits.OSTS // bit 5
3304 #define PLLR OSCSTATbits.PLLR // bit 6
3305 #define SOSCR OSCSTATbits.SOSCR // bit 7
3307 #define TUN0 OSCTUNEbits.TUN0 // bit 0
3308 #define TUN1 OSCTUNEbits.TUN1 // bit 1
3309 #define TUN2 OSCTUNEbits.TUN2 // bit 2
3310 #define TUN3 OSCTUNEbits.TUN3 // bit 3
3311 #define TUN4 OSCTUNEbits.TUN4 // bit 4
3312 #define TUN5 OSCTUNEbits.TUN5 // bit 5
3314 #define NOT_BOR PCONbits.NOT_BOR // bit 0
3315 #define NOT_POR PCONbits.NOT_POR // bit 1
3316 #define NOT_RI PCONbits.NOT_RI // bit 2
3317 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3
3318 #define NOT_RWDT PCONbits.NOT_RWDT // bit 4
3319 #define STKUNF PCONbits.STKUNF // bit 6
3320 #define STKOVF PCONbits.STKOVF // bit 7
3322 #define TMR1IE PIE1bits.TMR1IE // bit 0
3323 #define TMR2IE PIE1bits.TMR2IE // bit 1
3324 #define CCP1IE PIE1bits.CCP1IE // bit 2, shadows bit in PIE1bits
3325 #define CCPIE PIE1bits.CCPIE // bit 2, shadows bit in PIE1bits
3326 #define SSP1IE PIE1bits.SSP1IE // bit 3
3327 #define ADIE PIE1bits.ADIE // bit 6
3328 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
3330 #define CCP2IE PIE2bits.CCP2IE // bit 0
3331 #define BCL1IE PIE2bits.BCL1IE // bit 3
3333 #define ZCDIE PIE3bits.ZCDIE // bit 4
3335 #define TMR1IF PIR1bits.TMR1IF // bit 0
3336 #define TMR2IF PIR1bits.TMR2IF // bit 1
3337 #define CCP1IF PIR1bits.CCP1IF // bit 2, shadows bit in PIR1bits
3338 #define CCPIF PIR1bits.CCPIF // bit 2, shadows bit in PIR1bits
3339 #define SSP1IF PIR1bits.SSP1IF // bit 3
3340 #define ADIF PIR1bits.ADIF // bit 6
3341 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
3343 #define CCP2IF PIR2bits.CCP2IF // bit 0
3344 #define BCL1IF PIR2bits.BCL1IF // bit 3
3346 #define ZCDIF PIR3bits.ZCDIF // bit 4
3348 #define RD PMCON1bits.RD // bit 0
3349 #define WR PMCON1bits.WR // bit 1
3350 #define WREN PMCON1bits.WREN // bit 2
3351 #define WRERR PMCON1bits.WRERR // bit 3
3352 #define FREE PMCON1bits.FREE // bit 4
3353 #define LWLO PMCON1bits.LWLO // bit 5
3354 #define CFGS PMCON1bits.CFGS // bit 6
3356 #define RA0 PORTAbits.RA0 // bit 0
3357 #define RA1 PORTAbits.RA1 // bit 1
3358 #define RA2 PORTAbits.RA2 // bit 2
3359 #define RA3 PORTAbits.RA3 // bit 3
3360 #define RA4 PORTAbits.RA4 // bit 4
3361 #define RA5 PORTAbits.RA5 // bit 5
3363 #define RC0 PORTCbits.RC0 // bit 0
3364 #define RC1 PORTCbits.RC1 // bit 1
3365 #define RC2 PORTCbits.RC2 // bit 2
3366 #define RC3 PORTCbits.RC3 // bit 3
3367 #define RC4 PORTCbits.RC4 // bit 4
3368 #define RC5 PORTCbits.RC5 // bit 5
3370 #define PPSLOCKED PPSLOCKbits.PPSLOCKED // bit 0
3372 #define SLRA0 SLRCONAbits.SLRA0 // bit 0
3373 #define SLRA1 SLRCONAbits.SLRA1 // bit 1
3374 #define SLRA2 SLRCONAbits.SLRA2 // bit 2
3375 #define SLRA4 SLRCONAbits.SLRA4 // bit 4
3376 #define SLRA5 SLRCONAbits.SLRA5 // bit 5
3378 #define SLRC0 SLRCONCbits.SLRC0 // bit 0
3379 #define SLRC1 SLRCONCbits.SLRC1 // bit 1
3380 #define SLRC2 SLRCONCbits.SLRC2 // bit 2
3381 #define SLRC3 SLRCONCbits.SLRC3 // bit 3
3382 #define SLRC4 SLRCONCbits.SLRC4 // bit 4
3383 #define SLRC5 SLRCONCbits.SLRC5 // bit 5
3385 #define SSP1ADD0 SSP1ADDbits.SSP1ADD0 // bit 0, shadows bit in SSP1ADDbits
3386 #define ADD0 SSP1ADDbits.ADD0 // bit 0, shadows bit in SSP1ADDbits
3387 #define SSP1ADD1 SSP1ADDbits.SSP1ADD1 // bit 1, shadows bit in SSP1ADDbits
3388 #define ADD1 SSP1ADDbits.ADD1 // bit 1, shadows bit in SSP1ADDbits
3389 #define SSP1ADD2 SSP1ADDbits.SSP1ADD2 // bit 2, shadows bit in SSP1ADDbits
3390 #define ADD2 SSP1ADDbits.ADD2 // bit 2, shadows bit in SSP1ADDbits
3391 #define SSP1ADD3 SSP1ADDbits.SSP1ADD3 // bit 3, shadows bit in SSP1ADDbits
3392 #define ADD3 SSP1ADDbits.ADD3 // bit 3, shadows bit in SSP1ADDbits
3393 #define SSP1ADD4 SSP1ADDbits.SSP1ADD4 // bit 4, shadows bit in SSP1ADDbits
3394 #define ADD4 SSP1ADDbits.ADD4 // bit 4, shadows bit in SSP1ADDbits
3395 #define SSP1ADD5 SSP1ADDbits.SSP1ADD5 // bit 5, shadows bit in SSP1ADDbits
3396 #define ADD5 SSP1ADDbits.ADD5 // bit 5, shadows bit in SSP1ADDbits
3397 #define SSP1ADD6 SSP1ADDbits.SSP1ADD6 // bit 6, shadows bit in SSP1ADDbits
3398 #define ADD6 SSP1ADDbits.ADD6 // bit 6, shadows bit in SSP1ADDbits
3399 #define SSP1ADD7 SSP1ADDbits.SSP1ADD7 // bit 7, shadows bit in SSP1ADDbits
3400 #define ADD7 SSP1ADDbits.ADD7 // bit 7, shadows bit in SSP1ADDbits
3402 #define SSP1BUF0 SSP1BUFbits.SSP1BUF0 // bit 0, shadows bit in SSP1BUFbits
3403 #define BUF0 SSP1BUFbits.BUF0 // bit 0, shadows bit in SSP1BUFbits
3404 #define SSP1BUF1 SSP1BUFbits.SSP1BUF1 // bit 1, shadows bit in SSP1BUFbits
3405 #define BUF1 SSP1BUFbits.BUF1 // bit 1, shadows bit in SSP1BUFbits
3406 #define SSP1BUF2 SSP1BUFbits.SSP1BUF2 // bit 2, shadows bit in SSP1BUFbits
3407 #define BUF2 SSP1BUFbits.BUF2 // bit 2, shadows bit in SSP1BUFbits
3408 #define SSP1BUF3 SSP1BUFbits.SSP1BUF3 // bit 3, shadows bit in SSP1BUFbits
3409 #define BUF3 SSP1BUFbits.BUF3 // bit 3, shadows bit in SSP1BUFbits
3410 #define SSP1BUF4 SSP1BUFbits.SSP1BUF4 // bit 4, shadows bit in SSP1BUFbits
3411 #define BUF4 SSP1BUFbits.BUF4 // bit 4, shadows bit in SSP1BUFbits
3412 #define SSP1BUF5 SSP1BUFbits.SSP1BUF5 // bit 5, shadows bit in SSP1BUFbits
3413 #define BUF5 SSP1BUFbits.BUF5 // bit 5, shadows bit in SSP1BUFbits
3414 #define SSP1BUF6 SSP1BUFbits.SSP1BUF6 // bit 6, shadows bit in SSP1BUFbits
3415 #define BUF6 SSP1BUFbits.BUF6 // bit 6, shadows bit in SSP1BUFbits
3416 #define SSP1BUF7 SSP1BUFbits.SSP1BUF7 // bit 7, shadows bit in SSP1BUFbits
3417 #define BUF7 SSP1BUFbits.BUF7 // bit 7, shadows bit in SSP1BUFbits
3419 #define SSPM0 SSP1CONbits.SSPM0 // bit 0
3420 #define SSPM1 SSP1CONbits.SSPM1 // bit 1
3421 #define SSPM2 SSP1CONbits.SSPM2 // bit 2
3422 #define SSPM3 SSP1CONbits.SSPM3 // bit 3
3423 #define CKP SSP1CONbits.CKP // bit 4
3424 #define SSPEN SSP1CONbits.SSPEN // bit 5
3425 #define SSPOV SSP1CONbits.SSPOV // bit 6
3426 #define WCOL SSP1CONbits.WCOL // bit 7
3428 #define SEN SSP1CON2bits.SEN // bit 0
3429 #define RSEN SSP1CON2bits.RSEN // bit 1
3430 #define PEN SSP1CON2bits.PEN // bit 2
3431 #define RCEN SSP1CON2bits.RCEN // bit 3
3432 #define ACKEN SSP1CON2bits.ACKEN // bit 4
3433 #define ACKDT SSP1CON2bits.ACKDT // bit 5
3434 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6
3435 #define GCEN SSP1CON2bits.GCEN // bit 7
3437 #define DHEN SSP1CON3bits.DHEN // bit 0
3438 #define AHEN SSP1CON3bits.AHEN // bit 1
3439 #define SBCDE SSP1CON3bits.SBCDE // bit 2
3440 #define SDAHT SSP1CON3bits.SDAHT // bit 3
3441 #define BOEN SSP1CON3bits.BOEN // bit 4
3442 #define SCIE SSP1CON3bits.SCIE // bit 5
3443 #define PCIE SSP1CON3bits.PCIE // bit 6
3444 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7
3446 #define SSP1MSK0 SSP1MSKbits.SSP1MSK0 // bit 0, shadows bit in SSP1MSKbits
3447 #define MSK0 SSP1MSKbits.MSK0 // bit 0, shadows bit in SSP1MSKbits
3448 #define SSP1MSK1 SSP1MSKbits.SSP1MSK1 // bit 1, shadows bit in SSP1MSKbits
3449 #define MSK1 SSP1MSKbits.MSK1 // bit 1, shadows bit in SSP1MSKbits
3450 #define SSP1MSK2 SSP1MSKbits.SSP1MSK2 // bit 2, shadows bit in SSP1MSKbits
3451 #define MSK2 SSP1MSKbits.MSK2 // bit 2, shadows bit in SSP1MSKbits
3452 #define SSP1MSK3 SSP1MSKbits.SSP1MSK3 // bit 3, shadows bit in SSP1MSKbits
3453 #define MSK3 SSP1MSKbits.MSK3 // bit 3, shadows bit in SSP1MSKbits
3454 #define SSP1MSK4 SSP1MSKbits.SSP1MSK4 // bit 4, shadows bit in SSP1MSKbits
3455 #define MSK4 SSP1MSKbits.MSK4 // bit 4, shadows bit in SSP1MSKbits
3456 #define SSP1MSK5 SSP1MSKbits.SSP1MSK5 // bit 5, shadows bit in SSP1MSKbits
3457 #define MSK5 SSP1MSKbits.MSK5 // bit 5, shadows bit in SSP1MSKbits
3458 #define SSP1MSK6 SSP1MSKbits.SSP1MSK6 // bit 6, shadows bit in SSP1MSKbits
3459 #define MSK6 SSP1MSKbits.MSK6 // bit 6, shadows bit in SSP1MSKbits
3460 #define SSP1MSK7 SSP1MSKbits.SSP1MSK7 // bit 7, shadows bit in SSP1MSKbits
3461 #define MSK7 SSP1MSKbits.MSK7 // bit 7, shadows bit in SSP1MSKbits
3463 #define BF SSP1STATbits.BF // bit 0
3464 #define UA SSP1STATbits.UA // bit 1
3465 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2
3466 #define S SSP1STATbits.S // bit 3
3467 #define P SSP1STATbits.P // bit 4
3468 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5
3469 #define CKE SSP1STATbits.CKE // bit 6
3470 #define SMP SSP1STATbits.SMP // bit 7
3472 #define C STATUSbits.C // bit 0
3473 #define DC STATUSbits.DC // bit 1
3474 #define Z STATUSbits.Z // bit 2
3475 #define NOT_PD STATUSbits.NOT_PD // bit 3
3476 #define NOT_TO STATUSbits.NOT_TO // bit 4
3478 #define C_SHAD STATUS_SHADbits.C_SHAD // bit 0
3479 #define DC_SHAD STATUS_SHADbits.DC_SHAD // bit 1
3480 #define Z_SHAD STATUS_SHADbits.Z_SHAD // bit 2
3482 #define TMR1ON T1CONbits.TMR1ON // bit 0
3483 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
3484 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
3485 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
3486 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
3487 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6
3488 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7
3490 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0
3491 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1
3492 #define T1GVAL T1GCONbits.T1GVAL // bit 2
3493 #define T1GGO_NOT_DONE T1GCONbits.T1GGO_NOT_DONE // bit 3
3494 #define T1GSPM T1GCONbits.T1GSPM // bit 4
3495 #define T1GTM T1GCONbits.T1GTM // bit 5
3496 #define T1GPOL T1GCONbits.T1GPOL // bit 6
3497 #define TMR1GE T1GCONbits.TMR1GE // bit 7
3499 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
3500 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
3501 #define TMR2ON T2CONbits.TMR2ON // bit 2
3502 #define T2OUTPS0 T2CONbits.T2OUTPS0 // bit 3
3503 #define T2OUTPS1 T2CONbits.T2OUTPS1 // bit 4
3504 #define T2OUTPS2 T2CONbits.T2OUTPS2 // bit 5
3505 #define T2OUTPS3 T2CONbits.T2OUTPS3 // bit 6
3507 #define TRISA0 TRISAbits.TRISA0 // bit 0
3508 #define TRISA1 TRISAbits.TRISA1 // bit 1
3509 #define TRISA2 TRISAbits.TRISA2 // bit 2
3510 #define TRISA4 TRISAbits.TRISA4 // bit 4
3511 #define TRISA5 TRISAbits.TRISA5 // bit 5
3513 #define TRISC0 TRISCbits.TRISC0 // bit 0
3514 #define TRISC1 TRISCbits.TRISC1 // bit 1
3515 #define TRISC2 TRISCbits.TRISC2 // bit 2
3516 #define TRISC3 TRISCbits.TRISC3 // bit 3
3517 #define TRISC4 TRISCbits.TRISC4 // bit 4
3518 #define TRISC5 TRISCbits.TRISC5 // bit 5
3520 #define SWDTEN WDTCONbits.SWDTEN // bit 0
3521 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
3522 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
3523 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
3524 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
3525 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5
3527 #define WPUA0 WPUAbits.WPUA0 // bit 0
3528 #define WPUA1 WPUAbits.WPUA1 // bit 1
3529 #define WPUA2 WPUAbits.WPUA2 // bit 2
3530 #define WPUA3 WPUAbits.WPUA3 // bit 3
3531 #define WPUA4 WPUAbits.WPUA4 // bit 4
3532 #define WPUA5 WPUAbits.WPUA5 // bit 5
3534 #define WPUC0 WPUCbits.WPUC0 // bit 0
3535 #define WPUC1 WPUCbits.WPUC1 // bit 1
3536 #define WPUC2 WPUCbits.WPUC2 // bit 2
3537 #define WPUC3 WPUCbits.WPUC3 // bit 3
3538 #define WPUC4 WPUCbits.WPUC4 // bit 4
3539 #define WPUC5 WPUCbits.WPUC5 // bit 5
3541 #define ZCD1INTN ZCD1CONbits.ZCD1INTN // bit 0
3542 #define ZCD1INTP ZCD1CONbits.ZCD1INTP // bit 1
3543 #define ZCD1POL ZCD1CONbits.ZCD1POL // bit 4
3544 #define ZCD1OUT ZCD1CONbits.ZCD1OUT // bit 5
3545 #define ZCD1EN ZCD1CONbits.ZCD1EN // bit 7
3547 #endif // #ifndef NO_BIT_DEFINES
3549 #endif // #ifndef __PIC16LF1703_H__