struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f86j16.h
blob6847b3b46634f368f21c165266fb1b191d30e783
1 /*
2 * This declarations of the PIC18F86J16 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:37 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 __PIC18F86J16_H__
26 #define __PIC18F86J16_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 PMD5 : 1;
1141 unsigned PMD4 : 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_PMD5 0x10
1162 #define _PORTA_RA5 0x20
1163 #define _PORTA_AN4 0x20
1164 #define _PORTA_PMD4 0x20
1165 #define _PORTA_RA6 0x40
1166 #define _PORTA_OSC2 0x40
1167 #define _PORTA_CLKO 0x40
1168 #define _PORTA_RA7 0x80
1170 //==============================================================================
1173 //==============================================================================
1174 // PORTB Bits
1176 extern __at(0x0F81) __sfr PORTB;
1178 typedef union
1180 struct
1182 unsigned RB0 : 1;
1183 unsigned RB1 : 1;
1184 unsigned RB2 : 1;
1185 unsigned RB3 : 1;
1186 unsigned RB4 : 1;
1187 unsigned RB5 : 1;
1188 unsigned RB6 : 1;
1189 unsigned RB7 : 1;
1192 struct
1194 unsigned INT0 : 1;
1195 unsigned INT1 : 1;
1196 unsigned INT2 : 1;
1197 unsigned INT3 : 1;
1198 unsigned KBI0 : 1;
1199 unsigned KBI1 : 1;
1200 unsigned KBI2 : 1;
1201 unsigned KBI3 : 1;
1204 struct
1206 unsigned FLT0 : 1;
1207 unsigned PMA4 : 1;
1208 unsigned PMA3 : 1;
1209 unsigned PMA2 : 1;
1210 unsigned PMA1 : 1;
1211 unsigned PMA0 : 1;
1212 unsigned PGC : 1;
1213 unsigned PGD : 1;
1216 struct
1218 unsigned : 1;
1219 unsigned : 1;
1220 unsigned : 1;
1221 unsigned CCP2 : 1;
1222 unsigned : 1;
1223 unsigned : 1;
1224 unsigned : 1;
1225 unsigned : 1;
1228 struct
1230 unsigned INT : 4;
1231 unsigned : 4;
1234 struct
1236 unsigned : 4;
1237 unsigned KBI : 4;
1239 } __PORTBbits_t;
1241 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1243 #define _PORTB_RB0 0x01
1244 #define _PORTB_INT0 0x01
1245 #define _PORTB_FLT0 0x01
1246 #define _PORTB_RB1 0x02
1247 #define _PORTB_INT1 0x02
1248 #define _PORTB_PMA4 0x02
1249 #define _PORTB_RB2 0x04
1250 #define _PORTB_INT2 0x04
1251 #define _PORTB_PMA3 0x04
1252 #define _PORTB_RB3 0x08
1253 #define _PORTB_INT3 0x08
1254 #define _PORTB_PMA2 0x08
1255 #define _PORTB_CCP2 0x08
1256 #define _PORTB_RB4 0x10
1257 #define _PORTB_KBI0 0x10
1258 #define _PORTB_PMA1 0x10
1259 #define _PORTB_RB5 0x20
1260 #define _PORTB_KBI1 0x20
1261 #define _PORTB_PMA0 0x20
1262 #define _PORTB_RB6 0x40
1263 #define _PORTB_KBI2 0x40
1264 #define _PORTB_PGC 0x40
1265 #define _PORTB_RB7 0x80
1266 #define _PORTB_KBI3 0x80
1267 #define _PORTB_PGD 0x80
1269 //==============================================================================
1272 //==============================================================================
1273 // PORTC Bits
1275 extern __at(0x0F82) __sfr PORTC;
1277 typedef union
1279 struct
1281 unsigned RC0 : 1;
1282 unsigned RC1 : 1;
1283 unsigned RC2 : 1;
1284 unsigned RC3 : 1;
1285 unsigned RC4 : 1;
1286 unsigned RC5 : 1;
1287 unsigned RC6 : 1;
1288 unsigned RC7 : 1;
1291 struct
1293 unsigned T1OSO : 1;
1294 unsigned T1OSI : 1;
1295 unsigned CCP1 : 1;
1296 unsigned SCK : 1;
1297 unsigned SDI : 1;
1298 unsigned SDO : 1;
1299 unsigned TX : 1;
1300 unsigned RX : 1;
1303 struct
1305 unsigned T13CKI : 1;
1306 unsigned CCP2 : 1;
1307 unsigned : 1;
1308 unsigned SCL : 1;
1309 unsigned SDA : 1;
1310 unsigned : 1;
1311 unsigned CK : 1;
1312 unsigned : 1;
1314 } __PORTCbits_t;
1316 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1318 #define _PORTC_RC0 0x01
1319 #define _PORTC_T1OSO 0x01
1320 #define _PORTC_T13CKI 0x01
1321 #define _PORTC_RC1 0x02
1322 #define _PORTC_T1OSI 0x02
1323 #define _PORTC_CCP2 0x02
1324 #define _PORTC_RC2 0x04
1325 #define _PORTC_CCP1 0x04
1326 #define _PORTC_RC3 0x08
1327 #define _PORTC_SCK 0x08
1328 #define _PORTC_SCL 0x08
1329 #define _PORTC_RC4 0x10
1330 #define _PORTC_SDI 0x10
1331 #define _PORTC_SDA 0x10
1332 #define _PORTC_RC5 0x20
1333 #define _PORTC_SDO 0x20
1334 #define _PORTC_RC6 0x40
1335 #define _PORTC_TX 0x40
1336 #define _PORTC_CK 0x40
1337 #define _PORTC_RC7 0x80
1338 #define _PORTC_RX 0x80
1340 //==============================================================================
1343 //==============================================================================
1344 // PORTD Bits
1346 extern __at(0x0F83) __sfr PORTD;
1348 typedef union
1350 struct
1352 unsigned RD0 : 1;
1353 unsigned RD1 : 1;
1354 unsigned RD2 : 1;
1355 unsigned RD3 : 1;
1356 unsigned RD4 : 1;
1357 unsigned RD5 : 1;
1358 unsigned RD6 : 1;
1359 unsigned RD7 : 1;
1362 struct
1364 unsigned PMD0 : 1;
1365 unsigned PMD1 : 1;
1366 unsigned PMD2 : 1;
1367 unsigned PMD3 : 1;
1368 unsigned PMD4 : 1;
1369 unsigned PMD5 : 1;
1370 unsigned PMD6 : 1;
1371 unsigned PMD7 : 1;
1374 struct
1376 unsigned AD0 : 1;
1377 unsigned AD1 : 1;
1378 unsigned AD2 : 1;
1379 unsigned AD3 : 1;
1380 unsigned AD4 : 1;
1381 unsigned AD5 : 1;
1382 unsigned AD6 : 1;
1383 unsigned AD7 : 1;
1386 struct
1388 unsigned : 1;
1389 unsigned : 1;
1390 unsigned : 1;
1391 unsigned : 1;
1392 unsigned SDO2 : 1;
1393 unsigned SDA2 : 1;
1394 unsigned SCL2 : 1;
1395 unsigned SS2 : 1;
1398 struct
1400 unsigned : 1;
1401 unsigned : 1;
1402 unsigned : 1;
1403 unsigned : 1;
1404 unsigned : 1;
1405 unsigned SDI2 : 1;
1406 unsigned SCK2 : 1;
1407 unsigned : 1;
1409 } __PORTDbits_t;
1411 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1413 #define _PORTD_RD0 0x01
1414 #define _PORTD_PMD0 0x01
1415 #define _PORTD_AD0 0x01
1416 #define _PORTD_RD1 0x02
1417 #define _PORTD_PMD1 0x02
1418 #define _PORTD_AD1 0x02
1419 #define _PORTD_RD2 0x04
1420 #define _PORTD_PMD2 0x04
1421 #define _PORTD_AD2 0x04
1422 #define _PORTD_RD3 0x08
1423 #define _PORTD_PMD3 0x08
1424 #define _PORTD_AD3 0x08
1425 #define _PORTD_RD4 0x10
1426 #define _PORTD_PMD4 0x10
1427 #define _PORTD_AD4 0x10
1428 #define _PORTD_SDO2 0x10
1429 #define _PORTD_RD5 0x20
1430 #define _PORTD_PMD5 0x20
1431 #define _PORTD_AD5 0x20
1432 #define _PORTD_SDA2 0x20
1433 #define _PORTD_SDI2 0x20
1434 #define _PORTD_RD6 0x40
1435 #define _PORTD_PMD6 0x40
1436 #define _PORTD_AD6 0x40
1437 #define _PORTD_SCL2 0x40
1438 #define _PORTD_SCK2 0x40
1439 #define _PORTD_RD7 0x80
1440 #define _PORTD_PMD7 0x80
1441 #define _PORTD_AD7 0x80
1442 #define _PORTD_SS2 0x80
1444 //==============================================================================
1447 //==============================================================================
1448 // PORTE Bits
1450 extern __at(0x0F84) __sfr PORTE;
1452 typedef union
1454 struct
1456 unsigned RE0 : 1;
1457 unsigned RE1 : 1;
1458 unsigned RE2 : 1;
1459 unsigned RE3 : 1;
1460 unsigned RE4 : 1;
1461 unsigned RE5 : 1;
1462 unsigned RE6 : 1;
1463 unsigned RE7 : 1;
1466 struct
1468 unsigned AD8 : 1;
1469 unsigned AD9 : 1;
1470 unsigned AD10 : 1;
1471 unsigned AD11 : 1;
1472 unsigned AD12 : 1;
1473 unsigned AD13 : 1;
1474 unsigned AD14 : 1;
1475 unsigned AD15 : 1;
1478 struct
1480 unsigned PMRD : 1;
1481 unsigned PMWR : 1;
1482 unsigned PMBE : 1;
1483 unsigned PMA13 : 1;
1484 unsigned PMA12 : 1;
1485 unsigned PMA11 : 1;
1486 unsigned PMA10 : 1;
1487 unsigned PMA9 : 1;
1490 struct
1492 unsigned : 1;
1493 unsigned : 1;
1494 unsigned : 1;
1495 unsigned REFO : 1;
1496 unsigned : 1;
1497 unsigned : 1;
1498 unsigned : 1;
1499 unsigned CCP2 : 1;
1501 } __PORTEbits_t;
1503 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1505 #define _PORTE_RE0 0x01
1506 #define _PORTE_AD8 0x01
1507 #define _PORTE_PMRD 0x01
1508 #define _PORTE_RE1 0x02
1509 #define _PORTE_AD9 0x02
1510 #define _PORTE_PMWR 0x02
1511 #define _PORTE_RE2 0x04
1512 #define _PORTE_AD10 0x04
1513 #define _PORTE_PMBE 0x04
1514 #define _PORTE_RE3 0x08
1515 #define _PORTE_AD11 0x08
1516 #define _PORTE_PMA13 0x08
1517 #define _PORTE_REFO 0x08
1518 #define _PORTE_RE4 0x10
1519 #define _PORTE_AD12 0x10
1520 #define _PORTE_PMA12 0x10
1521 #define _PORTE_RE5 0x20
1522 #define _PORTE_AD13 0x20
1523 #define _PORTE_PMA11 0x20
1524 #define _PORTE_RE6 0x40
1525 #define _PORTE_AD14 0x40
1526 #define _PORTE_PMA10 0x40
1527 #define _PORTE_RE7 0x80
1528 #define _PORTE_AD15 0x80
1529 #define _PORTE_PMA9 0x80
1530 #define _PORTE_CCP2 0x80
1532 //==============================================================================
1535 //==============================================================================
1536 // PORTF Bits
1538 extern __at(0x0F85) __sfr PORTF;
1540 typedef union
1542 struct
1544 unsigned : 1;
1545 unsigned RF1 : 1;
1546 unsigned RF2 : 1;
1547 unsigned RF3 : 1;
1548 unsigned RF4 : 1;
1549 unsigned RF5 : 1;
1550 unsigned RF6 : 1;
1551 unsigned RF7 : 1;
1554 struct
1556 unsigned : 1;
1557 unsigned AN6 : 1;
1558 unsigned AN7 : 1;
1559 unsigned AN8 : 1;
1560 unsigned AN9 : 1;
1561 unsigned AN10 : 1;
1562 unsigned AN11 : 1;
1563 unsigned SS : 1;
1566 struct
1568 unsigned : 1;
1569 unsigned C2OUT : 1;
1570 unsigned C1OUT : 1;
1571 unsigned C2INB : 1;
1572 unsigned C2INA : 1;
1573 unsigned CVREF : 1;
1574 unsigned C1INA : 1;
1575 unsigned PMD0 : 1;
1578 struct
1580 unsigned : 1;
1581 unsigned : 1;
1582 unsigned PMA5 : 1;
1583 unsigned : 1;
1584 unsigned : 1;
1585 unsigned C1INB : 1;
1586 unsigned PMD1 : 1;
1587 unsigned : 1;
1590 struct
1592 unsigned : 1;
1593 unsigned : 1;
1594 unsigned : 1;
1595 unsigned : 1;
1596 unsigned : 1;
1597 unsigned PMD2 : 1;
1598 unsigned : 1;
1599 unsigned : 1;
1601 } __PORTFbits_t;
1603 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
1605 #define _PORTF_RF1 0x02
1606 #define _PORTF_AN6 0x02
1607 #define _PORTF_C2OUT 0x02
1608 #define _PORTF_RF2 0x04
1609 #define _PORTF_AN7 0x04
1610 #define _PORTF_C1OUT 0x04
1611 #define _PORTF_PMA5 0x04
1612 #define _PORTF_RF3 0x08
1613 #define _PORTF_AN8 0x08
1614 #define _PORTF_C2INB 0x08
1615 #define _PORTF_RF4 0x10
1616 #define _PORTF_AN9 0x10
1617 #define _PORTF_C2INA 0x10
1618 #define _PORTF_RF5 0x20
1619 #define _PORTF_AN10 0x20
1620 #define _PORTF_CVREF 0x20
1621 #define _PORTF_C1INB 0x20
1622 #define _PORTF_PMD2 0x20
1623 #define _PORTF_RF6 0x40
1624 #define _PORTF_AN11 0x40
1625 #define _PORTF_C1INA 0x40
1626 #define _PORTF_PMD1 0x40
1627 #define _PORTF_RF7 0x80
1628 #define _PORTF_SS 0x80
1629 #define _PORTF_PMD0 0x80
1631 //==============================================================================
1634 //==============================================================================
1635 // PORTG Bits
1637 extern __at(0x0F86) __sfr PORTG;
1639 typedef union
1641 struct
1643 unsigned RG0 : 1;
1644 unsigned RG1 : 1;
1645 unsigned RG2 : 1;
1646 unsigned RG3 : 1;
1647 unsigned RG4 : 1;
1648 unsigned RJPU : 1;
1649 unsigned REPU : 1;
1650 unsigned RDPU : 1;
1653 struct
1655 unsigned CCP3 : 1;
1656 unsigned TX2 : 1;
1657 unsigned RX2 : 1;
1658 unsigned CCP4 : 1;
1659 unsigned CCP5 : 1;
1660 unsigned : 1;
1661 unsigned : 1;
1662 unsigned : 1;
1665 struct
1667 unsigned PMA8 : 1;
1668 unsigned CK2 : 1;
1669 unsigned DT2 : 1;
1670 unsigned PMCS1 : 1;
1671 unsigned PMCS2 : 1;
1672 unsigned : 1;
1673 unsigned : 1;
1674 unsigned : 1;
1677 struct
1679 unsigned : 1;
1680 unsigned PMA7 : 1;
1681 unsigned PMA6 : 1;
1682 unsigned : 1;
1683 unsigned : 1;
1684 unsigned : 1;
1685 unsigned : 1;
1686 unsigned : 1;
1689 struct
1691 unsigned RG : 5;
1692 unsigned : 3;
1694 } __PORTGbits_t;
1696 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
1698 #define _PORTG_RG0 0x01
1699 #define _PORTG_CCP3 0x01
1700 #define _PORTG_PMA8 0x01
1701 #define _PORTG_RG1 0x02
1702 #define _PORTG_TX2 0x02
1703 #define _PORTG_CK2 0x02
1704 #define _PORTG_PMA7 0x02
1705 #define _PORTG_RG2 0x04
1706 #define _PORTG_RX2 0x04
1707 #define _PORTG_DT2 0x04
1708 #define _PORTG_PMA6 0x04
1709 #define _PORTG_RG3 0x08
1710 #define _PORTG_CCP4 0x08
1711 #define _PORTG_PMCS1 0x08
1712 #define _PORTG_RG4 0x10
1713 #define _PORTG_CCP5 0x10
1714 #define _PORTG_PMCS2 0x10
1715 #define _PORTG_RJPU 0x20
1716 #define _PORTG_REPU 0x40
1717 #define _PORTG_RDPU 0x80
1719 //==============================================================================
1722 //==============================================================================
1723 // PORTH Bits
1725 extern __at(0x0F87) __sfr PORTH;
1727 typedef union
1729 struct
1731 unsigned RH0 : 1;
1732 unsigned RH1 : 1;
1733 unsigned RH2 : 1;
1734 unsigned RH3 : 1;
1735 unsigned RH4 : 1;
1736 unsigned RH5 : 1;
1737 unsigned RH6 : 1;
1738 unsigned RH7 : 1;
1741 struct
1743 unsigned A16 : 1;
1744 unsigned A17 : 1;
1745 unsigned A18 : 1;
1746 unsigned A19 : 1;
1747 unsigned AN12 : 1;
1748 unsigned AN13 : 1;
1749 unsigned AN14 : 1;
1750 unsigned AN15 : 1;
1753 struct
1755 unsigned : 1;
1756 unsigned : 1;
1757 unsigned PMD7 : 1;
1758 unsigned PMD6 : 1;
1759 unsigned PMD3 : 1;
1760 unsigned PMBE : 1;
1761 unsigned PMRD : 1;
1762 unsigned PMWR : 1;
1765 struct
1767 unsigned : 1;
1768 unsigned : 1;
1769 unsigned : 1;
1770 unsigned : 1;
1771 unsigned C2INC : 1;
1772 unsigned C2IND : 1;
1773 unsigned C1INC : 1;
1774 unsigned : 1;
1776 } __PORTHbits_t;
1778 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
1780 #define _PORTH_RH0 0x01
1781 #define _PORTH_A16 0x01
1782 #define _PORTH_RH1 0x02
1783 #define _PORTH_A17 0x02
1784 #define _PORTH_RH2 0x04
1785 #define _PORTH_A18 0x04
1786 #define _PORTH_PMD7 0x04
1787 #define _PORTH_RH3 0x08
1788 #define _PORTH_A19 0x08
1789 #define _PORTH_PMD6 0x08
1790 #define _PORTH_RH4 0x10
1791 #define _PORTH_AN12 0x10
1792 #define _PORTH_PMD3 0x10
1793 #define _PORTH_C2INC 0x10
1794 #define _PORTH_RH5 0x20
1795 #define _PORTH_AN13 0x20
1796 #define _PORTH_PMBE 0x20
1797 #define _PORTH_C2IND 0x20
1798 #define _PORTH_RH6 0x40
1799 #define _PORTH_AN14 0x40
1800 #define _PORTH_PMRD 0x40
1801 #define _PORTH_C1INC 0x40
1802 #define _PORTH_RH7 0x80
1803 #define _PORTH_AN15 0x80
1804 #define _PORTH_PMWR 0x80
1806 //==============================================================================
1809 //==============================================================================
1810 // PORTJ Bits
1812 extern __at(0x0F88) __sfr PORTJ;
1814 typedef union
1816 struct
1818 unsigned RJ0 : 1;
1819 unsigned RJ1 : 1;
1820 unsigned RJ2 : 1;
1821 unsigned RJ3 : 1;
1822 unsigned RJ4 : 1;
1823 unsigned RJ5 : 1;
1824 unsigned RJ6 : 1;
1825 unsigned RJ7 : 1;
1828 struct
1830 unsigned ALE : 1;
1831 unsigned OE : 1;
1832 unsigned WRL : 1;
1833 unsigned WRH : 1;
1834 unsigned BA0 : 1;
1835 unsigned CE : 1;
1836 unsigned LB : 1;
1837 unsigned UB : 1;
1839 } __PORTJbits_t;
1841 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
1843 #define _PORTJ_RJ0 0x01
1844 #define _PORTJ_ALE 0x01
1845 #define _PORTJ_RJ1 0x02
1846 #define _PORTJ_OE 0x02
1847 #define _PORTJ_RJ2 0x04
1848 #define _PORTJ_WRL 0x04
1849 #define _PORTJ_RJ3 0x08
1850 #define _PORTJ_WRH 0x08
1851 #define _PORTJ_RJ4 0x10
1852 #define _PORTJ_BA0 0x10
1853 #define _PORTJ_RJ5 0x20
1854 #define _PORTJ_CE 0x20
1855 #define _PORTJ_RJ6 0x40
1856 #define _PORTJ_LB 0x40
1857 #define _PORTJ_RJ7 0x80
1858 #define _PORTJ_UB 0x80
1860 //==============================================================================
1863 //==============================================================================
1864 // LATA Bits
1866 extern __at(0x0F89) __sfr LATA;
1868 typedef struct
1870 unsigned LATA0 : 1;
1871 unsigned LATA1 : 1;
1872 unsigned LATA2 : 1;
1873 unsigned LATA3 : 1;
1874 unsigned LATA4 : 1;
1875 unsigned LATA5 : 1;
1876 unsigned LATA6 : 1;
1877 unsigned LATA7 : 1;
1878 } __LATAbits_t;
1880 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1882 #define _LATA0 0x01
1883 #define _LATA1 0x02
1884 #define _LATA2 0x04
1885 #define _LATA3 0x08
1886 #define _LATA4 0x10
1887 #define _LATA5 0x20
1888 #define _LATA6 0x40
1889 #define _LATA7 0x80
1891 //==============================================================================
1894 //==============================================================================
1895 // LATB Bits
1897 extern __at(0x0F8A) __sfr LATB;
1899 typedef struct
1901 unsigned LATB0 : 1;
1902 unsigned LATB1 : 1;
1903 unsigned LATB2 : 1;
1904 unsigned LATB3 : 1;
1905 unsigned LATB4 : 1;
1906 unsigned LATB5 : 1;
1907 unsigned LATB6 : 1;
1908 unsigned LATB7 : 1;
1909 } __LATBbits_t;
1911 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1913 #define _LATB0 0x01
1914 #define _LATB1 0x02
1915 #define _LATB2 0x04
1916 #define _LATB3 0x08
1917 #define _LATB4 0x10
1918 #define _LATB5 0x20
1919 #define _LATB6 0x40
1920 #define _LATB7 0x80
1922 //==============================================================================
1925 //==============================================================================
1926 // LATC Bits
1928 extern __at(0x0F8B) __sfr LATC;
1930 typedef struct
1932 unsigned LATC0 : 1;
1933 unsigned LATC1 : 1;
1934 unsigned LATC2 : 1;
1935 unsigned LATC3 : 1;
1936 unsigned LATC4 : 1;
1937 unsigned LATC5 : 1;
1938 unsigned LATC6 : 1;
1939 unsigned LATC7 : 1;
1940 } __LATCbits_t;
1942 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1944 #define _LATC0 0x01
1945 #define _LATC1 0x02
1946 #define _LATC2 0x04
1947 #define _LATC3 0x08
1948 #define _LATC4 0x10
1949 #define _LATC5 0x20
1950 #define _LATC6 0x40
1951 #define _LATC7 0x80
1953 //==============================================================================
1956 //==============================================================================
1957 // LATD Bits
1959 extern __at(0x0F8C) __sfr LATD;
1961 typedef struct
1963 unsigned LATD0 : 1;
1964 unsigned LATD1 : 1;
1965 unsigned LATD2 : 1;
1966 unsigned LATD3 : 1;
1967 unsigned LATD4 : 1;
1968 unsigned LATD5 : 1;
1969 unsigned LATD6 : 1;
1970 unsigned LATD7 : 1;
1971 } __LATDbits_t;
1973 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1975 #define _LATD0 0x01
1976 #define _LATD1 0x02
1977 #define _LATD2 0x04
1978 #define _LATD3 0x08
1979 #define _LATD4 0x10
1980 #define _LATD5 0x20
1981 #define _LATD6 0x40
1982 #define _LATD7 0x80
1984 //==============================================================================
1987 //==============================================================================
1988 // LATE Bits
1990 extern __at(0x0F8D) __sfr LATE;
1992 typedef struct
1994 unsigned LATE0 : 1;
1995 unsigned LATE1 : 1;
1996 unsigned LATE2 : 1;
1997 unsigned LATE3 : 1;
1998 unsigned LATE4 : 1;
1999 unsigned LATE5 : 1;
2000 unsigned LATE6 : 1;
2001 unsigned LATE7 : 1;
2002 } __LATEbits_t;
2004 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2006 #define _LATE0 0x01
2007 #define _LATE1 0x02
2008 #define _LATE2 0x04
2009 #define _LATE3 0x08
2010 #define _LATE4 0x10
2011 #define _LATE5 0x20
2012 #define _LATE6 0x40
2013 #define _LATE7 0x80
2015 //==============================================================================
2018 //==============================================================================
2019 // LATF Bits
2021 extern __at(0x0F8E) __sfr LATF;
2023 typedef struct
2025 unsigned : 1;
2026 unsigned LATF1 : 1;
2027 unsigned LATF2 : 1;
2028 unsigned LATF3 : 1;
2029 unsigned LATF4 : 1;
2030 unsigned LATF5 : 1;
2031 unsigned LATF6 : 1;
2032 unsigned LATF7 : 1;
2033 } __LATFbits_t;
2035 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
2037 #define _LATF1 0x02
2038 #define _LATF2 0x04
2039 #define _LATF3 0x08
2040 #define _LATF4 0x10
2041 #define _LATF5 0x20
2042 #define _LATF6 0x40
2043 #define _LATF7 0x80
2045 //==============================================================================
2048 //==============================================================================
2049 // LATG Bits
2051 extern __at(0x0F8F) __sfr LATG;
2053 typedef union
2055 struct
2057 unsigned LATG0 : 1;
2058 unsigned LATG1 : 1;
2059 unsigned LATG2 : 1;
2060 unsigned LATG3 : 1;
2061 unsigned LATG4 : 1;
2062 unsigned : 1;
2063 unsigned : 1;
2064 unsigned : 1;
2067 struct
2069 unsigned LATG : 5;
2070 unsigned : 3;
2072 } __LATGbits_t;
2074 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2076 #define _LATG0 0x01
2077 #define _LATG1 0x02
2078 #define _LATG2 0x04
2079 #define _LATG3 0x08
2080 #define _LATG4 0x10
2082 //==============================================================================
2085 //==============================================================================
2086 // LATH Bits
2088 extern __at(0x0F90) __sfr LATH;
2090 typedef struct
2092 unsigned LATH0 : 1;
2093 unsigned LATH1 : 1;
2094 unsigned LATH2 : 1;
2095 unsigned LATH3 : 1;
2096 unsigned LATH4 : 1;
2097 unsigned LATH5 : 1;
2098 unsigned LATH6 : 1;
2099 unsigned LATH7 : 1;
2100 } __LATHbits_t;
2102 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
2104 #define _LATH0 0x01
2105 #define _LATH1 0x02
2106 #define _LATH2 0x04
2107 #define _LATH3 0x08
2108 #define _LATH4 0x10
2109 #define _LATH5 0x20
2110 #define _LATH6 0x40
2111 #define _LATH7 0x80
2113 //==============================================================================
2116 //==============================================================================
2117 // LATJ Bits
2119 extern __at(0x0F91) __sfr LATJ;
2121 typedef struct
2123 unsigned LATJ0 : 1;
2124 unsigned LATJ1 : 1;
2125 unsigned LATJ2 : 1;
2126 unsigned LATJ3 : 1;
2127 unsigned LATJ4 : 1;
2128 unsigned LATJ5 : 1;
2129 unsigned LATJ6 : 1;
2130 unsigned LATJ7 : 1;
2131 } __LATJbits_t;
2133 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
2135 #define _LATJ0 0x01
2136 #define _LATJ1 0x02
2137 #define _LATJ2 0x04
2138 #define _LATJ3 0x08
2139 #define _LATJ4 0x10
2140 #define _LATJ5 0x20
2141 #define _LATJ6 0x40
2142 #define _LATJ7 0x80
2144 //==============================================================================
2147 //==============================================================================
2148 // DDRA Bits
2150 extern __at(0x0F92) __sfr DDRA;
2152 typedef union
2154 struct
2156 unsigned TRISA0 : 1;
2157 unsigned TRISA1 : 1;
2158 unsigned TRISA2 : 1;
2159 unsigned TRISA3 : 1;
2160 unsigned TRISA4 : 1;
2161 unsigned TRISA5 : 1;
2162 unsigned TRISA6 : 1;
2163 unsigned TRISA7 : 1;
2166 struct
2168 unsigned RA0 : 1;
2169 unsigned RA1 : 1;
2170 unsigned RA2 : 1;
2171 unsigned RA3 : 1;
2172 unsigned RA4 : 1;
2173 unsigned RA5 : 1;
2174 unsigned RA6 : 1;
2175 unsigned RA7 : 1;
2177 } __DDRAbits_t;
2179 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2181 #define _TRISA0 0x01
2182 #define _RA0 0x01
2183 #define _TRISA1 0x02
2184 #define _RA1 0x02
2185 #define _TRISA2 0x04
2186 #define _RA2 0x04
2187 #define _TRISA3 0x08
2188 #define _RA3 0x08
2189 #define _TRISA4 0x10
2190 #define _RA4 0x10
2191 #define _TRISA5 0x20
2192 #define _RA5 0x20
2193 #define _TRISA6 0x40
2194 #define _RA6 0x40
2195 #define _TRISA7 0x80
2196 #define _RA7 0x80
2198 //==============================================================================
2201 //==============================================================================
2202 // TRISA Bits
2204 extern __at(0x0F92) __sfr TRISA;
2206 typedef union
2208 struct
2210 unsigned TRISA0 : 1;
2211 unsigned TRISA1 : 1;
2212 unsigned TRISA2 : 1;
2213 unsigned TRISA3 : 1;
2214 unsigned TRISA4 : 1;
2215 unsigned TRISA5 : 1;
2216 unsigned TRISA6 : 1;
2217 unsigned TRISA7 : 1;
2220 struct
2222 unsigned RA0 : 1;
2223 unsigned RA1 : 1;
2224 unsigned RA2 : 1;
2225 unsigned RA3 : 1;
2226 unsigned RA4 : 1;
2227 unsigned RA5 : 1;
2228 unsigned RA6 : 1;
2229 unsigned RA7 : 1;
2231 } __TRISAbits_t;
2233 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2235 #define _TRISA_TRISA0 0x01
2236 #define _TRISA_RA0 0x01
2237 #define _TRISA_TRISA1 0x02
2238 #define _TRISA_RA1 0x02
2239 #define _TRISA_TRISA2 0x04
2240 #define _TRISA_RA2 0x04
2241 #define _TRISA_TRISA3 0x08
2242 #define _TRISA_RA3 0x08
2243 #define _TRISA_TRISA4 0x10
2244 #define _TRISA_RA4 0x10
2245 #define _TRISA_TRISA5 0x20
2246 #define _TRISA_RA5 0x20
2247 #define _TRISA_TRISA6 0x40
2248 #define _TRISA_RA6 0x40
2249 #define _TRISA_TRISA7 0x80
2250 #define _TRISA_RA7 0x80
2252 //==============================================================================
2255 //==============================================================================
2256 // DDRB Bits
2258 extern __at(0x0F93) __sfr DDRB;
2260 typedef union
2262 struct
2264 unsigned TRISB0 : 1;
2265 unsigned TRISB1 : 1;
2266 unsigned TRISB2 : 1;
2267 unsigned TRISB3 : 1;
2268 unsigned TRISB4 : 1;
2269 unsigned TRISB5 : 1;
2270 unsigned TRISB6 : 1;
2271 unsigned TRISB7 : 1;
2274 struct
2276 unsigned RB0 : 1;
2277 unsigned RB1 : 1;
2278 unsigned RB2 : 1;
2279 unsigned RB3 : 1;
2280 unsigned RB4 : 1;
2281 unsigned RB5 : 1;
2282 unsigned RB6 : 1;
2283 unsigned RB7 : 1;
2285 } __DDRBbits_t;
2287 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2289 #define _TRISB0 0x01
2290 #define _RB0 0x01
2291 #define _TRISB1 0x02
2292 #define _RB1 0x02
2293 #define _TRISB2 0x04
2294 #define _RB2 0x04
2295 #define _TRISB3 0x08
2296 #define _RB3 0x08
2297 #define _TRISB4 0x10
2298 #define _RB4 0x10
2299 #define _TRISB5 0x20
2300 #define _RB5 0x20
2301 #define _TRISB6 0x40
2302 #define _RB6 0x40
2303 #define _TRISB7 0x80
2304 #define _RB7 0x80
2306 //==============================================================================
2309 //==============================================================================
2310 // TRISB Bits
2312 extern __at(0x0F93) __sfr TRISB;
2314 typedef union
2316 struct
2318 unsigned TRISB0 : 1;
2319 unsigned TRISB1 : 1;
2320 unsigned TRISB2 : 1;
2321 unsigned TRISB3 : 1;
2322 unsigned TRISB4 : 1;
2323 unsigned TRISB5 : 1;
2324 unsigned TRISB6 : 1;
2325 unsigned TRISB7 : 1;
2328 struct
2330 unsigned RB0 : 1;
2331 unsigned RB1 : 1;
2332 unsigned RB2 : 1;
2333 unsigned RB3 : 1;
2334 unsigned RB4 : 1;
2335 unsigned RB5 : 1;
2336 unsigned RB6 : 1;
2337 unsigned RB7 : 1;
2339 } __TRISBbits_t;
2341 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2343 #define _TRISB_TRISB0 0x01
2344 #define _TRISB_RB0 0x01
2345 #define _TRISB_TRISB1 0x02
2346 #define _TRISB_RB1 0x02
2347 #define _TRISB_TRISB2 0x04
2348 #define _TRISB_RB2 0x04
2349 #define _TRISB_TRISB3 0x08
2350 #define _TRISB_RB3 0x08
2351 #define _TRISB_TRISB4 0x10
2352 #define _TRISB_RB4 0x10
2353 #define _TRISB_TRISB5 0x20
2354 #define _TRISB_RB5 0x20
2355 #define _TRISB_TRISB6 0x40
2356 #define _TRISB_RB6 0x40
2357 #define _TRISB_TRISB7 0x80
2358 #define _TRISB_RB7 0x80
2360 //==============================================================================
2363 //==============================================================================
2364 // DDRC Bits
2366 extern __at(0x0F94) __sfr DDRC;
2368 typedef union
2370 struct
2372 unsigned TRISC0 : 1;
2373 unsigned TRISC1 : 1;
2374 unsigned TRISC2 : 1;
2375 unsigned TRISC3 : 1;
2376 unsigned TRISC4 : 1;
2377 unsigned TRISC5 : 1;
2378 unsigned TRISC6 : 1;
2379 unsigned TRISC7 : 1;
2382 struct
2384 unsigned RC0 : 1;
2385 unsigned RC1 : 1;
2386 unsigned RC2 : 1;
2387 unsigned RC3 : 1;
2388 unsigned RC4 : 1;
2389 unsigned RC5 : 1;
2390 unsigned RC6 : 1;
2391 unsigned RC7 : 1;
2393 } __DDRCbits_t;
2395 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2397 #define _TRISC0 0x01
2398 #define _RC0 0x01
2399 #define _TRISC1 0x02
2400 #define _RC1 0x02
2401 #define _TRISC2 0x04
2402 #define _RC2 0x04
2403 #define _TRISC3 0x08
2404 #define _RC3 0x08
2405 #define _TRISC4 0x10
2406 #define _RC4 0x10
2407 #define _TRISC5 0x20
2408 #define _RC5 0x20
2409 #define _TRISC6 0x40
2410 #define _RC6 0x40
2411 #define _TRISC7 0x80
2412 #define _RC7 0x80
2414 //==============================================================================
2417 //==============================================================================
2418 // TRISC Bits
2420 extern __at(0x0F94) __sfr TRISC;
2422 typedef union
2424 struct
2426 unsigned TRISC0 : 1;
2427 unsigned TRISC1 : 1;
2428 unsigned TRISC2 : 1;
2429 unsigned TRISC3 : 1;
2430 unsigned TRISC4 : 1;
2431 unsigned TRISC5 : 1;
2432 unsigned TRISC6 : 1;
2433 unsigned TRISC7 : 1;
2436 struct
2438 unsigned RC0 : 1;
2439 unsigned RC1 : 1;
2440 unsigned RC2 : 1;
2441 unsigned RC3 : 1;
2442 unsigned RC4 : 1;
2443 unsigned RC5 : 1;
2444 unsigned RC6 : 1;
2445 unsigned RC7 : 1;
2447 } __TRISCbits_t;
2449 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2451 #define _TRISC_TRISC0 0x01
2452 #define _TRISC_RC0 0x01
2453 #define _TRISC_TRISC1 0x02
2454 #define _TRISC_RC1 0x02
2455 #define _TRISC_TRISC2 0x04
2456 #define _TRISC_RC2 0x04
2457 #define _TRISC_TRISC3 0x08
2458 #define _TRISC_RC3 0x08
2459 #define _TRISC_TRISC4 0x10
2460 #define _TRISC_RC4 0x10
2461 #define _TRISC_TRISC5 0x20
2462 #define _TRISC_RC5 0x20
2463 #define _TRISC_TRISC6 0x40
2464 #define _TRISC_RC6 0x40
2465 #define _TRISC_TRISC7 0x80
2466 #define _TRISC_RC7 0x80
2468 //==============================================================================
2471 //==============================================================================
2472 // DDRD Bits
2474 extern __at(0x0F95) __sfr DDRD;
2476 typedef union
2478 struct
2480 unsigned TRISD0 : 1;
2481 unsigned TRISD1 : 1;
2482 unsigned TRISD2 : 1;
2483 unsigned TRISD3 : 1;
2484 unsigned TRISD4 : 1;
2485 unsigned TRISD5 : 1;
2486 unsigned TRISD6 : 1;
2487 unsigned TRISD7 : 1;
2490 struct
2492 unsigned RD0 : 1;
2493 unsigned RD1 : 1;
2494 unsigned RD2 : 1;
2495 unsigned RD3 : 1;
2496 unsigned RD4 : 1;
2497 unsigned RD5 : 1;
2498 unsigned RD6 : 1;
2499 unsigned RD7 : 1;
2501 } __DDRDbits_t;
2503 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2505 #define _TRISD0 0x01
2506 #define _RD0 0x01
2507 #define _TRISD1 0x02
2508 #define _RD1 0x02
2509 #define _TRISD2 0x04
2510 #define _RD2 0x04
2511 #define _TRISD3 0x08
2512 #define _RD3 0x08
2513 #define _TRISD4 0x10
2514 #define _RD4 0x10
2515 #define _TRISD5 0x20
2516 #define _RD5 0x20
2517 #define _TRISD6 0x40
2518 #define _RD6 0x40
2519 #define _TRISD7 0x80
2520 #define _RD7 0x80
2522 //==============================================================================
2525 //==============================================================================
2526 // TRISD Bits
2528 extern __at(0x0F95) __sfr TRISD;
2530 typedef union
2532 struct
2534 unsigned TRISD0 : 1;
2535 unsigned TRISD1 : 1;
2536 unsigned TRISD2 : 1;
2537 unsigned TRISD3 : 1;
2538 unsigned TRISD4 : 1;
2539 unsigned TRISD5 : 1;
2540 unsigned TRISD6 : 1;
2541 unsigned TRISD7 : 1;
2544 struct
2546 unsigned RD0 : 1;
2547 unsigned RD1 : 1;
2548 unsigned RD2 : 1;
2549 unsigned RD3 : 1;
2550 unsigned RD4 : 1;
2551 unsigned RD5 : 1;
2552 unsigned RD6 : 1;
2553 unsigned RD7 : 1;
2555 } __TRISDbits_t;
2557 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2559 #define _TRISD_TRISD0 0x01
2560 #define _TRISD_RD0 0x01
2561 #define _TRISD_TRISD1 0x02
2562 #define _TRISD_RD1 0x02
2563 #define _TRISD_TRISD2 0x04
2564 #define _TRISD_RD2 0x04
2565 #define _TRISD_TRISD3 0x08
2566 #define _TRISD_RD3 0x08
2567 #define _TRISD_TRISD4 0x10
2568 #define _TRISD_RD4 0x10
2569 #define _TRISD_TRISD5 0x20
2570 #define _TRISD_RD5 0x20
2571 #define _TRISD_TRISD6 0x40
2572 #define _TRISD_RD6 0x40
2573 #define _TRISD_TRISD7 0x80
2574 #define _TRISD_RD7 0x80
2576 //==============================================================================
2579 //==============================================================================
2580 // DDRE Bits
2582 extern __at(0x0F96) __sfr DDRE;
2584 typedef union
2586 struct
2588 unsigned TRISE0 : 1;
2589 unsigned TRISE1 : 1;
2590 unsigned TRISE2 : 1;
2591 unsigned TRISE3 : 1;
2592 unsigned TRISE4 : 1;
2593 unsigned TRISE5 : 1;
2594 unsigned TRISE6 : 1;
2595 unsigned TRISE7 : 1;
2598 struct
2600 unsigned RE0 : 1;
2601 unsigned RE1 : 1;
2602 unsigned RE2 : 1;
2603 unsigned RE3 : 1;
2604 unsigned RE4 : 1;
2605 unsigned RE5 : 1;
2606 unsigned RE6 : 1;
2607 unsigned RE7 : 1;
2609 } __DDREbits_t;
2611 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2613 #define _TRISE0 0x01
2614 #define _RE0 0x01
2615 #define _TRISE1 0x02
2616 #define _RE1 0x02
2617 #define _TRISE2 0x04
2618 #define _RE2 0x04
2619 #define _TRISE3 0x08
2620 #define _RE3 0x08
2621 #define _TRISE4 0x10
2622 #define _RE4 0x10
2623 #define _TRISE5 0x20
2624 #define _RE5 0x20
2625 #define _TRISE6 0x40
2626 #define _RE6 0x40
2627 #define _TRISE7 0x80
2628 #define _RE7 0x80
2630 //==============================================================================
2633 //==============================================================================
2634 // TRISE Bits
2636 extern __at(0x0F96) __sfr TRISE;
2638 typedef union
2640 struct
2642 unsigned TRISE0 : 1;
2643 unsigned TRISE1 : 1;
2644 unsigned TRISE2 : 1;
2645 unsigned TRISE3 : 1;
2646 unsigned TRISE4 : 1;
2647 unsigned TRISE5 : 1;
2648 unsigned TRISE6 : 1;
2649 unsigned TRISE7 : 1;
2652 struct
2654 unsigned RE0 : 1;
2655 unsigned RE1 : 1;
2656 unsigned RE2 : 1;
2657 unsigned RE3 : 1;
2658 unsigned RE4 : 1;
2659 unsigned RE5 : 1;
2660 unsigned RE6 : 1;
2661 unsigned RE7 : 1;
2663 } __TRISEbits_t;
2665 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2667 #define _TRISE_TRISE0 0x01
2668 #define _TRISE_RE0 0x01
2669 #define _TRISE_TRISE1 0x02
2670 #define _TRISE_RE1 0x02
2671 #define _TRISE_TRISE2 0x04
2672 #define _TRISE_RE2 0x04
2673 #define _TRISE_TRISE3 0x08
2674 #define _TRISE_RE3 0x08
2675 #define _TRISE_TRISE4 0x10
2676 #define _TRISE_RE4 0x10
2677 #define _TRISE_TRISE5 0x20
2678 #define _TRISE_RE5 0x20
2679 #define _TRISE_TRISE6 0x40
2680 #define _TRISE_RE6 0x40
2681 #define _TRISE_TRISE7 0x80
2682 #define _TRISE_RE7 0x80
2684 //==============================================================================
2687 //==============================================================================
2688 // DDRF Bits
2690 extern __at(0x0F97) __sfr DDRF;
2692 typedef union
2694 struct
2696 unsigned : 1;
2697 unsigned TRISF1 : 1;
2698 unsigned TRISF2 : 1;
2699 unsigned TRISF3 : 1;
2700 unsigned TRISF4 : 1;
2701 unsigned TRISF5 : 1;
2702 unsigned TRISF6 : 1;
2703 unsigned TRISF7 : 1;
2706 struct
2708 unsigned : 1;
2709 unsigned RF1 : 1;
2710 unsigned RF2 : 1;
2711 unsigned RF3 : 1;
2712 unsigned RF4 : 1;
2713 unsigned RF5 : 1;
2714 unsigned RF6 : 1;
2715 unsigned RF7 : 1;
2717 } __DDRFbits_t;
2719 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
2721 #define _TRISF1 0x02
2722 #define _RF1 0x02
2723 #define _TRISF2 0x04
2724 #define _RF2 0x04
2725 #define _TRISF3 0x08
2726 #define _RF3 0x08
2727 #define _TRISF4 0x10
2728 #define _RF4 0x10
2729 #define _TRISF5 0x20
2730 #define _RF5 0x20
2731 #define _TRISF6 0x40
2732 #define _RF6 0x40
2733 #define _TRISF7 0x80
2734 #define _RF7 0x80
2736 //==============================================================================
2739 //==============================================================================
2740 // TRISF Bits
2742 extern __at(0x0F97) __sfr TRISF;
2744 typedef union
2746 struct
2748 unsigned : 1;
2749 unsigned TRISF1 : 1;
2750 unsigned TRISF2 : 1;
2751 unsigned TRISF3 : 1;
2752 unsigned TRISF4 : 1;
2753 unsigned TRISF5 : 1;
2754 unsigned TRISF6 : 1;
2755 unsigned TRISF7 : 1;
2758 struct
2760 unsigned : 1;
2761 unsigned RF1 : 1;
2762 unsigned RF2 : 1;
2763 unsigned RF3 : 1;
2764 unsigned RF4 : 1;
2765 unsigned RF5 : 1;
2766 unsigned RF6 : 1;
2767 unsigned RF7 : 1;
2769 } __TRISFbits_t;
2771 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
2773 #define _TRISF_TRISF1 0x02
2774 #define _TRISF_RF1 0x02
2775 #define _TRISF_TRISF2 0x04
2776 #define _TRISF_RF2 0x04
2777 #define _TRISF_TRISF3 0x08
2778 #define _TRISF_RF3 0x08
2779 #define _TRISF_TRISF4 0x10
2780 #define _TRISF_RF4 0x10
2781 #define _TRISF_TRISF5 0x20
2782 #define _TRISF_RF5 0x20
2783 #define _TRISF_TRISF6 0x40
2784 #define _TRISF_RF6 0x40
2785 #define _TRISF_TRISF7 0x80
2786 #define _TRISF_RF7 0x80
2788 //==============================================================================
2791 //==============================================================================
2792 // DDRG Bits
2794 extern __at(0x0F98) __sfr DDRG;
2796 typedef union
2798 struct
2800 unsigned TRISG0 : 1;
2801 unsigned TRISG1 : 1;
2802 unsigned TRISG2 : 1;
2803 unsigned TRISG3 : 1;
2804 unsigned TRISG4 : 1;
2805 unsigned : 1;
2806 unsigned : 1;
2807 unsigned : 1;
2810 struct
2812 unsigned RG0 : 1;
2813 unsigned RG1 : 1;
2814 unsigned RG2 : 1;
2815 unsigned RG3 : 1;
2816 unsigned RG4 : 1;
2817 unsigned : 1;
2818 unsigned : 1;
2819 unsigned : 1;
2822 struct
2824 unsigned RG : 5;
2825 unsigned : 3;
2828 struct
2830 unsigned TRISG : 5;
2831 unsigned : 3;
2833 } __DDRGbits_t;
2835 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
2837 #define _TRISG0 0x01
2838 #define _RG0 0x01
2839 #define _TRISG1 0x02
2840 #define _RG1 0x02
2841 #define _TRISG2 0x04
2842 #define _RG2 0x04
2843 #define _TRISG3 0x08
2844 #define _RG3 0x08
2845 #define _TRISG4 0x10
2846 #define _RG4 0x10
2848 //==============================================================================
2851 //==============================================================================
2852 // TRISG Bits
2854 extern __at(0x0F98) __sfr TRISG;
2856 typedef union
2858 struct
2860 unsigned TRISG0 : 1;
2861 unsigned TRISG1 : 1;
2862 unsigned TRISG2 : 1;
2863 unsigned TRISG3 : 1;
2864 unsigned TRISG4 : 1;
2865 unsigned : 1;
2866 unsigned : 1;
2867 unsigned : 1;
2870 struct
2872 unsigned RG0 : 1;
2873 unsigned RG1 : 1;
2874 unsigned RG2 : 1;
2875 unsigned RG3 : 1;
2876 unsigned RG4 : 1;
2877 unsigned : 1;
2878 unsigned : 1;
2879 unsigned : 1;
2882 struct
2884 unsigned RG : 5;
2885 unsigned : 3;
2888 struct
2890 unsigned TRISG : 5;
2891 unsigned : 3;
2893 } __TRISGbits_t;
2895 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
2897 #define _TRISG_TRISG0 0x01
2898 #define _TRISG_RG0 0x01
2899 #define _TRISG_TRISG1 0x02
2900 #define _TRISG_RG1 0x02
2901 #define _TRISG_TRISG2 0x04
2902 #define _TRISG_RG2 0x04
2903 #define _TRISG_TRISG3 0x08
2904 #define _TRISG_RG3 0x08
2905 #define _TRISG_TRISG4 0x10
2906 #define _TRISG_RG4 0x10
2908 //==============================================================================
2911 //==============================================================================
2912 // DDRH Bits
2914 extern __at(0x0F99) __sfr DDRH;
2916 typedef union
2918 struct
2920 unsigned TRISH0 : 1;
2921 unsigned TRISH1 : 1;
2922 unsigned TRISH2 : 1;
2923 unsigned TRISH3 : 1;
2924 unsigned TRISH4 : 1;
2925 unsigned TRISH5 : 1;
2926 unsigned TRISH6 : 1;
2927 unsigned TRISH7 : 1;
2930 struct
2932 unsigned RH0 : 1;
2933 unsigned RH1 : 1;
2934 unsigned RH2 : 1;
2935 unsigned RH3 : 1;
2936 unsigned RH4 : 1;
2937 unsigned RH5 : 1;
2938 unsigned RH6 : 1;
2939 unsigned RH7 : 1;
2941 } __DDRHbits_t;
2943 extern __at(0x0F99) volatile __DDRHbits_t DDRHbits;
2945 #define _TRISH0 0x01
2946 #define _RH0 0x01
2947 #define _TRISH1 0x02
2948 #define _RH1 0x02
2949 #define _TRISH2 0x04
2950 #define _RH2 0x04
2951 #define _TRISH3 0x08
2952 #define _RH3 0x08
2953 #define _TRISH4 0x10
2954 #define _RH4 0x10
2955 #define _TRISH5 0x20
2956 #define _RH5 0x20
2957 #define _TRISH6 0x40
2958 #define _RH6 0x40
2959 #define _TRISH7 0x80
2960 #define _RH7 0x80
2962 //==============================================================================
2965 //==============================================================================
2966 // TRISH Bits
2968 extern __at(0x0F99) __sfr TRISH;
2970 typedef union
2972 struct
2974 unsigned TRISH0 : 1;
2975 unsigned TRISH1 : 1;
2976 unsigned TRISH2 : 1;
2977 unsigned TRISH3 : 1;
2978 unsigned TRISH4 : 1;
2979 unsigned TRISH5 : 1;
2980 unsigned TRISH6 : 1;
2981 unsigned TRISH7 : 1;
2984 struct
2986 unsigned RH0 : 1;
2987 unsigned RH1 : 1;
2988 unsigned RH2 : 1;
2989 unsigned RH3 : 1;
2990 unsigned RH4 : 1;
2991 unsigned RH5 : 1;
2992 unsigned RH6 : 1;
2993 unsigned RH7 : 1;
2995 } __TRISHbits_t;
2997 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
2999 #define _TRISH_TRISH0 0x01
3000 #define _TRISH_RH0 0x01
3001 #define _TRISH_TRISH1 0x02
3002 #define _TRISH_RH1 0x02
3003 #define _TRISH_TRISH2 0x04
3004 #define _TRISH_RH2 0x04
3005 #define _TRISH_TRISH3 0x08
3006 #define _TRISH_RH3 0x08
3007 #define _TRISH_TRISH4 0x10
3008 #define _TRISH_RH4 0x10
3009 #define _TRISH_TRISH5 0x20
3010 #define _TRISH_RH5 0x20
3011 #define _TRISH_TRISH6 0x40
3012 #define _TRISH_RH6 0x40
3013 #define _TRISH_TRISH7 0x80
3014 #define _TRISH_RH7 0x80
3016 //==============================================================================
3019 //==============================================================================
3020 // DDRJ Bits
3022 extern __at(0x0F9A) __sfr DDRJ;
3024 typedef union
3026 struct
3028 unsigned TRISJ0 : 1;
3029 unsigned TRISJ1 : 1;
3030 unsigned TRISJ2 : 1;
3031 unsigned TRISJ3 : 1;
3032 unsigned TRISJ4 : 1;
3033 unsigned TRISJ5 : 1;
3034 unsigned TRISJ6 : 1;
3035 unsigned TRISJ7 : 1;
3038 struct
3040 unsigned RJ0 : 1;
3041 unsigned RJ1 : 1;
3042 unsigned RJ2 : 1;
3043 unsigned RJ3 : 1;
3044 unsigned RJ4 : 1;
3045 unsigned RJ5 : 1;
3046 unsigned RJ6 : 1;
3047 unsigned RJ7 : 1;
3049 } __DDRJbits_t;
3051 extern __at(0x0F9A) volatile __DDRJbits_t DDRJbits;
3053 #define _TRISJ0 0x01
3054 #define _RJ0 0x01
3055 #define _TRISJ1 0x02
3056 #define _RJ1 0x02
3057 #define _TRISJ2 0x04
3058 #define _RJ2 0x04
3059 #define _TRISJ3 0x08
3060 #define _RJ3 0x08
3061 #define _TRISJ4 0x10
3062 #define _RJ4 0x10
3063 #define _TRISJ5 0x20
3064 #define _RJ5 0x20
3065 #define _TRISJ6 0x40
3066 #define _RJ6 0x40
3067 #define _TRISJ7 0x80
3068 #define _RJ7 0x80
3070 //==============================================================================
3073 //==============================================================================
3074 // TRISJ Bits
3076 extern __at(0x0F9A) __sfr TRISJ;
3078 typedef union
3080 struct
3082 unsigned TRISJ0 : 1;
3083 unsigned TRISJ1 : 1;
3084 unsigned TRISJ2 : 1;
3085 unsigned TRISJ3 : 1;
3086 unsigned TRISJ4 : 1;
3087 unsigned TRISJ5 : 1;
3088 unsigned TRISJ6 : 1;
3089 unsigned TRISJ7 : 1;
3092 struct
3094 unsigned RJ0 : 1;
3095 unsigned RJ1 : 1;
3096 unsigned RJ2 : 1;
3097 unsigned RJ3 : 1;
3098 unsigned RJ4 : 1;
3099 unsigned RJ5 : 1;
3100 unsigned RJ6 : 1;
3101 unsigned RJ7 : 1;
3103 } __TRISJbits_t;
3105 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
3107 #define _TRISJ_TRISJ0 0x01
3108 #define _TRISJ_RJ0 0x01
3109 #define _TRISJ_TRISJ1 0x02
3110 #define _TRISJ_RJ1 0x02
3111 #define _TRISJ_TRISJ2 0x04
3112 #define _TRISJ_RJ2 0x04
3113 #define _TRISJ_TRISJ3 0x08
3114 #define _TRISJ_RJ3 0x08
3115 #define _TRISJ_TRISJ4 0x10
3116 #define _TRISJ_RJ4 0x10
3117 #define _TRISJ_TRISJ5 0x20
3118 #define _TRISJ_RJ5 0x20
3119 #define _TRISJ_TRISJ6 0x40
3120 #define _TRISJ_RJ6 0x40
3121 #define _TRISJ_TRISJ7 0x80
3122 #define _TRISJ_RJ7 0x80
3124 //==============================================================================
3127 //==============================================================================
3128 // OSCTUNE Bits
3130 extern __at(0x0F9B) __sfr OSCTUNE;
3132 typedef union
3134 struct
3136 unsigned TUN0 : 1;
3137 unsigned TUN1 : 1;
3138 unsigned TUN2 : 1;
3139 unsigned TUN3 : 1;
3140 unsigned TUN4 : 1;
3141 unsigned TUN5 : 1;
3142 unsigned PLLEN : 1;
3143 unsigned INTSRC : 1;
3146 struct
3148 unsigned TUN : 6;
3149 unsigned : 2;
3151 } __OSCTUNEbits_t;
3153 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3155 #define _TUN0 0x01
3156 #define _TUN1 0x02
3157 #define _TUN2 0x04
3158 #define _TUN3 0x08
3159 #define _TUN4 0x10
3160 #define _TUN5 0x20
3161 #define _PLLEN 0x40
3162 #define _INTSRC 0x80
3164 //==============================================================================
3167 //==============================================================================
3168 // RCSTA2 Bits
3170 extern __at(0x0F9C) __sfr RCSTA2;
3172 typedef union
3174 struct
3176 unsigned RX9D : 1;
3177 unsigned OERR : 1;
3178 unsigned FERR : 1;
3179 unsigned ADDEN : 1;
3180 unsigned CREN : 1;
3181 unsigned SREN : 1;
3182 unsigned RX9 : 1;
3183 unsigned SPEN : 1;
3186 struct
3188 unsigned RCD8 : 1;
3189 unsigned OERR2 : 1;
3190 unsigned FERR2 : 1;
3191 unsigned ADDEN2 : 1;
3192 unsigned CREN2 : 1;
3193 unsigned SREN2 : 1;
3194 unsigned RC9 : 1;
3195 unsigned SPEN2 : 1;
3198 struct
3200 unsigned RX9D2 : 1;
3201 unsigned : 1;
3202 unsigned : 1;
3203 unsigned : 1;
3204 unsigned : 1;
3205 unsigned : 1;
3206 unsigned NOT_RC8 : 1;
3207 unsigned : 1;
3210 struct
3212 unsigned : 1;
3213 unsigned : 1;
3214 unsigned : 1;
3215 unsigned : 1;
3216 unsigned : 1;
3217 unsigned : 1;
3218 unsigned RC8_9 : 1;
3219 unsigned : 1;
3222 struct
3224 unsigned : 1;
3225 unsigned : 1;
3226 unsigned : 1;
3227 unsigned : 1;
3228 unsigned : 1;
3229 unsigned : 1;
3230 unsigned RX92 : 1;
3231 unsigned : 1;
3233 } __RCSTA2bits_t;
3235 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
3237 #define _RCSTA2_RX9D 0x01
3238 #define _RCSTA2_RCD8 0x01
3239 #define _RCSTA2_RX9D2 0x01
3240 #define _RCSTA2_OERR 0x02
3241 #define _RCSTA2_OERR2 0x02
3242 #define _RCSTA2_FERR 0x04
3243 #define _RCSTA2_FERR2 0x04
3244 #define _RCSTA2_ADDEN 0x08
3245 #define _RCSTA2_ADDEN2 0x08
3246 #define _RCSTA2_CREN 0x10
3247 #define _RCSTA2_CREN2 0x10
3248 #define _RCSTA2_SREN 0x20
3249 #define _RCSTA2_SREN2 0x20
3250 #define _RCSTA2_RX9 0x40
3251 #define _RCSTA2_RC9 0x40
3252 #define _RCSTA2_NOT_RC8 0x40
3253 #define _RCSTA2_RC8_9 0x40
3254 #define _RCSTA2_RX92 0x40
3255 #define _RCSTA2_SPEN 0x80
3256 #define _RCSTA2_SPEN2 0x80
3258 //==============================================================================
3261 //==============================================================================
3262 // PIE1 Bits
3264 extern __at(0x0F9D) __sfr PIE1;
3266 typedef union
3268 struct
3270 unsigned TMR1IE : 1;
3271 unsigned TMR2IE : 1;
3272 unsigned CCP1IE : 1;
3273 unsigned SSP1IE : 1;
3274 unsigned TX1IE : 1;
3275 unsigned RC1IE : 1;
3276 unsigned ADIE : 1;
3277 unsigned PMPIE : 1;
3280 struct
3282 unsigned : 1;
3283 unsigned : 1;
3284 unsigned : 1;
3285 unsigned SSPIE : 1;
3286 unsigned TXIE : 1;
3287 unsigned RCIE : 1;
3288 unsigned : 1;
3289 unsigned : 1;
3291 } __PIE1bits_t;
3293 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3295 #define _TMR1IE 0x01
3296 #define _TMR2IE 0x02
3297 #define _CCP1IE 0x04
3298 #define _SSP1IE 0x08
3299 #define _SSPIE 0x08
3300 #define _TX1IE 0x10
3301 #define _TXIE 0x10
3302 #define _RC1IE 0x20
3303 #define _RCIE 0x20
3304 #define _ADIE 0x40
3305 #define _PMPIE 0x80
3307 //==============================================================================
3310 //==============================================================================
3311 // PIR1 Bits
3313 extern __at(0x0F9E) __sfr PIR1;
3315 typedef union
3317 struct
3319 unsigned TMR1IF : 1;
3320 unsigned TMR2IF : 1;
3321 unsigned CCP1IF : 1;
3322 unsigned SSP1IF : 1;
3323 unsigned TX1IF : 1;
3324 unsigned RC1IF : 1;
3325 unsigned ADIF : 1;
3326 unsigned PMPIF : 1;
3329 struct
3331 unsigned : 1;
3332 unsigned : 1;
3333 unsigned : 1;
3334 unsigned SSPIF : 1;
3335 unsigned TXIF : 1;
3336 unsigned RCIF : 1;
3337 unsigned : 1;
3338 unsigned : 1;
3340 } __PIR1bits_t;
3342 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3344 #define _TMR1IF 0x01
3345 #define _TMR2IF 0x02
3346 #define _CCP1IF 0x04
3347 #define _SSP1IF 0x08
3348 #define _SSPIF 0x08
3349 #define _TX1IF 0x10
3350 #define _TXIF 0x10
3351 #define _RC1IF 0x20
3352 #define _RCIF 0x20
3353 #define _ADIF 0x40
3354 #define _PMPIF 0x80
3356 //==============================================================================
3359 //==============================================================================
3360 // IPR1 Bits
3362 extern __at(0x0F9F) __sfr IPR1;
3364 typedef union
3366 struct
3368 unsigned TMR1IP : 1;
3369 unsigned TMR2IP : 1;
3370 unsigned CCP1IP : 1;
3371 unsigned SSP1IP : 1;
3372 unsigned TX1IP : 1;
3373 unsigned RC1IP : 1;
3374 unsigned ADIP : 1;
3375 unsigned PMPIP : 1;
3378 struct
3380 unsigned : 1;
3381 unsigned : 1;
3382 unsigned : 1;
3383 unsigned SSPIP : 1;
3384 unsigned TXIP : 1;
3385 unsigned RCIP : 1;
3386 unsigned : 1;
3387 unsigned : 1;
3389 } __IPR1bits_t;
3391 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3393 #define _TMR1IP 0x01
3394 #define _TMR2IP 0x02
3395 #define _CCP1IP 0x04
3396 #define _SSP1IP 0x08
3397 #define _SSPIP 0x08
3398 #define _TX1IP 0x10
3399 #define _TXIP 0x10
3400 #define _RC1IP 0x20
3401 #define _RCIP 0x20
3402 #define _ADIP 0x40
3403 #define _PMPIP 0x80
3405 //==============================================================================
3408 //==============================================================================
3409 // PIE2 Bits
3411 extern __at(0x0FA0) __sfr PIE2;
3413 typedef union
3415 struct
3417 unsigned CCP2IE : 1;
3418 unsigned TMR3IE : 1;
3419 unsigned LVDIE : 1;
3420 unsigned BCL1IE : 1;
3421 unsigned : 1;
3422 unsigned CM1IE : 1;
3423 unsigned CM2IE : 1;
3424 unsigned OSCFIE : 1;
3427 struct
3429 unsigned : 1;
3430 unsigned : 1;
3431 unsigned : 1;
3432 unsigned BCLIE : 1;
3433 unsigned : 1;
3434 unsigned : 1;
3435 unsigned : 1;
3436 unsigned : 1;
3438 } __PIE2bits_t;
3440 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3442 #define _CCP2IE 0x01
3443 #define _TMR3IE 0x02
3444 #define _LVDIE 0x04
3445 #define _BCL1IE 0x08
3446 #define _BCLIE 0x08
3447 #define _CM1IE 0x20
3448 #define _CM2IE 0x40
3449 #define _OSCFIE 0x80
3451 //==============================================================================
3454 //==============================================================================
3455 // PIR2 Bits
3457 extern __at(0x0FA1) __sfr PIR2;
3459 typedef union
3461 struct
3463 unsigned CCP2IF : 1;
3464 unsigned TMR3IF : 1;
3465 unsigned LVDIF : 1;
3466 unsigned BCL1IF : 1;
3467 unsigned : 1;
3468 unsigned CM1IF : 1;
3469 unsigned CM2IF : 1;
3470 unsigned OSCFIF : 1;
3473 struct
3475 unsigned : 1;
3476 unsigned : 1;
3477 unsigned : 1;
3478 unsigned BCLIF : 1;
3479 unsigned : 1;
3480 unsigned : 1;
3481 unsigned : 1;
3482 unsigned : 1;
3484 } __PIR2bits_t;
3486 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3488 #define _CCP2IF 0x01
3489 #define _TMR3IF 0x02
3490 #define _LVDIF 0x04
3491 #define _BCL1IF 0x08
3492 #define _BCLIF 0x08
3493 #define _CM1IF 0x20
3494 #define _CM2IF 0x40
3495 #define _OSCFIF 0x80
3497 //==============================================================================
3500 //==============================================================================
3501 // IPR2 Bits
3503 extern __at(0x0FA2) __sfr IPR2;
3505 typedef union
3507 struct
3509 unsigned CCP2IP : 1;
3510 unsigned TMR3IP : 1;
3511 unsigned LVDIP : 1;
3512 unsigned BCL1IP : 1;
3513 unsigned : 1;
3514 unsigned CM1IP : 1;
3515 unsigned CM2IP : 1;
3516 unsigned OSCFIP : 1;
3519 struct
3521 unsigned : 1;
3522 unsigned : 1;
3523 unsigned : 1;
3524 unsigned BCLIP : 1;
3525 unsigned : 1;
3526 unsigned : 1;
3527 unsigned : 1;
3528 unsigned : 1;
3530 } __IPR2bits_t;
3532 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3534 #define _CCP2IP 0x01
3535 #define _TMR3IP 0x02
3536 #define _LVDIP 0x04
3537 #define _BCL1IP 0x08
3538 #define _BCLIP 0x08
3539 #define _CM1IP 0x20
3540 #define _CM2IP 0x40
3541 #define _OSCFIP 0x80
3543 //==============================================================================
3546 //==============================================================================
3547 // PIE3 Bits
3549 extern __at(0x0FA3) __sfr PIE3;
3551 typedef struct
3553 unsigned CCP3IE : 1;
3554 unsigned CCP4IE : 1;
3555 unsigned CCP5IE : 1;
3556 unsigned TMR4IE : 1;
3557 unsigned TX2IE : 1;
3558 unsigned RC2IE : 1;
3559 unsigned BCL2IE : 1;
3560 unsigned SSP2IE : 1;
3561 } __PIE3bits_t;
3563 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3565 #define _CCP3IE 0x01
3566 #define _CCP4IE 0x02
3567 #define _CCP5IE 0x04
3568 #define _TMR4IE 0x08
3569 #define _TX2IE 0x10
3570 #define _RC2IE 0x20
3571 #define _BCL2IE 0x40
3572 #define _SSP2IE 0x80
3574 //==============================================================================
3577 //==============================================================================
3578 // PIR3 Bits
3580 extern __at(0x0FA4) __sfr PIR3;
3582 typedef struct
3584 unsigned CCP3IF : 1;
3585 unsigned CCP4IF : 1;
3586 unsigned CCP5IF : 1;
3587 unsigned TMR4IF : 1;
3588 unsigned TX2IF : 1;
3589 unsigned RC2IF : 1;
3590 unsigned BCL2IF : 1;
3591 unsigned SSP2IF : 1;
3592 } __PIR3bits_t;
3594 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3596 #define _CCP3IF 0x01
3597 #define _CCP4IF 0x02
3598 #define _CCP5IF 0x04
3599 #define _TMR4IF 0x08
3600 #define _TX2IF 0x10
3601 #define _RC2IF 0x20
3602 #define _BCL2IF 0x40
3603 #define _SSP2IF 0x80
3605 //==============================================================================
3608 //==============================================================================
3609 // IPR3 Bits
3611 extern __at(0x0FA5) __sfr IPR3;
3613 typedef struct
3615 unsigned CCP3IP : 1;
3616 unsigned CCP4IP : 1;
3617 unsigned CCP5IP : 1;
3618 unsigned TMR4IP : 1;
3619 unsigned TX2IP : 1;
3620 unsigned RC2IP : 1;
3621 unsigned BCL2IP : 1;
3622 unsigned SSP2IP : 1;
3623 } __IPR3bits_t;
3625 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3627 #define _CCP3IP 0x01
3628 #define _CCP4IP 0x02
3629 #define _CCP5IP 0x04
3630 #define _TMR4IP 0x08
3631 #define _TX2IP 0x10
3632 #define _RC2IP 0x20
3633 #define _BCL2IP 0x40
3634 #define _SSP2IP 0x80
3636 //==============================================================================
3639 //==============================================================================
3640 // EECON1 Bits
3642 extern __at(0x0FA6) __sfr EECON1;
3644 typedef struct
3646 unsigned : 1;
3647 unsigned WR : 1;
3648 unsigned WREN : 1;
3649 unsigned WRERR : 1;
3650 unsigned FREE : 1;
3651 unsigned WPROG : 1;
3652 unsigned : 1;
3653 unsigned : 1;
3654 } __EECON1bits_t;
3656 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3658 #define _WR 0x02
3659 #define _WREN 0x04
3660 #define _WRERR 0x08
3661 #define _FREE 0x10
3662 #define _WPROG 0x20
3664 //==============================================================================
3666 extern __at(0x0FA7) __sfr EECON2;
3668 //==============================================================================
3669 // TXSTA2 Bits
3671 extern __at(0x0FA8) __sfr TXSTA2;
3673 typedef union
3675 struct
3677 unsigned TX9D : 1;
3678 unsigned TRMT : 1;
3679 unsigned BRGH : 1;
3680 unsigned SENDB : 1;
3681 unsigned SYNC : 1;
3682 unsigned TXEN : 1;
3683 unsigned TX9 : 1;
3684 unsigned CSRC : 1;
3687 struct
3689 unsigned TXD8 : 1;
3690 unsigned TRMT2 : 1;
3691 unsigned BRGH2 : 1;
3692 unsigned SENDB2 : 1;
3693 unsigned SYNC2 : 1;
3694 unsigned TXEN2 : 1;
3695 unsigned TX8_9 : 1;
3696 unsigned CSRC2 : 1;
3699 struct
3701 unsigned TX9D2 : 1;
3702 unsigned : 1;
3703 unsigned : 1;
3704 unsigned : 1;
3705 unsigned : 1;
3706 unsigned : 1;
3707 unsigned NOT_TX8 : 1;
3708 unsigned : 1;
3711 struct
3713 unsigned : 1;
3714 unsigned : 1;
3715 unsigned : 1;
3716 unsigned : 1;
3717 unsigned : 1;
3718 unsigned : 1;
3719 unsigned TX92 : 1;
3720 unsigned : 1;
3722 } __TXSTA2bits_t;
3724 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
3726 #define _TXSTA2_TX9D 0x01
3727 #define _TXSTA2_TXD8 0x01
3728 #define _TXSTA2_TX9D2 0x01
3729 #define _TXSTA2_TRMT 0x02
3730 #define _TXSTA2_TRMT2 0x02
3731 #define _TXSTA2_BRGH 0x04
3732 #define _TXSTA2_BRGH2 0x04
3733 #define _TXSTA2_SENDB 0x08
3734 #define _TXSTA2_SENDB2 0x08
3735 #define _TXSTA2_SYNC 0x10
3736 #define _TXSTA2_SYNC2 0x10
3737 #define _TXSTA2_TXEN 0x20
3738 #define _TXSTA2_TXEN2 0x20
3739 #define _TXSTA2_TX9 0x40
3740 #define _TXSTA2_TX8_9 0x40
3741 #define _TXSTA2_NOT_TX8 0x40
3742 #define _TXSTA2_TX92 0x40
3743 #define _TXSTA2_CSRC 0x80
3744 #define _TXSTA2_CSRC2 0x80
3746 //==============================================================================
3748 extern __at(0x0FA9) __sfr TXREG2;
3749 extern __at(0x0FAA) __sfr RCREG2;
3750 extern __at(0x0FAB) __sfr SPBRG2;
3752 //==============================================================================
3753 // RCSTA Bits
3755 extern __at(0x0FAC) __sfr RCSTA;
3757 typedef union
3759 struct
3761 unsigned RX9D : 1;
3762 unsigned OERR : 1;
3763 unsigned FERR : 1;
3764 unsigned ADDEN : 1;
3765 unsigned CREN : 1;
3766 unsigned SREN : 1;
3767 unsigned RX9 : 1;
3768 unsigned SPEN : 1;
3771 struct
3773 unsigned RCD8 : 1;
3774 unsigned OERR1 : 1;
3775 unsigned FERR1 : 1;
3776 unsigned ADDEN1 : 1;
3777 unsigned CREN1 : 1;
3778 unsigned SREN1 : 1;
3779 unsigned RC9 : 1;
3780 unsigned SPEN1 : 1;
3783 struct
3785 unsigned RX9D1 : 1;
3786 unsigned : 1;
3787 unsigned : 1;
3788 unsigned : 1;
3789 unsigned : 1;
3790 unsigned : 1;
3791 unsigned NOT_RC8 : 1;
3792 unsigned : 1;
3795 struct
3797 unsigned : 1;
3798 unsigned : 1;
3799 unsigned : 1;
3800 unsigned : 1;
3801 unsigned : 1;
3802 unsigned : 1;
3803 unsigned RC8_9 : 1;
3804 unsigned : 1;
3807 struct
3809 unsigned : 1;
3810 unsigned : 1;
3811 unsigned : 1;
3812 unsigned : 1;
3813 unsigned : 1;
3814 unsigned : 1;
3815 unsigned RX91 : 1;
3816 unsigned : 1;
3818 } __RCSTAbits_t;
3820 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
3822 #define _RX9D 0x01
3823 #define _RCD8 0x01
3824 #define _RX9D1 0x01
3825 #define _OERR 0x02
3826 #define _OERR1 0x02
3827 #define _FERR 0x04
3828 #define _FERR1 0x04
3829 #define _ADDEN 0x08
3830 #define _ADDEN1 0x08
3831 #define _CREN 0x10
3832 #define _CREN1 0x10
3833 #define _SREN 0x20
3834 #define _SREN1 0x20
3835 #define _RX9 0x40
3836 #define _RC9 0x40
3837 #define _NOT_RC8 0x40
3838 #define _RC8_9 0x40
3839 #define _RX91 0x40
3840 #define _SPEN 0x80
3841 #define _SPEN1 0x80
3843 //==============================================================================
3846 //==============================================================================
3847 // RCSTA1 Bits
3849 extern __at(0x0FAC) __sfr RCSTA1;
3851 typedef union
3853 struct
3855 unsigned RX9D : 1;
3856 unsigned OERR : 1;
3857 unsigned FERR : 1;
3858 unsigned ADDEN : 1;
3859 unsigned CREN : 1;
3860 unsigned SREN : 1;
3861 unsigned RX9 : 1;
3862 unsigned SPEN : 1;
3865 struct
3867 unsigned RCD8 : 1;
3868 unsigned OERR1 : 1;
3869 unsigned FERR1 : 1;
3870 unsigned ADDEN1 : 1;
3871 unsigned CREN1 : 1;
3872 unsigned SREN1 : 1;
3873 unsigned RC9 : 1;
3874 unsigned SPEN1 : 1;
3877 struct
3879 unsigned RX9D1 : 1;
3880 unsigned : 1;
3881 unsigned : 1;
3882 unsigned : 1;
3883 unsigned : 1;
3884 unsigned : 1;
3885 unsigned NOT_RC8 : 1;
3886 unsigned : 1;
3889 struct
3891 unsigned : 1;
3892 unsigned : 1;
3893 unsigned : 1;
3894 unsigned : 1;
3895 unsigned : 1;
3896 unsigned : 1;
3897 unsigned RC8_9 : 1;
3898 unsigned : 1;
3901 struct
3903 unsigned : 1;
3904 unsigned : 1;
3905 unsigned : 1;
3906 unsigned : 1;
3907 unsigned : 1;
3908 unsigned : 1;
3909 unsigned RX91 : 1;
3910 unsigned : 1;
3912 } __RCSTA1bits_t;
3914 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
3916 #define _RCSTA1_RX9D 0x01
3917 #define _RCSTA1_RCD8 0x01
3918 #define _RCSTA1_RX9D1 0x01
3919 #define _RCSTA1_OERR 0x02
3920 #define _RCSTA1_OERR1 0x02
3921 #define _RCSTA1_FERR 0x04
3922 #define _RCSTA1_FERR1 0x04
3923 #define _RCSTA1_ADDEN 0x08
3924 #define _RCSTA1_ADDEN1 0x08
3925 #define _RCSTA1_CREN 0x10
3926 #define _RCSTA1_CREN1 0x10
3927 #define _RCSTA1_SREN 0x20
3928 #define _RCSTA1_SREN1 0x20
3929 #define _RCSTA1_RX9 0x40
3930 #define _RCSTA1_RC9 0x40
3931 #define _RCSTA1_NOT_RC8 0x40
3932 #define _RCSTA1_RC8_9 0x40
3933 #define _RCSTA1_RX91 0x40
3934 #define _RCSTA1_SPEN 0x80
3935 #define _RCSTA1_SPEN1 0x80
3937 //==============================================================================
3940 //==============================================================================
3941 // TXSTA Bits
3943 extern __at(0x0FAD) __sfr TXSTA;
3945 typedef union
3947 struct
3949 unsigned TX9D : 1;
3950 unsigned TRMT : 1;
3951 unsigned BRGH : 1;
3952 unsigned SENDB : 1;
3953 unsigned SYNC : 1;
3954 unsigned TXEN : 1;
3955 unsigned TX9 : 1;
3956 unsigned CSRC : 1;
3959 struct
3961 unsigned TXD8 : 1;
3962 unsigned TRMT1 : 1;
3963 unsigned BRGH1 : 1;
3964 unsigned SENDB1 : 1;
3965 unsigned SYNC1 : 1;
3966 unsigned TXEN1 : 1;
3967 unsigned TX8_9 : 1;
3968 unsigned CSRC1 : 1;
3971 struct
3973 unsigned TX9D1 : 1;
3974 unsigned : 1;
3975 unsigned : 1;
3976 unsigned : 1;
3977 unsigned : 1;
3978 unsigned : 1;
3979 unsigned NOT_TX8 : 1;
3980 unsigned : 1;
3983 struct
3985 unsigned : 1;
3986 unsigned : 1;
3987 unsigned : 1;
3988 unsigned : 1;
3989 unsigned : 1;
3990 unsigned : 1;
3991 unsigned TX91 : 1;
3992 unsigned : 1;
3994 } __TXSTAbits_t;
3996 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
3998 #define _TX9D 0x01
3999 #define _TXD8 0x01
4000 #define _TX9D1 0x01
4001 #define _TRMT 0x02
4002 #define _TRMT1 0x02
4003 #define _BRGH 0x04
4004 #define _BRGH1 0x04
4005 #define _SENDB 0x08
4006 #define _SENDB1 0x08
4007 #define _SYNC 0x10
4008 #define _SYNC1 0x10
4009 #define _TXEN 0x20
4010 #define _TXEN1 0x20
4011 #define _TX9 0x40
4012 #define _TX8_9 0x40
4013 #define _NOT_TX8 0x40
4014 #define _TX91 0x40
4015 #define _CSRC 0x80
4016 #define _CSRC1 0x80
4018 //==============================================================================
4021 //==============================================================================
4022 // TXSTA1 Bits
4024 extern __at(0x0FAD) __sfr TXSTA1;
4026 typedef union
4028 struct
4030 unsigned TX9D : 1;
4031 unsigned TRMT : 1;
4032 unsigned BRGH : 1;
4033 unsigned SENDB : 1;
4034 unsigned SYNC : 1;
4035 unsigned TXEN : 1;
4036 unsigned TX9 : 1;
4037 unsigned CSRC : 1;
4040 struct
4042 unsigned TXD8 : 1;
4043 unsigned TRMT1 : 1;
4044 unsigned BRGH1 : 1;
4045 unsigned SENDB1 : 1;
4046 unsigned SYNC1 : 1;
4047 unsigned TXEN1 : 1;
4048 unsigned TX8_9 : 1;
4049 unsigned CSRC1 : 1;
4052 struct
4054 unsigned TX9D1 : 1;
4055 unsigned : 1;
4056 unsigned : 1;
4057 unsigned : 1;
4058 unsigned : 1;
4059 unsigned : 1;
4060 unsigned NOT_TX8 : 1;
4061 unsigned : 1;
4064 struct
4066 unsigned : 1;
4067 unsigned : 1;
4068 unsigned : 1;
4069 unsigned : 1;
4070 unsigned : 1;
4071 unsigned : 1;
4072 unsigned TX91 : 1;
4073 unsigned : 1;
4075 } __TXSTA1bits_t;
4077 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
4079 #define _TXSTA1_TX9D 0x01
4080 #define _TXSTA1_TXD8 0x01
4081 #define _TXSTA1_TX9D1 0x01
4082 #define _TXSTA1_TRMT 0x02
4083 #define _TXSTA1_TRMT1 0x02
4084 #define _TXSTA1_BRGH 0x04
4085 #define _TXSTA1_BRGH1 0x04
4086 #define _TXSTA1_SENDB 0x08
4087 #define _TXSTA1_SENDB1 0x08
4088 #define _TXSTA1_SYNC 0x10
4089 #define _TXSTA1_SYNC1 0x10
4090 #define _TXSTA1_TXEN 0x20
4091 #define _TXSTA1_TXEN1 0x20
4092 #define _TXSTA1_TX9 0x40
4093 #define _TXSTA1_TX8_9 0x40
4094 #define _TXSTA1_NOT_TX8 0x40
4095 #define _TXSTA1_TX91 0x40
4096 #define _TXSTA1_CSRC 0x80
4097 #define _TXSTA1_CSRC1 0x80
4099 //==============================================================================
4101 extern __at(0x0FAE) __sfr TXREG;
4102 extern __at(0x0FAE) __sfr TXREG1;
4103 extern __at(0x0FAF) __sfr RCREG;
4104 extern __at(0x0FAF) __sfr RCREG1;
4105 extern __at(0x0FB0) __sfr SPBRG;
4106 extern __at(0x0FB0) __sfr SPBRG1;
4108 //==============================================================================
4109 // CCP3CON Bits
4111 extern __at(0x0FB1) __sfr CCP3CON;
4113 typedef union
4115 struct
4117 unsigned CCP3M0 : 1;
4118 unsigned CCP3M1 : 1;
4119 unsigned CCP3M2 : 1;
4120 unsigned CCP3M3 : 1;
4121 unsigned DC3B0 : 1;
4122 unsigned DC3B1 : 1;
4123 unsigned P3M0 : 1;
4124 unsigned P3M1 : 1;
4127 struct
4129 unsigned : 1;
4130 unsigned : 1;
4131 unsigned : 1;
4132 unsigned : 1;
4133 unsigned CCP3Y : 1;
4134 unsigned CCP3X : 1;
4135 unsigned : 1;
4136 unsigned : 1;
4139 struct
4141 unsigned CCP3M : 4;
4142 unsigned : 4;
4145 struct
4147 unsigned : 4;
4148 unsigned DC3B : 2;
4149 unsigned : 2;
4152 struct
4154 unsigned : 6;
4155 unsigned P3M : 2;
4157 } __CCP3CONbits_t;
4159 extern __at(0x0FB1) volatile __CCP3CONbits_t CCP3CONbits;
4161 #define _CCP3M0 0x01
4162 #define _CCP3M1 0x02
4163 #define _CCP3M2 0x04
4164 #define _CCP3M3 0x08
4165 #define _DC3B0 0x10
4166 #define _CCP3Y 0x10
4167 #define _DC3B1 0x20
4168 #define _CCP3X 0x20
4169 #define _P3M0 0x40
4170 #define _P3M1 0x80
4172 //==============================================================================
4175 //==============================================================================
4176 // ECCP3CON Bits
4178 extern __at(0x0FB1) __sfr ECCP3CON;
4180 typedef union
4182 struct
4184 unsigned CCP3M0 : 1;
4185 unsigned CCP3M1 : 1;
4186 unsigned CCP3M2 : 1;
4187 unsigned CCP3M3 : 1;
4188 unsigned DC3B0 : 1;
4189 unsigned DC3B1 : 1;
4190 unsigned P3M0 : 1;
4191 unsigned P3M1 : 1;
4194 struct
4196 unsigned : 1;
4197 unsigned : 1;
4198 unsigned : 1;
4199 unsigned : 1;
4200 unsigned CCP3Y : 1;
4201 unsigned CCP3X : 1;
4202 unsigned : 1;
4203 unsigned : 1;
4206 struct
4208 unsigned CCP3M : 4;
4209 unsigned : 4;
4212 struct
4214 unsigned : 4;
4215 unsigned DC3B : 2;
4216 unsigned : 2;
4219 struct
4221 unsigned : 6;
4222 unsigned P3M : 2;
4224 } __ECCP3CONbits_t;
4226 extern __at(0x0FB1) volatile __ECCP3CONbits_t ECCP3CONbits;
4228 #define _ECCP3CON_CCP3M0 0x01
4229 #define _ECCP3CON_CCP3M1 0x02
4230 #define _ECCP3CON_CCP3M2 0x04
4231 #define _ECCP3CON_CCP3M3 0x08
4232 #define _ECCP3CON_DC3B0 0x10
4233 #define _ECCP3CON_CCP3Y 0x10
4234 #define _ECCP3CON_DC3B1 0x20
4235 #define _ECCP3CON_CCP3X 0x20
4236 #define _ECCP3CON_P3M0 0x40
4237 #define _ECCP3CON_P3M1 0x80
4239 //==============================================================================
4241 extern __at(0x0FB2) __sfr CCPR3;
4242 extern __at(0x0FB2) __sfr CCPR3L;
4243 extern __at(0x0FB3) __sfr CCPR3H;
4245 //==============================================================================
4246 // ECCP3DEL Bits
4248 extern __at(0x0FB4) __sfr ECCP3DEL;
4250 typedef union
4252 struct
4254 unsigned PDC0 : 1;
4255 unsigned PDC1 : 1;
4256 unsigned PDC2 : 1;
4257 unsigned PDC3 : 1;
4258 unsigned PDC4 : 1;
4259 unsigned PDC5 : 1;
4260 unsigned PDC6 : 1;
4261 unsigned PRSEN : 1;
4264 struct
4266 unsigned P3DC0 : 1;
4267 unsigned P3DC1 : 1;
4268 unsigned P3DC2 : 1;
4269 unsigned P3DC3 : 1;
4270 unsigned P3DC4 : 1;
4271 unsigned P3DC5 : 1;
4272 unsigned P3DC6 : 1;
4273 unsigned P3RSEN : 1;
4276 struct
4278 unsigned P3DC : 7;
4279 unsigned : 1;
4282 struct
4284 unsigned PDC : 7;
4285 unsigned : 1;
4287 } __ECCP3DELbits_t;
4289 extern __at(0x0FB4) volatile __ECCP3DELbits_t ECCP3DELbits;
4291 #define _ECCP3DEL_PDC0 0x01
4292 #define _ECCP3DEL_P3DC0 0x01
4293 #define _ECCP3DEL_PDC1 0x02
4294 #define _ECCP3DEL_P3DC1 0x02
4295 #define _ECCP3DEL_PDC2 0x04
4296 #define _ECCP3DEL_P3DC2 0x04
4297 #define _ECCP3DEL_PDC3 0x08
4298 #define _ECCP3DEL_P3DC3 0x08
4299 #define _ECCP3DEL_PDC4 0x10
4300 #define _ECCP3DEL_P3DC4 0x10
4301 #define _ECCP3DEL_PDC5 0x20
4302 #define _ECCP3DEL_P3DC5 0x20
4303 #define _ECCP3DEL_PDC6 0x40
4304 #define _ECCP3DEL_P3DC6 0x40
4305 #define _ECCP3DEL_PRSEN 0x80
4306 #define _ECCP3DEL_P3RSEN 0x80
4308 //==============================================================================
4311 //==============================================================================
4312 // ECCP3AS Bits
4314 extern __at(0x0FB5) __sfr ECCP3AS;
4316 typedef union
4318 struct
4320 unsigned PSSBD0 : 1;
4321 unsigned PSSBD1 : 1;
4322 unsigned PSSAC0 : 1;
4323 unsigned PSSAC1 : 1;
4324 unsigned ECCPAS0 : 1;
4325 unsigned ECCPAS1 : 1;
4326 unsigned ECCPAS2 : 1;
4327 unsigned ECCPASE : 1;
4330 struct
4332 unsigned PSS3BD0 : 1;
4333 unsigned PSS3BD1 : 1;
4334 unsigned PSS3AC0 : 1;
4335 unsigned PSS3AC1 : 1;
4336 unsigned ECCP3AS0 : 1;
4337 unsigned ECCP3AS1 : 1;
4338 unsigned ECCP3AS2 : 1;
4339 unsigned ECCP3ASE : 1;
4342 struct
4344 unsigned PSS3BD : 2;
4345 unsigned : 6;
4348 struct
4350 unsigned PSSBD : 2;
4351 unsigned : 6;
4354 struct
4356 unsigned : 2;
4357 unsigned PSS3AC : 2;
4358 unsigned : 4;
4361 struct
4363 unsigned : 2;
4364 unsigned PSSAC : 2;
4365 unsigned : 4;
4368 struct
4370 unsigned : 4;
4371 unsigned ECCP3AS : 3;
4372 unsigned : 1;
4375 struct
4377 unsigned : 4;
4378 unsigned ECCPAS : 3;
4379 unsigned : 1;
4381 } __ECCP3ASbits_t;
4383 extern __at(0x0FB5) volatile __ECCP3ASbits_t ECCP3ASbits;
4385 #define _ECCP3AS_PSSBD0 0x01
4386 #define _ECCP3AS_PSS3BD0 0x01
4387 #define _ECCP3AS_PSSBD1 0x02
4388 #define _ECCP3AS_PSS3BD1 0x02
4389 #define _ECCP3AS_PSSAC0 0x04
4390 #define _ECCP3AS_PSS3AC0 0x04
4391 #define _ECCP3AS_PSSAC1 0x08
4392 #define _ECCP3AS_PSS3AC1 0x08
4393 #define _ECCP3AS_ECCPAS0 0x10
4394 #define _ECCP3AS_ECCP3AS0 0x10
4395 #define _ECCP3AS_ECCPAS1 0x20
4396 #define _ECCP3AS_ECCP3AS1 0x20
4397 #define _ECCP3AS_ECCPAS2 0x40
4398 #define _ECCP3AS_ECCP3AS2 0x40
4399 #define _ECCP3AS_ECCPASE 0x80
4400 #define _ECCP3AS_ECCP3ASE 0x80
4402 //==============================================================================
4405 //==============================================================================
4406 // CCP2CON Bits
4408 extern __at(0x0FB6) __sfr CCP2CON;
4410 typedef union
4412 struct
4414 unsigned CCP2M0 : 1;
4415 unsigned CCP2M1 : 1;
4416 unsigned CCP2M2 : 1;
4417 unsigned CCP2M3 : 1;
4418 unsigned DC2B0 : 1;
4419 unsigned DC2B1 : 1;
4420 unsigned P2M0 : 1;
4421 unsigned P2M1 : 1;
4424 struct
4426 unsigned : 1;
4427 unsigned : 1;
4428 unsigned : 1;
4429 unsigned : 1;
4430 unsigned CCP2Y : 1;
4431 unsigned CCP2X : 1;
4432 unsigned : 1;
4433 unsigned : 1;
4436 struct
4438 unsigned CCP2M : 4;
4439 unsigned : 4;
4442 struct
4444 unsigned : 4;
4445 unsigned DC2B : 2;
4446 unsigned : 2;
4449 struct
4451 unsigned : 6;
4452 unsigned P2M : 2;
4454 } __CCP2CONbits_t;
4456 extern __at(0x0FB6) volatile __CCP2CONbits_t CCP2CONbits;
4458 #define _CCP2M0 0x01
4459 #define _CCP2M1 0x02
4460 #define _CCP2M2 0x04
4461 #define _CCP2M3 0x08
4462 #define _DC2B0 0x10
4463 #define _CCP2Y 0x10
4464 #define _DC2B1 0x20
4465 #define _CCP2X 0x20
4466 #define _P2M0 0x40
4467 #define _P2M1 0x80
4469 //==============================================================================
4472 //==============================================================================
4473 // ECCP2CON Bits
4475 extern __at(0x0FB6) __sfr ECCP2CON;
4477 typedef union
4479 struct
4481 unsigned CCP2M0 : 1;
4482 unsigned CCP2M1 : 1;
4483 unsigned CCP2M2 : 1;
4484 unsigned CCP2M3 : 1;
4485 unsigned DC2B0 : 1;
4486 unsigned DC2B1 : 1;
4487 unsigned P2M0 : 1;
4488 unsigned P2M1 : 1;
4491 struct
4493 unsigned : 1;
4494 unsigned : 1;
4495 unsigned : 1;
4496 unsigned : 1;
4497 unsigned CCP2Y : 1;
4498 unsigned CCP2X : 1;
4499 unsigned : 1;
4500 unsigned : 1;
4503 struct
4505 unsigned CCP2M : 4;
4506 unsigned : 4;
4509 struct
4511 unsigned : 4;
4512 unsigned DC2B : 2;
4513 unsigned : 2;
4516 struct
4518 unsigned : 6;
4519 unsigned P2M : 2;
4521 } __ECCP2CONbits_t;
4523 extern __at(0x0FB6) volatile __ECCP2CONbits_t ECCP2CONbits;
4525 #define _ECCP2CON_CCP2M0 0x01
4526 #define _ECCP2CON_CCP2M1 0x02
4527 #define _ECCP2CON_CCP2M2 0x04
4528 #define _ECCP2CON_CCP2M3 0x08
4529 #define _ECCP2CON_DC2B0 0x10
4530 #define _ECCP2CON_CCP2Y 0x10
4531 #define _ECCP2CON_DC2B1 0x20
4532 #define _ECCP2CON_CCP2X 0x20
4533 #define _ECCP2CON_P2M0 0x40
4534 #define _ECCP2CON_P2M1 0x80
4536 //==============================================================================
4538 extern __at(0x0FB7) __sfr CCPR2;
4539 extern __at(0x0FB7) __sfr CCPR2L;
4540 extern __at(0x0FB8) __sfr CCPR2H;
4542 //==============================================================================
4543 // ECCP2DEL Bits
4545 extern __at(0x0FB9) __sfr ECCP2DEL;
4547 typedef union
4549 struct
4551 unsigned PDC0 : 1;
4552 unsigned PDC1 : 1;
4553 unsigned PDC2 : 1;
4554 unsigned PDC3 : 1;
4555 unsigned PDC4 : 1;
4556 unsigned PDC5 : 1;
4557 unsigned PDC6 : 1;
4558 unsigned PRSEN : 1;
4561 struct
4563 unsigned P2DC0 : 1;
4564 unsigned P2DC1 : 1;
4565 unsigned P2DC2 : 1;
4566 unsigned P2DC3 : 1;
4567 unsigned P2DC4 : 1;
4568 unsigned P2DC5 : 1;
4569 unsigned P2DC6 : 1;
4570 unsigned P2RSEN : 1;
4573 struct
4575 unsigned PDC : 7;
4576 unsigned : 1;
4579 struct
4581 unsigned P2DC : 7;
4582 unsigned : 1;
4584 } __ECCP2DELbits_t;
4586 extern __at(0x0FB9) volatile __ECCP2DELbits_t ECCP2DELbits;
4588 #define _ECCP2DEL_PDC0 0x01
4589 #define _ECCP2DEL_P2DC0 0x01
4590 #define _ECCP2DEL_PDC1 0x02
4591 #define _ECCP2DEL_P2DC1 0x02
4592 #define _ECCP2DEL_PDC2 0x04
4593 #define _ECCP2DEL_P2DC2 0x04
4594 #define _ECCP2DEL_PDC3 0x08
4595 #define _ECCP2DEL_P2DC3 0x08
4596 #define _ECCP2DEL_PDC4 0x10
4597 #define _ECCP2DEL_P2DC4 0x10
4598 #define _ECCP2DEL_PDC5 0x20
4599 #define _ECCP2DEL_P2DC5 0x20
4600 #define _ECCP2DEL_PDC6 0x40
4601 #define _ECCP2DEL_P2DC6 0x40
4602 #define _ECCP2DEL_PRSEN 0x80
4603 #define _ECCP2DEL_P2RSEN 0x80
4605 //==============================================================================
4608 //==============================================================================
4609 // ECCP2AS Bits
4611 extern __at(0x0FBA) __sfr ECCP2AS;
4613 typedef union
4615 struct
4617 unsigned PSSBD0 : 1;
4618 unsigned PSSBD1 : 1;
4619 unsigned PSSAC0 : 1;
4620 unsigned PSSAC1 : 1;
4621 unsigned ECCPAS0 : 1;
4622 unsigned ECCPAS1 : 1;
4623 unsigned ECCPAS2 : 1;
4624 unsigned ECCPASE : 1;
4627 struct
4629 unsigned PSS2BD0 : 1;
4630 unsigned PSS2BD1 : 1;
4631 unsigned PSS2AC0 : 1;
4632 unsigned PSS2AC1 : 1;
4633 unsigned ECCP2AS0 : 1;
4634 unsigned ECCP2AS1 : 1;
4635 unsigned ECCP2AS2 : 1;
4636 unsigned ECCP2ASE : 1;
4639 struct
4641 unsigned PSSBD : 2;
4642 unsigned : 6;
4645 struct
4647 unsigned PSS2BD : 2;
4648 unsigned : 6;
4651 struct
4653 unsigned : 2;
4654 unsigned PSS2AC : 2;
4655 unsigned : 4;
4658 struct
4660 unsigned : 2;
4661 unsigned PSSAC : 2;
4662 unsigned : 4;
4665 struct
4667 unsigned : 4;
4668 unsigned ECCP2AS : 3;
4669 unsigned : 1;
4672 struct
4674 unsigned : 4;
4675 unsigned ECCPAS : 3;
4676 unsigned : 1;
4678 } __ECCP2ASbits_t;
4680 extern __at(0x0FBA) volatile __ECCP2ASbits_t ECCP2ASbits;
4682 #define _ECCP2AS_PSSBD0 0x01
4683 #define _ECCP2AS_PSS2BD0 0x01
4684 #define _ECCP2AS_PSSBD1 0x02
4685 #define _ECCP2AS_PSS2BD1 0x02
4686 #define _ECCP2AS_PSSAC0 0x04
4687 #define _ECCP2AS_PSS2AC0 0x04
4688 #define _ECCP2AS_PSSAC1 0x08
4689 #define _ECCP2AS_PSS2AC1 0x08
4690 #define _ECCP2AS_ECCPAS0 0x10
4691 #define _ECCP2AS_ECCP2AS0 0x10
4692 #define _ECCP2AS_ECCPAS1 0x20
4693 #define _ECCP2AS_ECCP2AS1 0x20
4694 #define _ECCP2AS_ECCPAS2 0x40
4695 #define _ECCP2AS_ECCP2AS2 0x40
4696 #define _ECCP2AS_ECCPASE 0x80
4697 #define _ECCP2AS_ECCP2ASE 0x80
4699 //==============================================================================
4702 //==============================================================================
4703 // CCP1CON Bits
4705 extern __at(0x0FBB) __sfr CCP1CON;
4707 typedef union
4709 struct
4711 unsigned CCP1M0 : 1;
4712 unsigned CCP1M1 : 1;
4713 unsigned CCP1M2 : 1;
4714 unsigned CCP1M3 : 1;
4715 unsigned DC1B0 : 1;
4716 unsigned DC1B1 : 1;
4717 unsigned P1M0 : 1;
4718 unsigned P1M1 : 1;
4721 struct
4723 unsigned : 1;
4724 unsigned : 1;
4725 unsigned : 1;
4726 unsigned : 1;
4727 unsigned CCP1Y : 1;
4728 unsigned CCP1X : 1;
4729 unsigned : 1;
4730 unsigned : 1;
4733 struct
4735 unsigned CCP1M : 4;
4736 unsigned : 4;
4739 struct
4741 unsigned : 4;
4742 unsigned DC1B : 2;
4743 unsigned : 2;
4746 struct
4748 unsigned : 6;
4749 unsigned P1M : 2;
4751 } __CCP1CONbits_t;
4753 extern __at(0x0FBB) volatile __CCP1CONbits_t CCP1CONbits;
4755 #define _CCP1M0 0x01
4756 #define _CCP1M1 0x02
4757 #define _CCP1M2 0x04
4758 #define _CCP1M3 0x08
4759 #define _DC1B0 0x10
4760 #define _CCP1Y 0x10
4761 #define _DC1B1 0x20
4762 #define _CCP1X 0x20
4763 #define _P1M0 0x40
4764 #define _P1M1 0x80
4766 //==============================================================================
4769 //==============================================================================
4770 // ECCP1CON Bits
4772 extern __at(0x0FBB) __sfr ECCP1CON;
4774 typedef union
4776 struct
4778 unsigned CCP1M0 : 1;
4779 unsigned CCP1M1 : 1;
4780 unsigned CCP1M2 : 1;
4781 unsigned CCP1M3 : 1;
4782 unsigned DC1B0 : 1;
4783 unsigned DC1B1 : 1;
4784 unsigned P1M0 : 1;
4785 unsigned P1M1 : 1;
4788 struct
4790 unsigned : 1;
4791 unsigned : 1;
4792 unsigned : 1;
4793 unsigned : 1;
4794 unsigned CCP1Y : 1;
4795 unsigned CCP1X : 1;
4796 unsigned : 1;
4797 unsigned : 1;
4800 struct
4802 unsigned CCP1M : 4;
4803 unsigned : 4;
4806 struct
4808 unsigned : 4;
4809 unsigned DC1B : 2;
4810 unsigned : 2;
4813 struct
4815 unsigned : 6;
4816 unsigned P1M : 2;
4818 } __ECCP1CONbits_t;
4820 extern __at(0x0FBB) volatile __ECCP1CONbits_t ECCP1CONbits;
4822 #define _ECCP1CON_CCP1M0 0x01
4823 #define _ECCP1CON_CCP1M1 0x02
4824 #define _ECCP1CON_CCP1M2 0x04
4825 #define _ECCP1CON_CCP1M3 0x08
4826 #define _ECCP1CON_DC1B0 0x10
4827 #define _ECCP1CON_CCP1Y 0x10
4828 #define _ECCP1CON_DC1B1 0x20
4829 #define _ECCP1CON_CCP1X 0x20
4830 #define _ECCP1CON_P1M0 0x40
4831 #define _ECCP1CON_P1M1 0x80
4833 //==============================================================================
4835 extern __at(0x0FBC) __sfr CCPR1;
4836 extern __at(0x0FBC) __sfr CCPR1L;
4837 extern __at(0x0FBD) __sfr CCPR1H;
4839 //==============================================================================
4840 // ECCP1DEL Bits
4842 extern __at(0x0FBE) __sfr ECCP1DEL;
4844 typedef union
4846 struct
4848 unsigned PDC0 : 1;
4849 unsigned PDC1 : 1;
4850 unsigned PDC2 : 1;
4851 unsigned PDC3 : 1;
4852 unsigned PDC4 : 1;
4853 unsigned PDC5 : 1;
4854 unsigned PDC6 : 1;
4855 unsigned PRSEN : 1;
4858 struct
4860 unsigned P1DC0 : 1;
4861 unsigned P1DC1 : 1;
4862 unsigned P1DC2 : 1;
4863 unsigned P1DC3 : 1;
4864 unsigned P1DC4 : 1;
4865 unsigned P1DC5 : 1;
4866 unsigned P1DC6 : 1;
4867 unsigned P1RSEN : 1;
4870 struct
4872 unsigned P1DC : 7;
4873 unsigned : 1;
4876 struct
4878 unsigned PDC : 7;
4879 unsigned : 1;
4881 } __ECCP1DELbits_t;
4883 extern __at(0x0FBE) volatile __ECCP1DELbits_t ECCP1DELbits;
4885 #define _PDC0 0x01
4886 #define _P1DC0 0x01
4887 #define _PDC1 0x02
4888 #define _P1DC1 0x02
4889 #define _PDC2 0x04
4890 #define _P1DC2 0x04
4891 #define _PDC3 0x08
4892 #define _P1DC3 0x08
4893 #define _PDC4 0x10
4894 #define _P1DC4 0x10
4895 #define _PDC5 0x20
4896 #define _P1DC5 0x20
4897 #define _PDC6 0x40
4898 #define _P1DC6 0x40
4899 #define _PRSEN 0x80
4900 #define _P1RSEN 0x80
4902 //==============================================================================
4905 //==============================================================================
4906 // ECCP1AS Bits
4908 extern __at(0x0FBF) __sfr ECCP1AS;
4910 typedef union
4912 struct
4914 unsigned PSSBD0 : 1;
4915 unsigned PSSBD1 : 1;
4916 unsigned PSSAC0 : 1;
4917 unsigned PSSAC1 : 1;
4918 unsigned ECCPAS0 : 1;
4919 unsigned ECCPAS1 : 1;
4920 unsigned ECCPAS2 : 1;
4921 unsigned ECCPASE : 1;
4924 struct
4926 unsigned PSS1BD0 : 1;
4927 unsigned PSS1BD1 : 1;
4928 unsigned PSS1AC0 : 1;
4929 unsigned PSS1AC1 : 1;
4930 unsigned ECCP1AS0 : 1;
4931 unsigned ECCP1AS1 : 1;
4932 unsigned ECCP1AS2 : 1;
4933 unsigned ECCP1ASE : 1;
4936 struct
4938 unsigned PSSBD : 2;
4939 unsigned : 6;
4942 struct
4944 unsigned PSS1BD : 2;
4945 unsigned : 6;
4948 struct
4950 unsigned : 2;
4951 unsigned PSS1AC : 2;
4952 unsigned : 4;
4955 struct
4957 unsigned : 2;
4958 unsigned PSSAC : 2;
4959 unsigned : 4;
4962 struct
4964 unsigned : 4;
4965 unsigned ECCP1AS : 3;
4966 unsigned : 1;
4969 struct
4971 unsigned : 4;
4972 unsigned ECCPAS : 3;
4973 unsigned : 1;
4975 } __ECCP1ASbits_t;
4977 extern __at(0x0FBF) volatile __ECCP1ASbits_t ECCP1ASbits;
4979 #define _PSSBD0 0x01
4980 #define _PSS1BD0 0x01
4981 #define _PSSBD1 0x02
4982 #define _PSS1BD1 0x02
4983 #define _PSSAC0 0x04
4984 #define _PSS1AC0 0x04
4985 #define _PSSAC1 0x08
4986 #define _PSS1AC1 0x08
4987 #define _ECCPAS0 0x10
4988 #define _ECCP1AS0 0x10
4989 #define _ECCPAS1 0x20
4990 #define _ECCP1AS1 0x20
4991 #define _ECCPAS2 0x40
4992 #define _ECCP1AS2 0x40
4993 #define _ECCPASE 0x80
4994 #define _ECCP1ASE 0x80
4996 //==============================================================================
4999 //==============================================================================
5000 // WDTCON Bits
5002 extern __at(0x0FC0) __sfr WDTCON;
5004 typedef union
5006 struct
5008 unsigned SWDTEN : 1;
5009 unsigned : 1;
5010 unsigned : 1;
5011 unsigned : 1;
5012 unsigned ADSHR : 1;
5013 unsigned : 1;
5014 unsigned LVDSTAT : 1;
5015 unsigned REGSLP : 1;
5018 struct
5020 unsigned SWDTE : 1;
5021 unsigned : 1;
5022 unsigned : 1;
5023 unsigned : 1;
5024 unsigned DEVCFG : 1;
5025 unsigned : 1;
5026 unsigned : 1;
5027 unsigned : 1;
5029 } __WDTCONbits_t;
5031 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
5033 #define _SWDTEN 0x01
5034 #define _SWDTE 0x01
5035 #define _ADSHR 0x10
5036 #define _DEVCFG 0x10
5037 #define _LVDSTAT 0x40
5038 #define _REGSLP 0x80
5040 //==============================================================================
5043 //==============================================================================
5044 // ADCON1 Bits
5046 extern __at(0x0FC1) __sfr ADCON1;
5048 typedef union
5050 struct
5052 unsigned ADCS0 : 1;
5053 unsigned ADCS1 : 1;
5054 unsigned ADCS2 : 1;
5055 unsigned ACQT0 : 1;
5056 unsigned ACQT1 : 1;
5057 unsigned ACQT2 : 1;
5058 unsigned ADCAL : 1;
5059 unsigned ADFM : 1;
5062 struct
5064 unsigned ADCS : 3;
5065 unsigned : 5;
5068 struct
5070 unsigned : 3;
5071 unsigned ACQT : 3;
5072 unsigned : 2;
5074 } __ADCON1bits_t;
5076 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5078 #define _ADCS0 0x01
5079 #define _ADCS1 0x02
5080 #define _ADCS2 0x04
5081 #define _ACQT0 0x08
5082 #define _ACQT1 0x10
5083 #define _ACQT2 0x20
5084 #define _ADCAL 0x40
5085 #define _ADFM 0x80
5087 //==============================================================================
5090 //==============================================================================
5091 // ANCON0 Bits
5093 extern __at(0x0FC1) __sfr ANCON0;
5095 typedef struct
5097 unsigned PCFG0 : 1;
5098 unsigned PCFG1 : 1;
5099 unsigned PCFG2 : 1;
5100 unsigned PCFG3 : 1;
5101 unsigned PCFG4 : 1;
5102 unsigned : 1;
5103 unsigned PCFG6 : 1;
5104 unsigned PCFG7 : 1;
5105 } __ANCON0bits_t;
5107 extern __at(0x0FC1) volatile __ANCON0bits_t ANCON0bits;
5109 #define _PCFG0 0x01
5110 #define _PCFG1 0x02
5111 #define _PCFG2 0x04
5112 #define _PCFG3 0x08
5113 #define _PCFG4 0x10
5114 #define _PCFG6 0x40
5115 #define _PCFG7 0x80
5117 //==============================================================================
5120 //==============================================================================
5121 // ADCON0 Bits
5123 extern __at(0x0FC2) __sfr ADCON0;
5125 typedef union
5127 struct
5129 unsigned ADON : 1;
5130 unsigned GO_NOT_DONE : 1;
5131 unsigned CHS0 : 1;
5132 unsigned CHS1 : 1;
5133 unsigned CHS2 : 1;
5134 unsigned CHS3 : 1;
5135 unsigned VCFG0 : 1;
5136 unsigned VCFG1 : 1;
5139 struct
5141 unsigned : 1;
5142 unsigned DONE : 1;
5143 unsigned : 1;
5144 unsigned : 1;
5145 unsigned : 1;
5146 unsigned : 1;
5147 unsigned : 1;
5148 unsigned : 1;
5151 struct
5153 unsigned : 1;
5154 unsigned GO_DONE : 1;
5155 unsigned : 1;
5156 unsigned : 1;
5157 unsigned : 1;
5158 unsigned : 1;
5159 unsigned : 1;
5160 unsigned : 1;
5163 struct
5165 unsigned : 1;
5166 unsigned GO : 1;
5167 unsigned : 1;
5168 unsigned : 1;
5169 unsigned : 1;
5170 unsigned : 1;
5171 unsigned : 1;
5172 unsigned : 1;
5175 struct
5177 unsigned : 1;
5178 unsigned NOT_DONE : 1;
5179 unsigned : 1;
5180 unsigned : 1;
5181 unsigned : 1;
5182 unsigned : 1;
5183 unsigned : 1;
5184 unsigned : 1;
5187 struct
5189 unsigned : 2;
5190 unsigned CHS : 4;
5191 unsigned : 2;
5194 struct
5196 unsigned : 6;
5197 unsigned VCFG : 2;
5199 } __ADCON0bits_t;
5201 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5203 #define _ADON 0x01
5204 #define _GO_NOT_DONE 0x02
5205 #define _DONE 0x02
5206 #define _GO_DONE 0x02
5207 #define _GO 0x02
5208 #define _NOT_DONE 0x02
5209 #define _CHS0 0x04
5210 #define _CHS1 0x08
5211 #define _CHS2 0x10
5212 #define _CHS3 0x20
5213 #define _VCFG0 0x40
5214 #define _VCFG1 0x80
5216 //==============================================================================
5219 //==============================================================================
5220 // ANCON1 Bits
5222 extern __at(0x0FC2) __sfr ANCON1;
5224 typedef struct
5226 unsigned PCFG8 : 1;
5227 unsigned PCFG9 : 1;
5228 unsigned PCFG10 : 1;
5229 unsigned PCFG11 : 1;
5230 unsigned PCFG12 : 1;
5231 unsigned PCFG13 : 1;
5232 unsigned PCFG14 : 1;
5233 unsigned PCFG15 : 1;
5234 } __ANCON1bits_t;
5236 extern __at(0x0FC2) volatile __ANCON1bits_t ANCON1bits;
5238 #define _PCFG8 0x01
5239 #define _PCFG9 0x02
5240 #define _PCFG10 0x04
5241 #define _PCFG11 0x08
5242 #define _PCFG12 0x10
5243 #define _PCFG13 0x20
5244 #define _PCFG14 0x40
5245 #define _PCFG15 0x80
5247 //==============================================================================
5249 extern __at(0x0FC3) __sfr ADRES;
5250 extern __at(0x0FC3) __sfr ADRESL;
5251 extern __at(0x0FC4) __sfr ADRESH;
5253 //==============================================================================
5254 // SSP1CON2 Bits
5256 extern __at(0x0FC5) __sfr SSP1CON2;
5258 typedef union
5260 struct
5262 unsigned SEN : 1;
5263 unsigned RSEN : 1;
5264 unsigned PEN : 1;
5265 unsigned RCEN : 1;
5266 unsigned ACKEN : 1;
5267 unsigned ACKDT : 1;
5268 unsigned ACKSTAT : 1;
5269 unsigned GCEN : 1;
5272 struct
5274 unsigned : 1;
5275 unsigned ADMSK1 : 1;
5276 unsigned ADMSK2 : 1;
5277 unsigned ADMSK3 : 1;
5278 unsigned ADMSK4 : 1;
5279 unsigned ADMSK5 : 1;
5280 unsigned : 1;
5281 unsigned : 1;
5283 } __SSP1CON2bits_t;
5285 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5287 #define _SEN 0x01
5288 #define _RSEN 0x02
5289 #define _ADMSK1 0x02
5290 #define _PEN 0x04
5291 #define _ADMSK2 0x04
5292 #define _RCEN 0x08
5293 #define _ADMSK3 0x08
5294 #define _ACKEN 0x10
5295 #define _ADMSK4 0x10
5296 #define _ACKDT 0x20
5297 #define _ADMSK5 0x20
5298 #define _ACKSTAT 0x40
5299 #define _GCEN 0x80
5301 //==============================================================================
5304 //==============================================================================
5305 // SSPCON2 Bits
5307 extern __at(0x0FC5) __sfr SSPCON2;
5309 typedef union
5311 struct
5313 unsigned SEN : 1;
5314 unsigned RSEN : 1;
5315 unsigned PEN : 1;
5316 unsigned RCEN : 1;
5317 unsigned ACKEN : 1;
5318 unsigned ACKDT : 1;
5319 unsigned ACKSTAT : 1;
5320 unsigned GCEN : 1;
5323 struct
5325 unsigned : 1;
5326 unsigned ADMSK1 : 1;
5327 unsigned ADMSK2 : 1;
5328 unsigned ADMSK3 : 1;
5329 unsigned ADMSK4 : 1;
5330 unsigned ADMSK5 : 1;
5331 unsigned : 1;
5332 unsigned : 1;
5334 } __SSPCON2bits_t;
5336 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5338 #define _SSPCON2_SEN 0x01
5339 #define _SSPCON2_RSEN 0x02
5340 #define _SSPCON2_ADMSK1 0x02
5341 #define _SSPCON2_PEN 0x04
5342 #define _SSPCON2_ADMSK2 0x04
5343 #define _SSPCON2_RCEN 0x08
5344 #define _SSPCON2_ADMSK3 0x08
5345 #define _SSPCON2_ACKEN 0x10
5346 #define _SSPCON2_ADMSK4 0x10
5347 #define _SSPCON2_ACKDT 0x20
5348 #define _SSPCON2_ADMSK5 0x20
5349 #define _SSPCON2_ACKSTAT 0x40
5350 #define _SSPCON2_GCEN 0x80
5352 //==============================================================================
5355 //==============================================================================
5356 // SSP1CON1 Bits
5358 extern __at(0x0FC6) __sfr SSP1CON1;
5360 typedef union
5362 struct
5364 unsigned SSPM0 : 1;
5365 unsigned SSPM1 : 1;
5366 unsigned SSPM2 : 1;
5367 unsigned SSPM3 : 1;
5368 unsigned CKP : 1;
5369 unsigned SSPEN : 1;
5370 unsigned SSPOV : 1;
5371 unsigned WCOL : 1;
5374 struct
5376 unsigned SSPM : 4;
5377 unsigned : 4;
5379 } __SSP1CON1bits_t;
5381 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5383 #define _SSPM0 0x01
5384 #define _SSPM1 0x02
5385 #define _SSPM2 0x04
5386 #define _SSPM3 0x08
5387 #define _CKP 0x10
5388 #define _SSPEN 0x20
5389 #define _SSPOV 0x40
5390 #define _WCOL 0x80
5392 //==============================================================================
5395 //==============================================================================
5396 // SSPCON1 Bits
5398 extern __at(0x0FC6) __sfr SSPCON1;
5400 typedef union
5402 struct
5404 unsigned SSPM0 : 1;
5405 unsigned SSPM1 : 1;
5406 unsigned SSPM2 : 1;
5407 unsigned SSPM3 : 1;
5408 unsigned CKP : 1;
5409 unsigned SSPEN : 1;
5410 unsigned SSPOV : 1;
5411 unsigned WCOL : 1;
5414 struct
5416 unsigned SSPM : 4;
5417 unsigned : 4;
5419 } __SSPCON1bits_t;
5421 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5423 #define _SSPCON1_SSPM0 0x01
5424 #define _SSPCON1_SSPM1 0x02
5425 #define _SSPCON1_SSPM2 0x04
5426 #define _SSPCON1_SSPM3 0x08
5427 #define _SSPCON1_CKP 0x10
5428 #define _SSPCON1_SSPEN 0x20
5429 #define _SSPCON1_SSPOV 0x40
5430 #define _SSPCON1_WCOL 0x80
5432 //==============================================================================
5435 //==============================================================================
5436 // SSP1STAT Bits
5438 extern __at(0x0FC7) __sfr SSP1STAT;
5440 typedef union
5442 struct
5444 unsigned BF : 1;
5445 unsigned UA : 1;
5446 unsigned R_NOT_W : 1;
5447 unsigned S : 1;
5448 unsigned P : 1;
5449 unsigned D_NOT_A : 1;
5450 unsigned CKE : 1;
5451 unsigned SMP : 1;
5454 struct
5456 unsigned : 1;
5457 unsigned : 1;
5458 unsigned R_W : 1;
5459 unsigned I2C_START : 1;
5460 unsigned I2C_STOP : 1;
5461 unsigned D_A : 1;
5462 unsigned : 1;
5463 unsigned : 1;
5466 struct
5468 unsigned : 1;
5469 unsigned : 1;
5470 unsigned I2C_READ : 1;
5471 unsigned : 1;
5472 unsigned : 1;
5473 unsigned I2C_DAT : 1;
5474 unsigned : 1;
5475 unsigned : 1;
5478 struct
5480 unsigned : 1;
5481 unsigned : 1;
5482 unsigned NOT_W : 1;
5483 unsigned : 1;
5484 unsigned : 1;
5485 unsigned NOT_A : 1;
5486 unsigned : 1;
5487 unsigned : 1;
5490 struct
5492 unsigned : 1;
5493 unsigned : 1;
5494 unsigned NOT_WRITE : 1;
5495 unsigned : 1;
5496 unsigned : 1;
5497 unsigned NOT_ADDRESS : 1;
5498 unsigned : 1;
5499 unsigned : 1;
5502 struct
5504 unsigned : 1;
5505 unsigned : 1;
5506 unsigned READ_WRITE : 1;
5507 unsigned : 1;
5508 unsigned : 1;
5509 unsigned DATA_ADDRESS : 1;
5510 unsigned : 1;
5511 unsigned : 1;
5514 struct
5516 unsigned : 1;
5517 unsigned : 1;
5518 unsigned R : 1;
5519 unsigned : 1;
5520 unsigned : 1;
5521 unsigned D : 1;
5522 unsigned : 1;
5523 unsigned : 1;
5525 } __SSP1STATbits_t;
5527 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5529 #define _BF 0x01
5530 #define _UA 0x02
5531 #define _R_NOT_W 0x04
5532 #define _R_W 0x04
5533 #define _I2C_READ 0x04
5534 #define _NOT_W 0x04
5535 #define _NOT_WRITE 0x04
5536 #define _READ_WRITE 0x04
5537 #define _R 0x04
5538 #define _S 0x08
5539 #define _I2C_START 0x08
5540 #define _P 0x10
5541 #define _I2C_STOP 0x10
5542 #define _D_NOT_A 0x20
5543 #define _D_A 0x20
5544 #define _I2C_DAT 0x20
5545 #define _NOT_A 0x20
5546 #define _NOT_ADDRESS 0x20
5547 #define _DATA_ADDRESS 0x20
5548 #define _D 0x20
5549 #define _CKE 0x40
5550 #define _SMP 0x80
5552 //==============================================================================
5555 //==============================================================================
5556 // SSPSTAT Bits
5558 extern __at(0x0FC7) __sfr SSPSTAT;
5560 typedef union
5562 struct
5564 unsigned BF : 1;
5565 unsigned UA : 1;
5566 unsigned R_NOT_W : 1;
5567 unsigned S : 1;
5568 unsigned P : 1;
5569 unsigned D_NOT_A : 1;
5570 unsigned CKE : 1;
5571 unsigned SMP : 1;
5574 struct
5576 unsigned : 1;
5577 unsigned : 1;
5578 unsigned R_W : 1;
5579 unsigned I2C_START : 1;
5580 unsigned I2C_STOP : 1;
5581 unsigned D_A : 1;
5582 unsigned : 1;
5583 unsigned : 1;
5586 struct
5588 unsigned : 1;
5589 unsigned : 1;
5590 unsigned I2C_READ : 1;
5591 unsigned : 1;
5592 unsigned : 1;
5593 unsigned I2C_DAT : 1;
5594 unsigned : 1;
5595 unsigned : 1;
5598 struct
5600 unsigned : 1;
5601 unsigned : 1;
5602 unsigned NOT_W : 1;
5603 unsigned : 1;
5604 unsigned : 1;
5605 unsigned NOT_A : 1;
5606 unsigned : 1;
5607 unsigned : 1;
5610 struct
5612 unsigned : 1;
5613 unsigned : 1;
5614 unsigned NOT_WRITE : 1;
5615 unsigned : 1;
5616 unsigned : 1;
5617 unsigned NOT_ADDRESS : 1;
5618 unsigned : 1;
5619 unsigned : 1;
5622 struct
5624 unsigned : 1;
5625 unsigned : 1;
5626 unsigned READ_WRITE : 1;
5627 unsigned : 1;
5628 unsigned : 1;
5629 unsigned DATA_ADDRESS : 1;
5630 unsigned : 1;
5631 unsigned : 1;
5634 struct
5636 unsigned : 1;
5637 unsigned : 1;
5638 unsigned R : 1;
5639 unsigned : 1;
5640 unsigned : 1;
5641 unsigned D : 1;
5642 unsigned : 1;
5643 unsigned : 1;
5645 } __SSPSTATbits_t;
5647 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5649 #define _SSPSTAT_BF 0x01
5650 #define _SSPSTAT_UA 0x02
5651 #define _SSPSTAT_R_NOT_W 0x04
5652 #define _SSPSTAT_R_W 0x04
5653 #define _SSPSTAT_I2C_READ 0x04
5654 #define _SSPSTAT_NOT_W 0x04
5655 #define _SSPSTAT_NOT_WRITE 0x04
5656 #define _SSPSTAT_READ_WRITE 0x04
5657 #define _SSPSTAT_R 0x04
5658 #define _SSPSTAT_S 0x08
5659 #define _SSPSTAT_I2C_START 0x08
5660 #define _SSPSTAT_P 0x10
5661 #define _SSPSTAT_I2C_STOP 0x10
5662 #define _SSPSTAT_D_NOT_A 0x20
5663 #define _SSPSTAT_D_A 0x20
5664 #define _SSPSTAT_I2C_DAT 0x20
5665 #define _SSPSTAT_NOT_A 0x20
5666 #define _SSPSTAT_NOT_ADDRESS 0x20
5667 #define _SSPSTAT_DATA_ADDRESS 0x20
5668 #define _SSPSTAT_D 0x20
5669 #define _SSPSTAT_CKE 0x40
5670 #define _SSPSTAT_SMP 0x80
5672 //==============================================================================
5674 extern __at(0x0FC8) __sfr SSP1ADD;
5676 //==============================================================================
5677 // SSP1MSK Bits
5679 extern __at(0x0FC8) __sfr SSP1MSK;
5681 typedef struct
5683 unsigned MSK0 : 1;
5684 unsigned MSK1 : 1;
5685 unsigned MSK2 : 1;
5686 unsigned MSK3 : 1;
5687 unsigned MSK4 : 1;
5688 unsigned MSK5 : 1;
5689 unsigned MSK6 : 1;
5690 unsigned MSK7 : 1;
5691 } __SSP1MSKbits_t;
5693 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
5695 #define _MSK0 0x01
5696 #define _MSK1 0x02
5697 #define _MSK2 0x04
5698 #define _MSK3 0x08
5699 #define _MSK4 0x10
5700 #define _MSK5 0x20
5701 #define _MSK6 0x40
5702 #define _MSK7 0x80
5704 //==============================================================================
5706 extern __at(0x0FC8) __sfr SSPADD;
5707 extern __at(0x0FC9) __sfr SSP1BUF;
5708 extern __at(0x0FC9) __sfr SSPBUF;
5710 //==============================================================================
5711 // T2CON Bits
5713 extern __at(0x0FCA) __sfr T2CON;
5715 typedef union
5717 struct
5719 unsigned T2CKPS0 : 1;
5720 unsigned T2CKPS1 : 1;
5721 unsigned TMR2ON : 1;
5722 unsigned T2OUTPS0 : 1;
5723 unsigned T2OUTPS1 : 1;
5724 unsigned T2OUTPS2 : 1;
5725 unsigned T2OUTPS3 : 1;
5726 unsigned : 1;
5729 struct
5731 unsigned T2CKPS : 2;
5732 unsigned : 6;
5735 struct
5737 unsigned : 3;
5738 unsigned T2OUTPS : 4;
5739 unsigned : 1;
5741 } __T2CONbits_t;
5743 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5745 #define _T2CKPS0 0x01
5746 #define _T2CKPS1 0x02
5747 #define _TMR2ON 0x04
5748 #define _T2OUTPS0 0x08
5749 #define _T2OUTPS1 0x10
5750 #define _T2OUTPS2 0x20
5751 #define _T2OUTPS3 0x40
5753 //==============================================================================
5756 //==============================================================================
5757 // MEMCON Bits
5759 extern __at(0x0FCB) __sfr MEMCON;
5761 typedef union
5763 struct
5765 unsigned WM0 : 1;
5766 unsigned WM1 : 1;
5767 unsigned : 1;
5768 unsigned : 1;
5769 unsigned WAIT0 : 1;
5770 unsigned WAIT1 : 1;
5771 unsigned : 1;
5772 unsigned EBDIS : 1;
5775 struct
5777 unsigned : 1;
5778 unsigned : 1;
5779 unsigned : 1;
5780 unsigned : 1;
5781 unsigned : 1;
5782 unsigned : 1;
5783 unsigned : 1;
5784 unsigned EDBIS : 1;
5787 struct
5789 unsigned WM : 2;
5790 unsigned : 6;
5793 struct
5795 unsigned : 4;
5796 unsigned WAIT : 2;
5797 unsigned : 2;
5799 } __MEMCONbits_t;
5801 extern __at(0x0FCB) volatile __MEMCONbits_t MEMCONbits;
5803 #define _WM0 0x01
5804 #define _WM1 0x02
5805 #define _WAIT0 0x10
5806 #define _WAIT1 0x20
5807 #define _EBDIS 0x80
5808 #define _EDBIS 0x80
5810 //==============================================================================
5812 extern __at(0x0FCB) __sfr PR2;
5814 //==============================================================================
5815 // PADCFG1 Bits
5817 extern __at(0x0FCC) __sfr PADCFG1;
5819 typedef union
5821 struct
5823 unsigned PMPTL : 1;
5824 unsigned : 1;
5825 unsigned : 1;
5826 unsigned : 1;
5827 unsigned : 1;
5828 unsigned : 1;
5829 unsigned : 1;
5830 unsigned : 1;
5833 struct
5835 unsigned PMPTTL : 1;
5836 unsigned : 1;
5837 unsigned : 1;
5838 unsigned : 1;
5839 unsigned : 1;
5840 unsigned : 1;
5841 unsigned : 1;
5842 unsigned : 1;
5844 } __PADCFG1bits_t;
5846 extern __at(0x0FCC) volatile __PADCFG1bits_t PADCFG1bits;
5848 #define _PMPTL 0x01
5849 #define _PMPTTL 0x01
5851 //==============================================================================
5853 extern __at(0x0FCC) __sfr TMR2;
5855 //==============================================================================
5856 // ODCON3 Bits
5858 extern __at(0x0FCD) __sfr ODCON3;
5860 typedef struct
5862 unsigned SPI1OD : 1;
5863 unsigned SPI2OD : 1;
5864 unsigned : 1;
5865 unsigned : 1;
5866 unsigned : 1;
5867 unsigned : 1;
5868 unsigned : 1;
5869 unsigned : 1;
5870 } __ODCON3bits_t;
5872 extern __at(0x0FCD) volatile __ODCON3bits_t ODCON3bits;
5874 #define _SPI1OD 0x01
5875 #define _SPI2OD 0x02
5877 //==============================================================================
5880 //==============================================================================
5881 // T1CON Bits
5883 extern __at(0x0FCD) __sfr T1CON;
5885 typedef union
5887 struct
5889 unsigned TMR1ON : 1;
5890 unsigned TMR1CS : 1;
5891 unsigned NOT_T1SYNC : 1;
5892 unsigned T1OSCEN : 1;
5893 unsigned T1CKPS0 : 1;
5894 unsigned T1CKPS1 : 1;
5895 unsigned T1RUN : 1;
5896 unsigned RD16 : 1;
5899 struct
5901 unsigned : 1;
5902 unsigned : 1;
5903 unsigned T1SYNC : 1;
5904 unsigned : 1;
5905 unsigned : 1;
5906 unsigned : 1;
5907 unsigned : 1;
5908 unsigned : 1;
5911 struct
5913 unsigned : 1;
5914 unsigned : 1;
5915 unsigned T1INSYNC : 1;
5916 unsigned : 1;
5917 unsigned : 1;
5918 unsigned : 1;
5919 unsigned : 1;
5920 unsigned : 1;
5923 struct
5925 unsigned : 4;
5926 unsigned T1CKPS : 2;
5927 unsigned : 2;
5929 } __T1CONbits_t;
5931 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5933 #define _TMR1ON 0x01
5934 #define _TMR1CS 0x02
5935 #define _NOT_T1SYNC 0x04
5936 #define _T1SYNC 0x04
5937 #define _T1INSYNC 0x04
5938 #define _T1OSCEN 0x08
5939 #define _T1CKPS0 0x10
5940 #define _T1CKPS1 0x20
5941 #define _T1RUN 0x40
5942 #define _RD16 0x80
5944 //==============================================================================
5947 //==============================================================================
5948 // ODCON2 Bits
5950 extern __at(0x0FCE) __sfr ODCON2;
5952 typedef union
5954 struct
5956 unsigned USART1OD : 1;
5957 unsigned USART2OD : 1;
5958 unsigned : 1;
5959 unsigned : 1;
5960 unsigned : 1;
5961 unsigned : 1;
5962 unsigned : 1;
5963 unsigned : 1;
5966 struct
5968 unsigned U1OD : 1;
5969 unsigned U2OD : 1;
5970 unsigned : 1;
5971 unsigned : 1;
5972 unsigned : 1;
5973 unsigned : 1;
5974 unsigned : 1;
5975 unsigned : 1;
5977 } __ODCON2bits_t;
5979 extern __at(0x0FCE) volatile __ODCON2bits_t ODCON2bits;
5981 #define _USART1OD 0x01
5982 #define _U1OD 0x01
5983 #define _USART2OD 0x02
5984 #define _U2OD 0x02
5986 //==============================================================================
5988 extern __at(0x0FCE) __sfr TMR1;
5989 extern __at(0x0FCE) __sfr TMR1L;
5991 //==============================================================================
5992 // ODCON1 Bits
5994 extern __at(0x0FCF) __sfr ODCON1;
5996 typedef struct
5998 unsigned ECCP1OD : 1;
5999 unsigned ECCP2OD : 1;
6000 unsigned ECCP3OD : 1;
6001 unsigned CCP4OD : 1;
6002 unsigned CCP5OD : 1;
6003 unsigned : 1;
6004 unsigned : 1;
6005 unsigned : 1;
6006 } __ODCON1bits_t;
6008 extern __at(0x0FCF) volatile __ODCON1bits_t ODCON1bits;
6010 #define _ECCP1OD 0x01
6011 #define _ECCP2OD 0x02
6012 #define _ECCP3OD 0x04
6013 #define _CCP4OD 0x08
6014 #define _CCP5OD 0x10
6016 //==============================================================================
6018 extern __at(0x0FCF) __sfr TMR1H;
6020 //==============================================================================
6021 // RCON Bits
6023 extern __at(0x0FD0) __sfr RCON;
6025 typedef union
6027 struct
6029 unsigned NOT_BOR : 1;
6030 unsigned NOT_POR : 1;
6031 unsigned NOT_PD : 1;
6032 unsigned NOT_TO : 1;
6033 unsigned NOT_RI : 1;
6034 unsigned NOT_CM : 1;
6035 unsigned : 1;
6036 unsigned IPEN : 1;
6039 struct
6041 unsigned BOR : 1;
6042 unsigned POR : 1;
6043 unsigned PD : 1;
6044 unsigned TO : 1;
6045 unsigned RI : 1;
6046 unsigned CM : 1;
6047 unsigned : 1;
6048 unsigned : 1;
6050 } __RCONbits_t;
6052 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6054 #define _NOT_BOR 0x01
6055 #define _BOR 0x01
6056 #define _NOT_POR 0x02
6057 #define _POR 0x02
6058 #define _NOT_PD 0x04
6059 #define _PD 0x04
6060 #define _NOT_TO 0x08
6061 #define _TO 0x08
6062 #define _NOT_RI 0x10
6063 #define _RI 0x10
6064 #define _NOT_CM 0x20
6065 #define _CM 0x20
6066 #define _IPEN 0x80
6068 //==============================================================================
6071 //==============================================================================
6072 // CM2CON Bits
6074 extern __at(0x0FD1) __sfr CM2CON;
6076 typedef union
6078 struct
6080 unsigned C1CH0 : 1;
6081 unsigned C1CH1 : 1;
6082 unsigned CREF : 1;
6083 unsigned EVPOL0 : 1;
6084 unsigned EVPOL1 : 1;
6085 unsigned CPOL : 1;
6086 unsigned COE : 1;
6087 unsigned CON : 1;
6090 struct
6092 unsigned CCH0 : 1;
6093 unsigned CCH1 : 1;
6094 unsigned : 1;
6095 unsigned : 1;
6096 unsigned : 1;
6097 unsigned : 1;
6098 unsigned : 1;
6099 unsigned : 1;
6102 struct
6104 unsigned CCH : 2;
6105 unsigned : 6;
6108 struct
6110 unsigned C1CH : 2;
6111 unsigned : 6;
6114 struct
6116 unsigned : 3;
6117 unsigned EVPOL : 2;
6118 unsigned : 3;
6120 } __CM2CONbits_t;
6122 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
6124 #define _CM2CON_C1CH0 0x01
6125 #define _CM2CON_CCH0 0x01
6126 #define _CM2CON_C1CH1 0x02
6127 #define _CM2CON_CCH1 0x02
6128 #define _CM2CON_CREF 0x04
6129 #define _CM2CON_EVPOL0 0x08
6130 #define _CM2CON_EVPOL1 0x10
6131 #define _CM2CON_CPOL 0x20
6132 #define _CM2CON_COE 0x40
6133 #define _CM2CON_CON 0x80
6135 //==============================================================================
6138 //==============================================================================
6139 // CM2CON1 Bits
6141 extern __at(0x0FD1) __sfr CM2CON1;
6143 typedef union
6145 struct
6147 unsigned C1CH0 : 1;
6148 unsigned C1CH1 : 1;
6149 unsigned CREF : 1;
6150 unsigned EVPOL0 : 1;
6151 unsigned EVPOL1 : 1;
6152 unsigned CPOL : 1;
6153 unsigned COE : 1;
6154 unsigned CON : 1;
6157 struct
6159 unsigned CCH0 : 1;
6160 unsigned CCH1 : 1;
6161 unsigned : 1;
6162 unsigned : 1;
6163 unsigned : 1;
6164 unsigned : 1;
6165 unsigned : 1;
6166 unsigned : 1;
6169 struct
6171 unsigned CCH : 2;
6172 unsigned : 6;
6175 struct
6177 unsigned C1CH : 2;
6178 unsigned : 6;
6181 struct
6183 unsigned : 3;
6184 unsigned EVPOL : 2;
6185 unsigned : 3;
6187 } __CM2CON1bits_t;
6189 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
6191 #define _CM2CON1_C1CH0 0x01
6192 #define _CM2CON1_CCH0 0x01
6193 #define _CM2CON1_C1CH1 0x02
6194 #define _CM2CON1_CCH1 0x02
6195 #define _CM2CON1_CREF 0x04
6196 #define _CM2CON1_EVPOL0 0x08
6197 #define _CM2CON1_EVPOL1 0x10
6198 #define _CM2CON1_CPOL 0x20
6199 #define _CM2CON1_COE 0x40
6200 #define _CM2CON1_CON 0x80
6202 //==============================================================================
6205 //==============================================================================
6206 // CM1CON Bits
6208 extern __at(0x0FD2) __sfr CM1CON;
6210 typedef union
6212 struct
6214 unsigned C1CH0 : 1;
6215 unsigned C1CH1 : 1;
6216 unsigned CREF : 1;
6217 unsigned EVPOL0 : 1;
6218 unsigned EVPOL1 : 1;
6219 unsigned CPOL : 1;
6220 unsigned COE : 1;
6221 unsigned CON : 1;
6224 struct
6226 unsigned CCH0 : 1;
6227 unsigned CCH1 : 1;
6228 unsigned : 1;
6229 unsigned : 1;
6230 unsigned : 1;
6231 unsigned : 1;
6232 unsigned : 1;
6233 unsigned : 1;
6236 struct
6238 unsigned CCH : 2;
6239 unsigned : 6;
6242 struct
6244 unsigned C1CH : 2;
6245 unsigned : 6;
6248 struct
6250 unsigned : 3;
6251 unsigned EVPOL : 2;
6252 unsigned : 3;
6254 } __CM1CONbits_t;
6256 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
6258 #define _C1CH0 0x01
6259 #define _CCH0 0x01
6260 #define _C1CH1 0x02
6261 #define _CCH1 0x02
6262 #define _CREF 0x04
6263 #define _EVPOL0 0x08
6264 #define _EVPOL1 0x10
6265 #define _CPOL 0x20
6266 #define _COE 0x40
6267 #define _CON 0x80
6269 //==============================================================================
6272 //==============================================================================
6273 // CM1CON1 Bits
6275 extern __at(0x0FD2) __sfr CM1CON1;
6277 typedef union
6279 struct
6281 unsigned C1CH0 : 1;
6282 unsigned C1CH1 : 1;
6283 unsigned CREF : 1;
6284 unsigned EVPOL0 : 1;
6285 unsigned EVPOL1 : 1;
6286 unsigned CPOL : 1;
6287 unsigned COE : 1;
6288 unsigned CON : 1;
6291 struct
6293 unsigned CCH0 : 1;
6294 unsigned CCH1 : 1;
6295 unsigned : 1;
6296 unsigned : 1;
6297 unsigned : 1;
6298 unsigned : 1;
6299 unsigned : 1;
6300 unsigned : 1;
6303 struct
6305 unsigned C1CH : 2;
6306 unsigned : 6;
6309 struct
6311 unsigned CCH : 2;
6312 unsigned : 6;
6315 struct
6317 unsigned : 3;
6318 unsigned EVPOL : 2;
6319 unsigned : 3;
6321 } __CM1CON1bits_t;
6323 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
6325 #define _CM1CON1_C1CH0 0x01
6326 #define _CM1CON1_CCH0 0x01
6327 #define _CM1CON1_C1CH1 0x02
6328 #define _CM1CON1_CCH1 0x02
6329 #define _CM1CON1_CREF 0x04
6330 #define _CM1CON1_EVPOL0 0x08
6331 #define _CM1CON1_EVPOL1 0x10
6332 #define _CM1CON1_CPOL 0x20
6333 #define _CM1CON1_COE 0x40
6334 #define _CM1CON1_CON 0x80
6336 //==============================================================================
6339 //==============================================================================
6340 // OSCCON Bits
6342 extern __at(0x0FD3) __sfr OSCCON;
6344 typedef union
6346 struct
6348 unsigned SCS0 : 1;
6349 unsigned SCS1 : 1;
6350 unsigned : 1;
6351 unsigned OSTS : 1;
6352 unsigned IRCF0 : 1;
6353 unsigned IRCF1 : 1;
6354 unsigned IRCF2 : 1;
6355 unsigned IDLEN : 1;
6358 struct
6360 unsigned SCS : 2;
6361 unsigned : 6;
6364 struct
6366 unsigned : 4;
6367 unsigned IRCF : 3;
6368 unsigned : 1;
6370 } __OSCCONbits_t;
6372 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6374 #define _SCS0 0x01
6375 #define _SCS1 0x02
6376 #define _OSTS 0x08
6377 #define _IRCF0 0x10
6378 #define _IRCF1 0x20
6379 #define _IRCF2 0x40
6380 #define _IDLEN 0x80
6382 //==============================================================================
6385 //==============================================================================
6386 // REFOCON Bits
6388 extern __at(0x0FD3) __sfr REFOCON;
6390 typedef union
6392 struct
6394 unsigned RODIV0 : 1;
6395 unsigned RODIV1 : 1;
6396 unsigned RODIV2 : 1;
6397 unsigned RODIV3 : 1;
6398 unsigned ROSEL : 1;
6399 unsigned ROSSLP : 1;
6400 unsigned : 1;
6401 unsigned ROON : 1;
6404 struct
6406 unsigned RODIV : 4;
6407 unsigned : 4;
6409 } __REFOCONbits_t;
6411 extern __at(0x0FD3) volatile __REFOCONbits_t REFOCONbits;
6413 #define _RODIV0 0x01
6414 #define _RODIV1 0x02
6415 #define _RODIV2 0x04
6416 #define _RODIV3 0x08
6417 #define _ROSEL 0x10
6418 #define _ROSSLP 0x20
6419 #define _ROON 0x80
6421 //==============================================================================
6424 //==============================================================================
6425 // T0CON Bits
6427 extern __at(0x0FD5) __sfr T0CON;
6429 typedef union
6431 struct
6433 unsigned T0PS0 : 1;
6434 unsigned T0PS1 : 1;
6435 unsigned T0PS2 : 1;
6436 unsigned PSA : 1;
6437 unsigned T0SE : 1;
6438 unsigned T0CS : 1;
6439 unsigned T08BIT : 1;
6440 unsigned TMR0ON : 1;
6443 struct
6445 unsigned : 1;
6446 unsigned : 1;
6447 unsigned : 1;
6448 unsigned T0PS3 : 1;
6449 unsigned : 1;
6450 unsigned : 1;
6451 unsigned : 1;
6452 unsigned : 1;
6455 struct
6457 unsigned T0PS : 4;
6458 unsigned : 4;
6460 } __T0CONbits_t;
6462 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6464 #define _T0PS0 0x01
6465 #define _T0PS1 0x02
6466 #define _T0PS2 0x04
6467 #define _PSA 0x08
6468 #define _T0PS3 0x08
6469 #define _T0SE 0x10
6470 #define _T0CS 0x20
6471 #define _T08BIT 0x40
6472 #define _TMR0ON 0x80
6474 //==============================================================================
6476 extern __at(0x0FD6) __sfr TMR0;
6477 extern __at(0x0FD6) __sfr TMR0L;
6478 extern __at(0x0FD7) __sfr TMR0H;
6480 //==============================================================================
6481 // STATUS Bits
6483 extern __at(0x0FD8) __sfr STATUS;
6485 typedef struct
6487 unsigned C : 1;
6488 unsigned DC : 1;
6489 unsigned Z : 1;
6490 unsigned OV : 1;
6491 unsigned N : 1;
6492 unsigned : 1;
6493 unsigned : 1;
6494 unsigned : 1;
6495 } __STATUSbits_t;
6497 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6499 #define _C 0x01
6500 #define _DC 0x02
6501 #define _Z 0x04
6502 #define _OV 0x08
6503 #define _N 0x10
6505 //==============================================================================
6507 extern __at(0x0FD9) __sfr FSR2L;
6508 extern __at(0x0FDA) __sfr FSR2H;
6509 extern __at(0x0FDB) __sfr PLUSW2;
6510 extern __at(0x0FDC) __sfr PREINC2;
6511 extern __at(0x0FDD) __sfr POSTDEC2;
6512 extern __at(0x0FDE) __sfr POSTINC2;
6513 extern __at(0x0FDF) __sfr INDF2;
6514 extern __at(0x0FE0) __sfr BSR;
6515 extern __at(0x0FE1) __sfr FSR1L;
6516 extern __at(0x0FE2) __sfr FSR1H;
6517 extern __at(0x0FE3) __sfr PLUSW1;
6518 extern __at(0x0FE4) __sfr PREINC1;
6519 extern __at(0x0FE5) __sfr POSTDEC1;
6520 extern __at(0x0FE6) __sfr POSTINC1;
6521 extern __at(0x0FE7) __sfr INDF1;
6522 extern __at(0x0FE8) __sfr WREG;
6523 extern __at(0x0FE9) __sfr FSR0L;
6524 extern __at(0x0FEA) __sfr FSR0H;
6525 extern __at(0x0FEB) __sfr PLUSW0;
6526 extern __at(0x0FEC) __sfr PREINC0;
6527 extern __at(0x0FED) __sfr POSTDEC0;
6528 extern __at(0x0FEE) __sfr POSTINC0;
6529 extern __at(0x0FEF) __sfr INDF0;
6531 //==============================================================================
6532 // INTCON3 Bits
6534 extern __at(0x0FF0) __sfr INTCON3;
6536 typedef union
6538 struct
6540 unsigned INT1IF : 1;
6541 unsigned INT2IF : 1;
6542 unsigned INT3IF : 1;
6543 unsigned INT1IE : 1;
6544 unsigned INT2IE : 1;
6545 unsigned INT3IE : 1;
6546 unsigned INT1IP : 1;
6547 unsigned INT2IP : 1;
6550 struct
6552 unsigned INT1F : 1;
6553 unsigned INT2F : 1;
6554 unsigned INT3F : 1;
6555 unsigned INT1E : 1;
6556 unsigned INT2E : 1;
6557 unsigned INT3E : 1;
6558 unsigned INT1P : 1;
6559 unsigned INT2P : 1;
6561 } __INTCON3bits_t;
6563 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6565 #define _INT1IF 0x01
6566 #define _INT1F 0x01
6567 #define _INT2IF 0x02
6568 #define _INT2F 0x02
6569 #define _INT3IF 0x04
6570 #define _INT3F 0x04
6571 #define _INT1IE 0x08
6572 #define _INT1E 0x08
6573 #define _INT2IE 0x10
6574 #define _INT2E 0x10
6575 #define _INT3IE 0x20
6576 #define _INT3E 0x20
6577 #define _INT1IP 0x40
6578 #define _INT1P 0x40
6579 #define _INT2IP 0x80
6580 #define _INT2P 0x80
6582 //==============================================================================
6585 //==============================================================================
6586 // INTCON2 Bits
6588 extern __at(0x0FF1) __sfr INTCON2;
6590 typedef union
6592 struct
6594 unsigned RBIP : 1;
6595 unsigned INT3IP : 1;
6596 unsigned TMR0IP : 1;
6597 unsigned INTEDG3 : 1;
6598 unsigned INTEDG2 : 1;
6599 unsigned INTEDG1 : 1;
6600 unsigned INTEDG0 : 1;
6601 unsigned NOT_RBPU : 1;
6604 struct
6606 unsigned : 1;
6607 unsigned INT3P : 1;
6608 unsigned T0IP : 1;
6609 unsigned : 1;
6610 unsigned : 1;
6611 unsigned : 1;
6612 unsigned : 1;
6613 unsigned RBPU : 1;
6615 } __INTCON2bits_t;
6617 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6619 #define _RBIP 0x01
6620 #define _INT3IP 0x02
6621 #define _INT3P 0x02
6622 #define _TMR0IP 0x04
6623 #define _T0IP 0x04
6624 #define _INTEDG3 0x08
6625 #define _INTEDG2 0x10
6626 #define _INTEDG1 0x20
6627 #define _INTEDG0 0x40
6628 #define _NOT_RBPU 0x80
6629 #define _RBPU 0x80
6631 //==============================================================================
6634 //==============================================================================
6635 // INTCON Bits
6637 extern __at(0x0FF2) __sfr INTCON;
6639 typedef union
6641 struct
6643 unsigned RBIF : 1;
6644 unsigned INT0IF : 1;
6645 unsigned TMR0IF : 1;
6646 unsigned RBIE : 1;
6647 unsigned INT0IE : 1;
6648 unsigned TMR0IE : 1;
6649 unsigned PEIE_GIEL : 1;
6650 unsigned GIE_GIEH : 1;
6653 struct
6655 unsigned : 1;
6656 unsigned INT0F : 1;
6657 unsigned T0IF : 1;
6658 unsigned : 1;
6659 unsigned INT0E : 1;
6660 unsigned T0IE : 1;
6661 unsigned PEIE : 1;
6662 unsigned GIE : 1;
6665 struct
6667 unsigned : 1;
6668 unsigned : 1;
6669 unsigned : 1;
6670 unsigned : 1;
6671 unsigned : 1;
6672 unsigned : 1;
6673 unsigned GIEL : 1;
6674 unsigned GIEH : 1;
6676 } __INTCONbits_t;
6678 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6680 #define _RBIF 0x01
6681 #define _INT0IF 0x02
6682 #define _INT0F 0x02
6683 #define _TMR0IF 0x04
6684 #define _T0IF 0x04
6685 #define _RBIE 0x08
6686 #define _INT0IE 0x10
6687 #define _INT0E 0x10
6688 #define _TMR0IE 0x20
6689 #define _T0IE 0x20
6690 #define _PEIE_GIEL 0x40
6691 #define _PEIE 0x40
6692 #define _GIEL 0x40
6693 #define _GIE_GIEH 0x80
6694 #define _GIE 0x80
6695 #define _GIEH 0x80
6697 //==============================================================================
6699 extern __at(0x0FF3) __sfr PROD;
6700 extern __at(0x0FF3) __sfr PRODL;
6701 extern __at(0x0FF4) __sfr PRODH;
6702 extern __at(0x0FF5) __sfr TABLAT;
6703 extern __at(0x0FF6) __sfr TBLPTR;
6704 extern __at(0x0FF6) __sfr TBLPTRL;
6705 extern __at(0x0FF7) __sfr TBLPTRH;
6706 extern __at(0x0FF8) __sfr TBLPTRU;
6707 extern __at(0x0FF9) __sfr PC;
6708 extern __at(0x0FF9) __sfr PCL;
6709 extern __at(0x0FFA) __sfr PCLATH;
6710 extern __at(0x0FFB) __sfr PCLATU;
6712 //==============================================================================
6713 // STKPTR Bits
6715 extern __at(0x0FFC) __sfr STKPTR;
6717 typedef union
6719 struct
6721 unsigned STKPTR0 : 1;
6722 unsigned STKPTR1 : 1;
6723 unsigned STKPTR2 : 1;
6724 unsigned STKPTR3 : 1;
6725 unsigned STKPTR4 : 1;
6726 unsigned : 1;
6727 unsigned STKUNF : 1;
6728 unsigned STKFUL : 1;
6731 struct
6733 unsigned SP0 : 1;
6734 unsigned SP1 : 1;
6735 unsigned SP2 : 1;
6736 unsigned SP3 : 1;
6737 unsigned SP4 : 1;
6738 unsigned : 1;
6739 unsigned : 1;
6740 unsigned STKOVF : 1;
6743 struct
6745 unsigned STKPTR : 5;
6746 unsigned : 3;
6749 struct
6751 unsigned SP : 5;
6752 unsigned : 3;
6754 } __STKPTRbits_t;
6756 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6758 #define _STKPTR0 0x01
6759 #define _SP0 0x01
6760 #define _STKPTR1 0x02
6761 #define _SP1 0x02
6762 #define _STKPTR2 0x04
6763 #define _SP2 0x04
6764 #define _STKPTR3 0x08
6765 #define _SP3 0x08
6766 #define _STKPTR4 0x10
6767 #define _SP4 0x10
6768 #define _STKUNF 0x40
6769 #define _STKFUL 0x80
6770 #define _STKOVF 0x80
6772 //==============================================================================
6774 extern __at(0x0FFD) __sfr TOS;
6775 extern __at(0x0FFD) __sfr TOSL;
6776 extern __at(0x0FFE) __sfr TOSH;
6777 extern __at(0x0FFF) __sfr TOSU;
6779 //==============================================================================
6781 // Configuration Addresses
6783 //==============================================================================
6785 #define __CONFIG1L 0x017FF8
6786 #define __CONFIG1H 0x017FF9
6787 #define __CONFIG2L 0x017FFA
6788 #define __CONFIG2H 0x017FFB
6789 #define __CONFIG3L 0x017FFC
6790 #define __CONFIG3H 0x017FFD
6792 //==============================================================================
6794 #endif // #ifndef __PIC18F86J16_H__