Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f66j50.h
blobe57281c0bdcd3a2119271ebd1cae819ab37072c7
1 /*
2 * This declarations of the PIC18F66J50 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:33 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 __PIC18F66J50_H__
26 #define __PIC18F66J50_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
36 extern __at(0x0F40) __sfr PMSTAT;
38 //==============================================================================
39 // PMSTATL Bits
41 extern __at(0x0F40) __sfr PMSTATL;
43 typedef struct
45 unsigned OB0E : 1;
46 unsigned OB1E : 1;
47 unsigned OB2E : 1;
48 unsigned OB3E : 1;
49 unsigned : 1;
50 unsigned : 1;
51 unsigned OBUF : 1;
52 unsigned OBE : 1;
53 } __PMSTATLbits_t;
55 extern __at(0x0F40) volatile __PMSTATLbits_t PMSTATLbits;
57 #define _OB0E 0x01
58 #define _OB1E 0x02
59 #define _OB2E 0x04
60 #define _OB3E 0x08
61 #define _OBUF 0x40
62 #define _OBE 0x80
64 //==============================================================================
67 //==============================================================================
68 // PMSTATH Bits
70 extern __at(0x0F41) __sfr PMSTATH;
72 typedef struct
74 unsigned IB0F : 1;
75 unsigned IB1F : 1;
76 unsigned IB2F : 1;
77 unsigned IB3F : 1;
78 unsigned : 1;
79 unsigned : 1;
80 unsigned IBOV : 1;
81 unsigned IBF : 1;
82 } __PMSTATHbits_t;
84 extern __at(0x0F41) volatile __PMSTATHbits_t PMSTATHbits;
86 #define _IB0F 0x01
87 #define _IB1F 0x02
88 #define _IB2F 0x04
89 #define _IB3F 0x08
90 #define _IBOV 0x40
91 #define _IBF 0x80
93 //==============================================================================
96 //==============================================================================
97 // PMEL Bits
99 extern __at(0x0F42) __sfr PMEL;
101 typedef struct
103 unsigned PTEN0 : 1;
104 unsigned PTEN1 : 1;
105 unsigned PTEN2 : 1;
106 unsigned PTEN3 : 1;
107 unsigned PTEN4 : 1;
108 unsigned PTEN5 : 1;
109 unsigned PTEN6 : 1;
110 unsigned PTEN7 : 1;
111 } __PMELbits_t;
113 extern __at(0x0F42) volatile __PMELbits_t PMELbits;
115 #define _PTEN0 0x01
116 #define _PTEN1 0x02
117 #define _PTEN2 0x04
118 #define _PTEN3 0x08
119 #define _PTEN4 0x10
120 #define _PTEN5 0x20
121 #define _PTEN6 0x40
122 #define _PTEN7 0x80
124 //==============================================================================
126 extern __at(0x0F42) __sfr PMEN;
128 //==============================================================================
129 // PMEH Bits
131 extern __at(0x0F43) __sfr PMEH;
133 typedef struct
135 unsigned PTEN8 : 1;
136 unsigned PTEN9 : 1;
137 unsigned PTEN10 : 1;
138 unsigned PTEN11 : 1;
139 unsigned PTEN12 : 1;
140 unsigned PTEN13 : 1;
141 unsigned PTEN14 : 1;
142 unsigned PTEN15 : 1;
143 } __PMEHbits_t;
145 extern __at(0x0F43) volatile __PMEHbits_t PMEHbits;
147 #define _PTEN8 0x01
148 #define _PTEN9 0x02
149 #define _PTEN10 0x04
150 #define _PTEN11 0x08
151 #define _PTEN12 0x10
152 #define _PTEN13 0x20
153 #define _PTEN14 0x40
154 #define _PTEN15 0x80
156 //==============================================================================
158 extern __at(0x0F44) __sfr PMDIN2;
159 extern __at(0x0F44) __sfr PMDIN2L;
160 extern __at(0x0F45) __sfr PMDIN2H;
161 extern __at(0x0F46) __sfr PMDOUT2;
162 extern __at(0x0F46) __sfr PMDOUT2L;
163 extern __at(0x0F47) __sfr PMDOUT2H;
164 extern __at(0x0F48) __sfr PMMODE;
166 //==============================================================================
167 // PMMODEL Bits
169 extern __at(0x0F48) __sfr PMMODEL;
171 typedef union
173 struct
175 unsigned WAITE0 : 1;
176 unsigned WAITE1 : 1;
177 unsigned WAITM0 : 1;
178 unsigned WAITM1 : 1;
179 unsigned WAITM2 : 1;
180 unsigned WAITM3 : 1;
181 unsigned WAITB0 : 1;
182 unsigned WAITB1 : 1;
185 struct
187 unsigned WAITE : 2;
188 unsigned : 6;
191 struct
193 unsigned : 2;
194 unsigned WAITM : 4;
195 unsigned : 2;
198 struct
200 unsigned : 6;
201 unsigned WAITB : 2;
203 } __PMMODELbits_t;
205 extern __at(0x0F48) volatile __PMMODELbits_t PMMODELbits;
207 #define _WAITE0 0x01
208 #define _WAITE1 0x02
209 #define _WAITM0 0x04
210 #define _WAITM1 0x08
211 #define _WAITM2 0x10
212 #define _WAITM3 0x20
213 #define _WAITB0 0x40
214 #define _WAITB1 0x80
216 //==============================================================================
219 //==============================================================================
220 // PMMODEH Bits
222 extern __at(0x0F49) __sfr PMMODEH;
224 typedef union
226 struct
228 unsigned MODE0 : 1;
229 unsigned MODE1 : 1;
230 unsigned MODE16 : 1;
231 unsigned INCM0 : 1;
232 unsigned INCM1 : 1;
233 unsigned IRQM0 : 1;
234 unsigned IRQM1 : 1;
235 unsigned BUSY : 1;
238 struct
240 unsigned : 3;
241 unsigned INCM : 2;
242 unsigned : 3;
245 struct
247 unsigned : 5;
248 unsigned IRQM : 2;
249 unsigned : 1;
251 } __PMMODEHbits_t;
253 extern __at(0x0F49) volatile __PMMODEHbits_t PMMODEHbits;
255 #define _MODE0 0x01
256 #define _MODE1 0x02
257 #define _MODE16 0x04
258 #define _INCM0 0x08
259 #define _INCM1 0x10
260 #define _IRQM0 0x20
261 #define _IRQM1 0x40
262 #define _BUSY 0x80
264 //==============================================================================
266 extern __at(0x0F4A) __sfr PMCON;
268 //==============================================================================
269 // PMCONL Bits
271 extern __at(0x0F4A) __sfr PMCONL;
273 typedef union
275 struct
277 unsigned RDSP : 1;
278 unsigned WRSP : 1;
279 unsigned BEP : 1;
280 unsigned CS1P : 1;
281 unsigned CS2P : 1;
282 unsigned ALP : 1;
283 unsigned CSF0 : 1;
284 unsigned CSF1 : 1;
287 struct
289 unsigned : 6;
290 unsigned CSF : 2;
292 } __PMCONLbits_t;
294 extern __at(0x0F4A) volatile __PMCONLbits_t PMCONLbits;
296 #define _RDSP 0x01
297 #define _WRSP 0x02
298 #define _BEP 0x04
299 #define _CS1P 0x08
300 #define _CS2P 0x10
301 #define _ALP 0x20
302 #define _CSF0 0x40
303 #define _CSF1 0x80
305 //==============================================================================
308 //==============================================================================
309 // PMCONH Bits
311 extern __at(0x0F4B) __sfr PMCONH;
313 typedef union
315 struct
317 unsigned PTRDEN : 1;
318 unsigned PTWREN : 1;
319 unsigned PTBEEN : 1;
320 unsigned ADRMUX0 : 1;
321 unsigned ADRMUX1 : 1;
322 unsigned PSIDL : 1;
323 unsigned : 1;
324 unsigned PMPEN : 1;
327 struct
329 unsigned : 3;
330 unsigned ADRMUX : 2;
331 unsigned : 3;
333 } __PMCONHbits_t;
335 extern __at(0x0F4B) volatile __PMCONHbits_t PMCONHbits;
337 #define _PTRDEN 0x01
338 #define _PTWREN 0x02
339 #define _PTBEEN 0x04
340 #define _ADRMUX0 0x08
341 #define _ADRMUX1 0x10
342 #define _PSIDL 0x20
343 #define _PMPEN 0x80
345 //==============================================================================
348 //==============================================================================
349 // UEP0 Bits
351 extern __at(0x0F4C) __sfr UEP0;
353 typedef struct
355 unsigned EPSTALL : 1;
356 unsigned EPINEN : 1;
357 unsigned EPOUTEN : 1;
358 unsigned EPCONDIS : 1;
359 unsigned EPHSHK : 1;
360 unsigned : 1;
361 unsigned : 1;
362 unsigned : 1;
363 } __UEP0bits_t;
365 extern __at(0x0F4C) volatile __UEP0bits_t UEP0bits;
367 #define _EPSTALL 0x01
368 #define _EPINEN 0x02
369 #define _EPOUTEN 0x04
370 #define _EPCONDIS 0x08
371 #define _EPHSHK 0x10
373 //==============================================================================
376 //==============================================================================
377 // UEP1 Bits
379 extern __at(0x0F4D) __sfr UEP1;
381 typedef struct
383 unsigned EPSTALL : 1;
384 unsigned EPINEN : 1;
385 unsigned EPOUTEN : 1;
386 unsigned EPCONDIS : 1;
387 unsigned EPHSHK : 1;
388 unsigned : 1;
389 unsigned : 1;
390 unsigned : 1;
391 } __UEP1bits_t;
393 extern __at(0x0F4D) volatile __UEP1bits_t UEP1bits;
395 #define _UEP1_EPSTALL 0x01
396 #define _UEP1_EPINEN 0x02
397 #define _UEP1_EPOUTEN 0x04
398 #define _UEP1_EPCONDIS 0x08
399 #define _UEP1_EPHSHK 0x10
401 //==============================================================================
404 //==============================================================================
405 // UEP2 Bits
407 extern __at(0x0F4E) __sfr UEP2;
409 typedef struct
411 unsigned EPSTALL : 1;
412 unsigned EPINEN : 1;
413 unsigned EPOUTEN : 1;
414 unsigned EPCONDIS : 1;
415 unsigned EPHSHK : 1;
416 unsigned : 1;
417 unsigned : 1;
418 unsigned : 1;
419 } __UEP2bits_t;
421 extern __at(0x0F4E) volatile __UEP2bits_t UEP2bits;
423 #define _UEP2_EPSTALL 0x01
424 #define _UEP2_EPINEN 0x02
425 #define _UEP2_EPOUTEN 0x04
426 #define _UEP2_EPCONDIS 0x08
427 #define _UEP2_EPHSHK 0x10
429 //==============================================================================
432 //==============================================================================
433 // UEP3 Bits
435 extern __at(0x0F4F) __sfr UEP3;
437 typedef struct
439 unsigned EPSTALL : 1;
440 unsigned EPINEN : 1;
441 unsigned EPOUTEN : 1;
442 unsigned EPCONDIS : 1;
443 unsigned EPHSHK : 1;
444 unsigned : 1;
445 unsigned : 1;
446 unsigned : 1;
447 } __UEP3bits_t;
449 extern __at(0x0F4F) volatile __UEP3bits_t UEP3bits;
451 #define _UEP3_EPSTALL 0x01
452 #define _UEP3_EPINEN 0x02
453 #define _UEP3_EPOUTEN 0x04
454 #define _UEP3_EPCONDIS 0x08
455 #define _UEP3_EPHSHK 0x10
457 //==============================================================================
460 //==============================================================================
461 // UEP4 Bits
463 extern __at(0x0F50) __sfr UEP4;
465 typedef struct
467 unsigned EPSTALL : 1;
468 unsigned EPINEN : 1;
469 unsigned EPOUTEN : 1;
470 unsigned EPCONDIS : 1;
471 unsigned EPHSHK : 1;
472 unsigned : 1;
473 unsigned : 1;
474 unsigned : 1;
475 } __UEP4bits_t;
477 extern __at(0x0F50) volatile __UEP4bits_t UEP4bits;
479 #define _UEP4_EPSTALL 0x01
480 #define _UEP4_EPINEN 0x02
481 #define _UEP4_EPOUTEN 0x04
482 #define _UEP4_EPCONDIS 0x08
483 #define _UEP4_EPHSHK 0x10
485 //==============================================================================
488 //==============================================================================
489 // UEP5 Bits
491 extern __at(0x0F51) __sfr UEP5;
493 typedef struct
495 unsigned EPSTALL : 1;
496 unsigned EPINEN : 1;
497 unsigned EPOUTEN : 1;
498 unsigned EPCONDIS : 1;
499 unsigned EPHSHK : 1;
500 unsigned : 1;
501 unsigned : 1;
502 unsigned : 1;
503 } __UEP5bits_t;
505 extern __at(0x0F51) volatile __UEP5bits_t UEP5bits;
507 #define _UEP5_EPSTALL 0x01
508 #define _UEP5_EPINEN 0x02
509 #define _UEP5_EPOUTEN 0x04
510 #define _UEP5_EPCONDIS 0x08
511 #define _UEP5_EPHSHK 0x10
513 //==============================================================================
516 //==============================================================================
517 // UEP6 Bits
519 extern __at(0x0F52) __sfr UEP6;
521 typedef struct
523 unsigned EPSTALL : 1;
524 unsigned EPINEN : 1;
525 unsigned EPOUTEN : 1;
526 unsigned EPCONDIS : 1;
527 unsigned EPHSHK : 1;
528 unsigned : 1;
529 unsigned : 1;
530 unsigned : 1;
531 } __UEP6bits_t;
533 extern __at(0x0F52) volatile __UEP6bits_t UEP6bits;
535 #define _UEP6_EPSTALL 0x01
536 #define _UEP6_EPINEN 0x02
537 #define _UEP6_EPOUTEN 0x04
538 #define _UEP6_EPCONDIS 0x08
539 #define _UEP6_EPHSHK 0x10
541 //==============================================================================
544 //==============================================================================
545 // UEP7 Bits
547 extern __at(0x0F53) __sfr UEP7;
549 typedef struct
551 unsigned EPSTALL : 1;
552 unsigned EPINEN : 1;
553 unsigned EPOUTEN : 1;
554 unsigned EPCONDIS : 1;
555 unsigned EPHSHK : 1;
556 unsigned : 1;
557 unsigned : 1;
558 unsigned : 1;
559 } __UEP7bits_t;
561 extern __at(0x0F53) volatile __UEP7bits_t UEP7bits;
563 #define _UEP7_EPSTALL 0x01
564 #define _UEP7_EPINEN 0x02
565 #define _UEP7_EPOUTEN 0x04
566 #define _UEP7_EPCONDIS 0x08
567 #define _UEP7_EPHSHK 0x10
569 //==============================================================================
572 //==============================================================================
573 // UEP8 Bits
575 extern __at(0x0F54) __sfr UEP8;
577 typedef struct
579 unsigned EPSTALL : 1;
580 unsigned EPINEN : 1;
581 unsigned EPOUTEN : 1;
582 unsigned EPCONDIS : 1;
583 unsigned EPHSHK : 1;
584 unsigned : 1;
585 unsigned : 1;
586 unsigned : 1;
587 } __UEP8bits_t;
589 extern __at(0x0F54) volatile __UEP8bits_t UEP8bits;
591 #define _UEP8_EPSTALL 0x01
592 #define _UEP8_EPINEN 0x02
593 #define _UEP8_EPOUTEN 0x04
594 #define _UEP8_EPCONDIS 0x08
595 #define _UEP8_EPHSHK 0x10
597 //==============================================================================
600 //==============================================================================
601 // UEP9 Bits
603 extern __at(0x0F55) __sfr UEP9;
605 typedef struct
607 unsigned EPSTALL : 1;
608 unsigned EPINEN : 1;
609 unsigned EPOUTEN : 1;
610 unsigned EPCONDIS : 1;
611 unsigned EPHSHK : 1;
612 unsigned : 1;
613 unsigned : 1;
614 unsigned : 1;
615 } __UEP9bits_t;
617 extern __at(0x0F55) volatile __UEP9bits_t UEP9bits;
619 #define _UEP9_EPSTALL 0x01
620 #define _UEP9_EPINEN 0x02
621 #define _UEP9_EPOUTEN 0x04
622 #define _UEP9_EPCONDIS 0x08
623 #define _UEP9_EPHSHK 0x10
625 //==============================================================================
628 //==============================================================================
629 // UEP10 Bits
631 extern __at(0x0F56) __sfr UEP10;
633 typedef struct
635 unsigned EPSTALL : 1;
636 unsigned EPINEN : 1;
637 unsigned EPOUTEN : 1;
638 unsigned EPCONDIS : 1;
639 unsigned EPHSHK : 1;
640 unsigned : 1;
641 unsigned : 1;
642 unsigned : 1;
643 } __UEP10bits_t;
645 extern __at(0x0F56) volatile __UEP10bits_t UEP10bits;
647 #define _UEP10_EPSTALL 0x01
648 #define _UEP10_EPINEN 0x02
649 #define _UEP10_EPOUTEN 0x04
650 #define _UEP10_EPCONDIS 0x08
651 #define _UEP10_EPHSHK 0x10
653 //==============================================================================
656 //==============================================================================
657 // UEP11 Bits
659 extern __at(0x0F57) __sfr UEP11;
661 typedef struct
663 unsigned EPSTALL : 1;
664 unsigned EPINEN : 1;
665 unsigned EPOUTEN : 1;
666 unsigned EPCONDIS : 1;
667 unsigned EPHSHK : 1;
668 unsigned : 1;
669 unsigned : 1;
670 unsigned : 1;
671 } __UEP11bits_t;
673 extern __at(0x0F57) volatile __UEP11bits_t UEP11bits;
675 #define _UEP11_EPSTALL 0x01
676 #define _UEP11_EPINEN 0x02
677 #define _UEP11_EPOUTEN 0x04
678 #define _UEP11_EPCONDIS 0x08
679 #define _UEP11_EPHSHK 0x10
681 //==============================================================================
684 //==============================================================================
685 // UEP12 Bits
687 extern __at(0x0F58) __sfr UEP12;
689 typedef struct
691 unsigned EPSTALL : 1;
692 unsigned EPINEN : 1;
693 unsigned EPOUTEN : 1;
694 unsigned EPCONDIS : 1;
695 unsigned EPHSHK : 1;
696 unsigned : 1;
697 unsigned : 1;
698 unsigned : 1;
699 } __UEP12bits_t;
701 extern __at(0x0F58) volatile __UEP12bits_t UEP12bits;
703 #define _UEP12_EPSTALL 0x01
704 #define _UEP12_EPINEN 0x02
705 #define _UEP12_EPOUTEN 0x04
706 #define _UEP12_EPCONDIS 0x08
707 #define _UEP12_EPHSHK 0x10
709 //==============================================================================
712 //==============================================================================
713 // UEP13 Bits
715 extern __at(0x0F59) __sfr UEP13;
717 typedef struct
719 unsigned EPSTALL : 1;
720 unsigned EPINEN : 1;
721 unsigned EPOUTEN : 1;
722 unsigned EPCONDIS : 1;
723 unsigned EPHSHK : 1;
724 unsigned : 1;
725 unsigned : 1;
726 unsigned : 1;
727 } __UEP13bits_t;
729 extern __at(0x0F59) volatile __UEP13bits_t UEP13bits;
731 #define _UEP13_EPSTALL 0x01
732 #define _UEP13_EPINEN 0x02
733 #define _UEP13_EPOUTEN 0x04
734 #define _UEP13_EPCONDIS 0x08
735 #define _UEP13_EPHSHK 0x10
737 //==============================================================================
740 //==============================================================================
741 // UEP14 Bits
743 extern __at(0x0F5A) __sfr UEP14;
745 typedef struct
747 unsigned EPSTALL : 1;
748 unsigned EPINEN : 1;
749 unsigned EPOUTEN : 1;
750 unsigned EPCONDIS : 1;
751 unsigned EPHSHK : 1;
752 unsigned : 1;
753 unsigned : 1;
754 unsigned : 1;
755 } __UEP14bits_t;
757 extern __at(0x0F5A) volatile __UEP14bits_t UEP14bits;
759 #define _UEP14_EPSTALL 0x01
760 #define _UEP14_EPINEN 0x02
761 #define _UEP14_EPOUTEN 0x04
762 #define _UEP14_EPCONDIS 0x08
763 #define _UEP14_EPHSHK 0x10
765 //==============================================================================
768 //==============================================================================
769 // UEP15 Bits
771 extern __at(0x0F5B) __sfr UEP15;
773 typedef struct
775 unsigned EPSTALL : 1;
776 unsigned EPINEN : 1;
777 unsigned EPOUTEN : 1;
778 unsigned EPCONDIS : 1;
779 unsigned EPHSHK : 1;
780 unsigned : 1;
781 unsigned : 1;
782 unsigned : 1;
783 } __UEP15bits_t;
785 extern __at(0x0F5B) volatile __UEP15bits_t UEP15bits;
787 #define _UEP15_EPSTALL 0x01
788 #define _UEP15_EPINEN 0x02
789 #define _UEP15_EPOUTEN 0x04
790 #define _UEP15_EPCONDIS 0x08
791 #define _UEP15_EPHSHK 0x10
793 //==============================================================================
796 //==============================================================================
797 // UIE Bits
799 extern __at(0x0F5C) __sfr UIE;
801 typedef struct
803 unsigned URSTIE : 1;
804 unsigned UERRIE : 1;
805 unsigned ACTVIE : 1;
806 unsigned TRNIE : 1;
807 unsigned IDLEIE : 1;
808 unsigned STALLIE : 1;
809 unsigned SOFIE : 1;
810 unsigned : 1;
811 } __UIEbits_t;
813 extern __at(0x0F5C) volatile __UIEbits_t UIEbits;
815 #define _URSTIE 0x01
816 #define _UERRIE 0x02
817 #define _ACTVIE 0x04
818 #define _TRNIE 0x08
819 #define _IDLEIE 0x10
820 #define _STALLIE 0x20
821 #define _SOFIE 0x40
823 //==============================================================================
826 //==============================================================================
827 // UEIE Bits
829 extern __at(0x0F5D) __sfr UEIE;
831 typedef struct
833 unsigned PIDEE : 1;
834 unsigned CRC5EE : 1;
835 unsigned CRC16EE : 1;
836 unsigned DFN8EE : 1;
837 unsigned BTOEE : 1;
838 unsigned : 1;
839 unsigned : 1;
840 unsigned BTSEE : 1;
841 } __UEIEbits_t;
843 extern __at(0x0F5D) volatile __UEIEbits_t UEIEbits;
845 #define _PIDEE 0x01
846 #define _CRC5EE 0x02
847 #define _CRC16EE 0x04
848 #define _DFN8EE 0x08
849 #define _BTOEE 0x10
850 #define _BTSEE 0x80
852 //==============================================================================
855 //==============================================================================
856 // UADDR Bits
858 extern __at(0x0F5E) __sfr UADDR;
860 typedef union
862 struct
864 unsigned ADDR0 : 1;
865 unsigned ADDR1 : 1;
866 unsigned ADDR2 : 1;
867 unsigned ADDR3 : 1;
868 unsigned ADDR4 : 1;
869 unsigned ADDR5 : 1;
870 unsigned ADDR6 : 1;
871 unsigned : 1;
874 struct
876 unsigned ADDR : 7;
877 unsigned : 1;
879 } __UADDRbits_t;
881 extern __at(0x0F5E) volatile __UADDRbits_t UADDRbits;
883 #define _ADDR0 0x01
884 #define _ADDR1 0x02
885 #define _ADDR2 0x04
886 #define _ADDR3 0x08
887 #define _ADDR4 0x10
888 #define _ADDR5 0x20
889 #define _ADDR6 0x40
891 //==============================================================================
894 //==============================================================================
895 // UCFG Bits
897 extern __at(0x0F5F) __sfr UCFG;
899 typedef union
901 struct
903 unsigned PPB0 : 1;
904 unsigned PPB1 : 1;
905 unsigned FSEN : 1;
906 unsigned UTRDIS : 1;
907 unsigned UPUEN : 1;
908 unsigned : 1;
909 unsigned UOEMON : 1;
910 unsigned UTEYE : 1;
913 struct
915 unsigned PPB : 2;
916 unsigned : 6;
918 } __UCFGbits_t;
920 extern __at(0x0F5F) volatile __UCFGbits_t UCFGbits;
922 #define _PPB0 0x01
923 #define _PPB1 0x02
924 #define _FSEN 0x04
925 #define _UTRDIS 0x08
926 #define _UPUEN 0x10
927 #define _UOEMON 0x40
928 #define _UTEYE 0x80
930 //==============================================================================
932 extern __at(0x0F60) __sfr UFRM;
934 //==============================================================================
935 // UFRML Bits
937 extern __at(0x0F60) __sfr UFRML;
939 typedef struct
941 unsigned FRM0 : 1;
942 unsigned FRM1 : 1;
943 unsigned FRM2 : 1;
944 unsigned FRM3 : 1;
945 unsigned FRM4 : 1;
946 unsigned FRM5 : 1;
947 unsigned FRM6 : 1;
948 unsigned FRM7 : 1;
949 } __UFRMLbits_t;
951 extern __at(0x0F60) volatile __UFRMLbits_t UFRMLbits;
953 #define _FRM0 0x01
954 #define _FRM1 0x02
955 #define _FRM2 0x04
956 #define _FRM3 0x08
957 #define _FRM4 0x10
958 #define _FRM5 0x20
959 #define _FRM6 0x40
960 #define _FRM7 0x80
962 //==============================================================================
965 //==============================================================================
966 // UFRMH Bits
968 extern __at(0x0F61) __sfr UFRMH;
970 typedef struct
972 unsigned FRM8 : 1;
973 unsigned FRM9 : 1;
974 unsigned FRM10 : 1;
975 unsigned : 1;
976 unsigned : 1;
977 unsigned : 1;
978 unsigned : 1;
979 unsigned : 1;
980 } __UFRMHbits_t;
982 extern __at(0x0F61) volatile __UFRMHbits_t UFRMHbits;
984 #define _FRM8 0x01
985 #define _FRM9 0x02
986 #define _FRM10 0x04
988 //==============================================================================
991 //==============================================================================
992 // UIR Bits
994 extern __at(0x0F62) __sfr UIR;
996 typedef struct
998 unsigned URSTIF : 1;
999 unsigned UERRIF : 1;
1000 unsigned ACTVIF : 1;
1001 unsigned TRNIF : 1;
1002 unsigned IDLEIF : 1;
1003 unsigned STALLIF : 1;
1004 unsigned SOFIF : 1;
1005 unsigned : 1;
1006 } __UIRbits_t;
1008 extern __at(0x0F62) volatile __UIRbits_t UIRbits;
1010 #define _URSTIF 0x01
1011 #define _UERRIF 0x02
1012 #define _ACTVIF 0x04
1013 #define _TRNIF 0x08
1014 #define _IDLEIF 0x10
1015 #define _STALLIF 0x20
1016 #define _SOFIF 0x40
1018 //==============================================================================
1021 //==============================================================================
1022 // UEIR Bits
1024 extern __at(0x0F63) __sfr UEIR;
1026 typedef struct
1028 unsigned PIDEF : 1;
1029 unsigned CRC5EF : 1;
1030 unsigned CRC16EF : 1;
1031 unsigned DFN8EF : 1;
1032 unsigned BTOEF : 1;
1033 unsigned : 1;
1034 unsigned : 1;
1035 unsigned BTSEF : 1;
1036 } __UEIRbits_t;
1038 extern __at(0x0F63) volatile __UEIRbits_t UEIRbits;
1040 #define _PIDEF 0x01
1041 #define _CRC5EF 0x02
1042 #define _CRC16EF 0x04
1043 #define _DFN8EF 0x08
1044 #define _BTOEF 0x10
1045 #define _BTSEF 0x80
1047 //==============================================================================
1050 //==============================================================================
1051 // USTAT Bits
1053 extern __at(0x0F64) __sfr USTAT;
1055 typedef union
1057 struct
1059 unsigned : 1;
1060 unsigned PPBI : 1;
1061 unsigned DIR : 1;
1062 unsigned ENDP0 : 1;
1063 unsigned ENDP1 : 1;
1064 unsigned ENDP2 : 1;
1065 unsigned ENDP3 : 1;
1066 unsigned : 1;
1069 struct
1071 unsigned : 3;
1072 unsigned ENDP : 4;
1073 unsigned : 1;
1075 } __USTATbits_t;
1077 extern __at(0x0F64) volatile __USTATbits_t USTATbits;
1079 #define _PPBI 0x02
1080 #define _DIR 0x04
1081 #define _ENDP0 0x08
1082 #define _ENDP1 0x10
1083 #define _ENDP2 0x20
1084 #define _ENDP3 0x40
1086 //==============================================================================
1089 //==============================================================================
1090 // UCON Bits
1092 extern __at(0x0F65) __sfr UCON;
1094 typedef struct
1096 unsigned : 1;
1097 unsigned SUSPND : 1;
1098 unsigned RESUME : 1;
1099 unsigned USBEN : 1;
1100 unsigned PKTDIS : 1;
1101 unsigned SE0 : 1;
1102 unsigned PPBRST : 1;
1103 unsigned : 1;
1104 } __UCONbits_t;
1106 extern __at(0x0F65) volatile __UCONbits_t UCONbits;
1108 #define _SUSPND 0x02
1109 #define _RESUME 0x04
1110 #define _USBEN 0x08
1111 #define _PKTDIS 0x10
1112 #define _SE0 0x20
1113 #define _PPBRST 0x40
1115 //==============================================================================
1117 extern __at(0x0F66) __sfr PMDIN1;
1118 extern __at(0x0F66) __sfr PMDIN1L;
1119 extern __at(0x0F67) __sfr PMDIN1H;
1120 extern __at(0x0F68) __sfr PMADDR;
1121 extern __at(0x0F68) __sfr PMADDRL;
1122 extern __at(0x0F68) __sfr PMDOUT1;
1123 extern __at(0x0F68) __sfr PMDOUT1L;
1125 //==============================================================================
1126 // PMADDRH Bits
1128 extern __at(0x0F69) __sfr PMADDRH;
1130 typedef struct
1132 unsigned : 1;
1133 unsigned : 1;
1134 unsigned : 1;
1135 unsigned : 1;
1136 unsigned : 1;
1137 unsigned : 1;
1138 unsigned CS1 : 1;
1139 unsigned CS2 : 1;
1140 } __PMADDRHbits_t;
1142 extern __at(0x0F69) volatile __PMADDRHbits_t PMADDRHbits;
1144 #define _CS1 0x40
1145 #define _CS2 0x80
1147 //==============================================================================
1149 extern __at(0x0F69) __sfr PMDOUT1H;
1151 //==============================================================================
1152 // CMSTAT Bits
1154 extern __at(0x0F6A) __sfr CMSTAT;
1156 typedef struct
1158 unsigned COUT1 : 1;
1159 unsigned COUT2 : 1;
1160 unsigned : 1;
1161 unsigned : 1;
1162 unsigned : 1;
1163 unsigned : 1;
1164 unsigned : 1;
1165 unsigned : 1;
1166 } __CMSTATbits_t;
1168 extern __at(0x0F6A) volatile __CMSTATbits_t CMSTATbits;
1170 #define _COUT1 0x01
1171 #define _COUT2 0x02
1173 //==============================================================================
1176 //==============================================================================
1177 // CMSTATUS Bits
1179 extern __at(0x0F6A) __sfr CMSTATUS;
1181 typedef struct
1183 unsigned COUT1 : 1;
1184 unsigned COUT2 : 1;
1185 unsigned : 1;
1186 unsigned : 1;
1187 unsigned : 1;
1188 unsigned : 1;
1189 unsigned : 1;
1190 unsigned : 1;
1191 } __CMSTATUSbits_t;
1193 extern __at(0x0F6A) volatile __CMSTATUSbits_t CMSTATUSbits;
1195 #define _CMSTATUS_COUT1 0x01
1196 #define _CMSTATUS_COUT2 0x02
1198 //==============================================================================
1201 //==============================================================================
1202 // SSP2CON2 Bits
1204 extern __at(0x0F6B) __sfr SSP2CON2;
1206 typedef union
1208 struct
1210 unsigned SEN : 1;
1211 unsigned RSEN : 1;
1212 unsigned PEN : 1;
1213 unsigned RCEN : 1;
1214 unsigned ACKEN : 1;
1215 unsigned ACKDT : 1;
1216 unsigned ACKSTAT : 1;
1217 unsigned GCEN : 1;
1220 struct
1222 unsigned : 1;
1223 unsigned ADMSK1 : 1;
1224 unsigned ADMSK2 : 1;
1225 unsigned ADMSK3 : 1;
1226 unsigned ADMSK4 : 1;
1227 unsigned ADMSK5 : 1;
1228 unsigned : 1;
1229 unsigned : 1;
1231 } __SSP2CON2bits_t;
1233 extern __at(0x0F6B) volatile __SSP2CON2bits_t SSP2CON2bits;
1235 #define _SSP2CON2_SEN 0x01
1236 #define _SSP2CON2_RSEN 0x02
1237 #define _SSP2CON2_ADMSK1 0x02
1238 #define _SSP2CON2_PEN 0x04
1239 #define _SSP2CON2_ADMSK2 0x04
1240 #define _SSP2CON2_RCEN 0x08
1241 #define _SSP2CON2_ADMSK3 0x08
1242 #define _SSP2CON2_ACKEN 0x10
1243 #define _SSP2CON2_ADMSK4 0x10
1244 #define _SSP2CON2_ACKDT 0x20
1245 #define _SSP2CON2_ADMSK5 0x20
1246 #define _SSP2CON2_ACKSTAT 0x40
1247 #define _SSP2CON2_GCEN 0x80
1249 //==============================================================================
1252 //==============================================================================
1253 // SSP2CON1 Bits
1255 extern __at(0x0F6C) __sfr SSP2CON1;
1257 typedef union
1259 struct
1261 unsigned SSPM0 : 1;
1262 unsigned SSPM1 : 1;
1263 unsigned SSPM2 : 1;
1264 unsigned SSPM3 : 1;
1265 unsigned CKP : 1;
1266 unsigned SSPEN : 1;
1267 unsigned SSPOV : 1;
1268 unsigned WCOL : 1;
1271 struct
1273 unsigned SSPM : 4;
1274 unsigned : 4;
1276 } __SSP2CON1bits_t;
1278 extern __at(0x0F6C) volatile __SSP2CON1bits_t SSP2CON1bits;
1280 #define _SSP2CON1_SSPM0 0x01
1281 #define _SSP2CON1_SSPM1 0x02
1282 #define _SSP2CON1_SSPM2 0x04
1283 #define _SSP2CON1_SSPM3 0x08
1284 #define _SSP2CON1_CKP 0x10
1285 #define _SSP2CON1_SSPEN 0x20
1286 #define _SSP2CON1_SSPOV 0x40
1287 #define _SSP2CON1_WCOL 0x80
1289 //==============================================================================
1292 //==============================================================================
1293 // SSP2STAT Bits
1295 extern __at(0x0F6D) __sfr SSP2STAT;
1297 typedef union
1299 struct
1301 unsigned BF : 1;
1302 unsigned UA : 1;
1303 unsigned R_NOT_W : 1;
1304 unsigned S : 1;
1305 unsigned P : 1;
1306 unsigned D_NOT_A : 1;
1307 unsigned CKE : 1;
1308 unsigned SMP : 1;
1311 struct
1313 unsigned : 1;
1314 unsigned : 1;
1315 unsigned R_W : 1;
1316 unsigned I2C_START : 1;
1317 unsigned I2C_STOP : 1;
1318 unsigned D_A : 1;
1319 unsigned : 1;
1320 unsigned : 1;
1323 struct
1325 unsigned : 1;
1326 unsigned : 1;
1327 unsigned I2C_READ : 1;
1328 unsigned : 1;
1329 unsigned : 1;
1330 unsigned I2C_DAT : 1;
1331 unsigned : 1;
1332 unsigned : 1;
1335 struct
1337 unsigned : 1;
1338 unsigned : 1;
1339 unsigned NOT_W : 1;
1340 unsigned : 1;
1341 unsigned : 1;
1342 unsigned NOT_A : 1;
1343 unsigned : 1;
1344 unsigned : 1;
1347 struct
1349 unsigned : 1;
1350 unsigned : 1;
1351 unsigned NOT_WRITE : 1;
1352 unsigned : 1;
1353 unsigned : 1;
1354 unsigned NOT_ADDRESS : 1;
1355 unsigned : 1;
1356 unsigned : 1;
1359 struct
1361 unsigned : 1;
1362 unsigned : 1;
1363 unsigned READ_WRITE : 1;
1364 unsigned : 1;
1365 unsigned : 1;
1366 unsigned DATA_ADDRESS : 1;
1367 unsigned : 1;
1368 unsigned : 1;
1371 struct
1373 unsigned : 1;
1374 unsigned : 1;
1375 unsigned R : 1;
1376 unsigned : 1;
1377 unsigned : 1;
1378 unsigned D : 1;
1379 unsigned : 1;
1380 unsigned : 1;
1382 } __SSP2STATbits_t;
1384 extern __at(0x0F6D) volatile __SSP2STATbits_t SSP2STATbits;
1386 #define _SSP2STAT_BF 0x01
1387 #define _SSP2STAT_UA 0x02
1388 #define _SSP2STAT_R_NOT_W 0x04
1389 #define _SSP2STAT_R_W 0x04
1390 #define _SSP2STAT_I2C_READ 0x04
1391 #define _SSP2STAT_NOT_W 0x04
1392 #define _SSP2STAT_NOT_WRITE 0x04
1393 #define _SSP2STAT_READ_WRITE 0x04
1394 #define _SSP2STAT_R 0x04
1395 #define _SSP2STAT_S 0x08
1396 #define _SSP2STAT_I2C_START 0x08
1397 #define _SSP2STAT_P 0x10
1398 #define _SSP2STAT_I2C_STOP 0x10
1399 #define _SSP2STAT_D_NOT_A 0x20
1400 #define _SSP2STAT_D_A 0x20
1401 #define _SSP2STAT_I2C_DAT 0x20
1402 #define _SSP2STAT_NOT_A 0x20
1403 #define _SSP2STAT_NOT_ADDRESS 0x20
1404 #define _SSP2STAT_DATA_ADDRESS 0x20
1405 #define _SSP2STAT_D 0x20
1406 #define _SSP2STAT_CKE 0x40
1407 #define _SSP2STAT_SMP 0x80
1409 //==============================================================================
1411 extern __at(0x0F6E) __sfr SSP2ADD;
1413 //==============================================================================
1414 // SSP2MSK Bits
1416 extern __at(0x0F6E) __sfr SSP2MSK;
1418 typedef struct
1420 unsigned MSK0 : 1;
1421 unsigned MSK1 : 1;
1422 unsigned MSK2 : 1;
1423 unsigned MSK3 : 1;
1424 unsigned MSK4 : 1;
1425 unsigned MSK5 : 1;
1426 unsigned MSK6 : 1;
1427 unsigned MSK7 : 1;
1428 } __SSP2MSKbits_t;
1430 extern __at(0x0F6E) volatile __SSP2MSKbits_t SSP2MSKbits;
1432 #define _SSP2MSK_MSK0 0x01
1433 #define _SSP2MSK_MSK1 0x02
1434 #define _SSP2MSK_MSK2 0x04
1435 #define _SSP2MSK_MSK3 0x08
1436 #define _SSP2MSK_MSK4 0x10
1437 #define _SSP2MSK_MSK5 0x20
1438 #define _SSP2MSK_MSK6 0x40
1439 #define _SSP2MSK_MSK7 0x80
1441 //==============================================================================
1443 extern __at(0x0F6F) __sfr SSP2BUF;
1445 //==============================================================================
1446 // CCP5CON Bits
1448 extern __at(0x0F70) __sfr CCP5CON;
1450 typedef union
1452 struct
1454 unsigned CCP5M0 : 1;
1455 unsigned CCP5M1 : 1;
1456 unsigned CCP5M2 : 1;
1457 unsigned CCP5M3 : 1;
1458 unsigned DC5B0 : 1;
1459 unsigned DC5B1 : 1;
1460 unsigned : 1;
1461 unsigned : 1;
1464 struct
1466 unsigned : 1;
1467 unsigned : 1;
1468 unsigned : 1;
1469 unsigned : 1;
1470 unsigned DCCP5Y : 1;
1471 unsigned DCCP5X : 1;
1472 unsigned : 1;
1473 unsigned : 1;
1476 struct
1478 unsigned : 1;
1479 unsigned : 1;
1480 unsigned : 1;
1481 unsigned : 1;
1482 unsigned DC5Y : 1;
1483 unsigned DC5X : 1;
1484 unsigned : 1;
1485 unsigned : 1;
1488 struct
1490 unsigned CCP5M : 4;
1491 unsigned : 4;
1494 struct
1496 unsigned : 4;
1497 unsigned DC5B : 2;
1498 unsigned : 2;
1500 } __CCP5CONbits_t;
1502 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits;
1504 #define _CCP5M0 0x01
1505 #define _CCP5M1 0x02
1506 #define _CCP5M2 0x04
1507 #define _CCP5M3 0x08
1508 #define _DC5B0 0x10
1509 #define _DCCP5Y 0x10
1510 #define _DC5Y 0x10
1511 #define _DC5B1 0x20
1512 #define _DCCP5X 0x20
1513 #define _DC5X 0x20
1515 //==============================================================================
1517 extern __at(0x0F71) __sfr CCPR5;
1518 extern __at(0x0F71) __sfr CCPR5L;
1519 extern __at(0x0F72) __sfr CCPR5H;
1521 //==============================================================================
1522 // CCP4CON Bits
1524 extern __at(0x0F73) __sfr CCP4CON;
1526 typedef union
1528 struct
1530 unsigned CCP4M0 : 1;
1531 unsigned CCP4M1 : 1;
1532 unsigned CCP4M2 : 1;
1533 unsigned CCP4M3 : 1;
1534 unsigned DC4B0 : 1;
1535 unsigned DC4B1 : 1;
1536 unsigned : 1;
1537 unsigned : 1;
1540 struct
1542 unsigned : 1;
1543 unsigned : 1;
1544 unsigned : 1;
1545 unsigned : 1;
1546 unsigned DCCP4Y : 1;
1547 unsigned DCCP4X : 1;
1548 unsigned : 1;
1549 unsigned : 1;
1552 struct
1554 unsigned : 1;
1555 unsigned : 1;
1556 unsigned : 1;
1557 unsigned : 1;
1558 unsigned DC4Y : 1;
1559 unsigned DC4X : 1;
1560 unsigned : 1;
1561 unsigned : 1;
1564 struct
1566 unsigned CCP4M : 4;
1567 unsigned : 4;
1570 struct
1572 unsigned : 4;
1573 unsigned DC4B : 2;
1574 unsigned : 2;
1576 } __CCP4CONbits_t;
1578 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits;
1580 #define _CCP4M0 0x01
1581 #define _CCP4M1 0x02
1582 #define _CCP4M2 0x04
1583 #define _CCP4M3 0x08
1584 #define _DC4B0 0x10
1585 #define _DCCP4Y 0x10
1586 #define _DC4Y 0x10
1587 #define _DC4B1 0x20
1588 #define _DCCP4X 0x20
1589 #define _DC4X 0x20
1591 //==============================================================================
1593 extern __at(0x0F74) __sfr CCPR4;
1594 extern __at(0x0F74) __sfr CCPR4L;
1595 extern __at(0x0F75) __sfr CCPR4H;
1597 //==============================================================================
1598 // T4CON Bits
1600 extern __at(0x0F76) __sfr T4CON;
1602 typedef union
1604 struct
1606 unsigned T4CKPS0 : 1;
1607 unsigned T4CKPS1 : 1;
1608 unsigned TMR4ON : 1;
1609 unsigned T4OUTPS0 : 1;
1610 unsigned T4OUTPS1 : 1;
1611 unsigned T4OUTPS2 : 1;
1612 unsigned T4OUTPS3 : 1;
1613 unsigned : 1;
1616 struct
1618 unsigned T4CKPS : 2;
1619 unsigned : 6;
1622 struct
1624 unsigned : 3;
1625 unsigned T4OUTPS : 4;
1626 unsigned : 1;
1628 } __T4CONbits_t;
1630 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
1632 #define _T4CKPS0 0x01
1633 #define _T4CKPS1 0x02
1634 #define _TMR4ON 0x04
1635 #define _T4OUTPS0 0x08
1636 #define _T4OUTPS1 0x10
1637 #define _T4OUTPS2 0x20
1638 #define _T4OUTPS3 0x40
1640 //==============================================================================
1643 //==============================================================================
1644 // CVRCON Bits
1646 extern __at(0x0F77) __sfr CVRCON;
1648 typedef union
1650 struct
1652 unsigned CVR0 : 1;
1653 unsigned CVR1 : 1;
1654 unsigned CVR2 : 1;
1655 unsigned CVR3 : 1;
1656 unsigned CVRSS : 1;
1657 unsigned CVRR : 1;
1658 unsigned CVROE : 1;
1659 unsigned CVREN : 1;
1662 struct
1664 unsigned CVR : 4;
1665 unsigned : 4;
1667 } __CVRCONbits_t;
1669 extern __at(0x0F77) volatile __CVRCONbits_t CVRCONbits;
1671 #define _CVR0 0x01
1672 #define _CVR1 0x02
1673 #define _CVR2 0x04
1674 #define _CVR3 0x08
1675 #define _CVRSS 0x10
1676 #define _CVRR 0x20
1677 #define _CVROE 0x40
1678 #define _CVREN 0x80
1680 //==============================================================================
1682 extern __at(0x0F77) __sfr PR4;
1683 extern __at(0x0F78) __sfr TMR4;
1685 //==============================================================================
1686 // T3CON Bits
1688 extern __at(0x0F79) __sfr T3CON;
1690 typedef union
1692 struct
1694 unsigned TMR3ON : 1;
1695 unsigned TMR3CS : 1;
1696 unsigned NOT_T3SYNC : 1;
1697 unsigned T3CCP1 : 1;
1698 unsigned T3CKPS0 : 1;
1699 unsigned T3CKPS1 : 1;
1700 unsigned T3CCP2 : 1;
1701 unsigned RD16 : 1;
1704 struct
1706 unsigned : 1;
1707 unsigned : 1;
1708 unsigned T3SYNC : 1;
1709 unsigned : 1;
1710 unsigned : 1;
1711 unsigned : 1;
1712 unsigned : 1;
1713 unsigned : 1;
1716 struct
1718 unsigned : 1;
1719 unsigned : 1;
1720 unsigned T3INSYNC : 1;
1721 unsigned : 1;
1722 unsigned : 1;
1723 unsigned : 1;
1724 unsigned : 1;
1725 unsigned : 1;
1728 struct
1730 unsigned : 4;
1731 unsigned T3CKPS : 2;
1732 unsigned : 2;
1734 } __T3CONbits_t;
1736 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits;
1738 #define _T3CON_TMR3ON 0x01
1739 #define _T3CON_TMR3CS 0x02
1740 #define _T3CON_NOT_T3SYNC 0x04
1741 #define _T3CON_T3SYNC 0x04
1742 #define _T3CON_T3INSYNC 0x04
1743 #define _T3CON_T3CCP1 0x08
1744 #define _T3CON_T3CKPS0 0x10
1745 #define _T3CON_T3CKPS1 0x20
1746 #define _T3CON_T3CCP2 0x40
1747 #define _T3CON_RD16 0x80
1749 //==============================================================================
1751 extern __at(0x0F7A) __sfr TMR3;
1752 extern __at(0x0F7A) __sfr TMR3L;
1753 extern __at(0x0F7B) __sfr TMR3H;
1755 //==============================================================================
1756 // BAUDCON2 Bits
1758 extern __at(0x0F7C) __sfr BAUDCON2;
1760 typedef union
1762 struct
1764 unsigned ABDEN : 1;
1765 unsigned WUE : 1;
1766 unsigned : 1;
1767 unsigned BRG16 : 1;
1768 unsigned TXCKP : 1;
1769 unsigned RXDTP : 1;
1770 unsigned RCIDL : 1;
1771 unsigned ABDOVF : 1;
1774 struct
1776 unsigned : 1;
1777 unsigned : 1;
1778 unsigned : 1;
1779 unsigned : 1;
1780 unsigned SCKP : 1;
1781 unsigned DTRXP : 1;
1782 unsigned RCMT : 1;
1783 unsigned : 1;
1785 } __BAUDCON2bits_t;
1787 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
1789 #define _BAUDCON2_ABDEN 0x01
1790 #define _BAUDCON2_WUE 0x02
1791 #define _BAUDCON2_BRG16 0x08
1792 #define _BAUDCON2_TXCKP 0x10
1793 #define _BAUDCON2_SCKP 0x10
1794 #define _BAUDCON2_RXDTP 0x20
1795 #define _BAUDCON2_DTRXP 0x20
1796 #define _BAUDCON2_RCIDL 0x40
1797 #define _BAUDCON2_RCMT 0x40
1798 #define _BAUDCON2_ABDOVF 0x80
1800 //==============================================================================
1802 extern __at(0x0F7D) __sfr SPBRGH2;
1804 //==============================================================================
1805 // BAUDCON Bits
1807 extern __at(0x0F7E) __sfr BAUDCON;
1809 typedef union
1811 struct
1813 unsigned ABDEN : 1;
1814 unsigned WUE : 1;
1815 unsigned : 1;
1816 unsigned BRG16 : 1;
1817 unsigned TXCKP : 1;
1818 unsigned RXDTP : 1;
1819 unsigned RCIDL : 1;
1820 unsigned ABDOVF : 1;
1823 struct
1825 unsigned : 1;
1826 unsigned : 1;
1827 unsigned : 1;
1828 unsigned : 1;
1829 unsigned SCKP : 1;
1830 unsigned DTRXP : 1;
1831 unsigned RCMT : 1;
1832 unsigned : 1;
1834 } __BAUDCONbits_t;
1836 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1838 #define _ABDEN 0x01
1839 #define _WUE 0x02
1840 #define _BRG16 0x08
1841 #define _TXCKP 0x10
1842 #define _SCKP 0x10
1843 #define _RXDTP 0x20
1844 #define _DTRXP 0x20
1845 #define _RCIDL 0x40
1846 #define _RCMT 0x40
1847 #define _ABDOVF 0x80
1849 //==============================================================================
1852 //==============================================================================
1853 // BAUDCON1 Bits
1855 extern __at(0x0F7E) __sfr BAUDCON1;
1857 typedef union
1859 struct
1861 unsigned ABDEN : 1;
1862 unsigned WUE : 1;
1863 unsigned : 1;
1864 unsigned BRG16 : 1;
1865 unsigned TXCKP : 1;
1866 unsigned RXDTP : 1;
1867 unsigned RCIDL : 1;
1868 unsigned ABDOVF : 1;
1871 struct
1873 unsigned : 1;
1874 unsigned : 1;
1875 unsigned : 1;
1876 unsigned : 1;
1877 unsigned SCKP : 1;
1878 unsigned DTRXP : 1;
1879 unsigned RCMT : 1;
1880 unsigned : 1;
1882 } __BAUDCON1bits_t;
1884 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1886 #define _BAUDCON1_ABDEN 0x01
1887 #define _BAUDCON1_WUE 0x02
1888 #define _BAUDCON1_BRG16 0x08
1889 #define _BAUDCON1_TXCKP 0x10
1890 #define _BAUDCON1_SCKP 0x10
1891 #define _BAUDCON1_RXDTP 0x20
1892 #define _BAUDCON1_DTRXP 0x20
1893 #define _BAUDCON1_RCIDL 0x40
1894 #define _BAUDCON1_RCMT 0x40
1895 #define _BAUDCON1_ABDOVF 0x80
1897 //==============================================================================
1899 extern __at(0x0F7F) __sfr SPBRGH;
1900 extern __at(0x0F7F) __sfr SPBRGH1;
1902 //==============================================================================
1903 // PORTA Bits
1905 extern __at(0x0F80) __sfr PORTA;
1907 typedef union
1909 struct
1911 unsigned RA0 : 1;
1912 unsigned RA1 : 1;
1913 unsigned RA2 : 1;
1914 unsigned RA3 : 1;
1915 unsigned RA4 : 1;
1916 unsigned RA5 : 1;
1917 unsigned RA6 : 1;
1918 unsigned RA7 : 1;
1921 struct
1923 unsigned AN0 : 1;
1924 unsigned AN1 : 1;
1925 unsigned AN2 : 1;
1926 unsigned AN3 : 1;
1927 unsigned T0CKI : 1;
1928 unsigned AN4 : 1;
1929 unsigned OSC2 : 1;
1930 unsigned : 1;
1933 struct
1935 unsigned : 1;
1936 unsigned : 1;
1937 unsigned VREFM : 1;
1938 unsigned VREFP : 1;
1939 unsigned : 1;
1940 unsigned C2INA : 1;
1941 unsigned CLKO : 1;
1942 unsigned : 1;
1944 } __PORTAbits_t;
1946 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1948 #define _PORTA_RA0 0x01
1949 #define _PORTA_AN0 0x01
1950 #define _PORTA_RA1 0x02
1951 #define _PORTA_AN1 0x02
1952 #define _PORTA_RA2 0x04
1953 #define _PORTA_AN2 0x04
1954 #define _PORTA_VREFM 0x04
1955 #define _PORTA_RA3 0x08
1956 #define _PORTA_AN3 0x08
1957 #define _PORTA_VREFP 0x08
1958 #define _PORTA_RA4 0x10
1959 #define _PORTA_T0CKI 0x10
1960 #define _PORTA_RA5 0x20
1961 #define _PORTA_AN4 0x20
1962 #define _PORTA_C2INA 0x20
1963 #define _PORTA_RA6 0x40
1964 #define _PORTA_OSC2 0x40
1965 #define _PORTA_CLKO 0x40
1966 #define _PORTA_RA7 0x80
1968 //==============================================================================
1971 //==============================================================================
1972 // PORTB Bits
1974 extern __at(0x0F81) __sfr PORTB;
1976 typedef union
1978 struct
1980 unsigned RB0 : 1;
1981 unsigned RB1 : 1;
1982 unsigned RB2 : 1;
1983 unsigned RB3 : 1;
1984 unsigned RB4 : 1;
1985 unsigned RB5 : 1;
1986 unsigned RB6 : 1;
1987 unsigned RB7 : 1;
1990 struct
1992 unsigned INT0 : 1;
1993 unsigned INT1 : 1;
1994 unsigned INT2 : 1;
1995 unsigned INT3 : 1;
1996 unsigned KBI0 : 1;
1997 unsigned KBI1 : 1;
1998 unsigned KBI2 : 1;
1999 unsigned KBI3 : 1;
2002 struct
2004 unsigned FLT0 : 1;
2005 unsigned PMA4 : 1;
2006 unsigned PMA3 : 1;
2007 unsigned PMA2 : 1;
2008 unsigned PMA1 : 1;
2009 unsigned PMA0 : 1;
2010 unsigned PGD : 1;
2011 unsigned : 1;
2014 struct
2016 unsigned : 1;
2017 unsigned : 1;
2018 unsigned : 1;
2019 unsigned : 1;
2020 unsigned : 1;
2021 unsigned PGC : 1;
2022 unsigned : 1;
2023 unsigned : 1;
2026 struct
2028 unsigned INT : 4;
2029 unsigned : 4;
2032 struct
2034 unsigned : 4;
2035 unsigned KBI : 4;
2037 } __PORTBbits_t;
2039 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
2041 #define _PORTB_RB0 0x01
2042 #define _PORTB_INT0 0x01
2043 #define _PORTB_FLT0 0x01
2044 #define _PORTB_RB1 0x02
2045 #define _PORTB_INT1 0x02
2046 #define _PORTB_PMA4 0x02
2047 #define _PORTB_RB2 0x04
2048 #define _PORTB_INT2 0x04
2049 #define _PORTB_PMA3 0x04
2050 #define _PORTB_RB3 0x08
2051 #define _PORTB_INT3 0x08
2052 #define _PORTB_PMA2 0x08
2053 #define _PORTB_RB4 0x10
2054 #define _PORTB_KBI0 0x10
2055 #define _PORTB_PMA1 0x10
2056 #define _PORTB_RB5 0x20
2057 #define _PORTB_KBI1 0x20
2058 #define _PORTB_PMA0 0x20
2059 #define _PORTB_PGC 0x20
2060 #define _PORTB_RB6 0x40
2061 #define _PORTB_KBI2 0x40
2062 #define _PORTB_PGD 0x40
2063 #define _PORTB_RB7 0x80
2064 #define _PORTB_KBI3 0x80
2066 //==============================================================================
2069 //==============================================================================
2070 // PORTC Bits
2072 extern __at(0x0F82) __sfr PORTC;
2074 typedef union
2076 struct
2078 unsigned RC0 : 1;
2079 unsigned RC1 : 1;
2080 unsigned RC2 : 1;
2081 unsigned RC3 : 1;
2082 unsigned RC4 : 1;
2083 unsigned RC5 : 1;
2084 unsigned RC6 : 1;
2085 unsigned RC7 : 1;
2088 struct
2090 unsigned T1OSO : 1;
2091 unsigned T1OSI : 1;
2092 unsigned CCP1 : 1;
2093 unsigned SCK : 1;
2094 unsigned SDI : 1;
2095 unsigned SDO : 1;
2096 unsigned TX : 1;
2097 unsigned RX : 1;
2100 struct
2102 unsigned T13CKI : 1;
2103 unsigned CCP2 : 1;
2104 unsigned : 1;
2105 unsigned SCL : 1;
2106 unsigned SDA : 1;
2107 unsigned C2OUT : 1;
2108 unsigned CK : 1;
2109 unsigned : 1;
2111 } __PORTCbits_t;
2113 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
2115 #define _PORTC_RC0 0x01
2116 #define _PORTC_T1OSO 0x01
2117 #define _PORTC_T13CKI 0x01
2118 #define _PORTC_RC1 0x02
2119 #define _PORTC_T1OSI 0x02
2120 #define _PORTC_CCP2 0x02
2121 #define _PORTC_RC2 0x04
2122 #define _PORTC_CCP1 0x04
2123 #define _PORTC_RC3 0x08
2124 #define _PORTC_SCK 0x08
2125 #define _PORTC_SCL 0x08
2126 #define _PORTC_RC4 0x10
2127 #define _PORTC_SDI 0x10
2128 #define _PORTC_SDA 0x10
2129 #define _PORTC_RC5 0x20
2130 #define _PORTC_SDO 0x20
2131 #define _PORTC_C2OUT 0x20
2132 #define _PORTC_RC6 0x40
2133 #define _PORTC_TX 0x40
2134 #define _PORTC_CK 0x40
2135 #define _PORTC_RC7 0x80
2136 #define _PORTC_RX 0x80
2138 //==============================================================================
2141 //==============================================================================
2142 // PORTD Bits
2144 extern __at(0x0F83) __sfr PORTD;
2146 typedef union
2148 struct
2150 unsigned RD0 : 1;
2151 unsigned RD1 : 1;
2152 unsigned RD2 : 1;
2153 unsigned RD3 : 1;
2154 unsigned RD4 : 1;
2155 unsigned RD5 : 1;
2156 unsigned RD6 : 1;
2157 unsigned RD7 : 1;
2160 struct
2162 unsigned PMD0 : 1;
2163 unsigned PMD1 : 1;
2164 unsigned PMD2 : 1;
2165 unsigned PMD3 : 1;
2166 unsigned PMD4 : 1;
2167 unsigned PMD5 : 1;
2168 unsigned PMD6 : 1;
2169 unsigned PMD7 : 1;
2172 struct
2174 unsigned : 1;
2175 unsigned : 1;
2176 unsigned : 1;
2177 unsigned : 1;
2178 unsigned SDO2 : 1;
2179 unsigned SDA2 : 1;
2180 unsigned SCL2 : 1;
2181 unsigned SS2 : 1;
2184 struct
2186 unsigned : 1;
2187 unsigned : 1;
2188 unsigned : 1;
2189 unsigned : 1;
2190 unsigned : 1;
2191 unsigned SDI2 : 1;
2192 unsigned SCK2 : 1;
2193 unsigned : 1;
2195 } __PORTDbits_t;
2197 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
2199 #define _PORTD_RD0 0x01
2200 #define _PORTD_PMD0 0x01
2201 #define _PORTD_RD1 0x02
2202 #define _PORTD_PMD1 0x02
2203 #define _PORTD_RD2 0x04
2204 #define _PORTD_PMD2 0x04
2205 #define _PORTD_RD3 0x08
2206 #define _PORTD_PMD3 0x08
2207 #define _PORTD_RD4 0x10
2208 #define _PORTD_PMD4 0x10
2209 #define _PORTD_SDO2 0x10
2210 #define _PORTD_RD5 0x20
2211 #define _PORTD_PMD5 0x20
2212 #define _PORTD_SDA2 0x20
2213 #define _PORTD_SDI2 0x20
2214 #define _PORTD_RD6 0x40
2215 #define _PORTD_PMD6 0x40
2216 #define _PORTD_SCL2 0x40
2217 #define _PORTD_SCK2 0x40
2218 #define _PORTD_RD7 0x80
2219 #define _PORTD_PMD7 0x80
2220 #define _PORTD_SS2 0x80
2222 //==============================================================================
2225 //==============================================================================
2226 // PORTE Bits
2228 extern __at(0x0F84) __sfr PORTE;
2230 typedef union
2232 struct
2234 unsigned RE0 : 1;
2235 unsigned RE1 : 1;
2236 unsigned RE2 : 1;
2237 unsigned RE3 : 1;
2238 unsigned RE4 : 1;
2239 unsigned RE5 : 1;
2240 unsigned RE6 : 1;
2241 unsigned RE7 : 1;
2244 struct
2246 unsigned PMRD : 1;
2247 unsigned PMWR : 1;
2248 unsigned PMBE : 1;
2249 unsigned PMA13 : 1;
2250 unsigned PMA12 : 1;
2251 unsigned PMA11 : 1;
2252 unsigned PMA10 : 1;
2253 unsigned PMA9 : 1;
2256 struct
2258 unsigned : 1;
2259 unsigned : 1;
2260 unsigned : 1;
2261 unsigned REFO : 1;
2262 unsigned : 1;
2263 unsigned : 1;
2264 unsigned : 1;
2265 unsigned CCP2 : 1;
2267 } __PORTEbits_t;
2269 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
2271 #define _PORTE_RE0 0x01
2272 #define _PORTE_PMRD 0x01
2273 #define _PORTE_RE1 0x02
2274 #define _PORTE_PMWR 0x02
2275 #define _PORTE_RE2 0x04
2276 #define _PORTE_PMBE 0x04
2277 #define _PORTE_RE3 0x08
2278 #define _PORTE_PMA13 0x08
2279 #define _PORTE_REFO 0x08
2280 #define _PORTE_RE4 0x10
2281 #define _PORTE_PMA12 0x10
2282 #define _PORTE_RE5 0x20
2283 #define _PORTE_PMA11 0x20
2284 #define _PORTE_RE6 0x40
2285 #define _PORTE_PMA10 0x40
2286 #define _PORTE_RE7 0x80
2287 #define _PORTE_PMA9 0x80
2288 #define _PORTE_CCP2 0x80
2290 //==============================================================================
2293 //==============================================================================
2294 // PORTF Bits
2296 extern __at(0x0F85) __sfr PORTF;
2298 typedef union
2300 struct
2302 unsigned : 1;
2303 unsigned : 1;
2304 unsigned RF2 : 1;
2305 unsigned RF3 : 1;
2306 unsigned RF4 : 1;
2307 unsigned RF5 : 1;
2308 unsigned RF6 : 1;
2309 unsigned RF7 : 1;
2312 struct
2314 unsigned : 1;
2315 unsigned : 1;
2316 unsigned AN7 : 1;
2317 unsigned : 1;
2318 unsigned : 1;
2319 unsigned AN10 : 1;
2320 unsigned AN11 : 1;
2321 unsigned SS : 1;
2324 struct
2326 unsigned : 1;
2327 unsigned : 1;
2328 unsigned C2INB : 1;
2329 unsigned : 1;
2330 unsigned : 1;
2331 unsigned CVREF : 1;
2332 unsigned C1INA : 1;
2333 unsigned C1OUT : 1;
2336 struct
2338 unsigned : 1;
2339 unsigned : 1;
2340 unsigned PMA5 : 1;
2341 unsigned : 1;
2342 unsigned : 1;
2343 unsigned C1INB : 1;
2344 unsigned : 1;
2345 unsigned : 1;
2347 } __PORTFbits_t;
2349 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
2351 #define _PORTF_RF2 0x04
2352 #define _PORTF_AN7 0x04
2353 #define _PORTF_C2INB 0x04
2354 #define _PORTF_PMA5 0x04
2355 #define _PORTF_RF3 0x08
2356 #define _PORTF_RF4 0x10
2357 #define _PORTF_RF5 0x20
2358 #define _PORTF_AN10 0x20
2359 #define _PORTF_CVREF 0x20
2360 #define _PORTF_C1INB 0x20
2361 #define _PORTF_RF6 0x40
2362 #define _PORTF_AN11 0x40
2363 #define _PORTF_C1INA 0x40
2364 #define _PORTF_RF7 0x80
2365 #define _PORTF_SS 0x80
2366 #define _PORTF_C1OUT 0x80
2368 //==============================================================================
2371 //==============================================================================
2372 // PORTG Bits
2374 extern __at(0x0F86) __sfr PORTG;
2376 typedef union
2378 struct
2380 unsigned RG0 : 1;
2381 unsigned RG1 : 1;
2382 unsigned RG2 : 1;
2383 unsigned RG3 : 1;
2384 unsigned RG4 : 1;
2385 unsigned : 1;
2386 unsigned REPU : 1;
2387 unsigned RDPU : 1;
2390 struct
2392 unsigned CCP3 : 1;
2393 unsigned TX2 : 1;
2394 unsigned RX2 : 1;
2395 unsigned CCP4 : 1;
2396 unsigned CCP5 : 1;
2397 unsigned : 1;
2398 unsigned : 1;
2399 unsigned : 1;
2402 struct
2404 unsigned PMA8 : 1;
2405 unsigned CK2 : 1;
2406 unsigned DT2 : 1;
2407 unsigned PMCS1 : 1;
2408 unsigned PMCS2 : 1;
2409 unsigned : 1;
2410 unsigned : 1;
2411 unsigned : 1;
2414 struct
2416 unsigned : 1;
2417 unsigned PMA7 : 1;
2418 unsigned PMA6 : 1;
2419 unsigned : 1;
2420 unsigned : 1;
2421 unsigned : 1;
2422 unsigned : 1;
2423 unsigned : 1;
2426 struct
2428 unsigned RG : 5;
2429 unsigned : 3;
2431 } __PORTGbits_t;
2433 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
2435 #define _PORTG_RG0 0x01
2436 #define _PORTG_CCP3 0x01
2437 #define _PORTG_PMA8 0x01
2438 #define _PORTG_RG1 0x02
2439 #define _PORTG_TX2 0x02
2440 #define _PORTG_CK2 0x02
2441 #define _PORTG_PMA7 0x02
2442 #define _PORTG_RG2 0x04
2443 #define _PORTG_RX2 0x04
2444 #define _PORTG_DT2 0x04
2445 #define _PORTG_PMA6 0x04
2446 #define _PORTG_RG3 0x08
2447 #define _PORTG_CCP4 0x08
2448 #define _PORTG_PMCS1 0x08
2449 #define _PORTG_RG4 0x10
2450 #define _PORTG_CCP5 0x10
2451 #define _PORTG_PMCS2 0x10
2452 #define _PORTG_REPU 0x40
2453 #define _PORTG_RDPU 0x80
2455 //==============================================================================
2458 //==============================================================================
2459 // LATA Bits
2461 extern __at(0x0F89) __sfr LATA;
2463 typedef struct
2465 unsigned LATA0 : 1;
2466 unsigned LATA1 : 1;
2467 unsigned LATA2 : 1;
2468 unsigned LATA3 : 1;
2469 unsigned LATA4 : 1;
2470 unsigned LATA5 : 1;
2471 unsigned LATA6 : 1;
2472 unsigned LATA7 : 1;
2473 } __LATAbits_t;
2475 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2477 #define _LATA0 0x01
2478 #define _LATA1 0x02
2479 #define _LATA2 0x04
2480 #define _LATA3 0x08
2481 #define _LATA4 0x10
2482 #define _LATA5 0x20
2483 #define _LATA6 0x40
2484 #define _LATA7 0x80
2486 //==============================================================================
2489 //==============================================================================
2490 // LATB Bits
2492 extern __at(0x0F8A) __sfr LATB;
2494 typedef struct
2496 unsigned LATB0 : 1;
2497 unsigned LATB1 : 1;
2498 unsigned LATB2 : 1;
2499 unsigned LATB3 : 1;
2500 unsigned LATB4 : 1;
2501 unsigned LATB5 : 1;
2502 unsigned LATB6 : 1;
2503 unsigned LATB7 : 1;
2504 } __LATBbits_t;
2506 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2508 #define _LATB0 0x01
2509 #define _LATB1 0x02
2510 #define _LATB2 0x04
2511 #define _LATB3 0x08
2512 #define _LATB4 0x10
2513 #define _LATB5 0x20
2514 #define _LATB6 0x40
2515 #define _LATB7 0x80
2517 //==============================================================================
2520 //==============================================================================
2521 // LATC Bits
2523 extern __at(0x0F8B) __sfr LATC;
2525 typedef struct
2527 unsigned LATC0 : 1;
2528 unsigned LATC1 : 1;
2529 unsigned LATC2 : 1;
2530 unsigned LATC3 : 1;
2531 unsigned LATC4 : 1;
2532 unsigned LATC5 : 1;
2533 unsigned LATC6 : 1;
2534 unsigned LATC7 : 1;
2535 } __LATCbits_t;
2537 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2539 #define _LATC0 0x01
2540 #define _LATC1 0x02
2541 #define _LATC2 0x04
2542 #define _LATC3 0x08
2543 #define _LATC4 0x10
2544 #define _LATC5 0x20
2545 #define _LATC6 0x40
2546 #define _LATC7 0x80
2548 //==============================================================================
2551 //==============================================================================
2552 // LATD Bits
2554 extern __at(0x0F8C) __sfr LATD;
2556 typedef struct
2558 unsigned LATD0 : 1;
2559 unsigned LATD1 : 1;
2560 unsigned LATD2 : 1;
2561 unsigned LATD3 : 1;
2562 unsigned LATD4 : 1;
2563 unsigned LATD5 : 1;
2564 unsigned LATD6 : 1;
2565 unsigned LATD7 : 1;
2566 } __LATDbits_t;
2568 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2570 #define _LATD0 0x01
2571 #define _LATD1 0x02
2572 #define _LATD2 0x04
2573 #define _LATD3 0x08
2574 #define _LATD4 0x10
2575 #define _LATD5 0x20
2576 #define _LATD6 0x40
2577 #define _LATD7 0x80
2579 //==============================================================================
2582 //==============================================================================
2583 // LATE Bits
2585 extern __at(0x0F8D) __sfr LATE;
2587 typedef struct
2589 unsigned LATE0 : 1;
2590 unsigned LATE1 : 1;
2591 unsigned LATE2 : 1;
2592 unsigned LATE3 : 1;
2593 unsigned LATE4 : 1;
2594 unsigned LATE5 : 1;
2595 unsigned LATE6 : 1;
2596 unsigned LATE7 : 1;
2597 } __LATEbits_t;
2599 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2601 #define _LATE0 0x01
2602 #define _LATE1 0x02
2603 #define _LATE2 0x04
2604 #define _LATE3 0x08
2605 #define _LATE4 0x10
2606 #define _LATE5 0x20
2607 #define _LATE6 0x40
2608 #define _LATE7 0x80
2610 //==============================================================================
2613 //==============================================================================
2614 // LATF Bits
2616 extern __at(0x0F8E) __sfr LATF;
2618 typedef struct
2620 unsigned : 1;
2621 unsigned : 1;
2622 unsigned LATF2 : 1;
2623 unsigned LATF3 : 1;
2624 unsigned LATF4 : 1;
2625 unsigned LATF5 : 1;
2626 unsigned LATF6 : 1;
2627 unsigned LATF7 : 1;
2628 } __LATFbits_t;
2630 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
2632 #define _LATF2 0x04
2633 #define _LATF3 0x08
2634 #define _LATF4 0x10
2635 #define _LATF5 0x20
2636 #define _LATF6 0x40
2637 #define _LATF7 0x80
2639 //==============================================================================
2642 //==============================================================================
2643 // LATG Bits
2645 extern __at(0x0F8F) __sfr LATG;
2647 typedef union
2649 struct
2651 unsigned LATG0 : 1;
2652 unsigned LATG1 : 1;
2653 unsigned LATG2 : 1;
2654 unsigned LATG3 : 1;
2655 unsigned LATG4 : 1;
2656 unsigned : 1;
2657 unsigned : 1;
2658 unsigned : 1;
2661 struct
2663 unsigned LATG : 5;
2664 unsigned : 3;
2666 } __LATGbits_t;
2668 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2670 #define _LATG0 0x01
2671 #define _LATG1 0x02
2672 #define _LATG2 0x04
2673 #define _LATG3 0x08
2674 #define _LATG4 0x10
2676 //==============================================================================
2679 //==============================================================================
2680 // DDRA Bits
2682 extern __at(0x0F92) __sfr DDRA;
2684 typedef union
2686 struct
2688 unsigned TRISA0 : 1;
2689 unsigned TRISA1 : 1;
2690 unsigned TRISA2 : 1;
2691 unsigned TRISA3 : 1;
2692 unsigned TRISA4 : 1;
2693 unsigned TRISA5 : 1;
2694 unsigned TRISA6 : 1;
2695 unsigned TRISA7 : 1;
2698 struct
2700 unsigned RA0 : 1;
2701 unsigned RA1 : 1;
2702 unsigned RA2 : 1;
2703 unsigned RA3 : 1;
2704 unsigned RA4 : 1;
2705 unsigned RA5 : 1;
2706 unsigned RA6 : 1;
2707 unsigned RA7 : 1;
2709 } __DDRAbits_t;
2711 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2713 #define _TRISA0 0x01
2714 #define _RA0 0x01
2715 #define _TRISA1 0x02
2716 #define _RA1 0x02
2717 #define _TRISA2 0x04
2718 #define _RA2 0x04
2719 #define _TRISA3 0x08
2720 #define _RA3 0x08
2721 #define _TRISA4 0x10
2722 #define _RA4 0x10
2723 #define _TRISA5 0x20
2724 #define _RA5 0x20
2725 #define _TRISA6 0x40
2726 #define _RA6 0x40
2727 #define _TRISA7 0x80
2728 #define _RA7 0x80
2730 //==============================================================================
2733 //==============================================================================
2734 // TRISA Bits
2736 extern __at(0x0F92) __sfr TRISA;
2738 typedef union
2740 struct
2742 unsigned TRISA0 : 1;
2743 unsigned TRISA1 : 1;
2744 unsigned TRISA2 : 1;
2745 unsigned TRISA3 : 1;
2746 unsigned TRISA4 : 1;
2747 unsigned TRISA5 : 1;
2748 unsigned TRISA6 : 1;
2749 unsigned TRISA7 : 1;
2752 struct
2754 unsigned RA0 : 1;
2755 unsigned RA1 : 1;
2756 unsigned RA2 : 1;
2757 unsigned RA3 : 1;
2758 unsigned RA4 : 1;
2759 unsigned RA5 : 1;
2760 unsigned RA6 : 1;
2761 unsigned RA7 : 1;
2763 } __TRISAbits_t;
2765 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2767 #define _TRISA_TRISA0 0x01
2768 #define _TRISA_RA0 0x01
2769 #define _TRISA_TRISA1 0x02
2770 #define _TRISA_RA1 0x02
2771 #define _TRISA_TRISA2 0x04
2772 #define _TRISA_RA2 0x04
2773 #define _TRISA_TRISA3 0x08
2774 #define _TRISA_RA3 0x08
2775 #define _TRISA_TRISA4 0x10
2776 #define _TRISA_RA4 0x10
2777 #define _TRISA_TRISA5 0x20
2778 #define _TRISA_RA5 0x20
2779 #define _TRISA_TRISA6 0x40
2780 #define _TRISA_RA6 0x40
2781 #define _TRISA_TRISA7 0x80
2782 #define _TRISA_RA7 0x80
2784 //==============================================================================
2787 //==============================================================================
2788 // DDRB Bits
2790 extern __at(0x0F93) __sfr DDRB;
2792 typedef union
2794 struct
2796 unsigned TRISB0 : 1;
2797 unsigned TRISB1 : 1;
2798 unsigned TRISB2 : 1;
2799 unsigned TRISB3 : 1;
2800 unsigned TRISB4 : 1;
2801 unsigned TRISB5 : 1;
2802 unsigned TRISB6 : 1;
2803 unsigned TRISB7 : 1;
2806 struct
2808 unsigned RB0 : 1;
2809 unsigned RB1 : 1;
2810 unsigned RB2 : 1;
2811 unsigned RB3 : 1;
2812 unsigned RB4 : 1;
2813 unsigned RB5 : 1;
2814 unsigned RB6 : 1;
2815 unsigned RB7 : 1;
2817 } __DDRBbits_t;
2819 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2821 #define _TRISB0 0x01
2822 #define _RB0 0x01
2823 #define _TRISB1 0x02
2824 #define _RB1 0x02
2825 #define _TRISB2 0x04
2826 #define _RB2 0x04
2827 #define _TRISB3 0x08
2828 #define _RB3 0x08
2829 #define _TRISB4 0x10
2830 #define _RB4 0x10
2831 #define _TRISB5 0x20
2832 #define _RB5 0x20
2833 #define _TRISB6 0x40
2834 #define _RB6 0x40
2835 #define _TRISB7 0x80
2836 #define _RB7 0x80
2838 //==============================================================================
2841 //==============================================================================
2842 // TRISB Bits
2844 extern __at(0x0F93) __sfr TRISB;
2846 typedef union
2848 struct
2850 unsigned TRISB0 : 1;
2851 unsigned TRISB1 : 1;
2852 unsigned TRISB2 : 1;
2853 unsigned TRISB3 : 1;
2854 unsigned TRISB4 : 1;
2855 unsigned TRISB5 : 1;
2856 unsigned TRISB6 : 1;
2857 unsigned TRISB7 : 1;
2860 struct
2862 unsigned RB0 : 1;
2863 unsigned RB1 : 1;
2864 unsigned RB2 : 1;
2865 unsigned RB3 : 1;
2866 unsigned RB4 : 1;
2867 unsigned RB5 : 1;
2868 unsigned RB6 : 1;
2869 unsigned RB7 : 1;
2871 } __TRISBbits_t;
2873 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2875 #define _TRISB_TRISB0 0x01
2876 #define _TRISB_RB0 0x01
2877 #define _TRISB_TRISB1 0x02
2878 #define _TRISB_RB1 0x02
2879 #define _TRISB_TRISB2 0x04
2880 #define _TRISB_RB2 0x04
2881 #define _TRISB_TRISB3 0x08
2882 #define _TRISB_RB3 0x08
2883 #define _TRISB_TRISB4 0x10
2884 #define _TRISB_RB4 0x10
2885 #define _TRISB_TRISB5 0x20
2886 #define _TRISB_RB5 0x20
2887 #define _TRISB_TRISB6 0x40
2888 #define _TRISB_RB6 0x40
2889 #define _TRISB_TRISB7 0x80
2890 #define _TRISB_RB7 0x80
2892 //==============================================================================
2895 //==============================================================================
2896 // DDRC Bits
2898 extern __at(0x0F94) __sfr DDRC;
2900 typedef union
2902 struct
2904 unsigned TRISC0 : 1;
2905 unsigned TRISC1 : 1;
2906 unsigned TRISC2 : 1;
2907 unsigned TRISC3 : 1;
2908 unsigned TRISC4 : 1;
2909 unsigned TRISC5 : 1;
2910 unsigned TRISC6 : 1;
2911 unsigned TRISC7 : 1;
2914 struct
2916 unsigned RC0 : 1;
2917 unsigned RC1 : 1;
2918 unsigned RC2 : 1;
2919 unsigned RC3 : 1;
2920 unsigned RC4 : 1;
2921 unsigned RC5 : 1;
2922 unsigned RC6 : 1;
2923 unsigned RC7 : 1;
2925 } __DDRCbits_t;
2927 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2929 #define _TRISC0 0x01
2930 #define _RC0 0x01
2931 #define _TRISC1 0x02
2932 #define _RC1 0x02
2933 #define _TRISC2 0x04
2934 #define _RC2 0x04
2935 #define _TRISC3 0x08
2936 #define _RC3 0x08
2937 #define _TRISC4 0x10
2938 #define _RC4 0x10
2939 #define _TRISC5 0x20
2940 #define _RC5 0x20
2941 #define _TRISC6 0x40
2942 #define _RC6 0x40
2943 #define _TRISC7 0x80
2944 #define _RC7 0x80
2946 //==============================================================================
2949 //==============================================================================
2950 // TRISC Bits
2952 extern __at(0x0F94) __sfr TRISC;
2954 typedef union
2956 struct
2958 unsigned TRISC0 : 1;
2959 unsigned TRISC1 : 1;
2960 unsigned TRISC2 : 1;
2961 unsigned TRISC3 : 1;
2962 unsigned TRISC4 : 1;
2963 unsigned TRISC5 : 1;
2964 unsigned TRISC6 : 1;
2965 unsigned TRISC7 : 1;
2968 struct
2970 unsigned RC0 : 1;
2971 unsigned RC1 : 1;
2972 unsigned RC2 : 1;
2973 unsigned RC3 : 1;
2974 unsigned RC4 : 1;
2975 unsigned RC5 : 1;
2976 unsigned RC6 : 1;
2977 unsigned RC7 : 1;
2979 } __TRISCbits_t;
2981 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2983 #define _TRISC_TRISC0 0x01
2984 #define _TRISC_RC0 0x01
2985 #define _TRISC_TRISC1 0x02
2986 #define _TRISC_RC1 0x02
2987 #define _TRISC_TRISC2 0x04
2988 #define _TRISC_RC2 0x04
2989 #define _TRISC_TRISC3 0x08
2990 #define _TRISC_RC3 0x08
2991 #define _TRISC_TRISC4 0x10
2992 #define _TRISC_RC4 0x10
2993 #define _TRISC_TRISC5 0x20
2994 #define _TRISC_RC5 0x20
2995 #define _TRISC_TRISC6 0x40
2996 #define _TRISC_RC6 0x40
2997 #define _TRISC_TRISC7 0x80
2998 #define _TRISC_RC7 0x80
3000 //==============================================================================
3003 //==============================================================================
3004 // DDRD Bits
3006 extern __at(0x0F95) __sfr DDRD;
3008 typedef union
3010 struct
3012 unsigned TRISD0 : 1;
3013 unsigned TRISD1 : 1;
3014 unsigned TRISD2 : 1;
3015 unsigned TRISD3 : 1;
3016 unsigned TRISD4 : 1;
3017 unsigned TRISD5 : 1;
3018 unsigned TRISD6 : 1;
3019 unsigned TRISD7 : 1;
3022 struct
3024 unsigned RD0 : 1;
3025 unsigned RD1 : 1;
3026 unsigned RD2 : 1;
3027 unsigned RD3 : 1;
3028 unsigned RD4 : 1;
3029 unsigned RD5 : 1;
3030 unsigned RD6 : 1;
3031 unsigned RD7 : 1;
3033 } __DDRDbits_t;
3035 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
3037 #define _TRISD0 0x01
3038 #define _RD0 0x01
3039 #define _TRISD1 0x02
3040 #define _RD1 0x02
3041 #define _TRISD2 0x04
3042 #define _RD2 0x04
3043 #define _TRISD3 0x08
3044 #define _RD3 0x08
3045 #define _TRISD4 0x10
3046 #define _RD4 0x10
3047 #define _TRISD5 0x20
3048 #define _RD5 0x20
3049 #define _TRISD6 0x40
3050 #define _RD6 0x40
3051 #define _TRISD7 0x80
3052 #define _RD7 0x80
3054 //==============================================================================
3057 //==============================================================================
3058 // TRISD Bits
3060 extern __at(0x0F95) __sfr TRISD;
3062 typedef union
3064 struct
3066 unsigned TRISD0 : 1;
3067 unsigned TRISD1 : 1;
3068 unsigned TRISD2 : 1;
3069 unsigned TRISD3 : 1;
3070 unsigned TRISD4 : 1;
3071 unsigned TRISD5 : 1;
3072 unsigned TRISD6 : 1;
3073 unsigned TRISD7 : 1;
3076 struct
3078 unsigned RD0 : 1;
3079 unsigned RD1 : 1;
3080 unsigned RD2 : 1;
3081 unsigned RD3 : 1;
3082 unsigned RD4 : 1;
3083 unsigned RD5 : 1;
3084 unsigned RD6 : 1;
3085 unsigned RD7 : 1;
3087 } __TRISDbits_t;
3089 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
3091 #define _TRISD_TRISD0 0x01
3092 #define _TRISD_RD0 0x01
3093 #define _TRISD_TRISD1 0x02
3094 #define _TRISD_RD1 0x02
3095 #define _TRISD_TRISD2 0x04
3096 #define _TRISD_RD2 0x04
3097 #define _TRISD_TRISD3 0x08
3098 #define _TRISD_RD3 0x08
3099 #define _TRISD_TRISD4 0x10
3100 #define _TRISD_RD4 0x10
3101 #define _TRISD_TRISD5 0x20
3102 #define _TRISD_RD5 0x20
3103 #define _TRISD_TRISD6 0x40
3104 #define _TRISD_RD6 0x40
3105 #define _TRISD_TRISD7 0x80
3106 #define _TRISD_RD7 0x80
3108 //==============================================================================
3111 //==============================================================================
3112 // DDRE Bits
3114 extern __at(0x0F96) __sfr DDRE;
3116 typedef union
3118 struct
3120 unsigned TRISE0 : 1;
3121 unsigned TRISE1 : 1;
3122 unsigned TRISE2 : 1;
3123 unsigned TRISE3 : 1;
3124 unsigned TRISE4 : 1;
3125 unsigned TRISE5 : 1;
3126 unsigned TRISE6 : 1;
3127 unsigned TRISE7 : 1;
3130 struct
3132 unsigned RE0 : 1;
3133 unsigned RE1 : 1;
3134 unsigned RE2 : 1;
3135 unsigned RE3 : 1;
3136 unsigned RE4 : 1;
3137 unsigned RE5 : 1;
3138 unsigned RE6 : 1;
3139 unsigned RE7 : 1;
3141 } __DDREbits_t;
3143 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
3145 #define _TRISE0 0x01
3146 #define _RE0 0x01
3147 #define _TRISE1 0x02
3148 #define _RE1 0x02
3149 #define _TRISE2 0x04
3150 #define _RE2 0x04
3151 #define _TRISE3 0x08
3152 #define _RE3 0x08
3153 #define _TRISE4 0x10
3154 #define _RE4 0x10
3155 #define _TRISE5 0x20
3156 #define _RE5 0x20
3157 #define _TRISE6 0x40
3158 #define _RE6 0x40
3159 #define _TRISE7 0x80
3160 #define _RE7 0x80
3162 //==============================================================================
3165 //==============================================================================
3166 // TRISE Bits
3168 extern __at(0x0F96) __sfr TRISE;
3170 typedef union
3172 struct
3174 unsigned TRISE0 : 1;
3175 unsigned TRISE1 : 1;
3176 unsigned TRISE2 : 1;
3177 unsigned TRISE3 : 1;
3178 unsigned TRISE4 : 1;
3179 unsigned TRISE5 : 1;
3180 unsigned TRISE6 : 1;
3181 unsigned TRISE7 : 1;
3184 struct
3186 unsigned RE0 : 1;
3187 unsigned RE1 : 1;
3188 unsigned RE2 : 1;
3189 unsigned RE3 : 1;
3190 unsigned RE4 : 1;
3191 unsigned RE5 : 1;
3192 unsigned RE6 : 1;
3193 unsigned RE7 : 1;
3195 } __TRISEbits_t;
3197 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
3199 #define _TRISE_TRISE0 0x01
3200 #define _TRISE_RE0 0x01
3201 #define _TRISE_TRISE1 0x02
3202 #define _TRISE_RE1 0x02
3203 #define _TRISE_TRISE2 0x04
3204 #define _TRISE_RE2 0x04
3205 #define _TRISE_TRISE3 0x08
3206 #define _TRISE_RE3 0x08
3207 #define _TRISE_TRISE4 0x10
3208 #define _TRISE_RE4 0x10
3209 #define _TRISE_TRISE5 0x20
3210 #define _TRISE_RE5 0x20
3211 #define _TRISE_TRISE6 0x40
3212 #define _TRISE_RE6 0x40
3213 #define _TRISE_TRISE7 0x80
3214 #define _TRISE_RE7 0x80
3216 //==============================================================================
3219 //==============================================================================
3220 // DDRF Bits
3222 extern __at(0x0F97) __sfr DDRF;
3224 typedef union
3226 struct
3228 unsigned : 1;
3229 unsigned : 1;
3230 unsigned TRISF2 : 1;
3231 unsigned TRISF3 : 1;
3232 unsigned TRISF4 : 1;
3233 unsigned TRISF5 : 1;
3234 unsigned TRISF6 : 1;
3235 unsigned TRISF7 : 1;
3238 struct
3240 unsigned : 1;
3241 unsigned : 1;
3242 unsigned RF2 : 1;
3243 unsigned RF3 : 1;
3244 unsigned RF4 : 1;
3245 unsigned RF5 : 1;
3246 unsigned RF6 : 1;
3247 unsigned RF7 : 1;
3249 } __DDRFbits_t;
3251 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
3253 #define _TRISF2 0x04
3254 #define _RF2 0x04
3255 #define _TRISF3 0x08
3256 #define _RF3 0x08
3257 #define _TRISF4 0x10
3258 #define _RF4 0x10
3259 #define _TRISF5 0x20
3260 #define _RF5 0x20
3261 #define _TRISF6 0x40
3262 #define _RF6 0x40
3263 #define _TRISF7 0x80
3264 #define _RF7 0x80
3266 //==============================================================================
3269 //==============================================================================
3270 // TRISF Bits
3272 extern __at(0x0F97) __sfr TRISF;
3274 typedef union
3276 struct
3278 unsigned : 1;
3279 unsigned : 1;
3280 unsigned TRISF2 : 1;
3281 unsigned TRISF3 : 1;
3282 unsigned TRISF4 : 1;
3283 unsigned TRISF5 : 1;
3284 unsigned TRISF6 : 1;
3285 unsigned TRISF7 : 1;
3288 struct
3290 unsigned : 1;
3291 unsigned : 1;
3292 unsigned RF2 : 1;
3293 unsigned RF3 : 1;
3294 unsigned RF4 : 1;
3295 unsigned RF5 : 1;
3296 unsigned RF6 : 1;
3297 unsigned RF7 : 1;
3299 } __TRISFbits_t;
3301 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
3303 #define _TRISF_TRISF2 0x04
3304 #define _TRISF_RF2 0x04
3305 #define _TRISF_TRISF3 0x08
3306 #define _TRISF_RF3 0x08
3307 #define _TRISF_TRISF4 0x10
3308 #define _TRISF_RF4 0x10
3309 #define _TRISF_TRISF5 0x20
3310 #define _TRISF_RF5 0x20
3311 #define _TRISF_TRISF6 0x40
3312 #define _TRISF_RF6 0x40
3313 #define _TRISF_TRISF7 0x80
3314 #define _TRISF_RF7 0x80
3316 //==============================================================================
3319 //==============================================================================
3320 // DDRG Bits
3322 extern __at(0x0F98) __sfr DDRG;
3324 typedef union
3326 struct
3328 unsigned TRISG0 : 1;
3329 unsigned TRISG1 : 1;
3330 unsigned TRISG2 : 1;
3331 unsigned TRISG3 : 1;
3332 unsigned TRISG4 : 1;
3333 unsigned : 1;
3334 unsigned : 1;
3335 unsigned : 1;
3338 struct
3340 unsigned RG0 : 1;
3341 unsigned RG1 : 1;
3342 unsigned RG2 : 1;
3343 unsigned RG3 : 1;
3344 unsigned RG4 : 1;
3345 unsigned : 1;
3346 unsigned : 1;
3347 unsigned : 1;
3350 struct
3352 unsigned RG : 5;
3353 unsigned : 3;
3356 struct
3358 unsigned TRISG : 5;
3359 unsigned : 3;
3361 } __DDRGbits_t;
3363 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
3365 #define _TRISG0 0x01
3366 #define _RG0 0x01
3367 #define _TRISG1 0x02
3368 #define _RG1 0x02
3369 #define _TRISG2 0x04
3370 #define _RG2 0x04
3371 #define _TRISG3 0x08
3372 #define _RG3 0x08
3373 #define _TRISG4 0x10
3374 #define _RG4 0x10
3376 //==============================================================================
3379 //==============================================================================
3380 // TRISG Bits
3382 extern __at(0x0F98) __sfr TRISG;
3384 typedef union
3386 struct
3388 unsigned TRISG0 : 1;
3389 unsigned TRISG1 : 1;
3390 unsigned TRISG2 : 1;
3391 unsigned TRISG3 : 1;
3392 unsigned TRISG4 : 1;
3393 unsigned : 1;
3394 unsigned : 1;
3395 unsigned : 1;
3398 struct
3400 unsigned RG0 : 1;
3401 unsigned RG1 : 1;
3402 unsigned RG2 : 1;
3403 unsigned RG3 : 1;
3404 unsigned RG4 : 1;
3405 unsigned : 1;
3406 unsigned : 1;
3407 unsigned : 1;
3410 struct
3412 unsigned RG : 5;
3413 unsigned : 3;
3416 struct
3418 unsigned TRISG : 5;
3419 unsigned : 3;
3421 } __TRISGbits_t;
3423 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
3425 #define _TRISG_TRISG0 0x01
3426 #define _TRISG_RG0 0x01
3427 #define _TRISG_TRISG1 0x02
3428 #define _TRISG_RG1 0x02
3429 #define _TRISG_TRISG2 0x04
3430 #define _TRISG_RG2 0x04
3431 #define _TRISG_TRISG3 0x08
3432 #define _TRISG_RG3 0x08
3433 #define _TRISG_TRISG4 0x10
3434 #define _TRISG_RG4 0x10
3436 //==============================================================================
3439 //==============================================================================
3440 // OSCTUNE Bits
3442 extern __at(0x0F9B) __sfr OSCTUNE;
3444 typedef union
3446 struct
3448 unsigned TUN0 : 1;
3449 unsigned TUN1 : 1;
3450 unsigned TUN2 : 1;
3451 unsigned TUN3 : 1;
3452 unsigned TUN4 : 1;
3453 unsigned TUN5 : 1;
3454 unsigned PLLEN : 1;
3455 unsigned INTSRC : 1;
3458 struct
3460 unsigned TUN : 6;
3461 unsigned : 2;
3463 } __OSCTUNEbits_t;
3465 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3467 #define _TUN0 0x01
3468 #define _TUN1 0x02
3469 #define _TUN2 0x04
3470 #define _TUN3 0x08
3471 #define _TUN4 0x10
3472 #define _TUN5 0x20
3473 #define _PLLEN 0x40
3474 #define _INTSRC 0x80
3476 //==============================================================================
3479 //==============================================================================
3480 // RCSTA2 Bits
3482 extern __at(0x0F9C) __sfr RCSTA2;
3484 typedef union
3486 struct
3488 unsigned RX9D : 1;
3489 unsigned OERR : 1;
3490 unsigned FERR : 1;
3491 unsigned ADDEN : 1;
3492 unsigned CREN : 1;
3493 unsigned SREN : 1;
3494 unsigned RX9 : 1;
3495 unsigned SPEN : 1;
3498 struct
3500 unsigned RCD8 : 1;
3501 unsigned OERR2 : 1;
3502 unsigned FERR2 : 1;
3503 unsigned ADDEN2 : 1;
3504 unsigned CREN2 : 1;
3505 unsigned SREN2 : 1;
3506 unsigned RC9 : 1;
3507 unsigned SPEN2 : 1;
3510 struct
3512 unsigned RX9D2 : 1;
3513 unsigned : 1;
3514 unsigned : 1;
3515 unsigned : 1;
3516 unsigned : 1;
3517 unsigned : 1;
3518 unsigned NOT_RC8 : 1;
3519 unsigned : 1;
3522 struct
3524 unsigned : 1;
3525 unsigned : 1;
3526 unsigned : 1;
3527 unsigned : 1;
3528 unsigned : 1;
3529 unsigned : 1;
3530 unsigned RC8_9 : 1;
3531 unsigned : 1;
3534 struct
3536 unsigned : 1;
3537 unsigned : 1;
3538 unsigned : 1;
3539 unsigned : 1;
3540 unsigned : 1;
3541 unsigned : 1;
3542 unsigned RX92 : 1;
3543 unsigned : 1;
3545 } __RCSTA2bits_t;
3547 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
3549 #define _RCSTA2_RX9D 0x01
3550 #define _RCSTA2_RCD8 0x01
3551 #define _RCSTA2_RX9D2 0x01
3552 #define _RCSTA2_OERR 0x02
3553 #define _RCSTA2_OERR2 0x02
3554 #define _RCSTA2_FERR 0x04
3555 #define _RCSTA2_FERR2 0x04
3556 #define _RCSTA2_ADDEN 0x08
3557 #define _RCSTA2_ADDEN2 0x08
3558 #define _RCSTA2_CREN 0x10
3559 #define _RCSTA2_CREN2 0x10
3560 #define _RCSTA2_SREN 0x20
3561 #define _RCSTA2_SREN2 0x20
3562 #define _RCSTA2_RX9 0x40
3563 #define _RCSTA2_RC9 0x40
3564 #define _RCSTA2_NOT_RC8 0x40
3565 #define _RCSTA2_RC8_9 0x40
3566 #define _RCSTA2_RX92 0x40
3567 #define _RCSTA2_SPEN 0x80
3568 #define _RCSTA2_SPEN2 0x80
3570 //==============================================================================
3573 //==============================================================================
3574 // PIE1 Bits
3576 extern __at(0x0F9D) __sfr PIE1;
3578 typedef union
3580 struct
3582 unsigned TMR1IE : 1;
3583 unsigned TMR2IE : 1;
3584 unsigned CCP1IE : 1;
3585 unsigned SSP1IE : 1;
3586 unsigned TX1IE : 1;
3587 unsigned RC1IE : 1;
3588 unsigned ADIE : 1;
3589 unsigned PMPIE : 1;
3592 struct
3594 unsigned : 1;
3595 unsigned : 1;
3596 unsigned : 1;
3597 unsigned SSPIE : 1;
3598 unsigned TXIE : 1;
3599 unsigned RCIE : 1;
3600 unsigned : 1;
3601 unsigned : 1;
3603 } __PIE1bits_t;
3605 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3607 #define _TMR1IE 0x01
3608 #define _TMR2IE 0x02
3609 #define _CCP1IE 0x04
3610 #define _SSP1IE 0x08
3611 #define _SSPIE 0x08
3612 #define _TX1IE 0x10
3613 #define _TXIE 0x10
3614 #define _RC1IE 0x20
3615 #define _RCIE 0x20
3616 #define _ADIE 0x40
3617 #define _PMPIE 0x80
3619 //==============================================================================
3622 //==============================================================================
3623 // PIR1 Bits
3625 extern __at(0x0F9E) __sfr PIR1;
3627 typedef union
3629 struct
3631 unsigned TMR1IF : 1;
3632 unsigned TMR2IF : 1;
3633 unsigned CCP1IF : 1;
3634 unsigned SSP1IF : 1;
3635 unsigned TX1IF : 1;
3636 unsigned RC1IF : 1;
3637 unsigned ADIF : 1;
3638 unsigned PMPIF : 1;
3641 struct
3643 unsigned : 1;
3644 unsigned : 1;
3645 unsigned : 1;
3646 unsigned SSPIF : 1;
3647 unsigned TXIF : 1;
3648 unsigned RCIF : 1;
3649 unsigned : 1;
3650 unsigned : 1;
3652 } __PIR1bits_t;
3654 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3656 #define _TMR1IF 0x01
3657 #define _TMR2IF 0x02
3658 #define _CCP1IF 0x04
3659 #define _SSP1IF 0x08
3660 #define _SSPIF 0x08
3661 #define _TX1IF 0x10
3662 #define _TXIF 0x10
3663 #define _RC1IF 0x20
3664 #define _RCIF 0x20
3665 #define _ADIF 0x40
3666 #define _PMPIF 0x80
3668 //==============================================================================
3671 //==============================================================================
3672 // IPR1 Bits
3674 extern __at(0x0F9F) __sfr IPR1;
3676 typedef union
3678 struct
3680 unsigned TMR1IP : 1;
3681 unsigned TMR2IP : 1;
3682 unsigned CCP1IP : 1;
3683 unsigned SSP1IP : 1;
3684 unsigned TX1IP : 1;
3685 unsigned RC1IP : 1;
3686 unsigned ADIP : 1;
3687 unsigned PMPIP : 1;
3690 struct
3692 unsigned : 1;
3693 unsigned : 1;
3694 unsigned : 1;
3695 unsigned SSPIP : 1;
3696 unsigned TXIP : 1;
3697 unsigned RCIP : 1;
3698 unsigned : 1;
3699 unsigned : 1;
3701 } __IPR1bits_t;
3703 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3705 #define _TMR1IP 0x01
3706 #define _TMR2IP 0x02
3707 #define _CCP1IP 0x04
3708 #define _SSP1IP 0x08
3709 #define _SSPIP 0x08
3710 #define _TX1IP 0x10
3711 #define _TXIP 0x10
3712 #define _RC1IP 0x20
3713 #define _RCIP 0x20
3714 #define _ADIP 0x40
3715 #define _PMPIP 0x80
3717 //==============================================================================
3720 //==============================================================================
3721 // PIE2 Bits
3723 extern __at(0x0FA0) __sfr PIE2;
3725 typedef union
3727 struct
3729 unsigned CCP2IE : 1;
3730 unsigned TMR3IE : 1;
3731 unsigned LVDIE : 1;
3732 unsigned BCL1IE : 1;
3733 unsigned USBIE : 1;
3734 unsigned CM1IE : 1;
3735 unsigned CM2IE : 1;
3736 unsigned OSCFIE : 1;
3739 struct
3741 unsigned : 1;
3742 unsigned : 1;
3743 unsigned : 1;
3744 unsigned BCLIE : 1;
3745 unsigned : 1;
3746 unsigned : 1;
3747 unsigned : 1;
3748 unsigned : 1;
3750 } __PIE2bits_t;
3752 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3754 #define _CCP2IE 0x01
3755 #define _TMR3IE 0x02
3756 #define _LVDIE 0x04
3757 #define _BCL1IE 0x08
3758 #define _BCLIE 0x08
3759 #define _USBIE 0x10
3760 #define _CM1IE 0x20
3761 #define _CM2IE 0x40
3762 #define _OSCFIE 0x80
3764 //==============================================================================
3767 //==============================================================================
3768 // PIR2 Bits
3770 extern __at(0x0FA1) __sfr PIR2;
3772 typedef union
3774 struct
3776 unsigned CCP2IF : 1;
3777 unsigned TMR3IF : 1;
3778 unsigned LVDIF : 1;
3779 unsigned BCL1IF : 1;
3780 unsigned USBIF : 1;
3781 unsigned CM1IF : 1;
3782 unsigned CM2IF : 1;
3783 unsigned OSCFIF : 1;
3786 struct
3788 unsigned : 1;
3789 unsigned : 1;
3790 unsigned : 1;
3791 unsigned BCLIF : 1;
3792 unsigned : 1;
3793 unsigned : 1;
3794 unsigned : 1;
3795 unsigned : 1;
3797 } __PIR2bits_t;
3799 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3801 #define _CCP2IF 0x01
3802 #define _TMR3IF 0x02
3803 #define _LVDIF 0x04
3804 #define _BCL1IF 0x08
3805 #define _BCLIF 0x08
3806 #define _USBIF 0x10
3807 #define _CM1IF 0x20
3808 #define _CM2IF 0x40
3809 #define _OSCFIF 0x80
3811 //==============================================================================
3814 //==============================================================================
3815 // IPR2 Bits
3817 extern __at(0x0FA2) __sfr IPR2;
3819 typedef union
3821 struct
3823 unsigned CCP2IP : 1;
3824 unsigned TMR3IP : 1;
3825 unsigned LVDIP : 1;
3826 unsigned BCL1IP : 1;
3827 unsigned USBIP : 1;
3828 unsigned CM1IP : 1;
3829 unsigned CM2IP : 1;
3830 unsigned OSCFIP : 1;
3833 struct
3835 unsigned : 1;
3836 unsigned : 1;
3837 unsigned : 1;
3838 unsigned BCLIP : 1;
3839 unsigned : 1;
3840 unsigned : 1;
3841 unsigned : 1;
3842 unsigned : 1;
3844 } __IPR2bits_t;
3846 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3848 #define _CCP2IP 0x01
3849 #define _TMR3IP 0x02
3850 #define _LVDIP 0x04
3851 #define _BCL1IP 0x08
3852 #define _BCLIP 0x08
3853 #define _USBIP 0x10
3854 #define _CM1IP 0x20
3855 #define _CM2IP 0x40
3856 #define _OSCFIP 0x80
3858 //==============================================================================
3861 //==============================================================================
3862 // PIE3 Bits
3864 extern __at(0x0FA3) __sfr PIE3;
3866 typedef struct
3868 unsigned CCP3IE : 1;
3869 unsigned CCP4IE : 1;
3870 unsigned CCP5IE : 1;
3871 unsigned TMR4IE : 1;
3872 unsigned TX2IE : 1;
3873 unsigned RC2IE : 1;
3874 unsigned BCL2IE : 1;
3875 unsigned SSP2IE : 1;
3876 } __PIE3bits_t;
3878 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3880 #define _CCP3IE 0x01
3881 #define _CCP4IE 0x02
3882 #define _CCP5IE 0x04
3883 #define _TMR4IE 0x08
3884 #define _TX2IE 0x10
3885 #define _RC2IE 0x20
3886 #define _BCL2IE 0x40
3887 #define _SSP2IE 0x80
3889 //==============================================================================
3892 //==============================================================================
3893 // PIR3 Bits
3895 extern __at(0x0FA4) __sfr PIR3;
3897 typedef struct
3899 unsigned CCP3IF : 1;
3900 unsigned CCP4IF : 1;
3901 unsigned CCP5IF : 1;
3902 unsigned TMR4IF : 1;
3903 unsigned TX2IF : 1;
3904 unsigned RC2IF : 1;
3905 unsigned BCL2IF : 1;
3906 unsigned SSP2IF : 1;
3907 } __PIR3bits_t;
3909 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3911 #define _CCP3IF 0x01
3912 #define _CCP4IF 0x02
3913 #define _CCP5IF 0x04
3914 #define _TMR4IF 0x08
3915 #define _TX2IF 0x10
3916 #define _RC2IF 0x20
3917 #define _BCL2IF 0x40
3918 #define _SSP2IF 0x80
3920 //==============================================================================
3923 //==============================================================================
3924 // IPR3 Bits
3926 extern __at(0x0FA5) __sfr IPR3;
3928 typedef struct
3930 unsigned CCP3IP : 1;
3931 unsigned CCP4IP : 1;
3932 unsigned CCP5IP : 1;
3933 unsigned TMR4IP : 1;
3934 unsigned TX2IP : 1;
3935 unsigned RC2IP : 1;
3936 unsigned BCL2IP : 1;
3937 unsigned SSP2IP : 1;
3938 } __IPR3bits_t;
3940 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3942 #define _CCP3IP 0x01
3943 #define _CCP4IP 0x02
3944 #define _CCP5IP 0x04
3945 #define _TMR4IP 0x08
3946 #define _TX2IP 0x10
3947 #define _RC2IP 0x20
3948 #define _BCL2IP 0x40
3949 #define _SSP2IP 0x80
3951 //==============================================================================
3954 //==============================================================================
3955 // EECON1 Bits
3957 extern __at(0x0FA6) __sfr EECON1;
3959 typedef struct
3961 unsigned : 1;
3962 unsigned WR : 1;
3963 unsigned WREN : 1;
3964 unsigned WRERR : 1;
3965 unsigned FREE : 1;
3966 unsigned WPROG : 1;
3967 unsigned : 1;
3968 unsigned : 1;
3969 } __EECON1bits_t;
3971 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3973 #define _WR 0x02
3974 #define _WREN 0x04
3975 #define _WRERR 0x08
3976 #define _FREE 0x10
3977 #define _WPROG 0x20
3979 //==============================================================================
3981 extern __at(0x0FA7) __sfr EECON2;
3983 //==============================================================================
3984 // TXSTA2 Bits
3986 extern __at(0x0FA8) __sfr TXSTA2;
3988 typedef union
3990 struct
3992 unsigned TX9D : 1;
3993 unsigned TRMT : 1;
3994 unsigned BRGH : 1;
3995 unsigned SENDB : 1;
3996 unsigned SYNC : 1;
3997 unsigned TXEN : 1;
3998 unsigned TX9 : 1;
3999 unsigned CSRC : 1;
4002 struct
4004 unsigned TXD8 : 1;
4005 unsigned TRMT2 : 1;
4006 unsigned BRGH2 : 1;
4007 unsigned SENDB2 : 1;
4008 unsigned SYNC2 : 1;
4009 unsigned TXEN2 : 1;
4010 unsigned TX8_9 : 1;
4011 unsigned CSRC2 : 1;
4014 struct
4016 unsigned TX9D2 : 1;
4017 unsigned : 1;
4018 unsigned : 1;
4019 unsigned : 1;
4020 unsigned : 1;
4021 unsigned : 1;
4022 unsigned NOT_TX8 : 1;
4023 unsigned : 1;
4026 struct
4028 unsigned : 1;
4029 unsigned : 1;
4030 unsigned : 1;
4031 unsigned : 1;
4032 unsigned : 1;
4033 unsigned : 1;
4034 unsigned TX92 : 1;
4035 unsigned : 1;
4037 } __TXSTA2bits_t;
4039 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
4041 #define _TXSTA2_TX9D 0x01
4042 #define _TXSTA2_TXD8 0x01
4043 #define _TXSTA2_TX9D2 0x01
4044 #define _TXSTA2_TRMT 0x02
4045 #define _TXSTA2_TRMT2 0x02
4046 #define _TXSTA2_BRGH 0x04
4047 #define _TXSTA2_BRGH2 0x04
4048 #define _TXSTA2_SENDB 0x08
4049 #define _TXSTA2_SENDB2 0x08
4050 #define _TXSTA2_SYNC 0x10
4051 #define _TXSTA2_SYNC2 0x10
4052 #define _TXSTA2_TXEN 0x20
4053 #define _TXSTA2_TXEN2 0x20
4054 #define _TXSTA2_TX9 0x40
4055 #define _TXSTA2_TX8_9 0x40
4056 #define _TXSTA2_NOT_TX8 0x40
4057 #define _TXSTA2_TX92 0x40
4058 #define _TXSTA2_CSRC 0x80
4059 #define _TXSTA2_CSRC2 0x80
4061 //==============================================================================
4063 extern __at(0x0FA9) __sfr TXREG2;
4064 extern __at(0x0FAA) __sfr RCREG2;
4065 extern __at(0x0FAB) __sfr SPBRG2;
4067 //==============================================================================
4068 // RCSTA Bits
4070 extern __at(0x0FAC) __sfr RCSTA;
4072 typedef union
4074 struct
4076 unsigned RX9D : 1;
4077 unsigned OERR : 1;
4078 unsigned FERR : 1;
4079 unsigned ADDEN : 1;
4080 unsigned CREN : 1;
4081 unsigned SREN : 1;
4082 unsigned RX9 : 1;
4083 unsigned SPEN : 1;
4086 struct
4088 unsigned RCD8 : 1;
4089 unsigned OERR1 : 1;
4090 unsigned FERR1 : 1;
4091 unsigned ADDEN1 : 1;
4092 unsigned CREN1 : 1;
4093 unsigned SREN1 : 1;
4094 unsigned RC9 : 1;
4095 unsigned SPEN1 : 1;
4098 struct
4100 unsigned RX9D1 : 1;
4101 unsigned : 1;
4102 unsigned : 1;
4103 unsigned : 1;
4104 unsigned : 1;
4105 unsigned : 1;
4106 unsigned NOT_RC8 : 1;
4107 unsigned : 1;
4110 struct
4112 unsigned : 1;
4113 unsigned : 1;
4114 unsigned : 1;
4115 unsigned : 1;
4116 unsigned : 1;
4117 unsigned : 1;
4118 unsigned RC8_9 : 1;
4119 unsigned : 1;
4122 struct
4124 unsigned : 1;
4125 unsigned : 1;
4126 unsigned : 1;
4127 unsigned : 1;
4128 unsigned : 1;
4129 unsigned : 1;
4130 unsigned RX91 : 1;
4131 unsigned : 1;
4133 } __RCSTAbits_t;
4135 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
4137 #define _RX9D 0x01
4138 #define _RCD8 0x01
4139 #define _RX9D1 0x01
4140 #define _OERR 0x02
4141 #define _OERR1 0x02
4142 #define _FERR 0x04
4143 #define _FERR1 0x04
4144 #define _ADDEN 0x08
4145 #define _ADDEN1 0x08
4146 #define _CREN 0x10
4147 #define _CREN1 0x10
4148 #define _SREN 0x20
4149 #define _SREN1 0x20
4150 #define _RX9 0x40
4151 #define _RC9 0x40
4152 #define _NOT_RC8 0x40
4153 #define _RC8_9 0x40
4154 #define _RX91 0x40
4155 #define _SPEN 0x80
4156 #define _SPEN1 0x80
4158 //==============================================================================
4161 //==============================================================================
4162 // RCSTA1 Bits
4164 extern __at(0x0FAC) __sfr RCSTA1;
4166 typedef union
4168 struct
4170 unsigned RX9D : 1;
4171 unsigned OERR : 1;
4172 unsigned FERR : 1;
4173 unsigned ADDEN : 1;
4174 unsigned CREN : 1;
4175 unsigned SREN : 1;
4176 unsigned RX9 : 1;
4177 unsigned SPEN : 1;
4180 struct
4182 unsigned RCD8 : 1;
4183 unsigned OERR1 : 1;
4184 unsigned FERR1 : 1;
4185 unsigned ADDEN1 : 1;
4186 unsigned CREN1 : 1;
4187 unsigned SREN1 : 1;
4188 unsigned RC9 : 1;
4189 unsigned SPEN1 : 1;
4192 struct
4194 unsigned RX9D1 : 1;
4195 unsigned : 1;
4196 unsigned : 1;
4197 unsigned : 1;
4198 unsigned : 1;
4199 unsigned : 1;
4200 unsigned NOT_RC8 : 1;
4201 unsigned : 1;
4204 struct
4206 unsigned : 1;
4207 unsigned : 1;
4208 unsigned : 1;
4209 unsigned : 1;
4210 unsigned : 1;
4211 unsigned : 1;
4212 unsigned RC8_9 : 1;
4213 unsigned : 1;
4216 struct
4218 unsigned : 1;
4219 unsigned : 1;
4220 unsigned : 1;
4221 unsigned : 1;
4222 unsigned : 1;
4223 unsigned : 1;
4224 unsigned RX91 : 1;
4225 unsigned : 1;
4227 } __RCSTA1bits_t;
4229 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
4231 #define _RCSTA1_RX9D 0x01
4232 #define _RCSTA1_RCD8 0x01
4233 #define _RCSTA1_RX9D1 0x01
4234 #define _RCSTA1_OERR 0x02
4235 #define _RCSTA1_OERR1 0x02
4236 #define _RCSTA1_FERR 0x04
4237 #define _RCSTA1_FERR1 0x04
4238 #define _RCSTA1_ADDEN 0x08
4239 #define _RCSTA1_ADDEN1 0x08
4240 #define _RCSTA1_CREN 0x10
4241 #define _RCSTA1_CREN1 0x10
4242 #define _RCSTA1_SREN 0x20
4243 #define _RCSTA1_SREN1 0x20
4244 #define _RCSTA1_RX9 0x40
4245 #define _RCSTA1_RC9 0x40
4246 #define _RCSTA1_NOT_RC8 0x40
4247 #define _RCSTA1_RC8_9 0x40
4248 #define _RCSTA1_RX91 0x40
4249 #define _RCSTA1_SPEN 0x80
4250 #define _RCSTA1_SPEN1 0x80
4252 //==============================================================================
4255 //==============================================================================
4256 // TXSTA Bits
4258 extern __at(0x0FAD) __sfr TXSTA;
4260 typedef union
4262 struct
4264 unsigned TX9D : 1;
4265 unsigned TRMT : 1;
4266 unsigned BRGH : 1;
4267 unsigned SENDB : 1;
4268 unsigned SYNC : 1;
4269 unsigned TXEN : 1;
4270 unsigned TX9 : 1;
4271 unsigned CSRC : 1;
4274 struct
4276 unsigned TXD8 : 1;
4277 unsigned TRMT1 : 1;
4278 unsigned BRGH1 : 1;
4279 unsigned SENDB1 : 1;
4280 unsigned SYNC1 : 1;
4281 unsigned TXEN1 : 1;
4282 unsigned TX8_9 : 1;
4283 unsigned CSRC1 : 1;
4286 struct
4288 unsigned TX9D1 : 1;
4289 unsigned : 1;
4290 unsigned : 1;
4291 unsigned : 1;
4292 unsigned : 1;
4293 unsigned : 1;
4294 unsigned NOT_TX8 : 1;
4295 unsigned : 1;
4298 struct
4300 unsigned : 1;
4301 unsigned : 1;
4302 unsigned : 1;
4303 unsigned : 1;
4304 unsigned : 1;
4305 unsigned : 1;
4306 unsigned TX91 : 1;
4307 unsigned : 1;
4309 } __TXSTAbits_t;
4311 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
4313 #define _TX9D 0x01
4314 #define _TXD8 0x01
4315 #define _TX9D1 0x01
4316 #define _TRMT 0x02
4317 #define _TRMT1 0x02
4318 #define _BRGH 0x04
4319 #define _BRGH1 0x04
4320 #define _SENDB 0x08
4321 #define _SENDB1 0x08
4322 #define _SYNC 0x10
4323 #define _SYNC1 0x10
4324 #define _TXEN 0x20
4325 #define _TXEN1 0x20
4326 #define _TX9 0x40
4327 #define _TX8_9 0x40
4328 #define _NOT_TX8 0x40
4329 #define _TX91 0x40
4330 #define _CSRC 0x80
4331 #define _CSRC1 0x80
4333 //==============================================================================
4336 //==============================================================================
4337 // TXSTA1 Bits
4339 extern __at(0x0FAD) __sfr TXSTA1;
4341 typedef union
4343 struct
4345 unsigned TX9D : 1;
4346 unsigned TRMT : 1;
4347 unsigned BRGH : 1;
4348 unsigned SENDB : 1;
4349 unsigned SYNC : 1;
4350 unsigned TXEN : 1;
4351 unsigned TX9 : 1;
4352 unsigned CSRC : 1;
4355 struct
4357 unsigned TXD8 : 1;
4358 unsigned TRMT1 : 1;
4359 unsigned BRGH1 : 1;
4360 unsigned SENDB1 : 1;
4361 unsigned SYNC1 : 1;
4362 unsigned TXEN1 : 1;
4363 unsigned TX8_9 : 1;
4364 unsigned CSRC1 : 1;
4367 struct
4369 unsigned TX9D1 : 1;
4370 unsigned : 1;
4371 unsigned : 1;
4372 unsigned : 1;
4373 unsigned : 1;
4374 unsigned : 1;
4375 unsigned NOT_TX8 : 1;
4376 unsigned : 1;
4379 struct
4381 unsigned : 1;
4382 unsigned : 1;
4383 unsigned : 1;
4384 unsigned : 1;
4385 unsigned : 1;
4386 unsigned : 1;
4387 unsigned TX91 : 1;
4388 unsigned : 1;
4390 } __TXSTA1bits_t;
4392 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
4394 #define _TXSTA1_TX9D 0x01
4395 #define _TXSTA1_TXD8 0x01
4396 #define _TXSTA1_TX9D1 0x01
4397 #define _TXSTA1_TRMT 0x02
4398 #define _TXSTA1_TRMT1 0x02
4399 #define _TXSTA1_BRGH 0x04
4400 #define _TXSTA1_BRGH1 0x04
4401 #define _TXSTA1_SENDB 0x08
4402 #define _TXSTA1_SENDB1 0x08
4403 #define _TXSTA1_SYNC 0x10
4404 #define _TXSTA1_SYNC1 0x10
4405 #define _TXSTA1_TXEN 0x20
4406 #define _TXSTA1_TXEN1 0x20
4407 #define _TXSTA1_TX9 0x40
4408 #define _TXSTA1_TX8_9 0x40
4409 #define _TXSTA1_NOT_TX8 0x40
4410 #define _TXSTA1_TX91 0x40
4411 #define _TXSTA1_CSRC 0x80
4412 #define _TXSTA1_CSRC1 0x80
4414 //==============================================================================
4416 extern __at(0x0FAE) __sfr TXREG;
4417 extern __at(0x0FAE) __sfr TXREG1;
4418 extern __at(0x0FAF) __sfr RCREG;
4419 extern __at(0x0FAF) __sfr RCREG1;
4420 extern __at(0x0FB0) __sfr SPBRG;
4421 extern __at(0x0FB0) __sfr SPBRG1;
4423 //==============================================================================
4424 // CCP3CON Bits
4426 extern __at(0x0FB1) __sfr CCP3CON;
4428 typedef union
4430 struct
4432 unsigned CCP3M0 : 1;
4433 unsigned CCP3M1 : 1;
4434 unsigned CCP3M2 : 1;
4435 unsigned CCP3M3 : 1;
4436 unsigned DC3B0 : 1;
4437 unsigned DC3B1 : 1;
4438 unsigned P3M0 : 1;
4439 unsigned P3M1 : 1;
4442 struct
4444 unsigned : 1;
4445 unsigned : 1;
4446 unsigned : 1;
4447 unsigned : 1;
4448 unsigned CCP3Y : 1;
4449 unsigned CCP3X : 1;
4450 unsigned : 1;
4451 unsigned : 1;
4454 struct
4456 unsigned CCP3M : 4;
4457 unsigned : 4;
4460 struct
4462 unsigned : 4;
4463 unsigned DC3B : 2;
4464 unsigned : 2;
4467 struct
4469 unsigned : 6;
4470 unsigned P3M : 2;
4472 } __CCP3CONbits_t;
4474 extern __at(0x0FB1) volatile __CCP3CONbits_t CCP3CONbits;
4476 #define _CCP3M0 0x01
4477 #define _CCP3M1 0x02
4478 #define _CCP3M2 0x04
4479 #define _CCP3M3 0x08
4480 #define _DC3B0 0x10
4481 #define _CCP3Y 0x10
4482 #define _DC3B1 0x20
4483 #define _CCP3X 0x20
4484 #define _P3M0 0x40
4485 #define _P3M1 0x80
4487 //==============================================================================
4490 //==============================================================================
4491 // ECCP3CON Bits
4493 extern __at(0x0FB1) __sfr ECCP3CON;
4495 typedef union
4497 struct
4499 unsigned CCP3M0 : 1;
4500 unsigned CCP3M1 : 1;
4501 unsigned CCP3M2 : 1;
4502 unsigned CCP3M3 : 1;
4503 unsigned DC3B0 : 1;
4504 unsigned DC3B1 : 1;
4505 unsigned P3M0 : 1;
4506 unsigned P3M1 : 1;
4509 struct
4511 unsigned : 1;
4512 unsigned : 1;
4513 unsigned : 1;
4514 unsigned : 1;
4515 unsigned CCP3Y : 1;
4516 unsigned CCP3X : 1;
4517 unsigned : 1;
4518 unsigned : 1;
4521 struct
4523 unsigned CCP3M : 4;
4524 unsigned : 4;
4527 struct
4529 unsigned : 4;
4530 unsigned DC3B : 2;
4531 unsigned : 2;
4534 struct
4536 unsigned : 6;
4537 unsigned P3M : 2;
4539 } __ECCP3CONbits_t;
4541 extern __at(0x0FB1) volatile __ECCP3CONbits_t ECCP3CONbits;
4543 #define _ECCP3CON_CCP3M0 0x01
4544 #define _ECCP3CON_CCP3M1 0x02
4545 #define _ECCP3CON_CCP3M2 0x04
4546 #define _ECCP3CON_CCP3M3 0x08
4547 #define _ECCP3CON_DC3B0 0x10
4548 #define _ECCP3CON_CCP3Y 0x10
4549 #define _ECCP3CON_DC3B1 0x20
4550 #define _ECCP3CON_CCP3X 0x20
4551 #define _ECCP3CON_P3M0 0x40
4552 #define _ECCP3CON_P3M1 0x80
4554 //==============================================================================
4556 extern __at(0x0FB2) __sfr CCPR3;
4557 extern __at(0x0FB2) __sfr CCPR3L;
4558 extern __at(0x0FB3) __sfr CCPR3H;
4560 //==============================================================================
4561 // ECCP3DEL Bits
4563 extern __at(0x0FB4) __sfr ECCP3DEL;
4565 typedef union
4567 struct
4569 unsigned PDC0 : 1;
4570 unsigned PDC1 : 1;
4571 unsigned PDC2 : 1;
4572 unsigned PDC3 : 1;
4573 unsigned PDC4 : 1;
4574 unsigned PDC5 : 1;
4575 unsigned PDC6 : 1;
4576 unsigned PRSEN : 1;
4579 struct
4581 unsigned P3DC0 : 1;
4582 unsigned P3DC1 : 1;
4583 unsigned P3DC2 : 1;
4584 unsigned P3DC3 : 1;
4585 unsigned P3DC4 : 1;
4586 unsigned P3DC5 : 1;
4587 unsigned P3DC6 : 1;
4588 unsigned P3RSEN : 1;
4591 struct
4593 unsigned P3DC : 7;
4594 unsigned : 1;
4597 struct
4599 unsigned PDC : 7;
4600 unsigned : 1;
4602 } __ECCP3DELbits_t;
4604 extern __at(0x0FB4) volatile __ECCP3DELbits_t ECCP3DELbits;
4606 #define _ECCP3DEL_PDC0 0x01
4607 #define _ECCP3DEL_P3DC0 0x01
4608 #define _ECCP3DEL_PDC1 0x02
4609 #define _ECCP3DEL_P3DC1 0x02
4610 #define _ECCP3DEL_PDC2 0x04
4611 #define _ECCP3DEL_P3DC2 0x04
4612 #define _ECCP3DEL_PDC3 0x08
4613 #define _ECCP3DEL_P3DC3 0x08
4614 #define _ECCP3DEL_PDC4 0x10
4615 #define _ECCP3DEL_P3DC4 0x10
4616 #define _ECCP3DEL_PDC5 0x20
4617 #define _ECCP3DEL_P3DC5 0x20
4618 #define _ECCP3DEL_PDC6 0x40
4619 #define _ECCP3DEL_P3DC6 0x40
4620 #define _ECCP3DEL_PRSEN 0x80
4621 #define _ECCP3DEL_P3RSEN 0x80
4623 //==============================================================================
4626 //==============================================================================
4627 // ECCP3AS Bits
4629 extern __at(0x0FB5) __sfr ECCP3AS;
4631 typedef union
4633 struct
4635 unsigned PSSBD0 : 1;
4636 unsigned PSSBD1 : 1;
4637 unsigned PSSAC0 : 1;
4638 unsigned PSSAC1 : 1;
4639 unsigned ECCPAS0 : 1;
4640 unsigned ECCPAS1 : 1;
4641 unsigned ECCPAS2 : 1;
4642 unsigned ECCPASE : 1;
4645 struct
4647 unsigned PSS3BD0 : 1;
4648 unsigned PSS3BD1 : 1;
4649 unsigned PSS3AC0 : 1;
4650 unsigned PSS3AC1 : 1;
4651 unsigned ECCP3AS0 : 1;
4652 unsigned ECCP3AS1 : 1;
4653 unsigned ECCP3AS2 : 1;
4654 unsigned ECCP3ASE : 1;
4657 struct
4659 unsigned PSS3BD : 2;
4660 unsigned : 6;
4663 struct
4665 unsigned PSSBD : 2;
4666 unsigned : 6;
4669 struct
4671 unsigned : 2;
4672 unsigned PSS3AC : 2;
4673 unsigned : 4;
4676 struct
4678 unsigned : 2;
4679 unsigned PSSAC : 2;
4680 unsigned : 4;
4683 struct
4685 unsigned : 4;
4686 unsigned ECCPAS : 3;
4687 unsigned : 1;
4690 struct
4692 unsigned : 4;
4693 unsigned ECCP3AS : 3;
4694 unsigned : 1;
4696 } __ECCP3ASbits_t;
4698 extern __at(0x0FB5) volatile __ECCP3ASbits_t ECCP3ASbits;
4700 #define _ECCP3AS_PSSBD0 0x01
4701 #define _ECCP3AS_PSS3BD0 0x01
4702 #define _ECCP3AS_PSSBD1 0x02
4703 #define _ECCP3AS_PSS3BD1 0x02
4704 #define _ECCP3AS_PSSAC0 0x04
4705 #define _ECCP3AS_PSS3AC0 0x04
4706 #define _ECCP3AS_PSSAC1 0x08
4707 #define _ECCP3AS_PSS3AC1 0x08
4708 #define _ECCP3AS_ECCPAS0 0x10
4709 #define _ECCP3AS_ECCP3AS0 0x10
4710 #define _ECCP3AS_ECCPAS1 0x20
4711 #define _ECCP3AS_ECCP3AS1 0x20
4712 #define _ECCP3AS_ECCPAS2 0x40
4713 #define _ECCP3AS_ECCP3AS2 0x40
4714 #define _ECCP3AS_ECCPASE 0x80
4715 #define _ECCP3AS_ECCP3ASE 0x80
4717 //==============================================================================
4720 //==============================================================================
4721 // CCP2CON Bits
4723 extern __at(0x0FB6) __sfr CCP2CON;
4725 typedef union
4727 struct
4729 unsigned CCP2M0 : 1;
4730 unsigned CCP2M1 : 1;
4731 unsigned CCP2M2 : 1;
4732 unsigned CCP2M3 : 1;
4733 unsigned DC2B0 : 1;
4734 unsigned DC2B1 : 1;
4735 unsigned P2M0 : 1;
4736 unsigned P2M1 : 1;
4739 struct
4741 unsigned : 1;
4742 unsigned : 1;
4743 unsigned : 1;
4744 unsigned : 1;
4745 unsigned CCP2Y : 1;
4746 unsigned CCP2X : 1;
4747 unsigned : 1;
4748 unsigned : 1;
4751 struct
4753 unsigned CCP2M : 4;
4754 unsigned : 4;
4757 struct
4759 unsigned : 4;
4760 unsigned DC2B : 2;
4761 unsigned : 2;
4764 struct
4766 unsigned : 6;
4767 unsigned P2M : 2;
4769 } __CCP2CONbits_t;
4771 extern __at(0x0FB6) volatile __CCP2CONbits_t CCP2CONbits;
4773 #define _CCP2M0 0x01
4774 #define _CCP2M1 0x02
4775 #define _CCP2M2 0x04
4776 #define _CCP2M3 0x08
4777 #define _DC2B0 0x10
4778 #define _CCP2Y 0x10
4779 #define _DC2B1 0x20
4780 #define _CCP2X 0x20
4781 #define _P2M0 0x40
4782 #define _P2M1 0x80
4784 //==============================================================================
4787 //==============================================================================
4788 // ECCP2CON Bits
4790 extern __at(0x0FB6) __sfr ECCP2CON;
4792 typedef union
4794 struct
4796 unsigned CCP2M0 : 1;
4797 unsigned CCP2M1 : 1;
4798 unsigned CCP2M2 : 1;
4799 unsigned CCP2M3 : 1;
4800 unsigned DC2B0 : 1;
4801 unsigned DC2B1 : 1;
4802 unsigned P2M0 : 1;
4803 unsigned P2M1 : 1;
4806 struct
4808 unsigned : 1;
4809 unsigned : 1;
4810 unsigned : 1;
4811 unsigned : 1;
4812 unsigned CCP2Y : 1;
4813 unsigned CCP2X : 1;
4814 unsigned : 1;
4815 unsigned : 1;
4818 struct
4820 unsigned CCP2M : 4;
4821 unsigned : 4;
4824 struct
4826 unsigned : 4;
4827 unsigned DC2B : 2;
4828 unsigned : 2;
4831 struct
4833 unsigned : 6;
4834 unsigned P2M : 2;
4836 } __ECCP2CONbits_t;
4838 extern __at(0x0FB6) volatile __ECCP2CONbits_t ECCP2CONbits;
4840 #define _ECCP2CON_CCP2M0 0x01
4841 #define _ECCP2CON_CCP2M1 0x02
4842 #define _ECCP2CON_CCP2M2 0x04
4843 #define _ECCP2CON_CCP2M3 0x08
4844 #define _ECCP2CON_DC2B0 0x10
4845 #define _ECCP2CON_CCP2Y 0x10
4846 #define _ECCP2CON_DC2B1 0x20
4847 #define _ECCP2CON_CCP2X 0x20
4848 #define _ECCP2CON_P2M0 0x40
4849 #define _ECCP2CON_P2M1 0x80
4851 //==============================================================================
4853 extern __at(0x0FB7) __sfr CCPR2;
4854 extern __at(0x0FB7) __sfr CCPR2L;
4855 extern __at(0x0FB8) __sfr CCPR2H;
4857 //==============================================================================
4858 // ECCP2DEL Bits
4860 extern __at(0x0FB9) __sfr ECCP2DEL;
4862 typedef union
4864 struct
4866 unsigned PDC0 : 1;
4867 unsigned PDC1 : 1;
4868 unsigned PDC2 : 1;
4869 unsigned PDC3 : 1;
4870 unsigned PDC4 : 1;
4871 unsigned PDC5 : 1;
4872 unsigned PDC6 : 1;
4873 unsigned PRSEN : 1;
4876 struct
4878 unsigned P2DC0 : 1;
4879 unsigned P2DC1 : 1;
4880 unsigned P2DC2 : 1;
4881 unsigned P2DC3 : 1;
4882 unsigned P2DC4 : 1;
4883 unsigned P2DC5 : 1;
4884 unsigned P2DC6 : 1;
4885 unsigned P2RSEN : 1;
4888 struct
4890 unsigned PDC : 7;
4891 unsigned : 1;
4894 struct
4896 unsigned P2DC : 7;
4897 unsigned : 1;
4899 } __ECCP2DELbits_t;
4901 extern __at(0x0FB9) volatile __ECCP2DELbits_t ECCP2DELbits;
4903 #define _ECCP2DEL_PDC0 0x01
4904 #define _ECCP2DEL_P2DC0 0x01
4905 #define _ECCP2DEL_PDC1 0x02
4906 #define _ECCP2DEL_P2DC1 0x02
4907 #define _ECCP2DEL_PDC2 0x04
4908 #define _ECCP2DEL_P2DC2 0x04
4909 #define _ECCP2DEL_PDC3 0x08
4910 #define _ECCP2DEL_P2DC3 0x08
4911 #define _ECCP2DEL_PDC4 0x10
4912 #define _ECCP2DEL_P2DC4 0x10
4913 #define _ECCP2DEL_PDC5 0x20
4914 #define _ECCP2DEL_P2DC5 0x20
4915 #define _ECCP2DEL_PDC6 0x40
4916 #define _ECCP2DEL_P2DC6 0x40
4917 #define _ECCP2DEL_PRSEN 0x80
4918 #define _ECCP2DEL_P2RSEN 0x80
4920 //==============================================================================
4923 //==============================================================================
4924 // ECCP2AS Bits
4926 extern __at(0x0FBA) __sfr ECCP2AS;
4928 typedef union
4930 struct
4932 unsigned PSSBD0 : 1;
4933 unsigned PSSBD1 : 1;
4934 unsigned PSSAC0 : 1;
4935 unsigned PSSAC1 : 1;
4936 unsigned ECCPAS0 : 1;
4937 unsigned ECCPAS1 : 1;
4938 unsigned ECCPAS2 : 1;
4939 unsigned ECCPASE : 1;
4942 struct
4944 unsigned PSS2BD0 : 1;
4945 unsigned PSS2BD1 : 1;
4946 unsigned PSS2AC0 : 1;
4947 unsigned PSS2AC1 : 1;
4948 unsigned ECCP2AS0 : 1;
4949 unsigned ECCP2AS1 : 1;
4950 unsigned ECCP2AS2 : 1;
4951 unsigned ECCP2ASE : 1;
4954 struct
4956 unsigned PSS2BD : 2;
4957 unsigned : 6;
4960 struct
4962 unsigned PSSBD : 2;
4963 unsigned : 6;
4966 struct
4968 unsigned : 2;
4969 unsigned PSSAC : 2;
4970 unsigned : 4;
4973 struct
4975 unsigned : 2;
4976 unsigned PSS2AC : 2;
4977 unsigned : 4;
4980 struct
4982 unsigned : 4;
4983 unsigned ECCPAS : 3;
4984 unsigned : 1;
4987 struct
4989 unsigned : 4;
4990 unsigned ECCP2AS : 3;
4991 unsigned : 1;
4993 } __ECCP2ASbits_t;
4995 extern __at(0x0FBA) volatile __ECCP2ASbits_t ECCP2ASbits;
4997 #define _ECCP2AS_PSSBD0 0x01
4998 #define _ECCP2AS_PSS2BD0 0x01
4999 #define _ECCP2AS_PSSBD1 0x02
5000 #define _ECCP2AS_PSS2BD1 0x02
5001 #define _ECCP2AS_PSSAC0 0x04
5002 #define _ECCP2AS_PSS2AC0 0x04
5003 #define _ECCP2AS_PSSAC1 0x08
5004 #define _ECCP2AS_PSS2AC1 0x08
5005 #define _ECCP2AS_ECCPAS0 0x10
5006 #define _ECCP2AS_ECCP2AS0 0x10
5007 #define _ECCP2AS_ECCPAS1 0x20
5008 #define _ECCP2AS_ECCP2AS1 0x20
5009 #define _ECCP2AS_ECCPAS2 0x40
5010 #define _ECCP2AS_ECCP2AS2 0x40
5011 #define _ECCP2AS_ECCPASE 0x80
5012 #define _ECCP2AS_ECCP2ASE 0x80
5014 //==============================================================================
5017 //==============================================================================
5018 // CCP1CON Bits
5020 extern __at(0x0FBB) __sfr CCP1CON;
5022 typedef union
5024 struct
5026 unsigned CCP1M0 : 1;
5027 unsigned CCP1M1 : 1;
5028 unsigned CCP1M2 : 1;
5029 unsigned CCP1M3 : 1;
5030 unsigned DC1B0 : 1;
5031 unsigned DC1B1 : 1;
5032 unsigned P1M0 : 1;
5033 unsigned P1M1 : 1;
5036 struct
5038 unsigned : 1;
5039 unsigned : 1;
5040 unsigned : 1;
5041 unsigned : 1;
5042 unsigned CCP1Y : 1;
5043 unsigned CCP1X : 1;
5044 unsigned : 1;
5045 unsigned : 1;
5048 struct
5050 unsigned CCP1M : 4;
5051 unsigned : 4;
5054 struct
5056 unsigned : 4;
5057 unsigned DC1B : 2;
5058 unsigned : 2;
5061 struct
5063 unsigned : 6;
5064 unsigned P1M : 2;
5066 } __CCP1CONbits_t;
5068 extern __at(0x0FBB) volatile __CCP1CONbits_t CCP1CONbits;
5070 #define _CCP1M0 0x01
5071 #define _CCP1M1 0x02
5072 #define _CCP1M2 0x04
5073 #define _CCP1M3 0x08
5074 #define _DC1B0 0x10
5075 #define _CCP1Y 0x10
5076 #define _DC1B1 0x20
5077 #define _CCP1X 0x20
5078 #define _P1M0 0x40
5079 #define _P1M1 0x80
5081 //==============================================================================
5084 //==============================================================================
5085 // ECCP1CON Bits
5087 extern __at(0x0FBB) __sfr ECCP1CON;
5089 typedef union
5091 struct
5093 unsigned CCP1M0 : 1;
5094 unsigned CCP1M1 : 1;
5095 unsigned CCP1M2 : 1;
5096 unsigned CCP1M3 : 1;
5097 unsigned DC1B0 : 1;
5098 unsigned DC1B1 : 1;
5099 unsigned P1M0 : 1;
5100 unsigned P1M1 : 1;
5103 struct
5105 unsigned : 1;
5106 unsigned : 1;
5107 unsigned : 1;
5108 unsigned : 1;
5109 unsigned CCP1Y : 1;
5110 unsigned CCP1X : 1;
5111 unsigned : 1;
5112 unsigned : 1;
5115 struct
5117 unsigned CCP1M : 4;
5118 unsigned : 4;
5121 struct
5123 unsigned : 4;
5124 unsigned DC1B : 2;
5125 unsigned : 2;
5128 struct
5130 unsigned : 6;
5131 unsigned P1M : 2;
5133 } __ECCP1CONbits_t;
5135 extern __at(0x0FBB) volatile __ECCP1CONbits_t ECCP1CONbits;
5137 #define _ECCP1CON_CCP1M0 0x01
5138 #define _ECCP1CON_CCP1M1 0x02
5139 #define _ECCP1CON_CCP1M2 0x04
5140 #define _ECCP1CON_CCP1M3 0x08
5141 #define _ECCP1CON_DC1B0 0x10
5142 #define _ECCP1CON_CCP1Y 0x10
5143 #define _ECCP1CON_DC1B1 0x20
5144 #define _ECCP1CON_CCP1X 0x20
5145 #define _ECCP1CON_P1M0 0x40
5146 #define _ECCP1CON_P1M1 0x80
5148 //==============================================================================
5150 extern __at(0x0FBC) __sfr CCPR1;
5151 extern __at(0x0FBC) __sfr CCPR1L;
5152 extern __at(0x0FBD) __sfr CCPR1H;
5154 //==============================================================================
5155 // ECCP1DEL Bits
5157 extern __at(0x0FBE) __sfr ECCP1DEL;
5159 typedef union
5161 struct
5163 unsigned PDC0 : 1;
5164 unsigned PDC1 : 1;
5165 unsigned PDC2 : 1;
5166 unsigned PDC3 : 1;
5167 unsigned PDC4 : 1;
5168 unsigned PDC5 : 1;
5169 unsigned PDC6 : 1;
5170 unsigned PRSEN : 1;
5173 struct
5175 unsigned P1DC0 : 1;
5176 unsigned P1DC1 : 1;
5177 unsigned P1DC2 : 1;
5178 unsigned P1DC3 : 1;
5179 unsigned P1DC4 : 1;
5180 unsigned P1DC5 : 1;
5181 unsigned P1DC6 : 1;
5182 unsigned P1RSEN : 1;
5185 struct
5187 unsigned P1DC : 7;
5188 unsigned : 1;
5191 struct
5193 unsigned PDC : 7;
5194 unsigned : 1;
5196 } __ECCP1DELbits_t;
5198 extern __at(0x0FBE) volatile __ECCP1DELbits_t ECCP1DELbits;
5200 #define _PDC0 0x01
5201 #define _P1DC0 0x01
5202 #define _PDC1 0x02
5203 #define _P1DC1 0x02
5204 #define _PDC2 0x04
5205 #define _P1DC2 0x04
5206 #define _PDC3 0x08
5207 #define _P1DC3 0x08
5208 #define _PDC4 0x10
5209 #define _P1DC4 0x10
5210 #define _PDC5 0x20
5211 #define _P1DC5 0x20
5212 #define _PDC6 0x40
5213 #define _P1DC6 0x40
5214 #define _PRSEN 0x80
5215 #define _P1RSEN 0x80
5217 //==============================================================================
5220 //==============================================================================
5221 // ECCP1AS Bits
5223 extern __at(0x0FBF) __sfr ECCP1AS;
5225 typedef union
5227 struct
5229 unsigned PSSBD0 : 1;
5230 unsigned PSSBD1 : 1;
5231 unsigned PSSAC0 : 1;
5232 unsigned PSSAC1 : 1;
5233 unsigned ECCPAS0 : 1;
5234 unsigned ECCPAS1 : 1;
5235 unsigned ECCPAS2 : 1;
5236 unsigned ECCPASE : 1;
5239 struct
5241 unsigned PSS1BD0 : 1;
5242 unsigned PSS1BD1 : 1;
5243 unsigned PSS1AC0 : 1;
5244 unsigned PSS1AC1 : 1;
5245 unsigned ECCP1AS0 : 1;
5246 unsigned ECCP1AS1 : 1;
5247 unsigned ECCP1AS2 : 1;
5248 unsigned ECCP1ASE : 1;
5251 struct
5253 unsigned PSS1BD : 2;
5254 unsigned : 6;
5257 struct
5259 unsigned PSSBD : 2;
5260 unsigned : 6;
5263 struct
5265 unsigned : 2;
5266 unsigned PSS1AC : 2;
5267 unsigned : 4;
5270 struct
5272 unsigned : 2;
5273 unsigned PSSAC : 2;
5274 unsigned : 4;
5277 struct
5279 unsigned : 4;
5280 unsigned ECCP1AS : 3;
5281 unsigned : 1;
5284 struct
5286 unsigned : 4;
5287 unsigned ECCPAS : 3;
5288 unsigned : 1;
5290 } __ECCP1ASbits_t;
5292 extern __at(0x0FBF) volatile __ECCP1ASbits_t ECCP1ASbits;
5294 #define _PSSBD0 0x01
5295 #define _PSS1BD0 0x01
5296 #define _PSSBD1 0x02
5297 #define _PSS1BD1 0x02
5298 #define _PSSAC0 0x04
5299 #define _PSS1AC0 0x04
5300 #define _PSSAC1 0x08
5301 #define _PSS1AC1 0x08
5302 #define _ECCPAS0 0x10
5303 #define _ECCP1AS0 0x10
5304 #define _ECCPAS1 0x20
5305 #define _ECCP1AS1 0x20
5306 #define _ECCPAS2 0x40
5307 #define _ECCP1AS2 0x40
5308 #define _ECCPASE 0x80
5309 #define _ECCP1ASE 0x80
5311 //==============================================================================
5314 //==============================================================================
5315 // WDTCON Bits
5317 extern __at(0x0FC0) __sfr WDTCON;
5319 typedef union
5321 struct
5323 unsigned SWDTEN : 1;
5324 unsigned : 1;
5325 unsigned : 1;
5326 unsigned : 1;
5327 unsigned ADSHR : 1;
5328 unsigned : 1;
5329 unsigned LVDSTAT : 1;
5330 unsigned REGSLP : 1;
5333 struct
5335 unsigned SWDTE : 1;
5336 unsigned : 1;
5337 unsigned : 1;
5338 unsigned : 1;
5339 unsigned DEVCFG : 1;
5340 unsigned : 1;
5341 unsigned : 1;
5342 unsigned : 1;
5344 } __WDTCONbits_t;
5346 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
5348 #define _SWDTEN 0x01
5349 #define _SWDTE 0x01
5350 #define _ADSHR 0x10
5351 #define _DEVCFG 0x10
5352 #define _LVDSTAT 0x40
5353 #define _REGSLP 0x80
5355 //==============================================================================
5358 //==============================================================================
5359 // ADCON1 Bits
5361 extern __at(0x0FC1) __sfr ADCON1;
5363 typedef union
5365 struct
5367 unsigned ADCS0 : 1;
5368 unsigned ADCS1 : 1;
5369 unsigned ADCS2 : 1;
5370 unsigned ACQT0 : 1;
5371 unsigned ACQT1 : 1;
5372 unsigned ACQT2 : 1;
5373 unsigned ADCAL : 1;
5374 unsigned ADFM : 1;
5377 struct
5379 unsigned ADCS : 3;
5380 unsigned : 5;
5383 struct
5385 unsigned : 3;
5386 unsigned ACQT : 3;
5387 unsigned : 2;
5389 } __ADCON1bits_t;
5391 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5393 #define _ADCS0 0x01
5394 #define _ADCS1 0x02
5395 #define _ADCS2 0x04
5396 #define _ACQT0 0x08
5397 #define _ACQT1 0x10
5398 #define _ACQT2 0x20
5399 #define _ADCAL 0x40
5400 #define _ADFM 0x80
5402 //==============================================================================
5405 //==============================================================================
5406 // ANCON0 Bits
5408 extern __at(0x0FC1) __sfr ANCON0;
5410 typedef struct
5412 unsigned PCFG0 : 1;
5413 unsigned PCFG1 : 1;
5414 unsigned PCFG2 : 1;
5415 unsigned PCFG3 : 1;
5416 unsigned PCFG4 : 1;
5417 unsigned : 1;
5418 unsigned : 1;
5419 unsigned PCFG7 : 1;
5420 } __ANCON0bits_t;
5422 extern __at(0x0FC1) volatile __ANCON0bits_t ANCON0bits;
5424 #define _PCFG0 0x01
5425 #define _PCFG1 0x02
5426 #define _PCFG2 0x04
5427 #define _PCFG3 0x08
5428 #define _PCFG4 0x10
5429 #define _PCFG7 0x80
5431 //==============================================================================
5434 //==============================================================================
5435 // ADCON0 Bits
5437 extern __at(0x0FC2) __sfr ADCON0;
5439 typedef union
5441 struct
5443 unsigned ADON : 1;
5444 unsigned GO_NOT_DONE : 1;
5445 unsigned CHS0 : 1;
5446 unsigned CHS1 : 1;
5447 unsigned CHS2 : 1;
5448 unsigned CHS3 : 1;
5449 unsigned VCFG0 : 1;
5450 unsigned VCFG1 : 1;
5453 struct
5455 unsigned : 1;
5456 unsigned DONE : 1;
5457 unsigned : 1;
5458 unsigned : 1;
5459 unsigned : 1;
5460 unsigned : 1;
5461 unsigned : 1;
5462 unsigned : 1;
5465 struct
5467 unsigned : 1;
5468 unsigned GO_DONE : 1;
5469 unsigned : 1;
5470 unsigned : 1;
5471 unsigned : 1;
5472 unsigned : 1;
5473 unsigned : 1;
5474 unsigned : 1;
5477 struct
5479 unsigned : 1;
5480 unsigned GO : 1;
5481 unsigned : 1;
5482 unsigned : 1;
5483 unsigned : 1;
5484 unsigned : 1;
5485 unsigned : 1;
5486 unsigned : 1;
5489 struct
5491 unsigned : 1;
5492 unsigned NOT_DONE : 1;
5493 unsigned : 1;
5494 unsigned : 1;
5495 unsigned : 1;
5496 unsigned : 1;
5497 unsigned : 1;
5498 unsigned : 1;
5501 struct
5503 unsigned : 2;
5504 unsigned CHS : 4;
5505 unsigned : 2;
5508 struct
5510 unsigned : 6;
5511 unsigned VCFG : 2;
5513 } __ADCON0bits_t;
5515 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5517 #define _ADON 0x01
5518 #define _GO_NOT_DONE 0x02
5519 #define _DONE 0x02
5520 #define _GO_DONE 0x02
5521 #define _GO 0x02
5522 #define _NOT_DONE 0x02
5523 #define _CHS0 0x04
5524 #define _CHS1 0x08
5525 #define _CHS2 0x10
5526 #define _CHS3 0x20
5527 #define _VCFG0 0x40
5528 #define _VCFG1 0x80
5530 //==============================================================================
5533 //==============================================================================
5534 // ANCON1 Bits
5536 extern __at(0x0FC2) __sfr ANCON1;
5538 typedef struct
5540 unsigned : 1;
5541 unsigned : 1;
5542 unsigned PCFG10 : 1;
5543 unsigned PCFG11 : 1;
5544 unsigned : 1;
5545 unsigned : 1;
5546 unsigned : 1;
5547 unsigned : 1;
5548 } __ANCON1bits_t;
5550 extern __at(0x0FC2) volatile __ANCON1bits_t ANCON1bits;
5552 #define _PCFG10 0x04
5553 #define _PCFG11 0x08
5555 //==============================================================================
5557 extern __at(0x0FC3) __sfr ADRES;
5558 extern __at(0x0FC3) __sfr ADRESL;
5559 extern __at(0x0FC4) __sfr ADRESH;
5561 //==============================================================================
5562 // SSP1CON2 Bits
5564 extern __at(0x0FC5) __sfr SSP1CON2;
5566 typedef union
5568 struct
5570 unsigned SEN : 1;
5571 unsigned RSEN : 1;
5572 unsigned PEN : 1;
5573 unsigned RCEN : 1;
5574 unsigned ACKEN : 1;
5575 unsigned ACKDT : 1;
5576 unsigned ACKSTAT : 1;
5577 unsigned GCEN : 1;
5580 struct
5582 unsigned : 1;
5583 unsigned ADMSK1 : 1;
5584 unsigned ADMSK2 : 1;
5585 unsigned ADMSK3 : 1;
5586 unsigned ADMSK4 : 1;
5587 unsigned ADMSK5 : 1;
5588 unsigned : 1;
5589 unsigned : 1;
5591 } __SSP1CON2bits_t;
5593 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5595 #define _SEN 0x01
5596 #define _RSEN 0x02
5597 #define _ADMSK1 0x02
5598 #define _PEN 0x04
5599 #define _ADMSK2 0x04
5600 #define _RCEN 0x08
5601 #define _ADMSK3 0x08
5602 #define _ACKEN 0x10
5603 #define _ADMSK4 0x10
5604 #define _ACKDT 0x20
5605 #define _ADMSK5 0x20
5606 #define _ACKSTAT 0x40
5607 #define _GCEN 0x80
5609 //==============================================================================
5612 //==============================================================================
5613 // SSPCON2 Bits
5615 extern __at(0x0FC5) __sfr SSPCON2;
5617 typedef union
5619 struct
5621 unsigned SEN : 1;
5622 unsigned RSEN : 1;
5623 unsigned PEN : 1;
5624 unsigned RCEN : 1;
5625 unsigned ACKEN : 1;
5626 unsigned ACKDT : 1;
5627 unsigned ACKSTAT : 1;
5628 unsigned GCEN : 1;
5631 struct
5633 unsigned : 1;
5634 unsigned ADMSK1 : 1;
5635 unsigned ADMSK2 : 1;
5636 unsigned ADMSK3 : 1;
5637 unsigned ADMSK4 : 1;
5638 unsigned ADMSK5 : 1;
5639 unsigned : 1;
5640 unsigned : 1;
5642 } __SSPCON2bits_t;
5644 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5646 #define _SSPCON2_SEN 0x01
5647 #define _SSPCON2_RSEN 0x02
5648 #define _SSPCON2_ADMSK1 0x02
5649 #define _SSPCON2_PEN 0x04
5650 #define _SSPCON2_ADMSK2 0x04
5651 #define _SSPCON2_RCEN 0x08
5652 #define _SSPCON2_ADMSK3 0x08
5653 #define _SSPCON2_ACKEN 0x10
5654 #define _SSPCON2_ADMSK4 0x10
5655 #define _SSPCON2_ACKDT 0x20
5656 #define _SSPCON2_ADMSK5 0x20
5657 #define _SSPCON2_ACKSTAT 0x40
5658 #define _SSPCON2_GCEN 0x80
5660 //==============================================================================
5663 //==============================================================================
5664 // SSP1CON1 Bits
5666 extern __at(0x0FC6) __sfr SSP1CON1;
5668 typedef union
5670 struct
5672 unsigned SSPM0 : 1;
5673 unsigned SSPM1 : 1;
5674 unsigned SSPM2 : 1;
5675 unsigned SSPM3 : 1;
5676 unsigned CKP : 1;
5677 unsigned SSPEN : 1;
5678 unsigned SSPOV : 1;
5679 unsigned WCOL : 1;
5682 struct
5684 unsigned SSPM : 4;
5685 unsigned : 4;
5687 } __SSP1CON1bits_t;
5689 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5691 #define _SSPM0 0x01
5692 #define _SSPM1 0x02
5693 #define _SSPM2 0x04
5694 #define _SSPM3 0x08
5695 #define _CKP 0x10
5696 #define _SSPEN 0x20
5697 #define _SSPOV 0x40
5698 #define _WCOL 0x80
5700 //==============================================================================
5703 //==============================================================================
5704 // SSPCON1 Bits
5706 extern __at(0x0FC6) __sfr SSPCON1;
5708 typedef union
5710 struct
5712 unsigned SSPM0 : 1;
5713 unsigned SSPM1 : 1;
5714 unsigned SSPM2 : 1;
5715 unsigned SSPM3 : 1;
5716 unsigned CKP : 1;
5717 unsigned SSPEN : 1;
5718 unsigned SSPOV : 1;
5719 unsigned WCOL : 1;
5722 struct
5724 unsigned SSPM : 4;
5725 unsigned : 4;
5727 } __SSPCON1bits_t;
5729 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5731 #define _SSPCON1_SSPM0 0x01
5732 #define _SSPCON1_SSPM1 0x02
5733 #define _SSPCON1_SSPM2 0x04
5734 #define _SSPCON1_SSPM3 0x08
5735 #define _SSPCON1_CKP 0x10
5736 #define _SSPCON1_SSPEN 0x20
5737 #define _SSPCON1_SSPOV 0x40
5738 #define _SSPCON1_WCOL 0x80
5740 //==============================================================================
5743 //==============================================================================
5744 // SSP1STAT Bits
5746 extern __at(0x0FC7) __sfr SSP1STAT;
5748 typedef union
5750 struct
5752 unsigned BF : 1;
5753 unsigned UA : 1;
5754 unsigned R_NOT_W : 1;
5755 unsigned S : 1;
5756 unsigned P : 1;
5757 unsigned D_NOT_A : 1;
5758 unsigned CKE : 1;
5759 unsigned SMP : 1;
5762 struct
5764 unsigned : 1;
5765 unsigned : 1;
5766 unsigned R_W : 1;
5767 unsigned I2C_START : 1;
5768 unsigned I2C_STOP : 1;
5769 unsigned D_A : 1;
5770 unsigned : 1;
5771 unsigned : 1;
5774 struct
5776 unsigned : 1;
5777 unsigned : 1;
5778 unsigned I2C_READ : 1;
5779 unsigned : 1;
5780 unsigned : 1;
5781 unsigned I2C_DAT : 1;
5782 unsigned : 1;
5783 unsigned : 1;
5786 struct
5788 unsigned : 1;
5789 unsigned : 1;
5790 unsigned NOT_W : 1;
5791 unsigned : 1;
5792 unsigned : 1;
5793 unsigned NOT_A : 1;
5794 unsigned : 1;
5795 unsigned : 1;
5798 struct
5800 unsigned : 1;
5801 unsigned : 1;
5802 unsigned NOT_WRITE : 1;
5803 unsigned : 1;
5804 unsigned : 1;
5805 unsigned NOT_ADDRESS : 1;
5806 unsigned : 1;
5807 unsigned : 1;
5810 struct
5812 unsigned : 1;
5813 unsigned : 1;
5814 unsigned READ_WRITE : 1;
5815 unsigned : 1;
5816 unsigned : 1;
5817 unsigned DATA_ADDRESS : 1;
5818 unsigned : 1;
5819 unsigned : 1;
5822 struct
5824 unsigned : 1;
5825 unsigned : 1;
5826 unsigned R : 1;
5827 unsigned : 1;
5828 unsigned : 1;
5829 unsigned D : 1;
5830 unsigned : 1;
5831 unsigned : 1;
5833 } __SSP1STATbits_t;
5835 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5837 #define _BF 0x01
5838 #define _UA 0x02
5839 #define _R_NOT_W 0x04
5840 #define _R_W 0x04
5841 #define _I2C_READ 0x04
5842 #define _NOT_W 0x04
5843 #define _NOT_WRITE 0x04
5844 #define _READ_WRITE 0x04
5845 #define _R 0x04
5846 #define _S 0x08
5847 #define _I2C_START 0x08
5848 #define _P 0x10
5849 #define _I2C_STOP 0x10
5850 #define _D_NOT_A 0x20
5851 #define _D_A 0x20
5852 #define _I2C_DAT 0x20
5853 #define _NOT_A 0x20
5854 #define _NOT_ADDRESS 0x20
5855 #define _DATA_ADDRESS 0x20
5856 #define _D 0x20
5857 #define _CKE 0x40
5858 #define _SMP 0x80
5860 //==============================================================================
5863 //==============================================================================
5864 // SSPSTAT Bits
5866 extern __at(0x0FC7) __sfr SSPSTAT;
5868 typedef union
5870 struct
5872 unsigned BF : 1;
5873 unsigned UA : 1;
5874 unsigned R_NOT_W : 1;
5875 unsigned S : 1;
5876 unsigned P : 1;
5877 unsigned D_NOT_A : 1;
5878 unsigned CKE : 1;
5879 unsigned SMP : 1;
5882 struct
5884 unsigned : 1;
5885 unsigned : 1;
5886 unsigned R_W : 1;
5887 unsigned I2C_START : 1;
5888 unsigned I2C_STOP : 1;
5889 unsigned D_A : 1;
5890 unsigned : 1;
5891 unsigned : 1;
5894 struct
5896 unsigned : 1;
5897 unsigned : 1;
5898 unsigned I2C_READ : 1;
5899 unsigned : 1;
5900 unsigned : 1;
5901 unsigned I2C_DAT : 1;
5902 unsigned : 1;
5903 unsigned : 1;
5906 struct
5908 unsigned : 1;
5909 unsigned : 1;
5910 unsigned NOT_W : 1;
5911 unsigned : 1;
5912 unsigned : 1;
5913 unsigned NOT_A : 1;
5914 unsigned : 1;
5915 unsigned : 1;
5918 struct
5920 unsigned : 1;
5921 unsigned : 1;
5922 unsigned NOT_WRITE : 1;
5923 unsigned : 1;
5924 unsigned : 1;
5925 unsigned NOT_ADDRESS : 1;
5926 unsigned : 1;
5927 unsigned : 1;
5930 struct
5932 unsigned : 1;
5933 unsigned : 1;
5934 unsigned READ_WRITE : 1;
5935 unsigned : 1;
5936 unsigned : 1;
5937 unsigned DATA_ADDRESS : 1;
5938 unsigned : 1;
5939 unsigned : 1;
5942 struct
5944 unsigned : 1;
5945 unsigned : 1;
5946 unsigned R : 1;
5947 unsigned : 1;
5948 unsigned : 1;
5949 unsigned D : 1;
5950 unsigned : 1;
5951 unsigned : 1;
5953 } __SSPSTATbits_t;
5955 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5957 #define _SSPSTAT_BF 0x01
5958 #define _SSPSTAT_UA 0x02
5959 #define _SSPSTAT_R_NOT_W 0x04
5960 #define _SSPSTAT_R_W 0x04
5961 #define _SSPSTAT_I2C_READ 0x04
5962 #define _SSPSTAT_NOT_W 0x04
5963 #define _SSPSTAT_NOT_WRITE 0x04
5964 #define _SSPSTAT_READ_WRITE 0x04
5965 #define _SSPSTAT_R 0x04
5966 #define _SSPSTAT_S 0x08
5967 #define _SSPSTAT_I2C_START 0x08
5968 #define _SSPSTAT_P 0x10
5969 #define _SSPSTAT_I2C_STOP 0x10
5970 #define _SSPSTAT_D_NOT_A 0x20
5971 #define _SSPSTAT_D_A 0x20
5972 #define _SSPSTAT_I2C_DAT 0x20
5973 #define _SSPSTAT_NOT_A 0x20
5974 #define _SSPSTAT_NOT_ADDRESS 0x20
5975 #define _SSPSTAT_DATA_ADDRESS 0x20
5976 #define _SSPSTAT_D 0x20
5977 #define _SSPSTAT_CKE 0x40
5978 #define _SSPSTAT_SMP 0x80
5980 //==============================================================================
5982 extern __at(0x0FC8) __sfr SSP1ADD;
5984 //==============================================================================
5985 // SSP1MSK Bits
5987 extern __at(0x0FC8) __sfr SSP1MSK;
5989 typedef struct
5991 unsigned MSK0 : 1;
5992 unsigned MSK1 : 1;
5993 unsigned MSK2 : 1;
5994 unsigned MSK3 : 1;
5995 unsigned MSK4 : 1;
5996 unsigned MSK5 : 1;
5997 unsigned MSK6 : 1;
5998 unsigned MSK7 : 1;
5999 } __SSP1MSKbits_t;
6001 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
6003 #define _MSK0 0x01
6004 #define _MSK1 0x02
6005 #define _MSK2 0x04
6006 #define _MSK3 0x08
6007 #define _MSK4 0x10
6008 #define _MSK5 0x20
6009 #define _MSK6 0x40
6010 #define _MSK7 0x80
6012 //==============================================================================
6014 extern __at(0x0FC8) __sfr SSPADD;
6015 extern __at(0x0FC9) __sfr SSP1BUF;
6016 extern __at(0x0FC9) __sfr SSPBUF;
6018 //==============================================================================
6019 // T2CON Bits
6021 extern __at(0x0FCA) __sfr T2CON;
6023 typedef union
6025 struct
6027 unsigned T2CKPS0 : 1;
6028 unsigned T2CKPS1 : 1;
6029 unsigned TMR2ON : 1;
6030 unsigned T2OUTPS0 : 1;
6031 unsigned T2OUTPS1 : 1;
6032 unsigned T2OUTPS2 : 1;
6033 unsigned T2OUTPS3 : 1;
6034 unsigned : 1;
6037 struct
6039 unsigned T2CKPS : 2;
6040 unsigned : 6;
6043 struct
6045 unsigned : 3;
6046 unsigned T2OUTPS : 4;
6047 unsigned : 1;
6049 } __T2CONbits_t;
6051 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
6053 #define _T2CKPS0 0x01
6054 #define _T2CKPS1 0x02
6055 #define _TMR2ON 0x04
6056 #define _T2OUTPS0 0x08
6057 #define _T2OUTPS1 0x10
6058 #define _T2OUTPS2 0x20
6059 #define _T2OUTPS3 0x40
6061 //==============================================================================
6063 extern __at(0x0FCB) __sfr PR2;
6065 //==============================================================================
6066 // PADCFG1 Bits
6068 extern __at(0x0FCC) __sfr PADCFG1;
6070 typedef union
6072 struct
6074 unsigned PMPTL : 1;
6075 unsigned : 1;
6076 unsigned : 1;
6077 unsigned : 1;
6078 unsigned : 1;
6079 unsigned : 1;
6080 unsigned : 1;
6081 unsigned : 1;
6084 struct
6086 unsigned PMPTTL : 1;
6087 unsigned : 1;
6088 unsigned : 1;
6089 unsigned : 1;
6090 unsigned : 1;
6091 unsigned : 1;
6092 unsigned : 1;
6093 unsigned : 1;
6095 } __PADCFG1bits_t;
6097 extern __at(0x0FCC) volatile __PADCFG1bits_t PADCFG1bits;
6099 #define _PMPTL 0x01
6100 #define _PMPTTL 0x01
6102 //==============================================================================
6104 extern __at(0x0FCC) __sfr TMR2;
6106 //==============================================================================
6107 // ODCON3 Bits
6109 extern __at(0x0FCD) __sfr ODCON3;
6111 typedef struct
6113 unsigned SPI1OD : 1;
6114 unsigned SPI2OD : 1;
6115 unsigned : 1;
6116 unsigned : 1;
6117 unsigned : 1;
6118 unsigned : 1;
6119 unsigned : 1;
6120 unsigned : 1;
6121 } __ODCON3bits_t;
6123 extern __at(0x0FCD) volatile __ODCON3bits_t ODCON3bits;
6125 #define _SPI1OD 0x01
6126 #define _SPI2OD 0x02
6128 //==============================================================================
6131 //==============================================================================
6132 // T1CON Bits
6134 extern __at(0x0FCD) __sfr T1CON;
6136 typedef union
6138 struct
6140 unsigned TMR1ON : 1;
6141 unsigned TMR1CS : 1;
6142 unsigned NOT_T1SYNC : 1;
6143 unsigned T1OSCEN : 1;
6144 unsigned T1CKPS0 : 1;
6145 unsigned T1CKPS1 : 1;
6146 unsigned T1RUN : 1;
6147 unsigned RD16 : 1;
6150 struct
6152 unsigned : 1;
6153 unsigned : 1;
6154 unsigned T1SYNC : 1;
6155 unsigned : 1;
6156 unsigned : 1;
6157 unsigned : 1;
6158 unsigned : 1;
6159 unsigned : 1;
6162 struct
6164 unsigned : 1;
6165 unsigned : 1;
6166 unsigned T1INSYNC : 1;
6167 unsigned : 1;
6168 unsigned : 1;
6169 unsigned : 1;
6170 unsigned : 1;
6171 unsigned : 1;
6174 struct
6176 unsigned : 4;
6177 unsigned T1CKPS : 2;
6178 unsigned : 2;
6180 } __T1CONbits_t;
6182 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6184 #define _TMR1ON 0x01
6185 #define _TMR1CS 0x02
6186 #define _NOT_T1SYNC 0x04
6187 #define _T1SYNC 0x04
6188 #define _T1INSYNC 0x04
6189 #define _T1OSCEN 0x08
6190 #define _T1CKPS0 0x10
6191 #define _T1CKPS1 0x20
6192 #define _T1RUN 0x40
6193 #define _RD16 0x80
6195 //==============================================================================
6198 //==============================================================================
6199 // ODCON2 Bits
6201 extern __at(0x0FCE) __sfr ODCON2;
6203 typedef union
6205 struct
6207 unsigned USART1OD : 1;
6208 unsigned USART2OD : 1;
6209 unsigned : 1;
6210 unsigned : 1;
6211 unsigned : 1;
6212 unsigned : 1;
6213 unsigned : 1;
6214 unsigned : 1;
6217 struct
6219 unsigned U1OD : 1;
6220 unsigned U2OD : 1;
6221 unsigned : 1;
6222 unsigned : 1;
6223 unsigned : 1;
6224 unsigned : 1;
6225 unsigned : 1;
6226 unsigned : 1;
6228 } __ODCON2bits_t;
6230 extern __at(0x0FCE) volatile __ODCON2bits_t ODCON2bits;
6232 #define _USART1OD 0x01
6233 #define _U1OD 0x01
6234 #define _USART2OD 0x02
6235 #define _U2OD 0x02
6237 //==============================================================================
6239 extern __at(0x0FCE) __sfr TMR1;
6240 extern __at(0x0FCE) __sfr TMR1L;
6242 //==============================================================================
6243 // ODCON1 Bits
6245 extern __at(0x0FCF) __sfr ODCON1;
6247 typedef struct
6249 unsigned ECCP1OD : 1;
6250 unsigned ECCP2OD : 1;
6251 unsigned ECCP3OD : 1;
6252 unsigned CCP4OD : 1;
6253 unsigned CCP5OD : 1;
6254 unsigned : 1;
6255 unsigned : 1;
6256 unsigned : 1;
6257 } __ODCON1bits_t;
6259 extern __at(0x0FCF) volatile __ODCON1bits_t ODCON1bits;
6261 #define _ECCP1OD 0x01
6262 #define _ECCP2OD 0x02
6263 #define _ECCP3OD 0x04
6264 #define _CCP4OD 0x08
6265 #define _CCP5OD 0x10
6267 //==============================================================================
6269 extern __at(0x0FCF) __sfr TMR1H;
6271 //==============================================================================
6272 // RCON Bits
6274 extern __at(0x0FD0) __sfr RCON;
6276 typedef union
6278 struct
6280 unsigned NOT_BOR : 1;
6281 unsigned NOT_POR : 1;
6282 unsigned NOT_PD : 1;
6283 unsigned NOT_TO : 1;
6284 unsigned NOT_RI : 1;
6285 unsigned NOT_CM : 1;
6286 unsigned : 1;
6287 unsigned IPEN : 1;
6290 struct
6292 unsigned BOR : 1;
6293 unsigned POR : 1;
6294 unsigned PD : 1;
6295 unsigned TO : 1;
6296 unsigned RI : 1;
6297 unsigned CM : 1;
6298 unsigned : 1;
6299 unsigned : 1;
6301 } __RCONbits_t;
6303 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6305 #define _NOT_BOR 0x01
6306 #define _BOR 0x01
6307 #define _NOT_POR 0x02
6308 #define _POR 0x02
6309 #define _NOT_PD 0x04
6310 #define _PD 0x04
6311 #define _NOT_TO 0x08
6312 #define _TO 0x08
6313 #define _NOT_RI 0x10
6314 #define _RI 0x10
6315 #define _NOT_CM 0x20
6316 #define _CM 0x20
6317 #define _IPEN 0x80
6319 //==============================================================================
6322 //==============================================================================
6323 // CM2CON Bits
6325 extern __at(0x0FD1) __sfr CM2CON;
6327 typedef union
6329 struct
6331 unsigned C1CH0 : 1;
6332 unsigned C1CH1 : 1;
6333 unsigned CREF : 1;
6334 unsigned EVPOL0 : 1;
6335 unsigned EVPOL1 : 1;
6336 unsigned CPOL : 1;
6337 unsigned COE : 1;
6338 unsigned CON : 1;
6341 struct
6343 unsigned CCH0 : 1;
6344 unsigned CCH1 : 1;
6345 unsigned CREF2 : 1;
6346 unsigned EVPOL02 : 1;
6347 unsigned EVPOL12 : 1;
6348 unsigned CPOL2 : 1;
6349 unsigned COE2 : 1;
6350 unsigned CON2 : 1;
6353 struct
6355 unsigned C1CH02 : 1;
6356 unsigned C1CH12 : 1;
6357 unsigned : 1;
6358 unsigned : 1;
6359 unsigned : 1;
6360 unsigned : 1;
6361 unsigned : 1;
6362 unsigned : 1;
6365 struct
6367 unsigned CCH : 2;
6368 unsigned : 6;
6370 } __CM2CONbits_t;
6372 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
6374 #define _CM2CON_C1CH0 0x01
6375 #define _CM2CON_CCH0 0x01
6376 #define _CM2CON_C1CH02 0x01
6377 #define _CM2CON_C1CH1 0x02
6378 #define _CM2CON_CCH1 0x02
6379 #define _CM2CON_C1CH12 0x02
6380 #define _CM2CON_CREF 0x04
6381 #define _CM2CON_CREF2 0x04
6382 #define _CM2CON_EVPOL0 0x08
6383 #define _CM2CON_EVPOL02 0x08
6384 #define _CM2CON_EVPOL1 0x10
6385 #define _CM2CON_EVPOL12 0x10
6386 #define _CM2CON_CPOL 0x20
6387 #define _CM2CON_CPOL2 0x20
6388 #define _CM2CON_COE 0x40
6389 #define _CM2CON_COE2 0x40
6390 #define _CM2CON_CON 0x80
6391 #define _CM2CON_CON2 0x80
6393 //==============================================================================
6396 //==============================================================================
6397 // CM2CON1 Bits
6399 extern __at(0x0FD1) __sfr CM2CON1;
6401 typedef union
6403 struct
6405 unsigned C1CH0 : 1;
6406 unsigned C1CH1 : 1;
6407 unsigned CREF : 1;
6408 unsigned EVPOL0 : 1;
6409 unsigned EVPOL1 : 1;
6410 unsigned CPOL : 1;
6411 unsigned COE : 1;
6412 unsigned CON : 1;
6415 struct
6417 unsigned CCH0 : 1;
6418 unsigned CCH1 : 1;
6419 unsigned CREF2 : 1;
6420 unsigned EVPOL02 : 1;
6421 unsigned EVPOL12 : 1;
6422 unsigned CPOL2 : 1;
6423 unsigned COE2 : 1;
6424 unsigned CON2 : 1;
6427 struct
6429 unsigned C1CH02 : 1;
6430 unsigned C1CH12 : 1;
6431 unsigned : 1;
6432 unsigned : 1;
6433 unsigned : 1;
6434 unsigned : 1;
6435 unsigned : 1;
6436 unsigned : 1;
6439 struct
6441 unsigned CCH : 2;
6442 unsigned : 6;
6444 } __CM2CON1bits_t;
6446 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
6448 #define _CM2CON1_C1CH0 0x01
6449 #define _CM2CON1_CCH0 0x01
6450 #define _CM2CON1_C1CH02 0x01
6451 #define _CM2CON1_C1CH1 0x02
6452 #define _CM2CON1_CCH1 0x02
6453 #define _CM2CON1_C1CH12 0x02
6454 #define _CM2CON1_CREF 0x04
6455 #define _CM2CON1_CREF2 0x04
6456 #define _CM2CON1_EVPOL0 0x08
6457 #define _CM2CON1_EVPOL02 0x08
6458 #define _CM2CON1_EVPOL1 0x10
6459 #define _CM2CON1_EVPOL12 0x10
6460 #define _CM2CON1_CPOL 0x20
6461 #define _CM2CON1_CPOL2 0x20
6462 #define _CM2CON1_COE 0x40
6463 #define _CM2CON1_COE2 0x40
6464 #define _CM2CON1_CON 0x80
6465 #define _CM2CON1_CON2 0x80
6467 //==============================================================================
6470 //==============================================================================
6471 // CM1CON Bits
6473 extern __at(0x0FD2) __sfr CM1CON;
6475 typedef union
6477 struct
6479 unsigned C1CH0 : 1;
6480 unsigned C1CH1 : 1;
6481 unsigned CREF : 1;
6482 unsigned EVPOL0 : 1;
6483 unsigned EVPOL1 : 1;
6484 unsigned CPOL : 1;
6485 unsigned COE : 1;
6486 unsigned CON : 1;
6489 struct
6491 unsigned CCH0 : 1;
6492 unsigned CCH1 : 1;
6493 unsigned : 1;
6494 unsigned : 1;
6495 unsigned : 1;
6496 unsigned : 1;
6497 unsigned : 1;
6498 unsigned : 1;
6501 struct
6503 unsigned C1CH : 2;
6504 unsigned : 6;
6507 struct
6509 unsigned CCH : 2;
6510 unsigned : 6;
6513 struct
6515 unsigned : 3;
6516 unsigned EVPOL : 2;
6517 unsigned : 3;
6519 } __CM1CONbits_t;
6521 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
6523 #define _C1CH0 0x01
6524 #define _CCH0 0x01
6525 #define _C1CH1 0x02
6526 #define _CCH1 0x02
6527 #define _CREF 0x04
6528 #define _EVPOL0 0x08
6529 #define _EVPOL1 0x10
6530 #define _CPOL 0x20
6531 #define _COE 0x40
6532 #define _CON 0x80
6534 //==============================================================================
6537 //==============================================================================
6538 // CM1CON1 Bits
6540 extern __at(0x0FD2) __sfr CM1CON1;
6542 typedef union
6544 struct
6546 unsigned C1CH0 : 1;
6547 unsigned C1CH1 : 1;
6548 unsigned CREF : 1;
6549 unsigned EVPOL0 : 1;
6550 unsigned EVPOL1 : 1;
6551 unsigned CPOL : 1;
6552 unsigned COE : 1;
6553 unsigned CON : 1;
6556 struct
6558 unsigned CCH0 : 1;
6559 unsigned CCH1 : 1;
6560 unsigned : 1;
6561 unsigned : 1;
6562 unsigned : 1;
6563 unsigned : 1;
6564 unsigned : 1;
6565 unsigned : 1;
6568 struct
6570 unsigned CCH : 2;
6571 unsigned : 6;
6574 struct
6576 unsigned C1CH : 2;
6577 unsigned : 6;
6580 struct
6582 unsigned : 3;
6583 unsigned EVPOL : 2;
6584 unsigned : 3;
6586 } __CM1CON1bits_t;
6588 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
6590 #define _CM1CON1_C1CH0 0x01
6591 #define _CM1CON1_CCH0 0x01
6592 #define _CM1CON1_C1CH1 0x02
6593 #define _CM1CON1_CCH1 0x02
6594 #define _CM1CON1_CREF 0x04
6595 #define _CM1CON1_EVPOL0 0x08
6596 #define _CM1CON1_EVPOL1 0x10
6597 #define _CM1CON1_CPOL 0x20
6598 #define _CM1CON1_COE 0x40
6599 #define _CM1CON1_CON 0x80
6601 //==============================================================================
6604 //==============================================================================
6605 // OSCCON Bits
6607 extern __at(0x0FD3) __sfr OSCCON;
6609 typedef union
6611 struct
6613 unsigned SCS0 : 1;
6614 unsigned SCS1 : 1;
6615 unsigned : 1;
6616 unsigned OSTS : 1;
6617 unsigned IRCF0 : 1;
6618 unsigned IRCF1 : 1;
6619 unsigned IRCF2 : 1;
6620 unsigned IDLEN : 1;
6623 struct
6625 unsigned SCS : 2;
6626 unsigned : 6;
6629 struct
6631 unsigned : 4;
6632 unsigned IRCF : 3;
6633 unsigned : 1;
6635 } __OSCCONbits_t;
6637 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6639 #define _SCS0 0x01
6640 #define _SCS1 0x02
6641 #define _OSTS 0x08
6642 #define _IRCF0 0x10
6643 #define _IRCF1 0x20
6644 #define _IRCF2 0x40
6645 #define _IDLEN 0x80
6647 //==============================================================================
6650 //==============================================================================
6651 // REFOCON Bits
6653 extern __at(0x0FD3) __sfr REFOCON;
6655 typedef union
6657 struct
6659 unsigned RODIV0 : 1;
6660 unsigned RODIV1 : 1;
6661 unsigned RODIV2 : 1;
6662 unsigned RODIV3 : 1;
6663 unsigned ROSEL : 1;
6664 unsigned ROSSLP : 1;
6665 unsigned : 1;
6666 unsigned ROON : 1;
6669 struct
6671 unsigned RODIV : 4;
6672 unsigned : 4;
6674 } __REFOCONbits_t;
6676 extern __at(0x0FD3) volatile __REFOCONbits_t REFOCONbits;
6678 #define _RODIV0 0x01
6679 #define _RODIV1 0x02
6680 #define _RODIV2 0x04
6681 #define _RODIV3 0x08
6682 #define _ROSEL 0x10
6683 #define _ROSSLP 0x20
6684 #define _ROON 0x80
6686 //==============================================================================
6689 //==============================================================================
6690 // T0CON Bits
6692 extern __at(0x0FD5) __sfr T0CON;
6694 typedef union
6696 struct
6698 unsigned T0PS0 : 1;
6699 unsigned T0PS1 : 1;
6700 unsigned T0PS2 : 1;
6701 unsigned PSA : 1;
6702 unsigned T0SE : 1;
6703 unsigned T0CS : 1;
6704 unsigned T08BIT : 1;
6705 unsigned TMR0ON : 1;
6708 struct
6710 unsigned : 1;
6711 unsigned : 1;
6712 unsigned : 1;
6713 unsigned T0PS3 : 1;
6714 unsigned : 1;
6715 unsigned : 1;
6716 unsigned : 1;
6717 unsigned : 1;
6720 struct
6722 unsigned T0PS : 4;
6723 unsigned : 4;
6725 } __T0CONbits_t;
6727 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6729 #define _T0PS0 0x01
6730 #define _T0PS1 0x02
6731 #define _T0PS2 0x04
6732 #define _PSA 0x08
6733 #define _T0PS3 0x08
6734 #define _T0SE 0x10
6735 #define _T0CS 0x20
6736 #define _T08BIT 0x40
6737 #define _TMR0ON 0x80
6739 //==============================================================================
6741 extern __at(0x0FD6) __sfr TMR0;
6742 extern __at(0x0FD6) __sfr TMR0L;
6743 extern __at(0x0FD7) __sfr TMR0H;
6745 //==============================================================================
6746 // STATUS Bits
6748 extern __at(0x0FD8) __sfr STATUS;
6750 typedef struct
6752 unsigned C : 1;
6753 unsigned DC : 1;
6754 unsigned Z : 1;
6755 unsigned OV : 1;
6756 unsigned N : 1;
6757 unsigned : 1;
6758 unsigned : 1;
6759 unsigned : 1;
6760 } __STATUSbits_t;
6762 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6764 #define _C 0x01
6765 #define _DC 0x02
6766 #define _Z 0x04
6767 #define _OV 0x08
6768 #define _N 0x10
6770 //==============================================================================
6772 extern __at(0x0FD9) __sfr FSR2L;
6773 extern __at(0x0FDA) __sfr FSR2H;
6774 extern __at(0x0FDB) __sfr PLUSW2;
6775 extern __at(0x0FDC) __sfr PREINC2;
6776 extern __at(0x0FDD) __sfr POSTDEC2;
6777 extern __at(0x0FDE) __sfr POSTINC2;
6778 extern __at(0x0FDF) __sfr INDF2;
6779 extern __at(0x0FE0) __sfr BSR;
6780 extern __at(0x0FE1) __sfr FSR1L;
6781 extern __at(0x0FE2) __sfr FSR1H;
6782 extern __at(0x0FE3) __sfr PLUSW1;
6783 extern __at(0x0FE4) __sfr PREINC1;
6784 extern __at(0x0FE5) __sfr POSTDEC1;
6785 extern __at(0x0FE6) __sfr POSTINC1;
6786 extern __at(0x0FE7) __sfr INDF1;
6787 extern __at(0x0FE8) __sfr WREG;
6788 extern __at(0x0FE9) __sfr FSR0L;
6789 extern __at(0x0FEA) __sfr FSR0H;
6790 extern __at(0x0FEB) __sfr PLUSW0;
6791 extern __at(0x0FEC) __sfr PREINC0;
6792 extern __at(0x0FED) __sfr POSTDEC0;
6793 extern __at(0x0FEE) __sfr POSTINC0;
6794 extern __at(0x0FEF) __sfr INDF0;
6796 //==============================================================================
6797 // INTCON3 Bits
6799 extern __at(0x0FF0) __sfr INTCON3;
6801 typedef union
6803 struct
6805 unsigned INT1IF : 1;
6806 unsigned INT2IF : 1;
6807 unsigned INT3IF : 1;
6808 unsigned INT1IE : 1;
6809 unsigned INT2IE : 1;
6810 unsigned INT3IE : 1;
6811 unsigned INT1IP : 1;
6812 unsigned INT2IP : 1;
6815 struct
6817 unsigned INT1F : 1;
6818 unsigned INT2F : 1;
6819 unsigned INT3F : 1;
6820 unsigned INT1E : 1;
6821 unsigned INT2E : 1;
6822 unsigned INT3E : 1;
6823 unsigned INT1P : 1;
6824 unsigned INT2P : 1;
6826 } __INTCON3bits_t;
6828 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6830 #define _INT1IF 0x01
6831 #define _INT1F 0x01
6832 #define _INT2IF 0x02
6833 #define _INT2F 0x02
6834 #define _INT3IF 0x04
6835 #define _INT3F 0x04
6836 #define _INT1IE 0x08
6837 #define _INT1E 0x08
6838 #define _INT2IE 0x10
6839 #define _INT2E 0x10
6840 #define _INT3IE 0x20
6841 #define _INT3E 0x20
6842 #define _INT1IP 0x40
6843 #define _INT1P 0x40
6844 #define _INT2IP 0x80
6845 #define _INT2P 0x80
6847 //==============================================================================
6850 //==============================================================================
6851 // INTCON2 Bits
6853 extern __at(0x0FF1) __sfr INTCON2;
6855 typedef union
6857 struct
6859 unsigned RBIP : 1;
6860 unsigned INT3IP : 1;
6861 unsigned TMR0IP : 1;
6862 unsigned INTEDG3 : 1;
6863 unsigned INTEDG2 : 1;
6864 unsigned INTEDG1 : 1;
6865 unsigned INTEDG0 : 1;
6866 unsigned NOT_RBPU : 1;
6869 struct
6871 unsigned : 1;
6872 unsigned INT3P : 1;
6873 unsigned T0IP : 1;
6874 unsigned : 1;
6875 unsigned : 1;
6876 unsigned : 1;
6877 unsigned : 1;
6878 unsigned RBPU : 1;
6880 } __INTCON2bits_t;
6882 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6884 #define _RBIP 0x01
6885 #define _INT3IP 0x02
6886 #define _INT3P 0x02
6887 #define _TMR0IP 0x04
6888 #define _T0IP 0x04
6889 #define _INTEDG3 0x08
6890 #define _INTEDG2 0x10
6891 #define _INTEDG1 0x20
6892 #define _INTEDG0 0x40
6893 #define _NOT_RBPU 0x80
6894 #define _RBPU 0x80
6896 //==============================================================================
6899 //==============================================================================
6900 // INTCON Bits
6902 extern __at(0x0FF2) __sfr INTCON;
6904 typedef union
6906 struct
6908 unsigned RBIF : 1;
6909 unsigned INT0IF : 1;
6910 unsigned TMR0IF : 1;
6911 unsigned RBIE : 1;
6912 unsigned INT0IE : 1;
6913 unsigned TMR0IE : 1;
6914 unsigned PEIE_GIEL : 1;
6915 unsigned GIE_GIEH : 1;
6918 struct
6920 unsigned : 1;
6921 unsigned INT0F : 1;
6922 unsigned T0IF : 1;
6923 unsigned : 1;
6924 unsigned INT0E : 1;
6925 unsigned T0IE : 1;
6926 unsigned PEIE : 1;
6927 unsigned GIE : 1;
6930 struct
6932 unsigned : 1;
6933 unsigned : 1;
6934 unsigned : 1;
6935 unsigned : 1;
6936 unsigned : 1;
6937 unsigned : 1;
6938 unsigned GIEL : 1;
6939 unsigned GIEH : 1;
6941 } __INTCONbits_t;
6943 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6945 #define _RBIF 0x01
6946 #define _INT0IF 0x02
6947 #define _INT0F 0x02
6948 #define _TMR0IF 0x04
6949 #define _T0IF 0x04
6950 #define _RBIE 0x08
6951 #define _INT0IE 0x10
6952 #define _INT0E 0x10
6953 #define _TMR0IE 0x20
6954 #define _T0IE 0x20
6955 #define _PEIE_GIEL 0x40
6956 #define _PEIE 0x40
6957 #define _GIEL 0x40
6958 #define _GIE_GIEH 0x80
6959 #define _GIE 0x80
6960 #define _GIEH 0x80
6962 //==============================================================================
6964 extern __at(0x0FF3) __sfr PROD;
6965 extern __at(0x0FF3) __sfr PRODL;
6966 extern __at(0x0FF4) __sfr PRODH;
6967 extern __at(0x0FF5) __sfr TABLAT;
6968 extern __at(0x0FF6) __sfr TBLPTR;
6969 extern __at(0x0FF6) __sfr TBLPTRL;
6970 extern __at(0x0FF7) __sfr TBLPTRH;
6971 extern __at(0x0FF8) __sfr TBLPTRU;
6972 extern __at(0x0FF9) __sfr PC;
6973 extern __at(0x0FF9) __sfr PCL;
6974 extern __at(0x0FFA) __sfr PCLATH;
6975 extern __at(0x0FFB) __sfr PCLATU;
6977 //==============================================================================
6978 // STKPTR Bits
6980 extern __at(0x0FFC) __sfr STKPTR;
6982 typedef union
6984 struct
6986 unsigned STKPTR0 : 1;
6987 unsigned STKPTR1 : 1;
6988 unsigned STKPTR2 : 1;
6989 unsigned STKPTR3 : 1;
6990 unsigned STKPTR4 : 1;
6991 unsigned : 1;
6992 unsigned STKUNF : 1;
6993 unsigned STKFUL : 1;
6996 struct
6998 unsigned SP0 : 1;
6999 unsigned SP1 : 1;
7000 unsigned SP2 : 1;
7001 unsigned SP3 : 1;
7002 unsigned SP4 : 1;
7003 unsigned : 1;
7004 unsigned : 1;
7005 unsigned STKOVF : 1;
7008 struct
7010 unsigned STKPTR : 5;
7011 unsigned : 3;
7014 struct
7016 unsigned SP : 5;
7017 unsigned : 3;
7019 } __STKPTRbits_t;
7021 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
7023 #define _STKPTR0 0x01
7024 #define _SP0 0x01
7025 #define _STKPTR1 0x02
7026 #define _SP1 0x02
7027 #define _STKPTR2 0x04
7028 #define _SP2 0x04
7029 #define _STKPTR3 0x08
7030 #define _SP3 0x08
7031 #define _STKPTR4 0x10
7032 #define _SP4 0x10
7033 #define _STKUNF 0x40
7034 #define _STKFUL 0x80
7035 #define _STKOVF 0x80
7037 //==============================================================================
7039 extern __at(0x0FFD) __sfr TOS;
7040 extern __at(0x0FFD) __sfr TOSL;
7041 extern __at(0x0FFE) __sfr TOSH;
7042 extern __at(0x0FFF) __sfr TOSU;
7044 //==============================================================================
7046 // Configuration Addresses
7048 //==============================================================================
7050 #define __CONFIG1L 0x00FFF8
7051 #define __CONFIG1H 0x00FFF9
7052 #define __CONFIG2L 0x00FFFA
7053 #define __CONFIG2H 0x00FFFB
7054 #define __CONFIG3L 0x00FFFC
7055 #define __CONFIG3H 0x00FFFD
7057 //==============================================================================
7059 #endif // #ifndef __PIC18F66J50_H__