Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f26k22.h
blob0165570339c729d7c92e8f8df3af3690f04cf5f7
1 /*
2 * This declarations of the PIC18F26K22 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:28 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 __PIC18F26K22_H__
26 #define __PIC18F26K22_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 PSS2BD : 2;
1617 unsigned : 6;
1620 struct
1622 unsigned P2SSBD : 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 P2SSBD : 2;
1700 unsigned : 6;
1703 struct
1705 unsigned PSS2BD : 2;
1706 unsigned : 6;
1709 struct
1711 unsigned : 2;
1712 unsigned P2SSAC : 2;
1713 unsigned : 4;
1716 struct
1718 unsigned : 2;
1719 unsigned PSS2AC : 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 HLVDL : 4;
3885 unsigned : 4;
3888 struct
3890 unsigned LVV : 4;
3891 unsigned : 4;
3894 struct
3896 unsigned LVDL : 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 HLVDL : 4;
3972 unsigned : 4;
3975 struct
3977 unsigned LVDL : 4;
3978 unsigned : 4;
3981 struct
3983 unsigned LVV : 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 // EEADRH Bits
4460 extern __at(0x0FAA) __sfr EEADRH;
4462 typedef struct
4464 unsigned EEADR8 : 1;
4465 unsigned EEADR9 : 1;
4466 unsigned : 1;
4467 unsigned : 1;
4468 unsigned : 1;
4469 unsigned : 1;
4470 unsigned : 1;
4471 unsigned : 1;
4472 } __EEADRHbits_t;
4474 extern __at(0x0FAA) volatile __EEADRHbits_t EEADRHbits;
4476 #define _EEADR8 0x01
4477 #define _EEADR9 0x02
4479 //==============================================================================
4482 //==============================================================================
4483 // RC1STA Bits
4485 extern __at(0x0FAB) __sfr RC1STA;
4487 typedef union
4489 struct
4491 unsigned RX9D : 1;
4492 unsigned OERR : 1;
4493 unsigned FERR : 1;
4494 unsigned ADDEN : 1;
4495 unsigned CREN : 1;
4496 unsigned SREN : 1;
4497 unsigned RX9 : 1;
4498 unsigned SPEN : 1;
4501 struct
4503 unsigned RX9D1 : 1;
4504 unsigned OERR1 : 1;
4505 unsigned FERR1 : 1;
4506 unsigned ADEN : 1;
4507 unsigned CREN1 : 1;
4508 unsigned SREN1 : 1;
4509 unsigned RX91 : 1;
4510 unsigned SPEN1 : 1;
4513 struct
4515 unsigned : 1;
4516 unsigned : 1;
4517 unsigned : 1;
4518 unsigned ADDEN1 : 1;
4519 unsigned : 1;
4520 unsigned : 1;
4521 unsigned : 1;
4522 unsigned : 1;
4524 } __RC1STAbits_t;
4526 extern __at(0x0FAB) volatile __RC1STAbits_t RC1STAbits;
4528 #define _RX9D 0x01
4529 #define _RX9D1 0x01
4530 #define _OERR 0x02
4531 #define _OERR1 0x02
4532 #define _FERR 0x04
4533 #define _FERR1 0x04
4534 #define _ADDEN 0x08
4535 #define _ADEN 0x08
4536 #define _ADDEN1 0x08
4537 #define _CREN 0x10
4538 #define _CREN1 0x10
4539 #define _SREN 0x20
4540 #define _SREN1 0x20
4541 #define _RX9 0x40
4542 #define _RX91 0x40
4543 #define _SPEN 0x80
4544 #define _SPEN1 0x80
4546 //==============================================================================
4549 //==============================================================================
4550 // RCSTA Bits
4552 extern __at(0x0FAB) __sfr RCSTA;
4554 typedef union
4556 struct
4558 unsigned RX9D : 1;
4559 unsigned OERR : 1;
4560 unsigned FERR : 1;
4561 unsigned ADDEN : 1;
4562 unsigned CREN : 1;
4563 unsigned SREN : 1;
4564 unsigned RX9 : 1;
4565 unsigned SPEN : 1;
4568 struct
4570 unsigned RX9D1 : 1;
4571 unsigned OERR1 : 1;
4572 unsigned FERR1 : 1;
4573 unsigned ADEN : 1;
4574 unsigned CREN1 : 1;
4575 unsigned SREN1 : 1;
4576 unsigned RX91 : 1;
4577 unsigned SPEN1 : 1;
4580 struct
4582 unsigned : 1;
4583 unsigned : 1;
4584 unsigned : 1;
4585 unsigned ADDEN1 : 1;
4586 unsigned : 1;
4587 unsigned : 1;
4588 unsigned : 1;
4589 unsigned : 1;
4591 } __RCSTAbits_t;
4593 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
4595 #define _RCSTA_RX9D 0x01
4596 #define _RCSTA_RX9D1 0x01
4597 #define _RCSTA_OERR 0x02
4598 #define _RCSTA_OERR1 0x02
4599 #define _RCSTA_FERR 0x04
4600 #define _RCSTA_FERR1 0x04
4601 #define _RCSTA_ADDEN 0x08
4602 #define _RCSTA_ADEN 0x08
4603 #define _RCSTA_ADDEN1 0x08
4604 #define _RCSTA_CREN 0x10
4605 #define _RCSTA_CREN1 0x10
4606 #define _RCSTA_SREN 0x20
4607 #define _RCSTA_SREN1 0x20
4608 #define _RCSTA_RX9 0x40
4609 #define _RCSTA_RX91 0x40
4610 #define _RCSTA_SPEN 0x80
4611 #define _RCSTA_SPEN1 0x80
4613 //==============================================================================
4616 //==============================================================================
4617 // RCSTA1 Bits
4619 extern __at(0x0FAB) __sfr RCSTA1;
4621 typedef union
4623 struct
4625 unsigned RX9D : 1;
4626 unsigned OERR : 1;
4627 unsigned FERR : 1;
4628 unsigned ADDEN : 1;
4629 unsigned CREN : 1;
4630 unsigned SREN : 1;
4631 unsigned RX9 : 1;
4632 unsigned SPEN : 1;
4635 struct
4637 unsigned RX9D1 : 1;
4638 unsigned OERR1 : 1;
4639 unsigned FERR1 : 1;
4640 unsigned ADEN : 1;
4641 unsigned CREN1 : 1;
4642 unsigned SREN1 : 1;
4643 unsigned RX91 : 1;
4644 unsigned SPEN1 : 1;
4647 struct
4649 unsigned : 1;
4650 unsigned : 1;
4651 unsigned : 1;
4652 unsigned ADDEN1 : 1;
4653 unsigned : 1;
4654 unsigned : 1;
4655 unsigned : 1;
4656 unsigned : 1;
4658 } __RCSTA1bits_t;
4660 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
4662 #define _RCSTA1_RX9D 0x01
4663 #define _RCSTA1_RX9D1 0x01
4664 #define _RCSTA1_OERR 0x02
4665 #define _RCSTA1_OERR1 0x02
4666 #define _RCSTA1_FERR 0x04
4667 #define _RCSTA1_FERR1 0x04
4668 #define _RCSTA1_ADDEN 0x08
4669 #define _RCSTA1_ADEN 0x08
4670 #define _RCSTA1_ADDEN1 0x08
4671 #define _RCSTA1_CREN 0x10
4672 #define _RCSTA1_CREN1 0x10
4673 #define _RCSTA1_SREN 0x20
4674 #define _RCSTA1_SREN1 0x20
4675 #define _RCSTA1_RX9 0x40
4676 #define _RCSTA1_RX91 0x40
4677 #define _RCSTA1_SPEN 0x80
4678 #define _RCSTA1_SPEN1 0x80
4680 //==============================================================================
4683 //==============================================================================
4684 // TX1STA Bits
4686 extern __at(0x0FAC) __sfr TX1STA;
4688 typedef union
4690 struct
4692 unsigned TX9D : 1;
4693 unsigned TRMT : 1;
4694 unsigned BRGH : 1;
4695 unsigned SENDB : 1;
4696 unsigned SYNC : 1;
4697 unsigned TXEN : 1;
4698 unsigned TX9 : 1;
4699 unsigned CSRC : 1;
4702 struct
4704 unsigned TX9D1 : 1;
4705 unsigned TRMT1 : 1;
4706 unsigned BRGH1 : 1;
4707 unsigned SENDB1 : 1;
4708 unsigned SYNC1 : 1;
4709 unsigned TXEN1 : 1;
4710 unsigned TX91 : 1;
4711 unsigned CSRC1 : 1;
4713 } __TX1STAbits_t;
4715 extern __at(0x0FAC) volatile __TX1STAbits_t TX1STAbits;
4717 #define _TX9D 0x01
4718 #define _TX9D1 0x01
4719 #define _TRMT 0x02
4720 #define _TRMT1 0x02
4721 #define _BRGH 0x04
4722 #define _BRGH1 0x04
4723 #define _SENDB 0x08
4724 #define _SENDB1 0x08
4725 #define _SYNC 0x10
4726 #define _SYNC1 0x10
4727 #define _TXEN 0x20
4728 #define _TXEN1 0x20
4729 #define _TX9 0x40
4730 #define _TX91 0x40
4731 #define _CSRC 0x80
4732 #define _CSRC1 0x80
4734 //==============================================================================
4737 //==============================================================================
4738 // TXSTA Bits
4740 extern __at(0x0FAC) __sfr TXSTA;
4742 typedef union
4744 struct
4746 unsigned TX9D : 1;
4747 unsigned TRMT : 1;
4748 unsigned BRGH : 1;
4749 unsigned SENDB : 1;
4750 unsigned SYNC : 1;
4751 unsigned TXEN : 1;
4752 unsigned TX9 : 1;
4753 unsigned CSRC : 1;
4756 struct
4758 unsigned TX9D1 : 1;
4759 unsigned TRMT1 : 1;
4760 unsigned BRGH1 : 1;
4761 unsigned SENDB1 : 1;
4762 unsigned SYNC1 : 1;
4763 unsigned TXEN1 : 1;
4764 unsigned TX91 : 1;
4765 unsigned CSRC1 : 1;
4767 } __TXSTAbits_t;
4769 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
4771 #define _TXSTA_TX9D 0x01
4772 #define _TXSTA_TX9D1 0x01
4773 #define _TXSTA_TRMT 0x02
4774 #define _TXSTA_TRMT1 0x02
4775 #define _TXSTA_BRGH 0x04
4776 #define _TXSTA_BRGH1 0x04
4777 #define _TXSTA_SENDB 0x08
4778 #define _TXSTA_SENDB1 0x08
4779 #define _TXSTA_SYNC 0x10
4780 #define _TXSTA_SYNC1 0x10
4781 #define _TXSTA_TXEN 0x20
4782 #define _TXSTA_TXEN1 0x20
4783 #define _TXSTA_TX9 0x40
4784 #define _TXSTA_TX91 0x40
4785 #define _TXSTA_CSRC 0x80
4786 #define _TXSTA_CSRC1 0x80
4788 //==============================================================================
4791 //==============================================================================
4792 // TXSTA1 Bits
4794 extern __at(0x0FAC) __sfr TXSTA1;
4796 typedef union
4798 struct
4800 unsigned TX9D : 1;
4801 unsigned TRMT : 1;
4802 unsigned BRGH : 1;
4803 unsigned SENDB : 1;
4804 unsigned SYNC : 1;
4805 unsigned TXEN : 1;
4806 unsigned TX9 : 1;
4807 unsigned CSRC : 1;
4810 struct
4812 unsigned TX9D1 : 1;
4813 unsigned TRMT1 : 1;
4814 unsigned BRGH1 : 1;
4815 unsigned SENDB1 : 1;
4816 unsigned SYNC1 : 1;
4817 unsigned TXEN1 : 1;
4818 unsigned TX91 : 1;
4819 unsigned CSRC1 : 1;
4821 } __TXSTA1bits_t;
4823 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
4825 #define _TXSTA1_TX9D 0x01
4826 #define _TXSTA1_TX9D1 0x01
4827 #define _TXSTA1_TRMT 0x02
4828 #define _TXSTA1_TRMT1 0x02
4829 #define _TXSTA1_BRGH 0x04
4830 #define _TXSTA1_BRGH1 0x04
4831 #define _TXSTA1_SENDB 0x08
4832 #define _TXSTA1_SENDB1 0x08
4833 #define _TXSTA1_SYNC 0x10
4834 #define _TXSTA1_SYNC1 0x10
4835 #define _TXSTA1_TXEN 0x20
4836 #define _TXSTA1_TXEN1 0x20
4837 #define _TXSTA1_TX9 0x40
4838 #define _TXSTA1_TX91 0x40
4839 #define _TXSTA1_CSRC 0x80
4840 #define _TXSTA1_CSRC1 0x80
4842 //==============================================================================
4844 extern __at(0x0FAD) __sfr TX1REG;
4845 extern __at(0x0FAD) __sfr TXREG;
4846 extern __at(0x0FAD) __sfr TXREG1;
4847 extern __at(0x0FAE) __sfr RC1REG;
4848 extern __at(0x0FAE) __sfr RCREG;
4849 extern __at(0x0FAE) __sfr RCREG1;
4850 extern __at(0x0FAF) __sfr SP1BRG;
4851 extern __at(0x0FAF) __sfr SPBRG;
4852 extern __at(0x0FAF) __sfr SPBRG1;
4853 extern __at(0x0FB0) __sfr SP1BRGH;
4854 extern __at(0x0FB0) __sfr SPBRGH;
4855 extern __at(0x0FB0) __sfr SPBRGH1;
4857 //==============================================================================
4858 // T3CON Bits
4860 extern __at(0x0FB1) __sfr T3CON;
4862 typedef union
4864 struct
4866 unsigned TMR3ON : 1;
4867 unsigned T3RD16 : 1;
4868 unsigned NOT_T3SYNC : 1;
4869 unsigned T3SOSCEN : 1;
4870 unsigned T3CKPS0 : 1;
4871 unsigned T3CKPS1 : 1;
4872 unsigned TMR3CS0 : 1;
4873 unsigned TMR3CS1 : 1;
4876 struct
4878 unsigned : 1;
4879 unsigned : 1;
4880 unsigned : 1;
4881 unsigned T3OSCEN : 1;
4882 unsigned : 1;
4883 unsigned : 1;
4884 unsigned : 1;
4885 unsigned : 1;
4888 struct
4890 unsigned : 4;
4891 unsigned T3CKPS : 2;
4892 unsigned : 2;
4895 struct
4897 unsigned : 6;
4898 unsigned TMR3CS : 2;
4900 } __T3CONbits_t;
4902 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
4904 #define _TMR3ON 0x01
4905 #define _T3RD16 0x02
4906 #define _NOT_T3SYNC 0x04
4907 #define _T3SOSCEN 0x08
4908 #define _T3OSCEN 0x08
4909 #define _T3CKPS0 0x10
4910 #define _T3CKPS1 0x20
4911 #define _TMR3CS0 0x40
4912 #define _TMR3CS1 0x80
4914 //==============================================================================
4916 extern __at(0x0FB2) __sfr TMR3;
4917 extern __at(0x0FB2) __sfr TMR3L;
4918 extern __at(0x0FB3) __sfr TMR3H;
4920 //==============================================================================
4921 // T3GCON Bits
4923 extern __at(0x0FB4) __sfr T3GCON;
4925 typedef union
4927 struct
4929 unsigned T3GSS0 : 1;
4930 unsigned T3GSS1 : 1;
4931 unsigned T3GVAL : 1;
4932 unsigned T3GGO_NOT_DONE : 1;
4933 unsigned T3GSPM : 1;
4934 unsigned T3GTM : 1;
4935 unsigned T3GPOL : 1;
4936 unsigned TMR3GE : 1;
4939 struct
4941 unsigned : 1;
4942 unsigned : 1;
4943 unsigned : 1;
4944 unsigned T3G_DONE : 1;
4945 unsigned : 1;
4946 unsigned : 1;
4947 unsigned : 1;
4948 unsigned : 1;
4951 struct
4953 unsigned : 1;
4954 unsigned : 1;
4955 unsigned : 1;
4956 unsigned T3GGO : 1;
4957 unsigned : 1;
4958 unsigned : 1;
4959 unsigned : 1;
4960 unsigned : 1;
4963 struct
4965 unsigned T3GSS : 2;
4966 unsigned : 6;
4968 } __T3GCONbits_t;
4970 extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits;
4972 #define _T3GSS0 0x01
4973 #define _T3GSS1 0x02
4974 #define _T3GVAL 0x04
4975 #define _T3GGO_NOT_DONE 0x08
4976 #define _T3G_DONE 0x08
4977 #define _T3GGO 0x08
4978 #define _T3GSPM 0x10
4979 #define _T3GTM 0x20
4980 #define _T3GPOL 0x40
4981 #define _TMR3GE 0x80
4983 //==============================================================================
4986 //==============================================================================
4987 // ECCP1AS Bits
4989 extern __at(0x0FB6) __sfr ECCP1AS;
4991 typedef union
4993 struct
4995 unsigned P1SSBD0 : 1;
4996 unsigned P1SSBD1 : 1;
4997 unsigned P1SSAC0 : 1;
4998 unsigned P1SSAC1 : 1;
4999 unsigned CCP1AS0 : 1;
5000 unsigned CCP1AS1 : 1;
5001 unsigned CCP1AS2 : 1;
5002 unsigned CCP1ASE : 1;
5005 struct
5007 unsigned PSS1BD0 : 1;
5008 unsigned PSS1BD1 : 1;
5009 unsigned PSS1AC0 : 1;
5010 unsigned PSS1AC1 : 1;
5011 unsigned ECCPAS0 : 1;
5012 unsigned ECCPAS1 : 1;
5013 unsigned ECCPAS2 : 1;
5014 unsigned ECCPASE : 1;
5017 struct
5019 unsigned PSSBD0 : 1;
5020 unsigned PSSBD1 : 1;
5021 unsigned PSSAC0 : 1;
5022 unsigned PSSAC1 : 1;
5023 unsigned : 1;
5024 unsigned : 1;
5025 unsigned : 1;
5026 unsigned : 1;
5029 struct
5031 unsigned PSS1BD : 2;
5032 unsigned : 6;
5035 struct
5037 unsigned PSSBD : 2;
5038 unsigned : 6;
5041 struct
5043 unsigned P1SSBD : 2;
5044 unsigned : 6;
5047 struct
5049 unsigned : 2;
5050 unsigned P1SSAC : 2;
5051 unsigned : 4;
5054 struct
5056 unsigned : 2;
5057 unsigned PSSAC : 2;
5058 unsigned : 4;
5061 struct
5063 unsigned : 2;
5064 unsigned PSS1AC : 2;
5065 unsigned : 4;
5068 struct
5070 unsigned : 4;
5071 unsigned CCP1AS : 3;
5072 unsigned : 1;
5075 struct
5077 unsigned : 4;
5078 unsigned ECCPAS : 3;
5079 unsigned : 1;
5081 } __ECCP1ASbits_t;
5083 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
5085 #define _P1SSBD0 0x01
5086 #define _PSS1BD0 0x01
5087 #define _PSSBD0 0x01
5088 #define _P1SSBD1 0x02
5089 #define _PSS1BD1 0x02
5090 #define _PSSBD1 0x02
5091 #define _P1SSAC0 0x04
5092 #define _PSS1AC0 0x04
5093 #define _PSSAC0 0x04
5094 #define _P1SSAC1 0x08
5095 #define _PSS1AC1 0x08
5096 #define _PSSAC1 0x08
5097 #define _CCP1AS0 0x10
5098 #define _ECCPAS0 0x10
5099 #define _CCP1AS1 0x20
5100 #define _ECCPAS1 0x20
5101 #define _CCP1AS2 0x40
5102 #define _ECCPAS2 0x40
5103 #define _CCP1ASE 0x80
5104 #define _ECCPASE 0x80
5106 //==============================================================================
5109 //==============================================================================
5110 // ECCPAS Bits
5112 extern __at(0x0FB6) __sfr ECCPAS;
5114 typedef union
5116 struct
5118 unsigned P1SSBD0 : 1;
5119 unsigned P1SSBD1 : 1;
5120 unsigned P1SSAC0 : 1;
5121 unsigned P1SSAC1 : 1;
5122 unsigned CCP1AS0 : 1;
5123 unsigned CCP1AS1 : 1;
5124 unsigned CCP1AS2 : 1;
5125 unsigned CCP1ASE : 1;
5128 struct
5130 unsigned PSS1BD0 : 1;
5131 unsigned PSS1BD1 : 1;
5132 unsigned PSS1AC0 : 1;
5133 unsigned PSS1AC1 : 1;
5134 unsigned ECCPAS0 : 1;
5135 unsigned ECCPAS1 : 1;
5136 unsigned ECCPAS2 : 1;
5137 unsigned ECCPASE : 1;
5140 struct
5142 unsigned PSSBD0 : 1;
5143 unsigned PSSBD1 : 1;
5144 unsigned PSSAC0 : 1;
5145 unsigned PSSAC1 : 1;
5146 unsigned : 1;
5147 unsigned : 1;
5148 unsigned : 1;
5149 unsigned : 1;
5152 struct
5154 unsigned PSS1BD : 2;
5155 unsigned : 6;
5158 struct
5160 unsigned PSSBD : 2;
5161 unsigned : 6;
5164 struct
5166 unsigned P1SSBD : 2;
5167 unsigned : 6;
5170 struct
5172 unsigned : 2;
5173 unsigned P1SSAC : 2;
5174 unsigned : 4;
5177 struct
5179 unsigned : 2;
5180 unsigned PSSAC : 2;
5181 unsigned : 4;
5184 struct
5186 unsigned : 2;
5187 unsigned PSS1AC : 2;
5188 unsigned : 4;
5191 struct
5193 unsigned : 4;
5194 unsigned CCP1AS : 3;
5195 unsigned : 1;
5198 struct
5200 unsigned : 4;
5201 unsigned ECCPAS : 3;
5202 unsigned : 1;
5204 } __ECCPASbits_t;
5206 extern __at(0x0FB6) volatile __ECCPASbits_t ECCPASbits;
5208 #define _ECCPAS_P1SSBD0 0x01
5209 #define _ECCPAS_PSS1BD0 0x01
5210 #define _ECCPAS_PSSBD0 0x01
5211 #define _ECCPAS_P1SSBD1 0x02
5212 #define _ECCPAS_PSS1BD1 0x02
5213 #define _ECCPAS_PSSBD1 0x02
5214 #define _ECCPAS_P1SSAC0 0x04
5215 #define _ECCPAS_PSS1AC0 0x04
5216 #define _ECCPAS_PSSAC0 0x04
5217 #define _ECCPAS_P1SSAC1 0x08
5218 #define _ECCPAS_PSS1AC1 0x08
5219 #define _ECCPAS_PSSAC1 0x08
5220 #define _ECCPAS_CCP1AS0 0x10
5221 #define _ECCPAS_ECCPAS0 0x10
5222 #define _ECCPAS_CCP1AS1 0x20
5223 #define _ECCPAS_ECCPAS1 0x20
5224 #define _ECCPAS_CCP1AS2 0x40
5225 #define _ECCPAS_ECCPAS2 0x40
5226 #define _ECCPAS_CCP1ASE 0x80
5227 #define _ECCPAS_ECCPASE 0x80
5229 //==============================================================================
5232 //==============================================================================
5233 // PWM1CON Bits
5235 extern __at(0x0FB7) __sfr PWM1CON;
5237 typedef union
5239 struct
5241 unsigned P1DC0 : 1;
5242 unsigned P1DC1 : 1;
5243 unsigned P1DC2 : 1;
5244 unsigned P1DC3 : 1;
5245 unsigned P1DC4 : 1;
5246 unsigned P1DC5 : 1;
5247 unsigned P1DC6 : 1;
5248 unsigned P1RSEN : 1;
5251 struct
5253 unsigned PDC0 : 1;
5254 unsigned PDC1 : 1;
5255 unsigned PDC2 : 1;
5256 unsigned PDC3 : 1;
5257 unsigned PDC4 : 1;
5258 unsigned PDC5 : 1;
5259 unsigned PDC6 : 1;
5260 unsigned PRSEN : 1;
5263 struct
5265 unsigned P1DC : 7;
5266 unsigned : 1;
5269 struct
5271 unsigned PDC : 7;
5272 unsigned : 1;
5274 } __PWM1CONbits_t;
5276 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
5278 #define _P1DC0 0x01
5279 #define _PDC0 0x01
5280 #define _P1DC1 0x02
5281 #define _PDC1 0x02
5282 #define _P1DC2 0x04
5283 #define _PDC2 0x04
5284 #define _P1DC3 0x08
5285 #define _PDC3 0x08
5286 #define _P1DC4 0x10
5287 #define _PDC4 0x10
5288 #define _P1DC5 0x20
5289 #define _PDC5 0x20
5290 #define _P1DC6 0x40
5291 #define _PDC6 0x40
5292 #define _P1RSEN 0x80
5293 #define _PRSEN 0x80
5295 //==============================================================================
5298 //==============================================================================
5299 // PWMCON Bits
5301 extern __at(0x0FB7) __sfr PWMCON;
5303 typedef union
5305 struct
5307 unsigned P1DC0 : 1;
5308 unsigned P1DC1 : 1;
5309 unsigned P1DC2 : 1;
5310 unsigned P1DC3 : 1;
5311 unsigned P1DC4 : 1;
5312 unsigned P1DC5 : 1;
5313 unsigned P1DC6 : 1;
5314 unsigned P1RSEN : 1;
5317 struct
5319 unsigned PDC0 : 1;
5320 unsigned PDC1 : 1;
5321 unsigned PDC2 : 1;
5322 unsigned PDC3 : 1;
5323 unsigned PDC4 : 1;
5324 unsigned PDC5 : 1;
5325 unsigned PDC6 : 1;
5326 unsigned PRSEN : 1;
5329 struct
5331 unsigned P1DC : 7;
5332 unsigned : 1;
5335 struct
5337 unsigned PDC : 7;
5338 unsigned : 1;
5340 } __PWMCONbits_t;
5342 extern __at(0x0FB7) volatile __PWMCONbits_t PWMCONbits;
5344 #define _PWMCON_P1DC0 0x01
5345 #define _PWMCON_PDC0 0x01
5346 #define _PWMCON_P1DC1 0x02
5347 #define _PWMCON_PDC1 0x02
5348 #define _PWMCON_P1DC2 0x04
5349 #define _PWMCON_PDC2 0x04
5350 #define _PWMCON_P1DC3 0x08
5351 #define _PWMCON_PDC3 0x08
5352 #define _PWMCON_P1DC4 0x10
5353 #define _PWMCON_PDC4 0x10
5354 #define _PWMCON_P1DC5 0x20
5355 #define _PWMCON_PDC5 0x20
5356 #define _PWMCON_P1DC6 0x40
5357 #define _PWMCON_PDC6 0x40
5358 #define _PWMCON_P1RSEN 0x80
5359 #define _PWMCON_PRSEN 0x80
5361 //==============================================================================
5364 //==============================================================================
5365 // BAUD1CON Bits
5367 extern __at(0x0FB8) __sfr BAUD1CON;
5369 typedef union
5371 struct
5373 unsigned ABDEN : 1;
5374 unsigned WUE : 1;
5375 unsigned : 1;
5376 unsigned BRG16 : 1;
5377 unsigned CKTXP : 1;
5378 unsigned DTRXP : 1;
5379 unsigned RCIDL : 1;
5380 unsigned ABDOVF : 1;
5383 struct
5385 unsigned : 1;
5386 unsigned : 1;
5387 unsigned : 1;
5388 unsigned : 1;
5389 unsigned SCKP : 1;
5390 unsigned : 1;
5391 unsigned : 1;
5392 unsigned : 1;
5394 } __BAUD1CONbits_t;
5396 extern __at(0x0FB8) volatile __BAUD1CONbits_t BAUD1CONbits;
5398 #define _ABDEN 0x01
5399 #define _WUE 0x02
5400 #define _BRG16 0x08
5401 #define _CKTXP 0x10
5402 #define _SCKP 0x10
5403 #define _DTRXP 0x20
5404 #define _RCIDL 0x40
5405 #define _ABDOVF 0x80
5407 //==============================================================================
5410 //==============================================================================
5411 // BAUDCON Bits
5413 extern __at(0x0FB8) __sfr BAUDCON;
5415 typedef union
5417 struct
5419 unsigned ABDEN : 1;
5420 unsigned WUE : 1;
5421 unsigned : 1;
5422 unsigned BRG16 : 1;
5423 unsigned CKTXP : 1;
5424 unsigned DTRXP : 1;
5425 unsigned RCIDL : 1;
5426 unsigned ABDOVF : 1;
5429 struct
5431 unsigned : 1;
5432 unsigned : 1;
5433 unsigned : 1;
5434 unsigned : 1;
5435 unsigned SCKP : 1;
5436 unsigned : 1;
5437 unsigned : 1;
5438 unsigned : 1;
5440 } __BAUDCONbits_t;
5442 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
5444 #define _BAUDCON_ABDEN 0x01
5445 #define _BAUDCON_WUE 0x02
5446 #define _BAUDCON_BRG16 0x08
5447 #define _BAUDCON_CKTXP 0x10
5448 #define _BAUDCON_SCKP 0x10
5449 #define _BAUDCON_DTRXP 0x20
5450 #define _BAUDCON_RCIDL 0x40
5451 #define _BAUDCON_ABDOVF 0x80
5453 //==============================================================================
5456 //==============================================================================
5457 // BAUDCON1 Bits
5459 extern __at(0x0FB8) __sfr BAUDCON1;
5461 typedef union
5463 struct
5465 unsigned ABDEN : 1;
5466 unsigned WUE : 1;
5467 unsigned : 1;
5468 unsigned BRG16 : 1;
5469 unsigned CKTXP : 1;
5470 unsigned DTRXP : 1;
5471 unsigned RCIDL : 1;
5472 unsigned ABDOVF : 1;
5475 struct
5477 unsigned : 1;
5478 unsigned : 1;
5479 unsigned : 1;
5480 unsigned : 1;
5481 unsigned SCKP : 1;
5482 unsigned : 1;
5483 unsigned : 1;
5484 unsigned : 1;
5486 } __BAUDCON1bits_t;
5488 extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits;
5490 #define _BAUDCON1_ABDEN 0x01
5491 #define _BAUDCON1_WUE 0x02
5492 #define _BAUDCON1_BRG16 0x08
5493 #define _BAUDCON1_CKTXP 0x10
5494 #define _BAUDCON1_SCKP 0x10
5495 #define _BAUDCON1_DTRXP 0x20
5496 #define _BAUDCON1_RCIDL 0x40
5497 #define _BAUDCON1_ABDOVF 0x80
5499 //==============================================================================
5502 //==============================================================================
5503 // BAUDCTL Bits
5505 extern __at(0x0FB8) __sfr BAUDCTL;
5507 typedef union
5509 struct
5511 unsigned ABDEN : 1;
5512 unsigned WUE : 1;
5513 unsigned : 1;
5514 unsigned BRG16 : 1;
5515 unsigned CKTXP : 1;
5516 unsigned DTRXP : 1;
5517 unsigned RCIDL : 1;
5518 unsigned ABDOVF : 1;
5521 struct
5523 unsigned : 1;
5524 unsigned : 1;
5525 unsigned : 1;
5526 unsigned : 1;
5527 unsigned SCKP : 1;
5528 unsigned : 1;
5529 unsigned : 1;
5530 unsigned : 1;
5532 } __BAUDCTLbits_t;
5534 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
5536 #define _BAUDCTL_ABDEN 0x01
5537 #define _BAUDCTL_WUE 0x02
5538 #define _BAUDCTL_BRG16 0x08
5539 #define _BAUDCTL_CKTXP 0x10
5540 #define _BAUDCTL_SCKP 0x10
5541 #define _BAUDCTL_DTRXP 0x20
5542 #define _BAUDCTL_RCIDL 0x40
5543 #define _BAUDCTL_ABDOVF 0x80
5545 //==============================================================================
5548 //==============================================================================
5549 // PSTR1CON Bits
5551 extern __at(0x0FB9) __sfr PSTR1CON;
5553 typedef struct
5555 unsigned STR1A : 1;
5556 unsigned STR1B : 1;
5557 unsigned STR1C : 1;
5558 unsigned STR1D : 1;
5559 unsigned STR1SYNC : 1;
5560 unsigned : 1;
5561 unsigned : 1;
5562 unsigned : 1;
5563 } __PSTR1CONbits_t;
5565 extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits;
5567 #define _STR1A 0x01
5568 #define _STR1B 0x02
5569 #define _STR1C 0x04
5570 #define _STR1D 0x08
5571 #define _STR1SYNC 0x10
5573 //==============================================================================
5576 //==============================================================================
5577 // PSTRCON Bits
5579 extern __at(0x0FB9) __sfr PSTRCON;
5581 typedef struct
5583 unsigned STR1A : 1;
5584 unsigned STR1B : 1;
5585 unsigned STR1C : 1;
5586 unsigned STR1D : 1;
5587 unsigned STR1SYNC : 1;
5588 unsigned : 1;
5589 unsigned : 1;
5590 unsigned : 1;
5591 } __PSTRCONbits_t;
5593 extern __at(0x0FB9) volatile __PSTRCONbits_t PSTRCONbits;
5595 #define _PSTRCON_STR1A 0x01
5596 #define _PSTRCON_STR1B 0x02
5597 #define _PSTRCON_STR1C 0x04
5598 #define _PSTRCON_STR1D 0x08
5599 #define _PSTRCON_STR1SYNC 0x10
5601 //==============================================================================
5604 //==============================================================================
5605 // T2CON Bits
5607 extern __at(0x0FBA) __sfr T2CON;
5609 typedef union
5611 struct
5613 unsigned T2CKPS0 : 1;
5614 unsigned T2CKPS1 : 1;
5615 unsigned TMR2ON : 1;
5616 unsigned T2OUTPS0 : 1;
5617 unsigned T2OUTPS1 : 1;
5618 unsigned T2OUTPS2 : 1;
5619 unsigned T2OUTPS3 : 1;
5620 unsigned : 1;
5623 struct
5625 unsigned T2CKPS : 2;
5626 unsigned : 6;
5629 struct
5631 unsigned : 3;
5632 unsigned T2OUTPS : 4;
5633 unsigned : 1;
5635 } __T2CONbits_t;
5637 extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits;
5639 #define _T2CKPS0 0x01
5640 #define _T2CKPS1 0x02
5641 #define _TMR2ON 0x04
5642 #define _T2OUTPS0 0x08
5643 #define _T2OUTPS1 0x10
5644 #define _T2OUTPS2 0x20
5645 #define _T2OUTPS3 0x40
5647 //==============================================================================
5649 extern __at(0x0FBB) __sfr PR2;
5650 extern __at(0x0FBC) __sfr TMR2;
5652 //==============================================================================
5653 // CCP1CON Bits
5655 extern __at(0x0FBD) __sfr CCP1CON;
5657 typedef union
5659 struct
5661 unsigned CCP1M0 : 1;
5662 unsigned CCP1M1 : 1;
5663 unsigned CCP1M2 : 1;
5664 unsigned CCP1M3 : 1;
5665 unsigned DC1B0 : 1;
5666 unsigned DC1B1 : 1;
5667 unsigned P1M0 : 1;
5668 unsigned P1M1 : 1;
5671 struct
5673 unsigned CCP1M : 4;
5674 unsigned : 4;
5677 struct
5679 unsigned : 4;
5680 unsigned DC1B : 2;
5681 unsigned : 2;
5684 struct
5686 unsigned : 6;
5687 unsigned P1M : 2;
5689 } __CCP1CONbits_t;
5691 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
5693 #define _CCP1M0 0x01
5694 #define _CCP1M1 0x02
5695 #define _CCP1M2 0x04
5696 #define _CCP1M3 0x08
5697 #define _DC1B0 0x10
5698 #define _DC1B1 0x20
5699 #define _P1M0 0x40
5700 #define _P1M1 0x80
5702 //==============================================================================
5704 extern __at(0x0FBE) __sfr CCPR1;
5705 extern __at(0x0FBE) __sfr CCPR1L;
5706 extern __at(0x0FBF) __sfr CCPR1H;
5708 //==============================================================================
5709 // ADCON2 Bits
5711 extern __at(0x0FC0) __sfr ADCON2;
5713 typedef union
5715 struct
5717 unsigned ADCS0 : 1;
5718 unsigned ADCS1 : 1;
5719 unsigned ADCS2 : 1;
5720 unsigned ACQT0 : 1;
5721 unsigned ACQT1 : 1;
5722 unsigned ACQT2 : 1;
5723 unsigned : 1;
5724 unsigned ADFM : 1;
5727 struct
5729 unsigned ADCS : 3;
5730 unsigned : 5;
5733 struct
5735 unsigned : 3;
5736 unsigned ACQT : 3;
5737 unsigned : 2;
5739 } __ADCON2bits_t;
5741 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
5743 #define _ADCS0 0x01
5744 #define _ADCS1 0x02
5745 #define _ADCS2 0x04
5746 #define _ACQT0 0x08
5747 #define _ACQT1 0x10
5748 #define _ACQT2 0x20
5749 #define _ADFM 0x80
5751 //==============================================================================
5754 //==============================================================================
5755 // ADCON1 Bits
5757 extern __at(0x0FC1) __sfr ADCON1;
5759 typedef union
5761 struct
5763 unsigned NVCFG0 : 1;
5764 unsigned NVCFG1 : 1;
5765 unsigned PVCFG0 : 1;
5766 unsigned PVCFG1 : 1;
5767 unsigned : 1;
5768 unsigned : 1;
5769 unsigned : 1;
5770 unsigned TRIGSEL : 1;
5773 struct
5775 unsigned NVCFG : 2;
5776 unsigned : 6;
5779 struct
5781 unsigned : 2;
5782 unsigned PVCFG : 2;
5783 unsigned : 4;
5785 } __ADCON1bits_t;
5787 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5789 #define _NVCFG0 0x01
5790 #define _NVCFG1 0x02
5791 #define _PVCFG0 0x04
5792 #define _PVCFG1 0x08
5793 #define _TRIGSEL 0x80
5795 //==============================================================================
5798 //==============================================================================
5799 // ADCON0 Bits
5801 extern __at(0x0FC2) __sfr ADCON0;
5803 typedef union
5805 struct
5807 unsigned ADON : 1;
5808 unsigned GO_NOT_DONE : 1;
5809 unsigned CHS0 : 1;
5810 unsigned CHS1 : 1;
5811 unsigned CHS2 : 1;
5812 unsigned CHS3 : 1;
5813 unsigned CHS4 : 1;
5814 unsigned : 1;
5817 struct
5819 unsigned : 1;
5820 unsigned GO : 1;
5821 unsigned : 1;
5822 unsigned : 1;
5823 unsigned : 1;
5824 unsigned : 1;
5825 unsigned : 1;
5826 unsigned : 1;
5829 struct
5831 unsigned : 1;
5832 unsigned DONE : 1;
5833 unsigned : 1;
5834 unsigned : 1;
5835 unsigned : 1;
5836 unsigned : 1;
5837 unsigned : 1;
5838 unsigned : 1;
5841 struct
5843 unsigned : 1;
5844 unsigned NOT_DONE : 1;
5845 unsigned : 1;
5846 unsigned : 1;
5847 unsigned : 1;
5848 unsigned : 1;
5849 unsigned : 1;
5850 unsigned : 1;
5853 struct
5855 unsigned : 1;
5856 unsigned GO_DONE : 1;
5857 unsigned : 1;
5858 unsigned : 1;
5859 unsigned : 1;
5860 unsigned : 1;
5861 unsigned : 1;
5862 unsigned : 1;
5865 struct
5867 unsigned : 2;
5868 unsigned CHS : 5;
5869 unsigned : 1;
5871 } __ADCON0bits_t;
5873 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5875 #define _ADON 0x01
5876 #define _GO_NOT_DONE 0x02
5877 #define _GO 0x02
5878 #define _DONE 0x02
5879 #define _NOT_DONE 0x02
5880 #define _GO_DONE 0x02
5881 #define _CHS0 0x04
5882 #define _CHS1 0x08
5883 #define _CHS2 0x10
5884 #define _CHS3 0x20
5885 #define _CHS4 0x40
5887 //==============================================================================
5889 extern __at(0x0FC3) __sfr ADRES;
5890 extern __at(0x0FC3) __sfr ADRESL;
5891 extern __at(0x0FC4) __sfr ADRESH;
5893 //==============================================================================
5894 // SSP1CON2 Bits
5896 extern __at(0x0FC5) __sfr SSP1CON2;
5898 typedef struct
5900 unsigned SEN : 1;
5901 unsigned RSEN : 1;
5902 unsigned PEN : 1;
5903 unsigned RCEN : 1;
5904 unsigned ACKEN : 1;
5905 unsigned ACKDT : 1;
5906 unsigned ACKSTAT : 1;
5907 unsigned GCEN : 1;
5908 } __SSP1CON2bits_t;
5910 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5912 #define _SEN 0x01
5913 #define _RSEN 0x02
5914 #define _PEN 0x04
5915 #define _RCEN 0x08
5916 #define _ACKEN 0x10
5917 #define _ACKDT 0x20
5918 #define _ACKSTAT 0x40
5919 #define _GCEN 0x80
5921 //==============================================================================
5924 //==============================================================================
5925 // SSPCON2 Bits
5927 extern __at(0x0FC5) __sfr SSPCON2;
5929 typedef struct
5931 unsigned SEN : 1;
5932 unsigned RSEN : 1;
5933 unsigned PEN : 1;
5934 unsigned RCEN : 1;
5935 unsigned ACKEN : 1;
5936 unsigned ACKDT : 1;
5937 unsigned ACKSTAT : 1;
5938 unsigned GCEN : 1;
5939 } __SSPCON2bits_t;
5941 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5943 #define _SSPCON2_SEN 0x01
5944 #define _SSPCON2_RSEN 0x02
5945 #define _SSPCON2_PEN 0x04
5946 #define _SSPCON2_RCEN 0x08
5947 #define _SSPCON2_ACKEN 0x10
5948 #define _SSPCON2_ACKDT 0x20
5949 #define _SSPCON2_ACKSTAT 0x40
5950 #define _SSPCON2_GCEN 0x80
5952 //==============================================================================
5955 //==============================================================================
5956 // SSP1CON1 Bits
5958 extern __at(0x0FC6) __sfr SSP1CON1;
5960 typedef union
5962 struct
5964 unsigned SSPM0 : 1;
5965 unsigned SSPM1 : 1;
5966 unsigned SSPM2 : 1;
5967 unsigned SSPM3 : 1;
5968 unsigned CKP : 1;
5969 unsigned SSPEN : 1;
5970 unsigned SSPOV : 1;
5971 unsigned WCOL : 1;
5974 struct
5976 unsigned SSPM : 4;
5977 unsigned : 4;
5979 } __SSP1CON1bits_t;
5981 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5983 #define _SSPM0 0x01
5984 #define _SSPM1 0x02
5985 #define _SSPM2 0x04
5986 #define _SSPM3 0x08
5987 #define _CKP 0x10
5988 #define _SSPEN 0x20
5989 #define _SSPOV 0x40
5990 #define _WCOL 0x80
5992 //==============================================================================
5995 //==============================================================================
5996 // SSPCON1 Bits
5998 extern __at(0x0FC6) __sfr SSPCON1;
6000 typedef union
6002 struct
6004 unsigned SSPM0 : 1;
6005 unsigned SSPM1 : 1;
6006 unsigned SSPM2 : 1;
6007 unsigned SSPM3 : 1;
6008 unsigned CKP : 1;
6009 unsigned SSPEN : 1;
6010 unsigned SSPOV : 1;
6011 unsigned WCOL : 1;
6014 struct
6016 unsigned SSPM : 4;
6017 unsigned : 4;
6019 } __SSPCON1bits_t;
6021 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
6023 #define _SSPCON1_SSPM0 0x01
6024 #define _SSPCON1_SSPM1 0x02
6025 #define _SSPCON1_SSPM2 0x04
6026 #define _SSPCON1_SSPM3 0x08
6027 #define _SSPCON1_CKP 0x10
6028 #define _SSPCON1_SSPEN 0x20
6029 #define _SSPCON1_SSPOV 0x40
6030 #define _SSPCON1_WCOL 0x80
6032 //==============================================================================
6035 //==============================================================================
6036 // SSP1STAT Bits
6038 extern __at(0x0FC7) __sfr SSP1STAT;
6040 typedef union
6042 struct
6044 unsigned BF : 1;
6045 unsigned UA : 1;
6046 unsigned R_NOT_W : 1;
6047 unsigned S : 1;
6048 unsigned P : 1;
6049 unsigned D_NOT_A : 1;
6050 unsigned CKE : 1;
6051 unsigned SMP : 1;
6054 struct
6056 unsigned : 1;
6057 unsigned : 1;
6058 unsigned R : 1;
6059 unsigned : 1;
6060 unsigned : 1;
6061 unsigned D : 1;
6062 unsigned : 1;
6063 unsigned : 1;
6066 struct
6068 unsigned : 1;
6069 unsigned : 1;
6070 unsigned NOT_W : 1;
6071 unsigned : 1;
6072 unsigned : 1;
6073 unsigned NOT_A : 1;
6074 unsigned : 1;
6075 unsigned : 1;
6078 struct
6080 unsigned : 1;
6081 unsigned : 1;
6082 unsigned R_W : 1;
6083 unsigned : 1;
6084 unsigned : 1;
6085 unsigned D_A : 1;
6086 unsigned : 1;
6087 unsigned : 1;
6090 struct
6092 unsigned : 1;
6093 unsigned : 1;
6094 unsigned NOT_WRITE : 1;
6095 unsigned : 1;
6096 unsigned : 1;
6097 unsigned NOT_ADDRESS : 1;
6098 unsigned : 1;
6099 unsigned : 1;
6101 } __SSP1STATbits_t;
6103 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
6105 #define _BF 0x01
6106 #define _UA 0x02
6107 #define _R_NOT_W 0x04
6108 #define _R 0x04
6109 #define _NOT_W 0x04
6110 #define _R_W 0x04
6111 #define _NOT_WRITE 0x04
6112 #define _S 0x08
6113 #define _P 0x10
6114 #define _D_NOT_A 0x20
6115 #define _D 0x20
6116 #define _NOT_A 0x20
6117 #define _D_A 0x20
6118 #define _NOT_ADDRESS 0x20
6119 #define _CKE 0x40
6120 #define _SMP 0x80
6122 //==============================================================================
6125 //==============================================================================
6126 // SSPSTAT Bits
6128 extern __at(0x0FC7) __sfr SSPSTAT;
6130 typedef union
6132 struct
6134 unsigned BF : 1;
6135 unsigned UA : 1;
6136 unsigned R_NOT_W : 1;
6137 unsigned S : 1;
6138 unsigned P : 1;
6139 unsigned D_NOT_A : 1;
6140 unsigned CKE : 1;
6141 unsigned SMP : 1;
6144 struct
6146 unsigned : 1;
6147 unsigned : 1;
6148 unsigned R : 1;
6149 unsigned : 1;
6150 unsigned : 1;
6151 unsigned D : 1;
6152 unsigned : 1;
6153 unsigned : 1;
6156 struct
6158 unsigned : 1;
6159 unsigned : 1;
6160 unsigned NOT_W : 1;
6161 unsigned : 1;
6162 unsigned : 1;
6163 unsigned NOT_A : 1;
6164 unsigned : 1;
6165 unsigned : 1;
6168 struct
6170 unsigned : 1;
6171 unsigned : 1;
6172 unsigned R_W : 1;
6173 unsigned : 1;
6174 unsigned : 1;
6175 unsigned D_A : 1;
6176 unsigned : 1;
6177 unsigned : 1;
6180 struct
6182 unsigned : 1;
6183 unsigned : 1;
6184 unsigned NOT_WRITE : 1;
6185 unsigned : 1;
6186 unsigned : 1;
6187 unsigned NOT_ADDRESS : 1;
6188 unsigned : 1;
6189 unsigned : 1;
6191 } __SSPSTATbits_t;
6193 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
6195 #define _SSPSTAT_BF 0x01
6196 #define _SSPSTAT_UA 0x02
6197 #define _SSPSTAT_R_NOT_W 0x04
6198 #define _SSPSTAT_R 0x04
6199 #define _SSPSTAT_NOT_W 0x04
6200 #define _SSPSTAT_R_W 0x04
6201 #define _SSPSTAT_NOT_WRITE 0x04
6202 #define _SSPSTAT_S 0x08
6203 #define _SSPSTAT_P 0x10
6204 #define _SSPSTAT_D_NOT_A 0x20
6205 #define _SSPSTAT_D 0x20
6206 #define _SSPSTAT_NOT_A 0x20
6207 #define _SSPSTAT_D_A 0x20
6208 #define _SSPSTAT_NOT_ADDRESS 0x20
6209 #define _SSPSTAT_CKE 0x40
6210 #define _SSPSTAT_SMP 0x80
6212 //==============================================================================
6214 extern __at(0x0FC8) __sfr SSP1ADD;
6215 extern __at(0x0FC8) __sfr SSPADD;
6216 extern __at(0x0FC9) __sfr SSP1BUF;
6217 extern __at(0x0FC9) __sfr SSPBUF;
6219 //==============================================================================
6220 // SSP1MSK Bits
6222 extern __at(0x0FCA) __sfr SSP1MSK;
6224 typedef struct
6226 unsigned MSK0 : 1;
6227 unsigned MSK1 : 1;
6228 unsigned MSK2 : 1;
6229 unsigned MSK3 : 1;
6230 unsigned MSK4 : 1;
6231 unsigned MSK5 : 1;
6232 unsigned MSK6 : 1;
6233 unsigned MSK7 : 1;
6234 } __SSP1MSKbits_t;
6236 extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits;
6238 #define _MSK0 0x01
6239 #define _MSK1 0x02
6240 #define _MSK2 0x04
6241 #define _MSK3 0x08
6242 #define _MSK4 0x10
6243 #define _MSK5 0x20
6244 #define _MSK6 0x40
6245 #define _MSK7 0x80
6247 //==============================================================================
6250 //==============================================================================
6251 // SSPMSK Bits
6253 extern __at(0x0FCA) __sfr SSPMSK;
6255 typedef struct
6257 unsigned MSK0 : 1;
6258 unsigned MSK1 : 1;
6259 unsigned MSK2 : 1;
6260 unsigned MSK3 : 1;
6261 unsigned MSK4 : 1;
6262 unsigned MSK5 : 1;
6263 unsigned MSK6 : 1;
6264 unsigned MSK7 : 1;
6265 } __SSPMSKbits_t;
6267 extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits;
6269 #define _SSPMSK_MSK0 0x01
6270 #define _SSPMSK_MSK1 0x02
6271 #define _SSPMSK_MSK2 0x04
6272 #define _SSPMSK_MSK3 0x08
6273 #define _SSPMSK_MSK4 0x10
6274 #define _SSPMSK_MSK5 0x20
6275 #define _SSPMSK_MSK6 0x40
6276 #define _SSPMSK_MSK7 0x80
6278 //==============================================================================
6281 //==============================================================================
6282 // SSP1CON3 Bits
6284 extern __at(0x0FCB) __sfr SSP1CON3;
6286 typedef struct
6288 unsigned DHEN : 1;
6289 unsigned AHEN : 1;
6290 unsigned SBCDE : 1;
6291 unsigned SDAHT : 1;
6292 unsigned BOEN : 1;
6293 unsigned SCIE : 1;
6294 unsigned PCIE : 1;
6295 unsigned ACKTIM : 1;
6296 } __SSP1CON3bits_t;
6298 extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits;
6300 #define _DHEN 0x01
6301 #define _AHEN 0x02
6302 #define _SBCDE 0x04
6303 #define _SDAHT 0x08
6304 #define _BOEN 0x10
6305 #define _SCIE 0x20
6306 #define _PCIE 0x40
6307 #define _ACKTIM 0x80
6309 //==============================================================================
6312 //==============================================================================
6313 // SSPCON3 Bits
6315 extern __at(0x0FCB) __sfr SSPCON3;
6317 typedef struct
6319 unsigned DHEN : 1;
6320 unsigned AHEN : 1;
6321 unsigned SBCDE : 1;
6322 unsigned SDAHT : 1;
6323 unsigned BOEN : 1;
6324 unsigned SCIE : 1;
6325 unsigned PCIE : 1;
6326 unsigned ACKTIM : 1;
6327 } __SSPCON3bits_t;
6329 extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits;
6331 #define _SSPCON3_DHEN 0x01
6332 #define _SSPCON3_AHEN 0x02
6333 #define _SSPCON3_SBCDE 0x04
6334 #define _SSPCON3_SDAHT 0x08
6335 #define _SSPCON3_BOEN 0x10
6336 #define _SSPCON3_SCIE 0x20
6337 #define _SSPCON3_PCIE 0x40
6338 #define _SSPCON3_ACKTIM 0x80
6340 //==============================================================================
6343 //==============================================================================
6344 // T1GCON Bits
6346 extern __at(0x0FCC) __sfr T1GCON;
6348 typedef union
6350 struct
6352 unsigned T1GSS0 : 1;
6353 unsigned T1GSS1 : 1;
6354 unsigned T1GVAL : 1;
6355 unsigned T1GGO_NOT_DONE : 1;
6356 unsigned T1GSPM : 1;
6357 unsigned T1GTM : 1;
6358 unsigned T1GPOL : 1;
6359 unsigned TMR1GE : 1;
6362 struct
6364 unsigned : 1;
6365 unsigned : 1;
6366 unsigned : 1;
6367 unsigned T1G_DONE : 1;
6368 unsigned : 1;
6369 unsigned : 1;
6370 unsigned : 1;
6371 unsigned : 1;
6374 struct
6376 unsigned : 1;
6377 unsigned : 1;
6378 unsigned : 1;
6379 unsigned T1GGO : 1;
6380 unsigned : 1;
6381 unsigned : 1;
6382 unsigned : 1;
6383 unsigned : 1;
6386 struct
6388 unsigned T1GSS : 2;
6389 unsigned : 6;
6391 } __T1GCONbits_t;
6393 extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits;
6395 #define _T1GSS0 0x01
6396 #define _T1GSS1 0x02
6397 #define _T1GVAL 0x04
6398 #define _T1GGO_NOT_DONE 0x08
6399 #define _T1G_DONE 0x08
6400 #define _T1GGO 0x08
6401 #define _T1GSPM 0x10
6402 #define _T1GTM 0x20
6403 #define _T1GPOL 0x40
6404 #define _TMR1GE 0x80
6406 //==============================================================================
6409 //==============================================================================
6410 // T1CON Bits
6412 extern __at(0x0FCD) __sfr T1CON;
6414 typedef union
6416 struct
6418 unsigned TMR1ON : 1;
6419 unsigned T1RD16 : 1;
6420 unsigned NOT_T1SYNC : 1;
6421 unsigned T1SOSCEN : 1;
6422 unsigned T1CKPS0 : 1;
6423 unsigned T1CKPS1 : 1;
6424 unsigned TMR1CS0 : 1;
6425 unsigned TMR1CS1 : 1;
6428 struct
6430 unsigned : 1;
6431 unsigned RD16 : 1;
6432 unsigned T1SYNC : 1;
6433 unsigned T1OSCEN : 1;
6434 unsigned : 1;
6435 unsigned : 1;
6436 unsigned : 1;
6437 unsigned : 1;
6440 struct
6442 unsigned : 4;
6443 unsigned T1CKPS : 2;
6444 unsigned : 2;
6447 struct
6449 unsigned : 6;
6450 unsigned TMR1CS : 2;
6452 } __T1CONbits_t;
6454 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6456 #define _TMR1ON 0x01
6457 #define _T1RD16 0x02
6458 #define _RD16 0x02
6459 #define _NOT_T1SYNC 0x04
6460 #define _T1SYNC 0x04
6461 #define _T1SOSCEN 0x08
6462 #define _T1OSCEN 0x08
6463 #define _T1CKPS0 0x10
6464 #define _T1CKPS1 0x20
6465 #define _TMR1CS0 0x40
6466 #define _TMR1CS1 0x80
6468 //==============================================================================
6470 extern __at(0x0FCE) __sfr TMR1;
6471 extern __at(0x0FCE) __sfr TMR1L;
6472 extern __at(0x0FCF) __sfr TMR1H;
6474 //==============================================================================
6475 // RCON Bits
6477 extern __at(0x0FD0) __sfr RCON;
6479 typedef union
6481 struct
6483 unsigned NOT_BOR : 1;
6484 unsigned NOT_POR : 1;
6485 unsigned NOT_PD : 1;
6486 unsigned NOT_TO : 1;
6487 unsigned NOT_RI : 1;
6488 unsigned : 1;
6489 unsigned SBOREN : 1;
6490 unsigned IPEN : 1;
6493 struct
6495 unsigned BOR : 1;
6496 unsigned POR : 1;
6497 unsigned PD : 1;
6498 unsigned TO : 1;
6499 unsigned RI : 1;
6500 unsigned : 1;
6501 unsigned : 1;
6502 unsigned : 1;
6504 } __RCONbits_t;
6506 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6508 #define _NOT_BOR 0x01
6509 #define _BOR 0x01
6510 #define _NOT_POR 0x02
6511 #define _POR 0x02
6512 #define _NOT_PD 0x04
6513 #define _PD 0x04
6514 #define _NOT_TO 0x08
6515 #define _TO 0x08
6516 #define _NOT_RI 0x10
6517 #define _RI 0x10
6518 #define _SBOREN 0x40
6519 #define _IPEN 0x80
6521 //==============================================================================
6524 //==============================================================================
6525 // WDTCON Bits
6527 extern __at(0x0FD1) __sfr WDTCON;
6529 typedef union
6531 struct
6533 unsigned SWDTEN : 1;
6534 unsigned : 1;
6535 unsigned : 1;
6536 unsigned : 1;
6537 unsigned : 1;
6538 unsigned : 1;
6539 unsigned : 1;
6540 unsigned : 1;
6543 struct
6545 unsigned SWDTE : 1;
6546 unsigned : 1;
6547 unsigned : 1;
6548 unsigned : 1;
6549 unsigned : 1;
6550 unsigned : 1;
6551 unsigned : 1;
6552 unsigned : 1;
6554 } __WDTCONbits_t;
6556 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
6558 #define _SWDTEN 0x01
6559 #define _SWDTE 0x01
6561 //==============================================================================
6564 //==============================================================================
6565 // OSCCON2 Bits
6567 extern __at(0x0FD2) __sfr OSCCON2;
6569 typedef struct
6571 unsigned LFIOFS : 1;
6572 unsigned MFIOFS : 1;
6573 unsigned PRISD : 1;
6574 unsigned SOSCGO : 1;
6575 unsigned MFIOSEL : 1;
6576 unsigned : 1;
6577 unsigned SOSCRUN : 1;
6578 unsigned PLLRDY : 1;
6579 } __OSCCON2bits_t;
6581 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
6583 #define _LFIOFS 0x01
6584 #define _MFIOFS 0x02
6585 #define _PRISD 0x04
6586 #define _SOSCGO 0x08
6587 #define _MFIOSEL 0x10
6588 #define _SOSCRUN 0x40
6589 #define _PLLRDY 0x80
6591 //==============================================================================
6594 //==============================================================================
6595 // OSCCON Bits
6597 extern __at(0x0FD3) __sfr OSCCON;
6599 typedef union
6601 struct
6603 unsigned SCS0 : 1;
6604 unsigned SCS1 : 1;
6605 unsigned HFIOFS : 1;
6606 unsigned OSTS : 1;
6607 unsigned IRCF0 : 1;
6608 unsigned IRCF1 : 1;
6609 unsigned IRCF2 : 1;
6610 unsigned IDLEN : 1;
6613 struct
6615 unsigned : 1;
6616 unsigned : 1;
6617 unsigned IOFS : 1;
6618 unsigned : 1;
6619 unsigned : 1;
6620 unsigned : 1;
6621 unsigned : 1;
6622 unsigned : 1;
6625 struct
6627 unsigned SCS : 2;
6628 unsigned : 6;
6631 struct
6633 unsigned : 4;
6634 unsigned IRCF : 3;
6635 unsigned : 1;
6637 } __OSCCONbits_t;
6639 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6641 #define _SCS0 0x01
6642 #define _SCS1 0x02
6643 #define _HFIOFS 0x04
6644 #define _IOFS 0x04
6645 #define _OSTS 0x08
6646 #define _IRCF0 0x10
6647 #define _IRCF1 0x20
6648 #define _IRCF2 0x40
6649 #define _IDLEN 0x80
6651 //==============================================================================
6654 //==============================================================================
6655 // T0CON Bits
6657 extern __at(0x0FD5) __sfr T0CON;
6659 typedef union
6661 struct
6663 unsigned T0PS0 : 1;
6664 unsigned T0PS1 : 1;
6665 unsigned T0PS2 : 1;
6666 unsigned PSA : 1;
6667 unsigned T0SE : 1;
6668 unsigned T0CS : 1;
6669 unsigned T08BIT : 1;
6670 unsigned TMR0ON : 1;
6673 struct
6675 unsigned T0PS : 3;
6676 unsigned : 5;
6678 } __T0CONbits_t;
6680 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6682 #define _T0PS0 0x01
6683 #define _T0PS1 0x02
6684 #define _T0PS2 0x04
6685 #define _PSA 0x08
6686 #define _T0SE 0x10
6687 #define _T0CS 0x20
6688 #define _T08BIT 0x40
6689 #define _TMR0ON 0x80
6691 //==============================================================================
6693 extern __at(0x0FD6) __sfr TMR0;
6694 extern __at(0x0FD6) __sfr TMR0L;
6695 extern __at(0x0FD7) __sfr TMR0H;
6697 //==============================================================================
6698 // STATUS Bits
6700 extern __at(0x0FD8) __sfr STATUS;
6702 typedef struct
6704 unsigned C : 1;
6705 unsigned DC : 1;
6706 unsigned Z : 1;
6707 unsigned OV : 1;
6708 unsigned N : 1;
6709 unsigned : 1;
6710 unsigned : 1;
6711 unsigned : 1;
6712 } __STATUSbits_t;
6714 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6716 #define _C 0x01
6717 #define _DC 0x02
6718 #define _Z 0x04
6719 #define _OV 0x08
6720 #define _N 0x10
6722 //==============================================================================
6724 extern __at(0x0FD9) __sfr FSR2L;
6725 extern __at(0x0FDA) __sfr FSR2H;
6726 extern __at(0x0FDB) __sfr PLUSW2;
6727 extern __at(0x0FDC) __sfr PREINC2;
6728 extern __at(0x0FDD) __sfr POSTDEC2;
6729 extern __at(0x0FDE) __sfr POSTINC2;
6730 extern __at(0x0FDF) __sfr INDF2;
6731 extern __at(0x0FE0) __sfr BSR;
6732 extern __at(0x0FE1) __sfr FSR1L;
6733 extern __at(0x0FE2) __sfr FSR1H;
6734 extern __at(0x0FE3) __sfr PLUSW1;
6735 extern __at(0x0FE4) __sfr PREINC1;
6736 extern __at(0x0FE5) __sfr POSTDEC1;
6737 extern __at(0x0FE6) __sfr POSTINC1;
6738 extern __at(0x0FE7) __sfr INDF1;
6739 extern __at(0x0FE8) __sfr WREG;
6740 extern __at(0x0FE9) __sfr FSR0L;
6741 extern __at(0x0FEA) __sfr FSR0H;
6742 extern __at(0x0FEB) __sfr PLUSW0;
6743 extern __at(0x0FEC) __sfr PREINC0;
6744 extern __at(0x0FED) __sfr POSTDEC0;
6745 extern __at(0x0FEE) __sfr POSTINC0;
6746 extern __at(0x0FEF) __sfr INDF0;
6748 //==============================================================================
6749 // INTCON3 Bits
6751 extern __at(0x0FF0) __sfr INTCON3;
6753 typedef union
6755 struct
6757 unsigned INT1IF : 1;
6758 unsigned INT2IF : 1;
6759 unsigned : 1;
6760 unsigned INT1IE : 1;
6761 unsigned INT2IE : 1;
6762 unsigned : 1;
6763 unsigned INT1IP : 1;
6764 unsigned INT2IP : 1;
6767 struct
6769 unsigned INT1F : 1;
6770 unsigned INT2F : 1;
6771 unsigned : 1;
6772 unsigned INT1E : 1;
6773 unsigned INT2E : 1;
6774 unsigned : 1;
6775 unsigned INT1P : 1;
6776 unsigned INT2P : 1;
6778 } __INTCON3bits_t;
6780 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6782 #define _INT1IF 0x01
6783 #define _INT1F 0x01
6784 #define _INT2IF 0x02
6785 #define _INT2F 0x02
6786 #define _INT1IE 0x08
6787 #define _INT1E 0x08
6788 #define _INT2IE 0x10
6789 #define _INT2E 0x10
6790 #define _INT1IP 0x40
6791 #define _INT1P 0x40
6792 #define _INT2IP 0x80
6793 #define _INT2P 0x80
6795 //==============================================================================
6798 //==============================================================================
6799 // INTCON2 Bits
6801 extern __at(0x0FF1) __sfr INTCON2;
6803 typedef union
6805 struct
6807 unsigned RBIP : 1;
6808 unsigned : 1;
6809 unsigned TMR0IP : 1;
6810 unsigned : 1;
6811 unsigned INTEDG2 : 1;
6812 unsigned INTEDG1 : 1;
6813 unsigned INTEDG0 : 1;
6814 unsigned NOT_RBPU : 1;
6817 struct
6819 unsigned : 1;
6820 unsigned : 1;
6821 unsigned : 1;
6822 unsigned : 1;
6823 unsigned : 1;
6824 unsigned : 1;
6825 unsigned : 1;
6826 unsigned RBPU : 1;
6828 } __INTCON2bits_t;
6830 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6832 #define _RBIP 0x01
6833 #define _TMR0IP 0x04
6834 #define _INTEDG2 0x10
6835 #define _INTEDG1 0x20
6836 #define _INTEDG0 0x40
6837 #define _NOT_RBPU 0x80
6838 #define _RBPU 0x80
6840 //==============================================================================
6843 //==============================================================================
6844 // INTCON Bits
6846 extern __at(0x0FF2) __sfr INTCON;
6848 typedef union
6850 struct
6852 unsigned RBIF : 1;
6853 unsigned INT0IF : 1;
6854 unsigned TMR0IF : 1;
6855 unsigned RBIE : 1;
6856 unsigned INT0IE : 1;
6857 unsigned TMR0IE : 1;
6858 unsigned PEIE_GIEL : 1;
6859 unsigned GIE_GIEH : 1;
6862 struct
6864 unsigned : 1;
6865 unsigned INT0F : 1;
6866 unsigned T0IF : 1;
6867 unsigned : 1;
6868 unsigned INT0E : 1;
6869 unsigned T0IE : 1;
6870 unsigned PEIE : 1;
6871 unsigned GIE : 1;
6874 struct
6876 unsigned : 1;
6877 unsigned : 1;
6878 unsigned : 1;
6879 unsigned : 1;
6880 unsigned : 1;
6881 unsigned : 1;
6882 unsigned GIEL : 1;
6883 unsigned GIEH : 1;
6885 } __INTCONbits_t;
6887 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6889 #define _RBIF 0x01
6890 #define _INT0IF 0x02
6891 #define _INT0F 0x02
6892 #define _TMR0IF 0x04
6893 #define _T0IF 0x04
6894 #define _RBIE 0x08
6895 #define _INT0IE 0x10
6896 #define _INT0E 0x10
6897 #define _TMR0IE 0x20
6898 #define _T0IE 0x20
6899 #define _PEIE_GIEL 0x40
6900 #define _PEIE 0x40
6901 #define _GIEL 0x40
6902 #define _GIE_GIEH 0x80
6903 #define _GIE 0x80
6904 #define _GIEH 0x80
6906 //==============================================================================
6908 extern __at(0x0FF3) __sfr PROD;
6909 extern __at(0x0FF3) __sfr PRODL;
6910 extern __at(0x0FF4) __sfr PRODH;
6911 extern __at(0x0FF5) __sfr TABLAT;
6912 extern __at(0x0FF6) __sfr TBLPTR;
6913 extern __at(0x0FF6) __sfr TBLPTRL;
6914 extern __at(0x0FF7) __sfr TBLPTRH;
6915 extern __at(0x0FF8) __sfr TBLPTRU;
6916 extern __at(0x0FF9) __sfr PC;
6917 extern __at(0x0FF9) __sfr PCL;
6918 extern __at(0x0FFA) __sfr PCLATH;
6919 extern __at(0x0FFB) __sfr PCLATU;
6921 //==============================================================================
6922 // STKPTR Bits
6924 extern __at(0x0FFC) __sfr STKPTR;
6926 typedef union
6928 struct
6930 unsigned STKPTR0 : 1;
6931 unsigned STKPTR1 : 1;
6932 unsigned STKPTR2 : 1;
6933 unsigned STKPTR3 : 1;
6934 unsigned STKPTR4 : 1;
6935 unsigned : 1;
6936 unsigned STKUNF : 1;
6937 unsigned STKFUL : 1;
6940 struct
6942 unsigned SP0 : 1;
6943 unsigned SP1 : 1;
6944 unsigned SP2 : 1;
6945 unsigned SP3 : 1;
6946 unsigned SP4 : 1;
6947 unsigned : 1;
6948 unsigned : 1;
6949 unsigned STKOVF : 1;
6952 struct
6954 unsigned STKPTR : 5;
6955 unsigned : 3;
6958 struct
6960 unsigned SP : 5;
6961 unsigned : 3;
6963 } __STKPTRbits_t;
6965 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6967 #define _STKPTR0 0x01
6968 #define _SP0 0x01
6969 #define _STKPTR1 0x02
6970 #define _SP1 0x02
6971 #define _STKPTR2 0x04
6972 #define _SP2 0x04
6973 #define _STKPTR3 0x08
6974 #define _SP3 0x08
6975 #define _STKPTR4 0x10
6976 #define _SP4 0x10
6977 #define _STKUNF 0x40
6978 #define _STKFUL 0x80
6979 #define _STKOVF 0x80
6981 //==============================================================================
6983 extern __at(0x0FFD) __sfr TOS;
6984 extern __at(0x0FFD) __sfr TOSL;
6985 extern __at(0x0FFE) __sfr TOSH;
6986 extern __at(0x0FFF) __sfr TOSU;
6988 //==============================================================================
6990 // Configuration Bits
6992 //==============================================================================
6994 #define __CONFIG1H 0x300001
6995 #define __CONFIG2L 0x300002
6996 #define __CONFIG2H 0x300003
6997 #define __CONFIG3H 0x300005
6998 #define __CONFIG4L 0x300006
6999 #define __CONFIG5L 0x300008
7000 #define __CONFIG5H 0x300009
7001 #define __CONFIG6L 0x30000A
7002 #define __CONFIG6H 0x30000B
7003 #define __CONFIG7L 0x30000C
7004 #define __CONFIG7H 0x30000D
7006 //----------------------------- CONFIG1H Options -------------------------------
7008 #define _FOSC_LP_1H 0xF0 // LP oscillator.
7009 #define _FOSC_XT_1H 0xF1 // XT oscillator.
7010 #define _FOSC_HSHP_1H 0xF2 // HS oscillator (high power > 16 MHz).
7011 #define _FOSC_HSMP_1H 0xF3 // HS oscillator (medium power 4-16 MHz).
7012 #define _FOSC_ECHP_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (high power, >16 MHz).
7013 #define _FOSC_ECHPIO6_1H 0xF5 // EC oscillator (high power, >16 MHz).
7014 #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
7015 #define _FOSC_RCIO6_1H 0xF7 // External RC oscillator.
7016 #define _FOSC_INTIO67_1H 0xF8 // Internal oscillator block.
7017 #define _FOSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKOUT function on OSC2.
7018 #define _FOSC_ECMP_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (medium power, 500 kHz-16 MHz).
7019 #define _FOSC_ECMPIO6_1H 0xFB // EC oscillator (medium power, 500 kHz-16 MHz).
7020 #define _FOSC_ECLP_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (low power, <500 kHz).
7021 #define _FOSC_ECLPIO6_1H 0xFD // EC oscillator (low power, <500 kHz).
7022 #define _PLLCFG_OFF_1H 0xEF // Oscillator used directly.
7023 #define _PLLCFG_ON_1H 0xFF // Oscillator multiplied by 4.
7024 #define _PRICLKEN_OFF_1H 0xDF // Primary clock can be disabled by software.
7025 #define _PRICLKEN_ON_1H 0xFF // Primary clock enabled.
7026 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
7027 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
7028 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
7029 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
7031 //----------------------------- CONFIG2L Options -------------------------------
7033 #define _PWRTEN_ON_2L 0xFE // Power up timer enabled.
7034 #define _PWRTEN_OFF_2L 0xFF // Power up timer disabled.
7035 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
7036 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
7037 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
7038 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
7039 #define _BORV_285_2L 0xE7 // VBOR set to 2.85 V nominal.
7040 #define _BORV_250_2L 0xEF // VBOR set to 2.50 V nominal.
7041 #define _BORV_220_2L 0xF7 // VBOR set to 2.20 V nominal.
7042 #define _BORV_190_2L 0xFF // VBOR set to 1.90 V nominal.
7044 //----------------------------- CONFIG2H Options -------------------------------
7046 #define _WDTEN_OFF_2H 0xFC // Watch dog timer is always disabled. SWDTEN has no effect.
7047 #define _WDTEN_NOSLP_2H 0xFD // WDT is disabled in sleep, otherwise enabled. SWDTEN bit has no effect.
7048 #define _WDTEN_SWON_2H 0xFE // WDT is controlled by SWDTEN bit of the WDTCON register.
7049 #define _WDTEN_ON_2H 0xFF // WDT is always enabled. SWDTEN bit has no effect.
7050 #define _WDTPS_1_2H 0xC3 // 1:1.
7051 #define _WDTPS_2_2H 0xC7 // 1:2.
7052 #define _WDTPS_4_2H 0xCB // 1:4.
7053 #define _WDTPS_8_2H 0xCF // 1:8.
7054 #define _WDTPS_16_2H 0xD3 // 1:16.
7055 #define _WDTPS_32_2H 0xD7 // 1:32.
7056 #define _WDTPS_64_2H 0xDB // 1:64.
7057 #define _WDTPS_128_2H 0xDF // 1:128.
7058 #define _WDTPS_256_2H 0xE3 // 1:256.
7059 #define _WDTPS_512_2H 0xE7 // 1:512.
7060 #define _WDTPS_1024_2H 0xEB // 1:1024.
7061 #define _WDTPS_2048_2H 0xEF // 1:2048.
7062 #define _WDTPS_4096_2H 0xF3 // 1:4096.
7063 #define _WDTPS_8192_2H 0xF7 // 1:8192.
7064 #define _WDTPS_16384_2H 0xFB // 1:16384.
7065 #define _WDTPS_32768_2H 0xFF // 1:32768.
7067 //----------------------------- CONFIG3H Options -------------------------------
7069 #define _CCP2MX_PORTB3_3H 0xFE // CCP2 input/output is multiplexed with RB3.
7070 #define _CCP2MX_PORTC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
7071 #define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset.
7072 #define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset.
7073 #define _CCP3MX_PORTC6_3H 0xFB // P3A/CCP3 input/output is mulitplexed with RC6.
7074 #define _CCP3MX_PORTB5_3H 0xFF // P3A/CCP3 input/output is multiplexed with RB5.
7075 #define _HFOFST_OFF_3H 0xF7 // HFINTOSC output and ready status are delayed by the oscillator stable status.
7076 #define _HFOFST_ON_3H 0xFF // HFINTOSC output and ready status are not delayed by the oscillator stable status.
7077 #define _T3CMX_PORTB5_3H 0xEF // T3CKI is on RB5.
7078 #define _T3CMX_PORTC0_3H 0xFF // T3CKI is on RC0.
7079 #define _P2BMX_PORTC0_3H 0xDF // P2B is on RC0.
7080 #define _P2BMX_PORTB5_3H 0xFF // P2B is on RB5.
7081 #define _MCLRE_INTMCLR_3H 0x7F // RE3 input pin enabled; MCLR disabled.
7082 #define _MCLRE_EXTMCLR_3H 0xFF // MCLR pin enabled, RE3 input pin disabled.
7084 //----------------------------- CONFIG4L Options -------------------------------
7086 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
7087 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
7088 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
7089 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1.
7090 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
7091 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
7092 #define _DEBUG_ON_4L 0x7F // Enabled.
7093 #define _DEBUG_OFF_4L 0xFF // Disabled.
7095 //----------------------------- CONFIG5L Options -------------------------------
7097 #define _CP0_ON_5L 0xFE // Block 0 (000800-003FFFh) code-protected.
7098 #define _CP0_OFF_5L 0xFF // Block 0 (000800-003FFFh) not code-protected.
7099 #define _CP1_ON_5L 0xFD // Block 1 (004000-007FFFh) code-protected.
7100 #define _CP1_OFF_5L 0xFF // Block 1 (004000-007FFFh) not code-protected.
7101 #define _CP2_ON_5L 0xFB // Block 2 (008000-00BFFFh) code-protected.
7102 #define _CP2_OFF_5L 0xFF // Block 2 (008000-00BFFFh) not code-protected.
7103 #define _CP3_ON_5L 0xF7 // Block 3 (00C000-00FFFFh) code-protected.
7104 #define _CP3_OFF_5L 0xFF // Block 3 (00C000-00FFFFh) not code-protected.
7106 //----------------------------- CONFIG5H Options -------------------------------
7108 #define _CPB_ON_5H 0xBF // Boot block (000000-0007FFh) code-protected.
7109 #define _CPB_OFF_5H 0xFF // Boot block (000000-0007FFh) not code-protected.
7110 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
7111 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
7113 //----------------------------- CONFIG6L Options -------------------------------
7115 #define _WRT0_ON_6L 0xFE // Block 0 (000800-003FFFh) write-protected.
7116 #define _WRT0_OFF_6L 0xFF // Block 0 (000800-003FFFh) not write-protected.
7117 #define _WRT1_ON_6L 0xFD // Block 1 (004000-007FFFh) write-protected.
7118 #define _WRT1_OFF_6L 0xFF // Block 1 (004000-007FFFh) not write-protected.
7119 #define _WRT2_ON_6L 0xFB // Block 2 (008000-00BFFFh) write-protected.
7120 #define _WRT2_OFF_6L 0xFF // Block 2 (008000-00BFFFh) not write-protected.
7121 #define _WRT3_ON_6L 0xF7 // Block 3 (00C000-00FFFFh) write-protected.
7122 #define _WRT3_OFF_6L 0xFF // Block 3 (00C000-00FFFFh) not write-protected.
7124 //----------------------------- CONFIG6H Options -------------------------------
7126 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
7127 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
7128 #define _WRTB_ON_6H 0xBF // Boot Block (000000-0007FFh) write-protected.
7129 #define _WRTB_OFF_6H 0xFF // Boot Block (000000-0007FFh) not write-protected.
7130 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
7131 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
7133 //----------------------------- CONFIG7L Options -------------------------------
7135 #define _EBTR0_ON_7L 0xFE // Block 0 (000800-003FFFh) protected from table reads executed in other blocks.
7136 #define _EBTR0_OFF_7L 0xFF // Block 0 (000800-003FFFh) not protected from table reads executed in other blocks.
7137 #define _EBTR1_ON_7L 0xFD // Block 1 (004000-007FFFh) protected from table reads executed in other blocks.
7138 #define _EBTR1_OFF_7L 0xFF // Block 1 (004000-007FFFh) not protected from table reads executed in other blocks.
7139 #define _EBTR2_ON_7L 0xFB // Block 2 (008000-00BFFFh) protected from table reads executed in other blocks.
7140 #define _EBTR2_OFF_7L 0xFF // Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks.
7141 #define _EBTR3_ON_7L 0xF7 // Block 3 (00C000-00FFFFh) protected from table reads executed in other blocks.
7142 #define _EBTR3_OFF_7L 0xFF // Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks.
7144 //----------------------------- CONFIG7H Options -------------------------------
7146 #define _EBTRB_ON_7H 0xBF // Boot Block (000000-0007FFh) protected from table reads executed in other blocks.
7147 #define _EBTRB_OFF_7H 0xFF // Boot Block (000000-0007FFh) not protected from table reads executed in other blocks.
7149 //==============================================================================
7151 #define __DEVID1 0x3FFFFE
7152 #define __DEVID2 0x3FFFFF
7154 #define __IDLOC0 0x200000
7155 #define __IDLOC1 0x200001
7156 #define __IDLOC2 0x200002
7157 #define __IDLOC3 0x200003
7158 #define __IDLOC4 0x200004
7159 #define __IDLOC5 0x200005
7160 #define __IDLOC6 0x200006
7161 #define __IDLOC7 0x200007
7163 #endif // #ifndef __PIC18F26K22_H__