Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f67j90.h
blob7c78603cc406ebc984523c83dcd57f7c2238b47c
1 /*
2 * This declarations of the PIC18F67J90 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:35 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 __PIC18F67J90_H__
26 #define __PIC18F67J90_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 T3RD16 : 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
3827 #define _T3CON_T3RD16 0x80
3829 //==============================================================================
3831 extern __at(0x0FB2) __sfr TMR3;
3832 extern __at(0x0FB2) __sfr TMR3L;
3833 extern __at(0x0FB3) __sfr TMR3H;
3835 //==============================================================================
3836 // CMCON Bits
3838 extern __at(0x0FB4) __sfr CMCON;
3840 typedef union
3842 struct
3844 unsigned CM0 : 1;
3845 unsigned CM1 : 1;
3846 unsigned CM2 : 1;
3847 unsigned CIS : 1;
3848 unsigned C1INV : 1;
3849 unsigned C2INV : 1;
3850 unsigned C1OUT : 1;
3851 unsigned C2OUT : 1;
3854 struct
3856 unsigned CM : 3;
3857 unsigned : 5;
3859 } __CMCONbits_t;
3861 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
3863 #define _CM0 0x01
3864 #define _CM1 0x02
3865 #define _CM2 0x04
3866 #define _CIS 0x08
3867 #define _C1INV 0x10
3868 #define _C2INV 0x20
3869 #define _C1OUT 0x40
3870 #define _C2OUT 0x80
3872 //==============================================================================
3875 //==============================================================================
3876 // CVRCON Bits
3878 extern __at(0x0FB5) __sfr CVRCON;
3880 typedef union
3882 struct
3884 unsigned CVR0 : 1;
3885 unsigned CVR1 : 1;
3886 unsigned CVR2 : 1;
3887 unsigned CVR3 : 1;
3888 unsigned CVRSS : 1;
3889 unsigned CVRR : 1;
3890 unsigned CVROE : 1;
3891 unsigned CVREN : 1;
3894 struct
3896 unsigned CVR : 4;
3897 unsigned : 4;
3899 } __CVRCONbits_t;
3901 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
3903 #define _CVR0 0x01
3904 #define _CVR1 0x02
3905 #define _CVR2 0x04
3906 #define _CVR3 0x08
3907 #define _CVRSS 0x10
3908 #define _CVRR 0x20
3909 #define _CVROE 0x40
3910 #define _CVREN 0x80
3912 //==============================================================================
3915 //==============================================================================
3916 // LCDSE1 Bits
3918 extern __at(0x0FB6) __sfr LCDSE1;
3920 typedef union
3922 struct
3924 unsigned SE8 : 1;
3925 unsigned SE9 : 1;
3926 unsigned SE10 : 1;
3927 unsigned SE11 : 1;
3928 unsigned SE12 : 1;
3929 unsigned SE13 : 1;
3930 unsigned SE14 : 1;
3931 unsigned SE15 : 1;
3934 struct
3936 unsigned SEGEN8 : 1;
3937 unsigned SEGEN9 : 1;
3938 unsigned SEGEN10 : 1;
3939 unsigned SEGEN11 : 1;
3940 unsigned SEGEN12 : 1;
3941 unsigned SEGEN13 : 1;
3942 unsigned SEGEN14 : 1;
3943 unsigned SEGEN15 : 1;
3946 struct
3948 unsigned SE08 : 1;
3949 unsigned SE09 : 1;
3950 unsigned : 1;
3951 unsigned : 1;
3952 unsigned : 1;
3953 unsigned : 1;
3954 unsigned : 1;
3955 unsigned : 1;
3957 } __LCDSE1bits_t;
3959 extern __at(0x0FB6) volatile __LCDSE1bits_t LCDSE1bits;
3961 #define _SE8 0x01
3962 #define _SEGEN8 0x01
3963 #define _SE08 0x01
3964 #define _SE9 0x02
3965 #define _SEGEN9 0x02
3966 #define _SE09 0x02
3967 #define _SE10 0x04
3968 #define _SEGEN10 0x04
3969 #define _SE11 0x08
3970 #define _SEGEN11 0x08
3971 #define _SE12 0x10
3972 #define _SEGEN12 0x10
3973 #define _SE13 0x20
3974 #define _SEGEN13 0x20
3975 #define _SE14 0x40
3976 #define _SEGEN14 0x40
3977 #define _SE15 0x80
3978 #define _SEGEN15 0x80
3980 //==============================================================================
3983 //==============================================================================
3984 // LCDSE2 Bits
3986 extern __at(0x0FB7) __sfr LCDSE2;
3988 typedef union
3990 struct
3992 unsigned SE16 : 1;
3993 unsigned SE17 : 1;
3994 unsigned SE18 : 1;
3995 unsigned SE19 : 1;
3996 unsigned SE20 : 1;
3997 unsigned SE21 : 1;
3998 unsigned SE22 : 1;
3999 unsigned SE23 : 1;
4002 struct
4004 unsigned SEGEN16 : 1;
4005 unsigned SEGEN17 : 1;
4006 unsigned SEGEN18 : 1;
4007 unsigned SEGEN19 : 1;
4008 unsigned SEGEN20 : 1;
4009 unsigned SEGEN21 : 1;
4010 unsigned SEGEN22 : 1;
4011 unsigned SEGEN23 : 1;
4013 } __LCDSE2bits_t;
4015 extern __at(0x0FB7) volatile __LCDSE2bits_t LCDSE2bits;
4017 #define _SE16 0x01
4018 #define _SEGEN16 0x01
4019 #define _SE17 0x02
4020 #define _SEGEN17 0x02
4021 #define _SE18 0x04
4022 #define _SEGEN18 0x04
4023 #define _SE19 0x08
4024 #define _SEGEN19 0x08
4025 #define _SE20 0x10
4026 #define _SEGEN20 0x10
4027 #define _SE21 0x20
4028 #define _SEGEN21 0x20
4029 #define _SE22 0x40
4030 #define _SEGEN22 0x40
4031 #define _SE23 0x80
4032 #define _SEGEN23 0x80
4034 //==============================================================================
4037 //==============================================================================
4038 // LCDSE3 Bits
4040 extern __at(0x0FB8) __sfr LCDSE3;
4042 typedef union
4044 struct
4046 unsigned SE24 : 1;
4047 unsigned SE25 : 1;
4048 unsigned SE26 : 1;
4049 unsigned SE27 : 1;
4050 unsigned SE28 : 1;
4051 unsigned SE29 : 1;
4052 unsigned SE30 : 1;
4053 unsigned SE31 : 1;
4056 struct
4058 unsigned SEGEN24 : 1;
4059 unsigned SEGEN25 : 1;
4060 unsigned SEGEN26 : 1;
4061 unsigned SEGEN27 : 1;
4062 unsigned SEGEN28 : 1;
4063 unsigned SEGEN29 : 1;
4064 unsigned SEGEN30 : 1;
4065 unsigned SEGEN31 : 1;
4067 } __LCDSE3bits_t;
4069 extern __at(0x0FB8) volatile __LCDSE3bits_t LCDSE3bits;
4071 #define _SE24 0x01
4072 #define _SEGEN24 0x01
4073 #define _SE25 0x02
4074 #define _SEGEN25 0x02
4075 #define _SE26 0x04
4076 #define _SEGEN26 0x04
4077 #define _SE27 0x08
4078 #define _SEGEN27 0x08
4079 #define _SE28 0x10
4080 #define _SEGEN28 0x10
4081 #define _SE29 0x20
4082 #define _SEGEN29 0x20
4083 #define _SE30 0x40
4084 #define _SEGEN30 0x40
4085 #define _SE31 0x80
4086 #define _SEGEN31 0x80
4088 //==============================================================================
4091 //==============================================================================
4092 // LCDSE4 Bits
4094 extern __at(0x0FB9) __sfr LCDSE4;
4096 typedef union
4098 struct
4100 unsigned SE32 : 1;
4101 unsigned : 1;
4102 unsigned : 1;
4103 unsigned : 1;
4104 unsigned : 1;
4105 unsigned : 1;
4106 unsigned : 1;
4107 unsigned : 1;
4110 struct
4112 unsigned SEGEN32 : 1;
4113 unsigned : 1;
4114 unsigned : 1;
4115 unsigned : 1;
4116 unsigned : 1;
4117 unsigned : 1;
4118 unsigned : 1;
4119 unsigned : 1;
4121 } __LCDSE4bits_t;
4123 extern __at(0x0FB9) volatile __LCDSE4bits_t LCDSE4bits;
4125 #define _SE32 0x01
4126 #define _SEGEN32 0x01
4128 //==============================================================================
4131 //==============================================================================
4132 // LCDDATA0 Bits
4134 extern __at(0x0FBB) __sfr LCDDATA0;
4136 typedef union
4138 struct
4140 unsigned S0C0 : 1;
4141 unsigned S1C0 : 1;
4142 unsigned S2C0 : 1;
4143 unsigned S3C0 : 1;
4144 unsigned S4C0 : 1;
4145 unsigned S5C0 : 1;
4146 unsigned S6C0 : 1;
4147 unsigned S7C0 : 1;
4150 struct
4152 unsigned SEG0COM0 : 1;
4153 unsigned SEG1COM0 : 1;
4154 unsigned SEG2COM0 : 1;
4155 unsigned SEG3COM0 : 1;
4156 unsigned SEG4COM0 : 1;
4157 unsigned SEG5COM0 : 1;
4158 unsigned SEG6COM0 : 1;
4159 unsigned SEG7COM0 : 1;
4162 struct
4164 unsigned S00C0 : 1;
4165 unsigned S01C0 : 1;
4166 unsigned S02C0 : 1;
4167 unsigned S03C0 : 1;
4168 unsigned S04C0 : 1;
4169 unsigned S05C0 : 1;
4170 unsigned S06C0 : 1;
4171 unsigned S07C0 : 1;
4173 } __LCDDATA0bits_t;
4175 extern __at(0x0FBB) volatile __LCDDATA0bits_t LCDDATA0bits;
4177 #define _S0C0 0x01
4178 #define _SEG0COM0 0x01
4179 #define _S00C0 0x01
4180 #define _S1C0 0x02
4181 #define _SEG1COM0 0x02
4182 #define _S01C0 0x02
4183 #define _S2C0 0x04
4184 #define _SEG2COM0 0x04
4185 #define _S02C0 0x04
4186 #define _S3C0 0x08
4187 #define _SEG3COM0 0x08
4188 #define _S03C0 0x08
4189 #define _S4C0 0x10
4190 #define _SEG4COM0 0x10
4191 #define _S04C0 0x10
4192 #define _S5C0 0x20
4193 #define _SEG5COM0 0x20
4194 #define _S05C0 0x20
4195 #define _S6C0 0x40
4196 #define _SEG6COM0 0x40
4197 #define _S06C0 0x40
4198 #define _S7C0 0x80
4199 #define _SEG7COM0 0x80
4200 #define _S07C0 0x80
4202 //==============================================================================
4205 //==============================================================================
4206 // LCDDATA1 Bits
4208 extern __at(0x0FBC) __sfr LCDDATA1;
4210 typedef union
4212 struct
4214 unsigned S8C0 : 1;
4215 unsigned S9C0 : 1;
4216 unsigned S10C0 : 1;
4217 unsigned S11C0 : 1;
4218 unsigned S12C0 : 1;
4219 unsigned S13C0 : 1;
4220 unsigned S14C0 : 1;
4221 unsigned S15C0 : 1;
4224 struct
4226 unsigned SEG8COM0 : 1;
4227 unsigned SEG9COM0 : 1;
4228 unsigned SEG10COM0 : 1;
4229 unsigned SEG11COM0 : 1;
4230 unsigned SEG12COM0 : 1;
4231 unsigned SEG13COM0 : 1;
4232 unsigned SEG14COM0 : 1;
4233 unsigned SEG15COM0 : 1;
4236 struct
4238 unsigned S08C0 : 1;
4239 unsigned S09C0 : 1;
4240 unsigned : 1;
4241 unsigned : 1;
4242 unsigned : 1;
4243 unsigned : 1;
4244 unsigned : 1;
4245 unsigned : 1;
4247 } __LCDDATA1bits_t;
4249 extern __at(0x0FBC) volatile __LCDDATA1bits_t LCDDATA1bits;
4251 #define _S8C0 0x01
4252 #define _SEG8COM0 0x01
4253 #define _S08C0 0x01
4254 #define _S9C0 0x02
4255 #define _SEG9COM0 0x02
4256 #define _S09C0 0x02
4257 #define _S10C0 0x04
4258 #define _SEG10COM0 0x04
4259 #define _S11C0 0x08
4260 #define _SEG11COM0 0x08
4261 #define _S12C0 0x10
4262 #define _SEG12COM0 0x10
4263 #define _S13C0 0x20
4264 #define _SEG13COM0 0x20
4265 #define _S14C0 0x40
4266 #define _SEG14COM0 0x40
4267 #define _S15C0 0x80
4268 #define _SEG15COM0 0x80
4270 //==============================================================================
4273 //==============================================================================
4274 // LCDDATA2 Bits
4276 extern __at(0x0FBD) __sfr LCDDATA2;
4278 typedef union
4280 struct
4282 unsigned S16C0 : 1;
4283 unsigned S17C0 : 1;
4284 unsigned S18C0 : 1;
4285 unsigned S19C0 : 1;
4286 unsigned S20C0 : 1;
4287 unsigned S21C0 : 1;
4288 unsigned S22C0 : 1;
4289 unsigned S23C0 : 1;
4292 struct
4294 unsigned SEG16COM0 : 1;
4295 unsigned SEG17COM0 : 1;
4296 unsigned SEG18COM0 : 1;
4297 unsigned SEG19COM0 : 1;
4298 unsigned SEG20COM0 : 1;
4299 unsigned SEG21COM0 : 1;
4300 unsigned SEG22COM0 : 1;
4301 unsigned SEG23COM0 : 1;
4303 } __LCDDATA2bits_t;
4305 extern __at(0x0FBD) volatile __LCDDATA2bits_t LCDDATA2bits;
4307 #define _S16C0 0x01
4308 #define _SEG16COM0 0x01
4309 #define _S17C0 0x02
4310 #define _SEG17COM0 0x02
4311 #define _S18C0 0x04
4312 #define _SEG18COM0 0x04
4313 #define _S19C0 0x08
4314 #define _SEG19COM0 0x08
4315 #define _S20C0 0x10
4316 #define _SEG20COM0 0x10
4317 #define _S21C0 0x20
4318 #define _SEG21COM0 0x20
4319 #define _S22C0 0x40
4320 #define _SEG22COM0 0x40
4321 #define _S23C0 0x80
4322 #define _SEG23COM0 0x80
4324 //==============================================================================
4327 //==============================================================================
4328 // LCDDATA3 Bits
4330 extern __at(0x0FBE) __sfr LCDDATA3;
4332 typedef union
4334 struct
4336 unsigned S24C0 : 1;
4337 unsigned S25C0 : 1;
4338 unsigned S26C0 : 1;
4339 unsigned S27C0 : 1;
4340 unsigned S28C0 : 1;
4341 unsigned S29C0 : 1;
4342 unsigned S30C0 : 1;
4343 unsigned S31C0 : 1;
4346 struct
4348 unsigned SEG24COM0 : 1;
4349 unsigned SEG25COM0 : 1;
4350 unsigned SEG26COM0 : 1;
4351 unsigned SEG27COM0 : 1;
4352 unsigned SEG28COM0 : 1;
4353 unsigned SEG29COM0 : 1;
4354 unsigned SEG30COM0 : 1;
4355 unsigned SEG31COM0 : 1;
4357 } __LCDDATA3bits_t;
4359 extern __at(0x0FBE) volatile __LCDDATA3bits_t LCDDATA3bits;
4361 #define _S24C0 0x01
4362 #define _SEG24COM0 0x01
4363 #define _S25C0 0x02
4364 #define _SEG25COM0 0x02
4365 #define _S26C0 0x04
4366 #define _SEG26COM0 0x04
4367 #define _S27C0 0x08
4368 #define _SEG27COM0 0x08
4369 #define _S28C0 0x10
4370 #define _SEG28COM0 0x10
4371 #define _S29C0 0x20
4372 #define _SEG29COM0 0x20
4373 #define _S30C0 0x40
4374 #define _SEG30COM0 0x40
4375 #define _S31C0 0x80
4376 #define _SEG31COM0 0x80
4378 //==============================================================================
4381 //==============================================================================
4382 // LCDDATA4 Bits
4384 extern __at(0x0FBF) __sfr LCDDATA4;
4386 typedef union
4388 struct
4390 unsigned S32C0 : 1;
4391 unsigned S33C0 : 1;
4392 unsigned S34C0 : 1;
4393 unsigned S35C0 : 1;
4394 unsigned S36C0 : 1;
4395 unsigned S37C0 : 1;
4396 unsigned S38C0 : 1;
4397 unsigned S39C0 : 1;
4400 struct
4402 unsigned SEG32COM0 : 1;
4403 unsigned SEG33COM0 : 1;
4404 unsigned SEG34COM0 : 1;
4405 unsigned SEG35COM0 : 1;
4406 unsigned SEG36COM0 : 1;
4407 unsigned SEG37COM0 : 1;
4408 unsigned SEG38COM0 : 1;
4409 unsigned SEG39COM0 : 1;
4411 } __LCDDATA4bits_t;
4413 extern __at(0x0FBF) volatile __LCDDATA4bits_t LCDDATA4bits;
4415 #define _S32C0 0x01
4416 #define _SEG32COM0 0x01
4417 #define _S33C0 0x02
4418 #define _SEG33COM0 0x02
4419 #define _S34C0 0x04
4420 #define _SEG34COM0 0x04
4421 #define _S35C0 0x08
4422 #define _SEG35COM0 0x08
4423 #define _S36C0 0x10
4424 #define _SEG36COM0 0x10
4425 #define _S37C0 0x20
4426 #define _SEG37COM0 0x20
4427 #define _S38C0 0x40
4428 #define _SEG38COM0 0x40
4429 #define _S39C0 0x80
4430 #define _SEG39COM0 0x80
4432 //==============================================================================
4435 //==============================================================================
4436 // ADCON2 Bits
4438 extern __at(0x0FC0) __sfr ADCON2;
4440 typedef union
4442 struct
4444 unsigned ADCS0 : 1;
4445 unsigned ADCS1 : 1;
4446 unsigned ADCS2 : 1;
4447 unsigned ACQT0 : 1;
4448 unsigned ACQT1 : 1;
4449 unsigned ACQT2 : 1;
4450 unsigned : 1;
4451 unsigned ADFM : 1;
4454 struct
4456 unsigned ADCS : 3;
4457 unsigned : 5;
4460 struct
4462 unsigned : 3;
4463 unsigned ACQT : 3;
4464 unsigned : 2;
4466 } __ADCON2bits_t;
4468 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4470 #define _ADCS0 0x01
4471 #define _ADCS1 0x02
4472 #define _ADCS2 0x04
4473 #define _ACQT0 0x08
4474 #define _ACQT1 0x10
4475 #define _ACQT2 0x20
4476 #define _ADFM 0x80
4478 //==============================================================================
4481 //==============================================================================
4482 // ADCON1 Bits
4484 extern __at(0x0FC1) __sfr ADCON1;
4486 typedef union
4488 struct
4490 unsigned PCFG0 : 1;
4491 unsigned PCFG1 : 1;
4492 unsigned PCFG2 : 1;
4493 unsigned PCFG3 : 1;
4494 unsigned VCFG0 : 1;
4495 unsigned VCFG1 : 1;
4496 unsigned : 1;
4497 unsigned TRIGSEL : 1;
4500 struct
4502 unsigned PCFG : 4;
4503 unsigned : 4;
4506 struct
4508 unsigned : 4;
4509 unsigned VCFG : 2;
4510 unsigned : 2;
4512 } __ADCON1bits_t;
4514 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4516 #define _PCFG0 0x01
4517 #define _PCFG1 0x02
4518 #define _PCFG2 0x04
4519 #define _PCFG3 0x08
4520 #define _VCFG0 0x10
4521 #define _VCFG1 0x20
4522 #define _TRIGSEL 0x80
4524 //==============================================================================
4527 //==============================================================================
4528 // ADCON0 Bits
4530 extern __at(0x0FC2) __sfr ADCON0;
4532 typedef union
4534 struct
4536 unsigned ADON : 1;
4537 unsigned GO_NOT_DONE : 1;
4538 unsigned CHS0 : 1;
4539 unsigned CHS1 : 1;
4540 unsigned CHS2 : 1;
4541 unsigned CHS3 : 1;
4542 unsigned : 1;
4543 unsigned ADCAL : 1;
4546 struct
4548 unsigned : 1;
4549 unsigned GO_DONE : 1;
4550 unsigned : 1;
4551 unsigned : 1;
4552 unsigned : 1;
4553 unsigned : 1;
4554 unsigned : 1;
4555 unsigned : 1;
4558 struct
4560 unsigned : 1;
4561 unsigned DONE : 1;
4562 unsigned : 1;
4563 unsigned : 1;
4564 unsigned : 1;
4565 unsigned : 1;
4566 unsigned : 1;
4567 unsigned : 1;
4570 struct
4572 unsigned : 1;
4573 unsigned GO : 1;
4574 unsigned : 1;
4575 unsigned : 1;
4576 unsigned : 1;
4577 unsigned : 1;
4578 unsigned : 1;
4579 unsigned : 1;
4582 struct
4584 unsigned : 1;
4585 unsigned NOT_DONE : 1;
4586 unsigned : 1;
4587 unsigned : 1;
4588 unsigned : 1;
4589 unsigned : 1;
4590 unsigned : 1;
4591 unsigned : 1;
4594 struct
4596 unsigned : 2;
4597 unsigned CHS : 4;
4598 unsigned : 2;
4600 } __ADCON0bits_t;
4602 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4604 #define _ADON 0x01
4605 #define _GO_NOT_DONE 0x02
4606 #define _GO_DONE 0x02
4607 #define _DONE 0x02
4608 #define _GO 0x02
4609 #define _NOT_DONE 0x02
4610 #define _CHS0 0x04
4611 #define _CHS1 0x08
4612 #define _CHS2 0x10
4613 #define _CHS3 0x20
4614 #define _ADCAL 0x80
4616 //==============================================================================
4618 extern __at(0x0FC3) __sfr ADRES;
4619 extern __at(0x0FC3) __sfr ADRESL;
4620 extern __at(0x0FC4) __sfr ADRESH;
4622 //==============================================================================
4623 // SSP1CON2 Bits
4625 extern __at(0x0FC5) __sfr SSP1CON2;
4627 typedef union
4629 struct
4631 unsigned SEN : 1;
4632 unsigned RSEN : 1;
4633 unsigned PEN : 1;
4634 unsigned RCEN : 1;
4635 unsigned ACKEN : 1;
4636 unsigned ACKDT : 1;
4637 unsigned ACKSTAT : 1;
4638 unsigned GCEN : 1;
4641 struct
4643 unsigned : 1;
4644 unsigned ADMSK1 : 1;
4645 unsigned ADMSK2 : 1;
4646 unsigned ADMSK3 : 1;
4647 unsigned ADMSK4 : 1;
4648 unsigned ADMSK5 : 1;
4649 unsigned : 1;
4650 unsigned : 1;
4652 } __SSP1CON2bits_t;
4654 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4656 #define _SEN 0x01
4657 #define _RSEN 0x02
4658 #define _ADMSK1 0x02
4659 #define _PEN 0x04
4660 #define _ADMSK2 0x04
4661 #define _RCEN 0x08
4662 #define _ADMSK3 0x08
4663 #define _ACKEN 0x10
4664 #define _ADMSK4 0x10
4665 #define _ACKDT 0x20
4666 #define _ADMSK5 0x20
4667 #define _ACKSTAT 0x40
4668 #define _GCEN 0x80
4670 //==============================================================================
4673 //==============================================================================
4674 // SSPCON2 Bits
4676 extern __at(0x0FC5) __sfr SSPCON2;
4678 typedef union
4680 struct
4682 unsigned SEN : 1;
4683 unsigned RSEN : 1;
4684 unsigned PEN : 1;
4685 unsigned RCEN : 1;
4686 unsigned ACKEN : 1;
4687 unsigned ACKDT : 1;
4688 unsigned ACKSTAT : 1;
4689 unsigned GCEN : 1;
4692 struct
4694 unsigned : 1;
4695 unsigned ADMSK1 : 1;
4696 unsigned ADMSK2 : 1;
4697 unsigned ADMSK3 : 1;
4698 unsigned ADMSK4 : 1;
4699 unsigned ADMSK5 : 1;
4700 unsigned : 1;
4701 unsigned : 1;
4703 } __SSPCON2bits_t;
4705 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4707 #define _SSPCON2_SEN 0x01
4708 #define _SSPCON2_RSEN 0x02
4709 #define _SSPCON2_ADMSK1 0x02
4710 #define _SSPCON2_PEN 0x04
4711 #define _SSPCON2_ADMSK2 0x04
4712 #define _SSPCON2_RCEN 0x08
4713 #define _SSPCON2_ADMSK3 0x08
4714 #define _SSPCON2_ACKEN 0x10
4715 #define _SSPCON2_ADMSK4 0x10
4716 #define _SSPCON2_ACKDT 0x20
4717 #define _SSPCON2_ADMSK5 0x20
4718 #define _SSPCON2_ACKSTAT 0x40
4719 #define _SSPCON2_GCEN 0x80
4721 //==============================================================================
4724 //==============================================================================
4725 // SSP1CON1 Bits
4727 extern __at(0x0FC6) __sfr SSP1CON1;
4729 typedef union
4731 struct
4733 unsigned SSPM0 : 1;
4734 unsigned SSPM1 : 1;
4735 unsigned SSPM2 : 1;
4736 unsigned SSPM3 : 1;
4737 unsigned CKP : 1;
4738 unsigned SSPEN : 1;
4739 unsigned SSPOV : 1;
4740 unsigned WCOL : 1;
4743 struct
4745 unsigned SSPM : 4;
4746 unsigned : 4;
4748 } __SSP1CON1bits_t;
4750 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4752 #define _SSPM0 0x01
4753 #define _SSPM1 0x02
4754 #define _SSPM2 0x04
4755 #define _SSPM3 0x08
4756 #define _CKP 0x10
4757 #define _SSPEN 0x20
4758 #define _SSPOV 0x40
4759 #define _WCOL 0x80
4761 //==============================================================================
4764 //==============================================================================
4765 // SSPCON1 Bits
4767 extern __at(0x0FC6) __sfr SSPCON1;
4769 typedef union
4771 struct
4773 unsigned SSPM0 : 1;
4774 unsigned SSPM1 : 1;
4775 unsigned SSPM2 : 1;
4776 unsigned SSPM3 : 1;
4777 unsigned CKP : 1;
4778 unsigned SSPEN : 1;
4779 unsigned SSPOV : 1;
4780 unsigned WCOL : 1;
4783 struct
4785 unsigned SSPM : 4;
4786 unsigned : 4;
4788 } __SSPCON1bits_t;
4790 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4792 #define _SSPCON1_SSPM0 0x01
4793 #define _SSPCON1_SSPM1 0x02
4794 #define _SSPCON1_SSPM2 0x04
4795 #define _SSPCON1_SSPM3 0x08
4796 #define _SSPCON1_CKP 0x10
4797 #define _SSPCON1_SSPEN 0x20
4798 #define _SSPCON1_SSPOV 0x40
4799 #define _SSPCON1_WCOL 0x80
4801 //==============================================================================
4804 //==============================================================================
4805 // SSP1STAT Bits
4807 extern __at(0x0FC7) __sfr SSP1STAT;
4809 typedef union
4811 struct
4813 unsigned BF : 1;
4814 unsigned UA : 1;
4815 unsigned R_NOT_W : 1;
4816 unsigned S : 1;
4817 unsigned P : 1;
4818 unsigned D_NOT_A : 1;
4819 unsigned CKE : 1;
4820 unsigned SMP : 1;
4823 struct
4825 unsigned : 1;
4826 unsigned : 1;
4827 unsigned R : 1;
4828 unsigned I2C_START : 1;
4829 unsigned I2C_STOP : 1;
4830 unsigned D : 1;
4831 unsigned : 1;
4832 unsigned : 1;
4835 struct
4837 unsigned : 1;
4838 unsigned : 1;
4839 unsigned R_W : 1;
4840 unsigned : 1;
4841 unsigned : 1;
4842 unsigned D_A : 1;
4843 unsigned : 1;
4844 unsigned : 1;
4847 struct
4849 unsigned : 1;
4850 unsigned : 1;
4851 unsigned NOT_W : 1;
4852 unsigned : 1;
4853 unsigned : 1;
4854 unsigned NOT_A : 1;
4855 unsigned : 1;
4856 unsigned : 1;
4859 struct
4861 unsigned : 1;
4862 unsigned : 1;
4863 unsigned NOT_WRITE : 1;
4864 unsigned : 1;
4865 unsigned : 1;
4866 unsigned NOT_ADDRESS : 1;
4867 unsigned : 1;
4868 unsigned : 1;
4871 struct
4873 unsigned : 1;
4874 unsigned : 1;
4875 unsigned READ_WRITE : 1;
4876 unsigned : 1;
4877 unsigned : 1;
4878 unsigned DATA_ADDRESS : 1;
4879 unsigned : 1;
4880 unsigned : 1;
4883 struct
4885 unsigned : 1;
4886 unsigned : 1;
4887 unsigned I2C_READ : 1;
4888 unsigned : 1;
4889 unsigned : 1;
4890 unsigned I2C_DAT : 1;
4891 unsigned : 1;
4892 unsigned : 1;
4894 } __SSP1STATbits_t;
4896 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4898 #define _BF 0x01
4899 #define _UA 0x02
4900 #define _R_NOT_W 0x04
4901 #define _R 0x04
4902 #define _R_W 0x04
4903 #define _NOT_W 0x04
4904 #define _NOT_WRITE 0x04
4905 #define _READ_WRITE 0x04
4906 #define _I2C_READ 0x04
4907 #define _S 0x08
4908 #define _I2C_START 0x08
4909 #define _P 0x10
4910 #define _I2C_STOP 0x10
4911 #define _D_NOT_A 0x20
4912 #define _D 0x20
4913 #define _D_A 0x20
4914 #define _NOT_A 0x20
4915 #define _NOT_ADDRESS 0x20
4916 #define _DATA_ADDRESS 0x20
4917 #define _I2C_DAT 0x20
4918 #define _CKE 0x40
4919 #define _SMP 0x80
4921 //==============================================================================
4924 //==============================================================================
4925 // SSPSTAT Bits
4927 extern __at(0x0FC7) __sfr SSPSTAT;
4929 typedef union
4931 struct
4933 unsigned BF : 1;
4934 unsigned UA : 1;
4935 unsigned R_NOT_W : 1;
4936 unsigned S : 1;
4937 unsigned P : 1;
4938 unsigned D_NOT_A : 1;
4939 unsigned CKE : 1;
4940 unsigned SMP : 1;
4943 struct
4945 unsigned : 1;
4946 unsigned : 1;
4947 unsigned R : 1;
4948 unsigned I2C_START : 1;
4949 unsigned I2C_STOP : 1;
4950 unsigned D : 1;
4951 unsigned : 1;
4952 unsigned : 1;
4955 struct
4957 unsigned : 1;
4958 unsigned : 1;
4959 unsigned R_W : 1;
4960 unsigned : 1;
4961 unsigned : 1;
4962 unsigned D_A : 1;
4963 unsigned : 1;
4964 unsigned : 1;
4967 struct
4969 unsigned : 1;
4970 unsigned : 1;
4971 unsigned NOT_W : 1;
4972 unsigned : 1;
4973 unsigned : 1;
4974 unsigned NOT_A : 1;
4975 unsigned : 1;
4976 unsigned : 1;
4979 struct
4981 unsigned : 1;
4982 unsigned : 1;
4983 unsigned NOT_WRITE : 1;
4984 unsigned : 1;
4985 unsigned : 1;
4986 unsigned NOT_ADDRESS : 1;
4987 unsigned : 1;
4988 unsigned : 1;
4991 struct
4993 unsigned : 1;
4994 unsigned : 1;
4995 unsigned READ_WRITE : 1;
4996 unsigned : 1;
4997 unsigned : 1;
4998 unsigned DATA_ADDRESS : 1;
4999 unsigned : 1;
5000 unsigned : 1;
5003 struct
5005 unsigned : 1;
5006 unsigned : 1;
5007 unsigned I2C_READ : 1;
5008 unsigned : 1;
5009 unsigned : 1;
5010 unsigned I2C_DAT : 1;
5011 unsigned : 1;
5012 unsigned : 1;
5014 } __SSPSTATbits_t;
5016 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5018 #define _SSPSTAT_BF 0x01
5019 #define _SSPSTAT_UA 0x02
5020 #define _SSPSTAT_R_NOT_W 0x04
5021 #define _SSPSTAT_R 0x04
5022 #define _SSPSTAT_R_W 0x04
5023 #define _SSPSTAT_NOT_W 0x04
5024 #define _SSPSTAT_NOT_WRITE 0x04
5025 #define _SSPSTAT_READ_WRITE 0x04
5026 #define _SSPSTAT_I2C_READ 0x04
5027 #define _SSPSTAT_S 0x08
5028 #define _SSPSTAT_I2C_START 0x08
5029 #define _SSPSTAT_P 0x10
5030 #define _SSPSTAT_I2C_STOP 0x10
5031 #define _SSPSTAT_D_NOT_A 0x20
5032 #define _SSPSTAT_D 0x20
5033 #define _SSPSTAT_D_A 0x20
5034 #define _SSPSTAT_NOT_A 0x20
5035 #define _SSPSTAT_NOT_ADDRESS 0x20
5036 #define _SSPSTAT_DATA_ADDRESS 0x20
5037 #define _SSPSTAT_I2C_DAT 0x20
5038 #define _SSPSTAT_CKE 0x40
5039 #define _SSPSTAT_SMP 0x80
5041 //==============================================================================
5044 //==============================================================================
5045 // SSP1ADD Bits
5047 extern __at(0x0FC8) __sfr SSP1ADD;
5049 typedef struct
5051 unsigned MSK0 : 1;
5052 unsigned MSK1 : 1;
5053 unsigned MSK2 : 1;
5054 unsigned MSK3 : 1;
5055 unsigned MSK4 : 1;
5056 unsigned MSK5 : 1;
5057 unsigned MSK6 : 1;
5058 unsigned MSK7 : 1;
5059 } __SSP1ADDbits_t;
5061 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
5063 #define _MSK0 0x01
5064 #define _MSK1 0x02
5065 #define _MSK2 0x04
5066 #define _MSK3 0x08
5067 #define _MSK4 0x10
5068 #define _MSK5 0x20
5069 #define _MSK6 0x40
5070 #define _MSK7 0x80
5072 //==============================================================================
5075 //==============================================================================
5076 // SSPADD Bits
5078 extern __at(0x0FC8) __sfr SSPADD;
5080 typedef struct
5082 unsigned MSK0 : 1;
5083 unsigned MSK1 : 1;
5084 unsigned MSK2 : 1;
5085 unsigned MSK3 : 1;
5086 unsigned MSK4 : 1;
5087 unsigned MSK5 : 1;
5088 unsigned MSK6 : 1;
5089 unsigned MSK7 : 1;
5090 } __SSPADDbits_t;
5092 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
5094 #define _SSPADD_MSK0 0x01
5095 #define _SSPADD_MSK1 0x02
5096 #define _SSPADD_MSK2 0x04
5097 #define _SSPADD_MSK3 0x08
5098 #define _SSPADD_MSK4 0x10
5099 #define _SSPADD_MSK5 0x20
5100 #define _SSPADD_MSK6 0x40
5101 #define _SSPADD_MSK7 0x80
5103 //==============================================================================
5105 extern __at(0x0FC9) __sfr SSP1BUF;
5106 extern __at(0x0FC9) __sfr SSPBUF;
5108 //==============================================================================
5109 // T2CON Bits
5111 extern __at(0x0FCA) __sfr T2CON;
5113 typedef union
5115 struct
5117 unsigned T2CKPS0 : 1;
5118 unsigned T2CKPS1 : 1;
5119 unsigned TMR2ON : 1;
5120 unsigned T2OUTPS0 : 1;
5121 unsigned T2OUTPS1 : 1;
5122 unsigned T2OUTPS2 : 1;
5123 unsigned T2OUTPS3 : 1;
5124 unsigned : 1;
5127 struct
5129 unsigned T2CKPS : 2;
5130 unsigned : 6;
5133 struct
5135 unsigned : 3;
5136 unsigned T2OUTPS : 4;
5137 unsigned : 1;
5139 } __T2CONbits_t;
5141 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5143 #define _T2CKPS0 0x01
5144 #define _T2CKPS1 0x02
5145 #define _TMR2ON 0x04
5146 #define _T2OUTPS0 0x08
5147 #define _T2OUTPS1 0x10
5148 #define _T2OUTPS2 0x20
5149 #define _T2OUTPS3 0x40
5151 //==============================================================================
5153 extern __at(0x0FCB) __sfr PR2;
5154 extern __at(0x0FCC) __sfr TMR2;
5156 //==============================================================================
5157 // T1CON Bits
5159 extern __at(0x0FCD) __sfr T1CON;
5161 typedef union
5163 struct
5165 unsigned TMR1ON : 1;
5166 unsigned TMR1CS : 1;
5167 unsigned NOT_T1SYNC : 1;
5168 unsigned T1OSCEN : 1;
5169 unsigned T1CKPS0 : 1;
5170 unsigned T1CKPS1 : 1;
5171 unsigned T1RUN : 1;
5172 unsigned RD16 : 1;
5175 struct
5177 unsigned : 1;
5178 unsigned : 1;
5179 unsigned T1INSYNC : 1;
5180 unsigned : 1;
5181 unsigned : 1;
5182 unsigned : 1;
5183 unsigned : 1;
5184 unsigned T1RD16 : 1;
5187 struct
5189 unsigned : 1;
5190 unsigned : 1;
5191 unsigned T1SYNC : 1;
5192 unsigned : 1;
5193 unsigned : 1;
5194 unsigned : 1;
5195 unsigned : 1;
5196 unsigned : 1;
5199 struct
5201 unsigned : 4;
5202 unsigned T1CKPS : 2;
5203 unsigned : 2;
5205 } __T1CONbits_t;
5207 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5209 #define _TMR1ON 0x01
5210 #define _TMR1CS 0x02
5211 #define _NOT_T1SYNC 0x04
5212 #define _T1INSYNC 0x04
5213 #define _T1SYNC 0x04
5214 #define _T1OSCEN 0x08
5215 #define _T1CKPS0 0x10
5216 #define _T1CKPS1 0x20
5217 #define _T1RUN 0x40
5218 #define _RD16 0x80
5219 #define _T1RD16 0x80
5221 //==============================================================================
5223 extern __at(0x0FCE) __sfr TMR1;
5224 extern __at(0x0FCE) __sfr TMR1L;
5225 extern __at(0x0FCF) __sfr TMR1H;
5227 //==============================================================================
5228 // RCON Bits
5230 extern __at(0x0FD0) __sfr RCON;
5232 typedef union
5234 struct
5236 unsigned NOT_BOR : 1;
5237 unsigned NOT_POR : 1;
5238 unsigned NOT_PD : 1;
5239 unsigned NOT_TO : 1;
5240 unsigned NOT_RI : 1;
5241 unsigned NOT_CM : 1;
5242 unsigned : 1;
5243 unsigned IPEN : 1;
5246 struct
5248 unsigned BOR : 1;
5249 unsigned POR : 1;
5250 unsigned PD : 1;
5251 unsigned TO : 1;
5252 unsigned RI : 1;
5253 unsigned CM : 1;
5254 unsigned : 1;
5255 unsigned : 1;
5257 } __RCONbits_t;
5259 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5261 #define _NOT_BOR 0x01
5262 #define _BOR 0x01
5263 #define _NOT_POR 0x02
5264 #define _POR 0x02
5265 #define _NOT_PD 0x04
5266 #define _PD 0x04
5267 #define _NOT_TO 0x08
5268 #define _TO 0x08
5269 #define _NOT_RI 0x10
5270 #define _RI 0x10
5271 #define _NOT_CM 0x20
5272 #define _CM 0x20
5273 #define _IPEN 0x80
5275 //==============================================================================
5278 //==============================================================================
5279 // WDTCON Bits
5281 extern __at(0x0FD1) __sfr WDTCON;
5283 typedef union
5285 struct
5287 unsigned SWDTEN : 1;
5288 unsigned : 1;
5289 unsigned : 1;
5290 unsigned : 1;
5291 unsigned : 1;
5292 unsigned : 1;
5293 unsigned : 1;
5294 unsigned REGSLP : 1;
5297 struct
5299 unsigned SWDTE : 1;
5300 unsigned : 1;
5301 unsigned : 1;
5302 unsigned : 1;
5303 unsigned : 1;
5304 unsigned : 1;
5305 unsigned : 1;
5306 unsigned : 1;
5308 } __WDTCONbits_t;
5310 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5312 #define _SWDTEN 0x01
5313 #define _SWDTE 0x01
5314 #define _REGSLP 0x80
5316 //==============================================================================
5319 //==============================================================================
5320 // LCDREG Bits
5322 extern __at(0x0FD2) __sfr LCDREG;
5324 typedef union
5326 struct
5328 unsigned CKSEL0 : 1;
5329 unsigned CKSEL1 : 1;
5330 unsigned MODE13 : 1;
5331 unsigned BIAS0 : 1;
5332 unsigned BIAS1 : 1;
5333 unsigned BIAS2 : 1;
5334 unsigned CPEN : 1;
5335 unsigned : 1;
5338 struct
5340 unsigned CKSEL : 2;
5341 unsigned : 6;
5344 struct
5346 unsigned : 3;
5347 unsigned BIAS : 3;
5348 unsigned : 2;
5350 } __LCDREGbits_t;
5352 extern __at(0x0FD2) volatile __LCDREGbits_t LCDREGbits;
5354 #define _CKSEL0 0x01
5355 #define _CKSEL1 0x02
5356 #define _MODE13 0x04
5357 #define _BIAS0 0x08
5358 #define _BIAS1 0x10
5359 #define _BIAS2 0x20
5360 #define _CPEN 0x40
5362 //==============================================================================
5365 //==============================================================================
5366 // OSCCON Bits
5368 extern __at(0x0FD3) __sfr OSCCON;
5370 typedef union
5372 struct
5374 unsigned SCS0 : 1;
5375 unsigned SCS1 : 1;
5376 unsigned IOFS : 1;
5377 unsigned OSTS : 1;
5378 unsigned IRCF0 : 1;
5379 unsigned IRCF1 : 1;
5380 unsigned IRCF2 : 1;
5381 unsigned IDLEN : 1;
5384 struct
5386 unsigned SCS : 2;
5387 unsigned : 6;
5390 struct
5392 unsigned : 4;
5393 unsigned IRCF : 3;
5394 unsigned : 1;
5396 } __OSCCONbits_t;
5398 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5400 #define _SCS0 0x01
5401 #define _SCS1 0x02
5402 #define _IOFS 0x04
5403 #define _OSTS 0x08
5404 #define _IRCF0 0x10
5405 #define _IRCF1 0x20
5406 #define _IRCF2 0x40
5407 #define _IDLEN 0x80
5409 //==============================================================================
5412 //==============================================================================
5413 // T0CON Bits
5415 extern __at(0x0FD5) __sfr T0CON;
5417 typedef union
5419 struct
5421 unsigned T0PS0 : 1;
5422 unsigned T0PS1 : 1;
5423 unsigned T0PS2 : 1;
5424 unsigned PSA : 1;
5425 unsigned T0SE : 1;
5426 unsigned T0CS : 1;
5427 unsigned T08BIT : 1;
5428 unsigned TMR0ON : 1;
5431 struct
5433 unsigned T0PS : 3;
5434 unsigned : 5;
5436 } __T0CONbits_t;
5438 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5440 #define _T0PS0 0x01
5441 #define _T0PS1 0x02
5442 #define _T0PS2 0x04
5443 #define _PSA 0x08
5444 #define _T0SE 0x10
5445 #define _T0CS 0x20
5446 #define _T08BIT 0x40
5447 #define _TMR0ON 0x80
5449 //==============================================================================
5451 extern __at(0x0FD6) __sfr TMR0;
5452 extern __at(0x0FD6) __sfr TMR0L;
5453 extern __at(0x0FD7) __sfr TMR0H;
5455 //==============================================================================
5456 // STATUS Bits
5458 extern __at(0x0FD8) __sfr STATUS;
5460 typedef struct
5462 unsigned C : 1;
5463 unsigned DC : 1;
5464 unsigned Z : 1;
5465 unsigned OV : 1;
5466 unsigned N : 1;
5467 unsigned : 1;
5468 unsigned : 1;
5469 unsigned : 1;
5470 } __STATUSbits_t;
5472 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5474 #define _C 0x01
5475 #define _DC 0x02
5476 #define _Z 0x04
5477 #define _OV 0x08
5478 #define _N 0x10
5480 //==============================================================================
5482 extern __at(0x0FD9) __sfr FSR2L;
5483 extern __at(0x0FDA) __sfr FSR2H;
5484 extern __at(0x0FDB) __sfr PLUSW2;
5485 extern __at(0x0FDC) __sfr PREINC2;
5486 extern __at(0x0FDD) __sfr POSTDEC2;
5487 extern __at(0x0FDE) __sfr POSTINC2;
5488 extern __at(0x0FDF) __sfr INDF2;
5489 extern __at(0x0FE0) __sfr BSR;
5490 extern __at(0x0FE1) __sfr FSR1L;
5491 extern __at(0x0FE2) __sfr FSR1H;
5492 extern __at(0x0FE3) __sfr PLUSW1;
5493 extern __at(0x0FE4) __sfr PREINC1;
5494 extern __at(0x0FE5) __sfr POSTDEC1;
5495 extern __at(0x0FE6) __sfr POSTINC1;
5496 extern __at(0x0FE7) __sfr INDF1;
5497 extern __at(0x0FE8) __sfr WREG;
5498 extern __at(0x0FE9) __sfr FSR0L;
5499 extern __at(0x0FEA) __sfr FSR0H;
5500 extern __at(0x0FEB) __sfr PLUSW0;
5501 extern __at(0x0FEC) __sfr PREINC0;
5502 extern __at(0x0FED) __sfr POSTDEC0;
5503 extern __at(0x0FEE) __sfr POSTINC0;
5504 extern __at(0x0FEF) __sfr INDF0;
5506 //==============================================================================
5507 // INTCON3 Bits
5509 extern __at(0x0FF0) __sfr INTCON3;
5511 typedef union
5513 struct
5515 unsigned INT1IF : 1;
5516 unsigned INT2IF : 1;
5517 unsigned INT3IF : 1;
5518 unsigned INT1IE : 1;
5519 unsigned INT2IE : 1;
5520 unsigned INT3IE : 1;
5521 unsigned INT1IP : 1;
5522 unsigned INT2IP : 1;
5525 struct
5527 unsigned INT1F : 1;
5528 unsigned INT2F : 1;
5529 unsigned INT3F : 1;
5530 unsigned INT1E : 1;
5531 unsigned INT2E : 1;
5532 unsigned INT3E : 1;
5533 unsigned INT1P : 1;
5534 unsigned INT2P : 1;
5536 } __INTCON3bits_t;
5538 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5540 #define _INT1IF 0x01
5541 #define _INT1F 0x01
5542 #define _INT2IF 0x02
5543 #define _INT2F 0x02
5544 #define _INT3IF 0x04
5545 #define _INT3F 0x04
5546 #define _INT1IE 0x08
5547 #define _INT1E 0x08
5548 #define _INT2IE 0x10
5549 #define _INT2E 0x10
5550 #define _INT3IE 0x20
5551 #define _INT3E 0x20
5552 #define _INT1IP 0x40
5553 #define _INT1P 0x40
5554 #define _INT2IP 0x80
5555 #define _INT2P 0x80
5557 //==============================================================================
5560 //==============================================================================
5561 // INTCON2 Bits
5563 extern __at(0x0FF1) __sfr INTCON2;
5565 typedef union
5567 struct
5569 unsigned RBIP : 1;
5570 unsigned INT3IP : 1;
5571 unsigned TMR0IP : 1;
5572 unsigned INTEDG3 : 1;
5573 unsigned INTEDG2 : 1;
5574 unsigned INTEDG1 : 1;
5575 unsigned INTEDG0 : 1;
5576 unsigned NOT_RBPU : 1;
5579 struct
5581 unsigned : 1;
5582 unsigned INT3P : 1;
5583 unsigned T0IP : 1;
5584 unsigned : 1;
5585 unsigned : 1;
5586 unsigned : 1;
5587 unsigned : 1;
5588 unsigned RBPU : 1;
5590 } __INTCON2bits_t;
5592 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5594 #define _RBIP 0x01
5595 #define _INT3IP 0x02
5596 #define _INT3P 0x02
5597 #define _TMR0IP 0x04
5598 #define _T0IP 0x04
5599 #define _INTEDG3 0x08
5600 #define _INTEDG2 0x10
5601 #define _INTEDG1 0x20
5602 #define _INTEDG0 0x40
5603 #define _NOT_RBPU 0x80
5604 #define _RBPU 0x80
5606 //==============================================================================
5609 //==============================================================================
5610 // INTCON Bits
5612 extern __at(0x0FF2) __sfr INTCON;
5614 typedef union
5616 struct
5618 unsigned RBIF : 1;
5619 unsigned INT0IF : 1;
5620 unsigned TMR0IF : 1;
5621 unsigned RBIE : 1;
5622 unsigned INT0IE : 1;
5623 unsigned TMR0IE : 1;
5624 unsigned PEIE_GIEL : 1;
5625 unsigned GIE_GIEH : 1;
5628 struct
5630 unsigned : 1;
5631 unsigned INT0F : 1;
5632 unsigned T0IF : 1;
5633 unsigned : 1;
5634 unsigned INT0E : 1;
5635 unsigned T0IE : 1;
5636 unsigned PEIE : 1;
5637 unsigned GIE : 1;
5640 struct
5642 unsigned : 1;
5643 unsigned : 1;
5644 unsigned : 1;
5645 unsigned : 1;
5646 unsigned : 1;
5647 unsigned : 1;
5648 unsigned GIEL : 1;
5649 unsigned GIEH : 1;
5651 } __INTCONbits_t;
5653 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5655 #define _RBIF 0x01
5656 #define _INT0IF 0x02
5657 #define _INT0F 0x02
5658 #define _TMR0IF 0x04
5659 #define _T0IF 0x04
5660 #define _RBIE 0x08
5661 #define _INT0IE 0x10
5662 #define _INT0E 0x10
5663 #define _TMR0IE 0x20
5664 #define _T0IE 0x20
5665 #define _PEIE_GIEL 0x40
5666 #define _PEIE 0x40
5667 #define _GIEL 0x40
5668 #define _GIE_GIEH 0x80
5669 #define _GIE 0x80
5670 #define _GIEH 0x80
5672 //==============================================================================
5674 extern __at(0x0FF3) __sfr PROD;
5675 extern __at(0x0FF3) __sfr PRODL;
5676 extern __at(0x0FF4) __sfr PRODH;
5677 extern __at(0x0FF5) __sfr TABLAT;
5678 extern __at(0x0FF6) __sfr TBLPTR;
5679 extern __at(0x0FF6) __sfr TBLPTRL;
5680 extern __at(0x0FF7) __sfr TBLPTRH;
5681 extern __at(0x0FF8) __sfr TBLPTRU;
5682 extern __at(0x0FF9) __sfr PC;
5683 extern __at(0x0FF9) __sfr PCL;
5684 extern __at(0x0FFA) __sfr PCLATH;
5685 extern __at(0x0FFB) __sfr PCLATU;
5687 //==============================================================================
5688 // STKPTR Bits
5690 extern __at(0x0FFC) __sfr STKPTR;
5692 typedef union
5694 struct
5696 unsigned SP0 : 1;
5697 unsigned SP1 : 1;
5698 unsigned SP2 : 1;
5699 unsigned SP3 : 1;
5700 unsigned SP4 : 1;
5701 unsigned : 1;
5702 unsigned STKUNF : 1;
5703 unsigned STKFUL : 1;
5706 struct
5708 unsigned STKPTR0 : 1;
5709 unsigned STKPTR1 : 1;
5710 unsigned STKPTR2 : 1;
5711 unsigned STKPTR3 : 1;
5712 unsigned STKPTR4 : 1;
5713 unsigned : 1;
5714 unsigned : 1;
5715 unsigned STKOVF : 1;
5718 struct
5720 unsigned STKPTR : 5;
5721 unsigned : 3;
5724 struct
5726 unsigned SP : 5;
5727 unsigned : 3;
5729 } __STKPTRbits_t;
5731 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5733 #define _SP0 0x01
5734 #define _STKPTR0 0x01
5735 #define _SP1 0x02
5736 #define _STKPTR1 0x02
5737 #define _SP2 0x04
5738 #define _STKPTR2 0x04
5739 #define _SP3 0x08
5740 #define _STKPTR3 0x08
5741 #define _SP4 0x10
5742 #define _STKPTR4 0x10
5743 #define _STKUNF 0x40
5744 #define _STKFUL 0x80
5745 #define _STKOVF 0x80
5747 //==============================================================================
5749 extern __at(0x0FFD) __sfr TOS;
5750 extern __at(0x0FFD) __sfr TOSL;
5751 extern __at(0x0FFE) __sfr TOSH;
5752 extern __at(0x0FFF) __sfr TOSU;
5754 //==============================================================================
5756 // Configuration Addresses
5758 //==============================================================================
5760 #define __CONFIG1L 0x01FFF8
5761 #define __CONFIG1H 0x01FFF9
5762 #define __CONFIG2L 0x01FFFA
5763 #define __CONFIG2H 0x01FFFB
5764 #define __CONFIG3L 0x01FFFC
5765 #define __CONFIG3H 0x01FFFD
5766 #define __CONFIG4L 0x01FFFE
5767 #define __CONFIG4H 0x01FFFF
5769 //==============================================================================
5771 #endif // #ifndef __PIC18F67J90_H__