struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f46k22.h
blobfb84e47fe97a1225e32ebb92861e8b5b41f6f2cb
1 /*
2 * This declarations of the PIC18F46K22 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:31 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 __PIC18F46K22_H__
26 #define __PIC18F46K22_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 // ANSELD Bits
135 extern __at(0x0F3B) __sfr ANSELD;
137 typedef struct
139 unsigned ANSD0 : 1;
140 unsigned ANSD1 : 1;
141 unsigned ANSD2 : 1;
142 unsigned ANSD3 : 1;
143 unsigned ANSD4 : 1;
144 unsigned ANSD5 : 1;
145 unsigned ANSD6 : 1;
146 unsigned ANSD7 : 1;
147 } __ANSELDbits_t;
149 extern __at(0x0F3B) volatile __ANSELDbits_t ANSELDbits;
151 #define _ANSD0 0x01
152 #define _ANSD1 0x02
153 #define _ANSD2 0x04
154 #define _ANSD3 0x08
155 #define _ANSD4 0x10
156 #define _ANSD5 0x20
157 #define _ANSD6 0x40
158 #define _ANSD7 0x80
160 //==============================================================================
163 //==============================================================================
164 // ANSELE Bits
166 extern __at(0x0F3C) __sfr ANSELE;
168 typedef union
170 struct
172 unsigned ANSE0 : 1;
173 unsigned ANSE1 : 1;
174 unsigned ANSE2 : 1;
175 unsigned : 1;
176 unsigned : 1;
177 unsigned : 1;
178 unsigned : 1;
179 unsigned : 1;
182 struct
184 unsigned ANSE : 3;
185 unsigned : 5;
187 } __ANSELEbits_t;
189 extern __at(0x0F3C) volatile __ANSELEbits_t ANSELEbits;
191 #define _ANSE0 0x01
192 #define _ANSE1 0x02
193 #define _ANSE2 0x04
195 //==============================================================================
198 //==============================================================================
199 // PMD2 Bits
201 extern __at(0x0F3D) __sfr PMD2;
203 typedef struct
205 unsigned ADCMD : 1;
206 unsigned CMP1MD : 1;
207 unsigned CMP2MD : 1;
208 unsigned CTMUMD : 1;
209 unsigned : 1;
210 unsigned : 1;
211 unsigned : 1;
212 unsigned : 1;
213 } __PMD2bits_t;
215 extern __at(0x0F3D) volatile __PMD2bits_t PMD2bits;
217 #define _ADCMD 0x01
218 #define _CMP1MD 0x02
219 #define _CMP2MD 0x04
220 #define _CTMUMD 0x08
222 //==============================================================================
225 //==============================================================================
226 // PMD1 Bits
228 extern __at(0x0F3E) __sfr PMD1;
230 typedef struct
232 unsigned CCP1MD : 1;
233 unsigned CCP2MD : 1;
234 unsigned CCP3MD : 1;
235 unsigned CCP4MD : 1;
236 unsigned CCP5MD : 1;
237 unsigned : 1;
238 unsigned MSSP1MD : 1;
239 unsigned MSSP2MD : 1;
240 } __PMD1bits_t;
242 extern __at(0x0F3E) volatile __PMD1bits_t PMD1bits;
244 #define _CCP1MD 0x01
245 #define _CCP2MD 0x02
246 #define _CCP3MD 0x04
247 #define _CCP4MD 0x08
248 #define _CCP5MD 0x10
249 #define _MSSP1MD 0x40
250 #define _MSSP2MD 0x80
252 //==============================================================================
255 //==============================================================================
256 // PMD0 Bits
258 extern __at(0x0F3F) __sfr PMD0;
260 typedef struct
262 unsigned TMR1MD : 1;
263 unsigned TMR2MD : 1;
264 unsigned TMR3MD : 1;
265 unsigned TMR4MD : 1;
266 unsigned TMR5MD : 1;
267 unsigned TMR6MD : 1;
268 unsigned UART1MD : 1;
269 unsigned UART2MD : 1;
270 } __PMD0bits_t;
272 extern __at(0x0F3F) volatile __PMD0bits_t PMD0bits;
274 #define _TMR1MD 0x01
275 #define _TMR2MD 0x02
276 #define _TMR3MD 0x04
277 #define _TMR4MD 0x08
278 #define _TMR5MD 0x10
279 #define _TMR6MD 0x20
280 #define _UART1MD 0x40
281 #define _UART2MD 0x80
283 //==============================================================================
286 //==============================================================================
287 // DACCON1 Bits
289 extern __at(0x0F40) __sfr DACCON1;
291 typedef union
293 struct
295 unsigned DACR0 : 1;
296 unsigned DACR1 : 1;
297 unsigned DACR2 : 1;
298 unsigned DACR3 : 1;
299 unsigned DACR4 : 1;
300 unsigned : 1;
301 unsigned : 1;
302 unsigned : 1;
305 struct
307 unsigned DACR : 5;
308 unsigned : 3;
310 } __DACCON1bits_t;
312 extern __at(0x0F40) volatile __DACCON1bits_t DACCON1bits;
314 #define _DACR0 0x01
315 #define _DACR1 0x02
316 #define _DACR2 0x04
317 #define _DACR3 0x08
318 #define _DACR4 0x10
320 //==============================================================================
323 //==============================================================================
324 // VREFCON2 Bits
326 extern __at(0x0F40) __sfr VREFCON2;
328 typedef union
330 struct
332 unsigned DACR0 : 1;
333 unsigned DACR1 : 1;
334 unsigned DACR2 : 1;
335 unsigned DACR3 : 1;
336 unsigned DACR4 : 1;
337 unsigned : 1;
338 unsigned : 1;
339 unsigned : 1;
342 struct
344 unsigned DACR : 5;
345 unsigned : 3;
347 } __VREFCON2bits_t;
349 extern __at(0x0F40) volatile __VREFCON2bits_t VREFCON2bits;
351 #define _VREFCON2_DACR0 0x01
352 #define _VREFCON2_DACR1 0x02
353 #define _VREFCON2_DACR2 0x04
354 #define _VREFCON2_DACR3 0x08
355 #define _VREFCON2_DACR4 0x10
357 //==============================================================================
360 //==============================================================================
361 // DACCON0 Bits
363 extern __at(0x0F41) __sfr DACCON0;
365 typedef union
367 struct
369 unsigned DACNSS : 1;
370 unsigned : 1;
371 unsigned DACPSS0 : 1;
372 unsigned DACPSS1 : 1;
373 unsigned : 1;
374 unsigned DACOE : 1;
375 unsigned DACLPS : 1;
376 unsigned DACEN : 1;
379 struct
381 unsigned : 2;
382 unsigned DACPSS : 2;
383 unsigned : 4;
385 } __DACCON0bits_t;
387 extern __at(0x0F41) volatile __DACCON0bits_t DACCON0bits;
389 #define _DACNSS 0x01
390 #define _DACPSS0 0x04
391 #define _DACPSS1 0x08
392 #define _DACOE 0x20
393 #define _DACLPS 0x40
394 #define _DACEN 0x80
396 //==============================================================================
399 //==============================================================================
400 // VREFCON1 Bits
402 extern __at(0x0F41) __sfr VREFCON1;
404 typedef union
406 struct
408 unsigned DACNSS : 1;
409 unsigned : 1;
410 unsigned DACPSS0 : 1;
411 unsigned DACPSS1 : 1;
412 unsigned : 1;
413 unsigned DACOE : 1;
414 unsigned DACLPS : 1;
415 unsigned DACEN : 1;
418 struct
420 unsigned : 2;
421 unsigned DACPSS : 2;
422 unsigned : 4;
424 } __VREFCON1bits_t;
426 extern __at(0x0F41) volatile __VREFCON1bits_t VREFCON1bits;
428 #define _VREFCON1_DACNSS 0x01
429 #define _VREFCON1_DACPSS0 0x04
430 #define _VREFCON1_DACPSS1 0x08
431 #define _VREFCON1_DACOE 0x20
432 #define _VREFCON1_DACLPS 0x40
433 #define _VREFCON1_DACEN 0x80
435 //==============================================================================
438 //==============================================================================
439 // FVRCON Bits
441 extern __at(0x0F42) __sfr FVRCON;
443 typedef union
445 struct
447 unsigned : 1;
448 unsigned : 1;
449 unsigned : 1;
450 unsigned : 1;
451 unsigned FVRS0 : 1;
452 unsigned FVRS1 : 1;
453 unsigned FVRST : 1;
454 unsigned FVREN : 1;
457 struct
459 unsigned : 4;
460 unsigned FVRS : 2;
461 unsigned : 2;
463 } __FVRCONbits_t;
465 extern __at(0x0F42) volatile __FVRCONbits_t FVRCONbits;
467 #define _FVRS0 0x10
468 #define _FVRS1 0x20
469 #define _FVRST 0x40
470 #define _FVREN 0x80
472 //==============================================================================
475 //==============================================================================
476 // VREFCON0 Bits
478 extern __at(0x0F42) __sfr VREFCON0;
480 typedef union
482 struct
484 unsigned : 1;
485 unsigned : 1;
486 unsigned : 1;
487 unsigned : 1;
488 unsigned FVRS0 : 1;
489 unsigned FVRS1 : 1;
490 unsigned FVRST : 1;
491 unsigned FVREN : 1;
494 struct
496 unsigned : 4;
497 unsigned FVRS : 2;
498 unsigned : 2;
500 } __VREFCON0bits_t;
502 extern __at(0x0F42) volatile __VREFCON0bits_t VREFCON0bits;
504 #define _VREFCON0_FVRS0 0x10
505 #define _VREFCON0_FVRS1 0x20
506 #define _VREFCON0_FVRST 0x40
507 #define _VREFCON0_FVREN 0x80
509 //==============================================================================
512 //==============================================================================
513 // CTMUICON Bits
515 extern __at(0x0F43) __sfr CTMUICON;
517 typedef union
519 struct
521 unsigned IRNG0 : 1;
522 unsigned IRNG1 : 1;
523 unsigned ITRIM0 : 1;
524 unsigned ITRIM1 : 1;
525 unsigned ITRIM2 : 1;
526 unsigned ITRIM3 : 1;
527 unsigned ITRIM4 : 1;
528 unsigned ITRIM5 : 1;
531 struct
533 unsigned IRNG : 2;
534 unsigned : 6;
537 struct
539 unsigned : 2;
540 unsigned ITRIM : 6;
542 } __CTMUICONbits_t;
544 extern __at(0x0F43) volatile __CTMUICONbits_t CTMUICONbits;
546 #define _IRNG0 0x01
547 #define _IRNG1 0x02
548 #define _ITRIM0 0x04
549 #define _ITRIM1 0x08
550 #define _ITRIM2 0x10
551 #define _ITRIM3 0x20
552 #define _ITRIM4 0x40
553 #define _ITRIM5 0x80
555 //==============================================================================
558 //==============================================================================
559 // CTMUICONH Bits
561 extern __at(0x0F43) __sfr CTMUICONH;
563 typedef union
565 struct
567 unsigned IRNG0 : 1;
568 unsigned IRNG1 : 1;
569 unsigned ITRIM0 : 1;
570 unsigned ITRIM1 : 1;
571 unsigned ITRIM2 : 1;
572 unsigned ITRIM3 : 1;
573 unsigned ITRIM4 : 1;
574 unsigned ITRIM5 : 1;
577 struct
579 unsigned IRNG : 2;
580 unsigned : 6;
583 struct
585 unsigned : 2;
586 unsigned ITRIM : 6;
588 } __CTMUICONHbits_t;
590 extern __at(0x0F43) volatile __CTMUICONHbits_t CTMUICONHbits;
592 #define _CTMUICONH_IRNG0 0x01
593 #define _CTMUICONH_IRNG1 0x02
594 #define _CTMUICONH_ITRIM0 0x04
595 #define _CTMUICONH_ITRIM1 0x08
596 #define _CTMUICONH_ITRIM2 0x10
597 #define _CTMUICONH_ITRIM3 0x20
598 #define _CTMUICONH_ITRIM4 0x40
599 #define _CTMUICONH_ITRIM5 0x80
601 //==============================================================================
604 //==============================================================================
605 // CTMUCON1 Bits
607 extern __at(0x0F44) __sfr CTMUCON1;
609 typedef union
611 struct
613 unsigned EDG1STAT : 1;
614 unsigned EDG2STAT : 1;
615 unsigned EDG1SEL0 : 1;
616 unsigned EDG1SEL1 : 1;
617 unsigned EDG1POL : 1;
618 unsigned EDG2SEL0 : 1;
619 unsigned EDG2SEL1 : 1;
620 unsigned EDG2POL : 1;
623 struct
625 unsigned : 2;
626 unsigned EDG1SEL : 2;
627 unsigned : 4;
630 struct
632 unsigned : 5;
633 unsigned EDG2SEL : 2;
634 unsigned : 1;
636 } __CTMUCON1bits_t;
638 extern __at(0x0F44) volatile __CTMUCON1bits_t CTMUCON1bits;
640 #define _EDG1STAT 0x01
641 #define _EDG2STAT 0x02
642 #define _EDG1SEL0 0x04
643 #define _EDG1SEL1 0x08
644 #define _EDG1POL 0x10
645 #define _EDG2SEL0 0x20
646 #define _EDG2SEL1 0x40
647 #define _EDG2POL 0x80
649 //==============================================================================
652 //==============================================================================
653 // CTMUCONL Bits
655 extern __at(0x0F44) __sfr CTMUCONL;
657 typedef union
659 struct
661 unsigned EDG1STAT : 1;
662 unsigned EDG2STAT : 1;
663 unsigned EDG1SEL0 : 1;
664 unsigned EDG1SEL1 : 1;
665 unsigned EDG1POL : 1;
666 unsigned EDG2SEL0 : 1;
667 unsigned EDG2SEL1 : 1;
668 unsigned EDG2POL : 1;
671 struct
673 unsigned : 2;
674 unsigned EDG1SEL : 2;
675 unsigned : 4;
678 struct
680 unsigned : 5;
681 unsigned EDG2SEL : 2;
682 unsigned : 1;
684 } __CTMUCONLbits_t;
686 extern __at(0x0F44) volatile __CTMUCONLbits_t CTMUCONLbits;
688 #define _CTMUCONL_EDG1STAT 0x01
689 #define _CTMUCONL_EDG2STAT 0x02
690 #define _CTMUCONL_EDG1SEL0 0x04
691 #define _CTMUCONL_EDG1SEL1 0x08
692 #define _CTMUCONL_EDG1POL 0x10
693 #define _CTMUCONL_EDG2SEL0 0x20
694 #define _CTMUCONL_EDG2SEL1 0x40
695 #define _CTMUCONL_EDG2POL 0x80
697 //==============================================================================
700 //==============================================================================
701 // CTMUCON0 Bits
703 extern __at(0x0F45) __sfr CTMUCON0;
705 typedef struct
707 unsigned CTTRIG : 1;
708 unsigned IDISSEN : 1;
709 unsigned EDGSEQEN : 1;
710 unsigned EDGEN : 1;
711 unsigned TGEN : 1;
712 unsigned CTMUSIDL : 1;
713 unsigned : 1;
714 unsigned CTMUEN : 1;
715 } __CTMUCON0bits_t;
717 extern __at(0x0F45) volatile __CTMUCON0bits_t CTMUCON0bits;
719 #define _CTTRIG 0x01
720 #define _IDISSEN 0x02
721 #define _EDGSEQEN 0x04
722 #define _EDGEN 0x08
723 #define _TGEN 0x10
724 #define _CTMUSIDL 0x20
725 #define _CTMUEN 0x80
727 //==============================================================================
730 //==============================================================================
731 // CTMUCONH Bits
733 extern __at(0x0F45) __sfr CTMUCONH;
735 typedef struct
737 unsigned CTTRIG : 1;
738 unsigned IDISSEN : 1;
739 unsigned EDGSEQEN : 1;
740 unsigned EDGEN : 1;
741 unsigned TGEN : 1;
742 unsigned CTMUSIDL : 1;
743 unsigned : 1;
744 unsigned CTMUEN : 1;
745 } __CTMUCONHbits_t;
747 extern __at(0x0F45) volatile __CTMUCONHbits_t CTMUCONHbits;
749 #define _CTMUCONH_CTTRIG 0x01
750 #define _CTMUCONH_IDISSEN 0x02
751 #define _CTMUCONH_EDGSEQEN 0x04
752 #define _CTMUCONH_EDGEN 0x08
753 #define _CTMUCONH_TGEN 0x10
754 #define _CTMUCONH_CTMUSIDL 0x20
755 #define _CTMUCONH_CTMUEN 0x80
757 //==============================================================================
760 //==============================================================================
761 // SRCON1 Bits
763 extern __at(0x0F46) __sfr SRCON1;
765 typedef struct
767 unsigned SRRC1E : 1;
768 unsigned SRRC2E : 1;
769 unsigned SRRCKE : 1;
770 unsigned SRRPE : 1;
771 unsigned SRSC1E : 1;
772 unsigned SRSC2E : 1;
773 unsigned SRSCKE : 1;
774 unsigned SRSPE : 1;
775 } __SRCON1bits_t;
777 extern __at(0x0F46) volatile __SRCON1bits_t SRCON1bits;
779 #define _SRRC1E 0x01
780 #define _SRRC2E 0x02
781 #define _SRRCKE 0x04
782 #define _SRRPE 0x08
783 #define _SRSC1E 0x10
784 #define _SRSC2E 0x20
785 #define _SRSCKE 0x40
786 #define _SRSPE 0x80
788 //==============================================================================
791 //==============================================================================
792 // SRCON0 Bits
794 extern __at(0x0F47) __sfr SRCON0;
796 typedef union
798 struct
800 unsigned SRPR : 1;
801 unsigned SRPS : 1;
802 unsigned SRNQEN : 1;
803 unsigned SRQEN : 1;
804 unsigned SRCLK0 : 1;
805 unsigned SRCLK1 : 1;
806 unsigned SRCLK2 : 1;
807 unsigned SRLEN : 1;
810 struct
812 unsigned : 4;
813 unsigned SRCLK : 3;
814 unsigned : 1;
816 } __SRCON0bits_t;
818 extern __at(0x0F47) volatile __SRCON0bits_t SRCON0bits;
820 #define _SRPR 0x01
821 #define _SRPS 0x02
822 #define _SRNQEN 0x04
823 #define _SRQEN 0x08
824 #define _SRCLK0 0x10
825 #define _SRCLK1 0x20
826 #define _SRCLK2 0x40
827 #define _SRLEN 0x80
829 //==============================================================================
832 //==============================================================================
833 // CCPTMRS1 Bits
835 extern __at(0x0F48) __sfr CCPTMRS1;
837 typedef union
839 struct
841 unsigned C4TSEL0 : 1;
842 unsigned C4TSEL1 : 1;
843 unsigned C5TSEL0 : 1;
844 unsigned C5TSEL1 : 1;
845 unsigned : 1;
846 unsigned : 1;
847 unsigned : 1;
848 unsigned : 1;
851 struct
853 unsigned C4TSEL : 2;
854 unsigned : 6;
857 struct
859 unsigned : 2;
860 unsigned C5TSEL : 2;
861 unsigned : 4;
863 } __CCPTMRS1bits_t;
865 extern __at(0x0F48) volatile __CCPTMRS1bits_t CCPTMRS1bits;
867 #define _C4TSEL0 0x01
868 #define _C4TSEL1 0x02
869 #define _C5TSEL0 0x04
870 #define _C5TSEL1 0x08
872 //==============================================================================
875 //==============================================================================
876 // CCPTMRS0 Bits
878 extern __at(0x0F49) __sfr CCPTMRS0;
880 typedef union
882 struct
884 unsigned C1TSEL0 : 1;
885 unsigned C1TSEL1 : 1;
886 unsigned : 1;
887 unsigned C2TSEL0 : 1;
888 unsigned C2TSEL1 : 1;
889 unsigned : 1;
890 unsigned C3TSEL0 : 1;
891 unsigned C3TSEL1 : 1;
894 struct
896 unsigned C1TSEL : 2;
897 unsigned : 6;
900 struct
902 unsigned : 3;
903 unsigned C2TSEL : 2;
904 unsigned : 3;
907 struct
909 unsigned : 6;
910 unsigned C3TSEL : 2;
912 } __CCPTMRS0bits_t;
914 extern __at(0x0F49) volatile __CCPTMRS0bits_t CCPTMRS0bits;
916 #define _C1TSEL0 0x01
917 #define _C1TSEL1 0x02
918 #define _C2TSEL0 0x08
919 #define _C2TSEL1 0x10
920 #define _C3TSEL0 0x40
921 #define _C3TSEL1 0x80
923 //==============================================================================
926 //==============================================================================
927 // T6CON Bits
929 extern __at(0x0F4A) __sfr T6CON;
931 typedef union
933 struct
935 unsigned T6CKPS0 : 1;
936 unsigned T6CKPS1 : 1;
937 unsigned TMR6ON : 1;
938 unsigned T6OUTPS0 : 1;
939 unsigned T6OUTPS1 : 1;
940 unsigned T6OUTPS2 : 1;
941 unsigned T6OUTPS3 : 1;
942 unsigned : 1;
945 struct
947 unsigned T6CKPS : 2;
948 unsigned : 6;
951 struct
953 unsigned : 3;
954 unsigned T6OUTPS : 4;
955 unsigned : 1;
957 } __T6CONbits_t;
959 extern __at(0x0F4A) volatile __T6CONbits_t T6CONbits;
961 #define _T6CKPS0 0x01
962 #define _T6CKPS1 0x02
963 #define _TMR6ON 0x04
964 #define _T6OUTPS0 0x08
965 #define _T6OUTPS1 0x10
966 #define _T6OUTPS2 0x20
967 #define _T6OUTPS3 0x40
969 //==============================================================================
971 extern __at(0x0F4B) __sfr PR6;
972 extern __at(0x0F4C) __sfr TMR6;
974 //==============================================================================
975 // T5GCON Bits
977 extern __at(0x0F4D) __sfr T5GCON;
979 typedef union
981 struct
983 unsigned T5GSS0 : 1;
984 unsigned T5GSS1 : 1;
985 unsigned T5GVAL : 1;
986 unsigned T5GGO_NOT_DONE : 1;
987 unsigned T5GSPM : 1;
988 unsigned T5GTM : 1;
989 unsigned T5GPOL : 1;
990 unsigned TMR5GE : 1;
993 struct
995 unsigned : 1;
996 unsigned : 1;
997 unsigned : 1;
998 unsigned T5GGO : 1;
999 unsigned : 1;
1000 unsigned : 1;
1001 unsigned : 1;
1002 unsigned : 1;
1005 struct
1007 unsigned : 1;
1008 unsigned : 1;
1009 unsigned : 1;
1010 unsigned T5G_DONE : 1;
1011 unsigned : 1;
1012 unsigned : 1;
1013 unsigned : 1;
1014 unsigned : 1;
1017 struct
1019 unsigned T5GSS : 2;
1020 unsigned : 6;
1022 } __T5GCONbits_t;
1024 extern __at(0x0F4D) volatile __T5GCONbits_t T5GCONbits;
1026 #define _T5GSS0 0x01
1027 #define _T5GSS1 0x02
1028 #define _T5GVAL 0x04
1029 #define _T5GGO_NOT_DONE 0x08
1030 #define _T5GGO 0x08
1031 #define _T5G_DONE 0x08
1032 #define _T5GSPM 0x10
1033 #define _T5GTM 0x20
1034 #define _T5GPOL 0x40
1035 #define _TMR5GE 0x80
1037 //==============================================================================
1040 //==============================================================================
1041 // T5CON Bits
1043 extern __at(0x0F4E) __sfr T5CON;
1045 typedef union
1047 struct
1049 unsigned TMR5ON : 1;
1050 unsigned T5RD16 : 1;
1051 unsigned NOT_T5SYNC : 1;
1052 unsigned T5SOSCEN : 1;
1053 unsigned T5CKPS0 : 1;
1054 unsigned T5CKPS1 : 1;
1055 unsigned TMR5CS0 : 1;
1056 unsigned TMR5CS1 : 1;
1059 struct
1061 unsigned : 1;
1062 unsigned : 1;
1063 unsigned T5SYNC : 1;
1064 unsigned : 1;
1065 unsigned : 1;
1066 unsigned : 1;
1067 unsigned : 1;
1068 unsigned : 1;
1071 struct
1073 unsigned : 4;
1074 unsigned T5CKPS : 2;
1075 unsigned : 2;
1078 struct
1080 unsigned : 6;
1081 unsigned TMR5CS : 2;
1083 } __T5CONbits_t;
1085 extern __at(0x0F4E) volatile __T5CONbits_t T5CONbits;
1087 #define _TMR5ON 0x01
1088 #define _T5RD16 0x02
1089 #define _NOT_T5SYNC 0x04
1090 #define _T5SYNC 0x04
1091 #define _T5SOSCEN 0x08
1092 #define _T5CKPS0 0x10
1093 #define _T5CKPS1 0x20
1094 #define _TMR5CS0 0x40
1095 #define _TMR5CS1 0x80
1097 //==============================================================================
1099 extern __at(0x0F4F) __sfr TMR5;
1100 extern __at(0x0F4F) __sfr TMR5L;
1101 extern __at(0x0F50) __sfr TMR5H;
1103 //==============================================================================
1104 // T4CON Bits
1106 extern __at(0x0F51) __sfr T4CON;
1108 typedef union
1110 struct
1112 unsigned T4CKPS0 : 1;
1113 unsigned T4CKPS1 : 1;
1114 unsigned TMR4ON : 1;
1115 unsigned T4OUTPS0 : 1;
1116 unsigned T4OUTPS1 : 1;
1117 unsigned T4OUTPS2 : 1;
1118 unsigned T4OUTPS3 : 1;
1119 unsigned : 1;
1122 struct
1124 unsigned T4CKPS : 2;
1125 unsigned : 6;
1128 struct
1130 unsigned : 3;
1131 unsigned T4OUTPS : 4;
1132 unsigned : 1;
1134 } __T4CONbits_t;
1136 extern __at(0x0F51) volatile __T4CONbits_t T4CONbits;
1138 #define _T4CKPS0 0x01
1139 #define _T4CKPS1 0x02
1140 #define _TMR4ON 0x04
1141 #define _T4OUTPS0 0x08
1142 #define _T4OUTPS1 0x10
1143 #define _T4OUTPS2 0x20
1144 #define _T4OUTPS3 0x40
1146 //==============================================================================
1148 extern __at(0x0F52) __sfr PR4;
1149 extern __at(0x0F53) __sfr TMR4;
1151 //==============================================================================
1152 // CCP5CON Bits
1154 extern __at(0x0F54) __sfr CCP5CON;
1156 typedef union
1158 struct
1160 unsigned CCP5M0 : 1;
1161 unsigned CCP5M1 : 1;
1162 unsigned CCP5M2 : 1;
1163 unsigned CCP5M3 : 1;
1164 unsigned DC5B0 : 1;
1165 unsigned DC5B1 : 1;
1166 unsigned : 1;
1167 unsigned : 1;
1170 struct
1172 unsigned CCP5M : 4;
1173 unsigned : 4;
1176 struct
1178 unsigned : 4;
1179 unsigned DC5B : 2;
1180 unsigned : 2;
1182 } __CCP5CONbits_t;
1184 extern __at(0x0F54) volatile __CCP5CONbits_t CCP5CONbits;
1186 #define _CCP5M0 0x01
1187 #define _CCP5M1 0x02
1188 #define _CCP5M2 0x04
1189 #define _CCP5M3 0x08
1190 #define _DC5B0 0x10
1191 #define _DC5B1 0x20
1193 //==============================================================================
1195 extern __at(0x0F55) __sfr CCPR5;
1196 extern __at(0x0F55) __sfr CCPR5L;
1197 extern __at(0x0F56) __sfr CCPR5H;
1199 //==============================================================================
1200 // CCP4CON Bits
1202 extern __at(0x0F57) __sfr CCP4CON;
1204 typedef union
1206 struct
1208 unsigned CCP4M0 : 1;
1209 unsigned CCP4M1 : 1;
1210 unsigned CCP4M2 : 1;
1211 unsigned CCP4M3 : 1;
1212 unsigned DC4B0 : 1;
1213 unsigned DC4B1 : 1;
1214 unsigned : 1;
1215 unsigned : 1;
1218 struct
1220 unsigned CCP4M : 4;
1221 unsigned : 4;
1224 struct
1226 unsigned : 4;
1227 unsigned DC4B : 2;
1228 unsigned : 2;
1230 } __CCP4CONbits_t;
1232 extern __at(0x0F57) volatile __CCP4CONbits_t CCP4CONbits;
1234 #define _CCP4M0 0x01
1235 #define _CCP4M1 0x02
1236 #define _CCP4M2 0x04
1237 #define _CCP4M3 0x08
1238 #define _DC4B0 0x10
1239 #define _DC4B1 0x20
1241 //==============================================================================
1243 extern __at(0x0F58) __sfr CCPR4;
1244 extern __at(0x0F58) __sfr CCPR4L;
1245 extern __at(0x0F59) __sfr CCPR4H;
1247 //==============================================================================
1248 // PSTR3CON Bits
1250 extern __at(0x0F5A) __sfr PSTR3CON;
1252 typedef struct
1254 unsigned STR3A : 1;
1255 unsigned STR3B : 1;
1256 unsigned STR3C : 1;
1257 unsigned STR3D : 1;
1258 unsigned STR3SYNC : 1;
1259 unsigned : 1;
1260 unsigned : 1;
1261 unsigned : 1;
1262 } __PSTR3CONbits_t;
1264 extern __at(0x0F5A) volatile __PSTR3CONbits_t PSTR3CONbits;
1266 #define _STR3A 0x01
1267 #define _STR3B 0x02
1268 #define _STR3C 0x04
1269 #define _STR3D 0x08
1270 #define _STR3SYNC 0x10
1272 //==============================================================================
1275 //==============================================================================
1276 // CCP3AS Bits
1278 extern __at(0x0F5B) __sfr CCP3AS;
1280 typedef union
1282 struct
1284 unsigned P3SSBD0 : 1;
1285 unsigned P3SSBD1 : 1;
1286 unsigned P3SSAC0 : 1;
1287 unsigned P3SSAC1 : 1;
1288 unsigned CCP3AS0 : 1;
1289 unsigned CCP3AS1 : 1;
1290 unsigned CCP3AS2 : 1;
1291 unsigned CCP3ASE : 1;
1294 struct
1296 unsigned PSS3BD0 : 1;
1297 unsigned PSS3BD1 : 1;
1298 unsigned PSS3AC0 : 1;
1299 unsigned PSS3AC1 : 1;
1300 unsigned : 1;
1301 unsigned : 1;
1302 unsigned : 1;
1303 unsigned : 1;
1306 struct
1308 unsigned PSS3BD : 2;
1309 unsigned : 6;
1312 struct
1314 unsigned P3SSBD : 2;
1315 unsigned : 6;
1318 struct
1320 unsigned : 2;
1321 unsigned PSS3AC : 2;
1322 unsigned : 4;
1325 struct
1327 unsigned : 2;
1328 unsigned P3SSAC : 2;
1329 unsigned : 4;
1332 struct
1334 unsigned : 4;
1335 unsigned CCP3AS : 3;
1336 unsigned : 1;
1338 } __CCP3ASbits_t;
1340 extern __at(0x0F5B) volatile __CCP3ASbits_t CCP3ASbits;
1342 #define _P3SSBD0 0x01
1343 #define _PSS3BD0 0x01
1344 #define _P3SSBD1 0x02
1345 #define _PSS3BD1 0x02
1346 #define _P3SSAC0 0x04
1347 #define _PSS3AC0 0x04
1348 #define _P3SSAC1 0x08
1349 #define _PSS3AC1 0x08
1350 #define _CCP3AS0 0x10
1351 #define _CCP3AS1 0x20
1352 #define _CCP3AS2 0x40
1353 #define _CCP3ASE 0x80
1355 //==============================================================================
1358 //==============================================================================
1359 // ECCP3AS Bits
1361 extern __at(0x0F5B) __sfr ECCP3AS;
1363 typedef union
1365 struct
1367 unsigned P3SSBD0 : 1;
1368 unsigned P3SSBD1 : 1;
1369 unsigned P3SSAC0 : 1;
1370 unsigned P3SSAC1 : 1;
1371 unsigned CCP3AS0 : 1;
1372 unsigned CCP3AS1 : 1;
1373 unsigned CCP3AS2 : 1;
1374 unsigned CCP3ASE : 1;
1377 struct
1379 unsigned PSS3BD0 : 1;
1380 unsigned PSS3BD1 : 1;
1381 unsigned PSS3AC0 : 1;
1382 unsigned PSS3AC1 : 1;
1383 unsigned : 1;
1384 unsigned : 1;
1385 unsigned : 1;
1386 unsigned : 1;
1389 struct
1391 unsigned PSS3BD : 2;
1392 unsigned : 6;
1395 struct
1397 unsigned P3SSBD : 2;
1398 unsigned : 6;
1401 struct
1403 unsigned : 2;
1404 unsigned P3SSAC : 2;
1405 unsigned : 4;
1408 struct
1410 unsigned : 2;
1411 unsigned PSS3AC : 2;
1412 unsigned : 4;
1415 struct
1417 unsigned : 4;
1418 unsigned CCP3AS : 3;
1419 unsigned : 1;
1421 } __ECCP3ASbits_t;
1423 extern __at(0x0F5B) volatile __ECCP3ASbits_t ECCP3ASbits;
1425 #define _ECCP3AS_P3SSBD0 0x01
1426 #define _ECCP3AS_PSS3BD0 0x01
1427 #define _ECCP3AS_P3SSBD1 0x02
1428 #define _ECCP3AS_PSS3BD1 0x02
1429 #define _ECCP3AS_P3SSAC0 0x04
1430 #define _ECCP3AS_PSS3AC0 0x04
1431 #define _ECCP3AS_P3SSAC1 0x08
1432 #define _ECCP3AS_PSS3AC1 0x08
1433 #define _ECCP3AS_CCP3AS0 0x10
1434 #define _ECCP3AS_CCP3AS1 0x20
1435 #define _ECCP3AS_CCP3AS2 0x40
1436 #define _ECCP3AS_CCP3ASE 0x80
1438 //==============================================================================
1441 //==============================================================================
1442 // PWM3CON Bits
1444 extern __at(0x0F5C) __sfr PWM3CON;
1446 typedef union
1448 struct
1450 unsigned P3DC0 : 1;
1451 unsigned P3DC1 : 1;
1452 unsigned P3DC2 : 1;
1453 unsigned P3DC3 : 1;
1454 unsigned P3DC4 : 1;
1455 unsigned P3DC5 : 1;
1456 unsigned P3DC6 : 1;
1457 unsigned P3RSEN : 1;
1460 struct
1462 unsigned P3DC : 7;
1463 unsigned : 1;
1465 } __PWM3CONbits_t;
1467 extern __at(0x0F5C) volatile __PWM3CONbits_t PWM3CONbits;
1469 #define _P3DC0 0x01
1470 #define _P3DC1 0x02
1471 #define _P3DC2 0x04
1472 #define _P3DC3 0x08
1473 #define _P3DC4 0x10
1474 #define _P3DC5 0x20
1475 #define _P3DC6 0x40
1476 #define _P3RSEN 0x80
1478 //==============================================================================
1481 //==============================================================================
1482 // CCP3CON Bits
1484 extern __at(0x0F5D) __sfr CCP3CON;
1486 typedef union
1488 struct
1490 unsigned CCP3M0 : 1;
1491 unsigned CCP3M1 : 1;
1492 unsigned CCP3M2 : 1;
1493 unsigned CCP3M3 : 1;
1494 unsigned DC3B0 : 1;
1495 unsigned DC3B1 : 1;
1496 unsigned P3M0 : 1;
1497 unsigned P3M1 : 1;
1500 struct
1502 unsigned CCP3M : 4;
1503 unsigned : 4;
1506 struct
1508 unsigned : 4;
1509 unsigned DC3B : 2;
1510 unsigned : 2;
1513 struct
1515 unsigned : 6;
1516 unsigned P3M : 2;
1518 } __CCP3CONbits_t;
1520 extern __at(0x0F5D) volatile __CCP3CONbits_t CCP3CONbits;
1522 #define _CCP3M0 0x01
1523 #define _CCP3M1 0x02
1524 #define _CCP3M2 0x04
1525 #define _CCP3M3 0x08
1526 #define _DC3B0 0x10
1527 #define _DC3B1 0x20
1528 #define _P3M0 0x40
1529 #define _P3M1 0x80
1531 //==============================================================================
1533 extern __at(0x0F5E) __sfr CCPR3;
1534 extern __at(0x0F5E) __sfr CCPR3L;
1535 extern __at(0x0F5F) __sfr CCPR3H;
1537 //==============================================================================
1538 // SLRCON Bits
1540 extern __at(0x0F60) __sfr SLRCON;
1542 typedef struct
1544 unsigned SLRA : 1;
1545 unsigned SLRB : 1;
1546 unsigned SLRC : 1;
1547 unsigned SLRD : 1;
1548 unsigned SLRE : 1;
1549 unsigned : 1;
1550 unsigned : 1;
1551 unsigned : 1;
1552 } __SLRCONbits_t;
1554 extern __at(0x0F60) volatile __SLRCONbits_t SLRCONbits;
1556 #define _SLRA 0x01
1557 #define _SLRB 0x02
1558 #define _SLRC 0x04
1559 #define _SLRD 0x08
1560 #define _SLRE 0x10
1562 //==============================================================================
1565 //==============================================================================
1566 // WPUB Bits
1568 extern __at(0x0F61) __sfr WPUB;
1570 typedef struct
1572 unsigned WPUB0 : 1;
1573 unsigned WPUB1 : 1;
1574 unsigned WPUB2 : 1;
1575 unsigned WPUB3 : 1;
1576 unsigned WPUB4 : 1;
1577 unsigned WPUB5 : 1;
1578 unsigned WPUB6 : 1;
1579 unsigned WPUB7 : 1;
1580 } __WPUBbits_t;
1582 extern __at(0x0F61) volatile __WPUBbits_t WPUBbits;
1584 #define _WPUB0 0x01
1585 #define _WPUB1 0x02
1586 #define _WPUB2 0x04
1587 #define _WPUB3 0x08
1588 #define _WPUB4 0x10
1589 #define _WPUB5 0x20
1590 #define _WPUB6 0x40
1591 #define _WPUB7 0x80
1593 //==============================================================================
1596 //==============================================================================
1597 // IOCB Bits
1599 extern __at(0x0F62) __sfr IOCB;
1601 typedef struct
1603 unsigned : 1;
1604 unsigned : 1;
1605 unsigned : 1;
1606 unsigned : 1;
1607 unsigned IOCB4 : 1;
1608 unsigned IOCB5 : 1;
1609 unsigned IOCB6 : 1;
1610 unsigned IOCB7 : 1;
1611 } __IOCBbits_t;
1613 extern __at(0x0F62) volatile __IOCBbits_t IOCBbits;
1615 #define _IOCB4 0x10
1616 #define _IOCB5 0x20
1617 #define _IOCB6 0x40
1618 #define _IOCB7 0x80
1620 //==============================================================================
1623 //==============================================================================
1624 // PSTR2CON Bits
1626 extern __at(0x0F63) __sfr PSTR2CON;
1628 typedef struct
1630 unsigned STR2A : 1;
1631 unsigned STR2B : 1;
1632 unsigned STR2C : 1;
1633 unsigned STR2D : 1;
1634 unsigned STR2SYNC : 1;
1635 unsigned : 1;
1636 unsigned : 1;
1637 unsigned : 1;
1638 } __PSTR2CONbits_t;
1640 extern __at(0x0F63) volatile __PSTR2CONbits_t PSTR2CONbits;
1642 #define _STR2A 0x01
1643 #define _STR2B 0x02
1644 #define _STR2C 0x04
1645 #define _STR2D 0x08
1646 #define _STR2SYNC 0x10
1648 //==============================================================================
1651 //==============================================================================
1652 // CCP2AS Bits
1654 extern __at(0x0F64) __sfr CCP2AS;
1656 typedef union
1658 struct
1660 unsigned P2SSBD0 : 1;
1661 unsigned P2SSBD1 : 1;
1662 unsigned P2SSAC0 : 1;
1663 unsigned P2SSAC1 : 1;
1664 unsigned CCP2AS0 : 1;
1665 unsigned CCP2AS1 : 1;
1666 unsigned CCP2AS2 : 1;
1667 unsigned CCP2ASE : 1;
1670 struct
1672 unsigned PSS2BD0 : 1;
1673 unsigned PSS2BD1 : 1;
1674 unsigned PSS2AC0 : 1;
1675 unsigned PSS2AC1 : 1;
1676 unsigned : 1;
1677 unsigned : 1;
1678 unsigned : 1;
1679 unsigned : 1;
1682 struct
1684 unsigned PSS2BD : 2;
1685 unsigned : 6;
1688 struct
1690 unsigned P2SSBD : 2;
1691 unsigned : 6;
1694 struct
1696 unsigned : 2;
1697 unsigned P2SSAC : 2;
1698 unsigned : 4;
1701 struct
1703 unsigned : 2;
1704 unsigned PSS2AC : 2;
1705 unsigned : 4;
1708 struct
1710 unsigned : 4;
1711 unsigned CCP2AS : 3;
1712 unsigned : 1;
1714 } __CCP2ASbits_t;
1716 extern __at(0x0F64) volatile __CCP2ASbits_t CCP2ASbits;
1718 #define _P2SSBD0 0x01
1719 #define _PSS2BD0 0x01
1720 #define _P2SSBD1 0x02
1721 #define _PSS2BD1 0x02
1722 #define _P2SSAC0 0x04
1723 #define _PSS2AC0 0x04
1724 #define _P2SSAC1 0x08
1725 #define _PSS2AC1 0x08
1726 #define _CCP2AS0 0x10
1727 #define _CCP2AS1 0x20
1728 #define _CCP2AS2 0x40
1729 #define _CCP2ASE 0x80
1731 //==============================================================================
1734 //==============================================================================
1735 // ECCP2AS Bits
1737 extern __at(0x0F64) __sfr ECCP2AS;
1739 typedef union
1741 struct
1743 unsigned P2SSBD0 : 1;
1744 unsigned P2SSBD1 : 1;
1745 unsigned P2SSAC0 : 1;
1746 unsigned P2SSAC1 : 1;
1747 unsigned CCP2AS0 : 1;
1748 unsigned CCP2AS1 : 1;
1749 unsigned CCP2AS2 : 1;
1750 unsigned CCP2ASE : 1;
1753 struct
1755 unsigned PSS2BD0 : 1;
1756 unsigned PSS2BD1 : 1;
1757 unsigned PSS2AC0 : 1;
1758 unsigned PSS2AC1 : 1;
1759 unsigned : 1;
1760 unsigned : 1;
1761 unsigned : 1;
1762 unsigned : 1;
1765 struct
1767 unsigned PSS2BD : 2;
1768 unsigned : 6;
1771 struct
1773 unsigned P2SSBD : 2;
1774 unsigned : 6;
1777 struct
1779 unsigned : 2;
1780 unsigned PSS2AC : 2;
1781 unsigned : 4;
1784 struct
1786 unsigned : 2;
1787 unsigned P2SSAC : 2;
1788 unsigned : 4;
1791 struct
1793 unsigned : 4;
1794 unsigned CCP2AS : 3;
1795 unsigned : 1;
1797 } __ECCP2ASbits_t;
1799 extern __at(0x0F64) volatile __ECCP2ASbits_t ECCP2ASbits;
1801 #define _ECCP2AS_P2SSBD0 0x01
1802 #define _ECCP2AS_PSS2BD0 0x01
1803 #define _ECCP2AS_P2SSBD1 0x02
1804 #define _ECCP2AS_PSS2BD1 0x02
1805 #define _ECCP2AS_P2SSAC0 0x04
1806 #define _ECCP2AS_PSS2AC0 0x04
1807 #define _ECCP2AS_P2SSAC1 0x08
1808 #define _ECCP2AS_PSS2AC1 0x08
1809 #define _ECCP2AS_CCP2AS0 0x10
1810 #define _ECCP2AS_CCP2AS1 0x20
1811 #define _ECCP2AS_CCP2AS2 0x40
1812 #define _ECCP2AS_CCP2ASE 0x80
1814 //==============================================================================
1817 //==============================================================================
1818 // PWM2CON Bits
1820 extern __at(0x0F65) __sfr PWM2CON;
1822 typedef union
1824 struct
1826 unsigned P2DC0 : 1;
1827 unsigned P2DC1 : 1;
1828 unsigned P2DC2 : 1;
1829 unsigned P2DC3 : 1;
1830 unsigned P2DC4 : 1;
1831 unsigned P2DC5 : 1;
1832 unsigned P2DC6 : 1;
1833 unsigned P2RSEN : 1;
1836 struct
1838 unsigned P2DC : 7;
1839 unsigned : 1;
1841 } __PWM2CONbits_t;
1843 extern __at(0x0F65) volatile __PWM2CONbits_t PWM2CONbits;
1845 #define _P2DC0 0x01
1846 #define _P2DC1 0x02
1847 #define _P2DC2 0x04
1848 #define _P2DC3 0x08
1849 #define _P2DC4 0x10
1850 #define _P2DC5 0x20
1851 #define _P2DC6 0x40
1852 #define _P2RSEN 0x80
1854 //==============================================================================
1857 //==============================================================================
1858 // CCP2CON Bits
1860 extern __at(0x0F66) __sfr CCP2CON;
1862 typedef union
1864 struct
1866 unsigned CCP2M0 : 1;
1867 unsigned CCP2M1 : 1;
1868 unsigned CCP2M2 : 1;
1869 unsigned CCP2M3 : 1;
1870 unsigned DC2B0 : 1;
1871 unsigned DC2B1 : 1;
1872 unsigned P2M0 : 1;
1873 unsigned P2M1 : 1;
1876 struct
1878 unsigned CCP2M : 4;
1879 unsigned : 4;
1882 struct
1884 unsigned : 4;
1885 unsigned DC2B : 2;
1886 unsigned : 2;
1889 struct
1891 unsigned : 6;
1892 unsigned P2M : 2;
1894 } __CCP2CONbits_t;
1896 extern __at(0x0F66) volatile __CCP2CONbits_t CCP2CONbits;
1898 #define _CCP2M0 0x01
1899 #define _CCP2M1 0x02
1900 #define _CCP2M2 0x04
1901 #define _CCP2M3 0x08
1902 #define _DC2B0 0x10
1903 #define _DC2B1 0x20
1904 #define _P2M0 0x40
1905 #define _P2M1 0x80
1907 //==============================================================================
1909 extern __at(0x0F67) __sfr CCPR2;
1910 extern __at(0x0F67) __sfr CCPR2L;
1911 extern __at(0x0F68) __sfr CCPR2H;
1913 //==============================================================================
1914 // SSP2CON3 Bits
1916 extern __at(0x0F69) __sfr SSP2CON3;
1918 typedef struct
1920 unsigned DHEN : 1;
1921 unsigned AHEN : 1;
1922 unsigned SBCDE : 1;
1923 unsigned SDAHT : 1;
1924 unsigned BOEN : 1;
1925 unsigned SCIE : 1;
1926 unsigned PCIE : 1;
1927 unsigned ACKTIM : 1;
1928 } __SSP2CON3bits_t;
1930 extern __at(0x0F69) volatile __SSP2CON3bits_t SSP2CON3bits;
1932 #define _SSP2CON3_DHEN 0x01
1933 #define _SSP2CON3_AHEN 0x02
1934 #define _SSP2CON3_SBCDE 0x04
1935 #define _SSP2CON3_SDAHT 0x08
1936 #define _SSP2CON3_BOEN 0x10
1937 #define _SSP2CON3_SCIE 0x20
1938 #define _SSP2CON3_PCIE 0x40
1939 #define _SSP2CON3_ACKTIM 0x80
1941 //==============================================================================
1944 //==============================================================================
1945 // SSP2MSK Bits
1947 extern __at(0x0F6A) __sfr SSP2MSK;
1949 typedef struct
1951 unsigned MSK0 : 1;
1952 unsigned MSK1 : 1;
1953 unsigned MSK2 : 1;
1954 unsigned MSK3 : 1;
1955 unsigned MSK4 : 1;
1956 unsigned MSK5 : 1;
1957 unsigned MSK6 : 1;
1958 unsigned MSK7 : 1;
1959 } __SSP2MSKbits_t;
1961 extern __at(0x0F6A) volatile __SSP2MSKbits_t SSP2MSKbits;
1963 #define _SSP2MSK_MSK0 0x01
1964 #define _SSP2MSK_MSK1 0x02
1965 #define _SSP2MSK_MSK2 0x04
1966 #define _SSP2MSK_MSK3 0x08
1967 #define _SSP2MSK_MSK4 0x10
1968 #define _SSP2MSK_MSK5 0x20
1969 #define _SSP2MSK_MSK6 0x40
1970 #define _SSP2MSK_MSK7 0x80
1972 //==============================================================================
1975 //==============================================================================
1976 // SSP2CON2 Bits
1978 extern __at(0x0F6B) __sfr SSP2CON2;
1980 typedef struct
1982 unsigned SEN : 1;
1983 unsigned RSEN : 1;
1984 unsigned PEN : 1;
1985 unsigned RCEN : 1;
1986 unsigned ACKEN : 1;
1987 unsigned ACKDT : 1;
1988 unsigned ACKSTAT : 1;
1989 unsigned GCEN : 1;
1990 } __SSP2CON2bits_t;
1992 extern __at(0x0F6B) volatile __SSP2CON2bits_t SSP2CON2bits;
1994 #define _SSP2CON2_SEN 0x01
1995 #define _SSP2CON2_RSEN 0x02
1996 #define _SSP2CON2_PEN 0x04
1997 #define _SSP2CON2_RCEN 0x08
1998 #define _SSP2CON2_ACKEN 0x10
1999 #define _SSP2CON2_ACKDT 0x20
2000 #define _SSP2CON2_ACKSTAT 0x40
2001 #define _SSP2CON2_GCEN 0x80
2003 //==============================================================================
2006 //==============================================================================
2007 // SSP2CON1 Bits
2009 extern __at(0x0F6C) __sfr SSP2CON1;
2011 typedef union
2013 struct
2015 unsigned SSPM0 : 1;
2016 unsigned SSPM1 : 1;
2017 unsigned SSPM2 : 1;
2018 unsigned SSPM3 : 1;
2019 unsigned CKP : 1;
2020 unsigned SSPEN : 1;
2021 unsigned SSPOV : 1;
2022 unsigned WCOL : 1;
2025 struct
2027 unsigned SSPM : 4;
2028 unsigned : 4;
2030 } __SSP2CON1bits_t;
2032 extern __at(0x0F6C) volatile __SSP2CON1bits_t SSP2CON1bits;
2034 #define _SSP2CON1_SSPM0 0x01
2035 #define _SSP2CON1_SSPM1 0x02
2036 #define _SSP2CON1_SSPM2 0x04
2037 #define _SSP2CON1_SSPM3 0x08
2038 #define _SSP2CON1_CKP 0x10
2039 #define _SSP2CON1_SSPEN 0x20
2040 #define _SSP2CON1_SSPOV 0x40
2041 #define _SSP2CON1_WCOL 0x80
2043 //==============================================================================
2046 //==============================================================================
2047 // SSP2STAT Bits
2049 extern __at(0x0F6D) __sfr SSP2STAT;
2051 typedef union
2053 struct
2055 unsigned BF : 1;
2056 unsigned UA : 1;
2057 unsigned R_NOT_W : 1;
2058 unsigned S : 1;
2059 unsigned P : 1;
2060 unsigned D_NOT_A : 1;
2061 unsigned CKE : 1;
2062 unsigned SMP : 1;
2065 struct
2067 unsigned : 1;
2068 unsigned : 1;
2069 unsigned R : 1;
2070 unsigned : 1;
2071 unsigned : 1;
2072 unsigned D : 1;
2073 unsigned : 1;
2074 unsigned : 1;
2077 struct
2079 unsigned : 1;
2080 unsigned : 1;
2081 unsigned NOT_W : 1;
2082 unsigned : 1;
2083 unsigned : 1;
2084 unsigned NOT_A : 1;
2085 unsigned : 1;
2086 unsigned : 1;
2089 struct
2091 unsigned : 1;
2092 unsigned : 1;
2093 unsigned R_W : 1;
2094 unsigned : 1;
2095 unsigned : 1;
2096 unsigned D_A : 1;
2097 unsigned : 1;
2098 unsigned : 1;
2101 struct
2103 unsigned : 1;
2104 unsigned : 1;
2105 unsigned NOT_WRITE : 1;
2106 unsigned : 1;
2107 unsigned : 1;
2108 unsigned NOT_ADDRESS : 1;
2109 unsigned : 1;
2110 unsigned : 1;
2112 } __SSP2STATbits_t;
2114 extern __at(0x0F6D) volatile __SSP2STATbits_t SSP2STATbits;
2116 #define _SSP2STAT_BF 0x01
2117 #define _SSP2STAT_UA 0x02
2118 #define _SSP2STAT_R_NOT_W 0x04
2119 #define _SSP2STAT_R 0x04
2120 #define _SSP2STAT_NOT_W 0x04
2121 #define _SSP2STAT_R_W 0x04
2122 #define _SSP2STAT_NOT_WRITE 0x04
2123 #define _SSP2STAT_S 0x08
2124 #define _SSP2STAT_P 0x10
2125 #define _SSP2STAT_D_NOT_A 0x20
2126 #define _SSP2STAT_D 0x20
2127 #define _SSP2STAT_NOT_A 0x20
2128 #define _SSP2STAT_D_A 0x20
2129 #define _SSP2STAT_NOT_ADDRESS 0x20
2130 #define _SSP2STAT_CKE 0x40
2131 #define _SSP2STAT_SMP 0x80
2133 //==============================================================================
2135 extern __at(0x0F6E) __sfr SSP2ADD;
2136 extern __at(0x0F6F) __sfr SSP2BUF;
2138 //==============================================================================
2139 // BAUD2CON Bits
2141 extern __at(0x0F70) __sfr BAUD2CON;
2143 typedef union
2145 struct
2147 unsigned ABDEN : 1;
2148 unsigned WUE : 1;
2149 unsigned : 1;
2150 unsigned BRG16 : 1;
2151 unsigned CKTXP : 1;
2152 unsigned DTRXP : 1;
2153 unsigned RCIDL : 1;
2154 unsigned ABDOVF : 1;
2157 struct
2159 unsigned : 1;
2160 unsigned : 1;
2161 unsigned : 1;
2162 unsigned : 1;
2163 unsigned SCKP : 1;
2164 unsigned : 1;
2165 unsigned : 1;
2166 unsigned : 1;
2168 } __BAUD2CONbits_t;
2170 extern __at(0x0F70) volatile __BAUD2CONbits_t BAUD2CONbits;
2172 #define _BAUD2CON_ABDEN 0x01
2173 #define _BAUD2CON_WUE 0x02
2174 #define _BAUD2CON_BRG16 0x08
2175 #define _BAUD2CON_CKTXP 0x10
2176 #define _BAUD2CON_SCKP 0x10
2177 #define _BAUD2CON_DTRXP 0x20
2178 #define _BAUD2CON_RCIDL 0x40
2179 #define _BAUD2CON_ABDOVF 0x80
2181 //==============================================================================
2184 //==============================================================================
2185 // BAUDCON2 Bits
2187 extern __at(0x0F70) __sfr BAUDCON2;
2189 typedef union
2191 struct
2193 unsigned ABDEN : 1;
2194 unsigned WUE : 1;
2195 unsigned : 1;
2196 unsigned BRG16 : 1;
2197 unsigned CKTXP : 1;
2198 unsigned DTRXP : 1;
2199 unsigned RCIDL : 1;
2200 unsigned ABDOVF : 1;
2203 struct
2205 unsigned : 1;
2206 unsigned : 1;
2207 unsigned : 1;
2208 unsigned : 1;
2209 unsigned SCKP : 1;
2210 unsigned : 1;
2211 unsigned : 1;
2212 unsigned : 1;
2214 } __BAUDCON2bits_t;
2216 extern __at(0x0F70) volatile __BAUDCON2bits_t BAUDCON2bits;
2218 #define _BAUDCON2_ABDEN 0x01
2219 #define _BAUDCON2_WUE 0x02
2220 #define _BAUDCON2_BRG16 0x08
2221 #define _BAUDCON2_CKTXP 0x10
2222 #define _BAUDCON2_SCKP 0x10
2223 #define _BAUDCON2_DTRXP 0x20
2224 #define _BAUDCON2_RCIDL 0x40
2225 #define _BAUDCON2_ABDOVF 0x80
2227 //==============================================================================
2230 //==============================================================================
2231 // RC2STA Bits
2233 extern __at(0x0F71) __sfr RC2STA;
2235 typedef union
2237 struct
2239 unsigned RX9D : 1;
2240 unsigned OERR : 1;
2241 unsigned FERR : 1;
2242 unsigned ADDEN : 1;
2243 unsigned CREN : 1;
2244 unsigned SREN : 1;
2245 unsigned RX9 : 1;
2246 unsigned SPEN : 1;
2249 struct
2251 unsigned RX9D2 : 1;
2252 unsigned OERR2 : 1;
2253 unsigned FERR2 : 1;
2254 unsigned ADEN : 1;
2255 unsigned CREN2 : 1;
2256 unsigned SREN2 : 1;
2257 unsigned RX92 : 1;
2258 unsigned SPEN2 : 1;
2261 struct
2263 unsigned : 1;
2264 unsigned : 1;
2265 unsigned : 1;
2266 unsigned ADDEN2 : 1;
2267 unsigned : 1;
2268 unsigned : 1;
2269 unsigned : 1;
2270 unsigned : 1;
2272 } __RC2STAbits_t;
2274 extern __at(0x0F71) volatile __RC2STAbits_t RC2STAbits;
2276 #define _RC2STA_RX9D 0x01
2277 #define _RC2STA_RX9D2 0x01
2278 #define _RC2STA_OERR 0x02
2279 #define _RC2STA_OERR2 0x02
2280 #define _RC2STA_FERR 0x04
2281 #define _RC2STA_FERR2 0x04
2282 #define _RC2STA_ADDEN 0x08
2283 #define _RC2STA_ADEN 0x08
2284 #define _RC2STA_ADDEN2 0x08
2285 #define _RC2STA_CREN 0x10
2286 #define _RC2STA_CREN2 0x10
2287 #define _RC2STA_SREN 0x20
2288 #define _RC2STA_SREN2 0x20
2289 #define _RC2STA_RX9 0x40
2290 #define _RC2STA_RX92 0x40
2291 #define _RC2STA_SPEN 0x80
2292 #define _RC2STA_SPEN2 0x80
2294 //==============================================================================
2297 //==============================================================================
2298 // RCSTA2 Bits
2300 extern __at(0x0F71) __sfr RCSTA2;
2302 typedef union
2304 struct
2306 unsigned RX9D : 1;
2307 unsigned OERR : 1;
2308 unsigned FERR : 1;
2309 unsigned ADDEN : 1;
2310 unsigned CREN : 1;
2311 unsigned SREN : 1;
2312 unsigned RX9 : 1;
2313 unsigned SPEN : 1;
2316 struct
2318 unsigned RX9D2 : 1;
2319 unsigned OERR2 : 1;
2320 unsigned FERR2 : 1;
2321 unsigned ADEN : 1;
2322 unsigned CREN2 : 1;
2323 unsigned SREN2 : 1;
2324 unsigned RX92 : 1;
2325 unsigned SPEN2 : 1;
2328 struct
2330 unsigned : 1;
2331 unsigned : 1;
2332 unsigned : 1;
2333 unsigned ADDEN2 : 1;
2334 unsigned : 1;
2335 unsigned : 1;
2336 unsigned : 1;
2337 unsigned : 1;
2339 } __RCSTA2bits_t;
2341 extern __at(0x0F71) volatile __RCSTA2bits_t RCSTA2bits;
2343 #define _RCSTA2_RX9D 0x01
2344 #define _RCSTA2_RX9D2 0x01
2345 #define _RCSTA2_OERR 0x02
2346 #define _RCSTA2_OERR2 0x02
2347 #define _RCSTA2_FERR 0x04
2348 #define _RCSTA2_FERR2 0x04
2349 #define _RCSTA2_ADDEN 0x08
2350 #define _RCSTA2_ADEN 0x08
2351 #define _RCSTA2_ADDEN2 0x08
2352 #define _RCSTA2_CREN 0x10
2353 #define _RCSTA2_CREN2 0x10
2354 #define _RCSTA2_SREN 0x20
2355 #define _RCSTA2_SREN2 0x20
2356 #define _RCSTA2_RX9 0x40
2357 #define _RCSTA2_RX92 0x40
2358 #define _RCSTA2_SPEN 0x80
2359 #define _RCSTA2_SPEN2 0x80
2361 //==============================================================================
2364 //==============================================================================
2365 // TX2STA Bits
2367 extern __at(0x0F72) __sfr TX2STA;
2369 typedef union
2371 struct
2373 unsigned TX9D : 1;
2374 unsigned TRMT : 1;
2375 unsigned BRGH : 1;
2376 unsigned SENDB : 1;
2377 unsigned SYNC : 1;
2378 unsigned TXEN : 1;
2379 unsigned TX9 : 1;
2380 unsigned CSRC : 1;
2383 struct
2385 unsigned TX9D2 : 1;
2386 unsigned TRMT2 : 1;
2387 unsigned BRGH2 : 1;
2388 unsigned SENDB2 : 1;
2389 unsigned SYNC2 : 1;
2390 unsigned TXEN2 : 1;
2391 unsigned TX92 : 1;
2392 unsigned CSRC2 : 1;
2394 } __TX2STAbits_t;
2396 extern __at(0x0F72) volatile __TX2STAbits_t TX2STAbits;
2398 #define _TX2STA_TX9D 0x01
2399 #define _TX2STA_TX9D2 0x01
2400 #define _TX2STA_TRMT 0x02
2401 #define _TX2STA_TRMT2 0x02
2402 #define _TX2STA_BRGH 0x04
2403 #define _TX2STA_BRGH2 0x04
2404 #define _TX2STA_SENDB 0x08
2405 #define _TX2STA_SENDB2 0x08
2406 #define _TX2STA_SYNC 0x10
2407 #define _TX2STA_SYNC2 0x10
2408 #define _TX2STA_TXEN 0x20
2409 #define _TX2STA_TXEN2 0x20
2410 #define _TX2STA_TX9 0x40
2411 #define _TX2STA_TX92 0x40
2412 #define _TX2STA_CSRC 0x80
2413 #define _TX2STA_CSRC2 0x80
2415 //==============================================================================
2418 //==============================================================================
2419 // TXSTA2 Bits
2421 extern __at(0x0F72) __sfr TXSTA2;
2423 typedef union
2425 struct
2427 unsigned TX9D : 1;
2428 unsigned TRMT : 1;
2429 unsigned BRGH : 1;
2430 unsigned SENDB : 1;
2431 unsigned SYNC : 1;
2432 unsigned TXEN : 1;
2433 unsigned TX9 : 1;
2434 unsigned CSRC : 1;
2437 struct
2439 unsigned TX9D2 : 1;
2440 unsigned TRMT2 : 1;
2441 unsigned BRGH2 : 1;
2442 unsigned SENDB2 : 1;
2443 unsigned SYNC2 : 1;
2444 unsigned TXEN2 : 1;
2445 unsigned TX92 : 1;
2446 unsigned CSRC2 : 1;
2448 } __TXSTA2bits_t;
2450 extern __at(0x0F72) volatile __TXSTA2bits_t TXSTA2bits;
2452 #define _TXSTA2_TX9D 0x01
2453 #define _TXSTA2_TX9D2 0x01
2454 #define _TXSTA2_TRMT 0x02
2455 #define _TXSTA2_TRMT2 0x02
2456 #define _TXSTA2_BRGH 0x04
2457 #define _TXSTA2_BRGH2 0x04
2458 #define _TXSTA2_SENDB 0x08
2459 #define _TXSTA2_SENDB2 0x08
2460 #define _TXSTA2_SYNC 0x10
2461 #define _TXSTA2_SYNC2 0x10
2462 #define _TXSTA2_TXEN 0x20
2463 #define _TXSTA2_TXEN2 0x20
2464 #define _TXSTA2_TX9 0x40
2465 #define _TXSTA2_TX92 0x40
2466 #define _TXSTA2_CSRC 0x80
2467 #define _TXSTA2_CSRC2 0x80
2469 //==============================================================================
2471 extern __at(0x0F73) __sfr TX2REG;
2472 extern __at(0x0F73) __sfr TXREG2;
2473 extern __at(0x0F74) __sfr RC2REG;
2474 extern __at(0x0F74) __sfr RCREG2;
2475 extern __at(0x0F75) __sfr SP2BRG;
2476 extern __at(0x0F75) __sfr SPBRG2;
2477 extern __at(0x0F76) __sfr SP2BRGH;
2478 extern __at(0x0F76) __sfr SPBRGH2;
2480 //==============================================================================
2481 // CM12CON Bits
2483 extern __at(0x0F77) __sfr CM12CON;
2485 typedef struct
2487 unsigned C2SYNC : 1;
2488 unsigned C1SYNC : 1;
2489 unsigned C2HYS : 1;
2490 unsigned C1HYS : 1;
2491 unsigned C2RSEL : 1;
2492 unsigned C1RSEL : 1;
2493 unsigned MC2OUT : 1;
2494 unsigned MC1OUT : 1;
2495 } __CM12CONbits_t;
2497 extern __at(0x0F77) volatile __CM12CONbits_t CM12CONbits;
2499 #define _CM12CON_C2SYNC 0x01
2500 #define _CM12CON_C1SYNC 0x02
2501 #define _CM12CON_C2HYS 0x04
2502 #define _CM12CON_C1HYS 0x08
2503 #define _CM12CON_C2RSEL 0x10
2504 #define _CM12CON_C1RSEL 0x20
2505 #define _CM12CON_MC2OUT 0x40
2506 #define _CM12CON_MC1OUT 0x80
2508 //==============================================================================
2511 //==============================================================================
2512 // CM2CON1 Bits
2514 extern __at(0x0F77) __sfr CM2CON1;
2516 typedef struct
2518 unsigned C2SYNC : 1;
2519 unsigned C1SYNC : 1;
2520 unsigned C2HYS : 1;
2521 unsigned C1HYS : 1;
2522 unsigned C2RSEL : 1;
2523 unsigned C1RSEL : 1;
2524 unsigned MC2OUT : 1;
2525 unsigned MC1OUT : 1;
2526 } __CM2CON1bits_t;
2528 extern __at(0x0F77) volatile __CM2CON1bits_t CM2CON1bits;
2530 #define _C2SYNC 0x01
2531 #define _C1SYNC 0x02
2532 #define _C2HYS 0x04
2533 #define _C1HYS 0x08
2534 #define _C2RSEL 0x10
2535 #define _C1RSEL 0x20
2536 #define _MC2OUT 0x40
2537 #define _MC1OUT 0x80
2539 //==============================================================================
2542 //==============================================================================
2543 // CM2CON Bits
2545 extern __at(0x0F78) __sfr CM2CON;
2547 typedef union
2549 struct
2551 unsigned C2CH0 : 1;
2552 unsigned C2CH1 : 1;
2553 unsigned C2R : 1;
2554 unsigned C2SP : 1;
2555 unsigned C2POL : 1;
2556 unsigned C2OE : 1;
2557 unsigned C2OUT : 1;
2558 unsigned C2ON : 1;
2561 struct
2563 unsigned C2CH : 2;
2564 unsigned : 6;
2566 } __CM2CONbits_t;
2568 extern __at(0x0F78) volatile __CM2CONbits_t CM2CONbits;
2570 #define _C2CH0 0x01
2571 #define _C2CH1 0x02
2572 #define _C2R 0x04
2573 #define _C2SP 0x08
2574 #define _C2POL 0x10
2575 #define _C2OE 0x20
2576 #define _C2OUT 0x40
2577 #define _C2ON 0x80
2579 //==============================================================================
2582 //==============================================================================
2583 // CM2CON0 Bits
2585 extern __at(0x0F78) __sfr CM2CON0;
2587 typedef union
2589 struct
2591 unsigned C2CH0 : 1;
2592 unsigned C2CH1 : 1;
2593 unsigned C2R : 1;
2594 unsigned C2SP : 1;
2595 unsigned C2POL : 1;
2596 unsigned C2OE : 1;
2597 unsigned C2OUT : 1;
2598 unsigned C2ON : 1;
2601 struct
2603 unsigned C2CH : 2;
2604 unsigned : 6;
2606 } __CM2CON0bits_t;
2608 extern __at(0x0F78) volatile __CM2CON0bits_t CM2CON0bits;
2610 #define _CM2CON0_C2CH0 0x01
2611 #define _CM2CON0_C2CH1 0x02
2612 #define _CM2CON0_C2R 0x04
2613 #define _CM2CON0_C2SP 0x08
2614 #define _CM2CON0_C2POL 0x10
2615 #define _CM2CON0_C2OE 0x20
2616 #define _CM2CON0_C2OUT 0x40
2617 #define _CM2CON0_C2ON 0x80
2619 //==============================================================================
2622 //==============================================================================
2623 // CM1CON Bits
2625 extern __at(0x0F79) __sfr CM1CON;
2627 typedef union
2629 struct
2631 unsigned C1CH0 : 1;
2632 unsigned C1CH1 : 1;
2633 unsigned C1R : 1;
2634 unsigned C1SP : 1;
2635 unsigned C1POL : 1;
2636 unsigned C1OE : 1;
2637 unsigned C1OUT : 1;
2638 unsigned C1ON : 1;
2641 struct
2643 unsigned C1CH : 2;
2644 unsigned : 6;
2646 } __CM1CONbits_t;
2648 extern __at(0x0F79) volatile __CM1CONbits_t CM1CONbits;
2650 #define _C1CH0 0x01
2651 #define _C1CH1 0x02
2652 #define _C1R 0x04
2653 #define _C1SP 0x08
2654 #define _C1POL 0x10
2655 #define _C1OE 0x20
2656 #define _C1OUT 0x40
2657 #define _C1ON 0x80
2659 //==============================================================================
2662 //==============================================================================
2663 // CM1CON0 Bits
2665 extern __at(0x0F79) __sfr CM1CON0;
2667 typedef union
2669 struct
2671 unsigned C1CH0 : 1;
2672 unsigned C1CH1 : 1;
2673 unsigned C1R : 1;
2674 unsigned C1SP : 1;
2675 unsigned C1POL : 1;
2676 unsigned C1OE : 1;
2677 unsigned C1OUT : 1;
2678 unsigned C1ON : 1;
2681 struct
2683 unsigned C1CH : 2;
2684 unsigned : 6;
2686 } __CM1CON0bits_t;
2688 extern __at(0x0F79) volatile __CM1CON0bits_t CM1CON0bits;
2690 #define _CM1CON0_C1CH0 0x01
2691 #define _CM1CON0_C1CH1 0x02
2692 #define _CM1CON0_C1R 0x04
2693 #define _CM1CON0_C1SP 0x08
2694 #define _CM1CON0_C1POL 0x10
2695 #define _CM1CON0_C1OE 0x20
2696 #define _CM1CON0_C1OUT 0x40
2697 #define _CM1CON0_C1ON 0x80
2699 //==============================================================================
2702 //==============================================================================
2703 // PIE4 Bits
2705 extern __at(0x0F7A) __sfr PIE4;
2707 typedef struct
2709 unsigned CCP3IE : 1;
2710 unsigned CCP4IE : 1;
2711 unsigned CCP5IE : 1;
2712 unsigned : 1;
2713 unsigned : 1;
2714 unsigned : 1;
2715 unsigned : 1;
2716 unsigned : 1;
2717 } __PIE4bits_t;
2719 extern __at(0x0F7A) volatile __PIE4bits_t PIE4bits;
2721 #define _CCP3IE 0x01
2722 #define _CCP4IE 0x02
2723 #define _CCP5IE 0x04
2725 //==============================================================================
2728 //==============================================================================
2729 // PIR4 Bits
2731 extern __at(0x0F7B) __sfr PIR4;
2733 typedef struct
2735 unsigned CCP3IF : 1;
2736 unsigned CCP4IF : 1;
2737 unsigned CCP5IF : 1;
2738 unsigned : 1;
2739 unsigned : 1;
2740 unsigned : 1;
2741 unsigned : 1;
2742 unsigned : 1;
2743 } __PIR4bits_t;
2745 extern __at(0x0F7B) volatile __PIR4bits_t PIR4bits;
2747 #define _CCP3IF 0x01
2748 #define _CCP4IF 0x02
2749 #define _CCP5IF 0x04
2751 //==============================================================================
2754 //==============================================================================
2755 // IPR4 Bits
2757 extern __at(0x0F7C) __sfr IPR4;
2759 typedef struct
2761 unsigned CCP3IP : 1;
2762 unsigned CCP4IP : 1;
2763 unsigned CCP5IP : 1;
2764 unsigned : 1;
2765 unsigned : 1;
2766 unsigned : 1;
2767 unsigned : 1;
2768 unsigned : 1;
2769 } __IPR4bits_t;
2771 extern __at(0x0F7C) volatile __IPR4bits_t IPR4bits;
2773 #define _CCP3IP 0x01
2774 #define _CCP4IP 0x02
2775 #define _CCP5IP 0x04
2777 //==============================================================================
2780 //==============================================================================
2781 // PIE5 Bits
2783 extern __at(0x0F7D) __sfr PIE5;
2785 typedef struct
2787 unsigned TMR4IE : 1;
2788 unsigned TMR5IE : 1;
2789 unsigned TMR6IE : 1;
2790 unsigned : 1;
2791 unsigned : 1;
2792 unsigned : 1;
2793 unsigned : 1;
2794 unsigned : 1;
2795 } __PIE5bits_t;
2797 extern __at(0x0F7D) volatile __PIE5bits_t PIE5bits;
2799 #define _TMR4IE 0x01
2800 #define _TMR5IE 0x02
2801 #define _TMR6IE 0x04
2803 //==============================================================================
2806 //==============================================================================
2807 // PIR5 Bits
2809 extern __at(0x0F7E) __sfr PIR5;
2811 typedef struct
2813 unsigned TMR4IF : 1;
2814 unsigned TMR5IF : 1;
2815 unsigned TMR6IF : 1;
2816 unsigned : 1;
2817 unsigned : 1;
2818 unsigned : 1;
2819 unsigned : 1;
2820 unsigned : 1;
2821 } __PIR5bits_t;
2823 extern __at(0x0F7E) volatile __PIR5bits_t PIR5bits;
2825 #define _TMR4IF 0x01
2826 #define _TMR5IF 0x02
2827 #define _TMR6IF 0x04
2829 //==============================================================================
2832 //==============================================================================
2833 // IPR5 Bits
2835 extern __at(0x0F7F) __sfr IPR5;
2837 typedef struct
2839 unsigned TMR4IP : 1;
2840 unsigned TMR5IP : 1;
2841 unsigned TMR6IP : 1;
2842 unsigned : 1;
2843 unsigned : 1;
2844 unsigned : 1;
2845 unsigned : 1;
2846 unsigned : 1;
2847 } __IPR5bits_t;
2849 extern __at(0x0F7F) volatile __IPR5bits_t IPR5bits;
2851 #define _TMR4IP 0x01
2852 #define _TMR5IP 0x02
2853 #define _TMR6IP 0x04
2855 //==============================================================================
2858 //==============================================================================
2859 // PORTA Bits
2861 extern __at(0x0F80) __sfr PORTA;
2863 typedef union
2865 struct
2867 unsigned RA0 : 1;
2868 unsigned RA1 : 1;
2869 unsigned RA2 : 1;
2870 unsigned RA3 : 1;
2871 unsigned RA4 : 1;
2872 unsigned RA5 : 1;
2873 unsigned RA6 : 1;
2874 unsigned RA7 : 1;
2877 struct
2879 unsigned AN0 : 1;
2880 unsigned AN1 : 1;
2881 unsigned AN2 : 1;
2882 unsigned AN3 : 1;
2883 unsigned C1OUT : 1;
2884 unsigned AN4 : 1;
2885 unsigned : 1;
2886 unsigned : 1;
2889 struct
2891 unsigned C12IN0M : 1;
2892 unsigned C12IN1M : 1;
2893 unsigned C2INP : 1;
2894 unsigned C1INP : 1;
2895 unsigned T0CKI : 1;
2896 unsigned C2OUT : 1;
2897 unsigned : 1;
2898 unsigned : 1;
2901 struct
2903 unsigned C12IN0N : 1;
2904 unsigned C12IN1N : 1;
2905 unsigned VREFM : 1;
2906 unsigned VREFP : 1;
2907 unsigned SRQ : 1;
2908 unsigned SS : 1;
2909 unsigned : 1;
2910 unsigned : 1;
2913 struct
2915 unsigned : 1;
2916 unsigned : 1;
2917 unsigned VREFN : 1;
2918 unsigned : 1;
2919 unsigned : 1;
2920 unsigned NOT_SS : 1;
2921 unsigned : 1;
2922 unsigned : 1;
2925 struct
2927 unsigned : 1;
2928 unsigned : 1;
2929 unsigned CVREF : 1;
2930 unsigned : 1;
2931 unsigned : 1;
2932 unsigned LVDIN : 1;
2933 unsigned : 1;
2934 unsigned : 1;
2937 struct
2939 unsigned : 1;
2940 unsigned : 1;
2941 unsigned DACOUT : 1;
2942 unsigned : 1;
2943 unsigned : 1;
2944 unsigned HLVDIN : 1;
2945 unsigned : 1;
2946 unsigned : 1;
2949 struct
2951 unsigned : 1;
2952 unsigned : 1;
2953 unsigned : 1;
2954 unsigned : 1;
2955 unsigned : 1;
2956 unsigned SS1 : 1;
2957 unsigned : 1;
2958 unsigned : 1;
2961 struct
2963 unsigned : 1;
2964 unsigned : 1;
2965 unsigned : 1;
2966 unsigned : 1;
2967 unsigned : 1;
2968 unsigned NOT_SS1 : 1;
2969 unsigned : 1;
2970 unsigned : 1;
2973 struct
2975 unsigned : 1;
2976 unsigned : 1;
2977 unsigned : 1;
2978 unsigned : 1;
2979 unsigned : 1;
2980 unsigned SRNQ : 1;
2981 unsigned : 1;
2982 unsigned : 1;
2984 } __PORTAbits_t;
2986 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
2988 #define _PORTA_RA0 0x01
2989 #define _PORTA_AN0 0x01
2990 #define _PORTA_C12IN0M 0x01
2991 #define _PORTA_C12IN0N 0x01
2992 #define _PORTA_RA1 0x02
2993 #define _PORTA_AN1 0x02
2994 #define _PORTA_C12IN1M 0x02
2995 #define _PORTA_C12IN1N 0x02
2996 #define _PORTA_RA2 0x04
2997 #define _PORTA_AN2 0x04
2998 #define _PORTA_C2INP 0x04
2999 #define _PORTA_VREFM 0x04
3000 #define _PORTA_VREFN 0x04
3001 #define _PORTA_CVREF 0x04
3002 #define _PORTA_DACOUT 0x04
3003 #define _PORTA_RA3 0x08
3004 #define _PORTA_AN3 0x08
3005 #define _PORTA_C1INP 0x08
3006 #define _PORTA_VREFP 0x08
3007 #define _PORTA_RA4 0x10
3008 #define _PORTA_C1OUT 0x10
3009 #define _PORTA_T0CKI 0x10
3010 #define _PORTA_SRQ 0x10
3011 #define _PORTA_RA5 0x20
3012 #define _PORTA_AN4 0x20
3013 #define _PORTA_C2OUT 0x20
3014 #define _PORTA_SS 0x20
3015 #define _PORTA_NOT_SS 0x20
3016 #define _PORTA_LVDIN 0x20
3017 #define _PORTA_HLVDIN 0x20
3018 #define _PORTA_SS1 0x20
3019 #define _PORTA_NOT_SS1 0x20
3020 #define _PORTA_SRNQ 0x20
3021 #define _PORTA_RA6 0x40
3022 #define _PORTA_RA7 0x80
3024 //==============================================================================
3027 //==============================================================================
3028 // PORTB Bits
3030 extern __at(0x0F81) __sfr PORTB;
3032 typedef union
3034 struct
3036 unsigned RB0 : 1;
3037 unsigned RB1 : 1;
3038 unsigned RB2 : 1;
3039 unsigned RB3 : 1;
3040 unsigned RB4 : 1;
3041 unsigned RB5 : 1;
3042 unsigned RB6 : 1;
3043 unsigned RB7 : 1;
3046 struct
3048 unsigned INT0 : 1;
3049 unsigned INT1 : 1;
3050 unsigned INT2 : 1;
3051 unsigned CCP2 : 1;
3052 unsigned KBI0 : 1;
3053 unsigned KBI1 : 1;
3054 unsigned KBI2 : 1;
3055 unsigned KBI3 : 1;
3058 struct
3060 unsigned AN12 : 1;
3061 unsigned AN10 : 1;
3062 unsigned AN8 : 1;
3063 unsigned AN9 : 1;
3064 unsigned AN11 : 1;
3065 unsigned AN13 : 1;
3066 unsigned PGC : 1;
3067 unsigned PGD : 1;
3070 struct
3072 unsigned FLT0 : 1;
3073 unsigned C12IN3M : 1;
3074 unsigned CTED1 : 1;
3075 unsigned C12IN2M : 1;
3076 unsigned T5G : 1;
3077 unsigned T1G : 1;
3078 unsigned : 1;
3079 unsigned : 1;
3082 struct
3084 unsigned SRI : 1;
3085 unsigned C12IN3N : 1;
3086 unsigned : 1;
3087 unsigned C12IN2N : 1;
3088 unsigned : 1;
3089 unsigned CCP3 : 1;
3090 unsigned : 1;
3091 unsigned : 1;
3094 struct
3096 unsigned : 1;
3097 unsigned : 1;
3098 unsigned : 1;
3099 unsigned CTED2 : 1;
3100 unsigned : 1;
3101 unsigned T3CKI : 1;
3102 unsigned : 1;
3103 unsigned : 1;
3106 struct
3108 unsigned : 1;
3109 unsigned : 1;
3110 unsigned : 1;
3111 unsigned P2A : 1;
3112 unsigned : 1;
3113 unsigned P3A : 1;
3114 unsigned : 1;
3115 unsigned : 1;
3118 struct
3120 unsigned INT : 3;
3121 unsigned : 5;
3124 struct
3126 unsigned : 4;
3127 unsigned KBI : 4;
3129 } __PORTBbits_t;
3131 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
3133 #define _PORTB_RB0 0x01
3134 #define _PORTB_INT0 0x01
3135 #define _PORTB_AN12 0x01
3136 #define _PORTB_FLT0 0x01
3137 #define _PORTB_SRI 0x01
3138 #define _PORTB_RB1 0x02
3139 #define _PORTB_INT1 0x02
3140 #define _PORTB_AN10 0x02
3141 #define _PORTB_C12IN3M 0x02
3142 #define _PORTB_C12IN3N 0x02
3143 #define _PORTB_RB2 0x04
3144 #define _PORTB_INT2 0x04
3145 #define _PORTB_AN8 0x04
3146 #define _PORTB_CTED1 0x04
3147 #define _PORTB_RB3 0x08
3148 #define _PORTB_CCP2 0x08
3149 #define _PORTB_AN9 0x08
3150 #define _PORTB_C12IN2M 0x08
3151 #define _PORTB_C12IN2N 0x08
3152 #define _PORTB_CTED2 0x08
3153 #define _PORTB_P2A 0x08
3154 #define _PORTB_RB4 0x10
3155 #define _PORTB_KBI0 0x10
3156 #define _PORTB_AN11 0x10
3157 #define _PORTB_T5G 0x10
3158 #define _PORTB_RB5 0x20
3159 #define _PORTB_KBI1 0x20
3160 #define _PORTB_AN13 0x20
3161 #define _PORTB_T1G 0x20
3162 #define _PORTB_CCP3 0x20
3163 #define _PORTB_T3CKI 0x20
3164 #define _PORTB_P3A 0x20
3165 #define _PORTB_RB6 0x40
3166 #define _PORTB_KBI2 0x40
3167 #define _PORTB_PGC 0x40
3168 #define _PORTB_RB7 0x80
3169 #define _PORTB_KBI3 0x80
3170 #define _PORTB_PGD 0x80
3172 //==============================================================================
3175 //==============================================================================
3176 // PORTC Bits
3178 extern __at(0x0F82) __sfr PORTC;
3180 typedef union
3182 struct
3184 unsigned RC0 : 1;
3185 unsigned RC1 : 1;
3186 unsigned RC2 : 1;
3187 unsigned RC3 : 1;
3188 unsigned RC4 : 1;
3189 unsigned RC5 : 1;
3190 unsigned RC6 : 1;
3191 unsigned RC7 : 1;
3194 struct
3196 unsigned T1OSO : 1;
3197 unsigned T1OSI : 1;
3198 unsigned T5CKI : 1;
3199 unsigned SCK : 1;
3200 unsigned SDI : 1;
3201 unsigned SDO : 1;
3202 unsigned TX : 1;
3203 unsigned RX : 1;
3206 struct
3208 unsigned P2B : 1;
3209 unsigned P2A : 1;
3210 unsigned P1A : 1;
3211 unsigned SCL : 1;
3212 unsigned SDA : 1;
3213 unsigned SDO1 : 1;
3214 unsigned CK : 1;
3215 unsigned RX1 : 1;
3218 struct
3220 unsigned T1CKI : 1;
3221 unsigned CCP2 : 1;
3222 unsigned CCP1 : 1;
3223 unsigned SCK1 : 1;
3224 unsigned SDI1 : 1;
3225 unsigned AN17 : 1;
3226 unsigned TX1 : 1;
3227 unsigned DT1 : 1;
3230 struct
3232 unsigned T3CKI : 1;
3233 unsigned : 1;
3234 unsigned CTPLS : 1;
3235 unsigned SCL1 : 1;
3236 unsigned SDA1 : 1;
3237 unsigned : 1;
3238 unsigned CK1 : 1;
3239 unsigned AN19 : 1;
3242 struct
3244 unsigned T3G : 1;
3245 unsigned : 1;
3246 unsigned AN14 : 1;
3247 unsigned AN15 : 1;
3248 unsigned AN16 : 1;
3249 unsigned : 1;
3250 unsigned AN18 : 1;
3251 unsigned : 1;
3253 } __PORTCbits_t;
3255 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
3257 #define _PORTC_RC0 0x01
3258 #define _PORTC_T1OSO 0x01
3259 #define _PORTC_P2B 0x01
3260 #define _PORTC_T1CKI 0x01
3261 #define _PORTC_T3CKI 0x01
3262 #define _PORTC_T3G 0x01
3263 #define _PORTC_RC1 0x02
3264 #define _PORTC_T1OSI 0x02
3265 #define _PORTC_P2A 0x02
3266 #define _PORTC_CCP2 0x02
3267 #define _PORTC_RC2 0x04
3268 #define _PORTC_T5CKI 0x04
3269 #define _PORTC_P1A 0x04
3270 #define _PORTC_CCP1 0x04
3271 #define _PORTC_CTPLS 0x04
3272 #define _PORTC_AN14 0x04
3273 #define _PORTC_RC3 0x08
3274 #define _PORTC_SCK 0x08
3275 #define _PORTC_SCL 0x08
3276 #define _PORTC_SCK1 0x08
3277 #define _PORTC_SCL1 0x08
3278 #define _PORTC_AN15 0x08
3279 #define _PORTC_RC4 0x10
3280 #define _PORTC_SDI 0x10
3281 #define _PORTC_SDA 0x10
3282 #define _PORTC_SDI1 0x10
3283 #define _PORTC_SDA1 0x10
3284 #define _PORTC_AN16 0x10
3285 #define _PORTC_RC5 0x20
3286 #define _PORTC_SDO 0x20
3287 #define _PORTC_SDO1 0x20
3288 #define _PORTC_AN17 0x20
3289 #define _PORTC_RC6 0x40
3290 #define _PORTC_TX 0x40
3291 #define _PORTC_CK 0x40
3292 #define _PORTC_TX1 0x40
3293 #define _PORTC_CK1 0x40
3294 #define _PORTC_AN18 0x40
3295 #define _PORTC_RC7 0x80
3296 #define _PORTC_RX 0x80
3297 #define _PORTC_RX1 0x80
3298 #define _PORTC_DT1 0x80
3299 #define _PORTC_AN19 0x80
3301 //==============================================================================
3304 //==============================================================================
3305 // PORTD Bits
3307 extern __at(0x0F83) __sfr PORTD;
3309 typedef union
3311 struct
3313 unsigned RD0 : 1;
3314 unsigned RD1 : 1;
3315 unsigned RD2 : 1;
3316 unsigned RD3 : 1;
3317 unsigned RD4 : 1;
3318 unsigned RD5 : 1;
3319 unsigned RD6 : 1;
3320 unsigned RD7 : 1;
3323 struct
3325 unsigned SCK2 : 1;
3326 unsigned CCP4 : 1;
3327 unsigned P2B : 1;
3328 unsigned P2C : 1;
3329 unsigned P2D : 1;
3330 unsigned P1B : 1;
3331 unsigned P1C : 1;
3332 unsigned P1D : 1;
3335 struct
3337 unsigned SCL2 : 1;
3338 unsigned SDI2 : 1;
3339 unsigned AN22 : 1;
3340 unsigned NOT_SS2 : 1;
3341 unsigned SDO2 : 1;
3342 unsigned AN25 : 1;
3343 unsigned TX2 : 1;
3344 unsigned RX2 : 1;
3347 struct
3349 unsigned AN20 : 1;
3350 unsigned SDA2 : 1;
3351 unsigned : 1;
3352 unsigned SS2 : 1;
3353 unsigned AN24 : 1;
3354 unsigned : 1;
3355 unsigned CK2 : 1;
3356 unsigned DT2 : 1;
3359 struct
3361 unsigned : 1;
3362 unsigned AN21 : 1;
3363 unsigned : 1;
3364 unsigned AN23 : 1;
3365 unsigned : 1;
3366 unsigned : 1;
3367 unsigned AN26 : 1;
3368 unsigned AN27 : 1;
3370 } __PORTDbits_t;
3372 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
3374 #define _PORTD_RD0 0x01
3375 #define _PORTD_SCK2 0x01
3376 #define _PORTD_SCL2 0x01
3377 #define _PORTD_AN20 0x01
3378 #define _PORTD_RD1 0x02
3379 #define _PORTD_CCP4 0x02
3380 #define _PORTD_SDI2 0x02
3381 #define _PORTD_SDA2 0x02
3382 #define _PORTD_AN21 0x02
3383 #define _PORTD_RD2 0x04
3384 #define _PORTD_P2B 0x04
3385 #define _PORTD_AN22 0x04
3386 #define _PORTD_RD3 0x08
3387 #define _PORTD_P2C 0x08
3388 #define _PORTD_NOT_SS2 0x08
3389 #define _PORTD_SS2 0x08
3390 #define _PORTD_AN23 0x08
3391 #define _PORTD_RD4 0x10
3392 #define _PORTD_P2D 0x10
3393 #define _PORTD_SDO2 0x10
3394 #define _PORTD_AN24 0x10
3395 #define _PORTD_RD5 0x20
3396 #define _PORTD_P1B 0x20
3397 #define _PORTD_AN25 0x20
3398 #define _PORTD_RD6 0x40
3399 #define _PORTD_P1C 0x40
3400 #define _PORTD_TX2 0x40
3401 #define _PORTD_CK2 0x40
3402 #define _PORTD_AN26 0x40
3403 #define _PORTD_RD7 0x80
3404 #define _PORTD_P1D 0x80
3405 #define _PORTD_RX2 0x80
3406 #define _PORTD_DT2 0x80
3407 #define _PORTD_AN27 0x80
3409 //==============================================================================
3412 //==============================================================================
3413 // PORTE Bits
3415 extern __at(0x0F84) __sfr PORTE;
3417 typedef union
3419 struct
3421 unsigned RE0 : 1;
3422 unsigned RE1 : 1;
3423 unsigned RE2 : 1;
3424 unsigned RE3 : 1;
3425 unsigned : 1;
3426 unsigned : 1;
3427 unsigned : 1;
3428 unsigned : 1;
3431 struct
3433 unsigned AN5 : 1;
3434 unsigned AN6 : 1;
3435 unsigned AN7 : 1;
3436 unsigned MCLR : 1;
3437 unsigned : 1;
3438 unsigned : 1;
3439 unsigned : 1;
3440 unsigned : 1;
3443 struct
3445 unsigned P3A : 1;
3446 unsigned P3B : 1;
3447 unsigned CCP5 : 1;
3448 unsigned NOT_MCLR : 1;
3449 unsigned : 1;
3450 unsigned : 1;
3451 unsigned : 1;
3452 unsigned : 1;
3455 struct
3457 unsigned CCP3 : 1;
3458 unsigned : 1;
3459 unsigned : 1;
3460 unsigned VPP : 1;
3461 unsigned : 1;
3462 unsigned : 1;
3463 unsigned : 1;
3464 unsigned : 1;
3467 struct
3469 unsigned RE : 4;
3470 unsigned : 4;
3472 } __PORTEbits_t;
3474 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
3476 #define _PORTE_RE0 0x01
3477 #define _PORTE_AN5 0x01
3478 #define _PORTE_P3A 0x01
3479 #define _PORTE_CCP3 0x01
3480 #define _PORTE_RE1 0x02
3481 #define _PORTE_AN6 0x02
3482 #define _PORTE_P3B 0x02
3483 #define _PORTE_RE2 0x04
3484 #define _PORTE_AN7 0x04
3485 #define _PORTE_CCP5 0x04
3486 #define _PORTE_RE3 0x08
3487 #define _PORTE_MCLR 0x08
3488 #define _PORTE_NOT_MCLR 0x08
3489 #define _PORTE_VPP 0x08
3491 //==============================================================================
3494 //==============================================================================
3495 // LATA Bits
3497 extern __at(0x0F89) __sfr LATA;
3499 typedef struct
3501 unsigned LATA0 : 1;
3502 unsigned LATA1 : 1;
3503 unsigned LATA2 : 1;
3504 unsigned LATA3 : 1;
3505 unsigned LATA4 : 1;
3506 unsigned LATA5 : 1;
3507 unsigned LATA6 : 1;
3508 unsigned LATA7 : 1;
3509 } __LATAbits_t;
3511 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
3513 #define _LATA0 0x01
3514 #define _LATA1 0x02
3515 #define _LATA2 0x04
3516 #define _LATA3 0x08
3517 #define _LATA4 0x10
3518 #define _LATA5 0x20
3519 #define _LATA6 0x40
3520 #define _LATA7 0x80
3522 //==============================================================================
3525 //==============================================================================
3526 // LATB Bits
3528 extern __at(0x0F8A) __sfr LATB;
3530 typedef struct
3532 unsigned LATB0 : 1;
3533 unsigned LATB1 : 1;
3534 unsigned LATB2 : 1;
3535 unsigned LATB3 : 1;
3536 unsigned LATB4 : 1;
3537 unsigned LATB5 : 1;
3538 unsigned LATB6 : 1;
3539 unsigned LATB7 : 1;
3540 } __LATBbits_t;
3542 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
3544 #define _LATB0 0x01
3545 #define _LATB1 0x02
3546 #define _LATB2 0x04
3547 #define _LATB3 0x08
3548 #define _LATB4 0x10
3549 #define _LATB5 0x20
3550 #define _LATB6 0x40
3551 #define _LATB7 0x80
3553 //==============================================================================
3556 //==============================================================================
3557 // LATC Bits
3559 extern __at(0x0F8B) __sfr LATC;
3561 typedef struct
3563 unsigned LATC0 : 1;
3564 unsigned LATC1 : 1;
3565 unsigned LATC2 : 1;
3566 unsigned LATC3 : 1;
3567 unsigned LATC4 : 1;
3568 unsigned LATC5 : 1;
3569 unsigned LATC6 : 1;
3570 unsigned LATC7 : 1;
3571 } __LATCbits_t;
3573 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
3575 #define _LATC0 0x01
3576 #define _LATC1 0x02
3577 #define _LATC2 0x04
3578 #define _LATC3 0x08
3579 #define _LATC4 0x10
3580 #define _LATC5 0x20
3581 #define _LATC6 0x40
3582 #define _LATC7 0x80
3584 //==============================================================================
3587 //==============================================================================
3588 // LATD Bits
3590 extern __at(0x0F8C) __sfr LATD;
3592 typedef struct
3594 unsigned LATD0 : 1;
3595 unsigned LATD1 : 1;
3596 unsigned LATD2 : 1;
3597 unsigned LATD3 : 1;
3598 unsigned LATD4 : 1;
3599 unsigned LATD5 : 1;
3600 unsigned LATD6 : 1;
3601 unsigned LATD7 : 1;
3602 } __LATDbits_t;
3604 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
3606 #define _LATD0 0x01
3607 #define _LATD1 0x02
3608 #define _LATD2 0x04
3609 #define _LATD3 0x08
3610 #define _LATD4 0x10
3611 #define _LATD5 0x20
3612 #define _LATD6 0x40
3613 #define _LATD7 0x80
3615 //==============================================================================
3618 //==============================================================================
3619 // LATE Bits
3621 extern __at(0x0F8D) __sfr LATE;
3623 typedef union
3625 struct
3627 unsigned LATE0 : 1;
3628 unsigned LATE1 : 1;
3629 unsigned LATE2 : 1;
3630 unsigned : 1;
3631 unsigned : 1;
3632 unsigned : 1;
3633 unsigned : 1;
3634 unsigned : 1;
3637 struct
3639 unsigned LATE : 3;
3640 unsigned : 5;
3642 } __LATEbits_t;
3644 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
3646 #define _LATE0 0x01
3647 #define _LATE1 0x02
3648 #define _LATE2 0x04
3650 //==============================================================================
3653 //==============================================================================
3654 // DDRA Bits
3656 extern __at(0x0F92) __sfr DDRA;
3658 typedef union
3660 struct
3662 unsigned TRISA0 : 1;
3663 unsigned TRISA1 : 1;
3664 unsigned TRISA2 : 1;
3665 unsigned TRISA3 : 1;
3666 unsigned TRISA4 : 1;
3667 unsigned TRISA5 : 1;
3668 unsigned TRISA6 : 1;
3669 unsigned TRISA7 : 1;
3672 struct
3674 unsigned RA0 : 1;
3675 unsigned RA1 : 1;
3676 unsigned RA2 : 1;
3677 unsigned RA3 : 1;
3678 unsigned RA4 : 1;
3679 unsigned RA5 : 1;
3680 unsigned RA6 : 1;
3681 unsigned RA7 : 1;
3683 } __DDRAbits_t;
3685 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
3687 #define _TRISA0 0x01
3688 #define _RA0 0x01
3689 #define _TRISA1 0x02
3690 #define _RA1 0x02
3691 #define _TRISA2 0x04
3692 #define _RA2 0x04
3693 #define _TRISA3 0x08
3694 #define _RA3 0x08
3695 #define _TRISA4 0x10
3696 #define _RA4 0x10
3697 #define _TRISA5 0x20
3698 #define _RA5 0x20
3699 #define _TRISA6 0x40
3700 #define _RA6 0x40
3701 #define _TRISA7 0x80
3702 #define _RA7 0x80
3704 //==============================================================================
3707 //==============================================================================
3708 // TRISA Bits
3710 extern __at(0x0F92) __sfr TRISA;
3712 typedef union
3714 struct
3716 unsigned TRISA0 : 1;
3717 unsigned TRISA1 : 1;
3718 unsigned TRISA2 : 1;
3719 unsigned TRISA3 : 1;
3720 unsigned TRISA4 : 1;
3721 unsigned TRISA5 : 1;
3722 unsigned TRISA6 : 1;
3723 unsigned TRISA7 : 1;
3726 struct
3728 unsigned RA0 : 1;
3729 unsigned RA1 : 1;
3730 unsigned RA2 : 1;
3731 unsigned RA3 : 1;
3732 unsigned RA4 : 1;
3733 unsigned RA5 : 1;
3734 unsigned RA6 : 1;
3735 unsigned RA7 : 1;
3737 } __TRISAbits_t;
3739 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
3741 #define _TRISA_TRISA0 0x01
3742 #define _TRISA_RA0 0x01
3743 #define _TRISA_TRISA1 0x02
3744 #define _TRISA_RA1 0x02
3745 #define _TRISA_TRISA2 0x04
3746 #define _TRISA_RA2 0x04
3747 #define _TRISA_TRISA3 0x08
3748 #define _TRISA_RA3 0x08
3749 #define _TRISA_TRISA4 0x10
3750 #define _TRISA_RA4 0x10
3751 #define _TRISA_TRISA5 0x20
3752 #define _TRISA_RA5 0x20
3753 #define _TRISA_TRISA6 0x40
3754 #define _TRISA_RA6 0x40
3755 #define _TRISA_TRISA7 0x80
3756 #define _TRISA_RA7 0x80
3758 //==============================================================================
3761 //==============================================================================
3762 // DDRB Bits
3764 extern __at(0x0F93) __sfr DDRB;
3766 typedef union
3768 struct
3770 unsigned TRISB0 : 1;
3771 unsigned TRISB1 : 1;
3772 unsigned TRISB2 : 1;
3773 unsigned TRISB3 : 1;
3774 unsigned TRISB4 : 1;
3775 unsigned TRISB5 : 1;
3776 unsigned TRISB6 : 1;
3777 unsigned TRISB7 : 1;
3780 struct
3782 unsigned RB0 : 1;
3783 unsigned RB1 : 1;
3784 unsigned RB2 : 1;
3785 unsigned RB3 : 1;
3786 unsigned RB4 : 1;
3787 unsigned RB5 : 1;
3788 unsigned RB6 : 1;
3789 unsigned RB7 : 1;
3791 } __DDRBbits_t;
3793 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
3795 #define _TRISB0 0x01
3796 #define _RB0 0x01
3797 #define _TRISB1 0x02
3798 #define _RB1 0x02
3799 #define _TRISB2 0x04
3800 #define _RB2 0x04
3801 #define _TRISB3 0x08
3802 #define _RB3 0x08
3803 #define _TRISB4 0x10
3804 #define _RB4 0x10
3805 #define _TRISB5 0x20
3806 #define _RB5 0x20
3807 #define _TRISB6 0x40
3808 #define _RB6 0x40
3809 #define _TRISB7 0x80
3810 #define _RB7 0x80
3812 //==============================================================================
3815 //==============================================================================
3816 // TRISB Bits
3818 extern __at(0x0F93) __sfr TRISB;
3820 typedef union
3822 struct
3824 unsigned TRISB0 : 1;
3825 unsigned TRISB1 : 1;
3826 unsigned TRISB2 : 1;
3827 unsigned TRISB3 : 1;
3828 unsigned TRISB4 : 1;
3829 unsigned TRISB5 : 1;
3830 unsigned TRISB6 : 1;
3831 unsigned TRISB7 : 1;
3834 struct
3836 unsigned RB0 : 1;
3837 unsigned RB1 : 1;
3838 unsigned RB2 : 1;
3839 unsigned RB3 : 1;
3840 unsigned RB4 : 1;
3841 unsigned RB5 : 1;
3842 unsigned RB6 : 1;
3843 unsigned RB7 : 1;
3845 } __TRISBbits_t;
3847 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3849 #define _TRISB_TRISB0 0x01
3850 #define _TRISB_RB0 0x01
3851 #define _TRISB_TRISB1 0x02
3852 #define _TRISB_RB1 0x02
3853 #define _TRISB_TRISB2 0x04
3854 #define _TRISB_RB2 0x04
3855 #define _TRISB_TRISB3 0x08
3856 #define _TRISB_RB3 0x08
3857 #define _TRISB_TRISB4 0x10
3858 #define _TRISB_RB4 0x10
3859 #define _TRISB_TRISB5 0x20
3860 #define _TRISB_RB5 0x20
3861 #define _TRISB_TRISB6 0x40
3862 #define _TRISB_RB6 0x40
3863 #define _TRISB_TRISB7 0x80
3864 #define _TRISB_RB7 0x80
3866 //==============================================================================
3869 //==============================================================================
3870 // DDRC Bits
3872 extern __at(0x0F94) __sfr DDRC;
3874 typedef union
3876 struct
3878 unsigned TRISC0 : 1;
3879 unsigned TRISC1 : 1;
3880 unsigned TRISC2 : 1;
3881 unsigned TRISC3 : 1;
3882 unsigned TRISC4 : 1;
3883 unsigned TRISC5 : 1;
3884 unsigned TRISC6 : 1;
3885 unsigned TRISC7 : 1;
3888 struct
3890 unsigned RC0 : 1;
3891 unsigned RC1 : 1;
3892 unsigned RC2 : 1;
3893 unsigned RC3 : 1;
3894 unsigned RC4 : 1;
3895 unsigned RC5 : 1;
3896 unsigned RC6 : 1;
3897 unsigned RC7 : 1;
3899 } __DDRCbits_t;
3901 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
3903 #define _TRISC0 0x01
3904 #define _RC0 0x01
3905 #define _TRISC1 0x02
3906 #define _RC1 0x02
3907 #define _TRISC2 0x04
3908 #define _RC2 0x04
3909 #define _TRISC3 0x08
3910 #define _RC3 0x08
3911 #define _TRISC4 0x10
3912 #define _RC4 0x10
3913 #define _TRISC5 0x20
3914 #define _RC5 0x20
3915 #define _TRISC6 0x40
3916 #define _RC6 0x40
3917 #define _TRISC7 0x80
3918 #define _RC7 0x80
3920 //==============================================================================
3923 //==============================================================================
3924 // TRISC Bits
3926 extern __at(0x0F94) __sfr TRISC;
3928 typedef union
3930 struct
3932 unsigned TRISC0 : 1;
3933 unsigned TRISC1 : 1;
3934 unsigned TRISC2 : 1;
3935 unsigned TRISC3 : 1;
3936 unsigned TRISC4 : 1;
3937 unsigned TRISC5 : 1;
3938 unsigned TRISC6 : 1;
3939 unsigned TRISC7 : 1;
3942 struct
3944 unsigned RC0 : 1;
3945 unsigned RC1 : 1;
3946 unsigned RC2 : 1;
3947 unsigned RC3 : 1;
3948 unsigned RC4 : 1;
3949 unsigned RC5 : 1;
3950 unsigned RC6 : 1;
3951 unsigned RC7 : 1;
3953 } __TRISCbits_t;
3955 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3957 #define _TRISC_TRISC0 0x01
3958 #define _TRISC_RC0 0x01
3959 #define _TRISC_TRISC1 0x02
3960 #define _TRISC_RC1 0x02
3961 #define _TRISC_TRISC2 0x04
3962 #define _TRISC_RC2 0x04
3963 #define _TRISC_TRISC3 0x08
3964 #define _TRISC_RC3 0x08
3965 #define _TRISC_TRISC4 0x10
3966 #define _TRISC_RC4 0x10
3967 #define _TRISC_TRISC5 0x20
3968 #define _TRISC_RC5 0x20
3969 #define _TRISC_TRISC6 0x40
3970 #define _TRISC_RC6 0x40
3971 #define _TRISC_TRISC7 0x80
3972 #define _TRISC_RC7 0x80
3974 //==============================================================================
3977 //==============================================================================
3978 // DDRD Bits
3980 extern __at(0x0F95) __sfr DDRD;
3982 typedef union
3984 struct
3986 unsigned TRISD0 : 1;
3987 unsigned TRISD1 : 1;
3988 unsigned TRISD2 : 1;
3989 unsigned TRISD3 : 1;
3990 unsigned TRISD4 : 1;
3991 unsigned TRISD5 : 1;
3992 unsigned TRISD6 : 1;
3993 unsigned TRISD7 : 1;
3996 struct
3998 unsigned RD0 : 1;
3999 unsigned RD1 : 1;
4000 unsigned RD2 : 1;
4001 unsigned RD3 : 1;
4002 unsigned RD4 : 1;
4003 unsigned RD5 : 1;
4004 unsigned RD6 : 1;
4005 unsigned RD7 : 1;
4007 } __DDRDbits_t;
4009 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
4011 #define _TRISD0 0x01
4012 #define _RD0 0x01
4013 #define _TRISD1 0x02
4014 #define _RD1 0x02
4015 #define _TRISD2 0x04
4016 #define _RD2 0x04
4017 #define _TRISD3 0x08
4018 #define _RD3 0x08
4019 #define _TRISD4 0x10
4020 #define _RD4 0x10
4021 #define _TRISD5 0x20
4022 #define _RD5 0x20
4023 #define _TRISD6 0x40
4024 #define _RD6 0x40
4025 #define _TRISD7 0x80
4026 #define _RD7 0x80
4028 //==============================================================================
4031 //==============================================================================
4032 // TRISD Bits
4034 extern __at(0x0F95) __sfr TRISD;
4036 typedef union
4038 struct
4040 unsigned TRISD0 : 1;
4041 unsigned TRISD1 : 1;
4042 unsigned TRISD2 : 1;
4043 unsigned TRISD3 : 1;
4044 unsigned TRISD4 : 1;
4045 unsigned TRISD5 : 1;
4046 unsigned TRISD6 : 1;
4047 unsigned TRISD7 : 1;
4050 struct
4052 unsigned RD0 : 1;
4053 unsigned RD1 : 1;
4054 unsigned RD2 : 1;
4055 unsigned RD3 : 1;
4056 unsigned RD4 : 1;
4057 unsigned RD5 : 1;
4058 unsigned RD6 : 1;
4059 unsigned RD7 : 1;
4061 } __TRISDbits_t;
4063 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
4065 #define _TRISD_TRISD0 0x01
4066 #define _TRISD_RD0 0x01
4067 #define _TRISD_TRISD1 0x02
4068 #define _TRISD_RD1 0x02
4069 #define _TRISD_TRISD2 0x04
4070 #define _TRISD_RD2 0x04
4071 #define _TRISD_TRISD3 0x08
4072 #define _TRISD_RD3 0x08
4073 #define _TRISD_TRISD4 0x10
4074 #define _TRISD_RD4 0x10
4075 #define _TRISD_TRISD5 0x20
4076 #define _TRISD_RD5 0x20
4077 #define _TRISD_TRISD6 0x40
4078 #define _TRISD_RD6 0x40
4079 #define _TRISD_TRISD7 0x80
4080 #define _TRISD_RD7 0x80
4082 //==============================================================================
4085 //==============================================================================
4086 // DDRE Bits
4088 extern __at(0x0F96) __sfr DDRE;
4090 typedef union
4092 struct
4094 unsigned TRISE0 : 1;
4095 unsigned TRISE1 : 1;
4096 unsigned TRISE2 : 1;
4097 unsigned : 1;
4098 unsigned : 1;
4099 unsigned : 1;
4100 unsigned : 1;
4101 unsigned WPUE3 : 1;
4104 struct
4106 unsigned RE0 : 1;
4107 unsigned RE1 : 1;
4108 unsigned RE2 : 1;
4109 unsigned : 1;
4110 unsigned : 1;
4111 unsigned : 1;
4112 unsigned : 1;
4113 unsigned : 1;
4116 struct
4118 unsigned TRISE : 3;
4119 unsigned : 5;
4122 struct
4124 unsigned RE : 3;
4125 unsigned : 5;
4127 } __DDREbits_t;
4129 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
4131 #define _TRISE0 0x01
4132 #define _RE0 0x01
4133 #define _TRISE1 0x02
4134 #define _RE1 0x02
4135 #define _TRISE2 0x04
4136 #define _RE2 0x04
4137 #define _WPUE3 0x80
4139 //==============================================================================
4142 //==============================================================================
4143 // TRISE Bits
4145 extern __at(0x0F96) __sfr TRISE;
4147 typedef union
4149 struct
4151 unsigned TRISE0 : 1;
4152 unsigned TRISE1 : 1;
4153 unsigned TRISE2 : 1;
4154 unsigned : 1;
4155 unsigned : 1;
4156 unsigned : 1;
4157 unsigned : 1;
4158 unsigned WPUE3 : 1;
4161 struct
4163 unsigned RE0 : 1;
4164 unsigned RE1 : 1;
4165 unsigned RE2 : 1;
4166 unsigned : 1;
4167 unsigned : 1;
4168 unsigned : 1;
4169 unsigned : 1;
4170 unsigned : 1;
4173 struct
4175 unsigned TRISE : 3;
4176 unsigned : 5;
4179 struct
4181 unsigned RE : 3;
4182 unsigned : 5;
4184 } __TRISEbits_t;
4186 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
4188 #define _TRISE_TRISE0 0x01
4189 #define _TRISE_RE0 0x01
4190 #define _TRISE_TRISE1 0x02
4191 #define _TRISE_RE1 0x02
4192 #define _TRISE_TRISE2 0x04
4193 #define _TRISE_RE2 0x04
4194 #define _TRISE_WPUE3 0x80
4196 //==============================================================================
4199 //==============================================================================
4200 // OSCTUNE Bits
4202 extern __at(0x0F9B) __sfr OSCTUNE;
4204 typedef union
4206 struct
4208 unsigned TUN0 : 1;
4209 unsigned TUN1 : 1;
4210 unsigned TUN2 : 1;
4211 unsigned TUN3 : 1;
4212 unsigned TUN4 : 1;
4213 unsigned TUN5 : 1;
4214 unsigned PLLEN : 1;
4215 unsigned INTSRC : 1;
4218 struct
4220 unsigned TUN : 6;
4221 unsigned : 2;
4223 } __OSCTUNEbits_t;
4225 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
4227 #define _TUN0 0x01
4228 #define _TUN1 0x02
4229 #define _TUN2 0x04
4230 #define _TUN3 0x08
4231 #define _TUN4 0x10
4232 #define _TUN5 0x20
4233 #define _PLLEN 0x40
4234 #define _INTSRC 0x80
4236 //==============================================================================
4239 //==============================================================================
4240 // HLVDCON Bits
4242 extern __at(0x0F9C) __sfr HLVDCON;
4244 typedef union
4246 struct
4248 unsigned HLVDL0 : 1;
4249 unsigned HLVDL1 : 1;
4250 unsigned HLVDL2 : 1;
4251 unsigned HLVDL3 : 1;
4252 unsigned HLVDEN : 1;
4253 unsigned IRVST : 1;
4254 unsigned BGVST : 1;
4255 unsigned VDIRMAG : 1;
4258 struct
4260 unsigned LVDL0 : 1;
4261 unsigned LVDL1 : 1;
4262 unsigned LVDL2 : 1;
4263 unsigned LVDL3 : 1;
4264 unsigned LVDEN : 1;
4265 unsigned IVRST : 1;
4266 unsigned : 1;
4267 unsigned : 1;
4270 struct
4272 unsigned LVV0 : 1;
4273 unsigned LVV1 : 1;
4274 unsigned LVV2 : 1;
4275 unsigned LVV3 : 1;
4276 unsigned : 1;
4277 unsigned BGST : 1;
4278 unsigned : 1;
4279 unsigned : 1;
4282 struct
4284 unsigned LVDL : 4;
4285 unsigned : 4;
4288 struct
4290 unsigned HLVDL : 4;
4291 unsigned : 4;
4294 struct
4296 unsigned LVV : 4;
4297 unsigned : 4;
4299 } __HLVDCONbits_t;
4301 extern __at(0x0F9C) volatile __HLVDCONbits_t HLVDCONbits;
4303 #define _HLVDL0 0x01
4304 #define _LVDL0 0x01
4305 #define _LVV0 0x01
4306 #define _HLVDL1 0x02
4307 #define _LVDL1 0x02
4308 #define _LVV1 0x02
4309 #define _HLVDL2 0x04
4310 #define _LVDL2 0x04
4311 #define _LVV2 0x04
4312 #define _HLVDL3 0x08
4313 #define _LVDL3 0x08
4314 #define _LVV3 0x08
4315 #define _HLVDEN 0x10
4316 #define _LVDEN 0x10
4317 #define _IRVST 0x20
4318 #define _IVRST 0x20
4319 #define _BGST 0x20
4320 #define _BGVST 0x40
4321 #define _VDIRMAG 0x80
4323 //==============================================================================
4326 //==============================================================================
4327 // LVDCON Bits
4329 extern __at(0x0F9C) __sfr LVDCON;
4331 typedef union
4333 struct
4335 unsigned HLVDL0 : 1;
4336 unsigned HLVDL1 : 1;
4337 unsigned HLVDL2 : 1;
4338 unsigned HLVDL3 : 1;
4339 unsigned HLVDEN : 1;
4340 unsigned IRVST : 1;
4341 unsigned BGVST : 1;
4342 unsigned VDIRMAG : 1;
4345 struct
4347 unsigned LVDL0 : 1;
4348 unsigned LVDL1 : 1;
4349 unsigned LVDL2 : 1;
4350 unsigned LVDL3 : 1;
4351 unsigned LVDEN : 1;
4352 unsigned IVRST : 1;
4353 unsigned : 1;
4354 unsigned : 1;
4357 struct
4359 unsigned LVV0 : 1;
4360 unsigned LVV1 : 1;
4361 unsigned LVV2 : 1;
4362 unsigned LVV3 : 1;
4363 unsigned : 1;
4364 unsigned BGST : 1;
4365 unsigned : 1;
4366 unsigned : 1;
4369 struct
4371 unsigned HLVDL : 4;
4372 unsigned : 4;
4375 struct
4377 unsigned LVV : 4;
4378 unsigned : 4;
4381 struct
4383 unsigned LVDL : 4;
4384 unsigned : 4;
4386 } __LVDCONbits_t;
4388 extern __at(0x0F9C) volatile __LVDCONbits_t LVDCONbits;
4390 #define _LVDCON_HLVDL0 0x01
4391 #define _LVDCON_LVDL0 0x01
4392 #define _LVDCON_LVV0 0x01
4393 #define _LVDCON_HLVDL1 0x02
4394 #define _LVDCON_LVDL1 0x02
4395 #define _LVDCON_LVV1 0x02
4396 #define _LVDCON_HLVDL2 0x04
4397 #define _LVDCON_LVDL2 0x04
4398 #define _LVDCON_LVV2 0x04
4399 #define _LVDCON_HLVDL3 0x08
4400 #define _LVDCON_LVDL3 0x08
4401 #define _LVDCON_LVV3 0x08
4402 #define _LVDCON_HLVDEN 0x10
4403 #define _LVDCON_LVDEN 0x10
4404 #define _LVDCON_IRVST 0x20
4405 #define _LVDCON_IVRST 0x20
4406 #define _LVDCON_BGST 0x20
4407 #define _LVDCON_BGVST 0x40
4408 #define _LVDCON_VDIRMAG 0x80
4410 //==============================================================================
4413 //==============================================================================
4414 // PIE1 Bits
4416 extern __at(0x0F9D) __sfr PIE1;
4418 typedef union
4420 struct
4422 unsigned TMR1IE : 1;
4423 unsigned TMR2IE : 1;
4424 unsigned CCP1IE : 1;
4425 unsigned SSP1IE : 1;
4426 unsigned TX1IE : 1;
4427 unsigned RC1IE : 1;
4428 unsigned ADIE : 1;
4429 unsigned : 1;
4432 struct
4434 unsigned : 1;
4435 unsigned : 1;
4436 unsigned : 1;
4437 unsigned SSPIE : 1;
4438 unsigned TXIE : 1;
4439 unsigned RCIE : 1;
4440 unsigned : 1;
4441 unsigned : 1;
4443 } __PIE1bits_t;
4445 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
4447 #define _TMR1IE 0x01
4448 #define _TMR2IE 0x02
4449 #define _CCP1IE 0x04
4450 #define _SSP1IE 0x08
4451 #define _SSPIE 0x08
4452 #define _TX1IE 0x10
4453 #define _TXIE 0x10
4454 #define _RC1IE 0x20
4455 #define _RCIE 0x20
4456 #define _ADIE 0x40
4458 //==============================================================================
4461 //==============================================================================
4462 // PIR1 Bits
4464 extern __at(0x0F9E) __sfr PIR1;
4466 typedef union
4468 struct
4470 unsigned TMR1IF : 1;
4471 unsigned TMR2IF : 1;
4472 unsigned CCP1IF : 1;
4473 unsigned SSP1IF : 1;
4474 unsigned TX1IF : 1;
4475 unsigned RC1IF : 1;
4476 unsigned ADIF : 1;
4477 unsigned : 1;
4480 struct
4482 unsigned : 1;
4483 unsigned : 1;
4484 unsigned : 1;
4485 unsigned SSPIF : 1;
4486 unsigned TXIF : 1;
4487 unsigned RCIF : 1;
4488 unsigned : 1;
4489 unsigned : 1;
4491 } __PIR1bits_t;
4493 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4495 #define _TMR1IF 0x01
4496 #define _TMR2IF 0x02
4497 #define _CCP1IF 0x04
4498 #define _SSP1IF 0x08
4499 #define _SSPIF 0x08
4500 #define _TX1IF 0x10
4501 #define _TXIF 0x10
4502 #define _RC1IF 0x20
4503 #define _RCIF 0x20
4504 #define _ADIF 0x40
4506 //==============================================================================
4509 //==============================================================================
4510 // IPR1 Bits
4512 extern __at(0x0F9F) __sfr IPR1;
4514 typedef union
4516 struct
4518 unsigned TMR1IP : 1;
4519 unsigned TMR2IP : 1;
4520 unsigned CCP1IP : 1;
4521 unsigned SSP1IP : 1;
4522 unsigned TX1IP : 1;
4523 unsigned RC1IP : 1;
4524 unsigned ADIP : 1;
4525 unsigned : 1;
4528 struct
4530 unsigned : 1;
4531 unsigned : 1;
4532 unsigned : 1;
4533 unsigned SSPIP : 1;
4534 unsigned TXIP : 1;
4535 unsigned RCIP : 1;
4536 unsigned : 1;
4537 unsigned : 1;
4539 } __IPR1bits_t;
4541 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4543 #define _TMR1IP 0x01
4544 #define _TMR2IP 0x02
4545 #define _CCP1IP 0x04
4546 #define _SSP1IP 0x08
4547 #define _SSPIP 0x08
4548 #define _TX1IP 0x10
4549 #define _TXIP 0x10
4550 #define _RC1IP 0x20
4551 #define _RCIP 0x20
4552 #define _ADIP 0x40
4554 //==============================================================================
4557 //==============================================================================
4558 // PIE2 Bits
4560 extern __at(0x0FA0) __sfr PIE2;
4562 typedef union
4564 struct
4566 unsigned CCP2IE : 1;
4567 unsigned TMR3IE : 1;
4568 unsigned HLVDIE : 1;
4569 unsigned BCL1IE : 1;
4570 unsigned EEIE : 1;
4571 unsigned C2IE : 1;
4572 unsigned C1IE : 1;
4573 unsigned OSCFIE : 1;
4576 struct
4578 unsigned : 1;
4579 unsigned : 1;
4580 unsigned LVDIE : 1;
4581 unsigned BCLIE : 1;
4582 unsigned : 1;
4583 unsigned : 1;
4584 unsigned : 1;
4585 unsigned : 1;
4587 } __PIE2bits_t;
4589 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4591 #define _CCP2IE 0x01
4592 #define _TMR3IE 0x02
4593 #define _HLVDIE 0x04
4594 #define _LVDIE 0x04
4595 #define _BCL1IE 0x08
4596 #define _BCLIE 0x08
4597 #define _EEIE 0x10
4598 #define _C2IE 0x20
4599 #define _C1IE 0x40
4600 #define _OSCFIE 0x80
4602 //==============================================================================
4605 //==============================================================================
4606 // PIR2 Bits
4608 extern __at(0x0FA1) __sfr PIR2;
4610 typedef union
4612 struct
4614 unsigned CCP2IF : 1;
4615 unsigned TMR3IF : 1;
4616 unsigned HLVDIF : 1;
4617 unsigned BCL1IF : 1;
4618 unsigned EEIF : 1;
4619 unsigned C2IF : 1;
4620 unsigned C1IF : 1;
4621 unsigned OSCFIF : 1;
4624 struct
4626 unsigned : 1;
4627 unsigned : 1;
4628 unsigned LVDIF : 1;
4629 unsigned BCLIF : 1;
4630 unsigned : 1;
4631 unsigned : 1;
4632 unsigned : 1;
4633 unsigned : 1;
4635 } __PIR2bits_t;
4637 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4639 #define _CCP2IF 0x01
4640 #define _TMR3IF 0x02
4641 #define _HLVDIF 0x04
4642 #define _LVDIF 0x04
4643 #define _BCL1IF 0x08
4644 #define _BCLIF 0x08
4645 #define _EEIF 0x10
4646 #define _C2IF 0x20
4647 #define _C1IF 0x40
4648 #define _OSCFIF 0x80
4650 //==============================================================================
4653 //==============================================================================
4654 // IPR2 Bits
4656 extern __at(0x0FA2) __sfr IPR2;
4658 typedef union
4660 struct
4662 unsigned CCP2IP : 1;
4663 unsigned TMR3IP : 1;
4664 unsigned HLVDIP : 1;
4665 unsigned BCL1IP : 1;
4666 unsigned EEIP : 1;
4667 unsigned C2IP : 1;
4668 unsigned C1IP : 1;
4669 unsigned OSCFIP : 1;
4672 struct
4674 unsigned : 1;
4675 unsigned : 1;
4676 unsigned LVDIP : 1;
4677 unsigned BCLIP : 1;
4678 unsigned : 1;
4679 unsigned : 1;
4680 unsigned : 1;
4681 unsigned : 1;
4683 } __IPR2bits_t;
4685 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4687 #define _CCP2IP 0x01
4688 #define _TMR3IP 0x02
4689 #define _HLVDIP 0x04
4690 #define _LVDIP 0x04
4691 #define _BCL1IP 0x08
4692 #define _BCLIP 0x08
4693 #define _EEIP 0x10
4694 #define _C2IP 0x20
4695 #define _C1IP 0x40
4696 #define _OSCFIP 0x80
4698 //==============================================================================
4701 //==============================================================================
4702 // PIE3 Bits
4704 extern __at(0x0FA3) __sfr PIE3;
4706 typedef struct
4708 unsigned TMR1GIE : 1;
4709 unsigned TMR3GIE : 1;
4710 unsigned TMR5GIE : 1;
4711 unsigned CTMUIE : 1;
4712 unsigned TX2IE : 1;
4713 unsigned RC2IE : 1;
4714 unsigned BCL2IE : 1;
4715 unsigned SSP2IE : 1;
4716 } __PIE3bits_t;
4718 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4720 #define _TMR1GIE 0x01
4721 #define _TMR3GIE 0x02
4722 #define _TMR5GIE 0x04
4723 #define _CTMUIE 0x08
4724 #define _TX2IE 0x10
4725 #define _RC2IE 0x20
4726 #define _BCL2IE 0x40
4727 #define _SSP2IE 0x80
4729 //==============================================================================
4732 //==============================================================================
4733 // PIR3 Bits
4735 extern __at(0x0FA4) __sfr PIR3;
4737 typedef struct
4739 unsigned TMR1GIF : 1;
4740 unsigned TMR3GIF : 1;
4741 unsigned TMR5GIF : 1;
4742 unsigned CTMUIF : 1;
4743 unsigned TX2IF : 1;
4744 unsigned RC2IF : 1;
4745 unsigned BCL2IF : 1;
4746 unsigned SSP2IF : 1;
4747 } __PIR3bits_t;
4749 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
4751 #define _TMR1GIF 0x01
4752 #define _TMR3GIF 0x02
4753 #define _TMR5GIF 0x04
4754 #define _CTMUIF 0x08
4755 #define _TX2IF 0x10
4756 #define _RC2IF 0x20
4757 #define _BCL2IF 0x40
4758 #define _SSP2IF 0x80
4760 //==============================================================================
4763 //==============================================================================
4764 // IPR3 Bits
4766 extern __at(0x0FA5) __sfr IPR3;
4768 typedef struct
4770 unsigned TMR1GIP : 1;
4771 unsigned TMR3GIP : 1;
4772 unsigned TMR5GIP : 1;
4773 unsigned CTMUIP : 1;
4774 unsigned TX2IP : 1;
4775 unsigned RC2IP : 1;
4776 unsigned BCL2IP : 1;
4777 unsigned SSP2IP : 1;
4778 } __IPR3bits_t;
4780 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4782 #define _TMR1GIP 0x01
4783 #define _TMR3GIP 0x02
4784 #define _TMR5GIP 0x04
4785 #define _CTMUIP 0x08
4786 #define _TX2IP 0x10
4787 #define _RC2IP 0x20
4788 #define _BCL2IP 0x40
4789 #define _SSP2IP 0x80
4791 //==============================================================================
4794 //==============================================================================
4795 // EECON1 Bits
4797 extern __at(0x0FA6) __sfr EECON1;
4799 typedef struct
4801 unsigned RD : 1;
4802 unsigned WR : 1;
4803 unsigned WREN : 1;
4804 unsigned WRERR : 1;
4805 unsigned FREE : 1;
4806 unsigned : 1;
4807 unsigned CFGS : 1;
4808 unsigned EEPGD : 1;
4809 } __EECON1bits_t;
4811 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
4813 #define _RD 0x01
4814 #define _WR 0x02
4815 #define _WREN 0x04
4816 #define _WRERR 0x08
4817 #define _FREE 0x10
4818 #define _CFGS 0x40
4819 #define _EEPGD 0x80
4821 //==============================================================================
4823 extern __at(0x0FA7) __sfr EECON2;
4824 extern __at(0x0FA8) __sfr EEDATA;
4826 //==============================================================================
4827 // EEADR Bits
4829 extern __at(0x0FA9) __sfr EEADR;
4831 typedef struct
4833 unsigned EEADR0 : 1;
4834 unsigned EEADR1 : 1;
4835 unsigned EEADR2 : 1;
4836 unsigned EEADR3 : 1;
4837 unsigned EEADR4 : 1;
4838 unsigned EEADR5 : 1;
4839 unsigned EEADR6 : 1;
4840 unsigned EEADR7 : 1;
4841 } __EEADRbits_t;
4843 extern __at(0x0FA9) volatile __EEADRbits_t EEADRbits;
4845 #define _EEADR0 0x01
4846 #define _EEADR1 0x02
4847 #define _EEADR2 0x04
4848 #define _EEADR3 0x08
4849 #define _EEADR4 0x10
4850 #define _EEADR5 0x20
4851 #define _EEADR6 0x40
4852 #define _EEADR7 0x80
4854 //==============================================================================
4857 //==============================================================================
4858 // EEADRH Bits
4860 extern __at(0x0FAA) __sfr EEADRH;
4862 typedef struct
4864 unsigned EEADR8 : 1;
4865 unsigned EEADR9 : 1;
4866 unsigned : 1;
4867 unsigned : 1;
4868 unsigned : 1;
4869 unsigned : 1;
4870 unsigned : 1;
4871 unsigned : 1;
4872 } __EEADRHbits_t;
4874 extern __at(0x0FAA) volatile __EEADRHbits_t EEADRHbits;
4876 #define _EEADR8 0x01
4877 #define _EEADR9 0x02
4879 //==============================================================================
4882 //==============================================================================
4883 // RC1STA Bits
4885 extern __at(0x0FAB) __sfr RC1STA;
4887 typedef union
4889 struct
4891 unsigned RX9D : 1;
4892 unsigned OERR : 1;
4893 unsigned FERR : 1;
4894 unsigned ADDEN : 1;
4895 unsigned CREN : 1;
4896 unsigned SREN : 1;
4897 unsigned RX9 : 1;
4898 unsigned SPEN : 1;
4901 struct
4903 unsigned RX9D1 : 1;
4904 unsigned OERR1 : 1;
4905 unsigned FERR1 : 1;
4906 unsigned ADEN : 1;
4907 unsigned CREN1 : 1;
4908 unsigned SREN1 : 1;
4909 unsigned RX91 : 1;
4910 unsigned SPEN1 : 1;
4913 struct
4915 unsigned : 1;
4916 unsigned : 1;
4917 unsigned : 1;
4918 unsigned ADDEN1 : 1;
4919 unsigned : 1;
4920 unsigned : 1;
4921 unsigned : 1;
4922 unsigned : 1;
4924 } __RC1STAbits_t;
4926 extern __at(0x0FAB) volatile __RC1STAbits_t RC1STAbits;
4928 #define _RX9D 0x01
4929 #define _RX9D1 0x01
4930 #define _OERR 0x02
4931 #define _OERR1 0x02
4932 #define _FERR 0x04
4933 #define _FERR1 0x04
4934 #define _ADDEN 0x08
4935 #define _ADEN 0x08
4936 #define _ADDEN1 0x08
4937 #define _CREN 0x10
4938 #define _CREN1 0x10
4939 #define _SREN 0x20
4940 #define _SREN1 0x20
4941 #define _RX9 0x40
4942 #define _RX91 0x40
4943 #define _SPEN 0x80
4944 #define _SPEN1 0x80
4946 //==============================================================================
4949 //==============================================================================
4950 // RCSTA Bits
4952 extern __at(0x0FAB) __sfr RCSTA;
4954 typedef union
4956 struct
4958 unsigned RX9D : 1;
4959 unsigned OERR : 1;
4960 unsigned FERR : 1;
4961 unsigned ADDEN : 1;
4962 unsigned CREN : 1;
4963 unsigned SREN : 1;
4964 unsigned RX9 : 1;
4965 unsigned SPEN : 1;
4968 struct
4970 unsigned RX9D1 : 1;
4971 unsigned OERR1 : 1;
4972 unsigned FERR1 : 1;
4973 unsigned ADEN : 1;
4974 unsigned CREN1 : 1;
4975 unsigned SREN1 : 1;
4976 unsigned RX91 : 1;
4977 unsigned SPEN1 : 1;
4980 struct
4982 unsigned : 1;
4983 unsigned : 1;
4984 unsigned : 1;
4985 unsigned ADDEN1 : 1;
4986 unsigned : 1;
4987 unsigned : 1;
4988 unsigned : 1;
4989 unsigned : 1;
4991 } __RCSTAbits_t;
4993 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
4995 #define _RCSTA_RX9D 0x01
4996 #define _RCSTA_RX9D1 0x01
4997 #define _RCSTA_OERR 0x02
4998 #define _RCSTA_OERR1 0x02
4999 #define _RCSTA_FERR 0x04
5000 #define _RCSTA_FERR1 0x04
5001 #define _RCSTA_ADDEN 0x08
5002 #define _RCSTA_ADEN 0x08
5003 #define _RCSTA_ADDEN1 0x08
5004 #define _RCSTA_CREN 0x10
5005 #define _RCSTA_CREN1 0x10
5006 #define _RCSTA_SREN 0x20
5007 #define _RCSTA_SREN1 0x20
5008 #define _RCSTA_RX9 0x40
5009 #define _RCSTA_RX91 0x40
5010 #define _RCSTA_SPEN 0x80
5011 #define _RCSTA_SPEN1 0x80
5013 //==============================================================================
5016 //==============================================================================
5017 // RCSTA1 Bits
5019 extern __at(0x0FAB) __sfr RCSTA1;
5021 typedef union
5023 struct
5025 unsigned RX9D : 1;
5026 unsigned OERR : 1;
5027 unsigned FERR : 1;
5028 unsigned ADDEN : 1;
5029 unsigned CREN : 1;
5030 unsigned SREN : 1;
5031 unsigned RX9 : 1;
5032 unsigned SPEN : 1;
5035 struct
5037 unsigned RX9D1 : 1;
5038 unsigned OERR1 : 1;
5039 unsigned FERR1 : 1;
5040 unsigned ADEN : 1;
5041 unsigned CREN1 : 1;
5042 unsigned SREN1 : 1;
5043 unsigned RX91 : 1;
5044 unsigned SPEN1 : 1;
5047 struct
5049 unsigned : 1;
5050 unsigned : 1;
5051 unsigned : 1;
5052 unsigned ADDEN1 : 1;
5053 unsigned : 1;
5054 unsigned : 1;
5055 unsigned : 1;
5056 unsigned : 1;
5058 } __RCSTA1bits_t;
5060 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
5062 #define _RCSTA1_RX9D 0x01
5063 #define _RCSTA1_RX9D1 0x01
5064 #define _RCSTA1_OERR 0x02
5065 #define _RCSTA1_OERR1 0x02
5066 #define _RCSTA1_FERR 0x04
5067 #define _RCSTA1_FERR1 0x04
5068 #define _RCSTA1_ADDEN 0x08
5069 #define _RCSTA1_ADEN 0x08
5070 #define _RCSTA1_ADDEN1 0x08
5071 #define _RCSTA1_CREN 0x10
5072 #define _RCSTA1_CREN1 0x10
5073 #define _RCSTA1_SREN 0x20
5074 #define _RCSTA1_SREN1 0x20
5075 #define _RCSTA1_RX9 0x40
5076 #define _RCSTA1_RX91 0x40
5077 #define _RCSTA1_SPEN 0x80
5078 #define _RCSTA1_SPEN1 0x80
5080 //==============================================================================
5083 //==============================================================================
5084 // TX1STA Bits
5086 extern __at(0x0FAC) __sfr TX1STA;
5088 typedef union
5090 struct
5092 unsigned TX9D : 1;
5093 unsigned TRMT : 1;
5094 unsigned BRGH : 1;
5095 unsigned SENDB : 1;
5096 unsigned SYNC : 1;
5097 unsigned TXEN : 1;
5098 unsigned TX9 : 1;
5099 unsigned CSRC : 1;
5102 struct
5104 unsigned TX9D1 : 1;
5105 unsigned TRMT1 : 1;
5106 unsigned BRGH1 : 1;
5107 unsigned SENDB1 : 1;
5108 unsigned SYNC1 : 1;
5109 unsigned TXEN1 : 1;
5110 unsigned TX91 : 1;
5111 unsigned CSRC1 : 1;
5113 } __TX1STAbits_t;
5115 extern __at(0x0FAC) volatile __TX1STAbits_t TX1STAbits;
5117 #define _TX9D 0x01
5118 #define _TX9D1 0x01
5119 #define _TRMT 0x02
5120 #define _TRMT1 0x02
5121 #define _BRGH 0x04
5122 #define _BRGH1 0x04
5123 #define _SENDB 0x08
5124 #define _SENDB1 0x08
5125 #define _SYNC 0x10
5126 #define _SYNC1 0x10
5127 #define _TXEN 0x20
5128 #define _TXEN1 0x20
5129 #define _TX9 0x40
5130 #define _TX91 0x40
5131 #define _CSRC 0x80
5132 #define _CSRC1 0x80
5134 //==============================================================================
5137 //==============================================================================
5138 // TXSTA Bits
5140 extern __at(0x0FAC) __sfr TXSTA;
5142 typedef union
5144 struct
5146 unsigned TX9D : 1;
5147 unsigned TRMT : 1;
5148 unsigned BRGH : 1;
5149 unsigned SENDB : 1;
5150 unsigned SYNC : 1;
5151 unsigned TXEN : 1;
5152 unsigned TX9 : 1;
5153 unsigned CSRC : 1;
5156 struct
5158 unsigned TX9D1 : 1;
5159 unsigned TRMT1 : 1;
5160 unsigned BRGH1 : 1;
5161 unsigned SENDB1 : 1;
5162 unsigned SYNC1 : 1;
5163 unsigned TXEN1 : 1;
5164 unsigned TX91 : 1;
5165 unsigned CSRC1 : 1;
5167 } __TXSTAbits_t;
5169 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
5171 #define _TXSTA_TX9D 0x01
5172 #define _TXSTA_TX9D1 0x01
5173 #define _TXSTA_TRMT 0x02
5174 #define _TXSTA_TRMT1 0x02
5175 #define _TXSTA_BRGH 0x04
5176 #define _TXSTA_BRGH1 0x04
5177 #define _TXSTA_SENDB 0x08
5178 #define _TXSTA_SENDB1 0x08
5179 #define _TXSTA_SYNC 0x10
5180 #define _TXSTA_SYNC1 0x10
5181 #define _TXSTA_TXEN 0x20
5182 #define _TXSTA_TXEN1 0x20
5183 #define _TXSTA_TX9 0x40
5184 #define _TXSTA_TX91 0x40
5185 #define _TXSTA_CSRC 0x80
5186 #define _TXSTA_CSRC1 0x80
5188 //==============================================================================
5191 //==============================================================================
5192 // TXSTA1 Bits
5194 extern __at(0x0FAC) __sfr TXSTA1;
5196 typedef union
5198 struct
5200 unsigned TX9D : 1;
5201 unsigned TRMT : 1;
5202 unsigned BRGH : 1;
5203 unsigned SENDB : 1;
5204 unsigned SYNC : 1;
5205 unsigned TXEN : 1;
5206 unsigned TX9 : 1;
5207 unsigned CSRC : 1;
5210 struct
5212 unsigned TX9D1 : 1;
5213 unsigned TRMT1 : 1;
5214 unsigned BRGH1 : 1;
5215 unsigned SENDB1 : 1;
5216 unsigned SYNC1 : 1;
5217 unsigned TXEN1 : 1;
5218 unsigned TX91 : 1;
5219 unsigned CSRC1 : 1;
5221 } __TXSTA1bits_t;
5223 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
5225 #define _TXSTA1_TX9D 0x01
5226 #define _TXSTA1_TX9D1 0x01
5227 #define _TXSTA1_TRMT 0x02
5228 #define _TXSTA1_TRMT1 0x02
5229 #define _TXSTA1_BRGH 0x04
5230 #define _TXSTA1_BRGH1 0x04
5231 #define _TXSTA1_SENDB 0x08
5232 #define _TXSTA1_SENDB1 0x08
5233 #define _TXSTA1_SYNC 0x10
5234 #define _TXSTA1_SYNC1 0x10
5235 #define _TXSTA1_TXEN 0x20
5236 #define _TXSTA1_TXEN1 0x20
5237 #define _TXSTA1_TX9 0x40
5238 #define _TXSTA1_TX91 0x40
5239 #define _TXSTA1_CSRC 0x80
5240 #define _TXSTA1_CSRC1 0x80
5242 //==============================================================================
5244 extern __at(0x0FAD) __sfr TX1REG;
5245 extern __at(0x0FAD) __sfr TXREG;
5246 extern __at(0x0FAD) __sfr TXREG1;
5247 extern __at(0x0FAE) __sfr RC1REG;
5248 extern __at(0x0FAE) __sfr RCREG;
5249 extern __at(0x0FAE) __sfr RCREG1;
5250 extern __at(0x0FAF) __sfr SP1BRG;
5251 extern __at(0x0FAF) __sfr SPBRG;
5252 extern __at(0x0FAF) __sfr SPBRG1;
5253 extern __at(0x0FB0) __sfr SP1BRGH;
5254 extern __at(0x0FB0) __sfr SPBRGH;
5255 extern __at(0x0FB0) __sfr SPBRGH1;
5257 //==============================================================================
5258 // T3CON Bits
5260 extern __at(0x0FB1) __sfr T3CON;
5262 typedef union
5264 struct
5266 unsigned TMR3ON : 1;
5267 unsigned T3RD16 : 1;
5268 unsigned NOT_T3SYNC : 1;
5269 unsigned T3SOSCEN : 1;
5270 unsigned T3CKPS0 : 1;
5271 unsigned T3CKPS1 : 1;
5272 unsigned TMR3CS0 : 1;
5273 unsigned TMR3CS1 : 1;
5276 struct
5278 unsigned : 1;
5279 unsigned : 1;
5280 unsigned : 1;
5281 unsigned T3OSCEN : 1;
5282 unsigned : 1;
5283 unsigned : 1;
5284 unsigned : 1;
5285 unsigned : 1;
5288 struct
5290 unsigned : 4;
5291 unsigned T3CKPS : 2;
5292 unsigned : 2;
5295 struct
5297 unsigned : 6;
5298 unsigned TMR3CS : 2;
5300 } __T3CONbits_t;
5302 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
5304 #define _TMR3ON 0x01
5305 #define _T3RD16 0x02
5306 #define _NOT_T3SYNC 0x04
5307 #define _T3SOSCEN 0x08
5308 #define _T3OSCEN 0x08
5309 #define _T3CKPS0 0x10
5310 #define _T3CKPS1 0x20
5311 #define _TMR3CS0 0x40
5312 #define _TMR3CS1 0x80
5314 //==============================================================================
5316 extern __at(0x0FB2) __sfr TMR3;
5317 extern __at(0x0FB2) __sfr TMR3L;
5318 extern __at(0x0FB3) __sfr TMR3H;
5320 //==============================================================================
5321 // T3GCON Bits
5323 extern __at(0x0FB4) __sfr T3GCON;
5325 typedef union
5327 struct
5329 unsigned T3GSS0 : 1;
5330 unsigned T3GSS1 : 1;
5331 unsigned T3GVAL : 1;
5332 unsigned T3GGO_NOT_DONE : 1;
5333 unsigned T3GSPM : 1;
5334 unsigned T3GTM : 1;
5335 unsigned T3GPOL : 1;
5336 unsigned TMR3GE : 1;
5339 struct
5341 unsigned : 1;
5342 unsigned : 1;
5343 unsigned : 1;
5344 unsigned T3G_DONE : 1;
5345 unsigned : 1;
5346 unsigned : 1;
5347 unsigned : 1;
5348 unsigned : 1;
5351 struct
5353 unsigned : 1;
5354 unsigned : 1;
5355 unsigned : 1;
5356 unsigned T3GGO : 1;
5357 unsigned : 1;
5358 unsigned : 1;
5359 unsigned : 1;
5360 unsigned : 1;
5363 struct
5365 unsigned T3GSS : 2;
5366 unsigned : 6;
5368 } __T3GCONbits_t;
5370 extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits;
5372 #define _T3GSS0 0x01
5373 #define _T3GSS1 0x02
5374 #define _T3GVAL 0x04
5375 #define _T3GGO_NOT_DONE 0x08
5376 #define _T3G_DONE 0x08
5377 #define _T3GGO 0x08
5378 #define _T3GSPM 0x10
5379 #define _T3GTM 0x20
5380 #define _T3GPOL 0x40
5381 #define _TMR3GE 0x80
5383 //==============================================================================
5386 //==============================================================================
5387 // ECCP1AS Bits
5389 extern __at(0x0FB6) __sfr ECCP1AS;
5391 typedef union
5393 struct
5395 unsigned P1SSBD0 : 1;
5396 unsigned P1SSBD1 : 1;
5397 unsigned P1SSAC0 : 1;
5398 unsigned P1SSAC1 : 1;
5399 unsigned CCP1AS0 : 1;
5400 unsigned CCP1AS1 : 1;
5401 unsigned CCP1AS2 : 1;
5402 unsigned CCP1ASE : 1;
5405 struct
5407 unsigned PSS1BD0 : 1;
5408 unsigned PSS1BD1 : 1;
5409 unsigned PSS1AC0 : 1;
5410 unsigned PSS1AC1 : 1;
5411 unsigned ECCPAS0 : 1;
5412 unsigned ECCPAS1 : 1;
5413 unsigned ECCPAS2 : 1;
5414 unsigned ECCPASE : 1;
5417 struct
5419 unsigned PSSBD0 : 1;
5420 unsigned PSSBD1 : 1;
5421 unsigned PSSAC0 : 1;
5422 unsigned PSSAC1 : 1;
5423 unsigned : 1;
5424 unsigned : 1;
5425 unsigned : 1;
5426 unsigned : 1;
5429 struct
5431 unsigned P1SSBD : 2;
5432 unsigned : 6;
5435 struct
5437 unsigned PSSBD : 2;
5438 unsigned : 6;
5441 struct
5443 unsigned PSS1BD : 2;
5444 unsigned : 6;
5447 struct
5449 unsigned : 2;
5450 unsigned P1SSAC : 2;
5451 unsigned : 4;
5454 struct
5456 unsigned : 2;
5457 unsigned PSS1AC : 2;
5458 unsigned : 4;
5461 struct
5463 unsigned : 2;
5464 unsigned PSSAC : 2;
5465 unsigned : 4;
5468 struct
5470 unsigned : 4;
5471 unsigned ECCPAS : 3;
5472 unsigned : 1;
5475 struct
5477 unsigned : 4;
5478 unsigned CCP1AS : 3;
5479 unsigned : 1;
5481 } __ECCP1ASbits_t;
5483 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
5485 #define _P1SSBD0 0x01
5486 #define _PSS1BD0 0x01
5487 #define _PSSBD0 0x01
5488 #define _P1SSBD1 0x02
5489 #define _PSS1BD1 0x02
5490 #define _PSSBD1 0x02
5491 #define _P1SSAC0 0x04
5492 #define _PSS1AC0 0x04
5493 #define _PSSAC0 0x04
5494 #define _P1SSAC1 0x08
5495 #define _PSS1AC1 0x08
5496 #define _PSSAC1 0x08
5497 #define _CCP1AS0 0x10
5498 #define _ECCPAS0 0x10
5499 #define _CCP1AS1 0x20
5500 #define _ECCPAS1 0x20
5501 #define _CCP1AS2 0x40
5502 #define _ECCPAS2 0x40
5503 #define _CCP1ASE 0x80
5504 #define _ECCPASE 0x80
5506 //==============================================================================
5509 //==============================================================================
5510 // ECCPAS Bits
5512 extern __at(0x0FB6) __sfr ECCPAS;
5514 typedef union
5516 struct
5518 unsigned P1SSBD0 : 1;
5519 unsigned P1SSBD1 : 1;
5520 unsigned P1SSAC0 : 1;
5521 unsigned P1SSAC1 : 1;
5522 unsigned CCP1AS0 : 1;
5523 unsigned CCP1AS1 : 1;
5524 unsigned CCP1AS2 : 1;
5525 unsigned CCP1ASE : 1;
5528 struct
5530 unsigned PSS1BD0 : 1;
5531 unsigned PSS1BD1 : 1;
5532 unsigned PSS1AC0 : 1;
5533 unsigned PSS1AC1 : 1;
5534 unsigned ECCPAS0 : 1;
5535 unsigned ECCPAS1 : 1;
5536 unsigned ECCPAS2 : 1;
5537 unsigned ECCPASE : 1;
5540 struct
5542 unsigned PSSBD0 : 1;
5543 unsigned PSSBD1 : 1;
5544 unsigned PSSAC0 : 1;
5545 unsigned PSSAC1 : 1;
5546 unsigned : 1;
5547 unsigned : 1;
5548 unsigned : 1;
5549 unsigned : 1;
5552 struct
5554 unsigned PSS1BD : 2;
5555 unsigned : 6;
5558 struct
5560 unsigned PSSBD : 2;
5561 unsigned : 6;
5564 struct
5566 unsigned P1SSBD : 2;
5567 unsigned : 6;
5570 struct
5572 unsigned : 2;
5573 unsigned PSSAC : 2;
5574 unsigned : 4;
5577 struct
5579 unsigned : 2;
5580 unsigned PSS1AC : 2;
5581 unsigned : 4;
5584 struct
5586 unsigned : 2;
5587 unsigned P1SSAC : 2;
5588 unsigned : 4;
5591 struct
5593 unsigned : 4;
5594 unsigned CCP1AS : 3;
5595 unsigned : 1;
5598 struct
5600 unsigned : 4;
5601 unsigned ECCPAS : 3;
5602 unsigned : 1;
5604 } __ECCPASbits_t;
5606 extern __at(0x0FB6) volatile __ECCPASbits_t ECCPASbits;
5608 #define _ECCPAS_P1SSBD0 0x01
5609 #define _ECCPAS_PSS1BD0 0x01
5610 #define _ECCPAS_PSSBD0 0x01
5611 #define _ECCPAS_P1SSBD1 0x02
5612 #define _ECCPAS_PSS1BD1 0x02
5613 #define _ECCPAS_PSSBD1 0x02
5614 #define _ECCPAS_P1SSAC0 0x04
5615 #define _ECCPAS_PSS1AC0 0x04
5616 #define _ECCPAS_PSSAC0 0x04
5617 #define _ECCPAS_P1SSAC1 0x08
5618 #define _ECCPAS_PSS1AC1 0x08
5619 #define _ECCPAS_PSSAC1 0x08
5620 #define _ECCPAS_CCP1AS0 0x10
5621 #define _ECCPAS_ECCPAS0 0x10
5622 #define _ECCPAS_CCP1AS1 0x20
5623 #define _ECCPAS_ECCPAS1 0x20
5624 #define _ECCPAS_CCP1AS2 0x40
5625 #define _ECCPAS_ECCPAS2 0x40
5626 #define _ECCPAS_CCP1ASE 0x80
5627 #define _ECCPAS_ECCPASE 0x80
5629 //==============================================================================
5632 //==============================================================================
5633 // PWM1CON Bits
5635 extern __at(0x0FB7) __sfr PWM1CON;
5637 typedef union
5639 struct
5641 unsigned P1DC0 : 1;
5642 unsigned P1DC1 : 1;
5643 unsigned P1DC2 : 1;
5644 unsigned P1DC3 : 1;
5645 unsigned P1DC4 : 1;
5646 unsigned P1DC5 : 1;
5647 unsigned P1DC6 : 1;
5648 unsigned P1RSEN : 1;
5651 struct
5653 unsigned PDC0 : 1;
5654 unsigned PDC1 : 1;
5655 unsigned PDC2 : 1;
5656 unsigned PDC3 : 1;
5657 unsigned PDC4 : 1;
5658 unsigned PDC5 : 1;
5659 unsigned PDC6 : 1;
5660 unsigned PRSEN : 1;
5663 struct
5665 unsigned PDC : 7;
5666 unsigned : 1;
5669 struct
5671 unsigned P1DC : 7;
5672 unsigned : 1;
5674 } __PWM1CONbits_t;
5676 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
5678 #define _P1DC0 0x01
5679 #define _PDC0 0x01
5680 #define _P1DC1 0x02
5681 #define _PDC1 0x02
5682 #define _P1DC2 0x04
5683 #define _PDC2 0x04
5684 #define _P1DC3 0x08
5685 #define _PDC3 0x08
5686 #define _P1DC4 0x10
5687 #define _PDC4 0x10
5688 #define _P1DC5 0x20
5689 #define _PDC5 0x20
5690 #define _P1DC6 0x40
5691 #define _PDC6 0x40
5692 #define _P1RSEN 0x80
5693 #define _PRSEN 0x80
5695 //==============================================================================
5698 //==============================================================================
5699 // PWMCON Bits
5701 extern __at(0x0FB7) __sfr PWMCON;
5703 typedef union
5705 struct
5707 unsigned P1DC0 : 1;
5708 unsigned P1DC1 : 1;
5709 unsigned P1DC2 : 1;
5710 unsigned P1DC3 : 1;
5711 unsigned P1DC4 : 1;
5712 unsigned P1DC5 : 1;
5713 unsigned P1DC6 : 1;
5714 unsigned P1RSEN : 1;
5717 struct
5719 unsigned PDC0 : 1;
5720 unsigned PDC1 : 1;
5721 unsigned PDC2 : 1;
5722 unsigned PDC3 : 1;
5723 unsigned PDC4 : 1;
5724 unsigned PDC5 : 1;
5725 unsigned PDC6 : 1;
5726 unsigned PRSEN : 1;
5729 struct
5731 unsigned P1DC : 7;
5732 unsigned : 1;
5735 struct
5737 unsigned PDC : 7;
5738 unsigned : 1;
5740 } __PWMCONbits_t;
5742 extern __at(0x0FB7) volatile __PWMCONbits_t PWMCONbits;
5744 #define _PWMCON_P1DC0 0x01
5745 #define _PWMCON_PDC0 0x01
5746 #define _PWMCON_P1DC1 0x02
5747 #define _PWMCON_PDC1 0x02
5748 #define _PWMCON_P1DC2 0x04
5749 #define _PWMCON_PDC2 0x04
5750 #define _PWMCON_P1DC3 0x08
5751 #define _PWMCON_PDC3 0x08
5752 #define _PWMCON_P1DC4 0x10
5753 #define _PWMCON_PDC4 0x10
5754 #define _PWMCON_P1DC5 0x20
5755 #define _PWMCON_PDC5 0x20
5756 #define _PWMCON_P1DC6 0x40
5757 #define _PWMCON_PDC6 0x40
5758 #define _PWMCON_P1RSEN 0x80
5759 #define _PWMCON_PRSEN 0x80
5761 //==============================================================================
5764 //==============================================================================
5765 // BAUD1CON Bits
5767 extern __at(0x0FB8) __sfr BAUD1CON;
5769 typedef union
5771 struct
5773 unsigned ABDEN : 1;
5774 unsigned WUE : 1;
5775 unsigned : 1;
5776 unsigned BRG16 : 1;
5777 unsigned CKTXP : 1;
5778 unsigned DTRXP : 1;
5779 unsigned RCIDL : 1;
5780 unsigned ABDOVF : 1;
5783 struct
5785 unsigned : 1;
5786 unsigned : 1;
5787 unsigned : 1;
5788 unsigned : 1;
5789 unsigned SCKP : 1;
5790 unsigned : 1;
5791 unsigned : 1;
5792 unsigned : 1;
5794 } __BAUD1CONbits_t;
5796 extern __at(0x0FB8) volatile __BAUD1CONbits_t BAUD1CONbits;
5798 #define _ABDEN 0x01
5799 #define _WUE 0x02
5800 #define _BRG16 0x08
5801 #define _CKTXP 0x10
5802 #define _SCKP 0x10
5803 #define _DTRXP 0x20
5804 #define _RCIDL 0x40
5805 #define _ABDOVF 0x80
5807 //==============================================================================
5810 //==============================================================================
5811 // BAUDCON Bits
5813 extern __at(0x0FB8) __sfr BAUDCON;
5815 typedef union
5817 struct
5819 unsigned ABDEN : 1;
5820 unsigned WUE : 1;
5821 unsigned : 1;
5822 unsigned BRG16 : 1;
5823 unsigned CKTXP : 1;
5824 unsigned DTRXP : 1;
5825 unsigned RCIDL : 1;
5826 unsigned ABDOVF : 1;
5829 struct
5831 unsigned : 1;
5832 unsigned : 1;
5833 unsigned : 1;
5834 unsigned : 1;
5835 unsigned SCKP : 1;
5836 unsigned : 1;
5837 unsigned : 1;
5838 unsigned : 1;
5840 } __BAUDCONbits_t;
5842 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
5844 #define _BAUDCON_ABDEN 0x01
5845 #define _BAUDCON_WUE 0x02
5846 #define _BAUDCON_BRG16 0x08
5847 #define _BAUDCON_CKTXP 0x10
5848 #define _BAUDCON_SCKP 0x10
5849 #define _BAUDCON_DTRXP 0x20
5850 #define _BAUDCON_RCIDL 0x40
5851 #define _BAUDCON_ABDOVF 0x80
5853 //==============================================================================
5856 //==============================================================================
5857 // BAUDCON1 Bits
5859 extern __at(0x0FB8) __sfr BAUDCON1;
5861 typedef union
5863 struct
5865 unsigned ABDEN : 1;
5866 unsigned WUE : 1;
5867 unsigned : 1;
5868 unsigned BRG16 : 1;
5869 unsigned CKTXP : 1;
5870 unsigned DTRXP : 1;
5871 unsigned RCIDL : 1;
5872 unsigned ABDOVF : 1;
5875 struct
5877 unsigned : 1;
5878 unsigned : 1;
5879 unsigned : 1;
5880 unsigned : 1;
5881 unsigned SCKP : 1;
5882 unsigned : 1;
5883 unsigned : 1;
5884 unsigned : 1;
5886 } __BAUDCON1bits_t;
5888 extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits;
5890 #define _BAUDCON1_ABDEN 0x01
5891 #define _BAUDCON1_WUE 0x02
5892 #define _BAUDCON1_BRG16 0x08
5893 #define _BAUDCON1_CKTXP 0x10
5894 #define _BAUDCON1_SCKP 0x10
5895 #define _BAUDCON1_DTRXP 0x20
5896 #define _BAUDCON1_RCIDL 0x40
5897 #define _BAUDCON1_ABDOVF 0x80
5899 //==============================================================================
5902 //==============================================================================
5903 // BAUDCTL Bits
5905 extern __at(0x0FB8) __sfr BAUDCTL;
5907 typedef union
5909 struct
5911 unsigned ABDEN : 1;
5912 unsigned WUE : 1;
5913 unsigned : 1;
5914 unsigned BRG16 : 1;
5915 unsigned CKTXP : 1;
5916 unsigned DTRXP : 1;
5917 unsigned RCIDL : 1;
5918 unsigned ABDOVF : 1;
5921 struct
5923 unsigned : 1;
5924 unsigned : 1;
5925 unsigned : 1;
5926 unsigned : 1;
5927 unsigned SCKP : 1;
5928 unsigned : 1;
5929 unsigned : 1;
5930 unsigned : 1;
5932 } __BAUDCTLbits_t;
5934 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
5936 #define _BAUDCTL_ABDEN 0x01
5937 #define _BAUDCTL_WUE 0x02
5938 #define _BAUDCTL_BRG16 0x08
5939 #define _BAUDCTL_CKTXP 0x10
5940 #define _BAUDCTL_SCKP 0x10
5941 #define _BAUDCTL_DTRXP 0x20
5942 #define _BAUDCTL_RCIDL 0x40
5943 #define _BAUDCTL_ABDOVF 0x80
5945 //==============================================================================
5948 //==============================================================================
5949 // PSTR1CON Bits
5951 extern __at(0x0FB9) __sfr PSTR1CON;
5953 typedef struct
5955 unsigned STR1A : 1;
5956 unsigned STR1B : 1;
5957 unsigned STR1C : 1;
5958 unsigned STR1D : 1;
5959 unsigned STR1SYNC : 1;
5960 unsigned : 1;
5961 unsigned : 1;
5962 unsigned : 1;
5963 } __PSTR1CONbits_t;
5965 extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits;
5967 #define _STR1A 0x01
5968 #define _STR1B 0x02
5969 #define _STR1C 0x04
5970 #define _STR1D 0x08
5971 #define _STR1SYNC 0x10
5973 //==============================================================================
5976 //==============================================================================
5977 // PSTRCON Bits
5979 extern __at(0x0FB9) __sfr PSTRCON;
5981 typedef struct
5983 unsigned STR1A : 1;
5984 unsigned STR1B : 1;
5985 unsigned STR1C : 1;
5986 unsigned STR1D : 1;
5987 unsigned STR1SYNC : 1;
5988 unsigned : 1;
5989 unsigned : 1;
5990 unsigned : 1;
5991 } __PSTRCONbits_t;
5993 extern __at(0x0FB9) volatile __PSTRCONbits_t PSTRCONbits;
5995 #define _PSTRCON_STR1A 0x01
5996 #define _PSTRCON_STR1B 0x02
5997 #define _PSTRCON_STR1C 0x04
5998 #define _PSTRCON_STR1D 0x08
5999 #define _PSTRCON_STR1SYNC 0x10
6001 //==============================================================================
6004 //==============================================================================
6005 // T2CON Bits
6007 extern __at(0x0FBA) __sfr T2CON;
6009 typedef union
6011 struct
6013 unsigned T2CKPS0 : 1;
6014 unsigned T2CKPS1 : 1;
6015 unsigned TMR2ON : 1;
6016 unsigned T2OUTPS0 : 1;
6017 unsigned T2OUTPS1 : 1;
6018 unsigned T2OUTPS2 : 1;
6019 unsigned T2OUTPS3 : 1;
6020 unsigned : 1;
6023 struct
6025 unsigned T2CKPS : 2;
6026 unsigned : 6;
6029 struct
6031 unsigned : 3;
6032 unsigned T2OUTPS : 4;
6033 unsigned : 1;
6035 } __T2CONbits_t;
6037 extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits;
6039 #define _T2CKPS0 0x01
6040 #define _T2CKPS1 0x02
6041 #define _TMR2ON 0x04
6042 #define _T2OUTPS0 0x08
6043 #define _T2OUTPS1 0x10
6044 #define _T2OUTPS2 0x20
6045 #define _T2OUTPS3 0x40
6047 //==============================================================================
6049 extern __at(0x0FBB) __sfr PR2;
6050 extern __at(0x0FBC) __sfr TMR2;
6052 //==============================================================================
6053 // CCP1CON Bits
6055 extern __at(0x0FBD) __sfr CCP1CON;
6057 typedef union
6059 struct
6061 unsigned CCP1M0 : 1;
6062 unsigned CCP1M1 : 1;
6063 unsigned CCP1M2 : 1;
6064 unsigned CCP1M3 : 1;
6065 unsigned DC1B0 : 1;
6066 unsigned DC1B1 : 1;
6067 unsigned P1M0 : 1;
6068 unsigned P1M1 : 1;
6071 struct
6073 unsigned CCP1M : 4;
6074 unsigned : 4;
6077 struct
6079 unsigned : 4;
6080 unsigned DC1B : 2;
6081 unsigned : 2;
6084 struct
6086 unsigned : 6;
6087 unsigned P1M : 2;
6089 } __CCP1CONbits_t;
6091 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
6093 #define _CCP1M0 0x01
6094 #define _CCP1M1 0x02
6095 #define _CCP1M2 0x04
6096 #define _CCP1M3 0x08
6097 #define _DC1B0 0x10
6098 #define _DC1B1 0x20
6099 #define _P1M0 0x40
6100 #define _P1M1 0x80
6102 //==============================================================================
6104 extern __at(0x0FBE) __sfr CCPR1;
6105 extern __at(0x0FBE) __sfr CCPR1L;
6106 extern __at(0x0FBF) __sfr CCPR1H;
6108 //==============================================================================
6109 // ADCON2 Bits
6111 extern __at(0x0FC0) __sfr ADCON2;
6113 typedef union
6115 struct
6117 unsigned ADCS0 : 1;
6118 unsigned ADCS1 : 1;
6119 unsigned ADCS2 : 1;
6120 unsigned ACQT0 : 1;
6121 unsigned ACQT1 : 1;
6122 unsigned ACQT2 : 1;
6123 unsigned : 1;
6124 unsigned ADFM : 1;
6127 struct
6129 unsigned ADCS : 3;
6130 unsigned : 5;
6133 struct
6135 unsigned : 3;
6136 unsigned ACQT : 3;
6137 unsigned : 2;
6139 } __ADCON2bits_t;
6141 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
6143 #define _ADCS0 0x01
6144 #define _ADCS1 0x02
6145 #define _ADCS2 0x04
6146 #define _ACQT0 0x08
6147 #define _ACQT1 0x10
6148 #define _ACQT2 0x20
6149 #define _ADFM 0x80
6151 //==============================================================================
6154 //==============================================================================
6155 // ADCON1 Bits
6157 extern __at(0x0FC1) __sfr ADCON1;
6159 typedef union
6161 struct
6163 unsigned NVCFG0 : 1;
6164 unsigned NVCFG1 : 1;
6165 unsigned PVCFG0 : 1;
6166 unsigned PVCFG1 : 1;
6167 unsigned : 1;
6168 unsigned : 1;
6169 unsigned : 1;
6170 unsigned TRIGSEL : 1;
6173 struct
6175 unsigned NVCFG : 2;
6176 unsigned : 6;
6179 struct
6181 unsigned : 2;
6182 unsigned PVCFG : 2;
6183 unsigned : 4;
6185 } __ADCON1bits_t;
6187 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
6189 #define _NVCFG0 0x01
6190 #define _NVCFG1 0x02
6191 #define _PVCFG0 0x04
6192 #define _PVCFG1 0x08
6193 #define _TRIGSEL 0x80
6195 //==============================================================================
6198 //==============================================================================
6199 // ADCON0 Bits
6201 extern __at(0x0FC2) __sfr ADCON0;
6203 typedef union
6205 struct
6207 unsigned ADON : 1;
6208 unsigned GO_NOT_DONE : 1;
6209 unsigned CHS0 : 1;
6210 unsigned CHS1 : 1;
6211 unsigned CHS2 : 1;
6212 unsigned CHS3 : 1;
6213 unsigned CHS4 : 1;
6214 unsigned : 1;
6217 struct
6219 unsigned : 1;
6220 unsigned GO : 1;
6221 unsigned : 1;
6222 unsigned : 1;
6223 unsigned : 1;
6224 unsigned : 1;
6225 unsigned : 1;
6226 unsigned : 1;
6229 struct
6231 unsigned : 1;
6232 unsigned DONE : 1;
6233 unsigned : 1;
6234 unsigned : 1;
6235 unsigned : 1;
6236 unsigned : 1;
6237 unsigned : 1;
6238 unsigned : 1;
6241 struct
6243 unsigned : 1;
6244 unsigned NOT_DONE : 1;
6245 unsigned : 1;
6246 unsigned : 1;
6247 unsigned : 1;
6248 unsigned : 1;
6249 unsigned : 1;
6250 unsigned : 1;
6253 struct
6255 unsigned : 1;
6256 unsigned GO_DONE : 1;
6257 unsigned : 1;
6258 unsigned : 1;
6259 unsigned : 1;
6260 unsigned : 1;
6261 unsigned : 1;
6262 unsigned : 1;
6265 struct
6267 unsigned : 2;
6268 unsigned CHS : 5;
6269 unsigned : 1;
6271 } __ADCON0bits_t;
6273 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
6275 #define _ADON 0x01
6276 #define _GO_NOT_DONE 0x02
6277 #define _GO 0x02
6278 #define _DONE 0x02
6279 #define _NOT_DONE 0x02
6280 #define _GO_DONE 0x02
6281 #define _CHS0 0x04
6282 #define _CHS1 0x08
6283 #define _CHS2 0x10
6284 #define _CHS3 0x20
6285 #define _CHS4 0x40
6287 //==============================================================================
6289 extern __at(0x0FC3) __sfr ADRES;
6290 extern __at(0x0FC3) __sfr ADRESL;
6291 extern __at(0x0FC4) __sfr ADRESH;
6293 //==============================================================================
6294 // SSP1CON2 Bits
6296 extern __at(0x0FC5) __sfr SSP1CON2;
6298 typedef struct
6300 unsigned SEN : 1;
6301 unsigned RSEN : 1;
6302 unsigned PEN : 1;
6303 unsigned RCEN : 1;
6304 unsigned ACKEN : 1;
6305 unsigned ACKDT : 1;
6306 unsigned ACKSTAT : 1;
6307 unsigned GCEN : 1;
6308 } __SSP1CON2bits_t;
6310 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
6312 #define _SEN 0x01
6313 #define _RSEN 0x02
6314 #define _PEN 0x04
6315 #define _RCEN 0x08
6316 #define _ACKEN 0x10
6317 #define _ACKDT 0x20
6318 #define _ACKSTAT 0x40
6319 #define _GCEN 0x80
6321 //==============================================================================
6324 //==============================================================================
6325 // SSPCON2 Bits
6327 extern __at(0x0FC5) __sfr SSPCON2;
6329 typedef struct
6331 unsigned SEN : 1;
6332 unsigned RSEN : 1;
6333 unsigned PEN : 1;
6334 unsigned RCEN : 1;
6335 unsigned ACKEN : 1;
6336 unsigned ACKDT : 1;
6337 unsigned ACKSTAT : 1;
6338 unsigned GCEN : 1;
6339 } __SSPCON2bits_t;
6341 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
6343 #define _SSPCON2_SEN 0x01
6344 #define _SSPCON2_RSEN 0x02
6345 #define _SSPCON2_PEN 0x04
6346 #define _SSPCON2_RCEN 0x08
6347 #define _SSPCON2_ACKEN 0x10
6348 #define _SSPCON2_ACKDT 0x20
6349 #define _SSPCON2_ACKSTAT 0x40
6350 #define _SSPCON2_GCEN 0x80
6352 //==============================================================================
6355 //==============================================================================
6356 // SSP1CON1 Bits
6358 extern __at(0x0FC6) __sfr SSP1CON1;
6360 typedef union
6362 struct
6364 unsigned SSPM0 : 1;
6365 unsigned SSPM1 : 1;
6366 unsigned SSPM2 : 1;
6367 unsigned SSPM3 : 1;
6368 unsigned CKP : 1;
6369 unsigned SSPEN : 1;
6370 unsigned SSPOV : 1;
6371 unsigned WCOL : 1;
6374 struct
6376 unsigned SSPM : 4;
6377 unsigned : 4;
6379 } __SSP1CON1bits_t;
6381 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
6383 #define _SSPM0 0x01
6384 #define _SSPM1 0x02
6385 #define _SSPM2 0x04
6386 #define _SSPM3 0x08
6387 #define _CKP 0x10
6388 #define _SSPEN 0x20
6389 #define _SSPOV 0x40
6390 #define _WCOL 0x80
6392 //==============================================================================
6395 //==============================================================================
6396 // SSPCON1 Bits
6398 extern __at(0x0FC6) __sfr SSPCON1;
6400 typedef union
6402 struct
6404 unsigned SSPM0 : 1;
6405 unsigned SSPM1 : 1;
6406 unsigned SSPM2 : 1;
6407 unsigned SSPM3 : 1;
6408 unsigned CKP : 1;
6409 unsigned SSPEN : 1;
6410 unsigned SSPOV : 1;
6411 unsigned WCOL : 1;
6414 struct
6416 unsigned SSPM : 4;
6417 unsigned : 4;
6419 } __SSPCON1bits_t;
6421 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
6423 #define _SSPCON1_SSPM0 0x01
6424 #define _SSPCON1_SSPM1 0x02
6425 #define _SSPCON1_SSPM2 0x04
6426 #define _SSPCON1_SSPM3 0x08
6427 #define _SSPCON1_CKP 0x10
6428 #define _SSPCON1_SSPEN 0x20
6429 #define _SSPCON1_SSPOV 0x40
6430 #define _SSPCON1_WCOL 0x80
6432 //==============================================================================
6435 //==============================================================================
6436 // SSP1STAT Bits
6438 extern __at(0x0FC7) __sfr SSP1STAT;
6440 typedef union
6442 struct
6444 unsigned BF : 1;
6445 unsigned UA : 1;
6446 unsigned R_NOT_W : 1;
6447 unsigned S : 1;
6448 unsigned P : 1;
6449 unsigned D_NOT_A : 1;
6450 unsigned CKE : 1;
6451 unsigned SMP : 1;
6454 struct
6456 unsigned : 1;
6457 unsigned : 1;
6458 unsigned R : 1;
6459 unsigned : 1;
6460 unsigned : 1;
6461 unsigned D : 1;
6462 unsigned : 1;
6463 unsigned : 1;
6466 struct
6468 unsigned : 1;
6469 unsigned : 1;
6470 unsigned NOT_W : 1;
6471 unsigned : 1;
6472 unsigned : 1;
6473 unsigned NOT_A : 1;
6474 unsigned : 1;
6475 unsigned : 1;
6478 struct
6480 unsigned : 1;
6481 unsigned : 1;
6482 unsigned R_W : 1;
6483 unsigned : 1;
6484 unsigned : 1;
6485 unsigned D_A : 1;
6486 unsigned : 1;
6487 unsigned : 1;
6490 struct
6492 unsigned : 1;
6493 unsigned : 1;
6494 unsigned NOT_WRITE : 1;
6495 unsigned : 1;
6496 unsigned : 1;
6497 unsigned NOT_ADDRESS : 1;
6498 unsigned : 1;
6499 unsigned : 1;
6501 } __SSP1STATbits_t;
6503 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
6505 #define _BF 0x01
6506 #define _UA 0x02
6507 #define _R_NOT_W 0x04
6508 #define _R 0x04
6509 #define _NOT_W 0x04
6510 #define _R_W 0x04
6511 #define _NOT_WRITE 0x04
6512 #define _S 0x08
6513 #define _P 0x10
6514 #define _D_NOT_A 0x20
6515 #define _D 0x20
6516 #define _NOT_A 0x20
6517 #define _D_A 0x20
6518 #define _NOT_ADDRESS 0x20
6519 #define _CKE 0x40
6520 #define _SMP 0x80
6522 //==============================================================================
6525 //==============================================================================
6526 // SSPSTAT Bits
6528 extern __at(0x0FC7) __sfr SSPSTAT;
6530 typedef union
6532 struct
6534 unsigned BF : 1;
6535 unsigned UA : 1;
6536 unsigned R_NOT_W : 1;
6537 unsigned S : 1;
6538 unsigned P : 1;
6539 unsigned D_NOT_A : 1;
6540 unsigned CKE : 1;
6541 unsigned SMP : 1;
6544 struct
6546 unsigned : 1;
6547 unsigned : 1;
6548 unsigned R : 1;
6549 unsigned : 1;
6550 unsigned : 1;
6551 unsigned D : 1;
6552 unsigned : 1;
6553 unsigned : 1;
6556 struct
6558 unsigned : 1;
6559 unsigned : 1;
6560 unsigned NOT_W : 1;
6561 unsigned : 1;
6562 unsigned : 1;
6563 unsigned NOT_A : 1;
6564 unsigned : 1;
6565 unsigned : 1;
6568 struct
6570 unsigned : 1;
6571 unsigned : 1;
6572 unsigned R_W : 1;
6573 unsigned : 1;
6574 unsigned : 1;
6575 unsigned D_A : 1;
6576 unsigned : 1;
6577 unsigned : 1;
6580 struct
6582 unsigned : 1;
6583 unsigned : 1;
6584 unsigned NOT_WRITE : 1;
6585 unsigned : 1;
6586 unsigned : 1;
6587 unsigned NOT_ADDRESS : 1;
6588 unsigned : 1;
6589 unsigned : 1;
6591 } __SSPSTATbits_t;
6593 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
6595 #define _SSPSTAT_BF 0x01
6596 #define _SSPSTAT_UA 0x02
6597 #define _SSPSTAT_R_NOT_W 0x04
6598 #define _SSPSTAT_R 0x04
6599 #define _SSPSTAT_NOT_W 0x04
6600 #define _SSPSTAT_R_W 0x04
6601 #define _SSPSTAT_NOT_WRITE 0x04
6602 #define _SSPSTAT_S 0x08
6603 #define _SSPSTAT_P 0x10
6604 #define _SSPSTAT_D_NOT_A 0x20
6605 #define _SSPSTAT_D 0x20
6606 #define _SSPSTAT_NOT_A 0x20
6607 #define _SSPSTAT_D_A 0x20
6608 #define _SSPSTAT_NOT_ADDRESS 0x20
6609 #define _SSPSTAT_CKE 0x40
6610 #define _SSPSTAT_SMP 0x80
6612 //==============================================================================
6614 extern __at(0x0FC8) __sfr SSP1ADD;
6615 extern __at(0x0FC8) __sfr SSPADD;
6616 extern __at(0x0FC9) __sfr SSP1BUF;
6617 extern __at(0x0FC9) __sfr SSPBUF;
6619 //==============================================================================
6620 // SSP1MSK Bits
6622 extern __at(0x0FCA) __sfr SSP1MSK;
6624 typedef struct
6626 unsigned MSK0 : 1;
6627 unsigned MSK1 : 1;
6628 unsigned MSK2 : 1;
6629 unsigned MSK3 : 1;
6630 unsigned MSK4 : 1;
6631 unsigned MSK5 : 1;
6632 unsigned MSK6 : 1;
6633 unsigned MSK7 : 1;
6634 } __SSP1MSKbits_t;
6636 extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits;
6638 #define _MSK0 0x01
6639 #define _MSK1 0x02
6640 #define _MSK2 0x04
6641 #define _MSK3 0x08
6642 #define _MSK4 0x10
6643 #define _MSK5 0x20
6644 #define _MSK6 0x40
6645 #define _MSK7 0x80
6647 //==============================================================================
6650 //==============================================================================
6651 // SSPMSK Bits
6653 extern __at(0x0FCA) __sfr SSPMSK;
6655 typedef struct
6657 unsigned MSK0 : 1;
6658 unsigned MSK1 : 1;
6659 unsigned MSK2 : 1;
6660 unsigned MSK3 : 1;
6661 unsigned MSK4 : 1;
6662 unsigned MSK5 : 1;
6663 unsigned MSK6 : 1;
6664 unsigned MSK7 : 1;
6665 } __SSPMSKbits_t;
6667 extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits;
6669 #define _SSPMSK_MSK0 0x01
6670 #define _SSPMSK_MSK1 0x02
6671 #define _SSPMSK_MSK2 0x04
6672 #define _SSPMSK_MSK3 0x08
6673 #define _SSPMSK_MSK4 0x10
6674 #define _SSPMSK_MSK5 0x20
6675 #define _SSPMSK_MSK6 0x40
6676 #define _SSPMSK_MSK7 0x80
6678 //==============================================================================
6681 //==============================================================================
6682 // SSP1CON3 Bits
6684 extern __at(0x0FCB) __sfr SSP1CON3;
6686 typedef struct
6688 unsigned DHEN : 1;
6689 unsigned AHEN : 1;
6690 unsigned SBCDE : 1;
6691 unsigned SDAHT : 1;
6692 unsigned BOEN : 1;
6693 unsigned SCIE : 1;
6694 unsigned PCIE : 1;
6695 unsigned ACKTIM : 1;
6696 } __SSP1CON3bits_t;
6698 extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits;
6700 #define _DHEN 0x01
6701 #define _AHEN 0x02
6702 #define _SBCDE 0x04
6703 #define _SDAHT 0x08
6704 #define _BOEN 0x10
6705 #define _SCIE 0x20
6706 #define _PCIE 0x40
6707 #define _ACKTIM 0x80
6709 //==============================================================================
6712 //==============================================================================
6713 // SSPCON3 Bits
6715 extern __at(0x0FCB) __sfr SSPCON3;
6717 typedef struct
6719 unsigned DHEN : 1;
6720 unsigned AHEN : 1;
6721 unsigned SBCDE : 1;
6722 unsigned SDAHT : 1;
6723 unsigned BOEN : 1;
6724 unsigned SCIE : 1;
6725 unsigned PCIE : 1;
6726 unsigned ACKTIM : 1;
6727 } __SSPCON3bits_t;
6729 extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits;
6731 #define _SSPCON3_DHEN 0x01
6732 #define _SSPCON3_AHEN 0x02
6733 #define _SSPCON3_SBCDE 0x04
6734 #define _SSPCON3_SDAHT 0x08
6735 #define _SSPCON3_BOEN 0x10
6736 #define _SSPCON3_SCIE 0x20
6737 #define _SSPCON3_PCIE 0x40
6738 #define _SSPCON3_ACKTIM 0x80
6740 //==============================================================================
6743 //==============================================================================
6744 // T1GCON Bits
6746 extern __at(0x0FCC) __sfr T1GCON;
6748 typedef union
6750 struct
6752 unsigned T1GSS0 : 1;
6753 unsigned T1GSS1 : 1;
6754 unsigned T1GVAL : 1;
6755 unsigned T1GGO_NOT_DONE : 1;
6756 unsigned T1GSPM : 1;
6757 unsigned T1GTM : 1;
6758 unsigned T1GPOL : 1;
6759 unsigned TMR1GE : 1;
6762 struct
6764 unsigned : 1;
6765 unsigned : 1;
6766 unsigned : 1;
6767 unsigned T1G_DONE : 1;
6768 unsigned : 1;
6769 unsigned : 1;
6770 unsigned : 1;
6771 unsigned : 1;
6774 struct
6776 unsigned : 1;
6777 unsigned : 1;
6778 unsigned : 1;
6779 unsigned T1GGO : 1;
6780 unsigned : 1;
6781 unsigned : 1;
6782 unsigned : 1;
6783 unsigned : 1;
6786 struct
6788 unsigned T1GSS : 2;
6789 unsigned : 6;
6791 } __T1GCONbits_t;
6793 extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits;
6795 #define _T1GSS0 0x01
6796 #define _T1GSS1 0x02
6797 #define _T1GVAL 0x04
6798 #define _T1GGO_NOT_DONE 0x08
6799 #define _T1G_DONE 0x08
6800 #define _T1GGO 0x08
6801 #define _T1GSPM 0x10
6802 #define _T1GTM 0x20
6803 #define _T1GPOL 0x40
6804 #define _TMR1GE 0x80
6806 //==============================================================================
6809 //==============================================================================
6810 // T1CON Bits
6812 extern __at(0x0FCD) __sfr T1CON;
6814 typedef union
6816 struct
6818 unsigned TMR1ON : 1;
6819 unsigned T1RD16 : 1;
6820 unsigned NOT_T1SYNC : 1;
6821 unsigned T1SOSCEN : 1;
6822 unsigned T1CKPS0 : 1;
6823 unsigned T1CKPS1 : 1;
6824 unsigned TMR1CS0 : 1;
6825 unsigned TMR1CS1 : 1;
6828 struct
6830 unsigned : 1;
6831 unsigned RD16 : 1;
6832 unsigned T1SYNC : 1;
6833 unsigned T1OSCEN : 1;
6834 unsigned : 1;
6835 unsigned : 1;
6836 unsigned : 1;
6837 unsigned : 1;
6840 struct
6842 unsigned : 4;
6843 unsigned T1CKPS : 2;
6844 unsigned : 2;
6847 struct
6849 unsigned : 6;
6850 unsigned TMR1CS : 2;
6852 } __T1CONbits_t;
6854 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6856 #define _TMR1ON 0x01
6857 #define _T1RD16 0x02
6858 #define _RD16 0x02
6859 #define _NOT_T1SYNC 0x04
6860 #define _T1SYNC 0x04
6861 #define _T1SOSCEN 0x08
6862 #define _T1OSCEN 0x08
6863 #define _T1CKPS0 0x10
6864 #define _T1CKPS1 0x20
6865 #define _TMR1CS0 0x40
6866 #define _TMR1CS1 0x80
6868 //==============================================================================
6870 extern __at(0x0FCE) __sfr TMR1;
6871 extern __at(0x0FCE) __sfr TMR1L;
6872 extern __at(0x0FCF) __sfr TMR1H;
6874 //==============================================================================
6875 // RCON Bits
6877 extern __at(0x0FD0) __sfr RCON;
6879 typedef union
6881 struct
6883 unsigned NOT_BOR : 1;
6884 unsigned NOT_POR : 1;
6885 unsigned NOT_PD : 1;
6886 unsigned NOT_TO : 1;
6887 unsigned NOT_RI : 1;
6888 unsigned : 1;
6889 unsigned SBOREN : 1;
6890 unsigned IPEN : 1;
6893 struct
6895 unsigned BOR : 1;
6896 unsigned POR : 1;
6897 unsigned PD : 1;
6898 unsigned TO : 1;
6899 unsigned RI : 1;
6900 unsigned : 1;
6901 unsigned : 1;
6902 unsigned : 1;
6904 } __RCONbits_t;
6906 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6908 #define _NOT_BOR 0x01
6909 #define _BOR 0x01
6910 #define _NOT_POR 0x02
6911 #define _POR 0x02
6912 #define _NOT_PD 0x04
6913 #define _PD 0x04
6914 #define _NOT_TO 0x08
6915 #define _TO 0x08
6916 #define _NOT_RI 0x10
6917 #define _RI 0x10
6918 #define _SBOREN 0x40
6919 #define _IPEN 0x80
6921 //==============================================================================
6924 //==============================================================================
6925 // WDTCON Bits
6927 extern __at(0x0FD1) __sfr WDTCON;
6929 typedef union
6931 struct
6933 unsigned SWDTEN : 1;
6934 unsigned : 1;
6935 unsigned : 1;
6936 unsigned : 1;
6937 unsigned : 1;
6938 unsigned : 1;
6939 unsigned : 1;
6940 unsigned : 1;
6943 struct
6945 unsigned SWDTE : 1;
6946 unsigned : 1;
6947 unsigned : 1;
6948 unsigned : 1;
6949 unsigned : 1;
6950 unsigned : 1;
6951 unsigned : 1;
6952 unsigned : 1;
6954 } __WDTCONbits_t;
6956 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
6958 #define _SWDTEN 0x01
6959 #define _SWDTE 0x01
6961 //==============================================================================
6964 //==============================================================================
6965 // OSCCON2 Bits
6967 extern __at(0x0FD2) __sfr OSCCON2;
6969 typedef struct
6971 unsigned LFIOFS : 1;
6972 unsigned MFIOFS : 1;
6973 unsigned PRISD : 1;
6974 unsigned SOSCGO : 1;
6975 unsigned MFIOSEL : 1;
6976 unsigned : 1;
6977 unsigned SOSCRUN : 1;
6978 unsigned PLLRDY : 1;
6979 } __OSCCON2bits_t;
6981 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
6983 #define _LFIOFS 0x01
6984 #define _MFIOFS 0x02
6985 #define _PRISD 0x04
6986 #define _SOSCGO 0x08
6987 #define _MFIOSEL 0x10
6988 #define _SOSCRUN 0x40
6989 #define _PLLRDY 0x80
6991 //==============================================================================
6994 //==============================================================================
6995 // OSCCON Bits
6997 extern __at(0x0FD3) __sfr OSCCON;
6999 typedef union
7001 struct
7003 unsigned SCS0 : 1;
7004 unsigned SCS1 : 1;
7005 unsigned HFIOFS : 1;
7006 unsigned OSTS : 1;
7007 unsigned IRCF0 : 1;
7008 unsigned IRCF1 : 1;
7009 unsigned IRCF2 : 1;
7010 unsigned IDLEN : 1;
7013 struct
7015 unsigned : 1;
7016 unsigned : 1;
7017 unsigned IOFS : 1;
7018 unsigned : 1;
7019 unsigned : 1;
7020 unsigned : 1;
7021 unsigned : 1;
7022 unsigned : 1;
7025 struct
7027 unsigned SCS : 2;
7028 unsigned : 6;
7031 struct
7033 unsigned : 4;
7034 unsigned IRCF : 3;
7035 unsigned : 1;
7037 } __OSCCONbits_t;
7039 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
7041 #define _SCS0 0x01
7042 #define _SCS1 0x02
7043 #define _HFIOFS 0x04
7044 #define _IOFS 0x04
7045 #define _OSTS 0x08
7046 #define _IRCF0 0x10
7047 #define _IRCF1 0x20
7048 #define _IRCF2 0x40
7049 #define _IDLEN 0x80
7051 //==============================================================================
7054 //==============================================================================
7055 // T0CON Bits
7057 extern __at(0x0FD5) __sfr T0CON;
7059 typedef union
7061 struct
7063 unsigned T0PS0 : 1;
7064 unsigned T0PS1 : 1;
7065 unsigned T0PS2 : 1;
7066 unsigned PSA : 1;
7067 unsigned T0SE : 1;
7068 unsigned T0CS : 1;
7069 unsigned T08BIT : 1;
7070 unsigned TMR0ON : 1;
7073 struct
7075 unsigned T0PS : 3;
7076 unsigned : 5;
7078 } __T0CONbits_t;
7080 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
7082 #define _T0PS0 0x01
7083 #define _T0PS1 0x02
7084 #define _T0PS2 0x04
7085 #define _PSA 0x08
7086 #define _T0SE 0x10
7087 #define _T0CS 0x20
7088 #define _T08BIT 0x40
7089 #define _TMR0ON 0x80
7091 //==============================================================================
7093 extern __at(0x0FD6) __sfr TMR0;
7094 extern __at(0x0FD6) __sfr TMR0L;
7095 extern __at(0x0FD7) __sfr TMR0H;
7097 //==============================================================================
7098 // STATUS Bits
7100 extern __at(0x0FD8) __sfr STATUS;
7102 typedef struct
7104 unsigned C : 1;
7105 unsigned DC : 1;
7106 unsigned Z : 1;
7107 unsigned OV : 1;
7108 unsigned N : 1;
7109 unsigned : 1;
7110 unsigned : 1;
7111 unsigned : 1;
7112 } __STATUSbits_t;
7114 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
7116 #define _C 0x01
7117 #define _DC 0x02
7118 #define _Z 0x04
7119 #define _OV 0x08
7120 #define _N 0x10
7122 //==============================================================================
7124 extern __at(0x0FD9) __sfr FSR2L;
7125 extern __at(0x0FDA) __sfr FSR2H;
7126 extern __at(0x0FDB) __sfr PLUSW2;
7127 extern __at(0x0FDC) __sfr PREINC2;
7128 extern __at(0x0FDD) __sfr POSTDEC2;
7129 extern __at(0x0FDE) __sfr POSTINC2;
7130 extern __at(0x0FDF) __sfr INDF2;
7131 extern __at(0x0FE0) __sfr BSR;
7132 extern __at(0x0FE1) __sfr FSR1L;
7133 extern __at(0x0FE2) __sfr FSR1H;
7134 extern __at(0x0FE3) __sfr PLUSW1;
7135 extern __at(0x0FE4) __sfr PREINC1;
7136 extern __at(0x0FE5) __sfr POSTDEC1;
7137 extern __at(0x0FE6) __sfr POSTINC1;
7138 extern __at(0x0FE7) __sfr INDF1;
7139 extern __at(0x0FE8) __sfr WREG;
7140 extern __at(0x0FE9) __sfr FSR0L;
7141 extern __at(0x0FEA) __sfr FSR0H;
7142 extern __at(0x0FEB) __sfr PLUSW0;
7143 extern __at(0x0FEC) __sfr PREINC0;
7144 extern __at(0x0FED) __sfr POSTDEC0;
7145 extern __at(0x0FEE) __sfr POSTINC0;
7146 extern __at(0x0FEF) __sfr INDF0;
7148 //==============================================================================
7149 // INTCON3 Bits
7151 extern __at(0x0FF0) __sfr INTCON3;
7153 typedef union
7155 struct
7157 unsigned INT1IF : 1;
7158 unsigned INT2IF : 1;
7159 unsigned : 1;
7160 unsigned INT1IE : 1;
7161 unsigned INT2IE : 1;
7162 unsigned : 1;
7163 unsigned INT1IP : 1;
7164 unsigned INT2IP : 1;
7167 struct
7169 unsigned INT1F : 1;
7170 unsigned INT2F : 1;
7171 unsigned : 1;
7172 unsigned INT1E : 1;
7173 unsigned INT2E : 1;
7174 unsigned : 1;
7175 unsigned INT1P : 1;
7176 unsigned INT2P : 1;
7178 } __INTCON3bits_t;
7180 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
7182 #define _INT1IF 0x01
7183 #define _INT1F 0x01
7184 #define _INT2IF 0x02
7185 #define _INT2F 0x02
7186 #define _INT1IE 0x08
7187 #define _INT1E 0x08
7188 #define _INT2IE 0x10
7189 #define _INT2E 0x10
7190 #define _INT1IP 0x40
7191 #define _INT1P 0x40
7192 #define _INT2IP 0x80
7193 #define _INT2P 0x80
7195 //==============================================================================
7198 //==============================================================================
7199 // INTCON2 Bits
7201 extern __at(0x0FF1) __sfr INTCON2;
7203 typedef union
7205 struct
7207 unsigned RBIP : 1;
7208 unsigned : 1;
7209 unsigned TMR0IP : 1;
7210 unsigned : 1;
7211 unsigned INTEDG2 : 1;
7212 unsigned INTEDG1 : 1;
7213 unsigned INTEDG0 : 1;
7214 unsigned NOT_RBPU : 1;
7217 struct
7219 unsigned : 1;
7220 unsigned : 1;
7221 unsigned : 1;
7222 unsigned : 1;
7223 unsigned : 1;
7224 unsigned : 1;
7225 unsigned : 1;
7226 unsigned RBPU : 1;
7228 } __INTCON2bits_t;
7230 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
7232 #define _RBIP 0x01
7233 #define _TMR0IP 0x04
7234 #define _INTEDG2 0x10
7235 #define _INTEDG1 0x20
7236 #define _INTEDG0 0x40
7237 #define _NOT_RBPU 0x80
7238 #define _RBPU 0x80
7240 //==============================================================================
7243 //==============================================================================
7244 // INTCON Bits
7246 extern __at(0x0FF2) __sfr INTCON;
7248 typedef union
7250 struct
7252 unsigned RBIF : 1;
7253 unsigned INT0IF : 1;
7254 unsigned TMR0IF : 1;
7255 unsigned RBIE : 1;
7256 unsigned INT0IE : 1;
7257 unsigned TMR0IE : 1;
7258 unsigned PEIE_GIEL : 1;
7259 unsigned GIE_GIEH : 1;
7262 struct
7264 unsigned : 1;
7265 unsigned INT0F : 1;
7266 unsigned T0IF : 1;
7267 unsigned : 1;
7268 unsigned INT0E : 1;
7269 unsigned T0IE : 1;
7270 unsigned PEIE : 1;
7271 unsigned GIE : 1;
7274 struct
7276 unsigned : 1;
7277 unsigned : 1;
7278 unsigned : 1;
7279 unsigned : 1;
7280 unsigned : 1;
7281 unsigned : 1;
7282 unsigned GIEL : 1;
7283 unsigned GIEH : 1;
7285 } __INTCONbits_t;
7287 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
7289 #define _RBIF 0x01
7290 #define _INT0IF 0x02
7291 #define _INT0F 0x02
7292 #define _TMR0IF 0x04
7293 #define _T0IF 0x04
7294 #define _RBIE 0x08
7295 #define _INT0IE 0x10
7296 #define _INT0E 0x10
7297 #define _TMR0IE 0x20
7298 #define _T0IE 0x20
7299 #define _PEIE_GIEL 0x40
7300 #define _PEIE 0x40
7301 #define _GIEL 0x40
7302 #define _GIE_GIEH 0x80
7303 #define _GIE 0x80
7304 #define _GIEH 0x80
7306 //==============================================================================
7308 extern __at(0x0FF3) __sfr PROD;
7309 extern __at(0x0FF3) __sfr PRODL;
7310 extern __at(0x0FF4) __sfr PRODH;
7311 extern __at(0x0FF5) __sfr TABLAT;
7312 extern __at(0x0FF6) __sfr TBLPTR;
7313 extern __at(0x0FF6) __sfr TBLPTRL;
7314 extern __at(0x0FF7) __sfr TBLPTRH;
7315 extern __at(0x0FF8) __sfr TBLPTRU;
7316 extern __at(0x0FF9) __sfr PC;
7317 extern __at(0x0FF9) __sfr PCL;
7318 extern __at(0x0FFA) __sfr PCLATH;
7319 extern __at(0x0FFB) __sfr PCLATU;
7321 //==============================================================================
7322 // STKPTR Bits
7324 extern __at(0x0FFC) __sfr STKPTR;
7326 typedef union
7328 struct
7330 unsigned STKPTR0 : 1;
7331 unsigned STKPTR1 : 1;
7332 unsigned STKPTR2 : 1;
7333 unsigned STKPTR3 : 1;
7334 unsigned STKPTR4 : 1;
7335 unsigned : 1;
7336 unsigned STKUNF : 1;
7337 unsigned STKFUL : 1;
7340 struct
7342 unsigned SP0 : 1;
7343 unsigned SP1 : 1;
7344 unsigned SP2 : 1;
7345 unsigned SP3 : 1;
7346 unsigned SP4 : 1;
7347 unsigned : 1;
7348 unsigned : 1;
7349 unsigned STKOVF : 1;
7352 struct
7354 unsigned STKPTR : 5;
7355 unsigned : 3;
7358 struct
7360 unsigned SP : 5;
7361 unsigned : 3;
7363 } __STKPTRbits_t;
7365 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
7367 #define _STKPTR0 0x01
7368 #define _SP0 0x01
7369 #define _STKPTR1 0x02
7370 #define _SP1 0x02
7371 #define _STKPTR2 0x04
7372 #define _SP2 0x04
7373 #define _STKPTR3 0x08
7374 #define _SP3 0x08
7375 #define _STKPTR4 0x10
7376 #define _SP4 0x10
7377 #define _STKUNF 0x40
7378 #define _STKFUL 0x80
7379 #define _STKOVF 0x80
7381 //==============================================================================
7383 extern __at(0x0FFD) __sfr TOS;
7384 extern __at(0x0FFD) __sfr TOSL;
7385 extern __at(0x0FFE) __sfr TOSH;
7386 extern __at(0x0FFF) __sfr TOSU;
7388 //==============================================================================
7390 // Configuration Bits
7392 //==============================================================================
7394 #define __CONFIG1H 0x300001
7395 #define __CONFIG2L 0x300002
7396 #define __CONFIG2H 0x300003
7397 #define __CONFIG3H 0x300005
7398 #define __CONFIG4L 0x300006
7399 #define __CONFIG5L 0x300008
7400 #define __CONFIG5H 0x300009
7401 #define __CONFIG6L 0x30000A
7402 #define __CONFIG6H 0x30000B
7403 #define __CONFIG7L 0x30000C
7404 #define __CONFIG7H 0x30000D
7406 //----------------------------- CONFIG1H Options -------------------------------
7408 #define _FOSC_LP_1H 0xF0 // LP oscillator.
7409 #define _FOSC_XT_1H 0xF1 // XT oscillator.
7410 #define _FOSC_HSHP_1H 0xF2 // HS oscillator (high power > 16 MHz).
7411 #define _FOSC_HSMP_1H 0xF3 // HS oscillator (medium power 4-16 MHz).
7412 #define _FOSC_ECHP_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (high power, >16 MHz).
7413 #define _FOSC_ECHPIO6_1H 0xF5 // EC oscillator (high power, >16 MHz).
7414 #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
7415 #define _FOSC_RCIO6_1H 0xF7 // External RC oscillator.
7416 #define _FOSC_INTIO67_1H 0xF8 // Internal oscillator block.
7417 #define _FOSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKOUT function on OSC2.
7418 #define _FOSC_ECMP_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (medium power, 500 kHz-16 MHz).
7419 #define _FOSC_ECMPIO6_1H 0xFB // EC oscillator (medium power, 500 kHz-16 MHz).
7420 #define _FOSC_ECLP_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (low power, <500 kHz).
7421 #define _FOSC_ECLPIO6_1H 0xFD // EC oscillator (low power, <500 kHz).
7422 #define _PLLCFG_OFF_1H 0xEF // Oscillator used directly.
7423 #define _PLLCFG_ON_1H 0xFF // Oscillator multiplied by 4.
7424 #define _PRICLKEN_OFF_1H 0xDF // Primary clock can be disabled by software.
7425 #define _PRICLKEN_ON_1H 0xFF // Primary clock is always enabled.
7426 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
7427 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
7428 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
7429 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
7431 //----------------------------- CONFIG2L Options -------------------------------
7433 #define _PWRTEN_ON_2L 0xFE // Power up timer enabled.
7434 #define _PWRTEN_OFF_2L 0xFF // Power up timer disabled.
7435 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
7436 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
7437 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
7438 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
7439 #define _BORV_285_2L 0xE7 // VBOR set to 2.85 V nominal.
7440 #define _BORV_250_2L 0xEF // VBOR set to 2.50 V nominal.
7441 #define _BORV_220_2L 0xF7 // VBOR set to 2.20 V nominal.
7442 #define _BORV_190_2L 0xFF // VBOR set to 1.90 V nominal.
7444 //----------------------------- CONFIG2H Options -------------------------------
7446 #define _WDTEN_OFF_2H 0xFC // Watch dog timer is always disabled. SWDTEN has no effect.
7447 #define _WDTEN_NOSLP_2H 0xFD // WDT is disabled in sleep, otherwise enabled. SWDTEN bit has no effect.
7448 #define _WDTEN_SWON_2H 0xFE // WDT is controlled by SWDTEN bit of the WDTCON register.
7449 #define _WDTEN_ON_2H 0xFF // WDT is always enabled. SWDTEN bit has no effect.
7450 #define _WDTPS_1_2H 0xC3 // 1:1.
7451 #define _WDTPS_2_2H 0xC7 // 1:2.
7452 #define _WDTPS_4_2H 0xCB // 1:4.
7453 #define _WDTPS_8_2H 0xCF // 1:8.
7454 #define _WDTPS_16_2H 0xD3 // 1:16.
7455 #define _WDTPS_32_2H 0xD7 // 1:32.
7456 #define _WDTPS_64_2H 0xDB // 1:64.
7457 #define _WDTPS_128_2H 0xDF // 1:128.
7458 #define _WDTPS_256_2H 0xE3 // 1:256.
7459 #define _WDTPS_512_2H 0xE7 // 1:512.
7460 #define _WDTPS_1024_2H 0xEB // 1:1024.
7461 #define _WDTPS_2048_2H 0xEF // 1:2048.
7462 #define _WDTPS_4096_2H 0xF3 // 1:4096.
7463 #define _WDTPS_8192_2H 0xF7 // 1:8192.
7464 #define _WDTPS_16384_2H 0xFB // 1:16384.
7465 #define _WDTPS_32768_2H 0xFF // 1:32768.
7467 //----------------------------- CONFIG3H Options -------------------------------
7469 #define _CCP2MX_PORTB3_3H 0xFE // CCP2 input/output is multiplexed with RB3.
7470 #define _CCP2MX_PORTC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
7471 #define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset.
7472 #define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset.
7473 #define _CCP3MX_PORTE0_3H 0xFB // P3A/CCP3 input/output is mulitplexed with RE0.
7474 #define _CCP3MX_PORTB5_3H 0xFF // P3A/CCP3 input/output is multiplexed with RB5.
7475 #define _HFOFST_OFF_3H 0xF7 // HFINTOSC output and ready status are delayed by the oscillator stable status.
7476 #define _HFOFST_ON_3H 0xFF // HFINTOSC output and ready status are not delayed by the oscillator stable status.
7477 #define _T3CMX_PORTB5_3H 0xEF // T3CKI is on RB5.
7478 #define _T3CMX_PORTC0_3H 0xFF // T3CKI is on RC0.
7479 #define _P2BMX_PORTC0_3H 0xDF // P2B is on RC0.
7480 #define _P2BMX_PORTD2_3H 0xFF // P2B is on RD2.
7481 #define _MCLRE_INTMCLR_3H 0x7F // RE3 input pin enabled; MCLR disabled.
7482 #define _MCLRE_EXTMCLR_3H 0xFF // MCLR pin enabled, RE3 input pin disabled.
7484 //----------------------------- CONFIG4L Options -------------------------------
7486 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
7487 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
7488 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
7489 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1.
7490 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
7491 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
7492 #define _DEBUG_ON_4L 0x7F // Enabled.
7493 #define _DEBUG_OFF_4L 0xFF // Disabled.
7495 //----------------------------- CONFIG5L Options -------------------------------
7497 #define _CP0_ON_5L 0xFE // Block 0 (000800-003FFFh) code-protected.
7498 #define _CP0_OFF_5L 0xFF // Block 0 (000800-003FFFh) not code-protected.
7499 #define _CP1_ON_5L 0xFD // Block 1 (004000-007FFFh) code-protected.
7500 #define _CP1_OFF_5L 0xFF // Block 1 (004000-007FFFh) not code-protected.
7501 #define _CP2_ON_5L 0xFB // Block 2 (008000-00BFFFh) code-protected.
7502 #define _CP2_OFF_5L 0xFF // Block 2 (008000-00BFFFh) not code-protected.
7503 #define _CP3_ON_5L 0xF7 // Block 3 (00C000-00FFFFh) code-protected.
7504 #define _CP3_OFF_5L 0xFF // Block 3 (00C000-00FFFFh) not code-protected.
7506 //----------------------------- CONFIG5H Options -------------------------------
7508 #define _CPB_ON_5H 0xBF // Boot block (000000-0007FFh) code-protected.
7509 #define _CPB_OFF_5H 0xFF // Boot block (000000-0007FFh) not code-protected.
7510 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
7511 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
7513 //----------------------------- CONFIG6L Options -------------------------------
7515 #define _WRT0_ON_6L 0xFE // Block 0 (000800-003FFFh) write-protected.
7516 #define _WRT0_OFF_6L 0xFF // Block 0 (000800-003FFFh) not write-protected.
7517 #define _WRT1_ON_6L 0xFD // Block 1 (004000-007FFFh) write-protected.
7518 #define _WRT1_OFF_6L 0xFF // Block 1 (004000-007FFFh) not write-protected.
7519 #define _WRT2_ON_6L 0xFB // Block 2 (008000-00BFFFh) write-protected.
7520 #define _WRT2_OFF_6L 0xFF // Block 2 (008000-00BFFFh) not write-protected.
7521 #define _WRT3_ON_6L 0xF7 // Block 3 (00C000-00FFFFh) write-protected.
7522 #define _WRT3_OFF_6L 0xFF // Block 3 (00C000-00FFFFh) not write-protected.
7524 //----------------------------- CONFIG6H Options -------------------------------
7526 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
7527 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
7528 #define _WRTB_ON_6H 0xBF // Boot Block (000000-0007FFh) write-protected.
7529 #define _WRTB_OFF_6H 0xFF // Boot Block (000000-0007FFh) not write-protected.
7530 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
7531 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
7533 //----------------------------- CONFIG7L Options -------------------------------
7535 #define _EBTR0_ON_7L 0xFE // Block 0 (000800-003FFFh) protected from table reads executed in other blocks.
7536 #define _EBTR0_OFF_7L 0xFF // Block 0 (000800-003FFFh) not protected from table reads executed in other blocks.
7537 #define _EBTR1_ON_7L 0xFD // Block 1 (004000-007FFFh) protected from table reads executed in other blocks.
7538 #define _EBTR1_OFF_7L 0xFF // Block 1 (004000-007FFFh) not protected from table reads executed in other blocks.
7539 #define _EBTR2_ON_7L 0xFB // Block 2 (008000-00BFFFh) protected from table reads executed in other blocks.
7540 #define _EBTR2_OFF_7L 0xFF // Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks.
7541 #define _EBTR3_ON_7L 0xF7 // Block 3 (00C000-00FFFFh) protected from table reads executed in other blocks.
7542 #define _EBTR3_OFF_7L 0xFF // Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks.
7544 //----------------------------- CONFIG7H Options -------------------------------
7546 #define _EBTRB_ON_7H 0xBF // Boot Block (000000-0007FFh) protected from table reads executed in other blocks.
7547 #define _EBTRB_OFF_7H 0xFF // Boot Block (000000-0007FFh) not protected from table reads executed in other blocks.
7549 //==============================================================================
7551 #define __DEVID1 0x3FFFFE
7552 #define __DEVID2 0x3FFFFF
7554 #define __IDLOC0 0x200000
7555 #define __IDLOC1 0x200001
7556 #define __IDLOC2 0x200002
7557 #define __IDLOC3 0x200003
7558 #define __IDLOC4 0x200004
7559 #define __IDLOC5 0x200005
7560 #define __IDLOC6 0x200006
7561 #define __IDLOC7 0x200007
7563 #endif // #ifndef __PIC18F46K22_H__