struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f6393.h
blob94701ac6e34e8e59b94895b204de6b8a3bef7519
1 /*
2 * This declarations of the PIC18F6393 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:48 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 __PIC18F6393_H__
26 #define __PIC18F6393_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // LCDPS Bits
40 extern __at(0x0F58) __sfr LCDPS;
42 typedef union
44 struct
46 unsigned LP0 : 1;
47 unsigned LP1 : 1;
48 unsigned LP2 : 1;
49 unsigned LP3 : 1;
50 unsigned WA : 1;
51 unsigned LCDA : 1;
52 unsigned BIASMD : 1;
53 unsigned WFT : 1;
56 struct
58 unsigned LCDPS0 : 1;
59 unsigned LCDPS1 : 1;
60 unsigned LCDPS2 : 1;
61 unsigned LCDPS3 : 1;
62 unsigned : 1;
63 unsigned : 1;
64 unsigned : 1;
65 unsigned : 1;
68 struct
70 unsigned LCDPS : 4;
71 unsigned : 4;
74 struct
76 unsigned LP : 4;
77 unsigned : 4;
79 } __LCDPSbits_t;
81 extern __at(0x0F58) volatile __LCDPSbits_t LCDPSbits;
83 #define _LP0 0x01
84 #define _LCDPS0 0x01
85 #define _LP1 0x02
86 #define _LCDPS1 0x02
87 #define _LP2 0x04
88 #define _LCDPS2 0x04
89 #define _LP3 0x08
90 #define _LCDPS3 0x08
91 #define _WA 0x10
92 #define _LCDA 0x20
93 #define _BIASMD 0x40
94 #define _WFT 0x80
96 //==============================================================================
99 //==============================================================================
100 // LCDCON Bits
102 extern __at(0x0F59) __sfr LCDCON;
104 typedef union
106 struct
108 unsigned LMUX0 : 1;
109 unsigned LMUX1 : 1;
110 unsigned CS0 : 1;
111 unsigned CS1 : 1;
112 unsigned : 1;
113 unsigned WERR : 1;
114 unsigned SLPEN : 1;
115 unsigned LCDEN : 1;
118 struct
120 unsigned : 1;
121 unsigned : 1;
122 unsigned LCDCS0 : 1;
123 unsigned LCDCS1 : 1;
124 unsigned : 1;
125 unsigned LCDWERR : 1;
126 unsigned LCDSLPEN : 1;
127 unsigned : 1;
130 struct
132 unsigned LMUX : 2;
133 unsigned : 6;
136 struct
138 unsigned : 2;
139 unsigned CS : 2;
140 unsigned : 4;
143 struct
145 unsigned : 2;
146 unsigned LCDCS : 2;
147 unsigned : 4;
149 } __LCDCONbits_t;
151 extern __at(0x0F59) volatile __LCDCONbits_t LCDCONbits;
153 #define _LMUX0 0x01
154 #define _LMUX1 0x02
155 #define _CS0 0x04
156 #define _LCDCS0 0x04
157 #define _CS1 0x08
158 #define _LCDCS1 0x08
159 #define _WERR 0x20
160 #define _LCDWERR 0x20
161 #define _SLPEN 0x40
162 #define _LCDSLPEN 0x40
163 #define _LCDEN 0x80
165 //==============================================================================
168 //==============================================================================
169 // LCDSE0 Bits
171 extern __at(0x0F5A) __sfr LCDSE0;
173 typedef union
175 struct
177 unsigned SE0 : 1;
178 unsigned SE1 : 1;
179 unsigned SE2 : 1;
180 unsigned SE3 : 1;
181 unsigned SE4 : 1;
182 unsigned SE5 : 1;
183 unsigned SE6 : 1;
184 unsigned SE7 : 1;
187 struct
189 unsigned SEGEN0 : 1;
190 unsigned SEGEN1 : 1;
191 unsigned SEGEN2 : 1;
192 unsigned SEGEN3 : 1;
193 unsigned SEGEN4 : 1;
194 unsigned SEGEN5 : 1;
195 unsigned SEGEN6 : 1;
196 unsigned SEGEN7 : 1;
198 } __LCDSE0bits_t;
200 extern __at(0x0F5A) volatile __LCDSE0bits_t LCDSE0bits;
202 #define _SE0 0x01
203 #define _SEGEN0 0x01
204 #define _SE1 0x02
205 #define _SEGEN1 0x02
206 #define _SE2 0x04
207 #define _SEGEN2 0x04
208 #define _SE3 0x08
209 #define _SEGEN3 0x08
210 #define _SE4 0x10
211 #define _SEGEN4 0x10
212 #define _SE5 0x20
213 #define _SEGEN5 0x20
214 #define _SE6 0x40
215 #define _SEGEN6 0x40
216 #define _SE7 0x80
217 #define _SEGEN7 0x80
219 //==============================================================================
222 //==============================================================================
223 // LCDSE1 Bits
225 extern __at(0x0F5B) __sfr LCDSE1;
227 typedef union
229 struct
231 unsigned SE8 : 1;
232 unsigned SE9 : 1;
233 unsigned SE10 : 1;
234 unsigned SE11 : 1;
235 unsigned SE12 : 1;
236 unsigned SE13 : 1;
237 unsigned SE14 : 1;
238 unsigned SE15 : 1;
241 struct
243 unsigned SEGEN8 : 1;
244 unsigned SEGEN9 : 1;
245 unsigned SEGEN10 : 1;
246 unsigned SEGEN11 : 1;
247 unsigned SEGEN12 : 1;
248 unsigned SEGEN13 : 1;
249 unsigned SEGEN14 : 1;
250 unsigned SEGEN15 : 1;
252 } __LCDSE1bits_t;
254 extern __at(0x0F5B) volatile __LCDSE1bits_t LCDSE1bits;
256 #define _SE8 0x01
257 #define _SEGEN8 0x01
258 #define _SE9 0x02
259 #define _SEGEN9 0x02
260 #define _SE10 0x04
261 #define _SEGEN10 0x04
262 #define _SE11 0x08
263 #define _SEGEN11 0x08
264 #define _SE12 0x10
265 #define _SEGEN12 0x10
266 #define _SE13 0x20
267 #define _SEGEN13 0x20
268 #define _SE14 0x40
269 #define _SEGEN14 0x40
270 #define _SE15 0x80
271 #define _SEGEN15 0x80
273 //==============================================================================
276 //==============================================================================
277 // LCDSE2 Bits
279 extern __at(0x0F5C) __sfr LCDSE2;
281 typedef union
283 struct
285 unsigned SE16 : 1;
286 unsigned SE17 : 1;
287 unsigned SE18 : 1;
288 unsigned SE19 : 1;
289 unsigned SE20 : 1;
290 unsigned SE21 : 1;
291 unsigned SE22 : 1;
292 unsigned SE23 : 1;
295 struct
297 unsigned SEGEN16 : 1;
298 unsigned SEGEN17 : 1;
299 unsigned SEGEN18 : 1;
300 unsigned SEGEN19 : 1;
301 unsigned SEGEN20 : 1;
302 unsigned SEGEN21 : 1;
303 unsigned SEGEN22 : 1;
304 unsigned SEGEN23 : 1;
306 } __LCDSE2bits_t;
308 extern __at(0x0F5C) volatile __LCDSE2bits_t LCDSE2bits;
310 #define _SE16 0x01
311 #define _SEGEN16 0x01
312 #define _SE17 0x02
313 #define _SEGEN17 0x02
314 #define _SE18 0x04
315 #define _SEGEN18 0x04
316 #define _SE19 0x08
317 #define _SEGEN19 0x08
318 #define _SE20 0x10
319 #define _SEGEN20 0x10
320 #define _SE21 0x20
321 #define _SEGEN21 0x20
322 #define _SE22 0x40
323 #define _SEGEN22 0x40
324 #define _SE23 0x80
325 #define _SEGEN23 0x80
327 //==============================================================================
330 //==============================================================================
331 // LCDSE3 Bits
333 extern __at(0x0F5D) __sfr LCDSE3;
335 typedef union
337 struct
339 unsigned SE24 : 1;
340 unsigned SE25 : 1;
341 unsigned SE26 : 1;
342 unsigned SE27 : 1;
343 unsigned SE28 : 1;
344 unsigned SE29 : 1;
345 unsigned SE30 : 1;
346 unsigned SE31 : 1;
349 struct
351 unsigned SEGEN24 : 1;
352 unsigned SEGEN25 : 1;
353 unsigned SEGEN26 : 1;
354 unsigned SEGEN27 : 1;
355 unsigned SEGEN28 : 1;
356 unsigned SEGEN29 : 1;
357 unsigned SEGEN30 : 1;
358 unsigned SEGEN31 : 1;
360 } __LCDSE3bits_t;
362 extern __at(0x0F5D) volatile __LCDSE3bits_t LCDSE3bits;
364 #define _SE24 0x01
365 #define _SEGEN24 0x01
366 #define _SE25 0x02
367 #define _SEGEN25 0x02
368 #define _SE26 0x04
369 #define _SEGEN26 0x04
370 #define _SE27 0x08
371 #define _SEGEN27 0x08
372 #define _SE28 0x10
373 #define _SEGEN28 0x10
374 #define _SE29 0x20
375 #define _SEGEN29 0x20
376 #define _SE30 0x40
377 #define _SEGEN30 0x40
378 #define _SE31 0x80
379 #define _SEGEN31 0x80
381 //==============================================================================
384 //==============================================================================
385 // LCDDATA0 Bits
387 extern __at(0x0F60) __sfr LCDDATA0;
389 typedef union
391 struct
393 unsigned S0C0 : 1;
394 unsigned S1C0 : 1;
395 unsigned S2C0 : 1;
396 unsigned S3C0 : 1;
397 unsigned S4C0 : 1;
398 unsigned S5C0 : 1;
399 unsigned S6C0 : 1;
400 unsigned S7C0 : 1;
403 struct
405 unsigned SEG0COM0 : 1;
406 unsigned SEG1COM0 : 1;
407 unsigned SEG2COM0 : 1;
408 unsigned SEG3COM0 : 1;
409 unsigned SEG4COM0 : 1;
410 unsigned SEG5COM0 : 1;
411 unsigned SEG6COM0 : 1;
412 unsigned SEG7COM0 : 1;
415 struct
417 unsigned S00C0 : 1;
418 unsigned S01C0 : 1;
419 unsigned S02C0 : 1;
420 unsigned S03C0 : 1;
421 unsigned S04C0 : 1;
422 unsigned S05C0 : 1;
423 unsigned S06C0 : 1;
424 unsigned S07C0 : 1;
426 } __LCDDATA0bits_t;
428 extern __at(0x0F60) volatile __LCDDATA0bits_t LCDDATA0bits;
430 #define _S0C0 0x01
431 #define _SEG0COM0 0x01
432 #define _S00C0 0x01
433 #define _S1C0 0x02
434 #define _SEG1COM0 0x02
435 #define _S01C0 0x02
436 #define _S2C0 0x04
437 #define _SEG2COM0 0x04
438 #define _S02C0 0x04
439 #define _S3C0 0x08
440 #define _SEG3COM0 0x08
441 #define _S03C0 0x08
442 #define _S4C0 0x10
443 #define _SEG4COM0 0x10
444 #define _S04C0 0x10
445 #define _S5C0 0x20
446 #define _SEG5COM0 0x20
447 #define _S05C0 0x20
448 #define _S6C0 0x40
449 #define _SEG6COM0 0x40
450 #define _S06C0 0x40
451 #define _S7C0 0x80
452 #define _SEG7COM0 0x80
453 #define _S07C0 0x80
455 //==============================================================================
458 //==============================================================================
459 // LCDDATA1 Bits
461 extern __at(0x0F61) __sfr LCDDATA1;
463 typedef union
465 struct
467 unsigned S8C0 : 1;
468 unsigned S9C0 : 1;
469 unsigned S10C0 : 1;
470 unsigned S11C0 : 1;
471 unsigned S12C0 : 1;
472 unsigned S13C0 : 1;
473 unsigned S14C0 : 1;
474 unsigned S15C0 : 1;
477 struct
479 unsigned SEG8COM0 : 1;
480 unsigned SEG9COM0 : 1;
481 unsigned SEG10COM0 : 1;
482 unsigned SEG11COM0 : 1;
483 unsigned SEG12COM0 : 1;
484 unsigned SEG13COM0 : 1;
485 unsigned SEG14COM0 : 1;
486 unsigned SEG15COM0 : 1;
489 struct
491 unsigned S08C0 : 1;
492 unsigned S09C0 : 1;
493 unsigned : 1;
494 unsigned : 1;
495 unsigned : 1;
496 unsigned : 1;
497 unsigned : 1;
498 unsigned : 1;
500 } __LCDDATA1bits_t;
502 extern __at(0x0F61) volatile __LCDDATA1bits_t LCDDATA1bits;
504 #define _S8C0 0x01
505 #define _SEG8COM0 0x01
506 #define _S08C0 0x01
507 #define _S9C0 0x02
508 #define _SEG9COM0 0x02
509 #define _S09C0 0x02
510 #define _S10C0 0x04
511 #define _SEG10COM0 0x04
512 #define _S11C0 0x08
513 #define _SEG11COM0 0x08
514 #define _S12C0 0x10
515 #define _SEG12COM0 0x10
516 #define _S13C0 0x20
517 #define _SEG13COM0 0x20
518 #define _S14C0 0x40
519 #define _SEG14COM0 0x40
520 #define _S15C0 0x80
521 #define _SEG15COM0 0x80
523 //==============================================================================
526 //==============================================================================
527 // LCDDATA2 Bits
529 extern __at(0x0F62) __sfr LCDDATA2;
531 typedef union
533 struct
535 unsigned S16C0 : 1;
536 unsigned S17C0 : 1;
537 unsigned S18C0 : 1;
538 unsigned S19C0 : 1;
539 unsigned S20C0 : 1;
540 unsigned S21C0 : 1;
541 unsigned S22C0 : 1;
542 unsigned S23C0 : 1;
545 struct
547 unsigned SEG16COM0 : 1;
548 unsigned SEG17COM0 : 1;
549 unsigned SEG18COM0 : 1;
550 unsigned SEG19COM0 : 1;
551 unsigned SEG20COM0 : 1;
552 unsigned SEG21COM0 : 1;
553 unsigned SEG22COM0 : 1;
554 unsigned SEG23COM0 : 1;
556 } __LCDDATA2bits_t;
558 extern __at(0x0F62) volatile __LCDDATA2bits_t LCDDATA2bits;
560 #define _S16C0 0x01
561 #define _SEG16COM0 0x01
562 #define _S17C0 0x02
563 #define _SEG17COM0 0x02
564 #define _S18C0 0x04
565 #define _SEG18COM0 0x04
566 #define _S19C0 0x08
567 #define _SEG19COM0 0x08
568 #define _S20C0 0x10
569 #define _SEG20COM0 0x10
570 #define _S21C0 0x20
571 #define _SEG21COM0 0x20
572 #define _S22C0 0x40
573 #define _SEG22COM0 0x40
574 #define _S23C0 0x80
575 #define _SEG23COM0 0x80
577 //==============================================================================
580 //==============================================================================
581 // LCDDATA3 Bits
583 extern __at(0x0F63) __sfr LCDDATA3;
585 typedef union
587 struct
589 unsigned S24C0 : 1;
590 unsigned S25C0 : 1;
591 unsigned S26C0 : 1;
592 unsigned S27C0 : 1;
593 unsigned S28C0 : 1;
594 unsigned S29C0 : 1;
595 unsigned S30C0 : 1;
596 unsigned S31C0 : 1;
599 struct
601 unsigned SEG24COM0 : 1;
602 unsigned SEG25COM0 : 1;
603 unsigned SEG26COM0 : 1;
604 unsigned SEG27COM0 : 1;
605 unsigned SEG28COM0 : 1;
606 unsigned SEG29COM0 : 1;
607 unsigned SEG30COM0 : 1;
608 unsigned SEG31COM0 : 1;
610 } __LCDDATA3bits_t;
612 extern __at(0x0F63) volatile __LCDDATA3bits_t LCDDATA3bits;
614 #define _S24C0 0x01
615 #define _SEG24COM0 0x01
616 #define _S25C0 0x02
617 #define _SEG25COM0 0x02
618 #define _S26C0 0x04
619 #define _SEG26COM0 0x04
620 #define _S27C0 0x08
621 #define _SEG27COM0 0x08
622 #define _S28C0 0x10
623 #define _SEG28COM0 0x10
624 #define _S29C0 0x20
625 #define _SEG29COM0 0x20
626 #define _S30C0 0x40
627 #define _SEG30COM0 0x40
628 #define _S31C0 0x80
629 #define _SEG31COM0 0x80
631 //==============================================================================
634 //==============================================================================
635 // LCDDATA4 Bits
637 extern __at(0x0F64) __sfr LCDDATA4;
639 typedef union
641 struct
643 unsigned S32C0 : 1;
644 unsigned S33C0 : 1;
645 unsigned S34C0 : 1;
646 unsigned S35C0 : 1;
647 unsigned S36C0 : 1;
648 unsigned S37C0 : 1;
649 unsigned S38C0 : 1;
650 unsigned S39C0 : 1;
653 struct
655 unsigned SEG32COM0 : 1;
656 unsigned SEG33COM0 : 1;
657 unsigned SEG34COM0 : 1;
658 unsigned SEG35COM0 : 1;
659 unsigned SEG36COM0 : 1;
660 unsigned SEG37COM0 : 1;
661 unsigned SEG38COM0 : 1;
662 unsigned SEG39COM0 : 1;
664 } __LCDDATA4bits_t;
666 extern __at(0x0F64) volatile __LCDDATA4bits_t LCDDATA4bits;
668 #define _S32C0 0x01
669 #define _SEG32COM0 0x01
670 #define _S33C0 0x02
671 #define _SEG33COM0 0x02
672 #define _S34C0 0x04
673 #define _SEG34COM0 0x04
674 #define _S35C0 0x08
675 #define _SEG35COM0 0x08
676 #define _S36C0 0x10
677 #define _SEG36COM0 0x10
678 #define _S37C0 0x20
679 #define _SEG37COM0 0x20
680 #define _S38C0 0x40
681 #define _SEG38COM0 0x40
682 #define _S39C0 0x80
683 #define _SEG39COM0 0x80
685 //==============================================================================
688 //==============================================================================
689 // LCDDATA5 Bits
691 extern __at(0x0F65) __sfr LCDDATA5;
693 typedef union
695 struct
697 unsigned S40C0 : 1;
698 unsigned S41C0 : 1;
699 unsigned S42C0 : 1;
700 unsigned S43C0 : 1;
701 unsigned S44C0 : 1;
702 unsigned S45C0 : 1;
703 unsigned S46C0 : 1;
704 unsigned S47C0 : 1;
707 struct
709 unsigned SEG40COM0 : 1;
710 unsigned SEG41COM0 : 1;
711 unsigned SEG42COM0 : 1;
712 unsigned SEG43COM0 : 1;
713 unsigned SEG44COM0 : 1;
714 unsigned SEG45COM0 : 1;
715 unsigned SEG46COM0 : 1;
716 unsigned SEG47COM0 : 1;
718 } __LCDDATA5bits_t;
720 extern __at(0x0F65) volatile __LCDDATA5bits_t LCDDATA5bits;
722 #define _S40C0 0x01
723 #define _SEG40COM0 0x01
724 #define _S41C0 0x02
725 #define _SEG41COM0 0x02
726 #define _S42C0 0x04
727 #define _SEG42COM0 0x04
728 #define _S43C0 0x08
729 #define _SEG43COM0 0x08
730 #define _S44C0 0x10
731 #define _SEG44COM0 0x10
732 #define _S45C0 0x20
733 #define _SEG45COM0 0x20
734 #define _S46C0 0x40
735 #define _SEG46COM0 0x40
736 #define _S47C0 0x80
737 #define _SEG47COM0 0x80
739 //==============================================================================
742 //==============================================================================
743 // LCDDATA6 Bits
745 extern __at(0x0F66) __sfr LCDDATA6;
747 typedef union
749 struct
751 unsigned S0C1 : 1;
752 unsigned S1C1 : 1;
753 unsigned S2C1 : 1;
754 unsigned S3C1 : 1;
755 unsigned S4C1 : 1;
756 unsigned S5C1 : 1;
757 unsigned S6C1 : 1;
758 unsigned S7C1 : 1;
761 struct
763 unsigned SEG0COM1 : 1;
764 unsigned SEG1COM1 : 1;
765 unsigned SEG2COM1 : 1;
766 unsigned SEG3COM1 : 1;
767 unsigned SEG4COM1 : 1;
768 unsigned SEG5COM1 : 1;
769 unsigned SEG6COM1 : 1;
770 unsigned SEG7COM1 : 1;
773 struct
775 unsigned S00C1 : 1;
776 unsigned S01C1 : 1;
777 unsigned S02C1 : 1;
778 unsigned S03C1 : 1;
779 unsigned S04C1 : 1;
780 unsigned S05C1 : 1;
781 unsigned S06C1 : 1;
782 unsigned S07C1 : 1;
784 } __LCDDATA6bits_t;
786 extern __at(0x0F66) volatile __LCDDATA6bits_t LCDDATA6bits;
788 #define _S0C1 0x01
789 #define _SEG0COM1 0x01
790 #define _S00C1 0x01
791 #define _S1C1 0x02
792 #define _SEG1COM1 0x02
793 #define _S01C1 0x02
794 #define _S2C1 0x04
795 #define _SEG2COM1 0x04
796 #define _S02C1 0x04
797 #define _S3C1 0x08
798 #define _SEG3COM1 0x08
799 #define _S03C1 0x08
800 #define _S4C1 0x10
801 #define _SEG4COM1 0x10
802 #define _S04C1 0x10
803 #define _S5C1 0x20
804 #define _SEG5COM1 0x20
805 #define _S05C1 0x20
806 #define _S6C1 0x40
807 #define _SEG6COM1 0x40
808 #define _S06C1 0x40
809 #define _S7C1 0x80
810 #define _SEG7COM1 0x80
811 #define _S07C1 0x80
813 //==============================================================================
816 //==============================================================================
817 // LCDDATA7 Bits
819 extern __at(0x0F67) __sfr LCDDATA7;
821 typedef union
823 struct
825 unsigned S8C1 : 1;
826 unsigned S9C1 : 1;
827 unsigned S10C1 : 1;
828 unsigned S11C1 : 1;
829 unsigned S12C1 : 1;
830 unsigned S13C1 : 1;
831 unsigned S14C1 : 1;
832 unsigned S15C1 : 1;
835 struct
837 unsigned SEG8COM1 : 1;
838 unsigned SEG9COM1 : 1;
839 unsigned SEG10COM1 : 1;
840 unsigned SEG11COM1 : 1;
841 unsigned SEG12COM1 : 1;
842 unsigned SEG13COM1 : 1;
843 unsigned SEG14COM1 : 1;
844 unsigned SEG15COM1 : 1;
847 struct
849 unsigned S08C1 : 1;
850 unsigned S09C1 : 1;
851 unsigned : 1;
852 unsigned : 1;
853 unsigned : 1;
854 unsigned : 1;
855 unsigned : 1;
856 unsigned : 1;
858 } __LCDDATA7bits_t;
860 extern __at(0x0F67) volatile __LCDDATA7bits_t LCDDATA7bits;
862 #define _S8C1 0x01
863 #define _SEG8COM1 0x01
864 #define _S08C1 0x01
865 #define _S9C1 0x02
866 #define _SEG9COM1 0x02
867 #define _S09C1 0x02
868 #define _S10C1 0x04
869 #define _SEG10COM1 0x04
870 #define _S11C1 0x08
871 #define _SEG11COM1 0x08
872 #define _S12C1 0x10
873 #define _SEG12COM1 0x10
874 #define _S13C1 0x20
875 #define _SEG13COM1 0x20
876 #define _S14C1 0x40
877 #define _SEG14COM1 0x40
878 #define _S15C1 0x80
879 #define _SEG15COM1 0x80
881 //==============================================================================
884 //==============================================================================
885 // LCDDATA8 Bits
887 extern __at(0x0F68) __sfr LCDDATA8;
889 typedef union
891 struct
893 unsigned S16C1 : 1;
894 unsigned S17C1 : 1;
895 unsigned S18C1 : 1;
896 unsigned S19C1 : 1;
897 unsigned S20C1 : 1;
898 unsigned S21C1 : 1;
899 unsigned S22C1 : 1;
900 unsigned S23C1 : 1;
903 struct
905 unsigned SEG16COM1 : 1;
906 unsigned SEG17COM1 : 1;
907 unsigned SEG18COM1 : 1;
908 unsigned SEG19COM1 : 1;
909 unsigned SEG20COM1 : 1;
910 unsigned SEG21COM1 : 1;
911 unsigned SEG22COM1 : 1;
912 unsigned SEG23COM1 : 1;
914 } __LCDDATA8bits_t;
916 extern __at(0x0F68) volatile __LCDDATA8bits_t LCDDATA8bits;
918 #define _S16C1 0x01
919 #define _SEG16COM1 0x01
920 #define _S17C1 0x02
921 #define _SEG17COM1 0x02
922 #define _S18C1 0x04
923 #define _SEG18COM1 0x04
924 #define _S19C1 0x08
925 #define _SEG19COM1 0x08
926 #define _S20C1 0x10
927 #define _SEG20COM1 0x10
928 #define _S21C1 0x20
929 #define _SEG21COM1 0x20
930 #define _S22C1 0x40
931 #define _SEG22COM1 0x40
932 #define _S23C1 0x80
933 #define _SEG23COM1 0x80
935 //==============================================================================
938 //==============================================================================
939 // LCDDATA9 Bits
941 extern __at(0x0F69) __sfr LCDDATA9;
943 typedef union
945 struct
947 unsigned S24C1 : 1;
948 unsigned S25C1 : 1;
949 unsigned S26C1 : 1;
950 unsigned S27C1 : 1;
951 unsigned S28C1 : 1;
952 unsigned S29C1 : 1;
953 unsigned S30C1 : 1;
954 unsigned S31C1 : 1;
957 struct
959 unsigned SEG24COM1 : 1;
960 unsigned SEG25COM1 : 1;
961 unsigned SEG26COM1 : 1;
962 unsigned SEG27COM1 : 1;
963 unsigned SEG28COM1 : 1;
964 unsigned SEG29COM1 : 1;
965 unsigned SEG30COM1 : 1;
966 unsigned SEG31COM1 : 1;
968 } __LCDDATA9bits_t;
970 extern __at(0x0F69) volatile __LCDDATA9bits_t LCDDATA9bits;
972 #define _S24C1 0x01
973 #define _SEG24COM1 0x01
974 #define _S25C1 0x02
975 #define _SEG25COM1 0x02
976 #define _S26C1 0x04
977 #define _SEG26COM1 0x04
978 #define _S27C1 0x08
979 #define _SEG27COM1 0x08
980 #define _S28C1 0x10
981 #define _SEG28COM1 0x10
982 #define _S29C1 0x20
983 #define _SEG29COM1 0x20
984 #define _S30C1 0x40
985 #define _SEG30COM1 0x40
986 #define _S31C1 0x80
987 #define _SEG31COM1 0x80
989 //==============================================================================
992 //==============================================================================
993 // LCDDATA10 Bits
995 extern __at(0x0F6A) __sfr LCDDATA10;
997 typedef union
999 struct
1001 unsigned S32C1 : 1;
1002 unsigned S33C1 : 1;
1003 unsigned S34C1 : 1;
1004 unsigned S35C1 : 1;
1005 unsigned S36C1 : 1;
1006 unsigned S37C1 : 1;
1007 unsigned S38C1 : 1;
1008 unsigned S39C1 : 1;
1011 struct
1013 unsigned SEG32COM1 : 1;
1014 unsigned SEG33COM1 : 1;
1015 unsigned SEG34COM1 : 1;
1016 unsigned SEG35COM1 : 1;
1017 unsigned SEG36COM1 : 1;
1018 unsigned SEG37COM1 : 1;
1019 unsigned SEG38COM1 : 1;
1020 unsigned SEG39COM1 : 1;
1022 } __LCDDATA10bits_t;
1024 extern __at(0x0F6A) volatile __LCDDATA10bits_t LCDDATA10bits;
1026 #define _S32C1 0x01
1027 #define _SEG32COM1 0x01
1028 #define _S33C1 0x02
1029 #define _SEG33COM1 0x02
1030 #define _S34C1 0x04
1031 #define _SEG34COM1 0x04
1032 #define _S35C1 0x08
1033 #define _SEG35COM1 0x08
1034 #define _S36C1 0x10
1035 #define _SEG36COM1 0x10
1036 #define _S37C1 0x20
1037 #define _SEG37COM1 0x20
1038 #define _S38C1 0x40
1039 #define _SEG38COM1 0x40
1040 #define _S39C1 0x80
1041 #define _SEG39COM1 0x80
1043 //==============================================================================
1046 //==============================================================================
1047 // RCSTA2 Bits
1049 extern __at(0x0F6B) __sfr RCSTA2;
1051 typedef union
1053 struct
1055 unsigned RX9D : 1;
1056 unsigned OERR : 1;
1057 unsigned FERR : 1;
1058 unsigned ADDEN : 1;
1059 unsigned CREN : 1;
1060 unsigned SREN : 1;
1061 unsigned RX9 : 1;
1062 unsigned SPEN : 1;
1065 struct
1067 unsigned RCD8 : 1;
1068 unsigned OERR2 : 1;
1069 unsigned FERR2 : 1;
1070 unsigned ADEN : 1;
1071 unsigned CREN2 : 1;
1072 unsigned SREN2 : 1;
1073 unsigned RC9 : 1;
1074 unsigned SPEN2 : 1;
1077 struct
1079 unsigned RX9D2 : 1;
1080 unsigned : 1;
1081 unsigned : 1;
1082 unsigned ADDEN2 : 1;
1083 unsigned : 1;
1084 unsigned : 1;
1085 unsigned NOT_RC8 : 1;
1086 unsigned : 1;
1089 struct
1091 unsigned : 1;
1092 unsigned : 1;
1093 unsigned : 1;
1094 unsigned : 1;
1095 unsigned : 1;
1096 unsigned : 1;
1097 unsigned RC8_9 : 1;
1098 unsigned : 1;
1101 struct
1103 unsigned : 1;
1104 unsigned : 1;
1105 unsigned : 1;
1106 unsigned : 1;
1107 unsigned : 1;
1108 unsigned : 1;
1109 unsigned RX92 : 1;
1110 unsigned : 1;
1112 } __RCSTA2bits_t;
1114 extern __at(0x0F6B) volatile __RCSTA2bits_t RCSTA2bits;
1116 #define _RCSTA2_RX9D 0x01
1117 #define _RCSTA2_RCD8 0x01
1118 #define _RCSTA2_RX9D2 0x01
1119 #define _RCSTA2_OERR 0x02
1120 #define _RCSTA2_OERR2 0x02
1121 #define _RCSTA2_FERR 0x04
1122 #define _RCSTA2_FERR2 0x04
1123 #define _RCSTA2_ADDEN 0x08
1124 #define _RCSTA2_ADEN 0x08
1125 #define _RCSTA2_ADDEN2 0x08
1126 #define _RCSTA2_CREN 0x10
1127 #define _RCSTA2_CREN2 0x10
1128 #define _RCSTA2_SREN 0x20
1129 #define _RCSTA2_SREN2 0x20
1130 #define _RCSTA2_RX9 0x40
1131 #define _RCSTA2_RC9 0x40
1132 #define _RCSTA2_NOT_RC8 0x40
1133 #define _RCSTA2_RC8_9 0x40
1134 #define _RCSTA2_RX92 0x40
1135 #define _RCSTA2_SPEN 0x80
1136 #define _RCSTA2_SPEN2 0x80
1138 //==============================================================================
1141 //==============================================================================
1142 // TXSTA2 Bits
1144 extern __at(0x0F6C) __sfr TXSTA2;
1146 typedef union
1148 struct
1150 unsigned TX9D : 1;
1151 unsigned TRMT : 1;
1152 unsigned BRGH : 1;
1153 unsigned SENDB2 : 1;
1154 unsigned SYNC : 1;
1155 unsigned TXEN : 1;
1156 unsigned TX9 : 1;
1157 unsigned CSRC : 1;
1160 struct
1162 unsigned TXD8 : 1;
1163 unsigned TRMT2 : 1;
1164 unsigned BRGH2 : 1;
1165 unsigned : 1;
1166 unsigned SYNC2 : 1;
1167 unsigned TXEN2 : 1;
1168 unsigned TX8_9 : 1;
1169 unsigned CSRC2 : 1;
1172 struct
1174 unsigned TX9D2 : 1;
1175 unsigned : 1;
1176 unsigned : 1;
1177 unsigned : 1;
1178 unsigned : 1;
1179 unsigned : 1;
1180 unsigned NOT_TX8 : 1;
1181 unsigned : 1;
1184 struct
1186 unsigned : 1;
1187 unsigned : 1;
1188 unsigned : 1;
1189 unsigned : 1;
1190 unsigned : 1;
1191 unsigned : 1;
1192 unsigned TX92 : 1;
1193 unsigned : 1;
1195 } __TXSTA2bits_t;
1197 extern __at(0x0F6C) volatile __TXSTA2bits_t TXSTA2bits;
1199 #define _TXSTA2_TX9D 0x01
1200 #define _TXSTA2_TXD8 0x01
1201 #define _TXSTA2_TX9D2 0x01
1202 #define _TXSTA2_TRMT 0x02
1203 #define _TXSTA2_TRMT2 0x02
1204 #define _TXSTA2_BRGH 0x04
1205 #define _TXSTA2_BRGH2 0x04
1206 #define _TXSTA2_SENDB2 0x08
1207 #define _TXSTA2_SYNC 0x10
1208 #define _TXSTA2_SYNC2 0x10
1209 #define _TXSTA2_TXEN 0x20
1210 #define _TXSTA2_TXEN2 0x20
1211 #define _TXSTA2_TX9 0x40
1212 #define _TXSTA2_TX8_9 0x40
1213 #define _TXSTA2_NOT_TX8 0x40
1214 #define _TXSTA2_TX92 0x40
1215 #define _TXSTA2_CSRC 0x80
1216 #define _TXSTA2_CSRC2 0x80
1218 //==============================================================================
1220 extern __at(0x0F6D) __sfr TXREG2;
1221 extern __at(0x0F6E) __sfr RCREG2;
1222 extern __at(0x0F6F) __sfr SPBRG2;
1224 //==============================================================================
1225 // LCDDATA11 Bits
1227 extern __at(0x0F70) __sfr LCDDATA11;
1229 typedef union
1231 struct
1233 unsigned S40C1 : 1;
1234 unsigned S41C1 : 1;
1235 unsigned S42C1 : 1;
1236 unsigned S43C1 : 1;
1237 unsigned S44C1 : 1;
1238 unsigned S45C1 : 1;
1239 unsigned S46C1 : 1;
1240 unsigned S47C1 : 1;
1243 struct
1245 unsigned SEG40COM1 : 1;
1246 unsigned SEG41COM1 : 1;
1247 unsigned SEG42COM1 : 1;
1248 unsigned SEG43COM1 : 1;
1249 unsigned SEG44COM1 : 1;
1250 unsigned SEG45COM1 : 1;
1251 unsigned SEG46COM1 : 1;
1252 unsigned SEG47COM1 : 1;
1254 } __LCDDATA11bits_t;
1256 extern __at(0x0F70) volatile __LCDDATA11bits_t LCDDATA11bits;
1258 #define _S40C1 0x01
1259 #define _SEG40COM1 0x01
1260 #define _S41C1 0x02
1261 #define _SEG41COM1 0x02
1262 #define _S42C1 0x04
1263 #define _SEG42COM1 0x04
1264 #define _S43C1 0x08
1265 #define _SEG43COM1 0x08
1266 #define _S44C1 0x10
1267 #define _SEG44COM1 0x10
1268 #define _S45C1 0x20
1269 #define _SEG45COM1 0x20
1270 #define _S46C1 0x40
1271 #define _SEG46COM1 0x40
1272 #define _S47C1 0x80
1273 #define _SEG47COM1 0x80
1275 //==============================================================================
1278 //==============================================================================
1279 // LCDDATA12 Bits
1281 extern __at(0x0F71) __sfr LCDDATA12;
1283 typedef union
1285 struct
1287 unsigned S0C2 : 1;
1288 unsigned S1C2 : 1;
1289 unsigned S2C2 : 1;
1290 unsigned S3C2 : 1;
1291 unsigned S4C2 : 1;
1292 unsigned S5C2 : 1;
1293 unsigned S6C2 : 1;
1294 unsigned S7C2 : 1;
1297 struct
1299 unsigned SEG0COM2 : 1;
1300 unsigned SEG1COM2 : 1;
1301 unsigned SEG2COM2 : 1;
1302 unsigned SEG3COM2 : 1;
1303 unsigned SEG4COM2 : 1;
1304 unsigned SEG5COM2 : 1;
1305 unsigned SEG6COM2 : 1;
1306 unsigned SEG7COM2 : 1;
1309 struct
1311 unsigned S00C2 : 1;
1312 unsigned S01C2 : 1;
1313 unsigned S02C2 : 1;
1314 unsigned S03C2 : 1;
1315 unsigned S04C2 : 1;
1316 unsigned S05C2 : 1;
1317 unsigned S06C2 : 1;
1318 unsigned S07C2 : 1;
1320 } __LCDDATA12bits_t;
1322 extern __at(0x0F71) volatile __LCDDATA12bits_t LCDDATA12bits;
1324 #define _S0C2 0x01
1325 #define _SEG0COM2 0x01
1326 #define _S00C2 0x01
1327 #define _S1C2 0x02
1328 #define _SEG1COM2 0x02
1329 #define _S01C2 0x02
1330 #define _S2C2 0x04
1331 #define _SEG2COM2 0x04
1332 #define _S02C2 0x04
1333 #define _S3C2 0x08
1334 #define _SEG3COM2 0x08
1335 #define _S03C2 0x08
1336 #define _S4C2 0x10
1337 #define _SEG4COM2 0x10
1338 #define _S04C2 0x10
1339 #define _S5C2 0x20
1340 #define _SEG5COM2 0x20
1341 #define _S05C2 0x20
1342 #define _S6C2 0x40
1343 #define _SEG6COM2 0x40
1344 #define _S06C2 0x40
1345 #define _S7C2 0x80
1346 #define _SEG7COM2 0x80
1347 #define _S07C2 0x80
1349 //==============================================================================
1352 //==============================================================================
1353 // LCDDATA13 Bits
1355 extern __at(0x0F72) __sfr LCDDATA13;
1357 typedef union
1359 struct
1361 unsigned S8C2 : 1;
1362 unsigned S9C2 : 1;
1363 unsigned S10C2 : 1;
1364 unsigned S11C2 : 1;
1365 unsigned S12C2 : 1;
1366 unsigned S13C2 : 1;
1367 unsigned S14C2 : 1;
1368 unsigned S15C2 : 1;
1371 struct
1373 unsigned SEG8COM2 : 1;
1374 unsigned SEG9COM2 : 1;
1375 unsigned SEG10COM2 : 1;
1376 unsigned SEG11COM2 : 1;
1377 unsigned SEG12COM2 : 1;
1378 unsigned SEG13COM2 : 1;
1379 unsigned SEG14COM2 : 1;
1380 unsigned SEG15COM2 : 1;
1383 struct
1385 unsigned S08C2 : 1;
1386 unsigned S09C2 : 1;
1387 unsigned : 1;
1388 unsigned : 1;
1389 unsigned : 1;
1390 unsigned : 1;
1391 unsigned : 1;
1392 unsigned : 1;
1394 } __LCDDATA13bits_t;
1396 extern __at(0x0F72) volatile __LCDDATA13bits_t LCDDATA13bits;
1398 #define _S8C2 0x01
1399 #define _SEG8COM2 0x01
1400 #define _S08C2 0x01
1401 #define _S9C2 0x02
1402 #define _SEG9COM2 0x02
1403 #define _S09C2 0x02
1404 #define _S10C2 0x04
1405 #define _SEG10COM2 0x04
1406 #define _S11C2 0x08
1407 #define _SEG11COM2 0x08
1408 #define _S12C2 0x10
1409 #define _SEG12COM2 0x10
1410 #define _S13C2 0x20
1411 #define _SEG13COM2 0x20
1412 #define _S14C2 0x40
1413 #define _SEG14COM2 0x40
1414 #define _S15C2 0x80
1415 #define _SEG15COM2 0x80
1417 //==============================================================================
1420 //==============================================================================
1421 // LCDDATA14 Bits
1423 extern __at(0x0F73) __sfr LCDDATA14;
1425 typedef union
1427 struct
1429 unsigned S16C2 : 1;
1430 unsigned S17C2 : 1;
1431 unsigned S18C2 : 1;
1432 unsigned S19C2 : 1;
1433 unsigned S20C2 : 1;
1434 unsigned S21C2 : 1;
1435 unsigned S22C2 : 1;
1436 unsigned S23C2 : 1;
1439 struct
1441 unsigned SEG16COM2 : 1;
1442 unsigned SEG17COM2 : 1;
1443 unsigned SEG18COM2 : 1;
1444 unsigned SEG19COM2 : 1;
1445 unsigned SEG20COM2 : 1;
1446 unsigned SEG21COM2 : 1;
1447 unsigned SEG22COM2 : 1;
1448 unsigned SEG23COM2 : 1;
1450 } __LCDDATA14bits_t;
1452 extern __at(0x0F73) volatile __LCDDATA14bits_t LCDDATA14bits;
1454 #define _S16C2 0x01
1455 #define _SEG16COM2 0x01
1456 #define _S17C2 0x02
1457 #define _SEG17COM2 0x02
1458 #define _S18C2 0x04
1459 #define _SEG18COM2 0x04
1460 #define _S19C2 0x08
1461 #define _SEG19COM2 0x08
1462 #define _S20C2 0x10
1463 #define _SEG20COM2 0x10
1464 #define _S21C2 0x20
1465 #define _SEG21COM2 0x20
1466 #define _S22C2 0x40
1467 #define _SEG22COM2 0x40
1468 #define _S23C2 0x80
1469 #define _SEG23COM2 0x80
1471 //==============================================================================
1474 //==============================================================================
1475 // LCDDATA15 Bits
1477 extern __at(0x0F74) __sfr LCDDATA15;
1479 typedef union
1481 struct
1483 unsigned S24C2 : 1;
1484 unsigned S25C2 : 1;
1485 unsigned S26C2 : 1;
1486 unsigned S27C2 : 1;
1487 unsigned S28C2 : 1;
1488 unsigned S29C2 : 1;
1489 unsigned S30C2 : 1;
1490 unsigned S31C2 : 1;
1493 struct
1495 unsigned SEG24COM2 : 1;
1496 unsigned SEG25COM2 : 1;
1497 unsigned SEG26COM2 : 1;
1498 unsigned SEG27COM2 : 1;
1499 unsigned SEG28COM2 : 1;
1500 unsigned SEG29COM2 : 1;
1501 unsigned SEG30COM2 : 1;
1502 unsigned SEG31COM2 : 1;
1504 } __LCDDATA15bits_t;
1506 extern __at(0x0F74) volatile __LCDDATA15bits_t LCDDATA15bits;
1508 #define _S24C2 0x01
1509 #define _SEG24COM2 0x01
1510 #define _S25C2 0x02
1511 #define _SEG25COM2 0x02
1512 #define _S26C2 0x04
1513 #define _SEG26COM2 0x04
1514 #define _S27C2 0x08
1515 #define _SEG27COM2 0x08
1516 #define _S28C2 0x10
1517 #define _SEG28COM2 0x10
1518 #define _S29C2 0x20
1519 #define _SEG29COM2 0x20
1520 #define _S30C2 0x40
1521 #define _SEG30COM2 0x40
1522 #define _S31C2 0x80
1523 #define _SEG31COM2 0x80
1525 //==============================================================================
1528 //==============================================================================
1529 // LCDDATA16 Bits
1531 extern __at(0x0F75) __sfr LCDDATA16;
1533 typedef union
1535 struct
1537 unsigned S32C2 : 1;
1538 unsigned S33C2 : 1;
1539 unsigned S34C2 : 1;
1540 unsigned S35C2 : 1;
1541 unsigned S36C2 : 1;
1542 unsigned S37C2 : 1;
1543 unsigned S38C2 : 1;
1544 unsigned S39C2 : 1;
1547 struct
1549 unsigned SEG32COM2 : 1;
1550 unsigned SEG33COM2 : 1;
1551 unsigned SEG34COM2 : 1;
1552 unsigned SEG35COM2 : 1;
1553 unsigned SEG36COM2 : 1;
1554 unsigned SEG37COM2 : 1;
1555 unsigned SEG38COM2 : 1;
1556 unsigned SEG39COM2 : 1;
1558 } __LCDDATA16bits_t;
1560 extern __at(0x0F75) volatile __LCDDATA16bits_t LCDDATA16bits;
1562 #define _S32C2 0x01
1563 #define _SEG32COM2 0x01
1564 #define _S33C2 0x02
1565 #define _SEG33COM2 0x02
1566 #define _S34C2 0x04
1567 #define _SEG34COM2 0x04
1568 #define _S35C2 0x08
1569 #define _SEG35COM2 0x08
1570 #define _S36C2 0x10
1571 #define _SEG36COM2 0x10
1572 #define _S37C2 0x20
1573 #define _SEG37COM2 0x20
1574 #define _S38C2 0x40
1575 #define _SEG38COM2 0x40
1576 #define _S39C2 0x80
1577 #define _SEG39COM2 0x80
1579 //==============================================================================
1582 //==============================================================================
1583 // LCDDATA17 Bits
1585 extern __at(0x0F76) __sfr LCDDATA17;
1587 typedef union
1589 struct
1591 unsigned S40C2 : 1;
1592 unsigned S41C2 : 1;
1593 unsigned S42C2 : 1;
1594 unsigned S43C2 : 1;
1595 unsigned S44C2 : 1;
1596 unsigned S45C2 : 1;
1597 unsigned S46C2 : 1;
1598 unsigned S47C2 : 1;
1601 struct
1603 unsigned SEG40COM2 : 1;
1604 unsigned SEG41COM2 : 1;
1605 unsigned SEG42COM2 : 1;
1606 unsigned SEG43COM2 : 1;
1607 unsigned SEG44COM2 : 1;
1608 unsigned SEG45COM2 : 1;
1609 unsigned SEG46COM2 : 1;
1610 unsigned SEG47COM2 : 1;
1612 } __LCDDATA17bits_t;
1614 extern __at(0x0F76) volatile __LCDDATA17bits_t LCDDATA17bits;
1616 #define _S40C2 0x01
1617 #define _SEG40COM2 0x01
1618 #define _S41C2 0x02
1619 #define _SEG41COM2 0x02
1620 #define _S42C2 0x04
1621 #define _SEG42COM2 0x04
1622 #define _S43C2 0x08
1623 #define _SEG43COM2 0x08
1624 #define _S44C2 0x10
1625 #define _SEG44COM2 0x10
1626 #define _S45C2 0x20
1627 #define _SEG45COM2 0x20
1628 #define _S46C2 0x40
1629 #define _SEG46COM2 0x40
1630 #define _S47C2 0x80
1631 #define _SEG47COM2 0x80
1633 //==============================================================================
1636 //==============================================================================
1637 // LCDDATA18 Bits
1639 extern __at(0x0F77) __sfr LCDDATA18;
1641 typedef union
1643 struct
1645 unsigned S0C3 : 1;
1646 unsigned S1C3 : 1;
1647 unsigned S2C3 : 1;
1648 unsigned S3C3 : 1;
1649 unsigned S4C3 : 1;
1650 unsigned S5C3 : 1;
1651 unsigned S6C3 : 1;
1652 unsigned S7C3 : 1;
1655 struct
1657 unsigned SEG0COM3 : 1;
1658 unsigned SEG1COM3 : 1;
1659 unsigned SEG2COM3 : 1;
1660 unsigned SEG3COM3 : 1;
1661 unsigned SEG4COM3 : 1;
1662 unsigned SEG5COM3 : 1;
1663 unsigned SEG6COM3 : 1;
1664 unsigned SEG7COM3 : 1;
1667 struct
1669 unsigned S00C3 : 1;
1670 unsigned S01C3 : 1;
1671 unsigned S02C3 : 1;
1672 unsigned S03C3 : 1;
1673 unsigned S04C3 : 1;
1674 unsigned S05C3 : 1;
1675 unsigned S06C3 : 1;
1676 unsigned S07C3 : 1;
1678 } __LCDDATA18bits_t;
1680 extern __at(0x0F77) volatile __LCDDATA18bits_t LCDDATA18bits;
1682 #define _S0C3 0x01
1683 #define _SEG0COM3 0x01
1684 #define _S00C3 0x01
1685 #define _S1C3 0x02
1686 #define _SEG1COM3 0x02
1687 #define _S01C3 0x02
1688 #define _S2C3 0x04
1689 #define _SEG2COM3 0x04
1690 #define _S02C3 0x04
1691 #define _S3C3 0x08
1692 #define _SEG3COM3 0x08
1693 #define _S03C3 0x08
1694 #define _S4C3 0x10
1695 #define _SEG4COM3 0x10
1696 #define _S04C3 0x10
1697 #define _S5C3 0x20
1698 #define _SEG5COM3 0x20
1699 #define _S05C3 0x20
1700 #define _S6C3 0x40
1701 #define _SEG6COM3 0x40
1702 #define _S06C3 0x40
1703 #define _S7C3 0x80
1704 #define _SEG7COM3 0x80
1705 #define _S07C3 0x80
1707 //==============================================================================
1710 //==============================================================================
1711 // LCDDATA19 Bits
1713 extern __at(0x0F78) __sfr LCDDATA19;
1715 typedef union
1717 struct
1719 unsigned S8C3 : 1;
1720 unsigned S9C3 : 1;
1721 unsigned S10C3 : 1;
1722 unsigned S11C3 : 1;
1723 unsigned S12C3 : 1;
1724 unsigned S13C3 : 1;
1725 unsigned S14C3 : 1;
1726 unsigned S15C3 : 1;
1729 struct
1731 unsigned SEG8COM3 : 1;
1732 unsigned SEG9COM3 : 1;
1733 unsigned SEG10COM3 : 1;
1734 unsigned SEG11COM3 : 1;
1735 unsigned SEG12COM3 : 1;
1736 unsigned SEG13COM3 : 1;
1737 unsigned SEG14COM3 : 1;
1738 unsigned SEG15COM3 : 1;
1741 struct
1743 unsigned S08C3 : 1;
1744 unsigned S09C3 : 1;
1745 unsigned : 1;
1746 unsigned : 1;
1747 unsigned : 1;
1748 unsigned : 1;
1749 unsigned : 1;
1750 unsigned : 1;
1752 } __LCDDATA19bits_t;
1754 extern __at(0x0F78) volatile __LCDDATA19bits_t LCDDATA19bits;
1756 #define _S8C3 0x01
1757 #define _SEG8COM3 0x01
1758 #define _S08C3 0x01
1759 #define _S9C3 0x02
1760 #define _SEG9COM3 0x02
1761 #define _S09C3 0x02
1762 #define _S10C3 0x04
1763 #define _SEG10COM3 0x04
1764 #define _S11C3 0x08
1765 #define _SEG11COM3 0x08
1766 #define _S12C3 0x10
1767 #define _SEG12COM3 0x10
1768 #define _S13C3 0x20
1769 #define _SEG13COM3 0x20
1770 #define _S14C3 0x40
1771 #define _SEG14COM3 0x40
1772 #define _S15C3 0x80
1773 #define _SEG15COM3 0x80
1775 //==============================================================================
1778 //==============================================================================
1779 // LCDDATA20 Bits
1781 extern __at(0x0F79) __sfr LCDDATA20;
1783 typedef union
1785 struct
1787 unsigned S16C3 : 1;
1788 unsigned S17C3 : 1;
1789 unsigned S18C3 : 1;
1790 unsigned S19C3 : 1;
1791 unsigned S20C3 : 1;
1792 unsigned S21C3 : 1;
1793 unsigned S22C3 : 1;
1794 unsigned S23C3 : 1;
1797 struct
1799 unsigned SEG16COM3 : 1;
1800 unsigned SEG17COM3 : 1;
1801 unsigned SEG18COM3 : 1;
1802 unsigned SEG19COM3 : 1;
1803 unsigned SEG20COM3 : 1;
1804 unsigned SEG21COM3 : 1;
1805 unsigned SEG22COM3 : 1;
1806 unsigned SEG23COM3 : 1;
1808 } __LCDDATA20bits_t;
1810 extern __at(0x0F79) volatile __LCDDATA20bits_t LCDDATA20bits;
1812 #define _S16C3 0x01
1813 #define _SEG16COM3 0x01
1814 #define _S17C3 0x02
1815 #define _SEG17COM3 0x02
1816 #define _S18C3 0x04
1817 #define _SEG18COM3 0x04
1818 #define _S19C3 0x08
1819 #define _SEG19COM3 0x08
1820 #define _S20C3 0x10
1821 #define _SEG20COM3 0x10
1822 #define _S21C3 0x20
1823 #define _SEG21COM3 0x20
1824 #define _S22C3 0x40
1825 #define _SEG22COM3 0x40
1826 #define _S23C3 0x80
1827 #define _SEG23COM3 0x80
1829 //==============================================================================
1832 //==============================================================================
1833 // LCDDATA21 Bits
1835 extern __at(0x0F7A) __sfr LCDDATA21;
1837 typedef union
1839 struct
1841 unsigned S24C3 : 1;
1842 unsigned S25C3 : 1;
1843 unsigned S26C3 : 1;
1844 unsigned S27C3 : 1;
1845 unsigned S28C3 : 1;
1846 unsigned S29C3 : 1;
1847 unsigned S30C3 : 1;
1848 unsigned S31C3 : 1;
1851 struct
1853 unsigned SEG24COM3 : 1;
1854 unsigned SEG25COM3 : 1;
1855 unsigned SEG26COM3 : 1;
1856 unsigned SEG27COM3 : 1;
1857 unsigned SEG28COM3 : 1;
1858 unsigned SEG29COM3 : 1;
1859 unsigned SEG30COM3 : 1;
1860 unsigned SEG31COM3 : 1;
1862 } __LCDDATA21bits_t;
1864 extern __at(0x0F7A) volatile __LCDDATA21bits_t LCDDATA21bits;
1866 #define _S24C3 0x01
1867 #define _SEG24COM3 0x01
1868 #define _S25C3 0x02
1869 #define _SEG25COM3 0x02
1870 #define _S26C3 0x04
1871 #define _SEG26COM3 0x04
1872 #define _S27C3 0x08
1873 #define _SEG27COM3 0x08
1874 #define _S28C3 0x10
1875 #define _SEG28COM3 0x10
1876 #define _S29C3 0x20
1877 #define _SEG29COM3 0x20
1878 #define _S30C3 0x40
1879 #define _SEG30COM3 0x40
1880 #define _S31C3 0x80
1881 #define _SEG31COM3 0x80
1883 //==============================================================================
1886 //==============================================================================
1887 // LCDDATA22 Bits
1889 extern __at(0x0F7B) __sfr LCDDATA22;
1891 typedef union
1893 struct
1895 unsigned S32C3 : 1;
1896 unsigned S33C3 : 1;
1897 unsigned S34C3 : 1;
1898 unsigned S35C3 : 1;
1899 unsigned S36C3 : 1;
1900 unsigned S37C3 : 1;
1901 unsigned S38C3 : 1;
1902 unsigned S39C3 : 1;
1905 struct
1907 unsigned SEG32COM3 : 1;
1908 unsigned SEG33COM3 : 1;
1909 unsigned SEG34COM3 : 1;
1910 unsigned SEG35COM3 : 1;
1911 unsigned SEG36COM3 : 1;
1912 unsigned SEG37COM3 : 1;
1913 unsigned SEG38COM3 : 1;
1914 unsigned SEG39COM3 : 1;
1916 } __LCDDATA22bits_t;
1918 extern __at(0x0F7B) volatile __LCDDATA22bits_t LCDDATA22bits;
1920 #define _S32C3 0x01
1921 #define _SEG32COM3 0x01
1922 #define _S33C3 0x02
1923 #define _SEG33COM3 0x02
1924 #define _S34C3 0x04
1925 #define _SEG34COM3 0x04
1926 #define _S35C3 0x08
1927 #define _SEG35COM3 0x08
1928 #define _S36C3 0x10
1929 #define _SEG36COM3 0x10
1930 #define _S37C3 0x20
1931 #define _SEG37COM3 0x20
1932 #define _S38C3 0x40
1933 #define _SEG38COM3 0x40
1934 #define _S39C3 0x80
1935 #define _SEG39COM3 0x80
1937 //==============================================================================
1940 //==============================================================================
1941 // LCDDATA23 Bits
1943 extern __at(0x0F7C) __sfr LCDDATA23;
1945 typedef union
1947 struct
1949 unsigned S40C3 : 1;
1950 unsigned S41C3 : 1;
1951 unsigned S42C3 : 1;
1952 unsigned S43C3 : 1;
1953 unsigned S44C3 : 1;
1954 unsigned S45C3 : 1;
1955 unsigned S46C3 : 1;
1956 unsigned S47C3 : 1;
1959 struct
1961 unsigned SEG40COM3 : 1;
1962 unsigned SEG41COM3 : 1;
1963 unsigned SEG42COM3 : 1;
1964 unsigned SEG43COM3 : 1;
1965 unsigned SEG44COM3 : 1;
1966 unsigned SEG45COM3 : 1;
1967 unsigned SEG46COM3 : 1;
1968 unsigned SEG47COM3 : 1;
1970 } __LCDDATA23bits_t;
1972 extern __at(0x0F7C) volatile __LCDDATA23bits_t LCDDATA23bits;
1974 #define _S40C3 0x01
1975 #define _SEG40COM3 0x01
1976 #define _S41C3 0x02
1977 #define _SEG41COM3 0x02
1978 #define _S42C3 0x04
1979 #define _SEG42COM3 0x04
1980 #define _S43C3 0x08
1981 #define _SEG43COM3 0x08
1982 #define _S44C3 0x10
1983 #define _SEG44COM3 0x10
1984 #define _S45C3 0x20
1985 #define _SEG45COM3 0x20
1986 #define _S46C3 0x40
1987 #define _SEG46COM3 0x40
1988 #define _S47C3 0x80
1989 #define _SEG47COM3 0x80
1991 //==============================================================================
1994 //==============================================================================
1995 // BAUDCON1 Bits
1997 extern __at(0x0F7E) __sfr BAUDCON1;
1999 typedef union
2001 struct
2003 unsigned ABDEN : 1;
2004 unsigned WUE : 1;
2005 unsigned : 1;
2006 unsigned BRG16 : 1;
2007 unsigned SCKP : 1;
2008 unsigned : 1;
2009 unsigned RCIDL : 1;
2010 unsigned ABDOVF : 1;
2013 struct
2015 unsigned : 1;
2016 unsigned : 1;
2017 unsigned : 1;
2018 unsigned : 1;
2019 unsigned : 1;
2020 unsigned : 1;
2021 unsigned RCMT : 1;
2022 unsigned : 1;
2024 } __BAUDCON1bits_t;
2026 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
2028 #define _ABDEN 0x01
2029 #define _WUE 0x02
2030 #define _BRG16 0x08
2031 #define _SCKP 0x10
2032 #define _RCIDL 0x40
2033 #define _RCMT 0x40
2034 #define _ABDOVF 0x80
2036 //==============================================================================
2039 //==============================================================================
2040 // BAUDCTL1 Bits
2042 extern __at(0x0F7E) __sfr BAUDCTL1;
2044 typedef union
2046 struct
2048 unsigned ABDEN : 1;
2049 unsigned WUE : 1;
2050 unsigned : 1;
2051 unsigned BRG16 : 1;
2052 unsigned SCKP : 1;
2053 unsigned : 1;
2054 unsigned RCIDL : 1;
2055 unsigned ABDOVF : 1;
2058 struct
2060 unsigned : 1;
2061 unsigned : 1;
2062 unsigned : 1;
2063 unsigned : 1;
2064 unsigned : 1;
2065 unsigned : 1;
2066 unsigned RCMT : 1;
2067 unsigned : 1;
2069 } __BAUDCTL1bits_t;
2071 extern __at(0x0F7E) volatile __BAUDCTL1bits_t BAUDCTL1bits;
2073 #define _BAUDCTL1_ABDEN 0x01
2074 #define _BAUDCTL1_WUE 0x02
2075 #define _BAUDCTL1_BRG16 0x08
2076 #define _BAUDCTL1_SCKP 0x10
2077 #define _BAUDCTL1_RCIDL 0x40
2078 #define _BAUDCTL1_RCMT 0x40
2079 #define _BAUDCTL1_ABDOVF 0x80
2081 //==============================================================================
2083 extern __at(0x0F7F) __sfr SPBRGH1;
2085 //==============================================================================
2086 // PORTA Bits
2088 extern __at(0x0F80) __sfr PORTA;
2090 typedef union
2092 struct
2094 unsigned RA0 : 1;
2095 unsigned RA1 : 1;
2096 unsigned RA2 : 1;
2097 unsigned RA3 : 1;
2098 unsigned RA4 : 1;
2099 unsigned RA5 : 1;
2100 unsigned RA6 : 1;
2101 unsigned RA7 : 1;
2104 struct
2106 unsigned AN0 : 1;
2107 unsigned AN1 : 1;
2108 unsigned AN2 : 1;
2109 unsigned AN3 : 1;
2110 unsigned T0CKI : 1;
2111 unsigned AN4 : 1;
2112 unsigned OSC2 : 1;
2113 unsigned OSC1 : 1;
2116 struct
2118 unsigned : 1;
2119 unsigned : 1;
2120 unsigned VREFM : 1;
2121 unsigned VREFP : 1;
2122 unsigned SEG14 : 1;
2123 unsigned LVDIN : 1;
2124 unsigned CLKO : 1;
2125 unsigned CLKI : 1;
2128 struct
2130 unsigned : 1;
2131 unsigned : 1;
2132 unsigned SEG16 : 1;
2133 unsigned SEG17 : 1;
2134 unsigned : 1;
2135 unsigned SEG15 : 1;
2136 unsigned : 1;
2137 unsigned : 1;
2139 } __PORTAbits_t;
2141 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
2143 #define _PORTA_RA0 0x01
2144 #define _PORTA_AN0 0x01
2145 #define _PORTA_RA1 0x02
2146 #define _PORTA_AN1 0x02
2147 #define _PORTA_RA2 0x04
2148 #define _PORTA_AN2 0x04
2149 #define _PORTA_VREFM 0x04
2150 #define _PORTA_SEG16 0x04
2151 #define _PORTA_RA3 0x08
2152 #define _PORTA_AN3 0x08
2153 #define _PORTA_VREFP 0x08
2154 #define _PORTA_SEG17 0x08
2155 #define _PORTA_RA4 0x10
2156 #define _PORTA_T0CKI 0x10
2157 #define _PORTA_SEG14 0x10
2158 #define _PORTA_RA5 0x20
2159 #define _PORTA_AN4 0x20
2160 #define _PORTA_LVDIN 0x20
2161 #define _PORTA_SEG15 0x20
2162 #define _PORTA_RA6 0x40
2163 #define _PORTA_OSC2 0x40
2164 #define _PORTA_CLKO 0x40
2165 #define _PORTA_RA7 0x80
2166 #define _PORTA_OSC1 0x80
2167 #define _PORTA_CLKI 0x80
2169 //==============================================================================
2172 //==============================================================================
2173 // PORTB Bits
2175 extern __at(0x0F81) __sfr PORTB;
2177 typedef union
2179 struct
2181 unsigned RB0 : 1;
2182 unsigned RB1 : 1;
2183 unsigned RB2 : 1;
2184 unsigned RB3 : 1;
2185 unsigned RB4 : 1;
2186 unsigned RB5 : 1;
2187 unsigned RB6 : 1;
2188 unsigned RB7 : 1;
2191 struct
2193 unsigned INT0 : 1;
2194 unsigned INT1 : 1;
2195 unsigned INT2 : 1;
2196 unsigned INT3 : 1;
2197 unsigned KBI0 : 1;
2198 unsigned KBI1 : 1;
2199 unsigned KBI2 : 1;
2200 unsigned KBI3 : 1;
2203 struct
2205 unsigned : 1;
2206 unsigned SEG8 : 1;
2207 unsigned SEG9 : 1;
2208 unsigned SEG10 : 1;
2209 unsigned SEG11 : 1;
2210 unsigned PGM : 1;
2211 unsigned PGC : 1;
2212 unsigned PGD : 1;
2215 struct
2217 unsigned : 1;
2218 unsigned : 1;
2219 unsigned : 1;
2220 unsigned CCP2B : 1;
2221 unsigned : 1;
2222 unsigned : 1;
2223 unsigned : 1;
2224 unsigned : 1;
2227 struct
2229 unsigned INT : 4;
2230 unsigned : 4;
2233 struct
2235 unsigned : 4;
2236 unsigned KBI : 4;
2238 } __PORTBbits_t;
2240 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
2242 #define _PORTB_RB0 0x01
2243 #define _PORTB_INT0 0x01
2244 #define _PORTB_RB1 0x02
2245 #define _PORTB_INT1 0x02
2246 #define _PORTB_SEG8 0x02
2247 #define _PORTB_RB2 0x04
2248 #define _PORTB_INT2 0x04
2249 #define _PORTB_SEG9 0x04
2250 #define _PORTB_RB3 0x08
2251 #define _PORTB_INT3 0x08
2252 #define _PORTB_SEG10 0x08
2253 #define _PORTB_CCP2B 0x08
2254 #define _PORTB_RB4 0x10
2255 #define _PORTB_KBI0 0x10
2256 #define _PORTB_SEG11 0x10
2257 #define _PORTB_RB5 0x20
2258 #define _PORTB_KBI1 0x20
2259 #define _PORTB_PGM 0x20
2260 #define _PORTB_RB6 0x40
2261 #define _PORTB_KBI2 0x40
2262 #define _PORTB_PGC 0x40
2263 #define _PORTB_RB7 0x80
2264 #define _PORTB_KBI3 0x80
2265 #define _PORTB_PGD 0x80
2267 //==============================================================================
2270 //==============================================================================
2271 // PORTC Bits
2273 extern __at(0x0F82) __sfr PORTC;
2275 typedef union
2277 struct
2279 unsigned RC0 : 1;
2280 unsigned RC1 : 1;
2281 unsigned RC2 : 1;
2282 unsigned RC3 : 1;
2283 unsigned RC4 : 1;
2284 unsigned RC5 : 1;
2285 unsigned RC6 : 1;
2286 unsigned RC7 : 1;
2289 struct
2291 unsigned T1OSO : 1;
2292 unsigned T1OSI : 1;
2293 unsigned CCP1 : 1;
2294 unsigned SCK : 1;
2295 unsigned SDI : 1;
2296 unsigned SDO : 1;
2297 unsigned TX : 1;
2298 unsigned RX : 1;
2301 struct
2303 unsigned T13CKI : 1;
2304 unsigned CCP2C : 1;
2305 unsigned SEG13 : 1;
2306 unsigned SCL : 1;
2307 unsigned SDA : 1;
2308 unsigned : 1;
2309 unsigned CK : 1;
2310 unsigned : 1;
2313 struct
2315 unsigned : 1;
2316 unsigned : 1;
2317 unsigned : 1;
2318 unsigned SEG12 : 1;
2319 unsigned : 1;
2320 unsigned : 1;
2321 unsigned : 1;
2322 unsigned : 1;
2324 } __PORTCbits_t;
2326 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
2328 #define _PORTC_RC0 0x01
2329 #define _PORTC_T1OSO 0x01
2330 #define _PORTC_T13CKI 0x01
2331 #define _PORTC_RC1 0x02
2332 #define _PORTC_T1OSI 0x02
2333 #define _PORTC_CCP2C 0x02
2334 #define _PORTC_RC2 0x04
2335 #define _PORTC_CCP1 0x04
2336 #define _PORTC_SEG13 0x04
2337 #define _PORTC_RC3 0x08
2338 #define _PORTC_SCK 0x08
2339 #define _PORTC_SCL 0x08
2340 #define _PORTC_SEG12 0x08
2341 #define _PORTC_RC4 0x10
2342 #define _PORTC_SDI 0x10
2343 #define _PORTC_SDA 0x10
2344 #define _PORTC_RC5 0x20
2345 #define _PORTC_SDO 0x20
2346 #define _PORTC_RC6 0x40
2347 #define _PORTC_TX 0x40
2348 #define _PORTC_CK 0x40
2349 #define _PORTC_RC7 0x80
2350 #define _PORTC_RX 0x80
2352 //==============================================================================
2355 //==============================================================================
2356 // PORTD Bits
2358 extern __at(0x0F83) __sfr PORTD;
2360 typedef union
2362 struct
2364 unsigned RD0 : 1;
2365 unsigned RD1 : 1;
2366 unsigned RD2 : 1;
2367 unsigned RD3 : 1;
2368 unsigned RD4 : 1;
2369 unsigned RD5 : 1;
2370 unsigned RD6 : 1;
2371 unsigned RD7 : 1;
2374 struct
2376 unsigned SEG0 : 1;
2377 unsigned SEG1 : 1;
2378 unsigned SEG2 : 1;
2379 unsigned SEG3 : 1;
2380 unsigned SEG4 : 1;
2381 unsigned SEG5 : 1;
2382 unsigned SEG6 : 1;
2383 unsigned SEG7 : 1;
2385 } __PORTDbits_t;
2387 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
2389 #define _PORTD_RD0 0x01
2390 #define _PORTD_SEG0 0x01
2391 #define _PORTD_RD1 0x02
2392 #define _PORTD_SEG1 0x02
2393 #define _PORTD_RD2 0x04
2394 #define _PORTD_SEG2 0x04
2395 #define _PORTD_RD3 0x08
2396 #define _PORTD_SEG3 0x08
2397 #define _PORTD_RD4 0x10
2398 #define _PORTD_SEG4 0x10
2399 #define _PORTD_RD5 0x20
2400 #define _PORTD_SEG5 0x20
2401 #define _PORTD_RD6 0x40
2402 #define _PORTD_SEG6 0x40
2403 #define _PORTD_RD7 0x80
2404 #define _PORTD_SEG7 0x80
2406 //==============================================================================
2409 //==============================================================================
2410 // PORTE Bits
2412 extern __at(0x0F84) __sfr PORTE;
2414 typedef union
2416 struct
2418 unsigned LCDBIAS1 : 1;
2419 unsigned LCDBIAS2 : 1;
2420 unsigned LCDBIAS3 : 1;
2421 unsigned COM0 : 1;
2422 unsigned RE4 : 1;
2423 unsigned RE5 : 1;
2424 unsigned RE6 : 1;
2425 unsigned RE7 : 1;
2428 struct
2430 unsigned BIAS1 : 1;
2431 unsigned BIAS2 : 1;
2432 unsigned BIAS3 : 1;
2433 unsigned : 1;
2434 unsigned COM1 : 1;
2435 unsigned COM2 : 1;
2436 unsigned COM3 : 1;
2437 unsigned SEG31 : 1;
2440 struct
2442 unsigned : 1;
2443 unsigned : 1;
2444 unsigned : 1;
2445 unsigned : 1;
2446 unsigned : 1;
2447 unsigned : 1;
2448 unsigned : 1;
2449 unsigned CCP2E : 1;
2452 struct
2454 unsigned : 3;
2455 unsigned COM : 4;
2456 unsigned : 1;
2458 } __PORTEbits_t;
2460 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
2462 #define _PORTE_LCDBIAS1 0x01
2463 #define _PORTE_BIAS1 0x01
2464 #define _PORTE_LCDBIAS2 0x02
2465 #define _PORTE_BIAS2 0x02
2466 #define _PORTE_LCDBIAS3 0x04
2467 #define _PORTE_BIAS3 0x04
2468 #define _PORTE_COM0 0x08
2469 #define _PORTE_RE4 0x10
2470 #define _PORTE_COM1 0x10
2471 #define _PORTE_RE5 0x20
2472 #define _PORTE_COM2 0x20
2473 #define _PORTE_RE6 0x40
2474 #define _PORTE_COM3 0x40
2475 #define _PORTE_RE7 0x80
2476 #define _PORTE_SEG31 0x80
2477 #define _PORTE_CCP2E 0x80
2479 //==============================================================================
2482 //==============================================================================
2483 // PORTF Bits
2485 extern __at(0x0F85) __sfr PORTF;
2487 typedef union
2489 struct
2491 unsigned RF0 : 1;
2492 unsigned RF1 : 1;
2493 unsigned RF2 : 1;
2494 unsigned RF3 : 1;
2495 unsigned RF4 : 1;
2496 unsigned RF5 : 1;
2497 unsigned RF6 : 1;
2498 unsigned RF7 : 1;
2501 struct
2503 unsigned AN5 : 1;
2504 unsigned AN6 : 1;
2505 unsigned AN7 : 1;
2506 unsigned AN8 : 1;
2507 unsigned AN9 : 1;
2508 unsigned AN10 : 1;
2509 unsigned AN11 : 1;
2510 unsigned SS : 1;
2513 struct
2515 unsigned SEG18 : 1;
2516 unsigned SEG19 : 1;
2517 unsigned SEG20 : 1;
2518 unsigned SEG21 : 1;
2519 unsigned SEG22 : 1;
2520 unsigned SEG23 : 1;
2521 unsigned SEG24 : 1;
2522 unsigned SEG25 : 1;
2525 struct
2527 unsigned : 1;
2528 unsigned C2OUTF : 1;
2529 unsigned C1OUTF : 1;
2530 unsigned : 1;
2531 unsigned : 1;
2532 unsigned CVREFF : 1;
2533 unsigned : 1;
2534 unsigned : 1;
2536 } __PORTFbits_t;
2538 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
2540 #define _PORTF_RF0 0x01
2541 #define _PORTF_AN5 0x01
2542 #define _PORTF_SEG18 0x01
2543 #define _PORTF_RF1 0x02
2544 #define _PORTF_AN6 0x02
2545 #define _PORTF_SEG19 0x02
2546 #define _PORTF_C2OUTF 0x02
2547 #define _PORTF_RF2 0x04
2548 #define _PORTF_AN7 0x04
2549 #define _PORTF_SEG20 0x04
2550 #define _PORTF_C1OUTF 0x04
2551 #define _PORTF_RF3 0x08
2552 #define _PORTF_AN8 0x08
2553 #define _PORTF_SEG21 0x08
2554 #define _PORTF_RF4 0x10
2555 #define _PORTF_AN9 0x10
2556 #define _PORTF_SEG22 0x10
2557 #define _PORTF_RF5 0x20
2558 #define _PORTF_AN10 0x20
2559 #define _PORTF_SEG23 0x20
2560 #define _PORTF_CVREFF 0x20
2561 #define _PORTF_RF6 0x40
2562 #define _PORTF_AN11 0x40
2563 #define _PORTF_SEG24 0x40
2564 #define _PORTF_RF7 0x80
2565 #define _PORTF_SS 0x80
2566 #define _PORTF_SEG25 0x80
2568 //==============================================================================
2571 //==============================================================================
2572 // PORTG Bits
2574 extern __at(0x0F86) __sfr PORTG;
2576 typedef union
2578 struct
2580 unsigned RG0 : 1;
2581 unsigned RG1 : 1;
2582 unsigned RG2 : 1;
2583 unsigned RG3 : 1;
2584 unsigned RG4 : 1;
2585 unsigned RG5 : 1;
2586 unsigned : 1;
2587 unsigned : 1;
2590 struct
2592 unsigned SEG30 : 1;
2593 unsigned TX2 : 1;
2594 unsigned RX2 : 1;
2595 unsigned SEG27 : 1;
2596 unsigned SEG26 : 1;
2597 unsigned MCLR : 1;
2598 unsigned : 1;
2599 unsigned : 1;
2602 struct
2604 unsigned : 1;
2605 unsigned CK2 : 1;
2606 unsigned DT2 : 1;
2607 unsigned : 1;
2608 unsigned : 1;
2609 unsigned VPP : 1;
2610 unsigned : 1;
2611 unsigned : 1;
2614 struct
2616 unsigned : 1;
2617 unsigned SEG29 : 1;
2618 unsigned SEG28 : 1;
2619 unsigned : 1;
2620 unsigned : 1;
2621 unsigned : 1;
2622 unsigned : 1;
2623 unsigned : 1;
2626 struct
2628 unsigned RG : 6;
2629 unsigned : 2;
2631 } __PORTGbits_t;
2633 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
2635 #define _PORTG_RG0 0x01
2636 #define _PORTG_SEG30 0x01
2637 #define _PORTG_RG1 0x02
2638 #define _PORTG_TX2 0x02
2639 #define _PORTG_CK2 0x02
2640 #define _PORTG_SEG29 0x02
2641 #define _PORTG_RG2 0x04
2642 #define _PORTG_RX2 0x04
2643 #define _PORTG_DT2 0x04
2644 #define _PORTG_SEG28 0x04
2645 #define _PORTG_RG3 0x08
2646 #define _PORTG_SEG27 0x08
2647 #define _PORTG_RG4 0x10
2648 #define _PORTG_SEG26 0x10
2649 #define _PORTG_RG5 0x20
2650 #define _PORTG_MCLR 0x20
2651 #define _PORTG_VPP 0x20
2653 //==============================================================================
2656 //==============================================================================
2657 // LATA Bits
2659 extern __at(0x0F89) __sfr LATA;
2661 typedef struct
2663 unsigned LATA0 : 1;
2664 unsigned LATA1 : 1;
2665 unsigned LATA2 : 1;
2666 unsigned LATA3 : 1;
2667 unsigned LATA4 : 1;
2668 unsigned LATA5 : 1;
2669 unsigned LATA6 : 1;
2670 unsigned LATA7 : 1;
2671 } __LATAbits_t;
2673 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2675 #define _LATA0 0x01
2676 #define _LATA1 0x02
2677 #define _LATA2 0x04
2678 #define _LATA3 0x08
2679 #define _LATA4 0x10
2680 #define _LATA5 0x20
2681 #define _LATA6 0x40
2682 #define _LATA7 0x80
2684 //==============================================================================
2687 //==============================================================================
2688 // LATB Bits
2690 extern __at(0x0F8A) __sfr LATB;
2692 typedef struct
2694 unsigned LATB0 : 1;
2695 unsigned LATB1 : 1;
2696 unsigned LATB2 : 1;
2697 unsigned LATB3 : 1;
2698 unsigned LATB4 : 1;
2699 unsigned LATB5 : 1;
2700 unsigned LATB6 : 1;
2701 unsigned LATB7 : 1;
2702 } __LATBbits_t;
2704 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2706 #define _LATB0 0x01
2707 #define _LATB1 0x02
2708 #define _LATB2 0x04
2709 #define _LATB3 0x08
2710 #define _LATB4 0x10
2711 #define _LATB5 0x20
2712 #define _LATB6 0x40
2713 #define _LATB7 0x80
2715 //==============================================================================
2718 //==============================================================================
2719 // LATC Bits
2721 extern __at(0x0F8B) __sfr LATC;
2723 typedef struct
2725 unsigned LATC0 : 1;
2726 unsigned LATC1 : 1;
2727 unsigned LATC2 : 1;
2728 unsigned LATC3 : 1;
2729 unsigned LATC4 : 1;
2730 unsigned LATC5 : 1;
2731 unsigned LATC6 : 1;
2732 unsigned LATC7 : 1;
2733 } __LATCbits_t;
2735 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2737 #define _LATC0 0x01
2738 #define _LATC1 0x02
2739 #define _LATC2 0x04
2740 #define _LATC3 0x08
2741 #define _LATC4 0x10
2742 #define _LATC5 0x20
2743 #define _LATC6 0x40
2744 #define _LATC7 0x80
2746 //==============================================================================
2749 //==============================================================================
2750 // LATD Bits
2752 extern __at(0x0F8C) __sfr LATD;
2754 typedef struct
2756 unsigned LATD0 : 1;
2757 unsigned LATD1 : 1;
2758 unsigned LATD2 : 1;
2759 unsigned LATD3 : 1;
2760 unsigned LATD4 : 1;
2761 unsigned LATD5 : 1;
2762 unsigned LATD6 : 1;
2763 unsigned LATD7 : 1;
2764 } __LATDbits_t;
2766 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2768 #define _LATD0 0x01
2769 #define _LATD1 0x02
2770 #define _LATD2 0x04
2771 #define _LATD3 0x08
2772 #define _LATD4 0x10
2773 #define _LATD5 0x20
2774 #define _LATD6 0x40
2775 #define _LATD7 0x80
2777 //==============================================================================
2780 //==============================================================================
2781 // LATE Bits
2783 extern __at(0x0F8D) __sfr LATE;
2785 typedef struct
2787 unsigned : 1;
2788 unsigned : 1;
2789 unsigned : 1;
2790 unsigned : 1;
2791 unsigned LATE4 : 1;
2792 unsigned LATE5 : 1;
2793 unsigned LATE6 : 1;
2794 unsigned LATE7 : 1;
2795 } __LATEbits_t;
2797 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2799 #define _LATE4 0x10
2800 #define _LATE5 0x20
2801 #define _LATE6 0x40
2802 #define _LATE7 0x80
2804 //==============================================================================
2807 //==============================================================================
2808 // LATF Bits
2810 extern __at(0x0F8E) __sfr LATF;
2812 typedef struct
2814 unsigned LATF0 : 1;
2815 unsigned LATF1 : 1;
2816 unsigned LATF2 : 1;
2817 unsigned LATF3 : 1;
2818 unsigned LATF4 : 1;
2819 unsigned LATF5 : 1;
2820 unsigned LATF6 : 1;
2821 unsigned LATF7 : 1;
2822 } __LATFbits_t;
2824 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
2826 #define _LATF0 0x01
2827 #define _LATF1 0x02
2828 #define _LATF2 0x04
2829 #define _LATF3 0x08
2830 #define _LATF4 0x10
2831 #define _LATF5 0x20
2832 #define _LATF6 0x40
2833 #define _LATF7 0x80
2835 //==============================================================================
2838 //==============================================================================
2839 // LATG Bits
2841 extern __at(0x0F8F) __sfr LATG;
2843 typedef union
2845 struct
2847 unsigned LATG0 : 1;
2848 unsigned LATG1 : 1;
2849 unsigned LATG2 : 1;
2850 unsigned LATG3 : 1;
2851 unsigned LATG4 : 1;
2852 unsigned : 1;
2853 unsigned : 1;
2854 unsigned : 1;
2857 struct
2859 unsigned LATG : 5;
2860 unsigned : 3;
2862 } __LATGbits_t;
2864 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2866 #define _LATG0 0x01
2867 #define _LATG1 0x02
2868 #define _LATG2 0x04
2869 #define _LATG3 0x08
2870 #define _LATG4 0x10
2872 //==============================================================================
2875 //==============================================================================
2876 // DDRA Bits
2878 extern __at(0x0F92) __sfr DDRA;
2880 typedef union
2882 struct
2884 unsigned TRISA0 : 1;
2885 unsigned TRISA1 : 1;
2886 unsigned TRISA2 : 1;
2887 unsigned TRISA3 : 1;
2888 unsigned TRISA4 : 1;
2889 unsigned TRISA5 : 1;
2890 unsigned TRISA6 : 1;
2891 unsigned TRISA7 : 1;
2894 struct
2896 unsigned RA0 : 1;
2897 unsigned RA1 : 1;
2898 unsigned RA2 : 1;
2899 unsigned RA3 : 1;
2900 unsigned RA4 : 1;
2901 unsigned RA5 : 1;
2902 unsigned RA6 : 1;
2903 unsigned RA7 : 1;
2905 } __DDRAbits_t;
2907 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2909 #define _TRISA0 0x01
2910 #define _RA0 0x01
2911 #define _TRISA1 0x02
2912 #define _RA1 0x02
2913 #define _TRISA2 0x04
2914 #define _RA2 0x04
2915 #define _TRISA3 0x08
2916 #define _RA3 0x08
2917 #define _TRISA4 0x10
2918 #define _RA4 0x10
2919 #define _TRISA5 0x20
2920 #define _RA5 0x20
2921 #define _TRISA6 0x40
2922 #define _RA6 0x40
2923 #define _TRISA7 0x80
2924 #define _RA7 0x80
2926 //==============================================================================
2929 //==============================================================================
2930 // TRISA Bits
2932 extern __at(0x0F92) __sfr TRISA;
2934 typedef union
2936 struct
2938 unsigned TRISA0 : 1;
2939 unsigned TRISA1 : 1;
2940 unsigned TRISA2 : 1;
2941 unsigned TRISA3 : 1;
2942 unsigned TRISA4 : 1;
2943 unsigned TRISA5 : 1;
2944 unsigned TRISA6 : 1;
2945 unsigned TRISA7 : 1;
2948 struct
2950 unsigned RA0 : 1;
2951 unsigned RA1 : 1;
2952 unsigned RA2 : 1;
2953 unsigned RA3 : 1;
2954 unsigned RA4 : 1;
2955 unsigned RA5 : 1;
2956 unsigned RA6 : 1;
2957 unsigned RA7 : 1;
2959 } __TRISAbits_t;
2961 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2963 #define _TRISA_TRISA0 0x01
2964 #define _TRISA_RA0 0x01
2965 #define _TRISA_TRISA1 0x02
2966 #define _TRISA_RA1 0x02
2967 #define _TRISA_TRISA2 0x04
2968 #define _TRISA_RA2 0x04
2969 #define _TRISA_TRISA3 0x08
2970 #define _TRISA_RA3 0x08
2971 #define _TRISA_TRISA4 0x10
2972 #define _TRISA_RA4 0x10
2973 #define _TRISA_TRISA5 0x20
2974 #define _TRISA_RA5 0x20
2975 #define _TRISA_TRISA6 0x40
2976 #define _TRISA_RA6 0x40
2977 #define _TRISA_TRISA7 0x80
2978 #define _TRISA_RA7 0x80
2980 //==============================================================================
2983 //==============================================================================
2984 // DDRB Bits
2986 extern __at(0x0F93) __sfr DDRB;
2988 typedef union
2990 struct
2992 unsigned TRISB0 : 1;
2993 unsigned TRISB1 : 1;
2994 unsigned TRISB2 : 1;
2995 unsigned TRISB3 : 1;
2996 unsigned TRISB4 : 1;
2997 unsigned TRISB5 : 1;
2998 unsigned TRISB6 : 1;
2999 unsigned TRISB7 : 1;
3002 struct
3004 unsigned RB0 : 1;
3005 unsigned RB1 : 1;
3006 unsigned RB2 : 1;
3007 unsigned RB3 : 1;
3008 unsigned RB4 : 1;
3009 unsigned RB5 : 1;
3010 unsigned RB6 : 1;
3011 unsigned RB7 : 1;
3013 } __DDRBbits_t;
3015 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
3017 #define _TRISB0 0x01
3018 #define _RB0 0x01
3019 #define _TRISB1 0x02
3020 #define _RB1 0x02
3021 #define _TRISB2 0x04
3022 #define _RB2 0x04
3023 #define _TRISB3 0x08
3024 #define _RB3 0x08
3025 #define _TRISB4 0x10
3026 #define _RB4 0x10
3027 #define _TRISB5 0x20
3028 #define _RB5 0x20
3029 #define _TRISB6 0x40
3030 #define _RB6 0x40
3031 #define _TRISB7 0x80
3032 #define _RB7 0x80
3034 //==============================================================================
3037 //==============================================================================
3038 // TRISB Bits
3040 extern __at(0x0F93) __sfr TRISB;
3042 typedef union
3044 struct
3046 unsigned TRISB0 : 1;
3047 unsigned TRISB1 : 1;
3048 unsigned TRISB2 : 1;
3049 unsigned TRISB3 : 1;
3050 unsigned TRISB4 : 1;
3051 unsigned TRISB5 : 1;
3052 unsigned TRISB6 : 1;
3053 unsigned TRISB7 : 1;
3056 struct
3058 unsigned RB0 : 1;
3059 unsigned RB1 : 1;
3060 unsigned RB2 : 1;
3061 unsigned RB3 : 1;
3062 unsigned RB4 : 1;
3063 unsigned RB5 : 1;
3064 unsigned RB6 : 1;
3065 unsigned RB7 : 1;
3067 } __TRISBbits_t;
3069 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3071 #define _TRISB_TRISB0 0x01
3072 #define _TRISB_RB0 0x01
3073 #define _TRISB_TRISB1 0x02
3074 #define _TRISB_RB1 0x02
3075 #define _TRISB_TRISB2 0x04
3076 #define _TRISB_RB2 0x04
3077 #define _TRISB_TRISB3 0x08
3078 #define _TRISB_RB3 0x08
3079 #define _TRISB_TRISB4 0x10
3080 #define _TRISB_RB4 0x10
3081 #define _TRISB_TRISB5 0x20
3082 #define _TRISB_RB5 0x20
3083 #define _TRISB_TRISB6 0x40
3084 #define _TRISB_RB6 0x40
3085 #define _TRISB_TRISB7 0x80
3086 #define _TRISB_RB7 0x80
3088 //==============================================================================
3091 //==============================================================================
3092 // DDRC Bits
3094 extern __at(0x0F94) __sfr DDRC;
3096 typedef union
3098 struct
3100 unsigned TRISC0 : 1;
3101 unsigned TRISC1 : 1;
3102 unsigned TRISC2 : 1;
3103 unsigned TRISC3 : 1;
3104 unsigned TRISC4 : 1;
3105 unsigned TRISC5 : 1;
3106 unsigned TRISC6 : 1;
3107 unsigned TRISC7 : 1;
3110 struct
3112 unsigned RC0 : 1;
3113 unsigned RC1 : 1;
3114 unsigned RC2 : 1;
3115 unsigned RC3 : 1;
3116 unsigned RC4 : 1;
3117 unsigned RC5 : 1;
3118 unsigned RC6 : 1;
3119 unsigned RC7 : 1;
3121 } __DDRCbits_t;
3123 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
3125 #define _TRISC0 0x01
3126 #define _RC0 0x01
3127 #define _TRISC1 0x02
3128 #define _RC1 0x02
3129 #define _TRISC2 0x04
3130 #define _RC2 0x04
3131 #define _TRISC3 0x08
3132 #define _RC3 0x08
3133 #define _TRISC4 0x10
3134 #define _RC4 0x10
3135 #define _TRISC5 0x20
3136 #define _RC5 0x20
3137 #define _TRISC6 0x40
3138 #define _RC6 0x40
3139 #define _TRISC7 0x80
3140 #define _RC7 0x80
3142 //==============================================================================
3145 //==============================================================================
3146 // TRISC Bits
3148 extern __at(0x0F94) __sfr TRISC;
3150 typedef union
3152 struct
3154 unsigned TRISC0 : 1;
3155 unsigned TRISC1 : 1;
3156 unsigned TRISC2 : 1;
3157 unsigned TRISC3 : 1;
3158 unsigned TRISC4 : 1;
3159 unsigned TRISC5 : 1;
3160 unsigned TRISC6 : 1;
3161 unsigned TRISC7 : 1;
3164 struct
3166 unsigned RC0 : 1;
3167 unsigned RC1 : 1;
3168 unsigned RC2 : 1;
3169 unsigned RC3 : 1;
3170 unsigned RC4 : 1;
3171 unsigned RC5 : 1;
3172 unsigned RC6 : 1;
3173 unsigned RC7 : 1;
3175 } __TRISCbits_t;
3177 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3179 #define _TRISC_TRISC0 0x01
3180 #define _TRISC_RC0 0x01
3181 #define _TRISC_TRISC1 0x02
3182 #define _TRISC_RC1 0x02
3183 #define _TRISC_TRISC2 0x04
3184 #define _TRISC_RC2 0x04
3185 #define _TRISC_TRISC3 0x08
3186 #define _TRISC_RC3 0x08
3187 #define _TRISC_TRISC4 0x10
3188 #define _TRISC_RC4 0x10
3189 #define _TRISC_TRISC5 0x20
3190 #define _TRISC_RC5 0x20
3191 #define _TRISC_TRISC6 0x40
3192 #define _TRISC_RC6 0x40
3193 #define _TRISC_TRISC7 0x80
3194 #define _TRISC_RC7 0x80
3196 //==============================================================================
3199 //==============================================================================
3200 // DDRD Bits
3202 extern __at(0x0F95) __sfr DDRD;
3204 typedef union
3206 struct
3208 unsigned TRISD0 : 1;
3209 unsigned TRISD1 : 1;
3210 unsigned TRISD2 : 1;
3211 unsigned TRISD3 : 1;
3212 unsigned TRISD4 : 1;
3213 unsigned TRISD5 : 1;
3214 unsigned TRISD6 : 1;
3215 unsigned TRISD7 : 1;
3218 struct
3220 unsigned RD0 : 1;
3221 unsigned RD1 : 1;
3222 unsigned RD2 : 1;
3223 unsigned RD3 : 1;
3224 unsigned RD4 : 1;
3225 unsigned RD5 : 1;
3226 unsigned RD6 : 1;
3227 unsigned RD7 : 1;
3229 } __DDRDbits_t;
3231 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
3233 #define _TRISD0 0x01
3234 #define _RD0 0x01
3235 #define _TRISD1 0x02
3236 #define _RD1 0x02
3237 #define _TRISD2 0x04
3238 #define _RD2 0x04
3239 #define _TRISD3 0x08
3240 #define _RD3 0x08
3241 #define _TRISD4 0x10
3242 #define _RD4 0x10
3243 #define _TRISD5 0x20
3244 #define _RD5 0x20
3245 #define _TRISD6 0x40
3246 #define _RD6 0x40
3247 #define _TRISD7 0x80
3248 #define _RD7 0x80
3250 //==============================================================================
3253 //==============================================================================
3254 // TRISD Bits
3256 extern __at(0x0F95) __sfr TRISD;
3258 typedef union
3260 struct
3262 unsigned TRISD0 : 1;
3263 unsigned TRISD1 : 1;
3264 unsigned TRISD2 : 1;
3265 unsigned TRISD3 : 1;
3266 unsigned TRISD4 : 1;
3267 unsigned TRISD5 : 1;
3268 unsigned TRISD6 : 1;
3269 unsigned TRISD7 : 1;
3272 struct
3274 unsigned RD0 : 1;
3275 unsigned RD1 : 1;
3276 unsigned RD2 : 1;
3277 unsigned RD3 : 1;
3278 unsigned RD4 : 1;
3279 unsigned RD5 : 1;
3280 unsigned RD6 : 1;
3281 unsigned RD7 : 1;
3283 } __TRISDbits_t;
3285 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
3287 #define _TRISD_TRISD0 0x01
3288 #define _TRISD_RD0 0x01
3289 #define _TRISD_TRISD1 0x02
3290 #define _TRISD_RD1 0x02
3291 #define _TRISD_TRISD2 0x04
3292 #define _TRISD_RD2 0x04
3293 #define _TRISD_TRISD3 0x08
3294 #define _TRISD_RD3 0x08
3295 #define _TRISD_TRISD4 0x10
3296 #define _TRISD_RD4 0x10
3297 #define _TRISD_TRISD5 0x20
3298 #define _TRISD_RD5 0x20
3299 #define _TRISD_TRISD6 0x40
3300 #define _TRISD_RD6 0x40
3301 #define _TRISD_TRISD7 0x80
3302 #define _TRISD_RD7 0x80
3304 //==============================================================================
3307 //==============================================================================
3308 // DDRE Bits
3310 extern __at(0x0F96) __sfr DDRE;
3312 typedef union
3314 struct
3316 unsigned : 1;
3317 unsigned : 1;
3318 unsigned : 1;
3319 unsigned : 1;
3320 unsigned TRISE4 : 1;
3321 unsigned TRISE5 : 1;
3322 unsigned TRISE6 : 1;
3323 unsigned TRISE7 : 1;
3326 struct
3328 unsigned : 1;
3329 unsigned : 1;
3330 unsigned : 1;
3331 unsigned : 1;
3332 unsigned RE4 : 1;
3333 unsigned RE5 : 1;
3334 unsigned RE6 : 1;
3335 unsigned RE7 : 1;
3337 } __DDREbits_t;
3339 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
3341 #define _TRISE4 0x10
3342 #define _RE4 0x10
3343 #define _TRISE5 0x20
3344 #define _RE5 0x20
3345 #define _TRISE6 0x40
3346 #define _RE6 0x40
3347 #define _TRISE7 0x80
3348 #define _RE7 0x80
3350 //==============================================================================
3353 //==============================================================================
3354 // TRISE Bits
3356 extern __at(0x0F96) __sfr TRISE;
3358 typedef union
3360 struct
3362 unsigned : 1;
3363 unsigned : 1;
3364 unsigned : 1;
3365 unsigned : 1;
3366 unsigned TRISE4 : 1;
3367 unsigned TRISE5 : 1;
3368 unsigned TRISE6 : 1;
3369 unsigned TRISE7 : 1;
3372 struct
3374 unsigned : 1;
3375 unsigned : 1;
3376 unsigned : 1;
3377 unsigned : 1;
3378 unsigned RE4 : 1;
3379 unsigned RE5 : 1;
3380 unsigned RE6 : 1;
3381 unsigned RE7 : 1;
3383 } __TRISEbits_t;
3385 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
3387 #define _TRISE_TRISE4 0x10
3388 #define _TRISE_RE4 0x10
3389 #define _TRISE_TRISE5 0x20
3390 #define _TRISE_RE5 0x20
3391 #define _TRISE_TRISE6 0x40
3392 #define _TRISE_RE6 0x40
3393 #define _TRISE_TRISE7 0x80
3394 #define _TRISE_RE7 0x80
3396 //==============================================================================
3399 //==============================================================================
3400 // DDRF Bits
3402 extern __at(0x0F97) __sfr DDRF;
3404 typedef union
3406 struct
3408 unsigned TRISF0 : 1;
3409 unsigned TRISF1 : 1;
3410 unsigned TRISF2 : 1;
3411 unsigned TRISF3 : 1;
3412 unsigned TRISF4 : 1;
3413 unsigned TRISF5 : 1;
3414 unsigned TRISF6 : 1;
3415 unsigned TRISF7 : 1;
3418 struct
3420 unsigned RF0 : 1;
3421 unsigned RF1 : 1;
3422 unsigned RF2 : 1;
3423 unsigned RF3 : 1;
3424 unsigned RF4 : 1;
3425 unsigned RF5 : 1;
3426 unsigned RF6 : 1;
3427 unsigned RF7 : 1;
3429 } __DDRFbits_t;
3431 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
3433 #define _TRISF0 0x01
3434 #define _RF0 0x01
3435 #define _TRISF1 0x02
3436 #define _RF1 0x02
3437 #define _TRISF2 0x04
3438 #define _RF2 0x04
3439 #define _TRISF3 0x08
3440 #define _RF3 0x08
3441 #define _TRISF4 0x10
3442 #define _RF4 0x10
3443 #define _TRISF5 0x20
3444 #define _RF5 0x20
3445 #define _TRISF6 0x40
3446 #define _RF6 0x40
3447 #define _TRISF7 0x80
3448 #define _RF7 0x80
3450 //==============================================================================
3453 //==============================================================================
3454 // TRISF Bits
3456 extern __at(0x0F97) __sfr TRISF;
3458 typedef union
3460 struct
3462 unsigned TRISF0 : 1;
3463 unsigned TRISF1 : 1;
3464 unsigned TRISF2 : 1;
3465 unsigned TRISF3 : 1;
3466 unsigned TRISF4 : 1;
3467 unsigned TRISF5 : 1;
3468 unsigned TRISF6 : 1;
3469 unsigned TRISF7 : 1;
3472 struct
3474 unsigned RF0 : 1;
3475 unsigned RF1 : 1;
3476 unsigned RF2 : 1;
3477 unsigned RF3 : 1;
3478 unsigned RF4 : 1;
3479 unsigned RF5 : 1;
3480 unsigned RF6 : 1;
3481 unsigned RF7 : 1;
3483 } __TRISFbits_t;
3485 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
3487 #define _TRISF_TRISF0 0x01
3488 #define _TRISF_RF0 0x01
3489 #define _TRISF_TRISF1 0x02
3490 #define _TRISF_RF1 0x02
3491 #define _TRISF_TRISF2 0x04
3492 #define _TRISF_RF2 0x04
3493 #define _TRISF_TRISF3 0x08
3494 #define _TRISF_RF3 0x08
3495 #define _TRISF_TRISF4 0x10
3496 #define _TRISF_RF4 0x10
3497 #define _TRISF_TRISF5 0x20
3498 #define _TRISF_RF5 0x20
3499 #define _TRISF_TRISF6 0x40
3500 #define _TRISF_RF6 0x40
3501 #define _TRISF_TRISF7 0x80
3502 #define _TRISF_RF7 0x80
3504 //==============================================================================
3507 //==============================================================================
3508 // DDRG Bits
3510 extern __at(0x0F98) __sfr DDRG;
3512 typedef union
3514 struct
3516 unsigned TRISG0 : 1;
3517 unsigned TRISG1 : 1;
3518 unsigned TRISG2 : 1;
3519 unsigned TRISG3 : 1;
3520 unsigned TRISG4 : 1;
3521 unsigned : 1;
3522 unsigned : 1;
3523 unsigned : 1;
3526 struct
3528 unsigned RG0 : 1;
3529 unsigned RG1 : 1;
3530 unsigned RG2 : 1;
3531 unsigned RG3 : 1;
3532 unsigned RG4 : 1;
3533 unsigned : 1;
3534 unsigned : 1;
3535 unsigned : 1;
3538 struct
3540 unsigned RG : 5;
3541 unsigned : 3;
3544 struct
3546 unsigned TRISG : 5;
3547 unsigned : 3;
3549 } __DDRGbits_t;
3551 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
3553 #define _TRISG0 0x01
3554 #define _RG0 0x01
3555 #define _TRISG1 0x02
3556 #define _RG1 0x02
3557 #define _TRISG2 0x04
3558 #define _RG2 0x04
3559 #define _TRISG3 0x08
3560 #define _RG3 0x08
3561 #define _TRISG4 0x10
3562 #define _RG4 0x10
3564 //==============================================================================
3567 //==============================================================================
3568 // TRISG Bits
3570 extern __at(0x0F98) __sfr TRISG;
3572 typedef union
3574 struct
3576 unsigned TRISG0 : 1;
3577 unsigned TRISG1 : 1;
3578 unsigned TRISG2 : 1;
3579 unsigned TRISG3 : 1;
3580 unsigned TRISG4 : 1;
3581 unsigned : 1;
3582 unsigned : 1;
3583 unsigned : 1;
3586 struct
3588 unsigned RG0 : 1;
3589 unsigned RG1 : 1;
3590 unsigned RG2 : 1;
3591 unsigned RG3 : 1;
3592 unsigned RG4 : 1;
3593 unsigned : 1;
3594 unsigned : 1;
3595 unsigned : 1;
3598 struct
3600 unsigned RG : 5;
3601 unsigned : 3;
3604 struct
3606 unsigned TRISG : 5;
3607 unsigned : 3;
3609 } __TRISGbits_t;
3611 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
3613 #define _TRISG_TRISG0 0x01
3614 #define _TRISG_RG0 0x01
3615 #define _TRISG_TRISG1 0x02
3616 #define _TRISG_RG1 0x02
3617 #define _TRISG_TRISG2 0x04
3618 #define _TRISG_RG2 0x04
3619 #define _TRISG_TRISG3 0x08
3620 #define _TRISG_RG3 0x08
3621 #define _TRISG_TRISG4 0x10
3622 #define _TRISG_RG4 0x10
3624 //==============================================================================
3627 //==============================================================================
3628 // OSCTUNE Bits
3630 extern __at(0x0F9B) __sfr OSCTUNE;
3632 typedef union
3634 struct
3636 unsigned TUN0 : 1;
3637 unsigned TUN1 : 1;
3638 unsigned TUN2 : 1;
3639 unsigned TUN3 : 1;
3640 unsigned TUN4 : 1;
3641 unsigned : 1;
3642 unsigned PLLEN : 1;
3643 unsigned INTSRC : 1;
3646 struct
3648 unsigned TUN : 5;
3649 unsigned : 3;
3651 } __OSCTUNEbits_t;
3653 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3655 #define _TUN0 0x01
3656 #define _TUN1 0x02
3657 #define _TUN2 0x04
3658 #define _TUN3 0x08
3659 #define _TUN4 0x10
3660 #define _PLLEN 0x40
3661 #define _INTSRC 0x80
3663 //==============================================================================
3666 //==============================================================================
3667 // PIE1 Bits
3669 extern __at(0x0F9D) __sfr PIE1;
3671 typedef union
3673 struct
3675 unsigned TMR1IE : 1;
3676 unsigned TMR2IE : 1;
3677 unsigned CCP1IE : 1;
3678 unsigned SSPIE : 1;
3679 unsigned TXIE : 1;
3680 unsigned RCIE : 1;
3681 unsigned ADIE : 1;
3682 unsigned : 1;
3685 struct
3687 unsigned : 1;
3688 unsigned : 1;
3689 unsigned : 1;
3690 unsigned : 1;
3691 unsigned TX1IE : 1;
3692 unsigned RC1IE : 1;
3693 unsigned : 1;
3694 unsigned : 1;
3696 } __PIE1bits_t;
3698 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3700 #define _TMR1IE 0x01
3701 #define _TMR2IE 0x02
3702 #define _CCP1IE 0x04
3703 #define _SSPIE 0x08
3704 #define _TXIE 0x10
3705 #define _TX1IE 0x10
3706 #define _RCIE 0x20
3707 #define _RC1IE 0x20
3708 #define _ADIE 0x40
3710 //==============================================================================
3713 //==============================================================================
3714 // PIR1 Bits
3716 extern __at(0x0F9E) __sfr PIR1;
3718 typedef union
3720 struct
3722 unsigned TMR1IF : 1;
3723 unsigned TMR2IF : 1;
3724 unsigned CCP1IF : 1;
3725 unsigned SSPIF : 1;
3726 unsigned TXIF : 1;
3727 unsigned RCIF : 1;
3728 unsigned ADIF : 1;
3729 unsigned : 1;
3732 struct
3734 unsigned : 1;
3735 unsigned : 1;
3736 unsigned : 1;
3737 unsigned : 1;
3738 unsigned TX1IF : 1;
3739 unsigned RC1IF : 1;
3740 unsigned : 1;
3741 unsigned : 1;
3743 } __PIR1bits_t;
3745 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3747 #define _TMR1IF 0x01
3748 #define _TMR2IF 0x02
3749 #define _CCP1IF 0x04
3750 #define _SSPIF 0x08
3751 #define _TXIF 0x10
3752 #define _TX1IF 0x10
3753 #define _RCIF 0x20
3754 #define _RC1IF 0x20
3755 #define _ADIF 0x40
3757 //==============================================================================
3760 //==============================================================================
3761 // IPR1 Bits
3763 extern __at(0x0F9F) __sfr IPR1;
3765 typedef union
3767 struct
3769 unsigned TMR1IP : 1;
3770 unsigned TMR2IP : 1;
3771 unsigned CCP1IP : 1;
3772 unsigned SSPIP : 1;
3773 unsigned TXIP : 1;
3774 unsigned RCIP : 1;
3775 unsigned ADIP : 1;
3776 unsigned : 1;
3779 struct
3781 unsigned : 1;
3782 unsigned : 1;
3783 unsigned : 1;
3784 unsigned : 1;
3785 unsigned TX1IP : 1;
3786 unsigned RC1IP : 1;
3787 unsigned : 1;
3788 unsigned : 1;
3790 } __IPR1bits_t;
3792 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3794 #define _TMR1IP 0x01
3795 #define _TMR2IP 0x02
3796 #define _CCP1IP 0x04
3797 #define _SSPIP 0x08
3798 #define _TXIP 0x10
3799 #define _TX1IP 0x10
3800 #define _RCIP 0x20
3801 #define _RC1IP 0x20
3802 #define _ADIP 0x40
3804 //==============================================================================
3807 //==============================================================================
3808 // PIE2 Bits
3810 extern __at(0x0FA0) __sfr PIE2;
3812 typedef union
3814 struct
3816 unsigned CCP2IE : 1;
3817 unsigned TMR3IE : 1;
3818 unsigned HLVDIE : 1;
3819 unsigned BCLIE : 1;
3820 unsigned : 1;
3821 unsigned : 1;
3822 unsigned CMIE : 1;
3823 unsigned OSCFIE : 1;
3826 struct
3828 unsigned : 1;
3829 unsigned : 1;
3830 unsigned LVDIE : 1;
3831 unsigned : 1;
3832 unsigned : 1;
3833 unsigned : 1;
3834 unsigned : 1;
3835 unsigned : 1;
3837 } __PIE2bits_t;
3839 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3841 #define _CCP2IE 0x01
3842 #define _TMR3IE 0x02
3843 #define _HLVDIE 0x04
3844 #define _LVDIE 0x04
3845 #define _BCLIE 0x08
3846 #define _CMIE 0x40
3847 #define _OSCFIE 0x80
3849 //==============================================================================
3852 //==============================================================================
3853 // PIR2 Bits
3855 extern __at(0x0FA1) __sfr PIR2;
3857 typedef union
3859 struct
3861 unsigned CCP2IF : 1;
3862 unsigned TMR3IF : 1;
3863 unsigned HLVDIF : 1;
3864 unsigned BCLIF : 1;
3865 unsigned : 1;
3866 unsigned : 1;
3867 unsigned CMIF : 1;
3868 unsigned OSCFIF : 1;
3871 struct
3873 unsigned : 1;
3874 unsigned : 1;
3875 unsigned LVDIF : 1;
3876 unsigned : 1;
3877 unsigned : 1;
3878 unsigned : 1;
3879 unsigned : 1;
3880 unsigned : 1;
3882 } __PIR2bits_t;
3884 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3886 #define _CCP2IF 0x01
3887 #define _TMR3IF 0x02
3888 #define _HLVDIF 0x04
3889 #define _LVDIF 0x04
3890 #define _BCLIF 0x08
3891 #define _CMIF 0x40
3892 #define _OSCFIF 0x80
3894 //==============================================================================
3897 //==============================================================================
3898 // IPR2 Bits
3900 extern __at(0x0FA2) __sfr IPR2;
3902 typedef union
3904 struct
3906 unsigned CCP2IP : 1;
3907 unsigned TMR3IP : 1;
3908 unsigned HLVDIP : 1;
3909 unsigned BCLIP : 1;
3910 unsigned : 1;
3911 unsigned : 1;
3912 unsigned CMIP : 1;
3913 unsigned OSCFIP : 1;
3916 struct
3918 unsigned : 1;
3919 unsigned : 1;
3920 unsigned LVDIP : 1;
3921 unsigned : 1;
3922 unsigned : 1;
3923 unsigned : 1;
3924 unsigned : 1;
3925 unsigned : 1;
3927 } __IPR2bits_t;
3929 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3931 #define _CCP2IP 0x01
3932 #define _TMR3IP 0x02
3933 #define _HLVDIP 0x04
3934 #define _LVDIP 0x04
3935 #define _BCLIP 0x08
3936 #define _CMIP 0x40
3937 #define _OSCFIP 0x80
3939 //==============================================================================
3942 //==============================================================================
3943 // PIE3 Bits
3945 extern __at(0x0FA3) __sfr PIE3;
3947 typedef struct
3949 unsigned : 1;
3950 unsigned : 1;
3951 unsigned : 1;
3952 unsigned : 1;
3953 unsigned TX2IE : 1;
3954 unsigned RC2IE : 1;
3955 unsigned LCDIE : 1;
3956 unsigned : 1;
3957 } __PIE3bits_t;
3959 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3961 #define _TX2IE 0x10
3962 #define _RC2IE 0x20
3963 #define _LCDIE 0x40
3965 //==============================================================================
3968 //==============================================================================
3969 // PIR3 Bits
3971 extern __at(0x0FA4) __sfr PIR3;
3973 typedef struct
3975 unsigned : 1;
3976 unsigned : 1;
3977 unsigned : 1;
3978 unsigned : 1;
3979 unsigned TX2IF : 1;
3980 unsigned RC2IF : 1;
3981 unsigned LCDIF : 1;
3982 unsigned : 1;
3983 } __PIR3bits_t;
3985 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3987 #define _TX2IF 0x10
3988 #define _RC2IF 0x20
3989 #define _LCDIF 0x40
3991 //==============================================================================
3994 //==============================================================================
3995 // IPR3 Bits
3997 extern __at(0x0FA5) __sfr IPR3;
3999 typedef struct
4001 unsigned : 1;
4002 unsigned : 1;
4003 unsigned : 1;
4004 unsigned : 1;
4005 unsigned TX2IP : 1;
4006 unsigned RC2IP : 1;
4007 unsigned LCDIP : 1;
4008 unsigned : 1;
4009 } __IPR3bits_t;
4011 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4013 #define _TX2IP 0x10
4014 #define _RC2IP 0x20
4015 #define _LCDIP 0x40
4017 //==============================================================================
4020 //==============================================================================
4021 // RCSTA Bits
4023 extern __at(0x0FAB) __sfr RCSTA;
4025 typedef union
4027 struct
4029 unsigned RX9D : 1;
4030 unsigned OERR : 1;
4031 unsigned FERR : 1;
4032 unsigned ADDEN : 1;
4033 unsigned CREN : 1;
4034 unsigned SREN : 1;
4035 unsigned RX9 : 1;
4036 unsigned SPEN : 1;
4039 struct
4041 unsigned RX9D1 : 1;
4042 unsigned OERR1 : 1;
4043 unsigned FERR1 : 1;
4044 unsigned ADEN : 1;
4045 unsigned CREN1 : 1;
4046 unsigned SREN1 : 1;
4047 unsigned RX91 : 1;
4048 unsigned SPEN1 : 1;
4051 struct
4053 unsigned : 1;
4054 unsigned : 1;
4055 unsigned : 1;
4056 unsigned ADDEN1 : 1;
4057 unsigned : 1;
4058 unsigned : 1;
4059 unsigned : 1;
4060 unsigned : 1;
4062 } __RCSTAbits_t;
4064 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
4066 #define _RX9D 0x01
4067 #define _RX9D1 0x01
4068 #define _OERR 0x02
4069 #define _OERR1 0x02
4070 #define _FERR 0x04
4071 #define _FERR1 0x04
4072 #define _ADDEN 0x08
4073 #define _ADEN 0x08
4074 #define _ADDEN1 0x08
4075 #define _CREN 0x10
4076 #define _CREN1 0x10
4077 #define _SREN 0x20
4078 #define _SREN1 0x20
4079 #define _RX9 0x40
4080 #define _RX91 0x40
4081 #define _SPEN 0x80
4082 #define _SPEN1 0x80
4084 //==============================================================================
4087 //==============================================================================
4088 // RCSTA1 Bits
4090 extern __at(0x0FAB) __sfr RCSTA1;
4092 typedef union
4094 struct
4096 unsigned RX9D : 1;
4097 unsigned OERR : 1;
4098 unsigned FERR : 1;
4099 unsigned ADDEN : 1;
4100 unsigned CREN : 1;
4101 unsigned SREN : 1;
4102 unsigned RX9 : 1;
4103 unsigned SPEN : 1;
4106 struct
4108 unsigned RX9D1 : 1;
4109 unsigned OERR1 : 1;
4110 unsigned FERR1 : 1;
4111 unsigned ADEN : 1;
4112 unsigned CREN1 : 1;
4113 unsigned SREN1 : 1;
4114 unsigned RX91 : 1;
4115 unsigned SPEN1 : 1;
4118 struct
4120 unsigned : 1;
4121 unsigned : 1;
4122 unsigned : 1;
4123 unsigned ADDEN1 : 1;
4124 unsigned : 1;
4125 unsigned : 1;
4126 unsigned : 1;
4127 unsigned : 1;
4129 } __RCSTA1bits_t;
4131 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
4133 #define _RCSTA1_RX9D 0x01
4134 #define _RCSTA1_RX9D1 0x01
4135 #define _RCSTA1_OERR 0x02
4136 #define _RCSTA1_OERR1 0x02
4137 #define _RCSTA1_FERR 0x04
4138 #define _RCSTA1_FERR1 0x04
4139 #define _RCSTA1_ADDEN 0x08
4140 #define _RCSTA1_ADEN 0x08
4141 #define _RCSTA1_ADDEN1 0x08
4142 #define _RCSTA1_CREN 0x10
4143 #define _RCSTA1_CREN1 0x10
4144 #define _RCSTA1_SREN 0x20
4145 #define _RCSTA1_SREN1 0x20
4146 #define _RCSTA1_RX9 0x40
4147 #define _RCSTA1_RX91 0x40
4148 #define _RCSTA1_SPEN 0x80
4149 #define _RCSTA1_SPEN1 0x80
4151 //==============================================================================
4154 //==============================================================================
4155 // TXSTA Bits
4157 extern __at(0x0FAC) __sfr TXSTA;
4159 typedef union
4161 struct
4163 unsigned TX9D : 1;
4164 unsigned TRMT : 1;
4165 unsigned BRGH : 1;
4166 unsigned SENDB : 1;
4167 unsigned SYNC : 1;
4168 unsigned TXEN : 1;
4169 unsigned TX9 : 1;
4170 unsigned CSRC : 1;
4173 struct
4175 unsigned TX9D1 : 1;
4176 unsigned TRMT1 : 1;
4177 unsigned BRGH1 : 1;
4178 unsigned SENDB1 : 1;
4179 unsigned SYNC1 : 1;
4180 unsigned TXEN1 : 1;
4181 unsigned TX91 : 1;
4182 unsigned CSRC1 : 1;
4184 } __TXSTAbits_t;
4186 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
4188 #define _TX9D 0x01
4189 #define _TX9D1 0x01
4190 #define _TRMT 0x02
4191 #define _TRMT1 0x02
4192 #define _BRGH 0x04
4193 #define _BRGH1 0x04
4194 #define _SENDB 0x08
4195 #define _SENDB1 0x08
4196 #define _SYNC 0x10
4197 #define _SYNC1 0x10
4198 #define _TXEN 0x20
4199 #define _TXEN1 0x20
4200 #define _TX9 0x40
4201 #define _TX91 0x40
4202 #define _CSRC 0x80
4203 #define _CSRC1 0x80
4205 //==============================================================================
4208 //==============================================================================
4209 // TXSTA1 Bits
4211 extern __at(0x0FAC) __sfr TXSTA1;
4213 typedef union
4215 struct
4217 unsigned TX9D : 1;
4218 unsigned TRMT : 1;
4219 unsigned BRGH : 1;
4220 unsigned SENDB : 1;
4221 unsigned SYNC : 1;
4222 unsigned TXEN : 1;
4223 unsigned TX9 : 1;
4224 unsigned CSRC : 1;
4227 struct
4229 unsigned TX9D1 : 1;
4230 unsigned TRMT1 : 1;
4231 unsigned BRGH1 : 1;
4232 unsigned SENDB1 : 1;
4233 unsigned SYNC1 : 1;
4234 unsigned TXEN1 : 1;
4235 unsigned TX91 : 1;
4236 unsigned CSRC1 : 1;
4238 } __TXSTA1bits_t;
4240 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
4242 #define _TXSTA1_TX9D 0x01
4243 #define _TXSTA1_TX9D1 0x01
4244 #define _TXSTA1_TRMT 0x02
4245 #define _TXSTA1_TRMT1 0x02
4246 #define _TXSTA1_BRGH 0x04
4247 #define _TXSTA1_BRGH1 0x04
4248 #define _TXSTA1_SENDB 0x08
4249 #define _TXSTA1_SENDB1 0x08
4250 #define _TXSTA1_SYNC 0x10
4251 #define _TXSTA1_SYNC1 0x10
4252 #define _TXSTA1_TXEN 0x20
4253 #define _TXSTA1_TXEN1 0x20
4254 #define _TXSTA1_TX9 0x40
4255 #define _TXSTA1_TX91 0x40
4256 #define _TXSTA1_CSRC 0x80
4257 #define _TXSTA1_CSRC1 0x80
4259 //==============================================================================
4261 extern __at(0x0FAD) __sfr TXREG;
4262 extern __at(0x0FAD) __sfr TXREG1;
4263 extern __at(0x0FAE) __sfr RCREG;
4264 extern __at(0x0FAE) __sfr RCREG1;
4265 extern __at(0x0FAF) __sfr SPBRG;
4266 extern __at(0x0FAF) __sfr SPBRG1;
4268 //==============================================================================
4269 // T3CON Bits
4271 extern __at(0x0FB1) __sfr T3CON;
4273 typedef union
4275 struct
4277 unsigned TMR3ON : 1;
4278 unsigned TMR3CS : 1;
4279 unsigned NOT_T3SYNC : 1;
4280 unsigned T3CCP1 : 1;
4281 unsigned T3CKPS0 : 1;
4282 unsigned T3CKPS1 : 1;
4283 unsigned T3CCP2 : 1;
4284 unsigned RD16 : 1;
4287 struct
4289 unsigned : 1;
4290 unsigned : 1;
4291 unsigned T3SYNC : 1;
4292 unsigned : 1;
4293 unsigned : 1;
4294 unsigned : 1;
4295 unsigned : 1;
4296 unsigned : 1;
4299 struct
4301 unsigned : 1;
4302 unsigned : 1;
4303 unsigned T3INSYNC : 1;
4304 unsigned : 1;
4305 unsigned : 1;
4306 unsigned : 1;
4307 unsigned : 1;
4308 unsigned : 1;
4311 struct
4313 unsigned : 4;
4314 unsigned T3CKPS : 2;
4315 unsigned : 2;
4317 } __T3CONbits_t;
4319 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
4321 #define _T3CON_TMR3ON 0x01
4322 #define _T3CON_TMR3CS 0x02
4323 #define _T3CON_NOT_T3SYNC 0x04
4324 #define _T3CON_T3SYNC 0x04
4325 #define _T3CON_T3INSYNC 0x04
4326 #define _T3CON_T3CCP1 0x08
4327 #define _T3CON_T3CKPS0 0x10
4328 #define _T3CON_T3CKPS1 0x20
4329 #define _T3CON_T3CCP2 0x40
4330 #define _T3CON_RD16 0x80
4332 //==============================================================================
4334 extern __at(0x0FB2) __sfr TMR3;
4335 extern __at(0x0FB2) __sfr TMR3L;
4336 extern __at(0x0FB3) __sfr TMR3H;
4338 //==============================================================================
4339 // CMCON Bits
4341 extern __at(0x0FB4) __sfr CMCON;
4343 typedef union
4345 struct
4347 unsigned CM0 : 1;
4348 unsigned CM1 : 1;
4349 unsigned CM2 : 1;
4350 unsigned CIS : 1;
4351 unsigned C1INV : 1;
4352 unsigned C2INV : 1;
4353 unsigned C1OUT : 1;
4354 unsigned C2OUT : 1;
4357 struct
4359 unsigned CM : 3;
4360 unsigned : 5;
4362 } __CMCONbits_t;
4364 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
4366 #define _CM0 0x01
4367 #define _CM1 0x02
4368 #define _CM2 0x04
4369 #define _CIS 0x08
4370 #define _C1INV 0x10
4371 #define _C2INV 0x20
4372 #define _C1OUT 0x40
4373 #define _C2OUT 0x80
4375 //==============================================================================
4378 //==============================================================================
4379 // CVRCON Bits
4381 extern __at(0x0FB5) __sfr CVRCON;
4383 typedef union
4385 struct
4387 unsigned CVR0 : 1;
4388 unsigned CVR1 : 1;
4389 unsigned CVR2 : 1;
4390 unsigned CVR3 : 1;
4391 unsigned CVRSS : 1;
4392 unsigned CVRR : 1;
4393 unsigned CVROE : 1;
4394 unsigned CVREN : 1;
4397 struct
4399 unsigned : 1;
4400 unsigned : 1;
4401 unsigned : 1;
4402 unsigned : 1;
4403 unsigned CVREF : 1;
4404 unsigned : 1;
4405 unsigned : 1;
4406 unsigned : 1;
4409 struct
4411 unsigned CVR : 4;
4412 unsigned : 4;
4414 } __CVRCONbits_t;
4416 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
4418 #define _CVR0 0x01
4419 #define _CVR1 0x02
4420 #define _CVR2 0x04
4421 #define _CVR3 0x08
4422 #define _CVRSS 0x10
4423 #define _CVREF 0x10
4424 #define _CVRR 0x20
4425 #define _CVROE 0x40
4426 #define _CVREN 0x80
4428 //==============================================================================
4431 //==============================================================================
4432 // CCP2CON Bits
4434 extern __at(0x0FBA) __sfr CCP2CON;
4436 typedef union
4438 struct
4440 unsigned CCP2M0 : 1;
4441 unsigned CCP2M1 : 1;
4442 unsigned CCP2M2 : 1;
4443 unsigned CCP2M3 : 1;
4444 unsigned DCCP2Y : 1;
4445 unsigned DCCP2X : 1;
4446 unsigned : 1;
4447 unsigned : 1;
4450 struct
4452 unsigned : 1;
4453 unsigned : 1;
4454 unsigned : 1;
4455 unsigned : 1;
4456 unsigned CCP2Y : 1;
4457 unsigned CCP2X : 1;
4458 unsigned : 1;
4459 unsigned : 1;
4462 struct
4464 unsigned : 1;
4465 unsigned : 1;
4466 unsigned : 1;
4467 unsigned : 1;
4468 unsigned DC2B0 : 1;
4469 unsigned DC2B1 : 1;
4470 unsigned : 1;
4471 unsigned : 1;
4474 struct
4476 unsigned CCP2M : 4;
4477 unsigned : 4;
4480 struct
4482 unsigned : 4;
4483 unsigned DC2B : 2;
4484 unsigned : 2;
4486 } __CCP2CONbits_t;
4488 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
4490 #define _CCP2M0 0x01
4491 #define _CCP2M1 0x02
4492 #define _CCP2M2 0x04
4493 #define _CCP2M3 0x08
4494 #define _DCCP2Y 0x10
4495 #define _CCP2Y 0x10
4496 #define _DC2B0 0x10
4497 #define _DCCP2X 0x20
4498 #define _CCP2X 0x20
4499 #define _DC2B1 0x20
4501 //==============================================================================
4503 extern __at(0x0FBB) __sfr CCPR2;
4504 extern __at(0x0FBB) __sfr CCPR2L;
4505 extern __at(0x0FBC) __sfr CCPR2H;
4507 //==============================================================================
4508 // CCP1CON Bits
4510 extern __at(0x0FBD) __sfr CCP1CON;
4512 typedef union
4514 struct
4516 unsigned CCP1M0 : 1;
4517 unsigned CCP1M1 : 1;
4518 unsigned CCP1M2 : 1;
4519 unsigned CCP1M3 : 1;
4520 unsigned DCCP1Y : 1;
4521 unsigned DCCP1X : 1;
4522 unsigned : 1;
4523 unsigned : 1;
4526 struct
4528 unsigned : 1;
4529 unsigned : 1;
4530 unsigned : 1;
4531 unsigned : 1;
4532 unsigned CCP1Y : 1;
4533 unsigned CCP1X : 1;
4534 unsigned : 1;
4535 unsigned : 1;
4538 struct
4540 unsigned : 1;
4541 unsigned : 1;
4542 unsigned : 1;
4543 unsigned : 1;
4544 unsigned DC1B0 : 1;
4545 unsigned DC1B1 : 1;
4546 unsigned : 1;
4547 unsigned : 1;
4550 struct
4552 unsigned CCP1M : 4;
4553 unsigned : 4;
4556 struct
4558 unsigned : 4;
4559 unsigned DC1B : 2;
4560 unsigned : 2;
4562 } __CCP1CONbits_t;
4564 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
4566 #define _CCP1M0 0x01
4567 #define _CCP1M1 0x02
4568 #define _CCP1M2 0x04
4569 #define _CCP1M3 0x08
4570 #define _DCCP1Y 0x10
4571 #define _CCP1Y 0x10
4572 #define _DC1B0 0x10
4573 #define _DCCP1X 0x20
4574 #define _CCP1X 0x20
4575 #define _DC1B1 0x20
4577 //==============================================================================
4579 extern __at(0x0FBE) __sfr CCPR1;
4580 extern __at(0x0FBE) __sfr CCPR1L;
4581 extern __at(0x0FBF) __sfr CCPR1H;
4583 //==============================================================================
4584 // ADCON2 Bits
4586 extern __at(0x0FC0) __sfr ADCON2;
4588 typedef union
4590 struct
4592 unsigned ADCS0 : 1;
4593 unsigned ADCS1 : 1;
4594 unsigned ADCS2 : 1;
4595 unsigned ACQT0 : 1;
4596 unsigned ACQT1 : 1;
4597 unsigned ACQT2 : 1;
4598 unsigned : 1;
4599 unsigned ADFM : 1;
4602 struct
4604 unsigned ADCS : 3;
4605 unsigned : 5;
4608 struct
4610 unsigned : 3;
4611 unsigned ACQT : 3;
4612 unsigned : 2;
4614 } __ADCON2bits_t;
4616 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4618 #define _ADCS0 0x01
4619 #define _ADCS1 0x02
4620 #define _ADCS2 0x04
4621 #define _ACQT0 0x08
4622 #define _ACQT1 0x10
4623 #define _ACQT2 0x20
4624 #define _ADFM 0x80
4626 //==============================================================================
4629 //==============================================================================
4630 // ADCON1 Bits
4632 extern __at(0x0FC1) __sfr ADCON1;
4634 typedef union
4636 struct
4638 unsigned PCFG0 : 1;
4639 unsigned PCFG1 : 1;
4640 unsigned PCFG2 : 1;
4641 unsigned PCFG3 : 1;
4642 unsigned VCFG0 : 1;
4643 unsigned VCFG1 : 1;
4644 unsigned : 1;
4645 unsigned : 1;
4648 struct
4650 unsigned PCFG : 4;
4651 unsigned : 4;
4654 struct
4656 unsigned : 4;
4657 unsigned VCFG : 2;
4658 unsigned : 2;
4660 } __ADCON1bits_t;
4662 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4664 #define _PCFG0 0x01
4665 #define _PCFG1 0x02
4666 #define _PCFG2 0x04
4667 #define _PCFG3 0x08
4668 #define _VCFG0 0x10
4669 #define _VCFG1 0x20
4671 //==============================================================================
4674 //==============================================================================
4675 // ADCON0 Bits
4677 extern __at(0x0FC2) __sfr ADCON0;
4679 typedef union
4681 struct
4683 unsigned ADON : 1;
4684 unsigned GO_NOT_DONE : 1;
4685 unsigned CHS0 : 1;
4686 unsigned CHS1 : 1;
4687 unsigned CHS2 : 1;
4688 unsigned CHS3 : 1;
4689 unsigned : 1;
4690 unsigned : 1;
4693 struct
4695 unsigned : 1;
4696 unsigned GO_DONE : 1;
4697 unsigned : 1;
4698 unsigned : 1;
4699 unsigned : 1;
4700 unsigned : 1;
4701 unsigned : 1;
4702 unsigned : 1;
4705 struct
4707 unsigned : 1;
4708 unsigned DONE : 1;
4709 unsigned : 1;
4710 unsigned : 1;
4711 unsigned : 1;
4712 unsigned : 1;
4713 unsigned : 1;
4714 unsigned : 1;
4717 struct
4719 unsigned : 1;
4720 unsigned GO : 1;
4721 unsigned : 1;
4722 unsigned : 1;
4723 unsigned : 1;
4724 unsigned : 1;
4725 unsigned : 1;
4726 unsigned : 1;
4729 struct
4731 unsigned : 1;
4732 unsigned NOT_DONE : 1;
4733 unsigned : 1;
4734 unsigned : 1;
4735 unsigned : 1;
4736 unsigned : 1;
4737 unsigned : 1;
4738 unsigned : 1;
4741 struct
4743 unsigned : 2;
4744 unsigned CHS : 4;
4745 unsigned : 2;
4747 } __ADCON0bits_t;
4749 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4751 #define _ADON 0x01
4752 #define _GO_NOT_DONE 0x02
4753 #define _GO_DONE 0x02
4754 #define _DONE 0x02
4755 #define _GO 0x02
4756 #define _NOT_DONE 0x02
4757 #define _CHS0 0x04
4758 #define _CHS1 0x08
4759 #define _CHS2 0x10
4760 #define _CHS3 0x20
4762 //==============================================================================
4764 extern __at(0x0FC3) __sfr ADRES;
4765 extern __at(0x0FC3) __sfr ADRESL;
4766 extern __at(0x0FC4) __sfr ADRESH;
4768 //==============================================================================
4769 // SSPCON2 Bits
4771 extern __at(0x0FC5) __sfr SSPCON2;
4773 typedef struct
4775 unsigned SEN : 1;
4776 unsigned RSEN : 1;
4777 unsigned PEN : 1;
4778 unsigned RCEN : 1;
4779 unsigned ACKEN : 1;
4780 unsigned ACKDT : 1;
4781 unsigned ACKSTAT : 1;
4782 unsigned GCEN : 1;
4783 } __SSPCON2bits_t;
4785 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4787 #define _SEN 0x01
4788 #define _RSEN 0x02
4789 #define _PEN 0x04
4790 #define _RCEN 0x08
4791 #define _ACKEN 0x10
4792 #define _ACKDT 0x20
4793 #define _ACKSTAT 0x40
4794 #define _GCEN 0x80
4796 //==============================================================================
4799 //==============================================================================
4800 // SSPCON1 Bits
4802 extern __at(0x0FC6) __sfr SSPCON1;
4804 typedef union
4806 struct
4808 unsigned SSPM0 : 1;
4809 unsigned SSPM1 : 1;
4810 unsigned SSPM2 : 1;
4811 unsigned SSPM3 : 1;
4812 unsigned CKP : 1;
4813 unsigned SSPEN : 1;
4814 unsigned SSPOV : 1;
4815 unsigned WCOL : 1;
4818 struct
4820 unsigned SSPM : 4;
4821 unsigned : 4;
4823 } __SSPCON1bits_t;
4825 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4827 #define _SSPM0 0x01
4828 #define _SSPM1 0x02
4829 #define _SSPM2 0x04
4830 #define _SSPM3 0x08
4831 #define _CKP 0x10
4832 #define _SSPEN 0x20
4833 #define _SSPOV 0x40
4834 #define _WCOL 0x80
4836 //==============================================================================
4839 //==============================================================================
4840 // SSPSTAT Bits
4842 extern __at(0x0FC7) __sfr SSPSTAT;
4844 typedef union
4846 struct
4848 unsigned BF : 1;
4849 unsigned UA : 1;
4850 unsigned R_NOT_W : 1;
4851 unsigned S : 1;
4852 unsigned P : 1;
4853 unsigned D_NOT_A : 1;
4854 unsigned CKE : 1;
4855 unsigned SMP : 1;
4858 struct
4860 unsigned : 1;
4861 unsigned : 1;
4862 unsigned R_W : 1;
4863 unsigned I2C_START : 1;
4864 unsigned I2C_STOP : 1;
4865 unsigned D_A : 1;
4866 unsigned : 1;
4867 unsigned : 1;
4870 struct
4872 unsigned : 1;
4873 unsigned : 1;
4874 unsigned I2C_READ : 1;
4875 unsigned : 1;
4876 unsigned : 1;
4877 unsigned I2C_DAT : 1;
4878 unsigned : 1;
4879 unsigned : 1;
4882 struct
4884 unsigned : 1;
4885 unsigned : 1;
4886 unsigned NOT_W : 1;
4887 unsigned : 1;
4888 unsigned : 1;
4889 unsigned NOT_A : 1;
4890 unsigned : 1;
4891 unsigned : 1;
4894 struct
4896 unsigned : 1;
4897 unsigned : 1;
4898 unsigned NOT_WRITE : 1;
4899 unsigned : 1;
4900 unsigned : 1;
4901 unsigned NOT_ADDRESS : 1;
4902 unsigned : 1;
4903 unsigned : 1;
4906 struct
4908 unsigned : 1;
4909 unsigned : 1;
4910 unsigned READ_WRITE : 1;
4911 unsigned : 1;
4912 unsigned : 1;
4913 unsigned DATA_ADDRESS : 1;
4914 unsigned : 1;
4915 unsigned : 1;
4918 struct
4920 unsigned : 1;
4921 unsigned : 1;
4922 unsigned R : 1;
4923 unsigned : 1;
4924 unsigned : 1;
4925 unsigned D : 1;
4926 unsigned : 1;
4927 unsigned : 1;
4929 } __SSPSTATbits_t;
4931 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
4933 #define _BF 0x01
4934 #define _UA 0x02
4935 #define _R_NOT_W 0x04
4936 #define _R_W 0x04
4937 #define _I2C_READ 0x04
4938 #define _NOT_W 0x04
4939 #define _NOT_WRITE 0x04
4940 #define _READ_WRITE 0x04
4941 #define _R 0x04
4942 #define _S 0x08
4943 #define _I2C_START 0x08
4944 #define _P 0x10
4945 #define _I2C_STOP 0x10
4946 #define _D_NOT_A 0x20
4947 #define _D_A 0x20
4948 #define _I2C_DAT 0x20
4949 #define _NOT_A 0x20
4950 #define _NOT_ADDRESS 0x20
4951 #define _DATA_ADDRESS 0x20
4952 #define _D 0x20
4953 #define _CKE 0x40
4954 #define _SMP 0x80
4956 //==============================================================================
4958 extern __at(0x0FC8) __sfr SSPADD;
4959 extern __at(0x0FC9) __sfr SSPBUF;
4961 //==============================================================================
4962 // T2CON Bits
4964 extern __at(0x0FCA) __sfr T2CON;
4966 typedef union
4968 struct
4970 unsigned T2CKPS0 : 1;
4971 unsigned T2CKPS1 : 1;
4972 unsigned TMR2ON : 1;
4973 unsigned T2OUTPS0 : 1;
4974 unsigned T2OUTPS1 : 1;
4975 unsigned T2OUTPS2 : 1;
4976 unsigned T2OUTPS3 : 1;
4977 unsigned : 1;
4980 struct
4982 unsigned T2CKPS : 2;
4983 unsigned : 6;
4986 struct
4988 unsigned : 3;
4989 unsigned T2OUTPS : 4;
4990 unsigned : 1;
4992 } __T2CONbits_t;
4994 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
4996 #define _T2CKPS0 0x01
4997 #define _T2CKPS1 0x02
4998 #define _TMR2ON 0x04
4999 #define _T2OUTPS0 0x08
5000 #define _T2OUTPS1 0x10
5001 #define _T2OUTPS2 0x20
5002 #define _T2OUTPS3 0x40
5004 //==============================================================================
5006 extern __at(0x0FCB) __sfr PR2;
5007 extern __at(0x0FCC) __sfr TMR2;
5009 //==============================================================================
5010 // T1CON Bits
5012 extern __at(0x0FCD) __sfr T1CON;
5014 typedef union
5016 struct
5018 unsigned TMR1ON : 1;
5019 unsigned TMR1CS : 1;
5020 unsigned NOT_T1SYNC : 1;
5021 unsigned T1OSCEN : 1;
5022 unsigned T1CKPS0 : 1;
5023 unsigned T1CKPS1 : 1;
5024 unsigned T1RUN : 1;
5025 unsigned RD16 : 1;
5028 struct
5030 unsigned : 1;
5031 unsigned : 1;
5032 unsigned T1INSYNC : 1;
5033 unsigned : 1;
5034 unsigned : 1;
5035 unsigned : 1;
5036 unsigned : 1;
5037 unsigned : 1;
5040 struct
5042 unsigned : 1;
5043 unsigned : 1;
5044 unsigned T1SYNC : 1;
5045 unsigned : 1;
5046 unsigned : 1;
5047 unsigned : 1;
5048 unsigned : 1;
5049 unsigned : 1;
5052 struct
5054 unsigned : 4;
5055 unsigned T1CKPS : 2;
5056 unsigned : 2;
5058 } __T1CONbits_t;
5060 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5062 #define _TMR1ON 0x01
5063 #define _TMR1CS 0x02
5064 #define _NOT_T1SYNC 0x04
5065 #define _T1INSYNC 0x04
5066 #define _T1SYNC 0x04
5067 #define _T1OSCEN 0x08
5068 #define _T1CKPS0 0x10
5069 #define _T1CKPS1 0x20
5070 #define _T1RUN 0x40
5071 #define _RD16 0x80
5073 //==============================================================================
5075 extern __at(0x0FCE) __sfr TMR1;
5076 extern __at(0x0FCE) __sfr TMR1L;
5077 extern __at(0x0FCF) __sfr TMR1H;
5079 //==============================================================================
5080 // RCON Bits
5082 extern __at(0x0FD0) __sfr RCON;
5084 typedef union
5086 struct
5088 unsigned NOT_BOR : 1;
5089 unsigned NOT_POR : 1;
5090 unsigned NOT_PD : 1;
5091 unsigned NOT_TO : 1;
5092 unsigned NOT_RI : 1;
5093 unsigned : 1;
5094 unsigned SBOREN : 1;
5095 unsigned IPEN : 1;
5098 struct
5100 unsigned BOR : 1;
5101 unsigned POR : 1;
5102 unsigned PD : 1;
5103 unsigned TO : 1;
5104 unsigned RI : 1;
5105 unsigned : 1;
5106 unsigned : 1;
5107 unsigned : 1;
5109 } __RCONbits_t;
5111 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5113 #define _NOT_BOR 0x01
5114 #define _BOR 0x01
5115 #define _NOT_POR 0x02
5116 #define _POR 0x02
5117 #define _NOT_PD 0x04
5118 #define _PD 0x04
5119 #define _NOT_TO 0x08
5120 #define _TO 0x08
5121 #define _NOT_RI 0x10
5122 #define _RI 0x10
5123 #define _SBOREN 0x40
5124 #define _IPEN 0x80
5126 //==============================================================================
5129 //==============================================================================
5130 // WDTCON Bits
5132 extern __at(0x0FD1) __sfr WDTCON;
5134 typedef union
5136 struct
5138 unsigned SWDTEN : 1;
5139 unsigned : 1;
5140 unsigned : 1;
5141 unsigned : 1;
5142 unsigned : 1;
5143 unsigned : 1;
5144 unsigned : 1;
5145 unsigned : 1;
5148 struct
5150 unsigned SWDTE : 1;
5151 unsigned : 1;
5152 unsigned : 1;
5153 unsigned : 1;
5154 unsigned : 1;
5155 unsigned : 1;
5156 unsigned : 1;
5157 unsigned : 1;
5159 } __WDTCONbits_t;
5161 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5163 #define _SWDTEN 0x01
5164 #define _SWDTE 0x01
5166 //==============================================================================
5169 //==============================================================================
5170 // HLVDCON Bits
5172 extern __at(0x0FD2) __sfr HLVDCON;
5174 typedef union
5176 struct
5178 unsigned HLVDL0 : 1;
5179 unsigned HLVDL1 : 1;
5180 unsigned HLVDL2 : 1;
5181 unsigned HLVDL3 : 1;
5182 unsigned HLVDEN : 1;
5183 unsigned IRVST : 1;
5184 unsigned : 1;
5185 unsigned VDIRMAG : 1;
5188 struct
5190 unsigned LVDL0 : 1;
5191 unsigned LVDL1 : 1;
5192 unsigned LVDL2 : 1;
5193 unsigned LVDL3 : 1;
5194 unsigned LVDEN : 1;
5195 unsigned BGST : 1;
5196 unsigned : 1;
5197 unsigned : 1;
5200 struct
5202 unsigned LVV0 : 1;
5203 unsigned LVV1 : 1;
5204 unsigned LVV2 : 1;
5205 unsigned LVV3 : 1;
5206 unsigned : 1;
5207 unsigned : 1;
5208 unsigned : 1;
5209 unsigned : 1;
5212 struct
5214 unsigned HLVDL : 4;
5215 unsigned : 4;
5218 struct
5220 unsigned LVV : 4;
5221 unsigned : 4;
5224 struct
5226 unsigned LVDL : 4;
5227 unsigned : 4;
5229 } __HLVDCONbits_t;
5231 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
5233 #define _HLVDL0 0x01
5234 #define _LVDL0 0x01
5235 #define _LVV0 0x01
5236 #define _HLVDL1 0x02
5237 #define _LVDL1 0x02
5238 #define _LVV1 0x02
5239 #define _HLVDL2 0x04
5240 #define _LVDL2 0x04
5241 #define _LVV2 0x04
5242 #define _HLVDL3 0x08
5243 #define _LVDL3 0x08
5244 #define _LVV3 0x08
5245 #define _HLVDEN 0x10
5246 #define _LVDEN 0x10
5247 #define _IRVST 0x20
5248 #define _BGST 0x20
5249 #define _VDIRMAG 0x80
5251 //==============================================================================
5254 //==============================================================================
5255 // OSCCON Bits
5257 extern __at(0x0FD3) __sfr OSCCON;
5259 typedef union
5261 struct
5263 unsigned SCS0 : 1;
5264 unsigned SCS1 : 1;
5265 unsigned IOFS : 1;
5266 unsigned OSTS : 1;
5267 unsigned IRCF0 : 1;
5268 unsigned IRCF1 : 1;
5269 unsigned IRCF2 : 1;
5270 unsigned IDLEN : 1;
5273 struct
5275 unsigned : 1;
5276 unsigned : 1;
5277 unsigned FLTS : 1;
5278 unsigned : 1;
5279 unsigned : 1;
5280 unsigned : 1;
5281 unsigned : 1;
5282 unsigned : 1;
5285 struct
5287 unsigned SCS : 2;
5288 unsigned : 6;
5291 struct
5293 unsigned : 4;
5294 unsigned IRCF : 3;
5295 unsigned : 1;
5297 } __OSCCONbits_t;
5299 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5301 #define _SCS0 0x01
5302 #define _SCS1 0x02
5303 #define _IOFS 0x04
5304 #define _FLTS 0x04
5305 #define _OSTS 0x08
5306 #define _IRCF0 0x10
5307 #define _IRCF1 0x20
5308 #define _IRCF2 0x40
5309 #define _IDLEN 0x80
5311 //==============================================================================
5314 //==============================================================================
5315 // T0CON Bits
5317 extern __at(0x0FD5) __sfr T0CON;
5319 typedef union
5321 struct
5323 unsigned T0PS0 : 1;
5324 unsigned T0PS1 : 1;
5325 unsigned T0PS2 : 1;
5326 unsigned PSA : 1;
5327 unsigned T0SE : 1;
5328 unsigned T0CS : 1;
5329 unsigned T08BIT : 1;
5330 unsigned TMR0ON : 1;
5333 struct
5335 unsigned T0PS : 3;
5336 unsigned : 5;
5338 } __T0CONbits_t;
5340 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5342 #define _T0PS0 0x01
5343 #define _T0PS1 0x02
5344 #define _T0PS2 0x04
5345 #define _PSA 0x08
5346 #define _T0SE 0x10
5347 #define _T0CS 0x20
5348 #define _T08BIT 0x40
5349 #define _TMR0ON 0x80
5351 //==============================================================================
5353 extern __at(0x0FD6) __sfr TMR0;
5354 extern __at(0x0FD6) __sfr TMR0L;
5355 extern __at(0x0FD7) __sfr TMR0H;
5357 //==============================================================================
5358 // STATUS Bits
5360 extern __at(0x0FD8) __sfr STATUS;
5362 typedef struct
5364 unsigned C : 1;
5365 unsigned DC : 1;
5366 unsigned Z : 1;
5367 unsigned OV : 1;
5368 unsigned N : 1;
5369 unsigned : 1;
5370 unsigned : 1;
5371 unsigned : 1;
5372 } __STATUSbits_t;
5374 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5376 #define _C 0x01
5377 #define _DC 0x02
5378 #define _Z 0x04
5379 #define _OV 0x08
5380 #define _N 0x10
5382 //==============================================================================
5384 extern __at(0x0FD9) __sfr FSR2L;
5385 extern __at(0x0FDA) __sfr FSR2H;
5386 extern __at(0x0FDB) __sfr PLUSW2;
5387 extern __at(0x0FDC) __sfr PREINC2;
5388 extern __at(0x0FDD) __sfr POSTDEC2;
5389 extern __at(0x0FDE) __sfr POSTINC2;
5390 extern __at(0x0FDF) __sfr INDF2;
5391 extern __at(0x0FE0) __sfr BSR;
5392 extern __at(0x0FE1) __sfr FSR1L;
5393 extern __at(0x0FE2) __sfr FSR1H;
5394 extern __at(0x0FE3) __sfr PLUSW1;
5395 extern __at(0x0FE4) __sfr PREINC1;
5396 extern __at(0x0FE5) __sfr POSTDEC1;
5397 extern __at(0x0FE6) __sfr POSTINC1;
5398 extern __at(0x0FE7) __sfr INDF1;
5399 extern __at(0x0FE8) __sfr WREG;
5400 extern __at(0x0FE9) __sfr FSR0L;
5401 extern __at(0x0FEA) __sfr FSR0H;
5402 extern __at(0x0FEB) __sfr PLUSW0;
5403 extern __at(0x0FEC) __sfr PREINC0;
5404 extern __at(0x0FED) __sfr POSTDEC0;
5405 extern __at(0x0FEE) __sfr POSTINC0;
5406 extern __at(0x0FEF) __sfr INDF0;
5408 //==============================================================================
5409 // INTCON3 Bits
5411 extern __at(0x0FF0) __sfr INTCON3;
5413 typedef union
5415 struct
5417 unsigned INT1IF : 1;
5418 unsigned INT2IF : 1;
5419 unsigned INT3IF : 1;
5420 unsigned INT1IE : 1;
5421 unsigned INT2IE : 1;
5422 unsigned INT3IE : 1;
5423 unsigned INT1IP : 1;
5424 unsigned INT2IP : 1;
5427 struct
5429 unsigned INT1F : 1;
5430 unsigned INT2F : 1;
5431 unsigned INT3F : 1;
5432 unsigned INT1E : 1;
5433 unsigned INT2E : 1;
5434 unsigned INT3E : 1;
5435 unsigned INT1P : 1;
5436 unsigned INT2P : 1;
5438 } __INTCON3bits_t;
5440 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5442 #define _INT1IF 0x01
5443 #define _INT1F 0x01
5444 #define _INT2IF 0x02
5445 #define _INT2F 0x02
5446 #define _INT3IF 0x04
5447 #define _INT3F 0x04
5448 #define _INT1IE 0x08
5449 #define _INT1E 0x08
5450 #define _INT2IE 0x10
5451 #define _INT2E 0x10
5452 #define _INT3IE 0x20
5453 #define _INT3E 0x20
5454 #define _INT1IP 0x40
5455 #define _INT1P 0x40
5456 #define _INT2IP 0x80
5457 #define _INT2P 0x80
5459 //==============================================================================
5462 //==============================================================================
5463 // INTCON2 Bits
5465 extern __at(0x0FF1) __sfr INTCON2;
5467 typedef union
5469 struct
5471 unsigned RBIP : 1;
5472 unsigned INT3IP : 1;
5473 unsigned TMR0IP : 1;
5474 unsigned INTEDG3 : 1;
5475 unsigned INTEDG2 : 1;
5476 unsigned INTEDG1 : 1;
5477 unsigned INTEDG0 : 1;
5478 unsigned NOT_RBPU : 1;
5481 struct
5483 unsigned : 1;
5484 unsigned INT3P : 1;
5485 unsigned T0IP : 1;
5486 unsigned : 1;
5487 unsigned : 1;
5488 unsigned : 1;
5489 unsigned : 1;
5490 unsigned RBPU : 1;
5492 } __INTCON2bits_t;
5494 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5496 #define _RBIP 0x01
5497 #define _INT3IP 0x02
5498 #define _INT3P 0x02
5499 #define _TMR0IP 0x04
5500 #define _T0IP 0x04
5501 #define _INTEDG3 0x08
5502 #define _INTEDG2 0x10
5503 #define _INTEDG1 0x20
5504 #define _INTEDG0 0x40
5505 #define _NOT_RBPU 0x80
5506 #define _RBPU 0x80
5508 //==============================================================================
5511 //==============================================================================
5512 // INTCON Bits
5514 extern __at(0x0FF2) __sfr INTCON;
5516 typedef union
5518 struct
5520 unsigned RBIF : 1;
5521 unsigned INT0IF : 1;
5522 unsigned TMR0IF : 1;
5523 unsigned RBIE : 1;
5524 unsigned INT0IE : 1;
5525 unsigned TMR0IE : 1;
5526 unsigned PEIE_GIEL : 1;
5527 unsigned GIE_GIEH : 1;
5530 struct
5532 unsigned : 1;
5533 unsigned INT0F : 1;
5534 unsigned T0IF : 1;
5535 unsigned : 1;
5536 unsigned INT0E : 1;
5537 unsigned T0IE : 1;
5538 unsigned PEIE : 1;
5539 unsigned GIE : 1;
5542 struct
5544 unsigned : 1;
5545 unsigned : 1;
5546 unsigned : 1;
5547 unsigned : 1;
5548 unsigned : 1;
5549 unsigned : 1;
5550 unsigned GIEL : 1;
5551 unsigned GIEH : 1;
5553 } __INTCONbits_t;
5555 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5557 #define _RBIF 0x01
5558 #define _INT0IF 0x02
5559 #define _INT0F 0x02
5560 #define _TMR0IF 0x04
5561 #define _T0IF 0x04
5562 #define _RBIE 0x08
5563 #define _INT0IE 0x10
5564 #define _INT0E 0x10
5565 #define _TMR0IE 0x20
5566 #define _T0IE 0x20
5567 #define _PEIE_GIEL 0x40
5568 #define _PEIE 0x40
5569 #define _GIEL 0x40
5570 #define _GIE_GIEH 0x80
5571 #define _GIE 0x80
5572 #define _GIEH 0x80
5574 //==============================================================================
5576 extern __at(0x0FF3) __sfr PROD;
5577 extern __at(0x0FF3) __sfr PRODL;
5578 extern __at(0x0FF4) __sfr PRODH;
5579 extern __at(0x0FF5) __sfr TABLAT;
5580 extern __at(0x0FF6) __sfr TBLPTR;
5581 extern __at(0x0FF6) __sfr TBLPTRL;
5582 extern __at(0x0FF7) __sfr TBLPTRH;
5583 extern __at(0x0FF8) __sfr TBLPTRU;
5584 extern __at(0x0FF9) __sfr PC;
5585 extern __at(0x0FF9) __sfr PCL;
5586 extern __at(0x0FFA) __sfr PCLATH;
5587 extern __at(0x0FFB) __sfr PCLATU;
5589 //==============================================================================
5590 // STKPTR Bits
5592 extern __at(0x0FFC) __sfr STKPTR;
5594 typedef union
5596 struct
5598 unsigned STKPTR0 : 1;
5599 unsigned STKPTR1 : 1;
5600 unsigned STKPTR2 : 1;
5601 unsigned STKPTR3 : 1;
5602 unsigned STKPTR4 : 1;
5603 unsigned : 1;
5604 unsigned STKUNF : 1;
5605 unsigned STKFUL : 1;
5608 struct
5610 unsigned : 1;
5611 unsigned : 1;
5612 unsigned : 1;
5613 unsigned : 1;
5614 unsigned : 1;
5615 unsigned : 1;
5616 unsigned : 1;
5617 unsigned STKOVF : 1;
5620 struct
5622 unsigned STKPTR : 5;
5623 unsigned : 3;
5625 } __STKPTRbits_t;
5627 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5629 #define _STKPTR0 0x01
5630 #define _STKPTR1 0x02
5631 #define _STKPTR2 0x04
5632 #define _STKPTR3 0x08
5633 #define _STKPTR4 0x10
5634 #define _STKUNF 0x40
5635 #define _STKFUL 0x80
5636 #define _STKOVF 0x80
5638 //==============================================================================
5640 extern __at(0x0FFD) __sfr TOS;
5641 extern __at(0x0FFD) __sfr TOSL;
5642 extern __at(0x0FFE) __sfr TOSH;
5643 extern __at(0x0FFF) __sfr TOSU;
5645 //==============================================================================
5647 // Configuration Bits
5649 //==============================================================================
5651 #define __CONFIG1H 0x300001
5652 #define __CONFIG2L 0x300002
5653 #define __CONFIG2H 0x300003
5654 #define __CONFIG3H 0x300005
5655 #define __CONFIG4L 0x300006
5656 #define __CONFIG5L 0x300008
5658 //----------------------------- CONFIG1H Options -------------------------------
5660 #define _OSC_LP_1H 0xF0 // LP oscillator.
5661 #define _OSC_XT_1H 0xF1 // XT oscillator.
5662 #define _OSC_HS_1H 0xF2 // HS oscillator.
5663 #define _OSC_RC_1H 0xF3 // External RC oscillator, CLKO function on RA6.
5664 #define _OSC_EC_1H 0xF4 // EC oscillator, CLKO function on RA6.
5665 #define _OSC_ECIO_1H 0xF5 // EC oscillator, port function on RA6.
5666 #define _OSC_HSPLL_1H 0xF6 // HS oscillator, PLL enabled (clock frequency = 4 x FOSC1).
5667 #define _OSC_RCIO_1H 0xF7 // External RC oscillator, port function on RA6.
5668 #define _OSC_INTIO67_1H 0xF8 // Internal oscillator block, port function on RA6 and RA7.
5669 #define _OSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKO function on RA6, port function on RA7.
5670 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
5671 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
5672 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
5673 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
5675 //----------------------------- CONFIG2L Options -------------------------------
5677 #define _PWRT_ON_2L 0xFE // PWRT enabled.
5678 #define _PWRT_OFF_2L 0xFF // PWRT disabled.
5679 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
5680 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
5681 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
5682 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
5683 #define _BORV_0_2L 0xE7 // VBOR set to 4.6V.
5684 #define _BORV_1_2L 0xEF // VBOR set to 4.3V.
5685 #define _BORV_2_2L 0xF7 // VBOR set to 2.8V.
5686 #define _BORV_3_2L 0xFF // VBOR set to 2.1V.
5688 //----------------------------- CONFIG2H Options -------------------------------
5690 #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
5691 #define _WDT_ON_2H 0xFF // WDT enabled.
5692 #define _WDTPS_1_2H 0xE1 // 1:1.
5693 #define _WDTPS_2_2H 0xE3 // 1:2.
5694 #define _WDTPS_4_2H 0xE5 // 1:4.
5695 #define _WDTPS_8_2H 0xE7 // 1:8.
5696 #define _WDTPS_16_2H 0xE9 // 1:16.
5697 #define _WDTPS_32_2H 0xEB // 1:32.
5698 #define _WDTPS_64_2H 0xED // 1:64.
5699 #define _WDTPS_128_2H 0xEF // 1:128.
5700 #define _WDTPS_256_2H 0xF1 // 1:256.
5701 #define _WDTPS_512_2H 0xF3 // 1:512.
5702 #define _WDTPS_1024_2H 0xF5 // 1:1024.
5703 #define _WDTPS_2048_2H 0xF7 // 1:2048.
5704 #define _WDTPS_4096_2H 0xF9 // 1:4096.
5705 #define _WDTPS_8192_2H 0xFB // 1:8192.
5706 #define _WDTPS_16384_2H 0xFD // 1:16384.
5707 #define _WDTPS_32768_2H 0xFF // 1:32768.
5709 //----------------------------- CONFIG3H Options -------------------------------
5711 #define _CCP2MX_PORTBE_3H 0xFE // CCP2 input/output is multiplexed with RE7.
5712 #define _CCP2MX_PORTC_3H 0xFF // CCP2 input/output is multiplexed with RC1.
5713 #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
5714 #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
5715 #define _MCLRE_OFF_3H 0x7F // RG5 input pin enabled; MCLR disabled.
5716 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RG5 input pin disabled.
5718 //----------------------------- CONFIG4L Options -------------------------------
5720 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
5721 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
5722 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
5723 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
5724 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
5725 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
5727 //----------------------------- CONFIG5L Options -------------------------------
5729 #define _CP_ON_5L 0xFE // Program memory block (000000-003FFFh) code-protected.
5730 #define _CP_OFF_5L 0xFF // Program memory block (000000-003FFFh) not code-protected.
5732 //==============================================================================
5734 #define __DEVID1 0x3FFFFE
5735 #define __DEVID2 0x3FFFFF
5737 #define __IDLOC0 0x200000
5738 #define __IDLOC1 0x200001
5739 #define __IDLOC2 0x200002
5740 #define __IDLOC3 0x200003
5741 #define __IDLOC4 0x200004
5742 #define __IDLOC5 0x200005
5743 #define __IDLOC6 0x200006
5744 #define __IDLOC7 0x200007
5746 #endif // #ifndef __PIC18F6393_H__