Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18lf23k22.h
blob3c7628cc7e02821e978971f3fdf11eb1a2a6e2e6
1 /*
2 * This declarations of the PIC18LF23K22 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:53 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 __PIC18LF23K22_H__
26 #define __PIC18LF23K22_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // ANSELA Bits
40 extern __at(0x0F38) __sfr ANSELA;
42 typedef struct
44 unsigned ANSA0 : 1;
45 unsigned ANSA1 : 1;
46 unsigned ANSA2 : 1;
47 unsigned ANSA3 : 1;
48 unsigned : 1;
49 unsigned ANSA5 : 1;
50 unsigned : 1;
51 unsigned : 1;
52 } __ANSELAbits_t;
54 extern __at(0x0F38) volatile __ANSELAbits_t ANSELAbits;
56 #define _ANSA0 0x01
57 #define _ANSA1 0x02
58 #define _ANSA2 0x04
59 #define _ANSA3 0x08
60 #define _ANSA5 0x20
62 //==============================================================================
65 //==============================================================================
66 // ANSELB Bits
68 extern __at(0x0F39) __sfr ANSELB;
70 typedef union
72 struct
74 unsigned ANSB0 : 1;
75 unsigned ANSB1 : 1;
76 unsigned ANSB2 : 1;
77 unsigned ANSB3 : 1;
78 unsigned ANSB4 : 1;
79 unsigned ANSB5 : 1;
80 unsigned : 1;
81 unsigned : 1;
84 struct
86 unsigned ANSB : 6;
87 unsigned : 2;
89 } __ANSELBbits_t;
91 extern __at(0x0F39) volatile __ANSELBbits_t ANSELBbits;
93 #define _ANSB0 0x01
94 #define _ANSB1 0x02
95 #define _ANSB2 0x04
96 #define _ANSB3 0x08
97 #define _ANSB4 0x10
98 #define _ANSB5 0x20
100 //==============================================================================
103 //==============================================================================
104 // ANSELC Bits
106 extern __at(0x0F3A) __sfr ANSELC;
108 typedef struct
110 unsigned : 1;
111 unsigned : 1;
112 unsigned ANSC2 : 1;
113 unsigned ANSC3 : 1;
114 unsigned ANSC4 : 1;
115 unsigned ANSC5 : 1;
116 unsigned ANSC6 : 1;
117 unsigned ANSC7 : 1;
118 } __ANSELCbits_t;
120 extern __at(0x0F3A) volatile __ANSELCbits_t ANSELCbits;
122 #define _ANSC2 0x04
123 #define _ANSC3 0x08
124 #define _ANSC4 0x10
125 #define _ANSC5 0x20
126 #define _ANSC6 0x40
127 #define _ANSC7 0x80
129 //==============================================================================
132 //==============================================================================
133 // PMD2 Bits
135 extern __at(0x0F3D) __sfr PMD2;
137 typedef struct
139 unsigned ADCMD : 1;
140 unsigned CMP1MD : 1;
141 unsigned CMP2MD : 1;
142 unsigned CTMUMD : 1;
143 unsigned : 1;
144 unsigned : 1;
145 unsigned : 1;
146 unsigned : 1;
147 } __PMD2bits_t;
149 extern __at(0x0F3D) volatile __PMD2bits_t PMD2bits;
151 #define _ADCMD 0x01
152 #define _CMP1MD 0x02
153 #define _CMP2MD 0x04
154 #define _CTMUMD 0x08
156 //==============================================================================
159 //==============================================================================
160 // PMD1 Bits
162 extern __at(0x0F3E) __sfr PMD1;
164 typedef struct
166 unsigned CCP1MD : 1;
167 unsigned CCP2MD : 1;
168 unsigned CCP3MD : 1;
169 unsigned CCP4MD : 1;
170 unsigned CCP5MD : 1;
171 unsigned : 1;
172 unsigned MSSP1MD : 1;
173 unsigned MSSP2MD : 1;
174 } __PMD1bits_t;
176 extern __at(0x0F3E) volatile __PMD1bits_t PMD1bits;
178 #define _CCP1MD 0x01
179 #define _CCP2MD 0x02
180 #define _CCP3MD 0x04
181 #define _CCP4MD 0x08
182 #define _CCP5MD 0x10
183 #define _MSSP1MD 0x40
184 #define _MSSP2MD 0x80
186 //==============================================================================
189 //==============================================================================
190 // PMD0 Bits
192 extern __at(0x0F3F) __sfr PMD0;
194 typedef struct
196 unsigned TMR1MD : 1;
197 unsigned TMR2MD : 1;
198 unsigned TMR3MD : 1;
199 unsigned TMR4MD : 1;
200 unsigned TMR5MD : 1;
201 unsigned TMR6MD : 1;
202 unsigned UART1MD : 1;
203 unsigned UART2MD : 1;
204 } __PMD0bits_t;
206 extern __at(0x0F3F) volatile __PMD0bits_t PMD0bits;
208 #define _TMR1MD 0x01
209 #define _TMR2MD 0x02
210 #define _TMR3MD 0x04
211 #define _TMR4MD 0x08
212 #define _TMR5MD 0x10
213 #define _TMR6MD 0x20
214 #define _UART1MD 0x40
215 #define _UART2MD 0x80
217 //==============================================================================
220 //==============================================================================
221 // DACCON1 Bits
223 extern __at(0x0F40) __sfr DACCON1;
225 typedef union
227 struct
229 unsigned DACR0 : 1;
230 unsigned DACR1 : 1;
231 unsigned DACR2 : 1;
232 unsigned DACR3 : 1;
233 unsigned DACR4 : 1;
234 unsigned : 1;
235 unsigned : 1;
236 unsigned : 1;
239 struct
241 unsigned DACR : 5;
242 unsigned : 3;
244 } __DACCON1bits_t;
246 extern __at(0x0F40) volatile __DACCON1bits_t DACCON1bits;
248 #define _DACR0 0x01
249 #define _DACR1 0x02
250 #define _DACR2 0x04
251 #define _DACR3 0x08
252 #define _DACR4 0x10
254 //==============================================================================
257 //==============================================================================
258 // VREFCON2 Bits
260 extern __at(0x0F40) __sfr VREFCON2;
262 typedef union
264 struct
266 unsigned DACR0 : 1;
267 unsigned DACR1 : 1;
268 unsigned DACR2 : 1;
269 unsigned DACR3 : 1;
270 unsigned DACR4 : 1;
271 unsigned : 1;
272 unsigned : 1;
273 unsigned : 1;
276 struct
278 unsigned DACR : 5;
279 unsigned : 3;
281 } __VREFCON2bits_t;
283 extern __at(0x0F40) volatile __VREFCON2bits_t VREFCON2bits;
285 #define _VREFCON2_DACR0 0x01
286 #define _VREFCON2_DACR1 0x02
287 #define _VREFCON2_DACR2 0x04
288 #define _VREFCON2_DACR3 0x08
289 #define _VREFCON2_DACR4 0x10
291 //==============================================================================
294 //==============================================================================
295 // DACCON0 Bits
297 extern __at(0x0F41) __sfr DACCON0;
299 typedef union
301 struct
303 unsigned DACNSS : 1;
304 unsigned : 1;
305 unsigned DACPSS0 : 1;
306 unsigned DACPSS1 : 1;
307 unsigned : 1;
308 unsigned DACOE : 1;
309 unsigned DACLPS : 1;
310 unsigned DACEN : 1;
313 struct
315 unsigned : 2;
316 unsigned DACPSS : 2;
317 unsigned : 4;
319 } __DACCON0bits_t;
321 extern __at(0x0F41) volatile __DACCON0bits_t DACCON0bits;
323 #define _DACNSS 0x01
324 #define _DACPSS0 0x04
325 #define _DACPSS1 0x08
326 #define _DACOE 0x20
327 #define _DACLPS 0x40
328 #define _DACEN 0x80
330 //==============================================================================
333 //==============================================================================
334 // VREFCON1 Bits
336 extern __at(0x0F41) __sfr VREFCON1;
338 typedef union
340 struct
342 unsigned DACNSS : 1;
343 unsigned : 1;
344 unsigned DACPSS0 : 1;
345 unsigned DACPSS1 : 1;
346 unsigned : 1;
347 unsigned DACOE : 1;
348 unsigned DACLPS : 1;
349 unsigned DACEN : 1;
352 struct
354 unsigned : 2;
355 unsigned DACPSS : 2;
356 unsigned : 4;
358 } __VREFCON1bits_t;
360 extern __at(0x0F41) volatile __VREFCON1bits_t VREFCON1bits;
362 #define _VREFCON1_DACNSS 0x01
363 #define _VREFCON1_DACPSS0 0x04
364 #define _VREFCON1_DACPSS1 0x08
365 #define _VREFCON1_DACOE 0x20
366 #define _VREFCON1_DACLPS 0x40
367 #define _VREFCON1_DACEN 0x80
369 //==============================================================================
372 //==============================================================================
373 // FVRCON Bits
375 extern __at(0x0F42) __sfr FVRCON;
377 typedef union
379 struct
381 unsigned : 1;
382 unsigned : 1;
383 unsigned : 1;
384 unsigned : 1;
385 unsigned FVRS0 : 1;
386 unsigned FVRS1 : 1;
387 unsigned FVRST : 1;
388 unsigned FVREN : 1;
391 struct
393 unsigned : 4;
394 unsigned FVRS : 2;
395 unsigned : 2;
397 } __FVRCONbits_t;
399 extern __at(0x0F42) volatile __FVRCONbits_t FVRCONbits;
401 #define _FVRS0 0x10
402 #define _FVRS1 0x20
403 #define _FVRST 0x40
404 #define _FVREN 0x80
406 //==============================================================================
409 //==============================================================================
410 // VREFCON0 Bits
412 extern __at(0x0F42) __sfr VREFCON0;
414 typedef union
416 struct
418 unsigned : 1;
419 unsigned : 1;
420 unsigned : 1;
421 unsigned : 1;
422 unsigned FVRS0 : 1;
423 unsigned FVRS1 : 1;
424 unsigned FVRST : 1;
425 unsigned FVREN : 1;
428 struct
430 unsigned : 4;
431 unsigned FVRS : 2;
432 unsigned : 2;
434 } __VREFCON0bits_t;
436 extern __at(0x0F42) volatile __VREFCON0bits_t VREFCON0bits;
438 #define _VREFCON0_FVRS0 0x10
439 #define _VREFCON0_FVRS1 0x20
440 #define _VREFCON0_FVRST 0x40
441 #define _VREFCON0_FVREN 0x80
443 //==============================================================================
446 //==============================================================================
447 // CTMUICON Bits
449 extern __at(0x0F43) __sfr CTMUICON;
451 typedef union
453 struct
455 unsigned IRNG0 : 1;
456 unsigned IRNG1 : 1;
457 unsigned ITRIM0 : 1;
458 unsigned ITRIM1 : 1;
459 unsigned ITRIM2 : 1;
460 unsigned ITRIM3 : 1;
461 unsigned ITRIM4 : 1;
462 unsigned ITRIM5 : 1;
465 struct
467 unsigned IRNG : 2;
468 unsigned : 6;
471 struct
473 unsigned : 2;
474 unsigned ITRIM : 6;
476 } __CTMUICONbits_t;
478 extern __at(0x0F43) volatile __CTMUICONbits_t CTMUICONbits;
480 #define _IRNG0 0x01
481 #define _IRNG1 0x02
482 #define _ITRIM0 0x04
483 #define _ITRIM1 0x08
484 #define _ITRIM2 0x10
485 #define _ITRIM3 0x20
486 #define _ITRIM4 0x40
487 #define _ITRIM5 0x80
489 //==============================================================================
492 //==============================================================================
493 // CTMUICONH Bits
495 extern __at(0x0F43) __sfr CTMUICONH;
497 typedef union
499 struct
501 unsigned IRNG0 : 1;
502 unsigned IRNG1 : 1;
503 unsigned ITRIM0 : 1;
504 unsigned ITRIM1 : 1;
505 unsigned ITRIM2 : 1;
506 unsigned ITRIM3 : 1;
507 unsigned ITRIM4 : 1;
508 unsigned ITRIM5 : 1;
511 struct
513 unsigned IRNG : 2;
514 unsigned : 6;
517 struct
519 unsigned : 2;
520 unsigned ITRIM : 6;
522 } __CTMUICONHbits_t;
524 extern __at(0x0F43) volatile __CTMUICONHbits_t CTMUICONHbits;
526 #define _CTMUICONH_IRNG0 0x01
527 #define _CTMUICONH_IRNG1 0x02
528 #define _CTMUICONH_ITRIM0 0x04
529 #define _CTMUICONH_ITRIM1 0x08
530 #define _CTMUICONH_ITRIM2 0x10
531 #define _CTMUICONH_ITRIM3 0x20
532 #define _CTMUICONH_ITRIM4 0x40
533 #define _CTMUICONH_ITRIM5 0x80
535 //==============================================================================
538 //==============================================================================
539 // CTMUCON1 Bits
541 extern __at(0x0F44) __sfr CTMUCON1;
543 typedef union
545 struct
547 unsigned EDG1STAT : 1;
548 unsigned EDG2STAT : 1;
549 unsigned EDG1SEL0 : 1;
550 unsigned EDG1SEL1 : 1;
551 unsigned EDG1POL : 1;
552 unsigned EDG2SEL0 : 1;
553 unsigned EDG2SEL1 : 1;
554 unsigned EDG2POL : 1;
557 struct
559 unsigned : 2;
560 unsigned EDG1SEL : 2;
561 unsigned : 4;
564 struct
566 unsigned : 5;
567 unsigned EDG2SEL : 2;
568 unsigned : 1;
570 } __CTMUCON1bits_t;
572 extern __at(0x0F44) volatile __CTMUCON1bits_t CTMUCON1bits;
574 #define _EDG1STAT 0x01
575 #define _EDG2STAT 0x02
576 #define _EDG1SEL0 0x04
577 #define _EDG1SEL1 0x08
578 #define _EDG1POL 0x10
579 #define _EDG2SEL0 0x20
580 #define _EDG2SEL1 0x40
581 #define _EDG2POL 0x80
583 //==============================================================================
586 //==============================================================================
587 // CTMUCONL Bits
589 extern __at(0x0F44) __sfr CTMUCONL;
591 typedef union
593 struct
595 unsigned EDG1STAT : 1;
596 unsigned EDG2STAT : 1;
597 unsigned EDG1SEL0 : 1;
598 unsigned EDG1SEL1 : 1;
599 unsigned EDG1POL : 1;
600 unsigned EDG2SEL0 : 1;
601 unsigned EDG2SEL1 : 1;
602 unsigned EDG2POL : 1;
605 struct
607 unsigned : 2;
608 unsigned EDG1SEL : 2;
609 unsigned : 4;
612 struct
614 unsigned : 5;
615 unsigned EDG2SEL : 2;
616 unsigned : 1;
618 } __CTMUCONLbits_t;
620 extern __at(0x0F44) volatile __CTMUCONLbits_t CTMUCONLbits;
622 #define _CTMUCONL_EDG1STAT 0x01
623 #define _CTMUCONL_EDG2STAT 0x02
624 #define _CTMUCONL_EDG1SEL0 0x04
625 #define _CTMUCONL_EDG1SEL1 0x08
626 #define _CTMUCONL_EDG1POL 0x10
627 #define _CTMUCONL_EDG2SEL0 0x20
628 #define _CTMUCONL_EDG2SEL1 0x40
629 #define _CTMUCONL_EDG2POL 0x80
631 //==============================================================================
634 //==============================================================================
635 // CTMUCON0 Bits
637 extern __at(0x0F45) __sfr CTMUCON0;
639 typedef struct
641 unsigned CTTRIG : 1;
642 unsigned IDISSEN : 1;
643 unsigned EDGSEQEN : 1;
644 unsigned EDGEN : 1;
645 unsigned TGEN : 1;
646 unsigned CTMUSIDL : 1;
647 unsigned : 1;
648 unsigned CTMUEN : 1;
649 } __CTMUCON0bits_t;
651 extern __at(0x0F45) volatile __CTMUCON0bits_t CTMUCON0bits;
653 #define _CTTRIG 0x01
654 #define _IDISSEN 0x02
655 #define _EDGSEQEN 0x04
656 #define _EDGEN 0x08
657 #define _TGEN 0x10
658 #define _CTMUSIDL 0x20
659 #define _CTMUEN 0x80
661 //==============================================================================
664 //==============================================================================
665 // CTMUCONH Bits
667 extern __at(0x0F45) __sfr CTMUCONH;
669 typedef struct
671 unsigned CTTRIG : 1;
672 unsigned IDISSEN : 1;
673 unsigned EDGSEQEN : 1;
674 unsigned EDGEN : 1;
675 unsigned TGEN : 1;
676 unsigned CTMUSIDL : 1;
677 unsigned : 1;
678 unsigned CTMUEN : 1;
679 } __CTMUCONHbits_t;
681 extern __at(0x0F45) volatile __CTMUCONHbits_t CTMUCONHbits;
683 #define _CTMUCONH_CTTRIG 0x01
684 #define _CTMUCONH_IDISSEN 0x02
685 #define _CTMUCONH_EDGSEQEN 0x04
686 #define _CTMUCONH_EDGEN 0x08
687 #define _CTMUCONH_TGEN 0x10
688 #define _CTMUCONH_CTMUSIDL 0x20
689 #define _CTMUCONH_CTMUEN 0x80
691 //==============================================================================
694 //==============================================================================
695 // SRCON1 Bits
697 extern __at(0x0F46) __sfr SRCON1;
699 typedef struct
701 unsigned SRRC1E : 1;
702 unsigned SRRC2E : 1;
703 unsigned SRRCKE : 1;
704 unsigned SRRPE : 1;
705 unsigned SRSC1E : 1;
706 unsigned SRSC2E : 1;
707 unsigned SRSCKE : 1;
708 unsigned SRSPE : 1;
709 } __SRCON1bits_t;
711 extern __at(0x0F46) volatile __SRCON1bits_t SRCON1bits;
713 #define _SRRC1E 0x01
714 #define _SRRC2E 0x02
715 #define _SRRCKE 0x04
716 #define _SRRPE 0x08
717 #define _SRSC1E 0x10
718 #define _SRSC2E 0x20
719 #define _SRSCKE 0x40
720 #define _SRSPE 0x80
722 //==============================================================================
725 //==============================================================================
726 // SRCON0 Bits
728 extern __at(0x0F47) __sfr SRCON0;
730 typedef union
732 struct
734 unsigned SRPR : 1;
735 unsigned SRPS : 1;
736 unsigned SRNQEN : 1;
737 unsigned SRQEN : 1;
738 unsigned SRCLK0 : 1;
739 unsigned SRCLK1 : 1;
740 unsigned SRCLK2 : 1;
741 unsigned SRLEN : 1;
744 struct
746 unsigned : 4;
747 unsigned SRCLK : 3;
748 unsigned : 1;
750 } __SRCON0bits_t;
752 extern __at(0x0F47) volatile __SRCON0bits_t SRCON0bits;
754 #define _SRPR 0x01
755 #define _SRPS 0x02
756 #define _SRNQEN 0x04
757 #define _SRQEN 0x08
758 #define _SRCLK0 0x10
759 #define _SRCLK1 0x20
760 #define _SRCLK2 0x40
761 #define _SRLEN 0x80
763 //==============================================================================
766 //==============================================================================
767 // CCPTMRS1 Bits
769 extern __at(0x0F48) __sfr CCPTMRS1;
771 typedef union
773 struct
775 unsigned C4TSEL0 : 1;
776 unsigned C4TSEL1 : 1;
777 unsigned C5TSEL0 : 1;
778 unsigned C5TSEL1 : 1;
779 unsigned : 1;
780 unsigned : 1;
781 unsigned : 1;
782 unsigned : 1;
785 struct
787 unsigned C4TSEL : 2;
788 unsigned : 6;
791 struct
793 unsigned : 2;
794 unsigned C5TSEL : 2;
795 unsigned : 4;
797 } __CCPTMRS1bits_t;
799 extern __at(0x0F48) volatile __CCPTMRS1bits_t CCPTMRS1bits;
801 #define _C4TSEL0 0x01
802 #define _C4TSEL1 0x02
803 #define _C5TSEL0 0x04
804 #define _C5TSEL1 0x08
806 //==============================================================================
809 //==============================================================================
810 // CCPTMRS0 Bits
812 extern __at(0x0F49) __sfr CCPTMRS0;
814 typedef union
816 struct
818 unsigned C1TSEL0 : 1;
819 unsigned C1TSEL1 : 1;
820 unsigned : 1;
821 unsigned C2TSEL0 : 1;
822 unsigned C2TSEL1 : 1;
823 unsigned : 1;
824 unsigned C3TSEL0 : 1;
825 unsigned C3TSEL1 : 1;
828 struct
830 unsigned C1TSEL : 2;
831 unsigned : 6;
834 struct
836 unsigned : 3;
837 unsigned C2TSEL : 2;
838 unsigned : 3;
841 struct
843 unsigned : 6;
844 unsigned C3TSEL : 2;
846 } __CCPTMRS0bits_t;
848 extern __at(0x0F49) volatile __CCPTMRS0bits_t CCPTMRS0bits;
850 #define _C1TSEL0 0x01
851 #define _C1TSEL1 0x02
852 #define _C2TSEL0 0x08
853 #define _C2TSEL1 0x10
854 #define _C3TSEL0 0x40
855 #define _C3TSEL1 0x80
857 //==============================================================================
860 //==============================================================================
861 // T6CON Bits
863 extern __at(0x0F4A) __sfr T6CON;
865 typedef union
867 struct
869 unsigned T6CKPS0 : 1;
870 unsigned T6CKPS1 : 1;
871 unsigned TMR6ON : 1;
872 unsigned T6OUTPS0 : 1;
873 unsigned T6OUTPS1 : 1;
874 unsigned T6OUTPS2 : 1;
875 unsigned T6OUTPS3 : 1;
876 unsigned : 1;
879 struct
881 unsigned T6CKPS : 2;
882 unsigned : 6;
885 struct
887 unsigned : 3;
888 unsigned T6OUTPS : 4;
889 unsigned : 1;
891 } __T6CONbits_t;
893 extern __at(0x0F4A) volatile __T6CONbits_t T6CONbits;
895 #define _T6CKPS0 0x01
896 #define _T6CKPS1 0x02
897 #define _TMR6ON 0x04
898 #define _T6OUTPS0 0x08
899 #define _T6OUTPS1 0x10
900 #define _T6OUTPS2 0x20
901 #define _T6OUTPS3 0x40
903 //==============================================================================
905 extern __at(0x0F4B) __sfr PR6;
906 extern __at(0x0F4C) __sfr TMR6;
908 //==============================================================================
909 // T5GCON Bits
911 extern __at(0x0F4D) __sfr T5GCON;
913 typedef union
915 struct
917 unsigned T5GSS0 : 1;
918 unsigned T5GSS1 : 1;
919 unsigned T5GVAL : 1;
920 unsigned T5GGO_NOT_DONE : 1;
921 unsigned T5GSPM : 1;
922 unsigned T5GTM : 1;
923 unsigned T5GPOL : 1;
924 unsigned TMR5GE : 1;
927 struct
929 unsigned : 1;
930 unsigned : 1;
931 unsigned : 1;
932 unsigned T5GGO : 1;
933 unsigned : 1;
934 unsigned : 1;
935 unsigned : 1;
936 unsigned : 1;
939 struct
941 unsigned : 1;
942 unsigned : 1;
943 unsigned : 1;
944 unsigned T5G_DONE : 1;
945 unsigned : 1;
946 unsigned : 1;
947 unsigned : 1;
948 unsigned : 1;
951 struct
953 unsigned T5GSS : 2;
954 unsigned : 6;
956 } __T5GCONbits_t;
958 extern __at(0x0F4D) volatile __T5GCONbits_t T5GCONbits;
960 #define _T5GSS0 0x01
961 #define _T5GSS1 0x02
962 #define _T5GVAL 0x04
963 #define _T5GGO_NOT_DONE 0x08
964 #define _T5GGO 0x08
965 #define _T5G_DONE 0x08
966 #define _T5GSPM 0x10
967 #define _T5GTM 0x20
968 #define _T5GPOL 0x40
969 #define _TMR5GE 0x80
971 //==============================================================================
974 //==============================================================================
975 // T5CON Bits
977 extern __at(0x0F4E) __sfr T5CON;
979 typedef union
981 struct
983 unsigned TMR5ON : 1;
984 unsigned T5RD16 : 1;
985 unsigned NOT_T5SYNC : 1;
986 unsigned T5SOSCEN : 1;
987 unsigned T5CKPS0 : 1;
988 unsigned T5CKPS1 : 1;
989 unsigned TMR5CS0 : 1;
990 unsigned TMR5CS1 : 1;
993 struct
995 unsigned : 1;
996 unsigned : 1;
997 unsigned T5SYNC : 1;
998 unsigned : 1;
999 unsigned : 1;
1000 unsigned : 1;
1001 unsigned : 1;
1002 unsigned : 1;
1005 struct
1007 unsigned : 4;
1008 unsigned T5CKPS : 2;
1009 unsigned : 2;
1012 struct
1014 unsigned : 6;
1015 unsigned TMR5CS : 2;
1017 } __T5CONbits_t;
1019 extern __at(0x0F4E) volatile __T5CONbits_t T5CONbits;
1021 #define _TMR5ON 0x01
1022 #define _T5RD16 0x02
1023 #define _NOT_T5SYNC 0x04
1024 #define _T5SYNC 0x04
1025 #define _T5SOSCEN 0x08
1026 #define _T5CKPS0 0x10
1027 #define _T5CKPS1 0x20
1028 #define _TMR5CS0 0x40
1029 #define _TMR5CS1 0x80
1031 //==============================================================================
1033 extern __at(0x0F4F) __sfr TMR5;
1034 extern __at(0x0F4F) __sfr TMR5L;
1035 extern __at(0x0F50) __sfr TMR5H;
1037 //==============================================================================
1038 // T4CON Bits
1040 extern __at(0x0F51) __sfr T4CON;
1042 typedef union
1044 struct
1046 unsigned T4CKPS0 : 1;
1047 unsigned T4CKPS1 : 1;
1048 unsigned TMR4ON : 1;
1049 unsigned T4OUTPS0 : 1;
1050 unsigned T4OUTPS1 : 1;
1051 unsigned T4OUTPS2 : 1;
1052 unsigned T4OUTPS3 : 1;
1053 unsigned : 1;
1056 struct
1058 unsigned T4CKPS : 2;
1059 unsigned : 6;
1062 struct
1064 unsigned : 3;
1065 unsigned T4OUTPS : 4;
1066 unsigned : 1;
1068 } __T4CONbits_t;
1070 extern __at(0x0F51) volatile __T4CONbits_t T4CONbits;
1072 #define _T4CKPS0 0x01
1073 #define _T4CKPS1 0x02
1074 #define _TMR4ON 0x04
1075 #define _T4OUTPS0 0x08
1076 #define _T4OUTPS1 0x10
1077 #define _T4OUTPS2 0x20
1078 #define _T4OUTPS3 0x40
1080 //==============================================================================
1082 extern __at(0x0F52) __sfr PR4;
1083 extern __at(0x0F53) __sfr TMR4;
1085 //==============================================================================
1086 // CCP5CON Bits
1088 extern __at(0x0F54) __sfr CCP5CON;
1090 typedef union
1092 struct
1094 unsigned CCP5M0 : 1;
1095 unsigned CCP5M1 : 1;
1096 unsigned CCP5M2 : 1;
1097 unsigned CCP5M3 : 1;
1098 unsigned DC5B0 : 1;
1099 unsigned DC5B1 : 1;
1100 unsigned : 1;
1101 unsigned : 1;
1104 struct
1106 unsigned CCP5M : 4;
1107 unsigned : 4;
1110 struct
1112 unsigned : 4;
1113 unsigned DC5B : 2;
1114 unsigned : 2;
1116 } __CCP5CONbits_t;
1118 extern __at(0x0F54) volatile __CCP5CONbits_t CCP5CONbits;
1120 #define _CCP5M0 0x01
1121 #define _CCP5M1 0x02
1122 #define _CCP5M2 0x04
1123 #define _CCP5M3 0x08
1124 #define _DC5B0 0x10
1125 #define _DC5B1 0x20
1127 //==============================================================================
1129 extern __at(0x0F55) __sfr CCPR5;
1130 extern __at(0x0F55) __sfr CCPR5L;
1131 extern __at(0x0F56) __sfr CCPR5H;
1133 //==============================================================================
1134 // CCP4CON Bits
1136 extern __at(0x0F57) __sfr CCP4CON;
1138 typedef union
1140 struct
1142 unsigned CCP4M0 : 1;
1143 unsigned CCP4M1 : 1;
1144 unsigned CCP4M2 : 1;
1145 unsigned CCP4M3 : 1;
1146 unsigned DC4B0 : 1;
1147 unsigned DC4B1 : 1;
1148 unsigned : 1;
1149 unsigned : 1;
1152 struct
1154 unsigned CCP4M : 4;
1155 unsigned : 4;
1158 struct
1160 unsigned : 4;
1161 unsigned DC4B : 2;
1162 unsigned : 2;
1164 } __CCP4CONbits_t;
1166 extern __at(0x0F57) volatile __CCP4CONbits_t CCP4CONbits;
1168 #define _CCP4M0 0x01
1169 #define _CCP4M1 0x02
1170 #define _CCP4M2 0x04
1171 #define _CCP4M3 0x08
1172 #define _DC4B0 0x10
1173 #define _DC4B1 0x20
1175 //==============================================================================
1177 extern __at(0x0F58) __sfr CCPR4;
1178 extern __at(0x0F58) __sfr CCPR4L;
1179 extern __at(0x0F59) __sfr CCPR4H;
1181 //==============================================================================
1182 // PSTR3CON Bits
1184 extern __at(0x0F5A) __sfr PSTR3CON;
1186 typedef struct
1188 unsigned STR3A : 1;
1189 unsigned STR3B : 1;
1190 unsigned STR3C : 1;
1191 unsigned STR3D : 1;
1192 unsigned STR3SYNC : 1;
1193 unsigned : 1;
1194 unsigned : 1;
1195 unsigned : 1;
1196 } __PSTR3CONbits_t;
1198 extern __at(0x0F5A) volatile __PSTR3CONbits_t PSTR3CONbits;
1200 #define _STR3A 0x01
1201 #define _STR3B 0x02
1202 #define _STR3C 0x04
1203 #define _STR3D 0x08
1204 #define _STR3SYNC 0x10
1206 //==============================================================================
1209 //==============================================================================
1210 // CCP3AS Bits
1212 extern __at(0x0F5B) __sfr CCP3AS;
1214 typedef union
1216 struct
1218 unsigned P3SSBD0 : 1;
1219 unsigned P3SSBD1 : 1;
1220 unsigned P3SSAC0 : 1;
1221 unsigned P3SSAC1 : 1;
1222 unsigned CCP3AS0 : 1;
1223 unsigned CCP3AS1 : 1;
1224 unsigned CCP3AS2 : 1;
1225 unsigned CCP3ASE : 1;
1228 struct
1230 unsigned PSS3BD0 : 1;
1231 unsigned PSS3BD1 : 1;
1232 unsigned PSS3AC0 : 1;
1233 unsigned PSS3AC1 : 1;
1234 unsigned : 1;
1235 unsigned : 1;
1236 unsigned : 1;
1237 unsigned : 1;
1240 struct
1242 unsigned P3SSBD : 2;
1243 unsigned : 6;
1246 struct
1248 unsigned PSS3BD : 2;
1249 unsigned : 6;
1252 struct
1254 unsigned : 2;
1255 unsigned PSS3AC : 2;
1256 unsigned : 4;
1259 struct
1261 unsigned : 2;
1262 unsigned P3SSAC : 2;
1263 unsigned : 4;
1266 struct
1268 unsigned : 4;
1269 unsigned CCP3AS : 3;
1270 unsigned : 1;
1272 } __CCP3ASbits_t;
1274 extern __at(0x0F5B) volatile __CCP3ASbits_t CCP3ASbits;
1276 #define _P3SSBD0 0x01
1277 #define _PSS3BD0 0x01
1278 #define _P3SSBD1 0x02
1279 #define _PSS3BD1 0x02
1280 #define _P3SSAC0 0x04
1281 #define _PSS3AC0 0x04
1282 #define _P3SSAC1 0x08
1283 #define _PSS3AC1 0x08
1284 #define _CCP3AS0 0x10
1285 #define _CCP3AS1 0x20
1286 #define _CCP3AS2 0x40
1287 #define _CCP3ASE 0x80
1289 //==============================================================================
1292 //==============================================================================
1293 // ECCP3AS Bits
1295 extern __at(0x0F5B) __sfr ECCP3AS;
1297 typedef union
1299 struct
1301 unsigned P3SSBD0 : 1;
1302 unsigned P3SSBD1 : 1;
1303 unsigned P3SSAC0 : 1;
1304 unsigned P3SSAC1 : 1;
1305 unsigned CCP3AS0 : 1;
1306 unsigned CCP3AS1 : 1;
1307 unsigned CCP3AS2 : 1;
1308 unsigned CCP3ASE : 1;
1311 struct
1313 unsigned PSS3BD0 : 1;
1314 unsigned PSS3BD1 : 1;
1315 unsigned PSS3AC0 : 1;
1316 unsigned PSS3AC1 : 1;
1317 unsigned : 1;
1318 unsigned : 1;
1319 unsigned : 1;
1320 unsigned : 1;
1323 struct
1325 unsigned PSS3BD : 2;
1326 unsigned : 6;
1329 struct
1331 unsigned P3SSBD : 2;
1332 unsigned : 6;
1335 struct
1337 unsigned : 2;
1338 unsigned PSS3AC : 2;
1339 unsigned : 4;
1342 struct
1344 unsigned : 2;
1345 unsigned P3SSAC : 2;
1346 unsigned : 4;
1349 struct
1351 unsigned : 4;
1352 unsigned CCP3AS : 3;
1353 unsigned : 1;
1355 } __ECCP3ASbits_t;
1357 extern __at(0x0F5B) volatile __ECCP3ASbits_t ECCP3ASbits;
1359 #define _ECCP3AS_P3SSBD0 0x01
1360 #define _ECCP3AS_PSS3BD0 0x01
1361 #define _ECCP3AS_P3SSBD1 0x02
1362 #define _ECCP3AS_PSS3BD1 0x02
1363 #define _ECCP3AS_P3SSAC0 0x04
1364 #define _ECCP3AS_PSS3AC0 0x04
1365 #define _ECCP3AS_P3SSAC1 0x08
1366 #define _ECCP3AS_PSS3AC1 0x08
1367 #define _ECCP3AS_CCP3AS0 0x10
1368 #define _ECCP3AS_CCP3AS1 0x20
1369 #define _ECCP3AS_CCP3AS2 0x40
1370 #define _ECCP3AS_CCP3ASE 0x80
1372 //==============================================================================
1375 //==============================================================================
1376 // PWM3CON Bits
1378 extern __at(0x0F5C) __sfr PWM3CON;
1380 typedef union
1382 struct
1384 unsigned P3DC0 : 1;
1385 unsigned P3DC1 : 1;
1386 unsigned P3DC2 : 1;
1387 unsigned P3DC3 : 1;
1388 unsigned P3DC4 : 1;
1389 unsigned P3DC5 : 1;
1390 unsigned P3DC6 : 1;
1391 unsigned P3RSEN : 1;
1394 struct
1396 unsigned P3DC : 7;
1397 unsigned : 1;
1399 } __PWM3CONbits_t;
1401 extern __at(0x0F5C) volatile __PWM3CONbits_t PWM3CONbits;
1403 #define _P3DC0 0x01
1404 #define _P3DC1 0x02
1405 #define _P3DC2 0x04
1406 #define _P3DC3 0x08
1407 #define _P3DC4 0x10
1408 #define _P3DC5 0x20
1409 #define _P3DC6 0x40
1410 #define _P3RSEN 0x80
1412 //==============================================================================
1415 //==============================================================================
1416 // CCP3CON Bits
1418 extern __at(0x0F5D) __sfr CCP3CON;
1420 typedef union
1422 struct
1424 unsigned CCP3M0 : 1;
1425 unsigned CCP3M1 : 1;
1426 unsigned CCP3M2 : 1;
1427 unsigned CCP3M3 : 1;
1428 unsigned DC3B0 : 1;
1429 unsigned DC3B1 : 1;
1430 unsigned P3M0 : 1;
1431 unsigned P3M1 : 1;
1434 struct
1436 unsigned CCP3M : 4;
1437 unsigned : 4;
1440 struct
1442 unsigned : 4;
1443 unsigned DC3B : 2;
1444 unsigned : 2;
1447 struct
1449 unsigned : 6;
1450 unsigned P3M : 2;
1452 } __CCP3CONbits_t;
1454 extern __at(0x0F5D) volatile __CCP3CONbits_t CCP3CONbits;
1456 #define _CCP3M0 0x01
1457 #define _CCP3M1 0x02
1458 #define _CCP3M2 0x04
1459 #define _CCP3M3 0x08
1460 #define _DC3B0 0x10
1461 #define _DC3B1 0x20
1462 #define _P3M0 0x40
1463 #define _P3M1 0x80
1465 //==============================================================================
1467 extern __at(0x0F5E) __sfr CCPR3;
1468 extern __at(0x0F5E) __sfr CCPR3L;
1469 extern __at(0x0F5F) __sfr CCPR3H;
1471 //==============================================================================
1472 // SLRCON Bits
1474 extern __at(0x0F60) __sfr SLRCON;
1476 typedef struct
1478 unsigned SLRA : 1;
1479 unsigned SLRB : 1;
1480 unsigned SLRC : 1;
1481 unsigned : 1;
1482 unsigned : 1;
1483 unsigned : 1;
1484 unsigned : 1;
1485 unsigned : 1;
1486 } __SLRCONbits_t;
1488 extern __at(0x0F60) volatile __SLRCONbits_t SLRCONbits;
1490 #define _SLRA 0x01
1491 #define _SLRB 0x02
1492 #define _SLRC 0x04
1494 //==============================================================================
1497 //==============================================================================
1498 // WPUB Bits
1500 extern __at(0x0F61) __sfr WPUB;
1502 typedef struct
1504 unsigned WPUB0 : 1;
1505 unsigned WPUB1 : 1;
1506 unsigned WPUB2 : 1;
1507 unsigned WPUB3 : 1;
1508 unsigned WPUB4 : 1;
1509 unsigned WPUB5 : 1;
1510 unsigned WPUB6 : 1;
1511 unsigned WPUB7 : 1;
1512 } __WPUBbits_t;
1514 extern __at(0x0F61) volatile __WPUBbits_t WPUBbits;
1516 #define _WPUB0 0x01
1517 #define _WPUB1 0x02
1518 #define _WPUB2 0x04
1519 #define _WPUB3 0x08
1520 #define _WPUB4 0x10
1521 #define _WPUB5 0x20
1522 #define _WPUB6 0x40
1523 #define _WPUB7 0x80
1525 //==============================================================================
1528 //==============================================================================
1529 // IOCB Bits
1531 extern __at(0x0F62) __sfr IOCB;
1533 typedef struct
1535 unsigned : 1;
1536 unsigned : 1;
1537 unsigned : 1;
1538 unsigned : 1;
1539 unsigned IOCB4 : 1;
1540 unsigned IOCB5 : 1;
1541 unsigned IOCB6 : 1;
1542 unsigned IOCB7 : 1;
1543 } __IOCBbits_t;
1545 extern __at(0x0F62) volatile __IOCBbits_t IOCBbits;
1547 #define _IOCB4 0x10
1548 #define _IOCB5 0x20
1549 #define _IOCB6 0x40
1550 #define _IOCB7 0x80
1552 //==============================================================================
1555 //==============================================================================
1556 // PSTR2CON Bits
1558 extern __at(0x0F63) __sfr PSTR2CON;
1560 typedef struct
1562 unsigned STR2A : 1;
1563 unsigned STR2B : 1;
1564 unsigned STR2C : 1;
1565 unsigned STR2D : 1;
1566 unsigned STR2SYNC : 1;
1567 unsigned : 1;
1568 unsigned : 1;
1569 unsigned : 1;
1570 } __PSTR2CONbits_t;
1572 extern __at(0x0F63) volatile __PSTR2CONbits_t PSTR2CONbits;
1574 #define _STR2A 0x01
1575 #define _STR2B 0x02
1576 #define _STR2C 0x04
1577 #define _STR2D 0x08
1578 #define _STR2SYNC 0x10
1580 //==============================================================================
1583 //==============================================================================
1584 // CCP2AS Bits
1586 extern __at(0x0F64) __sfr CCP2AS;
1588 typedef union
1590 struct
1592 unsigned P2SSBD0 : 1;
1593 unsigned P2SSBD1 : 1;
1594 unsigned P2SSAC0 : 1;
1595 unsigned P2SSAC1 : 1;
1596 unsigned CCP2AS0 : 1;
1597 unsigned CCP2AS1 : 1;
1598 unsigned CCP2AS2 : 1;
1599 unsigned CCP2ASE : 1;
1602 struct
1604 unsigned PSS2BD0 : 1;
1605 unsigned PSS2BD1 : 1;
1606 unsigned PSS2AC0 : 1;
1607 unsigned PSS2AC1 : 1;
1608 unsigned : 1;
1609 unsigned : 1;
1610 unsigned : 1;
1611 unsigned : 1;
1614 struct
1616 unsigned P2SSBD : 2;
1617 unsigned : 6;
1620 struct
1622 unsigned PSS2BD : 2;
1623 unsigned : 6;
1626 struct
1628 unsigned : 2;
1629 unsigned PSS2AC : 2;
1630 unsigned : 4;
1633 struct
1635 unsigned : 2;
1636 unsigned P2SSAC : 2;
1637 unsigned : 4;
1640 struct
1642 unsigned : 4;
1643 unsigned CCP2AS : 3;
1644 unsigned : 1;
1646 } __CCP2ASbits_t;
1648 extern __at(0x0F64) volatile __CCP2ASbits_t CCP2ASbits;
1650 #define _P2SSBD0 0x01
1651 #define _PSS2BD0 0x01
1652 #define _P2SSBD1 0x02
1653 #define _PSS2BD1 0x02
1654 #define _P2SSAC0 0x04
1655 #define _PSS2AC0 0x04
1656 #define _P2SSAC1 0x08
1657 #define _PSS2AC1 0x08
1658 #define _CCP2AS0 0x10
1659 #define _CCP2AS1 0x20
1660 #define _CCP2AS2 0x40
1661 #define _CCP2ASE 0x80
1663 //==============================================================================
1666 //==============================================================================
1667 // ECCP2AS Bits
1669 extern __at(0x0F64) __sfr ECCP2AS;
1671 typedef union
1673 struct
1675 unsigned P2SSBD0 : 1;
1676 unsigned P2SSBD1 : 1;
1677 unsigned P2SSAC0 : 1;
1678 unsigned P2SSAC1 : 1;
1679 unsigned CCP2AS0 : 1;
1680 unsigned CCP2AS1 : 1;
1681 unsigned CCP2AS2 : 1;
1682 unsigned CCP2ASE : 1;
1685 struct
1687 unsigned PSS2BD0 : 1;
1688 unsigned PSS2BD1 : 1;
1689 unsigned PSS2AC0 : 1;
1690 unsigned PSS2AC1 : 1;
1691 unsigned : 1;
1692 unsigned : 1;
1693 unsigned : 1;
1694 unsigned : 1;
1697 struct
1699 unsigned PSS2BD : 2;
1700 unsigned : 6;
1703 struct
1705 unsigned P2SSBD : 2;
1706 unsigned : 6;
1709 struct
1711 unsigned : 2;
1712 unsigned PSS2AC : 2;
1713 unsigned : 4;
1716 struct
1718 unsigned : 2;
1719 unsigned P2SSAC : 2;
1720 unsigned : 4;
1723 struct
1725 unsigned : 4;
1726 unsigned CCP2AS : 3;
1727 unsigned : 1;
1729 } __ECCP2ASbits_t;
1731 extern __at(0x0F64) volatile __ECCP2ASbits_t ECCP2ASbits;
1733 #define _ECCP2AS_P2SSBD0 0x01
1734 #define _ECCP2AS_PSS2BD0 0x01
1735 #define _ECCP2AS_P2SSBD1 0x02
1736 #define _ECCP2AS_PSS2BD1 0x02
1737 #define _ECCP2AS_P2SSAC0 0x04
1738 #define _ECCP2AS_PSS2AC0 0x04
1739 #define _ECCP2AS_P2SSAC1 0x08
1740 #define _ECCP2AS_PSS2AC1 0x08
1741 #define _ECCP2AS_CCP2AS0 0x10
1742 #define _ECCP2AS_CCP2AS1 0x20
1743 #define _ECCP2AS_CCP2AS2 0x40
1744 #define _ECCP2AS_CCP2ASE 0x80
1746 //==============================================================================
1749 //==============================================================================
1750 // PWM2CON Bits
1752 extern __at(0x0F65) __sfr PWM2CON;
1754 typedef union
1756 struct
1758 unsigned P2DC0 : 1;
1759 unsigned P2DC1 : 1;
1760 unsigned P2DC2 : 1;
1761 unsigned P2DC3 : 1;
1762 unsigned P2DC4 : 1;
1763 unsigned P2DC5 : 1;
1764 unsigned P2DC6 : 1;
1765 unsigned P2RSEN : 1;
1768 struct
1770 unsigned P2DC : 7;
1771 unsigned : 1;
1773 } __PWM2CONbits_t;
1775 extern __at(0x0F65) volatile __PWM2CONbits_t PWM2CONbits;
1777 #define _P2DC0 0x01
1778 #define _P2DC1 0x02
1779 #define _P2DC2 0x04
1780 #define _P2DC3 0x08
1781 #define _P2DC4 0x10
1782 #define _P2DC5 0x20
1783 #define _P2DC6 0x40
1784 #define _P2RSEN 0x80
1786 //==============================================================================
1789 //==============================================================================
1790 // CCP2CON Bits
1792 extern __at(0x0F66) __sfr CCP2CON;
1794 typedef union
1796 struct
1798 unsigned CCP2M0 : 1;
1799 unsigned CCP2M1 : 1;
1800 unsigned CCP2M2 : 1;
1801 unsigned CCP2M3 : 1;
1802 unsigned DC2B0 : 1;
1803 unsigned DC2B1 : 1;
1804 unsigned P2M0 : 1;
1805 unsigned P2M1 : 1;
1808 struct
1810 unsigned CCP2M : 4;
1811 unsigned : 4;
1814 struct
1816 unsigned : 4;
1817 unsigned DC2B : 2;
1818 unsigned : 2;
1821 struct
1823 unsigned : 6;
1824 unsigned P2M : 2;
1826 } __CCP2CONbits_t;
1828 extern __at(0x0F66) volatile __CCP2CONbits_t CCP2CONbits;
1830 #define _CCP2M0 0x01
1831 #define _CCP2M1 0x02
1832 #define _CCP2M2 0x04
1833 #define _CCP2M3 0x08
1834 #define _DC2B0 0x10
1835 #define _DC2B1 0x20
1836 #define _P2M0 0x40
1837 #define _P2M1 0x80
1839 //==============================================================================
1841 extern __at(0x0F67) __sfr CCPR2;
1842 extern __at(0x0F67) __sfr CCPR2L;
1843 extern __at(0x0F68) __sfr CCPR2H;
1845 //==============================================================================
1846 // SSP2CON3 Bits
1848 extern __at(0x0F69) __sfr SSP2CON3;
1850 typedef struct
1852 unsigned DHEN : 1;
1853 unsigned AHEN : 1;
1854 unsigned SBCDE : 1;
1855 unsigned SDAHT : 1;
1856 unsigned BOEN : 1;
1857 unsigned SCIE : 1;
1858 unsigned PCIE : 1;
1859 unsigned ACKTIM : 1;
1860 } __SSP2CON3bits_t;
1862 extern __at(0x0F69) volatile __SSP2CON3bits_t SSP2CON3bits;
1864 #define _SSP2CON3_DHEN 0x01
1865 #define _SSP2CON3_AHEN 0x02
1866 #define _SSP2CON3_SBCDE 0x04
1867 #define _SSP2CON3_SDAHT 0x08
1868 #define _SSP2CON3_BOEN 0x10
1869 #define _SSP2CON3_SCIE 0x20
1870 #define _SSP2CON3_PCIE 0x40
1871 #define _SSP2CON3_ACKTIM 0x80
1873 //==============================================================================
1876 //==============================================================================
1877 // SSP2MSK Bits
1879 extern __at(0x0F6A) __sfr SSP2MSK;
1881 typedef struct
1883 unsigned MSK0 : 1;
1884 unsigned MSK1 : 1;
1885 unsigned MSK2 : 1;
1886 unsigned MSK3 : 1;
1887 unsigned MSK4 : 1;
1888 unsigned MSK5 : 1;
1889 unsigned MSK6 : 1;
1890 unsigned MSK7 : 1;
1891 } __SSP2MSKbits_t;
1893 extern __at(0x0F6A) volatile __SSP2MSKbits_t SSP2MSKbits;
1895 #define _SSP2MSK_MSK0 0x01
1896 #define _SSP2MSK_MSK1 0x02
1897 #define _SSP2MSK_MSK2 0x04
1898 #define _SSP2MSK_MSK3 0x08
1899 #define _SSP2MSK_MSK4 0x10
1900 #define _SSP2MSK_MSK5 0x20
1901 #define _SSP2MSK_MSK6 0x40
1902 #define _SSP2MSK_MSK7 0x80
1904 //==============================================================================
1907 //==============================================================================
1908 // SSP2CON2 Bits
1910 extern __at(0x0F6B) __sfr SSP2CON2;
1912 typedef struct
1914 unsigned SEN : 1;
1915 unsigned RSEN : 1;
1916 unsigned PEN : 1;
1917 unsigned RCEN : 1;
1918 unsigned ACKEN : 1;
1919 unsigned ACKDT : 1;
1920 unsigned ACKSTAT : 1;
1921 unsigned GCEN : 1;
1922 } __SSP2CON2bits_t;
1924 extern __at(0x0F6B) volatile __SSP2CON2bits_t SSP2CON2bits;
1926 #define _SSP2CON2_SEN 0x01
1927 #define _SSP2CON2_RSEN 0x02
1928 #define _SSP2CON2_PEN 0x04
1929 #define _SSP2CON2_RCEN 0x08
1930 #define _SSP2CON2_ACKEN 0x10
1931 #define _SSP2CON2_ACKDT 0x20
1932 #define _SSP2CON2_ACKSTAT 0x40
1933 #define _SSP2CON2_GCEN 0x80
1935 //==============================================================================
1938 //==============================================================================
1939 // SSP2CON1 Bits
1941 extern __at(0x0F6C) __sfr SSP2CON1;
1943 typedef union
1945 struct
1947 unsigned SSPM0 : 1;
1948 unsigned SSPM1 : 1;
1949 unsigned SSPM2 : 1;
1950 unsigned SSPM3 : 1;
1951 unsigned CKP : 1;
1952 unsigned SSPEN : 1;
1953 unsigned SSPOV : 1;
1954 unsigned WCOL : 1;
1957 struct
1959 unsigned SSPM : 4;
1960 unsigned : 4;
1962 } __SSP2CON1bits_t;
1964 extern __at(0x0F6C) volatile __SSP2CON1bits_t SSP2CON1bits;
1966 #define _SSP2CON1_SSPM0 0x01
1967 #define _SSP2CON1_SSPM1 0x02
1968 #define _SSP2CON1_SSPM2 0x04
1969 #define _SSP2CON1_SSPM3 0x08
1970 #define _SSP2CON1_CKP 0x10
1971 #define _SSP2CON1_SSPEN 0x20
1972 #define _SSP2CON1_SSPOV 0x40
1973 #define _SSP2CON1_WCOL 0x80
1975 //==============================================================================
1978 //==============================================================================
1979 // SSP2STAT Bits
1981 extern __at(0x0F6D) __sfr SSP2STAT;
1983 typedef union
1985 struct
1987 unsigned BF : 1;
1988 unsigned UA : 1;
1989 unsigned R_NOT_W : 1;
1990 unsigned S : 1;
1991 unsigned P : 1;
1992 unsigned D_NOT_A : 1;
1993 unsigned CKE : 1;
1994 unsigned SMP : 1;
1997 struct
1999 unsigned : 1;
2000 unsigned : 1;
2001 unsigned R : 1;
2002 unsigned : 1;
2003 unsigned : 1;
2004 unsigned D : 1;
2005 unsigned : 1;
2006 unsigned : 1;
2009 struct
2011 unsigned : 1;
2012 unsigned : 1;
2013 unsigned NOT_W : 1;
2014 unsigned : 1;
2015 unsigned : 1;
2016 unsigned NOT_A : 1;
2017 unsigned : 1;
2018 unsigned : 1;
2021 struct
2023 unsigned : 1;
2024 unsigned : 1;
2025 unsigned R_W : 1;
2026 unsigned : 1;
2027 unsigned : 1;
2028 unsigned D_A : 1;
2029 unsigned : 1;
2030 unsigned : 1;
2033 struct
2035 unsigned : 1;
2036 unsigned : 1;
2037 unsigned NOT_WRITE : 1;
2038 unsigned : 1;
2039 unsigned : 1;
2040 unsigned NOT_ADDRESS : 1;
2041 unsigned : 1;
2042 unsigned : 1;
2044 } __SSP2STATbits_t;
2046 extern __at(0x0F6D) volatile __SSP2STATbits_t SSP2STATbits;
2048 #define _SSP2STAT_BF 0x01
2049 #define _SSP2STAT_UA 0x02
2050 #define _SSP2STAT_R_NOT_W 0x04
2051 #define _SSP2STAT_R 0x04
2052 #define _SSP2STAT_NOT_W 0x04
2053 #define _SSP2STAT_R_W 0x04
2054 #define _SSP2STAT_NOT_WRITE 0x04
2055 #define _SSP2STAT_S 0x08
2056 #define _SSP2STAT_P 0x10
2057 #define _SSP2STAT_D_NOT_A 0x20
2058 #define _SSP2STAT_D 0x20
2059 #define _SSP2STAT_NOT_A 0x20
2060 #define _SSP2STAT_D_A 0x20
2061 #define _SSP2STAT_NOT_ADDRESS 0x20
2062 #define _SSP2STAT_CKE 0x40
2063 #define _SSP2STAT_SMP 0x80
2065 //==============================================================================
2067 extern __at(0x0F6E) __sfr SSP2ADD;
2068 extern __at(0x0F6F) __sfr SSP2BUF;
2070 //==============================================================================
2071 // BAUD2CON Bits
2073 extern __at(0x0F70) __sfr BAUD2CON;
2075 typedef union
2077 struct
2079 unsigned ABDEN : 1;
2080 unsigned WUE : 1;
2081 unsigned : 1;
2082 unsigned BRG16 : 1;
2083 unsigned CKTXP : 1;
2084 unsigned DTRXP : 1;
2085 unsigned RCIDL : 1;
2086 unsigned ABDOVF : 1;
2089 struct
2091 unsigned : 1;
2092 unsigned : 1;
2093 unsigned : 1;
2094 unsigned : 1;
2095 unsigned SCKP : 1;
2096 unsigned : 1;
2097 unsigned : 1;
2098 unsigned : 1;
2100 } __BAUD2CONbits_t;
2102 extern __at(0x0F70) volatile __BAUD2CONbits_t BAUD2CONbits;
2104 #define _BAUD2CON_ABDEN 0x01
2105 #define _BAUD2CON_WUE 0x02
2106 #define _BAUD2CON_BRG16 0x08
2107 #define _BAUD2CON_CKTXP 0x10
2108 #define _BAUD2CON_SCKP 0x10
2109 #define _BAUD2CON_DTRXP 0x20
2110 #define _BAUD2CON_RCIDL 0x40
2111 #define _BAUD2CON_ABDOVF 0x80
2113 //==============================================================================
2116 //==============================================================================
2117 // BAUDCON2 Bits
2119 extern __at(0x0F70) __sfr BAUDCON2;
2121 typedef union
2123 struct
2125 unsigned ABDEN : 1;
2126 unsigned WUE : 1;
2127 unsigned : 1;
2128 unsigned BRG16 : 1;
2129 unsigned CKTXP : 1;
2130 unsigned DTRXP : 1;
2131 unsigned RCIDL : 1;
2132 unsigned ABDOVF : 1;
2135 struct
2137 unsigned : 1;
2138 unsigned : 1;
2139 unsigned : 1;
2140 unsigned : 1;
2141 unsigned SCKP : 1;
2142 unsigned : 1;
2143 unsigned : 1;
2144 unsigned : 1;
2146 } __BAUDCON2bits_t;
2148 extern __at(0x0F70) volatile __BAUDCON2bits_t BAUDCON2bits;
2150 #define _BAUDCON2_ABDEN 0x01
2151 #define _BAUDCON2_WUE 0x02
2152 #define _BAUDCON2_BRG16 0x08
2153 #define _BAUDCON2_CKTXP 0x10
2154 #define _BAUDCON2_SCKP 0x10
2155 #define _BAUDCON2_DTRXP 0x20
2156 #define _BAUDCON2_RCIDL 0x40
2157 #define _BAUDCON2_ABDOVF 0x80
2159 //==============================================================================
2162 //==============================================================================
2163 // RC2STA Bits
2165 extern __at(0x0F71) __sfr RC2STA;
2167 typedef union
2169 struct
2171 unsigned RX9D : 1;
2172 unsigned OERR : 1;
2173 unsigned FERR : 1;
2174 unsigned ADDEN : 1;
2175 unsigned CREN : 1;
2176 unsigned SREN : 1;
2177 unsigned RX9 : 1;
2178 unsigned SPEN : 1;
2181 struct
2183 unsigned RX9D2 : 1;
2184 unsigned OERR2 : 1;
2185 unsigned FERR2 : 1;
2186 unsigned ADEN : 1;
2187 unsigned CREN2 : 1;
2188 unsigned SREN2 : 1;
2189 unsigned RX92 : 1;
2190 unsigned SPEN2 : 1;
2193 struct
2195 unsigned : 1;
2196 unsigned : 1;
2197 unsigned : 1;
2198 unsigned ADDEN2 : 1;
2199 unsigned : 1;
2200 unsigned : 1;
2201 unsigned : 1;
2202 unsigned : 1;
2204 } __RC2STAbits_t;
2206 extern __at(0x0F71) volatile __RC2STAbits_t RC2STAbits;
2208 #define _RC2STA_RX9D 0x01
2209 #define _RC2STA_RX9D2 0x01
2210 #define _RC2STA_OERR 0x02
2211 #define _RC2STA_OERR2 0x02
2212 #define _RC2STA_FERR 0x04
2213 #define _RC2STA_FERR2 0x04
2214 #define _RC2STA_ADDEN 0x08
2215 #define _RC2STA_ADEN 0x08
2216 #define _RC2STA_ADDEN2 0x08
2217 #define _RC2STA_CREN 0x10
2218 #define _RC2STA_CREN2 0x10
2219 #define _RC2STA_SREN 0x20
2220 #define _RC2STA_SREN2 0x20
2221 #define _RC2STA_RX9 0x40
2222 #define _RC2STA_RX92 0x40
2223 #define _RC2STA_SPEN 0x80
2224 #define _RC2STA_SPEN2 0x80
2226 //==============================================================================
2229 //==============================================================================
2230 // RCSTA2 Bits
2232 extern __at(0x0F71) __sfr RCSTA2;
2234 typedef union
2236 struct
2238 unsigned RX9D : 1;
2239 unsigned OERR : 1;
2240 unsigned FERR : 1;
2241 unsigned ADDEN : 1;
2242 unsigned CREN : 1;
2243 unsigned SREN : 1;
2244 unsigned RX9 : 1;
2245 unsigned SPEN : 1;
2248 struct
2250 unsigned RX9D2 : 1;
2251 unsigned OERR2 : 1;
2252 unsigned FERR2 : 1;
2253 unsigned ADEN : 1;
2254 unsigned CREN2 : 1;
2255 unsigned SREN2 : 1;
2256 unsigned RX92 : 1;
2257 unsigned SPEN2 : 1;
2260 struct
2262 unsigned : 1;
2263 unsigned : 1;
2264 unsigned : 1;
2265 unsigned ADDEN2 : 1;
2266 unsigned : 1;
2267 unsigned : 1;
2268 unsigned : 1;
2269 unsigned : 1;
2271 } __RCSTA2bits_t;
2273 extern __at(0x0F71) volatile __RCSTA2bits_t RCSTA2bits;
2275 #define _RCSTA2_RX9D 0x01
2276 #define _RCSTA2_RX9D2 0x01
2277 #define _RCSTA2_OERR 0x02
2278 #define _RCSTA2_OERR2 0x02
2279 #define _RCSTA2_FERR 0x04
2280 #define _RCSTA2_FERR2 0x04
2281 #define _RCSTA2_ADDEN 0x08
2282 #define _RCSTA2_ADEN 0x08
2283 #define _RCSTA2_ADDEN2 0x08
2284 #define _RCSTA2_CREN 0x10
2285 #define _RCSTA2_CREN2 0x10
2286 #define _RCSTA2_SREN 0x20
2287 #define _RCSTA2_SREN2 0x20
2288 #define _RCSTA2_RX9 0x40
2289 #define _RCSTA2_RX92 0x40
2290 #define _RCSTA2_SPEN 0x80
2291 #define _RCSTA2_SPEN2 0x80
2293 //==============================================================================
2296 //==============================================================================
2297 // TX2STA Bits
2299 extern __at(0x0F72) __sfr TX2STA;
2301 typedef union
2303 struct
2305 unsigned TX9D : 1;
2306 unsigned TRMT : 1;
2307 unsigned BRGH : 1;
2308 unsigned SENDB : 1;
2309 unsigned SYNC : 1;
2310 unsigned TXEN : 1;
2311 unsigned TX9 : 1;
2312 unsigned CSRC : 1;
2315 struct
2317 unsigned TX9D2 : 1;
2318 unsigned TRMT2 : 1;
2319 unsigned BRGH2 : 1;
2320 unsigned SENDB2 : 1;
2321 unsigned SYNC2 : 1;
2322 unsigned TXEN2 : 1;
2323 unsigned TX92 : 1;
2324 unsigned CSRC2 : 1;
2326 } __TX2STAbits_t;
2328 extern __at(0x0F72) volatile __TX2STAbits_t TX2STAbits;
2330 #define _TX2STA_TX9D 0x01
2331 #define _TX2STA_TX9D2 0x01
2332 #define _TX2STA_TRMT 0x02
2333 #define _TX2STA_TRMT2 0x02
2334 #define _TX2STA_BRGH 0x04
2335 #define _TX2STA_BRGH2 0x04
2336 #define _TX2STA_SENDB 0x08
2337 #define _TX2STA_SENDB2 0x08
2338 #define _TX2STA_SYNC 0x10
2339 #define _TX2STA_SYNC2 0x10
2340 #define _TX2STA_TXEN 0x20
2341 #define _TX2STA_TXEN2 0x20
2342 #define _TX2STA_TX9 0x40
2343 #define _TX2STA_TX92 0x40
2344 #define _TX2STA_CSRC 0x80
2345 #define _TX2STA_CSRC2 0x80
2347 //==============================================================================
2350 //==============================================================================
2351 // TXSTA2 Bits
2353 extern __at(0x0F72) __sfr TXSTA2;
2355 typedef union
2357 struct
2359 unsigned TX9D : 1;
2360 unsigned TRMT : 1;
2361 unsigned BRGH : 1;
2362 unsigned SENDB : 1;
2363 unsigned SYNC : 1;
2364 unsigned TXEN : 1;
2365 unsigned TX9 : 1;
2366 unsigned CSRC : 1;
2369 struct
2371 unsigned TX9D2 : 1;
2372 unsigned TRMT2 : 1;
2373 unsigned BRGH2 : 1;
2374 unsigned SENDB2 : 1;
2375 unsigned SYNC2 : 1;
2376 unsigned TXEN2 : 1;
2377 unsigned TX92 : 1;
2378 unsigned CSRC2 : 1;
2380 } __TXSTA2bits_t;
2382 extern __at(0x0F72) volatile __TXSTA2bits_t TXSTA2bits;
2384 #define _TXSTA2_TX9D 0x01
2385 #define _TXSTA2_TX9D2 0x01
2386 #define _TXSTA2_TRMT 0x02
2387 #define _TXSTA2_TRMT2 0x02
2388 #define _TXSTA2_BRGH 0x04
2389 #define _TXSTA2_BRGH2 0x04
2390 #define _TXSTA2_SENDB 0x08
2391 #define _TXSTA2_SENDB2 0x08
2392 #define _TXSTA2_SYNC 0x10
2393 #define _TXSTA2_SYNC2 0x10
2394 #define _TXSTA2_TXEN 0x20
2395 #define _TXSTA2_TXEN2 0x20
2396 #define _TXSTA2_TX9 0x40
2397 #define _TXSTA2_TX92 0x40
2398 #define _TXSTA2_CSRC 0x80
2399 #define _TXSTA2_CSRC2 0x80
2401 //==============================================================================
2403 extern __at(0x0F73) __sfr TX2REG;
2404 extern __at(0x0F73) __sfr TXREG2;
2405 extern __at(0x0F74) __sfr RC2REG;
2406 extern __at(0x0F74) __sfr RCREG2;
2407 extern __at(0x0F75) __sfr SP2BRG;
2408 extern __at(0x0F75) __sfr SPBRG2;
2409 extern __at(0x0F76) __sfr SP2BRGH;
2410 extern __at(0x0F76) __sfr SPBRGH2;
2412 //==============================================================================
2413 // CM12CON Bits
2415 extern __at(0x0F77) __sfr CM12CON;
2417 typedef struct
2419 unsigned C2SYNC : 1;
2420 unsigned C1SYNC : 1;
2421 unsigned C2HYS : 1;
2422 unsigned C1HYS : 1;
2423 unsigned C2RSEL : 1;
2424 unsigned C1RSEL : 1;
2425 unsigned MC2OUT : 1;
2426 unsigned MC1OUT : 1;
2427 } __CM12CONbits_t;
2429 extern __at(0x0F77) volatile __CM12CONbits_t CM12CONbits;
2431 #define _CM12CON_C2SYNC 0x01
2432 #define _CM12CON_C1SYNC 0x02
2433 #define _CM12CON_C2HYS 0x04
2434 #define _CM12CON_C1HYS 0x08
2435 #define _CM12CON_C2RSEL 0x10
2436 #define _CM12CON_C1RSEL 0x20
2437 #define _CM12CON_MC2OUT 0x40
2438 #define _CM12CON_MC1OUT 0x80
2440 //==============================================================================
2443 //==============================================================================
2444 // CM2CON1 Bits
2446 extern __at(0x0F77) __sfr CM2CON1;
2448 typedef struct
2450 unsigned C2SYNC : 1;
2451 unsigned C1SYNC : 1;
2452 unsigned C2HYS : 1;
2453 unsigned C1HYS : 1;
2454 unsigned C2RSEL : 1;
2455 unsigned C1RSEL : 1;
2456 unsigned MC2OUT : 1;
2457 unsigned MC1OUT : 1;
2458 } __CM2CON1bits_t;
2460 extern __at(0x0F77) volatile __CM2CON1bits_t CM2CON1bits;
2462 #define _C2SYNC 0x01
2463 #define _C1SYNC 0x02
2464 #define _C2HYS 0x04
2465 #define _C1HYS 0x08
2466 #define _C2RSEL 0x10
2467 #define _C1RSEL 0x20
2468 #define _MC2OUT 0x40
2469 #define _MC1OUT 0x80
2471 //==============================================================================
2474 //==============================================================================
2475 // CM2CON Bits
2477 extern __at(0x0F78) __sfr CM2CON;
2479 typedef union
2481 struct
2483 unsigned C2CH0 : 1;
2484 unsigned C2CH1 : 1;
2485 unsigned C2R : 1;
2486 unsigned C2SP : 1;
2487 unsigned C2POL : 1;
2488 unsigned C2OE : 1;
2489 unsigned C2OUT : 1;
2490 unsigned C2ON : 1;
2493 struct
2495 unsigned C2CH : 2;
2496 unsigned : 6;
2498 } __CM2CONbits_t;
2500 extern __at(0x0F78) volatile __CM2CONbits_t CM2CONbits;
2502 #define _C2CH0 0x01
2503 #define _C2CH1 0x02
2504 #define _C2R 0x04
2505 #define _C2SP 0x08
2506 #define _C2POL 0x10
2507 #define _C2OE 0x20
2508 #define _C2OUT 0x40
2509 #define _C2ON 0x80
2511 //==============================================================================
2514 //==============================================================================
2515 // CM2CON0 Bits
2517 extern __at(0x0F78) __sfr CM2CON0;
2519 typedef union
2521 struct
2523 unsigned C2CH0 : 1;
2524 unsigned C2CH1 : 1;
2525 unsigned C2R : 1;
2526 unsigned C2SP : 1;
2527 unsigned C2POL : 1;
2528 unsigned C2OE : 1;
2529 unsigned C2OUT : 1;
2530 unsigned C2ON : 1;
2533 struct
2535 unsigned C2CH : 2;
2536 unsigned : 6;
2538 } __CM2CON0bits_t;
2540 extern __at(0x0F78) volatile __CM2CON0bits_t CM2CON0bits;
2542 #define _CM2CON0_C2CH0 0x01
2543 #define _CM2CON0_C2CH1 0x02
2544 #define _CM2CON0_C2R 0x04
2545 #define _CM2CON0_C2SP 0x08
2546 #define _CM2CON0_C2POL 0x10
2547 #define _CM2CON0_C2OE 0x20
2548 #define _CM2CON0_C2OUT 0x40
2549 #define _CM2CON0_C2ON 0x80
2551 //==============================================================================
2554 //==============================================================================
2555 // CM1CON Bits
2557 extern __at(0x0F79) __sfr CM1CON;
2559 typedef union
2561 struct
2563 unsigned C1CH0 : 1;
2564 unsigned C1CH1 : 1;
2565 unsigned C1R : 1;
2566 unsigned C1SP : 1;
2567 unsigned C1POL : 1;
2568 unsigned C1OE : 1;
2569 unsigned C1OUT : 1;
2570 unsigned C1ON : 1;
2573 struct
2575 unsigned C1CH : 2;
2576 unsigned : 6;
2578 } __CM1CONbits_t;
2580 extern __at(0x0F79) volatile __CM1CONbits_t CM1CONbits;
2582 #define _C1CH0 0x01
2583 #define _C1CH1 0x02
2584 #define _C1R 0x04
2585 #define _C1SP 0x08
2586 #define _C1POL 0x10
2587 #define _C1OE 0x20
2588 #define _C1OUT 0x40
2589 #define _C1ON 0x80
2591 //==============================================================================
2594 //==============================================================================
2595 // CM1CON0 Bits
2597 extern __at(0x0F79) __sfr CM1CON0;
2599 typedef union
2601 struct
2603 unsigned C1CH0 : 1;
2604 unsigned C1CH1 : 1;
2605 unsigned C1R : 1;
2606 unsigned C1SP : 1;
2607 unsigned C1POL : 1;
2608 unsigned C1OE : 1;
2609 unsigned C1OUT : 1;
2610 unsigned C1ON : 1;
2613 struct
2615 unsigned C1CH : 2;
2616 unsigned : 6;
2618 } __CM1CON0bits_t;
2620 extern __at(0x0F79) volatile __CM1CON0bits_t CM1CON0bits;
2622 #define _CM1CON0_C1CH0 0x01
2623 #define _CM1CON0_C1CH1 0x02
2624 #define _CM1CON0_C1R 0x04
2625 #define _CM1CON0_C1SP 0x08
2626 #define _CM1CON0_C1POL 0x10
2627 #define _CM1CON0_C1OE 0x20
2628 #define _CM1CON0_C1OUT 0x40
2629 #define _CM1CON0_C1ON 0x80
2631 //==============================================================================
2634 //==============================================================================
2635 // PIE4 Bits
2637 extern __at(0x0F7A) __sfr PIE4;
2639 typedef struct
2641 unsigned CCP3IE : 1;
2642 unsigned CCP4IE : 1;
2643 unsigned CCP5IE : 1;
2644 unsigned : 1;
2645 unsigned : 1;
2646 unsigned : 1;
2647 unsigned : 1;
2648 unsigned : 1;
2649 } __PIE4bits_t;
2651 extern __at(0x0F7A) volatile __PIE4bits_t PIE4bits;
2653 #define _CCP3IE 0x01
2654 #define _CCP4IE 0x02
2655 #define _CCP5IE 0x04
2657 //==============================================================================
2660 //==============================================================================
2661 // PIR4 Bits
2663 extern __at(0x0F7B) __sfr PIR4;
2665 typedef struct
2667 unsigned CCP3IF : 1;
2668 unsigned CCP4IF : 1;
2669 unsigned CCP5IF : 1;
2670 unsigned : 1;
2671 unsigned : 1;
2672 unsigned : 1;
2673 unsigned : 1;
2674 unsigned : 1;
2675 } __PIR4bits_t;
2677 extern __at(0x0F7B) volatile __PIR4bits_t PIR4bits;
2679 #define _CCP3IF 0x01
2680 #define _CCP4IF 0x02
2681 #define _CCP5IF 0x04
2683 //==============================================================================
2686 //==============================================================================
2687 // IPR4 Bits
2689 extern __at(0x0F7C) __sfr IPR4;
2691 typedef struct
2693 unsigned CCP3IP : 1;
2694 unsigned CCP4IP : 1;
2695 unsigned CCP5IP : 1;
2696 unsigned : 1;
2697 unsigned : 1;
2698 unsigned : 1;
2699 unsigned : 1;
2700 unsigned : 1;
2701 } __IPR4bits_t;
2703 extern __at(0x0F7C) volatile __IPR4bits_t IPR4bits;
2705 #define _CCP3IP 0x01
2706 #define _CCP4IP 0x02
2707 #define _CCP5IP 0x04
2709 //==============================================================================
2712 //==============================================================================
2713 // PIE5 Bits
2715 extern __at(0x0F7D) __sfr PIE5;
2717 typedef struct
2719 unsigned TMR4IE : 1;
2720 unsigned TMR5IE : 1;
2721 unsigned TMR6IE : 1;
2722 unsigned : 1;
2723 unsigned : 1;
2724 unsigned : 1;
2725 unsigned : 1;
2726 unsigned : 1;
2727 } __PIE5bits_t;
2729 extern __at(0x0F7D) volatile __PIE5bits_t PIE5bits;
2731 #define _TMR4IE 0x01
2732 #define _TMR5IE 0x02
2733 #define _TMR6IE 0x04
2735 //==============================================================================
2738 //==============================================================================
2739 // PIR5 Bits
2741 extern __at(0x0F7E) __sfr PIR5;
2743 typedef struct
2745 unsigned TMR4IF : 1;
2746 unsigned TMR5IF : 1;
2747 unsigned TMR6IF : 1;
2748 unsigned : 1;
2749 unsigned : 1;
2750 unsigned : 1;
2751 unsigned : 1;
2752 unsigned : 1;
2753 } __PIR5bits_t;
2755 extern __at(0x0F7E) volatile __PIR5bits_t PIR5bits;
2757 #define _TMR4IF 0x01
2758 #define _TMR5IF 0x02
2759 #define _TMR6IF 0x04
2761 //==============================================================================
2764 //==============================================================================
2765 // IPR5 Bits
2767 extern __at(0x0F7F) __sfr IPR5;
2769 typedef struct
2771 unsigned TMR4IP : 1;
2772 unsigned TMR5IP : 1;
2773 unsigned TMR6IP : 1;
2774 unsigned : 1;
2775 unsigned : 1;
2776 unsigned : 1;
2777 unsigned : 1;
2778 unsigned : 1;
2779 } __IPR5bits_t;
2781 extern __at(0x0F7F) volatile __IPR5bits_t IPR5bits;
2783 #define _TMR4IP 0x01
2784 #define _TMR5IP 0x02
2785 #define _TMR6IP 0x04
2787 //==============================================================================
2790 //==============================================================================
2791 // PORTA Bits
2793 extern __at(0x0F80) __sfr PORTA;
2795 typedef union
2797 struct
2799 unsigned RA0 : 1;
2800 unsigned RA1 : 1;
2801 unsigned RA2 : 1;
2802 unsigned RA3 : 1;
2803 unsigned RA4 : 1;
2804 unsigned RA5 : 1;
2805 unsigned RA6 : 1;
2806 unsigned RA7 : 1;
2809 struct
2811 unsigned AN0 : 1;
2812 unsigned AN1 : 1;
2813 unsigned AN2 : 1;
2814 unsigned AN3 : 1;
2815 unsigned C1OUT : 1;
2816 unsigned AN4 : 1;
2817 unsigned : 1;
2818 unsigned : 1;
2821 struct
2823 unsigned C12IN0M : 1;
2824 unsigned C12IN1M : 1;
2825 unsigned C2INP : 1;
2826 unsigned C1INP : 1;
2827 unsigned T0CKI : 1;
2828 unsigned C2OUT : 1;
2829 unsigned : 1;
2830 unsigned : 1;
2833 struct
2835 unsigned C12IN0N : 1;
2836 unsigned C12IN1N : 1;
2837 unsigned VREFM : 1;
2838 unsigned VREFP : 1;
2839 unsigned SRQ : 1;
2840 unsigned SS : 1;
2841 unsigned : 1;
2842 unsigned : 1;
2845 struct
2847 unsigned : 1;
2848 unsigned : 1;
2849 unsigned VREFN : 1;
2850 unsigned : 1;
2851 unsigned CCP5 : 1;
2852 unsigned NOT_SS : 1;
2853 unsigned : 1;
2854 unsigned : 1;
2857 struct
2859 unsigned : 1;
2860 unsigned : 1;
2861 unsigned CVREF : 1;
2862 unsigned : 1;
2863 unsigned : 1;
2864 unsigned LVDIN : 1;
2865 unsigned : 1;
2866 unsigned : 1;
2869 struct
2871 unsigned : 1;
2872 unsigned : 1;
2873 unsigned DACOUT : 1;
2874 unsigned : 1;
2875 unsigned : 1;
2876 unsigned HLVDIN : 1;
2877 unsigned : 1;
2878 unsigned : 1;
2881 struct
2883 unsigned : 1;
2884 unsigned : 1;
2885 unsigned : 1;
2886 unsigned : 1;
2887 unsigned : 1;
2888 unsigned SS1 : 1;
2889 unsigned : 1;
2890 unsigned : 1;
2893 struct
2895 unsigned : 1;
2896 unsigned : 1;
2897 unsigned : 1;
2898 unsigned : 1;
2899 unsigned : 1;
2900 unsigned NOT_SS1 : 1;
2901 unsigned : 1;
2902 unsigned : 1;
2905 struct
2907 unsigned : 1;
2908 unsigned : 1;
2909 unsigned : 1;
2910 unsigned : 1;
2911 unsigned : 1;
2912 unsigned SRNQ : 1;
2913 unsigned : 1;
2914 unsigned : 1;
2916 } __PORTAbits_t;
2918 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
2920 #define _PORTA_RA0 0x01
2921 #define _PORTA_AN0 0x01
2922 #define _PORTA_C12IN0M 0x01
2923 #define _PORTA_C12IN0N 0x01
2924 #define _PORTA_RA1 0x02
2925 #define _PORTA_AN1 0x02
2926 #define _PORTA_C12IN1M 0x02
2927 #define _PORTA_C12IN1N 0x02
2928 #define _PORTA_RA2 0x04
2929 #define _PORTA_AN2 0x04
2930 #define _PORTA_C2INP 0x04
2931 #define _PORTA_VREFM 0x04
2932 #define _PORTA_VREFN 0x04
2933 #define _PORTA_CVREF 0x04
2934 #define _PORTA_DACOUT 0x04
2935 #define _PORTA_RA3 0x08
2936 #define _PORTA_AN3 0x08
2937 #define _PORTA_C1INP 0x08
2938 #define _PORTA_VREFP 0x08
2939 #define _PORTA_RA4 0x10
2940 #define _PORTA_C1OUT 0x10
2941 #define _PORTA_T0CKI 0x10
2942 #define _PORTA_SRQ 0x10
2943 #define _PORTA_CCP5 0x10
2944 #define _PORTA_RA5 0x20
2945 #define _PORTA_AN4 0x20
2946 #define _PORTA_C2OUT 0x20
2947 #define _PORTA_SS 0x20
2948 #define _PORTA_NOT_SS 0x20
2949 #define _PORTA_LVDIN 0x20
2950 #define _PORTA_HLVDIN 0x20
2951 #define _PORTA_SS1 0x20
2952 #define _PORTA_NOT_SS1 0x20
2953 #define _PORTA_SRNQ 0x20
2954 #define _PORTA_RA6 0x40
2955 #define _PORTA_RA7 0x80
2957 //==============================================================================
2960 //==============================================================================
2961 // PORTB Bits
2963 extern __at(0x0F81) __sfr PORTB;
2965 typedef union
2967 struct
2969 unsigned RB0 : 1;
2970 unsigned RB1 : 1;
2971 unsigned RB2 : 1;
2972 unsigned RB3 : 1;
2973 unsigned RB4 : 1;
2974 unsigned RB5 : 1;
2975 unsigned RB6 : 1;
2976 unsigned RB7 : 1;
2979 struct
2981 unsigned INT0 : 1;
2982 unsigned INT1 : 1;
2983 unsigned INT2 : 1;
2984 unsigned CCP2 : 1;
2985 unsigned KBI0 : 1;
2986 unsigned KBI1 : 1;
2987 unsigned KBI2 : 1;
2988 unsigned KBI3 : 1;
2991 struct
2993 unsigned AN12 : 1;
2994 unsigned AN10 : 1;
2995 unsigned AN8 : 1;
2996 unsigned AN9 : 1;
2997 unsigned AN11 : 1;
2998 unsigned AN13 : 1;
2999 unsigned TX2 : 1;
3000 unsigned RX2 : 1;
3003 struct
3005 unsigned FLT0 : 1;
3006 unsigned C12IN3M : 1;
3007 unsigned P1B : 1;
3008 unsigned C12IN2M : 1;
3009 unsigned T5G : 1;
3010 unsigned T1G : 1;
3011 unsigned CK2 : 1;
3012 unsigned DT2 : 1;
3015 struct
3017 unsigned SRI : 1;
3018 unsigned C12IN3N : 1;
3019 unsigned CTED1 : 1;
3020 unsigned C12IN2N : 1;
3021 unsigned P1D : 1;
3022 unsigned CCP3 : 1;
3023 unsigned PGC : 1;
3024 unsigned PGD : 1;
3027 struct
3029 unsigned CCP4 : 1;
3030 unsigned P1C : 1;
3031 unsigned SDA2 : 1;
3032 unsigned CTED2 : 1;
3033 unsigned : 1;
3034 unsigned T3CKI : 1;
3035 unsigned : 1;
3036 unsigned : 1;
3039 struct
3041 unsigned SS2 : 1;
3042 unsigned SCL2 : 1;
3043 unsigned SDI2 : 1;
3044 unsigned P2A : 1;
3045 unsigned : 1;
3046 unsigned P3A : 1;
3047 unsigned : 1;
3048 unsigned : 1;
3051 struct
3053 unsigned NOT_SS2 : 1;
3054 unsigned SCK2 : 1;
3055 unsigned : 1;
3056 unsigned SDO2 : 1;
3057 unsigned : 1;
3058 unsigned P2B : 1;
3059 unsigned : 1;
3060 unsigned : 1;
3063 struct
3065 unsigned INT : 3;
3066 unsigned : 5;
3069 struct
3071 unsigned : 4;
3072 unsigned KBI : 4;
3074 } __PORTBbits_t;
3076 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
3078 #define _PORTB_RB0 0x01
3079 #define _PORTB_INT0 0x01
3080 #define _PORTB_AN12 0x01
3081 #define _PORTB_FLT0 0x01
3082 #define _PORTB_SRI 0x01
3083 #define _PORTB_CCP4 0x01
3084 #define _PORTB_SS2 0x01
3085 #define _PORTB_NOT_SS2 0x01
3086 #define _PORTB_RB1 0x02
3087 #define _PORTB_INT1 0x02
3088 #define _PORTB_AN10 0x02
3089 #define _PORTB_C12IN3M 0x02
3090 #define _PORTB_C12IN3N 0x02
3091 #define _PORTB_P1C 0x02
3092 #define _PORTB_SCL2 0x02
3093 #define _PORTB_SCK2 0x02
3094 #define _PORTB_RB2 0x04
3095 #define _PORTB_INT2 0x04
3096 #define _PORTB_AN8 0x04
3097 #define _PORTB_P1B 0x04
3098 #define _PORTB_CTED1 0x04
3099 #define _PORTB_SDA2 0x04
3100 #define _PORTB_SDI2 0x04
3101 #define _PORTB_RB3 0x08
3102 #define _PORTB_CCP2 0x08
3103 #define _PORTB_AN9 0x08
3104 #define _PORTB_C12IN2M 0x08
3105 #define _PORTB_C12IN2N 0x08
3106 #define _PORTB_CTED2 0x08
3107 #define _PORTB_P2A 0x08
3108 #define _PORTB_SDO2 0x08
3109 #define _PORTB_RB4 0x10
3110 #define _PORTB_KBI0 0x10
3111 #define _PORTB_AN11 0x10
3112 #define _PORTB_T5G 0x10
3113 #define _PORTB_P1D 0x10
3114 #define _PORTB_RB5 0x20
3115 #define _PORTB_KBI1 0x20
3116 #define _PORTB_AN13 0x20
3117 #define _PORTB_T1G 0x20
3118 #define _PORTB_CCP3 0x20
3119 #define _PORTB_T3CKI 0x20
3120 #define _PORTB_P3A 0x20
3121 #define _PORTB_P2B 0x20
3122 #define _PORTB_RB6 0x40
3123 #define _PORTB_KBI2 0x40
3124 #define _PORTB_TX2 0x40
3125 #define _PORTB_CK2 0x40
3126 #define _PORTB_PGC 0x40
3127 #define _PORTB_RB7 0x80
3128 #define _PORTB_KBI3 0x80
3129 #define _PORTB_RX2 0x80
3130 #define _PORTB_DT2 0x80
3131 #define _PORTB_PGD 0x80
3133 //==============================================================================
3136 //==============================================================================
3137 // PORTC Bits
3139 extern __at(0x0F82) __sfr PORTC;
3141 typedef union
3143 struct
3145 unsigned RC0 : 1;
3146 unsigned RC1 : 1;
3147 unsigned RC2 : 1;
3148 unsigned RC3 : 1;
3149 unsigned RC4 : 1;
3150 unsigned RC5 : 1;
3151 unsigned RC6 : 1;
3152 unsigned RC7 : 1;
3155 struct
3157 unsigned T1OSO : 1;
3158 unsigned T1OSI : 1;
3159 unsigned T5CKI : 1;
3160 unsigned SCK : 1;
3161 unsigned SDI : 1;
3162 unsigned SDO : 1;
3163 unsigned TX : 1;
3164 unsigned RX : 1;
3167 struct
3169 unsigned P2B : 1;
3170 unsigned P2A : 1;
3171 unsigned P1A : 1;
3172 unsigned SCL : 1;
3173 unsigned SDA : 1;
3174 unsigned SDO1 : 1;
3175 unsigned CK : 1;
3176 unsigned RX1 : 1;
3179 struct
3181 unsigned T1CKI : 1;
3182 unsigned CCP2 : 1;
3183 unsigned CCP1 : 1;
3184 unsigned SCK1 : 1;
3185 unsigned SDI1 : 1;
3186 unsigned AN17 : 1;
3187 unsigned TX1 : 1;
3188 unsigned DT1 : 1;
3191 struct
3193 unsigned T3CKI : 1;
3194 unsigned : 1;
3195 unsigned CTPLS : 1;
3196 unsigned SCL1 : 1;
3197 unsigned SDA1 : 1;
3198 unsigned : 1;
3199 unsigned CK1 : 1;
3200 unsigned AN19 : 1;
3203 struct
3205 unsigned T3G : 1;
3206 unsigned : 1;
3207 unsigned AN14 : 1;
3208 unsigned AN15 : 1;
3209 unsigned AN16 : 1;
3210 unsigned : 1;
3211 unsigned AN18 : 1;
3212 unsigned P3B : 1;
3215 struct
3217 unsigned : 1;
3218 unsigned : 1;
3219 unsigned : 1;
3220 unsigned : 1;
3221 unsigned : 1;
3222 unsigned : 1;
3223 unsigned CCP3 : 1;
3224 unsigned : 1;
3227 struct
3229 unsigned : 1;
3230 unsigned : 1;
3231 unsigned : 1;
3232 unsigned : 1;
3233 unsigned : 1;
3234 unsigned : 1;
3235 unsigned P3A : 1;
3236 unsigned : 1;
3238 } __PORTCbits_t;
3240 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
3242 #define _PORTC_RC0 0x01
3243 #define _PORTC_T1OSO 0x01
3244 #define _PORTC_P2B 0x01
3245 #define _PORTC_T1CKI 0x01
3246 #define _PORTC_T3CKI 0x01
3247 #define _PORTC_T3G 0x01
3248 #define _PORTC_RC1 0x02
3249 #define _PORTC_T1OSI 0x02
3250 #define _PORTC_P2A 0x02
3251 #define _PORTC_CCP2 0x02
3252 #define _PORTC_RC2 0x04
3253 #define _PORTC_T5CKI 0x04
3254 #define _PORTC_P1A 0x04
3255 #define _PORTC_CCP1 0x04
3256 #define _PORTC_CTPLS 0x04
3257 #define _PORTC_AN14 0x04
3258 #define _PORTC_RC3 0x08
3259 #define _PORTC_SCK 0x08
3260 #define _PORTC_SCL 0x08
3261 #define _PORTC_SCK1 0x08
3262 #define _PORTC_SCL1 0x08
3263 #define _PORTC_AN15 0x08
3264 #define _PORTC_RC4 0x10
3265 #define _PORTC_SDI 0x10
3266 #define _PORTC_SDA 0x10
3267 #define _PORTC_SDI1 0x10
3268 #define _PORTC_SDA1 0x10
3269 #define _PORTC_AN16 0x10
3270 #define _PORTC_RC5 0x20
3271 #define _PORTC_SDO 0x20
3272 #define _PORTC_SDO1 0x20
3273 #define _PORTC_AN17 0x20
3274 #define _PORTC_RC6 0x40
3275 #define _PORTC_TX 0x40
3276 #define _PORTC_CK 0x40
3277 #define _PORTC_TX1 0x40
3278 #define _PORTC_CK1 0x40
3279 #define _PORTC_AN18 0x40
3280 #define _PORTC_CCP3 0x40
3281 #define _PORTC_P3A 0x40
3282 #define _PORTC_RC7 0x80
3283 #define _PORTC_RX 0x80
3284 #define _PORTC_RX1 0x80
3285 #define _PORTC_DT1 0x80
3286 #define _PORTC_AN19 0x80
3287 #define _PORTC_P3B 0x80
3289 //==============================================================================
3292 //==============================================================================
3293 // PORTE Bits
3295 extern __at(0x0F84) __sfr PORTE;
3297 typedef union
3299 struct
3301 unsigned : 1;
3302 unsigned : 1;
3303 unsigned : 1;
3304 unsigned RE3 : 1;
3305 unsigned : 1;
3306 unsigned : 1;
3307 unsigned : 1;
3308 unsigned : 1;
3311 struct
3313 unsigned : 1;
3314 unsigned : 1;
3315 unsigned : 1;
3316 unsigned MCLR : 1;
3317 unsigned : 1;
3318 unsigned : 1;
3319 unsigned : 1;
3320 unsigned : 1;
3323 struct
3325 unsigned : 1;
3326 unsigned : 1;
3327 unsigned : 1;
3328 unsigned NOT_MCLR : 1;
3329 unsigned : 1;
3330 unsigned : 1;
3331 unsigned : 1;
3332 unsigned : 1;
3335 struct
3337 unsigned : 1;
3338 unsigned : 1;
3339 unsigned : 1;
3340 unsigned VPP : 1;
3341 unsigned : 1;
3342 unsigned : 1;
3343 unsigned : 1;
3344 unsigned : 1;
3346 } __PORTEbits_t;
3348 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
3350 #define _RE3 0x08
3351 #define _MCLR 0x08
3352 #define _NOT_MCLR 0x08
3353 #define _VPP 0x08
3355 //==============================================================================
3358 //==============================================================================
3359 // LATA Bits
3361 extern __at(0x0F89) __sfr LATA;
3363 typedef struct
3365 unsigned LATA0 : 1;
3366 unsigned LATA1 : 1;
3367 unsigned LATA2 : 1;
3368 unsigned LATA3 : 1;
3369 unsigned LATA4 : 1;
3370 unsigned LATA5 : 1;
3371 unsigned LATA6 : 1;
3372 unsigned LATA7 : 1;
3373 } __LATAbits_t;
3375 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
3377 #define _LATA0 0x01
3378 #define _LATA1 0x02
3379 #define _LATA2 0x04
3380 #define _LATA3 0x08
3381 #define _LATA4 0x10
3382 #define _LATA5 0x20
3383 #define _LATA6 0x40
3384 #define _LATA7 0x80
3386 //==============================================================================
3389 //==============================================================================
3390 // LATB Bits
3392 extern __at(0x0F8A) __sfr LATB;
3394 typedef struct
3396 unsigned LATB0 : 1;
3397 unsigned LATB1 : 1;
3398 unsigned LATB2 : 1;
3399 unsigned LATB3 : 1;
3400 unsigned LATB4 : 1;
3401 unsigned LATB5 : 1;
3402 unsigned LATB6 : 1;
3403 unsigned LATB7 : 1;
3404 } __LATBbits_t;
3406 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
3408 #define _LATB0 0x01
3409 #define _LATB1 0x02
3410 #define _LATB2 0x04
3411 #define _LATB3 0x08
3412 #define _LATB4 0x10
3413 #define _LATB5 0x20
3414 #define _LATB6 0x40
3415 #define _LATB7 0x80
3417 //==============================================================================
3420 //==============================================================================
3421 // LATC Bits
3423 extern __at(0x0F8B) __sfr LATC;
3425 typedef struct
3427 unsigned LATC0 : 1;
3428 unsigned LATC1 : 1;
3429 unsigned LATC2 : 1;
3430 unsigned LATC3 : 1;
3431 unsigned LATC4 : 1;
3432 unsigned LATC5 : 1;
3433 unsigned LATC6 : 1;
3434 unsigned LATC7 : 1;
3435 } __LATCbits_t;
3437 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
3439 #define _LATC0 0x01
3440 #define _LATC1 0x02
3441 #define _LATC2 0x04
3442 #define _LATC3 0x08
3443 #define _LATC4 0x10
3444 #define _LATC5 0x20
3445 #define _LATC6 0x40
3446 #define _LATC7 0x80
3448 //==============================================================================
3451 //==============================================================================
3452 // DDRA Bits
3454 extern __at(0x0F92) __sfr DDRA;
3456 typedef union
3458 struct
3460 unsigned TRISA0 : 1;
3461 unsigned TRISA1 : 1;
3462 unsigned TRISA2 : 1;
3463 unsigned TRISA3 : 1;
3464 unsigned TRISA4 : 1;
3465 unsigned TRISA5 : 1;
3466 unsigned TRISA6 : 1;
3467 unsigned TRISA7 : 1;
3470 struct
3472 unsigned RA0 : 1;
3473 unsigned RA1 : 1;
3474 unsigned RA2 : 1;
3475 unsigned RA3 : 1;
3476 unsigned RA4 : 1;
3477 unsigned RA5 : 1;
3478 unsigned RA6 : 1;
3479 unsigned RA7 : 1;
3481 } __DDRAbits_t;
3483 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
3485 #define _TRISA0 0x01
3486 #define _RA0 0x01
3487 #define _TRISA1 0x02
3488 #define _RA1 0x02
3489 #define _TRISA2 0x04
3490 #define _RA2 0x04
3491 #define _TRISA3 0x08
3492 #define _RA3 0x08
3493 #define _TRISA4 0x10
3494 #define _RA4 0x10
3495 #define _TRISA5 0x20
3496 #define _RA5 0x20
3497 #define _TRISA6 0x40
3498 #define _RA6 0x40
3499 #define _TRISA7 0x80
3500 #define _RA7 0x80
3502 //==============================================================================
3505 //==============================================================================
3506 // TRISA Bits
3508 extern __at(0x0F92) __sfr TRISA;
3510 typedef union
3512 struct
3514 unsigned TRISA0 : 1;
3515 unsigned TRISA1 : 1;
3516 unsigned TRISA2 : 1;
3517 unsigned TRISA3 : 1;
3518 unsigned TRISA4 : 1;
3519 unsigned TRISA5 : 1;
3520 unsigned TRISA6 : 1;
3521 unsigned TRISA7 : 1;
3524 struct
3526 unsigned RA0 : 1;
3527 unsigned RA1 : 1;
3528 unsigned RA2 : 1;
3529 unsigned RA3 : 1;
3530 unsigned RA4 : 1;
3531 unsigned RA5 : 1;
3532 unsigned RA6 : 1;
3533 unsigned RA7 : 1;
3535 } __TRISAbits_t;
3537 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
3539 #define _TRISA_TRISA0 0x01
3540 #define _TRISA_RA0 0x01
3541 #define _TRISA_TRISA1 0x02
3542 #define _TRISA_RA1 0x02
3543 #define _TRISA_TRISA2 0x04
3544 #define _TRISA_RA2 0x04
3545 #define _TRISA_TRISA3 0x08
3546 #define _TRISA_RA3 0x08
3547 #define _TRISA_TRISA4 0x10
3548 #define _TRISA_RA4 0x10
3549 #define _TRISA_TRISA5 0x20
3550 #define _TRISA_RA5 0x20
3551 #define _TRISA_TRISA6 0x40
3552 #define _TRISA_RA6 0x40
3553 #define _TRISA_TRISA7 0x80
3554 #define _TRISA_RA7 0x80
3556 //==============================================================================
3559 //==============================================================================
3560 // DDRB Bits
3562 extern __at(0x0F93) __sfr DDRB;
3564 typedef union
3566 struct
3568 unsigned TRISB0 : 1;
3569 unsigned TRISB1 : 1;
3570 unsigned TRISB2 : 1;
3571 unsigned TRISB3 : 1;
3572 unsigned TRISB4 : 1;
3573 unsigned TRISB5 : 1;
3574 unsigned TRISB6 : 1;
3575 unsigned TRISB7 : 1;
3578 struct
3580 unsigned RB0 : 1;
3581 unsigned RB1 : 1;
3582 unsigned RB2 : 1;
3583 unsigned RB3 : 1;
3584 unsigned RB4 : 1;
3585 unsigned RB5 : 1;
3586 unsigned RB6 : 1;
3587 unsigned RB7 : 1;
3589 } __DDRBbits_t;
3591 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
3593 #define _TRISB0 0x01
3594 #define _RB0 0x01
3595 #define _TRISB1 0x02
3596 #define _RB1 0x02
3597 #define _TRISB2 0x04
3598 #define _RB2 0x04
3599 #define _TRISB3 0x08
3600 #define _RB3 0x08
3601 #define _TRISB4 0x10
3602 #define _RB4 0x10
3603 #define _TRISB5 0x20
3604 #define _RB5 0x20
3605 #define _TRISB6 0x40
3606 #define _RB6 0x40
3607 #define _TRISB7 0x80
3608 #define _RB7 0x80
3610 //==============================================================================
3613 //==============================================================================
3614 // TRISB Bits
3616 extern __at(0x0F93) __sfr TRISB;
3618 typedef union
3620 struct
3622 unsigned TRISB0 : 1;
3623 unsigned TRISB1 : 1;
3624 unsigned TRISB2 : 1;
3625 unsigned TRISB3 : 1;
3626 unsigned TRISB4 : 1;
3627 unsigned TRISB5 : 1;
3628 unsigned TRISB6 : 1;
3629 unsigned TRISB7 : 1;
3632 struct
3634 unsigned RB0 : 1;
3635 unsigned RB1 : 1;
3636 unsigned RB2 : 1;
3637 unsigned RB3 : 1;
3638 unsigned RB4 : 1;
3639 unsigned RB5 : 1;
3640 unsigned RB6 : 1;
3641 unsigned RB7 : 1;
3643 } __TRISBbits_t;
3645 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3647 #define _TRISB_TRISB0 0x01
3648 #define _TRISB_RB0 0x01
3649 #define _TRISB_TRISB1 0x02
3650 #define _TRISB_RB1 0x02
3651 #define _TRISB_TRISB2 0x04
3652 #define _TRISB_RB2 0x04
3653 #define _TRISB_TRISB3 0x08
3654 #define _TRISB_RB3 0x08
3655 #define _TRISB_TRISB4 0x10
3656 #define _TRISB_RB4 0x10
3657 #define _TRISB_TRISB5 0x20
3658 #define _TRISB_RB5 0x20
3659 #define _TRISB_TRISB6 0x40
3660 #define _TRISB_RB6 0x40
3661 #define _TRISB_TRISB7 0x80
3662 #define _TRISB_RB7 0x80
3664 //==============================================================================
3667 //==============================================================================
3668 // DDRC Bits
3670 extern __at(0x0F94) __sfr DDRC;
3672 typedef union
3674 struct
3676 unsigned TRISC0 : 1;
3677 unsigned TRISC1 : 1;
3678 unsigned TRISC2 : 1;
3679 unsigned TRISC3 : 1;
3680 unsigned TRISC4 : 1;
3681 unsigned TRISC5 : 1;
3682 unsigned TRISC6 : 1;
3683 unsigned TRISC7 : 1;
3686 struct
3688 unsigned RC0 : 1;
3689 unsigned RC1 : 1;
3690 unsigned RC2 : 1;
3691 unsigned RC3 : 1;
3692 unsigned RC4 : 1;
3693 unsigned RC5 : 1;
3694 unsigned RC6 : 1;
3695 unsigned RC7 : 1;
3697 } __DDRCbits_t;
3699 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
3701 #define _TRISC0 0x01
3702 #define _RC0 0x01
3703 #define _TRISC1 0x02
3704 #define _RC1 0x02
3705 #define _TRISC2 0x04
3706 #define _RC2 0x04
3707 #define _TRISC3 0x08
3708 #define _RC3 0x08
3709 #define _TRISC4 0x10
3710 #define _RC4 0x10
3711 #define _TRISC5 0x20
3712 #define _RC5 0x20
3713 #define _TRISC6 0x40
3714 #define _RC6 0x40
3715 #define _TRISC7 0x80
3716 #define _RC7 0x80
3718 //==============================================================================
3721 //==============================================================================
3722 // TRISC Bits
3724 extern __at(0x0F94) __sfr TRISC;
3726 typedef union
3728 struct
3730 unsigned TRISC0 : 1;
3731 unsigned TRISC1 : 1;
3732 unsigned TRISC2 : 1;
3733 unsigned TRISC3 : 1;
3734 unsigned TRISC4 : 1;
3735 unsigned TRISC5 : 1;
3736 unsigned TRISC6 : 1;
3737 unsigned TRISC7 : 1;
3740 struct
3742 unsigned RC0 : 1;
3743 unsigned RC1 : 1;
3744 unsigned RC2 : 1;
3745 unsigned RC3 : 1;
3746 unsigned RC4 : 1;
3747 unsigned RC5 : 1;
3748 unsigned RC6 : 1;
3749 unsigned RC7 : 1;
3751 } __TRISCbits_t;
3753 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3755 #define _TRISC_TRISC0 0x01
3756 #define _TRISC_RC0 0x01
3757 #define _TRISC_TRISC1 0x02
3758 #define _TRISC_RC1 0x02
3759 #define _TRISC_TRISC2 0x04
3760 #define _TRISC_RC2 0x04
3761 #define _TRISC_TRISC3 0x08
3762 #define _TRISC_RC3 0x08
3763 #define _TRISC_TRISC4 0x10
3764 #define _TRISC_RC4 0x10
3765 #define _TRISC_TRISC5 0x20
3766 #define _TRISC_RC5 0x20
3767 #define _TRISC_TRISC6 0x40
3768 #define _TRISC_RC6 0x40
3769 #define _TRISC_TRISC7 0x80
3770 #define _TRISC_RC7 0x80
3772 //==============================================================================
3775 //==============================================================================
3776 // TRISE Bits
3778 extern __at(0x0F96) __sfr TRISE;
3780 typedef struct
3782 unsigned : 1;
3783 unsigned : 1;
3784 unsigned : 1;
3785 unsigned : 1;
3786 unsigned : 1;
3787 unsigned : 1;
3788 unsigned : 1;
3789 unsigned WPUE3 : 1;
3790 } __TRISEbits_t;
3792 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
3794 #define _WPUE3 0x80
3796 //==============================================================================
3799 //==============================================================================
3800 // OSCTUNE Bits
3802 extern __at(0x0F9B) __sfr OSCTUNE;
3804 typedef union
3806 struct
3808 unsigned TUN0 : 1;
3809 unsigned TUN1 : 1;
3810 unsigned TUN2 : 1;
3811 unsigned TUN3 : 1;
3812 unsigned TUN4 : 1;
3813 unsigned TUN5 : 1;
3814 unsigned PLLEN : 1;
3815 unsigned INTSRC : 1;
3818 struct
3820 unsigned TUN : 6;
3821 unsigned : 2;
3823 } __OSCTUNEbits_t;
3825 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3827 #define _TUN0 0x01
3828 #define _TUN1 0x02
3829 #define _TUN2 0x04
3830 #define _TUN3 0x08
3831 #define _TUN4 0x10
3832 #define _TUN5 0x20
3833 #define _PLLEN 0x40
3834 #define _INTSRC 0x80
3836 //==============================================================================
3839 //==============================================================================
3840 // HLVDCON Bits
3842 extern __at(0x0F9C) __sfr HLVDCON;
3844 typedef union
3846 struct
3848 unsigned HLVDL0 : 1;
3849 unsigned HLVDL1 : 1;
3850 unsigned HLVDL2 : 1;
3851 unsigned HLVDL3 : 1;
3852 unsigned HLVDEN : 1;
3853 unsigned IRVST : 1;
3854 unsigned BGVST : 1;
3855 unsigned VDIRMAG : 1;
3858 struct
3860 unsigned LVDL0 : 1;
3861 unsigned LVDL1 : 1;
3862 unsigned LVDL2 : 1;
3863 unsigned LVDL3 : 1;
3864 unsigned LVDEN : 1;
3865 unsigned IVRST : 1;
3866 unsigned : 1;
3867 unsigned : 1;
3870 struct
3872 unsigned LVV0 : 1;
3873 unsigned LVV1 : 1;
3874 unsigned LVV2 : 1;
3875 unsigned LVV3 : 1;
3876 unsigned : 1;
3877 unsigned BGST : 1;
3878 unsigned : 1;
3879 unsigned : 1;
3882 struct
3884 unsigned LVDL : 4;
3885 unsigned : 4;
3888 struct
3890 unsigned HLVDL : 4;
3891 unsigned : 4;
3894 struct
3896 unsigned LVV : 4;
3897 unsigned : 4;
3899 } __HLVDCONbits_t;
3901 extern __at(0x0F9C) volatile __HLVDCONbits_t HLVDCONbits;
3903 #define _HLVDL0 0x01
3904 #define _LVDL0 0x01
3905 #define _LVV0 0x01
3906 #define _HLVDL1 0x02
3907 #define _LVDL1 0x02
3908 #define _LVV1 0x02
3909 #define _HLVDL2 0x04
3910 #define _LVDL2 0x04
3911 #define _LVV2 0x04
3912 #define _HLVDL3 0x08
3913 #define _LVDL3 0x08
3914 #define _LVV3 0x08
3915 #define _HLVDEN 0x10
3916 #define _LVDEN 0x10
3917 #define _IRVST 0x20
3918 #define _IVRST 0x20
3919 #define _BGST 0x20
3920 #define _BGVST 0x40
3921 #define _VDIRMAG 0x80
3923 //==============================================================================
3926 //==============================================================================
3927 // LVDCON Bits
3929 extern __at(0x0F9C) __sfr LVDCON;
3931 typedef union
3933 struct
3935 unsigned HLVDL0 : 1;
3936 unsigned HLVDL1 : 1;
3937 unsigned HLVDL2 : 1;
3938 unsigned HLVDL3 : 1;
3939 unsigned HLVDEN : 1;
3940 unsigned IRVST : 1;
3941 unsigned BGVST : 1;
3942 unsigned VDIRMAG : 1;
3945 struct
3947 unsigned LVDL0 : 1;
3948 unsigned LVDL1 : 1;
3949 unsigned LVDL2 : 1;
3950 unsigned LVDL3 : 1;
3951 unsigned LVDEN : 1;
3952 unsigned IVRST : 1;
3953 unsigned : 1;
3954 unsigned : 1;
3957 struct
3959 unsigned LVV0 : 1;
3960 unsigned LVV1 : 1;
3961 unsigned LVV2 : 1;
3962 unsigned LVV3 : 1;
3963 unsigned : 1;
3964 unsigned BGST : 1;
3965 unsigned : 1;
3966 unsigned : 1;
3969 struct
3971 unsigned LVDL : 4;
3972 unsigned : 4;
3975 struct
3977 unsigned LVV : 4;
3978 unsigned : 4;
3981 struct
3983 unsigned HLVDL : 4;
3984 unsigned : 4;
3986 } __LVDCONbits_t;
3988 extern __at(0x0F9C) volatile __LVDCONbits_t LVDCONbits;
3990 #define _LVDCON_HLVDL0 0x01
3991 #define _LVDCON_LVDL0 0x01
3992 #define _LVDCON_LVV0 0x01
3993 #define _LVDCON_HLVDL1 0x02
3994 #define _LVDCON_LVDL1 0x02
3995 #define _LVDCON_LVV1 0x02
3996 #define _LVDCON_HLVDL2 0x04
3997 #define _LVDCON_LVDL2 0x04
3998 #define _LVDCON_LVV2 0x04
3999 #define _LVDCON_HLVDL3 0x08
4000 #define _LVDCON_LVDL3 0x08
4001 #define _LVDCON_LVV3 0x08
4002 #define _LVDCON_HLVDEN 0x10
4003 #define _LVDCON_LVDEN 0x10
4004 #define _LVDCON_IRVST 0x20
4005 #define _LVDCON_IVRST 0x20
4006 #define _LVDCON_BGST 0x20
4007 #define _LVDCON_BGVST 0x40
4008 #define _LVDCON_VDIRMAG 0x80
4010 //==============================================================================
4013 //==============================================================================
4014 // PIE1 Bits
4016 extern __at(0x0F9D) __sfr PIE1;
4018 typedef union
4020 struct
4022 unsigned TMR1IE : 1;
4023 unsigned TMR2IE : 1;
4024 unsigned CCP1IE : 1;
4025 unsigned SSP1IE : 1;
4026 unsigned TX1IE : 1;
4027 unsigned RC1IE : 1;
4028 unsigned ADIE : 1;
4029 unsigned : 1;
4032 struct
4034 unsigned : 1;
4035 unsigned : 1;
4036 unsigned : 1;
4037 unsigned SSPIE : 1;
4038 unsigned TXIE : 1;
4039 unsigned RCIE : 1;
4040 unsigned : 1;
4041 unsigned : 1;
4043 } __PIE1bits_t;
4045 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
4047 #define _TMR1IE 0x01
4048 #define _TMR2IE 0x02
4049 #define _CCP1IE 0x04
4050 #define _SSP1IE 0x08
4051 #define _SSPIE 0x08
4052 #define _TX1IE 0x10
4053 #define _TXIE 0x10
4054 #define _RC1IE 0x20
4055 #define _RCIE 0x20
4056 #define _ADIE 0x40
4058 //==============================================================================
4061 //==============================================================================
4062 // PIR1 Bits
4064 extern __at(0x0F9E) __sfr PIR1;
4066 typedef union
4068 struct
4070 unsigned TMR1IF : 1;
4071 unsigned TMR2IF : 1;
4072 unsigned CCP1IF : 1;
4073 unsigned SSP1IF : 1;
4074 unsigned TX1IF : 1;
4075 unsigned RC1IF : 1;
4076 unsigned ADIF : 1;
4077 unsigned : 1;
4080 struct
4082 unsigned : 1;
4083 unsigned : 1;
4084 unsigned : 1;
4085 unsigned SSPIF : 1;
4086 unsigned TXIF : 1;
4087 unsigned RCIF : 1;
4088 unsigned : 1;
4089 unsigned : 1;
4091 } __PIR1bits_t;
4093 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4095 #define _TMR1IF 0x01
4096 #define _TMR2IF 0x02
4097 #define _CCP1IF 0x04
4098 #define _SSP1IF 0x08
4099 #define _SSPIF 0x08
4100 #define _TX1IF 0x10
4101 #define _TXIF 0x10
4102 #define _RC1IF 0x20
4103 #define _RCIF 0x20
4104 #define _ADIF 0x40
4106 //==============================================================================
4109 //==============================================================================
4110 // IPR1 Bits
4112 extern __at(0x0F9F) __sfr IPR1;
4114 typedef union
4116 struct
4118 unsigned TMR1IP : 1;
4119 unsigned TMR2IP : 1;
4120 unsigned CCP1IP : 1;
4121 unsigned SSP1IP : 1;
4122 unsigned TX1IP : 1;
4123 unsigned RC1IP : 1;
4124 unsigned ADIP : 1;
4125 unsigned : 1;
4128 struct
4130 unsigned : 1;
4131 unsigned : 1;
4132 unsigned : 1;
4133 unsigned SSPIP : 1;
4134 unsigned TXIP : 1;
4135 unsigned RCIP : 1;
4136 unsigned : 1;
4137 unsigned : 1;
4139 } __IPR1bits_t;
4141 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4143 #define _TMR1IP 0x01
4144 #define _TMR2IP 0x02
4145 #define _CCP1IP 0x04
4146 #define _SSP1IP 0x08
4147 #define _SSPIP 0x08
4148 #define _TX1IP 0x10
4149 #define _TXIP 0x10
4150 #define _RC1IP 0x20
4151 #define _RCIP 0x20
4152 #define _ADIP 0x40
4154 //==============================================================================
4157 //==============================================================================
4158 // PIE2 Bits
4160 extern __at(0x0FA0) __sfr PIE2;
4162 typedef union
4164 struct
4166 unsigned CCP2IE : 1;
4167 unsigned TMR3IE : 1;
4168 unsigned HLVDIE : 1;
4169 unsigned BCL1IE : 1;
4170 unsigned EEIE : 1;
4171 unsigned C2IE : 1;
4172 unsigned C1IE : 1;
4173 unsigned OSCFIE : 1;
4176 struct
4178 unsigned : 1;
4179 unsigned : 1;
4180 unsigned LVDIE : 1;
4181 unsigned BCLIE : 1;
4182 unsigned : 1;
4183 unsigned : 1;
4184 unsigned : 1;
4185 unsigned : 1;
4187 } __PIE2bits_t;
4189 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4191 #define _CCP2IE 0x01
4192 #define _TMR3IE 0x02
4193 #define _HLVDIE 0x04
4194 #define _LVDIE 0x04
4195 #define _BCL1IE 0x08
4196 #define _BCLIE 0x08
4197 #define _EEIE 0x10
4198 #define _C2IE 0x20
4199 #define _C1IE 0x40
4200 #define _OSCFIE 0x80
4202 //==============================================================================
4205 //==============================================================================
4206 // PIR2 Bits
4208 extern __at(0x0FA1) __sfr PIR2;
4210 typedef union
4212 struct
4214 unsigned CCP2IF : 1;
4215 unsigned TMR3IF : 1;
4216 unsigned HLVDIF : 1;
4217 unsigned BCL1IF : 1;
4218 unsigned EEIF : 1;
4219 unsigned C2IF : 1;
4220 unsigned C1IF : 1;
4221 unsigned OSCFIF : 1;
4224 struct
4226 unsigned : 1;
4227 unsigned : 1;
4228 unsigned LVDIF : 1;
4229 unsigned BCLIF : 1;
4230 unsigned : 1;
4231 unsigned : 1;
4232 unsigned : 1;
4233 unsigned : 1;
4235 } __PIR2bits_t;
4237 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4239 #define _CCP2IF 0x01
4240 #define _TMR3IF 0x02
4241 #define _HLVDIF 0x04
4242 #define _LVDIF 0x04
4243 #define _BCL1IF 0x08
4244 #define _BCLIF 0x08
4245 #define _EEIF 0x10
4246 #define _C2IF 0x20
4247 #define _C1IF 0x40
4248 #define _OSCFIF 0x80
4250 //==============================================================================
4253 //==============================================================================
4254 // IPR2 Bits
4256 extern __at(0x0FA2) __sfr IPR2;
4258 typedef union
4260 struct
4262 unsigned CCP2IP : 1;
4263 unsigned TMR3IP : 1;
4264 unsigned HLVDIP : 1;
4265 unsigned BCL1IP : 1;
4266 unsigned EEIP : 1;
4267 unsigned C2IP : 1;
4268 unsigned C1IP : 1;
4269 unsigned OSCFIP : 1;
4272 struct
4274 unsigned : 1;
4275 unsigned : 1;
4276 unsigned LVDIP : 1;
4277 unsigned BCLIP : 1;
4278 unsigned : 1;
4279 unsigned : 1;
4280 unsigned : 1;
4281 unsigned : 1;
4283 } __IPR2bits_t;
4285 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4287 #define _CCP2IP 0x01
4288 #define _TMR3IP 0x02
4289 #define _HLVDIP 0x04
4290 #define _LVDIP 0x04
4291 #define _BCL1IP 0x08
4292 #define _BCLIP 0x08
4293 #define _EEIP 0x10
4294 #define _C2IP 0x20
4295 #define _C1IP 0x40
4296 #define _OSCFIP 0x80
4298 //==============================================================================
4301 //==============================================================================
4302 // PIE3 Bits
4304 extern __at(0x0FA3) __sfr PIE3;
4306 typedef struct
4308 unsigned TMR1GIE : 1;
4309 unsigned TMR3GIE : 1;
4310 unsigned TMR5GIE : 1;
4311 unsigned CTMUIE : 1;
4312 unsigned TX2IE : 1;
4313 unsigned RC2IE : 1;
4314 unsigned BCL2IE : 1;
4315 unsigned SSP2IE : 1;
4316 } __PIE3bits_t;
4318 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4320 #define _TMR1GIE 0x01
4321 #define _TMR3GIE 0x02
4322 #define _TMR5GIE 0x04
4323 #define _CTMUIE 0x08
4324 #define _TX2IE 0x10
4325 #define _RC2IE 0x20
4326 #define _BCL2IE 0x40
4327 #define _SSP2IE 0x80
4329 //==============================================================================
4332 //==============================================================================
4333 // PIR3 Bits
4335 extern __at(0x0FA4) __sfr PIR3;
4337 typedef struct
4339 unsigned TMR1GIF : 1;
4340 unsigned TMR3GIF : 1;
4341 unsigned TMR5GIF : 1;
4342 unsigned CTMUIF : 1;
4343 unsigned TX2IF : 1;
4344 unsigned RC2IF : 1;
4345 unsigned BCL2IF : 1;
4346 unsigned SSP2IF : 1;
4347 } __PIR3bits_t;
4349 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
4351 #define _TMR1GIF 0x01
4352 #define _TMR3GIF 0x02
4353 #define _TMR5GIF 0x04
4354 #define _CTMUIF 0x08
4355 #define _TX2IF 0x10
4356 #define _RC2IF 0x20
4357 #define _BCL2IF 0x40
4358 #define _SSP2IF 0x80
4360 //==============================================================================
4363 //==============================================================================
4364 // IPR3 Bits
4366 extern __at(0x0FA5) __sfr IPR3;
4368 typedef struct
4370 unsigned TMR1GIP : 1;
4371 unsigned TMR3GIP : 1;
4372 unsigned TMR5GIP : 1;
4373 unsigned CTMUIP : 1;
4374 unsigned TX2IP : 1;
4375 unsigned RC2IP : 1;
4376 unsigned BCL2IP : 1;
4377 unsigned SSP2IP : 1;
4378 } __IPR3bits_t;
4380 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4382 #define _TMR1GIP 0x01
4383 #define _TMR3GIP 0x02
4384 #define _TMR5GIP 0x04
4385 #define _CTMUIP 0x08
4386 #define _TX2IP 0x10
4387 #define _RC2IP 0x20
4388 #define _BCL2IP 0x40
4389 #define _SSP2IP 0x80
4391 //==============================================================================
4394 //==============================================================================
4395 // EECON1 Bits
4397 extern __at(0x0FA6) __sfr EECON1;
4399 typedef struct
4401 unsigned RD : 1;
4402 unsigned WR : 1;
4403 unsigned WREN : 1;
4404 unsigned WRERR : 1;
4405 unsigned FREE : 1;
4406 unsigned : 1;
4407 unsigned CFGS : 1;
4408 unsigned EEPGD : 1;
4409 } __EECON1bits_t;
4411 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
4413 #define _RD 0x01
4414 #define _WR 0x02
4415 #define _WREN 0x04
4416 #define _WRERR 0x08
4417 #define _FREE 0x10
4418 #define _CFGS 0x40
4419 #define _EEPGD 0x80
4421 //==============================================================================
4423 extern __at(0x0FA7) __sfr EECON2;
4424 extern __at(0x0FA8) __sfr EEDATA;
4426 //==============================================================================
4427 // EEADR Bits
4429 extern __at(0x0FA9) __sfr EEADR;
4431 typedef struct
4433 unsigned EEADR0 : 1;
4434 unsigned EEADR1 : 1;
4435 unsigned EEADR2 : 1;
4436 unsigned EEADR3 : 1;
4437 unsigned EEADR4 : 1;
4438 unsigned EEADR5 : 1;
4439 unsigned EEADR6 : 1;
4440 unsigned EEADR7 : 1;
4441 } __EEADRbits_t;
4443 extern __at(0x0FA9) volatile __EEADRbits_t EEADRbits;
4445 #define _EEADR0 0x01
4446 #define _EEADR1 0x02
4447 #define _EEADR2 0x04
4448 #define _EEADR3 0x08
4449 #define _EEADR4 0x10
4450 #define _EEADR5 0x20
4451 #define _EEADR6 0x40
4452 #define _EEADR7 0x80
4454 //==============================================================================
4457 //==============================================================================
4458 // RC1STA Bits
4460 extern __at(0x0FAB) __sfr RC1STA;
4462 typedef union
4464 struct
4466 unsigned RX9D : 1;
4467 unsigned OERR : 1;
4468 unsigned FERR : 1;
4469 unsigned ADDEN : 1;
4470 unsigned CREN : 1;
4471 unsigned SREN : 1;
4472 unsigned RX9 : 1;
4473 unsigned SPEN : 1;
4476 struct
4478 unsigned RX9D1 : 1;
4479 unsigned OERR1 : 1;
4480 unsigned FERR1 : 1;
4481 unsigned ADEN : 1;
4482 unsigned CREN1 : 1;
4483 unsigned SREN1 : 1;
4484 unsigned RX91 : 1;
4485 unsigned SPEN1 : 1;
4488 struct
4490 unsigned : 1;
4491 unsigned : 1;
4492 unsigned : 1;
4493 unsigned ADDEN1 : 1;
4494 unsigned : 1;
4495 unsigned : 1;
4496 unsigned : 1;
4497 unsigned : 1;
4499 } __RC1STAbits_t;
4501 extern __at(0x0FAB) volatile __RC1STAbits_t RC1STAbits;
4503 #define _RX9D 0x01
4504 #define _RX9D1 0x01
4505 #define _OERR 0x02
4506 #define _OERR1 0x02
4507 #define _FERR 0x04
4508 #define _FERR1 0x04
4509 #define _ADDEN 0x08
4510 #define _ADEN 0x08
4511 #define _ADDEN1 0x08
4512 #define _CREN 0x10
4513 #define _CREN1 0x10
4514 #define _SREN 0x20
4515 #define _SREN1 0x20
4516 #define _RX9 0x40
4517 #define _RX91 0x40
4518 #define _SPEN 0x80
4519 #define _SPEN1 0x80
4521 //==============================================================================
4524 //==============================================================================
4525 // RCSTA Bits
4527 extern __at(0x0FAB) __sfr RCSTA;
4529 typedef union
4531 struct
4533 unsigned RX9D : 1;
4534 unsigned OERR : 1;
4535 unsigned FERR : 1;
4536 unsigned ADDEN : 1;
4537 unsigned CREN : 1;
4538 unsigned SREN : 1;
4539 unsigned RX9 : 1;
4540 unsigned SPEN : 1;
4543 struct
4545 unsigned RX9D1 : 1;
4546 unsigned OERR1 : 1;
4547 unsigned FERR1 : 1;
4548 unsigned ADEN : 1;
4549 unsigned CREN1 : 1;
4550 unsigned SREN1 : 1;
4551 unsigned RX91 : 1;
4552 unsigned SPEN1 : 1;
4555 struct
4557 unsigned : 1;
4558 unsigned : 1;
4559 unsigned : 1;
4560 unsigned ADDEN1 : 1;
4561 unsigned : 1;
4562 unsigned : 1;
4563 unsigned : 1;
4564 unsigned : 1;
4566 } __RCSTAbits_t;
4568 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
4570 #define _RCSTA_RX9D 0x01
4571 #define _RCSTA_RX9D1 0x01
4572 #define _RCSTA_OERR 0x02
4573 #define _RCSTA_OERR1 0x02
4574 #define _RCSTA_FERR 0x04
4575 #define _RCSTA_FERR1 0x04
4576 #define _RCSTA_ADDEN 0x08
4577 #define _RCSTA_ADEN 0x08
4578 #define _RCSTA_ADDEN1 0x08
4579 #define _RCSTA_CREN 0x10
4580 #define _RCSTA_CREN1 0x10
4581 #define _RCSTA_SREN 0x20
4582 #define _RCSTA_SREN1 0x20
4583 #define _RCSTA_RX9 0x40
4584 #define _RCSTA_RX91 0x40
4585 #define _RCSTA_SPEN 0x80
4586 #define _RCSTA_SPEN1 0x80
4588 //==============================================================================
4591 //==============================================================================
4592 // RCSTA1 Bits
4594 extern __at(0x0FAB) __sfr RCSTA1;
4596 typedef union
4598 struct
4600 unsigned RX9D : 1;
4601 unsigned OERR : 1;
4602 unsigned FERR : 1;
4603 unsigned ADDEN : 1;
4604 unsigned CREN : 1;
4605 unsigned SREN : 1;
4606 unsigned RX9 : 1;
4607 unsigned SPEN : 1;
4610 struct
4612 unsigned RX9D1 : 1;
4613 unsigned OERR1 : 1;
4614 unsigned FERR1 : 1;
4615 unsigned ADEN : 1;
4616 unsigned CREN1 : 1;
4617 unsigned SREN1 : 1;
4618 unsigned RX91 : 1;
4619 unsigned SPEN1 : 1;
4622 struct
4624 unsigned : 1;
4625 unsigned : 1;
4626 unsigned : 1;
4627 unsigned ADDEN1 : 1;
4628 unsigned : 1;
4629 unsigned : 1;
4630 unsigned : 1;
4631 unsigned : 1;
4633 } __RCSTA1bits_t;
4635 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
4637 #define _RCSTA1_RX9D 0x01
4638 #define _RCSTA1_RX9D1 0x01
4639 #define _RCSTA1_OERR 0x02
4640 #define _RCSTA1_OERR1 0x02
4641 #define _RCSTA1_FERR 0x04
4642 #define _RCSTA1_FERR1 0x04
4643 #define _RCSTA1_ADDEN 0x08
4644 #define _RCSTA1_ADEN 0x08
4645 #define _RCSTA1_ADDEN1 0x08
4646 #define _RCSTA1_CREN 0x10
4647 #define _RCSTA1_CREN1 0x10
4648 #define _RCSTA1_SREN 0x20
4649 #define _RCSTA1_SREN1 0x20
4650 #define _RCSTA1_RX9 0x40
4651 #define _RCSTA1_RX91 0x40
4652 #define _RCSTA1_SPEN 0x80
4653 #define _RCSTA1_SPEN1 0x80
4655 //==============================================================================
4658 //==============================================================================
4659 // TX1STA Bits
4661 extern __at(0x0FAC) __sfr TX1STA;
4663 typedef union
4665 struct
4667 unsigned TX9D : 1;
4668 unsigned TRMT : 1;
4669 unsigned BRGH : 1;
4670 unsigned SENDB : 1;
4671 unsigned SYNC : 1;
4672 unsigned TXEN : 1;
4673 unsigned TX9 : 1;
4674 unsigned CSRC : 1;
4677 struct
4679 unsigned TX9D1 : 1;
4680 unsigned TRMT1 : 1;
4681 unsigned BRGH1 : 1;
4682 unsigned SENDB1 : 1;
4683 unsigned SYNC1 : 1;
4684 unsigned TXEN1 : 1;
4685 unsigned TX91 : 1;
4686 unsigned CSRC1 : 1;
4688 } __TX1STAbits_t;
4690 extern __at(0x0FAC) volatile __TX1STAbits_t TX1STAbits;
4692 #define _TX9D 0x01
4693 #define _TX9D1 0x01
4694 #define _TRMT 0x02
4695 #define _TRMT1 0x02
4696 #define _BRGH 0x04
4697 #define _BRGH1 0x04
4698 #define _SENDB 0x08
4699 #define _SENDB1 0x08
4700 #define _SYNC 0x10
4701 #define _SYNC1 0x10
4702 #define _TXEN 0x20
4703 #define _TXEN1 0x20
4704 #define _TX9 0x40
4705 #define _TX91 0x40
4706 #define _CSRC 0x80
4707 #define _CSRC1 0x80
4709 //==============================================================================
4712 //==============================================================================
4713 // TXSTA Bits
4715 extern __at(0x0FAC) __sfr TXSTA;
4717 typedef union
4719 struct
4721 unsigned TX9D : 1;
4722 unsigned TRMT : 1;
4723 unsigned BRGH : 1;
4724 unsigned SENDB : 1;
4725 unsigned SYNC : 1;
4726 unsigned TXEN : 1;
4727 unsigned TX9 : 1;
4728 unsigned CSRC : 1;
4731 struct
4733 unsigned TX9D1 : 1;
4734 unsigned TRMT1 : 1;
4735 unsigned BRGH1 : 1;
4736 unsigned SENDB1 : 1;
4737 unsigned SYNC1 : 1;
4738 unsigned TXEN1 : 1;
4739 unsigned TX91 : 1;
4740 unsigned CSRC1 : 1;
4742 } __TXSTAbits_t;
4744 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
4746 #define _TXSTA_TX9D 0x01
4747 #define _TXSTA_TX9D1 0x01
4748 #define _TXSTA_TRMT 0x02
4749 #define _TXSTA_TRMT1 0x02
4750 #define _TXSTA_BRGH 0x04
4751 #define _TXSTA_BRGH1 0x04
4752 #define _TXSTA_SENDB 0x08
4753 #define _TXSTA_SENDB1 0x08
4754 #define _TXSTA_SYNC 0x10
4755 #define _TXSTA_SYNC1 0x10
4756 #define _TXSTA_TXEN 0x20
4757 #define _TXSTA_TXEN1 0x20
4758 #define _TXSTA_TX9 0x40
4759 #define _TXSTA_TX91 0x40
4760 #define _TXSTA_CSRC 0x80
4761 #define _TXSTA_CSRC1 0x80
4763 //==============================================================================
4766 //==============================================================================
4767 // TXSTA1 Bits
4769 extern __at(0x0FAC) __sfr TXSTA1;
4771 typedef union
4773 struct
4775 unsigned TX9D : 1;
4776 unsigned TRMT : 1;
4777 unsigned BRGH : 1;
4778 unsigned SENDB : 1;
4779 unsigned SYNC : 1;
4780 unsigned TXEN : 1;
4781 unsigned TX9 : 1;
4782 unsigned CSRC : 1;
4785 struct
4787 unsigned TX9D1 : 1;
4788 unsigned TRMT1 : 1;
4789 unsigned BRGH1 : 1;
4790 unsigned SENDB1 : 1;
4791 unsigned SYNC1 : 1;
4792 unsigned TXEN1 : 1;
4793 unsigned TX91 : 1;
4794 unsigned CSRC1 : 1;
4796 } __TXSTA1bits_t;
4798 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
4800 #define _TXSTA1_TX9D 0x01
4801 #define _TXSTA1_TX9D1 0x01
4802 #define _TXSTA1_TRMT 0x02
4803 #define _TXSTA1_TRMT1 0x02
4804 #define _TXSTA1_BRGH 0x04
4805 #define _TXSTA1_BRGH1 0x04
4806 #define _TXSTA1_SENDB 0x08
4807 #define _TXSTA1_SENDB1 0x08
4808 #define _TXSTA1_SYNC 0x10
4809 #define _TXSTA1_SYNC1 0x10
4810 #define _TXSTA1_TXEN 0x20
4811 #define _TXSTA1_TXEN1 0x20
4812 #define _TXSTA1_TX9 0x40
4813 #define _TXSTA1_TX91 0x40
4814 #define _TXSTA1_CSRC 0x80
4815 #define _TXSTA1_CSRC1 0x80
4817 //==============================================================================
4819 extern __at(0x0FAD) __sfr TX1REG;
4820 extern __at(0x0FAD) __sfr TXREG;
4821 extern __at(0x0FAD) __sfr TXREG1;
4822 extern __at(0x0FAE) __sfr RC1REG;
4823 extern __at(0x0FAE) __sfr RCREG;
4824 extern __at(0x0FAE) __sfr RCREG1;
4825 extern __at(0x0FAF) __sfr SP1BRG;
4826 extern __at(0x0FAF) __sfr SPBRG;
4827 extern __at(0x0FAF) __sfr SPBRG1;
4828 extern __at(0x0FB0) __sfr SP1BRGH;
4829 extern __at(0x0FB0) __sfr SPBRGH;
4830 extern __at(0x0FB0) __sfr SPBRGH1;
4832 //==============================================================================
4833 // T3CON Bits
4835 extern __at(0x0FB1) __sfr T3CON;
4837 typedef union
4839 struct
4841 unsigned TMR3ON : 1;
4842 unsigned T3RD16 : 1;
4843 unsigned NOT_T3SYNC : 1;
4844 unsigned T3SOSCEN : 1;
4845 unsigned T3CKPS0 : 1;
4846 unsigned T3CKPS1 : 1;
4847 unsigned TMR3CS0 : 1;
4848 unsigned TMR3CS1 : 1;
4851 struct
4853 unsigned : 1;
4854 unsigned : 1;
4855 unsigned : 1;
4856 unsigned T3OSCEN : 1;
4857 unsigned : 1;
4858 unsigned : 1;
4859 unsigned : 1;
4860 unsigned : 1;
4863 struct
4865 unsigned : 4;
4866 unsigned T3CKPS : 2;
4867 unsigned : 2;
4870 struct
4872 unsigned : 6;
4873 unsigned TMR3CS : 2;
4875 } __T3CONbits_t;
4877 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
4879 #define _TMR3ON 0x01
4880 #define _T3RD16 0x02
4881 #define _NOT_T3SYNC 0x04
4882 #define _T3SOSCEN 0x08
4883 #define _T3OSCEN 0x08
4884 #define _T3CKPS0 0x10
4885 #define _T3CKPS1 0x20
4886 #define _TMR3CS0 0x40
4887 #define _TMR3CS1 0x80
4889 //==============================================================================
4891 extern __at(0x0FB2) __sfr TMR3;
4892 extern __at(0x0FB2) __sfr TMR3L;
4893 extern __at(0x0FB3) __sfr TMR3H;
4895 //==============================================================================
4896 // T3GCON Bits
4898 extern __at(0x0FB4) __sfr T3GCON;
4900 typedef union
4902 struct
4904 unsigned T3GSS0 : 1;
4905 unsigned T3GSS1 : 1;
4906 unsigned T3GVAL : 1;
4907 unsigned T3GGO_NOT_DONE : 1;
4908 unsigned T3GSPM : 1;
4909 unsigned T3GTM : 1;
4910 unsigned T3GPOL : 1;
4911 unsigned TMR3GE : 1;
4914 struct
4916 unsigned : 1;
4917 unsigned : 1;
4918 unsigned : 1;
4919 unsigned T3G_DONE : 1;
4920 unsigned : 1;
4921 unsigned : 1;
4922 unsigned : 1;
4923 unsigned : 1;
4926 struct
4928 unsigned : 1;
4929 unsigned : 1;
4930 unsigned : 1;
4931 unsigned T3GGO : 1;
4932 unsigned : 1;
4933 unsigned : 1;
4934 unsigned : 1;
4935 unsigned : 1;
4938 struct
4940 unsigned T3GSS : 2;
4941 unsigned : 6;
4943 } __T3GCONbits_t;
4945 extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits;
4947 #define _T3GSS0 0x01
4948 #define _T3GSS1 0x02
4949 #define _T3GVAL 0x04
4950 #define _T3GGO_NOT_DONE 0x08
4951 #define _T3G_DONE 0x08
4952 #define _T3GGO 0x08
4953 #define _T3GSPM 0x10
4954 #define _T3GTM 0x20
4955 #define _T3GPOL 0x40
4956 #define _TMR3GE 0x80
4958 //==============================================================================
4961 //==============================================================================
4962 // ECCP1AS Bits
4964 extern __at(0x0FB6) __sfr ECCP1AS;
4966 typedef union
4968 struct
4970 unsigned P1SSBD0 : 1;
4971 unsigned P1SSBD1 : 1;
4972 unsigned P1SSAC0 : 1;
4973 unsigned P1SSAC1 : 1;
4974 unsigned CCP1AS0 : 1;
4975 unsigned CCP1AS1 : 1;
4976 unsigned CCP1AS2 : 1;
4977 unsigned CCP1ASE : 1;
4980 struct
4982 unsigned PSS1BD0 : 1;
4983 unsigned PSS1BD1 : 1;
4984 unsigned PSS1AC0 : 1;
4985 unsigned PSS1AC1 : 1;
4986 unsigned ECCPAS0 : 1;
4987 unsigned ECCPAS1 : 1;
4988 unsigned ECCPAS2 : 1;
4989 unsigned ECCPASE : 1;
4992 struct
4994 unsigned PSSBD0 : 1;
4995 unsigned PSSBD1 : 1;
4996 unsigned PSSAC0 : 1;
4997 unsigned PSSAC1 : 1;
4998 unsigned : 1;
4999 unsigned : 1;
5000 unsigned : 1;
5001 unsigned : 1;
5004 struct
5006 unsigned PSSBD : 2;
5007 unsigned : 6;
5010 struct
5012 unsigned PSS1BD : 2;
5013 unsigned : 6;
5016 struct
5018 unsigned P1SSBD : 2;
5019 unsigned : 6;
5022 struct
5024 unsigned : 2;
5025 unsigned P1SSAC : 2;
5026 unsigned : 4;
5029 struct
5031 unsigned : 2;
5032 unsigned PSSAC : 2;
5033 unsigned : 4;
5036 struct
5038 unsigned : 2;
5039 unsigned PSS1AC : 2;
5040 unsigned : 4;
5043 struct
5045 unsigned : 4;
5046 unsigned CCP1AS : 3;
5047 unsigned : 1;
5050 struct
5052 unsigned : 4;
5053 unsigned ECCPAS : 3;
5054 unsigned : 1;
5056 } __ECCP1ASbits_t;
5058 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
5060 #define _P1SSBD0 0x01
5061 #define _PSS1BD0 0x01
5062 #define _PSSBD0 0x01
5063 #define _P1SSBD1 0x02
5064 #define _PSS1BD1 0x02
5065 #define _PSSBD1 0x02
5066 #define _P1SSAC0 0x04
5067 #define _PSS1AC0 0x04
5068 #define _PSSAC0 0x04
5069 #define _P1SSAC1 0x08
5070 #define _PSS1AC1 0x08
5071 #define _PSSAC1 0x08
5072 #define _CCP1AS0 0x10
5073 #define _ECCPAS0 0x10
5074 #define _CCP1AS1 0x20
5075 #define _ECCPAS1 0x20
5076 #define _CCP1AS2 0x40
5077 #define _ECCPAS2 0x40
5078 #define _CCP1ASE 0x80
5079 #define _ECCPASE 0x80
5081 //==============================================================================
5084 //==============================================================================
5085 // ECCPAS Bits
5087 extern __at(0x0FB6) __sfr ECCPAS;
5089 typedef union
5091 struct
5093 unsigned P1SSBD0 : 1;
5094 unsigned P1SSBD1 : 1;
5095 unsigned P1SSAC0 : 1;
5096 unsigned P1SSAC1 : 1;
5097 unsigned CCP1AS0 : 1;
5098 unsigned CCP1AS1 : 1;
5099 unsigned CCP1AS2 : 1;
5100 unsigned CCP1ASE : 1;
5103 struct
5105 unsigned PSS1BD0 : 1;
5106 unsigned PSS1BD1 : 1;
5107 unsigned PSS1AC0 : 1;
5108 unsigned PSS1AC1 : 1;
5109 unsigned ECCPAS0 : 1;
5110 unsigned ECCPAS1 : 1;
5111 unsigned ECCPAS2 : 1;
5112 unsigned ECCPASE : 1;
5115 struct
5117 unsigned PSSBD0 : 1;
5118 unsigned PSSBD1 : 1;
5119 unsigned PSSAC0 : 1;
5120 unsigned PSSAC1 : 1;
5121 unsigned : 1;
5122 unsigned : 1;
5123 unsigned : 1;
5124 unsigned : 1;
5127 struct
5129 unsigned P1SSBD : 2;
5130 unsigned : 6;
5133 struct
5135 unsigned PSS1BD : 2;
5136 unsigned : 6;
5139 struct
5141 unsigned PSSBD : 2;
5142 unsigned : 6;
5145 struct
5147 unsigned : 2;
5148 unsigned P1SSAC : 2;
5149 unsigned : 4;
5152 struct
5154 unsigned : 2;
5155 unsigned PSS1AC : 2;
5156 unsigned : 4;
5159 struct
5161 unsigned : 2;
5162 unsigned PSSAC : 2;
5163 unsigned : 4;
5166 struct
5168 unsigned : 4;
5169 unsigned CCP1AS : 3;
5170 unsigned : 1;
5173 struct
5175 unsigned : 4;
5176 unsigned ECCPAS : 3;
5177 unsigned : 1;
5179 } __ECCPASbits_t;
5181 extern __at(0x0FB6) volatile __ECCPASbits_t ECCPASbits;
5183 #define _ECCPAS_P1SSBD0 0x01
5184 #define _ECCPAS_PSS1BD0 0x01
5185 #define _ECCPAS_PSSBD0 0x01
5186 #define _ECCPAS_P1SSBD1 0x02
5187 #define _ECCPAS_PSS1BD1 0x02
5188 #define _ECCPAS_PSSBD1 0x02
5189 #define _ECCPAS_P1SSAC0 0x04
5190 #define _ECCPAS_PSS1AC0 0x04
5191 #define _ECCPAS_PSSAC0 0x04
5192 #define _ECCPAS_P1SSAC1 0x08
5193 #define _ECCPAS_PSS1AC1 0x08
5194 #define _ECCPAS_PSSAC1 0x08
5195 #define _ECCPAS_CCP1AS0 0x10
5196 #define _ECCPAS_ECCPAS0 0x10
5197 #define _ECCPAS_CCP1AS1 0x20
5198 #define _ECCPAS_ECCPAS1 0x20
5199 #define _ECCPAS_CCP1AS2 0x40
5200 #define _ECCPAS_ECCPAS2 0x40
5201 #define _ECCPAS_CCP1ASE 0x80
5202 #define _ECCPAS_ECCPASE 0x80
5204 //==============================================================================
5207 //==============================================================================
5208 // PWM1CON Bits
5210 extern __at(0x0FB7) __sfr PWM1CON;
5212 typedef union
5214 struct
5216 unsigned P1DC0 : 1;
5217 unsigned P1DC1 : 1;
5218 unsigned P1DC2 : 1;
5219 unsigned P1DC3 : 1;
5220 unsigned P1DC4 : 1;
5221 unsigned P1DC5 : 1;
5222 unsigned P1DC6 : 1;
5223 unsigned P1RSEN : 1;
5226 struct
5228 unsigned PDC0 : 1;
5229 unsigned PDC1 : 1;
5230 unsigned PDC2 : 1;
5231 unsigned PDC3 : 1;
5232 unsigned PDC4 : 1;
5233 unsigned PDC5 : 1;
5234 unsigned PDC6 : 1;
5235 unsigned PRSEN : 1;
5238 struct
5240 unsigned PDC : 7;
5241 unsigned : 1;
5244 struct
5246 unsigned P1DC : 7;
5247 unsigned : 1;
5249 } __PWM1CONbits_t;
5251 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
5253 #define _P1DC0 0x01
5254 #define _PDC0 0x01
5255 #define _P1DC1 0x02
5256 #define _PDC1 0x02
5257 #define _P1DC2 0x04
5258 #define _PDC2 0x04
5259 #define _P1DC3 0x08
5260 #define _PDC3 0x08
5261 #define _P1DC4 0x10
5262 #define _PDC4 0x10
5263 #define _P1DC5 0x20
5264 #define _PDC5 0x20
5265 #define _P1DC6 0x40
5266 #define _PDC6 0x40
5267 #define _P1RSEN 0x80
5268 #define _PRSEN 0x80
5270 //==============================================================================
5273 //==============================================================================
5274 // PWMCON Bits
5276 extern __at(0x0FB7) __sfr PWMCON;
5278 typedef union
5280 struct
5282 unsigned P1DC0 : 1;
5283 unsigned P1DC1 : 1;
5284 unsigned P1DC2 : 1;
5285 unsigned P1DC3 : 1;
5286 unsigned P1DC4 : 1;
5287 unsigned P1DC5 : 1;
5288 unsigned P1DC6 : 1;
5289 unsigned P1RSEN : 1;
5292 struct
5294 unsigned PDC0 : 1;
5295 unsigned PDC1 : 1;
5296 unsigned PDC2 : 1;
5297 unsigned PDC3 : 1;
5298 unsigned PDC4 : 1;
5299 unsigned PDC5 : 1;
5300 unsigned PDC6 : 1;
5301 unsigned PRSEN : 1;
5304 struct
5306 unsigned P1DC : 7;
5307 unsigned : 1;
5310 struct
5312 unsigned PDC : 7;
5313 unsigned : 1;
5315 } __PWMCONbits_t;
5317 extern __at(0x0FB7) volatile __PWMCONbits_t PWMCONbits;
5319 #define _PWMCON_P1DC0 0x01
5320 #define _PWMCON_PDC0 0x01
5321 #define _PWMCON_P1DC1 0x02
5322 #define _PWMCON_PDC1 0x02
5323 #define _PWMCON_P1DC2 0x04
5324 #define _PWMCON_PDC2 0x04
5325 #define _PWMCON_P1DC3 0x08
5326 #define _PWMCON_PDC3 0x08
5327 #define _PWMCON_P1DC4 0x10
5328 #define _PWMCON_PDC4 0x10
5329 #define _PWMCON_P1DC5 0x20
5330 #define _PWMCON_PDC5 0x20
5331 #define _PWMCON_P1DC6 0x40
5332 #define _PWMCON_PDC6 0x40
5333 #define _PWMCON_P1RSEN 0x80
5334 #define _PWMCON_PRSEN 0x80
5336 //==============================================================================
5339 //==============================================================================
5340 // BAUD1CON Bits
5342 extern __at(0x0FB8) __sfr BAUD1CON;
5344 typedef union
5346 struct
5348 unsigned ABDEN : 1;
5349 unsigned WUE : 1;
5350 unsigned : 1;
5351 unsigned BRG16 : 1;
5352 unsigned CKTXP : 1;
5353 unsigned DTRXP : 1;
5354 unsigned RCIDL : 1;
5355 unsigned ABDOVF : 1;
5358 struct
5360 unsigned : 1;
5361 unsigned : 1;
5362 unsigned : 1;
5363 unsigned : 1;
5364 unsigned SCKP : 1;
5365 unsigned : 1;
5366 unsigned : 1;
5367 unsigned : 1;
5369 } __BAUD1CONbits_t;
5371 extern __at(0x0FB8) volatile __BAUD1CONbits_t BAUD1CONbits;
5373 #define _ABDEN 0x01
5374 #define _WUE 0x02
5375 #define _BRG16 0x08
5376 #define _CKTXP 0x10
5377 #define _SCKP 0x10
5378 #define _DTRXP 0x20
5379 #define _RCIDL 0x40
5380 #define _ABDOVF 0x80
5382 //==============================================================================
5385 //==============================================================================
5386 // BAUDCON Bits
5388 extern __at(0x0FB8) __sfr BAUDCON;
5390 typedef union
5392 struct
5394 unsigned ABDEN : 1;
5395 unsigned WUE : 1;
5396 unsigned : 1;
5397 unsigned BRG16 : 1;
5398 unsigned CKTXP : 1;
5399 unsigned DTRXP : 1;
5400 unsigned RCIDL : 1;
5401 unsigned ABDOVF : 1;
5404 struct
5406 unsigned : 1;
5407 unsigned : 1;
5408 unsigned : 1;
5409 unsigned : 1;
5410 unsigned SCKP : 1;
5411 unsigned : 1;
5412 unsigned : 1;
5413 unsigned : 1;
5415 } __BAUDCONbits_t;
5417 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
5419 #define _BAUDCON_ABDEN 0x01
5420 #define _BAUDCON_WUE 0x02
5421 #define _BAUDCON_BRG16 0x08
5422 #define _BAUDCON_CKTXP 0x10
5423 #define _BAUDCON_SCKP 0x10
5424 #define _BAUDCON_DTRXP 0x20
5425 #define _BAUDCON_RCIDL 0x40
5426 #define _BAUDCON_ABDOVF 0x80
5428 //==============================================================================
5431 //==============================================================================
5432 // BAUDCON1 Bits
5434 extern __at(0x0FB8) __sfr BAUDCON1;
5436 typedef union
5438 struct
5440 unsigned ABDEN : 1;
5441 unsigned WUE : 1;
5442 unsigned : 1;
5443 unsigned BRG16 : 1;
5444 unsigned CKTXP : 1;
5445 unsigned DTRXP : 1;
5446 unsigned RCIDL : 1;
5447 unsigned ABDOVF : 1;
5450 struct
5452 unsigned : 1;
5453 unsigned : 1;
5454 unsigned : 1;
5455 unsigned : 1;
5456 unsigned SCKP : 1;
5457 unsigned : 1;
5458 unsigned : 1;
5459 unsigned : 1;
5461 } __BAUDCON1bits_t;
5463 extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits;
5465 #define _BAUDCON1_ABDEN 0x01
5466 #define _BAUDCON1_WUE 0x02
5467 #define _BAUDCON1_BRG16 0x08
5468 #define _BAUDCON1_CKTXP 0x10
5469 #define _BAUDCON1_SCKP 0x10
5470 #define _BAUDCON1_DTRXP 0x20
5471 #define _BAUDCON1_RCIDL 0x40
5472 #define _BAUDCON1_ABDOVF 0x80
5474 //==============================================================================
5477 //==============================================================================
5478 // BAUDCTL Bits
5480 extern __at(0x0FB8) __sfr BAUDCTL;
5482 typedef union
5484 struct
5486 unsigned ABDEN : 1;
5487 unsigned WUE : 1;
5488 unsigned : 1;
5489 unsigned BRG16 : 1;
5490 unsigned CKTXP : 1;
5491 unsigned DTRXP : 1;
5492 unsigned RCIDL : 1;
5493 unsigned ABDOVF : 1;
5496 struct
5498 unsigned : 1;
5499 unsigned : 1;
5500 unsigned : 1;
5501 unsigned : 1;
5502 unsigned SCKP : 1;
5503 unsigned : 1;
5504 unsigned : 1;
5505 unsigned : 1;
5507 } __BAUDCTLbits_t;
5509 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
5511 #define _BAUDCTL_ABDEN 0x01
5512 #define _BAUDCTL_WUE 0x02
5513 #define _BAUDCTL_BRG16 0x08
5514 #define _BAUDCTL_CKTXP 0x10
5515 #define _BAUDCTL_SCKP 0x10
5516 #define _BAUDCTL_DTRXP 0x20
5517 #define _BAUDCTL_RCIDL 0x40
5518 #define _BAUDCTL_ABDOVF 0x80
5520 //==============================================================================
5523 //==============================================================================
5524 // PSTR1CON Bits
5526 extern __at(0x0FB9) __sfr PSTR1CON;
5528 typedef struct
5530 unsigned STR1A : 1;
5531 unsigned STR1B : 1;
5532 unsigned STR1C : 1;
5533 unsigned STR1D : 1;
5534 unsigned STR1SYNC : 1;
5535 unsigned : 1;
5536 unsigned : 1;
5537 unsigned : 1;
5538 } __PSTR1CONbits_t;
5540 extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits;
5542 #define _STR1A 0x01
5543 #define _STR1B 0x02
5544 #define _STR1C 0x04
5545 #define _STR1D 0x08
5546 #define _STR1SYNC 0x10
5548 //==============================================================================
5551 //==============================================================================
5552 // PSTRCON Bits
5554 extern __at(0x0FB9) __sfr PSTRCON;
5556 typedef struct
5558 unsigned STR1A : 1;
5559 unsigned STR1B : 1;
5560 unsigned STR1C : 1;
5561 unsigned STR1D : 1;
5562 unsigned STR1SYNC : 1;
5563 unsigned : 1;
5564 unsigned : 1;
5565 unsigned : 1;
5566 } __PSTRCONbits_t;
5568 extern __at(0x0FB9) volatile __PSTRCONbits_t PSTRCONbits;
5570 #define _PSTRCON_STR1A 0x01
5571 #define _PSTRCON_STR1B 0x02
5572 #define _PSTRCON_STR1C 0x04
5573 #define _PSTRCON_STR1D 0x08
5574 #define _PSTRCON_STR1SYNC 0x10
5576 //==============================================================================
5579 //==============================================================================
5580 // T2CON Bits
5582 extern __at(0x0FBA) __sfr T2CON;
5584 typedef union
5586 struct
5588 unsigned T2CKPS0 : 1;
5589 unsigned T2CKPS1 : 1;
5590 unsigned TMR2ON : 1;
5591 unsigned T2OUTPS0 : 1;
5592 unsigned T2OUTPS1 : 1;
5593 unsigned T2OUTPS2 : 1;
5594 unsigned T2OUTPS3 : 1;
5595 unsigned : 1;
5598 struct
5600 unsigned T2CKPS : 2;
5601 unsigned : 6;
5604 struct
5606 unsigned : 3;
5607 unsigned T2OUTPS : 4;
5608 unsigned : 1;
5610 } __T2CONbits_t;
5612 extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits;
5614 #define _T2CKPS0 0x01
5615 #define _T2CKPS1 0x02
5616 #define _TMR2ON 0x04
5617 #define _T2OUTPS0 0x08
5618 #define _T2OUTPS1 0x10
5619 #define _T2OUTPS2 0x20
5620 #define _T2OUTPS3 0x40
5622 //==============================================================================
5624 extern __at(0x0FBB) __sfr PR2;
5625 extern __at(0x0FBC) __sfr TMR2;
5627 //==============================================================================
5628 // CCP1CON Bits
5630 extern __at(0x0FBD) __sfr CCP1CON;
5632 typedef union
5634 struct
5636 unsigned CCP1M0 : 1;
5637 unsigned CCP1M1 : 1;
5638 unsigned CCP1M2 : 1;
5639 unsigned CCP1M3 : 1;
5640 unsigned DC1B0 : 1;
5641 unsigned DC1B1 : 1;
5642 unsigned P1M0 : 1;
5643 unsigned P1M1 : 1;
5646 struct
5648 unsigned CCP1M : 4;
5649 unsigned : 4;
5652 struct
5654 unsigned : 4;
5655 unsigned DC1B : 2;
5656 unsigned : 2;
5659 struct
5661 unsigned : 6;
5662 unsigned P1M : 2;
5664 } __CCP1CONbits_t;
5666 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
5668 #define _CCP1M0 0x01
5669 #define _CCP1M1 0x02
5670 #define _CCP1M2 0x04
5671 #define _CCP1M3 0x08
5672 #define _DC1B0 0x10
5673 #define _DC1B1 0x20
5674 #define _P1M0 0x40
5675 #define _P1M1 0x80
5677 //==============================================================================
5679 extern __at(0x0FBE) __sfr CCPR1;
5680 extern __at(0x0FBE) __sfr CCPR1L;
5681 extern __at(0x0FBF) __sfr CCPR1H;
5683 //==============================================================================
5684 // ADCON2 Bits
5686 extern __at(0x0FC0) __sfr ADCON2;
5688 typedef union
5690 struct
5692 unsigned ADCS0 : 1;
5693 unsigned ADCS1 : 1;
5694 unsigned ADCS2 : 1;
5695 unsigned ACQT0 : 1;
5696 unsigned ACQT1 : 1;
5697 unsigned ACQT2 : 1;
5698 unsigned : 1;
5699 unsigned ADFM : 1;
5702 struct
5704 unsigned ADCS : 3;
5705 unsigned : 5;
5708 struct
5710 unsigned : 3;
5711 unsigned ACQT : 3;
5712 unsigned : 2;
5714 } __ADCON2bits_t;
5716 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
5718 #define _ADCS0 0x01
5719 #define _ADCS1 0x02
5720 #define _ADCS2 0x04
5721 #define _ACQT0 0x08
5722 #define _ACQT1 0x10
5723 #define _ACQT2 0x20
5724 #define _ADFM 0x80
5726 //==============================================================================
5729 //==============================================================================
5730 // ADCON1 Bits
5732 extern __at(0x0FC1) __sfr ADCON1;
5734 typedef union
5736 struct
5738 unsigned NVCFG0 : 1;
5739 unsigned NVCFG1 : 1;
5740 unsigned PVCFG0 : 1;
5741 unsigned PVCFG1 : 1;
5742 unsigned : 1;
5743 unsigned : 1;
5744 unsigned : 1;
5745 unsigned TRIGSEL : 1;
5748 struct
5750 unsigned NVCFG : 2;
5751 unsigned : 6;
5754 struct
5756 unsigned : 2;
5757 unsigned PVCFG : 2;
5758 unsigned : 4;
5760 } __ADCON1bits_t;
5762 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5764 #define _NVCFG0 0x01
5765 #define _NVCFG1 0x02
5766 #define _PVCFG0 0x04
5767 #define _PVCFG1 0x08
5768 #define _TRIGSEL 0x80
5770 //==============================================================================
5773 //==============================================================================
5774 // ADCON0 Bits
5776 extern __at(0x0FC2) __sfr ADCON0;
5778 typedef union
5780 struct
5782 unsigned ADON : 1;
5783 unsigned GO_NOT_DONE : 1;
5784 unsigned CHS0 : 1;
5785 unsigned CHS1 : 1;
5786 unsigned CHS2 : 1;
5787 unsigned CHS3 : 1;
5788 unsigned CHS4 : 1;
5789 unsigned : 1;
5792 struct
5794 unsigned : 1;
5795 unsigned GO : 1;
5796 unsigned : 1;
5797 unsigned : 1;
5798 unsigned : 1;
5799 unsigned : 1;
5800 unsigned : 1;
5801 unsigned : 1;
5804 struct
5806 unsigned : 1;
5807 unsigned DONE : 1;
5808 unsigned : 1;
5809 unsigned : 1;
5810 unsigned : 1;
5811 unsigned : 1;
5812 unsigned : 1;
5813 unsigned : 1;
5816 struct
5818 unsigned : 1;
5819 unsigned NOT_DONE : 1;
5820 unsigned : 1;
5821 unsigned : 1;
5822 unsigned : 1;
5823 unsigned : 1;
5824 unsigned : 1;
5825 unsigned : 1;
5828 struct
5830 unsigned : 1;
5831 unsigned GO_DONE : 1;
5832 unsigned : 1;
5833 unsigned : 1;
5834 unsigned : 1;
5835 unsigned : 1;
5836 unsigned : 1;
5837 unsigned : 1;
5840 struct
5842 unsigned : 2;
5843 unsigned CHS : 5;
5844 unsigned : 1;
5846 } __ADCON0bits_t;
5848 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5850 #define _ADON 0x01
5851 #define _GO_NOT_DONE 0x02
5852 #define _GO 0x02
5853 #define _DONE 0x02
5854 #define _NOT_DONE 0x02
5855 #define _GO_DONE 0x02
5856 #define _CHS0 0x04
5857 #define _CHS1 0x08
5858 #define _CHS2 0x10
5859 #define _CHS3 0x20
5860 #define _CHS4 0x40
5862 //==============================================================================
5864 extern __at(0x0FC3) __sfr ADRES;
5865 extern __at(0x0FC3) __sfr ADRESL;
5866 extern __at(0x0FC4) __sfr ADRESH;
5868 //==============================================================================
5869 // SSP1CON2 Bits
5871 extern __at(0x0FC5) __sfr SSP1CON2;
5873 typedef struct
5875 unsigned SEN : 1;
5876 unsigned RSEN : 1;
5877 unsigned PEN : 1;
5878 unsigned RCEN : 1;
5879 unsigned ACKEN : 1;
5880 unsigned ACKDT : 1;
5881 unsigned ACKSTAT : 1;
5882 unsigned GCEN : 1;
5883 } __SSP1CON2bits_t;
5885 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5887 #define _SEN 0x01
5888 #define _RSEN 0x02
5889 #define _PEN 0x04
5890 #define _RCEN 0x08
5891 #define _ACKEN 0x10
5892 #define _ACKDT 0x20
5893 #define _ACKSTAT 0x40
5894 #define _GCEN 0x80
5896 //==============================================================================
5899 //==============================================================================
5900 // SSPCON2 Bits
5902 extern __at(0x0FC5) __sfr SSPCON2;
5904 typedef struct
5906 unsigned SEN : 1;
5907 unsigned RSEN : 1;
5908 unsigned PEN : 1;
5909 unsigned RCEN : 1;
5910 unsigned ACKEN : 1;
5911 unsigned ACKDT : 1;
5912 unsigned ACKSTAT : 1;
5913 unsigned GCEN : 1;
5914 } __SSPCON2bits_t;
5916 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5918 #define _SSPCON2_SEN 0x01
5919 #define _SSPCON2_RSEN 0x02
5920 #define _SSPCON2_PEN 0x04
5921 #define _SSPCON2_RCEN 0x08
5922 #define _SSPCON2_ACKEN 0x10
5923 #define _SSPCON2_ACKDT 0x20
5924 #define _SSPCON2_ACKSTAT 0x40
5925 #define _SSPCON2_GCEN 0x80
5927 //==============================================================================
5930 //==============================================================================
5931 // SSP1CON1 Bits
5933 extern __at(0x0FC6) __sfr SSP1CON1;
5935 typedef union
5937 struct
5939 unsigned SSPM0 : 1;
5940 unsigned SSPM1 : 1;
5941 unsigned SSPM2 : 1;
5942 unsigned SSPM3 : 1;
5943 unsigned CKP : 1;
5944 unsigned SSPEN : 1;
5945 unsigned SSPOV : 1;
5946 unsigned WCOL : 1;
5949 struct
5951 unsigned SSPM : 4;
5952 unsigned : 4;
5954 } __SSP1CON1bits_t;
5956 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5958 #define _SSPM0 0x01
5959 #define _SSPM1 0x02
5960 #define _SSPM2 0x04
5961 #define _SSPM3 0x08
5962 #define _CKP 0x10
5963 #define _SSPEN 0x20
5964 #define _SSPOV 0x40
5965 #define _WCOL 0x80
5967 //==============================================================================
5970 //==============================================================================
5971 // SSPCON1 Bits
5973 extern __at(0x0FC6) __sfr SSPCON1;
5975 typedef union
5977 struct
5979 unsigned SSPM0 : 1;
5980 unsigned SSPM1 : 1;
5981 unsigned SSPM2 : 1;
5982 unsigned SSPM3 : 1;
5983 unsigned CKP : 1;
5984 unsigned SSPEN : 1;
5985 unsigned SSPOV : 1;
5986 unsigned WCOL : 1;
5989 struct
5991 unsigned SSPM : 4;
5992 unsigned : 4;
5994 } __SSPCON1bits_t;
5996 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5998 #define _SSPCON1_SSPM0 0x01
5999 #define _SSPCON1_SSPM1 0x02
6000 #define _SSPCON1_SSPM2 0x04
6001 #define _SSPCON1_SSPM3 0x08
6002 #define _SSPCON1_CKP 0x10
6003 #define _SSPCON1_SSPEN 0x20
6004 #define _SSPCON1_SSPOV 0x40
6005 #define _SSPCON1_WCOL 0x80
6007 //==============================================================================
6010 //==============================================================================
6011 // SSP1STAT Bits
6013 extern __at(0x0FC7) __sfr SSP1STAT;
6015 typedef union
6017 struct
6019 unsigned BF : 1;
6020 unsigned UA : 1;
6021 unsigned R_NOT_W : 1;
6022 unsigned S : 1;
6023 unsigned P : 1;
6024 unsigned D_NOT_A : 1;
6025 unsigned CKE : 1;
6026 unsigned SMP : 1;
6029 struct
6031 unsigned : 1;
6032 unsigned : 1;
6033 unsigned R : 1;
6034 unsigned : 1;
6035 unsigned : 1;
6036 unsigned D : 1;
6037 unsigned : 1;
6038 unsigned : 1;
6041 struct
6043 unsigned : 1;
6044 unsigned : 1;
6045 unsigned NOT_W : 1;
6046 unsigned : 1;
6047 unsigned : 1;
6048 unsigned NOT_A : 1;
6049 unsigned : 1;
6050 unsigned : 1;
6053 struct
6055 unsigned : 1;
6056 unsigned : 1;
6057 unsigned R_W : 1;
6058 unsigned : 1;
6059 unsigned : 1;
6060 unsigned D_A : 1;
6061 unsigned : 1;
6062 unsigned : 1;
6065 struct
6067 unsigned : 1;
6068 unsigned : 1;
6069 unsigned NOT_WRITE : 1;
6070 unsigned : 1;
6071 unsigned : 1;
6072 unsigned NOT_ADDRESS : 1;
6073 unsigned : 1;
6074 unsigned : 1;
6076 } __SSP1STATbits_t;
6078 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
6080 #define _BF 0x01
6081 #define _UA 0x02
6082 #define _R_NOT_W 0x04
6083 #define _R 0x04
6084 #define _NOT_W 0x04
6085 #define _R_W 0x04
6086 #define _NOT_WRITE 0x04
6087 #define _S 0x08
6088 #define _P 0x10
6089 #define _D_NOT_A 0x20
6090 #define _D 0x20
6091 #define _NOT_A 0x20
6092 #define _D_A 0x20
6093 #define _NOT_ADDRESS 0x20
6094 #define _CKE 0x40
6095 #define _SMP 0x80
6097 //==============================================================================
6100 //==============================================================================
6101 // SSPSTAT Bits
6103 extern __at(0x0FC7) __sfr SSPSTAT;
6105 typedef union
6107 struct
6109 unsigned BF : 1;
6110 unsigned UA : 1;
6111 unsigned R_NOT_W : 1;
6112 unsigned S : 1;
6113 unsigned P : 1;
6114 unsigned D_NOT_A : 1;
6115 unsigned CKE : 1;
6116 unsigned SMP : 1;
6119 struct
6121 unsigned : 1;
6122 unsigned : 1;
6123 unsigned R : 1;
6124 unsigned : 1;
6125 unsigned : 1;
6126 unsigned D : 1;
6127 unsigned : 1;
6128 unsigned : 1;
6131 struct
6133 unsigned : 1;
6134 unsigned : 1;
6135 unsigned NOT_W : 1;
6136 unsigned : 1;
6137 unsigned : 1;
6138 unsigned NOT_A : 1;
6139 unsigned : 1;
6140 unsigned : 1;
6143 struct
6145 unsigned : 1;
6146 unsigned : 1;
6147 unsigned R_W : 1;
6148 unsigned : 1;
6149 unsigned : 1;
6150 unsigned D_A : 1;
6151 unsigned : 1;
6152 unsigned : 1;
6155 struct
6157 unsigned : 1;
6158 unsigned : 1;
6159 unsigned NOT_WRITE : 1;
6160 unsigned : 1;
6161 unsigned : 1;
6162 unsigned NOT_ADDRESS : 1;
6163 unsigned : 1;
6164 unsigned : 1;
6166 } __SSPSTATbits_t;
6168 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
6170 #define _SSPSTAT_BF 0x01
6171 #define _SSPSTAT_UA 0x02
6172 #define _SSPSTAT_R_NOT_W 0x04
6173 #define _SSPSTAT_R 0x04
6174 #define _SSPSTAT_NOT_W 0x04
6175 #define _SSPSTAT_R_W 0x04
6176 #define _SSPSTAT_NOT_WRITE 0x04
6177 #define _SSPSTAT_S 0x08
6178 #define _SSPSTAT_P 0x10
6179 #define _SSPSTAT_D_NOT_A 0x20
6180 #define _SSPSTAT_D 0x20
6181 #define _SSPSTAT_NOT_A 0x20
6182 #define _SSPSTAT_D_A 0x20
6183 #define _SSPSTAT_NOT_ADDRESS 0x20
6184 #define _SSPSTAT_CKE 0x40
6185 #define _SSPSTAT_SMP 0x80
6187 //==============================================================================
6189 extern __at(0x0FC8) __sfr SSP1ADD;
6190 extern __at(0x0FC8) __sfr SSPADD;
6191 extern __at(0x0FC9) __sfr SSP1BUF;
6192 extern __at(0x0FC9) __sfr SSPBUF;
6194 //==============================================================================
6195 // SSP1MSK Bits
6197 extern __at(0x0FCA) __sfr SSP1MSK;
6199 typedef struct
6201 unsigned MSK0 : 1;
6202 unsigned MSK1 : 1;
6203 unsigned MSK2 : 1;
6204 unsigned MSK3 : 1;
6205 unsigned MSK4 : 1;
6206 unsigned MSK5 : 1;
6207 unsigned MSK6 : 1;
6208 unsigned MSK7 : 1;
6209 } __SSP1MSKbits_t;
6211 extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits;
6213 #define _MSK0 0x01
6214 #define _MSK1 0x02
6215 #define _MSK2 0x04
6216 #define _MSK3 0x08
6217 #define _MSK4 0x10
6218 #define _MSK5 0x20
6219 #define _MSK6 0x40
6220 #define _MSK7 0x80
6222 //==============================================================================
6225 //==============================================================================
6226 // SSPMSK Bits
6228 extern __at(0x0FCA) __sfr SSPMSK;
6230 typedef struct
6232 unsigned MSK0 : 1;
6233 unsigned MSK1 : 1;
6234 unsigned MSK2 : 1;
6235 unsigned MSK3 : 1;
6236 unsigned MSK4 : 1;
6237 unsigned MSK5 : 1;
6238 unsigned MSK6 : 1;
6239 unsigned MSK7 : 1;
6240 } __SSPMSKbits_t;
6242 extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits;
6244 #define _SSPMSK_MSK0 0x01
6245 #define _SSPMSK_MSK1 0x02
6246 #define _SSPMSK_MSK2 0x04
6247 #define _SSPMSK_MSK3 0x08
6248 #define _SSPMSK_MSK4 0x10
6249 #define _SSPMSK_MSK5 0x20
6250 #define _SSPMSK_MSK6 0x40
6251 #define _SSPMSK_MSK7 0x80
6253 //==============================================================================
6256 //==============================================================================
6257 // SSP1CON3 Bits
6259 extern __at(0x0FCB) __sfr SSP1CON3;
6261 typedef struct
6263 unsigned DHEN : 1;
6264 unsigned AHEN : 1;
6265 unsigned SBCDE : 1;
6266 unsigned SDAHT : 1;
6267 unsigned BOEN : 1;
6268 unsigned SCIE : 1;
6269 unsigned PCIE : 1;
6270 unsigned ACKTIM : 1;
6271 } __SSP1CON3bits_t;
6273 extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits;
6275 #define _DHEN 0x01
6276 #define _AHEN 0x02
6277 #define _SBCDE 0x04
6278 #define _SDAHT 0x08
6279 #define _BOEN 0x10
6280 #define _SCIE 0x20
6281 #define _PCIE 0x40
6282 #define _ACKTIM 0x80
6284 //==============================================================================
6287 //==============================================================================
6288 // SSPCON3 Bits
6290 extern __at(0x0FCB) __sfr SSPCON3;
6292 typedef struct
6294 unsigned DHEN : 1;
6295 unsigned AHEN : 1;
6296 unsigned SBCDE : 1;
6297 unsigned SDAHT : 1;
6298 unsigned BOEN : 1;
6299 unsigned SCIE : 1;
6300 unsigned PCIE : 1;
6301 unsigned ACKTIM : 1;
6302 } __SSPCON3bits_t;
6304 extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits;
6306 #define _SSPCON3_DHEN 0x01
6307 #define _SSPCON3_AHEN 0x02
6308 #define _SSPCON3_SBCDE 0x04
6309 #define _SSPCON3_SDAHT 0x08
6310 #define _SSPCON3_BOEN 0x10
6311 #define _SSPCON3_SCIE 0x20
6312 #define _SSPCON3_PCIE 0x40
6313 #define _SSPCON3_ACKTIM 0x80
6315 //==============================================================================
6318 //==============================================================================
6319 // T1GCON Bits
6321 extern __at(0x0FCC) __sfr T1GCON;
6323 typedef union
6325 struct
6327 unsigned T1GSS0 : 1;
6328 unsigned T1GSS1 : 1;
6329 unsigned T1GVAL : 1;
6330 unsigned T1GGO_NOT_DONE : 1;
6331 unsigned T1GSPM : 1;
6332 unsigned T1GTM : 1;
6333 unsigned T1GPOL : 1;
6334 unsigned TMR1GE : 1;
6337 struct
6339 unsigned : 1;
6340 unsigned : 1;
6341 unsigned : 1;
6342 unsigned T1G_DONE : 1;
6343 unsigned : 1;
6344 unsigned : 1;
6345 unsigned : 1;
6346 unsigned : 1;
6349 struct
6351 unsigned : 1;
6352 unsigned : 1;
6353 unsigned : 1;
6354 unsigned T1GGO : 1;
6355 unsigned : 1;
6356 unsigned : 1;
6357 unsigned : 1;
6358 unsigned : 1;
6361 struct
6363 unsigned T1GSS : 2;
6364 unsigned : 6;
6366 } __T1GCONbits_t;
6368 extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits;
6370 #define _T1GSS0 0x01
6371 #define _T1GSS1 0x02
6372 #define _T1GVAL 0x04
6373 #define _T1GGO_NOT_DONE 0x08
6374 #define _T1G_DONE 0x08
6375 #define _T1GGO 0x08
6376 #define _T1GSPM 0x10
6377 #define _T1GTM 0x20
6378 #define _T1GPOL 0x40
6379 #define _TMR1GE 0x80
6381 //==============================================================================
6384 //==============================================================================
6385 // T1CON Bits
6387 extern __at(0x0FCD) __sfr T1CON;
6389 typedef union
6391 struct
6393 unsigned TMR1ON : 1;
6394 unsigned T1RD16 : 1;
6395 unsigned NOT_T1SYNC : 1;
6396 unsigned T1SOSCEN : 1;
6397 unsigned T1CKPS0 : 1;
6398 unsigned T1CKPS1 : 1;
6399 unsigned TMR1CS0 : 1;
6400 unsigned TMR1CS1 : 1;
6403 struct
6405 unsigned : 1;
6406 unsigned RD16 : 1;
6407 unsigned T1SYNC : 1;
6408 unsigned T1OSCEN : 1;
6409 unsigned : 1;
6410 unsigned : 1;
6411 unsigned : 1;
6412 unsigned : 1;
6415 struct
6417 unsigned : 4;
6418 unsigned T1CKPS : 2;
6419 unsigned : 2;
6422 struct
6424 unsigned : 6;
6425 unsigned TMR1CS : 2;
6427 } __T1CONbits_t;
6429 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6431 #define _TMR1ON 0x01
6432 #define _T1RD16 0x02
6433 #define _RD16 0x02
6434 #define _NOT_T1SYNC 0x04
6435 #define _T1SYNC 0x04
6436 #define _T1SOSCEN 0x08
6437 #define _T1OSCEN 0x08
6438 #define _T1CKPS0 0x10
6439 #define _T1CKPS1 0x20
6440 #define _TMR1CS0 0x40
6441 #define _TMR1CS1 0x80
6443 //==============================================================================
6445 extern __at(0x0FCE) __sfr TMR1;
6446 extern __at(0x0FCE) __sfr TMR1L;
6447 extern __at(0x0FCF) __sfr TMR1H;
6449 //==============================================================================
6450 // RCON Bits
6452 extern __at(0x0FD0) __sfr RCON;
6454 typedef union
6456 struct
6458 unsigned NOT_BOR : 1;
6459 unsigned NOT_POR : 1;
6460 unsigned NOT_PD : 1;
6461 unsigned NOT_TO : 1;
6462 unsigned NOT_RI : 1;
6463 unsigned : 1;
6464 unsigned SBOREN : 1;
6465 unsigned IPEN : 1;
6468 struct
6470 unsigned BOR : 1;
6471 unsigned POR : 1;
6472 unsigned PD : 1;
6473 unsigned TO : 1;
6474 unsigned RI : 1;
6475 unsigned : 1;
6476 unsigned : 1;
6477 unsigned : 1;
6479 } __RCONbits_t;
6481 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6483 #define _NOT_BOR 0x01
6484 #define _BOR 0x01
6485 #define _NOT_POR 0x02
6486 #define _POR 0x02
6487 #define _NOT_PD 0x04
6488 #define _PD 0x04
6489 #define _NOT_TO 0x08
6490 #define _TO 0x08
6491 #define _NOT_RI 0x10
6492 #define _RI 0x10
6493 #define _SBOREN 0x40
6494 #define _IPEN 0x80
6496 //==============================================================================
6499 //==============================================================================
6500 // WDTCON Bits
6502 extern __at(0x0FD1) __sfr WDTCON;
6504 typedef union
6506 struct
6508 unsigned SWDTEN : 1;
6509 unsigned : 1;
6510 unsigned : 1;
6511 unsigned : 1;
6512 unsigned : 1;
6513 unsigned : 1;
6514 unsigned : 1;
6515 unsigned : 1;
6518 struct
6520 unsigned SWDTE : 1;
6521 unsigned : 1;
6522 unsigned : 1;
6523 unsigned : 1;
6524 unsigned : 1;
6525 unsigned : 1;
6526 unsigned : 1;
6527 unsigned : 1;
6529 } __WDTCONbits_t;
6531 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
6533 #define _SWDTEN 0x01
6534 #define _SWDTE 0x01
6536 //==============================================================================
6539 //==============================================================================
6540 // OSCCON2 Bits
6542 extern __at(0x0FD2) __sfr OSCCON2;
6544 typedef struct
6546 unsigned LFIOFS : 1;
6547 unsigned MFIOFS : 1;
6548 unsigned PRISD : 1;
6549 unsigned SOSCGO : 1;
6550 unsigned MFIOSEL : 1;
6551 unsigned : 1;
6552 unsigned SOSCRUN : 1;
6553 unsigned PLLRDY : 1;
6554 } __OSCCON2bits_t;
6556 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
6558 #define _LFIOFS 0x01
6559 #define _MFIOFS 0x02
6560 #define _PRISD 0x04
6561 #define _SOSCGO 0x08
6562 #define _MFIOSEL 0x10
6563 #define _SOSCRUN 0x40
6564 #define _PLLRDY 0x80
6566 //==============================================================================
6569 //==============================================================================
6570 // OSCCON Bits
6572 extern __at(0x0FD3) __sfr OSCCON;
6574 typedef union
6576 struct
6578 unsigned SCS0 : 1;
6579 unsigned SCS1 : 1;
6580 unsigned HFIOFS : 1;
6581 unsigned OSTS : 1;
6582 unsigned IRCF0 : 1;
6583 unsigned IRCF1 : 1;
6584 unsigned IRCF2 : 1;
6585 unsigned IDLEN : 1;
6588 struct
6590 unsigned : 1;
6591 unsigned : 1;
6592 unsigned IOFS : 1;
6593 unsigned : 1;
6594 unsigned : 1;
6595 unsigned : 1;
6596 unsigned : 1;
6597 unsigned : 1;
6600 struct
6602 unsigned SCS : 2;
6603 unsigned : 6;
6606 struct
6608 unsigned : 4;
6609 unsigned IRCF : 3;
6610 unsigned : 1;
6612 } __OSCCONbits_t;
6614 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6616 #define _SCS0 0x01
6617 #define _SCS1 0x02
6618 #define _HFIOFS 0x04
6619 #define _IOFS 0x04
6620 #define _OSTS 0x08
6621 #define _IRCF0 0x10
6622 #define _IRCF1 0x20
6623 #define _IRCF2 0x40
6624 #define _IDLEN 0x80
6626 //==============================================================================
6629 //==============================================================================
6630 // T0CON Bits
6632 extern __at(0x0FD5) __sfr T0CON;
6634 typedef union
6636 struct
6638 unsigned T0PS0 : 1;
6639 unsigned T0PS1 : 1;
6640 unsigned T0PS2 : 1;
6641 unsigned PSA : 1;
6642 unsigned T0SE : 1;
6643 unsigned T0CS : 1;
6644 unsigned T08BIT : 1;
6645 unsigned TMR0ON : 1;
6648 struct
6650 unsigned T0PS : 3;
6651 unsigned : 5;
6653 } __T0CONbits_t;
6655 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6657 #define _T0PS0 0x01
6658 #define _T0PS1 0x02
6659 #define _T0PS2 0x04
6660 #define _PSA 0x08
6661 #define _T0SE 0x10
6662 #define _T0CS 0x20
6663 #define _T08BIT 0x40
6664 #define _TMR0ON 0x80
6666 //==============================================================================
6668 extern __at(0x0FD6) __sfr TMR0;
6669 extern __at(0x0FD6) __sfr TMR0L;
6670 extern __at(0x0FD7) __sfr TMR0H;
6672 //==============================================================================
6673 // STATUS Bits
6675 extern __at(0x0FD8) __sfr STATUS;
6677 typedef struct
6679 unsigned C : 1;
6680 unsigned DC : 1;
6681 unsigned Z : 1;
6682 unsigned OV : 1;
6683 unsigned N : 1;
6684 unsigned : 1;
6685 unsigned : 1;
6686 unsigned : 1;
6687 } __STATUSbits_t;
6689 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6691 #define _C 0x01
6692 #define _DC 0x02
6693 #define _Z 0x04
6694 #define _OV 0x08
6695 #define _N 0x10
6697 //==============================================================================
6699 extern __at(0x0FD9) __sfr FSR2L;
6700 extern __at(0x0FDA) __sfr FSR2H;
6701 extern __at(0x0FDB) __sfr PLUSW2;
6702 extern __at(0x0FDC) __sfr PREINC2;
6703 extern __at(0x0FDD) __sfr POSTDEC2;
6704 extern __at(0x0FDE) __sfr POSTINC2;
6705 extern __at(0x0FDF) __sfr INDF2;
6706 extern __at(0x0FE0) __sfr BSR;
6707 extern __at(0x0FE1) __sfr FSR1L;
6708 extern __at(0x0FE2) __sfr FSR1H;
6709 extern __at(0x0FE3) __sfr PLUSW1;
6710 extern __at(0x0FE4) __sfr PREINC1;
6711 extern __at(0x0FE5) __sfr POSTDEC1;
6712 extern __at(0x0FE6) __sfr POSTINC1;
6713 extern __at(0x0FE7) __sfr INDF1;
6714 extern __at(0x0FE8) __sfr WREG;
6715 extern __at(0x0FE9) __sfr FSR0L;
6716 extern __at(0x0FEA) __sfr FSR0H;
6717 extern __at(0x0FEB) __sfr PLUSW0;
6718 extern __at(0x0FEC) __sfr PREINC0;
6719 extern __at(0x0FED) __sfr POSTDEC0;
6720 extern __at(0x0FEE) __sfr POSTINC0;
6721 extern __at(0x0FEF) __sfr INDF0;
6723 //==============================================================================
6724 // INTCON3 Bits
6726 extern __at(0x0FF0) __sfr INTCON3;
6728 typedef union
6730 struct
6732 unsigned INT1IF : 1;
6733 unsigned INT2IF : 1;
6734 unsigned : 1;
6735 unsigned INT1IE : 1;
6736 unsigned INT2IE : 1;
6737 unsigned : 1;
6738 unsigned INT1IP : 1;
6739 unsigned INT2IP : 1;
6742 struct
6744 unsigned INT1F : 1;
6745 unsigned INT2F : 1;
6746 unsigned : 1;
6747 unsigned INT1E : 1;
6748 unsigned INT2E : 1;
6749 unsigned : 1;
6750 unsigned INT1P : 1;
6751 unsigned INT2P : 1;
6753 } __INTCON3bits_t;
6755 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6757 #define _INT1IF 0x01
6758 #define _INT1F 0x01
6759 #define _INT2IF 0x02
6760 #define _INT2F 0x02
6761 #define _INT1IE 0x08
6762 #define _INT1E 0x08
6763 #define _INT2IE 0x10
6764 #define _INT2E 0x10
6765 #define _INT1IP 0x40
6766 #define _INT1P 0x40
6767 #define _INT2IP 0x80
6768 #define _INT2P 0x80
6770 //==============================================================================
6773 //==============================================================================
6774 // INTCON2 Bits
6776 extern __at(0x0FF1) __sfr INTCON2;
6778 typedef union
6780 struct
6782 unsigned RBIP : 1;
6783 unsigned : 1;
6784 unsigned TMR0IP : 1;
6785 unsigned : 1;
6786 unsigned INTEDG2 : 1;
6787 unsigned INTEDG1 : 1;
6788 unsigned INTEDG0 : 1;
6789 unsigned NOT_RBPU : 1;
6792 struct
6794 unsigned : 1;
6795 unsigned : 1;
6796 unsigned : 1;
6797 unsigned : 1;
6798 unsigned : 1;
6799 unsigned : 1;
6800 unsigned : 1;
6801 unsigned RBPU : 1;
6803 } __INTCON2bits_t;
6805 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6807 #define _RBIP 0x01
6808 #define _TMR0IP 0x04
6809 #define _INTEDG2 0x10
6810 #define _INTEDG1 0x20
6811 #define _INTEDG0 0x40
6812 #define _NOT_RBPU 0x80
6813 #define _RBPU 0x80
6815 //==============================================================================
6818 //==============================================================================
6819 // INTCON Bits
6821 extern __at(0x0FF2) __sfr INTCON;
6823 typedef union
6825 struct
6827 unsigned RBIF : 1;
6828 unsigned INT0IF : 1;
6829 unsigned TMR0IF : 1;
6830 unsigned RBIE : 1;
6831 unsigned INT0IE : 1;
6832 unsigned TMR0IE : 1;
6833 unsigned PEIE_GIEL : 1;
6834 unsigned GIE_GIEH : 1;
6837 struct
6839 unsigned : 1;
6840 unsigned INT0F : 1;
6841 unsigned T0IF : 1;
6842 unsigned : 1;
6843 unsigned INT0E : 1;
6844 unsigned T0IE : 1;
6845 unsigned PEIE : 1;
6846 unsigned GIE : 1;
6849 struct
6851 unsigned : 1;
6852 unsigned : 1;
6853 unsigned : 1;
6854 unsigned : 1;
6855 unsigned : 1;
6856 unsigned : 1;
6857 unsigned GIEL : 1;
6858 unsigned GIEH : 1;
6860 } __INTCONbits_t;
6862 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6864 #define _RBIF 0x01
6865 #define _INT0IF 0x02
6866 #define _INT0F 0x02
6867 #define _TMR0IF 0x04
6868 #define _T0IF 0x04
6869 #define _RBIE 0x08
6870 #define _INT0IE 0x10
6871 #define _INT0E 0x10
6872 #define _TMR0IE 0x20
6873 #define _T0IE 0x20
6874 #define _PEIE_GIEL 0x40
6875 #define _PEIE 0x40
6876 #define _GIEL 0x40
6877 #define _GIE_GIEH 0x80
6878 #define _GIE 0x80
6879 #define _GIEH 0x80
6881 //==============================================================================
6883 extern __at(0x0FF3) __sfr PROD;
6884 extern __at(0x0FF3) __sfr PRODL;
6885 extern __at(0x0FF4) __sfr PRODH;
6886 extern __at(0x0FF5) __sfr TABLAT;
6887 extern __at(0x0FF6) __sfr TBLPTR;
6888 extern __at(0x0FF6) __sfr TBLPTRL;
6889 extern __at(0x0FF7) __sfr TBLPTRH;
6890 extern __at(0x0FF8) __sfr TBLPTRU;
6891 extern __at(0x0FF9) __sfr PC;
6892 extern __at(0x0FF9) __sfr PCL;
6893 extern __at(0x0FFA) __sfr PCLATH;
6894 extern __at(0x0FFB) __sfr PCLATU;
6896 //==============================================================================
6897 // STKPTR Bits
6899 extern __at(0x0FFC) __sfr STKPTR;
6901 typedef union
6903 struct
6905 unsigned STKPTR0 : 1;
6906 unsigned STKPTR1 : 1;
6907 unsigned STKPTR2 : 1;
6908 unsigned STKPTR3 : 1;
6909 unsigned STKPTR4 : 1;
6910 unsigned : 1;
6911 unsigned STKUNF : 1;
6912 unsigned STKFUL : 1;
6915 struct
6917 unsigned SP0 : 1;
6918 unsigned SP1 : 1;
6919 unsigned SP2 : 1;
6920 unsigned SP3 : 1;
6921 unsigned SP4 : 1;
6922 unsigned : 1;
6923 unsigned : 1;
6924 unsigned STKOVF : 1;
6927 struct
6929 unsigned SP : 5;
6930 unsigned : 3;
6933 struct
6935 unsigned STKPTR : 5;
6936 unsigned : 3;
6938 } __STKPTRbits_t;
6940 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6942 #define _STKPTR0 0x01
6943 #define _SP0 0x01
6944 #define _STKPTR1 0x02
6945 #define _SP1 0x02
6946 #define _STKPTR2 0x04
6947 #define _SP2 0x04
6948 #define _STKPTR3 0x08
6949 #define _SP3 0x08
6950 #define _STKPTR4 0x10
6951 #define _SP4 0x10
6952 #define _STKUNF 0x40
6953 #define _STKFUL 0x80
6954 #define _STKOVF 0x80
6956 //==============================================================================
6958 extern __at(0x0FFD) __sfr TOS;
6959 extern __at(0x0FFD) __sfr TOSL;
6960 extern __at(0x0FFE) __sfr TOSH;
6961 extern __at(0x0FFF) __sfr TOSU;
6963 //==============================================================================
6965 // Configuration Bits
6967 //==============================================================================
6969 #define __CONFIG1H 0x300001
6970 #define __CONFIG2L 0x300002
6971 #define __CONFIG2H 0x300003
6972 #define __CONFIG3H 0x300005
6973 #define __CONFIG4L 0x300006
6974 #define __CONFIG5L 0x300008
6975 #define __CONFIG5H 0x300009
6976 #define __CONFIG6L 0x30000A
6977 #define __CONFIG6H 0x30000B
6978 #define __CONFIG7L 0x30000C
6979 #define __CONFIG7H 0x30000D
6981 //----------------------------- CONFIG1H Options -------------------------------
6983 #define _FOSC_LP_1H 0xF0 // LP oscillator.
6984 #define _FOSC_XT_1H 0xF1 // XT oscillator.
6985 #define _FOSC_HSHP_1H 0xF2 // HS oscillator (high power > 16 MHz).
6986 #define _FOSC_HSMP_1H 0xF3 // HS oscillator (medium power 4-16 MHz).
6987 #define _FOSC_ECHP_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (high power, >16 MHz).
6988 #define _FOSC_ECHPIO6_1H 0xF5 // EC oscillator (high power, >16 MHz).
6989 #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
6990 #define _FOSC_RCIO6_1H 0xF7 // External RC oscillator.
6991 #define _FOSC_INTIO67_1H 0xF8 // Internal oscillator block.
6992 #define _FOSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKOUT function on OSC2.
6993 #define _FOSC_ECMP_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (medium power, 500 kHz-16 MHz).
6994 #define _FOSC_ECMPIO6_1H 0xFB // EC oscillator (medium power, 500 kHz-16 MHz).
6995 #define _FOSC_ECLP_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (low power, <500 kHz).
6996 #define _FOSC_ECLPIO6_1H 0xFD // EC oscillator (low power, <500 kHz).
6997 #define _PLLCFG_OFF_1H 0xEF // Oscillator used directly.
6998 #define _PLLCFG_ON_1H 0xFF // Oscillator multiplied by 4.
6999 #define _PRICLKEN_OFF_1H 0xDF // Primary clock can be disabled by software.
7000 #define _PRICLKEN_ON_1H 0xFF // Primary clock enabled.
7001 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
7002 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
7003 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
7004 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
7006 //----------------------------- CONFIG2L Options -------------------------------
7008 #define _PWRTEN_ON_2L 0xFE // Power up timer enabled.
7009 #define _PWRTEN_OFF_2L 0xFF // Power up timer disabled.
7010 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
7011 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
7012 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
7013 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
7014 #define _BORV_285_2L 0xE7 // VBOR set to 2.85 V nominal.
7015 #define _BORV_250_2L 0xEF // VBOR set to 2.50 V nominal.
7016 #define _BORV_220_2L 0xF7 // VBOR set to 2.20 V nominal.
7017 #define _BORV_190_2L 0xFF // VBOR set to 1.90 V nominal.
7019 //----------------------------- CONFIG2H Options -------------------------------
7021 #define _WDTEN_OFF_2H 0xFC // Watch dog timer is always disabled. SWDTEN has no effect.
7022 #define _WDTEN_NOSLP_2H 0xFD // WDT is disabled in sleep, otherwise enabled. SWDTEN bit has no effect.
7023 #define _WDTEN_SWON_2H 0xFE // WDT is controlled by SWDTEN bit of the WDTCON register.
7024 #define _WDTEN_ON_2H 0xFF // WDT is always enabled. SWDTEN bit has no effect.
7025 #define _WDTPS_1_2H 0xC3 // 1:1.
7026 #define _WDTPS_2_2H 0xC7 // 1:2.
7027 #define _WDTPS_4_2H 0xCB // 1:4.
7028 #define _WDTPS_8_2H 0xCF // 1:8.
7029 #define _WDTPS_16_2H 0xD3 // 1:16.
7030 #define _WDTPS_32_2H 0xD7 // 1:32.
7031 #define _WDTPS_64_2H 0xDB // 1:64.
7032 #define _WDTPS_128_2H 0xDF // 1:128.
7033 #define _WDTPS_256_2H 0xE3 // 1:256.
7034 #define _WDTPS_512_2H 0xE7 // 1:512.
7035 #define _WDTPS_1024_2H 0xEB // 1:1024.
7036 #define _WDTPS_2048_2H 0xEF // 1:2048.
7037 #define _WDTPS_4096_2H 0xF3 // 1:4096.
7038 #define _WDTPS_8192_2H 0xF7 // 1:8192.
7039 #define _WDTPS_16384_2H 0xFB // 1:16384.
7040 #define _WDTPS_32768_2H 0xFF // 1:32768.
7042 //----------------------------- CONFIG3H Options -------------------------------
7044 #define _CCP2MX_PORTB3_3H 0xFE // CCP2 input/output is multiplexed with RB3.
7045 #define _CCP2MX_PORTC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
7046 #define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset.
7047 #define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset.
7048 #define _CCP3MX_PORTC6_3H 0xFB // P3A/CCP3 input/output is mulitplexed with RC6.
7049 #define _CCP3MX_PORTB5_3H 0xFF // P3A/CCP3 input/output is multiplexed with RB5.
7050 #define _HFOFST_OFF_3H 0xF7 // HFINTOSC output and ready status are delayed by the oscillator stable status.
7051 #define _HFOFST_ON_3H 0xFF // HFINTOSC output and ready status are not delayed by the oscillator stable status.
7052 #define _T3CMX_PORTB5_3H 0xEF // T3CKI is on RB5.
7053 #define _T3CMX_PORTC0_3H 0xFF // T3CKI is on RC0.
7054 #define _P2BMX_PORTC0_3H 0xDF // P2B is on RC0.
7055 #define _P2BMX_PORTB5_3H 0xFF // P2B is on RB5.
7056 #define _MCLRE_INTMCLR_3H 0x7F // RE3 input pin enabled; MCLR disabled.
7057 #define _MCLRE_EXTMCLR_3H 0xFF // MCLR pin enabled, RE3 input pin disabled.
7059 //----------------------------- CONFIG4L Options -------------------------------
7061 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
7062 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
7063 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
7064 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1.
7065 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
7066 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
7067 #define _DEBUG_ON_4L 0x7F // Enabled.
7068 #define _DEBUG_OFF_4L 0xFF // Disabled.
7070 //----------------------------- CONFIG5L Options -------------------------------
7072 #define _CP0_ON_5L 0xFE // Block 0 (000200-000FFFh) code-protected.
7073 #define _CP0_OFF_5L 0xFF // Block 0 (000200-000FFFh) not code-protected.
7074 #define _CP1_ON_5L 0xFD // Block 1 (001000-001FFFh) code-protected.
7075 #define _CP1_OFF_5L 0xFF // Block 1 (001000-001FFFh) not code-protected.
7077 //----------------------------- CONFIG5H Options -------------------------------
7079 #define _CPB_ON_5H 0xBF // Boot block (000000-0001FFh) code-protected.
7080 #define _CPB_OFF_5H 0xFF // Boot block (000000-0001FFh) not code-protected.
7081 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
7082 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
7084 //----------------------------- CONFIG6L Options -------------------------------
7086 #define _WRT0_ON_6L 0xFE // Block 0 (000200-000FFFh) write-protected.
7087 #define _WRT0_OFF_6L 0xFF // Block 0 (000200-000FFFh) not write-protected.
7088 #define _WRT1_ON_6L 0xFD // Block 1 (001000-001FFFh) write-protected.
7089 #define _WRT1_OFF_6L 0xFF // Block 1 (001000-001FFFh) not write-protected.
7091 //----------------------------- CONFIG6H Options -------------------------------
7093 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
7094 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
7095 #define _WRTB_ON_6H 0xBF // Boot Block (000000-0001FFh) write-protected.
7096 #define _WRTB_OFF_6H 0xFF // Boot Block (000000-0001FFh) not write-protected.
7097 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
7098 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
7100 //----------------------------- CONFIG7L Options -------------------------------
7102 #define _EBTR0_ON_7L 0xFE // Block 0 (000200-000FFFh) protected from table reads executed in other blocks.
7103 #define _EBTR0_OFF_7L 0xFF // Block 0 (000200-000FFFh) not protected from table reads executed in other blocks.
7104 #define _EBTR1_ON_7L 0xFD // Block 1 (001000-001FFFh) protected from table reads executed in other blocks.
7105 #define _EBTR1_OFF_7L 0xFF // Block 1 (001000-001FFFh) not protected from table reads executed in other blocks.
7107 //----------------------------- CONFIG7H Options -------------------------------
7109 #define _EBTRB_ON_7H 0xBF // Boot Block (000000-0001FFh) protected from table reads executed in other blocks.
7110 #define _EBTRB_OFF_7H 0xFF // Boot Block (000000-0001FFh) not protected from table reads executed in other blocks.
7112 //==============================================================================
7114 #define __DEVID1 0x3FFFFE
7115 #define __DEVID2 0x3FFFFF
7117 #define __IDLOC0 0x200000
7118 #define __IDLOC1 0x200001
7119 #define __IDLOC2 0x200002
7120 #define __IDLOC3 0x200003
7121 #define __IDLOC4 0x200004
7122 #define __IDLOC5 0x200005
7123 #define __IDLOC6 0x200006
7124 #define __IDLOC7 0x200007
7126 #endif // #ifndef __PIC18LF23K22_H__