Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f66j16.h
blobb28d5a9d992966e63bb9e03fb14d2704db500fa9
1 /*
2 * This declarations of the PIC18F66J16 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 __PIC18F66J16_H__
26 #define __PIC18F66J16_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
36 extern __at(0x0F5A) __sfr PMSTAT;
38 //==============================================================================
39 // PMSTATL Bits
41 extern __at(0x0F5A) __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(0x0F5A) 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(0x0F5B) __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(0x0F5B) 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(0x0F5C) __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(0x0F5C) 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(0x0F5C) __sfr PMEN;
128 //==============================================================================
129 // PMEH Bits
131 extern __at(0x0F5D) __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(0x0F5D) 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(0x0F5E) __sfr PMDIN2;
159 extern __at(0x0F5E) __sfr PMDIN2L;
160 extern __at(0x0F5F) __sfr PMDIN2H;
161 extern __at(0x0F60) __sfr PMDOUT2;
162 extern __at(0x0F60) __sfr PMDOUT2L;
163 extern __at(0x0F61) __sfr PMDOUT2H;
164 extern __at(0x0F62) __sfr PMMODE;
166 //==============================================================================
167 // PMMODEL Bits
169 extern __at(0x0F62) __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(0x0F62) 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(0x0F63) __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(0x0F63) 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(0x0F64) __sfr PMCON;
268 //==============================================================================
269 // PMCONL Bits
271 extern __at(0x0F64) __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(0x0F64) 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(0x0F65) __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(0x0F65) 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 //==============================================================================
347 extern __at(0x0F66) __sfr PMDIN1;
348 extern __at(0x0F66) __sfr PMDIN1L;
349 extern __at(0x0F67) __sfr PMDIN1H;
350 extern __at(0x0F68) __sfr PMADDR;
351 extern __at(0x0F68) __sfr PMADDRL;
352 extern __at(0x0F68) __sfr PMDOUT1;
353 extern __at(0x0F68) __sfr PMDOUT1L;
355 //==============================================================================
356 // PMADDRH Bits
358 extern __at(0x0F69) __sfr PMADDRH;
360 typedef struct
362 unsigned : 1;
363 unsigned : 1;
364 unsigned : 1;
365 unsigned : 1;
366 unsigned : 1;
367 unsigned : 1;
368 unsigned CS1 : 1;
369 unsigned CS2 : 1;
370 } __PMADDRHbits_t;
372 extern __at(0x0F69) volatile __PMADDRHbits_t PMADDRHbits;
374 #define _CS1 0x40
375 #define _CS2 0x80
377 //==============================================================================
379 extern __at(0x0F69) __sfr PMDOUT1H;
381 //==============================================================================
382 // CMSTAT Bits
384 extern __at(0x0F6A) __sfr CMSTAT;
386 typedef struct
388 unsigned COUT1 : 1;
389 unsigned COUT2 : 1;
390 unsigned : 1;
391 unsigned : 1;
392 unsigned : 1;
393 unsigned : 1;
394 unsigned : 1;
395 unsigned : 1;
396 } __CMSTATbits_t;
398 extern __at(0x0F6A) volatile __CMSTATbits_t CMSTATbits;
400 #define _COUT1 0x01
401 #define _COUT2 0x02
403 //==============================================================================
406 //==============================================================================
407 // CMSTATUS Bits
409 extern __at(0x0F6A) __sfr CMSTATUS;
411 typedef struct
413 unsigned COUT1 : 1;
414 unsigned COUT2 : 1;
415 unsigned : 1;
416 unsigned : 1;
417 unsigned : 1;
418 unsigned : 1;
419 unsigned : 1;
420 unsigned : 1;
421 } __CMSTATUSbits_t;
423 extern __at(0x0F6A) volatile __CMSTATUSbits_t CMSTATUSbits;
425 #define _CMSTATUS_COUT1 0x01
426 #define _CMSTATUS_COUT2 0x02
428 //==============================================================================
431 //==============================================================================
432 // SSP2CON2 Bits
434 extern __at(0x0F6B) __sfr SSP2CON2;
436 typedef union
438 struct
440 unsigned SEN : 1;
441 unsigned RSEN : 1;
442 unsigned PEN : 1;
443 unsigned RCEN : 1;
444 unsigned ACKEN : 1;
445 unsigned ACKDT : 1;
446 unsigned ACKSTAT : 1;
447 unsigned GCEN : 1;
450 struct
452 unsigned : 1;
453 unsigned ADMSK1 : 1;
454 unsigned ADMSK2 : 1;
455 unsigned ADMSK3 : 1;
456 unsigned ADMSK4 : 1;
457 unsigned ADMSK5 : 1;
458 unsigned : 1;
459 unsigned : 1;
461 } __SSP2CON2bits_t;
463 extern __at(0x0F6B) volatile __SSP2CON2bits_t SSP2CON2bits;
465 #define _SSP2CON2_SEN 0x01
466 #define _SSP2CON2_RSEN 0x02
467 #define _SSP2CON2_ADMSK1 0x02
468 #define _SSP2CON2_PEN 0x04
469 #define _SSP2CON2_ADMSK2 0x04
470 #define _SSP2CON2_RCEN 0x08
471 #define _SSP2CON2_ADMSK3 0x08
472 #define _SSP2CON2_ACKEN 0x10
473 #define _SSP2CON2_ADMSK4 0x10
474 #define _SSP2CON2_ACKDT 0x20
475 #define _SSP2CON2_ADMSK5 0x20
476 #define _SSP2CON2_ACKSTAT 0x40
477 #define _SSP2CON2_GCEN 0x80
479 //==============================================================================
482 //==============================================================================
483 // SSP2CON1 Bits
485 extern __at(0x0F6C) __sfr SSP2CON1;
487 typedef union
489 struct
491 unsigned SSPM0 : 1;
492 unsigned SSPM1 : 1;
493 unsigned SSPM2 : 1;
494 unsigned SSPM3 : 1;
495 unsigned CKP : 1;
496 unsigned SSPEN : 1;
497 unsigned SSPOV : 1;
498 unsigned WCOL : 1;
501 struct
503 unsigned SSPM : 4;
504 unsigned : 4;
506 } __SSP2CON1bits_t;
508 extern __at(0x0F6C) volatile __SSP2CON1bits_t SSP2CON1bits;
510 #define _SSP2CON1_SSPM0 0x01
511 #define _SSP2CON1_SSPM1 0x02
512 #define _SSP2CON1_SSPM2 0x04
513 #define _SSP2CON1_SSPM3 0x08
514 #define _SSP2CON1_CKP 0x10
515 #define _SSP2CON1_SSPEN 0x20
516 #define _SSP2CON1_SSPOV 0x40
517 #define _SSP2CON1_WCOL 0x80
519 //==============================================================================
522 //==============================================================================
523 // SSP2STAT Bits
525 extern __at(0x0F6D) __sfr SSP2STAT;
527 typedef union
529 struct
531 unsigned BF : 1;
532 unsigned UA : 1;
533 unsigned R_NOT_W : 1;
534 unsigned S : 1;
535 unsigned P : 1;
536 unsigned D_NOT_A : 1;
537 unsigned CKE : 1;
538 unsigned SMP : 1;
541 struct
543 unsigned : 1;
544 unsigned : 1;
545 unsigned R_W : 1;
546 unsigned I2C_START : 1;
547 unsigned I2C_STOP : 1;
548 unsigned D_A : 1;
549 unsigned : 1;
550 unsigned : 1;
553 struct
555 unsigned : 1;
556 unsigned : 1;
557 unsigned I2C_READ : 1;
558 unsigned : 1;
559 unsigned : 1;
560 unsigned I2C_DAT : 1;
561 unsigned : 1;
562 unsigned : 1;
565 struct
567 unsigned : 1;
568 unsigned : 1;
569 unsigned NOT_W : 1;
570 unsigned : 1;
571 unsigned : 1;
572 unsigned NOT_A : 1;
573 unsigned : 1;
574 unsigned : 1;
577 struct
579 unsigned : 1;
580 unsigned : 1;
581 unsigned NOT_WRITE : 1;
582 unsigned : 1;
583 unsigned : 1;
584 unsigned NOT_ADDRESS : 1;
585 unsigned : 1;
586 unsigned : 1;
589 struct
591 unsigned : 1;
592 unsigned : 1;
593 unsigned READ_WRITE : 1;
594 unsigned : 1;
595 unsigned : 1;
596 unsigned DATA_ADDRESS : 1;
597 unsigned : 1;
598 unsigned : 1;
601 struct
603 unsigned : 1;
604 unsigned : 1;
605 unsigned R : 1;
606 unsigned : 1;
607 unsigned : 1;
608 unsigned D : 1;
609 unsigned : 1;
610 unsigned : 1;
612 } __SSP2STATbits_t;
614 extern __at(0x0F6D) volatile __SSP2STATbits_t SSP2STATbits;
616 #define _SSP2STAT_BF 0x01
617 #define _SSP2STAT_UA 0x02
618 #define _SSP2STAT_R_NOT_W 0x04
619 #define _SSP2STAT_R_W 0x04
620 #define _SSP2STAT_I2C_READ 0x04
621 #define _SSP2STAT_NOT_W 0x04
622 #define _SSP2STAT_NOT_WRITE 0x04
623 #define _SSP2STAT_READ_WRITE 0x04
624 #define _SSP2STAT_R 0x04
625 #define _SSP2STAT_S 0x08
626 #define _SSP2STAT_I2C_START 0x08
627 #define _SSP2STAT_P 0x10
628 #define _SSP2STAT_I2C_STOP 0x10
629 #define _SSP2STAT_D_NOT_A 0x20
630 #define _SSP2STAT_D_A 0x20
631 #define _SSP2STAT_I2C_DAT 0x20
632 #define _SSP2STAT_NOT_A 0x20
633 #define _SSP2STAT_NOT_ADDRESS 0x20
634 #define _SSP2STAT_DATA_ADDRESS 0x20
635 #define _SSP2STAT_D 0x20
636 #define _SSP2STAT_CKE 0x40
637 #define _SSP2STAT_SMP 0x80
639 //==============================================================================
641 extern __at(0x0F6E) __sfr SSP2ADD;
643 //==============================================================================
644 // SSP2MSK Bits
646 extern __at(0x0F6E) __sfr SSP2MSK;
648 typedef struct
650 unsigned MSK0 : 1;
651 unsigned MSK1 : 1;
652 unsigned MSK2 : 1;
653 unsigned MSK3 : 1;
654 unsigned MSK4 : 1;
655 unsigned MSK5 : 1;
656 unsigned MSK6 : 1;
657 unsigned MSK7 : 1;
658 } __SSP2MSKbits_t;
660 extern __at(0x0F6E) volatile __SSP2MSKbits_t SSP2MSKbits;
662 #define _SSP2MSK_MSK0 0x01
663 #define _SSP2MSK_MSK1 0x02
664 #define _SSP2MSK_MSK2 0x04
665 #define _SSP2MSK_MSK3 0x08
666 #define _SSP2MSK_MSK4 0x10
667 #define _SSP2MSK_MSK5 0x20
668 #define _SSP2MSK_MSK6 0x40
669 #define _SSP2MSK_MSK7 0x80
671 //==============================================================================
673 extern __at(0x0F6F) __sfr SSP2BUF;
675 //==============================================================================
676 // CCP5CON Bits
678 extern __at(0x0F70) __sfr CCP5CON;
680 typedef union
682 struct
684 unsigned CCP5M0 : 1;
685 unsigned CCP5M1 : 1;
686 unsigned CCP5M2 : 1;
687 unsigned CCP5M3 : 1;
688 unsigned DC5B0 : 1;
689 unsigned DC5B1 : 1;
690 unsigned : 1;
691 unsigned : 1;
694 struct
696 unsigned : 1;
697 unsigned : 1;
698 unsigned : 1;
699 unsigned : 1;
700 unsigned DCCP5Y : 1;
701 unsigned DCCP5X : 1;
702 unsigned : 1;
703 unsigned : 1;
706 struct
708 unsigned CCP5M : 4;
709 unsigned : 4;
712 struct
714 unsigned : 4;
715 unsigned DC5B : 2;
716 unsigned : 2;
718 } __CCP5CONbits_t;
720 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits;
722 #define _CCP5M0 0x01
723 #define _CCP5M1 0x02
724 #define _CCP5M2 0x04
725 #define _CCP5M3 0x08
726 #define _DC5B0 0x10
727 #define _DCCP5Y 0x10
728 #define _DC5B1 0x20
729 #define _DCCP5X 0x20
731 //==============================================================================
733 extern __at(0x0F71) __sfr CCPR5;
734 extern __at(0x0F71) __sfr CCPR5L;
735 extern __at(0x0F72) __sfr CCPR5H;
737 //==============================================================================
738 // CCP4CON Bits
740 extern __at(0x0F73) __sfr CCP4CON;
742 typedef union
744 struct
746 unsigned CCP4M0 : 1;
747 unsigned CCP4M1 : 1;
748 unsigned CCP4M2 : 1;
749 unsigned CCP4M3 : 1;
750 unsigned DC4B0 : 1;
751 unsigned DC4B1 : 1;
752 unsigned : 1;
753 unsigned : 1;
756 struct
758 unsigned : 1;
759 unsigned : 1;
760 unsigned : 1;
761 unsigned : 1;
762 unsigned DCCP4Y : 1;
763 unsigned DCCP4X : 1;
764 unsigned : 1;
765 unsigned : 1;
768 struct
770 unsigned CCP4M : 4;
771 unsigned : 4;
774 struct
776 unsigned : 4;
777 unsigned DC4B : 2;
778 unsigned : 2;
780 } __CCP4CONbits_t;
782 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits;
784 #define _CCP4M0 0x01
785 #define _CCP4M1 0x02
786 #define _CCP4M2 0x04
787 #define _CCP4M3 0x08
788 #define _DC4B0 0x10
789 #define _DCCP4Y 0x10
790 #define _DC4B1 0x20
791 #define _DCCP4X 0x20
793 //==============================================================================
795 extern __at(0x0F74) __sfr CCPR4;
796 extern __at(0x0F74) __sfr CCPR4L;
797 extern __at(0x0F75) __sfr CCPR4H;
799 //==============================================================================
800 // T4CON Bits
802 extern __at(0x0F76) __sfr T4CON;
804 typedef union
806 struct
808 unsigned T4CKPS0 : 1;
809 unsigned T4CKPS1 : 1;
810 unsigned TMR4ON : 1;
811 unsigned T4OUTPS0 : 1;
812 unsigned T4OUTPS1 : 1;
813 unsigned T4OUTPS2 : 1;
814 unsigned T4OUTPS3 : 1;
815 unsigned : 1;
818 struct
820 unsigned T4CKPS : 2;
821 unsigned : 6;
824 struct
826 unsigned : 3;
827 unsigned T4OUTPS : 4;
828 unsigned : 1;
830 } __T4CONbits_t;
832 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
834 #define _T4CKPS0 0x01
835 #define _T4CKPS1 0x02
836 #define _TMR4ON 0x04
837 #define _T4OUTPS0 0x08
838 #define _T4OUTPS1 0x10
839 #define _T4OUTPS2 0x20
840 #define _T4OUTPS3 0x40
842 //==============================================================================
845 //==============================================================================
846 // CVRCON Bits
848 extern __at(0x0F77) __sfr CVRCON;
850 typedef union
852 struct
854 unsigned CVR0 : 1;
855 unsigned CVR1 : 1;
856 unsigned CVR2 : 1;
857 unsigned CVR3 : 1;
858 unsigned CVRSS : 1;
859 unsigned CVRR : 1;
860 unsigned CVROE : 1;
861 unsigned CVREN : 1;
864 struct
866 unsigned CVR : 4;
867 unsigned : 4;
869 } __CVRCONbits_t;
871 extern __at(0x0F77) volatile __CVRCONbits_t CVRCONbits;
873 #define _CVR0 0x01
874 #define _CVR1 0x02
875 #define _CVR2 0x04
876 #define _CVR3 0x08
877 #define _CVRSS 0x10
878 #define _CVRR 0x20
879 #define _CVROE 0x40
880 #define _CVREN 0x80
882 //==============================================================================
884 extern __at(0x0F77) __sfr PR4;
885 extern __at(0x0F78) __sfr TMR4;
887 //==============================================================================
888 // T3CON Bits
890 extern __at(0x0F79) __sfr T3CON;
892 typedef union
894 struct
896 unsigned TMR3ON : 1;
897 unsigned TMR3CS : 1;
898 unsigned NOT_T3SYNC : 1;
899 unsigned T3CCP1 : 1;
900 unsigned T3CKPS0 : 1;
901 unsigned T3CKPS1 : 1;
902 unsigned T3CCP2 : 1;
903 unsigned RD16 : 1;
906 struct
908 unsigned : 1;
909 unsigned : 1;
910 unsigned T3SYNC : 1;
911 unsigned : 1;
912 unsigned : 1;
913 unsigned : 1;
914 unsigned : 1;
915 unsigned : 1;
918 struct
920 unsigned : 1;
921 unsigned : 1;
922 unsigned T3INSYNC : 1;
923 unsigned : 1;
924 unsigned : 1;
925 unsigned : 1;
926 unsigned : 1;
927 unsigned : 1;
930 struct
932 unsigned : 4;
933 unsigned T3CKPS : 2;
934 unsigned : 2;
936 } __T3CONbits_t;
938 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits;
940 #define _T3CON_TMR3ON 0x01
941 #define _T3CON_TMR3CS 0x02
942 #define _T3CON_NOT_T3SYNC 0x04
943 #define _T3CON_T3SYNC 0x04
944 #define _T3CON_T3INSYNC 0x04
945 #define _T3CON_T3CCP1 0x08
946 #define _T3CON_T3CKPS0 0x10
947 #define _T3CON_T3CKPS1 0x20
948 #define _T3CON_T3CCP2 0x40
949 #define _T3CON_RD16 0x80
951 //==============================================================================
953 extern __at(0x0F7A) __sfr TMR3;
954 extern __at(0x0F7A) __sfr TMR3L;
955 extern __at(0x0F7B) __sfr TMR3H;
957 //==============================================================================
958 // BAUDCON2 Bits
960 extern __at(0x0F7C) __sfr BAUDCON2;
962 typedef union
964 struct
966 unsigned ABDEN : 1;
967 unsigned WUE : 1;
968 unsigned : 1;
969 unsigned BRG16 : 1;
970 unsigned TXCKP : 1;
971 unsigned RXDTP : 1;
972 unsigned RCIDL : 1;
973 unsigned ABDOVF : 1;
976 struct
978 unsigned : 1;
979 unsigned : 1;
980 unsigned : 1;
981 unsigned : 1;
982 unsigned SCKP : 1;
983 unsigned DTRXP : 1;
984 unsigned RCMT : 1;
985 unsigned : 1;
987 } __BAUDCON2bits_t;
989 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
991 #define _BAUDCON2_ABDEN 0x01
992 #define _BAUDCON2_WUE 0x02
993 #define _BAUDCON2_BRG16 0x08
994 #define _BAUDCON2_TXCKP 0x10
995 #define _BAUDCON2_SCKP 0x10
996 #define _BAUDCON2_RXDTP 0x20
997 #define _BAUDCON2_DTRXP 0x20
998 #define _BAUDCON2_RCIDL 0x40
999 #define _BAUDCON2_RCMT 0x40
1000 #define _BAUDCON2_ABDOVF 0x80
1002 //==============================================================================
1004 extern __at(0x0F7D) __sfr SPBRGH2;
1006 //==============================================================================
1007 // BAUDCON Bits
1009 extern __at(0x0F7E) __sfr BAUDCON;
1011 typedef union
1013 struct
1015 unsigned ABDEN : 1;
1016 unsigned WUE : 1;
1017 unsigned : 1;
1018 unsigned BRG16 : 1;
1019 unsigned TXCKP : 1;
1020 unsigned RXDTP : 1;
1021 unsigned RCIDL : 1;
1022 unsigned ABDOVF : 1;
1025 struct
1027 unsigned : 1;
1028 unsigned : 1;
1029 unsigned : 1;
1030 unsigned : 1;
1031 unsigned SCKP : 1;
1032 unsigned DTRXP : 1;
1033 unsigned RCMT : 1;
1034 unsigned : 1;
1036 } __BAUDCONbits_t;
1038 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1040 #define _ABDEN 0x01
1041 #define _WUE 0x02
1042 #define _BRG16 0x08
1043 #define _TXCKP 0x10
1044 #define _SCKP 0x10
1045 #define _RXDTP 0x20
1046 #define _DTRXP 0x20
1047 #define _RCIDL 0x40
1048 #define _RCMT 0x40
1049 #define _ABDOVF 0x80
1051 //==============================================================================
1054 //==============================================================================
1055 // BAUDCON1 Bits
1057 extern __at(0x0F7E) __sfr BAUDCON1;
1059 typedef union
1061 struct
1063 unsigned ABDEN : 1;
1064 unsigned WUE : 1;
1065 unsigned : 1;
1066 unsigned BRG16 : 1;
1067 unsigned TXCKP : 1;
1068 unsigned RXDTP : 1;
1069 unsigned RCIDL : 1;
1070 unsigned ABDOVF : 1;
1073 struct
1075 unsigned : 1;
1076 unsigned : 1;
1077 unsigned : 1;
1078 unsigned : 1;
1079 unsigned SCKP : 1;
1080 unsigned DTRXP : 1;
1081 unsigned RCMT : 1;
1082 unsigned : 1;
1084 } __BAUDCON1bits_t;
1086 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1088 #define _BAUDCON1_ABDEN 0x01
1089 #define _BAUDCON1_WUE 0x02
1090 #define _BAUDCON1_BRG16 0x08
1091 #define _BAUDCON1_TXCKP 0x10
1092 #define _BAUDCON1_SCKP 0x10
1093 #define _BAUDCON1_RXDTP 0x20
1094 #define _BAUDCON1_DTRXP 0x20
1095 #define _BAUDCON1_RCIDL 0x40
1096 #define _BAUDCON1_RCMT 0x40
1097 #define _BAUDCON1_ABDOVF 0x80
1099 //==============================================================================
1101 extern __at(0x0F7F) __sfr SPBRGH1;
1103 //==============================================================================
1104 // PORTA Bits
1106 extern __at(0x0F80) __sfr PORTA;
1108 typedef union
1110 struct
1112 unsigned RA0 : 1;
1113 unsigned RA1 : 1;
1114 unsigned RA2 : 1;
1115 unsigned RA3 : 1;
1116 unsigned RA4 : 1;
1117 unsigned RA5 : 1;
1118 unsigned RA6 : 1;
1119 unsigned RA7 : 1;
1122 struct
1124 unsigned AN0 : 1;
1125 unsigned AN1 : 1;
1126 unsigned AN2 : 1;
1127 unsigned AN3 : 1;
1128 unsigned T0CKI : 1;
1129 unsigned AN4 : 1;
1130 unsigned OSC2 : 1;
1131 unsigned : 1;
1134 struct
1136 unsigned : 1;
1137 unsigned : 1;
1138 unsigned VREFM : 1;
1139 unsigned VREFP : 1;
1140 unsigned : 1;
1141 unsigned : 1;
1142 unsigned CLKO : 1;
1143 unsigned : 1;
1145 } __PORTAbits_t;
1147 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1149 #define _PORTA_RA0 0x01
1150 #define _PORTA_AN0 0x01
1151 #define _PORTA_RA1 0x02
1152 #define _PORTA_AN1 0x02
1153 #define _PORTA_RA2 0x04
1154 #define _PORTA_AN2 0x04
1155 #define _PORTA_VREFM 0x04
1156 #define _PORTA_RA3 0x08
1157 #define _PORTA_AN3 0x08
1158 #define _PORTA_VREFP 0x08
1159 #define _PORTA_RA4 0x10
1160 #define _PORTA_T0CKI 0x10
1161 #define _PORTA_RA5 0x20
1162 #define _PORTA_AN4 0x20
1163 #define _PORTA_RA6 0x40
1164 #define _PORTA_OSC2 0x40
1165 #define _PORTA_CLKO 0x40
1166 #define _PORTA_RA7 0x80
1168 //==============================================================================
1171 //==============================================================================
1172 // PORTB Bits
1174 extern __at(0x0F81) __sfr PORTB;
1176 typedef union
1178 struct
1180 unsigned RB0 : 1;
1181 unsigned RB1 : 1;
1182 unsigned RB2 : 1;
1183 unsigned RB3 : 1;
1184 unsigned RB4 : 1;
1185 unsigned RB5 : 1;
1186 unsigned RB6 : 1;
1187 unsigned RB7 : 1;
1190 struct
1192 unsigned INT0 : 1;
1193 unsigned INT1 : 1;
1194 unsigned INT2 : 1;
1195 unsigned INT3 : 1;
1196 unsigned KBI0 : 1;
1197 unsigned KBI1 : 1;
1198 unsigned KBI2 : 1;
1199 unsigned KBI3 : 1;
1202 struct
1204 unsigned FLT0 : 1;
1205 unsigned PMA4 : 1;
1206 unsigned PMA3 : 1;
1207 unsigned PMA2 : 1;
1208 unsigned PMA1 : 1;
1209 unsigned PMA0 : 1;
1210 unsigned PGC : 1;
1211 unsigned PGD : 1;
1214 struct
1216 unsigned INT : 4;
1217 unsigned : 4;
1220 struct
1222 unsigned : 4;
1223 unsigned KBI : 4;
1225 } __PORTBbits_t;
1227 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1229 #define _PORTB_RB0 0x01
1230 #define _PORTB_INT0 0x01
1231 #define _PORTB_FLT0 0x01
1232 #define _PORTB_RB1 0x02
1233 #define _PORTB_INT1 0x02
1234 #define _PORTB_PMA4 0x02
1235 #define _PORTB_RB2 0x04
1236 #define _PORTB_INT2 0x04
1237 #define _PORTB_PMA3 0x04
1238 #define _PORTB_RB3 0x08
1239 #define _PORTB_INT3 0x08
1240 #define _PORTB_PMA2 0x08
1241 #define _PORTB_RB4 0x10
1242 #define _PORTB_KBI0 0x10
1243 #define _PORTB_PMA1 0x10
1244 #define _PORTB_RB5 0x20
1245 #define _PORTB_KBI1 0x20
1246 #define _PORTB_PMA0 0x20
1247 #define _PORTB_RB6 0x40
1248 #define _PORTB_KBI2 0x40
1249 #define _PORTB_PGC 0x40
1250 #define _PORTB_RB7 0x80
1251 #define _PORTB_KBI3 0x80
1252 #define _PORTB_PGD 0x80
1254 //==============================================================================
1257 //==============================================================================
1258 // PORTC Bits
1260 extern __at(0x0F82) __sfr PORTC;
1262 typedef union
1264 struct
1266 unsigned RC0 : 1;
1267 unsigned RC1 : 1;
1268 unsigned RC2 : 1;
1269 unsigned RC3 : 1;
1270 unsigned RC4 : 1;
1271 unsigned RC5 : 1;
1272 unsigned RC6 : 1;
1273 unsigned RC7 : 1;
1276 struct
1278 unsigned T1OSO : 1;
1279 unsigned T1OSI : 1;
1280 unsigned CCP1 : 1;
1281 unsigned SCK : 1;
1282 unsigned SDI : 1;
1283 unsigned SDO : 1;
1284 unsigned TX : 1;
1285 unsigned RX : 1;
1288 struct
1290 unsigned T13CKI : 1;
1291 unsigned CCP2 : 1;
1292 unsigned : 1;
1293 unsigned SCL : 1;
1294 unsigned SDA : 1;
1295 unsigned : 1;
1296 unsigned CK : 1;
1297 unsigned : 1;
1299 } __PORTCbits_t;
1301 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1303 #define _PORTC_RC0 0x01
1304 #define _PORTC_T1OSO 0x01
1305 #define _PORTC_T13CKI 0x01
1306 #define _PORTC_RC1 0x02
1307 #define _PORTC_T1OSI 0x02
1308 #define _PORTC_CCP2 0x02
1309 #define _PORTC_RC2 0x04
1310 #define _PORTC_CCP1 0x04
1311 #define _PORTC_RC3 0x08
1312 #define _PORTC_SCK 0x08
1313 #define _PORTC_SCL 0x08
1314 #define _PORTC_RC4 0x10
1315 #define _PORTC_SDI 0x10
1316 #define _PORTC_SDA 0x10
1317 #define _PORTC_RC5 0x20
1318 #define _PORTC_SDO 0x20
1319 #define _PORTC_RC6 0x40
1320 #define _PORTC_TX 0x40
1321 #define _PORTC_CK 0x40
1322 #define _PORTC_RC7 0x80
1323 #define _PORTC_RX 0x80
1325 //==============================================================================
1328 //==============================================================================
1329 // PORTD Bits
1331 extern __at(0x0F83) __sfr PORTD;
1333 typedef union
1335 struct
1337 unsigned RD0 : 1;
1338 unsigned RD1 : 1;
1339 unsigned RD2 : 1;
1340 unsigned RD3 : 1;
1341 unsigned RD4 : 1;
1342 unsigned RD5 : 1;
1343 unsigned RD6 : 1;
1344 unsigned RD7 : 1;
1347 struct
1349 unsigned PMD0 : 1;
1350 unsigned PMD1 : 1;
1351 unsigned PMD2 : 1;
1352 unsigned PMD3 : 1;
1353 unsigned PMD4 : 1;
1354 unsigned PMD5 : 1;
1355 unsigned PMD6 : 1;
1356 unsigned PMD7 : 1;
1359 struct
1361 unsigned : 1;
1362 unsigned : 1;
1363 unsigned : 1;
1364 unsigned : 1;
1365 unsigned SDO2 : 1;
1366 unsigned SDA2 : 1;
1367 unsigned SCL2 : 1;
1368 unsigned SS2 : 1;
1371 struct
1373 unsigned : 1;
1374 unsigned : 1;
1375 unsigned : 1;
1376 unsigned : 1;
1377 unsigned : 1;
1378 unsigned SDI2 : 1;
1379 unsigned SCK2 : 1;
1380 unsigned : 1;
1382 } __PORTDbits_t;
1384 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1386 #define _PORTD_RD0 0x01
1387 #define _PORTD_PMD0 0x01
1388 #define _PORTD_RD1 0x02
1389 #define _PORTD_PMD1 0x02
1390 #define _PORTD_RD2 0x04
1391 #define _PORTD_PMD2 0x04
1392 #define _PORTD_RD3 0x08
1393 #define _PORTD_PMD3 0x08
1394 #define _PORTD_RD4 0x10
1395 #define _PORTD_PMD4 0x10
1396 #define _PORTD_SDO2 0x10
1397 #define _PORTD_RD5 0x20
1398 #define _PORTD_PMD5 0x20
1399 #define _PORTD_SDA2 0x20
1400 #define _PORTD_SDI2 0x20
1401 #define _PORTD_RD6 0x40
1402 #define _PORTD_PMD6 0x40
1403 #define _PORTD_SCL2 0x40
1404 #define _PORTD_SCK2 0x40
1405 #define _PORTD_RD7 0x80
1406 #define _PORTD_PMD7 0x80
1407 #define _PORTD_SS2 0x80
1409 //==============================================================================
1412 //==============================================================================
1413 // PORTE Bits
1415 extern __at(0x0F84) __sfr PORTE;
1417 typedef union
1419 struct
1421 unsigned RE0 : 1;
1422 unsigned RE1 : 1;
1423 unsigned RE2 : 1;
1424 unsigned RE3 : 1;
1425 unsigned RE4 : 1;
1426 unsigned RE5 : 1;
1427 unsigned RE6 : 1;
1428 unsigned RE7 : 1;
1431 struct
1433 unsigned PMRD : 1;
1434 unsigned PMWR : 1;
1435 unsigned PMBE : 1;
1436 unsigned PMA13 : 1;
1437 unsigned PMA12 : 1;
1438 unsigned PMA11 : 1;
1439 unsigned PMA10 : 1;
1440 unsigned PMA9 : 1;
1443 struct
1445 unsigned : 1;
1446 unsigned : 1;
1447 unsigned : 1;
1448 unsigned REFO : 1;
1449 unsigned : 1;
1450 unsigned : 1;
1451 unsigned : 1;
1452 unsigned CCP2 : 1;
1454 } __PORTEbits_t;
1456 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1458 #define _PORTE_RE0 0x01
1459 #define _PORTE_PMRD 0x01
1460 #define _PORTE_RE1 0x02
1461 #define _PORTE_PMWR 0x02
1462 #define _PORTE_RE2 0x04
1463 #define _PORTE_PMBE 0x04
1464 #define _PORTE_RE3 0x08
1465 #define _PORTE_PMA13 0x08
1466 #define _PORTE_REFO 0x08
1467 #define _PORTE_RE4 0x10
1468 #define _PORTE_PMA12 0x10
1469 #define _PORTE_RE5 0x20
1470 #define _PORTE_PMA11 0x20
1471 #define _PORTE_RE6 0x40
1472 #define _PORTE_PMA10 0x40
1473 #define _PORTE_RE7 0x80
1474 #define _PORTE_PMA9 0x80
1475 #define _PORTE_CCP2 0x80
1477 //==============================================================================
1480 //==============================================================================
1481 // PORTF Bits
1483 extern __at(0x0F85) __sfr PORTF;
1485 typedef union
1487 struct
1489 unsigned : 1;
1490 unsigned RF1 : 1;
1491 unsigned RF2 : 1;
1492 unsigned RF3 : 1;
1493 unsigned RF4 : 1;
1494 unsigned RF5 : 1;
1495 unsigned RF6 : 1;
1496 unsigned RF7 : 1;
1499 struct
1501 unsigned : 1;
1502 unsigned AN6 : 1;
1503 unsigned AN7 : 1;
1504 unsigned AN8 : 1;
1505 unsigned AN9 : 1;
1506 unsigned AN10 : 1;
1507 unsigned AN11 : 1;
1508 unsigned SS : 1;
1511 struct
1513 unsigned : 1;
1514 unsigned C2OUT : 1;
1515 unsigned C1OUT : 1;
1516 unsigned C2INB : 1;
1517 unsigned C2INA : 1;
1518 unsigned CVREF : 1;
1519 unsigned C1INA : 1;
1520 unsigned : 1;
1523 struct
1525 unsigned : 1;
1526 unsigned : 1;
1527 unsigned PMA5 : 1;
1528 unsigned : 1;
1529 unsigned : 1;
1530 unsigned C1INB : 1;
1531 unsigned : 1;
1532 unsigned : 1;
1534 } __PORTFbits_t;
1536 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
1538 #define _PORTF_RF1 0x02
1539 #define _PORTF_AN6 0x02
1540 #define _PORTF_C2OUT 0x02
1541 #define _PORTF_RF2 0x04
1542 #define _PORTF_AN7 0x04
1543 #define _PORTF_C1OUT 0x04
1544 #define _PORTF_PMA5 0x04
1545 #define _PORTF_RF3 0x08
1546 #define _PORTF_AN8 0x08
1547 #define _PORTF_C2INB 0x08
1548 #define _PORTF_RF4 0x10
1549 #define _PORTF_AN9 0x10
1550 #define _PORTF_C2INA 0x10
1551 #define _PORTF_RF5 0x20
1552 #define _PORTF_AN10 0x20
1553 #define _PORTF_CVREF 0x20
1554 #define _PORTF_C1INB 0x20
1555 #define _PORTF_RF6 0x40
1556 #define _PORTF_AN11 0x40
1557 #define _PORTF_C1INA 0x40
1558 #define _PORTF_RF7 0x80
1559 #define _PORTF_SS 0x80
1561 //==============================================================================
1564 //==============================================================================
1565 // PORTG Bits
1567 extern __at(0x0F86) __sfr PORTG;
1569 typedef union
1571 struct
1573 unsigned RG0 : 1;
1574 unsigned RG1 : 1;
1575 unsigned RG2 : 1;
1576 unsigned RG3 : 1;
1577 unsigned RG4 : 1;
1578 unsigned : 1;
1579 unsigned REPU : 1;
1580 unsigned RDPU : 1;
1583 struct
1585 unsigned CCP3 : 1;
1586 unsigned TX2 : 1;
1587 unsigned RX2 : 1;
1588 unsigned CCP4 : 1;
1589 unsigned CCP5 : 1;
1590 unsigned : 1;
1591 unsigned : 1;
1592 unsigned : 1;
1595 struct
1597 unsigned PMA8 : 1;
1598 unsigned CK2 : 1;
1599 unsigned DT2 : 1;
1600 unsigned PMCS1 : 1;
1601 unsigned PMCS2 : 1;
1602 unsigned : 1;
1603 unsigned : 1;
1604 unsigned : 1;
1607 struct
1609 unsigned : 1;
1610 unsigned PMA7 : 1;
1611 unsigned PMA6 : 1;
1612 unsigned : 1;
1613 unsigned : 1;
1614 unsigned : 1;
1615 unsigned : 1;
1616 unsigned : 1;
1619 struct
1621 unsigned RG : 5;
1622 unsigned : 3;
1624 } __PORTGbits_t;
1626 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
1628 #define _PORTG_RG0 0x01
1629 #define _PORTG_CCP3 0x01
1630 #define _PORTG_PMA8 0x01
1631 #define _PORTG_RG1 0x02
1632 #define _PORTG_TX2 0x02
1633 #define _PORTG_CK2 0x02
1634 #define _PORTG_PMA7 0x02
1635 #define _PORTG_RG2 0x04
1636 #define _PORTG_RX2 0x04
1637 #define _PORTG_DT2 0x04
1638 #define _PORTG_PMA6 0x04
1639 #define _PORTG_RG3 0x08
1640 #define _PORTG_CCP4 0x08
1641 #define _PORTG_PMCS1 0x08
1642 #define _PORTG_RG4 0x10
1643 #define _PORTG_CCP5 0x10
1644 #define _PORTG_PMCS2 0x10
1645 #define _PORTG_REPU 0x40
1646 #define _PORTG_RDPU 0x80
1648 //==============================================================================
1651 //==============================================================================
1652 // LATA Bits
1654 extern __at(0x0F89) __sfr LATA;
1656 typedef struct
1658 unsigned LATA0 : 1;
1659 unsigned LATA1 : 1;
1660 unsigned LATA2 : 1;
1661 unsigned LATA3 : 1;
1662 unsigned LATA4 : 1;
1663 unsigned LATA5 : 1;
1664 unsigned LATA6 : 1;
1665 unsigned LATA7 : 1;
1666 } __LATAbits_t;
1668 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1670 #define _LATA0 0x01
1671 #define _LATA1 0x02
1672 #define _LATA2 0x04
1673 #define _LATA3 0x08
1674 #define _LATA4 0x10
1675 #define _LATA5 0x20
1676 #define _LATA6 0x40
1677 #define _LATA7 0x80
1679 //==============================================================================
1682 //==============================================================================
1683 // LATB Bits
1685 extern __at(0x0F8A) __sfr LATB;
1687 typedef struct
1689 unsigned LATB0 : 1;
1690 unsigned LATB1 : 1;
1691 unsigned LATB2 : 1;
1692 unsigned LATB3 : 1;
1693 unsigned LATB4 : 1;
1694 unsigned LATB5 : 1;
1695 unsigned LATB6 : 1;
1696 unsigned LATB7 : 1;
1697 } __LATBbits_t;
1699 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1701 #define _LATB0 0x01
1702 #define _LATB1 0x02
1703 #define _LATB2 0x04
1704 #define _LATB3 0x08
1705 #define _LATB4 0x10
1706 #define _LATB5 0x20
1707 #define _LATB6 0x40
1708 #define _LATB7 0x80
1710 //==============================================================================
1713 //==============================================================================
1714 // LATC Bits
1716 extern __at(0x0F8B) __sfr LATC;
1718 typedef struct
1720 unsigned LATC0 : 1;
1721 unsigned LATC1 : 1;
1722 unsigned LATC2 : 1;
1723 unsigned LATC3 : 1;
1724 unsigned LATC4 : 1;
1725 unsigned LATC5 : 1;
1726 unsigned LATC6 : 1;
1727 unsigned LATC7 : 1;
1728 } __LATCbits_t;
1730 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1732 #define _LATC0 0x01
1733 #define _LATC1 0x02
1734 #define _LATC2 0x04
1735 #define _LATC3 0x08
1736 #define _LATC4 0x10
1737 #define _LATC5 0x20
1738 #define _LATC6 0x40
1739 #define _LATC7 0x80
1741 //==============================================================================
1744 //==============================================================================
1745 // LATD Bits
1747 extern __at(0x0F8C) __sfr LATD;
1749 typedef struct
1751 unsigned LATD0 : 1;
1752 unsigned LATD1 : 1;
1753 unsigned LATD2 : 1;
1754 unsigned LATD3 : 1;
1755 unsigned LATD4 : 1;
1756 unsigned LATD5 : 1;
1757 unsigned LATD6 : 1;
1758 unsigned LATD7 : 1;
1759 } __LATDbits_t;
1761 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1763 #define _LATD0 0x01
1764 #define _LATD1 0x02
1765 #define _LATD2 0x04
1766 #define _LATD3 0x08
1767 #define _LATD4 0x10
1768 #define _LATD5 0x20
1769 #define _LATD6 0x40
1770 #define _LATD7 0x80
1772 //==============================================================================
1775 //==============================================================================
1776 // LATE Bits
1778 extern __at(0x0F8D) __sfr LATE;
1780 typedef struct
1782 unsigned LATE0 : 1;
1783 unsigned LATE1 : 1;
1784 unsigned LATE2 : 1;
1785 unsigned LATE3 : 1;
1786 unsigned LATE4 : 1;
1787 unsigned LATE5 : 1;
1788 unsigned LATE6 : 1;
1789 unsigned LATE7 : 1;
1790 } __LATEbits_t;
1792 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1794 #define _LATE0 0x01
1795 #define _LATE1 0x02
1796 #define _LATE2 0x04
1797 #define _LATE3 0x08
1798 #define _LATE4 0x10
1799 #define _LATE5 0x20
1800 #define _LATE6 0x40
1801 #define _LATE7 0x80
1803 //==============================================================================
1806 //==============================================================================
1807 // LATF Bits
1809 extern __at(0x0F8E) __sfr LATF;
1811 typedef struct
1813 unsigned : 1;
1814 unsigned LATF1 : 1;
1815 unsigned LATF2 : 1;
1816 unsigned LATF3 : 1;
1817 unsigned LATF4 : 1;
1818 unsigned LATF5 : 1;
1819 unsigned LATF6 : 1;
1820 unsigned LATF7 : 1;
1821 } __LATFbits_t;
1823 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
1825 #define _LATF1 0x02
1826 #define _LATF2 0x04
1827 #define _LATF3 0x08
1828 #define _LATF4 0x10
1829 #define _LATF5 0x20
1830 #define _LATF6 0x40
1831 #define _LATF7 0x80
1833 //==============================================================================
1836 //==============================================================================
1837 // LATG Bits
1839 extern __at(0x0F8F) __sfr LATG;
1841 typedef union
1843 struct
1845 unsigned LATG0 : 1;
1846 unsigned LATG1 : 1;
1847 unsigned LATG2 : 1;
1848 unsigned LATG3 : 1;
1849 unsigned LATG4 : 1;
1850 unsigned : 1;
1851 unsigned : 1;
1852 unsigned : 1;
1855 struct
1857 unsigned LATG : 5;
1858 unsigned : 3;
1860 } __LATGbits_t;
1862 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
1864 #define _LATG0 0x01
1865 #define _LATG1 0x02
1866 #define _LATG2 0x04
1867 #define _LATG3 0x08
1868 #define _LATG4 0x10
1870 //==============================================================================
1873 //==============================================================================
1874 // DDRA Bits
1876 extern __at(0x0F92) __sfr DDRA;
1878 typedef union
1880 struct
1882 unsigned TRISA0 : 1;
1883 unsigned TRISA1 : 1;
1884 unsigned TRISA2 : 1;
1885 unsigned TRISA3 : 1;
1886 unsigned TRISA4 : 1;
1887 unsigned TRISA5 : 1;
1888 unsigned TRISA6 : 1;
1889 unsigned TRISA7 : 1;
1892 struct
1894 unsigned RA0 : 1;
1895 unsigned RA1 : 1;
1896 unsigned RA2 : 1;
1897 unsigned RA3 : 1;
1898 unsigned RA4 : 1;
1899 unsigned RA5 : 1;
1900 unsigned RA6 : 1;
1901 unsigned RA7 : 1;
1903 } __DDRAbits_t;
1905 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1907 #define _TRISA0 0x01
1908 #define _RA0 0x01
1909 #define _TRISA1 0x02
1910 #define _RA1 0x02
1911 #define _TRISA2 0x04
1912 #define _RA2 0x04
1913 #define _TRISA3 0x08
1914 #define _RA3 0x08
1915 #define _TRISA4 0x10
1916 #define _RA4 0x10
1917 #define _TRISA5 0x20
1918 #define _RA5 0x20
1919 #define _TRISA6 0x40
1920 #define _RA6 0x40
1921 #define _TRISA7 0x80
1922 #define _RA7 0x80
1924 //==============================================================================
1927 //==============================================================================
1928 // TRISA Bits
1930 extern __at(0x0F92) __sfr TRISA;
1932 typedef union
1934 struct
1936 unsigned TRISA0 : 1;
1937 unsigned TRISA1 : 1;
1938 unsigned TRISA2 : 1;
1939 unsigned TRISA3 : 1;
1940 unsigned TRISA4 : 1;
1941 unsigned TRISA5 : 1;
1942 unsigned TRISA6 : 1;
1943 unsigned TRISA7 : 1;
1946 struct
1948 unsigned RA0 : 1;
1949 unsigned RA1 : 1;
1950 unsigned RA2 : 1;
1951 unsigned RA3 : 1;
1952 unsigned RA4 : 1;
1953 unsigned RA5 : 1;
1954 unsigned RA6 : 1;
1955 unsigned RA7 : 1;
1957 } __TRISAbits_t;
1959 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1961 #define _TRISA_TRISA0 0x01
1962 #define _TRISA_RA0 0x01
1963 #define _TRISA_TRISA1 0x02
1964 #define _TRISA_RA1 0x02
1965 #define _TRISA_TRISA2 0x04
1966 #define _TRISA_RA2 0x04
1967 #define _TRISA_TRISA3 0x08
1968 #define _TRISA_RA3 0x08
1969 #define _TRISA_TRISA4 0x10
1970 #define _TRISA_RA4 0x10
1971 #define _TRISA_TRISA5 0x20
1972 #define _TRISA_RA5 0x20
1973 #define _TRISA_TRISA6 0x40
1974 #define _TRISA_RA6 0x40
1975 #define _TRISA_TRISA7 0x80
1976 #define _TRISA_RA7 0x80
1978 //==============================================================================
1981 //==============================================================================
1982 // DDRB Bits
1984 extern __at(0x0F93) __sfr DDRB;
1986 typedef union
1988 struct
1990 unsigned TRISB0 : 1;
1991 unsigned TRISB1 : 1;
1992 unsigned TRISB2 : 1;
1993 unsigned TRISB3 : 1;
1994 unsigned TRISB4 : 1;
1995 unsigned TRISB5 : 1;
1996 unsigned TRISB6 : 1;
1997 unsigned TRISB7 : 1;
2000 struct
2002 unsigned RB0 : 1;
2003 unsigned RB1 : 1;
2004 unsigned RB2 : 1;
2005 unsigned RB3 : 1;
2006 unsigned RB4 : 1;
2007 unsigned RB5 : 1;
2008 unsigned RB6 : 1;
2009 unsigned RB7 : 1;
2011 } __DDRBbits_t;
2013 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2015 #define _TRISB0 0x01
2016 #define _RB0 0x01
2017 #define _TRISB1 0x02
2018 #define _RB1 0x02
2019 #define _TRISB2 0x04
2020 #define _RB2 0x04
2021 #define _TRISB3 0x08
2022 #define _RB3 0x08
2023 #define _TRISB4 0x10
2024 #define _RB4 0x10
2025 #define _TRISB5 0x20
2026 #define _RB5 0x20
2027 #define _TRISB6 0x40
2028 #define _RB6 0x40
2029 #define _TRISB7 0x80
2030 #define _RB7 0x80
2032 //==============================================================================
2035 //==============================================================================
2036 // TRISB Bits
2038 extern __at(0x0F93) __sfr TRISB;
2040 typedef union
2042 struct
2044 unsigned TRISB0 : 1;
2045 unsigned TRISB1 : 1;
2046 unsigned TRISB2 : 1;
2047 unsigned TRISB3 : 1;
2048 unsigned TRISB4 : 1;
2049 unsigned TRISB5 : 1;
2050 unsigned TRISB6 : 1;
2051 unsigned TRISB7 : 1;
2054 struct
2056 unsigned RB0 : 1;
2057 unsigned RB1 : 1;
2058 unsigned RB2 : 1;
2059 unsigned RB3 : 1;
2060 unsigned RB4 : 1;
2061 unsigned RB5 : 1;
2062 unsigned RB6 : 1;
2063 unsigned RB7 : 1;
2065 } __TRISBbits_t;
2067 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2069 #define _TRISB_TRISB0 0x01
2070 #define _TRISB_RB0 0x01
2071 #define _TRISB_TRISB1 0x02
2072 #define _TRISB_RB1 0x02
2073 #define _TRISB_TRISB2 0x04
2074 #define _TRISB_RB2 0x04
2075 #define _TRISB_TRISB3 0x08
2076 #define _TRISB_RB3 0x08
2077 #define _TRISB_TRISB4 0x10
2078 #define _TRISB_RB4 0x10
2079 #define _TRISB_TRISB5 0x20
2080 #define _TRISB_RB5 0x20
2081 #define _TRISB_TRISB6 0x40
2082 #define _TRISB_RB6 0x40
2083 #define _TRISB_TRISB7 0x80
2084 #define _TRISB_RB7 0x80
2086 //==============================================================================
2089 //==============================================================================
2090 // DDRC Bits
2092 extern __at(0x0F94) __sfr DDRC;
2094 typedef union
2096 struct
2098 unsigned TRISC0 : 1;
2099 unsigned TRISC1 : 1;
2100 unsigned TRISC2 : 1;
2101 unsigned TRISC3 : 1;
2102 unsigned TRISC4 : 1;
2103 unsigned TRISC5 : 1;
2104 unsigned TRISC6 : 1;
2105 unsigned TRISC7 : 1;
2108 struct
2110 unsigned RC0 : 1;
2111 unsigned RC1 : 1;
2112 unsigned RC2 : 1;
2113 unsigned RC3 : 1;
2114 unsigned RC4 : 1;
2115 unsigned RC5 : 1;
2116 unsigned RC6 : 1;
2117 unsigned RC7 : 1;
2119 } __DDRCbits_t;
2121 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2123 #define _TRISC0 0x01
2124 #define _RC0 0x01
2125 #define _TRISC1 0x02
2126 #define _RC1 0x02
2127 #define _TRISC2 0x04
2128 #define _RC2 0x04
2129 #define _TRISC3 0x08
2130 #define _RC3 0x08
2131 #define _TRISC4 0x10
2132 #define _RC4 0x10
2133 #define _TRISC5 0x20
2134 #define _RC5 0x20
2135 #define _TRISC6 0x40
2136 #define _RC6 0x40
2137 #define _TRISC7 0x80
2138 #define _RC7 0x80
2140 //==============================================================================
2143 //==============================================================================
2144 // TRISC Bits
2146 extern __at(0x0F94) __sfr TRISC;
2148 typedef union
2150 struct
2152 unsigned TRISC0 : 1;
2153 unsigned TRISC1 : 1;
2154 unsigned TRISC2 : 1;
2155 unsigned TRISC3 : 1;
2156 unsigned TRISC4 : 1;
2157 unsigned TRISC5 : 1;
2158 unsigned TRISC6 : 1;
2159 unsigned TRISC7 : 1;
2162 struct
2164 unsigned RC0 : 1;
2165 unsigned RC1 : 1;
2166 unsigned RC2 : 1;
2167 unsigned RC3 : 1;
2168 unsigned RC4 : 1;
2169 unsigned RC5 : 1;
2170 unsigned RC6 : 1;
2171 unsigned RC7 : 1;
2173 } __TRISCbits_t;
2175 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2177 #define _TRISC_TRISC0 0x01
2178 #define _TRISC_RC0 0x01
2179 #define _TRISC_TRISC1 0x02
2180 #define _TRISC_RC1 0x02
2181 #define _TRISC_TRISC2 0x04
2182 #define _TRISC_RC2 0x04
2183 #define _TRISC_TRISC3 0x08
2184 #define _TRISC_RC3 0x08
2185 #define _TRISC_TRISC4 0x10
2186 #define _TRISC_RC4 0x10
2187 #define _TRISC_TRISC5 0x20
2188 #define _TRISC_RC5 0x20
2189 #define _TRISC_TRISC6 0x40
2190 #define _TRISC_RC6 0x40
2191 #define _TRISC_TRISC7 0x80
2192 #define _TRISC_RC7 0x80
2194 //==============================================================================
2197 //==============================================================================
2198 // DDRD Bits
2200 extern __at(0x0F95) __sfr DDRD;
2202 typedef union
2204 struct
2206 unsigned TRISD0 : 1;
2207 unsigned TRISD1 : 1;
2208 unsigned TRISD2 : 1;
2209 unsigned TRISD3 : 1;
2210 unsigned TRISD4 : 1;
2211 unsigned TRISD5 : 1;
2212 unsigned TRISD6 : 1;
2213 unsigned TRISD7 : 1;
2216 struct
2218 unsigned RD0 : 1;
2219 unsigned RD1 : 1;
2220 unsigned RD2 : 1;
2221 unsigned RD3 : 1;
2222 unsigned RD4 : 1;
2223 unsigned RD5 : 1;
2224 unsigned RD6 : 1;
2225 unsigned RD7 : 1;
2227 } __DDRDbits_t;
2229 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2231 #define _TRISD0 0x01
2232 #define _RD0 0x01
2233 #define _TRISD1 0x02
2234 #define _RD1 0x02
2235 #define _TRISD2 0x04
2236 #define _RD2 0x04
2237 #define _TRISD3 0x08
2238 #define _RD3 0x08
2239 #define _TRISD4 0x10
2240 #define _RD4 0x10
2241 #define _TRISD5 0x20
2242 #define _RD5 0x20
2243 #define _TRISD6 0x40
2244 #define _RD6 0x40
2245 #define _TRISD7 0x80
2246 #define _RD7 0x80
2248 //==============================================================================
2251 //==============================================================================
2252 // TRISD Bits
2254 extern __at(0x0F95) __sfr TRISD;
2256 typedef union
2258 struct
2260 unsigned TRISD0 : 1;
2261 unsigned TRISD1 : 1;
2262 unsigned TRISD2 : 1;
2263 unsigned TRISD3 : 1;
2264 unsigned TRISD4 : 1;
2265 unsigned TRISD5 : 1;
2266 unsigned TRISD6 : 1;
2267 unsigned TRISD7 : 1;
2270 struct
2272 unsigned RD0 : 1;
2273 unsigned RD1 : 1;
2274 unsigned RD2 : 1;
2275 unsigned RD3 : 1;
2276 unsigned RD4 : 1;
2277 unsigned RD5 : 1;
2278 unsigned RD6 : 1;
2279 unsigned RD7 : 1;
2281 } __TRISDbits_t;
2283 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2285 #define _TRISD_TRISD0 0x01
2286 #define _TRISD_RD0 0x01
2287 #define _TRISD_TRISD1 0x02
2288 #define _TRISD_RD1 0x02
2289 #define _TRISD_TRISD2 0x04
2290 #define _TRISD_RD2 0x04
2291 #define _TRISD_TRISD3 0x08
2292 #define _TRISD_RD3 0x08
2293 #define _TRISD_TRISD4 0x10
2294 #define _TRISD_RD4 0x10
2295 #define _TRISD_TRISD5 0x20
2296 #define _TRISD_RD5 0x20
2297 #define _TRISD_TRISD6 0x40
2298 #define _TRISD_RD6 0x40
2299 #define _TRISD_TRISD7 0x80
2300 #define _TRISD_RD7 0x80
2302 //==============================================================================
2305 //==============================================================================
2306 // DDRE Bits
2308 extern __at(0x0F96) __sfr DDRE;
2310 typedef union
2312 struct
2314 unsigned TRISE0 : 1;
2315 unsigned TRISE1 : 1;
2316 unsigned TRISE2 : 1;
2317 unsigned TRISE3 : 1;
2318 unsigned TRISE4 : 1;
2319 unsigned TRISE5 : 1;
2320 unsigned TRISE6 : 1;
2321 unsigned TRISE7 : 1;
2324 struct
2326 unsigned RE0 : 1;
2327 unsigned RE1 : 1;
2328 unsigned RE2 : 1;
2329 unsigned RE3 : 1;
2330 unsigned RE4 : 1;
2331 unsigned RE5 : 1;
2332 unsigned RE6 : 1;
2333 unsigned RE7 : 1;
2335 } __DDREbits_t;
2337 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2339 #define _TRISE0 0x01
2340 #define _RE0 0x01
2341 #define _TRISE1 0x02
2342 #define _RE1 0x02
2343 #define _TRISE2 0x04
2344 #define _RE2 0x04
2345 #define _TRISE3 0x08
2346 #define _RE3 0x08
2347 #define _TRISE4 0x10
2348 #define _RE4 0x10
2349 #define _TRISE5 0x20
2350 #define _RE5 0x20
2351 #define _TRISE6 0x40
2352 #define _RE6 0x40
2353 #define _TRISE7 0x80
2354 #define _RE7 0x80
2356 //==============================================================================
2359 //==============================================================================
2360 // TRISE Bits
2362 extern __at(0x0F96) __sfr TRISE;
2364 typedef union
2366 struct
2368 unsigned TRISE0 : 1;
2369 unsigned TRISE1 : 1;
2370 unsigned TRISE2 : 1;
2371 unsigned TRISE3 : 1;
2372 unsigned TRISE4 : 1;
2373 unsigned TRISE5 : 1;
2374 unsigned TRISE6 : 1;
2375 unsigned TRISE7 : 1;
2378 struct
2380 unsigned RE0 : 1;
2381 unsigned RE1 : 1;
2382 unsigned RE2 : 1;
2383 unsigned RE3 : 1;
2384 unsigned RE4 : 1;
2385 unsigned RE5 : 1;
2386 unsigned RE6 : 1;
2387 unsigned RE7 : 1;
2389 } __TRISEbits_t;
2391 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2393 #define _TRISE_TRISE0 0x01
2394 #define _TRISE_RE0 0x01
2395 #define _TRISE_TRISE1 0x02
2396 #define _TRISE_RE1 0x02
2397 #define _TRISE_TRISE2 0x04
2398 #define _TRISE_RE2 0x04
2399 #define _TRISE_TRISE3 0x08
2400 #define _TRISE_RE3 0x08
2401 #define _TRISE_TRISE4 0x10
2402 #define _TRISE_RE4 0x10
2403 #define _TRISE_TRISE5 0x20
2404 #define _TRISE_RE5 0x20
2405 #define _TRISE_TRISE6 0x40
2406 #define _TRISE_RE6 0x40
2407 #define _TRISE_TRISE7 0x80
2408 #define _TRISE_RE7 0x80
2410 //==============================================================================
2413 //==============================================================================
2414 // DDRF Bits
2416 extern __at(0x0F97) __sfr DDRF;
2418 typedef union
2420 struct
2422 unsigned : 1;
2423 unsigned TRISF1 : 1;
2424 unsigned TRISF2 : 1;
2425 unsigned TRISF3 : 1;
2426 unsigned TRISF4 : 1;
2427 unsigned TRISF5 : 1;
2428 unsigned TRISF6 : 1;
2429 unsigned TRISF7 : 1;
2432 struct
2434 unsigned : 1;
2435 unsigned RF1 : 1;
2436 unsigned RF2 : 1;
2437 unsigned RF3 : 1;
2438 unsigned RF4 : 1;
2439 unsigned RF5 : 1;
2440 unsigned RF6 : 1;
2441 unsigned RF7 : 1;
2443 } __DDRFbits_t;
2445 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
2447 #define _TRISF1 0x02
2448 #define _RF1 0x02
2449 #define _TRISF2 0x04
2450 #define _RF2 0x04
2451 #define _TRISF3 0x08
2452 #define _RF3 0x08
2453 #define _TRISF4 0x10
2454 #define _RF4 0x10
2455 #define _TRISF5 0x20
2456 #define _RF5 0x20
2457 #define _TRISF6 0x40
2458 #define _RF6 0x40
2459 #define _TRISF7 0x80
2460 #define _RF7 0x80
2462 //==============================================================================
2465 //==============================================================================
2466 // TRISF Bits
2468 extern __at(0x0F97) __sfr TRISF;
2470 typedef union
2472 struct
2474 unsigned : 1;
2475 unsigned TRISF1 : 1;
2476 unsigned TRISF2 : 1;
2477 unsigned TRISF3 : 1;
2478 unsigned TRISF4 : 1;
2479 unsigned TRISF5 : 1;
2480 unsigned TRISF6 : 1;
2481 unsigned TRISF7 : 1;
2484 struct
2486 unsigned : 1;
2487 unsigned RF1 : 1;
2488 unsigned RF2 : 1;
2489 unsigned RF3 : 1;
2490 unsigned RF4 : 1;
2491 unsigned RF5 : 1;
2492 unsigned RF6 : 1;
2493 unsigned RF7 : 1;
2495 } __TRISFbits_t;
2497 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
2499 #define _TRISF_TRISF1 0x02
2500 #define _TRISF_RF1 0x02
2501 #define _TRISF_TRISF2 0x04
2502 #define _TRISF_RF2 0x04
2503 #define _TRISF_TRISF3 0x08
2504 #define _TRISF_RF3 0x08
2505 #define _TRISF_TRISF4 0x10
2506 #define _TRISF_RF4 0x10
2507 #define _TRISF_TRISF5 0x20
2508 #define _TRISF_RF5 0x20
2509 #define _TRISF_TRISF6 0x40
2510 #define _TRISF_RF6 0x40
2511 #define _TRISF_TRISF7 0x80
2512 #define _TRISF_RF7 0x80
2514 //==============================================================================
2517 //==============================================================================
2518 // DDRG Bits
2520 extern __at(0x0F98) __sfr DDRG;
2522 typedef union
2524 struct
2526 unsigned TRISG0 : 1;
2527 unsigned TRISG1 : 1;
2528 unsigned TRISG2 : 1;
2529 unsigned TRISG3 : 1;
2530 unsigned TRISG4 : 1;
2531 unsigned : 1;
2532 unsigned : 1;
2533 unsigned : 1;
2536 struct
2538 unsigned RG0 : 1;
2539 unsigned RG1 : 1;
2540 unsigned RG2 : 1;
2541 unsigned RG3 : 1;
2542 unsigned RG4 : 1;
2543 unsigned : 1;
2544 unsigned : 1;
2545 unsigned : 1;
2548 struct
2550 unsigned TRISG : 5;
2551 unsigned : 3;
2554 struct
2556 unsigned RG : 5;
2557 unsigned : 3;
2559 } __DDRGbits_t;
2561 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
2563 #define _TRISG0 0x01
2564 #define _RG0 0x01
2565 #define _TRISG1 0x02
2566 #define _RG1 0x02
2567 #define _TRISG2 0x04
2568 #define _RG2 0x04
2569 #define _TRISG3 0x08
2570 #define _RG3 0x08
2571 #define _TRISG4 0x10
2572 #define _RG4 0x10
2574 //==============================================================================
2577 //==============================================================================
2578 // TRISG Bits
2580 extern __at(0x0F98) __sfr TRISG;
2582 typedef union
2584 struct
2586 unsigned TRISG0 : 1;
2587 unsigned TRISG1 : 1;
2588 unsigned TRISG2 : 1;
2589 unsigned TRISG3 : 1;
2590 unsigned TRISG4 : 1;
2591 unsigned : 1;
2592 unsigned : 1;
2593 unsigned : 1;
2596 struct
2598 unsigned RG0 : 1;
2599 unsigned RG1 : 1;
2600 unsigned RG2 : 1;
2601 unsigned RG3 : 1;
2602 unsigned RG4 : 1;
2603 unsigned : 1;
2604 unsigned : 1;
2605 unsigned : 1;
2608 struct
2610 unsigned TRISG : 5;
2611 unsigned : 3;
2614 struct
2616 unsigned RG : 5;
2617 unsigned : 3;
2619 } __TRISGbits_t;
2621 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
2623 #define _TRISG_TRISG0 0x01
2624 #define _TRISG_RG0 0x01
2625 #define _TRISG_TRISG1 0x02
2626 #define _TRISG_RG1 0x02
2627 #define _TRISG_TRISG2 0x04
2628 #define _TRISG_RG2 0x04
2629 #define _TRISG_TRISG3 0x08
2630 #define _TRISG_RG3 0x08
2631 #define _TRISG_TRISG4 0x10
2632 #define _TRISG_RG4 0x10
2634 //==============================================================================
2637 //==============================================================================
2638 // OSCTUNE Bits
2640 extern __at(0x0F9B) __sfr OSCTUNE;
2642 typedef union
2644 struct
2646 unsigned TUN0 : 1;
2647 unsigned TUN1 : 1;
2648 unsigned TUN2 : 1;
2649 unsigned TUN3 : 1;
2650 unsigned TUN4 : 1;
2651 unsigned TUN5 : 1;
2652 unsigned PLLEN : 1;
2653 unsigned INTSRC : 1;
2656 struct
2658 unsigned TUN : 6;
2659 unsigned : 2;
2661 } __OSCTUNEbits_t;
2663 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2665 #define _TUN0 0x01
2666 #define _TUN1 0x02
2667 #define _TUN2 0x04
2668 #define _TUN3 0x08
2669 #define _TUN4 0x10
2670 #define _TUN5 0x20
2671 #define _PLLEN 0x40
2672 #define _INTSRC 0x80
2674 //==============================================================================
2677 //==============================================================================
2678 // RCSTA2 Bits
2680 extern __at(0x0F9C) __sfr RCSTA2;
2682 typedef union
2684 struct
2686 unsigned RX9D : 1;
2687 unsigned OERR : 1;
2688 unsigned FERR : 1;
2689 unsigned ADDEN : 1;
2690 unsigned CREN : 1;
2691 unsigned SREN : 1;
2692 unsigned RX9 : 1;
2693 unsigned SPEN : 1;
2696 struct
2698 unsigned RCD8 : 1;
2699 unsigned OERR2 : 1;
2700 unsigned FERR2 : 1;
2701 unsigned ADDEN2 : 1;
2702 unsigned CREN2 : 1;
2703 unsigned SREN2 : 1;
2704 unsigned RC9 : 1;
2705 unsigned SPEN2 : 1;
2708 struct
2710 unsigned RX9D2 : 1;
2711 unsigned : 1;
2712 unsigned : 1;
2713 unsigned : 1;
2714 unsigned : 1;
2715 unsigned : 1;
2716 unsigned NOT_RC8 : 1;
2717 unsigned : 1;
2720 struct
2722 unsigned : 1;
2723 unsigned : 1;
2724 unsigned : 1;
2725 unsigned : 1;
2726 unsigned : 1;
2727 unsigned : 1;
2728 unsigned RC8_9 : 1;
2729 unsigned : 1;
2732 struct
2734 unsigned : 1;
2735 unsigned : 1;
2736 unsigned : 1;
2737 unsigned : 1;
2738 unsigned : 1;
2739 unsigned : 1;
2740 unsigned RX92 : 1;
2741 unsigned : 1;
2743 } __RCSTA2bits_t;
2745 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
2747 #define _RCSTA2_RX9D 0x01
2748 #define _RCSTA2_RCD8 0x01
2749 #define _RCSTA2_RX9D2 0x01
2750 #define _RCSTA2_OERR 0x02
2751 #define _RCSTA2_OERR2 0x02
2752 #define _RCSTA2_FERR 0x04
2753 #define _RCSTA2_FERR2 0x04
2754 #define _RCSTA2_ADDEN 0x08
2755 #define _RCSTA2_ADDEN2 0x08
2756 #define _RCSTA2_CREN 0x10
2757 #define _RCSTA2_CREN2 0x10
2758 #define _RCSTA2_SREN 0x20
2759 #define _RCSTA2_SREN2 0x20
2760 #define _RCSTA2_RX9 0x40
2761 #define _RCSTA2_RC9 0x40
2762 #define _RCSTA2_NOT_RC8 0x40
2763 #define _RCSTA2_RC8_9 0x40
2764 #define _RCSTA2_RX92 0x40
2765 #define _RCSTA2_SPEN 0x80
2766 #define _RCSTA2_SPEN2 0x80
2768 //==============================================================================
2771 //==============================================================================
2772 // PIE1 Bits
2774 extern __at(0x0F9D) __sfr PIE1;
2776 typedef union
2778 struct
2780 unsigned TMR1IE : 1;
2781 unsigned TMR2IE : 1;
2782 unsigned CCP1IE : 1;
2783 unsigned SSP1IE : 1;
2784 unsigned TX1IE : 1;
2785 unsigned RC1IE : 1;
2786 unsigned ADIE : 1;
2787 unsigned PMPIE : 1;
2790 struct
2792 unsigned : 1;
2793 unsigned : 1;
2794 unsigned : 1;
2795 unsigned SSPIE : 1;
2796 unsigned TXIE : 1;
2797 unsigned RCIE : 1;
2798 unsigned : 1;
2799 unsigned : 1;
2801 } __PIE1bits_t;
2803 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
2805 #define _TMR1IE 0x01
2806 #define _TMR2IE 0x02
2807 #define _CCP1IE 0x04
2808 #define _SSP1IE 0x08
2809 #define _SSPIE 0x08
2810 #define _TX1IE 0x10
2811 #define _TXIE 0x10
2812 #define _RC1IE 0x20
2813 #define _RCIE 0x20
2814 #define _ADIE 0x40
2815 #define _PMPIE 0x80
2817 //==============================================================================
2820 //==============================================================================
2821 // PIR1 Bits
2823 extern __at(0x0F9E) __sfr PIR1;
2825 typedef union
2827 struct
2829 unsigned TMR1IF : 1;
2830 unsigned TMR2IF : 1;
2831 unsigned CCP1IF : 1;
2832 unsigned SSP1IF : 1;
2833 unsigned TX1IF : 1;
2834 unsigned RC1IF : 1;
2835 unsigned ADIF : 1;
2836 unsigned PMPIF : 1;
2839 struct
2841 unsigned : 1;
2842 unsigned : 1;
2843 unsigned : 1;
2844 unsigned SSPIF : 1;
2845 unsigned TXIF : 1;
2846 unsigned RCIF : 1;
2847 unsigned : 1;
2848 unsigned : 1;
2850 } __PIR1bits_t;
2852 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2854 #define _TMR1IF 0x01
2855 #define _TMR2IF 0x02
2856 #define _CCP1IF 0x04
2857 #define _SSP1IF 0x08
2858 #define _SSPIF 0x08
2859 #define _TX1IF 0x10
2860 #define _TXIF 0x10
2861 #define _RC1IF 0x20
2862 #define _RCIF 0x20
2863 #define _ADIF 0x40
2864 #define _PMPIF 0x80
2866 //==============================================================================
2869 //==============================================================================
2870 // IPR1 Bits
2872 extern __at(0x0F9F) __sfr IPR1;
2874 typedef union
2876 struct
2878 unsigned TMR1IP : 1;
2879 unsigned TMR2IP : 1;
2880 unsigned CCP1IP : 1;
2881 unsigned SSP1IP : 1;
2882 unsigned TX1IP : 1;
2883 unsigned RC1IP : 1;
2884 unsigned ADIP : 1;
2885 unsigned PMPIP : 1;
2888 struct
2890 unsigned : 1;
2891 unsigned : 1;
2892 unsigned : 1;
2893 unsigned SSPIP : 1;
2894 unsigned TXIP : 1;
2895 unsigned RCIP : 1;
2896 unsigned : 1;
2897 unsigned : 1;
2899 } __IPR1bits_t;
2901 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2903 #define _TMR1IP 0x01
2904 #define _TMR2IP 0x02
2905 #define _CCP1IP 0x04
2906 #define _SSP1IP 0x08
2907 #define _SSPIP 0x08
2908 #define _TX1IP 0x10
2909 #define _TXIP 0x10
2910 #define _RC1IP 0x20
2911 #define _RCIP 0x20
2912 #define _ADIP 0x40
2913 #define _PMPIP 0x80
2915 //==============================================================================
2918 //==============================================================================
2919 // PIE2 Bits
2921 extern __at(0x0FA0) __sfr PIE2;
2923 typedef union
2925 struct
2927 unsigned CCP2IE : 1;
2928 unsigned TMR3IE : 1;
2929 unsigned LVDIE : 1;
2930 unsigned BCL1IE : 1;
2931 unsigned : 1;
2932 unsigned CM1IE : 1;
2933 unsigned CM2IE : 1;
2934 unsigned OSCFIE : 1;
2937 struct
2939 unsigned : 1;
2940 unsigned : 1;
2941 unsigned : 1;
2942 unsigned BCLIE : 1;
2943 unsigned : 1;
2944 unsigned : 1;
2945 unsigned : 1;
2946 unsigned : 1;
2948 } __PIE2bits_t;
2950 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2952 #define _CCP2IE 0x01
2953 #define _TMR3IE 0x02
2954 #define _LVDIE 0x04
2955 #define _BCL1IE 0x08
2956 #define _BCLIE 0x08
2957 #define _CM1IE 0x20
2958 #define _CM2IE 0x40
2959 #define _OSCFIE 0x80
2961 //==============================================================================
2964 //==============================================================================
2965 // PIR2 Bits
2967 extern __at(0x0FA1) __sfr PIR2;
2969 typedef union
2971 struct
2973 unsigned CCP2IF : 1;
2974 unsigned TMR3IF : 1;
2975 unsigned LVDIF : 1;
2976 unsigned BCL1IF : 1;
2977 unsigned : 1;
2978 unsigned CM1IF : 1;
2979 unsigned CM2IF : 1;
2980 unsigned OSCFIF : 1;
2983 struct
2985 unsigned : 1;
2986 unsigned : 1;
2987 unsigned : 1;
2988 unsigned BCLIF : 1;
2989 unsigned : 1;
2990 unsigned : 1;
2991 unsigned : 1;
2992 unsigned : 1;
2994 } __PIR2bits_t;
2996 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2998 #define _CCP2IF 0x01
2999 #define _TMR3IF 0x02
3000 #define _LVDIF 0x04
3001 #define _BCL1IF 0x08
3002 #define _BCLIF 0x08
3003 #define _CM1IF 0x20
3004 #define _CM2IF 0x40
3005 #define _OSCFIF 0x80
3007 //==============================================================================
3010 //==============================================================================
3011 // IPR2 Bits
3013 extern __at(0x0FA2) __sfr IPR2;
3015 typedef union
3017 struct
3019 unsigned CCP2IP : 1;
3020 unsigned TMR3IP : 1;
3021 unsigned LVDIP : 1;
3022 unsigned BCL1IP : 1;
3023 unsigned : 1;
3024 unsigned CM1IP : 1;
3025 unsigned CM2IP : 1;
3026 unsigned OSCFIP : 1;
3029 struct
3031 unsigned : 1;
3032 unsigned : 1;
3033 unsigned : 1;
3034 unsigned BCLIP : 1;
3035 unsigned : 1;
3036 unsigned : 1;
3037 unsigned : 1;
3038 unsigned : 1;
3040 } __IPR2bits_t;
3042 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3044 #define _CCP2IP 0x01
3045 #define _TMR3IP 0x02
3046 #define _LVDIP 0x04
3047 #define _BCL1IP 0x08
3048 #define _BCLIP 0x08
3049 #define _CM1IP 0x20
3050 #define _CM2IP 0x40
3051 #define _OSCFIP 0x80
3053 //==============================================================================
3056 //==============================================================================
3057 // PIE3 Bits
3059 extern __at(0x0FA3) __sfr PIE3;
3061 typedef struct
3063 unsigned CCP3IE : 1;
3064 unsigned CCP4IE : 1;
3065 unsigned CCP5IE : 1;
3066 unsigned TMR4IE : 1;
3067 unsigned TX2IE : 1;
3068 unsigned RC2IE : 1;
3069 unsigned BCL2IE : 1;
3070 unsigned SSP2IE : 1;
3071 } __PIE3bits_t;
3073 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3075 #define _CCP3IE 0x01
3076 #define _CCP4IE 0x02
3077 #define _CCP5IE 0x04
3078 #define _TMR4IE 0x08
3079 #define _TX2IE 0x10
3080 #define _RC2IE 0x20
3081 #define _BCL2IE 0x40
3082 #define _SSP2IE 0x80
3084 //==============================================================================
3087 //==============================================================================
3088 // PIR3 Bits
3090 extern __at(0x0FA4) __sfr PIR3;
3092 typedef struct
3094 unsigned CCP3IF : 1;
3095 unsigned CCP4IF : 1;
3096 unsigned CCP5IF : 1;
3097 unsigned TMR4IF : 1;
3098 unsigned TX2IF : 1;
3099 unsigned RC2IF : 1;
3100 unsigned BCL2IF : 1;
3101 unsigned SSP2IF : 1;
3102 } __PIR3bits_t;
3104 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3106 #define _CCP3IF 0x01
3107 #define _CCP4IF 0x02
3108 #define _CCP5IF 0x04
3109 #define _TMR4IF 0x08
3110 #define _TX2IF 0x10
3111 #define _RC2IF 0x20
3112 #define _BCL2IF 0x40
3113 #define _SSP2IF 0x80
3115 //==============================================================================
3118 //==============================================================================
3119 // IPR3 Bits
3121 extern __at(0x0FA5) __sfr IPR3;
3123 typedef struct
3125 unsigned CCP3IP : 1;
3126 unsigned CCP4IP : 1;
3127 unsigned CCP5IP : 1;
3128 unsigned TMR4IP : 1;
3129 unsigned TX2IP : 1;
3130 unsigned RC2IP : 1;
3131 unsigned BCL2IP : 1;
3132 unsigned SSP2IP : 1;
3133 } __IPR3bits_t;
3135 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3137 #define _CCP3IP 0x01
3138 #define _CCP4IP 0x02
3139 #define _CCP5IP 0x04
3140 #define _TMR4IP 0x08
3141 #define _TX2IP 0x10
3142 #define _RC2IP 0x20
3143 #define _BCL2IP 0x40
3144 #define _SSP2IP 0x80
3146 //==============================================================================
3149 //==============================================================================
3150 // EECON1 Bits
3152 extern __at(0x0FA6) __sfr EECON1;
3154 typedef struct
3156 unsigned : 1;
3157 unsigned WR : 1;
3158 unsigned WREN : 1;
3159 unsigned WRERR : 1;
3160 unsigned FREE : 1;
3161 unsigned WPROG : 1;
3162 unsigned : 1;
3163 unsigned : 1;
3164 } __EECON1bits_t;
3166 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3168 #define _WR 0x02
3169 #define _WREN 0x04
3170 #define _WRERR 0x08
3171 #define _FREE 0x10
3172 #define _WPROG 0x20
3174 //==============================================================================
3176 extern __at(0x0FA7) __sfr EECON2;
3178 //==============================================================================
3179 // TXSTA2 Bits
3181 extern __at(0x0FA8) __sfr TXSTA2;
3183 typedef union
3185 struct
3187 unsigned TX9D : 1;
3188 unsigned TRMT : 1;
3189 unsigned BRGH : 1;
3190 unsigned SENDB : 1;
3191 unsigned SYNC : 1;
3192 unsigned TXEN : 1;
3193 unsigned TX9 : 1;
3194 unsigned CSRC : 1;
3197 struct
3199 unsigned TXD8 : 1;
3200 unsigned TRMT2 : 1;
3201 unsigned BRGH2 : 1;
3202 unsigned SENDB2 : 1;
3203 unsigned SYNC2 : 1;
3204 unsigned TXEN2 : 1;
3205 unsigned TX8_9 : 1;
3206 unsigned CSRC2 : 1;
3209 struct
3211 unsigned TX9D2 : 1;
3212 unsigned : 1;
3213 unsigned : 1;
3214 unsigned : 1;
3215 unsigned : 1;
3216 unsigned : 1;
3217 unsigned NOT_TX8 : 1;
3218 unsigned : 1;
3221 struct
3223 unsigned : 1;
3224 unsigned : 1;
3225 unsigned : 1;
3226 unsigned : 1;
3227 unsigned : 1;
3228 unsigned : 1;
3229 unsigned TX92 : 1;
3230 unsigned : 1;
3232 } __TXSTA2bits_t;
3234 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
3236 #define _TXSTA2_TX9D 0x01
3237 #define _TXSTA2_TXD8 0x01
3238 #define _TXSTA2_TX9D2 0x01
3239 #define _TXSTA2_TRMT 0x02
3240 #define _TXSTA2_TRMT2 0x02
3241 #define _TXSTA2_BRGH 0x04
3242 #define _TXSTA2_BRGH2 0x04
3243 #define _TXSTA2_SENDB 0x08
3244 #define _TXSTA2_SENDB2 0x08
3245 #define _TXSTA2_SYNC 0x10
3246 #define _TXSTA2_SYNC2 0x10
3247 #define _TXSTA2_TXEN 0x20
3248 #define _TXSTA2_TXEN2 0x20
3249 #define _TXSTA2_TX9 0x40
3250 #define _TXSTA2_TX8_9 0x40
3251 #define _TXSTA2_NOT_TX8 0x40
3252 #define _TXSTA2_TX92 0x40
3253 #define _TXSTA2_CSRC 0x80
3254 #define _TXSTA2_CSRC2 0x80
3256 //==============================================================================
3258 extern __at(0x0FA9) __sfr TXREG2;
3259 extern __at(0x0FAA) __sfr RCREG2;
3260 extern __at(0x0FAB) __sfr SPBRG2;
3262 //==============================================================================
3263 // RCSTA Bits
3265 extern __at(0x0FAC) __sfr RCSTA;
3267 typedef union
3269 struct
3271 unsigned RX9D : 1;
3272 unsigned OERR : 1;
3273 unsigned FERR : 1;
3274 unsigned ADDEN : 1;
3275 unsigned CREN : 1;
3276 unsigned SREN : 1;
3277 unsigned RX9 : 1;
3278 unsigned SPEN : 1;
3281 struct
3283 unsigned RCD8 : 1;
3284 unsigned OERR1 : 1;
3285 unsigned FERR1 : 1;
3286 unsigned ADDEN1 : 1;
3287 unsigned CREN1 : 1;
3288 unsigned SREN1 : 1;
3289 unsigned RC9 : 1;
3290 unsigned SPEN1 : 1;
3293 struct
3295 unsigned RX9D1 : 1;
3296 unsigned : 1;
3297 unsigned : 1;
3298 unsigned : 1;
3299 unsigned : 1;
3300 unsigned : 1;
3301 unsigned NOT_RC8 : 1;
3302 unsigned : 1;
3305 struct
3307 unsigned : 1;
3308 unsigned : 1;
3309 unsigned : 1;
3310 unsigned : 1;
3311 unsigned : 1;
3312 unsigned : 1;
3313 unsigned RC8_9 : 1;
3314 unsigned : 1;
3317 struct
3319 unsigned : 1;
3320 unsigned : 1;
3321 unsigned : 1;
3322 unsigned : 1;
3323 unsigned : 1;
3324 unsigned : 1;
3325 unsigned RX91 : 1;
3326 unsigned : 1;
3328 } __RCSTAbits_t;
3330 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
3332 #define _RX9D 0x01
3333 #define _RCD8 0x01
3334 #define _RX9D1 0x01
3335 #define _OERR 0x02
3336 #define _OERR1 0x02
3337 #define _FERR 0x04
3338 #define _FERR1 0x04
3339 #define _ADDEN 0x08
3340 #define _ADDEN1 0x08
3341 #define _CREN 0x10
3342 #define _CREN1 0x10
3343 #define _SREN 0x20
3344 #define _SREN1 0x20
3345 #define _RX9 0x40
3346 #define _RC9 0x40
3347 #define _NOT_RC8 0x40
3348 #define _RC8_9 0x40
3349 #define _RX91 0x40
3350 #define _SPEN 0x80
3351 #define _SPEN1 0x80
3353 //==============================================================================
3356 //==============================================================================
3357 // RCSTA1 Bits
3359 extern __at(0x0FAC) __sfr RCSTA1;
3361 typedef union
3363 struct
3365 unsigned RX9D : 1;
3366 unsigned OERR : 1;
3367 unsigned FERR : 1;
3368 unsigned ADDEN : 1;
3369 unsigned CREN : 1;
3370 unsigned SREN : 1;
3371 unsigned RX9 : 1;
3372 unsigned SPEN : 1;
3375 struct
3377 unsigned RCD8 : 1;
3378 unsigned OERR1 : 1;
3379 unsigned FERR1 : 1;
3380 unsigned ADDEN1 : 1;
3381 unsigned CREN1 : 1;
3382 unsigned SREN1 : 1;
3383 unsigned RC9 : 1;
3384 unsigned SPEN1 : 1;
3387 struct
3389 unsigned RX9D1 : 1;
3390 unsigned : 1;
3391 unsigned : 1;
3392 unsigned : 1;
3393 unsigned : 1;
3394 unsigned : 1;
3395 unsigned NOT_RC8 : 1;
3396 unsigned : 1;
3399 struct
3401 unsigned : 1;
3402 unsigned : 1;
3403 unsigned : 1;
3404 unsigned : 1;
3405 unsigned : 1;
3406 unsigned : 1;
3407 unsigned RC8_9 : 1;
3408 unsigned : 1;
3411 struct
3413 unsigned : 1;
3414 unsigned : 1;
3415 unsigned : 1;
3416 unsigned : 1;
3417 unsigned : 1;
3418 unsigned : 1;
3419 unsigned RX91 : 1;
3420 unsigned : 1;
3422 } __RCSTA1bits_t;
3424 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
3426 #define _RCSTA1_RX9D 0x01
3427 #define _RCSTA1_RCD8 0x01
3428 #define _RCSTA1_RX9D1 0x01
3429 #define _RCSTA1_OERR 0x02
3430 #define _RCSTA1_OERR1 0x02
3431 #define _RCSTA1_FERR 0x04
3432 #define _RCSTA1_FERR1 0x04
3433 #define _RCSTA1_ADDEN 0x08
3434 #define _RCSTA1_ADDEN1 0x08
3435 #define _RCSTA1_CREN 0x10
3436 #define _RCSTA1_CREN1 0x10
3437 #define _RCSTA1_SREN 0x20
3438 #define _RCSTA1_SREN1 0x20
3439 #define _RCSTA1_RX9 0x40
3440 #define _RCSTA1_RC9 0x40
3441 #define _RCSTA1_NOT_RC8 0x40
3442 #define _RCSTA1_RC8_9 0x40
3443 #define _RCSTA1_RX91 0x40
3444 #define _RCSTA1_SPEN 0x80
3445 #define _RCSTA1_SPEN1 0x80
3447 //==============================================================================
3450 //==============================================================================
3451 // TXSTA Bits
3453 extern __at(0x0FAD) __sfr TXSTA;
3455 typedef union
3457 struct
3459 unsigned TX9D : 1;
3460 unsigned TRMT : 1;
3461 unsigned BRGH : 1;
3462 unsigned SENDB : 1;
3463 unsigned SYNC : 1;
3464 unsigned TXEN : 1;
3465 unsigned TX9 : 1;
3466 unsigned CSRC : 1;
3469 struct
3471 unsigned TXD8 : 1;
3472 unsigned TRMT1 : 1;
3473 unsigned BRGH1 : 1;
3474 unsigned SENDB1 : 1;
3475 unsigned SYNC1 : 1;
3476 unsigned TXEN1 : 1;
3477 unsigned TX8_9 : 1;
3478 unsigned CSRC1 : 1;
3481 struct
3483 unsigned TX9D1 : 1;
3484 unsigned : 1;
3485 unsigned : 1;
3486 unsigned : 1;
3487 unsigned : 1;
3488 unsigned : 1;
3489 unsigned NOT_TX8 : 1;
3490 unsigned : 1;
3493 struct
3495 unsigned : 1;
3496 unsigned : 1;
3497 unsigned : 1;
3498 unsigned : 1;
3499 unsigned : 1;
3500 unsigned : 1;
3501 unsigned TX91 : 1;
3502 unsigned : 1;
3504 } __TXSTAbits_t;
3506 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
3508 #define _TX9D 0x01
3509 #define _TXD8 0x01
3510 #define _TX9D1 0x01
3511 #define _TRMT 0x02
3512 #define _TRMT1 0x02
3513 #define _BRGH 0x04
3514 #define _BRGH1 0x04
3515 #define _SENDB 0x08
3516 #define _SENDB1 0x08
3517 #define _SYNC 0x10
3518 #define _SYNC1 0x10
3519 #define _TXEN 0x20
3520 #define _TXEN1 0x20
3521 #define _TX9 0x40
3522 #define _TX8_9 0x40
3523 #define _NOT_TX8 0x40
3524 #define _TX91 0x40
3525 #define _CSRC 0x80
3526 #define _CSRC1 0x80
3528 //==============================================================================
3531 //==============================================================================
3532 // TXSTA1 Bits
3534 extern __at(0x0FAD) __sfr TXSTA1;
3536 typedef union
3538 struct
3540 unsigned TX9D : 1;
3541 unsigned TRMT : 1;
3542 unsigned BRGH : 1;
3543 unsigned SENDB : 1;
3544 unsigned SYNC : 1;
3545 unsigned TXEN : 1;
3546 unsigned TX9 : 1;
3547 unsigned CSRC : 1;
3550 struct
3552 unsigned TXD8 : 1;
3553 unsigned TRMT1 : 1;
3554 unsigned BRGH1 : 1;
3555 unsigned SENDB1 : 1;
3556 unsigned SYNC1 : 1;
3557 unsigned TXEN1 : 1;
3558 unsigned TX8_9 : 1;
3559 unsigned CSRC1 : 1;
3562 struct
3564 unsigned TX9D1 : 1;
3565 unsigned : 1;
3566 unsigned : 1;
3567 unsigned : 1;
3568 unsigned : 1;
3569 unsigned : 1;
3570 unsigned NOT_TX8 : 1;
3571 unsigned : 1;
3574 struct
3576 unsigned : 1;
3577 unsigned : 1;
3578 unsigned : 1;
3579 unsigned : 1;
3580 unsigned : 1;
3581 unsigned : 1;
3582 unsigned TX91 : 1;
3583 unsigned : 1;
3585 } __TXSTA1bits_t;
3587 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
3589 #define _TXSTA1_TX9D 0x01
3590 #define _TXSTA1_TXD8 0x01
3591 #define _TXSTA1_TX9D1 0x01
3592 #define _TXSTA1_TRMT 0x02
3593 #define _TXSTA1_TRMT1 0x02
3594 #define _TXSTA1_BRGH 0x04
3595 #define _TXSTA1_BRGH1 0x04
3596 #define _TXSTA1_SENDB 0x08
3597 #define _TXSTA1_SENDB1 0x08
3598 #define _TXSTA1_SYNC 0x10
3599 #define _TXSTA1_SYNC1 0x10
3600 #define _TXSTA1_TXEN 0x20
3601 #define _TXSTA1_TXEN1 0x20
3602 #define _TXSTA1_TX9 0x40
3603 #define _TXSTA1_TX8_9 0x40
3604 #define _TXSTA1_NOT_TX8 0x40
3605 #define _TXSTA1_TX91 0x40
3606 #define _TXSTA1_CSRC 0x80
3607 #define _TXSTA1_CSRC1 0x80
3609 //==============================================================================
3611 extern __at(0x0FAE) __sfr TXREG;
3612 extern __at(0x0FAE) __sfr TXREG1;
3613 extern __at(0x0FAF) __sfr RCREG;
3614 extern __at(0x0FAF) __sfr RCREG1;
3615 extern __at(0x0FB0) __sfr SPBRG;
3616 extern __at(0x0FB0) __sfr SPBRG1;
3618 //==============================================================================
3619 // CCP3CON Bits
3621 extern __at(0x0FB1) __sfr CCP3CON;
3623 typedef union
3625 struct
3627 unsigned CCP3M0 : 1;
3628 unsigned CCP3M1 : 1;
3629 unsigned CCP3M2 : 1;
3630 unsigned CCP3M3 : 1;
3631 unsigned DC3B0 : 1;
3632 unsigned DC3B1 : 1;
3633 unsigned P3M0 : 1;
3634 unsigned P3M1 : 1;
3637 struct
3639 unsigned : 1;
3640 unsigned : 1;
3641 unsigned : 1;
3642 unsigned : 1;
3643 unsigned CCP3Y : 1;
3644 unsigned CCP3X : 1;
3645 unsigned : 1;
3646 unsigned : 1;
3649 struct
3651 unsigned CCP3M : 4;
3652 unsigned : 4;
3655 struct
3657 unsigned : 4;
3658 unsigned DC3B : 2;
3659 unsigned : 2;
3662 struct
3664 unsigned : 6;
3665 unsigned P3M : 2;
3667 } __CCP3CONbits_t;
3669 extern __at(0x0FB1) volatile __CCP3CONbits_t CCP3CONbits;
3671 #define _CCP3M0 0x01
3672 #define _CCP3M1 0x02
3673 #define _CCP3M2 0x04
3674 #define _CCP3M3 0x08
3675 #define _DC3B0 0x10
3676 #define _CCP3Y 0x10
3677 #define _DC3B1 0x20
3678 #define _CCP3X 0x20
3679 #define _P3M0 0x40
3680 #define _P3M1 0x80
3682 //==============================================================================
3685 //==============================================================================
3686 // ECCP3CON Bits
3688 extern __at(0x0FB1) __sfr ECCP3CON;
3690 typedef union
3692 struct
3694 unsigned CCP3M0 : 1;
3695 unsigned CCP3M1 : 1;
3696 unsigned CCP3M2 : 1;
3697 unsigned CCP3M3 : 1;
3698 unsigned DC3B0 : 1;
3699 unsigned DC3B1 : 1;
3700 unsigned P3M0 : 1;
3701 unsigned P3M1 : 1;
3704 struct
3706 unsigned : 1;
3707 unsigned : 1;
3708 unsigned : 1;
3709 unsigned : 1;
3710 unsigned CCP3Y : 1;
3711 unsigned CCP3X : 1;
3712 unsigned : 1;
3713 unsigned : 1;
3716 struct
3718 unsigned CCP3M : 4;
3719 unsigned : 4;
3722 struct
3724 unsigned : 4;
3725 unsigned DC3B : 2;
3726 unsigned : 2;
3729 struct
3731 unsigned : 6;
3732 unsigned P3M : 2;
3734 } __ECCP3CONbits_t;
3736 extern __at(0x0FB1) volatile __ECCP3CONbits_t ECCP3CONbits;
3738 #define _ECCP3CON_CCP3M0 0x01
3739 #define _ECCP3CON_CCP3M1 0x02
3740 #define _ECCP3CON_CCP3M2 0x04
3741 #define _ECCP3CON_CCP3M3 0x08
3742 #define _ECCP3CON_DC3B0 0x10
3743 #define _ECCP3CON_CCP3Y 0x10
3744 #define _ECCP3CON_DC3B1 0x20
3745 #define _ECCP3CON_CCP3X 0x20
3746 #define _ECCP3CON_P3M0 0x40
3747 #define _ECCP3CON_P3M1 0x80
3749 //==============================================================================
3751 extern __at(0x0FB2) __sfr CCPR3;
3752 extern __at(0x0FB2) __sfr CCPR3L;
3753 extern __at(0x0FB3) __sfr CCPR3H;
3755 //==============================================================================
3756 // ECCP3DEL Bits
3758 extern __at(0x0FB4) __sfr ECCP3DEL;
3760 typedef union
3762 struct
3764 unsigned PDC0 : 1;
3765 unsigned PDC1 : 1;
3766 unsigned PDC2 : 1;
3767 unsigned PDC3 : 1;
3768 unsigned PDC4 : 1;
3769 unsigned PDC5 : 1;
3770 unsigned PDC6 : 1;
3771 unsigned PRSEN : 1;
3774 struct
3776 unsigned P3DC0 : 1;
3777 unsigned P3DC1 : 1;
3778 unsigned P3DC2 : 1;
3779 unsigned P3DC3 : 1;
3780 unsigned P3DC4 : 1;
3781 unsigned P3DC5 : 1;
3782 unsigned P3DC6 : 1;
3783 unsigned P3RSEN : 1;
3786 struct
3788 unsigned PDC : 7;
3789 unsigned : 1;
3792 struct
3794 unsigned P3DC : 7;
3795 unsigned : 1;
3797 } __ECCP3DELbits_t;
3799 extern __at(0x0FB4) volatile __ECCP3DELbits_t ECCP3DELbits;
3801 #define _ECCP3DEL_PDC0 0x01
3802 #define _ECCP3DEL_P3DC0 0x01
3803 #define _ECCP3DEL_PDC1 0x02
3804 #define _ECCP3DEL_P3DC1 0x02
3805 #define _ECCP3DEL_PDC2 0x04
3806 #define _ECCP3DEL_P3DC2 0x04
3807 #define _ECCP3DEL_PDC3 0x08
3808 #define _ECCP3DEL_P3DC3 0x08
3809 #define _ECCP3DEL_PDC4 0x10
3810 #define _ECCP3DEL_P3DC4 0x10
3811 #define _ECCP3DEL_PDC5 0x20
3812 #define _ECCP3DEL_P3DC5 0x20
3813 #define _ECCP3DEL_PDC6 0x40
3814 #define _ECCP3DEL_P3DC6 0x40
3815 #define _ECCP3DEL_PRSEN 0x80
3816 #define _ECCP3DEL_P3RSEN 0x80
3818 //==============================================================================
3821 //==============================================================================
3822 // ECCP3AS Bits
3824 extern __at(0x0FB5) __sfr ECCP3AS;
3826 typedef union
3828 struct
3830 unsigned PSSBD0 : 1;
3831 unsigned PSSBD1 : 1;
3832 unsigned PSSAC0 : 1;
3833 unsigned PSSAC1 : 1;
3834 unsigned ECCPAS0 : 1;
3835 unsigned ECCPAS1 : 1;
3836 unsigned ECCPAS2 : 1;
3837 unsigned ECCPASE : 1;
3840 struct
3842 unsigned PSS3BD0 : 1;
3843 unsigned PSS3BD1 : 1;
3844 unsigned PSS3AC0 : 1;
3845 unsigned PSS3AC1 : 1;
3846 unsigned ECCP3AS0 : 1;
3847 unsigned ECCP3AS1 : 1;
3848 unsigned ECCP3AS2 : 1;
3849 unsigned ECCP3ASE : 1;
3852 struct
3854 unsigned PSSBD : 2;
3855 unsigned : 6;
3858 struct
3860 unsigned PSS3BD : 2;
3861 unsigned : 6;
3864 struct
3866 unsigned : 2;
3867 unsigned PSSAC : 2;
3868 unsigned : 4;
3871 struct
3873 unsigned : 2;
3874 unsigned PSS3AC : 2;
3875 unsigned : 4;
3878 struct
3880 unsigned : 4;
3881 unsigned ECCPAS : 3;
3882 unsigned : 1;
3885 struct
3887 unsigned : 4;
3888 unsigned ECCP3AS : 3;
3889 unsigned : 1;
3891 } __ECCP3ASbits_t;
3893 extern __at(0x0FB5) volatile __ECCP3ASbits_t ECCP3ASbits;
3895 #define _ECCP3AS_PSSBD0 0x01
3896 #define _ECCP3AS_PSS3BD0 0x01
3897 #define _ECCP3AS_PSSBD1 0x02
3898 #define _ECCP3AS_PSS3BD1 0x02
3899 #define _ECCP3AS_PSSAC0 0x04
3900 #define _ECCP3AS_PSS3AC0 0x04
3901 #define _ECCP3AS_PSSAC1 0x08
3902 #define _ECCP3AS_PSS3AC1 0x08
3903 #define _ECCP3AS_ECCPAS0 0x10
3904 #define _ECCP3AS_ECCP3AS0 0x10
3905 #define _ECCP3AS_ECCPAS1 0x20
3906 #define _ECCP3AS_ECCP3AS1 0x20
3907 #define _ECCP3AS_ECCPAS2 0x40
3908 #define _ECCP3AS_ECCP3AS2 0x40
3909 #define _ECCP3AS_ECCPASE 0x80
3910 #define _ECCP3AS_ECCP3ASE 0x80
3912 //==============================================================================
3915 //==============================================================================
3916 // CCP2CON Bits
3918 extern __at(0x0FB6) __sfr CCP2CON;
3920 typedef union
3922 struct
3924 unsigned CCP2M0 : 1;
3925 unsigned CCP2M1 : 1;
3926 unsigned CCP2M2 : 1;
3927 unsigned CCP2M3 : 1;
3928 unsigned DC2B0 : 1;
3929 unsigned DC2B1 : 1;
3930 unsigned P2M0 : 1;
3931 unsigned P2M1 : 1;
3934 struct
3936 unsigned : 1;
3937 unsigned : 1;
3938 unsigned : 1;
3939 unsigned : 1;
3940 unsigned CCP2Y : 1;
3941 unsigned CCP2X : 1;
3942 unsigned : 1;
3943 unsigned : 1;
3946 struct
3948 unsigned CCP2M : 4;
3949 unsigned : 4;
3952 struct
3954 unsigned : 4;
3955 unsigned DC2B : 2;
3956 unsigned : 2;
3959 struct
3961 unsigned : 6;
3962 unsigned P2M : 2;
3964 } __CCP2CONbits_t;
3966 extern __at(0x0FB6) volatile __CCP2CONbits_t CCP2CONbits;
3968 #define _CCP2M0 0x01
3969 #define _CCP2M1 0x02
3970 #define _CCP2M2 0x04
3971 #define _CCP2M3 0x08
3972 #define _DC2B0 0x10
3973 #define _CCP2Y 0x10
3974 #define _DC2B1 0x20
3975 #define _CCP2X 0x20
3976 #define _P2M0 0x40
3977 #define _P2M1 0x80
3979 //==============================================================================
3982 //==============================================================================
3983 // ECCP2CON Bits
3985 extern __at(0x0FB6) __sfr ECCP2CON;
3987 typedef union
3989 struct
3991 unsigned CCP2M0 : 1;
3992 unsigned CCP2M1 : 1;
3993 unsigned CCP2M2 : 1;
3994 unsigned CCP2M3 : 1;
3995 unsigned DC2B0 : 1;
3996 unsigned DC2B1 : 1;
3997 unsigned P2M0 : 1;
3998 unsigned P2M1 : 1;
4001 struct
4003 unsigned : 1;
4004 unsigned : 1;
4005 unsigned : 1;
4006 unsigned : 1;
4007 unsigned CCP2Y : 1;
4008 unsigned CCP2X : 1;
4009 unsigned : 1;
4010 unsigned : 1;
4013 struct
4015 unsigned CCP2M : 4;
4016 unsigned : 4;
4019 struct
4021 unsigned : 4;
4022 unsigned DC2B : 2;
4023 unsigned : 2;
4026 struct
4028 unsigned : 6;
4029 unsigned P2M : 2;
4031 } __ECCP2CONbits_t;
4033 extern __at(0x0FB6) volatile __ECCP2CONbits_t ECCP2CONbits;
4035 #define _ECCP2CON_CCP2M0 0x01
4036 #define _ECCP2CON_CCP2M1 0x02
4037 #define _ECCP2CON_CCP2M2 0x04
4038 #define _ECCP2CON_CCP2M3 0x08
4039 #define _ECCP2CON_DC2B0 0x10
4040 #define _ECCP2CON_CCP2Y 0x10
4041 #define _ECCP2CON_DC2B1 0x20
4042 #define _ECCP2CON_CCP2X 0x20
4043 #define _ECCP2CON_P2M0 0x40
4044 #define _ECCP2CON_P2M1 0x80
4046 //==============================================================================
4048 extern __at(0x0FB7) __sfr CCPR2;
4049 extern __at(0x0FB7) __sfr CCPR2L;
4050 extern __at(0x0FB8) __sfr CCPR2H;
4052 //==============================================================================
4053 // ECCP2DEL Bits
4055 extern __at(0x0FB9) __sfr ECCP2DEL;
4057 typedef union
4059 struct
4061 unsigned PDC0 : 1;
4062 unsigned PDC1 : 1;
4063 unsigned PDC2 : 1;
4064 unsigned PDC3 : 1;
4065 unsigned PDC4 : 1;
4066 unsigned PDC5 : 1;
4067 unsigned PDC6 : 1;
4068 unsigned PRSEN : 1;
4071 struct
4073 unsigned P2DC0 : 1;
4074 unsigned P2DC1 : 1;
4075 unsigned P2DC2 : 1;
4076 unsigned P2DC3 : 1;
4077 unsigned P2DC4 : 1;
4078 unsigned P2DC5 : 1;
4079 unsigned P2DC6 : 1;
4080 unsigned P2RSEN : 1;
4083 struct
4085 unsigned PDC : 7;
4086 unsigned : 1;
4089 struct
4091 unsigned P2DC : 7;
4092 unsigned : 1;
4094 } __ECCP2DELbits_t;
4096 extern __at(0x0FB9) volatile __ECCP2DELbits_t ECCP2DELbits;
4098 #define _ECCP2DEL_PDC0 0x01
4099 #define _ECCP2DEL_P2DC0 0x01
4100 #define _ECCP2DEL_PDC1 0x02
4101 #define _ECCP2DEL_P2DC1 0x02
4102 #define _ECCP2DEL_PDC2 0x04
4103 #define _ECCP2DEL_P2DC2 0x04
4104 #define _ECCP2DEL_PDC3 0x08
4105 #define _ECCP2DEL_P2DC3 0x08
4106 #define _ECCP2DEL_PDC4 0x10
4107 #define _ECCP2DEL_P2DC4 0x10
4108 #define _ECCP2DEL_PDC5 0x20
4109 #define _ECCP2DEL_P2DC5 0x20
4110 #define _ECCP2DEL_PDC6 0x40
4111 #define _ECCP2DEL_P2DC6 0x40
4112 #define _ECCP2DEL_PRSEN 0x80
4113 #define _ECCP2DEL_P2RSEN 0x80
4115 //==============================================================================
4118 //==============================================================================
4119 // ECCP2AS Bits
4121 extern __at(0x0FBA) __sfr ECCP2AS;
4123 typedef union
4125 struct
4127 unsigned PSSBD0 : 1;
4128 unsigned PSSBD1 : 1;
4129 unsigned PSSAC0 : 1;
4130 unsigned PSSAC1 : 1;
4131 unsigned ECCPAS0 : 1;
4132 unsigned ECCPAS1 : 1;
4133 unsigned ECCPAS2 : 1;
4134 unsigned ECCPASE : 1;
4137 struct
4139 unsigned PSS2BD0 : 1;
4140 unsigned PSS2BD1 : 1;
4141 unsigned PSS2AC0 : 1;
4142 unsigned PSS2AC1 : 1;
4143 unsigned ECCP2AS0 : 1;
4144 unsigned ECCP2AS1 : 1;
4145 unsigned ECCP2AS2 : 1;
4146 unsigned ECCP2ASE : 1;
4149 struct
4151 unsigned PSS2BD : 2;
4152 unsigned : 6;
4155 struct
4157 unsigned PSSBD : 2;
4158 unsigned : 6;
4161 struct
4163 unsigned : 2;
4164 unsigned PSSAC : 2;
4165 unsigned : 4;
4168 struct
4170 unsigned : 2;
4171 unsigned PSS2AC : 2;
4172 unsigned : 4;
4175 struct
4177 unsigned : 4;
4178 unsigned ECCPAS : 3;
4179 unsigned : 1;
4182 struct
4184 unsigned : 4;
4185 unsigned ECCP2AS : 3;
4186 unsigned : 1;
4188 } __ECCP2ASbits_t;
4190 extern __at(0x0FBA) volatile __ECCP2ASbits_t ECCP2ASbits;
4192 #define _ECCP2AS_PSSBD0 0x01
4193 #define _ECCP2AS_PSS2BD0 0x01
4194 #define _ECCP2AS_PSSBD1 0x02
4195 #define _ECCP2AS_PSS2BD1 0x02
4196 #define _ECCP2AS_PSSAC0 0x04
4197 #define _ECCP2AS_PSS2AC0 0x04
4198 #define _ECCP2AS_PSSAC1 0x08
4199 #define _ECCP2AS_PSS2AC1 0x08
4200 #define _ECCP2AS_ECCPAS0 0x10
4201 #define _ECCP2AS_ECCP2AS0 0x10
4202 #define _ECCP2AS_ECCPAS1 0x20
4203 #define _ECCP2AS_ECCP2AS1 0x20
4204 #define _ECCP2AS_ECCPAS2 0x40
4205 #define _ECCP2AS_ECCP2AS2 0x40
4206 #define _ECCP2AS_ECCPASE 0x80
4207 #define _ECCP2AS_ECCP2ASE 0x80
4209 //==============================================================================
4212 //==============================================================================
4213 // CCP1CON Bits
4215 extern __at(0x0FBB) __sfr CCP1CON;
4217 typedef union
4219 struct
4221 unsigned CCP1M0 : 1;
4222 unsigned CCP1M1 : 1;
4223 unsigned CCP1M2 : 1;
4224 unsigned CCP1M3 : 1;
4225 unsigned DC1B0 : 1;
4226 unsigned DC1B1 : 1;
4227 unsigned P1M0 : 1;
4228 unsigned P1M1 : 1;
4231 struct
4233 unsigned : 1;
4234 unsigned : 1;
4235 unsigned : 1;
4236 unsigned : 1;
4237 unsigned CCP1Y : 1;
4238 unsigned CCP1X : 1;
4239 unsigned : 1;
4240 unsigned : 1;
4243 struct
4245 unsigned CCP1M : 4;
4246 unsigned : 4;
4249 struct
4251 unsigned : 4;
4252 unsigned DC1B : 2;
4253 unsigned : 2;
4256 struct
4258 unsigned : 6;
4259 unsigned P1M : 2;
4261 } __CCP1CONbits_t;
4263 extern __at(0x0FBB) volatile __CCP1CONbits_t CCP1CONbits;
4265 #define _CCP1M0 0x01
4266 #define _CCP1M1 0x02
4267 #define _CCP1M2 0x04
4268 #define _CCP1M3 0x08
4269 #define _DC1B0 0x10
4270 #define _CCP1Y 0x10
4271 #define _DC1B1 0x20
4272 #define _CCP1X 0x20
4273 #define _P1M0 0x40
4274 #define _P1M1 0x80
4276 //==============================================================================
4279 //==============================================================================
4280 // ECCP1CON Bits
4282 extern __at(0x0FBB) __sfr ECCP1CON;
4284 typedef union
4286 struct
4288 unsigned CCP1M0 : 1;
4289 unsigned CCP1M1 : 1;
4290 unsigned CCP1M2 : 1;
4291 unsigned CCP1M3 : 1;
4292 unsigned DC1B0 : 1;
4293 unsigned DC1B1 : 1;
4294 unsigned P1M0 : 1;
4295 unsigned P1M1 : 1;
4298 struct
4300 unsigned : 1;
4301 unsigned : 1;
4302 unsigned : 1;
4303 unsigned : 1;
4304 unsigned CCP1Y : 1;
4305 unsigned CCP1X : 1;
4306 unsigned : 1;
4307 unsigned : 1;
4310 struct
4312 unsigned CCP1M : 4;
4313 unsigned : 4;
4316 struct
4318 unsigned : 4;
4319 unsigned DC1B : 2;
4320 unsigned : 2;
4323 struct
4325 unsigned : 6;
4326 unsigned P1M : 2;
4328 } __ECCP1CONbits_t;
4330 extern __at(0x0FBB) volatile __ECCP1CONbits_t ECCP1CONbits;
4332 #define _ECCP1CON_CCP1M0 0x01
4333 #define _ECCP1CON_CCP1M1 0x02
4334 #define _ECCP1CON_CCP1M2 0x04
4335 #define _ECCP1CON_CCP1M3 0x08
4336 #define _ECCP1CON_DC1B0 0x10
4337 #define _ECCP1CON_CCP1Y 0x10
4338 #define _ECCP1CON_DC1B1 0x20
4339 #define _ECCP1CON_CCP1X 0x20
4340 #define _ECCP1CON_P1M0 0x40
4341 #define _ECCP1CON_P1M1 0x80
4343 //==============================================================================
4345 extern __at(0x0FBC) __sfr CCPR1;
4346 extern __at(0x0FBC) __sfr CCPR1L;
4347 extern __at(0x0FBD) __sfr CCPR1H;
4349 //==============================================================================
4350 // ECCP1DEL Bits
4352 extern __at(0x0FBE) __sfr ECCP1DEL;
4354 typedef union
4356 struct
4358 unsigned PDC0 : 1;
4359 unsigned PDC1 : 1;
4360 unsigned PDC2 : 1;
4361 unsigned PDC3 : 1;
4362 unsigned PDC4 : 1;
4363 unsigned PDC5 : 1;
4364 unsigned PDC6 : 1;
4365 unsigned PRSEN : 1;
4368 struct
4370 unsigned P1DC0 : 1;
4371 unsigned P1DC1 : 1;
4372 unsigned P1DC2 : 1;
4373 unsigned P1DC3 : 1;
4374 unsigned P1DC4 : 1;
4375 unsigned P1DC5 : 1;
4376 unsigned P1DC6 : 1;
4377 unsigned P1RSEN : 1;
4380 struct
4382 unsigned PDC : 7;
4383 unsigned : 1;
4386 struct
4388 unsigned P1DC : 7;
4389 unsigned : 1;
4391 } __ECCP1DELbits_t;
4393 extern __at(0x0FBE) volatile __ECCP1DELbits_t ECCP1DELbits;
4395 #define _PDC0 0x01
4396 #define _P1DC0 0x01
4397 #define _PDC1 0x02
4398 #define _P1DC1 0x02
4399 #define _PDC2 0x04
4400 #define _P1DC2 0x04
4401 #define _PDC3 0x08
4402 #define _P1DC3 0x08
4403 #define _PDC4 0x10
4404 #define _P1DC4 0x10
4405 #define _PDC5 0x20
4406 #define _P1DC5 0x20
4407 #define _PDC6 0x40
4408 #define _P1DC6 0x40
4409 #define _PRSEN 0x80
4410 #define _P1RSEN 0x80
4412 //==============================================================================
4415 //==============================================================================
4416 // ECCP1AS Bits
4418 extern __at(0x0FBF) __sfr ECCP1AS;
4420 typedef union
4422 struct
4424 unsigned PSSBD0 : 1;
4425 unsigned PSSBD1 : 1;
4426 unsigned PSSAC0 : 1;
4427 unsigned PSSAC1 : 1;
4428 unsigned ECCPAS0 : 1;
4429 unsigned ECCPAS1 : 1;
4430 unsigned ECCPAS2 : 1;
4431 unsigned ECCPASE : 1;
4434 struct
4436 unsigned PSS1BD0 : 1;
4437 unsigned PSS1BD1 : 1;
4438 unsigned PSS1AC0 : 1;
4439 unsigned PSS1AC1 : 1;
4440 unsigned ECCP1AS0 : 1;
4441 unsigned ECCP1AS1 : 1;
4442 unsigned ECCP1AS2 : 1;
4443 unsigned ECCP1ASE : 1;
4446 struct
4448 unsigned PSS1BD : 2;
4449 unsigned : 6;
4452 struct
4454 unsigned PSSBD : 2;
4455 unsigned : 6;
4458 struct
4460 unsigned : 2;
4461 unsigned PSS1AC : 2;
4462 unsigned : 4;
4465 struct
4467 unsigned : 2;
4468 unsigned PSSAC : 2;
4469 unsigned : 4;
4472 struct
4474 unsigned : 4;
4475 unsigned ECCP1AS : 3;
4476 unsigned : 1;
4479 struct
4481 unsigned : 4;
4482 unsigned ECCPAS : 3;
4483 unsigned : 1;
4485 } __ECCP1ASbits_t;
4487 extern __at(0x0FBF) volatile __ECCP1ASbits_t ECCP1ASbits;
4489 #define _PSSBD0 0x01
4490 #define _PSS1BD0 0x01
4491 #define _PSSBD1 0x02
4492 #define _PSS1BD1 0x02
4493 #define _PSSAC0 0x04
4494 #define _PSS1AC0 0x04
4495 #define _PSSAC1 0x08
4496 #define _PSS1AC1 0x08
4497 #define _ECCPAS0 0x10
4498 #define _ECCP1AS0 0x10
4499 #define _ECCPAS1 0x20
4500 #define _ECCP1AS1 0x20
4501 #define _ECCPAS2 0x40
4502 #define _ECCP1AS2 0x40
4503 #define _ECCPASE 0x80
4504 #define _ECCP1ASE 0x80
4506 //==============================================================================
4509 //==============================================================================
4510 // WDTCON Bits
4512 extern __at(0x0FC0) __sfr WDTCON;
4514 typedef union
4516 struct
4518 unsigned SWDTEN : 1;
4519 unsigned : 1;
4520 unsigned : 1;
4521 unsigned : 1;
4522 unsigned ADSHR : 1;
4523 unsigned : 1;
4524 unsigned LVDSTAT : 1;
4525 unsigned REGSLP : 1;
4528 struct
4530 unsigned SWDTE : 1;
4531 unsigned : 1;
4532 unsigned : 1;
4533 unsigned : 1;
4534 unsigned DEVCFG : 1;
4535 unsigned : 1;
4536 unsigned : 1;
4537 unsigned : 1;
4539 } __WDTCONbits_t;
4541 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
4543 #define _SWDTEN 0x01
4544 #define _SWDTE 0x01
4545 #define _ADSHR 0x10
4546 #define _DEVCFG 0x10
4547 #define _LVDSTAT 0x40
4548 #define _REGSLP 0x80
4550 //==============================================================================
4553 //==============================================================================
4554 // ADCON1 Bits
4556 extern __at(0x0FC1) __sfr ADCON1;
4558 typedef union
4560 struct
4562 unsigned ADCS0 : 1;
4563 unsigned ADCS1 : 1;
4564 unsigned ADCS2 : 1;
4565 unsigned ACQT0 : 1;
4566 unsigned ACQT1 : 1;
4567 unsigned ACQT2 : 1;
4568 unsigned ADCAL : 1;
4569 unsigned ADFM : 1;
4572 struct
4574 unsigned ADCS : 3;
4575 unsigned : 5;
4578 struct
4580 unsigned : 3;
4581 unsigned ACQT : 3;
4582 unsigned : 2;
4584 } __ADCON1bits_t;
4586 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4588 #define _ADCS0 0x01
4589 #define _ADCS1 0x02
4590 #define _ADCS2 0x04
4591 #define _ACQT0 0x08
4592 #define _ACQT1 0x10
4593 #define _ACQT2 0x20
4594 #define _ADCAL 0x40
4595 #define _ADFM 0x80
4597 //==============================================================================
4600 //==============================================================================
4601 // ANCON0 Bits
4603 extern __at(0x0FC1) __sfr ANCON0;
4605 typedef struct
4607 unsigned PCFG0 : 1;
4608 unsigned PCFG1 : 1;
4609 unsigned PCFG2 : 1;
4610 unsigned PCFG3 : 1;
4611 unsigned PCFG4 : 1;
4612 unsigned : 1;
4613 unsigned PCFG6 : 1;
4614 unsigned PCFG7 : 1;
4615 } __ANCON0bits_t;
4617 extern __at(0x0FC1) volatile __ANCON0bits_t ANCON0bits;
4619 #define _PCFG0 0x01
4620 #define _PCFG1 0x02
4621 #define _PCFG2 0x04
4622 #define _PCFG3 0x08
4623 #define _PCFG4 0x10
4624 #define _PCFG6 0x40
4625 #define _PCFG7 0x80
4627 //==============================================================================
4630 //==============================================================================
4631 // ADCON0 Bits
4633 extern __at(0x0FC2) __sfr ADCON0;
4635 typedef union
4637 struct
4639 unsigned ADON : 1;
4640 unsigned GO_NOT_DONE : 1;
4641 unsigned CHS0 : 1;
4642 unsigned CHS1 : 1;
4643 unsigned CHS2 : 1;
4644 unsigned CHS3 : 1;
4645 unsigned VCFG0 : 1;
4646 unsigned VCFG1 : 1;
4649 struct
4651 unsigned : 1;
4652 unsigned DONE : 1;
4653 unsigned : 1;
4654 unsigned : 1;
4655 unsigned : 1;
4656 unsigned : 1;
4657 unsigned : 1;
4658 unsigned : 1;
4661 struct
4663 unsigned : 1;
4664 unsigned GO_DONE : 1;
4665 unsigned : 1;
4666 unsigned : 1;
4667 unsigned : 1;
4668 unsigned : 1;
4669 unsigned : 1;
4670 unsigned : 1;
4673 struct
4675 unsigned : 1;
4676 unsigned GO : 1;
4677 unsigned : 1;
4678 unsigned : 1;
4679 unsigned : 1;
4680 unsigned : 1;
4681 unsigned : 1;
4682 unsigned : 1;
4685 struct
4687 unsigned : 1;
4688 unsigned NOT_DONE : 1;
4689 unsigned : 1;
4690 unsigned : 1;
4691 unsigned : 1;
4692 unsigned : 1;
4693 unsigned : 1;
4694 unsigned : 1;
4697 struct
4699 unsigned : 2;
4700 unsigned CHS : 4;
4701 unsigned : 2;
4704 struct
4706 unsigned : 6;
4707 unsigned VCFG : 2;
4709 } __ADCON0bits_t;
4711 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4713 #define _ADON 0x01
4714 #define _GO_NOT_DONE 0x02
4715 #define _DONE 0x02
4716 #define _GO_DONE 0x02
4717 #define _GO 0x02
4718 #define _NOT_DONE 0x02
4719 #define _CHS0 0x04
4720 #define _CHS1 0x08
4721 #define _CHS2 0x10
4722 #define _CHS3 0x20
4723 #define _VCFG0 0x40
4724 #define _VCFG1 0x80
4726 //==============================================================================
4729 //==============================================================================
4730 // ANCON1 Bits
4732 extern __at(0x0FC2) __sfr ANCON1;
4734 typedef struct
4736 unsigned PCFG8 : 1;
4737 unsigned PCFG9 : 1;
4738 unsigned PCFG10 : 1;
4739 unsigned PCFG11 : 1;
4740 unsigned PCFG12 : 1;
4741 unsigned PCFG13 : 1;
4742 unsigned PCFG14 : 1;
4743 unsigned PCFG15 : 1;
4744 } __ANCON1bits_t;
4746 extern __at(0x0FC2) volatile __ANCON1bits_t ANCON1bits;
4748 #define _PCFG8 0x01
4749 #define _PCFG9 0x02
4750 #define _PCFG10 0x04
4751 #define _PCFG11 0x08
4752 #define _PCFG12 0x10
4753 #define _PCFG13 0x20
4754 #define _PCFG14 0x40
4755 #define _PCFG15 0x80
4757 //==============================================================================
4759 extern __at(0x0FC3) __sfr ADRES;
4760 extern __at(0x0FC3) __sfr ADRESL;
4761 extern __at(0x0FC4) __sfr ADRESH;
4763 //==============================================================================
4764 // SSP1CON2 Bits
4766 extern __at(0x0FC5) __sfr SSP1CON2;
4768 typedef union
4770 struct
4772 unsigned SEN : 1;
4773 unsigned RSEN : 1;
4774 unsigned PEN : 1;
4775 unsigned RCEN : 1;
4776 unsigned ACKEN : 1;
4777 unsigned ACKDT : 1;
4778 unsigned ACKSTAT : 1;
4779 unsigned GCEN : 1;
4782 struct
4784 unsigned : 1;
4785 unsigned ADMSK1 : 1;
4786 unsigned ADMSK2 : 1;
4787 unsigned ADMSK3 : 1;
4788 unsigned ADMSK4 : 1;
4789 unsigned ADMSK5 : 1;
4790 unsigned : 1;
4791 unsigned : 1;
4793 } __SSP1CON2bits_t;
4795 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4797 #define _SEN 0x01
4798 #define _RSEN 0x02
4799 #define _ADMSK1 0x02
4800 #define _PEN 0x04
4801 #define _ADMSK2 0x04
4802 #define _RCEN 0x08
4803 #define _ADMSK3 0x08
4804 #define _ACKEN 0x10
4805 #define _ADMSK4 0x10
4806 #define _ACKDT 0x20
4807 #define _ADMSK5 0x20
4808 #define _ACKSTAT 0x40
4809 #define _GCEN 0x80
4811 //==============================================================================
4814 //==============================================================================
4815 // SSPCON2 Bits
4817 extern __at(0x0FC5) __sfr SSPCON2;
4819 typedef union
4821 struct
4823 unsigned SEN : 1;
4824 unsigned RSEN : 1;
4825 unsigned PEN : 1;
4826 unsigned RCEN : 1;
4827 unsigned ACKEN : 1;
4828 unsigned ACKDT : 1;
4829 unsigned ACKSTAT : 1;
4830 unsigned GCEN : 1;
4833 struct
4835 unsigned : 1;
4836 unsigned ADMSK1 : 1;
4837 unsigned ADMSK2 : 1;
4838 unsigned ADMSK3 : 1;
4839 unsigned ADMSK4 : 1;
4840 unsigned ADMSK5 : 1;
4841 unsigned : 1;
4842 unsigned : 1;
4844 } __SSPCON2bits_t;
4846 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4848 #define _SSPCON2_SEN 0x01
4849 #define _SSPCON2_RSEN 0x02
4850 #define _SSPCON2_ADMSK1 0x02
4851 #define _SSPCON2_PEN 0x04
4852 #define _SSPCON2_ADMSK2 0x04
4853 #define _SSPCON2_RCEN 0x08
4854 #define _SSPCON2_ADMSK3 0x08
4855 #define _SSPCON2_ACKEN 0x10
4856 #define _SSPCON2_ADMSK4 0x10
4857 #define _SSPCON2_ACKDT 0x20
4858 #define _SSPCON2_ADMSK5 0x20
4859 #define _SSPCON2_ACKSTAT 0x40
4860 #define _SSPCON2_GCEN 0x80
4862 //==============================================================================
4865 //==============================================================================
4866 // SSP1CON1 Bits
4868 extern __at(0x0FC6) __sfr SSP1CON1;
4870 typedef union
4872 struct
4874 unsigned SSPM0 : 1;
4875 unsigned SSPM1 : 1;
4876 unsigned SSPM2 : 1;
4877 unsigned SSPM3 : 1;
4878 unsigned CKP : 1;
4879 unsigned SSPEN : 1;
4880 unsigned SSPOV : 1;
4881 unsigned WCOL : 1;
4884 struct
4886 unsigned SSPM : 4;
4887 unsigned : 4;
4889 } __SSP1CON1bits_t;
4891 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4893 #define _SSPM0 0x01
4894 #define _SSPM1 0x02
4895 #define _SSPM2 0x04
4896 #define _SSPM3 0x08
4897 #define _CKP 0x10
4898 #define _SSPEN 0x20
4899 #define _SSPOV 0x40
4900 #define _WCOL 0x80
4902 //==============================================================================
4905 //==============================================================================
4906 // SSPCON1 Bits
4908 extern __at(0x0FC6) __sfr SSPCON1;
4910 typedef union
4912 struct
4914 unsigned SSPM0 : 1;
4915 unsigned SSPM1 : 1;
4916 unsigned SSPM2 : 1;
4917 unsigned SSPM3 : 1;
4918 unsigned CKP : 1;
4919 unsigned SSPEN : 1;
4920 unsigned SSPOV : 1;
4921 unsigned WCOL : 1;
4924 struct
4926 unsigned SSPM : 4;
4927 unsigned : 4;
4929 } __SSPCON1bits_t;
4931 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4933 #define _SSPCON1_SSPM0 0x01
4934 #define _SSPCON1_SSPM1 0x02
4935 #define _SSPCON1_SSPM2 0x04
4936 #define _SSPCON1_SSPM3 0x08
4937 #define _SSPCON1_CKP 0x10
4938 #define _SSPCON1_SSPEN 0x20
4939 #define _SSPCON1_SSPOV 0x40
4940 #define _SSPCON1_WCOL 0x80
4942 //==============================================================================
4945 //==============================================================================
4946 // SSP1STAT Bits
4948 extern __at(0x0FC7) __sfr SSP1STAT;
4950 typedef union
4952 struct
4954 unsigned BF : 1;
4955 unsigned UA : 1;
4956 unsigned R_NOT_W : 1;
4957 unsigned S : 1;
4958 unsigned P : 1;
4959 unsigned D_NOT_A : 1;
4960 unsigned CKE : 1;
4961 unsigned SMP : 1;
4964 struct
4966 unsigned : 1;
4967 unsigned : 1;
4968 unsigned R_W : 1;
4969 unsigned I2C_START : 1;
4970 unsigned I2C_STOP : 1;
4971 unsigned D_A : 1;
4972 unsigned : 1;
4973 unsigned : 1;
4976 struct
4978 unsigned : 1;
4979 unsigned : 1;
4980 unsigned I2C_READ : 1;
4981 unsigned : 1;
4982 unsigned : 1;
4983 unsigned I2C_DAT : 1;
4984 unsigned : 1;
4985 unsigned : 1;
4988 struct
4990 unsigned : 1;
4991 unsigned : 1;
4992 unsigned NOT_W : 1;
4993 unsigned : 1;
4994 unsigned : 1;
4995 unsigned NOT_A : 1;
4996 unsigned : 1;
4997 unsigned : 1;
5000 struct
5002 unsigned : 1;
5003 unsigned : 1;
5004 unsigned NOT_WRITE : 1;
5005 unsigned : 1;
5006 unsigned : 1;
5007 unsigned NOT_ADDRESS : 1;
5008 unsigned : 1;
5009 unsigned : 1;
5012 struct
5014 unsigned : 1;
5015 unsigned : 1;
5016 unsigned READ_WRITE : 1;
5017 unsigned : 1;
5018 unsigned : 1;
5019 unsigned DATA_ADDRESS : 1;
5020 unsigned : 1;
5021 unsigned : 1;
5024 struct
5026 unsigned : 1;
5027 unsigned : 1;
5028 unsigned R : 1;
5029 unsigned : 1;
5030 unsigned : 1;
5031 unsigned D : 1;
5032 unsigned : 1;
5033 unsigned : 1;
5035 } __SSP1STATbits_t;
5037 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5039 #define _BF 0x01
5040 #define _UA 0x02
5041 #define _R_NOT_W 0x04
5042 #define _R_W 0x04
5043 #define _I2C_READ 0x04
5044 #define _NOT_W 0x04
5045 #define _NOT_WRITE 0x04
5046 #define _READ_WRITE 0x04
5047 #define _R 0x04
5048 #define _S 0x08
5049 #define _I2C_START 0x08
5050 #define _P 0x10
5051 #define _I2C_STOP 0x10
5052 #define _D_NOT_A 0x20
5053 #define _D_A 0x20
5054 #define _I2C_DAT 0x20
5055 #define _NOT_A 0x20
5056 #define _NOT_ADDRESS 0x20
5057 #define _DATA_ADDRESS 0x20
5058 #define _D 0x20
5059 #define _CKE 0x40
5060 #define _SMP 0x80
5062 //==============================================================================
5065 //==============================================================================
5066 // SSPSTAT Bits
5068 extern __at(0x0FC7) __sfr SSPSTAT;
5070 typedef union
5072 struct
5074 unsigned BF : 1;
5075 unsigned UA : 1;
5076 unsigned R_NOT_W : 1;
5077 unsigned S : 1;
5078 unsigned P : 1;
5079 unsigned D_NOT_A : 1;
5080 unsigned CKE : 1;
5081 unsigned SMP : 1;
5084 struct
5086 unsigned : 1;
5087 unsigned : 1;
5088 unsigned R_W : 1;
5089 unsigned I2C_START : 1;
5090 unsigned I2C_STOP : 1;
5091 unsigned D_A : 1;
5092 unsigned : 1;
5093 unsigned : 1;
5096 struct
5098 unsigned : 1;
5099 unsigned : 1;
5100 unsigned I2C_READ : 1;
5101 unsigned : 1;
5102 unsigned : 1;
5103 unsigned I2C_DAT : 1;
5104 unsigned : 1;
5105 unsigned : 1;
5108 struct
5110 unsigned : 1;
5111 unsigned : 1;
5112 unsigned NOT_W : 1;
5113 unsigned : 1;
5114 unsigned : 1;
5115 unsigned NOT_A : 1;
5116 unsigned : 1;
5117 unsigned : 1;
5120 struct
5122 unsigned : 1;
5123 unsigned : 1;
5124 unsigned NOT_WRITE : 1;
5125 unsigned : 1;
5126 unsigned : 1;
5127 unsigned NOT_ADDRESS : 1;
5128 unsigned : 1;
5129 unsigned : 1;
5132 struct
5134 unsigned : 1;
5135 unsigned : 1;
5136 unsigned READ_WRITE : 1;
5137 unsigned : 1;
5138 unsigned : 1;
5139 unsigned DATA_ADDRESS : 1;
5140 unsigned : 1;
5141 unsigned : 1;
5144 struct
5146 unsigned : 1;
5147 unsigned : 1;
5148 unsigned R : 1;
5149 unsigned : 1;
5150 unsigned : 1;
5151 unsigned D : 1;
5152 unsigned : 1;
5153 unsigned : 1;
5155 } __SSPSTATbits_t;
5157 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5159 #define _SSPSTAT_BF 0x01
5160 #define _SSPSTAT_UA 0x02
5161 #define _SSPSTAT_R_NOT_W 0x04
5162 #define _SSPSTAT_R_W 0x04
5163 #define _SSPSTAT_I2C_READ 0x04
5164 #define _SSPSTAT_NOT_W 0x04
5165 #define _SSPSTAT_NOT_WRITE 0x04
5166 #define _SSPSTAT_READ_WRITE 0x04
5167 #define _SSPSTAT_R 0x04
5168 #define _SSPSTAT_S 0x08
5169 #define _SSPSTAT_I2C_START 0x08
5170 #define _SSPSTAT_P 0x10
5171 #define _SSPSTAT_I2C_STOP 0x10
5172 #define _SSPSTAT_D_NOT_A 0x20
5173 #define _SSPSTAT_D_A 0x20
5174 #define _SSPSTAT_I2C_DAT 0x20
5175 #define _SSPSTAT_NOT_A 0x20
5176 #define _SSPSTAT_NOT_ADDRESS 0x20
5177 #define _SSPSTAT_DATA_ADDRESS 0x20
5178 #define _SSPSTAT_D 0x20
5179 #define _SSPSTAT_CKE 0x40
5180 #define _SSPSTAT_SMP 0x80
5182 //==============================================================================
5184 extern __at(0x0FC8) __sfr SSP1ADD;
5186 //==============================================================================
5187 // SSP1MSK Bits
5189 extern __at(0x0FC8) __sfr SSP1MSK;
5191 typedef struct
5193 unsigned MSK0 : 1;
5194 unsigned MSK1 : 1;
5195 unsigned MSK2 : 1;
5196 unsigned MSK3 : 1;
5197 unsigned MSK4 : 1;
5198 unsigned MSK5 : 1;
5199 unsigned MSK6 : 1;
5200 unsigned MSK7 : 1;
5201 } __SSP1MSKbits_t;
5203 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
5205 #define _MSK0 0x01
5206 #define _MSK1 0x02
5207 #define _MSK2 0x04
5208 #define _MSK3 0x08
5209 #define _MSK4 0x10
5210 #define _MSK5 0x20
5211 #define _MSK6 0x40
5212 #define _MSK7 0x80
5214 //==============================================================================
5216 extern __at(0x0FC8) __sfr SSPADD;
5217 extern __at(0x0FC9) __sfr SSP1BUF;
5218 extern __at(0x0FC9) __sfr SSPBUF;
5220 //==============================================================================
5221 // T2CON Bits
5223 extern __at(0x0FCA) __sfr T2CON;
5225 typedef union
5227 struct
5229 unsigned T2CKPS0 : 1;
5230 unsigned T2CKPS1 : 1;
5231 unsigned TMR2ON : 1;
5232 unsigned T2OUTPS0 : 1;
5233 unsigned T2OUTPS1 : 1;
5234 unsigned T2OUTPS2 : 1;
5235 unsigned T2OUTPS3 : 1;
5236 unsigned : 1;
5239 struct
5241 unsigned T2CKPS : 2;
5242 unsigned : 6;
5245 struct
5247 unsigned : 3;
5248 unsigned T2OUTPS : 4;
5249 unsigned : 1;
5251 } __T2CONbits_t;
5253 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5255 #define _T2CKPS0 0x01
5256 #define _T2CKPS1 0x02
5257 #define _TMR2ON 0x04
5258 #define _T2OUTPS0 0x08
5259 #define _T2OUTPS1 0x10
5260 #define _T2OUTPS2 0x20
5261 #define _T2OUTPS3 0x40
5263 //==============================================================================
5265 extern __at(0x0FCB) __sfr PR2;
5267 //==============================================================================
5268 // PADCFG1 Bits
5270 extern __at(0x0FCC) __sfr PADCFG1;
5272 typedef union
5274 struct
5276 unsigned PMPTL : 1;
5277 unsigned : 1;
5278 unsigned : 1;
5279 unsigned : 1;
5280 unsigned : 1;
5281 unsigned : 1;
5282 unsigned : 1;
5283 unsigned : 1;
5286 struct
5288 unsigned PMPTTL : 1;
5289 unsigned : 1;
5290 unsigned : 1;
5291 unsigned : 1;
5292 unsigned : 1;
5293 unsigned : 1;
5294 unsigned : 1;
5295 unsigned : 1;
5297 } __PADCFG1bits_t;
5299 extern __at(0x0FCC) volatile __PADCFG1bits_t PADCFG1bits;
5301 #define _PMPTL 0x01
5302 #define _PMPTTL 0x01
5304 //==============================================================================
5306 extern __at(0x0FCC) __sfr TMR2;
5308 //==============================================================================
5309 // ODCON3 Bits
5311 extern __at(0x0FCD) __sfr ODCON3;
5313 typedef struct
5315 unsigned SPI1OD : 1;
5316 unsigned SPI2OD : 1;
5317 unsigned : 1;
5318 unsigned : 1;
5319 unsigned : 1;
5320 unsigned : 1;
5321 unsigned : 1;
5322 unsigned : 1;
5323 } __ODCON3bits_t;
5325 extern __at(0x0FCD) volatile __ODCON3bits_t ODCON3bits;
5327 #define _SPI1OD 0x01
5328 #define _SPI2OD 0x02
5330 //==============================================================================
5333 //==============================================================================
5334 // T1CON Bits
5336 extern __at(0x0FCD) __sfr T1CON;
5338 typedef union
5340 struct
5342 unsigned TMR1ON : 1;
5343 unsigned TMR1CS : 1;
5344 unsigned NOT_T1SYNC : 1;
5345 unsigned T1OSCEN : 1;
5346 unsigned T1CKPS0 : 1;
5347 unsigned T1CKPS1 : 1;
5348 unsigned T1RUN : 1;
5349 unsigned RD16 : 1;
5352 struct
5354 unsigned : 1;
5355 unsigned : 1;
5356 unsigned T1SYNC : 1;
5357 unsigned : 1;
5358 unsigned : 1;
5359 unsigned : 1;
5360 unsigned : 1;
5361 unsigned : 1;
5364 struct
5366 unsigned : 1;
5367 unsigned : 1;
5368 unsigned T1INSYNC : 1;
5369 unsigned : 1;
5370 unsigned : 1;
5371 unsigned : 1;
5372 unsigned : 1;
5373 unsigned : 1;
5376 struct
5378 unsigned : 4;
5379 unsigned T1CKPS : 2;
5380 unsigned : 2;
5382 } __T1CONbits_t;
5384 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5386 #define _TMR1ON 0x01
5387 #define _TMR1CS 0x02
5388 #define _NOT_T1SYNC 0x04
5389 #define _T1SYNC 0x04
5390 #define _T1INSYNC 0x04
5391 #define _T1OSCEN 0x08
5392 #define _T1CKPS0 0x10
5393 #define _T1CKPS1 0x20
5394 #define _T1RUN 0x40
5395 #define _RD16 0x80
5397 //==============================================================================
5400 //==============================================================================
5401 // ODCON2 Bits
5403 extern __at(0x0FCE) __sfr ODCON2;
5405 typedef union
5407 struct
5409 unsigned USART1OD : 1;
5410 unsigned USART2OD : 1;
5411 unsigned : 1;
5412 unsigned : 1;
5413 unsigned : 1;
5414 unsigned : 1;
5415 unsigned : 1;
5416 unsigned : 1;
5419 struct
5421 unsigned U1OD : 1;
5422 unsigned U2OD : 1;
5423 unsigned : 1;
5424 unsigned : 1;
5425 unsigned : 1;
5426 unsigned : 1;
5427 unsigned : 1;
5428 unsigned : 1;
5430 } __ODCON2bits_t;
5432 extern __at(0x0FCE) volatile __ODCON2bits_t ODCON2bits;
5434 #define _USART1OD 0x01
5435 #define _U1OD 0x01
5436 #define _USART2OD 0x02
5437 #define _U2OD 0x02
5439 //==============================================================================
5441 extern __at(0x0FCE) __sfr TMR1;
5442 extern __at(0x0FCE) __sfr TMR1L;
5444 //==============================================================================
5445 // ODCON1 Bits
5447 extern __at(0x0FCF) __sfr ODCON1;
5449 typedef struct
5451 unsigned ECCP1OD : 1;
5452 unsigned ECCP2OD : 1;
5453 unsigned ECCP3OD : 1;
5454 unsigned CCP4OD : 1;
5455 unsigned CCP5OD : 1;
5456 unsigned : 1;
5457 unsigned : 1;
5458 unsigned : 1;
5459 } __ODCON1bits_t;
5461 extern __at(0x0FCF) volatile __ODCON1bits_t ODCON1bits;
5463 #define _ECCP1OD 0x01
5464 #define _ECCP2OD 0x02
5465 #define _ECCP3OD 0x04
5466 #define _CCP4OD 0x08
5467 #define _CCP5OD 0x10
5469 //==============================================================================
5471 extern __at(0x0FCF) __sfr TMR1H;
5473 //==============================================================================
5474 // RCON Bits
5476 extern __at(0x0FD0) __sfr RCON;
5478 typedef union
5480 struct
5482 unsigned NOT_BOR : 1;
5483 unsigned NOT_POR : 1;
5484 unsigned NOT_PD : 1;
5485 unsigned NOT_TO : 1;
5486 unsigned NOT_RI : 1;
5487 unsigned NOT_CM : 1;
5488 unsigned : 1;
5489 unsigned IPEN : 1;
5492 struct
5494 unsigned BOR : 1;
5495 unsigned POR : 1;
5496 unsigned PD : 1;
5497 unsigned TO : 1;
5498 unsigned RI : 1;
5499 unsigned CM : 1;
5500 unsigned : 1;
5501 unsigned : 1;
5503 } __RCONbits_t;
5505 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5507 #define _NOT_BOR 0x01
5508 #define _BOR 0x01
5509 #define _NOT_POR 0x02
5510 #define _POR 0x02
5511 #define _NOT_PD 0x04
5512 #define _PD 0x04
5513 #define _NOT_TO 0x08
5514 #define _TO 0x08
5515 #define _NOT_RI 0x10
5516 #define _RI 0x10
5517 #define _NOT_CM 0x20
5518 #define _CM 0x20
5519 #define _IPEN 0x80
5521 //==============================================================================
5524 //==============================================================================
5525 // CM2CON Bits
5527 extern __at(0x0FD1) __sfr CM2CON;
5529 typedef union
5531 struct
5533 unsigned C1CH0 : 1;
5534 unsigned C1CH1 : 1;
5535 unsigned CREF : 1;
5536 unsigned EVPOL0 : 1;
5537 unsigned EVPOL1 : 1;
5538 unsigned CPOL : 1;
5539 unsigned COE : 1;
5540 unsigned CON : 1;
5543 struct
5545 unsigned CCH0 : 1;
5546 unsigned CCH1 : 1;
5547 unsigned : 1;
5548 unsigned : 1;
5549 unsigned : 1;
5550 unsigned : 1;
5551 unsigned : 1;
5552 unsigned : 1;
5555 struct
5557 unsigned CCH : 2;
5558 unsigned : 6;
5561 struct
5563 unsigned C1CH : 2;
5564 unsigned : 6;
5567 struct
5569 unsigned : 3;
5570 unsigned EVPOL : 2;
5571 unsigned : 3;
5573 } __CM2CONbits_t;
5575 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
5577 #define _CM2CON_C1CH0 0x01
5578 #define _CM2CON_CCH0 0x01
5579 #define _CM2CON_C1CH1 0x02
5580 #define _CM2CON_CCH1 0x02
5581 #define _CM2CON_CREF 0x04
5582 #define _CM2CON_EVPOL0 0x08
5583 #define _CM2CON_EVPOL1 0x10
5584 #define _CM2CON_CPOL 0x20
5585 #define _CM2CON_COE 0x40
5586 #define _CM2CON_CON 0x80
5588 //==============================================================================
5591 //==============================================================================
5592 // CM2CON1 Bits
5594 extern __at(0x0FD1) __sfr CM2CON1;
5596 typedef union
5598 struct
5600 unsigned C1CH0 : 1;
5601 unsigned C1CH1 : 1;
5602 unsigned CREF : 1;
5603 unsigned EVPOL0 : 1;
5604 unsigned EVPOL1 : 1;
5605 unsigned CPOL : 1;
5606 unsigned COE : 1;
5607 unsigned CON : 1;
5610 struct
5612 unsigned CCH0 : 1;
5613 unsigned CCH1 : 1;
5614 unsigned : 1;
5615 unsigned : 1;
5616 unsigned : 1;
5617 unsigned : 1;
5618 unsigned : 1;
5619 unsigned : 1;
5622 struct
5624 unsigned CCH : 2;
5625 unsigned : 6;
5628 struct
5630 unsigned C1CH : 2;
5631 unsigned : 6;
5634 struct
5636 unsigned : 3;
5637 unsigned EVPOL : 2;
5638 unsigned : 3;
5640 } __CM2CON1bits_t;
5642 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
5644 #define _CM2CON1_C1CH0 0x01
5645 #define _CM2CON1_CCH0 0x01
5646 #define _CM2CON1_C1CH1 0x02
5647 #define _CM2CON1_CCH1 0x02
5648 #define _CM2CON1_CREF 0x04
5649 #define _CM2CON1_EVPOL0 0x08
5650 #define _CM2CON1_EVPOL1 0x10
5651 #define _CM2CON1_CPOL 0x20
5652 #define _CM2CON1_COE 0x40
5653 #define _CM2CON1_CON 0x80
5655 //==============================================================================
5658 //==============================================================================
5659 // CM1CON Bits
5661 extern __at(0x0FD2) __sfr CM1CON;
5663 typedef union
5665 struct
5667 unsigned C1CH0 : 1;
5668 unsigned C1CH1 : 1;
5669 unsigned CREF : 1;
5670 unsigned EVPOL0 : 1;
5671 unsigned EVPOL1 : 1;
5672 unsigned CPOL : 1;
5673 unsigned COE : 1;
5674 unsigned CON : 1;
5677 struct
5679 unsigned CCH0 : 1;
5680 unsigned CCH1 : 1;
5681 unsigned : 1;
5682 unsigned : 1;
5683 unsigned : 1;
5684 unsigned : 1;
5685 unsigned : 1;
5686 unsigned : 1;
5689 struct
5691 unsigned C1CH : 2;
5692 unsigned : 6;
5695 struct
5697 unsigned CCH : 2;
5698 unsigned : 6;
5701 struct
5703 unsigned : 3;
5704 unsigned EVPOL : 2;
5705 unsigned : 3;
5707 } __CM1CONbits_t;
5709 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
5711 #define _C1CH0 0x01
5712 #define _CCH0 0x01
5713 #define _C1CH1 0x02
5714 #define _CCH1 0x02
5715 #define _CREF 0x04
5716 #define _EVPOL0 0x08
5717 #define _EVPOL1 0x10
5718 #define _CPOL 0x20
5719 #define _COE 0x40
5720 #define _CON 0x80
5722 //==============================================================================
5725 //==============================================================================
5726 // CM1CON1 Bits
5728 extern __at(0x0FD2) __sfr CM1CON1;
5730 typedef union
5732 struct
5734 unsigned C1CH0 : 1;
5735 unsigned C1CH1 : 1;
5736 unsigned CREF : 1;
5737 unsigned EVPOL0 : 1;
5738 unsigned EVPOL1 : 1;
5739 unsigned CPOL : 1;
5740 unsigned COE : 1;
5741 unsigned CON : 1;
5744 struct
5746 unsigned CCH0 : 1;
5747 unsigned CCH1 : 1;
5748 unsigned : 1;
5749 unsigned : 1;
5750 unsigned : 1;
5751 unsigned : 1;
5752 unsigned : 1;
5753 unsigned : 1;
5756 struct
5758 unsigned CCH : 2;
5759 unsigned : 6;
5762 struct
5764 unsigned C1CH : 2;
5765 unsigned : 6;
5768 struct
5770 unsigned : 3;
5771 unsigned EVPOL : 2;
5772 unsigned : 3;
5774 } __CM1CON1bits_t;
5776 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
5778 #define _CM1CON1_C1CH0 0x01
5779 #define _CM1CON1_CCH0 0x01
5780 #define _CM1CON1_C1CH1 0x02
5781 #define _CM1CON1_CCH1 0x02
5782 #define _CM1CON1_CREF 0x04
5783 #define _CM1CON1_EVPOL0 0x08
5784 #define _CM1CON1_EVPOL1 0x10
5785 #define _CM1CON1_CPOL 0x20
5786 #define _CM1CON1_COE 0x40
5787 #define _CM1CON1_CON 0x80
5789 //==============================================================================
5792 //==============================================================================
5793 // OSCCON Bits
5795 extern __at(0x0FD3) __sfr OSCCON;
5797 typedef union
5799 struct
5801 unsigned SCS0 : 1;
5802 unsigned SCS1 : 1;
5803 unsigned : 1;
5804 unsigned OSTS : 1;
5805 unsigned IRCF0 : 1;
5806 unsigned IRCF1 : 1;
5807 unsigned IRCF2 : 1;
5808 unsigned IDLEN : 1;
5811 struct
5813 unsigned SCS : 2;
5814 unsigned : 6;
5817 struct
5819 unsigned : 4;
5820 unsigned IRCF : 3;
5821 unsigned : 1;
5823 } __OSCCONbits_t;
5825 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5827 #define _SCS0 0x01
5828 #define _SCS1 0x02
5829 #define _OSTS 0x08
5830 #define _IRCF0 0x10
5831 #define _IRCF1 0x20
5832 #define _IRCF2 0x40
5833 #define _IDLEN 0x80
5835 //==============================================================================
5838 //==============================================================================
5839 // REFOCON Bits
5841 extern __at(0x0FD3) __sfr REFOCON;
5843 typedef union
5845 struct
5847 unsigned RODIV0 : 1;
5848 unsigned RODIV1 : 1;
5849 unsigned RODIV2 : 1;
5850 unsigned RODIV3 : 1;
5851 unsigned ROSEL : 1;
5852 unsigned ROSSLP : 1;
5853 unsigned : 1;
5854 unsigned ROON : 1;
5857 struct
5859 unsigned RODIV : 4;
5860 unsigned : 4;
5862 } __REFOCONbits_t;
5864 extern __at(0x0FD3) volatile __REFOCONbits_t REFOCONbits;
5866 #define _RODIV0 0x01
5867 #define _RODIV1 0x02
5868 #define _RODIV2 0x04
5869 #define _RODIV3 0x08
5870 #define _ROSEL 0x10
5871 #define _ROSSLP 0x20
5872 #define _ROON 0x80
5874 //==============================================================================
5877 //==============================================================================
5878 // T0CON Bits
5880 extern __at(0x0FD5) __sfr T0CON;
5882 typedef union
5884 struct
5886 unsigned T0PS0 : 1;
5887 unsigned T0PS1 : 1;
5888 unsigned T0PS2 : 1;
5889 unsigned PSA : 1;
5890 unsigned T0SE : 1;
5891 unsigned T0CS : 1;
5892 unsigned T08BIT : 1;
5893 unsigned TMR0ON : 1;
5896 struct
5898 unsigned : 1;
5899 unsigned : 1;
5900 unsigned : 1;
5901 unsigned T0PS3 : 1;
5902 unsigned : 1;
5903 unsigned : 1;
5904 unsigned : 1;
5905 unsigned : 1;
5908 struct
5910 unsigned T0PS : 4;
5911 unsigned : 4;
5913 } __T0CONbits_t;
5915 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5917 #define _T0PS0 0x01
5918 #define _T0PS1 0x02
5919 #define _T0PS2 0x04
5920 #define _PSA 0x08
5921 #define _T0PS3 0x08
5922 #define _T0SE 0x10
5923 #define _T0CS 0x20
5924 #define _T08BIT 0x40
5925 #define _TMR0ON 0x80
5927 //==============================================================================
5929 extern __at(0x0FD6) __sfr TMR0;
5930 extern __at(0x0FD6) __sfr TMR0L;
5931 extern __at(0x0FD7) __sfr TMR0H;
5933 //==============================================================================
5934 // STATUS Bits
5936 extern __at(0x0FD8) __sfr STATUS;
5938 typedef struct
5940 unsigned C : 1;
5941 unsigned DC : 1;
5942 unsigned Z : 1;
5943 unsigned OV : 1;
5944 unsigned N : 1;
5945 unsigned : 1;
5946 unsigned : 1;
5947 unsigned : 1;
5948 } __STATUSbits_t;
5950 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5952 #define _C 0x01
5953 #define _DC 0x02
5954 #define _Z 0x04
5955 #define _OV 0x08
5956 #define _N 0x10
5958 //==============================================================================
5960 extern __at(0x0FD9) __sfr FSR2L;
5961 extern __at(0x0FDA) __sfr FSR2H;
5962 extern __at(0x0FDB) __sfr PLUSW2;
5963 extern __at(0x0FDC) __sfr PREINC2;
5964 extern __at(0x0FDD) __sfr POSTDEC2;
5965 extern __at(0x0FDE) __sfr POSTINC2;
5966 extern __at(0x0FDF) __sfr INDF2;
5967 extern __at(0x0FE0) __sfr BSR;
5968 extern __at(0x0FE1) __sfr FSR1L;
5969 extern __at(0x0FE2) __sfr FSR1H;
5970 extern __at(0x0FE3) __sfr PLUSW1;
5971 extern __at(0x0FE4) __sfr PREINC1;
5972 extern __at(0x0FE5) __sfr POSTDEC1;
5973 extern __at(0x0FE6) __sfr POSTINC1;
5974 extern __at(0x0FE7) __sfr INDF1;
5975 extern __at(0x0FE8) __sfr WREG;
5976 extern __at(0x0FE9) __sfr FSR0L;
5977 extern __at(0x0FEA) __sfr FSR0H;
5978 extern __at(0x0FEB) __sfr PLUSW0;
5979 extern __at(0x0FEC) __sfr PREINC0;
5980 extern __at(0x0FED) __sfr POSTDEC0;
5981 extern __at(0x0FEE) __sfr POSTINC0;
5982 extern __at(0x0FEF) __sfr INDF0;
5984 //==============================================================================
5985 // INTCON3 Bits
5987 extern __at(0x0FF0) __sfr INTCON3;
5989 typedef union
5991 struct
5993 unsigned INT1IF : 1;
5994 unsigned INT2IF : 1;
5995 unsigned INT3IF : 1;
5996 unsigned INT1IE : 1;
5997 unsigned INT2IE : 1;
5998 unsigned INT3IE : 1;
5999 unsigned INT1IP : 1;
6000 unsigned INT2IP : 1;
6003 struct
6005 unsigned INT1F : 1;
6006 unsigned INT2F : 1;
6007 unsigned INT3F : 1;
6008 unsigned INT1E : 1;
6009 unsigned INT2E : 1;
6010 unsigned INT3E : 1;
6011 unsigned INT1P : 1;
6012 unsigned INT2P : 1;
6014 } __INTCON3bits_t;
6016 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6018 #define _INT1IF 0x01
6019 #define _INT1F 0x01
6020 #define _INT2IF 0x02
6021 #define _INT2F 0x02
6022 #define _INT3IF 0x04
6023 #define _INT3F 0x04
6024 #define _INT1IE 0x08
6025 #define _INT1E 0x08
6026 #define _INT2IE 0x10
6027 #define _INT2E 0x10
6028 #define _INT3IE 0x20
6029 #define _INT3E 0x20
6030 #define _INT1IP 0x40
6031 #define _INT1P 0x40
6032 #define _INT2IP 0x80
6033 #define _INT2P 0x80
6035 //==============================================================================
6038 //==============================================================================
6039 // INTCON2 Bits
6041 extern __at(0x0FF1) __sfr INTCON2;
6043 typedef union
6045 struct
6047 unsigned RBIP : 1;
6048 unsigned INT3IP : 1;
6049 unsigned TMR0IP : 1;
6050 unsigned INTEDG3 : 1;
6051 unsigned INTEDG2 : 1;
6052 unsigned INTEDG1 : 1;
6053 unsigned INTEDG0 : 1;
6054 unsigned NOT_RBPU : 1;
6057 struct
6059 unsigned : 1;
6060 unsigned INT3P : 1;
6061 unsigned T0IP : 1;
6062 unsigned : 1;
6063 unsigned : 1;
6064 unsigned : 1;
6065 unsigned : 1;
6066 unsigned RBPU : 1;
6068 } __INTCON2bits_t;
6070 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6072 #define _RBIP 0x01
6073 #define _INT3IP 0x02
6074 #define _INT3P 0x02
6075 #define _TMR0IP 0x04
6076 #define _T0IP 0x04
6077 #define _INTEDG3 0x08
6078 #define _INTEDG2 0x10
6079 #define _INTEDG1 0x20
6080 #define _INTEDG0 0x40
6081 #define _NOT_RBPU 0x80
6082 #define _RBPU 0x80
6084 //==============================================================================
6087 //==============================================================================
6088 // INTCON Bits
6090 extern __at(0x0FF2) __sfr INTCON;
6092 typedef union
6094 struct
6096 unsigned RBIF : 1;
6097 unsigned INT0IF : 1;
6098 unsigned TMR0IF : 1;
6099 unsigned RBIE : 1;
6100 unsigned INT0IE : 1;
6101 unsigned TMR0IE : 1;
6102 unsigned PEIE_GIEL : 1;
6103 unsigned GIE_GIEH : 1;
6106 struct
6108 unsigned : 1;
6109 unsigned INT0F : 1;
6110 unsigned T0IF : 1;
6111 unsigned : 1;
6112 unsigned INT0E : 1;
6113 unsigned T0IE : 1;
6114 unsigned PEIE : 1;
6115 unsigned GIE : 1;
6118 struct
6120 unsigned : 1;
6121 unsigned : 1;
6122 unsigned : 1;
6123 unsigned : 1;
6124 unsigned : 1;
6125 unsigned : 1;
6126 unsigned GIEL : 1;
6127 unsigned GIEH : 1;
6129 } __INTCONbits_t;
6131 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6133 #define _RBIF 0x01
6134 #define _INT0IF 0x02
6135 #define _INT0F 0x02
6136 #define _TMR0IF 0x04
6137 #define _T0IF 0x04
6138 #define _RBIE 0x08
6139 #define _INT0IE 0x10
6140 #define _INT0E 0x10
6141 #define _TMR0IE 0x20
6142 #define _T0IE 0x20
6143 #define _PEIE_GIEL 0x40
6144 #define _PEIE 0x40
6145 #define _GIEL 0x40
6146 #define _GIE_GIEH 0x80
6147 #define _GIE 0x80
6148 #define _GIEH 0x80
6150 //==============================================================================
6152 extern __at(0x0FF3) __sfr PROD;
6153 extern __at(0x0FF3) __sfr PRODL;
6154 extern __at(0x0FF4) __sfr PRODH;
6155 extern __at(0x0FF5) __sfr TABLAT;
6156 extern __at(0x0FF6) __sfr TBLPTR;
6157 extern __at(0x0FF6) __sfr TBLPTRL;
6158 extern __at(0x0FF7) __sfr TBLPTRH;
6159 extern __at(0x0FF8) __sfr TBLPTRU;
6160 extern __at(0x0FF9) __sfr PC;
6161 extern __at(0x0FF9) __sfr PCL;
6162 extern __at(0x0FFA) __sfr PCLATH;
6163 extern __at(0x0FFB) __sfr PCLATU;
6165 //==============================================================================
6166 // STKPTR Bits
6168 extern __at(0x0FFC) __sfr STKPTR;
6170 typedef union
6172 struct
6174 unsigned STKPTR0 : 1;
6175 unsigned STKPTR1 : 1;
6176 unsigned STKPTR2 : 1;
6177 unsigned STKPTR3 : 1;
6178 unsigned STKPTR4 : 1;
6179 unsigned : 1;
6180 unsigned STKUNF : 1;
6181 unsigned STKFUL : 1;
6184 struct
6186 unsigned SP0 : 1;
6187 unsigned SP1 : 1;
6188 unsigned SP2 : 1;
6189 unsigned SP3 : 1;
6190 unsigned SP4 : 1;
6191 unsigned : 1;
6192 unsigned : 1;
6193 unsigned STKOVF : 1;
6196 struct
6198 unsigned SP : 5;
6199 unsigned : 3;
6202 struct
6204 unsigned STKPTR : 5;
6205 unsigned : 3;
6207 } __STKPTRbits_t;
6209 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6211 #define _STKPTR0 0x01
6212 #define _SP0 0x01
6213 #define _STKPTR1 0x02
6214 #define _SP1 0x02
6215 #define _STKPTR2 0x04
6216 #define _SP2 0x04
6217 #define _STKPTR3 0x08
6218 #define _SP3 0x08
6219 #define _STKPTR4 0x10
6220 #define _SP4 0x10
6221 #define _STKUNF 0x40
6222 #define _STKFUL 0x80
6223 #define _STKOVF 0x80
6225 //==============================================================================
6227 extern __at(0x0FFD) __sfr TOS;
6228 extern __at(0x0FFD) __sfr TOSL;
6229 extern __at(0x0FFE) __sfr TOSH;
6230 extern __at(0x0FFF) __sfr TOSU;
6232 //==============================================================================
6234 // Configuration Addresses
6236 //==============================================================================
6238 #define __CONFIG1L 0x017FF8
6239 #define __CONFIG1H 0x017FF9
6240 #define __CONFIG2L 0x017FFA
6241 #define __CONFIG2H 0x017FFB
6242 #define __CONFIG3L 0x017FFC
6243 #define __CONFIG3H 0x017FFD
6245 //==============================================================================
6247 #endif // #ifndef __PIC18F66J16_H__