Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f87k90.h
blob9007618c27479e313faa9390f0e30dce85675098
1 /*
2 * This declarations of the PIC18F87K90 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:40 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 __PIC18F87K90_H__
26 #define __PIC18F87K90_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // LCDCON Bits
40 extern __at(0x0EF4) __sfr LCDCON;
42 typedef union
44 struct
46 unsigned LMUX0 : 1;
47 unsigned LMUX1 : 1;
48 unsigned CS0 : 1;
49 unsigned CS1 : 1;
50 unsigned : 1;
51 unsigned WERR : 1;
52 unsigned SLPEN : 1;
53 unsigned LCDEN : 1;
56 struct
58 unsigned LMUX : 2;
59 unsigned : 6;
62 struct
64 unsigned : 2;
65 unsigned CS : 2;
66 unsigned : 4;
68 } __LCDCONbits_t;
70 extern __at(0x0EF4) volatile __LCDCONbits_t LCDCONbits;
72 #define _LMUX0 0x01
73 #define _LMUX1 0x02
74 #define _CS0 0x04
75 #define _CS1 0x08
76 #define _WERR 0x20
77 #define _SLPEN 0x40
78 #define _LCDEN 0x80
80 //==============================================================================
83 //==============================================================================
84 // LCDPS Bits
86 extern __at(0x0EF5) __sfr LCDPS;
88 typedef union
90 struct
92 unsigned LP0 : 1;
93 unsigned LP1 : 1;
94 unsigned LP2 : 1;
95 unsigned LP3 : 1;
96 unsigned WA : 1;
97 unsigned LCDA : 1;
98 unsigned BIASMD : 1;
99 unsigned WFT : 1;
102 struct
104 unsigned LP : 4;
105 unsigned : 4;
107 } __LCDPSbits_t;
109 extern __at(0x0EF5) volatile __LCDPSbits_t LCDPSbits;
111 #define _LP0 0x01
112 #define _LP1 0x02
113 #define _LP2 0x04
114 #define _LP3 0x08
115 #define _WA 0x10
116 #define _LCDA 0x20
117 #define _BIASMD 0x40
118 #define _WFT 0x80
120 //==============================================================================
123 //==============================================================================
124 // LCDSE0 Bits
126 extern __at(0x0EF6) __sfr LCDSE0;
128 typedef struct
130 unsigned SE00 : 1;
131 unsigned SE01 : 1;
132 unsigned SE02 : 1;
133 unsigned SE03 : 1;
134 unsigned SE04 : 1;
135 unsigned SE05 : 1;
136 unsigned SE06 : 1;
137 unsigned SE07 : 1;
138 } __LCDSE0bits_t;
140 extern __at(0x0EF6) volatile __LCDSE0bits_t LCDSE0bits;
142 #define _SE00 0x01
143 #define _SE01 0x02
144 #define _SE02 0x04
145 #define _SE03 0x08
146 #define _SE04 0x10
147 #define _SE05 0x20
148 #define _SE06 0x40
149 #define _SE07 0x80
151 //==============================================================================
154 //==============================================================================
155 // LCDSE1 Bits
157 extern __at(0x0EF7) __sfr LCDSE1;
159 typedef struct
161 unsigned SE08 : 1;
162 unsigned SE09 : 1;
163 unsigned SE10 : 1;
164 unsigned SE11 : 1;
165 unsigned SE12 : 1;
166 unsigned SE13 : 1;
167 unsigned SE14 : 1;
168 unsigned SE15 : 1;
169 } __LCDSE1bits_t;
171 extern __at(0x0EF7) volatile __LCDSE1bits_t LCDSE1bits;
173 #define _SE08 0x01
174 #define _SE09 0x02
175 #define _SE10 0x04
176 #define _SE11 0x08
177 #define _SE12 0x10
178 #define _SE13 0x20
179 #define _SE14 0x40
180 #define _SE15 0x80
182 //==============================================================================
185 //==============================================================================
186 // LCDSE2 Bits
188 extern __at(0x0EF8) __sfr LCDSE2;
190 typedef struct
192 unsigned SE16 : 1;
193 unsigned SE17 : 1;
194 unsigned SE18 : 1;
195 unsigned SE19 : 1;
196 unsigned SE20 : 1;
197 unsigned SE21 : 1;
198 unsigned SE22 : 1;
199 unsigned SE23 : 1;
200 } __LCDSE2bits_t;
202 extern __at(0x0EF8) volatile __LCDSE2bits_t LCDSE2bits;
204 #define _SE16 0x01
205 #define _SE17 0x02
206 #define _SE18 0x04
207 #define _SE19 0x08
208 #define _SE20 0x10
209 #define _SE21 0x20
210 #define _SE22 0x40
211 #define _SE23 0x80
213 //==============================================================================
216 //==============================================================================
217 // LCDSE3 Bits
219 extern __at(0x0EF9) __sfr LCDSE3;
221 typedef struct
223 unsigned SE24 : 1;
224 unsigned SE25 : 1;
225 unsigned SE26 : 1;
226 unsigned SE27 : 1;
227 unsigned SE28 : 1;
228 unsigned SE29 : 1;
229 unsigned SE30 : 1;
230 unsigned SE31 : 1;
231 } __LCDSE3bits_t;
233 extern __at(0x0EF9) volatile __LCDSE3bits_t LCDSE3bits;
235 #define _SE24 0x01
236 #define _SE25 0x02
237 #define _SE26 0x04
238 #define _SE27 0x08
239 #define _SE28 0x10
240 #define _SE29 0x20
241 #define _SE30 0x40
242 #define _SE31 0x80
244 //==============================================================================
247 //==============================================================================
248 // LCDSE4 Bits
250 extern __at(0x0EFA) __sfr LCDSE4;
252 typedef struct
254 unsigned SE32 : 1;
255 unsigned SE33 : 1;
256 unsigned SE34 : 1;
257 unsigned SE35 : 1;
258 unsigned SE36 : 1;
259 unsigned SE37 : 1;
260 unsigned SE38 : 1;
261 unsigned SE39 : 1;
262 } __LCDSE4bits_t;
264 extern __at(0x0EFA) volatile __LCDSE4bits_t LCDSE4bits;
266 #define _SE32 0x01
267 #define _SE33 0x02
268 #define _SE34 0x04
269 #define _SE35 0x08
270 #define _SE36 0x10
271 #define _SE37 0x20
272 #define _SE38 0x40
273 #define _SE39 0x80
275 //==============================================================================
278 //==============================================================================
279 // LCDSE5 Bits
281 extern __at(0x0EFB) __sfr LCDSE5;
283 typedef struct
285 unsigned SE40 : 1;
286 unsigned SE41 : 1;
287 unsigned SE42 : 1;
288 unsigned SE43 : 1;
289 unsigned SE44 : 1;
290 unsigned SE45 : 1;
291 unsigned SE46 : 1;
292 unsigned SE47 : 1;
293 } __LCDSE5bits_t;
295 extern __at(0x0EFB) volatile __LCDSE5bits_t LCDSE5bits;
297 #define _SE40 0x01
298 #define _SE41 0x02
299 #define _SE42 0x04
300 #define _SE43 0x08
301 #define _SE44 0x10
302 #define _SE45 0x20
303 #define _SE46 0x40
304 #define _SE47 0x80
306 //==============================================================================
309 //==============================================================================
310 // LCDRL Bits
312 extern __at(0x0EFC) __sfr LCDRL;
314 typedef union
316 struct
318 unsigned LRLAT0 : 1;
319 unsigned LRLAT1 : 1;
320 unsigned LRLAT2 : 1;
321 unsigned : 1;
322 unsigned LRLBP0 : 1;
323 unsigned LRLBP1 : 1;
324 unsigned LRLAP0 : 1;
325 unsigned LRLAP1 : 1;
328 struct
330 unsigned LRLAT : 3;
331 unsigned : 5;
334 struct
336 unsigned : 4;
337 unsigned LRLBP : 2;
338 unsigned : 2;
341 struct
343 unsigned : 6;
344 unsigned LRLAP : 2;
346 } __LCDRLbits_t;
348 extern __at(0x0EFC) volatile __LCDRLbits_t LCDRLbits;
350 #define _LRLAT0 0x01
351 #define _LRLAT1 0x02
352 #define _LRLAT2 0x04
353 #define _LRLBP0 0x10
354 #define _LRLBP1 0x20
355 #define _LRLAP0 0x40
356 #define _LRLAP1 0x80
358 //==============================================================================
361 //==============================================================================
362 // LCDREF Bits
364 extern __at(0x0EFD) __sfr LCDREF;
366 typedef union
368 struct
370 unsigned VLCD1PE : 1;
371 unsigned VLCD2PE : 1;
372 unsigned VLCD3PE : 1;
373 unsigned LCDCST0 : 1;
374 unsigned LCDCST1 : 1;
375 unsigned LCDCST2 : 1;
376 unsigned LCDIRS : 1;
377 unsigned LCDIRE : 1;
380 struct
382 unsigned : 3;
383 unsigned LCDCST : 3;
384 unsigned : 2;
386 } __LCDREFbits_t;
388 extern __at(0x0EFD) volatile __LCDREFbits_t LCDREFbits;
390 #define _VLCD1PE 0x01
391 #define _VLCD2PE 0x02
392 #define _VLCD3PE 0x04
393 #define _LCDCST0 0x08
394 #define _LCDCST1 0x10
395 #define _LCDCST2 0x20
396 #define _LCDIRS 0x40
397 #define _LCDIRE 0x80
399 //==============================================================================
402 //==============================================================================
403 // SSP2CON2 Bits
405 extern __at(0x0EFE) __sfr SSP2CON2;
407 typedef union
409 struct
411 unsigned SEN : 1;
412 unsigned RSEN : 1;
413 unsigned PEN : 1;
414 unsigned RCEN : 1;
415 unsigned ACKEN : 1;
416 unsigned ACKDT : 1;
417 unsigned ACKSTAT : 1;
418 unsigned GCEN : 1;
421 struct
423 unsigned : 1;
424 unsigned ADMSK1 : 1;
425 unsigned ADMSK2 : 1;
426 unsigned ADMSK3 : 1;
427 unsigned ADMSK4 : 1;
428 unsigned ADMSK5 : 1;
429 unsigned : 1;
430 unsigned : 1;
432 } __SSP2CON2bits_t;
434 extern __at(0x0EFE) volatile __SSP2CON2bits_t SSP2CON2bits;
436 #define _SSP2CON2_SEN 0x01
437 #define _SSP2CON2_RSEN 0x02
438 #define _SSP2CON2_ADMSK1 0x02
439 #define _SSP2CON2_PEN 0x04
440 #define _SSP2CON2_ADMSK2 0x04
441 #define _SSP2CON2_RCEN 0x08
442 #define _SSP2CON2_ADMSK3 0x08
443 #define _SSP2CON2_ACKEN 0x10
444 #define _SSP2CON2_ADMSK4 0x10
445 #define _SSP2CON2_ACKDT 0x20
446 #define _SSP2CON2_ADMSK5 0x20
447 #define _SSP2CON2_ACKSTAT 0x40
448 #define _SSP2CON2_GCEN 0x80
450 //==============================================================================
453 //==============================================================================
454 // SSP2CON1 Bits
456 extern __at(0x0EFF) __sfr SSP2CON1;
458 typedef union
460 struct
462 unsigned SSPM0 : 1;
463 unsigned SSPM1 : 1;
464 unsigned SSPM2 : 1;
465 unsigned SSPM3 : 1;
466 unsigned CKP : 1;
467 unsigned SSPEN : 1;
468 unsigned SSPOV : 1;
469 unsigned WCOL : 1;
472 struct
474 unsigned SSPM : 4;
475 unsigned : 4;
477 } __SSP2CON1bits_t;
479 extern __at(0x0EFF) volatile __SSP2CON1bits_t SSP2CON1bits;
481 #define _SSP2CON1_SSPM0 0x01
482 #define _SSP2CON1_SSPM1 0x02
483 #define _SSP2CON1_SSPM2 0x04
484 #define _SSP2CON1_SSPM3 0x08
485 #define _SSP2CON1_CKP 0x10
486 #define _SSP2CON1_SSPEN 0x20
487 #define _SSP2CON1_SSPOV 0x40
488 #define _SSP2CON1_WCOL 0x80
490 //==============================================================================
493 //==============================================================================
494 // SSP2STAT Bits
496 extern __at(0x0F00) __sfr SSP2STAT;
498 typedef union
500 struct
502 unsigned BF : 1;
503 unsigned UA : 1;
504 unsigned R_NOT_W : 1;
505 unsigned S : 1;
506 unsigned P : 1;
507 unsigned D_NOT_A : 1;
508 unsigned CKE : 1;
509 unsigned SMP : 1;
512 struct
514 unsigned : 1;
515 unsigned : 1;
516 unsigned R : 1;
517 unsigned I2C_START : 1;
518 unsigned I2C_STOP : 1;
519 unsigned D : 1;
520 unsigned : 1;
521 unsigned : 1;
524 struct
526 unsigned : 1;
527 unsigned : 1;
528 unsigned R_W : 1;
529 unsigned : 1;
530 unsigned : 1;
531 unsigned D_A : 1;
532 unsigned : 1;
533 unsigned : 1;
536 struct
538 unsigned : 1;
539 unsigned : 1;
540 unsigned NOT_W : 1;
541 unsigned : 1;
542 unsigned : 1;
543 unsigned NOT_A : 1;
544 unsigned : 1;
545 unsigned : 1;
548 struct
550 unsigned : 1;
551 unsigned : 1;
552 unsigned NOT_WRITE : 1;
553 unsigned : 1;
554 unsigned : 1;
555 unsigned NOT_ADDRESS : 1;
556 unsigned : 1;
557 unsigned : 1;
560 struct
562 unsigned : 1;
563 unsigned : 1;
564 unsigned READ_WRITE : 1;
565 unsigned : 1;
566 unsigned : 1;
567 unsigned DATA_ADDRESS : 1;
568 unsigned : 1;
569 unsigned : 1;
572 struct
574 unsigned : 1;
575 unsigned : 1;
576 unsigned I2C_READ : 1;
577 unsigned : 1;
578 unsigned : 1;
579 unsigned I2C_DAT : 1;
580 unsigned : 1;
581 unsigned : 1;
583 } __SSP2STATbits_t;
585 extern __at(0x0F00) volatile __SSP2STATbits_t SSP2STATbits;
587 #define _SSP2STAT_BF 0x01
588 #define _SSP2STAT_UA 0x02
589 #define _SSP2STAT_R_NOT_W 0x04
590 #define _SSP2STAT_R 0x04
591 #define _SSP2STAT_R_W 0x04
592 #define _SSP2STAT_NOT_W 0x04
593 #define _SSP2STAT_NOT_WRITE 0x04
594 #define _SSP2STAT_READ_WRITE 0x04
595 #define _SSP2STAT_I2C_READ 0x04
596 #define _SSP2STAT_S 0x08
597 #define _SSP2STAT_I2C_START 0x08
598 #define _SSP2STAT_P 0x10
599 #define _SSP2STAT_I2C_STOP 0x10
600 #define _SSP2STAT_D_NOT_A 0x20
601 #define _SSP2STAT_D 0x20
602 #define _SSP2STAT_D_A 0x20
603 #define _SSP2STAT_NOT_A 0x20
604 #define _SSP2STAT_NOT_ADDRESS 0x20
605 #define _SSP2STAT_DATA_ADDRESS 0x20
606 #define _SSP2STAT_I2C_DAT 0x20
607 #define _SSP2STAT_CKE 0x40
608 #define _SSP2STAT_SMP 0x80
610 //==============================================================================
613 //==============================================================================
614 // SSP2ADD Bits
616 extern __at(0x0F01) __sfr SSP2ADD;
618 typedef struct
620 unsigned MSK0 : 1;
621 unsigned MSK1 : 1;
622 unsigned MSK2 : 1;
623 unsigned MSK3 : 1;
624 unsigned MSK4 : 1;
625 unsigned MSK5 : 1;
626 unsigned MSK6 : 1;
627 unsigned MSK7 : 1;
628 } __SSP2ADDbits_t;
630 extern __at(0x0F01) volatile __SSP2ADDbits_t SSP2ADDbits;
632 #define _SSP2ADD_MSK0 0x01
633 #define _SSP2ADD_MSK1 0x02
634 #define _SSP2ADD_MSK2 0x04
635 #define _SSP2ADD_MSK3 0x08
636 #define _SSP2ADD_MSK4 0x10
637 #define _SSP2ADD_MSK5 0x20
638 #define _SSP2ADD_MSK6 0x40
639 #define _SSP2ADD_MSK7 0x80
641 //==============================================================================
643 extern __at(0x0F02) __sfr SSP2BUF;
645 //==============================================================================
646 // T4CON Bits
648 extern __at(0x0F03) __sfr T4CON;
650 typedef union
652 struct
654 unsigned T4CKPS0 : 1;
655 unsigned T4CKPS1 : 1;
656 unsigned TMR4ON : 1;
657 unsigned T4OUTPS0 : 1;
658 unsigned T4OUTPS1 : 1;
659 unsigned T4OUTPS2 : 1;
660 unsigned T4OUTPS3 : 1;
661 unsigned : 1;
664 struct
666 unsigned T4CKPS : 2;
667 unsigned : 6;
670 struct
672 unsigned : 3;
673 unsigned T4OUTPS : 4;
674 unsigned : 1;
676 } __T4CONbits_t;
678 extern __at(0x0F03) volatile __T4CONbits_t T4CONbits;
680 #define _T4CKPS0 0x01
681 #define _T4CKPS1 0x02
682 #define _TMR4ON 0x04
683 #define _T4OUTPS0 0x08
684 #define _T4OUTPS1 0x10
685 #define _T4OUTPS2 0x20
686 #define _T4OUTPS3 0x40
688 //==============================================================================
690 extern __at(0x0F04) __sfr PR4;
691 extern __at(0x0F05) __sfr TMR4;
693 //==============================================================================
694 // CCP7CON Bits
696 extern __at(0x0F06) __sfr CCP7CON;
698 typedef union
700 struct
702 unsigned CCP7M0 : 1;
703 unsigned CCP7M1 : 1;
704 unsigned CCP7M2 : 1;
705 unsigned CCP7M3 : 1;
706 unsigned DC7B0 : 1;
707 unsigned DC7B1 : 1;
708 unsigned : 1;
709 unsigned : 1;
712 struct
714 unsigned : 1;
715 unsigned : 1;
716 unsigned : 1;
717 unsigned : 1;
718 unsigned CCP7Y : 1;
719 unsigned CCP7X : 1;
720 unsigned : 1;
721 unsigned : 1;
724 struct
726 unsigned CCP7M : 4;
727 unsigned : 4;
730 struct
732 unsigned : 4;
733 unsigned DC7B : 2;
734 unsigned : 2;
736 } __CCP7CONbits_t;
738 extern __at(0x0F06) volatile __CCP7CONbits_t CCP7CONbits;
740 #define _CCP7M0 0x01
741 #define _CCP7M1 0x02
742 #define _CCP7M2 0x04
743 #define _CCP7M3 0x08
744 #define _DC7B0 0x10
745 #define _CCP7Y 0x10
746 #define _DC7B1 0x20
747 #define _CCP7X 0x20
749 //==============================================================================
751 extern __at(0x0F07) __sfr CCPR7;
752 extern __at(0x0F07) __sfr CCPR7L;
753 extern __at(0x0F08) __sfr CCPR7H;
755 //==============================================================================
756 // CCP6CON Bits
758 extern __at(0x0F09) __sfr CCP6CON;
760 typedef union
762 struct
764 unsigned CCP6M0 : 1;
765 unsigned CCP6M1 : 1;
766 unsigned CCP6M2 : 1;
767 unsigned CCP6M3 : 1;
768 unsigned DC6B0 : 1;
769 unsigned DC6B1 : 1;
770 unsigned : 1;
771 unsigned : 1;
774 struct
776 unsigned : 1;
777 unsigned : 1;
778 unsigned : 1;
779 unsigned : 1;
780 unsigned CCP6Y : 1;
781 unsigned CCP6X : 1;
782 unsigned : 1;
783 unsigned : 1;
786 struct
788 unsigned CCP6M : 4;
789 unsigned : 4;
792 struct
794 unsigned : 4;
795 unsigned DC6B : 2;
796 unsigned : 2;
798 } __CCP6CONbits_t;
800 extern __at(0x0F09) volatile __CCP6CONbits_t CCP6CONbits;
802 #define _CCP6M0 0x01
803 #define _CCP6M1 0x02
804 #define _CCP6M2 0x04
805 #define _CCP6M3 0x08
806 #define _DC6B0 0x10
807 #define _CCP6Y 0x10
808 #define _DC6B1 0x20
809 #define _CCP6X 0x20
811 //==============================================================================
813 extern __at(0x0F0A) __sfr CCPR6;
814 extern __at(0x0F0A) __sfr CCPR6L;
815 extern __at(0x0F0B) __sfr CCPR6H;
817 //==============================================================================
818 // CCP5CON Bits
820 extern __at(0x0F0C) __sfr CCP5CON;
822 typedef union
824 struct
826 unsigned CCP5M0 : 1;
827 unsigned CCP5M1 : 1;
828 unsigned CCP5M2 : 1;
829 unsigned CCP5M3 : 1;
830 unsigned DC5B0 : 1;
831 unsigned DC5B1 : 1;
832 unsigned : 1;
833 unsigned : 1;
836 struct
838 unsigned : 1;
839 unsigned : 1;
840 unsigned : 1;
841 unsigned : 1;
842 unsigned CCP5Y : 1;
843 unsigned CCP5X : 1;
844 unsigned : 1;
845 unsigned : 1;
848 struct
850 unsigned CCP5M : 4;
851 unsigned : 4;
854 struct
856 unsigned : 4;
857 unsigned DC5B : 2;
858 unsigned : 2;
860 } __CCP5CONbits_t;
862 extern __at(0x0F0C) volatile __CCP5CONbits_t CCP5CONbits;
864 #define _CCP5M0 0x01
865 #define _CCP5M1 0x02
866 #define _CCP5M2 0x04
867 #define _CCP5M3 0x08
868 #define _DC5B0 0x10
869 #define _CCP5Y 0x10
870 #define _DC5B1 0x20
871 #define _CCP5X 0x20
873 //==============================================================================
875 extern __at(0x0F0D) __sfr CCPR5;
876 extern __at(0x0F0D) __sfr CCPR5L;
877 extern __at(0x0F0E) __sfr CCPR5H;
879 //==============================================================================
880 // CCP4CON Bits
882 extern __at(0x0F0F) __sfr CCP4CON;
884 typedef union
886 struct
888 unsigned CCP4M0 : 1;
889 unsigned CCP4M1 : 1;
890 unsigned CCP4M2 : 1;
891 unsigned CCP4M3 : 1;
892 unsigned DC4B0 : 1;
893 unsigned DC4B1 : 1;
894 unsigned : 1;
895 unsigned : 1;
898 struct
900 unsigned : 1;
901 unsigned : 1;
902 unsigned : 1;
903 unsigned : 1;
904 unsigned CCP4Y : 1;
905 unsigned CCP4X : 1;
906 unsigned : 1;
907 unsigned : 1;
910 struct
912 unsigned CCP4M : 4;
913 unsigned : 4;
916 struct
918 unsigned : 4;
919 unsigned DC4B : 2;
920 unsigned : 2;
922 } __CCP4CONbits_t;
924 extern __at(0x0F0F) volatile __CCP4CONbits_t CCP4CONbits;
926 #define _CCP4M0 0x01
927 #define _CCP4M1 0x02
928 #define _CCP4M2 0x04
929 #define _CCP4M3 0x08
930 #define _DC4B0 0x10
931 #define _CCP4Y 0x10
932 #define _DC4B1 0x20
933 #define _CCP4X 0x20
935 //==============================================================================
937 extern __at(0x0F10) __sfr CCPR4;
938 extern __at(0x0F10) __sfr CCPR4L;
939 extern __at(0x0F11) __sfr CCPR4H;
941 //==============================================================================
942 // T5GCON Bits
944 extern __at(0x0F12) __sfr T5GCON;
946 typedef union
948 struct
950 unsigned T5GSS0 : 1;
951 unsigned T5GSS1 : 1;
952 unsigned T5GVAL : 1;
953 unsigned T5GGO_NOT_T5DONE : 1;
954 unsigned T5GSPM : 1;
955 unsigned T5GTM : 1;
956 unsigned T5GPOL : 1;
957 unsigned TMR5GE : 1;
960 struct
962 unsigned : 1;
963 unsigned : 1;
964 unsigned : 1;
965 unsigned T5GGO : 1;
966 unsigned : 1;
967 unsigned : 1;
968 unsigned : 1;
969 unsigned : 1;
972 struct
974 unsigned : 1;
975 unsigned : 1;
976 unsigned : 1;
977 unsigned NOT_T5DONE : 1;
978 unsigned : 1;
979 unsigned : 1;
980 unsigned : 1;
981 unsigned : 1;
984 struct
986 unsigned T5GSS : 2;
987 unsigned : 6;
989 } __T5GCONbits_t;
991 extern __at(0x0F12) volatile __T5GCONbits_t T5GCONbits;
993 #define _T5GSS0 0x01
994 #define _T5GSS1 0x02
995 #define _T5GVAL 0x04
996 #define _T5GGO_NOT_T5DONE 0x08
997 #define _T5GGO 0x08
998 #define _NOT_T5DONE 0x08
999 #define _T5GSPM 0x10
1000 #define _T5GTM 0x20
1001 #define _T5GPOL 0x40
1002 #define _TMR5GE 0x80
1004 //==============================================================================
1007 //==============================================================================
1008 // T5CON Bits
1010 extern __at(0x0F13) __sfr T5CON;
1012 typedef union
1014 struct
1016 unsigned TMR5ON : 1;
1017 unsigned RD16 : 1;
1018 unsigned NOT_T5SYNC : 1;
1019 unsigned SOSCEN : 1;
1020 unsigned T5CKPS0 : 1;
1021 unsigned T5CKPS1 : 1;
1022 unsigned TMR5CS0 : 1;
1023 unsigned TMR5CS1 : 1;
1026 struct
1028 unsigned : 4;
1029 unsigned T5CKPS : 2;
1030 unsigned : 2;
1033 struct
1035 unsigned : 6;
1036 unsigned TMR5CS : 2;
1038 } __T5CONbits_t;
1040 extern __at(0x0F13) volatile __T5CONbits_t T5CONbits;
1042 #define _T5CON_TMR5ON 0x01
1043 #define _T5CON_RD16 0x02
1044 #define _T5CON_NOT_T5SYNC 0x04
1045 #define _T5CON_SOSCEN 0x08
1046 #define _T5CON_T5CKPS0 0x10
1047 #define _T5CON_T5CKPS1 0x20
1048 #define _T5CON_TMR5CS0 0x40
1049 #define _T5CON_TMR5CS1 0x80
1051 //==============================================================================
1053 extern __at(0x0F14) __sfr TMR5;
1054 extern __at(0x0F14) __sfr TMR5L;
1055 extern __at(0x0F15) __sfr TMR5H;
1057 //==============================================================================
1058 // PMD3 Bits
1060 extern __at(0x0F16) __sfr PMD3;
1062 typedef struct
1064 unsigned TMR12MD : 1;
1065 unsigned CCP4MD : 1;
1066 unsigned CCP5MD : 1;
1067 unsigned CCP6MD : 1;
1068 unsigned CCP7MD : 1;
1069 unsigned CCP8MD : 1;
1070 unsigned CCP9MD : 1;
1071 unsigned CCP10MD : 1;
1072 } __PMD3bits_t;
1074 extern __at(0x0F16) volatile __PMD3bits_t PMD3bits;
1076 #define _TMR12MD 0x01
1077 #define _CCP4MD 0x02
1078 #define _CCP5MD 0x04
1079 #define _CCP6MD 0x08
1080 #define _CCP7MD 0x10
1081 #define _CCP8MD 0x20
1082 #define _CCP9MD 0x40
1083 #define _CCP10MD 0x80
1085 //==============================================================================
1088 //==============================================================================
1089 // PMD2 Bits
1091 extern __at(0x0F17) __sfr PMD2;
1093 typedef struct
1095 unsigned CMP1MD : 1;
1096 unsigned CMP2MD : 1;
1097 unsigned CMP3MD : 1;
1098 unsigned TMR5MD : 1;
1099 unsigned TMR6MD : 1;
1100 unsigned TMR7MD : 1;
1101 unsigned TMR8MD : 1;
1102 unsigned TMR10MD : 1;
1103 } __PMD2bits_t;
1105 extern __at(0x0F17) volatile __PMD2bits_t PMD2bits;
1107 #define _CMP1MD 0x01
1108 #define _CMP2MD 0x02
1109 #define _CMP3MD 0x04
1110 #define _TMR5MD 0x08
1111 #define _TMR6MD 0x10
1112 #define _TMR7MD 0x20
1113 #define _TMR8MD 0x40
1114 #define _TMR10MD 0x80
1116 //==============================================================================
1119 //==============================================================================
1120 // PMD1 Bits
1122 extern __at(0x0F18) __sfr PMD1;
1124 typedef struct
1126 unsigned : 1;
1127 unsigned TMR1MD : 1;
1128 unsigned TMR2MD : 1;
1129 unsigned TMR3MD : 1;
1130 unsigned TMR4MD : 1;
1131 unsigned RTCCMD : 1;
1132 unsigned CTMUMD : 1;
1133 unsigned : 1;
1134 } __PMD1bits_t;
1136 extern __at(0x0F18) volatile __PMD1bits_t PMD1bits;
1138 #define _TMR1MD 0x02
1139 #define _TMR2MD 0x04
1140 #define _TMR3MD 0x08
1141 #define _TMR4MD 0x10
1142 #define _RTCCMD 0x20
1143 #define _CTMUMD 0x40
1145 //==============================================================================
1148 //==============================================================================
1149 // PMD0 Bits
1151 extern __at(0x0F19) __sfr PMD0;
1153 typedef struct
1155 unsigned ADCMD : 1;
1156 unsigned SSP1MD : 1;
1157 unsigned SSP2MD : 1;
1158 unsigned UART1MD : 1;
1159 unsigned UART2MD : 1;
1160 unsigned CCP1MD : 1;
1161 unsigned CCP2MD : 1;
1162 unsigned CCP3MD : 1;
1163 } __PMD0bits_t;
1165 extern __at(0x0F19) volatile __PMD0bits_t PMD0bits;
1167 #define _ADCMD 0x01
1168 #define _SSP1MD 0x02
1169 #define _SSP2MD 0x04
1170 #define _UART1MD 0x08
1171 #define _UART2MD 0x10
1172 #define _CCP1MD 0x20
1173 #define _CCP2MD 0x40
1174 #define _CCP3MD 0x80
1176 //==============================================================================
1179 //==============================================================================
1180 // PSTR3CON Bits
1182 extern __at(0x0F1A) __sfr PSTR3CON;
1184 typedef union
1186 struct
1188 unsigned STRA : 1;
1189 unsigned STRB : 1;
1190 unsigned STRC : 1;
1191 unsigned STRD : 1;
1192 unsigned STRSYNC : 1;
1193 unsigned : 1;
1194 unsigned CMPL0 : 1;
1195 unsigned CMPL1 : 1;
1198 struct
1200 unsigned : 6;
1201 unsigned CMPL : 2;
1203 } __PSTR3CONbits_t;
1205 extern __at(0x0F1A) volatile __PSTR3CONbits_t PSTR3CONbits;
1207 #define _PSTR3CON_STRA 0x01
1208 #define _PSTR3CON_STRB 0x02
1209 #define _PSTR3CON_STRC 0x04
1210 #define _PSTR3CON_STRD 0x08
1211 #define _PSTR3CON_STRSYNC 0x10
1212 #define _PSTR3CON_CMPL0 0x40
1213 #define _PSTR3CON_CMPL1 0x80
1215 //==============================================================================
1218 //==============================================================================
1219 // PSTR2CON Bits
1221 extern __at(0x0F1B) __sfr PSTR2CON;
1223 typedef union
1225 struct
1227 unsigned STRA : 1;
1228 unsigned STRB : 1;
1229 unsigned STRC : 1;
1230 unsigned STRD : 1;
1231 unsigned STRSYNC : 1;
1232 unsigned : 1;
1233 unsigned CMPL0 : 1;
1234 unsigned CMPL1 : 1;
1237 struct
1239 unsigned : 6;
1240 unsigned CMPL : 2;
1242 } __PSTR2CONbits_t;
1244 extern __at(0x0F1B) volatile __PSTR2CONbits_t PSTR2CONbits;
1246 #define _PSTR2CON_STRA 0x01
1247 #define _PSTR2CON_STRB 0x02
1248 #define _PSTR2CON_STRC 0x04
1249 #define _PSTR2CON_STRD 0x08
1250 #define _PSTR2CON_STRSYNC 0x10
1251 #define _PSTR2CON_CMPL0 0x40
1252 #define _PSTR2CON_CMPL1 0x80
1254 //==============================================================================
1256 extern __at(0x0F1C) __sfr TXREG2;
1257 extern __at(0x0F1D) __sfr RCREG2;
1258 extern __at(0x0F1E) __sfr SPBRG2;
1259 extern __at(0x0F1F) __sfr SPBRGH2;
1261 //==============================================================================
1262 // BAUDCON2 Bits
1264 extern __at(0x0F20) __sfr BAUDCON2;
1266 typedef struct
1268 unsigned ABDEN : 1;
1269 unsigned WUE : 1;
1270 unsigned : 1;
1271 unsigned BRG16 : 1;
1272 unsigned TXCKP : 1;
1273 unsigned RXDTP : 1;
1274 unsigned RCIDL : 1;
1275 unsigned ABDOVF : 1;
1276 } __BAUDCON2bits_t;
1278 extern __at(0x0F20) volatile __BAUDCON2bits_t BAUDCON2bits;
1280 #define _BAUDCON2_ABDEN 0x01
1281 #define _BAUDCON2_WUE 0x02
1282 #define _BAUDCON2_BRG16 0x08
1283 #define _BAUDCON2_TXCKP 0x10
1284 #define _BAUDCON2_RXDTP 0x20
1285 #define _BAUDCON2_RCIDL 0x40
1286 #define _BAUDCON2_ABDOVF 0x80
1288 //==============================================================================
1291 //==============================================================================
1292 // TXSTA2 Bits
1294 extern __at(0x0F21) __sfr TXSTA2;
1296 typedef union
1298 struct
1300 unsigned TX9D : 1;
1301 unsigned TRMT : 1;
1302 unsigned BRGH : 1;
1303 unsigned SENDB : 1;
1304 unsigned SYNC : 1;
1305 unsigned TXEN : 1;
1306 unsigned TX9 : 1;
1307 unsigned CSRC : 1;
1310 struct
1312 unsigned TX9D2 : 1;
1313 unsigned TRMT2 : 1;
1314 unsigned BRGH2 : 1;
1315 unsigned SENDB2 : 1;
1316 unsigned SYNC2 : 1;
1317 unsigned TXEN2 : 1;
1318 unsigned TX92 : 1;
1319 unsigned CSRC2 : 1;
1321 } __TXSTA2bits_t;
1323 extern __at(0x0F21) volatile __TXSTA2bits_t TXSTA2bits;
1325 #define _TXSTA2_TX9D 0x01
1326 #define _TXSTA2_TX9D2 0x01
1327 #define _TXSTA2_TRMT 0x02
1328 #define _TXSTA2_TRMT2 0x02
1329 #define _TXSTA2_BRGH 0x04
1330 #define _TXSTA2_BRGH2 0x04
1331 #define _TXSTA2_SENDB 0x08
1332 #define _TXSTA2_SENDB2 0x08
1333 #define _TXSTA2_SYNC 0x10
1334 #define _TXSTA2_SYNC2 0x10
1335 #define _TXSTA2_TXEN 0x20
1336 #define _TXSTA2_TXEN2 0x20
1337 #define _TXSTA2_TX9 0x40
1338 #define _TXSTA2_TX92 0x40
1339 #define _TXSTA2_CSRC 0x80
1340 #define _TXSTA2_CSRC2 0x80
1342 //==============================================================================
1345 //==============================================================================
1346 // RCSTA2 Bits
1348 extern __at(0x0F22) __sfr RCSTA2;
1350 typedef union
1352 struct
1354 unsigned RX9D : 1;
1355 unsigned OERR : 1;
1356 unsigned FERR : 1;
1357 unsigned ADDEN : 1;
1358 unsigned CREN : 1;
1359 unsigned SREN : 1;
1360 unsigned RX9 : 1;
1361 unsigned SPEN : 1;
1364 struct
1366 unsigned RX9D2 : 1;
1367 unsigned OERR2 : 1;
1368 unsigned FERR2 : 1;
1369 unsigned ADDEN2 : 1;
1370 unsigned CREN2 : 1;
1371 unsigned SREN2 : 1;
1372 unsigned RX92 : 1;
1373 unsigned SPEN2 : 1;
1375 } __RCSTA2bits_t;
1377 extern __at(0x0F22) volatile __RCSTA2bits_t RCSTA2bits;
1379 #define _RCSTA2_RX9D 0x01
1380 #define _RCSTA2_RX9D2 0x01
1381 #define _RCSTA2_OERR 0x02
1382 #define _RCSTA2_OERR2 0x02
1383 #define _RCSTA2_FERR 0x04
1384 #define _RCSTA2_FERR2 0x04
1385 #define _RCSTA2_ADDEN 0x08
1386 #define _RCSTA2_ADDEN2 0x08
1387 #define _RCSTA2_CREN 0x10
1388 #define _RCSTA2_CREN2 0x10
1389 #define _RCSTA2_SREN 0x20
1390 #define _RCSTA2_SREN2 0x20
1391 #define _RCSTA2_RX9 0x40
1392 #define _RCSTA2_RX92 0x40
1393 #define _RCSTA2_SPEN 0x80
1394 #define _RCSTA2_SPEN2 0x80
1396 //==============================================================================
1399 //==============================================================================
1400 // ANCON2 Bits
1402 extern __at(0x0F23) __sfr ANCON2;
1404 typedef struct
1406 unsigned ANSEL16 : 1;
1407 unsigned ANSEL17 : 1;
1408 unsigned ANSEL18 : 1;
1409 unsigned ANSEL19 : 1;
1410 unsigned ANSEL20 : 1;
1411 unsigned ANSEL21 : 1;
1412 unsigned ANSEL22 : 1;
1413 unsigned ANSEL23 : 1;
1414 } __ANCON2bits_t;
1416 extern __at(0x0F23) volatile __ANCON2bits_t ANCON2bits;
1418 #define _ANSEL16 0x01
1419 #define _ANSEL17 0x02
1420 #define _ANSEL18 0x04
1421 #define _ANSEL19 0x08
1422 #define _ANSEL20 0x10
1423 #define _ANSEL21 0x20
1424 #define _ANSEL22 0x40
1425 #define _ANSEL23 0x80
1427 //==============================================================================
1430 //==============================================================================
1431 // ANCON1 Bits
1433 extern __at(0x0F24) __sfr ANCON1;
1435 typedef struct
1437 unsigned ANSEL8 : 1;
1438 unsigned ANSEL9 : 1;
1439 unsigned ANSEL10 : 1;
1440 unsigned ANSEL11 : 1;
1441 unsigned ANSEL12 : 1;
1442 unsigned ANSEL13 : 1;
1443 unsigned ANSEL14 : 1;
1444 unsigned ANSEL15 : 1;
1445 } __ANCON1bits_t;
1447 extern __at(0x0F24) volatile __ANCON1bits_t ANCON1bits;
1449 #define _ANSEL8 0x01
1450 #define _ANSEL9 0x02
1451 #define _ANSEL10 0x04
1452 #define _ANSEL11 0x08
1453 #define _ANSEL12 0x10
1454 #define _ANSEL13 0x20
1455 #define _ANSEL14 0x40
1456 #define _ANSEL15 0x80
1458 //==============================================================================
1461 //==============================================================================
1462 // ANCON0 Bits
1464 extern __at(0x0F25) __sfr ANCON0;
1466 typedef struct
1468 unsigned ANSEL0 : 1;
1469 unsigned ANSEL1 : 1;
1470 unsigned ANSEL2 : 1;
1471 unsigned ANSEL3 : 1;
1472 unsigned ANSEL4 : 1;
1473 unsigned ANSEL5 : 1;
1474 unsigned ANSEL6 : 1;
1475 unsigned ANSEL7 : 1;
1476 } __ANCON0bits_t;
1478 extern __at(0x0F25) volatile __ANCON0bits_t ANCON0bits;
1480 #define _ANSEL0 0x01
1481 #define _ANSEL1 0x02
1482 #define _ANSEL2 0x04
1483 #define _ANSEL3 0x08
1484 #define _ANSEL4 0x10
1485 #define _ANSEL5 0x20
1486 #define _ANSEL6 0x40
1487 #define _ANSEL7 0x80
1489 //==============================================================================
1492 //==============================================================================
1493 // ODCON3 Bits
1495 extern __at(0x0F27) __sfr ODCON3;
1497 typedef struct
1499 unsigned CTMUDS : 1;
1500 unsigned : 1;
1501 unsigned : 1;
1502 unsigned : 1;
1503 unsigned : 1;
1504 unsigned : 1;
1505 unsigned U1OD : 1;
1506 unsigned U2OD : 1;
1507 } __ODCON3bits_t;
1509 extern __at(0x0F27) volatile __ODCON3bits_t ODCON3bits;
1511 #define _CTMUDS 0x01
1512 #define _U1OD 0x40
1513 #define _U2OD 0x80
1515 //==============================================================================
1518 //==============================================================================
1519 // ODCON2 Bits
1521 extern __at(0x0F28) __sfr ODCON2;
1523 typedef struct
1525 unsigned CCP3OD : 1;
1526 unsigned CCP4OD : 1;
1527 unsigned CCP5OD : 1;
1528 unsigned CCP6OD : 1;
1529 unsigned CCP7OD : 1;
1530 unsigned CCP8OD : 1;
1531 unsigned CCP9OD : 1;
1532 unsigned CCP10OD : 1;
1533 } __ODCON2bits_t;
1535 extern __at(0x0F28) volatile __ODCON2bits_t ODCON2bits;
1537 #define _CCP3OD 0x01
1538 #define _CCP4OD 0x02
1539 #define _CCP5OD 0x04
1540 #define _CCP6OD 0x08
1541 #define _CCP7OD 0x10
1542 #define _CCP8OD 0x20
1543 #define _CCP9OD 0x40
1544 #define _CCP10OD 0x80
1546 //==============================================================================
1549 //==============================================================================
1550 // ODCON1 Bits
1552 extern __at(0x0F29) __sfr ODCON1;
1554 typedef struct
1556 unsigned SPI2OD : 1;
1557 unsigned : 1;
1558 unsigned : 1;
1559 unsigned : 1;
1560 unsigned : 1;
1561 unsigned CCP1OD : 1;
1562 unsigned CCP2OD : 1;
1563 unsigned SPI1OD : 1;
1564 } __ODCON1bits_t;
1566 extern __at(0x0F29) volatile __ODCON1bits_t ODCON1bits;
1568 #define _SPI2OD 0x01
1569 #define _CCP1OD 0x20
1570 #define _CCP2OD 0x40
1571 #define _SPI1OD 0x80
1573 //==============================================================================
1576 //==============================================================================
1577 // REFOCON Bits
1579 extern __at(0x0F2A) __sfr REFOCON;
1581 typedef union
1583 struct
1585 unsigned RODIV0 : 1;
1586 unsigned RODIV1 : 1;
1587 unsigned RODIV2 : 1;
1588 unsigned RODIV3 : 1;
1589 unsigned ROSEL : 1;
1590 unsigned ROSSLP : 1;
1591 unsigned : 1;
1592 unsigned ROON : 1;
1595 struct
1597 unsigned RODIV : 4;
1598 unsigned : 4;
1600 } __REFOCONbits_t;
1602 extern __at(0x0F2A) volatile __REFOCONbits_t REFOCONbits;
1604 #define _RODIV0 0x01
1605 #define _RODIV1 0x02
1606 #define _RODIV2 0x04
1607 #define _RODIV3 0x08
1608 #define _ROSEL 0x10
1609 #define _ROSSLP 0x20
1610 #define _ROON 0x80
1612 //==============================================================================
1615 //==============================================================================
1616 // CCPTMRS2 Bits
1618 extern __at(0x0F2B) __sfr CCPTMRS2;
1620 typedef union
1622 struct
1624 unsigned C8TSEL0 : 1;
1625 unsigned C8TSEL1 : 1;
1626 unsigned C9TSEL0 : 1;
1627 unsigned : 1;
1628 unsigned C10TSEL0 : 1;
1629 unsigned : 1;
1630 unsigned : 1;
1631 unsigned : 1;
1634 struct
1636 unsigned C8TSEL : 2;
1637 unsigned : 6;
1639 } __CCPTMRS2bits_t;
1641 extern __at(0x0F2B) volatile __CCPTMRS2bits_t CCPTMRS2bits;
1643 #define _C8TSEL0 0x01
1644 #define _C8TSEL1 0x02
1645 #define _C9TSEL0 0x04
1646 #define _C10TSEL0 0x10
1648 //==============================================================================
1651 //==============================================================================
1652 // CCPTMRS1 Bits
1654 extern __at(0x0F2C) __sfr CCPTMRS1;
1656 typedef union
1658 struct
1660 unsigned C4TSEL0 : 1;
1661 unsigned C4TSEL1 : 1;
1662 unsigned C5TSEL0 : 1;
1663 unsigned : 1;
1664 unsigned C6TSEL0 : 1;
1665 unsigned : 1;
1666 unsigned C7TSEL0 : 1;
1667 unsigned C7TSEL1 : 1;
1670 struct
1672 unsigned C4TSEL : 2;
1673 unsigned : 6;
1676 struct
1678 unsigned : 6;
1679 unsigned C7TSEL : 2;
1681 } __CCPTMRS1bits_t;
1683 extern __at(0x0F2C) volatile __CCPTMRS1bits_t CCPTMRS1bits;
1685 #define _C4TSEL0 0x01
1686 #define _C4TSEL1 0x02
1687 #define _C5TSEL0 0x04
1688 #define _C6TSEL0 0x10
1689 #define _C7TSEL0 0x40
1690 #define _C7TSEL1 0x80
1692 //==============================================================================
1695 //==============================================================================
1696 // CCPTMRS0 Bits
1698 extern __at(0x0F2D) __sfr CCPTMRS0;
1700 typedef union
1702 struct
1704 unsigned C1TSEL0 : 1;
1705 unsigned C1TSEL1 : 1;
1706 unsigned C1TSEL2 : 1;
1707 unsigned C2TSEL0 : 1;
1708 unsigned C2TSEL1 : 1;
1709 unsigned C2TSEL2 : 1;
1710 unsigned C3TSEL0 : 1;
1711 unsigned C3TSEL1 : 1;
1714 struct
1716 unsigned C1TSEL : 3;
1717 unsigned : 5;
1720 struct
1722 unsigned : 3;
1723 unsigned C2TSEL : 3;
1724 unsigned : 2;
1727 struct
1729 unsigned : 6;
1730 unsigned C3TSEL : 2;
1732 } __CCPTMRS0bits_t;
1734 extern __at(0x0F2D) volatile __CCPTMRS0bits_t CCPTMRS0bits;
1736 #define _C1TSEL0 0x01
1737 #define _C1TSEL1 0x02
1738 #define _C1TSEL2 0x04
1739 #define _C2TSEL0 0x08
1740 #define _C2TSEL1 0x10
1741 #define _C2TSEL2 0x20
1742 #define _C3TSEL0 0x40
1743 #define _C3TSEL1 0x80
1745 //==============================================================================
1748 //==============================================================================
1749 // CM3CON Bits
1751 extern __at(0x0F2E) __sfr CM3CON;
1753 typedef union
1755 struct
1757 unsigned CCH0 : 1;
1758 unsigned CCH1 : 1;
1759 unsigned CREF : 1;
1760 unsigned EVPOL0 : 1;
1761 unsigned EVPOL1 : 1;
1762 unsigned CPOL : 1;
1763 unsigned COE : 1;
1764 unsigned CON : 1;
1767 struct
1769 unsigned CCH : 2;
1770 unsigned : 6;
1773 struct
1775 unsigned : 3;
1776 unsigned EVPOL : 2;
1777 unsigned : 3;
1779 } __CM3CONbits_t;
1781 extern __at(0x0F2E) volatile __CM3CONbits_t CM3CONbits;
1783 #define _CM3CON_CCH0 0x01
1784 #define _CM3CON_CCH1 0x02
1785 #define _CM3CON_CREF 0x04
1786 #define _CM3CON_EVPOL0 0x08
1787 #define _CM3CON_EVPOL1 0x10
1788 #define _CM3CON_CPOL 0x20
1789 #define _CM3CON_COE 0x40
1790 #define _CM3CON_CON 0x80
1792 //==============================================================================
1795 //==============================================================================
1796 // CM3CON1 Bits
1798 extern __at(0x0F2E) __sfr CM3CON1;
1800 typedef union
1802 struct
1804 unsigned CCH0 : 1;
1805 unsigned CCH1 : 1;
1806 unsigned CREF : 1;
1807 unsigned EVPOL0 : 1;
1808 unsigned EVPOL1 : 1;
1809 unsigned CPOL : 1;
1810 unsigned COE : 1;
1811 unsigned CON : 1;
1814 struct
1816 unsigned CCH : 2;
1817 unsigned : 6;
1820 struct
1822 unsigned : 3;
1823 unsigned EVPOL : 2;
1824 unsigned : 3;
1826 } __CM3CON1bits_t;
1828 extern __at(0x0F2E) volatile __CM3CON1bits_t CM3CON1bits;
1830 #define _CM3CON1_CCH0 0x01
1831 #define _CM3CON1_CCH1 0x02
1832 #define _CM3CON1_CREF 0x04
1833 #define _CM3CON1_EVPOL0 0x08
1834 #define _CM3CON1_EVPOL1 0x10
1835 #define _CM3CON1_CPOL 0x20
1836 #define _CM3CON1_COE 0x40
1837 #define _CM3CON1_CON 0x80
1839 //==============================================================================
1842 //==============================================================================
1843 // CM2CON Bits
1845 extern __at(0x0F2F) __sfr CM2CON;
1847 typedef union
1849 struct
1851 unsigned CCH0 : 1;
1852 unsigned CCH1 : 1;
1853 unsigned CREF : 1;
1854 unsigned EVPOL0 : 1;
1855 unsigned EVPOL1 : 1;
1856 unsigned CPOL : 1;
1857 unsigned COE : 1;
1858 unsigned CON : 1;
1861 struct
1863 unsigned CCH : 2;
1864 unsigned : 6;
1867 struct
1869 unsigned : 3;
1870 unsigned EVPOL : 2;
1871 unsigned : 3;
1873 } __CM2CONbits_t;
1875 extern __at(0x0F2F) volatile __CM2CONbits_t CM2CONbits;
1877 #define _CM2CON_CCH0 0x01
1878 #define _CM2CON_CCH1 0x02
1879 #define _CM2CON_CREF 0x04
1880 #define _CM2CON_EVPOL0 0x08
1881 #define _CM2CON_EVPOL1 0x10
1882 #define _CM2CON_CPOL 0x20
1883 #define _CM2CON_COE 0x40
1884 #define _CM2CON_CON 0x80
1886 //==============================================================================
1889 //==============================================================================
1890 // CM2CON1 Bits
1892 extern __at(0x0F2F) __sfr CM2CON1;
1894 typedef union
1896 struct
1898 unsigned CCH0 : 1;
1899 unsigned CCH1 : 1;
1900 unsigned CREF : 1;
1901 unsigned EVPOL0 : 1;
1902 unsigned EVPOL1 : 1;
1903 unsigned CPOL : 1;
1904 unsigned COE : 1;
1905 unsigned CON : 1;
1908 struct
1910 unsigned CCH : 2;
1911 unsigned : 6;
1914 struct
1916 unsigned : 3;
1917 unsigned EVPOL : 2;
1918 unsigned : 3;
1920 } __CM2CON1bits_t;
1922 extern __at(0x0F2F) volatile __CM2CON1bits_t CM2CON1bits;
1924 #define _CM2CON1_CCH0 0x01
1925 #define _CM2CON1_CCH1 0x02
1926 #define _CM2CON1_CREF 0x04
1927 #define _CM2CON1_EVPOL0 0x08
1928 #define _CM2CON1_EVPOL1 0x10
1929 #define _CM2CON1_CPOL 0x20
1930 #define _CM2CON1_COE 0x40
1931 #define _CM2CON1_CON 0x80
1933 //==============================================================================
1936 //==============================================================================
1937 // T12CON Bits
1939 extern __at(0x0F30) __sfr T12CON;
1941 typedef union
1943 struct
1945 unsigned T12CKPS0 : 1;
1946 unsigned T12CKPS1 : 1;
1947 unsigned TMR12ON : 1;
1948 unsigned T12OUTPS0 : 1;
1949 unsigned T12OUTPS1 : 1;
1950 unsigned T12OUTPS2 : 1;
1951 unsigned T12OUTPS3 : 1;
1952 unsigned : 1;
1955 struct
1957 unsigned T12CKPS : 2;
1958 unsigned : 6;
1961 struct
1963 unsigned : 3;
1964 unsigned T12OUTPS : 4;
1965 unsigned : 1;
1967 } __T12CONbits_t;
1969 extern __at(0x0F30) volatile __T12CONbits_t T12CONbits;
1971 #define _T12CKPS0 0x01
1972 #define _T12CKPS1 0x02
1973 #define _TMR12ON 0x04
1974 #define _T12OUTPS0 0x08
1975 #define _T12OUTPS1 0x10
1976 #define _T12OUTPS2 0x20
1977 #define _T12OUTPS3 0x40
1979 //==============================================================================
1981 extern __at(0x0F31) __sfr PR12;
1982 extern __at(0x0F32) __sfr TMR12;
1984 //==============================================================================
1985 // T10CON Bits
1987 extern __at(0x0F33) __sfr T10CON;
1989 typedef union
1991 struct
1993 unsigned T10CKPS0 : 1;
1994 unsigned T10CKPS1 : 1;
1995 unsigned TMR10ON : 1;
1996 unsigned T10OUTPS0 : 1;
1997 unsigned T10OUTPS1 : 1;
1998 unsigned T10OUTPS2 : 1;
1999 unsigned T10OUTPS3 : 1;
2000 unsigned : 1;
2003 struct
2005 unsigned T10CKPS : 2;
2006 unsigned : 6;
2009 struct
2011 unsigned : 3;
2012 unsigned T10OUTPS : 4;
2013 unsigned : 1;
2015 } __T10CONbits_t;
2017 extern __at(0x0F33) volatile __T10CONbits_t T10CONbits;
2019 #define _T10CKPS0 0x01
2020 #define _T10CKPS1 0x02
2021 #define _TMR10ON 0x04
2022 #define _T10OUTPS0 0x08
2023 #define _T10OUTPS1 0x10
2024 #define _T10OUTPS2 0x20
2025 #define _T10OUTPS3 0x40
2027 //==============================================================================
2029 extern __at(0x0F34) __sfr PR10;
2030 extern __at(0x0F35) __sfr TMR10;
2032 //==============================================================================
2033 // T8CON Bits
2035 extern __at(0x0F36) __sfr T8CON;
2037 typedef union
2039 struct
2041 unsigned T8CKPS0 : 1;
2042 unsigned T8CKPS1 : 1;
2043 unsigned TMR8ON : 1;
2044 unsigned T8OUTPS0 : 1;
2045 unsigned T8OUTPS1 : 1;
2046 unsigned T8OUTPS2 : 1;
2047 unsigned T8OUTPS3 : 1;
2048 unsigned : 1;
2051 struct
2053 unsigned T8CKPS : 2;
2054 unsigned : 6;
2057 struct
2059 unsigned : 3;
2060 unsigned T8OUTPS : 4;
2061 unsigned : 1;
2063 } __T8CONbits_t;
2065 extern __at(0x0F36) volatile __T8CONbits_t T8CONbits;
2067 #define _T8CKPS0 0x01
2068 #define _T8CKPS1 0x02
2069 #define _TMR8ON 0x04
2070 #define _T8OUTPS0 0x08
2071 #define _T8OUTPS1 0x10
2072 #define _T8OUTPS2 0x20
2073 #define _T8OUTPS3 0x40
2075 //==============================================================================
2077 extern __at(0x0F37) __sfr PR8;
2078 extern __at(0x0F38) __sfr TMR8;
2080 //==============================================================================
2081 // T6CON Bits
2083 extern __at(0x0F39) __sfr T6CON;
2085 typedef union
2087 struct
2089 unsigned T6CKPS0 : 1;
2090 unsigned T6CKPS1 : 1;
2091 unsigned TMR6ON : 1;
2092 unsigned T6OUTPS0 : 1;
2093 unsigned T6OUTPS1 : 1;
2094 unsigned T6OUTPS2 : 1;
2095 unsigned T6OUTPS3 : 1;
2096 unsigned : 1;
2099 struct
2101 unsigned T6CKPS : 2;
2102 unsigned : 6;
2105 struct
2107 unsigned : 3;
2108 unsigned T6OUTPS : 4;
2109 unsigned : 1;
2111 } __T6CONbits_t;
2113 extern __at(0x0F39) volatile __T6CONbits_t T6CONbits;
2115 #define _T6CKPS0 0x01
2116 #define _T6CKPS1 0x02
2117 #define _TMR6ON 0x04
2118 #define _T6OUTPS0 0x08
2119 #define _T6OUTPS1 0x10
2120 #define _T6OUTPS2 0x20
2121 #define _T6OUTPS3 0x40
2123 //==============================================================================
2125 extern __at(0x0F3A) __sfr PR6;
2126 extern __at(0x0F3B) __sfr TMR6;
2128 //==============================================================================
2129 // T7GCON Bits
2131 extern __at(0x0F3C) __sfr T7GCON;
2133 typedef union
2135 struct
2137 unsigned T7GSS0 : 1;
2138 unsigned T7GSS1 : 1;
2139 unsigned T7GVAL : 1;
2140 unsigned T7GGO_NOT_T7DONE : 1;
2141 unsigned T7GSPM : 1;
2142 unsigned T7GTM : 1;
2143 unsigned T7GPOL : 1;
2144 unsigned TMR7GE : 1;
2147 struct
2149 unsigned : 1;
2150 unsigned : 1;
2151 unsigned : 1;
2152 unsigned T7GGO : 1;
2153 unsigned : 1;
2154 unsigned : 1;
2155 unsigned : 1;
2156 unsigned : 1;
2159 struct
2161 unsigned : 1;
2162 unsigned : 1;
2163 unsigned : 1;
2164 unsigned NOT_T7DONE : 1;
2165 unsigned : 1;
2166 unsigned : 1;
2167 unsigned : 1;
2168 unsigned : 1;
2171 struct
2173 unsigned T7GSS : 2;
2174 unsigned : 6;
2176 } __T7GCONbits_t;
2178 extern __at(0x0F3C) volatile __T7GCONbits_t T7GCONbits;
2180 #define _T7GSS0 0x01
2181 #define _T7GSS1 0x02
2182 #define _T7GVAL 0x04
2183 #define _T7GGO_NOT_T7DONE 0x08
2184 #define _T7GGO 0x08
2185 #define _NOT_T7DONE 0x08
2186 #define _T7GSPM 0x10
2187 #define _T7GTM 0x20
2188 #define _T7GPOL 0x40
2189 #define _TMR7GE 0x80
2191 //==============================================================================
2194 //==============================================================================
2195 // T7CON Bits
2197 extern __at(0x0F3D) __sfr T7CON;
2199 typedef union
2201 struct
2203 unsigned TMR7ON : 1;
2204 unsigned RD16 : 1;
2205 unsigned NOT_T7SYNC : 1;
2206 unsigned SOSCEN : 1;
2207 unsigned T7CKPS0 : 1;
2208 unsigned T7CKPS1 : 1;
2209 unsigned TMR7CS0 : 1;
2210 unsigned TMR7CS1 : 1;
2213 struct
2215 unsigned : 4;
2216 unsigned T7CKPS : 2;
2217 unsigned : 2;
2220 struct
2222 unsigned : 6;
2223 unsigned TMR7CS : 2;
2225 } __T7CONbits_t;
2227 extern __at(0x0F3D) volatile __T7CONbits_t T7CONbits;
2229 #define _T7CON_TMR7ON 0x01
2230 #define _T7CON_RD16 0x02
2231 #define _T7CON_NOT_T7SYNC 0x04
2232 #define _T7CON_SOSCEN 0x08
2233 #define _T7CON_T7CKPS0 0x10
2234 #define _T7CON_T7CKPS1 0x20
2235 #define _T7CON_TMR7CS0 0x40
2236 #define _T7CON_TMR7CS1 0x80
2238 //==============================================================================
2240 extern __at(0x0F3E) __sfr TMR7;
2241 extern __at(0x0F3E) __sfr TMR7L;
2242 extern __at(0x0F3F) __sfr TMR7H;
2244 //==============================================================================
2245 // CCP10CON Bits
2247 extern __at(0x0F40) __sfr CCP10CON;
2249 typedef union
2251 struct
2253 unsigned CCP10M0 : 1;
2254 unsigned CCP10M1 : 1;
2255 unsigned CCP10M2 : 1;
2256 unsigned CCP10M3 : 1;
2257 unsigned DC10B0 : 1;
2258 unsigned DC10B1 : 1;
2259 unsigned : 1;
2260 unsigned : 1;
2263 struct
2265 unsigned : 1;
2266 unsigned : 1;
2267 unsigned : 1;
2268 unsigned : 1;
2269 unsigned CCP10Y : 1;
2270 unsigned CCP10X : 1;
2271 unsigned : 1;
2272 unsigned : 1;
2275 struct
2277 unsigned CCP10M : 4;
2278 unsigned : 4;
2281 struct
2283 unsigned : 4;
2284 unsigned DC10B : 2;
2285 unsigned : 2;
2287 } __CCP10CONbits_t;
2289 extern __at(0x0F40) volatile __CCP10CONbits_t CCP10CONbits;
2291 #define _CCP10M0 0x01
2292 #define _CCP10M1 0x02
2293 #define _CCP10M2 0x04
2294 #define _CCP10M3 0x08
2295 #define _DC10B0 0x10
2296 #define _CCP10Y 0x10
2297 #define _DC10B1 0x20
2298 #define _CCP10X 0x20
2300 //==============================================================================
2302 extern __at(0x0F41) __sfr CCPR10;
2303 extern __at(0x0F41) __sfr CCPR10L;
2304 extern __at(0x0F42) __sfr CCPR10H;
2306 //==============================================================================
2307 // CCP9CON Bits
2309 extern __at(0x0F43) __sfr CCP9CON;
2311 typedef union
2313 struct
2315 unsigned CCP9M0 : 1;
2316 unsigned CCP9M1 : 1;
2317 unsigned CCP9M2 : 1;
2318 unsigned CCP9M3 : 1;
2319 unsigned DC9B0 : 1;
2320 unsigned DC9B1 : 1;
2321 unsigned : 1;
2322 unsigned : 1;
2325 struct
2327 unsigned : 1;
2328 unsigned : 1;
2329 unsigned : 1;
2330 unsigned : 1;
2331 unsigned CCP9Y : 1;
2332 unsigned CCP9X : 1;
2333 unsigned : 1;
2334 unsigned : 1;
2337 struct
2339 unsigned CCP9M : 4;
2340 unsigned : 4;
2343 struct
2345 unsigned : 4;
2346 unsigned DC9B : 2;
2347 unsigned : 2;
2349 } __CCP9CONbits_t;
2351 extern __at(0x0F43) volatile __CCP9CONbits_t CCP9CONbits;
2353 #define _CCP9M0 0x01
2354 #define _CCP9M1 0x02
2355 #define _CCP9M2 0x04
2356 #define _CCP9M3 0x08
2357 #define _DC9B0 0x10
2358 #define _CCP9Y 0x10
2359 #define _DC9B1 0x20
2360 #define _CCP9X 0x20
2362 //==============================================================================
2364 extern __at(0x0F44) __sfr CCPR9;
2365 extern __at(0x0F44) __sfr CCPR9L;
2366 extern __at(0x0F45) __sfr CCPR9H;
2368 //==============================================================================
2369 // CCP8CON Bits
2371 extern __at(0x0F46) __sfr CCP8CON;
2373 typedef union
2375 struct
2377 unsigned CCP8M0 : 1;
2378 unsigned CCP8M1 : 1;
2379 unsigned CCP8M2 : 1;
2380 unsigned CCP8M3 : 1;
2381 unsigned DC8B0 : 1;
2382 unsigned DC8B1 : 1;
2383 unsigned : 1;
2384 unsigned : 1;
2387 struct
2389 unsigned : 1;
2390 unsigned : 1;
2391 unsigned : 1;
2392 unsigned : 1;
2393 unsigned CCP8Y : 1;
2394 unsigned CCP8X : 1;
2395 unsigned : 1;
2396 unsigned : 1;
2399 struct
2401 unsigned CCP8M : 4;
2402 unsigned : 4;
2405 struct
2407 unsigned : 4;
2408 unsigned DC8B : 2;
2409 unsigned : 2;
2411 } __CCP8CONbits_t;
2413 extern __at(0x0F46) volatile __CCP8CONbits_t CCP8CONbits;
2415 #define _CCP8M0 0x01
2416 #define _CCP8M1 0x02
2417 #define _CCP8M2 0x04
2418 #define _CCP8M3 0x08
2419 #define _DC8B0 0x10
2420 #define _CCP8Y 0x10
2421 #define _DC8B1 0x20
2422 #define _CCP8X 0x20
2424 //==============================================================================
2426 extern __at(0x0F47) __sfr CCPR8;
2427 extern __at(0x0F47) __sfr CCPR8L;
2428 extern __at(0x0F48) __sfr CCPR8H;
2430 //==============================================================================
2431 // CCP3CON Bits
2433 extern __at(0x0F49) __sfr CCP3CON;
2435 typedef union
2437 struct
2439 unsigned CCP3M0 : 1;
2440 unsigned CCP3M1 : 1;
2441 unsigned CCP3M2 : 1;
2442 unsigned CCP3M3 : 1;
2443 unsigned DC3B0 : 1;
2444 unsigned DC3B1 : 1;
2445 unsigned P3M0 : 1;
2446 unsigned P3M1 : 1;
2449 struct
2451 unsigned : 1;
2452 unsigned : 1;
2453 unsigned : 1;
2454 unsigned : 1;
2455 unsigned CCP3Y : 1;
2456 unsigned CCP3X : 1;
2457 unsigned : 1;
2458 unsigned : 1;
2461 struct
2463 unsigned CCP3M : 4;
2464 unsigned : 4;
2467 struct
2469 unsigned : 4;
2470 unsigned DC3B : 2;
2471 unsigned : 2;
2474 struct
2476 unsigned : 6;
2477 unsigned P3M : 2;
2479 } __CCP3CONbits_t;
2481 extern __at(0x0F49) volatile __CCP3CONbits_t CCP3CONbits;
2483 #define _CCP3M0 0x01
2484 #define _CCP3M1 0x02
2485 #define _CCP3M2 0x04
2486 #define _CCP3M3 0x08
2487 #define _DC3B0 0x10
2488 #define _CCP3Y 0x10
2489 #define _DC3B1 0x20
2490 #define _CCP3X 0x20
2491 #define _P3M0 0x40
2492 #define _P3M1 0x80
2494 //==============================================================================
2496 extern __at(0x0F4A) __sfr CCPR3;
2497 extern __at(0x0F4A) __sfr CCPR3L;
2498 extern __at(0x0F4B) __sfr CCPR3H;
2500 //==============================================================================
2501 // ECCP3DEL Bits
2503 extern __at(0x0F4C) __sfr ECCP3DEL;
2505 typedef union
2507 struct
2509 unsigned P3DC0 : 1;
2510 unsigned P3DC1 : 1;
2511 unsigned P3DC2 : 1;
2512 unsigned P3DC3 : 1;
2513 unsigned P3DC4 : 1;
2514 unsigned P3DC5 : 1;
2515 unsigned P3DC6 : 1;
2516 unsigned P3RSEN : 1;
2519 struct
2521 unsigned P3DC : 7;
2522 unsigned : 1;
2524 } __ECCP3DELbits_t;
2526 extern __at(0x0F4C) volatile __ECCP3DELbits_t ECCP3DELbits;
2528 #define _P3DC0 0x01
2529 #define _P3DC1 0x02
2530 #define _P3DC2 0x04
2531 #define _P3DC3 0x08
2532 #define _P3DC4 0x10
2533 #define _P3DC5 0x20
2534 #define _P3DC6 0x40
2535 #define _P3RSEN 0x80
2537 //==============================================================================
2540 //==============================================================================
2541 // PWM3CON Bits
2543 extern __at(0x0F4C) __sfr PWM3CON;
2545 typedef union
2547 struct
2549 unsigned P3DC0 : 1;
2550 unsigned P3DC1 : 1;
2551 unsigned P3DC2 : 1;
2552 unsigned P3DC3 : 1;
2553 unsigned P3DC4 : 1;
2554 unsigned P3DC5 : 1;
2555 unsigned P3DC6 : 1;
2556 unsigned P3RSEN : 1;
2559 struct
2561 unsigned P3DC : 7;
2562 unsigned : 1;
2564 } __PWM3CONbits_t;
2566 extern __at(0x0F4C) volatile __PWM3CONbits_t PWM3CONbits;
2568 #define _PWM3CON_P3DC0 0x01
2569 #define _PWM3CON_P3DC1 0x02
2570 #define _PWM3CON_P3DC2 0x04
2571 #define _PWM3CON_P3DC3 0x08
2572 #define _PWM3CON_P3DC4 0x10
2573 #define _PWM3CON_P3DC5 0x20
2574 #define _PWM3CON_P3DC6 0x40
2575 #define _PWM3CON_P3RSEN 0x80
2577 //==============================================================================
2580 //==============================================================================
2581 // ECCP3AS Bits
2583 extern __at(0x0F4D) __sfr ECCP3AS;
2585 typedef union
2587 struct
2589 unsigned PSS3BD0 : 1;
2590 unsigned PSS3BD1 : 1;
2591 unsigned PSS3AC0 : 1;
2592 unsigned PSS3AC1 : 1;
2593 unsigned ECCP3AS0 : 1;
2594 unsigned ECCP3AS1 : 1;
2595 unsigned ECCP3AS2 : 1;
2596 unsigned ECCP3ASE : 1;
2599 struct
2601 unsigned PSS3BD : 2;
2602 unsigned : 6;
2605 struct
2607 unsigned : 2;
2608 unsigned PSS3AC : 2;
2609 unsigned : 4;
2612 struct
2614 unsigned : 4;
2615 unsigned ECCP3AS : 3;
2616 unsigned : 1;
2618 } __ECCP3ASbits_t;
2620 extern __at(0x0F4D) volatile __ECCP3ASbits_t ECCP3ASbits;
2622 #define _PSS3BD0 0x01
2623 #define _PSS3BD1 0x02
2624 #define _PSS3AC0 0x04
2625 #define _PSS3AC1 0x08
2626 #define _ECCP3AS0 0x10
2627 #define _ECCP3AS1 0x20
2628 #define _ECCP3AS2 0x40
2629 #define _ECCP3ASE 0x80
2631 //==============================================================================
2634 //==============================================================================
2635 // CCP2CON Bits
2637 extern __at(0x0F4E) __sfr CCP2CON;
2639 typedef union
2641 struct
2643 unsigned CCP2M0 : 1;
2644 unsigned CCP2M1 : 1;
2645 unsigned CCP2M2 : 1;
2646 unsigned CCP2M3 : 1;
2647 unsigned DC2B0 : 1;
2648 unsigned DC2B1 : 1;
2649 unsigned P2M0 : 1;
2650 unsigned P2M1 : 1;
2653 struct
2655 unsigned : 1;
2656 unsigned : 1;
2657 unsigned : 1;
2658 unsigned : 1;
2659 unsigned CCP2Y : 1;
2660 unsigned CCP2X : 1;
2661 unsigned : 1;
2662 unsigned : 1;
2665 struct
2667 unsigned CCP2M : 4;
2668 unsigned : 4;
2671 struct
2673 unsigned : 4;
2674 unsigned DC2B : 2;
2675 unsigned : 2;
2678 struct
2680 unsigned : 6;
2681 unsigned P2M : 2;
2683 } __CCP2CONbits_t;
2685 extern __at(0x0F4E) volatile __CCP2CONbits_t CCP2CONbits;
2687 #define _CCP2M0 0x01
2688 #define _CCP2M1 0x02
2689 #define _CCP2M2 0x04
2690 #define _CCP2M3 0x08
2691 #define _DC2B0 0x10
2692 #define _CCP2Y 0x10
2693 #define _DC2B1 0x20
2694 #define _CCP2X 0x20
2695 #define _P2M0 0x40
2696 #define _P2M1 0x80
2698 //==============================================================================
2701 //==============================================================================
2702 // ECCP2CON Bits
2704 extern __at(0x0F4E) __sfr ECCP2CON;
2706 typedef union
2708 struct
2710 unsigned CCP2M0 : 1;
2711 unsigned CCP2M1 : 1;
2712 unsigned CCP2M2 : 1;
2713 unsigned CCP2M3 : 1;
2714 unsigned DC2B0 : 1;
2715 unsigned DC2B1 : 1;
2716 unsigned P2M0 : 1;
2717 unsigned P2M1 : 1;
2720 struct
2722 unsigned : 1;
2723 unsigned : 1;
2724 unsigned : 1;
2725 unsigned : 1;
2726 unsigned CCP2Y : 1;
2727 unsigned CCP2X : 1;
2728 unsigned : 1;
2729 unsigned : 1;
2732 struct
2734 unsigned CCP2M : 4;
2735 unsigned : 4;
2738 struct
2740 unsigned : 4;
2741 unsigned DC2B : 2;
2742 unsigned : 2;
2745 struct
2747 unsigned : 6;
2748 unsigned P2M : 2;
2750 } __ECCP2CONbits_t;
2752 extern __at(0x0F4E) volatile __ECCP2CONbits_t ECCP2CONbits;
2754 #define _ECCP2CON_CCP2M0 0x01
2755 #define _ECCP2CON_CCP2M1 0x02
2756 #define _ECCP2CON_CCP2M2 0x04
2757 #define _ECCP2CON_CCP2M3 0x08
2758 #define _ECCP2CON_DC2B0 0x10
2759 #define _ECCP2CON_CCP2Y 0x10
2760 #define _ECCP2CON_DC2B1 0x20
2761 #define _ECCP2CON_CCP2X 0x20
2762 #define _ECCP2CON_P2M0 0x40
2763 #define _ECCP2CON_P2M1 0x80
2765 //==============================================================================
2767 extern __at(0x0F4F) __sfr CCPR2;
2768 extern __at(0x0F4F) __sfr CCPR2L;
2769 extern __at(0x0F50) __sfr CCPR2H;
2771 //==============================================================================
2772 // ECCP2DEL Bits
2774 extern __at(0x0F51) __sfr ECCP2DEL;
2776 typedef union
2778 struct
2780 unsigned P2DC0 : 1;
2781 unsigned P2DC1 : 1;
2782 unsigned P2DC2 : 1;
2783 unsigned P2DC3 : 1;
2784 unsigned P2DC4 : 1;
2785 unsigned P2DC5 : 1;
2786 unsigned P2DC6 : 1;
2787 unsigned P2RSEN : 1;
2790 struct
2792 unsigned P2DC : 7;
2793 unsigned : 1;
2795 } __ECCP2DELbits_t;
2797 extern __at(0x0F51) volatile __ECCP2DELbits_t ECCP2DELbits;
2799 #define _P2DC0 0x01
2800 #define _P2DC1 0x02
2801 #define _P2DC2 0x04
2802 #define _P2DC3 0x08
2803 #define _P2DC4 0x10
2804 #define _P2DC5 0x20
2805 #define _P2DC6 0x40
2806 #define _P2RSEN 0x80
2808 //==============================================================================
2811 //==============================================================================
2812 // PWM2CON Bits
2814 extern __at(0x0F51) __sfr PWM2CON;
2816 typedef union
2818 struct
2820 unsigned P2DC0 : 1;
2821 unsigned P2DC1 : 1;
2822 unsigned P2DC2 : 1;
2823 unsigned P2DC3 : 1;
2824 unsigned P2DC4 : 1;
2825 unsigned P2DC5 : 1;
2826 unsigned P2DC6 : 1;
2827 unsigned P2RSEN : 1;
2830 struct
2832 unsigned P2DC : 7;
2833 unsigned : 1;
2835 } __PWM2CONbits_t;
2837 extern __at(0x0F51) volatile __PWM2CONbits_t PWM2CONbits;
2839 #define _PWM2CON_P2DC0 0x01
2840 #define _PWM2CON_P2DC1 0x02
2841 #define _PWM2CON_P2DC2 0x04
2842 #define _PWM2CON_P2DC3 0x08
2843 #define _PWM2CON_P2DC4 0x10
2844 #define _PWM2CON_P2DC5 0x20
2845 #define _PWM2CON_P2DC6 0x40
2846 #define _PWM2CON_P2RSEN 0x80
2848 //==============================================================================
2851 //==============================================================================
2852 // ECCP2AS Bits
2854 extern __at(0x0F52) __sfr ECCP2AS;
2856 typedef union
2858 struct
2860 unsigned PSS2BD0 : 1;
2861 unsigned PSS2BD1 : 1;
2862 unsigned PSS2AC0 : 1;
2863 unsigned PSS2AC1 : 1;
2864 unsigned ECCP2AS0 : 1;
2865 unsigned ECCP2AS1 : 1;
2866 unsigned ECCP2AS2 : 1;
2867 unsigned ECCP2ASE : 1;
2870 struct
2872 unsigned PSS2BD : 2;
2873 unsigned : 6;
2876 struct
2878 unsigned : 2;
2879 unsigned PSS2AC : 2;
2880 unsigned : 4;
2883 struct
2885 unsigned : 4;
2886 unsigned ECCP2AS : 3;
2887 unsigned : 1;
2889 } __ECCP2ASbits_t;
2891 extern __at(0x0F52) volatile __ECCP2ASbits_t ECCP2ASbits;
2893 #define _PSS2BD0 0x01
2894 #define _PSS2BD1 0x02
2895 #define _PSS2AC0 0x04
2896 #define _PSS2AC1 0x08
2897 #define _ECCP2AS0 0x10
2898 #define _ECCP2AS1 0x20
2899 #define _ECCP2AS2 0x40
2900 #define _ECCP2ASE 0x80
2902 //==============================================================================
2905 //==============================================================================
2906 // PADCFG1 Bits
2908 extern __at(0x0F53) __sfr PADCFG1;
2910 typedef union
2912 struct
2914 unsigned : 1;
2915 unsigned RTSECSEL0 : 1;
2916 unsigned RTSECSEL1 : 1;
2917 unsigned : 1;
2918 unsigned : 1;
2919 unsigned RJPU : 1;
2920 unsigned REPU : 1;
2921 unsigned RDPU : 1;
2924 struct
2926 unsigned : 1;
2927 unsigned RTSECSEL : 2;
2928 unsigned : 5;
2930 } __PADCFG1bits_t;
2932 extern __at(0x0F53) volatile __PADCFG1bits_t PADCFG1bits;
2934 #define _RTSECSEL0 0x02
2935 #define _RTSECSEL1 0x04
2936 #define _RJPU 0x20
2937 #define _REPU 0x40
2938 #define _RDPU 0x80
2940 //==============================================================================
2943 //==============================================================================
2944 // CM1CON Bits
2946 extern __at(0x0F54) __sfr CM1CON;
2948 typedef union
2950 struct
2952 unsigned CCH0 : 1;
2953 unsigned CCH1 : 1;
2954 unsigned CREF : 1;
2955 unsigned EVPOL0 : 1;
2956 unsigned EVPOL1 : 1;
2957 unsigned CPOL : 1;
2958 unsigned COE : 1;
2959 unsigned CON : 1;
2962 struct
2964 unsigned CCH : 2;
2965 unsigned : 6;
2968 struct
2970 unsigned : 3;
2971 unsigned EVPOL : 2;
2972 unsigned : 3;
2974 } __CM1CONbits_t;
2976 extern __at(0x0F54) volatile __CM1CONbits_t CM1CONbits;
2978 #define _CCH0 0x01
2979 #define _CCH1 0x02
2980 #define _CREF 0x04
2981 #define _EVPOL0 0x08
2982 #define _EVPOL1 0x10
2983 #define _CPOL 0x20
2984 #define _COE 0x40
2985 #define _CON 0x80
2987 //==============================================================================
2990 //==============================================================================
2991 // CM1CON1 Bits
2993 extern __at(0x0F54) __sfr CM1CON1;
2995 typedef union
2997 struct
2999 unsigned CCH0 : 1;
3000 unsigned CCH1 : 1;
3001 unsigned CREF : 1;
3002 unsigned EVPOL0 : 1;
3003 unsigned EVPOL1 : 1;
3004 unsigned CPOL : 1;
3005 unsigned COE : 1;
3006 unsigned CON : 1;
3009 struct
3011 unsigned CCH : 2;
3012 unsigned : 6;
3015 struct
3017 unsigned : 3;
3018 unsigned EVPOL : 2;
3019 unsigned : 3;
3021 } __CM1CON1bits_t;
3023 extern __at(0x0F54) volatile __CM1CON1bits_t CM1CON1bits;
3025 #define _CM1CON1_CCH0 0x01
3026 #define _CM1CON1_CCH1 0x02
3027 #define _CM1CON1_CREF 0x04
3028 #define _CM1CON1_EVPOL0 0x08
3029 #define _CM1CON1_EVPOL1 0x10
3030 #define _CM1CON1_CPOL 0x20
3031 #define _CM1CON1_COE 0x40
3032 #define _CM1CON1_CON 0x80
3034 //==============================================================================
3037 //==============================================================================
3038 // CTMUICON Bits
3040 extern __at(0x0F55) __sfr CTMUICON;
3042 typedef union
3044 struct
3046 unsigned IRNG0 : 1;
3047 unsigned IRNG1 : 1;
3048 unsigned ITRIM0 : 1;
3049 unsigned ITRIM1 : 1;
3050 unsigned ITRIM2 : 1;
3051 unsigned ITRIM3 : 1;
3052 unsigned ITRIM4 : 1;
3053 unsigned ITRIM5 : 1;
3056 struct
3058 unsigned IRNG : 2;
3059 unsigned : 6;
3062 struct
3064 unsigned : 2;
3065 unsigned ITRIM : 6;
3067 } __CTMUICONbits_t;
3069 extern __at(0x0F55) volatile __CTMUICONbits_t CTMUICONbits;
3071 #define _IRNG0 0x01
3072 #define _IRNG1 0x02
3073 #define _ITRIM0 0x04
3074 #define _ITRIM1 0x08
3075 #define _ITRIM2 0x10
3076 #define _ITRIM3 0x20
3077 #define _ITRIM4 0x40
3078 #define _ITRIM5 0x80
3080 //==============================================================================
3083 //==============================================================================
3084 // CTMUCONL Bits
3086 extern __at(0x0F56) __sfr CTMUCONL;
3088 typedef union
3090 struct
3092 unsigned EDG1STAT : 1;
3093 unsigned EDG2STAT : 1;
3094 unsigned EDG1SEL0 : 1;
3095 unsigned EDG1SEL1 : 1;
3096 unsigned EDG1POL : 1;
3097 unsigned EDG2SEL0 : 1;
3098 unsigned EDG2SEL1 : 1;
3099 unsigned EDG2POL : 1;
3102 struct
3104 unsigned : 2;
3105 unsigned EDG1SEL : 2;
3106 unsigned : 4;
3109 struct
3111 unsigned : 5;
3112 unsigned EDG2SEL : 2;
3113 unsigned : 1;
3115 } __CTMUCONLbits_t;
3117 extern __at(0x0F56) volatile __CTMUCONLbits_t CTMUCONLbits;
3119 #define _EDG1STAT 0x01
3120 #define _EDG2STAT 0x02
3121 #define _EDG1SEL0 0x04
3122 #define _EDG1SEL1 0x08
3123 #define _EDG1POL 0x10
3124 #define _EDG2SEL0 0x20
3125 #define _EDG2SEL1 0x40
3126 #define _EDG2POL 0x80
3128 //==============================================================================
3131 //==============================================================================
3132 // CTMUCONH Bits
3134 extern __at(0x0F57) __sfr CTMUCONH;
3136 typedef struct
3138 unsigned CTTRIG : 1;
3139 unsigned IDISSEN : 1;
3140 unsigned EDGSEQEN : 1;
3141 unsigned EDGEN : 1;
3142 unsigned TGEN : 1;
3143 unsigned CTMUSIDL : 1;
3144 unsigned : 1;
3145 unsigned CTMUEN : 1;
3146 } __CTMUCONHbits_t;
3148 extern __at(0x0F57) volatile __CTMUCONHbits_t CTMUCONHbits;
3150 #define _CTTRIG 0x01
3151 #define _IDISSEN 0x02
3152 #define _EDGSEQEN 0x04
3153 #define _EDGEN 0x08
3154 #define _TGEN 0x10
3155 #define _CTMUSIDL 0x20
3156 #define _CTMUEN 0x80
3158 //==============================================================================
3160 extern __at(0x0F58) __sfr ALRMVAL;
3161 extern __at(0x0F58) __sfr ALRMVALL;
3162 extern __at(0x0F59) __sfr ALRMVALH;
3164 //==============================================================================
3165 // ALRMRPT Bits
3167 extern __at(0x0F5A) __sfr ALRMRPT;
3169 typedef struct
3171 unsigned ARPT0 : 1;
3172 unsigned ARPT1 : 1;
3173 unsigned ARPT2 : 1;
3174 unsigned ARPT3 : 1;
3175 unsigned ARPT4 : 1;
3176 unsigned ARPT5 : 1;
3177 unsigned ARPT6 : 1;
3178 unsigned ARPT7 : 1;
3179 } __ALRMRPTbits_t;
3181 extern __at(0x0F5A) volatile __ALRMRPTbits_t ALRMRPTbits;
3183 #define _ARPT0 0x01
3184 #define _ARPT1 0x02
3185 #define _ARPT2 0x04
3186 #define _ARPT3 0x08
3187 #define _ARPT4 0x10
3188 #define _ARPT5 0x20
3189 #define _ARPT6 0x40
3190 #define _ARPT7 0x80
3192 //==============================================================================
3195 //==============================================================================
3196 // ALRMCFG Bits
3198 extern __at(0x0F5B) __sfr ALRMCFG;
3200 typedef union
3202 struct
3204 unsigned ALRMPTR0 : 1;
3205 unsigned ALRMPTR1 : 1;
3206 unsigned AMASK0 : 1;
3207 unsigned AMASK1 : 1;
3208 unsigned AMASK2 : 1;
3209 unsigned AMASK3 : 1;
3210 unsigned CHIME : 1;
3211 unsigned ALRMEN : 1;
3214 struct
3216 unsigned ALRMPTR : 2;
3217 unsigned : 6;
3220 struct
3222 unsigned : 2;
3223 unsigned AMASK : 4;
3224 unsigned : 2;
3226 } __ALRMCFGbits_t;
3228 extern __at(0x0F5B) volatile __ALRMCFGbits_t ALRMCFGbits;
3230 #define _ALRMPTR0 0x01
3231 #define _ALRMPTR1 0x02
3232 #define _AMASK0 0x04
3233 #define _AMASK1 0x08
3234 #define _AMASK2 0x10
3235 #define _AMASK3 0x20
3236 #define _CHIME 0x40
3237 #define _ALRMEN 0x80
3239 //==============================================================================
3241 extern __at(0x0F5C) __sfr RTCVAL;
3242 extern __at(0x0F5C) __sfr RTCVALL;
3244 //==============================================================================
3245 // RTCVALH Bits
3247 extern __at(0x0F5D) __sfr RTCVALH;
3249 typedef union
3251 struct
3253 unsigned WAITE0 : 1;
3254 unsigned WAITE1 : 1;
3255 unsigned WAITM0 : 1;
3256 unsigned WAITM1 : 1;
3257 unsigned WAITM2 : 1;
3258 unsigned WAITM3 : 1;
3259 unsigned WAITB0 : 1;
3260 unsigned WAITB1 : 1;
3263 struct
3265 unsigned WAITE : 2;
3266 unsigned : 6;
3269 struct
3271 unsigned : 2;
3272 unsigned WAITM : 4;
3273 unsigned : 2;
3276 struct
3278 unsigned : 6;
3279 unsigned WAITB : 2;
3281 } __RTCVALHbits_t;
3283 extern __at(0x0F5D) volatile __RTCVALHbits_t RTCVALHbits;
3285 #define _WAITE0 0x01
3286 #define _WAITE1 0x02
3287 #define _WAITM0 0x04
3288 #define _WAITM1 0x08
3289 #define _WAITM2 0x10
3290 #define _WAITM3 0x20
3291 #define _WAITB0 0x40
3292 #define _WAITB1 0x80
3294 //==============================================================================
3297 //==============================================================================
3298 // RTCCAL Bits
3300 extern __at(0x0F5E) __sfr RTCCAL;
3302 typedef struct
3304 unsigned CAL0 : 1;
3305 unsigned CAL1 : 1;
3306 unsigned CAL2 : 1;
3307 unsigned CAL3 : 1;
3308 unsigned CAL4 : 1;
3309 unsigned CAL5 : 1;
3310 unsigned CAL6 : 1;
3311 unsigned CAL7 : 1;
3312 } __RTCCALbits_t;
3314 extern __at(0x0F5E) volatile __RTCCALbits_t RTCCALbits;
3316 #define _CAL0 0x01
3317 #define _CAL1 0x02
3318 #define _CAL2 0x04
3319 #define _CAL3 0x08
3320 #define _CAL4 0x10
3321 #define _CAL5 0x20
3322 #define _CAL6 0x40
3323 #define _CAL7 0x80
3325 //==============================================================================
3328 //==============================================================================
3329 // RTCCFG Bits
3331 extern __at(0x0F5F) __sfr RTCCFG;
3333 typedef union
3335 struct
3337 unsigned RTCPTR0 : 1;
3338 unsigned RTCPTR1 : 1;
3339 unsigned RTCOE : 1;
3340 unsigned HALFSEC : 1;
3341 unsigned RTCSYNC : 1;
3342 unsigned RTCWREN : 1;
3343 unsigned : 1;
3344 unsigned RTCEN : 1;
3347 struct
3349 unsigned RTCPTR : 2;
3350 unsigned : 6;
3352 } __RTCCFGbits_t;
3354 extern __at(0x0F5F) volatile __RTCCFGbits_t RTCCFGbits;
3356 #define _RTCPTR0 0x01
3357 #define _RTCPTR1 0x02
3358 #define _RTCOE 0x04
3359 #define _HALFSEC 0x08
3360 #define _RTCSYNC 0x10
3361 #define _RTCWREN 0x20
3362 #define _RTCEN 0x80
3364 //==============================================================================
3367 //==============================================================================
3368 // PIE6 Bits
3370 extern __at(0x0F60) __sfr PIE6;
3372 typedef struct
3374 unsigned CMP1IE : 1;
3375 unsigned CMP2IE : 1;
3376 unsigned CMP3IE : 1;
3377 unsigned : 1;
3378 unsigned EEIE : 1;
3379 unsigned : 1;
3380 unsigned : 1;
3381 unsigned : 1;
3382 } __PIE6bits_t;
3384 extern __at(0x0F60) volatile __PIE6bits_t PIE6bits;
3386 #define _CMP1IE 0x01
3387 #define _CMP2IE 0x02
3388 #define _CMP3IE 0x04
3389 #define _EEIE 0x10
3391 //==============================================================================
3393 extern __at(0x0F61) __sfr EEDATA;
3394 extern __at(0x0F62) __sfr EEADR;
3395 extern __at(0x0F63) __sfr EEADRH;
3397 //==============================================================================
3398 // OSCCON2 Bits
3400 extern __at(0x0F64) __sfr OSCCON2;
3402 typedef struct
3404 unsigned MFIOSEL : 1;
3405 unsigned MFIOFS : 1;
3406 unsigned : 1;
3407 unsigned SOSCGO : 1;
3408 unsigned : 1;
3409 unsigned : 1;
3410 unsigned SOSCRUN : 1;
3411 unsigned : 1;
3412 } __OSCCON2bits_t;
3414 extern __at(0x0F64) volatile __OSCCON2bits_t OSCCON2bits;
3416 #define _MFIOSEL 0x01
3417 #define _MFIOFS 0x02
3418 #define _SOSCGO 0x08
3419 #define _SOSCRUN 0x40
3421 //==============================================================================
3424 //==============================================================================
3425 // BAUDCON Bits
3427 extern __at(0x0F65) __sfr BAUDCON;
3429 typedef struct
3431 unsigned ABDEN : 1;
3432 unsigned WUE : 1;
3433 unsigned : 1;
3434 unsigned BRG16 : 1;
3435 unsigned TXCKP : 1;
3436 unsigned RXDTP : 1;
3437 unsigned RCIDL : 1;
3438 unsigned ABDOVF : 1;
3439 } __BAUDCONbits_t;
3441 extern __at(0x0F65) volatile __BAUDCONbits_t BAUDCONbits;
3443 #define _ABDEN 0x01
3444 #define _WUE 0x02
3445 #define _BRG16 0x08
3446 #define _TXCKP 0x10
3447 #define _RXDTP 0x20
3448 #define _RCIDL 0x40
3449 #define _ABDOVF 0x80
3451 //==============================================================================
3454 //==============================================================================
3455 // BAUDCON1 Bits
3457 extern __at(0x0F65) __sfr BAUDCON1;
3459 typedef struct
3461 unsigned ABDEN : 1;
3462 unsigned WUE : 1;
3463 unsigned : 1;
3464 unsigned BRG16 : 1;
3465 unsigned TXCKP : 1;
3466 unsigned RXDTP : 1;
3467 unsigned RCIDL : 1;
3468 unsigned ABDOVF : 1;
3469 } __BAUDCON1bits_t;
3471 extern __at(0x0F65) volatile __BAUDCON1bits_t BAUDCON1bits;
3473 #define _BAUDCON1_ABDEN 0x01
3474 #define _BAUDCON1_WUE 0x02
3475 #define _BAUDCON1_BRG16 0x08
3476 #define _BAUDCON1_TXCKP 0x10
3477 #define _BAUDCON1_RXDTP 0x20
3478 #define _BAUDCON1_RCIDL 0x40
3479 #define _BAUDCON1_ABDOVF 0x80
3481 //==============================================================================
3484 //==============================================================================
3485 // BAUDCTL Bits
3487 extern __at(0x0F65) __sfr BAUDCTL;
3489 typedef struct
3491 unsigned ABDEN : 1;
3492 unsigned WUE : 1;
3493 unsigned : 1;
3494 unsigned BRG16 : 1;
3495 unsigned TXCKP : 1;
3496 unsigned RXDTP : 1;
3497 unsigned RCIDL : 1;
3498 unsigned ABDOVF : 1;
3499 } __BAUDCTLbits_t;
3501 extern __at(0x0F65) volatile __BAUDCTLbits_t BAUDCTLbits;
3503 #define _BAUDCTL_ABDEN 0x01
3504 #define _BAUDCTL_WUE 0x02
3505 #define _BAUDCTL_BRG16 0x08
3506 #define _BAUDCTL_TXCKP 0x10
3507 #define _BAUDCTL_RXDTP 0x20
3508 #define _BAUDCTL_RCIDL 0x40
3509 #define _BAUDCTL_ABDOVF 0x80
3511 //==============================================================================
3514 //==============================================================================
3515 // LCDDATA0 Bits
3517 extern __at(0x0F66) __sfr LCDDATA0;
3519 typedef struct
3521 unsigned S00C0 : 1;
3522 unsigned S01C0 : 1;
3523 unsigned S02C0 : 1;
3524 unsigned S03C0 : 1;
3525 unsigned S04C0 : 1;
3526 unsigned S05C0 : 1;
3527 unsigned S06C0 : 1;
3528 unsigned S07C0 : 1;
3529 } __LCDDATA0bits_t;
3531 extern __at(0x0F66) volatile __LCDDATA0bits_t LCDDATA0bits;
3533 #define _S00C0 0x01
3534 #define _S01C0 0x02
3535 #define _S02C0 0x04
3536 #define _S03C0 0x08
3537 #define _S04C0 0x10
3538 #define _S05C0 0x20
3539 #define _S06C0 0x40
3540 #define _S07C0 0x80
3542 //==============================================================================
3545 //==============================================================================
3546 // LCDDATA1 Bits
3548 extern __at(0x0F67) __sfr LCDDATA1;
3550 typedef struct
3552 unsigned S08C0 : 1;
3553 unsigned S09C0 : 1;
3554 unsigned S10C0 : 1;
3555 unsigned S11C0 : 1;
3556 unsigned S12C0 : 1;
3557 unsigned S13C0 : 1;
3558 unsigned S14C0 : 1;
3559 unsigned S15C0 : 1;
3560 } __LCDDATA1bits_t;
3562 extern __at(0x0F67) volatile __LCDDATA1bits_t LCDDATA1bits;
3564 #define _S08C0 0x01
3565 #define _S09C0 0x02
3566 #define _S10C0 0x04
3567 #define _S11C0 0x08
3568 #define _S12C0 0x10
3569 #define _S13C0 0x20
3570 #define _S14C0 0x40
3571 #define _S15C0 0x80
3573 //==============================================================================
3576 //==============================================================================
3577 // LCDDATA2 Bits
3579 extern __at(0x0F68) __sfr LCDDATA2;
3581 typedef struct
3583 unsigned S16C0 : 1;
3584 unsigned S17C0 : 1;
3585 unsigned S18C0 : 1;
3586 unsigned S19C0 : 1;
3587 unsigned S20C0 : 1;
3588 unsigned S21C0 : 1;
3589 unsigned S22C0 : 1;
3590 unsigned S23C0 : 1;
3591 } __LCDDATA2bits_t;
3593 extern __at(0x0F68) volatile __LCDDATA2bits_t LCDDATA2bits;
3595 #define _S16C0 0x01
3596 #define _S17C0 0x02
3597 #define _S18C0 0x04
3598 #define _S19C0 0x08
3599 #define _S20C0 0x10
3600 #define _S21C0 0x20
3601 #define _S22C0 0x40
3602 #define _S23C0 0x80
3604 //==============================================================================
3607 //==============================================================================
3608 // LCDDATA3 Bits
3610 extern __at(0x0F69) __sfr LCDDATA3;
3612 typedef struct
3614 unsigned S24C0 : 1;
3615 unsigned S25C0 : 1;
3616 unsigned S26C0 : 1;
3617 unsigned S27C0 : 1;
3618 unsigned S28C0 : 1;
3619 unsigned S29C0 : 1;
3620 unsigned S30C0 : 1;
3621 unsigned S31C0 : 1;
3622 } __LCDDATA3bits_t;
3624 extern __at(0x0F69) volatile __LCDDATA3bits_t LCDDATA3bits;
3626 #define _S24C0 0x01
3627 #define _S25C0 0x02
3628 #define _S26C0 0x04
3629 #define _S27C0 0x08
3630 #define _S28C0 0x10
3631 #define _S29C0 0x20
3632 #define _S30C0 0x40
3633 #define _S31C0 0x80
3635 //==============================================================================
3638 //==============================================================================
3639 // LCDDATA4 Bits
3641 extern __at(0x0F6A) __sfr LCDDATA4;
3643 typedef struct
3645 unsigned S32C0 : 1;
3646 unsigned S33C0 : 1;
3647 unsigned S34C0 : 1;
3648 unsigned S35C0 : 1;
3649 unsigned S36C0 : 1;
3650 unsigned S37C0 : 1;
3651 unsigned S38C0 : 1;
3652 unsigned S39C0 : 1;
3653 } __LCDDATA4bits_t;
3655 extern __at(0x0F6A) volatile __LCDDATA4bits_t LCDDATA4bits;
3657 #define _S32C0 0x01
3658 #define _S33C0 0x02
3659 #define _S34C0 0x04
3660 #define _S35C0 0x08
3661 #define _S36C0 0x10
3662 #define _S37C0 0x20
3663 #define _S38C0 0x40
3664 #define _S39C0 0x80
3666 //==============================================================================
3669 //==============================================================================
3670 // LCDDATA5 Bits
3672 extern __at(0x0F6B) __sfr LCDDATA5;
3674 typedef struct
3676 unsigned S40C0 : 1;
3677 unsigned S41C0 : 1;
3678 unsigned S42C0 : 1;
3679 unsigned S43C0 : 1;
3680 unsigned S44C0 : 1;
3681 unsigned S45C0 : 1;
3682 unsigned S46C0 : 1;
3683 unsigned S47C0 : 1;
3684 } __LCDDATA5bits_t;
3686 extern __at(0x0F6B) volatile __LCDDATA5bits_t LCDDATA5bits;
3688 #define _S40C0 0x01
3689 #define _S41C0 0x02
3690 #define _S42C0 0x04
3691 #define _S43C0 0x08
3692 #define _S44C0 0x10
3693 #define _S45C0 0x20
3694 #define _S46C0 0x40
3695 #define _S47C0 0x80
3697 //==============================================================================
3700 //==============================================================================
3701 // LCDDATA6 Bits
3703 extern __at(0x0F6C) __sfr LCDDATA6;
3705 typedef struct
3707 unsigned S00C1 : 1;
3708 unsigned S01C1 : 1;
3709 unsigned S02C1 : 1;
3710 unsigned S03C1 : 1;
3711 unsigned S04C1 : 1;
3712 unsigned S05C1 : 1;
3713 unsigned S06C1 : 1;
3714 unsigned S07C1 : 1;
3715 } __LCDDATA6bits_t;
3717 extern __at(0x0F6C) volatile __LCDDATA6bits_t LCDDATA6bits;
3719 #define _S00C1 0x01
3720 #define _S01C1 0x02
3721 #define _S02C1 0x04
3722 #define _S03C1 0x08
3723 #define _S04C1 0x10
3724 #define _S05C1 0x20
3725 #define _S06C1 0x40
3726 #define _S07C1 0x80
3728 //==============================================================================
3731 //==============================================================================
3732 // LCDDATA7 Bits
3734 extern __at(0x0F6D) __sfr LCDDATA7;
3736 typedef struct
3738 unsigned S08C1 : 1;
3739 unsigned S09C1 : 1;
3740 unsigned S10C1 : 1;
3741 unsigned S11C1 : 1;
3742 unsigned S12C1 : 1;
3743 unsigned S13C1 : 1;
3744 unsigned S14C1 : 1;
3745 unsigned S15C1 : 1;
3746 } __LCDDATA7bits_t;
3748 extern __at(0x0F6D) volatile __LCDDATA7bits_t LCDDATA7bits;
3750 #define _S08C1 0x01
3751 #define _S09C1 0x02
3752 #define _S10C1 0x04
3753 #define _S11C1 0x08
3754 #define _S12C1 0x10
3755 #define _S13C1 0x20
3756 #define _S14C1 0x40
3757 #define _S15C1 0x80
3759 //==============================================================================
3762 //==============================================================================
3763 // LCDDATA8 Bits
3765 extern __at(0x0F6E) __sfr LCDDATA8;
3767 typedef struct
3769 unsigned S16C1 : 1;
3770 unsigned S17C1 : 1;
3771 unsigned S18C1 : 1;
3772 unsigned S19C1 : 1;
3773 unsigned S20C1 : 1;
3774 unsigned S21C1 : 1;
3775 unsigned S22C1 : 1;
3776 unsigned S23C1 : 1;
3777 } __LCDDATA8bits_t;
3779 extern __at(0x0F6E) volatile __LCDDATA8bits_t LCDDATA8bits;
3781 #define _S16C1 0x01
3782 #define _S17C1 0x02
3783 #define _S18C1 0x04
3784 #define _S19C1 0x08
3785 #define _S20C1 0x10
3786 #define _S21C1 0x20
3787 #define _S22C1 0x40
3788 #define _S23C1 0x80
3790 //==============================================================================
3793 //==============================================================================
3794 // LCDDATA9 Bits
3796 extern __at(0x0F6F) __sfr LCDDATA9;
3798 typedef struct
3800 unsigned S24C1 : 1;
3801 unsigned S25C1 : 1;
3802 unsigned S26C1 : 1;
3803 unsigned S27C1 : 1;
3804 unsigned S28C1 : 1;
3805 unsigned S29C1 : 1;
3806 unsigned S30C1 : 1;
3807 unsigned S31C1 : 1;
3808 } __LCDDATA9bits_t;
3810 extern __at(0x0F6F) volatile __LCDDATA9bits_t LCDDATA9bits;
3812 #define _S24C1 0x01
3813 #define _S25C1 0x02
3814 #define _S26C1 0x04
3815 #define _S27C1 0x08
3816 #define _S28C1 0x10
3817 #define _S29C1 0x20
3818 #define _S30C1 0x40
3819 #define _S31C1 0x80
3821 //==============================================================================
3824 //==============================================================================
3825 // LCDDATA10 Bits
3827 extern __at(0x0F70) __sfr LCDDATA10;
3829 typedef struct
3831 unsigned S32C1 : 1;
3832 unsigned S33C1 : 1;
3833 unsigned S34C1 : 1;
3834 unsigned S35C1 : 1;
3835 unsigned S36C1 : 1;
3836 unsigned S37C1 : 1;
3837 unsigned S38C1 : 1;
3838 unsigned S39C1 : 1;
3839 } __LCDDATA10bits_t;
3841 extern __at(0x0F70) volatile __LCDDATA10bits_t LCDDATA10bits;
3843 #define _S32C1 0x01
3844 #define _S33C1 0x02
3845 #define _S34C1 0x04
3846 #define _S35C1 0x08
3847 #define _S36C1 0x10
3848 #define _S37C1 0x20
3849 #define _S38C1 0x40
3850 #define _S39C1 0x80
3852 //==============================================================================
3855 //==============================================================================
3856 // LCDDATA11 Bits
3858 extern __at(0x0F71) __sfr LCDDATA11;
3860 typedef struct
3862 unsigned S40C1 : 1;
3863 unsigned S41C1 : 1;
3864 unsigned S42C1 : 1;
3865 unsigned S43C1 : 1;
3866 unsigned S44C1 : 1;
3867 unsigned S45C1 : 1;
3868 unsigned S46C1 : 1;
3869 unsigned S47C1 : 1;
3870 } __LCDDATA11bits_t;
3872 extern __at(0x0F71) volatile __LCDDATA11bits_t LCDDATA11bits;
3874 #define _S40C1 0x01
3875 #define _S41C1 0x02
3876 #define _S42C1 0x04
3877 #define _S43C1 0x08
3878 #define _S44C1 0x10
3879 #define _S45C1 0x20
3880 #define _S46C1 0x40
3881 #define _S47C1 0x80
3883 //==============================================================================
3886 //==============================================================================
3887 // LCDDATA12 Bits
3889 extern __at(0x0F72) __sfr LCDDATA12;
3891 typedef struct
3893 unsigned S00C2 : 1;
3894 unsigned S01C2 : 1;
3895 unsigned S02C2 : 1;
3896 unsigned S03C2 : 1;
3897 unsigned S04C2 : 1;
3898 unsigned S05C2 : 1;
3899 unsigned S06C2 : 1;
3900 unsigned S07C2 : 1;
3901 } __LCDDATA12bits_t;
3903 extern __at(0x0F72) volatile __LCDDATA12bits_t LCDDATA12bits;
3905 #define _S00C2 0x01
3906 #define _S01C2 0x02
3907 #define _S02C2 0x04
3908 #define _S03C2 0x08
3909 #define _S04C2 0x10
3910 #define _S05C2 0x20
3911 #define _S06C2 0x40
3912 #define _S07C2 0x80
3914 //==============================================================================
3917 //==============================================================================
3918 // LCDDATA13 Bits
3920 extern __at(0x0F73) __sfr LCDDATA13;
3922 typedef struct
3924 unsigned S08C2 : 1;
3925 unsigned S09C2 : 1;
3926 unsigned S10C2 : 1;
3927 unsigned S11C2 : 1;
3928 unsigned S12C2 : 1;
3929 unsigned S13C2 : 1;
3930 unsigned S14C2 : 1;
3931 unsigned S15C2 : 1;
3932 } __LCDDATA13bits_t;
3934 extern __at(0x0F73) volatile __LCDDATA13bits_t LCDDATA13bits;
3936 #define _S08C2 0x01
3937 #define _S09C2 0x02
3938 #define _S10C2 0x04
3939 #define _S11C2 0x08
3940 #define _S12C2 0x10
3941 #define _S13C2 0x20
3942 #define _S14C2 0x40
3943 #define _S15C2 0x80
3945 //==============================================================================
3948 //==============================================================================
3949 // LCDDATA14 Bits
3951 extern __at(0x0F74) __sfr LCDDATA14;
3953 typedef struct
3955 unsigned S16C2 : 1;
3956 unsigned S17C2 : 1;
3957 unsigned S18C2 : 1;
3958 unsigned S19C2 : 1;
3959 unsigned S20C2 : 1;
3960 unsigned S21C2 : 1;
3961 unsigned S22C2 : 1;
3962 unsigned S23C2 : 1;
3963 } __LCDDATA14bits_t;
3965 extern __at(0x0F74) volatile __LCDDATA14bits_t LCDDATA14bits;
3967 #define _S16C2 0x01
3968 #define _S17C2 0x02
3969 #define _S18C2 0x04
3970 #define _S19C2 0x08
3971 #define _S20C2 0x10
3972 #define _S21C2 0x20
3973 #define _S22C2 0x40
3974 #define _S23C2 0x80
3976 //==============================================================================
3979 //==============================================================================
3980 // LCDDATA15 Bits
3982 extern __at(0x0F75) __sfr LCDDATA15;
3984 typedef struct
3986 unsigned S24C2 : 1;
3987 unsigned S25C2 : 1;
3988 unsigned S26C2 : 1;
3989 unsigned S27C2 : 1;
3990 unsigned S28C2 : 1;
3991 unsigned S29C2 : 1;
3992 unsigned S30C2 : 1;
3993 unsigned S31C2 : 1;
3994 } __LCDDATA15bits_t;
3996 extern __at(0x0F75) volatile __LCDDATA15bits_t LCDDATA15bits;
3998 #define _S24C2 0x01
3999 #define _S25C2 0x02
4000 #define _S26C2 0x04
4001 #define _S27C2 0x08
4002 #define _S28C2 0x10
4003 #define _S29C2 0x20
4004 #define _S30C2 0x40
4005 #define _S31C2 0x80
4007 //==============================================================================
4010 //==============================================================================
4011 // LCDDATA16 Bits
4013 extern __at(0x0F76) __sfr LCDDATA16;
4015 typedef struct
4017 unsigned S32C2 : 1;
4018 unsigned S33C2 : 1;
4019 unsigned S34C2 : 1;
4020 unsigned S35C2 : 1;
4021 unsigned S36C2 : 1;
4022 unsigned S37C2 : 1;
4023 unsigned S38C2 : 1;
4024 unsigned S39C2 : 1;
4025 } __LCDDATA16bits_t;
4027 extern __at(0x0F76) volatile __LCDDATA16bits_t LCDDATA16bits;
4029 #define _S32C2 0x01
4030 #define _S33C2 0x02
4031 #define _S34C2 0x04
4032 #define _S35C2 0x08
4033 #define _S36C2 0x10
4034 #define _S37C2 0x20
4035 #define _S38C2 0x40
4036 #define _S39C2 0x80
4038 //==============================================================================
4041 //==============================================================================
4042 // LCDDATA17 Bits
4044 extern __at(0x0F77) __sfr LCDDATA17;
4046 typedef struct
4048 unsigned S40C2 : 1;
4049 unsigned S41C2 : 1;
4050 unsigned S42C2 : 1;
4051 unsigned S43C2 : 1;
4052 unsigned S44C2 : 1;
4053 unsigned S45C2 : 1;
4054 unsigned S46C2 : 1;
4055 unsigned S47C2 : 1;
4056 } __LCDDATA17bits_t;
4058 extern __at(0x0F77) volatile __LCDDATA17bits_t LCDDATA17bits;
4060 #define _S40C2 0x01
4061 #define _S41C2 0x02
4062 #define _S42C2 0x04
4063 #define _S43C2 0x08
4064 #define _S44C2 0x10
4065 #define _S45C2 0x20
4066 #define _S46C2 0x40
4067 #define _S47C2 0x80
4069 //==============================================================================
4072 //==============================================================================
4073 // LCDDATA18 Bits
4075 extern __at(0x0F78) __sfr LCDDATA18;
4077 typedef struct
4079 unsigned S00C3 : 1;
4080 unsigned S01C3 : 1;
4081 unsigned S02C3 : 1;
4082 unsigned S03C3 : 1;
4083 unsigned S04C3 : 1;
4084 unsigned S05C3 : 1;
4085 unsigned S06C3 : 1;
4086 unsigned S07C3 : 1;
4087 } __LCDDATA18bits_t;
4089 extern __at(0x0F78) volatile __LCDDATA18bits_t LCDDATA18bits;
4091 #define _S00C3 0x01
4092 #define _S01C3 0x02
4093 #define _S02C3 0x04
4094 #define _S03C3 0x08
4095 #define _S04C3 0x10
4096 #define _S05C3 0x20
4097 #define _S06C3 0x40
4098 #define _S07C3 0x80
4100 //==============================================================================
4103 //==============================================================================
4104 // LCDDATA19 Bits
4106 extern __at(0x0F79) __sfr LCDDATA19;
4108 typedef struct
4110 unsigned S08C3 : 1;
4111 unsigned S09C3 : 1;
4112 unsigned S10C3 : 1;
4113 unsigned S11C3 : 1;
4114 unsigned S12C3 : 1;
4115 unsigned S13C3 : 1;
4116 unsigned S14C3 : 1;
4117 unsigned S15C3 : 1;
4118 } __LCDDATA19bits_t;
4120 extern __at(0x0F79) volatile __LCDDATA19bits_t LCDDATA19bits;
4122 #define _S08C3 0x01
4123 #define _S09C3 0x02
4124 #define _S10C3 0x04
4125 #define _S11C3 0x08
4126 #define _S12C3 0x10
4127 #define _S13C3 0x20
4128 #define _S14C3 0x40
4129 #define _S15C3 0x80
4131 //==============================================================================
4134 //==============================================================================
4135 // LCDDATA20 Bits
4137 extern __at(0x0F7A) __sfr LCDDATA20;
4139 typedef struct
4141 unsigned S16C3 : 1;
4142 unsigned S17C3 : 1;
4143 unsigned S18C3 : 1;
4144 unsigned S19C3 : 1;
4145 unsigned S20C3 : 1;
4146 unsigned S21C3 : 1;
4147 unsigned S22C3 : 1;
4148 unsigned S23C3 : 1;
4149 } __LCDDATA20bits_t;
4151 extern __at(0x0F7A) volatile __LCDDATA20bits_t LCDDATA20bits;
4153 #define _S16C3 0x01
4154 #define _S17C3 0x02
4155 #define _S18C3 0x04
4156 #define _S19C3 0x08
4157 #define _S20C3 0x10
4158 #define _S21C3 0x20
4159 #define _S22C3 0x40
4160 #define _S23C3 0x80
4162 //==============================================================================
4165 //==============================================================================
4166 // LCDDATA21 Bits
4168 extern __at(0x0F7B) __sfr LCDDATA21;
4170 typedef struct
4172 unsigned S24C3 : 1;
4173 unsigned S25C3 : 1;
4174 unsigned S26C3 : 1;
4175 unsigned S27C3 : 1;
4176 unsigned S28C3 : 1;
4177 unsigned S29C3 : 1;
4178 unsigned S30C3 : 1;
4179 unsigned S31C3 : 1;
4180 } __LCDDATA21bits_t;
4182 extern __at(0x0F7B) volatile __LCDDATA21bits_t LCDDATA21bits;
4184 #define _S24C3 0x01
4185 #define _S25C3 0x02
4186 #define _S26C3 0x04
4187 #define _S27C3 0x08
4188 #define _S28C3 0x10
4189 #define _S29C3 0x20
4190 #define _S30C3 0x40
4191 #define _S31C3 0x80
4193 //==============================================================================
4196 //==============================================================================
4197 // LCDDATA22 Bits
4199 extern __at(0x0F7C) __sfr LCDDATA22;
4201 typedef struct
4203 unsigned S32C3 : 1;
4204 unsigned S33C3 : 1;
4205 unsigned S34C3 : 1;
4206 unsigned S35C3 : 1;
4207 unsigned S36C3 : 1;
4208 unsigned S37C3 : 1;
4209 unsigned S38C3 : 1;
4210 unsigned S39C3 : 1;
4211 } __LCDDATA22bits_t;
4213 extern __at(0x0F7C) volatile __LCDDATA22bits_t LCDDATA22bits;
4215 #define _S32C3 0x01
4216 #define _S33C3 0x02
4217 #define _S34C3 0x04
4218 #define _S35C3 0x08
4219 #define _S36C3 0x10
4220 #define _S37C3 0x20
4221 #define _S38C3 0x40
4222 #define _S39C3 0x80
4224 //==============================================================================
4227 //==============================================================================
4228 // LCDDATA23 Bits
4230 extern __at(0x0F7D) __sfr LCDDATA23;
4232 typedef struct
4234 unsigned S40C3 : 1;
4235 unsigned S41C3 : 1;
4236 unsigned S42C3 : 1;
4237 unsigned S43C3 : 1;
4238 unsigned S44C3 : 1;
4239 unsigned S45C3 : 1;
4240 unsigned S46C3 : 1;
4241 unsigned S47C3 : 1;
4242 } __LCDDATA23bits_t;
4244 extern __at(0x0F7D) volatile __LCDDATA23bits_t LCDDATA23bits;
4246 #define _S40C3 0x01
4247 #define _S41C3 0x02
4248 #define _S42C3 0x04
4249 #define _S43C3 0x08
4250 #define _S44C3 0x10
4251 #define _S45C3 0x20
4252 #define _S46C3 0x40
4253 #define _S47C3 0x80
4255 //==============================================================================
4257 extern __at(0x0F7E) __sfr EECON2;
4259 //==============================================================================
4260 // EECON1 Bits
4262 extern __at(0x0F7F) __sfr EECON1;
4264 typedef struct
4266 unsigned RD : 1;
4267 unsigned WR : 1;
4268 unsigned WREN : 1;
4269 unsigned WRERR : 1;
4270 unsigned FREE : 1;
4271 unsigned : 1;
4272 unsigned CFGS : 1;
4273 unsigned EEPGD : 1;
4274 } __EECON1bits_t;
4276 extern __at(0x0F7F) volatile __EECON1bits_t EECON1bits;
4278 #define _RD 0x01
4279 #define _WR 0x02
4280 #define _WREN 0x04
4281 #define _WRERR 0x08
4282 #define _FREE 0x10
4283 #define _CFGS 0x40
4284 #define _EEPGD 0x80
4286 //==============================================================================
4289 //==============================================================================
4290 // PORTA Bits
4292 extern __at(0x0F80) __sfr PORTA;
4294 typedef union
4296 struct
4298 unsigned RA0 : 1;
4299 unsigned RA1 : 1;
4300 unsigned RA2 : 1;
4301 unsigned RA3 : 1;
4302 unsigned RA4 : 1;
4303 unsigned RA5 : 1;
4304 unsigned RA6 : 1;
4305 unsigned RA7 : 1;
4308 struct
4310 unsigned AN0 : 1;
4311 unsigned AN1 : 1;
4312 unsigned AN2 : 1;
4313 unsigned AN3 : 1;
4314 unsigned SEG14 : 1;
4315 unsigned AN4 : 1;
4316 unsigned OSC2 : 1;
4317 unsigned OSC1 : 1;
4320 struct
4322 unsigned ULPWUIN : 1;
4323 unsigned SEG18 : 1;
4324 unsigned VREF_MINUS : 1;
4325 unsigned VREF_PLUS : 1;
4326 unsigned T0CKI : 1;
4327 unsigned SEG15 : 1;
4328 unsigned CLKO : 1;
4329 unsigned CLKI : 1;
4332 struct
4334 unsigned : 1;
4335 unsigned : 1;
4336 unsigned : 1;
4337 unsigned : 1;
4338 unsigned : 1;
4339 unsigned T1CKI : 1;
4340 unsigned : 1;
4341 unsigned : 1;
4344 struct
4346 unsigned : 1;
4347 unsigned : 1;
4348 unsigned : 1;
4349 unsigned : 1;
4350 unsigned : 1;
4351 unsigned T3G : 1;
4352 unsigned : 1;
4353 unsigned : 1;
4356 struct
4358 unsigned : 1;
4359 unsigned : 1;
4360 unsigned : 1;
4361 unsigned : 1;
4362 unsigned : 1;
4363 unsigned LVDIN : 1;
4364 unsigned : 1;
4365 unsigned : 1;
4367 } __PORTAbits_t;
4369 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
4371 #define _RA0 0x01
4372 #define _AN0 0x01
4373 #define _ULPWUIN 0x01
4374 #define _RA1 0x02
4375 #define _AN1 0x02
4376 #define _SEG18 0x02
4377 #define _RA2 0x04
4378 #define _AN2 0x04
4379 #define _VREF_MINUS 0x04
4380 #define _RA3 0x08
4381 #define _AN3 0x08
4382 #define _VREF_PLUS 0x08
4383 #define _RA4 0x10
4384 #define _SEG14 0x10
4385 #define _T0CKI 0x10
4386 #define _RA5 0x20
4387 #define _AN4 0x20
4388 #define _SEG15 0x20
4389 #define _T1CKI 0x20
4390 #define _T3G 0x20
4391 #define _LVDIN 0x20
4392 #define _RA6 0x40
4393 #define _OSC2 0x40
4394 #define _CLKO 0x40
4395 #define _RA7 0x80
4396 #define _OSC1 0x80
4397 #define _CLKI 0x80
4399 //==============================================================================
4402 //==============================================================================
4403 // PORTB Bits
4405 extern __at(0x0F81) __sfr PORTB;
4407 typedef union
4409 struct
4411 unsigned RB0 : 1;
4412 unsigned RB1 : 1;
4413 unsigned RB2 : 1;
4414 unsigned RB3 : 1;
4415 unsigned RB4 : 1;
4416 unsigned RB5 : 1;
4417 unsigned RB6 : 1;
4418 unsigned RB7 : 1;
4421 struct
4423 unsigned INT0 : 1;
4424 unsigned INT1 : 1;
4425 unsigned INT2 : 1;
4426 unsigned INT3 : 1;
4427 unsigned KBI0 : 1;
4428 unsigned KBI1 : 1;
4429 unsigned KBI2 : 1;
4430 unsigned KBI3 : 1;
4433 struct
4435 unsigned SEG30 : 1;
4436 unsigned SEG8 : 1;
4437 unsigned SEG9 : 1;
4438 unsigned SEG10 : 1;
4439 unsigned SEG11 : 1;
4440 unsigned SEG29 : 1;
4441 unsigned PGC : 1;
4442 unsigned PGD : 1;
4445 struct
4447 unsigned FLT0 : 1;
4448 unsigned : 1;
4449 unsigned CTED1 : 1;
4450 unsigned CTED2 : 1;
4451 unsigned : 1;
4452 unsigned T3CKI : 1;
4453 unsigned : 1;
4454 unsigned : 1;
4457 struct
4459 unsigned : 1;
4460 unsigned : 1;
4461 unsigned : 1;
4462 unsigned CCP2_PA2 : 1;
4463 unsigned : 1;
4464 unsigned T1G : 1;
4465 unsigned : 1;
4466 unsigned : 1;
4469 struct
4471 unsigned : 1;
4472 unsigned : 1;
4473 unsigned : 1;
4474 unsigned : 1;
4475 unsigned : 1;
4476 unsigned PGM : 1;
4477 unsigned : 1;
4478 unsigned : 1;
4481 struct
4483 unsigned INT : 4;
4484 unsigned : 4;
4487 struct
4489 unsigned : 4;
4490 unsigned KBI : 4;
4492 } __PORTBbits_t;
4494 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
4496 #define _RB0 0x01
4497 #define _INT0 0x01
4498 #define _SEG30 0x01
4499 #define _FLT0 0x01
4500 #define _RB1 0x02
4501 #define _INT1 0x02
4502 #define _SEG8 0x02
4503 #define _RB2 0x04
4504 #define _INT2 0x04
4505 #define _SEG9 0x04
4506 #define _CTED1 0x04
4507 #define _RB3 0x08
4508 #define _INT3 0x08
4509 #define _SEG10 0x08
4510 #define _CTED2 0x08
4511 #define _CCP2_PA2 0x08
4512 #define _RB4 0x10
4513 #define _KBI0 0x10
4514 #define _SEG11 0x10
4515 #define _RB5 0x20
4516 #define _KBI1 0x20
4517 #define _SEG29 0x20
4518 #define _T3CKI 0x20
4519 #define _T1G 0x20
4520 #define _PGM 0x20
4521 #define _RB6 0x40
4522 #define _KBI2 0x40
4523 #define _PGC 0x40
4524 #define _RB7 0x80
4525 #define _KBI3 0x80
4526 #define _PGD 0x80
4528 //==============================================================================
4531 //==============================================================================
4532 // PORTC Bits
4534 extern __at(0x0F82) __sfr PORTC;
4536 typedef union
4538 struct
4540 unsigned RC0 : 1;
4541 unsigned RC1 : 1;
4542 unsigned RC2 : 1;
4543 unsigned RC3 : 1;
4544 unsigned RC4 : 1;
4545 unsigned RC5 : 1;
4546 unsigned RC6 : 1;
4547 unsigned RC7 : 1;
4550 struct
4552 unsigned SOSCO : 1;
4553 unsigned SEG32 : 1;
4554 unsigned SEG13 : 1;
4555 unsigned SEG17 : 1;
4556 unsigned SEG16 : 1;
4557 unsigned SEG12 : 1;
4558 unsigned SEG27 : 1;
4559 unsigned SEG28 : 1;
4562 struct
4564 unsigned SCKLI : 1;
4565 unsigned SOSCI : 1;
4566 unsigned CCP1 : 1;
4567 unsigned SCK1 : 1;
4568 unsigned SDI1 : 1;
4569 unsigned SDO1 : 1;
4570 unsigned TX1 : 1;
4571 unsigned RX1 : 1;
4574 struct
4576 unsigned : 1;
4577 unsigned CCP2 : 1;
4578 unsigned PA1 : 1;
4579 unsigned SCL1 : 1;
4580 unsigned SDA1 : 1;
4581 unsigned : 1;
4582 unsigned CK1 : 1;
4583 unsigned DT1 : 1;
4586 struct
4588 unsigned : 1;
4589 unsigned PA2 : 1;
4590 unsigned : 1;
4591 unsigned : 1;
4592 unsigned : 1;
4593 unsigned : 1;
4594 unsigned : 1;
4595 unsigned : 1;
4597 } __PORTCbits_t;
4599 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
4601 #define _RC0 0x01
4602 #define _SOSCO 0x01
4603 #define _SCKLI 0x01
4604 #define _RC1 0x02
4605 #define _SEG32 0x02
4606 #define _SOSCI 0x02
4607 #define _CCP2 0x02
4608 #define _PA2 0x02
4609 #define _RC2 0x04
4610 #define _SEG13 0x04
4611 #define _CCP1 0x04
4612 #define _PA1 0x04
4613 #define _RC3 0x08
4614 #define _SEG17 0x08
4615 #define _SCK1 0x08
4616 #define _SCL1 0x08
4617 #define _RC4 0x10
4618 #define _SEG16 0x10
4619 #define _SDI1 0x10
4620 #define _SDA1 0x10
4621 #define _RC5 0x20
4622 #define _SEG12 0x20
4623 #define _SDO1 0x20
4624 #define _RC6 0x40
4625 #define _SEG27 0x40
4626 #define _TX1 0x40
4627 #define _CK1 0x40
4628 #define _RC7 0x80
4629 #define _SEG28 0x80
4630 #define _RX1 0x80
4631 #define _DT1 0x80
4633 //==============================================================================
4636 //==============================================================================
4637 // PORTD Bits
4639 extern __at(0x0F83) __sfr PORTD;
4641 typedef union
4643 struct
4645 unsigned RD0 : 1;
4646 unsigned RD1 : 1;
4647 unsigned RD2 : 1;
4648 unsigned RD3 : 1;
4649 unsigned RD4 : 1;
4650 unsigned RD5 : 1;
4651 unsigned RD6 : 1;
4652 unsigned RD7 : 1;
4655 struct
4657 unsigned AD0 : 1;
4658 unsigned AD1 : 1;
4659 unsigned AD2 : 1;
4660 unsigned AD3 : 1;
4661 unsigned AD4 : 1;
4662 unsigned AD5 : 1;
4663 unsigned AD6 : 1;
4664 unsigned AD7 : 1;
4667 struct
4669 unsigned PSP0 : 1;
4670 unsigned PSP1 : 1;
4671 unsigned PSP2 : 1;
4672 unsigned PSP3 : 1;
4673 unsigned PSP4 : 1;
4674 unsigned PSP5 : 1;
4675 unsigned PSP6 : 1;
4676 unsigned PSP7 : 1;
4679 struct
4681 unsigned SEG0 : 1;
4682 unsigned SEG1 : 1;
4683 unsigned SEG2 : 1;
4684 unsigned SEG3 : 1;
4685 unsigned SEG4 : 1;
4686 unsigned SEG5 : 1;
4687 unsigned SEG6 : 1;
4688 unsigned SEG7 : 1;
4691 struct
4693 unsigned CTPLS : 1;
4694 unsigned T5CKI : 1;
4695 unsigned : 1;
4696 unsigned : 1;
4697 unsigned SDO2 : 1;
4698 unsigned SDI2 : 1;
4699 unsigned SCK2 : 1;
4700 unsigned SS2 : 1;
4703 struct
4705 unsigned : 1;
4706 unsigned T7G : 1;
4707 unsigned : 1;
4708 unsigned : 1;
4709 unsigned : 1;
4710 unsigned SDA2 : 1;
4711 unsigned SCL2 : 1;
4712 unsigned : 1;
4714 } __PORTDbits_t;
4716 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
4718 #define _RD0 0x01
4719 #define _AD0 0x01
4720 #define _PSP0 0x01
4721 #define _SEG0 0x01
4722 #define _CTPLS 0x01
4723 #define _RD1 0x02
4724 #define _AD1 0x02
4725 #define _PSP1 0x02
4726 #define _SEG1 0x02
4727 #define _T5CKI 0x02
4728 #define _T7G 0x02
4729 #define _RD2 0x04
4730 #define _AD2 0x04
4731 #define _PSP2 0x04
4732 #define _SEG2 0x04
4733 #define _RD3 0x08
4734 #define _AD3 0x08
4735 #define _PSP3 0x08
4736 #define _SEG3 0x08
4737 #define _RD4 0x10
4738 #define _AD4 0x10
4739 #define _PSP4 0x10
4740 #define _SEG4 0x10
4741 #define _SDO2 0x10
4742 #define _RD5 0x20
4743 #define _AD5 0x20
4744 #define _PSP5 0x20
4745 #define _SEG5 0x20
4746 #define _SDI2 0x20
4747 #define _SDA2 0x20
4748 #define _RD6 0x40
4749 #define _AD6 0x40
4750 #define _PSP6 0x40
4751 #define _SEG6 0x40
4752 #define _SCK2 0x40
4753 #define _SCL2 0x40
4754 #define _RD7 0x80
4755 #define _AD7 0x80
4756 #define _PSP7 0x80
4757 #define _SEG7 0x80
4758 #define _SS2 0x80
4760 //==============================================================================
4763 //==============================================================================
4764 // PORTE Bits
4766 extern __at(0x0F84) __sfr PORTE;
4768 typedef union
4770 struct
4772 unsigned RE0 : 1;
4773 unsigned RE1 : 1;
4774 unsigned RE2 : 1;
4775 unsigned RE3 : 1;
4776 unsigned RE4 : 1;
4777 unsigned RE5 : 1;
4778 unsigned RE6 : 1;
4779 unsigned RE7 : 1;
4782 struct
4784 unsigned AD8 : 1;
4785 unsigned AD9 : 1;
4786 unsigned AD10 : 1;
4787 unsigned AD11 : 1;
4788 unsigned AD12 : 1;
4789 unsigned AD13 : 1;
4790 unsigned AD14 : 1;
4791 unsigned AD15 : 1;
4794 struct
4796 unsigned PD2 : 1;
4797 unsigned PC2 : 1;
4798 unsigned PB2 : 1;
4799 unsigned PC3 : 1;
4800 unsigned PB3 : 1;
4801 unsigned PC1 : 1;
4802 unsigned PB1 : 1;
4803 unsigned PA2 : 1;
4806 struct
4808 unsigned RD : 1;
4809 unsigned WR : 1;
4810 unsigned CCP10 : 1;
4811 unsigned CCP9 : 1;
4812 unsigned CCP8 : 1;
4813 unsigned CCP7 : 1;
4814 unsigned CCP6 : 1;
4815 unsigned CCP2 : 1;
4818 struct
4820 unsigned LCDBIAS1 : 1;
4821 unsigned LCDBIAS2 : 1;
4822 unsigned CS : 1;
4823 unsigned COM0 : 1;
4824 unsigned COM1 : 1;
4825 unsigned COM2 : 1;
4826 unsigned COM3 : 1;
4827 unsigned SEG31 : 1;
4830 struct
4832 unsigned : 1;
4833 unsigned : 1;
4834 unsigned LCDBIAS3 : 1;
4835 unsigned : 1;
4836 unsigned REFO : 1;
4837 unsigned : 1;
4838 unsigned : 1;
4839 unsigned : 1;
4842 struct
4844 unsigned : 3;
4845 unsigned COM : 4;
4846 unsigned : 1;
4848 } __PORTEbits_t;
4850 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
4852 #define _PORTE_RE0 0x01
4853 #define _PORTE_AD8 0x01
4854 #define _PORTE_PD2 0x01
4855 #define _PORTE_RD 0x01
4856 #define _PORTE_LCDBIAS1 0x01
4857 #define _PORTE_RE1 0x02
4858 #define _PORTE_AD9 0x02
4859 #define _PORTE_PC2 0x02
4860 #define _PORTE_WR 0x02
4861 #define _PORTE_LCDBIAS2 0x02
4862 #define _PORTE_RE2 0x04
4863 #define _PORTE_AD10 0x04
4864 #define _PORTE_PB2 0x04
4865 #define _PORTE_CCP10 0x04
4866 #define _PORTE_CS 0x04
4867 #define _PORTE_LCDBIAS3 0x04
4868 #define _PORTE_RE3 0x08
4869 #define _PORTE_AD11 0x08
4870 #define _PORTE_PC3 0x08
4871 #define _PORTE_CCP9 0x08
4872 #define _PORTE_COM0 0x08
4873 #define _PORTE_RE4 0x10
4874 #define _PORTE_AD12 0x10
4875 #define _PORTE_PB3 0x10
4876 #define _PORTE_CCP8 0x10
4877 #define _PORTE_COM1 0x10
4878 #define _PORTE_REFO 0x10
4879 #define _PORTE_RE5 0x20
4880 #define _PORTE_AD13 0x20
4881 #define _PORTE_PC1 0x20
4882 #define _PORTE_CCP7 0x20
4883 #define _PORTE_COM2 0x20
4884 #define _PORTE_RE6 0x40
4885 #define _PORTE_AD14 0x40
4886 #define _PORTE_PB1 0x40
4887 #define _PORTE_CCP6 0x40
4888 #define _PORTE_COM3 0x40
4889 #define _PORTE_RE7 0x80
4890 #define _PORTE_AD15 0x80
4891 #define _PORTE_PA2 0x80
4892 #define _PORTE_CCP2 0x80
4893 #define _PORTE_SEG31 0x80
4895 //==============================================================================
4898 //==============================================================================
4899 // PORTF Bits
4901 extern __at(0x0F85) __sfr PORTF;
4903 typedef union
4905 struct
4907 unsigned : 1;
4908 unsigned RF1 : 1;
4909 unsigned RF2 : 1;
4910 unsigned RF3 : 1;
4911 unsigned RF4 : 1;
4912 unsigned RF5 : 1;
4913 unsigned RF6 : 1;
4914 unsigned RF7 : 1;
4917 struct
4919 unsigned : 1;
4920 unsigned AN6 : 1;
4921 unsigned AN7 : 1;
4922 unsigned AN8 : 1;
4923 unsigned AN9 : 1;
4924 unsigned AN10 : 1;
4925 unsigned AN11 : 1;
4926 unsigned AN5 : 1;
4929 struct
4931 unsigned : 1;
4932 unsigned SEG19 : 1;
4933 unsigned SEG20 : 1;
4934 unsigned SEG21 : 1;
4935 unsigned SEG22 : 1;
4936 unsigned SEG23 : 1;
4937 unsigned SEG24 : 1;
4938 unsigned SEG25 : 1;
4941 struct
4943 unsigned : 1;
4944 unsigned C2OUT : 1;
4945 unsigned C1OUT : 1;
4946 unsigned C2INB : 1;
4947 unsigned C2INA : 1;
4948 unsigned C1INB : 1;
4949 unsigned C1INA : 1;
4950 unsigned SS1 : 1;
4953 struct
4955 unsigned : 1;
4956 unsigned CTDIN : 1;
4957 unsigned : 1;
4958 unsigned CTMUI : 1;
4959 unsigned : 1;
4960 unsigned CVREF : 1;
4961 unsigned : 1;
4962 unsigned : 1;
4964 } __PORTFbits_t;
4966 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
4968 #define _PORTF_RF1 0x02
4969 #define _PORTF_AN6 0x02
4970 #define _PORTF_SEG19 0x02
4971 #define _PORTF_C2OUT 0x02
4972 #define _PORTF_CTDIN 0x02
4973 #define _PORTF_RF2 0x04
4974 #define _PORTF_AN7 0x04
4975 #define _PORTF_SEG20 0x04
4976 #define _PORTF_C1OUT 0x04
4977 #define _PORTF_RF3 0x08
4978 #define _PORTF_AN8 0x08
4979 #define _PORTF_SEG21 0x08
4980 #define _PORTF_C2INB 0x08
4981 #define _PORTF_CTMUI 0x08
4982 #define _PORTF_RF4 0x10
4983 #define _PORTF_AN9 0x10
4984 #define _PORTF_SEG22 0x10
4985 #define _PORTF_C2INA 0x10
4986 #define _PORTF_RF5 0x20
4987 #define _PORTF_AN10 0x20
4988 #define _PORTF_SEG23 0x20
4989 #define _PORTF_C1INB 0x20
4990 #define _PORTF_CVREF 0x20
4991 #define _PORTF_RF6 0x40
4992 #define _PORTF_AN11 0x40
4993 #define _PORTF_SEG24 0x40
4994 #define _PORTF_C1INA 0x40
4995 #define _PORTF_RF7 0x80
4996 #define _PORTF_AN5 0x80
4997 #define _PORTF_SEG25 0x80
4998 #define _PORTF_SS1 0x80
5000 //==============================================================================
5003 //==============================================================================
5004 // PORTG Bits
5006 extern __at(0x0F86) __sfr PORTG;
5008 typedef union
5010 struct
5012 unsigned RG0 : 1;
5013 unsigned RG1 : 1;
5014 unsigned RG2 : 1;
5015 unsigned RG3 : 1;
5016 unsigned RG4 : 1;
5017 unsigned RG5 : 1;
5018 unsigned : 1;
5019 unsigned : 1;
5022 struct
5024 unsigned CCP3 : 1;
5025 unsigned C3OUT : 1;
5026 unsigned C3INA : 1;
5027 unsigned C3INB : 1;
5028 unsigned C3INC : 1;
5029 unsigned : 1;
5030 unsigned : 1;
5031 unsigned : 1;
5034 struct
5036 unsigned PA3 : 1;
5037 unsigned TX2 : 1;
5038 unsigned RX2 : 1;
5039 unsigned PD3 : 1;
5040 unsigned PD1 : 1;
5041 unsigned : 1;
5042 unsigned : 1;
5043 unsigned : 1;
5046 struct
5048 unsigned : 1;
5049 unsigned AN19 : 1;
5050 unsigned AN18 : 1;
5051 unsigned AN17 : 1;
5052 unsigned AN16 : 1;
5053 unsigned : 1;
5054 unsigned : 1;
5055 unsigned : 1;
5058 struct
5060 unsigned : 1;
5061 unsigned CK2 : 1;
5062 unsigned DT2 : 1;
5063 unsigned CCP4 : 1;
5064 unsigned CCP5 : 1;
5065 unsigned : 1;
5066 unsigned : 1;
5067 unsigned : 1;
5070 struct
5072 unsigned : 1;
5073 unsigned : 1;
5074 unsigned : 1;
5075 unsigned : 1;
5076 unsigned SEG26 : 1;
5077 unsigned : 1;
5078 unsigned : 1;
5079 unsigned : 1;
5082 struct
5084 unsigned : 1;
5085 unsigned : 1;
5086 unsigned : 1;
5087 unsigned : 1;
5088 unsigned T7CKI : 1;
5089 unsigned : 1;
5090 unsigned : 1;
5091 unsigned : 1;
5094 struct
5096 unsigned : 1;
5097 unsigned : 1;
5098 unsigned : 1;
5099 unsigned : 1;
5100 unsigned T5G : 1;
5101 unsigned : 1;
5102 unsigned : 1;
5103 unsigned : 1;
5106 struct
5108 unsigned : 1;
5109 unsigned : 1;
5110 unsigned : 1;
5111 unsigned : 1;
5112 unsigned RTCC : 1;
5113 unsigned : 1;
5114 unsigned : 1;
5115 unsigned : 1;
5118 struct
5120 unsigned RG : 6;
5121 unsigned : 2;
5123 } __PORTGbits_t;
5125 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
5127 #define _PORTG_RG0 0x01
5128 #define _PORTG_CCP3 0x01
5129 #define _PORTG_PA3 0x01
5130 #define _PORTG_RG1 0x02
5131 #define _PORTG_C3OUT 0x02
5132 #define _PORTG_TX2 0x02
5133 #define _PORTG_AN19 0x02
5134 #define _PORTG_CK2 0x02
5135 #define _PORTG_RG2 0x04
5136 #define _PORTG_C3INA 0x04
5137 #define _PORTG_RX2 0x04
5138 #define _PORTG_AN18 0x04
5139 #define _PORTG_DT2 0x04
5140 #define _PORTG_RG3 0x08
5141 #define _PORTG_C3INB 0x08
5142 #define _PORTG_PD3 0x08
5143 #define _PORTG_AN17 0x08
5144 #define _PORTG_CCP4 0x08
5145 #define _PORTG_RG4 0x10
5146 #define _PORTG_C3INC 0x10
5147 #define _PORTG_PD1 0x10
5148 #define _PORTG_AN16 0x10
5149 #define _PORTG_CCP5 0x10
5150 #define _PORTG_SEG26 0x10
5151 #define _PORTG_T7CKI 0x10
5152 #define _PORTG_T5G 0x10
5153 #define _PORTG_RTCC 0x10
5154 #define _PORTG_RG5 0x20
5156 //==============================================================================
5159 //==============================================================================
5160 // PORTH Bits
5162 extern __at(0x0F87) __sfr PORTH;
5164 typedef union
5166 struct
5168 unsigned RH0 : 1;
5169 unsigned RH1 : 1;
5170 unsigned RH2 : 1;
5171 unsigned RH3 : 1;
5172 unsigned RH4 : 1;
5173 unsigned RH5 : 1;
5174 unsigned RH6 : 1;
5175 unsigned RH7 : 1;
5178 struct
5180 unsigned SEG47 : 1;
5181 unsigned SEG46 : 1;
5182 unsigned SEG45 : 1;
5183 unsigned SEG44 : 1;
5184 unsigned SEG40 : 1;
5185 unsigned SEG41 : 1;
5186 unsigned SEG42 : 1;
5187 unsigned SEG43 : 1;
5190 struct
5192 unsigned AN23 : 1;
5193 unsigned AN22 : 1;
5194 unsigned AN21 : 1;
5195 unsigned AN20 : 1;
5196 unsigned AN12 : 1;
5197 unsigned AN13 : 1;
5198 unsigned AN14 : 1;
5199 unsigned AN15 : 1;
5202 struct
5204 unsigned A16 : 1;
5205 unsigned A17 : 1;
5206 unsigned A18 : 1;
5207 unsigned A19 : 1;
5208 unsigned CCP9 : 1;
5209 unsigned CCP8 : 1;
5210 unsigned CCP7 : 1;
5211 unsigned CCP6 : 1;
5214 struct
5216 unsigned : 1;
5217 unsigned : 1;
5218 unsigned : 1;
5219 unsigned : 1;
5220 unsigned PC3 : 1;
5221 unsigned PB3 : 1;
5222 unsigned PC1 : 1;
5223 unsigned PB1 : 1;
5226 struct
5228 unsigned : 1;
5229 unsigned : 1;
5230 unsigned : 1;
5231 unsigned : 1;
5232 unsigned C2INC : 1;
5233 unsigned C2IND : 1;
5234 unsigned C1INC : 1;
5235 unsigned : 1;
5237 } __PORTHbits_t;
5239 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
5241 #define _PORTH_RH0 0x01
5242 #define _PORTH_SEG47 0x01
5243 #define _PORTH_AN23 0x01
5244 #define _PORTH_A16 0x01
5245 #define _PORTH_RH1 0x02
5246 #define _PORTH_SEG46 0x02
5247 #define _PORTH_AN22 0x02
5248 #define _PORTH_A17 0x02
5249 #define _PORTH_RH2 0x04
5250 #define _PORTH_SEG45 0x04
5251 #define _PORTH_AN21 0x04
5252 #define _PORTH_A18 0x04
5253 #define _PORTH_RH3 0x08
5254 #define _PORTH_SEG44 0x08
5255 #define _PORTH_AN20 0x08
5256 #define _PORTH_A19 0x08
5257 #define _PORTH_RH4 0x10
5258 #define _PORTH_SEG40 0x10
5259 #define _PORTH_AN12 0x10
5260 #define _PORTH_CCP9 0x10
5261 #define _PORTH_PC3 0x10
5262 #define _PORTH_C2INC 0x10
5263 #define _PORTH_RH5 0x20
5264 #define _PORTH_SEG41 0x20
5265 #define _PORTH_AN13 0x20
5266 #define _PORTH_CCP8 0x20
5267 #define _PORTH_PB3 0x20
5268 #define _PORTH_C2IND 0x20
5269 #define _PORTH_RH6 0x40
5270 #define _PORTH_SEG42 0x40
5271 #define _PORTH_AN14 0x40
5272 #define _PORTH_CCP7 0x40
5273 #define _PORTH_PC1 0x40
5274 #define _PORTH_C1INC 0x40
5275 #define _PORTH_RH7 0x80
5276 #define _PORTH_SEG43 0x80
5277 #define _PORTH_AN15 0x80
5278 #define _PORTH_CCP6 0x80
5279 #define _PORTH_PB1 0x80
5281 //==============================================================================
5284 //==============================================================================
5285 // PORTJ Bits
5287 extern __at(0x0F88) __sfr PORTJ;
5289 typedef union
5291 struct
5293 unsigned RJ0 : 1;
5294 unsigned RJ1 : 1;
5295 unsigned RJ2 : 1;
5296 unsigned RJ3 : 1;
5297 unsigned RJ4 : 1;
5298 unsigned RJ5 : 1;
5299 unsigned RJ6 : 1;
5300 unsigned RJ7 : 1;
5303 struct
5305 unsigned ALE : 1;
5306 unsigned OE : 1;
5307 unsigned WRL : 1;
5308 unsigned WRH : 1;
5309 unsigned BA0 : 1;
5310 unsigned CE : 1;
5311 unsigned LB : 1;
5312 unsigned UB : 1;
5315 struct
5317 unsigned : 1;
5318 unsigned SEG33 : 1;
5319 unsigned SEG34 : 1;
5320 unsigned SEG35 : 1;
5321 unsigned SEG39 : 1;
5322 unsigned SEG38 : 1;
5323 unsigned SEG37 : 1;
5324 unsigned SEG36 : 1;
5326 } __PORTJbits_t;
5328 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
5330 #define _RJ0 0x01
5331 #define _ALE 0x01
5332 #define _RJ1 0x02
5333 #define _OE 0x02
5334 #define _SEG33 0x02
5335 #define _RJ2 0x04
5336 #define _WRL 0x04
5337 #define _SEG34 0x04
5338 #define _RJ3 0x08
5339 #define _WRH 0x08
5340 #define _SEG35 0x08
5341 #define _RJ4 0x10
5342 #define _BA0 0x10
5343 #define _SEG39 0x10
5344 #define _RJ5 0x20
5345 #define _CE 0x20
5346 #define _SEG38 0x20
5347 #define _RJ6 0x40
5348 #define _LB 0x40
5349 #define _SEG37 0x40
5350 #define _RJ7 0x80
5351 #define _UB 0x80
5352 #define _SEG36 0x80
5354 //==============================================================================
5357 //==============================================================================
5358 // LATA Bits
5360 extern __at(0x0F89) __sfr LATA;
5362 typedef struct
5364 unsigned LATA0 : 1;
5365 unsigned LATA1 : 1;
5366 unsigned LATA2 : 1;
5367 unsigned LATA3 : 1;
5368 unsigned LATA4 : 1;
5369 unsigned LATA5 : 1;
5370 unsigned LATA6 : 1;
5371 unsigned LATA7 : 1;
5372 } __LATAbits_t;
5374 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
5376 #define _LATA0 0x01
5377 #define _LATA1 0x02
5378 #define _LATA2 0x04
5379 #define _LATA3 0x08
5380 #define _LATA4 0x10
5381 #define _LATA5 0x20
5382 #define _LATA6 0x40
5383 #define _LATA7 0x80
5385 //==============================================================================
5388 //==============================================================================
5389 // LATB Bits
5391 extern __at(0x0F8A) __sfr LATB;
5393 typedef struct
5395 unsigned LATB0 : 1;
5396 unsigned LATB1 : 1;
5397 unsigned LATB2 : 1;
5398 unsigned LATB3 : 1;
5399 unsigned LATB4 : 1;
5400 unsigned LATB5 : 1;
5401 unsigned LATB6 : 1;
5402 unsigned LATB7 : 1;
5403 } __LATBbits_t;
5405 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
5407 #define _LATB0 0x01
5408 #define _LATB1 0x02
5409 #define _LATB2 0x04
5410 #define _LATB3 0x08
5411 #define _LATB4 0x10
5412 #define _LATB5 0x20
5413 #define _LATB6 0x40
5414 #define _LATB7 0x80
5416 //==============================================================================
5419 //==============================================================================
5420 // LATC Bits
5422 extern __at(0x0F8B) __sfr LATC;
5424 typedef struct
5426 unsigned LATC0 : 1;
5427 unsigned LATC1 : 1;
5428 unsigned LATC2 : 1;
5429 unsigned LATC3 : 1;
5430 unsigned LATC4 : 1;
5431 unsigned LATC5 : 1;
5432 unsigned LATC6 : 1;
5433 unsigned LATC7 : 1;
5434 } __LATCbits_t;
5436 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
5438 #define _LATC0 0x01
5439 #define _LATC1 0x02
5440 #define _LATC2 0x04
5441 #define _LATC3 0x08
5442 #define _LATC4 0x10
5443 #define _LATC5 0x20
5444 #define _LATC6 0x40
5445 #define _LATC7 0x80
5447 //==============================================================================
5450 //==============================================================================
5451 // LATD Bits
5453 extern __at(0x0F8C) __sfr LATD;
5455 typedef struct
5457 unsigned LATD0 : 1;
5458 unsigned LATD1 : 1;
5459 unsigned LATD2 : 1;
5460 unsigned LATD3 : 1;
5461 unsigned LATD4 : 1;
5462 unsigned LATD5 : 1;
5463 unsigned LATD6 : 1;
5464 unsigned LATD7 : 1;
5465 } __LATDbits_t;
5467 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
5469 #define _LATD0 0x01
5470 #define _LATD1 0x02
5471 #define _LATD2 0x04
5472 #define _LATD3 0x08
5473 #define _LATD4 0x10
5474 #define _LATD5 0x20
5475 #define _LATD6 0x40
5476 #define _LATD7 0x80
5478 //==============================================================================
5481 //==============================================================================
5482 // LATE Bits
5484 extern __at(0x0F8D) __sfr LATE;
5486 typedef struct
5488 unsigned LATE0 : 1;
5489 unsigned LATE1 : 1;
5490 unsigned LATE2 : 1;
5491 unsigned LATE3 : 1;
5492 unsigned LATE4 : 1;
5493 unsigned LATE5 : 1;
5494 unsigned LATE6 : 1;
5495 unsigned LATE7 : 1;
5496 } __LATEbits_t;
5498 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
5500 #define _LATE0 0x01
5501 #define _LATE1 0x02
5502 #define _LATE2 0x04
5503 #define _LATE3 0x08
5504 #define _LATE4 0x10
5505 #define _LATE5 0x20
5506 #define _LATE6 0x40
5507 #define _LATE7 0x80
5509 //==============================================================================
5512 //==============================================================================
5513 // LATF Bits
5515 extern __at(0x0F8E) __sfr LATF;
5517 typedef struct
5519 unsigned : 1;
5520 unsigned LATF1 : 1;
5521 unsigned LATF2 : 1;
5522 unsigned LATF3 : 1;
5523 unsigned LATF4 : 1;
5524 unsigned LATF5 : 1;
5525 unsigned LATF6 : 1;
5526 unsigned LATF7 : 1;
5527 } __LATFbits_t;
5529 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
5531 #define _LATF1 0x02
5532 #define _LATF2 0x04
5533 #define _LATF3 0x08
5534 #define _LATF4 0x10
5535 #define _LATF5 0x20
5536 #define _LATF6 0x40
5537 #define _LATF7 0x80
5539 //==============================================================================
5542 //==============================================================================
5543 // LATG Bits
5545 extern __at(0x0F8F) __sfr LATG;
5547 typedef union
5549 struct
5551 unsigned LATG0 : 1;
5552 unsigned LATG1 : 1;
5553 unsigned LATG2 : 1;
5554 unsigned LATG3 : 1;
5555 unsigned LATG4 : 1;
5556 unsigned : 1;
5557 unsigned : 1;
5558 unsigned : 1;
5561 struct
5563 unsigned LATG : 5;
5564 unsigned : 3;
5566 } __LATGbits_t;
5568 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
5570 #define _LATG0 0x01
5571 #define _LATG1 0x02
5572 #define _LATG2 0x04
5573 #define _LATG3 0x08
5574 #define _LATG4 0x10
5576 //==============================================================================
5579 //==============================================================================
5580 // LATH Bits
5582 extern __at(0x0F90) __sfr LATH;
5584 typedef struct
5586 unsigned LATH0 : 1;
5587 unsigned LATH1 : 1;
5588 unsigned LATH2 : 1;
5589 unsigned LATH3 : 1;
5590 unsigned LATH4 : 1;
5591 unsigned LATH5 : 1;
5592 unsigned LATH6 : 1;
5593 unsigned LATH7 : 1;
5594 } __LATHbits_t;
5596 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
5598 #define _LATH0 0x01
5599 #define _LATH1 0x02
5600 #define _LATH2 0x04
5601 #define _LATH3 0x08
5602 #define _LATH4 0x10
5603 #define _LATH5 0x20
5604 #define _LATH6 0x40
5605 #define _LATH7 0x80
5607 //==============================================================================
5610 //==============================================================================
5611 // LATJ Bits
5613 extern __at(0x0F91) __sfr LATJ;
5615 typedef struct
5617 unsigned LATJ0 : 1;
5618 unsigned LATJ1 : 1;
5619 unsigned LATJ2 : 1;
5620 unsigned LATJ3 : 1;
5621 unsigned LATJ4 : 1;
5622 unsigned LATJ5 : 1;
5623 unsigned LATJ6 : 1;
5624 unsigned LATJ7 : 1;
5625 } __LATJbits_t;
5627 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
5629 #define _LATJ0 0x01
5630 #define _LATJ1 0x02
5631 #define _LATJ2 0x04
5632 #define _LATJ3 0x08
5633 #define _LATJ4 0x10
5634 #define _LATJ5 0x20
5635 #define _LATJ6 0x40
5636 #define _LATJ7 0x80
5638 //==============================================================================
5641 //==============================================================================
5642 // TRISA Bits
5644 extern __at(0x0F92) __sfr TRISA;
5646 typedef struct
5648 unsigned TRISA0 : 1;
5649 unsigned TRISA1 : 1;
5650 unsigned TRISA2 : 1;
5651 unsigned TRISA3 : 1;
5652 unsigned TRISA4 : 1;
5653 unsigned TRISA5 : 1;
5654 unsigned TRISA6 : 1;
5655 unsigned TRISA7 : 1;
5656 } __TRISAbits_t;
5658 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
5660 #define _TRISA0 0x01
5661 #define _TRISA1 0x02
5662 #define _TRISA2 0x04
5663 #define _TRISA3 0x08
5664 #define _TRISA4 0x10
5665 #define _TRISA5 0x20
5666 #define _TRISA6 0x40
5667 #define _TRISA7 0x80
5669 //==============================================================================
5672 //==============================================================================
5673 // TRISB Bits
5675 extern __at(0x0F93) __sfr TRISB;
5677 typedef struct
5679 unsigned TRISB0 : 1;
5680 unsigned TRISB1 : 1;
5681 unsigned TRISB2 : 1;
5682 unsigned TRISB3 : 1;
5683 unsigned TRISB4 : 1;
5684 unsigned TRISB5 : 1;
5685 unsigned TRISB6 : 1;
5686 unsigned TRISB7 : 1;
5687 } __TRISBbits_t;
5689 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
5691 #define _TRISB0 0x01
5692 #define _TRISB1 0x02
5693 #define _TRISB2 0x04
5694 #define _TRISB3 0x08
5695 #define _TRISB4 0x10
5696 #define _TRISB5 0x20
5697 #define _TRISB6 0x40
5698 #define _TRISB7 0x80
5700 //==============================================================================
5703 //==============================================================================
5704 // TRISC Bits
5706 extern __at(0x0F94) __sfr TRISC;
5708 typedef struct
5710 unsigned TRISC0 : 1;
5711 unsigned TRISC1 : 1;
5712 unsigned TRISC2 : 1;
5713 unsigned TRISC3 : 1;
5714 unsigned TRISC4 : 1;
5715 unsigned TRISC5 : 1;
5716 unsigned TRISC6 : 1;
5717 unsigned TRISC7 : 1;
5718 } __TRISCbits_t;
5720 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
5722 #define _TRISC0 0x01
5723 #define _TRISC1 0x02
5724 #define _TRISC2 0x04
5725 #define _TRISC3 0x08
5726 #define _TRISC4 0x10
5727 #define _TRISC5 0x20
5728 #define _TRISC6 0x40
5729 #define _TRISC7 0x80
5731 //==============================================================================
5734 //==============================================================================
5735 // TRISD Bits
5737 extern __at(0x0F95) __sfr TRISD;
5739 typedef struct
5741 unsigned TRISD0 : 1;
5742 unsigned TRISD1 : 1;
5743 unsigned TRISD2 : 1;
5744 unsigned TRISD3 : 1;
5745 unsigned TRISD4 : 1;
5746 unsigned TRISD5 : 1;
5747 unsigned TRISD6 : 1;
5748 unsigned TRISD7 : 1;
5749 } __TRISDbits_t;
5751 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
5753 #define _TRISD0 0x01
5754 #define _TRISD1 0x02
5755 #define _TRISD2 0x04
5756 #define _TRISD3 0x08
5757 #define _TRISD4 0x10
5758 #define _TRISD5 0x20
5759 #define _TRISD6 0x40
5760 #define _TRISD7 0x80
5762 //==============================================================================
5765 //==============================================================================
5766 // TRISE Bits
5768 extern __at(0x0F96) __sfr TRISE;
5770 typedef struct
5772 unsigned TRISE0 : 1;
5773 unsigned TRISE1 : 1;
5774 unsigned TRISE2 : 1;
5775 unsigned TRISE3 : 1;
5776 unsigned TRISE4 : 1;
5777 unsigned TRISE5 : 1;
5778 unsigned TRISE6 : 1;
5779 unsigned TRISE7 : 1;
5780 } __TRISEbits_t;
5782 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
5784 #define _TRISE0 0x01
5785 #define _TRISE1 0x02
5786 #define _TRISE2 0x04
5787 #define _TRISE3 0x08
5788 #define _TRISE4 0x10
5789 #define _TRISE5 0x20
5790 #define _TRISE6 0x40
5791 #define _TRISE7 0x80
5793 //==============================================================================
5796 //==============================================================================
5797 // TRISF Bits
5799 extern __at(0x0F97) __sfr TRISF;
5801 typedef struct
5803 unsigned : 1;
5804 unsigned TRISF1 : 1;
5805 unsigned TRISF2 : 1;
5806 unsigned TRISF3 : 1;
5807 unsigned TRISF4 : 1;
5808 unsigned TRISF5 : 1;
5809 unsigned TRISF6 : 1;
5810 unsigned TRISF7 : 1;
5811 } __TRISFbits_t;
5813 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
5815 #define _TRISF1 0x02
5816 #define _TRISF2 0x04
5817 #define _TRISF3 0x08
5818 #define _TRISF4 0x10
5819 #define _TRISF5 0x20
5820 #define _TRISF6 0x40
5821 #define _TRISF7 0x80
5823 //==============================================================================
5826 //==============================================================================
5827 // TRISG Bits
5829 extern __at(0x0F98) __sfr TRISG;
5831 typedef union
5833 struct
5835 unsigned TRISG0 : 1;
5836 unsigned TRISG1 : 1;
5837 unsigned TRISG2 : 1;
5838 unsigned TRISG3 : 1;
5839 unsigned TRISG4 : 1;
5840 unsigned : 1;
5841 unsigned : 1;
5842 unsigned : 1;
5845 struct
5847 unsigned TRISG : 5;
5848 unsigned : 3;
5850 } __TRISGbits_t;
5852 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
5854 #define _TRISG0 0x01
5855 #define _TRISG1 0x02
5856 #define _TRISG2 0x04
5857 #define _TRISG3 0x08
5858 #define _TRISG4 0x10
5860 //==============================================================================
5863 //==============================================================================
5864 // TRISH Bits
5866 extern __at(0x0F99) __sfr TRISH;
5868 typedef struct
5870 unsigned TRISH0 : 1;
5871 unsigned TRISH1 : 1;
5872 unsigned TRISH2 : 1;
5873 unsigned TRISH3 : 1;
5874 unsigned TRISH4 : 1;
5875 unsigned TRISH5 : 1;
5876 unsigned TRISH6 : 1;
5877 unsigned TRISH7 : 1;
5878 } __TRISHbits_t;
5880 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
5882 #define _TRISH0 0x01
5883 #define _TRISH1 0x02
5884 #define _TRISH2 0x04
5885 #define _TRISH3 0x08
5886 #define _TRISH4 0x10
5887 #define _TRISH5 0x20
5888 #define _TRISH6 0x40
5889 #define _TRISH7 0x80
5891 //==============================================================================
5894 //==============================================================================
5895 // TRISJ Bits
5897 extern __at(0x0F9A) __sfr TRISJ;
5899 typedef struct
5901 unsigned TRISJ0 : 1;
5902 unsigned TRISJ1 : 1;
5903 unsigned TRISJ2 : 1;
5904 unsigned TRISJ3 : 1;
5905 unsigned TRISJ4 : 1;
5906 unsigned TRISJ5 : 1;
5907 unsigned TRISJ6 : 1;
5908 unsigned TRISJ7 : 1;
5909 } __TRISJbits_t;
5911 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
5913 #define _TRISJ0 0x01
5914 #define _TRISJ1 0x02
5915 #define _TRISJ2 0x04
5916 #define _TRISJ3 0x08
5917 #define _TRISJ4 0x10
5918 #define _TRISJ5 0x20
5919 #define _TRISJ6 0x40
5920 #define _TRISJ7 0x80
5922 //==============================================================================
5925 //==============================================================================
5926 // OSCTUNE Bits
5928 extern __at(0x0F9B) __sfr OSCTUNE;
5930 typedef union
5932 struct
5934 unsigned TUN0 : 1;
5935 unsigned TUN1 : 1;
5936 unsigned TUN2 : 1;
5937 unsigned TUN3 : 1;
5938 unsigned TUN4 : 1;
5939 unsigned TUN5 : 1;
5940 unsigned PLLEN : 1;
5941 unsigned INTSRC : 1;
5944 struct
5946 unsigned TUN : 6;
5947 unsigned : 2;
5949 } __OSCTUNEbits_t;
5951 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
5953 #define _TUN0 0x01
5954 #define _TUN1 0x02
5955 #define _TUN2 0x04
5956 #define _TUN3 0x08
5957 #define _TUN4 0x10
5958 #define _TUN5 0x20
5959 #define _PLLEN 0x40
5960 #define _INTSRC 0x80
5962 //==============================================================================
5965 //==============================================================================
5966 // PSTR1CON Bits
5968 extern __at(0x0F9C) __sfr PSTR1CON;
5970 typedef union
5972 struct
5974 unsigned STRA : 1;
5975 unsigned STRB : 1;
5976 unsigned STRC : 1;
5977 unsigned STRD : 1;
5978 unsigned STRSYNC : 1;
5979 unsigned : 1;
5980 unsigned CMPL0 : 1;
5981 unsigned CMPL1 : 1;
5984 struct
5986 unsigned : 6;
5987 unsigned CMPL : 2;
5989 } __PSTR1CONbits_t;
5991 extern __at(0x0F9C) volatile __PSTR1CONbits_t PSTR1CONbits;
5993 #define _STRA 0x01
5994 #define _STRB 0x02
5995 #define _STRC 0x04
5996 #define _STRD 0x08
5997 #define _STRSYNC 0x10
5998 #define _CMPL0 0x40
5999 #define _CMPL1 0x80
6001 //==============================================================================
6004 //==============================================================================
6005 // PIE1 Bits
6007 extern __at(0x0F9D) __sfr PIE1;
6009 typedef union
6011 struct
6013 unsigned TMR1IE : 1;
6014 unsigned TMR2IE : 1;
6015 unsigned TMR1GIE : 1;
6016 unsigned SSP1IE : 1;
6017 unsigned TX1IE : 1;
6018 unsigned RC1IE : 1;
6019 unsigned ADIE : 1;
6020 unsigned : 1;
6023 struct
6025 unsigned : 1;
6026 unsigned : 1;
6027 unsigned : 1;
6028 unsigned SSPIE : 1;
6029 unsigned TXIE : 1;
6030 unsigned RCIE : 1;
6031 unsigned : 1;
6032 unsigned : 1;
6034 } __PIE1bits_t;
6036 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
6038 #define _TMR1IE 0x01
6039 #define _TMR2IE 0x02
6040 #define _TMR1GIE 0x04
6041 #define _SSP1IE 0x08
6042 #define _SSPIE 0x08
6043 #define _TX1IE 0x10
6044 #define _TXIE 0x10
6045 #define _RC1IE 0x20
6046 #define _RCIE 0x20
6047 #define _ADIE 0x40
6049 //==============================================================================
6052 //==============================================================================
6053 // PIR1 Bits
6055 extern __at(0x0F9E) __sfr PIR1;
6057 typedef union
6059 struct
6061 unsigned TMR1IF : 1;
6062 unsigned TMR2IF : 1;
6063 unsigned TMR1GIF : 1;
6064 unsigned SSP1IF : 1;
6065 unsigned TX1IF : 1;
6066 unsigned RC1IF : 1;
6067 unsigned ADIF : 1;
6068 unsigned : 1;
6071 struct
6073 unsigned : 1;
6074 unsigned : 1;
6075 unsigned : 1;
6076 unsigned SSPIF : 1;
6077 unsigned TXIF : 1;
6078 unsigned RCIF : 1;
6079 unsigned : 1;
6080 unsigned : 1;
6082 } __PIR1bits_t;
6084 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
6086 #define _TMR1IF 0x01
6087 #define _TMR2IF 0x02
6088 #define _TMR1GIF 0x04
6089 #define _SSP1IF 0x08
6090 #define _SSPIF 0x08
6091 #define _TX1IF 0x10
6092 #define _TXIF 0x10
6093 #define _RC1IF 0x20
6094 #define _RCIF 0x20
6095 #define _ADIF 0x40
6097 //==============================================================================
6100 //==============================================================================
6101 // IPR1 Bits
6103 extern __at(0x0F9F) __sfr IPR1;
6105 typedef union
6107 struct
6109 unsigned TMR1IP : 1;
6110 unsigned TMR2IP : 1;
6111 unsigned TMR1GIP : 1;
6112 unsigned SSP1IP : 1;
6113 unsigned TX1IP : 1;
6114 unsigned RC1IP : 1;
6115 unsigned ADIP : 1;
6116 unsigned : 1;
6119 struct
6121 unsigned : 1;
6122 unsigned : 1;
6123 unsigned : 1;
6124 unsigned SSPIP : 1;
6125 unsigned TXIP : 1;
6126 unsigned RCIP : 1;
6127 unsigned : 1;
6128 unsigned : 1;
6130 } __IPR1bits_t;
6132 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
6134 #define _TMR1IP 0x01
6135 #define _TMR2IP 0x02
6136 #define _TMR1GIP 0x04
6137 #define _SSP1IP 0x08
6138 #define _SSPIP 0x08
6139 #define _TX1IP 0x10
6140 #define _TXIP 0x10
6141 #define _RC1IP 0x20
6142 #define _RCIP 0x20
6143 #define _ADIP 0x40
6145 //==============================================================================
6148 //==============================================================================
6149 // PIE2 Bits
6151 extern __at(0x0FA0) __sfr PIE2;
6153 typedef union
6155 struct
6157 unsigned TMR3GIE : 1;
6158 unsigned TMR3IE : 1;
6159 unsigned HLVDIE : 1;
6160 unsigned BCL1IE : 1;
6161 unsigned BCL2IE : 1;
6162 unsigned SSP2IE : 1;
6163 unsigned : 1;
6164 unsigned OSCFIE : 1;
6167 struct
6169 unsigned : 1;
6170 unsigned : 1;
6171 unsigned LVDIE : 1;
6172 unsigned BCLIE : 1;
6173 unsigned : 1;
6174 unsigned : 1;
6175 unsigned : 1;
6176 unsigned : 1;
6178 } __PIE2bits_t;
6180 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
6182 #define _TMR3GIE 0x01
6183 #define _TMR3IE 0x02
6184 #define _HLVDIE 0x04
6185 #define _LVDIE 0x04
6186 #define _BCL1IE 0x08
6187 #define _BCLIE 0x08
6188 #define _BCL2IE 0x10
6189 #define _SSP2IE 0x20
6190 #define _OSCFIE 0x80
6192 //==============================================================================
6195 //==============================================================================
6196 // PIR2 Bits
6198 extern __at(0x0FA1) __sfr PIR2;
6200 typedef union
6202 struct
6204 unsigned TMR3GIF : 1;
6205 unsigned TMR3IF : 1;
6206 unsigned HLVDIF : 1;
6207 unsigned BCL1IF : 1;
6208 unsigned BCL2IF : 1;
6209 unsigned SSP2IF : 1;
6210 unsigned : 1;
6211 unsigned OSCFIF : 1;
6214 struct
6216 unsigned : 1;
6217 unsigned : 1;
6218 unsigned LVDIF : 1;
6219 unsigned BCLIF : 1;
6220 unsigned : 1;
6221 unsigned : 1;
6222 unsigned : 1;
6223 unsigned : 1;
6225 } __PIR2bits_t;
6227 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
6229 #define _TMR3GIF 0x01
6230 #define _TMR3IF 0x02
6231 #define _HLVDIF 0x04
6232 #define _LVDIF 0x04
6233 #define _BCL1IF 0x08
6234 #define _BCLIF 0x08
6235 #define _BCL2IF 0x10
6236 #define _SSP2IF 0x20
6237 #define _OSCFIF 0x80
6239 //==============================================================================
6242 //==============================================================================
6243 // IPR2 Bits
6245 extern __at(0x0FA2) __sfr IPR2;
6247 typedef union
6249 struct
6251 unsigned TMR3GIP : 1;
6252 unsigned TMR3IP : 1;
6253 unsigned HLVDIP : 1;
6254 unsigned BCL1IP : 1;
6255 unsigned BCL2IP : 1;
6256 unsigned SSP2IP : 1;
6257 unsigned : 1;
6258 unsigned OSCFIP : 1;
6261 struct
6263 unsigned : 1;
6264 unsigned : 1;
6265 unsigned LVDIP : 1;
6266 unsigned BCLIP : 1;
6267 unsigned : 1;
6268 unsigned : 1;
6269 unsigned : 1;
6270 unsigned : 1;
6272 } __IPR2bits_t;
6274 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
6276 #define _TMR3GIP 0x01
6277 #define _TMR3IP 0x02
6278 #define _HLVDIP 0x04
6279 #define _LVDIP 0x04
6280 #define _BCL1IP 0x08
6281 #define _BCLIP 0x08
6282 #define _BCL2IP 0x10
6283 #define _SSP2IP 0x20
6284 #define _OSCFIP 0x80
6286 //==============================================================================
6289 //==============================================================================
6290 // PIE3 Bits
6292 extern __at(0x0FA3) __sfr PIE3;
6294 typedef struct
6296 unsigned RTCCIE : 1;
6297 unsigned CCP1IE : 1;
6298 unsigned CCP2IE : 1;
6299 unsigned CTMUIE : 1;
6300 unsigned TX2IE : 1;
6301 unsigned RC2IE : 1;
6302 unsigned LCDIE : 1;
6303 unsigned TMR5GIE : 1;
6304 } __PIE3bits_t;
6306 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
6308 #define _RTCCIE 0x01
6309 #define _CCP1IE 0x02
6310 #define _CCP2IE 0x04
6311 #define _CTMUIE 0x08
6312 #define _TX2IE 0x10
6313 #define _RC2IE 0x20
6314 #define _LCDIE 0x40
6315 #define _TMR5GIE 0x80
6317 //==============================================================================
6320 //==============================================================================
6321 // PIR3 Bits
6323 extern __at(0x0FA4) __sfr PIR3;
6325 typedef struct
6327 unsigned RTCCIF : 1;
6328 unsigned CCP1IF : 1;
6329 unsigned CCP2IF : 1;
6330 unsigned CTMUIF : 1;
6331 unsigned TX2IF : 1;
6332 unsigned RC2IF : 1;
6333 unsigned LCDIF : 1;
6334 unsigned TMR5GIF : 1;
6335 } __PIR3bits_t;
6337 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
6339 #define _RTCCIF 0x01
6340 #define _CCP1IF 0x02
6341 #define _CCP2IF 0x04
6342 #define _CTMUIF 0x08
6343 #define _TX2IF 0x10
6344 #define _RC2IF 0x20
6345 #define _LCDIF 0x40
6346 #define _TMR5GIF 0x80
6348 //==============================================================================
6351 //==============================================================================
6352 // IPR3 Bits
6354 extern __at(0x0FA5) __sfr IPR3;
6356 typedef struct
6358 unsigned RTCCIP : 1;
6359 unsigned CCP1IP : 1;
6360 unsigned CCP2IP : 1;
6361 unsigned CTMUIP : 1;
6362 unsigned TX2IP : 1;
6363 unsigned RC2IP : 1;
6364 unsigned LCDIP : 1;
6365 unsigned TMR5GIP : 1;
6366 } __IPR3bits_t;
6368 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
6370 #define _RTCCIP 0x01
6371 #define _CCP1IP 0x02
6372 #define _CCP2IP 0x04
6373 #define _CTMUIP 0x08
6374 #define _TX2IP 0x10
6375 #define _RC2IP 0x20
6376 #define _LCDIP 0x40
6377 #define _TMR5GIP 0x80
6379 //==============================================================================
6382 //==============================================================================
6383 // PIR6 Bits
6385 extern __at(0x0FA6) __sfr PIR6;
6387 typedef struct
6389 unsigned CMP1IF : 1;
6390 unsigned CMP2IF : 1;
6391 unsigned CMP3IF : 1;
6392 unsigned : 1;
6393 unsigned EEIF : 1;
6394 unsigned : 1;
6395 unsigned : 1;
6396 unsigned : 1;
6397 } __PIR6bits_t;
6399 extern __at(0x0FA6) volatile __PIR6bits_t PIR6bits;
6401 #define _CMP1IF 0x01
6402 #define _CMP2IF 0x02
6403 #define _CMP3IF 0x04
6404 #define _EEIF 0x10
6406 //==============================================================================
6409 //==============================================================================
6410 // HLVDCON Bits
6412 extern __at(0x0FA8) __sfr HLVDCON;
6414 typedef union
6416 struct
6418 unsigned HLVDL0 : 1;
6419 unsigned HLVDL1 : 1;
6420 unsigned HLVDL2 : 1;
6421 unsigned HLVDL3 : 1;
6422 unsigned HLVDEN : 1;
6423 unsigned IRVST : 1;
6424 unsigned BGVST : 1;
6425 unsigned VDIRMAG : 1;
6428 struct
6430 unsigned HLVDL : 4;
6431 unsigned : 4;
6433 } __HLVDCONbits_t;
6435 extern __at(0x0FA8) volatile __HLVDCONbits_t HLVDCONbits;
6437 #define _HLVDL0 0x01
6438 #define _HLVDL1 0x02
6439 #define _HLVDL2 0x04
6440 #define _HLVDL3 0x08
6441 #define _HLVDEN 0x10
6442 #define _IRVST 0x20
6443 #define _BGVST 0x40
6444 #define _VDIRMAG 0x80
6446 //==============================================================================
6449 //==============================================================================
6450 // IPR6 Bits
6452 extern __at(0x0FA9) __sfr IPR6;
6454 typedef struct
6456 unsigned CMP1IP : 1;
6457 unsigned CMP2IP : 1;
6458 unsigned CMP3IP : 1;
6459 unsigned : 1;
6460 unsigned EEIP : 1;
6461 unsigned : 1;
6462 unsigned : 1;
6463 unsigned : 1;
6464 } __IPR6bits_t;
6466 extern __at(0x0FA9) volatile __IPR6bits_t IPR6bits;
6468 #define _CMP1IP 0x01
6469 #define _CMP2IP 0x02
6470 #define _CMP3IP 0x04
6471 #define _EEIP 0x10
6473 //==============================================================================
6476 //==============================================================================
6477 // T1GCON Bits
6479 extern __at(0x0FAA) __sfr T1GCON;
6481 typedef union
6483 struct
6485 unsigned T1GSS0 : 1;
6486 unsigned T1GSS1 : 1;
6487 unsigned T1GVAL : 1;
6488 unsigned T1GGO_NOT_T1DONE : 1;
6489 unsigned T1GSPM : 1;
6490 unsigned T1GTM : 1;
6491 unsigned T1GPOL : 1;
6492 unsigned TMR1GE : 1;
6495 struct
6497 unsigned : 1;
6498 unsigned : 1;
6499 unsigned : 1;
6500 unsigned T1GGO : 1;
6501 unsigned : 1;
6502 unsigned : 1;
6503 unsigned : 1;
6504 unsigned : 1;
6507 struct
6509 unsigned : 1;
6510 unsigned : 1;
6511 unsigned : 1;
6512 unsigned NOT_T1DONE : 1;
6513 unsigned : 1;
6514 unsigned : 1;
6515 unsigned : 1;
6516 unsigned : 1;
6519 struct
6521 unsigned T1GSS : 2;
6522 unsigned : 6;
6524 } __T1GCONbits_t;
6526 extern __at(0x0FAA) volatile __T1GCONbits_t T1GCONbits;
6528 #define _T1GSS0 0x01
6529 #define _T1GSS1 0x02
6530 #define _T1GVAL 0x04
6531 #define _T1GGO_NOT_T1DONE 0x08
6532 #define _T1GGO 0x08
6533 #define _NOT_T1DONE 0x08
6534 #define _T1GSPM 0x10
6535 #define _T1GTM 0x20
6536 #define _T1GPOL 0x40
6537 #define _TMR1GE 0x80
6539 //==============================================================================
6542 //==============================================================================
6543 // RCSTA Bits
6545 extern __at(0x0FAB) __sfr RCSTA;
6547 typedef union
6549 struct
6551 unsigned RX9D : 1;
6552 unsigned OERR : 1;
6553 unsigned FERR : 1;
6554 unsigned ADDEN : 1;
6555 unsigned CREN : 1;
6556 unsigned SREN : 1;
6557 unsigned RX9 : 1;
6558 unsigned SPEN : 1;
6561 struct
6563 unsigned RCD8 : 1;
6564 unsigned OERR1 : 1;
6565 unsigned FERR1 : 1;
6566 unsigned ADEN : 1;
6567 unsigned CREN1 : 1;
6568 unsigned SREN1 : 1;
6569 unsigned RC9 : 1;
6570 unsigned SPEN1 : 1;
6573 struct
6575 unsigned RX9D1 : 1;
6576 unsigned : 1;
6577 unsigned : 1;
6578 unsigned ADDEN1 : 1;
6579 unsigned : 1;
6580 unsigned : 1;
6581 unsigned NOT_RC8 : 1;
6582 unsigned : 1;
6585 struct
6587 unsigned : 1;
6588 unsigned : 1;
6589 unsigned : 1;
6590 unsigned : 1;
6591 unsigned : 1;
6592 unsigned : 1;
6593 unsigned RC8_9 : 1;
6594 unsigned : 1;
6597 struct
6599 unsigned : 1;
6600 unsigned : 1;
6601 unsigned : 1;
6602 unsigned : 1;
6603 unsigned : 1;
6604 unsigned : 1;
6605 unsigned RX91 : 1;
6606 unsigned : 1;
6608 } __RCSTAbits_t;
6610 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
6612 #define _RX9D 0x01
6613 #define _RCD8 0x01
6614 #define _RX9D1 0x01
6615 #define _OERR 0x02
6616 #define _OERR1 0x02
6617 #define _FERR 0x04
6618 #define _FERR1 0x04
6619 #define _ADDEN 0x08
6620 #define _ADEN 0x08
6621 #define _ADDEN1 0x08
6622 #define _CREN 0x10
6623 #define _CREN1 0x10
6624 #define _SREN 0x20
6625 #define _SREN1 0x20
6626 #define _RX9 0x40
6627 #define _RC9 0x40
6628 #define _NOT_RC8 0x40
6629 #define _RC8_9 0x40
6630 #define _RX91 0x40
6631 #define _SPEN 0x80
6632 #define _SPEN1 0x80
6634 //==============================================================================
6637 //==============================================================================
6638 // RCSTA1 Bits
6640 extern __at(0x0FAB) __sfr RCSTA1;
6642 typedef union
6644 struct
6646 unsigned RX9D : 1;
6647 unsigned OERR : 1;
6648 unsigned FERR : 1;
6649 unsigned ADDEN : 1;
6650 unsigned CREN : 1;
6651 unsigned SREN : 1;
6652 unsigned RX9 : 1;
6653 unsigned SPEN : 1;
6656 struct
6658 unsigned RCD8 : 1;
6659 unsigned OERR1 : 1;
6660 unsigned FERR1 : 1;
6661 unsigned ADEN : 1;
6662 unsigned CREN1 : 1;
6663 unsigned SREN1 : 1;
6664 unsigned RC9 : 1;
6665 unsigned SPEN1 : 1;
6668 struct
6670 unsigned RX9D1 : 1;
6671 unsigned : 1;
6672 unsigned : 1;
6673 unsigned ADDEN1 : 1;
6674 unsigned : 1;
6675 unsigned : 1;
6676 unsigned NOT_RC8 : 1;
6677 unsigned : 1;
6680 struct
6682 unsigned : 1;
6683 unsigned : 1;
6684 unsigned : 1;
6685 unsigned : 1;
6686 unsigned : 1;
6687 unsigned : 1;
6688 unsigned RC8_9 : 1;
6689 unsigned : 1;
6692 struct
6694 unsigned : 1;
6695 unsigned : 1;
6696 unsigned : 1;
6697 unsigned : 1;
6698 unsigned : 1;
6699 unsigned : 1;
6700 unsigned RX91 : 1;
6701 unsigned : 1;
6703 } __RCSTA1bits_t;
6705 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
6707 #define _RCSTA1_RX9D 0x01
6708 #define _RCSTA1_RCD8 0x01
6709 #define _RCSTA1_RX9D1 0x01
6710 #define _RCSTA1_OERR 0x02
6711 #define _RCSTA1_OERR1 0x02
6712 #define _RCSTA1_FERR 0x04
6713 #define _RCSTA1_FERR1 0x04
6714 #define _RCSTA1_ADDEN 0x08
6715 #define _RCSTA1_ADEN 0x08
6716 #define _RCSTA1_ADDEN1 0x08
6717 #define _RCSTA1_CREN 0x10
6718 #define _RCSTA1_CREN1 0x10
6719 #define _RCSTA1_SREN 0x20
6720 #define _RCSTA1_SREN1 0x20
6721 #define _RCSTA1_RX9 0x40
6722 #define _RCSTA1_RC9 0x40
6723 #define _RCSTA1_NOT_RC8 0x40
6724 #define _RCSTA1_RC8_9 0x40
6725 #define _RCSTA1_RX91 0x40
6726 #define _RCSTA1_SPEN 0x80
6727 #define _RCSTA1_SPEN1 0x80
6729 //==============================================================================
6732 //==============================================================================
6733 // TXSTA Bits
6735 extern __at(0x0FAC) __sfr TXSTA;
6737 typedef union
6739 struct
6741 unsigned TX9D : 1;
6742 unsigned TRMT : 1;
6743 unsigned BRGH : 1;
6744 unsigned SENDB : 1;
6745 unsigned SYNC : 1;
6746 unsigned TXEN : 1;
6747 unsigned TX9 : 1;
6748 unsigned CSRC : 1;
6751 struct
6753 unsigned TXD8 : 1;
6754 unsigned TRMT1 : 1;
6755 unsigned BRGH1 : 1;
6756 unsigned SENDB1 : 1;
6757 unsigned SYNC1 : 1;
6758 unsigned TXEN1 : 1;
6759 unsigned TX8_9 : 1;
6760 unsigned CSRC1 : 1;
6763 struct
6765 unsigned TX9D1 : 1;
6766 unsigned : 1;
6767 unsigned : 1;
6768 unsigned : 1;
6769 unsigned : 1;
6770 unsigned : 1;
6771 unsigned NOT_TX8 : 1;
6772 unsigned : 1;
6775 struct
6777 unsigned : 1;
6778 unsigned : 1;
6779 unsigned : 1;
6780 unsigned : 1;
6781 unsigned : 1;
6782 unsigned : 1;
6783 unsigned TX91 : 1;
6784 unsigned : 1;
6786 } __TXSTAbits_t;
6788 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
6790 #define _TX9D 0x01
6791 #define _TXD8 0x01
6792 #define _TX9D1 0x01
6793 #define _TRMT 0x02
6794 #define _TRMT1 0x02
6795 #define _BRGH 0x04
6796 #define _BRGH1 0x04
6797 #define _SENDB 0x08
6798 #define _SENDB1 0x08
6799 #define _SYNC 0x10
6800 #define _SYNC1 0x10
6801 #define _TXEN 0x20
6802 #define _TXEN1 0x20
6803 #define _TX9 0x40
6804 #define _TX8_9 0x40
6805 #define _NOT_TX8 0x40
6806 #define _TX91 0x40
6807 #define _CSRC 0x80
6808 #define _CSRC1 0x80
6810 //==============================================================================
6813 //==============================================================================
6814 // TXSTA1 Bits
6816 extern __at(0x0FAC) __sfr TXSTA1;
6818 typedef union
6820 struct
6822 unsigned TX9D : 1;
6823 unsigned TRMT : 1;
6824 unsigned BRGH : 1;
6825 unsigned SENDB : 1;
6826 unsigned SYNC : 1;
6827 unsigned TXEN : 1;
6828 unsigned TX9 : 1;
6829 unsigned CSRC : 1;
6832 struct
6834 unsigned TXD8 : 1;
6835 unsigned TRMT1 : 1;
6836 unsigned BRGH1 : 1;
6837 unsigned SENDB1 : 1;
6838 unsigned SYNC1 : 1;
6839 unsigned TXEN1 : 1;
6840 unsigned TX8_9 : 1;
6841 unsigned CSRC1 : 1;
6844 struct
6846 unsigned TX9D1 : 1;
6847 unsigned : 1;
6848 unsigned : 1;
6849 unsigned : 1;
6850 unsigned : 1;
6851 unsigned : 1;
6852 unsigned NOT_TX8 : 1;
6853 unsigned : 1;
6856 struct
6858 unsigned : 1;
6859 unsigned : 1;
6860 unsigned : 1;
6861 unsigned : 1;
6862 unsigned : 1;
6863 unsigned : 1;
6864 unsigned TX91 : 1;
6865 unsigned : 1;
6867 } __TXSTA1bits_t;
6869 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
6871 #define _TXSTA1_TX9D 0x01
6872 #define _TXSTA1_TXD8 0x01
6873 #define _TXSTA1_TX9D1 0x01
6874 #define _TXSTA1_TRMT 0x02
6875 #define _TXSTA1_TRMT1 0x02
6876 #define _TXSTA1_BRGH 0x04
6877 #define _TXSTA1_BRGH1 0x04
6878 #define _TXSTA1_SENDB 0x08
6879 #define _TXSTA1_SENDB1 0x08
6880 #define _TXSTA1_SYNC 0x10
6881 #define _TXSTA1_SYNC1 0x10
6882 #define _TXSTA1_TXEN 0x20
6883 #define _TXSTA1_TXEN1 0x20
6884 #define _TXSTA1_TX9 0x40
6885 #define _TXSTA1_TX8_9 0x40
6886 #define _TXSTA1_NOT_TX8 0x40
6887 #define _TXSTA1_TX91 0x40
6888 #define _TXSTA1_CSRC 0x80
6889 #define _TXSTA1_CSRC1 0x80
6891 //==============================================================================
6893 extern __at(0x0FAD) __sfr TXREG;
6894 extern __at(0x0FAD) __sfr TXREG1;
6895 extern __at(0x0FAE) __sfr RCREG;
6896 extern __at(0x0FAE) __sfr RCREG1;
6897 extern __at(0x0FAF) __sfr SPBRG;
6898 extern __at(0x0FAF) __sfr SPBRG1;
6900 //==============================================================================
6901 // T3GCON Bits
6903 extern __at(0x0FB0) __sfr T3GCON;
6905 typedef union
6907 struct
6909 unsigned T3GSS0 : 1;
6910 unsigned T3GSS1 : 1;
6911 unsigned T3GVAL : 1;
6912 unsigned T3GGO_NOT_T3DONE : 1;
6913 unsigned T3GSPM : 1;
6914 unsigned T3GTM : 1;
6915 unsigned T3GPOL : 1;
6916 unsigned TMR3GE : 1;
6919 struct
6921 unsigned : 1;
6922 unsigned : 1;
6923 unsigned : 1;
6924 unsigned T3GGO : 1;
6925 unsigned : 1;
6926 unsigned : 1;
6927 unsigned : 1;
6928 unsigned : 1;
6931 struct
6933 unsigned : 1;
6934 unsigned : 1;
6935 unsigned : 1;
6936 unsigned NOT_T3DONE : 1;
6937 unsigned : 1;
6938 unsigned : 1;
6939 unsigned : 1;
6940 unsigned : 1;
6943 struct
6945 unsigned T3GSS : 2;
6946 unsigned : 6;
6948 } __T3GCONbits_t;
6950 extern __at(0x0FB0) volatile __T3GCONbits_t T3GCONbits;
6952 #define _T3GSS0 0x01
6953 #define _T3GSS1 0x02
6954 #define _T3GVAL 0x04
6955 #define _T3GGO_NOT_T3DONE 0x08
6956 #define _T3GGO 0x08
6957 #define _NOT_T3DONE 0x08
6958 #define _T3GSPM 0x10
6959 #define _T3GTM 0x20
6960 #define _T3GPOL 0x40
6961 #define _TMR3GE 0x80
6963 //==============================================================================
6966 //==============================================================================
6967 // T3CON Bits
6969 extern __at(0x0FB1) __sfr T3CON;
6971 typedef union
6973 struct
6975 unsigned TMR3ON : 1;
6976 unsigned RD16 : 1;
6977 unsigned NOT_T3SYNC : 1;
6978 unsigned SOSCEN : 1;
6979 unsigned T3CKPS0 : 1;
6980 unsigned T3CKPS1 : 1;
6981 unsigned TMR3CS0 : 1;
6982 unsigned TMR3CS1 : 1;
6985 struct
6987 unsigned : 4;
6988 unsigned T3CKPS : 2;
6989 unsigned : 2;
6992 struct
6994 unsigned : 6;
6995 unsigned TMR3CS : 2;
6997 } __T3CONbits_t;
6999 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
7001 #define _T3CON_TMR3ON 0x01
7002 #define _T3CON_RD16 0x02
7003 #define _T3CON_NOT_T3SYNC 0x04
7004 #define _T3CON_SOSCEN 0x08
7005 #define _T3CON_T3CKPS0 0x10
7006 #define _T3CON_T3CKPS1 0x20
7007 #define _T3CON_TMR3CS0 0x40
7008 #define _T3CON_TMR3CS1 0x80
7010 //==============================================================================
7012 extern __at(0x0FB2) __sfr TMR3;
7013 extern __at(0x0FB2) __sfr TMR3L;
7014 extern __at(0x0FB3) __sfr TMR3H;
7016 //==============================================================================
7017 // CMSTAT Bits
7019 extern __at(0x0FB4) __sfr CMSTAT;
7021 typedef union
7023 struct
7025 unsigned : 1;
7026 unsigned : 1;
7027 unsigned : 1;
7028 unsigned : 1;
7029 unsigned : 1;
7030 unsigned CMP1OUT : 1;
7031 unsigned CMP2OUT : 1;
7032 unsigned CMP3OUT : 1;
7035 struct
7037 unsigned : 1;
7038 unsigned : 1;
7039 unsigned : 1;
7040 unsigned : 1;
7041 unsigned : 1;
7042 unsigned C1OUT : 1;
7043 unsigned C2OUT : 1;
7044 unsigned C3OUT : 1;
7046 } __CMSTATbits_t;
7048 extern __at(0x0FB4) volatile __CMSTATbits_t CMSTATbits;
7050 #define _CMP1OUT 0x20
7051 #define _C1OUT 0x20
7052 #define _CMP2OUT 0x40
7053 #define _C2OUT 0x40
7054 #define _CMP3OUT 0x80
7055 #define _C3OUT 0x80
7057 //==============================================================================
7060 //==============================================================================
7061 // CMSTATUS Bits
7063 extern __at(0x0FB4) __sfr CMSTATUS;
7065 typedef union
7067 struct
7069 unsigned : 1;
7070 unsigned : 1;
7071 unsigned : 1;
7072 unsigned : 1;
7073 unsigned : 1;
7074 unsigned CMP1OUT : 1;
7075 unsigned CMP2OUT : 1;
7076 unsigned CMP3OUT : 1;
7079 struct
7081 unsigned : 1;
7082 unsigned : 1;
7083 unsigned : 1;
7084 unsigned : 1;
7085 unsigned : 1;
7086 unsigned C1OUT : 1;
7087 unsigned C2OUT : 1;
7088 unsigned C3OUT : 1;
7090 } __CMSTATUSbits_t;
7092 extern __at(0x0FB4) volatile __CMSTATUSbits_t CMSTATUSbits;
7094 #define _CMSTATUS_CMP1OUT 0x20
7095 #define _CMSTATUS_C1OUT 0x20
7096 #define _CMSTATUS_CMP2OUT 0x40
7097 #define _CMSTATUS_C2OUT 0x40
7098 #define _CMSTATUS_CMP3OUT 0x80
7099 #define _CMSTATUS_C3OUT 0x80
7101 //==============================================================================
7104 //==============================================================================
7105 // CVRCON Bits
7107 extern __at(0x0FB5) __sfr CVRCON;
7109 typedef union
7111 struct
7113 unsigned CVR0 : 1;
7114 unsigned CVR1 : 1;
7115 unsigned CVR2 : 1;
7116 unsigned CVR3 : 1;
7117 unsigned CVR4 : 1;
7118 unsigned CVRSS : 1;
7119 unsigned CVROE : 1;
7120 unsigned CVREN : 1;
7123 struct
7125 unsigned CVR : 5;
7126 unsigned : 3;
7128 } __CVRCONbits_t;
7130 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
7132 #define _CVR0 0x01
7133 #define _CVR1 0x02
7134 #define _CVR2 0x04
7135 #define _CVR3 0x08
7136 #define _CVR4 0x10
7137 #define _CVRSS 0x20
7138 #define _CVROE 0x40
7139 #define _CVREN 0x80
7141 //==============================================================================
7144 //==============================================================================
7145 // PIE4 Bits
7147 extern __at(0x0FB6) __sfr PIE4;
7149 typedef struct
7151 unsigned CCP3IE : 1;
7152 unsigned CCP4IE : 1;
7153 unsigned CCP5IE : 1;
7154 unsigned CCP6IE : 1;
7155 unsigned CCP7IE : 1;
7156 unsigned CCP8IE : 1;
7157 unsigned CCP9IE : 1;
7158 unsigned CCP10IE : 1;
7159 } __PIE4bits_t;
7161 extern __at(0x0FB6) volatile __PIE4bits_t PIE4bits;
7163 #define _CCP3IE 0x01
7164 #define _CCP4IE 0x02
7165 #define _CCP5IE 0x04
7166 #define _CCP6IE 0x08
7167 #define _CCP7IE 0x10
7168 #define _CCP8IE 0x20
7169 #define _CCP9IE 0x40
7170 #define _CCP10IE 0x80
7172 //==============================================================================
7175 //==============================================================================
7176 // PIR4 Bits
7178 extern __at(0x0FB7) __sfr PIR4;
7180 typedef struct
7182 unsigned CCP3IF : 1;
7183 unsigned CCP4IF : 1;
7184 unsigned CCP5IF : 1;
7185 unsigned CCP6IF : 1;
7186 unsigned CCP7IF : 1;
7187 unsigned CCP8IF : 1;
7188 unsigned CCP9IF : 1;
7189 unsigned CCP10IF : 1;
7190 } __PIR4bits_t;
7192 extern __at(0x0FB7) volatile __PIR4bits_t PIR4bits;
7194 #define _CCP3IF 0x01
7195 #define _CCP4IF 0x02
7196 #define _CCP5IF 0x04
7197 #define _CCP6IF 0x08
7198 #define _CCP7IF 0x10
7199 #define _CCP8IF 0x20
7200 #define _CCP9IF 0x40
7201 #define _CCP10IF 0x80
7203 //==============================================================================
7206 //==============================================================================
7207 // IPR4 Bits
7209 extern __at(0x0FB8) __sfr IPR4;
7211 typedef struct
7213 unsigned CCP3IP : 1;
7214 unsigned CCP4IP : 1;
7215 unsigned CCP5IP : 1;
7216 unsigned CCP6IP : 1;
7217 unsigned CCP7IP : 1;
7218 unsigned CCP8IP : 1;
7219 unsigned CCP9IP : 1;
7220 unsigned CCP10IP : 1;
7221 } __IPR4bits_t;
7223 extern __at(0x0FB8) volatile __IPR4bits_t IPR4bits;
7225 #define _CCP3IP 0x01
7226 #define _CCP4IP 0x02
7227 #define _CCP5IP 0x04
7228 #define _CCP6IP 0x08
7229 #define _CCP7IP 0x10
7230 #define _CCP8IP 0x20
7231 #define _CCP9IP 0x40
7232 #define _CCP10IP 0x80
7234 //==============================================================================
7237 //==============================================================================
7238 // PIE5 Bits
7240 extern __at(0x0FB9) __sfr PIE5;
7242 typedef struct
7244 unsigned TMR4IE : 1;
7245 unsigned TMR5IE : 1;
7246 unsigned TMR6IE : 1;
7247 unsigned TMR7IE : 1;
7248 unsigned TMR8IE : 1;
7249 unsigned TMR10IE : 1;
7250 unsigned TMR12IE : 1;
7251 unsigned TMR7GIE : 1;
7252 } __PIE5bits_t;
7254 extern __at(0x0FB9) volatile __PIE5bits_t PIE5bits;
7256 #define _TMR4IE 0x01
7257 #define _TMR5IE 0x02
7258 #define _TMR6IE 0x04
7259 #define _TMR7IE 0x08
7260 #define _TMR8IE 0x10
7261 #define _TMR10IE 0x20
7262 #define _TMR12IE 0x40
7263 #define _TMR7GIE 0x80
7265 //==============================================================================
7268 //==============================================================================
7269 // PIR5 Bits
7271 extern __at(0x0FBA) __sfr PIR5;
7273 typedef struct
7275 unsigned TMR4IF : 1;
7276 unsigned TMR5IF : 1;
7277 unsigned TMR6IF : 1;
7278 unsigned TMR7IF : 1;
7279 unsigned TMR8IF : 1;
7280 unsigned TMR10IF : 1;
7281 unsigned TMR12IF : 1;
7282 unsigned TMR7GIF : 1;
7283 } __PIR5bits_t;
7285 extern __at(0x0FBA) volatile __PIR5bits_t PIR5bits;
7287 #define _TMR4IF 0x01
7288 #define _TMR5IF 0x02
7289 #define _TMR6IF 0x04
7290 #define _TMR7IF 0x08
7291 #define _TMR8IF 0x10
7292 #define _TMR10IF 0x20
7293 #define _TMR12IF 0x40
7294 #define _TMR7GIF 0x80
7296 //==============================================================================
7299 //==============================================================================
7300 // CCP1CON Bits
7302 extern __at(0x0FBB) __sfr CCP1CON;
7304 typedef union
7306 struct
7308 unsigned CCP1M0 : 1;
7309 unsigned CCP1M1 : 1;
7310 unsigned CCP1M2 : 1;
7311 unsigned CCP1M3 : 1;
7312 unsigned DC1B0 : 1;
7313 unsigned DC1B1 : 1;
7314 unsigned P1M0 : 1;
7315 unsigned P1M1 : 1;
7318 struct
7320 unsigned : 1;
7321 unsigned : 1;
7322 unsigned : 1;
7323 unsigned : 1;
7324 unsigned CCP1Y : 1;
7325 unsigned CCP1X : 1;
7326 unsigned : 1;
7327 unsigned : 1;
7330 struct
7332 unsigned CCP1M : 4;
7333 unsigned : 4;
7336 struct
7338 unsigned : 4;
7339 unsigned DC1B : 2;
7340 unsigned : 2;
7343 struct
7345 unsigned : 6;
7346 unsigned P1M : 2;
7348 } __CCP1CONbits_t;
7350 extern __at(0x0FBB) volatile __CCP1CONbits_t CCP1CONbits;
7352 #define _CCP1M0 0x01
7353 #define _CCP1M1 0x02
7354 #define _CCP1M2 0x04
7355 #define _CCP1M3 0x08
7356 #define _DC1B0 0x10
7357 #define _CCP1Y 0x10
7358 #define _DC1B1 0x20
7359 #define _CCP1X 0x20
7360 #define _P1M0 0x40
7361 #define _P1M1 0x80
7363 //==============================================================================
7366 //==============================================================================
7367 // ECCP1CON Bits
7369 extern __at(0x0FBB) __sfr ECCP1CON;
7371 typedef union
7373 struct
7375 unsigned CCP1M0 : 1;
7376 unsigned CCP1M1 : 1;
7377 unsigned CCP1M2 : 1;
7378 unsigned CCP1M3 : 1;
7379 unsigned DC1B0 : 1;
7380 unsigned DC1B1 : 1;
7381 unsigned P1M0 : 1;
7382 unsigned P1M1 : 1;
7385 struct
7387 unsigned : 1;
7388 unsigned : 1;
7389 unsigned : 1;
7390 unsigned : 1;
7391 unsigned CCP1Y : 1;
7392 unsigned CCP1X : 1;
7393 unsigned : 1;
7394 unsigned : 1;
7397 struct
7399 unsigned CCP1M : 4;
7400 unsigned : 4;
7403 struct
7405 unsigned : 4;
7406 unsigned DC1B : 2;
7407 unsigned : 2;
7410 struct
7412 unsigned : 6;
7413 unsigned P1M : 2;
7415 } __ECCP1CONbits_t;
7417 extern __at(0x0FBB) volatile __ECCP1CONbits_t ECCP1CONbits;
7419 #define _ECCP1CON_CCP1M0 0x01
7420 #define _ECCP1CON_CCP1M1 0x02
7421 #define _ECCP1CON_CCP1M2 0x04
7422 #define _ECCP1CON_CCP1M3 0x08
7423 #define _ECCP1CON_DC1B0 0x10
7424 #define _ECCP1CON_CCP1Y 0x10
7425 #define _ECCP1CON_DC1B1 0x20
7426 #define _ECCP1CON_CCP1X 0x20
7427 #define _ECCP1CON_P1M0 0x40
7428 #define _ECCP1CON_P1M1 0x80
7430 //==============================================================================
7432 extern __at(0x0FBC) __sfr CCPR1;
7433 extern __at(0x0FBC) __sfr CCPR1L;
7434 extern __at(0x0FBD) __sfr CCPR1H;
7436 //==============================================================================
7437 // ECCP1DEL Bits
7439 extern __at(0x0FBE) __sfr ECCP1DEL;
7441 typedef union
7443 struct
7445 unsigned P1DC0 : 1;
7446 unsigned P1DC1 : 1;
7447 unsigned P1DC2 : 1;
7448 unsigned P1DC3 : 1;
7449 unsigned P1DC4 : 1;
7450 unsigned P1DC5 : 1;
7451 unsigned P1DC6 : 1;
7452 unsigned P1RSEN : 1;
7455 struct
7457 unsigned P1DC : 7;
7458 unsigned : 1;
7460 } __ECCP1DELbits_t;
7462 extern __at(0x0FBE) volatile __ECCP1DELbits_t ECCP1DELbits;
7464 #define _P1DC0 0x01
7465 #define _P1DC1 0x02
7466 #define _P1DC2 0x04
7467 #define _P1DC3 0x08
7468 #define _P1DC4 0x10
7469 #define _P1DC5 0x20
7470 #define _P1DC6 0x40
7471 #define _P1RSEN 0x80
7473 //==============================================================================
7476 //==============================================================================
7477 // PWM1CON Bits
7479 extern __at(0x0FBE) __sfr PWM1CON;
7481 typedef union
7483 struct
7485 unsigned P1DC0 : 1;
7486 unsigned P1DC1 : 1;
7487 unsigned P1DC2 : 1;
7488 unsigned P1DC3 : 1;
7489 unsigned P1DC4 : 1;
7490 unsigned P1DC5 : 1;
7491 unsigned P1DC6 : 1;
7492 unsigned P1RSEN : 1;
7495 struct
7497 unsigned P1DC : 7;
7498 unsigned : 1;
7500 } __PWM1CONbits_t;
7502 extern __at(0x0FBE) volatile __PWM1CONbits_t PWM1CONbits;
7504 #define _PWM1CON_P1DC0 0x01
7505 #define _PWM1CON_P1DC1 0x02
7506 #define _PWM1CON_P1DC2 0x04
7507 #define _PWM1CON_P1DC3 0x08
7508 #define _PWM1CON_P1DC4 0x10
7509 #define _PWM1CON_P1DC5 0x20
7510 #define _PWM1CON_P1DC6 0x40
7511 #define _PWM1CON_P1RSEN 0x80
7513 //==============================================================================
7516 //==============================================================================
7517 // ECCP1AS Bits
7519 extern __at(0x0FBF) __sfr ECCP1AS;
7521 typedef union
7523 struct
7525 unsigned PSS1BD0 : 1;
7526 unsigned PSS1BD1 : 1;
7527 unsigned PSS1AC0 : 1;
7528 unsigned PSS1AC1 : 1;
7529 unsigned ECCP1AS0 : 1;
7530 unsigned ECCP1AS1 : 1;
7531 unsigned ECCP1AS2 : 1;
7532 unsigned ECCP1ASE : 1;
7535 struct
7537 unsigned PSS1BD : 2;
7538 unsigned : 6;
7541 struct
7543 unsigned : 2;
7544 unsigned PSS1AC : 2;
7545 unsigned : 4;
7548 struct
7550 unsigned : 4;
7551 unsigned ECCP1AS : 3;
7552 unsigned : 1;
7554 } __ECCP1ASbits_t;
7556 extern __at(0x0FBF) volatile __ECCP1ASbits_t ECCP1ASbits;
7558 #define _PSS1BD0 0x01
7559 #define _PSS1BD1 0x02
7560 #define _PSS1AC0 0x04
7561 #define _PSS1AC1 0x08
7562 #define _ECCP1AS0 0x10
7563 #define _ECCP1AS1 0x20
7564 #define _ECCP1AS2 0x40
7565 #define _ECCP1ASE 0x80
7567 //==============================================================================
7570 //==============================================================================
7571 // ADCON2 Bits
7573 extern __at(0x0FC0) __sfr ADCON2;
7575 typedef union
7577 struct
7579 unsigned ADCS0 : 1;
7580 unsigned ADCS1 : 1;
7581 unsigned ADCS2 : 1;
7582 unsigned ACQT0 : 1;
7583 unsigned ACQT1 : 1;
7584 unsigned ACQT2 : 1;
7585 unsigned : 1;
7586 unsigned ADFM : 1;
7589 struct
7591 unsigned ADCS : 3;
7592 unsigned : 5;
7595 struct
7597 unsigned : 3;
7598 unsigned ACQT : 3;
7599 unsigned : 2;
7601 } __ADCON2bits_t;
7603 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
7605 #define _ADCS0 0x01
7606 #define _ADCS1 0x02
7607 #define _ADCS2 0x04
7608 #define _ACQT0 0x08
7609 #define _ACQT1 0x10
7610 #define _ACQT2 0x20
7611 #define _ADFM 0x80
7613 //==============================================================================
7616 //==============================================================================
7617 // ADCON1 Bits
7619 extern __at(0x0FC1) __sfr ADCON1;
7621 typedef union
7623 struct
7625 unsigned CHSN0 : 1;
7626 unsigned CHSN1 : 1;
7627 unsigned CHSN2 : 1;
7628 unsigned VNCFG : 1;
7629 unsigned VCFG0 : 1;
7630 unsigned VCFG1 : 1;
7631 unsigned TRIGSEL0 : 1;
7632 unsigned TRIGSEL1 : 1;
7635 struct
7637 unsigned CHSN : 3;
7638 unsigned : 5;
7641 struct
7643 unsigned : 4;
7644 unsigned VCFG : 2;
7645 unsigned : 2;
7648 struct
7650 unsigned : 6;
7651 unsigned TRIGSEL : 2;
7653 } __ADCON1bits_t;
7655 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
7657 #define _CHSN0 0x01
7658 #define _CHSN1 0x02
7659 #define _CHSN2 0x04
7660 #define _VNCFG 0x08
7661 #define _VCFG0 0x10
7662 #define _VCFG1 0x20
7663 #define _TRIGSEL0 0x40
7664 #define _TRIGSEL1 0x80
7666 //==============================================================================
7669 //==============================================================================
7670 // ADCON0 Bits
7672 extern __at(0x0FC2) __sfr ADCON0;
7674 typedef union
7676 struct
7678 unsigned ADON : 1;
7679 unsigned GO_NOT_DONE : 1;
7680 unsigned CHS0 : 1;
7681 unsigned CHS1 : 1;
7682 unsigned CHS2 : 1;
7683 unsigned CHS3 : 1;
7684 unsigned CHS4 : 1;
7685 unsigned : 1;
7688 struct
7690 unsigned : 1;
7691 unsigned DONE : 1;
7692 unsigned : 1;
7693 unsigned : 1;
7694 unsigned : 1;
7695 unsigned : 1;
7696 unsigned : 1;
7697 unsigned : 1;
7700 struct
7702 unsigned : 1;
7703 unsigned GO : 1;
7704 unsigned : 1;
7705 unsigned : 1;
7706 unsigned : 1;
7707 unsigned : 1;
7708 unsigned : 1;
7709 unsigned : 1;
7712 struct
7714 unsigned : 1;
7715 unsigned NOT_DONE : 1;
7716 unsigned : 1;
7717 unsigned : 1;
7718 unsigned : 1;
7719 unsigned : 1;
7720 unsigned : 1;
7721 unsigned : 1;
7724 struct
7726 unsigned : 2;
7727 unsigned CHS : 5;
7728 unsigned : 1;
7730 } __ADCON0bits_t;
7732 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
7734 #define _ADON 0x01
7735 #define _GO_NOT_DONE 0x02
7736 #define _DONE 0x02
7737 #define _GO 0x02
7738 #define _NOT_DONE 0x02
7739 #define _CHS0 0x04
7740 #define _CHS1 0x08
7741 #define _CHS2 0x10
7742 #define _CHS3 0x20
7743 #define _CHS4 0x40
7745 //==============================================================================
7747 extern __at(0x0FC3) __sfr ADRES;
7748 extern __at(0x0FC3) __sfr ADRESL;
7749 extern __at(0x0FC4) __sfr ADRESH;
7751 //==============================================================================
7752 // SSP1CON2 Bits
7754 extern __at(0x0FC5) __sfr SSP1CON2;
7756 typedef union
7758 struct
7760 unsigned SEN : 1;
7761 unsigned RSEN : 1;
7762 unsigned PEN : 1;
7763 unsigned RCEN : 1;
7764 unsigned ACKEN : 1;
7765 unsigned ACKDT : 1;
7766 unsigned ACKSTAT : 1;
7767 unsigned GCEN : 1;
7770 struct
7772 unsigned : 1;
7773 unsigned ADMSK1 : 1;
7774 unsigned ADMSK2 : 1;
7775 unsigned ADMSK3 : 1;
7776 unsigned ADMSK4 : 1;
7777 unsigned ADMSK5 : 1;
7778 unsigned : 1;
7779 unsigned : 1;
7781 } __SSP1CON2bits_t;
7783 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
7785 #define _SEN 0x01
7786 #define _RSEN 0x02
7787 #define _ADMSK1 0x02
7788 #define _PEN 0x04
7789 #define _ADMSK2 0x04
7790 #define _RCEN 0x08
7791 #define _ADMSK3 0x08
7792 #define _ACKEN 0x10
7793 #define _ADMSK4 0x10
7794 #define _ACKDT 0x20
7795 #define _ADMSK5 0x20
7796 #define _ACKSTAT 0x40
7797 #define _GCEN 0x80
7799 //==============================================================================
7802 //==============================================================================
7803 // SSPCON2 Bits
7805 extern __at(0x0FC5) __sfr SSPCON2;
7807 typedef union
7809 struct
7811 unsigned SEN : 1;
7812 unsigned RSEN : 1;
7813 unsigned PEN : 1;
7814 unsigned RCEN : 1;
7815 unsigned ACKEN : 1;
7816 unsigned ACKDT : 1;
7817 unsigned ACKSTAT : 1;
7818 unsigned GCEN : 1;
7821 struct
7823 unsigned : 1;
7824 unsigned ADMSK1 : 1;
7825 unsigned ADMSK2 : 1;
7826 unsigned ADMSK3 : 1;
7827 unsigned ADMSK4 : 1;
7828 unsigned ADMSK5 : 1;
7829 unsigned : 1;
7830 unsigned : 1;
7832 } __SSPCON2bits_t;
7834 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
7836 #define _SSPCON2_SEN 0x01
7837 #define _SSPCON2_RSEN 0x02
7838 #define _SSPCON2_ADMSK1 0x02
7839 #define _SSPCON2_PEN 0x04
7840 #define _SSPCON2_ADMSK2 0x04
7841 #define _SSPCON2_RCEN 0x08
7842 #define _SSPCON2_ADMSK3 0x08
7843 #define _SSPCON2_ACKEN 0x10
7844 #define _SSPCON2_ADMSK4 0x10
7845 #define _SSPCON2_ACKDT 0x20
7846 #define _SSPCON2_ADMSK5 0x20
7847 #define _SSPCON2_ACKSTAT 0x40
7848 #define _SSPCON2_GCEN 0x80
7850 //==============================================================================
7853 //==============================================================================
7854 // SSP1CON1 Bits
7856 extern __at(0x0FC6) __sfr SSP1CON1;
7858 typedef union
7860 struct
7862 unsigned SSPM0 : 1;
7863 unsigned SSPM1 : 1;
7864 unsigned SSPM2 : 1;
7865 unsigned SSPM3 : 1;
7866 unsigned CKP : 1;
7867 unsigned SSPEN : 1;
7868 unsigned SSPOV : 1;
7869 unsigned WCOL : 1;
7872 struct
7874 unsigned SSPM : 4;
7875 unsigned : 4;
7877 } __SSP1CON1bits_t;
7879 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
7881 #define _SSPM0 0x01
7882 #define _SSPM1 0x02
7883 #define _SSPM2 0x04
7884 #define _SSPM3 0x08
7885 #define _CKP 0x10
7886 #define _SSPEN 0x20
7887 #define _SSPOV 0x40
7888 #define _WCOL 0x80
7890 //==============================================================================
7893 //==============================================================================
7894 // SSPCON1 Bits
7896 extern __at(0x0FC6) __sfr SSPCON1;
7898 typedef union
7900 struct
7902 unsigned SSPM0 : 1;
7903 unsigned SSPM1 : 1;
7904 unsigned SSPM2 : 1;
7905 unsigned SSPM3 : 1;
7906 unsigned CKP : 1;
7907 unsigned SSPEN : 1;
7908 unsigned SSPOV : 1;
7909 unsigned WCOL : 1;
7912 struct
7914 unsigned SSPM : 4;
7915 unsigned : 4;
7917 } __SSPCON1bits_t;
7919 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
7921 #define _SSPCON1_SSPM0 0x01
7922 #define _SSPCON1_SSPM1 0x02
7923 #define _SSPCON1_SSPM2 0x04
7924 #define _SSPCON1_SSPM3 0x08
7925 #define _SSPCON1_CKP 0x10
7926 #define _SSPCON1_SSPEN 0x20
7927 #define _SSPCON1_SSPOV 0x40
7928 #define _SSPCON1_WCOL 0x80
7930 //==============================================================================
7933 //==============================================================================
7934 // SSP1STAT Bits
7936 extern __at(0x0FC7) __sfr SSP1STAT;
7938 typedef union
7940 struct
7942 unsigned BF : 1;
7943 unsigned UA : 1;
7944 unsigned R_NOT_W : 1;
7945 unsigned S : 1;
7946 unsigned P : 1;
7947 unsigned D_NOT_A : 1;
7948 unsigned CKE : 1;
7949 unsigned SMP : 1;
7952 struct
7954 unsigned : 1;
7955 unsigned : 1;
7956 unsigned R : 1;
7957 unsigned I2C_START : 1;
7958 unsigned I2C_STOP : 1;
7959 unsigned D : 1;
7960 unsigned : 1;
7961 unsigned : 1;
7964 struct
7966 unsigned : 1;
7967 unsigned : 1;
7968 unsigned R_W : 1;
7969 unsigned : 1;
7970 unsigned : 1;
7971 unsigned D_A : 1;
7972 unsigned : 1;
7973 unsigned : 1;
7976 struct
7978 unsigned : 1;
7979 unsigned : 1;
7980 unsigned NOT_W : 1;
7981 unsigned : 1;
7982 unsigned : 1;
7983 unsigned NOT_A : 1;
7984 unsigned : 1;
7985 unsigned : 1;
7988 struct
7990 unsigned : 1;
7991 unsigned : 1;
7992 unsigned NOT_WRITE : 1;
7993 unsigned : 1;
7994 unsigned : 1;
7995 unsigned NOT_ADDRESS : 1;
7996 unsigned : 1;
7997 unsigned : 1;
8000 struct
8002 unsigned : 1;
8003 unsigned : 1;
8004 unsigned READ_WRITE : 1;
8005 unsigned : 1;
8006 unsigned : 1;
8007 unsigned DATA_ADDRESS : 1;
8008 unsigned : 1;
8009 unsigned : 1;
8012 struct
8014 unsigned : 1;
8015 unsigned : 1;
8016 unsigned I2C_READ : 1;
8017 unsigned : 1;
8018 unsigned : 1;
8019 unsigned I2C_DAT : 1;
8020 unsigned : 1;
8021 unsigned : 1;
8023 } __SSP1STATbits_t;
8025 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
8027 #define _BF 0x01
8028 #define _UA 0x02
8029 #define _R_NOT_W 0x04
8030 #define _R 0x04
8031 #define _R_W 0x04
8032 #define _NOT_W 0x04
8033 #define _NOT_WRITE 0x04
8034 #define _READ_WRITE 0x04
8035 #define _I2C_READ 0x04
8036 #define _S 0x08
8037 #define _I2C_START 0x08
8038 #define _P 0x10
8039 #define _I2C_STOP 0x10
8040 #define _D_NOT_A 0x20
8041 #define _D 0x20
8042 #define _D_A 0x20
8043 #define _NOT_A 0x20
8044 #define _NOT_ADDRESS 0x20
8045 #define _DATA_ADDRESS 0x20
8046 #define _I2C_DAT 0x20
8047 #define _CKE 0x40
8048 #define _SMP 0x80
8050 //==============================================================================
8053 //==============================================================================
8054 // SSPSTAT Bits
8056 extern __at(0x0FC7) __sfr SSPSTAT;
8058 typedef union
8060 struct
8062 unsigned BF : 1;
8063 unsigned UA : 1;
8064 unsigned R_NOT_W : 1;
8065 unsigned S : 1;
8066 unsigned P : 1;
8067 unsigned D_NOT_A : 1;
8068 unsigned CKE : 1;
8069 unsigned SMP : 1;
8072 struct
8074 unsigned : 1;
8075 unsigned : 1;
8076 unsigned R : 1;
8077 unsigned I2C_START : 1;
8078 unsigned I2C_STOP : 1;
8079 unsigned D : 1;
8080 unsigned : 1;
8081 unsigned : 1;
8084 struct
8086 unsigned : 1;
8087 unsigned : 1;
8088 unsigned R_W : 1;
8089 unsigned : 1;
8090 unsigned : 1;
8091 unsigned D_A : 1;
8092 unsigned : 1;
8093 unsigned : 1;
8096 struct
8098 unsigned : 1;
8099 unsigned : 1;
8100 unsigned NOT_W : 1;
8101 unsigned : 1;
8102 unsigned : 1;
8103 unsigned NOT_A : 1;
8104 unsigned : 1;
8105 unsigned : 1;
8108 struct
8110 unsigned : 1;
8111 unsigned : 1;
8112 unsigned NOT_WRITE : 1;
8113 unsigned : 1;
8114 unsigned : 1;
8115 unsigned NOT_ADDRESS : 1;
8116 unsigned : 1;
8117 unsigned : 1;
8120 struct
8122 unsigned : 1;
8123 unsigned : 1;
8124 unsigned READ_WRITE : 1;
8125 unsigned : 1;
8126 unsigned : 1;
8127 unsigned DATA_ADDRESS : 1;
8128 unsigned : 1;
8129 unsigned : 1;
8132 struct
8134 unsigned : 1;
8135 unsigned : 1;
8136 unsigned I2C_READ : 1;
8137 unsigned : 1;
8138 unsigned : 1;
8139 unsigned I2C_DAT : 1;
8140 unsigned : 1;
8141 unsigned : 1;
8143 } __SSPSTATbits_t;
8145 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
8147 #define _SSPSTAT_BF 0x01
8148 #define _SSPSTAT_UA 0x02
8149 #define _SSPSTAT_R_NOT_W 0x04
8150 #define _SSPSTAT_R 0x04
8151 #define _SSPSTAT_R_W 0x04
8152 #define _SSPSTAT_NOT_W 0x04
8153 #define _SSPSTAT_NOT_WRITE 0x04
8154 #define _SSPSTAT_READ_WRITE 0x04
8155 #define _SSPSTAT_I2C_READ 0x04
8156 #define _SSPSTAT_S 0x08
8157 #define _SSPSTAT_I2C_START 0x08
8158 #define _SSPSTAT_P 0x10
8159 #define _SSPSTAT_I2C_STOP 0x10
8160 #define _SSPSTAT_D_NOT_A 0x20
8161 #define _SSPSTAT_D 0x20
8162 #define _SSPSTAT_D_A 0x20
8163 #define _SSPSTAT_NOT_A 0x20
8164 #define _SSPSTAT_NOT_ADDRESS 0x20
8165 #define _SSPSTAT_DATA_ADDRESS 0x20
8166 #define _SSPSTAT_I2C_DAT 0x20
8167 #define _SSPSTAT_CKE 0x40
8168 #define _SSPSTAT_SMP 0x80
8170 //==============================================================================
8173 //==============================================================================
8174 // SSP1ADD Bits
8176 extern __at(0x0FC8) __sfr SSP1ADD;
8178 typedef struct
8180 unsigned MSK0 : 1;
8181 unsigned MSK1 : 1;
8182 unsigned MSK2 : 1;
8183 unsigned MSK3 : 1;
8184 unsigned MSK4 : 1;
8185 unsigned MSK5 : 1;
8186 unsigned MSK6 : 1;
8187 unsigned MSK7 : 1;
8188 } __SSP1ADDbits_t;
8190 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
8192 #define _MSK0 0x01
8193 #define _MSK1 0x02
8194 #define _MSK2 0x04
8195 #define _MSK3 0x08
8196 #define _MSK4 0x10
8197 #define _MSK5 0x20
8198 #define _MSK6 0x40
8199 #define _MSK7 0x80
8201 //==============================================================================
8204 //==============================================================================
8205 // SSPADD Bits
8207 extern __at(0x0FC8) __sfr SSPADD;
8209 typedef struct
8211 unsigned MSK0 : 1;
8212 unsigned MSK1 : 1;
8213 unsigned MSK2 : 1;
8214 unsigned MSK3 : 1;
8215 unsigned MSK4 : 1;
8216 unsigned MSK5 : 1;
8217 unsigned MSK6 : 1;
8218 unsigned MSK7 : 1;
8219 } __SSPADDbits_t;
8221 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
8223 #define _SSPADD_MSK0 0x01
8224 #define _SSPADD_MSK1 0x02
8225 #define _SSPADD_MSK2 0x04
8226 #define _SSPADD_MSK3 0x08
8227 #define _SSPADD_MSK4 0x10
8228 #define _SSPADD_MSK5 0x20
8229 #define _SSPADD_MSK6 0x40
8230 #define _SSPADD_MSK7 0x80
8232 //==============================================================================
8234 extern __at(0x0FC9) __sfr SSP1BUF;
8235 extern __at(0x0FC9) __sfr SSPBUF;
8237 //==============================================================================
8238 // T2CON Bits
8240 extern __at(0x0FCA) __sfr T2CON;
8242 typedef union
8244 struct
8246 unsigned T2CKPS0 : 1;
8247 unsigned T2CKPS1 : 1;
8248 unsigned TMR2ON : 1;
8249 unsigned T2OUTPS0 : 1;
8250 unsigned T2OUTPS1 : 1;
8251 unsigned T2OUTPS2 : 1;
8252 unsigned T2OUTPS3 : 1;
8253 unsigned : 1;
8256 struct
8258 unsigned T2CKPS : 2;
8259 unsigned : 6;
8262 struct
8264 unsigned : 3;
8265 unsigned T2OUTPS : 4;
8266 unsigned : 1;
8268 } __T2CONbits_t;
8270 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
8272 #define _T2CKPS0 0x01
8273 #define _T2CKPS1 0x02
8274 #define _TMR2ON 0x04
8275 #define _T2OUTPS0 0x08
8276 #define _T2OUTPS1 0x10
8277 #define _T2OUTPS2 0x20
8278 #define _T2OUTPS3 0x40
8280 //==============================================================================
8282 extern __at(0x0FCB) __sfr PR2;
8283 extern __at(0x0FCC) __sfr TMR2;
8285 //==============================================================================
8286 // T1CON Bits
8288 extern __at(0x0FCD) __sfr T1CON;
8290 typedef union
8292 struct
8294 unsigned TMR1ON : 1;
8295 unsigned RD16 : 1;
8296 unsigned NOT_T1SYNC : 1;
8297 unsigned SOSCEN : 1;
8298 unsigned T1CKPS0 : 1;
8299 unsigned T1CKPS1 : 1;
8300 unsigned TMR1CS0 : 1;
8301 unsigned TMR1CS1 : 1;
8304 struct
8306 unsigned : 4;
8307 unsigned T1CKPS : 2;
8308 unsigned : 2;
8311 struct
8313 unsigned : 6;
8314 unsigned TMR1CS : 2;
8316 } __T1CONbits_t;
8318 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
8320 #define _TMR1ON 0x01
8321 #define _RD16 0x02
8322 #define _NOT_T1SYNC 0x04
8323 #define _SOSCEN 0x08
8324 #define _T1CKPS0 0x10
8325 #define _T1CKPS1 0x20
8326 #define _TMR1CS0 0x40
8327 #define _TMR1CS1 0x80
8329 //==============================================================================
8331 extern __at(0x0FCE) __sfr TMR1;
8332 extern __at(0x0FCE) __sfr TMR1L;
8333 extern __at(0x0FCF) __sfr TMR1H;
8335 //==============================================================================
8336 // RCON Bits
8338 extern __at(0x0FD0) __sfr RCON;
8340 typedef union
8342 struct
8344 unsigned NOT_BOR : 1;
8345 unsigned NOT_POR : 1;
8346 unsigned NOT_PD : 1;
8347 unsigned NOT_TO : 1;
8348 unsigned NOT_RI : 1;
8349 unsigned NOT_CM : 1;
8350 unsigned SBOREN : 1;
8351 unsigned IPEN : 1;
8354 struct
8356 unsigned BOR : 1;
8357 unsigned POR : 1;
8358 unsigned PD : 1;
8359 unsigned TO : 1;
8360 unsigned RI : 1;
8361 unsigned CM : 1;
8362 unsigned : 1;
8363 unsigned : 1;
8365 } __RCONbits_t;
8367 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
8369 #define _NOT_BOR 0x01
8370 #define _BOR 0x01
8371 #define _NOT_POR 0x02
8372 #define _POR 0x02
8373 #define _NOT_PD 0x04
8374 #define _PD 0x04
8375 #define _NOT_TO 0x08
8376 #define _TO 0x08
8377 #define _NOT_RI 0x10
8378 #define _RI 0x10
8379 #define _NOT_CM 0x20
8380 #define _CM 0x20
8381 #define _SBOREN 0x40
8382 #define _IPEN 0x80
8384 //==============================================================================
8387 //==============================================================================
8388 // WDTCON Bits
8390 extern __at(0x0FD1) __sfr WDTCON;
8392 typedef union
8394 struct
8396 unsigned SWDTEN : 1;
8397 unsigned ULPSINK : 1;
8398 unsigned ULPEN : 1;
8399 unsigned : 1;
8400 unsigned SRETEN : 1;
8401 unsigned ULPLVL : 1;
8402 unsigned : 1;
8403 unsigned REGSLP : 1;
8406 struct
8408 unsigned SWDTE : 1;
8409 unsigned : 1;
8410 unsigned : 1;
8411 unsigned : 1;
8412 unsigned : 1;
8413 unsigned : 1;
8414 unsigned : 1;
8415 unsigned : 1;
8417 } __WDTCONbits_t;
8419 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
8421 #define _SWDTEN 0x01
8422 #define _SWDTE 0x01
8423 #define _ULPSINK 0x02
8424 #define _ULPEN 0x04
8425 #define _SRETEN 0x10
8426 #define _ULPLVL 0x20
8427 #define _REGSLP 0x80
8429 //==============================================================================
8432 //==============================================================================
8433 // IPR5 Bits
8435 extern __at(0x0FD2) __sfr IPR5;
8437 typedef struct
8439 unsigned TMR4IP : 1;
8440 unsigned TMR5IP : 1;
8441 unsigned TMR6IP : 1;
8442 unsigned TMR7IP : 1;
8443 unsigned TMR8IP : 1;
8444 unsigned TMR10IP : 1;
8445 unsigned TMR12IP : 1;
8446 unsigned TMR7GIP : 1;
8447 } __IPR5bits_t;
8449 extern __at(0x0FD2) volatile __IPR5bits_t IPR5bits;
8451 #define _TMR4IP 0x01
8452 #define _TMR5IP 0x02
8453 #define _TMR6IP 0x04
8454 #define _TMR7IP 0x08
8455 #define _TMR8IP 0x10
8456 #define _TMR10IP 0x20
8457 #define _TMR12IP 0x40
8458 #define _TMR7GIP 0x80
8460 //==============================================================================
8463 //==============================================================================
8464 // OSCCON Bits
8466 extern __at(0x0FD3) __sfr OSCCON;
8468 typedef union
8470 struct
8472 unsigned SCS0 : 1;
8473 unsigned SCS1 : 1;
8474 unsigned HFIOFS : 1;
8475 unsigned OSTS : 1;
8476 unsigned IRCF0 : 1;
8477 unsigned IRCF1 : 1;
8478 unsigned IRCF2 : 1;
8479 unsigned IDLEN : 1;
8482 struct
8484 unsigned SCS : 2;
8485 unsigned : 6;
8488 struct
8490 unsigned : 4;
8491 unsigned IRCF : 3;
8492 unsigned : 1;
8494 } __OSCCONbits_t;
8496 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
8498 #define _SCS0 0x01
8499 #define _SCS1 0x02
8500 #define _HFIOFS 0x04
8501 #define _OSTS 0x08
8502 #define _IRCF0 0x10
8503 #define _IRCF1 0x20
8504 #define _IRCF2 0x40
8505 #define _IDLEN 0x80
8507 //==============================================================================
8509 extern __at(0x0FD4) __sfr SPBRGH1;
8511 //==============================================================================
8512 // T0CON Bits
8514 extern __at(0x0FD5) __sfr T0CON;
8516 typedef union
8518 struct
8520 unsigned T0PS0 : 1;
8521 unsigned T0PS1 : 1;
8522 unsigned T0PS2 : 1;
8523 unsigned PSA : 1;
8524 unsigned T0SE : 1;
8525 unsigned T0CS : 1;
8526 unsigned T08BIT : 1;
8527 unsigned TMR0ON : 1;
8530 struct
8532 unsigned T0PS : 3;
8533 unsigned : 5;
8535 } __T0CONbits_t;
8537 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
8539 #define _T0PS0 0x01
8540 #define _T0PS1 0x02
8541 #define _T0PS2 0x04
8542 #define _PSA 0x08
8543 #define _T0SE 0x10
8544 #define _T0CS 0x20
8545 #define _T08BIT 0x40
8546 #define _TMR0ON 0x80
8548 //==============================================================================
8550 extern __at(0x0FD6) __sfr TMR0;
8551 extern __at(0x0FD6) __sfr TMR0L;
8552 extern __at(0x0FD7) __sfr TMR0H;
8554 //==============================================================================
8555 // STATUS Bits
8557 extern __at(0x0FD8) __sfr STATUS;
8559 typedef struct
8561 unsigned C : 1;
8562 unsigned DC : 1;
8563 unsigned Z : 1;
8564 unsigned OV : 1;
8565 unsigned N : 1;
8566 unsigned : 1;
8567 unsigned : 1;
8568 unsigned : 1;
8569 } __STATUSbits_t;
8571 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
8573 #define _C 0x01
8574 #define _DC 0x02
8575 #define _Z 0x04
8576 #define _OV 0x08
8577 #define _N 0x10
8579 //==============================================================================
8581 extern __at(0x0FD9) __sfr FSR2L;
8582 extern __at(0x0FDA) __sfr FSR2H;
8583 extern __at(0x0FDB) __sfr PLUSW2;
8584 extern __at(0x0FDC) __sfr PREINC2;
8585 extern __at(0x0FDD) __sfr POSTDEC2;
8586 extern __at(0x0FDE) __sfr POSTINC2;
8587 extern __at(0x0FDF) __sfr INDF2;
8588 extern __at(0x0FE0) __sfr BSR;
8589 extern __at(0x0FE1) __sfr FSR1L;
8590 extern __at(0x0FE2) __sfr FSR1H;
8591 extern __at(0x0FE3) __sfr PLUSW1;
8592 extern __at(0x0FE4) __sfr PREINC1;
8593 extern __at(0x0FE5) __sfr POSTDEC1;
8594 extern __at(0x0FE6) __sfr POSTINC1;
8595 extern __at(0x0FE7) __sfr INDF1;
8596 extern __at(0x0FE8) __sfr WREG;
8597 extern __at(0x0FE9) __sfr FSR0L;
8598 extern __at(0x0FEA) __sfr FSR0H;
8599 extern __at(0x0FEB) __sfr PLUSW0;
8600 extern __at(0x0FEC) __sfr PREINC0;
8601 extern __at(0x0FED) __sfr POSTDEC0;
8602 extern __at(0x0FEE) __sfr POSTINC0;
8603 extern __at(0x0FEF) __sfr INDF0;
8605 //==============================================================================
8606 // INTCON3 Bits
8608 extern __at(0x0FF0) __sfr INTCON3;
8610 typedef union
8612 struct
8614 unsigned INT1IF : 1;
8615 unsigned INT2IF : 1;
8616 unsigned INT3IF : 1;
8617 unsigned INT1IE : 1;
8618 unsigned INT2IE : 1;
8619 unsigned INT3IE : 1;
8620 unsigned INT1IP : 1;
8621 unsigned INT2IP : 1;
8624 struct
8626 unsigned INT1F : 1;
8627 unsigned INT2F : 1;
8628 unsigned INT3F : 1;
8629 unsigned INT1E : 1;
8630 unsigned INT2E : 1;
8631 unsigned INT3E : 1;
8632 unsigned INT1P : 1;
8633 unsigned INT2P : 1;
8635 } __INTCON3bits_t;
8637 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
8639 #define _INT1IF 0x01
8640 #define _INT1F 0x01
8641 #define _INT2IF 0x02
8642 #define _INT2F 0x02
8643 #define _INT3IF 0x04
8644 #define _INT3F 0x04
8645 #define _INT1IE 0x08
8646 #define _INT1E 0x08
8647 #define _INT2IE 0x10
8648 #define _INT2E 0x10
8649 #define _INT3IE 0x20
8650 #define _INT3E 0x20
8651 #define _INT1IP 0x40
8652 #define _INT1P 0x40
8653 #define _INT2IP 0x80
8654 #define _INT2P 0x80
8656 //==============================================================================
8659 //==============================================================================
8660 // INTCON2 Bits
8662 extern __at(0x0FF1) __sfr INTCON2;
8664 typedef union
8666 struct
8668 unsigned RBIP : 1;
8669 unsigned INT3IP : 1;
8670 unsigned TMR0IP : 1;
8671 unsigned INTEDG3 : 1;
8672 unsigned INTEDG2 : 1;
8673 unsigned INTEDG1 : 1;
8674 unsigned INTEDG0 : 1;
8675 unsigned NOT_RBPU : 1;
8678 struct
8680 unsigned : 1;
8681 unsigned INT3P : 1;
8682 unsigned T0IP : 1;
8683 unsigned : 1;
8684 unsigned : 1;
8685 unsigned : 1;
8686 unsigned : 1;
8687 unsigned RBPU : 1;
8689 } __INTCON2bits_t;
8691 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
8693 #define _RBIP 0x01
8694 #define _INT3IP 0x02
8695 #define _INT3P 0x02
8696 #define _TMR0IP 0x04
8697 #define _T0IP 0x04
8698 #define _INTEDG3 0x08
8699 #define _INTEDG2 0x10
8700 #define _INTEDG1 0x20
8701 #define _INTEDG0 0x40
8702 #define _NOT_RBPU 0x80
8703 #define _RBPU 0x80
8705 //==============================================================================
8708 //==============================================================================
8709 // INTCON Bits
8711 extern __at(0x0FF2) __sfr INTCON;
8713 typedef union
8715 struct
8717 unsigned RBIF : 1;
8718 unsigned INT0IF : 1;
8719 unsigned TMR0IF : 1;
8720 unsigned RBIE : 1;
8721 unsigned INT0IE : 1;
8722 unsigned TMR0IE : 1;
8723 unsigned PEIE_GIEL : 1;
8724 unsigned GIE_GIEH : 1;
8727 struct
8729 unsigned : 1;
8730 unsigned INT0F : 1;
8731 unsigned T0IF : 1;
8732 unsigned : 1;
8733 unsigned INT0E : 1;
8734 unsigned T0IE : 1;
8735 unsigned PEIE : 1;
8736 unsigned GIE : 1;
8739 struct
8741 unsigned : 1;
8742 unsigned : 1;
8743 unsigned : 1;
8744 unsigned : 1;
8745 unsigned : 1;
8746 unsigned : 1;
8747 unsigned GIEL : 1;
8748 unsigned GIEH : 1;
8750 } __INTCONbits_t;
8752 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
8754 #define _RBIF 0x01
8755 #define _INT0IF 0x02
8756 #define _INT0F 0x02
8757 #define _TMR0IF 0x04
8758 #define _T0IF 0x04
8759 #define _RBIE 0x08
8760 #define _INT0IE 0x10
8761 #define _INT0E 0x10
8762 #define _TMR0IE 0x20
8763 #define _T0IE 0x20
8764 #define _PEIE_GIEL 0x40
8765 #define _PEIE 0x40
8766 #define _GIEL 0x40
8767 #define _GIE_GIEH 0x80
8768 #define _GIE 0x80
8769 #define _GIEH 0x80
8771 //==============================================================================
8773 extern __at(0x0FF3) __sfr PROD;
8774 extern __at(0x0FF3) __sfr PRODL;
8775 extern __at(0x0FF4) __sfr PRODH;
8776 extern __at(0x0FF5) __sfr TABLAT;
8777 extern __at(0x0FF6) __sfr TBLPTR;
8778 extern __at(0x0FF6) __sfr TBLPTRL;
8779 extern __at(0x0FF7) __sfr TBLPTRH;
8780 extern __at(0x0FF8) __sfr TBLPTRU;
8781 extern __at(0x0FF9) __sfr PC;
8782 extern __at(0x0FF9) __sfr PCL;
8783 extern __at(0x0FFA) __sfr PCLATH;
8784 extern __at(0x0FFB) __sfr PCLATU;
8786 //==============================================================================
8787 // STKPTR Bits
8789 extern __at(0x0FFC) __sfr STKPTR;
8791 typedef union
8793 struct
8795 unsigned SP0 : 1;
8796 unsigned SP1 : 1;
8797 unsigned SP2 : 1;
8798 unsigned SP3 : 1;
8799 unsigned SP4 : 1;
8800 unsigned : 1;
8801 unsigned STKUNF : 1;
8802 unsigned STKFUL : 1;
8805 struct
8807 unsigned : 1;
8808 unsigned : 1;
8809 unsigned : 1;
8810 unsigned : 1;
8811 unsigned : 1;
8812 unsigned : 1;
8813 unsigned : 1;
8814 unsigned STKOVF : 1;
8817 struct
8819 unsigned SP : 5;
8820 unsigned : 3;
8822 } __STKPTRbits_t;
8824 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
8826 #define _SP0 0x01
8827 #define _SP1 0x02
8828 #define _SP2 0x04
8829 #define _SP3 0x08
8830 #define _SP4 0x10
8831 #define _STKUNF 0x40
8832 #define _STKFUL 0x80
8833 #define _STKOVF 0x80
8835 //==============================================================================
8837 extern __at(0x0FFD) __sfr TOS;
8838 extern __at(0x0FFD) __sfr TOSL;
8839 extern __at(0x0FFE) __sfr TOSH;
8840 extern __at(0x0FFF) __sfr TOSU;
8842 //==============================================================================
8844 // Configuration Bits
8846 //==============================================================================
8848 #define __CONFIG1L 0x300000
8849 #define __CONFIG1H 0x300001
8850 #define __CONFIG2L 0x300002
8851 #define __CONFIG2H 0x300003
8852 #define __CONFIG3L 0x300004
8853 #define __CONFIG3H 0x300005
8854 #define __CONFIG4L 0x300006
8855 #define __CONFIG5L 0x300008
8856 #define __CONFIG5H 0x300009
8857 #define __CONFIG6L 0x30000A
8858 #define __CONFIG6H 0x30000B
8859 #define __CONFIG7L 0x30000C
8860 #define __CONFIG7H 0x30000D
8862 //----------------------------- CONFIG1L Options -------------------------------
8864 #define _RETEN_OFF_1L 0xFE // Disabled - Controlled by SRETEN bit.
8865 #define _RETEN_ON_1L 0xFF // Enabled.
8866 #define _INTOSCSEL_LOW_1L 0xFB // LF-INTOSC in Low-power mode during Sleep.
8867 #define _INTOSCSEL_HIGH_1L 0xFF // LF-INTOSC in High-power mode during Sleep.
8868 #define _SOSCSEL_LOW_1L 0xEF // Low Power SOSC circuit selected.
8869 #define _SOSCSEL_DIG_1L 0xF7 // Digital (SCLKI) mode.
8870 #define _SOSCSEL_HIGH_1L 0xFF // High Power SOSC circuit selected.
8871 #define _XINST_OFF_1L 0xBF // Disabled.
8872 #define _XINST_ON_1L 0xFF // Enabled.
8874 //----------------------------- CONFIG1H Options -------------------------------
8876 #define _FOSC_LP_1H 0xF0 // LP oscillator.
8877 #define _FOSC_XT_1H 0xF1 // XT oscillator.
8878 #define _FOSC_HS2_1H 0xF2 // HS oscillator (High power, 16 MHz - 25 MHz).
8879 #define _FOSC_HS1_1H 0xF3 // HS oscillator (Medium power, 4 MHz - 16 MHz).
8880 #define _FOSC_EC3IO_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (High power, 16 MHz - 64 MHz).
8881 #define _FOSC_EC3_1H 0xF5 // EC oscillator (High power, 16 MHz - 64 MHz).
8882 #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
8883 #define _FOSC_RCIO_1H 0xF7 // External RC oscillator.
8884 #define _FOSC_INTIO2_1H 0xF8 // Internal RC oscillator.
8885 #define _FOSC_INTIO1_1H 0xF9 // Internal RC oscillator, CLKOUT function on OSC2.
8886 #define _FOSC_EC2IO_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (Medium power, 160 kHz - 16 MHz).
8887 #define _FOSC_EC2_1H 0xFB // EC oscillator (Medium power, 160 kHz - 16 MHz).
8888 #define _FOSC_EC1IO_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (Low power, DC - 160 kHz).
8889 #define _FOSC_EC1_1H 0xFD // EC oscillator (Low power, DC - 160 kHz).
8890 #define _PLLCFG_OFF_1H 0xEF // Disabled.
8891 #define _PLLCFG_ON_1H 0xFF // Enabled.
8892 #define _FCMEN_OFF_1H 0xBF // Disabled.
8893 #define _FCMEN_ON_1H 0xFF // Enabled.
8894 #define _IESO_OFF_1H 0x7F // Disabled.
8895 #define _IESO_ON_1H 0xFF // Enabled.
8897 //----------------------------- CONFIG2L Options -------------------------------
8899 #define _PWRTEN_ON_2L 0xFE // Enabled.
8900 #define _PWRTEN_OFF_2L 0xFF // Disabled.
8901 #define _BOREN_OFF_2L 0xF9 // Disabled in hardware, SBOREN disabled.
8902 #define _BOREN_ON_2L 0xFB // Controlled with SBOREN bit.
8903 #define _BOREN_NOSLP_2L 0xFD // Enabled while active, disabled in SLEEP, SBOREN disabled.
8904 #define _BOREN_SBORDIS_2L 0xFF // Enabled in hardware, SBOREN disabled.
8905 #define _BORV_0_2L 0xE7 // 3.0V.
8906 #define _BORV_1_2L 0xEF // 2.7V.
8907 #define _BORV_2_2L 0xF7 // 2.0V.
8908 #define _BORV_3_2L 0xFF // 1.8V.
8909 #define _BORPWR_LOW_2L 0x9F // BORMV set to low power level.
8910 #define _BORPWR_MEDIUM_2L 0xBF // BORMV set to medium power level.
8911 #define _BORPWR_HIGH_2L 0xDF // BORMV set to high power level.
8912 #define _BORPWR_ZPBORMV_2L 0xFF // ZPBORMV instead of BORMV is selected.
8914 //----------------------------- CONFIG2H Options -------------------------------
8916 #define _WDTEN_OFF_2H 0xFC // WDT disabled in hardware; SWDTEN bit disabled.
8917 #define _WDTEN_NOSLP_2H 0xFD // WDT enabled only while device is active and disabled in Sleep mode; SWDTEN bit disabled.
8918 #define _WDTEN_ON_2H 0xFE // WDT controlled by SWDTEN bit setting.
8919 #define _WDTEN_SWDTDIS_2H 0xFF // WDT enabled in hardware; SWDTEN bit disabled.
8920 #define _WDTPS_1_2H 0x83 // 1:1.
8921 #define _WDTPS_2_2H 0x87 // 1:2.
8922 #define _WDTPS_4_2H 0x8B // 1:4.
8923 #define _WDTPS_8_2H 0x8F // 1:8.
8924 #define _WDTPS_16_2H 0x93 // 1:16.
8925 #define _WDTPS_32_2H 0x97 // 1:32.
8926 #define _WDTPS_64_2H 0x9B // 1:64.
8927 #define _WDTPS_128_2H 0x9F // 1:128.
8928 #define _WDTPS_256_2H 0xA3 // 1:256.
8929 #define _WDTPS_512_2H 0xA7 // 1:512.
8930 #define _WDTPS_1024_2H 0xAB // 1:1024.
8931 #define _WDTPS_2048_2H 0xAF // 1:2048.
8932 #define _WDTPS_4096_2H 0xB3 // 1:4096.
8933 #define _WDTPS_8192_2H 0xB7 // 1:8192.
8934 #define _WDTPS_16384_2H 0xBB // 1:16384.
8935 #define _WDTPS_32768_2H 0xBF // 1:32768.
8936 #define _WDTPS_65536_2H 0xC3 // 1:65536.
8937 #define _WDTPS_131072_2H 0xC7 // 1:131072.
8938 #define _WDTPS_262144_2H 0xCB // 1:262144.
8939 #define _WDTPS_524288_2H 0xCF // 1:524288.
8940 #define _WDTPS_1048576_2H 0xFF // 1:1048576.
8942 //----------------------------- CONFIG3L Options -------------------------------
8944 #define _RTCOSC_INTOSCREF_3L 0xFE // RTCC uses INTRC.
8945 #define _RTCOSC_SOSCREF_3L 0xFF // RTCC uses SOSC.
8947 //----------------------------- CONFIG3H Options -------------------------------
8949 #define _CCP2MX_PORTBE_3H 0xFE // RE7-Microcontroller Mode/RB3-All other modes.
8950 #define _CCP2MX_PORTC_3H 0xFF // RC1.
8951 #define _ECCPMX_PORTH_3H 0xFD // Enhanced CCP1/3 [P1B/P1C/P3B/P3C] muxed with RH7/RH6/RH5/RH4.
8952 #define _ECCPMX_PORTE_3H 0xFF // Enhanced CCP1/3 [P1B/P1C/P3B/P3C] muxed with RE6/RE5/RE4/RE3.
8953 #define _MSSPMSK_MSK5_3H 0xF7 // 5 bit address masking mode.
8954 #define _MSSPMSK_MSK7_3H 0xFF // 7 Bit address masking mode.
8955 #define _MCLRE_OFF_3H 0x7F // MCLR Disabled, RG5 Enabled.
8956 #define _MCLRE_ON_3H 0xFF // MCLR Enabled, RG5 Disabled.
8958 //----------------------------- CONFIG4L Options -------------------------------
8960 #define _STVREN_OFF_4L 0xFE // Disabled.
8961 #define _STVREN_ON_4L 0xFF // Enabled.
8962 #define _BBSIZ_BB1K_4L 0xEF // 1K word Boot Block size.
8963 #define _BBSIZ_BB2K_4L 0xFF // 2K word Boot Block size.
8964 #define _DEBUG_ON_4L 0x7F // Enabled.
8965 #define _DEBUG_OFF_4L 0xFF // Disabled.
8967 //----------------------------- CONFIG5L Options -------------------------------
8969 #define _CP0_ON_5L 0xFE // Enabled.
8970 #define _CP0_OFF_5L 0xFF // Disabled.
8971 #define _CP1_ON_5L 0xFD // Enabled.
8972 #define _CP1_OFF_5L 0xFF // Disabled.
8973 #define _CP2_ON_5L 0xFB // Enabled.
8974 #define _CP2_OFF_5L 0xFF // Disabled.
8975 #define _CP3_ON_5L 0xF7 // Enabled.
8976 #define _CP3_OFF_5L 0xFF // Disabled.
8977 #define _CP4_ON_5L 0xEF // Enabled.
8978 #define _CP4_OFF_5L 0xFF // Disabled.
8979 #define _CP5_ON_5L 0xDF // Enabled.
8980 #define _CP5_OFF_5L 0xFF // Disabled.
8981 #define _CP6_ON_5L 0xBF // Enabled.
8982 #define _CP6_OFF_5L 0xFF // Disabled.
8983 #define _CP7_ON_5L 0x7F // Enabled.
8984 #define _CP7_OFF_5L 0xFF // Disabled.
8986 //----------------------------- CONFIG5H Options -------------------------------
8988 #define _CPB_ON_5H 0xBF // Enabled.
8989 #define _CPB_OFF_5H 0xFF // Disabled.
8990 #define _CPD_ON_5H 0x7F // Enabled.
8991 #define _CPD_OFF_5H 0xFF // Disabled.
8993 //----------------------------- CONFIG6L Options -------------------------------
8995 #define _WRT0_ON_6L 0xFE // Enabled.
8996 #define _WRT0_OFF_6L 0xFF // Disabled.
8997 #define _WRT1_ON_6L 0xFD // Enabled.
8998 #define _WRT1_OFF_6L 0xFF // Disabled.
8999 #define _WRT2_ON_6L 0xFB // Enabled.
9000 #define _WRT2_OFF_6L 0xFF // Disabled.
9001 #define _WRT3_ON_6L 0xF7 // Enabled.
9002 #define _WRT3_OFF_6L 0xFF // Disabled.
9003 #define _WRT4_ON_6L 0xEF // Enabled.
9004 #define _WRT4_OFF_6L 0xFF // Disabled.
9005 #define _WRT5_ON_6L 0xDF // Enabled.
9006 #define _WRT5_OFF_6L 0xFF // Disabled.
9007 #define _WRT6_ON_6L 0xBF // Enabled.
9008 #define _WRT6_OFF_6L 0xFF // Disabled.
9009 #define _WRT7_ON_6L 0x7F // Enabled.
9010 #define _WRT7_OFF_6L 0xFF // Disabled.
9012 //----------------------------- CONFIG6H Options -------------------------------
9014 #define _WRTC_ON_6H 0xDF // Enabled.
9015 #define _WRTC_OFF_6H 0xFF // Disabled.
9016 #define _WRTB_ON_6H 0xBF // Enabled.
9017 #define _WRTB_OFF_6H 0xFF // Disabled.
9018 #define _WRTD_ON_6H 0x7F // Enabled.
9019 #define _WRTD_OFF_6H 0xFF // Disabled.
9021 //----------------------------- CONFIG7L Options -------------------------------
9023 #define _EBRT0_ON_7L 0xFE // Enabled.
9024 #define _EBRT0_OFF_7L 0xFF // Disabled.
9025 #define _EBRT1_ON_7L 0xFD // Enabled.
9026 #define _EBRT1_OFF_7L 0xFF // Disabled.
9027 #define _EBRT2_ON_7L 0xFB // Enabled.
9028 #define _EBRT2_OFF_7L 0xFF // Disabled.
9029 #define _EBRT3_ON_7L 0xF7 // Enabled.
9030 #define _EBRT3_OFF_7L 0xFF // Disabled.
9031 #define _EBRT4_ON_7L 0xEF // Enabled.
9032 #define _EBRT4_OFF_7L 0xFF // Disabled.
9033 #define _EBRT5_ON_7L 0xDF // Enabled.
9034 #define _EBRT5_OFF_7L 0xFF // Disabled.
9035 #define _EBRT6_ON_7L 0xBF // Enabled.
9036 #define _EBRT6_OFF_7L 0xFF // Disabled.
9037 #define _EBRT7_ON_7L 0x7F // Enabled.
9038 #define _EBRT7_OFF_7L 0xFF // Disabled.
9040 //----------------------------- CONFIG7H Options -------------------------------
9042 #define _EBRTB_ON_7H 0xBF // Enabled.
9043 #define _EBRTB_OFF_7H 0xFF // Disabled.
9045 //==============================================================================
9047 #define __DEVID1 0x3FFFFE
9048 #define __DEVID2 0x3FFFFF
9050 #define __IDLOC0 0x200000
9051 #define __IDLOC1 0x200001
9052 #define __IDLOC2 0x200002
9053 #define __IDLOC3 0x200003
9054 #define __IDLOC4 0x200004
9055 #define __IDLOC5 0x200005
9056 #define __IDLOC6 0x200006
9057 #define __IDLOC7 0x200007
9059 #endif // #ifndef __PIC18F87K90_H__