struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18lf46j53.h
blob0d586b382e3c20691fef29f80e7e4605ab19efdb
1 /*
2 * This declarations of the PIC18LF46J53 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:57 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 __PIC18LF46J53_H__
26 #define __PIC18LF46J53_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // ADCTRIG Bits
40 extern __at(0x0EB8) __sfr ADCTRIG;
42 typedef union
44 struct
46 unsigned SRC0 : 1;
47 unsigned SRC1 : 1;
48 unsigned : 1;
49 unsigned : 1;
50 unsigned : 1;
51 unsigned : 1;
52 unsigned : 1;
53 unsigned : 1;
56 struct
58 unsigned TRIGSEL0 : 1;
59 unsigned TRIGSEL1 : 1;
60 unsigned : 1;
61 unsigned : 1;
62 unsigned : 1;
63 unsigned : 1;
64 unsigned : 1;
65 unsigned : 1;
68 struct
70 unsigned TRIGSEL : 2;
71 unsigned : 6;
74 struct
76 unsigned SRC : 2;
77 unsigned : 6;
79 } __ADCTRIGbits_t;
81 extern __at(0x0EB8) volatile __ADCTRIGbits_t ADCTRIGbits;
83 #define _SRC0 0x01
84 #define _TRIGSEL0 0x01
85 #define _SRC1 0x02
86 #define _TRIGSEL1 0x02
88 //==============================================================================
91 //==============================================================================
92 // PD0 Bits
94 extern __at(0x0EB9) __sfr PD0;
96 typedef union
98 struct
100 unsigned ADCMD : 1;
101 unsigned SPI1MD : 1;
102 unsigned SPI2MD : 1;
103 unsigned UART1MD : 1;
104 unsigned UART2MD : 1;
105 unsigned ECCP1MD : 1;
106 unsigned ECCP2MD : 1;
107 unsigned ECCP3MD : 1;
110 struct
112 unsigned PMDADC : 1;
113 unsigned PMDMSSP1 : 1;
114 unsigned PMDMSSP2 : 1;
115 unsigned PMDUART1 : 1;
116 unsigned PMDUART2 : 1;
117 unsigned PMDECCP1 : 1;
118 unsigned PMDECCP2 : 1;
119 unsigned PMDECCP3 : 1;
121 } __PD0bits_t;
123 extern __at(0x0EB9) volatile __PD0bits_t PD0bits;
125 #define _ADCMD 0x01
126 #define _PMDADC 0x01
127 #define _SPI1MD 0x02
128 #define _PMDMSSP1 0x02
129 #define _SPI2MD 0x04
130 #define _PMDMSSP2 0x04
131 #define _UART1MD 0x08
132 #define _PMDUART1 0x08
133 #define _UART2MD 0x10
134 #define _PMDUART2 0x10
135 #define _ECCP1MD 0x20
136 #define _PMDECCP1 0x20
137 #define _ECCP2MD 0x40
138 #define _PMDECCP2 0x40
139 #define _ECCP3MD 0x80
140 #define _PMDECCP3 0x80
142 //==============================================================================
145 //==============================================================================
146 // PMDIS0 Bits
148 extern __at(0x0EB9) __sfr PMDIS0;
150 typedef union
152 struct
154 unsigned ADCMD : 1;
155 unsigned SPI1MD : 1;
156 unsigned SPI2MD : 1;
157 unsigned UART1MD : 1;
158 unsigned UART2MD : 1;
159 unsigned ECCP1MD : 1;
160 unsigned ECCP2MD : 1;
161 unsigned ECCP3MD : 1;
164 struct
166 unsigned PMDADC : 1;
167 unsigned PMDMSSP1 : 1;
168 unsigned PMDMSSP2 : 1;
169 unsigned PMDUART1 : 1;
170 unsigned PMDUART2 : 1;
171 unsigned PMDECCP1 : 1;
172 unsigned PMDECCP2 : 1;
173 unsigned PMDECCP3 : 1;
175 } __PMDIS0bits_t;
177 extern __at(0x0EB9) volatile __PMDIS0bits_t PMDIS0bits;
179 #define _PMDIS0_ADCMD 0x01
180 #define _PMDIS0_PMDADC 0x01
181 #define _PMDIS0_SPI1MD 0x02
182 #define _PMDIS0_PMDMSSP1 0x02
183 #define _PMDIS0_SPI2MD 0x04
184 #define _PMDIS0_PMDMSSP2 0x04
185 #define _PMDIS0_UART1MD 0x08
186 #define _PMDIS0_PMDUART1 0x08
187 #define _PMDIS0_UART2MD 0x10
188 #define _PMDIS0_PMDUART2 0x10
189 #define _PMDIS0_ECCP1MD 0x20
190 #define _PMDIS0_PMDECCP1 0x20
191 #define _PMDIS0_ECCP2MD 0x40
192 #define _PMDIS0_PMDECCP2 0x40
193 #define _PMDIS0_ECCP3MD 0x80
194 #define _PMDIS0_PMDECCP3 0x80
196 //==============================================================================
199 //==============================================================================
200 // PD1 Bits
202 extern __at(0x0EBA) __sfr PD1;
204 typedef union
206 struct
208 unsigned : 1;
209 unsigned TMR1MD : 1;
210 unsigned TMR2MD : 1;
211 unsigned TMR3MD : 1;
212 unsigned TMR4MD : 1;
213 unsigned RTCCMD : 1;
214 unsigned CTMUMD : 1;
215 unsigned PSPMD : 1;
218 struct
220 unsigned : 1;
221 unsigned PMDTMR1 : 1;
222 unsigned PMDTMR2 : 1;
223 unsigned PMDTMR3 : 1;
224 unsigned PMDTMR4 : 1;
225 unsigned PMDRTCC : 1;
226 unsigned PMDCTMU : 1;
227 unsigned PMDPSP : 1;
229 } __PD1bits_t;
231 extern __at(0x0EBA) volatile __PD1bits_t PD1bits;
233 #define _TMR1MD 0x02
234 #define _PMDTMR1 0x02
235 #define _TMR2MD 0x04
236 #define _PMDTMR2 0x04
237 #define _TMR3MD 0x08
238 #define _PMDTMR3 0x08
239 #define _TMR4MD 0x10
240 #define _PMDTMR4 0x10
241 #define _RTCCMD 0x20
242 #define _PMDRTCC 0x20
243 #define _CTMUMD 0x40
244 #define _PMDCTMU 0x40
245 #define _PSPMD 0x80
246 #define _PMDPSP 0x80
248 //==============================================================================
251 //==============================================================================
252 // PMDIS1 Bits
254 extern __at(0x0EBA) __sfr PMDIS1;
256 typedef union
258 struct
260 unsigned : 1;
261 unsigned TMR1MD : 1;
262 unsigned TMR2MD : 1;
263 unsigned TMR3MD : 1;
264 unsigned TMR4MD : 1;
265 unsigned RTCCMD : 1;
266 unsigned CTMUMD : 1;
267 unsigned PSPMD : 1;
270 struct
272 unsigned : 1;
273 unsigned PMDTMR1 : 1;
274 unsigned PMDTMR2 : 1;
275 unsigned PMDTMR3 : 1;
276 unsigned PMDTMR4 : 1;
277 unsigned PMDRTCC : 1;
278 unsigned PMDCTMU : 1;
279 unsigned PMDPSP : 1;
281 } __PMDIS1bits_t;
283 extern __at(0x0EBA) volatile __PMDIS1bits_t PMDIS1bits;
285 #define _PMDIS1_TMR1MD 0x02
286 #define _PMDIS1_PMDTMR1 0x02
287 #define _PMDIS1_TMR2MD 0x04
288 #define _PMDIS1_PMDTMR2 0x04
289 #define _PMDIS1_TMR3MD 0x08
290 #define _PMDIS1_PMDTMR3 0x08
291 #define _PMDIS1_TMR4MD 0x10
292 #define _PMDIS1_PMDTMR4 0x10
293 #define _PMDIS1_RTCCMD 0x20
294 #define _PMDIS1_PMDRTCC 0x20
295 #define _PMDIS1_CTMUMD 0x40
296 #define _PMDIS1_PMDCTMU 0x40
297 #define _PMDIS1_PSPMD 0x80
298 #define _PMDIS1_PMDPSP 0x80
300 //==============================================================================
303 //==============================================================================
304 // PD2 Bits
306 extern __at(0x0EBB) __sfr PD2;
308 typedef union
310 struct
312 unsigned CMP1MD : 1;
313 unsigned CMP2MD : 1;
314 unsigned CMP3MD : 1;
315 unsigned TMR5MD : 1;
316 unsigned TMR6MD : 1;
317 unsigned : 1;
318 unsigned TMR8MD : 1;
319 unsigned : 1;
322 struct
324 unsigned PMDCMP1 : 1;
325 unsigned PMDCMP2 : 1;
326 unsigned PMDCMP3 : 1;
327 unsigned PMDTMR5 : 1;
328 unsigned PMDTMR6 : 1;
329 unsigned : 1;
330 unsigned PMDTMR8 : 1;
331 unsigned : 1;
333 } __PD2bits_t;
335 extern __at(0x0EBB) volatile __PD2bits_t PD2bits;
337 #define _CMP1MD 0x01
338 #define _PMDCMP1 0x01
339 #define _CMP2MD 0x02
340 #define _PMDCMP2 0x02
341 #define _CMP3MD 0x04
342 #define _PMDCMP3 0x04
343 #define _TMR5MD 0x08
344 #define _PMDTMR5 0x08
345 #define _TMR6MD 0x10
346 #define _PMDTMR6 0x10
347 #define _TMR8MD 0x40
348 #define _PMDTMR8 0x40
350 //==============================================================================
353 //==============================================================================
354 // PMDIS2 Bits
356 extern __at(0x0EBB) __sfr PMDIS2;
358 typedef union
360 struct
362 unsigned CMP1MD : 1;
363 unsigned CMP2MD : 1;
364 unsigned CMP3MD : 1;
365 unsigned TMR5MD : 1;
366 unsigned TMR6MD : 1;
367 unsigned : 1;
368 unsigned TMR8MD : 1;
369 unsigned : 1;
372 struct
374 unsigned PMDCMP1 : 1;
375 unsigned PMDCMP2 : 1;
376 unsigned PMDCMP3 : 1;
377 unsigned PMDTMR5 : 1;
378 unsigned PMDTMR6 : 1;
379 unsigned : 1;
380 unsigned PMDTMR8 : 1;
381 unsigned : 1;
383 } __PMDIS2bits_t;
385 extern __at(0x0EBB) volatile __PMDIS2bits_t PMDIS2bits;
387 #define _PMDIS2_CMP1MD 0x01
388 #define _PMDIS2_PMDCMP1 0x01
389 #define _PMDIS2_CMP2MD 0x02
390 #define _PMDIS2_PMDCMP2 0x02
391 #define _PMDIS2_CMP3MD 0x04
392 #define _PMDIS2_PMDCMP3 0x04
393 #define _PMDIS2_TMR5MD 0x08
394 #define _PMDIS2_PMDTMR5 0x08
395 #define _PMDIS2_TMR6MD 0x10
396 #define _PMDIS2_PMDTMR6 0x10
397 #define _PMDIS2_TMR8MD 0x40
398 #define _PMDIS2_PMDTMR8 0x40
400 //==============================================================================
403 //==============================================================================
404 // PD3 Bits
406 extern __at(0x0EBC) __sfr PD3;
408 typedef union
410 struct
412 unsigned : 1;
413 unsigned CCP4MD : 1;
414 unsigned CCP5MD : 1;
415 unsigned CCP6MD : 1;
416 unsigned CCP7MD : 1;
417 unsigned CCP8MD : 1;
418 unsigned CCP9MD : 1;
419 unsigned CCP10MD : 1;
422 struct
424 unsigned : 1;
425 unsigned PMDCCP4 : 1;
426 unsigned PMDCCP5 : 1;
427 unsigned PMDCCP6 : 1;
428 unsigned PMDCCP7 : 1;
429 unsigned PMDCCP8 : 1;
430 unsigned PMDCCP9 : 1;
431 unsigned PMDCCP10 : 1;
433 } __PD3bits_t;
435 extern __at(0x0EBC) volatile __PD3bits_t PD3bits;
437 #define _CCP4MD 0x02
438 #define _PMDCCP4 0x02
439 #define _CCP5MD 0x04
440 #define _PMDCCP5 0x04
441 #define _CCP6MD 0x08
442 #define _PMDCCP6 0x08
443 #define _CCP7MD 0x10
444 #define _PMDCCP7 0x10
445 #define _CCP8MD 0x20
446 #define _PMDCCP8 0x20
447 #define _CCP9MD 0x40
448 #define _PMDCCP9 0x40
449 #define _CCP10MD 0x80
450 #define _PMDCCP10 0x80
452 //==============================================================================
455 //==============================================================================
456 // PMDIS3 Bits
458 extern __at(0x0EBC) __sfr PMDIS3;
460 typedef union
462 struct
464 unsigned : 1;
465 unsigned CCP4MD : 1;
466 unsigned CCP5MD : 1;
467 unsigned CCP6MD : 1;
468 unsigned CCP7MD : 1;
469 unsigned CCP8MD : 1;
470 unsigned CCP9MD : 1;
471 unsigned CCP10MD : 1;
474 struct
476 unsigned : 1;
477 unsigned PMDCCP4 : 1;
478 unsigned PMDCCP5 : 1;
479 unsigned PMDCCP6 : 1;
480 unsigned PMDCCP7 : 1;
481 unsigned PMDCCP8 : 1;
482 unsigned PMDCCP9 : 1;
483 unsigned PMDCCP10 : 1;
485 } __PMDIS3bits_t;
487 extern __at(0x0EBC) volatile __PMDIS3bits_t PMDIS3bits;
489 #define _PMDIS3_CCP4MD 0x02
490 #define _PMDIS3_PMDCCP4 0x02
491 #define _PMDIS3_CCP5MD 0x04
492 #define _PMDIS3_PMDCCP5 0x04
493 #define _PMDIS3_CCP6MD 0x08
494 #define _PMDIS3_PMDCCP6 0x08
495 #define _PMDIS3_CCP7MD 0x10
496 #define _PMDIS3_PMDCCP7 0x10
497 #define _PMDIS3_CCP8MD 0x20
498 #define _PMDIS3_PMDCCP8 0x20
499 #define _PMDIS3_CCP9MD 0x40
500 #define _PMDIS3_PMDCCP9 0x40
501 #define _PMDIS3_CCP10MD 0x80
502 #define _PMDIS3_PMDCCP10 0x80
504 //==============================================================================
507 //==============================================================================
508 // PPSCON Bits
510 extern __at(0x0EBF) __sfr PPSCON;
512 typedef struct
514 unsigned IOLOCK : 1;
515 unsigned : 1;
516 unsigned : 1;
517 unsigned : 1;
518 unsigned : 1;
519 unsigned : 1;
520 unsigned : 1;
521 unsigned : 1;
522 } __PPSCONbits_t;
524 extern __at(0x0EBF) volatile __PPSCONbits_t PPSCONbits;
526 #define _IOLOCK 0x01
528 //==============================================================================
530 extern __at(0x0EC0) __sfr RPOR0;
531 extern __at(0x0EC1) __sfr RPOR1;
532 extern __at(0x0EC2) __sfr RPOR2;
533 extern __at(0x0EC3) __sfr RPOR3;
534 extern __at(0x0EC4) __sfr RPOR4;
535 extern __at(0x0EC5) __sfr RPOR5;
536 extern __at(0x0EC6) __sfr RPOR6;
537 extern __at(0x0EC7) __sfr RPOR7;
538 extern __at(0x0EC8) __sfr RPOR8;
539 extern __at(0x0EC9) __sfr RPOR9;
540 extern __at(0x0ECA) __sfr RPOR10;
541 extern __at(0x0ECB) __sfr RPOR11;
542 extern __at(0x0ECC) __sfr RPOR12;
543 extern __at(0x0ECD) __sfr RPOR13;
544 extern __at(0x0ED1) __sfr RPOR17;
545 extern __at(0x0ED2) __sfr RPOR18;
546 extern __at(0x0ED3) __sfr RPOR19;
547 extern __at(0x0ED4) __sfr RPOR20;
548 extern __at(0x0ED5) __sfr RPOR21;
549 extern __at(0x0ED6) __sfr RPOR22;
550 extern __at(0x0ED7) __sfr RPOR23;
551 extern __at(0x0ED8) __sfr RPOR24;
552 extern __at(0x0EE1) __sfr RPINR1;
553 extern __at(0x0EE2) __sfr RPINR2;
554 extern __at(0x0EE3) __sfr RPINR3;
555 extern __at(0x0EE4) __sfr RPINR4;
556 extern __at(0x0EE6) __sfr RPINR6;
557 extern __at(0x0EE7) __sfr RPINR15;
558 extern __at(0x0EE8) __sfr RPINR7;
559 extern __at(0x0EE9) __sfr RPINR8;
560 extern __at(0x0EEA) __sfr RPINR9;
561 extern __at(0x0EF2) __sfr RPINR12;
562 extern __at(0x0EF3) __sfr RPINR13;
563 extern __at(0x0EF4) __sfr RPINR14;
564 extern __at(0x0EF7) __sfr RPINR16;
565 extern __at(0x0EF8) __sfr RPINR17;
566 extern __at(0x0EFC) __sfr RPINR21;
567 extern __at(0x0EFD) __sfr RPINR22;
568 extern __at(0x0EFE) __sfr RPINR23;
569 extern __at(0x0EFF) __sfr RPINR24;
571 //==============================================================================
572 // CCP10CON Bits
574 extern __at(0x0F00) __sfr CCP10CON;
576 typedef union
578 struct
580 unsigned CCP10M0 : 1;
581 unsigned CCP10M1 : 1;
582 unsigned CCP10M2 : 1;
583 unsigned CCP10M3 : 1;
584 unsigned DC10B0 : 1;
585 unsigned DC10B1 : 1;
586 unsigned : 1;
587 unsigned : 1;
590 struct
592 unsigned CCP10M : 4;
593 unsigned : 4;
596 struct
598 unsigned : 4;
599 unsigned DC10B : 2;
600 unsigned : 2;
602 } __CCP10CONbits_t;
604 extern __at(0x0F00) volatile __CCP10CONbits_t CCP10CONbits;
606 #define _CCP10M0 0x01
607 #define _CCP10M1 0x02
608 #define _CCP10M2 0x04
609 #define _CCP10M3 0x08
610 #define _DC10B0 0x10
611 #define _DC10B1 0x20
613 //==============================================================================
615 extern __at(0x0F01) __sfr CCPR10L;
616 extern __at(0x0F02) __sfr CCPR10H;
618 //==============================================================================
619 // CCP9CON Bits
621 extern __at(0x0F03) __sfr CCP9CON;
623 typedef union
625 struct
627 unsigned CCP9M0 : 1;
628 unsigned CCP9M1 : 1;
629 unsigned CCP9M2 : 1;
630 unsigned CCP9M3 : 1;
631 unsigned DC9B0 : 1;
632 unsigned DC9B1 : 1;
633 unsigned : 1;
634 unsigned : 1;
637 struct
639 unsigned CCP9M : 4;
640 unsigned : 4;
643 struct
645 unsigned : 4;
646 unsigned DC9B : 2;
647 unsigned : 2;
649 } __CCP9CONbits_t;
651 extern __at(0x0F03) volatile __CCP9CONbits_t CCP9CONbits;
653 #define _CCP9M0 0x01
654 #define _CCP9M1 0x02
655 #define _CCP9M2 0x04
656 #define _CCP9M3 0x08
657 #define _DC9B0 0x10
658 #define _DC9B1 0x20
660 //==============================================================================
662 extern __at(0x0F04) __sfr CCPR9L;
663 extern __at(0x0F05) __sfr CCPR9H;
665 //==============================================================================
666 // CCP8CON Bits
668 extern __at(0x0F06) __sfr CCP8CON;
670 typedef union
672 struct
674 unsigned CCP8M0 : 1;
675 unsigned CCP8M1 : 1;
676 unsigned CCP8M2 : 1;
677 unsigned CCP8M3 : 1;
678 unsigned DC8B0 : 1;
679 unsigned DC8B1 : 1;
680 unsigned : 1;
681 unsigned : 1;
684 struct
686 unsigned CCP8M : 4;
687 unsigned : 4;
690 struct
692 unsigned : 4;
693 unsigned DC8B : 2;
694 unsigned : 2;
696 } __CCP8CONbits_t;
698 extern __at(0x0F06) volatile __CCP8CONbits_t CCP8CONbits;
700 #define _CCP8M0 0x01
701 #define _CCP8M1 0x02
702 #define _CCP8M2 0x04
703 #define _CCP8M3 0x08
704 #define _DC8B0 0x10
705 #define _DC8B1 0x20
707 //==============================================================================
709 extern __at(0x0F07) __sfr CCPR8L;
710 extern __at(0x0F08) __sfr CCPR8H;
712 //==============================================================================
713 // CCP7CON Bits
715 extern __at(0x0F09) __sfr CCP7CON;
717 typedef union
719 struct
721 unsigned CCP7M0 : 1;
722 unsigned CCP7M1 : 1;
723 unsigned CCP7M2 : 1;
724 unsigned CCP7M3 : 1;
725 unsigned DC7B0 : 1;
726 unsigned DC7B1 : 1;
727 unsigned : 1;
728 unsigned : 1;
731 struct
733 unsigned CCP7M : 4;
734 unsigned : 4;
737 struct
739 unsigned : 4;
740 unsigned DC7B : 2;
741 unsigned : 2;
743 } __CCP7CONbits_t;
745 extern __at(0x0F09) volatile __CCP7CONbits_t CCP7CONbits;
747 #define _CCP7M0 0x01
748 #define _CCP7M1 0x02
749 #define _CCP7M2 0x04
750 #define _CCP7M3 0x08
751 #define _DC7B0 0x10
752 #define _DC7B1 0x20
754 //==============================================================================
756 extern __at(0x0F0A) __sfr CCPR7L;
757 extern __at(0x0F0B) __sfr CCPR7H;
759 //==============================================================================
760 // CCP6CON Bits
762 extern __at(0x0F0C) __sfr CCP6CON;
764 typedef union
766 struct
768 unsigned CCP6M0 : 1;
769 unsigned CCP6M1 : 1;
770 unsigned CCP6M2 : 1;
771 unsigned CCP6M3 : 1;
772 unsigned DC6B0 : 1;
773 unsigned DC6B1 : 1;
774 unsigned : 1;
775 unsigned : 1;
778 struct
780 unsigned CCP6M : 4;
781 unsigned : 4;
784 struct
786 unsigned : 4;
787 unsigned DC6B : 2;
788 unsigned : 2;
790 } __CCP6CONbits_t;
792 extern __at(0x0F0C) volatile __CCP6CONbits_t CCP6CONbits;
794 #define _CCP6M0 0x01
795 #define _CCP6M1 0x02
796 #define _CCP6M2 0x04
797 #define _CCP6M3 0x08
798 #define _DC6B0 0x10
799 #define _DC6B1 0x20
801 //==============================================================================
803 extern __at(0x0F0D) __sfr CCPR6L;
804 extern __at(0x0F0E) __sfr CCPR6H;
806 //==============================================================================
807 // CCP5CON Bits
809 extern __at(0x0F0F) __sfr CCP5CON;
811 typedef union
813 struct
815 unsigned CCP5M0 : 1;
816 unsigned CCP5M1 : 1;
817 unsigned CCP5M2 : 1;
818 unsigned CCP5M3 : 1;
819 unsigned DC5B0 : 1;
820 unsigned DC5B1 : 1;
821 unsigned : 1;
822 unsigned : 1;
825 struct
827 unsigned CCP5M : 4;
828 unsigned : 4;
831 struct
833 unsigned : 4;
834 unsigned DC5B : 2;
835 unsigned : 2;
837 } __CCP5CONbits_t;
839 extern __at(0x0F0F) volatile __CCP5CONbits_t CCP5CONbits;
841 #define _CCP5M0 0x01
842 #define _CCP5M1 0x02
843 #define _CCP5M2 0x04
844 #define _CCP5M3 0x08
845 #define _DC5B0 0x10
846 #define _DC5B1 0x20
848 //==============================================================================
850 extern __at(0x0F10) __sfr CCPR5L;
851 extern __at(0x0F11) __sfr CCPR5H;
853 //==============================================================================
854 // CCP4CON Bits
856 extern __at(0x0F12) __sfr CCP4CON;
858 typedef union
860 struct
862 unsigned CCP4M0 : 1;
863 unsigned CCP4M1 : 1;
864 unsigned CCP4M2 : 1;
865 unsigned CCP4M3 : 1;
866 unsigned DC4B0 : 1;
867 unsigned DC4B1 : 1;
868 unsigned : 1;
869 unsigned : 1;
872 struct
874 unsigned CCP4M : 4;
875 unsigned : 4;
878 struct
880 unsigned : 4;
881 unsigned DC4B : 2;
882 unsigned : 2;
884 } __CCP4CONbits_t;
886 extern __at(0x0F12) volatile __CCP4CONbits_t CCP4CONbits;
888 #define _CCP4M0 0x01
889 #define _CCP4M1 0x02
890 #define _CCP4M2 0x04
891 #define _CCP4M3 0x08
892 #define _DC4B0 0x10
893 #define _DC4B1 0x20
895 //==============================================================================
897 extern __at(0x0F13) __sfr CCPR4L;
898 extern __at(0x0F14) __sfr CCPR4H;
900 //==============================================================================
901 // CCP3CON Bits
903 extern __at(0x0F15) __sfr CCP3CON;
905 typedef union
907 struct
909 unsigned CCP3M0 : 1;
910 unsigned CCP3M1 : 1;
911 unsigned CCP3M2 : 1;
912 unsigned CCP3M3 : 1;
913 unsigned DC3B0 : 1;
914 unsigned DC3B1 : 1;
915 unsigned P3M0 : 1;
916 unsigned P3M1 : 1;
919 struct
921 unsigned CCP3M : 4;
922 unsigned : 4;
925 struct
927 unsigned : 4;
928 unsigned DC3B : 2;
929 unsigned : 2;
932 struct
934 unsigned : 6;
935 unsigned P3M : 2;
937 } __CCP3CONbits_t;
939 extern __at(0x0F15) volatile __CCP3CONbits_t CCP3CONbits;
941 #define _CCP3M0 0x01
942 #define _CCP3M1 0x02
943 #define _CCP3M2 0x04
944 #define _CCP3M3 0x08
945 #define _DC3B0 0x10
946 #define _DC3B1 0x20
947 #define _P3M0 0x40
948 #define _P3M1 0x80
950 //==============================================================================
952 extern __at(0x0F16) __sfr CCPR3L;
953 extern __at(0x0F17) __sfr CCPR3H;
955 //==============================================================================
956 // ECCP3DEL Bits
958 extern __at(0x0F18) __sfr ECCP3DEL;
960 typedef union
962 struct
964 unsigned P3DC0 : 1;
965 unsigned P3DC1 : 1;
966 unsigned P3DC2 : 1;
967 unsigned P3DC3 : 1;
968 unsigned P3DC4 : 1;
969 unsigned P3DC5 : 1;
970 unsigned P3DC6 : 1;
971 unsigned P3RSEN : 1;
974 struct
976 unsigned P3DC : 7;
977 unsigned : 1;
979 } __ECCP3DELbits_t;
981 extern __at(0x0F18) volatile __ECCP3DELbits_t ECCP3DELbits;
983 #define _P3DC0 0x01
984 #define _P3DC1 0x02
985 #define _P3DC2 0x04
986 #define _P3DC3 0x08
987 #define _P3DC4 0x10
988 #define _P3DC5 0x20
989 #define _P3DC6 0x40
990 #define _P3RSEN 0x80
992 //==============================================================================
995 //==============================================================================
996 // ECCP3AS Bits
998 extern __at(0x0F19) __sfr ECCP3AS;
1000 typedef union
1002 struct
1004 unsigned PSS3BD0 : 1;
1005 unsigned PSS3BD1 : 1;
1006 unsigned PSS3AC0 : 1;
1007 unsigned PSS3AC1 : 1;
1008 unsigned ECCP3AS0 : 1;
1009 unsigned ECCP3AS1 : 1;
1010 unsigned ECCP3AS2 : 1;
1011 unsigned ECCP3ASE : 1;
1014 struct
1016 unsigned PSS3BD : 2;
1017 unsigned : 6;
1020 struct
1022 unsigned : 2;
1023 unsigned PSS3AC : 2;
1024 unsigned : 4;
1027 struct
1029 unsigned : 4;
1030 unsigned ECCP3AS : 3;
1031 unsigned : 1;
1033 } __ECCP3ASbits_t;
1035 extern __at(0x0F19) volatile __ECCP3ASbits_t ECCP3ASbits;
1037 #define _PSS3BD0 0x01
1038 #define _PSS3BD1 0x02
1039 #define _PSS3AC0 0x04
1040 #define _PSS3AC1 0x08
1041 #define _ECCP3AS0 0x10
1042 #define _ECCP3AS1 0x20
1043 #define _ECCP3AS2 0x40
1044 #define _ECCP3ASE 0x80
1046 //==============================================================================
1049 //==============================================================================
1050 // PSTR3CON Bits
1052 extern __at(0x0F1A) __sfr PSTR3CON;
1054 typedef union
1056 struct
1058 unsigned STRA : 1;
1059 unsigned STRB : 1;
1060 unsigned STRC : 1;
1061 unsigned STRD : 1;
1062 unsigned STRSYNC : 1;
1063 unsigned : 1;
1064 unsigned CMPL0 : 1;
1065 unsigned CMPL1 : 1;
1068 struct
1070 unsigned : 6;
1071 unsigned CMPL : 2;
1073 } __PSTR3CONbits_t;
1075 extern __at(0x0F1A) volatile __PSTR3CONbits_t PSTR3CONbits;
1077 #define _PSTR3CON_STRA 0x01
1078 #define _PSTR3CON_STRB 0x02
1079 #define _PSTR3CON_STRC 0x04
1080 #define _PSTR3CON_STRD 0x08
1081 #define _PSTR3CON_STRSYNC 0x10
1082 #define _PSTR3CON_CMPL0 0x40
1083 #define _PSTR3CON_CMPL1 0x80
1085 //==============================================================================
1088 //==============================================================================
1089 // T8CON Bits
1091 extern __at(0x0F1B) __sfr T8CON;
1093 typedef union
1095 struct
1097 unsigned T8CKPS0 : 1;
1098 unsigned T8CKPS1 : 1;
1099 unsigned TMR8ON : 1;
1100 unsigned T8OUTPS0 : 1;
1101 unsigned T8OUTPS1 : 1;
1102 unsigned T8OUTPS2 : 1;
1103 unsigned T8OUTPS3 : 1;
1104 unsigned : 1;
1107 struct
1109 unsigned T8CKPS : 2;
1110 unsigned : 6;
1113 struct
1115 unsigned : 3;
1116 unsigned T8OUTPS : 4;
1117 unsigned : 1;
1119 } __T8CONbits_t;
1121 extern __at(0x0F1B) volatile __T8CONbits_t T8CONbits;
1123 #define _T8CKPS0 0x01
1124 #define _T8CKPS1 0x02
1125 #define _TMR8ON 0x04
1126 #define _T8OUTPS0 0x08
1127 #define _T8OUTPS1 0x10
1128 #define _T8OUTPS2 0x20
1129 #define _T8OUTPS3 0x40
1131 //==============================================================================
1133 extern __at(0x0F1C) __sfr PR8;
1134 extern __at(0x0F1D) __sfr TMR8;
1136 //==============================================================================
1137 // T6CON Bits
1139 extern __at(0x0F1E) __sfr T6CON;
1141 typedef union
1143 struct
1145 unsigned T6CKPS0 : 1;
1146 unsigned T6CKPS1 : 1;
1147 unsigned TMR6ON : 1;
1148 unsigned T6OUTPS0 : 1;
1149 unsigned T6OUTPS1 : 1;
1150 unsigned T6OUTPS2 : 1;
1151 unsigned T6OUTPS3 : 1;
1152 unsigned : 1;
1155 struct
1157 unsigned T6CKPS : 2;
1158 unsigned : 6;
1161 struct
1163 unsigned : 3;
1164 unsigned T6OUTPS : 4;
1165 unsigned : 1;
1167 } __T6CONbits_t;
1169 extern __at(0x0F1E) volatile __T6CONbits_t T6CONbits;
1171 #define _T6CKPS0 0x01
1172 #define _T6CKPS1 0x02
1173 #define _TMR6ON 0x04
1174 #define _T6OUTPS0 0x08
1175 #define _T6OUTPS1 0x10
1176 #define _T6OUTPS2 0x20
1177 #define _T6OUTPS3 0x40
1179 //==============================================================================
1181 extern __at(0x0F1F) __sfr PR6;
1182 extern __at(0x0F20) __sfr TMR6;
1184 //==============================================================================
1185 // T5GCON Bits
1187 extern __at(0x0F21) __sfr T5GCON;
1189 typedef union
1191 struct
1193 unsigned T5GSS0 : 1;
1194 unsigned T5GSS1 : 1;
1195 unsigned T5GVAL : 1;
1196 unsigned T5GGO_NOT_T5DONE : 1;
1197 unsigned T5GSPM : 1;
1198 unsigned T5GTM : 1;
1199 unsigned T5GPOL : 1;
1200 unsigned TMR5GE : 1;
1203 struct
1205 unsigned : 1;
1206 unsigned : 1;
1207 unsigned : 1;
1208 unsigned T5GGO : 1;
1209 unsigned : 1;
1210 unsigned : 1;
1211 unsigned : 1;
1212 unsigned : 1;
1215 struct
1217 unsigned : 1;
1218 unsigned : 1;
1219 unsigned : 1;
1220 unsigned NOT_T5DONE : 1;
1221 unsigned : 1;
1222 unsigned : 1;
1223 unsigned : 1;
1224 unsigned : 1;
1227 struct
1229 unsigned : 1;
1230 unsigned : 1;
1231 unsigned : 1;
1232 unsigned T5DONE : 1;
1233 unsigned : 1;
1234 unsigned : 1;
1235 unsigned : 1;
1236 unsigned : 1;
1239 struct
1241 unsigned T5GSS : 2;
1242 unsigned : 6;
1244 } __T5GCONbits_t;
1246 extern __at(0x0F21) volatile __T5GCONbits_t T5GCONbits;
1248 #define _T5GSS0 0x01
1249 #define _T5GSS1 0x02
1250 #define _T5GVAL 0x04
1251 #define _T5GGO_NOT_T5DONE 0x08
1252 #define _T5GGO 0x08
1253 #define _NOT_T5DONE 0x08
1254 #define _T5DONE 0x08
1255 #define _T5GSPM 0x10
1256 #define _T5GTM 0x20
1257 #define _T5GPOL 0x40
1258 #define _TMR5GE 0x80
1260 //==============================================================================
1263 //==============================================================================
1264 // T5CON Bits
1266 extern __at(0x0F22) __sfr T5CON;
1268 typedef union
1270 struct
1272 unsigned TMR5ON : 1;
1273 unsigned RD16 : 1;
1274 unsigned NOT_T5SYNC : 1;
1275 unsigned T5OSCEN : 1;
1276 unsigned T5CKPS0 : 1;
1277 unsigned T5CKPS1 : 1;
1278 unsigned TMR5CS0 : 1;
1279 unsigned TMR5CS1 : 1;
1282 struct
1284 unsigned : 4;
1285 unsigned T5CKPS : 2;
1286 unsigned : 2;
1289 struct
1291 unsigned : 6;
1292 unsigned TMR5CS : 2;
1294 } __T5CONbits_t;
1296 extern __at(0x0F22) volatile __T5CONbits_t T5CONbits;
1298 #define _T5CON_TMR5ON 0x01
1299 #define _T5CON_RD16 0x02
1300 #define _T5CON_NOT_T5SYNC 0x04
1301 #define _T5CON_T5OSCEN 0x08
1302 #define _T5CON_T5CKPS0 0x10
1303 #define _T5CON_T5CKPS1 0x20
1304 #define _T5CON_TMR5CS0 0x40
1305 #define _T5CON_TMR5CS1 0x80
1307 //==============================================================================
1309 extern __at(0x0F23) __sfr TMR5L;
1310 extern __at(0x0F24) __sfr TMR5H;
1312 //==============================================================================
1313 // CM3CON Bits
1315 extern __at(0x0F25) __sfr CM3CON;
1317 typedef union
1319 struct
1321 unsigned CCH0 : 1;
1322 unsigned CCH1 : 1;
1323 unsigned CREF : 1;
1324 unsigned EVPOL0 : 1;
1325 unsigned EVPOL1 : 1;
1326 unsigned CPOL : 1;
1327 unsigned COE : 1;
1328 unsigned CON : 1;
1331 struct
1333 unsigned CCH : 2;
1334 unsigned : 6;
1337 struct
1339 unsigned : 3;
1340 unsigned EVPOL : 2;
1341 unsigned : 3;
1343 } __CM3CONbits_t;
1345 extern __at(0x0F25) volatile __CM3CONbits_t CM3CONbits;
1347 #define _CM3CON_CCH0 0x01
1348 #define _CM3CON_CCH1 0x02
1349 #define _CM3CON_CREF 0x04
1350 #define _CM3CON_EVPOL0 0x08
1351 #define _CM3CON_EVPOL1 0x10
1352 #define _CM3CON_CPOL 0x20
1353 #define _CM3CON_COE 0x40
1354 #define _CM3CON_CON 0x80
1356 //==============================================================================
1359 //==============================================================================
1360 // UEP0 Bits
1362 extern __at(0x0F26) __sfr UEP0;
1364 typedef struct
1366 unsigned EPSTALL : 1;
1367 unsigned EPINEN : 1;
1368 unsigned EPOUTEN : 1;
1369 unsigned EPCONDIS : 1;
1370 unsigned EPHSHK : 1;
1371 unsigned : 1;
1372 unsigned : 1;
1373 unsigned : 1;
1374 } __UEP0bits_t;
1376 extern __at(0x0F26) volatile __UEP0bits_t UEP0bits;
1378 #define _EPSTALL 0x01
1379 #define _EPINEN 0x02
1380 #define _EPOUTEN 0x04
1381 #define _EPCONDIS 0x08
1382 #define _EPHSHK 0x10
1384 //==============================================================================
1387 //==============================================================================
1388 // UEP1 Bits
1390 extern __at(0x0F27) __sfr UEP1;
1392 typedef struct
1394 unsigned EPSTALL : 1;
1395 unsigned EPINEN : 1;
1396 unsigned EPOUTEN : 1;
1397 unsigned EPCONDIS : 1;
1398 unsigned EPHSHK : 1;
1399 unsigned : 1;
1400 unsigned : 1;
1401 unsigned : 1;
1402 } __UEP1bits_t;
1404 extern __at(0x0F27) volatile __UEP1bits_t UEP1bits;
1406 #define _UEP1_EPSTALL 0x01
1407 #define _UEP1_EPINEN 0x02
1408 #define _UEP1_EPOUTEN 0x04
1409 #define _UEP1_EPCONDIS 0x08
1410 #define _UEP1_EPHSHK 0x10
1412 //==============================================================================
1415 //==============================================================================
1416 // UEP2 Bits
1418 extern __at(0x0F28) __sfr UEP2;
1420 typedef struct
1422 unsigned EPSTALL : 1;
1423 unsigned EPINEN : 1;
1424 unsigned EPOUTEN : 1;
1425 unsigned EPCONDIS : 1;
1426 unsigned EPHSHK : 1;
1427 unsigned : 1;
1428 unsigned : 1;
1429 unsigned : 1;
1430 } __UEP2bits_t;
1432 extern __at(0x0F28) volatile __UEP2bits_t UEP2bits;
1434 #define _UEP2_EPSTALL 0x01
1435 #define _UEP2_EPINEN 0x02
1436 #define _UEP2_EPOUTEN 0x04
1437 #define _UEP2_EPCONDIS 0x08
1438 #define _UEP2_EPHSHK 0x10
1440 //==============================================================================
1443 //==============================================================================
1444 // UEP3 Bits
1446 extern __at(0x0F29) __sfr UEP3;
1448 typedef struct
1450 unsigned EPSTALL : 1;
1451 unsigned EPINEN : 1;
1452 unsigned EPOUTEN : 1;
1453 unsigned EPCONDIS : 1;
1454 unsigned EPHSHK : 1;
1455 unsigned : 1;
1456 unsigned : 1;
1457 unsigned : 1;
1458 } __UEP3bits_t;
1460 extern __at(0x0F29) volatile __UEP3bits_t UEP3bits;
1462 #define _UEP3_EPSTALL 0x01
1463 #define _UEP3_EPINEN 0x02
1464 #define _UEP3_EPOUTEN 0x04
1465 #define _UEP3_EPCONDIS 0x08
1466 #define _UEP3_EPHSHK 0x10
1468 //==============================================================================
1471 //==============================================================================
1472 // UEP4 Bits
1474 extern __at(0x0F2A) __sfr UEP4;
1476 typedef struct
1478 unsigned EPSTALL : 1;
1479 unsigned EPINEN : 1;
1480 unsigned EPOUTEN : 1;
1481 unsigned EPCONDIS : 1;
1482 unsigned EPHSHK : 1;
1483 unsigned : 1;
1484 unsigned : 1;
1485 unsigned : 1;
1486 } __UEP4bits_t;
1488 extern __at(0x0F2A) volatile __UEP4bits_t UEP4bits;
1490 #define _UEP4_EPSTALL 0x01
1491 #define _UEP4_EPINEN 0x02
1492 #define _UEP4_EPOUTEN 0x04
1493 #define _UEP4_EPCONDIS 0x08
1494 #define _UEP4_EPHSHK 0x10
1496 //==============================================================================
1499 //==============================================================================
1500 // UEP5 Bits
1502 extern __at(0x0F2B) __sfr UEP5;
1504 typedef struct
1506 unsigned EPSTALL : 1;
1507 unsigned EPINEN : 1;
1508 unsigned EPOUTEN : 1;
1509 unsigned EPCONDIS : 1;
1510 unsigned EPHSHK : 1;
1511 unsigned : 1;
1512 unsigned : 1;
1513 unsigned : 1;
1514 } __UEP5bits_t;
1516 extern __at(0x0F2B) volatile __UEP5bits_t UEP5bits;
1518 #define _UEP5_EPSTALL 0x01
1519 #define _UEP5_EPINEN 0x02
1520 #define _UEP5_EPOUTEN 0x04
1521 #define _UEP5_EPCONDIS 0x08
1522 #define _UEP5_EPHSHK 0x10
1524 //==============================================================================
1527 //==============================================================================
1528 // UEP6 Bits
1530 extern __at(0x0F2C) __sfr UEP6;
1532 typedef struct
1534 unsigned EPSTALL : 1;
1535 unsigned EPINEN : 1;
1536 unsigned EPOUTEN : 1;
1537 unsigned EPCONDIS : 1;
1538 unsigned EPHSHK : 1;
1539 unsigned : 1;
1540 unsigned : 1;
1541 unsigned : 1;
1542 } __UEP6bits_t;
1544 extern __at(0x0F2C) volatile __UEP6bits_t UEP6bits;
1546 #define _UEP6_EPSTALL 0x01
1547 #define _UEP6_EPINEN 0x02
1548 #define _UEP6_EPOUTEN 0x04
1549 #define _UEP6_EPCONDIS 0x08
1550 #define _UEP6_EPHSHK 0x10
1552 //==============================================================================
1555 //==============================================================================
1556 // UEP7 Bits
1558 extern __at(0x0F2D) __sfr UEP7;
1560 typedef struct
1562 unsigned EPSTALL : 1;
1563 unsigned EPINEN : 1;
1564 unsigned EPOUTEN : 1;
1565 unsigned EPCONDIS : 1;
1566 unsigned EPHSHK : 1;
1567 unsigned : 1;
1568 unsigned : 1;
1569 unsigned : 1;
1570 } __UEP7bits_t;
1572 extern __at(0x0F2D) volatile __UEP7bits_t UEP7bits;
1574 #define _UEP7_EPSTALL 0x01
1575 #define _UEP7_EPINEN 0x02
1576 #define _UEP7_EPOUTEN 0x04
1577 #define _UEP7_EPCONDIS 0x08
1578 #define _UEP7_EPHSHK 0x10
1580 //==============================================================================
1583 //==============================================================================
1584 // UEP8 Bits
1586 extern __at(0x0F2E) __sfr UEP8;
1588 typedef struct
1590 unsigned EPSTALL : 1;
1591 unsigned EPINEN : 1;
1592 unsigned EPOUTEN : 1;
1593 unsigned EPCONDIS : 1;
1594 unsigned EPHSHK : 1;
1595 unsigned : 1;
1596 unsigned : 1;
1597 unsigned : 1;
1598 } __UEP8bits_t;
1600 extern __at(0x0F2E) volatile __UEP8bits_t UEP8bits;
1602 #define _UEP8_EPSTALL 0x01
1603 #define _UEP8_EPINEN 0x02
1604 #define _UEP8_EPOUTEN 0x04
1605 #define _UEP8_EPCONDIS 0x08
1606 #define _UEP8_EPHSHK 0x10
1608 //==============================================================================
1611 //==============================================================================
1612 // UEP9 Bits
1614 extern __at(0x0F2F) __sfr UEP9;
1616 typedef struct
1618 unsigned EPSTALL : 1;
1619 unsigned EPINEN : 1;
1620 unsigned EPOUTEN : 1;
1621 unsigned EPCONDIS : 1;
1622 unsigned EPHSHK : 1;
1623 unsigned : 1;
1624 unsigned : 1;
1625 unsigned : 1;
1626 } __UEP9bits_t;
1628 extern __at(0x0F2F) volatile __UEP9bits_t UEP9bits;
1630 #define _UEP9_EPSTALL 0x01
1631 #define _UEP9_EPINEN 0x02
1632 #define _UEP9_EPOUTEN 0x04
1633 #define _UEP9_EPCONDIS 0x08
1634 #define _UEP9_EPHSHK 0x10
1636 //==============================================================================
1639 //==============================================================================
1640 // UEP10 Bits
1642 extern __at(0x0F30) __sfr UEP10;
1644 typedef struct
1646 unsigned EPSTALL : 1;
1647 unsigned EPINEN : 1;
1648 unsigned EPOUTEN : 1;
1649 unsigned EPCONDIS : 1;
1650 unsigned EPHSHK : 1;
1651 unsigned : 1;
1652 unsigned : 1;
1653 unsigned : 1;
1654 } __UEP10bits_t;
1656 extern __at(0x0F30) volatile __UEP10bits_t UEP10bits;
1658 #define _UEP10_EPSTALL 0x01
1659 #define _UEP10_EPINEN 0x02
1660 #define _UEP10_EPOUTEN 0x04
1661 #define _UEP10_EPCONDIS 0x08
1662 #define _UEP10_EPHSHK 0x10
1664 //==============================================================================
1667 //==============================================================================
1668 // UEP11 Bits
1670 extern __at(0x0F31) __sfr UEP11;
1672 typedef struct
1674 unsigned EPSTALL : 1;
1675 unsigned EPINEN : 1;
1676 unsigned EPOUTEN : 1;
1677 unsigned EPCONDIS : 1;
1678 unsigned EPHSHK : 1;
1679 unsigned : 1;
1680 unsigned : 1;
1681 unsigned : 1;
1682 } __UEP11bits_t;
1684 extern __at(0x0F31) volatile __UEP11bits_t UEP11bits;
1686 #define _UEP11_EPSTALL 0x01
1687 #define _UEP11_EPINEN 0x02
1688 #define _UEP11_EPOUTEN 0x04
1689 #define _UEP11_EPCONDIS 0x08
1690 #define _UEP11_EPHSHK 0x10
1692 //==============================================================================
1695 //==============================================================================
1696 // UEP12 Bits
1698 extern __at(0x0F32) __sfr UEP12;
1700 typedef struct
1702 unsigned EPSTALL : 1;
1703 unsigned EPINEN : 1;
1704 unsigned EPOUTEN : 1;
1705 unsigned EPCONDIS : 1;
1706 unsigned EPHSHK : 1;
1707 unsigned : 1;
1708 unsigned : 1;
1709 unsigned : 1;
1710 } __UEP12bits_t;
1712 extern __at(0x0F32) volatile __UEP12bits_t UEP12bits;
1714 #define _UEP12_EPSTALL 0x01
1715 #define _UEP12_EPINEN 0x02
1716 #define _UEP12_EPOUTEN 0x04
1717 #define _UEP12_EPCONDIS 0x08
1718 #define _UEP12_EPHSHK 0x10
1720 //==============================================================================
1723 //==============================================================================
1724 // UEP13 Bits
1726 extern __at(0x0F33) __sfr UEP13;
1728 typedef struct
1730 unsigned EPSTALL : 1;
1731 unsigned EPINEN : 1;
1732 unsigned EPOUTEN : 1;
1733 unsigned EPCONDIS : 1;
1734 unsigned EPHSHK : 1;
1735 unsigned : 1;
1736 unsigned : 1;
1737 unsigned : 1;
1738 } __UEP13bits_t;
1740 extern __at(0x0F33) volatile __UEP13bits_t UEP13bits;
1742 #define _UEP13_EPSTALL 0x01
1743 #define _UEP13_EPINEN 0x02
1744 #define _UEP13_EPOUTEN 0x04
1745 #define _UEP13_EPCONDIS 0x08
1746 #define _UEP13_EPHSHK 0x10
1748 //==============================================================================
1751 //==============================================================================
1752 // UEP14 Bits
1754 extern __at(0x0F34) __sfr UEP14;
1756 typedef struct
1758 unsigned EPSTALL : 1;
1759 unsigned EPINEN : 1;
1760 unsigned EPOUTEN : 1;
1761 unsigned EPCONDIS : 1;
1762 unsigned EPHSHK : 1;
1763 unsigned : 1;
1764 unsigned : 1;
1765 unsigned : 1;
1766 } __UEP14bits_t;
1768 extern __at(0x0F34) volatile __UEP14bits_t UEP14bits;
1770 #define _UEP14_EPSTALL 0x01
1771 #define _UEP14_EPINEN 0x02
1772 #define _UEP14_EPOUTEN 0x04
1773 #define _UEP14_EPCONDIS 0x08
1774 #define _UEP14_EPHSHK 0x10
1776 //==============================================================================
1779 //==============================================================================
1780 // UEP15 Bits
1782 extern __at(0x0F35) __sfr UEP15;
1784 typedef struct
1786 unsigned EPSTALL : 1;
1787 unsigned EPINEN : 1;
1788 unsigned EPOUTEN : 1;
1789 unsigned EPCONDIS : 1;
1790 unsigned EPHSHK : 1;
1791 unsigned : 1;
1792 unsigned : 1;
1793 unsigned : 1;
1794 } __UEP15bits_t;
1796 extern __at(0x0F35) volatile __UEP15bits_t UEP15bits;
1798 #define _UEP15_EPSTALL 0x01
1799 #define _UEP15_EPINEN 0x02
1800 #define _UEP15_EPOUTEN 0x04
1801 #define _UEP15_EPCONDIS 0x08
1802 #define _UEP15_EPHSHK 0x10
1804 //==============================================================================
1807 //==============================================================================
1808 // UIE Bits
1810 extern __at(0x0F36) __sfr UIE;
1812 typedef struct
1814 unsigned URSTIE : 1;
1815 unsigned UERRIE : 1;
1816 unsigned ACTVIE : 1;
1817 unsigned TRNIE : 1;
1818 unsigned IDLEIE : 1;
1819 unsigned STALLIE : 1;
1820 unsigned SOFIE : 1;
1821 unsigned : 1;
1822 } __UIEbits_t;
1824 extern __at(0x0F36) volatile __UIEbits_t UIEbits;
1826 #define _URSTIE 0x01
1827 #define _UERRIE 0x02
1828 #define _ACTVIE 0x04
1829 #define _TRNIE 0x08
1830 #define _IDLEIE 0x10
1831 #define _STALLIE 0x20
1832 #define _SOFIE 0x40
1834 //==============================================================================
1837 //==============================================================================
1838 // UEIE Bits
1840 extern __at(0x0F37) __sfr UEIE;
1842 typedef struct
1844 unsigned PIDEE : 1;
1845 unsigned CRC5EE : 1;
1846 unsigned CRC16EE : 1;
1847 unsigned DFN8EE : 1;
1848 unsigned BTOEE : 1;
1849 unsigned : 1;
1850 unsigned : 1;
1851 unsigned BTSEE : 1;
1852 } __UEIEbits_t;
1854 extern __at(0x0F37) volatile __UEIEbits_t UEIEbits;
1856 #define _PIDEE 0x01
1857 #define _CRC5EE 0x02
1858 #define _CRC16EE 0x04
1859 #define _DFN8EE 0x08
1860 #define _BTOEE 0x10
1861 #define _BTSEE 0x80
1863 //==============================================================================
1866 //==============================================================================
1867 // UADDR Bits
1869 extern __at(0x0F38) __sfr UADDR;
1871 typedef union
1873 struct
1875 unsigned ADDR0 : 1;
1876 unsigned ADDR1 : 1;
1877 unsigned ADDR2 : 1;
1878 unsigned ADDR3 : 1;
1879 unsigned ADDR4 : 1;
1880 unsigned ADDR5 : 1;
1881 unsigned ADDR6 : 1;
1882 unsigned : 1;
1885 struct
1887 unsigned ADDR : 7;
1888 unsigned : 1;
1890 } __UADDRbits_t;
1892 extern __at(0x0F38) volatile __UADDRbits_t UADDRbits;
1894 #define _ADDR0 0x01
1895 #define _ADDR1 0x02
1896 #define _ADDR2 0x04
1897 #define _ADDR3 0x08
1898 #define _ADDR4 0x10
1899 #define _ADDR5 0x20
1900 #define _ADDR6 0x40
1902 //==============================================================================
1905 //==============================================================================
1906 // UCFG Bits
1908 extern __at(0x0F39) __sfr UCFG;
1910 typedef union
1912 struct
1914 unsigned PPB0 : 1;
1915 unsigned PPB1 : 1;
1916 unsigned FSEN : 1;
1917 unsigned UTRDIS : 1;
1918 unsigned UPUEN : 1;
1919 unsigned : 1;
1920 unsigned UOEMON : 1;
1921 unsigned UTEYE : 1;
1924 struct
1926 unsigned PPB : 2;
1927 unsigned : 6;
1929 } __UCFGbits_t;
1931 extern __at(0x0F39) volatile __UCFGbits_t UCFGbits;
1933 #define _PPB0 0x01
1934 #define _PPB1 0x02
1935 #define _FSEN 0x04
1936 #define _UTRDIS 0x08
1937 #define _UPUEN 0x10
1938 #define _UOEMON 0x40
1939 #define _UTEYE 0x80
1941 //==============================================================================
1943 extern __at(0x0F3A) __sfr RTCVALL;
1944 extern __at(0x0F3B) __sfr RTCVALH;
1946 //==============================================================================
1947 // PADCFG1 Bits
1949 extern __at(0x0F3C) __sfr PADCFG1;
1951 typedef union
1953 struct
1955 unsigned PMPTTL : 1;
1956 unsigned RTSECSEL0 : 1;
1957 unsigned RTSECSEL1 : 1;
1958 unsigned : 1;
1959 unsigned : 1;
1960 unsigned : 1;
1961 unsigned : 1;
1962 unsigned : 1;
1965 struct
1967 unsigned : 1;
1968 unsigned RTSECSEL : 2;
1969 unsigned : 5;
1971 } __PADCFG1bits_t;
1973 extern __at(0x0F3C) volatile __PADCFG1bits_t PADCFG1bits;
1975 #define _PMPTTL 0x01
1976 #define _RTSECSEL0 0x02
1977 #define _RTSECSEL1 0x04
1979 //==============================================================================
1982 //==============================================================================
1983 // REFOCON Bits
1985 extern __at(0x0F3D) __sfr REFOCON;
1987 typedef union
1989 struct
1991 unsigned RODIV0 : 1;
1992 unsigned RODIV1 : 1;
1993 unsigned RODIV2 : 1;
1994 unsigned RODIV3 : 1;
1995 unsigned ROSEL : 1;
1996 unsigned ROSSLP : 1;
1997 unsigned : 1;
1998 unsigned ROON : 1;
2001 struct
2003 unsigned RODIV : 4;
2004 unsigned : 4;
2006 } __REFOCONbits_t;
2008 extern __at(0x0F3D) volatile __REFOCONbits_t REFOCONbits;
2010 #define _RODIV0 0x01
2011 #define _RODIV1 0x02
2012 #define _RODIV2 0x04
2013 #define _RODIV3 0x08
2014 #define _ROSEL 0x10
2015 #define _ROSSLP 0x20
2016 #define _ROON 0x80
2018 //==============================================================================
2021 //==============================================================================
2022 // RTCCAL Bits
2024 extern __at(0x0F3E) __sfr RTCCAL;
2026 typedef struct
2028 unsigned CAL0 : 1;
2029 unsigned CAL1 : 1;
2030 unsigned CAL2 : 1;
2031 unsigned CAL3 : 1;
2032 unsigned CAL4 : 1;
2033 unsigned CAL5 : 1;
2034 unsigned CAL6 : 1;
2035 unsigned CAL7 : 1;
2036 } __RTCCALbits_t;
2038 extern __at(0x0F3E) volatile __RTCCALbits_t RTCCALbits;
2040 #define _CAL0 0x01
2041 #define _CAL1 0x02
2042 #define _CAL2 0x04
2043 #define _CAL3 0x08
2044 #define _CAL4 0x10
2045 #define _CAL5 0x20
2046 #define _CAL6 0x40
2047 #define _CAL7 0x80
2049 //==============================================================================
2052 //==============================================================================
2053 // RTCCFG Bits
2055 extern __at(0x0F3F) __sfr RTCCFG;
2057 typedef union
2059 struct
2061 unsigned RTCPTR0 : 1;
2062 unsigned RTCPTR1 : 1;
2063 unsigned RTCOE : 1;
2064 unsigned HALFSEC : 1;
2065 unsigned RTCSYNC : 1;
2066 unsigned RTCWREN : 1;
2067 unsigned : 1;
2068 unsigned RTCEN : 1;
2071 struct
2073 unsigned RTCPTR : 2;
2074 unsigned : 6;
2076 } __RTCCFGbits_t;
2078 extern __at(0x0F3F) volatile __RTCCFGbits_t RTCCFGbits;
2080 #define _RTCPTR0 0x01
2081 #define _RTCPTR1 0x02
2082 #define _RTCOE 0x04
2083 #define _HALFSEC 0x08
2084 #define _RTCSYNC 0x10
2085 #define _RTCWREN 0x20
2086 #define _RTCEN 0x80
2088 //==============================================================================
2091 //==============================================================================
2092 // ODCON3 Bits
2094 extern __at(0x0F40) __sfr ODCON3;
2096 typedef struct
2098 unsigned SPI1OD : 1;
2099 unsigned SPI2OD : 1;
2100 unsigned : 1;
2101 unsigned : 1;
2102 unsigned : 1;
2103 unsigned : 1;
2104 unsigned : 1;
2105 unsigned : 1;
2106 } __ODCON3bits_t;
2108 extern __at(0x0F40) volatile __ODCON3bits_t ODCON3bits;
2110 #define _SPI1OD 0x01
2111 #define _SPI2OD 0x02
2113 //==============================================================================
2116 //==============================================================================
2117 // ODCON2 Bits
2119 extern __at(0x0F41) __sfr ODCON2;
2121 typedef struct
2123 unsigned U1OD : 1;
2124 unsigned U2OD : 1;
2125 unsigned CCP9OD : 1;
2126 unsigned CCP10OD : 1;
2127 unsigned : 1;
2128 unsigned : 1;
2129 unsigned : 1;
2130 unsigned : 1;
2131 } __ODCON2bits_t;
2133 extern __at(0x0F41) volatile __ODCON2bits_t ODCON2bits;
2135 #define _U1OD 0x01
2136 #define _U2OD 0x02
2137 #define _CCP9OD 0x04
2138 #define _CCP10OD 0x08
2140 //==============================================================================
2143 //==============================================================================
2144 // ODCON1 Bits
2146 extern __at(0x0F42) __sfr ODCON1;
2148 typedef struct
2150 unsigned ECCP1OD : 1;
2151 unsigned ECCP2OD : 1;
2152 unsigned ECCP3OD : 1;
2153 unsigned CCP4OD : 1;
2154 unsigned CCP5OD : 1;
2155 unsigned CCP6OD : 1;
2156 unsigned CCP7OD : 1;
2157 unsigned CCP8OD : 1;
2158 } __ODCON1bits_t;
2160 extern __at(0x0F42) volatile __ODCON1bits_t ODCON1bits;
2162 #define _ECCP1OD 0x01
2163 #define _ECCP2OD 0x02
2164 #define _ECCP3OD 0x04
2165 #define _CCP4OD 0x08
2166 #define _CCP5OD 0x10
2167 #define _CCP6OD 0x20
2168 #define _CCP7OD 0x40
2169 #define _CCP8OD 0x80
2171 //==============================================================================
2173 extern __at(0x0F44) __sfr ALRMVALL;
2174 extern __at(0x0F45) __sfr ALRMVALH;
2176 //==============================================================================
2177 // ALRMRPT Bits
2179 extern __at(0x0F46) __sfr ALRMRPT;
2181 typedef struct
2183 unsigned ARPT0 : 1;
2184 unsigned ARPT1 : 1;
2185 unsigned ARPT2 : 1;
2186 unsigned ARPT3 : 1;
2187 unsigned ARPT4 : 1;
2188 unsigned ARPT5 : 1;
2189 unsigned ARPT6 : 1;
2190 unsigned ARPT7 : 1;
2191 } __ALRMRPTbits_t;
2193 extern __at(0x0F46) volatile __ALRMRPTbits_t ALRMRPTbits;
2195 #define _ARPT0 0x01
2196 #define _ARPT1 0x02
2197 #define _ARPT2 0x04
2198 #define _ARPT3 0x08
2199 #define _ARPT4 0x10
2200 #define _ARPT5 0x20
2201 #define _ARPT6 0x40
2202 #define _ARPT7 0x80
2204 //==============================================================================
2207 //==============================================================================
2208 // ALRMCFG Bits
2210 extern __at(0x0F47) __sfr ALRMCFG;
2212 typedef union
2214 struct
2216 unsigned ALRMPTR0 : 1;
2217 unsigned ALRMPTR1 : 1;
2218 unsigned AMASK0 : 1;
2219 unsigned AMASK1 : 1;
2220 unsigned AMASK2 : 1;
2221 unsigned AMASK3 : 1;
2222 unsigned CHIME : 1;
2223 unsigned ALRMEN : 1;
2226 struct
2228 unsigned ALRMPTR : 2;
2229 unsigned : 6;
2232 struct
2234 unsigned : 2;
2235 unsigned AMASK : 4;
2236 unsigned : 2;
2238 } __ALRMCFGbits_t;
2240 extern __at(0x0F47) volatile __ALRMCFGbits_t ALRMCFGbits;
2242 #define _ALRMPTR0 0x01
2243 #define _ALRMPTR1 0x02
2244 #define _AMASK0 0x04
2245 #define _AMASK1 0x08
2246 #define _AMASK2 0x10
2247 #define _AMASK3 0x20
2248 #define _CHIME 0x40
2249 #define _ALRMEN 0x80
2251 //==============================================================================
2254 //==============================================================================
2255 // ANCON0 Bits
2257 extern __at(0x0F48) __sfr ANCON0;
2259 typedef struct
2261 unsigned PCFG0 : 1;
2262 unsigned PCFG1 : 1;
2263 unsigned PCFG2 : 1;
2264 unsigned PCFG3 : 1;
2265 unsigned PCFG4 : 1;
2266 unsigned PCFG5 : 1;
2267 unsigned PCFG6 : 1;
2268 unsigned PCFG7 : 1;
2269 } __ANCON0bits_t;
2271 extern __at(0x0F48) volatile __ANCON0bits_t ANCON0bits;
2273 #define _PCFG0 0x01
2274 #define _PCFG1 0x02
2275 #define _PCFG2 0x04
2276 #define _PCFG3 0x08
2277 #define _PCFG4 0x10
2278 #define _PCFG5 0x20
2279 #define _PCFG6 0x40
2280 #define _PCFG7 0x80
2282 //==============================================================================
2285 //==============================================================================
2286 // ANCON1 Bits
2288 extern __at(0x0F49) __sfr ANCON1;
2290 typedef struct
2292 unsigned PCFG8 : 1;
2293 unsigned PCFG9 : 1;
2294 unsigned PCFG10 : 1;
2295 unsigned PCFG11 : 1;
2296 unsigned PCFG12 : 1;
2297 unsigned : 1;
2298 unsigned : 1;
2299 unsigned VBGEN : 1;
2300 } __ANCON1bits_t;
2302 extern __at(0x0F49) volatile __ANCON1bits_t ANCON1bits;
2304 #define _PCFG8 0x01
2305 #define _PCFG9 0x02
2306 #define _PCFG10 0x04
2307 #define _PCFG11 0x08
2308 #define _PCFG12 0x10
2309 #define _VBGEN 0x80
2311 //==============================================================================
2314 //==============================================================================
2315 // DSWAKEL Bits
2317 extern __at(0x0F4A) __sfr DSWAKEL;
2319 typedef struct
2321 unsigned DSPOR : 1;
2322 unsigned : 1;
2323 unsigned DSMCLR : 1;
2324 unsigned DSRTC : 1;
2325 unsigned DSWDT : 1;
2326 unsigned DSULP : 1;
2327 unsigned : 1;
2328 unsigned DSFLT : 1;
2329 } __DSWAKELbits_t;
2331 extern __at(0x0F4A) volatile __DSWAKELbits_t DSWAKELbits;
2333 #define _DSPOR 0x01
2334 #define _DSMCLR 0x04
2335 #define _DSRTC 0x08
2336 #define _DSWDT 0x10
2337 #define _DSULP 0x20
2338 #define _DSFLT 0x80
2340 //==============================================================================
2343 //==============================================================================
2344 // DSWAKEH Bits
2346 extern __at(0x0F4B) __sfr DSWAKEH;
2348 typedef struct
2350 unsigned DSINT0 : 1;
2351 unsigned : 1;
2352 unsigned : 1;
2353 unsigned : 1;
2354 unsigned : 1;
2355 unsigned : 1;
2356 unsigned : 1;
2357 unsigned : 1;
2358 } __DSWAKEHbits_t;
2360 extern __at(0x0F4B) volatile __DSWAKEHbits_t DSWAKEHbits;
2362 #define _DSINT0 0x01
2364 //==============================================================================
2367 //==============================================================================
2368 // DSCONL Bits
2370 extern __at(0x0F4C) __sfr DSCONL;
2372 typedef struct
2374 unsigned RELEASE : 1;
2375 unsigned DSBOR : 1;
2376 unsigned ULPWDIS : 1;
2377 unsigned : 1;
2378 unsigned : 1;
2379 unsigned : 1;
2380 unsigned : 1;
2381 unsigned : 1;
2382 } __DSCONLbits_t;
2384 extern __at(0x0F4C) volatile __DSCONLbits_t DSCONLbits;
2386 #define _RELEASE 0x01
2387 #define _DSBOR 0x02
2388 #define _ULPWDIS 0x04
2390 //==============================================================================
2393 //==============================================================================
2394 // DSCONH Bits
2396 extern __at(0x0F4D) __sfr DSCONH;
2398 typedef struct
2400 unsigned RTCWDIS : 1;
2401 unsigned DSULPEN : 1;
2402 unsigned : 1;
2403 unsigned : 1;
2404 unsigned : 1;
2405 unsigned : 1;
2406 unsigned : 1;
2407 unsigned DSEN : 1;
2408 } __DSCONHbits_t;
2410 extern __at(0x0F4D) volatile __DSCONHbits_t DSCONHbits;
2412 #define _RTCWDIS 0x01
2413 #define _DSULPEN 0x02
2414 #define _DSEN 0x80
2416 //==============================================================================
2418 extern __at(0x0F4E) __sfr DSGPR0;
2419 extern __at(0x0F4F) __sfr DSGPR1;
2421 //==============================================================================
2422 // CCPTMRS2 Bits
2424 extern __at(0x0F50) __sfr CCPTMRS2;
2426 typedef union
2428 struct
2430 unsigned C8TSEL0 : 1;
2431 unsigned C8TSEL1 : 1;
2432 unsigned C9TSEL0 : 1;
2433 unsigned : 1;
2434 unsigned C10TSEL0 : 1;
2435 unsigned : 1;
2436 unsigned : 1;
2437 unsigned : 1;
2440 struct
2442 unsigned C8TSEL : 2;
2443 unsigned : 6;
2445 } __CCPTMRS2bits_t;
2447 extern __at(0x0F50) volatile __CCPTMRS2bits_t CCPTMRS2bits;
2449 #define _C8TSEL0 0x01
2450 #define _C8TSEL1 0x02
2451 #define _C9TSEL0 0x04
2452 #define _C10TSEL0 0x10
2454 //==============================================================================
2457 //==============================================================================
2458 // CCPTMRS1 Bits
2460 extern __at(0x0F51) __sfr CCPTMRS1;
2462 typedef union
2464 struct
2466 unsigned C4TSEL0 : 1;
2467 unsigned C4TSEL1 : 1;
2468 unsigned C5TSEL0 : 1;
2469 unsigned : 1;
2470 unsigned C6TSEL0 : 1;
2471 unsigned : 1;
2472 unsigned C7TSEL0 : 1;
2473 unsigned C7TSEL1 : 1;
2476 struct
2478 unsigned C4TSEL : 2;
2479 unsigned : 6;
2482 struct
2484 unsigned : 6;
2485 unsigned C7TSEL : 2;
2487 } __CCPTMRS1bits_t;
2489 extern __at(0x0F51) volatile __CCPTMRS1bits_t CCPTMRS1bits;
2491 #define _C4TSEL0 0x01
2492 #define _C4TSEL1 0x02
2493 #define _C5TSEL0 0x04
2494 #define _C6TSEL0 0x10
2495 #define _C7TSEL0 0x40
2496 #define _C7TSEL1 0x80
2498 //==============================================================================
2501 //==============================================================================
2502 // CCPTMRS0 Bits
2504 extern __at(0x0F52) __sfr CCPTMRS0;
2506 typedef union
2508 struct
2510 unsigned C1TSEL0 : 1;
2511 unsigned C1TSEL1 : 1;
2512 unsigned C1TSEL2 : 1;
2513 unsigned C2TSEL0 : 1;
2514 unsigned C2TSEL1 : 1;
2515 unsigned C2TSEL2 : 1;
2516 unsigned C3TSEL0 : 1;
2517 unsigned C3TSEL1 : 1;
2520 struct
2522 unsigned C1TSEL : 3;
2523 unsigned : 5;
2526 struct
2528 unsigned : 3;
2529 unsigned C2TSEL : 3;
2530 unsigned : 2;
2533 struct
2535 unsigned : 6;
2536 unsigned C3TSEL : 2;
2538 } __CCPTMRS0bits_t;
2540 extern __at(0x0F52) volatile __CCPTMRS0bits_t CCPTMRS0bits;
2542 #define _C1TSEL0 0x01
2543 #define _C1TSEL1 0x02
2544 #define _C1TSEL2 0x04
2545 #define _C2TSEL0 0x08
2546 #define _C2TSEL1 0x10
2547 #define _C2TSEL2 0x20
2548 #define _C3TSEL0 0x40
2549 #define _C3TSEL1 0x80
2551 //==============================================================================
2554 //==============================================================================
2555 // CVRCON Bits
2557 extern __at(0x0F53) __sfr CVRCON;
2559 typedef union
2561 struct
2563 unsigned CVR0 : 1;
2564 unsigned CVR1 : 1;
2565 unsigned CVR2 : 1;
2566 unsigned CVR3 : 1;
2567 unsigned CVRSS : 1;
2568 unsigned CVRR : 1;
2569 unsigned CVROE : 1;
2570 unsigned CVREN : 1;
2573 struct
2575 unsigned CVR : 4;
2576 unsigned : 4;
2578 } __CVRCONbits_t;
2580 extern __at(0x0F53) volatile __CVRCONbits_t CVRCONbits;
2582 #define _CVR0 0x01
2583 #define _CVR1 0x02
2584 #define _CVR2 0x04
2585 #define _CVR3 0x08
2586 #define _CVRSS 0x10
2587 #define _CVRR 0x20
2588 #define _CVROE 0x40
2589 #define _CVREN 0x80
2591 //==============================================================================
2594 //==============================================================================
2595 // PMSTATL Bits
2597 extern __at(0x0F54) __sfr PMSTATL;
2599 typedef struct
2601 unsigned OB0E : 1;
2602 unsigned OB1E : 1;
2603 unsigned OB2E : 1;
2604 unsigned OB3E : 1;
2605 unsigned : 1;
2606 unsigned : 1;
2607 unsigned OBUF : 1;
2608 unsigned OBE : 1;
2609 } __PMSTATLbits_t;
2611 extern __at(0x0F54) volatile __PMSTATLbits_t PMSTATLbits;
2613 #define _OB0E 0x01
2614 #define _OB1E 0x02
2615 #define _OB2E 0x04
2616 #define _OB3E 0x08
2617 #define _OBUF 0x40
2618 #define _OBE 0x80
2620 //==============================================================================
2623 //==============================================================================
2624 // PMSTATH Bits
2626 extern __at(0x0F55) __sfr PMSTATH;
2628 typedef struct
2630 unsigned IB0F : 1;
2631 unsigned IB1F : 1;
2632 unsigned IB2F : 1;
2633 unsigned IB3F : 1;
2634 unsigned : 1;
2635 unsigned : 1;
2636 unsigned IBOV : 1;
2637 unsigned IBF : 1;
2638 } __PMSTATHbits_t;
2640 extern __at(0x0F55) volatile __PMSTATHbits_t PMSTATHbits;
2642 #define _IB0F 0x01
2643 #define _IB1F 0x02
2644 #define _IB2F 0x04
2645 #define _IB3F 0x08
2646 #define _IBOV 0x40
2647 #define _IBF 0x80
2649 //==============================================================================
2652 //==============================================================================
2653 // PMEL Bits
2655 extern __at(0x0F56) __sfr PMEL;
2657 typedef struct
2659 unsigned PTEN0 : 1;
2660 unsigned PTEN1 : 1;
2661 unsigned PTEN2 : 1;
2662 unsigned PTEN3 : 1;
2663 unsigned PTEN4 : 1;
2664 unsigned PTEN5 : 1;
2665 unsigned PTEN6 : 1;
2666 unsigned PTEN7 : 1;
2667 } __PMELbits_t;
2669 extern __at(0x0F56) volatile __PMELbits_t PMELbits;
2671 #define _PTEN0 0x01
2672 #define _PTEN1 0x02
2673 #define _PTEN2 0x04
2674 #define _PTEN3 0x08
2675 #define _PTEN4 0x10
2676 #define _PTEN5 0x20
2677 #define _PTEN6 0x40
2678 #define _PTEN7 0x80
2680 //==============================================================================
2683 //==============================================================================
2684 // PMEH Bits
2686 extern __at(0x0F57) __sfr PMEH;
2688 typedef struct
2690 unsigned PTEN8 : 1;
2691 unsigned PTEN9 : 1;
2692 unsigned PTEN10 : 1;
2693 unsigned PTEN11 : 1;
2694 unsigned PTEN12 : 1;
2695 unsigned PTEN13 : 1;
2696 unsigned PTEN14 : 1;
2697 unsigned PTEN15 : 1;
2698 } __PMEHbits_t;
2700 extern __at(0x0F57) volatile __PMEHbits_t PMEHbits;
2702 #define _PTEN8 0x01
2703 #define _PTEN9 0x02
2704 #define _PTEN10 0x04
2705 #define _PTEN11 0x08
2706 #define _PTEN12 0x10
2707 #define _PTEN13 0x20
2708 #define _PTEN14 0x40
2709 #define _PTEN15 0x80
2711 //==============================================================================
2713 extern __at(0x0F58) __sfr PMDIN2L;
2714 extern __at(0x0F59) __sfr PMDIN2H;
2715 extern __at(0x0F5A) __sfr PMDOUT2L;
2716 extern __at(0x0F5B) __sfr PMDOUT2H;
2718 //==============================================================================
2719 // PMMODEL Bits
2721 extern __at(0x0F5C) __sfr PMMODEL;
2723 typedef union
2725 struct
2727 unsigned WAITE0 : 1;
2728 unsigned WAITE1 : 1;
2729 unsigned WAITM0 : 1;
2730 unsigned WAITM1 : 1;
2731 unsigned WAITM2 : 1;
2732 unsigned WAITM3 : 1;
2733 unsigned WAITB0 : 1;
2734 unsigned WAITB1 : 1;
2737 struct
2739 unsigned WAITE : 2;
2740 unsigned : 6;
2743 struct
2745 unsigned : 2;
2746 unsigned WAITM : 4;
2747 unsigned : 2;
2750 struct
2752 unsigned : 6;
2753 unsigned WAITB : 2;
2755 } __PMMODELbits_t;
2757 extern __at(0x0F5C) volatile __PMMODELbits_t PMMODELbits;
2759 #define _WAITE0 0x01
2760 #define _WAITE1 0x02
2761 #define _WAITM0 0x04
2762 #define _WAITM1 0x08
2763 #define _WAITM2 0x10
2764 #define _WAITM3 0x20
2765 #define _WAITB0 0x40
2766 #define _WAITB1 0x80
2768 //==============================================================================
2771 //==============================================================================
2772 // PMMODEH Bits
2774 extern __at(0x0F5D) __sfr PMMODEH;
2776 typedef union
2778 struct
2780 unsigned MODE0 : 1;
2781 unsigned MODE1 : 1;
2782 unsigned MODE16 : 1;
2783 unsigned INCM0 : 1;
2784 unsigned INCM1 : 1;
2785 unsigned IRQM0 : 1;
2786 unsigned IRQM1 : 1;
2787 unsigned BUSY : 1;
2790 struct
2792 unsigned : 3;
2793 unsigned INCM : 2;
2794 unsigned : 3;
2797 struct
2799 unsigned : 5;
2800 unsigned IRQM : 2;
2801 unsigned : 1;
2803 } __PMMODEHbits_t;
2805 extern __at(0x0F5D) volatile __PMMODEHbits_t PMMODEHbits;
2807 #define _MODE0 0x01
2808 #define _MODE1 0x02
2809 #define _MODE16 0x04
2810 #define _INCM0 0x08
2811 #define _INCM1 0x10
2812 #define _IRQM0 0x20
2813 #define _IRQM1 0x40
2814 #define _BUSY 0x80
2816 //==============================================================================
2819 //==============================================================================
2820 // PMCONL Bits
2822 extern __at(0x0F5E) __sfr PMCONL;
2824 typedef union
2826 struct
2828 unsigned RDSP : 1;
2829 unsigned WRSP : 1;
2830 unsigned BEP : 1;
2831 unsigned CS1P : 1;
2832 unsigned Reserved : 1;
2833 unsigned ALP : 1;
2834 unsigned CSF0 : 1;
2835 unsigned CSF1 : 1;
2838 struct
2840 unsigned : 6;
2841 unsigned CSF : 2;
2843 } __PMCONLbits_t;
2845 extern __at(0x0F5E) volatile __PMCONLbits_t PMCONLbits;
2847 #define _RDSP 0x01
2848 #define _WRSP 0x02
2849 #define _BEP 0x04
2850 #define _CS1P 0x08
2851 #define _Reserved 0x10
2852 #define _ALP 0x20
2853 #define _CSF0 0x40
2854 #define _CSF1 0x80
2856 //==============================================================================
2859 //==============================================================================
2860 // PMCONH Bits
2862 extern __at(0x0F5F) __sfr PMCONH;
2864 typedef union
2866 struct
2868 unsigned PTRDEN : 1;
2869 unsigned PTWREN : 1;
2870 unsigned PTBEEN : 1;
2871 unsigned ADRMUX0 : 1;
2872 unsigned ADRMUX1 : 1;
2873 unsigned PSIDL : 1;
2874 unsigned : 1;
2875 unsigned PMPEN : 1;
2878 struct
2880 unsigned : 3;
2881 unsigned ADRMUX : 2;
2882 unsigned : 3;
2884 } __PMCONHbits_t;
2886 extern __at(0x0F5F) volatile __PMCONHbits_t PMCONHbits;
2888 #define _PTRDEN 0x01
2889 #define _PTWREN 0x02
2890 #define _PTBEEN 0x04
2891 #define _ADRMUX0 0x08
2892 #define _ADRMUX1 0x10
2893 #define _PSIDL 0x20
2894 #define _PMPEN 0x80
2896 //==============================================================================
2898 extern __at(0x0F60) __sfr UFRM;
2900 //==============================================================================
2901 // UFRML Bits
2903 extern __at(0x0F60) __sfr UFRML;
2905 typedef struct
2907 unsigned FRM0 : 1;
2908 unsigned FRM1 : 1;
2909 unsigned FRM2 : 1;
2910 unsigned FRM3 : 1;
2911 unsigned FRM4 : 1;
2912 unsigned FRM5 : 1;
2913 unsigned FRM6 : 1;
2914 unsigned FRM7 : 1;
2915 } __UFRMLbits_t;
2917 extern __at(0x0F60) volatile __UFRMLbits_t UFRMLbits;
2919 #define _FRM0 0x01
2920 #define _FRM1 0x02
2921 #define _FRM2 0x04
2922 #define _FRM3 0x08
2923 #define _FRM4 0x10
2924 #define _FRM5 0x20
2925 #define _FRM6 0x40
2926 #define _FRM7 0x80
2928 //==============================================================================
2931 //==============================================================================
2932 // UFRMH Bits
2934 extern __at(0x0F61) __sfr UFRMH;
2936 typedef struct
2938 unsigned FRM8 : 1;
2939 unsigned FRM9 : 1;
2940 unsigned FRM10 : 1;
2941 unsigned : 1;
2942 unsigned : 1;
2943 unsigned : 1;
2944 unsigned : 1;
2945 unsigned : 1;
2946 } __UFRMHbits_t;
2948 extern __at(0x0F61) volatile __UFRMHbits_t UFRMHbits;
2950 #define _FRM8 0x01
2951 #define _FRM9 0x02
2952 #define _FRM10 0x04
2954 //==============================================================================
2957 //==============================================================================
2958 // UIR Bits
2960 extern __at(0x0F62) __sfr UIR;
2962 typedef struct
2964 unsigned URSTIF : 1;
2965 unsigned UERRIF : 1;
2966 unsigned ACTVIF : 1;
2967 unsigned TRNIF : 1;
2968 unsigned IDLEIF : 1;
2969 unsigned STALLIF : 1;
2970 unsigned SOFIF : 1;
2971 unsigned : 1;
2972 } __UIRbits_t;
2974 extern __at(0x0F62) volatile __UIRbits_t UIRbits;
2976 #define _URSTIF 0x01
2977 #define _UERRIF 0x02
2978 #define _ACTVIF 0x04
2979 #define _TRNIF 0x08
2980 #define _IDLEIF 0x10
2981 #define _STALLIF 0x20
2982 #define _SOFIF 0x40
2984 //==============================================================================
2987 //==============================================================================
2988 // UEIR Bits
2990 extern __at(0x0F63) __sfr UEIR;
2992 typedef struct
2994 unsigned PIDEF : 1;
2995 unsigned CRC5EF : 1;
2996 unsigned CRC16EF : 1;
2997 unsigned DFN8EF : 1;
2998 unsigned BTOEF : 1;
2999 unsigned : 1;
3000 unsigned : 1;
3001 unsigned BTSEF : 1;
3002 } __UEIRbits_t;
3004 extern __at(0x0F63) volatile __UEIRbits_t UEIRbits;
3006 #define _PIDEF 0x01
3007 #define _CRC5EF 0x02
3008 #define _CRC16EF 0x04
3009 #define _DFN8EF 0x08
3010 #define _BTOEF 0x10
3011 #define _BTSEF 0x80
3013 //==============================================================================
3016 //==============================================================================
3017 // USTAT Bits
3019 extern __at(0x0F64) __sfr USTAT;
3021 typedef union
3023 struct
3025 unsigned : 1;
3026 unsigned PPBI : 1;
3027 unsigned DIR : 1;
3028 unsigned ENDP0 : 1;
3029 unsigned ENDP1 : 1;
3030 unsigned ENDP2 : 1;
3031 unsigned ENDP3 : 1;
3032 unsigned : 1;
3035 struct
3037 unsigned : 3;
3038 unsigned ENDP : 4;
3039 unsigned : 1;
3041 } __USTATbits_t;
3043 extern __at(0x0F64) volatile __USTATbits_t USTATbits;
3045 #define _PPBI 0x02
3046 #define _DIR 0x04
3047 #define _ENDP0 0x08
3048 #define _ENDP1 0x10
3049 #define _ENDP2 0x20
3050 #define _ENDP3 0x40
3052 //==============================================================================
3055 //==============================================================================
3056 // UCON Bits
3058 extern __at(0x0F65) __sfr UCON;
3060 typedef struct
3062 unsigned : 1;
3063 unsigned SUSPND : 1;
3064 unsigned RESUME : 1;
3065 unsigned USBEN : 1;
3066 unsigned PKTDIS : 1;
3067 unsigned SE0 : 1;
3068 unsigned PPBRST : 1;
3069 unsigned : 1;
3070 } __UCONbits_t;
3072 extern __at(0x0F65) volatile __UCONbits_t UCONbits;
3074 #define _SUSPND 0x02
3075 #define _RESUME 0x04
3076 #define _USBEN 0x08
3077 #define _PKTDIS 0x10
3078 #define _SE0 0x20
3079 #define _PPBRST 0x40
3081 //==============================================================================
3083 extern __at(0x0F66) __sfr DMABCH;
3084 extern __at(0x0F67) __sfr DMABCL;
3085 extern __at(0x0F68) __sfr RXADDRH;
3086 extern __at(0x0F69) __sfr RXADDRL;
3087 extern __at(0x0F6A) __sfr TXADDRH;
3088 extern __at(0x0F6B) __sfr TXADDRL;
3089 extern __at(0x0F6C) __sfr PMDIN1L;
3090 extern __at(0x0F6D) __sfr PMDIN1H;
3091 extern __at(0x0F6E) __sfr PMADDRL;
3092 extern __at(0x0F6E) __sfr PMDOUT1L;
3094 //==============================================================================
3095 // PMADDRH Bits
3097 extern __at(0x0F6F) __sfr PMADDRH;
3099 typedef struct
3101 unsigned : 1;
3102 unsigned : 1;
3103 unsigned : 1;
3104 unsigned : 1;
3105 unsigned : 1;
3106 unsigned : 1;
3107 unsigned CS1 : 1;
3108 unsigned : 1;
3109 } __PMADDRHbits_t;
3111 extern __at(0x0F6F) volatile __PMADDRHbits_t PMADDRHbits;
3113 #define _CS1 0x40
3115 //==============================================================================
3117 extern __at(0x0F6F) __sfr PMDOUT1H;
3119 //==============================================================================
3120 // CMSTAT Bits
3122 extern __at(0x0F70) __sfr CMSTAT;
3124 typedef struct
3126 unsigned COUT1 : 1;
3127 unsigned COUT2 : 1;
3128 unsigned COUT3 : 1;
3129 unsigned : 1;
3130 unsigned : 1;
3131 unsigned : 1;
3132 unsigned : 1;
3133 unsigned : 1;
3134 } __CMSTATbits_t;
3136 extern __at(0x0F70) volatile __CMSTATbits_t CMSTATbits;
3138 #define _COUT1 0x01
3139 #define _COUT2 0x02
3140 #define _COUT3 0x04
3142 //==============================================================================
3145 //==============================================================================
3146 // CMSTATUS Bits
3148 extern __at(0x0F70) __sfr CMSTATUS;
3150 typedef struct
3152 unsigned COUT1 : 1;
3153 unsigned COUT2 : 1;
3154 unsigned COUT3 : 1;
3155 unsigned : 1;
3156 unsigned : 1;
3157 unsigned : 1;
3158 unsigned : 1;
3159 unsigned : 1;
3160 } __CMSTATUSbits_t;
3162 extern __at(0x0F70) volatile __CMSTATUSbits_t CMSTATUSbits;
3164 #define _CMSTATUS_COUT1 0x01
3165 #define _CMSTATUS_COUT2 0x02
3166 #define _CMSTATUS_COUT3 0x04
3168 //==============================================================================
3171 //==============================================================================
3172 // SSP2CON2 Bits
3174 extern __at(0x0F71) __sfr SSP2CON2;
3176 typedef union
3178 struct
3180 unsigned SEN : 1;
3181 unsigned RSEN : 1;
3182 unsigned PEN : 1;
3183 unsigned RCEN : 1;
3184 unsigned ACKEN : 1;
3185 unsigned ACKDT : 1;
3186 unsigned ACKSTAT : 1;
3187 unsigned GCEN : 1;
3190 struct
3192 unsigned : 1;
3193 unsigned ADMSK1 : 1;
3194 unsigned ADMSK2 : 1;
3195 unsigned ADMSK3 : 1;
3196 unsigned ADMSK4 : 1;
3197 unsigned ADMSK5 : 1;
3198 unsigned : 1;
3199 unsigned : 1;
3201 } __SSP2CON2bits_t;
3203 extern __at(0x0F71) volatile __SSP2CON2bits_t SSP2CON2bits;
3205 #define _SSP2CON2_SEN 0x01
3206 #define _SSP2CON2_RSEN 0x02
3207 #define _SSP2CON2_ADMSK1 0x02
3208 #define _SSP2CON2_PEN 0x04
3209 #define _SSP2CON2_ADMSK2 0x04
3210 #define _SSP2CON2_RCEN 0x08
3211 #define _SSP2CON2_ADMSK3 0x08
3212 #define _SSP2CON2_ACKEN 0x10
3213 #define _SSP2CON2_ADMSK4 0x10
3214 #define _SSP2CON2_ACKDT 0x20
3215 #define _SSP2CON2_ADMSK5 0x20
3216 #define _SSP2CON2_ACKSTAT 0x40
3217 #define _SSP2CON2_GCEN 0x80
3219 //==============================================================================
3222 //==============================================================================
3223 // SSP2CON1 Bits
3225 extern __at(0x0F72) __sfr SSP2CON1;
3227 typedef union
3229 struct
3231 unsigned SSPM0 : 1;
3232 unsigned SSPM1 : 1;
3233 unsigned SSPM2 : 1;
3234 unsigned SSPM3 : 1;
3235 unsigned CKP : 1;
3236 unsigned SSPEN : 1;
3237 unsigned SSPOV : 1;
3238 unsigned WCOL : 1;
3241 struct
3243 unsigned SSPM : 4;
3244 unsigned : 4;
3246 } __SSP2CON1bits_t;
3248 extern __at(0x0F72) volatile __SSP2CON1bits_t SSP2CON1bits;
3250 #define _SSP2CON1_SSPM0 0x01
3251 #define _SSP2CON1_SSPM1 0x02
3252 #define _SSP2CON1_SSPM2 0x04
3253 #define _SSP2CON1_SSPM3 0x08
3254 #define _SSP2CON1_CKP 0x10
3255 #define _SSP2CON1_SSPEN 0x20
3256 #define _SSP2CON1_SSPOV 0x40
3257 #define _SSP2CON1_WCOL 0x80
3259 //==============================================================================
3262 //==============================================================================
3263 // SSP2STAT Bits
3265 extern __at(0x0F73) __sfr SSP2STAT;
3267 typedef struct
3269 unsigned BF : 1;
3270 unsigned UA : 1;
3271 unsigned R_NOT_W : 1;
3272 unsigned S : 1;
3273 unsigned P : 1;
3274 unsigned D_NOT_A : 1;
3275 unsigned CKE : 1;
3276 unsigned SMP : 1;
3277 } __SSP2STATbits_t;
3279 extern __at(0x0F73) volatile __SSP2STATbits_t SSP2STATbits;
3281 #define _SSP2STAT_BF 0x01
3282 #define _SSP2STAT_UA 0x02
3283 #define _SSP2STAT_R_NOT_W 0x04
3284 #define _SSP2STAT_S 0x08
3285 #define _SSP2STAT_P 0x10
3286 #define _SSP2STAT_D_NOT_A 0x20
3287 #define _SSP2STAT_CKE 0x40
3288 #define _SSP2STAT_SMP 0x80
3290 //==============================================================================
3292 extern __at(0x0F74) __sfr SSP2ADD;
3294 //==============================================================================
3295 // SSP2MSK Bits
3297 extern __at(0x0F74) __sfr SSP2MSK;
3299 typedef struct
3301 unsigned MSK0 : 1;
3302 unsigned MSK1 : 1;
3303 unsigned MSK2 : 1;
3304 unsigned MSK3 : 1;
3305 unsigned MSK4 : 1;
3306 unsigned MSK5 : 1;
3307 unsigned MSK6 : 1;
3308 unsigned MSK7 : 1;
3309 } __SSP2MSKbits_t;
3311 extern __at(0x0F74) volatile __SSP2MSKbits_t SSP2MSKbits;
3313 #define _SSP2MSK_MSK0 0x01
3314 #define _SSP2MSK_MSK1 0x02
3315 #define _SSP2MSK_MSK2 0x04
3316 #define _SSP2MSK_MSK3 0x08
3317 #define _SSP2MSK_MSK4 0x10
3318 #define _SSP2MSK_MSK5 0x20
3319 #define _SSP2MSK_MSK6 0x40
3320 #define _SSP2MSK_MSK7 0x80
3322 //==============================================================================
3324 extern __at(0x0F75) __sfr SSP2BUF;
3326 //==============================================================================
3327 // T4CON Bits
3329 extern __at(0x0F76) __sfr T4CON;
3331 typedef union
3333 struct
3335 unsigned T4CKPS0 : 1;
3336 unsigned T4CKPS1 : 1;
3337 unsigned TMR4ON : 1;
3338 unsigned T4OUTPS0 : 1;
3339 unsigned T4OUTPS1 : 1;
3340 unsigned T4OUTPS2 : 1;
3341 unsigned T4OUTPS3 : 1;
3342 unsigned : 1;
3345 struct
3347 unsigned T4CKPS : 2;
3348 unsigned : 6;
3351 struct
3353 unsigned : 3;
3354 unsigned T4OUTPS : 4;
3355 unsigned : 1;
3357 } __T4CONbits_t;
3359 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
3361 #define _T4CKPS0 0x01
3362 #define _T4CKPS1 0x02
3363 #define _TMR4ON 0x04
3364 #define _T4OUTPS0 0x08
3365 #define _T4OUTPS1 0x10
3366 #define _T4OUTPS2 0x20
3367 #define _T4OUTPS3 0x40
3369 //==============================================================================
3371 extern __at(0x0F77) __sfr PR4;
3372 extern __at(0x0F78) __sfr TMR4;
3374 //==============================================================================
3375 // T3CON Bits
3377 extern __at(0x0F79) __sfr T3CON;
3379 typedef union
3381 struct
3383 unsigned TMR3ON : 1;
3384 unsigned RD16 : 1;
3385 unsigned NOT_T3SYNC : 1;
3386 unsigned T3OSCEN : 1;
3387 unsigned T3CKPS0 : 1;
3388 unsigned T3CKPS1 : 1;
3389 unsigned TMR3CS0 : 1;
3390 unsigned TMR3CS1 : 1;
3393 struct
3395 unsigned : 4;
3396 unsigned T3CKPS : 2;
3397 unsigned : 2;
3400 struct
3402 unsigned : 6;
3403 unsigned TMR3CS : 2;
3405 } __T3CONbits_t;
3407 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits;
3409 #define _T3CON_TMR3ON 0x01
3410 #define _T3CON_RD16 0x02
3411 #define _T3CON_NOT_T3SYNC 0x04
3412 #define _T3CON_T3OSCEN 0x08
3413 #define _T3CON_T3CKPS0 0x10
3414 #define _T3CON_T3CKPS1 0x20
3415 #define _T3CON_TMR3CS0 0x40
3416 #define _T3CON_TMR3CS1 0x80
3418 //==============================================================================
3420 extern __at(0x0F7A) __sfr TMR3;
3421 extern __at(0x0F7A) __sfr TMR3L;
3422 extern __at(0x0F7B) __sfr TMR3H;
3424 //==============================================================================
3425 // BAUDCON2 Bits
3427 extern __at(0x0F7C) __sfr BAUDCON2;
3429 typedef struct
3431 unsigned ABDEN : 1;
3432 unsigned WUE : 1;
3433 unsigned : 1;
3434 unsigned BRG16 : 1;
3435 unsigned TXCKP : 1;
3436 unsigned RXDTP : 1;
3437 unsigned RCIDL : 1;
3438 unsigned ABDOVF : 1;
3439 } __BAUDCON2bits_t;
3441 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
3443 #define _BAUDCON2_ABDEN 0x01
3444 #define _BAUDCON2_WUE 0x02
3445 #define _BAUDCON2_BRG16 0x08
3446 #define _BAUDCON2_TXCKP 0x10
3447 #define _BAUDCON2_RXDTP 0x20
3448 #define _BAUDCON2_RCIDL 0x40
3449 #define _BAUDCON2_ABDOVF 0x80
3451 //==============================================================================
3453 extern __at(0x0F7D) __sfr SPBRGH2;
3455 //==============================================================================
3456 // BAUDCON Bits
3458 extern __at(0x0F7E) __sfr BAUDCON;
3460 typedef struct
3462 unsigned ABDEN : 1;
3463 unsigned WUE : 1;
3464 unsigned : 1;
3465 unsigned BRG16 : 1;
3466 unsigned TXCKP : 1;
3467 unsigned RXDTP : 1;
3468 unsigned RCIDL : 1;
3469 unsigned ABDOVF : 1;
3470 } __BAUDCONbits_t;
3472 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
3474 #define _ABDEN 0x01
3475 #define _WUE 0x02
3476 #define _BRG16 0x08
3477 #define _TXCKP 0x10
3478 #define _RXDTP 0x20
3479 #define _RCIDL 0x40
3480 #define _ABDOVF 0x80
3482 //==============================================================================
3485 //==============================================================================
3486 // BAUDCON1 Bits
3488 extern __at(0x0F7E) __sfr BAUDCON1;
3490 typedef struct
3492 unsigned ABDEN : 1;
3493 unsigned WUE : 1;
3494 unsigned : 1;
3495 unsigned BRG16 : 1;
3496 unsigned TXCKP : 1;
3497 unsigned RXDTP : 1;
3498 unsigned RCIDL : 1;
3499 unsigned ABDOVF : 1;
3500 } __BAUDCON1bits_t;
3502 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
3504 #define _BAUDCON1_ABDEN 0x01
3505 #define _BAUDCON1_WUE 0x02
3506 #define _BAUDCON1_BRG16 0x08
3507 #define _BAUDCON1_TXCKP 0x10
3508 #define _BAUDCON1_RXDTP 0x20
3509 #define _BAUDCON1_RCIDL 0x40
3510 #define _BAUDCON1_ABDOVF 0x80
3512 //==============================================================================
3515 //==============================================================================
3516 // BAUDCTL Bits
3518 extern __at(0x0F7E) __sfr BAUDCTL;
3520 typedef struct
3522 unsigned ABDEN : 1;
3523 unsigned WUE : 1;
3524 unsigned : 1;
3525 unsigned BRG16 : 1;
3526 unsigned TXCKP : 1;
3527 unsigned RXDTP : 1;
3528 unsigned RCIDL : 1;
3529 unsigned ABDOVF : 1;
3530 } __BAUDCTLbits_t;
3532 extern __at(0x0F7E) volatile __BAUDCTLbits_t BAUDCTLbits;
3534 #define _BAUDCTL_ABDEN 0x01
3535 #define _BAUDCTL_WUE 0x02
3536 #define _BAUDCTL_BRG16 0x08
3537 #define _BAUDCTL_TXCKP 0x10
3538 #define _BAUDCTL_RXDTP 0x20
3539 #define _BAUDCTL_RCIDL 0x40
3540 #define _BAUDCTL_ABDOVF 0x80
3542 //==============================================================================
3544 extern __at(0x0F7F) __sfr SPBRGH;
3545 extern __at(0x0F7F) __sfr SPBRGH1;
3547 //==============================================================================
3548 // PORTA Bits
3550 extern __at(0x0F80) __sfr PORTA;
3552 typedef union
3554 struct
3556 unsigned RA0 : 1;
3557 unsigned RA1 : 1;
3558 unsigned RA2 : 1;
3559 unsigned RA3 : 1;
3560 unsigned : 1;
3561 unsigned RA5 : 1;
3562 unsigned RA6 : 1;
3563 unsigned RA7 : 1;
3566 struct
3568 unsigned AN0 : 1;
3569 unsigned AN1 : 1;
3570 unsigned AN2 : 1;
3571 unsigned AN3 : 1;
3572 unsigned : 1;
3573 unsigned AN4 : 1;
3574 unsigned OSC2 : 1;
3575 unsigned OSC1 : 1;
3578 struct
3580 unsigned C1INA : 1;
3581 unsigned C2INA : 1;
3582 unsigned VREF_MINUS : 1;
3583 unsigned VREF_PLUS : 1;
3584 unsigned : 1;
3585 unsigned NOT_SS1 : 1;
3586 unsigned CLKO : 1;
3587 unsigned CLKI : 1;
3590 struct
3592 unsigned PMA6 : 1;
3593 unsigned PMA7 : 1;
3594 unsigned CVREF : 1;
3595 unsigned C1INB : 1;
3596 unsigned : 1;
3597 unsigned HLVDIN : 1;
3598 unsigned : 1;
3599 unsigned : 1;
3602 struct
3604 unsigned RP0 : 1;
3605 unsigned RP1 : 1;
3606 unsigned C2INB : 1;
3607 unsigned : 1;
3608 unsigned : 1;
3609 unsigned RCV : 1;
3610 unsigned : 1;
3611 unsigned : 1;
3614 struct
3616 unsigned ULPWU : 1;
3617 unsigned VBG : 1;
3618 unsigned C1IND : 1;
3619 unsigned : 1;
3620 unsigned : 1;
3621 unsigned RP2 : 1;
3622 unsigned : 1;
3623 unsigned : 1;
3626 struct
3628 unsigned : 1;
3629 unsigned : 1;
3630 unsigned C3INB : 1;
3631 unsigned : 1;
3632 unsigned : 1;
3633 unsigned C1INC : 1;
3634 unsigned : 1;
3635 unsigned : 1;
3637 } __PORTAbits_t;
3639 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
3641 #define _RA0 0x01
3642 #define _AN0 0x01
3643 #define _C1INA 0x01
3644 #define _PMA6 0x01
3645 #define _RP0 0x01
3646 #define _ULPWU 0x01
3647 #define _RA1 0x02
3648 #define _AN1 0x02
3649 #define _C2INA 0x02
3650 #define _PMA7 0x02
3651 #define _RP1 0x02
3652 #define _VBG 0x02
3653 #define _RA2 0x04
3654 #define _AN2 0x04
3655 #define _VREF_MINUS 0x04
3656 #define _CVREF 0x04
3657 #define _C2INB 0x04
3658 #define _C1IND 0x04
3659 #define _C3INB 0x04
3660 #define _RA3 0x08
3661 #define _AN3 0x08
3662 #define _VREF_PLUS 0x08
3663 #define _C1INB 0x08
3664 #define _RA5 0x20
3665 #define _AN4 0x20
3666 #define _NOT_SS1 0x20
3667 #define _HLVDIN 0x20
3668 #define _RCV 0x20
3669 #define _RP2 0x20
3670 #define _C1INC 0x20
3671 #define _RA6 0x40
3672 #define _OSC2 0x40
3673 #define _CLKO 0x40
3674 #define _RA7 0x80
3675 #define _OSC1 0x80
3676 #define _CLKI 0x80
3678 //==============================================================================
3681 //==============================================================================
3682 // PORTB Bits
3684 extern __at(0x0F81) __sfr PORTB;
3686 typedef union
3688 struct
3690 unsigned RB0 : 1;
3691 unsigned RB1 : 1;
3692 unsigned RB2 : 1;
3693 unsigned RB3 : 1;
3694 unsigned RB4 : 1;
3695 unsigned RB5 : 1;
3696 unsigned RB6 : 1;
3697 unsigned RB7 : 1;
3700 struct
3702 unsigned AN12 : 1;
3703 unsigned AN10 : 1;
3704 unsigned AN8 : 1;
3705 unsigned AN9 : 1;
3706 unsigned PMA1 : 1;
3707 unsigned PMA0 : 1;
3708 unsigned KBI2 : 1;
3709 unsigned KBI3 : 1;
3712 struct
3714 unsigned INT0 : 1;
3715 unsigned PMPBE : 1;
3716 unsigned CTED1 : 1;
3717 unsigned CTED2 : 1;
3718 unsigned KBI0 : 1;
3719 unsigned KBI1 : 1;
3720 unsigned PGC : 1;
3721 unsigned PGD : 1;
3724 struct
3726 unsigned RP3 : 1;
3727 unsigned RTCC : 1;
3728 unsigned PMA3 : 1;
3729 unsigned PMA2 : 1;
3730 unsigned SCK1 : 1;
3731 unsigned SDI1 : 1;
3732 unsigned RP9 : 1;
3733 unsigned RP10 : 1;
3736 struct
3738 unsigned C3IND : 1;
3739 unsigned RP4 : 1;
3740 unsigned VMO : 1;
3741 unsigned VPO : 1;
3742 unsigned SCL1 : 1;
3743 unsigned SDA1 : 1;
3744 unsigned CCP6 : 1;
3745 unsigned CCP7 : 1;
3748 struct
3750 unsigned : 1;
3751 unsigned C3INC : 1;
3752 unsigned REFO : 1;
3753 unsigned RP6 : 1;
3754 unsigned RP7 : 1;
3755 unsigned RP8 : 1;
3756 unsigned : 1;
3757 unsigned : 1;
3760 struct
3762 unsigned : 1;
3763 unsigned PMBE : 1;
3764 unsigned RP5 : 1;
3765 unsigned C3INA : 1;
3766 unsigned CCP4 : 1;
3767 unsigned CCP5 : 1;
3768 unsigned : 1;
3769 unsigned : 1;
3772 struct
3774 unsigned : 1;
3775 unsigned : 1;
3776 unsigned C2INC : 1;
3777 unsigned : 1;
3778 unsigned : 1;
3779 unsigned : 1;
3780 unsigned : 1;
3781 unsigned : 1;
3784 struct
3786 unsigned : 4;
3787 unsigned KBI : 4;
3789 } __PORTBbits_t;
3791 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
3793 #define _RB0 0x01
3794 #define _AN12 0x01
3795 #define _INT0 0x01
3796 #define _RP3 0x01
3797 #define _C3IND 0x01
3798 #define _RB1 0x02
3799 #define _AN10 0x02
3800 #define _PMPBE 0x02
3801 #define _RTCC 0x02
3802 #define _RP4 0x02
3803 #define _C3INC 0x02
3804 #define _PMBE 0x02
3805 #define _RB2 0x04
3806 #define _AN8 0x04
3807 #define _CTED1 0x04
3808 #define _PMA3 0x04
3809 #define _VMO 0x04
3810 #define _REFO 0x04
3811 #define _RP5 0x04
3812 #define _C2INC 0x04
3813 #define _RB3 0x08
3814 #define _AN9 0x08
3815 #define _CTED2 0x08
3816 #define _PMA2 0x08
3817 #define _VPO 0x08
3818 #define _RP6 0x08
3819 #define _C3INA 0x08
3820 #define _RB4 0x10
3821 #define _PMA1 0x10
3822 #define _KBI0 0x10
3823 #define _SCK1 0x10
3824 #define _SCL1 0x10
3825 #define _RP7 0x10
3826 #define _CCP4 0x10
3827 #define _RB5 0x20
3828 #define _PMA0 0x20
3829 #define _KBI1 0x20
3830 #define _SDI1 0x20
3831 #define _SDA1 0x20
3832 #define _RP8 0x20
3833 #define _CCP5 0x20
3834 #define _RB6 0x40
3835 #define _KBI2 0x40
3836 #define _PGC 0x40
3837 #define _RP9 0x40
3838 #define _CCP6 0x40
3839 #define _RB7 0x80
3840 #define _KBI3 0x80
3841 #define _PGD 0x80
3842 #define _RP10 0x80
3843 #define _CCP7 0x80
3845 //==============================================================================
3848 //==============================================================================
3849 // PORTC Bits
3851 extern __at(0x0F82) __sfr PORTC;
3853 typedef union
3855 struct
3857 unsigned RC0 : 1;
3858 unsigned RC1 : 1;
3859 unsigned RC2 : 1;
3860 unsigned : 1;
3861 unsigned RC4 : 1;
3862 unsigned RC5 : 1;
3863 unsigned RC6 : 1;
3864 unsigned RC7 : 1;
3867 struct
3869 unsigned T1OSO : 1;
3870 unsigned T1OSI : 1;
3871 unsigned AN11 : 1;
3872 unsigned : 1;
3873 unsigned D_MINUS : 1;
3874 unsigned D_PLUS : 1;
3875 unsigned PMA5 : 1;
3876 unsigned PMA4 : 1;
3879 struct
3881 unsigned T1CKI : 1;
3882 unsigned NOT_UOE : 1;
3883 unsigned CTPLS : 1;
3884 unsigned : 1;
3885 unsigned VM : 1;
3886 unsigned VP : 1;
3887 unsigned TX1 : 1;
3888 unsigned RX1 : 1;
3891 struct
3893 unsigned RP11 : 1;
3894 unsigned RP12 : 1;
3895 unsigned RP13 : 1;
3896 unsigned : 1;
3897 unsigned : 1;
3898 unsigned : 1;
3899 unsigned CK1 : 1;
3900 unsigned DT1 : 1;
3903 struct
3905 unsigned : 1;
3906 unsigned CCP8 : 1;
3907 unsigned C2IND : 1;
3908 unsigned : 1;
3909 unsigned : 1;
3910 unsigned : 1;
3911 unsigned RP17 : 1;
3912 unsigned SDO1 : 1;
3915 struct
3917 unsigned : 1;
3918 unsigned : 1;
3919 unsigned : 1;
3920 unsigned : 1;
3921 unsigned : 1;
3922 unsigned : 1;
3923 unsigned CCP9 : 1;
3924 unsigned RP18 : 1;
3927 struct
3929 unsigned : 1;
3930 unsigned : 1;
3931 unsigned : 1;
3932 unsigned : 1;
3933 unsigned : 1;
3934 unsigned : 1;
3935 unsigned : 1;
3936 unsigned CCP10 : 1;
3938 } __PORTCbits_t;
3940 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
3942 #define _RC0 0x01
3943 #define _T1OSO 0x01
3944 #define _T1CKI 0x01
3945 #define _RP11 0x01
3946 #define _RC1 0x02
3947 #define _T1OSI 0x02
3948 #define _NOT_UOE 0x02
3949 #define _RP12 0x02
3950 #define _CCP8 0x02
3951 #define _RC2 0x04
3952 #define _AN11 0x04
3953 #define _CTPLS 0x04
3954 #define _RP13 0x04
3955 #define _C2IND 0x04
3956 #define _RC4 0x10
3957 #define _D_MINUS 0x10
3958 #define _VM 0x10
3959 #define _RC5 0x20
3960 #define _D_PLUS 0x20
3961 #define _VP 0x20
3962 #define _RC6 0x40
3963 #define _PMA5 0x40
3964 #define _TX1 0x40
3965 #define _CK1 0x40
3966 #define _RP17 0x40
3967 #define _CCP9 0x40
3968 #define _RC7 0x80
3969 #define _PMA4 0x80
3970 #define _RX1 0x80
3971 #define _DT1 0x80
3972 #define _SDO1 0x80
3973 #define _RP18 0x80
3974 #define _CCP10 0x80
3976 //==============================================================================
3979 //==============================================================================
3980 // PORTD Bits
3982 extern __at(0x0F83) __sfr PORTD;
3984 typedef union
3986 struct
3988 unsigned RD0 : 1;
3989 unsigned RD1 : 1;
3990 unsigned RD2 : 1;
3991 unsigned RD3 : 1;
3992 unsigned RD4 : 1;
3993 unsigned RD5 : 1;
3994 unsigned RD6 : 1;
3995 unsigned RD7 : 1;
3998 struct
4000 unsigned PMD0 : 1;
4001 unsigned PMD1 : 1;
4002 unsigned PMD2 : 1;
4003 unsigned PMD3 : 1;
4004 unsigned PMD4 : 1;
4005 unsigned PMD5 : 1;
4006 unsigned PMD6 : 1;
4007 unsigned PMD7 : 1;
4010 struct
4012 unsigned SCL2 : 1;
4013 unsigned SDA2 : 1;
4014 unsigned RP19 : 1;
4015 unsigned RP20 : 1;
4016 unsigned RP21 : 1;
4017 unsigned RP22 : 1;
4018 unsigned RP23 : 1;
4019 unsigned RP24 : 1;
4021 } __PORTDbits_t;
4023 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
4025 #define _RD0 0x01
4026 #define _PMD0 0x01
4027 #define _SCL2 0x01
4028 #define _RD1 0x02
4029 #define _PMD1 0x02
4030 #define _SDA2 0x02
4031 #define _RD2 0x04
4032 #define _PMD2 0x04
4033 #define _RP19 0x04
4034 #define _RD3 0x08
4035 #define _PMD3 0x08
4036 #define _RP20 0x08
4037 #define _RD4 0x10
4038 #define _PMD4 0x10
4039 #define _RP21 0x10
4040 #define _RD5 0x20
4041 #define _PMD5 0x20
4042 #define _RP22 0x20
4043 #define _RD6 0x40
4044 #define _PMD6 0x40
4045 #define _RP23 0x40
4046 #define _RD7 0x80
4047 #define _PMD7 0x80
4048 #define _RP24 0x80
4050 //==============================================================================
4053 //==============================================================================
4054 // PORTE Bits
4056 extern __at(0x0F84) __sfr PORTE;
4058 typedef union
4060 struct
4062 unsigned RE0 : 1;
4063 unsigned RE1 : 1;
4064 unsigned RE2 : 1;
4065 unsigned : 1;
4066 unsigned : 1;
4067 unsigned : 1;
4068 unsigned : 1;
4069 unsigned : 1;
4072 struct
4074 unsigned AN5 : 1;
4075 unsigned AN6 : 1;
4076 unsigned AN7 : 1;
4077 unsigned : 1;
4078 unsigned : 1;
4079 unsigned : 1;
4080 unsigned : 1;
4081 unsigned : 1;
4084 struct
4086 unsigned PMPRD : 1;
4087 unsigned PMPWR : 1;
4088 unsigned PMPCS : 1;
4089 unsigned : 1;
4090 unsigned : 1;
4091 unsigned : 1;
4092 unsigned : 1;
4093 unsigned : 1;
4096 struct
4098 unsigned PMRD : 1;
4099 unsigned PMWR : 1;
4100 unsigned PMCS : 1;
4101 unsigned : 1;
4102 unsigned : 1;
4103 unsigned : 1;
4104 unsigned : 1;
4105 unsigned : 1;
4108 struct
4110 unsigned RE : 3;
4111 unsigned : 5;
4113 } __PORTEbits_t;
4115 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
4117 #define _RE0 0x01
4118 #define _AN5 0x01
4119 #define _PMPRD 0x01
4120 #define _PMRD 0x01
4121 #define _RE1 0x02
4122 #define _AN6 0x02
4123 #define _PMPWR 0x02
4124 #define _PMWR 0x02
4125 #define _RE2 0x04
4126 #define _AN7 0x04
4127 #define _PMPCS 0x04
4128 #define _PMCS 0x04
4130 //==============================================================================
4133 //==============================================================================
4134 // HLVDCON Bits
4136 extern __at(0x0F85) __sfr HLVDCON;
4138 typedef union
4140 struct
4142 unsigned HLVDL0 : 1;
4143 unsigned HLVDL1 : 1;
4144 unsigned HLVDL2 : 1;
4145 unsigned HLVDL3 : 1;
4146 unsigned HLVDEN : 1;
4147 unsigned IRVST : 1;
4148 unsigned BGVST : 1;
4149 unsigned VDIRMAG : 1;
4152 struct
4154 unsigned HLVDL : 4;
4155 unsigned : 4;
4157 } __HLVDCONbits_t;
4159 extern __at(0x0F85) volatile __HLVDCONbits_t HLVDCONbits;
4161 #define _HLVDL0 0x01
4162 #define _HLVDL1 0x02
4163 #define _HLVDL2 0x04
4164 #define _HLVDL3 0x08
4165 #define _HLVDEN 0x10
4166 #define _IRVST 0x20
4167 #define _BGVST 0x40
4168 #define _VDIRMAG 0x80
4170 //==============================================================================
4173 //==============================================================================
4174 // DMACON2 Bits
4176 extern __at(0x0F86) __sfr DMACON2;
4178 typedef union
4180 struct
4182 unsigned INTLVL0 : 1;
4183 unsigned INTLVL1 : 1;
4184 unsigned INTLVL2 : 1;
4185 unsigned INTLVL3 : 1;
4186 unsigned DLYCYC0 : 1;
4187 unsigned DLYCYC1 : 1;
4188 unsigned DLYCYC2 : 1;
4189 unsigned DLYCYC3 : 1;
4192 struct
4194 unsigned INTLVL : 4;
4195 unsigned : 4;
4198 struct
4200 unsigned : 4;
4201 unsigned DLYCYC : 4;
4203 } __DMACON2bits_t;
4205 extern __at(0x0F86) volatile __DMACON2bits_t DMACON2bits;
4207 #define _INTLVL0 0x01
4208 #define _INTLVL1 0x02
4209 #define _INTLVL2 0x04
4210 #define _INTLVL3 0x08
4211 #define _DLYCYC0 0x10
4212 #define _DLYCYC1 0x20
4213 #define _DLYCYC2 0x40
4214 #define _DLYCYC3 0x80
4216 //==============================================================================
4219 //==============================================================================
4220 // OSCCON2 Bits
4222 extern __at(0x0F87) __sfr OSCCON2;
4224 typedef struct
4226 unsigned : 1;
4227 unsigned : 1;
4228 unsigned PRISD : 1;
4229 unsigned SOSCGO : 1;
4230 unsigned SOSCDRV : 1;
4231 unsigned : 1;
4232 unsigned SOSCRUN : 1;
4233 unsigned : 1;
4234 } __OSCCON2bits_t;
4236 extern __at(0x0F87) volatile __OSCCON2bits_t OSCCON2bits;
4238 #define _PRISD 0x04
4239 #define _SOSCGO 0x08
4240 #define _SOSCDRV 0x10
4241 #define _SOSCRUN 0x40
4243 //==============================================================================
4246 //==============================================================================
4247 // DMACON1 Bits
4249 extern __at(0x0F88) __sfr DMACON1;
4251 typedef union
4253 struct
4255 unsigned DMAEN : 1;
4256 unsigned DLYINTEN : 1;
4257 unsigned DUPLEX0 : 1;
4258 unsigned DUPLEX1 : 1;
4259 unsigned RXINC : 1;
4260 unsigned TXINC : 1;
4261 unsigned SSCON0 : 1;
4262 unsigned SSCON1 : 1;
4265 struct
4267 unsigned : 2;
4268 unsigned DUPLEX : 2;
4269 unsigned : 4;
4272 struct
4274 unsigned : 6;
4275 unsigned SSCON : 2;
4277 } __DMACON1bits_t;
4279 extern __at(0x0F88) volatile __DMACON1bits_t DMACON1bits;
4281 #define _DMAEN 0x01
4282 #define _DLYINTEN 0x02
4283 #define _DUPLEX0 0x04
4284 #define _DUPLEX1 0x08
4285 #define _RXINC 0x10
4286 #define _TXINC 0x20
4287 #define _SSCON0 0x40
4288 #define _SSCON1 0x80
4290 //==============================================================================
4293 //==============================================================================
4294 // LATA Bits
4296 extern __at(0x0F89) __sfr LATA;
4298 typedef struct
4300 unsigned LATA0 : 1;
4301 unsigned LATA1 : 1;
4302 unsigned LATA2 : 1;
4303 unsigned LATA3 : 1;
4304 unsigned : 1;
4305 unsigned LATA5 : 1;
4306 unsigned LATA6 : 1;
4307 unsigned LATA7 : 1;
4308 } __LATAbits_t;
4310 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
4312 #define _LATA0 0x01
4313 #define _LATA1 0x02
4314 #define _LATA2 0x04
4315 #define _LATA3 0x08
4316 #define _LATA5 0x20
4317 #define _LATA6 0x40
4318 #define _LATA7 0x80
4320 //==============================================================================
4323 //==============================================================================
4324 // LATB Bits
4326 extern __at(0x0F8A) __sfr LATB;
4328 typedef struct
4330 unsigned LATB0 : 1;
4331 unsigned LATB1 : 1;
4332 unsigned LATB2 : 1;
4333 unsigned LATB3 : 1;
4334 unsigned LATB4 : 1;
4335 unsigned LATB5 : 1;
4336 unsigned LATB6 : 1;
4337 unsigned LATB7 : 1;
4338 } __LATBbits_t;
4340 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
4342 #define _LATB0 0x01
4343 #define _LATB1 0x02
4344 #define _LATB2 0x04
4345 #define _LATB3 0x08
4346 #define _LATB4 0x10
4347 #define _LATB5 0x20
4348 #define _LATB6 0x40
4349 #define _LATB7 0x80
4351 //==============================================================================
4354 //==============================================================================
4355 // LATC Bits
4357 extern __at(0x0F8B) __sfr LATC;
4359 typedef struct
4361 unsigned LATC0 : 1;
4362 unsigned LATC1 : 1;
4363 unsigned LATC2 : 1;
4364 unsigned : 1;
4365 unsigned : 1;
4366 unsigned : 1;
4367 unsigned LATC6 : 1;
4368 unsigned LATC7 : 1;
4369 } __LATCbits_t;
4371 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
4373 #define _LATC0 0x01
4374 #define _LATC1 0x02
4375 #define _LATC2 0x04
4376 #define _LATC6 0x40
4377 #define _LATC7 0x80
4379 //==============================================================================
4382 //==============================================================================
4383 // LATD Bits
4385 extern __at(0x0F8C) __sfr LATD;
4387 typedef struct
4389 unsigned LATD0 : 1;
4390 unsigned LATD1 : 1;
4391 unsigned LATD2 : 1;
4392 unsigned LATD3 : 1;
4393 unsigned LATD4 : 1;
4394 unsigned LATD5 : 1;
4395 unsigned LATD6 : 1;
4396 unsigned LATD7 : 1;
4397 } __LATDbits_t;
4399 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
4401 #define _LATD0 0x01
4402 #define _LATD1 0x02
4403 #define _LATD2 0x04
4404 #define _LATD3 0x08
4405 #define _LATD4 0x10
4406 #define _LATD5 0x20
4407 #define _LATD6 0x40
4408 #define _LATD7 0x80
4410 //==============================================================================
4413 //==============================================================================
4414 // LATE Bits
4416 extern __at(0x0F8D) __sfr LATE;
4418 typedef union
4420 struct
4422 unsigned LATE0 : 1;
4423 unsigned LATE1 : 1;
4424 unsigned LATE2 : 1;
4425 unsigned : 1;
4426 unsigned : 1;
4427 unsigned : 1;
4428 unsigned : 1;
4429 unsigned : 1;
4432 struct
4434 unsigned LATE : 3;
4435 unsigned : 5;
4437 } __LATEbits_t;
4439 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
4441 #define _LATE0 0x01
4442 #define _LATE1 0x02
4443 #define _LATE2 0x04
4445 //==============================================================================
4448 //==============================================================================
4449 // PIE4 Bits
4451 extern __at(0x0F8E) __sfr PIE4;
4453 typedef struct
4455 unsigned CCP3IE : 1;
4456 unsigned CCP4IE : 1;
4457 unsigned CCP5IE : 1;
4458 unsigned CCP6IE : 1;
4459 unsigned CCP7IE : 1;
4460 unsigned CCP8IE : 1;
4461 unsigned CCP9IE : 1;
4462 unsigned CCP10IE : 1;
4463 } __PIE4bits_t;
4465 extern __at(0x0F8E) volatile __PIE4bits_t PIE4bits;
4467 #define _CCP3IE 0x01
4468 #define _CCP4IE 0x02
4469 #define _CCP5IE 0x04
4470 #define _CCP6IE 0x08
4471 #define _CCP7IE 0x10
4472 #define _CCP8IE 0x20
4473 #define _CCP9IE 0x40
4474 #define _CCP10IE 0x80
4476 //==============================================================================
4479 //==============================================================================
4480 // PIR4 Bits
4482 extern __at(0x0F8F) __sfr PIR4;
4484 typedef struct
4486 unsigned CCP3IF : 1;
4487 unsigned CCP4IF : 1;
4488 unsigned CCP5IF : 1;
4489 unsigned CCP6IF : 1;
4490 unsigned CCP7IF : 1;
4491 unsigned CCP8IF : 1;
4492 unsigned CCP9IF : 1;
4493 unsigned CCP10IF : 1;
4494 } __PIR4bits_t;
4496 extern __at(0x0F8F) volatile __PIR4bits_t PIR4bits;
4498 #define _CCP3IF 0x01
4499 #define _CCP4IF 0x02
4500 #define _CCP5IF 0x04
4501 #define _CCP6IF 0x08
4502 #define _CCP7IF 0x10
4503 #define _CCP8IF 0x20
4504 #define _CCP9IF 0x40
4505 #define _CCP10IF 0x80
4507 //==============================================================================
4510 //==============================================================================
4511 // IPR4 Bits
4513 extern __at(0x0F90) __sfr IPR4;
4515 typedef struct
4517 unsigned CCP3IP : 1;
4518 unsigned CCP4IP : 1;
4519 unsigned CCP5IP : 1;
4520 unsigned CCP6IP : 1;
4521 unsigned CCP7IP : 1;
4522 unsigned CCP8IP : 1;
4523 unsigned CCP9IP : 1;
4524 unsigned CCP10IP : 1;
4525 } __IPR4bits_t;
4527 extern __at(0x0F90) volatile __IPR4bits_t IPR4bits;
4529 #define _CCP3IP 0x01
4530 #define _CCP4IP 0x02
4531 #define _CCP5IP 0x04
4532 #define _CCP6IP 0x08
4533 #define _CCP7IP 0x10
4534 #define _CCP8IP 0x20
4535 #define _CCP9IP 0x40
4536 #define _CCP10IP 0x80
4538 //==============================================================================
4541 //==============================================================================
4542 // PIE5 Bits
4544 extern __at(0x0F91) __sfr PIE5;
4546 typedef struct
4548 unsigned TMR1GIE : 1;
4549 unsigned TMR5GIE : 1;
4550 unsigned TMR5IE : 1;
4551 unsigned TMR6IE : 1;
4552 unsigned TMR8IE : 1;
4553 unsigned CM3IE : 1;
4554 unsigned : 1;
4555 unsigned : 1;
4556 } __PIE5bits_t;
4558 extern __at(0x0F91) volatile __PIE5bits_t PIE5bits;
4560 #define _TMR1GIE 0x01
4561 #define _TMR5GIE 0x02
4562 #define _TMR5IE 0x04
4563 #define _TMR6IE 0x08
4564 #define _TMR8IE 0x10
4565 #define _CM3IE 0x20
4567 //==============================================================================
4570 //==============================================================================
4571 // TRISA Bits
4573 extern __at(0x0F92) __sfr TRISA;
4575 typedef struct
4577 unsigned TRISA0 : 1;
4578 unsigned TRISA1 : 1;
4579 unsigned TRISA2 : 1;
4580 unsigned TRISA3 : 1;
4581 unsigned : 1;
4582 unsigned TRISA5 : 1;
4583 unsigned TRISA6 : 1;
4584 unsigned TRISA7 : 1;
4585 } __TRISAbits_t;
4587 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
4589 #define _TRISA0 0x01
4590 #define _TRISA1 0x02
4591 #define _TRISA2 0x04
4592 #define _TRISA3 0x08
4593 #define _TRISA5 0x20
4594 #define _TRISA6 0x40
4595 #define _TRISA7 0x80
4597 //==============================================================================
4600 //==============================================================================
4601 // TRISB Bits
4603 extern __at(0x0F93) __sfr TRISB;
4605 typedef struct
4607 unsigned TRISB0 : 1;
4608 unsigned TRISB1 : 1;
4609 unsigned TRISB2 : 1;
4610 unsigned TRISB3 : 1;
4611 unsigned TRISB4 : 1;
4612 unsigned TRISB5 : 1;
4613 unsigned TRISB6 : 1;
4614 unsigned TRISB7 : 1;
4615 } __TRISBbits_t;
4617 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
4619 #define _TRISB0 0x01
4620 #define _TRISB1 0x02
4621 #define _TRISB2 0x04
4622 #define _TRISB3 0x08
4623 #define _TRISB4 0x10
4624 #define _TRISB5 0x20
4625 #define _TRISB6 0x40
4626 #define _TRISB7 0x80
4628 //==============================================================================
4631 //==============================================================================
4632 // TRISC Bits
4634 extern __at(0x0F94) __sfr TRISC;
4636 typedef struct
4638 unsigned TRISC0 : 1;
4639 unsigned TRISC1 : 1;
4640 unsigned TRISC2 : 1;
4641 unsigned : 1;
4642 unsigned : 1;
4643 unsigned : 1;
4644 unsigned TRISC6 : 1;
4645 unsigned TRISC7 : 1;
4646 } __TRISCbits_t;
4648 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
4650 #define _TRISC0 0x01
4651 #define _TRISC1 0x02
4652 #define _TRISC2 0x04
4653 #define _TRISC6 0x40
4654 #define _TRISC7 0x80
4656 //==============================================================================
4659 //==============================================================================
4660 // TRISD Bits
4662 extern __at(0x0F95) __sfr TRISD;
4664 typedef struct
4666 unsigned TRISD0 : 1;
4667 unsigned TRISD1 : 1;
4668 unsigned TRISD2 : 1;
4669 unsigned TRISD3 : 1;
4670 unsigned TRISD4 : 1;
4671 unsigned TRISD5 : 1;
4672 unsigned TRISD6 : 1;
4673 unsigned TRISD7 : 1;
4674 } __TRISDbits_t;
4676 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
4678 #define _TRISD0 0x01
4679 #define _TRISD1 0x02
4680 #define _TRISD2 0x04
4681 #define _TRISD3 0x08
4682 #define _TRISD4 0x10
4683 #define _TRISD5 0x20
4684 #define _TRISD6 0x40
4685 #define _TRISD7 0x80
4687 //==============================================================================
4690 //==============================================================================
4691 // TRISE Bits
4693 extern __at(0x0F96) __sfr TRISE;
4695 typedef union
4697 struct
4699 unsigned TRISE0 : 1;
4700 unsigned TRISE1 : 1;
4701 unsigned TRISE2 : 1;
4702 unsigned : 1;
4703 unsigned : 1;
4704 unsigned : 1;
4705 unsigned REPU : 1;
4706 unsigned RDPU : 1;
4709 struct
4711 unsigned TRISE : 3;
4712 unsigned : 5;
4714 } __TRISEbits_t;
4716 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
4718 #define _TRISE0 0x01
4719 #define _TRISE1 0x02
4720 #define _TRISE2 0x04
4721 #define _REPU 0x40
4722 #define _RDPU 0x80
4724 //==============================================================================
4727 //==============================================================================
4728 // T3GCON Bits
4730 extern __at(0x0F97) __sfr T3GCON;
4732 typedef union
4734 struct
4736 unsigned T3GSS0 : 1;
4737 unsigned T3GSS1 : 1;
4738 unsigned T3GVAL : 1;
4739 unsigned T3GGO_T3DONE : 1;
4740 unsigned T3GSPM : 1;
4741 unsigned T3GTM : 1;
4742 unsigned T3GPOL : 1;
4743 unsigned TMR3GE : 1;
4746 struct
4748 unsigned : 1;
4749 unsigned : 1;
4750 unsigned : 1;
4751 unsigned T3GGO : 1;
4752 unsigned : 1;
4753 unsigned : 1;
4754 unsigned : 1;
4755 unsigned : 1;
4758 struct
4760 unsigned : 1;
4761 unsigned : 1;
4762 unsigned : 1;
4763 unsigned NOT_T3DONE : 1;
4764 unsigned : 1;
4765 unsigned : 1;
4766 unsigned : 1;
4767 unsigned : 1;
4770 struct
4772 unsigned T3GSS : 2;
4773 unsigned : 6;
4775 } __T3GCONbits_t;
4777 extern __at(0x0F97) volatile __T3GCONbits_t T3GCONbits;
4779 #define _T3GSS0 0x01
4780 #define _T3GSS1 0x02
4781 #define _T3GVAL 0x04
4782 #define _T3GGO_T3DONE 0x08
4783 #define _T3GGO 0x08
4784 #define _NOT_T3DONE 0x08
4785 #define _T3GSPM 0x10
4786 #define _T3GTM 0x20
4787 #define _T3GPOL 0x40
4788 #define _TMR3GE 0x80
4790 //==============================================================================
4793 //==============================================================================
4794 // PIR5 Bits
4796 extern __at(0x0F98) __sfr PIR5;
4798 typedef struct
4800 unsigned TMR1GIF : 1;
4801 unsigned TMR5GIF : 1;
4802 unsigned TMR5IF : 1;
4803 unsigned TMR6IF : 1;
4804 unsigned TMR8IF : 1;
4805 unsigned CM3IF : 1;
4806 unsigned : 1;
4807 unsigned : 1;
4808 } __PIR5bits_t;
4810 extern __at(0x0F98) volatile __PIR5bits_t PIR5bits;
4812 #define _TMR1GIF 0x01
4813 #define _TMR5GIF 0x02
4814 #define _TMR5IF 0x04
4815 #define _TMR6IF 0x08
4816 #define _TMR8IF 0x10
4817 #define _CM3IF 0x20
4819 //==============================================================================
4822 //==============================================================================
4823 // IPR5 Bits
4825 extern __at(0x0F99) __sfr IPR5;
4827 typedef struct
4829 unsigned TMR1GIP : 1;
4830 unsigned TMR5GIP : 1;
4831 unsigned TMR5IP : 1;
4832 unsigned TMR6IP : 1;
4833 unsigned TMR8IP : 1;
4834 unsigned CM3IP : 1;
4835 unsigned : 1;
4836 unsigned : 1;
4837 } __IPR5bits_t;
4839 extern __at(0x0F99) volatile __IPR5bits_t IPR5bits;
4841 #define _TMR1GIP 0x01
4842 #define _TMR5GIP 0x02
4843 #define _TMR5IP 0x04
4844 #define _TMR6IP 0x08
4845 #define _TMR8IP 0x10
4846 #define _CM3IP 0x20
4848 //==============================================================================
4851 //==============================================================================
4852 // T1GCON Bits
4854 extern __at(0x0F9A) __sfr T1GCON;
4856 typedef union
4858 struct
4860 unsigned T1GSS0 : 1;
4861 unsigned T1GSS1 : 1;
4862 unsigned T1GVAL : 1;
4863 unsigned T1GGO_NOT_T1DONE : 1;
4864 unsigned T1GSPM : 1;
4865 unsigned T1GTM : 1;
4866 unsigned T1GPOL : 1;
4867 unsigned TMR1GE : 1;
4870 struct
4872 unsigned : 1;
4873 unsigned : 1;
4874 unsigned : 1;
4875 unsigned T1GGO : 1;
4876 unsigned : 1;
4877 unsigned : 1;
4878 unsigned : 1;
4879 unsigned : 1;
4882 struct
4884 unsigned : 1;
4885 unsigned : 1;
4886 unsigned : 1;
4887 unsigned NOT_T1DONE : 1;
4888 unsigned : 1;
4889 unsigned : 1;
4890 unsigned : 1;
4891 unsigned : 1;
4894 struct
4896 unsigned : 1;
4897 unsigned : 1;
4898 unsigned : 1;
4899 unsigned T1DONE : 1;
4900 unsigned : 1;
4901 unsigned : 1;
4902 unsigned : 1;
4903 unsigned : 1;
4906 struct
4908 unsigned T1GSS : 2;
4909 unsigned : 6;
4911 } __T1GCONbits_t;
4913 extern __at(0x0F9A) volatile __T1GCONbits_t T1GCONbits;
4915 #define _T1GSS0 0x01
4916 #define _T1GSS1 0x02
4917 #define _T1GVAL 0x04
4918 #define _T1GGO_NOT_T1DONE 0x08
4919 #define _T1GGO 0x08
4920 #define _NOT_T1DONE 0x08
4921 #define _T1DONE 0x08
4922 #define _T1GSPM 0x10
4923 #define _T1GTM 0x20
4924 #define _T1GPOL 0x40
4925 #define _TMR1GE 0x80
4927 //==============================================================================
4930 //==============================================================================
4931 // OSCTUNE Bits
4933 extern __at(0x0F9B) __sfr OSCTUNE;
4935 typedef union
4937 struct
4939 unsigned TUN0 : 1;
4940 unsigned TUN1 : 1;
4941 unsigned TUN2 : 1;
4942 unsigned TUN3 : 1;
4943 unsigned TUN4 : 1;
4944 unsigned TUN5 : 1;
4945 unsigned PLLEN : 1;
4946 unsigned INTSRC : 1;
4949 struct
4951 unsigned TUN : 6;
4952 unsigned : 2;
4954 } __OSCTUNEbits_t;
4956 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
4958 #define _TUN0 0x01
4959 #define _TUN1 0x02
4960 #define _TUN2 0x04
4961 #define _TUN3 0x08
4962 #define _TUN4 0x10
4963 #define _TUN5 0x20
4964 #define _PLLEN 0x40
4965 #define _INTSRC 0x80
4967 //==============================================================================
4970 //==============================================================================
4971 // RCSTA2 Bits
4973 extern __at(0x0F9C) __sfr RCSTA2;
4975 typedef union
4977 struct
4979 unsigned RX9D : 1;
4980 unsigned OERR : 1;
4981 unsigned FERR : 1;
4982 unsigned ADDEN : 1;
4983 unsigned CREN : 1;
4984 unsigned SREN : 1;
4985 unsigned RX9 : 1;
4986 unsigned SPEN : 1;
4989 struct
4991 unsigned RX9D2 : 1;
4992 unsigned OERR2 : 1;
4993 unsigned FERR2 : 1;
4994 unsigned ADDEN2 : 1;
4995 unsigned CREN2 : 1;
4996 unsigned SREN2 : 1;
4997 unsigned RX92 : 1;
4998 unsigned SPEN2 : 1;
5000 } __RCSTA2bits_t;
5002 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
5004 #define _RCSTA2_RX9D 0x01
5005 #define _RCSTA2_RX9D2 0x01
5006 #define _RCSTA2_OERR 0x02
5007 #define _RCSTA2_OERR2 0x02
5008 #define _RCSTA2_FERR 0x04
5009 #define _RCSTA2_FERR2 0x04
5010 #define _RCSTA2_ADDEN 0x08
5011 #define _RCSTA2_ADDEN2 0x08
5012 #define _RCSTA2_CREN 0x10
5013 #define _RCSTA2_CREN2 0x10
5014 #define _RCSTA2_SREN 0x20
5015 #define _RCSTA2_SREN2 0x20
5016 #define _RCSTA2_RX9 0x40
5017 #define _RCSTA2_RX92 0x40
5018 #define _RCSTA2_SPEN 0x80
5019 #define _RCSTA2_SPEN2 0x80
5021 //==============================================================================
5024 //==============================================================================
5025 // PIE1 Bits
5027 extern __at(0x0F9D) __sfr PIE1;
5029 typedef union
5031 struct
5033 unsigned TMR1IE : 1;
5034 unsigned TMR2IE : 1;
5035 unsigned CCP1IE : 1;
5036 unsigned SSP1IE : 1;
5037 unsigned TX1IE : 1;
5038 unsigned RC1IE : 1;
5039 unsigned ADIE : 1;
5040 unsigned PMPIE : 1;
5043 struct
5045 unsigned : 1;
5046 unsigned : 1;
5047 unsigned : 1;
5048 unsigned SSPIE : 1;
5049 unsigned TXIE : 1;
5050 unsigned RCIE : 1;
5051 unsigned : 1;
5052 unsigned : 1;
5054 } __PIE1bits_t;
5056 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
5058 #define _TMR1IE 0x01
5059 #define _TMR2IE 0x02
5060 #define _CCP1IE 0x04
5061 #define _SSP1IE 0x08
5062 #define _SSPIE 0x08
5063 #define _TX1IE 0x10
5064 #define _TXIE 0x10
5065 #define _RC1IE 0x20
5066 #define _RCIE 0x20
5067 #define _ADIE 0x40
5068 #define _PMPIE 0x80
5070 //==============================================================================
5073 //==============================================================================
5074 // PIR1 Bits
5076 extern __at(0x0F9E) __sfr PIR1;
5078 typedef union
5080 struct
5082 unsigned TMR1IF : 1;
5083 unsigned TMR2IF : 1;
5084 unsigned CCP1IF : 1;
5085 unsigned SSP1IF : 1;
5086 unsigned TX1IF : 1;
5087 unsigned RC1IF : 1;
5088 unsigned ADIF : 1;
5089 unsigned PMPIF : 1;
5092 struct
5094 unsigned : 1;
5095 unsigned : 1;
5096 unsigned : 1;
5097 unsigned SSPIF : 1;
5098 unsigned TXIF : 1;
5099 unsigned RCIF : 1;
5100 unsigned : 1;
5101 unsigned : 1;
5103 } __PIR1bits_t;
5105 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
5107 #define _TMR1IF 0x01
5108 #define _TMR2IF 0x02
5109 #define _CCP1IF 0x04
5110 #define _SSP1IF 0x08
5111 #define _SSPIF 0x08
5112 #define _TX1IF 0x10
5113 #define _TXIF 0x10
5114 #define _RC1IF 0x20
5115 #define _RCIF 0x20
5116 #define _ADIF 0x40
5117 #define _PMPIF 0x80
5119 //==============================================================================
5122 //==============================================================================
5123 // IPR1 Bits
5125 extern __at(0x0F9F) __sfr IPR1;
5127 typedef union
5129 struct
5131 unsigned TMR1IP : 1;
5132 unsigned TMR2IP : 1;
5133 unsigned CCP1IP : 1;
5134 unsigned SSP1IP : 1;
5135 unsigned TX1IP : 1;
5136 unsigned RC1IP : 1;
5137 unsigned ADIP : 1;
5138 unsigned PMPIP : 1;
5141 struct
5143 unsigned : 1;
5144 unsigned : 1;
5145 unsigned : 1;
5146 unsigned SSPIP : 1;
5147 unsigned TXIP : 1;
5148 unsigned RCIP : 1;
5149 unsigned : 1;
5150 unsigned : 1;
5152 } __IPR1bits_t;
5154 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
5156 #define _TMR1IP 0x01
5157 #define _TMR2IP 0x02
5158 #define _CCP1IP 0x04
5159 #define _SSP1IP 0x08
5160 #define _SSPIP 0x08
5161 #define _TX1IP 0x10
5162 #define _TXIP 0x10
5163 #define _RC1IP 0x20
5164 #define _RCIP 0x20
5165 #define _ADIP 0x40
5166 #define _PMPIP 0x80
5168 //==============================================================================
5171 //==============================================================================
5172 // PIE2 Bits
5174 extern __at(0x0FA0) __sfr PIE2;
5176 typedef union
5178 struct
5180 unsigned CCP2IE : 1;
5181 unsigned TMR3IE : 1;
5182 unsigned LVDIE : 1;
5183 unsigned BCL1IE : 1;
5184 unsigned USBIE : 1;
5185 unsigned CM1IE : 1;
5186 unsigned CM2IE : 1;
5187 unsigned OSCFIE : 1;
5190 struct
5192 unsigned : 1;
5193 unsigned : 1;
5194 unsigned HLVDIE : 1;
5195 unsigned BCLIE : 1;
5196 unsigned : 1;
5197 unsigned : 1;
5198 unsigned : 1;
5199 unsigned : 1;
5201 } __PIE2bits_t;
5203 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
5205 #define _CCP2IE 0x01
5206 #define _TMR3IE 0x02
5207 #define _LVDIE 0x04
5208 #define _HLVDIE 0x04
5209 #define _BCL1IE 0x08
5210 #define _BCLIE 0x08
5211 #define _USBIE 0x10
5212 #define _CM1IE 0x20
5213 #define _CM2IE 0x40
5214 #define _OSCFIE 0x80
5216 //==============================================================================
5219 //==============================================================================
5220 // PIR2 Bits
5222 extern __at(0x0FA1) __sfr PIR2;
5224 typedef union
5226 struct
5228 unsigned CCP2IF : 1;
5229 unsigned TMR3IF : 1;
5230 unsigned LVDIF : 1;
5231 unsigned BCL1IF : 1;
5232 unsigned USBIF : 1;
5233 unsigned CM1IF : 1;
5234 unsigned CM2IF : 1;
5235 unsigned OSCFIF : 1;
5238 struct
5240 unsigned : 1;
5241 unsigned : 1;
5242 unsigned HLVDIF : 1;
5243 unsigned BCLIF : 1;
5244 unsigned : 1;
5245 unsigned : 1;
5246 unsigned : 1;
5247 unsigned : 1;
5249 } __PIR2bits_t;
5251 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
5253 #define _CCP2IF 0x01
5254 #define _TMR3IF 0x02
5255 #define _LVDIF 0x04
5256 #define _HLVDIF 0x04
5257 #define _BCL1IF 0x08
5258 #define _BCLIF 0x08
5259 #define _USBIF 0x10
5260 #define _CM1IF 0x20
5261 #define _CM2IF 0x40
5262 #define _OSCFIF 0x80
5264 //==============================================================================
5267 //==============================================================================
5268 // IPR2 Bits
5270 extern __at(0x0FA2) __sfr IPR2;
5272 typedef union
5274 struct
5276 unsigned CCP2IP : 1;
5277 unsigned TMR3IP : 1;
5278 unsigned LVDIP : 1;
5279 unsigned BCL1IP : 1;
5280 unsigned USBIP : 1;
5281 unsigned CM1IP : 1;
5282 unsigned CM2IP : 1;
5283 unsigned OSCFIP : 1;
5286 struct
5288 unsigned : 1;
5289 unsigned : 1;
5290 unsigned HLVDIP : 1;
5291 unsigned BCLIP : 1;
5292 unsigned : 1;
5293 unsigned : 1;
5294 unsigned : 1;
5295 unsigned : 1;
5297 } __IPR2bits_t;
5299 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
5301 #define _CCP2IP 0x01
5302 #define _TMR3IP 0x02
5303 #define _LVDIP 0x04
5304 #define _HLVDIP 0x04
5305 #define _BCL1IP 0x08
5306 #define _BCLIP 0x08
5307 #define _USBIP 0x10
5308 #define _CM1IP 0x20
5309 #define _CM2IP 0x40
5310 #define _OSCFIP 0x80
5312 //==============================================================================
5315 //==============================================================================
5316 // PIE3 Bits
5318 extern __at(0x0FA3) __sfr PIE3;
5320 typedef struct
5322 unsigned RTCCIE : 1;
5323 unsigned TMR3GIE : 1;
5324 unsigned CTMUIE : 1;
5325 unsigned TMR4IE : 1;
5326 unsigned TX2IE : 1;
5327 unsigned RC2IE : 1;
5328 unsigned BCL2IE : 1;
5329 unsigned SSP2IE : 1;
5330 } __PIE3bits_t;
5332 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
5334 #define _RTCCIE 0x01
5335 #define _TMR3GIE 0x02
5336 #define _CTMUIE 0x04
5337 #define _TMR4IE 0x08
5338 #define _TX2IE 0x10
5339 #define _RC2IE 0x20
5340 #define _BCL2IE 0x40
5341 #define _SSP2IE 0x80
5343 //==============================================================================
5346 //==============================================================================
5347 // PIR3 Bits
5349 extern __at(0x0FA4) __sfr PIR3;
5351 typedef struct
5353 unsigned RTCCIF : 1;
5354 unsigned TMR3GIF : 1;
5355 unsigned CTMUIF : 1;
5356 unsigned TMR4IF : 1;
5357 unsigned TX2IF : 1;
5358 unsigned RC2IF : 1;
5359 unsigned BCL2IF : 1;
5360 unsigned SSP2IF : 1;
5361 } __PIR3bits_t;
5363 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
5365 #define _RTCCIF 0x01
5366 #define _TMR3GIF 0x02
5367 #define _CTMUIF 0x04
5368 #define _TMR4IF 0x08
5369 #define _TX2IF 0x10
5370 #define _RC2IF 0x20
5371 #define _BCL2IF 0x40
5372 #define _SSP2IF 0x80
5374 //==============================================================================
5377 //==============================================================================
5378 // IPR3 Bits
5380 extern __at(0x0FA5) __sfr IPR3;
5382 typedef struct
5384 unsigned RTCCIP : 1;
5385 unsigned TMR3GIP : 1;
5386 unsigned CTMUIP : 1;
5387 unsigned TMR4IP : 1;
5388 unsigned TX2IP : 1;
5389 unsigned RC2IP : 1;
5390 unsigned BCL2IP : 1;
5391 unsigned SSP2IP : 1;
5392 } __IPR3bits_t;
5394 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
5396 #define _RTCCIP 0x01
5397 #define _TMR3GIP 0x02
5398 #define _CTMUIP 0x04
5399 #define _TMR4IP 0x08
5400 #define _TX2IP 0x10
5401 #define _RC2IP 0x20
5402 #define _BCL2IP 0x40
5403 #define _SSP2IP 0x80
5405 //==============================================================================
5408 //==============================================================================
5409 // EECON1 Bits
5411 extern __at(0x0FA6) __sfr EECON1;
5413 typedef struct
5415 unsigned : 1;
5416 unsigned WR : 1;
5417 unsigned WREN : 1;
5418 unsigned WRERR : 1;
5419 unsigned FREE : 1;
5420 unsigned WPROG : 1;
5421 unsigned : 1;
5422 unsigned : 1;
5423 } __EECON1bits_t;
5425 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
5427 #define _WR 0x02
5428 #define _WREN 0x04
5429 #define _WRERR 0x08
5430 #define _FREE 0x10
5431 #define _WPROG 0x20
5433 //==============================================================================
5435 extern __at(0x0FA7) __sfr EECON2;
5437 //==============================================================================
5438 // TXSTA2 Bits
5440 extern __at(0x0FA8) __sfr TXSTA2;
5442 typedef union
5444 struct
5446 unsigned TX9D : 1;
5447 unsigned TRMT : 1;
5448 unsigned BRGH : 1;
5449 unsigned SENDB : 1;
5450 unsigned SYNC : 1;
5451 unsigned TXEN : 1;
5452 unsigned TX9 : 1;
5453 unsigned CSRC : 1;
5456 struct
5458 unsigned TX9D2 : 1;
5459 unsigned TRMT2 : 1;
5460 unsigned BRGH2 : 1;
5461 unsigned SENDB2 : 1;
5462 unsigned SYNC2 : 1;
5463 unsigned TXEN2 : 1;
5464 unsigned TX92 : 1;
5465 unsigned CSRC2 : 1;
5467 } __TXSTA2bits_t;
5469 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
5471 #define _TXSTA2_TX9D 0x01
5472 #define _TXSTA2_TX9D2 0x01
5473 #define _TXSTA2_TRMT 0x02
5474 #define _TXSTA2_TRMT2 0x02
5475 #define _TXSTA2_BRGH 0x04
5476 #define _TXSTA2_BRGH2 0x04
5477 #define _TXSTA2_SENDB 0x08
5478 #define _TXSTA2_SENDB2 0x08
5479 #define _TXSTA2_SYNC 0x10
5480 #define _TXSTA2_SYNC2 0x10
5481 #define _TXSTA2_TXEN 0x20
5482 #define _TXSTA2_TXEN2 0x20
5483 #define _TXSTA2_TX9 0x40
5484 #define _TXSTA2_TX92 0x40
5485 #define _TXSTA2_CSRC 0x80
5486 #define _TXSTA2_CSRC2 0x80
5488 //==============================================================================
5490 extern __at(0x0FA9) __sfr TXREG2;
5491 extern __at(0x0FAA) __sfr RCREG2;
5492 extern __at(0x0FAB) __sfr SPBRG2;
5494 //==============================================================================
5495 // RCSTA Bits
5497 extern __at(0x0FAC) __sfr RCSTA;
5499 typedef union
5501 struct
5503 unsigned RX9D : 1;
5504 unsigned OERR : 1;
5505 unsigned FERR : 1;
5506 unsigned ADDEN : 1;
5507 unsigned CREN : 1;
5508 unsigned SREN : 1;
5509 unsigned RX9 : 1;
5510 unsigned SPEN : 1;
5513 struct
5515 unsigned RCD8 : 1;
5516 unsigned OERR1 : 1;
5517 unsigned FERR1 : 1;
5518 unsigned ADEN : 1;
5519 unsigned CREN1 : 1;
5520 unsigned SREN1 : 1;
5521 unsigned RC9 : 1;
5522 unsigned SPEN1 : 1;
5525 struct
5527 unsigned RX9D1 : 1;
5528 unsigned : 1;
5529 unsigned : 1;
5530 unsigned ADDEN1 : 1;
5531 unsigned : 1;
5532 unsigned : 1;
5533 unsigned NOT_RC8 : 1;
5534 unsigned : 1;
5537 struct
5539 unsigned : 1;
5540 unsigned : 1;
5541 unsigned : 1;
5542 unsigned : 1;
5543 unsigned : 1;
5544 unsigned : 1;
5545 unsigned RC8_9 : 1;
5546 unsigned : 1;
5549 struct
5551 unsigned : 1;
5552 unsigned : 1;
5553 unsigned : 1;
5554 unsigned : 1;
5555 unsigned : 1;
5556 unsigned : 1;
5557 unsigned RX91 : 1;
5558 unsigned : 1;
5560 } __RCSTAbits_t;
5562 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
5564 #define _RX9D 0x01
5565 #define _RCD8 0x01
5566 #define _RX9D1 0x01
5567 #define _OERR 0x02
5568 #define _OERR1 0x02
5569 #define _FERR 0x04
5570 #define _FERR1 0x04
5571 #define _ADDEN 0x08
5572 #define _ADEN 0x08
5573 #define _ADDEN1 0x08
5574 #define _CREN 0x10
5575 #define _CREN1 0x10
5576 #define _SREN 0x20
5577 #define _SREN1 0x20
5578 #define _RX9 0x40
5579 #define _RC9 0x40
5580 #define _NOT_RC8 0x40
5581 #define _RC8_9 0x40
5582 #define _RX91 0x40
5583 #define _SPEN 0x80
5584 #define _SPEN1 0x80
5586 //==============================================================================
5589 //==============================================================================
5590 // RCSTA1 Bits
5592 extern __at(0x0FAC) __sfr RCSTA1;
5594 typedef union
5596 struct
5598 unsigned RX9D : 1;
5599 unsigned OERR : 1;
5600 unsigned FERR : 1;
5601 unsigned ADDEN : 1;
5602 unsigned CREN : 1;
5603 unsigned SREN : 1;
5604 unsigned RX9 : 1;
5605 unsigned SPEN : 1;
5608 struct
5610 unsigned RCD8 : 1;
5611 unsigned OERR1 : 1;
5612 unsigned FERR1 : 1;
5613 unsigned ADEN : 1;
5614 unsigned CREN1 : 1;
5615 unsigned SREN1 : 1;
5616 unsigned RC9 : 1;
5617 unsigned SPEN1 : 1;
5620 struct
5622 unsigned RX9D1 : 1;
5623 unsigned : 1;
5624 unsigned : 1;
5625 unsigned ADDEN1 : 1;
5626 unsigned : 1;
5627 unsigned : 1;
5628 unsigned NOT_RC8 : 1;
5629 unsigned : 1;
5632 struct
5634 unsigned : 1;
5635 unsigned : 1;
5636 unsigned : 1;
5637 unsigned : 1;
5638 unsigned : 1;
5639 unsigned : 1;
5640 unsigned RC8_9 : 1;
5641 unsigned : 1;
5644 struct
5646 unsigned : 1;
5647 unsigned : 1;
5648 unsigned : 1;
5649 unsigned : 1;
5650 unsigned : 1;
5651 unsigned : 1;
5652 unsigned RX91 : 1;
5653 unsigned : 1;
5655 } __RCSTA1bits_t;
5657 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
5659 #define _RCSTA1_RX9D 0x01
5660 #define _RCSTA1_RCD8 0x01
5661 #define _RCSTA1_RX9D1 0x01
5662 #define _RCSTA1_OERR 0x02
5663 #define _RCSTA1_OERR1 0x02
5664 #define _RCSTA1_FERR 0x04
5665 #define _RCSTA1_FERR1 0x04
5666 #define _RCSTA1_ADDEN 0x08
5667 #define _RCSTA1_ADEN 0x08
5668 #define _RCSTA1_ADDEN1 0x08
5669 #define _RCSTA1_CREN 0x10
5670 #define _RCSTA1_CREN1 0x10
5671 #define _RCSTA1_SREN 0x20
5672 #define _RCSTA1_SREN1 0x20
5673 #define _RCSTA1_RX9 0x40
5674 #define _RCSTA1_RC9 0x40
5675 #define _RCSTA1_NOT_RC8 0x40
5676 #define _RCSTA1_RC8_9 0x40
5677 #define _RCSTA1_RX91 0x40
5678 #define _RCSTA1_SPEN 0x80
5679 #define _RCSTA1_SPEN1 0x80
5681 //==============================================================================
5684 //==============================================================================
5685 // TXSTA Bits
5687 extern __at(0x0FAD) __sfr TXSTA;
5689 typedef union
5691 struct
5693 unsigned TX9D : 1;
5694 unsigned TRMT : 1;
5695 unsigned BRGH : 1;
5696 unsigned SENDB : 1;
5697 unsigned SYNC : 1;
5698 unsigned TXEN : 1;
5699 unsigned TX9 : 1;
5700 unsigned CSRC : 1;
5703 struct
5705 unsigned TXD8 : 1;
5706 unsigned TRMT1 : 1;
5707 unsigned BRGH1 : 1;
5708 unsigned SENDB1 : 1;
5709 unsigned SYNC1 : 1;
5710 unsigned TXEN1 : 1;
5711 unsigned TX8_9 : 1;
5712 unsigned CSRC1 : 1;
5715 struct
5717 unsigned TX9D1 : 1;
5718 unsigned : 1;
5719 unsigned : 1;
5720 unsigned : 1;
5721 unsigned : 1;
5722 unsigned : 1;
5723 unsigned NOT_TX8 : 1;
5724 unsigned : 1;
5727 struct
5729 unsigned : 1;
5730 unsigned : 1;
5731 unsigned : 1;
5732 unsigned : 1;
5733 unsigned : 1;
5734 unsigned : 1;
5735 unsigned TX91 : 1;
5736 unsigned : 1;
5738 } __TXSTAbits_t;
5740 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
5742 #define _TX9D 0x01
5743 #define _TXD8 0x01
5744 #define _TX9D1 0x01
5745 #define _TRMT 0x02
5746 #define _TRMT1 0x02
5747 #define _BRGH 0x04
5748 #define _BRGH1 0x04
5749 #define _SENDB 0x08
5750 #define _SENDB1 0x08
5751 #define _SYNC 0x10
5752 #define _SYNC1 0x10
5753 #define _TXEN 0x20
5754 #define _TXEN1 0x20
5755 #define _TX9 0x40
5756 #define _TX8_9 0x40
5757 #define _NOT_TX8 0x40
5758 #define _TX91 0x40
5759 #define _CSRC 0x80
5760 #define _CSRC1 0x80
5762 //==============================================================================
5765 //==============================================================================
5766 // TXSTA1 Bits
5768 extern __at(0x0FAD) __sfr TXSTA1;
5770 typedef union
5772 struct
5774 unsigned TX9D : 1;
5775 unsigned TRMT : 1;
5776 unsigned BRGH : 1;
5777 unsigned SENDB : 1;
5778 unsigned SYNC : 1;
5779 unsigned TXEN : 1;
5780 unsigned TX9 : 1;
5781 unsigned CSRC : 1;
5784 struct
5786 unsigned TXD8 : 1;
5787 unsigned TRMT1 : 1;
5788 unsigned BRGH1 : 1;
5789 unsigned SENDB1 : 1;
5790 unsigned SYNC1 : 1;
5791 unsigned TXEN1 : 1;
5792 unsigned TX8_9 : 1;
5793 unsigned CSRC1 : 1;
5796 struct
5798 unsigned TX9D1 : 1;
5799 unsigned : 1;
5800 unsigned : 1;
5801 unsigned : 1;
5802 unsigned : 1;
5803 unsigned : 1;
5804 unsigned NOT_TX8 : 1;
5805 unsigned : 1;
5808 struct
5810 unsigned : 1;
5811 unsigned : 1;
5812 unsigned : 1;
5813 unsigned : 1;
5814 unsigned : 1;
5815 unsigned : 1;
5816 unsigned TX91 : 1;
5817 unsigned : 1;
5819 } __TXSTA1bits_t;
5821 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
5823 #define _TXSTA1_TX9D 0x01
5824 #define _TXSTA1_TXD8 0x01
5825 #define _TXSTA1_TX9D1 0x01
5826 #define _TXSTA1_TRMT 0x02
5827 #define _TXSTA1_TRMT1 0x02
5828 #define _TXSTA1_BRGH 0x04
5829 #define _TXSTA1_BRGH1 0x04
5830 #define _TXSTA1_SENDB 0x08
5831 #define _TXSTA1_SENDB1 0x08
5832 #define _TXSTA1_SYNC 0x10
5833 #define _TXSTA1_SYNC1 0x10
5834 #define _TXSTA1_TXEN 0x20
5835 #define _TXSTA1_TXEN1 0x20
5836 #define _TXSTA1_TX9 0x40
5837 #define _TXSTA1_TX8_9 0x40
5838 #define _TXSTA1_NOT_TX8 0x40
5839 #define _TXSTA1_TX91 0x40
5840 #define _TXSTA1_CSRC 0x80
5841 #define _TXSTA1_CSRC1 0x80
5843 //==============================================================================
5845 extern __at(0x0FAE) __sfr TXREG;
5846 extern __at(0x0FAE) __sfr TXREG1;
5847 extern __at(0x0FAF) __sfr RCREG;
5848 extern __at(0x0FAF) __sfr RCREG1;
5849 extern __at(0x0FB0) __sfr SPBRG;
5850 extern __at(0x0FB0) __sfr SPBRG1;
5852 //==============================================================================
5853 // CTMUICON Bits
5855 extern __at(0x0FB1) __sfr CTMUICON;
5857 typedef union
5859 struct
5861 unsigned IRNG0 : 1;
5862 unsigned IRNG1 : 1;
5863 unsigned ITRIM0 : 1;
5864 unsigned ITRIM1 : 1;
5865 unsigned ITRIM2 : 1;
5866 unsigned ITRIM3 : 1;
5867 unsigned ITRIM4 : 1;
5868 unsigned ITRIM5 : 1;
5871 struct
5873 unsigned IRNG : 2;
5874 unsigned : 6;
5877 struct
5879 unsigned : 2;
5880 unsigned ITRIM : 6;
5882 } __CTMUICONbits_t;
5884 extern __at(0x0FB1) volatile __CTMUICONbits_t CTMUICONbits;
5886 #define _IRNG0 0x01
5887 #define _IRNG1 0x02
5888 #define _ITRIM0 0x04
5889 #define _ITRIM1 0x08
5890 #define _ITRIM2 0x10
5891 #define _ITRIM3 0x20
5892 #define _ITRIM4 0x40
5893 #define _ITRIM5 0x80
5895 //==============================================================================
5898 //==============================================================================
5899 // CTMUCONL Bits
5901 extern __at(0x0FB2) __sfr CTMUCONL;
5903 typedef union
5905 struct
5907 unsigned EDG1STAT : 1;
5908 unsigned EDG2STAT : 1;
5909 unsigned EDG1SEL0 : 1;
5910 unsigned EDG1SEL1 : 1;
5911 unsigned EDG1POL : 1;
5912 unsigned EDG2SEL0 : 1;
5913 unsigned EDG2SEL1 : 1;
5914 unsigned EDG2POL : 1;
5917 struct
5919 unsigned : 2;
5920 unsigned EDG1SEL : 2;
5921 unsigned : 4;
5924 struct
5926 unsigned : 5;
5927 unsigned EDG2SEL : 2;
5928 unsigned : 1;
5930 } __CTMUCONLbits_t;
5932 extern __at(0x0FB2) volatile __CTMUCONLbits_t CTMUCONLbits;
5934 #define _EDG1STAT 0x01
5935 #define _EDG2STAT 0x02
5936 #define _EDG1SEL0 0x04
5937 #define _EDG1SEL1 0x08
5938 #define _EDG1POL 0x10
5939 #define _EDG2SEL0 0x20
5940 #define _EDG2SEL1 0x40
5941 #define _EDG2POL 0x80
5943 //==============================================================================
5946 //==============================================================================
5947 // CTMUCONH Bits
5949 extern __at(0x0FB3) __sfr CTMUCONH;
5951 typedef struct
5953 unsigned CTTRIG : 1;
5954 unsigned IDISSEN : 1;
5955 unsigned EDGSEQEN : 1;
5956 unsigned EDGEN : 1;
5957 unsigned TGEN : 1;
5958 unsigned CTMUSIDL : 1;
5959 unsigned : 1;
5960 unsigned CTMUEN : 1;
5961 } __CTMUCONHbits_t;
5963 extern __at(0x0FB3) volatile __CTMUCONHbits_t CTMUCONHbits;
5965 #define _CTTRIG 0x01
5966 #define _IDISSEN 0x02
5967 #define _EDGSEQEN 0x04
5968 #define _EDGEN 0x08
5969 #define _TGEN 0x10
5970 #define _CTMUSIDL 0x20
5971 #define _CTMUEN 0x80
5973 //==============================================================================
5976 //==============================================================================
5977 // CCP2CON Bits
5979 extern __at(0x0FB4) __sfr CCP2CON;
5981 typedef union
5983 struct
5985 unsigned CCP2M0 : 1;
5986 unsigned CCP2M1 : 1;
5987 unsigned CCP2M2 : 1;
5988 unsigned CCP2M3 : 1;
5989 unsigned DC2B0 : 1;
5990 unsigned DC2B1 : 1;
5991 unsigned P2M0 : 1;
5992 unsigned P2M1 : 1;
5995 struct
5997 unsigned : 1;
5998 unsigned : 1;
5999 unsigned : 1;
6000 unsigned : 1;
6001 unsigned CCP2Y : 1;
6002 unsigned CCP2X : 1;
6003 unsigned : 1;
6004 unsigned : 1;
6007 struct
6009 unsigned CCP2M : 4;
6010 unsigned : 4;
6013 struct
6015 unsigned : 4;
6016 unsigned DC2B : 2;
6017 unsigned : 2;
6020 struct
6022 unsigned : 6;
6023 unsigned P2M : 2;
6025 } __CCP2CONbits_t;
6027 extern __at(0x0FB4) volatile __CCP2CONbits_t CCP2CONbits;
6029 #define _CCP2M0 0x01
6030 #define _CCP2M1 0x02
6031 #define _CCP2M2 0x04
6032 #define _CCP2M3 0x08
6033 #define _DC2B0 0x10
6034 #define _CCP2Y 0x10
6035 #define _DC2B1 0x20
6036 #define _CCP2X 0x20
6037 #define _P2M0 0x40
6038 #define _P2M1 0x80
6040 //==============================================================================
6043 //==============================================================================
6044 // ECCP2CON Bits
6046 extern __at(0x0FB4) __sfr ECCP2CON;
6048 typedef union
6050 struct
6052 unsigned CCP2M0 : 1;
6053 unsigned CCP2M1 : 1;
6054 unsigned CCP2M2 : 1;
6055 unsigned CCP2M3 : 1;
6056 unsigned DC2B0 : 1;
6057 unsigned DC2B1 : 1;
6058 unsigned P2M0 : 1;
6059 unsigned P2M1 : 1;
6062 struct
6064 unsigned : 1;
6065 unsigned : 1;
6066 unsigned : 1;
6067 unsigned : 1;
6068 unsigned CCP2Y : 1;
6069 unsigned CCP2X : 1;
6070 unsigned : 1;
6071 unsigned : 1;
6074 struct
6076 unsigned CCP2M : 4;
6077 unsigned : 4;
6080 struct
6082 unsigned : 4;
6083 unsigned DC2B : 2;
6084 unsigned : 2;
6087 struct
6089 unsigned : 6;
6090 unsigned P2M : 2;
6092 } __ECCP2CONbits_t;
6094 extern __at(0x0FB4) volatile __ECCP2CONbits_t ECCP2CONbits;
6096 #define _ECCP2CON_CCP2M0 0x01
6097 #define _ECCP2CON_CCP2M1 0x02
6098 #define _ECCP2CON_CCP2M2 0x04
6099 #define _ECCP2CON_CCP2M3 0x08
6100 #define _ECCP2CON_DC2B0 0x10
6101 #define _ECCP2CON_CCP2Y 0x10
6102 #define _ECCP2CON_DC2B1 0x20
6103 #define _ECCP2CON_CCP2X 0x20
6104 #define _ECCP2CON_P2M0 0x40
6105 #define _ECCP2CON_P2M1 0x80
6107 //==============================================================================
6109 extern __at(0x0FB5) __sfr CCPR2;
6110 extern __at(0x0FB5) __sfr CCPR2L;
6111 extern __at(0x0FB6) __sfr CCPR2H;
6113 //==============================================================================
6114 // ECCP2DEL Bits
6116 extern __at(0x0FB7) __sfr ECCP2DEL;
6118 typedef union
6120 struct
6122 unsigned P2DC0 : 1;
6123 unsigned P2DC1 : 1;
6124 unsigned P2DC2 : 1;
6125 unsigned P2DC3 : 1;
6126 unsigned P2DC4 : 1;
6127 unsigned P2DC5 : 1;
6128 unsigned P2DC6 : 1;
6129 unsigned P2RSEN : 1;
6132 struct
6134 unsigned P2DC : 7;
6135 unsigned : 1;
6137 } __ECCP2DELbits_t;
6139 extern __at(0x0FB7) volatile __ECCP2DELbits_t ECCP2DELbits;
6141 #define _P2DC0 0x01
6142 #define _P2DC1 0x02
6143 #define _P2DC2 0x04
6144 #define _P2DC3 0x08
6145 #define _P2DC4 0x10
6146 #define _P2DC5 0x20
6147 #define _P2DC6 0x40
6148 #define _P2RSEN 0x80
6150 //==============================================================================
6153 //==============================================================================
6154 // PWM2CON Bits
6156 extern __at(0x0FB7) __sfr PWM2CON;
6158 typedef union
6160 struct
6162 unsigned P2DC0 : 1;
6163 unsigned P2DC1 : 1;
6164 unsigned P2DC2 : 1;
6165 unsigned P2DC3 : 1;
6166 unsigned P2DC4 : 1;
6167 unsigned P2DC5 : 1;
6168 unsigned P2DC6 : 1;
6169 unsigned P2RSEN : 1;
6172 struct
6174 unsigned P2DC : 7;
6175 unsigned : 1;
6177 } __PWM2CONbits_t;
6179 extern __at(0x0FB7) volatile __PWM2CONbits_t PWM2CONbits;
6181 #define _PWM2CON_P2DC0 0x01
6182 #define _PWM2CON_P2DC1 0x02
6183 #define _PWM2CON_P2DC2 0x04
6184 #define _PWM2CON_P2DC3 0x08
6185 #define _PWM2CON_P2DC4 0x10
6186 #define _PWM2CON_P2DC5 0x20
6187 #define _PWM2CON_P2DC6 0x40
6188 #define _PWM2CON_P2RSEN 0x80
6190 //==============================================================================
6193 //==============================================================================
6194 // ECCP2AS Bits
6196 extern __at(0x0FB8) __sfr ECCP2AS;
6198 typedef union
6200 struct
6202 unsigned PSS2BD0 : 1;
6203 unsigned PSS2BD1 : 1;
6204 unsigned PSS2AC0 : 1;
6205 unsigned PSS2AC1 : 1;
6206 unsigned ECCP2AS0 : 1;
6207 unsigned ECCP2AS1 : 1;
6208 unsigned ECCP2AS2 : 1;
6209 unsigned ECCP2ASE : 1;
6212 struct
6214 unsigned PSS2BD : 2;
6215 unsigned : 6;
6218 struct
6220 unsigned : 2;
6221 unsigned PSS2AC : 2;
6222 unsigned : 4;
6225 struct
6227 unsigned : 4;
6228 unsigned ECCP2AS : 3;
6229 unsigned : 1;
6231 } __ECCP2ASbits_t;
6233 extern __at(0x0FB8) volatile __ECCP2ASbits_t ECCP2ASbits;
6235 #define _PSS2BD0 0x01
6236 #define _PSS2BD1 0x02
6237 #define _PSS2AC0 0x04
6238 #define _PSS2AC1 0x08
6239 #define _ECCP2AS0 0x10
6240 #define _ECCP2AS1 0x20
6241 #define _ECCP2AS2 0x40
6242 #define _ECCP2ASE 0x80
6244 //==============================================================================
6247 //==============================================================================
6248 // PSTR2CON Bits
6250 extern __at(0x0FB9) __sfr PSTR2CON;
6252 typedef union
6254 struct
6256 unsigned STRA : 1;
6257 unsigned STRB : 1;
6258 unsigned STRC : 1;
6259 unsigned STRD : 1;
6260 unsigned STRSYNC : 1;
6261 unsigned P2DC5 : 1;
6262 unsigned CMPL0 : 1;
6263 unsigned CMPL1 : 1;
6266 struct
6268 unsigned P2DC0 : 1;
6269 unsigned P2DC1 : 1;
6270 unsigned P2DC2 : 1;
6271 unsigned P2DC3 : 1;
6272 unsigned P2DC4 : 1;
6273 unsigned : 1;
6274 unsigned P2DC6 : 1;
6275 unsigned : 1;
6278 struct
6280 unsigned P2DC : 7;
6281 unsigned : 1;
6284 struct
6286 unsigned : 6;
6287 unsigned CMPL : 2;
6289 } __PSTR2CONbits_t;
6291 extern __at(0x0FB9) volatile __PSTR2CONbits_t PSTR2CONbits;
6293 #define _PSTR2CON_STRA 0x01
6294 #define _PSTR2CON_P2DC0 0x01
6295 #define _PSTR2CON_STRB 0x02
6296 #define _PSTR2CON_P2DC1 0x02
6297 #define _PSTR2CON_STRC 0x04
6298 #define _PSTR2CON_P2DC2 0x04
6299 #define _PSTR2CON_STRD 0x08
6300 #define _PSTR2CON_P2DC3 0x08
6301 #define _PSTR2CON_STRSYNC 0x10
6302 #define _PSTR2CON_P2DC4 0x10
6303 #define _PSTR2CON_P2DC5 0x20
6304 #define _PSTR2CON_CMPL0 0x40
6305 #define _PSTR2CON_P2DC6 0x40
6306 #define _PSTR2CON_CMPL1 0x80
6308 //==============================================================================
6311 //==============================================================================
6312 // CCP1CON Bits
6314 extern __at(0x0FBA) __sfr CCP1CON;
6316 typedef union
6318 struct
6320 unsigned CCP1M0 : 1;
6321 unsigned CCP1M1 : 1;
6322 unsigned CCP1M2 : 1;
6323 unsigned CCP1M3 : 1;
6324 unsigned DC1B0 : 1;
6325 unsigned DC1B1 : 1;
6326 unsigned P1M0 : 1;
6327 unsigned P1M1 : 1;
6330 struct
6332 unsigned : 1;
6333 unsigned : 1;
6334 unsigned : 1;
6335 unsigned : 1;
6336 unsigned CCP1Y : 1;
6337 unsigned CCP1X : 1;
6338 unsigned : 1;
6339 unsigned : 1;
6342 struct
6344 unsigned CCP1M : 4;
6345 unsigned : 4;
6348 struct
6350 unsigned : 4;
6351 unsigned DC1B : 2;
6352 unsigned : 2;
6355 struct
6357 unsigned : 6;
6358 unsigned P1M : 2;
6360 } __CCP1CONbits_t;
6362 extern __at(0x0FBA) volatile __CCP1CONbits_t CCP1CONbits;
6364 #define _CCP1M0 0x01
6365 #define _CCP1M1 0x02
6366 #define _CCP1M2 0x04
6367 #define _CCP1M3 0x08
6368 #define _DC1B0 0x10
6369 #define _CCP1Y 0x10
6370 #define _DC1B1 0x20
6371 #define _CCP1X 0x20
6372 #define _P1M0 0x40
6373 #define _P1M1 0x80
6375 //==============================================================================
6378 //==============================================================================
6379 // ECCP1CON Bits
6381 extern __at(0x0FBA) __sfr ECCP1CON;
6383 typedef union
6385 struct
6387 unsigned CCP1M0 : 1;
6388 unsigned CCP1M1 : 1;
6389 unsigned CCP1M2 : 1;
6390 unsigned CCP1M3 : 1;
6391 unsigned DC1B0 : 1;
6392 unsigned DC1B1 : 1;
6393 unsigned P1M0 : 1;
6394 unsigned P1M1 : 1;
6397 struct
6399 unsigned : 1;
6400 unsigned : 1;
6401 unsigned : 1;
6402 unsigned : 1;
6403 unsigned CCP1Y : 1;
6404 unsigned CCP1X : 1;
6405 unsigned : 1;
6406 unsigned : 1;
6409 struct
6411 unsigned CCP1M : 4;
6412 unsigned : 4;
6415 struct
6417 unsigned : 4;
6418 unsigned DC1B : 2;
6419 unsigned : 2;
6422 struct
6424 unsigned : 6;
6425 unsigned P1M : 2;
6427 } __ECCP1CONbits_t;
6429 extern __at(0x0FBA) volatile __ECCP1CONbits_t ECCP1CONbits;
6431 #define _ECCP1CON_CCP1M0 0x01
6432 #define _ECCP1CON_CCP1M1 0x02
6433 #define _ECCP1CON_CCP1M2 0x04
6434 #define _ECCP1CON_CCP1M3 0x08
6435 #define _ECCP1CON_DC1B0 0x10
6436 #define _ECCP1CON_CCP1Y 0x10
6437 #define _ECCP1CON_DC1B1 0x20
6438 #define _ECCP1CON_CCP1X 0x20
6439 #define _ECCP1CON_P1M0 0x40
6440 #define _ECCP1CON_P1M1 0x80
6442 //==============================================================================
6444 extern __at(0x0FBB) __sfr CCPR1;
6445 extern __at(0x0FBB) __sfr CCPR1L;
6446 extern __at(0x0FBC) __sfr CCPR1H;
6448 //==============================================================================
6449 // ECCP1DEL Bits
6451 extern __at(0x0FBD) __sfr ECCP1DEL;
6453 typedef union
6455 struct
6457 unsigned P1DC0 : 1;
6458 unsigned P1DC1 : 1;
6459 unsigned P1DC2 : 1;
6460 unsigned P1DC3 : 1;
6461 unsigned P1DC4 : 1;
6462 unsigned P1DC5 : 1;
6463 unsigned P1DC6 : 1;
6464 unsigned P1RSEN : 1;
6467 struct
6469 unsigned P1DC : 7;
6470 unsigned : 1;
6472 } __ECCP1DELbits_t;
6474 extern __at(0x0FBD) volatile __ECCP1DELbits_t ECCP1DELbits;
6476 #define _P1DC0 0x01
6477 #define _P1DC1 0x02
6478 #define _P1DC2 0x04
6479 #define _P1DC3 0x08
6480 #define _P1DC4 0x10
6481 #define _P1DC5 0x20
6482 #define _P1DC6 0x40
6483 #define _P1RSEN 0x80
6485 //==============================================================================
6488 //==============================================================================
6489 // PWM1CON Bits
6491 extern __at(0x0FBD) __sfr PWM1CON;
6493 typedef union
6495 struct
6497 unsigned P1DC0 : 1;
6498 unsigned P1DC1 : 1;
6499 unsigned P1DC2 : 1;
6500 unsigned P1DC3 : 1;
6501 unsigned P1DC4 : 1;
6502 unsigned P1DC5 : 1;
6503 unsigned P1DC6 : 1;
6504 unsigned P1RSEN : 1;
6507 struct
6509 unsigned P1DC : 7;
6510 unsigned : 1;
6512 } __PWM1CONbits_t;
6514 extern __at(0x0FBD) volatile __PWM1CONbits_t PWM1CONbits;
6516 #define _PWM1CON_P1DC0 0x01
6517 #define _PWM1CON_P1DC1 0x02
6518 #define _PWM1CON_P1DC2 0x04
6519 #define _PWM1CON_P1DC3 0x08
6520 #define _PWM1CON_P1DC4 0x10
6521 #define _PWM1CON_P1DC5 0x20
6522 #define _PWM1CON_P1DC6 0x40
6523 #define _PWM1CON_P1RSEN 0x80
6525 //==============================================================================
6528 //==============================================================================
6529 // ECCP1AS Bits
6531 extern __at(0x0FBE) __sfr ECCP1AS;
6533 typedef union
6535 struct
6537 unsigned PSS1BD0 : 1;
6538 unsigned PSS1BD1 : 1;
6539 unsigned PSS1AC0 : 1;
6540 unsigned PSS1AC1 : 1;
6541 unsigned ECCP1AS0 : 1;
6542 unsigned ECCP1AS1 : 1;
6543 unsigned ECCP1AS2 : 1;
6544 unsigned ECCP1ASE : 1;
6547 struct
6549 unsigned PSS1BD : 2;
6550 unsigned : 6;
6553 struct
6555 unsigned : 2;
6556 unsigned PSS1AC : 2;
6557 unsigned : 4;
6560 struct
6562 unsigned : 4;
6563 unsigned ECCP1AS : 3;
6564 unsigned : 1;
6566 } __ECCP1ASbits_t;
6568 extern __at(0x0FBE) volatile __ECCP1ASbits_t ECCP1ASbits;
6570 #define _PSS1BD0 0x01
6571 #define _PSS1BD1 0x02
6572 #define _PSS1AC0 0x04
6573 #define _PSS1AC1 0x08
6574 #define _ECCP1AS0 0x10
6575 #define _ECCP1AS1 0x20
6576 #define _ECCP1AS2 0x40
6577 #define _ECCP1ASE 0x80
6579 //==============================================================================
6582 //==============================================================================
6583 // PSTR1CON Bits
6585 extern __at(0x0FBF) __sfr PSTR1CON;
6587 typedef union
6589 struct
6591 unsigned STRA : 1;
6592 unsigned STRB : 1;
6593 unsigned STRC : 1;
6594 unsigned STRD : 1;
6595 unsigned STRSYNC : 1;
6596 unsigned : 1;
6597 unsigned CMPL0 : 1;
6598 unsigned CMPL1 : 1;
6601 struct
6603 unsigned : 6;
6604 unsigned CMPL : 2;
6606 } __PSTR1CONbits_t;
6608 extern __at(0x0FBF) volatile __PSTR1CONbits_t PSTR1CONbits;
6610 #define _STRA 0x01
6611 #define _STRB 0x02
6612 #define _STRC 0x04
6613 #define _STRD 0x08
6614 #define _STRSYNC 0x10
6615 #define _CMPL0 0x40
6616 #define _CMPL1 0x80
6618 //==============================================================================
6621 //==============================================================================
6622 // WDTCON Bits
6624 extern __at(0x0FC0) __sfr WDTCON;
6626 typedef union
6628 struct
6630 unsigned SWDTEN : 1;
6631 unsigned ULPSINK : 1;
6632 unsigned ULPEN : 1;
6633 unsigned DS : 1;
6634 unsigned VBGOE : 1;
6635 unsigned ULPLVL : 1;
6636 unsigned LVDSTAT : 1;
6637 unsigned REGSLP : 1;
6640 struct
6642 unsigned SWDTE : 1;
6643 unsigned : 1;
6644 unsigned : 1;
6645 unsigned : 1;
6646 unsigned : 1;
6647 unsigned : 1;
6648 unsigned : 1;
6649 unsigned : 1;
6651 } __WDTCONbits_t;
6653 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
6655 #define _SWDTEN 0x01
6656 #define _SWDTE 0x01
6657 #define _ULPSINK 0x02
6658 #define _ULPEN 0x04
6659 #define _DS 0x08
6660 #define _VBGOE 0x10
6661 #define _ULPLVL 0x20
6662 #define _LVDSTAT 0x40
6663 #define _REGSLP 0x80
6665 //==============================================================================
6668 //==============================================================================
6669 // ADCON1 Bits
6671 extern __at(0x0FC1) __sfr ADCON1;
6673 typedef union
6675 struct
6677 unsigned ADCS0 : 1;
6678 unsigned ADCS1 : 1;
6679 unsigned ADCS2 : 1;
6680 unsigned ACQT0 : 1;
6681 unsigned ACQT1 : 1;
6682 unsigned ACQT2 : 1;
6683 unsigned ADCAL : 1;
6684 unsigned ADFM : 1;
6687 struct
6689 unsigned ADCS : 3;
6690 unsigned : 5;
6693 struct
6695 unsigned : 3;
6696 unsigned ACQT : 3;
6697 unsigned : 2;
6699 } __ADCON1bits_t;
6701 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
6703 #define _ADCS0 0x01
6704 #define _ADCS1 0x02
6705 #define _ADCS2 0x04
6706 #define _ACQT0 0x08
6707 #define _ACQT1 0x10
6708 #define _ACQT2 0x20
6709 #define _ADCAL 0x40
6710 #define _ADFM 0x80
6712 //==============================================================================
6715 //==============================================================================
6716 // ADCON0 Bits
6718 extern __at(0x0FC2) __sfr ADCON0;
6720 typedef union
6722 struct
6724 unsigned ADON : 1;
6725 unsigned GO_NOT_DONE : 1;
6726 unsigned CHS0 : 1;
6727 unsigned CHS1 : 1;
6728 unsigned CHS2 : 1;
6729 unsigned CHS3 : 1;
6730 unsigned VCFG0 : 1;
6731 unsigned VCFG1 : 1;
6734 struct
6736 unsigned : 1;
6737 unsigned GO_DONE : 1;
6738 unsigned : 1;
6739 unsigned : 1;
6740 unsigned : 1;
6741 unsigned : 1;
6742 unsigned : 1;
6743 unsigned : 1;
6746 struct
6748 unsigned : 1;
6749 unsigned DONE : 1;
6750 unsigned : 1;
6751 unsigned : 1;
6752 unsigned : 1;
6753 unsigned : 1;
6754 unsigned : 1;
6755 unsigned : 1;
6758 struct
6760 unsigned : 1;
6761 unsigned GO : 1;
6762 unsigned : 1;
6763 unsigned : 1;
6764 unsigned : 1;
6765 unsigned : 1;
6766 unsigned : 1;
6767 unsigned : 1;
6770 struct
6772 unsigned : 1;
6773 unsigned NOT_DONE : 1;
6774 unsigned : 1;
6775 unsigned : 1;
6776 unsigned : 1;
6777 unsigned : 1;
6778 unsigned : 1;
6779 unsigned : 1;
6782 struct
6784 unsigned : 2;
6785 unsigned CHS : 4;
6786 unsigned : 2;
6789 struct
6791 unsigned : 6;
6792 unsigned VCFG : 2;
6794 } __ADCON0bits_t;
6796 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
6798 #define _ADON 0x01
6799 #define _GO_NOT_DONE 0x02
6800 #define _GO_DONE 0x02
6801 #define _DONE 0x02
6802 #define _GO 0x02
6803 #define _NOT_DONE 0x02
6804 #define _CHS0 0x04
6805 #define _CHS1 0x08
6806 #define _CHS2 0x10
6807 #define _CHS3 0x20
6808 #define _VCFG0 0x40
6809 #define _VCFG1 0x80
6811 //==============================================================================
6813 extern __at(0x0FC3) __sfr ADRES;
6814 extern __at(0x0FC3) __sfr ADRESL;
6815 extern __at(0x0FC4) __sfr ADRESH;
6817 //==============================================================================
6818 // SSP1CON2 Bits
6820 extern __at(0x0FC5) __sfr SSP1CON2;
6822 typedef union
6824 struct
6826 unsigned SEN : 1;
6827 unsigned RSEN : 1;
6828 unsigned PEN : 1;
6829 unsigned RCEN : 1;
6830 unsigned ACKEN : 1;
6831 unsigned ACKDT : 1;
6832 unsigned ACKSTAT : 1;
6833 unsigned GCEN : 1;
6836 struct
6838 unsigned : 1;
6839 unsigned ADMSK1 : 1;
6840 unsigned ADMSK2 : 1;
6841 unsigned ADMSK3 : 1;
6842 unsigned ADMSK4 : 1;
6843 unsigned ADMSK5 : 1;
6844 unsigned : 1;
6845 unsigned : 1;
6847 } __SSP1CON2bits_t;
6849 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
6851 #define _SEN 0x01
6852 #define _RSEN 0x02
6853 #define _ADMSK1 0x02
6854 #define _PEN 0x04
6855 #define _ADMSK2 0x04
6856 #define _RCEN 0x08
6857 #define _ADMSK3 0x08
6858 #define _ACKEN 0x10
6859 #define _ADMSK4 0x10
6860 #define _ACKDT 0x20
6861 #define _ADMSK5 0x20
6862 #define _ACKSTAT 0x40
6863 #define _GCEN 0x80
6865 //==============================================================================
6868 //==============================================================================
6869 // SSPCON2 Bits
6871 extern __at(0x0FC5) __sfr SSPCON2;
6873 typedef union
6875 struct
6877 unsigned SEN : 1;
6878 unsigned RSEN : 1;
6879 unsigned PEN : 1;
6880 unsigned RCEN : 1;
6881 unsigned ACKEN : 1;
6882 unsigned ACKDT : 1;
6883 unsigned ACKSTAT : 1;
6884 unsigned GCEN : 1;
6887 struct
6889 unsigned : 1;
6890 unsigned ADMSK1 : 1;
6891 unsigned ADMSK2 : 1;
6892 unsigned ADMSK3 : 1;
6893 unsigned ADMSK4 : 1;
6894 unsigned ADMSK5 : 1;
6895 unsigned : 1;
6896 unsigned : 1;
6898 } __SSPCON2bits_t;
6900 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
6902 #define _SSPCON2_SEN 0x01
6903 #define _SSPCON2_RSEN 0x02
6904 #define _SSPCON2_ADMSK1 0x02
6905 #define _SSPCON2_PEN 0x04
6906 #define _SSPCON2_ADMSK2 0x04
6907 #define _SSPCON2_RCEN 0x08
6908 #define _SSPCON2_ADMSK3 0x08
6909 #define _SSPCON2_ACKEN 0x10
6910 #define _SSPCON2_ADMSK4 0x10
6911 #define _SSPCON2_ACKDT 0x20
6912 #define _SSPCON2_ADMSK5 0x20
6913 #define _SSPCON2_ACKSTAT 0x40
6914 #define _SSPCON2_GCEN 0x80
6916 //==============================================================================
6919 //==============================================================================
6920 // SSP1CON1 Bits
6922 extern __at(0x0FC6) __sfr SSP1CON1;
6924 typedef union
6926 struct
6928 unsigned SSPM0 : 1;
6929 unsigned SSPM1 : 1;
6930 unsigned SSPM2 : 1;
6931 unsigned SSPM3 : 1;
6932 unsigned CKP : 1;
6933 unsigned SSPEN : 1;
6934 unsigned SSPOV : 1;
6935 unsigned WCOL : 1;
6938 struct
6940 unsigned SSPM : 4;
6941 unsigned : 4;
6943 } __SSP1CON1bits_t;
6945 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
6947 #define _SSPM0 0x01
6948 #define _SSPM1 0x02
6949 #define _SSPM2 0x04
6950 #define _SSPM3 0x08
6951 #define _CKP 0x10
6952 #define _SSPEN 0x20
6953 #define _SSPOV 0x40
6954 #define _WCOL 0x80
6956 //==============================================================================
6959 //==============================================================================
6960 // SSPCON1 Bits
6962 extern __at(0x0FC6) __sfr SSPCON1;
6964 typedef union
6966 struct
6968 unsigned SSPM0 : 1;
6969 unsigned SSPM1 : 1;
6970 unsigned SSPM2 : 1;
6971 unsigned SSPM3 : 1;
6972 unsigned CKP : 1;
6973 unsigned SSPEN : 1;
6974 unsigned SSPOV : 1;
6975 unsigned WCOL : 1;
6978 struct
6980 unsigned SSPM : 4;
6981 unsigned : 4;
6983 } __SSPCON1bits_t;
6985 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
6987 #define _SSPCON1_SSPM0 0x01
6988 #define _SSPCON1_SSPM1 0x02
6989 #define _SSPCON1_SSPM2 0x04
6990 #define _SSPCON1_SSPM3 0x08
6991 #define _SSPCON1_CKP 0x10
6992 #define _SSPCON1_SSPEN 0x20
6993 #define _SSPCON1_SSPOV 0x40
6994 #define _SSPCON1_WCOL 0x80
6996 //==============================================================================
6999 //==============================================================================
7000 // SSP1STAT Bits
7002 extern __at(0x0FC7) __sfr SSP1STAT;
7004 typedef union
7006 struct
7008 unsigned BF : 1;
7009 unsigned UA : 1;
7010 unsigned R_NOT_W : 1;
7011 unsigned S : 1;
7012 unsigned P : 1;
7013 unsigned D_NOT_A : 1;
7014 unsigned CKE : 1;
7015 unsigned SMP : 1;
7018 struct
7020 unsigned : 1;
7021 unsigned : 1;
7022 unsigned R : 1;
7023 unsigned I2C_START : 1;
7024 unsigned I2C_STOP : 1;
7025 unsigned D : 1;
7026 unsigned : 1;
7027 unsigned : 1;
7030 struct
7032 unsigned : 1;
7033 unsigned : 1;
7034 unsigned R_W : 1;
7035 unsigned : 1;
7036 unsigned : 1;
7037 unsigned D_A : 1;
7038 unsigned : 1;
7039 unsigned : 1;
7042 struct
7044 unsigned : 1;
7045 unsigned : 1;
7046 unsigned NOT_W : 1;
7047 unsigned : 1;
7048 unsigned : 1;
7049 unsigned NOT_A : 1;
7050 unsigned : 1;
7051 unsigned : 1;
7054 struct
7056 unsigned : 1;
7057 unsigned : 1;
7058 unsigned NOT_WRITE : 1;
7059 unsigned : 1;
7060 unsigned : 1;
7061 unsigned NOT_ADDRESS : 1;
7062 unsigned : 1;
7063 unsigned : 1;
7066 struct
7068 unsigned : 1;
7069 unsigned : 1;
7070 unsigned READ_WRITE : 1;
7071 unsigned : 1;
7072 unsigned : 1;
7073 unsigned DATA_ADDRESS : 1;
7074 unsigned : 1;
7075 unsigned : 1;
7078 struct
7080 unsigned : 1;
7081 unsigned : 1;
7082 unsigned I2C_READ : 1;
7083 unsigned : 1;
7084 unsigned : 1;
7085 unsigned I2C_DAT : 1;
7086 unsigned : 1;
7087 unsigned : 1;
7089 } __SSP1STATbits_t;
7091 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
7093 #define _BF 0x01
7094 #define _UA 0x02
7095 #define _R_NOT_W 0x04
7096 #define _R 0x04
7097 #define _R_W 0x04
7098 #define _NOT_W 0x04
7099 #define _NOT_WRITE 0x04
7100 #define _READ_WRITE 0x04
7101 #define _I2C_READ 0x04
7102 #define _S 0x08
7103 #define _I2C_START 0x08
7104 #define _P 0x10
7105 #define _I2C_STOP 0x10
7106 #define _D_NOT_A 0x20
7107 #define _D 0x20
7108 #define _D_A 0x20
7109 #define _NOT_A 0x20
7110 #define _NOT_ADDRESS 0x20
7111 #define _DATA_ADDRESS 0x20
7112 #define _I2C_DAT 0x20
7113 #define _CKE 0x40
7114 #define _SMP 0x80
7116 //==============================================================================
7119 //==============================================================================
7120 // SSPSTAT Bits
7122 extern __at(0x0FC7) __sfr SSPSTAT;
7124 typedef union
7126 struct
7128 unsigned BF : 1;
7129 unsigned UA : 1;
7130 unsigned R_NOT_W : 1;
7131 unsigned S : 1;
7132 unsigned P : 1;
7133 unsigned D_NOT_A : 1;
7134 unsigned CKE : 1;
7135 unsigned SMP : 1;
7138 struct
7140 unsigned : 1;
7141 unsigned : 1;
7142 unsigned R : 1;
7143 unsigned I2C_START : 1;
7144 unsigned I2C_STOP : 1;
7145 unsigned D : 1;
7146 unsigned : 1;
7147 unsigned : 1;
7150 struct
7152 unsigned : 1;
7153 unsigned : 1;
7154 unsigned R_W : 1;
7155 unsigned : 1;
7156 unsigned : 1;
7157 unsigned D_A : 1;
7158 unsigned : 1;
7159 unsigned : 1;
7162 struct
7164 unsigned : 1;
7165 unsigned : 1;
7166 unsigned NOT_W : 1;
7167 unsigned : 1;
7168 unsigned : 1;
7169 unsigned NOT_A : 1;
7170 unsigned : 1;
7171 unsigned : 1;
7174 struct
7176 unsigned : 1;
7177 unsigned : 1;
7178 unsigned NOT_WRITE : 1;
7179 unsigned : 1;
7180 unsigned : 1;
7181 unsigned NOT_ADDRESS : 1;
7182 unsigned : 1;
7183 unsigned : 1;
7186 struct
7188 unsigned : 1;
7189 unsigned : 1;
7190 unsigned READ_WRITE : 1;
7191 unsigned : 1;
7192 unsigned : 1;
7193 unsigned DATA_ADDRESS : 1;
7194 unsigned : 1;
7195 unsigned : 1;
7198 struct
7200 unsigned : 1;
7201 unsigned : 1;
7202 unsigned I2C_READ : 1;
7203 unsigned : 1;
7204 unsigned : 1;
7205 unsigned I2C_DAT : 1;
7206 unsigned : 1;
7207 unsigned : 1;
7209 } __SSPSTATbits_t;
7211 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
7213 #define _SSPSTAT_BF 0x01
7214 #define _SSPSTAT_UA 0x02
7215 #define _SSPSTAT_R_NOT_W 0x04
7216 #define _SSPSTAT_R 0x04
7217 #define _SSPSTAT_R_W 0x04
7218 #define _SSPSTAT_NOT_W 0x04
7219 #define _SSPSTAT_NOT_WRITE 0x04
7220 #define _SSPSTAT_READ_WRITE 0x04
7221 #define _SSPSTAT_I2C_READ 0x04
7222 #define _SSPSTAT_S 0x08
7223 #define _SSPSTAT_I2C_START 0x08
7224 #define _SSPSTAT_P 0x10
7225 #define _SSPSTAT_I2C_STOP 0x10
7226 #define _SSPSTAT_D_NOT_A 0x20
7227 #define _SSPSTAT_D 0x20
7228 #define _SSPSTAT_D_A 0x20
7229 #define _SSPSTAT_NOT_A 0x20
7230 #define _SSPSTAT_NOT_ADDRESS 0x20
7231 #define _SSPSTAT_DATA_ADDRESS 0x20
7232 #define _SSPSTAT_I2C_DAT 0x20
7233 #define _SSPSTAT_CKE 0x40
7234 #define _SSPSTAT_SMP 0x80
7236 //==============================================================================
7238 extern __at(0x0FC8) __sfr SSP1ADD;
7240 //==============================================================================
7241 // SSP1MSK Bits
7243 extern __at(0x0FC8) __sfr SSP1MSK;
7245 typedef struct
7247 unsigned MSK0 : 1;
7248 unsigned MSK1 : 1;
7249 unsigned MSK2 : 1;
7250 unsigned MSK3 : 1;
7251 unsigned MSK4 : 1;
7252 unsigned MSK5 : 1;
7253 unsigned MSK6 : 1;
7254 unsigned MSK7 : 1;
7255 } __SSP1MSKbits_t;
7257 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
7259 #define _MSK0 0x01
7260 #define _MSK1 0x02
7261 #define _MSK2 0x04
7262 #define _MSK3 0x08
7263 #define _MSK4 0x10
7264 #define _MSK5 0x20
7265 #define _MSK6 0x40
7266 #define _MSK7 0x80
7268 //==============================================================================
7270 extern __at(0x0FC8) __sfr SSPADD;
7271 extern __at(0x0FC9) __sfr SSP1BUF;
7272 extern __at(0x0FC9) __sfr SSPBUF;
7274 //==============================================================================
7275 // T2CON Bits
7277 extern __at(0x0FCA) __sfr T2CON;
7279 typedef union
7281 struct
7283 unsigned T2CKPS0 : 1;
7284 unsigned T2CKPS1 : 1;
7285 unsigned TMR2ON : 1;
7286 unsigned T2OUTPS0 : 1;
7287 unsigned T2OUTPS1 : 1;
7288 unsigned T2OUTPS2 : 1;
7289 unsigned T2OUTPS3 : 1;
7290 unsigned : 1;
7293 struct
7295 unsigned T2CKPS : 2;
7296 unsigned : 6;
7299 struct
7301 unsigned : 3;
7302 unsigned T2OUTPS : 4;
7303 unsigned : 1;
7305 } __T2CONbits_t;
7307 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
7309 #define _T2CKPS0 0x01
7310 #define _T2CKPS1 0x02
7311 #define _TMR2ON 0x04
7312 #define _T2OUTPS0 0x08
7313 #define _T2OUTPS1 0x10
7314 #define _T2OUTPS2 0x20
7315 #define _T2OUTPS3 0x40
7317 //==============================================================================
7319 extern __at(0x0FCB) __sfr PR2;
7320 extern __at(0x0FCC) __sfr TMR2;
7322 //==============================================================================
7323 // T1CON Bits
7325 extern __at(0x0FCD) __sfr T1CON;
7327 typedef union
7329 struct
7331 unsigned TMR1ON : 1;
7332 unsigned RD16 : 1;
7333 unsigned NOT_T1SYNC : 1;
7334 unsigned T1OSCEN : 1;
7335 unsigned T1CKPS0 : 1;
7336 unsigned T1CKPS1 : 1;
7337 unsigned TMR1CS0 : 1;
7338 unsigned TMR1CS1 : 1;
7341 struct
7343 unsigned : 4;
7344 unsigned T1CKPS : 2;
7345 unsigned : 2;
7348 struct
7350 unsigned : 6;
7351 unsigned TMR1CS : 2;
7353 } __T1CONbits_t;
7355 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
7357 #define _TMR1ON 0x01
7358 #define _RD16 0x02
7359 #define _NOT_T1SYNC 0x04
7360 #define _T1OSCEN 0x08
7361 #define _T1CKPS0 0x10
7362 #define _T1CKPS1 0x20
7363 #define _TMR1CS0 0x40
7364 #define _TMR1CS1 0x80
7366 //==============================================================================
7368 extern __at(0x0FCE) __sfr TMR1;
7369 extern __at(0x0FCE) __sfr TMR1L;
7370 extern __at(0x0FCF) __sfr TMR1H;
7372 //==============================================================================
7373 // RCON Bits
7375 extern __at(0x0FD0) __sfr RCON;
7377 typedef union
7379 struct
7381 unsigned NOT_BOR : 1;
7382 unsigned NOT_POR : 1;
7383 unsigned NOT_PD : 1;
7384 unsigned NOT_TO : 1;
7385 unsigned NOT_RI : 1;
7386 unsigned NOT_CM : 1;
7387 unsigned : 1;
7388 unsigned IPEN : 1;
7391 struct
7393 unsigned BOR : 1;
7394 unsigned POR : 1;
7395 unsigned PD : 1;
7396 unsigned TO : 1;
7397 unsigned RI : 1;
7398 unsigned CM : 1;
7399 unsigned : 1;
7400 unsigned : 1;
7402 } __RCONbits_t;
7404 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
7406 #define _NOT_BOR 0x01
7407 #define _BOR 0x01
7408 #define _NOT_POR 0x02
7409 #define _POR 0x02
7410 #define _NOT_PD 0x04
7411 #define _PD 0x04
7412 #define _NOT_TO 0x08
7413 #define _TO 0x08
7414 #define _NOT_RI 0x10
7415 #define _RI 0x10
7416 #define _NOT_CM 0x20
7417 #define _CM 0x20
7418 #define _IPEN 0x80
7420 //==============================================================================
7423 //==============================================================================
7424 // CM2CON Bits
7426 extern __at(0x0FD1) __sfr CM2CON;
7428 typedef union
7430 struct
7432 unsigned CCH0 : 1;
7433 unsigned CCH1 : 1;
7434 unsigned CREF : 1;
7435 unsigned EVPOL0 : 1;
7436 unsigned EVPOL1 : 1;
7437 unsigned CPOL : 1;
7438 unsigned COE : 1;
7439 unsigned CON : 1;
7442 struct
7444 unsigned CCH : 2;
7445 unsigned : 6;
7448 struct
7450 unsigned : 3;
7451 unsigned EVPOL : 2;
7452 unsigned : 3;
7454 } __CM2CONbits_t;
7456 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
7458 #define _CM2CON_CCH0 0x01
7459 #define _CM2CON_CCH1 0x02
7460 #define _CM2CON_CREF 0x04
7461 #define _CM2CON_EVPOL0 0x08
7462 #define _CM2CON_EVPOL1 0x10
7463 #define _CM2CON_CPOL 0x20
7464 #define _CM2CON_COE 0x40
7465 #define _CM2CON_CON 0x80
7467 //==============================================================================
7470 //==============================================================================
7471 // CM2CON1 Bits
7473 extern __at(0x0FD1) __sfr CM2CON1;
7475 typedef union
7477 struct
7479 unsigned CCH0 : 1;
7480 unsigned CCH1 : 1;
7481 unsigned CREF : 1;
7482 unsigned EVPOL0 : 1;
7483 unsigned EVPOL1 : 1;
7484 unsigned CPOL : 1;
7485 unsigned COE : 1;
7486 unsigned CON : 1;
7489 struct
7491 unsigned CCH : 2;
7492 unsigned : 6;
7495 struct
7497 unsigned : 3;
7498 unsigned EVPOL : 2;
7499 unsigned : 3;
7501 } __CM2CON1bits_t;
7503 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
7505 #define _CM2CON1_CCH0 0x01
7506 #define _CM2CON1_CCH1 0x02
7507 #define _CM2CON1_CREF 0x04
7508 #define _CM2CON1_EVPOL0 0x08
7509 #define _CM2CON1_EVPOL1 0x10
7510 #define _CM2CON1_CPOL 0x20
7511 #define _CM2CON1_COE 0x40
7512 #define _CM2CON1_CON 0x80
7514 //==============================================================================
7517 //==============================================================================
7518 // CM1CON Bits
7520 extern __at(0x0FD2) __sfr CM1CON;
7522 typedef union
7524 struct
7526 unsigned CCH0 : 1;
7527 unsigned CCH1 : 1;
7528 unsigned CREF : 1;
7529 unsigned EVPOL0 : 1;
7530 unsigned EVPOL1 : 1;
7531 unsigned CPOL : 1;
7532 unsigned COE : 1;
7533 unsigned CON : 1;
7536 struct
7538 unsigned CCH : 2;
7539 unsigned : 6;
7542 struct
7544 unsigned : 3;
7545 unsigned EVPOL : 2;
7546 unsigned : 3;
7548 } __CM1CONbits_t;
7550 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
7552 #define _CCH0 0x01
7553 #define _CCH1 0x02
7554 #define _CREF 0x04
7555 #define _EVPOL0 0x08
7556 #define _EVPOL1 0x10
7557 #define _CPOL 0x20
7558 #define _COE 0x40
7559 #define _CON 0x80
7561 //==============================================================================
7564 //==============================================================================
7565 // CM1CON1 Bits
7567 extern __at(0x0FD2) __sfr CM1CON1;
7569 typedef union
7571 struct
7573 unsigned CCH0 : 1;
7574 unsigned CCH1 : 1;
7575 unsigned CREF : 1;
7576 unsigned EVPOL0 : 1;
7577 unsigned EVPOL1 : 1;
7578 unsigned CPOL : 1;
7579 unsigned COE : 1;
7580 unsigned CON : 1;
7583 struct
7585 unsigned CCH : 2;
7586 unsigned : 6;
7589 struct
7591 unsigned : 3;
7592 unsigned EVPOL : 2;
7593 unsigned : 3;
7595 } __CM1CON1bits_t;
7597 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
7599 #define _CM1CON1_CCH0 0x01
7600 #define _CM1CON1_CCH1 0x02
7601 #define _CM1CON1_CREF 0x04
7602 #define _CM1CON1_EVPOL0 0x08
7603 #define _CM1CON1_EVPOL1 0x10
7604 #define _CM1CON1_CPOL 0x20
7605 #define _CM1CON1_COE 0x40
7606 #define _CM1CON1_CON 0x80
7608 //==============================================================================
7611 //==============================================================================
7612 // OSCCON Bits
7614 extern __at(0x0FD3) __sfr OSCCON;
7616 typedef union
7618 struct
7620 unsigned SCS0 : 1;
7621 unsigned SCS1 : 1;
7622 unsigned FLTS : 1;
7623 unsigned OSTS : 1;
7624 unsigned IRCF0 : 1;
7625 unsigned IRCF1 : 1;
7626 unsigned IRCF2 : 1;
7627 unsigned IDLEN : 1;
7630 struct
7632 unsigned SCS : 2;
7633 unsigned : 6;
7636 struct
7638 unsigned : 4;
7639 unsigned IRCF : 3;
7640 unsigned : 1;
7642 } __OSCCONbits_t;
7644 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
7646 #define _SCS0 0x01
7647 #define _SCS1 0x02
7648 #define _FLTS 0x04
7649 #define _OSTS 0x08
7650 #define _IRCF0 0x10
7651 #define _IRCF1 0x20
7652 #define _IRCF2 0x40
7653 #define _IDLEN 0x80
7655 //==============================================================================
7658 //==============================================================================
7659 // T0CON Bits
7661 extern __at(0x0FD5) __sfr T0CON;
7663 typedef union
7665 struct
7667 unsigned T0PS0 : 1;
7668 unsigned T0PS1 : 1;
7669 unsigned T0PS2 : 1;
7670 unsigned PSA : 1;
7671 unsigned T0SE : 1;
7672 unsigned T0CS : 1;
7673 unsigned T08BIT : 1;
7674 unsigned TMR0ON : 1;
7677 struct
7679 unsigned T0PS : 3;
7680 unsigned : 5;
7682 } __T0CONbits_t;
7684 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
7686 #define _T0PS0 0x01
7687 #define _T0PS1 0x02
7688 #define _T0PS2 0x04
7689 #define _PSA 0x08
7690 #define _T0SE 0x10
7691 #define _T0CS 0x20
7692 #define _T08BIT 0x40
7693 #define _TMR0ON 0x80
7695 //==============================================================================
7697 extern __at(0x0FD6) __sfr TMR0;
7698 extern __at(0x0FD6) __sfr TMR0L;
7699 extern __at(0x0FD7) __sfr TMR0H;
7701 //==============================================================================
7702 // STATUS Bits
7704 extern __at(0x0FD8) __sfr STATUS;
7706 typedef struct
7708 unsigned C : 1;
7709 unsigned DC : 1;
7710 unsigned Z : 1;
7711 unsigned OV : 1;
7712 unsigned N : 1;
7713 unsigned : 1;
7714 unsigned : 1;
7715 unsigned : 1;
7716 } __STATUSbits_t;
7718 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
7720 #define _C 0x01
7721 #define _DC 0x02
7722 #define _Z 0x04
7723 #define _OV 0x08
7724 #define _N 0x10
7726 //==============================================================================
7728 extern __at(0x0FD9) __sfr FSR2L;
7729 extern __at(0x0FDA) __sfr FSR2H;
7730 extern __at(0x0FDB) __sfr PLUSW2;
7731 extern __at(0x0FDC) __sfr PREINC2;
7732 extern __at(0x0FDD) __sfr POSTDEC2;
7733 extern __at(0x0FDE) __sfr POSTINC2;
7734 extern __at(0x0FDF) __sfr INDF2;
7735 extern __at(0x0FE0) __sfr BSR;
7736 extern __at(0x0FE1) __sfr FSR1L;
7737 extern __at(0x0FE2) __sfr FSR1H;
7738 extern __at(0x0FE3) __sfr PLUSW1;
7739 extern __at(0x0FE4) __sfr PREINC1;
7740 extern __at(0x0FE5) __sfr POSTDEC1;
7741 extern __at(0x0FE6) __sfr POSTINC1;
7742 extern __at(0x0FE7) __sfr INDF1;
7743 extern __at(0x0FE8) __sfr WREG;
7744 extern __at(0x0FE9) __sfr FSR0L;
7745 extern __at(0x0FEA) __sfr FSR0H;
7746 extern __at(0x0FEB) __sfr PLUSW0;
7747 extern __at(0x0FEC) __sfr PREINC0;
7748 extern __at(0x0FED) __sfr POSTDEC0;
7749 extern __at(0x0FEE) __sfr POSTINC0;
7750 extern __at(0x0FEF) __sfr INDF0;
7752 //==============================================================================
7753 // INTCON3 Bits
7755 extern __at(0x0FF0) __sfr INTCON3;
7757 typedef union
7759 struct
7761 unsigned INT1IF : 1;
7762 unsigned INT2IF : 1;
7763 unsigned INT3IF : 1;
7764 unsigned INT1IE : 1;
7765 unsigned INT2IE : 1;
7766 unsigned INT3IE : 1;
7767 unsigned INT1IP : 1;
7768 unsigned INT2IP : 1;
7771 struct
7773 unsigned INT1F : 1;
7774 unsigned INT2F : 1;
7775 unsigned INT3F : 1;
7776 unsigned INT1E : 1;
7777 unsigned INT2E : 1;
7778 unsigned INT3E : 1;
7779 unsigned INT1P : 1;
7780 unsigned INT2P : 1;
7782 } __INTCON3bits_t;
7784 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
7786 #define _INT1IF 0x01
7787 #define _INT1F 0x01
7788 #define _INT2IF 0x02
7789 #define _INT2F 0x02
7790 #define _INT3IF 0x04
7791 #define _INT3F 0x04
7792 #define _INT1IE 0x08
7793 #define _INT1E 0x08
7794 #define _INT2IE 0x10
7795 #define _INT2E 0x10
7796 #define _INT3IE 0x20
7797 #define _INT3E 0x20
7798 #define _INT1IP 0x40
7799 #define _INT1P 0x40
7800 #define _INT2IP 0x80
7801 #define _INT2P 0x80
7803 //==============================================================================
7806 //==============================================================================
7807 // INTCON2 Bits
7809 extern __at(0x0FF1) __sfr INTCON2;
7811 typedef union
7813 struct
7815 unsigned RBIP : 1;
7816 unsigned INT3IP : 1;
7817 unsigned TMR0IP : 1;
7818 unsigned INTEDG3 : 1;
7819 unsigned INTEDG2 : 1;
7820 unsigned INTEDG1 : 1;
7821 unsigned INTEDG0 : 1;
7822 unsigned NOT_RBPU : 1;
7825 struct
7827 unsigned : 1;
7828 unsigned INT3P : 1;
7829 unsigned T0IP : 1;
7830 unsigned : 1;
7831 unsigned : 1;
7832 unsigned : 1;
7833 unsigned : 1;
7834 unsigned RBPU : 1;
7836 } __INTCON2bits_t;
7838 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
7840 #define _RBIP 0x01
7841 #define _INT3IP 0x02
7842 #define _INT3P 0x02
7843 #define _TMR0IP 0x04
7844 #define _T0IP 0x04
7845 #define _INTEDG3 0x08
7846 #define _INTEDG2 0x10
7847 #define _INTEDG1 0x20
7848 #define _INTEDG0 0x40
7849 #define _NOT_RBPU 0x80
7850 #define _RBPU 0x80
7852 //==============================================================================
7855 //==============================================================================
7856 // INTCON Bits
7858 extern __at(0x0FF2) __sfr INTCON;
7860 typedef union
7862 struct
7864 unsigned RBIF : 1;
7865 unsigned INT0IF : 1;
7866 unsigned TMR0IF : 1;
7867 unsigned RBIE : 1;
7868 unsigned INT0IE : 1;
7869 unsigned TMR0IE : 1;
7870 unsigned PEIE_GIEL : 1;
7871 unsigned GIE_GIEH : 1;
7874 struct
7876 unsigned : 1;
7877 unsigned INT0F : 1;
7878 unsigned T0IF : 1;
7879 unsigned : 1;
7880 unsigned INT0E : 1;
7881 unsigned T0IE : 1;
7882 unsigned PEIE : 1;
7883 unsigned GIE : 1;
7886 struct
7888 unsigned : 1;
7889 unsigned : 1;
7890 unsigned : 1;
7891 unsigned : 1;
7892 unsigned : 1;
7893 unsigned : 1;
7894 unsigned GIEL : 1;
7895 unsigned GIEH : 1;
7897 } __INTCONbits_t;
7899 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
7901 #define _RBIF 0x01
7902 #define _INT0IF 0x02
7903 #define _INT0F 0x02
7904 #define _TMR0IF 0x04
7905 #define _T0IF 0x04
7906 #define _RBIE 0x08
7907 #define _INT0IE 0x10
7908 #define _INT0E 0x10
7909 #define _TMR0IE 0x20
7910 #define _T0IE 0x20
7911 #define _PEIE_GIEL 0x40
7912 #define _PEIE 0x40
7913 #define _GIEL 0x40
7914 #define _GIE_GIEH 0x80
7915 #define _GIE 0x80
7916 #define _GIEH 0x80
7918 //==============================================================================
7920 extern __at(0x0FF3) __sfr PROD;
7921 extern __at(0x0FF3) __sfr PRODL;
7922 extern __at(0x0FF4) __sfr PRODH;
7923 extern __at(0x0FF5) __sfr TABLAT;
7924 extern __at(0x0FF6) __sfr TBLPTR;
7925 extern __at(0x0FF6) __sfr TBLPTRL;
7926 extern __at(0x0FF7) __sfr TBLPTRH;
7927 extern __at(0x0FF8) __sfr TBLPTRU;
7928 extern __at(0x0FF9) __sfr PC;
7929 extern __at(0x0FF9) __sfr PCL;
7930 extern __at(0x0FFA) __sfr PCLATH;
7931 extern __at(0x0FFB) __sfr PCLATU;
7933 //==============================================================================
7934 // STKPTR Bits
7936 extern __at(0x0FFC) __sfr STKPTR;
7938 typedef union
7940 struct
7942 unsigned SP0 : 1;
7943 unsigned SP1 : 1;
7944 unsigned SP2 : 1;
7945 unsigned SP3 : 1;
7946 unsigned SP4 : 1;
7947 unsigned : 1;
7948 unsigned STKUNF : 1;
7949 unsigned STKFUL : 1;
7952 struct
7954 unsigned : 1;
7955 unsigned : 1;
7956 unsigned : 1;
7957 unsigned : 1;
7958 unsigned : 1;
7959 unsigned : 1;
7960 unsigned : 1;
7961 unsigned STKOVF : 1;
7964 struct
7966 unsigned SP : 5;
7967 unsigned : 3;
7969 } __STKPTRbits_t;
7971 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
7973 #define _SP0 0x01
7974 #define _SP1 0x02
7975 #define _SP2 0x04
7976 #define _SP3 0x08
7977 #define _SP4 0x10
7978 #define _STKUNF 0x40
7979 #define _STKFUL 0x80
7980 #define _STKOVF 0x80
7982 //==============================================================================
7984 extern __at(0x0FFD) __sfr TOS;
7985 extern __at(0x0FFD) __sfr TOSL;
7986 extern __at(0x0FFE) __sfr TOSH;
7987 extern __at(0x0FFF) __sfr TOSU;
7989 //==============================================================================
7991 // Configuration Addresses
7993 //==============================================================================
7995 #define __CONFIG1L 0x00FFF8
7996 #define __CONFIG1H 0x00FFF9
7997 #define __CONFIG2L 0x00FFFA
7998 #define __CONFIG2H 0x00FFFB
7999 #define __CONFIG3L 0x00FFFC
8000 #define __CONFIG3H 0x00FFFD
8001 #define __CONFIG4L 0x00FFFE
8002 #define __CONFIG4H 0x00FFFF
8004 //==============================================================================
8006 #endif // #ifndef __PIC18LF46J53_H__