Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f8493.h
blob9447042797565439bcd90700d97a0ec3a0c19e3e
1 /*
2 * This declarations of the PIC18F8493 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:51 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 __PIC18F8493_H__
26 #define __PIC18F8493_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 LP : 4;
71 unsigned : 4;
74 struct
76 unsigned LCDPS : 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 LCDCS : 2;
140 unsigned : 4;
143 struct
145 unsigned : 2;
146 unsigned CS : 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 // LCDSE4 Bits
387 extern __at(0x0F5E) __sfr LCDSE4;
389 typedef union
391 struct
393 unsigned SE32 : 1;
394 unsigned SE33 : 1;
395 unsigned SE34 : 1;
396 unsigned SE35 : 1;
397 unsigned SE36 : 1;
398 unsigned SE37 : 1;
399 unsigned SE38 : 1;
400 unsigned SE39 : 1;
403 struct
405 unsigned SEGEN32 : 1;
406 unsigned SEGEN33 : 1;
407 unsigned SEGEN34 : 1;
408 unsigned SEGEN35 : 1;
409 unsigned SEGEN36 : 1;
410 unsigned SEGEN37 : 1;
411 unsigned SEGEN38 : 1;
412 unsigned SEGEN39 : 1;
414 } __LCDSE4bits_t;
416 extern __at(0x0F5E) volatile __LCDSE4bits_t LCDSE4bits;
418 #define _SE32 0x01
419 #define _SEGEN32 0x01
420 #define _SE33 0x02
421 #define _SEGEN33 0x02
422 #define _SE34 0x04
423 #define _SEGEN34 0x04
424 #define _SE35 0x08
425 #define _SEGEN35 0x08
426 #define _SE36 0x10
427 #define _SEGEN36 0x10
428 #define _SE37 0x20
429 #define _SEGEN37 0x20
430 #define _SE38 0x40
431 #define _SEGEN38 0x40
432 #define _SE39 0x80
433 #define _SEGEN39 0x80
435 //==============================================================================
438 //==============================================================================
439 // LCDSE5 Bits
441 extern __at(0x0F5F) __sfr LCDSE5;
443 typedef union
445 struct
447 unsigned SE40 : 1;
448 unsigned SE41 : 1;
449 unsigned SE42 : 1;
450 unsigned SE43 : 1;
451 unsigned SE44 : 1;
452 unsigned SE45 : 1;
453 unsigned SE46 : 1;
454 unsigned SE47 : 1;
457 struct
459 unsigned SEGEN40 : 1;
460 unsigned SEGEN41 : 1;
461 unsigned SEGEN42 : 1;
462 unsigned SEGEN43 : 1;
463 unsigned SEGEN44 : 1;
464 unsigned SEGEN45 : 1;
465 unsigned SEGEN46 : 1;
466 unsigned SEGEN47 : 1;
468 } __LCDSE5bits_t;
470 extern __at(0x0F5F) volatile __LCDSE5bits_t LCDSE5bits;
472 #define _SE40 0x01
473 #define _SEGEN40 0x01
474 #define _SE41 0x02
475 #define _SEGEN41 0x02
476 #define _SE42 0x04
477 #define _SEGEN42 0x04
478 #define _SE43 0x08
479 #define _SEGEN43 0x08
480 #define _SE44 0x10
481 #define _SEGEN44 0x10
482 #define _SE45 0x20
483 #define _SEGEN45 0x20
484 #define _SE46 0x40
485 #define _SEGEN46 0x40
486 #define _SE47 0x80
487 #define _SEGEN47 0x80
489 //==============================================================================
492 //==============================================================================
493 // LCDDATA0 Bits
495 extern __at(0x0F60) __sfr LCDDATA0;
497 typedef union
499 struct
501 unsigned S0C0 : 1;
502 unsigned S1C0 : 1;
503 unsigned S2C0 : 1;
504 unsigned S3C0 : 1;
505 unsigned S4C0 : 1;
506 unsigned S5C0 : 1;
507 unsigned S6C0 : 1;
508 unsigned S7C0 : 1;
511 struct
513 unsigned SEG0COM0 : 1;
514 unsigned SEG1COM0 : 1;
515 unsigned SEG2COM0 : 1;
516 unsigned SEG3COM0 : 1;
517 unsigned SEG4COM0 : 1;
518 unsigned SEG5COM0 : 1;
519 unsigned SEG6COM0 : 1;
520 unsigned SEG7COM0 : 1;
523 struct
525 unsigned S00C0 : 1;
526 unsigned S01C0 : 1;
527 unsigned S02C0 : 1;
528 unsigned S03C0 : 1;
529 unsigned S04C0 : 1;
530 unsigned S05C0 : 1;
531 unsigned S06C0 : 1;
532 unsigned S07C0 : 1;
534 } __LCDDATA0bits_t;
536 extern __at(0x0F60) volatile __LCDDATA0bits_t LCDDATA0bits;
538 #define _S0C0 0x01
539 #define _SEG0COM0 0x01
540 #define _S00C0 0x01
541 #define _S1C0 0x02
542 #define _SEG1COM0 0x02
543 #define _S01C0 0x02
544 #define _S2C0 0x04
545 #define _SEG2COM0 0x04
546 #define _S02C0 0x04
547 #define _S3C0 0x08
548 #define _SEG3COM0 0x08
549 #define _S03C0 0x08
550 #define _S4C0 0x10
551 #define _SEG4COM0 0x10
552 #define _S04C0 0x10
553 #define _S5C0 0x20
554 #define _SEG5COM0 0x20
555 #define _S05C0 0x20
556 #define _S6C0 0x40
557 #define _SEG6COM0 0x40
558 #define _S06C0 0x40
559 #define _S7C0 0x80
560 #define _SEG7COM0 0x80
561 #define _S07C0 0x80
563 //==============================================================================
566 //==============================================================================
567 // LCDDATA1 Bits
569 extern __at(0x0F61) __sfr LCDDATA1;
571 typedef union
573 struct
575 unsigned S8C0 : 1;
576 unsigned S9C0 : 1;
577 unsigned S10C0 : 1;
578 unsigned S11C0 : 1;
579 unsigned S12C0 : 1;
580 unsigned S13C0 : 1;
581 unsigned S14C0 : 1;
582 unsigned S15C0 : 1;
585 struct
587 unsigned SEG8COM0 : 1;
588 unsigned SEG9COM0 : 1;
589 unsigned SEG10COM0 : 1;
590 unsigned SEG11COM0 : 1;
591 unsigned SEG12COM0 : 1;
592 unsigned SEG13COM0 : 1;
593 unsigned SEG14COM0 : 1;
594 unsigned SEG15COM0 : 1;
597 struct
599 unsigned S08C0 : 1;
600 unsigned S09C0 : 1;
601 unsigned : 1;
602 unsigned : 1;
603 unsigned : 1;
604 unsigned : 1;
605 unsigned : 1;
606 unsigned : 1;
608 } __LCDDATA1bits_t;
610 extern __at(0x0F61) volatile __LCDDATA1bits_t LCDDATA1bits;
612 #define _S8C0 0x01
613 #define _SEG8COM0 0x01
614 #define _S08C0 0x01
615 #define _S9C0 0x02
616 #define _SEG9COM0 0x02
617 #define _S09C0 0x02
618 #define _S10C0 0x04
619 #define _SEG10COM0 0x04
620 #define _S11C0 0x08
621 #define _SEG11COM0 0x08
622 #define _S12C0 0x10
623 #define _SEG12COM0 0x10
624 #define _S13C0 0x20
625 #define _SEG13COM0 0x20
626 #define _S14C0 0x40
627 #define _SEG14COM0 0x40
628 #define _S15C0 0x80
629 #define _SEG15COM0 0x80
631 //==============================================================================
634 //==============================================================================
635 // LCDDATA2 Bits
637 extern __at(0x0F62) __sfr LCDDATA2;
639 typedef union
641 struct
643 unsigned S16C0 : 1;
644 unsigned S17C0 : 1;
645 unsigned S18C0 : 1;
646 unsigned S19C0 : 1;
647 unsigned S20C0 : 1;
648 unsigned S21C0 : 1;
649 unsigned S22C0 : 1;
650 unsigned S23C0 : 1;
653 struct
655 unsigned SEG16COM0 : 1;
656 unsigned SEG17COM0 : 1;
657 unsigned SEG18COM0 : 1;
658 unsigned SEG19COM0 : 1;
659 unsigned SEG20COM0 : 1;
660 unsigned SEG21COM0 : 1;
661 unsigned SEG22COM0 : 1;
662 unsigned SEG23COM0 : 1;
664 } __LCDDATA2bits_t;
666 extern __at(0x0F62) volatile __LCDDATA2bits_t LCDDATA2bits;
668 #define _S16C0 0x01
669 #define _SEG16COM0 0x01
670 #define _S17C0 0x02
671 #define _SEG17COM0 0x02
672 #define _S18C0 0x04
673 #define _SEG18COM0 0x04
674 #define _S19C0 0x08
675 #define _SEG19COM0 0x08
676 #define _S20C0 0x10
677 #define _SEG20COM0 0x10
678 #define _S21C0 0x20
679 #define _SEG21COM0 0x20
680 #define _S22C0 0x40
681 #define _SEG22COM0 0x40
682 #define _S23C0 0x80
683 #define _SEG23COM0 0x80
685 //==============================================================================
688 //==============================================================================
689 // LCDDATA3 Bits
691 extern __at(0x0F63) __sfr LCDDATA3;
693 typedef union
695 struct
697 unsigned S24C0 : 1;
698 unsigned S25C0 : 1;
699 unsigned S26C0 : 1;
700 unsigned S27C0 : 1;
701 unsigned S28C0 : 1;
702 unsigned S29C0 : 1;
703 unsigned S30C0 : 1;
704 unsigned S31C0 : 1;
707 struct
709 unsigned SEG24COM0 : 1;
710 unsigned SEG25COM0 : 1;
711 unsigned SEG26COM0 : 1;
712 unsigned SEG27COM0 : 1;
713 unsigned SEG28COM0 : 1;
714 unsigned SEG29COM0 : 1;
715 unsigned SEG30COM0 : 1;
716 unsigned SEG31COM0 : 1;
718 } __LCDDATA3bits_t;
720 extern __at(0x0F63) volatile __LCDDATA3bits_t LCDDATA3bits;
722 #define _S24C0 0x01
723 #define _SEG24COM0 0x01
724 #define _S25C0 0x02
725 #define _SEG25COM0 0x02
726 #define _S26C0 0x04
727 #define _SEG26COM0 0x04
728 #define _S27C0 0x08
729 #define _SEG27COM0 0x08
730 #define _S28C0 0x10
731 #define _SEG28COM0 0x10
732 #define _S29C0 0x20
733 #define _SEG29COM0 0x20
734 #define _S30C0 0x40
735 #define _SEG30COM0 0x40
736 #define _S31C0 0x80
737 #define _SEG31COM0 0x80
739 //==============================================================================
742 //==============================================================================
743 // LCDDATA4 Bits
745 extern __at(0x0F64) __sfr LCDDATA4;
747 typedef union
749 struct
751 unsigned S32C0 : 1;
752 unsigned S33C0 : 1;
753 unsigned S34C0 : 1;
754 unsigned S35C0 : 1;
755 unsigned S36C0 : 1;
756 unsigned S37C0 : 1;
757 unsigned S38C0 : 1;
758 unsigned S39C0 : 1;
761 struct
763 unsigned SEG32COM0 : 1;
764 unsigned SEG33COM0 : 1;
765 unsigned SEG34COM0 : 1;
766 unsigned SEG35COM0 : 1;
767 unsigned SEG36COM0 : 1;
768 unsigned SEG37COM0 : 1;
769 unsigned SEG38COM0 : 1;
770 unsigned SEG39COM0 : 1;
772 } __LCDDATA4bits_t;
774 extern __at(0x0F64) volatile __LCDDATA4bits_t LCDDATA4bits;
776 #define _S32C0 0x01
777 #define _SEG32COM0 0x01
778 #define _S33C0 0x02
779 #define _SEG33COM0 0x02
780 #define _S34C0 0x04
781 #define _SEG34COM0 0x04
782 #define _S35C0 0x08
783 #define _SEG35COM0 0x08
784 #define _S36C0 0x10
785 #define _SEG36COM0 0x10
786 #define _S37C0 0x20
787 #define _SEG37COM0 0x20
788 #define _S38C0 0x40
789 #define _SEG38COM0 0x40
790 #define _S39C0 0x80
791 #define _SEG39COM0 0x80
793 //==============================================================================
796 //==============================================================================
797 // LCDDATA5 Bits
799 extern __at(0x0F65) __sfr LCDDATA5;
801 typedef union
803 struct
805 unsigned S40C0 : 1;
806 unsigned S41C0 : 1;
807 unsigned S42C0 : 1;
808 unsigned S43C0 : 1;
809 unsigned S44C0 : 1;
810 unsigned S45C0 : 1;
811 unsigned S46C0 : 1;
812 unsigned S47C0 : 1;
815 struct
817 unsigned SEG40COM0 : 1;
818 unsigned SEG41COM0 : 1;
819 unsigned SEG42COM0 : 1;
820 unsigned SEG43COM0 : 1;
821 unsigned SEG44COM0 : 1;
822 unsigned SEG45COM0 : 1;
823 unsigned SEG46COM0 : 1;
824 unsigned SEG47COM0 : 1;
826 } __LCDDATA5bits_t;
828 extern __at(0x0F65) volatile __LCDDATA5bits_t LCDDATA5bits;
830 #define _S40C0 0x01
831 #define _SEG40COM0 0x01
832 #define _S41C0 0x02
833 #define _SEG41COM0 0x02
834 #define _S42C0 0x04
835 #define _SEG42COM0 0x04
836 #define _S43C0 0x08
837 #define _SEG43COM0 0x08
838 #define _S44C0 0x10
839 #define _SEG44COM0 0x10
840 #define _S45C0 0x20
841 #define _SEG45COM0 0x20
842 #define _S46C0 0x40
843 #define _SEG46COM0 0x40
844 #define _S47C0 0x80
845 #define _SEG47COM0 0x80
847 //==============================================================================
850 //==============================================================================
851 // LCDDATA6 Bits
853 extern __at(0x0F66) __sfr LCDDATA6;
855 typedef union
857 struct
859 unsigned S0C1 : 1;
860 unsigned S1C1 : 1;
861 unsigned S2C1 : 1;
862 unsigned S3C1 : 1;
863 unsigned S4C1 : 1;
864 unsigned S5C1 : 1;
865 unsigned S6C1 : 1;
866 unsigned S7C1 : 1;
869 struct
871 unsigned SEG0COM1 : 1;
872 unsigned SEG1COM1 : 1;
873 unsigned SEG2COM1 : 1;
874 unsigned SEG3COM1 : 1;
875 unsigned SEG4COM1 : 1;
876 unsigned SEG5COM1 : 1;
877 unsigned SEG6COM1 : 1;
878 unsigned SEG7COM1 : 1;
881 struct
883 unsigned S00C1 : 1;
884 unsigned S01C1 : 1;
885 unsigned S02C1 : 1;
886 unsigned S03C1 : 1;
887 unsigned S04C1 : 1;
888 unsigned S05C1 : 1;
889 unsigned S06C1 : 1;
890 unsigned S07C1 : 1;
892 } __LCDDATA6bits_t;
894 extern __at(0x0F66) volatile __LCDDATA6bits_t LCDDATA6bits;
896 #define _S0C1 0x01
897 #define _SEG0COM1 0x01
898 #define _S00C1 0x01
899 #define _S1C1 0x02
900 #define _SEG1COM1 0x02
901 #define _S01C1 0x02
902 #define _S2C1 0x04
903 #define _SEG2COM1 0x04
904 #define _S02C1 0x04
905 #define _S3C1 0x08
906 #define _SEG3COM1 0x08
907 #define _S03C1 0x08
908 #define _S4C1 0x10
909 #define _SEG4COM1 0x10
910 #define _S04C1 0x10
911 #define _S5C1 0x20
912 #define _SEG5COM1 0x20
913 #define _S05C1 0x20
914 #define _S6C1 0x40
915 #define _SEG6COM1 0x40
916 #define _S06C1 0x40
917 #define _S7C1 0x80
918 #define _SEG7COM1 0x80
919 #define _S07C1 0x80
921 //==============================================================================
924 //==============================================================================
925 // LCDDATA7 Bits
927 extern __at(0x0F67) __sfr LCDDATA7;
929 typedef union
931 struct
933 unsigned S8C1 : 1;
934 unsigned S9C1 : 1;
935 unsigned S10C1 : 1;
936 unsigned S11C1 : 1;
937 unsigned S12C1 : 1;
938 unsigned S13C1 : 1;
939 unsigned S14C1 : 1;
940 unsigned S15C1 : 1;
943 struct
945 unsigned SEG8COM1 : 1;
946 unsigned SEG9COM1 : 1;
947 unsigned SEG10COM1 : 1;
948 unsigned SEG11COM1 : 1;
949 unsigned SEG12COM1 : 1;
950 unsigned SEG13COM1 : 1;
951 unsigned SEG14COM1 : 1;
952 unsigned SEG15COM1 : 1;
955 struct
957 unsigned S08C1 : 1;
958 unsigned S09C1 : 1;
959 unsigned : 1;
960 unsigned : 1;
961 unsigned : 1;
962 unsigned : 1;
963 unsigned : 1;
964 unsigned : 1;
966 } __LCDDATA7bits_t;
968 extern __at(0x0F67) volatile __LCDDATA7bits_t LCDDATA7bits;
970 #define _S8C1 0x01
971 #define _SEG8COM1 0x01
972 #define _S08C1 0x01
973 #define _S9C1 0x02
974 #define _SEG9COM1 0x02
975 #define _S09C1 0x02
976 #define _S10C1 0x04
977 #define _SEG10COM1 0x04
978 #define _S11C1 0x08
979 #define _SEG11COM1 0x08
980 #define _S12C1 0x10
981 #define _SEG12COM1 0x10
982 #define _S13C1 0x20
983 #define _SEG13COM1 0x20
984 #define _S14C1 0x40
985 #define _SEG14COM1 0x40
986 #define _S15C1 0x80
987 #define _SEG15COM1 0x80
989 //==============================================================================
992 //==============================================================================
993 // LCDDATA8 Bits
995 extern __at(0x0F68) __sfr LCDDATA8;
997 typedef union
999 struct
1001 unsigned S16C1 : 1;
1002 unsigned S17C1 : 1;
1003 unsigned S18C1 : 1;
1004 unsigned S19C1 : 1;
1005 unsigned S20C1 : 1;
1006 unsigned S21C1 : 1;
1007 unsigned S22C1 : 1;
1008 unsigned S23C1 : 1;
1011 struct
1013 unsigned SEG16COM1 : 1;
1014 unsigned SEG17COM1 : 1;
1015 unsigned SEG18COM1 : 1;
1016 unsigned SEG19COM1 : 1;
1017 unsigned SEG20COM1 : 1;
1018 unsigned SEG21COM1 : 1;
1019 unsigned SEG22COM1 : 1;
1020 unsigned SEG23COM1 : 1;
1022 } __LCDDATA8bits_t;
1024 extern __at(0x0F68) volatile __LCDDATA8bits_t LCDDATA8bits;
1026 #define _S16C1 0x01
1027 #define _SEG16COM1 0x01
1028 #define _S17C1 0x02
1029 #define _SEG17COM1 0x02
1030 #define _S18C1 0x04
1031 #define _SEG18COM1 0x04
1032 #define _S19C1 0x08
1033 #define _SEG19COM1 0x08
1034 #define _S20C1 0x10
1035 #define _SEG20COM1 0x10
1036 #define _S21C1 0x20
1037 #define _SEG21COM1 0x20
1038 #define _S22C1 0x40
1039 #define _SEG22COM1 0x40
1040 #define _S23C1 0x80
1041 #define _SEG23COM1 0x80
1043 //==============================================================================
1046 //==============================================================================
1047 // LCDDATA9 Bits
1049 extern __at(0x0F69) __sfr LCDDATA9;
1051 typedef union
1053 struct
1055 unsigned S24C1 : 1;
1056 unsigned S25C1 : 1;
1057 unsigned S26C1 : 1;
1058 unsigned S27C1 : 1;
1059 unsigned S28C1 : 1;
1060 unsigned S29C1 : 1;
1061 unsigned S30C1 : 1;
1062 unsigned S31C1 : 1;
1065 struct
1067 unsigned SEG24COM1 : 1;
1068 unsigned SEG25COM1 : 1;
1069 unsigned SEG26COM1 : 1;
1070 unsigned SEG27COM1 : 1;
1071 unsigned SEG28COM1 : 1;
1072 unsigned SEG29COM1 : 1;
1073 unsigned SEG30COM1 : 1;
1074 unsigned SEG31COM1 : 1;
1076 } __LCDDATA9bits_t;
1078 extern __at(0x0F69) volatile __LCDDATA9bits_t LCDDATA9bits;
1080 #define _S24C1 0x01
1081 #define _SEG24COM1 0x01
1082 #define _S25C1 0x02
1083 #define _SEG25COM1 0x02
1084 #define _S26C1 0x04
1085 #define _SEG26COM1 0x04
1086 #define _S27C1 0x08
1087 #define _SEG27COM1 0x08
1088 #define _S28C1 0x10
1089 #define _SEG28COM1 0x10
1090 #define _S29C1 0x20
1091 #define _SEG29COM1 0x20
1092 #define _S30C1 0x40
1093 #define _SEG30COM1 0x40
1094 #define _S31C1 0x80
1095 #define _SEG31COM1 0x80
1097 //==============================================================================
1100 //==============================================================================
1101 // LCDDATA10 Bits
1103 extern __at(0x0F6A) __sfr LCDDATA10;
1105 typedef union
1107 struct
1109 unsigned S32C1 : 1;
1110 unsigned S33C1 : 1;
1111 unsigned S34C1 : 1;
1112 unsigned S35C1 : 1;
1113 unsigned S36C1 : 1;
1114 unsigned S37C1 : 1;
1115 unsigned S38C1 : 1;
1116 unsigned S39C1 : 1;
1119 struct
1121 unsigned SEG32COM1 : 1;
1122 unsigned SEG33COM1 : 1;
1123 unsigned SEG34COM1 : 1;
1124 unsigned SEG35COM1 : 1;
1125 unsigned SEG36COM1 : 1;
1126 unsigned SEG37COM1 : 1;
1127 unsigned SEG38COM1 : 1;
1128 unsigned SEG39COM1 : 1;
1130 } __LCDDATA10bits_t;
1132 extern __at(0x0F6A) volatile __LCDDATA10bits_t LCDDATA10bits;
1134 #define _S32C1 0x01
1135 #define _SEG32COM1 0x01
1136 #define _S33C1 0x02
1137 #define _SEG33COM1 0x02
1138 #define _S34C1 0x04
1139 #define _SEG34COM1 0x04
1140 #define _S35C1 0x08
1141 #define _SEG35COM1 0x08
1142 #define _S36C1 0x10
1143 #define _SEG36COM1 0x10
1144 #define _S37C1 0x20
1145 #define _SEG37COM1 0x20
1146 #define _S38C1 0x40
1147 #define _SEG38COM1 0x40
1148 #define _S39C1 0x80
1149 #define _SEG39COM1 0x80
1151 //==============================================================================
1154 //==============================================================================
1155 // RCSTA2 Bits
1157 extern __at(0x0F6B) __sfr RCSTA2;
1159 typedef union
1161 struct
1163 unsigned RX9D : 1;
1164 unsigned OERR : 1;
1165 unsigned FERR : 1;
1166 unsigned ADDEN : 1;
1167 unsigned CREN : 1;
1168 unsigned SREN : 1;
1169 unsigned RX9 : 1;
1170 unsigned SPEN : 1;
1173 struct
1175 unsigned RCD8 : 1;
1176 unsigned OERR2 : 1;
1177 unsigned FERR2 : 1;
1178 unsigned ADEN : 1;
1179 unsigned CREN2 : 1;
1180 unsigned SREN2 : 1;
1181 unsigned RC9 : 1;
1182 unsigned SPEN2 : 1;
1185 struct
1187 unsigned RX9D2 : 1;
1188 unsigned : 1;
1189 unsigned : 1;
1190 unsigned ADDEN2 : 1;
1191 unsigned : 1;
1192 unsigned : 1;
1193 unsigned NOT_RC8 : 1;
1194 unsigned : 1;
1197 struct
1199 unsigned : 1;
1200 unsigned : 1;
1201 unsigned : 1;
1202 unsigned : 1;
1203 unsigned : 1;
1204 unsigned : 1;
1205 unsigned RC8_9 : 1;
1206 unsigned : 1;
1209 struct
1211 unsigned : 1;
1212 unsigned : 1;
1213 unsigned : 1;
1214 unsigned : 1;
1215 unsigned : 1;
1216 unsigned : 1;
1217 unsigned RX92 : 1;
1218 unsigned : 1;
1220 } __RCSTA2bits_t;
1222 extern __at(0x0F6B) volatile __RCSTA2bits_t RCSTA2bits;
1224 #define _RCSTA2_RX9D 0x01
1225 #define _RCSTA2_RCD8 0x01
1226 #define _RCSTA2_RX9D2 0x01
1227 #define _RCSTA2_OERR 0x02
1228 #define _RCSTA2_OERR2 0x02
1229 #define _RCSTA2_FERR 0x04
1230 #define _RCSTA2_FERR2 0x04
1231 #define _RCSTA2_ADDEN 0x08
1232 #define _RCSTA2_ADEN 0x08
1233 #define _RCSTA2_ADDEN2 0x08
1234 #define _RCSTA2_CREN 0x10
1235 #define _RCSTA2_CREN2 0x10
1236 #define _RCSTA2_SREN 0x20
1237 #define _RCSTA2_SREN2 0x20
1238 #define _RCSTA2_RX9 0x40
1239 #define _RCSTA2_RC9 0x40
1240 #define _RCSTA2_NOT_RC8 0x40
1241 #define _RCSTA2_RC8_9 0x40
1242 #define _RCSTA2_RX92 0x40
1243 #define _RCSTA2_SPEN 0x80
1244 #define _RCSTA2_SPEN2 0x80
1246 //==============================================================================
1249 //==============================================================================
1250 // TXSTA2 Bits
1252 extern __at(0x0F6C) __sfr TXSTA2;
1254 typedef union
1256 struct
1258 unsigned TX9D : 1;
1259 unsigned TRMT : 1;
1260 unsigned BRGH : 1;
1261 unsigned SENDB2 : 1;
1262 unsigned SYNC : 1;
1263 unsigned TXEN : 1;
1264 unsigned TX9 : 1;
1265 unsigned CSRC : 1;
1268 struct
1270 unsigned TXD8 : 1;
1271 unsigned TRMT2 : 1;
1272 unsigned BRGH2 : 1;
1273 unsigned : 1;
1274 unsigned SYNC2 : 1;
1275 unsigned TXEN2 : 1;
1276 unsigned TX8_9 : 1;
1277 unsigned CSRC2 : 1;
1280 struct
1282 unsigned TX9D2 : 1;
1283 unsigned : 1;
1284 unsigned : 1;
1285 unsigned : 1;
1286 unsigned : 1;
1287 unsigned : 1;
1288 unsigned NOT_TX8 : 1;
1289 unsigned : 1;
1292 struct
1294 unsigned : 1;
1295 unsigned : 1;
1296 unsigned : 1;
1297 unsigned : 1;
1298 unsigned : 1;
1299 unsigned : 1;
1300 unsigned TX92 : 1;
1301 unsigned : 1;
1303 } __TXSTA2bits_t;
1305 extern __at(0x0F6C) volatile __TXSTA2bits_t TXSTA2bits;
1307 #define _TXSTA2_TX9D 0x01
1308 #define _TXSTA2_TXD8 0x01
1309 #define _TXSTA2_TX9D2 0x01
1310 #define _TXSTA2_TRMT 0x02
1311 #define _TXSTA2_TRMT2 0x02
1312 #define _TXSTA2_BRGH 0x04
1313 #define _TXSTA2_BRGH2 0x04
1314 #define _TXSTA2_SENDB2 0x08
1315 #define _TXSTA2_SYNC 0x10
1316 #define _TXSTA2_SYNC2 0x10
1317 #define _TXSTA2_TXEN 0x20
1318 #define _TXSTA2_TXEN2 0x20
1319 #define _TXSTA2_TX9 0x40
1320 #define _TXSTA2_TX8_9 0x40
1321 #define _TXSTA2_NOT_TX8 0x40
1322 #define _TXSTA2_TX92 0x40
1323 #define _TXSTA2_CSRC 0x80
1324 #define _TXSTA2_CSRC2 0x80
1326 //==============================================================================
1328 extern __at(0x0F6D) __sfr TXREG2;
1329 extern __at(0x0F6E) __sfr RCREG2;
1330 extern __at(0x0F6F) __sfr SPBRG2;
1332 //==============================================================================
1333 // LCDDATA11 Bits
1335 extern __at(0x0F70) __sfr LCDDATA11;
1337 typedef union
1339 struct
1341 unsigned S40C1 : 1;
1342 unsigned S41C1 : 1;
1343 unsigned S42C1 : 1;
1344 unsigned S43C1 : 1;
1345 unsigned S44C1 : 1;
1346 unsigned S45C1 : 1;
1347 unsigned S46C1 : 1;
1348 unsigned S47C1 : 1;
1351 struct
1353 unsigned SEG40COM1 : 1;
1354 unsigned SEG41COM1 : 1;
1355 unsigned SEG42COM1 : 1;
1356 unsigned SEG43COM1 : 1;
1357 unsigned SEG44COM1 : 1;
1358 unsigned SEG45COM1 : 1;
1359 unsigned SEG46COM1 : 1;
1360 unsigned SEG47COM1 : 1;
1362 } __LCDDATA11bits_t;
1364 extern __at(0x0F70) volatile __LCDDATA11bits_t LCDDATA11bits;
1366 #define _S40C1 0x01
1367 #define _SEG40COM1 0x01
1368 #define _S41C1 0x02
1369 #define _SEG41COM1 0x02
1370 #define _S42C1 0x04
1371 #define _SEG42COM1 0x04
1372 #define _S43C1 0x08
1373 #define _SEG43COM1 0x08
1374 #define _S44C1 0x10
1375 #define _SEG44COM1 0x10
1376 #define _S45C1 0x20
1377 #define _SEG45COM1 0x20
1378 #define _S46C1 0x40
1379 #define _SEG46COM1 0x40
1380 #define _S47C1 0x80
1381 #define _SEG47COM1 0x80
1383 //==============================================================================
1386 //==============================================================================
1387 // LCDDATA12 Bits
1389 extern __at(0x0F71) __sfr LCDDATA12;
1391 typedef union
1393 struct
1395 unsigned S0C2 : 1;
1396 unsigned S1C2 : 1;
1397 unsigned S2C2 : 1;
1398 unsigned S3C2 : 1;
1399 unsigned S4C2 : 1;
1400 unsigned S5C2 : 1;
1401 unsigned S6C2 : 1;
1402 unsigned S7C2 : 1;
1405 struct
1407 unsigned SEG0COM2 : 1;
1408 unsigned SEG1COM2 : 1;
1409 unsigned SEG2COM2 : 1;
1410 unsigned SEG3COM2 : 1;
1411 unsigned SEG4COM2 : 1;
1412 unsigned SEG5COM2 : 1;
1413 unsigned SEG6COM2 : 1;
1414 unsigned SEG7COM2 : 1;
1417 struct
1419 unsigned S00C2 : 1;
1420 unsigned S01C2 : 1;
1421 unsigned S02C2 : 1;
1422 unsigned S03C2 : 1;
1423 unsigned S04C2 : 1;
1424 unsigned S05C2 : 1;
1425 unsigned S06C2 : 1;
1426 unsigned S07C2 : 1;
1428 } __LCDDATA12bits_t;
1430 extern __at(0x0F71) volatile __LCDDATA12bits_t LCDDATA12bits;
1432 #define _S0C2 0x01
1433 #define _SEG0COM2 0x01
1434 #define _S00C2 0x01
1435 #define _S1C2 0x02
1436 #define _SEG1COM2 0x02
1437 #define _S01C2 0x02
1438 #define _S2C2 0x04
1439 #define _SEG2COM2 0x04
1440 #define _S02C2 0x04
1441 #define _S3C2 0x08
1442 #define _SEG3COM2 0x08
1443 #define _S03C2 0x08
1444 #define _S4C2 0x10
1445 #define _SEG4COM2 0x10
1446 #define _S04C2 0x10
1447 #define _S5C2 0x20
1448 #define _SEG5COM2 0x20
1449 #define _S05C2 0x20
1450 #define _S6C2 0x40
1451 #define _SEG6COM2 0x40
1452 #define _S06C2 0x40
1453 #define _S7C2 0x80
1454 #define _SEG7COM2 0x80
1455 #define _S07C2 0x80
1457 //==============================================================================
1460 //==============================================================================
1461 // LCDDATA13 Bits
1463 extern __at(0x0F72) __sfr LCDDATA13;
1465 typedef union
1467 struct
1469 unsigned S8C2 : 1;
1470 unsigned S9C2 : 1;
1471 unsigned S10C2 : 1;
1472 unsigned S11C2 : 1;
1473 unsigned S12C2 : 1;
1474 unsigned S13C2 : 1;
1475 unsigned S14C2 : 1;
1476 unsigned S15C2 : 1;
1479 struct
1481 unsigned SEG8COM2 : 1;
1482 unsigned SEG9COM2 : 1;
1483 unsigned SEG10COM2 : 1;
1484 unsigned SEG11COM2 : 1;
1485 unsigned SEG12COM2 : 1;
1486 unsigned SEG13COM2 : 1;
1487 unsigned SEG14COM2 : 1;
1488 unsigned SEG15COM2 : 1;
1491 struct
1493 unsigned S08C2 : 1;
1494 unsigned S09C2 : 1;
1495 unsigned : 1;
1496 unsigned : 1;
1497 unsigned : 1;
1498 unsigned : 1;
1499 unsigned : 1;
1500 unsigned : 1;
1502 } __LCDDATA13bits_t;
1504 extern __at(0x0F72) volatile __LCDDATA13bits_t LCDDATA13bits;
1506 #define _S8C2 0x01
1507 #define _SEG8COM2 0x01
1508 #define _S08C2 0x01
1509 #define _S9C2 0x02
1510 #define _SEG9COM2 0x02
1511 #define _S09C2 0x02
1512 #define _S10C2 0x04
1513 #define _SEG10COM2 0x04
1514 #define _S11C2 0x08
1515 #define _SEG11COM2 0x08
1516 #define _S12C2 0x10
1517 #define _SEG12COM2 0x10
1518 #define _S13C2 0x20
1519 #define _SEG13COM2 0x20
1520 #define _S14C2 0x40
1521 #define _SEG14COM2 0x40
1522 #define _S15C2 0x80
1523 #define _SEG15COM2 0x80
1525 //==============================================================================
1528 //==============================================================================
1529 // LCDDATA14 Bits
1531 extern __at(0x0F73) __sfr LCDDATA14;
1533 typedef union
1535 struct
1537 unsigned S16C2 : 1;
1538 unsigned S17C2 : 1;
1539 unsigned S18C2 : 1;
1540 unsigned S19C2 : 1;
1541 unsigned S20C2 : 1;
1542 unsigned S21C2 : 1;
1543 unsigned S22C2 : 1;
1544 unsigned S23C2 : 1;
1547 struct
1549 unsigned SEG16COM2 : 1;
1550 unsigned SEG17COM2 : 1;
1551 unsigned SEG18COM2 : 1;
1552 unsigned SEG19COM2 : 1;
1553 unsigned SEG20COM2 : 1;
1554 unsigned SEG21COM2 : 1;
1555 unsigned SEG22COM2 : 1;
1556 unsigned SEG23COM2 : 1;
1558 } __LCDDATA14bits_t;
1560 extern __at(0x0F73) volatile __LCDDATA14bits_t LCDDATA14bits;
1562 #define _S16C2 0x01
1563 #define _SEG16COM2 0x01
1564 #define _S17C2 0x02
1565 #define _SEG17COM2 0x02
1566 #define _S18C2 0x04
1567 #define _SEG18COM2 0x04
1568 #define _S19C2 0x08
1569 #define _SEG19COM2 0x08
1570 #define _S20C2 0x10
1571 #define _SEG20COM2 0x10
1572 #define _S21C2 0x20
1573 #define _SEG21COM2 0x20
1574 #define _S22C2 0x40
1575 #define _SEG22COM2 0x40
1576 #define _S23C2 0x80
1577 #define _SEG23COM2 0x80
1579 //==============================================================================
1582 //==============================================================================
1583 // LCDDATA15 Bits
1585 extern __at(0x0F74) __sfr LCDDATA15;
1587 typedef union
1589 struct
1591 unsigned S24C2 : 1;
1592 unsigned S25C2 : 1;
1593 unsigned S26C2 : 1;
1594 unsigned S27C2 : 1;
1595 unsigned S28C2 : 1;
1596 unsigned S29C2 : 1;
1597 unsigned S30C2 : 1;
1598 unsigned S31C2 : 1;
1601 struct
1603 unsigned SEG24COM2 : 1;
1604 unsigned SEG25COM2 : 1;
1605 unsigned SEG26COM2 : 1;
1606 unsigned SEG27COM2 : 1;
1607 unsigned SEG28COM2 : 1;
1608 unsigned SEG29COM2 : 1;
1609 unsigned SEG30COM2 : 1;
1610 unsigned SEG31COM2 : 1;
1612 } __LCDDATA15bits_t;
1614 extern __at(0x0F74) volatile __LCDDATA15bits_t LCDDATA15bits;
1616 #define _S24C2 0x01
1617 #define _SEG24COM2 0x01
1618 #define _S25C2 0x02
1619 #define _SEG25COM2 0x02
1620 #define _S26C2 0x04
1621 #define _SEG26COM2 0x04
1622 #define _S27C2 0x08
1623 #define _SEG27COM2 0x08
1624 #define _S28C2 0x10
1625 #define _SEG28COM2 0x10
1626 #define _S29C2 0x20
1627 #define _SEG29COM2 0x20
1628 #define _S30C2 0x40
1629 #define _SEG30COM2 0x40
1630 #define _S31C2 0x80
1631 #define _SEG31COM2 0x80
1633 //==============================================================================
1636 //==============================================================================
1637 // LCDDATA16 Bits
1639 extern __at(0x0F75) __sfr LCDDATA16;
1641 typedef union
1643 struct
1645 unsigned S32C2 : 1;
1646 unsigned S33C2 : 1;
1647 unsigned S34C2 : 1;
1648 unsigned S35C2 : 1;
1649 unsigned S36C2 : 1;
1650 unsigned S37C2 : 1;
1651 unsigned S38C2 : 1;
1652 unsigned S39C2 : 1;
1655 struct
1657 unsigned SEG32COM2 : 1;
1658 unsigned SEG33COM2 : 1;
1659 unsigned SEG34COM2 : 1;
1660 unsigned SEG35COM2 : 1;
1661 unsigned SEG36COM2 : 1;
1662 unsigned SEG37COM2 : 1;
1663 unsigned SEG38COM2 : 1;
1664 unsigned SEG39COM2 : 1;
1666 } __LCDDATA16bits_t;
1668 extern __at(0x0F75) volatile __LCDDATA16bits_t LCDDATA16bits;
1670 #define _S32C2 0x01
1671 #define _SEG32COM2 0x01
1672 #define _S33C2 0x02
1673 #define _SEG33COM2 0x02
1674 #define _S34C2 0x04
1675 #define _SEG34COM2 0x04
1676 #define _S35C2 0x08
1677 #define _SEG35COM2 0x08
1678 #define _S36C2 0x10
1679 #define _SEG36COM2 0x10
1680 #define _S37C2 0x20
1681 #define _SEG37COM2 0x20
1682 #define _S38C2 0x40
1683 #define _SEG38COM2 0x40
1684 #define _S39C2 0x80
1685 #define _SEG39COM2 0x80
1687 //==============================================================================
1690 //==============================================================================
1691 // LCDDATA17 Bits
1693 extern __at(0x0F76) __sfr LCDDATA17;
1695 typedef union
1697 struct
1699 unsigned S40C2 : 1;
1700 unsigned S41C2 : 1;
1701 unsigned S42C2 : 1;
1702 unsigned S43C2 : 1;
1703 unsigned S44C2 : 1;
1704 unsigned S45C2 : 1;
1705 unsigned S46C2 : 1;
1706 unsigned S47C2 : 1;
1709 struct
1711 unsigned SEG40COM2 : 1;
1712 unsigned SEG41COM2 : 1;
1713 unsigned SEG42COM2 : 1;
1714 unsigned SEG43COM2 : 1;
1715 unsigned SEG44COM2 : 1;
1716 unsigned SEG45COM2 : 1;
1717 unsigned SEG46COM2 : 1;
1718 unsigned SEG47COM2 : 1;
1720 } __LCDDATA17bits_t;
1722 extern __at(0x0F76) volatile __LCDDATA17bits_t LCDDATA17bits;
1724 #define _S40C2 0x01
1725 #define _SEG40COM2 0x01
1726 #define _S41C2 0x02
1727 #define _SEG41COM2 0x02
1728 #define _S42C2 0x04
1729 #define _SEG42COM2 0x04
1730 #define _S43C2 0x08
1731 #define _SEG43COM2 0x08
1732 #define _S44C2 0x10
1733 #define _SEG44COM2 0x10
1734 #define _S45C2 0x20
1735 #define _SEG45COM2 0x20
1736 #define _S46C2 0x40
1737 #define _SEG46COM2 0x40
1738 #define _S47C2 0x80
1739 #define _SEG47COM2 0x80
1741 //==============================================================================
1744 //==============================================================================
1745 // LCDDATA18 Bits
1747 extern __at(0x0F77) __sfr LCDDATA18;
1749 typedef union
1751 struct
1753 unsigned S0C3 : 1;
1754 unsigned S1C3 : 1;
1755 unsigned S2C3 : 1;
1756 unsigned S3C3 : 1;
1757 unsigned S4C3 : 1;
1758 unsigned S5C3 : 1;
1759 unsigned S6C3 : 1;
1760 unsigned S7C3 : 1;
1763 struct
1765 unsigned SEG0COM3 : 1;
1766 unsigned SEG1COM3 : 1;
1767 unsigned SEG2COM3 : 1;
1768 unsigned SEG3COM3 : 1;
1769 unsigned SEG4COM3 : 1;
1770 unsigned SEG5COM3 : 1;
1771 unsigned SEG6COM3 : 1;
1772 unsigned SEG7COM3 : 1;
1775 struct
1777 unsigned S00C3 : 1;
1778 unsigned S01C3 : 1;
1779 unsigned S02C3 : 1;
1780 unsigned S03C3 : 1;
1781 unsigned S04C3 : 1;
1782 unsigned S05C3 : 1;
1783 unsigned S06C3 : 1;
1784 unsigned S07C3 : 1;
1786 } __LCDDATA18bits_t;
1788 extern __at(0x0F77) volatile __LCDDATA18bits_t LCDDATA18bits;
1790 #define _S0C3 0x01
1791 #define _SEG0COM3 0x01
1792 #define _S00C3 0x01
1793 #define _S1C3 0x02
1794 #define _SEG1COM3 0x02
1795 #define _S01C3 0x02
1796 #define _S2C3 0x04
1797 #define _SEG2COM3 0x04
1798 #define _S02C3 0x04
1799 #define _S3C3 0x08
1800 #define _SEG3COM3 0x08
1801 #define _S03C3 0x08
1802 #define _S4C3 0x10
1803 #define _SEG4COM3 0x10
1804 #define _S04C3 0x10
1805 #define _S5C3 0x20
1806 #define _SEG5COM3 0x20
1807 #define _S05C3 0x20
1808 #define _S6C3 0x40
1809 #define _SEG6COM3 0x40
1810 #define _S06C3 0x40
1811 #define _S7C3 0x80
1812 #define _SEG7COM3 0x80
1813 #define _S07C3 0x80
1815 //==============================================================================
1818 //==============================================================================
1819 // LCDDATA19 Bits
1821 extern __at(0x0F78) __sfr LCDDATA19;
1823 typedef union
1825 struct
1827 unsigned S8C3 : 1;
1828 unsigned S9C3 : 1;
1829 unsigned S10C3 : 1;
1830 unsigned S11C3 : 1;
1831 unsigned S12C3 : 1;
1832 unsigned S13C3 : 1;
1833 unsigned S14C3 : 1;
1834 unsigned S15C3 : 1;
1837 struct
1839 unsigned SEG8COM3 : 1;
1840 unsigned SEG9COM3 : 1;
1841 unsigned SEG10COM3 : 1;
1842 unsigned SEG11COM3 : 1;
1843 unsigned SEG12COM3 : 1;
1844 unsigned SEG13COM3 : 1;
1845 unsigned SEG14COM3 : 1;
1846 unsigned SEG15COM3 : 1;
1849 struct
1851 unsigned S08C3 : 1;
1852 unsigned S09C3 : 1;
1853 unsigned : 1;
1854 unsigned : 1;
1855 unsigned : 1;
1856 unsigned : 1;
1857 unsigned : 1;
1858 unsigned : 1;
1860 } __LCDDATA19bits_t;
1862 extern __at(0x0F78) volatile __LCDDATA19bits_t LCDDATA19bits;
1864 #define _S8C3 0x01
1865 #define _SEG8COM3 0x01
1866 #define _S08C3 0x01
1867 #define _S9C3 0x02
1868 #define _SEG9COM3 0x02
1869 #define _S09C3 0x02
1870 #define _S10C3 0x04
1871 #define _SEG10COM3 0x04
1872 #define _S11C3 0x08
1873 #define _SEG11COM3 0x08
1874 #define _S12C3 0x10
1875 #define _SEG12COM3 0x10
1876 #define _S13C3 0x20
1877 #define _SEG13COM3 0x20
1878 #define _S14C3 0x40
1879 #define _SEG14COM3 0x40
1880 #define _S15C3 0x80
1881 #define _SEG15COM3 0x80
1883 //==============================================================================
1886 //==============================================================================
1887 // LCDDATA20 Bits
1889 extern __at(0x0F79) __sfr LCDDATA20;
1891 typedef union
1893 struct
1895 unsigned S16C3 : 1;
1896 unsigned S17C3 : 1;
1897 unsigned S18C3 : 1;
1898 unsigned S19C3 : 1;
1899 unsigned S20C3 : 1;
1900 unsigned S21C3 : 1;
1901 unsigned S22C3 : 1;
1902 unsigned S23C3 : 1;
1905 struct
1907 unsigned SEG16COM3 : 1;
1908 unsigned SEG17COM3 : 1;
1909 unsigned SEG18COM3 : 1;
1910 unsigned SEG19COM3 : 1;
1911 unsigned SEG20COM3 : 1;
1912 unsigned SEG21COM3 : 1;
1913 unsigned SEG22COM3 : 1;
1914 unsigned SEG23COM3 : 1;
1916 } __LCDDATA20bits_t;
1918 extern __at(0x0F79) volatile __LCDDATA20bits_t LCDDATA20bits;
1920 #define _S16C3 0x01
1921 #define _SEG16COM3 0x01
1922 #define _S17C3 0x02
1923 #define _SEG17COM3 0x02
1924 #define _S18C3 0x04
1925 #define _SEG18COM3 0x04
1926 #define _S19C3 0x08
1927 #define _SEG19COM3 0x08
1928 #define _S20C3 0x10
1929 #define _SEG20COM3 0x10
1930 #define _S21C3 0x20
1931 #define _SEG21COM3 0x20
1932 #define _S22C3 0x40
1933 #define _SEG22COM3 0x40
1934 #define _S23C3 0x80
1935 #define _SEG23COM3 0x80
1937 //==============================================================================
1940 //==============================================================================
1941 // LCDDATA21 Bits
1943 extern __at(0x0F7A) __sfr LCDDATA21;
1945 typedef union
1947 struct
1949 unsigned S24C3 : 1;
1950 unsigned S25C3 : 1;
1951 unsigned S26C3 : 1;
1952 unsigned S27C3 : 1;
1953 unsigned S28C3 : 1;
1954 unsigned S29C3 : 1;
1955 unsigned S30C3 : 1;
1956 unsigned S31C3 : 1;
1959 struct
1961 unsigned SEG24COM3 : 1;
1962 unsigned SEG25COM3 : 1;
1963 unsigned SEG26COM3 : 1;
1964 unsigned SEG27COM3 : 1;
1965 unsigned SEG28COM3 : 1;
1966 unsigned SEG29COM3 : 1;
1967 unsigned SEG30COM3 : 1;
1968 unsigned SEG31COM3 : 1;
1970 } __LCDDATA21bits_t;
1972 extern __at(0x0F7A) volatile __LCDDATA21bits_t LCDDATA21bits;
1974 #define _S24C3 0x01
1975 #define _SEG24COM3 0x01
1976 #define _S25C3 0x02
1977 #define _SEG25COM3 0x02
1978 #define _S26C3 0x04
1979 #define _SEG26COM3 0x04
1980 #define _S27C3 0x08
1981 #define _SEG27COM3 0x08
1982 #define _S28C3 0x10
1983 #define _SEG28COM3 0x10
1984 #define _S29C3 0x20
1985 #define _SEG29COM3 0x20
1986 #define _S30C3 0x40
1987 #define _SEG30COM3 0x40
1988 #define _S31C3 0x80
1989 #define _SEG31COM3 0x80
1991 //==============================================================================
1994 //==============================================================================
1995 // LCDDATA22 Bits
1997 extern __at(0x0F7B) __sfr LCDDATA22;
1999 typedef union
2001 struct
2003 unsigned S32C3 : 1;
2004 unsigned S33C3 : 1;
2005 unsigned S34C3 : 1;
2006 unsigned S35C3 : 1;
2007 unsigned S36C3 : 1;
2008 unsigned S37C3 : 1;
2009 unsigned S38C3 : 1;
2010 unsigned S39C3 : 1;
2013 struct
2015 unsigned SEG32COM3 : 1;
2016 unsigned SEG33COM3 : 1;
2017 unsigned SEG34COM3 : 1;
2018 unsigned SEG35COM3 : 1;
2019 unsigned SEG36COM3 : 1;
2020 unsigned SEG37COM3 : 1;
2021 unsigned SEG38COM3 : 1;
2022 unsigned SEG39COM3 : 1;
2024 } __LCDDATA22bits_t;
2026 extern __at(0x0F7B) volatile __LCDDATA22bits_t LCDDATA22bits;
2028 #define _S32C3 0x01
2029 #define _SEG32COM3 0x01
2030 #define _S33C3 0x02
2031 #define _SEG33COM3 0x02
2032 #define _S34C3 0x04
2033 #define _SEG34COM3 0x04
2034 #define _S35C3 0x08
2035 #define _SEG35COM3 0x08
2036 #define _S36C3 0x10
2037 #define _SEG36COM3 0x10
2038 #define _S37C3 0x20
2039 #define _SEG37COM3 0x20
2040 #define _S38C3 0x40
2041 #define _SEG38COM3 0x40
2042 #define _S39C3 0x80
2043 #define _SEG39COM3 0x80
2045 //==============================================================================
2048 //==============================================================================
2049 // LCDDATA23 Bits
2051 extern __at(0x0F7C) __sfr LCDDATA23;
2053 typedef union
2055 struct
2057 unsigned S40C3 : 1;
2058 unsigned S41C3 : 1;
2059 unsigned S42C3 : 1;
2060 unsigned S43C3 : 1;
2061 unsigned S44C3 : 1;
2062 unsigned S45C3 : 1;
2063 unsigned S46C3 : 1;
2064 unsigned S47C3 : 1;
2067 struct
2069 unsigned SEG40COM3 : 1;
2070 unsigned SEG41COM3 : 1;
2071 unsigned SEG42COM3 : 1;
2072 unsigned SEG43COM3 : 1;
2073 unsigned SEG44COM3 : 1;
2074 unsigned SEG45COM3 : 1;
2075 unsigned SEG46COM3 : 1;
2076 unsigned SEG47COM3 : 1;
2078 } __LCDDATA23bits_t;
2080 extern __at(0x0F7C) volatile __LCDDATA23bits_t LCDDATA23bits;
2082 #define _S40C3 0x01
2083 #define _SEG40COM3 0x01
2084 #define _S41C3 0x02
2085 #define _SEG41COM3 0x02
2086 #define _S42C3 0x04
2087 #define _SEG42COM3 0x04
2088 #define _S43C3 0x08
2089 #define _SEG43COM3 0x08
2090 #define _S44C3 0x10
2091 #define _SEG44COM3 0x10
2092 #define _S45C3 0x20
2093 #define _SEG45COM3 0x20
2094 #define _S46C3 0x40
2095 #define _SEG46COM3 0x40
2096 #define _S47C3 0x80
2097 #define _SEG47COM3 0x80
2099 //==============================================================================
2102 //==============================================================================
2103 // BAUDCON1 Bits
2105 extern __at(0x0F7E) __sfr BAUDCON1;
2107 typedef union
2109 struct
2111 unsigned ABDEN : 1;
2112 unsigned WUE : 1;
2113 unsigned : 1;
2114 unsigned BRG16 : 1;
2115 unsigned SCKP : 1;
2116 unsigned : 1;
2117 unsigned RCIDL : 1;
2118 unsigned ABDOVF : 1;
2121 struct
2123 unsigned : 1;
2124 unsigned : 1;
2125 unsigned : 1;
2126 unsigned : 1;
2127 unsigned : 1;
2128 unsigned : 1;
2129 unsigned RCMT : 1;
2130 unsigned : 1;
2132 } __BAUDCON1bits_t;
2134 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
2136 #define _ABDEN 0x01
2137 #define _WUE 0x02
2138 #define _BRG16 0x08
2139 #define _SCKP 0x10
2140 #define _RCIDL 0x40
2141 #define _RCMT 0x40
2142 #define _ABDOVF 0x80
2144 //==============================================================================
2147 //==============================================================================
2148 // BAUDCTL1 Bits
2150 extern __at(0x0F7E) __sfr BAUDCTL1;
2152 typedef union
2154 struct
2156 unsigned ABDEN : 1;
2157 unsigned WUE : 1;
2158 unsigned : 1;
2159 unsigned BRG16 : 1;
2160 unsigned SCKP : 1;
2161 unsigned : 1;
2162 unsigned RCIDL : 1;
2163 unsigned ABDOVF : 1;
2166 struct
2168 unsigned : 1;
2169 unsigned : 1;
2170 unsigned : 1;
2171 unsigned : 1;
2172 unsigned : 1;
2173 unsigned : 1;
2174 unsigned RCMT : 1;
2175 unsigned : 1;
2177 } __BAUDCTL1bits_t;
2179 extern __at(0x0F7E) volatile __BAUDCTL1bits_t BAUDCTL1bits;
2181 #define _BAUDCTL1_ABDEN 0x01
2182 #define _BAUDCTL1_WUE 0x02
2183 #define _BAUDCTL1_BRG16 0x08
2184 #define _BAUDCTL1_SCKP 0x10
2185 #define _BAUDCTL1_RCIDL 0x40
2186 #define _BAUDCTL1_RCMT 0x40
2187 #define _BAUDCTL1_ABDOVF 0x80
2189 //==============================================================================
2191 extern __at(0x0F7F) __sfr SPBRGH1;
2193 //==============================================================================
2194 // PORTA Bits
2196 extern __at(0x0F80) __sfr PORTA;
2198 typedef union
2200 struct
2202 unsigned RA0 : 1;
2203 unsigned RA1 : 1;
2204 unsigned RA2 : 1;
2205 unsigned RA3 : 1;
2206 unsigned RA4 : 1;
2207 unsigned RA5 : 1;
2208 unsigned RA6 : 1;
2209 unsigned RA7 : 1;
2212 struct
2214 unsigned AN0 : 1;
2215 unsigned AN1 : 1;
2216 unsigned AN2 : 1;
2217 unsigned AN3 : 1;
2218 unsigned T0CKI : 1;
2219 unsigned AN4 : 1;
2220 unsigned OSC2 : 1;
2221 unsigned OSC1 : 1;
2224 struct
2226 unsigned : 1;
2227 unsigned : 1;
2228 unsigned VREFM : 1;
2229 unsigned VREFP : 1;
2230 unsigned SEG14 : 1;
2231 unsigned LVDIN : 1;
2232 unsigned CLKO : 1;
2233 unsigned CLKI : 1;
2236 struct
2238 unsigned : 1;
2239 unsigned : 1;
2240 unsigned SEG16 : 1;
2241 unsigned SEG17 : 1;
2242 unsigned : 1;
2243 unsigned SEG15 : 1;
2244 unsigned : 1;
2245 unsigned : 1;
2247 } __PORTAbits_t;
2249 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
2251 #define _PORTA_RA0 0x01
2252 #define _PORTA_AN0 0x01
2253 #define _PORTA_RA1 0x02
2254 #define _PORTA_AN1 0x02
2255 #define _PORTA_RA2 0x04
2256 #define _PORTA_AN2 0x04
2257 #define _PORTA_VREFM 0x04
2258 #define _PORTA_SEG16 0x04
2259 #define _PORTA_RA3 0x08
2260 #define _PORTA_AN3 0x08
2261 #define _PORTA_VREFP 0x08
2262 #define _PORTA_SEG17 0x08
2263 #define _PORTA_RA4 0x10
2264 #define _PORTA_T0CKI 0x10
2265 #define _PORTA_SEG14 0x10
2266 #define _PORTA_RA5 0x20
2267 #define _PORTA_AN4 0x20
2268 #define _PORTA_LVDIN 0x20
2269 #define _PORTA_SEG15 0x20
2270 #define _PORTA_RA6 0x40
2271 #define _PORTA_OSC2 0x40
2272 #define _PORTA_CLKO 0x40
2273 #define _PORTA_RA7 0x80
2274 #define _PORTA_OSC1 0x80
2275 #define _PORTA_CLKI 0x80
2277 //==============================================================================
2280 //==============================================================================
2281 // PORTB Bits
2283 extern __at(0x0F81) __sfr PORTB;
2285 typedef union
2287 struct
2289 unsigned RB0 : 1;
2290 unsigned RB1 : 1;
2291 unsigned RB2 : 1;
2292 unsigned RB3 : 1;
2293 unsigned RB4 : 1;
2294 unsigned RB5 : 1;
2295 unsigned RB6 : 1;
2296 unsigned RB7 : 1;
2299 struct
2301 unsigned INT0 : 1;
2302 unsigned INT1 : 1;
2303 unsigned INT2 : 1;
2304 unsigned INT3 : 1;
2305 unsigned KBI0 : 1;
2306 unsigned KBI1 : 1;
2307 unsigned KBI2 : 1;
2308 unsigned KBI3 : 1;
2311 struct
2313 unsigned : 1;
2314 unsigned SEG8 : 1;
2315 unsigned SEG9 : 1;
2316 unsigned SEG10 : 1;
2317 unsigned SEG11 : 1;
2318 unsigned PGM : 1;
2319 unsigned PGC : 1;
2320 unsigned PGD : 1;
2323 struct
2325 unsigned : 1;
2326 unsigned : 1;
2327 unsigned : 1;
2328 unsigned CCP2B : 1;
2329 unsigned : 1;
2330 unsigned : 1;
2331 unsigned : 1;
2332 unsigned : 1;
2335 struct
2337 unsigned INT : 4;
2338 unsigned : 4;
2341 struct
2343 unsigned : 4;
2344 unsigned KBI : 4;
2346 } __PORTBbits_t;
2348 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
2350 #define _PORTB_RB0 0x01
2351 #define _PORTB_INT0 0x01
2352 #define _PORTB_RB1 0x02
2353 #define _PORTB_INT1 0x02
2354 #define _PORTB_SEG8 0x02
2355 #define _PORTB_RB2 0x04
2356 #define _PORTB_INT2 0x04
2357 #define _PORTB_SEG9 0x04
2358 #define _PORTB_RB3 0x08
2359 #define _PORTB_INT3 0x08
2360 #define _PORTB_SEG10 0x08
2361 #define _PORTB_CCP2B 0x08
2362 #define _PORTB_RB4 0x10
2363 #define _PORTB_KBI0 0x10
2364 #define _PORTB_SEG11 0x10
2365 #define _PORTB_RB5 0x20
2366 #define _PORTB_KBI1 0x20
2367 #define _PORTB_PGM 0x20
2368 #define _PORTB_RB6 0x40
2369 #define _PORTB_KBI2 0x40
2370 #define _PORTB_PGC 0x40
2371 #define _PORTB_RB7 0x80
2372 #define _PORTB_KBI3 0x80
2373 #define _PORTB_PGD 0x80
2375 //==============================================================================
2378 //==============================================================================
2379 // PORTC Bits
2381 extern __at(0x0F82) __sfr PORTC;
2383 typedef union
2385 struct
2387 unsigned RC0 : 1;
2388 unsigned RC1 : 1;
2389 unsigned RC2 : 1;
2390 unsigned RC3 : 1;
2391 unsigned RC4 : 1;
2392 unsigned RC5 : 1;
2393 unsigned RC6 : 1;
2394 unsigned RC7 : 1;
2397 struct
2399 unsigned T1OSO : 1;
2400 unsigned T1OSI : 1;
2401 unsigned CCP1 : 1;
2402 unsigned SCK : 1;
2403 unsigned SDI : 1;
2404 unsigned SDO : 1;
2405 unsigned TX : 1;
2406 unsigned RX : 1;
2409 struct
2411 unsigned T13CKI : 1;
2412 unsigned CCP2C : 1;
2413 unsigned SEG13 : 1;
2414 unsigned SCL : 1;
2415 unsigned SDA : 1;
2416 unsigned : 1;
2417 unsigned CK : 1;
2418 unsigned : 1;
2421 struct
2423 unsigned : 1;
2424 unsigned : 1;
2425 unsigned : 1;
2426 unsigned SEG12 : 1;
2427 unsigned : 1;
2428 unsigned : 1;
2429 unsigned : 1;
2430 unsigned : 1;
2432 } __PORTCbits_t;
2434 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
2436 #define _PORTC_RC0 0x01
2437 #define _PORTC_T1OSO 0x01
2438 #define _PORTC_T13CKI 0x01
2439 #define _PORTC_RC1 0x02
2440 #define _PORTC_T1OSI 0x02
2441 #define _PORTC_CCP2C 0x02
2442 #define _PORTC_RC2 0x04
2443 #define _PORTC_CCP1 0x04
2444 #define _PORTC_SEG13 0x04
2445 #define _PORTC_RC3 0x08
2446 #define _PORTC_SCK 0x08
2447 #define _PORTC_SCL 0x08
2448 #define _PORTC_SEG12 0x08
2449 #define _PORTC_RC4 0x10
2450 #define _PORTC_SDI 0x10
2451 #define _PORTC_SDA 0x10
2452 #define _PORTC_RC5 0x20
2453 #define _PORTC_SDO 0x20
2454 #define _PORTC_RC6 0x40
2455 #define _PORTC_TX 0x40
2456 #define _PORTC_CK 0x40
2457 #define _PORTC_RC7 0x80
2458 #define _PORTC_RX 0x80
2460 //==============================================================================
2463 //==============================================================================
2464 // PORTD Bits
2466 extern __at(0x0F83) __sfr PORTD;
2468 typedef union
2470 struct
2472 unsigned RD0 : 1;
2473 unsigned RD1 : 1;
2474 unsigned RD2 : 1;
2475 unsigned RD3 : 1;
2476 unsigned RD4 : 1;
2477 unsigned RD5 : 1;
2478 unsigned RD6 : 1;
2479 unsigned RD7 : 1;
2482 struct
2484 unsigned SEG0 : 1;
2485 unsigned SEG1 : 1;
2486 unsigned SEG2 : 1;
2487 unsigned SEG3 : 1;
2488 unsigned SEG4 : 1;
2489 unsigned SEG5 : 1;
2490 unsigned SEG6 : 1;
2491 unsigned SEG7 : 1;
2493 } __PORTDbits_t;
2495 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
2497 #define _PORTD_RD0 0x01
2498 #define _PORTD_SEG0 0x01
2499 #define _PORTD_RD1 0x02
2500 #define _PORTD_SEG1 0x02
2501 #define _PORTD_RD2 0x04
2502 #define _PORTD_SEG2 0x04
2503 #define _PORTD_RD3 0x08
2504 #define _PORTD_SEG3 0x08
2505 #define _PORTD_RD4 0x10
2506 #define _PORTD_SEG4 0x10
2507 #define _PORTD_RD5 0x20
2508 #define _PORTD_SEG5 0x20
2509 #define _PORTD_RD6 0x40
2510 #define _PORTD_SEG6 0x40
2511 #define _PORTD_RD7 0x80
2512 #define _PORTD_SEG7 0x80
2514 //==============================================================================
2517 //==============================================================================
2518 // PORTE Bits
2520 extern __at(0x0F84) __sfr PORTE;
2522 typedef union
2524 struct
2526 unsigned LCDBIAS1 : 1;
2527 unsigned LCDBIAS2 : 1;
2528 unsigned LCDBIAS3 : 1;
2529 unsigned COM0 : 1;
2530 unsigned RE4 : 1;
2531 unsigned RE5 : 1;
2532 unsigned RE6 : 1;
2533 unsigned RE7 : 1;
2536 struct
2538 unsigned BIAS1 : 1;
2539 unsigned BIAS2 : 1;
2540 unsigned BIAS3 : 1;
2541 unsigned : 1;
2542 unsigned COM1 : 1;
2543 unsigned COM2 : 1;
2544 unsigned COM3 : 1;
2545 unsigned SEG31 : 1;
2548 struct
2550 unsigned : 1;
2551 unsigned : 1;
2552 unsigned : 1;
2553 unsigned : 1;
2554 unsigned : 1;
2555 unsigned : 1;
2556 unsigned : 1;
2557 unsigned CCP2E : 1;
2560 struct
2562 unsigned : 3;
2563 unsigned COM : 4;
2564 unsigned : 1;
2566 } __PORTEbits_t;
2568 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
2570 #define _PORTE_LCDBIAS1 0x01
2571 #define _PORTE_BIAS1 0x01
2572 #define _PORTE_LCDBIAS2 0x02
2573 #define _PORTE_BIAS2 0x02
2574 #define _PORTE_LCDBIAS3 0x04
2575 #define _PORTE_BIAS3 0x04
2576 #define _PORTE_COM0 0x08
2577 #define _PORTE_RE4 0x10
2578 #define _PORTE_COM1 0x10
2579 #define _PORTE_RE5 0x20
2580 #define _PORTE_COM2 0x20
2581 #define _PORTE_RE6 0x40
2582 #define _PORTE_COM3 0x40
2583 #define _PORTE_RE7 0x80
2584 #define _PORTE_SEG31 0x80
2585 #define _PORTE_CCP2E 0x80
2587 //==============================================================================
2590 //==============================================================================
2591 // PORTF Bits
2593 extern __at(0x0F85) __sfr PORTF;
2595 typedef union
2597 struct
2599 unsigned RF0 : 1;
2600 unsigned RF1 : 1;
2601 unsigned RF2 : 1;
2602 unsigned RF3 : 1;
2603 unsigned RF4 : 1;
2604 unsigned RF5 : 1;
2605 unsigned RF6 : 1;
2606 unsigned RF7 : 1;
2609 struct
2611 unsigned AN5 : 1;
2612 unsigned AN6 : 1;
2613 unsigned AN7 : 1;
2614 unsigned AN8 : 1;
2615 unsigned AN9 : 1;
2616 unsigned AN10 : 1;
2617 unsigned AN11 : 1;
2618 unsigned SS : 1;
2621 struct
2623 unsigned SEG18 : 1;
2624 unsigned SEG19 : 1;
2625 unsigned SEG20 : 1;
2626 unsigned SEG21 : 1;
2627 unsigned SEG22 : 1;
2628 unsigned SEG23 : 1;
2629 unsigned SEG24 : 1;
2630 unsigned SEG25 : 1;
2633 struct
2635 unsigned : 1;
2636 unsigned C2OUTF : 1;
2637 unsigned C1OUTF : 1;
2638 unsigned : 1;
2639 unsigned : 1;
2640 unsigned CVREFF : 1;
2641 unsigned : 1;
2642 unsigned : 1;
2644 } __PORTFbits_t;
2646 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
2648 #define _PORTF_RF0 0x01
2649 #define _PORTF_AN5 0x01
2650 #define _PORTF_SEG18 0x01
2651 #define _PORTF_RF1 0x02
2652 #define _PORTF_AN6 0x02
2653 #define _PORTF_SEG19 0x02
2654 #define _PORTF_C2OUTF 0x02
2655 #define _PORTF_RF2 0x04
2656 #define _PORTF_AN7 0x04
2657 #define _PORTF_SEG20 0x04
2658 #define _PORTF_C1OUTF 0x04
2659 #define _PORTF_RF3 0x08
2660 #define _PORTF_AN8 0x08
2661 #define _PORTF_SEG21 0x08
2662 #define _PORTF_RF4 0x10
2663 #define _PORTF_AN9 0x10
2664 #define _PORTF_SEG22 0x10
2665 #define _PORTF_RF5 0x20
2666 #define _PORTF_AN10 0x20
2667 #define _PORTF_SEG23 0x20
2668 #define _PORTF_CVREFF 0x20
2669 #define _PORTF_RF6 0x40
2670 #define _PORTF_AN11 0x40
2671 #define _PORTF_SEG24 0x40
2672 #define _PORTF_RF7 0x80
2673 #define _PORTF_SS 0x80
2674 #define _PORTF_SEG25 0x80
2676 //==============================================================================
2679 //==============================================================================
2680 // PORTG Bits
2682 extern __at(0x0F86) __sfr PORTG;
2684 typedef union
2686 struct
2688 unsigned RG0 : 1;
2689 unsigned RG1 : 1;
2690 unsigned RG2 : 1;
2691 unsigned RG3 : 1;
2692 unsigned RG4 : 1;
2693 unsigned RG5 : 1;
2694 unsigned : 1;
2695 unsigned : 1;
2698 struct
2700 unsigned SEG30 : 1;
2701 unsigned TX2 : 1;
2702 unsigned RX2 : 1;
2703 unsigned SEG27 : 1;
2704 unsigned SEG26 : 1;
2705 unsigned MCLR : 1;
2706 unsigned : 1;
2707 unsigned : 1;
2710 struct
2712 unsigned : 1;
2713 unsigned CK2 : 1;
2714 unsigned DT2 : 1;
2715 unsigned : 1;
2716 unsigned : 1;
2717 unsigned VPP : 1;
2718 unsigned : 1;
2719 unsigned : 1;
2722 struct
2724 unsigned : 1;
2725 unsigned SEG29 : 1;
2726 unsigned SEG28 : 1;
2727 unsigned : 1;
2728 unsigned : 1;
2729 unsigned : 1;
2730 unsigned : 1;
2731 unsigned : 1;
2734 struct
2736 unsigned RG : 6;
2737 unsigned : 2;
2739 } __PORTGbits_t;
2741 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
2743 #define _PORTG_RG0 0x01
2744 #define _PORTG_SEG30 0x01
2745 #define _PORTG_RG1 0x02
2746 #define _PORTG_TX2 0x02
2747 #define _PORTG_CK2 0x02
2748 #define _PORTG_SEG29 0x02
2749 #define _PORTG_RG2 0x04
2750 #define _PORTG_RX2 0x04
2751 #define _PORTG_DT2 0x04
2752 #define _PORTG_SEG28 0x04
2753 #define _PORTG_RG3 0x08
2754 #define _PORTG_SEG27 0x08
2755 #define _PORTG_RG4 0x10
2756 #define _PORTG_SEG26 0x10
2757 #define _PORTG_RG5 0x20
2758 #define _PORTG_MCLR 0x20
2759 #define _PORTG_VPP 0x20
2761 //==============================================================================
2764 //==============================================================================
2765 // PORTH Bits
2767 extern __at(0x0F87) __sfr PORTH;
2769 typedef union
2771 struct
2773 unsigned RH0 : 1;
2774 unsigned RH1 : 1;
2775 unsigned RH2 : 1;
2776 unsigned RH3 : 1;
2777 unsigned RH4 : 1;
2778 unsigned RH5 : 1;
2779 unsigned RH6 : 1;
2780 unsigned RH7 : 1;
2783 struct
2785 unsigned SEG47 : 1;
2786 unsigned SEG46 : 1;
2787 unsigned SEG45 : 1;
2788 unsigned SEG44 : 1;
2789 unsigned SEG40 : 1;
2790 unsigned SEG41 : 1;
2791 unsigned SEG42 : 1;
2792 unsigned SEG43 : 1;
2794 } __PORTHbits_t;
2796 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
2798 #define _PORTH_RH0 0x01
2799 #define _PORTH_SEG47 0x01
2800 #define _PORTH_RH1 0x02
2801 #define _PORTH_SEG46 0x02
2802 #define _PORTH_RH2 0x04
2803 #define _PORTH_SEG45 0x04
2804 #define _PORTH_RH3 0x08
2805 #define _PORTH_SEG44 0x08
2806 #define _PORTH_RH4 0x10
2807 #define _PORTH_SEG40 0x10
2808 #define _PORTH_RH5 0x20
2809 #define _PORTH_SEG41 0x20
2810 #define _PORTH_RH6 0x40
2811 #define _PORTH_SEG42 0x40
2812 #define _PORTH_RH7 0x80
2813 #define _PORTH_SEG43 0x80
2815 //==============================================================================
2818 //==============================================================================
2819 // PORTJ Bits
2821 extern __at(0x0F88) __sfr PORTJ;
2823 typedef union
2825 struct
2827 unsigned RJ0 : 1;
2828 unsigned RJ1 : 1;
2829 unsigned RJ2 : 1;
2830 unsigned RJ3 : 1;
2831 unsigned RJ4 : 1;
2832 unsigned RJ5 : 1;
2833 unsigned RJ6 : 1;
2834 unsigned RJ7 : 1;
2837 struct
2839 unsigned SEG32 : 1;
2840 unsigned SEG33 : 1;
2841 unsigned SEG34 : 1;
2842 unsigned SEG35 : 1;
2843 unsigned SEG39 : 1;
2844 unsigned SEG38 : 1;
2845 unsigned SEG37 : 1;
2846 unsigned SEG36 : 1;
2848 } __PORTJbits_t;
2850 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
2852 #define _PORTJ_RJ0 0x01
2853 #define _PORTJ_SEG32 0x01
2854 #define _PORTJ_RJ1 0x02
2855 #define _PORTJ_SEG33 0x02
2856 #define _PORTJ_RJ2 0x04
2857 #define _PORTJ_SEG34 0x04
2858 #define _PORTJ_RJ3 0x08
2859 #define _PORTJ_SEG35 0x08
2860 #define _PORTJ_RJ4 0x10
2861 #define _PORTJ_SEG39 0x10
2862 #define _PORTJ_RJ5 0x20
2863 #define _PORTJ_SEG38 0x20
2864 #define _PORTJ_RJ6 0x40
2865 #define _PORTJ_SEG37 0x40
2866 #define _PORTJ_RJ7 0x80
2867 #define _PORTJ_SEG36 0x80
2869 //==============================================================================
2872 //==============================================================================
2873 // LATA Bits
2875 extern __at(0x0F89) __sfr LATA;
2877 typedef struct
2879 unsigned LATA0 : 1;
2880 unsigned LATA1 : 1;
2881 unsigned LATA2 : 1;
2882 unsigned LATA3 : 1;
2883 unsigned LATA4 : 1;
2884 unsigned LATA5 : 1;
2885 unsigned LATA6 : 1;
2886 unsigned LATA7 : 1;
2887 } __LATAbits_t;
2889 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2891 #define _LATA0 0x01
2892 #define _LATA1 0x02
2893 #define _LATA2 0x04
2894 #define _LATA3 0x08
2895 #define _LATA4 0x10
2896 #define _LATA5 0x20
2897 #define _LATA6 0x40
2898 #define _LATA7 0x80
2900 //==============================================================================
2903 //==============================================================================
2904 // LATB Bits
2906 extern __at(0x0F8A) __sfr LATB;
2908 typedef struct
2910 unsigned LATB0 : 1;
2911 unsigned LATB1 : 1;
2912 unsigned LATB2 : 1;
2913 unsigned LATB3 : 1;
2914 unsigned LATB4 : 1;
2915 unsigned LATB5 : 1;
2916 unsigned LATB6 : 1;
2917 unsigned LATB7 : 1;
2918 } __LATBbits_t;
2920 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2922 #define _LATB0 0x01
2923 #define _LATB1 0x02
2924 #define _LATB2 0x04
2925 #define _LATB3 0x08
2926 #define _LATB4 0x10
2927 #define _LATB5 0x20
2928 #define _LATB6 0x40
2929 #define _LATB7 0x80
2931 //==============================================================================
2934 //==============================================================================
2935 // LATC Bits
2937 extern __at(0x0F8B) __sfr LATC;
2939 typedef struct
2941 unsigned LATC0 : 1;
2942 unsigned LATC1 : 1;
2943 unsigned LATC2 : 1;
2944 unsigned LATC3 : 1;
2945 unsigned LATC4 : 1;
2946 unsigned LATC5 : 1;
2947 unsigned LATC6 : 1;
2948 unsigned LATC7 : 1;
2949 } __LATCbits_t;
2951 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2953 #define _LATC0 0x01
2954 #define _LATC1 0x02
2955 #define _LATC2 0x04
2956 #define _LATC3 0x08
2957 #define _LATC4 0x10
2958 #define _LATC5 0x20
2959 #define _LATC6 0x40
2960 #define _LATC7 0x80
2962 //==============================================================================
2965 //==============================================================================
2966 // LATD Bits
2968 extern __at(0x0F8C) __sfr LATD;
2970 typedef struct
2972 unsigned LATD0 : 1;
2973 unsigned LATD1 : 1;
2974 unsigned LATD2 : 1;
2975 unsigned LATD3 : 1;
2976 unsigned LATD4 : 1;
2977 unsigned LATD5 : 1;
2978 unsigned LATD6 : 1;
2979 unsigned LATD7 : 1;
2980 } __LATDbits_t;
2982 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2984 #define _LATD0 0x01
2985 #define _LATD1 0x02
2986 #define _LATD2 0x04
2987 #define _LATD3 0x08
2988 #define _LATD4 0x10
2989 #define _LATD5 0x20
2990 #define _LATD6 0x40
2991 #define _LATD7 0x80
2993 //==============================================================================
2996 //==============================================================================
2997 // LATE Bits
2999 extern __at(0x0F8D) __sfr LATE;
3001 typedef struct
3003 unsigned : 1;
3004 unsigned : 1;
3005 unsigned : 1;
3006 unsigned : 1;
3007 unsigned LATE4 : 1;
3008 unsigned LATE5 : 1;
3009 unsigned LATE6 : 1;
3010 unsigned LATE7 : 1;
3011 } __LATEbits_t;
3013 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
3015 #define _LATE4 0x10
3016 #define _LATE5 0x20
3017 #define _LATE6 0x40
3018 #define _LATE7 0x80
3020 //==============================================================================
3023 //==============================================================================
3024 // LATF Bits
3026 extern __at(0x0F8E) __sfr LATF;
3028 typedef struct
3030 unsigned LATF0 : 1;
3031 unsigned LATF1 : 1;
3032 unsigned LATF2 : 1;
3033 unsigned LATF3 : 1;
3034 unsigned LATF4 : 1;
3035 unsigned LATF5 : 1;
3036 unsigned LATF6 : 1;
3037 unsigned LATF7 : 1;
3038 } __LATFbits_t;
3040 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
3042 #define _LATF0 0x01
3043 #define _LATF1 0x02
3044 #define _LATF2 0x04
3045 #define _LATF3 0x08
3046 #define _LATF4 0x10
3047 #define _LATF5 0x20
3048 #define _LATF6 0x40
3049 #define _LATF7 0x80
3051 //==============================================================================
3054 //==============================================================================
3055 // LATG Bits
3057 extern __at(0x0F8F) __sfr LATG;
3059 typedef union
3061 struct
3063 unsigned LATG0 : 1;
3064 unsigned LATG1 : 1;
3065 unsigned LATG2 : 1;
3066 unsigned LATG3 : 1;
3067 unsigned LATG4 : 1;
3068 unsigned : 1;
3069 unsigned : 1;
3070 unsigned : 1;
3073 struct
3075 unsigned LATG : 5;
3076 unsigned : 3;
3078 } __LATGbits_t;
3080 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
3082 #define _LATG0 0x01
3083 #define _LATG1 0x02
3084 #define _LATG2 0x04
3085 #define _LATG3 0x08
3086 #define _LATG4 0x10
3088 //==============================================================================
3091 //==============================================================================
3092 // LATH Bits
3094 extern __at(0x0F90) __sfr LATH;
3096 typedef struct
3098 unsigned LATH0 : 1;
3099 unsigned LATH1 : 1;
3100 unsigned LATH2 : 1;
3101 unsigned LATH3 : 1;
3102 unsigned LATH4 : 1;
3103 unsigned LATH5 : 1;
3104 unsigned LATH6 : 1;
3105 unsigned LATH7 : 1;
3106 } __LATHbits_t;
3108 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
3110 #define _LATH0 0x01
3111 #define _LATH1 0x02
3112 #define _LATH2 0x04
3113 #define _LATH3 0x08
3114 #define _LATH4 0x10
3115 #define _LATH5 0x20
3116 #define _LATH6 0x40
3117 #define _LATH7 0x80
3119 //==============================================================================
3122 //==============================================================================
3123 // LATJ Bits
3125 extern __at(0x0F91) __sfr LATJ;
3127 typedef struct
3129 unsigned LATJ0 : 1;
3130 unsigned LATJ1 : 1;
3131 unsigned LATJ2 : 1;
3132 unsigned LATJ3 : 1;
3133 unsigned LATJ4 : 1;
3134 unsigned LATJ5 : 1;
3135 unsigned LATJ6 : 1;
3136 unsigned LATJ7 : 1;
3137 } __LATJbits_t;
3139 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
3141 #define _LATJ0 0x01
3142 #define _LATJ1 0x02
3143 #define _LATJ2 0x04
3144 #define _LATJ3 0x08
3145 #define _LATJ4 0x10
3146 #define _LATJ5 0x20
3147 #define _LATJ6 0x40
3148 #define _LATJ7 0x80
3150 //==============================================================================
3153 //==============================================================================
3154 // DDRA Bits
3156 extern __at(0x0F92) __sfr DDRA;
3158 typedef union
3160 struct
3162 unsigned TRISA0 : 1;
3163 unsigned TRISA1 : 1;
3164 unsigned TRISA2 : 1;
3165 unsigned TRISA3 : 1;
3166 unsigned TRISA4 : 1;
3167 unsigned TRISA5 : 1;
3168 unsigned TRISA6 : 1;
3169 unsigned TRISA7 : 1;
3172 struct
3174 unsigned RA0 : 1;
3175 unsigned RA1 : 1;
3176 unsigned RA2 : 1;
3177 unsigned RA3 : 1;
3178 unsigned RA4 : 1;
3179 unsigned RA5 : 1;
3180 unsigned RA6 : 1;
3181 unsigned RA7 : 1;
3183 } __DDRAbits_t;
3185 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
3187 #define _TRISA0 0x01
3188 #define _RA0 0x01
3189 #define _TRISA1 0x02
3190 #define _RA1 0x02
3191 #define _TRISA2 0x04
3192 #define _RA2 0x04
3193 #define _TRISA3 0x08
3194 #define _RA3 0x08
3195 #define _TRISA4 0x10
3196 #define _RA4 0x10
3197 #define _TRISA5 0x20
3198 #define _RA5 0x20
3199 #define _TRISA6 0x40
3200 #define _RA6 0x40
3201 #define _TRISA7 0x80
3202 #define _RA7 0x80
3204 //==============================================================================
3207 //==============================================================================
3208 // TRISA Bits
3210 extern __at(0x0F92) __sfr TRISA;
3212 typedef union
3214 struct
3216 unsigned TRISA0 : 1;
3217 unsigned TRISA1 : 1;
3218 unsigned TRISA2 : 1;
3219 unsigned TRISA3 : 1;
3220 unsigned TRISA4 : 1;
3221 unsigned TRISA5 : 1;
3222 unsigned TRISA6 : 1;
3223 unsigned TRISA7 : 1;
3226 struct
3228 unsigned RA0 : 1;
3229 unsigned RA1 : 1;
3230 unsigned RA2 : 1;
3231 unsigned RA3 : 1;
3232 unsigned RA4 : 1;
3233 unsigned RA5 : 1;
3234 unsigned RA6 : 1;
3235 unsigned RA7 : 1;
3237 } __TRISAbits_t;
3239 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
3241 #define _TRISA_TRISA0 0x01
3242 #define _TRISA_RA0 0x01
3243 #define _TRISA_TRISA1 0x02
3244 #define _TRISA_RA1 0x02
3245 #define _TRISA_TRISA2 0x04
3246 #define _TRISA_RA2 0x04
3247 #define _TRISA_TRISA3 0x08
3248 #define _TRISA_RA3 0x08
3249 #define _TRISA_TRISA4 0x10
3250 #define _TRISA_RA4 0x10
3251 #define _TRISA_TRISA5 0x20
3252 #define _TRISA_RA5 0x20
3253 #define _TRISA_TRISA6 0x40
3254 #define _TRISA_RA6 0x40
3255 #define _TRISA_TRISA7 0x80
3256 #define _TRISA_RA7 0x80
3258 //==============================================================================
3261 //==============================================================================
3262 // DDRB Bits
3264 extern __at(0x0F93) __sfr DDRB;
3266 typedef union
3268 struct
3270 unsigned TRISB0 : 1;
3271 unsigned TRISB1 : 1;
3272 unsigned TRISB2 : 1;
3273 unsigned TRISB3 : 1;
3274 unsigned TRISB4 : 1;
3275 unsigned TRISB5 : 1;
3276 unsigned TRISB6 : 1;
3277 unsigned TRISB7 : 1;
3280 struct
3282 unsigned RB0 : 1;
3283 unsigned RB1 : 1;
3284 unsigned RB2 : 1;
3285 unsigned RB3 : 1;
3286 unsigned RB4 : 1;
3287 unsigned RB5 : 1;
3288 unsigned RB6 : 1;
3289 unsigned RB7 : 1;
3291 } __DDRBbits_t;
3293 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
3295 #define _TRISB0 0x01
3296 #define _RB0 0x01
3297 #define _TRISB1 0x02
3298 #define _RB1 0x02
3299 #define _TRISB2 0x04
3300 #define _RB2 0x04
3301 #define _TRISB3 0x08
3302 #define _RB3 0x08
3303 #define _TRISB4 0x10
3304 #define _RB4 0x10
3305 #define _TRISB5 0x20
3306 #define _RB5 0x20
3307 #define _TRISB6 0x40
3308 #define _RB6 0x40
3309 #define _TRISB7 0x80
3310 #define _RB7 0x80
3312 //==============================================================================
3315 //==============================================================================
3316 // TRISB Bits
3318 extern __at(0x0F93) __sfr TRISB;
3320 typedef union
3322 struct
3324 unsigned TRISB0 : 1;
3325 unsigned TRISB1 : 1;
3326 unsigned TRISB2 : 1;
3327 unsigned TRISB3 : 1;
3328 unsigned TRISB4 : 1;
3329 unsigned TRISB5 : 1;
3330 unsigned TRISB6 : 1;
3331 unsigned TRISB7 : 1;
3334 struct
3336 unsigned RB0 : 1;
3337 unsigned RB1 : 1;
3338 unsigned RB2 : 1;
3339 unsigned RB3 : 1;
3340 unsigned RB4 : 1;
3341 unsigned RB5 : 1;
3342 unsigned RB6 : 1;
3343 unsigned RB7 : 1;
3345 } __TRISBbits_t;
3347 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3349 #define _TRISB_TRISB0 0x01
3350 #define _TRISB_RB0 0x01
3351 #define _TRISB_TRISB1 0x02
3352 #define _TRISB_RB1 0x02
3353 #define _TRISB_TRISB2 0x04
3354 #define _TRISB_RB2 0x04
3355 #define _TRISB_TRISB3 0x08
3356 #define _TRISB_RB3 0x08
3357 #define _TRISB_TRISB4 0x10
3358 #define _TRISB_RB4 0x10
3359 #define _TRISB_TRISB5 0x20
3360 #define _TRISB_RB5 0x20
3361 #define _TRISB_TRISB6 0x40
3362 #define _TRISB_RB6 0x40
3363 #define _TRISB_TRISB7 0x80
3364 #define _TRISB_RB7 0x80
3366 //==============================================================================
3369 //==============================================================================
3370 // DDRC Bits
3372 extern __at(0x0F94) __sfr DDRC;
3374 typedef union
3376 struct
3378 unsigned TRISC0 : 1;
3379 unsigned TRISC1 : 1;
3380 unsigned TRISC2 : 1;
3381 unsigned TRISC3 : 1;
3382 unsigned TRISC4 : 1;
3383 unsigned TRISC5 : 1;
3384 unsigned TRISC6 : 1;
3385 unsigned TRISC7 : 1;
3388 struct
3390 unsigned RC0 : 1;
3391 unsigned RC1 : 1;
3392 unsigned RC2 : 1;
3393 unsigned RC3 : 1;
3394 unsigned RC4 : 1;
3395 unsigned RC5 : 1;
3396 unsigned RC6 : 1;
3397 unsigned RC7 : 1;
3399 } __DDRCbits_t;
3401 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
3403 #define _TRISC0 0x01
3404 #define _RC0 0x01
3405 #define _TRISC1 0x02
3406 #define _RC1 0x02
3407 #define _TRISC2 0x04
3408 #define _RC2 0x04
3409 #define _TRISC3 0x08
3410 #define _RC3 0x08
3411 #define _TRISC4 0x10
3412 #define _RC4 0x10
3413 #define _TRISC5 0x20
3414 #define _RC5 0x20
3415 #define _TRISC6 0x40
3416 #define _RC6 0x40
3417 #define _TRISC7 0x80
3418 #define _RC7 0x80
3420 //==============================================================================
3423 //==============================================================================
3424 // TRISC Bits
3426 extern __at(0x0F94) __sfr TRISC;
3428 typedef union
3430 struct
3432 unsigned TRISC0 : 1;
3433 unsigned TRISC1 : 1;
3434 unsigned TRISC2 : 1;
3435 unsigned TRISC3 : 1;
3436 unsigned TRISC4 : 1;
3437 unsigned TRISC5 : 1;
3438 unsigned TRISC6 : 1;
3439 unsigned TRISC7 : 1;
3442 struct
3444 unsigned RC0 : 1;
3445 unsigned RC1 : 1;
3446 unsigned RC2 : 1;
3447 unsigned RC3 : 1;
3448 unsigned RC4 : 1;
3449 unsigned RC5 : 1;
3450 unsigned RC6 : 1;
3451 unsigned RC7 : 1;
3453 } __TRISCbits_t;
3455 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3457 #define _TRISC_TRISC0 0x01
3458 #define _TRISC_RC0 0x01
3459 #define _TRISC_TRISC1 0x02
3460 #define _TRISC_RC1 0x02
3461 #define _TRISC_TRISC2 0x04
3462 #define _TRISC_RC2 0x04
3463 #define _TRISC_TRISC3 0x08
3464 #define _TRISC_RC3 0x08
3465 #define _TRISC_TRISC4 0x10
3466 #define _TRISC_RC4 0x10
3467 #define _TRISC_TRISC5 0x20
3468 #define _TRISC_RC5 0x20
3469 #define _TRISC_TRISC6 0x40
3470 #define _TRISC_RC6 0x40
3471 #define _TRISC_TRISC7 0x80
3472 #define _TRISC_RC7 0x80
3474 //==============================================================================
3477 //==============================================================================
3478 // DDRD Bits
3480 extern __at(0x0F95) __sfr DDRD;
3482 typedef union
3484 struct
3486 unsigned TRISD0 : 1;
3487 unsigned TRISD1 : 1;
3488 unsigned TRISD2 : 1;
3489 unsigned TRISD3 : 1;
3490 unsigned TRISD4 : 1;
3491 unsigned TRISD5 : 1;
3492 unsigned TRISD6 : 1;
3493 unsigned TRISD7 : 1;
3496 struct
3498 unsigned RD0 : 1;
3499 unsigned RD1 : 1;
3500 unsigned RD2 : 1;
3501 unsigned RD3 : 1;
3502 unsigned RD4 : 1;
3503 unsigned RD5 : 1;
3504 unsigned RD6 : 1;
3505 unsigned RD7 : 1;
3507 } __DDRDbits_t;
3509 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
3511 #define _TRISD0 0x01
3512 #define _RD0 0x01
3513 #define _TRISD1 0x02
3514 #define _RD1 0x02
3515 #define _TRISD2 0x04
3516 #define _RD2 0x04
3517 #define _TRISD3 0x08
3518 #define _RD3 0x08
3519 #define _TRISD4 0x10
3520 #define _RD4 0x10
3521 #define _TRISD5 0x20
3522 #define _RD5 0x20
3523 #define _TRISD6 0x40
3524 #define _RD6 0x40
3525 #define _TRISD7 0x80
3526 #define _RD7 0x80
3528 //==============================================================================
3531 //==============================================================================
3532 // TRISD Bits
3534 extern __at(0x0F95) __sfr TRISD;
3536 typedef union
3538 struct
3540 unsigned TRISD0 : 1;
3541 unsigned TRISD1 : 1;
3542 unsigned TRISD2 : 1;
3543 unsigned TRISD3 : 1;
3544 unsigned TRISD4 : 1;
3545 unsigned TRISD5 : 1;
3546 unsigned TRISD6 : 1;
3547 unsigned TRISD7 : 1;
3550 struct
3552 unsigned RD0 : 1;
3553 unsigned RD1 : 1;
3554 unsigned RD2 : 1;
3555 unsigned RD3 : 1;
3556 unsigned RD4 : 1;
3557 unsigned RD5 : 1;
3558 unsigned RD6 : 1;
3559 unsigned RD7 : 1;
3561 } __TRISDbits_t;
3563 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
3565 #define _TRISD_TRISD0 0x01
3566 #define _TRISD_RD0 0x01
3567 #define _TRISD_TRISD1 0x02
3568 #define _TRISD_RD1 0x02
3569 #define _TRISD_TRISD2 0x04
3570 #define _TRISD_RD2 0x04
3571 #define _TRISD_TRISD3 0x08
3572 #define _TRISD_RD3 0x08
3573 #define _TRISD_TRISD4 0x10
3574 #define _TRISD_RD4 0x10
3575 #define _TRISD_TRISD5 0x20
3576 #define _TRISD_RD5 0x20
3577 #define _TRISD_TRISD6 0x40
3578 #define _TRISD_RD6 0x40
3579 #define _TRISD_TRISD7 0x80
3580 #define _TRISD_RD7 0x80
3582 //==============================================================================
3585 //==============================================================================
3586 // DDRE Bits
3588 extern __at(0x0F96) __sfr DDRE;
3590 typedef union
3592 struct
3594 unsigned : 1;
3595 unsigned : 1;
3596 unsigned : 1;
3597 unsigned : 1;
3598 unsigned TRISE4 : 1;
3599 unsigned TRISE5 : 1;
3600 unsigned TRISE6 : 1;
3601 unsigned TRISE7 : 1;
3604 struct
3606 unsigned : 1;
3607 unsigned : 1;
3608 unsigned : 1;
3609 unsigned : 1;
3610 unsigned RE4 : 1;
3611 unsigned RE5 : 1;
3612 unsigned RE6 : 1;
3613 unsigned RE7 : 1;
3615 } __DDREbits_t;
3617 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
3619 #define _TRISE4 0x10
3620 #define _RE4 0x10
3621 #define _TRISE5 0x20
3622 #define _RE5 0x20
3623 #define _TRISE6 0x40
3624 #define _RE6 0x40
3625 #define _TRISE7 0x80
3626 #define _RE7 0x80
3628 //==============================================================================
3631 //==============================================================================
3632 // TRISE Bits
3634 extern __at(0x0F96) __sfr TRISE;
3636 typedef union
3638 struct
3640 unsigned : 1;
3641 unsigned : 1;
3642 unsigned : 1;
3643 unsigned : 1;
3644 unsigned TRISE4 : 1;
3645 unsigned TRISE5 : 1;
3646 unsigned TRISE6 : 1;
3647 unsigned TRISE7 : 1;
3650 struct
3652 unsigned : 1;
3653 unsigned : 1;
3654 unsigned : 1;
3655 unsigned : 1;
3656 unsigned RE4 : 1;
3657 unsigned RE5 : 1;
3658 unsigned RE6 : 1;
3659 unsigned RE7 : 1;
3661 } __TRISEbits_t;
3663 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
3665 #define _TRISE_TRISE4 0x10
3666 #define _TRISE_RE4 0x10
3667 #define _TRISE_TRISE5 0x20
3668 #define _TRISE_RE5 0x20
3669 #define _TRISE_TRISE6 0x40
3670 #define _TRISE_RE6 0x40
3671 #define _TRISE_TRISE7 0x80
3672 #define _TRISE_RE7 0x80
3674 //==============================================================================
3677 //==============================================================================
3678 // DDRF Bits
3680 extern __at(0x0F97) __sfr DDRF;
3682 typedef union
3684 struct
3686 unsigned TRISF0 : 1;
3687 unsigned TRISF1 : 1;
3688 unsigned TRISF2 : 1;
3689 unsigned TRISF3 : 1;
3690 unsigned TRISF4 : 1;
3691 unsigned TRISF5 : 1;
3692 unsigned TRISF6 : 1;
3693 unsigned TRISF7 : 1;
3696 struct
3698 unsigned RF0 : 1;
3699 unsigned RF1 : 1;
3700 unsigned RF2 : 1;
3701 unsigned RF3 : 1;
3702 unsigned RF4 : 1;
3703 unsigned RF5 : 1;
3704 unsigned RF6 : 1;
3705 unsigned RF7 : 1;
3707 } __DDRFbits_t;
3709 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
3711 #define _TRISF0 0x01
3712 #define _RF0 0x01
3713 #define _TRISF1 0x02
3714 #define _RF1 0x02
3715 #define _TRISF2 0x04
3716 #define _RF2 0x04
3717 #define _TRISF3 0x08
3718 #define _RF3 0x08
3719 #define _TRISF4 0x10
3720 #define _RF4 0x10
3721 #define _TRISF5 0x20
3722 #define _RF5 0x20
3723 #define _TRISF6 0x40
3724 #define _RF6 0x40
3725 #define _TRISF7 0x80
3726 #define _RF7 0x80
3728 //==============================================================================
3731 //==============================================================================
3732 // TRISF Bits
3734 extern __at(0x0F97) __sfr TRISF;
3736 typedef union
3738 struct
3740 unsigned TRISF0 : 1;
3741 unsigned TRISF1 : 1;
3742 unsigned TRISF2 : 1;
3743 unsigned TRISF3 : 1;
3744 unsigned TRISF4 : 1;
3745 unsigned TRISF5 : 1;
3746 unsigned TRISF6 : 1;
3747 unsigned TRISF7 : 1;
3750 struct
3752 unsigned RF0 : 1;
3753 unsigned RF1 : 1;
3754 unsigned RF2 : 1;
3755 unsigned RF3 : 1;
3756 unsigned RF4 : 1;
3757 unsigned RF5 : 1;
3758 unsigned RF6 : 1;
3759 unsigned RF7 : 1;
3761 } __TRISFbits_t;
3763 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
3765 #define _TRISF_TRISF0 0x01
3766 #define _TRISF_RF0 0x01
3767 #define _TRISF_TRISF1 0x02
3768 #define _TRISF_RF1 0x02
3769 #define _TRISF_TRISF2 0x04
3770 #define _TRISF_RF2 0x04
3771 #define _TRISF_TRISF3 0x08
3772 #define _TRISF_RF3 0x08
3773 #define _TRISF_TRISF4 0x10
3774 #define _TRISF_RF4 0x10
3775 #define _TRISF_TRISF5 0x20
3776 #define _TRISF_RF5 0x20
3777 #define _TRISF_TRISF6 0x40
3778 #define _TRISF_RF6 0x40
3779 #define _TRISF_TRISF7 0x80
3780 #define _TRISF_RF7 0x80
3782 //==============================================================================
3785 //==============================================================================
3786 // DDRG Bits
3788 extern __at(0x0F98) __sfr DDRG;
3790 typedef union
3792 struct
3794 unsigned TRISG0 : 1;
3795 unsigned TRISG1 : 1;
3796 unsigned TRISG2 : 1;
3797 unsigned TRISG3 : 1;
3798 unsigned TRISG4 : 1;
3799 unsigned : 1;
3800 unsigned : 1;
3801 unsigned : 1;
3804 struct
3806 unsigned RG0 : 1;
3807 unsigned RG1 : 1;
3808 unsigned RG2 : 1;
3809 unsigned RG3 : 1;
3810 unsigned RG4 : 1;
3811 unsigned : 1;
3812 unsigned : 1;
3813 unsigned : 1;
3816 struct
3818 unsigned TRISG : 5;
3819 unsigned : 3;
3822 struct
3824 unsigned RG : 5;
3825 unsigned : 3;
3827 } __DDRGbits_t;
3829 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
3831 #define _TRISG0 0x01
3832 #define _RG0 0x01
3833 #define _TRISG1 0x02
3834 #define _RG1 0x02
3835 #define _TRISG2 0x04
3836 #define _RG2 0x04
3837 #define _TRISG3 0x08
3838 #define _RG3 0x08
3839 #define _TRISG4 0x10
3840 #define _RG4 0x10
3842 //==============================================================================
3845 //==============================================================================
3846 // TRISG Bits
3848 extern __at(0x0F98) __sfr TRISG;
3850 typedef union
3852 struct
3854 unsigned TRISG0 : 1;
3855 unsigned TRISG1 : 1;
3856 unsigned TRISG2 : 1;
3857 unsigned TRISG3 : 1;
3858 unsigned TRISG4 : 1;
3859 unsigned : 1;
3860 unsigned : 1;
3861 unsigned : 1;
3864 struct
3866 unsigned RG0 : 1;
3867 unsigned RG1 : 1;
3868 unsigned RG2 : 1;
3869 unsigned RG3 : 1;
3870 unsigned RG4 : 1;
3871 unsigned : 1;
3872 unsigned : 1;
3873 unsigned : 1;
3876 struct
3878 unsigned RG : 5;
3879 unsigned : 3;
3882 struct
3884 unsigned TRISG : 5;
3885 unsigned : 3;
3887 } __TRISGbits_t;
3889 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
3891 #define _TRISG_TRISG0 0x01
3892 #define _TRISG_RG0 0x01
3893 #define _TRISG_TRISG1 0x02
3894 #define _TRISG_RG1 0x02
3895 #define _TRISG_TRISG2 0x04
3896 #define _TRISG_RG2 0x04
3897 #define _TRISG_TRISG3 0x08
3898 #define _TRISG_RG3 0x08
3899 #define _TRISG_TRISG4 0x10
3900 #define _TRISG_RG4 0x10
3902 //==============================================================================
3905 //==============================================================================
3906 // DDRH Bits
3908 extern __at(0x0F99) __sfr DDRH;
3910 typedef union
3912 struct
3914 unsigned TRISH0 : 1;
3915 unsigned TRISH1 : 1;
3916 unsigned TRISH2 : 1;
3917 unsigned TRISH3 : 1;
3918 unsigned TRISH4 : 1;
3919 unsigned TRISH5 : 1;
3920 unsigned TRISH6 : 1;
3921 unsigned TRISH7 : 1;
3924 struct
3926 unsigned RH0 : 1;
3927 unsigned RH1 : 1;
3928 unsigned RH2 : 1;
3929 unsigned RH3 : 1;
3930 unsigned RH4 : 1;
3931 unsigned RH5 : 1;
3932 unsigned RH6 : 1;
3933 unsigned RH7 : 1;
3935 } __DDRHbits_t;
3937 extern __at(0x0F99) volatile __DDRHbits_t DDRHbits;
3939 #define _TRISH0 0x01
3940 #define _RH0 0x01
3941 #define _TRISH1 0x02
3942 #define _RH1 0x02
3943 #define _TRISH2 0x04
3944 #define _RH2 0x04
3945 #define _TRISH3 0x08
3946 #define _RH3 0x08
3947 #define _TRISH4 0x10
3948 #define _RH4 0x10
3949 #define _TRISH5 0x20
3950 #define _RH5 0x20
3951 #define _TRISH6 0x40
3952 #define _RH6 0x40
3953 #define _TRISH7 0x80
3954 #define _RH7 0x80
3956 //==============================================================================
3959 //==============================================================================
3960 // TRISH Bits
3962 extern __at(0x0F99) __sfr TRISH;
3964 typedef union
3966 struct
3968 unsigned TRISH0 : 1;
3969 unsigned TRISH1 : 1;
3970 unsigned TRISH2 : 1;
3971 unsigned TRISH3 : 1;
3972 unsigned TRISH4 : 1;
3973 unsigned TRISH5 : 1;
3974 unsigned TRISH6 : 1;
3975 unsigned TRISH7 : 1;
3978 struct
3980 unsigned RH0 : 1;
3981 unsigned RH1 : 1;
3982 unsigned RH2 : 1;
3983 unsigned RH3 : 1;
3984 unsigned RH4 : 1;
3985 unsigned RH5 : 1;
3986 unsigned RH6 : 1;
3987 unsigned RH7 : 1;
3989 } __TRISHbits_t;
3991 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
3993 #define _TRISH_TRISH0 0x01
3994 #define _TRISH_RH0 0x01
3995 #define _TRISH_TRISH1 0x02
3996 #define _TRISH_RH1 0x02
3997 #define _TRISH_TRISH2 0x04
3998 #define _TRISH_RH2 0x04
3999 #define _TRISH_TRISH3 0x08
4000 #define _TRISH_RH3 0x08
4001 #define _TRISH_TRISH4 0x10
4002 #define _TRISH_RH4 0x10
4003 #define _TRISH_TRISH5 0x20
4004 #define _TRISH_RH5 0x20
4005 #define _TRISH_TRISH6 0x40
4006 #define _TRISH_RH6 0x40
4007 #define _TRISH_TRISH7 0x80
4008 #define _TRISH_RH7 0x80
4010 //==============================================================================
4013 //==============================================================================
4014 // DDRJ Bits
4016 extern __at(0x0F9A) __sfr DDRJ;
4018 typedef union
4020 struct
4022 unsigned TRISJ0 : 1;
4023 unsigned TRISJ1 : 1;
4024 unsigned TRISJ2 : 1;
4025 unsigned TRISJ3 : 1;
4026 unsigned TRISJ4 : 1;
4027 unsigned TRISJ5 : 1;
4028 unsigned TRISJ6 : 1;
4029 unsigned TRISJ7 : 1;
4032 struct
4034 unsigned RJ0 : 1;
4035 unsigned RJ1 : 1;
4036 unsigned RJ2 : 1;
4037 unsigned RJ3 : 1;
4038 unsigned RJ4 : 1;
4039 unsigned RJ5 : 1;
4040 unsigned RJ6 : 1;
4041 unsigned RJ7 : 1;
4043 } __DDRJbits_t;
4045 extern __at(0x0F9A) volatile __DDRJbits_t DDRJbits;
4047 #define _TRISJ0 0x01
4048 #define _RJ0 0x01
4049 #define _TRISJ1 0x02
4050 #define _RJ1 0x02
4051 #define _TRISJ2 0x04
4052 #define _RJ2 0x04
4053 #define _TRISJ3 0x08
4054 #define _RJ3 0x08
4055 #define _TRISJ4 0x10
4056 #define _RJ4 0x10
4057 #define _TRISJ5 0x20
4058 #define _RJ5 0x20
4059 #define _TRISJ6 0x40
4060 #define _RJ6 0x40
4061 #define _TRISJ7 0x80
4062 #define _RJ7 0x80
4064 //==============================================================================
4067 //==============================================================================
4068 // TRISJ Bits
4070 extern __at(0x0F9A) __sfr TRISJ;
4072 typedef union
4074 struct
4076 unsigned TRISJ0 : 1;
4077 unsigned TRISJ1 : 1;
4078 unsigned TRISJ2 : 1;
4079 unsigned TRISJ3 : 1;
4080 unsigned TRISJ4 : 1;
4081 unsigned TRISJ5 : 1;
4082 unsigned TRISJ6 : 1;
4083 unsigned TRISJ7 : 1;
4086 struct
4088 unsigned RJ0 : 1;
4089 unsigned RJ1 : 1;
4090 unsigned RJ2 : 1;
4091 unsigned RJ3 : 1;
4092 unsigned RJ4 : 1;
4093 unsigned RJ5 : 1;
4094 unsigned RJ6 : 1;
4095 unsigned RJ7 : 1;
4097 } __TRISJbits_t;
4099 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
4101 #define _TRISJ_TRISJ0 0x01
4102 #define _TRISJ_RJ0 0x01
4103 #define _TRISJ_TRISJ1 0x02
4104 #define _TRISJ_RJ1 0x02
4105 #define _TRISJ_TRISJ2 0x04
4106 #define _TRISJ_RJ2 0x04
4107 #define _TRISJ_TRISJ3 0x08
4108 #define _TRISJ_RJ3 0x08
4109 #define _TRISJ_TRISJ4 0x10
4110 #define _TRISJ_RJ4 0x10
4111 #define _TRISJ_TRISJ5 0x20
4112 #define _TRISJ_RJ5 0x20
4113 #define _TRISJ_TRISJ6 0x40
4114 #define _TRISJ_RJ6 0x40
4115 #define _TRISJ_TRISJ7 0x80
4116 #define _TRISJ_RJ7 0x80
4118 //==============================================================================
4121 //==============================================================================
4122 // OSCTUNE Bits
4124 extern __at(0x0F9B) __sfr OSCTUNE;
4126 typedef union
4128 struct
4130 unsigned TUN0 : 1;
4131 unsigned TUN1 : 1;
4132 unsigned TUN2 : 1;
4133 unsigned TUN3 : 1;
4134 unsigned TUN4 : 1;
4135 unsigned : 1;
4136 unsigned PLLEN : 1;
4137 unsigned INTSRC : 1;
4140 struct
4142 unsigned TUN : 5;
4143 unsigned : 3;
4145 } __OSCTUNEbits_t;
4147 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
4149 #define _TUN0 0x01
4150 #define _TUN1 0x02
4151 #define _TUN2 0x04
4152 #define _TUN3 0x08
4153 #define _TUN4 0x10
4154 #define _PLLEN 0x40
4155 #define _INTSRC 0x80
4157 //==============================================================================
4160 //==============================================================================
4161 // MEMCON Bits
4163 extern __at(0x0F9C) __sfr MEMCON;
4165 typedef struct
4167 unsigned : 1;
4168 unsigned : 1;
4169 unsigned : 1;
4170 unsigned : 1;
4171 unsigned : 1;
4172 unsigned : 1;
4173 unsigned : 1;
4174 unsigned EBDIS : 1;
4175 } __MEMCONbits_t;
4177 extern __at(0x0F9C) volatile __MEMCONbits_t MEMCONbits;
4179 #define _EBDIS 0x80
4181 //==============================================================================
4184 //==============================================================================
4185 // PIE1 Bits
4187 extern __at(0x0F9D) __sfr PIE1;
4189 typedef union
4191 struct
4193 unsigned TMR1IE : 1;
4194 unsigned TMR2IE : 1;
4195 unsigned CCP1IE : 1;
4196 unsigned SSPIE : 1;
4197 unsigned TXIE : 1;
4198 unsigned RCIE : 1;
4199 unsigned ADIE : 1;
4200 unsigned : 1;
4203 struct
4205 unsigned : 1;
4206 unsigned : 1;
4207 unsigned : 1;
4208 unsigned : 1;
4209 unsigned TX1IE : 1;
4210 unsigned RC1IE : 1;
4211 unsigned : 1;
4212 unsigned : 1;
4214 } __PIE1bits_t;
4216 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
4218 #define _TMR1IE 0x01
4219 #define _TMR2IE 0x02
4220 #define _CCP1IE 0x04
4221 #define _SSPIE 0x08
4222 #define _TXIE 0x10
4223 #define _TX1IE 0x10
4224 #define _RCIE 0x20
4225 #define _RC1IE 0x20
4226 #define _ADIE 0x40
4228 //==============================================================================
4231 //==============================================================================
4232 // PIR1 Bits
4234 extern __at(0x0F9E) __sfr PIR1;
4236 typedef union
4238 struct
4240 unsigned TMR1IF : 1;
4241 unsigned TMR2IF : 1;
4242 unsigned CCP1IF : 1;
4243 unsigned SSPIF : 1;
4244 unsigned TXIF : 1;
4245 unsigned RCIF : 1;
4246 unsigned ADIF : 1;
4247 unsigned : 1;
4250 struct
4252 unsigned : 1;
4253 unsigned : 1;
4254 unsigned : 1;
4255 unsigned : 1;
4256 unsigned TX1IF : 1;
4257 unsigned RC1IF : 1;
4258 unsigned : 1;
4259 unsigned : 1;
4261 } __PIR1bits_t;
4263 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4265 #define _TMR1IF 0x01
4266 #define _TMR2IF 0x02
4267 #define _CCP1IF 0x04
4268 #define _SSPIF 0x08
4269 #define _TXIF 0x10
4270 #define _TX1IF 0x10
4271 #define _RCIF 0x20
4272 #define _RC1IF 0x20
4273 #define _ADIF 0x40
4275 //==============================================================================
4278 //==============================================================================
4279 // IPR1 Bits
4281 extern __at(0x0F9F) __sfr IPR1;
4283 typedef union
4285 struct
4287 unsigned TMR1IP : 1;
4288 unsigned TMR2IP : 1;
4289 unsigned CCP1IP : 1;
4290 unsigned SSPIP : 1;
4291 unsigned TXIP : 1;
4292 unsigned RCIP : 1;
4293 unsigned ADIP : 1;
4294 unsigned : 1;
4297 struct
4299 unsigned : 1;
4300 unsigned : 1;
4301 unsigned : 1;
4302 unsigned : 1;
4303 unsigned TX1IP : 1;
4304 unsigned RC1IP : 1;
4305 unsigned : 1;
4306 unsigned : 1;
4308 } __IPR1bits_t;
4310 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4312 #define _TMR1IP 0x01
4313 #define _TMR2IP 0x02
4314 #define _CCP1IP 0x04
4315 #define _SSPIP 0x08
4316 #define _TXIP 0x10
4317 #define _TX1IP 0x10
4318 #define _RCIP 0x20
4319 #define _RC1IP 0x20
4320 #define _ADIP 0x40
4322 //==============================================================================
4325 //==============================================================================
4326 // PIE2 Bits
4328 extern __at(0x0FA0) __sfr PIE2;
4330 typedef union
4332 struct
4334 unsigned CCP2IE : 1;
4335 unsigned TMR3IE : 1;
4336 unsigned HLVDIE : 1;
4337 unsigned BCLIE : 1;
4338 unsigned : 1;
4339 unsigned : 1;
4340 unsigned CMIE : 1;
4341 unsigned OSCFIE : 1;
4344 struct
4346 unsigned : 1;
4347 unsigned : 1;
4348 unsigned LVDIE : 1;
4349 unsigned : 1;
4350 unsigned : 1;
4351 unsigned : 1;
4352 unsigned : 1;
4353 unsigned : 1;
4355 } __PIE2bits_t;
4357 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4359 #define _CCP2IE 0x01
4360 #define _TMR3IE 0x02
4361 #define _HLVDIE 0x04
4362 #define _LVDIE 0x04
4363 #define _BCLIE 0x08
4364 #define _CMIE 0x40
4365 #define _OSCFIE 0x80
4367 //==============================================================================
4370 //==============================================================================
4371 // PIR2 Bits
4373 extern __at(0x0FA1) __sfr PIR2;
4375 typedef union
4377 struct
4379 unsigned CCP2IF : 1;
4380 unsigned TMR3IF : 1;
4381 unsigned HLVDIF : 1;
4382 unsigned BCLIF : 1;
4383 unsigned : 1;
4384 unsigned : 1;
4385 unsigned CMIF : 1;
4386 unsigned OSCFIF : 1;
4389 struct
4391 unsigned : 1;
4392 unsigned : 1;
4393 unsigned LVDIF : 1;
4394 unsigned : 1;
4395 unsigned : 1;
4396 unsigned : 1;
4397 unsigned : 1;
4398 unsigned : 1;
4400 } __PIR2bits_t;
4402 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4404 #define _CCP2IF 0x01
4405 #define _TMR3IF 0x02
4406 #define _HLVDIF 0x04
4407 #define _LVDIF 0x04
4408 #define _BCLIF 0x08
4409 #define _CMIF 0x40
4410 #define _OSCFIF 0x80
4412 //==============================================================================
4415 //==============================================================================
4416 // IPR2 Bits
4418 extern __at(0x0FA2) __sfr IPR2;
4420 typedef union
4422 struct
4424 unsigned CCP2IP : 1;
4425 unsigned TMR3IP : 1;
4426 unsigned HLVDIP : 1;
4427 unsigned BCLIP : 1;
4428 unsigned : 1;
4429 unsigned : 1;
4430 unsigned CMIP : 1;
4431 unsigned OSCFIP : 1;
4434 struct
4436 unsigned : 1;
4437 unsigned : 1;
4438 unsigned LVDIP : 1;
4439 unsigned : 1;
4440 unsigned : 1;
4441 unsigned : 1;
4442 unsigned : 1;
4443 unsigned : 1;
4445 } __IPR2bits_t;
4447 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4449 #define _CCP2IP 0x01
4450 #define _TMR3IP 0x02
4451 #define _HLVDIP 0x04
4452 #define _LVDIP 0x04
4453 #define _BCLIP 0x08
4454 #define _CMIP 0x40
4455 #define _OSCFIP 0x80
4457 //==============================================================================
4460 //==============================================================================
4461 // PIE3 Bits
4463 extern __at(0x0FA3) __sfr PIE3;
4465 typedef struct
4467 unsigned : 1;
4468 unsigned : 1;
4469 unsigned : 1;
4470 unsigned : 1;
4471 unsigned TX2IE : 1;
4472 unsigned RC2IE : 1;
4473 unsigned LCDIE : 1;
4474 unsigned : 1;
4475 } __PIE3bits_t;
4477 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4479 #define _TX2IE 0x10
4480 #define _RC2IE 0x20
4481 #define _LCDIE 0x40
4483 //==============================================================================
4486 //==============================================================================
4487 // PIR3 Bits
4489 extern __at(0x0FA4) __sfr PIR3;
4491 typedef struct
4493 unsigned : 1;
4494 unsigned : 1;
4495 unsigned : 1;
4496 unsigned : 1;
4497 unsigned TX2IF : 1;
4498 unsigned RC2IF : 1;
4499 unsigned LCDIF : 1;
4500 unsigned : 1;
4501 } __PIR3bits_t;
4503 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
4505 #define _TX2IF 0x10
4506 #define _RC2IF 0x20
4507 #define _LCDIF 0x40
4509 //==============================================================================
4512 //==============================================================================
4513 // IPR3 Bits
4515 extern __at(0x0FA5) __sfr IPR3;
4517 typedef struct
4519 unsigned : 1;
4520 unsigned : 1;
4521 unsigned : 1;
4522 unsigned : 1;
4523 unsigned TX2IP : 1;
4524 unsigned RC2IP : 1;
4525 unsigned LCDIP : 1;
4526 unsigned : 1;
4527 } __IPR3bits_t;
4529 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4531 #define _TX2IP 0x10
4532 #define _RC2IP 0x20
4533 #define _LCDIP 0x40
4535 //==============================================================================
4538 //==============================================================================
4539 // RCSTA Bits
4541 extern __at(0x0FAB) __sfr RCSTA;
4543 typedef union
4545 struct
4547 unsigned RX9D : 1;
4548 unsigned OERR : 1;
4549 unsigned FERR : 1;
4550 unsigned ADDEN : 1;
4551 unsigned CREN : 1;
4552 unsigned SREN : 1;
4553 unsigned RX9 : 1;
4554 unsigned SPEN : 1;
4557 struct
4559 unsigned RX9D1 : 1;
4560 unsigned OERR1 : 1;
4561 unsigned FERR1 : 1;
4562 unsigned ADEN : 1;
4563 unsigned CREN1 : 1;
4564 unsigned SREN1 : 1;
4565 unsigned RX91 : 1;
4566 unsigned SPEN1 : 1;
4569 struct
4571 unsigned : 1;
4572 unsigned : 1;
4573 unsigned : 1;
4574 unsigned ADDEN1 : 1;
4575 unsigned : 1;
4576 unsigned : 1;
4577 unsigned : 1;
4578 unsigned : 1;
4580 } __RCSTAbits_t;
4582 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
4584 #define _RX9D 0x01
4585 #define _RX9D1 0x01
4586 #define _OERR 0x02
4587 #define _OERR1 0x02
4588 #define _FERR 0x04
4589 #define _FERR1 0x04
4590 #define _ADDEN 0x08
4591 #define _ADEN 0x08
4592 #define _ADDEN1 0x08
4593 #define _CREN 0x10
4594 #define _CREN1 0x10
4595 #define _SREN 0x20
4596 #define _SREN1 0x20
4597 #define _RX9 0x40
4598 #define _RX91 0x40
4599 #define _SPEN 0x80
4600 #define _SPEN1 0x80
4602 //==============================================================================
4605 //==============================================================================
4606 // RCSTA1 Bits
4608 extern __at(0x0FAB) __sfr RCSTA1;
4610 typedef union
4612 struct
4614 unsigned RX9D : 1;
4615 unsigned OERR : 1;
4616 unsigned FERR : 1;
4617 unsigned ADDEN : 1;
4618 unsigned CREN : 1;
4619 unsigned SREN : 1;
4620 unsigned RX9 : 1;
4621 unsigned SPEN : 1;
4624 struct
4626 unsigned RX9D1 : 1;
4627 unsigned OERR1 : 1;
4628 unsigned FERR1 : 1;
4629 unsigned ADEN : 1;
4630 unsigned CREN1 : 1;
4631 unsigned SREN1 : 1;
4632 unsigned RX91 : 1;
4633 unsigned SPEN1 : 1;
4636 struct
4638 unsigned : 1;
4639 unsigned : 1;
4640 unsigned : 1;
4641 unsigned ADDEN1 : 1;
4642 unsigned : 1;
4643 unsigned : 1;
4644 unsigned : 1;
4645 unsigned : 1;
4647 } __RCSTA1bits_t;
4649 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
4651 #define _RCSTA1_RX9D 0x01
4652 #define _RCSTA1_RX9D1 0x01
4653 #define _RCSTA1_OERR 0x02
4654 #define _RCSTA1_OERR1 0x02
4655 #define _RCSTA1_FERR 0x04
4656 #define _RCSTA1_FERR1 0x04
4657 #define _RCSTA1_ADDEN 0x08
4658 #define _RCSTA1_ADEN 0x08
4659 #define _RCSTA1_ADDEN1 0x08
4660 #define _RCSTA1_CREN 0x10
4661 #define _RCSTA1_CREN1 0x10
4662 #define _RCSTA1_SREN 0x20
4663 #define _RCSTA1_SREN1 0x20
4664 #define _RCSTA1_RX9 0x40
4665 #define _RCSTA1_RX91 0x40
4666 #define _RCSTA1_SPEN 0x80
4667 #define _RCSTA1_SPEN1 0x80
4669 //==============================================================================
4672 //==============================================================================
4673 // TXSTA Bits
4675 extern __at(0x0FAC) __sfr TXSTA;
4677 typedef union
4679 struct
4681 unsigned TX9D : 1;
4682 unsigned TRMT : 1;
4683 unsigned BRGH : 1;
4684 unsigned SENDB : 1;
4685 unsigned SYNC : 1;
4686 unsigned TXEN : 1;
4687 unsigned TX9 : 1;
4688 unsigned CSRC : 1;
4691 struct
4693 unsigned TX9D1 : 1;
4694 unsigned TRMT1 : 1;
4695 unsigned BRGH1 : 1;
4696 unsigned SENDB1 : 1;
4697 unsigned SYNC1 : 1;
4698 unsigned TXEN1 : 1;
4699 unsigned TX91 : 1;
4700 unsigned CSRC1 : 1;
4702 } __TXSTAbits_t;
4704 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
4706 #define _TX9D 0x01
4707 #define _TX9D1 0x01
4708 #define _TRMT 0x02
4709 #define _TRMT1 0x02
4710 #define _BRGH 0x04
4711 #define _BRGH1 0x04
4712 #define _SENDB 0x08
4713 #define _SENDB1 0x08
4714 #define _SYNC 0x10
4715 #define _SYNC1 0x10
4716 #define _TXEN 0x20
4717 #define _TXEN1 0x20
4718 #define _TX9 0x40
4719 #define _TX91 0x40
4720 #define _CSRC 0x80
4721 #define _CSRC1 0x80
4723 //==============================================================================
4726 //==============================================================================
4727 // TXSTA1 Bits
4729 extern __at(0x0FAC) __sfr TXSTA1;
4731 typedef union
4733 struct
4735 unsigned TX9D : 1;
4736 unsigned TRMT : 1;
4737 unsigned BRGH : 1;
4738 unsigned SENDB : 1;
4739 unsigned SYNC : 1;
4740 unsigned TXEN : 1;
4741 unsigned TX9 : 1;
4742 unsigned CSRC : 1;
4745 struct
4747 unsigned TX9D1 : 1;
4748 unsigned TRMT1 : 1;
4749 unsigned BRGH1 : 1;
4750 unsigned SENDB1 : 1;
4751 unsigned SYNC1 : 1;
4752 unsigned TXEN1 : 1;
4753 unsigned TX91 : 1;
4754 unsigned CSRC1 : 1;
4756 } __TXSTA1bits_t;
4758 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
4760 #define _TXSTA1_TX9D 0x01
4761 #define _TXSTA1_TX9D1 0x01
4762 #define _TXSTA1_TRMT 0x02
4763 #define _TXSTA1_TRMT1 0x02
4764 #define _TXSTA1_BRGH 0x04
4765 #define _TXSTA1_BRGH1 0x04
4766 #define _TXSTA1_SENDB 0x08
4767 #define _TXSTA1_SENDB1 0x08
4768 #define _TXSTA1_SYNC 0x10
4769 #define _TXSTA1_SYNC1 0x10
4770 #define _TXSTA1_TXEN 0x20
4771 #define _TXSTA1_TXEN1 0x20
4772 #define _TXSTA1_TX9 0x40
4773 #define _TXSTA1_TX91 0x40
4774 #define _TXSTA1_CSRC 0x80
4775 #define _TXSTA1_CSRC1 0x80
4777 //==============================================================================
4779 extern __at(0x0FAD) __sfr TXREG;
4780 extern __at(0x0FAD) __sfr TXREG1;
4781 extern __at(0x0FAE) __sfr RCREG;
4782 extern __at(0x0FAE) __sfr RCREG1;
4783 extern __at(0x0FAF) __sfr SPBRG;
4784 extern __at(0x0FAF) __sfr SPBRG1;
4786 //==============================================================================
4787 // T3CON Bits
4789 extern __at(0x0FB1) __sfr T3CON;
4791 typedef union
4793 struct
4795 unsigned TMR3ON : 1;
4796 unsigned TMR3CS : 1;
4797 unsigned NOT_T3SYNC : 1;
4798 unsigned T3CCP1 : 1;
4799 unsigned T3CKPS0 : 1;
4800 unsigned T3CKPS1 : 1;
4801 unsigned T3CCP2 : 1;
4802 unsigned RD16 : 1;
4805 struct
4807 unsigned : 1;
4808 unsigned : 1;
4809 unsigned T3SYNC : 1;
4810 unsigned : 1;
4811 unsigned : 1;
4812 unsigned : 1;
4813 unsigned : 1;
4814 unsigned : 1;
4817 struct
4819 unsigned : 1;
4820 unsigned : 1;
4821 unsigned T3INSYNC : 1;
4822 unsigned : 1;
4823 unsigned : 1;
4824 unsigned : 1;
4825 unsigned : 1;
4826 unsigned : 1;
4829 struct
4831 unsigned : 4;
4832 unsigned T3CKPS : 2;
4833 unsigned : 2;
4835 } __T3CONbits_t;
4837 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
4839 #define _T3CON_TMR3ON 0x01
4840 #define _T3CON_TMR3CS 0x02
4841 #define _T3CON_NOT_T3SYNC 0x04
4842 #define _T3CON_T3SYNC 0x04
4843 #define _T3CON_T3INSYNC 0x04
4844 #define _T3CON_T3CCP1 0x08
4845 #define _T3CON_T3CKPS0 0x10
4846 #define _T3CON_T3CKPS1 0x20
4847 #define _T3CON_T3CCP2 0x40
4848 #define _T3CON_RD16 0x80
4850 //==============================================================================
4852 extern __at(0x0FB2) __sfr TMR3;
4853 extern __at(0x0FB2) __sfr TMR3L;
4854 extern __at(0x0FB3) __sfr TMR3H;
4856 //==============================================================================
4857 // CMCON Bits
4859 extern __at(0x0FB4) __sfr CMCON;
4861 typedef union
4863 struct
4865 unsigned CM0 : 1;
4866 unsigned CM1 : 1;
4867 unsigned CM2 : 1;
4868 unsigned CIS : 1;
4869 unsigned C1INV : 1;
4870 unsigned C2INV : 1;
4871 unsigned C1OUT : 1;
4872 unsigned C2OUT : 1;
4875 struct
4877 unsigned CM : 3;
4878 unsigned : 5;
4880 } __CMCONbits_t;
4882 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
4884 #define _CM0 0x01
4885 #define _CM1 0x02
4886 #define _CM2 0x04
4887 #define _CIS 0x08
4888 #define _C1INV 0x10
4889 #define _C2INV 0x20
4890 #define _C1OUT 0x40
4891 #define _C2OUT 0x80
4893 //==============================================================================
4896 //==============================================================================
4897 // CVRCON Bits
4899 extern __at(0x0FB5) __sfr CVRCON;
4901 typedef union
4903 struct
4905 unsigned CVR0 : 1;
4906 unsigned CVR1 : 1;
4907 unsigned CVR2 : 1;
4908 unsigned CVR3 : 1;
4909 unsigned CVRSS : 1;
4910 unsigned CVRR : 1;
4911 unsigned CVROE : 1;
4912 unsigned CVREN : 1;
4915 struct
4917 unsigned : 1;
4918 unsigned : 1;
4919 unsigned : 1;
4920 unsigned : 1;
4921 unsigned CVREF : 1;
4922 unsigned : 1;
4923 unsigned : 1;
4924 unsigned : 1;
4927 struct
4929 unsigned CVR : 4;
4930 unsigned : 4;
4932 } __CVRCONbits_t;
4934 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
4936 #define _CVR0 0x01
4937 #define _CVR1 0x02
4938 #define _CVR2 0x04
4939 #define _CVR3 0x08
4940 #define _CVRSS 0x10
4941 #define _CVREF 0x10
4942 #define _CVRR 0x20
4943 #define _CVROE 0x40
4944 #define _CVREN 0x80
4946 //==============================================================================
4949 //==============================================================================
4950 // CCP2CON Bits
4952 extern __at(0x0FBA) __sfr CCP2CON;
4954 typedef union
4956 struct
4958 unsigned CCP2M0 : 1;
4959 unsigned CCP2M1 : 1;
4960 unsigned CCP2M2 : 1;
4961 unsigned CCP2M3 : 1;
4962 unsigned DCCP2Y : 1;
4963 unsigned DCCP2X : 1;
4964 unsigned : 1;
4965 unsigned : 1;
4968 struct
4970 unsigned : 1;
4971 unsigned : 1;
4972 unsigned : 1;
4973 unsigned : 1;
4974 unsigned CCP2Y : 1;
4975 unsigned CCP2X : 1;
4976 unsigned : 1;
4977 unsigned : 1;
4980 struct
4982 unsigned : 1;
4983 unsigned : 1;
4984 unsigned : 1;
4985 unsigned : 1;
4986 unsigned DC2B0 : 1;
4987 unsigned DC2B1 : 1;
4988 unsigned : 1;
4989 unsigned : 1;
4992 struct
4994 unsigned CCP2M : 4;
4995 unsigned : 4;
4998 struct
5000 unsigned : 4;
5001 unsigned DC2B : 2;
5002 unsigned : 2;
5004 } __CCP2CONbits_t;
5006 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
5008 #define _CCP2M0 0x01
5009 #define _CCP2M1 0x02
5010 #define _CCP2M2 0x04
5011 #define _CCP2M3 0x08
5012 #define _DCCP2Y 0x10
5013 #define _CCP2Y 0x10
5014 #define _DC2B0 0x10
5015 #define _DCCP2X 0x20
5016 #define _CCP2X 0x20
5017 #define _DC2B1 0x20
5019 //==============================================================================
5021 extern __at(0x0FBB) __sfr CCPR2;
5022 extern __at(0x0FBB) __sfr CCPR2L;
5023 extern __at(0x0FBC) __sfr CCPR2H;
5025 //==============================================================================
5026 // CCP1CON Bits
5028 extern __at(0x0FBD) __sfr CCP1CON;
5030 typedef union
5032 struct
5034 unsigned CCP1M0 : 1;
5035 unsigned CCP1M1 : 1;
5036 unsigned CCP1M2 : 1;
5037 unsigned CCP1M3 : 1;
5038 unsigned DCCP1Y : 1;
5039 unsigned DCCP1X : 1;
5040 unsigned : 1;
5041 unsigned : 1;
5044 struct
5046 unsigned : 1;
5047 unsigned : 1;
5048 unsigned : 1;
5049 unsigned : 1;
5050 unsigned CCP1Y : 1;
5051 unsigned CCP1X : 1;
5052 unsigned : 1;
5053 unsigned : 1;
5056 struct
5058 unsigned : 1;
5059 unsigned : 1;
5060 unsigned : 1;
5061 unsigned : 1;
5062 unsigned DC1B0 : 1;
5063 unsigned DC1B1 : 1;
5064 unsigned : 1;
5065 unsigned : 1;
5068 struct
5070 unsigned CCP1M : 4;
5071 unsigned : 4;
5074 struct
5076 unsigned : 4;
5077 unsigned DC1B : 2;
5078 unsigned : 2;
5080 } __CCP1CONbits_t;
5082 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
5084 #define _CCP1M0 0x01
5085 #define _CCP1M1 0x02
5086 #define _CCP1M2 0x04
5087 #define _CCP1M3 0x08
5088 #define _DCCP1Y 0x10
5089 #define _CCP1Y 0x10
5090 #define _DC1B0 0x10
5091 #define _DCCP1X 0x20
5092 #define _CCP1X 0x20
5093 #define _DC1B1 0x20
5095 //==============================================================================
5097 extern __at(0x0FBE) __sfr CCPR1;
5098 extern __at(0x0FBE) __sfr CCPR1L;
5099 extern __at(0x0FBF) __sfr CCPR1H;
5101 //==============================================================================
5102 // ADCON2 Bits
5104 extern __at(0x0FC0) __sfr ADCON2;
5106 typedef union
5108 struct
5110 unsigned ADCS0 : 1;
5111 unsigned ADCS1 : 1;
5112 unsigned ADCS2 : 1;
5113 unsigned ACQT0 : 1;
5114 unsigned ACQT1 : 1;
5115 unsigned ACQT2 : 1;
5116 unsigned : 1;
5117 unsigned ADFM : 1;
5120 struct
5122 unsigned ADCS : 3;
5123 unsigned : 5;
5126 struct
5128 unsigned : 3;
5129 unsigned ACQT : 3;
5130 unsigned : 2;
5132 } __ADCON2bits_t;
5134 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
5136 #define _ADCS0 0x01
5137 #define _ADCS1 0x02
5138 #define _ADCS2 0x04
5139 #define _ACQT0 0x08
5140 #define _ACQT1 0x10
5141 #define _ACQT2 0x20
5142 #define _ADFM 0x80
5144 //==============================================================================
5147 //==============================================================================
5148 // ADCON1 Bits
5150 extern __at(0x0FC1) __sfr ADCON1;
5152 typedef union
5154 struct
5156 unsigned PCFG0 : 1;
5157 unsigned PCFG1 : 1;
5158 unsigned PCFG2 : 1;
5159 unsigned PCFG3 : 1;
5160 unsigned VCFG0 : 1;
5161 unsigned VCFG1 : 1;
5162 unsigned : 1;
5163 unsigned : 1;
5166 struct
5168 unsigned PCFG : 4;
5169 unsigned : 4;
5172 struct
5174 unsigned : 4;
5175 unsigned VCFG : 2;
5176 unsigned : 2;
5178 } __ADCON1bits_t;
5180 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5182 #define _PCFG0 0x01
5183 #define _PCFG1 0x02
5184 #define _PCFG2 0x04
5185 #define _PCFG3 0x08
5186 #define _VCFG0 0x10
5187 #define _VCFG1 0x20
5189 //==============================================================================
5192 //==============================================================================
5193 // ADCON0 Bits
5195 extern __at(0x0FC2) __sfr ADCON0;
5197 typedef union
5199 struct
5201 unsigned ADON : 1;
5202 unsigned GO_NOT_DONE : 1;
5203 unsigned CHS0 : 1;
5204 unsigned CHS1 : 1;
5205 unsigned CHS2 : 1;
5206 unsigned CHS3 : 1;
5207 unsigned : 1;
5208 unsigned : 1;
5211 struct
5213 unsigned : 1;
5214 unsigned GO_DONE : 1;
5215 unsigned : 1;
5216 unsigned : 1;
5217 unsigned : 1;
5218 unsigned : 1;
5219 unsigned : 1;
5220 unsigned : 1;
5223 struct
5225 unsigned : 1;
5226 unsigned DONE : 1;
5227 unsigned : 1;
5228 unsigned : 1;
5229 unsigned : 1;
5230 unsigned : 1;
5231 unsigned : 1;
5232 unsigned : 1;
5235 struct
5237 unsigned : 1;
5238 unsigned GO : 1;
5239 unsigned : 1;
5240 unsigned : 1;
5241 unsigned : 1;
5242 unsigned : 1;
5243 unsigned : 1;
5244 unsigned : 1;
5247 struct
5249 unsigned : 1;
5250 unsigned NOT_DONE : 1;
5251 unsigned : 1;
5252 unsigned : 1;
5253 unsigned : 1;
5254 unsigned : 1;
5255 unsigned : 1;
5256 unsigned : 1;
5259 struct
5261 unsigned : 2;
5262 unsigned CHS : 4;
5263 unsigned : 2;
5265 } __ADCON0bits_t;
5267 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5269 #define _ADON 0x01
5270 #define _GO_NOT_DONE 0x02
5271 #define _GO_DONE 0x02
5272 #define _DONE 0x02
5273 #define _GO 0x02
5274 #define _NOT_DONE 0x02
5275 #define _CHS0 0x04
5276 #define _CHS1 0x08
5277 #define _CHS2 0x10
5278 #define _CHS3 0x20
5280 //==============================================================================
5282 extern __at(0x0FC3) __sfr ADRES;
5283 extern __at(0x0FC3) __sfr ADRESL;
5284 extern __at(0x0FC4) __sfr ADRESH;
5286 //==============================================================================
5287 // SSPCON2 Bits
5289 extern __at(0x0FC5) __sfr SSPCON2;
5291 typedef struct
5293 unsigned SEN : 1;
5294 unsigned RSEN : 1;
5295 unsigned PEN : 1;
5296 unsigned RCEN : 1;
5297 unsigned ACKEN : 1;
5298 unsigned ACKDT : 1;
5299 unsigned ACKSTAT : 1;
5300 unsigned GCEN : 1;
5301 } __SSPCON2bits_t;
5303 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5305 #define _SEN 0x01
5306 #define _RSEN 0x02
5307 #define _PEN 0x04
5308 #define _RCEN 0x08
5309 #define _ACKEN 0x10
5310 #define _ACKDT 0x20
5311 #define _ACKSTAT 0x40
5312 #define _GCEN 0x80
5314 //==============================================================================
5317 //==============================================================================
5318 // SSPCON1 Bits
5320 extern __at(0x0FC6) __sfr SSPCON1;
5322 typedef union
5324 struct
5326 unsigned SSPM0 : 1;
5327 unsigned SSPM1 : 1;
5328 unsigned SSPM2 : 1;
5329 unsigned SSPM3 : 1;
5330 unsigned CKP : 1;
5331 unsigned SSPEN : 1;
5332 unsigned SSPOV : 1;
5333 unsigned WCOL : 1;
5336 struct
5338 unsigned SSPM : 4;
5339 unsigned : 4;
5341 } __SSPCON1bits_t;
5343 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5345 #define _SSPM0 0x01
5346 #define _SSPM1 0x02
5347 #define _SSPM2 0x04
5348 #define _SSPM3 0x08
5349 #define _CKP 0x10
5350 #define _SSPEN 0x20
5351 #define _SSPOV 0x40
5352 #define _WCOL 0x80
5354 //==============================================================================
5357 //==============================================================================
5358 // SSPSTAT Bits
5360 extern __at(0x0FC7) __sfr SSPSTAT;
5362 typedef union
5364 struct
5366 unsigned BF : 1;
5367 unsigned UA : 1;
5368 unsigned R_NOT_W : 1;
5369 unsigned S : 1;
5370 unsigned P : 1;
5371 unsigned D_NOT_A : 1;
5372 unsigned CKE : 1;
5373 unsigned SMP : 1;
5376 struct
5378 unsigned : 1;
5379 unsigned : 1;
5380 unsigned R_W : 1;
5381 unsigned I2C_START : 1;
5382 unsigned I2C_STOP : 1;
5383 unsigned D_A : 1;
5384 unsigned : 1;
5385 unsigned : 1;
5388 struct
5390 unsigned : 1;
5391 unsigned : 1;
5392 unsigned I2C_READ : 1;
5393 unsigned : 1;
5394 unsigned : 1;
5395 unsigned I2C_DAT : 1;
5396 unsigned : 1;
5397 unsigned : 1;
5400 struct
5402 unsigned : 1;
5403 unsigned : 1;
5404 unsigned NOT_W : 1;
5405 unsigned : 1;
5406 unsigned : 1;
5407 unsigned NOT_A : 1;
5408 unsigned : 1;
5409 unsigned : 1;
5412 struct
5414 unsigned : 1;
5415 unsigned : 1;
5416 unsigned NOT_WRITE : 1;
5417 unsigned : 1;
5418 unsigned : 1;
5419 unsigned NOT_ADDRESS : 1;
5420 unsigned : 1;
5421 unsigned : 1;
5424 struct
5426 unsigned : 1;
5427 unsigned : 1;
5428 unsigned READ_WRITE : 1;
5429 unsigned : 1;
5430 unsigned : 1;
5431 unsigned DATA_ADDRESS : 1;
5432 unsigned : 1;
5433 unsigned : 1;
5436 struct
5438 unsigned : 1;
5439 unsigned : 1;
5440 unsigned R : 1;
5441 unsigned : 1;
5442 unsigned : 1;
5443 unsigned D : 1;
5444 unsigned : 1;
5445 unsigned : 1;
5447 } __SSPSTATbits_t;
5449 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5451 #define _BF 0x01
5452 #define _UA 0x02
5453 #define _R_NOT_W 0x04
5454 #define _R_W 0x04
5455 #define _I2C_READ 0x04
5456 #define _NOT_W 0x04
5457 #define _NOT_WRITE 0x04
5458 #define _READ_WRITE 0x04
5459 #define _R 0x04
5460 #define _S 0x08
5461 #define _I2C_START 0x08
5462 #define _P 0x10
5463 #define _I2C_STOP 0x10
5464 #define _D_NOT_A 0x20
5465 #define _D_A 0x20
5466 #define _I2C_DAT 0x20
5467 #define _NOT_A 0x20
5468 #define _NOT_ADDRESS 0x20
5469 #define _DATA_ADDRESS 0x20
5470 #define _D 0x20
5471 #define _CKE 0x40
5472 #define _SMP 0x80
5474 //==============================================================================
5476 extern __at(0x0FC8) __sfr SSPADD;
5477 extern __at(0x0FC9) __sfr SSPBUF;
5479 //==============================================================================
5480 // T2CON Bits
5482 extern __at(0x0FCA) __sfr T2CON;
5484 typedef union
5486 struct
5488 unsigned T2CKPS0 : 1;
5489 unsigned T2CKPS1 : 1;
5490 unsigned TMR2ON : 1;
5491 unsigned T2OUTPS0 : 1;
5492 unsigned T2OUTPS1 : 1;
5493 unsigned T2OUTPS2 : 1;
5494 unsigned T2OUTPS3 : 1;
5495 unsigned : 1;
5498 struct
5500 unsigned T2CKPS : 2;
5501 unsigned : 6;
5504 struct
5506 unsigned : 3;
5507 unsigned T2OUTPS : 4;
5508 unsigned : 1;
5510 } __T2CONbits_t;
5512 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5514 #define _T2CKPS0 0x01
5515 #define _T2CKPS1 0x02
5516 #define _TMR2ON 0x04
5517 #define _T2OUTPS0 0x08
5518 #define _T2OUTPS1 0x10
5519 #define _T2OUTPS2 0x20
5520 #define _T2OUTPS3 0x40
5522 //==============================================================================
5524 extern __at(0x0FCB) __sfr PR2;
5525 extern __at(0x0FCC) __sfr TMR2;
5527 //==============================================================================
5528 // T1CON Bits
5530 extern __at(0x0FCD) __sfr T1CON;
5532 typedef union
5534 struct
5536 unsigned TMR1ON : 1;
5537 unsigned TMR1CS : 1;
5538 unsigned NOT_T1SYNC : 1;
5539 unsigned T1OSCEN : 1;
5540 unsigned T1CKPS0 : 1;
5541 unsigned T1CKPS1 : 1;
5542 unsigned T1RUN : 1;
5543 unsigned RD16 : 1;
5546 struct
5548 unsigned : 1;
5549 unsigned : 1;
5550 unsigned T1INSYNC : 1;
5551 unsigned : 1;
5552 unsigned : 1;
5553 unsigned : 1;
5554 unsigned : 1;
5555 unsigned : 1;
5558 struct
5560 unsigned : 1;
5561 unsigned : 1;
5562 unsigned T1SYNC : 1;
5563 unsigned : 1;
5564 unsigned : 1;
5565 unsigned : 1;
5566 unsigned : 1;
5567 unsigned : 1;
5570 struct
5572 unsigned : 4;
5573 unsigned T1CKPS : 2;
5574 unsigned : 2;
5576 } __T1CONbits_t;
5578 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5580 #define _TMR1ON 0x01
5581 #define _TMR1CS 0x02
5582 #define _NOT_T1SYNC 0x04
5583 #define _T1INSYNC 0x04
5584 #define _T1SYNC 0x04
5585 #define _T1OSCEN 0x08
5586 #define _T1CKPS0 0x10
5587 #define _T1CKPS1 0x20
5588 #define _T1RUN 0x40
5589 #define _RD16 0x80
5591 //==============================================================================
5593 extern __at(0x0FCE) __sfr TMR1;
5594 extern __at(0x0FCE) __sfr TMR1L;
5595 extern __at(0x0FCF) __sfr TMR1H;
5597 //==============================================================================
5598 // RCON Bits
5600 extern __at(0x0FD0) __sfr RCON;
5602 typedef union
5604 struct
5606 unsigned NOT_BOR : 1;
5607 unsigned NOT_POR : 1;
5608 unsigned NOT_PD : 1;
5609 unsigned NOT_TO : 1;
5610 unsigned NOT_RI : 1;
5611 unsigned : 1;
5612 unsigned SBOREN : 1;
5613 unsigned IPEN : 1;
5616 struct
5618 unsigned BOR : 1;
5619 unsigned POR : 1;
5620 unsigned PD : 1;
5621 unsigned TO : 1;
5622 unsigned RI : 1;
5623 unsigned : 1;
5624 unsigned : 1;
5625 unsigned : 1;
5627 } __RCONbits_t;
5629 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5631 #define _NOT_BOR 0x01
5632 #define _BOR 0x01
5633 #define _NOT_POR 0x02
5634 #define _POR 0x02
5635 #define _NOT_PD 0x04
5636 #define _PD 0x04
5637 #define _NOT_TO 0x08
5638 #define _TO 0x08
5639 #define _NOT_RI 0x10
5640 #define _RI 0x10
5641 #define _SBOREN 0x40
5642 #define _IPEN 0x80
5644 //==============================================================================
5647 //==============================================================================
5648 // WDTCON Bits
5650 extern __at(0x0FD1) __sfr WDTCON;
5652 typedef union
5654 struct
5656 unsigned SWDTEN : 1;
5657 unsigned : 1;
5658 unsigned : 1;
5659 unsigned : 1;
5660 unsigned : 1;
5661 unsigned : 1;
5662 unsigned : 1;
5663 unsigned : 1;
5666 struct
5668 unsigned SWDTE : 1;
5669 unsigned : 1;
5670 unsigned : 1;
5671 unsigned : 1;
5672 unsigned : 1;
5673 unsigned : 1;
5674 unsigned : 1;
5675 unsigned : 1;
5677 } __WDTCONbits_t;
5679 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5681 #define _SWDTEN 0x01
5682 #define _SWDTE 0x01
5684 //==============================================================================
5687 //==============================================================================
5688 // HLVDCON Bits
5690 extern __at(0x0FD2) __sfr HLVDCON;
5692 typedef union
5694 struct
5696 unsigned HLVDL0 : 1;
5697 unsigned HLVDL1 : 1;
5698 unsigned HLVDL2 : 1;
5699 unsigned HLVDL3 : 1;
5700 unsigned HLVDEN : 1;
5701 unsigned IRVST : 1;
5702 unsigned : 1;
5703 unsigned VDIRMAG : 1;
5706 struct
5708 unsigned LVDL0 : 1;
5709 unsigned LVDL1 : 1;
5710 unsigned LVDL2 : 1;
5711 unsigned LVDL3 : 1;
5712 unsigned LVDEN : 1;
5713 unsigned BGST : 1;
5714 unsigned : 1;
5715 unsigned : 1;
5718 struct
5720 unsigned LVV0 : 1;
5721 unsigned LVV1 : 1;
5722 unsigned LVV2 : 1;
5723 unsigned LVV3 : 1;
5724 unsigned : 1;
5725 unsigned : 1;
5726 unsigned : 1;
5727 unsigned : 1;
5730 struct
5732 unsigned HLVDL : 4;
5733 unsigned : 4;
5736 struct
5738 unsigned LVDL : 4;
5739 unsigned : 4;
5742 struct
5744 unsigned LVV : 4;
5745 unsigned : 4;
5747 } __HLVDCONbits_t;
5749 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
5751 #define _HLVDL0 0x01
5752 #define _LVDL0 0x01
5753 #define _LVV0 0x01
5754 #define _HLVDL1 0x02
5755 #define _LVDL1 0x02
5756 #define _LVV1 0x02
5757 #define _HLVDL2 0x04
5758 #define _LVDL2 0x04
5759 #define _LVV2 0x04
5760 #define _HLVDL3 0x08
5761 #define _LVDL3 0x08
5762 #define _LVV3 0x08
5763 #define _HLVDEN 0x10
5764 #define _LVDEN 0x10
5765 #define _IRVST 0x20
5766 #define _BGST 0x20
5767 #define _VDIRMAG 0x80
5769 //==============================================================================
5772 //==============================================================================
5773 // OSCCON Bits
5775 extern __at(0x0FD3) __sfr OSCCON;
5777 typedef union
5779 struct
5781 unsigned SCS0 : 1;
5782 unsigned SCS1 : 1;
5783 unsigned IOFS : 1;
5784 unsigned OSTS : 1;
5785 unsigned IRCF0 : 1;
5786 unsigned IRCF1 : 1;
5787 unsigned IRCF2 : 1;
5788 unsigned IDLEN : 1;
5791 struct
5793 unsigned : 1;
5794 unsigned : 1;
5795 unsigned FLTS : 1;
5796 unsigned : 1;
5797 unsigned : 1;
5798 unsigned : 1;
5799 unsigned : 1;
5800 unsigned : 1;
5803 struct
5805 unsigned SCS : 2;
5806 unsigned : 6;
5809 struct
5811 unsigned : 4;
5812 unsigned IRCF : 3;
5813 unsigned : 1;
5815 } __OSCCONbits_t;
5817 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5819 #define _SCS0 0x01
5820 #define _SCS1 0x02
5821 #define _IOFS 0x04
5822 #define _FLTS 0x04
5823 #define _OSTS 0x08
5824 #define _IRCF0 0x10
5825 #define _IRCF1 0x20
5826 #define _IRCF2 0x40
5827 #define _IDLEN 0x80
5829 //==============================================================================
5832 //==============================================================================
5833 // T0CON Bits
5835 extern __at(0x0FD5) __sfr T0CON;
5837 typedef union
5839 struct
5841 unsigned T0PS0 : 1;
5842 unsigned T0PS1 : 1;
5843 unsigned T0PS2 : 1;
5844 unsigned PSA : 1;
5845 unsigned T0SE : 1;
5846 unsigned T0CS : 1;
5847 unsigned T08BIT : 1;
5848 unsigned TMR0ON : 1;
5851 struct
5853 unsigned T0PS : 3;
5854 unsigned : 5;
5856 } __T0CONbits_t;
5858 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5860 #define _T0PS0 0x01
5861 #define _T0PS1 0x02
5862 #define _T0PS2 0x04
5863 #define _PSA 0x08
5864 #define _T0SE 0x10
5865 #define _T0CS 0x20
5866 #define _T08BIT 0x40
5867 #define _TMR0ON 0x80
5869 //==============================================================================
5871 extern __at(0x0FD6) __sfr TMR0;
5872 extern __at(0x0FD6) __sfr TMR0L;
5873 extern __at(0x0FD7) __sfr TMR0H;
5875 //==============================================================================
5876 // STATUS Bits
5878 extern __at(0x0FD8) __sfr STATUS;
5880 typedef struct
5882 unsigned C : 1;
5883 unsigned DC : 1;
5884 unsigned Z : 1;
5885 unsigned OV : 1;
5886 unsigned N : 1;
5887 unsigned : 1;
5888 unsigned : 1;
5889 unsigned : 1;
5890 } __STATUSbits_t;
5892 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5894 #define _C 0x01
5895 #define _DC 0x02
5896 #define _Z 0x04
5897 #define _OV 0x08
5898 #define _N 0x10
5900 //==============================================================================
5902 extern __at(0x0FD9) __sfr FSR2L;
5903 extern __at(0x0FDA) __sfr FSR2H;
5904 extern __at(0x0FDB) __sfr PLUSW2;
5905 extern __at(0x0FDC) __sfr PREINC2;
5906 extern __at(0x0FDD) __sfr POSTDEC2;
5907 extern __at(0x0FDE) __sfr POSTINC2;
5908 extern __at(0x0FDF) __sfr INDF2;
5909 extern __at(0x0FE0) __sfr BSR;
5910 extern __at(0x0FE1) __sfr FSR1L;
5911 extern __at(0x0FE2) __sfr FSR1H;
5912 extern __at(0x0FE3) __sfr PLUSW1;
5913 extern __at(0x0FE4) __sfr PREINC1;
5914 extern __at(0x0FE5) __sfr POSTDEC1;
5915 extern __at(0x0FE6) __sfr POSTINC1;
5916 extern __at(0x0FE7) __sfr INDF1;
5917 extern __at(0x0FE8) __sfr WREG;
5918 extern __at(0x0FE9) __sfr FSR0L;
5919 extern __at(0x0FEA) __sfr FSR0H;
5920 extern __at(0x0FEB) __sfr PLUSW0;
5921 extern __at(0x0FEC) __sfr PREINC0;
5922 extern __at(0x0FED) __sfr POSTDEC0;
5923 extern __at(0x0FEE) __sfr POSTINC0;
5924 extern __at(0x0FEF) __sfr INDF0;
5926 //==============================================================================
5927 // INTCON3 Bits
5929 extern __at(0x0FF0) __sfr INTCON3;
5931 typedef union
5933 struct
5935 unsigned INT1IF : 1;
5936 unsigned INT2IF : 1;
5937 unsigned INT3IF : 1;
5938 unsigned INT1IE : 1;
5939 unsigned INT2IE : 1;
5940 unsigned INT3IE : 1;
5941 unsigned INT1IP : 1;
5942 unsigned INT2IP : 1;
5945 struct
5947 unsigned INT1F : 1;
5948 unsigned INT2F : 1;
5949 unsigned INT3F : 1;
5950 unsigned INT1E : 1;
5951 unsigned INT2E : 1;
5952 unsigned INT3E : 1;
5953 unsigned INT1P : 1;
5954 unsigned INT2P : 1;
5956 } __INTCON3bits_t;
5958 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5960 #define _INT1IF 0x01
5961 #define _INT1F 0x01
5962 #define _INT2IF 0x02
5963 #define _INT2F 0x02
5964 #define _INT3IF 0x04
5965 #define _INT3F 0x04
5966 #define _INT1IE 0x08
5967 #define _INT1E 0x08
5968 #define _INT2IE 0x10
5969 #define _INT2E 0x10
5970 #define _INT3IE 0x20
5971 #define _INT3E 0x20
5972 #define _INT1IP 0x40
5973 #define _INT1P 0x40
5974 #define _INT2IP 0x80
5975 #define _INT2P 0x80
5977 //==============================================================================
5980 //==============================================================================
5981 // INTCON2 Bits
5983 extern __at(0x0FF1) __sfr INTCON2;
5985 typedef union
5987 struct
5989 unsigned RBIP : 1;
5990 unsigned INT3IP : 1;
5991 unsigned TMR0IP : 1;
5992 unsigned INTEDG3 : 1;
5993 unsigned INTEDG2 : 1;
5994 unsigned INTEDG1 : 1;
5995 unsigned INTEDG0 : 1;
5996 unsigned NOT_RBPU : 1;
5999 struct
6001 unsigned : 1;
6002 unsigned INT3P : 1;
6003 unsigned T0IP : 1;
6004 unsigned : 1;
6005 unsigned : 1;
6006 unsigned : 1;
6007 unsigned : 1;
6008 unsigned RBPU : 1;
6010 } __INTCON2bits_t;
6012 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6014 #define _RBIP 0x01
6015 #define _INT3IP 0x02
6016 #define _INT3P 0x02
6017 #define _TMR0IP 0x04
6018 #define _T0IP 0x04
6019 #define _INTEDG3 0x08
6020 #define _INTEDG2 0x10
6021 #define _INTEDG1 0x20
6022 #define _INTEDG0 0x40
6023 #define _NOT_RBPU 0x80
6024 #define _RBPU 0x80
6026 //==============================================================================
6029 //==============================================================================
6030 // INTCON Bits
6032 extern __at(0x0FF2) __sfr INTCON;
6034 typedef union
6036 struct
6038 unsigned RBIF : 1;
6039 unsigned INT0IF : 1;
6040 unsigned TMR0IF : 1;
6041 unsigned RBIE : 1;
6042 unsigned INT0IE : 1;
6043 unsigned TMR0IE : 1;
6044 unsigned PEIE_GIEL : 1;
6045 unsigned GIE_GIEH : 1;
6048 struct
6050 unsigned : 1;
6051 unsigned INT0F : 1;
6052 unsigned T0IF : 1;
6053 unsigned : 1;
6054 unsigned INT0E : 1;
6055 unsigned T0IE : 1;
6056 unsigned PEIE : 1;
6057 unsigned GIE : 1;
6060 struct
6062 unsigned : 1;
6063 unsigned : 1;
6064 unsigned : 1;
6065 unsigned : 1;
6066 unsigned : 1;
6067 unsigned : 1;
6068 unsigned GIEL : 1;
6069 unsigned GIEH : 1;
6071 } __INTCONbits_t;
6073 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6075 #define _RBIF 0x01
6076 #define _INT0IF 0x02
6077 #define _INT0F 0x02
6078 #define _TMR0IF 0x04
6079 #define _T0IF 0x04
6080 #define _RBIE 0x08
6081 #define _INT0IE 0x10
6082 #define _INT0E 0x10
6083 #define _TMR0IE 0x20
6084 #define _T0IE 0x20
6085 #define _PEIE_GIEL 0x40
6086 #define _PEIE 0x40
6087 #define _GIEL 0x40
6088 #define _GIE_GIEH 0x80
6089 #define _GIE 0x80
6090 #define _GIEH 0x80
6092 //==============================================================================
6094 extern __at(0x0FF3) __sfr PROD;
6095 extern __at(0x0FF3) __sfr PRODL;
6096 extern __at(0x0FF4) __sfr PRODH;
6097 extern __at(0x0FF5) __sfr TABLAT;
6098 extern __at(0x0FF6) __sfr TBLPTR;
6099 extern __at(0x0FF6) __sfr TBLPTRL;
6100 extern __at(0x0FF7) __sfr TBLPTRH;
6101 extern __at(0x0FF8) __sfr TBLPTRU;
6102 extern __at(0x0FF9) __sfr PC;
6103 extern __at(0x0FF9) __sfr PCL;
6104 extern __at(0x0FFA) __sfr PCLATH;
6105 extern __at(0x0FFB) __sfr PCLATU;
6107 //==============================================================================
6108 // STKPTR Bits
6110 extern __at(0x0FFC) __sfr STKPTR;
6112 typedef union
6114 struct
6116 unsigned STKPTR0 : 1;
6117 unsigned STKPTR1 : 1;
6118 unsigned STKPTR2 : 1;
6119 unsigned STKPTR3 : 1;
6120 unsigned STKPTR4 : 1;
6121 unsigned : 1;
6122 unsigned STKUNF : 1;
6123 unsigned STKFUL : 1;
6126 struct
6128 unsigned : 1;
6129 unsigned : 1;
6130 unsigned : 1;
6131 unsigned : 1;
6132 unsigned : 1;
6133 unsigned : 1;
6134 unsigned : 1;
6135 unsigned STKOVF : 1;
6138 struct
6140 unsigned STKPTR : 5;
6141 unsigned : 3;
6143 } __STKPTRbits_t;
6145 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6147 #define _STKPTR0 0x01
6148 #define _STKPTR1 0x02
6149 #define _STKPTR2 0x04
6150 #define _STKPTR3 0x08
6151 #define _STKPTR4 0x10
6152 #define _STKUNF 0x40
6153 #define _STKFUL 0x80
6154 #define _STKOVF 0x80
6156 //==============================================================================
6158 extern __at(0x0FFD) __sfr TOS;
6159 extern __at(0x0FFD) __sfr TOSL;
6160 extern __at(0x0FFE) __sfr TOSH;
6161 extern __at(0x0FFF) __sfr TOSU;
6163 //==============================================================================
6165 // Configuration Bits
6167 //==============================================================================
6169 #define __CONFIG1H 0x300001
6170 #define __CONFIG2L 0x300002
6171 #define __CONFIG2H 0x300003
6172 #define __CONFIG3H 0x300005
6173 #define __CONFIG4L 0x300006
6174 #define __CONFIG5L 0x300008
6176 //----------------------------- CONFIG1H Options -------------------------------
6178 #define _OSC_LP_1H 0xF0 // LP oscillator.
6179 #define _OSC_XT_1H 0xF1 // XT oscillator.
6180 #define _OSC_HS_1H 0xF2 // HS oscillator.
6181 #define _OSC_RC_1H 0xF3 // External RC oscillator, CLKO function on RA6.
6182 #define _OSC_EC_1H 0xF4 // EC oscillator, CLKO function on RA6.
6183 #define _OSC_ECIO_1H 0xF5 // EC oscillator, port function on RA6.
6184 #define _OSC_HSPLL_1H 0xF6 // HS oscillator, PLL enabled (clock frequency = 4 x FOSC1).
6185 #define _OSC_RCIO_1H 0xF7 // External RC oscillator, port function on RA6.
6186 #define _OSC_INTIO67_1H 0xF8 // Internal oscillator block, port function on RA6 and RA7.
6187 #define _OSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKO function on RA6, port function on RA7.
6188 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
6189 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
6190 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
6191 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
6193 //----------------------------- CONFIG2L Options -------------------------------
6195 #define _PWRT_ON_2L 0xFE // PWRT enabled.
6196 #define _PWRT_OFF_2L 0xFF // PWRT disabled.
6197 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
6198 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
6199 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
6200 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
6201 #define _BORV_0_2L 0xE7 // VBOR set to 4.6V.
6202 #define _BORV_1_2L 0xEF // VBOR set to 4.3V.
6203 #define _BORV_2_2L 0xF7 // VBOR set to 2.8V.
6204 #define _BORV_3_2L 0xFF // VBOR set to 2.1V.
6206 //----------------------------- CONFIG2H Options -------------------------------
6208 #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
6209 #define _WDT_ON_2H 0xFF // WDT enabled.
6210 #define _WDTPS_1_2H 0xE1 // 1:1.
6211 #define _WDTPS_2_2H 0xE3 // 1:2.
6212 #define _WDTPS_4_2H 0xE5 // 1:4.
6213 #define _WDTPS_8_2H 0xE7 // 1:8.
6214 #define _WDTPS_16_2H 0xE9 // 1:16.
6215 #define _WDTPS_32_2H 0xEB // 1:32.
6216 #define _WDTPS_64_2H 0xED // 1:64.
6217 #define _WDTPS_128_2H 0xEF // 1:128.
6218 #define _WDTPS_256_2H 0xF1 // 1:256.
6219 #define _WDTPS_512_2H 0xF3 // 1:512.
6220 #define _WDTPS_1024_2H 0xF5 // 1:1024.
6221 #define _WDTPS_2048_2H 0xF7 // 1:2048.
6222 #define _WDTPS_4096_2H 0xF9 // 1:4096.
6223 #define _WDTPS_8192_2H 0xFB // 1:8192.
6224 #define _WDTPS_16384_2H 0xFD // 1:16384.
6225 #define _WDTPS_32768_2H 0xFF // 1:32768.
6227 //----------------------------- CONFIG3H Options -------------------------------
6229 #define _CCP2MX_PORTBE_3H 0xFE // CCP2 input/output is multiplexed with RE7.
6230 #define _CCP2MX_PORTC_3H 0xFF // CCP2 input/output is multiplexed with RC1.
6231 #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
6232 #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
6233 #define _MCLRE_OFF_3H 0x7F // RG5 input pin enabled; MCLR disabled.
6234 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RG5 input pin disabled.
6236 //----------------------------- CONFIG4L Options -------------------------------
6238 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
6239 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
6240 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
6241 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
6242 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
6243 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
6245 //----------------------------- CONFIG5L Options -------------------------------
6247 #define _CP_ON_5L 0xFE // Program memory block (000000-003FFFh) code-protected.
6248 #define _CP_OFF_5L 0xFF // Program memory block (000000-003FFFh) not code-protected.
6250 //==============================================================================
6252 #define __DEVID1 0x3FFFFE
6253 #define __DEVID2 0x3FFFFF
6255 #define __IDLOC0 0x200000
6256 #define __IDLOC1 0x200001
6257 #define __IDLOC2 0x200002
6258 #define __IDLOC3 0x200003
6259 #define __IDLOC4 0x200004
6260 #define __IDLOC5 0x200005
6261 #define __IDLOC6 0x200006
6262 #define __IDLOC7 0x200007
6264 #endif // #ifndef __PIC18F8493_H__