struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f64j90.h
blob087dbe2eee4ee99654ba7a386ec1a2e4ef98ca83
1 /*
2 * This declarations of the PIC18F64J90 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:31 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 __PIC18F64J90_H__
26 #define __PIC18F64J90_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // RCSTA2 Bits
40 extern __at(0x0F60) __sfr RCSTA2;
42 typedef union
44 struct
46 unsigned RX9D : 1;
47 unsigned OERR : 1;
48 unsigned FERR : 1;
49 unsigned ADDEN : 1;
50 unsigned CREN : 1;
51 unsigned SREN : 1;
52 unsigned RX9 : 1;
53 unsigned SPEN : 1;
56 struct
58 unsigned RCD8 : 1;
59 unsigned OERR2 : 1;
60 unsigned FERR2 : 1;
61 unsigned ADDEN2 : 1;
62 unsigned CREN2 : 1;
63 unsigned SREN2 : 1;
64 unsigned RC9 : 1;
65 unsigned SPEN2 : 1;
68 struct
70 unsigned RX9D2 : 1;
71 unsigned : 1;
72 unsigned : 1;
73 unsigned : 1;
74 unsigned : 1;
75 unsigned : 1;
76 unsigned NOT_RC8 : 1;
77 unsigned : 1;
80 struct
82 unsigned : 1;
83 unsigned : 1;
84 unsigned : 1;
85 unsigned : 1;
86 unsigned : 1;
87 unsigned : 1;
88 unsigned RC8_9 : 1;
89 unsigned : 1;
92 struct
94 unsigned : 1;
95 unsigned : 1;
96 unsigned : 1;
97 unsigned : 1;
98 unsigned : 1;
99 unsigned : 1;
100 unsigned RX92 : 1;
101 unsigned : 1;
103 } __RCSTA2bits_t;
105 extern __at(0x0F60) volatile __RCSTA2bits_t RCSTA2bits;
107 #define _RCSTA2_RX9D 0x01
108 #define _RCSTA2_RCD8 0x01
109 #define _RCSTA2_RX9D2 0x01
110 #define _RCSTA2_OERR 0x02
111 #define _RCSTA2_OERR2 0x02
112 #define _RCSTA2_FERR 0x04
113 #define _RCSTA2_FERR2 0x04
114 #define _RCSTA2_ADDEN 0x08
115 #define _RCSTA2_ADDEN2 0x08
116 #define _RCSTA2_CREN 0x10
117 #define _RCSTA2_CREN2 0x10
118 #define _RCSTA2_SREN 0x20
119 #define _RCSTA2_SREN2 0x20
120 #define _RCSTA2_RX9 0x40
121 #define _RCSTA2_RC9 0x40
122 #define _RCSTA2_NOT_RC8 0x40
123 #define _RCSTA2_RC8_9 0x40
124 #define _RCSTA2_RX92 0x40
125 #define _RCSTA2_SPEN 0x80
126 #define _RCSTA2_SPEN2 0x80
128 //==============================================================================
131 //==============================================================================
132 // TXSTA2 Bits
134 extern __at(0x0F61) __sfr TXSTA2;
136 typedef union
138 struct
140 unsigned TX9D : 1;
141 unsigned TRMT : 1;
142 unsigned BRGH : 1;
143 unsigned SENDB2 : 1;
144 unsigned SYNC : 1;
145 unsigned TXEN : 1;
146 unsigned TX9 : 1;
147 unsigned CSRC : 1;
150 struct
152 unsigned TXD8 : 1;
153 unsigned TRMT2 : 1;
154 unsigned BRGH2 : 1;
155 unsigned : 1;
156 unsigned SYNC2 : 1;
157 unsigned TXEN2 : 1;
158 unsigned TX8_9 : 1;
159 unsigned CSRC2 : 1;
162 struct
164 unsigned TX9D2 : 1;
165 unsigned : 1;
166 unsigned : 1;
167 unsigned : 1;
168 unsigned : 1;
169 unsigned : 1;
170 unsigned NOT_TX8 : 1;
171 unsigned : 1;
174 struct
176 unsigned : 1;
177 unsigned : 1;
178 unsigned : 1;
179 unsigned : 1;
180 unsigned : 1;
181 unsigned : 1;
182 unsigned TX92 : 1;
183 unsigned : 1;
185 } __TXSTA2bits_t;
187 extern __at(0x0F61) volatile __TXSTA2bits_t TXSTA2bits;
189 #define _TXSTA2_TX9D 0x01
190 #define _TXSTA2_TXD8 0x01
191 #define _TXSTA2_TX9D2 0x01
192 #define _TXSTA2_TRMT 0x02
193 #define _TXSTA2_TRMT2 0x02
194 #define _TXSTA2_BRGH 0x04
195 #define _TXSTA2_BRGH2 0x04
196 #define _TXSTA2_SENDB2 0x08
197 #define _TXSTA2_SYNC 0x10
198 #define _TXSTA2_SYNC2 0x10
199 #define _TXSTA2_TXEN 0x20
200 #define _TXSTA2_TXEN2 0x20
201 #define _TXSTA2_TX9 0x40
202 #define _TXSTA2_TX8_9 0x40
203 #define _TXSTA2_NOT_TX8 0x40
204 #define _TXSTA2_TX92 0x40
205 #define _TXSTA2_CSRC 0x80
206 #define _TXSTA2_CSRC2 0x80
208 //==============================================================================
210 extern __at(0x0F62) __sfr TXREG2;
211 extern __at(0x0F63) __sfr RCREG2;
212 extern __at(0x0F64) __sfr SPBRG2;
214 //==============================================================================
215 // CCP2CON Bits
217 extern __at(0x0F65) __sfr CCP2CON;
219 typedef union
221 struct
223 unsigned CCP2M0 : 1;
224 unsigned CCP2M1 : 1;
225 unsigned CCP2M2 : 1;
226 unsigned CCP2M3 : 1;
227 unsigned DC2B0 : 1;
228 unsigned DC2B1 : 1;
229 unsigned : 1;
230 unsigned : 1;
233 struct
235 unsigned : 1;
236 unsigned : 1;
237 unsigned : 1;
238 unsigned : 1;
239 unsigned DCCP2Y : 1;
240 unsigned DCCP2X : 1;
241 unsigned : 1;
242 unsigned : 1;
245 struct
247 unsigned CCP2M : 4;
248 unsigned : 4;
251 struct
253 unsigned : 4;
254 unsigned DC2B : 2;
255 unsigned : 2;
257 } __CCP2CONbits_t;
259 extern __at(0x0F65) volatile __CCP2CONbits_t CCP2CONbits;
261 #define _CCP2M0 0x01
262 #define _CCP2M1 0x02
263 #define _CCP2M2 0x04
264 #define _CCP2M3 0x08
265 #define _DC2B0 0x10
266 #define _DCCP2Y 0x10
267 #define _DC2B1 0x20
268 #define _DCCP2X 0x20
270 //==============================================================================
272 extern __at(0x0F66) __sfr CCPR2;
273 extern __at(0x0F66) __sfr CCPR2L;
274 extern __at(0x0F67) __sfr CCPR2H;
276 //==============================================================================
277 // CCP1CON Bits
279 extern __at(0x0F68) __sfr CCP1CON;
281 typedef union
283 struct
285 unsigned CCP1M0 : 1;
286 unsigned CCP1M1 : 1;
287 unsigned CCP1M2 : 1;
288 unsigned CCP1M3 : 1;
289 unsigned DC1B0 : 1;
290 unsigned DC1B1 : 1;
291 unsigned : 1;
292 unsigned : 1;
295 struct
297 unsigned : 1;
298 unsigned : 1;
299 unsigned : 1;
300 unsigned : 1;
301 unsigned DCCP1Y : 1;
302 unsigned DCCP1X : 1;
303 unsigned : 1;
304 unsigned : 1;
307 struct
309 unsigned CCP1M : 4;
310 unsigned : 4;
313 struct
315 unsigned : 4;
316 unsigned DC1B : 2;
317 unsigned : 2;
319 } __CCP1CONbits_t;
321 extern __at(0x0F68) volatile __CCP1CONbits_t CCP1CONbits;
323 #define _CCP1M0 0x01
324 #define _CCP1M1 0x02
325 #define _CCP1M2 0x04
326 #define _CCP1M3 0x08
327 #define _DC1B0 0x10
328 #define _DCCP1Y 0x10
329 #define _DC1B1 0x20
330 #define _DCCP1X 0x20
332 //==============================================================================
334 extern __at(0x0F69) __sfr CCPR1;
335 extern __at(0x0F69) __sfr CCPR1L;
336 extern __at(0x0F6A) __sfr CCPR1H;
338 //==============================================================================
339 // LCDDATA6 Bits
341 extern __at(0x0F6C) __sfr LCDDATA6;
343 typedef union
345 struct
347 unsigned S00C1 : 1;
348 unsigned S01C1 : 1;
349 unsigned S02C1 : 1;
350 unsigned S03C1 : 1;
351 unsigned S04C1 : 1;
352 unsigned S05C1 : 1;
353 unsigned S06C1 : 1;
354 unsigned S07C1 : 1;
357 struct
359 unsigned SEG0COM1 : 1;
360 unsigned SEG1COM1 : 1;
361 unsigned SEG2COM1 : 1;
362 unsigned SEG3COM1 : 1;
363 unsigned SEG4COM1 : 1;
364 unsigned SEG5COM1 : 1;
365 unsigned SEG6COM1 : 1;
366 unsigned SEG7COM1 : 1;
369 struct
371 unsigned S0C1 : 1;
372 unsigned S1C1 : 1;
373 unsigned S2C1 : 1;
374 unsigned S3C1 : 1;
375 unsigned S4C1 : 1;
376 unsigned S5C1 : 1;
377 unsigned S6C1 : 1;
378 unsigned S7C1 : 1;
380 } __LCDDATA6bits_t;
382 extern __at(0x0F6C) volatile __LCDDATA6bits_t LCDDATA6bits;
384 #define _S00C1 0x01
385 #define _SEG0COM1 0x01
386 #define _S0C1 0x01
387 #define _S01C1 0x02
388 #define _SEG1COM1 0x02
389 #define _S1C1 0x02
390 #define _S02C1 0x04
391 #define _SEG2COM1 0x04
392 #define _S2C1 0x04
393 #define _S03C1 0x08
394 #define _SEG3COM1 0x08
395 #define _S3C1 0x08
396 #define _S04C1 0x10
397 #define _SEG4COM1 0x10
398 #define _S4C1 0x10
399 #define _S05C1 0x20
400 #define _SEG5COM1 0x20
401 #define _S5C1 0x20
402 #define _S06C1 0x40
403 #define _SEG6COM1 0x40
404 #define _S6C1 0x40
405 #define _S07C1 0x80
406 #define _SEG7COM1 0x80
407 #define _S7C1 0x80
409 //==============================================================================
412 //==============================================================================
413 // LCDDATA7 Bits
415 extern __at(0x0F6D) __sfr LCDDATA7;
417 typedef union
419 struct
421 unsigned S8C1 : 1;
422 unsigned S9C1 : 1;
423 unsigned S10C1 : 1;
424 unsigned S11C1 : 1;
425 unsigned S12C1 : 1;
426 unsigned S13C1 : 1;
427 unsigned S14C1 : 1;
428 unsigned S15C1 : 1;
431 struct
433 unsigned SEG8COM1 : 1;
434 unsigned SEG9COM1 : 1;
435 unsigned SEG10COM1 : 1;
436 unsigned SEG11COM1 : 1;
437 unsigned SEG12COM1 : 1;
438 unsigned SEG13COM1 : 1;
439 unsigned SEG14COM1 : 1;
440 unsigned SEG15COM1 : 1;
443 struct
445 unsigned S08C1 : 1;
446 unsigned S09C1 : 1;
447 unsigned : 1;
448 unsigned : 1;
449 unsigned : 1;
450 unsigned : 1;
451 unsigned : 1;
452 unsigned : 1;
454 } __LCDDATA7bits_t;
456 extern __at(0x0F6D) volatile __LCDDATA7bits_t LCDDATA7bits;
458 #define _S8C1 0x01
459 #define _SEG8COM1 0x01
460 #define _S08C1 0x01
461 #define _S9C1 0x02
462 #define _SEG9COM1 0x02
463 #define _S09C1 0x02
464 #define _S10C1 0x04
465 #define _SEG10COM1 0x04
466 #define _S11C1 0x08
467 #define _SEG11COM1 0x08
468 #define _S12C1 0x10
469 #define _SEG12COM1 0x10
470 #define _S13C1 0x20
471 #define _SEG13COM1 0x20
472 #define _S14C1 0x40
473 #define _SEG14COM1 0x40
474 #define _S15C1 0x80
475 #define _SEG15COM1 0x80
477 //==============================================================================
480 //==============================================================================
481 // LCDDATA8 Bits
483 extern __at(0x0F6E) __sfr LCDDATA8;
485 typedef union
487 struct
489 unsigned S16C1 : 1;
490 unsigned S17C1 : 1;
491 unsigned S18C1 : 1;
492 unsigned S19C1 : 1;
493 unsigned S20C1 : 1;
494 unsigned S21C1 : 1;
495 unsigned S22C1 : 1;
496 unsigned S23C1 : 1;
499 struct
501 unsigned SEG16COM1 : 1;
502 unsigned SEG17COM1 : 1;
503 unsigned SEG18COM1 : 1;
504 unsigned SEG19COM1 : 1;
505 unsigned SEG20COM1 : 1;
506 unsigned SEG21COM1 : 1;
507 unsigned SEG22COM1 : 1;
508 unsigned SEG23COM1 : 1;
510 } __LCDDATA8bits_t;
512 extern __at(0x0F6E) volatile __LCDDATA8bits_t LCDDATA8bits;
514 #define _S16C1 0x01
515 #define _SEG16COM1 0x01
516 #define _S17C1 0x02
517 #define _SEG17COM1 0x02
518 #define _S18C1 0x04
519 #define _SEG18COM1 0x04
520 #define _S19C1 0x08
521 #define _SEG19COM1 0x08
522 #define _S20C1 0x10
523 #define _SEG20COM1 0x10
524 #define _S21C1 0x20
525 #define _SEG21COM1 0x20
526 #define _S22C1 0x40
527 #define _SEG22COM1 0x40
528 #define _S23C1 0x80
529 #define _SEG23COM1 0x80
531 //==============================================================================
534 //==============================================================================
535 // LCDDATA9 Bits
537 extern __at(0x0F6F) __sfr LCDDATA9;
539 typedef union
541 struct
543 unsigned S24C1 : 1;
544 unsigned S25C1 : 1;
545 unsigned S26C1 : 1;
546 unsigned S27C1 : 1;
547 unsigned S28C1 : 1;
548 unsigned S29C1 : 1;
549 unsigned S30C1 : 1;
550 unsigned S31C1 : 1;
553 struct
555 unsigned SEG24COM1 : 1;
556 unsigned SEG25COM1 : 1;
557 unsigned SEG26COM1 : 1;
558 unsigned SEG27COM1 : 1;
559 unsigned SEG28COM1 : 1;
560 unsigned SEG29COM1 : 1;
561 unsigned SEG30COM1 : 1;
562 unsigned SEG31COM1 : 1;
564 } __LCDDATA9bits_t;
566 extern __at(0x0F6F) volatile __LCDDATA9bits_t LCDDATA9bits;
568 #define _S24C1 0x01
569 #define _SEG24COM1 0x01
570 #define _S25C1 0x02
571 #define _SEG25COM1 0x02
572 #define _S26C1 0x04
573 #define _SEG26COM1 0x04
574 #define _S27C1 0x08
575 #define _SEG27COM1 0x08
576 #define _S28C1 0x10
577 #define _SEG28COM1 0x10
578 #define _S29C1 0x20
579 #define _SEG29COM1 0x20
580 #define _S30C1 0x40
581 #define _SEG30COM1 0x40
582 #define _S31C1 0x80
583 #define _SEG31COM1 0x80
585 //==============================================================================
588 //==============================================================================
589 // LCDDATA10 Bits
591 extern __at(0x0F70) __sfr LCDDATA10;
593 typedef union
595 struct
597 unsigned S32C1 : 1;
598 unsigned : 1;
599 unsigned : 1;
600 unsigned : 1;
601 unsigned : 1;
602 unsigned : 1;
603 unsigned : 1;
604 unsigned : 1;
607 struct
609 unsigned SEG32COM1 : 1;
610 unsigned : 1;
611 unsigned : 1;
612 unsigned : 1;
613 unsigned : 1;
614 unsigned : 1;
615 unsigned : 1;
616 unsigned : 1;
618 } __LCDDATA10bits_t;
620 extern __at(0x0F70) volatile __LCDDATA10bits_t LCDDATA10bits;
622 #define _S32C1 0x01
623 #define _SEG32COM1 0x01
625 //==============================================================================
628 //==============================================================================
629 // LCDDATA12 Bits
631 extern __at(0x0F72) __sfr LCDDATA12;
633 typedef union
635 struct
637 unsigned S00C2 : 1;
638 unsigned S01C2 : 1;
639 unsigned S02C2 : 1;
640 unsigned S03C2 : 1;
641 unsigned S04C2 : 1;
642 unsigned S05C2 : 1;
643 unsigned S06C2 : 1;
644 unsigned S07C2 : 1;
647 struct
649 unsigned SEG0COM2 : 1;
650 unsigned SEG1COM2 : 1;
651 unsigned SEG2COM2 : 1;
652 unsigned SEG3COM2 : 1;
653 unsigned SEG4COM2 : 1;
654 unsigned SEG5COM2 : 1;
655 unsigned SEG6COM2 : 1;
656 unsigned SEG7COM2 : 1;
659 struct
661 unsigned S0C2 : 1;
662 unsigned S1C2 : 1;
663 unsigned S2C2 : 1;
664 unsigned S3C2 : 1;
665 unsigned S4C2 : 1;
666 unsigned S5C2 : 1;
667 unsigned S6C2 : 1;
668 unsigned S7C2 : 1;
670 } __LCDDATA12bits_t;
672 extern __at(0x0F72) volatile __LCDDATA12bits_t LCDDATA12bits;
674 #define _S00C2 0x01
675 #define _SEG0COM2 0x01
676 #define _S0C2 0x01
677 #define _S01C2 0x02
678 #define _SEG1COM2 0x02
679 #define _S1C2 0x02
680 #define _S02C2 0x04
681 #define _SEG2COM2 0x04
682 #define _S2C2 0x04
683 #define _S03C2 0x08
684 #define _SEG3COM2 0x08
685 #define _S3C2 0x08
686 #define _S04C2 0x10
687 #define _SEG4COM2 0x10
688 #define _S4C2 0x10
689 #define _S05C2 0x20
690 #define _SEG5COM2 0x20
691 #define _S5C2 0x20
692 #define _S06C2 0x40
693 #define _SEG6COM2 0x40
694 #define _S6C2 0x40
695 #define _S07C2 0x80
696 #define _SEG7COM2 0x80
697 #define _S7C2 0x80
699 //==============================================================================
702 //==============================================================================
703 // LCDDATA13 Bits
705 extern __at(0x0F73) __sfr LCDDATA13;
707 typedef union
709 struct
711 unsigned S8C2 : 1;
712 unsigned S9C2 : 1;
713 unsigned S10C2 : 1;
714 unsigned S11C2 : 1;
715 unsigned S12C2 : 1;
716 unsigned S13C2 : 1;
717 unsigned S14C2 : 1;
718 unsigned S15C2 : 1;
721 struct
723 unsigned SEG8COM2 : 1;
724 unsigned SEG9COM2 : 1;
725 unsigned SEG10COM2 : 1;
726 unsigned SEG11COM2 : 1;
727 unsigned SEG12COM2 : 1;
728 unsigned SEG13COM2 : 1;
729 unsigned SEG14COM2 : 1;
730 unsigned SEG15COM2 : 1;
733 struct
735 unsigned S08C2 : 1;
736 unsigned S09C2 : 1;
737 unsigned : 1;
738 unsigned : 1;
739 unsigned : 1;
740 unsigned : 1;
741 unsigned : 1;
742 unsigned : 1;
744 } __LCDDATA13bits_t;
746 extern __at(0x0F73) volatile __LCDDATA13bits_t LCDDATA13bits;
748 #define _S8C2 0x01
749 #define _SEG8COM2 0x01
750 #define _S08C2 0x01
751 #define _S9C2 0x02
752 #define _SEG9COM2 0x02
753 #define _S09C2 0x02
754 #define _S10C2 0x04
755 #define _SEG10COM2 0x04
756 #define _S11C2 0x08
757 #define _SEG11COM2 0x08
758 #define _S12C2 0x10
759 #define _SEG12COM2 0x10
760 #define _S13C2 0x20
761 #define _SEG13COM2 0x20
762 #define _S14C2 0x40
763 #define _SEG14COM2 0x40
764 #define _S15C2 0x80
765 #define _SEG15COM2 0x80
767 //==============================================================================
770 //==============================================================================
771 // LCDDATA14 Bits
773 extern __at(0x0F74) __sfr LCDDATA14;
775 typedef union
777 struct
779 unsigned S16C2 : 1;
780 unsigned S17C2 : 1;
781 unsigned S18C2 : 1;
782 unsigned S19C2 : 1;
783 unsigned S20C2 : 1;
784 unsigned S21C2 : 1;
785 unsigned S22C2 : 1;
786 unsigned S23C2 : 1;
789 struct
791 unsigned SEG16COM2 : 1;
792 unsigned SEG17COM2 : 1;
793 unsigned SEG18COM2 : 1;
794 unsigned SEG19COM2 : 1;
795 unsigned SEG20COM2 : 1;
796 unsigned SEG21COM2 : 1;
797 unsigned SEG22COM2 : 1;
798 unsigned SEG23COM2 : 1;
800 } __LCDDATA14bits_t;
802 extern __at(0x0F74) volatile __LCDDATA14bits_t LCDDATA14bits;
804 #define _S16C2 0x01
805 #define _SEG16COM2 0x01
806 #define _S17C2 0x02
807 #define _SEG17COM2 0x02
808 #define _S18C2 0x04
809 #define _SEG18COM2 0x04
810 #define _S19C2 0x08
811 #define _SEG19COM2 0x08
812 #define _S20C2 0x10
813 #define _SEG20COM2 0x10
814 #define _S21C2 0x20
815 #define _SEG21COM2 0x20
816 #define _S22C2 0x40
817 #define _SEG22COM2 0x40
818 #define _S23C2 0x80
819 #define _SEG23COM2 0x80
821 //==============================================================================
824 //==============================================================================
825 // LCDDATA15 Bits
827 extern __at(0x0F75) __sfr LCDDATA15;
829 typedef union
831 struct
833 unsigned S24C2 : 1;
834 unsigned S25C2 : 1;
835 unsigned S26C2 : 1;
836 unsigned S27C2 : 1;
837 unsigned S28C2 : 1;
838 unsigned S29C2 : 1;
839 unsigned S30C2 : 1;
840 unsigned S31C2 : 1;
843 struct
845 unsigned SEG24COM2 : 1;
846 unsigned SEG25COM2 : 1;
847 unsigned SEG26COM2 : 1;
848 unsigned SEG27COM2 : 1;
849 unsigned SEG28COM2 : 1;
850 unsigned SEG29COM2 : 1;
851 unsigned SEG30COM2 : 1;
852 unsigned SEG31COM2 : 1;
854 } __LCDDATA15bits_t;
856 extern __at(0x0F75) volatile __LCDDATA15bits_t LCDDATA15bits;
858 #define _S24C2 0x01
859 #define _SEG24COM2 0x01
860 #define _S25C2 0x02
861 #define _SEG25COM2 0x02
862 #define _S26C2 0x04
863 #define _SEG26COM2 0x04
864 #define _S27C2 0x08
865 #define _SEG27COM2 0x08
866 #define _S28C2 0x10
867 #define _SEG28COM2 0x10
868 #define _S29C2 0x20
869 #define _SEG29COM2 0x20
870 #define _S30C2 0x40
871 #define _SEG30COM2 0x40
872 #define _S31C2 0x80
873 #define _SEG31COM2 0x80
875 //==============================================================================
878 //==============================================================================
879 // LCDDATA16 Bits
881 extern __at(0x0F76) __sfr LCDDATA16;
883 typedef union
885 struct
887 unsigned S32C2 : 1;
888 unsigned : 1;
889 unsigned : 1;
890 unsigned : 1;
891 unsigned : 1;
892 unsigned : 1;
893 unsigned : 1;
894 unsigned : 1;
897 struct
899 unsigned SEG32COM2 : 1;
900 unsigned : 1;
901 unsigned : 1;
902 unsigned : 1;
903 unsigned : 1;
904 unsigned : 1;
905 unsigned : 1;
906 unsigned : 1;
908 } __LCDDATA16bits_t;
910 extern __at(0x0F76) volatile __LCDDATA16bits_t LCDDATA16bits;
912 #define _S32C2 0x01
913 #define _SEG32COM2 0x01
915 //==============================================================================
918 //==============================================================================
919 // LCDDATA18 Bits
921 extern __at(0x0F78) __sfr LCDDATA18;
923 typedef union
925 struct
927 unsigned S00C3 : 1;
928 unsigned S01C3 : 1;
929 unsigned S02C3 : 1;
930 unsigned S03C3 : 1;
931 unsigned S04C3 : 1;
932 unsigned S05C3 : 1;
933 unsigned S06C3 : 1;
934 unsigned S07C3 : 1;
937 struct
939 unsigned SEG0COM3 : 1;
940 unsigned SEG1COM3 : 1;
941 unsigned SEG2COM3 : 1;
942 unsigned SEG3COM3 : 1;
943 unsigned SEG4COM3 : 1;
944 unsigned SEG5COM3 : 1;
945 unsigned SEG6COM3 : 1;
946 unsigned SEG7COM3 : 1;
949 struct
951 unsigned S0C3 : 1;
952 unsigned S1C3 : 1;
953 unsigned S2C3 : 1;
954 unsigned S3C3 : 1;
955 unsigned S4C3 : 1;
956 unsigned S5C3 : 1;
957 unsigned S6C3 : 1;
958 unsigned S7C3 : 1;
960 } __LCDDATA18bits_t;
962 extern __at(0x0F78) volatile __LCDDATA18bits_t LCDDATA18bits;
964 #define _S00C3 0x01
965 #define _SEG0COM3 0x01
966 #define _S0C3 0x01
967 #define _S01C3 0x02
968 #define _SEG1COM3 0x02
969 #define _S1C3 0x02
970 #define _S02C3 0x04
971 #define _SEG2COM3 0x04
972 #define _S2C3 0x04
973 #define _S03C3 0x08
974 #define _SEG3COM3 0x08
975 #define _S3C3 0x08
976 #define _S04C3 0x10
977 #define _SEG4COM3 0x10
978 #define _S4C3 0x10
979 #define _S05C3 0x20
980 #define _SEG5COM3 0x20
981 #define _S5C3 0x20
982 #define _S06C3 0x40
983 #define _SEG6COM3 0x40
984 #define _S6C3 0x40
985 #define _S07C3 0x80
986 #define _SEG7COM3 0x80
987 #define _S7C3 0x80
989 //==============================================================================
992 //==============================================================================
993 // LCDDATA19 Bits
995 extern __at(0x0F79) __sfr LCDDATA19;
997 typedef union
999 struct
1001 unsigned S8C3 : 1;
1002 unsigned S9C3 : 1;
1003 unsigned S10C3 : 1;
1004 unsigned S11C3 : 1;
1005 unsigned S12C3 : 1;
1006 unsigned S13C3 : 1;
1007 unsigned S14C3 : 1;
1008 unsigned S15C3 : 1;
1011 struct
1013 unsigned SEG8COM3 : 1;
1014 unsigned SEG9COM3 : 1;
1015 unsigned SEG10COM3 : 1;
1016 unsigned SEG11COM3 : 1;
1017 unsigned SEG12COM3 : 1;
1018 unsigned SEG13COM3 : 1;
1019 unsigned SEG14COM3 : 1;
1020 unsigned SEG15COM3 : 1;
1023 struct
1025 unsigned S08C3 : 1;
1026 unsigned S09C3 : 1;
1027 unsigned : 1;
1028 unsigned : 1;
1029 unsigned : 1;
1030 unsigned : 1;
1031 unsigned : 1;
1032 unsigned : 1;
1034 } __LCDDATA19bits_t;
1036 extern __at(0x0F79) volatile __LCDDATA19bits_t LCDDATA19bits;
1038 #define _S8C3 0x01
1039 #define _SEG8COM3 0x01
1040 #define _S08C3 0x01
1041 #define _S9C3 0x02
1042 #define _SEG9COM3 0x02
1043 #define _S09C3 0x02
1044 #define _S10C3 0x04
1045 #define _SEG10COM3 0x04
1046 #define _S11C3 0x08
1047 #define _SEG11COM3 0x08
1048 #define _S12C3 0x10
1049 #define _SEG12COM3 0x10
1050 #define _S13C3 0x20
1051 #define _SEG13COM3 0x20
1052 #define _S14C3 0x40
1053 #define _SEG14COM3 0x40
1054 #define _S15C3 0x80
1055 #define _SEG15COM3 0x80
1057 //==============================================================================
1060 //==============================================================================
1061 // LCDDATA20 Bits
1063 extern __at(0x0F7A) __sfr LCDDATA20;
1065 typedef union
1067 struct
1069 unsigned S16C3 : 1;
1070 unsigned S17C3 : 1;
1071 unsigned S18C3 : 1;
1072 unsigned S19C3 : 1;
1073 unsigned S20C3 : 1;
1074 unsigned S21C3 : 1;
1075 unsigned S22C3 : 1;
1076 unsigned S23C3 : 1;
1079 struct
1081 unsigned SEG16COM3 : 1;
1082 unsigned SEG17COM3 : 1;
1083 unsigned SEG18COM3 : 1;
1084 unsigned SEG19COM3 : 1;
1085 unsigned SEG20COM3 : 1;
1086 unsigned SEG21COM3 : 1;
1087 unsigned SEG22COM3 : 1;
1088 unsigned SEG23COM3 : 1;
1090 } __LCDDATA20bits_t;
1092 extern __at(0x0F7A) volatile __LCDDATA20bits_t LCDDATA20bits;
1094 #define _S16C3 0x01
1095 #define _SEG16COM3 0x01
1096 #define _S17C3 0x02
1097 #define _SEG17COM3 0x02
1098 #define _S18C3 0x04
1099 #define _SEG18COM3 0x04
1100 #define _S19C3 0x08
1101 #define _SEG19COM3 0x08
1102 #define _S20C3 0x10
1103 #define _SEG20COM3 0x10
1104 #define _S21C3 0x20
1105 #define _SEG21COM3 0x20
1106 #define _S22C3 0x40
1107 #define _SEG22COM3 0x40
1108 #define _S23C3 0x80
1109 #define _SEG23COM3 0x80
1111 //==============================================================================
1114 //==============================================================================
1115 // LCDDATA21 Bits
1117 extern __at(0x0F7B) __sfr LCDDATA21;
1119 typedef union
1121 struct
1123 unsigned S24C3 : 1;
1124 unsigned S25C3 : 1;
1125 unsigned S26C3 : 1;
1126 unsigned S27C3 : 1;
1127 unsigned S28C3 : 1;
1128 unsigned S29C3 : 1;
1129 unsigned S30C3 : 1;
1130 unsigned S31C3 : 1;
1133 struct
1135 unsigned SEG24COM3 : 1;
1136 unsigned SEG25COM3 : 1;
1137 unsigned SEG26COM3 : 1;
1138 unsigned SEG27COM3 : 1;
1139 unsigned SEG28COM3 : 1;
1140 unsigned SEG29COM3 : 1;
1141 unsigned SEG30COM3 : 1;
1142 unsigned SEG31COM3 : 1;
1144 } __LCDDATA21bits_t;
1146 extern __at(0x0F7B) volatile __LCDDATA21bits_t LCDDATA21bits;
1148 #define _S24C3 0x01
1149 #define _SEG24COM3 0x01
1150 #define _S25C3 0x02
1151 #define _SEG25COM3 0x02
1152 #define _S26C3 0x04
1153 #define _SEG26COM3 0x04
1154 #define _S27C3 0x08
1155 #define _SEG27COM3 0x08
1156 #define _S28C3 0x10
1157 #define _SEG28COM3 0x10
1158 #define _S29C3 0x20
1159 #define _SEG29COM3 0x20
1160 #define _S30C3 0x40
1161 #define _SEG30COM3 0x40
1162 #define _S31C3 0x80
1163 #define _SEG31COM3 0x80
1165 //==============================================================================
1168 //==============================================================================
1169 // LCDDATA22 Bits
1171 extern __at(0x0F7C) __sfr LCDDATA22;
1173 typedef union
1175 struct
1177 unsigned S32C3 : 1;
1178 unsigned : 1;
1179 unsigned : 1;
1180 unsigned : 1;
1181 unsigned : 1;
1182 unsigned : 1;
1183 unsigned : 1;
1184 unsigned : 1;
1187 struct
1189 unsigned SEG32COM3 : 1;
1190 unsigned : 1;
1191 unsigned : 1;
1192 unsigned : 1;
1193 unsigned : 1;
1194 unsigned : 1;
1195 unsigned : 1;
1196 unsigned : 1;
1198 } __LCDDATA22bits_t;
1200 extern __at(0x0F7C) volatile __LCDDATA22bits_t LCDDATA22bits;
1202 #define _S32C3 0x01
1203 #define _SEG32COM3 0x01
1205 //==============================================================================
1208 //==============================================================================
1209 // BAUDCON1 Bits
1211 extern __at(0x0F7E) __sfr BAUDCON1;
1213 typedef union
1215 struct
1217 unsigned ABDEN : 1;
1218 unsigned WUE : 1;
1219 unsigned : 1;
1220 unsigned BRG16 : 1;
1221 unsigned TXCKP : 1;
1222 unsigned RXDTP : 1;
1223 unsigned RCIDL : 1;
1224 unsigned ABDOVF : 1;
1227 struct
1229 unsigned : 1;
1230 unsigned : 1;
1231 unsigned : 1;
1232 unsigned : 1;
1233 unsigned SCKP : 1;
1234 unsigned : 1;
1235 unsigned RCMT : 1;
1236 unsigned : 1;
1238 } __BAUDCON1bits_t;
1240 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1242 #define _ABDEN 0x01
1243 #define _WUE 0x02
1244 #define _BRG16 0x08
1245 #define _TXCKP 0x10
1246 #define _SCKP 0x10
1247 #define _RXDTP 0x20
1248 #define _RCIDL 0x40
1249 #define _RCMT 0x40
1250 #define _ABDOVF 0x80
1252 //==============================================================================
1254 extern __at(0x0F7F) __sfr SPBRGH1;
1256 //==============================================================================
1257 // PORTA Bits
1259 extern __at(0x0F80) __sfr PORTA;
1261 typedef union
1263 struct
1265 unsigned RA0 : 1;
1266 unsigned RA1 : 1;
1267 unsigned RA2 : 1;
1268 unsigned RA3 : 1;
1269 unsigned RA4 : 1;
1270 unsigned RA5 : 1;
1271 unsigned RA6 : 1;
1272 unsigned RA7 : 1;
1275 struct
1277 unsigned AN0 : 1;
1278 unsigned AN1 : 1;
1279 unsigned AN2 : 1;
1280 unsigned AN3 : 1;
1281 unsigned T0CKI : 1;
1282 unsigned AN4 : 1;
1283 unsigned OSC2 : 1;
1284 unsigned OSC1 : 1;
1287 struct
1289 unsigned : 1;
1290 unsigned SEG18 : 1;
1291 unsigned VREFM : 1;
1292 unsigned VREFP : 1;
1293 unsigned SEG14 : 1;
1294 unsigned SEG15 : 1;
1295 unsigned CLKO : 1;
1296 unsigned CLKI : 1;
1298 } __PORTAbits_t;
1300 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1302 #define _PORTA_RA0 0x01
1303 #define _PORTA_AN0 0x01
1304 #define _PORTA_RA1 0x02
1305 #define _PORTA_AN1 0x02
1306 #define _PORTA_SEG18 0x02
1307 #define _PORTA_RA2 0x04
1308 #define _PORTA_AN2 0x04
1309 #define _PORTA_VREFM 0x04
1310 #define _PORTA_RA3 0x08
1311 #define _PORTA_AN3 0x08
1312 #define _PORTA_VREFP 0x08
1313 #define _PORTA_RA4 0x10
1314 #define _PORTA_T0CKI 0x10
1315 #define _PORTA_SEG14 0x10
1316 #define _PORTA_RA5 0x20
1317 #define _PORTA_AN4 0x20
1318 #define _PORTA_SEG15 0x20
1319 #define _PORTA_RA6 0x40
1320 #define _PORTA_OSC2 0x40
1321 #define _PORTA_CLKO 0x40
1322 #define _PORTA_RA7 0x80
1323 #define _PORTA_OSC1 0x80
1324 #define _PORTA_CLKI 0x80
1326 //==============================================================================
1329 //==============================================================================
1330 // PORTB Bits
1332 extern __at(0x0F81) __sfr PORTB;
1334 typedef union
1336 struct
1338 unsigned RB0 : 1;
1339 unsigned RB1 : 1;
1340 unsigned RB2 : 1;
1341 unsigned RB3 : 1;
1342 unsigned RB4 : 1;
1343 unsigned RB5 : 1;
1344 unsigned RB6 : 1;
1345 unsigned RB7 : 1;
1348 struct
1350 unsigned INT0 : 1;
1351 unsigned INT1 : 1;
1352 unsigned INT2 : 1;
1353 unsigned INT3 : 1;
1354 unsigned KBI0 : 1;
1355 unsigned KBI1 : 1;
1356 unsigned KBI2 : 1;
1357 unsigned KBI3 : 1;
1360 struct
1362 unsigned SEG30 : 1;
1363 unsigned SEG8 : 1;
1364 unsigned SEG9 : 1;
1365 unsigned SEG10 : 1;
1366 unsigned SEG11 : 1;
1367 unsigned SEG29 : 1;
1368 unsigned PGC : 1;
1369 unsigned PGD : 1;
1372 struct
1374 unsigned INT : 4;
1375 unsigned : 4;
1378 struct
1380 unsigned : 4;
1381 unsigned KBI : 4;
1383 } __PORTBbits_t;
1385 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1387 #define _PORTB_RB0 0x01
1388 #define _PORTB_INT0 0x01
1389 #define _PORTB_SEG30 0x01
1390 #define _PORTB_RB1 0x02
1391 #define _PORTB_INT1 0x02
1392 #define _PORTB_SEG8 0x02
1393 #define _PORTB_RB2 0x04
1394 #define _PORTB_INT2 0x04
1395 #define _PORTB_SEG9 0x04
1396 #define _PORTB_RB3 0x08
1397 #define _PORTB_INT3 0x08
1398 #define _PORTB_SEG10 0x08
1399 #define _PORTB_RB4 0x10
1400 #define _PORTB_KBI0 0x10
1401 #define _PORTB_SEG11 0x10
1402 #define _PORTB_RB5 0x20
1403 #define _PORTB_KBI1 0x20
1404 #define _PORTB_SEG29 0x20
1405 #define _PORTB_RB6 0x40
1406 #define _PORTB_KBI2 0x40
1407 #define _PORTB_PGC 0x40
1408 #define _PORTB_RB7 0x80
1409 #define _PORTB_KBI3 0x80
1410 #define _PORTB_PGD 0x80
1412 //==============================================================================
1415 //==============================================================================
1416 // PORTC Bits
1418 extern __at(0x0F82) __sfr PORTC;
1420 typedef union
1422 struct
1424 unsigned RC0 : 1;
1425 unsigned RC1 : 1;
1426 unsigned RC2 : 1;
1427 unsigned RC3 : 1;
1428 unsigned RC4 : 1;
1429 unsigned RC5 : 1;
1430 unsigned RC6 : 1;
1431 unsigned RC7 : 1;
1434 struct
1436 unsigned T1OSO : 1;
1437 unsigned T1OSI : 1;
1438 unsigned CCP1 : 1;
1439 unsigned SCL : 1;
1440 unsigned SDA : 1;
1441 unsigned SDO : 1;
1442 unsigned CK1 : 1;
1443 unsigned DT1 : 1;
1446 struct
1448 unsigned T13CKI : 1;
1449 unsigned CCP2 : 1;
1450 unsigned SEG13 : 1;
1451 unsigned SCK : 1;
1452 unsigned SDI : 1;
1453 unsigned SEG12 : 1;
1454 unsigned TX1 : 1;
1455 unsigned RX1 : 1;
1458 struct
1460 unsigned : 1;
1461 unsigned SEG32 : 1;
1462 unsigned : 1;
1463 unsigned SEG17 : 1;
1464 unsigned SEG16 : 1;
1465 unsigned : 1;
1466 unsigned SEG27 : 1;
1467 unsigned SEG28 : 1;
1469 } __PORTCbits_t;
1471 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1473 #define _PORTC_RC0 0x01
1474 #define _PORTC_T1OSO 0x01
1475 #define _PORTC_T13CKI 0x01
1476 #define _PORTC_RC1 0x02
1477 #define _PORTC_T1OSI 0x02
1478 #define _PORTC_CCP2 0x02
1479 #define _PORTC_SEG32 0x02
1480 #define _PORTC_RC2 0x04
1481 #define _PORTC_CCP1 0x04
1482 #define _PORTC_SEG13 0x04
1483 #define _PORTC_RC3 0x08
1484 #define _PORTC_SCL 0x08
1485 #define _PORTC_SCK 0x08
1486 #define _PORTC_SEG17 0x08
1487 #define _PORTC_RC4 0x10
1488 #define _PORTC_SDA 0x10
1489 #define _PORTC_SDI 0x10
1490 #define _PORTC_SEG16 0x10
1491 #define _PORTC_RC5 0x20
1492 #define _PORTC_SDO 0x20
1493 #define _PORTC_SEG12 0x20
1494 #define _PORTC_RC6 0x40
1495 #define _PORTC_CK1 0x40
1496 #define _PORTC_TX1 0x40
1497 #define _PORTC_SEG27 0x40
1498 #define _PORTC_RC7 0x80
1499 #define _PORTC_DT1 0x80
1500 #define _PORTC_RX1 0x80
1501 #define _PORTC_SEG28 0x80
1503 //==============================================================================
1506 //==============================================================================
1507 // PORTD Bits
1509 extern __at(0x0F83) __sfr PORTD;
1511 typedef union
1513 struct
1515 unsigned RD0 : 1;
1516 unsigned RD1 : 1;
1517 unsigned RD2 : 1;
1518 unsigned RD3 : 1;
1519 unsigned RD4 : 1;
1520 unsigned RD5 : 1;
1521 unsigned RD6 : 1;
1522 unsigned RD7 : 1;
1525 struct
1527 unsigned SEG0 : 1;
1528 unsigned SEG1 : 1;
1529 unsigned SEG2 : 1;
1530 unsigned SEG3 : 1;
1531 unsigned SEG4 : 1;
1532 unsigned SEG5 : 1;
1533 unsigned SEG6 : 1;
1534 unsigned SEG7 : 1;
1536 } __PORTDbits_t;
1538 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1540 #define _PORTD_RD0 0x01
1541 #define _PORTD_SEG0 0x01
1542 #define _PORTD_RD1 0x02
1543 #define _PORTD_SEG1 0x02
1544 #define _PORTD_RD2 0x04
1545 #define _PORTD_SEG2 0x04
1546 #define _PORTD_RD3 0x08
1547 #define _PORTD_SEG3 0x08
1548 #define _PORTD_RD4 0x10
1549 #define _PORTD_SEG4 0x10
1550 #define _PORTD_RD5 0x20
1551 #define _PORTD_SEG5 0x20
1552 #define _PORTD_RD6 0x40
1553 #define _PORTD_SEG6 0x40
1554 #define _PORTD_RD7 0x80
1555 #define _PORTD_SEG7 0x80
1557 //==============================================================================
1560 //==============================================================================
1561 // PORTE Bits
1563 extern __at(0x0F84) __sfr PORTE;
1565 typedef union
1567 struct
1569 unsigned RE0 : 1;
1570 unsigned RE1 : 1;
1571 unsigned : 1;
1572 unsigned RE3 : 1;
1573 unsigned RE4 : 1;
1574 unsigned RE5 : 1;
1575 unsigned RE6 : 1;
1576 unsigned RE7 : 1;
1579 struct
1581 unsigned LCDBIAS1 : 1;
1582 unsigned LCDBIAS2 : 1;
1583 unsigned : 1;
1584 unsigned COM0 : 1;
1585 unsigned COM1 : 1;
1586 unsigned COM2 : 1;
1587 unsigned COM3 : 1;
1588 unsigned CCP2 : 1;
1591 struct
1593 unsigned : 1;
1594 unsigned : 1;
1595 unsigned : 1;
1596 unsigned : 1;
1597 unsigned : 1;
1598 unsigned : 1;
1599 unsigned : 1;
1600 unsigned SEG31 : 1;
1603 struct
1605 unsigned : 3;
1606 unsigned COM : 4;
1607 unsigned : 1;
1609 } __PORTEbits_t;
1611 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1613 #define _PORTE_RE0 0x01
1614 #define _PORTE_LCDBIAS1 0x01
1615 #define _PORTE_RE1 0x02
1616 #define _PORTE_LCDBIAS2 0x02
1617 #define _PORTE_RE3 0x08
1618 #define _PORTE_COM0 0x08
1619 #define _PORTE_RE4 0x10
1620 #define _PORTE_COM1 0x10
1621 #define _PORTE_RE5 0x20
1622 #define _PORTE_COM2 0x20
1623 #define _PORTE_RE6 0x40
1624 #define _PORTE_COM3 0x40
1625 #define _PORTE_RE7 0x80
1626 #define _PORTE_CCP2 0x80
1627 #define _PORTE_SEG31 0x80
1629 //==============================================================================
1632 //==============================================================================
1633 // PORTF Bits
1635 extern __at(0x0F85) __sfr PORTF;
1637 typedef union
1639 struct
1641 unsigned : 1;
1642 unsigned RF1 : 1;
1643 unsigned RF2 : 1;
1644 unsigned RF3 : 1;
1645 unsigned RF4 : 1;
1646 unsigned RF5 : 1;
1647 unsigned RF6 : 1;
1648 unsigned RF7 : 1;
1651 struct
1653 unsigned : 1;
1654 unsigned AN6 : 1;
1655 unsigned AN7 : 1;
1656 unsigned AN8 : 1;
1657 unsigned AN9 : 1;
1658 unsigned AN10 : 1;
1659 unsigned AN11 : 1;
1660 unsigned AN5 : 1;
1663 struct
1665 unsigned : 1;
1666 unsigned C2OUT : 1;
1667 unsigned C1OUT : 1;
1668 unsigned C2INB : 1;
1669 unsigned C2INA : 1;
1670 unsigned C1INB : 1;
1671 unsigned C1INA : 1;
1672 unsigned SS1 : 1;
1675 struct
1677 unsigned : 1;
1678 unsigned SEG19 : 1;
1679 unsigned SEG20 : 1;
1680 unsigned SEG21 : 1;
1681 unsigned SEG22 : 1;
1682 unsigned SEG23 : 1;
1683 unsigned SEG24 : 1;
1684 unsigned SEG25 : 1;
1687 struct
1689 unsigned : 1;
1690 unsigned : 1;
1691 unsigned : 1;
1692 unsigned : 1;
1693 unsigned : 1;
1694 unsigned CVREF : 1;
1695 unsigned : 1;
1696 unsigned : 1;
1698 } __PORTFbits_t;
1700 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
1702 #define _PORTF_RF1 0x02
1703 #define _PORTF_AN6 0x02
1704 #define _PORTF_C2OUT 0x02
1705 #define _PORTF_SEG19 0x02
1706 #define _PORTF_RF2 0x04
1707 #define _PORTF_AN7 0x04
1708 #define _PORTF_C1OUT 0x04
1709 #define _PORTF_SEG20 0x04
1710 #define _PORTF_RF3 0x08
1711 #define _PORTF_AN8 0x08
1712 #define _PORTF_C2INB 0x08
1713 #define _PORTF_SEG21 0x08
1714 #define _PORTF_RF4 0x10
1715 #define _PORTF_AN9 0x10
1716 #define _PORTF_C2INA 0x10
1717 #define _PORTF_SEG22 0x10
1718 #define _PORTF_RF5 0x20
1719 #define _PORTF_AN10 0x20
1720 #define _PORTF_C1INB 0x20
1721 #define _PORTF_SEG23 0x20
1722 #define _PORTF_CVREF 0x20
1723 #define _PORTF_RF6 0x40
1724 #define _PORTF_AN11 0x40
1725 #define _PORTF_C1INA 0x40
1726 #define _PORTF_SEG24 0x40
1727 #define _PORTF_RF7 0x80
1728 #define _PORTF_AN5 0x80
1729 #define _PORTF_SS1 0x80
1730 #define _PORTF_SEG25 0x80
1732 //==============================================================================
1735 //==============================================================================
1736 // PORTG Bits
1738 extern __at(0x0F86) __sfr PORTG;
1740 typedef union
1742 struct
1744 unsigned RG0 : 1;
1745 unsigned RG1 : 1;
1746 unsigned RG2 : 1;
1747 unsigned RG3 : 1;
1748 unsigned RG4 : 1;
1749 unsigned : 1;
1750 unsigned REPU : 1;
1751 unsigned RDPU : 1;
1754 struct
1756 unsigned LCDBIAS0 : 1;
1757 unsigned CK2 : 1;
1758 unsigned DT2 : 1;
1759 unsigned VLCAP2 : 1;
1760 unsigned SEG26 : 1;
1761 unsigned : 1;
1762 unsigned : 1;
1763 unsigned : 1;
1766 struct
1768 unsigned : 1;
1769 unsigned TX2 : 1;
1770 unsigned RX2 : 1;
1771 unsigned : 1;
1772 unsigned : 1;
1773 unsigned : 1;
1774 unsigned : 1;
1775 unsigned : 1;
1778 struct
1780 unsigned : 1;
1781 unsigned : 1;
1782 unsigned VLCAP1 : 1;
1783 unsigned : 1;
1784 unsigned : 1;
1785 unsigned : 1;
1786 unsigned : 1;
1787 unsigned : 1;
1790 struct
1792 unsigned RG : 5;
1793 unsigned : 3;
1795 } __PORTGbits_t;
1797 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
1799 #define _PORTG_RG0 0x01
1800 #define _PORTG_LCDBIAS0 0x01
1801 #define _PORTG_RG1 0x02
1802 #define _PORTG_CK2 0x02
1803 #define _PORTG_TX2 0x02
1804 #define _PORTG_RG2 0x04
1805 #define _PORTG_DT2 0x04
1806 #define _PORTG_RX2 0x04
1807 #define _PORTG_VLCAP1 0x04
1808 #define _PORTG_RG3 0x08
1809 #define _PORTG_VLCAP2 0x08
1810 #define _PORTG_RG4 0x10
1811 #define _PORTG_SEG26 0x10
1812 #define _PORTG_REPU 0x40
1813 #define _PORTG_RDPU 0x80
1815 //==============================================================================
1818 //==============================================================================
1819 // LATA Bits
1821 extern __at(0x0F89) __sfr LATA;
1823 typedef struct
1825 unsigned LATA0 : 1;
1826 unsigned LATA1 : 1;
1827 unsigned LATA2 : 1;
1828 unsigned LATA3 : 1;
1829 unsigned LATA4 : 1;
1830 unsigned LATA5 : 1;
1831 unsigned LATA6 : 1;
1832 unsigned LATA7 : 1;
1833 } __LATAbits_t;
1835 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1837 #define _LATA0 0x01
1838 #define _LATA1 0x02
1839 #define _LATA2 0x04
1840 #define _LATA3 0x08
1841 #define _LATA4 0x10
1842 #define _LATA5 0x20
1843 #define _LATA6 0x40
1844 #define _LATA7 0x80
1846 //==============================================================================
1849 //==============================================================================
1850 // LATB Bits
1852 extern __at(0x0F8A) __sfr LATB;
1854 typedef struct
1856 unsigned LATB0 : 1;
1857 unsigned LATB1 : 1;
1858 unsigned LATB2 : 1;
1859 unsigned LATB3 : 1;
1860 unsigned LATB4 : 1;
1861 unsigned LATB5 : 1;
1862 unsigned LATB6 : 1;
1863 unsigned LATB7 : 1;
1864 } __LATBbits_t;
1866 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1868 #define _LATB0 0x01
1869 #define _LATB1 0x02
1870 #define _LATB2 0x04
1871 #define _LATB3 0x08
1872 #define _LATB4 0x10
1873 #define _LATB5 0x20
1874 #define _LATB6 0x40
1875 #define _LATB7 0x80
1877 //==============================================================================
1880 //==============================================================================
1881 // LATC Bits
1883 extern __at(0x0F8B) __sfr LATC;
1885 typedef struct
1887 unsigned LATC0 : 1;
1888 unsigned LATC1 : 1;
1889 unsigned LATC2 : 1;
1890 unsigned LATC3 : 1;
1891 unsigned LATC4 : 1;
1892 unsigned LATC5 : 1;
1893 unsigned LATC6 : 1;
1894 unsigned LATC7 : 1;
1895 } __LATCbits_t;
1897 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1899 #define _LATC0 0x01
1900 #define _LATC1 0x02
1901 #define _LATC2 0x04
1902 #define _LATC3 0x08
1903 #define _LATC4 0x10
1904 #define _LATC5 0x20
1905 #define _LATC6 0x40
1906 #define _LATC7 0x80
1908 //==============================================================================
1911 //==============================================================================
1912 // LATD Bits
1914 extern __at(0x0F8C) __sfr LATD;
1916 typedef struct
1918 unsigned LATD0 : 1;
1919 unsigned LATD1 : 1;
1920 unsigned LATD2 : 1;
1921 unsigned LATD3 : 1;
1922 unsigned LATD4 : 1;
1923 unsigned LATD5 : 1;
1924 unsigned LATD6 : 1;
1925 unsigned LATD7 : 1;
1926 } __LATDbits_t;
1928 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1930 #define _LATD0 0x01
1931 #define _LATD1 0x02
1932 #define _LATD2 0x04
1933 #define _LATD3 0x08
1934 #define _LATD4 0x10
1935 #define _LATD5 0x20
1936 #define _LATD6 0x40
1937 #define _LATD7 0x80
1939 //==============================================================================
1942 //==============================================================================
1943 // LATE Bits
1945 extern __at(0x0F8D) __sfr LATE;
1947 typedef struct
1949 unsigned LATE0 : 1;
1950 unsigned LATE1 : 1;
1951 unsigned : 1;
1952 unsigned LATE3 : 1;
1953 unsigned LATE4 : 1;
1954 unsigned LATE5 : 1;
1955 unsigned LATE6 : 1;
1956 unsigned LATE7 : 1;
1957 } __LATEbits_t;
1959 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1961 #define _LATE0 0x01
1962 #define _LATE1 0x02
1963 #define _LATE3 0x08
1964 #define _LATE4 0x10
1965 #define _LATE5 0x20
1966 #define _LATE6 0x40
1967 #define _LATE7 0x80
1969 //==============================================================================
1972 //==============================================================================
1973 // LATF Bits
1975 extern __at(0x0F8E) __sfr LATF;
1977 typedef struct
1979 unsigned : 1;
1980 unsigned LATF1 : 1;
1981 unsigned LATF2 : 1;
1982 unsigned LATF3 : 1;
1983 unsigned LATF4 : 1;
1984 unsigned LATF5 : 1;
1985 unsigned LATF6 : 1;
1986 unsigned LATF7 : 1;
1987 } __LATFbits_t;
1989 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
1991 #define _LATF1 0x02
1992 #define _LATF2 0x04
1993 #define _LATF3 0x08
1994 #define _LATF4 0x10
1995 #define _LATF5 0x20
1996 #define _LATF6 0x40
1997 #define _LATF7 0x80
1999 //==============================================================================
2002 //==============================================================================
2003 // LATG Bits
2005 extern __at(0x0F8F) __sfr LATG;
2007 typedef union
2009 struct
2011 unsigned LATG0 : 1;
2012 unsigned LATG1 : 1;
2013 unsigned LATG2 : 1;
2014 unsigned LATG3 : 1;
2015 unsigned LATG4 : 1;
2016 unsigned : 1;
2017 unsigned U1OD : 1;
2018 unsigned U2OD : 1;
2021 struct
2023 unsigned LATG : 5;
2024 unsigned : 3;
2026 } __LATGbits_t;
2028 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2030 #define _LATG0 0x01
2031 #define _LATG1 0x02
2032 #define _LATG2 0x04
2033 #define _LATG3 0x08
2034 #define _LATG4 0x10
2035 #define _U1OD 0x40
2036 #define _U2OD 0x80
2038 //==============================================================================
2041 //==============================================================================
2042 // DDRA Bits
2044 extern __at(0x0F92) __sfr DDRA;
2046 typedef union
2048 struct
2050 unsigned TRISA0 : 1;
2051 unsigned TRISA1 : 1;
2052 unsigned TRISA2 : 1;
2053 unsigned TRISA3 : 1;
2054 unsigned TRISA4 : 1;
2055 unsigned TRISA5 : 1;
2056 unsigned TRISA6 : 1;
2057 unsigned TRISA7 : 1;
2060 struct
2062 unsigned RA0 : 1;
2063 unsigned RA1 : 1;
2064 unsigned RA2 : 1;
2065 unsigned RA3 : 1;
2066 unsigned RA4 : 1;
2067 unsigned RA5 : 1;
2068 unsigned RA6 : 1;
2069 unsigned RA7 : 1;
2071 } __DDRAbits_t;
2073 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2075 #define _TRISA0 0x01
2076 #define _RA0 0x01
2077 #define _TRISA1 0x02
2078 #define _RA1 0x02
2079 #define _TRISA2 0x04
2080 #define _RA2 0x04
2081 #define _TRISA3 0x08
2082 #define _RA3 0x08
2083 #define _TRISA4 0x10
2084 #define _RA4 0x10
2085 #define _TRISA5 0x20
2086 #define _RA5 0x20
2087 #define _TRISA6 0x40
2088 #define _RA6 0x40
2089 #define _TRISA7 0x80
2090 #define _RA7 0x80
2092 //==============================================================================
2095 //==============================================================================
2096 // TRISA Bits
2098 extern __at(0x0F92) __sfr TRISA;
2100 typedef union
2102 struct
2104 unsigned TRISA0 : 1;
2105 unsigned TRISA1 : 1;
2106 unsigned TRISA2 : 1;
2107 unsigned TRISA3 : 1;
2108 unsigned TRISA4 : 1;
2109 unsigned TRISA5 : 1;
2110 unsigned TRISA6 : 1;
2111 unsigned TRISA7 : 1;
2114 struct
2116 unsigned RA0 : 1;
2117 unsigned RA1 : 1;
2118 unsigned RA2 : 1;
2119 unsigned RA3 : 1;
2120 unsigned RA4 : 1;
2121 unsigned RA5 : 1;
2122 unsigned RA6 : 1;
2123 unsigned RA7 : 1;
2125 } __TRISAbits_t;
2127 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2129 #define _TRISA_TRISA0 0x01
2130 #define _TRISA_RA0 0x01
2131 #define _TRISA_TRISA1 0x02
2132 #define _TRISA_RA1 0x02
2133 #define _TRISA_TRISA2 0x04
2134 #define _TRISA_RA2 0x04
2135 #define _TRISA_TRISA3 0x08
2136 #define _TRISA_RA3 0x08
2137 #define _TRISA_TRISA4 0x10
2138 #define _TRISA_RA4 0x10
2139 #define _TRISA_TRISA5 0x20
2140 #define _TRISA_RA5 0x20
2141 #define _TRISA_TRISA6 0x40
2142 #define _TRISA_RA6 0x40
2143 #define _TRISA_TRISA7 0x80
2144 #define _TRISA_RA7 0x80
2146 //==============================================================================
2149 //==============================================================================
2150 // DDRB Bits
2152 extern __at(0x0F93) __sfr DDRB;
2154 typedef union
2156 struct
2158 unsigned TRISB0 : 1;
2159 unsigned TRISB1 : 1;
2160 unsigned TRISB2 : 1;
2161 unsigned TRISB3 : 1;
2162 unsigned TRISB4 : 1;
2163 unsigned TRISB5 : 1;
2164 unsigned TRISB6 : 1;
2165 unsigned TRISB7 : 1;
2168 struct
2170 unsigned RB0 : 1;
2171 unsigned RB1 : 1;
2172 unsigned RB2 : 1;
2173 unsigned RB3 : 1;
2174 unsigned RB4 : 1;
2175 unsigned RB5 : 1;
2176 unsigned RB6 : 1;
2177 unsigned RB7 : 1;
2179 } __DDRBbits_t;
2181 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2183 #define _TRISB0 0x01
2184 #define _RB0 0x01
2185 #define _TRISB1 0x02
2186 #define _RB1 0x02
2187 #define _TRISB2 0x04
2188 #define _RB2 0x04
2189 #define _TRISB3 0x08
2190 #define _RB3 0x08
2191 #define _TRISB4 0x10
2192 #define _RB4 0x10
2193 #define _TRISB5 0x20
2194 #define _RB5 0x20
2195 #define _TRISB6 0x40
2196 #define _RB6 0x40
2197 #define _TRISB7 0x80
2198 #define _RB7 0x80
2200 //==============================================================================
2203 //==============================================================================
2204 // TRISB Bits
2206 extern __at(0x0F93) __sfr TRISB;
2208 typedef union
2210 struct
2212 unsigned TRISB0 : 1;
2213 unsigned TRISB1 : 1;
2214 unsigned TRISB2 : 1;
2215 unsigned TRISB3 : 1;
2216 unsigned TRISB4 : 1;
2217 unsigned TRISB5 : 1;
2218 unsigned TRISB6 : 1;
2219 unsigned TRISB7 : 1;
2222 struct
2224 unsigned RB0 : 1;
2225 unsigned RB1 : 1;
2226 unsigned RB2 : 1;
2227 unsigned RB3 : 1;
2228 unsigned RB4 : 1;
2229 unsigned RB5 : 1;
2230 unsigned RB6 : 1;
2231 unsigned RB7 : 1;
2233 } __TRISBbits_t;
2235 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2237 #define _TRISB_TRISB0 0x01
2238 #define _TRISB_RB0 0x01
2239 #define _TRISB_TRISB1 0x02
2240 #define _TRISB_RB1 0x02
2241 #define _TRISB_TRISB2 0x04
2242 #define _TRISB_RB2 0x04
2243 #define _TRISB_TRISB3 0x08
2244 #define _TRISB_RB3 0x08
2245 #define _TRISB_TRISB4 0x10
2246 #define _TRISB_RB4 0x10
2247 #define _TRISB_TRISB5 0x20
2248 #define _TRISB_RB5 0x20
2249 #define _TRISB_TRISB6 0x40
2250 #define _TRISB_RB6 0x40
2251 #define _TRISB_TRISB7 0x80
2252 #define _TRISB_RB7 0x80
2254 //==============================================================================
2257 //==============================================================================
2258 // DDRC Bits
2260 extern __at(0x0F94) __sfr DDRC;
2262 typedef union
2264 struct
2266 unsigned TRISC0 : 1;
2267 unsigned TRISC1 : 1;
2268 unsigned TRISC2 : 1;
2269 unsigned TRISC3 : 1;
2270 unsigned TRISC4 : 1;
2271 unsigned TRISC5 : 1;
2272 unsigned TRISC6 : 1;
2273 unsigned TRISC7 : 1;
2276 struct
2278 unsigned RC0 : 1;
2279 unsigned RC1 : 1;
2280 unsigned RC2 : 1;
2281 unsigned RC3 : 1;
2282 unsigned RC4 : 1;
2283 unsigned RC5 : 1;
2284 unsigned RC6 : 1;
2285 unsigned RC7 : 1;
2287 } __DDRCbits_t;
2289 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2291 #define _TRISC0 0x01
2292 #define _RC0 0x01
2293 #define _TRISC1 0x02
2294 #define _RC1 0x02
2295 #define _TRISC2 0x04
2296 #define _RC2 0x04
2297 #define _TRISC3 0x08
2298 #define _RC3 0x08
2299 #define _TRISC4 0x10
2300 #define _RC4 0x10
2301 #define _TRISC5 0x20
2302 #define _RC5 0x20
2303 #define _TRISC6 0x40
2304 #define _RC6 0x40
2305 #define _TRISC7 0x80
2306 #define _RC7 0x80
2308 //==============================================================================
2311 //==============================================================================
2312 // TRISC Bits
2314 extern __at(0x0F94) __sfr TRISC;
2316 typedef union
2318 struct
2320 unsigned TRISC0 : 1;
2321 unsigned TRISC1 : 1;
2322 unsigned TRISC2 : 1;
2323 unsigned TRISC3 : 1;
2324 unsigned TRISC4 : 1;
2325 unsigned TRISC5 : 1;
2326 unsigned TRISC6 : 1;
2327 unsigned TRISC7 : 1;
2330 struct
2332 unsigned RC0 : 1;
2333 unsigned RC1 : 1;
2334 unsigned RC2 : 1;
2335 unsigned RC3 : 1;
2336 unsigned RC4 : 1;
2337 unsigned RC5 : 1;
2338 unsigned RC6 : 1;
2339 unsigned RC7 : 1;
2341 } __TRISCbits_t;
2343 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2345 #define _TRISC_TRISC0 0x01
2346 #define _TRISC_RC0 0x01
2347 #define _TRISC_TRISC1 0x02
2348 #define _TRISC_RC1 0x02
2349 #define _TRISC_TRISC2 0x04
2350 #define _TRISC_RC2 0x04
2351 #define _TRISC_TRISC3 0x08
2352 #define _TRISC_RC3 0x08
2353 #define _TRISC_TRISC4 0x10
2354 #define _TRISC_RC4 0x10
2355 #define _TRISC_TRISC5 0x20
2356 #define _TRISC_RC5 0x20
2357 #define _TRISC_TRISC6 0x40
2358 #define _TRISC_RC6 0x40
2359 #define _TRISC_TRISC7 0x80
2360 #define _TRISC_RC7 0x80
2362 //==============================================================================
2365 //==============================================================================
2366 // DDRD Bits
2368 extern __at(0x0F95) __sfr DDRD;
2370 typedef union
2372 struct
2374 unsigned TRISD0 : 1;
2375 unsigned TRISD1 : 1;
2376 unsigned TRISD2 : 1;
2377 unsigned TRISD3 : 1;
2378 unsigned TRISD4 : 1;
2379 unsigned TRISD5 : 1;
2380 unsigned TRISD6 : 1;
2381 unsigned TRISD7 : 1;
2384 struct
2386 unsigned RD0 : 1;
2387 unsigned RD1 : 1;
2388 unsigned RD2 : 1;
2389 unsigned RD3 : 1;
2390 unsigned RD4 : 1;
2391 unsigned RD5 : 1;
2392 unsigned RD6 : 1;
2393 unsigned RD7 : 1;
2395 } __DDRDbits_t;
2397 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2399 #define _TRISD0 0x01
2400 #define _RD0 0x01
2401 #define _TRISD1 0x02
2402 #define _RD1 0x02
2403 #define _TRISD2 0x04
2404 #define _RD2 0x04
2405 #define _TRISD3 0x08
2406 #define _RD3 0x08
2407 #define _TRISD4 0x10
2408 #define _RD4 0x10
2409 #define _TRISD5 0x20
2410 #define _RD5 0x20
2411 #define _TRISD6 0x40
2412 #define _RD6 0x40
2413 #define _TRISD7 0x80
2414 #define _RD7 0x80
2416 //==============================================================================
2419 //==============================================================================
2420 // TRISD Bits
2422 extern __at(0x0F95) __sfr TRISD;
2424 typedef union
2426 struct
2428 unsigned TRISD0 : 1;
2429 unsigned TRISD1 : 1;
2430 unsigned TRISD2 : 1;
2431 unsigned TRISD3 : 1;
2432 unsigned TRISD4 : 1;
2433 unsigned TRISD5 : 1;
2434 unsigned TRISD6 : 1;
2435 unsigned TRISD7 : 1;
2438 struct
2440 unsigned RD0 : 1;
2441 unsigned RD1 : 1;
2442 unsigned RD2 : 1;
2443 unsigned RD3 : 1;
2444 unsigned RD4 : 1;
2445 unsigned RD5 : 1;
2446 unsigned RD6 : 1;
2447 unsigned RD7 : 1;
2449 } __TRISDbits_t;
2451 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2453 #define _TRISD_TRISD0 0x01
2454 #define _TRISD_RD0 0x01
2455 #define _TRISD_TRISD1 0x02
2456 #define _TRISD_RD1 0x02
2457 #define _TRISD_TRISD2 0x04
2458 #define _TRISD_RD2 0x04
2459 #define _TRISD_TRISD3 0x08
2460 #define _TRISD_RD3 0x08
2461 #define _TRISD_TRISD4 0x10
2462 #define _TRISD_RD4 0x10
2463 #define _TRISD_TRISD5 0x20
2464 #define _TRISD_RD5 0x20
2465 #define _TRISD_TRISD6 0x40
2466 #define _TRISD_RD6 0x40
2467 #define _TRISD_TRISD7 0x80
2468 #define _TRISD_RD7 0x80
2470 //==============================================================================
2473 //==============================================================================
2474 // DDRE Bits
2476 extern __at(0x0F96) __sfr DDRE;
2478 typedef union
2480 struct
2482 unsigned TRISE0 : 1;
2483 unsigned TRISE1 : 1;
2484 unsigned : 1;
2485 unsigned TRISE3 : 1;
2486 unsigned TRISE4 : 1;
2487 unsigned TRISE5 : 1;
2488 unsigned TRISE6 : 1;
2489 unsigned TRISE7 : 1;
2492 struct
2494 unsigned RE0 : 1;
2495 unsigned RE1 : 1;
2496 unsigned : 1;
2497 unsigned RE3 : 1;
2498 unsigned RE4 : 1;
2499 unsigned RE5 : 1;
2500 unsigned RE6 : 1;
2501 unsigned RE7 : 1;
2503 } __DDREbits_t;
2505 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2507 #define _TRISE0 0x01
2508 #define _RE0 0x01
2509 #define _TRISE1 0x02
2510 #define _RE1 0x02
2511 #define _TRISE3 0x08
2512 #define _RE3 0x08
2513 #define _TRISE4 0x10
2514 #define _RE4 0x10
2515 #define _TRISE5 0x20
2516 #define _RE5 0x20
2517 #define _TRISE6 0x40
2518 #define _RE6 0x40
2519 #define _TRISE7 0x80
2520 #define _RE7 0x80
2522 //==============================================================================
2525 //==============================================================================
2526 // TRISE Bits
2528 extern __at(0x0F96) __sfr TRISE;
2530 typedef union
2532 struct
2534 unsigned TRISE0 : 1;
2535 unsigned TRISE1 : 1;
2536 unsigned : 1;
2537 unsigned TRISE3 : 1;
2538 unsigned TRISE4 : 1;
2539 unsigned TRISE5 : 1;
2540 unsigned TRISE6 : 1;
2541 unsigned TRISE7 : 1;
2544 struct
2546 unsigned RE0 : 1;
2547 unsigned RE1 : 1;
2548 unsigned : 1;
2549 unsigned RE3 : 1;
2550 unsigned RE4 : 1;
2551 unsigned RE5 : 1;
2552 unsigned RE6 : 1;
2553 unsigned RE7 : 1;
2555 } __TRISEbits_t;
2557 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2559 #define _TRISE_TRISE0 0x01
2560 #define _TRISE_RE0 0x01
2561 #define _TRISE_TRISE1 0x02
2562 #define _TRISE_RE1 0x02
2563 #define _TRISE_TRISE3 0x08
2564 #define _TRISE_RE3 0x08
2565 #define _TRISE_TRISE4 0x10
2566 #define _TRISE_RE4 0x10
2567 #define _TRISE_TRISE5 0x20
2568 #define _TRISE_RE5 0x20
2569 #define _TRISE_TRISE6 0x40
2570 #define _TRISE_RE6 0x40
2571 #define _TRISE_TRISE7 0x80
2572 #define _TRISE_RE7 0x80
2574 //==============================================================================
2577 //==============================================================================
2578 // DDRF Bits
2580 extern __at(0x0F97) __sfr DDRF;
2582 typedef union
2584 struct
2586 unsigned : 1;
2587 unsigned TRISF1 : 1;
2588 unsigned TRISF2 : 1;
2589 unsigned TRISF3 : 1;
2590 unsigned TRISF4 : 1;
2591 unsigned TRISF5 : 1;
2592 unsigned TRISF6 : 1;
2593 unsigned TRISF7 : 1;
2596 struct
2598 unsigned : 1;
2599 unsigned RF1 : 1;
2600 unsigned RF2 : 1;
2601 unsigned RF3 : 1;
2602 unsigned RF4 : 1;
2603 unsigned RF5 : 1;
2604 unsigned RF6 : 1;
2605 unsigned RF7 : 1;
2607 } __DDRFbits_t;
2609 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
2611 #define _TRISF1 0x02
2612 #define _RF1 0x02
2613 #define _TRISF2 0x04
2614 #define _RF2 0x04
2615 #define _TRISF3 0x08
2616 #define _RF3 0x08
2617 #define _TRISF4 0x10
2618 #define _RF4 0x10
2619 #define _TRISF5 0x20
2620 #define _RF5 0x20
2621 #define _TRISF6 0x40
2622 #define _RF6 0x40
2623 #define _TRISF7 0x80
2624 #define _RF7 0x80
2626 //==============================================================================
2629 //==============================================================================
2630 // TRISF Bits
2632 extern __at(0x0F97) __sfr TRISF;
2634 typedef union
2636 struct
2638 unsigned : 1;
2639 unsigned TRISF1 : 1;
2640 unsigned TRISF2 : 1;
2641 unsigned TRISF3 : 1;
2642 unsigned TRISF4 : 1;
2643 unsigned TRISF5 : 1;
2644 unsigned TRISF6 : 1;
2645 unsigned TRISF7 : 1;
2648 struct
2650 unsigned : 1;
2651 unsigned RF1 : 1;
2652 unsigned RF2 : 1;
2653 unsigned RF3 : 1;
2654 unsigned RF4 : 1;
2655 unsigned RF5 : 1;
2656 unsigned RF6 : 1;
2657 unsigned RF7 : 1;
2659 } __TRISFbits_t;
2661 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
2663 #define _TRISF_TRISF1 0x02
2664 #define _TRISF_RF1 0x02
2665 #define _TRISF_TRISF2 0x04
2666 #define _TRISF_RF2 0x04
2667 #define _TRISF_TRISF3 0x08
2668 #define _TRISF_RF3 0x08
2669 #define _TRISF_TRISF4 0x10
2670 #define _TRISF_RF4 0x10
2671 #define _TRISF_TRISF5 0x20
2672 #define _TRISF_RF5 0x20
2673 #define _TRISF_TRISF6 0x40
2674 #define _TRISF_RF6 0x40
2675 #define _TRISF_TRISF7 0x80
2676 #define _TRISF_RF7 0x80
2678 //==============================================================================
2681 //==============================================================================
2682 // DDRG Bits
2684 extern __at(0x0F98) __sfr DDRG;
2686 typedef union
2688 struct
2690 unsigned TRISG0 : 1;
2691 unsigned TRISG1 : 1;
2692 unsigned TRISG2 : 1;
2693 unsigned TRISG3 : 1;
2694 unsigned TRISG4 : 1;
2695 unsigned CCP1OD : 1;
2696 unsigned CCP2OD : 1;
2697 unsigned SPIOD : 1;
2700 struct
2702 unsigned RG0 : 1;
2703 unsigned RG1 : 1;
2704 unsigned RG2 : 1;
2705 unsigned RG3 : 1;
2706 unsigned RG4 : 1;
2707 unsigned : 1;
2708 unsigned : 1;
2709 unsigned : 1;
2712 struct
2714 unsigned RG : 5;
2715 unsigned : 3;
2718 struct
2720 unsigned TRISG : 5;
2721 unsigned : 3;
2723 } __DDRGbits_t;
2725 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
2727 #define _TRISG0 0x01
2728 #define _RG0 0x01
2729 #define _TRISG1 0x02
2730 #define _RG1 0x02
2731 #define _TRISG2 0x04
2732 #define _RG2 0x04
2733 #define _TRISG3 0x08
2734 #define _RG3 0x08
2735 #define _TRISG4 0x10
2736 #define _RG4 0x10
2737 #define _CCP1OD 0x20
2738 #define _CCP2OD 0x40
2739 #define _SPIOD 0x80
2741 //==============================================================================
2744 //==============================================================================
2745 // TRISG Bits
2747 extern __at(0x0F98) __sfr TRISG;
2749 typedef union
2751 struct
2753 unsigned TRISG0 : 1;
2754 unsigned TRISG1 : 1;
2755 unsigned TRISG2 : 1;
2756 unsigned TRISG3 : 1;
2757 unsigned TRISG4 : 1;
2758 unsigned CCP1OD : 1;
2759 unsigned CCP2OD : 1;
2760 unsigned SPIOD : 1;
2763 struct
2765 unsigned RG0 : 1;
2766 unsigned RG1 : 1;
2767 unsigned RG2 : 1;
2768 unsigned RG3 : 1;
2769 unsigned RG4 : 1;
2770 unsigned : 1;
2771 unsigned : 1;
2772 unsigned : 1;
2775 struct
2777 unsigned RG : 5;
2778 unsigned : 3;
2781 struct
2783 unsigned TRISG : 5;
2784 unsigned : 3;
2786 } __TRISGbits_t;
2788 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
2790 #define _TRISG_TRISG0 0x01
2791 #define _TRISG_RG0 0x01
2792 #define _TRISG_TRISG1 0x02
2793 #define _TRISG_RG1 0x02
2794 #define _TRISG_TRISG2 0x04
2795 #define _TRISG_RG2 0x04
2796 #define _TRISG_TRISG3 0x08
2797 #define _TRISG_RG3 0x08
2798 #define _TRISG_TRISG4 0x10
2799 #define _TRISG_RG4 0x10
2800 #define _TRISG_CCP1OD 0x20
2801 #define _TRISG_CCP2OD 0x40
2802 #define _TRISG_SPIOD 0x80
2804 //==============================================================================
2807 //==============================================================================
2808 // OSCTUNE Bits
2810 extern __at(0x0F9B) __sfr OSCTUNE;
2812 typedef union
2814 struct
2816 unsigned TUN0 : 1;
2817 unsigned TUN1 : 1;
2818 unsigned TUN2 : 1;
2819 unsigned TUN3 : 1;
2820 unsigned TUN4 : 1;
2821 unsigned TUN5 : 1;
2822 unsigned PLLEN : 1;
2823 unsigned INTSRC : 1;
2826 struct
2828 unsigned TUN : 6;
2829 unsigned : 2;
2831 } __OSCTUNEbits_t;
2833 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2835 #define _TUN0 0x01
2836 #define _TUN1 0x02
2837 #define _TUN2 0x04
2838 #define _TUN3 0x08
2839 #define _TUN4 0x10
2840 #define _TUN5 0x20
2841 #define _PLLEN 0x40
2842 #define _INTSRC 0x80
2844 //==============================================================================
2847 //==============================================================================
2848 // PIE1 Bits
2850 extern __at(0x0F9D) __sfr PIE1;
2852 typedef union
2854 struct
2856 unsigned TMR1IE : 1;
2857 unsigned TMR2IE : 1;
2858 unsigned : 1;
2859 unsigned SSPIE : 1;
2860 unsigned TX1IE : 1;
2861 unsigned RC1IE : 1;
2862 unsigned ADIE : 1;
2863 unsigned : 1;
2866 struct
2868 unsigned : 1;
2869 unsigned : 1;
2870 unsigned : 1;
2871 unsigned SSP1IE : 1;
2872 unsigned TXIE : 1;
2873 unsigned RCIE : 1;
2874 unsigned : 1;
2875 unsigned : 1;
2877 } __PIE1bits_t;
2879 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
2881 #define _TMR1IE 0x01
2882 #define _TMR2IE 0x02
2883 #define _SSPIE 0x08
2884 #define _SSP1IE 0x08
2885 #define _TX1IE 0x10
2886 #define _TXIE 0x10
2887 #define _RC1IE 0x20
2888 #define _RCIE 0x20
2889 #define _ADIE 0x40
2891 //==============================================================================
2894 //==============================================================================
2895 // PIR1 Bits
2897 extern __at(0x0F9E) __sfr PIR1;
2899 typedef union
2901 struct
2903 unsigned TMR1IF : 1;
2904 unsigned TMR2IF : 1;
2905 unsigned : 1;
2906 unsigned SSPIF : 1;
2907 unsigned TX1IF : 1;
2908 unsigned RC1IF : 1;
2909 unsigned ADIF : 1;
2910 unsigned : 1;
2913 struct
2915 unsigned : 1;
2916 unsigned : 1;
2917 unsigned : 1;
2918 unsigned SSP1IF : 1;
2919 unsigned TXIF : 1;
2920 unsigned RCIF : 1;
2921 unsigned : 1;
2922 unsigned : 1;
2924 } __PIR1bits_t;
2926 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2928 #define _TMR1IF 0x01
2929 #define _TMR2IF 0x02
2930 #define _SSPIF 0x08
2931 #define _SSP1IF 0x08
2932 #define _TX1IF 0x10
2933 #define _TXIF 0x10
2934 #define _RC1IF 0x20
2935 #define _RCIF 0x20
2936 #define _ADIF 0x40
2938 //==============================================================================
2941 //==============================================================================
2942 // IPR1 Bits
2944 extern __at(0x0F9F) __sfr IPR1;
2946 typedef union
2948 struct
2950 unsigned TMR1IP : 1;
2951 unsigned TMR2IP : 1;
2952 unsigned : 1;
2953 unsigned SSPIP : 1;
2954 unsigned TX1IP : 1;
2955 unsigned RC1IP : 1;
2956 unsigned ADIP : 1;
2957 unsigned : 1;
2960 struct
2962 unsigned : 1;
2963 unsigned : 1;
2964 unsigned : 1;
2965 unsigned SSP1IP : 1;
2966 unsigned TXIP : 1;
2967 unsigned RCIP : 1;
2968 unsigned : 1;
2969 unsigned : 1;
2971 } __IPR1bits_t;
2973 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2975 #define _TMR1IP 0x01
2976 #define _TMR2IP 0x02
2977 #define _SSPIP 0x08
2978 #define _SSP1IP 0x08
2979 #define _TX1IP 0x10
2980 #define _TXIP 0x10
2981 #define _RC1IP 0x20
2982 #define _RCIP 0x20
2983 #define _ADIP 0x40
2985 //==============================================================================
2988 //==============================================================================
2989 // PIE2 Bits
2991 extern __at(0x0FA0) __sfr PIE2;
2993 typedef union
2995 struct
2997 unsigned : 1;
2998 unsigned TMR3IE : 1;
2999 unsigned LVDIE : 1;
3000 unsigned BCLIE : 1;
3001 unsigned : 1;
3002 unsigned : 1;
3003 unsigned CMIE : 1;
3004 unsigned OSCFIE : 1;
3007 struct
3009 unsigned : 1;
3010 unsigned : 1;
3011 unsigned : 1;
3012 unsigned BCL1IE : 1;
3013 unsigned : 1;
3014 unsigned : 1;
3015 unsigned : 1;
3016 unsigned : 1;
3018 } __PIE2bits_t;
3020 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3022 #define _TMR3IE 0x02
3023 #define _LVDIE 0x04
3024 #define _BCLIE 0x08
3025 #define _BCL1IE 0x08
3026 #define _CMIE 0x40
3027 #define _OSCFIE 0x80
3029 //==============================================================================
3032 //==============================================================================
3033 // PIR2 Bits
3035 extern __at(0x0FA1) __sfr PIR2;
3037 typedef union
3039 struct
3041 unsigned : 1;
3042 unsigned TMR3IF : 1;
3043 unsigned LVDIF : 1;
3044 unsigned BCLIF : 1;
3045 unsigned : 1;
3046 unsigned : 1;
3047 unsigned CMIF : 1;
3048 unsigned OSCFIF : 1;
3051 struct
3053 unsigned : 1;
3054 unsigned : 1;
3055 unsigned : 1;
3056 unsigned BCL1IF : 1;
3057 unsigned : 1;
3058 unsigned : 1;
3059 unsigned : 1;
3060 unsigned : 1;
3062 } __PIR2bits_t;
3064 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3066 #define _TMR3IF 0x02
3067 #define _LVDIF 0x04
3068 #define _BCLIF 0x08
3069 #define _BCL1IF 0x08
3070 #define _CMIF 0x40
3071 #define _OSCFIF 0x80
3073 //==============================================================================
3076 //==============================================================================
3077 // IPR2 Bits
3079 extern __at(0x0FA2) __sfr IPR2;
3081 typedef union
3083 struct
3085 unsigned : 1;
3086 unsigned TMR3IP : 1;
3087 unsigned LVDIP : 1;
3088 unsigned BCLIP : 1;
3089 unsigned : 1;
3090 unsigned : 1;
3091 unsigned CMIP : 1;
3092 unsigned OSCFIP : 1;
3095 struct
3097 unsigned : 1;
3098 unsigned : 1;
3099 unsigned : 1;
3100 unsigned BCL1IP : 1;
3101 unsigned : 1;
3102 unsigned : 1;
3103 unsigned : 1;
3104 unsigned : 1;
3106 } __IPR2bits_t;
3108 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3110 #define _TMR3IP 0x02
3111 #define _LVDIP 0x04
3112 #define _BCLIP 0x08
3113 #define _BCL1IP 0x08
3114 #define _CMIP 0x40
3115 #define _OSCFIP 0x80
3117 //==============================================================================
3120 //==============================================================================
3121 // PIE3 Bits
3123 extern __at(0x0FA3) __sfr PIE3;
3125 typedef struct
3127 unsigned : 1;
3128 unsigned CCP1IE : 1;
3129 unsigned CCP2IE : 1;
3130 unsigned : 1;
3131 unsigned TX2IE : 1;
3132 unsigned RC2IE : 1;
3133 unsigned LCDIE : 1;
3134 unsigned : 1;
3135 } __PIE3bits_t;
3137 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3139 #define _CCP1IE 0x02
3140 #define _CCP2IE 0x04
3141 #define _TX2IE 0x10
3142 #define _RC2IE 0x20
3143 #define _LCDIE 0x40
3145 //==============================================================================
3148 //==============================================================================
3149 // PIR3 Bits
3151 extern __at(0x0FA4) __sfr PIR3;
3153 typedef struct
3155 unsigned : 1;
3156 unsigned CCP1IF : 1;
3157 unsigned CCP2IF : 1;
3158 unsigned : 1;
3159 unsigned TX2IF : 1;
3160 unsigned RC2IF : 1;
3161 unsigned LCDIF : 1;
3162 unsigned : 1;
3163 } __PIR3bits_t;
3165 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3167 #define _CCP1IF 0x02
3168 #define _CCP2IF 0x04
3169 #define _TX2IF 0x10
3170 #define _RC2IF 0x20
3171 #define _LCDIF 0x40
3173 //==============================================================================
3176 //==============================================================================
3177 // IPR3 Bits
3179 extern __at(0x0FA5) __sfr IPR3;
3181 typedef struct
3183 unsigned : 1;
3184 unsigned CCP1IP : 1;
3185 unsigned CCP2IP : 1;
3186 unsigned : 1;
3187 unsigned TX2IP : 1;
3188 unsigned RC2IP : 1;
3189 unsigned LCDIP : 1;
3190 unsigned : 1;
3191 } __IPR3bits_t;
3193 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3195 #define _CCP1IP 0x02
3196 #define _CCP2IP 0x04
3197 #define _TX2IP 0x10
3198 #define _RC2IP 0x20
3199 #define _LCDIP 0x40
3201 //==============================================================================
3204 //==============================================================================
3205 // EECON1 Bits
3207 extern __at(0x0FA6) __sfr EECON1;
3209 typedef struct
3211 unsigned : 1;
3212 unsigned WR : 1;
3213 unsigned WREN : 1;
3214 unsigned WRERR : 1;
3215 unsigned FREE : 1;
3216 unsigned : 1;
3217 unsigned : 1;
3218 unsigned : 1;
3219 } __EECON1bits_t;
3221 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3223 #define _WR 0x02
3224 #define _WREN 0x04
3225 #define _WRERR 0x08
3226 #define _FREE 0x10
3228 //==============================================================================
3230 extern __at(0x0FA7) __sfr EECON2;
3232 //==============================================================================
3233 // LCDCON Bits
3235 extern __at(0x0FA8) __sfr LCDCON;
3237 typedef union
3239 struct
3241 unsigned LMUX0 : 1;
3242 unsigned LMUX1 : 1;
3243 unsigned LCDCS0 : 1;
3244 unsigned LCDCS1 : 1;
3245 unsigned : 1;
3246 unsigned WERR : 1;
3247 unsigned SLPEN : 1;
3248 unsigned LCDEN : 1;
3251 struct
3253 unsigned : 1;
3254 unsigned : 1;
3255 unsigned CS0 : 1;
3256 unsigned CS1 : 1;
3257 unsigned : 1;
3258 unsigned LCDWERR : 1;
3259 unsigned LCDSLPEN : 1;
3260 unsigned : 1;
3263 struct
3265 unsigned LMUX : 2;
3266 unsigned : 6;
3269 struct
3271 unsigned : 2;
3272 unsigned LCDCS : 2;
3273 unsigned : 4;
3276 struct
3278 unsigned : 2;
3279 unsigned CS : 2;
3280 unsigned : 4;
3282 } __LCDCONbits_t;
3284 extern __at(0x0FA8) volatile __LCDCONbits_t LCDCONbits;
3286 #define _LMUX0 0x01
3287 #define _LMUX1 0x02
3288 #define _LCDCS0 0x04
3289 #define _CS0 0x04
3290 #define _LCDCS1 0x08
3291 #define _CS1 0x08
3292 #define _WERR 0x20
3293 #define _LCDWERR 0x20
3294 #define _SLPEN 0x40
3295 #define _LCDSLPEN 0x40
3296 #define _LCDEN 0x80
3298 //==============================================================================
3301 //==============================================================================
3302 // LCDSE0 Bits
3304 extern __at(0x0FA9) __sfr LCDSE0;
3306 typedef union
3308 struct
3310 unsigned SE0 : 1;
3311 unsigned SE1 : 1;
3312 unsigned SE2 : 1;
3313 unsigned SE3 : 1;
3314 unsigned SE4 : 1;
3315 unsigned SE5 : 1;
3316 unsigned SE6 : 1;
3317 unsigned SE7 : 1;
3320 struct
3322 unsigned SEGEN0 : 1;
3323 unsigned SEGEN1 : 1;
3324 unsigned SEGEN2 : 1;
3325 unsigned SEGEN3 : 1;
3326 unsigned SEGEN4 : 1;
3327 unsigned SEGEN5 : 1;
3328 unsigned SEGEN6 : 1;
3329 unsigned SEGEN7 : 1;
3332 struct
3334 unsigned SE00 : 1;
3335 unsigned SE01 : 1;
3336 unsigned SE02 : 1;
3337 unsigned SE03 : 1;
3338 unsigned SE04 : 1;
3339 unsigned SE05 : 1;
3340 unsigned SE06 : 1;
3341 unsigned SE07 : 1;
3343 } __LCDSE0bits_t;
3345 extern __at(0x0FA9) volatile __LCDSE0bits_t LCDSE0bits;
3347 #define _SE0 0x01
3348 #define _SEGEN0 0x01
3349 #define _SE00 0x01
3350 #define _SE1 0x02
3351 #define _SEGEN1 0x02
3352 #define _SE01 0x02
3353 #define _SE2 0x04
3354 #define _SEGEN2 0x04
3355 #define _SE02 0x04
3356 #define _SE3 0x08
3357 #define _SEGEN3 0x08
3358 #define _SE03 0x08
3359 #define _SE4 0x10
3360 #define _SEGEN4 0x10
3361 #define _SE04 0x10
3362 #define _SE5 0x20
3363 #define _SEGEN5 0x20
3364 #define _SE05 0x20
3365 #define _SE6 0x40
3366 #define _SEGEN6 0x40
3367 #define _SE06 0x40
3368 #define _SE7 0x80
3369 #define _SEGEN7 0x80
3370 #define _SE07 0x80
3372 //==============================================================================
3375 //==============================================================================
3376 // LCDPS Bits
3378 extern __at(0x0FAA) __sfr LCDPS;
3380 typedef union
3382 struct
3384 unsigned LCDPS0 : 1;
3385 unsigned LCDPS1 : 1;
3386 unsigned LCDPS2 : 1;
3387 unsigned LCDPS3 : 1;
3388 unsigned WA : 1;
3389 unsigned LCDA : 1;
3390 unsigned BIASMD : 1;
3391 unsigned WFT : 1;
3394 struct
3396 unsigned LP0 : 1;
3397 unsigned LP1 : 1;
3398 unsigned LP2 : 1;
3399 unsigned LP3 : 1;
3400 unsigned : 1;
3401 unsigned : 1;
3402 unsigned : 1;
3403 unsigned : 1;
3406 struct
3408 unsigned LCDPS : 4;
3409 unsigned : 4;
3412 struct
3414 unsigned LP : 4;
3415 unsigned : 4;
3417 } __LCDPSbits_t;
3419 extern __at(0x0FAA) volatile __LCDPSbits_t LCDPSbits;
3421 #define _LCDPS0 0x01
3422 #define _LP0 0x01
3423 #define _LCDPS1 0x02
3424 #define _LP1 0x02
3425 #define _LCDPS2 0x04
3426 #define _LP2 0x04
3427 #define _LCDPS3 0x08
3428 #define _LP3 0x08
3429 #define _WA 0x10
3430 #define _LCDA 0x20
3431 #define _BIASMD 0x40
3432 #define _WFT 0x80
3434 //==============================================================================
3437 //==============================================================================
3438 // RCSTA Bits
3440 extern __at(0x0FAB) __sfr RCSTA;
3442 typedef union
3444 struct
3446 unsigned RX9D : 1;
3447 unsigned OERR : 1;
3448 unsigned FERR : 1;
3449 unsigned ADDEN : 1;
3450 unsigned CREN : 1;
3451 unsigned SREN : 1;
3452 unsigned RX9 : 1;
3453 unsigned SPEN : 1;
3456 struct
3458 unsigned RCD8 : 1;
3459 unsigned OERR1 : 1;
3460 unsigned FERR1 : 1;
3461 unsigned ADDEN1 : 1;
3462 unsigned CREN1 : 1;
3463 unsigned SREN1 : 1;
3464 unsigned RC9 : 1;
3465 unsigned SPEN1 : 1;
3468 struct
3470 unsigned RX9D1 : 1;
3471 unsigned : 1;
3472 unsigned : 1;
3473 unsigned : 1;
3474 unsigned : 1;
3475 unsigned : 1;
3476 unsigned NOT_RC8 : 1;
3477 unsigned : 1;
3480 struct
3482 unsigned : 1;
3483 unsigned : 1;
3484 unsigned : 1;
3485 unsigned : 1;
3486 unsigned : 1;
3487 unsigned : 1;
3488 unsigned RC8_9 : 1;
3489 unsigned : 1;
3492 struct
3494 unsigned : 1;
3495 unsigned : 1;
3496 unsigned : 1;
3497 unsigned : 1;
3498 unsigned : 1;
3499 unsigned : 1;
3500 unsigned RX91 : 1;
3501 unsigned : 1;
3503 } __RCSTAbits_t;
3505 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3507 #define _RX9D 0x01
3508 #define _RCD8 0x01
3509 #define _RX9D1 0x01
3510 #define _OERR 0x02
3511 #define _OERR1 0x02
3512 #define _FERR 0x04
3513 #define _FERR1 0x04
3514 #define _ADDEN 0x08
3515 #define _ADDEN1 0x08
3516 #define _CREN 0x10
3517 #define _CREN1 0x10
3518 #define _SREN 0x20
3519 #define _SREN1 0x20
3520 #define _RX9 0x40
3521 #define _RC9 0x40
3522 #define _NOT_RC8 0x40
3523 #define _RC8_9 0x40
3524 #define _RX91 0x40
3525 #define _SPEN 0x80
3526 #define _SPEN1 0x80
3528 //==============================================================================
3531 //==============================================================================
3532 // RCSTA1 Bits
3534 extern __at(0x0FAB) __sfr RCSTA1;
3536 typedef union
3538 struct
3540 unsigned RX9D : 1;
3541 unsigned OERR : 1;
3542 unsigned FERR : 1;
3543 unsigned ADDEN : 1;
3544 unsigned CREN : 1;
3545 unsigned SREN : 1;
3546 unsigned RX9 : 1;
3547 unsigned SPEN : 1;
3550 struct
3552 unsigned RCD8 : 1;
3553 unsigned OERR1 : 1;
3554 unsigned FERR1 : 1;
3555 unsigned ADDEN1 : 1;
3556 unsigned CREN1 : 1;
3557 unsigned SREN1 : 1;
3558 unsigned RC9 : 1;
3559 unsigned SPEN1 : 1;
3562 struct
3564 unsigned RX9D1 : 1;
3565 unsigned : 1;
3566 unsigned : 1;
3567 unsigned : 1;
3568 unsigned : 1;
3569 unsigned : 1;
3570 unsigned NOT_RC8 : 1;
3571 unsigned : 1;
3574 struct
3576 unsigned : 1;
3577 unsigned : 1;
3578 unsigned : 1;
3579 unsigned : 1;
3580 unsigned : 1;
3581 unsigned : 1;
3582 unsigned RC8_9 : 1;
3583 unsigned : 1;
3586 struct
3588 unsigned : 1;
3589 unsigned : 1;
3590 unsigned : 1;
3591 unsigned : 1;
3592 unsigned : 1;
3593 unsigned : 1;
3594 unsigned RX91 : 1;
3595 unsigned : 1;
3597 } __RCSTA1bits_t;
3599 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
3601 #define _RCSTA1_RX9D 0x01
3602 #define _RCSTA1_RCD8 0x01
3603 #define _RCSTA1_RX9D1 0x01
3604 #define _RCSTA1_OERR 0x02
3605 #define _RCSTA1_OERR1 0x02
3606 #define _RCSTA1_FERR 0x04
3607 #define _RCSTA1_FERR1 0x04
3608 #define _RCSTA1_ADDEN 0x08
3609 #define _RCSTA1_ADDEN1 0x08
3610 #define _RCSTA1_CREN 0x10
3611 #define _RCSTA1_CREN1 0x10
3612 #define _RCSTA1_SREN 0x20
3613 #define _RCSTA1_SREN1 0x20
3614 #define _RCSTA1_RX9 0x40
3615 #define _RCSTA1_RC9 0x40
3616 #define _RCSTA1_NOT_RC8 0x40
3617 #define _RCSTA1_RC8_9 0x40
3618 #define _RCSTA1_RX91 0x40
3619 #define _RCSTA1_SPEN 0x80
3620 #define _RCSTA1_SPEN1 0x80
3622 //==============================================================================
3625 //==============================================================================
3626 // TXSTA Bits
3628 extern __at(0x0FAC) __sfr TXSTA;
3630 typedef union
3632 struct
3634 unsigned TX9D : 1;
3635 unsigned TRMT : 1;
3636 unsigned BRGH : 1;
3637 unsigned SENDB : 1;
3638 unsigned SYNC : 1;
3639 unsigned TXEN : 1;
3640 unsigned TX9 : 1;
3641 unsigned CSRC : 1;
3644 struct
3646 unsigned TXD8 : 1;
3647 unsigned TRMT1 : 1;
3648 unsigned BRGH1 : 1;
3649 unsigned SENDB1 : 1;
3650 unsigned SYNC1 : 1;
3651 unsigned TXEN1 : 1;
3652 unsigned TX8_9 : 1;
3653 unsigned CSRC1 : 1;
3656 struct
3658 unsigned TX9D1 : 1;
3659 unsigned : 1;
3660 unsigned : 1;
3661 unsigned : 1;
3662 unsigned : 1;
3663 unsigned : 1;
3664 unsigned NOT_TX8 : 1;
3665 unsigned : 1;
3668 struct
3670 unsigned : 1;
3671 unsigned : 1;
3672 unsigned : 1;
3673 unsigned : 1;
3674 unsigned : 1;
3675 unsigned : 1;
3676 unsigned TX91 : 1;
3677 unsigned : 1;
3679 } __TXSTAbits_t;
3681 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
3683 #define _TX9D 0x01
3684 #define _TXD8 0x01
3685 #define _TX9D1 0x01
3686 #define _TRMT 0x02
3687 #define _TRMT1 0x02
3688 #define _BRGH 0x04
3689 #define _BRGH1 0x04
3690 #define _SENDB 0x08
3691 #define _SENDB1 0x08
3692 #define _SYNC 0x10
3693 #define _SYNC1 0x10
3694 #define _TXEN 0x20
3695 #define _TXEN1 0x20
3696 #define _TX9 0x40
3697 #define _TX8_9 0x40
3698 #define _NOT_TX8 0x40
3699 #define _TX91 0x40
3700 #define _CSRC 0x80
3701 #define _CSRC1 0x80
3703 //==============================================================================
3706 //==============================================================================
3707 // TXSTA1 Bits
3709 extern __at(0x0FAC) __sfr TXSTA1;
3711 typedef union
3713 struct
3715 unsigned TX9D : 1;
3716 unsigned TRMT : 1;
3717 unsigned BRGH : 1;
3718 unsigned SENDB : 1;
3719 unsigned SYNC : 1;
3720 unsigned TXEN : 1;
3721 unsigned TX9 : 1;
3722 unsigned CSRC : 1;
3725 struct
3727 unsigned TXD8 : 1;
3728 unsigned TRMT1 : 1;
3729 unsigned BRGH1 : 1;
3730 unsigned SENDB1 : 1;
3731 unsigned SYNC1 : 1;
3732 unsigned TXEN1 : 1;
3733 unsigned TX8_9 : 1;
3734 unsigned CSRC1 : 1;
3737 struct
3739 unsigned TX9D1 : 1;
3740 unsigned : 1;
3741 unsigned : 1;
3742 unsigned : 1;
3743 unsigned : 1;
3744 unsigned : 1;
3745 unsigned NOT_TX8 : 1;
3746 unsigned : 1;
3749 struct
3751 unsigned : 1;
3752 unsigned : 1;
3753 unsigned : 1;
3754 unsigned : 1;
3755 unsigned : 1;
3756 unsigned : 1;
3757 unsigned TX91 : 1;
3758 unsigned : 1;
3760 } __TXSTA1bits_t;
3762 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
3764 #define _TXSTA1_TX9D 0x01
3765 #define _TXSTA1_TXD8 0x01
3766 #define _TXSTA1_TX9D1 0x01
3767 #define _TXSTA1_TRMT 0x02
3768 #define _TXSTA1_TRMT1 0x02
3769 #define _TXSTA1_BRGH 0x04
3770 #define _TXSTA1_BRGH1 0x04
3771 #define _TXSTA1_SENDB 0x08
3772 #define _TXSTA1_SENDB1 0x08
3773 #define _TXSTA1_SYNC 0x10
3774 #define _TXSTA1_SYNC1 0x10
3775 #define _TXSTA1_TXEN 0x20
3776 #define _TXSTA1_TXEN1 0x20
3777 #define _TXSTA1_TX9 0x40
3778 #define _TXSTA1_TX8_9 0x40
3779 #define _TXSTA1_NOT_TX8 0x40
3780 #define _TXSTA1_TX91 0x40
3781 #define _TXSTA1_CSRC 0x80
3782 #define _TXSTA1_CSRC1 0x80
3784 //==============================================================================
3786 extern __at(0x0FAD) __sfr TXREG;
3787 extern __at(0x0FAD) __sfr TXREG1;
3788 extern __at(0x0FAE) __sfr RCREG;
3789 extern __at(0x0FAE) __sfr RCREG1;
3790 extern __at(0x0FAF) __sfr SPBRG;
3791 extern __at(0x0FAF) __sfr SPBRG1;
3793 //==============================================================================
3794 // T3CON Bits
3796 extern __at(0x0FB1) __sfr T3CON;
3798 typedef union
3800 struct
3802 unsigned TMR3ON : 1;
3803 unsigned TMR3CS : 1;
3804 unsigned NOT_T3SYNC : 1;
3805 unsigned T3CCP1 : 1;
3806 unsigned T3CKPS0 : 1;
3807 unsigned T3CKPS1 : 1;
3808 unsigned T3CCP2 : 1;
3809 unsigned RD16 : 1;
3812 struct
3814 unsigned : 1;
3815 unsigned : 1;
3816 unsigned T3SYNC : 1;
3817 unsigned : 1;
3818 unsigned : 1;
3819 unsigned : 1;
3820 unsigned : 1;
3821 unsigned : 1;
3824 struct
3826 unsigned : 1;
3827 unsigned : 1;
3828 unsigned T3INSYNC : 1;
3829 unsigned : 1;
3830 unsigned : 1;
3831 unsigned : 1;
3832 unsigned : 1;
3833 unsigned : 1;
3836 struct
3838 unsigned : 4;
3839 unsigned T3CKPS : 2;
3840 unsigned : 2;
3842 } __T3CONbits_t;
3844 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
3846 #define _T3CON_TMR3ON 0x01
3847 #define _T3CON_TMR3CS 0x02
3848 #define _T3CON_NOT_T3SYNC 0x04
3849 #define _T3CON_T3SYNC 0x04
3850 #define _T3CON_T3INSYNC 0x04
3851 #define _T3CON_T3CCP1 0x08
3852 #define _T3CON_T3CKPS0 0x10
3853 #define _T3CON_T3CKPS1 0x20
3854 #define _T3CON_T3CCP2 0x40
3855 #define _T3CON_RD16 0x80
3857 //==============================================================================
3859 extern __at(0x0FB2) __sfr TMR3;
3860 extern __at(0x0FB2) __sfr TMR3L;
3861 extern __at(0x0FB3) __sfr TMR3H;
3863 //==============================================================================
3864 // CMCON Bits
3866 extern __at(0x0FB4) __sfr CMCON;
3868 typedef union
3870 struct
3872 unsigned CM0 : 1;
3873 unsigned CM1 : 1;
3874 unsigned CM2 : 1;
3875 unsigned CIS : 1;
3876 unsigned C1INV : 1;
3877 unsigned C2INV : 1;
3878 unsigned C1OUT : 1;
3879 unsigned C2OUT : 1;
3882 struct
3884 unsigned CM : 3;
3885 unsigned : 5;
3887 } __CMCONbits_t;
3889 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
3891 #define _CM0 0x01
3892 #define _CM1 0x02
3893 #define _CM2 0x04
3894 #define _CIS 0x08
3895 #define _C1INV 0x10
3896 #define _C2INV 0x20
3897 #define _C1OUT 0x40
3898 #define _C2OUT 0x80
3900 //==============================================================================
3903 //==============================================================================
3904 // CVRCON Bits
3906 extern __at(0x0FB5) __sfr CVRCON;
3908 typedef union
3910 struct
3912 unsigned CVR0 : 1;
3913 unsigned CVR1 : 1;
3914 unsigned CVR2 : 1;
3915 unsigned CVR3 : 1;
3916 unsigned CVRSS : 1;
3917 unsigned CVRR : 1;
3918 unsigned CVROE : 1;
3919 unsigned CVREN : 1;
3922 struct
3924 unsigned CVR : 4;
3925 unsigned : 4;
3927 } __CVRCONbits_t;
3929 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
3931 #define _CVR0 0x01
3932 #define _CVR1 0x02
3933 #define _CVR2 0x04
3934 #define _CVR3 0x08
3935 #define _CVRSS 0x10
3936 #define _CVRR 0x20
3937 #define _CVROE 0x40
3938 #define _CVREN 0x80
3940 //==============================================================================
3943 //==============================================================================
3944 // LCDSE1 Bits
3946 extern __at(0x0FB6) __sfr LCDSE1;
3948 typedef union
3950 struct
3952 unsigned SE8 : 1;
3953 unsigned SE9 : 1;
3954 unsigned SE10 : 1;
3955 unsigned SE11 : 1;
3956 unsigned SE12 : 1;
3957 unsigned SE13 : 1;
3958 unsigned SE14 : 1;
3959 unsigned SE15 : 1;
3962 struct
3964 unsigned SEGEN8 : 1;
3965 unsigned SEGEN9 : 1;
3966 unsigned SEGEN10 : 1;
3967 unsigned SEGEN11 : 1;
3968 unsigned SEGEN12 : 1;
3969 unsigned SEGEN13 : 1;
3970 unsigned SEGEN14 : 1;
3971 unsigned SEGEN15 : 1;
3974 struct
3976 unsigned SE08 : 1;
3977 unsigned SE09 : 1;
3978 unsigned : 1;
3979 unsigned : 1;
3980 unsigned : 1;
3981 unsigned : 1;
3982 unsigned : 1;
3983 unsigned : 1;
3985 } __LCDSE1bits_t;
3987 extern __at(0x0FB6) volatile __LCDSE1bits_t LCDSE1bits;
3989 #define _SE8 0x01
3990 #define _SEGEN8 0x01
3991 #define _SE08 0x01
3992 #define _SE9 0x02
3993 #define _SEGEN9 0x02
3994 #define _SE09 0x02
3995 #define _SE10 0x04
3996 #define _SEGEN10 0x04
3997 #define _SE11 0x08
3998 #define _SEGEN11 0x08
3999 #define _SE12 0x10
4000 #define _SEGEN12 0x10
4001 #define _SE13 0x20
4002 #define _SEGEN13 0x20
4003 #define _SE14 0x40
4004 #define _SEGEN14 0x40
4005 #define _SE15 0x80
4006 #define _SEGEN15 0x80
4008 //==============================================================================
4011 //==============================================================================
4012 // LCDSE2 Bits
4014 extern __at(0x0FB7) __sfr LCDSE2;
4016 typedef union
4018 struct
4020 unsigned SE16 : 1;
4021 unsigned SE17 : 1;
4022 unsigned SE18 : 1;
4023 unsigned SE19 : 1;
4024 unsigned SE20 : 1;
4025 unsigned SE21 : 1;
4026 unsigned SE22 : 1;
4027 unsigned SE23 : 1;
4030 struct
4032 unsigned SEGEN16 : 1;
4033 unsigned SEGEN17 : 1;
4034 unsigned SEGEN18 : 1;
4035 unsigned SEGEN19 : 1;
4036 unsigned SEGEN20 : 1;
4037 unsigned SEGEN21 : 1;
4038 unsigned SEGEN22 : 1;
4039 unsigned SEGEN23 : 1;
4041 } __LCDSE2bits_t;
4043 extern __at(0x0FB7) volatile __LCDSE2bits_t LCDSE2bits;
4045 #define _SE16 0x01
4046 #define _SEGEN16 0x01
4047 #define _SE17 0x02
4048 #define _SEGEN17 0x02
4049 #define _SE18 0x04
4050 #define _SEGEN18 0x04
4051 #define _SE19 0x08
4052 #define _SEGEN19 0x08
4053 #define _SE20 0x10
4054 #define _SEGEN20 0x10
4055 #define _SE21 0x20
4056 #define _SEGEN21 0x20
4057 #define _SE22 0x40
4058 #define _SEGEN22 0x40
4059 #define _SE23 0x80
4060 #define _SEGEN23 0x80
4062 //==============================================================================
4065 //==============================================================================
4066 // LCDSE3 Bits
4068 extern __at(0x0FB8) __sfr LCDSE3;
4070 typedef union
4072 struct
4074 unsigned SE24 : 1;
4075 unsigned SE25 : 1;
4076 unsigned SE26 : 1;
4077 unsigned SE27 : 1;
4078 unsigned SE28 : 1;
4079 unsigned SE29 : 1;
4080 unsigned SE30 : 1;
4081 unsigned SE31 : 1;
4084 struct
4086 unsigned SEGEN24 : 1;
4087 unsigned SEGEN25 : 1;
4088 unsigned SEGEN26 : 1;
4089 unsigned SEGEN27 : 1;
4090 unsigned SEGEN28 : 1;
4091 unsigned SEGEN29 : 1;
4092 unsigned SEGEN30 : 1;
4093 unsigned SEGEN31 : 1;
4095 } __LCDSE3bits_t;
4097 extern __at(0x0FB8) volatile __LCDSE3bits_t LCDSE3bits;
4099 #define _SE24 0x01
4100 #define _SEGEN24 0x01
4101 #define _SE25 0x02
4102 #define _SEGEN25 0x02
4103 #define _SE26 0x04
4104 #define _SEGEN26 0x04
4105 #define _SE27 0x08
4106 #define _SEGEN27 0x08
4107 #define _SE28 0x10
4108 #define _SEGEN28 0x10
4109 #define _SE29 0x20
4110 #define _SEGEN29 0x20
4111 #define _SE30 0x40
4112 #define _SEGEN30 0x40
4113 #define _SE31 0x80
4114 #define _SEGEN31 0x80
4116 //==============================================================================
4119 //==============================================================================
4120 // LCDSE4 Bits
4122 extern __at(0x0FB9) __sfr LCDSE4;
4124 typedef union
4126 struct
4128 unsigned SE32 : 1;
4129 unsigned : 1;
4130 unsigned : 1;
4131 unsigned : 1;
4132 unsigned : 1;
4133 unsigned : 1;
4134 unsigned : 1;
4135 unsigned : 1;
4138 struct
4140 unsigned SEGEN32 : 1;
4141 unsigned : 1;
4142 unsigned : 1;
4143 unsigned : 1;
4144 unsigned : 1;
4145 unsigned : 1;
4146 unsigned : 1;
4147 unsigned : 1;
4149 } __LCDSE4bits_t;
4151 extern __at(0x0FB9) volatile __LCDSE4bits_t LCDSE4bits;
4153 #define _SE32 0x01
4154 #define _SEGEN32 0x01
4156 //==============================================================================
4159 //==============================================================================
4160 // LCDDATA0 Bits
4162 extern __at(0x0FBB) __sfr LCDDATA0;
4164 typedef union
4166 struct
4168 unsigned S0C0 : 1;
4169 unsigned S1C0 : 1;
4170 unsigned S2C0 : 1;
4171 unsigned S3C0 : 1;
4172 unsigned S4C0 : 1;
4173 unsigned S5C0 : 1;
4174 unsigned S6C0 : 1;
4175 unsigned S7C0 : 1;
4178 struct
4180 unsigned SEG0COM0 : 1;
4181 unsigned SEG1COM0 : 1;
4182 unsigned SEG2COM0 : 1;
4183 unsigned SEG3COM0 : 1;
4184 unsigned SEG4COM0 : 1;
4185 unsigned SEG5COM0 : 1;
4186 unsigned SEG6COM0 : 1;
4187 unsigned SEG7COM0 : 1;
4190 struct
4192 unsigned S00C0 : 1;
4193 unsigned S01C0 : 1;
4194 unsigned S02C0 : 1;
4195 unsigned S03C0 : 1;
4196 unsigned S04C0 : 1;
4197 unsigned S05C0 : 1;
4198 unsigned S06C0 : 1;
4199 unsigned S07C0 : 1;
4201 } __LCDDATA0bits_t;
4203 extern __at(0x0FBB) volatile __LCDDATA0bits_t LCDDATA0bits;
4205 #define _S0C0 0x01
4206 #define _SEG0COM0 0x01
4207 #define _S00C0 0x01
4208 #define _S1C0 0x02
4209 #define _SEG1COM0 0x02
4210 #define _S01C0 0x02
4211 #define _S2C0 0x04
4212 #define _SEG2COM0 0x04
4213 #define _S02C0 0x04
4214 #define _S3C0 0x08
4215 #define _SEG3COM0 0x08
4216 #define _S03C0 0x08
4217 #define _S4C0 0x10
4218 #define _SEG4COM0 0x10
4219 #define _S04C0 0x10
4220 #define _S5C0 0x20
4221 #define _SEG5COM0 0x20
4222 #define _S05C0 0x20
4223 #define _S6C0 0x40
4224 #define _SEG6COM0 0x40
4225 #define _S06C0 0x40
4226 #define _S7C0 0x80
4227 #define _SEG7COM0 0x80
4228 #define _S07C0 0x80
4230 //==============================================================================
4233 //==============================================================================
4234 // LCDDATA1 Bits
4236 extern __at(0x0FBC) __sfr LCDDATA1;
4238 typedef union
4240 struct
4242 unsigned S8C0 : 1;
4243 unsigned S9C0 : 1;
4244 unsigned S10C0 : 1;
4245 unsigned S11C0 : 1;
4246 unsigned S12C0 : 1;
4247 unsigned S13C0 : 1;
4248 unsigned S14C0 : 1;
4249 unsigned S15C0 : 1;
4252 struct
4254 unsigned SEG8COM0 : 1;
4255 unsigned SEG9COM0 : 1;
4256 unsigned SEG10COM0 : 1;
4257 unsigned SEG11COM0 : 1;
4258 unsigned SEG12COM0 : 1;
4259 unsigned SEG13COM0 : 1;
4260 unsigned SEG14COM0 : 1;
4261 unsigned SEG15COM0 : 1;
4264 struct
4266 unsigned S08C0 : 1;
4267 unsigned S09C0 : 1;
4268 unsigned : 1;
4269 unsigned : 1;
4270 unsigned : 1;
4271 unsigned : 1;
4272 unsigned : 1;
4273 unsigned : 1;
4275 } __LCDDATA1bits_t;
4277 extern __at(0x0FBC) volatile __LCDDATA1bits_t LCDDATA1bits;
4279 #define _S8C0 0x01
4280 #define _SEG8COM0 0x01
4281 #define _S08C0 0x01
4282 #define _S9C0 0x02
4283 #define _SEG9COM0 0x02
4284 #define _S09C0 0x02
4285 #define _S10C0 0x04
4286 #define _SEG10COM0 0x04
4287 #define _S11C0 0x08
4288 #define _SEG11COM0 0x08
4289 #define _S12C0 0x10
4290 #define _SEG12COM0 0x10
4291 #define _S13C0 0x20
4292 #define _SEG13COM0 0x20
4293 #define _S14C0 0x40
4294 #define _SEG14COM0 0x40
4295 #define _S15C0 0x80
4296 #define _SEG15COM0 0x80
4298 //==============================================================================
4301 //==============================================================================
4302 // LCDDATA2 Bits
4304 extern __at(0x0FBD) __sfr LCDDATA2;
4306 typedef union
4308 struct
4310 unsigned S16C0 : 1;
4311 unsigned S17C0 : 1;
4312 unsigned S18C0 : 1;
4313 unsigned S19C0 : 1;
4314 unsigned S20C0 : 1;
4315 unsigned S21C0 : 1;
4316 unsigned S22C0 : 1;
4317 unsigned S23C0 : 1;
4320 struct
4322 unsigned SEG16COM0 : 1;
4323 unsigned SEG17COM0 : 1;
4324 unsigned SEG18COM0 : 1;
4325 unsigned SEG19COM0 : 1;
4326 unsigned SEG20COM0 : 1;
4327 unsigned SEG21COM0 : 1;
4328 unsigned SEG22COM0 : 1;
4329 unsigned SEG23COM0 : 1;
4331 } __LCDDATA2bits_t;
4333 extern __at(0x0FBD) volatile __LCDDATA2bits_t LCDDATA2bits;
4335 #define _S16C0 0x01
4336 #define _SEG16COM0 0x01
4337 #define _S17C0 0x02
4338 #define _SEG17COM0 0x02
4339 #define _S18C0 0x04
4340 #define _SEG18COM0 0x04
4341 #define _S19C0 0x08
4342 #define _SEG19COM0 0x08
4343 #define _S20C0 0x10
4344 #define _SEG20COM0 0x10
4345 #define _S21C0 0x20
4346 #define _SEG21COM0 0x20
4347 #define _S22C0 0x40
4348 #define _SEG22COM0 0x40
4349 #define _S23C0 0x80
4350 #define _SEG23COM0 0x80
4352 //==============================================================================
4355 //==============================================================================
4356 // LCDDATA3 Bits
4358 extern __at(0x0FBE) __sfr LCDDATA3;
4360 typedef union
4362 struct
4364 unsigned S24C0 : 1;
4365 unsigned S25C0 : 1;
4366 unsigned S26C0 : 1;
4367 unsigned S27C0 : 1;
4368 unsigned S28C0 : 1;
4369 unsigned S29C0 : 1;
4370 unsigned S30C0 : 1;
4371 unsigned S31C0 : 1;
4374 struct
4376 unsigned SEG24COM0 : 1;
4377 unsigned SEG25COM0 : 1;
4378 unsigned SEG26COM0 : 1;
4379 unsigned SEG27COM0 : 1;
4380 unsigned SEG28COM0 : 1;
4381 unsigned SEG29COM0 : 1;
4382 unsigned SEG30COM0 : 1;
4383 unsigned SEG31COM0 : 1;
4385 } __LCDDATA3bits_t;
4387 extern __at(0x0FBE) volatile __LCDDATA3bits_t LCDDATA3bits;
4389 #define _S24C0 0x01
4390 #define _SEG24COM0 0x01
4391 #define _S25C0 0x02
4392 #define _SEG25COM0 0x02
4393 #define _S26C0 0x04
4394 #define _SEG26COM0 0x04
4395 #define _S27C0 0x08
4396 #define _SEG27COM0 0x08
4397 #define _S28C0 0x10
4398 #define _SEG28COM0 0x10
4399 #define _S29C0 0x20
4400 #define _SEG29COM0 0x20
4401 #define _S30C0 0x40
4402 #define _SEG30COM0 0x40
4403 #define _S31C0 0x80
4404 #define _SEG31COM0 0x80
4406 //==============================================================================
4409 //==============================================================================
4410 // LCDDATA4 Bits
4412 extern __at(0x0FBF) __sfr LCDDATA4;
4414 typedef union
4416 struct
4418 unsigned S32C0 : 1;
4419 unsigned : 1;
4420 unsigned : 1;
4421 unsigned : 1;
4422 unsigned : 1;
4423 unsigned : 1;
4424 unsigned : 1;
4425 unsigned : 1;
4428 struct
4430 unsigned SEG32COM0 : 1;
4431 unsigned : 1;
4432 unsigned : 1;
4433 unsigned : 1;
4434 unsigned : 1;
4435 unsigned : 1;
4436 unsigned : 1;
4437 unsigned : 1;
4439 } __LCDDATA4bits_t;
4441 extern __at(0x0FBF) volatile __LCDDATA4bits_t LCDDATA4bits;
4443 #define _S32C0 0x01
4444 #define _SEG32COM0 0x01
4446 //==============================================================================
4449 //==============================================================================
4450 // ADCON2 Bits
4452 extern __at(0x0FC0) __sfr ADCON2;
4454 typedef union
4456 struct
4458 unsigned ADCS0 : 1;
4459 unsigned ADCS1 : 1;
4460 unsigned ADCS2 : 1;
4461 unsigned ACQT0 : 1;
4462 unsigned ACQT1 : 1;
4463 unsigned ACQT2 : 1;
4464 unsigned : 1;
4465 unsigned ADFM : 1;
4468 struct
4470 unsigned ADCS : 3;
4471 unsigned : 5;
4474 struct
4476 unsigned : 3;
4477 unsigned ACQT : 3;
4478 unsigned : 2;
4480 } __ADCON2bits_t;
4482 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4484 #define _ADCS0 0x01
4485 #define _ADCS1 0x02
4486 #define _ADCS2 0x04
4487 #define _ACQT0 0x08
4488 #define _ACQT1 0x10
4489 #define _ACQT2 0x20
4490 #define _ADFM 0x80
4492 //==============================================================================
4495 //==============================================================================
4496 // ADCON1 Bits
4498 extern __at(0x0FC1) __sfr ADCON1;
4500 typedef union
4502 struct
4504 unsigned PCFG0 : 1;
4505 unsigned PCFG1 : 1;
4506 unsigned PCFG2 : 1;
4507 unsigned PCFG3 : 1;
4508 unsigned VCFG0 : 1;
4509 unsigned VCFG1 : 1;
4510 unsigned : 1;
4511 unsigned : 1;
4514 struct
4516 unsigned PCFG : 4;
4517 unsigned : 4;
4520 struct
4522 unsigned : 4;
4523 unsigned VCFG : 2;
4524 unsigned : 2;
4526 } __ADCON1bits_t;
4528 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4530 #define _PCFG0 0x01
4531 #define _PCFG1 0x02
4532 #define _PCFG2 0x04
4533 #define _PCFG3 0x08
4534 #define _VCFG0 0x10
4535 #define _VCFG1 0x20
4537 //==============================================================================
4540 //==============================================================================
4541 // ADCON0 Bits
4543 extern __at(0x0FC2) __sfr ADCON0;
4545 typedef union
4547 struct
4549 unsigned ADON : 1;
4550 unsigned GO_NOT_DONE : 1;
4551 unsigned CHS0 : 1;
4552 unsigned CHS1 : 1;
4553 unsigned CHS2 : 1;
4554 unsigned CHS3 : 1;
4555 unsigned : 1;
4556 unsigned ADCAL : 1;
4559 struct
4561 unsigned : 1;
4562 unsigned GO_DONE : 1;
4563 unsigned : 1;
4564 unsigned : 1;
4565 unsigned : 1;
4566 unsigned : 1;
4567 unsigned : 1;
4568 unsigned : 1;
4571 struct
4573 unsigned : 1;
4574 unsigned DONE : 1;
4575 unsigned : 1;
4576 unsigned : 1;
4577 unsigned : 1;
4578 unsigned : 1;
4579 unsigned : 1;
4580 unsigned : 1;
4583 struct
4585 unsigned : 1;
4586 unsigned GO : 1;
4587 unsigned : 1;
4588 unsigned : 1;
4589 unsigned : 1;
4590 unsigned : 1;
4591 unsigned : 1;
4592 unsigned : 1;
4595 struct
4597 unsigned : 1;
4598 unsigned NOT_DONE : 1;
4599 unsigned : 1;
4600 unsigned : 1;
4601 unsigned : 1;
4602 unsigned : 1;
4603 unsigned : 1;
4604 unsigned : 1;
4607 struct
4609 unsigned : 2;
4610 unsigned CHS : 4;
4611 unsigned : 2;
4613 } __ADCON0bits_t;
4615 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4617 #define _ADON 0x01
4618 #define _GO_NOT_DONE 0x02
4619 #define _GO_DONE 0x02
4620 #define _DONE 0x02
4621 #define _GO 0x02
4622 #define _NOT_DONE 0x02
4623 #define _CHS0 0x04
4624 #define _CHS1 0x08
4625 #define _CHS2 0x10
4626 #define _CHS3 0x20
4627 #define _ADCAL 0x80
4629 //==============================================================================
4631 extern __at(0x0FC3) __sfr ADRES;
4632 extern __at(0x0FC3) __sfr ADRESL;
4633 extern __at(0x0FC4) __sfr ADRESH;
4635 //==============================================================================
4636 // SSP1CON2 Bits
4638 extern __at(0x0FC5) __sfr SSP1CON2;
4640 typedef union
4642 struct
4644 unsigned SEN : 1;
4645 unsigned RSEN : 1;
4646 unsigned PEN : 1;
4647 unsigned RCEN : 1;
4648 unsigned ACKEN : 1;
4649 unsigned ACKDT : 1;
4650 unsigned ACKSTAT : 1;
4651 unsigned GCEN : 1;
4654 struct
4656 unsigned : 1;
4657 unsigned ADMSK1 : 1;
4658 unsigned ADMSK2 : 1;
4659 unsigned ADMSK3 : 1;
4660 unsigned ADMSK4 : 1;
4661 unsigned ADMSK5 : 1;
4662 unsigned : 1;
4663 unsigned : 1;
4665 } __SSP1CON2bits_t;
4667 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4669 #define _SEN 0x01
4670 #define _RSEN 0x02
4671 #define _ADMSK1 0x02
4672 #define _PEN 0x04
4673 #define _ADMSK2 0x04
4674 #define _RCEN 0x08
4675 #define _ADMSK3 0x08
4676 #define _ACKEN 0x10
4677 #define _ADMSK4 0x10
4678 #define _ACKDT 0x20
4679 #define _ADMSK5 0x20
4680 #define _ACKSTAT 0x40
4681 #define _GCEN 0x80
4683 //==============================================================================
4686 //==============================================================================
4687 // SSPCON2 Bits
4689 extern __at(0x0FC5) __sfr SSPCON2;
4691 typedef union
4693 struct
4695 unsigned SEN : 1;
4696 unsigned RSEN : 1;
4697 unsigned PEN : 1;
4698 unsigned RCEN : 1;
4699 unsigned ACKEN : 1;
4700 unsigned ACKDT : 1;
4701 unsigned ACKSTAT : 1;
4702 unsigned GCEN : 1;
4705 struct
4707 unsigned : 1;
4708 unsigned ADMSK1 : 1;
4709 unsigned ADMSK2 : 1;
4710 unsigned ADMSK3 : 1;
4711 unsigned ADMSK4 : 1;
4712 unsigned ADMSK5 : 1;
4713 unsigned : 1;
4714 unsigned : 1;
4716 } __SSPCON2bits_t;
4718 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4720 #define _SSPCON2_SEN 0x01
4721 #define _SSPCON2_RSEN 0x02
4722 #define _SSPCON2_ADMSK1 0x02
4723 #define _SSPCON2_PEN 0x04
4724 #define _SSPCON2_ADMSK2 0x04
4725 #define _SSPCON2_RCEN 0x08
4726 #define _SSPCON2_ADMSK3 0x08
4727 #define _SSPCON2_ACKEN 0x10
4728 #define _SSPCON2_ADMSK4 0x10
4729 #define _SSPCON2_ACKDT 0x20
4730 #define _SSPCON2_ADMSK5 0x20
4731 #define _SSPCON2_ACKSTAT 0x40
4732 #define _SSPCON2_GCEN 0x80
4734 //==============================================================================
4737 //==============================================================================
4738 // SSP1CON1 Bits
4740 extern __at(0x0FC6) __sfr SSP1CON1;
4742 typedef union
4744 struct
4746 unsigned SSPM0 : 1;
4747 unsigned SSPM1 : 1;
4748 unsigned SSPM2 : 1;
4749 unsigned SSPM3 : 1;
4750 unsigned CKP : 1;
4751 unsigned SSPEN : 1;
4752 unsigned SSPOV : 1;
4753 unsigned WCOL : 1;
4756 struct
4758 unsigned SSPM : 4;
4759 unsigned : 4;
4761 } __SSP1CON1bits_t;
4763 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4765 #define _SSPM0 0x01
4766 #define _SSPM1 0x02
4767 #define _SSPM2 0x04
4768 #define _SSPM3 0x08
4769 #define _CKP 0x10
4770 #define _SSPEN 0x20
4771 #define _SSPOV 0x40
4772 #define _WCOL 0x80
4774 //==============================================================================
4777 //==============================================================================
4778 // SSPCON1 Bits
4780 extern __at(0x0FC6) __sfr SSPCON1;
4782 typedef union
4784 struct
4786 unsigned SSPM0 : 1;
4787 unsigned SSPM1 : 1;
4788 unsigned SSPM2 : 1;
4789 unsigned SSPM3 : 1;
4790 unsigned CKP : 1;
4791 unsigned SSPEN : 1;
4792 unsigned SSPOV : 1;
4793 unsigned WCOL : 1;
4796 struct
4798 unsigned SSPM : 4;
4799 unsigned : 4;
4801 } __SSPCON1bits_t;
4803 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4805 #define _SSPCON1_SSPM0 0x01
4806 #define _SSPCON1_SSPM1 0x02
4807 #define _SSPCON1_SSPM2 0x04
4808 #define _SSPCON1_SSPM3 0x08
4809 #define _SSPCON1_CKP 0x10
4810 #define _SSPCON1_SSPEN 0x20
4811 #define _SSPCON1_SSPOV 0x40
4812 #define _SSPCON1_WCOL 0x80
4814 //==============================================================================
4817 //==============================================================================
4818 // SSP1STAT Bits
4820 extern __at(0x0FC7) __sfr SSP1STAT;
4822 typedef union
4824 struct
4826 unsigned BF : 1;
4827 unsigned UA : 1;
4828 unsigned R_NOT_W : 1;
4829 unsigned S : 1;
4830 unsigned P : 1;
4831 unsigned D_NOT_A : 1;
4832 unsigned CKE : 1;
4833 unsigned SMP : 1;
4836 struct
4838 unsigned : 1;
4839 unsigned : 1;
4840 unsigned R : 1;
4841 unsigned I2C_START : 1;
4842 unsigned I2C_STOP : 1;
4843 unsigned D : 1;
4844 unsigned : 1;
4845 unsigned : 1;
4848 struct
4850 unsigned : 1;
4851 unsigned : 1;
4852 unsigned R_W : 1;
4853 unsigned : 1;
4854 unsigned : 1;
4855 unsigned D_A : 1;
4856 unsigned : 1;
4857 unsigned : 1;
4860 struct
4862 unsigned : 1;
4863 unsigned : 1;
4864 unsigned NOT_W : 1;
4865 unsigned : 1;
4866 unsigned : 1;
4867 unsigned NOT_A : 1;
4868 unsigned : 1;
4869 unsigned : 1;
4872 struct
4874 unsigned : 1;
4875 unsigned : 1;
4876 unsigned NOT_WRITE : 1;
4877 unsigned : 1;
4878 unsigned : 1;
4879 unsigned NOT_ADDRESS : 1;
4880 unsigned : 1;
4881 unsigned : 1;
4884 struct
4886 unsigned : 1;
4887 unsigned : 1;
4888 unsigned READ_WRITE : 1;
4889 unsigned : 1;
4890 unsigned : 1;
4891 unsigned DATA_ADDRESS : 1;
4892 unsigned : 1;
4893 unsigned : 1;
4896 struct
4898 unsigned : 1;
4899 unsigned : 1;
4900 unsigned I2C_READ : 1;
4901 unsigned : 1;
4902 unsigned : 1;
4903 unsigned I2C_DAT : 1;
4904 unsigned : 1;
4905 unsigned : 1;
4907 } __SSP1STATbits_t;
4909 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4911 #define _BF 0x01
4912 #define _UA 0x02
4913 #define _R_NOT_W 0x04
4914 #define _R 0x04
4915 #define _R_W 0x04
4916 #define _NOT_W 0x04
4917 #define _NOT_WRITE 0x04
4918 #define _READ_WRITE 0x04
4919 #define _I2C_READ 0x04
4920 #define _S 0x08
4921 #define _I2C_START 0x08
4922 #define _P 0x10
4923 #define _I2C_STOP 0x10
4924 #define _D_NOT_A 0x20
4925 #define _D 0x20
4926 #define _D_A 0x20
4927 #define _NOT_A 0x20
4928 #define _NOT_ADDRESS 0x20
4929 #define _DATA_ADDRESS 0x20
4930 #define _I2C_DAT 0x20
4931 #define _CKE 0x40
4932 #define _SMP 0x80
4934 //==============================================================================
4937 //==============================================================================
4938 // SSPSTAT Bits
4940 extern __at(0x0FC7) __sfr SSPSTAT;
4942 typedef union
4944 struct
4946 unsigned BF : 1;
4947 unsigned UA : 1;
4948 unsigned R_NOT_W : 1;
4949 unsigned S : 1;
4950 unsigned P : 1;
4951 unsigned D_NOT_A : 1;
4952 unsigned CKE : 1;
4953 unsigned SMP : 1;
4956 struct
4958 unsigned : 1;
4959 unsigned : 1;
4960 unsigned R : 1;
4961 unsigned I2C_START : 1;
4962 unsigned I2C_STOP : 1;
4963 unsigned D : 1;
4964 unsigned : 1;
4965 unsigned : 1;
4968 struct
4970 unsigned : 1;
4971 unsigned : 1;
4972 unsigned R_W : 1;
4973 unsigned : 1;
4974 unsigned : 1;
4975 unsigned D_A : 1;
4976 unsigned : 1;
4977 unsigned : 1;
4980 struct
4982 unsigned : 1;
4983 unsigned : 1;
4984 unsigned NOT_W : 1;
4985 unsigned : 1;
4986 unsigned : 1;
4987 unsigned NOT_A : 1;
4988 unsigned : 1;
4989 unsigned : 1;
4992 struct
4994 unsigned : 1;
4995 unsigned : 1;
4996 unsigned NOT_WRITE : 1;
4997 unsigned : 1;
4998 unsigned : 1;
4999 unsigned NOT_ADDRESS : 1;
5000 unsigned : 1;
5001 unsigned : 1;
5004 struct
5006 unsigned : 1;
5007 unsigned : 1;
5008 unsigned READ_WRITE : 1;
5009 unsigned : 1;
5010 unsigned : 1;
5011 unsigned DATA_ADDRESS : 1;
5012 unsigned : 1;
5013 unsigned : 1;
5016 struct
5018 unsigned : 1;
5019 unsigned : 1;
5020 unsigned I2C_READ : 1;
5021 unsigned : 1;
5022 unsigned : 1;
5023 unsigned I2C_DAT : 1;
5024 unsigned : 1;
5025 unsigned : 1;
5027 } __SSPSTATbits_t;
5029 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5031 #define _SSPSTAT_BF 0x01
5032 #define _SSPSTAT_UA 0x02
5033 #define _SSPSTAT_R_NOT_W 0x04
5034 #define _SSPSTAT_R 0x04
5035 #define _SSPSTAT_R_W 0x04
5036 #define _SSPSTAT_NOT_W 0x04
5037 #define _SSPSTAT_NOT_WRITE 0x04
5038 #define _SSPSTAT_READ_WRITE 0x04
5039 #define _SSPSTAT_I2C_READ 0x04
5040 #define _SSPSTAT_S 0x08
5041 #define _SSPSTAT_I2C_START 0x08
5042 #define _SSPSTAT_P 0x10
5043 #define _SSPSTAT_I2C_STOP 0x10
5044 #define _SSPSTAT_D_NOT_A 0x20
5045 #define _SSPSTAT_D 0x20
5046 #define _SSPSTAT_D_A 0x20
5047 #define _SSPSTAT_NOT_A 0x20
5048 #define _SSPSTAT_NOT_ADDRESS 0x20
5049 #define _SSPSTAT_DATA_ADDRESS 0x20
5050 #define _SSPSTAT_I2C_DAT 0x20
5051 #define _SSPSTAT_CKE 0x40
5052 #define _SSPSTAT_SMP 0x80
5054 //==============================================================================
5056 extern __at(0x0FC8) __sfr SSP1ADD;
5057 extern __at(0x0FC8) __sfr SSPADD;
5058 extern __at(0x0FC9) __sfr SSP1BUF;
5059 extern __at(0x0FC9) __sfr SSPBUF;
5061 //==============================================================================
5062 // T2CON Bits
5064 extern __at(0x0FCA) __sfr T2CON;
5066 typedef union
5068 struct
5070 unsigned T2CKPS0 : 1;
5071 unsigned T2CKPS1 : 1;
5072 unsigned TMR2ON : 1;
5073 unsigned T2OUTPS0 : 1;
5074 unsigned T2OUTPS1 : 1;
5075 unsigned T2OUTPS2 : 1;
5076 unsigned T2OUTPS3 : 1;
5077 unsigned : 1;
5080 struct
5082 unsigned T2CKPS : 2;
5083 unsigned : 6;
5086 struct
5088 unsigned : 3;
5089 unsigned T2OUTPS : 4;
5090 unsigned : 1;
5092 } __T2CONbits_t;
5094 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5096 #define _T2CKPS0 0x01
5097 #define _T2CKPS1 0x02
5098 #define _TMR2ON 0x04
5099 #define _T2OUTPS0 0x08
5100 #define _T2OUTPS1 0x10
5101 #define _T2OUTPS2 0x20
5102 #define _T2OUTPS3 0x40
5104 //==============================================================================
5106 extern __at(0x0FCB) __sfr PR2;
5107 extern __at(0x0FCC) __sfr TMR2;
5109 //==============================================================================
5110 // T1CON Bits
5112 extern __at(0x0FCD) __sfr T1CON;
5114 typedef union
5116 struct
5118 unsigned TMR1ON : 1;
5119 unsigned TMR1CS : 1;
5120 unsigned NOT_T1SYNC : 1;
5121 unsigned T1OSCEN : 1;
5122 unsigned T1CKPS0 : 1;
5123 unsigned T1CKPS1 : 1;
5124 unsigned T1RUN : 1;
5125 unsigned RD16 : 1;
5128 struct
5130 unsigned : 1;
5131 unsigned : 1;
5132 unsigned T1INSYNC : 1;
5133 unsigned : 1;
5134 unsigned : 1;
5135 unsigned : 1;
5136 unsigned : 1;
5137 unsigned : 1;
5140 struct
5142 unsigned : 1;
5143 unsigned : 1;
5144 unsigned T1SYNC : 1;
5145 unsigned : 1;
5146 unsigned : 1;
5147 unsigned : 1;
5148 unsigned : 1;
5149 unsigned : 1;
5152 struct
5154 unsigned : 4;
5155 unsigned T1CKPS : 2;
5156 unsigned : 2;
5158 } __T1CONbits_t;
5160 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5162 #define _TMR1ON 0x01
5163 #define _TMR1CS 0x02
5164 #define _NOT_T1SYNC 0x04
5165 #define _T1INSYNC 0x04
5166 #define _T1SYNC 0x04
5167 #define _T1OSCEN 0x08
5168 #define _T1CKPS0 0x10
5169 #define _T1CKPS1 0x20
5170 #define _T1RUN 0x40
5171 #define _RD16 0x80
5173 //==============================================================================
5175 extern __at(0x0FCE) __sfr TMR1;
5176 extern __at(0x0FCE) __sfr TMR1L;
5177 extern __at(0x0FCF) __sfr TMR1H;
5179 //==============================================================================
5180 // RCON Bits
5182 extern __at(0x0FD0) __sfr RCON;
5184 typedef union
5186 struct
5188 unsigned NOT_BOR : 1;
5189 unsigned NOT_POR : 1;
5190 unsigned NOT_PD : 1;
5191 unsigned NOT_TO : 1;
5192 unsigned NOT_RI : 1;
5193 unsigned NOT_CM : 1;
5194 unsigned : 1;
5195 unsigned IPEN : 1;
5198 struct
5200 unsigned BOR : 1;
5201 unsigned POR : 1;
5202 unsigned PD : 1;
5203 unsigned TO : 1;
5204 unsigned RI : 1;
5205 unsigned CM : 1;
5206 unsigned : 1;
5207 unsigned : 1;
5209 } __RCONbits_t;
5211 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5213 #define _NOT_BOR 0x01
5214 #define _BOR 0x01
5215 #define _NOT_POR 0x02
5216 #define _POR 0x02
5217 #define _NOT_PD 0x04
5218 #define _PD 0x04
5219 #define _NOT_TO 0x08
5220 #define _TO 0x08
5221 #define _NOT_RI 0x10
5222 #define _RI 0x10
5223 #define _NOT_CM 0x20
5224 #define _CM 0x20
5225 #define _IPEN 0x80
5227 //==============================================================================
5230 //==============================================================================
5231 // WDTCON Bits
5233 extern __at(0x0FD1) __sfr WDTCON;
5235 typedef union
5237 struct
5239 unsigned SWDTEN : 1;
5240 unsigned : 1;
5241 unsigned : 1;
5242 unsigned : 1;
5243 unsigned : 1;
5244 unsigned : 1;
5245 unsigned : 1;
5246 unsigned REGSLP : 1;
5249 struct
5251 unsigned SWDTE : 1;
5252 unsigned : 1;
5253 unsigned : 1;
5254 unsigned : 1;
5255 unsigned : 1;
5256 unsigned : 1;
5257 unsigned : 1;
5258 unsigned : 1;
5260 } __WDTCONbits_t;
5262 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5264 #define _SWDTEN 0x01
5265 #define _SWDTE 0x01
5266 #define _REGSLP 0x80
5268 //==============================================================================
5271 //==============================================================================
5272 // LCDREG Bits
5274 extern __at(0x0FD2) __sfr LCDREG;
5276 typedef union
5278 struct
5280 unsigned CKSEL0 : 1;
5281 unsigned CKSEL1 : 1;
5282 unsigned MODE13 : 1;
5283 unsigned BIAS0 : 1;
5284 unsigned BIAS1 : 1;
5285 unsigned BIAS2 : 1;
5286 unsigned CPEN : 1;
5287 unsigned : 1;
5290 struct
5292 unsigned CKSEL : 2;
5293 unsigned : 6;
5296 struct
5298 unsigned : 3;
5299 unsigned BIAS : 3;
5300 unsigned : 2;
5302 } __LCDREGbits_t;
5304 extern __at(0x0FD2) volatile __LCDREGbits_t LCDREGbits;
5306 #define _CKSEL0 0x01
5307 #define _CKSEL1 0x02
5308 #define _MODE13 0x04
5309 #define _BIAS0 0x08
5310 #define _BIAS1 0x10
5311 #define _BIAS2 0x20
5312 #define _CPEN 0x40
5314 //==============================================================================
5317 //==============================================================================
5318 // OSCCON Bits
5320 extern __at(0x0FD3) __sfr OSCCON;
5322 typedef union
5324 struct
5326 unsigned SCS0 : 1;
5327 unsigned SCS1 : 1;
5328 unsigned IOFS : 1;
5329 unsigned OSTS : 1;
5330 unsigned IRCF0 : 1;
5331 unsigned IRCF1 : 1;
5332 unsigned IRCF2 : 1;
5333 unsigned IDLEN : 1;
5336 struct
5338 unsigned SCS : 2;
5339 unsigned : 6;
5342 struct
5344 unsigned : 4;
5345 unsigned IRCF : 3;
5346 unsigned : 1;
5348 } __OSCCONbits_t;
5350 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5352 #define _SCS0 0x01
5353 #define _SCS1 0x02
5354 #define _IOFS 0x04
5355 #define _OSTS 0x08
5356 #define _IRCF0 0x10
5357 #define _IRCF1 0x20
5358 #define _IRCF2 0x40
5359 #define _IDLEN 0x80
5361 //==============================================================================
5364 //==============================================================================
5365 // T0CON Bits
5367 extern __at(0x0FD5) __sfr T0CON;
5369 typedef union
5371 struct
5373 unsigned T0PS0 : 1;
5374 unsigned T0PS1 : 1;
5375 unsigned T0PS2 : 1;
5376 unsigned PSA : 1;
5377 unsigned T0SE : 1;
5378 unsigned T0CS : 1;
5379 unsigned T08BIT : 1;
5380 unsigned TMR0ON : 1;
5383 struct
5385 unsigned : 1;
5386 unsigned : 1;
5387 unsigned : 1;
5388 unsigned T0PS3 : 1;
5389 unsigned : 1;
5390 unsigned : 1;
5391 unsigned : 1;
5392 unsigned : 1;
5395 struct
5397 unsigned T0PS : 4;
5398 unsigned : 4;
5400 } __T0CONbits_t;
5402 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5404 #define _T0PS0 0x01
5405 #define _T0PS1 0x02
5406 #define _T0PS2 0x04
5407 #define _PSA 0x08
5408 #define _T0PS3 0x08
5409 #define _T0SE 0x10
5410 #define _T0CS 0x20
5411 #define _T08BIT 0x40
5412 #define _TMR0ON 0x80
5414 //==============================================================================
5416 extern __at(0x0FD6) __sfr TMR0;
5417 extern __at(0x0FD6) __sfr TMR0L;
5418 extern __at(0x0FD7) __sfr TMR0H;
5420 //==============================================================================
5421 // STATUS Bits
5423 extern __at(0x0FD8) __sfr STATUS;
5425 typedef struct
5427 unsigned C : 1;
5428 unsigned DC : 1;
5429 unsigned Z : 1;
5430 unsigned OV : 1;
5431 unsigned N : 1;
5432 unsigned : 1;
5433 unsigned : 1;
5434 unsigned : 1;
5435 } __STATUSbits_t;
5437 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5439 #define _C 0x01
5440 #define _DC 0x02
5441 #define _Z 0x04
5442 #define _OV 0x08
5443 #define _N 0x10
5445 //==============================================================================
5447 extern __at(0x0FD9) __sfr FSR2L;
5448 extern __at(0x0FDA) __sfr FSR2H;
5449 extern __at(0x0FDB) __sfr PLUSW2;
5450 extern __at(0x0FDC) __sfr PREINC2;
5451 extern __at(0x0FDD) __sfr POSTDEC2;
5452 extern __at(0x0FDE) __sfr POSTINC2;
5453 extern __at(0x0FDF) __sfr INDF2;
5454 extern __at(0x0FE0) __sfr BSR;
5455 extern __at(0x0FE1) __sfr FSR1L;
5456 extern __at(0x0FE2) __sfr FSR1H;
5457 extern __at(0x0FE3) __sfr PLUSW1;
5458 extern __at(0x0FE4) __sfr PREINC1;
5459 extern __at(0x0FE5) __sfr POSTDEC1;
5460 extern __at(0x0FE6) __sfr POSTINC1;
5461 extern __at(0x0FE7) __sfr INDF1;
5462 extern __at(0x0FE8) __sfr WREG;
5463 extern __at(0x0FE9) __sfr FSR0L;
5464 extern __at(0x0FEA) __sfr FSR0H;
5465 extern __at(0x0FEB) __sfr PLUSW0;
5466 extern __at(0x0FEC) __sfr PREINC0;
5467 extern __at(0x0FED) __sfr POSTDEC0;
5468 extern __at(0x0FEE) __sfr POSTINC0;
5469 extern __at(0x0FEF) __sfr INDF0;
5471 //==============================================================================
5472 // INTCON3 Bits
5474 extern __at(0x0FF0) __sfr INTCON3;
5476 typedef union
5478 struct
5480 unsigned INT1IF : 1;
5481 unsigned INT2IF : 1;
5482 unsigned INT3IF : 1;
5483 unsigned INT1IE : 1;
5484 unsigned INT2IE : 1;
5485 unsigned INT3IE : 1;
5486 unsigned INT1IP : 1;
5487 unsigned INT2IP : 1;
5490 struct
5492 unsigned INT1F : 1;
5493 unsigned INT2F : 1;
5494 unsigned INT3F : 1;
5495 unsigned INT1E : 1;
5496 unsigned INT2E : 1;
5497 unsigned INT3E : 1;
5498 unsigned INT1P : 1;
5499 unsigned INT2P : 1;
5501 } __INTCON3bits_t;
5503 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5505 #define _INT1IF 0x01
5506 #define _INT1F 0x01
5507 #define _INT2IF 0x02
5508 #define _INT2F 0x02
5509 #define _INT3IF 0x04
5510 #define _INT3F 0x04
5511 #define _INT1IE 0x08
5512 #define _INT1E 0x08
5513 #define _INT2IE 0x10
5514 #define _INT2E 0x10
5515 #define _INT3IE 0x20
5516 #define _INT3E 0x20
5517 #define _INT1IP 0x40
5518 #define _INT1P 0x40
5519 #define _INT2IP 0x80
5520 #define _INT2P 0x80
5522 //==============================================================================
5525 //==============================================================================
5526 // INTCON2 Bits
5528 extern __at(0x0FF1) __sfr INTCON2;
5530 typedef union
5532 struct
5534 unsigned RBIP : 1;
5535 unsigned INT3IP : 1;
5536 unsigned TMR0IP : 1;
5537 unsigned INTEDG3 : 1;
5538 unsigned INTEDG2 : 1;
5539 unsigned INTEDG1 : 1;
5540 unsigned INTEDG0 : 1;
5541 unsigned NOT_RBPU : 1;
5544 struct
5546 unsigned : 1;
5547 unsigned INT3P : 1;
5548 unsigned T0IP : 1;
5549 unsigned : 1;
5550 unsigned : 1;
5551 unsigned : 1;
5552 unsigned : 1;
5553 unsigned RBPU : 1;
5555 } __INTCON2bits_t;
5557 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5559 #define _RBIP 0x01
5560 #define _INT3IP 0x02
5561 #define _INT3P 0x02
5562 #define _TMR0IP 0x04
5563 #define _T0IP 0x04
5564 #define _INTEDG3 0x08
5565 #define _INTEDG2 0x10
5566 #define _INTEDG1 0x20
5567 #define _INTEDG0 0x40
5568 #define _NOT_RBPU 0x80
5569 #define _RBPU 0x80
5571 //==============================================================================
5574 //==============================================================================
5575 // INTCON Bits
5577 extern __at(0x0FF2) __sfr INTCON;
5579 typedef union
5581 struct
5583 unsigned RBIF : 1;
5584 unsigned INT0IF : 1;
5585 unsigned TMR0IF : 1;
5586 unsigned RBIE : 1;
5587 unsigned INT0IE : 1;
5588 unsigned TMR0IE : 1;
5589 unsigned PEIE_GIEL : 1;
5590 unsigned GIE_GIEH : 1;
5593 struct
5595 unsigned : 1;
5596 unsigned INT0F : 1;
5597 unsigned T0IF : 1;
5598 unsigned : 1;
5599 unsigned INT0E : 1;
5600 unsigned T0IE : 1;
5601 unsigned PEIE : 1;
5602 unsigned GIE : 1;
5605 struct
5607 unsigned : 1;
5608 unsigned : 1;
5609 unsigned : 1;
5610 unsigned : 1;
5611 unsigned : 1;
5612 unsigned : 1;
5613 unsigned GIEL : 1;
5614 unsigned GIEH : 1;
5616 } __INTCONbits_t;
5618 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5620 #define _RBIF 0x01
5621 #define _INT0IF 0x02
5622 #define _INT0F 0x02
5623 #define _TMR0IF 0x04
5624 #define _T0IF 0x04
5625 #define _RBIE 0x08
5626 #define _INT0IE 0x10
5627 #define _INT0E 0x10
5628 #define _TMR0IE 0x20
5629 #define _T0IE 0x20
5630 #define _PEIE_GIEL 0x40
5631 #define _PEIE 0x40
5632 #define _GIEL 0x40
5633 #define _GIE_GIEH 0x80
5634 #define _GIE 0x80
5635 #define _GIEH 0x80
5637 //==============================================================================
5639 extern __at(0x0FF3) __sfr PROD;
5640 extern __at(0x0FF3) __sfr PRODL;
5641 extern __at(0x0FF4) __sfr PRODH;
5642 extern __at(0x0FF5) __sfr TABLAT;
5643 extern __at(0x0FF6) __sfr TBLPTR;
5644 extern __at(0x0FF6) __sfr TBLPTRL;
5645 extern __at(0x0FF7) __sfr TBLPTRH;
5646 extern __at(0x0FF8) __sfr TBLPTRU;
5647 extern __at(0x0FF9) __sfr PC;
5648 extern __at(0x0FF9) __sfr PCL;
5649 extern __at(0x0FFA) __sfr PCLATH;
5650 extern __at(0x0FFB) __sfr PCLATU;
5652 //==============================================================================
5653 // STKPTR Bits
5655 extern __at(0x0FFC) __sfr STKPTR;
5657 typedef union
5659 struct
5661 unsigned SP0 : 1;
5662 unsigned SP1 : 1;
5663 unsigned SP2 : 1;
5664 unsigned SP3 : 1;
5665 unsigned SP4 : 1;
5666 unsigned : 1;
5667 unsigned STKUNF : 1;
5668 unsigned STKFUL : 1;
5671 struct
5673 unsigned STKPTR0 : 1;
5674 unsigned STKPTR1 : 1;
5675 unsigned STKPTR2 : 1;
5676 unsigned STKPTR3 : 1;
5677 unsigned STKPTR4 : 1;
5678 unsigned : 1;
5679 unsigned : 1;
5680 unsigned STKOVF : 1;
5683 struct
5685 unsigned SP : 5;
5686 unsigned : 3;
5689 struct
5691 unsigned STKPTR : 5;
5692 unsigned : 3;
5694 } __STKPTRbits_t;
5696 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5698 #define _SP0 0x01
5699 #define _STKPTR0 0x01
5700 #define _SP1 0x02
5701 #define _STKPTR1 0x02
5702 #define _SP2 0x04
5703 #define _STKPTR2 0x04
5704 #define _SP3 0x08
5705 #define _STKPTR3 0x08
5706 #define _SP4 0x10
5707 #define _STKPTR4 0x10
5708 #define _STKUNF 0x40
5709 #define _STKFUL 0x80
5710 #define _STKOVF 0x80
5712 //==============================================================================
5714 extern __at(0x0FFD) __sfr TOS;
5715 extern __at(0x0FFD) __sfr TOSL;
5716 extern __at(0x0FFE) __sfr TOSH;
5717 extern __at(0x0FFF) __sfr TOSU;
5719 //==============================================================================
5721 // Configuration Addresses
5723 //==============================================================================
5725 #define __CONFIG1L 0x003FF8
5726 #define __CONFIG1H 0x003FF9
5727 #define __CONFIG2L 0x003FFA
5728 #define __CONFIG2H 0x003FFB
5729 #define __CONFIG3L 0x003FFC
5730 #define __CONFIG3H 0x003FFD
5732 //==============================================================================
5734 #endif // #ifndef __PIC18F64J90_H__