Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f46j13.h
bloba099391a9037f70324cd1dc87379b7c39ac1db03
1 /*
2 * This declarations of the PIC18F46J13 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:30 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 __PIC18F46J13_H__
26 #define __PIC18F46J13_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(0x0ECE) __sfr RPOR14;
545 extern __at(0x0ECF) __sfr RPOR15;
546 extern __at(0x0ED0) __sfr RPOR16;
547 extern __at(0x0ED1) __sfr RPOR17;
548 extern __at(0x0ED2) __sfr RPOR18;
549 extern __at(0x0ED3) __sfr RPOR19;
550 extern __at(0x0ED4) __sfr RPOR20;
551 extern __at(0x0ED5) __sfr RPOR21;
552 extern __at(0x0ED6) __sfr RPOR22;
553 extern __at(0x0ED7) __sfr RPOR23;
554 extern __at(0x0ED8) __sfr RPOR24;
555 extern __at(0x0EE1) __sfr RPINR1;
556 extern __at(0x0EE2) __sfr RPINR2;
557 extern __at(0x0EE3) __sfr RPINR3;
558 extern __at(0x0EE4) __sfr RPINR4;
559 extern __at(0x0EE6) __sfr RPINR6;
560 extern __at(0x0EE7) __sfr RPINR15;
561 extern __at(0x0EE8) __sfr RPINR7;
562 extern __at(0x0EE9) __sfr RPINR8;
563 extern __at(0x0EEA) __sfr RPINR9;
564 extern __at(0x0EF2) __sfr RPINR12;
565 extern __at(0x0EF3) __sfr RPINR13;
566 extern __at(0x0EF4) __sfr RPINR14;
567 extern __at(0x0EF7) __sfr RPINR16;
568 extern __at(0x0EF8) __sfr RPINR17;
569 extern __at(0x0EFC) __sfr RPINR21;
570 extern __at(0x0EFD) __sfr RPINR22;
571 extern __at(0x0EFE) __sfr RPINR23;
572 extern __at(0x0EFF) __sfr RPINR24;
574 //==============================================================================
575 // CCP10CON Bits
577 extern __at(0x0F00) __sfr CCP10CON;
579 typedef union
581 struct
583 unsigned CCP10M0 : 1;
584 unsigned CCP10M1 : 1;
585 unsigned CCP10M2 : 1;
586 unsigned CCP10M3 : 1;
587 unsigned DC10B0 : 1;
588 unsigned DC10B1 : 1;
589 unsigned : 1;
590 unsigned : 1;
593 struct
595 unsigned CCP10M : 4;
596 unsigned : 4;
599 struct
601 unsigned : 4;
602 unsigned DC10B : 2;
603 unsigned : 2;
605 } __CCP10CONbits_t;
607 extern __at(0x0F00) volatile __CCP10CONbits_t CCP10CONbits;
609 #define _CCP10M0 0x01
610 #define _CCP10M1 0x02
611 #define _CCP10M2 0x04
612 #define _CCP10M3 0x08
613 #define _DC10B0 0x10
614 #define _DC10B1 0x20
616 //==============================================================================
618 extern __at(0x0F01) __sfr CCPR10L;
619 extern __at(0x0F02) __sfr CCPR10H;
621 //==============================================================================
622 // CCP9CON Bits
624 extern __at(0x0F03) __sfr CCP9CON;
626 typedef union
628 struct
630 unsigned CCP9M0 : 1;
631 unsigned CCP9M1 : 1;
632 unsigned CCP9M2 : 1;
633 unsigned CCP9M3 : 1;
634 unsigned DC9B0 : 1;
635 unsigned DC9B1 : 1;
636 unsigned : 1;
637 unsigned : 1;
640 struct
642 unsigned CCP9M : 4;
643 unsigned : 4;
646 struct
648 unsigned : 4;
649 unsigned DC9B : 2;
650 unsigned : 2;
652 } __CCP9CONbits_t;
654 extern __at(0x0F03) volatile __CCP9CONbits_t CCP9CONbits;
656 #define _CCP9M0 0x01
657 #define _CCP9M1 0x02
658 #define _CCP9M2 0x04
659 #define _CCP9M3 0x08
660 #define _DC9B0 0x10
661 #define _DC9B1 0x20
663 //==============================================================================
665 extern __at(0x0F04) __sfr CCPR9L;
666 extern __at(0x0F05) __sfr CCPR9H;
668 //==============================================================================
669 // CCP8CON Bits
671 extern __at(0x0F06) __sfr CCP8CON;
673 typedef union
675 struct
677 unsigned CCP8M0 : 1;
678 unsigned CCP8M1 : 1;
679 unsigned CCP8M2 : 1;
680 unsigned CCP8M3 : 1;
681 unsigned DC8B0 : 1;
682 unsigned DC8B1 : 1;
683 unsigned : 1;
684 unsigned : 1;
687 struct
689 unsigned CCP8M : 4;
690 unsigned : 4;
693 struct
695 unsigned : 4;
696 unsigned DC8B : 2;
697 unsigned : 2;
699 } __CCP8CONbits_t;
701 extern __at(0x0F06) volatile __CCP8CONbits_t CCP8CONbits;
703 #define _CCP8M0 0x01
704 #define _CCP8M1 0x02
705 #define _CCP8M2 0x04
706 #define _CCP8M3 0x08
707 #define _DC8B0 0x10
708 #define _DC8B1 0x20
710 //==============================================================================
712 extern __at(0x0F07) __sfr CCPR8L;
713 extern __at(0x0F08) __sfr CCPR8H;
715 //==============================================================================
716 // CCP7CON Bits
718 extern __at(0x0F09) __sfr CCP7CON;
720 typedef union
722 struct
724 unsigned CCP7M0 : 1;
725 unsigned CCP7M1 : 1;
726 unsigned CCP7M2 : 1;
727 unsigned CCP7M3 : 1;
728 unsigned DC7B0 : 1;
729 unsigned DC7B1 : 1;
730 unsigned : 1;
731 unsigned : 1;
734 struct
736 unsigned CCP7M : 4;
737 unsigned : 4;
740 struct
742 unsigned : 4;
743 unsigned DC7B : 2;
744 unsigned : 2;
746 } __CCP7CONbits_t;
748 extern __at(0x0F09) volatile __CCP7CONbits_t CCP7CONbits;
750 #define _CCP7M0 0x01
751 #define _CCP7M1 0x02
752 #define _CCP7M2 0x04
753 #define _CCP7M3 0x08
754 #define _DC7B0 0x10
755 #define _DC7B1 0x20
757 //==============================================================================
759 extern __at(0x0F0A) __sfr CCPR7L;
760 extern __at(0x0F0B) __sfr CCPR7H;
762 //==============================================================================
763 // CCP6CON Bits
765 extern __at(0x0F0C) __sfr CCP6CON;
767 typedef union
769 struct
771 unsigned CCP6M0 : 1;
772 unsigned CCP6M1 : 1;
773 unsigned CCP6M2 : 1;
774 unsigned CCP6M3 : 1;
775 unsigned DC6B0 : 1;
776 unsigned DC6B1 : 1;
777 unsigned : 1;
778 unsigned : 1;
781 struct
783 unsigned CCP6M : 4;
784 unsigned : 4;
787 struct
789 unsigned : 4;
790 unsigned DC6B : 2;
791 unsigned : 2;
793 } __CCP6CONbits_t;
795 extern __at(0x0F0C) volatile __CCP6CONbits_t CCP6CONbits;
797 #define _CCP6M0 0x01
798 #define _CCP6M1 0x02
799 #define _CCP6M2 0x04
800 #define _CCP6M3 0x08
801 #define _DC6B0 0x10
802 #define _DC6B1 0x20
804 //==============================================================================
806 extern __at(0x0F0D) __sfr CCPR6L;
807 extern __at(0x0F0E) __sfr CCPR6H;
809 //==============================================================================
810 // CCP5CON Bits
812 extern __at(0x0F0F) __sfr CCP5CON;
814 typedef union
816 struct
818 unsigned CCP5M0 : 1;
819 unsigned CCP5M1 : 1;
820 unsigned CCP5M2 : 1;
821 unsigned CCP5M3 : 1;
822 unsigned DC5B0 : 1;
823 unsigned DC5B1 : 1;
824 unsigned : 1;
825 unsigned : 1;
828 struct
830 unsigned CCP5M : 4;
831 unsigned : 4;
834 struct
836 unsigned : 4;
837 unsigned DC5B : 2;
838 unsigned : 2;
840 } __CCP5CONbits_t;
842 extern __at(0x0F0F) volatile __CCP5CONbits_t CCP5CONbits;
844 #define _CCP5M0 0x01
845 #define _CCP5M1 0x02
846 #define _CCP5M2 0x04
847 #define _CCP5M3 0x08
848 #define _DC5B0 0x10
849 #define _DC5B1 0x20
851 //==============================================================================
853 extern __at(0x0F10) __sfr CCPR5L;
854 extern __at(0x0F11) __sfr CCPR5H;
856 //==============================================================================
857 // CCP4CON Bits
859 extern __at(0x0F12) __sfr CCP4CON;
861 typedef union
863 struct
865 unsigned CCP4M0 : 1;
866 unsigned CCP4M1 : 1;
867 unsigned CCP4M2 : 1;
868 unsigned CCP4M3 : 1;
869 unsigned DC4B0 : 1;
870 unsigned DC4B1 : 1;
871 unsigned : 1;
872 unsigned : 1;
875 struct
877 unsigned CCP4M : 4;
878 unsigned : 4;
881 struct
883 unsigned : 4;
884 unsigned DC4B : 2;
885 unsigned : 2;
887 } __CCP4CONbits_t;
889 extern __at(0x0F12) volatile __CCP4CONbits_t CCP4CONbits;
891 #define _CCP4M0 0x01
892 #define _CCP4M1 0x02
893 #define _CCP4M2 0x04
894 #define _CCP4M3 0x08
895 #define _DC4B0 0x10
896 #define _DC4B1 0x20
898 //==============================================================================
900 extern __at(0x0F13) __sfr CCPR4L;
901 extern __at(0x0F14) __sfr CCPR4H;
903 //==============================================================================
904 // CCP3CON Bits
906 extern __at(0x0F15) __sfr CCP3CON;
908 typedef union
910 struct
912 unsigned CCP3M0 : 1;
913 unsigned CCP3M1 : 1;
914 unsigned CCP3M2 : 1;
915 unsigned CCP3M3 : 1;
916 unsigned DC3B0 : 1;
917 unsigned DC3B1 : 1;
918 unsigned P3M0 : 1;
919 unsigned P3M1 : 1;
922 struct
924 unsigned CCP3M : 4;
925 unsigned : 4;
928 struct
930 unsigned : 4;
931 unsigned DC3B : 2;
932 unsigned : 2;
935 struct
937 unsigned : 6;
938 unsigned P3M : 2;
940 } __CCP3CONbits_t;
942 extern __at(0x0F15) volatile __CCP3CONbits_t CCP3CONbits;
944 #define _CCP3M0 0x01
945 #define _CCP3M1 0x02
946 #define _CCP3M2 0x04
947 #define _CCP3M3 0x08
948 #define _DC3B0 0x10
949 #define _DC3B1 0x20
950 #define _P3M0 0x40
951 #define _P3M1 0x80
953 //==============================================================================
955 extern __at(0x0F16) __sfr CCPR3L;
956 extern __at(0x0F17) __sfr CCPR3H;
958 //==============================================================================
959 // ECCP3DEL Bits
961 extern __at(0x0F18) __sfr ECCP3DEL;
963 typedef union
965 struct
967 unsigned P3DC0 : 1;
968 unsigned P3DC1 : 1;
969 unsigned P3DC2 : 1;
970 unsigned P3DC3 : 1;
971 unsigned P3DC4 : 1;
972 unsigned P3DC5 : 1;
973 unsigned P3DC6 : 1;
974 unsigned P3RSEN : 1;
977 struct
979 unsigned P3DC : 7;
980 unsigned : 1;
982 } __ECCP3DELbits_t;
984 extern __at(0x0F18) volatile __ECCP3DELbits_t ECCP3DELbits;
986 #define _P3DC0 0x01
987 #define _P3DC1 0x02
988 #define _P3DC2 0x04
989 #define _P3DC3 0x08
990 #define _P3DC4 0x10
991 #define _P3DC5 0x20
992 #define _P3DC6 0x40
993 #define _P3RSEN 0x80
995 //==============================================================================
998 //==============================================================================
999 // ECCP3AS Bits
1001 extern __at(0x0F19) __sfr ECCP3AS;
1003 typedef union
1005 struct
1007 unsigned PSS3BD0 : 1;
1008 unsigned PSS3BD1 : 1;
1009 unsigned PSS3AC0 : 1;
1010 unsigned PSS3AC1 : 1;
1011 unsigned ECCP3AS0 : 1;
1012 unsigned ECCP3AS1 : 1;
1013 unsigned ECCP3AS2 : 1;
1014 unsigned ECCP3ASE : 1;
1017 struct
1019 unsigned PSS3BD : 2;
1020 unsigned : 6;
1023 struct
1025 unsigned : 2;
1026 unsigned PSS3AC : 2;
1027 unsigned : 4;
1030 struct
1032 unsigned : 4;
1033 unsigned ECCP3AS : 3;
1034 unsigned : 1;
1036 } __ECCP3ASbits_t;
1038 extern __at(0x0F19) volatile __ECCP3ASbits_t ECCP3ASbits;
1040 #define _PSS3BD0 0x01
1041 #define _PSS3BD1 0x02
1042 #define _PSS3AC0 0x04
1043 #define _PSS3AC1 0x08
1044 #define _ECCP3AS0 0x10
1045 #define _ECCP3AS1 0x20
1046 #define _ECCP3AS2 0x40
1047 #define _ECCP3ASE 0x80
1049 //==============================================================================
1052 //==============================================================================
1053 // PSTR3CON Bits
1055 extern __at(0x0F1A) __sfr PSTR3CON;
1057 typedef union
1059 struct
1061 unsigned STRA : 1;
1062 unsigned STRB : 1;
1063 unsigned STRC : 1;
1064 unsigned STRD : 1;
1065 unsigned STRSYNC : 1;
1066 unsigned : 1;
1067 unsigned CMPL0 : 1;
1068 unsigned CMPL1 : 1;
1071 struct
1073 unsigned : 6;
1074 unsigned CMPL : 2;
1076 } __PSTR3CONbits_t;
1078 extern __at(0x0F1A) volatile __PSTR3CONbits_t PSTR3CONbits;
1080 #define _PSTR3CON_STRA 0x01
1081 #define _PSTR3CON_STRB 0x02
1082 #define _PSTR3CON_STRC 0x04
1083 #define _PSTR3CON_STRD 0x08
1084 #define _PSTR3CON_STRSYNC 0x10
1085 #define _PSTR3CON_CMPL0 0x40
1086 #define _PSTR3CON_CMPL1 0x80
1088 //==============================================================================
1091 //==============================================================================
1092 // T8CON Bits
1094 extern __at(0x0F1B) __sfr T8CON;
1096 typedef union
1098 struct
1100 unsigned T8CKPS0 : 1;
1101 unsigned T8CKPS1 : 1;
1102 unsigned TMR8ON : 1;
1103 unsigned T8OUTPS0 : 1;
1104 unsigned T8OUTPS1 : 1;
1105 unsigned T8OUTPS2 : 1;
1106 unsigned T8OUTPS3 : 1;
1107 unsigned : 1;
1110 struct
1112 unsigned T8CKPS : 2;
1113 unsigned : 6;
1116 struct
1118 unsigned : 3;
1119 unsigned T8OUTPS : 4;
1120 unsigned : 1;
1122 } __T8CONbits_t;
1124 extern __at(0x0F1B) volatile __T8CONbits_t T8CONbits;
1126 #define _T8CKPS0 0x01
1127 #define _T8CKPS1 0x02
1128 #define _TMR8ON 0x04
1129 #define _T8OUTPS0 0x08
1130 #define _T8OUTPS1 0x10
1131 #define _T8OUTPS2 0x20
1132 #define _T8OUTPS3 0x40
1134 //==============================================================================
1136 extern __at(0x0F1C) __sfr PR8;
1137 extern __at(0x0F1D) __sfr TMR8;
1139 //==============================================================================
1140 // T6CON Bits
1142 extern __at(0x0F1E) __sfr T6CON;
1144 typedef union
1146 struct
1148 unsigned T6CKPS0 : 1;
1149 unsigned T6CKPS1 : 1;
1150 unsigned TMR6ON : 1;
1151 unsigned T6OUTPS0 : 1;
1152 unsigned T6OUTPS1 : 1;
1153 unsigned T6OUTPS2 : 1;
1154 unsigned T6OUTPS3 : 1;
1155 unsigned : 1;
1158 struct
1160 unsigned T6CKPS : 2;
1161 unsigned : 6;
1164 struct
1166 unsigned : 3;
1167 unsigned T6OUTPS : 4;
1168 unsigned : 1;
1170 } __T6CONbits_t;
1172 extern __at(0x0F1E) volatile __T6CONbits_t T6CONbits;
1174 #define _T6CKPS0 0x01
1175 #define _T6CKPS1 0x02
1176 #define _TMR6ON 0x04
1177 #define _T6OUTPS0 0x08
1178 #define _T6OUTPS1 0x10
1179 #define _T6OUTPS2 0x20
1180 #define _T6OUTPS3 0x40
1182 //==============================================================================
1184 extern __at(0x0F1F) __sfr PR6;
1185 extern __at(0x0F20) __sfr TMR6;
1187 //==============================================================================
1188 // T5GCON Bits
1190 extern __at(0x0F21) __sfr T5GCON;
1192 typedef union
1194 struct
1196 unsigned T5GSS0 : 1;
1197 unsigned T5GSS1 : 1;
1198 unsigned T5GVAL : 1;
1199 unsigned T5GGO_NOT_T5DONE : 1;
1200 unsigned T5GSPM : 1;
1201 unsigned T5GTM : 1;
1202 unsigned T5GPOL : 1;
1203 unsigned TMR5GE : 1;
1206 struct
1208 unsigned : 1;
1209 unsigned : 1;
1210 unsigned : 1;
1211 unsigned T5GGO : 1;
1212 unsigned : 1;
1213 unsigned : 1;
1214 unsigned : 1;
1215 unsigned : 1;
1218 struct
1220 unsigned : 1;
1221 unsigned : 1;
1222 unsigned : 1;
1223 unsigned NOT_T5DONE : 1;
1224 unsigned : 1;
1225 unsigned : 1;
1226 unsigned : 1;
1227 unsigned : 1;
1230 struct
1232 unsigned : 1;
1233 unsigned : 1;
1234 unsigned : 1;
1235 unsigned T5DONE : 1;
1236 unsigned : 1;
1237 unsigned : 1;
1238 unsigned : 1;
1239 unsigned : 1;
1242 struct
1244 unsigned T5GSS : 2;
1245 unsigned : 6;
1247 } __T5GCONbits_t;
1249 extern __at(0x0F21) volatile __T5GCONbits_t T5GCONbits;
1251 #define _T5GSS0 0x01
1252 #define _T5GSS1 0x02
1253 #define _T5GVAL 0x04
1254 #define _T5GGO_NOT_T5DONE 0x08
1255 #define _T5GGO 0x08
1256 #define _NOT_T5DONE 0x08
1257 #define _T5DONE 0x08
1258 #define _T5GSPM 0x10
1259 #define _T5GTM 0x20
1260 #define _T5GPOL 0x40
1261 #define _TMR5GE 0x80
1263 //==============================================================================
1266 //==============================================================================
1267 // T5CON Bits
1269 extern __at(0x0F22) __sfr T5CON;
1271 typedef union
1273 struct
1275 unsigned TMR5ON : 1;
1276 unsigned RD16 : 1;
1277 unsigned NOT_T5SYNC : 1;
1278 unsigned T5OSCEN : 1;
1279 unsigned T5CKPS0 : 1;
1280 unsigned T5CKPS1 : 1;
1281 unsigned TMR5CS0 : 1;
1282 unsigned TMR5CS1 : 1;
1285 struct
1287 unsigned : 4;
1288 unsigned T5CKPS : 2;
1289 unsigned : 2;
1292 struct
1294 unsigned : 6;
1295 unsigned TMR5CS : 2;
1297 } __T5CONbits_t;
1299 extern __at(0x0F22) volatile __T5CONbits_t T5CONbits;
1301 #define _T5CON_TMR5ON 0x01
1302 #define _T5CON_RD16 0x02
1303 #define _T5CON_NOT_T5SYNC 0x04
1304 #define _T5CON_T5OSCEN 0x08
1305 #define _T5CON_T5CKPS0 0x10
1306 #define _T5CON_T5CKPS1 0x20
1307 #define _T5CON_TMR5CS0 0x40
1308 #define _T5CON_TMR5CS1 0x80
1310 //==============================================================================
1312 extern __at(0x0F23) __sfr TMR5L;
1313 extern __at(0x0F24) __sfr TMR5H;
1315 //==============================================================================
1316 // CM3CON Bits
1318 extern __at(0x0F25) __sfr CM3CON;
1320 typedef union
1322 struct
1324 unsigned CCH0 : 1;
1325 unsigned CCH1 : 1;
1326 unsigned CREF : 1;
1327 unsigned EVPOL0 : 1;
1328 unsigned EVPOL1 : 1;
1329 unsigned CPOL : 1;
1330 unsigned COE : 1;
1331 unsigned CON : 1;
1334 struct
1336 unsigned CCH : 2;
1337 unsigned : 6;
1340 struct
1342 unsigned : 3;
1343 unsigned EVPOL : 2;
1344 unsigned : 3;
1346 } __CM3CONbits_t;
1348 extern __at(0x0F25) volatile __CM3CONbits_t CM3CONbits;
1350 #define _CM3CON_CCH0 0x01
1351 #define _CM3CON_CCH1 0x02
1352 #define _CM3CON_CREF 0x04
1353 #define _CM3CON_EVPOL0 0x08
1354 #define _CM3CON_EVPOL1 0x10
1355 #define _CM3CON_CPOL 0x20
1356 #define _CM3CON_COE 0x40
1357 #define _CM3CON_CON 0x80
1359 //==============================================================================
1361 extern __at(0x0F3A) __sfr RTCVALL;
1362 extern __at(0x0F3B) __sfr RTCVALH;
1364 //==============================================================================
1365 // PADCFG1 Bits
1367 extern __at(0x0F3C) __sfr PADCFG1;
1369 typedef union
1371 struct
1373 unsigned PMPTTL : 1;
1374 unsigned RTSECSEL0 : 1;
1375 unsigned RTSECSEL1 : 1;
1376 unsigned : 1;
1377 unsigned : 1;
1378 unsigned : 1;
1379 unsigned : 1;
1380 unsigned : 1;
1383 struct
1385 unsigned : 1;
1386 unsigned RTSECSEL : 2;
1387 unsigned : 5;
1389 } __PADCFG1bits_t;
1391 extern __at(0x0F3C) volatile __PADCFG1bits_t PADCFG1bits;
1393 #define _PMPTTL 0x01
1394 #define _RTSECSEL0 0x02
1395 #define _RTSECSEL1 0x04
1397 //==============================================================================
1400 //==============================================================================
1401 // REFOCON Bits
1403 extern __at(0x0F3D) __sfr REFOCON;
1405 typedef union
1407 struct
1409 unsigned RODIV0 : 1;
1410 unsigned RODIV1 : 1;
1411 unsigned RODIV2 : 1;
1412 unsigned RODIV3 : 1;
1413 unsigned ROSEL : 1;
1414 unsigned ROSSLP : 1;
1415 unsigned : 1;
1416 unsigned ROON : 1;
1419 struct
1421 unsigned RODIV : 4;
1422 unsigned : 4;
1424 } __REFOCONbits_t;
1426 extern __at(0x0F3D) volatile __REFOCONbits_t REFOCONbits;
1428 #define _RODIV0 0x01
1429 #define _RODIV1 0x02
1430 #define _RODIV2 0x04
1431 #define _RODIV3 0x08
1432 #define _ROSEL 0x10
1433 #define _ROSSLP 0x20
1434 #define _ROON 0x80
1436 //==============================================================================
1439 //==============================================================================
1440 // RTCCAL Bits
1442 extern __at(0x0F3E) __sfr RTCCAL;
1444 typedef struct
1446 unsigned CAL0 : 1;
1447 unsigned CAL1 : 1;
1448 unsigned CAL2 : 1;
1449 unsigned CAL3 : 1;
1450 unsigned CAL4 : 1;
1451 unsigned CAL5 : 1;
1452 unsigned CAL6 : 1;
1453 unsigned CAL7 : 1;
1454 } __RTCCALbits_t;
1456 extern __at(0x0F3E) volatile __RTCCALbits_t RTCCALbits;
1458 #define _CAL0 0x01
1459 #define _CAL1 0x02
1460 #define _CAL2 0x04
1461 #define _CAL3 0x08
1462 #define _CAL4 0x10
1463 #define _CAL5 0x20
1464 #define _CAL6 0x40
1465 #define _CAL7 0x80
1467 //==============================================================================
1470 //==============================================================================
1471 // RTCCFG Bits
1473 extern __at(0x0F3F) __sfr RTCCFG;
1475 typedef union
1477 struct
1479 unsigned RTCPTR0 : 1;
1480 unsigned RTCPTR1 : 1;
1481 unsigned RTCOE : 1;
1482 unsigned HALFSEC : 1;
1483 unsigned RTCSYNC : 1;
1484 unsigned RTCWREN : 1;
1485 unsigned : 1;
1486 unsigned RTCEN : 1;
1489 struct
1491 unsigned RTCPTR : 2;
1492 unsigned : 6;
1494 } __RTCCFGbits_t;
1496 extern __at(0x0F3F) volatile __RTCCFGbits_t RTCCFGbits;
1498 #define _RTCPTR0 0x01
1499 #define _RTCPTR1 0x02
1500 #define _RTCOE 0x04
1501 #define _HALFSEC 0x08
1502 #define _RTCSYNC 0x10
1503 #define _RTCWREN 0x20
1504 #define _RTCEN 0x80
1506 //==============================================================================
1509 //==============================================================================
1510 // ODCON3 Bits
1512 extern __at(0x0F40) __sfr ODCON3;
1514 typedef struct
1516 unsigned SPI1OD : 1;
1517 unsigned SPI2OD : 1;
1518 unsigned : 1;
1519 unsigned : 1;
1520 unsigned : 1;
1521 unsigned : 1;
1522 unsigned : 1;
1523 unsigned CTMUDS : 1;
1524 } __ODCON3bits_t;
1526 extern __at(0x0F40) volatile __ODCON3bits_t ODCON3bits;
1528 #define _SPI1OD 0x01
1529 #define _SPI2OD 0x02
1530 #define _CTMUDS 0x80
1532 //==============================================================================
1535 //==============================================================================
1536 // ODCON2 Bits
1538 extern __at(0x0F41) __sfr ODCON2;
1540 typedef struct
1542 unsigned U1OD : 1;
1543 unsigned U2OD : 1;
1544 unsigned CCP9OD : 1;
1545 unsigned CCP10OD : 1;
1546 unsigned : 1;
1547 unsigned : 1;
1548 unsigned : 1;
1549 unsigned : 1;
1550 } __ODCON2bits_t;
1552 extern __at(0x0F41) volatile __ODCON2bits_t ODCON2bits;
1554 #define _U1OD 0x01
1555 #define _U2OD 0x02
1556 #define _CCP9OD 0x04
1557 #define _CCP10OD 0x08
1559 //==============================================================================
1562 //==============================================================================
1563 // ODCON1 Bits
1565 extern __at(0x0F42) __sfr ODCON1;
1567 typedef struct
1569 unsigned ECCP1OD : 1;
1570 unsigned ECCP2OD : 1;
1571 unsigned ECCP3OD : 1;
1572 unsigned CCP4OD : 1;
1573 unsigned CCP5OD : 1;
1574 unsigned CCP6OD : 1;
1575 unsigned CCP7OD : 1;
1576 unsigned CCP8OD : 1;
1577 } __ODCON1bits_t;
1579 extern __at(0x0F42) volatile __ODCON1bits_t ODCON1bits;
1581 #define _ECCP1OD 0x01
1582 #define _ECCP2OD 0x02
1583 #define _ECCP3OD 0x04
1584 #define _CCP4OD 0x08
1585 #define _CCP5OD 0x10
1586 #define _CCP6OD 0x20
1587 #define _CCP7OD 0x40
1588 #define _CCP8OD 0x80
1590 //==============================================================================
1592 extern __at(0x0F44) __sfr ALRMVALL;
1593 extern __at(0x0F45) __sfr ALRMVALH;
1595 //==============================================================================
1596 // ALRMRPT Bits
1598 extern __at(0x0F46) __sfr ALRMRPT;
1600 typedef struct
1602 unsigned ARPT0 : 1;
1603 unsigned ARPT1 : 1;
1604 unsigned ARPT2 : 1;
1605 unsigned ARPT3 : 1;
1606 unsigned ARPT4 : 1;
1607 unsigned ARPT5 : 1;
1608 unsigned ARPT6 : 1;
1609 unsigned ARPT7 : 1;
1610 } __ALRMRPTbits_t;
1612 extern __at(0x0F46) volatile __ALRMRPTbits_t ALRMRPTbits;
1614 #define _ARPT0 0x01
1615 #define _ARPT1 0x02
1616 #define _ARPT2 0x04
1617 #define _ARPT3 0x08
1618 #define _ARPT4 0x10
1619 #define _ARPT5 0x20
1620 #define _ARPT6 0x40
1621 #define _ARPT7 0x80
1623 //==============================================================================
1626 //==============================================================================
1627 // ALRMCFG Bits
1629 extern __at(0x0F47) __sfr ALRMCFG;
1631 typedef union
1633 struct
1635 unsigned ALRMPTR0 : 1;
1636 unsigned ALRMPTR1 : 1;
1637 unsigned AMASK0 : 1;
1638 unsigned AMASK1 : 1;
1639 unsigned AMASK2 : 1;
1640 unsigned AMASK3 : 1;
1641 unsigned CHIME : 1;
1642 unsigned ALRMEN : 1;
1645 struct
1647 unsigned ALRMPTR : 2;
1648 unsigned : 6;
1651 struct
1653 unsigned : 2;
1654 unsigned AMASK : 4;
1655 unsigned : 2;
1657 } __ALRMCFGbits_t;
1659 extern __at(0x0F47) volatile __ALRMCFGbits_t ALRMCFGbits;
1661 #define _ALRMPTR0 0x01
1662 #define _ALRMPTR1 0x02
1663 #define _AMASK0 0x04
1664 #define _AMASK1 0x08
1665 #define _AMASK2 0x10
1666 #define _AMASK3 0x20
1667 #define _CHIME 0x40
1668 #define _ALRMEN 0x80
1670 //==============================================================================
1673 //==============================================================================
1674 // ANCON0 Bits
1676 extern __at(0x0F48) __sfr ANCON0;
1678 typedef struct
1680 unsigned PCFG0 : 1;
1681 unsigned PCFG1 : 1;
1682 unsigned PCFG2 : 1;
1683 unsigned PCFG3 : 1;
1684 unsigned PCFG4 : 1;
1685 unsigned PCFG5 : 1;
1686 unsigned PCFG6 : 1;
1687 unsigned PCFG7 : 1;
1688 } __ANCON0bits_t;
1690 extern __at(0x0F48) volatile __ANCON0bits_t ANCON0bits;
1692 #define _PCFG0 0x01
1693 #define _PCFG1 0x02
1694 #define _PCFG2 0x04
1695 #define _PCFG3 0x08
1696 #define _PCFG4 0x10
1697 #define _PCFG5 0x20
1698 #define _PCFG6 0x40
1699 #define _PCFG7 0x80
1701 //==============================================================================
1704 //==============================================================================
1705 // ANCON1 Bits
1707 extern __at(0x0F49) __sfr ANCON1;
1709 typedef struct
1711 unsigned PCFG8 : 1;
1712 unsigned PCFG9 : 1;
1713 unsigned PCFG10 : 1;
1714 unsigned PCFG11 : 1;
1715 unsigned PCFG12 : 1;
1716 unsigned : 1;
1717 unsigned : 1;
1718 unsigned VBGEN : 1;
1719 } __ANCON1bits_t;
1721 extern __at(0x0F49) volatile __ANCON1bits_t ANCON1bits;
1723 #define _PCFG8 0x01
1724 #define _PCFG9 0x02
1725 #define _PCFG10 0x04
1726 #define _PCFG11 0x08
1727 #define _PCFG12 0x10
1728 #define _VBGEN 0x80
1730 //==============================================================================
1733 //==============================================================================
1734 // DSWAKEL Bits
1736 extern __at(0x0F4A) __sfr DSWAKEL;
1738 typedef struct
1740 unsigned DSPOR : 1;
1741 unsigned : 1;
1742 unsigned DSMCLR : 1;
1743 unsigned DSRTC : 1;
1744 unsigned DSWDT : 1;
1745 unsigned DSULP : 1;
1746 unsigned : 1;
1747 unsigned DSFLT : 1;
1748 } __DSWAKELbits_t;
1750 extern __at(0x0F4A) volatile __DSWAKELbits_t DSWAKELbits;
1752 #define _DSPOR 0x01
1753 #define _DSMCLR 0x04
1754 #define _DSRTC 0x08
1755 #define _DSWDT 0x10
1756 #define _DSULP 0x20
1757 #define _DSFLT 0x80
1759 //==============================================================================
1762 //==============================================================================
1763 // DSWAKEH Bits
1765 extern __at(0x0F4B) __sfr DSWAKEH;
1767 typedef struct
1769 unsigned DSINT0 : 1;
1770 unsigned : 1;
1771 unsigned : 1;
1772 unsigned : 1;
1773 unsigned : 1;
1774 unsigned : 1;
1775 unsigned : 1;
1776 unsigned : 1;
1777 } __DSWAKEHbits_t;
1779 extern __at(0x0F4B) volatile __DSWAKEHbits_t DSWAKEHbits;
1781 #define _DSINT0 0x01
1783 //==============================================================================
1786 //==============================================================================
1787 // DSCONL Bits
1789 extern __at(0x0F4C) __sfr DSCONL;
1791 typedef struct
1793 unsigned RELEASE : 1;
1794 unsigned DSBOR : 1;
1795 unsigned ULPWDIS : 1;
1796 unsigned : 1;
1797 unsigned : 1;
1798 unsigned : 1;
1799 unsigned : 1;
1800 unsigned : 1;
1801 } __DSCONLbits_t;
1803 extern __at(0x0F4C) volatile __DSCONLbits_t DSCONLbits;
1805 #define _RELEASE 0x01
1806 #define _DSBOR 0x02
1807 #define _ULPWDIS 0x04
1809 //==============================================================================
1812 //==============================================================================
1813 // DSCONH Bits
1815 extern __at(0x0F4D) __sfr DSCONH;
1817 typedef struct
1819 unsigned RTCWDIS : 1;
1820 unsigned DSULPEN : 1;
1821 unsigned : 1;
1822 unsigned : 1;
1823 unsigned : 1;
1824 unsigned : 1;
1825 unsigned : 1;
1826 unsigned DSEN : 1;
1827 } __DSCONHbits_t;
1829 extern __at(0x0F4D) volatile __DSCONHbits_t DSCONHbits;
1831 #define _RTCWDIS 0x01
1832 #define _DSULPEN 0x02
1833 #define _DSEN 0x80
1835 //==============================================================================
1837 extern __at(0x0F4E) __sfr DSGPR0;
1838 extern __at(0x0F4F) __sfr DSGPR1;
1840 //==============================================================================
1841 // CCPTMRS2 Bits
1843 extern __at(0x0F50) __sfr CCPTMRS2;
1845 typedef union
1847 struct
1849 unsigned C8TSEL0 : 1;
1850 unsigned C8TSEL1 : 1;
1851 unsigned C9TSEL0 : 1;
1852 unsigned : 1;
1853 unsigned C10TSEL0 : 1;
1854 unsigned : 1;
1855 unsigned : 1;
1856 unsigned : 1;
1859 struct
1861 unsigned C8TSEL : 2;
1862 unsigned : 6;
1864 } __CCPTMRS2bits_t;
1866 extern __at(0x0F50) volatile __CCPTMRS2bits_t CCPTMRS2bits;
1868 #define _C8TSEL0 0x01
1869 #define _C8TSEL1 0x02
1870 #define _C9TSEL0 0x04
1871 #define _C10TSEL0 0x10
1873 //==============================================================================
1876 //==============================================================================
1877 // CCPTMRS1 Bits
1879 extern __at(0x0F51) __sfr CCPTMRS1;
1881 typedef union
1883 struct
1885 unsigned C4TSEL0 : 1;
1886 unsigned C4TSEL1 : 1;
1887 unsigned C5TSEL0 : 1;
1888 unsigned : 1;
1889 unsigned C6TSEL0 : 1;
1890 unsigned : 1;
1891 unsigned C7TSEL0 : 1;
1892 unsigned C7TSEL1 : 1;
1895 struct
1897 unsigned C4TSEL : 2;
1898 unsigned : 6;
1901 struct
1903 unsigned : 6;
1904 unsigned C7TSEL : 2;
1906 } __CCPTMRS1bits_t;
1908 extern __at(0x0F51) volatile __CCPTMRS1bits_t CCPTMRS1bits;
1910 #define _C4TSEL0 0x01
1911 #define _C4TSEL1 0x02
1912 #define _C5TSEL0 0x04
1913 #define _C6TSEL0 0x10
1914 #define _C7TSEL0 0x40
1915 #define _C7TSEL1 0x80
1917 //==============================================================================
1920 //==============================================================================
1921 // CCPTMRS0 Bits
1923 extern __at(0x0F52) __sfr CCPTMRS0;
1925 typedef union
1927 struct
1929 unsigned C1TSEL0 : 1;
1930 unsigned C1TSEL1 : 1;
1931 unsigned C1TSEL2 : 1;
1932 unsigned C2TSEL0 : 1;
1933 unsigned C2TSEL1 : 1;
1934 unsigned C2TSEL2 : 1;
1935 unsigned C3TSEL0 : 1;
1936 unsigned C3TSEL1 : 1;
1939 struct
1941 unsigned C1TSEL : 3;
1942 unsigned : 5;
1945 struct
1947 unsigned : 3;
1948 unsigned C2TSEL : 3;
1949 unsigned : 2;
1952 struct
1954 unsigned : 6;
1955 unsigned C3TSEL : 2;
1957 } __CCPTMRS0bits_t;
1959 extern __at(0x0F52) volatile __CCPTMRS0bits_t CCPTMRS0bits;
1961 #define _C1TSEL0 0x01
1962 #define _C1TSEL1 0x02
1963 #define _C1TSEL2 0x04
1964 #define _C2TSEL0 0x08
1965 #define _C2TSEL1 0x10
1966 #define _C2TSEL2 0x20
1967 #define _C3TSEL0 0x40
1968 #define _C3TSEL1 0x80
1970 //==============================================================================
1973 //==============================================================================
1974 // CVRCON Bits
1976 extern __at(0x0F53) __sfr CVRCON;
1978 typedef union
1980 struct
1982 unsigned CVR0 : 1;
1983 unsigned CVR1 : 1;
1984 unsigned CVR2 : 1;
1985 unsigned CVR3 : 1;
1986 unsigned CVRSS : 1;
1987 unsigned CVRR : 1;
1988 unsigned CVROE : 1;
1989 unsigned CVREN : 1;
1992 struct
1994 unsigned CVR : 4;
1995 unsigned : 4;
1997 } __CVRCONbits_t;
1999 extern __at(0x0F53) volatile __CVRCONbits_t CVRCONbits;
2001 #define _CVR0 0x01
2002 #define _CVR1 0x02
2003 #define _CVR2 0x04
2004 #define _CVR3 0x08
2005 #define _CVRSS 0x10
2006 #define _CVRR 0x20
2007 #define _CVROE 0x40
2008 #define _CVREN 0x80
2010 //==============================================================================
2013 //==============================================================================
2014 // PMSTATL Bits
2016 extern __at(0x0F54) __sfr PMSTATL;
2018 typedef struct
2020 unsigned OB0E : 1;
2021 unsigned OB1E : 1;
2022 unsigned OB2E : 1;
2023 unsigned OB3E : 1;
2024 unsigned : 1;
2025 unsigned : 1;
2026 unsigned OBUF : 1;
2027 unsigned OBE : 1;
2028 } __PMSTATLbits_t;
2030 extern __at(0x0F54) volatile __PMSTATLbits_t PMSTATLbits;
2032 #define _OB0E 0x01
2033 #define _OB1E 0x02
2034 #define _OB2E 0x04
2035 #define _OB3E 0x08
2036 #define _OBUF 0x40
2037 #define _OBE 0x80
2039 //==============================================================================
2042 //==============================================================================
2043 // PMSTATH Bits
2045 extern __at(0x0F55) __sfr PMSTATH;
2047 typedef struct
2049 unsigned IB0F : 1;
2050 unsigned IB1F : 1;
2051 unsigned IB2F : 1;
2052 unsigned IB3F : 1;
2053 unsigned : 1;
2054 unsigned : 1;
2055 unsigned IBOV : 1;
2056 unsigned IBF : 1;
2057 } __PMSTATHbits_t;
2059 extern __at(0x0F55) volatile __PMSTATHbits_t PMSTATHbits;
2061 #define _IB0F 0x01
2062 #define _IB1F 0x02
2063 #define _IB2F 0x04
2064 #define _IB3F 0x08
2065 #define _IBOV 0x40
2066 #define _IBF 0x80
2068 //==============================================================================
2071 //==============================================================================
2072 // PMEL Bits
2074 extern __at(0x0F56) __sfr PMEL;
2076 typedef struct
2078 unsigned PTEN0 : 1;
2079 unsigned PTEN1 : 1;
2080 unsigned PTEN2 : 1;
2081 unsigned PTEN3 : 1;
2082 unsigned PTEN4 : 1;
2083 unsigned PTEN5 : 1;
2084 unsigned PTEN6 : 1;
2085 unsigned PTEN7 : 1;
2086 } __PMELbits_t;
2088 extern __at(0x0F56) volatile __PMELbits_t PMELbits;
2090 #define _PTEN0 0x01
2091 #define _PTEN1 0x02
2092 #define _PTEN2 0x04
2093 #define _PTEN3 0x08
2094 #define _PTEN4 0x10
2095 #define _PTEN5 0x20
2096 #define _PTEN6 0x40
2097 #define _PTEN7 0x80
2099 //==============================================================================
2102 //==============================================================================
2103 // PMEH Bits
2105 extern __at(0x0F57) __sfr PMEH;
2107 typedef struct
2109 unsigned PTEN8 : 1;
2110 unsigned PTEN9 : 1;
2111 unsigned PTEN10 : 1;
2112 unsigned PTEN11 : 1;
2113 unsigned PTEN12 : 1;
2114 unsigned PTEN13 : 1;
2115 unsigned PTEN14 : 1;
2116 unsigned PTEN15 : 1;
2117 } __PMEHbits_t;
2119 extern __at(0x0F57) volatile __PMEHbits_t PMEHbits;
2121 #define _PTEN8 0x01
2122 #define _PTEN9 0x02
2123 #define _PTEN10 0x04
2124 #define _PTEN11 0x08
2125 #define _PTEN12 0x10
2126 #define _PTEN13 0x20
2127 #define _PTEN14 0x40
2128 #define _PTEN15 0x80
2130 //==============================================================================
2132 extern __at(0x0F58) __sfr PMDIN2L;
2133 extern __at(0x0F59) __sfr PMDIN2H;
2134 extern __at(0x0F5A) __sfr PMDOUT2L;
2135 extern __at(0x0F5B) __sfr PMDOUT2H;
2137 //==============================================================================
2138 // PMMODEL Bits
2140 extern __at(0x0F5C) __sfr PMMODEL;
2142 typedef union
2144 struct
2146 unsigned WAITE0 : 1;
2147 unsigned WAITE1 : 1;
2148 unsigned WAITM0 : 1;
2149 unsigned WAITM1 : 1;
2150 unsigned WAITM2 : 1;
2151 unsigned WAITM3 : 1;
2152 unsigned WAITB0 : 1;
2153 unsigned WAITB1 : 1;
2156 struct
2158 unsigned WAITE : 2;
2159 unsigned : 6;
2162 struct
2164 unsigned : 2;
2165 unsigned WAITM : 4;
2166 unsigned : 2;
2169 struct
2171 unsigned : 6;
2172 unsigned WAITB : 2;
2174 } __PMMODELbits_t;
2176 extern __at(0x0F5C) volatile __PMMODELbits_t PMMODELbits;
2178 #define _WAITE0 0x01
2179 #define _WAITE1 0x02
2180 #define _WAITM0 0x04
2181 #define _WAITM1 0x08
2182 #define _WAITM2 0x10
2183 #define _WAITM3 0x20
2184 #define _WAITB0 0x40
2185 #define _WAITB1 0x80
2187 //==============================================================================
2190 //==============================================================================
2191 // PMMODEH Bits
2193 extern __at(0x0F5D) __sfr PMMODEH;
2195 typedef union
2197 struct
2199 unsigned MODE0 : 1;
2200 unsigned MODE1 : 1;
2201 unsigned MODE16 : 1;
2202 unsigned INCM0 : 1;
2203 unsigned INCM1 : 1;
2204 unsigned IRQM0 : 1;
2205 unsigned IRQM1 : 1;
2206 unsigned BUSY : 1;
2209 struct
2211 unsigned : 3;
2212 unsigned INCM : 2;
2213 unsigned : 3;
2216 struct
2218 unsigned : 5;
2219 unsigned IRQM : 2;
2220 unsigned : 1;
2222 } __PMMODEHbits_t;
2224 extern __at(0x0F5D) volatile __PMMODEHbits_t PMMODEHbits;
2226 #define _MODE0 0x01
2227 #define _MODE1 0x02
2228 #define _MODE16 0x04
2229 #define _INCM0 0x08
2230 #define _INCM1 0x10
2231 #define _IRQM0 0x20
2232 #define _IRQM1 0x40
2233 #define _BUSY 0x80
2235 //==============================================================================
2238 //==============================================================================
2239 // PMCONL Bits
2241 extern __at(0x0F5E) __sfr PMCONL;
2243 typedef union
2245 struct
2247 unsigned RDSP : 1;
2248 unsigned WRSP : 1;
2249 unsigned BEP : 1;
2250 unsigned CS1P : 1;
2251 unsigned Reserved : 1;
2252 unsigned ALP : 1;
2253 unsigned CSF0 : 1;
2254 unsigned CSF1 : 1;
2257 struct
2259 unsigned : 6;
2260 unsigned CSF : 2;
2262 } __PMCONLbits_t;
2264 extern __at(0x0F5E) volatile __PMCONLbits_t PMCONLbits;
2266 #define _RDSP 0x01
2267 #define _WRSP 0x02
2268 #define _BEP 0x04
2269 #define _CS1P 0x08
2270 #define _Reserved 0x10
2271 #define _ALP 0x20
2272 #define _CSF0 0x40
2273 #define _CSF1 0x80
2275 //==============================================================================
2278 //==============================================================================
2279 // PMCONH Bits
2281 extern __at(0x0F5F) __sfr PMCONH;
2283 typedef union
2285 struct
2287 unsigned PTRDEN : 1;
2288 unsigned PTWREN : 1;
2289 unsigned PTBEEN : 1;
2290 unsigned ADRMUX0 : 1;
2291 unsigned ADRMUX1 : 1;
2292 unsigned : 1;
2293 unsigned : 1;
2294 unsigned PMPEN : 1;
2297 struct
2299 unsigned : 3;
2300 unsigned ADRMUX : 2;
2301 unsigned : 3;
2303 } __PMCONHbits_t;
2305 extern __at(0x0F5F) volatile __PMCONHbits_t PMCONHbits;
2307 #define _PTRDEN 0x01
2308 #define _PTWREN 0x02
2309 #define _PTBEEN 0x04
2310 #define _ADRMUX0 0x08
2311 #define _ADRMUX1 0x10
2312 #define _PMPEN 0x80
2314 //==============================================================================
2316 extern __at(0x0F66) __sfr DMABCH;
2317 extern __at(0x0F67) __sfr DMABCL;
2318 extern __at(0x0F68) __sfr RXADDRH;
2319 extern __at(0x0F69) __sfr RXADDRL;
2320 extern __at(0x0F6A) __sfr TXADDRH;
2321 extern __at(0x0F6B) __sfr TXADDRL;
2322 extern __at(0x0F6C) __sfr PMDIN1L;
2323 extern __at(0x0F6D) __sfr PMDIN1H;
2324 extern __at(0x0F6E) __sfr PMADDRL;
2325 extern __at(0x0F6E) __sfr PMDOUT1L;
2327 //==============================================================================
2328 // PMADDRH Bits
2330 extern __at(0x0F6F) __sfr PMADDRH;
2332 typedef struct
2334 unsigned : 1;
2335 unsigned : 1;
2336 unsigned : 1;
2337 unsigned : 1;
2338 unsigned : 1;
2339 unsigned : 1;
2340 unsigned CS1 : 1;
2341 unsigned : 1;
2342 } __PMADDRHbits_t;
2344 extern __at(0x0F6F) volatile __PMADDRHbits_t PMADDRHbits;
2346 #define _CS1 0x40
2348 //==============================================================================
2350 extern __at(0x0F6F) __sfr PMDOUT1H;
2352 //==============================================================================
2353 // CMSTAT Bits
2355 extern __at(0x0F70) __sfr CMSTAT;
2357 typedef struct
2359 unsigned COUT1 : 1;
2360 unsigned COUT2 : 1;
2361 unsigned COUT3 : 1;
2362 unsigned : 1;
2363 unsigned : 1;
2364 unsigned : 1;
2365 unsigned : 1;
2366 unsigned : 1;
2367 } __CMSTATbits_t;
2369 extern __at(0x0F70) volatile __CMSTATbits_t CMSTATbits;
2371 #define _COUT1 0x01
2372 #define _COUT2 0x02
2373 #define _COUT3 0x04
2375 //==============================================================================
2378 //==============================================================================
2379 // CMSTATUS Bits
2381 extern __at(0x0F70) __sfr CMSTATUS;
2383 typedef struct
2385 unsigned COUT1 : 1;
2386 unsigned COUT2 : 1;
2387 unsigned COUT3 : 1;
2388 unsigned : 1;
2389 unsigned : 1;
2390 unsigned : 1;
2391 unsigned : 1;
2392 unsigned : 1;
2393 } __CMSTATUSbits_t;
2395 extern __at(0x0F70) volatile __CMSTATUSbits_t CMSTATUSbits;
2397 #define _CMSTATUS_COUT1 0x01
2398 #define _CMSTATUS_COUT2 0x02
2399 #define _CMSTATUS_COUT3 0x04
2401 //==============================================================================
2404 //==============================================================================
2405 // SSP2CON2 Bits
2407 extern __at(0x0F71) __sfr SSP2CON2;
2409 typedef union
2411 struct
2413 unsigned SEN : 1;
2414 unsigned RSEN : 1;
2415 unsigned PEN : 1;
2416 unsigned RCEN : 1;
2417 unsigned ACKEN : 1;
2418 unsigned ACKDT : 1;
2419 unsigned ACKSTAT : 1;
2420 unsigned GCEN : 1;
2423 struct
2425 unsigned : 1;
2426 unsigned ADMSK1 : 1;
2427 unsigned ADMSK2 : 1;
2428 unsigned ADMSK3 : 1;
2429 unsigned ADMSK4 : 1;
2430 unsigned ADMSK5 : 1;
2431 unsigned : 1;
2432 unsigned : 1;
2434 } __SSP2CON2bits_t;
2436 extern __at(0x0F71) volatile __SSP2CON2bits_t SSP2CON2bits;
2438 #define _SSP2CON2_SEN 0x01
2439 #define _SSP2CON2_RSEN 0x02
2440 #define _SSP2CON2_ADMSK1 0x02
2441 #define _SSP2CON2_PEN 0x04
2442 #define _SSP2CON2_ADMSK2 0x04
2443 #define _SSP2CON2_RCEN 0x08
2444 #define _SSP2CON2_ADMSK3 0x08
2445 #define _SSP2CON2_ACKEN 0x10
2446 #define _SSP2CON2_ADMSK4 0x10
2447 #define _SSP2CON2_ACKDT 0x20
2448 #define _SSP2CON2_ADMSK5 0x20
2449 #define _SSP2CON2_ACKSTAT 0x40
2450 #define _SSP2CON2_GCEN 0x80
2452 //==============================================================================
2455 //==============================================================================
2456 // SSP2CON1 Bits
2458 extern __at(0x0F72) __sfr SSP2CON1;
2460 typedef union
2462 struct
2464 unsigned SSPM0 : 1;
2465 unsigned SSPM1 : 1;
2466 unsigned SSPM2 : 1;
2467 unsigned SSPM3 : 1;
2468 unsigned CKP : 1;
2469 unsigned SSPEN : 1;
2470 unsigned SSPOV : 1;
2471 unsigned WCOL : 1;
2474 struct
2476 unsigned SSPM : 4;
2477 unsigned : 4;
2479 } __SSP2CON1bits_t;
2481 extern __at(0x0F72) volatile __SSP2CON1bits_t SSP2CON1bits;
2483 #define _SSP2CON1_SSPM0 0x01
2484 #define _SSP2CON1_SSPM1 0x02
2485 #define _SSP2CON1_SSPM2 0x04
2486 #define _SSP2CON1_SSPM3 0x08
2487 #define _SSP2CON1_CKP 0x10
2488 #define _SSP2CON1_SSPEN 0x20
2489 #define _SSP2CON1_SSPOV 0x40
2490 #define _SSP2CON1_WCOL 0x80
2492 //==============================================================================
2495 //==============================================================================
2496 // SSP2STAT Bits
2498 extern __at(0x0F73) __sfr SSP2STAT;
2500 typedef struct
2502 unsigned BF : 1;
2503 unsigned UA : 1;
2504 unsigned R_NOT_W : 1;
2505 unsigned S : 1;
2506 unsigned P : 1;
2507 unsigned D_NOT_A : 1;
2508 unsigned CKE : 1;
2509 unsigned SMP : 1;
2510 } __SSP2STATbits_t;
2512 extern __at(0x0F73) volatile __SSP2STATbits_t SSP2STATbits;
2514 #define _SSP2STAT_BF 0x01
2515 #define _SSP2STAT_UA 0x02
2516 #define _SSP2STAT_R_NOT_W 0x04
2517 #define _SSP2STAT_S 0x08
2518 #define _SSP2STAT_P 0x10
2519 #define _SSP2STAT_D_NOT_A 0x20
2520 #define _SSP2STAT_CKE 0x40
2521 #define _SSP2STAT_SMP 0x80
2523 //==============================================================================
2525 extern __at(0x0F74) __sfr SSP2ADD;
2527 //==============================================================================
2528 // SSP2MSK Bits
2530 extern __at(0x0F74) __sfr SSP2MSK;
2532 typedef struct
2534 unsigned MSK0 : 1;
2535 unsigned MSK1 : 1;
2536 unsigned MSK2 : 1;
2537 unsigned MSK3 : 1;
2538 unsigned MSK4 : 1;
2539 unsigned MSK5 : 1;
2540 unsigned MSK6 : 1;
2541 unsigned MSK7 : 1;
2542 } __SSP2MSKbits_t;
2544 extern __at(0x0F74) volatile __SSP2MSKbits_t SSP2MSKbits;
2546 #define _SSP2MSK_MSK0 0x01
2547 #define _SSP2MSK_MSK1 0x02
2548 #define _SSP2MSK_MSK2 0x04
2549 #define _SSP2MSK_MSK3 0x08
2550 #define _SSP2MSK_MSK4 0x10
2551 #define _SSP2MSK_MSK5 0x20
2552 #define _SSP2MSK_MSK6 0x40
2553 #define _SSP2MSK_MSK7 0x80
2555 //==============================================================================
2557 extern __at(0x0F75) __sfr SSP2BUF;
2559 //==============================================================================
2560 // T4CON Bits
2562 extern __at(0x0F76) __sfr T4CON;
2564 typedef union
2566 struct
2568 unsigned T4CKPS0 : 1;
2569 unsigned T4CKPS1 : 1;
2570 unsigned TMR4ON : 1;
2571 unsigned T4OUTPS0 : 1;
2572 unsigned T4OUTPS1 : 1;
2573 unsigned T4OUTPS2 : 1;
2574 unsigned T4OUTPS3 : 1;
2575 unsigned : 1;
2578 struct
2580 unsigned T4CKPS : 2;
2581 unsigned : 6;
2584 struct
2586 unsigned : 3;
2587 unsigned T4OUTPS : 4;
2588 unsigned : 1;
2590 } __T4CONbits_t;
2592 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
2594 #define _T4CKPS0 0x01
2595 #define _T4CKPS1 0x02
2596 #define _TMR4ON 0x04
2597 #define _T4OUTPS0 0x08
2598 #define _T4OUTPS1 0x10
2599 #define _T4OUTPS2 0x20
2600 #define _T4OUTPS3 0x40
2602 //==============================================================================
2604 extern __at(0x0F77) __sfr PR4;
2605 extern __at(0x0F78) __sfr TMR4;
2607 //==============================================================================
2608 // T3CON Bits
2610 extern __at(0x0F79) __sfr T3CON;
2612 typedef union
2614 struct
2616 unsigned TMR3ON : 1;
2617 unsigned RD16 : 1;
2618 unsigned NOT_T3SYNC : 1;
2619 unsigned T3OSCEN : 1;
2620 unsigned T3CKPS0 : 1;
2621 unsigned T3CKPS1 : 1;
2622 unsigned TMR3CS0 : 1;
2623 unsigned TMR3CS1 : 1;
2626 struct
2628 unsigned : 4;
2629 unsigned T3CKPS : 2;
2630 unsigned : 2;
2633 struct
2635 unsigned : 6;
2636 unsigned TMR3CS : 2;
2638 } __T3CONbits_t;
2640 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits;
2642 #define _T3CON_TMR3ON 0x01
2643 #define _T3CON_RD16 0x02
2644 #define _T3CON_NOT_T3SYNC 0x04
2645 #define _T3CON_T3OSCEN 0x08
2646 #define _T3CON_T3CKPS0 0x10
2647 #define _T3CON_T3CKPS1 0x20
2648 #define _T3CON_TMR3CS0 0x40
2649 #define _T3CON_TMR3CS1 0x80
2651 //==============================================================================
2653 extern __at(0x0F7A) __sfr TMR3;
2654 extern __at(0x0F7A) __sfr TMR3L;
2655 extern __at(0x0F7B) __sfr TMR3H;
2657 //==============================================================================
2658 // BAUDCON2 Bits
2660 extern __at(0x0F7C) __sfr BAUDCON2;
2662 typedef struct
2664 unsigned ABDEN : 1;
2665 unsigned WUE : 1;
2666 unsigned : 1;
2667 unsigned BRG16 : 1;
2668 unsigned TXCKP : 1;
2669 unsigned RXDTP : 1;
2670 unsigned RCIDL : 1;
2671 unsigned ABDOVF : 1;
2672 } __BAUDCON2bits_t;
2674 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
2676 #define _BAUDCON2_ABDEN 0x01
2677 #define _BAUDCON2_WUE 0x02
2678 #define _BAUDCON2_BRG16 0x08
2679 #define _BAUDCON2_TXCKP 0x10
2680 #define _BAUDCON2_RXDTP 0x20
2681 #define _BAUDCON2_RCIDL 0x40
2682 #define _BAUDCON2_ABDOVF 0x80
2684 //==============================================================================
2686 extern __at(0x0F7D) __sfr SPBRGH2;
2688 //==============================================================================
2689 // BAUDCON Bits
2691 extern __at(0x0F7E) __sfr BAUDCON;
2693 typedef struct
2695 unsigned ABDEN : 1;
2696 unsigned WUE : 1;
2697 unsigned : 1;
2698 unsigned BRG16 : 1;
2699 unsigned TXCKP : 1;
2700 unsigned RXDTP : 1;
2701 unsigned RCIDL : 1;
2702 unsigned ABDOVF : 1;
2703 } __BAUDCONbits_t;
2705 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
2707 #define _ABDEN 0x01
2708 #define _WUE 0x02
2709 #define _BRG16 0x08
2710 #define _TXCKP 0x10
2711 #define _RXDTP 0x20
2712 #define _RCIDL 0x40
2713 #define _ABDOVF 0x80
2715 //==============================================================================
2718 //==============================================================================
2719 // BAUDCON1 Bits
2721 extern __at(0x0F7E) __sfr BAUDCON1;
2723 typedef struct
2725 unsigned ABDEN : 1;
2726 unsigned WUE : 1;
2727 unsigned : 1;
2728 unsigned BRG16 : 1;
2729 unsigned TXCKP : 1;
2730 unsigned RXDTP : 1;
2731 unsigned RCIDL : 1;
2732 unsigned ABDOVF : 1;
2733 } __BAUDCON1bits_t;
2735 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
2737 #define _BAUDCON1_ABDEN 0x01
2738 #define _BAUDCON1_WUE 0x02
2739 #define _BAUDCON1_BRG16 0x08
2740 #define _BAUDCON1_TXCKP 0x10
2741 #define _BAUDCON1_RXDTP 0x20
2742 #define _BAUDCON1_RCIDL 0x40
2743 #define _BAUDCON1_ABDOVF 0x80
2745 //==============================================================================
2748 //==============================================================================
2749 // BAUDCTL Bits
2751 extern __at(0x0F7E) __sfr BAUDCTL;
2753 typedef struct
2755 unsigned ABDEN : 1;
2756 unsigned WUE : 1;
2757 unsigned : 1;
2758 unsigned BRG16 : 1;
2759 unsigned TXCKP : 1;
2760 unsigned RXDTP : 1;
2761 unsigned RCIDL : 1;
2762 unsigned ABDOVF : 1;
2763 } __BAUDCTLbits_t;
2765 extern __at(0x0F7E) volatile __BAUDCTLbits_t BAUDCTLbits;
2767 #define _BAUDCTL_ABDEN 0x01
2768 #define _BAUDCTL_WUE 0x02
2769 #define _BAUDCTL_BRG16 0x08
2770 #define _BAUDCTL_TXCKP 0x10
2771 #define _BAUDCTL_RXDTP 0x20
2772 #define _BAUDCTL_RCIDL 0x40
2773 #define _BAUDCTL_ABDOVF 0x80
2775 //==============================================================================
2777 extern __at(0x0F7F) __sfr SPBRGH;
2778 extern __at(0x0F7F) __sfr SPBRGH1;
2780 //==============================================================================
2781 // PORTA Bits
2783 extern __at(0x0F80) __sfr PORTA;
2785 typedef union
2787 struct
2789 unsigned RA0 : 1;
2790 unsigned RA1 : 1;
2791 unsigned RA2 : 1;
2792 unsigned RA3 : 1;
2793 unsigned : 1;
2794 unsigned RA5 : 1;
2795 unsigned RA6 : 1;
2796 unsigned RA7 : 1;
2799 struct
2801 unsigned AN0 : 1;
2802 unsigned AN1 : 1;
2803 unsigned AN2 : 1;
2804 unsigned AN3 : 1;
2805 unsigned : 1;
2806 unsigned AN4 : 1;
2807 unsigned OSC2 : 1;
2808 unsigned OSC1 : 1;
2811 struct
2813 unsigned C1INA : 1;
2814 unsigned C2INA : 1;
2815 unsigned VREF_MINUS : 1;
2816 unsigned VREF_PLUS : 1;
2817 unsigned : 1;
2818 unsigned NOT_SS1 : 1;
2819 unsigned CLKO : 1;
2820 unsigned CLKI : 1;
2823 struct
2825 unsigned PMA6 : 1;
2826 unsigned PMA7 : 1;
2827 unsigned CVREF : 1;
2828 unsigned C1INB : 1;
2829 unsigned : 1;
2830 unsigned HLVDIN : 1;
2831 unsigned : 1;
2832 unsigned : 1;
2835 struct
2837 unsigned RP0 : 1;
2838 unsigned RP1 : 1;
2839 unsigned C2INB : 1;
2840 unsigned : 1;
2841 unsigned : 1;
2842 unsigned C1INC : 1;
2843 unsigned : 1;
2844 unsigned : 1;
2847 struct
2849 unsigned ULPWU : 1;
2850 unsigned VBG : 1;
2851 unsigned C1IND : 1;
2852 unsigned : 1;
2853 unsigned : 1;
2854 unsigned RP2 : 1;
2855 unsigned : 1;
2856 unsigned : 1;
2859 struct
2861 unsigned : 1;
2862 unsigned : 1;
2863 unsigned C3INB : 1;
2864 unsigned : 1;
2865 unsigned : 1;
2866 unsigned : 1;
2867 unsigned : 1;
2868 unsigned : 1;
2870 } __PORTAbits_t;
2872 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
2874 #define _RA0 0x01
2875 #define _AN0 0x01
2876 #define _C1INA 0x01
2877 #define _PMA6 0x01
2878 #define _RP0 0x01
2879 #define _ULPWU 0x01
2880 #define _RA1 0x02
2881 #define _AN1 0x02
2882 #define _C2INA 0x02
2883 #define _PMA7 0x02
2884 #define _RP1 0x02
2885 #define _VBG 0x02
2886 #define _RA2 0x04
2887 #define _AN2 0x04
2888 #define _VREF_MINUS 0x04
2889 #define _CVREF 0x04
2890 #define _C2INB 0x04
2891 #define _C1IND 0x04
2892 #define _C3INB 0x04
2893 #define _RA3 0x08
2894 #define _AN3 0x08
2895 #define _VREF_PLUS 0x08
2896 #define _C1INB 0x08
2897 #define _RA5 0x20
2898 #define _AN4 0x20
2899 #define _NOT_SS1 0x20
2900 #define _HLVDIN 0x20
2901 #define _C1INC 0x20
2902 #define _RP2 0x20
2903 #define _RA6 0x40
2904 #define _OSC2 0x40
2905 #define _CLKO 0x40
2906 #define _RA7 0x80
2907 #define _OSC1 0x80
2908 #define _CLKI 0x80
2910 //==============================================================================
2913 //==============================================================================
2914 // PORTB Bits
2916 extern __at(0x0F81) __sfr PORTB;
2918 typedef union
2920 struct
2922 unsigned RB0 : 1;
2923 unsigned RB1 : 1;
2924 unsigned RB2 : 1;
2925 unsigned RB3 : 1;
2926 unsigned RB4 : 1;
2927 unsigned RB5 : 1;
2928 unsigned RB6 : 1;
2929 unsigned RB7 : 1;
2932 struct
2934 unsigned AN12 : 1;
2935 unsigned AN10 : 1;
2936 unsigned AN8 : 1;
2937 unsigned AN9 : 1;
2938 unsigned PMA1 : 1;
2939 unsigned PMA0 : 1;
2940 unsigned KBI2 : 1;
2941 unsigned KBI3 : 1;
2944 struct
2946 unsigned INT0 : 1;
2947 unsigned PMPBE : 1;
2948 unsigned CTED1 : 1;
2949 unsigned CTED2 : 1;
2950 unsigned KBI0 : 1;
2951 unsigned KBI1 : 1;
2952 unsigned PGC : 1;
2953 unsigned PGD : 1;
2956 struct
2958 unsigned RP3 : 1;
2959 unsigned RTCC : 1;
2960 unsigned PMA3 : 1;
2961 unsigned PMA2 : 1;
2962 unsigned RP7 : 1;
2963 unsigned RP8 : 1;
2964 unsigned RP9 : 1;
2965 unsigned RP10 : 1;
2968 struct
2970 unsigned C3IND : 1;
2971 unsigned PMBE : 1;
2972 unsigned REFO : 1;
2973 unsigned RP6 : 1;
2974 unsigned CCP4 : 1;
2975 unsigned CCP5 : 1;
2976 unsigned CCP6 : 1;
2977 unsigned CCP7 : 1;
2980 struct
2982 unsigned : 1;
2983 unsigned RP4 : 1;
2984 unsigned RP5 : 1;
2985 unsigned C3INA : 1;
2986 unsigned : 1;
2987 unsigned : 1;
2988 unsigned : 1;
2989 unsigned : 1;
2992 struct
2994 unsigned : 1;
2995 unsigned C3INC : 1;
2996 unsigned C2INC : 1;
2997 unsigned : 1;
2998 unsigned : 1;
2999 unsigned : 1;
3000 unsigned : 1;
3001 unsigned : 1;
3004 struct
3006 unsigned : 4;
3007 unsigned KBI : 4;
3009 } __PORTBbits_t;
3011 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
3013 #define _RB0 0x01
3014 #define _AN12 0x01
3015 #define _INT0 0x01
3016 #define _RP3 0x01
3017 #define _C3IND 0x01
3018 #define _RB1 0x02
3019 #define _AN10 0x02
3020 #define _PMPBE 0x02
3021 #define _RTCC 0x02
3022 #define _PMBE 0x02
3023 #define _RP4 0x02
3024 #define _C3INC 0x02
3025 #define _RB2 0x04
3026 #define _AN8 0x04
3027 #define _CTED1 0x04
3028 #define _PMA3 0x04
3029 #define _REFO 0x04
3030 #define _RP5 0x04
3031 #define _C2INC 0x04
3032 #define _RB3 0x08
3033 #define _AN9 0x08
3034 #define _CTED2 0x08
3035 #define _PMA2 0x08
3036 #define _RP6 0x08
3037 #define _C3INA 0x08
3038 #define _RB4 0x10
3039 #define _PMA1 0x10
3040 #define _KBI0 0x10
3041 #define _RP7 0x10
3042 #define _CCP4 0x10
3043 #define _RB5 0x20
3044 #define _PMA0 0x20
3045 #define _KBI1 0x20
3046 #define _RP8 0x20
3047 #define _CCP5 0x20
3048 #define _RB6 0x40
3049 #define _KBI2 0x40
3050 #define _PGC 0x40
3051 #define _RP9 0x40
3052 #define _CCP6 0x40
3053 #define _RB7 0x80
3054 #define _KBI3 0x80
3055 #define _PGD 0x80
3056 #define _RP10 0x80
3057 #define _CCP7 0x80
3059 //==============================================================================
3062 //==============================================================================
3063 // PORTC Bits
3065 extern __at(0x0F82) __sfr PORTC;
3067 typedef union
3069 struct
3071 unsigned RC0 : 1;
3072 unsigned RC1 : 1;
3073 unsigned RC2 : 1;
3074 unsigned RC3 : 1;
3075 unsigned RC4 : 1;
3076 unsigned RC5 : 1;
3077 unsigned RC6 : 1;
3078 unsigned RC7 : 1;
3081 struct
3083 unsigned T1OSO : 1;
3084 unsigned T1OSI : 1;
3085 unsigned AN11 : 1;
3086 unsigned SCL1 : 1;
3087 unsigned SDA1 : 1;
3088 unsigned RP16 : 1;
3089 unsigned PMA5 : 1;
3090 unsigned PMA4 : 1;
3093 struct
3095 unsigned T1CKI : 1;
3096 unsigned RP12 : 1;
3097 unsigned CTPLS : 1;
3098 unsigned RP14 : 1;
3099 unsigned RP15 : 1;
3100 unsigned SDO1 : 1;
3101 unsigned TX1 : 1;
3102 unsigned RX1 : 1;
3105 struct
3107 unsigned RP11 : 1;
3108 unsigned CCP8 : 1;
3109 unsigned RP13 : 1;
3110 unsigned SCK1 : 1;
3111 unsigned SDI1 : 1;
3112 unsigned : 1;
3113 unsigned CK1 : 1;
3114 unsigned DT1 : 1;
3117 struct
3119 unsigned : 1;
3120 unsigned : 1;
3121 unsigned C2IND : 1;
3122 unsigned : 1;
3123 unsigned : 1;
3124 unsigned : 1;
3125 unsigned RP17 : 1;
3126 unsigned RP18 : 1;
3129 struct
3131 unsigned : 1;
3132 unsigned : 1;
3133 unsigned : 1;
3134 unsigned : 1;
3135 unsigned : 1;
3136 unsigned : 1;
3137 unsigned CCP9 : 1;
3138 unsigned CCP10 : 1;
3140 } __PORTCbits_t;
3142 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
3144 #define _RC0 0x01
3145 #define _T1OSO 0x01
3146 #define _T1CKI 0x01
3147 #define _RP11 0x01
3148 #define _RC1 0x02
3149 #define _T1OSI 0x02
3150 #define _RP12 0x02
3151 #define _CCP8 0x02
3152 #define _RC2 0x04
3153 #define _AN11 0x04
3154 #define _CTPLS 0x04
3155 #define _RP13 0x04
3156 #define _C2IND 0x04
3157 #define _RC3 0x08
3158 #define _SCL1 0x08
3159 #define _RP14 0x08
3160 #define _SCK1 0x08
3161 #define _RC4 0x10
3162 #define _SDA1 0x10
3163 #define _RP15 0x10
3164 #define _SDI1 0x10
3165 #define _RC5 0x20
3166 #define _RP16 0x20
3167 #define _SDO1 0x20
3168 #define _RC6 0x40
3169 #define _PMA5 0x40
3170 #define _TX1 0x40
3171 #define _CK1 0x40
3172 #define _RP17 0x40
3173 #define _CCP9 0x40
3174 #define _RC7 0x80
3175 #define _PMA4 0x80
3176 #define _RX1 0x80
3177 #define _DT1 0x80
3178 #define _RP18 0x80
3179 #define _CCP10 0x80
3181 //==============================================================================
3184 //==============================================================================
3185 // PORTD Bits
3187 extern __at(0x0F83) __sfr PORTD;
3189 typedef union
3191 struct
3193 unsigned RD0 : 1;
3194 unsigned RD1 : 1;
3195 unsigned RD2 : 1;
3196 unsigned RD3 : 1;
3197 unsigned RD4 : 1;
3198 unsigned RD5 : 1;
3199 unsigned RD6 : 1;
3200 unsigned RD7 : 1;
3203 struct
3205 unsigned PMD0 : 1;
3206 unsigned PMD1 : 1;
3207 unsigned PMD2 : 1;
3208 unsigned PMD3 : 1;
3209 unsigned PMD4 : 1;
3210 unsigned PMD5 : 1;
3211 unsigned PMD6 : 1;
3212 unsigned PMD7 : 1;
3215 struct
3217 unsigned SCL2 : 1;
3218 unsigned SDA2 : 1;
3219 unsigned RP19 : 1;
3220 unsigned RP20 : 1;
3221 unsigned RP21 : 1;
3222 unsigned RP22 : 1;
3223 unsigned RP23 : 1;
3224 unsigned RP24 : 1;
3226 } __PORTDbits_t;
3228 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
3230 #define _RD0 0x01
3231 #define _PMD0 0x01
3232 #define _SCL2 0x01
3233 #define _RD1 0x02
3234 #define _PMD1 0x02
3235 #define _SDA2 0x02
3236 #define _RD2 0x04
3237 #define _PMD2 0x04
3238 #define _RP19 0x04
3239 #define _RD3 0x08
3240 #define _PMD3 0x08
3241 #define _RP20 0x08
3242 #define _RD4 0x10
3243 #define _PMD4 0x10
3244 #define _RP21 0x10
3245 #define _RD5 0x20
3246 #define _PMD5 0x20
3247 #define _RP22 0x20
3248 #define _RD6 0x40
3249 #define _PMD6 0x40
3250 #define _RP23 0x40
3251 #define _RD7 0x80
3252 #define _PMD7 0x80
3253 #define _RP24 0x80
3255 //==============================================================================
3258 //==============================================================================
3259 // PORTE Bits
3261 extern __at(0x0F84) __sfr PORTE;
3263 typedef union
3265 struct
3267 unsigned RE0 : 1;
3268 unsigned RE1 : 1;
3269 unsigned RE2 : 1;
3270 unsigned : 1;
3271 unsigned : 1;
3272 unsigned : 1;
3273 unsigned : 1;
3274 unsigned : 1;
3277 struct
3279 unsigned AN5 : 1;
3280 unsigned AN6 : 1;
3281 unsigned AN7 : 1;
3282 unsigned : 1;
3283 unsigned : 1;
3284 unsigned : 1;
3285 unsigned : 1;
3286 unsigned : 1;
3289 struct
3291 unsigned PMPRD : 1;
3292 unsigned PMPWR : 1;
3293 unsigned PMPCS : 1;
3294 unsigned : 1;
3295 unsigned : 1;
3296 unsigned : 1;
3297 unsigned : 1;
3298 unsigned : 1;
3301 struct
3303 unsigned PMRD : 1;
3304 unsigned PMWR : 1;
3305 unsigned PMCS : 1;
3306 unsigned : 1;
3307 unsigned : 1;
3308 unsigned : 1;
3309 unsigned : 1;
3310 unsigned : 1;
3313 struct
3315 unsigned RE : 3;
3316 unsigned : 5;
3318 } __PORTEbits_t;
3320 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
3322 #define _RE0 0x01
3323 #define _AN5 0x01
3324 #define _PMPRD 0x01
3325 #define _PMRD 0x01
3326 #define _RE1 0x02
3327 #define _AN6 0x02
3328 #define _PMPWR 0x02
3329 #define _PMWR 0x02
3330 #define _RE2 0x04
3331 #define _AN7 0x04
3332 #define _PMPCS 0x04
3333 #define _PMCS 0x04
3335 //==============================================================================
3338 //==============================================================================
3339 // HLVDCON Bits
3341 extern __at(0x0F85) __sfr HLVDCON;
3343 typedef union
3345 struct
3347 unsigned HLVDL0 : 1;
3348 unsigned HLVDL1 : 1;
3349 unsigned HLVDL2 : 1;
3350 unsigned HLVDL3 : 1;
3351 unsigned HLVDEN : 1;
3352 unsigned IRVST : 1;
3353 unsigned BGVST : 1;
3354 unsigned VDIRMAG : 1;
3357 struct
3359 unsigned HLVDL : 4;
3360 unsigned : 4;
3362 } __HLVDCONbits_t;
3364 extern __at(0x0F85) volatile __HLVDCONbits_t HLVDCONbits;
3366 #define _HLVDL0 0x01
3367 #define _HLVDL1 0x02
3368 #define _HLVDL2 0x04
3369 #define _HLVDL3 0x08
3370 #define _HLVDEN 0x10
3371 #define _IRVST 0x20
3372 #define _BGVST 0x40
3373 #define _VDIRMAG 0x80
3375 //==============================================================================
3378 //==============================================================================
3379 // DMACON2 Bits
3381 extern __at(0x0F86) __sfr DMACON2;
3383 typedef union
3385 struct
3387 unsigned INTLVL0 : 1;
3388 unsigned INTLVL1 : 1;
3389 unsigned INTLVL2 : 1;
3390 unsigned INTLVL3 : 1;
3391 unsigned DLYCYC0 : 1;
3392 unsigned DLYCYC1 : 1;
3393 unsigned DLYCYC2 : 1;
3394 unsigned DLYCYC3 : 1;
3397 struct
3399 unsigned INTLVL : 4;
3400 unsigned : 4;
3403 struct
3405 unsigned : 4;
3406 unsigned DLYCYC : 4;
3408 } __DMACON2bits_t;
3410 extern __at(0x0F86) volatile __DMACON2bits_t DMACON2bits;
3412 #define _INTLVL0 0x01
3413 #define _INTLVL1 0x02
3414 #define _INTLVL2 0x04
3415 #define _INTLVL3 0x08
3416 #define _DLYCYC0 0x10
3417 #define _DLYCYC1 0x20
3418 #define _DLYCYC2 0x40
3419 #define _DLYCYC3 0x80
3421 //==============================================================================
3424 //==============================================================================
3425 // OSCCON2 Bits
3427 extern __at(0x0F87) __sfr OSCCON2;
3429 typedef struct
3431 unsigned : 1;
3432 unsigned : 1;
3433 unsigned PRISD : 1;
3434 unsigned SOSCGO : 1;
3435 unsigned SOSCDRV : 1;
3436 unsigned : 1;
3437 unsigned SOSCRUN : 1;
3438 unsigned : 1;
3439 } __OSCCON2bits_t;
3441 extern __at(0x0F87) volatile __OSCCON2bits_t OSCCON2bits;
3443 #define _PRISD 0x04
3444 #define _SOSCGO 0x08
3445 #define _SOSCDRV 0x10
3446 #define _SOSCRUN 0x40
3448 //==============================================================================
3451 //==============================================================================
3452 // DMACON1 Bits
3454 extern __at(0x0F88) __sfr DMACON1;
3456 typedef union
3458 struct
3460 unsigned DMAEN : 1;
3461 unsigned DLYINTEN : 1;
3462 unsigned DUPLEX0 : 1;
3463 unsigned DUPLEX1 : 1;
3464 unsigned RXINC : 1;
3465 unsigned TXINC : 1;
3466 unsigned SSCON0 : 1;
3467 unsigned SSCON1 : 1;
3470 struct
3472 unsigned : 2;
3473 unsigned DUPLEX : 2;
3474 unsigned : 4;
3477 struct
3479 unsigned : 6;
3480 unsigned SSCON : 2;
3482 } __DMACON1bits_t;
3484 extern __at(0x0F88) volatile __DMACON1bits_t DMACON1bits;
3486 #define _DMAEN 0x01
3487 #define _DLYINTEN 0x02
3488 #define _DUPLEX0 0x04
3489 #define _DUPLEX1 0x08
3490 #define _RXINC 0x10
3491 #define _TXINC 0x20
3492 #define _SSCON0 0x40
3493 #define _SSCON1 0x80
3495 //==============================================================================
3498 //==============================================================================
3499 // LATA Bits
3501 extern __at(0x0F89) __sfr LATA;
3503 typedef struct
3505 unsigned LATA0 : 1;
3506 unsigned LATA1 : 1;
3507 unsigned LATA2 : 1;
3508 unsigned LATA3 : 1;
3509 unsigned : 1;
3510 unsigned LATA5 : 1;
3511 unsigned LATA6 : 1;
3512 unsigned LATA7 : 1;
3513 } __LATAbits_t;
3515 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
3517 #define _LATA0 0x01
3518 #define _LATA1 0x02
3519 #define _LATA2 0x04
3520 #define _LATA3 0x08
3521 #define _LATA5 0x20
3522 #define _LATA6 0x40
3523 #define _LATA7 0x80
3525 //==============================================================================
3528 //==============================================================================
3529 // LATB Bits
3531 extern __at(0x0F8A) __sfr LATB;
3533 typedef struct
3535 unsigned LATB0 : 1;
3536 unsigned LATB1 : 1;
3537 unsigned LATB2 : 1;
3538 unsigned LATB3 : 1;
3539 unsigned LATB4 : 1;
3540 unsigned LATB5 : 1;
3541 unsigned LATB6 : 1;
3542 unsigned LATB7 : 1;
3543 } __LATBbits_t;
3545 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
3547 #define _LATB0 0x01
3548 #define _LATB1 0x02
3549 #define _LATB2 0x04
3550 #define _LATB3 0x08
3551 #define _LATB4 0x10
3552 #define _LATB5 0x20
3553 #define _LATB6 0x40
3554 #define _LATB7 0x80
3556 //==============================================================================
3559 //==============================================================================
3560 // LATC Bits
3562 extern __at(0x0F8B) __sfr LATC;
3564 typedef struct
3566 unsigned LATC0 : 1;
3567 unsigned LATC1 : 1;
3568 unsigned LATC2 : 1;
3569 unsigned LATC3 : 1;
3570 unsigned LATC4 : 1;
3571 unsigned LATC5 : 1;
3572 unsigned LATC6 : 1;
3573 unsigned LATC7 : 1;
3574 } __LATCbits_t;
3576 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
3578 #define _LATC0 0x01
3579 #define _LATC1 0x02
3580 #define _LATC2 0x04
3581 #define _LATC3 0x08
3582 #define _LATC4 0x10
3583 #define _LATC5 0x20
3584 #define _LATC6 0x40
3585 #define _LATC7 0x80
3587 //==============================================================================
3590 //==============================================================================
3591 // LATD Bits
3593 extern __at(0x0F8C) __sfr LATD;
3595 typedef struct
3597 unsigned LATD0 : 1;
3598 unsigned LATD1 : 1;
3599 unsigned LATD2 : 1;
3600 unsigned LATD3 : 1;
3601 unsigned LATD4 : 1;
3602 unsigned LATD5 : 1;
3603 unsigned LATD6 : 1;
3604 unsigned LATD7 : 1;
3605 } __LATDbits_t;
3607 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
3609 #define _LATD0 0x01
3610 #define _LATD1 0x02
3611 #define _LATD2 0x04
3612 #define _LATD3 0x08
3613 #define _LATD4 0x10
3614 #define _LATD5 0x20
3615 #define _LATD6 0x40
3616 #define _LATD7 0x80
3618 //==============================================================================
3621 //==============================================================================
3622 // LATE Bits
3624 extern __at(0x0F8D) __sfr LATE;
3626 typedef union
3628 struct
3630 unsigned LATE0 : 1;
3631 unsigned LATE1 : 1;
3632 unsigned LATE2 : 1;
3633 unsigned : 1;
3634 unsigned : 1;
3635 unsigned : 1;
3636 unsigned : 1;
3637 unsigned : 1;
3640 struct
3642 unsigned LATE : 3;
3643 unsigned : 5;
3645 } __LATEbits_t;
3647 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
3649 #define _LATE0 0x01
3650 #define _LATE1 0x02
3651 #define _LATE2 0x04
3653 //==============================================================================
3656 //==============================================================================
3657 // PIE4 Bits
3659 extern __at(0x0F8E) __sfr PIE4;
3661 typedef struct
3663 unsigned CCP3IE : 1;
3664 unsigned CCP4IE : 1;
3665 unsigned CCP5IE : 1;
3666 unsigned CCP6IE : 1;
3667 unsigned CCP7IE : 1;
3668 unsigned CCP8IE : 1;
3669 unsigned CCP9IE : 1;
3670 unsigned CCP10IE : 1;
3671 } __PIE4bits_t;
3673 extern __at(0x0F8E) volatile __PIE4bits_t PIE4bits;
3675 #define _CCP3IE 0x01
3676 #define _CCP4IE 0x02
3677 #define _CCP5IE 0x04
3678 #define _CCP6IE 0x08
3679 #define _CCP7IE 0x10
3680 #define _CCP8IE 0x20
3681 #define _CCP9IE 0x40
3682 #define _CCP10IE 0x80
3684 //==============================================================================
3687 //==============================================================================
3688 // PIR4 Bits
3690 extern __at(0x0F8F) __sfr PIR4;
3692 typedef struct
3694 unsigned CCP3IF : 1;
3695 unsigned CCP4IF : 1;
3696 unsigned CCP5IF : 1;
3697 unsigned CCP6IF : 1;
3698 unsigned CCP7IF : 1;
3699 unsigned CCP8IF : 1;
3700 unsigned CCP9IF : 1;
3701 unsigned CCP10IF : 1;
3702 } __PIR4bits_t;
3704 extern __at(0x0F8F) volatile __PIR4bits_t PIR4bits;
3706 #define _CCP3IF 0x01
3707 #define _CCP4IF 0x02
3708 #define _CCP5IF 0x04
3709 #define _CCP6IF 0x08
3710 #define _CCP7IF 0x10
3711 #define _CCP8IF 0x20
3712 #define _CCP9IF 0x40
3713 #define _CCP10IF 0x80
3715 //==============================================================================
3718 //==============================================================================
3719 // IPR4 Bits
3721 extern __at(0x0F90) __sfr IPR4;
3723 typedef struct
3725 unsigned CCP3IP : 1;
3726 unsigned CCP4IP : 1;
3727 unsigned CCP5IP : 1;
3728 unsigned CCP6IP : 1;
3729 unsigned CCP7IP : 1;
3730 unsigned CCP8IP : 1;
3731 unsigned CCP9IP : 1;
3732 unsigned CCP10IP : 1;
3733 } __IPR4bits_t;
3735 extern __at(0x0F90) volatile __IPR4bits_t IPR4bits;
3737 #define _CCP3IP 0x01
3738 #define _CCP4IP 0x02
3739 #define _CCP5IP 0x04
3740 #define _CCP6IP 0x08
3741 #define _CCP7IP 0x10
3742 #define _CCP8IP 0x20
3743 #define _CCP9IP 0x40
3744 #define _CCP10IP 0x80
3746 //==============================================================================
3749 //==============================================================================
3750 // PIE5 Bits
3752 extern __at(0x0F91) __sfr PIE5;
3754 typedef struct
3756 unsigned TMR1GIE : 1;
3757 unsigned TMR5GIE : 1;
3758 unsigned TMR5IE : 1;
3759 unsigned TMR6IE : 1;
3760 unsigned TMR8IE : 1;
3761 unsigned CM3IE : 1;
3762 unsigned : 1;
3763 unsigned : 1;
3764 } __PIE5bits_t;
3766 extern __at(0x0F91) volatile __PIE5bits_t PIE5bits;
3768 #define _TMR1GIE 0x01
3769 #define _TMR5GIE 0x02
3770 #define _TMR5IE 0x04
3771 #define _TMR6IE 0x08
3772 #define _TMR8IE 0x10
3773 #define _CM3IE 0x20
3775 //==============================================================================
3778 //==============================================================================
3779 // TRISA Bits
3781 extern __at(0x0F92) __sfr TRISA;
3783 typedef struct
3785 unsigned TRISA0 : 1;
3786 unsigned TRISA1 : 1;
3787 unsigned TRISA2 : 1;
3788 unsigned TRISA3 : 1;
3789 unsigned : 1;
3790 unsigned TRISA5 : 1;
3791 unsigned TRISA6 : 1;
3792 unsigned TRISA7 : 1;
3793 } __TRISAbits_t;
3795 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
3797 #define _TRISA0 0x01
3798 #define _TRISA1 0x02
3799 #define _TRISA2 0x04
3800 #define _TRISA3 0x08
3801 #define _TRISA5 0x20
3802 #define _TRISA6 0x40
3803 #define _TRISA7 0x80
3805 //==============================================================================
3808 //==============================================================================
3809 // TRISB Bits
3811 extern __at(0x0F93) __sfr TRISB;
3813 typedef struct
3815 unsigned TRISB0 : 1;
3816 unsigned TRISB1 : 1;
3817 unsigned TRISB2 : 1;
3818 unsigned TRISB3 : 1;
3819 unsigned TRISB4 : 1;
3820 unsigned TRISB5 : 1;
3821 unsigned TRISB6 : 1;
3822 unsigned TRISB7 : 1;
3823 } __TRISBbits_t;
3825 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3827 #define _TRISB0 0x01
3828 #define _TRISB1 0x02
3829 #define _TRISB2 0x04
3830 #define _TRISB3 0x08
3831 #define _TRISB4 0x10
3832 #define _TRISB5 0x20
3833 #define _TRISB6 0x40
3834 #define _TRISB7 0x80
3836 //==============================================================================
3839 //==============================================================================
3840 // TRISC Bits
3842 extern __at(0x0F94) __sfr TRISC;
3844 typedef struct
3846 unsigned TRISC0 : 1;
3847 unsigned TRISC1 : 1;
3848 unsigned TRISC2 : 1;
3849 unsigned TRISC3 : 1;
3850 unsigned TRISC4 : 1;
3851 unsigned TRISC5 : 1;
3852 unsigned TRISC6 : 1;
3853 unsigned TRISC7 : 1;
3854 } __TRISCbits_t;
3856 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3858 #define _TRISC0 0x01
3859 #define _TRISC1 0x02
3860 #define _TRISC2 0x04
3861 #define _TRISC3 0x08
3862 #define _TRISC4 0x10
3863 #define _TRISC5 0x20
3864 #define _TRISC6 0x40
3865 #define _TRISC7 0x80
3867 //==============================================================================
3870 //==============================================================================
3871 // TRISD Bits
3873 extern __at(0x0F95) __sfr TRISD;
3875 typedef struct
3877 unsigned TRISD0 : 1;
3878 unsigned TRISD1 : 1;
3879 unsigned TRISD2 : 1;
3880 unsigned TRISD3 : 1;
3881 unsigned TRISD4 : 1;
3882 unsigned TRISD5 : 1;
3883 unsigned TRISD6 : 1;
3884 unsigned TRISD7 : 1;
3885 } __TRISDbits_t;
3887 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
3889 #define _TRISD0 0x01
3890 #define _TRISD1 0x02
3891 #define _TRISD2 0x04
3892 #define _TRISD3 0x08
3893 #define _TRISD4 0x10
3894 #define _TRISD5 0x20
3895 #define _TRISD6 0x40
3896 #define _TRISD7 0x80
3898 //==============================================================================
3901 //==============================================================================
3902 // TRISE Bits
3904 extern __at(0x0F96) __sfr TRISE;
3906 typedef union
3908 struct
3910 unsigned TRISE0 : 1;
3911 unsigned TRISE1 : 1;
3912 unsigned TRISE2 : 1;
3913 unsigned : 1;
3914 unsigned : 1;
3915 unsigned : 1;
3916 unsigned REPU : 1;
3917 unsigned RDPU : 1;
3920 struct
3922 unsigned TRISE : 3;
3923 unsigned : 5;
3925 } __TRISEbits_t;
3927 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
3929 #define _TRISE0 0x01
3930 #define _TRISE1 0x02
3931 #define _TRISE2 0x04
3932 #define _REPU 0x40
3933 #define _RDPU 0x80
3935 //==============================================================================
3938 //==============================================================================
3939 // T3GCON Bits
3941 extern __at(0x0F97) __sfr T3GCON;
3943 typedef union
3945 struct
3947 unsigned T3GSS0 : 1;
3948 unsigned T3GSS1 : 1;
3949 unsigned T3GVAL : 1;
3950 unsigned T3GGO_T3DONE : 1;
3951 unsigned T3GSPM : 1;
3952 unsigned T3GTM : 1;
3953 unsigned T3GPOL : 1;
3954 unsigned TMR3GE : 1;
3957 struct
3959 unsigned : 1;
3960 unsigned : 1;
3961 unsigned : 1;
3962 unsigned T3GGO : 1;
3963 unsigned : 1;
3964 unsigned : 1;
3965 unsigned : 1;
3966 unsigned : 1;
3969 struct
3971 unsigned : 1;
3972 unsigned : 1;
3973 unsigned : 1;
3974 unsigned T3DONE : 1;
3975 unsigned : 1;
3976 unsigned : 1;
3977 unsigned : 1;
3978 unsigned : 1;
3981 struct
3983 unsigned T3GSS : 2;
3984 unsigned : 6;
3986 } __T3GCONbits_t;
3988 extern __at(0x0F97) volatile __T3GCONbits_t T3GCONbits;
3990 #define _T3GSS0 0x01
3991 #define _T3GSS1 0x02
3992 #define _T3GVAL 0x04
3993 #define _T3GGO_T3DONE 0x08
3994 #define _T3GGO 0x08
3995 #define _T3DONE 0x08
3996 #define _T3GSPM 0x10
3997 #define _T3GTM 0x20
3998 #define _T3GPOL 0x40
3999 #define _TMR3GE 0x80
4001 //==============================================================================
4004 //==============================================================================
4005 // PIR5 Bits
4007 extern __at(0x0F98) __sfr PIR5;
4009 typedef struct
4011 unsigned TMR1GIF : 1;
4012 unsigned TMR5GIF : 1;
4013 unsigned TMR5IF : 1;
4014 unsigned TMR6IF : 1;
4015 unsigned TMR8IF : 1;
4016 unsigned CM3IF : 1;
4017 unsigned : 1;
4018 unsigned : 1;
4019 } __PIR5bits_t;
4021 extern __at(0x0F98) volatile __PIR5bits_t PIR5bits;
4023 #define _TMR1GIF 0x01
4024 #define _TMR5GIF 0x02
4025 #define _TMR5IF 0x04
4026 #define _TMR6IF 0x08
4027 #define _TMR8IF 0x10
4028 #define _CM3IF 0x20
4030 //==============================================================================
4033 //==============================================================================
4034 // IPR5 Bits
4036 extern __at(0x0F99) __sfr IPR5;
4038 typedef struct
4040 unsigned TMR1GIP : 1;
4041 unsigned TMR5GIP : 1;
4042 unsigned TMR5IP : 1;
4043 unsigned TMR6IP : 1;
4044 unsigned TMR8IP : 1;
4045 unsigned CM3IP : 1;
4046 unsigned : 1;
4047 unsigned : 1;
4048 } __IPR5bits_t;
4050 extern __at(0x0F99) volatile __IPR5bits_t IPR5bits;
4052 #define _TMR1GIP 0x01
4053 #define _TMR5GIP 0x02
4054 #define _TMR5IP 0x04
4055 #define _TMR6IP 0x08
4056 #define _TMR8IP 0x10
4057 #define _CM3IP 0x20
4059 //==============================================================================
4062 //==============================================================================
4063 // T1GCON Bits
4065 extern __at(0x0F9A) __sfr T1GCON;
4067 typedef union
4069 struct
4071 unsigned T1GSS0 : 1;
4072 unsigned T1GSS1 : 1;
4073 unsigned T1GVAL : 1;
4074 unsigned T1GGO_NOT_T1DONE : 1;
4075 unsigned T1GSPM : 1;
4076 unsigned T1GTM : 1;
4077 unsigned T1GPOL : 1;
4078 unsigned TMR1GE : 1;
4081 struct
4083 unsigned : 1;
4084 unsigned : 1;
4085 unsigned : 1;
4086 unsigned T1GGO : 1;
4087 unsigned : 1;
4088 unsigned : 1;
4089 unsigned : 1;
4090 unsigned : 1;
4093 struct
4095 unsigned : 1;
4096 unsigned : 1;
4097 unsigned : 1;
4098 unsigned NOT_T1DONE : 1;
4099 unsigned : 1;
4100 unsigned : 1;
4101 unsigned : 1;
4102 unsigned : 1;
4105 struct
4107 unsigned : 1;
4108 unsigned : 1;
4109 unsigned : 1;
4110 unsigned T1DONE : 1;
4111 unsigned : 1;
4112 unsigned : 1;
4113 unsigned : 1;
4114 unsigned : 1;
4117 struct
4119 unsigned T1GSS : 2;
4120 unsigned : 6;
4122 } __T1GCONbits_t;
4124 extern __at(0x0F9A) volatile __T1GCONbits_t T1GCONbits;
4126 #define _T1GSS0 0x01
4127 #define _T1GSS1 0x02
4128 #define _T1GVAL 0x04
4129 #define _T1GGO_NOT_T1DONE 0x08
4130 #define _T1GGO 0x08
4131 #define _NOT_T1DONE 0x08
4132 #define _T1DONE 0x08
4133 #define _T1GSPM 0x10
4134 #define _T1GTM 0x20
4135 #define _T1GPOL 0x40
4136 #define _TMR1GE 0x80
4138 //==============================================================================
4141 //==============================================================================
4142 // OSCTUNE Bits
4144 extern __at(0x0F9B) __sfr OSCTUNE;
4146 typedef union
4148 struct
4150 unsigned TUN0 : 1;
4151 unsigned TUN1 : 1;
4152 unsigned TUN2 : 1;
4153 unsigned TUN3 : 1;
4154 unsigned TUN4 : 1;
4155 unsigned TUN5 : 1;
4156 unsigned PLLEN : 1;
4157 unsigned INTSRC : 1;
4160 struct
4162 unsigned TUN : 6;
4163 unsigned : 2;
4165 } __OSCTUNEbits_t;
4167 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
4169 #define _TUN0 0x01
4170 #define _TUN1 0x02
4171 #define _TUN2 0x04
4172 #define _TUN3 0x08
4173 #define _TUN4 0x10
4174 #define _TUN5 0x20
4175 #define _PLLEN 0x40
4176 #define _INTSRC 0x80
4178 //==============================================================================
4181 //==============================================================================
4182 // RCSTA2 Bits
4184 extern __at(0x0F9C) __sfr RCSTA2;
4186 typedef union
4188 struct
4190 unsigned RX9D : 1;
4191 unsigned OERR : 1;
4192 unsigned FERR : 1;
4193 unsigned ADDEN : 1;
4194 unsigned CREN : 1;
4195 unsigned SREN : 1;
4196 unsigned RX9 : 1;
4197 unsigned SPEN : 1;
4200 struct
4202 unsigned RX9D2 : 1;
4203 unsigned OERR2 : 1;
4204 unsigned FERR2 : 1;
4205 unsigned ADDEN2 : 1;
4206 unsigned CREN2 : 1;
4207 unsigned SREN2 : 1;
4208 unsigned RX92 : 1;
4209 unsigned SPEN2 : 1;
4211 } __RCSTA2bits_t;
4213 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
4215 #define _RCSTA2_RX9D 0x01
4216 #define _RCSTA2_RX9D2 0x01
4217 #define _RCSTA2_OERR 0x02
4218 #define _RCSTA2_OERR2 0x02
4219 #define _RCSTA2_FERR 0x04
4220 #define _RCSTA2_FERR2 0x04
4221 #define _RCSTA2_ADDEN 0x08
4222 #define _RCSTA2_ADDEN2 0x08
4223 #define _RCSTA2_CREN 0x10
4224 #define _RCSTA2_CREN2 0x10
4225 #define _RCSTA2_SREN 0x20
4226 #define _RCSTA2_SREN2 0x20
4227 #define _RCSTA2_RX9 0x40
4228 #define _RCSTA2_RX92 0x40
4229 #define _RCSTA2_SPEN 0x80
4230 #define _RCSTA2_SPEN2 0x80
4232 //==============================================================================
4235 //==============================================================================
4236 // PIE1 Bits
4238 extern __at(0x0F9D) __sfr PIE1;
4240 typedef union
4242 struct
4244 unsigned TMR1IE : 1;
4245 unsigned TMR2IE : 1;
4246 unsigned CCP1IE : 1;
4247 unsigned SSP1IE : 1;
4248 unsigned TX1IE : 1;
4249 unsigned RC1IE : 1;
4250 unsigned ADIE : 1;
4251 unsigned PMPIE : 1;
4254 struct
4256 unsigned : 1;
4257 unsigned : 1;
4258 unsigned : 1;
4259 unsigned SSPIE : 1;
4260 unsigned TXIE : 1;
4261 unsigned RCIE : 1;
4262 unsigned : 1;
4263 unsigned : 1;
4265 } __PIE1bits_t;
4267 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
4269 #define _TMR1IE 0x01
4270 #define _TMR2IE 0x02
4271 #define _CCP1IE 0x04
4272 #define _SSP1IE 0x08
4273 #define _SSPIE 0x08
4274 #define _TX1IE 0x10
4275 #define _TXIE 0x10
4276 #define _RC1IE 0x20
4277 #define _RCIE 0x20
4278 #define _ADIE 0x40
4279 #define _PMPIE 0x80
4281 //==============================================================================
4284 //==============================================================================
4285 // PIR1 Bits
4287 extern __at(0x0F9E) __sfr PIR1;
4289 typedef union
4291 struct
4293 unsigned TMR1IF : 1;
4294 unsigned TMR2IF : 1;
4295 unsigned CCP1IF : 1;
4296 unsigned SSP1IF : 1;
4297 unsigned TX1IF : 1;
4298 unsigned RC1IF : 1;
4299 unsigned ADIF : 1;
4300 unsigned PMPIF : 1;
4303 struct
4305 unsigned : 1;
4306 unsigned : 1;
4307 unsigned : 1;
4308 unsigned SSPIF : 1;
4309 unsigned TXIF : 1;
4310 unsigned RCIF : 1;
4311 unsigned : 1;
4312 unsigned : 1;
4314 } __PIR1bits_t;
4316 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4318 #define _TMR1IF 0x01
4319 #define _TMR2IF 0x02
4320 #define _CCP1IF 0x04
4321 #define _SSP1IF 0x08
4322 #define _SSPIF 0x08
4323 #define _TX1IF 0x10
4324 #define _TXIF 0x10
4325 #define _RC1IF 0x20
4326 #define _RCIF 0x20
4327 #define _ADIF 0x40
4328 #define _PMPIF 0x80
4330 //==============================================================================
4333 //==============================================================================
4334 // IPR1 Bits
4336 extern __at(0x0F9F) __sfr IPR1;
4338 typedef union
4340 struct
4342 unsigned TMR1IP : 1;
4343 unsigned TMR2IP : 1;
4344 unsigned CCP1IP : 1;
4345 unsigned SSP1IP : 1;
4346 unsigned TX1IP : 1;
4347 unsigned RC1IP : 1;
4348 unsigned ADIP : 1;
4349 unsigned PMPIP : 1;
4352 struct
4354 unsigned : 1;
4355 unsigned : 1;
4356 unsigned : 1;
4357 unsigned SSPIP : 1;
4358 unsigned TXIP : 1;
4359 unsigned RCIP : 1;
4360 unsigned : 1;
4361 unsigned : 1;
4363 } __IPR1bits_t;
4365 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4367 #define _TMR1IP 0x01
4368 #define _TMR2IP 0x02
4369 #define _CCP1IP 0x04
4370 #define _SSP1IP 0x08
4371 #define _SSPIP 0x08
4372 #define _TX1IP 0x10
4373 #define _TXIP 0x10
4374 #define _RC1IP 0x20
4375 #define _RCIP 0x20
4376 #define _ADIP 0x40
4377 #define _PMPIP 0x80
4379 //==============================================================================
4382 //==============================================================================
4383 // PIE2 Bits
4385 extern __at(0x0FA0) __sfr PIE2;
4387 typedef union
4389 struct
4391 unsigned CCP2IE : 1;
4392 unsigned TMR3IE : 1;
4393 unsigned LVDIE : 1;
4394 unsigned BCL1IE : 1;
4395 unsigned : 1;
4396 unsigned CM1IE : 1;
4397 unsigned CM2IE : 1;
4398 unsigned OSCFIE : 1;
4401 struct
4403 unsigned : 1;
4404 unsigned : 1;
4405 unsigned HLVDIE : 1;
4406 unsigned BCLIE : 1;
4407 unsigned : 1;
4408 unsigned : 1;
4409 unsigned : 1;
4410 unsigned : 1;
4412 } __PIE2bits_t;
4414 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4416 #define _CCP2IE 0x01
4417 #define _TMR3IE 0x02
4418 #define _LVDIE 0x04
4419 #define _HLVDIE 0x04
4420 #define _BCL1IE 0x08
4421 #define _BCLIE 0x08
4422 #define _CM1IE 0x20
4423 #define _CM2IE 0x40
4424 #define _OSCFIE 0x80
4426 //==============================================================================
4429 //==============================================================================
4430 // PIR2 Bits
4432 extern __at(0x0FA1) __sfr PIR2;
4434 typedef union
4436 struct
4438 unsigned CCP2IF : 1;
4439 unsigned TMR3IF : 1;
4440 unsigned LVDIF : 1;
4441 unsigned BCL1IF : 1;
4442 unsigned : 1;
4443 unsigned CM1IF : 1;
4444 unsigned CM2IF : 1;
4445 unsigned OSCFIF : 1;
4448 struct
4450 unsigned : 1;
4451 unsigned : 1;
4452 unsigned HLVDIF : 1;
4453 unsigned BCLIF : 1;
4454 unsigned : 1;
4455 unsigned : 1;
4456 unsigned : 1;
4457 unsigned : 1;
4459 } __PIR2bits_t;
4461 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4463 #define _CCP2IF 0x01
4464 #define _TMR3IF 0x02
4465 #define _LVDIF 0x04
4466 #define _HLVDIF 0x04
4467 #define _BCL1IF 0x08
4468 #define _BCLIF 0x08
4469 #define _CM1IF 0x20
4470 #define _CM2IF 0x40
4471 #define _OSCFIF 0x80
4473 //==============================================================================
4476 //==============================================================================
4477 // IPR2 Bits
4479 extern __at(0x0FA2) __sfr IPR2;
4481 typedef union
4483 struct
4485 unsigned CCP2IP : 1;
4486 unsigned TMR3IP : 1;
4487 unsigned LVDIP : 1;
4488 unsigned BCL1IP : 1;
4489 unsigned : 1;
4490 unsigned CM1IP : 1;
4491 unsigned CM2IP : 1;
4492 unsigned OSCFIP : 1;
4495 struct
4497 unsigned : 1;
4498 unsigned : 1;
4499 unsigned HLVDIP : 1;
4500 unsigned BCLIP : 1;
4501 unsigned : 1;
4502 unsigned : 1;
4503 unsigned : 1;
4504 unsigned : 1;
4506 } __IPR2bits_t;
4508 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4510 #define _CCP2IP 0x01
4511 #define _TMR3IP 0x02
4512 #define _LVDIP 0x04
4513 #define _HLVDIP 0x04
4514 #define _BCL1IP 0x08
4515 #define _BCLIP 0x08
4516 #define _CM1IP 0x20
4517 #define _CM2IP 0x40
4518 #define _OSCFIP 0x80
4520 //==============================================================================
4523 //==============================================================================
4524 // PIE3 Bits
4526 extern __at(0x0FA3) __sfr PIE3;
4528 typedef struct
4530 unsigned RTCCIE : 1;
4531 unsigned TMR3GIE : 1;
4532 unsigned CTMUIE : 1;
4533 unsigned TMR4IE : 1;
4534 unsigned TX2IE : 1;
4535 unsigned RC2IE : 1;
4536 unsigned BCL2IE : 1;
4537 unsigned SSP2IE : 1;
4538 } __PIE3bits_t;
4540 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4542 #define _RTCCIE 0x01
4543 #define _TMR3GIE 0x02
4544 #define _CTMUIE 0x04
4545 #define _TMR4IE 0x08
4546 #define _TX2IE 0x10
4547 #define _RC2IE 0x20
4548 #define _BCL2IE 0x40
4549 #define _SSP2IE 0x80
4551 //==============================================================================
4554 //==============================================================================
4555 // PIR3 Bits
4557 extern __at(0x0FA4) __sfr PIR3;
4559 typedef struct
4561 unsigned RTCCIF : 1;
4562 unsigned TMR3GIF : 1;
4563 unsigned CTMUIF : 1;
4564 unsigned TMR4IF : 1;
4565 unsigned TX2IF : 1;
4566 unsigned RC2IF : 1;
4567 unsigned BCL2IF : 1;
4568 unsigned SSP2IF : 1;
4569 } __PIR3bits_t;
4571 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
4573 #define _RTCCIF 0x01
4574 #define _TMR3GIF 0x02
4575 #define _CTMUIF 0x04
4576 #define _TMR4IF 0x08
4577 #define _TX2IF 0x10
4578 #define _RC2IF 0x20
4579 #define _BCL2IF 0x40
4580 #define _SSP2IF 0x80
4582 //==============================================================================
4585 //==============================================================================
4586 // IPR3 Bits
4588 extern __at(0x0FA5) __sfr IPR3;
4590 typedef struct
4592 unsigned RTCCIP : 1;
4593 unsigned TMR3GIP : 1;
4594 unsigned CTMUIP : 1;
4595 unsigned TMR4IP : 1;
4596 unsigned TX2IP : 1;
4597 unsigned RC2IP : 1;
4598 unsigned BCL2IP : 1;
4599 unsigned SSP2IP : 1;
4600 } __IPR3bits_t;
4602 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4604 #define _RTCCIP 0x01
4605 #define _TMR3GIP 0x02
4606 #define _CTMUIP 0x04
4607 #define _TMR4IP 0x08
4608 #define _TX2IP 0x10
4609 #define _RC2IP 0x20
4610 #define _BCL2IP 0x40
4611 #define _SSP2IP 0x80
4613 //==============================================================================
4616 //==============================================================================
4617 // EECON1 Bits
4619 extern __at(0x0FA6) __sfr EECON1;
4621 typedef struct
4623 unsigned : 1;
4624 unsigned WR : 1;
4625 unsigned WREN : 1;
4626 unsigned WRERR : 1;
4627 unsigned FREE : 1;
4628 unsigned WPROG : 1;
4629 unsigned : 1;
4630 unsigned : 1;
4631 } __EECON1bits_t;
4633 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
4635 #define _WR 0x02
4636 #define _WREN 0x04
4637 #define _WRERR 0x08
4638 #define _FREE 0x10
4639 #define _WPROG 0x20
4641 //==============================================================================
4643 extern __at(0x0FA7) __sfr EECON2;
4645 //==============================================================================
4646 // TXSTA2 Bits
4648 extern __at(0x0FA8) __sfr TXSTA2;
4650 typedef union
4652 struct
4654 unsigned TX9D : 1;
4655 unsigned TRMT : 1;
4656 unsigned BRGH : 1;
4657 unsigned SENDB : 1;
4658 unsigned SYNC : 1;
4659 unsigned TXEN : 1;
4660 unsigned TX9 : 1;
4661 unsigned CSRC : 1;
4664 struct
4666 unsigned TX9D2 : 1;
4667 unsigned TRMT2 : 1;
4668 unsigned BRGH2 : 1;
4669 unsigned SENDB2 : 1;
4670 unsigned SYNC2 : 1;
4671 unsigned TXEN2 : 1;
4672 unsigned TX92 : 1;
4673 unsigned CSRC2 : 1;
4675 } __TXSTA2bits_t;
4677 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
4679 #define _TXSTA2_TX9D 0x01
4680 #define _TXSTA2_TX9D2 0x01
4681 #define _TXSTA2_TRMT 0x02
4682 #define _TXSTA2_TRMT2 0x02
4683 #define _TXSTA2_BRGH 0x04
4684 #define _TXSTA2_BRGH2 0x04
4685 #define _TXSTA2_SENDB 0x08
4686 #define _TXSTA2_SENDB2 0x08
4687 #define _TXSTA2_SYNC 0x10
4688 #define _TXSTA2_SYNC2 0x10
4689 #define _TXSTA2_TXEN 0x20
4690 #define _TXSTA2_TXEN2 0x20
4691 #define _TXSTA2_TX9 0x40
4692 #define _TXSTA2_TX92 0x40
4693 #define _TXSTA2_CSRC 0x80
4694 #define _TXSTA2_CSRC2 0x80
4696 //==============================================================================
4698 extern __at(0x0FA9) __sfr TXREG2;
4699 extern __at(0x0FAA) __sfr RCREG2;
4700 extern __at(0x0FAB) __sfr SPBRG2;
4702 //==============================================================================
4703 // RCSTA Bits
4705 extern __at(0x0FAC) __sfr RCSTA;
4707 typedef union
4709 struct
4711 unsigned RX9D : 1;
4712 unsigned OERR : 1;
4713 unsigned FERR : 1;
4714 unsigned ADDEN : 1;
4715 unsigned CREN : 1;
4716 unsigned SREN : 1;
4717 unsigned RX9 : 1;
4718 unsigned SPEN : 1;
4721 struct
4723 unsigned RCD8 : 1;
4724 unsigned OERR1 : 1;
4725 unsigned FERR1 : 1;
4726 unsigned ADEN : 1;
4727 unsigned CREN1 : 1;
4728 unsigned SREN1 : 1;
4729 unsigned RC9 : 1;
4730 unsigned SPEN1 : 1;
4733 struct
4735 unsigned RX9D1 : 1;
4736 unsigned : 1;
4737 unsigned : 1;
4738 unsigned ADDEN1 : 1;
4739 unsigned : 1;
4740 unsigned : 1;
4741 unsigned NOT_RC8 : 1;
4742 unsigned : 1;
4745 struct
4747 unsigned : 1;
4748 unsigned : 1;
4749 unsigned : 1;
4750 unsigned : 1;
4751 unsigned : 1;
4752 unsigned : 1;
4753 unsigned RC8_9 : 1;
4754 unsigned : 1;
4757 struct
4759 unsigned : 1;
4760 unsigned : 1;
4761 unsigned : 1;
4762 unsigned : 1;
4763 unsigned : 1;
4764 unsigned : 1;
4765 unsigned RX91 : 1;
4766 unsigned : 1;
4768 } __RCSTAbits_t;
4770 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
4772 #define _RX9D 0x01
4773 #define _RCD8 0x01
4774 #define _RX9D1 0x01
4775 #define _OERR 0x02
4776 #define _OERR1 0x02
4777 #define _FERR 0x04
4778 #define _FERR1 0x04
4779 #define _ADDEN 0x08
4780 #define _ADEN 0x08
4781 #define _ADDEN1 0x08
4782 #define _CREN 0x10
4783 #define _CREN1 0x10
4784 #define _SREN 0x20
4785 #define _SREN1 0x20
4786 #define _RX9 0x40
4787 #define _RC9 0x40
4788 #define _NOT_RC8 0x40
4789 #define _RC8_9 0x40
4790 #define _RX91 0x40
4791 #define _SPEN 0x80
4792 #define _SPEN1 0x80
4794 //==============================================================================
4797 //==============================================================================
4798 // RCSTA1 Bits
4800 extern __at(0x0FAC) __sfr RCSTA1;
4802 typedef union
4804 struct
4806 unsigned RX9D : 1;
4807 unsigned OERR : 1;
4808 unsigned FERR : 1;
4809 unsigned ADDEN : 1;
4810 unsigned CREN : 1;
4811 unsigned SREN : 1;
4812 unsigned RX9 : 1;
4813 unsigned SPEN : 1;
4816 struct
4818 unsigned RCD8 : 1;
4819 unsigned OERR1 : 1;
4820 unsigned FERR1 : 1;
4821 unsigned ADEN : 1;
4822 unsigned CREN1 : 1;
4823 unsigned SREN1 : 1;
4824 unsigned RC9 : 1;
4825 unsigned SPEN1 : 1;
4828 struct
4830 unsigned RX9D1 : 1;
4831 unsigned : 1;
4832 unsigned : 1;
4833 unsigned ADDEN1 : 1;
4834 unsigned : 1;
4835 unsigned : 1;
4836 unsigned NOT_RC8 : 1;
4837 unsigned : 1;
4840 struct
4842 unsigned : 1;
4843 unsigned : 1;
4844 unsigned : 1;
4845 unsigned : 1;
4846 unsigned : 1;
4847 unsigned : 1;
4848 unsigned RC8_9 : 1;
4849 unsigned : 1;
4852 struct
4854 unsigned : 1;
4855 unsigned : 1;
4856 unsigned : 1;
4857 unsigned : 1;
4858 unsigned : 1;
4859 unsigned : 1;
4860 unsigned RX91 : 1;
4861 unsigned : 1;
4863 } __RCSTA1bits_t;
4865 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
4867 #define _RCSTA1_RX9D 0x01
4868 #define _RCSTA1_RCD8 0x01
4869 #define _RCSTA1_RX9D1 0x01
4870 #define _RCSTA1_OERR 0x02
4871 #define _RCSTA1_OERR1 0x02
4872 #define _RCSTA1_FERR 0x04
4873 #define _RCSTA1_FERR1 0x04
4874 #define _RCSTA1_ADDEN 0x08
4875 #define _RCSTA1_ADEN 0x08
4876 #define _RCSTA1_ADDEN1 0x08
4877 #define _RCSTA1_CREN 0x10
4878 #define _RCSTA1_CREN1 0x10
4879 #define _RCSTA1_SREN 0x20
4880 #define _RCSTA1_SREN1 0x20
4881 #define _RCSTA1_RX9 0x40
4882 #define _RCSTA1_RC9 0x40
4883 #define _RCSTA1_NOT_RC8 0x40
4884 #define _RCSTA1_RC8_9 0x40
4885 #define _RCSTA1_RX91 0x40
4886 #define _RCSTA1_SPEN 0x80
4887 #define _RCSTA1_SPEN1 0x80
4889 //==============================================================================
4892 //==============================================================================
4893 // TXSTA Bits
4895 extern __at(0x0FAD) __sfr TXSTA;
4897 typedef union
4899 struct
4901 unsigned TX9D : 1;
4902 unsigned TRMT : 1;
4903 unsigned BRGH : 1;
4904 unsigned SENDB : 1;
4905 unsigned SYNC : 1;
4906 unsigned TXEN : 1;
4907 unsigned TX9 : 1;
4908 unsigned CSRC : 1;
4911 struct
4913 unsigned TXD8 : 1;
4914 unsigned TRMT1 : 1;
4915 unsigned BRGH1 : 1;
4916 unsigned SENDB1 : 1;
4917 unsigned SYNC1 : 1;
4918 unsigned TXEN1 : 1;
4919 unsigned TX8_9 : 1;
4920 unsigned CSRC1 : 1;
4923 struct
4925 unsigned TX9D1 : 1;
4926 unsigned : 1;
4927 unsigned : 1;
4928 unsigned : 1;
4929 unsigned : 1;
4930 unsigned : 1;
4931 unsigned NOT_TX8 : 1;
4932 unsigned : 1;
4935 struct
4937 unsigned : 1;
4938 unsigned : 1;
4939 unsigned : 1;
4940 unsigned : 1;
4941 unsigned : 1;
4942 unsigned : 1;
4943 unsigned TX91 : 1;
4944 unsigned : 1;
4946 } __TXSTAbits_t;
4948 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
4950 #define _TX9D 0x01
4951 #define _TXD8 0x01
4952 #define _TX9D1 0x01
4953 #define _TRMT 0x02
4954 #define _TRMT1 0x02
4955 #define _BRGH 0x04
4956 #define _BRGH1 0x04
4957 #define _SENDB 0x08
4958 #define _SENDB1 0x08
4959 #define _SYNC 0x10
4960 #define _SYNC1 0x10
4961 #define _TXEN 0x20
4962 #define _TXEN1 0x20
4963 #define _TX9 0x40
4964 #define _TX8_9 0x40
4965 #define _NOT_TX8 0x40
4966 #define _TX91 0x40
4967 #define _CSRC 0x80
4968 #define _CSRC1 0x80
4970 //==============================================================================
4973 //==============================================================================
4974 // TXSTA1 Bits
4976 extern __at(0x0FAD) __sfr TXSTA1;
4978 typedef union
4980 struct
4982 unsigned TX9D : 1;
4983 unsigned TRMT : 1;
4984 unsigned BRGH : 1;
4985 unsigned SENDB : 1;
4986 unsigned SYNC : 1;
4987 unsigned TXEN : 1;
4988 unsigned TX9 : 1;
4989 unsigned CSRC : 1;
4992 struct
4994 unsigned TXD8 : 1;
4995 unsigned TRMT1 : 1;
4996 unsigned BRGH1 : 1;
4997 unsigned SENDB1 : 1;
4998 unsigned SYNC1 : 1;
4999 unsigned TXEN1 : 1;
5000 unsigned TX8_9 : 1;
5001 unsigned CSRC1 : 1;
5004 struct
5006 unsigned TX9D1 : 1;
5007 unsigned : 1;
5008 unsigned : 1;
5009 unsigned : 1;
5010 unsigned : 1;
5011 unsigned : 1;
5012 unsigned NOT_TX8 : 1;
5013 unsigned : 1;
5016 struct
5018 unsigned : 1;
5019 unsigned : 1;
5020 unsigned : 1;
5021 unsigned : 1;
5022 unsigned : 1;
5023 unsigned : 1;
5024 unsigned TX91 : 1;
5025 unsigned : 1;
5027 } __TXSTA1bits_t;
5029 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
5031 #define _TXSTA1_TX9D 0x01
5032 #define _TXSTA1_TXD8 0x01
5033 #define _TXSTA1_TX9D1 0x01
5034 #define _TXSTA1_TRMT 0x02
5035 #define _TXSTA1_TRMT1 0x02
5036 #define _TXSTA1_BRGH 0x04
5037 #define _TXSTA1_BRGH1 0x04
5038 #define _TXSTA1_SENDB 0x08
5039 #define _TXSTA1_SENDB1 0x08
5040 #define _TXSTA1_SYNC 0x10
5041 #define _TXSTA1_SYNC1 0x10
5042 #define _TXSTA1_TXEN 0x20
5043 #define _TXSTA1_TXEN1 0x20
5044 #define _TXSTA1_TX9 0x40
5045 #define _TXSTA1_TX8_9 0x40
5046 #define _TXSTA1_NOT_TX8 0x40
5047 #define _TXSTA1_TX91 0x40
5048 #define _TXSTA1_CSRC 0x80
5049 #define _TXSTA1_CSRC1 0x80
5051 //==============================================================================
5053 extern __at(0x0FAE) __sfr TXREG;
5054 extern __at(0x0FAE) __sfr TXREG1;
5055 extern __at(0x0FAF) __sfr RCREG;
5056 extern __at(0x0FAF) __sfr RCREG1;
5057 extern __at(0x0FB0) __sfr SPBRG;
5058 extern __at(0x0FB0) __sfr SPBRG1;
5060 //==============================================================================
5061 // CTMUICON Bits
5063 extern __at(0x0FB1) __sfr CTMUICON;
5065 typedef union
5067 struct
5069 unsigned IRNG0 : 1;
5070 unsigned IRNG1 : 1;
5071 unsigned ITRIM0 : 1;
5072 unsigned ITRIM1 : 1;
5073 unsigned ITRIM2 : 1;
5074 unsigned ITRIM3 : 1;
5075 unsigned ITRIM4 : 1;
5076 unsigned ITRIM5 : 1;
5079 struct
5081 unsigned IRNG : 2;
5082 unsigned : 6;
5085 struct
5087 unsigned : 2;
5088 unsigned ITRIM : 6;
5090 } __CTMUICONbits_t;
5092 extern __at(0x0FB1) volatile __CTMUICONbits_t CTMUICONbits;
5094 #define _IRNG0 0x01
5095 #define _IRNG1 0x02
5096 #define _ITRIM0 0x04
5097 #define _ITRIM1 0x08
5098 #define _ITRIM2 0x10
5099 #define _ITRIM3 0x20
5100 #define _ITRIM4 0x40
5101 #define _ITRIM5 0x80
5103 //==============================================================================
5106 //==============================================================================
5107 // CTMUCONL Bits
5109 extern __at(0x0FB2) __sfr CTMUCONL;
5111 typedef union
5113 struct
5115 unsigned EDG1STAT : 1;
5116 unsigned EDG2STAT : 1;
5117 unsigned EDG1SEL0 : 1;
5118 unsigned EDG1SEL1 : 1;
5119 unsigned EDG1POL : 1;
5120 unsigned EDG2SEL0 : 1;
5121 unsigned EDG2SEL1 : 1;
5122 unsigned EDG2POL : 1;
5125 struct
5127 unsigned : 2;
5128 unsigned EDG1SEL : 2;
5129 unsigned : 4;
5132 struct
5134 unsigned : 5;
5135 unsigned EDG2SEL : 2;
5136 unsigned : 1;
5138 } __CTMUCONLbits_t;
5140 extern __at(0x0FB2) volatile __CTMUCONLbits_t CTMUCONLbits;
5142 #define _EDG1STAT 0x01
5143 #define _EDG2STAT 0x02
5144 #define _EDG1SEL0 0x04
5145 #define _EDG1SEL1 0x08
5146 #define _EDG1POL 0x10
5147 #define _EDG2SEL0 0x20
5148 #define _EDG2SEL1 0x40
5149 #define _EDG2POL 0x80
5151 //==============================================================================
5154 //==============================================================================
5155 // CTMUCONH Bits
5157 extern __at(0x0FB3) __sfr CTMUCONH;
5159 typedef struct
5161 unsigned CTTRIG : 1;
5162 unsigned IDISSEN : 1;
5163 unsigned EDGSEQEN : 1;
5164 unsigned EDGEN : 1;
5165 unsigned TGEN : 1;
5166 unsigned CTMUSIDL : 1;
5167 unsigned : 1;
5168 unsigned CTMUEN : 1;
5169 } __CTMUCONHbits_t;
5171 extern __at(0x0FB3) volatile __CTMUCONHbits_t CTMUCONHbits;
5173 #define _CTTRIG 0x01
5174 #define _IDISSEN 0x02
5175 #define _EDGSEQEN 0x04
5176 #define _EDGEN 0x08
5177 #define _TGEN 0x10
5178 #define _CTMUSIDL 0x20
5179 #define _CTMUEN 0x80
5181 //==============================================================================
5184 //==============================================================================
5185 // CCP2CON Bits
5187 extern __at(0x0FB4) __sfr CCP2CON;
5189 typedef union
5191 struct
5193 unsigned CCP2M0 : 1;
5194 unsigned CCP2M1 : 1;
5195 unsigned CCP2M2 : 1;
5196 unsigned CCP2M3 : 1;
5197 unsigned DC2B0 : 1;
5198 unsigned DC2B1 : 1;
5199 unsigned P2M0 : 1;
5200 unsigned P2M1 : 1;
5203 struct
5205 unsigned : 1;
5206 unsigned : 1;
5207 unsigned : 1;
5208 unsigned : 1;
5209 unsigned CCP2Y : 1;
5210 unsigned CCP2X : 1;
5211 unsigned : 1;
5212 unsigned : 1;
5215 struct
5217 unsigned CCP2M : 4;
5218 unsigned : 4;
5221 struct
5223 unsigned : 4;
5224 unsigned DC2B : 2;
5225 unsigned : 2;
5228 struct
5230 unsigned : 6;
5231 unsigned P2M : 2;
5233 } __CCP2CONbits_t;
5235 extern __at(0x0FB4) volatile __CCP2CONbits_t CCP2CONbits;
5237 #define _CCP2M0 0x01
5238 #define _CCP2M1 0x02
5239 #define _CCP2M2 0x04
5240 #define _CCP2M3 0x08
5241 #define _DC2B0 0x10
5242 #define _CCP2Y 0x10
5243 #define _DC2B1 0x20
5244 #define _CCP2X 0x20
5245 #define _P2M0 0x40
5246 #define _P2M1 0x80
5248 //==============================================================================
5251 //==============================================================================
5252 // ECCP2CON Bits
5254 extern __at(0x0FB4) __sfr ECCP2CON;
5256 typedef union
5258 struct
5260 unsigned CCP2M0 : 1;
5261 unsigned CCP2M1 : 1;
5262 unsigned CCP2M2 : 1;
5263 unsigned CCP2M3 : 1;
5264 unsigned DC2B0 : 1;
5265 unsigned DC2B1 : 1;
5266 unsigned P2M0 : 1;
5267 unsigned P2M1 : 1;
5270 struct
5272 unsigned : 1;
5273 unsigned : 1;
5274 unsigned : 1;
5275 unsigned : 1;
5276 unsigned CCP2Y : 1;
5277 unsigned CCP2X : 1;
5278 unsigned : 1;
5279 unsigned : 1;
5282 struct
5284 unsigned CCP2M : 4;
5285 unsigned : 4;
5288 struct
5290 unsigned : 4;
5291 unsigned DC2B : 2;
5292 unsigned : 2;
5295 struct
5297 unsigned : 6;
5298 unsigned P2M : 2;
5300 } __ECCP2CONbits_t;
5302 extern __at(0x0FB4) volatile __ECCP2CONbits_t ECCP2CONbits;
5304 #define _ECCP2CON_CCP2M0 0x01
5305 #define _ECCP2CON_CCP2M1 0x02
5306 #define _ECCP2CON_CCP2M2 0x04
5307 #define _ECCP2CON_CCP2M3 0x08
5308 #define _ECCP2CON_DC2B0 0x10
5309 #define _ECCP2CON_CCP2Y 0x10
5310 #define _ECCP2CON_DC2B1 0x20
5311 #define _ECCP2CON_CCP2X 0x20
5312 #define _ECCP2CON_P2M0 0x40
5313 #define _ECCP2CON_P2M1 0x80
5315 //==============================================================================
5317 extern __at(0x0FB5) __sfr CCPR2;
5318 extern __at(0x0FB5) __sfr CCPR2L;
5319 extern __at(0x0FB6) __sfr CCPR2H;
5321 //==============================================================================
5322 // ECCP2DEL Bits
5324 extern __at(0x0FB7) __sfr ECCP2DEL;
5326 typedef union
5328 struct
5330 unsigned P2DC0 : 1;
5331 unsigned P2DC1 : 1;
5332 unsigned P2DC2 : 1;
5333 unsigned P2DC3 : 1;
5334 unsigned P2DC4 : 1;
5335 unsigned P2DC5 : 1;
5336 unsigned P2DC6 : 1;
5337 unsigned P2RSEN : 1;
5340 struct
5342 unsigned P2DC : 7;
5343 unsigned : 1;
5345 } __ECCP2DELbits_t;
5347 extern __at(0x0FB7) volatile __ECCP2DELbits_t ECCP2DELbits;
5349 #define _P2DC0 0x01
5350 #define _P2DC1 0x02
5351 #define _P2DC2 0x04
5352 #define _P2DC3 0x08
5353 #define _P2DC4 0x10
5354 #define _P2DC5 0x20
5355 #define _P2DC6 0x40
5356 #define _P2RSEN 0x80
5358 //==============================================================================
5361 //==============================================================================
5362 // PWM2CON Bits
5364 extern __at(0x0FB7) __sfr PWM2CON;
5366 typedef union
5368 struct
5370 unsigned P2DC0 : 1;
5371 unsigned P2DC1 : 1;
5372 unsigned P2DC2 : 1;
5373 unsigned P2DC3 : 1;
5374 unsigned P2DC4 : 1;
5375 unsigned P2DC5 : 1;
5376 unsigned P2DC6 : 1;
5377 unsigned P2RSEN : 1;
5380 struct
5382 unsigned P2DC : 7;
5383 unsigned : 1;
5385 } __PWM2CONbits_t;
5387 extern __at(0x0FB7) volatile __PWM2CONbits_t PWM2CONbits;
5389 #define _PWM2CON_P2DC0 0x01
5390 #define _PWM2CON_P2DC1 0x02
5391 #define _PWM2CON_P2DC2 0x04
5392 #define _PWM2CON_P2DC3 0x08
5393 #define _PWM2CON_P2DC4 0x10
5394 #define _PWM2CON_P2DC5 0x20
5395 #define _PWM2CON_P2DC6 0x40
5396 #define _PWM2CON_P2RSEN 0x80
5398 //==============================================================================
5401 //==============================================================================
5402 // ECCP2AS Bits
5404 extern __at(0x0FB8) __sfr ECCP2AS;
5406 typedef union
5408 struct
5410 unsigned PSS2BD0 : 1;
5411 unsigned PSS2BD1 : 1;
5412 unsigned PSS2AC0 : 1;
5413 unsigned PSS2AC1 : 1;
5414 unsigned ECCP2AS0 : 1;
5415 unsigned ECCP2AS1 : 1;
5416 unsigned ECCP2AS2 : 1;
5417 unsigned ECCP2ASE : 1;
5420 struct
5422 unsigned PSS2BD : 2;
5423 unsigned : 6;
5426 struct
5428 unsigned : 2;
5429 unsigned PSS2AC : 2;
5430 unsigned : 4;
5433 struct
5435 unsigned : 4;
5436 unsigned ECCP2AS : 3;
5437 unsigned : 1;
5439 } __ECCP2ASbits_t;
5441 extern __at(0x0FB8) volatile __ECCP2ASbits_t ECCP2ASbits;
5443 #define _PSS2BD0 0x01
5444 #define _PSS2BD1 0x02
5445 #define _PSS2AC0 0x04
5446 #define _PSS2AC1 0x08
5447 #define _ECCP2AS0 0x10
5448 #define _ECCP2AS1 0x20
5449 #define _ECCP2AS2 0x40
5450 #define _ECCP2ASE 0x80
5452 //==============================================================================
5455 //==============================================================================
5456 // PSTR2CON Bits
5458 extern __at(0x0FB9) __sfr PSTR2CON;
5460 typedef union
5462 struct
5464 unsigned STRA : 1;
5465 unsigned STRB : 1;
5466 unsigned STRC : 1;
5467 unsigned STRD : 1;
5468 unsigned STRSYNC : 1;
5469 unsigned P2DC5 : 1;
5470 unsigned CMPL0 : 1;
5471 unsigned CMPL1 : 1;
5474 struct
5476 unsigned P2DC0 : 1;
5477 unsigned P2DC1 : 1;
5478 unsigned P2DC2 : 1;
5479 unsigned P2DC3 : 1;
5480 unsigned P2DC4 : 1;
5481 unsigned : 1;
5482 unsigned P2DC6 : 1;
5483 unsigned : 1;
5486 struct
5488 unsigned P2DC : 7;
5489 unsigned : 1;
5492 struct
5494 unsigned : 6;
5495 unsigned CMPL : 2;
5497 } __PSTR2CONbits_t;
5499 extern __at(0x0FB9) volatile __PSTR2CONbits_t PSTR2CONbits;
5501 #define _PSTR2CON_STRA 0x01
5502 #define _PSTR2CON_P2DC0 0x01
5503 #define _PSTR2CON_STRB 0x02
5504 #define _PSTR2CON_P2DC1 0x02
5505 #define _PSTR2CON_STRC 0x04
5506 #define _PSTR2CON_P2DC2 0x04
5507 #define _PSTR2CON_STRD 0x08
5508 #define _PSTR2CON_P2DC3 0x08
5509 #define _PSTR2CON_STRSYNC 0x10
5510 #define _PSTR2CON_P2DC4 0x10
5511 #define _PSTR2CON_P2DC5 0x20
5512 #define _PSTR2CON_CMPL0 0x40
5513 #define _PSTR2CON_P2DC6 0x40
5514 #define _PSTR2CON_CMPL1 0x80
5516 //==============================================================================
5519 //==============================================================================
5520 // CCP1CON Bits
5522 extern __at(0x0FBA) __sfr CCP1CON;
5524 typedef union
5526 struct
5528 unsigned CCP1M0 : 1;
5529 unsigned CCP1M1 : 1;
5530 unsigned CCP1M2 : 1;
5531 unsigned CCP1M3 : 1;
5532 unsigned DC1B0 : 1;
5533 unsigned DC1B1 : 1;
5534 unsigned P1M0 : 1;
5535 unsigned P1M1 : 1;
5538 struct
5540 unsigned : 1;
5541 unsigned : 1;
5542 unsigned : 1;
5543 unsigned : 1;
5544 unsigned CCP1Y : 1;
5545 unsigned CCP1X : 1;
5546 unsigned : 1;
5547 unsigned : 1;
5550 struct
5552 unsigned CCP1M : 4;
5553 unsigned : 4;
5556 struct
5558 unsigned : 4;
5559 unsigned DC1B : 2;
5560 unsigned : 2;
5563 struct
5565 unsigned : 6;
5566 unsigned P1M : 2;
5568 } __CCP1CONbits_t;
5570 extern __at(0x0FBA) volatile __CCP1CONbits_t CCP1CONbits;
5572 #define _CCP1M0 0x01
5573 #define _CCP1M1 0x02
5574 #define _CCP1M2 0x04
5575 #define _CCP1M3 0x08
5576 #define _DC1B0 0x10
5577 #define _CCP1Y 0x10
5578 #define _DC1B1 0x20
5579 #define _CCP1X 0x20
5580 #define _P1M0 0x40
5581 #define _P1M1 0x80
5583 //==============================================================================
5586 //==============================================================================
5587 // ECCP1CON Bits
5589 extern __at(0x0FBA) __sfr ECCP1CON;
5591 typedef union
5593 struct
5595 unsigned CCP1M0 : 1;
5596 unsigned CCP1M1 : 1;
5597 unsigned CCP1M2 : 1;
5598 unsigned CCP1M3 : 1;
5599 unsigned DC1B0 : 1;
5600 unsigned DC1B1 : 1;
5601 unsigned P1M0 : 1;
5602 unsigned P1M1 : 1;
5605 struct
5607 unsigned : 1;
5608 unsigned : 1;
5609 unsigned : 1;
5610 unsigned : 1;
5611 unsigned CCP1Y : 1;
5612 unsigned CCP1X : 1;
5613 unsigned : 1;
5614 unsigned : 1;
5617 struct
5619 unsigned CCP1M : 4;
5620 unsigned : 4;
5623 struct
5625 unsigned : 4;
5626 unsigned DC1B : 2;
5627 unsigned : 2;
5630 struct
5632 unsigned : 6;
5633 unsigned P1M : 2;
5635 } __ECCP1CONbits_t;
5637 extern __at(0x0FBA) volatile __ECCP1CONbits_t ECCP1CONbits;
5639 #define _ECCP1CON_CCP1M0 0x01
5640 #define _ECCP1CON_CCP1M1 0x02
5641 #define _ECCP1CON_CCP1M2 0x04
5642 #define _ECCP1CON_CCP1M3 0x08
5643 #define _ECCP1CON_DC1B0 0x10
5644 #define _ECCP1CON_CCP1Y 0x10
5645 #define _ECCP1CON_DC1B1 0x20
5646 #define _ECCP1CON_CCP1X 0x20
5647 #define _ECCP1CON_P1M0 0x40
5648 #define _ECCP1CON_P1M1 0x80
5650 //==============================================================================
5652 extern __at(0x0FBB) __sfr CCPR1;
5653 extern __at(0x0FBB) __sfr CCPR1L;
5654 extern __at(0x0FBC) __sfr CCPR1H;
5656 //==============================================================================
5657 // ECCP1DEL Bits
5659 extern __at(0x0FBD) __sfr ECCP1DEL;
5661 typedef union
5663 struct
5665 unsigned P1DC0 : 1;
5666 unsigned P1DC1 : 1;
5667 unsigned P1DC2 : 1;
5668 unsigned P1DC3 : 1;
5669 unsigned P1DC4 : 1;
5670 unsigned P1DC5 : 1;
5671 unsigned P1DC6 : 1;
5672 unsigned P1RSEN : 1;
5675 struct
5677 unsigned P1DC : 7;
5678 unsigned : 1;
5680 } __ECCP1DELbits_t;
5682 extern __at(0x0FBD) volatile __ECCP1DELbits_t ECCP1DELbits;
5684 #define _P1DC0 0x01
5685 #define _P1DC1 0x02
5686 #define _P1DC2 0x04
5687 #define _P1DC3 0x08
5688 #define _P1DC4 0x10
5689 #define _P1DC5 0x20
5690 #define _P1DC6 0x40
5691 #define _P1RSEN 0x80
5693 //==============================================================================
5696 //==============================================================================
5697 // PWM1CON Bits
5699 extern __at(0x0FBD) __sfr PWM1CON;
5701 typedef union
5703 struct
5705 unsigned P1DC0 : 1;
5706 unsigned P1DC1 : 1;
5707 unsigned P1DC2 : 1;
5708 unsigned P1DC3 : 1;
5709 unsigned P1DC4 : 1;
5710 unsigned P1DC5 : 1;
5711 unsigned P1DC6 : 1;
5712 unsigned P1RSEN : 1;
5715 struct
5717 unsigned P1DC : 7;
5718 unsigned : 1;
5720 } __PWM1CONbits_t;
5722 extern __at(0x0FBD) volatile __PWM1CONbits_t PWM1CONbits;
5724 #define _PWM1CON_P1DC0 0x01
5725 #define _PWM1CON_P1DC1 0x02
5726 #define _PWM1CON_P1DC2 0x04
5727 #define _PWM1CON_P1DC3 0x08
5728 #define _PWM1CON_P1DC4 0x10
5729 #define _PWM1CON_P1DC5 0x20
5730 #define _PWM1CON_P1DC6 0x40
5731 #define _PWM1CON_P1RSEN 0x80
5733 //==============================================================================
5736 //==============================================================================
5737 // ECCP1AS Bits
5739 extern __at(0x0FBE) __sfr ECCP1AS;
5741 typedef union
5743 struct
5745 unsigned PSS1BD0 : 1;
5746 unsigned PSS1BD1 : 1;
5747 unsigned PSS1AC0 : 1;
5748 unsigned PSS1AC1 : 1;
5749 unsigned ECCP1AS0 : 1;
5750 unsigned ECCP1AS1 : 1;
5751 unsigned ECCP1AS2 : 1;
5752 unsigned ECCP1ASE : 1;
5755 struct
5757 unsigned PSS1BD : 2;
5758 unsigned : 6;
5761 struct
5763 unsigned : 2;
5764 unsigned PSS1AC : 2;
5765 unsigned : 4;
5768 struct
5770 unsigned : 4;
5771 unsigned ECCP1AS : 3;
5772 unsigned : 1;
5774 } __ECCP1ASbits_t;
5776 extern __at(0x0FBE) volatile __ECCP1ASbits_t ECCP1ASbits;
5778 #define _PSS1BD0 0x01
5779 #define _PSS1BD1 0x02
5780 #define _PSS1AC0 0x04
5781 #define _PSS1AC1 0x08
5782 #define _ECCP1AS0 0x10
5783 #define _ECCP1AS1 0x20
5784 #define _ECCP1AS2 0x40
5785 #define _ECCP1ASE 0x80
5787 //==============================================================================
5790 //==============================================================================
5791 // PSTR1CON Bits
5793 extern __at(0x0FBF) __sfr PSTR1CON;
5795 typedef union
5797 struct
5799 unsigned STRA : 1;
5800 unsigned STRB : 1;
5801 unsigned STRC : 1;
5802 unsigned STRD : 1;
5803 unsigned STRSYNC : 1;
5804 unsigned : 1;
5805 unsigned CMPL0 : 1;
5806 unsigned CMPL1 : 1;
5809 struct
5811 unsigned : 6;
5812 unsigned CMPL : 2;
5814 } __PSTR1CONbits_t;
5816 extern __at(0x0FBF) volatile __PSTR1CONbits_t PSTR1CONbits;
5818 #define _STRA 0x01
5819 #define _STRB 0x02
5820 #define _STRC 0x04
5821 #define _STRD 0x08
5822 #define _STRSYNC 0x10
5823 #define _CMPL0 0x40
5824 #define _CMPL1 0x80
5826 //==============================================================================
5829 //==============================================================================
5830 // WDTCON Bits
5832 extern __at(0x0FC0) __sfr WDTCON;
5834 typedef union
5836 struct
5838 unsigned SWDTEN : 1;
5839 unsigned ULPSINK : 1;
5840 unsigned ULPEN : 1;
5841 unsigned DS : 1;
5842 unsigned VBGOE : 1;
5843 unsigned ULPLVL : 1;
5844 unsigned LVDSTAT : 1;
5845 unsigned REGSLP : 1;
5848 struct
5850 unsigned SWDTE : 1;
5851 unsigned : 1;
5852 unsigned : 1;
5853 unsigned : 1;
5854 unsigned : 1;
5855 unsigned : 1;
5856 unsigned : 1;
5857 unsigned : 1;
5859 } __WDTCONbits_t;
5861 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
5863 #define _SWDTEN 0x01
5864 #define _SWDTE 0x01
5865 #define _ULPSINK 0x02
5866 #define _ULPEN 0x04
5867 #define _DS 0x08
5868 #define _VBGOE 0x10
5869 #define _ULPLVL 0x20
5870 #define _LVDSTAT 0x40
5871 #define _REGSLP 0x80
5873 //==============================================================================
5876 //==============================================================================
5877 // ADCON1 Bits
5879 extern __at(0x0FC1) __sfr ADCON1;
5881 typedef union
5883 struct
5885 unsigned ADCS0 : 1;
5886 unsigned ADCS1 : 1;
5887 unsigned ADCS2 : 1;
5888 unsigned ACQT0 : 1;
5889 unsigned ACQT1 : 1;
5890 unsigned ACQT2 : 1;
5891 unsigned ADCAL : 1;
5892 unsigned ADFM : 1;
5895 struct
5897 unsigned ADCS : 3;
5898 unsigned : 5;
5901 struct
5903 unsigned : 3;
5904 unsigned ACQT : 3;
5905 unsigned : 2;
5907 } __ADCON1bits_t;
5909 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5911 #define _ADCS0 0x01
5912 #define _ADCS1 0x02
5913 #define _ADCS2 0x04
5914 #define _ACQT0 0x08
5915 #define _ACQT1 0x10
5916 #define _ACQT2 0x20
5917 #define _ADCAL 0x40
5918 #define _ADFM 0x80
5920 //==============================================================================
5923 //==============================================================================
5924 // ADCON0 Bits
5926 extern __at(0x0FC2) __sfr ADCON0;
5928 typedef union
5930 struct
5932 unsigned ADON : 1;
5933 unsigned GO_NOT_DONE : 1;
5934 unsigned CHS0 : 1;
5935 unsigned CHS1 : 1;
5936 unsigned CHS2 : 1;
5937 unsigned CHS3 : 1;
5938 unsigned VCFG0 : 1;
5939 unsigned VCFG1 : 1;
5942 struct
5944 unsigned : 1;
5945 unsigned GO_DONE : 1;
5946 unsigned : 1;
5947 unsigned : 1;
5948 unsigned : 1;
5949 unsigned : 1;
5950 unsigned : 1;
5951 unsigned : 1;
5954 struct
5956 unsigned : 1;
5957 unsigned DONE : 1;
5958 unsigned : 1;
5959 unsigned : 1;
5960 unsigned : 1;
5961 unsigned : 1;
5962 unsigned : 1;
5963 unsigned : 1;
5966 struct
5968 unsigned : 1;
5969 unsigned GO : 1;
5970 unsigned : 1;
5971 unsigned : 1;
5972 unsigned : 1;
5973 unsigned : 1;
5974 unsigned : 1;
5975 unsigned : 1;
5978 struct
5980 unsigned : 1;
5981 unsigned NOT_DONE : 1;
5982 unsigned : 1;
5983 unsigned : 1;
5984 unsigned : 1;
5985 unsigned : 1;
5986 unsigned : 1;
5987 unsigned : 1;
5990 struct
5992 unsigned : 2;
5993 unsigned CHS : 4;
5994 unsigned : 2;
5997 struct
5999 unsigned : 6;
6000 unsigned VCFG : 2;
6002 } __ADCON0bits_t;
6004 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
6006 #define _ADON 0x01
6007 #define _GO_NOT_DONE 0x02
6008 #define _GO_DONE 0x02
6009 #define _DONE 0x02
6010 #define _GO 0x02
6011 #define _NOT_DONE 0x02
6012 #define _CHS0 0x04
6013 #define _CHS1 0x08
6014 #define _CHS2 0x10
6015 #define _CHS3 0x20
6016 #define _VCFG0 0x40
6017 #define _VCFG1 0x80
6019 //==============================================================================
6021 extern __at(0x0FC3) __sfr ADRES;
6022 extern __at(0x0FC3) __sfr ADRESL;
6023 extern __at(0x0FC4) __sfr ADRESH;
6025 //==============================================================================
6026 // SSP1CON2 Bits
6028 extern __at(0x0FC5) __sfr SSP1CON2;
6030 typedef union
6032 struct
6034 unsigned SEN : 1;
6035 unsigned RSEN : 1;
6036 unsigned PEN : 1;
6037 unsigned RCEN : 1;
6038 unsigned ACKEN : 1;
6039 unsigned ACKDT : 1;
6040 unsigned ACKSTAT : 1;
6041 unsigned GCEN : 1;
6044 struct
6046 unsigned : 1;
6047 unsigned ADMSK1 : 1;
6048 unsigned ADMSK2 : 1;
6049 unsigned ADMSK3 : 1;
6050 unsigned ADMSK4 : 1;
6051 unsigned ADMSK5 : 1;
6052 unsigned : 1;
6053 unsigned : 1;
6055 } __SSP1CON2bits_t;
6057 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
6059 #define _SEN 0x01
6060 #define _RSEN 0x02
6061 #define _ADMSK1 0x02
6062 #define _PEN 0x04
6063 #define _ADMSK2 0x04
6064 #define _RCEN 0x08
6065 #define _ADMSK3 0x08
6066 #define _ACKEN 0x10
6067 #define _ADMSK4 0x10
6068 #define _ACKDT 0x20
6069 #define _ADMSK5 0x20
6070 #define _ACKSTAT 0x40
6071 #define _GCEN 0x80
6073 //==============================================================================
6076 //==============================================================================
6077 // SSPCON2 Bits
6079 extern __at(0x0FC5) __sfr SSPCON2;
6081 typedef union
6083 struct
6085 unsigned SEN : 1;
6086 unsigned RSEN : 1;
6087 unsigned PEN : 1;
6088 unsigned RCEN : 1;
6089 unsigned ACKEN : 1;
6090 unsigned ACKDT : 1;
6091 unsigned ACKSTAT : 1;
6092 unsigned GCEN : 1;
6095 struct
6097 unsigned : 1;
6098 unsigned ADMSK1 : 1;
6099 unsigned ADMSK2 : 1;
6100 unsigned ADMSK3 : 1;
6101 unsigned ADMSK4 : 1;
6102 unsigned ADMSK5 : 1;
6103 unsigned : 1;
6104 unsigned : 1;
6106 } __SSPCON2bits_t;
6108 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
6110 #define _SSPCON2_SEN 0x01
6111 #define _SSPCON2_RSEN 0x02
6112 #define _SSPCON2_ADMSK1 0x02
6113 #define _SSPCON2_PEN 0x04
6114 #define _SSPCON2_ADMSK2 0x04
6115 #define _SSPCON2_RCEN 0x08
6116 #define _SSPCON2_ADMSK3 0x08
6117 #define _SSPCON2_ACKEN 0x10
6118 #define _SSPCON2_ADMSK4 0x10
6119 #define _SSPCON2_ACKDT 0x20
6120 #define _SSPCON2_ADMSK5 0x20
6121 #define _SSPCON2_ACKSTAT 0x40
6122 #define _SSPCON2_GCEN 0x80
6124 //==============================================================================
6127 //==============================================================================
6128 // SSP1CON1 Bits
6130 extern __at(0x0FC6) __sfr SSP1CON1;
6132 typedef union
6134 struct
6136 unsigned SSPM0 : 1;
6137 unsigned SSPM1 : 1;
6138 unsigned SSPM2 : 1;
6139 unsigned SSPM3 : 1;
6140 unsigned CKP : 1;
6141 unsigned SSPEN : 1;
6142 unsigned SSPOV : 1;
6143 unsigned WCOL : 1;
6146 struct
6148 unsigned SSPM : 4;
6149 unsigned : 4;
6151 } __SSP1CON1bits_t;
6153 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
6155 #define _SSPM0 0x01
6156 #define _SSPM1 0x02
6157 #define _SSPM2 0x04
6158 #define _SSPM3 0x08
6159 #define _CKP 0x10
6160 #define _SSPEN 0x20
6161 #define _SSPOV 0x40
6162 #define _WCOL 0x80
6164 //==============================================================================
6167 //==============================================================================
6168 // SSPCON1 Bits
6170 extern __at(0x0FC6) __sfr SSPCON1;
6172 typedef union
6174 struct
6176 unsigned SSPM0 : 1;
6177 unsigned SSPM1 : 1;
6178 unsigned SSPM2 : 1;
6179 unsigned SSPM3 : 1;
6180 unsigned CKP : 1;
6181 unsigned SSPEN : 1;
6182 unsigned SSPOV : 1;
6183 unsigned WCOL : 1;
6186 struct
6188 unsigned SSPM : 4;
6189 unsigned : 4;
6191 } __SSPCON1bits_t;
6193 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
6195 #define _SSPCON1_SSPM0 0x01
6196 #define _SSPCON1_SSPM1 0x02
6197 #define _SSPCON1_SSPM2 0x04
6198 #define _SSPCON1_SSPM3 0x08
6199 #define _SSPCON1_CKP 0x10
6200 #define _SSPCON1_SSPEN 0x20
6201 #define _SSPCON1_SSPOV 0x40
6202 #define _SSPCON1_WCOL 0x80
6204 //==============================================================================
6207 //==============================================================================
6208 // SSP1STAT Bits
6210 extern __at(0x0FC7) __sfr SSP1STAT;
6212 typedef union
6214 struct
6216 unsigned BF : 1;
6217 unsigned UA : 1;
6218 unsigned R_NOT_W : 1;
6219 unsigned S : 1;
6220 unsigned P : 1;
6221 unsigned D_NOT_A : 1;
6222 unsigned CKE : 1;
6223 unsigned SMP : 1;
6226 struct
6228 unsigned : 1;
6229 unsigned : 1;
6230 unsigned R : 1;
6231 unsigned I2C_START : 1;
6232 unsigned I2C_STOP : 1;
6233 unsigned D : 1;
6234 unsigned : 1;
6235 unsigned : 1;
6238 struct
6240 unsigned : 1;
6241 unsigned : 1;
6242 unsigned R_W : 1;
6243 unsigned : 1;
6244 unsigned : 1;
6245 unsigned D_A : 1;
6246 unsigned : 1;
6247 unsigned : 1;
6250 struct
6252 unsigned : 1;
6253 unsigned : 1;
6254 unsigned NOT_W : 1;
6255 unsigned : 1;
6256 unsigned : 1;
6257 unsigned NOT_A : 1;
6258 unsigned : 1;
6259 unsigned : 1;
6262 struct
6264 unsigned : 1;
6265 unsigned : 1;
6266 unsigned NOT_WRITE : 1;
6267 unsigned : 1;
6268 unsigned : 1;
6269 unsigned NOT_ADDRESS : 1;
6270 unsigned : 1;
6271 unsigned : 1;
6274 struct
6276 unsigned : 1;
6277 unsigned : 1;
6278 unsigned READ_WRITE : 1;
6279 unsigned : 1;
6280 unsigned : 1;
6281 unsigned DATA_ADDRESS : 1;
6282 unsigned : 1;
6283 unsigned : 1;
6286 struct
6288 unsigned : 1;
6289 unsigned : 1;
6290 unsigned I2C_READ : 1;
6291 unsigned : 1;
6292 unsigned : 1;
6293 unsigned I2C_DAT : 1;
6294 unsigned : 1;
6295 unsigned : 1;
6297 } __SSP1STATbits_t;
6299 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
6301 #define _BF 0x01
6302 #define _UA 0x02
6303 #define _R_NOT_W 0x04
6304 #define _R 0x04
6305 #define _R_W 0x04
6306 #define _NOT_W 0x04
6307 #define _NOT_WRITE 0x04
6308 #define _READ_WRITE 0x04
6309 #define _I2C_READ 0x04
6310 #define _S 0x08
6311 #define _I2C_START 0x08
6312 #define _P 0x10
6313 #define _I2C_STOP 0x10
6314 #define _D_NOT_A 0x20
6315 #define _D 0x20
6316 #define _D_A 0x20
6317 #define _NOT_A 0x20
6318 #define _NOT_ADDRESS 0x20
6319 #define _DATA_ADDRESS 0x20
6320 #define _I2C_DAT 0x20
6321 #define _CKE 0x40
6322 #define _SMP 0x80
6324 //==============================================================================
6327 //==============================================================================
6328 // SSPSTAT Bits
6330 extern __at(0x0FC7) __sfr SSPSTAT;
6332 typedef union
6334 struct
6336 unsigned BF : 1;
6337 unsigned UA : 1;
6338 unsigned R_NOT_W : 1;
6339 unsigned S : 1;
6340 unsigned P : 1;
6341 unsigned D_NOT_A : 1;
6342 unsigned CKE : 1;
6343 unsigned SMP : 1;
6346 struct
6348 unsigned : 1;
6349 unsigned : 1;
6350 unsigned R : 1;
6351 unsigned I2C_START : 1;
6352 unsigned I2C_STOP : 1;
6353 unsigned D : 1;
6354 unsigned : 1;
6355 unsigned : 1;
6358 struct
6360 unsigned : 1;
6361 unsigned : 1;
6362 unsigned R_W : 1;
6363 unsigned : 1;
6364 unsigned : 1;
6365 unsigned D_A : 1;
6366 unsigned : 1;
6367 unsigned : 1;
6370 struct
6372 unsigned : 1;
6373 unsigned : 1;
6374 unsigned NOT_W : 1;
6375 unsigned : 1;
6376 unsigned : 1;
6377 unsigned NOT_A : 1;
6378 unsigned : 1;
6379 unsigned : 1;
6382 struct
6384 unsigned : 1;
6385 unsigned : 1;
6386 unsigned NOT_WRITE : 1;
6387 unsigned : 1;
6388 unsigned : 1;
6389 unsigned NOT_ADDRESS : 1;
6390 unsigned : 1;
6391 unsigned : 1;
6394 struct
6396 unsigned : 1;
6397 unsigned : 1;
6398 unsigned READ_WRITE : 1;
6399 unsigned : 1;
6400 unsigned : 1;
6401 unsigned DATA_ADDRESS : 1;
6402 unsigned : 1;
6403 unsigned : 1;
6406 struct
6408 unsigned : 1;
6409 unsigned : 1;
6410 unsigned I2C_READ : 1;
6411 unsigned : 1;
6412 unsigned : 1;
6413 unsigned I2C_DAT : 1;
6414 unsigned : 1;
6415 unsigned : 1;
6417 } __SSPSTATbits_t;
6419 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
6421 #define _SSPSTAT_BF 0x01
6422 #define _SSPSTAT_UA 0x02
6423 #define _SSPSTAT_R_NOT_W 0x04
6424 #define _SSPSTAT_R 0x04
6425 #define _SSPSTAT_R_W 0x04
6426 #define _SSPSTAT_NOT_W 0x04
6427 #define _SSPSTAT_NOT_WRITE 0x04
6428 #define _SSPSTAT_READ_WRITE 0x04
6429 #define _SSPSTAT_I2C_READ 0x04
6430 #define _SSPSTAT_S 0x08
6431 #define _SSPSTAT_I2C_START 0x08
6432 #define _SSPSTAT_P 0x10
6433 #define _SSPSTAT_I2C_STOP 0x10
6434 #define _SSPSTAT_D_NOT_A 0x20
6435 #define _SSPSTAT_D 0x20
6436 #define _SSPSTAT_D_A 0x20
6437 #define _SSPSTAT_NOT_A 0x20
6438 #define _SSPSTAT_NOT_ADDRESS 0x20
6439 #define _SSPSTAT_DATA_ADDRESS 0x20
6440 #define _SSPSTAT_I2C_DAT 0x20
6441 #define _SSPSTAT_CKE 0x40
6442 #define _SSPSTAT_SMP 0x80
6444 //==============================================================================
6446 extern __at(0x0FC8) __sfr SSP1ADD;
6448 //==============================================================================
6449 // SSP1MSK Bits
6451 extern __at(0x0FC8) __sfr SSP1MSK;
6453 typedef struct
6455 unsigned MSK0 : 1;
6456 unsigned MSK1 : 1;
6457 unsigned MSK2 : 1;
6458 unsigned MSK3 : 1;
6459 unsigned MSK4 : 1;
6460 unsigned MSK5 : 1;
6461 unsigned MSK6 : 1;
6462 unsigned MSK7 : 1;
6463 } __SSP1MSKbits_t;
6465 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
6467 #define _MSK0 0x01
6468 #define _MSK1 0x02
6469 #define _MSK2 0x04
6470 #define _MSK3 0x08
6471 #define _MSK4 0x10
6472 #define _MSK5 0x20
6473 #define _MSK6 0x40
6474 #define _MSK7 0x80
6476 //==============================================================================
6478 extern __at(0x0FC8) __sfr SSPADD;
6479 extern __at(0x0FC9) __sfr SSP1BUF;
6480 extern __at(0x0FC9) __sfr SSPBUF;
6482 //==============================================================================
6483 // T2CON Bits
6485 extern __at(0x0FCA) __sfr T2CON;
6487 typedef union
6489 struct
6491 unsigned T2CKPS0 : 1;
6492 unsigned T2CKPS1 : 1;
6493 unsigned TMR2ON : 1;
6494 unsigned T2OUTPS0 : 1;
6495 unsigned T2OUTPS1 : 1;
6496 unsigned T2OUTPS2 : 1;
6497 unsigned T2OUTPS3 : 1;
6498 unsigned : 1;
6501 struct
6503 unsigned T2CKPS : 2;
6504 unsigned : 6;
6507 struct
6509 unsigned : 3;
6510 unsigned T2OUTPS : 4;
6511 unsigned : 1;
6513 } __T2CONbits_t;
6515 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
6517 #define _T2CKPS0 0x01
6518 #define _T2CKPS1 0x02
6519 #define _TMR2ON 0x04
6520 #define _T2OUTPS0 0x08
6521 #define _T2OUTPS1 0x10
6522 #define _T2OUTPS2 0x20
6523 #define _T2OUTPS3 0x40
6525 //==============================================================================
6527 extern __at(0x0FCB) __sfr PR2;
6528 extern __at(0x0FCC) __sfr TMR2;
6530 //==============================================================================
6531 // T1CON Bits
6533 extern __at(0x0FCD) __sfr T1CON;
6535 typedef union
6537 struct
6539 unsigned TMR1ON : 1;
6540 unsigned RD16 : 1;
6541 unsigned NOT_T1SYNC : 1;
6542 unsigned T1OSCEN : 1;
6543 unsigned T1CKPS0 : 1;
6544 unsigned T1CKPS1 : 1;
6545 unsigned TMR1CS0 : 1;
6546 unsigned TMR1CS1 : 1;
6549 struct
6551 unsigned : 4;
6552 unsigned T1CKPS : 2;
6553 unsigned : 2;
6556 struct
6558 unsigned : 6;
6559 unsigned TMR1CS : 2;
6561 } __T1CONbits_t;
6563 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6565 #define _TMR1ON 0x01
6566 #define _RD16 0x02
6567 #define _NOT_T1SYNC 0x04
6568 #define _T1OSCEN 0x08
6569 #define _T1CKPS0 0x10
6570 #define _T1CKPS1 0x20
6571 #define _TMR1CS0 0x40
6572 #define _TMR1CS1 0x80
6574 //==============================================================================
6576 extern __at(0x0FCE) __sfr TMR1;
6577 extern __at(0x0FCE) __sfr TMR1L;
6578 extern __at(0x0FCF) __sfr TMR1H;
6580 //==============================================================================
6581 // RCON Bits
6583 extern __at(0x0FD0) __sfr RCON;
6585 typedef union
6587 struct
6589 unsigned NOT_BOR : 1;
6590 unsigned NOT_POR : 1;
6591 unsigned NOT_PD : 1;
6592 unsigned NOT_TO : 1;
6593 unsigned NOT_RI : 1;
6594 unsigned NOT_CM : 1;
6595 unsigned : 1;
6596 unsigned IPEN : 1;
6599 struct
6601 unsigned BOR : 1;
6602 unsigned POR : 1;
6603 unsigned PD : 1;
6604 unsigned TO : 1;
6605 unsigned RI : 1;
6606 unsigned CM : 1;
6607 unsigned : 1;
6608 unsigned : 1;
6610 } __RCONbits_t;
6612 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6614 #define _NOT_BOR 0x01
6615 #define _BOR 0x01
6616 #define _NOT_POR 0x02
6617 #define _POR 0x02
6618 #define _NOT_PD 0x04
6619 #define _PD 0x04
6620 #define _NOT_TO 0x08
6621 #define _TO 0x08
6622 #define _NOT_RI 0x10
6623 #define _RI 0x10
6624 #define _NOT_CM 0x20
6625 #define _CM 0x20
6626 #define _IPEN 0x80
6628 //==============================================================================
6631 //==============================================================================
6632 // CM2CON Bits
6634 extern __at(0x0FD1) __sfr CM2CON;
6636 typedef union
6638 struct
6640 unsigned CCH0 : 1;
6641 unsigned CCH1 : 1;
6642 unsigned CREF : 1;
6643 unsigned EVPOL0 : 1;
6644 unsigned EVPOL1 : 1;
6645 unsigned CPOL : 1;
6646 unsigned COE : 1;
6647 unsigned CON : 1;
6650 struct
6652 unsigned CCH : 2;
6653 unsigned : 6;
6656 struct
6658 unsigned : 3;
6659 unsigned EVPOL : 2;
6660 unsigned : 3;
6662 } __CM2CONbits_t;
6664 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
6666 #define _CM2CON_CCH0 0x01
6667 #define _CM2CON_CCH1 0x02
6668 #define _CM2CON_CREF 0x04
6669 #define _CM2CON_EVPOL0 0x08
6670 #define _CM2CON_EVPOL1 0x10
6671 #define _CM2CON_CPOL 0x20
6672 #define _CM2CON_COE 0x40
6673 #define _CM2CON_CON 0x80
6675 //==============================================================================
6678 //==============================================================================
6679 // CM2CON1 Bits
6681 extern __at(0x0FD1) __sfr CM2CON1;
6683 typedef union
6685 struct
6687 unsigned CCH0 : 1;
6688 unsigned CCH1 : 1;
6689 unsigned CREF : 1;
6690 unsigned EVPOL0 : 1;
6691 unsigned EVPOL1 : 1;
6692 unsigned CPOL : 1;
6693 unsigned COE : 1;
6694 unsigned CON : 1;
6697 struct
6699 unsigned CCH : 2;
6700 unsigned : 6;
6703 struct
6705 unsigned : 3;
6706 unsigned EVPOL : 2;
6707 unsigned : 3;
6709 } __CM2CON1bits_t;
6711 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
6713 #define _CM2CON1_CCH0 0x01
6714 #define _CM2CON1_CCH1 0x02
6715 #define _CM2CON1_CREF 0x04
6716 #define _CM2CON1_EVPOL0 0x08
6717 #define _CM2CON1_EVPOL1 0x10
6718 #define _CM2CON1_CPOL 0x20
6719 #define _CM2CON1_COE 0x40
6720 #define _CM2CON1_CON 0x80
6722 //==============================================================================
6725 //==============================================================================
6726 // CM1CON Bits
6728 extern __at(0x0FD2) __sfr CM1CON;
6730 typedef union
6732 struct
6734 unsigned CCH0 : 1;
6735 unsigned CCH1 : 1;
6736 unsigned CREF : 1;
6737 unsigned EVPOL0 : 1;
6738 unsigned EVPOL1 : 1;
6739 unsigned CPOL : 1;
6740 unsigned COE : 1;
6741 unsigned CON : 1;
6744 struct
6746 unsigned CCH : 2;
6747 unsigned : 6;
6750 struct
6752 unsigned : 3;
6753 unsigned EVPOL : 2;
6754 unsigned : 3;
6756 } __CM1CONbits_t;
6758 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
6760 #define _CCH0 0x01
6761 #define _CCH1 0x02
6762 #define _CREF 0x04
6763 #define _EVPOL0 0x08
6764 #define _EVPOL1 0x10
6765 #define _CPOL 0x20
6766 #define _COE 0x40
6767 #define _CON 0x80
6769 //==============================================================================
6772 //==============================================================================
6773 // CM1CON1 Bits
6775 extern __at(0x0FD2) __sfr CM1CON1;
6777 typedef union
6779 struct
6781 unsigned CCH0 : 1;
6782 unsigned CCH1 : 1;
6783 unsigned CREF : 1;
6784 unsigned EVPOL0 : 1;
6785 unsigned EVPOL1 : 1;
6786 unsigned CPOL : 1;
6787 unsigned COE : 1;
6788 unsigned CON : 1;
6791 struct
6793 unsigned CCH : 2;
6794 unsigned : 6;
6797 struct
6799 unsigned : 3;
6800 unsigned EVPOL : 2;
6801 unsigned : 3;
6803 } __CM1CON1bits_t;
6805 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
6807 #define _CM1CON1_CCH0 0x01
6808 #define _CM1CON1_CCH1 0x02
6809 #define _CM1CON1_CREF 0x04
6810 #define _CM1CON1_EVPOL0 0x08
6811 #define _CM1CON1_EVPOL1 0x10
6812 #define _CM1CON1_CPOL 0x20
6813 #define _CM1CON1_COE 0x40
6814 #define _CM1CON1_CON 0x80
6816 //==============================================================================
6819 //==============================================================================
6820 // OSCCON Bits
6822 extern __at(0x0FD3) __sfr OSCCON;
6824 typedef union
6826 struct
6828 unsigned SCS0 : 1;
6829 unsigned SCS1 : 1;
6830 unsigned : 1;
6831 unsigned OSTS : 1;
6832 unsigned IRCF0 : 1;
6833 unsigned IRCF1 : 1;
6834 unsigned IRCF2 : 1;
6835 unsigned IDLEN : 1;
6838 struct
6840 unsigned SCS : 2;
6841 unsigned : 6;
6844 struct
6846 unsigned : 4;
6847 unsigned IRCF : 3;
6848 unsigned : 1;
6850 } __OSCCONbits_t;
6852 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6854 #define _SCS0 0x01
6855 #define _SCS1 0x02
6856 #define _OSTS 0x08
6857 #define _IRCF0 0x10
6858 #define _IRCF1 0x20
6859 #define _IRCF2 0x40
6860 #define _IDLEN 0x80
6862 //==============================================================================
6865 //==============================================================================
6866 // T0CON Bits
6868 extern __at(0x0FD5) __sfr T0CON;
6870 typedef union
6872 struct
6874 unsigned T0PS0 : 1;
6875 unsigned T0PS1 : 1;
6876 unsigned T0PS2 : 1;
6877 unsigned PSA : 1;
6878 unsigned T0SE : 1;
6879 unsigned T0CS : 1;
6880 unsigned T08BIT : 1;
6881 unsigned TMR0ON : 1;
6884 struct
6886 unsigned T0PS : 3;
6887 unsigned : 5;
6889 } __T0CONbits_t;
6891 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6893 #define _T0PS0 0x01
6894 #define _T0PS1 0x02
6895 #define _T0PS2 0x04
6896 #define _PSA 0x08
6897 #define _T0SE 0x10
6898 #define _T0CS 0x20
6899 #define _T08BIT 0x40
6900 #define _TMR0ON 0x80
6902 //==============================================================================
6904 extern __at(0x0FD6) __sfr TMR0;
6905 extern __at(0x0FD6) __sfr TMR0L;
6906 extern __at(0x0FD7) __sfr TMR0H;
6908 //==============================================================================
6909 // STATUS Bits
6911 extern __at(0x0FD8) __sfr STATUS;
6913 typedef struct
6915 unsigned C : 1;
6916 unsigned DC : 1;
6917 unsigned Z : 1;
6918 unsigned OV : 1;
6919 unsigned N : 1;
6920 unsigned : 1;
6921 unsigned : 1;
6922 unsigned : 1;
6923 } __STATUSbits_t;
6925 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6927 #define _C 0x01
6928 #define _DC 0x02
6929 #define _Z 0x04
6930 #define _OV 0x08
6931 #define _N 0x10
6933 //==============================================================================
6935 extern __at(0x0FD9) __sfr FSR2L;
6936 extern __at(0x0FDA) __sfr FSR2H;
6937 extern __at(0x0FDB) __sfr PLUSW2;
6938 extern __at(0x0FDC) __sfr PREINC2;
6939 extern __at(0x0FDD) __sfr POSTDEC2;
6940 extern __at(0x0FDE) __sfr POSTINC2;
6941 extern __at(0x0FDF) __sfr INDF2;
6942 extern __at(0x0FE0) __sfr BSR;
6943 extern __at(0x0FE1) __sfr FSR1L;
6944 extern __at(0x0FE2) __sfr FSR1H;
6945 extern __at(0x0FE3) __sfr PLUSW1;
6946 extern __at(0x0FE4) __sfr PREINC1;
6947 extern __at(0x0FE5) __sfr POSTDEC1;
6948 extern __at(0x0FE6) __sfr POSTINC1;
6949 extern __at(0x0FE7) __sfr INDF1;
6950 extern __at(0x0FE8) __sfr WREG;
6951 extern __at(0x0FE9) __sfr FSR0L;
6952 extern __at(0x0FEA) __sfr FSR0H;
6953 extern __at(0x0FEB) __sfr PLUSW0;
6954 extern __at(0x0FEC) __sfr PREINC0;
6955 extern __at(0x0FED) __sfr POSTDEC0;
6956 extern __at(0x0FEE) __sfr POSTINC0;
6957 extern __at(0x0FEF) __sfr INDF0;
6959 //==============================================================================
6960 // INTCON3 Bits
6962 extern __at(0x0FF0) __sfr INTCON3;
6964 typedef union
6966 struct
6968 unsigned INT1IF : 1;
6969 unsigned INT2IF : 1;
6970 unsigned INT3IF : 1;
6971 unsigned INT1IE : 1;
6972 unsigned INT2IE : 1;
6973 unsigned INT3IE : 1;
6974 unsigned INT1IP : 1;
6975 unsigned INT2IP : 1;
6978 struct
6980 unsigned INT1F : 1;
6981 unsigned INT2F : 1;
6982 unsigned INT3F : 1;
6983 unsigned INT1E : 1;
6984 unsigned INT2E : 1;
6985 unsigned INT3E : 1;
6986 unsigned INT1P : 1;
6987 unsigned INT2P : 1;
6989 } __INTCON3bits_t;
6991 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6993 #define _INT1IF 0x01
6994 #define _INT1F 0x01
6995 #define _INT2IF 0x02
6996 #define _INT2F 0x02
6997 #define _INT3IF 0x04
6998 #define _INT3F 0x04
6999 #define _INT1IE 0x08
7000 #define _INT1E 0x08
7001 #define _INT2IE 0x10
7002 #define _INT2E 0x10
7003 #define _INT3IE 0x20
7004 #define _INT3E 0x20
7005 #define _INT1IP 0x40
7006 #define _INT1P 0x40
7007 #define _INT2IP 0x80
7008 #define _INT2P 0x80
7010 //==============================================================================
7013 //==============================================================================
7014 // INTCON2 Bits
7016 extern __at(0x0FF1) __sfr INTCON2;
7018 typedef union
7020 struct
7022 unsigned RBIP : 1;
7023 unsigned INT3IP : 1;
7024 unsigned TMR0IP : 1;
7025 unsigned INTEDG3 : 1;
7026 unsigned INTEDG2 : 1;
7027 unsigned INTEDG1 : 1;
7028 unsigned INTEDG0 : 1;
7029 unsigned NOT_RBPU : 1;
7032 struct
7034 unsigned : 1;
7035 unsigned INT3P : 1;
7036 unsigned T0IP : 1;
7037 unsigned : 1;
7038 unsigned : 1;
7039 unsigned : 1;
7040 unsigned : 1;
7041 unsigned RBPU : 1;
7043 } __INTCON2bits_t;
7045 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
7047 #define _RBIP 0x01
7048 #define _INT3IP 0x02
7049 #define _INT3P 0x02
7050 #define _TMR0IP 0x04
7051 #define _T0IP 0x04
7052 #define _INTEDG3 0x08
7053 #define _INTEDG2 0x10
7054 #define _INTEDG1 0x20
7055 #define _INTEDG0 0x40
7056 #define _NOT_RBPU 0x80
7057 #define _RBPU 0x80
7059 //==============================================================================
7062 //==============================================================================
7063 // INTCON Bits
7065 extern __at(0x0FF2) __sfr INTCON;
7067 typedef union
7069 struct
7071 unsigned RBIF : 1;
7072 unsigned INT0IF : 1;
7073 unsigned TMR0IF : 1;
7074 unsigned RBIE : 1;
7075 unsigned INT0IE : 1;
7076 unsigned TMR0IE : 1;
7077 unsigned PEIE_GIEL : 1;
7078 unsigned GIE_GIEH : 1;
7081 struct
7083 unsigned : 1;
7084 unsigned INT0F : 1;
7085 unsigned T0IF : 1;
7086 unsigned : 1;
7087 unsigned INT0E : 1;
7088 unsigned T0IE : 1;
7089 unsigned PEIE : 1;
7090 unsigned GIE : 1;
7093 struct
7095 unsigned : 1;
7096 unsigned : 1;
7097 unsigned : 1;
7098 unsigned : 1;
7099 unsigned : 1;
7100 unsigned : 1;
7101 unsigned GIEL : 1;
7102 unsigned GIEH : 1;
7104 } __INTCONbits_t;
7106 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
7108 #define _RBIF 0x01
7109 #define _INT0IF 0x02
7110 #define _INT0F 0x02
7111 #define _TMR0IF 0x04
7112 #define _T0IF 0x04
7113 #define _RBIE 0x08
7114 #define _INT0IE 0x10
7115 #define _INT0E 0x10
7116 #define _TMR0IE 0x20
7117 #define _T0IE 0x20
7118 #define _PEIE_GIEL 0x40
7119 #define _PEIE 0x40
7120 #define _GIEL 0x40
7121 #define _GIE_GIEH 0x80
7122 #define _GIE 0x80
7123 #define _GIEH 0x80
7125 //==============================================================================
7127 extern __at(0x0FF3) __sfr PROD;
7128 extern __at(0x0FF3) __sfr PRODL;
7129 extern __at(0x0FF4) __sfr PRODH;
7130 extern __at(0x0FF5) __sfr TABLAT;
7131 extern __at(0x0FF6) __sfr TBLPTR;
7132 extern __at(0x0FF6) __sfr TBLPTRL;
7133 extern __at(0x0FF7) __sfr TBLPTRH;
7134 extern __at(0x0FF8) __sfr TBLPTRU;
7135 extern __at(0x0FF9) __sfr PC;
7136 extern __at(0x0FF9) __sfr PCL;
7137 extern __at(0x0FFA) __sfr PCLATH;
7138 extern __at(0x0FFB) __sfr PCLATU;
7140 //==============================================================================
7141 // STKPTR Bits
7143 extern __at(0x0FFC) __sfr STKPTR;
7145 typedef union
7147 struct
7149 unsigned SP0 : 1;
7150 unsigned SP1 : 1;
7151 unsigned SP2 : 1;
7152 unsigned SP3 : 1;
7153 unsigned SP4 : 1;
7154 unsigned : 1;
7155 unsigned STKUNF : 1;
7156 unsigned STKFUL : 1;
7159 struct
7161 unsigned : 1;
7162 unsigned : 1;
7163 unsigned : 1;
7164 unsigned : 1;
7165 unsigned : 1;
7166 unsigned : 1;
7167 unsigned : 1;
7168 unsigned STKOVF : 1;
7171 struct
7173 unsigned SP : 5;
7174 unsigned : 3;
7176 } __STKPTRbits_t;
7178 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
7180 #define _SP0 0x01
7181 #define _SP1 0x02
7182 #define _SP2 0x04
7183 #define _SP3 0x08
7184 #define _SP4 0x10
7185 #define _STKUNF 0x40
7186 #define _STKFUL 0x80
7187 #define _STKOVF 0x80
7189 //==============================================================================
7191 extern __at(0x0FFD) __sfr TOS;
7192 extern __at(0x0FFD) __sfr TOSL;
7193 extern __at(0x0FFE) __sfr TOSH;
7194 extern __at(0x0FFF) __sfr TOSU;
7196 //==============================================================================
7198 // Configuration Addresses
7200 //==============================================================================
7202 #define __CONFIG1L 0x00FFF8
7203 #define __CONFIG1H 0x00FFF9
7204 #define __CONFIG2L 0x00FFFA
7205 #define __CONFIG2H 0x00FFFB
7206 #define __CONFIG3L 0x00FFFC
7207 #define __CONFIG3H 0x00FFFD
7208 #define __CONFIG4L 0x00FFFE
7209 #define __CONFIG4H 0x00FFFF
7211 //==============================================================================
7213 #endif // #ifndef __PIC18F46J13_H__