struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f87j72.h
blobb8fb61690e10d5b76c24f88358e1c6c6f767c7ad
1 /*
2 * This declarations of the PIC18F87J72 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:39 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 __PIC18F87J72_H__
26 #define __PIC18F87J72_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 // LCDDATA6 Bits
770 extern __at(0x0F6C) __sfr LCDDATA6;
772 typedef union
774 struct
776 unsigned S00C1 : 1;
777 unsigned S01C1 : 1;
778 unsigned S02C1 : 1;
779 unsigned S03C1 : 1;
780 unsigned S04C1 : 1;
781 unsigned S05C1 : 1;
782 unsigned S06C1 : 1;
783 unsigned S07C1 : 1;
786 struct
788 unsigned SEG0COM1 : 1;
789 unsigned SEG1COM1 : 1;
790 unsigned SEG2COM1 : 1;
791 unsigned SEG3COM1 : 1;
792 unsigned SEG4COM1 : 1;
793 unsigned SEG5COM1 : 1;
794 unsigned SEG6COM1 : 1;
795 unsigned SEG7COM1 : 1;
798 struct
800 unsigned S0C1 : 1;
801 unsigned S1C1 : 1;
802 unsigned S2C1 : 1;
803 unsigned S3C1 : 1;
804 unsigned S4C1 : 1;
805 unsigned S5C1 : 1;
806 unsigned S6C1 : 1;
807 unsigned S7C1 : 1;
809 } __LCDDATA6bits_t;
811 extern __at(0x0F6C) volatile __LCDDATA6bits_t LCDDATA6bits;
813 #define _S00C1 0x01
814 #define _SEG0COM1 0x01
815 #define _S0C1 0x01
816 #define _S01C1 0x02
817 #define _SEG1COM1 0x02
818 #define _S1C1 0x02
819 #define _S02C1 0x04
820 #define _SEG2COM1 0x04
821 #define _S2C1 0x04
822 #define _S03C1 0x08
823 #define _SEG3COM1 0x08
824 #define _S3C1 0x08
825 #define _S04C1 0x10
826 #define _SEG4COM1 0x10
827 #define _S4C1 0x10
828 #define _S05C1 0x20
829 #define _SEG5COM1 0x20
830 #define _S5C1 0x20
831 #define _S06C1 0x40
832 #define _SEG6COM1 0x40
833 #define _S6C1 0x40
834 #define _S07C1 0x80
835 #define _SEG7COM1 0x80
836 #define _S7C1 0x80
838 //==============================================================================
841 //==============================================================================
842 // LCDDATA7 Bits
844 extern __at(0x0F6D) __sfr LCDDATA7;
846 typedef union
848 struct
850 unsigned S8C1 : 1;
851 unsigned S9C1 : 1;
852 unsigned S10C1 : 1;
853 unsigned S11C1 : 1;
854 unsigned S12C1 : 1;
855 unsigned S13C1 : 1;
856 unsigned S14C1 : 1;
857 unsigned S15C1 : 1;
860 struct
862 unsigned SEG8COM1 : 1;
863 unsigned SEG9COM1 : 1;
864 unsigned SEG10COM1 : 1;
865 unsigned SEG11COM1 : 1;
866 unsigned SEG12COM1 : 1;
867 unsigned SEG13COM1 : 1;
868 unsigned SEG14COM1 : 1;
869 unsigned SEG15COM1 : 1;
872 struct
874 unsigned S08C1 : 1;
875 unsigned S09C1 : 1;
876 unsigned : 1;
877 unsigned : 1;
878 unsigned : 1;
879 unsigned : 1;
880 unsigned : 1;
881 unsigned : 1;
883 } __LCDDATA7bits_t;
885 extern __at(0x0F6D) volatile __LCDDATA7bits_t LCDDATA7bits;
887 #define _S8C1 0x01
888 #define _SEG8COM1 0x01
889 #define _S08C1 0x01
890 #define _S9C1 0x02
891 #define _SEG9COM1 0x02
892 #define _S09C1 0x02
893 #define _S10C1 0x04
894 #define _SEG10COM1 0x04
895 #define _S11C1 0x08
896 #define _SEG11COM1 0x08
897 #define _S12C1 0x10
898 #define _SEG12COM1 0x10
899 #define _S13C1 0x20
900 #define _SEG13COM1 0x20
901 #define _S14C1 0x40
902 #define _SEG14COM1 0x40
903 #define _S15C1 0x80
904 #define _SEG15COM1 0x80
906 //==============================================================================
909 //==============================================================================
910 // LCDDATA8 Bits
912 extern __at(0x0F6E) __sfr LCDDATA8;
914 typedef union
916 struct
918 unsigned S16C1 : 1;
919 unsigned S17C1 : 1;
920 unsigned S18C1 : 1;
921 unsigned S19C1 : 1;
922 unsigned S20C1 : 1;
923 unsigned S21C1 : 1;
924 unsigned S22C1 : 1;
925 unsigned S23C1 : 1;
928 struct
930 unsigned SEG16COM1 : 1;
931 unsigned SEG17COM1 : 1;
932 unsigned SEG18COM1 : 1;
933 unsigned SEG19COM1 : 1;
934 unsigned SEG20COM1 : 1;
935 unsigned SEG21COM1 : 1;
936 unsigned SEG22COM1 : 1;
937 unsigned SEG23COM1 : 1;
939 } __LCDDATA8bits_t;
941 extern __at(0x0F6E) volatile __LCDDATA8bits_t LCDDATA8bits;
943 #define _S16C1 0x01
944 #define _SEG16COM1 0x01
945 #define _S17C1 0x02
946 #define _SEG17COM1 0x02
947 #define _S18C1 0x04
948 #define _SEG18COM1 0x04
949 #define _S19C1 0x08
950 #define _SEG19COM1 0x08
951 #define _S20C1 0x10
952 #define _SEG20COM1 0x10
953 #define _S21C1 0x20
954 #define _SEG21COM1 0x20
955 #define _S22C1 0x40
956 #define _SEG22COM1 0x40
957 #define _S23C1 0x80
958 #define _SEG23COM1 0x80
960 //==============================================================================
963 //==============================================================================
964 // LCDDATA9 Bits
966 extern __at(0x0F6F) __sfr LCDDATA9;
968 typedef union
970 struct
972 unsigned S24C1 : 1;
973 unsigned S25C1 : 1;
974 unsigned S26C1 : 1;
975 unsigned S27C1 : 1;
976 unsigned S28C1 : 1;
977 unsigned S29C1 : 1;
978 unsigned S30C1 : 1;
979 unsigned S31C1 : 1;
982 struct
984 unsigned SEG24COM1 : 1;
985 unsigned SEG25COM1 : 1;
986 unsigned SEG26COM1 : 1;
987 unsigned SEG27COM1 : 1;
988 unsigned SEG28COM1 : 1;
989 unsigned SEG29COM1 : 1;
990 unsigned SEG30COM1 : 1;
991 unsigned SEG31COM1 : 1;
993 } __LCDDATA9bits_t;
995 extern __at(0x0F6F) volatile __LCDDATA9bits_t LCDDATA9bits;
997 #define _S24C1 0x01
998 #define _SEG24COM1 0x01
999 #define _S25C1 0x02
1000 #define _SEG25COM1 0x02
1001 #define _S26C1 0x04
1002 #define _SEG26COM1 0x04
1003 #define _S27C1 0x08
1004 #define _SEG27COM1 0x08
1005 #define _S28C1 0x10
1006 #define _SEG28COM1 0x10
1007 #define _S29C1 0x20
1008 #define _SEG29COM1 0x20
1009 #define _S30C1 0x40
1010 #define _SEG30COM1 0x40
1011 #define _S31C1 0x80
1012 #define _SEG31COM1 0x80
1014 //==============================================================================
1017 //==============================================================================
1018 // LCDDATA10 Bits
1020 extern __at(0x0F70) __sfr LCDDATA10;
1022 typedef union
1024 struct
1026 unsigned S32C1 : 1;
1027 unsigned : 1;
1028 unsigned : 1;
1029 unsigned : 1;
1030 unsigned : 1;
1031 unsigned : 1;
1032 unsigned : 1;
1033 unsigned : 1;
1036 struct
1038 unsigned SEG32COM1 : 1;
1039 unsigned : 1;
1040 unsigned : 1;
1041 unsigned : 1;
1042 unsigned : 1;
1043 unsigned : 1;
1044 unsigned : 1;
1045 unsigned : 1;
1047 } __LCDDATA10bits_t;
1049 extern __at(0x0F70) volatile __LCDDATA10bits_t LCDDATA10bits;
1051 #define _S32C1 0x01
1052 #define _SEG32COM1 0x01
1054 //==============================================================================
1057 //==============================================================================
1058 // LCDDATA12 Bits
1060 extern __at(0x0F72) __sfr LCDDATA12;
1062 typedef union
1064 struct
1066 unsigned S00C2 : 1;
1067 unsigned S01C2 : 1;
1068 unsigned S02C2 : 1;
1069 unsigned S03C2 : 1;
1070 unsigned S04C2 : 1;
1071 unsigned S05C2 : 1;
1072 unsigned S06C2 : 1;
1073 unsigned S07C2 : 1;
1076 struct
1078 unsigned SEG0COM2 : 1;
1079 unsigned SEG1COM2 : 1;
1080 unsigned SEG2COM2 : 1;
1081 unsigned SEG3COM2 : 1;
1082 unsigned SEG4COM2 : 1;
1083 unsigned SEG5COM2 : 1;
1084 unsigned SEG6COM2 : 1;
1085 unsigned SEG7COM2 : 1;
1088 struct
1090 unsigned S0C2 : 1;
1091 unsigned S1C2 : 1;
1092 unsigned S2C2 : 1;
1093 unsigned S3C2 : 1;
1094 unsigned S4C2 : 1;
1095 unsigned S5C2 : 1;
1096 unsigned S6C2 : 1;
1097 unsigned S7C2 : 1;
1099 } __LCDDATA12bits_t;
1101 extern __at(0x0F72) volatile __LCDDATA12bits_t LCDDATA12bits;
1103 #define _S00C2 0x01
1104 #define _SEG0COM2 0x01
1105 #define _S0C2 0x01
1106 #define _S01C2 0x02
1107 #define _SEG1COM2 0x02
1108 #define _S1C2 0x02
1109 #define _S02C2 0x04
1110 #define _SEG2COM2 0x04
1111 #define _S2C2 0x04
1112 #define _S03C2 0x08
1113 #define _SEG3COM2 0x08
1114 #define _S3C2 0x08
1115 #define _S04C2 0x10
1116 #define _SEG4COM2 0x10
1117 #define _S4C2 0x10
1118 #define _S05C2 0x20
1119 #define _SEG5COM2 0x20
1120 #define _S5C2 0x20
1121 #define _S06C2 0x40
1122 #define _SEG6COM2 0x40
1123 #define _S6C2 0x40
1124 #define _S07C2 0x80
1125 #define _SEG7COM2 0x80
1126 #define _S7C2 0x80
1128 //==============================================================================
1131 //==============================================================================
1132 // LCDDATA13 Bits
1134 extern __at(0x0F73) __sfr LCDDATA13;
1136 typedef union
1138 struct
1140 unsigned S8C2 : 1;
1141 unsigned S9C2 : 1;
1142 unsigned S10C2 : 1;
1143 unsigned S11C2 : 1;
1144 unsigned S12C2 : 1;
1145 unsigned S13C2 : 1;
1146 unsigned S14C2 : 1;
1147 unsigned S15C2 : 1;
1150 struct
1152 unsigned SEG8COM2 : 1;
1153 unsigned SEG9COM2 : 1;
1154 unsigned SEG10COM2 : 1;
1155 unsigned SEG11COM2 : 1;
1156 unsigned SEG12COM2 : 1;
1157 unsigned SEG13COM2 : 1;
1158 unsigned SEG14COM2 : 1;
1159 unsigned SEG15COM2 : 1;
1162 struct
1164 unsigned S08C2 : 1;
1165 unsigned S09C2 : 1;
1166 unsigned : 1;
1167 unsigned : 1;
1168 unsigned : 1;
1169 unsigned : 1;
1170 unsigned : 1;
1171 unsigned : 1;
1173 } __LCDDATA13bits_t;
1175 extern __at(0x0F73) volatile __LCDDATA13bits_t LCDDATA13bits;
1177 #define _S8C2 0x01
1178 #define _SEG8COM2 0x01
1179 #define _S08C2 0x01
1180 #define _S9C2 0x02
1181 #define _SEG9COM2 0x02
1182 #define _S09C2 0x02
1183 #define _S10C2 0x04
1184 #define _SEG10COM2 0x04
1185 #define _S11C2 0x08
1186 #define _SEG11COM2 0x08
1187 #define _S12C2 0x10
1188 #define _SEG12COM2 0x10
1189 #define _S13C2 0x20
1190 #define _SEG13COM2 0x20
1191 #define _S14C2 0x40
1192 #define _SEG14COM2 0x40
1193 #define _S15C2 0x80
1194 #define _SEG15COM2 0x80
1196 //==============================================================================
1199 //==============================================================================
1200 // LCDDATA14 Bits
1202 extern __at(0x0F74) __sfr LCDDATA14;
1204 typedef union
1206 struct
1208 unsigned S16C2 : 1;
1209 unsigned S17C2 : 1;
1210 unsigned S18C2 : 1;
1211 unsigned S19C2 : 1;
1212 unsigned S20C2 : 1;
1213 unsigned S21C2 : 1;
1214 unsigned S22C2 : 1;
1215 unsigned S23C2 : 1;
1218 struct
1220 unsigned SEG16COM2 : 1;
1221 unsigned SEG17COM2 : 1;
1222 unsigned SEG18COM2 : 1;
1223 unsigned SEG19COM2 : 1;
1224 unsigned SEG20COM2 : 1;
1225 unsigned SEG21COM2 : 1;
1226 unsigned SEG22COM2 : 1;
1227 unsigned SEG23COM2 : 1;
1229 } __LCDDATA14bits_t;
1231 extern __at(0x0F74) volatile __LCDDATA14bits_t LCDDATA14bits;
1233 #define _S16C2 0x01
1234 #define _SEG16COM2 0x01
1235 #define _S17C2 0x02
1236 #define _SEG17COM2 0x02
1237 #define _S18C2 0x04
1238 #define _SEG18COM2 0x04
1239 #define _S19C2 0x08
1240 #define _SEG19COM2 0x08
1241 #define _S20C2 0x10
1242 #define _SEG20COM2 0x10
1243 #define _S21C2 0x20
1244 #define _SEG21COM2 0x20
1245 #define _S22C2 0x40
1246 #define _SEG22COM2 0x40
1247 #define _S23C2 0x80
1248 #define _SEG23COM2 0x80
1250 //==============================================================================
1253 //==============================================================================
1254 // LCDDATA15 Bits
1256 extern __at(0x0F75) __sfr LCDDATA15;
1258 typedef union
1260 struct
1262 unsigned S24C2 : 1;
1263 unsigned S25C2 : 1;
1264 unsigned S26C2 : 1;
1265 unsigned S27C2 : 1;
1266 unsigned S28C2 : 1;
1267 unsigned S29C2 : 1;
1268 unsigned S30C2 : 1;
1269 unsigned S31C2 : 1;
1272 struct
1274 unsigned SEG24COM2 : 1;
1275 unsigned SEG25COM2 : 1;
1276 unsigned SEG26COM2 : 1;
1277 unsigned SEG27COM2 : 1;
1278 unsigned SEG28COM2 : 1;
1279 unsigned SEG29COM2 : 1;
1280 unsigned SEG30COM2 : 1;
1281 unsigned SEG31COM2 : 1;
1283 } __LCDDATA15bits_t;
1285 extern __at(0x0F75) volatile __LCDDATA15bits_t LCDDATA15bits;
1287 #define _S24C2 0x01
1288 #define _SEG24COM2 0x01
1289 #define _S25C2 0x02
1290 #define _SEG25COM2 0x02
1291 #define _S26C2 0x04
1292 #define _SEG26COM2 0x04
1293 #define _S27C2 0x08
1294 #define _SEG27COM2 0x08
1295 #define _S28C2 0x10
1296 #define _SEG28COM2 0x10
1297 #define _S29C2 0x20
1298 #define _SEG29COM2 0x20
1299 #define _S30C2 0x40
1300 #define _SEG30COM2 0x40
1301 #define _S31C2 0x80
1302 #define _SEG31COM2 0x80
1304 //==============================================================================
1307 //==============================================================================
1308 // LCDDATA16 Bits
1310 extern __at(0x0F76) __sfr LCDDATA16;
1312 typedef union
1314 struct
1316 unsigned S32C2 : 1;
1317 unsigned : 1;
1318 unsigned : 1;
1319 unsigned : 1;
1320 unsigned : 1;
1321 unsigned : 1;
1322 unsigned : 1;
1323 unsigned : 1;
1326 struct
1328 unsigned SEG32COM2 : 1;
1329 unsigned : 1;
1330 unsigned : 1;
1331 unsigned : 1;
1332 unsigned : 1;
1333 unsigned : 1;
1334 unsigned : 1;
1335 unsigned : 1;
1337 } __LCDDATA16bits_t;
1339 extern __at(0x0F76) volatile __LCDDATA16bits_t LCDDATA16bits;
1341 #define _S32C2 0x01
1342 #define _SEG32COM2 0x01
1344 //==============================================================================
1347 //==============================================================================
1348 // LCDDATA18 Bits
1350 extern __at(0x0F78) __sfr LCDDATA18;
1352 typedef union
1354 struct
1356 unsigned S00C3 : 1;
1357 unsigned S01C3 : 1;
1358 unsigned S02C3 : 1;
1359 unsigned S03C3 : 1;
1360 unsigned S04C3 : 1;
1361 unsigned S05C3 : 1;
1362 unsigned S06C3 : 1;
1363 unsigned S07C3 : 1;
1366 struct
1368 unsigned SEG00COM3 : 1;
1369 unsigned SEG01COM3 : 1;
1370 unsigned SEG02COM3 : 1;
1371 unsigned SEG03COM3 : 1;
1372 unsigned SEG04COM3 : 1;
1373 unsigned SEG05COM3 : 1;
1374 unsigned SEG06COM3 : 1;
1375 unsigned SEG07COM3 : 1;
1378 struct
1380 unsigned S0C3 : 1;
1381 unsigned S1C3 : 1;
1382 unsigned S2C3 : 1;
1383 unsigned S3C3 : 1;
1384 unsigned S4C3 : 1;
1385 unsigned S5C3 : 1;
1386 unsigned S6C3 : 1;
1387 unsigned S7C3 : 1;
1389 } __LCDDATA18bits_t;
1391 extern __at(0x0F78) volatile __LCDDATA18bits_t LCDDATA18bits;
1393 #define _S00C3 0x01
1394 #define _SEG00COM3 0x01
1395 #define _S0C3 0x01
1396 #define _S01C3 0x02
1397 #define _SEG01COM3 0x02
1398 #define _S1C3 0x02
1399 #define _S02C3 0x04
1400 #define _SEG02COM3 0x04
1401 #define _S2C3 0x04
1402 #define _S03C3 0x08
1403 #define _SEG03COM3 0x08
1404 #define _S3C3 0x08
1405 #define _S04C3 0x10
1406 #define _SEG04COM3 0x10
1407 #define _S4C3 0x10
1408 #define _S05C3 0x20
1409 #define _SEG05COM3 0x20
1410 #define _S5C3 0x20
1411 #define _S06C3 0x40
1412 #define _SEG06COM3 0x40
1413 #define _S6C3 0x40
1414 #define _S07C3 0x80
1415 #define _SEG07COM3 0x80
1416 #define _S7C3 0x80
1418 //==============================================================================
1421 //==============================================================================
1422 // LCDDATA19 Bits
1424 extern __at(0x0F79) __sfr LCDDATA19;
1426 typedef union
1428 struct
1430 unsigned S8C3 : 1;
1431 unsigned S9C3 : 1;
1432 unsigned S10C3 : 1;
1433 unsigned S11C3 : 1;
1434 unsigned S12C3 : 1;
1435 unsigned S13C3 : 1;
1436 unsigned S14C3 : 1;
1437 unsigned S15C3 : 1;
1440 struct
1442 unsigned SEG8COM3 : 1;
1443 unsigned SEG9COM3 : 1;
1444 unsigned SEG10COM3 : 1;
1445 unsigned SEG11COM3 : 1;
1446 unsigned SEG12COM3 : 1;
1447 unsigned SEG13COM3 : 1;
1448 unsigned SEG14COM3 : 1;
1449 unsigned SEG15COM3 : 1;
1452 struct
1454 unsigned S08C3 : 1;
1455 unsigned S09C3 : 1;
1456 unsigned : 1;
1457 unsigned : 1;
1458 unsigned : 1;
1459 unsigned : 1;
1460 unsigned : 1;
1461 unsigned : 1;
1463 } __LCDDATA19bits_t;
1465 extern __at(0x0F79) volatile __LCDDATA19bits_t LCDDATA19bits;
1467 #define _S8C3 0x01
1468 #define _SEG8COM3 0x01
1469 #define _S08C3 0x01
1470 #define _S9C3 0x02
1471 #define _SEG9COM3 0x02
1472 #define _S09C3 0x02
1473 #define _S10C3 0x04
1474 #define _SEG10COM3 0x04
1475 #define _S11C3 0x08
1476 #define _SEG11COM3 0x08
1477 #define _S12C3 0x10
1478 #define _SEG12COM3 0x10
1479 #define _S13C3 0x20
1480 #define _SEG13COM3 0x20
1481 #define _S14C3 0x40
1482 #define _SEG14COM3 0x40
1483 #define _S15C3 0x80
1484 #define _SEG15COM3 0x80
1486 //==============================================================================
1489 //==============================================================================
1490 // LCDDATA20 Bits
1492 extern __at(0x0F7A) __sfr LCDDATA20;
1494 typedef union
1496 struct
1498 unsigned S16C3 : 1;
1499 unsigned S17C3 : 1;
1500 unsigned S18C3 : 1;
1501 unsigned S19C3 : 1;
1502 unsigned S20C3 : 1;
1503 unsigned S21C3 : 1;
1504 unsigned S22C3 : 1;
1505 unsigned S23C3 : 1;
1508 struct
1510 unsigned SEG16COM3 : 1;
1511 unsigned SEG17COM3 : 1;
1512 unsigned SEG18COM3 : 1;
1513 unsigned SEG19COM3 : 1;
1514 unsigned SEG20COM3 : 1;
1515 unsigned SEG21COM3 : 1;
1516 unsigned SEG22COM3 : 1;
1517 unsigned SEG23COM3 : 1;
1519 } __LCDDATA20bits_t;
1521 extern __at(0x0F7A) volatile __LCDDATA20bits_t LCDDATA20bits;
1523 #define _S16C3 0x01
1524 #define _SEG16COM3 0x01
1525 #define _S17C3 0x02
1526 #define _SEG17COM3 0x02
1527 #define _S18C3 0x04
1528 #define _SEG18COM3 0x04
1529 #define _S19C3 0x08
1530 #define _SEG19COM3 0x08
1531 #define _S20C3 0x10
1532 #define _SEG20COM3 0x10
1533 #define _S21C3 0x20
1534 #define _SEG21COM3 0x20
1535 #define _S22C3 0x40
1536 #define _SEG22COM3 0x40
1537 #define _S23C3 0x80
1538 #define _SEG23COM3 0x80
1540 //==============================================================================
1543 //==============================================================================
1544 // LCDDATA21 Bits
1546 extern __at(0x0F7B) __sfr LCDDATA21;
1548 typedef union
1550 struct
1552 unsigned S24C3 : 1;
1553 unsigned S25C3 : 1;
1554 unsigned S26C3 : 1;
1555 unsigned S27C3 : 1;
1556 unsigned S28C3 : 1;
1557 unsigned S29C3 : 1;
1558 unsigned S30C3 : 1;
1559 unsigned S31C3 : 1;
1562 struct
1564 unsigned SEG24COM3 : 1;
1565 unsigned SEG25COM3 : 1;
1566 unsigned SEG26COM3 : 1;
1567 unsigned SEG27COM3 : 1;
1568 unsigned SEG28COM3 : 1;
1569 unsigned SEG29COM3 : 1;
1570 unsigned SEG30COM3 : 1;
1571 unsigned SEG31COM3 : 1;
1573 } __LCDDATA21bits_t;
1575 extern __at(0x0F7B) volatile __LCDDATA21bits_t LCDDATA21bits;
1577 #define _S24C3 0x01
1578 #define _SEG24COM3 0x01
1579 #define _S25C3 0x02
1580 #define _SEG25COM3 0x02
1581 #define _S26C3 0x04
1582 #define _SEG26COM3 0x04
1583 #define _S27C3 0x08
1584 #define _SEG27COM3 0x08
1585 #define _S28C3 0x10
1586 #define _SEG28COM3 0x10
1587 #define _S29C3 0x20
1588 #define _SEG29COM3 0x20
1589 #define _S30C3 0x40
1590 #define _SEG30COM3 0x40
1591 #define _S31C3 0x80
1592 #define _SEG31COM3 0x80
1594 //==============================================================================
1597 //==============================================================================
1598 // LCDDATA22 Bits
1600 extern __at(0x0F7C) __sfr LCDDATA22;
1602 typedef union
1604 struct
1606 unsigned S32C3 : 1;
1607 unsigned : 1;
1608 unsigned : 1;
1609 unsigned : 1;
1610 unsigned : 1;
1611 unsigned : 1;
1612 unsigned : 1;
1613 unsigned : 1;
1616 struct
1618 unsigned SEG32COM3 : 1;
1619 unsigned : 1;
1620 unsigned : 1;
1621 unsigned : 1;
1622 unsigned : 1;
1623 unsigned : 1;
1624 unsigned : 1;
1625 unsigned : 1;
1627 } __LCDDATA22bits_t;
1629 extern __at(0x0F7C) volatile __LCDDATA22bits_t LCDDATA22bits;
1631 #define _S32C3 0x01
1632 #define _SEG32COM3 0x01
1634 //==============================================================================
1637 //==============================================================================
1638 // BAUDCON Bits
1640 extern __at(0x0F7E) __sfr BAUDCON;
1642 typedef union
1644 struct
1646 unsigned ABDEN : 1;
1647 unsigned WUE : 1;
1648 unsigned : 1;
1649 unsigned BRG16 : 1;
1650 unsigned TXCKP : 1;
1651 unsigned RXDTP : 1;
1652 unsigned RCMT : 1;
1653 unsigned ABDOVF : 1;
1656 struct
1658 unsigned : 1;
1659 unsigned : 1;
1660 unsigned : 1;
1661 unsigned : 1;
1662 unsigned : 1;
1663 unsigned : 1;
1664 unsigned RCIDL : 1;
1665 unsigned : 1;
1667 } __BAUDCONbits_t;
1669 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1671 #define _ABDEN 0x01
1672 #define _WUE 0x02
1673 #define _BRG16 0x08
1674 #define _TXCKP 0x10
1675 #define _RXDTP 0x20
1676 #define _RCMT 0x40
1677 #define _RCIDL 0x40
1678 #define _ABDOVF 0x80
1680 //==============================================================================
1683 //==============================================================================
1684 // BAUDCON1 Bits
1686 extern __at(0x0F7E) __sfr BAUDCON1;
1688 typedef union
1690 struct
1692 unsigned ABDEN : 1;
1693 unsigned WUE : 1;
1694 unsigned : 1;
1695 unsigned BRG16 : 1;
1696 unsigned TXCKP : 1;
1697 unsigned RXDTP : 1;
1698 unsigned RCMT : 1;
1699 unsigned ABDOVF : 1;
1702 struct
1704 unsigned : 1;
1705 unsigned : 1;
1706 unsigned : 1;
1707 unsigned : 1;
1708 unsigned : 1;
1709 unsigned : 1;
1710 unsigned RCIDL : 1;
1711 unsigned : 1;
1713 } __BAUDCON1bits_t;
1715 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1717 #define _BAUDCON1_ABDEN 0x01
1718 #define _BAUDCON1_WUE 0x02
1719 #define _BAUDCON1_BRG16 0x08
1720 #define _BAUDCON1_TXCKP 0x10
1721 #define _BAUDCON1_RXDTP 0x20
1722 #define _BAUDCON1_RCMT 0x40
1723 #define _BAUDCON1_RCIDL 0x40
1724 #define _BAUDCON1_ABDOVF 0x80
1726 //==============================================================================
1728 extern __at(0x0F7F) __sfr SPBRGH;
1729 extern __at(0x0F7F) __sfr SPBRGH1;
1731 //==============================================================================
1732 // PORTA Bits
1734 extern __at(0x0F80) __sfr PORTA;
1736 typedef union
1738 struct
1740 unsigned RA0 : 1;
1741 unsigned RA1 : 1;
1742 unsigned RA2 : 1;
1743 unsigned RA3 : 1;
1744 unsigned RA4 : 1;
1745 unsigned RA5 : 1;
1746 unsigned RA6 : 1;
1747 unsigned RA7 : 1;
1750 struct
1752 unsigned AN0 : 1;
1753 unsigned AN1 : 1;
1754 unsigned AN2 : 1;
1755 unsigned AN3 : 1;
1756 unsigned TOCKI : 1;
1757 unsigned AN4 : 1;
1758 unsigned OSC2 : 1;
1759 unsigned OSC1 : 1;
1762 struct
1764 unsigned : 1;
1765 unsigned SEG18 : 1;
1766 unsigned VREFM : 1;
1767 unsigned VREFP : 1;
1768 unsigned SEG14 : 1;
1769 unsigned SEG15 : 1;
1770 unsigned CLKO : 1;
1771 unsigned CLKI : 1;
1773 } __PORTAbits_t;
1775 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1777 #define _RA0 0x01
1778 #define _AN0 0x01
1779 #define _RA1 0x02
1780 #define _AN1 0x02
1781 #define _SEG18 0x02
1782 #define _RA2 0x04
1783 #define _AN2 0x04
1784 #define _VREFM 0x04
1785 #define _RA3 0x08
1786 #define _AN3 0x08
1787 #define _VREFP 0x08
1788 #define _RA4 0x10
1789 #define _TOCKI 0x10
1790 #define _SEG14 0x10
1791 #define _RA5 0x20
1792 #define _AN4 0x20
1793 #define _SEG15 0x20
1794 #define _RA6 0x40
1795 #define _OSC2 0x40
1796 #define _CLKO 0x40
1797 #define _RA7 0x80
1798 #define _OSC1 0x80
1799 #define _CLKI 0x80
1801 //==============================================================================
1804 //==============================================================================
1805 // PORTB Bits
1807 extern __at(0x0F81) __sfr PORTB;
1809 typedef union
1811 struct
1813 unsigned RB0 : 1;
1814 unsigned RB1 : 1;
1815 unsigned RB2 : 1;
1816 unsigned RB3 : 1;
1817 unsigned RB4 : 1;
1818 unsigned RB5 : 1;
1819 unsigned RB6 : 1;
1820 unsigned RB7 : 1;
1823 struct
1825 unsigned INT0 : 1;
1826 unsigned INT1 : 1;
1827 unsigned INT2 : 1;
1828 unsigned INT3 : 1;
1829 unsigned KBI0 : 1;
1830 unsigned KBI1 : 1;
1831 unsigned KBI2 : 1;
1832 unsigned KBI3 : 1;
1835 struct
1837 unsigned SEG30 : 1;
1838 unsigned SEG8 : 1;
1839 unsigned SEG9 : 1;
1840 unsigned SEG10 : 1;
1841 unsigned SEG11 : 1;
1842 unsigned SEG29 : 1;
1843 unsigned PGC : 1;
1844 unsigned PGD : 1;
1847 struct
1849 unsigned : 1;
1850 unsigned : 1;
1851 unsigned CTED1 : 1;
1852 unsigned CTED2 : 1;
1853 unsigned : 1;
1854 unsigned : 1;
1855 unsigned : 1;
1856 unsigned : 1;
1859 struct
1861 unsigned INT : 4;
1862 unsigned : 4;
1865 struct
1867 unsigned : 4;
1868 unsigned KBI : 4;
1870 } __PORTBbits_t;
1872 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1874 #define _RB0 0x01
1875 #define _INT0 0x01
1876 #define _SEG30 0x01
1877 #define _RB1 0x02
1878 #define _INT1 0x02
1879 #define _SEG8 0x02
1880 #define _RB2 0x04
1881 #define _INT2 0x04
1882 #define _SEG9 0x04
1883 #define _CTED1 0x04
1884 #define _RB3 0x08
1885 #define _INT3 0x08
1886 #define _SEG10 0x08
1887 #define _CTED2 0x08
1888 #define _RB4 0x10
1889 #define _KBI0 0x10
1890 #define _SEG11 0x10
1891 #define _RB5 0x20
1892 #define _KBI1 0x20
1893 #define _SEG29 0x20
1894 #define _RB6 0x40
1895 #define _KBI2 0x40
1896 #define _PGC 0x40
1897 #define _RB7 0x80
1898 #define _KBI3 0x80
1899 #define _PGD 0x80
1901 //==============================================================================
1904 //==============================================================================
1905 // PORTC Bits
1907 extern __at(0x0F82) __sfr PORTC;
1909 typedef union
1911 struct
1913 unsigned RC0 : 1;
1914 unsigned RC1 : 1;
1915 unsigned RC2 : 1;
1916 unsigned RC3 : 1;
1917 unsigned RC4 : 1;
1918 unsigned RC5 : 1;
1919 unsigned RC6 : 1;
1920 unsigned RC7 : 1;
1923 struct
1925 unsigned T1OSO : 1;
1926 unsigned T1OSI : 1;
1927 unsigned CCP1 : 1;
1928 unsigned SCL : 1;
1929 unsigned SDA : 1;
1930 unsigned SDO : 1;
1931 unsigned CK1 : 1;
1932 unsigned DT1 : 1;
1935 struct
1937 unsigned T13CKI : 1;
1938 unsigned CCP2 : 1;
1939 unsigned SEG13 : 1;
1940 unsigned SCK : 1;
1941 unsigned SDI : 1;
1942 unsigned SEG12 : 1;
1943 unsigned TX1 : 1;
1944 unsigned RX1 : 1;
1947 struct
1949 unsigned : 1;
1950 unsigned SEG32 : 1;
1951 unsigned : 1;
1952 unsigned SEG17 : 1;
1953 unsigned SEG16 : 1;
1954 unsigned : 1;
1955 unsigned SEG27 : 1;
1956 unsigned SEG28 : 1;
1958 } __PORTCbits_t;
1960 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1962 #define _RC0 0x01
1963 #define _T1OSO 0x01
1964 #define _T13CKI 0x01
1965 #define _RC1 0x02
1966 #define _T1OSI 0x02
1967 #define _CCP2 0x02
1968 #define _SEG32 0x02
1969 #define _RC2 0x04
1970 #define _CCP1 0x04
1971 #define _SEG13 0x04
1972 #define _RC3 0x08
1973 #define _SCL 0x08
1974 #define _SCK 0x08
1975 #define _SEG17 0x08
1976 #define _RC4 0x10
1977 #define _SDA 0x10
1978 #define _SDI 0x10
1979 #define _SEG16 0x10
1980 #define _RC5 0x20
1981 #define _SDO 0x20
1982 #define _SEG12 0x20
1983 #define _RC6 0x40
1984 #define _CK1 0x40
1985 #define _TX1 0x40
1986 #define _SEG27 0x40
1987 #define _RC7 0x80
1988 #define _DT1 0x80
1989 #define _RX1 0x80
1990 #define _SEG28 0x80
1992 //==============================================================================
1995 //==============================================================================
1996 // PORTD Bits
1998 extern __at(0x0F83) __sfr PORTD;
2000 typedef union
2002 struct
2004 unsigned RD0 : 1;
2005 unsigned RD1 : 1;
2006 unsigned RD2 : 1;
2007 unsigned RD3 : 1;
2008 unsigned RD4 : 1;
2009 unsigned RD5 : 1;
2010 unsigned RD6 : 1;
2011 unsigned RD7 : 1;
2014 struct
2016 unsigned SEG0 : 1;
2017 unsigned SEG1 : 1;
2018 unsigned SEG2 : 1;
2019 unsigned SEG3 : 1;
2020 unsigned SEG4 : 1;
2021 unsigned SEG5 : 1;
2022 unsigned SEG6 : 1;
2023 unsigned SEG7 : 1;
2026 struct
2028 unsigned CTPLS : 1;
2029 unsigned : 1;
2030 unsigned : 1;
2031 unsigned : 1;
2032 unsigned : 1;
2033 unsigned : 1;
2034 unsigned : 1;
2035 unsigned : 1;
2037 } __PORTDbits_t;
2039 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
2041 #define _RD0 0x01
2042 #define _SEG0 0x01
2043 #define _CTPLS 0x01
2044 #define _RD1 0x02
2045 #define _SEG1 0x02
2046 #define _RD2 0x04
2047 #define _SEG2 0x04
2048 #define _RD3 0x08
2049 #define _SEG3 0x08
2050 #define _RD4 0x10
2051 #define _SEG4 0x10
2052 #define _RD5 0x20
2053 #define _SEG5 0x20
2054 #define _RD6 0x40
2055 #define _SEG6 0x40
2056 #define _RD7 0x80
2057 #define _SEG7 0x80
2059 //==============================================================================
2062 //==============================================================================
2063 // PORTE Bits
2065 extern __at(0x0F84) __sfr PORTE;
2067 typedef union
2069 struct
2071 unsigned RE0 : 1;
2072 unsigned RE1 : 1;
2073 unsigned : 1;
2074 unsigned RE3 : 1;
2075 unsigned RE4 : 1;
2076 unsigned RE5 : 1;
2077 unsigned RE6 : 1;
2078 unsigned RE7 : 1;
2081 struct
2083 unsigned LCDBIAS1 : 1;
2084 unsigned LCDBIAS2 : 1;
2085 unsigned : 1;
2086 unsigned COM0 : 1;
2087 unsigned COM1 : 1;
2088 unsigned COM2 : 1;
2089 unsigned COM3 : 1;
2090 unsigned CCP2 : 1;
2093 struct
2095 unsigned : 1;
2096 unsigned : 1;
2097 unsigned : 1;
2098 unsigned : 1;
2099 unsigned : 1;
2100 unsigned : 1;
2101 unsigned : 1;
2102 unsigned SEG31 : 1;
2105 struct
2107 unsigned : 3;
2108 unsigned COM : 4;
2109 unsigned : 1;
2111 } __PORTEbits_t;
2113 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
2115 #define _PORTE_RE0 0x01
2116 #define _PORTE_LCDBIAS1 0x01
2117 #define _PORTE_RE1 0x02
2118 #define _PORTE_LCDBIAS2 0x02
2119 #define _PORTE_RE3 0x08
2120 #define _PORTE_COM0 0x08
2121 #define _PORTE_RE4 0x10
2122 #define _PORTE_COM1 0x10
2123 #define _PORTE_RE5 0x20
2124 #define _PORTE_COM2 0x20
2125 #define _PORTE_RE6 0x40
2126 #define _PORTE_COM3 0x40
2127 #define _PORTE_RE7 0x80
2128 #define _PORTE_CCP2 0x80
2129 #define _PORTE_SEG31 0x80
2131 //==============================================================================
2134 //==============================================================================
2135 // PORTF Bits
2137 extern __at(0x0F85) __sfr PORTF;
2139 typedef union
2141 struct
2143 unsigned : 1;
2144 unsigned RF1 : 1;
2145 unsigned RF2 : 1;
2146 unsigned RF3 : 1;
2147 unsigned RF4 : 1;
2148 unsigned RF5 : 1;
2149 unsigned RF6 : 1;
2150 unsigned RF7 : 1;
2153 struct
2155 unsigned : 1;
2156 unsigned AN6 : 1;
2157 unsigned AN7 : 1;
2158 unsigned AN8 : 1;
2159 unsigned AN9 : 1;
2160 unsigned AN10 : 1;
2161 unsigned AN11 : 1;
2162 unsigned AN5 : 1;
2165 struct
2167 unsigned : 1;
2168 unsigned C2OUT : 1;
2169 unsigned C1OUT : 1;
2170 unsigned C2INB : 1;
2171 unsigned C2INA : 1;
2172 unsigned C1INB : 1;
2173 unsigned C1INA : 1;
2174 unsigned SS1 : 1;
2177 struct
2179 unsigned : 1;
2180 unsigned SEG19 : 1;
2181 unsigned SEG20 : 1;
2182 unsigned SEG21 : 1;
2183 unsigned SEG22 : 1;
2184 unsigned SEG23 : 1;
2185 unsigned SEG24 : 1;
2186 unsigned SEG25 : 1;
2189 struct
2191 unsigned : 1;
2192 unsigned : 1;
2193 unsigned : 1;
2194 unsigned : 1;
2195 unsigned : 1;
2196 unsigned CVREF : 1;
2197 unsigned : 1;
2198 unsigned : 1;
2200 } __PORTFbits_t;
2202 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
2204 #define _PORTF_RF1 0x02
2205 #define _PORTF_AN6 0x02
2206 #define _PORTF_C2OUT 0x02
2207 #define _PORTF_SEG19 0x02
2208 #define _PORTF_RF2 0x04
2209 #define _PORTF_AN7 0x04
2210 #define _PORTF_C1OUT 0x04
2211 #define _PORTF_SEG20 0x04
2212 #define _PORTF_RF3 0x08
2213 #define _PORTF_AN8 0x08
2214 #define _PORTF_C2INB 0x08
2215 #define _PORTF_SEG21 0x08
2216 #define _PORTF_RF4 0x10
2217 #define _PORTF_AN9 0x10
2218 #define _PORTF_C2INA 0x10
2219 #define _PORTF_SEG22 0x10
2220 #define _PORTF_RF5 0x20
2221 #define _PORTF_AN10 0x20
2222 #define _PORTF_C1INB 0x20
2223 #define _PORTF_SEG23 0x20
2224 #define _PORTF_CVREF 0x20
2225 #define _PORTF_RF6 0x40
2226 #define _PORTF_AN11 0x40
2227 #define _PORTF_C1INA 0x40
2228 #define _PORTF_SEG24 0x40
2229 #define _PORTF_RF7 0x80
2230 #define _PORTF_AN5 0x80
2231 #define _PORTF_SS1 0x80
2232 #define _PORTF_SEG25 0x80
2234 //==============================================================================
2237 //==============================================================================
2238 // PORTG Bits
2240 extern __at(0x0F86) __sfr PORTG;
2242 typedef union
2244 struct
2246 unsigned RG0 : 1;
2247 unsigned RG1 : 1;
2248 unsigned RG2 : 1;
2249 unsigned RG3 : 1;
2250 unsigned RG4 : 1;
2251 unsigned RJPU : 1;
2252 unsigned REPU : 1;
2253 unsigned RDPU : 1;
2256 struct
2258 unsigned LCDBIAS0 : 1;
2259 unsigned CK2 : 1;
2260 unsigned DT2 : 1;
2261 unsigned VLCAP2 : 1;
2262 unsigned SEG26 : 1;
2263 unsigned : 1;
2264 unsigned : 1;
2265 unsigned : 1;
2268 struct
2270 unsigned : 1;
2271 unsigned TX2 : 1;
2272 unsigned RX2 : 1;
2273 unsigned : 1;
2274 unsigned RTCC : 1;
2275 unsigned : 1;
2276 unsigned : 1;
2277 unsigned : 1;
2280 struct
2282 unsigned : 1;
2283 unsigned : 1;
2284 unsigned VLCAP1 : 1;
2285 unsigned : 1;
2286 unsigned : 1;
2287 unsigned : 1;
2288 unsigned : 1;
2289 unsigned : 1;
2292 struct
2294 unsigned RG : 5;
2295 unsigned : 3;
2297 } __PORTGbits_t;
2299 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
2301 #define _RG0 0x01
2302 #define _LCDBIAS0 0x01
2303 #define _RG1 0x02
2304 #define _CK2 0x02
2305 #define _TX2 0x02
2306 #define _RG2 0x04
2307 #define _DT2 0x04
2308 #define _RX2 0x04
2309 #define _VLCAP1 0x04
2310 #define _RG3 0x08
2311 #define _VLCAP2 0x08
2312 #define _RG4 0x10
2313 #define _SEG26 0x10
2314 #define _RTCC 0x10
2315 #define _RJPU 0x20
2316 #define _REPU 0x40
2317 #define _RDPU 0x80
2319 //==============================================================================
2322 //==============================================================================
2323 // LATA Bits
2325 extern __at(0x0F89) __sfr LATA;
2327 typedef struct
2329 unsigned LATA0 : 1;
2330 unsigned LATA1 : 1;
2331 unsigned LATA2 : 1;
2332 unsigned LATA3 : 1;
2333 unsigned LATA4 : 1;
2334 unsigned LATA5 : 1;
2335 unsigned LATA6 : 1;
2336 unsigned LATA7 : 1;
2337 } __LATAbits_t;
2339 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2341 #define _LATA0 0x01
2342 #define _LATA1 0x02
2343 #define _LATA2 0x04
2344 #define _LATA3 0x08
2345 #define _LATA4 0x10
2346 #define _LATA5 0x20
2347 #define _LATA6 0x40
2348 #define _LATA7 0x80
2350 //==============================================================================
2353 //==============================================================================
2354 // LATB Bits
2356 extern __at(0x0F8A) __sfr LATB;
2358 typedef struct
2360 unsigned LATB0 : 1;
2361 unsigned LATB1 : 1;
2362 unsigned LATB2 : 1;
2363 unsigned LATB3 : 1;
2364 unsigned LATB4 : 1;
2365 unsigned LATB5 : 1;
2366 unsigned LATB6 : 1;
2367 unsigned LATB7 : 1;
2368 } __LATBbits_t;
2370 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2372 #define _LATB0 0x01
2373 #define _LATB1 0x02
2374 #define _LATB2 0x04
2375 #define _LATB3 0x08
2376 #define _LATB4 0x10
2377 #define _LATB5 0x20
2378 #define _LATB6 0x40
2379 #define _LATB7 0x80
2381 //==============================================================================
2384 //==============================================================================
2385 // LATC Bits
2387 extern __at(0x0F8B) __sfr LATC;
2389 typedef struct
2391 unsigned LATC0 : 1;
2392 unsigned LATC1 : 1;
2393 unsigned LATC2 : 1;
2394 unsigned LATC3 : 1;
2395 unsigned LATC4 : 1;
2396 unsigned LATC5 : 1;
2397 unsigned LATC6 : 1;
2398 unsigned LATC7 : 1;
2399 } __LATCbits_t;
2401 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2403 #define _LATC0 0x01
2404 #define _LATC1 0x02
2405 #define _LATC2 0x04
2406 #define _LATC3 0x08
2407 #define _LATC4 0x10
2408 #define _LATC5 0x20
2409 #define _LATC6 0x40
2410 #define _LATC7 0x80
2412 //==============================================================================
2415 //==============================================================================
2416 // LATD Bits
2418 extern __at(0x0F8C) __sfr LATD;
2420 typedef struct
2422 unsigned LATD0 : 1;
2423 unsigned LATD1 : 1;
2424 unsigned LATD2 : 1;
2425 unsigned LATD3 : 1;
2426 unsigned LATD4 : 1;
2427 unsigned LATD5 : 1;
2428 unsigned LATD6 : 1;
2429 unsigned LATD7 : 1;
2430 } __LATDbits_t;
2432 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2434 #define _LATD0 0x01
2435 #define _LATD1 0x02
2436 #define _LATD2 0x04
2437 #define _LATD3 0x08
2438 #define _LATD4 0x10
2439 #define _LATD5 0x20
2440 #define _LATD6 0x40
2441 #define _LATD7 0x80
2443 //==============================================================================
2446 //==============================================================================
2447 // LATE Bits
2449 extern __at(0x0F8D) __sfr LATE;
2451 typedef struct
2453 unsigned LATE0 : 1;
2454 unsigned LATE1 : 1;
2455 unsigned : 1;
2456 unsigned LATE3 : 1;
2457 unsigned LATE4 : 1;
2458 unsigned LATE5 : 1;
2459 unsigned LATE6 : 1;
2460 unsigned LATE7 : 1;
2461 } __LATEbits_t;
2463 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2465 #define _LATE0 0x01
2466 #define _LATE1 0x02
2467 #define _LATE3 0x08
2468 #define _LATE4 0x10
2469 #define _LATE5 0x20
2470 #define _LATE6 0x40
2471 #define _LATE7 0x80
2473 //==============================================================================
2476 //==============================================================================
2477 // LATF Bits
2479 extern __at(0x0F8E) __sfr LATF;
2481 typedef struct
2483 unsigned : 1;
2484 unsigned LATF1 : 1;
2485 unsigned LATF2 : 1;
2486 unsigned LATF3 : 1;
2487 unsigned LATF4 : 1;
2488 unsigned LATF5 : 1;
2489 unsigned LATF6 : 1;
2490 unsigned LATF7 : 1;
2491 } __LATFbits_t;
2493 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
2495 #define _LATF1 0x02
2496 #define _LATF2 0x04
2497 #define _LATF3 0x08
2498 #define _LATF4 0x10
2499 #define _LATF5 0x20
2500 #define _LATF6 0x40
2501 #define _LATF7 0x80
2503 //==============================================================================
2506 //==============================================================================
2507 // LATG Bits
2509 extern __at(0x0F8F) __sfr LATG;
2511 typedef union
2513 struct
2515 unsigned LATG0 : 1;
2516 unsigned LATG1 : 1;
2517 unsigned LATG2 : 1;
2518 unsigned LATG3 : 1;
2519 unsigned LATG4 : 1;
2520 unsigned : 1;
2521 unsigned U1OD : 1;
2522 unsigned U2OD : 1;
2525 struct
2527 unsigned LATG : 5;
2528 unsigned : 3;
2530 } __LATGbits_t;
2532 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2534 #define _LATG0 0x01
2535 #define _LATG1 0x02
2536 #define _LATG2 0x04
2537 #define _LATG3 0x08
2538 #define _LATG4 0x10
2539 #define _U1OD 0x40
2540 #define _U2OD 0x80
2542 //==============================================================================
2545 //==============================================================================
2546 // TRISA Bits
2548 extern __at(0x0F92) __sfr TRISA;
2550 typedef struct
2552 unsigned TRISA0 : 1;
2553 unsigned TRISA1 : 1;
2554 unsigned TRISA2 : 1;
2555 unsigned TRISA3 : 1;
2556 unsigned TRISA4 : 1;
2557 unsigned TRISA5 : 1;
2558 unsigned TRISA6 : 1;
2559 unsigned TRISA7 : 1;
2560 } __TRISAbits_t;
2562 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2564 #define _TRISA0 0x01
2565 #define _TRISA1 0x02
2566 #define _TRISA2 0x04
2567 #define _TRISA3 0x08
2568 #define _TRISA4 0x10
2569 #define _TRISA5 0x20
2570 #define _TRISA6 0x40
2571 #define _TRISA7 0x80
2573 //==============================================================================
2576 //==============================================================================
2577 // TRISB Bits
2579 extern __at(0x0F93) __sfr TRISB;
2581 typedef struct
2583 unsigned TRISB0 : 1;
2584 unsigned TRISB1 : 1;
2585 unsigned TRISB2 : 1;
2586 unsigned TRISB3 : 1;
2587 unsigned TRISB4 : 1;
2588 unsigned TRISB5 : 1;
2589 unsigned TRISB6 : 1;
2590 unsigned TRISB7 : 1;
2591 } __TRISBbits_t;
2593 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2595 #define _TRISB0 0x01
2596 #define _TRISB1 0x02
2597 #define _TRISB2 0x04
2598 #define _TRISB3 0x08
2599 #define _TRISB4 0x10
2600 #define _TRISB5 0x20
2601 #define _TRISB6 0x40
2602 #define _TRISB7 0x80
2604 //==============================================================================
2607 //==============================================================================
2608 // TRISC Bits
2610 extern __at(0x0F94) __sfr TRISC;
2612 typedef struct
2614 unsigned TRISC0 : 1;
2615 unsigned TRISC1 : 1;
2616 unsigned TRISC2 : 1;
2617 unsigned TRISC3 : 1;
2618 unsigned TRISC4 : 1;
2619 unsigned TRISC5 : 1;
2620 unsigned TRISC6 : 1;
2621 unsigned TRISC7 : 1;
2622 } __TRISCbits_t;
2624 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2626 #define _TRISC0 0x01
2627 #define _TRISC1 0x02
2628 #define _TRISC2 0x04
2629 #define _TRISC3 0x08
2630 #define _TRISC4 0x10
2631 #define _TRISC5 0x20
2632 #define _TRISC6 0x40
2633 #define _TRISC7 0x80
2635 //==============================================================================
2638 //==============================================================================
2639 // TRISD Bits
2641 extern __at(0x0F95) __sfr TRISD;
2643 typedef struct
2645 unsigned TRISD0 : 1;
2646 unsigned TRISD1 : 1;
2647 unsigned TRISD2 : 1;
2648 unsigned TRISD3 : 1;
2649 unsigned TRISD4 : 1;
2650 unsigned TRISD5 : 1;
2651 unsigned TRISD6 : 1;
2652 unsigned TRISD7 : 1;
2653 } __TRISDbits_t;
2655 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2657 #define _TRISD0 0x01
2658 #define _TRISD1 0x02
2659 #define _TRISD2 0x04
2660 #define _TRISD3 0x08
2661 #define _TRISD4 0x10
2662 #define _TRISD5 0x20
2663 #define _TRISD6 0x40
2664 #define _TRISD7 0x80
2666 //==============================================================================
2669 //==============================================================================
2670 // TRISE Bits
2672 extern __at(0x0F96) __sfr TRISE;
2674 typedef struct
2676 unsigned TRISE0 : 1;
2677 unsigned TRISE1 : 1;
2678 unsigned : 1;
2679 unsigned TRISE3 : 1;
2680 unsigned TRISE4 : 1;
2681 unsigned TRISE5 : 1;
2682 unsigned TRISE6 : 1;
2683 unsigned TRISE7 : 1;
2684 } __TRISEbits_t;
2686 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2688 #define _TRISE0 0x01
2689 #define _TRISE1 0x02
2690 #define _TRISE3 0x08
2691 #define _TRISE4 0x10
2692 #define _TRISE5 0x20
2693 #define _TRISE6 0x40
2694 #define _TRISE7 0x80
2696 //==============================================================================
2699 //==============================================================================
2700 // TRISF Bits
2702 extern __at(0x0F97) __sfr TRISF;
2704 typedef struct
2706 unsigned : 1;
2707 unsigned TRISF1 : 1;
2708 unsigned TRISF2 : 1;
2709 unsigned TRISF3 : 1;
2710 unsigned TRISF4 : 1;
2711 unsigned TRISF5 : 1;
2712 unsigned TRISF6 : 1;
2713 unsigned TRISF7 : 1;
2714 } __TRISFbits_t;
2716 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
2718 #define _TRISF1 0x02
2719 #define _TRISF2 0x04
2720 #define _TRISF3 0x08
2721 #define _TRISF4 0x10
2722 #define _TRISF5 0x20
2723 #define _TRISF6 0x40
2724 #define _TRISF7 0x80
2726 //==============================================================================
2729 //==============================================================================
2730 // TRISG Bits
2732 extern __at(0x0F98) __sfr TRISG;
2734 typedef union
2736 struct
2738 unsigned TRISG0 : 1;
2739 unsigned TRISG1 : 1;
2740 unsigned TRISG2 : 1;
2741 unsigned TRISG3 : 1;
2742 unsigned TRISG4 : 1;
2743 unsigned CCP1OD : 1;
2744 unsigned CCP2OD : 1;
2745 unsigned SPIOD : 1;
2748 struct
2750 unsigned TRISG : 5;
2751 unsigned : 3;
2753 } __TRISGbits_t;
2755 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
2757 #define _TRISG0 0x01
2758 #define _TRISG1 0x02
2759 #define _TRISG2 0x04
2760 #define _TRISG3 0x08
2761 #define _TRISG4 0x10
2762 #define _CCP1OD 0x20
2763 #define _CCP2OD 0x40
2764 #define _SPIOD 0x80
2766 //==============================================================================
2769 //==============================================================================
2770 // OSCTUNE Bits
2772 extern __at(0x0F9B) __sfr OSCTUNE;
2774 typedef union
2776 struct
2778 unsigned TUN0 : 1;
2779 unsigned TUN1 : 1;
2780 unsigned TUN2 : 1;
2781 unsigned TUN3 : 1;
2782 unsigned TUN4 : 1;
2783 unsigned TUN5 : 1;
2784 unsigned PLLEN : 1;
2785 unsigned INTSRC : 1;
2788 struct
2790 unsigned TUN : 6;
2791 unsigned : 2;
2793 } __OSCTUNEbits_t;
2795 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2797 #define _TUN0 0x01
2798 #define _TUN1 0x02
2799 #define _TUN2 0x04
2800 #define _TUN3 0x08
2801 #define _TUN4 0x10
2802 #define _TUN5 0x20
2803 #define _PLLEN 0x40
2804 #define _INTSRC 0x80
2806 //==============================================================================
2809 //==============================================================================
2810 // PIE1 Bits
2812 extern __at(0x0F9D) __sfr PIE1;
2814 typedef union
2816 struct
2818 unsigned TMR1IE : 1;
2819 unsigned TMR2IE : 1;
2820 unsigned : 1;
2821 unsigned SSPIE : 1;
2822 unsigned TX1IE : 1;
2823 unsigned RC1IE : 1;
2824 unsigned ADIE : 1;
2825 unsigned : 1;
2828 struct
2830 unsigned : 1;
2831 unsigned : 1;
2832 unsigned : 1;
2833 unsigned SSP1IE : 1;
2834 unsigned TXIE : 1;
2835 unsigned RCIE : 1;
2836 unsigned : 1;
2837 unsigned : 1;
2839 } __PIE1bits_t;
2841 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
2843 #define _TMR1IE 0x01
2844 #define _TMR2IE 0x02
2845 #define _SSPIE 0x08
2846 #define _SSP1IE 0x08
2847 #define _TX1IE 0x10
2848 #define _TXIE 0x10
2849 #define _RC1IE 0x20
2850 #define _RCIE 0x20
2851 #define _ADIE 0x40
2853 //==============================================================================
2856 //==============================================================================
2857 // PIR1 Bits
2859 extern __at(0x0F9E) __sfr PIR1;
2861 typedef union
2863 struct
2865 unsigned TMR1IF : 1;
2866 unsigned TMR2IF : 1;
2867 unsigned : 1;
2868 unsigned SSPIF : 1;
2869 unsigned TX1IF : 1;
2870 unsigned RC1IF : 1;
2871 unsigned ADIF : 1;
2872 unsigned : 1;
2875 struct
2877 unsigned : 1;
2878 unsigned : 1;
2879 unsigned : 1;
2880 unsigned SSP1IF : 1;
2881 unsigned TXIF : 1;
2882 unsigned RCIF : 1;
2883 unsigned : 1;
2884 unsigned : 1;
2886 } __PIR1bits_t;
2888 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2890 #define _TMR1IF 0x01
2891 #define _TMR2IF 0x02
2892 #define _SSPIF 0x08
2893 #define _SSP1IF 0x08
2894 #define _TX1IF 0x10
2895 #define _TXIF 0x10
2896 #define _RC1IF 0x20
2897 #define _RCIF 0x20
2898 #define _ADIF 0x40
2900 //==============================================================================
2903 //==============================================================================
2904 // IPR1 Bits
2906 extern __at(0x0F9F) __sfr IPR1;
2908 typedef union
2910 struct
2912 unsigned TMR1IP : 1;
2913 unsigned TMR2IP : 1;
2914 unsigned : 1;
2915 unsigned SSPIP : 1;
2916 unsigned TX1IP : 1;
2917 unsigned RC1IP : 1;
2918 unsigned ADIP : 1;
2919 unsigned : 1;
2922 struct
2924 unsigned : 1;
2925 unsigned : 1;
2926 unsigned : 1;
2927 unsigned SSP1IP : 1;
2928 unsigned TXIP : 1;
2929 unsigned RCIP : 1;
2930 unsigned : 1;
2931 unsigned : 1;
2933 } __IPR1bits_t;
2935 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2937 #define _TMR1IP 0x01
2938 #define _TMR2IP 0x02
2939 #define _SSPIP 0x08
2940 #define _SSP1IP 0x08
2941 #define _TX1IP 0x10
2942 #define _TXIP 0x10
2943 #define _RC1IP 0x20
2944 #define _RCIP 0x20
2945 #define _ADIP 0x40
2947 //==============================================================================
2950 //==============================================================================
2951 // PIE2 Bits
2953 extern __at(0x0FA0) __sfr PIE2;
2955 typedef union
2957 struct
2959 unsigned : 1;
2960 unsigned TMR3IE : 1;
2961 unsigned LVDIE : 1;
2962 unsigned BCLIE : 1;
2963 unsigned : 1;
2964 unsigned : 1;
2965 unsigned CMIE : 1;
2966 unsigned OSCFIE : 1;
2969 struct
2971 unsigned : 1;
2972 unsigned : 1;
2973 unsigned : 1;
2974 unsigned BCL1IE : 1;
2975 unsigned : 1;
2976 unsigned : 1;
2977 unsigned : 1;
2978 unsigned : 1;
2980 } __PIE2bits_t;
2982 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2984 #define _TMR3IE 0x02
2985 #define _LVDIE 0x04
2986 #define _BCLIE 0x08
2987 #define _BCL1IE 0x08
2988 #define _CMIE 0x40
2989 #define _OSCFIE 0x80
2991 //==============================================================================
2994 //==============================================================================
2995 // PIR2 Bits
2997 extern __at(0x0FA1) __sfr PIR2;
2999 typedef union
3001 struct
3003 unsigned : 1;
3004 unsigned TMR3IF : 1;
3005 unsigned LVDIF : 1;
3006 unsigned BCLIF : 1;
3007 unsigned : 1;
3008 unsigned : 1;
3009 unsigned CMIF : 1;
3010 unsigned OSCFIF : 1;
3013 struct
3015 unsigned : 1;
3016 unsigned : 1;
3017 unsigned : 1;
3018 unsigned BCL1IF : 1;
3019 unsigned : 1;
3020 unsigned : 1;
3021 unsigned : 1;
3022 unsigned : 1;
3024 } __PIR2bits_t;
3026 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3028 #define _TMR3IF 0x02
3029 #define _LVDIF 0x04
3030 #define _BCLIF 0x08
3031 #define _BCL1IF 0x08
3032 #define _CMIF 0x40
3033 #define _OSCFIF 0x80
3035 //==============================================================================
3038 //==============================================================================
3039 // IPR2 Bits
3041 extern __at(0x0FA2) __sfr IPR2;
3043 typedef union
3045 struct
3047 unsigned : 1;
3048 unsigned TMR3IP : 1;
3049 unsigned LVDIP : 1;
3050 unsigned BCLIP : 1;
3051 unsigned : 1;
3052 unsigned : 1;
3053 unsigned CMIP : 1;
3054 unsigned OSCFIP : 1;
3057 struct
3059 unsigned : 1;
3060 unsigned : 1;
3061 unsigned : 1;
3062 unsigned BCL1IP : 1;
3063 unsigned : 1;
3064 unsigned : 1;
3065 unsigned : 1;
3066 unsigned : 1;
3068 } __IPR2bits_t;
3070 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3072 #define _TMR3IP 0x02
3073 #define _LVDIP 0x04
3074 #define _BCLIP 0x08
3075 #define _BCL1IP 0x08
3076 #define _CMIP 0x40
3077 #define _OSCFIP 0x80
3079 //==============================================================================
3082 //==============================================================================
3083 // PIE3 Bits
3085 extern __at(0x0FA3) __sfr PIE3;
3087 typedef struct
3089 unsigned RTCCIE : 1;
3090 unsigned CCP1IE : 1;
3091 unsigned CCP2IE : 1;
3092 unsigned CTMUIE : 1;
3093 unsigned TX2IE : 1;
3094 unsigned RC2IE : 1;
3095 unsigned LCDIE : 1;
3096 unsigned : 1;
3097 } __PIE3bits_t;
3099 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3101 #define _RTCCIE 0x01
3102 #define _CCP1IE 0x02
3103 #define _CCP2IE 0x04
3104 #define _CTMUIE 0x08
3105 #define _TX2IE 0x10
3106 #define _RC2IE 0x20
3107 #define _LCDIE 0x40
3109 //==============================================================================
3112 //==============================================================================
3113 // PIR3 Bits
3115 extern __at(0x0FA4) __sfr PIR3;
3117 typedef struct
3119 unsigned RTCCIF : 1;
3120 unsigned CCP1IF : 1;
3121 unsigned CCP2IF : 1;
3122 unsigned CTMUIF : 1;
3123 unsigned TX2IF : 1;
3124 unsigned RC2IF : 1;
3125 unsigned LCDIF : 1;
3126 unsigned : 1;
3127 } __PIR3bits_t;
3129 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3131 #define _RTCCIF 0x01
3132 #define _CCP1IF 0x02
3133 #define _CCP2IF 0x04
3134 #define _CTMUIF 0x08
3135 #define _TX2IF 0x10
3136 #define _RC2IF 0x20
3137 #define _LCDIF 0x40
3139 //==============================================================================
3142 //==============================================================================
3143 // IPR3 Bits
3145 extern __at(0x0FA5) __sfr IPR3;
3147 typedef struct
3149 unsigned RTCCIP : 1;
3150 unsigned CCP1IP : 1;
3151 unsigned CCP2IP : 1;
3152 unsigned CTMUIP : 1;
3153 unsigned TX2IP : 1;
3154 unsigned RC2IP : 1;
3155 unsigned LCDIP : 1;
3156 unsigned : 1;
3157 } __IPR3bits_t;
3159 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3161 #define _RTCCIP 0x01
3162 #define _CCP1IP 0x02
3163 #define _CCP2IP 0x04
3164 #define _CTMUIP 0x08
3165 #define _TX2IP 0x10
3166 #define _RC2IP 0x20
3167 #define _LCDIP 0x40
3169 //==============================================================================
3172 //==============================================================================
3173 // EECON1 Bits
3175 extern __at(0x0FA6) __sfr EECON1;
3177 typedef struct
3179 unsigned : 1;
3180 unsigned WR : 1;
3181 unsigned WREN : 1;
3182 unsigned WRERR : 1;
3183 unsigned FREE : 1;
3184 unsigned WPROG : 1;
3185 unsigned : 1;
3186 unsigned : 1;
3187 } __EECON1bits_t;
3189 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3191 #define _WR 0x02
3192 #define _WREN 0x04
3193 #define _WRERR 0x08
3194 #define _FREE 0x10
3195 #define _WPROG 0x20
3197 //==============================================================================
3199 extern __at(0x0FA7) __sfr EECON2;
3201 //==============================================================================
3202 // LCDCON Bits
3204 extern __at(0x0FA8) __sfr LCDCON;
3206 typedef union
3208 struct
3210 unsigned LMUX0 : 1;
3211 unsigned LMUX1 : 1;
3212 unsigned CS0 : 1;
3213 unsigned CS1 : 1;
3214 unsigned : 1;
3215 unsigned WERR : 1;
3216 unsigned SLPEN : 1;
3217 unsigned LCDEN : 1;
3220 struct
3222 unsigned : 1;
3223 unsigned : 1;
3224 unsigned LCDCS0 : 1;
3225 unsigned LCDCS1 : 1;
3226 unsigned : 1;
3227 unsigned LCDWERR : 1;
3228 unsigned LCDSLPEN : 1;
3229 unsigned : 1;
3232 struct
3234 unsigned LMUX : 2;
3235 unsigned : 6;
3238 struct
3240 unsigned : 2;
3241 unsigned CS : 2;
3242 unsigned : 4;
3245 struct
3247 unsigned : 2;
3248 unsigned LCDCS : 2;
3249 unsigned : 4;
3251 } __LCDCONbits_t;
3253 extern __at(0x0FA8) volatile __LCDCONbits_t LCDCONbits;
3255 #define _LMUX0 0x01
3256 #define _LMUX1 0x02
3257 #define _CS0 0x04
3258 #define _LCDCS0 0x04
3259 #define _CS1 0x08
3260 #define _LCDCS1 0x08
3261 #define _WERR 0x20
3262 #define _LCDWERR 0x20
3263 #define _SLPEN 0x40
3264 #define _LCDSLPEN 0x40
3265 #define _LCDEN 0x80
3267 //==============================================================================
3270 //==============================================================================
3271 // LCDSE0 Bits
3273 extern __at(0x0FA9) __sfr LCDSE0;
3275 typedef union
3277 struct
3279 unsigned SE0 : 1;
3280 unsigned SE1 : 1;
3281 unsigned SE2 : 1;
3282 unsigned SE3 : 1;
3283 unsigned SE4 : 1;
3284 unsigned SE5 : 1;
3285 unsigned SE6 : 1;
3286 unsigned SE7 : 1;
3289 struct
3291 unsigned SEGEN0 : 1;
3292 unsigned SEGEN1 : 1;
3293 unsigned SEGEN2 : 1;
3294 unsigned SEGEN3 : 1;
3295 unsigned SEGEN4 : 1;
3296 unsigned SEGEN5 : 1;
3297 unsigned SEGEN6 : 1;
3298 unsigned SEGEN7 : 1;
3301 struct
3303 unsigned SE00 : 1;
3304 unsigned SE01 : 1;
3305 unsigned SE02 : 1;
3306 unsigned SE03 : 1;
3307 unsigned SE04 : 1;
3308 unsigned SE05 : 1;
3309 unsigned SE06 : 1;
3310 unsigned SE07 : 1;
3312 } __LCDSE0bits_t;
3314 extern __at(0x0FA9) volatile __LCDSE0bits_t LCDSE0bits;
3316 #define _SE0 0x01
3317 #define _SEGEN0 0x01
3318 #define _SE00 0x01
3319 #define _SE1 0x02
3320 #define _SEGEN1 0x02
3321 #define _SE01 0x02
3322 #define _SE2 0x04
3323 #define _SEGEN2 0x04
3324 #define _SE02 0x04
3325 #define _SE3 0x08
3326 #define _SEGEN3 0x08
3327 #define _SE03 0x08
3328 #define _SE4 0x10
3329 #define _SEGEN4 0x10
3330 #define _SE04 0x10
3331 #define _SE5 0x20
3332 #define _SEGEN5 0x20
3333 #define _SE05 0x20
3334 #define _SE6 0x40
3335 #define _SEGEN6 0x40
3336 #define _SE06 0x40
3337 #define _SE7 0x80
3338 #define _SEGEN7 0x80
3339 #define _SE07 0x80
3341 //==============================================================================
3344 //==============================================================================
3345 // LCDPS Bits
3347 extern __at(0x0FAA) __sfr LCDPS;
3349 typedef union
3351 struct
3353 unsigned LP0 : 1;
3354 unsigned LP1 : 1;
3355 unsigned LP2 : 1;
3356 unsigned LP3 : 1;
3357 unsigned WA : 1;
3358 unsigned LCDA : 1;
3359 unsigned BIASMD : 1;
3360 unsigned WFT : 1;
3363 struct
3365 unsigned LCDPS0 : 1;
3366 unsigned LCDPS1 : 1;
3367 unsigned LCDPS2 : 1;
3368 unsigned LCDPS3 : 1;
3369 unsigned : 1;
3370 unsigned : 1;
3371 unsigned : 1;
3372 unsigned : 1;
3375 struct
3377 unsigned LP : 4;
3378 unsigned : 4;
3381 struct
3383 unsigned LCDPS : 4;
3384 unsigned : 4;
3386 } __LCDPSbits_t;
3388 extern __at(0x0FAA) volatile __LCDPSbits_t LCDPSbits;
3390 #define _LP0 0x01
3391 #define _LCDPS0 0x01
3392 #define _LP1 0x02
3393 #define _LCDPS1 0x02
3394 #define _LP2 0x04
3395 #define _LCDPS2 0x04
3396 #define _LP3 0x08
3397 #define _LCDPS3 0x08
3398 #define _WA 0x10
3399 #define _LCDA 0x20
3400 #define _BIASMD 0x40
3401 #define _WFT 0x80
3403 //==============================================================================
3406 //==============================================================================
3407 // RCSTA Bits
3409 extern __at(0x0FAB) __sfr RCSTA;
3411 typedef union
3413 struct
3415 unsigned RX9D : 1;
3416 unsigned OERR : 1;
3417 unsigned FERR : 1;
3418 unsigned ADDEN : 1;
3419 unsigned CREN : 1;
3420 unsigned SREN : 1;
3421 unsigned RX9 : 1;
3422 unsigned SPEN : 1;
3425 struct
3427 unsigned RCD8 : 1;
3428 unsigned OERR1 : 1;
3429 unsigned FERR1 : 1;
3430 unsigned ADEN : 1;
3431 unsigned CREN1 : 1;
3432 unsigned SREN1 : 1;
3433 unsigned RC9 : 1;
3434 unsigned SPEN1 : 1;
3437 struct
3439 unsigned RX9D1 : 1;
3440 unsigned : 1;
3441 unsigned : 1;
3442 unsigned ADDEN1 : 1;
3443 unsigned : 1;
3444 unsigned : 1;
3445 unsigned NOT_RC8 : 1;
3446 unsigned : 1;
3449 struct
3451 unsigned : 1;
3452 unsigned : 1;
3453 unsigned : 1;
3454 unsigned : 1;
3455 unsigned : 1;
3456 unsigned : 1;
3457 unsigned RC8_9 : 1;
3458 unsigned : 1;
3461 struct
3463 unsigned : 1;
3464 unsigned : 1;
3465 unsigned : 1;
3466 unsigned : 1;
3467 unsigned : 1;
3468 unsigned : 1;
3469 unsigned RX91 : 1;
3470 unsigned : 1;
3472 } __RCSTAbits_t;
3474 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3476 #define _RX9D 0x01
3477 #define _RCD8 0x01
3478 #define _RX9D1 0x01
3479 #define _OERR 0x02
3480 #define _OERR1 0x02
3481 #define _FERR 0x04
3482 #define _FERR1 0x04
3483 #define _ADDEN 0x08
3484 #define _ADEN 0x08
3485 #define _ADDEN1 0x08
3486 #define _CREN 0x10
3487 #define _CREN1 0x10
3488 #define _SREN 0x20
3489 #define _SREN1 0x20
3490 #define _RX9 0x40
3491 #define _RC9 0x40
3492 #define _NOT_RC8 0x40
3493 #define _RC8_9 0x40
3494 #define _RX91 0x40
3495 #define _SPEN 0x80
3496 #define _SPEN1 0x80
3498 //==============================================================================
3501 //==============================================================================
3502 // RCSTA1 Bits
3504 extern __at(0x0FAB) __sfr RCSTA1;
3506 typedef union
3508 struct
3510 unsigned RX9D : 1;
3511 unsigned OERR : 1;
3512 unsigned FERR : 1;
3513 unsigned ADDEN : 1;
3514 unsigned CREN : 1;
3515 unsigned SREN : 1;
3516 unsigned RX9 : 1;
3517 unsigned SPEN : 1;
3520 struct
3522 unsigned RCD8 : 1;
3523 unsigned OERR1 : 1;
3524 unsigned FERR1 : 1;
3525 unsigned ADEN : 1;
3526 unsigned CREN1 : 1;
3527 unsigned SREN1 : 1;
3528 unsigned RC9 : 1;
3529 unsigned SPEN1 : 1;
3532 struct
3534 unsigned RX9D1 : 1;
3535 unsigned : 1;
3536 unsigned : 1;
3537 unsigned ADDEN1 : 1;
3538 unsigned : 1;
3539 unsigned : 1;
3540 unsigned NOT_RC8 : 1;
3541 unsigned : 1;
3544 struct
3546 unsigned : 1;
3547 unsigned : 1;
3548 unsigned : 1;
3549 unsigned : 1;
3550 unsigned : 1;
3551 unsigned : 1;
3552 unsigned RC8_9 : 1;
3553 unsigned : 1;
3556 struct
3558 unsigned : 1;
3559 unsigned : 1;
3560 unsigned : 1;
3561 unsigned : 1;
3562 unsigned : 1;
3563 unsigned : 1;
3564 unsigned RX91 : 1;
3565 unsigned : 1;
3567 } __RCSTA1bits_t;
3569 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
3571 #define _RCSTA1_RX9D 0x01
3572 #define _RCSTA1_RCD8 0x01
3573 #define _RCSTA1_RX9D1 0x01
3574 #define _RCSTA1_OERR 0x02
3575 #define _RCSTA1_OERR1 0x02
3576 #define _RCSTA1_FERR 0x04
3577 #define _RCSTA1_FERR1 0x04
3578 #define _RCSTA1_ADDEN 0x08
3579 #define _RCSTA1_ADEN 0x08
3580 #define _RCSTA1_ADDEN1 0x08
3581 #define _RCSTA1_CREN 0x10
3582 #define _RCSTA1_CREN1 0x10
3583 #define _RCSTA1_SREN 0x20
3584 #define _RCSTA1_SREN1 0x20
3585 #define _RCSTA1_RX9 0x40
3586 #define _RCSTA1_RC9 0x40
3587 #define _RCSTA1_NOT_RC8 0x40
3588 #define _RCSTA1_RC8_9 0x40
3589 #define _RCSTA1_RX91 0x40
3590 #define _RCSTA1_SPEN 0x80
3591 #define _RCSTA1_SPEN1 0x80
3593 //==============================================================================
3596 //==============================================================================
3597 // TXSTA Bits
3599 extern __at(0x0FAC) __sfr TXSTA;
3601 typedef union
3603 struct
3605 unsigned TX9D : 1;
3606 unsigned TRMT : 1;
3607 unsigned BRGH : 1;
3608 unsigned SENDB : 1;
3609 unsigned SYNC : 1;
3610 unsigned TXEN : 1;
3611 unsigned TX9 : 1;
3612 unsigned CSRC : 1;
3615 struct
3617 unsigned TXD8 : 1;
3618 unsigned TRMT1 : 1;
3619 unsigned BRGH1 : 1;
3620 unsigned SENDB1 : 1;
3621 unsigned SYNC1 : 1;
3622 unsigned TXEN1 : 1;
3623 unsigned TX8_9 : 1;
3624 unsigned CSRC1 : 1;
3627 struct
3629 unsigned TX9D1 : 1;
3630 unsigned : 1;
3631 unsigned : 1;
3632 unsigned : 1;
3633 unsigned : 1;
3634 unsigned : 1;
3635 unsigned NOT_TX8 : 1;
3636 unsigned : 1;
3639 struct
3641 unsigned : 1;
3642 unsigned : 1;
3643 unsigned : 1;
3644 unsigned : 1;
3645 unsigned : 1;
3646 unsigned : 1;
3647 unsigned TX91 : 1;
3648 unsigned : 1;
3650 } __TXSTAbits_t;
3652 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
3654 #define _TX9D 0x01
3655 #define _TXD8 0x01
3656 #define _TX9D1 0x01
3657 #define _TRMT 0x02
3658 #define _TRMT1 0x02
3659 #define _BRGH 0x04
3660 #define _BRGH1 0x04
3661 #define _SENDB 0x08
3662 #define _SENDB1 0x08
3663 #define _SYNC 0x10
3664 #define _SYNC1 0x10
3665 #define _TXEN 0x20
3666 #define _TXEN1 0x20
3667 #define _TX9 0x40
3668 #define _TX8_9 0x40
3669 #define _NOT_TX8 0x40
3670 #define _TX91 0x40
3671 #define _CSRC 0x80
3672 #define _CSRC1 0x80
3674 //==============================================================================
3677 //==============================================================================
3678 // TXSTA1 Bits
3680 extern __at(0x0FAC) __sfr TXSTA1;
3682 typedef union
3684 struct
3686 unsigned TX9D : 1;
3687 unsigned TRMT : 1;
3688 unsigned BRGH : 1;
3689 unsigned SENDB : 1;
3690 unsigned SYNC : 1;
3691 unsigned TXEN : 1;
3692 unsigned TX9 : 1;
3693 unsigned CSRC : 1;
3696 struct
3698 unsigned TXD8 : 1;
3699 unsigned TRMT1 : 1;
3700 unsigned BRGH1 : 1;
3701 unsigned SENDB1 : 1;
3702 unsigned SYNC1 : 1;
3703 unsigned TXEN1 : 1;
3704 unsigned TX8_9 : 1;
3705 unsigned CSRC1 : 1;
3708 struct
3710 unsigned TX9D1 : 1;
3711 unsigned : 1;
3712 unsigned : 1;
3713 unsigned : 1;
3714 unsigned : 1;
3715 unsigned : 1;
3716 unsigned NOT_TX8 : 1;
3717 unsigned : 1;
3720 struct
3722 unsigned : 1;
3723 unsigned : 1;
3724 unsigned : 1;
3725 unsigned : 1;
3726 unsigned : 1;
3727 unsigned : 1;
3728 unsigned TX91 : 1;
3729 unsigned : 1;
3731 } __TXSTA1bits_t;
3733 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
3735 #define _TXSTA1_TX9D 0x01
3736 #define _TXSTA1_TXD8 0x01
3737 #define _TXSTA1_TX9D1 0x01
3738 #define _TXSTA1_TRMT 0x02
3739 #define _TXSTA1_TRMT1 0x02
3740 #define _TXSTA1_BRGH 0x04
3741 #define _TXSTA1_BRGH1 0x04
3742 #define _TXSTA1_SENDB 0x08
3743 #define _TXSTA1_SENDB1 0x08
3744 #define _TXSTA1_SYNC 0x10
3745 #define _TXSTA1_SYNC1 0x10
3746 #define _TXSTA1_TXEN 0x20
3747 #define _TXSTA1_TXEN1 0x20
3748 #define _TXSTA1_TX9 0x40
3749 #define _TXSTA1_TX8_9 0x40
3750 #define _TXSTA1_NOT_TX8 0x40
3751 #define _TXSTA1_TX91 0x40
3752 #define _TXSTA1_CSRC 0x80
3753 #define _TXSTA1_CSRC1 0x80
3755 //==============================================================================
3757 extern __at(0x0FAD) __sfr TXREG;
3758 extern __at(0x0FAD) __sfr TXREG1;
3759 extern __at(0x0FAE) __sfr RCREG;
3760 extern __at(0x0FAE) __sfr RCREG1;
3761 extern __at(0x0FAF) __sfr SPBRG;
3762 extern __at(0x0FAF) __sfr SPBRG1;
3764 //==============================================================================
3765 // T3CON Bits
3767 extern __at(0x0FB1) __sfr T3CON;
3769 typedef union
3771 struct
3773 unsigned TMR3ON : 1;
3774 unsigned TMR3CS : 1;
3775 unsigned NOT_T3SYNC : 1;
3776 unsigned T3CCP1 : 1;
3777 unsigned T3CKPS0 : 1;
3778 unsigned T3CKPS1 : 1;
3779 unsigned T3CCP2 : 1;
3780 unsigned RD16 : 1;
3783 struct
3785 unsigned : 1;
3786 unsigned : 1;
3787 unsigned T3SYNC : 1;
3788 unsigned : 1;
3789 unsigned : 1;
3790 unsigned : 1;
3791 unsigned : 1;
3792 unsigned : 1;
3795 struct
3797 unsigned : 1;
3798 unsigned : 1;
3799 unsigned T3INSYNC : 1;
3800 unsigned : 1;
3801 unsigned : 1;
3802 unsigned : 1;
3803 unsigned : 1;
3804 unsigned : 1;
3807 struct
3809 unsigned : 4;
3810 unsigned T3CKPS : 2;
3811 unsigned : 2;
3813 } __T3CONbits_t;
3815 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
3817 #define _T3CON_TMR3ON 0x01
3818 #define _T3CON_TMR3CS 0x02
3819 #define _T3CON_NOT_T3SYNC 0x04
3820 #define _T3CON_T3SYNC 0x04
3821 #define _T3CON_T3INSYNC 0x04
3822 #define _T3CON_T3CCP1 0x08
3823 #define _T3CON_T3CKPS0 0x10
3824 #define _T3CON_T3CKPS1 0x20
3825 #define _T3CON_T3CCP2 0x40
3826 #define _T3CON_RD16 0x80
3828 //==============================================================================
3830 extern __at(0x0FB2) __sfr TMR3;
3831 extern __at(0x0FB2) __sfr TMR3L;
3832 extern __at(0x0FB3) __sfr TMR3H;
3834 //==============================================================================
3835 // CMCON Bits
3837 extern __at(0x0FB4) __sfr CMCON;
3839 typedef union
3841 struct
3843 unsigned CM0 : 1;
3844 unsigned CM1 : 1;
3845 unsigned CM2 : 1;
3846 unsigned CIS : 1;
3847 unsigned C1INV : 1;
3848 unsigned C2INV : 1;
3849 unsigned C1OUT : 1;
3850 unsigned C2OUT : 1;
3853 struct
3855 unsigned CM : 3;
3856 unsigned : 5;
3858 } __CMCONbits_t;
3860 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
3862 #define _CM0 0x01
3863 #define _CM1 0x02
3864 #define _CM2 0x04
3865 #define _CIS 0x08
3866 #define _C1INV 0x10
3867 #define _C2INV 0x20
3868 #define _C1OUT 0x40
3869 #define _C2OUT 0x80
3871 //==============================================================================
3874 //==============================================================================
3875 // CVRCON Bits
3877 extern __at(0x0FB5) __sfr CVRCON;
3879 typedef union
3881 struct
3883 unsigned CVR0 : 1;
3884 unsigned CVR1 : 1;
3885 unsigned CVR2 : 1;
3886 unsigned CVR3 : 1;
3887 unsigned CVRSS : 1;
3888 unsigned CVRR : 1;
3889 unsigned CVROE : 1;
3890 unsigned CVREN : 1;
3893 struct
3895 unsigned CVR : 4;
3896 unsigned : 4;
3898 } __CVRCONbits_t;
3900 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
3902 #define _CVR0 0x01
3903 #define _CVR1 0x02
3904 #define _CVR2 0x04
3905 #define _CVR3 0x08
3906 #define _CVRSS 0x10
3907 #define _CVRR 0x20
3908 #define _CVROE 0x40
3909 #define _CVREN 0x80
3911 //==============================================================================
3914 //==============================================================================
3915 // LCDSE1 Bits
3917 extern __at(0x0FB6) __sfr LCDSE1;
3919 typedef union
3921 struct
3923 unsigned SE8 : 1;
3924 unsigned SE9 : 1;
3925 unsigned SE10 : 1;
3926 unsigned SE11 : 1;
3927 unsigned SE12 : 1;
3928 unsigned SE13 : 1;
3929 unsigned SE14 : 1;
3930 unsigned SE15 : 1;
3933 struct
3935 unsigned SEGEN8 : 1;
3936 unsigned SEGEN9 : 1;
3937 unsigned SEGEN10 : 1;
3938 unsigned SEGEN11 : 1;
3939 unsigned SEGEN12 : 1;
3940 unsigned SEGEN13 : 1;
3941 unsigned SEGEN14 : 1;
3942 unsigned SEGEN15 : 1;
3945 struct
3947 unsigned SE08 : 1;
3948 unsigned SE09 : 1;
3949 unsigned : 1;
3950 unsigned : 1;
3951 unsigned : 1;
3952 unsigned : 1;
3953 unsigned : 1;
3954 unsigned : 1;
3956 } __LCDSE1bits_t;
3958 extern __at(0x0FB6) volatile __LCDSE1bits_t LCDSE1bits;
3960 #define _SE8 0x01
3961 #define _SEGEN8 0x01
3962 #define _SE08 0x01
3963 #define _SE9 0x02
3964 #define _SEGEN9 0x02
3965 #define _SE09 0x02
3966 #define _SE10 0x04
3967 #define _SEGEN10 0x04
3968 #define _SE11 0x08
3969 #define _SEGEN11 0x08
3970 #define _SE12 0x10
3971 #define _SEGEN12 0x10
3972 #define _SE13 0x20
3973 #define _SEGEN13 0x20
3974 #define _SE14 0x40
3975 #define _SEGEN14 0x40
3976 #define _SE15 0x80
3977 #define _SEGEN15 0x80
3979 //==============================================================================
3982 //==============================================================================
3983 // LCDSE2 Bits
3985 extern __at(0x0FB7) __sfr LCDSE2;
3987 typedef union
3989 struct
3991 unsigned SE16 : 1;
3992 unsigned SE17 : 1;
3993 unsigned SE18 : 1;
3994 unsigned SE19 : 1;
3995 unsigned SE20 : 1;
3996 unsigned SE21 : 1;
3997 unsigned SE22 : 1;
3998 unsigned SE23 : 1;
4001 struct
4003 unsigned SEGEN16 : 1;
4004 unsigned SEGEN17 : 1;
4005 unsigned SEGEN18 : 1;
4006 unsigned SEGEN19 : 1;
4007 unsigned SEGEN20 : 1;
4008 unsigned SEGEN21 : 1;
4009 unsigned SEGEN22 : 1;
4010 unsigned SEGEN23 : 1;
4012 } __LCDSE2bits_t;
4014 extern __at(0x0FB7) volatile __LCDSE2bits_t LCDSE2bits;
4016 #define _SE16 0x01
4017 #define _SEGEN16 0x01
4018 #define _SE17 0x02
4019 #define _SEGEN17 0x02
4020 #define _SE18 0x04
4021 #define _SEGEN18 0x04
4022 #define _SE19 0x08
4023 #define _SEGEN19 0x08
4024 #define _SE20 0x10
4025 #define _SEGEN20 0x10
4026 #define _SE21 0x20
4027 #define _SEGEN21 0x20
4028 #define _SE22 0x40
4029 #define _SEGEN22 0x40
4030 #define _SE23 0x80
4031 #define _SEGEN23 0x80
4033 //==============================================================================
4036 //==============================================================================
4037 // LCDSE3 Bits
4039 extern __at(0x0FB8) __sfr LCDSE3;
4041 typedef union
4043 struct
4045 unsigned SE24 : 1;
4046 unsigned SE25 : 1;
4047 unsigned SE26 : 1;
4048 unsigned SE27 : 1;
4049 unsigned SE28 : 1;
4050 unsigned SE29 : 1;
4051 unsigned SE30 : 1;
4052 unsigned SE31 : 1;
4055 struct
4057 unsigned SEGEN24 : 1;
4058 unsigned SEGEN25 : 1;
4059 unsigned SEGEN26 : 1;
4060 unsigned SEGEN27 : 1;
4061 unsigned SEGEN28 : 1;
4062 unsigned SEGEN29 : 1;
4063 unsigned SEGEN30 : 1;
4064 unsigned SEGEN31 : 1;
4066 } __LCDSE3bits_t;
4068 extern __at(0x0FB8) volatile __LCDSE3bits_t LCDSE3bits;
4070 #define _SE24 0x01
4071 #define _SEGEN24 0x01
4072 #define _SE25 0x02
4073 #define _SEGEN25 0x02
4074 #define _SE26 0x04
4075 #define _SEGEN26 0x04
4076 #define _SE27 0x08
4077 #define _SEGEN27 0x08
4078 #define _SE28 0x10
4079 #define _SEGEN28 0x10
4080 #define _SE29 0x20
4081 #define _SEGEN29 0x20
4082 #define _SE30 0x40
4083 #define _SEGEN30 0x40
4084 #define _SE31 0x80
4085 #define _SEGEN31 0x80
4087 //==============================================================================
4090 //==============================================================================
4091 // LCDSE4 Bits
4093 extern __at(0x0FB9) __sfr LCDSE4;
4095 typedef union
4097 struct
4099 unsigned SE32 : 1;
4100 unsigned : 1;
4101 unsigned : 1;
4102 unsigned : 1;
4103 unsigned : 1;
4104 unsigned : 1;
4105 unsigned : 1;
4106 unsigned : 1;
4109 struct
4111 unsigned SEGEN32 : 1;
4112 unsigned : 1;
4113 unsigned : 1;
4114 unsigned : 1;
4115 unsigned : 1;
4116 unsigned : 1;
4117 unsigned : 1;
4118 unsigned : 1;
4120 } __LCDSE4bits_t;
4122 extern __at(0x0FB9) volatile __LCDSE4bits_t LCDSE4bits;
4124 #define _SE32 0x01
4125 #define _SEGEN32 0x01
4127 //==============================================================================
4130 //==============================================================================
4131 // LCDDATA0 Bits
4133 extern __at(0x0FBB) __sfr LCDDATA0;
4135 typedef union
4137 struct
4139 unsigned S0C0 : 1;
4140 unsigned S1C0 : 1;
4141 unsigned S2C0 : 1;
4142 unsigned S3C0 : 1;
4143 unsigned S4C0 : 1;
4144 unsigned S5C0 : 1;
4145 unsigned S6C0 : 1;
4146 unsigned S7C0 : 1;
4149 struct
4151 unsigned SEG0COM0 : 1;
4152 unsigned SEG1COM0 : 1;
4153 unsigned SEG2COM0 : 1;
4154 unsigned SEG3COM0 : 1;
4155 unsigned SEG4COM0 : 1;
4156 unsigned SEG5COM0 : 1;
4157 unsigned SEG6COM0 : 1;
4158 unsigned SEG7COM0 : 1;
4161 struct
4163 unsigned S00C0 : 1;
4164 unsigned S01C0 : 1;
4165 unsigned S02C0 : 1;
4166 unsigned S03C0 : 1;
4167 unsigned S04C0 : 1;
4168 unsigned S05C0 : 1;
4169 unsigned S06C0 : 1;
4170 unsigned S07C0 : 1;
4172 } __LCDDATA0bits_t;
4174 extern __at(0x0FBB) volatile __LCDDATA0bits_t LCDDATA0bits;
4176 #define _S0C0 0x01
4177 #define _SEG0COM0 0x01
4178 #define _S00C0 0x01
4179 #define _S1C0 0x02
4180 #define _SEG1COM0 0x02
4181 #define _S01C0 0x02
4182 #define _S2C0 0x04
4183 #define _SEG2COM0 0x04
4184 #define _S02C0 0x04
4185 #define _S3C0 0x08
4186 #define _SEG3COM0 0x08
4187 #define _S03C0 0x08
4188 #define _S4C0 0x10
4189 #define _SEG4COM0 0x10
4190 #define _S04C0 0x10
4191 #define _S5C0 0x20
4192 #define _SEG5COM0 0x20
4193 #define _S05C0 0x20
4194 #define _S6C0 0x40
4195 #define _SEG6COM0 0x40
4196 #define _S06C0 0x40
4197 #define _S7C0 0x80
4198 #define _SEG7COM0 0x80
4199 #define _S07C0 0x80
4201 //==============================================================================
4204 //==============================================================================
4205 // LCDDATA1 Bits
4207 extern __at(0x0FBC) __sfr LCDDATA1;
4209 typedef union
4211 struct
4213 unsigned S8C0 : 1;
4214 unsigned S9C0 : 1;
4215 unsigned S10C0 : 1;
4216 unsigned S11C0 : 1;
4217 unsigned S12C0 : 1;
4218 unsigned S13C0 : 1;
4219 unsigned S14C0 : 1;
4220 unsigned S15C0 : 1;
4223 struct
4225 unsigned SEG8COM0 : 1;
4226 unsigned SEG9COM0 : 1;
4227 unsigned SEG10COM0 : 1;
4228 unsigned SEG11COM0 : 1;
4229 unsigned SEG12COM0 : 1;
4230 unsigned SEG13COM0 : 1;
4231 unsigned SEG14COM0 : 1;
4232 unsigned SEG15COM0 : 1;
4235 struct
4237 unsigned S08C0 : 1;
4238 unsigned S09C0 : 1;
4239 unsigned : 1;
4240 unsigned : 1;
4241 unsigned : 1;
4242 unsigned : 1;
4243 unsigned : 1;
4244 unsigned : 1;
4246 } __LCDDATA1bits_t;
4248 extern __at(0x0FBC) volatile __LCDDATA1bits_t LCDDATA1bits;
4250 #define _S8C0 0x01
4251 #define _SEG8COM0 0x01
4252 #define _S08C0 0x01
4253 #define _S9C0 0x02
4254 #define _SEG9COM0 0x02
4255 #define _S09C0 0x02
4256 #define _S10C0 0x04
4257 #define _SEG10COM0 0x04
4258 #define _S11C0 0x08
4259 #define _SEG11COM0 0x08
4260 #define _S12C0 0x10
4261 #define _SEG12COM0 0x10
4262 #define _S13C0 0x20
4263 #define _SEG13COM0 0x20
4264 #define _S14C0 0x40
4265 #define _SEG14COM0 0x40
4266 #define _S15C0 0x80
4267 #define _SEG15COM0 0x80
4269 //==============================================================================
4272 //==============================================================================
4273 // LCDDATA2 Bits
4275 extern __at(0x0FBD) __sfr LCDDATA2;
4277 typedef union
4279 struct
4281 unsigned S16C0 : 1;
4282 unsigned S17C0 : 1;
4283 unsigned S18C0 : 1;
4284 unsigned S19C0 : 1;
4285 unsigned S20C0 : 1;
4286 unsigned S21C0 : 1;
4287 unsigned S22C0 : 1;
4288 unsigned S23C0 : 1;
4291 struct
4293 unsigned SEG16COM0 : 1;
4294 unsigned SEG17COM0 : 1;
4295 unsigned SEG18COM0 : 1;
4296 unsigned SEG19COM0 : 1;
4297 unsigned SEG20COM0 : 1;
4298 unsigned SEG21COM0 : 1;
4299 unsigned SEG22COM0 : 1;
4300 unsigned SEG23COM0 : 1;
4302 } __LCDDATA2bits_t;
4304 extern __at(0x0FBD) volatile __LCDDATA2bits_t LCDDATA2bits;
4306 #define _S16C0 0x01
4307 #define _SEG16COM0 0x01
4308 #define _S17C0 0x02
4309 #define _SEG17COM0 0x02
4310 #define _S18C0 0x04
4311 #define _SEG18COM0 0x04
4312 #define _S19C0 0x08
4313 #define _SEG19COM0 0x08
4314 #define _S20C0 0x10
4315 #define _SEG20COM0 0x10
4316 #define _S21C0 0x20
4317 #define _SEG21COM0 0x20
4318 #define _S22C0 0x40
4319 #define _SEG22COM0 0x40
4320 #define _S23C0 0x80
4321 #define _SEG23COM0 0x80
4323 //==============================================================================
4326 //==============================================================================
4327 // LCDDATA3 Bits
4329 extern __at(0x0FBE) __sfr LCDDATA3;
4331 typedef union
4333 struct
4335 unsigned S24C0 : 1;
4336 unsigned S25C0 : 1;
4337 unsigned S26C0 : 1;
4338 unsigned S27C0 : 1;
4339 unsigned S28C0 : 1;
4340 unsigned S29C0 : 1;
4341 unsigned S30C0 : 1;
4342 unsigned S31C0 : 1;
4345 struct
4347 unsigned SEG24COM0 : 1;
4348 unsigned SEG25COM0 : 1;
4349 unsigned SEG26COM0 : 1;
4350 unsigned SEG27COM0 : 1;
4351 unsigned SEG28COM0 : 1;
4352 unsigned SEG29COM0 : 1;
4353 unsigned SEG30COM0 : 1;
4354 unsigned SEG31COM0 : 1;
4356 } __LCDDATA3bits_t;
4358 extern __at(0x0FBE) volatile __LCDDATA3bits_t LCDDATA3bits;
4360 #define _S24C0 0x01
4361 #define _SEG24COM0 0x01
4362 #define _S25C0 0x02
4363 #define _SEG25COM0 0x02
4364 #define _S26C0 0x04
4365 #define _SEG26COM0 0x04
4366 #define _S27C0 0x08
4367 #define _SEG27COM0 0x08
4368 #define _S28C0 0x10
4369 #define _SEG28COM0 0x10
4370 #define _S29C0 0x20
4371 #define _SEG29COM0 0x20
4372 #define _S30C0 0x40
4373 #define _SEG30COM0 0x40
4374 #define _S31C0 0x80
4375 #define _SEG31COM0 0x80
4377 //==============================================================================
4380 //==============================================================================
4381 // LCDDATA4 Bits
4383 extern __at(0x0FBF) __sfr LCDDATA4;
4385 typedef union
4387 struct
4389 unsigned S32C0 : 1;
4390 unsigned S33C0 : 1;
4391 unsigned S34C0 : 1;
4392 unsigned S35C0 : 1;
4393 unsigned S36C0 : 1;
4394 unsigned S37C0 : 1;
4395 unsigned S38C0 : 1;
4396 unsigned S39C0 : 1;
4399 struct
4401 unsigned SEG32COM0 : 1;
4402 unsigned SEG33COM0 : 1;
4403 unsigned SEG34COM0 : 1;
4404 unsigned SEG35COM0 : 1;
4405 unsigned SEG36COM0 : 1;
4406 unsigned SEG37COM0 : 1;
4407 unsigned SEG38COM0 : 1;
4408 unsigned SEG39COM0 : 1;
4410 } __LCDDATA4bits_t;
4412 extern __at(0x0FBF) volatile __LCDDATA4bits_t LCDDATA4bits;
4414 #define _S32C0 0x01
4415 #define _SEG32COM0 0x01
4416 #define _S33C0 0x02
4417 #define _SEG33COM0 0x02
4418 #define _S34C0 0x04
4419 #define _SEG34COM0 0x04
4420 #define _S35C0 0x08
4421 #define _SEG35COM0 0x08
4422 #define _S36C0 0x10
4423 #define _SEG36COM0 0x10
4424 #define _S37C0 0x20
4425 #define _SEG37COM0 0x20
4426 #define _S38C0 0x40
4427 #define _SEG38COM0 0x40
4428 #define _S39C0 0x80
4429 #define _SEG39COM0 0x80
4431 //==============================================================================
4434 //==============================================================================
4435 // ADCON2 Bits
4437 extern __at(0x0FC0) __sfr ADCON2;
4439 typedef union
4441 struct
4443 unsigned ADCS0 : 1;
4444 unsigned ADCS1 : 1;
4445 unsigned ADCS2 : 1;
4446 unsigned ACQT0 : 1;
4447 unsigned ACQT1 : 1;
4448 unsigned ACQT2 : 1;
4449 unsigned : 1;
4450 unsigned ADFM : 1;
4453 struct
4455 unsigned ADCS : 3;
4456 unsigned : 5;
4459 struct
4461 unsigned : 3;
4462 unsigned ACQT : 3;
4463 unsigned : 2;
4465 } __ADCON2bits_t;
4467 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4469 #define _ADCS0 0x01
4470 #define _ADCS1 0x02
4471 #define _ADCS2 0x04
4472 #define _ACQT0 0x08
4473 #define _ACQT1 0x10
4474 #define _ACQT2 0x20
4475 #define _ADFM 0x80
4477 //==============================================================================
4480 //==============================================================================
4481 // ADCON1 Bits
4483 extern __at(0x0FC1) __sfr ADCON1;
4485 typedef union
4487 struct
4489 unsigned PCFG0 : 1;
4490 unsigned PCFG1 : 1;
4491 unsigned PCFG2 : 1;
4492 unsigned PCFG3 : 1;
4493 unsigned VCFG0 : 1;
4494 unsigned VCFG1 : 1;
4495 unsigned : 1;
4496 unsigned TRIGSEL : 1;
4499 struct
4501 unsigned PCFG : 4;
4502 unsigned : 4;
4505 struct
4507 unsigned : 4;
4508 unsigned VCFG : 2;
4509 unsigned : 2;
4511 } __ADCON1bits_t;
4513 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4515 #define _ADCON1_PCFG0 0x01
4516 #define _ADCON1_PCFG1 0x02
4517 #define _ADCON1_PCFG2 0x04
4518 #define _ADCON1_PCFG3 0x08
4519 #define _ADCON1_VCFG0 0x10
4520 #define _ADCON1_VCFG1 0x20
4521 #define _ADCON1_TRIGSEL 0x80
4523 //==============================================================================
4526 //==============================================================================
4527 // ADCON0 Bits
4529 extern __at(0x0FC2) __sfr ADCON0;
4531 typedef union
4533 struct
4535 unsigned ADON : 1;
4536 unsigned GO_NOT_DONE : 1;
4537 unsigned CHS0 : 1;
4538 unsigned CHS1 : 1;
4539 unsigned CHS2 : 1;
4540 unsigned CHS3 : 1;
4541 unsigned VCFG0 : 1;
4542 unsigned ADCAL : 1;
4545 struct
4547 unsigned : 1;
4548 unsigned GO_DONE : 1;
4549 unsigned : 1;
4550 unsigned : 1;
4551 unsigned : 1;
4552 unsigned : 1;
4553 unsigned : 1;
4554 unsigned VCFG1 : 1;
4557 struct
4559 unsigned : 1;
4560 unsigned DONE : 1;
4561 unsigned : 1;
4562 unsigned : 1;
4563 unsigned : 1;
4564 unsigned : 1;
4565 unsigned : 1;
4566 unsigned : 1;
4569 struct
4571 unsigned : 1;
4572 unsigned GO : 1;
4573 unsigned : 1;
4574 unsigned : 1;
4575 unsigned : 1;
4576 unsigned : 1;
4577 unsigned : 1;
4578 unsigned : 1;
4581 struct
4583 unsigned : 1;
4584 unsigned NOT_DONE : 1;
4585 unsigned : 1;
4586 unsigned : 1;
4587 unsigned : 1;
4588 unsigned : 1;
4589 unsigned : 1;
4590 unsigned : 1;
4593 struct
4595 unsigned : 2;
4596 unsigned CHS : 4;
4597 unsigned : 2;
4600 struct
4602 unsigned : 6;
4603 unsigned VCFG : 2;
4605 } __ADCON0bits_t;
4607 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4609 #define _ADON 0x01
4610 #define _GO_NOT_DONE 0x02
4611 #define _GO_DONE 0x02
4612 #define _DONE 0x02
4613 #define _GO 0x02
4614 #define _NOT_DONE 0x02
4615 #define _CHS0 0x04
4616 #define _CHS1 0x08
4617 #define _CHS2 0x10
4618 #define _CHS3 0x20
4619 #define _VCFG0 0x40
4620 #define _ADCAL 0x80
4621 #define _VCFG1 0x80
4623 //==============================================================================
4625 extern __at(0x0FC3) __sfr ADRES;
4626 extern __at(0x0FC3) __sfr ADRESL;
4627 extern __at(0x0FC4) __sfr ADRESH;
4629 //==============================================================================
4630 // SSP1CON2 Bits
4632 extern __at(0x0FC5) __sfr SSP1CON2;
4634 typedef union
4636 struct
4638 unsigned SEN : 1;
4639 unsigned RSEN : 1;
4640 unsigned PEN : 1;
4641 unsigned RCEN : 1;
4642 unsigned ACKEN : 1;
4643 unsigned ACKDT : 1;
4644 unsigned ACKSTAT : 1;
4645 unsigned GCEN : 1;
4648 struct
4650 unsigned : 1;
4651 unsigned ADMSK1 : 1;
4652 unsigned ADMSK2 : 1;
4653 unsigned ADMSK3 : 1;
4654 unsigned ADMSK4 : 1;
4655 unsigned ADMSK5 : 1;
4656 unsigned : 1;
4657 unsigned : 1;
4659 } __SSP1CON2bits_t;
4661 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4663 #define _SEN 0x01
4664 #define _RSEN 0x02
4665 #define _ADMSK1 0x02
4666 #define _PEN 0x04
4667 #define _ADMSK2 0x04
4668 #define _RCEN 0x08
4669 #define _ADMSK3 0x08
4670 #define _ACKEN 0x10
4671 #define _ADMSK4 0x10
4672 #define _ACKDT 0x20
4673 #define _ADMSK5 0x20
4674 #define _ACKSTAT 0x40
4675 #define _GCEN 0x80
4677 //==============================================================================
4680 //==============================================================================
4681 // SSPCON2 Bits
4683 extern __at(0x0FC5) __sfr SSPCON2;
4685 typedef union
4687 struct
4689 unsigned SEN : 1;
4690 unsigned RSEN : 1;
4691 unsigned PEN : 1;
4692 unsigned RCEN : 1;
4693 unsigned ACKEN : 1;
4694 unsigned ACKDT : 1;
4695 unsigned ACKSTAT : 1;
4696 unsigned GCEN : 1;
4699 struct
4701 unsigned : 1;
4702 unsigned ADMSK1 : 1;
4703 unsigned ADMSK2 : 1;
4704 unsigned ADMSK3 : 1;
4705 unsigned ADMSK4 : 1;
4706 unsigned ADMSK5 : 1;
4707 unsigned : 1;
4708 unsigned : 1;
4710 } __SSPCON2bits_t;
4712 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4714 #define _SSPCON2_SEN 0x01
4715 #define _SSPCON2_RSEN 0x02
4716 #define _SSPCON2_ADMSK1 0x02
4717 #define _SSPCON2_PEN 0x04
4718 #define _SSPCON2_ADMSK2 0x04
4719 #define _SSPCON2_RCEN 0x08
4720 #define _SSPCON2_ADMSK3 0x08
4721 #define _SSPCON2_ACKEN 0x10
4722 #define _SSPCON2_ADMSK4 0x10
4723 #define _SSPCON2_ACKDT 0x20
4724 #define _SSPCON2_ADMSK5 0x20
4725 #define _SSPCON2_ACKSTAT 0x40
4726 #define _SSPCON2_GCEN 0x80
4728 //==============================================================================
4731 //==============================================================================
4732 // SSP1CON1 Bits
4734 extern __at(0x0FC6) __sfr SSP1CON1;
4736 typedef union
4738 struct
4740 unsigned SSPM0 : 1;
4741 unsigned SSPM1 : 1;
4742 unsigned SSPM2 : 1;
4743 unsigned SSPM3 : 1;
4744 unsigned CKP : 1;
4745 unsigned SSPEN : 1;
4746 unsigned SSPOV : 1;
4747 unsigned WCOL : 1;
4750 struct
4752 unsigned SSPM : 4;
4753 unsigned : 4;
4755 } __SSP1CON1bits_t;
4757 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4759 #define _SSPM0 0x01
4760 #define _SSPM1 0x02
4761 #define _SSPM2 0x04
4762 #define _SSPM3 0x08
4763 #define _CKP 0x10
4764 #define _SSPEN 0x20
4765 #define _SSPOV 0x40
4766 #define _WCOL 0x80
4768 //==============================================================================
4771 //==============================================================================
4772 // SSPCON1 Bits
4774 extern __at(0x0FC6) __sfr SSPCON1;
4776 typedef union
4778 struct
4780 unsigned SSPM0 : 1;
4781 unsigned SSPM1 : 1;
4782 unsigned SSPM2 : 1;
4783 unsigned SSPM3 : 1;
4784 unsigned CKP : 1;
4785 unsigned SSPEN : 1;
4786 unsigned SSPOV : 1;
4787 unsigned WCOL : 1;
4790 struct
4792 unsigned SSPM : 4;
4793 unsigned : 4;
4795 } __SSPCON1bits_t;
4797 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4799 #define _SSPCON1_SSPM0 0x01
4800 #define _SSPCON1_SSPM1 0x02
4801 #define _SSPCON1_SSPM2 0x04
4802 #define _SSPCON1_SSPM3 0x08
4803 #define _SSPCON1_CKP 0x10
4804 #define _SSPCON1_SSPEN 0x20
4805 #define _SSPCON1_SSPOV 0x40
4806 #define _SSPCON1_WCOL 0x80
4808 //==============================================================================
4811 //==============================================================================
4812 // SSP1STAT Bits
4814 extern __at(0x0FC7) __sfr SSP1STAT;
4816 typedef union
4818 struct
4820 unsigned BF : 1;
4821 unsigned UA : 1;
4822 unsigned R_NOT_W : 1;
4823 unsigned S : 1;
4824 unsigned P : 1;
4825 unsigned D_NOT_A : 1;
4826 unsigned CKE : 1;
4827 unsigned SMP : 1;
4830 struct
4832 unsigned : 1;
4833 unsigned : 1;
4834 unsigned R : 1;
4835 unsigned I2C_START : 1;
4836 unsigned I2C_STOP : 1;
4837 unsigned D : 1;
4838 unsigned : 1;
4839 unsigned : 1;
4842 struct
4844 unsigned : 1;
4845 unsigned : 1;
4846 unsigned R_W : 1;
4847 unsigned : 1;
4848 unsigned : 1;
4849 unsigned D_A : 1;
4850 unsigned : 1;
4851 unsigned : 1;
4854 struct
4856 unsigned : 1;
4857 unsigned : 1;
4858 unsigned NOT_W : 1;
4859 unsigned : 1;
4860 unsigned : 1;
4861 unsigned NOT_A : 1;
4862 unsigned : 1;
4863 unsigned : 1;
4866 struct
4868 unsigned : 1;
4869 unsigned : 1;
4870 unsigned NOT_WRITE : 1;
4871 unsigned : 1;
4872 unsigned : 1;
4873 unsigned NOT_ADDRESS : 1;
4874 unsigned : 1;
4875 unsigned : 1;
4878 struct
4880 unsigned : 1;
4881 unsigned : 1;
4882 unsigned READ_WRITE : 1;
4883 unsigned : 1;
4884 unsigned : 1;
4885 unsigned DATA_ADDRESS : 1;
4886 unsigned : 1;
4887 unsigned : 1;
4890 struct
4892 unsigned : 1;
4893 unsigned : 1;
4894 unsigned I2C_READ : 1;
4895 unsigned : 1;
4896 unsigned : 1;
4897 unsigned I2C_DAT : 1;
4898 unsigned : 1;
4899 unsigned : 1;
4901 } __SSP1STATbits_t;
4903 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4905 #define _BF 0x01
4906 #define _UA 0x02
4907 #define _R_NOT_W 0x04
4908 #define _R 0x04
4909 #define _R_W 0x04
4910 #define _NOT_W 0x04
4911 #define _NOT_WRITE 0x04
4912 #define _READ_WRITE 0x04
4913 #define _I2C_READ 0x04
4914 #define _S 0x08
4915 #define _I2C_START 0x08
4916 #define _P 0x10
4917 #define _I2C_STOP 0x10
4918 #define _D_NOT_A 0x20
4919 #define _D 0x20
4920 #define _D_A 0x20
4921 #define _NOT_A 0x20
4922 #define _NOT_ADDRESS 0x20
4923 #define _DATA_ADDRESS 0x20
4924 #define _I2C_DAT 0x20
4925 #define _CKE 0x40
4926 #define _SMP 0x80
4928 //==============================================================================
4931 //==============================================================================
4932 // SSPSTAT Bits
4934 extern __at(0x0FC7) __sfr SSPSTAT;
4936 typedef union
4938 struct
4940 unsigned BF : 1;
4941 unsigned UA : 1;
4942 unsigned R_NOT_W : 1;
4943 unsigned S : 1;
4944 unsigned P : 1;
4945 unsigned D_NOT_A : 1;
4946 unsigned CKE : 1;
4947 unsigned SMP : 1;
4950 struct
4952 unsigned : 1;
4953 unsigned : 1;
4954 unsigned R : 1;
4955 unsigned I2C_START : 1;
4956 unsigned I2C_STOP : 1;
4957 unsigned D : 1;
4958 unsigned : 1;
4959 unsigned : 1;
4962 struct
4964 unsigned : 1;
4965 unsigned : 1;
4966 unsigned R_W : 1;
4967 unsigned : 1;
4968 unsigned : 1;
4969 unsigned D_A : 1;
4970 unsigned : 1;
4971 unsigned : 1;
4974 struct
4976 unsigned : 1;
4977 unsigned : 1;
4978 unsigned NOT_W : 1;
4979 unsigned : 1;
4980 unsigned : 1;
4981 unsigned NOT_A : 1;
4982 unsigned : 1;
4983 unsigned : 1;
4986 struct
4988 unsigned : 1;
4989 unsigned : 1;
4990 unsigned NOT_WRITE : 1;
4991 unsigned : 1;
4992 unsigned : 1;
4993 unsigned NOT_ADDRESS : 1;
4994 unsigned : 1;
4995 unsigned : 1;
4998 struct
5000 unsigned : 1;
5001 unsigned : 1;
5002 unsigned READ_WRITE : 1;
5003 unsigned : 1;
5004 unsigned : 1;
5005 unsigned DATA_ADDRESS : 1;
5006 unsigned : 1;
5007 unsigned : 1;
5010 struct
5012 unsigned : 1;
5013 unsigned : 1;
5014 unsigned I2C_READ : 1;
5015 unsigned : 1;
5016 unsigned : 1;
5017 unsigned I2C_DAT : 1;
5018 unsigned : 1;
5019 unsigned : 1;
5021 } __SSPSTATbits_t;
5023 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5025 #define _SSPSTAT_BF 0x01
5026 #define _SSPSTAT_UA 0x02
5027 #define _SSPSTAT_R_NOT_W 0x04
5028 #define _SSPSTAT_R 0x04
5029 #define _SSPSTAT_R_W 0x04
5030 #define _SSPSTAT_NOT_W 0x04
5031 #define _SSPSTAT_NOT_WRITE 0x04
5032 #define _SSPSTAT_READ_WRITE 0x04
5033 #define _SSPSTAT_I2C_READ 0x04
5034 #define _SSPSTAT_S 0x08
5035 #define _SSPSTAT_I2C_START 0x08
5036 #define _SSPSTAT_P 0x10
5037 #define _SSPSTAT_I2C_STOP 0x10
5038 #define _SSPSTAT_D_NOT_A 0x20
5039 #define _SSPSTAT_D 0x20
5040 #define _SSPSTAT_D_A 0x20
5041 #define _SSPSTAT_NOT_A 0x20
5042 #define _SSPSTAT_NOT_ADDRESS 0x20
5043 #define _SSPSTAT_DATA_ADDRESS 0x20
5044 #define _SSPSTAT_I2C_DAT 0x20
5045 #define _SSPSTAT_CKE 0x40
5046 #define _SSPSTAT_SMP 0x80
5048 //==============================================================================
5051 //==============================================================================
5052 // SSP1ADD Bits
5054 extern __at(0x0FC8) __sfr SSP1ADD;
5056 typedef struct
5058 unsigned MSK0 : 1;
5059 unsigned MSK1 : 1;
5060 unsigned MSK2 : 1;
5061 unsigned MSK3 : 1;
5062 unsigned MSK4 : 1;
5063 unsigned MSK5 : 1;
5064 unsigned MSK6 : 1;
5065 unsigned MSK7 : 1;
5066 } __SSP1ADDbits_t;
5068 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
5070 #define _MSK0 0x01
5071 #define _MSK1 0x02
5072 #define _MSK2 0x04
5073 #define _MSK3 0x08
5074 #define _MSK4 0x10
5075 #define _MSK5 0x20
5076 #define _MSK6 0x40
5077 #define _MSK7 0x80
5079 //==============================================================================
5082 //==============================================================================
5083 // SSPADD Bits
5085 extern __at(0x0FC8) __sfr SSPADD;
5087 typedef struct
5089 unsigned MSK0 : 1;
5090 unsigned MSK1 : 1;
5091 unsigned MSK2 : 1;
5092 unsigned MSK3 : 1;
5093 unsigned MSK4 : 1;
5094 unsigned MSK5 : 1;
5095 unsigned MSK6 : 1;
5096 unsigned MSK7 : 1;
5097 } __SSPADDbits_t;
5099 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
5101 #define _SSPADD_MSK0 0x01
5102 #define _SSPADD_MSK1 0x02
5103 #define _SSPADD_MSK2 0x04
5104 #define _SSPADD_MSK3 0x08
5105 #define _SSPADD_MSK4 0x10
5106 #define _SSPADD_MSK5 0x20
5107 #define _SSPADD_MSK6 0x40
5108 #define _SSPADD_MSK7 0x80
5110 //==============================================================================
5112 extern __at(0x0FC9) __sfr SSP1BUF;
5113 extern __at(0x0FC9) __sfr SSPBUF;
5115 //==============================================================================
5116 // T2CON Bits
5118 extern __at(0x0FCA) __sfr T2CON;
5120 typedef union
5122 struct
5124 unsigned T2CKPS0 : 1;
5125 unsigned T2CKPS1 : 1;
5126 unsigned TMR2ON : 1;
5127 unsigned T2OUTPS0 : 1;
5128 unsigned T2OUTPS1 : 1;
5129 unsigned T2OUTPS2 : 1;
5130 unsigned T2OUTPS3 : 1;
5131 unsigned : 1;
5134 struct
5136 unsigned T2CKPS : 2;
5137 unsigned : 6;
5140 struct
5142 unsigned : 3;
5143 unsigned T2OUTPS : 4;
5144 unsigned : 1;
5146 } __T2CONbits_t;
5148 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5150 #define _T2CKPS0 0x01
5151 #define _T2CKPS1 0x02
5152 #define _TMR2ON 0x04
5153 #define _T2OUTPS0 0x08
5154 #define _T2OUTPS1 0x10
5155 #define _T2OUTPS2 0x20
5156 #define _T2OUTPS3 0x40
5158 //==============================================================================
5160 extern __at(0x0FCB) __sfr PR2;
5161 extern __at(0x0FCC) __sfr TMR2;
5163 //==============================================================================
5164 // T1CON Bits
5166 extern __at(0x0FCD) __sfr T1CON;
5168 typedef union
5170 struct
5172 unsigned TMR1ON : 1;
5173 unsigned TMR1CS : 1;
5174 unsigned NOT_T1SYNC : 1;
5175 unsigned T1OSCEN : 1;
5176 unsigned T1CKPS0 : 1;
5177 unsigned T1CKPS1 : 1;
5178 unsigned T1RUN : 1;
5179 unsigned RD16 : 1;
5182 struct
5184 unsigned : 1;
5185 unsigned : 1;
5186 unsigned T1INSYNC : 1;
5187 unsigned : 1;
5188 unsigned : 1;
5189 unsigned : 1;
5190 unsigned : 1;
5191 unsigned : 1;
5194 struct
5196 unsigned : 1;
5197 unsigned : 1;
5198 unsigned T1SYNC : 1;
5199 unsigned : 1;
5200 unsigned : 1;
5201 unsigned : 1;
5202 unsigned : 1;
5203 unsigned : 1;
5206 struct
5208 unsigned : 4;
5209 unsigned T1CKPS : 2;
5210 unsigned : 2;
5212 } __T1CONbits_t;
5214 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5216 #define _TMR1ON 0x01
5217 #define _TMR1CS 0x02
5218 #define _NOT_T1SYNC 0x04
5219 #define _T1INSYNC 0x04
5220 #define _T1SYNC 0x04
5221 #define _T1OSCEN 0x08
5222 #define _T1CKPS0 0x10
5223 #define _T1CKPS1 0x20
5224 #define _T1RUN 0x40
5225 #define _RD16 0x80
5227 //==============================================================================
5229 extern __at(0x0FCE) __sfr TMR1;
5230 extern __at(0x0FCE) __sfr TMR1L;
5231 extern __at(0x0FCF) __sfr TMR1H;
5233 //==============================================================================
5234 // RCON Bits
5236 extern __at(0x0FD0) __sfr RCON;
5238 typedef union
5240 struct
5242 unsigned NOT_BOR : 1;
5243 unsigned NOT_POR : 1;
5244 unsigned NOT_PD : 1;
5245 unsigned NOT_TO : 1;
5246 unsigned NOT_RI : 1;
5247 unsigned NOT_CM : 1;
5248 unsigned : 1;
5249 unsigned IPEN : 1;
5252 struct
5254 unsigned BOR : 1;
5255 unsigned POR : 1;
5256 unsigned PD : 1;
5257 unsigned TO : 1;
5258 unsigned RI : 1;
5259 unsigned CM : 1;
5260 unsigned : 1;
5261 unsigned : 1;
5263 } __RCONbits_t;
5265 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5267 #define _NOT_BOR 0x01
5268 #define _BOR 0x01
5269 #define _NOT_POR 0x02
5270 #define _POR 0x02
5271 #define _NOT_PD 0x04
5272 #define _PD 0x04
5273 #define _NOT_TO 0x08
5274 #define _TO 0x08
5275 #define _NOT_RI 0x10
5276 #define _RI 0x10
5277 #define _NOT_CM 0x20
5278 #define _CM 0x20
5279 #define _IPEN 0x80
5281 //==============================================================================
5284 //==============================================================================
5285 // WDTCON Bits
5287 extern __at(0x0FD1) __sfr WDTCON;
5289 typedef union
5291 struct
5293 unsigned SWDTEN : 1;
5294 unsigned : 1;
5295 unsigned : 1;
5296 unsigned : 1;
5297 unsigned : 1;
5298 unsigned : 1;
5299 unsigned : 1;
5300 unsigned REGSLP : 1;
5303 struct
5305 unsigned SWDTE : 1;
5306 unsigned : 1;
5307 unsigned : 1;
5308 unsigned : 1;
5309 unsigned : 1;
5310 unsigned : 1;
5311 unsigned : 1;
5312 unsigned : 1;
5314 } __WDTCONbits_t;
5316 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5318 #define _SWDTEN 0x01
5319 #define _SWDTE 0x01
5320 #define _REGSLP 0x80
5322 //==============================================================================
5325 //==============================================================================
5326 // LCDREG Bits
5328 extern __at(0x0FD2) __sfr LCDREG;
5330 typedef union
5332 struct
5334 unsigned CKSEL0 : 1;
5335 unsigned CKSEL1 : 1;
5336 unsigned MODE13 : 1;
5337 unsigned BIAS0 : 1;
5338 unsigned BIAS1 : 1;
5339 unsigned BIAS2 : 1;
5340 unsigned CPEN : 1;
5341 unsigned : 1;
5344 struct
5346 unsigned CKSEL : 2;
5347 unsigned : 6;
5350 struct
5352 unsigned : 3;
5353 unsigned BIAS : 3;
5354 unsigned : 2;
5356 } __LCDREGbits_t;
5358 extern __at(0x0FD2) volatile __LCDREGbits_t LCDREGbits;
5360 #define _CKSEL0 0x01
5361 #define _CKSEL1 0x02
5362 #define _MODE13 0x04
5363 #define _BIAS0 0x08
5364 #define _BIAS1 0x10
5365 #define _BIAS2 0x20
5366 #define _CPEN 0x40
5368 //==============================================================================
5371 //==============================================================================
5372 // OSCCON Bits
5374 extern __at(0x0FD3) __sfr OSCCON;
5376 typedef union
5378 struct
5380 unsigned SCS0 : 1;
5381 unsigned SCS1 : 1;
5382 unsigned IOFS : 1;
5383 unsigned OSTS : 1;
5384 unsigned IRCF0 : 1;
5385 unsigned IRCF1 : 1;
5386 unsigned IRCF2 : 1;
5387 unsigned IDLEN : 1;
5390 struct
5392 unsigned SCS : 2;
5393 unsigned : 6;
5396 struct
5398 unsigned : 4;
5399 unsigned IRCF : 3;
5400 unsigned : 1;
5402 } __OSCCONbits_t;
5404 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5406 #define _SCS0 0x01
5407 #define _SCS1 0x02
5408 #define _IOFS 0x04
5409 #define _OSTS 0x08
5410 #define _IRCF0 0x10
5411 #define _IRCF1 0x20
5412 #define _IRCF2 0x40
5413 #define _IDLEN 0x80
5415 //==============================================================================
5418 //==============================================================================
5419 // T0CON Bits
5421 extern __at(0x0FD5) __sfr T0CON;
5423 typedef union
5425 struct
5427 unsigned T0PS0 : 1;
5428 unsigned T0PS1 : 1;
5429 unsigned T0PS2 : 1;
5430 unsigned PSA : 1;
5431 unsigned T0SE : 1;
5432 unsigned T0CS : 1;
5433 unsigned T08BIT : 1;
5434 unsigned TMR0ON : 1;
5437 struct
5439 unsigned T0PS : 3;
5440 unsigned : 5;
5442 } __T0CONbits_t;
5444 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5446 #define _T0PS0 0x01
5447 #define _T0PS1 0x02
5448 #define _T0PS2 0x04
5449 #define _PSA 0x08
5450 #define _T0SE 0x10
5451 #define _T0CS 0x20
5452 #define _T08BIT 0x40
5453 #define _TMR0ON 0x80
5455 //==============================================================================
5457 extern __at(0x0FD6) __sfr TMR0;
5458 extern __at(0x0FD6) __sfr TMR0L;
5459 extern __at(0x0FD7) __sfr TMR0H;
5461 //==============================================================================
5462 // STATUS Bits
5464 extern __at(0x0FD8) __sfr STATUS;
5466 typedef struct
5468 unsigned C : 1;
5469 unsigned DC : 1;
5470 unsigned Z : 1;
5471 unsigned OV : 1;
5472 unsigned N : 1;
5473 unsigned : 1;
5474 unsigned : 1;
5475 unsigned : 1;
5476 } __STATUSbits_t;
5478 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5480 #define _C 0x01
5481 #define _DC 0x02
5482 #define _Z 0x04
5483 #define _OV 0x08
5484 #define _N 0x10
5486 //==============================================================================
5488 extern __at(0x0FD9) __sfr FSR2L;
5489 extern __at(0x0FDA) __sfr FSR2H;
5490 extern __at(0x0FDB) __sfr PLUSW2;
5491 extern __at(0x0FDC) __sfr PREINC2;
5492 extern __at(0x0FDD) __sfr POSTDEC2;
5493 extern __at(0x0FDE) __sfr POSTINC2;
5494 extern __at(0x0FDF) __sfr INDF2;
5495 extern __at(0x0FE0) __sfr BSR;
5496 extern __at(0x0FE1) __sfr FSR1L;
5497 extern __at(0x0FE2) __sfr FSR1H;
5498 extern __at(0x0FE3) __sfr PLUSW1;
5499 extern __at(0x0FE4) __sfr PREINC1;
5500 extern __at(0x0FE5) __sfr POSTDEC1;
5501 extern __at(0x0FE6) __sfr POSTINC1;
5502 extern __at(0x0FE7) __sfr INDF1;
5503 extern __at(0x0FE8) __sfr WREG;
5504 extern __at(0x0FE9) __sfr FSR0L;
5505 extern __at(0x0FEA) __sfr FSR0H;
5506 extern __at(0x0FEB) __sfr PLUSW0;
5507 extern __at(0x0FEC) __sfr PREINC0;
5508 extern __at(0x0FED) __sfr POSTDEC0;
5509 extern __at(0x0FEE) __sfr POSTINC0;
5510 extern __at(0x0FEF) __sfr INDF0;
5512 //==============================================================================
5513 // INTCON3 Bits
5515 extern __at(0x0FF0) __sfr INTCON3;
5517 typedef union
5519 struct
5521 unsigned INT1IF : 1;
5522 unsigned INT2IF : 1;
5523 unsigned INT3IF : 1;
5524 unsigned INT1IE : 1;
5525 unsigned INT2IE : 1;
5526 unsigned INT3IE : 1;
5527 unsigned INT1IP : 1;
5528 unsigned INT2IP : 1;
5531 struct
5533 unsigned INT1F : 1;
5534 unsigned INT2F : 1;
5535 unsigned INT3F : 1;
5536 unsigned INT1E : 1;
5537 unsigned INT2E : 1;
5538 unsigned INT3E : 1;
5539 unsigned INT1P : 1;
5540 unsigned INT2P : 1;
5542 } __INTCON3bits_t;
5544 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5546 #define _INT1IF 0x01
5547 #define _INT1F 0x01
5548 #define _INT2IF 0x02
5549 #define _INT2F 0x02
5550 #define _INT3IF 0x04
5551 #define _INT3F 0x04
5552 #define _INT1IE 0x08
5553 #define _INT1E 0x08
5554 #define _INT2IE 0x10
5555 #define _INT2E 0x10
5556 #define _INT3IE 0x20
5557 #define _INT3E 0x20
5558 #define _INT1IP 0x40
5559 #define _INT1P 0x40
5560 #define _INT2IP 0x80
5561 #define _INT2P 0x80
5563 //==============================================================================
5566 //==============================================================================
5567 // INTCON2 Bits
5569 extern __at(0x0FF1) __sfr INTCON2;
5571 typedef union
5573 struct
5575 unsigned RBIP : 1;
5576 unsigned INT3IP : 1;
5577 unsigned TMR0IP : 1;
5578 unsigned INTEDG3 : 1;
5579 unsigned INTEDG2 : 1;
5580 unsigned INTEDG1 : 1;
5581 unsigned INTEDG0 : 1;
5582 unsigned NOT_RBPU : 1;
5585 struct
5587 unsigned : 1;
5588 unsigned INT3P : 1;
5589 unsigned T0IP : 1;
5590 unsigned : 1;
5591 unsigned : 1;
5592 unsigned : 1;
5593 unsigned : 1;
5594 unsigned RBPU : 1;
5596 } __INTCON2bits_t;
5598 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5600 #define _RBIP 0x01
5601 #define _INT3IP 0x02
5602 #define _INT3P 0x02
5603 #define _TMR0IP 0x04
5604 #define _T0IP 0x04
5605 #define _INTEDG3 0x08
5606 #define _INTEDG2 0x10
5607 #define _INTEDG1 0x20
5608 #define _INTEDG0 0x40
5609 #define _NOT_RBPU 0x80
5610 #define _RBPU 0x80
5612 //==============================================================================
5615 //==============================================================================
5616 // INTCON Bits
5618 extern __at(0x0FF2) __sfr INTCON;
5620 typedef union
5622 struct
5624 unsigned RBIF : 1;
5625 unsigned INT0IF : 1;
5626 unsigned TMR0IF : 1;
5627 unsigned RBIE : 1;
5628 unsigned INT0IE : 1;
5629 unsigned TMR0IE : 1;
5630 unsigned PEIE_GIEL : 1;
5631 unsigned GIE_GIEH : 1;
5634 struct
5636 unsigned : 1;
5637 unsigned INT0F : 1;
5638 unsigned T0IF : 1;
5639 unsigned : 1;
5640 unsigned INT0E : 1;
5641 unsigned T0IE : 1;
5642 unsigned PEIE : 1;
5643 unsigned GIE : 1;
5646 struct
5648 unsigned : 1;
5649 unsigned : 1;
5650 unsigned : 1;
5651 unsigned : 1;
5652 unsigned : 1;
5653 unsigned : 1;
5654 unsigned GIEL : 1;
5655 unsigned GIEH : 1;
5657 } __INTCONbits_t;
5659 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5661 #define _RBIF 0x01
5662 #define _INT0IF 0x02
5663 #define _INT0F 0x02
5664 #define _TMR0IF 0x04
5665 #define _T0IF 0x04
5666 #define _RBIE 0x08
5667 #define _INT0IE 0x10
5668 #define _INT0E 0x10
5669 #define _TMR0IE 0x20
5670 #define _T0IE 0x20
5671 #define _PEIE_GIEL 0x40
5672 #define _PEIE 0x40
5673 #define _GIEL 0x40
5674 #define _GIE_GIEH 0x80
5675 #define _GIE 0x80
5676 #define _GIEH 0x80
5678 //==============================================================================
5680 extern __at(0x0FF3) __sfr PROD;
5681 extern __at(0x0FF3) __sfr PRODL;
5682 extern __at(0x0FF4) __sfr PRODH;
5683 extern __at(0x0FF5) __sfr TABLAT;
5684 extern __at(0x0FF6) __sfr TBLPTR;
5685 extern __at(0x0FF6) __sfr TBLPTRL;
5686 extern __at(0x0FF7) __sfr TBLPTRH;
5687 extern __at(0x0FF8) __sfr TBLPTRU;
5688 extern __at(0x0FF9) __sfr PC;
5689 extern __at(0x0FF9) __sfr PCL;
5690 extern __at(0x0FFA) __sfr PCLATH;
5691 extern __at(0x0FFB) __sfr PCLATU;
5693 //==============================================================================
5694 // STKPTR Bits
5696 extern __at(0x0FFC) __sfr STKPTR;
5698 typedef union
5700 struct
5702 unsigned SP0 : 1;
5703 unsigned SP1 : 1;
5704 unsigned SP2 : 1;
5705 unsigned SP3 : 1;
5706 unsigned SP4 : 1;
5707 unsigned : 1;
5708 unsigned STKUNF : 1;
5709 unsigned STKFUL : 1;
5712 struct
5714 unsigned STKPTR0 : 1;
5715 unsigned STKPTR1 : 1;
5716 unsigned STKPTR2 : 1;
5717 unsigned STKPTR3 : 1;
5718 unsigned STKPTR4 : 1;
5719 unsigned : 1;
5720 unsigned : 1;
5721 unsigned STKOVF : 1;
5724 struct
5726 unsigned STKPTR : 5;
5727 unsigned : 3;
5730 struct
5732 unsigned SP : 5;
5733 unsigned : 3;
5735 } __STKPTRbits_t;
5737 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5739 #define _SP0 0x01
5740 #define _STKPTR0 0x01
5741 #define _SP1 0x02
5742 #define _STKPTR1 0x02
5743 #define _SP2 0x04
5744 #define _STKPTR2 0x04
5745 #define _SP3 0x08
5746 #define _STKPTR3 0x08
5747 #define _SP4 0x10
5748 #define _STKPTR4 0x10
5749 #define _STKUNF 0x40
5750 #define _STKFUL 0x80
5751 #define _STKOVF 0x80
5753 //==============================================================================
5755 extern __at(0x0FFD) __sfr TOS;
5756 extern __at(0x0FFD) __sfr TOSL;
5757 extern __at(0x0FFE) __sfr TOSH;
5758 extern __at(0x0FFF) __sfr TOSU;
5760 //==============================================================================
5762 // Configuration Addresses
5764 //==============================================================================
5766 #define __CONFIG1L 0x01FFF8
5767 #define __CONFIG1H 0x01FFF9
5768 #define __CONFIG2L 0x01FFFA
5769 #define __CONFIG2H 0x01FFFB
5770 #define __CONFIG3L 0x01FFFC
5771 #define __CONFIG3H 0x01FFFD
5772 #define __CONFIG4L 0x01FFFE
5773 #define __CONFIG4H 0x01FFFF
5775 //==============================================================================
5777 #endif // #ifndef __PIC18F87J72_H__