struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f86j90.h
blobe0c4184895eb45c171180751ec47ca75d5e820c5
1 /*
2 * This declarations of the PIC18F86J90 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:38 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 __PIC18F86J90_H__
26 #define __PIC18F86J90_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // PADCFG1 Bits
40 extern __at(0x0F54) __sfr PADCFG1;
42 typedef union
44 struct
46 unsigned : 1;
47 unsigned RTSECSEL0 : 1;
48 unsigned RTSECSEL1 : 1;
49 unsigned : 1;
50 unsigned : 1;
51 unsigned : 1;
52 unsigned : 1;
53 unsigned : 1;
56 struct
58 unsigned : 1;
59 unsigned RTSECSEL : 2;
60 unsigned : 5;
62 } __PADCFG1bits_t;
64 extern __at(0x0F54) volatile __PADCFG1bits_t PADCFG1bits;
66 #define _RTSECSEL0 0x02
67 #define _RTSECSEL1 0x04
69 //==============================================================================
72 //==============================================================================
73 // CTMUICON Bits
75 extern __at(0x0F55) __sfr CTMUICON;
77 typedef union
79 struct
81 unsigned IRNG0 : 1;
82 unsigned IRNG1 : 1;
83 unsigned ITRIM0 : 1;
84 unsigned ITRIM1 : 1;
85 unsigned ITRIM2 : 1;
86 unsigned ITRIM3 : 1;
87 unsigned ITRIM4 : 1;
88 unsigned ITRIM5 : 1;
91 struct
93 unsigned IRNG : 2;
94 unsigned : 6;
97 struct
99 unsigned : 2;
100 unsigned ITRIM : 6;
102 } __CTMUICONbits_t;
104 extern __at(0x0F55) volatile __CTMUICONbits_t CTMUICONbits;
106 #define _IRNG0 0x01
107 #define _IRNG1 0x02
108 #define _ITRIM0 0x04
109 #define _ITRIM1 0x08
110 #define _ITRIM2 0x10
111 #define _ITRIM3 0x20
112 #define _ITRIM4 0x40
113 #define _ITRIM5 0x80
115 //==============================================================================
118 //==============================================================================
119 // CTMUCONL Bits
121 extern __at(0x0F56) __sfr CTMUCONL;
123 typedef union
125 struct
127 unsigned EDG1STAT : 1;
128 unsigned EDG2STAT : 1;
129 unsigned EDG1SEL0 : 1;
130 unsigned EDG1SEL1 : 1;
131 unsigned EDG1POL : 1;
132 unsigned EDG2SEL0 : 1;
133 unsigned EDG2SEL1 : 1;
134 unsigned EDG2POL : 1;
137 struct
139 unsigned : 2;
140 unsigned EDG1SEL : 2;
141 unsigned : 4;
144 struct
146 unsigned : 5;
147 unsigned EDG2SEL : 2;
148 unsigned : 1;
150 } __CTMUCONLbits_t;
152 extern __at(0x0F56) volatile __CTMUCONLbits_t CTMUCONLbits;
154 #define _EDG1STAT 0x01
155 #define _EDG2STAT 0x02
156 #define _EDG1SEL0 0x04
157 #define _EDG1SEL1 0x08
158 #define _EDG1POL 0x10
159 #define _EDG2SEL0 0x20
160 #define _EDG2SEL1 0x40
161 #define _EDG2POL 0x80
163 //==============================================================================
166 //==============================================================================
167 // CTMUCONH Bits
169 extern __at(0x0F57) __sfr CTMUCONH;
171 typedef struct
173 unsigned CTTRIG : 1;
174 unsigned IDISSEN : 1;
175 unsigned EDGSEQEN : 1;
176 unsigned EDGEN : 1;
177 unsigned TGEN : 1;
178 unsigned CTMUSIDL : 1;
179 unsigned : 1;
180 unsigned CTMUEN : 1;
181 } __CTMUCONHbits_t;
183 extern __at(0x0F57) volatile __CTMUCONHbits_t CTMUCONHbits;
185 #define _CTTRIG 0x01
186 #define _IDISSEN 0x02
187 #define _EDGSEQEN 0x04
188 #define _EDGEN 0x08
189 #define _TGEN 0x10
190 #define _CTMUSIDL 0x20
191 #define _CTMUEN 0x80
193 //==============================================================================
195 extern __at(0x0F58) __sfr ALRMVALL;
196 extern __at(0x0F59) __sfr ALRMVALH;
198 //==============================================================================
199 // ALRMRPT Bits
201 extern __at(0x0F5A) __sfr ALRMRPT;
203 typedef struct
205 unsigned ARPT0 : 1;
206 unsigned ARPT1 : 1;
207 unsigned ARPT2 : 1;
208 unsigned ARPT3 : 1;
209 unsigned ARPT4 : 1;
210 unsigned ARPT5 : 1;
211 unsigned ARPT6 : 1;
212 unsigned ARPT7 : 1;
213 } __ALRMRPTbits_t;
215 extern __at(0x0F5A) volatile __ALRMRPTbits_t ALRMRPTbits;
217 #define _ARPT0 0x01
218 #define _ARPT1 0x02
219 #define _ARPT2 0x04
220 #define _ARPT3 0x08
221 #define _ARPT4 0x10
222 #define _ARPT5 0x20
223 #define _ARPT6 0x40
224 #define _ARPT7 0x80
226 //==============================================================================
229 //==============================================================================
230 // ALRMCFG Bits
232 extern __at(0x0F5B) __sfr ALRMCFG;
234 typedef union
236 struct
238 unsigned ALRMPTR0 : 1;
239 unsigned ALRMPTR1 : 1;
240 unsigned AMASK0 : 1;
241 unsigned AMASK1 : 1;
242 unsigned AMASK2 : 1;
243 unsigned AMASK3 : 1;
244 unsigned CHIME : 1;
245 unsigned ALRMEN : 1;
248 struct
250 unsigned ALRMPTR : 2;
251 unsigned : 6;
254 struct
256 unsigned : 2;
257 unsigned AMASK : 4;
258 unsigned : 2;
260 } __ALRMCFGbits_t;
262 extern __at(0x0F5B) volatile __ALRMCFGbits_t ALRMCFGbits;
264 #define _ALRMPTR0 0x01
265 #define _ALRMPTR1 0x02
266 #define _AMASK0 0x04
267 #define _AMASK1 0x08
268 #define _AMASK2 0x10
269 #define _AMASK3 0x20
270 #define _CHIME 0x40
271 #define _ALRMEN 0x80
273 //==============================================================================
275 extern __at(0x0F5C) __sfr RTCVALL;
276 extern __at(0x0F5D) __sfr RTCVALH;
278 //==============================================================================
279 // RTCCAL Bits
281 extern __at(0x0F5E) __sfr RTCCAL;
283 typedef struct
285 unsigned CAL0 : 1;
286 unsigned CAL1 : 1;
287 unsigned CAL2 : 1;
288 unsigned CAL3 : 1;
289 unsigned CAL4 : 1;
290 unsigned CAL5 : 1;
291 unsigned CAL6 : 1;
292 unsigned CAL7 : 1;
293 } __RTCCALbits_t;
295 extern __at(0x0F5E) volatile __RTCCALbits_t RTCCALbits;
297 #define _CAL0 0x01
298 #define _CAL1 0x02
299 #define _CAL2 0x04
300 #define _CAL3 0x08
301 #define _CAL4 0x10
302 #define _CAL5 0x20
303 #define _CAL6 0x40
304 #define _CAL7 0x80
306 //==============================================================================
309 //==============================================================================
310 // RTCCFG Bits
312 extern __at(0x0F5F) __sfr RTCCFG;
314 typedef union
316 struct
318 unsigned RTCPTR0 : 1;
319 unsigned RTCPTR1 : 1;
320 unsigned RTCOE : 1;
321 unsigned HALFSEC : 1;
322 unsigned RTCSYNC : 1;
323 unsigned RTCWREN : 1;
324 unsigned : 1;
325 unsigned RTCEN : 1;
328 struct
330 unsigned RTCPTR : 2;
331 unsigned : 6;
333 } __RTCCFGbits_t;
335 extern __at(0x0F5F) volatile __RTCCFGbits_t RTCCFGbits;
337 #define _RTCPTR0 0x01
338 #define _RTCPTR1 0x02
339 #define _RTCOE 0x04
340 #define _HALFSEC 0x08
341 #define _RTCSYNC 0x10
342 #define _RTCWREN 0x20
343 #define _RTCEN 0x80
345 //==============================================================================
348 //==============================================================================
349 // RCSTA2 Bits
351 extern __at(0x0F60) __sfr RCSTA2;
353 typedef union
355 struct
357 unsigned RX9D : 1;
358 unsigned OERR : 1;
359 unsigned FERR : 1;
360 unsigned ADDEN : 1;
361 unsigned CREN : 1;
362 unsigned SREN : 1;
363 unsigned RX9 : 1;
364 unsigned SPEN : 1;
367 struct
369 unsigned RCD8 : 1;
370 unsigned OERR2 : 1;
371 unsigned FERR2 : 1;
372 unsigned ADDEN2 : 1;
373 unsigned CREN2 : 1;
374 unsigned SREN2 : 1;
375 unsigned RC9 : 1;
376 unsigned SPEN2 : 1;
379 struct
381 unsigned RX9D2 : 1;
382 unsigned : 1;
383 unsigned : 1;
384 unsigned : 1;
385 unsigned : 1;
386 unsigned : 1;
387 unsigned NOT_RC8 : 1;
388 unsigned : 1;
391 struct
393 unsigned : 1;
394 unsigned : 1;
395 unsigned : 1;
396 unsigned : 1;
397 unsigned : 1;
398 unsigned : 1;
399 unsigned RC8_9 : 1;
400 unsigned : 1;
403 struct
405 unsigned : 1;
406 unsigned : 1;
407 unsigned : 1;
408 unsigned : 1;
409 unsigned : 1;
410 unsigned : 1;
411 unsigned RX92 : 1;
412 unsigned : 1;
414 } __RCSTA2bits_t;
416 extern __at(0x0F60) volatile __RCSTA2bits_t RCSTA2bits;
418 #define _RCSTA2_RX9D 0x01
419 #define _RCSTA2_RCD8 0x01
420 #define _RCSTA2_RX9D2 0x01
421 #define _RCSTA2_OERR 0x02
422 #define _RCSTA2_OERR2 0x02
423 #define _RCSTA2_FERR 0x04
424 #define _RCSTA2_FERR2 0x04
425 #define _RCSTA2_ADDEN 0x08
426 #define _RCSTA2_ADDEN2 0x08
427 #define _RCSTA2_CREN 0x10
428 #define _RCSTA2_CREN2 0x10
429 #define _RCSTA2_SREN 0x20
430 #define _RCSTA2_SREN2 0x20
431 #define _RCSTA2_RX9 0x40
432 #define _RCSTA2_RC9 0x40
433 #define _RCSTA2_NOT_RC8 0x40
434 #define _RCSTA2_RC8_9 0x40
435 #define _RCSTA2_RX92 0x40
436 #define _RCSTA2_SPEN 0x80
437 #define _RCSTA2_SPEN2 0x80
439 //==============================================================================
442 //==============================================================================
443 // TXSTA2 Bits
445 extern __at(0x0F61) __sfr TXSTA2;
447 typedef union
449 struct
451 unsigned TX9D : 1;
452 unsigned TRMT : 1;
453 unsigned BRGH : 1;
454 unsigned SENDB2 : 1;
455 unsigned SYNC : 1;
456 unsigned TXEN : 1;
457 unsigned TX9 : 1;
458 unsigned CSRC : 1;
461 struct
463 unsigned TXD8 : 1;
464 unsigned TRMT2 : 1;
465 unsigned BRGH2 : 1;
466 unsigned : 1;
467 unsigned SYNC2 : 1;
468 unsigned TXEN2 : 1;
469 unsigned TX8_9 : 1;
470 unsigned CSRC2 : 1;
473 struct
475 unsigned TX9D2 : 1;
476 unsigned : 1;
477 unsigned : 1;
478 unsigned : 1;
479 unsigned : 1;
480 unsigned : 1;
481 unsigned NOT_TX8 : 1;
482 unsigned : 1;
485 struct
487 unsigned : 1;
488 unsigned : 1;
489 unsigned : 1;
490 unsigned : 1;
491 unsigned : 1;
492 unsigned : 1;
493 unsigned TX92 : 1;
494 unsigned : 1;
496 } __TXSTA2bits_t;
498 extern __at(0x0F61) volatile __TXSTA2bits_t TXSTA2bits;
500 #define _TXSTA2_TX9D 0x01
501 #define _TXSTA2_TXD8 0x01
502 #define _TXSTA2_TX9D2 0x01
503 #define _TXSTA2_TRMT 0x02
504 #define _TXSTA2_TRMT2 0x02
505 #define _TXSTA2_BRGH 0x04
506 #define _TXSTA2_BRGH2 0x04
507 #define _TXSTA2_SENDB2 0x08
508 #define _TXSTA2_SYNC 0x10
509 #define _TXSTA2_SYNC2 0x10
510 #define _TXSTA2_TXEN 0x20
511 #define _TXSTA2_TXEN2 0x20
512 #define _TXSTA2_TX9 0x40
513 #define _TXSTA2_TX8_9 0x40
514 #define _TXSTA2_NOT_TX8 0x40
515 #define _TXSTA2_TX92 0x40
516 #define _TXSTA2_CSRC 0x80
517 #define _TXSTA2_CSRC2 0x80
519 //==============================================================================
521 extern __at(0x0F62) __sfr TXREG2;
522 extern __at(0x0F63) __sfr RCREG2;
523 extern __at(0x0F64) __sfr SPBRG2;
525 //==============================================================================
526 // CCP2CON Bits
528 extern __at(0x0F65) __sfr CCP2CON;
530 typedef union
532 struct
534 unsigned CCP2M0 : 1;
535 unsigned CCP2M1 : 1;
536 unsigned CCP2M2 : 1;
537 unsigned CCP2M3 : 1;
538 unsigned DC2B0 : 1;
539 unsigned DC2B1 : 1;
540 unsigned : 1;
541 unsigned : 1;
544 struct
546 unsigned : 1;
547 unsigned : 1;
548 unsigned : 1;
549 unsigned : 1;
550 unsigned DCCP2Y : 1;
551 unsigned DCCP2X : 1;
552 unsigned : 1;
553 unsigned : 1;
556 struct
558 unsigned CCP2M : 4;
559 unsigned : 4;
562 struct
564 unsigned : 4;
565 unsigned DC2B : 2;
566 unsigned : 2;
568 } __CCP2CONbits_t;
570 extern __at(0x0F65) volatile __CCP2CONbits_t CCP2CONbits;
572 #define _CCP2M0 0x01
573 #define _CCP2M1 0x02
574 #define _CCP2M2 0x04
575 #define _CCP2M3 0x08
576 #define _DC2B0 0x10
577 #define _DCCP2Y 0x10
578 #define _DC2B1 0x20
579 #define _DCCP2X 0x20
581 //==============================================================================
584 //==============================================================================
585 // ECCP2CON Bits
587 extern __at(0x0F65) __sfr ECCP2CON;
589 typedef union
591 struct
593 unsigned CCP2M0 : 1;
594 unsigned CCP2M1 : 1;
595 unsigned CCP2M2 : 1;
596 unsigned CCP2M3 : 1;
597 unsigned DC2B0 : 1;
598 unsigned DC2B1 : 1;
599 unsigned : 1;
600 unsigned : 1;
603 struct
605 unsigned : 1;
606 unsigned : 1;
607 unsigned : 1;
608 unsigned : 1;
609 unsigned DCCP2Y : 1;
610 unsigned DCCP2X : 1;
611 unsigned : 1;
612 unsigned : 1;
615 struct
617 unsigned CCP2M : 4;
618 unsigned : 4;
621 struct
623 unsigned : 4;
624 unsigned DC2B : 2;
625 unsigned : 2;
627 } __ECCP2CONbits_t;
629 extern __at(0x0F65) volatile __ECCP2CONbits_t ECCP2CONbits;
631 #define _ECCP2CON_CCP2M0 0x01
632 #define _ECCP2CON_CCP2M1 0x02
633 #define _ECCP2CON_CCP2M2 0x04
634 #define _ECCP2CON_CCP2M3 0x08
635 #define _ECCP2CON_DC2B0 0x10
636 #define _ECCP2CON_DCCP2Y 0x10
637 #define _ECCP2CON_DC2B1 0x20
638 #define _ECCP2CON_DCCP2X 0x20
640 //==============================================================================
642 extern __at(0x0F66) __sfr CCPR2;
643 extern __at(0x0F66) __sfr CCPR2L;
644 extern __at(0x0F67) __sfr CCPR2H;
646 //==============================================================================
647 // CCP1CON Bits
649 extern __at(0x0F68) __sfr CCP1CON;
651 typedef union
653 struct
655 unsigned CCP1M0 : 1;
656 unsigned CCP1M1 : 1;
657 unsigned CCP1M2 : 1;
658 unsigned CCP1M3 : 1;
659 unsigned DC1B0 : 1;
660 unsigned DC1B1 : 1;
661 unsigned : 1;
662 unsigned : 1;
665 struct
667 unsigned : 1;
668 unsigned : 1;
669 unsigned : 1;
670 unsigned : 1;
671 unsigned DCCP1Y : 1;
672 unsigned DCCP1X : 1;
673 unsigned : 1;
674 unsigned : 1;
677 struct
679 unsigned CCP1M : 4;
680 unsigned : 4;
683 struct
685 unsigned : 4;
686 unsigned DC1B : 2;
687 unsigned : 2;
689 } __CCP1CONbits_t;
691 extern __at(0x0F68) volatile __CCP1CONbits_t CCP1CONbits;
693 #define _CCP1M0 0x01
694 #define _CCP1M1 0x02
695 #define _CCP1M2 0x04
696 #define _CCP1M3 0x08
697 #define _DC1B0 0x10
698 #define _DCCP1Y 0x10
699 #define _DC1B1 0x20
700 #define _DCCP1X 0x20
702 //==============================================================================
705 //==============================================================================
706 // ECCP1CON Bits
708 extern __at(0x0F68) __sfr ECCP1CON;
710 typedef union
712 struct
714 unsigned CCP1M0 : 1;
715 unsigned CCP1M1 : 1;
716 unsigned CCP1M2 : 1;
717 unsigned CCP1M3 : 1;
718 unsigned DC1B0 : 1;
719 unsigned DC1B1 : 1;
720 unsigned : 1;
721 unsigned : 1;
724 struct
726 unsigned : 1;
727 unsigned : 1;
728 unsigned : 1;
729 unsigned : 1;
730 unsigned DCCP1Y : 1;
731 unsigned DCCP1X : 1;
732 unsigned : 1;
733 unsigned : 1;
736 struct
738 unsigned CCP1M : 4;
739 unsigned : 4;
742 struct
744 unsigned : 4;
745 unsigned DC1B : 2;
746 unsigned : 2;
748 } __ECCP1CONbits_t;
750 extern __at(0x0F68) volatile __ECCP1CONbits_t ECCP1CONbits;
752 #define _ECCP1CON_CCP1M0 0x01
753 #define _ECCP1CON_CCP1M1 0x02
754 #define _ECCP1CON_CCP1M2 0x04
755 #define _ECCP1CON_CCP1M3 0x08
756 #define _ECCP1CON_DC1B0 0x10
757 #define _ECCP1CON_DCCP1Y 0x10
758 #define _ECCP1CON_DC1B1 0x20
759 #define _ECCP1CON_DCCP1X 0x20
761 //==============================================================================
763 extern __at(0x0F69) __sfr CCPR1;
764 extern __at(0x0F69) __sfr CCPR1L;
765 extern __at(0x0F6A) __sfr CCPR1H;
767 //==============================================================================
768 // LCDDATA5 Bits
770 extern __at(0x0F6B) __sfr LCDDATA5;
772 typedef union
774 struct
776 unsigned S40C0 : 1;
777 unsigned S41C0 : 1;
778 unsigned S42C0 : 1;
779 unsigned S43C0 : 1;
780 unsigned S44C0 : 1;
781 unsigned S45C0 : 1;
782 unsigned S46C0 : 1;
783 unsigned S47C0 : 1;
786 struct
788 unsigned SEG40COM0 : 1;
789 unsigned SEG41COM0 : 1;
790 unsigned SEG42COM0 : 1;
791 unsigned SEG43COM0 : 1;
792 unsigned SEG44COM0 : 1;
793 unsigned SEG45COM0 : 1;
794 unsigned SEG46COM0 : 1;
795 unsigned SEG47COM0 : 1;
797 } __LCDDATA5bits_t;
799 extern __at(0x0F6B) volatile __LCDDATA5bits_t LCDDATA5bits;
801 #define _S40C0 0x01
802 #define _SEG40COM0 0x01
803 #define _S41C0 0x02
804 #define _SEG41COM0 0x02
805 #define _S42C0 0x04
806 #define _SEG42COM0 0x04
807 #define _S43C0 0x08
808 #define _SEG43COM0 0x08
809 #define _S44C0 0x10
810 #define _SEG44COM0 0x10
811 #define _S45C0 0x20
812 #define _SEG45COM0 0x20
813 #define _S46C0 0x40
814 #define _SEG46COM0 0x40
815 #define _S47C0 0x80
816 #define _SEG47COM0 0x80
818 //==============================================================================
821 //==============================================================================
822 // LCDDATA6 Bits
824 extern __at(0x0F6C) __sfr LCDDATA6;
826 typedef union
828 struct
830 unsigned S00C1 : 1;
831 unsigned S01C1 : 1;
832 unsigned S02C1 : 1;
833 unsigned S03C1 : 1;
834 unsigned S04C1 : 1;
835 unsigned S05C1 : 1;
836 unsigned S06C1 : 1;
837 unsigned S07C1 : 1;
840 struct
842 unsigned SEG0COM1 : 1;
843 unsigned SEG1COM1 : 1;
844 unsigned SEG2COM1 : 1;
845 unsigned SEG3COM1 : 1;
846 unsigned SEG4COM1 : 1;
847 unsigned SEG5COM1 : 1;
848 unsigned SEG6COM1 : 1;
849 unsigned SEG7COM1 : 1;
852 struct
854 unsigned S0C1 : 1;
855 unsigned S1C1 : 1;
856 unsigned S2C1 : 1;
857 unsigned S3C1 : 1;
858 unsigned S4C1 : 1;
859 unsigned S5C1 : 1;
860 unsigned S6C1 : 1;
861 unsigned S7C1 : 1;
863 } __LCDDATA6bits_t;
865 extern __at(0x0F6C) volatile __LCDDATA6bits_t LCDDATA6bits;
867 #define _S00C1 0x01
868 #define _SEG0COM1 0x01
869 #define _S0C1 0x01
870 #define _S01C1 0x02
871 #define _SEG1COM1 0x02
872 #define _S1C1 0x02
873 #define _S02C1 0x04
874 #define _SEG2COM1 0x04
875 #define _S2C1 0x04
876 #define _S03C1 0x08
877 #define _SEG3COM1 0x08
878 #define _S3C1 0x08
879 #define _S04C1 0x10
880 #define _SEG4COM1 0x10
881 #define _S4C1 0x10
882 #define _S05C1 0x20
883 #define _SEG5COM1 0x20
884 #define _S5C1 0x20
885 #define _S06C1 0x40
886 #define _SEG6COM1 0x40
887 #define _S6C1 0x40
888 #define _S07C1 0x80
889 #define _SEG7COM1 0x80
890 #define _S7C1 0x80
892 //==============================================================================
895 //==============================================================================
896 // LCDDATA7 Bits
898 extern __at(0x0F6D) __sfr LCDDATA7;
900 typedef union
902 struct
904 unsigned S8C1 : 1;
905 unsigned S9C1 : 1;
906 unsigned S10C1 : 1;
907 unsigned S11C1 : 1;
908 unsigned S12C1 : 1;
909 unsigned S13C1 : 1;
910 unsigned S14C1 : 1;
911 unsigned S15C1 : 1;
914 struct
916 unsigned SEG8COM1 : 1;
917 unsigned SEG9COM1 : 1;
918 unsigned SEG10COM1 : 1;
919 unsigned SEG11COM1 : 1;
920 unsigned SEG12COM1 : 1;
921 unsigned SEG13COM1 : 1;
922 unsigned SEG14COM1 : 1;
923 unsigned SEG15COM1 : 1;
926 struct
928 unsigned S08C1 : 1;
929 unsigned S09C1 : 1;
930 unsigned : 1;
931 unsigned : 1;
932 unsigned : 1;
933 unsigned : 1;
934 unsigned : 1;
935 unsigned : 1;
937 } __LCDDATA7bits_t;
939 extern __at(0x0F6D) volatile __LCDDATA7bits_t LCDDATA7bits;
941 #define _S8C1 0x01
942 #define _SEG8COM1 0x01
943 #define _S08C1 0x01
944 #define _S9C1 0x02
945 #define _SEG9COM1 0x02
946 #define _S09C1 0x02
947 #define _S10C1 0x04
948 #define _SEG10COM1 0x04
949 #define _S11C1 0x08
950 #define _SEG11COM1 0x08
951 #define _S12C1 0x10
952 #define _SEG12COM1 0x10
953 #define _S13C1 0x20
954 #define _SEG13COM1 0x20
955 #define _S14C1 0x40
956 #define _SEG14COM1 0x40
957 #define _S15C1 0x80
958 #define _SEG15COM1 0x80
960 //==============================================================================
963 //==============================================================================
964 // LCDDATA8 Bits
966 extern __at(0x0F6E) __sfr LCDDATA8;
968 typedef union
970 struct
972 unsigned S16C1 : 1;
973 unsigned S17C1 : 1;
974 unsigned S18C1 : 1;
975 unsigned S19C1 : 1;
976 unsigned S20C1 : 1;
977 unsigned S21C1 : 1;
978 unsigned S22C1 : 1;
979 unsigned S23C1 : 1;
982 struct
984 unsigned SEG16COM1 : 1;
985 unsigned SEG17COM1 : 1;
986 unsigned SEG18COM1 : 1;
987 unsigned SEG19COM1 : 1;
988 unsigned SEG20COM1 : 1;
989 unsigned SEG21COM1 : 1;
990 unsigned SEG22COM1 : 1;
991 unsigned SEG23COM1 : 1;
993 } __LCDDATA8bits_t;
995 extern __at(0x0F6E) volatile __LCDDATA8bits_t LCDDATA8bits;
997 #define _S16C1 0x01
998 #define _SEG16COM1 0x01
999 #define _S17C1 0x02
1000 #define _SEG17COM1 0x02
1001 #define _S18C1 0x04
1002 #define _SEG18COM1 0x04
1003 #define _S19C1 0x08
1004 #define _SEG19COM1 0x08
1005 #define _S20C1 0x10
1006 #define _SEG20COM1 0x10
1007 #define _S21C1 0x20
1008 #define _SEG21COM1 0x20
1009 #define _S22C1 0x40
1010 #define _SEG22COM1 0x40
1011 #define _S23C1 0x80
1012 #define _SEG23COM1 0x80
1014 //==============================================================================
1017 //==============================================================================
1018 // LCDDATA9 Bits
1020 extern __at(0x0F6F) __sfr LCDDATA9;
1022 typedef union
1024 struct
1026 unsigned S24C1 : 1;
1027 unsigned S25C1 : 1;
1028 unsigned S26C1 : 1;
1029 unsigned S27C1 : 1;
1030 unsigned S28C1 : 1;
1031 unsigned S29C1 : 1;
1032 unsigned S30C1 : 1;
1033 unsigned S31C1 : 1;
1036 struct
1038 unsigned SEG24COM1 : 1;
1039 unsigned SEG25COM1 : 1;
1040 unsigned SEG26COM1 : 1;
1041 unsigned SEG27COM1 : 1;
1042 unsigned SEG28COM1 : 1;
1043 unsigned SEG29COM1 : 1;
1044 unsigned SEG30COM1 : 1;
1045 unsigned SEG31COM1 : 1;
1047 } __LCDDATA9bits_t;
1049 extern __at(0x0F6F) volatile __LCDDATA9bits_t LCDDATA9bits;
1051 #define _S24C1 0x01
1052 #define _SEG24COM1 0x01
1053 #define _S25C1 0x02
1054 #define _SEG25COM1 0x02
1055 #define _S26C1 0x04
1056 #define _SEG26COM1 0x04
1057 #define _S27C1 0x08
1058 #define _SEG27COM1 0x08
1059 #define _S28C1 0x10
1060 #define _SEG28COM1 0x10
1061 #define _S29C1 0x20
1062 #define _SEG29COM1 0x20
1063 #define _S30C1 0x40
1064 #define _SEG30COM1 0x40
1065 #define _S31C1 0x80
1066 #define _SEG31COM1 0x80
1068 //==============================================================================
1071 //==============================================================================
1072 // LCDDATA10 Bits
1074 extern __at(0x0F70) __sfr LCDDATA10;
1076 typedef union
1078 struct
1080 unsigned S32C1 : 1;
1081 unsigned S33C1 : 1;
1082 unsigned S34C1 : 1;
1083 unsigned S35C1 : 1;
1084 unsigned S36C1 : 1;
1085 unsigned S37C1 : 1;
1086 unsigned S38C1 : 1;
1087 unsigned S39C1 : 1;
1090 struct
1092 unsigned SEG32COM1 : 1;
1093 unsigned SEG33COM1 : 1;
1094 unsigned SEG34COM1 : 1;
1095 unsigned SEG35COM1 : 1;
1096 unsigned SEG36COM1 : 1;
1097 unsigned SEG37COM1 : 1;
1098 unsigned SEG38COM1 : 1;
1099 unsigned SEG39COM1 : 1;
1101 } __LCDDATA10bits_t;
1103 extern __at(0x0F70) volatile __LCDDATA10bits_t LCDDATA10bits;
1105 #define _S32C1 0x01
1106 #define _SEG32COM1 0x01
1107 #define _S33C1 0x02
1108 #define _SEG33COM1 0x02
1109 #define _S34C1 0x04
1110 #define _SEG34COM1 0x04
1111 #define _S35C1 0x08
1112 #define _SEG35COM1 0x08
1113 #define _S36C1 0x10
1114 #define _SEG36COM1 0x10
1115 #define _S37C1 0x20
1116 #define _SEG37COM1 0x20
1117 #define _S38C1 0x40
1118 #define _SEG38COM1 0x40
1119 #define _S39C1 0x80
1120 #define _SEG39COM1 0x80
1122 //==============================================================================
1125 //==============================================================================
1126 // LCDDATA11 Bits
1128 extern __at(0x0F71) __sfr LCDDATA11;
1130 typedef union
1132 struct
1134 unsigned S40C1 : 1;
1135 unsigned S41C1 : 1;
1136 unsigned S42C1 : 1;
1137 unsigned S43C1 : 1;
1138 unsigned S44C1 : 1;
1139 unsigned S45C1 : 1;
1140 unsigned S46C1 : 1;
1141 unsigned S47C1 : 1;
1144 struct
1146 unsigned SEG40COM1 : 1;
1147 unsigned SEG41COM1 : 1;
1148 unsigned SEG42COM1 : 1;
1149 unsigned SEG43COM1 : 1;
1150 unsigned SEG44COM1 : 1;
1151 unsigned SEG45COM1 : 1;
1152 unsigned SEG46COM1 : 1;
1153 unsigned SEG47COM1 : 1;
1155 } __LCDDATA11bits_t;
1157 extern __at(0x0F71) volatile __LCDDATA11bits_t LCDDATA11bits;
1159 #define _S40C1 0x01
1160 #define _SEG40COM1 0x01
1161 #define _S41C1 0x02
1162 #define _SEG41COM1 0x02
1163 #define _S42C1 0x04
1164 #define _SEG42COM1 0x04
1165 #define _S43C1 0x08
1166 #define _SEG43COM1 0x08
1167 #define _S44C1 0x10
1168 #define _SEG44COM1 0x10
1169 #define _S45C1 0x20
1170 #define _SEG45COM1 0x20
1171 #define _S46C1 0x40
1172 #define _SEG46COM1 0x40
1173 #define _S47C1 0x80
1174 #define _SEG47COM1 0x80
1176 //==============================================================================
1179 //==============================================================================
1180 // LCDDATA12 Bits
1182 extern __at(0x0F72) __sfr LCDDATA12;
1184 typedef union
1186 struct
1188 unsigned S00C2 : 1;
1189 unsigned S01C2 : 1;
1190 unsigned S02C2 : 1;
1191 unsigned S03C2 : 1;
1192 unsigned S04C2 : 1;
1193 unsigned S05C2 : 1;
1194 unsigned S06C2 : 1;
1195 unsigned S07C2 : 1;
1198 struct
1200 unsigned SEG0COM2 : 1;
1201 unsigned SEG1COM2 : 1;
1202 unsigned SEG2COM2 : 1;
1203 unsigned SEG3COM2 : 1;
1204 unsigned SEG4COM2 : 1;
1205 unsigned SEG5COM2 : 1;
1206 unsigned SEG6COM2 : 1;
1207 unsigned SEG7COM2 : 1;
1210 struct
1212 unsigned S0C2 : 1;
1213 unsigned S1C2 : 1;
1214 unsigned S2C2 : 1;
1215 unsigned S3C2 : 1;
1216 unsigned S4C2 : 1;
1217 unsigned S5C2 : 1;
1218 unsigned S6C2 : 1;
1219 unsigned S7C2 : 1;
1221 } __LCDDATA12bits_t;
1223 extern __at(0x0F72) volatile __LCDDATA12bits_t LCDDATA12bits;
1225 #define _S00C2 0x01
1226 #define _SEG0COM2 0x01
1227 #define _S0C2 0x01
1228 #define _S01C2 0x02
1229 #define _SEG1COM2 0x02
1230 #define _S1C2 0x02
1231 #define _S02C2 0x04
1232 #define _SEG2COM2 0x04
1233 #define _S2C2 0x04
1234 #define _S03C2 0x08
1235 #define _SEG3COM2 0x08
1236 #define _S3C2 0x08
1237 #define _S04C2 0x10
1238 #define _SEG4COM2 0x10
1239 #define _S4C2 0x10
1240 #define _S05C2 0x20
1241 #define _SEG5COM2 0x20
1242 #define _S5C2 0x20
1243 #define _S06C2 0x40
1244 #define _SEG6COM2 0x40
1245 #define _S6C2 0x40
1246 #define _S07C2 0x80
1247 #define _SEG7COM2 0x80
1248 #define _S7C2 0x80
1250 //==============================================================================
1253 //==============================================================================
1254 // LCDDATA13 Bits
1256 extern __at(0x0F73) __sfr LCDDATA13;
1258 typedef union
1260 struct
1262 unsigned S8C2 : 1;
1263 unsigned S9C2 : 1;
1264 unsigned S10C2 : 1;
1265 unsigned S11C2 : 1;
1266 unsigned S12C2 : 1;
1267 unsigned S13C2 : 1;
1268 unsigned S14C2 : 1;
1269 unsigned S15C2 : 1;
1272 struct
1274 unsigned SEG8COM2 : 1;
1275 unsigned SEG9COM2 : 1;
1276 unsigned SEG10COM2 : 1;
1277 unsigned SEG11COM2 : 1;
1278 unsigned SEG12COM2 : 1;
1279 unsigned SEG13COM2 : 1;
1280 unsigned SEG14COM2 : 1;
1281 unsigned SEG15COM2 : 1;
1284 struct
1286 unsigned S08C2 : 1;
1287 unsigned S09C2 : 1;
1288 unsigned : 1;
1289 unsigned : 1;
1290 unsigned : 1;
1291 unsigned : 1;
1292 unsigned : 1;
1293 unsigned : 1;
1295 } __LCDDATA13bits_t;
1297 extern __at(0x0F73) volatile __LCDDATA13bits_t LCDDATA13bits;
1299 #define _S8C2 0x01
1300 #define _SEG8COM2 0x01
1301 #define _S08C2 0x01
1302 #define _S9C2 0x02
1303 #define _SEG9COM2 0x02
1304 #define _S09C2 0x02
1305 #define _S10C2 0x04
1306 #define _SEG10COM2 0x04
1307 #define _S11C2 0x08
1308 #define _SEG11COM2 0x08
1309 #define _S12C2 0x10
1310 #define _SEG12COM2 0x10
1311 #define _S13C2 0x20
1312 #define _SEG13COM2 0x20
1313 #define _S14C2 0x40
1314 #define _SEG14COM2 0x40
1315 #define _S15C2 0x80
1316 #define _SEG15COM2 0x80
1318 //==============================================================================
1321 //==============================================================================
1322 // LCDDATA14 Bits
1324 extern __at(0x0F74) __sfr LCDDATA14;
1326 typedef union
1328 struct
1330 unsigned S16C2 : 1;
1331 unsigned S17C2 : 1;
1332 unsigned S18C2 : 1;
1333 unsigned S19C2 : 1;
1334 unsigned S20C2 : 1;
1335 unsigned S21C2 : 1;
1336 unsigned S22C2 : 1;
1337 unsigned S23C2 : 1;
1340 struct
1342 unsigned SEG16COM2 : 1;
1343 unsigned SEG17COM2 : 1;
1344 unsigned SEG18COM2 : 1;
1345 unsigned SEG19COM2 : 1;
1346 unsigned SEG20COM2 : 1;
1347 unsigned SEG21COM2 : 1;
1348 unsigned SEG22COM2 : 1;
1349 unsigned SEG23COM2 : 1;
1351 } __LCDDATA14bits_t;
1353 extern __at(0x0F74) volatile __LCDDATA14bits_t LCDDATA14bits;
1355 #define _S16C2 0x01
1356 #define _SEG16COM2 0x01
1357 #define _S17C2 0x02
1358 #define _SEG17COM2 0x02
1359 #define _S18C2 0x04
1360 #define _SEG18COM2 0x04
1361 #define _S19C2 0x08
1362 #define _SEG19COM2 0x08
1363 #define _S20C2 0x10
1364 #define _SEG20COM2 0x10
1365 #define _S21C2 0x20
1366 #define _SEG21COM2 0x20
1367 #define _S22C2 0x40
1368 #define _SEG22COM2 0x40
1369 #define _S23C2 0x80
1370 #define _SEG23COM2 0x80
1372 //==============================================================================
1375 //==============================================================================
1376 // LCDDATA15 Bits
1378 extern __at(0x0F75) __sfr LCDDATA15;
1380 typedef union
1382 struct
1384 unsigned S24C2 : 1;
1385 unsigned S25C2 : 1;
1386 unsigned S26C2 : 1;
1387 unsigned S27C2 : 1;
1388 unsigned S28C2 : 1;
1389 unsigned S29C2 : 1;
1390 unsigned S30C2 : 1;
1391 unsigned S31C2 : 1;
1394 struct
1396 unsigned SEG24COM2 : 1;
1397 unsigned SEG25COM2 : 1;
1398 unsigned SEG26COM2 : 1;
1399 unsigned SEG27COM2 : 1;
1400 unsigned SEG28COM2 : 1;
1401 unsigned SEG29COM2 : 1;
1402 unsigned SEG30COM2 : 1;
1403 unsigned SEG31COM2 : 1;
1405 } __LCDDATA15bits_t;
1407 extern __at(0x0F75) volatile __LCDDATA15bits_t LCDDATA15bits;
1409 #define _S24C2 0x01
1410 #define _SEG24COM2 0x01
1411 #define _S25C2 0x02
1412 #define _SEG25COM2 0x02
1413 #define _S26C2 0x04
1414 #define _SEG26COM2 0x04
1415 #define _S27C2 0x08
1416 #define _SEG27COM2 0x08
1417 #define _S28C2 0x10
1418 #define _SEG28COM2 0x10
1419 #define _S29C2 0x20
1420 #define _SEG29COM2 0x20
1421 #define _S30C2 0x40
1422 #define _SEG30COM2 0x40
1423 #define _S31C2 0x80
1424 #define _SEG31COM2 0x80
1426 //==============================================================================
1429 //==============================================================================
1430 // LCDDATA16 Bits
1432 extern __at(0x0F76) __sfr LCDDATA16;
1434 typedef union
1436 struct
1438 unsigned S32C2 : 1;
1439 unsigned S33C2 : 1;
1440 unsigned S34C2 : 1;
1441 unsigned S35C2 : 1;
1442 unsigned S36C2 : 1;
1443 unsigned S37C2 : 1;
1444 unsigned S38C2 : 1;
1445 unsigned S39C2 : 1;
1448 struct
1450 unsigned SEG32COM2 : 1;
1451 unsigned SEG33COM2 : 1;
1452 unsigned SEG34COM2 : 1;
1453 unsigned SEG35COM2 : 1;
1454 unsigned SEG36COM2 : 1;
1455 unsigned SEG37COM2 : 1;
1456 unsigned SEG38COM2 : 1;
1457 unsigned SEG39COM2 : 1;
1459 } __LCDDATA16bits_t;
1461 extern __at(0x0F76) volatile __LCDDATA16bits_t LCDDATA16bits;
1463 #define _S32C2 0x01
1464 #define _SEG32COM2 0x01
1465 #define _S33C2 0x02
1466 #define _SEG33COM2 0x02
1467 #define _S34C2 0x04
1468 #define _SEG34COM2 0x04
1469 #define _S35C2 0x08
1470 #define _SEG35COM2 0x08
1471 #define _S36C2 0x10
1472 #define _SEG36COM2 0x10
1473 #define _S37C2 0x20
1474 #define _SEG37COM2 0x20
1475 #define _S38C2 0x40
1476 #define _SEG38COM2 0x40
1477 #define _S39C2 0x80
1478 #define _SEG39COM2 0x80
1480 //==============================================================================
1483 //==============================================================================
1484 // LCDDATA17 Bits
1486 extern __at(0x0F77) __sfr LCDDATA17;
1488 typedef union
1490 struct
1492 unsigned S40C2 : 1;
1493 unsigned S41C2 : 1;
1494 unsigned S42C2 : 1;
1495 unsigned S43C2 : 1;
1496 unsigned S44C2 : 1;
1497 unsigned S45C2 : 1;
1498 unsigned S46C2 : 1;
1499 unsigned S47C2 : 1;
1502 struct
1504 unsigned SEG40COM2 : 1;
1505 unsigned SEG41COM2 : 1;
1506 unsigned SEG42COM2 : 1;
1507 unsigned SEG43COM2 : 1;
1508 unsigned SEG44COM2 : 1;
1509 unsigned SEG45COM2 : 1;
1510 unsigned SEG46COM2 : 1;
1511 unsigned SEG47COM2 : 1;
1513 } __LCDDATA17bits_t;
1515 extern __at(0x0F77) volatile __LCDDATA17bits_t LCDDATA17bits;
1517 #define _S40C2 0x01
1518 #define _SEG40COM2 0x01
1519 #define _S41C2 0x02
1520 #define _SEG41COM2 0x02
1521 #define _S42C2 0x04
1522 #define _SEG42COM2 0x04
1523 #define _S43C2 0x08
1524 #define _SEG43COM2 0x08
1525 #define _S44C2 0x10
1526 #define _SEG44COM2 0x10
1527 #define _S45C2 0x20
1528 #define _SEG45COM2 0x20
1529 #define _S46C2 0x40
1530 #define _SEG46COM2 0x40
1531 #define _S47C2 0x80
1532 #define _SEG47COM2 0x80
1534 //==============================================================================
1537 //==============================================================================
1538 // LCDDATA18 Bits
1540 extern __at(0x0F78) __sfr LCDDATA18;
1542 typedef union
1544 struct
1546 unsigned S00C3 : 1;
1547 unsigned S01C3 : 1;
1548 unsigned S02C3 : 1;
1549 unsigned S03C3 : 1;
1550 unsigned S04C3 : 1;
1551 unsigned S05C3 : 1;
1552 unsigned S06C3 : 1;
1553 unsigned S07C3 : 1;
1556 struct
1558 unsigned SEG00COM3 : 1;
1559 unsigned SEG01COM3 : 1;
1560 unsigned SEG02COM3 : 1;
1561 unsigned SEG03COM3 : 1;
1562 unsigned SEG04COM3 : 1;
1563 unsigned SEG05COM3 : 1;
1564 unsigned SEG06COM3 : 1;
1565 unsigned SEG07COM3 : 1;
1568 struct
1570 unsigned S0C3 : 1;
1571 unsigned S1C3 : 1;
1572 unsigned S2C3 : 1;
1573 unsigned S3C3 : 1;
1574 unsigned S4C3 : 1;
1575 unsigned S5C3 : 1;
1576 unsigned S6C3 : 1;
1577 unsigned S7C3 : 1;
1579 } __LCDDATA18bits_t;
1581 extern __at(0x0F78) volatile __LCDDATA18bits_t LCDDATA18bits;
1583 #define _S00C3 0x01
1584 #define _SEG00COM3 0x01
1585 #define _S0C3 0x01
1586 #define _S01C3 0x02
1587 #define _SEG01COM3 0x02
1588 #define _S1C3 0x02
1589 #define _S02C3 0x04
1590 #define _SEG02COM3 0x04
1591 #define _S2C3 0x04
1592 #define _S03C3 0x08
1593 #define _SEG03COM3 0x08
1594 #define _S3C3 0x08
1595 #define _S04C3 0x10
1596 #define _SEG04COM3 0x10
1597 #define _S4C3 0x10
1598 #define _S05C3 0x20
1599 #define _SEG05COM3 0x20
1600 #define _S5C3 0x20
1601 #define _S06C3 0x40
1602 #define _SEG06COM3 0x40
1603 #define _S6C3 0x40
1604 #define _S07C3 0x80
1605 #define _SEG07COM3 0x80
1606 #define _S7C3 0x80
1608 //==============================================================================
1611 //==============================================================================
1612 // LCDDATA19 Bits
1614 extern __at(0x0F79) __sfr LCDDATA19;
1616 typedef union
1618 struct
1620 unsigned S8C3 : 1;
1621 unsigned S9C3 : 1;
1622 unsigned S10C3 : 1;
1623 unsigned S11C3 : 1;
1624 unsigned S12C3 : 1;
1625 unsigned S13C3 : 1;
1626 unsigned S14C3 : 1;
1627 unsigned S15C3 : 1;
1630 struct
1632 unsigned SEG8COM3 : 1;
1633 unsigned SEG9COM3 : 1;
1634 unsigned SEG10COM3 : 1;
1635 unsigned SEG11COM3 : 1;
1636 unsigned SEG12COM3 : 1;
1637 unsigned SEG13COM3 : 1;
1638 unsigned SEG14COM3 : 1;
1639 unsigned SEG15COM3 : 1;
1642 struct
1644 unsigned S08C3 : 1;
1645 unsigned S09C3 : 1;
1646 unsigned : 1;
1647 unsigned : 1;
1648 unsigned : 1;
1649 unsigned : 1;
1650 unsigned : 1;
1651 unsigned : 1;
1653 } __LCDDATA19bits_t;
1655 extern __at(0x0F79) volatile __LCDDATA19bits_t LCDDATA19bits;
1657 #define _S8C3 0x01
1658 #define _SEG8COM3 0x01
1659 #define _S08C3 0x01
1660 #define _S9C3 0x02
1661 #define _SEG9COM3 0x02
1662 #define _S09C3 0x02
1663 #define _S10C3 0x04
1664 #define _SEG10COM3 0x04
1665 #define _S11C3 0x08
1666 #define _SEG11COM3 0x08
1667 #define _S12C3 0x10
1668 #define _SEG12COM3 0x10
1669 #define _S13C3 0x20
1670 #define _SEG13COM3 0x20
1671 #define _S14C3 0x40
1672 #define _SEG14COM3 0x40
1673 #define _S15C3 0x80
1674 #define _SEG15COM3 0x80
1676 //==============================================================================
1679 //==============================================================================
1680 // LCDDATA20 Bits
1682 extern __at(0x0F7A) __sfr LCDDATA20;
1684 typedef union
1686 struct
1688 unsigned S16C3 : 1;
1689 unsigned S17C3 : 1;
1690 unsigned S18C3 : 1;
1691 unsigned S19C3 : 1;
1692 unsigned S20C3 : 1;
1693 unsigned S21C3 : 1;
1694 unsigned S22C3 : 1;
1695 unsigned S23C3 : 1;
1698 struct
1700 unsigned SEG16COM3 : 1;
1701 unsigned SEG17COM3 : 1;
1702 unsigned SEG18COM3 : 1;
1703 unsigned SEG19COM3 : 1;
1704 unsigned SEG20COM3 : 1;
1705 unsigned SEG21COM3 : 1;
1706 unsigned SEG22COM3 : 1;
1707 unsigned SEG23COM3 : 1;
1709 } __LCDDATA20bits_t;
1711 extern __at(0x0F7A) volatile __LCDDATA20bits_t LCDDATA20bits;
1713 #define _S16C3 0x01
1714 #define _SEG16COM3 0x01
1715 #define _S17C3 0x02
1716 #define _SEG17COM3 0x02
1717 #define _S18C3 0x04
1718 #define _SEG18COM3 0x04
1719 #define _S19C3 0x08
1720 #define _SEG19COM3 0x08
1721 #define _S20C3 0x10
1722 #define _SEG20COM3 0x10
1723 #define _S21C3 0x20
1724 #define _SEG21COM3 0x20
1725 #define _S22C3 0x40
1726 #define _SEG22COM3 0x40
1727 #define _S23C3 0x80
1728 #define _SEG23COM3 0x80
1730 //==============================================================================
1733 //==============================================================================
1734 // LCDDATA21 Bits
1736 extern __at(0x0F7B) __sfr LCDDATA21;
1738 typedef union
1740 struct
1742 unsigned S24C3 : 1;
1743 unsigned S25C3 : 1;
1744 unsigned S26C3 : 1;
1745 unsigned S27C3 : 1;
1746 unsigned S28C3 : 1;
1747 unsigned S29C3 : 1;
1748 unsigned S30C3 : 1;
1749 unsigned S31C3 : 1;
1752 struct
1754 unsigned SEG24COM3 : 1;
1755 unsigned SEG25COM3 : 1;
1756 unsigned SEG26COM3 : 1;
1757 unsigned SEG27COM3 : 1;
1758 unsigned SEG28COM3 : 1;
1759 unsigned SEG29COM3 : 1;
1760 unsigned SEG30COM3 : 1;
1761 unsigned SEG31COM3 : 1;
1763 } __LCDDATA21bits_t;
1765 extern __at(0x0F7B) volatile __LCDDATA21bits_t LCDDATA21bits;
1767 #define _S24C3 0x01
1768 #define _SEG24COM3 0x01
1769 #define _S25C3 0x02
1770 #define _SEG25COM3 0x02
1771 #define _S26C3 0x04
1772 #define _SEG26COM3 0x04
1773 #define _S27C3 0x08
1774 #define _SEG27COM3 0x08
1775 #define _S28C3 0x10
1776 #define _SEG28COM3 0x10
1777 #define _S29C3 0x20
1778 #define _SEG29COM3 0x20
1779 #define _S30C3 0x40
1780 #define _SEG30COM3 0x40
1781 #define _S31C3 0x80
1782 #define _SEG31COM3 0x80
1784 //==============================================================================
1787 //==============================================================================
1788 // LCDDATA22 Bits
1790 extern __at(0x0F7C) __sfr LCDDATA22;
1792 typedef union
1794 struct
1796 unsigned S32C3 : 1;
1797 unsigned S33C3 : 1;
1798 unsigned S34C3 : 1;
1799 unsigned S35C3 : 1;
1800 unsigned S36C3 : 1;
1801 unsigned S37C3 : 1;
1802 unsigned S38C3 : 1;
1803 unsigned S39C3 : 1;
1806 struct
1808 unsigned SEG32COM3 : 1;
1809 unsigned SEG33COM3 : 1;
1810 unsigned SEG34COM3 : 1;
1811 unsigned SEG35COM3 : 1;
1812 unsigned SEG36COM3 : 1;
1813 unsigned SEG37COM3 : 1;
1814 unsigned SEG38COM3 : 1;
1815 unsigned SEG39COM3 : 1;
1817 } __LCDDATA22bits_t;
1819 extern __at(0x0F7C) volatile __LCDDATA22bits_t LCDDATA22bits;
1821 #define _S32C3 0x01
1822 #define _SEG32COM3 0x01
1823 #define _S33C3 0x02
1824 #define _SEG33COM3 0x02
1825 #define _S34C3 0x04
1826 #define _SEG34COM3 0x04
1827 #define _S35C3 0x08
1828 #define _SEG35COM3 0x08
1829 #define _S36C3 0x10
1830 #define _SEG36COM3 0x10
1831 #define _S37C3 0x20
1832 #define _SEG37COM3 0x20
1833 #define _S38C3 0x40
1834 #define _SEG38COM3 0x40
1835 #define _S39C3 0x80
1836 #define _SEG39COM3 0x80
1838 //==============================================================================
1841 //==============================================================================
1842 // LCDDATA23 Bits
1844 extern __at(0x0F7D) __sfr LCDDATA23;
1846 typedef union
1848 struct
1850 unsigned S40C3 : 1;
1851 unsigned S41C3 : 1;
1852 unsigned S42C3 : 1;
1853 unsigned S43C3 : 1;
1854 unsigned S44C3 : 1;
1855 unsigned S45C3 : 1;
1856 unsigned S46C3 : 1;
1857 unsigned S47C3 : 1;
1860 struct
1862 unsigned SEG40COM3 : 1;
1863 unsigned SEG41COM3 : 1;
1864 unsigned SEG42COM3 : 1;
1865 unsigned SEG43COM3 : 1;
1866 unsigned SEG44COM3 : 1;
1867 unsigned SEG45COM3 : 1;
1868 unsigned SEG46COM3 : 1;
1869 unsigned SEG47COM3 : 1;
1871 } __LCDDATA23bits_t;
1873 extern __at(0x0F7D) volatile __LCDDATA23bits_t LCDDATA23bits;
1875 #define _S40C3 0x01
1876 #define _SEG40COM3 0x01
1877 #define _S41C3 0x02
1878 #define _SEG41COM3 0x02
1879 #define _S42C3 0x04
1880 #define _SEG42COM3 0x04
1881 #define _S43C3 0x08
1882 #define _SEG43COM3 0x08
1883 #define _S44C3 0x10
1884 #define _SEG44COM3 0x10
1885 #define _S45C3 0x20
1886 #define _SEG45COM3 0x20
1887 #define _S46C3 0x40
1888 #define _SEG46COM3 0x40
1889 #define _S47C3 0x80
1890 #define _SEG47COM3 0x80
1892 //==============================================================================
1895 //==============================================================================
1896 // BAUDCON Bits
1898 extern __at(0x0F7E) __sfr BAUDCON;
1900 typedef union
1902 struct
1904 unsigned ABDEN : 1;
1905 unsigned WUE : 1;
1906 unsigned : 1;
1907 unsigned BRG16 : 1;
1908 unsigned TXCKP : 1;
1909 unsigned RXDTP : 1;
1910 unsigned RCMT : 1;
1911 unsigned ABDOVF : 1;
1914 struct
1916 unsigned : 1;
1917 unsigned : 1;
1918 unsigned : 1;
1919 unsigned : 1;
1920 unsigned : 1;
1921 unsigned : 1;
1922 unsigned RCIDL : 1;
1923 unsigned : 1;
1925 } __BAUDCONbits_t;
1927 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1929 #define _ABDEN 0x01
1930 #define _WUE 0x02
1931 #define _BRG16 0x08
1932 #define _TXCKP 0x10
1933 #define _RXDTP 0x20
1934 #define _RCMT 0x40
1935 #define _RCIDL 0x40
1936 #define _ABDOVF 0x80
1938 //==============================================================================
1941 //==============================================================================
1942 // BAUDCON1 Bits
1944 extern __at(0x0F7E) __sfr BAUDCON1;
1946 typedef union
1948 struct
1950 unsigned ABDEN : 1;
1951 unsigned WUE : 1;
1952 unsigned : 1;
1953 unsigned BRG16 : 1;
1954 unsigned TXCKP : 1;
1955 unsigned RXDTP : 1;
1956 unsigned RCMT : 1;
1957 unsigned ABDOVF : 1;
1960 struct
1962 unsigned : 1;
1963 unsigned : 1;
1964 unsigned : 1;
1965 unsigned : 1;
1966 unsigned : 1;
1967 unsigned : 1;
1968 unsigned RCIDL : 1;
1969 unsigned : 1;
1971 } __BAUDCON1bits_t;
1973 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1975 #define _BAUDCON1_ABDEN 0x01
1976 #define _BAUDCON1_WUE 0x02
1977 #define _BAUDCON1_BRG16 0x08
1978 #define _BAUDCON1_TXCKP 0x10
1979 #define _BAUDCON1_RXDTP 0x20
1980 #define _BAUDCON1_RCMT 0x40
1981 #define _BAUDCON1_RCIDL 0x40
1982 #define _BAUDCON1_ABDOVF 0x80
1984 //==============================================================================
1986 extern __at(0x0F7F) __sfr SPBRGH;
1987 extern __at(0x0F7F) __sfr SPBRGH1;
1989 //==============================================================================
1990 // PORTA Bits
1992 extern __at(0x0F80) __sfr PORTA;
1994 typedef union
1996 struct
1998 unsigned RA0 : 1;
1999 unsigned RA1 : 1;
2000 unsigned RA2 : 1;
2001 unsigned RA3 : 1;
2002 unsigned RA4 : 1;
2003 unsigned RA5 : 1;
2004 unsigned RA6 : 1;
2005 unsigned RA7 : 1;
2008 struct
2010 unsigned AN0 : 1;
2011 unsigned AN1 : 1;
2012 unsigned AN2 : 1;
2013 unsigned AN3 : 1;
2014 unsigned TOCKI : 1;
2015 unsigned AN4 : 1;
2016 unsigned OSC2 : 1;
2017 unsigned OSC1 : 1;
2020 struct
2022 unsigned : 1;
2023 unsigned SEG18 : 1;
2024 unsigned VREFM : 1;
2025 unsigned VREFP : 1;
2026 unsigned SEG14 : 1;
2027 unsigned SEG15 : 1;
2028 unsigned CLKO : 1;
2029 unsigned CLKI : 1;
2031 } __PORTAbits_t;
2033 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
2035 #define _RA0 0x01
2036 #define _AN0 0x01
2037 #define _RA1 0x02
2038 #define _AN1 0x02
2039 #define _SEG18 0x02
2040 #define _RA2 0x04
2041 #define _AN2 0x04
2042 #define _VREFM 0x04
2043 #define _RA3 0x08
2044 #define _AN3 0x08
2045 #define _VREFP 0x08
2046 #define _RA4 0x10
2047 #define _TOCKI 0x10
2048 #define _SEG14 0x10
2049 #define _RA5 0x20
2050 #define _AN4 0x20
2051 #define _SEG15 0x20
2052 #define _RA6 0x40
2053 #define _OSC2 0x40
2054 #define _CLKO 0x40
2055 #define _RA7 0x80
2056 #define _OSC1 0x80
2057 #define _CLKI 0x80
2059 //==============================================================================
2062 //==============================================================================
2063 // PORTB Bits
2065 extern __at(0x0F81) __sfr PORTB;
2067 typedef union
2069 struct
2071 unsigned RB0 : 1;
2072 unsigned RB1 : 1;
2073 unsigned RB2 : 1;
2074 unsigned RB3 : 1;
2075 unsigned RB4 : 1;
2076 unsigned RB5 : 1;
2077 unsigned RB6 : 1;
2078 unsigned RB7 : 1;
2081 struct
2083 unsigned INT0 : 1;
2084 unsigned INT1 : 1;
2085 unsigned INT2 : 1;
2086 unsigned INT3 : 1;
2087 unsigned KBI0 : 1;
2088 unsigned KBI1 : 1;
2089 unsigned KBI2 : 1;
2090 unsigned KBI3 : 1;
2093 struct
2095 unsigned SEG30 : 1;
2096 unsigned SEG8 : 1;
2097 unsigned SEG9 : 1;
2098 unsigned SEG10 : 1;
2099 unsigned SEG11 : 1;
2100 unsigned SEG29 : 1;
2101 unsigned PGC : 1;
2102 unsigned PGD : 1;
2105 struct
2107 unsigned : 1;
2108 unsigned : 1;
2109 unsigned CTED1 : 1;
2110 unsigned CTED2 : 1;
2111 unsigned : 1;
2112 unsigned : 1;
2113 unsigned : 1;
2114 unsigned : 1;
2117 struct
2119 unsigned INT : 4;
2120 unsigned : 4;
2123 struct
2125 unsigned : 4;
2126 unsigned KBI : 4;
2128 } __PORTBbits_t;
2130 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
2132 #define _RB0 0x01
2133 #define _INT0 0x01
2134 #define _SEG30 0x01
2135 #define _RB1 0x02
2136 #define _INT1 0x02
2137 #define _SEG8 0x02
2138 #define _RB2 0x04
2139 #define _INT2 0x04
2140 #define _SEG9 0x04
2141 #define _CTED1 0x04
2142 #define _RB3 0x08
2143 #define _INT3 0x08
2144 #define _SEG10 0x08
2145 #define _CTED2 0x08
2146 #define _RB4 0x10
2147 #define _KBI0 0x10
2148 #define _SEG11 0x10
2149 #define _RB5 0x20
2150 #define _KBI1 0x20
2151 #define _SEG29 0x20
2152 #define _RB6 0x40
2153 #define _KBI2 0x40
2154 #define _PGC 0x40
2155 #define _RB7 0x80
2156 #define _KBI3 0x80
2157 #define _PGD 0x80
2159 //==============================================================================
2162 //==============================================================================
2163 // PORTC Bits
2165 extern __at(0x0F82) __sfr PORTC;
2167 typedef union
2169 struct
2171 unsigned RC0 : 1;
2172 unsigned RC1 : 1;
2173 unsigned RC2 : 1;
2174 unsigned RC3 : 1;
2175 unsigned RC4 : 1;
2176 unsigned RC5 : 1;
2177 unsigned RC6 : 1;
2178 unsigned RC7 : 1;
2181 struct
2183 unsigned T1OSO : 1;
2184 unsigned T1OSI : 1;
2185 unsigned CCP1 : 1;
2186 unsigned SCL : 1;
2187 unsigned SDA : 1;
2188 unsigned SDO : 1;
2189 unsigned CK1 : 1;
2190 unsigned DT1 : 1;
2193 struct
2195 unsigned T13CKI : 1;
2196 unsigned CCP2 : 1;
2197 unsigned SEG13 : 1;
2198 unsigned SCK : 1;
2199 unsigned SDI : 1;
2200 unsigned SEG12 : 1;
2201 unsigned TX1 : 1;
2202 unsigned RX1 : 1;
2205 struct
2207 unsigned : 1;
2208 unsigned SEG32 : 1;
2209 unsigned : 1;
2210 unsigned SEG17 : 1;
2211 unsigned SEG16 : 1;
2212 unsigned : 1;
2213 unsigned SEG27 : 1;
2214 unsigned SEG28 : 1;
2216 } __PORTCbits_t;
2218 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
2220 #define _RC0 0x01
2221 #define _T1OSO 0x01
2222 #define _T13CKI 0x01
2223 #define _RC1 0x02
2224 #define _T1OSI 0x02
2225 #define _CCP2 0x02
2226 #define _SEG32 0x02
2227 #define _RC2 0x04
2228 #define _CCP1 0x04
2229 #define _SEG13 0x04
2230 #define _RC3 0x08
2231 #define _SCL 0x08
2232 #define _SCK 0x08
2233 #define _SEG17 0x08
2234 #define _RC4 0x10
2235 #define _SDA 0x10
2236 #define _SDI 0x10
2237 #define _SEG16 0x10
2238 #define _RC5 0x20
2239 #define _SDO 0x20
2240 #define _SEG12 0x20
2241 #define _RC6 0x40
2242 #define _CK1 0x40
2243 #define _TX1 0x40
2244 #define _SEG27 0x40
2245 #define _RC7 0x80
2246 #define _DT1 0x80
2247 #define _RX1 0x80
2248 #define _SEG28 0x80
2250 //==============================================================================
2253 //==============================================================================
2254 // PORTD Bits
2256 extern __at(0x0F83) __sfr PORTD;
2258 typedef union
2260 struct
2262 unsigned RD0 : 1;
2263 unsigned RD1 : 1;
2264 unsigned RD2 : 1;
2265 unsigned RD3 : 1;
2266 unsigned RD4 : 1;
2267 unsigned RD5 : 1;
2268 unsigned RD6 : 1;
2269 unsigned RD7 : 1;
2272 struct
2274 unsigned SEG0 : 1;
2275 unsigned SEG1 : 1;
2276 unsigned SEG2 : 1;
2277 unsigned SEG3 : 1;
2278 unsigned SEG4 : 1;
2279 unsigned SEG5 : 1;
2280 unsigned SEG6 : 1;
2281 unsigned SEG7 : 1;
2284 struct
2286 unsigned CTPLS : 1;
2287 unsigned : 1;
2288 unsigned : 1;
2289 unsigned : 1;
2290 unsigned : 1;
2291 unsigned : 1;
2292 unsigned : 1;
2293 unsigned : 1;
2295 } __PORTDbits_t;
2297 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
2299 #define _RD0 0x01
2300 #define _SEG0 0x01
2301 #define _CTPLS 0x01
2302 #define _RD1 0x02
2303 #define _SEG1 0x02
2304 #define _RD2 0x04
2305 #define _SEG2 0x04
2306 #define _RD3 0x08
2307 #define _SEG3 0x08
2308 #define _RD4 0x10
2309 #define _SEG4 0x10
2310 #define _RD5 0x20
2311 #define _SEG5 0x20
2312 #define _RD6 0x40
2313 #define _SEG6 0x40
2314 #define _RD7 0x80
2315 #define _SEG7 0x80
2317 //==============================================================================
2320 //==============================================================================
2321 // PORTE Bits
2323 extern __at(0x0F84) __sfr PORTE;
2325 typedef union
2327 struct
2329 unsigned RE0 : 1;
2330 unsigned RE1 : 1;
2331 unsigned : 1;
2332 unsigned RE3 : 1;
2333 unsigned RE4 : 1;
2334 unsigned RE5 : 1;
2335 unsigned RE6 : 1;
2336 unsigned RE7 : 1;
2339 struct
2341 unsigned LCDBIAS1 : 1;
2342 unsigned LCDBIAS2 : 1;
2343 unsigned : 1;
2344 unsigned COM0 : 1;
2345 unsigned COM1 : 1;
2346 unsigned COM2 : 1;
2347 unsigned COM3 : 1;
2348 unsigned CCP2 : 1;
2351 struct
2353 unsigned : 1;
2354 unsigned : 1;
2355 unsigned : 1;
2356 unsigned : 1;
2357 unsigned : 1;
2358 unsigned : 1;
2359 unsigned : 1;
2360 unsigned SEG31 : 1;
2363 struct
2365 unsigned : 3;
2366 unsigned COM : 4;
2367 unsigned : 1;
2369 } __PORTEbits_t;
2371 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
2373 #define _PORTE_RE0 0x01
2374 #define _PORTE_LCDBIAS1 0x01
2375 #define _PORTE_RE1 0x02
2376 #define _PORTE_LCDBIAS2 0x02
2377 #define _PORTE_RE3 0x08
2378 #define _PORTE_COM0 0x08
2379 #define _PORTE_RE4 0x10
2380 #define _PORTE_COM1 0x10
2381 #define _PORTE_RE5 0x20
2382 #define _PORTE_COM2 0x20
2383 #define _PORTE_RE6 0x40
2384 #define _PORTE_COM3 0x40
2385 #define _PORTE_RE7 0x80
2386 #define _PORTE_CCP2 0x80
2387 #define _PORTE_SEG31 0x80
2389 //==============================================================================
2392 //==============================================================================
2393 // PORTF Bits
2395 extern __at(0x0F85) __sfr PORTF;
2397 typedef union
2399 struct
2401 unsigned : 1;
2402 unsigned RF1 : 1;
2403 unsigned RF2 : 1;
2404 unsigned RF3 : 1;
2405 unsigned RF4 : 1;
2406 unsigned RF5 : 1;
2407 unsigned RF6 : 1;
2408 unsigned RF7 : 1;
2411 struct
2413 unsigned : 1;
2414 unsigned AN6 : 1;
2415 unsigned AN7 : 1;
2416 unsigned AN8 : 1;
2417 unsigned AN9 : 1;
2418 unsigned AN10 : 1;
2419 unsigned AN11 : 1;
2420 unsigned AN5 : 1;
2423 struct
2425 unsigned : 1;
2426 unsigned C2OUT : 1;
2427 unsigned C1OUT : 1;
2428 unsigned C2INB : 1;
2429 unsigned C2INA : 1;
2430 unsigned C1INB : 1;
2431 unsigned C1INA : 1;
2432 unsigned SS1 : 1;
2435 struct
2437 unsigned : 1;
2438 unsigned SEG19 : 1;
2439 unsigned SEG20 : 1;
2440 unsigned SEG21 : 1;
2441 unsigned SEG22 : 1;
2442 unsigned SEG23 : 1;
2443 unsigned SEG24 : 1;
2444 unsigned SEG25 : 1;
2447 struct
2449 unsigned : 1;
2450 unsigned : 1;
2451 unsigned : 1;
2452 unsigned : 1;
2453 unsigned : 1;
2454 unsigned CVREF : 1;
2455 unsigned : 1;
2456 unsigned : 1;
2458 } __PORTFbits_t;
2460 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
2462 #define _PORTF_RF1 0x02
2463 #define _PORTF_AN6 0x02
2464 #define _PORTF_C2OUT 0x02
2465 #define _PORTF_SEG19 0x02
2466 #define _PORTF_RF2 0x04
2467 #define _PORTF_AN7 0x04
2468 #define _PORTF_C1OUT 0x04
2469 #define _PORTF_SEG20 0x04
2470 #define _PORTF_RF3 0x08
2471 #define _PORTF_AN8 0x08
2472 #define _PORTF_C2INB 0x08
2473 #define _PORTF_SEG21 0x08
2474 #define _PORTF_RF4 0x10
2475 #define _PORTF_AN9 0x10
2476 #define _PORTF_C2INA 0x10
2477 #define _PORTF_SEG22 0x10
2478 #define _PORTF_RF5 0x20
2479 #define _PORTF_AN10 0x20
2480 #define _PORTF_C1INB 0x20
2481 #define _PORTF_SEG23 0x20
2482 #define _PORTF_CVREF 0x20
2483 #define _PORTF_RF6 0x40
2484 #define _PORTF_AN11 0x40
2485 #define _PORTF_C1INA 0x40
2486 #define _PORTF_SEG24 0x40
2487 #define _PORTF_RF7 0x80
2488 #define _PORTF_AN5 0x80
2489 #define _PORTF_SS1 0x80
2490 #define _PORTF_SEG25 0x80
2492 //==============================================================================
2495 //==============================================================================
2496 // PORTG Bits
2498 extern __at(0x0F86) __sfr PORTG;
2500 typedef union
2502 struct
2504 unsigned RG0 : 1;
2505 unsigned RG1 : 1;
2506 unsigned RG2 : 1;
2507 unsigned RG3 : 1;
2508 unsigned RG4 : 1;
2509 unsigned RJPU : 1;
2510 unsigned REPU : 1;
2511 unsigned RDPU : 1;
2514 struct
2516 unsigned LCDBIAS0 : 1;
2517 unsigned CK2 : 1;
2518 unsigned DT2 : 1;
2519 unsigned VLCAP2 : 1;
2520 unsigned SEG26 : 1;
2521 unsigned : 1;
2522 unsigned : 1;
2523 unsigned : 1;
2526 struct
2528 unsigned : 1;
2529 unsigned TX2 : 1;
2530 unsigned RX2 : 1;
2531 unsigned : 1;
2532 unsigned RTCC : 1;
2533 unsigned : 1;
2534 unsigned : 1;
2535 unsigned : 1;
2538 struct
2540 unsigned : 1;
2541 unsigned : 1;
2542 unsigned VLCAP1 : 1;
2543 unsigned : 1;
2544 unsigned : 1;
2545 unsigned : 1;
2546 unsigned : 1;
2547 unsigned : 1;
2550 struct
2552 unsigned RG : 5;
2553 unsigned : 3;
2555 } __PORTGbits_t;
2557 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
2559 #define _RG0 0x01
2560 #define _LCDBIAS0 0x01
2561 #define _RG1 0x02
2562 #define _CK2 0x02
2563 #define _TX2 0x02
2564 #define _RG2 0x04
2565 #define _DT2 0x04
2566 #define _RX2 0x04
2567 #define _VLCAP1 0x04
2568 #define _RG3 0x08
2569 #define _VLCAP2 0x08
2570 #define _RG4 0x10
2571 #define _SEG26 0x10
2572 #define _RTCC 0x10
2573 #define _RJPU 0x20
2574 #define _REPU 0x40
2575 #define _RDPU 0x80
2577 //==============================================================================
2580 //==============================================================================
2581 // PORTH Bits
2583 extern __at(0x0F87) __sfr PORTH;
2585 typedef union
2587 struct
2589 unsigned RH0 : 1;
2590 unsigned RH1 : 1;
2591 unsigned RH2 : 1;
2592 unsigned RH3 : 1;
2593 unsigned RH4 : 1;
2594 unsigned RH5 : 1;
2595 unsigned RH6 : 1;
2596 unsigned RH7 : 1;
2599 struct
2601 unsigned SEG47 : 1;
2602 unsigned SEG46 : 1;
2603 unsigned SEG45 : 1;
2604 unsigned SEG44 : 1;
2605 unsigned SEG40 : 1;
2606 unsigned SEG41 : 1;
2607 unsigned SEG42 : 1;
2608 unsigned SEG43 : 1;
2610 } __PORTHbits_t;
2612 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
2614 #define _RH0 0x01
2615 #define _SEG47 0x01
2616 #define _RH1 0x02
2617 #define _SEG46 0x02
2618 #define _RH2 0x04
2619 #define _SEG45 0x04
2620 #define _RH3 0x08
2621 #define _SEG44 0x08
2622 #define _RH4 0x10
2623 #define _SEG40 0x10
2624 #define _RH5 0x20
2625 #define _SEG41 0x20
2626 #define _RH6 0x40
2627 #define _SEG42 0x40
2628 #define _RH7 0x80
2629 #define _SEG43 0x80
2631 //==============================================================================
2634 //==============================================================================
2635 // PORTJ Bits
2637 extern __at(0x0F88) __sfr PORTJ;
2639 typedef union
2641 struct
2643 unsigned RJ0 : 1;
2644 unsigned RJ1 : 1;
2645 unsigned RJ2 : 1;
2646 unsigned RJ3 : 1;
2647 unsigned RJ4 : 1;
2648 unsigned RJ5 : 1;
2649 unsigned RJ6 : 1;
2650 unsigned RJ7 : 1;
2653 struct
2655 unsigned : 1;
2656 unsigned SEG33 : 1;
2657 unsigned SEG34 : 1;
2658 unsigned SEG35 : 1;
2659 unsigned SEG39 : 1;
2660 unsigned SEG38 : 1;
2661 unsigned SEG37 : 1;
2662 unsigned SEG36 : 1;
2664 } __PORTJbits_t;
2666 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
2668 #define _RJ0 0x01
2669 #define _RJ1 0x02
2670 #define _SEG33 0x02
2671 #define _RJ2 0x04
2672 #define _SEG34 0x04
2673 #define _RJ3 0x08
2674 #define _SEG35 0x08
2675 #define _RJ4 0x10
2676 #define _SEG39 0x10
2677 #define _RJ5 0x20
2678 #define _SEG38 0x20
2679 #define _RJ6 0x40
2680 #define _SEG37 0x40
2681 #define _RJ7 0x80
2682 #define _SEG36 0x80
2684 //==============================================================================
2687 //==============================================================================
2688 // LATA Bits
2690 extern __at(0x0F89) __sfr LATA;
2692 typedef struct
2694 unsigned LATA0 : 1;
2695 unsigned LATA1 : 1;
2696 unsigned LATA2 : 1;
2697 unsigned LATA3 : 1;
2698 unsigned LATA4 : 1;
2699 unsigned LATA5 : 1;
2700 unsigned LATA6 : 1;
2701 unsigned LATA7 : 1;
2702 } __LATAbits_t;
2704 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2706 #define _LATA0 0x01
2707 #define _LATA1 0x02
2708 #define _LATA2 0x04
2709 #define _LATA3 0x08
2710 #define _LATA4 0x10
2711 #define _LATA5 0x20
2712 #define _LATA6 0x40
2713 #define _LATA7 0x80
2715 //==============================================================================
2718 //==============================================================================
2719 // LATB Bits
2721 extern __at(0x0F8A) __sfr LATB;
2723 typedef struct
2725 unsigned LATB0 : 1;
2726 unsigned LATB1 : 1;
2727 unsigned LATB2 : 1;
2728 unsigned LATB3 : 1;
2729 unsigned LATB4 : 1;
2730 unsigned LATB5 : 1;
2731 unsigned LATB6 : 1;
2732 unsigned LATB7 : 1;
2733 } __LATBbits_t;
2735 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2737 #define _LATB0 0x01
2738 #define _LATB1 0x02
2739 #define _LATB2 0x04
2740 #define _LATB3 0x08
2741 #define _LATB4 0x10
2742 #define _LATB5 0x20
2743 #define _LATB6 0x40
2744 #define _LATB7 0x80
2746 //==============================================================================
2749 //==============================================================================
2750 // LATC Bits
2752 extern __at(0x0F8B) __sfr LATC;
2754 typedef struct
2756 unsigned LATC0 : 1;
2757 unsigned LATC1 : 1;
2758 unsigned LATC2 : 1;
2759 unsigned LATC3 : 1;
2760 unsigned LATC4 : 1;
2761 unsigned LATC5 : 1;
2762 unsigned LATC6 : 1;
2763 unsigned LATC7 : 1;
2764 } __LATCbits_t;
2766 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2768 #define _LATC0 0x01
2769 #define _LATC1 0x02
2770 #define _LATC2 0x04
2771 #define _LATC3 0x08
2772 #define _LATC4 0x10
2773 #define _LATC5 0x20
2774 #define _LATC6 0x40
2775 #define _LATC7 0x80
2777 //==============================================================================
2780 //==============================================================================
2781 // LATD Bits
2783 extern __at(0x0F8C) __sfr LATD;
2785 typedef struct
2787 unsigned LATD0 : 1;
2788 unsigned LATD1 : 1;
2789 unsigned LATD2 : 1;
2790 unsigned LATD3 : 1;
2791 unsigned LATD4 : 1;
2792 unsigned LATD5 : 1;
2793 unsigned LATD6 : 1;
2794 unsigned LATD7 : 1;
2795 } __LATDbits_t;
2797 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2799 #define _LATD0 0x01
2800 #define _LATD1 0x02
2801 #define _LATD2 0x04
2802 #define _LATD3 0x08
2803 #define _LATD4 0x10
2804 #define _LATD5 0x20
2805 #define _LATD6 0x40
2806 #define _LATD7 0x80
2808 //==============================================================================
2811 //==============================================================================
2812 // LATE Bits
2814 extern __at(0x0F8D) __sfr LATE;
2816 typedef struct
2818 unsigned LATE0 : 1;
2819 unsigned LATE1 : 1;
2820 unsigned : 1;
2821 unsigned LATE3 : 1;
2822 unsigned LATE4 : 1;
2823 unsigned LATE5 : 1;
2824 unsigned LATE6 : 1;
2825 unsigned LATE7 : 1;
2826 } __LATEbits_t;
2828 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2830 #define _LATE0 0x01
2831 #define _LATE1 0x02
2832 #define _LATE3 0x08
2833 #define _LATE4 0x10
2834 #define _LATE5 0x20
2835 #define _LATE6 0x40
2836 #define _LATE7 0x80
2838 //==============================================================================
2841 //==============================================================================
2842 // LATF Bits
2844 extern __at(0x0F8E) __sfr LATF;
2846 typedef struct
2848 unsigned : 1;
2849 unsigned LATF1 : 1;
2850 unsigned LATF2 : 1;
2851 unsigned LATF3 : 1;
2852 unsigned LATF4 : 1;
2853 unsigned LATF5 : 1;
2854 unsigned LATF6 : 1;
2855 unsigned LATF7 : 1;
2856 } __LATFbits_t;
2858 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
2860 #define _LATF1 0x02
2861 #define _LATF2 0x04
2862 #define _LATF3 0x08
2863 #define _LATF4 0x10
2864 #define _LATF5 0x20
2865 #define _LATF6 0x40
2866 #define _LATF7 0x80
2868 //==============================================================================
2871 //==============================================================================
2872 // LATG Bits
2874 extern __at(0x0F8F) __sfr LATG;
2876 typedef union
2878 struct
2880 unsigned LATG0 : 1;
2881 unsigned LATG1 : 1;
2882 unsigned LATG2 : 1;
2883 unsigned LATG3 : 1;
2884 unsigned LATG4 : 1;
2885 unsigned : 1;
2886 unsigned U1OD : 1;
2887 unsigned U2OD : 1;
2890 struct
2892 unsigned LATG : 5;
2893 unsigned : 3;
2895 } __LATGbits_t;
2897 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2899 #define _LATG0 0x01
2900 #define _LATG1 0x02
2901 #define _LATG2 0x04
2902 #define _LATG3 0x08
2903 #define _LATG4 0x10
2904 #define _U1OD 0x40
2905 #define _U2OD 0x80
2907 //==============================================================================
2910 //==============================================================================
2911 // LATH Bits
2913 extern __at(0x0F90) __sfr LATH;
2915 typedef struct
2917 unsigned LATH0 : 1;
2918 unsigned LATH1 : 1;
2919 unsigned LATH2 : 1;
2920 unsigned LATH3 : 1;
2921 unsigned LATH4 : 1;
2922 unsigned LATH5 : 1;
2923 unsigned LATH6 : 1;
2924 unsigned LATH7 : 1;
2925 } __LATHbits_t;
2927 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
2929 #define _LATH0 0x01
2930 #define _LATH1 0x02
2931 #define _LATH2 0x04
2932 #define _LATH3 0x08
2933 #define _LATH4 0x10
2934 #define _LATH5 0x20
2935 #define _LATH6 0x40
2936 #define _LATH7 0x80
2938 //==============================================================================
2941 //==============================================================================
2942 // LATJ Bits
2944 extern __at(0x0F91) __sfr LATJ;
2946 typedef struct
2948 unsigned LATJ0 : 1;
2949 unsigned LATJ1 : 1;
2950 unsigned LATJ2 : 1;
2951 unsigned LATJ3 : 1;
2952 unsigned LATJ4 : 1;
2953 unsigned LATJ5 : 1;
2954 unsigned LATJ6 : 1;
2955 unsigned LATJ7 : 1;
2956 } __LATJbits_t;
2958 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
2960 #define _LATJ0 0x01
2961 #define _LATJ1 0x02
2962 #define _LATJ2 0x04
2963 #define _LATJ3 0x08
2964 #define _LATJ4 0x10
2965 #define _LATJ5 0x20
2966 #define _LATJ6 0x40
2967 #define _LATJ7 0x80
2969 //==============================================================================
2972 //==============================================================================
2973 // TRISA Bits
2975 extern __at(0x0F92) __sfr TRISA;
2977 typedef struct
2979 unsigned TRISA0 : 1;
2980 unsigned TRISA1 : 1;
2981 unsigned TRISA2 : 1;
2982 unsigned TRISA3 : 1;
2983 unsigned TRISA4 : 1;
2984 unsigned TRISA5 : 1;
2985 unsigned TRISA6 : 1;
2986 unsigned TRISA7 : 1;
2987 } __TRISAbits_t;
2989 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2991 #define _TRISA0 0x01
2992 #define _TRISA1 0x02
2993 #define _TRISA2 0x04
2994 #define _TRISA3 0x08
2995 #define _TRISA4 0x10
2996 #define _TRISA5 0x20
2997 #define _TRISA6 0x40
2998 #define _TRISA7 0x80
3000 //==============================================================================
3003 //==============================================================================
3004 // TRISB Bits
3006 extern __at(0x0F93) __sfr TRISB;
3008 typedef struct
3010 unsigned TRISB0 : 1;
3011 unsigned TRISB1 : 1;
3012 unsigned TRISB2 : 1;
3013 unsigned TRISB3 : 1;
3014 unsigned TRISB4 : 1;
3015 unsigned TRISB5 : 1;
3016 unsigned TRISB6 : 1;
3017 unsigned TRISB7 : 1;
3018 } __TRISBbits_t;
3020 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3022 #define _TRISB0 0x01
3023 #define _TRISB1 0x02
3024 #define _TRISB2 0x04
3025 #define _TRISB3 0x08
3026 #define _TRISB4 0x10
3027 #define _TRISB5 0x20
3028 #define _TRISB6 0x40
3029 #define _TRISB7 0x80
3031 //==============================================================================
3034 //==============================================================================
3035 // TRISC Bits
3037 extern __at(0x0F94) __sfr TRISC;
3039 typedef struct
3041 unsigned TRISC0 : 1;
3042 unsigned TRISC1 : 1;
3043 unsigned TRISC2 : 1;
3044 unsigned TRISC3 : 1;
3045 unsigned TRISC4 : 1;
3046 unsigned TRISC5 : 1;
3047 unsigned TRISC6 : 1;
3048 unsigned TRISC7 : 1;
3049 } __TRISCbits_t;
3051 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3053 #define _TRISC0 0x01
3054 #define _TRISC1 0x02
3055 #define _TRISC2 0x04
3056 #define _TRISC3 0x08
3057 #define _TRISC4 0x10
3058 #define _TRISC5 0x20
3059 #define _TRISC6 0x40
3060 #define _TRISC7 0x80
3062 //==============================================================================
3065 //==============================================================================
3066 // TRISD Bits
3068 extern __at(0x0F95) __sfr TRISD;
3070 typedef struct
3072 unsigned TRISD0 : 1;
3073 unsigned TRISD1 : 1;
3074 unsigned TRISD2 : 1;
3075 unsigned TRISD3 : 1;
3076 unsigned TRISD4 : 1;
3077 unsigned TRISD5 : 1;
3078 unsigned TRISD6 : 1;
3079 unsigned TRISD7 : 1;
3080 } __TRISDbits_t;
3082 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
3084 #define _TRISD0 0x01
3085 #define _TRISD1 0x02
3086 #define _TRISD2 0x04
3087 #define _TRISD3 0x08
3088 #define _TRISD4 0x10
3089 #define _TRISD5 0x20
3090 #define _TRISD6 0x40
3091 #define _TRISD7 0x80
3093 //==============================================================================
3096 //==============================================================================
3097 // TRISE Bits
3099 extern __at(0x0F96) __sfr TRISE;
3101 typedef struct
3103 unsigned TRISE0 : 1;
3104 unsigned TRISE1 : 1;
3105 unsigned : 1;
3106 unsigned TRISE3 : 1;
3107 unsigned TRISE4 : 1;
3108 unsigned TRISE5 : 1;
3109 unsigned TRISE6 : 1;
3110 unsigned TRISE7 : 1;
3111 } __TRISEbits_t;
3113 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
3115 #define _TRISE0 0x01
3116 #define _TRISE1 0x02
3117 #define _TRISE3 0x08
3118 #define _TRISE4 0x10
3119 #define _TRISE5 0x20
3120 #define _TRISE6 0x40
3121 #define _TRISE7 0x80
3123 //==============================================================================
3126 //==============================================================================
3127 // TRISF Bits
3129 extern __at(0x0F97) __sfr TRISF;
3131 typedef struct
3133 unsigned : 1;
3134 unsigned TRISF1 : 1;
3135 unsigned TRISF2 : 1;
3136 unsigned TRISF3 : 1;
3137 unsigned TRISF4 : 1;
3138 unsigned TRISF5 : 1;
3139 unsigned TRISF6 : 1;
3140 unsigned TRISF7 : 1;
3141 } __TRISFbits_t;
3143 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
3145 #define _TRISF1 0x02
3146 #define _TRISF2 0x04
3147 #define _TRISF3 0x08
3148 #define _TRISF4 0x10
3149 #define _TRISF5 0x20
3150 #define _TRISF6 0x40
3151 #define _TRISF7 0x80
3153 //==============================================================================
3156 //==============================================================================
3157 // TRISG Bits
3159 extern __at(0x0F98) __sfr TRISG;
3161 typedef union
3163 struct
3165 unsigned TRISG0 : 1;
3166 unsigned TRISG1 : 1;
3167 unsigned TRISG2 : 1;
3168 unsigned TRISG3 : 1;
3169 unsigned TRISG4 : 1;
3170 unsigned CCP1OD : 1;
3171 unsigned CCP2OD : 1;
3172 unsigned SPIOD : 1;
3175 struct
3177 unsigned TRISG : 5;
3178 unsigned : 3;
3180 } __TRISGbits_t;
3182 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
3184 #define _TRISG0 0x01
3185 #define _TRISG1 0x02
3186 #define _TRISG2 0x04
3187 #define _TRISG3 0x08
3188 #define _TRISG4 0x10
3189 #define _CCP1OD 0x20
3190 #define _CCP2OD 0x40
3191 #define _SPIOD 0x80
3193 //==============================================================================
3196 //==============================================================================
3197 // TRISH Bits
3199 extern __at(0x0F99) __sfr TRISH;
3201 typedef struct
3203 unsigned TRISH0 : 1;
3204 unsigned TRISH1 : 1;
3205 unsigned TRISH2 : 1;
3206 unsigned TRISH3 : 1;
3207 unsigned TRISH4 : 1;
3208 unsigned TRISH5 : 1;
3209 unsigned TRISH6 : 1;
3210 unsigned TRISH7 : 1;
3211 } __TRISHbits_t;
3213 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
3215 #define _TRISH0 0x01
3216 #define _TRISH1 0x02
3217 #define _TRISH2 0x04
3218 #define _TRISH3 0x08
3219 #define _TRISH4 0x10
3220 #define _TRISH5 0x20
3221 #define _TRISH6 0x40
3222 #define _TRISH7 0x80
3224 //==============================================================================
3227 //==============================================================================
3228 // TRISJ Bits
3230 extern __at(0x0F9A) __sfr TRISJ;
3232 typedef struct
3234 unsigned TRISJ0 : 1;
3235 unsigned TRISJ1 : 1;
3236 unsigned TRISJ2 : 1;
3237 unsigned TRISJ3 : 1;
3238 unsigned TRISJ4 : 1;
3239 unsigned TRISJ5 : 1;
3240 unsigned TRISJ6 : 1;
3241 unsigned TRISJ7 : 1;
3242 } __TRISJbits_t;
3244 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
3246 #define _TRISJ0 0x01
3247 #define _TRISJ1 0x02
3248 #define _TRISJ2 0x04
3249 #define _TRISJ3 0x08
3250 #define _TRISJ4 0x10
3251 #define _TRISJ5 0x20
3252 #define _TRISJ6 0x40
3253 #define _TRISJ7 0x80
3255 //==============================================================================
3258 //==============================================================================
3259 // OSCTUNE Bits
3261 extern __at(0x0F9B) __sfr OSCTUNE;
3263 typedef union
3265 struct
3267 unsigned TUN0 : 1;
3268 unsigned TUN1 : 1;
3269 unsigned TUN2 : 1;
3270 unsigned TUN3 : 1;
3271 unsigned TUN4 : 1;
3272 unsigned TUN5 : 1;
3273 unsigned PLLEN : 1;
3274 unsigned INTSRC : 1;
3277 struct
3279 unsigned TUN : 6;
3280 unsigned : 2;
3282 } __OSCTUNEbits_t;
3284 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3286 #define _TUN0 0x01
3287 #define _TUN1 0x02
3288 #define _TUN2 0x04
3289 #define _TUN3 0x08
3290 #define _TUN4 0x10
3291 #define _TUN5 0x20
3292 #define _PLLEN 0x40
3293 #define _INTSRC 0x80
3295 //==============================================================================
3298 //==============================================================================
3299 // PIE1 Bits
3301 extern __at(0x0F9D) __sfr PIE1;
3303 typedef union
3305 struct
3307 unsigned TMR1IE : 1;
3308 unsigned TMR2IE : 1;
3309 unsigned : 1;
3310 unsigned SSPIE : 1;
3311 unsigned TX1IE : 1;
3312 unsigned RC1IE : 1;
3313 unsigned ADIE : 1;
3314 unsigned : 1;
3317 struct
3319 unsigned : 1;
3320 unsigned : 1;
3321 unsigned : 1;
3322 unsigned SSP1IE : 1;
3323 unsigned TXIE : 1;
3324 unsigned RCIE : 1;
3325 unsigned : 1;
3326 unsigned : 1;
3328 } __PIE1bits_t;
3330 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3332 #define _TMR1IE 0x01
3333 #define _TMR2IE 0x02
3334 #define _SSPIE 0x08
3335 #define _SSP1IE 0x08
3336 #define _TX1IE 0x10
3337 #define _TXIE 0x10
3338 #define _RC1IE 0x20
3339 #define _RCIE 0x20
3340 #define _ADIE 0x40
3342 //==============================================================================
3345 //==============================================================================
3346 // PIR1 Bits
3348 extern __at(0x0F9E) __sfr PIR1;
3350 typedef union
3352 struct
3354 unsigned TMR1IF : 1;
3355 unsigned TMR2IF : 1;
3356 unsigned : 1;
3357 unsigned SSPIF : 1;
3358 unsigned TX1IF : 1;
3359 unsigned RC1IF : 1;
3360 unsigned ADIF : 1;
3361 unsigned : 1;
3364 struct
3366 unsigned : 1;
3367 unsigned : 1;
3368 unsigned : 1;
3369 unsigned SSP1IF : 1;
3370 unsigned TXIF : 1;
3371 unsigned RCIF : 1;
3372 unsigned : 1;
3373 unsigned : 1;
3375 } __PIR1bits_t;
3377 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3379 #define _TMR1IF 0x01
3380 #define _TMR2IF 0x02
3381 #define _SSPIF 0x08
3382 #define _SSP1IF 0x08
3383 #define _TX1IF 0x10
3384 #define _TXIF 0x10
3385 #define _RC1IF 0x20
3386 #define _RCIF 0x20
3387 #define _ADIF 0x40
3389 //==============================================================================
3392 //==============================================================================
3393 // IPR1 Bits
3395 extern __at(0x0F9F) __sfr IPR1;
3397 typedef union
3399 struct
3401 unsigned TMR1IP : 1;
3402 unsigned TMR2IP : 1;
3403 unsigned : 1;
3404 unsigned SSPIP : 1;
3405 unsigned TX1IP : 1;
3406 unsigned RC1IP : 1;
3407 unsigned ADIP : 1;
3408 unsigned : 1;
3411 struct
3413 unsigned : 1;
3414 unsigned : 1;
3415 unsigned : 1;
3416 unsigned SSP1IP : 1;
3417 unsigned TXIP : 1;
3418 unsigned RCIP : 1;
3419 unsigned : 1;
3420 unsigned : 1;
3422 } __IPR1bits_t;
3424 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3426 #define _TMR1IP 0x01
3427 #define _TMR2IP 0x02
3428 #define _SSPIP 0x08
3429 #define _SSP1IP 0x08
3430 #define _TX1IP 0x10
3431 #define _TXIP 0x10
3432 #define _RC1IP 0x20
3433 #define _RCIP 0x20
3434 #define _ADIP 0x40
3436 //==============================================================================
3439 //==============================================================================
3440 // PIE2 Bits
3442 extern __at(0x0FA0) __sfr PIE2;
3444 typedef union
3446 struct
3448 unsigned : 1;
3449 unsigned TMR3IE : 1;
3450 unsigned LVDIE : 1;
3451 unsigned BCLIE : 1;
3452 unsigned : 1;
3453 unsigned : 1;
3454 unsigned CMIE : 1;
3455 unsigned OSCFIE : 1;
3458 struct
3460 unsigned : 1;
3461 unsigned : 1;
3462 unsigned : 1;
3463 unsigned BCL1IE : 1;
3464 unsigned : 1;
3465 unsigned : 1;
3466 unsigned : 1;
3467 unsigned : 1;
3469 } __PIE2bits_t;
3471 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3473 #define _TMR3IE 0x02
3474 #define _LVDIE 0x04
3475 #define _BCLIE 0x08
3476 #define _BCL1IE 0x08
3477 #define _CMIE 0x40
3478 #define _OSCFIE 0x80
3480 //==============================================================================
3483 //==============================================================================
3484 // PIR2 Bits
3486 extern __at(0x0FA1) __sfr PIR2;
3488 typedef union
3490 struct
3492 unsigned : 1;
3493 unsigned TMR3IF : 1;
3494 unsigned LVDIF : 1;
3495 unsigned BCLIF : 1;
3496 unsigned : 1;
3497 unsigned : 1;
3498 unsigned CMIF : 1;
3499 unsigned OSCFIF : 1;
3502 struct
3504 unsigned : 1;
3505 unsigned : 1;
3506 unsigned : 1;
3507 unsigned BCL1IF : 1;
3508 unsigned : 1;
3509 unsigned : 1;
3510 unsigned : 1;
3511 unsigned : 1;
3513 } __PIR2bits_t;
3515 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3517 #define _TMR3IF 0x02
3518 #define _LVDIF 0x04
3519 #define _BCLIF 0x08
3520 #define _BCL1IF 0x08
3521 #define _CMIF 0x40
3522 #define _OSCFIF 0x80
3524 //==============================================================================
3527 //==============================================================================
3528 // IPR2 Bits
3530 extern __at(0x0FA2) __sfr IPR2;
3532 typedef union
3534 struct
3536 unsigned : 1;
3537 unsigned TMR3IP : 1;
3538 unsigned LVDIP : 1;
3539 unsigned BCLIP : 1;
3540 unsigned : 1;
3541 unsigned : 1;
3542 unsigned CMIP : 1;
3543 unsigned OSCFIP : 1;
3546 struct
3548 unsigned : 1;
3549 unsigned : 1;
3550 unsigned : 1;
3551 unsigned BCL1IP : 1;
3552 unsigned : 1;
3553 unsigned : 1;
3554 unsigned : 1;
3555 unsigned : 1;
3557 } __IPR2bits_t;
3559 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3561 #define _TMR3IP 0x02
3562 #define _LVDIP 0x04
3563 #define _BCLIP 0x08
3564 #define _BCL1IP 0x08
3565 #define _CMIP 0x40
3566 #define _OSCFIP 0x80
3568 //==============================================================================
3571 //==============================================================================
3572 // PIE3 Bits
3574 extern __at(0x0FA3) __sfr PIE3;
3576 typedef struct
3578 unsigned RTCCIE : 1;
3579 unsigned CCP1IE : 1;
3580 unsigned CCP2IE : 1;
3581 unsigned CTMUIE : 1;
3582 unsigned TX2IE : 1;
3583 unsigned RC2IE : 1;
3584 unsigned LCDIE : 1;
3585 unsigned : 1;
3586 } __PIE3bits_t;
3588 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3590 #define _RTCCIE 0x01
3591 #define _CCP1IE 0x02
3592 #define _CCP2IE 0x04
3593 #define _CTMUIE 0x08
3594 #define _TX2IE 0x10
3595 #define _RC2IE 0x20
3596 #define _LCDIE 0x40
3598 //==============================================================================
3601 //==============================================================================
3602 // PIR3 Bits
3604 extern __at(0x0FA4) __sfr PIR3;
3606 typedef struct
3608 unsigned RTCCIF : 1;
3609 unsigned CCP1IF : 1;
3610 unsigned CCP2IF : 1;
3611 unsigned CTMUIF : 1;
3612 unsigned TX2IF : 1;
3613 unsigned RC2IF : 1;
3614 unsigned LCDIF : 1;
3615 unsigned : 1;
3616 } __PIR3bits_t;
3618 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3620 #define _RTCCIF 0x01
3621 #define _CCP1IF 0x02
3622 #define _CCP2IF 0x04
3623 #define _CTMUIF 0x08
3624 #define _TX2IF 0x10
3625 #define _RC2IF 0x20
3626 #define _LCDIF 0x40
3628 //==============================================================================
3631 //==============================================================================
3632 // IPR3 Bits
3634 extern __at(0x0FA5) __sfr IPR3;
3636 typedef struct
3638 unsigned RTCCIP : 1;
3639 unsigned CCP1IP : 1;
3640 unsigned CCP2IP : 1;
3641 unsigned CTMUIP : 1;
3642 unsigned TX2IP : 1;
3643 unsigned RC2IP : 1;
3644 unsigned LCDIP : 1;
3645 unsigned : 1;
3646 } __IPR3bits_t;
3648 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3650 #define _RTCCIP 0x01
3651 #define _CCP1IP 0x02
3652 #define _CCP2IP 0x04
3653 #define _CTMUIP 0x08
3654 #define _TX2IP 0x10
3655 #define _RC2IP 0x20
3656 #define _LCDIP 0x40
3658 //==============================================================================
3661 //==============================================================================
3662 // EECON1 Bits
3664 extern __at(0x0FA6) __sfr EECON1;
3666 typedef struct
3668 unsigned : 1;
3669 unsigned WR : 1;
3670 unsigned WREN : 1;
3671 unsigned WRERR : 1;
3672 unsigned FREE : 1;
3673 unsigned WPROG : 1;
3674 unsigned : 1;
3675 unsigned : 1;
3676 } __EECON1bits_t;
3678 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3680 #define _WR 0x02
3681 #define _WREN 0x04
3682 #define _WRERR 0x08
3683 #define _FREE 0x10
3684 #define _WPROG 0x20
3686 //==============================================================================
3688 extern __at(0x0FA7) __sfr EECON2;
3690 //==============================================================================
3691 // LCDCON Bits
3693 extern __at(0x0FA8) __sfr LCDCON;
3695 typedef union
3697 struct
3699 unsigned LMUX0 : 1;
3700 unsigned LMUX1 : 1;
3701 unsigned CS0 : 1;
3702 unsigned CS1 : 1;
3703 unsigned : 1;
3704 unsigned WERR : 1;
3705 unsigned SLPEN : 1;
3706 unsigned LCDEN : 1;
3709 struct
3711 unsigned : 1;
3712 unsigned : 1;
3713 unsigned LCDCS0 : 1;
3714 unsigned LCDCS1 : 1;
3715 unsigned : 1;
3716 unsigned LCDWERR : 1;
3717 unsigned LCDSLPEN : 1;
3718 unsigned : 1;
3721 struct
3723 unsigned LMUX : 2;
3724 unsigned : 6;
3727 struct
3729 unsigned : 2;
3730 unsigned LCDCS : 2;
3731 unsigned : 4;
3734 struct
3736 unsigned : 2;
3737 unsigned CS : 2;
3738 unsigned : 4;
3740 } __LCDCONbits_t;
3742 extern __at(0x0FA8) volatile __LCDCONbits_t LCDCONbits;
3744 #define _LMUX0 0x01
3745 #define _LMUX1 0x02
3746 #define _CS0 0x04
3747 #define _LCDCS0 0x04
3748 #define _CS1 0x08
3749 #define _LCDCS1 0x08
3750 #define _WERR 0x20
3751 #define _LCDWERR 0x20
3752 #define _SLPEN 0x40
3753 #define _LCDSLPEN 0x40
3754 #define _LCDEN 0x80
3756 //==============================================================================
3759 //==============================================================================
3760 // LCDSE0 Bits
3762 extern __at(0x0FA9) __sfr LCDSE0;
3764 typedef union
3766 struct
3768 unsigned SE0 : 1;
3769 unsigned SE1 : 1;
3770 unsigned SE2 : 1;
3771 unsigned SE3 : 1;
3772 unsigned SE4 : 1;
3773 unsigned SE5 : 1;
3774 unsigned SE6 : 1;
3775 unsigned SE7 : 1;
3778 struct
3780 unsigned SEGEN0 : 1;
3781 unsigned SEGEN1 : 1;
3782 unsigned SEGEN2 : 1;
3783 unsigned SEGEN3 : 1;
3784 unsigned SEGEN4 : 1;
3785 unsigned SEGEN5 : 1;
3786 unsigned SEGEN6 : 1;
3787 unsigned SEGEN7 : 1;
3790 struct
3792 unsigned SE00 : 1;
3793 unsigned SE01 : 1;
3794 unsigned SE02 : 1;
3795 unsigned SE03 : 1;
3796 unsigned SE04 : 1;
3797 unsigned SE05 : 1;
3798 unsigned SE06 : 1;
3799 unsigned SE07 : 1;
3801 } __LCDSE0bits_t;
3803 extern __at(0x0FA9) volatile __LCDSE0bits_t LCDSE0bits;
3805 #define _SE0 0x01
3806 #define _SEGEN0 0x01
3807 #define _SE00 0x01
3808 #define _SE1 0x02
3809 #define _SEGEN1 0x02
3810 #define _SE01 0x02
3811 #define _SE2 0x04
3812 #define _SEGEN2 0x04
3813 #define _SE02 0x04
3814 #define _SE3 0x08
3815 #define _SEGEN3 0x08
3816 #define _SE03 0x08
3817 #define _SE4 0x10
3818 #define _SEGEN4 0x10
3819 #define _SE04 0x10
3820 #define _SE5 0x20
3821 #define _SEGEN5 0x20
3822 #define _SE05 0x20
3823 #define _SE6 0x40
3824 #define _SEGEN6 0x40
3825 #define _SE06 0x40
3826 #define _SE7 0x80
3827 #define _SEGEN7 0x80
3828 #define _SE07 0x80
3830 //==============================================================================
3833 //==============================================================================
3834 // LCDPS Bits
3836 extern __at(0x0FAA) __sfr LCDPS;
3838 typedef union
3840 struct
3842 unsigned LP0 : 1;
3843 unsigned LP1 : 1;
3844 unsigned LP2 : 1;
3845 unsigned LP3 : 1;
3846 unsigned WA : 1;
3847 unsigned LCDA : 1;
3848 unsigned BIASMD : 1;
3849 unsigned WFT : 1;
3852 struct
3854 unsigned LCDPS0 : 1;
3855 unsigned LCDPS1 : 1;
3856 unsigned LCDPS2 : 1;
3857 unsigned LCDPS3 : 1;
3858 unsigned : 1;
3859 unsigned : 1;
3860 unsigned : 1;
3861 unsigned : 1;
3864 struct
3866 unsigned LP : 4;
3867 unsigned : 4;
3870 struct
3872 unsigned LCDPS : 4;
3873 unsigned : 4;
3875 } __LCDPSbits_t;
3877 extern __at(0x0FAA) volatile __LCDPSbits_t LCDPSbits;
3879 #define _LP0 0x01
3880 #define _LCDPS0 0x01
3881 #define _LP1 0x02
3882 #define _LCDPS1 0x02
3883 #define _LP2 0x04
3884 #define _LCDPS2 0x04
3885 #define _LP3 0x08
3886 #define _LCDPS3 0x08
3887 #define _WA 0x10
3888 #define _LCDA 0x20
3889 #define _BIASMD 0x40
3890 #define _WFT 0x80
3892 //==============================================================================
3895 //==============================================================================
3896 // RCSTA Bits
3898 extern __at(0x0FAB) __sfr RCSTA;
3900 typedef union
3902 struct
3904 unsigned RX9D : 1;
3905 unsigned OERR : 1;
3906 unsigned FERR : 1;
3907 unsigned ADDEN : 1;
3908 unsigned CREN : 1;
3909 unsigned SREN : 1;
3910 unsigned RX9 : 1;
3911 unsigned SPEN : 1;
3914 struct
3916 unsigned RCD8 : 1;
3917 unsigned OERR1 : 1;
3918 unsigned FERR1 : 1;
3919 unsigned ADEN : 1;
3920 unsigned CREN1 : 1;
3921 unsigned SREN1 : 1;
3922 unsigned RC9 : 1;
3923 unsigned SPEN1 : 1;
3926 struct
3928 unsigned RX9D1 : 1;
3929 unsigned : 1;
3930 unsigned : 1;
3931 unsigned ADDEN1 : 1;
3932 unsigned : 1;
3933 unsigned : 1;
3934 unsigned NOT_RC8 : 1;
3935 unsigned : 1;
3938 struct
3940 unsigned : 1;
3941 unsigned : 1;
3942 unsigned : 1;
3943 unsigned : 1;
3944 unsigned : 1;
3945 unsigned : 1;
3946 unsigned RC8_9 : 1;
3947 unsigned : 1;
3950 struct
3952 unsigned : 1;
3953 unsigned : 1;
3954 unsigned : 1;
3955 unsigned : 1;
3956 unsigned : 1;
3957 unsigned : 1;
3958 unsigned RX91 : 1;
3959 unsigned : 1;
3961 } __RCSTAbits_t;
3963 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3965 #define _RX9D 0x01
3966 #define _RCD8 0x01
3967 #define _RX9D1 0x01
3968 #define _OERR 0x02
3969 #define _OERR1 0x02
3970 #define _FERR 0x04
3971 #define _FERR1 0x04
3972 #define _ADDEN 0x08
3973 #define _ADEN 0x08
3974 #define _ADDEN1 0x08
3975 #define _CREN 0x10
3976 #define _CREN1 0x10
3977 #define _SREN 0x20
3978 #define _SREN1 0x20
3979 #define _RX9 0x40
3980 #define _RC9 0x40
3981 #define _NOT_RC8 0x40
3982 #define _RC8_9 0x40
3983 #define _RX91 0x40
3984 #define _SPEN 0x80
3985 #define _SPEN1 0x80
3987 //==============================================================================
3990 //==============================================================================
3991 // RCSTA1 Bits
3993 extern __at(0x0FAB) __sfr RCSTA1;
3995 typedef union
3997 struct
3999 unsigned RX9D : 1;
4000 unsigned OERR : 1;
4001 unsigned FERR : 1;
4002 unsigned ADDEN : 1;
4003 unsigned CREN : 1;
4004 unsigned SREN : 1;
4005 unsigned RX9 : 1;
4006 unsigned SPEN : 1;
4009 struct
4011 unsigned RCD8 : 1;
4012 unsigned OERR1 : 1;
4013 unsigned FERR1 : 1;
4014 unsigned ADEN : 1;
4015 unsigned CREN1 : 1;
4016 unsigned SREN1 : 1;
4017 unsigned RC9 : 1;
4018 unsigned SPEN1 : 1;
4021 struct
4023 unsigned RX9D1 : 1;
4024 unsigned : 1;
4025 unsigned : 1;
4026 unsigned ADDEN1 : 1;
4027 unsigned : 1;
4028 unsigned : 1;
4029 unsigned NOT_RC8 : 1;
4030 unsigned : 1;
4033 struct
4035 unsigned : 1;
4036 unsigned : 1;
4037 unsigned : 1;
4038 unsigned : 1;
4039 unsigned : 1;
4040 unsigned : 1;
4041 unsigned RC8_9 : 1;
4042 unsigned : 1;
4045 struct
4047 unsigned : 1;
4048 unsigned : 1;
4049 unsigned : 1;
4050 unsigned : 1;
4051 unsigned : 1;
4052 unsigned : 1;
4053 unsigned RX91 : 1;
4054 unsigned : 1;
4056 } __RCSTA1bits_t;
4058 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
4060 #define _RCSTA1_RX9D 0x01
4061 #define _RCSTA1_RCD8 0x01
4062 #define _RCSTA1_RX9D1 0x01
4063 #define _RCSTA1_OERR 0x02
4064 #define _RCSTA1_OERR1 0x02
4065 #define _RCSTA1_FERR 0x04
4066 #define _RCSTA1_FERR1 0x04
4067 #define _RCSTA1_ADDEN 0x08
4068 #define _RCSTA1_ADEN 0x08
4069 #define _RCSTA1_ADDEN1 0x08
4070 #define _RCSTA1_CREN 0x10
4071 #define _RCSTA1_CREN1 0x10
4072 #define _RCSTA1_SREN 0x20
4073 #define _RCSTA1_SREN1 0x20
4074 #define _RCSTA1_RX9 0x40
4075 #define _RCSTA1_RC9 0x40
4076 #define _RCSTA1_NOT_RC8 0x40
4077 #define _RCSTA1_RC8_9 0x40
4078 #define _RCSTA1_RX91 0x40
4079 #define _RCSTA1_SPEN 0x80
4080 #define _RCSTA1_SPEN1 0x80
4082 //==============================================================================
4085 //==============================================================================
4086 // TXSTA Bits
4088 extern __at(0x0FAC) __sfr TXSTA;
4090 typedef union
4092 struct
4094 unsigned TX9D : 1;
4095 unsigned TRMT : 1;
4096 unsigned BRGH : 1;
4097 unsigned SENDB : 1;
4098 unsigned SYNC : 1;
4099 unsigned TXEN : 1;
4100 unsigned TX9 : 1;
4101 unsigned CSRC : 1;
4104 struct
4106 unsigned TXD8 : 1;
4107 unsigned TRMT1 : 1;
4108 unsigned BRGH1 : 1;
4109 unsigned SENDB1 : 1;
4110 unsigned SYNC1 : 1;
4111 unsigned TXEN1 : 1;
4112 unsigned TX8_9 : 1;
4113 unsigned CSRC1 : 1;
4116 struct
4118 unsigned TX9D1 : 1;
4119 unsigned : 1;
4120 unsigned : 1;
4121 unsigned : 1;
4122 unsigned : 1;
4123 unsigned : 1;
4124 unsigned NOT_TX8 : 1;
4125 unsigned : 1;
4128 struct
4130 unsigned : 1;
4131 unsigned : 1;
4132 unsigned : 1;
4133 unsigned : 1;
4134 unsigned : 1;
4135 unsigned : 1;
4136 unsigned TX91 : 1;
4137 unsigned : 1;
4139 } __TXSTAbits_t;
4141 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
4143 #define _TX9D 0x01
4144 #define _TXD8 0x01
4145 #define _TX9D1 0x01
4146 #define _TRMT 0x02
4147 #define _TRMT1 0x02
4148 #define _BRGH 0x04
4149 #define _BRGH1 0x04
4150 #define _SENDB 0x08
4151 #define _SENDB1 0x08
4152 #define _SYNC 0x10
4153 #define _SYNC1 0x10
4154 #define _TXEN 0x20
4155 #define _TXEN1 0x20
4156 #define _TX9 0x40
4157 #define _TX8_9 0x40
4158 #define _NOT_TX8 0x40
4159 #define _TX91 0x40
4160 #define _CSRC 0x80
4161 #define _CSRC1 0x80
4163 //==============================================================================
4166 //==============================================================================
4167 // TXSTA1 Bits
4169 extern __at(0x0FAC) __sfr TXSTA1;
4171 typedef union
4173 struct
4175 unsigned TX9D : 1;
4176 unsigned TRMT : 1;
4177 unsigned BRGH : 1;
4178 unsigned SENDB : 1;
4179 unsigned SYNC : 1;
4180 unsigned TXEN : 1;
4181 unsigned TX9 : 1;
4182 unsigned CSRC : 1;
4185 struct
4187 unsigned TXD8 : 1;
4188 unsigned TRMT1 : 1;
4189 unsigned BRGH1 : 1;
4190 unsigned SENDB1 : 1;
4191 unsigned SYNC1 : 1;
4192 unsigned TXEN1 : 1;
4193 unsigned TX8_9 : 1;
4194 unsigned CSRC1 : 1;
4197 struct
4199 unsigned TX9D1 : 1;
4200 unsigned : 1;
4201 unsigned : 1;
4202 unsigned : 1;
4203 unsigned : 1;
4204 unsigned : 1;
4205 unsigned NOT_TX8 : 1;
4206 unsigned : 1;
4209 struct
4211 unsigned : 1;
4212 unsigned : 1;
4213 unsigned : 1;
4214 unsigned : 1;
4215 unsigned : 1;
4216 unsigned : 1;
4217 unsigned TX91 : 1;
4218 unsigned : 1;
4220 } __TXSTA1bits_t;
4222 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
4224 #define _TXSTA1_TX9D 0x01
4225 #define _TXSTA1_TXD8 0x01
4226 #define _TXSTA1_TX9D1 0x01
4227 #define _TXSTA1_TRMT 0x02
4228 #define _TXSTA1_TRMT1 0x02
4229 #define _TXSTA1_BRGH 0x04
4230 #define _TXSTA1_BRGH1 0x04
4231 #define _TXSTA1_SENDB 0x08
4232 #define _TXSTA1_SENDB1 0x08
4233 #define _TXSTA1_SYNC 0x10
4234 #define _TXSTA1_SYNC1 0x10
4235 #define _TXSTA1_TXEN 0x20
4236 #define _TXSTA1_TXEN1 0x20
4237 #define _TXSTA1_TX9 0x40
4238 #define _TXSTA1_TX8_9 0x40
4239 #define _TXSTA1_NOT_TX8 0x40
4240 #define _TXSTA1_TX91 0x40
4241 #define _TXSTA1_CSRC 0x80
4242 #define _TXSTA1_CSRC1 0x80
4244 //==============================================================================
4246 extern __at(0x0FAD) __sfr TXREG;
4247 extern __at(0x0FAD) __sfr TXREG1;
4248 extern __at(0x0FAE) __sfr RCREG;
4249 extern __at(0x0FAE) __sfr RCREG1;
4250 extern __at(0x0FAF) __sfr SPBRG;
4251 extern __at(0x0FAF) __sfr SPBRG1;
4253 //==============================================================================
4254 // T3CON Bits
4256 extern __at(0x0FB1) __sfr T3CON;
4258 typedef union
4260 struct
4262 unsigned TMR3ON : 1;
4263 unsigned TMR3CS : 1;
4264 unsigned NOT_T3SYNC : 1;
4265 unsigned T3CCP1 : 1;
4266 unsigned T3CKPS0 : 1;
4267 unsigned T3CKPS1 : 1;
4268 unsigned T3CCP2 : 1;
4269 unsigned RD16 : 1;
4272 struct
4274 unsigned : 1;
4275 unsigned : 1;
4276 unsigned T3SYNC : 1;
4277 unsigned : 1;
4278 unsigned : 1;
4279 unsigned : 1;
4280 unsigned : 1;
4281 unsigned T3RD16 : 1;
4284 struct
4286 unsigned : 1;
4287 unsigned : 1;
4288 unsigned T3INSYNC : 1;
4289 unsigned : 1;
4290 unsigned : 1;
4291 unsigned : 1;
4292 unsigned : 1;
4293 unsigned : 1;
4296 struct
4298 unsigned : 4;
4299 unsigned T3CKPS : 2;
4300 unsigned : 2;
4302 } __T3CONbits_t;
4304 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
4306 #define _T3CON_TMR3ON 0x01
4307 #define _T3CON_TMR3CS 0x02
4308 #define _T3CON_NOT_T3SYNC 0x04
4309 #define _T3CON_T3SYNC 0x04
4310 #define _T3CON_T3INSYNC 0x04
4311 #define _T3CON_T3CCP1 0x08
4312 #define _T3CON_T3CKPS0 0x10
4313 #define _T3CON_T3CKPS1 0x20
4314 #define _T3CON_T3CCP2 0x40
4315 #define _T3CON_RD16 0x80
4316 #define _T3CON_T3RD16 0x80
4318 //==============================================================================
4320 extern __at(0x0FB2) __sfr TMR3;
4321 extern __at(0x0FB2) __sfr TMR3L;
4322 extern __at(0x0FB3) __sfr TMR3H;
4324 //==============================================================================
4325 // CMCON Bits
4327 extern __at(0x0FB4) __sfr CMCON;
4329 typedef union
4331 struct
4333 unsigned CM0 : 1;
4334 unsigned CM1 : 1;
4335 unsigned CM2 : 1;
4336 unsigned CIS : 1;
4337 unsigned C1INV : 1;
4338 unsigned C2INV : 1;
4339 unsigned C1OUT : 1;
4340 unsigned C2OUT : 1;
4343 struct
4345 unsigned CM : 3;
4346 unsigned : 5;
4348 } __CMCONbits_t;
4350 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
4352 #define _CM0 0x01
4353 #define _CM1 0x02
4354 #define _CM2 0x04
4355 #define _CIS 0x08
4356 #define _C1INV 0x10
4357 #define _C2INV 0x20
4358 #define _C1OUT 0x40
4359 #define _C2OUT 0x80
4361 //==============================================================================
4364 //==============================================================================
4365 // CVRCON Bits
4367 extern __at(0x0FB5) __sfr CVRCON;
4369 typedef union
4371 struct
4373 unsigned CVR0 : 1;
4374 unsigned CVR1 : 1;
4375 unsigned CVR2 : 1;
4376 unsigned CVR3 : 1;
4377 unsigned CVRSS : 1;
4378 unsigned CVRR : 1;
4379 unsigned CVROE : 1;
4380 unsigned CVREN : 1;
4383 struct
4385 unsigned CVR : 4;
4386 unsigned : 4;
4388 } __CVRCONbits_t;
4390 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
4392 #define _CVR0 0x01
4393 #define _CVR1 0x02
4394 #define _CVR2 0x04
4395 #define _CVR3 0x08
4396 #define _CVRSS 0x10
4397 #define _CVRR 0x20
4398 #define _CVROE 0x40
4399 #define _CVREN 0x80
4401 //==============================================================================
4404 //==============================================================================
4405 // LCDSE1 Bits
4407 extern __at(0x0FB6) __sfr LCDSE1;
4409 typedef union
4411 struct
4413 unsigned SE8 : 1;
4414 unsigned SE9 : 1;
4415 unsigned SE10 : 1;
4416 unsigned SE11 : 1;
4417 unsigned SE12 : 1;
4418 unsigned SE13 : 1;
4419 unsigned SE14 : 1;
4420 unsigned SE15 : 1;
4423 struct
4425 unsigned SEGEN8 : 1;
4426 unsigned SEGEN9 : 1;
4427 unsigned SEGEN10 : 1;
4428 unsigned SEGEN11 : 1;
4429 unsigned SEGEN12 : 1;
4430 unsigned SEGEN13 : 1;
4431 unsigned SEGEN14 : 1;
4432 unsigned SEGEN15 : 1;
4435 struct
4437 unsigned SE08 : 1;
4438 unsigned SE09 : 1;
4439 unsigned : 1;
4440 unsigned : 1;
4441 unsigned : 1;
4442 unsigned : 1;
4443 unsigned : 1;
4444 unsigned : 1;
4446 } __LCDSE1bits_t;
4448 extern __at(0x0FB6) volatile __LCDSE1bits_t LCDSE1bits;
4450 #define _SE8 0x01
4451 #define _SEGEN8 0x01
4452 #define _SE08 0x01
4453 #define _SE9 0x02
4454 #define _SEGEN9 0x02
4455 #define _SE09 0x02
4456 #define _SE10 0x04
4457 #define _SEGEN10 0x04
4458 #define _SE11 0x08
4459 #define _SEGEN11 0x08
4460 #define _SE12 0x10
4461 #define _SEGEN12 0x10
4462 #define _SE13 0x20
4463 #define _SEGEN13 0x20
4464 #define _SE14 0x40
4465 #define _SEGEN14 0x40
4466 #define _SE15 0x80
4467 #define _SEGEN15 0x80
4469 //==============================================================================
4472 //==============================================================================
4473 // LCDSE2 Bits
4475 extern __at(0x0FB7) __sfr LCDSE2;
4477 typedef union
4479 struct
4481 unsigned SE16 : 1;
4482 unsigned SE17 : 1;
4483 unsigned SE18 : 1;
4484 unsigned SE19 : 1;
4485 unsigned SE20 : 1;
4486 unsigned SE21 : 1;
4487 unsigned SE22 : 1;
4488 unsigned SE23 : 1;
4491 struct
4493 unsigned SEGEN16 : 1;
4494 unsigned SEGEN17 : 1;
4495 unsigned SEGEN18 : 1;
4496 unsigned SEGEN19 : 1;
4497 unsigned SEGEN20 : 1;
4498 unsigned SEGEN21 : 1;
4499 unsigned SEGEN22 : 1;
4500 unsigned SEGEN23 : 1;
4502 } __LCDSE2bits_t;
4504 extern __at(0x0FB7) volatile __LCDSE2bits_t LCDSE2bits;
4506 #define _SE16 0x01
4507 #define _SEGEN16 0x01
4508 #define _SE17 0x02
4509 #define _SEGEN17 0x02
4510 #define _SE18 0x04
4511 #define _SEGEN18 0x04
4512 #define _SE19 0x08
4513 #define _SEGEN19 0x08
4514 #define _SE20 0x10
4515 #define _SEGEN20 0x10
4516 #define _SE21 0x20
4517 #define _SEGEN21 0x20
4518 #define _SE22 0x40
4519 #define _SEGEN22 0x40
4520 #define _SE23 0x80
4521 #define _SEGEN23 0x80
4523 //==============================================================================
4526 //==============================================================================
4527 // LCDSE3 Bits
4529 extern __at(0x0FB8) __sfr LCDSE3;
4531 typedef union
4533 struct
4535 unsigned SE24 : 1;
4536 unsigned SE25 : 1;
4537 unsigned SE26 : 1;
4538 unsigned SE27 : 1;
4539 unsigned SE28 : 1;
4540 unsigned SE29 : 1;
4541 unsigned SE30 : 1;
4542 unsigned SE31 : 1;
4545 struct
4547 unsigned SEGEN24 : 1;
4548 unsigned SEGEN25 : 1;
4549 unsigned SEGEN26 : 1;
4550 unsigned SEGEN27 : 1;
4551 unsigned SEGEN28 : 1;
4552 unsigned SEGEN29 : 1;
4553 unsigned SEGEN30 : 1;
4554 unsigned SEGEN31 : 1;
4556 } __LCDSE3bits_t;
4558 extern __at(0x0FB8) volatile __LCDSE3bits_t LCDSE3bits;
4560 #define _SE24 0x01
4561 #define _SEGEN24 0x01
4562 #define _SE25 0x02
4563 #define _SEGEN25 0x02
4564 #define _SE26 0x04
4565 #define _SEGEN26 0x04
4566 #define _SE27 0x08
4567 #define _SEGEN27 0x08
4568 #define _SE28 0x10
4569 #define _SEGEN28 0x10
4570 #define _SE29 0x20
4571 #define _SEGEN29 0x20
4572 #define _SE30 0x40
4573 #define _SEGEN30 0x40
4574 #define _SE31 0x80
4575 #define _SEGEN31 0x80
4577 //==============================================================================
4580 //==============================================================================
4581 // LCDSE4 Bits
4583 extern __at(0x0FB9) __sfr LCDSE4;
4585 typedef union
4587 struct
4589 unsigned SE32 : 1;
4590 unsigned SE33 : 1;
4591 unsigned SE34 : 1;
4592 unsigned SE35 : 1;
4593 unsigned SE36 : 1;
4594 unsigned SE37 : 1;
4595 unsigned SE38 : 1;
4596 unsigned SE39 : 1;
4599 struct
4601 unsigned SEGEN32 : 1;
4602 unsigned SEGEN33 : 1;
4603 unsigned SEGEN34 : 1;
4604 unsigned SEGEN35 : 1;
4605 unsigned SEGEN36 : 1;
4606 unsigned SEGEN37 : 1;
4607 unsigned SEGEN38 : 1;
4608 unsigned SEGEN39 : 1;
4610 } __LCDSE4bits_t;
4612 extern __at(0x0FB9) volatile __LCDSE4bits_t LCDSE4bits;
4614 #define _SE32 0x01
4615 #define _SEGEN32 0x01
4616 #define _SE33 0x02
4617 #define _SEGEN33 0x02
4618 #define _SE34 0x04
4619 #define _SEGEN34 0x04
4620 #define _SE35 0x08
4621 #define _SEGEN35 0x08
4622 #define _SE36 0x10
4623 #define _SEGEN36 0x10
4624 #define _SE37 0x20
4625 #define _SEGEN37 0x20
4626 #define _SE38 0x40
4627 #define _SEGEN38 0x40
4628 #define _SE39 0x80
4629 #define _SEGEN39 0x80
4631 //==============================================================================
4634 //==============================================================================
4635 // LCDSE5 Bits
4637 extern __at(0x0FBA) __sfr LCDSE5;
4639 typedef union
4641 struct
4643 unsigned SE40 : 1;
4644 unsigned SE41 : 1;
4645 unsigned SE42 : 1;
4646 unsigned SE43 : 1;
4647 unsigned SE44 : 1;
4648 unsigned SE45 : 1;
4649 unsigned SE46 : 1;
4650 unsigned SE47 : 1;
4653 struct
4655 unsigned SEGEN40 : 1;
4656 unsigned SEGEN41 : 1;
4657 unsigned SEGEN42 : 1;
4658 unsigned SEGEN43 : 1;
4659 unsigned SEGEN44 : 1;
4660 unsigned SEGEN45 : 1;
4661 unsigned SEGEN46 : 1;
4662 unsigned SEGEN47 : 1;
4664 } __LCDSE5bits_t;
4666 extern __at(0x0FBA) volatile __LCDSE5bits_t LCDSE5bits;
4668 #define _SE40 0x01
4669 #define _SEGEN40 0x01
4670 #define _SE41 0x02
4671 #define _SEGEN41 0x02
4672 #define _SE42 0x04
4673 #define _SEGEN42 0x04
4674 #define _SE43 0x08
4675 #define _SEGEN43 0x08
4676 #define _SE44 0x10
4677 #define _SEGEN44 0x10
4678 #define _SE45 0x20
4679 #define _SEGEN45 0x20
4680 #define _SE46 0x40
4681 #define _SEGEN46 0x40
4682 #define _SE47 0x80
4683 #define _SEGEN47 0x80
4685 //==============================================================================
4688 //==============================================================================
4689 // LCDDATA0 Bits
4691 extern __at(0x0FBB) __sfr LCDDATA0;
4693 typedef union
4695 struct
4697 unsigned S0C0 : 1;
4698 unsigned S1C0 : 1;
4699 unsigned S2C0 : 1;
4700 unsigned S3C0 : 1;
4701 unsigned S4C0 : 1;
4702 unsigned S5C0 : 1;
4703 unsigned S6C0 : 1;
4704 unsigned S7C0 : 1;
4707 struct
4709 unsigned SEG0COM0 : 1;
4710 unsigned SEG1COM0 : 1;
4711 unsigned SEG2COM0 : 1;
4712 unsigned SEG3COM0 : 1;
4713 unsigned SEG4COM0 : 1;
4714 unsigned SEG5COM0 : 1;
4715 unsigned SEG6COM0 : 1;
4716 unsigned SEG7COM0 : 1;
4719 struct
4721 unsigned S00C0 : 1;
4722 unsigned S01C0 : 1;
4723 unsigned S02C0 : 1;
4724 unsigned S03C0 : 1;
4725 unsigned S04C0 : 1;
4726 unsigned S05C0 : 1;
4727 unsigned S06C0 : 1;
4728 unsigned S07C0 : 1;
4730 } __LCDDATA0bits_t;
4732 extern __at(0x0FBB) volatile __LCDDATA0bits_t LCDDATA0bits;
4734 #define _S0C0 0x01
4735 #define _SEG0COM0 0x01
4736 #define _S00C0 0x01
4737 #define _S1C0 0x02
4738 #define _SEG1COM0 0x02
4739 #define _S01C0 0x02
4740 #define _S2C0 0x04
4741 #define _SEG2COM0 0x04
4742 #define _S02C0 0x04
4743 #define _S3C0 0x08
4744 #define _SEG3COM0 0x08
4745 #define _S03C0 0x08
4746 #define _S4C0 0x10
4747 #define _SEG4COM0 0x10
4748 #define _S04C0 0x10
4749 #define _S5C0 0x20
4750 #define _SEG5COM0 0x20
4751 #define _S05C0 0x20
4752 #define _S6C0 0x40
4753 #define _SEG6COM0 0x40
4754 #define _S06C0 0x40
4755 #define _S7C0 0x80
4756 #define _SEG7COM0 0x80
4757 #define _S07C0 0x80
4759 //==============================================================================
4762 //==============================================================================
4763 // LCDDATA1 Bits
4765 extern __at(0x0FBC) __sfr LCDDATA1;
4767 typedef union
4769 struct
4771 unsigned S8C0 : 1;
4772 unsigned S9C0 : 1;
4773 unsigned S10C0 : 1;
4774 unsigned S11C0 : 1;
4775 unsigned S12C0 : 1;
4776 unsigned S13C0 : 1;
4777 unsigned S14C0 : 1;
4778 unsigned S15C0 : 1;
4781 struct
4783 unsigned SEG8COM0 : 1;
4784 unsigned SEG9COM0 : 1;
4785 unsigned SEG10COM0 : 1;
4786 unsigned SEG11COM0 : 1;
4787 unsigned SEG12COM0 : 1;
4788 unsigned SEG13COM0 : 1;
4789 unsigned SEG14COM0 : 1;
4790 unsigned SEG15COM0 : 1;
4793 struct
4795 unsigned S08C0 : 1;
4796 unsigned S09C0 : 1;
4797 unsigned : 1;
4798 unsigned : 1;
4799 unsigned : 1;
4800 unsigned : 1;
4801 unsigned : 1;
4802 unsigned : 1;
4804 } __LCDDATA1bits_t;
4806 extern __at(0x0FBC) volatile __LCDDATA1bits_t LCDDATA1bits;
4808 #define _S8C0 0x01
4809 #define _SEG8COM0 0x01
4810 #define _S08C0 0x01
4811 #define _S9C0 0x02
4812 #define _SEG9COM0 0x02
4813 #define _S09C0 0x02
4814 #define _S10C0 0x04
4815 #define _SEG10COM0 0x04
4816 #define _S11C0 0x08
4817 #define _SEG11COM0 0x08
4818 #define _S12C0 0x10
4819 #define _SEG12COM0 0x10
4820 #define _S13C0 0x20
4821 #define _SEG13COM0 0x20
4822 #define _S14C0 0x40
4823 #define _SEG14COM0 0x40
4824 #define _S15C0 0x80
4825 #define _SEG15COM0 0x80
4827 //==============================================================================
4830 //==============================================================================
4831 // LCDDATA2 Bits
4833 extern __at(0x0FBD) __sfr LCDDATA2;
4835 typedef union
4837 struct
4839 unsigned S16C0 : 1;
4840 unsigned S17C0 : 1;
4841 unsigned S18C0 : 1;
4842 unsigned S19C0 : 1;
4843 unsigned S20C0 : 1;
4844 unsigned S21C0 : 1;
4845 unsigned S22C0 : 1;
4846 unsigned S23C0 : 1;
4849 struct
4851 unsigned SEG16COM0 : 1;
4852 unsigned SEG17COM0 : 1;
4853 unsigned SEG18COM0 : 1;
4854 unsigned SEG19COM0 : 1;
4855 unsigned SEG20COM0 : 1;
4856 unsigned SEG21COM0 : 1;
4857 unsigned SEG22COM0 : 1;
4858 unsigned SEG23COM0 : 1;
4860 } __LCDDATA2bits_t;
4862 extern __at(0x0FBD) volatile __LCDDATA2bits_t LCDDATA2bits;
4864 #define _S16C0 0x01
4865 #define _SEG16COM0 0x01
4866 #define _S17C0 0x02
4867 #define _SEG17COM0 0x02
4868 #define _S18C0 0x04
4869 #define _SEG18COM0 0x04
4870 #define _S19C0 0x08
4871 #define _SEG19COM0 0x08
4872 #define _S20C0 0x10
4873 #define _SEG20COM0 0x10
4874 #define _S21C0 0x20
4875 #define _SEG21COM0 0x20
4876 #define _S22C0 0x40
4877 #define _SEG22COM0 0x40
4878 #define _S23C0 0x80
4879 #define _SEG23COM0 0x80
4881 //==============================================================================
4884 //==============================================================================
4885 // LCDDATA3 Bits
4887 extern __at(0x0FBE) __sfr LCDDATA3;
4889 typedef union
4891 struct
4893 unsigned S24C0 : 1;
4894 unsigned S25C0 : 1;
4895 unsigned S26C0 : 1;
4896 unsigned S27C0 : 1;
4897 unsigned S28C0 : 1;
4898 unsigned S29C0 : 1;
4899 unsigned S30C0 : 1;
4900 unsigned S31C0 : 1;
4903 struct
4905 unsigned SEG24COM0 : 1;
4906 unsigned SEG25COM0 : 1;
4907 unsigned SEG26COM0 : 1;
4908 unsigned SEG27COM0 : 1;
4909 unsigned SEG28COM0 : 1;
4910 unsigned SEG29COM0 : 1;
4911 unsigned SEG30COM0 : 1;
4912 unsigned SEG31COM0 : 1;
4914 } __LCDDATA3bits_t;
4916 extern __at(0x0FBE) volatile __LCDDATA3bits_t LCDDATA3bits;
4918 #define _S24C0 0x01
4919 #define _SEG24COM0 0x01
4920 #define _S25C0 0x02
4921 #define _SEG25COM0 0x02
4922 #define _S26C0 0x04
4923 #define _SEG26COM0 0x04
4924 #define _S27C0 0x08
4925 #define _SEG27COM0 0x08
4926 #define _S28C0 0x10
4927 #define _SEG28COM0 0x10
4928 #define _S29C0 0x20
4929 #define _SEG29COM0 0x20
4930 #define _S30C0 0x40
4931 #define _SEG30COM0 0x40
4932 #define _S31C0 0x80
4933 #define _SEG31COM0 0x80
4935 //==============================================================================
4938 //==============================================================================
4939 // LCDDATA4 Bits
4941 extern __at(0x0FBF) __sfr LCDDATA4;
4943 typedef union
4945 struct
4947 unsigned S32C0 : 1;
4948 unsigned S33C0 : 1;
4949 unsigned S34C0 : 1;
4950 unsigned S35C0 : 1;
4951 unsigned S36C0 : 1;
4952 unsigned S37C0 : 1;
4953 unsigned S38C0 : 1;
4954 unsigned S39C0 : 1;
4957 struct
4959 unsigned SEG32COM0 : 1;
4960 unsigned SEG33COM0 : 1;
4961 unsigned SEG34COM0 : 1;
4962 unsigned SEG35COM0 : 1;
4963 unsigned SEG36COM0 : 1;
4964 unsigned SEG37COM0 : 1;
4965 unsigned SEG38COM0 : 1;
4966 unsigned SEG39COM0 : 1;
4968 } __LCDDATA4bits_t;
4970 extern __at(0x0FBF) volatile __LCDDATA4bits_t LCDDATA4bits;
4972 #define _S32C0 0x01
4973 #define _SEG32COM0 0x01
4974 #define _S33C0 0x02
4975 #define _SEG33COM0 0x02
4976 #define _S34C0 0x04
4977 #define _SEG34COM0 0x04
4978 #define _S35C0 0x08
4979 #define _SEG35COM0 0x08
4980 #define _S36C0 0x10
4981 #define _SEG36COM0 0x10
4982 #define _S37C0 0x20
4983 #define _SEG37COM0 0x20
4984 #define _S38C0 0x40
4985 #define _SEG38COM0 0x40
4986 #define _S39C0 0x80
4987 #define _SEG39COM0 0x80
4989 //==============================================================================
4992 //==============================================================================
4993 // ADCON2 Bits
4995 extern __at(0x0FC0) __sfr ADCON2;
4997 typedef union
4999 struct
5001 unsigned ADCS0 : 1;
5002 unsigned ADCS1 : 1;
5003 unsigned ADCS2 : 1;
5004 unsigned ACQT0 : 1;
5005 unsigned ACQT1 : 1;
5006 unsigned ACQT2 : 1;
5007 unsigned : 1;
5008 unsigned ADFM : 1;
5011 struct
5013 unsigned ADCS : 3;
5014 unsigned : 5;
5017 struct
5019 unsigned : 3;
5020 unsigned ACQT : 3;
5021 unsigned : 2;
5023 } __ADCON2bits_t;
5025 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
5027 #define _ADCS0 0x01
5028 #define _ADCS1 0x02
5029 #define _ADCS2 0x04
5030 #define _ACQT0 0x08
5031 #define _ACQT1 0x10
5032 #define _ACQT2 0x20
5033 #define _ADFM 0x80
5035 //==============================================================================
5038 //==============================================================================
5039 // ADCON1 Bits
5041 extern __at(0x0FC1) __sfr ADCON1;
5043 typedef union
5045 struct
5047 unsigned PCFG0 : 1;
5048 unsigned PCFG1 : 1;
5049 unsigned PCFG2 : 1;
5050 unsigned PCFG3 : 1;
5051 unsigned VCFG0 : 1;
5052 unsigned VCFG1 : 1;
5053 unsigned : 1;
5054 unsigned TRIGSEL : 1;
5057 struct
5059 unsigned PCFG : 4;
5060 unsigned : 4;
5063 struct
5065 unsigned : 4;
5066 unsigned VCFG : 2;
5067 unsigned : 2;
5069 } __ADCON1bits_t;
5071 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5073 #define _PCFG0 0x01
5074 #define _PCFG1 0x02
5075 #define _PCFG2 0x04
5076 #define _PCFG3 0x08
5077 #define _VCFG0 0x10
5078 #define _VCFG1 0x20
5079 #define _TRIGSEL 0x80
5081 //==============================================================================
5084 //==============================================================================
5085 // ADCON0 Bits
5087 extern __at(0x0FC2) __sfr ADCON0;
5089 typedef union
5091 struct
5093 unsigned ADON : 1;
5094 unsigned GO_NOT_DONE : 1;
5095 unsigned CHS0 : 1;
5096 unsigned CHS1 : 1;
5097 unsigned CHS2 : 1;
5098 unsigned CHS3 : 1;
5099 unsigned : 1;
5100 unsigned ADCAL : 1;
5103 struct
5105 unsigned : 1;
5106 unsigned GO_DONE : 1;
5107 unsigned : 1;
5108 unsigned : 1;
5109 unsigned : 1;
5110 unsigned : 1;
5111 unsigned : 1;
5112 unsigned : 1;
5115 struct
5117 unsigned : 1;
5118 unsigned DONE : 1;
5119 unsigned : 1;
5120 unsigned : 1;
5121 unsigned : 1;
5122 unsigned : 1;
5123 unsigned : 1;
5124 unsigned : 1;
5127 struct
5129 unsigned : 1;
5130 unsigned GO : 1;
5131 unsigned : 1;
5132 unsigned : 1;
5133 unsigned : 1;
5134 unsigned : 1;
5135 unsigned : 1;
5136 unsigned : 1;
5139 struct
5141 unsigned : 1;
5142 unsigned NOT_DONE : 1;
5143 unsigned : 1;
5144 unsigned : 1;
5145 unsigned : 1;
5146 unsigned : 1;
5147 unsigned : 1;
5148 unsigned : 1;
5151 struct
5153 unsigned : 2;
5154 unsigned CHS : 4;
5155 unsigned : 2;
5157 } __ADCON0bits_t;
5159 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5161 #define _ADON 0x01
5162 #define _GO_NOT_DONE 0x02
5163 #define _GO_DONE 0x02
5164 #define _DONE 0x02
5165 #define _GO 0x02
5166 #define _NOT_DONE 0x02
5167 #define _CHS0 0x04
5168 #define _CHS1 0x08
5169 #define _CHS2 0x10
5170 #define _CHS3 0x20
5171 #define _ADCAL 0x80
5173 //==============================================================================
5175 extern __at(0x0FC3) __sfr ADRES;
5176 extern __at(0x0FC3) __sfr ADRESL;
5177 extern __at(0x0FC4) __sfr ADRESH;
5179 //==============================================================================
5180 // SSP1CON2 Bits
5182 extern __at(0x0FC5) __sfr SSP1CON2;
5184 typedef union
5186 struct
5188 unsigned SEN : 1;
5189 unsigned RSEN : 1;
5190 unsigned PEN : 1;
5191 unsigned RCEN : 1;
5192 unsigned ACKEN : 1;
5193 unsigned ACKDT : 1;
5194 unsigned ACKSTAT : 1;
5195 unsigned GCEN : 1;
5198 struct
5200 unsigned : 1;
5201 unsigned ADMSK1 : 1;
5202 unsigned ADMSK2 : 1;
5203 unsigned ADMSK3 : 1;
5204 unsigned ADMSK4 : 1;
5205 unsigned ADMSK5 : 1;
5206 unsigned : 1;
5207 unsigned : 1;
5209 } __SSP1CON2bits_t;
5211 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5213 #define _SEN 0x01
5214 #define _RSEN 0x02
5215 #define _ADMSK1 0x02
5216 #define _PEN 0x04
5217 #define _ADMSK2 0x04
5218 #define _RCEN 0x08
5219 #define _ADMSK3 0x08
5220 #define _ACKEN 0x10
5221 #define _ADMSK4 0x10
5222 #define _ACKDT 0x20
5223 #define _ADMSK5 0x20
5224 #define _ACKSTAT 0x40
5225 #define _GCEN 0x80
5227 //==============================================================================
5230 //==============================================================================
5231 // SSPCON2 Bits
5233 extern __at(0x0FC5) __sfr SSPCON2;
5235 typedef union
5237 struct
5239 unsigned SEN : 1;
5240 unsigned RSEN : 1;
5241 unsigned PEN : 1;
5242 unsigned RCEN : 1;
5243 unsigned ACKEN : 1;
5244 unsigned ACKDT : 1;
5245 unsigned ACKSTAT : 1;
5246 unsigned GCEN : 1;
5249 struct
5251 unsigned : 1;
5252 unsigned ADMSK1 : 1;
5253 unsigned ADMSK2 : 1;
5254 unsigned ADMSK3 : 1;
5255 unsigned ADMSK4 : 1;
5256 unsigned ADMSK5 : 1;
5257 unsigned : 1;
5258 unsigned : 1;
5260 } __SSPCON2bits_t;
5262 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5264 #define _SSPCON2_SEN 0x01
5265 #define _SSPCON2_RSEN 0x02
5266 #define _SSPCON2_ADMSK1 0x02
5267 #define _SSPCON2_PEN 0x04
5268 #define _SSPCON2_ADMSK2 0x04
5269 #define _SSPCON2_RCEN 0x08
5270 #define _SSPCON2_ADMSK3 0x08
5271 #define _SSPCON2_ACKEN 0x10
5272 #define _SSPCON2_ADMSK4 0x10
5273 #define _SSPCON2_ACKDT 0x20
5274 #define _SSPCON2_ADMSK5 0x20
5275 #define _SSPCON2_ACKSTAT 0x40
5276 #define _SSPCON2_GCEN 0x80
5278 //==============================================================================
5281 //==============================================================================
5282 // SSP1CON1 Bits
5284 extern __at(0x0FC6) __sfr SSP1CON1;
5286 typedef union
5288 struct
5290 unsigned SSPM0 : 1;
5291 unsigned SSPM1 : 1;
5292 unsigned SSPM2 : 1;
5293 unsigned SSPM3 : 1;
5294 unsigned CKP : 1;
5295 unsigned SSPEN : 1;
5296 unsigned SSPOV : 1;
5297 unsigned WCOL : 1;
5300 struct
5302 unsigned SSPM : 4;
5303 unsigned : 4;
5305 } __SSP1CON1bits_t;
5307 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5309 #define _SSPM0 0x01
5310 #define _SSPM1 0x02
5311 #define _SSPM2 0x04
5312 #define _SSPM3 0x08
5313 #define _CKP 0x10
5314 #define _SSPEN 0x20
5315 #define _SSPOV 0x40
5316 #define _WCOL 0x80
5318 //==============================================================================
5321 //==============================================================================
5322 // SSPCON1 Bits
5324 extern __at(0x0FC6) __sfr SSPCON1;
5326 typedef union
5328 struct
5330 unsigned SSPM0 : 1;
5331 unsigned SSPM1 : 1;
5332 unsigned SSPM2 : 1;
5333 unsigned SSPM3 : 1;
5334 unsigned CKP : 1;
5335 unsigned SSPEN : 1;
5336 unsigned SSPOV : 1;
5337 unsigned WCOL : 1;
5340 struct
5342 unsigned SSPM : 4;
5343 unsigned : 4;
5345 } __SSPCON1bits_t;
5347 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5349 #define _SSPCON1_SSPM0 0x01
5350 #define _SSPCON1_SSPM1 0x02
5351 #define _SSPCON1_SSPM2 0x04
5352 #define _SSPCON1_SSPM3 0x08
5353 #define _SSPCON1_CKP 0x10
5354 #define _SSPCON1_SSPEN 0x20
5355 #define _SSPCON1_SSPOV 0x40
5356 #define _SSPCON1_WCOL 0x80
5358 //==============================================================================
5361 //==============================================================================
5362 // SSP1STAT Bits
5364 extern __at(0x0FC7) __sfr SSP1STAT;
5366 typedef union
5368 struct
5370 unsigned BF : 1;
5371 unsigned UA : 1;
5372 unsigned R_NOT_W : 1;
5373 unsigned S : 1;
5374 unsigned P : 1;
5375 unsigned D_NOT_A : 1;
5376 unsigned CKE : 1;
5377 unsigned SMP : 1;
5380 struct
5382 unsigned : 1;
5383 unsigned : 1;
5384 unsigned R : 1;
5385 unsigned I2C_START : 1;
5386 unsigned I2C_STOP : 1;
5387 unsigned D : 1;
5388 unsigned : 1;
5389 unsigned : 1;
5392 struct
5394 unsigned : 1;
5395 unsigned : 1;
5396 unsigned R_W : 1;
5397 unsigned : 1;
5398 unsigned : 1;
5399 unsigned D_A : 1;
5400 unsigned : 1;
5401 unsigned : 1;
5404 struct
5406 unsigned : 1;
5407 unsigned : 1;
5408 unsigned NOT_W : 1;
5409 unsigned : 1;
5410 unsigned : 1;
5411 unsigned NOT_A : 1;
5412 unsigned : 1;
5413 unsigned : 1;
5416 struct
5418 unsigned : 1;
5419 unsigned : 1;
5420 unsigned NOT_WRITE : 1;
5421 unsigned : 1;
5422 unsigned : 1;
5423 unsigned NOT_ADDRESS : 1;
5424 unsigned : 1;
5425 unsigned : 1;
5428 struct
5430 unsigned : 1;
5431 unsigned : 1;
5432 unsigned READ_WRITE : 1;
5433 unsigned : 1;
5434 unsigned : 1;
5435 unsigned DATA_ADDRESS : 1;
5436 unsigned : 1;
5437 unsigned : 1;
5440 struct
5442 unsigned : 1;
5443 unsigned : 1;
5444 unsigned I2C_READ : 1;
5445 unsigned : 1;
5446 unsigned : 1;
5447 unsigned I2C_DAT : 1;
5448 unsigned : 1;
5449 unsigned : 1;
5451 } __SSP1STATbits_t;
5453 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5455 #define _BF 0x01
5456 #define _UA 0x02
5457 #define _R_NOT_W 0x04
5458 #define _R 0x04
5459 #define _R_W 0x04
5460 #define _NOT_W 0x04
5461 #define _NOT_WRITE 0x04
5462 #define _READ_WRITE 0x04
5463 #define _I2C_READ 0x04
5464 #define _S 0x08
5465 #define _I2C_START 0x08
5466 #define _P 0x10
5467 #define _I2C_STOP 0x10
5468 #define _D_NOT_A 0x20
5469 #define _D 0x20
5470 #define _D_A 0x20
5471 #define _NOT_A 0x20
5472 #define _NOT_ADDRESS 0x20
5473 #define _DATA_ADDRESS 0x20
5474 #define _I2C_DAT 0x20
5475 #define _CKE 0x40
5476 #define _SMP 0x80
5478 //==============================================================================
5481 //==============================================================================
5482 // SSPSTAT Bits
5484 extern __at(0x0FC7) __sfr SSPSTAT;
5486 typedef union
5488 struct
5490 unsigned BF : 1;
5491 unsigned UA : 1;
5492 unsigned R_NOT_W : 1;
5493 unsigned S : 1;
5494 unsigned P : 1;
5495 unsigned D_NOT_A : 1;
5496 unsigned CKE : 1;
5497 unsigned SMP : 1;
5500 struct
5502 unsigned : 1;
5503 unsigned : 1;
5504 unsigned R : 1;
5505 unsigned I2C_START : 1;
5506 unsigned I2C_STOP : 1;
5507 unsigned D : 1;
5508 unsigned : 1;
5509 unsigned : 1;
5512 struct
5514 unsigned : 1;
5515 unsigned : 1;
5516 unsigned R_W : 1;
5517 unsigned : 1;
5518 unsigned : 1;
5519 unsigned D_A : 1;
5520 unsigned : 1;
5521 unsigned : 1;
5524 struct
5526 unsigned : 1;
5527 unsigned : 1;
5528 unsigned NOT_W : 1;
5529 unsigned : 1;
5530 unsigned : 1;
5531 unsigned NOT_A : 1;
5532 unsigned : 1;
5533 unsigned : 1;
5536 struct
5538 unsigned : 1;
5539 unsigned : 1;
5540 unsigned NOT_WRITE : 1;
5541 unsigned : 1;
5542 unsigned : 1;
5543 unsigned NOT_ADDRESS : 1;
5544 unsigned : 1;
5545 unsigned : 1;
5548 struct
5550 unsigned : 1;
5551 unsigned : 1;
5552 unsigned READ_WRITE : 1;
5553 unsigned : 1;
5554 unsigned : 1;
5555 unsigned DATA_ADDRESS : 1;
5556 unsigned : 1;
5557 unsigned : 1;
5560 struct
5562 unsigned : 1;
5563 unsigned : 1;
5564 unsigned I2C_READ : 1;
5565 unsigned : 1;
5566 unsigned : 1;
5567 unsigned I2C_DAT : 1;
5568 unsigned : 1;
5569 unsigned : 1;
5571 } __SSPSTATbits_t;
5573 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5575 #define _SSPSTAT_BF 0x01
5576 #define _SSPSTAT_UA 0x02
5577 #define _SSPSTAT_R_NOT_W 0x04
5578 #define _SSPSTAT_R 0x04
5579 #define _SSPSTAT_R_W 0x04
5580 #define _SSPSTAT_NOT_W 0x04
5581 #define _SSPSTAT_NOT_WRITE 0x04
5582 #define _SSPSTAT_READ_WRITE 0x04
5583 #define _SSPSTAT_I2C_READ 0x04
5584 #define _SSPSTAT_S 0x08
5585 #define _SSPSTAT_I2C_START 0x08
5586 #define _SSPSTAT_P 0x10
5587 #define _SSPSTAT_I2C_STOP 0x10
5588 #define _SSPSTAT_D_NOT_A 0x20
5589 #define _SSPSTAT_D 0x20
5590 #define _SSPSTAT_D_A 0x20
5591 #define _SSPSTAT_NOT_A 0x20
5592 #define _SSPSTAT_NOT_ADDRESS 0x20
5593 #define _SSPSTAT_DATA_ADDRESS 0x20
5594 #define _SSPSTAT_I2C_DAT 0x20
5595 #define _SSPSTAT_CKE 0x40
5596 #define _SSPSTAT_SMP 0x80
5598 //==============================================================================
5601 //==============================================================================
5602 // SSP1ADD Bits
5604 extern __at(0x0FC8) __sfr SSP1ADD;
5606 typedef struct
5608 unsigned MSK0 : 1;
5609 unsigned MSK1 : 1;
5610 unsigned MSK2 : 1;
5611 unsigned MSK3 : 1;
5612 unsigned MSK4 : 1;
5613 unsigned MSK5 : 1;
5614 unsigned MSK6 : 1;
5615 unsigned MSK7 : 1;
5616 } __SSP1ADDbits_t;
5618 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
5620 #define _MSK0 0x01
5621 #define _MSK1 0x02
5622 #define _MSK2 0x04
5623 #define _MSK3 0x08
5624 #define _MSK4 0x10
5625 #define _MSK5 0x20
5626 #define _MSK6 0x40
5627 #define _MSK7 0x80
5629 //==============================================================================
5632 //==============================================================================
5633 // SSPADD Bits
5635 extern __at(0x0FC8) __sfr SSPADD;
5637 typedef struct
5639 unsigned MSK0 : 1;
5640 unsigned MSK1 : 1;
5641 unsigned MSK2 : 1;
5642 unsigned MSK3 : 1;
5643 unsigned MSK4 : 1;
5644 unsigned MSK5 : 1;
5645 unsigned MSK6 : 1;
5646 unsigned MSK7 : 1;
5647 } __SSPADDbits_t;
5649 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
5651 #define _SSPADD_MSK0 0x01
5652 #define _SSPADD_MSK1 0x02
5653 #define _SSPADD_MSK2 0x04
5654 #define _SSPADD_MSK3 0x08
5655 #define _SSPADD_MSK4 0x10
5656 #define _SSPADD_MSK5 0x20
5657 #define _SSPADD_MSK6 0x40
5658 #define _SSPADD_MSK7 0x80
5660 //==============================================================================
5662 extern __at(0x0FC9) __sfr SSP1BUF;
5663 extern __at(0x0FC9) __sfr SSPBUF;
5665 //==============================================================================
5666 // T2CON Bits
5668 extern __at(0x0FCA) __sfr T2CON;
5670 typedef union
5672 struct
5674 unsigned T2CKPS0 : 1;
5675 unsigned T2CKPS1 : 1;
5676 unsigned TMR2ON : 1;
5677 unsigned T2OUTPS0 : 1;
5678 unsigned T2OUTPS1 : 1;
5679 unsigned T2OUTPS2 : 1;
5680 unsigned T2OUTPS3 : 1;
5681 unsigned : 1;
5684 struct
5686 unsigned T2CKPS : 2;
5687 unsigned : 6;
5690 struct
5692 unsigned : 3;
5693 unsigned T2OUTPS : 4;
5694 unsigned : 1;
5696 } __T2CONbits_t;
5698 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5700 #define _T2CKPS0 0x01
5701 #define _T2CKPS1 0x02
5702 #define _TMR2ON 0x04
5703 #define _T2OUTPS0 0x08
5704 #define _T2OUTPS1 0x10
5705 #define _T2OUTPS2 0x20
5706 #define _T2OUTPS3 0x40
5708 //==============================================================================
5710 extern __at(0x0FCB) __sfr PR2;
5711 extern __at(0x0FCC) __sfr TMR2;
5713 //==============================================================================
5714 // T1CON Bits
5716 extern __at(0x0FCD) __sfr T1CON;
5718 typedef union
5720 struct
5722 unsigned TMR1ON : 1;
5723 unsigned TMR1CS : 1;
5724 unsigned NOT_T1SYNC : 1;
5725 unsigned T1OSCEN : 1;
5726 unsigned T1CKPS0 : 1;
5727 unsigned T1CKPS1 : 1;
5728 unsigned T1RUN : 1;
5729 unsigned RD16 : 1;
5732 struct
5734 unsigned : 1;
5735 unsigned : 1;
5736 unsigned T1INSYNC : 1;
5737 unsigned : 1;
5738 unsigned : 1;
5739 unsigned : 1;
5740 unsigned : 1;
5741 unsigned T1RD16 : 1;
5744 struct
5746 unsigned : 1;
5747 unsigned : 1;
5748 unsigned T1SYNC : 1;
5749 unsigned : 1;
5750 unsigned : 1;
5751 unsigned : 1;
5752 unsigned : 1;
5753 unsigned : 1;
5756 struct
5758 unsigned : 4;
5759 unsigned T1CKPS : 2;
5760 unsigned : 2;
5762 } __T1CONbits_t;
5764 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5766 #define _TMR1ON 0x01
5767 #define _TMR1CS 0x02
5768 #define _NOT_T1SYNC 0x04
5769 #define _T1INSYNC 0x04
5770 #define _T1SYNC 0x04
5771 #define _T1OSCEN 0x08
5772 #define _T1CKPS0 0x10
5773 #define _T1CKPS1 0x20
5774 #define _T1RUN 0x40
5775 #define _RD16 0x80
5776 #define _T1RD16 0x80
5778 //==============================================================================
5780 extern __at(0x0FCE) __sfr TMR1;
5781 extern __at(0x0FCE) __sfr TMR1L;
5782 extern __at(0x0FCF) __sfr TMR1H;
5784 //==============================================================================
5785 // RCON Bits
5787 extern __at(0x0FD0) __sfr RCON;
5789 typedef union
5791 struct
5793 unsigned NOT_BOR : 1;
5794 unsigned NOT_POR : 1;
5795 unsigned NOT_PD : 1;
5796 unsigned NOT_TO : 1;
5797 unsigned NOT_RI : 1;
5798 unsigned NOT_CM : 1;
5799 unsigned : 1;
5800 unsigned IPEN : 1;
5803 struct
5805 unsigned BOR : 1;
5806 unsigned POR : 1;
5807 unsigned PD : 1;
5808 unsigned TO : 1;
5809 unsigned RI : 1;
5810 unsigned CM : 1;
5811 unsigned : 1;
5812 unsigned : 1;
5814 } __RCONbits_t;
5816 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5818 #define _NOT_BOR 0x01
5819 #define _BOR 0x01
5820 #define _NOT_POR 0x02
5821 #define _POR 0x02
5822 #define _NOT_PD 0x04
5823 #define _PD 0x04
5824 #define _NOT_TO 0x08
5825 #define _TO 0x08
5826 #define _NOT_RI 0x10
5827 #define _RI 0x10
5828 #define _NOT_CM 0x20
5829 #define _CM 0x20
5830 #define _IPEN 0x80
5832 //==============================================================================
5835 //==============================================================================
5836 // WDTCON Bits
5838 extern __at(0x0FD1) __sfr WDTCON;
5840 typedef union
5842 struct
5844 unsigned SWDTEN : 1;
5845 unsigned : 1;
5846 unsigned : 1;
5847 unsigned : 1;
5848 unsigned : 1;
5849 unsigned : 1;
5850 unsigned : 1;
5851 unsigned REGSLP : 1;
5854 struct
5856 unsigned SWDTE : 1;
5857 unsigned : 1;
5858 unsigned : 1;
5859 unsigned : 1;
5860 unsigned : 1;
5861 unsigned : 1;
5862 unsigned : 1;
5863 unsigned : 1;
5865 } __WDTCONbits_t;
5867 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5869 #define _SWDTEN 0x01
5870 #define _SWDTE 0x01
5871 #define _REGSLP 0x80
5873 //==============================================================================
5876 //==============================================================================
5877 // LCDREG Bits
5879 extern __at(0x0FD2) __sfr LCDREG;
5881 typedef union
5883 struct
5885 unsigned CKSEL0 : 1;
5886 unsigned CKSEL1 : 1;
5887 unsigned MODE13 : 1;
5888 unsigned BIAS0 : 1;
5889 unsigned BIAS1 : 1;
5890 unsigned BIAS2 : 1;
5891 unsigned CPEN : 1;
5892 unsigned : 1;
5895 struct
5897 unsigned CKSEL : 2;
5898 unsigned : 6;
5901 struct
5903 unsigned : 3;
5904 unsigned BIAS : 3;
5905 unsigned : 2;
5907 } __LCDREGbits_t;
5909 extern __at(0x0FD2) volatile __LCDREGbits_t LCDREGbits;
5911 #define _CKSEL0 0x01
5912 #define _CKSEL1 0x02
5913 #define _MODE13 0x04
5914 #define _BIAS0 0x08
5915 #define _BIAS1 0x10
5916 #define _BIAS2 0x20
5917 #define _CPEN 0x40
5919 //==============================================================================
5922 //==============================================================================
5923 // OSCCON Bits
5925 extern __at(0x0FD3) __sfr OSCCON;
5927 typedef union
5929 struct
5931 unsigned SCS0 : 1;
5932 unsigned SCS1 : 1;
5933 unsigned IOFS : 1;
5934 unsigned OSTS : 1;
5935 unsigned IRCF0 : 1;
5936 unsigned IRCF1 : 1;
5937 unsigned IRCF2 : 1;
5938 unsigned IDLEN : 1;
5941 struct
5943 unsigned SCS : 2;
5944 unsigned : 6;
5947 struct
5949 unsigned : 4;
5950 unsigned IRCF : 3;
5951 unsigned : 1;
5953 } __OSCCONbits_t;
5955 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5957 #define _SCS0 0x01
5958 #define _SCS1 0x02
5959 #define _IOFS 0x04
5960 #define _OSTS 0x08
5961 #define _IRCF0 0x10
5962 #define _IRCF1 0x20
5963 #define _IRCF2 0x40
5964 #define _IDLEN 0x80
5966 //==============================================================================
5969 //==============================================================================
5970 // T0CON Bits
5972 extern __at(0x0FD5) __sfr T0CON;
5974 typedef union
5976 struct
5978 unsigned T0PS0 : 1;
5979 unsigned T0PS1 : 1;
5980 unsigned T0PS2 : 1;
5981 unsigned PSA : 1;
5982 unsigned T0SE : 1;
5983 unsigned T0CS : 1;
5984 unsigned T08BIT : 1;
5985 unsigned TMR0ON : 1;
5988 struct
5990 unsigned T0PS : 3;
5991 unsigned : 5;
5993 } __T0CONbits_t;
5995 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5997 #define _T0PS0 0x01
5998 #define _T0PS1 0x02
5999 #define _T0PS2 0x04
6000 #define _PSA 0x08
6001 #define _T0SE 0x10
6002 #define _T0CS 0x20
6003 #define _T08BIT 0x40
6004 #define _TMR0ON 0x80
6006 //==============================================================================
6008 extern __at(0x0FD6) __sfr TMR0;
6009 extern __at(0x0FD6) __sfr TMR0L;
6010 extern __at(0x0FD7) __sfr TMR0H;
6012 //==============================================================================
6013 // STATUS Bits
6015 extern __at(0x0FD8) __sfr STATUS;
6017 typedef struct
6019 unsigned C : 1;
6020 unsigned DC : 1;
6021 unsigned Z : 1;
6022 unsigned OV : 1;
6023 unsigned N : 1;
6024 unsigned : 1;
6025 unsigned : 1;
6026 unsigned : 1;
6027 } __STATUSbits_t;
6029 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6031 #define _C 0x01
6032 #define _DC 0x02
6033 #define _Z 0x04
6034 #define _OV 0x08
6035 #define _N 0x10
6037 //==============================================================================
6039 extern __at(0x0FD9) __sfr FSR2L;
6040 extern __at(0x0FDA) __sfr FSR2H;
6041 extern __at(0x0FDB) __sfr PLUSW2;
6042 extern __at(0x0FDC) __sfr PREINC2;
6043 extern __at(0x0FDD) __sfr POSTDEC2;
6044 extern __at(0x0FDE) __sfr POSTINC2;
6045 extern __at(0x0FDF) __sfr INDF2;
6046 extern __at(0x0FE0) __sfr BSR;
6047 extern __at(0x0FE1) __sfr FSR1L;
6048 extern __at(0x0FE2) __sfr FSR1H;
6049 extern __at(0x0FE3) __sfr PLUSW1;
6050 extern __at(0x0FE4) __sfr PREINC1;
6051 extern __at(0x0FE5) __sfr POSTDEC1;
6052 extern __at(0x0FE6) __sfr POSTINC1;
6053 extern __at(0x0FE7) __sfr INDF1;
6054 extern __at(0x0FE8) __sfr WREG;
6055 extern __at(0x0FE9) __sfr FSR0L;
6056 extern __at(0x0FEA) __sfr FSR0H;
6057 extern __at(0x0FEB) __sfr PLUSW0;
6058 extern __at(0x0FEC) __sfr PREINC0;
6059 extern __at(0x0FED) __sfr POSTDEC0;
6060 extern __at(0x0FEE) __sfr POSTINC0;
6061 extern __at(0x0FEF) __sfr INDF0;
6063 //==============================================================================
6064 // INTCON3 Bits
6066 extern __at(0x0FF0) __sfr INTCON3;
6068 typedef union
6070 struct
6072 unsigned INT1IF : 1;
6073 unsigned INT2IF : 1;
6074 unsigned INT3IF : 1;
6075 unsigned INT1IE : 1;
6076 unsigned INT2IE : 1;
6077 unsigned INT3IE : 1;
6078 unsigned INT1IP : 1;
6079 unsigned INT2IP : 1;
6082 struct
6084 unsigned INT1F : 1;
6085 unsigned INT2F : 1;
6086 unsigned INT3F : 1;
6087 unsigned INT1E : 1;
6088 unsigned INT2E : 1;
6089 unsigned INT3E : 1;
6090 unsigned INT1P : 1;
6091 unsigned INT2P : 1;
6093 } __INTCON3bits_t;
6095 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6097 #define _INT1IF 0x01
6098 #define _INT1F 0x01
6099 #define _INT2IF 0x02
6100 #define _INT2F 0x02
6101 #define _INT3IF 0x04
6102 #define _INT3F 0x04
6103 #define _INT1IE 0x08
6104 #define _INT1E 0x08
6105 #define _INT2IE 0x10
6106 #define _INT2E 0x10
6107 #define _INT3IE 0x20
6108 #define _INT3E 0x20
6109 #define _INT1IP 0x40
6110 #define _INT1P 0x40
6111 #define _INT2IP 0x80
6112 #define _INT2P 0x80
6114 //==============================================================================
6117 //==============================================================================
6118 // INTCON2 Bits
6120 extern __at(0x0FF1) __sfr INTCON2;
6122 typedef union
6124 struct
6126 unsigned RBIP : 1;
6127 unsigned INT3IP : 1;
6128 unsigned TMR0IP : 1;
6129 unsigned INTEDG3 : 1;
6130 unsigned INTEDG2 : 1;
6131 unsigned INTEDG1 : 1;
6132 unsigned INTEDG0 : 1;
6133 unsigned NOT_RBPU : 1;
6136 struct
6138 unsigned : 1;
6139 unsigned INT3P : 1;
6140 unsigned T0IP : 1;
6141 unsigned : 1;
6142 unsigned : 1;
6143 unsigned : 1;
6144 unsigned : 1;
6145 unsigned RBPU : 1;
6147 } __INTCON2bits_t;
6149 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6151 #define _RBIP 0x01
6152 #define _INT3IP 0x02
6153 #define _INT3P 0x02
6154 #define _TMR0IP 0x04
6155 #define _T0IP 0x04
6156 #define _INTEDG3 0x08
6157 #define _INTEDG2 0x10
6158 #define _INTEDG1 0x20
6159 #define _INTEDG0 0x40
6160 #define _NOT_RBPU 0x80
6161 #define _RBPU 0x80
6163 //==============================================================================
6166 //==============================================================================
6167 // INTCON Bits
6169 extern __at(0x0FF2) __sfr INTCON;
6171 typedef union
6173 struct
6175 unsigned RBIF : 1;
6176 unsigned INT0IF : 1;
6177 unsigned TMR0IF : 1;
6178 unsigned RBIE : 1;
6179 unsigned INT0IE : 1;
6180 unsigned TMR0IE : 1;
6181 unsigned PEIE_GIEL : 1;
6182 unsigned GIE_GIEH : 1;
6185 struct
6187 unsigned : 1;
6188 unsigned INT0F : 1;
6189 unsigned T0IF : 1;
6190 unsigned : 1;
6191 unsigned INT0E : 1;
6192 unsigned T0IE : 1;
6193 unsigned PEIE : 1;
6194 unsigned GIE : 1;
6197 struct
6199 unsigned : 1;
6200 unsigned : 1;
6201 unsigned : 1;
6202 unsigned : 1;
6203 unsigned : 1;
6204 unsigned : 1;
6205 unsigned GIEL : 1;
6206 unsigned GIEH : 1;
6208 } __INTCONbits_t;
6210 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6212 #define _RBIF 0x01
6213 #define _INT0IF 0x02
6214 #define _INT0F 0x02
6215 #define _TMR0IF 0x04
6216 #define _T0IF 0x04
6217 #define _RBIE 0x08
6218 #define _INT0IE 0x10
6219 #define _INT0E 0x10
6220 #define _TMR0IE 0x20
6221 #define _T0IE 0x20
6222 #define _PEIE_GIEL 0x40
6223 #define _PEIE 0x40
6224 #define _GIEL 0x40
6225 #define _GIE_GIEH 0x80
6226 #define _GIE 0x80
6227 #define _GIEH 0x80
6229 //==============================================================================
6231 extern __at(0x0FF3) __sfr PROD;
6232 extern __at(0x0FF3) __sfr PRODL;
6233 extern __at(0x0FF4) __sfr PRODH;
6234 extern __at(0x0FF5) __sfr TABLAT;
6235 extern __at(0x0FF6) __sfr TBLPTR;
6236 extern __at(0x0FF6) __sfr TBLPTRL;
6237 extern __at(0x0FF7) __sfr TBLPTRH;
6238 extern __at(0x0FF8) __sfr TBLPTRU;
6239 extern __at(0x0FF9) __sfr PC;
6240 extern __at(0x0FF9) __sfr PCL;
6241 extern __at(0x0FFA) __sfr PCLATH;
6242 extern __at(0x0FFB) __sfr PCLATU;
6244 //==============================================================================
6245 // STKPTR Bits
6247 extern __at(0x0FFC) __sfr STKPTR;
6249 typedef union
6251 struct
6253 unsigned SP0 : 1;
6254 unsigned SP1 : 1;
6255 unsigned SP2 : 1;
6256 unsigned SP3 : 1;
6257 unsigned SP4 : 1;
6258 unsigned : 1;
6259 unsigned STKUNF : 1;
6260 unsigned STKFUL : 1;
6263 struct
6265 unsigned STKPTR0 : 1;
6266 unsigned STKPTR1 : 1;
6267 unsigned STKPTR2 : 1;
6268 unsigned STKPTR3 : 1;
6269 unsigned STKPTR4 : 1;
6270 unsigned : 1;
6271 unsigned : 1;
6272 unsigned STKOVF : 1;
6275 struct
6277 unsigned SP : 5;
6278 unsigned : 3;
6281 struct
6283 unsigned STKPTR : 5;
6284 unsigned : 3;
6286 } __STKPTRbits_t;
6288 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6290 #define _SP0 0x01
6291 #define _STKPTR0 0x01
6292 #define _SP1 0x02
6293 #define _STKPTR1 0x02
6294 #define _SP2 0x04
6295 #define _STKPTR2 0x04
6296 #define _SP3 0x08
6297 #define _STKPTR3 0x08
6298 #define _SP4 0x10
6299 #define _STKPTR4 0x10
6300 #define _STKUNF 0x40
6301 #define _STKFUL 0x80
6302 #define _STKOVF 0x80
6304 //==============================================================================
6306 extern __at(0x0FFD) __sfr TOS;
6307 extern __at(0x0FFD) __sfr TOSL;
6308 extern __at(0x0FFE) __sfr TOSH;
6309 extern __at(0x0FFF) __sfr TOSU;
6311 //==============================================================================
6313 // Configuration Addresses
6315 //==============================================================================
6317 #define __CONFIG1L 0x00FFF8
6318 #define __CONFIG1H 0x00FFF9
6319 #define __CONFIG2L 0x00FFFA
6320 #define __CONFIG2H 0x00FFFB
6321 #define __CONFIG3L 0x00FFFC
6322 #define __CONFIG3H 0x00FFFD
6323 #define __CONFIG4L 0x00FFFE
6324 #define __CONFIG4H 0x00FFFF
6326 //==============================================================================
6328 #endif // #ifndef __PIC18F86J90_H__