struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f65k90.h
blob8afae70610e713f657c7a003f40620cdc1daceb8
1 /*
2 * This declarations of the PIC18F65K90 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:33 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 __PIC18F65K90_H__
26 #define __PIC18F65K90_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 : 1;
256 unsigned : 1;
257 unsigned : 1;
258 unsigned : 1;
259 unsigned : 1;
260 unsigned : 1;
261 unsigned : 1;
262 } __LCDSE4bits_t;
264 extern __at(0x0EFA) volatile __LCDSE4bits_t LCDSE4bits;
266 #define _SE32 0x01
268 //==============================================================================
271 //==============================================================================
272 // LCDRL Bits
274 extern __at(0x0EFC) __sfr LCDRL;
276 typedef union
278 struct
280 unsigned LRLAT0 : 1;
281 unsigned LRLAT1 : 1;
282 unsigned LRLAT2 : 1;
283 unsigned LCDIRI : 1;
284 unsigned LRLBP0 : 1;
285 unsigned LRLBP1 : 1;
286 unsigned LRLAP0 : 1;
287 unsigned LRLAP1 : 1;
290 struct
292 unsigned LRLAT : 3;
293 unsigned : 5;
296 struct
298 unsigned : 4;
299 unsigned LRLBP : 2;
300 unsigned : 2;
303 struct
305 unsigned : 6;
306 unsigned LRLAP : 2;
308 } __LCDRLbits_t;
310 extern __at(0x0EFC) volatile __LCDRLbits_t LCDRLbits;
312 #define _LRLAT0 0x01
313 #define _LRLAT1 0x02
314 #define _LRLAT2 0x04
315 #define _LCDIRI 0x08
316 #define _LRLBP0 0x10
317 #define _LRLBP1 0x20
318 #define _LRLAP0 0x40
319 #define _LRLAP1 0x80
321 //==============================================================================
324 //==============================================================================
325 // LCDREF Bits
327 extern __at(0x0EFD) __sfr LCDREF;
329 typedef union
331 struct
333 unsigned VLCD1PE : 1;
334 unsigned VLCD2PE : 1;
335 unsigned VLCD3PE : 1;
336 unsigned LCDCST0 : 1;
337 unsigned LCDCST1 : 1;
338 unsigned LCDCST2 : 1;
339 unsigned LCDIRS : 1;
340 unsigned LCDIRE : 1;
343 struct
345 unsigned : 3;
346 unsigned LCDCST : 3;
347 unsigned : 2;
349 } __LCDREFbits_t;
351 extern __at(0x0EFD) volatile __LCDREFbits_t LCDREFbits;
353 #define _VLCD1PE 0x01
354 #define _VLCD2PE 0x02
355 #define _VLCD3PE 0x04
356 #define _LCDCST0 0x08
357 #define _LCDCST1 0x10
358 #define _LCDCST2 0x20
359 #define _LCDIRS 0x40
360 #define _LCDIRE 0x80
362 //==============================================================================
365 //==============================================================================
366 // SSP2CON2 Bits
368 extern __at(0x0EFE) __sfr SSP2CON2;
370 typedef union
372 struct
374 unsigned SEN : 1;
375 unsigned RSEN : 1;
376 unsigned PEN : 1;
377 unsigned RCEN : 1;
378 unsigned ACKEN : 1;
379 unsigned ACKDT : 1;
380 unsigned ACKSTAT : 1;
381 unsigned GCEN : 1;
384 struct
386 unsigned : 1;
387 unsigned ADMSK1 : 1;
388 unsigned ADMSK2 : 1;
389 unsigned ADMSK3 : 1;
390 unsigned ADMSK4 : 1;
391 unsigned ADMSK5 : 1;
392 unsigned : 1;
393 unsigned : 1;
395 } __SSP2CON2bits_t;
397 extern __at(0x0EFE) volatile __SSP2CON2bits_t SSP2CON2bits;
399 #define _SSP2CON2_SEN 0x01
400 #define _SSP2CON2_RSEN 0x02
401 #define _SSP2CON2_ADMSK1 0x02
402 #define _SSP2CON2_PEN 0x04
403 #define _SSP2CON2_ADMSK2 0x04
404 #define _SSP2CON2_RCEN 0x08
405 #define _SSP2CON2_ADMSK3 0x08
406 #define _SSP2CON2_ACKEN 0x10
407 #define _SSP2CON2_ADMSK4 0x10
408 #define _SSP2CON2_ACKDT 0x20
409 #define _SSP2CON2_ADMSK5 0x20
410 #define _SSP2CON2_ACKSTAT 0x40
411 #define _SSP2CON2_GCEN 0x80
413 //==============================================================================
416 //==============================================================================
417 // SSP2CON1 Bits
419 extern __at(0x0EFF) __sfr SSP2CON1;
421 typedef union
423 struct
425 unsigned SSPM0 : 1;
426 unsigned SSPM1 : 1;
427 unsigned SSPM2 : 1;
428 unsigned SSPM3 : 1;
429 unsigned CKP : 1;
430 unsigned SSPEN : 1;
431 unsigned SSPOV : 1;
432 unsigned WCOL : 1;
435 struct
437 unsigned SSPM : 4;
438 unsigned : 4;
440 } __SSP2CON1bits_t;
442 extern __at(0x0EFF) volatile __SSP2CON1bits_t SSP2CON1bits;
444 #define _SSP2CON1_SSPM0 0x01
445 #define _SSP2CON1_SSPM1 0x02
446 #define _SSP2CON1_SSPM2 0x04
447 #define _SSP2CON1_SSPM3 0x08
448 #define _SSP2CON1_CKP 0x10
449 #define _SSP2CON1_SSPEN 0x20
450 #define _SSP2CON1_SSPOV 0x40
451 #define _SSP2CON1_WCOL 0x80
453 //==============================================================================
456 //==============================================================================
457 // SSP2STAT Bits
459 extern __at(0x0F00) __sfr SSP2STAT;
461 typedef union
463 struct
465 unsigned BF : 1;
466 unsigned UA : 1;
467 unsigned R_NOT_W : 1;
468 unsigned S : 1;
469 unsigned P : 1;
470 unsigned D_NOT_A : 1;
471 unsigned CKE : 1;
472 unsigned SMP : 1;
475 struct
477 unsigned : 1;
478 unsigned : 1;
479 unsigned R : 1;
480 unsigned I2C_START : 1;
481 unsigned I2C_STOP : 1;
482 unsigned D : 1;
483 unsigned : 1;
484 unsigned : 1;
487 struct
489 unsigned : 1;
490 unsigned : 1;
491 unsigned R_W : 1;
492 unsigned : 1;
493 unsigned : 1;
494 unsigned D_A : 1;
495 unsigned : 1;
496 unsigned : 1;
499 struct
501 unsigned : 1;
502 unsigned : 1;
503 unsigned NOT_W : 1;
504 unsigned : 1;
505 unsigned : 1;
506 unsigned NOT_A : 1;
507 unsigned : 1;
508 unsigned : 1;
511 struct
513 unsigned : 1;
514 unsigned : 1;
515 unsigned NOT_WRITE : 1;
516 unsigned : 1;
517 unsigned : 1;
518 unsigned NOT_ADDRESS : 1;
519 unsigned : 1;
520 unsigned : 1;
523 struct
525 unsigned : 1;
526 unsigned : 1;
527 unsigned READ_WRITE : 1;
528 unsigned : 1;
529 unsigned : 1;
530 unsigned DATA_ADDRESS : 1;
531 unsigned : 1;
532 unsigned : 1;
535 struct
537 unsigned : 1;
538 unsigned : 1;
539 unsigned I2C_READ : 1;
540 unsigned : 1;
541 unsigned : 1;
542 unsigned I2C_DAT : 1;
543 unsigned : 1;
544 unsigned : 1;
546 } __SSP2STATbits_t;
548 extern __at(0x0F00) volatile __SSP2STATbits_t SSP2STATbits;
550 #define _SSP2STAT_BF 0x01
551 #define _SSP2STAT_UA 0x02
552 #define _SSP2STAT_R_NOT_W 0x04
553 #define _SSP2STAT_R 0x04
554 #define _SSP2STAT_R_W 0x04
555 #define _SSP2STAT_NOT_W 0x04
556 #define _SSP2STAT_NOT_WRITE 0x04
557 #define _SSP2STAT_READ_WRITE 0x04
558 #define _SSP2STAT_I2C_READ 0x04
559 #define _SSP2STAT_S 0x08
560 #define _SSP2STAT_I2C_START 0x08
561 #define _SSP2STAT_P 0x10
562 #define _SSP2STAT_I2C_STOP 0x10
563 #define _SSP2STAT_D_NOT_A 0x20
564 #define _SSP2STAT_D 0x20
565 #define _SSP2STAT_D_A 0x20
566 #define _SSP2STAT_NOT_A 0x20
567 #define _SSP2STAT_NOT_ADDRESS 0x20
568 #define _SSP2STAT_DATA_ADDRESS 0x20
569 #define _SSP2STAT_I2C_DAT 0x20
570 #define _SSP2STAT_CKE 0x40
571 #define _SSP2STAT_SMP 0x80
573 //==============================================================================
576 //==============================================================================
577 // SSP2ADD Bits
579 extern __at(0x0F01) __sfr SSP2ADD;
581 typedef struct
583 unsigned MSK0 : 1;
584 unsigned MSK1 : 1;
585 unsigned MSK2 : 1;
586 unsigned MSK3 : 1;
587 unsigned MSK4 : 1;
588 unsigned MSK5 : 1;
589 unsigned MSK6 : 1;
590 unsigned MSK7 : 1;
591 } __SSP2ADDbits_t;
593 extern __at(0x0F01) volatile __SSP2ADDbits_t SSP2ADDbits;
595 #define _SSP2ADD_MSK0 0x01
596 #define _SSP2ADD_MSK1 0x02
597 #define _SSP2ADD_MSK2 0x04
598 #define _SSP2ADD_MSK3 0x08
599 #define _SSP2ADD_MSK4 0x10
600 #define _SSP2ADD_MSK5 0x20
601 #define _SSP2ADD_MSK6 0x40
602 #define _SSP2ADD_MSK7 0x80
604 //==============================================================================
606 extern __at(0x0F02) __sfr SSP2BUF;
608 //==============================================================================
609 // T4CON Bits
611 extern __at(0x0F03) __sfr T4CON;
613 typedef union
615 struct
617 unsigned T4CKPS0 : 1;
618 unsigned T4CKPS1 : 1;
619 unsigned TMR4ON : 1;
620 unsigned T4OUTPS0 : 1;
621 unsigned T4OUTPS1 : 1;
622 unsigned T4OUTPS2 : 1;
623 unsigned T4OUTPS3 : 1;
624 unsigned : 1;
627 struct
629 unsigned T4CKPS : 2;
630 unsigned : 6;
633 struct
635 unsigned : 3;
636 unsigned T4OUTPS : 4;
637 unsigned : 1;
639 } __T4CONbits_t;
641 extern __at(0x0F03) volatile __T4CONbits_t T4CONbits;
643 #define _T4CKPS0 0x01
644 #define _T4CKPS1 0x02
645 #define _TMR4ON 0x04
646 #define _T4OUTPS0 0x08
647 #define _T4OUTPS1 0x10
648 #define _T4OUTPS2 0x20
649 #define _T4OUTPS3 0x40
651 //==============================================================================
653 extern __at(0x0F04) __sfr PR4;
654 extern __at(0x0F05) __sfr TMR4;
656 //==============================================================================
657 // CCP7CON Bits
659 extern __at(0x0F06) __sfr CCP7CON;
661 typedef union
663 struct
665 unsigned CCP7M0 : 1;
666 unsigned CCP7M1 : 1;
667 unsigned CCP7M2 : 1;
668 unsigned CCP7M3 : 1;
669 unsigned DC7B0 : 1;
670 unsigned DC7B1 : 1;
671 unsigned : 1;
672 unsigned : 1;
675 struct
677 unsigned : 1;
678 unsigned : 1;
679 unsigned : 1;
680 unsigned : 1;
681 unsigned CCP7Y : 1;
682 unsigned CCP7X : 1;
683 unsigned : 1;
684 unsigned : 1;
687 struct
689 unsigned CCP7M : 4;
690 unsigned : 4;
693 struct
695 unsigned : 4;
696 unsigned DC7B : 2;
697 unsigned : 2;
699 } __CCP7CONbits_t;
701 extern __at(0x0F06) volatile __CCP7CONbits_t CCP7CONbits;
703 #define _CCP7M0 0x01
704 #define _CCP7M1 0x02
705 #define _CCP7M2 0x04
706 #define _CCP7M3 0x08
707 #define _DC7B0 0x10
708 #define _CCP7Y 0x10
709 #define _DC7B1 0x20
710 #define _CCP7X 0x20
712 //==============================================================================
714 extern __at(0x0F07) __sfr CCPR7;
715 extern __at(0x0F07) __sfr CCPR7L;
716 extern __at(0x0F08) __sfr CCPR7H;
718 //==============================================================================
719 // CCP6CON Bits
721 extern __at(0x0F09) __sfr CCP6CON;
723 typedef union
725 struct
727 unsigned CCP6M0 : 1;
728 unsigned CCP6M1 : 1;
729 unsigned CCP6M2 : 1;
730 unsigned CCP6M3 : 1;
731 unsigned DC6B0 : 1;
732 unsigned DC6B1 : 1;
733 unsigned : 1;
734 unsigned : 1;
737 struct
739 unsigned : 1;
740 unsigned : 1;
741 unsigned : 1;
742 unsigned : 1;
743 unsigned CCP6Y : 1;
744 unsigned CCP6X : 1;
745 unsigned : 1;
746 unsigned : 1;
749 struct
751 unsigned CCP6M : 4;
752 unsigned : 4;
755 struct
757 unsigned : 4;
758 unsigned DC6B : 2;
759 unsigned : 2;
761 } __CCP6CONbits_t;
763 extern __at(0x0F09) volatile __CCP6CONbits_t CCP6CONbits;
765 #define _CCP6M0 0x01
766 #define _CCP6M1 0x02
767 #define _CCP6M2 0x04
768 #define _CCP6M3 0x08
769 #define _DC6B0 0x10
770 #define _CCP6Y 0x10
771 #define _DC6B1 0x20
772 #define _CCP6X 0x20
774 //==============================================================================
776 extern __at(0x0F0A) __sfr CCPR6;
777 extern __at(0x0F0A) __sfr CCPR6L;
778 extern __at(0x0F0B) __sfr CCPR6H;
780 //==============================================================================
781 // CCP5CON Bits
783 extern __at(0x0F0C) __sfr CCP5CON;
785 typedef union
787 struct
789 unsigned CCP5M0 : 1;
790 unsigned CCP5M1 : 1;
791 unsigned CCP5M2 : 1;
792 unsigned CCP5M3 : 1;
793 unsigned DC5B0 : 1;
794 unsigned DC5B1 : 1;
795 unsigned : 1;
796 unsigned : 1;
799 struct
801 unsigned : 1;
802 unsigned : 1;
803 unsigned : 1;
804 unsigned : 1;
805 unsigned CCP5Y : 1;
806 unsigned CCP5X : 1;
807 unsigned : 1;
808 unsigned : 1;
811 struct
813 unsigned CCP5M : 4;
814 unsigned : 4;
817 struct
819 unsigned : 4;
820 unsigned DC5B : 2;
821 unsigned : 2;
823 } __CCP5CONbits_t;
825 extern __at(0x0F0C) volatile __CCP5CONbits_t CCP5CONbits;
827 #define _CCP5M0 0x01
828 #define _CCP5M1 0x02
829 #define _CCP5M2 0x04
830 #define _CCP5M3 0x08
831 #define _DC5B0 0x10
832 #define _CCP5Y 0x10
833 #define _DC5B1 0x20
834 #define _CCP5X 0x20
836 //==============================================================================
838 extern __at(0x0F0D) __sfr CCPR5;
839 extern __at(0x0F0D) __sfr CCPR5L;
840 extern __at(0x0F0E) __sfr CCPR5H;
842 //==============================================================================
843 // CCP4CON Bits
845 extern __at(0x0F0F) __sfr CCP4CON;
847 typedef union
849 struct
851 unsigned CCP4M0 : 1;
852 unsigned CCP4M1 : 1;
853 unsigned CCP4M2 : 1;
854 unsigned CCP4M3 : 1;
855 unsigned DC4B0 : 1;
856 unsigned DC4B1 : 1;
857 unsigned : 1;
858 unsigned : 1;
861 struct
863 unsigned : 1;
864 unsigned : 1;
865 unsigned : 1;
866 unsigned : 1;
867 unsigned CCP4Y : 1;
868 unsigned CCP4X : 1;
869 unsigned : 1;
870 unsigned : 1;
873 struct
875 unsigned CCP4M : 4;
876 unsigned : 4;
879 struct
881 unsigned : 4;
882 unsigned DC4B : 2;
883 unsigned : 2;
885 } __CCP4CONbits_t;
887 extern __at(0x0F0F) volatile __CCP4CONbits_t CCP4CONbits;
889 #define _CCP4M0 0x01
890 #define _CCP4M1 0x02
891 #define _CCP4M2 0x04
892 #define _CCP4M3 0x08
893 #define _DC4B0 0x10
894 #define _CCP4Y 0x10
895 #define _DC4B1 0x20
896 #define _CCP4X 0x20
898 //==============================================================================
900 extern __at(0x0F10) __sfr CCPR4;
901 extern __at(0x0F10) __sfr CCPR4L;
902 extern __at(0x0F11) __sfr CCPR4H;
904 //==============================================================================
905 // T5GCON Bits
907 extern __at(0x0F12) __sfr T5GCON;
909 typedef union
911 struct
913 unsigned T5GSS0 : 1;
914 unsigned T5GSS1 : 1;
915 unsigned T5GVAL : 1;
916 unsigned T5GGO_NOT_T5DONE : 1;
917 unsigned T5GSPM : 1;
918 unsigned T5GTM : 1;
919 unsigned T5GPOL : 1;
920 unsigned TMR5GE : 1;
923 struct
925 unsigned : 1;
926 unsigned : 1;
927 unsigned : 1;
928 unsigned T5GGO : 1;
929 unsigned : 1;
930 unsigned : 1;
931 unsigned : 1;
932 unsigned : 1;
935 struct
937 unsigned : 1;
938 unsigned : 1;
939 unsigned : 1;
940 unsigned NOT_T5DONE : 1;
941 unsigned : 1;
942 unsigned : 1;
943 unsigned : 1;
944 unsigned : 1;
947 struct
949 unsigned T5GSS : 2;
950 unsigned : 6;
952 } __T5GCONbits_t;
954 extern __at(0x0F12) volatile __T5GCONbits_t T5GCONbits;
956 #define _T5GSS0 0x01
957 #define _T5GSS1 0x02
958 #define _T5GVAL 0x04
959 #define _T5GGO_NOT_T5DONE 0x08
960 #define _T5GGO 0x08
961 #define _NOT_T5DONE 0x08
962 #define _T5GSPM 0x10
963 #define _T5GTM 0x20
964 #define _T5GPOL 0x40
965 #define _TMR5GE 0x80
967 //==============================================================================
970 //==============================================================================
971 // T5CON Bits
973 extern __at(0x0F13) __sfr T5CON;
975 typedef union
977 struct
979 unsigned TMR5ON : 1;
980 unsigned RD16 : 1;
981 unsigned NOT_T5SYNC : 1;
982 unsigned SOSCEN : 1;
983 unsigned T5CKPS0 : 1;
984 unsigned T5CKPS1 : 1;
985 unsigned TMR5CS0 : 1;
986 unsigned TMR5CS1 : 1;
989 struct
991 unsigned : 4;
992 unsigned T5CKPS : 2;
993 unsigned : 2;
996 struct
998 unsigned : 6;
999 unsigned TMR5CS : 2;
1001 } __T5CONbits_t;
1003 extern __at(0x0F13) volatile __T5CONbits_t T5CONbits;
1005 #define _T5CON_TMR5ON 0x01
1006 #define _T5CON_RD16 0x02
1007 #define _T5CON_NOT_T5SYNC 0x04
1008 #define _T5CON_SOSCEN 0x08
1009 #define _T5CON_T5CKPS0 0x10
1010 #define _T5CON_T5CKPS1 0x20
1011 #define _T5CON_TMR5CS0 0x40
1012 #define _T5CON_TMR5CS1 0x80
1014 //==============================================================================
1016 extern __at(0x0F14) __sfr TMR5;
1017 extern __at(0x0F14) __sfr TMR5L;
1018 extern __at(0x0F15) __sfr TMR5H;
1020 //==============================================================================
1021 // PMD3 Bits
1023 extern __at(0x0F16) __sfr PMD3;
1025 typedef struct
1027 unsigned : 1;
1028 unsigned CCP4MD : 1;
1029 unsigned CCP5MD : 1;
1030 unsigned CCP6MD : 1;
1031 unsigned CCP7MD : 1;
1032 unsigned CCP8MD : 1;
1033 unsigned : 1;
1034 unsigned : 1;
1035 } __PMD3bits_t;
1037 extern __at(0x0F16) volatile __PMD3bits_t PMD3bits;
1039 #define _CCP4MD 0x02
1040 #define _CCP5MD 0x04
1041 #define _CCP6MD 0x08
1042 #define _CCP7MD 0x10
1043 #define _CCP8MD 0x20
1045 //==============================================================================
1048 //==============================================================================
1049 // PMD2 Bits
1051 extern __at(0x0F17) __sfr PMD2;
1053 typedef struct
1055 unsigned CMP1MD : 1;
1056 unsigned CMP2MD : 1;
1057 unsigned CMP3MD : 1;
1058 unsigned TMR5MD : 1;
1059 unsigned TMR6MD : 1;
1060 unsigned : 1;
1061 unsigned TMR8MD : 1;
1062 unsigned : 1;
1063 } __PMD2bits_t;
1065 extern __at(0x0F17) volatile __PMD2bits_t PMD2bits;
1067 #define _CMP1MD 0x01
1068 #define _CMP2MD 0x02
1069 #define _CMP3MD 0x04
1070 #define _TMR5MD 0x08
1071 #define _TMR6MD 0x10
1072 #define _TMR8MD 0x40
1074 //==============================================================================
1077 //==============================================================================
1078 // PMD1 Bits
1080 extern __at(0x0F18) __sfr PMD1;
1082 typedef struct
1084 unsigned : 1;
1085 unsigned TMR1MD : 1;
1086 unsigned TMR2MD : 1;
1087 unsigned TMR3MD : 1;
1088 unsigned TMR4MD : 1;
1089 unsigned RTCCMD : 1;
1090 unsigned CTMUMD : 1;
1091 unsigned : 1;
1092 } __PMD1bits_t;
1094 extern __at(0x0F18) volatile __PMD1bits_t PMD1bits;
1096 #define _TMR1MD 0x02
1097 #define _TMR2MD 0x04
1098 #define _TMR3MD 0x08
1099 #define _TMR4MD 0x10
1100 #define _RTCCMD 0x20
1101 #define _CTMUMD 0x40
1103 //==============================================================================
1106 //==============================================================================
1107 // PMD0 Bits
1109 extern __at(0x0F19) __sfr PMD0;
1111 typedef struct
1113 unsigned ADCMD : 1;
1114 unsigned SSP1MD : 1;
1115 unsigned SSP2MD : 1;
1116 unsigned UART1MD : 1;
1117 unsigned UART2MD : 1;
1118 unsigned CCP1MD : 1;
1119 unsigned CCP2MD : 1;
1120 unsigned CCP3MD : 1;
1121 } __PMD0bits_t;
1123 extern __at(0x0F19) volatile __PMD0bits_t PMD0bits;
1125 #define _ADCMD 0x01
1126 #define _SSP1MD 0x02
1127 #define _SSP2MD 0x04
1128 #define _UART1MD 0x08
1129 #define _UART2MD 0x10
1130 #define _CCP1MD 0x20
1131 #define _CCP2MD 0x40
1132 #define _CCP3MD 0x80
1134 //==============================================================================
1137 //==============================================================================
1138 // PSTR3CON Bits
1140 extern __at(0x0F1A) __sfr PSTR3CON;
1142 typedef union
1144 struct
1146 unsigned STRA : 1;
1147 unsigned STRB : 1;
1148 unsigned STRC : 1;
1149 unsigned STRD : 1;
1150 unsigned STRSYNC : 1;
1151 unsigned : 1;
1152 unsigned CMPL0 : 1;
1153 unsigned CMPL1 : 1;
1156 struct
1158 unsigned : 6;
1159 unsigned CMPL : 2;
1161 } __PSTR3CONbits_t;
1163 extern __at(0x0F1A) volatile __PSTR3CONbits_t PSTR3CONbits;
1165 #define _PSTR3CON_STRA 0x01
1166 #define _PSTR3CON_STRB 0x02
1167 #define _PSTR3CON_STRC 0x04
1168 #define _PSTR3CON_STRD 0x08
1169 #define _PSTR3CON_STRSYNC 0x10
1170 #define _PSTR3CON_CMPL0 0x40
1171 #define _PSTR3CON_CMPL1 0x80
1173 //==============================================================================
1176 //==============================================================================
1177 // PSTR2CON Bits
1179 extern __at(0x0F1B) __sfr PSTR2CON;
1181 typedef union
1183 struct
1185 unsigned STRA : 1;
1186 unsigned STRB : 1;
1187 unsigned STRC : 1;
1188 unsigned STRD : 1;
1189 unsigned STRSYNC : 1;
1190 unsigned : 1;
1191 unsigned CMPL0 : 1;
1192 unsigned CMPL1 : 1;
1195 struct
1197 unsigned : 6;
1198 unsigned CMPL : 2;
1200 } __PSTR2CONbits_t;
1202 extern __at(0x0F1B) volatile __PSTR2CONbits_t PSTR2CONbits;
1204 #define _PSTR2CON_STRA 0x01
1205 #define _PSTR2CON_STRB 0x02
1206 #define _PSTR2CON_STRC 0x04
1207 #define _PSTR2CON_STRD 0x08
1208 #define _PSTR2CON_STRSYNC 0x10
1209 #define _PSTR2CON_CMPL0 0x40
1210 #define _PSTR2CON_CMPL1 0x80
1212 //==============================================================================
1214 extern __at(0x0F1C) __sfr TXREG2;
1215 extern __at(0x0F1D) __sfr RCREG2;
1216 extern __at(0x0F1E) __sfr SPBRG2;
1217 extern __at(0x0F1F) __sfr SPBRGH2;
1219 //==============================================================================
1220 // BAUDCON2 Bits
1222 extern __at(0x0F20) __sfr BAUDCON2;
1224 typedef struct
1226 unsigned ABDEN : 1;
1227 unsigned WUE : 1;
1228 unsigned : 1;
1229 unsigned BRG16 : 1;
1230 unsigned TXCKP : 1;
1231 unsigned RXDTP : 1;
1232 unsigned RCIDL : 1;
1233 unsigned ABDOVF : 1;
1234 } __BAUDCON2bits_t;
1236 extern __at(0x0F20) volatile __BAUDCON2bits_t BAUDCON2bits;
1238 #define _BAUDCON2_ABDEN 0x01
1239 #define _BAUDCON2_WUE 0x02
1240 #define _BAUDCON2_BRG16 0x08
1241 #define _BAUDCON2_TXCKP 0x10
1242 #define _BAUDCON2_RXDTP 0x20
1243 #define _BAUDCON2_RCIDL 0x40
1244 #define _BAUDCON2_ABDOVF 0x80
1246 //==============================================================================
1249 //==============================================================================
1250 // TXSTA2 Bits
1252 extern __at(0x0F21) __sfr TXSTA2;
1254 typedef union
1256 struct
1258 unsigned TX9D : 1;
1259 unsigned TRMT : 1;
1260 unsigned BRGH : 1;
1261 unsigned SENDB : 1;
1262 unsigned SYNC : 1;
1263 unsigned TXEN : 1;
1264 unsigned TX9 : 1;
1265 unsigned CSRC : 1;
1268 struct
1270 unsigned TX9D2 : 1;
1271 unsigned TRMT2 : 1;
1272 unsigned BRGH2 : 1;
1273 unsigned SENDB2 : 1;
1274 unsigned SYNC2 : 1;
1275 unsigned TXEN2 : 1;
1276 unsigned TX92 : 1;
1277 unsigned CSRC2 : 1;
1279 } __TXSTA2bits_t;
1281 extern __at(0x0F21) volatile __TXSTA2bits_t TXSTA2bits;
1283 #define _TXSTA2_TX9D 0x01
1284 #define _TXSTA2_TX9D2 0x01
1285 #define _TXSTA2_TRMT 0x02
1286 #define _TXSTA2_TRMT2 0x02
1287 #define _TXSTA2_BRGH 0x04
1288 #define _TXSTA2_BRGH2 0x04
1289 #define _TXSTA2_SENDB 0x08
1290 #define _TXSTA2_SENDB2 0x08
1291 #define _TXSTA2_SYNC 0x10
1292 #define _TXSTA2_SYNC2 0x10
1293 #define _TXSTA2_TXEN 0x20
1294 #define _TXSTA2_TXEN2 0x20
1295 #define _TXSTA2_TX9 0x40
1296 #define _TXSTA2_TX92 0x40
1297 #define _TXSTA2_CSRC 0x80
1298 #define _TXSTA2_CSRC2 0x80
1300 //==============================================================================
1303 //==============================================================================
1304 // RCSTA2 Bits
1306 extern __at(0x0F22) __sfr RCSTA2;
1308 typedef union
1310 struct
1312 unsigned RX9D : 1;
1313 unsigned OERR : 1;
1314 unsigned FERR : 1;
1315 unsigned ADDEN : 1;
1316 unsigned CREN : 1;
1317 unsigned SREN : 1;
1318 unsigned RX9 : 1;
1319 unsigned SPEN : 1;
1322 struct
1324 unsigned RX9D2 : 1;
1325 unsigned OERR2 : 1;
1326 unsigned FERR2 : 1;
1327 unsigned ADDEN2 : 1;
1328 unsigned CREN2 : 1;
1329 unsigned SREN2 : 1;
1330 unsigned RX92 : 1;
1331 unsigned SPEN2 : 1;
1333 } __RCSTA2bits_t;
1335 extern __at(0x0F22) volatile __RCSTA2bits_t RCSTA2bits;
1337 #define _RCSTA2_RX9D 0x01
1338 #define _RCSTA2_RX9D2 0x01
1339 #define _RCSTA2_OERR 0x02
1340 #define _RCSTA2_OERR2 0x02
1341 #define _RCSTA2_FERR 0x04
1342 #define _RCSTA2_FERR2 0x04
1343 #define _RCSTA2_ADDEN 0x08
1344 #define _RCSTA2_ADDEN2 0x08
1345 #define _RCSTA2_CREN 0x10
1346 #define _RCSTA2_CREN2 0x10
1347 #define _RCSTA2_SREN 0x20
1348 #define _RCSTA2_SREN2 0x20
1349 #define _RCSTA2_RX9 0x40
1350 #define _RCSTA2_RX92 0x40
1351 #define _RCSTA2_SPEN 0x80
1352 #define _RCSTA2_SPEN2 0x80
1354 //==============================================================================
1357 //==============================================================================
1358 // ANCON2 Bits
1360 extern __at(0x0F23) __sfr ANCON2;
1362 typedef struct
1364 unsigned ANSEL16 : 1;
1365 unsigned ANSEL17 : 1;
1366 unsigned ANSEL18 : 1;
1367 unsigned ANSEL19 : 1;
1368 unsigned : 1;
1369 unsigned : 1;
1370 unsigned : 1;
1371 unsigned : 1;
1372 } __ANCON2bits_t;
1374 extern __at(0x0F23) volatile __ANCON2bits_t ANCON2bits;
1376 #define _ANSEL16 0x01
1377 #define _ANSEL17 0x02
1378 #define _ANSEL18 0x04
1379 #define _ANSEL19 0x08
1381 //==============================================================================
1384 //==============================================================================
1385 // ANCON1 Bits
1387 extern __at(0x0F24) __sfr ANCON1;
1389 typedef struct
1391 unsigned ANSEL8 : 1;
1392 unsigned ANSEL9 : 1;
1393 unsigned ANSEL10 : 1;
1394 unsigned ANSEL11 : 1;
1395 unsigned : 1;
1396 unsigned : 1;
1397 unsigned : 1;
1398 unsigned : 1;
1399 } __ANCON1bits_t;
1401 extern __at(0x0F24) volatile __ANCON1bits_t ANCON1bits;
1403 #define _ANSEL8 0x01
1404 #define _ANSEL9 0x02
1405 #define _ANSEL10 0x04
1406 #define _ANSEL11 0x08
1408 //==============================================================================
1411 //==============================================================================
1412 // ANCON0 Bits
1414 extern __at(0x0F25) __sfr ANCON0;
1416 typedef struct
1418 unsigned ANSEL0 : 1;
1419 unsigned ANSEL1 : 1;
1420 unsigned ANSEL2 : 1;
1421 unsigned ANSEL3 : 1;
1422 unsigned ANSEL4 : 1;
1423 unsigned ANSEL5 : 1;
1424 unsigned ANSEL6 : 1;
1425 unsigned ANSEL7 : 1;
1426 } __ANCON0bits_t;
1428 extern __at(0x0F25) volatile __ANCON0bits_t ANCON0bits;
1430 #define _ANSEL0 0x01
1431 #define _ANSEL1 0x02
1432 #define _ANSEL2 0x04
1433 #define _ANSEL3 0x08
1434 #define _ANSEL4 0x10
1435 #define _ANSEL5 0x20
1436 #define _ANSEL6 0x40
1437 #define _ANSEL7 0x80
1439 //==============================================================================
1442 //==============================================================================
1443 // ODCON3 Bits
1445 extern __at(0x0F27) __sfr ODCON3;
1447 typedef struct
1449 unsigned CTMUDS : 1;
1450 unsigned : 1;
1451 unsigned : 1;
1452 unsigned : 1;
1453 unsigned : 1;
1454 unsigned : 1;
1455 unsigned U1OD : 1;
1456 unsigned U2OD : 1;
1457 } __ODCON3bits_t;
1459 extern __at(0x0F27) volatile __ODCON3bits_t ODCON3bits;
1461 #define _CTMUDS 0x01
1462 #define _U1OD 0x40
1463 #define _U2OD 0x80
1465 //==============================================================================
1468 //==============================================================================
1469 // ODCON2 Bits
1471 extern __at(0x0F28) __sfr ODCON2;
1473 typedef struct
1475 unsigned CCP3OD : 1;
1476 unsigned CCP4OD : 1;
1477 unsigned CCP5OD : 1;
1478 unsigned CCP6OD : 1;
1479 unsigned CCP7OD : 1;
1480 unsigned CCP8OD : 1;
1481 unsigned : 1;
1482 unsigned : 1;
1483 } __ODCON2bits_t;
1485 extern __at(0x0F28) volatile __ODCON2bits_t ODCON2bits;
1487 #define _CCP3OD 0x01
1488 #define _CCP4OD 0x02
1489 #define _CCP5OD 0x04
1490 #define _CCP6OD 0x08
1491 #define _CCP7OD 0x10
1492 #define _CCP8OD 0x20
1494 //==============================================================================
1497 //==============================================================================
1498 // ODCON1 Bits
1500 extern __at(0x0F29) __sfr ODCON1;
1502 typedef struct
1504 unsigned SPI2OD : 1;
1505 unsigned : 1;
1506 unsigned : 1;
1507 unsigned : 1;
1508 unsigned : 1;
1509 unsigned CCP1OD : 1;
1510 unsigned CCP2OD : 1;
1511 unsigned SPI1OD : 1;
1512 } __ODCON1bits_t;
1514 extern __at(0x0F29) volatile __ODCON1bits_t ODCON1bits;
1516 #define _SPI2OD 0x01
1517 #define _CCP1OD 0x20
1518 #define _CCP2OD 0x40
1519 #define _SPI1OD 0x80
1521 //==============================================================================
1524 //==============================================================================
1525 // REFOCON Bits
1527 extern __at(0x0F2A) __sfr REFOCON;
1529 typedef union
1531 struct
1533 unsigned RODIV0 : 1;
1534 unsigned RODIV1 : 1;
1535 unsigned RODIV2 : 1;
1536 unsigned RODIV3 : 1;
1537 unsigned ROSEL : 1;
1538 unsigned ROSSLP : 1;
1539 unsigned : 1;
1540 unsigned ROON : 1;
1543 struct
1545 unsigned RODIV : 4;
1546 unsigned : 4;
1548 } __REFOCONbits_t;
1550 extern __at(0x0F2A) volatile __REFOCONbits_t REFOCONbits;
1552 #define _RODIV0 0x01
1553 #define _RODIV1 0x02
1554 #define _RODIV2 0x04
1555 #define _RODIV3 0x08
1556 #define _ROSEL 0x10
1557 #define _ROSSLP 0x20
1558 #define _ROON 0x80
1560 //==============================================================================
1563 //==============================================================================
1564 // CCPTMRS2 Bits
1566 extern __at(0x0F2B) __sfr CCPTMRS2;
1568 typedef union
1570 struct
1572 unsigned C8TSEL0 : 1;
1573 unsigned C8TSEL1 : 1;
1574 unsigned : 1;
1575 unsigned : 1;
1576 unsigned : 1;
1577 unsigned : 1;
1578 unsigned : 1;
1579 unsigned : 1;
1582 struct
1584 unsigned C8TSEL : 2;
1585 unsigned : 6;
1587 } __CCPTMRS2bits_t;
1589 extern __at(0x0F2B) volatile __CCPTMRS2bits_t CCPTMRS2bits;
1591 #define _C8TSEL0 0x01
1592 #define _C8TSEL1 0x02
1594 //==============================================================================
1597 //==============================================================================
1598 // CCPTMRS1 Bits
1600 extern __at(0x0F2C) __sfr CCPTMRS1;
1602 typedef union
1604 struct
1606 unsigned C4TSEL0 : 1;
1607 unsigned C4TSEL1 : 1;
1608 unsigned C5TSEL0 : 1;
1609 unsigned : 1;
1610 unsigned C6TSEL0 : 1;
1611 unsigned : 1;
1612 unsigned C7TSEL0 : 1;
1613 unsigned C7TSEL1 : 1;
1616 struct
1618 unsigned C4TSEL : 2;
1619 unsigned : 6;
1622 struct
1624 unsigned : 6;
1625 unsigned C7TSEL : 2;
1627 } __CCPTMRS1bits_t;
1629 extern __at(0x0F2C) volatile __CCPTMRS1bits_t CCPTMRS1bits;
1631 #define _C4TSEL0 0x01
1632 #define _C4TSEL1 0x02
1633 #define _C5TSEL0 0x04
1634 #define _C6TSEL0 0x10
1635 #define _C7TSEL0 0x40
1636 #define _C7TSEL1 0x80
1638 //==============================================================================
1641 //==============================================================================
1642 // CCPTMRS0 Bits
1644 extern __at(0x0F2D) __sfr CCPTMRS0;
1646 typedef union
1648 struct
1650 unsigned C1TSEL0 : 1;
1651 unsigned C1TSEL1 : 1;
1652 unsigned C1TSEL2 : 1;
1653 unsigned C2TSEL0 : 1;
1654 unsigned C2TSEL1 : 1;
1655 unsigned C2TSEL2 : 1;
1656 unsigned C3TSEL0 : 1;
1657 unsigned C3TSEL1 : 1;
1660 struct
1662 unsigned C1TSEL : 3;
1663 unsigned : 5;
1666 struct
1668 unsigned : 3;
1669 unsigned C2TSEL : 3;
1670 unsigned : 2;
1673 struct
1675 unsigned : 6;
1676 unsigned C3TSEL : 2;
1678 } __CCPTMRS0bits_t;
1680 extern __at(0x0F2D) volatile __CCPTMRS0bits_t CCPTMRS0bits;
1682 #define _C1TSEL0 0x01
1683 #define _C1TSEL1 0x02
1684 #define _C1TSEL2 0x04
1685 #define _C2TSEL0 0x08
1686 #define _C2TSEL1 0x10
1687 #define _C2TSEL2 0x20
1688 #define _C3TSEL0 0x40
1689 #define _C3TSEL1 0x80
1691 //==============================================================================
1694 //==============================================================================
1695 // CM3CON Bits
1697 extern __at(0x0F2E) __sfr CM3CON;
1699 typedef union
1701 struct
1703 unsigned CCH0 : 1;
1704 unsigned CCH1 : 1;
1705 unsigned CREF : 1;
1706 unsigned EVPOL0 : 1;
1707 unsigned EVPOL1 : 1;
1708 unsigned CPOL : 1;
1709 unsigned COE : 1;
1710 unsigned CON : 1;
1713 struct
1715 unsigned CCH : 2;
1716 unsigned : 6;
1719 struct
1721 unsigned : 3;
1722 unsigned EVPOL : 2;
1723 unsigned : 3;
1725 } __CM3CONbits_t;
1727 extern __at(0x0F2E) volatile __CM3CONbits_t CM3CONbits;
1729 #define _CM3CON_CCH0 0x01
1730 #define _CM3CON_CCH1 0x02
1731 #define _CM3CON_CREF 0x04
1732 #define _CM3CON_EVPOL0 0x08
1733 #define _CM3CON_EVPOL1 0x10
1734 #define _CM3CON_CPOL 0x20
1735 #define _CM3CON_COE 0x40
1736 #define _CM3CON_CON 0x80
1738 //==============================================================================
1741 //==============================================================================
1742 // CM3CON1 Bits
1744 extern __at(0x0F2E) __sfr CM3CON1;
1746 typedef union
1748 struct
1750 unsigned CCH0 : 1;
1751 unsigned CCH1 : 1;
1752 unsigned CREF : 1;
1753 unsigned EVPOL0 : 1;
1754 unsigned EVPOL1 : 1;
1755 unsigned CPOL : 1;
1756 unsigned COE : 1;
1757 unsigned CON : 1;
1760 struct
1762 unsigned CCH : 2;
1763 unsigned : 6;
1766 struct
1768 unsigned : 3;
1769 unsigned EVPOL : 2;
1770 unsigned : 3;
1772 } __CM3CON1bits_t;
1774 extern __at(0x0F2E) volatile __CM3CON1bits_t CM3CON1bits;
1776 #define _CM3CON1_CCH0 0x01
1777 #define _CM3CON1_CCH1 0x02
1778 #define _CM3CON1_CREF 0x04
1779 #define _CM3CON1_EVPOL0 0x08
1780 #define _CM3CON1_EVPOL1 0x10
1781 #define _CM3CON1_CPOL 0x20
1782 #define _CM3CON1_COE 0x40
1783 #define _CM3CON1_CON 0x80
1785 //==============================================================================
1788 //==============================================================================
1789 // CM2CON Bits
1791 extern __at(0x0F2F) __sfr CM2CON;
1793 typedef union
1795 struct
1797 unsigned CCH0 : 1;
1798 unsigned CCH1 : 1;
1799 unsigned CREF : 1;
1800 unsigned EVPOL0 : 1;
1801 unsigned EVPOL1 : 1;
1802 unsigned CPOL : 1;
1803 unsigned COE : 1;
1804 unsigned CON : 1;
1807 struct
1809 unsigned CCH : 2;
1810 unsigned : 6;
1813 struct
1815 unsigned : 3;
1816 unsigned EVPOL : 2;
1817 unsigned : 3;
1819 } __CM2CONbits_t;
1821 extern __at(0x0F2F) volatile __CM2CONbits_t CM2CONbits;
1823 #define _CM2CON_CCH0 0x01
1824 #define _CM2CON_CCH1 0x02
1825 #define _CM2CON_CREF 0x04
1826 #define _CM2CON_EVPOL0 0x08
1827 #define _CM2CON_EVPOL1 0x10
1828 #define _CM2CON_CPOL 0x20
1829 #define _CM2CON_COE 0x40
1830 #define _CM2CON_CON 0x80
1832 //==============================================================================
1835 //==============================================================================
1836 // CM2CON1 Bits
1838 extern __at(0x0F2F) __sfr CM2CON1;
1840 typedef union
1842 struct
1844 unsigned CCH0 : 1;
1845 unsigned CCH1 : 1;
1846 unsigned CREF : 1;
1847 unsigned EVPOL0 : 1;
1848 unsigned EVPOL1 : 1;
1849 unsigned CPOL : 1;
1850 unsigned COE : 1;
1851 unsigned CON : 1;
1854 struct
1856 unsigned CCH : 2;
1857 unsigned : 6;
1860 struct
1862 unsigned : 3;
1863 unsigned EVPOL : 2;
1864 unsigned : 3;
1866 } __CM2CON1bits_t;
1868 extern __at(0x0F2F) volatile __CM2CON1bits_t CM2CON1bits;
1870 #define _CM2CON1_CCH0 0x01
1871 #define _CM2CON1_CCH1 0x02
1872 #define _CM2CON1_CREF 0x04
1873 #define _CM2CON1_EVPOL0 0x08
1874 #define _CM2CON1_EVPOL1 0x10
1875 #define _CM2CON1_CPOL 0x20
1876 #define _CM2CON1_COE 0x40
1877 #define _CM2CON1_CON 0x80
1879 //==============================================================================
1882 //==============================================================================
1883 // T8CON Bits
1885 extern __at(0x0F36) __sfr T8CON;
1887 typedef union
1889 struct
1891 unsigned T8CKPS0 : 1;
1892 unsigned T8CKPS1 : 1;
1893 unsigned TMR8ON : 1;
1894 unsigned T8OUTPS0 : 1;
1895 unsigned T8OUTPS1 : 1;
1896 unsigned T8OUTPS2 : 1;
1897 unsigned T8OUTPS3 : 1;
1898 unsigned : 1;
1901 struct
1903 unsigned T8CKPS : 2;
1904 unsigned : 6;
1907 struct
1909 unsigned : 3;
1910 unsigned T8OUTPS : 4;
1911 unsigned : 1;
1913 } __T8CONbits_t;
1915 extern __at(0x0F36) volatile __T8CONbits_t T8CONbits;
1917 #define _T8CKPS0 0x01
1918 #define _T8CKPS1 0x02
1919 #define _TMR8ON 0x04
1920 #define _T8OUTPS0 0x08
1921 #define _T8OUTPS1 0x10
1922 #define _T8OUTPS2 0x20
1923 #define _T8OUTPS3 0x40
1925 //==============================================================================
1927 extern __at(0x0F37) __sfr PR8;
1928 extern __at(0x0F38) __sfr TMR8;
1930 //==============================================================================
1931 // T6CON Bits
1933 extern __at(0x0F39) __sfr T6CON;
1935 typedef union
1937 struct
1939 unsigned T6CKPS0 : 1;
1940 unsigned T6CKPS1 : 1;
1941 unsigned TMR6ON : 1;
1942 unsigned T6OUTPS0 : 1;
1943 unsigned T6OUTPS1 : 1;
1944 unsigned T6OUTPS2 : 1;
1945 unsigned T6OUTPS3 : 1;
1946 unsigned : 1;
1949 struct
1951 unsigned T6CKPS : 2;
1952 unsigned : 6;
1955 struct
1957 unsigned : 3;
1958 unsigned T6OUTPS : 4;
1959 unsigned : 1;
1961 } __T6CONbits_t;
1963 extern __at(0x0F39) volatile __T6CONbits_t T6CONbits;
1965 #define _T6CKPS0 0x01
1966 #define _T6CKPS1 0x02
1967 #define _TMR6ON 0x04
1968 #define _T6OUTPS0 0x08
1969 #define _T6OUTPS1 0x10
1970 #define _T6OUTPS2 0x20
1971 #define _T6OUTPS3 0x40
1973 //==============================================================================
1975 extern __at(0x0F3A) __sfr PR6;
1976 extern __at(0x0F3B) __sfr TMR6;
1978 //==============================================================================
1979 // CCP8CON Bits
1981 extern __at(0x0F46) __sfr CCP8CON;
1983 typedef union
1985 struct
1987 unsigned CCP8M0 : 1;
1988 unsigned CCP8M1 : 1;
1989 unsigned CCP8M2 : 1;
1990 unsigned CCP8M3 : 1;
1991 unsigned DC8B0 : 1;
1992 unsigned DC8B1 : 1;
1993 unsigned : 1;
1994 unsigned : 1;
1997 struct
1999 unsigned : 1;
2000 unsigned : 1;
2001 unsigned : 1;
2002 unsigned : 1;
2003 unsigned CCP8Y : 1;
2004 unsigned CCP8X : 1;
2005 unsigned : 1;
2006 unsigned : 1;
2009 struct
2011 unsigned CCP8M : 4;
2012 unsigned : 4;
2015 struct
2017 unsigned : 4;
2018 unsigned DC8B : 2;
2019 unsigned : 2;
2021 } __CCP8CONbits_t;
2023 extern __at(0x0F46) volatile __CCP8CONbits_t CCP8CONbits;
2025 #define _CCP8M0 0x01
2026 #define _CCP8M1 0x02
2027 #define _CCP8M2 0x04
2028 #define _CCP8M3 0x08
2029 #define _DC8B0 0x10
2030 #define _CCP8Y 0x10
2031 #define _DC8B1 0x20
2032 #define _CCP8X 0x20
2034 //==============================================================================
2036 extern __at(0x0F47) __sfr CCPR8;
2037 extern __at(0x0F47) __sfr CCPR8L;
2038 extern __at(0x0F48) __sfr CCPR8H;
2040 //==============================================================================
2041 // CCP3CON Bits
2043 extern __at(0x0F49) __sfr CCP3CON;
2045 typedef union
2047 struct
2049 unsigned CCP3M0 : 1;
2050 unsigned CCP3M1 : 1;
2051 unsigned CCP3M2 : 1;
2052 unsigned CCP3M3 : 1;
2053 unsigned DC3B0 : 1;
2054 unsigned DC3B1 : 1;
2055 unsigned P3M0 : 1;
2056 unsigned P3M1 : 1;
2059 struct
2061 unsigned : 1;
2062 unsigned : 1;
2063 unsigned : 1;
2064 unsigned : 1;
2065 unsigned CCP3Y : 1;
2066 unsigned CCP3X : 1;
2067 unsigned : 1;
2068 unsigned : 1;
2071 struct
2073 unsigned CCP3M : 4;
2074 unsigned : 4;
2077 struct
2079 unsigned : 4;
2080 unsigned DC3B : 2;
2081 unsigned : 2;
2084 struct
2086 unsigned : 6;
2087 unsigned P3M : 2;
2089 } __CCP3CONbits_t;
2091 extern __at(0x0F49) volatile __CCP3CONbits_t CCP3CONbits;
2093 #define _CCP3M0 0x01
2094 #define _CCP3M1 0x02
2095 #define _CCP3M2 0x04
2096 #define _CCP3M3 0x08
2097 #define _DC3B0 0x10
2098 #define _CCP3Y 0x10
2099 #define _DC3B1 0x20
2100 #define _CCP3X 0x20
2101 #define _P3M0 0x40
2102 #define _P3M1 0x80
2104 //==============================================================================
2106 extern __at(0x0F4A) __sfr CCPR3;
2107 extern __at(0x0F4A) __sfr CCPR3L;
2108 extern __at(0x0F4B) __sfr CCPR3H;
2110 //==============================================================================
2111 // ECCP3DEL Bits
2113 extern __at(0x0F4C) __sfr ECCP3DEL;
2115 typedef union
2117 struct
2119 unsigned P3DC0 : 1;
2120 unsigned P3DC1 : 1;
2121 unsigned P3DC2 : 1;
2122 unsigned P3DC3 : 1;
2123 unsigned P3DC4 : 1;
2124 unsigned P3DC5 : 1;
2125 unsigned P3DC6 : 1;
2126 unsigned P3RSEN : 1;
2129 struct
2131 unsigned P3DC : 7;
2132 unsigned : 1;
2134 } __ECCP3DELbits_t;
2136 extern __at(0x0F4C) volatile __ECCP3DELbits_t ECCP3DELbits;
2138 #define _P3DC0 0x01
2139 #define _P3DC1 0x02
2140 #define _P3DC2 0x04
2141 #define _P3DC3 0x08
2142 #define _P3DC4 0x10
2143 #define _P3DC5 0x20
2144 #define _P3DC6 0x40
2145 #define _P3RSEN 0x80
2147 //==============================================================================
2150 //==============================================================================
2151 // PWM3CON Bits
2153 extern __at(0x0F4C) __sfr PWM3CON;
2155 typedef union
2157 struct
2159 unsigned P3DC0 : 1;
2160 unsigned P3DC1 : 1;
2161 unsigned P3DC2 : 1;
2162 unsigned P3DC3 : 1;
2163 unsigned P3DC4 : 1;
2164 unsigned P3DC5 : 1;
2165 unsigned P3DC6 : 1;
2166 unsigned P3RSEN : 1;
2169 struct
2171 unsigned P3DC : 7;
2172 unsigned : 1;
2174 } __PWM3CONbits_t;
2176 extern __at(0x0F4C) volatile __PWM3CONbits_t PWM3CONbits;
2178 #define _PWM3CON_P3DC0 0x01
2179 #define _PWM3CON_P3DC1 0x02
2180 #define _PWM3CON_P3DC2 0x04
2181 #define _PWM3CON_P3DC3 0x08
2182 #define _PWM3CON_P3DC4 0x10
2183 #define _PWM3CON_P3DC5 0x20
2184 #define _PWM3CON_P3DC6 0x40
2185 #define _PWM3CON_P3RSEN 0x80
2187 //==============================================================================
2190 //==============================================================================
2191 // ECCP3AS Bits
2193 extern __at(0x0F4D) __sfr ECCP3AS;
2195 typedef union
2197 struct
2199 unsigned PSS3BD0 : 1;
2200 unsigned PSS3BD1 : 1;
2201 unsigned PSS3AC0 : 1;
2202 unsigned PSS3AC1 : 1;
2203 unsigned ECCP3AS0 : 1;
2204 unsigned ECCP3AS1 : 1;
2205 unsigned ECCP3AS2 : 1;
2206 unsigned ECCP3ASE : 1;
2209 struct
2211 unsigned PSS3BD : 2;
2212 unsigned : 6;
2215 struct
2217 unsigned : 2;
2218 unsigned PSS3AC : 2;
2219 unsigned : 4;
2222 struct
2224 unsigned : 4;
2225 unsigned ECCP3AS : 3;
2226 unsigned : 1;
2228 } __ECCP3ASbits_t;
2230 extern __at(0x0F4D) volatile __ECCP3ASbits_t ECCP3ASbits;
2232 #define _PSS3BD0 0x01
2233 #define _PSS3BD1 0x02
2234 #define _PSS3AC0 0x04
2235 #define _PSS3AC1 0x08
2236 #define _ECCP3AS0 0x10
2237 #define _ECCP3AS1 0x20
2238 #define _ECCP3AS2 0x40
2239 #define _ECCP3ASE 0x80
2241 //==============================================================================
2244 //==============================================================================
2245 // CCP2CON Bits
2247 extern __at(0x0F4E) __sfr CCP2CON;
2249 typedef union
2251 struct
2253 unsigned CCP2M0 : 1;
2254 unsigned CCP2M1 : 1;
2255 unsigned CCP2M2 : 1;
2256 unsigned CCP2M3 : 1;
2257 unsigned DC2B0 : 1;
2258 unsigned DC2B1 : 1;
2259 unsigned P2M0 : 1;
2260 unsigned P2M1 : 1;
2263 struct
2265 unsigned : 1;
2266 unsigned : 1;
2267 unsigned : 1;
2268 unsigned : 1;
2269 unsigned CCP2Y : 1;
2270 unsigned CCP2X : 1;
2271 unsigned : 1;
2272 unsigned : 1;
2275 struct
2277 unsigned CCP2M : 4;
2278 unsigned : 4;
2281 struct
2283 unsigned : 4;
2284 unsigned DC2B : 2;
2285 unsigned : 2;
2288 struct
2290 unsigned : 6;
2291 unsigned P2M : 2;
2293 } __CCP2CONbits_t;
2295 extern __at(0x0F4E) volatile __CCP2CONbits_t CCP2CONbits;
2297 #define _CCP2M0 0x01
2298 #define _CCP2M1 0x02
2299 #define _CCP2M2 0x04
2300 #define _CCP2M3 0x08
2301 #define _DC2B0 0x10
2302 #define _CCP2Y 0x10
2303 #define _DC2B1 0x20
2304 #define _CCP2X 0x20
2305 #define _P2M0 0x40
2306 #define _P2M1 0x80
2308 //==============================================================================
2311 //==============================================================================
2312 // ECCP2CON Bits
2314 extern __at(0x0F4E) __sfr ECCP2CON;
2316 typedef union
2318 struct
2320 unsigned CCP2M0 : 1;
2321 unsigned CCP2M1 : 1;
2322 unsigned CCP2M2 : 1;
2323 unsigned CCP2M3 : 1;
2324 unsigned DC2B0 : 1;
2325 unsigned DC2B1 : 1;
2326 unsigned P2M0 : 1;
2327 unsigned P2M1 : 1;
2330 struct
2332 unsigned : 1;
2333 unsigned : 1;
2334 unsigned : 1;
2335 unsigned : 1;
2336 unsigned CCP2Y : 1;
2337 unsigned CCP2X : 1;
2338 unsigned : 1;
2339 unsigned : 1;
2342 struct
2344 unsigned CCP2M : 4;
2345 unsigned : 4;
2348 struct
2350 unsigned : 4;
2351 unsigned DC2B : 2;
2352 unsigned : 2;
2355 struct
2357 unsigned : 6;
2358 unsigned P2M : 2;
2360 } __ECCP2CONbits_t;
2362 extern __at(0x0F4E) volatile __ECCP2CONbits_t ECCP2CONbits;
2364 #define _ECCP2CON_CCP2M0 0x01
2365 #define _ECCP2CON_CCP2M1 0x02
2366 #define _ECCP2CON_CCP2M2 0x04
2367 #define _ECCP2CON_CCP2M3 0x08
2368 #define _ECCP2CON_DC2B0 0x10
2369 #define _ECCP2CON_CCP2Y 0x10
2370 #define _ECCP2CON_DC2B1 0x20
2371 #define _ECCP2CON_CCP2X 0x20
2372 #define _ECCP2CON_P2M0 0x40
2373 #define _ECCP2CON_P2M1 0x80
2375 //==============================================================================
2377 extern __at(0x0F4F) __sfr CCPR2;
2378 extern __at(0x0F4F) __sfr CCPR2L;
2379 extern __at(0x0F50) __sfr CCPR2H;
2381 //==============================================================================
2382 // ECCP2DEL Bits
2384 extern __at(0x0F51) __sfr ECCP2DEL;
2386 typedef union
2388 struct
2390 unsigned P2DC0 : 1;
2391 unsigned P2DC1 : 1;
2392 unsigned P2DC2 : 1;
2393 unsigned P2DC3 : 1;
2394 unsigned P2DC4 : 1;
2395 unsigned P2DC5 : 1;
2396 unsigned P2DC6 : 1;
2397 unsigned P2RSEN : 1;
2400 struct
2402 unsigned P2DC : 7;
2403 unsigned : 1;
2405 } __ECCP2DELbits_t;
2407 extern __at(0x0F51) volatile __ECCP2DELbits_t ECCP2DELbits;
2409 #define _P2DC0 0x01
2410 #define _P2DC1 0x02
2411 #define _P2DC2 0x04
2412 #define _P2DC3 0x08
2413 #define _P2DC4 0x10
2414 #define _P2DC5 0x20
2415 #define _P2DC6 0x40
2416 #define _P2RSEN 0x80
2418 //==============================================================================
2421 //==============================================================================
2422 // PWM2CON Bits
2424 extern __at(0x0F51) __sfr PWM2CON;
2426 typedef union
2428 struct
2430 unsigned P2DC0 : 1;
2431 unsigned P2DC1 : 1;
2432 unsigned P2DC2 : 1;
2433 unsigned P2DC3 : 1;
2434 unsigned P2DC4 : 1;
2435 unsigned P2DC5 : 1;
2436 unsigned P2DC6 : 1;
2437 unsigned P2RSEN : 1;
2440 struct
2442 unsigned P2DC : 7;
2443 unsigned : 1;
2445 } __PWM2CONbits_t;
2447 extern __at(0x0F51) volatile __PWM2CONbits_t PWM2CONbits;
2449 #define _PWM2CON_P2DC0 0x01
2450 #define _PWM2CON_P2DC1 0x02
2451 #define _PWM2CON_P2DC2 0x04
2452 #define _PWM2CON_P2DC3 0x08
2453 #define _PWM2CON_P2DC4 0x10
2454 #define _PWM2CON_P2DC5 0x20
2455 #define _PWM2CON_P2DC6 0x40
2456 #define _PWM2CON_P2RSEN 0x80
2458 //==============================================================================
2461 //==============================================================================
2462 // ECCP2AS Bits
2464 extern __at(0x0F52) __sfr ECCP2AS;
2466 typedef union
2468 struct
2470 unsigned PSS2BD0 : 1;
2471 unsigned PSS2BD1 : 1;
2472 unsigned PSS2AC0 : 1;
2473 unsigned PSS2AC1 : 1;
2474 unsigned ECCP2AS0 : 1;
2475 unsigned ECCP2AS1 : 1;
2476 unsigned ECCP2AS2 : 1;
2477 unsigned ECCP2ASE : 1;
2480 struct
2482 unsigned PSS2BD : 2;
2483 unsigned : 6;
2486 struct
2488 unsigned : 2;
2489 unsigned PSS2AC : 2;
2490 unsigned : 4;
2493 struct
2495 unsigned : 4;
2496 unsigned ECCP2AS : 3;
2497 unsigned : 1;
2499 } __ECCP2ASbits_t;
2501 extern __at(0x0F52) volatile __ECCP2ASbits_t ECCP2ASbits;
2503 #define _PSS2BD0 0x01
2504 #define _PSS2BD1 0x02
2505 #define _PSS2AC0 0x04
2506 #define _PSS2AC1 0x08
2507 #define _ECCP2AS0 0x10
2508 #define _ECCP2AS1 0x20
2509 #define _ECCP2AS2 0x40
2510 #define _ECCP2ASE 0x80
2512 //==============================================================================
2515 //==============================================================================
2516 // PADCFG1 Bits
2518 extern __at(0x0F53) __sfr PADCFG1;
2520 typedef union
2522 struct
2524 unsigned : 1;
2525 unsigned RTSECSEL0 : 1;
2526 unsigned RTSECSEL1 : 1;
2527 unsigned : 1;
2528 unsigned : 1;
2529 unsigned : 1;
2530 unsigned REPU : 1;
2531 unsigned RDPU : 1;
2534 struct
2536 unsigned : 1;
2537 unsigned RTSECSEL : 2;
2538 unsigned : 5;
2540 } __PADCFG1bits_t;
2542 extern __at(0x0F53) volatile __PADCFG1bits_t PADCFG1bits;
2544 #define _RTSECSEL0 0x02
2545 #define _RTSECSEL1 0x04
2546 #define _REPU 0x40
2547 #define _RDPU 0x80
2549 //==============================================================================
2552 //==============================================================================
2553 // CM1CON Bits
2555 extern __at(0x0F54) __sfr CM1CON;
2557 typedef union
2559 struct
2561 unsigned CCH0 : 1;
2562 unsigned CCH1 : 1;
2563 unsigned CREF : 1;
2564 unsigned EVPOL0 : 1;
2565 unsigned EVPOL1 : 1;
2566 unsigned CPOL : 1;
2567 unsigned COE : 1;
2568 unsigned CON : 1;
2571 struct
2573 unsigned CCH : 2;
2574 unsigned : 6;
2577 struct
2579 unsigned : 3;
2580 unsigned EVPOL : 2;
2581 unsigned : 3;
2583 } __CM1CONbits_t;
2585 extern __at(0x0F54) volatile __CM1CONbits_t CM1CONbits;
2587 #define _CCH0 0x01
2588 #define _CCH1 0x02
2589 #define _CREF 0x04
2590 #define _EVPOL0 0x08
2591 #define _EVPOL1 0x10
2592 #define _CPOL 0x20
2593 #define _COE 0x40
2594 #define _CON 0x80
2596 //==============================================================================
2599 //==============================================================================
2600 // CM1CON1 Bits
2602 extern __at(0x0F54) __sfr CM1CON1;
2604 typedef union
2606 struct
2608 unsigned CCH0 : 1;
2609 unsigned CCH1 : 1;
2610 unsigned CREF : 1;
2611 unsigned EVPOL0 : 1;
2612 unsigned EVPOL1 : 1;
2613 unsigned CPOL : 1;
2614 unsigned COE : 1;
2615 unsigned CON : 1;
2618 struct
2620 unsigned CCH : 2;
2621 unsigned : 6;
2624 struct
2626 unsigned : 3;
2627 unsigned EVPOL : 2;
2628 unsigned : 3;
2630 } __CM1CON1bits_t;
2632 extern __at(0x0F54) volatile __CM1CON1bits_t CM1CON1bits;
2634 #define _CM1CON1_CCH0 0x01
2635 #define _CM1CON1_CCH1 0x02
2636 #define _CM1CON1_CREF 0x04
2637 #define _CM1CON1_EVPOL0 0x08
2638 #define _CM1CON1_EVPOL1 0x10
2639 #define _CM1CON1_CPOL 0x20
2640 #define _CM1CON1_COE 0x40
2641 #define _CM1CON1_CON 0x80
2643 //==============================================================================
2646 //==============================================================================
2647 // CTMUICON Bits
2649 extern __at(0x0F55) __sfr CTMUICON;
2651 typedef union
2653 struct
2655 unsigned IRNG0 : 1;
2656 unsigned IRNG1 : 1;
2657 unsigned ITRIM0 : 1;
2658 unsigned ITRIM1 : 1;
2659 unsigned ITRIM2 : 1;
2660 unsigned ITRIM3 : 1;
2661 unsigned ITRIM4 : 1;
2662 unsigned ITRIM5 : 1;
2665 struct
2667 unsigned IRNG : 2;
2668 unsigned : 6;
2671 struct
2673 unsigned : 2;
2674 unsigned ITRIM : 6;
2676 } __CTMUICONbits_t;
2678 extern __at(0x0F55) volatile __CTMUICONbits_t CTMUICONbits;
2680 #define _IRNG0 0x01
2681 #define _IRNG1 0x02
2682 #define _ITRIM0 0x04
2683 #define _ITRIM1 0x08
2684 #define _ITRIM2 0x10
2685 #define _ITRIM3 0x20
2686 #define _ITRIM4 0x40
2687 #define _ITRIM5 0x80
2689 //==============================================================================
2692 //==============================================================================
2693 // CTMUCONL Bits
2695 extern __at(0x0F56) __sfr CTMUCONL;
2697 typedef union
2699 struct
2701 unsigned EDG1STAT : 1;
2702 unsigned EDG2STAT : 1;
2703 unsigned EDG1SEL0 : 1;
2704 unsigned EDG1SEL1 : 1;
2705 unsigned EDG1POL : 1;
2706 unsigned EDG2SEL0 : 1;
2707 unsigned EDG2SEL1 : 1;
2708 unsigned EDG2POL : 1;
2711 struct
2713 unsigned : 2;
2714 unsigned EDG1SEL : 2;
2715 unsigned : 4;
2718 struct
2720 unsigned : 5;
2721 unsigned EDG2SEL : 2;
2722 unsigned : 1;
2724 } __CTMUCONLbits_t;
2726 extern __at(0x0F56) volatile __CTMUCONLbits_t CTMUCONLbits;
2728 #define _EDG1STAT 0x01
2729 #define _EDG2STAT 0x02
2730 #define _EDG1SEL0 0x04
2731 #define _EDG1SEL1 0x08
2732 #define _EDG1POL 0x10
2733 #define _EDG2SEL0 0x20
2734 #define _EDG2SEL1 0x40
2735 #define _EDG2POL 0x80
2737 //==============================================================================
2740 //==============================================================================
2741 // CTMUCONH Bits
2743 extern __at(0x0F57) __sfr CTMUCONH;
2745 typedef struct
2747 unsigned CTTRIG : 1;
2748 unsigned IDISSEN : 1;
2749 unsigned EDGSEQEN : 1;
2750 unsigned EDGEN : 1;
2751 unsigned TGEN : 1;
2752 unsigned CTMUSIDL : 1;
2753 unsigned : 1;
2754 unsigned CTMUEN : 1;
2755 } __CTMUCONHbits_t;
2757 extern __at(0x0F57) volatile __CTMUCONHbits_t CTMUCONHbits;
2759 #define _CTTRIG 0x01
2760 #define _IDISSEN 0x02
2761 #define _EDGSEQEN 0x04
2762 #define _EDGEN 0x08
2763 #define _TGEN 0x10
2764 #define _CTMUSIDL 0x20
2765 #define _CTMUEN 0x80
2767 //==============================================================================
2769 extern __at(0x0F58) __sfr ALRMVAL;
2770 extern __at(0x0F58) __sfr ALRMVALL;
2771 extern __at(0x0F59) __sfr ALRMVALH;
2773 //==============================================================================
2774 // ALRMRPT Bits
2776 extern __at(0x0F5A) __sfr ALRMRPT;
2778 typedef struct
2780 unsigned ARPT0 : 1;
2781 unsigned ARPT1 : 1;
2782 unsigned ARPT2 : 1;
2783 unsigned ARPT3 : 1;
2784 unsigned ARPT4 : 1;
2785 unsigned ARPT5 : 1;
2786 unsigned ARPT6 : 1;
2787 unsigned ARPT7 : 1;
2788 } __ALRMRPTbits_t;
2790 extern __at(0x0F5A) volatile __ALRMRPTbits_t ALRMRPTbits;
2792 #define _ARPT0 0x01
2793 #define _ARPT1 0x02
2794 #define _ARPT2 0x04
2795 #define _ARPT3 0x08
2796 #define _ARPT4 0x10
2797 #define _ARPT5 0x20
2798 #define _ARPT6 0x40
2799 #define _ARPT7 0x80
2801 //==============================================================================
2804 //==============================================================================
2805 // ALRMCFG Bits
2807 extern __at(0x0F5B) __sfr ALRMCFG;
2809 typedef union
2811 struct
2813 unsigned ALRMPTR0 : 1;
2814 unsigned ALRMPTR1 : 1;
2815 unsigned AMASK0 : 1;
2816 unsigned AMASK1 : 1;
2817 unsigned AMASK2 : 1;
2818 unsigned AMASK3 : 1;
2819 unsigned CHIME : 1;
2820 unsigned ALRMEN : 1;
2823 struct
2825 unsigned ALRMPTR : 2;
2826 unsigned : 6;
2829 struct
2831 unsigned : 2;
2832 unsigned AMASK : 4;
2833 unsigned : 2;
2835 } __ALRMCFGbits_t;
2837 extern __at(0x0F5B) volatile __ALRMCFGbits_t ALRMCFGbits;
2839 #define _ALRMPTR0 0x01
2840 #define _ALRMPTR1 0x02
2841 #define _AMASK0 0x04
2842 #define _AMASK1 0x08
2843 #define _AMASK2 0x10
2844 #define _AMASK3 0x20
2845 #define _CHIME 0x40
2846 #define _ALRMEN 0x80
2848 //==============================================================================
2850 extern __at(0x0F5C) __sfr RTCVAL;
2851 extern __at(0x0F5C) __sfr RTCVALL;
2853 //==============================================================================
2854 // RTCVALH Bits
2856 extern __at(0x0F5D) __sfr RTCVALH;
2858 typedef union
2860 struct
2862 unsigned WAITE0 : 1;
2863 unsigned WAITE1 : 1;
2864 unsigned WAITM0 : 1;
2865 unsigned WAITM1 : 1;
2866 unsigned WAITM2 : 1;
2867 unsigned WAITM3 : 1;
2868 unsigned WAITB0 : 1;
2869 unsigned WAITB1 : 1;
2872 struct
2874 unsigned WAITE : 2;
2875 unsigned : 6;
2878 struct
2880 unsigned : 2;
2881 unsigned WAITM : 4;
2882 unsigned : 2;
2885 struct
2887 unsigned : 6;
2888 unsigned WAITB : 2;
2890 } __RTCVALHbits_t;
2892 extern __at(0x0F5D) volatile __RTCVALHbits_t RTCVALHbits;
2894 #define _WAITE0 0x01
2895 #define _WAITE1 0x02
2896 #define _WAITM0 0x04
2897 #define _WAITM1 0x08
2898 #define _WAITM2 0x10
2899 #define _WAITM3 0x20
2900 #define _WAITB0 0x40
2901 #define _WAITB1 0x80
2903 //==============================================================================
2906 //==============================================================================
2907 // RTCCAL Bits
2909 extern __at(0x0F5E) __sfr RTCCAL;
2911 typedef struct
2913 unsigned CAL0 : 1;
2914 unsigned CAL1 : 1;
2915 unsigned CAL2 : 1;
2916 unsigned CAL3 : 1;
2917 unsigned CAL4 : 1;
2918 unsigned CAL5 : 1;
2919 unsigned CAL6 : 1;
2920 unsigned CAL7 : 1;
2921 } __RTCCALbits_t;
2923 extern __at(0x0F5E) volatile __RTCCALbits_t RTCCALbits;
2925 #define _CAL0 0x01
2926 #define _CAL1 0x02
2927 #define _CAL2 0x04
2928 #define _CAL3 0x08
2929 #define _CAL4 0x10
2930 #define _CAL5 0x20
2931 #define _CAL6 0x40
2932 #define _CAL7 0x80
2934 //==============================================================================
2937 //==============================================================================
2938 // RTCCFG Bits
2940 extern __at(0x0F5F) __sfr RTCCFG;
2942 typedef union
2944 struct
2946 unsigned RTCPTR0 : 1;
2947 unsigned RTCPTR1 : 1;
2948 unsigned RTCOE : 1;
2949 unsigned HALFSEC : 1;
2950 unsigned RTCSYNC : 1;
2951 unsigned RTCWREN : 1;
2952 unsigned : 1;
2953 unsigned RTCEN : 1;
2956 struct
2958 unsigned RTCPTR : 2;
2959 unsigned : 6;
2961 } __RTCCFGbits_t;
2963 extern __at(0x0F5F) volatile __RTCCFGbits_t RTCCFGbits;
2965 #define _RTCPTR0 0x01
2966 #define _RTCPTR1 0x02
2967 #define _RTCOE 0x04
2968 #define _HALFSEC 0x08
2969 #define _RTCSYNC 0x10
2970 #define _RTCWREN 0x20
2971 #define _RTCEN 0x80
2973 //==============================================================================
2976 //==============================================================================
2977 // PIE6 Bits
2979 extern __at(0x0F60) __sfr PIE6;
2981 typedef struct
2983 unsigned CMP1IE : 1;
2984 unsigned CMP2IE : 1;
2985 unsigned CMP3IE : 1;
2986 unsigned : 1;
2987 unsigned EEIE : 1;
2988 unsigned : 1;
2989 unsigned : 1;
2990 unsigned : 1;
2991 } __PIE6bits_t;
2993 extern __at(0x0F60) volatile __PIE6bits_t PIE6bits;
2995 #define _CMP1IE 0x01
2996 #define _CMP2IE 0x02
2997 #define _CMP3IE 0x04
2998 #define _EEIE 0x10
3000 //==============================================================================
3002 extern __at(0x0F61) __sfr EEDATA;
3003 extern __at(0x0F62) __sfr EEADR;
3004 extern __at(0x0F63) __sfr EEADRH;
3006 //==============================================================================
3007 // OSCCON2 Bits
3009 extern __at(0x0F64) __sfr OSCCON2;
3011 typedef struct
3013 unsigned MFIOSEL : 1;
3014 unsigned MFIOFS : 1;
3015 unsigned : 1;
3016 unsigned SOSCGO : 1;
3017 unsigned : 1;
3018 unsigned : 1;
3019 unsigned SOSCRUN : 1;
3020 unsigned : 1;
3021 } __OSCCON2bits_t;
3023 extern __at(0x0F64) volatile __OSCCON2bits_t OSCCON2bits;
3025 #define _MFIOSEL 0x01
3026 #define _MFIOFS 0x02
3027 #define _SOSCGO 0x08
3028 #define _SOSCRUN 0x40
3030 //==============================================================================
3033 //==============================================================================
3034 // BAUDCON Bits
3036 extern __at(0x0F65) __sfr BAUDCON;
3038 typedef struct
3040 unsigned ABDEN : 1;
3041 unsigned WUE : 1;
3042 unsigned : 1;
3043 unsigned BRG16 : 1;
3044 unsigned TXCKP : 1;
3045 unsigned RXDTP : 1;
3046 unsigned RCIDL : 1;
3047 unsigned ABDOVF : 1;
3048 } __BAUDCONbits_t;
3050 extern __at(0x0F65) volatile __BAUDCONbits_t BAUDCONbits;
3052 #define _ABDEN 0x01
3053 #define _WUE 0x02
3054 #define _BRG16 0x08
3055 #define _TXCKP 0x10
3056 #define _RXDTP 0x20
3057 #define _RCIDL 0x40
3058 #define _ABDOVF 0x80
3060 //==============================================================================
3063 //==============================================================================
3064 // BAUDCON1 Bits
3066 extern __at(0x0F65) __sfr BAUDCON1;
3068 typedef struct
3070 unsigned ABDEN : 1;
3071 unsigned WUE : 1;
3072 unsigned : 1;
3073 unsigned BRG16 : 1;
3074 unsigned TXCKP : 1;
3075 unsigned RXDTP : 1;
3076 unsigned RCIDL : 1;
3077 unsigned ABDOVF : 1;
3078 } __BAUDCON1bits_t;
3080 extern __at(0x0F65) volatile __BAUDCON1bits_t BAUDCON1bits;
3082 #define _BAUDCON1_ABDEN 0x01
3083 #define _BAUDCON1_WUE 0x02
3084 #define _BAUDCON1_BRG16 0x08
3085 #define _BAUDCON1_TXCKP 0x10
3086 #define _BAUDCON1_RXDTP 0x20
3087 #define _BAUDCON1_RCIDL 0x40
3088 #define _BAUDCON1_ABDOVF 0x80
3090 //==============================================================================
3093 //==============================================================================
3094 // BAUDCTL Bits
3096 extern __at(0x0F65) __sfr BAUDCTL;
3098 typedef struct
3100 unsigned ABDEN : 1;
3101 unsigned WUE : 1;
3102 unsigned : 1;
3103 unsigned BRG16 : 1;
3104 unsigned TXCKP : 1;
3105 unsigned RXDTP : 1;
3106 unsigned RCIDL : 1;
3107 unsigned ABDOVF : 1;
3108 } __BAUDCTLbits_t;
3110 extern __at(0x0F65) volatile __BAUDCTLbits_t BAUDCTLbits;
3112 #define _BAUDCTL_ABDEN 0x01
3113 #define _BAUDCTL_WUE 0x02
3114 #define _BAUDCTL_BRG16 0x08
3115 #define _BAUDCTL_TXCKP 0x10
3116 #define _BAUDCTL_RXDTP 0x20
3117 #define _BAUDCTL_RCIDL 0x40
3118 #define _BAUDCTL_ABDOVF 0x80
3120 //==============================================================================
3123 //==============================================================================
3124 // LCDDATA0 Bits
3126 extern __at(0x0F66) __sfr LCDDATA0;
3128 typedef struct
3130 unsigned S00C0 : 1;
3131 unsigned S01C0 : 1;
3132 unsigned S02C0 : 1;
3133 unsigned S03C0 : 1;
3134 unsigned S04C0 : 1;
3135 unsigned S05C0 : 1;
3136 unsigned S06C0 : 1;
3137 unsigned S07C0 : 1;
3138 } __LCDDATA0bits_t;
3140 extern __at(0x0F66) volatile __LCDDATA0bits_t LCDDATA0bits;
3142 #define _S00C0 0x01
3143 #define _S01C0 0x02
3144 #define _S02C0 0x04
3145 #define _S03C0 0x08
3146 #define _S04C0 0x10
3147 #define _S05C0 0x20
3148 #define _S06C0 0x40
3149 #define _S07C0 0x80
3151 //==============================================================================
3154 //==============================================================================
3155 // LCDDATA1 Bits
3157 extern __at(0x0F67) __sfr LCDDATA1;
3159 typedef struct
3161 unsigned S08C0 : 1;
3162 unsigned S09C0 : 1;
3163 unsigned S10C0 : 1;
3164 unsigned S11C0 : 1;
3165 unsigned S12C0 : 1;
3166 unsigned S13C0 : 1;
3167 unsigned S14C0 : 1;
3168 unsigned S15C0 : 1;
3169 } __LCDDATA1bits_t;
3171 extern __at(0x0F67) volatile __LCDDATA1bits_t LCDDATA1bits;
3173 #define _S08C0 0x01
3174 #define _S09C0 0x02
3175 #define _S10C0 0x04
3176 #define _S11C0 0x08
3177 #define _S12C0 0x10
3178 #define _S13C0 0x20
3179 #define _S14C0 0x40
3180 #define _S15C0 0x80
3182 //==============================================================================
3185 //==============================================================================
3186 // LCDDATA2 Bits
3188 extern __at(0x0F68) __sfr LCDDATA2;
3190 typedef struct
3192 unsigned S16C0 : 1;
3193 unsigned S17C0 : 1;
3194 unsigned S18C0 : 1;
3195 unsigned S19C0 : 1;
3196 unsigned S20C0 : 1;
3197 unsigned S21C0 : 1;
3198 unsigned S22C0 : 1;
3199 unsigned S23C0 : 1;
3200 } __LCDDATA2bits_t;
3202 extern __at(0x0F68) volatile __LCDDATA2bits_t LCDDATA2bits;
3204 #define _S16C0 0x01
3205 #define _S17C0 0x02
3206 #define _S18C0 0x04
3207 #define _S19C0 0x08
3208 #define _S20C0 0x10
3209 #define _S21C0 0x20
3210 #define _S22C0 0x40
3211 #define _S23C0 0x80
3213 //==============================================================================
3216 //==============================================================================
3217 // LCDDATA3 Bits
3219 extern __at(0x0F69) __sfr LCDDATA3;
3221 typedef struct
3223 unsigned S24C0 : 1;
3224 unsigned S25C0 : 1;
3225 unsigned S26C0 : 1;
3226 unsigned S27C0 : 1;
3227 unsigned S28C0 : 1;
3228 unsigned S29C0 : 1;
3229 unsigned S30C0 : 1;
3230 unsigned S31C0 : 1;
3231 } __LCDDATA3bits_t;
3233 extern __at(0x0F69) volatile __LCDDATA3bits_t LCDDATA3bits;
3235 #define _S24C0 0x01
3236 #define _S25C0 0x02
3237 #define _S26C0 0x04
3238 #define _S27C0 0x08
3239 #define _S28C0 0x10
3240 #define _S29C0 0x20
3241 #define _S30C0 0x40
3242 #define _S31C0 0x80
3244 //==============================================================================
3247 //==============================================================================
3248 // LCDDATA4 Bits
3250 extern __at(0x0F6A) __sfr LCDDATA4;
3252 typedef struct
3254 unsigned S32C0 : 1;
3255 unsigned : 1;
3256 unsigned : 1;
3257 unsigned : 1;
3258 unsigned : 1;
3259 unsigned : 1;
3260 unsigned : 1;
3261 unsigned : 1;
3262 } __LCDDATA4bits_t;
3264 extern __at(0x0F6A) volatile __LCDDATA4bits_t LCDDATA4bits;
3266 #define _S32C0 0x01
3268 //==============================================================================
3271 //==============================================================================
3272 // LCDDATA6 Bits
3274 extern __at(0x0F6C) __sfr LCDDATA6;
3276 typedef struct
3278 unsigned S00C1 : 1;
3279 unsigned S01C1 : 1;
3280 unsigned S02C1 : 1;
3281 unsigned S03C1 : 1;
3282 unsigned S04C1 : 1;
3283 unsigned S05C1 : 1;
3284 unsigned S06C1 : 1;
3285 unsigned S07C1 : 1;
3286 } __LCDDATA6bits_t;
3288 extern __at(0x0F6C) volatile __LCDDATA6bits_t LCDDATA6bits;
3290 #define _S00C1 0x01
3291 #define _S01C1 0x02
3292 #define _S02C1 0x04
3293 #define _S03C1 0x08
3294 #define _S04C1 0x10
3295 #define _S05C1 0x20
3296 #define _S06C1 0x40
3297 #define _S07C1 0x80
3299 //==============================================================================
3302 //==============================================================================
3303 // LCDDATA7 Bits
3305 extern __at(0x0F6D) __sfr LCDDATA7;
3307 typedef struct
3309 unsigned S08C1 : 1;
3310 unsigned S09C1 : 1;
3311 unsigned S10C1 : 1;
3312 unsigned S11C1 : 1;
3313 unsigned S12C1 : 1;
3314 unsigned S13C1 : 1;
3315 unsigned S14C1 : 1;
3316 unsigned S15C1 : 1;
3317 } __LCDDATA7bits_t;
3319 extern __at(0x0F6D) volatile __LCDDATA7bits_t LCDDATA7bits;
3321 #define _S08C1 0x01
3322 #define _S09C1 0x02
3323 #define _S10C1 0x04
3324 #define _S11C1 0x08
3325 #define _S12C1 0x10
3326 #define _S13C1 0x20
3327 #define _S14C1 0x40
3328 #define _S15C1 0x80
3330 //==============================================================================
3333 //==============================================================================
3334 // LCDDATA8 Bits
3336 extern __at(0x0F6E) __sfr LCDDATA8;
3338 typedef struct
3340 unsigned S16C1 : 1;
3341 unsigned S17C1 : 1;
3342 unsigned S18C1 : 1;
3343 unsigned S19C1 : 1;
3344 unsigned S20C1 : 1;
3345 unsigned S21C1 : 1;
3346 unsigned S22C1 : 1;
3347 unsigned S23C1 : 1;
3348 } __LCDDATA8bits_t;
3350 extern __at(0x0F6E) volatile __LCDDATA8bits_t LCDDATA8bits;
3352 #define _S16C1 0x01
3353 #define _S17C1 0x02
3354 #define _S18C1 0x04
3355 #define _S19C1 0x08
3356 #define _S20C1 0x10
3357 #define _S21C1 0x20
3358 #define _S22C1 0x40
3359 #define _S23C1 0x80
3361 //==============================================================================
3364 //==============================================================================
3365 // LCDDATA9 Bits
3367 extern __at(0x0F6F) __sfr LCDDATA9;
3369 typedef struct
3371 unsigned S24C1 : 1;
3372 unsigned S25C1 : 1;
3373 unsigned S26C1 : 1;
3374 unsigned S27C1 : 1;
3375 unsigned S28C1 : 1;
3376 unsigned S29C1 : 1;
3377 unsigned S30C1 : 1;
3378 unsigned S31C1 : 1;
3379 } __LCDDATA9bits_t;
3381 extern __at(0x0F6F) volatile __LCDDATA9bits_t LCDDATA9bits;
3383 #define _S24C1 0x01
3384 #define _S25C1 0x02
3385 #define _S26C1 0x04
3386 #define _S27C1 0x08
3387 #define _S28C1 0x10
3388 #define _S29C1 0x20
3389 #define _S30C1 0x40
3390 #define _S31C1 0x80
3392 //==============================================================================
3395 //==============================================================================
3396 // LCDDATA10 Bits
3398 extern __at(0x0F70) __sfr LCDDATA10;
3400 typedef struct
3402 unsigned S32C1 : 1;
3403 unsigned : 1;
3404 unsigned : 1;
3405 unsigned : 1;
3406 unsigned : 1;
3407 unsigned : 1;
3408 unsigned : 1;
3409 unsigned : 1;
3410 } __LCDDATA10bits_t;
3412 extern __at(0x0F70) volatile __LCDDATA10bits_t LCDDATA10bits;
3414 #define _S32C1 0x01
3416 //==============================================================================
3419 //==============================================================================
3420 // LCDDATA12 Bits
3422 extern __at(0x0F72) __sfr LCDDATA12;
3424 typedef struct
3426 unsigned S00C2 : 1;
3427 unsigned S01C2 : 1;
3428 unsigned S02C2 : 1;
3429 unsigned S03C2 : 1;
3430 unsigned S04C2 : 1;
3431 unsigned S05C2 : 1;
3432 unsigned S06C2 : 1;
3433 unsigned S07C2 : 1;
3434 } __LCDDATA12bits_t;
3436 extern __at(0x0F72) volatile __LCDDATA12bits_t LCDDATA12bits;
3438 #define _S00C2 0x01
3439 #define _S01C2 0x02
3440 #define _S02C2 0x04
3441 #define _S03C2 0x08
3442 #define _S04C2 0x10
3443 #define _S05C2 0x20
3444 #define _S06C2 0x40
3445 #define _S07C2 0x80
3447 //==============================================================================
3450 //==============================================================================
3451 // LCDDATA13 Bits
3453 extern __at(0x0F73) __sfr LCDDATA13;
3455 typedef struct
3457 unsigned S08C2 : 1;
3458 unsigned S09C2 : 1;
3459 unsigned S10C2 : 1;
3460 unsigned S11C2 : 1;
3461 unsigned S12C2 : 1;
3462 unsigned S13C2 : 1;
3463 unsigned S14C2 : 1;
3464 unsigned S15C2 : 1;
3465 } __LCDDATA13bits_t;
3467 extern __at(0x0F73) volatile __LCDDATA13bits_t LCDDATA13bits;
3469 #define _S08C2 0x01
3470 #define _S09C2 0x02
3471 #define _S10C2 0x04
3472 #define _S11C2 0x08
3473 #define _S12C2 0x10
3474 #define _S13C2 0x20
3475 #define _S14C2 0x40
3476 #define _S15C2 0x80
3478 //==============================================================================
3481 //==============================================================================
3482 // LCDDATA14 Bits
3484 extern __at(0x0F74) __sfr LCDDATA14;
3486 typedef struct
3488 unsigned S16C2 : 1;
3489 unsigned S17C2 : 1;
3490 unsigned S18C2 : 1;
3491 unsigned S19C2 : 1;
3492 unsigned S20C2 : 1;
3493 unsigned S21C2 : 1;
3494 unsigned S22C2 : 1;
3495 unsigned S23C2 : 1;
3496 } __LCDDATA14bits_t;
3498 extern __at(0x0F74) volatile __LCDDATA14bits_t LCDDATA14bits;
3500 #define _S16C2 0x01
3501 #define _S17C2 0x02
3502 #define _S18C2 0x04
3503 #define _S19C2 0x08
3504 #define _S20C2 0x10
3505 #define _S21C2 0x20
3506 #define _S22C2 0x40
3507 #define _S23C2 0x80
3509 //==============================================================================
3512 //==============================================================================
3513 // LCDDATA15 Bits
3515 extern __at(0x0F75) __sfr LCDDATA15;
3517 typedef struct
3519 unsigned S24C2 : 1;
3520 unsigned S25C2 : 1;
3521 unsigned S26C2 : 1;
3522 unsigned S27C2 : 1;
3523 unsigned S28C2 : 1;
3524 unsigned S29C2 : 1;
3525 unsigned S30C2 : 1;
3526 unsigned S31C2 : 1;
3527 } __LCDDATA15bits_t;
3529 extern __at(0x0F75) volatile __LCDDATA15bits_t LCDDATA15bits;
3531 #define _S24C2 0x01
3532 #define _S25C2 0x02
3533 #define _S26C2 0x04
3534 #define _S27C2 0x08
3535 #define _S28C2 0x10
3536 #define _S29C2 0x20
3537 #define _S30C2 0x40
3538 #define _S31C2 0x80
3540 //==============================================================================
3543 //==============================================================================
3544 // LCDDATA16 Bits
3546 extern __at(0x0F76) __sfr LCDDATA16;
3548 typedef struct
3550 unsigned S32C2 : 1;
3551 unsigned : 1;
3552 unsigned : 1;
3553 unsigned : 1;
3554 unsigned : 1;
3555 unsigned : 1;
3556 unsigned : 1;
3557 unsigned : 1;
3558 } __LCDDATA16bits_t;
3560 extern __at(0x0F76) volatile __LCDDATA16bits_t LCDDATA16bits;
3562 #define _S32C2 0x01
3564 //==============================================================================
3567 //==============================================================================
3568 // LCDDATA18 Bits
3570 extern __at(0x0F78) __sfr LCDDATA18;
3572 typedef struct
3574 unsigned S00C3 : 1;
3575 unsigned S01C3 : 1;
3576 unsigned S02C3 : 1;
3577 unsigned S03C3 : 1;
3578 unsigned S04C3 : 1;
3579 unsigned S05C3 : 1;
3580 unsigned S06C3 : 1;
3581 unsigned S07C3 : 1;
3582 } __LCDDATA18bits_t;
3584 extern __at(0x0F78) volatile __LCDDATA18bits_t LCDDATA18bits;
3586 #define _S00C3 0x01
3587 #define _S01C3 0x02
3588 #define _S02C3 0x04
3589 #define _S03C3 0x08
3590 #define _S04C3 0x10
3591 #define _S05C3 0x20
3592 #define _S06C3 0x40
3593 #define _S07C3 0x80
3595 //==============================================================================
3598 //==============================================================================
3599 // LCDDATA19 Bits
3601 extern __at(0x0F79) __sfr LCDDATA19;
3603 typedef struct
3605 unsigned S08C3 : 1;
3606 unsigned S09C3 : 1;
3607 unsigned S10C3 : 1;
3608 unsigned S11C3 : 1;
3609 unsigned S12C3 : 1;
3610 unsigned S13C3 : 1;
3611 unsigned S14C3 : 1;
3612 unsigned S15C3 : 1;
3613 } __LCDDATA19bits_t;
3615 extern __at(0x0F79) volatile __LCDDATA19bits_t LCDDATA19bits;
3617 #define _S08C3 0x01
3618 #define _S09C3 0x02
3619 #define _S10C3 0x04
3620 #define _S11C3 0x08
3621 #define _S12C3 0x10
3622 #define _S13C3 0x20
3623 #define _S14C3 0x40
3624 #define _S15C3 0x80
3626 //==============================================================================
3629 //==============================================================================
3630 // LCDDATA20 Bits
3632 extern __at(0x0F7A) __sfr LCDDATA20;
3634 typedef struct
3636 unsigned S16C3 : 1;
3637 unsigned S17C3 : 1;
3638 unsigned S18C3 : 1;
3639 unsigned S19C3 : 1;
3640 unsigned S20C3 : 1;
3641 unsigned S21C3 : 1;
3642 unsigned S22C3 : 1;
3643 unsigned S23C3 : 1;
3644 } __LCDDATA20bits_t;
3646 extern __at(0x0F7A) volatile __LCDDATA20bits_t LCDDATA20bits;
3648 #define _S16C3 0x01
3649 #define _S17C3 0x02
3650 #define _S18C3 0x04
3651 #define _S19C3 0x08
3652 #define _S20C3 0x10
3653 #define _S21C3 0x20
3654 #define _S22C3 0x40
3655 #define _S23C3 0x80
3657 //==============================================================================
3660 //==============================================================================
3661 // LCDDATA21 Bits
3663 extern __at(0x0F7B) __sfr LCDDATA21;
3665 typedef struct
3667 unsigned S24C3 : 1;
3668 unsigned S25C3 : 1;
3669 unsigned S26C3 : 1;
3670 unsigned S27C3 : 1;
3671 unsigned S28C3 : 1;
3672 unsigned S29C3 : 1;
3673 unsigned S30C3 : 1;
3674 unsigned S31C3 : 1;
3675 } __LCDDATA21bits_t;
3677 extern __at(0x0F7B) volatile __LCDDATA21bits_t LCDDATA21bits;
3679 #define _S24C3 0x01
3680 #define _S25C3 0x02
3681 #define _S26C3 0x04
3682 #define _S27C3 0x08
3683 #define _S28C3 0x10
3684 #define _S29C3 0x20
3685 #define _S30C3 0x40
3686 #define _S31C3 0x80
3688 //==============================================================================
3691 //==============================================================================
3692 // LCDDATA22 Bits
3694 extern __at(0x0F7C) __sfr LCDDATA22;
3696 typedef struct
3698 unsigned S32C3 : 1;
3699 unsigned : 1;
3700 unsigned : 1;
3701 unsigned : 1;
3702 unsigned : 1;
3703 unsigned : 1;
3704 unsigned : 1;
3705 unsigned : 1;
3706 } __LCDDATA22bits_t;
3708 extern __at(0x0F7C) volatile __LCDDATA22bits_t LCDDATA22bits;
3710 #define _S32C3 0x01
3712 //==============================================================================
3714 extern __at(0x0F7E) __sfr EECON2;
3716 //==============================================================================
3717 // EECON1 Bits
3719 extern __at(0x0F7F) __sfr EECON1;
3721 typedef struct
3723 unsigned RD : 1;
3724 unsigned WR : 1;
3725 unsigned WREN : 1;
3726 unsigned WRERR : 1;
3727 unsigned FREE : 1;
3728 unsigned : 1;
3729 unsigned CFGS : 1;
3730 unsigned EEPGD : 1;
3731 } __EECON1bits_t;
3733 extern __at(0x0F7F) volatile __EECON1bits_t EECON1bits;
3735 #define _RD 0x01
3736 #define _WR 0x02
3737 #define _WREN 0x04
3738 #define _WRERR 0x08
3739 #define _FREE 0x10
3740 #define _CFGS 0x40
3741 #define _EEPGD 0x80
3743 //==============================================================================
3746 //==============================================================================
3747 // PORTA Bits
3749 extern __at(0x0F80) __sfr PORTA;
3751 typedef union
3753 struct
3755 unsigned RA0 : 1;
3756 unsigned RA1 : 1;
3757 unsigned RA2 : 1;
3758 unsigned RA3 : 1;
3759 unsigned RA4 : 1;
3760 unsigned RA5 : 1;
3761 unsigned RA6 : 1;
3762 unsigned RA7 : 1;
3765 struct
3767 unsigned AN0 : 1;
3768 unsigned AN1 : 1;
3769 unsigned AN2 : 1;
3770 unsigned AN3 : 1;
3771 unsigned SEG14 : 1;
3772 unsigned AN4 : 1;
3773 unsigned OSC2 : 1;
3774 unsigned OSC1 : 1;
3777 struct
3779 unsigned ULPWUIN : 1;
3780 unsigned SEG18 : 1;
3781 unsigned VREF_MINUS : 1;
3782 unsigned VREF_PLUS : 1;
3783 unsigned T0CKI : 1;
3784 unsigned SEG15 : 1;
3785 unsigned CLKO : 1;
3786 unsigned CLKI : 1;
3789 struct
3791 unsigned : 1;
3792 unsigned : 1;
3793 unsigned : 1;
3794 unsigned : 1;
3795 unsigned : 1;
3796 unsigned T1CKI : 1;
3797 unsigned : 1;
3798 unsigned : 1;
3801 struct
3803 unsigned : 1;
3804 unsigned : 1;
3805 unsigned : 1;
3806 unsigned : 1;
3807 unsigned : 1;
3808 unsigned T3G : 1;
3809 unsigned : 1;
3810 unsigned : 1;
3813 struct
3815 unsigned : 1;
3816 unsigned : 1;
3817 unsigned : 1;
3818 unsigned : 1;
3819 unsigned : 1;
3820 unsigned LVDIN : 1;
3821 unsigned : 1;
3822 unsigned : 1;
3824 } __PORTAbits_t;
3826 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
3828 #define _RA0 0x01
3829 #define _AN0 0x01
3830 #define _ULPWUIN 0x01
3831 #define _RA1 0x02
3832 #define _AN1 0x02
3833 #define _SEG18 0x02
3834 #define _RA2 0x04
3835 #define _AN2 0x04
3836 #define _VREF_MINUS 0x04
3837 #define _RA3 0x08
3838 #define _AN3 0x08
3839 #define _VREF_PLUS 0x08
3840 #define _RA4 0x10
3841 #define _SEG14 0x10
3842 #define _T0CKI 0x10
3843 #define _RA5 0x20
3844 #define _AN4 0x20
3845 #define _SEG15 0x20
3846 #define _T1CKI 0x20
3847 #define _T3G 0x20
3848 #define _LVDIN 0x20
3849 #define _RA6 0x40
3850 #define _OSC2 0x40
3851 #define _CLKO 0x40
3852 #define _RA7 0x80
3853 #define _OSC1 0x80
3854 #define _CLKI 0x80
3856 //==============================================================================
3859 //==============================================================================
3860 // PORTB Bits
3862 extern __at(0x0F81) __sfr PORTB;
3864 typedef union
3866 struct
3868 unsigned RB0 : 1;
3869 unsigned RB1 : 1;
3870 unsigned RB2 : 1;
3871 unsigned RB3 : 1;
3872 unsigned RB4 : 1;
3873 unsigned RB5 : 1;
3874 unsigned RB6 : 1;
3875 unsigned RB7 : 1;
3878 struct
3880 unsigned INT0 : 1;
3881 unsigned INT1 : 1;
3882 unsigned INT2 : 1;
3883 unsigned INT3 : 1;
3884 unsigned KBI0 : 1;
3885 unsigned KBI1 : 1;
3886 unsigned KBI2 : 1;
3887 unsigned KBI3 : 1;
3890 struct
3892 unsigned SEG30 : 1;
3893 unsigned SEG8 : 1;
3894 unsigned SEG9 : 1;
3895 unsigned SEG10 : 1;
3896 unsigned SEG11 : 1;
3897 unsigned SEG29 : 1;
3898 unsigned PGC : 1;
3899 unsigned PGD : 1;
3902 struct
3904 unsigned FLT0 : 1;
3905 unsigned : 1;
3906 unsigned CTED1 : 1;
3907 unsigned CTED2 : 1;
3908 unsigned : 1;
3909 unsigned T3CKI : 1;
3910 unsigned : 1;
3911 unsigned : 1;
3914 struct
3916 unsigned : 1;
3917 unsigned : 1;
3918 unsigned : 1;
3919 unsigned CCP2_PA2 : 1;
3920 unsigned : 1;
3921 unsigned T1G : 1;
3922 unsigned : 1;
3923 unsigned : 1;
3926 struct
3928 unsigned : 1;
3929 unsigned : 1;
3930 unsigned : 1;
3931 unsigned : 1;
3932 unsigned : 1;
3933 unsigned PGM : 1;
3934 unsigned : 1;
3935 unsigned : 1;
3938 struct
3940 unsigned INT : 4;
3941 unsigned : 4;
3944 struct
3946 unsigned : 4;
3947 unsigned KBI : 4;
3949 } __PORTBbits_t;
3951 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
3953 #define _RB0 0x01
3954 #define _INT0 0x01
3955 #define _SEG30 0x01
3956 #define _FLT0 0x01
3957 #define _RB1 0x02
3958 #define _INT1 0x02
3959 #define _SEG8 0x02
3960 #define _RB2 0x04
3961 #define _INT2 0x04
3962 #define _SEG9 0x04
3963 #define _CTED1 0x04
3964 #define _RB3 0x08
3965 #define _INT3 0x08
3966 #define _SEG10 0x08
3967 #define _CTED2 0x08
3968 #define _CCP2_PA2 0x08
3969 #define _RB4 0x10
3970 #define _KBI0 0x10
3971 #define _SEG11 0x10
3972 #define _RB5 0x20
3973 #define _KBI1 0x20
3974 #define _SEG29 0x20
3975 #define _T3CKI 0x20
3976 #define _T1G 0x20
3977 #define _PGM 0x20
3978 #define _RB6 0x40
3979 #define _KBI2 0x40
3980 #define _PGC 0x40
3981 #define _RB7 0x80
3982 #define _KBI3 0x80
3983 #define _PGD 0x80
3985 //==============================================================================
3988 //==============================================================================
3989 // PORTC Bits
3991 extern __at(0x0F82) __sfr PORTC;
3993 typedef union
3995 struct
3997 unsigned RC0 : 1;
3998 unsigned RC1 : 1;
3999 unsigned RC2 : 1;
4000 unsigned RC3 : 1;
4001 unsigned RC4 : 1;
4002 unsigned RC5 : 1;
4003 unsigned RC6 : 1;
4004 unsigned RC7 : 1;
4007 struct
4009 unsigned SOSCO : 1;
4010 unsigned SEG32 : 1;
4011 unsigned SEG13 : 1;
4012 unsigned SEG17 : 1;
4013 unsigned SEG16 : 1;
4014 unsigned SEG12 : 1;
4015 unsigned SEG27 : 1;
4016 unsigned SEG28 : 1;
4019 struct
4021 unsigned SCKLI : 1;
4022 unsigned SOSCI : 1;
4023 unsigned CCP1 : 1;
4024 unsigned SCK1 : 1;
4025 unsigned SDI1 : 1;
4026 unsigned SDO1 : 1;
4027 unsigned TX1 : 1;
4028 unsigned RX1 : 1;
4031 struct
4033 unsigned : 1;
4034 unsigned CCP2 : 1;
4035 unsigned PA1 : 1;
4036 unsigned SCL1 : 1;
4037 unsigned SDA1 : 1;
4038 unsigned : 1;
4039 unsigned CK1 : 1;
4040 unsigned DT1 : 1;
4043 struct
4045 unsigned : 1;
4046 unsigned PA2 : 1;
4047 unsigned : 1;
4048 unsigned : 1;
4049 unsigned : 1;
4050 unsigned : 1;
4051 unsigned : 1;
4052 unsigned : 1;
4054 } __PORTCbits_t;
4056 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
4058 #define _RC0 0x01
4059 #define _SOSCO 0x01
4060 #define _SCKLI 0x01
4061 #define _RC1 0x02
4062 #define _SEG32 0x02
4063 #define _SOSCI 0x02
4064 #define _CCP2 0x02
4065 #define _PA2 0x02
4066 #define _RC2 0x04
4067 #define _SEG13 0x04
4068 #define _CCP1 0x04
4069 #define _PA1 0x04
4070 #define _RC3 0x08
4071 #define _SEG17 0x08
4072 #define _SCK1 0x08
4073 #define _SCL1 0x08
4074 #define _RC4 0x10
4075 #define _SEG16 0x10
4076 #define _SDI1 0x10
4077 #define _SDA1 0x10
4078 #define _RC5 0x20
4079 #define _SEG12 0x20
4080 #define _SDO1 0x20
4081 #define _RC6 0x40
4082 #define _SEG27 0x40
4083 #define _TX1 0x40
4084 #define _CK1 0x40
4085 #define _RC7 0x80
4086 #define _SEG28 0x80
4087 #define _RX1 0x80
4088 #define _DT1 0x80
4090 //==============================================================================
4093 //==============================================================================
4094 // PORTD Bits
4096 extern __at(0x0F83) __sfr PORTD;
4098 typedef union
4100 struct
4102 unsigned RD0 : 1;
4103 unsigned RD1 : 1;
4104 unsigned RD2 : 1;
4105 unsigned RD3 : 1;
4106 unsigned RD4 : 1;
4107 unsigned RD5 : 1;
4108 unsigned RD6 : 1;
4109 unsigned RD7 : 1;
4112 struct
4114 unsigned AD0 : 1;
4115 unsigned AD1 : 1;
4116 unsigned AD2 : 1;
4117 unsigned AD3 : 1;
4118 unsigned AD4 : 1;
4119 unsigned AD5 : 1;
4120 unsigned AD6 : 1;
4121 unsigned AD7 : 1;
4124 struct
4126 unsigned PSP0 : 1;
4127 unsigned PSP1 : 1;
4128 unsigned PSP2 : 1;
4129 unsigned PSP3 : 1;
4130 unsigned PSP4 : 1;
4131 unsigned PSP5 : 1;
4132 unsigned PSP6 : 1;
4133 unsigned PSP7 : 1;
4136 struct
4138 unsigned SEG0 : 1;
4139 unsigned SEG1 : 1;
4140 unsigned SEG2 : 1;
4141 unsigned SEG3 : 1;
4142 unsigned SEG4 : 1;
4143 unsigned SEG5 : 1;
4144 unsigned SEG6 : 1;
4145 unsigned SEG7 : 1;
4148 struct
4150 unsigned CTPLS : 1;
4151 unsigned T5CKI : 1;
4152 unsigned : 1;
4153 unsigned : 1;
4154 unsigned SDO2 : 1;
4155 unsigned SDI2 : 1;
4156 unsigned SCK2 : 1;
4157 unsigned SS2 : 1;
4160 struct
4162 unsigned : 1;
4163 unsigned T7G : 1;
4164 unsigned : 1;
4165 unsigned : 1;
4166 unsigned : 1;
4167 unsigned SDA2 : 1;
4168 unsigned SCL2 : 1;
4169 unsigned : 1;
4171 } __PORTDbits_t;
4173 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
4175 #define _RD0 0x01
4176 #define _AD0 0x01
4177 #define _PSP0 0x01
4178 #define _SEG0 0x01
4179 #define _CTPLS 0x01
4180 #define _RD1 0x02
4181 #define _AD1 0x02
4182 #define _PSP1 0x02
4183 #define _SEG1 0x02
4184 #define _T5CKI 0x02
4185 #define _T7G 0x02
4186 #define _RD2 0x04
4187 #define _AD2 0x04
4188 #define _PSP2 0x04
4189 #define _SEG2 0x04
4190 #define _RD3 0x08
4191 #define _AD3 0x08
4192 #define _PSP3 0x08
4193 #define _SEG3 0x08
4194 #define _RD4 0x10
4195 #define _AD4 0x10
4196 #define _PSP4 0x10
4197 #define _SEG4 0x10
4198 #define _SDO2 0x10
4199 #define _RD5 0x20
4200 #define _AD5 0x20
4201 #define _PSP5 0x20
4202 #define _SEG5 0x20
4203 #define _SDI2 0x20
4204 #define _SDA2 0x20
4205 #define _RD6 0x40
4206 #define _AD6 0x40
4207 #define _PSP6 0x40
4208 #define _SEG6 0x40
4209 #define _SCK2 0x40
4210 #define _SCL2 0x40
4211 #define _RD7 0x80
4212 #define _AD7 0x80
4213 #define _PSP7 0x80
4214 #define _SEG7 0x80
4215 #define _SS2 0x80
4217 //==============================================================================
4220 //==============================================================================
4221 // PORTE Bits
4223 extern __at(0x0F84) __sfr PORTE;
4225 typedef union
4227 struct
4229 unsigned RE0 : 1;
4230 unsigned RE1 : 1;
4231 unsigned RE2 : 1;
4232 unsigned RE3 : 1;
4233 unsigned RE4 : 1;
4234 unsigned RE5 : 1;
4235 unsigned RE6 : 1;
4236 unsigned RE7 : 1;
4239 struct
4241 unsigned AD8 : 1;
4242 unsigned AD9 : 1;
4243 unsigned AD10 : 1;
4244 unsigned AD11 : 1;
4245 unsigned AD12 : 1;
4246 unsigned AD13 : 1;
4247 unsigned AD14 : 1;
4248 unsigned AD15 : 1;
4251 struct
4253 unsigned PD2 : 1;
4254 unsigned PC2 : 1;
4255 unsigned PB2 : 1;
4256 unsigned PC3 : 1;
4257 unsigned PB3 : 1;
4258 unsigned PC1 : 1;
4259 unsigned PB1 : 1;
4260 unsigned PA2 : 1;
4263 struct
4265 unsigned RD : 1;
4266 unsigned WR : 1;
4267 unsigned CCP10 : 1;
4268 unsigned CCP9 : 1;
4269 unsigned CCP8 : 1;
4270 unsigned CCP7 : 1;
4271 unsigned CCP6 : 1;
4272 unsigned CCP2 : 1;
4275 struct
4277 unsigned LCDBIAS1 : 1;
4278 unsigned LCDBIAS2 : 1;
4279 unsigned CS : 1;
4280 unsigned COM0 : 1;
4281 unsigned COM1 : 1;
4282 unsigned COM2 : 1;
4283 unsigned COM3 : 1;
4284 unsigned SEG31 : 1;
4287 struct
4289 unsigned : 1;
4290 unsigned : 1;
4291 unsigned LCDBIAS3 : 1;
4292 unsigned : 1;
4293 unsigned REFO : 1;
4294 unsigned : 1;
4295 unsigned : 1;
4296 unsigned : 1;
4299 struct
4301 unsigned : 3;
4302 unsigned COM : 4;
4303 unsigned : 1;
4305 } __PORTEbits_t;
4307 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
4309 #define _PORTE_RE0 0x01
4310 #define _PORTE_AD8 0x01
4311 #define _PORTE_PD2 0x01
4312 #define _PORTE_RD 0x01
4313 #define _PORTE_LCDBIAS1 0x01
4314 #define _PORTE_RE1 0x02
4315 #define _PORTE_AD9 0x02
4316 #define _PORTE_PC2 0x02
4317 #define _PORTE_WR 0x02
4318 #define _PORTE_LCDBIAS2 0x02
4319 #define _PORTE_RE2 0x04
4320 #define _PORTE_AD10 0x04
4321 #define _PORTE_PB2 0x04
4322 #define _PORTE_CCP10 0x04
4323 #define _PORTE_CS 0x04
4324 #define _PORTE_LCDBIAS3 0x04
4325 #define _PORTE_RE3 0x08
4326 #define _PORTE_AD11 0x08
4327 #define _PORTE_PC3 0x08
4328 #define _PORTE_CCP9 0x08
4329 #define _PORTE_COM0 0x08
4330 #define _PORTE_RE4 0x10
4331 #define _PORTE_AD12 0x10
4332 #define _PORTE_PB3 0x10
4333 #define _PORTE_CCP8 0x10
4334 #define _PORTE_COM1 0x10
4335 #define _PORTE_REFO 0x10
4336 #define _PORTE_RE5 0x20
4337 #define _PORTE_AD13 0x20
4338 #define _PORTE_PC1 0x20
4339 #define _PORTE_CCP7 0x20
4340 #define _PORTE_COM2 0x20
4341 #define _PORTE_RE6 0x40
4342 #define _PORTE_AD14 0x40
4343 #define _PORTE_PB1 0x40
4344 #define _PORTE_CCP6 0x40
4345 #define _PORTE_COM3 0x40
4346 #define _PORTE_RE7 0x80
4347 #define _PORTE_AD15 0x80
4348 #define _PORTE_PA2 0x80
4349 #define _PORTE_CCP2 0x80
4350 #define _PORTE_SEG31 0x80
4352 //==============================================================================
4355 //==============================================================================
4356 // PORTF Bits
4358 extern __at(0x0F85) __sfr PORTF;
4360 typedef union
4362 struct
4364 unsigned : 1;
4365 unsigned RF1 : 1;
4366 unsigned RF2 : 1;
4367 unsigned RF3 : 1;
4368 unsigned RF4 : 1;
4369 unsigned RF5 : 1;
4370 unsigned RF6 : 1;
4371 unsigned RF7 : 1;
4374 struct
4376 unsigned : 1;
4377 unsigned AN6 : 1;
4378 unsigned AN7 : 1;
4379 unsigned AN8 : 1;
4380 unsigned AN9 : 1;
4381 unsigned AN10 : 1;
4382 unsigned AN11 : 1;
4383 unsigned AN5 : 1;
4386 struct
4388 unsigned : 1;
4389 unsigned SEG19 : 1;
4390 unsigned SEG20 : 1;
4391 unsigned SEG21 : 1;
4392 unsigned SEG22 : 1;
4393 unsigned SEG23 : 1;
4394 unsigned SEG24 : 1;
4395 unsigned SEG25 : 1;
4398 struct
4400 unsigned : 1;
4401 unsigned C2OUT : 1;
4402 unsigned C1OUT : 1;
4403 unsigned C2INB : 1;
4404 unsigned C2INA : 1;
4405 unsigned C1INB : 1;
4406 unsigned C1INA : 1;
4407 unsigned SS1 : 1;
4410 struct
4412 unsigned : 1;
4413 unsigned CTDIN : 1;
4414 unsigned : 1;
4415 unsigned CTMUI : 1;
4416 unsigned : 1;
4417 unsigned CVREF : 1;
4418 unsigned : 1;
4419 unsigned : 1;
4421 } __PORTFbits_t;
4423 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
4425 #define _PORTF_RF1 0x02
4426 #define _PORTF_AN6 0x02
4427 #define _PORTF_SEG19 0x02
4428 #define _PORTF_C2OUT 0x02
4429 #define _PORTF_CTDIN 0x02
4430 #define _PORTF_RF2 0x04
4431 #define _PORTF_AN7 0x04
4432 #define _PORTF_SEG20 0x04
4433 #define _PORTF_C1OUT 0x04
4434 #define _PORTF_RF3 0x08
4435 #define _PORTF_AN8 0x08
4436 #define _PORTF_SEG21 0x08
4437 #define _PORTF_C2INB 0x08
4438 #define _PORTF_CTMUI 0x08
4439 #define _PORTF_RF4 0x10
4440 #define _PORTF_AN9 0x10
4441 #define _PORTF_SEG22 0x10
4442 #define _PORTF_C2INA 0x10
4443 #define _PORTF_RF5 0x20
4444 #define _PORTF_AN10 0x20
4445 #define _PORTF_SEG23 0x20
4446 #define _PORTF_C1INB 0x20
4447 #define _PORTF_CVREF 0x20
4448 #define _PORTF_RF6 0x40
4449 #define _PORTF_AN11 0x40
4450 #define _PORTF_SEG24 0x40
4451 #define _PORTF_C1INA 0x40
4452 #define _PORTF_RF7 0x80
4453 #define _PORTF_AN5 0x80
4454 #define _PORTF_SEG25 0x80
4455 #define _PORTF_SS1 0x80
4457 //==============================================================================
4460 //==============================================================================
4461 // PORTG Bits
4463 extern __at(0x0F86) __sfr PORTG;
4465 typedef union
4467 struct
4469 unsigned RG0 : 1;
4470 unsigned RG1 : 1;
4471 unsigned RG2 : 1;
4472 unsigned RG3 : 1;
4473 unsigned RG4 : 1;
4474 unsigned RG5 : 1;
4475 unsigned : 1;
4476 unsigned : 1;
4479 struct
4481 unsigned CCP3 : 1;
4482 unsigned C3OUT : 1;
4483 unsigned C3INA : 1;
4484 unsigned C3INB : 1;
4485 unsigned C3INC : 1;
4486 unsigned : 1;
4487 unsigned : 1;
4488 unsigned : 1;
4491 struct
4493 unsigned PA3 : 1;
4494 unsigned TX2 : 1;
4495 unsigned RX2 : 1;
4496 unsigned PD3 : 1;
4497 unsigned PD1 : 1;
4498 unsigned : 1;
4499 unsigned : 1;
4500 unsigned : 1;
4503 struct
4505 unsigned : 1;
4506 unsigned AN19 : 1;
4507 unsigned AN18 : 1;
4508 unsigned AN17 : 1;
4509 unsigned AN16 : 1;
4510 unsigned : 1;
4511 unsigned : 1;
4512 unsigned : 1;
4515 struct
4517 unsigned : 1;
4518 unsigned CK2 : 1;
4519 unsigned DT2 : 1;
4520 unsigned CCP4 : 1;
4521 unsigned CCP5 : 1;
4522 unsigned : 1;
4523 unsigned : 1;
4524 unsigned : 1;
4527 struct
4529 unsigned : 1;
4530 unsigned : 1;
4531 unsigned : 1;
4532 unsigned : 1;
4533 unsigned SEG26 : 1;
4534 unsigned : 1;
4535 unsigned : 1;
4536 unsigned : 1;
4539 struct
4541 unsigned : 1;
4542 unsigned : 1;
4543 unsigned : 1;
4544 unsigned : 1;
4545 unsigned T7CKI : 1;
4546 unsigned : 1;
4547 unsigned : 1;
4548 unsigned : 1;
4551 struct
4553 unsigned : 1;
4554 unsigned : 1;
4555 unsigned : 1;
4556 unsigned : 1;
4557 unsigned T5G : 1;
4558 unsigned : 1;
4559 unsigned : 1;
4560 unsigned : 1;
4563 struct
4565 unsigned : 1;
4566 unsigned : 1;
4567 unsigned : 1;
4568 unsigned : 1;
4569 unsigned RTCC : 1;
4570 unsigned : 1;
4571 unsigned : 1;
4572 unsigned : 1;
4575 struct
4577 unsigned RG : 6;
4578 unsigned : 2;
4580 } __PORTGbits_t;
4582 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
4584 #define _PORTG_RG0 0x01
4585 #define _PORTG_CCP3 0x01
4586 #define _PORTG_PA3 0x01
4587 #define _PORTG_RG1 0x02
4588 #define _PORTG_C3OUT 0x02
4589 #define _PORTG_TX2 0x02
4590 #define _PORTG_AN19 0x02
4591 #define _PORTG_CK2 0x02
4592 #define _PORTG_RG2 0x04
4593 #define _PORTG_C3INA 0x04
4594 #define _PORTG_RX2 0x04
4595 #define _PORTG_AN18 0x04
4596 #define _PORTG_DT2 0x04
4597 #define _PORTG_RG3 0x08
4598 #define _PORTG_C3INB 0x08
4599 #define _PORTG_PD3 0x08
4600 #define _PORTG_AN17 0x08
4601 #define _PORTG_CCP4 0x08
4602 #define _PORTG_RG4 0x10
4603 #define _PORTG_C3INC 0x10
4604 #define _PORTG_PD1 0x10
4605 #define _PORTG_AN16 0x10
4606 #define _PORTG_CCP5 0x10
4607 #define _PORTG_SEG26 0x10
4608 #define _PORTG_T7CKI 0x10
4609 #define _PORTG_T5G 0x10
4610 #define _PORTG_RTCC 0x10
4611 #define _PORTG_RG5 0x20
4613 //==============================================================================
4616 //==============================================================================
4617 // LATA Bits
4619 extern __at(0x0F89) __sfr LATA;
4621 typedef struct
4623 unsigned LATA0 : 1;
4624 unsigned LATA1 : 1;
4625 unsigned LATA2 : 1;
4626 unsigned LATA3 : 1;
4627 unsigned LATA4 : 1;
4628 unsigned LATA5 : 1;
4629 unsigned LATA6 : 1;
4630 unsigned LATA7 : 1;
4631 } __LATAbits_t;
4633 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
4635 #define _LATA0 0x01
4636 #define _LATA1 0x02
4637 #define _LATA2 0x04
4638 #define _LATA3 0x08
4639 #define _LATA4 0x10
4640 #define _LATA5 0x20
4641 #define _LATA6 0x40
4642 #define _LATA7 0x80
4644 //==============================================================================
4647 //==============================================================================
4648 // LATB Bits
4650 extern __at(0x0F8A) __sfr LATB;
4652 typedef struct
4654 unsigned LATB0 : 1;
4655 unsigned LATB1 : 1;
4656 unsigned LATB2 : 1;
4657 unsigned LATB3 : 1;
4658 unsigned LATB4 : 1;
4659 unsigned LATB5 : 1;
4660 unsigned LATB6 : 1;
4661 unsigned LATB7 : 1;
4662 } __LATBbits_t;
4664 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
4666 #define _LATB0 0x01
4667 #define _LATB1 0x02
4668 #define _LATB2 0x04
4669 #define _LATB3 0x08
4670 #define _LATB4 0x10
4671 #define _LATB5 0x20
4672 #define _LATB6 0x40
4673 #define _LATB7 0x80
4675 //==============================================================================
4678 //==============================================================================
4679 // LATC Bits
4681 extern __at(0x0F8B) __sfr LATC;
4683 typedef struct
4685 unsigned LATC0 : 1;
4686 unsigned LATC1 : 1;
4687 unsigned LATC2 : 1;
4688 unsigned LATC3 : 1;
4689 unsigned LATC4 : 1;
4690 unsigned LATC5 : 1;
4691 unsigned LATC6 : 1;
4692 unsigned LATC7 : 1;
4693 } __LATCbits_t;
4695 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
4697 #define _LATC0 0x01
4698 #define _LATC1 0x02
4699 #define _LATC2 0x04
4700 #define _LATC3 0x08
4701 #define _LATC4 0x10
4702 #define _LATC5 0x20
4703 #define _LATC6 0x40
4704 #define _LATC7 0x80
4706 //==============================================================================
4709 //==============================================================================
4710 // LATD Bits
4712 extern __at(0x0F8C) __sfr LATD;
4714 typedef struct
4716 unsigned LATD0 : 1;
4717 unsigned LATD1 : 1;
4718 unsigned LATD2 : 1;
4719 unsigned LATD3 : 1;
4720 unsigned LATD4 : 1;
4721 unsigned LATD5 : 1;
4722 unsigned LATD6 : 1;
4723 unsigned LATD7 : 1;
4724 } __LATDbits_t;
4726 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
4728 #define _LATD0 0x01
4729 #define _LATD1 0x02
4730 #define _LATD2 0x04
4731 #define _LATD3 0x08
4732 #define _LATD4 0x10
4733 #define _LATD5 0x20
4734 #define _LATD6 0x40
4735 #define _LATD7 0x80
4737 //==============================================================================
4740 //==============================================================================
4741 // LATE Bits
4743 extern __at(0x0F8D) __sfr LATE;
4745 typedef struct
4747 unsigned LATE0 : 1;
4748 unsigned LATE1 : 1;
4749 unsigned LATE2 : 1;
4750 unsigned LATE3 : 1;
4751 unsigned LATE4 : 1;
4752 unsigned LATE5 : 1;
4753 unsigned LATE6 : 1;
4754 unsigned LATE7 : 1;
4755 } __LATEbits_t;
4757 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
4759 #define _LATE0 0x01
4760 #define _LATE1 0x02
4761 #define _LATE2 0x04
4762 #define _LATE3 0x08
4763 #define _LATE4 0x10
4764 #define _LATE5 0x20
4765 #define _LATE6 0x40
4766 #define _LATE7 0x80
4768 //==============================================================================
4771 //==============================================================================
4772 // LATF Bits
4774 extern __at(0x0F8E) __sfr LATF;
4776 typedef struct
4778 unsigned : 1;
4779 unsigned LATF1 : 1;
4780 unsigned LATF2 : 1;
4781 unsigned LATF3 : 1;
4782 unsigned LATF4 : 1;
4783 unsigned LATF5 : 1;
4784 unsigned LATF6 : 1;
4785 unsigned LATF7 : 1;
4786 } __LATFbits_t;
4788 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
4790 #define _LATF1 0x02
4791 #define _LATF2 0x04
4792 #define _LATF3 0x08
4793 #define _LATF4 0x10
4794 #define _LATF5 0x20
4795 #define _LATF6 0x40
4796 #define _LATF7 0x80
4798 //==============================================================================
4801 //==============================================================================
4802 // LATG Bits
4804 extern __at(0x0F8F) __sfr LATG;
4806 typedef union
4808 struct
4810 unsigned LATG0 : 1;
4811 unsigned LATG1 : 1;
4812 unsigned LATG2 : 1;
4813 unsigned LATG3 : 1;
4814 unsigned LATG4 : 1;
4815 unsigned : 1;
4816 unsigned : 1;
4817 unsigned : 1;
4820 struct
4822 unsigned LATG : 5;
4823 unsigned : 3;
4825 } __LATGbits_t;
4827 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
4829 #define _LATG0 0x01
4830 #define _LATG1 0x02
4831 #define _LATG2 0x04
4832 #define _LATG3 0x08
4833 #define _LATG4 0x10
4835 //==============================================================================
4838 //==============================================================================
4839 // TRISA Bits
4841 extern __at(0x0F92) __sfr TRISA;
4843 typedef struct
4845 unsigned TRISA0 : 1;
4846 unsigned TRISA1 : 1;
4847 unsigned TRISA2 : 1;
4848 unsigned TRISA3 : 1;
4849 unsigned TRISA4 : 1;
4850 unsigned TRISA5 : 1;
4851 unsigned TRISA6 : 1;
4852 unsigned TRISA7 : 1;
4853 } __TRISAbits_t;
4855 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
4857 #define _TRISA0 0x01
4858 #define _TRISA1 0x02
4859 #define _TRISA2 0x04
4860 #define _TRISA3 0x08
4861 #define _TRISA4 0x10
4862 #define _TRISA5 0x20
4863 #define _TRISA6 0x40
4864 #define _TRISA7 0x80
4866 //==============================================================================
4869 //==============================================================================
4870 // TRISB Bits
4872 extern __at(0x0F93) __sfr TRISB;
4874 typedef struct
4876 unsigned TRISB0 : 1;
4877 unsigned TRISB1 : 1;
4878 unsigned TRISB2 : 1;
4879 unsigned TRISB3 : 1;
4880 unsigned TRISB4 : 1;
4881 unsigned TRISB5 : 1;
4882 unsigned TRISB6 : 1;
4883 unsigned TRISB7 : 1;
4884 } __TRISBbits_t;
4886 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
4888 #define _TRISB0 0x01
4889 #define _TRISB1 0x02
4890 #define _TRISB2 0x04
4891 #define _TRISB3 0x08
4892 #define _TRISB4 0x10
4893 #define _TRISB5 0x20
4894 #define _TRISB6 0x40
4895 #define _TRISB7 0x80
4897 //==============================================================================
4900 //==============================================================================
4901 // TRISC Bits
4903 extern __at(0x0F94) __sfr TRISC;
4905 typedef struct
4907 unsigned TRISC0 : 1;
4908 unsigned TRISC1 : 1;
4909 unsigned TRISC2 : 1;
4910 unsigned TRISC3 : 1;
4911 unsigned TRISC4 : 1;
4912 unsigned TRISC5 : 1;
4913 unsigned TRISC6 : 1;
4914 unsigned TRISC7 : 1;
4915 } __TRISCbits_t;
4917 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
4919 #define _TRISC0 0x01
4920 #define _TRISC1 0x02
4921 #define _TRISC2 0x04
4922 #define _TRISC3 0x08
4923 #define _TRISC4 0x10
4924 #define _TRISC5 0x20
4925 #define _TRISC6 0x40
4926 #define _TRISC7 0x80
4928 //==============================================================================
4931 //==============================================================================
4932 // TRISD Bits
4934 extern __at(0x0F95) __sfr TRISD;
4936 typedef struct
4938 unsigned TRISD0 : 1;
4939 unsigned TRISD1 : 1;
4940 unsigned TRISD2 : 1;
4941 unsigned TRISD3 : 1;
4942 unsigned TRISD4 : 1;
4943 unsigned TRISD5 : 1;
4944 unsigned TRISD6 : 1;
4945 unsigned TRISD7 : 1;
4946 } __TRISDbits_t;
4948 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
4950 #define _TRISD0 0x01
4951 #define _TRISD1 0x02
4952 #define _TRISD2 0x04
4953 #define _TRISD3 0x08
4954 #define _TRISD4 0x10
4955 #define _TRISD5 0x20
4956 #define _TRISD6 0x40
4957 #define _TRISD7 0x80
4959 //==============================================================================
4962 //==============================================================================
4963 // TRISE Bits
4965 extern __at(0x0F96) __sfr TRISE;
4967 typedef struct
4969 unsigned TRISE0 : 1;
4970 unsigned TRISE1 : 1;
4971 unsigned TRISE2 : 1;
4972 unsigned TRISE3 : 1;
4973 unsigned TRISE4 : 1;
4974 unsigned TRISE5 : 1;
4975 unsigned TRISE6 : 1;
4976 unsigned TRISE7 : 1;
4977 } __TRISEbits_t;
4979 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
4981 #define _TRISE0 0x01
4982 #define _TRISE1 0x02
4983 #define _TRISE2 0x04
4984 #define _TRISE3 0x08
4985 #define _TRISE4 0x10
4986 #define _TRISE5 0x20
4987 #define _TRISE6 0x40
4988 #define _TRISE7 0x80
4990 //==============================================================================
4993 //==============================================================================
4994 // TRISF Bits
4996 extern __at(0x0F97) __sfr TRISF;
4998 typedef struct
5000 unsigned : 1;
5001 unsigned TRISF1 : 1;
5002 unsigned TRISF2 : 1;
5003 unsigned TRISF3 : 1;
5004 unsigned TRISF4 : 1;
5005 unsigned TRISF5 : 1;
5006 unsigned TRISF6 : 1;
5007 unsigned TRISF7 : 1;
5008 } __TRISFbits_t;
5010 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
5012 #define _TRISF1 0x02
5013 #define _TRISF2 0x04
5014 #define _TRISF3 0x08
5015 #define _TRISF4 0x10
5016 #define _TRISF5 0x20
5017 #define _TRISF6 0x40
5018 #define _TRISF7 0x80
5020 //==============================================================================
5023 //==============================================================================
5024 // TRISG Bits
5026 extern __at(0x0F98) __sfr TRISG;
5028 typedef union
5030 struct
5032 unsigned TRISG0 : 1;
5033 unsigned TRISG1 : 1;
5034 unsigned TRISG2 : 1;
5035 unsigned TRISG3 : 1;
5036 unsigned TRISG4 : 1;
5037 unsigned : 1;
5038 unsigned : 1;
5039 unsigned : 1;
5042 struct
5044 unsigned TRISG : 5;
5045 unsigned : 3;
5047 } __TRISGbits_t;
5049 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
5051 #define _TRISG0 0x01
5052 #define _TRISG1 0x02
5053 #define _TRISG2 0x04
5054 #define _TRISG3 0x08
5055 #define _TRISG4 0x10
5057 //==============================================================================
5060 //==============================================================================
5061 // OSCTUNE Bits
5063 extern __at(0x0F9B) __sfr OSCTUNE;
5065 typedef union
5067 struct
5069 unsigned TUN0 : 1;
5070 unsigned TUN1 : 1;
5071 unsigned TUN2 : 1;
5072 unsigned TUN3 : 1;
5073 unsigned TUN4 : 1;
5074 unsigned TUN5 : 1;
5075 unsigned PLLEN : 1;
5076 unsigned INTSRC : 1;
5079 struct
5081 unsigned TUN : 6;
5082 unsigned : 2;
5084 } __OSCTUNEbits_t;
5086 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
5088 #define _TUN0 0x01
5089 #define _TUN1 0x02
5090 #define _TUN2 0x04
5091 #define _TUN3 0x08
5092 #define _TUN4 0x10
5093 #define _TUN5 0x20
5094 #define _PLLEN 0x40
5095 #define _INTSRC 0x80
5097 //==============================================================================
5100 //==============================================================================
5101 // PSTR1CON Bits
5103 extern __at(0x0F9C) __sfr PSTR1CON;
5105 typedef union
5107 struct
5109 unsigned STRA : 1;
5110 unsigned STRB : 1;
5111 unsigned STRC : 1;
5112 unsigned STRD : 1;
5113 unsigned STRSYNC : 1;
5114 unsigned : 1;
5115 unsigned CMPL0 : 1;
5116 unsigned CMPL1 : 1;
5119 struct
5121 unsigned : 6;
5122 unsigned CMPL : 2;
5124 } __PSTR1CONbits_t;
5126 extern __at(0x0F9C) volatile __PSTR1CONbits_t PSTR1CONbits;
5128 #define _STRA 0x01
5129 #define _STRB 0x02
5130 #define _STRC 0x04
5131 #define _STRD 0x08
5132 #define _STRSYNC 0x10
5133 #define _CMPL0 0x40
5134 #define _CMPL1 0x80
5136 //==============================================================================
5139 //==============================================================================
5140 // PIE1 Bits
5142 extern __at(0x0F9D) __sfr PIE1;
5144 typedef union
5146 struct
5148 unsigned TMR1IE : 1;
5149 unsigned TMR2IE : 1;
5150 unsigned TMR1GIE : 1;
5151 unsigned SSP1IE : 1;
5152 unsigned TX1IE : 1;
5153 unsigned RC1IE : 1;
5154 unsigned ADIE : 1;
5155 unsigned : 1;
5158 struct
5160 unsigned : 1;
5161 unsigned : 1;
5162 unsigned : 1;
5163 unsigned SSPIE : 1;
5164 unsigned TXIE : 1;
5165 unsigned RCIE : 1;
5166 unsigned : 1;
5167 unsigned : 1;
5169 } __PIE1bits_t;
5171 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
5173 #define _TMR1IE 0x01
5174 #define _TMR2IE 0x02
5175 #define _TMR1GIE 0x04
5176 #define _SSP1IE 0x08
5177 #define _SSPIE 0x08
5178 #define _TX1IE 0x10
5179 #define _TXIE 0x10
5180 #define _RC1IE 0x20
5181 #define _RCIE 0x20
5182 #define _ADIE 0x40
5184 //==============================================================================
5187 //==============================================================================
5188 // PIR1 Bits
5190 extern __at(0x0F9E) __sfr PIR1;
5192 typedef union
5194 struct
5196 unsigned TMR1IF : 1;
5197 unsigned TMR2IF : 1;
5198 unsigned TMR1GIF : 1;
5199 unsigned SSP1IF : 1;
5200 unsigned TX1IF : 1;
5201 unsigned RC1IF : 1;
5202 unsigned ADIF : 1;
5203 unsigned : 1;
5206 struct
5208 unsigned : 1;
5209 unsigned : 1;
5210 unsigned : 1;
5211 unsigned SSPIF : 1;
5212 unsigned TXIF : 1;
5213 unsigned RCIF : 1;
5214 unsigned : 1;
5215 unsigned : 1;
5217 } __PIR1bits_t;
5219 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
5221 #define _TMR1IF 0x01
5222 #define _TMR2IF 0x02
5223 #define _TMR1GIF 0x04
5224 #define _SSP1IF 0x08
5225 #define _SSPIF 0x08
5226 #define _TX1IF 0x10
5227 #define _TXIF 0x10
5228 #define _RC1IF 0x20
5229 #define _RCIF 0x20
5230 #define _ADIF 0x40
5232 //==============================================================================
5235 //==============================================================================
5236 // IPR1 Bits
5238 extern __at(0x0F9F) __sfr IPR1;
5240 typedef union
5242 struct
5244 unsigned TMR1IP : 1;
5245 unsigned TMR2IP : 1;
5246 unsigned TMR1GIP : 1;
5247 unsigned SSP1IP : 1;
5248 unsigned TX1IP : 1;
5249 unsigned RC1IP : 1;
5250 unsigned ADIP : 1;
5251 unsigned : 1;
5254 struct
5256 unsigned : 1;
5257 unsigned : 1;
5258 unsigned : 1;
5259 unsigned SSPIP : 1;
5260 unsigned TXIP : 1;
5261 unsigned RCIP : 1;
5262 unsigned : 1;
5263 unsigned : 1;
5265 } __IPR1bits_t;
5267 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
5269 #define _TMR1IP 0x01
5270 #define _TMR2IP 0x02
5271 #define _TMR1GIP 0x04
5272 #define _SSP1IP 0x08
5273 #define _SSPIP 0x08
5274 #define _TX1IP 0x10
5275 #define _TXIP 0x10
5276 #define _RC1IP 0x20
5277 #define _RCIP 0x20
5278 #define _ADIP 0x40
5280 //==============================================================================
5283 //==============================================================================
5284 // PIE2 Bits
5286 extern __at(0x0FA0) __sfr PIE2;
5288 typedef union
5290 struct
5292 unsigned TMR3GIE : 1;
5293 unsigned TMR3IE : 1;
5294 unsigned HLVDIE : 1;
5295 unsigned BCL1IE : 1;
5296 unsigned BCL2IE : 1;
5297 unsigned SSP2IE : 1;
5298 unsigned : 1;
5299 unsigned OSCFIE : 1;
5302 struct
5304 unsigned : 1;
5305 unsigned : 1;
5306 unsigned LVDIE : 1;
5307 unsigned BCLIE : 1;
5308 unsigned : 1;
5309 unsigned : 1;
5310 unsigned : 1;
5311 unsigned : 1;
5313 } __PIE2bits_t;
5315 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
5317 #define _TMR3GIE 0x01
5318 #define _TMR3IE 0x02
5319 #define _HLVDIE 0x04
5320 #define _LVDIE 0x04
5321 #define _BCL1IE 0x08
5322 #define _BCLIE 0x08
5323 #define _BCL2IE 0x10
5324 #define _SSP2IE 0x20
5325 #define _OSCFIE 0x80
5327 //==============================================================================
5330 //==============================================================================
5331 // PIR2 Bits
5333 extern __at(0x0FA1) __sfr PIR2;
5335 typedef union
5337 struct
5339 unsigned TMR3GIF : 1;
5340 unsigned TMR3IF : 1;
5341 unsigned HLVDIF : 1;
5342 unsigned BCL1IF : 1;
5343 unsigned BCL2IF : 1;
5344 unsigned SSP2IF : 1;
5345 unsigned : 1;
5346 unsigned OSCFIF : 1;
5349 struct
5351 unsigned : 1;
5352 unsigned : 1;
5353 unsigned LVDIF : 1;
5354 unsigned BCLIF : 1;
5355 unsigned : 1;
5356 unsigned : 1;
5357 unsigned : 1;
5358 unsigned : 1;
5360 } __PIR2bits_t;
5362 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
5364 #define _TMR3GIF 0x01
5365 #define _TMR3IF 0x02
5366 #define _HLVDIF 0x04
5367 #define _LVDIF 0x04
5368 #define _BCL1IF 0x08
5369 #define _BCLIF 0x08
5370 #define _BCL2IF 0x10
5371 #define _SSP2IF 0x20
5372 #define _OSCFIF 0x80
5374 //==============================================================================
5377 //==============================================================================
5378 // IPR2 Bits
5380 extern __at(0x0FA2) __sfr IPR2;
5382 typedef union
5384 struct
5386 unsigned TMR3GIP : 1;
5387 unsigned TMR3IP : 1;
5388 unsigned HLVDIP : 1;
5389 unsigned BCL1IP : 1;
5390 unsigned BCL2IP : 1;
5391 unsigned SSP2IP : 1;
5392 unsigned : 1;
5393 unsigned OSCFIP : 1;
5396 struct
5398 unsigned : 1;
5399 unsigned : 1;
5400 unsigned LVDIP : 1;
5401 unsigned BCLIP : 1;
5402 unsigned : 1;
5403 unsigned : 1;
5404 unsigned : 1;
5405 unsigned : 1;
5407 } __IPR2bits_t;
5409 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
5411 #define _TMR3GIP 0x01
5412 #define _TMR3IP 0x02
5413 #define _HLVDIP 0x04
5414 #define _LVDIP 0x04
5415 #define _BCL1IP 0x08
5416 #define _BCLIP 0x08
5417 #define _BCL2IP 0x10
5418 #define _SSP2IP 0x20
5419 #define _OSCFIP 0x80
5421 //==============================================================================
5424 //==============================================================================
5425 // PIE3 Bits
5427 extern __at(0x0FA3) __sfr PIE3;
5429 typedef struct
5431 unsigned RTCCIE : 1;
5432 unsigned CCP1IE : 1;
5433 unsigned CCP2IE : 1;
5434 unsigned CTMUIE : 1;
5435 unsigned TX2IE : 1;
5436 unsigned RC2IE : 1;
5437 unsigned LCDIE : 1;
5438 unsigned TMR5GIE : 1;
5439 } __PIE3bits_t;
5441 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
5443 #define _RTCCIE 0x01
5444 #define _CCP1IE 0x02
5445 #define _CCP2IE 0x04
5446 #define _CTMUIE 0x08
5447 #define _TX2IE 0x10
5448 #define _RC2IE 0x20
5449 #define _LCDIE 0x40
5450 #define _TMR5GIE 0x80
5452 //==============================================================================
5455 //==============================================================================
5456 // PIR3 Bits
5458 extern __at(0x0FA4) __sfr PIR3;
5460 typedef struct
5462 unsigned RTCCIF : 1;
5463 unsigned CCP1IF : 1;
5464 unsigned CCP2IF : 1;
5465 unsigned CTMUIF : 1;
5466 unsigned TX2IF : 1;
5467 unsigned RC2IF : 1;
5468 unsigned LCDIF : 1;
5469 unsigned TMR5GIF : 1;
5470 } __PIR3bits_t;
5472 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
5474 #define _RTCCIF 0x01
5475 #define _CCP1IF 0x02
5476 #define _CCP2IF 0x04
5477 #define _CTMUIF 0x08
5478 #define _TX2IF 0x10
5479 #define _RC2IF 0x20
5480 #define _LCDIF 0x40
5481 #define _TMR5GIF 0x80
5483 //==============================================================================
5486 //==============================================================================
5487 // IPR3 Bits
5489 extern __at(0x0FA5) __sfr IPR3;
5491 typedef struct
5493 unsigned RTCCIP : 1;
5494 unsigned CCP1IP : 1;
5495 unsigned CCP2IP : 1;
5496 unsigned CTMUIP : 1;
5497 unsigned TX2IP : 1;
5498 unsigned RC2IP : 1;
5499 unsigned LCDIP : 1;
5500 unsigned TMR5GIP : 1;
5501 } __IPR3bits_t;
5503 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
5505 #define _RTCCIP 0x01
5506 #define _CCP1IP 0x02
5507 #define _CCP2IP 0x04
5508 #define _CTMUIP 0x08
5509 #define _TX2IP 0x10
5510 #define _RC2IP 0x20
5511 #define _LCDIP 0x40
5512 #define _TMR5GIP 0x80
5514 //==============================================================================
5517 //==============================================================================
5518 // PIR6 Bits
5520 extern __at(0x0FA6) __sfr PIR6;
5522 typedef struct
5524 unsigned CMP1IF : 1;
5525 unsigned CMP2IF : 1;
5526 unsigned CMP3IF : 1;
5527 unsigned : 1;
5528 unsigned EEIF : 1;
5529 unsigned : 1;
5530 unsigned : 1;
5531 unsigned : 1;
5532 } __PIR6bits_t;
5534 extern __at(0x0FA6) volatile __PIR6bits_t PIR6bits;
5536 #define _CMP1IF 0x01
5537 #define _CMP2IF 0x02
5538 #define _CMP3IF 0x04
5539 #define _EEIF 0x10
5541 //==============================================================================
5544 //==============================================================================
5545 // HLVDCON Bits
5547 extern __at(0x0FA8) __sfr HLVDCON;
5549 typedef union
5551 struct
5553 unsigned HLVDL0 : 1;
5554 unsigned HLVDL1 : 1;
5555 unsigned HLVDL2 : 1;
5556 unsigned HLVDL3 : 1;
5557 unsigned HLVDEN : 1;
5558 unsigned IRVST : 1;
5559 unsigned BGVST : 1;
5560 unsigned VDIRMAG : 1;
5563 struct
5565 unsigned HLVDL : 4;
5566 unsigned : 4;
5568 } __HLVDCONbits_t;
5570 extern __at(0x0FA8) volatile __HLVDCONbits_t HLVDCONbits;
5572 #define _HLVDL0 0x01
5573 #define _HLVDL1 0x02
5574 #define _HLVDL2 0x04
5575 #define _HLVDL3 0x08
5576 #define _HLVDEN 0x10
5577 #define _IRVST 0x20
5578 #define _BGVST 0x40
5579 #define _VDIRMAG 0x80
5581 //==============================================================================
5584 //==============================================================================
5585 // IPR6 Bits
5587 extern __at(0x0FA9) __sfr IPR6;
5589 typedef struct
5591 unsigned CMP1IP : 1;
5592 unsigned CMP2IP : 1;
5593 unsigned CMP3IP : 1;
5594 unsigned : 1;
5595 unsigned EEIP : 1;
5596 unsigned : 1;
5597 unsigned : 1;
5598 unsigned : 1;
5599 } __IPR6bits_t;
5601 extern __at(0x0FA9) volatile __IPR6bits_t IPR6bits;
5603 #define _CMP1IP 0x01
5604 #define _CMP2IP 0x02
5605 #define _CMP3IP 0x04
5606 #define _EEIP 0x10
5608 //==============================================================================
5611 //==============================================================================
5612 // T1GCON Bits
5614 extern __at(0x0FAA) __sfr T1GCON;
5616 typedef union
5618 struct
5620 unsigned T1GSS0 : 1;
5621 unsigned T1GSS1 : 1;
5622 unsigned T1GVAL : 1;
5623 unsigned T1GGO_NOT_T1DONE : 1;
5624 unsigned T1GSPM : 1;
5625 unsigned T1GTM : 1;
5626 unsigned T1GPOL : 1;
5627 unsigned TMR1GE : 1;
5630 struct
5632 unsigned : 1;
5633 unsigned : 1;
5634 unsigned : 1;
5635 unsigned T1GGO : 1;
5636 unsigned : 1;
5637 unsigned : 1;
5638 unsigned : 1;
5639 unsigned : 1;
5642 struct
5644 unsigned : 1;
5645 unsigned : 1;
5646 unsigned : 1;
5647 unsigned NOT_T1DONE : 1;
5648 unsigned : 1;
5649 unsigned : 1;
5650 unsigned : 1;
5651 unsigned : 1;
5654 struct
5656 unsigned T1GSS : 2;
5657 unsigned : 6;
5659 } __T1GCONbits_t;
5661 extern __at(0x0FAA) volatile __T1GCONbits_t T1GCONbits;
5663 #define _T1GSS0 0x01
5664 #define _T1GSS1 0x02
5665 #define _T1GVAL 0x04
5666 #define _T1GGO_NOT_T1DONE 0x08
5667 #define _T1GGO 0x08
5668 #define _NOT_T1DONE 0x08
5669 #define _T1GSPM 0x10
5670 #define _T1GTM 0x20
5671 #define _T1GPOL 0x40
5672 #define _TMR1GE 0x80
5674 //==============================================================================
5677 //==============================================================================
5678 // RCSTA Bits
5680 extern __at(0x0FAB) __sfr RCSTA;
5682 typedef union
5684 struct
5686 unsigned RX9D : 1;
5687 unsigned OERR : 1;
5688 unsigned FERR : 1;
5689 unsigned ADDEN : 1;
5690 unsigned CREN : 1;
5691 unsigned SREN : 1;
5692 unsigned RX9 : 1;
5693 unsigned SPEN : 1;
5696 struct
5698 unsigned RCD8 : 1;
5699 unsigned OERR1 : 1;
5700 unsigned FERR1 : 1;
5701 unsigned ADEN : 1;
5702 unsigned CREN1 : 1;
5703 unsigned SREN1 : 1;
5704 unsigned RC9 : 1;
5705 unsigned SPEN1 : 1;
5708 struct
5710 unsigned RX9D1 : 1;
5711 unsigned : 1;
5712 unsigned : 1;
5713 unsigned ADDEN1 : 1;
5714 unsigned : 1;
5715 unsigned : 1;
5716 unsigned NOT_RC8 : 1;
5717 unsigned : 1;
5720 struct
5722 unsigned : 1;
5723 unsigned : 1;
5724 unsigned : 1;
5725 unsigned : 1;
5726 unsigned : 1;
5727 unsigned : 1;
5728 unsigned RC8_9 : 1;
5729 unsigned : 1;
5732 struct
5734 unsigned : 1;
5735 unsigned : 1;
5736 unsigned : 1;
5737 unsigned : 1;
5738 unsigned : 1;
5739 unsigned : 1;
5740 unsigned RX91 : 1;
5741 unsigned : 1;
5743 } __RCSTAbits_t;
5745 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
5747 #define _RX9D 0x01
5748 #define _RCD8 0x01
5749 #define _RX9D1 0x01
5750 #define _OERR 0x02
5751 #define _OERR1 0x02
5752 #define _FERR 0x04
5753 #define _FERR1 0x04
5754 #define _ADDEN 0x08
5755 #define _ADEN 0x08
5756 #define _ADDEN1 0x08
5757 #define _CREN 0x10
5758 #define _CREN1 0x10
5759 #define _SREN 0x20
5760 #define _SREN1 0x20
5761 #define _RX9 0x40
5762 #define _RC9 0x40
5763 #define _NOT_RC8 0x40
5764 #define _RC8_9 0x40
5765 #define _RX91 0x40
5766 #define _SPEN 0x80
5767 #define _SPEN1 0x80
5769 //==============================================================================
5772 //==============================================================================
5773 // RCSTA1 Bits
5775 extern __at(0x0FAB) __sfr RCSTA1;
5777 typedef union
5779 struct
5781 unsigned RX9D : 1;
5782 unsigned OERR : 1;
5783 unsigned FERR : 1;
5784 unsigned ADDEN : 1;
5785 unsigned CREN : 1;
5786 unsigned SREN : 1;
5787 unsigned RX9 : 1;
5788 unsigned SPEN : 1;
5791 struct
5793 unsigned RCD8 : 1;
5794 unsigned OERR1 : 1;
5795 unsigned FERR1 : 1;
5796 unsigned ADEN : 1;
5797 unsigned CREN1 : 1;
5798 unsigned SREN1 : 1;
5799 unsigned RC9 : 1;
5800 unsigned SPEN1 : 1;
5803 struct
5805 unsigned RX9D1 : 1;
5806 unsigned : 1;
5807 unsigned : 1;
5808 unsigned ADDEN1 : 1;
5809 unsigned : 1;
5810 unsigned : 1;
5811 unsigned NOT_RC8 : 1;
5812 unsigned : 1;
5815 struct
5817 unsigned : 1;
5818 unsigned : 1;
5819 unsigned : 1;
5820 unsigned : 1;
5821 unsigned : 1;
5822 unsigned : 1;
5823 unsigned RC8_9 : 1;
5824 unsigned : 1;
5827 struct
5829 unsigned : 1;
5830 unsigned : 1;
5831 unsigned : 1;
5832 unsigned : 1;
5833 unsigned : 1;
5834 unsigned : 1;
5835 unsigned RX91 : 1;
5836 unsigned : 1;
5838 } __RCSTA1bits_t;
5840 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
5842 #define _RCSTA1_RX9D 0x01
5843 #define _RCSTA1_RCD8 0x01
5844 #define _RCSTA1_RX9D1 0x01
5845 #define _RCSTA1_OERR 0x02
5846 #define _RCSTA1_OERR1 0x02
5847 #define _RCSTA1_FERR 0x04
5848 #define _RCSTA1_FERR1 0x04
5849 #define _RCSTA1_ADDEN 0x08
5850 #define _RCSTA1_ADEN 0x08
5851 #define _RCSTA1_ADDEN1 0x08
5852 #define _RCSTA1_CREN 0x10
5853 #define _RCSTA1_CREN1 0x10
5854 #define _RCSTA1_SREN 0x20
5855 #define _RCSTA1_SREN1 0x20
5856 #define _RCSTA1_RX9 0x40
5857 #define _RCSTA1_RC9 0x40
5858 #define _RCSTA1_NOT_RC8 0x40
5859 #define _RCSTA1_RC8_9 0x40
5860 #define _RCSTA1_RX91 0x40
5861 #define _RCSTA1_SPEN 0x80
5862 #define _RCSTA1_SPEN1 0x80
5864 //==============================================================================
5867 //==============================================================================
5868 // TXSTA Bits
5870 extern __at(0x0FAC) __sfr TXSTA;
5872 typedef union
5874 struct
5876 unsigned TX9D : 1;
5877 unsigned TRMT : 1;
5878 unsigned BRGH : 1;
5879 unsigned SENDB : 1;
5880 unsigned SYNC : 1;
5881 unsigned TXEN : 1;
5882 unsigned TX9 : 1;
5883 unsigned CSRC : 1;
5886 struct
5888 unsigned TXD8 : 1;
5889 unsigned TRMT1 : 1;
5890 unsigned BRGH1 : 1;
5891 unsigned SENDB1 : 1;
5892 unsigned SYNC1 : 1;
5893 unsigned TXEN1 : 1;
5894 unsigned TX8_9 : 1;
5895 unsigned CSRC1 : 1;
5898 struct
5900 unsigned TX9D1 : 1;
5901 unsigned : 1;
5902 unsigned : 1;
5903 unsigned : 1;
5904 unsigned : 1;
5905 unsigned : 1;
5906 unsigned NOT_TX8 : 1;
5907 unsigned : 1;
5910 struct
5912 unsigned : 1;
5913 unsigned : 1;
5914 unsigned : 1;
5915 unsigned : 1;
5916 unsigned : 1;
5917 unsigned : 1;
5918 unsigned TX91 : 1;
5919 unsigned : 1;
5921 } __TXSTAbits_t;
5923 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
5925 #define _TX9D 0x01
5926 #define _TXD8 0x01
5927 #define _TX9D1 0x01
5928 #define _TRMT 0x02
5929 #define _TRMT1 0x02
5930 #define _BRGH 0x04
5931 #define _BRGH1 0x04
5932 #define _SENDB 0x08
5933 #define _SENDB1 0x08
5934 #define _SYNC 0x10
5935 #define _SYNC1 0x10
5936 #define _TXEN 0x20
5937 #define _TXEN1 0x20
5938 #define _TX9 0x40
5939 #define _TX8_9 0x40
5940 #define _NOT_TX8 0x40
5941 #define _TX91 0x40
5942 #define _CSRC 0x80
5943 #define _CSRC1 0x80
5945 //==============================================================================
5948 //==============================================================================
5949 // TXSTA1 Bits
5951 extern __at(0x0FAC) __sfr TXSTA1;
5953 typedef union
5955 struct
5957 unsigned TX9D : 1;
5958 unsigned TRMT : 1;
5959 unsigned BRGH : 1;
5960 unsigned SENDB : 1;
5961 unsigned SYNC : 1;
5962 unsigned TXEN : 1;
5963 unsigned TX9 : 1;
5964 unsigned CSRC : 1;
5967 struct
5969 unsigned TXD8 : 1;
5970 unsigned TRMT1 : 1;
5971 unsigned BRGH1 : 1;
5972 unsigned SENDB1 : 1;
5973 unsigned SYNC1 : 1;
5974 unsigned TXEN1 : 1;
5975 unsigned TX8_9 : 1;
5976 unsigned CSRC1 : 1;
5979 struct
5981 unsigned TX9D1 : 1;
5982 unsigned : 1;
5983 unsigned : 1;
5984 unsigned : 1;
5985 unsigned : 1;
5986 unsigned : 1;
5987 unsigned NOT_TX8 : 1;
5988 unsigned : 1;
5991 struct
5993 unsigned : 1;
5994 unsigned : 1;
5995 unsigned : 1;
5996 unsigned : 1;
5997 unsigned : 1;
5998 unsigned : 1;
5999 unsigned TX91 : 1;
6000 unsigned : 1;
6002 } __TXSTA1bits_t;
6004 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
6006 #define _TXSTA1_TX9D 0x01
6007 #define _TXSTA1_TXD8 0x01
6008 #define _TXSTA1_TX9D1 0x01
6009 #define _TXSTA1_TRMT 0x02
6010 #define _TXSTA1_TRMT1 0x02
6011 #define _TXSTA1_BRGH 0x04
6012 #define _TXSTA1_BRGH1 0x04
6013 #define _TXSTA1_SENDB 0x08
6014 #define _TXSTA1_SENDB1 0x08
6015 #define _TXSTA1_SYNC 0x10
6016 #define _TXSTA1_SYNC1 0x10
6017 #define _TXSTA1_TXEN 0x20
6018 #define _TXSTA1_TXEN1 0x20
6019 #define _TXSTA1_TX9 0x40
6020 #define _TXSTA1_TX8_9 0x40
6021 #define _TXSTA1_NOT_TX8 0x40
6022 #define _TXSTA1_TX91 0x40
6023 #define _TXSTA1_CSRC 0x80
6024 #define _TXSTA1_CSRC1 0x80
6026 //==============================================================================
6028 extern __at(0x0FAD) __sfr TXREG;
6029 extern __at(0x0FAD) __sfr TXREG1;
6030 extern __at(0x0FAE) __sfr RCREG;
6031 extern __at(0x0FAE) __sfr RCREG1;
6032 extern __at(0x0FAF) __sfr SPBRG;
6033 extern __at(0x0FAF) __sfr SPBRG1;
6035 //==============================================================================
6036 // T3GCON Bits
6038 extern __at(0x0FB0) __sfr T3GCON;
6040 typedef union
6042 struct
6044 unsigned T3GSS0 : 1;
6045 unsigned T3GSS1 : 1;
6046 unsigned T3GVAL : 1;
6047 unsigned T3GGO_NOT_T3DONE : 1;
6048 unsigned T3GSPM : 1;
6049 unsigned T3GTM : 1;
6050 unsigned T3GPOL : 1;
6051 unsigned TMR3GE : 1;
6054 struct
6056 unsigned : 1;
6057 unsigned : 1;
6058 unsigned : 1;
6059 unsigned T3GGO : 1;
6060 unsigned : 1;
6061 unsigned : 1;
6062 unsigned : 1;
6063 unsigned : 1;
6066 struct
6068 unsigned : 1;
6069 unsigned : 1;
6070 unsigned : 1;
6071 unsigned NOT_T3DONE : 1;
6072 unsigned : 1;
6073 unsigned : 1;
6074 unsigned : 1;
6075 unsigned : 1;
6078 struct
6080 unsigned T3GSS : 2;
6081 unsigned : 6;
6083 } __T3GCONbits_t;
6085 extern __at(0x0FB0) volatile __T3GCONbits_t T3GCONbits;
6087 #define _T3GSS0 0x01
6088 #define _T3GSS1 0x02
6089 #define _T3GVAL 0x04
6090 #define _T3GGO_NOT_T3DONE 0x08
6091 #define _T3GGO 0x08
6092 #define _NOT_T3DONE 0x08
6093 #define _T3GSPM 0x10
6094 #define _T3GTM 0x20
6095 #define _T3GPOL 0x40
6096 #define _TMR3GE 0x80
6098 //==============================================================================
6101 //==============================================================================
6102 // T3CON Bits
6104 extern __at(0x0FB1) __sfr T3CON;
6106 typedef union
6108 struct
6110 unsigned TMR3ON : 1;
6111 unsigned RD16 : 1;
6112 unsigned NOT_T3SYNC : 1;
6113 unsigned SOSCEN : 1;
6114 unsigned T3CKPS0 : 1;
6115 unsigned T3CKPS1 : 1;
6116 unsigned TMR3CS0 : 1;
6117 unsigned TMR3CS1 : 1;
6120 struct
6122 unsigned : 4;
6123 unsigned T3CKPS : 2;
6124 unsigned : 2;
6127 struct
6129 unsigned : 6;
6130 unsigned TMR3CS : 2;
6132 } __T3CONbits_t;
6134 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
6136 #define _T3CON_TMR3ON 0x01
6137 #define _T3CON_RD16 0x02
6138 #define _T3CON_NOT_T3SYNC 0x04
6139 #define _T3CON_SOSCEN 0x08
6140 #define _T3CON_T3CKPS0 0x10
6141 #define _T3CON_T3CKPS1 0x20
6142 #define _T3CON_TMR3CS0 0x40
6143 #define _T3CON_TMR3CS1 0x80
6145 //==============================================================================
6147 extern __at(0x0FB2) __sfr TMR3;
6148 extern __at(0x0FB2) __sfr TMR3L;
6149 extern __at(0x0FB3) __sfr TMR3H;
6151 //==============================================================================
6152 // CMSTAT Bits
6154 extern __at(0x0FB4) __sfr CMSTAT;
6156 typedef union
6158 struct
6160 unsigned : 1;
6161 unsigned : 1;
6162 unsigned : 1;
6163 unsigned : 1;
6164 unsigned : 1;
6165 unsigned CMP1OUT : 1;
6166 unsigned CMP2OUT : 1;
6167 unsigned CMP3OUT : 1;
6170 struct
6172 unsigned : 1;
6173 unsigned : 1;
6174 unsigned : 1;
6175 unsigned : 1;
6176 unsigned : 1;
6177 unsigned C1OUT : 1;
6178 unsigned C2OUT : 1;
6179 unsigned C3OUT : 1;
6181 } __CMSTATbits_t;
6183 extern __at(0x0FB4) volatile __CMSTATbits_t CMSTATbits;
6185 #define _CMP1OUT 0x20
6186 #define _C1OUT 0x20
6187 #define _CMP2OUT 0x40
6188 #define _C2OUT 0x40
6189 #define _CMP3OUT 0x80
6190 #define _C3OUT 0x80
6192 //==============================================================================
6195 //==============================================================================
6196 // CMSTATUS Bits
6198 extern __at(0x0FB4) __sfr CMSTATUS;
6200 typedef union
6202 struct
6204 unsigned : 1;
6205 unsigned : 1;
6206 unsigned : 1;
6207 unsigned : 1;
6208 unsigned : 1;
6209 unsigned CMP1OUT : 1;
6210 unsigned CMP2OUT : 1;
6211 unsigned CMP3OUT : 1;
6214 struct
6216 unsigned : 1;
6217 unsigned : 1;
6218 unsigned : 1;
6219 unsigned : 1;
6220 unsigned : 1;
6221 unsigned C1OUT : 1;
6222 unsigned C2OUT : 1;
6223 unsigned C3OUT : 1;
6225 } __CMSTATUSbits_t;
6227 extern __at(0x0FB4) volatile __CMSTATUSbits_t CMSTATUSbits;
6229 #define _CMSTATUS_CMP1OUT 0x20
6230 #define _CMSTATUS_C1OUT 0x20
6231 #define _CMSTATUS_CMP2OUT 0x40
6232 #define _CMSTATUS_C2OUT 0x40
6233 #define _CMSTATUS_CMP3OUT 0x80
6234 #define _CMSTATUS_C3OUT 0x80
6236 //==============================================================================
6239 //==============================================================================
6240 // CVRCON Bits
6242 extern __at(0x0FB5) __sfr CVRCON;
6244 typedef union
6246 struct
6248 unsigned CVR0 : 1;
6249 unsigned CVR1 : 1;
6250 unsigned CVR2 : 1;
6251 unsigned CVR3 : 1;
6252 unsigned CVR4 : 1;
6253 unsigned CVRSS : 1;
6254 unsigned CVROE : 1;
6255 unsigned CVREN : 1;
6258 struct
6260 unsigned CVR : 5;
6261 unsigned : 3;
6263 } __CVRCONbits_t;
6265 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
6267 #define _CVR0 0x01
6268 #define _CVR1 0x02
6269 #define _CVR2 0x04
6270 #define _CVR3 0x08
6271 #define _CVR4 0x10
6272 #define _CVRSS 0x20
6273 #define _CVROE 0x40
6274 #define _CVREN 0x80
6276 //==============================================================================
6279 //==============================================================================
6280 // PIE4 Bits
6282 extern __at(0x0FB6) __sfr PIE4;
6284 typedef struct
6286 unsigned CCP3IE : 1;
6287 unsigned CCP4IE : 1;
6288 unsigned CCP5IE : 1;
6289 unsigned CCP6IE : 1;
6290 unsigned CCP7IE : 1;
6291 unsigned CCP8IE : 1;
6292 unsigned : 1;
6293 unsigned : 1;
6294 } __PIE4bits_t;
6296 extern __at(0x0FB6) volatile __PIE4bits_t PIE4bits;
6298 #define _CCP3IE 0x01
6299 #define _CCP4IE 0x02
6300 #define _CCP5IE 0x04
6301 #define _CCP6IE 0x08
6302 #define _CCP7IE 0x10
6303 #define _CCP8IE 0x20
6305 //==============================================================================
6308 //==============================================================================
6309 // PIR4 Bits
6311 extern __at(0x0FB7) __sfr PIR4;
6313 typedef struct
6315 unsigned CCP3IF : 1;
6316 unsigned CCP4IF : 1;
6317 unsigned CCP5IF : 1;
6318 unsigned CCP6IF : 1;
6319 unsigned CCP7IF : 1;
6320 unsigned CCP8IF : 1;
6321 unsigned : 1;
6322 unsigned : 1;
6323 } __PIR4bits_t;
6325 extern __at(0x0FB7) volatile __PIR4bits_t PIR4bits;
6327 #define _CCP3IF 0x01
6328 #define _CCP4IF 0x02
6329 #define _CCP5IF 0x04
6330 #define _CCP6IF 0x08
6331 #define _CCP7IF 0x10
6332 #define _CCP8IF 0x20
6334 //==============================================================================
6337 //==============================================================================
6338 // IPR4 Bits
6340 extern __at(0x0FB8) __sfr IPR4;
6342 typedef struct
6344 unsigned CCP3IP : 1;
6345 unsigned CCP4IP : 1;
6346 unsigned CCP5IP : 1;
6347 unsigned CCP6IP : 1;
6348 unsigned CCP7IP : 1;
6349 unsigned CCP8IP : 1;
6350 unsigned : 1;
6351 unsigned : 1;
6352 } __IPR4bits_t;
6354 extern __at(0x0FB8) volatile __IPR4bits_t IPR4bits;
6356 #define _CCP3IP 0x01
6357 #define _CCP4IP 0x02
6358 #define _CCP5IP 0x04
6359 #define _CCP6IP 0x08
6360 #define _CCP7IP 0x10
6361 #define _CCP8IP 0x20
6363 //==============================================================================
6366 //==============================================================================
6367 // PIE5 Bits
6369 extern __at(0x0FB9) __sfr PIE5;
6371 typedef struct
6373 unsigned TMR4IE : 1;
6374 unsigned TMR5IE : 1;
6375 unsigned TMR6IE : 1;
6376 unsigned : 1;
6377 unsigned TMR8IE : 1;
6378 unsigned : 1;
6379 unsigned : 1;
6380 unsigned : 1;
6381 } __PIE5bits_t;
6383 extern __at(0x0FB9) volatile __PIE5bits_t PIE5bits;
6385 #define _TMR4IE 0x01
6386 #define _TMR5IE 0x02
6387 #define _TMR6IE 0x04
6388 #define _TMR8IE 0x10
6390 //==============================================================================
6393 //==============================================================================
6394 // PIR5 Bits
6396 extern __at(0x0FBA) __sfr PIR5;
6398 typedef struct
6400 unsigned TMR4IF : 1;
6401 unsigned TMR5IF : 1;
6402 unsigned TMR6IF : 1;
6403 unsigned : 1;
6404 unsigned TMR8IF : 1;
6405 unsigned : 1;
6406 unsigned : 1;
6407 unsigned : 1;
6408 } __PIR5bits_t;
6410 extern __at(0x0FBA) volatile __PIR5bits_t PIR5bits;
6412 #define _TMR4IF 0x01
6413 #define _TMR5IF 0x02
6414 #define _TMR6IF 0x04
6415 #define _TMR8IF 0x10
6417 //==============================================================================
6420 //==============================================================================
6421 // CCP1CON Bits
6423 extern __at(0x0FBB) __sfr CCP1CON;
6425 typedef union
6427 struct
6429 unsigned CCP1M0 : 1;
6430 unsigned CCP1M1 : 1;
6431 unsigned CCP1M2 : 1;
6432 unsigned CCP1M3 : 1;
6433 unsigned DC1B0 : 1;
6434 unsigned DC1B1 : 1;
6435 unsigned P1M0 : 1;
6436 unsigned P1M1 : 1;
6439 struct
6441 unsigned : 1;
6442 unsigned : 1;
6443 unsigned : 1;
6444 unsigned : 1;
6445 unsigned CCP1Y : 1;
6446 unsigned CCP1X : 1;
6447 unsigned : 1;
6448 unsigned : 1;
6451 struct
6453 unsigned CCP1M : 4;
6454 unsigned : 4;
6457 struct
6459 unsigned : 4;
6460 unsigned DC1B : 2;
6461 unsigned : 2;
6464 struct
6466 unsigned : 6;
6467 unsigned P1M : 2;
6469 } __CCP1CONbits_t;
6471 extern __at(0x0FBB) volatile __CCP1CONbits_t CCP1CONbits;
6473 #define _CCP1M0 0x01
6474 #define _CCP1M1 0x02
6475 #define _CCP1M2 0x04
6476 #define _CCP1M3 0x08
6477 #define _DC1B0 0x10
6478 #define _CCP1Y 0x10
6479 #define _DC1B1 0x20
6480 #define _CCP1X 0x20
6481 #define _P1M0 0x40
6482 #define _P1M1 0x80
6484 //==============================================================================
6487 //==============================================================================
6488 // ECCP1CON Bits
6490 extern __at(0x0FBB) __sfr ECCP1CON;
6492 typedef union
6494 struct
6496 unsigned CCP1M0 : 1;
6497 unsigned CCP1M1 : 1;
6498 unsigned CCP1M2 : 1;
6499 unsigned CCP1M3 : 1;
6500 unsigned DC1B0 : 1;
6501 unsigned DC1B1 : 1;
6502 unsigned P1M0 : 1;
6503 unsigned P1M1 : 1;
6506 struct
6508 unsigned : 1;
6509 unsigned : 1;
6510 unsigned : 1;
6511 unsigned : 1;
6512 unsigned CCP1Y : 1;
6513 unsigned CCP1X : 1;
6514 unsigned : 1;
6515 unsigned : 1;
6518 struct
6520 unsigned CCP1M : 4;
6521 unsigned : 4;
6524 struct
6526 unsigned : 4;
6527 unsigned DC1B : 2;
6528 unsigned : 2;
6531 struct
6533 unsigned : 6;
6534 unsigned P1M : 2;
6536 } __ECCP1CONbits_t;
6538 extern __at(0x0FBB) volatile __ECCP1CONbits_t ECCP1CONbits;
6540 #define _ECCP1CON_CCP1M0 0x01
6541 #define _ECCP1CON_CCP1M1 0x02
6542 #define _ECCP1CON_CCP1M2 0x04
6543 #define _ECCP1CON_CCP1M3 0x08
6544 #define _ECCP1CON_DC1B0 0x10
6545 #define _ECCP1CON_CCP1Y 0x10
6546 #define _ECCP1CON_DC1B1 0x20
6547 #define _ECCP1CON_CCP1X 0x20
6548 #define _ECCP1CON_P1M0 0x40
6549 #define _ECCP1CON_P1M1 0x80
6551 //==============================================================================
6553 extern __at(0x0FBC) __sfr CCPR1;
6554 extern __at(0x0FBC) __sfr CCPR1L;
6555 extern __at(0x0FBD) __sfr CCPR1H;
6557 //==============================================================================
6558 // ECCP1DEL Bits
6560 extern __at(0x0FBE) __sfr ECCP1DEL;
6562 typedef union
6564 struct
6566 unsigned P1DC0 : 1;
6567 unsigned P1DC1 : 1;
6568 unsigned P1DC2 : 1;
6569 unsigned P1DC3 : 1;
6570 unsigned P1DC4 : 1;
6571 unsigned P1DC5 : 1;
6572 unsigned P1DC6 : 1;
6573 unsigned P1RSEN : 1;
6576 struct
6578 unsigned P1DC : 7;
6579 unsigned : 1;
6581 } __ECCP1DELbits_t;
6583 extern __at(0x0FBE) volatile __ECCP1DELbits_t ECCP1DELbits;
6585 #define _P1DC0 0x01
6586 #define _P1DC1 0x02
6587 #define _P1DC2 0x04
6588 #define _P1DC3 0x08
6589 #define _P1DC4 0x10
6590 #define _P1DC5 0x20
6591 #define _P1DC6 0x40
6592 #define _P1RSEN 0x80
6594 //==============================================================================
6597 //==============================================================================
6598 // PWM1CON Bits
6600 extern __at(0x0FBE) __sfr PWM1CON;
6602 typedef union
6604 struct
6606 unsigned P1DC0 : 1;
6607 unsigned P1DC1 : 1;
6608 unsigned P1DC2 : 1;
6609 unsigned P1DC3 : 1;
6610 unsigned P1DC4 : 1;
6611 unsigned P1DC5 : 1;
6612 unsigned P1DC6 : 1;
6613 unsigned P1RSEN : 1;
6616 struct
6618 unsigned P1DC : 7;
6619 unsigned : 1;
6621 } __PWM1CONbits_t;
6623 extern __at(0x0FBE) volatile __PWM1CONbits_t PWM1CONbits;
6625 #define _PWM1CON_P1DC0 0x01
6626 #define _PWM1CON_P1DC1 0x02
6627 #define _PWM1CON_P1DC2 0x04
6628 #define _PWM1CON_P1DC3 0x08
6629 #define _PWM1CON_P1DC4 0x10
6630 #define _PWM1CON_P1DC5 0x20
6631 #define _PWM1CON_P1DC6 0x40
6632 #define _PWM1CON_P1RSEN 0x80
6634 //==============================================================================
6637 //==============================================================================
6638 // ECCP1AS Bits
6640 extern __at(0x0FBF) __sfr ECCP1AS;
6642 typedef union
6644 struct
6646 unsigned PSS1BD0 : 1;
6647 unsigned PSS1BD1 : 1;
6648 unsigned PSS1AC0 : 1;
6649 unsigned PSS1AC1 : 1;
6650 unsigned ECCP1AS0 : 1;
6651 unsigned ECCP1AS1 : 1;
6652 unsigned ECCP1AS2 : 1;
6653 unsigned ECCP1ASE : 1;
6656 struct
6658 unsigned PSS1BD : 2;
6659 unsigned : 6;
6662 struct
6664 unsigned : 2;
6665 unsigned PSS1AC : 2;
6666 unsigned : 4;
6669 struct
6671 unsigned : 4;
6672 unsigned ECCP1AS : 3;
6673 unsigned : 1;
6675 } __ECCP1ASbits_t;
6677 extern __at(0x0FBF) volatile __ECCP1ASbits_t ECCP1ASbits;
6679 #define _PSS1BD0 0x01
6680 #define _PSS1BD1 0x02
6681 #define _PSS1AC0 0x04
6682 #define _PSS1AC1 0x08
6683 #define _ECCP1AS0 0x10
6684 #define _ECCP1AS1 0x20
6685 #define _ECCP1AS2 0x40
6686 #define _ECCP1ASE 0x80
6688 //==============================================================================
6691 //==============================================================================
6692 // ADCON2 Bits
6694 extern __at(0x0FC0) __sfr ADCON2;
6696 typedef union
6698 struct
6700 unsigned ADCS0 : 1;
6701 unsigned ADCS1 : 1;
6702 unsigned ADCS2 : 1;
6703 unsigned ACQT0 : 1;
6704 unsigned ACQT1 : 1;
6705 unsigned ACQT2 : 1;
6706 unsigned : 1;
6707 unsigned ADFM : 1;
6710 struct
6712 unsigned ADCS : 3;
6713 unsigned : 5;
6716 struct
6718 unsigned : 3;
6719 unsigned ACQT : 3;
6720 unsigned : 2;
6722 } __ADCON2bits_t;
6724 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
6726 #define _ADCS0 0x01
6727 #define _ADCS1 0x02
6728 #define _ADCS2 0x04
6729 #define _ACQT0 0x08
6730 #define _ACQT1 0x10
6731 #define _ACQT2 0x20
6732 #define _ADFM 0x80
6734 //==============================================================================
6737 //==============================================================================
6738 // ADCON1 Bits
6740 extern __at(0x0FC1) __sfr ADCON1;
6742 typedef union
6744 struct
6746 unsigned CHSN0 : 1;
6747 unsigned CHSN1 : 1;
6748 unsigned CHSN2 : 1;
6749 unsigned VNCFG : 1;
6750 unsigned VCFG0 : 1;
6751 unsigned VCFG1 : 1;
6752 unsigned TRIGSEL0 : 1;
6753 unsigned TRIGSEL1 : 1;
6756 struct
6758 unsigned CHSN : 3;
6759 unsigned : 5;
6762 struct
6764 unsigned : 4;
6765 unsigned VCFG : 2;
6766 unsigned : 2;
6769 struct
6771 unsigned : 6;
6772 unsigned TRIGSEL : 2;
6774 } __ADCON1bits_t;
6776 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
6778 #define _CHSN0 0x01
6779 #define _CHSN1 0x02
6780 #define _CHSN2 0x04
6781 #define _VNCFG 0x08
6782 #define _VCFG0 0x10
6783 #define _VCFG1 0x20
6784 #define _TRIGSEL0 0x40
6785 #define _TRIGSEL1 0x80
6787 //==============================================================================
6790 //==============================================================================
6791 // ADCON0 Bits
6793 extern __at(0x0FC2) __sfr ADCON0;
6795 typedef union
6797 struct
6799 unsigned ADON : 1;
6800 unsigned GO_NOT_DONE : 1;
6801 unsigned CHS0 : 1;
6802 unsigned CHS1 : 1;
6803 unsigned CHS2 : 1;
6804 unsigned CHS3 : 1;
6805 unsigned CHS4 : 1;
6806 unsigned : 1;
6809 struct
6811 unsigned : 1;
6812 unsigned DONE : 1;
6813 unsigned : 1;
6814 unsigned : 1;
6815 unsigned : 1;
6816 unsigned : 1;
6817 unsigned : 1;
6818 unsigned : 1;
6821 struct
6823 unsigned : 1;
6824 unsigned GO : 1;
6825 unsigned : 1;
6826 unsigned : 1;
6827 unsigned : 1;
6828 unsigned : 1;
6829 unsigned : 1;
6830 unsigned : 1;
6833 struct
6835 unsigned : 1;
6836 unsigned NOT_DONE : 1;
6837 unsigned : 1;
6838 unsigned : 1;
6839 unsigned : 1;
6840 unsigned : 1;
6841 unsigned : 1;
6842 unsigned : 1;
6845 struct
6847 unsigned : 2;
6848 unsigned CHS : 5;
6849 unsigned : 1;
6851 } __ADCON0bits_t;
6853 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
6855 #define _ADON 0x01
6856 #define _GO_NOT_DONE 0x02
6857 #define _DONE 0x02
6858 #define _GO 0x02
6859 #define _NOT_DONE 0x02
6860 #define _CHS0 0x04
6861 #define _CHS1 0x08
6862 #define _CHS2 0x10
6863 #define _CHS3 0x20
6864 #define _CHS4 0x40
6866 //==============================================================================
6868 extern __at(0x0FC3) __sfr ADRES;
6869 extern __at(0x0FC3) __sfr ADRESL;
6870 extern __at(0x0FC4) __sfr ADRESH;
6872 //==============================================================================
6873 // SSP1CON2 Bits
6875 extern __at(0x0FC5) __sfr SSP1CON2;
6877 typedef union
6879 struct
6881 unsigned SEN : 1;
6882 unsigned RSEN : 1;
6883 unsigned PEN : 1;
6884 unsigned RCEN : 1;
6885 unsigned ACKEN : 1;
6886 unsigned ACKDT : 1;
6887 unsigned ACKSTAT : 1;
6888 unsigned GCEN : 1;
6891 struct
6893 unsigned : 1;
6894 unsigned ADMSK1 : 1;
6895 unsigned ADMSK2 : 1;
6896 unsigned ADMSK3 : 1;
6897 unsigned ADMSK4 : 1;
6898 unsigned ADMSK5 : 1;
6899 unsigned : 1;
6900 unsigned : 1;
6902 } __SSP1CON2bits_t;
6904 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
6906 #define _SEN 0x01
6907 #define _RSEN 0x02
6908 #define _ADMSK1 0x02
6909 #define _PEN 0x04
6910 #define _ADMSK2 0x04
6911 #define _RCEN 0x08
6912 #define _ADMSK3 0x08
6913 #define _ACKEN 0x10
6914 #define _ADMSK4 0x10
6915 #define _ACKDT 0x20
6916 #define _ADMSK5 0x20
6917 #define _ACKSTAT 0x40
6918 #define _GCEN 0x80
6920 //==============================================================================
6923 //==============================================================================
6924 // SSPCON2 Bits
6926 extern __at(0x0FC5) __sfr SSPCON2;
6928 typedef union
6930 struct
6932 unsigned SEN : 1;
6933 unsigned RSEN : 1;
6934 unsigned PEN : 1;
6935 unsigned RCEN : 1;
6936 unsigned ACKEN : 1;
6937 unsigned ACKDT : 1;
6938 unsigned ACKSTAT : 1;
6939 unsigned GCEN : 1;
6942 struct
6944 unsigned : 1;
6945 unsigned ADMSK1 : 1;
6946 unsigned ADMSK2 : 1;
6947 unsigned ADMSK3 : 1;
6948 unsigned ADMSK4 : 1;
6949 unsigned ADMSK5 : 1;
6950 unsigned : 1;
6951 unsigned : 1;
6953 } __SSPCON2bits_t;
6955 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
6957 #define _SSPCON2_SEN 0x01
6958 #define _SSPCON2_RSEN 0x02
6959 #define _SSPCON2_ADMSK1 0x02
6960 #define _SSPCON2_PEN 0x04
6961 #define _SSPCON2_ADMSK2 0x04
6962 #define _SSPCON2_RCEN 0x08
6963 #define _SSPCON2_ADMSK3 0x08
6964 #define _SSPCON2_ACKEN 0x10
6965 #define _SSPCON2_ADMSK4 0x10
6966 #define _SSPCON2_ACKDT 0x20
6967 #define _SSPCON2_ADMSK5 0x20
6968 #define _SSPCON2_ACKSTAT 0x40
6969 #define _SSPCON2_GCEN 0x80
6971 //==============================================================================
6974 //==============================================================================
6975 // SSP1CON1 Bits
6977 extern __at(0x0FC6) __sfr SSP1CON1;
6979 typedef union
6981 struct
6983 unsigned SSPM0 : 1;
6984 unsigned SSPM1 : 1;
6985 unsigned SSPM2 : 1;
6986 unsigned SSPM3 : 1;
6987 unsigned CKP : 1;
6988 unsigned SSPEN : 1;
6989 unsigned SSPOV : 1;
6990 unsigned WCOL : 1;
6993 struct
6995 unsigned SSPM : 4;
6996 unsigned : 4;
6998 } __SSP1CON1bits_t;
7000 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
7002 #define _SSPM0 0x01
7003 #define _SSPM1 0x02
7004 #define _SSPM2 0x04
7005 #define _SSPM3 0x08
7006 #define _CKP 0x10
7007 #define _SSPEN 0x20
7008 #define _SSPOV 0x40
7009 #define _WCOL 0x80
7011 //==============================================================================
7014 //==============================================================================
7015 // SSPCON1 Bits
7017 extern __at(0x0FC6) __sfr SSPCON1;
7019 typedef union
7021 struct
7023 unsigned SSPM0 : 1;
7024 unsigned SSPM1 : 1;
7025 unsigned SSPM2 : 1;
7026 unsigned SSPM3 : 1;
7027 unsigned CKP : 1;
7028 unsigned SSPEN : 1;
7029 unsigned SSPOV : 1;
7030 unsigned WCOL : 1;
7033 struct
7035 unsigned SSPM : 4;
7036 unsigned : 4;
7038 } __SSPCON1bits_t;
7040 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
7042 #define _SSPCON1_SSPM0 0x01
7043 #define _SSPCON1_SSPM1 0x02
7044 #define _SSPCON1_SSPM2 0x04
7045 #define _SSPCON1_SSPM3 0x08
7046 #define _SSPCON1_CKP 0x10
7047 #define _SSPCON1_SSPEN 0x20
7048 #define _SSPCON1_SSPOV 0x40
7049 #define _SSPCON1_WCOL 0x80
7051 //==============================================================================
7054 //==============================================================================
7055 // SSP1STAT Bits
7057 extern __at(0x0FC7) __sfr SSP1STAT;
7059 typedef union
7061 struct
7063 unsigned BF : 1;
7064 unsigned UA : 1;
7065 unsigned R_NOT_W : 1;
7066 unsigned S : 1;
7067 unsigned P : 1;
7068 unsigned D_NOT_A : 1;
7069 unsigned CKE : 1;
7070 unsigned SMP : 1;
7073 struct
7075 unsigned : 1;
7076 unsigned : 1;
7077 unsigned R : 1;
7078 unsigned I2C_START : 1;
7079 unsigned I2C_STOP : 1;
7080 unsigned D : 1;
7081 unsigned : 1;
7082 unsigned : 1;
7085 struct
7087 unsigned : 1;
7088 unsigned : 1;
7089 unsigned R_W : 1;
7090 unsigned : 1;
7091 unsigned : 1;
7092 unsigned D_A : 1;
7093 unsigned : 1;
7094 unsigned : 1;
7097 struct
7099 unsigned : 1;
7100 unsigned : 1;
7101 unsigned NOT_W : 1;
7102 unsigned : 1;
7103 unsigned : 1;
7104 unsigned NOT_A : 1;
7105 unsigned : 1;
7106 unsigned : 1;
7109 struct
7111 unsigned : 1;
7112 unsigned : 1;
7113 unsigned NOT_WRITE : 1;
7114 unsigned : 1;
7115 unsigned : 1;
7116 unsigned NOT_ADDRESS : 1;
7117 unsigned : 1;
7118 unsigned : 1;
7121 struct
7123 unsigned : 1;
7124 unsigned : 1;
7125 unsigned READ_WRITE : 1;
7126 unsigned : 1;
7127 unsigned : 1;
7128 unsigned DATA_ADDRESS : 1;
7129 unsigned : 1;
7130 unsigned : 1;
7133 struct
7135 unsigned : 1;
7136 unsigned : 1;
7137 unsigned I2C_READ : 1;
7138 unsigned : 1;
7139 unsigned : 1;
7140 unsigned I2C_DAT : 1;
7141 unsigned : 1;
7142 unsigned : 1;
7144 } __SSP1STATbits_t;
7146 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
7148 #define _BF 0x01
7149 #define _UA 0x02
7150 #define _R_NOT_W 0x04
7151 #define _R 0x04
7152 #define _R_W 0x04
7153 #define _NOT_W 0x04
7154 #define _NOT_WRITE 0x04
7155 #define _READ_WRITE 0x04
7156 #define _I2C_READ 0x04
7157 #define _S 0x08
7158 #define _I2C_START 0x08
7159 #define _P 0x10
7160 #define _I2C_STOP 0x10
7161 #define _D_NOT_A 0x20
7162 #define _D 0x20
7163 #define _D_A 0x20
7164 #define _NOT_A 0x20
7165 #define _NOT_ADDRESS 0x20
7166 #define _DATA_ADDRESS 0x20
7167 #define _I2C_DAT 0x20
7168 #define _CKE 0x40
7169 #define _SMP 0x80
7171 //==============================================================================
7174 //==============================================================================
7175 // SSPSTAT Bits
7177 extern __at(0x0FC7) __sfr SSPSTAT;
7179 typedef union
7181 struct
7183 unsigned BF : 1;
7184 unsigned UA : 1;
7185 unsigned R_NOT_W : 1;
7186 unsigned S : 1;
7187 unsigned P : 1;
7188 unsigned D_NOT_A : 1;
7189 unsigned CKE : 1;
7190 unsigned SMP : 1;
7193 struct
7195 unsigned : 1;
7196 unsigned : 1;
7197 unsigned R : 1;
7198 unsigned I2C_START : 1;
7199 unsigned I2C_STOP : 1;
7200 unsigned D : 1;
7201 unsigned : 1;
7202 unsigned : 1;
7205 struct
7207 unsigned : 1;
7208 unsigned : 1;
7209 unsigned R_W : 1;
7210 unsigned : 1;
7211 unsigned : 1;
7212 unsigned D_A : 1;
7213 unsigned : 1;
7214 unsigned : 1;
7217 struct
7219 unsigned : 1;
7220 unsigned : 1;
7221 unsigned NOT_W : 1;
7222 unsigned : 1;
7223 unsigned : 1;
7224 unsigned NOT_A : 1;
7225 unsigned : 1;
7226 unsigned : 1;
7229 struct
7231 unsigned : 1;
7232 unsigned : 1;
7233 unsigned NOT_WRITE : 1;
7234 unsigned : 1;
7235 unsigned : 1;
7236 unsigned NOT_ADDRESS : 1;
7237 unsigned : 1;
7238 unsigned : 1;
7241 struct
7243 unsigned : 1;
7244 unsigned : 1;
7245 unsigned READ_WRITE : 1;
7246 unsigned : 1;
7247 unsigned : 1;
7248 unsigned DATA_ADDRESS : 1;
7249 unsigned : 1;
7250 unsigned : 1;
7253 struct
7255 unsigned : 1;
7256 unsigned : 1;
7257 unsigned I2C_READ : 1;
7258 unsigned : 1;
7259 unsigned : 1;
7260 unsigned I2C_DAT : 1;
7261 unsigned : 1;
7262 unsigned : 1;
7264 } __SSPSTATbits_t;
7266 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
7268 #define _SSPSTAT_BF 0x01
7269 #define _SSPSTAT_UA 0x02
7270 #define _SSPSTAT_R_NOT_W 0x04
7271 #define _SSPSTAT_R 0x04
7272 #define _SSPSTAT_R_W 0x04
7273 #define _SSPSTAT_NOT_W 0x04
7274 #define _SSPSTAT_NOT_WRITE 0x04
7275 #define _SSPSTAT_READ_WRITE 0x04
7276 #define _SSPSTAT_I2C_READ 0x04
7277 #define _SSPSTAT_S 0x08
7278 #define _SSPSTAT_I2C_START 0x08
7279 #define _SSPSTAT_P 0x10
7280 #define _SSPSTAT_I2C_STOP 0x10
7281 #define _SSPSTAT_D_NOT_A 0x20
7282 #define _SSPSTAT_D 0x20
7283 #define _SSPSTAT_D_A 0x20
7284 #define _SSPSTAT_NOT_A 0x20
7285 #define _SSPSTAT_NOT_ADDRESS 0x20
7286 #define _SSPSTAT_DATA_ADDRESS 0x20
7287 #define _SSPSTAT_I2C_DAT 0x20
7288 #define _SSPSTAT_CKE 0x40
7289 #define _SSPSTAT_SMP 0x80
7291 //==============================================================================
7294 //==============================================================================
7295 // SSP1ADD Bits
7297 extern __at(0x0FC8) __sfr SSP1ADD;
7299 typedef struct
7301 unsigned MSK0 : 1;
7302 unsigned MSK1 : 1;
7303 unsigned MSK2 : 1;
7304 unsigned MSK3 : 1;
7305 unsigned MSK4 : 1;
7306 unsigned MSK5 : 1;
7307 unsigned MSK6 : 1;
7308 unsigned MSK7 : 1;
7309 } __SSP1ADDbits_t;
7311 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
7313 #define _MSK0 0x01
7314 #define _MSK1 0x02
7315 #define _MSK2 0x04
7316 #define _MSK3 0x08
7317 #define _MSK4 0x10
7318 #define _MSK5 0x20
7319 #define _MSK6 0x40
7320 #define _MSK7 0x80
7322 //==============================================================================
7325 //==============================================================================
7326 // SSPADD Bits
7328 extern __at(0x0FC8) __sfr SSPADD;
7330 typedef struct
7332 unsigned MSK0 : 1;
7333 unsigned MSK1 : 1;
7334 unsigned MSK2 : 1;
7335 unsigned MSK3 : 1;
7336 unsigned MSK4 : 1;
7337 unsigned MSK5 : 1;
7338 unsigned MSK6 : 1;
7339 unsigned MSK7 : 1;
7340 } __SSPADDbits_t;
7342 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
7344 #define _SSPADD_MSK0 0x01
7345 #define _SSPADD_MSK1 0x02
7346 #define _SSPADD_MSK2 0x04
7347 #define _SSPADD_MSK3 0x08
7348 #define _SSPADD_MSK4 0x10
7349 #define _SSPADD_MSK5 0x20
7350 #define _SSPADD_MSK6 0x40
7351 #define _SSPADD_MSK7 0x80
7353 //==============================================================================
7355 extern __at(0x0FC9) __sfr SSP1BUF;
7356 extern __at(0x0FC9) __sfr SSPBUF;
7358 //==============================================================================
7359 // T2CON Bits
7361 extern __at(0x0FCA) __sfr T2CON;
7363 typedef union
7365 struct
7367 unsigned T2CKPS0 : 1;
7368 unsigned T2CKPS1 : 1;
7369 unsigned TMR2ON : 1;
7370 unsigned T2OUTPS0 : 1;
7371 unsigned T2OUTPS1 : 1;
7372 unsigned T2OUTPS2 : 1;
7373 unsigned T2OUTPS3 : 1;
7374 unsigned : 1;
7377 struct
7379 unsigned T2CKPS : 2;
7380 unsigned : 6;
7383 struct
7385 unsigned : 3;
7386 unsigned T2OUTPS : 4;
7387 unsigned : 1;
7389 } __T2CONbits_t;
7391 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
7393 #define _T2CKPS0 0x01
7394 #define _T2CKPS1 0x02
7395 #define _TMR2ON 0x04
7396 #define _T2OUTPS0 0x08
7397 #define _T2OUTPS1 0x10
7398 #define _T2OUTPS2 0x20
7399 #define _T2OUTPS3 0x40
7401 //==============================================================================
7403 extern __at(0x0FCB) __sfr PR2;
7404 extern __at(0x0FCC) __sfr TMR2;
7406 //==============================================================================
7407 // T1CON Bits
7409 extern __at(0x0FCD) __sfr T1CON;
7411 typedef union
7413 struct
7415 unsigned TMR1ON : 1;
7416 unsigned RD16 : 1;
7417 unsigned NOT_T1SYNC : 1;
7418 unsigned SOSCEN : 1;
7419 unsigned T1CKPS0 : 1;
7420 unsigned T1CKPS1 : 1;
7421 unsigned TMR1CS0 : 1;
7422 unsigned TMR1CS1 : 1;
7425 struct
7427 unsigned : 4;
7428 unsigned T1CKPS : 2;
7429 unsigned : 2;
7432 struct
7434 unsigned : 6;
7435 unsigned TMR1CS : 2;
7437 } __T1CONbits_t;
7439 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
7441 #define _TMR1ON 0x01
7442 #define _RD16 0x02
7443 #define _NOT_T1SYNC 0x04
7444 #define _SOSCEN 0x08
7445 #define _T1CKPS0 0x10
7446 #define _T1CKPS1 0x20
7447 #define _TMR1CS0 0x40
7448 #define _TMR1CS1 0x80
7450 //==============================================================================
7452 extern __at(0x0FCE) __sfr TMR1;
7453 extern __at(0x0FCE) __sfr TMR1L;
7454 extern __at(0x0FCF) __sfr TMR1H;
7456 //==============================================================================
7457 // RCON Bits
7459 extern __at(0x0FD0) __sfr RCON;
7461 typedef union
7463 struct
7465 unsigned NOT_BOR : 1;
7466 unsigned NOT_POR : 1;
7467 unsigned NOT_PD : 1;
7468 unsigned NOT_TO : 1;
7469 unsigned NOT_RI : 1;
7470 unsigned NOT_CM : 1;
7471 unsigned SBOREN : 1;
7472 unsigned IPEN : 1;
7475 struct
7477 unsigned BOR : 1;
7478 unsigned POR : 1;
7479 unsigned PD : 1;
7480 unsigned TO : 1;
7481 unsigned RI : 1;
7482 unsigned CM : 1;
7483 unsigned : 1;
7484 unsigned : 1;
7486 } __RCONbits_t;
7488 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
7490 #define _NOT_BOR 0x01
7491 #define _BOR 0x01
7492 #define _NOT_POR 0x02
7493 #define _POR 0x02
7494 #define _NOT_PD 0x04
7495 #define _PD 0x04
7496 #define _NOT_TO 0x08
7497 #define _TO 0x08
7498 #define _NOT_RI 0x10
7499 #define _RI 0x10
7500 #define _NOT_CM 0x20
7501 #define _CM 0x20
7502 #define _SBOREN 0x40
7503 #define _IPEN 0x80
7505 //==============================================================================
7508 //==============================================================================
7509 // WDTCON Bits
7511 extern __at(0x0FD1) __sfr WDTCON;
7513 typedef union
7515 struct
7517 unsigned SWDTEN : 1;
7518 unsigned ULPSINK : 1;
7519 unsigned ULPEN : 1;
7520 unsigned : 1;
7521 unsigned SRETEN : 1;
7522 unsigned ULPLVL : 1;
7523 unsigned : 1;
7524 unsigned REGSLP : 1;
7527 struct
7529 unsigned SWDTE : 1;
7530 unsigned : 1;
7531 unsigned : 1;
7532 unsigned : 1;
7533 unsigned : 1;
7534 unsigned : 1;
7535 unsigned : 1;
7536 unsigned : 1;
7538 } __WDTCONbits_t;
7540 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
7542 #define _SWDTEN 0x01
7543 #define _SWDTE 0x01
7544 #define _ULPSINK 0x02
7545 #define _ULPEN 0x04
7546 #define _SRETEN 0x10
7547 #define _ULPLVL 0x20
7548 #define _REGSLP 0x80
7550 //==============================================================================
7553 //==============================================================================
7554 // IPR5 Bits
7556 extern __at(0x0FD2) __sfr IPR5;
7558 typedef struct
7560 unsigned TMR4IP : 1;
7561 unsigned TMR5IP : 1;
7562 unsigned TMR6IP : 1;
7563 unsigned : 1;
7564 unsigned TMR8IP : 1;
7565 unsigned : 1;
7566 unsigned : 1;
7567 unsigned : 1;
7568 } __IPR5bits_t;
7570 extern __at(0x0FD2) volatile __IPR5bits_t IPR5bits;
7572 #define _TMR4IP 0x01
7573 #define _TMR5IP 0x02
7574 #define _TMR6IP 0x04
7575 #define _TMR8IP 0x10
7577 //==============================================================================
7580 //==============================================================================
7581 // OSCCON Bits
7583 extern __at(0x0FD3) __sfr OSCCON;
7585 typedef union
7587 struct
7589 unsigned SCS0 : 1;
7590 unsigned SCS1 : 1;
7591 unsigned HFIOFS : 1;
7592 unsigned OSTS : 1;
7593 unsigned IRCF0 : 1;
7594 unsigned IRCF1 : 1;
7595 unsigned IRCF2 : 1;
7596 unsigned IDLEN : 1;
7599 struct
7601 unsigned SCS : 2;
7602 unsigned : 6;
7605 struct
7607 unsigned : 4;
7608 unsigned IRCF : 3;
7609 unsigned : 1;
7611 } __OSCCONbits_t;
7613 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
7615 #define _SCS0 0x01
7616 #define _SCS1 0x02
7617 #define _HFIOFS 0x04
7618 #define _OSTS 0x08
7619 #define _IRCF0 0x10
7620 #define _IRCF1 0x20
7621 #define _IRCF2 0x40
7622 #define _IDLEN 0x80
7624 //==============================================================================
7626 extern __at(0x0FD4) __sfr SPBRGH1;
7628 //==============================================================================
7629 // T0CON Bits
7631 extern __at(0x0FD5) __sfr T0CON;
7633 typedef union
7635 struct
7637 unsigned T0PS0 : 1;
7638 unsigned T0PS1 : 1;
7639 unsigned T0PS2 : 1;
7640 unsigned PSA : 1;
7641 unsigned T0SE : 1;
7642 unsigned T0CS : 1;
7643 unsigned T08BIT : 1;
7644 unsigned TMR0ON : 1;
7647 struct
7649 unsigned T0PS : 3;
7650 unsigned : 5;
7652 } __T0CONbits_t;
7654 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
7656 #define _T0PS0 0x01
7657 #define _T0PS1 0x02
7658 #define _T0PS2 0x04
7659 #define _PSA 0x08
7660 #define _T0SE 0x10
7661 #define _T0CS 0x20
7662 #define _T08BIT 0x40
7663 #define _TMR0ON 0x80
7665 //==============================================================================
7667 extern __at(0x0FD6) __sfr TMR0;
7668 extern __at(0x0FD6) __sfr TMR0L;
7669 extern __at(0x0FD7) __sfr TMR0H;
7671 //==============================================================================
7672 // STATUS Bits
7674 extern __at(0x0FD8) __sfr STATUS;
7676 typedef struct
7678 unsigned C : 1;
7679 unsigned DC : 1;
7680 unsigned Z : 1;
7681 unsigned OV : 1;
7682 unsigned N : 1;
7683 unsigned : 1;
7684 unsigned : 1;
7685 unsigned : 1;
7686 } __STATUSbits_t;
7688 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
7690 #define _C 0x01
7691 #define _DC 0x02
7692 #define _Z 0x04
7693 #define _OV 0x08
7694 #define _N 0x10
7696 //==============================================================================
7698 extern __at(0x0FD9) __sfr FSR2L;
7699 extern __at(0x0FDA) __sfr FSR2H;
7700 extern __at(0x0FDB) __sfr PLUSW2;
7701 extern __at(0x0FDC) __sfr PREINC2;
7702 extern __at(0x0FDD) __sfr POSTDEC2;
7703 extern __at(0x0FDE) __sfr POSTINC2;
7704 extern __at(0x0FDF) __sfr INDF2;
7705 extern __at(0x0FE0) __sfr BSR;
7706 extern __at(0x0FE1) __sfr FSR1L;
7707 extern __at(0x0FE2) __sfr FSR1H;
7708 extern __at(0x0FE3) __sfr PLUSW1;
7709 extern __at(0x0FE4) __sfr PREINC1;
7710 extern __at(0x0FE5) __sfr POSTDEC1;
7711 extern __at(0x0FE6) __sfr POSTINC1;
7712 extern __at(0x0FE7) __sfr INDF1;
7713 extern __at(0x0FE8) __sfr WREG;
7714 extern __at(0x0FE9) __sfr FSR0L;
7715 extern __at(0x0FEA) __sfr FSR0H;
7716 extern __at(0x0FEB) __sfr PLUSW0;
7717 extern __at(0x0FEC) __sfr PREINC0;
7718 extern __at(0x0FED) __sfr POSTDEC0;
7719 extern __at(0x0FEE) __sfr POSTINC0;
7720 extern __at(0x0FEF) __sfr INDF0;
7722 //==============================================================================
7723 // INTCON3 Bits
7725 extern __at(0x0FF0) __sfr INTCON3;
7727 typedef union
7729 struct
7731 unsigned INT1IF : 1;
7732 unsigned INT2IF : 1;
7733 unsigned INT3IF : 1;
7734 unsigned INT1IE : 1;
7735 unsigned INT2IE : 1;
7736 unsigned INT3IE : 1;
7737 unsigned INT1IP : 1;
7738 unsigned INT2IP : 1;
7741 struct
7743 unsigned INT1F : 1;
7744 unsigned INT2F : 1;
7745 unsigned INT3F : 1;
7746 unsigned INT1E : 1;
7747 unsigned INT2E : 1;
7748 unsigned INT3E : 1;
7749 unsigned INT1P : 1;
7750 unsigned INT2P : 1;
7752 } __INTCON3bits_t;
7754 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
7756 #define _INT1IF 0x01
7757 #define _INT1F 0x01
7758 #define _INT2IF 0x02
7759 #define _INT2F 0x02
7760 #define _INT3IF 0x04
7761 #define _INT3F 0x04
7762 #define _INT1IE 0x08
7763 #define _INT1E 0x08
7764 #define _INT2IE 0x10
7765 #define _INT2E 0x10
7766 #define _INT3IE 0x20
7767 #define _INT3E 0x20
7768 #define _INT1IP 0x40
7769 #define _INT1P 0x40
7770 #define _INT2IP 0x80
7771 #define _INT2P 0x80
7773 //==============================================================================
7776 //==============================================================================
7777 // INTCON2 Bits
7779 extern __at(0x0FF1) __sfr INTCON2;
7781 typedef union
7783 struct
7785 unsigned RBIP : 1;
7786 unsigned INT3IP : 1;
7787 unsigned TMR0IP : 1;
7788 unsigned INTEDG3 : 1;
7789 unsigned INTEDG2 : 1;
7790 unsigned INTEDG1 : 1;
7791 unsigned INTEDG0 : 1;
7792 unsigned NOT_RBPU : 1;
7795 struct
7797 unsigned : 1;
7798 unsigned INT3P : 1;
7799 unsigned T0IP : 1;
7800 unsigned : 1;
7801 unsigned : 1;
7802 unsigned : 1;
7803 unsigned : 1;
7804 unsigned RBPU : 1;
7806 } __INTCON2bits_t;
7808 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
7810 #define _RBIP 0x01
7811 #define _INT3IP 0x02
7812 #define _INT3P 0x02
7813 #define _TMR0IP 0x04
7814 #define _T0IP 0x04
7815 #define _INTEDG3 0x08
7816 #define _INTEDG2 0x10
7817 #define _INTEDG1 0x20
7818 #define _INTEDG0 0x40
7819 #define _NOT_RBPU 0x80
7820 #define _RBPU 0x80
7822 //==============================================================================
7825 //==============================================================================
7826 // INTCON Bits
7828 extern __at(0x0FF2) __sfr INTCON;
7830 typedef union
7832 struct
7834 unsigned RBIF : 1;
7835 unsigned INT0IF : 1;
7836 unsigned TMR0IF : 1;
7837 unsigned RBIE : 1;
7838 unsigned INT0IE : 1;
7839 unsigned TMR0IE : 1;
7840 unsigned PEIE_GIEL : 1;
7841 unsigned GIE_GIEH : 1;
7844 struct
7846 unsigned : 1;
7847 unsigned INT0F : 1;
7848 unsigned T0IF : 1;
7849 unsigned : 1;
7850 unsigned INT0E : 1;
7851 unsigned T0IE : 1;
7852 unsigned PEIE : 1;
7853 unsigned GIE : 1;
7856 struct
7858 unsigned : 1;
7859 unsigned : 1;
7860 unsigned : 1;
7861 unsigned : 1;
7862 unsigned : 1;
7863 unsigned : 1;
7864 unsigned GIEL : 1;
7865 unsigned GIEH : 1;
7867 } __INTCONbits_t;
7869 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
7871 #define _RBIF 0x01
7872 #define _INT0IF 0x02
7873 #define _INT0F 0x02
7874 #define _TMR0IF 0x04
7875 #define _T0IF 0x04
7876 #define _RBIE 0x08
7877 #define _INT0IE 0x10
7878 #define _INT0E 0x10
7879 #define _TMR0IE 0x20
7880 #define _T0IE 0x20
7881 #define _PEIE_GIEL 0x40
7882 #define _PEIE 0x40
7883 #define _GIEL 0x40
7884 #define _GIE_GIEH 0x80
7885 #define _GIE 0x80
7886 #define _GIEH 0x80
7888 //==============================================================================
7890 extern __at(0x0FF3) __sfr PROD;
7891 extern __at(0x0FF3) __sfr PRODL;
7892 extern __at(0x0FF4) __sfr PRODH;
7893 extern __at(0x0FF5) __sfr TABLAT;
7894 extern __at(0x0FF6) __sfr TBLPTR;
7895 extern __at(0x0FF6) __sfr TBLPTRL;
7896 extern __at(0x0FF7) __sfr TBLPTRH;
7897 extern __at(0x0FF8) __sfr TBLPTRU;
7898 extern __at(0x0FF9) __sfr PC;
7899 extern __at(0x0FF9) __sfr PCL;
7900 extern __at(0x0FFA) __sfr PCLATH;
7901 extern __at(0x0FFB) __sfr PCLATU;
7903 //==============================================================================
7904 // STKPTR Bits
7906 extern __at(0x0FFC) __sfr STKPTR;
7908 typedef union
7910 struct
7912 unsigned SP0 : 1;
7913 unsigned SP1 : 1;
7914 unsigned SP2 : 1;
7915 unsigned SP3 : 1;
7916 unsigned SP4 : 1;
7917 unsigned : 1;
7918 unsigned STKUNF : 1;
7919 unsigned STKFUL : 1;
7922 struct
7924 unsigned : 1;
7925 unsigned : 1;
7926 unsigned : 1;
7927 unsigned : 1;
7928 unsigned : 1;
7929 unsigned : 1;
7930 unsigned : 1;
7931 unsigned STKOVF : 1;
7934 struct
7936 unsigned SP : 5;
7937 unsigned : 3;
7939 } __STKPTRbits_t;
7941 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
7943 #define _SP0 0x01
7944 #define _SP1 0x02
7945 #define _SP2 0x04
7946 #define _SP3 0x08
7947 #define _SP4 0x10
7948 #define _STKUNF 0x40
7949 #define _STKFUL 0x80
7950 #define _STKOVF 0x80
7952 //==============================================================================
7954 extern __at(0x0FFD) __sfr TOS;
7955 extern __at(0x0FFD) __sfr TOSL;
7956 extern __at(0x0FFE) __sfr TOSH;
7957 extern __at(0x0FFF) __sfr TOSU;
7959 //==============================================================================
7961 // Configuration Bits
7963 //==============================================================================
7965 #define __CONFIG1L 0x300000
7966 #define __CONFIG1H 0x300001
7967 #define __CONFIG2L 0x300002
7968 #define __CONFIG2H 0x300003
7969 #define __CONFIG3L 0x300004
7970 #define __CONFIG3H 0x300005
7971 #define __CONFIG4L 0x300006
7972 #define __CONFIG5L 0x300008
7973 #define __CONFIG5H 0x300009
7974 #define __CONFIG6L 0x30000A
7975 #define __CONFIG6H 0x30000B
7976 #define __CONFIG7L 0x30000C
7977 #define __CONFIG7H 0x30000D
7979 //----------------------------- CONFIG1L Options -------------------------------
7981 #define _RETEN_OFF_1L 0xFE // Disabled - Controlled by SRETEN bit.
7982 #define _RETEN_ON_1L 0xFF // Enabled.
7983 #define _INTOSCSEL_LOW_1L 0xFB // LF-INTOSC in Low-power mode during Sleep.
7984 #define _INTOSCSEL_HIGH_1L 0xFF // LF-INTOSC in High-power mode during Sleep.
7985 #define _SOSCSEL_LOW_1L 0xEF // Low Power SOSC circuit selected.
7986 #define _SOSCSEL_DIG_1L 0xF7 // Digital (SCLKI) mode.
7987 #define _SOSCSEL_HIGH_1L 0xFF // High Power SOSC circuit selected.
7988 #define _XINST_OFF_1L 0xBF // Disabled.
7989 #define _XINST_ON_1L 0xFF // Enabled.
7991 //----------------------------- CONFIG1H Options -------------------------------
7993 #define _FOSC_LP_1H 0xF0 // LP oscillator.
7994 #define _FOSC_XT_1H 0xF1 // XT oscillator.
7995 #define _FOSC_HS2_1H 0xF2 // HS oscillator (High power, 16 MHz - 25 MHz).
7996 #define _FOSC_HS1_1H 0xF3 // HS oscillator (Medium power, 4 MHz - 16 MHz).
7997 #define _FOSC_EC3IO_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (High power, 16 MHz - 64 MHz).
7998 #define _FOSC_EC3_1H 0xF5 // EC oscillator (High power, 16 MHz - 64 MHz).
7999 #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
8000 #define _FOSC_RCIO_1H 0xF7 // External RC oscillator.
8001 #define _FOSC_INTIO2_1H 0xF8 // Internal RC oscillator.
8002 #define _FOSC_INTIO1_1H 0xF9 // Internal RC oscillator, CLKOUT function on OSC2.
8003 #define _FOSC_EC2IO_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (Medium power, 160 kHz - 16 MHz).
8004 #define _FOSC_EC2_1H 0xFB // EC oscillator (Medium power, 160 kHz - 16 MHz).
8005 #define _FOSC_EC1IO_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (Low power, DC - 160 kHz).
8006 #define _FOSC_EC1_1H 0xFD // EC oscillator (Low power, DC - 160 kHz).
8007 #define _PLLCFG_OFF_1H 0xEF // Disabled.
8008 #define _PLLCFG_ON_1H 0xFF // Enabled.
8009 #define _FCMEN_OFF_1H 0xBF // Disabled.
8010 #define _FCMEN_ON_1H 0xFF // Enabled.
8011 #define _IESO_OFF_1H 0x7F // Disabled.
8012 #define _IESO_ON_1H 0xFF // Enabled.
8014 //----------------------------- CONFIG2L Options -------------------------------
8016 #define _PWRTEN_ON_2L 0xFE // Enabled.
8017 #define _PWRTEN_OFF_2L 0xFF // Disabled.
8018 #define _BOREN_OFF_2L 0xF9 // Disabled in hardware, SBOREN disabled.
8019 #define _BOREN_ON_2L 0xFB // Controlled with SBOREN bit.
8020 #define _BOREN_NOSLP_2L 0xFD // Enabled while active, disabled in SLEEP, SBOREN disabled.
8021 #define _BOREN_SBORDIS_2L 0xFF // Enabled in hardware, SBOREN disabled.
8022 #define _BORV_0_2L 0xE7 // 3.0V.
8023 #define _BORV_1_2L 0xEF // 2.7V.
8024 #define _BORV_2_2L 0xF7 // 2.0V.
8025 #define _BORV_3_2L 0xFF // 1.8V.
8026 #define _BORPWR_LOW_2L 0x9F // BORMV set to low power level.
8027 #define _BORPWR_MEDIUM_2L 0xBF // BORMV set to medium power level.
8028 #define _BORPWR_HIGH_2L 0xDF // BORMV set to high power level.
8029 #define _BORPWR_ZPBORMV_2L 0xFF // ZPBORMV instead of BORMV is selected.
8031 //----------------------------- CONFIG2H Options -------------------------------
8033 #define _WDTEN_OFF_2H 0xFC // WDT disabled in hardware; SWDTEN bit disabled.
8034 #define _WDTEN_NOSLP_2H 0xFD // WDT enabled only while device is active and disabled in Sleep mode; SWDTEN bit disabled.
8035 #define _WDTEN_ON_2H 0xFE // WDT controlled by SWDTEN bit setting.
8036 #define _WDTEN_SWDTDIS_2H 0xFF // WDT enabled in hardware; SWDTEN bit disabled.
8037 #define _WDTPS_1_2H 0x83 // 1:1.
8038 #define _WDTPS_2_2H 0x87 // 1:2.
8039 #define _WDTPS_4_2H 0x8B // 1:4.
8040 #define _WDTPS_8_2H 0x8F // 1:8.
8041 #define _WDTPS_16_2H 0x93 // 1:16.
8042 #define _WDTPS_32_2H 0x97 // 1:32.
8043 #define _WDTPS_64_2H 0x9B // 1:64.
8044 #define _WDTPS_128_2H 0x9F // 1:128.
8045 #define _WDTPS_256_2H 0xA3 // 1:256.
8046 #define _WDTPS_512_2H 0xA7 // 1:512.
8047 #define _WDTPS_1024_2H 0xAB // 1:1024.
8048 #define _WDTPS_2048_2H 0xAF // 1:2048.
8049 #define _WDTPS_4096_2H 0xB3 // 1:4096.
8050 #define _WDTPS_8192_2H 0xB7 // 1:8192.
8051 #define _WDTPS_16384_2H 0xBB // 1:16384.
8052 #define _WDTPS_32768_2H 0xBF // 1:32768.
8053 #define _WDTPS_65536_2H 0xC3 // 1:65536.
8054 #define _WDTPS_131072_2H 0xC7 // 1:131072.
8055 #define _WDTPS_262144_2H 0xCB // 1:262144.
8056 #define _WDTPS_524288_2H 0xCF // 1:524288.
8057 #define _WDTPS_1048576_2H 0xFF // 1:1048576.
8059 //----------------------------- CONFIG3L Options -------------------------------
8061 #define _RTCOSC_INTOSCREF_3L 0xFE // RTCC uses INTRC.
8062 #define _RTCOSC_SOSCREF_3L 0xFF // RTCC uses SOSC.
8064 //----------------------------- CONFIG3H Options -------------------------------
8066 #define _CCP2MX_PORTBE_3H 0xFE // RE7-Microcontroller Mode/RB3-All other modes.
8067 #define _CCP2MX_PORTC_3H 0xFF // RC1.
8068 #define _MSSPMSK_MSK5_3H 0xF7 // 5 bit address masking mode.
8069 #define _MSSPMSK_MSK7_3H 0xFF // 7 Bit address masking mode.
8070 #define _MCLRE_OFF_3H 0x7F // MCLR Disabled, RG5 Enabled.
8071 #define _MCLRE_ON_3H 0xFF // MCLR Enabled, RG5 Disabled.
8073 //----------------------------- CONFIG4L Options -------------------------------
8075 #define _STVREN_OFF_4L 0xFE // Disabled.
8076 #define _STVREN_ON_4L 0xFF // Enabled.
8077 #define _BBSIZ_BB1K_4L 0xEF // 1K word Boot Block size.
8078 #define _BBSIZ_BB2K_4L 0xFF // 2K word Boot Block size.
8079 #define _DEBUG_ON_4L 0x7F // Enabled.
8080 #define _DEBUG_OFF_4L 0xFF // Disabled.
8082 //----------------------------- CONFIG5L Options -------------------------------
8084 #define _CP0_ON_5L 0xFE // Enabled.
8085 #define _CP0_OFF_5L 0xFF // Disabled.
8086 #define _CP1_ON_5L 0xFD // Enabled.
8087 #define _CP1_OFF_5L 0xFF // Disabled.
8088 #define _CP2_ON_5L 0xFB // Enabled.
8089 #define _CP2_OFF_5L 0xFF // Disabled.
8090 #define _CP3_ON_5L 0xF7 // Enabled.
8091 #define _CP3_OFF_5L 0xFF // Disabled.
8093 //----------------------------- CONFIG5H Options -------------------------------
8095 #define _CPB_ON_5H 0xBF // Enabled.
8096 #define _CPB_OFF_5H 0xFF // Disabled.
8097 #define _CPD_ON_5H 0x7F // Enabled.
8098 #define _CPD_OFF_5H 0xFF // Disabled.
8100 //----------------------------- CONFIG6L Options -------------------------------
8102 #define _WRT0_ON_6L 0xFE // Enabled.
8103 #define _WRT0_OFF_6L 0xFF // Disabled.
8104 #define _WRT1_ON_6L 0xFD // Enabled.
8105 #define _WRT1_OFF_6L 0xFF // Disabled.
8106 #define _WRT2_ON_6L 0xFB // Enabled.
8107 #define _WRT2_OFF_6L 0xFF // Disabled.
8108 #define _WRT3_ON_6L 0xF7 // Enabled.
8109 #define _WRT3_OFF_6L 0xFF // Disabled.
8111 //----------------------------- CONFIG6H Options -------------------------------
8113 #define _WRTC_ON_6H 0xDF // Enabled.
8114 #define _WRTC_OFF_6H 0xFF // Disabled.
8115 #define _WRTB_ON_6H 0xBF // Enabled.
8116 #define _WRTB_OFF_6H 0xFF // Disabled.
8117 #define _WRTD_ON_6H 0x7F // Enabled.
8118 #define _WRTD_OFF_6H 0xFF // Disabled.
8120 //----------------------------- CONFIG7L Options -------------------------------
8122 #define _EBRT0_ON_7L 0xFE // Enabled.
8123 #define _EBRT0_OFF_7L 0xFF // Disabled.
8124 #define _EBRT1_ON_7L 0xFD // Enabled.
8125 #define _EBRT1_OFF_7L 0xFF // Disabled.
8126 #define _EBRT2_ON_7L 0xFB // Enabled.
8127 #define _EBRT2_OFF_7L 0xFF // Disabled.
8128 #define _EBRT3_ON_7L 0xF7 // Enabled.
8129 #define _EBRT3_OFF_7L 0xFF // Disabled.
8131 //----------------------------- CONFIG7H Options -------------------------------
8133 #define _EBRTB_ON_7H 0xBF // Enabled.
8134 #define _EBRTB_OFF_7H 0xFF // Disabled.
8136 //==============================================================================
8138 #define __DEVID1 0x3FFFFE
8139 #define __DEVID2 0x3FFFFF
8141 #define __IDLOC0 0x200000
8142 #define __IDLOC1 0x200001
8143 #define __IDLOC2 0x200002
8144 #define __IDLOC3 0x200003
8145 #define __IDLOC4 0x200004
8146 #define __IDLOC5 0x200005
8147 #define __IDLOC6 0x200006
8148 #define __IDLOC7 0x200007
8150 #endif // #ifndef __PIC18F65K90_H__