struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f85j90.h
blob92400ac4572fc474e5b94f8a4408b5d9095064a3
1 /*
2 * This declarations of the PIC18F85J90 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:36 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 __PIC18F85J90_H__
26 #define __PIC18F85J90_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 // LCDDATA5 Bits
341 extern __at(0x0F6B) __sfr LCDDATA5;
343 typedef union
345 struct
347 unsigned S40C0 : 1;
348 unsigned S41C0 : 1;
349 unsigned S42C0 : 1;
350 unsigned S43C0 : 1;
351 unsigned S44C0 : 1;
352 unsigned S45C0 : 1;
353 unsigned S46C0 : 1;
354 unsigned S47C0 : 1;
357 struct
359 unsigned SEG40COM0 : 1;
360 unsigned SEG41COM0 : 1;
361 unsigned SEG42COM0 : 1;
362 unsigned SEG43COM0 : 1;
363 unsigned SEG44COM0 : 1;
364 unsigned SEG45COM0 : 1;
365 unsigned SEG46COM0 : 1;
366 unsigned SEG47COM0 : 1;
368 } __LCDDATA5bits_t;
370 extern __at(0x0F6B) volatile __LCDDATA5bits_t LCDDATA5bits;
372 #define _S40C0 0x01
373 #define _SEG40COM0 0x01
374 #define _S41C0 0x02
375 #define _SEG41COM0 0x02
376 #define _S42C0 0x04
377 #define _SEG42COM0 0x04
378 #define _S43C0 0x08
379 #define _SEG43COM0 0x08
380 #define _S44C0 0x10
381 #define _SEG44COM0 0x10
382 #define _S45C0 0x20
383 #define _SEG45COM0 0x20
384 #define _S46C0 0x40
385 #define _SEG46COM0 0x40
386 #define _S47C0 0x80
387 #define _SEG47COM0 0x80
389 //==============================================================================
392 //==============================================================================
393 // LCDDATA6 Bits
395 extern __at(0x0F6C) __sfr LCDDATA6;
397 typedef union
399 struct
401 unsigned S00C1 : 1;
402 unsigned S01C1 : 1;
403 unsigned S02C1 : 1;
404 unsigned S03C1 : 1;
405 unsigned S04C1 : 1;
406 unsigned S05C1 : 1;
407 unsigned S06C1 : 1;
408 unsigned S07C1 : 1;
411 struct
413 unsigned SEG0COM1 : 1;
414 unsigned SEG1COM1 : 1;
415 unsigned SEG2COM1 : 1;
416 unsigned SEG3COM1 : 1;
417 unsigned SEG4COM1 : 1;
418 unsigned SEG5COM1 : 1;
419 unsigned SEG6COM1 : 1;
420 unsigned SEG7COM1 : 1;
423 struct
425 unsigned S0C1 : 1;
426 unsigned S1C1 : 1;
427 unsigned S2C1 : 1;
428 unsigned S3C1 : 1;
429 unsigned S4C1 : 1;
430 unsigned S5C1 : 1;
431 unsigned S6C1 : 1;
432 unsigned S7C1 : 1;
434 } __LCDDATA6bits_t;
436 extern __at(0x0F6C) volatile __LCDDATA6bits_t LCDDATA6bits;
438 #define _S00C1 0x01
439 #define _SEG0COM1 0x01
440 #define _S0C1 0x01
441 #define _S01C1 0x02
442 #define _SEG1COM1 0x02
443 #define _S1C1 0x02
444 #define _S02C1 0x04
445 #define _SEG2COM1 0x04
446 #define _S2C1 0x04
447 #define _S03C1 0x08
448 #define _SEG3COM1 0x08
449 #define _S3C1 0x08
450 #define _S04C1 0x10
451 #define _SEG4COM1 0x10
452 #define _S4C1 0x10
453 #define _S05C1 0x20
454 #define _SEG5COM1 0x20
455 #define _S5C1 0x20
456 #define _S06C1 0x40
457 #define _SEG6COM1 0x40
458 #define _S6C1 0x40
459 #define _S07C1 0x80
460 #define _SEG7COM1 0x80
461 #define _S7C1 0x80
463 //==============================================================================
466 //==============================================================================
467 // LCDDATA7 Bits
469 extern __at(0x0F6D) __sfr LCDDATA7;
471 typedef union
473 struct
475 unsigned S8C1 : 1;
476 unsigned S9C1 : 1;
477 unsigned S10C1 : 1;
478 unsigned S11C1 : 1;
479 unsigned S12C1 : 1;
480 unsigned S13C1 : 1;
481 unsigned S14C1 : 1;
482 unsigned S15C1 : 1;
485 struct
487 unsigned SEG8COM1 : 1;
488 unsigned SEG9COM1 : 1;
489 unsigned SEG10COM1 : 1;
490 unsigned SEG11COM1 : 1;
491 unsigned SEG12COM1 : 1;
492 unsigned SEG13COM1 : 1;
493 unsigned SEG14COM1 : 1;
494 unsigned SEG15COM1 : 1;
497 struct
499 unsigned S08C1 : 1;
500 unsigned S09C1 : 1;
501 unsigned : 1;
502 unsigned : 1;
503 unsigned : 1;
504 unsigned : 1;
505 unsigned : 1;
506 unsigned : 1;
508 } __LCDDATA7bits_t;
510 extern __at(0x0F6D) volatile __LCDDATA7bits_t LCDDATA7bits;
512 #define _S8C1 0x01
513 #define _SEG8COM1 0x01
514 #define _S08C1 0x01
515 #define _S9C1 0x02
516 #define _SEG9COM1 0x02
517 #define _S09C1 0x02
518 #define _S10C1 0x04
519 #define _SEG10COM1 0x04
520 #define _S11C1 0x08
521 #define _SEG11COM1 0x08
522 #define _S12C1 0x10
523 #define _SEG12COM1 0x10
524 #define _S13C1 0x20
525 #define _SEG13COM1 0x20
526 #define _S14C1 0x40
527 #define _SEG14COM1 0x40
528 #define _S15C1 0x80
529 #define _SEG15COM1 0x80
531 //==============================================================================
534 //==============================================================================
535 // LCDDATA8 Bits
537 extern __at(0x0F6E) __sfr LCDDATA8;
539 typedef union
541 struct
543 unsigned S16C1 : 1;
544 unsigned S17C1 : 1;
545 unsigned S18C1 : 1;
546 unsigned S19C1 : 1;
547 unsigned S20C1 : 1;
548 unsigned S21C1 : 1;
549 unsigned S22C1 : 1;
550 unsigned S23C1 : 1;
553 struct
555 unsigned SEG16COM1 : 1;
556 unsigned SEG17COM1 : 1;
557 unsigned SEG18COM1 : 1;
558 unsigned SEG19COM1 : 1;
559 unsigned SEG20COM1 : 1;
560 unsigned SEG21COM1 : 1;
561 unsigned SEG22COM1 : 1;
562 unsigned SEG23COM1 : 1;
564 } __LCDDATA8bits_t;
566 extern __at(0x0F6E) volatile __LCDDATA8bits_t LCDDATA8bits;
568 #define _S16C1 0x01
569 #define _SEG16COM1 0x01
570 #define _S17C1 0x02
571 #define _SEG17COM1 0x02
572 #define _S18C1 0x04
573 #define _SEG18COM1 0x04
574 #define _S19C1 0x08
575 #define _SEG19COM1 0x08
576 #define _S20C1 0x10
577 #define _SEG20COM1 0x10
578 #define _S21C1 0x20
579 #define _SEG21COM1 0x20
580 #define _S22C1 0x40
581 #define _SEG22COM1 0x40
582 #define _S23C1 0x80
583 #define _SEG23COM1 0x80
585 //==============================================================================
588 //==============================================================================
589 // LCDDATA9 Bits
591 extern __at(0x0F6F) __sfr LCDDATA9;
593 typedef union
595 struct
597 unsigned S24C1 : 1;
598 unsigned S25C1 : 1;
599 unsigned S26C1 : 1;
600 unsigned S27C1 : 1;
601 unsigned S28C1 : 1;
602 unsigned S29C1 : 1;
603 unsigned S30C1 : 1;
604 unsigned S31C1 : 1;
607 struct
609 unsigned SEG24COM1 : 1;
610 unsigned SEG25COM1 : 1;
611 unsigned SEG26COM1 : 1;
612 unsigned SEG27COM1 : 1;
613 unsigned SEG28COM1 : 1;
614 unsigned SEG29COM1 : 1;
615 unsigned SEG30COM1 : 1;
616 unsigned SEG31COM1 : 1;
618 } __LCDDATA9bits_t;
620 extern __at(0x0F6F) volatile __LCDDATA9bits_t LCDDATA9bits;
622 #define _S24C1 0x01
623 #define _SEG24COM1 0x01
624 #define _S25C1 0x02
625 #define _SEG25COM1 0x02
626 #define _S26C1 0x04
627 #define _SEG26COM1 0x04
628 #define _S27C1 0x08
629 #define _SEG27COM1 0x08
630 #define _S28C1 0x10
631 #define _SEG28COM1 0x10
632 #define _S29C1 0x20
633 #define _SEG29COM1 0x20
634 #define _S30C1 0x40
635 #define _SEG30COM1 0x40
636 #define _S31C1 0x80
637 #define _SEG31COM1 0x80
639 //==============================================================================
642 //==============================================================================
643 // LCDDATA10 Bits
645 extern __at(0x0F70) __sfr LCDDATA10;
647 typedef union
649 struct
651 unsigned S32C1 : 1;
652 unsigned S33C1 : 1;
653 unsigned S34C1 : 1;
654 unsigned S35C1 : 1;
655 unsigned S36C1 : 1;
656 unsigned S37C1 : 1;
657 unsigned S38C1 : 1;
658 unsigned S39C1 : 1;
661 struct
663 unsigned SEG32COM1 : 1;
664 unsigned SEG33COM1 : 1;
665 unsigned SEG34COM1 : 1;
666 unsigned SEG35COM1 : 1;
667 unsigned SEG36COM1 : 1;
668 unsigned SEG37COM1 : 1;
669 unsigned SEG38COM1 : 1;
670 unsigned SEG39COM1 : 1;
672 } __LCDDATA10bits_t;
674 extern __at(0x0F70) volatile __LCDDATA10bits_t LCDDATA10bits;
676 #define _S32C1 0x01
677 #define _SEG32COM1 0x01
678 #define _S33C1 0x02
679 #define _SEG33COM1 0x02
680 #define _S34C1 0x04
681 #define _SEG34COM1 0x04
682 #define _S35C1 0x08
683 #define _SEG35COM1 0x08
684 #define _S36C1 0x10
685 #define _SEG36COM1 0x10
686 #define _S37C1 0x20
687 #define _SEG37COM1 0x20
688 #define _S38C1 0x40
689 #define _SEG38COM1 0x40
690 #define _S39C1 0x80
691 #define _SEG39COM1 0x80
693 //==============================================================================
696 //==============================================================================
697 // LCDDATA11 Bits
699 extern __at(0x0F71) __sfr LCDDATA11;
701 typedef union
703 struct
705 unsigned S40C1 : 1;
706 unsigned S41C1 : 1;
707 unsigned S42C1 : 1;
708 unsigned S43C1 : 1;
709 unsigned S44C1 : 1;
710 unsigned S45C1 : 1;
711 unsigned S46C1 : 1;
712 unsigned S47C1 : 1;
715 struct
717 unsigned SEG40COM1 : 1;
718 unsigned SEG41COM1 : 1;
719 unsigned SEG42COM1 : 1;
720 unsigned SEG43COM1 : 1;
721 unsigned SEG44COM1 : 1;
722 unsigned SEG45COM1 : 1;
723 unsigned SEG46COM1 : 1;
724 unsigned SEG47COM1 : 1;
726 } __LCDDATA11bits_t;
728 extern __at(0x0F71) volatile __LCDDATA11bits_t LCDDATA11bits;
730 #define _S40C1 0x01
731 #define _SEG40COM1 0x01
732 #define _S41C1 0x02
733 #define _SEG41COM1 0x02
734 #define _S42C1 0x04
735 #define _SEG42COM1 0x04
736 #define _S43C1 0x08
737 #define _SEG43COM1 0x08
738 #define _S44C1 0x10
739 #define _SEG44COM1 0x10
740 #define _S45C1 0x20
741 #define _SEG45COM1 0x20
742 #define _S46C1 0x40
743 #define _SEG46COM1 0x40
744 #define _S47C1 0x80
745 #define _SEG47COM1 0x80
747 //==============================================================================
750 //==============================================================================
751 // LCDDATA12 Bits
753 extern __at(0x0F72) __sfr LCDDATA12;
755 typedef union
757 struct
759 unsigned S00C2 : 1;
760 unsigned S01C2 : 1;
761 unsigned S02C2 : 1;
762 unsigned S03C2 : 1;
763 unsigned S04C2 : 1;
764 unsigned S05C2 : 1;
765 unsigned S06C2 : 1;
766 unsigned S07C2 : 1;
769 struct
771 unsigned SEG0COM2 : 1;
772 unsigned SEG1COM2 : 1;
773 unsigned SEG2COM2 : 1;
774 unsigned SEG3COM2 : 1;
775 unsigned SEG4COM2 : 1;
776 unsigned SEG5COM2 : 1;
777 unsigned SEG6COM2 : 1;
778 unsigned SEG7COM2 : 1;
781 struct
783 unsigned S0C2 : 1;
784 unsigned S1C2 : 1;
785 unsigned S2C2 : 1;
786 unsigned S3C2 : 1;
787 unsigned S4C2 : 1;
788 unsigned S5C2 : 1;
789 unsigned S6C2 : 1;
790 unsigned S7C2 : 1;
792 } __LCDDATA12bits_t;
794 extern __at(0x0F72) volatile __LCDDATA12bits_t LCDDATA12bits;
796 #define _S00C2 0x01
797 #define _SEG0COM2 0x01
798 #define _S0C2 0x01
799 #define _S01C2 0x02
800 #define _SEG1COM2 0x02
801 #define _S1C2 0x02
802 #define _S02C2 0x04
803 #define _SEG2COM2 0x04
804 #define _S2C2 0x04
805 #define _S03C2 0x08
806 #define _SEG3COM2 0x08
807 #define _S3C2 0x08
808 #define _S04C2 0x10
809 #define _SEG4COM2 0x10
810 #define _S4C2 0x10
811 #define _S05C2 0x20
812 #define _SEG5COM2 0x20
813 #define _S5C2 0x20
814 #define _S06C2 0x40
815 #define _SEG6COM2 0x40
816 #define _S6C2 0x40
817 #define _S07C2 0x80
818 #define _SEG7COM2 0x80
819 #define _S7C2 0x80
821 //==============================================================================
824 //==============================================================================
825 // LCDDATA13 Bits
827 extern __at(0x0F73) __sfr LCDDATA13;
829 typedef union
831 struct
833 unsigned S8C2 : 1;
834 unsigned S9C2 : 1;
835 unsigned S10C2 : 1;
836 unsigned S11C2 : 1;
837 unsigned S12C2 : 1;
838 unsigned S13C2 : 1;
839 unsigned S14C2 : 1;
840 unsigned S15C2 : 1;
843 struct
845 unsigned SEG8COM2 : 1;
846 unsigned SEG9COM2 : 1;
847 unsigned SEG10COM2 : 1;
848 unsigned SEG11COM2 : 1;
849 unsigned SEG12COM2 : 1;
850 unsigned SEG13COM2 : 1;
851 unsigned SEG14COM2 : 1;
852 unsigned SEG15COM2 : 1;
855 struct
857 unsigned S08C2 : 1;
858 unsigned S09C2 : 1;
859 unsigned : 1;
860 unsigned : 1;
861 unsigned : 1;
862 unsigned : 1;
863 unsigned : 1;
864 unsigned : 1;
866 } __LCDDATA13bits_t;
868 extern __at(0x0F73) volatile __LCDDATA13bits_t LCDDATA13bits;
870 #define _S8C2 0x01
871 #define _SEG8COM2 0x01
872 #define _S08C2 0x01
873 #define _S9C2 0x02
874 #define _SEG9COM2 0x02
875 #define _S09C2 0x02
876 #define _S10C2 0x04
877 #define _SEG10COM2 0x04
878 #define _S11C2 0x08
879 #define _SEG11COM2 0x08
880 #define _S12C2 0x10
881 #define _SEG12COM2 0x10
882 #define _S13C2 0x20
883 #define _SEG13COM2 0x20
884 #define _S14C2 0x40
885 #define _SEG14COM2 0x40
886 #define _S15C2 0x80
887 #define _SEG15COM2 0x80
889 //==============================================================================
892 //==============================================================================
893 // LCDDATA14 Bits
895 extern __at(0x0F74) __sfr LCDDATA14;
897 typedef union
899 struct
901 unsigned S16C2 : 1;
902 unsigned S17C2 : 1;
903 unsigned S18C2 : 1;
904 unsigned S19C2 : 1;
905 unsigned S20C2 : 1;
906 unsigned S21C2 : 1;
907 unsigned S22C2 : 1;
908 unsigned S23C2 : 1;
911 struct
913 unsigned SEG16COM2 : 1;
914 unsigned SEG17COM2 : 1;
915 unsigned SEG18COM2 : 1;
916 unsigned SEG19COM2 : 1;
917 unsigned SEG20COM2 : 1;
918 unsigned SEG21COM2 : 1;
919 unsigned SEG22COM2 : 1;
920 unsigned SEG23COM2 : 1;
922 } __LCDDATA14bits_t;
924 extern __at(0x0F74) volatile __LCDDATA14bits_t LCDDATA14bits;
926 #define _S16C2 0x01
927 #define _SEG16COM2 0x01
928 #define _S17C2 0x02
929 #define _SEG17COM2 0x02
930 #define _S18C2 0x04
931 #define _SEG18COM2 0x04
932 #define _S19C2 0x08
933 #define _SEG19COM2 0x08
934 #define _S20C2 0x10
935 #define _SEG20COM2 0x10
936 #define _S21C2 0x20
937 #define _SEG21COM2 0x20
938 #define _S22C2 0x40
939 #define _SEG22COM2 0x40
940 #define _S23C2 0x80
941 #define _SEG23COM2 0x80
943 //==============================================================================
946 //==============================================================================
947 // LCDDATA15 Bits
949 extern __at(0x0F75) __sfr LCDDATA15;
951 typedef union
953 struct
955 unsigned S24C2 : 1;
956 unsigned S25C2 : 1;
957 unsigned S26C2 : 1;
958 unsigned S27C2 : 1;
959 unsigned S28C2 : 1;
960 unsigned S29C2 : 1;
961 unsigned S30C2 : 1;
962 unsigned S31C2 : 1;
965 struct
967 unsigned SEG24COM2 : 1;
968 unsigned SEG25COM2 : 1;
969 unsigned SEG26COM2 : 1;
970 unsigned SEG27COM2 : 1;
971 unsigned SEG28COM2 : 1;
972 unsigned SEG29COM2 : 1;
973 unsigned SEG30COM2 : 1;
974 unsigned SEG31COM2 : 1;
976 } __LCDDATA15bits_t;
978 extern __at(0x0F75) volatile __LCDDATA15bits_t LCDDATA15bits;
980 #define _S24C2 0x01
981 #define _SEG24COM2 0x01
982 #define _S25C2 0x02
983 #define _SEG25COM2 0x02
984 #define _S26C2 0x04
985 #define _SEG26COM2 0x04
986 #define _S27C2 0x08
987 #define _SEG27COM2 0x08
988 #define _S28C2 0x10
989 #define _SEG28COM2 0x10
990 #define _S29C2 0x20
991 #define _SEG29COM2 0x20
992 #define _S30C2 0x40
993 #define _SEG30COM2 0x40
994 #define _S31C2 0x80
995 #define _SEG31COM2 0x80
997 //==============================================================================
1000 //==============================================================================
1001 // LCDDATA16 Bits
1003 extern __at(0x0F76) __sfr LCDDATA16;
1005 typedef union
1007 struct
1009 unsigned S32C2 : 1;
1010 unsigned S33C2 : 1;
1011 unsigned S34C2 : 1;
1012 unsigned S35C2 : 1;
1013 unsigned S36C2 : 1;
1014 unsigned S37C2 : 1;
1015 unsigned S38C2 : 1;
1016 unsigned S39C2 : 1;
1019 struct
1021 unsigned SEG32COM2 : 1;
1022 unsigned SEG33COM2 : 1;
1023 unsigned SEG34COM2 : 1;
1024 unsigned SEG35COM2 : 1;
1025 unsigned SEG36COM2 : 1;
1026 unsigned SEG37COM2 : 1;
1027 unsigned SEG38COM2 : 1;
1028 unsigned SEG39COM2 : 1;
1030 } __LCDDATA16bits_t;
1032 extern __at(0x0F76) volatile __LCDDATA16bits_t LCDDATA16bits;
1034 #define _S32C2 0x01
1035 #define _SEG32COM2 0x01
1036 #define _S33C2 0x02
1037 #define _SEG33COM2 0x02
1038 #define _S34C2 0x04
1039 #define _SEG34COM2 0x04
1040 #define _S35C2 0x08
1041 #define _SEG35COM2 0x08
1042 #define _S36C2 0x10
1043 #define _SEG36COM2 0x10
1044 #define _S37C2 0x20
1045 #define _SEG37COM2 0x20
1046 #define _S38C2 0x40
1047 #define _SEG38COM2 0x40
1048 #define _S39C2 0x80
1049 #define _SEG39COM2 0x80
1051 //==============================================================================
1054 //==============================================================================
1055 // LCDDATA17 Bits
1057 extern __at(0x0F77) __sfr LCDDATA17;
1059 typedef union
1061 struct
1063 unsigned S40C2 : 1;
1064 unsigned S41C2 : 1;
1065 unsigned S42C2 : 1;
1066 unsigned S43C2 : 1;
1067 unsigned S44C2 : 1;
1068 unsigned S45C2 : 1;
1069 unsigned S46C2 : 1;
1070 unsigned S47C2 : 1;
1073 struct
1075 unsigned SEG40COM2 : 1;
1076 unsigned SEG41COM2 : 1;
1077 unsigned SEG42COM2 : 1;
1078 unsigned SEG43COM2 : 1;
1079 unsigned SEG44COM2 : 1;
1080 unsigned SEG45COM2 : 1;
1081 unsigned SEG46COM2 : 1;
1082 unsigned SEG47COM2 : 1;
1084 } __LCDDATA17bits_t;
1086 extern __at(0x0F77) volatile __LCDDATA17bits_t LCDDATA17bits;
1088 #define _S40C2 0x01
1089 #define _SEG40COM2 0x01
1090 #define _S41C2 0x02
1091 #define _SEG41COM2 0x02
1092 #define _S42C2 0x04
1093 #define _SEG42COM2 0x04
1094 #define _S43C2 0x08
1095 #define _SEG43COM2 0x08
1096 #define _S44C2 0x10
1097 #define _SEG44COM2 0x10
1098 #define _S45C2 0x20
1099 #define _SEG45COM2 0x20
1100 #define _S46C2 0x40
1101 #define _SEG46COM2 0x40
1102 #define _S47C2 0x80
1103 #define _SEG47COM2 0x80
1105 //==============================================================================
1108 //==============================================================================
1109 // LCDDATA18 Bits
1111 extern __at(0x0F78) __sfr LCDDATA18;
1113 typedef union
1115 struct
1117 unsigned S00C3 : 1;
1118 unsigned S01C3 : 1;
1119 unsigned S02C3 : 1;
1120 unsigned S03C3 : 1;
1121 unsigned S04C3 : 1;
1122 unsigned S05C3 : 1;
1123 unsigned S06C3 : 1;
1124 unsigned S07C3 : 1;
1127 struct
1129 unsigned SEG0COM3 : 1;
1130 unsigned SEG1COM3 : 1;
1131 unsigned SEG2COM3 : 1;
1132 unsigned SEG3COM3 : 1;
1133 unsigned SEG4COM3 : 1;
1134 unsigned SEG5COM3 : 1;
1135 unsigned SEG6COM3 : 1;
1136 unsigned SEG7COM3 : 1;
1139 struct
1141 unsigned S0C3 : 1;
1142 unsigned S1C3 : 1;
1143 unsigned S2C3 : 1;
1144 unsigned S3C3 : 1;
1145 unsigned S4C3 : 1;
1146 unsigned S5C3 : 1;
1147 unsigned S6C3 : 1;
1148 unsigned S7C3 : 1;
1150 } __LCDDATA18bits_t;
1152 extern __at(0x0F78) volatile __LCDDATA18bits_t LCDDATA18bits;
1154 #define _S00C3 0x01
1155 #define _SEG0COM3 0x01
1156 #define _S0C3 0x01
1157 #define _S01C3 0x02
1158 #define _SEG1COM3 0x02
1159 #define _S1C3 0x02
1160 #define _S02C3 0x04
1161 #define _SEG2COM3 0x04
1162 #define _S2C3 0x04
1163 #define _S03C3 0x08
1164 #define _SEG3COM3 0x08
1165 #define _S3C3 0x08
1166 #define _S04C3 0x10
1167 #define _SEG4COM3 0x10
1168 #define _S4C3 0x10
1169 #define _S05C3 0x20
1170 #define _SEG5COM3 0x20
1171 #define _S5C3 0x20
1172 #define _S06C3 0x40
1173 #define _SEG6COM3 0x40
1174 #define _S6C3 0x40
1175 #define _S07C3 0x80
1176 #define _SEG7COM3 0x80
1177 #define _S7C3 0x80
1179 //==============================================================================
1182 //==============================================================================
1183 // LCDDATA19 Bits
1185 extern __at(0x0F79) __sfr LCDDATA19;
1187 typedef union
1189 struct
1191 unsigned S8C3 : 1;
1192 unsigned S9C3 : 1;
1193 unsigned S10C3 : 1;
1194 unsigned S11C3 : 1;
1195 unsigned S12C3 : 1;
1196 unsigned S13C3 : 1;
1197 unsigned S14C3 : 1;
1198 unsigned S15C3 : 1;
1201 struct
1203 unsigned SEG8COM3 : 1;
1204 unsigned SEG9COM3 : 1;
1205 unsigned SEG10COM3 : 1;
1206 unsigned SEG11COM3 : 1;
1207 unsigned SEG12COM3 : 1;
1208 unsigned SEG13COM3 : 1;
1209 unsigned SEG14COM3 : 1;
1210 unsigned SEG15COM3 : 1;
1213 struct
1215 unsigned S08C3 : 1;
1216 unsigned S09C3 : 1;
1217 unsigned : 1;
1218 unsigned : 1;
1219 unsigned : 1;
1220 unsigned : 1;
1221 unsigned : 1;
1222 unsigned : 1;
1224 } __LCDDATA19bits_t;
1226 extern __at(0x0F79) volatile __LCDDATA19bits_t LCDDATA19bits;
1228 #define _S8C3 0x01
1229 #define _SEG8COM3 0x01
1230 #define _S08C3 0x01
1231 #define _S9C3 0x02
1232 #define _SEG9COM3 0x02
1233 #define _S09C3 0x02
1234 #define _S10C3 0x04
1235 #define _SEG10COM3 0x04
1236 #define _S11C3 0x08
1237 #define _SEG11COM3 0x08
1238 #define _S12C3 0x10
1239 #define _SEG12COM3 0x10
1240 #define _S13C3 0x20
1241 #define _SEG13COM3 0x20
1242 #define _S14C3 0x40
1243 #define _SEG14COM3 0x40
1244 #define _S15C3 0x80
1245 #define _SEG15COM3 0x80
1247 //==============================================================================
1250 //==============================================================================
1251 // LCDDATA20 Bits
1253 extern __at(0x0F7A) __sfr LCDDATA20;
1255 typedef union
1257 struct
1259 unsigned S16C3 : 1;
1260 unsigned S17C3 : 1;
1261 unsigned S18C3 : 1;
1262 unsigned S19C3 : 1;
1263 unsigned S20C3 : 1;
1264 unsigned S21C3 : 1;
1265 unsigned S22C3 : 1;
1266 unsigned S23C3 : 1;
1269 struct
1271 unsigned SEG16COM3 : 1;
1272 unsigned SEG17COM3 : 1;
1273 unsigned SEG18COM3 : 1;
1274 unsigned SEG19COM3 : 1;
1275 unsigned SEG20COM3 : 1;
1276 unsigned SEG21COM3 : 1;
1277 unsigned SEG22COM3 : 1;
1278 unsigned SEG23COM3 : 1;
1280 } __LCDDATA20bits_t;
1282 extern __at(0x0F7A) volatile __LCDDATA20bits_t LCDDATA20bits;
1284 #define _S16C3 0x01
1285 #define _SEG16COM3 0x01
1286 #define _S17C3 0x02
1287 #define _SEG17COM3 0x02
1288 #define _S18C3 0x04
1289 #define _SEG18COM3 0x04
1290 #define _S19C3 0x08
1291 #define _SEG19COM3 0x08
1292 #define _S20C3 0x10
1293 #define _SEG20COM3 0x10
1294 #define _S21C3 0x20
1295 #define _SEG21COM3 0x20
1296 #define _S22C3 0x40
1297 #define _SEG22COM3 0x40
1298 #define _S23C3 0x80
1299 #define _SEG23COM3 0x80
1301 //==============================================================================
1304 //==============================================================================
1305 // LCDDATA21 Bits
1307 extern __at(0x0F7B) __sfr LCDDATA21;
1309 typedef union
1311 struct
1313 unsigned S24C3 : 1;
1314 unsigned S25C3 : 1;
1315 unsigned S26C3 : 1;
1316 unsigned S27C3 : 1;
1317 unsigned S28C3 : 1;
1318 unsigned S29C3 : 1;
1319 unsigned S30C3 : 1;
1320 unsigned S31C3 : 1;
1323 struct
1325 unsigned SEG24COM3 : 1;
1326 unsigned SEG25COM3 : 1;
1327 unsigned SEG26COM3 : 1;
1328 unsigned SEG27COM3 : 1;
1329 unsigned SEG28COM3 : 1;
1330 unsigned SEG29COM3 : 1;
1331 unsigned SEG30COM3 : 1;
1332 unsigned SEG31COM3 : 1;
1334 } __LCDDATA21bits_t;
1336 extern __at(0x0F7B) volatile __LCDDATA21bits_t LCDDATA21bits;
1338 #define _S24C3 0x01
1339 #define _SEG24COM3 0x01
1340 #define _S25C3 0x02
1341 #define _SEG25COM3 0x02
1342 #define _S26C3 0x04
1343 #define _SEG26COM3 0x04
1344 #define _S27C3 0x08
1345 #define _SEG27COM3 0x08
1346 #define _S28C3 0x10
1347 #define _SEG28COM3 0x10
1348 #define _S29C3 0x20
1349 #define _SEG29COM3 0x20
1350 #define _S30C3 0x40
1351 #define _SEG30COM3 0x40
1352 #define _S31C3 0x80
1353 #define _SEG31COM3 0x80
1355 //==============================================================================
1358 //==============================================================================
1359 // LCDDATA22 Bits
1361 extern __at(0x0F7C) __sfr LCDDATA22;
1363 typedef union
1365 struct
1367 unsigned S32C3 : 1;
1368 unsigned S33C3 : 1;
1369 unsigned S34C3 : 1;
1370 unsigned S35C3 : 1;
1371 unsigned S36C3 : 1;
1372 unsigned S37C3 : 1;
1373 unsigned S38C3 : 1;
1374 unsigned S39C3 : 1;
1377 struct
1379 unsigned SEG32COM3 : 1;
1380 unsigned SEG33COM3 : 1;
1381 unsigned SEG34COM3 : 1;
1382 unsigned SEG35COM3 : 1;
1383 unsigned SEG36COM3 : 1;
1384 unsigned SEG37COM3 : 1;
1385 unsigned SEG38COM3 : 1;
1386 unsigned SEG39COM3 : 1;
1388 } __LCDDATA22bits_t;
1390 extern __at(0x0F7C) volatile __LCDDATA22bits_t LCDDATA22bits;
1392 #define _S32C3 0x01
1393 #define _SEG32COM3 0x01
1394 #define _S33C3 0x02
1395 #define _SEG33COM3 0x02
1396 #define _S34C3 0x04
1397 #define _SEG34COM3 0x04
1398 #define _S35C3 0x08
1399 #define _SEG35COM3 0x08
1400 #define _S36C3 0x10
1401 #define _SEG36COM3 0x10
1402 #define _S37C3 0x20
1403 #define _SEG37COM3 0x20
1404 #define _S38C3 0x40
1405 #define _SEG38COM3 0x40
1406 #define _S39C3 0x80
1407 #define _SEG39COM3 0x80
1409 //==============================================================================
1412 //==============================================================================
1413 // LCDDATA23 Bits
1415 extern __at(0x0F7D) __sfr LCDDATA23;
1417 typedef union
1419 struct
1421 unsigned S40C3 : 1;
1422 unsigned S41C3 : 1;
1423 unsigned S42C3 : 1;
1424 unsigned S43C3 : 1;
1425 unsigned S44C3 : 1;
1426 unsigned S45C3 : 1;
1427 unsigned S46C3 : 1;
1428 unsigned S47C3 : 1;
1431 struct
1433 unsigned SEG40COM3 : 1;
1434 unsigned SEG41COM3 : 1;
1435 unsigned SEG42COM3 : 1;
1436 unsigned SEG43COM3 : 1;
1437 unsigned SEG44COM3 : 1;
1438 unsigned SEG45COM3 : 1;
1439 unsigned SEG46COM3 : 1;
1440 unsigned SEG47COM3 : 1;
1442 } __LCDDATA23bits_t;
1444 extern __at(0x0F7D) volatile __LCDDATA23bits_t LCDDATA23bits;
1446 #define _S40C3 0x01
1447 #define _SEG40COM3 0x01
1448 #define _S41C3 0x02
1449 #define _SEG41COM3 0x02
1450 #define _S42C3 0x04
1451 #define _SEG42COM3 0x04
1452 #define _S43C3 0x08
1453 #define _SEG43COM3 0x08
1454 #define _S44C3 0x10
1455 #define _SEG44COM3 0x10
1456 #define _S45C3 0x20
1457 #define _SEG45COM3 0x20
1458 #define _S46C3 0x40
1459 #define _SEG46COM3 0x40
1460 #define _S47C3 0x80
1461 #define _SEG47COM3 0x80
1463 //==============================================================================
1466 //==============================================================================
1467 // BAUDCON1 Bits
1469 extern __at(0x0F7E) __sfr BAUDCON1;
1471 typedef union
1473 struct
1475 unsigned ABDEN : 1;
1476 unsigned WUE : 1;
1477 unsigned : 1;
1478 unsigned BRG16 : 1;
1479 unsigned TXCKP : 1;
1480 unsigned RXDTP : 1;
1481 unsigned RCIDL : 1;
1482 unsigned ABDOVF : 1;
1485 struct
1487 unsigned : 1;
1488 unsigned : 1;
1489 unsigned : 1;
1490 unsigned : 1;
1491 unsigned SCKP : 1;
1492 unsigned : 1;
1493 unsigned RCMT : 1;
1494 unsigned : 1;
1496 } __BAUDCON1bits_t;
1498 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1500 #define _ABDEN 0x01
1501 #define _WUE 0x02
1502 #define _BRG16 0x08
1503 #define _TXCKP 0x10
1504 #define _SCKP 0x10
1505 #define _RXDTP 0x20
1506 #define _RCIDL 0x40
1507 #define _RCMT 0x40
1508 #define _ABDOVF 0x80
1510 //==============================================================================
1512 extern __at(0x0F7F) __sfr SPBRGH1;
1514 //==============================================================================
1515 // PORTA Bits
1517 extern __at(0x0F80) __sfr PORTA;
1519 typedef union
1521 struct
1523 unsigned RA0 : 1;
1524 unsigned RA1 : 1;
1525 unsigned RA2 : 1;
1526 unsigned RA3 : 1;
1527 unsigned RA4 : 1;
1528 unsigned RA5 : 1;
1529 unsigned RA6 : 1;
1530 unsigned RA7 : 1;
1533 struct
1535 unsigned AN0 : 1;
1536 unsigned AN1 : 1;
1537 unsigned AN2 : 1;
1538 unsigned AN3 : 1;
1539 unsigned T0CKI : 1;
1540 unsigned AN4 : 1;
1541 unsigned OSC2 : 1;
1542 unsigned OSC1 : 1;
1545 struct
1547 unsigned : 1;
1548 unsigned SEG18 : 1;
1549 unsigned VREFM : 1;
1550 unsigned VREFP : 1;
1551 unsigned SEG14 : 1;
1552 unsigned SEG15 : 1;
1553 unsigned CLKO : 1;
1554 unsigned CLKI : 1;
1556 } __PORTAbits_t;
1558 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1560 #define _PORTA_RA0 0x01
1561 #define _PORTA_AN0 0x01
1562 #define _PORTA_RA1 0x02
1563 #define _PORTA_AN1 0x02
1564 #define _PORTA_SEG18 0x02
1565 #define _PORTA_RA2 0x04
1566 #define _PORTA_AN2 0x04
1567 #define _PORTA_VREFM 0x04
1568 #define _PORTA_RA3 0x08
1569 #define _PORTA_AN3 0x08
1570 #define _PORTA_VREFP 0x08
1571 #define _PORTA_RA4 0x10
1572 #define _PORTA_T0CKI 0x10
1573 #define _PORTA_SEG14 0x10
1574 #define _PORTA_RA5 0x20
1575 #define _PORTA_AN4 0x20
1576 #define _PORTA_SEG15 0x20
1577 #define _PORTA_RA6 0x40
1578 #define _PORTA_OSC2 0x40
1579 #define _PORTA_CLKO 0x40
1580 #define _PORTA_RA7 0x80
1581 #define _PORTA_OSC1 0x80
1582 #define _PORTA_CLKI 0x80
1584 //==============================================================================
1587 //==============================================================================
1588 // PORTB Bits
1590 extern __at(0x0F81) __sfr PORTB;
1592 typedef union
1594 struct
1596 unsigned RB0 : 1;
1597 unsigned RB1 : 1;
1598 unsigned RB2 : 1;
1599 unsigned RB3 : 1;
1600 unsigned RB4 : 1;
1601 unsigned RB5 : 1;
1602 unsigned RB6 : 1;
1603 unsigned RB7 : 1;
1606 struct
1608 unsigned INT0 : 1;
1609 unsigned INT1 : 1;
1610 unsigned INT2 : 1;
1611 unsigned INT3 : 1;
1612 unsigned KBI0 : 1;
1613 unsigned KBI1 : 1;
1614 unsigned KBI2 : 1;
1615 unsigned KBI3 : 1;
1618 struct
1620 unsigned SEG30 : 1;
1621 unsigned SEG8 : 1;
1622 unsigned SEG9 : 1;
1623 unsigned SEG10 : 1;
1624 unsigned SEG11 : 1;
1625 unsigned SEG29 : 1;
1626 unsigned PGC : 1;
1627 unsigned PGD : 1;
1630 struct
1632 unsigned INT : 4;
1633 unsigned : 4;
1636 struct
1638 unsigned : 4;
1639 unsigned KBI : 4;
1641 } __PORTBbits_t;
1643 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1645 #define _PORTB_RB0 0x01
1646 #define _PORTB_INT0 0x01
1647 #define _PORTB_SEG30 0x01
1648 #define _PORTB_RB1 0x02
1649 #define _PORTB_INT1 0x02
1650 #define _PORTB_SEG8 0x02
1651 #define _PORTB_RB2 0x04
1652 #define _PORTB_INT2 0x04
1653 #define _PORTB_SEG9 0x04
1654 #define _PORTB_RB3 0x08
1655 #define _PORTB_INT3 0x08
1656 #define _PORTB_SEG10 0x08
1657 #define _PORTB_RB4 0x10
1658 #define _PORTB_KBI0 0x10
1659 #define _PORTB_SEG11 0x10
1660 #define _PORTB_RB5 0x20
1661 #define _PORTB_KBI1 0x20
1662 #define _PORTB_SEG29 0x20
1663 #define _PORTB_RB6 0x40
1664 #define _PORTB_KBI2 0x40
1665 #define _PORTB_PGC 0x40
1666 #define _PORTB_RB7 0x80
1667 #define _PORTB_KBI3 0x80
1668 #define _PORTB_PGD 0x80
1670 //==============================================================================
1673 //==============================================================================
1674 // PORTC Bits
1676 extern __at(0x0F82) __sfr PORTC;
1678 typedef union
1680 struct
1682 unsigned RC0 : 1;
1683 unsigned RC1 : 1;
1684 unsigned RC2 : 1;
1685 unsigned RC3 : 1;
1686 unsigned RC4 : 1;
1687 unsigned RC5 : 1;
1688 unsigned RC6 : 1;
1689 unsigned RC7 : 1;
1692 struct
1694 unsigned T1OSO : 1;
1695 unsigned T1OSI : 1;
1696 unsigned CCP1 : 1;
1697 unsigned SCL : 1;
1698 unsigned SDA : 1;
1699 unsigned SDO : 1;
1700 unsigned CK1 : 1;
1701 unsigned DT1 : 1;
1704 struct
1706 unsigned T13CKI : 1;
1707 unsigned CCP2 : 1;
1708 unsigned SEG13 : 1;
1709 unsigned SCK : 1;
1710 unsigned SDI : 1;
1711 unsigned SEG12 : 1;
1712 unsigned TX1 : 1;
1713 unsigned RX1 : 1;
1716 struct
1718 unsigned : 1;
1719 unsigned SEG32 : 1;
1720 unsigned : 1;
1721 unsigned SEG17 : 1;
1722 unsigned SEG16 : 1;
1723 unsigned : 1;
1724 unsigned SEG27 : 1;
1725 unsigned SEG28 : 1;
1727 } __PORTCbits_t;
1729 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1731 #define _PORTC_RC0 0x01
1732 #define _PORTC_T1OSO 0x01
1733 #define _PORTC_T13CKI 0x01
1734 #define _PORTC_RC1 0x02
1735 #define _PORTC_T1OSI 0x02
1736 #define _PORTC_CCP2 0x02
1737 #define _PORTC_SEG32 0x02
1738 #define _PORTC_RC2 0x04
1739 #define _PORTC_CCP1 0x04
1740 #define _PORTC_SEG13 0x04
1741 #define _PORTC_RC3 0x08
1742 #define _PORTC_SCL 0x08
1743 #define _PORTC_SCK 0x08
1744 #define _PORTC_SEG17 0x08
1745 #define _PORTC_RC4 0x10
1746 #define _PORTC_SDA 0x10
1747 #define _PORTC_SDI 0x10
1748 #define _PORTC_SEG16 0x10
1749 #define _PORTC_RC5 0x20
1750 #define _PORTC_SDO 0x20
1751 #define _PORTC_SEG12 0x20
1752 #define _PORTC_RC6 0x40
1753 #define _PORTC_CK1 0x40
1754 #define _PORTC_TX1 0x40
1755 #define _PORTC_SEG27 0x40
1756 #define _PORTC_RC7 0x80
1757 #define _PORTC_DT1 0x80
1758 #define _PORTC_RX1 0x80
1759 #define _PORTC_SEG28 0x80
1761 //==============================================================================
1764 //==============================================================================
1765 // PORTD Bits
1767 extern __at(0x0F83) __sfr PORTD;
1769 typedef union
1771 struct
1773 unsigned RD0 : 1;
1774 unsigned RD1 : 1;
1775 unsigned RD2 : 1;
1776 unsigned RD3 : 1;
1777 unsigned RD4 : 1;
1778 unsigned RD5 : 1;
1779 unsigned RD6 : 1;
1780 unsigned RD7 : 1;
1783 struct
1785 unsigned SEG0 : 1;
1786 unsigned SEG1 : 1;
1787 unsigned SEG2 : 1;
1788 unsigned SEG3 : 1;
1789 unsigned SEG4 : 1;
1790 unsigned SEG5 : 1;
1791 unsigned SEG6 : 1;
1792 unsigned SEG7 : 1;
1794 } __PORTDbits_t;
1796 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1798 #define _PORTD_RD0 0x01
1799 #define _PORTD_SEG0 0x01
1800 #define _PORTD_RD1 0x02
1801 #define _PORTD_SEG1 0x02
1802 #define _PORTD_RD2 0x04
1803 #define _PORTD_SEG2 0x04
1804 #define _PORTD_RD3 0x08
1805 #define _PORTD_SEG3 0x08
1806 #define _PORTD_RD4 0x10
1807 #define _PORTD_SEG4 0x10
1808 #define _PORTD_RD5 0x20
1809 #define _PORTD_SEG5 0x20
1810 #define _PORTD_RD6 0x40
1811 #define _PORTD_SEG6 0x40
1812 #define _PORTD_RD7 0x80
1813 #define _PORTD_SEG7 0x80
1815 //==============================================================================
1818 //==============================================================================
1819 // PORTE Bits
1821 extern __at(0x0F84) __sfr PORTE;
1823 typedef union
1825 struct
1827 unsigned RE0 : 1;
1828 unsigned RE1 : 1;
1829 unsigned : 1;
1830 unsigned RE3 : 1;
1831 unsigned RE4 : 1;
1832 unsigned RE5 : 1;
1833 unsigned RE6 : 1;
1834 unsigned RE7 : 1;
1837 struct
1839 unsigned LCDBIAS1 : 1;
1840 unsigned LCDBIAS2 : 1;
1841 unsigned : 1;
1842 unsigned COM0 : 1;
1843 unsigned COM1 : 1;
1844 unsigned COM2 : 1;
1845 unsigned COM3 : 1;
1846 unsigned CCP2 : 1;
1849 struct
1851 unsigned : 1;
1852 unsigned : 1;
1853 unsigned : 1;
1854 unsigned : 1;
1855 unsigned : 1;
1856 unsigned : 1;
1857 unsigned : 1;
1858 unsigned SEG31 : 1;
1861 struct
1863 unsigned : 3;
1864 unsigned COM : 4;
1865 unsigned : 1;
1867 } __PORTEbits_t;
1869 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1871 #define _PORTE_RE0 0x01
1872 #define _PORTE_LCDBIAS1 0x01
1873 #define _PORTE_RE1 0x02
1874 #define _PORTE_LCDBIAS2 0x02
1875 #define _PORTE_RE3 0x08
1876 #define _PORTE_COM0 0x08
1877 #define _PORTE_RE4 0x10
1878 #define _PORTE_COM1 0x10
1879 #define _PORTE_RE5 0x20
1880 #define _PORTE_COM2 0x20
1881 #define _PORTE_RE6 0x40
1882 #define _PORTE_COM3 0x40
1883 #define _PORTE_RE7 0x80
1884 #define _PORTE_CCP2 0x80
1885 #define _PORTE_SEG31 0x80
1887 //==============================================================================
1890 //==============================================================================
1891 // PORTF Bits
1893 extern __at(0x0F85) __sfr PORTF;
1895 typedef union
1897 struct
1899 unsigned : 1;
1900 unsigned RF1 : 1;
1901 unsigned RF2 : 1;
1902 unsigned RF3 : 1;
1903 unsigned RF4 : 1;
1904 unsigned RF5 : 1;
1905 unsigned RF6 : 1;
1906 unsigned RF7 : 1;
1909 struct
1911 unsigned : 1;
1912 unsigned AN6 : 1;
1913 unsigned AN7 : 1;
1914 unsigned AN8 : 1;
1915 unsigned AN9 : 1;
1916 unsigned AN10 : 1;
1917 unsigned AN11 : 1;
1918 unsigned AN5 : 1;
1921 struct
1923 unsigned : 1;
1924 unsigned C2OUT : 1;
1925 unsigned C1OUT : 1;
1926 unsigned C2INB : 1;
1927 unsigned C2INA : 1;
1928 unsigned C1INB : 1;
1929 unsigned C1INA : 1;
1930 unsigned SS1 : 1;
1933 struct
1935 unsigned : 1;
1936 unsigned SEG19 : 1;
1937 unsigned SEG20 : 1;
1938 unsigned SEG21 : 1;
1939 unsigned SEG22 : 1;
1940 unsigned SEG23 : 1;
1941 unsigned SEG24 : 1;
1942 unsigned SEG25 : 1;
1945 struct
1947 unsigned : 1;
1948 unsigned : 1;
1949 unsigned : 1;
1950 unsigned : 1;
1951 unsigned : 1;
1952 unsigned CVREF : 1;
1953 unsigned : 1;
1954 unsigned : 1;
1956 } __PORTFbits_t;
1958 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
1960 #define _PORTF_RF1 0x02
1961 #define _PORTF_AN6 0x02
1962 #define _PORTF_C2OUT 0x02
1963 #define _PORTF_SEG19 0x02
1964 #define _PORTF_RF2 0x04
1965 #define _PORTF_AN7 0x04
1966 #define _PORTF_C1OUT 0x04
1967 #define _PORTF_SEG20 0x04
1968 #define _PORTF_RF3 0x08
1969 #define _PORTF_AN8 0x08
1970 #define _PORTF_C2INB 0x08
1971 #define _PORTF_SEG21 0x08
1972 #define _PORTF_RF4 0x10
1973 #define _PORTF_AN9 0x10
1974 #define _PORTF_C2INA 0x10
1975 #define _PORTF_SEG22 0x10
1976 #define _PORTF_RF5 0x20
1977 #define _PORTF_AN10 0x20
1978 #define _PORTF_C1INB 0x20
1979 #define _PORTF_SEG23 0x20
1980 #define _PORTF_CVREF 0x20
1981 #define _PORTF_RF6 0x40
1982 #define _PORTF_AN11 0x40
1983 #define _PORTF_C1INA 0x40
1984 #define _PORTF_SEG24 0x40
1985 #define _PORTF_RF7 0x80
1986 #define _PORTF_AN5 0x80
1987 #define _PORTF_SS1 0x80
1988 #define _PORTF_SEG25 0x80
1990 //==============================================================================
1993 //==============================================================================
1994 // PORTG Bits
1996 extern __at(0x0F86) __sfr PORTG;
1998 typedef union
2000 struct
2002 unsigned RG0 : 1;
2003 unsigned RG1 : 1;
2004 unsigned RG2 : 1;
2005 unsigned RG3 : 1;
2006 unsigned RG4 : 1;
2007 unsigned RJPU : 1;
2008 unsigned REPU : 1;
2009 unsigned RDPU : 1;
2012 struct
2014 unsigned LCDBIAS0 : 1;
2015 unsigned CK2 : 1;
2016 unsigned DT2 : 1;
2017 unsigned VLCAP2 : 1;
2018 unsigned SEG26 : 1;
2019 unsigned : 1;
2020 unsigned : 1;
2021 unsigned : 1;
2024 struct
2026 unsigned : 1;
2027 unsigned TX2 : 1;
2028 unsigned RX2 : 1;
2029 unsigned : 1;
2030 unsigned : 1;
2031 unsigned : 1;
2032 unsigned : 1;
2033 unsigned : 1;
2036 struct
2038 unsigned : 1;
2039 unsigned : 1;
2040 unsigned VLCAP1 : 1;
2041 unsigned : 1;
2042 unsigned : 1;
2043 unsigned : 1;
2044 unsigned : 1;
2045 unsigned : 1;
2048 struct
2050 unsigned RG : 5;
2051 unsigned : 3;
2053 } __PORTGbits_t;
2055 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
2057 #define _PORTG_RG0 0x01
2058 #define _PORTG_LCDBIAS0 0x01
2059 #define _PORTG_RG1 0x02
2060 #define _PORTG_CK2 0x02
2061 #define _PORTG_TX2 0x02
2062 #define _PORTG_RG2 0x04
2063 #define _PORTG_DT2 0x04
2064 #define _PORTG_RX2 0x04
2065 #define _PORTG_VLCAP1 0x04
2066 #define _PORTG_RG3 0x08
2067 #define _PORTG_VLCAP2 0x08
2068 #define _PORTG_RG4 0x10
2069 #define _PORTG_SEG26 0x10
2070 #define _PORTG_RJPU 0x20
2071 #define _PORTG_REPU 0x40
2072 #define _PORTG_RDPU 0x80
2074 //==============================================================================
2077 //==============================================================================
2078 // PORTH Bits
2080 extern __at(0x0F87) __sfr PORTH;
2082 typedef union
2084 struct
2086 unsigned RH0 : 1;
2087 unsigned RH1 : 1;
2088 unsigned RH2 : 1;
2089 unsigned RH3 : 1;
2090 unsigned RH4 : 1;
2091 unsigned RH5 : 1;
2092 unsigned RH6 : 1;
2093 unsigned RH7 : 1;
2096 struct
2098 unsigned SEG47 : 1;
2099 unsigned SEG46 : 1;
2100 unsigned SEG45 : 1;
2101 unsigned SEG44 : 1;
2102 unsigned SEG40 : 1;
2103 unsigned SEG41 : 1;
2104 unsigned SEG42 : 1;
2105 unsigned SEG43 : 1;
2107 } __PORTHbits_t;
2109 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
2111 #define _PORTH_RH0 0x01
2112 #define _PORTH_SEG47 0x01
2113 #define _PORTH_RH1 0x02
2114 #define _PORTH_SEG46 0x02
2115 #define _PORTH_RH2 0x04
2116 #define _PORTH_SEG45 0x04
2117 #define _PORTH_RH3 0x08
2118 #define _PORTH_SEG44 0x08
2119 #define _PORTH_RH4 0x10
2120 #define _PORTH_SEG40 0x10
2121 #define _PORTH_RH5 0x20
2122 #define _PORTH_SEG41 0x20
2123 #define _PORTH_RH6 0x40
2124 #define _PORTH_SEG42 0x40
2125 #define _PORTH_RH7 0x80
2126 #define _PORTH_SEG43 0x80
2128 //==============================================================================
2131 //==============================================================================
2132 // PORTJ Bits
2134 extern __at(0x0F88) __sfr PORTJ;
2136 typedef union
2138 struct
2140 unsigned RJ0 : 1;
2141 unsigned RJ1 : 1;
2142 unsigned RJ2 : 1;
2143 unsigned RJ3 : 1;
2144 unsigned RJ4 : 1;
2145 unsigned RJ5 : 1;
2146 unsigned RJ6 : 1;
2147 unsigned RJ7 : 1;
2150 struct
2152 unsigned : 1;
2153 unsigned SEG33 : 1;
2154 unsigned SEG34 : 1;
2155 unsigned SEG35 : 1;
2156 unsigned SEG39 : 1;
2157 unsigned SEG38 : 1;
2158 unsigned SEG37 : 1;
2159 unsigned SEG36 : 1;
2161 } __PORTJbits_t;
2163 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
2165 #define _PORTJ_RJ0 0x01
2166 #define _PORTJ_RJ1 0x02
2167 #define _PORTJ_SEG33 0x02
2168 #define _PORTJ_RJ2 0x04
2169 #define _PORTJ_SEG34 0x04
2170 #define _PORTJ_RJ3 0x08
2171 #define _PORTJ_SEG35 0x08
2172 #define _PORTJ_RJ4 0x10
2173 #define _PORTJ_SEG39 0x10
2174 #define _PORTJ_RJ5 0x20
2175 #define _PORTJ_SEG38 0x20
2176 #define _PORTJ_RJ6 0x40
2177 #define _PORTJ_SEG37 0x40
2178 #define _PORTJ_RJ7 0x80
2179 #define _PORTJ_SEG36 0x80
2181 //==============================================================================
2184 //==============================================================================
2185 // LATA Bits
2187 extern __at(0x0F89) __sfr LATA;
2189 typedef struct
2191 unsigned LATA0 : 1;
2192 unsigned LATA1 : 1;
2193 unsigned LATA2 : 1;
2194 unsigned LATA3 : 1;
2195 unsigned LATA4 : 1;
2196 unsigned LATA5 : 1;
2197 unsigned LATA6 : 1;
2198 unsigned LATA7 : 1;
2199 } __LATAbits_t;
2201 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2203 #define _LATA0 0x01
2204 #define _LATA1 0x02
2205 #define _LATA2 0x04
2206 #define _LATA3 0x08
2207 #define _LATA4 0x10
2208 #define _LATA5 0x20
2209 #define _LATA6 0x40
2210 #define _LATA7 0x80
2212 //==============================================================================
2215 //==============================================================================
2216 // LATB Bits
2218 extern __at(0x0F8A) __sfr LATB;
2220 typedef struct
2222 unsigned LATB0 : 1;
2223 unsigned LATB1 : 1;
2224 unsigned LATB2 : 1;
2225 unsigned LATB3 : 1;
2226 unsigned LATB4 : 1;
2227 unsigned LATB5 : 1;
2228 unsigned LATB6 : 1;
2229 unsigned LATB7 : 1;
2230 } __LATBbits_t;
2232 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2234 #define _LATB0 0x01
2235 #define _LATB1 0x02
2236 #define _LATB2 0x04
2237 #define _LATB3 0x08
2238 #define _LATB4 0x10
2239 #define _LATB5 0x20
2240 #define _LATB6 0x40
2241 #define _LATB7 0x80
2243 //==============================================================================
2246 //==============================================================================
2247 // LATC Bits
2249 extern __at(0x0F8B) __sfr LATC;
2251 typedef struct
2253 unsigned LATC0 : 1;
2254 unsigned LATC1 : 1;
2255 unsigned LATC2 : 1;
2256 unsigned LATC3 : 1;
2257 unsigned LATC4 : 1;
2258 unsigned LATC5 : 1;
2259 unsigned LATC6 : 1;
2260 unsigned LATC7 : 1;
2261 } __LATCbits_t;
2263 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2265 #define _LATC0 0x01
2266 #define _LATC1 0x02
2267 #define _LATC2 0x04
2268 #define _LATC3 0x08
2269 #define _LATC4 0x10
2270 #define _LATC5 0x20
2271 #define _LATC6 0x40
2272 #define _LATC7 0x80
2274 //==============================================================================
2277 //==============================================================================
2278 // LATD Bits
2280 extern __at(0x0F8C) __sfr LATD;
2282 typedef struct
2284 unsigned LATD0 : 1;
2285 unsigned LATD1 : 1;
2286 unsigned LATD2 : 1;
2287 unsigned LATD3 : 1;
2288 unsigned LATD4 : 1;
2289 unsigned LATD5 : 1;
2290 unsigned LATD6 : 1;
2291 unsigned LATD7 : 1;
2292 } __LATDbits_t;
2294 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2296 #define _LATD0 0x01
2297 #define _LATD1 0x02
2298 #define _LATD2 0x04
2299 #define _LATD3 0x08
2300 #define _LATD4 0x10
2301 #define _LATD5 0x20
2302 #define _LATD6 0x40
2303 #define _LATD7 0x80
2305 //==============================================================================
2308 //==============================================================================
2309 // LATE Bits
2311 extern __at(0x0F8D) __sfr LATE;
2313 typedef struct
2315 unsigned LATE0 : 1;
2316 unsigned LATE1 : 1;
2317 unsigned : 1;
2318 unsigned LATE3 : 1;
2319 unsigned LATE4 : 1;
2320 unsigned LATE5 : 1;
2321 unsigned LATE6 : 1;
2322 unsigned LATE7 : 1;
2323 } __LATEbits_t;
2325 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2327 #define _LATE0 0x01
2328 #define _LATE1 0x02
2329 #define _LATE3 0x08
2330 #define _LATE4 0x10
2331 #define _LATE5 0x20
2332 #define _LATE6 0x40
2333 #define _LATE7 0x80
2335 //==============================================================================
2338 //==============================================================================
2339 // LATF Bits
2341 extern __at(0x0F8E) __sfr LATF;
2343 typedef struct
2345 unsigned : 1;
2346 unsigned LATF1 : 1;
2347 unsigned LATF2 : 1;
2348 unsigned LATF3 : 1;
2349 unsigned LATF4 : 1;
2350 unsigned LATF5 : 1;
2351 unsigned LATF6 : 1;
2352 unsigned LATF7 : 1;
2353 } __LATFbits_t;
2355 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
2357 #define _LATF1 0x02
2358 #define _LATF2 0x04
2359 #define _LATF3 0x08
2360 #define _LATF4 0x10
2361 #define _LATF5 0x20
2362 #define _LATF6 0x40
2363 #define _LATF7 0x80
2365 //==============================================================================
2368 //==============================================================================
2369 // LATG Bits
2371 extern __at(0x0F8F) __sfr LATG;
2373 typedef union
2375 struct
2377 unsigned LATG0 : 1;
2378 unsigned LATG1 : 1;
2379 unsigned LATG2 : 1;
2380 unsigned LATG3 : 1;
2381 unsigned LATG4 : 1;
2382 unsigned : 1;
2383 unsigned U1OD : 1;
2384 unsigned U2OD : 1;
2387 struct
2389 unsigned LATG : 5;
2390 unsigned : 3;
2392 } __LATGbits_t;
2394 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2396 #define _LATG0 0x01
2397 #define _LATG1 0x02
2398 #define _LATG2 0x04
2399 #define _LATG3 0x08
2400 #define _LATG4 0x10
2401 #define _U1OD 0x40
2402 #define _U2OD 0x80
2404 //==============================================================================
2407 //==============================================================================
2408 // LATH Bits
2410 extern __at(0x0F90) __sfr LATH;
2412 typedef struct
2414 unsigned LATH0 : 1;
2415 unsigned LATH1 : 1;
2416 unsigned LATH2 : 1;
2417 unsigned LATH3 : 1;
2418 unsigned LATH4 : 1;
2419 unsigned LATH5 : 1;
2420 unsigned LATH6 : 1;
2421 unsigned LATH7 : 1;
2422 } __LATHbits_t;
2424 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
2426 #define _LATH0 0x01
2427 #define _LATH1 0x02
2428 #define _LATH2 0x04
2429 #define _LATH3 0x08
2430 #define _LATH4 0x10
2431 #define _LATH5 0x20
2432 #define _LATH6 0x40
2433 #define _LATH7 0x80
2435 //==============================================================================
2438 //==============================================================================
2439 // LATJ Bits
2441 extern __at(0x0F91) __sfr LATJ;
2443 typedef struct
2445 unsigned LATJ0 : 1;
2446 unsigned LATJ1 : 1;
2447 unsigned LATJ2 : 1;
2448 unsigned LATJ3 : 1;
2449 unsigned LATJ4 : 1;
2450 unsigned LATJ5 : 1;
2451 unsigned LATJ6 : 1;
2452 unsigned LATJ7 : 1;
2453 } __LATJbits_t;
2455 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
2457 #define _LATJ0 0x01
2458 #define _LATJ1 0x02
2459 #define _LATJ2 0x04
2460 #define _LATJ3 0x08
2461 #define _LATJ4 0x10
2462 #define _LATJ5 0x20
2463 #define _LATJ6 0x40
2464 #define _LATJ7 0x80
2466 //==============================================================================
2469 //==============================================================================
2470 // DDRA Bits
2472 extern __at(0x0F92) __sfr DDRA;
2474 typedef union
2476 struct
2478 unsigned TRISA0 : 1;
2479 unsigned TRISA1 : 1;
2480 unsigned TRISA2 : 1;
2481 unsigned TRISA3 : 1;
2482 unsigned TRISA4 : 1;
2483 unsigned TRISA5 : 1;
2484 unsigned TRISA6 : 1;
2485 unsigned TRISA7 : 1;
2488 struct
2490 unsigned RA0 : 1;
2491 unsigned RA1 : 1;
2492 unsigned RA2 : 1;
2493 unsigned RA3 : 1;
2494 unsigned RA4 : 1;
2495 unsigned RA5 : 1;
2496 unsigned RA6 : 1;
2497 unsigned RA7 : 1;
2499 } __DDRAbits_t;
2501 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2503 #define _TRISA0 0x01
2504 #define _RA0 0x01
2505 #define _TRISA1 0x02
2506 #define _RA1 0x02
2507 #define _TRISA2 0x04
2508 #define _RA2 0x04
2509 #define _TRISA3 0x08
2510 #define _RA3 0x08
2511 #define _TRISA4 0x10
2512 #define _RA4 0x10
2513 #define _TRISA5 0x20
2514 #define _RA5 0x20
2515 #define _TRISA6 0x40
2516 #define _RA6 0x40
2517 #define _TRISA7 0x80
2518 #define _RA7 0x80
2520 //==============================================================================
2523 //==============================================================================
2524 // TRISA Bits
2526 extern __at(0x0F92) __sfr TRISA;
2528 typedef union
2530 struct
2532 unsigned TRISA0 : 1;
2533 unsigned TRISA1 : 1;
2534 unsigned TRISA2 : 1;
2535 unsigned TRISA3 : 1;
2536 unsigned TRISA4 : 1;
2537 unsigned TRISA5 : 1;
2538 unsigned TRISA6 : 1;
2539 unsigned TRISA7 : 1;
2542 struct
2544 unsigned RA0 : 1;
2545 unsigned RA1 : 1;
2546 unsigned RA2 : 1;
2547 unsigned RA3 : 1;
2548 unsigned RA4 : 1;
2549 unsigned RA5 : 1;
2550 unsigned RA6 : 1;
2551 unsigned RA7 : 1;
2553 } __TRISAbits_t;
2555 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2557 #define _TRISA_TRISA0 0x01
2558 #define _TRISA_RA0 0x01
2559 #define _TRISA_TRISA1 0x02
2560 #define _TRISA_RA1 0x02
2561 #define _TRISA_TRISA2 0x04
2562 #define _TRISA_RA2 0x04
2563 #define _TRISA_TRISA3 0x08
2564 #define _TRISA_RA3 0x08
2565 #define _TRISA_TRISA4 0x10
2566 #define _TRISA_RA4 0x10
2567 #define _TRISA_TRISA5 0x20
2568 #define _TRISA_RA5 0x20
2569 #define _TRISA_TRISA6 0x40
2570 #define _TRISA_RA6 0x40
2571 #define _TRISA_TRISA7 0x80
2572 #define _TRISA_RA7 0x80
2574 //==============================================================================
2577 //==============================================================================
2578 // DDRB Bits
2580 extern __at(0x0F93) __sfr DDRB;
2582 typedef union
2584 struct
2586 unsigned TRISB0 : 1;
2587 unsigned TRISB1 : 1;
2588 unsigned TRISB2 : 1;
2589 unsigned TRISB3 : 1;
2590 unsigned TRISB4 : 1;
2591 unsigned TRISB5 : 1;
2592 unsigned TRISB6 : 1;
2593 unsigned TRISB7 : 1;
2596 struct
2598 unsigned RB0 : 1;
2599 unsigned RB1 : 1;
2600 unsigned RB2 : 1;
2601 unsigned RB3 : 1;
2602 unsigned RB4 : 1;
2603 unsigned RB5 : 1;
2604 unsigned RB6 : 1;
2605 unsigned RB7 : 1;
2607 } __DDRBbits_t;
2609 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2611 #define _TRISB0 0x01
2612 #define _RB0 0x01
2613 #define _TRISB1 0x02
2614 #define _RB1 0x02
2615 #define _TRISB2 0x04
2616 #define _RB2 0x04
2617 #define _TRISB3 0x08
2618 #define _RB3 0x08
2619 #define _TRISB4 0x10
2620 #define _RB4 0x10
2621 #define _TRISB5 0x20
2622 #define _RB5 0x20
2623 #define _TRISB6 0x40
2624 #define _RB6 0x40
2625 #define _TRISB7 0x80
2626 #define _RB7 0x80
2628 //==============================================================================
2631 //==============================================================================
2632 // TRISB Bits
2634 extern __at(0x0F93) __sfr TRISB;
2636 typedef union
2638 struct
2640 unsigned TRISB0 : 1;
2641 unsigned TRISB1 : 1;
2642 unsigned TRISB2 : 1;
2643 unsigned TRISB3 : 1;
2644 unsigned TRISB4 : 1;
2645 unsigned TRISB5 : 1;
2646 unsigned TRISB6 : 1;
2647 unsigned TRISB7 : 1;
2650 struct
2652 unsigned RB0 : 1;
2653 unsigned RB1 : 1;
2654 unsigned RB2 : 1;
2655 unsigned RB3 : 1;
2656 unsigned RB4 : 1;
2657 unsigned RB5 : 1;
2658 unsigned RB6 : 1;
2659 unsigned RB7 : 1;
2661 } __TRISBbits_t;
2663 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2665 #define _TRISB_TRISB0 0x01
2666 #define _TRISB_RB0 0x01
2667 #define _TRISB_TRISB1 0x02
2668 #define _TRISB_RB1 0x02
2669 #define _TRISB_TRISB2 0x04
2670 #define _TRISB_RB2 0x04
2671 #define _TRISB_TRISB3 0x08
2672 #define _TRISB_RB3 0x08
2673 #define _TRISB_TRISB4 0x10
2674 #define _TRISB_RB4 0x10
2675 #define _TRISB_TRISB5 0x20
2676 #define _TRISB_RB5 0x20
2677 #define _TRISB_TRISB6 0x40
2678 #define _TRISB_RB6 0x40
2679 #define _TRISB_TRISB7 0x80
2680 #define _TRISB_RB7 0x80
2682 //==============================================================================
2685 //==============================================================================
2686 // DDRC Bits
2688 extern __at(0x0F94) __sfr DDRC;
2690 typedef union
2692 struct
2694 unsigned TRISC0 : 1;
2695 unsigned TRISC1 : 1;
2696 unsigned TRISC2 : 1;
2697 unsigned TRISC3 : 1;
2698 unsigned TRISC4 : 1;
2699 unsigned TRISC5 : 1;
2700 unsigned TRISC6 : 1;
2701 unsigned TRISC7 : 1;
2704 struct
2706 unsigned RC0 : 1;
2707 unsigned RC1 : 1;
2708 unsigned RC2 : 1;
2709 unsigned RC3 : 1;
2710 unsigned RC4 : 1;
2711 unsigned RC5 : 1;
2712 unsigned RC6 : 1;
2713 unsigned RC7 : 1;
2715 } __DDRCbits_t;
2717 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2719 #define _TRISC0 0x01
2720 #define _RC0 0x01
2721 #define _TRISC1 0x02
2722 #define _RC1 0x02
2723 #define _TRISC2 0x04
2724 #define _RC2 0x04
2725 #define _TRISC3 0x08
2726 #define _RC3 0x08
2727 #define _TRISC4 0x10
2728 #define _RC4 0x10
2729 #define _TRISC5 0x20
2730 #define _RC5 0x20
2731 #define _TRISC6 0x40
2732 #define _RC6 0x40
2733 #define _TRISC7 0x80
2734 #define _RC7 0x80
2736 //==============================================================================
2739 //==============================================================================
2740 // TRISC Bits
2742 extern __at(0x0F94) __sfr TRISC;
2744 typedef union
2746 struct
2748 unsigned TRISC0 : 1;
2749 unsigned TRISC1 : 1;
2750 unsigned TRISC2 : 1;
2751 unsigned TRISC3 : 1;
2752 unsigned TRISC4 : 1;
2753 unsigned TRISC5 : 1;
2754 unsigned TRISC6 : 1;
2755 unsigned TRISC7 : 1;
2758 struct
2760 unsigned RC0 : 1;
2761 unsigned RC1 : 1;
2762 unsigned RC2 : 1;
2763 unsigned RC3 : 1;
2764 unsigned RC4 : 1;
2765 unsigned RC5 : 1;
2766 unsigned RC6 : 1;
2767 unsigned RC7 : 1;
2769 } __TRISCbits_t;
2771 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2773 #define _TRISC_TRISC0 0x01
2774 #define _TRISC_RC0 0x01
2775 #define _TRISC_TRISC1 0x02
2776 #define _TRISC_RC1 0x02
2777 #define _TRISC_TRISC2 0x04
2778 #define _TRISC_RC2 0x04
2779 #define _TRISC_TRISC3 0x08
2780 #define _TRISC_RC3 0x08
2781 #define _TRISC_TRISC4 0x10
2782 #define _TRISC_RC4 0x10
2783 #define _TRISC_TRISC5 0x20
2784 #define _TRISC_RC5 0x20
2785 #define _TRISC_TRISC6 0x40
2786 #define _TRISC_RC6 0x40
2787 #define _TRISC_TRISC7 0x80
2788 #define _TRISC_RC7 0x80
2790 //==============================================================================
2793 //==============================================================================
2794 // DDRD Bits
2796 extern __at(0x0F95) __sfr DDRD;
2798 typedef union
2800 struct
2802 unsigned TRISD0 : 1;
2803 unsigned TRISD1 : 1;
2804 unsigned TRISD2 : 1;
2805 unsigned TRISD3 : 1;
2806 unsigned TRISD4 : 1;
2807 unsigned TRISD5 : 1;
2808 unsigned TRISD6 : 1;
2809 unsigned TRISD7 : 1;
2812 struct
2814 unsigned RD0 : 1;
2815 unsigned RD1 : 1;
2816 unsigned RD2 : 1;
2817 unsigned RD3 : 1;
2818 unsigned RD4 : 1;
2819 unsigned RD5 : 1;
2820 unsigned RD6 : 1;
2821 unsigned RD7 : 1;
2823 } __DDRDbits_t;
2825 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2827 #define _TRISD0 0x01
2828 #define _RD0 0x01
2829 #define _TRISD1 0x02
2830 #define _RD1 0x02
2831 #define _TRISD2 0x04
2832 #define _RD2 0x04
2833 #define _TRISD3 0x08
2834 #define _RD3 0x08
2835 #define _TRISD4 0x10
2836 #define _RD4 0x10
2837 #define _TRISD5 0x20
2838 #define _RD5 0x20
2839 #define _TRISD6 0x40
2840 #define _RD6 0x40
2841 #define _TRISD7 0x80
2842 #define _RD7 0x80
2844 //==============================================================================
2847 //==============================================================================
2848 // TRISD Bits
2850 extern __at(0x0F95) __sfr TRISD;
2852 typedef union
2854 struct
2856 unsigned TRISD0 : 1;
2857 unsigned TRISD1 : 1;
2858 unsigned TRISD2 : 1;
2859 unsigned TRISD3 : 1;
2860 unsigned TRISD4 : 1;
2861 unsigned TRISD5 : 1;
2862 unsigned TRISD6 : 1;
2863 unsigned TRISD7 : 1;
2866 struct
2868 unsigned RD0 : 1;
2869 unsigned RD1 : 1;
2870 unsigned RD2 : 1;
2871 unsigned RD3 : 1;
2872 unsigned RD4 : 1;
2873 unsigned RD5 : 1;
2874 unsigned RD6 : 1;
2875 unsigned RD7 : 1;
2877 } __TRISDbits_t;
2879 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2881 #define _TRISD_TRISD0 0x01
2882 #define _TRISD_RD0 0x01
2883 #define _TRISD_TRISD1 0x02
2884 #define _TRISD_RD1 0x02
2885 #define _TRISD_TRISD2 0x04
2886 #define _TRISD_RD2 0x04
2887 #define _TRISD_TRISD3 0x08
2888 #define _TRISD_RD3 0x08
2889 #define _TRISD_TRISD4 0x10
2890 #define _TRISD_RD4 0x10
2891 #define _TRISD_TRISD5 0x20
2892 #define _TRISD_RD5 0x20
2893 #define _TRISD_TRISD6 0x40
2894 #define _TRISD_RD6 0x40
2895 #define _TRISD_TRISD7 0x80
2896 #define _TRISD_RD7 0x80
2898 //==============================================================================
2901 //==============================================================================
2902 // DDRE Bits
2904 extern __at(0x0F96) __sfr DDRE;
2906 typedef union
2908 struct
2910 unsigned TRISE0 : 1;
2911 unsigned TRISE1 : 1;
2912 unsigned : 1;
2913 unsigned TRISE3 : 1;
2914 unsigned TRISE4 : 1;
2915 unsigned TRISE5 : 1;
2916 unsigned TRISE6 : 1;
2917 unsigned TRISE7 : 1;
2920 struct
2922 unsigned RE0 : 1;
2923 unsigned RE1 : 1;
2924 unsigned : 1;
2925 unsigned RE3 : 1;
2926 unsigned RE4 : 1;
2927 unsigned RE5 : 1;
2928 unsigned RE6 : 1;
2929 unsigned RE7 : 1;
2931 } __DDREbits_t;
2933 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2935 #define _TRISE0 0x01
2936 #define _RE0 0x01
2937 #define _TRISE1 0x02
2938 #define _RE1 0x02
2939 #define _TRISE3 0x08
2940 #define _RE3 0x08
2941 #define _TRISE4 0x10
2942 #define _RE4 0x10
2943 #define _TRISE5 0x20
2944 #define _RE5 0x20
2945 #define _TRISE6 0x40
2946 #define _RE6 0x40
2947 #define _TRISE7 0x80
2948 #define _RE7 0x80
2950 //==============================================================================
2953 //==============================================================================
2954 // TRISE Bits
2956 extern __at(0x0F96) __sfr TRISE;
2958 typedef union
2960 struct
2962 unsigned TRISE0 : 1;
2963 unsigned TRISE1 : 1;
2964 unsigned : 1;
2965 unsigned TRISE3 : 1;
2966 unsigned TRISE4 : 1;
2967 unsigned TRISE5 : 1;
2968 unsigned TRISE6 : 1;
2969 unsigned TRISE7 : 1;
2972 struct
2974 unsigned RE0 : 1;
2975 unsigned RE1 : 1;
2976 unsigned : 1;
2977 unsigned RE3 : 1;
2978 unsigned RE4 : 1;
2979 unsigned RE5 : 1;
2980 unsigned RE6 : 1;
2981 unsigned RE7 : 1;
2983 } __TRISEbits_t;
2985 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2987 #define _TRISE_TRISE0 0x01
2988 #define _TRISE_RE0 0x01
2989 #define _TRISE_TRISE1 0x02
2990 #define _TRISE_RE1 0x02
2991 #define _TRISE_TRISE3 0x08
2992 #define _TRISE_RE3 0x08
2993 #define _TRISE_TRISE4 0x10
2994 #define _TRISE_RE4 0x10
2995 #define _TRISE_TRISE5 0x20
2996 #define _TRISE_RE5 0x20
2997 #define _TRISE_TRISE6 0x40
2998 #define _TRISE_RE6 0x40
2999 #define _TRISE_TRISE7 0x80
3000 #define _TRISE_RE7 0x80
3002 //==============================================================================
3005 //==============================================================================
3006 // DDRF Bits
3008 extern __at(0x0F97) __sfr DDRF;
3010 typedef union
3012 struct
3014 unsigned : 1;
3015 unsigned TRISF1 : 1;
3016 unsigned TRISF2 : 1;
3017 unsigned TRISF3 : 1;
3018 unsigned TRISF4 : 1;
3019 unsigned TRISF5 : 1;
3020 unsigned TRISF6 : 1;
3021 unsigned TRISF7 : 1;
3024 struct
3026 unsigned : 1;
3027 unsigned RF1 : 1;
3028 unsigned RF2 : 1;
3029 unsigned RF3 : 1;
3030 unsigned RF4 : 1;
3031 unsigned RF5 : 1;
3032 unsigned RF6 : 1;
3033 unsigned RF7 : 1;
3035 } __DDRFbits_t;
3037 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
3039 #define _TRISF1 0x02
3040 #define _RF1 0x02
3041 #define _TRISF2 0x04
3042 #define _RF2 0x04
3043 #define _TRISF3 0x08
3044 #define _RF3 0x08
3045 #define _TRISF4 0x10
3046 #define _RF4 0x10
3047 #define _TRISF5 0x20
3048 #define _RF5 0x20
3049 #define _TRISF6 0x40
3050 #define _RF6 0x40
3051 #define _TRISF7 0x80
3052 #define _RF7 0x80
3054 //==============================================================================
3057 //==============================================================================
3058 // TRISF Bits
3060 extern __at(0x0F97) __sfr TRISF;
3062 typedef union
3064 struct
3066 unsigned : 1;
3067 unsigned TRISF1 : 1;
3068 unsigned TRISF2 : 1;
3069 unsigned TRISF3 : 1;
3070 unsigned TRISF4 : 1;
3071 unsigned TRISF5 : 1;
3072 unsigned TRISF6 : 1;
3073 unsigned TRISF7 : 1;
3076 struct
3078 unsigned : 1;
3079 unsigned RF1 : 1;
3080 unsigned RF2 : 1;
3081 unsigned RF3 : 1;
3082 unsigned RF4 : 1;
3083 unsigned RF5 : 1;
3084 unsigned RF6 : 1;
3085 unsigned RF7 : 1;
3087 } __TRISFbits_t;
3089 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
3091 #define _TRISF_TRISF1 0x02
3092 #define _TRISF_RF1 0x02
3093 #define _TRISF_TRISF2 0x04
3094 #define _TRISF_RF2 0x04
3095 #define _TRISF_TRISF3 0x08
3096 #define _TRISF_RF3 0x08
3097 #define _TRISF_TRISF4 0x10
3098 #define _TRISF_RF4 0x10
3099 #define _TRISF_TRISF5 0x20
3100 #define _TRISF_RF5 0x20
3101 #define _TRISF_TRISF6 0x40
3102 #define _TRISF_RF6 0x40
3103 #define _TRISF_TRISF7 0x80
3104 #define _TRISF_RF7 0x80
3106 //==============================================================================
3109 //==============================================================================
3110 // DDRG Bits
3112 extern __at(0x0F98) __sfr DDRG;
3114 typedef union
3116 struct
3118 unsigned TRISG0 : 1;
3119 unsigned TRISG1 : 1;
3120 unsigned TRISG2 : 1;
3121 unsigned TRISG3 : 1;
3122 unsigned TRISG4 : 1;
3123 unsigned CCP1OD : 1;
3124 unsigned CCP2OD : 1;
3125 unsigned SPIOD : 1;
3128 struct
3130 unsigned RG0 : 1;
3131 unsigned RG1 : 1;
3132 unsigned RG2 : 1;
3133 unsigned RG3 : 1;
3134 unsigned RG4 : 1;
3135 unsigned : 1;
3136 unsigned : 1;
3137 unsigned : 1;
3140 struct
3142 unsigned TRISG : 5;
3143 unsigned : 3;
3146 struct
3148 unsigned RG : 5;
3149 unsigned : 3;
3151 } __DDRGbits_t;
3153 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
3155 #define _TRISG0 0x01
3156 #define _RG0 0x01
3157 #define _TRISG1 0x02
3158 #define _RG1 0x02
3159 #define _TRISG2 0x04
3160 #define _RG2 0x04
3161 #define _TRISG3 0x08
3162 #define _RG3 0x08
3163 #define _TRISG4 0x10
3164 #define _RG4 0x10
3165 #define _CCP1OD 0x20
3166 #define _CCP2OD 0x40
3167 #define _SPIOD 0x80
3169 //==============================================================================
3172 //==============================================================================
3173 // TRISG Bits
3175 extern __at(0x0F98) __sfr TRISG;
3177 typedef union
3179 struct
3181 unsigned TRISG0 : 1;
3182 unsigned TRISG1 : 1;
3183 unsigned TRISG2 : 1;
3184 unsigned TRISG3 : 1;
3185 unsigned TRISG4 : 1;
3186 unsigned CCP1OD : 1;
3187 unsigned CCP2OD : 1;
3188 unsigned SPIOD : 1;
3191 struct
3193 unsigned RG0 : 1;
3194 unsigned RG1 : 1;
3195 unsigned RG2 : 1;
3196 unsigned RG3 : 1;
3197 unsigned RG4 : 1;
3198 unsigned : 1;
3199 unsigned : 1;
3200 unsigned : 1;
3203 struct
3205 unsigned RG : 5;
3206 unsigned : 3;
3209 struct
3211 unsigned TRISG : 5;
3212 unsigned : 3;
3214 } __TRISGbits_t;
3216 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
3218 #define _TRISG_TRISG0 0x01
3219 #define _TRISG_RG0 0x01
3220 #define _TRISG_TRISG1 0x02
3221 #define _TRISG_RG1 0x02
3222 #define _TRISG_TRISG2 0x04
3223 #define _TRISG_RG2 0x04
3224 #define _TRISG_TRISG3 0x08
3225 #define _TRISG_RG3 0x08
3226 #define _TRISG_TRISG4 0x10
3227 #define _TRISG_RG4 0x10
3228 #define _TRISG_CCP1OD 0x20
3229 #define _TRISG_CCP2OD 0x40
3230 #define _TRISG_SPIOD 0x80
3232 //==============================================================================
3235 //==============================================================================
3236 // DDRH Bits
3238 extern __at(0x0F99) __sfr DDRH;
3240 typedef union
3242 struct
3244 unsigned TRISH0 : 1;
3245 unsigned TRISH1 : 1;
3246 unsigned TRISH2 : 1;
3247 unsigned TRISH3 : 1;
3248 unsigned TRISH4 : 1;
3249 unsigned TRISH5 : 1;
3250 unsigned TRISH6 : 1;
3251 unsigned TRISH7 : 1;
3254 struct
3256 unsigned RH0 : 1;
3257 unsigned RH1 : 1;
3258 unsigned RH2 : 1;
3259 unsigned RH3 : 1;
3260 unsigned RH4 : 1;
3261 unsigned RH5 : 1;
3262 unsigned RH6 : 1;
3263 unsigned RH7 : 1;
3265 } __DDRHbits_t;
3267 extern __at(0x0F99) volatile __DDRHbits_t DDRHbits;
3269 #define _TRISH0 0x01
3270 #define _RH0 0x01
3271 #define _TRISH1 0x02
3272 #define _RH1 0x02
3273 #define _TRISH2 0x04
3274 #define _RH2 0x04
3275 #define _TRISH3 0x08
3276 #define _RH3 0x08
3277 #define _TRISH4 0x10
3278 #define _RH4 0x10
3279 #define _TRISH5 0x20
3280 #define _RH5 0x20
3281 #define _TRISH6 0x40
3282 #define _RH6 0x40
3283 #define _TRISH7 0x80
3284 #define _RH7 0x80
3286 //==============================================================================
3289 //==============================================================================
3290 // TRISH Bits
3292 extern __at(0x0F99) __sfr TRISH;
3294 typedef union
3296 struct
3298 unsigned TRISH0 : 1;
3299 unsigned TRISH1 : 1;
3300 unsigned TRISH2 : 1;
3301 unsigned TRISH3 : 1;
3302 unsigned TRISH4 : 1;
3303 unsigned TRISH5 : 1;
3304 unsigned TRISH6 : 1;
3305 unsigned TRISH7 : 1;
3308 struct
3310 unsigned RH0 : 1;
3311 unsigned RH1 : 1;
3312 unsigned RH2 : 1;
3313 unsigned RH3 : 1;
3314 unsigned RH4 : 1;
3315 unsigned RH5 : 1;
3316 unsigned RH6 : 1;
3317 unsigned RH7 : 1;
3319 } __TRISHbits_t;
3321 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
3323 #define _TRISH_TRISH0 0x01
3324 #define _TRISH_RH0 0x01
3325 #define _TRISH_TRISH1 0x02
3326 #define _TRISH_RH1 0x02
3327 #define _TRISH_TRISH2 0x04
3328 #define _TRISH_RH2 0x04
3329 #define _TRISH_TRISH3 0x08
3330 #define _TRISH_RH3 0x08
3331 #define _TRISH_TRISH4 0x10
3332 #define _TRISH_RH4 0x10
3333 #define _TRISH_TRISH5 0x20
3334 #define _TRISH_RH5 0x20
3335 #define _TRISH_TRISH6 0x40
3336 #define _TRISH_RH6 0x40
3337 #define _TRISH_TRISH7 0x80
3338 #define _TRISH_RH7 0x80
3340 //==============================================================================
3343 //==============================================================================
3344 // DDRJ Bits
3346 extern __at(0x0F9A) __sfr DDRJ;
3348 typedef union
3350 struct
3352 unsigned TRISJ0 : 1;
3353 unsigned TRISJ1 : 1;
3354 unsigned TRISJ2 : 1;
3355 unsigned TRISJ3 : 1;
3356 unsigned TRISJ4 : 1;
3357 unsigned TRISJ5 : 1;
3358 unsigned TRISJ6 : 1;
3359 unsigned TRISJ7 : 1;
3362 struct
3364 unsigned RJ0 : 1;
3365 unsigned RJ1 : 1;
3366 unsigned RJ2 : 1;
3367 unsigned RJ3 : 1;
3368 unsigned RJ4 : 1;
3369 unsigned RJ5 : 1;
3370 unsigned RJ6 : 1;
3371 unsigned RJ7 : 1;
3373 } __DDRJbits_t;
3375 extern __at(0x0F9A) volatile __DDRJbits_t DDRJbits;
3377 #define _TRISJ0 0x01
3378 #define _RJ0 0x01
3379 #define _TRISJ1 0x02
3380 #define _RJ1 0x02
3381 #define _TRISJ2 0x04
3382 #define _RJ2 0x04
3383 #define _TRISJ3 0x08
3384 #define _RJ3 0x08
3385 #define _TRISJ4 0x10
3386 #define _RJ4 0x10
3387 #define _TRISJ5 0x20
3388 #define _RJ5 0x20
3389 #define _TRISJ6 0x40
3390 #define _RJ6 0x40
3391 #define _TRISJ7 0x80
3392 #define _RJ7 0x80
3394 //==============================================================================
3397 //==============================================================================
3398 // TRISJ Bits
3400 extern __at(0x0F9A) __sfr TRISJ;
3402 typedef union
3404 struct
3406 unsigned TRISJ0 : 1;
3407 unsigned TRISJ1 : 1;
3408 unsigned TRISJ2 : 1;
3409 unsigned TRISJ3 : 1;
3410 unsigned TRISJ4 : 1;
3411 unsigned TRISJ5 : 1;
3412 unsigned TRISJ6 : 1;
3413 unsigned TRISJ7 : 1;
3416 struct
3418 unsigned RJ0 : 1;
3419 unsigned RJ1 : 1;
3420 unsigned RJ2 : 1;
3421 unsigned RJ3 : 1;
3422 unsigned RJ4 : 1;
3423 unsigned RJ5 : 1;
3424 unsigned RJ6 : 1;
3425 unsigned RJ7 : 1;
3427 } __TRISJbits_t;
3429 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
3431 #define _TRISJ_TRISJ0 0x01
3432 #define _TRISJ_RJ0 0x01
3433 #define _TRISJ_TRISJ1 0x02
3434 #define _TRISJ_RJ1 0x02
3435 #define _TRISJ_TRISJ2 0x04
3436 #define _TRISJ_RJ2 0x04
3437 #define _TRISJ_TRISJ3 0x08
3438 #define _TRISJ_RJ3 0x08
3439 #define _TRISJ_TRISJ4 0x10
3440 #define _TRISJ_RJ4 0x10
3441 #define _TRISJ_TRISJ5 0x20
3442 #define _TRISJ_RJ5 0x20
3443 #define _TRISJ_TRISJ6 0x40
3444 #define _TRISJ_RJ6 0x40
3445 #define _TRISJ_TRISJ7 0x80
3446 #define _TRISJ_RJ7 0x80
3448 //==============================================================================
3451 //==============================================================================
3452 // OSCTUNE Bits
3454 extern __at(0x0F9B) __sfr OSCTUNE;
3456 typedef union
3458 struct
3460 unsigned TUN0 : 1;
3461 unsigned TUN1 : 1;
3462 unsigned TUN2 : 1;
3463 unsigned TUN3 : 1;
3464 unsigned TUN4 : 1;
3465 unsigned TUN5 : 1;
3466 unsigned PLLEN : 1;
3467 unsigned INTSRC : 1;
3470 struct
3472 unsigned TUN : 6;
3473 unsigned : 2;
3475 } __OSCTUNEbits_t;
3477 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3479 #define _TUN0 0x01
3480 #define _TUN1 0x02
3481 #define _TUN2 0x04
3482 #define _TUN3 0x08
3483 #define _TUN4 0x10
3484 #define _TUN5 0x20
3485 #define _PLLEN 0x40
3486 #define _INTSRC 0x80
3488 //==============================================================================
3491 //==============================================================================
3492 // PIE1 Bits
3494 extern __at(0x0F9D) __sfr PIE1;
3496 typedef union
3498 struct
3500 unsigned TMR1IE : 1;
3501 unsigned TMR2IE : 1;
3502 unsigned : 1;
3503 unsigned SSPIE : 1;
3504 unsigned TX1IE : 1;
3505 unsigned RC1IE : 1;
3506 unsigned ADIE : 1;
3507 unsigned : 1;
3510 struct
3512 unsigned : 1;
3513 unsigned : 1;
3514 unsigned : 1;
3515 unsigned SSP1IE : 1;
3516 unsigned TXIE : 1;
3517 unsigned RCIE : 1;
3518 unsigned : 1;
3519 unsigned : 1;
3521 } __PIE1bits_t;
3523 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3525 #define _TMR1IE 0x01
3526 #define _TMR2IE 0x02
3527 #define _SSPIE 0x08
3528 #define _SSP1IE 0x08
3529 #define _TX1IE 0x10
3530 #define _TXIE 0x10
3531 #define _RC1IE 0x20
3532 #define _RCIE 0x20
3533 #define _ADIE 0x40
3535 //==============================================================================
3538 //==============================================================================
3539 // PIR1 Bits
3541 extern __at(0x0F9E) __sfr PIR1;
3543 typedef union
3545 struct
3547 unsigned TMR1IF : 1;
3548 unsigned TMR2IF : 1;
3549 unsigned : 1;
3550 unsigned SSPIF : 1;
3551 unsigned TX1IF : 1;
3552 unsigned RC1IF : 1;
3553 unsigned ADIF : 1;
3554 unsigned : 1;
3557 struct
3559 unsigned : 1;
3560 unsigned : 1;
3561 unsigned : 1;
3562 unsigned SSP1IF : 1;
3563 unsigned TXIF : 1;
3564 unsigned RCIF : 1;
3565 unsigned : 1;
3566 unsigned : 1;
3568 } __PIR1bits_t;
3570 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3572 #define _TMR1IF 0x01
3573 #define _TMR2IF 0x02
3574 #define _SSPIF 0x08
3575 #define _SSP1IF 0x08
3576 #define _TX1IF 0x10
3577 #define _TXIF 0x10
3578 #define _RC1IF 0x20
3579 #define _RCIF 0x20
3580 #define _ADIF 0x40
3582 //==============================================================================
3585 //==============================================================================
3586 // IPR1 Bits
3588 extern __at(0x0F9F) __sfr IPR1;
3590 typedef union
3592 struct
3594 unsigned TMR1IP : 1;
3595 unsigned TMR2IP : 1;
3596 unsigned : 1;
3597 unsigned SSPIP : 1;
3598 unsigned TX1IP : 1;
3599 unsigned RC1IP : 1;
3600 unsigned ADIP : 1;
3601 unsigned : 1;
3604 struct
3606 unsigned : 1;
3607 unsigned : 1;
3608 unsigned : 1;
3609 unsigned SSP1IP : 1;
3610 unsigned TXIP : 1;
3611 unsigned RCIP : 1;
3612 unsigned : 1;
3613 unsigned : 1;
3615 } __IPR1bits_t;
3617 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3619 #define _TMR1IP 0x01
3620 #define _TMR2IP 0x02
3621 #define _SSPIP 0x08
3622 #define _SSP1IP 0x08
3623 #define _TX1IP 0x10
3624 #define _TXIP 0x10
3625 #define _RC1IP 0x20
3626 #define _RCIP 0x20
3627 #define _ADIP 0x40
3629 //==============================================================================
3632 //==============================================================================
3633 // PIE2 Bits
3635 extern __at(0x0FA0) __sfr PIE2;
3637 typedef union
3639 struct
3641 unsigned : 1;
3642 unsigned TMR3IE : 1;
3643 unsigned LVDIE : 1;
3644 unsigned BCLIE : 1;
3645 unsigned : 1;
3646 unsigned : 1;
3647 unsigned CMIE : 1;
3648 unsigned OSCFIE : 1;
3651 struct
3653 unsigned : 1;
3654 unsigned : 1;
3655 unsigned : 1;
3656 unsigned BCL1IE : 1;
3657 unsigned : 1;
3658 unsigned : 1;
3659 unsigned : 1;
3660 unsigned : 1;
3662 } __PIE2bits_t;
3664 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3666 #define _TMR3IE 0x02
3667 #define _LVDIE 0x04
3668 #define _BCLIE 0x08
3669 #define _BCL1IE 0x08
3670 #define _CMIE 0x40
3671 #define _OSCFIE 0x80
3673 //==============================================================================
3676 //==============================================================================
3677 // PIR2 Bits
3679 extern __at(0x0FA1) __sfr PIR2;
3681 typedef union
3683 struct
3685 unsigned : 1;
3686 unsigned TMR3IF : 1;
3687 unsigned LVDIF : 1;
3688 unsigned BCLIF : 1;
3689 unsigned : 1;
3690 unsigned : 1;
3691 unsigned CMIF : 1;
3692 unsigned OSCFIF : 1;
3695 struct
3697 unsigned : 1;
3698 unsigned : 1;
3699 unsigned : 1;
3700 unsigned BCL1IF : 1;
3701 unsigned : 1;
3702 unsigned : 1;
3703 unsigned : 1;
3704 unsigned : 1;
3706 } __PIR2bits_t;
3708 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3710 #define _TMR3IF 0x02
3711 #define _LVDIF 0x04
3712 #define _BCLIF 0x08
3713 #define _BCL1IF 0x08
3714 #define _CMIF 0x40
3715 #define _OSCFIF 0x80
3717 //==============================================================================
3720 //==============================================================================
3721 // IPR2 Bits
3723 extern __at(0x0FA2) __sfr IPR2;
3725 typedef union
3727 struct
3729 unsigned : 1;
3730 unsigned TMR3IP : 1;
3731 unsigned LVDIP : 1;
3732 unsigned BCLIP : 1;
3733 unsigned : 1;
3734 unsigned : 1;
3735 unsigned CMIP : 1;
3736 unsigned OSCFIP : 1;
3739 struct
3741 unsigned : 1;
3742 unsigned : 1;
3743 unsigned : 1;
3744 unsigned BCL1IP : 1;
3745 unsigned : 1;
3746 unsigned : 1;
3747 unsigned : 1;
3748 unsigned : 1;
3750 } __IPR2bits_t;
3752 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3754 #define _TMR3IP 0x02
3755 #define _LVDIP 0x04
3756 #define _BCLIP 0x08
3757 #define _BCL1IP 0x08
3758 #define _CMIP 0x40
3759 #define _OSCFIP 0x80
3761 //==============================================================================
3764 //==============================================================================
3765 // PIE3 Bits
3767 extern __at(0x0FA3) __sfr PIE3;
3769 typedef struct
3771 unsigned : 1;
3772 unsigned CCP1IE : 1;
3773 unsigned CCP2IE : 1;
3774 unsigned : 1;
3775 unsigned TX2IE : 1;
3776 unsigned RC2IE : 1;
3777 unsigned LCDIE : 1;
3778 unsigned : 1;
3779 } __PIE3bits_t;
3781 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3783 #define _CCP1IE 0x02
3784 #define _CCP2IE 0x04
3785 #define _TX2IE 0x10
3786 #define _RC2IE 0x20
3787 #define _LCDIE 0x40
3789 //==============================================================================
3792 //==============================================================================
3793 // PIR3 Bits
3795 extern __at(0x0FA4) __sfr PIR3;
3797 typedef struct
3799 unsigned : 1;
3800 unsigned CCP1IF : 1;
3801 unsigned CCP2IF : 1;
3802 unsigned : 1;
3803 unsigned TX2IF : 1;
3804 unsigned RC2IF : 1;
3805 unsigned LCDIF : 1;
3806 unsigned : 1;
3807 } __PIR3bits_t;
3809 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3811 #define _CCP1IF 0x02
3812 #define _CCP2IF 0x04
3813 #define _TX2IF 0x10
3814 #define _RC2IF 0x20
3815 #define _LCDIF 0x40
3817 //==============================================================================
3820 //==============================================================================
3821 // IPR3 Bits
3823 extern __at(0x0FA5) __sfr IPR3;
3825 typedef struct
3827 unsigned : 1;
3828 unsigned CCP1IP : 1;
3829 unsigned CCP2IP : 1;
3830 unsigned : 1;
3831 unsigned TX2IP : 1;
3832 unsigned RC2IP : 1;
3833 unsigned LCDIP : 1;
3834 unsigned : 1;
3835 } __IPR3bits_t;
3837 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3839 #define _CCP1IP 0x02
3840 #define _CCP2IP 0x04
3841 #define _TX2IP 0x10
3842 #define _RC2IP 0x20
3843 #define _LCDIP 0x40
3845 //==============================================================================
3848 //==============================================================================
3849 // EECON1 Bits
3851 extern __at(0x0FA6) __sfr EECON1;
3853 typedef struct
3855 unsigned : 1;
3856 unsigned WR : 1;
3857 unsigned WREN : 1;
3858 unsigned WRERR : 1;
3859 unsigned FREE : 1;
3860 unsigned : 1;
3861 unsigned : 1;
3862 unsigned : 1;
3863 } __EECON1bits_t;
3865 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3867 #define _WR 0x02
3868 #define _WREN 0x04
3869 #define _WRERR 0x08
3870 #define _FREE 0x10
3872 //==============================================================================
3874 extern __at(0x0FA7) __sfr EECON2;
3876 //==============================================================================
3877 // LCDCON Bits
3879 extern __at(0x0FA8) __sfr LCDCON;
3881 typedef union
3883 struct
3885 unsigned LMUX0 : 1;
3886 unsigned LMUX1 : 1;
3887 unsigned LCDCS0 : 1;
3888 unsigned LCDCS1 : 1;
3889 unsigned : 1;
3890 unsigned WERR : 1;
3891 unsigned SLPEN : 1;
3892 unsigned LCDEN : 1;
3895 struct
3897 unsigned : 1;
3898 unsigned : 1;
3899 unsigned CS0 : 1;
3900 unsigned CS1 : 1;
3901 unsigned : 1;
3902 unsigned LCDWERR : 1;
3903 unsigned LCDSLPEN : 1;
3904 unsigned : 1;
3907 struct
3909 unsigned LMUX : 2;
3910 unsigned : 6;
3913 struct
3915 unsigned : 2;
3916 unsigned LCDCS : 2;
3917 unsigned : 4;
3920 struct
3922 unsigned : 2;
3923 unsigned CS : 2;
3924 unsigned : 4;
3926 } __LCDCONbits_t;
3928 extern __at(0x0FA8) volatile __LCDCONbits_t LCDCONbits;
3930 #define _LMUX0 0x01
3931 #define _LMUX1 0x02
3932 #define _LCDCS0 0x04
3933 #define _CS0 0x04
3934 #define _LCDCS1 0x08
3935 #define _CS1 0x08
3936 #define _WERR 0x20
3937 #define _LCDWERR 0x20
3938 #define _SLPEN 0x40
3939 #define _LCDSLPEN 0x40
3940 #define _LCDEN 0x80
3942 //==============================================================================
3945 //==============================================================================
3946 // LCDSE0 Bits
3948 extern __at(0x0FA9) __sfr LCDSE0;
3950 typedef union
3952 struct
3954 unsigned SE0 : 1;
3955 unsigned SE1 : 1;
3956 unsigned SE2 : 1;
3957 unsigned SE3 : 1;
3958 unsigned SE4 : 1;
3959 unsigned SE5 : 1;
3960 unsigned SE6 : 1;
3961 unsigned SE7 : 1;
3964 struct
3966 unsigned SEGEN0 : 1;
3967 unsigned SEGEN1 : 1;
3968 unsigned SEGEN2 : 1;
3969 unsigned SEGEN3 : 1;
3970 unsigned SEGEN4 : 1;
3971 unsigned SEGEN5 : 1;
3972 unsigned SEGEN6 : 1;
3973 unsigned SEGEN7 : 1;
3976 struct
3978 unsigned SE00 : 1;
3979 unsigned SE01 : 1;
3980 unsigned SE02 : 1;
3981 unsigned SE03 : 1;
3982 unsigned SE04 : 1;
3983 unsigned SE05 : 1;
3984 unsigned SE06 : 1;
3985 unsigned SE07 : 1;
3987 } __LCDSE0bits_t;
3989 extern __at(0x0FA9) volatile __LCDSE0bits_t LCDSE0bits;
3991 #define _SE0 0x01
3992 #define _SEGEN0 0x01
3993 #define _SE00 0x01
3994 #define _SE1 0x02
3995 #define _SEGEN1 0x02
3996 #define _SE01 0x02
3997 #define _SE2 0x04
3998 #define _SEGEN2 0x04
3999 #define _SE02 0x04
4000 #define _SE3 0x08
4001 #define _SEGEN3 0x08
4002 #define _SE03 0x08
4003 #define _SE4 0x10
4004 #define _SEGEN4 0x10
4005 #define _SE04 0x10
4006 #define _SE5 0x20
4007 #define _SEGEN5 0x20
4008 #define _SE05 0x20
4009 #define _SE6 0x40
4010 #define _SEGEN6 0x40
4011 #define _SE06 0x40
4012 #define _SE7 0x80
4013 #define _SEGEN7 0x80
4014 #define _SE07 0x80
4016 //==============================================================================
4019 //==============================================================================
4020 // LCDPS Bits
4022 extern __at(0x0FAA) __sfr LCDPS;
4024 typedef union
4026 struct
4028 unsigned LCDPS0 : 1;
4029 unsigned LCDPS1 : 1;
4030 unsigned LCDPS2 : 1;
4031 unsigned LCDPS3 : 1;
4032 unsigned WA : 1;
4033 unsigned LCDA : 1;
4034 unsigned BIASMD : 1;
4035 unsigned WFT : 1;
4038 struct
4040 unsigned LP0 : 1;
4041 unsigned LP1 : 1;
4042 unsigned LP2 : 1;
4043 unsigned LP3 : 1;
4044 unsigned : 1;
4045 unsigned : 1;
4046 unsigned : 1;
4047 unsigned : 1;
4050 struct
4052 unsigned LP : 4;
4053 unsigned : 4;
4056 struct
4058 unsigned LCDPS : 4;
4059 unsigned : 4;
4061 } __LCDPSbits_t;
4063 extern __at(0x0FAA) volatile __LCDPSbits_t LCDPSbits;
4065 #define _LCDPS0 0x01
4066 #define _LP0 0x01
4067 #define _LCDPS1 0x02
4068 #define _LP1 0x02
4069 #define _LCDPS2 0x04
4070 #define _LP2 0x04
4071 #define _LCDPS3 0x08
4072 #define _LP3 0x08
4073 #define _WA 0x10
4074 #define _LCDA 0x20
4075 #define _BIASMD 0x40
4076 #define _WFT 0x80
4078 //==============================================================================
4081 //==============================================================================
4082 // RCSTA Bits
4084 extern __at(0x0FAB) __sfr RCSTA;
4086 typedef union
4088 struct
4090 unsigned RX9D : 1;
4091 unsigned OERR : 1;
4092 unsigned FERR : 1;
4093 unsigned ADDEN : 1;
4094 unsigned CREN : 1;
4095 unsigned SREN : 1;
4096 unsigned RX9 : 1;
4097 unsigned SPEN : 1;
4100 struct
4102 unsigned RCD8 : 1;
4103 unsigned OERR1 : 1;
4104 unsigned FERR1 : 1;
4105 unsigned ADDEN1 : 1;
4106 unsigned CREN1 : 1;
4107 unsigned SREN1 : 1;
4108 unsigned RC9 : 1;
4109 unsigned SPEN1 : 1;
4112 struct
4114 unsigned RX9D1 : 1;
4115 unsigned : 1;
4116 unsigned : 1;
4117 unsigned : 1;
4118 unsigned : 1;
4119 unsigned : 1;
4120 unsigned NOT_RC8 : 1;
4121 unsigned : 1;
4124 struct
4126 unsigned : 1;
4127 unsigned : 1;
4128 unsigned : 1;
4129 unsigned : 1;
4130 unsigned : 1;
4131 unsigned : 1;
4132 unsigned RC8_9 : 1;
4133 unsigned : 1;
4136 struct
4138 unsigned : 1;
4139 unsigned : 1;
4140 unsigned : 1;
4141 unsigned : 1;
4142 unsigned : 1;
4143 unsigned : 1;
4144 unsigned RX91 : 1;
4145 unsigned : 1;
4147 } __RCSTAbits_t;
4149 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
4151 #define _RX9D 0x01
4152 #define _RCD8 0x01
4153 #define _RX9D1 0x01
4154 #define _OERR 0x02
4155 #define _OERR1 0x02
4156 #define _FERR 0x04
4157 #define _FERR1 0x04
4158 #define _ADDEN 0x08
4159 #define _ADDEN1 0x08
4160 #define _CREN 0x10
4161 #define _CREN1 0x10
4162 #define _SREN 0x20
4163 #define _SREN1 0x20
4164 #define _RX9 0x40
4165 #define _RC9 0x40
4166 #define _NOT_RC8 0x40
4167 #define _RC8_9 0x40
4168 #define _RX91 0x40
4169 #define _SPEN 0x80
4170 #define _SPEN1 0x80
4172 //==============================================================================
4175 //==============================================================================
4176 // RCSTA1 Bits
4178 extern __at(0x0FAB) __sfr RCSTA1;
4180 typedef union
4182 struct
4184 unsigned RX9D : 1;
4185 unsigned OERR : 1;
4186 unsigned FERR : 1;
4187 unsigned ADDEN : 1;
4188 unsigned CREN : 1;
4189 unsigned SREN : 1;
4190 unsigned RX9 : 1;
4191 unsigned SPEN : 1;
4194 struct
4196 unsigned RCD8 : 1;
4197 unsigned OERR1 : 1;
4198 unsigned FERR1 : 1;
4199 unsigned ADDEN1 : 1;
4200 unsigned CREN1 : 1;
4201 unsigned SREN1 : 1;
4202 unsigned RC9 : 1;
4203 unsigned SPEN1 : 1;
4206 struct
4208 unsigned RX9D1 : 1;
4209 unsigned : 1;
4210 unsigned : 1;
4211 unsigned : 1;
4212 unsigned : 1;
4213 unsigned : 1;
4214 unsigned NOT_RC8 : 1;
4215 unsigned : 1;
4218 struct
4220 unsigned : 1;
4221 unsigned : 1;
4222 unsigned : 1;
4223 unsigned : 1;
4224 unsigned : 1;
4225 unsigned : 1;
4226 unsigned RC8_9 : 1;
4227 unsigned : 1;
4230 struct
4232 unsigned : 1;
4233 unsigned : 1;
4234 unsigned : 1;
4235 unsigned : 1;
4236 unsigned : 1;
4237 unsigned : 1;
4238 unsigned RX91 : 1;
4239 unsigned : 1;
4241 } __RCSTA1bits_t;
4243 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
4245 #define _RCSTA1_RX9D 0x01
4246 #define _RCSTA1_RCD8 0x01
4247 #define _RCSTA1_RX9D1 0x01
4248 #define _RCSTA1_OERR 0x02
4249 #define _RCSTA1_OERR1 0x02
4250 #define _RCSTA1_FERR 0x04
4251 #define _RCSTA1_FERR1 0x04
4252 #define _RCSTA1_ADDEN 0x08
4253 #define _RCSTA1_ADDEN1 0x08
4254 #define _RCSTA1_CREN 0x10
4255 #define _RCSTA1_CREN1 0x10
4256 #define _RCSTA1_SREN 0x20
4257 #define _RCSTA1_SREN1 0x20
4258 #define _RCSTA1_RX9 0x40
4259 #define _RCSTA1_RC9 0x40
4260 #define _RCSTA1_NOT_RC8 0x40
4261 #define _RCSTA1_RC8_9 0x40
4262 #define _RCSTA1_RX91 0x40
4263 #define _RCSTA1_SPEN 0x80
4264 #define _RCSTA1_SPEN1 0x80
4266 //==============================================================================
4269 //==============================================================================
4270 // TXSTA Bits
4272 extern __at(0x0FAC) __sfr TXSTA;
4274 typedef union
4276 struct
4278 unsigned TX9D : 1;
4279 unsigned TRMT : 1;
4280 unsigned BRGH : 1;
4281 unsigned SENDB : 1;
4282 unsigned SYNC : 1;
4283 unsigned TXEN : 1;
4284 unsigned TX9 : 1;
4285 unsigned CSRC : 1;
4288 struct
4290 unsigned TXD8 : 1;
4291 unsigned TRMT1 : 1;
4292 unsigned BRGH1 : 1;
4293 unsigned SENDB1 : 1;
4294 unsigned SYNC1 : 1;
4295 unsigned TXEN1 : 1;
4296 unsigned TX8_9 : 1;
4297 unsigned CSRC1 : 1;
4300 struct
4302 unsigned TX9D1 : 1;
4303 unsigned : 1;
4304 unsigned : 1;
4305 unsigned : 1;
4306 unsigned : 1;
4307 unsigned : 1;
4308 unsigned NOT_TX8 : 1;
4309 unsigned : 1;
4312 struct
4314 unsigned : 1;
4315 unsigned : 1;
4316 unsigned : 1;
4317 unsigned : 1;
4318 unsigned : 1;
4319 unsigned : 1;
4320 unsigned TX91 : 1;
4321 unsigned : 1;
4323 } __TXSTAbits_t;
4325 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
4327 #define _TX9D 0x01
4328 #define _TXD8 0x01
4329 #define _TX9D1 0x01
4330 #define _TRMT 0x02
4331 #define _TRMT1 0x02
4332 #define _BRGH 0x04
4333 #define _BRGH1 0x04
4334 #define _SENDB 0x08
4335 #define _SENDB1 0x08
4336 #define _SYNC 0x10
4337 #define _SYNC1 0x10
4338 #define _TXEN 0x20
4339 #define _TXEN1 0x20
4340 #define _TX9 0x40
4341 #define _TX8_9 0x40
4342 #define _NOT_TX8 0x40
4343 #define _TX91 0x40
4344 #define _CSRC 0x80
4345 #define _CSRC1 0x80
4347 //==============================================================================
4350 //==============================================================================
4351 // TXSTA1 Bits
4353 extern __at(0x0FAC) __sfr TXSTA1;
4355 typedef union
4357 struct
4359 unsigned TX9D : 1;
4360 unsigned TRMT : 1;
4361 unsigned BRGH : 1;
4362 unsigned SENDB : 1;
4363 unsigned SYNC : 1;
4364 unsigned TXEN : 1;
4365 unsigned TX9 : 1;
4366 unsigned CSRC : 1;
4369 struct
4371 unsigned TXD8 : 1;
4372 unsigned TRMT1 : 1;
4373 unsigned BRGH1 : 1;
4374 unsigned SENDB1 : 1;
4375 unsigned SYNC1 : 1;
4376 unsigned TXEN1 : 1;
4377 unsigned TX8_9 : 1;
4378 unsigned CSRC1 : 1;
4381 struct
4383 unsigned TX9D1 : 1;
4384 unsigned : 1;
4385 unsigned : 1;
4386 unsigned : 1;
4387 unsigned : 1;
4388 unsigned : 1;
4389 unsigned NOT_TX8 : 1;
4390 unsigned : 1;
4393 struct
4395 unsigned : 1;
4396 unsigned : 1;
4397 unsigned : 1;
4398 unsigned : 1;
4399 unsigned : 1;
4400 unsigned : 1;
4401 unsigned TX91 : 1;
4402 unsigned : 1;
4404 } __TXSTA1bits_t;
4406 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
4408 #define _TXSTA1_TX9D 0x01
4409 #define _TXSTA1_TXD8 0x01
4410 #define _TXSTA1_TX9D1 0x01
4411 #define _TXSTA1_TRMT 0x02
4412 #define _TXSTA1_TRMT1 0x02
4413 #define _TXSTA1_BRGH 0x04
4414 #define _TXSTA1_BRGH1 0x04
4415 #define _TXSTA1_SENDB 0x08
4416 #define _TXSTA1_SENDB1 0x08
4417 #define _TXSTA1_SYNC 0x10
4418 #define _TXSTA1_SYNC1 0x10
4419 #define _TXSTA1_TXEN 0x20
4420 #define _TXSTA1_TXEN1 0x20
4421 #define _TXSTA1_TX9 0x40
4422 #define _TXSTA1_TX8_9 0x40
4423 #define _TXSTA1_NOT_TX8 0x40
4424 #define _TXSTA1_TX91 0x40
4425 #define _TXSTA1_CSRC 0x80
4426 #define _TXSTA1_CSRC1 0x80
4428 //==============================================================================
4430 extern __at(0x0FAD) __sfr TXREG;
4431 extern __at(0x0FAD) __sfr TXREG1;
4432 extern __at(0x0FAE) __sfr RCREG;
4433 extern __at(0x0FAE) __sfr RCREG1;
4434 extern __at(0x0FAF) __sfr SPBRG;
4435 extern __at(0x0FAF) __sfr SPBRG1;
4437 //==============================================================================
4438 // T3CON Bits
4440 extern __at(0x0FB1) __sfr T3CON;
4442 typedef union
4444 struct
4446 unsigned TMR3ON : 1;
4447 unsigned TMR3CS : 1;
4448 unsigned NOT_T3SYNC : 1;
4449 unsigned T3CCP1 : 1;
4450 unsigned T3CKPS0 : 1;
4451 unsigned T3CKPS1 : 1;
4452 unsigned T3CCP2 : 1;
4453 unsigned RD16 : 1;
4456 struct
4458 unsigned : 1;
4459 unsigned : 1;
4460 unsigned T3SYNC : 1;
4461 unsigned : 1;
4462 unsigned : 1;
4463 unsigned : 1;
4464 unsigned : 1;
4465 unsigned : 1;
4468 struct
4470 unsigned : 1;
4471 unsigned : 1;
4472 unsigned T3INSYNC : 1;
4473 unsigned : 1;
4474 unsigned : 1;
4475 unsigned : 1;
4476 unsigned : 1;
4477 unsigned : 1;
4480 struct
4482 unsigned : 4;
4483 unsigned T3CKPS : 2;
4484 unsigned : 2;
4486 } __T3CONbits_t;
4488 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
4490 #define _T3CON_TMR3ON 0x01
4491 #define _T3CON_TMR3CS 0x02
4492 #define _T3CON_NOT_T3SYNC 0x04
4493 #define _T3CON_T3SYNC 0x04
4494 #define _T3CON_T3INSYNC 0x04
4495 #define _T3CON_T3CCP1 0x08
4496 #define _T3CON_T3CKPS0 0x10
4497 #define _T3CON_T3CKPS1 0x20
4498 #define _T3CON_T3CCP2 0x40
4499 #define _T3CON_RD16 0x80
4501 //==============================================================================
4503 extern __at(0x0FB2) __sfr TMR3;
4504 extern __at(0x0FB2) __sfr TMR3L;
4505 extern __at(0x0FB3) __sfr TMR3H;
4507 //==============================================================================
4508 // CMCON Bits
4510 extern __at(0x0FB4) __sfr CMCON;
4512 typedef union
4514 struct
4516 unsigned CM0 : 1;
4517 unsigned CM1 : 1;
4518 unsigned CM2 : 1;
4519 unsigned CIS : 1;
4520 unsigned C1INV : 1;
4521 unsigned C2INV : 1;
4522 unsigned C1OUT : 1;
4523 unsigned C2OUT : 1;
4526 struct
4528 unsigned CM : 3;
4529 unsigned : 5;
4531 } __CMCONbits_t;
4533 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
4535 #define _CM0 0x01
4536 #define _CM1 0x02
4537 #define _CM2 0x04
4538 #define _CIS 0x08
4539 #define _C1INV 0x10
4540 #define _C2INV 0x20
4541 #define _C1OUT 0x40
4542 #define _C2OUT 0x80
4544 //==============================================================================
4547 //==============================================================================
4548 // CVRCON Bits
4550 extern __at(0x0FB5) __sfr CVRCON;
4552 typedef union
4554 struct
4556 unsigned CVR0 : 1;
4557 unsigned CVR1 : 1;
4558 unsigned CVR2 : 1;
4559 unsigned CVR3 : 1;
4560 unsigned CVRSS : 1;
4561 unsigned CVRR : 1;
4562 unsigned CVROE : 1;
4563 unsigned CVREN : 1;
4566 struct
4568 unsigned CVR : 4;
4569 unsigned : 4;
4571 } __CVRCONbits_t;
4573 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
4575 #define _CVR0 0x01
4576 #define _CVR1 0x02
4577 #define _CVR2 0x04
4578 #define _CVR3 0x08
4579 #define _CVRSS 0x10
4580 #define _CVRR 0x20
4581 #define _CVROE 0x40
4582 #define _CVREN 0x80
4584 //==============================================================================
4587 //==============================================================================
4588 // LCDSE1 Bits
4590 extern __at(0x0FB6) __sfr LCDSE1;
4592 typedef union
4594 struct
4596 unsigned SE8 : 1;
4597 unsigned SE9 : 1;
4598 unsigned SE10 : 1;
4599 unsigned SE11 : 1;
4600 unsigned SE12 : 1;
4601 unsigned SE13 : 1;
4602 unsigned SE14 : 1;
4603 unsigned SE15 : 1;
4606 struct
4608 unsigned SEGEN8 : 1;
4609 unsigned SEGEN9 : 1;
4610 unsigned SEGEN10 : 1;
4611 unsigned SEGEN11 : 1;
4612 unsigned SEGEN12 : 1;
4613 unsigned SEGEN13 : 1;
4614 unsigned SEGEN14 : 1;
4615 unsigned SEGEN15 : 1;
4618 struct
4620 unsigned SE08 : 1;
4621 unsigned SE09 : 1;
4622 unsigned : 1;
4623 unsigned : 1;
4624 unsigned : 1;
4625 unsigned : 1;
4626 unsigned : 1;
4627 unsigned : 1;
4629 } __LCDSE1bits_t;
4631 extern __at(0x0FB6) volatile __LCDSE1bits_t LCDSE1bits;
4633 #define _SE8 0x01
4634 #define _SEGEN8 0x01
4635 #define _SE08 0x01
4636 #define _SE9 0x02
4637 #define _SEGEN9 0x02
4638 #define _SE09 0x02
4639 #define _SE10 0x04
4640 #define _SEGEN10 0x04
4641 #define _SE11 0x08
4642 #define _SEGEN11 0x08
4643 #define _SE12 0x10
4644 #define _SEGEN12 0x10
4645 #define _SE13 0x20
4646 #define _SEGEN13 0x20
4647 #define _SE14 0x40
4648 #define _SEGEN14 0x40
4649 #define _SE15 0x80
4650 #define _SEGEN15 0x80
4652 //==============================================================================
4655 //==============================================================================
4656 // LCDSE2 Bits
4658 extern __at(0x0FB7) __sfr LCDSE2;
4660 typedef union
4662 struct
4664 unsigned SE16 : 1;
4665 unsigned SE17 : 1;
4666 unsigned SE18 : 1;
4667 unsigned SE19 : 1;
4668 unsigned SE20 : 1;
4669 unsigned SE21 : 1;
4670 unsigned SE22 : 1;
4671 unsigned SE23 : 1;
4674 struct
4676 unsigned SEGEN16 : 1;
4677 unsigned SEGEN17 : 1;
4678 unsigned SEGEN18 : 1;
4679 unsigned SEGEN19 : 1;
4680 unsigned SEGEN20 : 1;
4681 unsigned SEGEN21 : 1;
4682 unsigned SEGEN22 : 1;
4683 unsigned SEGEN23 : 1;
4685 } __LCDSE2bits_t;
4687 extern __at(0x0FB7) volatile __LCDSE2bits_t LCDSE2bits;
4689 #define _SE16 0x01
4690 #define _SEGEN16 0x01
4691 #define _SE17 0x02
4692 #define _SEGEN17 0x02
4693 #define _SE18 0x04
4694 #define _SEGEN18 0x04
4695 #define _SE19 0x08
4696 #define _SEGEN19 0x08
4697 #define _SE20 0x10
4698 #define _SEGEN20 0x10
4699 #define _SE21 0x20
4700 #define _SEGEN21 0x20
4701 #define _SE22 0x40
4702 #define _SEGEN22 0x40
4703 #define _SE23 0x80
4704 #define _SEGEN23 0x80
4706 //==============================================================================
4709 //==============================================================================
4710 // LCDSE3 Bits
4712 extern __at(0x0FB8) __sfr LCDSE3;
4714 typedef union
4716 struct
4718 unsigned SE24 : 1;
4719 unsigned SE25 : 1;
4720 unsigned SE26 : 1;
4721 unsigned SE27 : 1;
4722 unsigned SE28 : 1;
4723 unsigned SE29 : 1;
4724 unsigned SE30 : 1;
4725 unsigned SE31 : 1;
4728 struct
4730 unsigned SEGEN24 : 1;
4731 unsigned SEGEN25 : 1;
4732 unsigned SEGEN26 : 1;
4733 unsigned SEGEN27 : 1;
4734 unsigned SEGEN28 : 1;
4735 unsigned SEGEN29 : 1;
4736 unsigned SEGEN30 : 1;
4737 unsigned SEGEN31 : 1;
4739 } __LCDSE3bits_t;
4741 extern __at(0x0FB8) volatile __LCDSE3bits_t LCDSE3bits;
4743 #define _SE24 0x01
4744 #define _SEGEN24 0x01
4745 #define _SE25 0x02
4746 #define _SEGEN25 0x02
4747 #define _SE26 0x04
4748 #define _SEGEN26 0x04
4749 #define _SE27 0x08
4750 #define _SEGEN27 0x08
4751 #define _SE28 0x10
4752 #define _SEGEN28 0x10
4753 #define _SE29 0x20
4754 #define _SEGEN29 0x20
4755 #define _SE30 0x40
4756 #define _SEGEN30 0x40
4757 #define _SE31 0x80
4758 #define _SEGEN31 0x80
4760 //==============================================================================
4763 //==============================================================================
4764 // LCDSE4 Bits
4766 extern __at(0x0FB9) __sfr LCDSE4;
4768 typedef union
4770 struct
4772 unsigned SE32 : 1;
4773 unsigned SE33 : 1;
4774 unsigned SE34 : 1;
4775 unsigned SE35 : 1;
4776 unsigned SE36 : 1;
4777 unsigned SE37 : 1;
4778 unsigned SE38 : 1;
4779 unsigned SE39 : 1;
4782 struct
4784 unsigned SEGEN32 : 1;
4785 unsigned SEGEN33 : 1;
4786 unsigned SEGEN34 : 1;
4787 unsigned SEGEN35 : 1;
4788 unsigned SEGEN36 : 1;
4789 unsigned SEGEN37 : 1;
4790 unsigned SEGEN38 : 1;
4791 unsigned SEGEN39 : 1;
4793 } __LCDSE4bits_t;
4795 extern __at(0x0FB9) volatile __LCDSE4bits_t LCDSE4bits;
4797 #define _SE32 0x01
4798 #define _SEGEN32 0x01
4799 #define _SE33 0x02
4800 #define _SEGEN33 0x02
4801 #define _SE34 0x04
4802 #define _SEGEN34 0x04
4803 #define _SE35 0x08
4804 #define _SEGEN35 0x08
4805 #define _SE36 0x10
4806 #define _SEGEN36 0x10
4807 #define _SE37 0x20
4808 #define _SEGEN37 0x20
4809 #define _SE38 0x40
4810 #define _SEGEN38 0x40
4811 #define _SE39 0x80
4812 #define _SEGEN39 0x80
4814 //==============================================================================
4817 //==============================================================================
4818 // LCDSE5 Bits
4820 extern __at(0x0FBA) __sfr LCDSE5;
4822 typedef union
4824 struct
4826 unsigned SE40 : 1;
4827 unsigned SE41 : 1;
4828 unsigned SE42 : 1;
4829 unsigned SE43 : 1;
4830 unsigned SE44 : 1;
4831 unsigned SE45 : 1;
4832 unsigned SE46 : 1;
4833 unsigned SE47 : 1;
4836 struct
4838 unsigned SEGEN40 : 1;
4839 unsigned SEGEN41 : 1;
4840 unsigned SEGEN42 : 1;
4841 unsigned SEGEN43 : 1;
4842 unsigned SEGEN44 : 1;
4843 unsigned SEGEN45 : 1;
4844 unsigned SEGEN46 : 1;
4845 unsigned SEGEN47 : 1;
4847 } __LCDSE5bits_t;
4849 extern __at(0x0FBA) volatile __LCDSE5bits_t LCDSE5bits;
4851 #define _SE40 0x01
4852 #define _SEGEN40 0x01
4853 #define _SE41 0x02
4854 #define _SEGEN41 0x02
4855 #define _SE42 0x04
4856 #define _SEGEN42 0x04
4857 #define _SE43 0x08
4858 #define _SEGEN43 0x08
4859 #define _SE44 0x10
4860 #define _SEGEN44 0x10
4861 #define _SE45 0x20
4862 #define _SEGEN45 0x20
4863 #define _SE46 0x40
4864 #define _SEGEN46 0x40
4865 #define _SE47 0x80
4866 #define _SEGEN47 0x80
4868 //==============================================================================
4871 //==============================================================================
4872 // LCDDATA0 Bits
4874 extern __at(0x0FBB) __sfr LCDDATA0;
4876 typedef union
4878 struct
4880 unsigned S0C0 : 1;
4881 unsigned S1C0 : 1;
4882 unsigned S2C0 : 1;
4883 unsigned S3C0 : 1;
4884 unsigned S4C0 : 1;
4885 unsigned S5C0 : 1;
4886 unsigned S6C0 : 1;
4887 unsigned S7C0 : 1;
4890 struct
4892 unsigned SEG0COM0 : 1;
4893 unsigned SEG1COM0 : 1;
4894 unsigned SEG2COM0 : 1;
4895 unsigned SEG3COM0 : 1;
4896 unsigned SEG4COM0 : 1;
4897 unsigned SEG5COM0 : 1;
4898 unsigned SEG6COM0 : 1;
4899 unsigned SEG7COM0 : 1;
4902 struct
4904 unsigned S00C0 : 1;
4905 unsigned S01C0 : 1;
4906 unsigned S02C0 : 1;
4907 unsigned S03C0 : 1;
4908 unsigned S04C0 : 1;
4909 unsigned S05C0 : 1;
4910 unsigned S06C0 : 1;
4911 unsigned S07C0 : 1;
4913 } __LCDDATA0bits_t;
4915 extern __at(0x0FBB) volatile __LCDDATA0bits_t LCDDATA0bits;
4917 #define _S0C0 0x01
4918 #define _SEG0COM0 0x01
4919 #define _S00C0 0x01
4920 #define _S1C0 0x02
4921 #define _SEG1COM0 0x02
4922 #define _S01C0 0x02
4923 #define _S2C0 0x04
4924 #define _SEG2COM0 0x04
4925 #define _S02C0 0x04
4926 #define _S3C0 0x08
4927 #define _SEG3COM0 0x08
4928 #define _S03C0 0x08
4929 #define _S4C0 0x10
4930 #define _SEG4COM0 0x10
4931 #define _S04C0 0x10
4932 #define _S5C0 0x20
4933 #define _SEG5COM0 0x20
4934 #define _S05C0 0x20
4935 #define _S6C0 0x40
4936 #define _SEG6COM0 0x40
4937 #define _S06C0 0x40
4938 #define _S7C0 0x80
4939 #define _SEG7COM0 0x80
4940 #define _S07C0 0x80
4942 //==============================================================================
4945 //==============================================================================
4946 // LCDDATA1 Bits
4948 extern __at(0x0FBC) __sfr LCDDATA1;
4950 typedef union
4952 struct
4954 unsigned S8C0 : 1;
4955 unsigned S9C0 : 1;
4956 unsigned S10C0 : 1;
4957 unsigned S11C0 : 1;
4958 unsigned S12C0 : 1;
4959 unsigned S13C0 : 1;
4960 unsigned S14C0 : 1;
4961 unsigned S15C0 : 1;
4964 struct
4966 unsigned SEG8COM0 : 1;
4967 unsigned SEG9COM0 : 1;
4968 unsigned SEG10COM0 : 1;
4969 unsigned SEG11COM0 : 1;
4970 unsigned SEG12COM0 : 1;
4971 unsigned SEG13COM0 : 1;
4972 unsigned SEG14COM0 : 1;
4973 unsigned SEG15COM0 : 1;
4976 struct
4978 unsigned S08C0 : 1;
4979 unsigned S09C0 : 1;
4980 unsigned : 1;
4981 unsigned : 1;
4982 unsigned : 1;
4983 unsigned : 1;
4984 unsigned : 1;
4985 unsigned : 1;
4987 } __LCDDATA1bits_t;
4989 extern __at(0x0FBC) volatile __LCDDATA1bits_t LCDDATA1bits;
4991 #define _S8C0 0x01
4992 #define _SEG8COM0 0x01
4993 #define _S08C0 0x01
4994 #define _S9C0 0x02
4995 #define _SEG9COM0 0x02
4996 #define _S09C0 0x02
4997 #define _S10C0 0x04
4998 #define _SEG10COM0 0x04
4999 #define _S11C0 0x08
5000 #define _SEG11COM0 0x08
5001 #define _S12C0 0x10
5002 #define _SEG12COM0 0x10
5003 #define _S13C0 0x20
5004 #define _SEG13COM0 0x20
5005 #define _S14C0 0x40
5006 #define _SEG14COM0 0x40
5007 #define _S15C0 0x80
5008 #define _SEG15COM0 0x80
5010 //==============================================================================
5013 //==============================================================================
5014 // LCDDATA2 Bits
5016 extern __at(0x0FBD) __sfr LCDDATA2;
5018 typedef union
5020 struct
5022 unsigned S16C0 : 1;
5023 unsigned S17C0 : 1;
5024 unsigned S18C0 : 1;
5025 unsigned S19C0 : 1;
5026 unsigned S20C0 : 1;
5027 unsigned S21C0 : 1;
5028 unsigned S22C0 : 1;
5029 unsigned S23C0 : 1;
5032 struct
5034 unsigned SEG16COM0 : 1;
5035 unsigned SEG17COM0 : 1;
5036 unsigned SEG18COM0 : 1;
5037 unsigned SEG19COM0 : 1;
5038 unsigned SEG20COM0 : 1;
5039 unsigned SEG21COM0 : 1;
5040 unsigned SEG22COM0 : 1;
5041 unsigned SEG23COM0 : 1;
5043 } __LCDDATA2bits_t;
5045 extern __at(0x0FBD) volatile __LCDDATA2bits_t LCDDATA2bits;
5047 #define _S16C0 0x01
5048 #define _SEG16COM0 0x01
5049 #define _S17C0 0x02
5050 #define _SEG17COM0 0x02
5051 #define _S18C0 0x04
5052 #define _SEG18COM0 0x04
5053 #define _S19C0 0x08
5054 #define _SEG19COM0 0x08
5055 #define _S20C0 0x10
5056 #define _SEG20COM0 0x10
5057 #define _S21C0 0x20
5058 #define _SEG21COM0 0x20
5059 #define _S22C0 0x40
5060 #define _SEG22COM0 0x40
5061 #define _S23C0 0x80
5062 #define _SEG23COM0 0x80
5064 //==============================================================================
5067 //==============================================================================
5068 // LCDDATA3 Bits
5070 extern __at(0x0FBE) __sfr LCDDATA3;
5072 typedef union
5074 struct
5076 unsigned S24C0 : 1;
5077 unsigned S25C0 : 1;
5078 unsigned S26C0 : 1;
5079 unsigned S27C0 : 1;
5080 unsigned S28C0 : 1;
5081 unsigned S29C0 : 1;
5082 unsigned S30C0 : 1;
5083 unsigned S31C0 : 1;
5086 struct
5088 unsigned SEG24COM0 : 1;
5089 unsigned SEG25COM0 : 1;
5090 unsigned SEG26COM0 : 1;
5091 unsigned SEG27COM0 : 1;
5092 unsigned SEG28COM0 : 1;
5093 unsigned SEG29COM0 : 1;
5094 unsigned SEG30COM0 : 1;
5095 unsigned SEG31COM0 : 1;
5097 } __LCDDATA3bits_t;
5099 extern __at(0x0FBE) volatile __LCDDATA3bits_t LCDDATA3bits;
5101 #define _S24C0 0x01
5102 #define _SEG24COM0 0x01
5103 #define _S25C0 0x02
5104 #define _SEG25COM0 0x02
5105 #define _S26C0 0x04
5106 #define _SEG26COM0 0x04
5107 #define _S27C0 0x08
5108 #define _SEG27COM0 0x08
5109 #define _S28C0 0x10
5110 #define _SEG28COM0 0x10
5111 #define _S29C0 0x20
5112 #define _SEG29COM0 0x20
5113 #define _S30C0 0x40
5114 #define _SEG30COM0 0x40
5115 #define _S31C0 0x80
5116 #define _SEG31COM0 0x80
5118 //==============================================================================
5121 //==============================================================================
5122 // LCDDATA4 Bits
5124 extern __at(0x0FBF) __sfr LCDDATA4;
5126 typedef union
5128 struct
5130 unsigned S32C0 : 1;
5131 unsigned S33C0 : 1;
5132 unsigned S34C0 : 1;
5133 unsigned S35C0 : 1;
5134 unsigned S36C0 : 1;
5135 unsigned S37C0 : 1;
5136 unsigned S38C0 : 1;
5137 unsigned S39C0 : 1;
5140 struct
5142 unsigned SEG32COM0 : 1;
5143 unsigned SEG33COM0 : 1;
5144 unsigned SEG34COM0 : 1;
5145 unsigned SEG35COM0 : 1;
5146 unsigned SEG36COM0 : 1;
5147 unsigned SEG37COM0 : 1;
5148 unsigned SEG38COM0 : 1;
5149 unsigned SEG39COM0 : 1;
5151 } __LCDDATA4bits_t;
5153 extern __at(0x0FBF) volatile __LCDDATA4bits_t LCDDATA4bits;
5155 #define _S32C0 0x01
5156 #define _SEG32COM0 0x01
5157 #define _S33C0 0x02
5158 #define _SEG33COM0 0x02
5159 #define _S34C0 0x04
5160 #define _SEG34COM0 0x04
5161 #define _S35C0 0x08
5162 #define _SEG35COM0 0x08
5163 #define _S36C0 0x10
5164 #define _SEG36COM0 0x10
5165 #define _S37C0 0x20
5166 #define _SEG37COM0 0x20
5167 #define _S38C0 0x40
5168 #define _SEG38COM0 0x40
5169 #define _S39C0 0x80
5170 #define _SEG39COM0 0x80
5172 //==============================================================================
5175 //==============================================================================
5176 // ADCON2 Bits
5178 extern __at(0x0FC0) __sfr ADCON2;
5180 typedef union
5182 struct
5184 unsigned ADCS0 : 1;
5185 unsigned ADCS1 : 1;
5186 unsigned ADCS2 : 1;
5187 unsigned ACQT0 : 1;
5188 unsigned ACQT1 : 1;
5189 unsigned ACQT2 : 1;
5190 unsigned : 1;
5191 unsigned ADFM : 1;
5194 struct
5196 unsigned ADCS : 3;
5197 unsigned : 5;
5200 struct
5202 unsigned : 3;
5203 unsigned ACQT : 3;
5204 unsigned : 2;
5206 } __ADCON2bits_t;
5208 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
5210 #define _ADCS0 0x01
5211 #define _ADCS1 0x02
5212 #define _ADCS2 0x04
5213 #define _ACQT0 0x08
5214 #define _ACQT1 0x10
5215 #define _ACQT2 0x20
5216 #define _ADFM 0x80
5218 //==============================================================================
5221 //==============================================================================
5222 // ADCON1 Bits
5224 extern __at(0x0FC1) __sfr ADCON1;
5226 typedef union
5228 struct
5230 unsigned PCFG0 : 1;
5231 unsigned PCFG1 : 1;
5232 unsigned PCFG2 : 1;
5233 unsigned PCFG3 : 1;
5234 unsigned VCFG0 : 1;
5235 unsigned VCFG1 : 1;
5236 unsigned : 1;
5237 unsigned : 1;
5240 struct
5242 unsigned PCFG : 4;
5243 unsigned : 4;
5246 struct
5248 unsigned : 4;
5249 unsigned VCFG : 2;
5250 unsigned : 2;
5252 } __ADCON1bits_t;
5254 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5256 #define _PCFG0 0x01
5257 #define _PCFG1 0x02
5258 #define _PCFG2 0x04
5259 #define _PCFG3 0x08
5260 #define _VCFG0 0x10
5261 #define _VCFG1 0x20
5263 //==============================================================================
5266 //==============================================================================
5267 // ADCON0 Bits
5269 extern __at(0x0FC2) __sfr ADCON0;
5271 typedef union
5273 struct
5275 unsigned ADON : 1;
5276 unsigned GO_NOT_DONE : 1;
5277 unsigned CHS0 : 1;
5278 unsigned CHS1 : 1;
5279 unsigned CHS2 : 1;
5280 unsigned CHS3 : 1;
5281 unsigned : 1;
5282 unsigned ADCAL : 1;
5285 struct
5287 unsigned : 1;
5288 unsigned GO_DONE : 1;
5289 unsigned : 1;
5290 unsigned : 1;
5291 unsigned : 1;
5292 unsigned : 1;
5293 unsigned : 1;
5294 unsigned : 1;
5297 struct
5299 unsigned : 1;
5300 unsigned DONE : 1;
5301 unsigned : 1;
5302 unsigned : 1;
5303 unsigned : 1;
5304 unsigned : 1;
5305 unsigned : 1;
5306 unsigned : 1;
5309 struct
5311 unsigned : 1;
5312 unsigned GO : 1;
5313 unsigned : 1;
5314 unsigned : 1;
5315 unsigned : 1;
5316 unsigned : 1;
5317 unsigned : 1;
5318 unsigned : 1;
5321 struct
5323 unsigned : 1;
5324 unsigned NOT_DONE : 1;
5325 unsigned : 1;
5326 unsigned : 1;
5327 unsigned : 1;
5328 unsigned : 1;
5329 unsigned : 1;
5330 unsigned : 1;
5333 struct
5335 unsigned : 2;
5336 unsigned CHS : 4;
5337 unsigned : 2;
5339 } __ADCON0bits_t;
5341 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5343 #define _ADON 0x01
5344 #define _GO_NOT_DONE 0x02
5345 #define _GO_DONE 0x02
5346 #define _DONE 0x02
5347 #define _GO 0x02
5348 #define _NOT_DONE 0x02
5349 #define _CHS0 0x04
5350 #define _CHS1 0x08
5351 #define _CHS2 0x10
5352 #define _CHS3 0x20
5353 #define _ADCAL 0x80
5355 //==============================================================================
5357 extern __at(0x0FC3) __sfr ADRES;
5358 extern __at(0x0FC3) __sfr ADRESL;
5359 extern __at(0x0FC4) __sfr ADRESH;
5361 //==============================================================================
5362 // SSP1CON2 Bits
5364 extern __at(0x0FC5) __sfr SSP1CON2;
5366 typedef union
5368 struct
5370 unsigned SEN : 1;
5371 unsigned RSEN : 1;
5372 unsigned PEN : 1;
5373 unsigned RCEN : 1;
5374 unsigned ACKEN : 1;
5375 unsigned ACKDT : 1;
5376 unsigned ACKSTAT : 1;
5377 unsigned GCEN : 1;
5380 struct
5382 unsigned : 1;
5383 unsigned ADMSK1 : 1;
5384 unsigned ADMSK2 : 1;
5385 unsigned ADMSK3 : 1;
5386 unsigned ADMSK4 : 1;
5387 unsigned ADMSK5 : 1;
5388 unsigned : 1;
5389 unsigned : 1;
5391 } __SSP1CON2bits_t;
5393 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5395 #define _SEN 0x01
5396 #define _RSEN 0x02
5397 #define _ADMSK1 0x02
5398 #define _PEN 0x04
5399 #define _ADMSK2 0x04
5400 #define _RCEN 0x08
5401 #define _ADMSK3 0x08
5402 #define _ACKEN 0x10
5403 #define _ADMSK4 0x10
5404 #define _ACKDT 0x20
5405 #define _ADMSK5 0x20
5406 #define _ACKSTAT 0x40
5407 #define _GCEN 0x80
5409 //==============================================================================
5412 //==============================================================================
5413 // SSPCON2 Bits
5415 extern __at(0x0FC5) __sfr SSPCON2;
5417 typedef union
5419 struct
5421 unsigned SEN : 1;
5422 unsigned RSEN : 1;
5423 unsigned PEN : 1;
5424 unsigned RCEN : 1;
5425 unsigned ACKEN : 1;
5426 unsigned ACKDT : 1;
5427 unsigned ACKSTAT : 1;
5428 unsigned GCEN : 1;
5431 struct
5433 unsigned : 1;
5434 unsigned ADMSK1 : 1;
5435 unsigned ADMSK2 : 1;
5436 unsigned ADMSK3 : 1;
5437 unsigned ADMSK4 : 1;
5438 unsigned ADMSK5 : 1;
5439 unsigned : 1;
5440 unsigned : 1;
5442 } __SSPCON2bits_t;
5444 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5446 #define _SSPCON2_SEN 0x01
5447 #define _SSPCON2_RSEN 0x02
5448 #define _SSPCON2_ADMSK1 0x02
5449 #define _SSPCON2_PEN 0x04
5450 #define _SSPCON2_ADMSK2 0x04
5451 #define _SSPCON2_RCEN 0x08
5452 #define _SSPCON2_ADMSK3 0x08
5453 #define _SSPCON2_ACKEN 0x10
5454 #define _SSPCON2_ADMSK4 0x10
5455 #define _SSPCON2_ACKDT 0x20
5456 #define _SSPCON2_ADMSK5 0x20
5457 #define _SSPCON2_ACKSTAT 0x40
5458 #define _SSPCON2_GCEN 0x80
5460 //==============================================================================
5463 //==============================================================================
5464 // SSP1CON1 Bits
5466 extern __at(0x0FC6) __sfr SSP1CON1;
5468 typedef union
5470 struct
5472 unsigned SSPM0 : 1;
5473 unsigned SSPM1 : 1;
5474 unsigned SSPM2 : 1;
5475 unsigned SSPM3 : 1;
5476 unsigned CKP : 1;
5477 unsigned SSPEN : 1;
5478 unsigned SSPOV : 1;
5479 unsigned WCOL : 1;
5482 struct
5484 unsigned SSPM : 4;
5485 unsigned : 4;
5487 } __SSP1CON1bits_t;
5489 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5491 #define _SSPM0 0x01
5492 #define _SSPM1 0x02
5493 #define _SSPM2 0x04
5494 #define _SSPM3 0x08
5495 #define _CKP 0x10
5496 #define _SSPEN 0x20
5497 #define _SSPOV 0x40
5498 #define _WCOL 0x80
5500 //==============================================================================
5503 //==============================================================================
5504 // SSPCON1 Bits
5506 extern __at(0x0FC6) __sfr SSPCON1;
5508 typedef union
5510 struct
5512 unsigned SSPM0 : 1;
5513 unsigned SSPM1 : 1;
5514 unsigned SSPM2 : 1;
5515 unsigned SSPM3 : 1;
5516 unsigned CKP : 1;
5517 unsigned SSPEN : 1;
5518 unsigned SSPOV : 1;
5519 unsigned WCOL : 1;
5522 struct
5524 unsigned SSPM : 4;
5525 unsigned : 4;
5527 } __SSPCON1bits_t;
5529 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5531 #define _SSPCON1_SSPM0 0x01
5532 #define _SSPCON1_SSPM1 0x02
5533 #define _SSPCON1_SSPM2 0x04
5534 #define _SSPCON1_SSPM3 0x08
5535 #define _SSPCON1_CKP 0x10
5536 #define _SSPCON1_SSPEN 0x20
5537 #define _SSPCON1_SSPOV 0x40
5538 #define _SSPCON1_WCOL 0x80
5540 //==============================================================================
5543 //==============================================================================
5544 // SSP1STAT Bits
5546 extern __at(0x0FC7) __sfr SSP1STAT;
5548 typedef union
5550 struct
5552 unsigned BF : 1;
5553 unsigned UA : 1;
5554 unsigned R_NOT_W : 1;
5555 unsigned S : 1;
5556 unsigned P : 1;
5557 unsigned D_NOT_A : 1;
5558 unsigned CKE : 1;
5559 unsigned SMP : 1;
5562 struct
5564 unsigned : 1;
5565 unsigned : 1;
5566 unsigned R : 1;
5567 unsigned I2C_START : 1;
5568 unsigned I2C_STOP : 1;
5569 unsigned D : 1;
5570 unsigned : 1;
5571 unsigned : 1;
5574 struct
5576 unsigned : 1;
5577 unsigned : 1;
5578 unsigned R_W : 1;
5579 unsigned : 1;
5580 unsigned : 1;
5581 unsigned D_A : 1;
5582 unsigned : 1;
5583 unsigned : 1;
5586 struct
5588 unsigned : 1;
5589 unsigned : 1;
5590 unsigned NOT_W : 1;
5591 unsigned : 1;
5592 unsigned : 1;
5593 unsigned NOT_A : 1;
5594 unsigned : 1;
5595 unsigned : 1;
5598 struct
5600 unsigned : 1;
5601 unsigned : 1;
5602 unsigned NOT_WRITE : 1;
5603 unsigned : 1;
5604 unsigned : 1;
5605 unsigned NOT_ADDRESS : 1;
5606 unsigned : 1;
5607 unsigned : 1;
5610 struct
5612 unsigned : 1;
5613 unsigned : 1;
5614 unsigned READ_WRITE : 1;
5615 unsigned : 1;
5616 unsigned : 1;
5617 unsigned DATA_ADDRESS : 1;
5618 unsigned : 1;
5619 unsigned : 1;
5622 struct
5624 unsigned : 1;
5625 unsigned : 1;
5626 unsigned I2C_READ : 1;
5627 unsigned : 1;
5628 unsigned : 1;
5629 unsigned I2C_DAT : 1;
5630 unsigned : 1;
5631 unsigned : 1;
5633 } __SSP1STATbits_t;
5635 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5637 #define _BF 0x01
5638 #define _UA 0x02
5639 #define _R_NOT_W 0x04
5640 #define _R 0x04
5641 #define _R_W 0x04
5642 #define _NOT_W 0x04
5643 #define _NOT_WRITE 0x04
5644 #define _READ_WRITE 0x04
5645 #define _I2C_READ 0x04
5646 #define _S 0x08
5647 #define _I2C_START 0x08
5648 #define _P 0x10
5649 #define _I2C_STOP 0x10
5650 #define _D_NOT_A 0x20
5651 #define _D 0x20
5652 #define _D_A 0x20
5653 #define _NOT_A 0x20
5654 #define _NOT_ADDRESS 0x20
5655 #define _DATA_ADDRESS 0x20
5656 #define _I2C_DAT 0x20
5657 #define _CKE 0x40
5658 #define _SMP 0x80
5660 //==============================================================================
5663 //==============================================================================
5664 // SSPSTAT Bits
5666 extern __at(0x0FC7) __sfr SSPSTAT;
5668 typedef union
5670 struct
5672 unsigned BF : 1;
5673 unsigned UA : 1;
5674 unsigned R_NOT_W : 1;
5675 unsigned S : 1;
5676 unsigned P : 1;
5677 unsigned D_NOT_A : 1;
5678 unsigned CKE : 1;
5679 unsigned SMP : 1;
5682 struct
5684 unsigned : 1;
5685 unsigned : 1;
5686 unsigned R : 1;
5687 unsigned I2C_START : 1;
5688 unsigned I2C_STOP : 1;
5689 unsigned D : 1;
5690 unsigned : 1;
5691 unsigned : 1;
5694 struct
5696 unsigned : 1;
5697 unsigned : 1;
5698 unsigned R_W : 1;
5699 unsigned : 1;
5700 unsigned : 1;
5701 unsigned D_A : 1;
5702 unsigned : 1;
5703 unsigned : 1;
5706 struct
5708 unsigned : 1;
5709 unsigned : 1;
5710 unsigned NOT_W : 1;
5711 unsigned : 1;
5712 unsigned : 1;
5713 unsigned NOT_A : 1;
5714 unsigned : 1;
5715 unsigned : 1;
5718 struct
5720 unsigned : 1;
5721 unsigned : 1;
5722 unsigned NOT_WRITE : 1;
5723 unsigned : 1;
5724 unsigned : 1;
5725 unsigned NOT_ADDRESS : 1;
5726 unsigned : 1;
5727 unsigned : 1;
5730 struct
5732 unsigned : 1;
5733 unsigned : 1;
5734 unsigned READ_WRITE : 1;
5735 unsigned : 1;
5736 unsigned : 1;
5737 unsigned DATA_ADDRESS : 1;
5738 unsigned : 1;
5739 unsigned : 1;
5742 struct
5744 unsigned : 1;
5745 unsigned : 1;
5746 unsigned I2C_READ : 1;
5747 unsigned : 1;
5748 unsigned : 1;
5749 unsigned I2C_DAT : 1;
5750 unsigned : 1;
5751 unsigned : 1;
5753 } __SSPSTATbits_t;
5755 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5757 #define _SSPSTAT_BF 0x01
5758 #define _SSPSTAT_UA 0x02
5759 #define _SSPSTAT_R_NOT_W 0x04
5760 #define _SSPSTAT_R 0x04
5761 #define _SSPSTAT_R_W 0x04
5762 #define _SSPSTAT_NOT_W 0x04
5763 #define _SSPSTAT_NOT_WRITE 0x04
5764 #define _SSPSTAT_READ_WRITE 0x04
5765 #define _SSPSTAT_I2C_READ 0x04
5766 #define _SSPSTAT_S 0x08
5767 #define _SSPSTAT_I2C_START 0x08
5768 #define _SSPSTAT_P 0x10
5769 #define _SSPSTAT_I2C_STOP 0x10
5770 #define _SSPSTAT_D_NOT_A 0x20
5771 #define _SSPSTAT_D 0x20
5772 #define _SSPSTAT_D_A 0x20
5773 #define _SSPSTAT_NOT_A 0x20
5774 #define _SSPSTAT_NOT_ADDRESS 0x20
5775 #define _SSPSTAT_DATA_ADDRESS 0x20
5776 #define _SSPSTAT_I2C_DAT 0x20
5777 #define _SSPSTAT_CKE 0x40
5778 #define _SSPSTAT_SMP 0x80
5780 //==============================================================================
5782 extern __at(0x0FC8) __sfr SSP1ADD;
5783 extern __at(0x0FC8) __sfr SSPADD;
5784 extern __at(0x0FC9) __sfr SSP1BUF;
5785 extern __at(0x0FC9) __sfr SSPBUF;
5787 //==============================================================================
5788 // T2CON Bits
5790 extern __at(0x0FCA) __sfr T2CON;
5792 typedef union
5794 struct
5796 unsigned T2CKPS0 : 1;
5797 unsigned T2CKPS1 : 1;
5798 unsigned TMR2ON : 1;
5799 unsigned T2OUTPS0 : 1;
5800 unsigned T2OUTPS1 : 1;
5801 unsigned T2OUTPS2 : 1;
5802 unsigned T2OUTPS3 : 1;
5803 unsigned : 1;
5806 struct
5808 unsigned T2CKPS : 2;
5809 unsigned : 6;
5812 struct
5814 unsigned : 3;
5815 unsigned T2OUTPS : 4;
5816 unsigned : 1;
5818 } __T2CONbits_t;
5820 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5822 #define _T2CKPS0 0x01
5823 #define _T2CKPS1 0x02
5824 #define _TMR2ON 0x04
5825 #define _T2OUTPS0 0x08
5826 #define _T2OUTPS1 0x10
5827 #define _T2OUTPS2 0x20
5828 #define _T2OUTPS3 0x40
5830 //==============================================================================
5832 extern __at(0x0FCB) __sfr PR2;
5833 extern __at(0x0FCC) __sfr TMR2;
5835 //==============================================================================
5836 // T1CON Bits
5838 extern __at(0x0FCD) __sfr T1CON;
5840 typedef union
5842 struct
5844 unsigned TMR1ON : 1;
5845 unsigned TMR1CS : 1;
5846 unsigned NOT_T1SYNC : 1;
5847 unsigned T1OSCEN : 1;
5848 unsigned T1CKPS0 : 1;
5849 unsigned T1CKPS1 : 1;
5850 unsigned T1RUN : 1;
5851 unsigned RD16 : 1;
5854 struct
5856 unsigned : 1;
5857 unsigned : 1;
5858 unsigned T1INSYNC : 1;
5859 unsigned : 1;
5860 unsigned : 1;
5861 unsigned : 1;
5862 unsigned : 1;
5863 unsigned : 1;
5866 struct
5868 unsigned : 1;
5869 unsigned : 1;
5870 unsigned T1SYNC : 1;
5871 unsigned : 1;
5872 unsigned : 1;
5873 unsigned : 1;
5874 unsigned : 1;
5875 unsigned : 1;
5878 struct
5880 unsigned : 4;
5881 unsigned T1CKPS : 2;
5882 unsigned : 2;
5884 } __T1CONbits_t;
5886 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5888 #define _TMR1ON 0x01
5889 #define _TMR1CS 0x02
5890 #define _NOT_T1SYNC 0x04
5891 #define _T1INSYNC 0x04
5892 #define _T1SYNC 0x04
5893 #define _T1OSCEN 0x08
5894 #define _T1CKPS0 0x10
5895 #define _T1CKPS1 0x20
5896 #define _T1RUN 0x40
5897 #define _RD16 0x80
5899 //==============================================================================
5901 extern __at(0x0FCE) __sfr TMR1;
5902 extern __at(0x0FCE) __sfr TMR1L;
5903 extern __at(0x0FCF) __sfr TMR1H;
5905 //==============================================================================
5906 // RCON Bits
5908 extern __at(0x0FD0) __sfr RCON;
5910 typedef union
5912 struct
5914 unsigned NOT_BOR : 1;
5915 unsigned NOT_POR : 1;
5916 unsigned NOT_PD : 1;
5917 unsigned NOT_TO : 1;
5918 unsigned NOT_RI : 1;
5919 unsigned NOT_CM : 1;
5920 unsigned : 1;
5921 unsigned IPEN : 1;
5924 struct
5926 unsigned BOR : 1;
5927 unsigned POR : 1;
5928 unsigned PD : 1;
5929 unsigned TO : 1;
5930 unsigned RI : 1;
5931 unsigned CM : 1;
5932 unsigned : 1;
5933 unsigned : 1;
5935 } __RCONbits_t;
5937 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5939 #define _NOT_BOR 0x01
5940 #define _BOR 0x01
5941 #define _NOT_POR 0x02
5942 #define _POR 0x02
5943 #define _NOT_PD 0x04
5944 #define _PD 0x04
5945 #define _NOT_TO 0x08
5946 #define _TO 0x08
5947 #define _NOT_RI 0x10
5948 #define _RI 0x10
5949 #define _NOT_CM 0x20
5950 #define _CM 0x20
5951 #define _IPEN 0x80
5953 //==============================================================================
5956 //==============================================================================
5957 // WDTCON Bits
5959 extern __at(0x0FD1) __sfr WDTCON;
5961 typedef union
5963 struct
5965 unsigned SWDTEN : 1;
5966 unsigned : 1;
5967 unsigned : 1;
5968 unsigned : 1;
5969 unsigned : 1;
5970 unsigned : 1;
5971 unsigned : 1;
5972 unsigned REGSLP : 1;
5975 struct
5977 unsigned SWDTE : 1;
5978 unsigned : 1;
5979 unsigned : 1;
5980 unsigned : 1;
5981 unsigned : 1;
5982 unsigned : 1;
5983 unsigned : 1;
5984 unsigned : 1;
5986 } __WDTCONbits_t;
5988 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5990 #define _SWDTEN 0x01
5991 #define _SWDTE 0x01
5992 #define _REGSLP 0x80
5994 //==============================================================================
5997 //==============================================================================
5998 // LCDREG Bits
6000 extern __at(0x0FD2) __sfr LCDREG;
6002 typedef union
6004 struct
6006 unsigned CKSEL0 : 1;
6007 unsigned CKSEL1 : 1;
6008 unsigned MODE13 : 1;
6009 unsigned BIAS0 : 1;
6010 unsigned BIAS1 : 1;
6011 unsigned BIAS2 : 1;
6012 unsigned CPEN : 1;
6013 unsigned : 1;
6016 struct
6018 unsigned CKSEL : 2;
6019 unsigned : 6;
6022 struct
6024 unsigned : 3;
6025 unsigned BIAS : 3;
6026 unsigned : 2;
6028 } __LCDREGbits_t;
6030 extern __at(0x0FD2) volatile __LCDREGbits_t LCDREGbits;
6032 #define _CKSEL0 0x01
6033 #define _CKSEL1 0x02
6034 #define _MODE13 0x04
6035 #define _BIAS0 0x08
6036 #define _BIAS1 0x10
6037 #define _BIAS2 0x20
6038 #define _CPEN 0x40
6040 //==============================================================================
6043 //==============================================================================
6044 // OSCCON Bits
6046 extern __at(0x0FD3) __sfr OSCCON;
6048 typedef union
6050 struct
6052 unsigned SCS0 : 1;
6053 unsigned SCS1 : 1;
6054 unsigned IOFS : 1;
6055 unsigned OSTS : 1;
6056 unsigned IRCF0 : 1;
6057 unsigned IRCF1 : 1;
6058 unsigned IRCF2 : 1;
6059 unsigned IDLEN : 1;
6062 struct
6064 unsigned SCS : 2;
6065 unsigned : 6;
6068 struct
6070 unsigned : 4;
6071 unsigned IRCF : 3;
6072 unsigned : 1;
6074 } __OSCCONbits_t;
6076 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6078 #define _SCS0 0x01
6079 #define _SCS1 0x02
6080 #define _IOFS 0x04
6081 #define _OSTS 0x08
6082 #define _IRCF0 0x10
6083 #define _IRCF1 0x20
6084 #define _IRCF2 0x40
6085 #define _IDLEN 0x80
6087 //==============================================================================
6090 //==============================================================================
6091 // T0CON Bits
6093 extern __at(0x0FD5) __sfr T0CON;
6095 typedef union
6097 struct
6099 unsigned T0PS0 : 1;
6100 unsigned T0PS1 : 1;
6101 unsigned T0PS2 : 1;
6102 unsigned PSA : 1;
6103 unsigned T0SE : 1;
6104 unsigned T0CS : 1;
6105 unsigned T08BIT : 1;
6106 unsigned TMR0ON : 1;
6109 struct
6111 unsigned : 1;
6112 unsigned : 1;
6113 unsigned : 1;
6114 unsigned T0PS3 : 1;
6115 unsigned : 1;
6116 unsigned : 1;
6117 unsigned : 1;
6118 unsigned : 1;
6121 struct
6123 unsigned T0PS : 4;
6124 unsigned : 4;
6126 } __T0CONbits_t;
6128 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6130 #define _T0PS0 0x01
6131 #define _T0PS1 0x02
6132 #define _T0PS2 0x04
6133 #define _PSA 0x08
6134 #define _T0PS3 0x08
6135 #define _T0SE 0x10
6136 #define _T0CS 0x20
6137 #define _T08BIT 0x40
6138 #define _TMR0ON 0x80
6140 //==============================================================================
6142 extern __at(0x0FD6) __sfr TMR0;
6143 extern __at(0x0FD6) __sfr TMR0L;
6144 extern __at(0x0FD7) __sfr TMR0H;
6146 //==============================================================================
6147 // STATUS Bits
6149 extern __at(0x0FD8) __sfr STATUS;
6151 typedef struct
6153 unsigned C : 1;
6154 unsigned DC : 1;
6155 unsigned Z : 1;
6156 unsigned OV : 1;
6157 unsigned N : 1;
6158 unsigned : 1;
6159 unsigned : 1;
6160 unsigned : 1;
6161 } __STATUSbits_t;
6163 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6165 #define _C 0x01
6166 #define _DC 0x02
6167 #define _Z 0x04
6168 #define _OV 0x08
6169 #define _N 0x10
6171 //==============================================================================
6173 extern __at(0x0FD9) __sfr FSR2L;
6174 extern __at(0x0FDA) __sfr FSR2H;
6175 extern __at(0x0FDB) __sfr PLUSW2;
6176 extern __at(0x0FDC) __sfr PREINC2;
6177 extern __at(0x0FDD) __sfr POSTDEC2;
6178 extern __at(0x0FDE) __sfr POSTINC2;
6179 extern __at(0x0FDF) __sfr INDF2;
6180 extern __at(0x0FE0) __sfr BSR;
6181 extern __at(0x0FE1) __sfr FSR1L;
6182 extern __at(0x0FE2) __sfr FSR1H;
6183 extern __at(0x0FE3) __sfr PLUSW1;
6184 extern __at(0x0FE4) __sfr PREINC1;
6185 extern __at(0x0FE5) __sfr POSTDEC1;
6186 extern __at(0x0FE6) __sfr POSTINC1;
6187 extern __at(0x0FE7) __sfr INDF1;
6188 extern __at(0x0FE8) __sfr WREG;
6189 extern __at(0x0FE9) __sfr FSR0L;
6190 extern __at(0x0FEA) __sfr FSR0H;
6191 extern __at(0x0FEB) __sfr PLUSW0;
6192 extern __at(0x0FEC) __sfr PREINC0;
6193 extern __at(0x0FED) __sfr POSTDEC0;
6194 extern __at(0x0FEE) __sfr POSTINC0;
6195 extern __at(0x0FEF) __sfr INDF0;
6197 //==============================================================================
6198 // INTCON3 Bits
6200 extern __at(0x0FF0) __sfr INTCON3;
6202 typedef union
6204 struct
6206 unsigned INT1IF : 1;
6207 unsigned INT2IF : 1;
6208 unsigned INT3IF : 1;
6209 unsigned INT1IE : 1;
6210 unsigned INT2IE : 1;
6211 unsigned INT3IE : 1;
6212 unsigned INT1IP : 1;
6213 unsigned INT2IP : 1;
6216 struct
6218 unsigned INT1F : 1;
6219 unsigned INT2F : 1;
6220 unsigned INT3F : 1;
6221 unsigned INT1E : 1;
6222 unsigned INT2E : 1;
6223 unsigned INT3E : 1;
6224 unsigned INT1P : 1;
6225 unsigned INT2P : 1;
6227 } __INTCON3bits_t;
6229 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6231 #define _INT1IF 0x01
6232 #define _INT1F 0x01
6233 #define _INT2IF 0x02
6234 #define _INT2F 0x02
6235 #define _INT3IF 0x04
6236 #define _INT3F 0x04
6237 #define _INT1IE 0x08
6238 #define _INT1E 0x08
6239 #define _INT2IE 0x10
6240 #define _INT2E 0x10
6241 #define _INT3IE 0x20
6242 #define _INT3E 0x20
6243 #define _INT1IP 0x40
6244 #define _INT1P 0x40
6245 #define _INT2IP 0x80
6246 #define _INT2P 0x80
6248 //==============================================================================
6251 //==============================================================================
6252 // INTCON2 Bits
6254 extern __at(0x0FF1) __sfr INTCON2;
6256 typedef union
6258 struct
6260 unsigned RBIP : 1;
6261 unsigned INT3IP : 1;
6262 unsigned TMR0IP : 1;
6263 unsigned INTEDG3 : 1;
6264 unsigned INTEDG2 : 1;
6265 unsigned INTEDG1 : 1;
6266 unsigned INTEDG0 : 1;
6267 unsigned NOT_RBPU : 1;
6270 struct
6272 unsigned : 1;
6273 unsigned INT3P : 1;
6274 unsigned T0IP : 1;
6275 unsigned : 1;
6276 unsigned : 1;
6277 unsigned : 1;
6278 unsigned : 1;
6279 unsigned RBPU : 1;
6281 } __INTCON2bits_t;
6283 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6285 #define _RBIP 0x01
6286 #define _INT3IP 0x02
6287 #define _INT3P 0x02
6288 #define _TMR0IP 0x04
6289 #define _T0IP 0x04
6290 #define _INTEDG3 0x08
6291 #define _INTEDG2 0x10
6292 #define _INTEDG1 0x20
6293 #define _INTEDG0 0x40
6294 #define _NOT_RBPU 0x80
6295 #define _RBPU 0x80
6297 //==============================================================================
6300 //==============================================================================
6301 // INTCON Bits
6303 extern __at(0x0FF2) __sfr INTCON;
6305 typedef union
6307 struct
6309 unsigned RBIF : 1;
6310 unsigned INT0IF : 1;
6311 unsigned TMR0IF : 1;
6312 unsigned RBIE : 1;
6313 unsigned INT0IE : 1;
6314 unsigned TMR0IE : 1;
6315 unsigned PEIE_GIEL : 1;
6316 unsigned GIE_GIEH : 1;
6319 struct
6321 unsigned : 1;
6322 unsigned INT0F : 1;
6323 unsigned T0IF : 1;
6324 unsigned : 1;
6325 unsigned INT0E : 1;
6326 unsigned T0IE : 1;
6327 unsigned PEIE : 1;
6328 unsigned GIE : 1;
6331 struct
6333 unsigned : 1;
6334 unsigned : 1;
6335 unsigned : 1;
6336 unsigned : 1;
6337 unsigned : 1;
6338 unsigned : 1;
6339 unsigned GIEL : 1;
6340 unsigned GIEH : 1;
6342 } __INTCONbits_t;
6344 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6346 #define _RBIF 0x01
6347 #define _INT0IF 0x02
6348 #define _INT0F 0x02
6349 #define _TMR0IF 0x04
6350 #define _T0IF 0x04
6351 #define _RBIE 0x08
6352 #define _INT0IE 0x10
6353 #define _INT0E 0x10
6354 #define _TMR0IE 0x20
6355 #define _T0IE 0x20
6356 #define _PEIE_GIEL 0x40
6357 #define _PEIE 0x40
6358 #define _GIEL 0x40
6359 #define _GIE_GIEH 0x80
6360 #define _GIE 0x80
6361 #define _GIEH 0x80
6363 //==============================================================================
6365 extern __at(0x0FF3) __sfr PROD;
6366 extern __at(0x0FF3) __sfr PRODL;
6367 extern __at(0x0FF4) __sfr PRODH;
6368 extern __at(0x0FF5) __sfr TABLAT;
6369 extern __at(0x0FF6) __sfr TBLPTR;
6370 extern __at(0x0FF6) __sfr TBLPTRL;
6371 extern __at(0x0FF7) __sfr TBLPTRH;
6372 extern __at(0x0FF8) __sfr TBLPTRU;
6373 extern __at(0x0FF9) __sfr PC;
6374 extern __at(0x0FF9) __sfr PCL;
6375 extern __at(0x0FFA) __sfr PCLATH;
6376 extern __at(0x0FFB) __sfr PCLATU;
6378 //==============================================================================
6379 // STKPTR Bits
6381 extern __at(0x0FFC) __sfr STKPTR;
6383 typedef union
6385 struct
6387 unsigned SP0 : 1;
6388 unsigned SP1 : 1;
6389 unsigned SP2 : 1;
6390 unsigned SP3 : 1;
6391 unsigned SP4 : 1;
6392 unsigned : 1;
6393 unsigned STKUNF : 1;
6394 unsigned STKFUL : 1;
6397 struct
6399 unsigned STKPTR0 : 1;
6400 unsigned STKPTR1 : 1;
6401 unsigned STKPTR2 : 1;
6402 unsigned STKPTR3 : 1;
6403 unsigned STKPTR4 : 1;
6404 unsigned : 1;
6405 unsigned : 1;
6406 unsigned STKOVF : 1;
6409 struct
6411 unsigned SP : 5;
6412 unsigned : 3;
6415 struct
6417 unsigned STKPTR : 5;
6418 unsigned : 3;
6420 } __STKPTRbits_t;
6422 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6424 #define _SP0 0x01
6425 #define _STKPTR0 0x01
6426 #define _SP1 0x02
6427 #define _STKPTR1 0x02
6428 #define _SP2 0x04
6429 #define _STKPTR2 0x04
6430 #define _SP3 0x08
6431 #define _STKPTR3 0x08
6432 #define _SP4 0x10
6433 #define _STKPTR4 0x10
6434 #define _STKUNF 0x40
6435 #define _STKFUL 0x80
6436 #define _STKOVF 0x80
6438 //==============================================================================
6440 extern __at(0x0FFD) __sfr TOS;
6441 extern __at(0x0FFD) __sfr TOSL;
6442 extern __at(0x0FFE) __sfr TOSH;
6443 extern __at(0x0FFF) __sfr TOSU;
6445 //==============================================================================
6447 // Configuration Addresses
6449 //==============================================================================
6451 #define __CONFIG1L 0x007FF8
6452 #define __CONFIG1H 0x007FF9
6453 #define __CONFIG2L 0x007FFA
6454 #define __CONFIG2H 0x007FFB
6455 #define __CONFIG3L 0x007FFC
6456 #define __CONFIG3H 0x007FFD
6458 //==============================================================================
6460 #endif // #ifndef __PIC18F85J90_H__