Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f26j13.h
blobefc4b77286af604e12c3530dd5d0ae071fca3891
1 /*
2 * This declarations of the PIC18F26J13 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:28 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 __PIC18F26J13_H__
26 #define __PIC18F26J13_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 : 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 : 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
246 //==============================================================================
249 //==============================================================================
250 // PMDIS1 Bits
252 extern __at(0x0EBA) __sfr PMDIS1;
254 typedef union
256 struct
258 unsigned : 1;
259 unsigned TMR1MD : 1;
260 unsigned TMR2MD : 1;
261 unsigned TMR3MD : 1;
262 unsigned TMR4MD : 1;
263 unsigned RTCCMD : 1;
264 unsigned CTMUMD : 1;
265 unsigned : 1;
268 struct
270 unsigned : 1;
271 unsigned PMDTMR1 : 1;
272 unsigned PMDTMR2 : 1;
273 unsigned PMDTMR3 : 1;
274 unsigned PMDTMR4 : 1;
275 unsigned PMDRTCC : 1;
276 unsigned PMDCTMU : 1;
277 unsigned : 1;
279 } __PMDIS1bits_t;
281 extern __at(0x0EBA) volatile __PMDIS1bits_t PMDIS1bits;
283 #define _PMDIS1_TMR1MD 0x02
284 #define _PMDIS1_PMDTMR1 0x02
285 #define _PMDIS1_TMR2MD 0x04
286 #define _PMDIS1_PMDTMR2 0x04
287 #define _PMDIS1_TMR3MD 0x08
288 #define _PMDIS1_PMDTMR3 0x08
289 #define _PMDIS1_TMR4MD 0x10
290 #define _PMDIS1_PMDTMR4 0x10
291 #define _PMDIS1_RTCCMD 0x20
292 #define _PMDIS1_PMDRTCC 0x20
293 #define _PMDIS1_CTMUMD 0x40
294 #define _PMDIS1_PMDCTMU 0x40
296 //==============================================================================
299 //==============================================================================
300 // PD2 Bits
302 extern __at(0x0EBB) __sfr PD2;
304 typedef union
306 struct
308 unsigned CMP1MD : 1;
309 unsigned CMP2MD : 1;
310 unsigned CMP3MD : 1;
311 unsigned TMR5MD : 1;
312 unsigned TMR6MD : 1;
313 unsigned : 1;
314 unsigned TMR8MD : 1;
315 unsigned : 1;
318 struct
320 unsigned PMDCMP1 : 1;
321 unsigned PMDCMP2 : 1;
322 unsigned PMDCMP3 : 1;
323 unsigned PMDTMR5 : 1;
324 unsigned PMDTMR6 : 1;
325 unsigned : 1;
326 unsigned PMDTMR8 : 1;
327 unsigned : 1;
329 } __PD2bits_t;
331 extern __at(0x0EBB) volatile __PD2bits_t PD2bits;
333 #define _CMP1MD 0x01
334 #define _PMDCMP1 0x01
335 #define _CMP2MD 0x02
336 #define _PMDCMP2 0x02
337 #define _CMP3MD 0x04
338 #define _PMDCMP3 0x04
339 #define _TMR5MD 0x08
340 #define _PMDTMR5 0x08
341 #define _TMR6MD 0x10
342 #define _PMDTMR6 0x10
343 #define _TMR8MD 0x40
344 #define _PMDTMR8 0x40
346 //==============================================================================
349 //==============================================================================
350 // PMDIS2 Bits
352 extern __at(0x0EBB) __sfr PMDIS2;
354 typedef union
356 struct
358 unsigned CMP1MD : 1;
359 unsigned CMP2MD : 1;
360 unsigned CMP3MD : 1;
361 unsigned TMR5MD : 1;
362 unsigned TMR6MD : 1;
363 unsigned : 1;
364 unsigned TMR8MD : 1;
365 unsigned : 1;
368 struct
370 unsigned PMDCMP1 : 1;
371 unsigned PMDCMP2 : 1;
372 unsigned PMDCMP3 : 1;
373 unsigned PMDTMR5 : 1;
374 unsigned PMDTMR6 : 1;
375 unsigned : 1;
376 unsigned PMDTMR8 : 1;
377 unsigned : 1;
379 } __PMDIS2bits_t;
381 extern __at(0x0EBB) volatile __PMDIS2bits_t PMDIS2bits;
383 #define _PMDIS2_CMP1MD 0x01
384 #define _PMDIS2_PMDCMP1 0x01
385 #define _PMDIS2_CMP2MD 0x02
386 #define _PMDIS2_PMDCMP2 0x02
387 #define _PMDIS2_CMP3MD 0x04
388 #define _PMDIS2_PMDCMP3 0x04
389 #define _PMDIS2_TMR5MD 0x08
390 #define _PMDIS2_PMDTMR5 0x08
391 #define _PMDIS2_TMR6MD 0x10
392 #define _PMDIS2_PMDTMR6 0x10
393 #define _PMDIS2_TMR8MD 0x40
394 #define _PMDIS2_PMDTMR8 0x40
396 //==============================================================================
399 //==============================================================================
400 // PD3 Bits
402 extern __at(0x0EBC) __sfr PD3;
404 typedef union
406 struct
408 unsigned : 1;
409 unsigned CCP4MD : 1;
410 unsigned CCP5MD : 1;
411 unsigned CCP6MD : 1;
412 unsigned CCP7MD : 1;
413 unsigned CCP8MD : 1;
414 unsigned CCP9MD : 1;
415 unsigned CCP10MD : 1;
418 struct
420 unsigned : 1;
421 unsigned PMDCCP4 : 1;
422 unsigned PMDCCP5 : 1;
423 unsigned PMDCCP6 : 1;
424 unsigned PMDCCP7 : 1;
425 unsigned PMDCCP8 : 1;
426 unsigned PMDCCP9 : 1;
427 unsigned PMDCCP10 : 1;
429 } __PD3bits_t;
431 extern __at(0x0EBC) volatile __PD3bits_t PD3bits;
433 #define _CCP4MD 0x02
434 #define _PMDCCP4 0x02
435 #define _CCP5MD 0x04
436 #define _PMDCCP5 0x04
437 #define _CCP6MD 0x08
438 #define _PMDCCP6 0x08
439 #define _CCP7MD 0x10
440 #define _PMDCCP7 0x10
441 #define _CCP8MD 0x20
442 #define _PMDCCP8 0x20
443 #define _CCP9MD 0x40
444 #define _PMDCCP9 0x40
445 #define _CCP10MD 0x80
446 #define _PMDCCP10 0x80
448 //==============================================================================
451 //==============================================================================
452 // PMDIS3 Bits
454 extern __at(0x0EBC) __sfr PMDIS3;
456 typedef union
458 struct
460 unsigned : 1;
461 unsigned CCP4MD : 1;
462 unsigned CCP5MD : 1;
463 unsigned CCP6MD : 1;
464 unsigned CCP7MD : 1;
465 unsigned CCP8MD : 1;
466 unsigned CCP9MD : 1;
467 unsigned CCP10MD : 1;
470 struct
472 unsigned : 1;
473 unsigned PMDCCP4 : 1;
474 unsigned PMDCCP5 : 1;
475 unsigned PMDCCP6 : 1;
476 unsigned PMDCCP7 : 1;
477 unsigned PMDCCP8 : 1;
478 unsigned PMDCCP9 : 1;
479 unsigned PMDCCP10 : 1;
481 } __PMDIS3bits_t;
483 extern __at(0x0EBC) volatile __PMDIS3bits_t PMDIS3bits;
485 #define _PMDIS3_CCP4MD 0x02
486 #define _PMDIS3_PMDCCP4 0x02
487 #define _PMDIS3_CCP5MD 0x04
488 #define _PMDIS3_PMDCCP5 0x04
489 #define _PMDIS3_CCP6MD 0x08
490 #define _PMDIS3_PMDCCP6 0x08
491 #define _PMDIS3_CCP7MD 0x10
492 #define _PMDIS3_PMDCCP7 0x10
493 #define _PMDIS3_CCP8MD 0x20
494 #define _PMDIS3_PMDCCP8 0x20
495 #define _PMDIS3_CCP9MD 0x40
496 #define _PMDIS3_PMDCCP9 0x40
497 #define _PMDIS3_CCP10MD 0x80
498 #define _PMDIS3_PMDCCP10 0x80
500 //==============================================================================
503 //==============================================================================
504 // PPSCON Bits
506 extern __at(0x0EBF) __sfr PPSCON;
508 typedef struct
510 unsigned IOLOCK : 1;
511 unsigned : 1;
512 unsigned : 1;
513 unsigned : 1;
514 unsigned : 1;
515 unsigned : 1;
516 unsigned : 1;
517 unsigned : 1;
518 } __PPSCONbits_t;
520 extern __at(0x0EBF) volatile __PPSCONbits_t PPSCONbits;
522 #define _IOLOCK 0x01
524 //==============================================================================
526 extern __at(0x0EC0) __sfr RPOR0;
527 extern __at(0x0EC1) __sfr RPOR1;
528 extern __at(0x0EC2) __sfr RPOR2;
529 extern __at(0x0EC3) __sfr RPOR3;
530 extern __at(0x0EC4) __sfr RPOR4;
531 extern __at(0x0EC5) __sfr RPOR5;
532 extern __at(0x0EC6) __sfr RPOR6;
533 extern __at(0x0EC7) __sfr RPOR7;
534 extern __at(0x0EC8) __sfr RPOR8;
535 extern __at(0x0EC9) __sfr RPOR9;
536 extern __at(0x0ECA) __sfr RPOR10;
537 extern __at(0x0ECB) __sfr RPOR11;
538 extern __at(0x0ECC) __sfr RPOR12;
539 extern __at(0x0ECD) __sfr RPOR13;
540 extern __at(0x0ECE) __sfr RPOR14;
541 extern __at(0x0ECF) __sfr RPOR15;
542 extern __at(0x0ED0) __sfr RPOR16;
543 extern __at(0x0ED1) __sfr RPOR17;
544 extern __at(0x0ED2) __sfr RPOR18;
545 extern __at(0x0EE1) __sfr RPINR1;
546 extern __at(0x0EE2) __sfr RPINR2;
547 extern __at(0x0EE3) __sfr RPINR3;
548 extern __at(0x0EE4) __sfr RPINR4;
549 extern __at(0x0EE6) __sfr RPINR6;
550 extern __at(0x0EE7) __sfr RPINR15;
551 extern __at(0x0EE8) __sfr RPINR7;
552 extern __at(0x0EE9) __sfr RPINR8;
553 extern __at(0x0EEA) __sfr RPINR9;
554 extern __at(0x0EF2) __sfr RPINR12;
555 extern __at(0x0EF3) __sfr RPINR13;
556 extern __at(0x0EF4) __sfr RPINR14;
557 extern __at(0x0EF7) __sfr RPINR16;
558 extern __at(0x0EF8) __sfr RPINR17;
559 extern __at(0x0EFC) __sfr RPINR21;
560 extern __at(0x0EFD) __sfr RPINR22;
561 extern __at(0x0EFE) __sfr RPINR23;
562 extern __at(0x0EFF) __sfr RPINR24;
564 //==============================================================================
565 // CCP10CON Bits
567 extern __at(0x0F00) __sfr CCP10CON;
569 typedef union
571 struct
573 unsigned CCP10M0 : 1;
574 unsigned CCP10M1 : 1;
575 unsigned CCP10M2 : 1;
576 unsigned CCP10M3 : 1;
577 unsigned DC10B0 : 1;
578 unsigned DC10B1 : 1;
579 unsigned : 1;
580 unsigned : 1;
583 struct
585 unsigned CCP10M : 4;
586 unsigned : 4;
589 struct
591 unsigned : 4;
592 unsigned DC10B : 2;
593 unsigned : 2;
595 } __CCP10CONbits_t;
597 extern __at(0x0F00) volatile __CCP10CONbits_t CCP10CONbits;
599 #define _CCP10M0 0x01
600 #define _CCP10M1 0x02
601 #define _CCP10M2 0x04
602 #define _CCP10M3 0x08
603 #define _DC10B0 0x10
604 #define _DC10B1 0x20
606 //==============================================================================
608 extern __at(0x0F01) __sfr CCPR10L;
609 extern __at(0x0F02) __sfr CCPR10H;
611 //==============================================================================
612 // CCP9CON Bits
614 extern __at(0x0F03) __sfr CCP9CON;
616 typedef union
618 struct
620 unsigned CCP9M0 : 1;
621 unsigned CCP9M1 : 1;
622 unsigned CCP9M2 : 1;
623 unsigned CCP9M3 : 1;
624 unsigned DC9B0 : 1;
625 unsigned DC9B1 : 1;
626 unsigned : 1;
627 unsigned : 1;
630 struct
632 unsigned CCP9M : 4;
633 unsigned : 4;
636 struct
638 unsigned : 4;
639 unsigned DC9B : 2;
640 unsigned : 2;
642 } __CCP9CONbits_t;
644 extern __at(0x0F03) volatile __CCP9CONbits_t CCP9CONbits;
646 #define _CCP9M0 0x01
647 #define _CCP9M1 0x02
648 #define _CCP9M2 0x04
649 #define _CCP9M3 0x08
650 #define _DC9B0 0x10
651 #define _DC9B1 0x20
653 //==============================================================================
655 extern __at(0x0F04) __sfr CCPR9L;
656 extern __at(0x0F05) __sfr CCPR9H;
658 //==============================================================================
659 // CCP8CON Bits
661 extern __at(0x0F06) __sfr CCP8CON;
663 typedef union
665 struct
667 unsigned CCP8M0 : 1;
668 unsigned CCP8M1 : 1;
669 unsigned CCP8M2 : 1;
670 unsigned CCP8M3 : 1;
671 unsigned DC8B0 : 1;
672 unsigned DC8B1 : 1;
673 unsigned : 1;
674 unsigned : 1;
677 struct
679 unsigned CCP8M : 4;
680 unsigned : 4;
683 struct
685 unsigned : 4;
686 unsigned DC8B : 2;
687 unsigned : 2;
689 } __CCP8CONbits_t;
691 extern __at(0x0F06) volatile __CCP8CONbits_t CCP8CONbits;
693 #define _CCP8M0 0x01
694 #define _CCP8M1 0x02
695 #define _CCP8M2 0x04
696 #define _CCP8M3 0x08
697 #define _DC8B0 0x10
698 #define _DC8B1 0x20
700 //==============================================================================
702 extern __at(0x0F07) __sfr CCPR8L;
703 extern __at(0x0F08) __sfr CCPR8H;
705 //==============================================================================
706 // CCP7CON Bits
708 extern __at(0x0F09) __sfr CCP7CON;
710 typedef union
712 struct
714 unsigned CCP7M0 : 1;
715 unsigned CCP7M1 : 1;
716 unsigned CCP7M2 : 1;
717 unsigned CCP7M3 : 1;
718 unsigned DC7B0 : 1;
719 unsigned DC7B1 : 1;
720 unsigned : 1;
721 unsigned : 1;
724 struct
726 unsigned CCP7M : 4;
727 unsigned : 4;
730 struct
732 unsigned : 4;
733 unsigned DC7B : 2;
734 unsigned : 2;
736 } __CCP7CONbits_t;
738 extern __at(0x0F09) volatile __CCP7CONbits_t CCP7CONbits;
740 #define _CCP7M0 0x01
741 #define _CCP7M1 0x02
742 #define _CCP7M2 0x04
743 #define _CCP7M3 0x08
744 #define _DC7B0 0x10
745 #define _DC7B1 0x20
747 //==============================================================================
749 extern __at(0x0F0A) __sfr CCPR7L;
750 extern __at(0x0F0B) __sfr CCPR7H;
752 //==============================================================================
753 // CCP6CON Bits
755 extern __at(0x0F0C) __sfr CCP6CON;
757 typedef union
759 struct
761 unsigned CCP6M0 : 1;
762 unsigned CCP6M1 : 1;
763 unsigned CCP6M2 : 1;
764 unsigned CCP6M3 : 1;
765 unsigned DC6B0 : 1;
766 unsigned DC6B1 : 1;
767 unsigned : 1;
768 unsigned : 1;
771 struct
773 unsigned CCP6M : 4;
774 unsigned : 4;
777 struct
779 unsigned : 4;
780 unsigned DC6B : 2;
781 unsigned : 2;
783 } __CCP6CONbits_t;
785 extern __at(0x0F0C) volatile __CCP6CONbits_t CCP6CONbits;
787 #define _CCP6M0 0x01
788 #define _CCP6M1 0x02
789 #define _CCP6M2 0x04
790 #define _CCP6M3 0x08
791 #define _DC6B0 0x10
792 #define _DC6B1 0x20
794 //==============================================================================
796 extern __at(0x0F0D) __sfr CCPR6L;
797 extern __at(0x0F0E) __sfr CCPR6H;
799 //==============================================================================
800 // CCP5CON Bits
802 extern __at(0x0F0F) __sfr CCP5CON;
804 typedef union
806 struct
808 unsigned CCP5M0 : 1;
809 unsigned CCP5M1 : 1;
810 unsigned CCP5M2 : 1;
811 unsigned CCP5M3 : 1;
812 unsigned DC5B0 : 1;
813 unsigned DC5B1 : 1;
814 unsigned : 1;
815 unsigned : 1;
818 struct
820 unsigned CCP5M : 4;
821 unsigned : 4;
824 struct
826 unsigned : 4;
827 unsigned DC5B : 2;
828 unsigned : 2;
830 } __CCP5CONbits_t;
832 extern __at(0x0F0F) volatile __CCP5CONbits_t CCP5CONbits;
834 #define _CCP5M0 0x01
835 #define _CCP5M1 0x02
836 #define _CCP5M2 0x04
837 #define _CCP5M3 0x08
838 #define _DC5B0 0x10
839 #define _DC5B1 0x20
841 //==============================================================================
843 extern __at(0x0F10) __sfr CCPR5L;
844 extern __at(0x0F11) __sfr CCPR5H;
846 //==============================================================================
847 // CCP4CON Bits
849 extern __at(0x0F12) __sfr CCP4CON;
851 typedef union
853 struct
855 unsigned CCP4M0 : 1;
856 unsigned CCP4M1 : 1;
857 unsigned CCP4M2 : 1;
858 unsigned CCP4M3 : 1;
859 unsigned DC4B0 : 1;
860 unsigned DC4B1 : 1;
861 unsigned : 1;
862 unsigned : 1;
865 struct
867 unsigned CCP4M : 4;
868 unsigned : 4;
871 struct
873 unsigned : 4;
874 unsigned DC4B : 2;
875 unsigned : 2;
877 } __CCP4CONbits_t;
879 extern __at(0x0F12) volatile __CCP4CONbits_t CCP4CONbits;
881 #define _CCP4M0 0x01
882 #define _CCP4M1 0x02
883 #define _CCP4M2 0x04
884 #define _CCP4M3 0x08
885 #define _DC4B0 0x10
886 #define _DC4B1 0x20
888 //==============================================================================
890 extern __at(0x0F13) __sfr CCPR4L;
891 extern __at(0x0F14) __sfr CCPR4H;
893 //==============================================================================
894 // CCP3CON Bits
896 extern __at(0x0F15) __sfr CCP3CON;
898 typedef union
900 struct
902 unsigned CCP3M0 : 1;
903 unsigned CCP3M1 : 1;
904 unsigned CCP3M2 : 1;
905 unsigned CCP3M3 : 1;
906 unsigned DC3B0 : 1;
907 unsigned DC3B1 : 1;
908 unsigned P3M0 : 1;
909 unsigned P3M1 : 1;
912 struct
914 unsigned CCP3M : 4;
915 unsigned : 4;
918 struct
920 unsigned : 4;
921 unsigned DC3B : 2;
922 unsigned : 2;
925 struct
927 unsigned : 6;
928 unsigned P3M : 2;
930 } __CCP3CONbits_t;
932 extern __at(0x0F15) volatile __CCP3CONbits_t CCP3CONbits;
934 #define _CCP3M0 0x01
935 #define _CCP3M1 0x02
936 #define _CCP3M2 0x04
937 #define _CCP3M3 0x08
938 #define _DC3B0 0x10
939 #define _DC3B1 0x20
940 #define _P3M0 0x40
941 #define _P3M1 0x80
943 //==============================================================================
945 extern __at(0x0F16) __sfr CCPR3L;
946 extern __at(0x0F17) __sfr CCPR3H;
948 //==============================================================================
949 // ECCP3DEL Bits
951 extern __at(0x0F18) __sfr ECCP3DEL;
953 typedef union
955 struct
957 unsigned P3DC0 : 1;
958 unsigned P3DC1 : 1;
959 unsigned P3DC2 : 1;
960 unsigned P3DC3 : 1;
961 unsigned P3DC4 : 1;
962 unsigned P3DC5 : 1;
963 unsigned P3DC6 : 1;
964 unsigned P3RSEN : 1;
967 struct
969 unsigned P3DC : 7;
970 unsigned : 1;
972 } __ECCP3DELbits_t;
974 extern __at(0x0F18) volatile __ECCP3DELbits_t ECCP3DELbits;
976 #define _P3DC0 0x01
977 #define _P3DC1 0x02
978 #define _P3DC2 0x04
979 #define _P3DC3 0x08
980 #define _P3DC4 0x10
981 #define _P3DC5 0x20
982 #define _P3DC6 0x40
983 #define _P3RSEN 0x80
985 //==============================================================================
988 //==============================================================================
989 // ECCP3AS Bits
991 extern __at(0x0F19) __sfr ECCP3AS;
993 typedef union
995 struct
997 unsigned PSS3BD0 : 1;
998 unsigned PSS3BD1 : 1;
999 unsigned PSS3AC0 : 1;
1000 unsigned PSS3AC1 : 1;
1001 unsigned ECCP3AS0 : 1;
1002 unsigned ECCP3AS1 : 1;
1003 unsigned ECCP3AS2 : 1;
1004 unsigned ECCP3ASE : 1;
1007 struct
1009 unsigned PSS3BD : 2;
1010 unsigned : 6;
1013 struct
1015 unsigned : 2;
1016 unsigned PSS3AC : 2;
1017 unsigned : 4;
1020 struct
1022 unsigned : 4;
1023 unsigned ECCP3AS : 3;
1024 unsigned : 1;
1026 } __ECCP3ASbits_t;
1028 extern __at(0x0F19) volatile __ECCP3ASbits_t ECCP3ASbits;
1030 #define _PSS3BD0 0x01
1031 #define _PSS3BD1 0x02
1032 #define _PSS3AC0 0x04
1033 #define _PSS3AC1 0x08
1034 #define _ECCP3AS0 0x10
1035 #define _ECCP3AS1 0x20
1036 #define _ECCP3AS2 0x40
1037 #define _ECCP3ASE 0x80
1039 //==============================================================================
1042 //==============================================================================
1043 // PSTR3CON Bits
1045 extern __at(0x0F1A) __sfr PSTR3CON;
1047 typedef union
1049 struct
1051 unsigned STRA : 1;
1052 unsigned STRB : 1;
1053 unsigned STRC : 1;
1054 unsigned STRD : 1;
1055 unsigned STRSYNC : 1;
1056 unsigned : 1;
1057 unsigned CMPL0 : 1;
1058 unsigned CMPL1 : 1;
1061 struct
1063 unsigned : 6;
1064 unsigned CMPL : 2;
1066 } __PSTR3CONbits_t;
1068 extern __at(0x0F1A) volatile __PSTR3CONbits_t PSTR3CONbits;
1070 #define _PSTR3CON_STRA 0x01
1071 #define _PSTR3CON_STRB 0x02
1072 #define _PSTR3CON_STRC 0x04
1073 #define _PSTR3CON_STRD 0x08
1074 #define _PSTR3CON_STRSYNC 0x10
1075 #define _PSTR3CON_CMPL0 0x40
1076 #define _PSTR3CON_CMPL1 0x80
1078 //==============================================================================
1081 //==============================================================================
1082 // T8CON Bits
1084 extern __at(0x0F1B) __sfr T8CON;
1086 typedef union
1088 struct
1090 unsigned T8CKPS0 : 1;
1091 unsigned T8CKPS1 : 1;
1092 unsigned TMR8ON : 1;
1093 unsigned T8OUTPS0 : 1;
1094 unsigned T8OUTPS1 : 1;
1095 unsigned T8OUTPS2 : 1;
1096 unsigned T8OUTPS3 : 1;
1097 unsigned : 1;
1100 struct
1102 unsigned T8CKPS : 2;
1103 unsigned : 6;
1106 struct
1108 unsigned : 3;
1109 unsigned T8OUTPS : 4;
1110 unsigned : 1;
1112 } __T8CONbits_t;
1114 extern __at(0x0F1B) volatile __T8CONbits_t T8CONbits;
1116 #define _T8CKPS0 0x01
1117 #define _T8CKPS1 0x02
1118 #define _TMR8ON 0x04
1119 #define _T8OUTPS0 0x08
1120 #define _T8OUTPS1 0x10
1121 #define _T8OUTPS2 0x20
1122 #define _T8OUTPS3 0x40
1124 //==============================================================================
1126 extern __at(0x0F1C) __sfr PR8;
1127 extern __at(0x0F1D) __sfr TMR8;
1129 //==============================================================================
1130 // T6CON Bits
1132 extern __at(0x0F1E) __sfr T6CON;
1134 typedef union
1136 struct
1138 unsigned T6CKPS0 : 1;
1139 unsigned T6CKPS1 : 1;
1140 unsigned TMR6ON : 1;
1141 unsigned T6OUTPS0 : 1;
1142 unsigned T6OUTPS1 : 1;
1143 unsigned T6OUTPS2 : 1;
1144 unsigned T6OUTPS3 : 1;
1145 unsigned : 1;
1148 struct
1150 unsigned T6CKPS : 2;
1151 unsigned : 6;
1154 struct
1156 unsigned : 3;
1157 unsigned T6OUTPS : 4;
1158 unsigned : 1;
1160 } __T6CONbits_t;
1162 extern __at(0x0F1E) volatile __T6CONbits_t T6CONbits;
1164 #define _T6CKPS0 0x01
1165 #define _T6CKPS1 0x02
1166 #define _TMR6ON 0x04
1167 #define _T6OUTPS0 0x08
1168 #define _T6OUTPS1 0x10
1169 #define _T6OUTPS2 0x20
1170 #define _T6OUTPS3 0x40
1172 //==============================================================================
1174 extern __at(0x0F1F) __sfr PR6;
1175 extern __at(0x0F20) __sfr TMR6;
1177 //==============================================================================
1178 // T5GCON Bits
1180 extern __at(0x0F21) __sfr T5GCON;
1182 typedef union
1184 struct
1186 unsigned T5GSS0 : 1;
1187 unsigned T5GSS1 : 1;
1188 unsigned T5GVAL : 1;
1189 unsigned T5GGO_NOT_T5DONE : 1;
1190 unsigned T5GSPM : 1;
1191 unsigned T5GTM : 1;
1192 unsigned T5GPOL : 1;
1193 unsigned TMR5GE : 1;
1196 struct
1198 unsigned : 1;
1199 unsigned : 1;
1200 unsigned : 1;
1201 unsigned T5GGO : 1;
1202 unsigned : 1;
1203 unsigned : 1;
1204 unsigned : 1;
1205 unsigned : 1;
1208 struct
1210 unsigned : 1;
1211 unsigned : 1;
1212 unsigned : 1;
1213 unsigned NOT_T5DONE : 1;
1214 unsigned : 1;
1215 unsigned : 1;
1216 unsigned : 1;
1217 unsigned : 1;
1220 struct
1222 unsigned : 1;
1223 unsigned : 1;
1224 unsigned : 1;
1225 unsigned T5DONE : 1;
1226 unsigned : 1;
1227 unsigned : 1;
1228 unsigned : 1;
1229 unsigned : 1;
1232 struct
1234 unsigned T5GSS : 2;
1235 unsigned : 6;
1237 } __T5GCONbits_t;
1239 extern __at(0x0F21) volatile __T5GCONbits_t T5GCONbits;
1241 #define _T5GSS0 0x01
1242 #define _T5GSS1 0x02
1243 #define _T5GVAL 0x04
1244 #define _T5GGO_NOT_T5DONE 0x08
1245 #define _T5GGO 0x08
1246 #define _NOT_T5DONE 0x08
1247 #define _T5DONE 0x08
1248 #define _T5GSPM 0x10
1249 #define _T5GTM 0x20
1250 #define _T5GPOL 0x40
1251 #define _TMR5GE 0x80
1253 //==============================================================================
1256 //==============================================================================
1257 // T5CON Bits
1259 extern __at(0x0F22) __sfr T5CON;
1261 typedef union
1263 struct
1265 unsigned TMR5ON : 1;
1266 unsigned RD16 : 1;
1267 unsigned NOT_T5SYNC : 1;
1268 unsigned T5OSCEN : 1;
1269 unsigned T5CKPS0 : 1;
1270 unsigned T5CKPS1 : 1;
1271 unsigned TMR5CS0 : 1;
1272 unsigned TMR5CS1 : 1;
1275 struct
1277 unsigned : 4;
1278 unsigned T5CKPS : 2;
1279 unsigned : 2;
1282 struct
1284 unsigned : 6;
1285 unsigned TMR5CS : 2;
1287 } __T5CONbits_t;
1289 extern __at(0x0F22) volatile __T5CONbits_t T5CONbits;
1291 #define _T5CON_TMR5ON 0x01
1292 #define _T5CON_RD16 0x02
1293 #define _T5CON_NOT_T5SYNC 0x04
1294 #define _T5CON_T5OSCEN 0x08
1295 #define _T5CON_T5CKPS0 0x10
1296 #define _T5CON_T5CKPS1 0x20
1297 #define _T5CON_TMR5CS0 0x40
1298 #define _T5CON_TMR5CS1 0x80
1300 //==============================================================================
1302 extern __at(0x0F23) __sfr TMR5L;
1303 extern __at(0x0F24) __sfr TMR5H;
1305 //==============================================================================
1306 // CM3CON Bits
1308 extern __at(0x0F25) __sfr CM3CON;
1310 typedef union
1312 struct
1314 unsigned CCH0 : 1;
1315 unsigned CCH1 : 1;
1316 unsigned CREF : 1;
1317 unsigned EVPOL0 : 1;
1318 unsigned EVPOL1 : 1;
1319 unsigned CPOL : 1;
1320 unsigned COE : 1;
1321 unsigned CON : 1;
1324 struct
1326 unsigned CCH : 2;
1327 unsigned : 6;
1330 struct
1332 unsigned : 3;
1333 unsigned EVPOL : 2;
1334 unsigned : 3;
1336 } __CM3CONbits_t;
1338 extern __at(0x0F25) volatile __CM3CONbits_t CM3CONbits;
1340 #define _CM3CON_CCH0 0x01
1341 #define _CM3CON_CCH1 0x02
1342 #define _CM3CON_CREF 0x04
1343 #define _CM3CON_EVPOL0 0x08
1344 #define _CM3CON_EVPOL1 0x10
1345 #define _CM3CON_CPOL 0x20
1346 #define _CM3CON_COE 0x40
1347 #define _CM3CON_CON 0x80
1349 //==============================================================================
1351 extern __at(0x0F3A) __sfr RTCVALL;
1352 extern __at(0x0F3B) __sfr RTCVALH;
1354 //==============================================================================
1355 // PADCFG1 Bits
1357 extern __at(0x0F3C) __sfr PADCFG1;
1359 typedef union
1361 struct
1363 unsigned : 1;
1364 unsigned RTSECSEL0 : 1;
1365 unsigned RTSECSEL1 : 1;
1366 unsigned : 1;
1367 unsigned : 1;
1368 unsigned : 1;
1369 unsigned : 1;
1370 unsigned : 1;
1373 struct
1375 unsigned : 1;
1376 unsigned RTSECSEL : 2;
1377 unsigned : 5;
1379 } __PADCFG1bits_t;
1381 extern __at(0x0F3C) volatile __PADCFG1bits_t PADCFG1bits;
1383 #define _RTSECSEL0 0x02
1384 #define _RTSECSEL1 0x04
1386 //==============================================================================
1389 //==============================================================================
1390 // REFOCON Bits
1392 extern __at(0x0F3D) __sfr REFOCON;
1394 typedef union
1396 struct
1398 unsigned RODIV0 : 1;
1399 unsigned RODIV1 : 1;
1400 unsigned RODIV2 : 1;
1401 unsigned RODIV3 : 1;
1402 unsigned ROSEL : 1;
1403 unsigned ROSSLP : 1;
1404 unsigned : 1;
1405 unsigned ROON : 1;
1408 struct
1410 unsigned RODIV : 4;
1411 unsigned : 4;
1413 } __REFOCONbits_t;
1415 extern __at(0x0F3D) volatile __REFOCONbits_t REFOCONbits;
1417 #define _RODIV0 0x01
1418 #define _RODIV1 0x02
1419 #define _RODIV2 0x04
1420 #define _RODIV3 0x08
1421 #define _ROSEL 0x10
1422 #define _ROSSLP 0x20
1423 #define _ROON 0x80
1425 //==============================================================================
1428 //==============================================================================
1429 // RTCCAL Bits
1431 extern __at(0x0F3E) __sfr RTCCAL;
1433 typedef struct
1435 unsigned CAL0 : 1;
1436 unsigned CAL1 : 1;
1437 unsigned CAL2 : 1;
1438 unsigned CAL3 : 1;
1439 unsigned CAL4 : 1;
1440 unsigned CAL5 : 1;
1441 unsigned CAL6 : 1;
1442 unsigned CAL7 : 1;
1443 } __RTCCALbits_t;
1445 extern __at(0x0F3E) volatile __RTCCALbits_t RTCCALbits;
1447 #define _CAL0 0x01
1448 #define _CAL1 0x02
1449 #define _CAL2 0x04
1450 #define _CAL3 0x08
1451 #define _CAL4 0x10
1452 #define _CAL5 0x20
1453 #define _CAL6 0x40
1454 #define _CAL7 0x80
1456 //==============================================================================
1459 //==============================================================================
1460 // RTCCFG Bits
1462 extern __at(0x0F3F) __sfr RTCCFG;
1464 typedef union
1466 struct
1468 unsigned RTCPTR0 : 1;
1469 unsigned RTCPTR1 : 1;
1470 unsigned RTCOE : 1;
1471 unsigned HALFSEC : 1;
1472 unsigned RTCSYNC : 1;
1473 unsigned RTCWREN : 1;
1474 unsigned : 1;
1475 unsigned RTCEN : 1;
1478 struct
1480 unsigned RTCPTR : 2;
1481 unsigned : 6;
1483 } __RTCCFGbits_t;
1485 extern __at(0x0F3F) volatile __RTCCFGbits_t RTCCFGbits;
1487 #define _RTCPTR0 0x01
1488 #define _RTCPTR1 0x02
1489 #define _RTCOE 0x04
1490 #define _HALFSEC 0x08
1491 #define _RTCSYNC 0x10
1492 #define _RTCWREN 0x20
1493 #define _RTCEN 0x80
1495 //==============================================================================
1498 //==============================================================================
1499 // ODCON3 Bits
1501 extern __at(0x0F40) __sfr ODCON3;
1503 typedef struct
1505 unsigned SPI1OD : 1;
1506 unsigned SPI2OD : 1;
1507 unsigned : 1;
1508 unsigned : 1;
1509 unsigned : 1;
1510 unsigned : 1;
1511 unsigned : 1;
1512 unsigned CTMUDS : 1;
1513 } __ODCON3bits_t;
1515 extern __at(0x0F40) volatile __ODCON3bits_t ODCON3bits;
1517 #define _SPI1OD 0x01
1518 #define _SPI2OD 0x02
1519 #define _CTMUDS 0x80
1521 //==============================================================================
1524 //==============================================================================
1525 // ODCON2 Bits
1527 extern __at(0x0F41) __sfr ODCON2;
1529 typedef struct
1531 unsigned U1OD : 1;
1532 unsigned U2OD : 1;
1533 unsigned CCP9OD : 1;
1534 unsigned CCP10OD : 1;
1535 unsigned : 1;
1536 unsigned : 1;
1537 unsigned : 1;
1538 unsigned : 1;
1539 } __ODCON2bits_t;
1541 extern __at(0x0F41) volatile __ODCON2bits_t ODCON2bits;
1543 #define _U1OD 0x01
1544 #define _U2OD 0x02
1545 #define _CCP9OD 0x04
1546 #define _CCP10OD 0x08
1548 //==============================================================================
1551 //==============================================================================
1552 // ODCON1 Bits
1554 extern __at(0x0F42) __sfr ODCON1;
1556 typedef struct
1558 unsigned ECCP1OD : 1;
1559 unsigned ECCP2OD : 1;
1560 unsigned ECCP3OD : 1;
1561 unsigned CCP4OD : 1;
1562 unsigned CCP5OD : 1;
1563 unsigned CCP6OD : 1;
1564 unsigned CCP7OD : 1;
1565 unsigned CCP8OD : 1;
1566 } __ODCON1bits_t;
1568 extern __at(0x0F42) volatile __ODCON1bits_t ODCON1bits;
1570 #define _ECCP1OD 0x01
1571 #define _ECCP2OD 0x02
1572 #define _ECCP3OD 0x04
1573 #define _CCP4OD 0x08
1574 #define _CCP5OD 0x10
1575 #define _CCP6OD 0x20
1576 #define _CCP7OD 0x40
1577 #define _CCP8OD 0x80
1579 //==============================================================================
1581 extern __at(0x0F44) __sfr ALRMVALL;
1582 extern __at(0x0F45) __sfr ALRMVALH;
1584 //==============================================================================
1585 // ALRMRPT Bits
1587 extern __at(0x0F46) __sfr ALRMRPT;
1589 typedef struct
1591 unsigned ARPT0 : 1;
1592 unsigned ARPT1 : 1;
1593 unsigned ARPT2 : 1;
1594 unsigned ARPT3 : 1;
1595 unsigned ARPT4 : 1;
1596 unsigned ARPT5 : 1;
1597 unsigned ARPT6 : 1;
1598 unsigned ARPT7 : 1;
1599 } __ALRMRPTbits_t;
1601 extern __at(0x0F46) volatile __ALRMRPTbits_t ALRMRPTbits;
1603 #define _ARPT0 0x01
1604 #define _ARPT1 0x02
1605 #define _ARPT2 0x04
1606 #define _ARPT3 0x08
1607 #define _ARPT4 0x10
1608 #define _ARPT5 0x20
1609 #define _ARPT6 0x40
1610 #define _ARPT7 0x80
1612 //==============================================================================
1615 //==============================================================================
1616 // ALRMCFG Bits
1618 extern __at(0x0F47) __sfr ALRMCFG;
1620 typedef union
1622 struct
1624 unsigned ALRMPTR0 : 1;
1625 unsigned ALRMPTR1 : 1;
1626 unsigned AMASK0 : 1;
1627 unsigned AMASK1 : 1;
1628 unsigned AMASK2 : 1;
1629 unsigned AMASK3 : 1;
1630 unsigned CHIME : 1;
1631 unsigned ALRMEN : 1;
1634 struct
1636 unsigned ALRMPTR : 2;
1637 unsigned : 6;
1640 struct
1642 unsigned : 2;
1643 unsigned AMASK : 4;
1644 unsigned : 2;
1646 } __ALRMCFGbits_t;
1648 extern __at(0x0F47) volatile __ALRMCFGbits_t ALRMCFGbits;
1650 #define _ALRMPTR0 0x01
1651 #define _ALRMPTR1 0x02
1652 #define _AMASK0 0x04
1653 #define _AMASK1 0x08
1654 #define _AMASK2 0x10
1655 #define _AMASK3 0x20
1656 #define _CHIME 0x40
1657 #define _ALRMEN 0x80
1659 //==============================================================================
1662 //==============================================================================
1663 // ANCON0 Bits
1665 extern __at(0x0F48) __sfr ANCON0;
1667 typedef union
1669 struct
1671 unsigned PCFG0 : 1;
1672 unsigned PCFG1 : 1;
1673 unsigned PCFG2 : 1;
1674 unsigned PCFG3 : 1;
1675 unsigned PCFG4 : 1;
1676 unsigned : 1;
1677 unsigned : 1;
1678 unsigned : 1;
1681 struct
1683 unsigned PCFG : 5;
1684 unsigned : 3;
1686 } __ANCON0bits_t;
1688 extern __at(0x0F48) volatile __ANCON0bits_t ANCON0bits;
1690 #define _PCFG0 0x01
1691 #define _PCFG1 0x02
1692 #define _PCFG2 0x04
1693 #define _PCFG3 0x08
1694 #define _PCFG4 0x10
1696 //==============================================================================
1699 //==============================================================================
1700 // ANCON1 Bits
1702 extern __at(0x0F49) __sfr ANCON1;
1704 typedef struct
1706 unsigned PCFG8 : 1;
1707 unsigned PCFG9 : 1;
1708 unsigned PCFG10 : 1;
1709 unsigned PCFG11 : 1;
1710 unsigned PCFG12 : 1;
1711 unsigned : 1;
1712 unsigned : 1;
1713 unsigned VBGEN : 1;
1714 } __ANCON1bits_t;
1716 extern __at(0x0F49) volatile __ANCON1bits_t ANCON1bits;
1718 #define _PCFG8 0x01
1719 #define _PCFG9 0x02
1720 #define _PCFG10 0x04
1721 #define _PCFG11 0x08
1722 #define _PCFG12 0x10
1723 #define _VBGEN 0x80
1725 //==============================================================================
1728 //==============================================================================
1729 // DSWAKEL Bits
1731 extern __at(0x0F4A) __sfr DSWAKEL;
1733 typedef struct
1735 unsigned DSPOR : 1;
1736 unsigned : 1;
1737 unsigned DSMCLR : 1;
1738 unsigned DSRTC : 1;
1739 unsigned DSWDT : 1;
1740 unsigned DSULP : 1;
1741 unsigned : 1;
1742 unsigned DSFLT : 1;
1743 } __DSWAKELbits_t;
1745 extern __at(0x0F4A) volatile __DSWAKELbits_t DSWAKELbits;
1747 #define _DSPOR 0x01
1748 #define _DSMCLR 0x04
1749 #define _DSRTC 0x08
1750 #define _DSWDT 0x10
1751 #define _DSULP 0x20
1752 #define _DSFLT 0x80
1754 //==============================================================================
1757 //==============================================================================
1758 // DSWAKEH Bits
1760 extern __at(0x0F4B) __sfr DSWAKEH;
1762 typedef struct
1764 unsigned DSINT0 : 1;
1765 unsigned : 1;
1766 unsigned : 1;
1767 unsigned : 1;
1768 unsigned : 1;
1769 unsigned : 1;
1770 unsigned : 1;
1771 unsigned : 1;
1772 } __DSWAKEHbits_t;
1774 extern __at(0x0F4B) volatile __DSWAKEHbits_t DSWAKEHbits;
1776 #define _DSINT0 0x01
1778 //==============================================================================
1781 //==============================================================================
1782 // DSCONL Bits
1784 extern __at(0x0F4C) __sfr DSCONL;
1786 typedef struct
1788 unsigned RELEASE : 1;
1789 unsigned DSBOR : 1;
1790 unsigned ULPWDIS : 1;
1791 unsigned : 1;
1792 unsigned : 1;
1793 unsigned : 1;
1794 unsigned : 1;
1795 unsigned : 1;
1796 } __DSCONLbits_t;
1798 extern __at(0x0F4C) volatile __DSCONLbits_t DSCONLbits;
1800 #define _RELEASE 0x01
1801 #define _DSBOR 0x02
1802 #define _ULPWDIS 0x04
1804 //==============================================================================
1807 //==============================================================================
1808 // DSCONH Bits
1810 extern __at(0x0F4D) __sfr DSCONH;
1812 typedef struct
1814 unsigned RTCWDIS : 1;
1815 unsigned DSULPEN : 1;
1816 unsigned : 1;
1817 unsigned : 1;
1818 unsigned : 1;
1819 unsigned : 1;
1820 unsigned : 1;
1821 unsigned DSEN : 1;
1822 } __DSCONHbits_t;
1824 extern __at(0x0F4D) volatile __DSCONHbits_t DSCONHbits;
1826 #define _RTCWDIS 0x01
1827 #define _DSULPEN 0x02
1828 #define _DSEN 0x80
1830 //==============================================================================
1832 extern __at(0x0F4E) __sfr DSGPR0;
1833 extern __at(0x0F4F) __sfr DSGPR1;
1835 //==============================================================================
1836 // CCPTMRS2 Bits
1838 extern __at(0x0F50) __sfr CCPTMRS2;
1840 typedef union
1842 struct
1844 unsigned C8TSEL0 : 1;
1845 unsigned C8TSEL1 : 1;
1846 unsigned C9TSEL0 : 1;
1847 unsigned : 1;
1848 unsigned C10TSEL0 : 1;
1849 unsigned : 1;
1850 unsigned : 1;
1851 unsigned : 1;
1854 struct
1856 unsigned C8TSEL : 2;
1857 unsigned : 6;
1859 } __CCPTMRS2bits_t;
1861 extern __at(0x0F50) volatile __CCPTMRS2bits_t CCPTMRS2bits;
1863 #define _C8TSEL0 0x01
1864 #define _C8TSEL1 0x02
1865 #define _C9TSEL0 0x04
1866 #define _C10TSEL0 0x10
1868 //==============================================================================
1871 //==============================================================================
1872 // CCPTMRS1 Bits
1874 extern __at(0x0F51) __sfr CCPTMRS1;
1876 typedef union
1878 struct
1880 unsigned C4TSEL0 : 1;
1881 unsigned C4TSEL1 : 1;
1882 unsigned C5TSEL0 : 1;
1883 unsigned : 1;
1884 unsigned C6TSEL0 : 1;
1885 unsigned : 1;
1886 unsigned C7TSEL0 : 1;
1887 unsigned C7TSEL1 : 1;
1890 struct
1892 unsigned C4TSEL : 2;
1893 unsigned : 6;
1896 struct
1898 unsigned : 6;
1899 unsigned C7TSEL : 2;
1901 } __CCPTMRS1bits_t;
1903 extern __at(0x0F51) volatile __CCPTMRS1bits_t CCPTMRS1bits;
1905 #define _C4TSEL0 0x01
1906 #define _C4TSEL1 0x02
1907 #define _C5TSEL0 0x04
1908 #define _C6TSEL0 0x10
1909 #define _C7TSEL0 0x40
1910 #define _C7TSEL1 0x80
1912 //==============================================================================
1915 //==============================================================================
1916 // CCPTMRS0 Bits
1918 extern __at(0x0F52) __sfr CCPTMRS0;
1920 typedef union
1922 struct
1924 unsigned C1TSEL0 : 1;
1925 unsigned C1TSEL1 : 1;
1926 unsigned C1TSEL2 : 1;
1927 unsigned C2TSEL0 : 1;
1928 unsigned C2TSEL1 : 1;
1929 unsigned C2TSEL2 : 1;
1930 unsigned C3TSEL0 : 1;
1931 unsigned C3TSEL1 : 1;
1934 struct
1936 unsigned C1TSEL : 3;
1937 unsigned : 5;
1940 struct
1942 unsigned : 3;
1943 unsigned C2TSEL : 3;
1944 unsigned : 2;
1947 struct
1949 unsigned : 6;
1950 unsigned C3TSEL : 2;
1952 } __CCPTMRS0bits_t;
1954 extern __at(0x0F52) volatile __CCPTMRS0bits_t CCPTMRS0bits;
1956 #define _C1TSEL0 0x01
1957 #define _C1TSEL1 0x02
1958 #define _C1TSEL2 0x04
1959 #define _C2TSEL0 0x08
1960 #define _C2TSEL1 0x10
1961 #define _C2TSEL2 0x20
1962 #define _C3TSEL0 0x40
1963 #define _C3TSEL1 0x80
1965 //==============================================================================
1968 //==============================================================================
1969 // CVRCON Bits
1971 extern __at(0x0F53) __sfr CVRCON;
1973 typedef union
1975 struct
1977 unsigned CVR0 : 1;
1978 unsigned CVR1 : 1;
1979 unsigned CVR2 : 1;
1980 unsigned CVR3 : 1;
1981 unsigned CVRSS : 1;
1982 unsigned CVRR : 1;
1983 unsigned CVROE : 1;
1984 unsigned CVREN : 1;
1987 struct
1989 unsigned CVR : 4;
1990 unsigned : 4;
1992 } __CVRCONbits_t;
1994 extern __at(0x0F53) volatile __CVRCONbits_t CVRCONbits;
1996 #define _CVR0 0x01
1997 #define _CVR1 0x02
1998 #define _CVR2 0x04
1999 #define _CVR3 0x08
2000 #define _CVRSS 0x10
2001 #define _CVRR 0x20
2002 #define _CVROE 0x40
2003 #define _CVREN 0x80
2005 //==============================================================================
2007 extern __at(0x0F66) __sfr DMABCH;
2008 extern __at(0x0F67) __sfr DMABCL;
2009 extern __at(0x0F68) __sfr RXADDRH;
2010 extern __at(0x0F69) __sfr RXADDRL;
2011 extern __at(0x0F6A) __sfr TXADDRH;
2012 extern __at(0x0F6B) __sfr TXADDRL;
2014 //==============================================================================
2015 // CMSTAT Bits
2017 extern __at(0x0F70) __sfr CMSTAT;
2019 typedef struct
2021 unsigned COUT1 : 1;
2022 unsigned COUT2 : 1;
2023 unsigned COUT3 : 1;
2024 unsigned : 1;
2025 unsigned : 1;
2026 unsigned : 1;
2027 unsigned : 1;
2028 unsigned : 1;
2029 } __CMSTATbits_t;
2031 extern __at(0x0F70) volatile __CMSTATbits_t CMSTATbits;
2033 #define _COUT1 0x01
2034 #define _COUT2 0x02
2035 #define _COUT3 0x04
2037 //==============================================================================
2040 //==============================================================================
2041 // CMSTATUS Bits
2043 extern __at(0x0F70) __sfr CMSTATUS;
2045 typedef struct
2047 unsigned COUT1 : 1;
2048 unsigned COUT2 : 1;
2049 unsigned COUT3 : 1;
2050 unsigned : 1;
2051 unsigned : 1;
2052 unsigned : 1;
2053 unsigned : 1;
2054 unsigned : 1;
2055 } __CMSTATUSbits_t;
2057 extern __at(0x0F70) volatile __CMSTATUSbits_t CMSTATUSbits;
2059 #define _CMSTATUS_COUT1 0x01
2060 #define _CMSTATUS_COUT2 0x02
2061 #define _CMSTATUS_COUT3 0x04
2063 //==============================================================================
2066 //==============================================================================
2067 // SSP2CON2 Bits
2069 extern __at(0x0F71) __sfr SSP2CON2;
2071 typedef union
2073 struct
2075 unsigned SEN : 1;
2076 unsigned RSEN : 1;
2077 unsigned PEN : 1;
2078 unsigned RCEN : 1;
2079 unsigned ACKEN : 1;
2080 unsigned ACKDT : 1;
2081 unsigned ACKSTAT : 1;
2082 unsigned GCEN : 1;
2085 struct
2087 unsigned : 1;
2088 unsigned ADMSK1 : 1;
2089 unsigned ADMSK2 : 1;
2090 unsigned ADMSK3 : 1;
2091 unsigned ADMSK4 : 1;
2092 unsigned ADMSK5 : 1;
2093 unsigned : 1;
2094 unsigned : 1;
2096 } __SSP2CON2bits_t;
2098 extern __at(0x0F71) volatile __SSP2CON2bits_t SSP2CON2bits;
2100 #define _SSP2CON2_SEN 0x01
2101 #define _SSP2CON2_RSEN 0x02
2102 #define _SSP2CON2_ADMSK1 0x02
2103 #define _SSP2CON2_PEN 0x04
2104 #define _SSP2CON2_ADMSK2 0x04
2105 #define _SSP2CON2_RCEN 0x08
2106 #define _SSP2CON2_ADMSK3 0x08
2107 #define _SSP2CON2_ACKEN 0x10
2108 #define _SSP2CON2_ADMSK4 0x10
2109 #define _SSP2CON2_ACKDT 0x20
2110 #define _SSP2CON2_ADMSK5 0x20
2111 #define _SSP2CON2_ACKSTAT 0x40
2112 #define _SSP2CON2_GCEN 0x80
2114 //==============================================================================
2117 //==============================================================================
2118 // SSP2CON1 Bits
2120 extern __at(0x0F72) __sfr SSP2CON1;
2122 typedef union
2124 struct
2126 unsigned SSPM0 : 1;
2127 unsigned SSPM1 : 1;
2128 unsigned SSPM2 : 1;
2129 unsigned SSPM3 : 1;
2130 unsigned CKP : 1;
2131 unsigned SSPEN : 1;
2132 unsigned SSPOV : 1;
2133 unsigned WCOL : 1;
2136 struct
2138 unsigned SSPM : 4;
2139 unsigned : 4;
2141 } __SSP2CON1bits_t;
2143 extern __at(0x0F72) volatile __SSP2CON1bits_t SSP2CON1bits;
2145 #define _SSP2CON1_SSPM0 0x01
2146 #define _SSP2CON1_SSPM1 0x02
2147 #define _SSP2CON1_SSPM2 0x04
2148 #define _SSP2CON1_SSPM3 0x08
2149 #define _SSP2CON1_CKP 0x10
2150 #define _SSP2CON1_SSPEN 0x20
2151 #define _SSP2CON1_SSPOV 0x40
2152 #define _SSP2CON1_WCOL 0x80
2154 //==============================================================================
2157 //==============================================================================
2158 // SSP2STAT Bits
2160 extern __at(0x0F73) __sfr SSP2STAT;
2162 typedef struct
2164 unsigned BF : 1;
2165 unsigned UA : 1;
2166 unsigned R_NOT_W : 1;
2167 unsigned S : 1;
2168 unsigned P : 1;
2169 unsigned D_NOT_A : 1;
2170 unsigned CKE : 1;
2171 unsigned SMP : 1;
2172 } __SSP2STATbits_t;
2174 extern __at(0x0F73) volatile __SSP2STATbits_t SSP2STATbits;
2176 #define _SSP2STAT_BF 0x01
2177 #define _SSP2STAT_UA 0x02
2178 #define _SSP2STAT_R_NOT_W 0x04
2179 #define _SSP2STAT_S 0x08
2180 #define _SSP2STAT_P 0x10
2181 #define _SSP2STAT_D_NOT_A 0x20
2182 #define _SSP2STAT_CKE 0x40
2183 #define _SSP2STAT_SMP 0x80
2185 //==============================================================================
2187 extern __at(0x0F74) __sfr SSP2ADD;
2189 //==============================================================================
2190 // SSP2MSK Bits
2192 extern __at(0x0F74) __sfr SSP2MSK;
2194 typedef struct
2196 unsigned MSK0 : 1;
2197 unsigned MSK1 : 1;
2198 unsigned MSK2 : 1;
2199 unsigned MSK3 : 1;
2200 unsigned MSK4 : 1;
2201 unsigned MSK5 : 1;
2202 unsigned MSK6 : 1;
2203 unsigned MSK7 : 1;
2204 } __SSP2MSKbits_t;
2206 extern __at(0x0F74) volatile __SSP2MSKbits_t SSP2MSKbits;
2208 #define _SSP2MSK_MSK0 0x01
2209 #define _SSP2MSK_MSK1 0x02
2210 #define _SSP2MSK_MSK2 0x04
2211 #define _SSP2MSK_MSK3 0x08
2212 #define _SSP2MSK_MSK4 0x10
2213 #define _SSP2MSK_MSK5 0x20
2214 #define _SSP2MSK_MSK6 0x40
2215 #define _SSP2MSK_MSK7 0x80
2217 //==============================================================================
2219 extern __at(0x0F75) __sfr SSP2BUF;
2221 //==============================================================================
2222 // T4CON Bits
2224 extern __at(0x0F76) __sfr T4CON;
2226 typedef union
2228 struct
2230 unsigned T4CKPS0 : 1;
2231 unsigned T4CKPS1 : 1;
2232 unsigned TMR4ON : 1;
2233 unsigned T4OUTPS0 : 1;
2234 unsigned T4OUTPS1 : 1;
2235 unsigned T4OUTPS2 : 1;
2236 unsigned T4OUTPS3 : 1;
2237 unsigned : 1;
2240 struct
2242 unsigned T4CKPS : 2;
2243 unsigned : 6;
2246 struct
2248 unsigned : 3;
2249 unsigned T4OUTPS : 4;
2250 unsigned : 1;
2252 } __T4CONbits_t;
2254 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
2256 #define _T4CKPS0 0x01
2257 #define _T4CKPS1 0x02
2258 #define _TMR4ON 0x04
2259 #define _T4OUTPS0 0x08
2260 #define _T4OUTPS1 0x10
2261 #define _T4OUTPS2 0x20
2262 #define _T4OUTPS3 0x40
2264 //==============================================================================
2266 extern __at(0x0F77) __sfr PR4;
2267 extern __at(0x0F78) __sfr TMR4;
2269 //==============================================================================
2270 // T3CON Bits
2272 extern __at(0x0F79) __sfr T3CON;
2274 typedef union
2276 struct
2278 unsigned TMR3ON : 1;
2279 unsigned RD16 : 1;
2280 unsigned NOT_T3SYNC : 1;
2281 unsigned T3OSCEN : 1;
2282 unsigned T3CKPS0 : 1;
2283 unsigned T3CKPS1 : 1;
2284 unsigned TMR3CS0 : 1;
2285 unsigned TMR3CS1 : 1;
2288 struct
2290 unsigned : 4;
2291 unsigned T3CKPS : 2;
2292 unsigned : 2;
2295 struct
2297 unsigned : 6;
2298 unsigned TMR3CS : 2;
2300 } __T3CONbits_t;
2302 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits;
2304 #define _T3CON_TMR3ON 0x01
2305 #define _T3CON_RD16 0x02
2306 #define _T3CON_NOT_T3SYNC 0x04
2307 #define _T3CON_T3OSCEN 0x08
2308 #define _T3CON_T3CKPS0 0x10
2309 #define _T3CON_T3CKPS1 0x20
2310 #define _T3CON_TMR3CS0 0x40
2311 #define _T3CON_TMR3CS1 0x80
2313 //==============================================================================
2315 extern __at(0x0F7A) __sfr TMR3;
2316 extern __at(0x0F7A) __sfr TMR3L;
2317 extern __at(0x0F7B) __sfr TMR3H;
2319 //==============================================================================
2320 // BAUDCON2 Bits
2322 extern __at(0x0F7C) __sfr BAUDCON2;
2324 typedef struct
2326 unsigned ABDEN : 1;
2327 unsigned WUE : 1;
2328 unsigned : 1;
2329 unsigned BRG16 : 1;
2330 unsigned TXCKP : 1;
2331 unsigned RXDTP : 1;
2332 unsigned RCIDL : 1;
2333 unsigned ABDOVF : 1;
2334 } __BAUDCON2bits_t;
2336 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
2338 #define _BAUDCON2_ABDEN 0x01
2339 #define _BAUDCON2_WUE 0x02
2340 #define _BAUDCON2_BRG16 0x08
2341 #define _BAUDCON2_TXCKP 0x10
2342 #define _BAUDCON2_RXDTP 0x20
2343 #define _BAUDCON2_RCIDL 0x40
2344 #define _BAUDCON2_ABDOVF 0x80
2346 //==============================================================================
2348 extern __at(0x0F7D) __sfr SPBRGH2;
2350 //==============================================================================
2351 // BAUDCON Bits
2353 extern __at(0x0F7E) __sfr BAUDCON;
2355 typedef struct
2357 unsigned ABDEN : 1;
2358 unsigned WUE : 1;
2359 unsigned : 1;
2360 unsigned BRG16 : 1;
2361 unsigned TXCKP : 1;
2362 unsigned RXDTP : 1;
2363 unsigned RCIDL : 1;
2364 unsigned ABDOVF : 1;
2365 } __BAUDCONbits_t;
2367 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
2369 #define _ABDEN 0x01
2370 #define _WUE 0x02
2371 #define _BRG16 0x08
2372 #define _TXCKP 0x10
2373 #define _RXDTP 0x20
2374 #define _RCIDL 0x40
2375 #define _ABDOVF 0x80
2377 //==============================================================================
2380 //==============================================================================
2381 // BAUDCON1 Bits
2383 extern __at(0x0F7E) __sfr BAUDCON1;
2385 typedef struct
2387 unsigned ABDEN : 1;
2388 unsigned WUE : 1;
2389 unsigned : 1;
2390 unsigned BRG16 : 1;
2391 unsigned TXCKP : 1;
2392 unsigned RXDTP : 1;
2393 unsigned RCIDL : 1;
2394 unsigned ABDOVF : 1;
2395 } __BAUDCON1bits_t;
2397 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
2399 #define _BAUDCON1_ABDEN 0x01
2400 #define _BAUDCON1_WUE 0x02
2401 #define _BAUDCON1_BRG16 0x08
2402 #define _BAUDCON1_TXCKP 0x10
2403 #define _BAUDCON1_RXDTP 0x20
2404 #define _BAUDCON1_RCIDL 0x40
2405 #define _BAUDCON1_ABDOVF 0x80
2407 //==============================================================================
2410 //==============================================================================
2411 // BAUDCTL Bits
2413 extern __at(0x0F7E) __sfr BAUDCTL;
2415 typedef struct
2417 unsigned ABDEN : 1;
2418 unsigned WUE : 1;
2419 unsigned : 1;
2420 unsigned BRG16 : 1;
2421 unsigned TXCKP : 1;
2422 unsigned RXDTP : 1;
2423 unsigned RCIDL : 1;
2424 unsigned ABDOVF : 1;
2425 } __BAUDCTLbits_t;
2427 extern __at(0x0F7E) volatile __BAUDCTLbits_t BAUDCTLbits;
2429 #define _BAUDCTL_ABDEN 0x01
2430 #define _BAUDCTL_WUE 0x02
2431 #define _BAUDCTL_BRG16 0x08
2432 #define _BAUDCTL_TXCKP 0x10
2433 #define _BAUDCTL_RXDTP 0x20
2434 #define _BAUDCTL_RCIDL 0x40
2435 #define _BAUDCTL_ABDOVF 0x80
2437 //==============================================================================
2439 extern __at(0x0F7F) __sfr SPBRGH;
2440 extern __at(0x0F7F) __sfr SPBRGH1;
2442 //==============================================================================
2443 // PORTA Bits
2445 extern __at(0x0F80) __sfr PORTA;
2447 typedef union
2449 struct
2451 unsigned RA0 : 1;
2452 unsigned RA1 : 1;
2453 unsigned RA2 : 1;
2454 unsigned RA3 : 1;
2455 unsigned : 1;
2456 unsigned RA5 : 1;
2457 unsigned RA6 : 1;
2458 unsigned RA7 : 1;
2461 struct
2463 unsigned AN0 : 1;
2464 unsigned AN1 : 1;
2465 unsigned AN2 : 1;
2466 unsigned AN3 : 1;
2467 unsigned : 1;
2468 unsigned AN4 : 1;
2469 unsigned OSC2 : 1;
2470 unsigned OSC1 : 1;
2473 struct
2475 unsigned C1INA : 1;
2476 unsigned C2INA : 1;
2477 unsigned VREF_MINUS : 1;
2478 unsigned VREF_PLUS : 1;
2479 unsigned : 1;
2480 unsigned NOT_SS1 : 1;
2481 unsigned CLKO : 1;
2482 unsigned CLKI : 1;
2485 struct
2487 unsigned RP0 : 1;
2488 unsigned RP1 : 1;
2489 unsigned CVREF : 1;
2490 unsigned C1INB : 1;
2491 unsigned : 1;
2492 unsigned HLVDIN : 1;
2493 unsigned : 1;
2494 unsigned : 1;
2497 struct
2499 unsigned ULPWU : 1;
2500 unsigned VBG : 1;
2501 unsigned C2INB : 1;
2502 unsigned : 1;
2503 unsigned : 1;
2504 unsigned RP2 : 1;
2505 unsigned : 1;
2506 unsigned : 1;
2509 struct
2511 unsigned : 1;
2512 unsigned : 1;
2513 unsigned C3INB : 1;
2514 unsigned : 1;
2515 unsigned : 1;
2516 unsigned C1INC : 1;
2517 unsigned : 1;
2518 unsigned : 1;
2521 struct
2523 unsigned : 1;
2524 unsigned : 1;
2525 unsigned C1IND : 1;
2526 unsigned : 1;
2527 unsigned : 1;
2528 unsigned : 1;
2529 unsigned : 1;
2530 unsigned : 1;
2532 } __PORTAbits_t;
2534 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
2536 #define _RA0 0x01
2537 #define _AN0 0x01
2538 #define _C1INA 0x01
2539 #define _RP0 0x01
2540 #define _ULPWU 0x01
2541 #define _RA1 0x02
2542 #define _AN1 0x02
2543 #define _C2INA 0x02
2544 #define _RP1 0x02
2545 #define _VBG 0x02
2546 #define _RA2 0x04
2547 #define _AN2 0x04
2548 #define _VREF_MINUS 0x04
2549 #define _CVREF 0x04
2550 #define _C2INB 0x04
2551 #define _C3INB 0x04
2552 #define _C1IND 0x04
2553 #define _RA3 0x08
2554 #define _AN3 0x08
2555 #define _VREF_PLUS 0x08
2556 #define _C1INB 0x08
2557 #define _RA5 0x20
2558 #define _AN4 0x20
2559 #define _NOT_SS1 0x20
2560 #define _HLVDIN 0x20
2561 #define _RP2 0x20
2562 #define _C1INC 0x20
2563 #define _RA6 0x40
2564 #define _OSC2 0x40
2565 #define _CLKO 0x40
2566 #define _RA7 0x80
2567 #define _OSC1 0x80
2568 #define _CLKI 0x80
2570 //==============================================================================
2573 //==============================================================================
2574 // PORTB Bits
2576 extern __at(0x0F81) __sfr PORTB;
2578 typedef union
2580 struct
2582 unsigned RB0 : 1;
2583 unsigned RB1 : 1;
2584 unsigned RB2 : 1;
2585 unsigned RB3 : 1;
2586 unsigned RB4 : 1;
2587 unsigned RB5 : 1;
2588 unsigned RB6 : 1;
2589 unsigned RB7 : 1;
2592 struct
2594 unsigned AN12 : 1;
2595 unsigned AN10 : 1;
2596 unsigned AN8 : 1;
2597 unsigned AN9 : 1;
2598 unsigned KBI0 : 1;
2599 unsigned KBI1 : 1;
2600 unsigned KBI2 : 1;
2601 unsigned KBI3 : 1;
2604 struct
2606 unsigned INT0 : 1;
2607 unsigned RTCC : 1;
2608 unsigned CTED1 : 1;
2609 unsigned CTED2 : 1;
2610 unsigned SCL2 : 1;
2611 unsigned SDA2 : 1;
2612 unsigned PGC : 1;
2613 unsigned PGD : 1;
2616 struct
2618 unsigned RP3 : 1;
2619 unsigned C3INC : 1;
2620 unsigned C2INC : 1;
2621 unsigned RP6 : 1;
2622 unsigned RP7 : 1;
2623 unsigned RP8 : 1;
2624 unsigned RP9 : 1;
2625 unsigned RP10 : 1;
2628 struct
2630 unsigned C3IND : 1;
2631 unsigned RP4 : 1;
2632 unsigned REFO : 1;
2633 unsigned C3INA : 1;
2634 unsigned CCP4 : 1;
2635 unsigned CCP5 : 1;
2636 unsigned CCP6 : 1;
2637 unsigned CCP7 : 1;
2640 struct
2642 unsigned : 1;
2643 unsigned : 1;
2644 unsigned RP5 : 1;
2645 unsigned : 1;
2646 unsigned : 1;
2647 unsigned : 1;
2648 unsigned : 1;
2649 unsigned : 1;
2652 struct
2654 unsigned : 4;
2655 unsigned KBI : 4;
2657 } __PORTBbits_t;
2659 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
2661 #define _RB0 0x01
2662 #define _AN12 0x01
2663 #define _INT0 0x01
2664 #define _RP3 0x01
2665 #define _C3IND 0x01
2666 #define _RB1 0x02
2667 #define _AN10 0x02
2668 #define _RTCC 0x02
2669 #define _C3INC 0x02
2670 #define _RP4 0x02
2671 #define _RB2 0x04
2672 #define _AN8 0x04
2673 #define _CTED1 0x04
2674 #define _C2INC 0x04
2675 #define _REFO 0x04
2676 #define _RP5 0x04
2677 #define _RB3 0x08
2678 #define _AN9 0x08
2679 #define _CTED2 0x08
2680 #define _RP6 0x08
2681 #define _C3INA 0x08
2682 #define _RB4 0x10
2683 #define _KBI0 0x10
2684 #define _SCL2 0x10
2685 #define _RP7 0x10
2686 #define _CCP4 0x10
2687 #define _RB5 0x20
2688 #define _KBI1 0x20
2689 #define _SDA2 0x20
2690 #define _RP8 0x20
2691 #define _CCP5 0x20
2692 #define _RB6 0x40
2693 #define _KBI2 0x40
2694 #define _PGC 0x40
2695 #define _RP9 0x40
2696 #define _CCP6 0x40
2697 #define _RB7 0x80
2698 #define _KBI3 0x80
2699 #define _PGD 0x80
2700 #define _RP10 0x80
2701 #define _CCP7 0x80
2703 //==============================================================================
2706 //==============================================================================
2707 // PORTC Bits
2709 extern __at(0x0F82) __sfr PORTC;
2711 typedef union
2713 struct
2715 unsigned RC0 : 1;
2716 unsigned RC1 : 1;
2717 unsigned RC2 : 1;
2718 unsigned RC3 : 1;
2719 unsigned RC4 : 1;
2720 unsigned RC5 : 1;
2721 unsigned RC6 : 1;
2722 unsigned RC7 : 1;
2725 struct
2727 unsigned T1OSO : 1;
2728 unsigned T1OSI : 1;
2729 unsigned AN11 : 1;
2730 unsigned SCL1 : 1;
2731 unsigned SDA1 : 1;
2732 unsigned RP16 : 1;
2733 unsigned TX1 : 1;
2734 unsigned RX1 : 1;
2737 struct
2739 unsigned T1CKI : 1;
2740 unsigned RP12 : 1;
2741 unsigned CTPLS : 1;
2742 unsigned RP14 : 1;
2743 unsigned RP15 : 1;
2744 unsigned SDO1 : 1;
2745 unsigned CK1 : 1;
2746 unsigned DT1 : 1;
2749 struct
2751 unsigned RP11 : 1;
2752 unsigned CCP8 : 1;
2753 unsigned RP13 : 1;
2754 unsigned SCK1 : 1;
2755 unsigned SDI1 : 1;
2756 unsigned : 1;
2757 unsigned CCP9 : 1;
2758 unsigned CCP10 : 1;
2761 struct
2763 unsigned : 1;
2764 unsigned : 1;
2765 unsigned C2IND : 1;
2766 unsigned : 1;
2767 unsigned : 1;
2768 unsigned : 1;
2769 unsigned RP17 : 1;
2770 unsigned RP18 : 1;
2772 } __PORTCbits_t;
2774 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
2776 #define _RC0 0x01
2777 #define _T1OSO 0x01
2778 #define _T1CKI 0x01
2779 #define _RP11 0x01
2780 #define _RC1 0x02
2781 #define _T1OSI 0x02
2782 #define _RP12 0x02
2783 #define _CCP8 0x02
2784 #define _RC2 0x04
2785 #define _AN11 0x04
2786 #define _CTPLS 0x04
2787 #define _RP13 0x04
2788 #define _C2IND 0x04
2789 #define _RC3 0x08
2790 #define _SCL1 0x08
2791 #define _RP14 0x08
2792 #define _SCK1 0x08
2793 #define _RC4 0x10
2794 #define _SDA1 0x10
2795 #define _RP15 0x10
2796 #define _SDI1 0x10
2797 #define _RC5 0x20
2798 #define _RP16 0x20
2799 #define _SDO1 0x20
2800 #define _RC6 0x40
2801 #define _TX1 0x40
2802 #define _CK1 0x40
2803 #define _CCP9 0x40
2804 #define _RP17 0x40
2805 #define _RC7 0x80
2806 #define _RX1 0x80
2807 #define _DT1 0x80
2808 #define _CCP10 0x80
2809 #define _RP18 0x80
2811 //==============================================================================
2814 //==============================================================================
2815 // HLVDCON Bits
2817 extern __at(0x0F85) __sfr HLVDCON;
2819 typedef union
2821 struct
2823 unsigned HLVDL0 : 1;
2824 unsigned HLVDL1 : 1;
2825 unsigned HLVDL2 : 1;
2826 unsigned HLVDL3 : 1;
2827 unsigned HLVDEN : 1;
2828 unsigned IRVST : 1;
2829 unsigned BGVST : 1;
2830 unsigned VDIRMAG : 1;
2833 struct
2835 unsigned HLVDL : 4;
2836 unsigned : 4;
2838 } __HLVDCONbits_t;
2840 extern __at(0x0F85) volatile __HLVDCONbits_t HLVDCONbits;
2842 #define _HLVDL0 0x01
2843 #define _HLVDL1 0x02
2844 #define _HLVDL2 0x04
2845 #define _HLVDL3 0x08
2846 #define _HLVDEN 0x10
2847 #define _IRVST 0x20
2848 #define _BGVST 0x40
2849 #define _VDIRMAG 0x80
2851 //==============================================================================
2854 //==============================================================================
2855 // DMACON2 Bits
2857 extern __at(0x0F86) __sfr DMACON2;
2859 typedef union
2861 struct
2863 unsigned INTLVL0 : 1;
2864 unsigned INTLVL1 : 1;
2865 unsigned INTLVL2 : 1;
2866 unsigned INTLVL3 : 1;
2867 unsigned DLYCYC0 : 1;
2868 unsigned DLYCYC1 : 1;
2869 unsigned DLYCYC2 : 1;
2870 unsigned DLYCYC3 : 1;
2873 struct
2875 unsigned INTLVL : 4;
2876 unsigned : 4;
2879 struct
2881 unsigned : 4;
2882 unsigned DLYCYC : 4;
2884 } __DMACON2bits_t;
2886 extern __at(0x0F86) volatile __DMACON2bits_t DMACON2bits;
2888 #define _INTLVL0 0x01
2889 #define _INTLVL1 0x02
2890 #define _INTLVL2 0x04
2891 #define _INTLVL3 0x08
2892 #define _DLYCYC0 0x10
2893 #define _DLYCYC1 0x20
2894 #define _DLYCYC2 0x40
2895 #define _DLYCYC3 0x80
2897 //==============================================================================
2900 //==============================================================================
2901 // OSCCON2 Bits
2903 extern __at(0x0F87) __sfr OSCCON2;
2905 typedef struct
2907 unsigned : 1;
2908 unsigned : 1;
2909 unsigned PRISD : 1;
2910 unsigned SOSCGO : 1;
2911 unsigned SOSCDRV : 1;
2912 unsigned : 1;
2913 unsigned SOSCRUN : 1;
2914 unsigned : 1;
2915 } __OSCCON2bits_t;
2917 extern __at(0x0F87) volatile __OSCCON2bits_t OSCCON2bits;
2919 #define _PRISD 0x04
2920 #define _SOSCGO 0x08
2921 #define _SOSCDRV 0x10
2922 #define _SOSCRUN 0x40
2924 //==============================================================================
2927 //==============================================================================
2928 // DMACON1 Bits
2930 extern __at(0x0F88) __sfr DMACON1;
2932 typedef union
2934 struct
2936 unsigned DMAEN : 1;
2937 unsigned DLYINTEN : 1;
2938 unsigned DUPLEX0 : 1;
2939 unsigned DUPLEX1 : 1;
2940 unsigned RXINC : 1;
2941 unsigned TXINC : 1;
2942 unsigned SSCON0 : 1;
2943 unsigned SSCON1 : 1;
2946 struct
2948 unsigned : 2;
2949 unsigned DUPLEX : 2;
2950 unsigned : 4;
2953 struct
2955 unsigned : 6;
2956 unsigned SSCON : 2;
2958 } __DMACON1bits_t;
2960 extern __at(0x0F88) volatile __DMACON1bits_t DMACON1bits;
2962 #define _DMAEN 0x01
2963 #define _DLYINTEN 0x02
2964 #define _DUPLEX0 0x04
2965 #define _DUPLEX1 0x08
2966 #define _RXINC 0x10
2967 #define _TXINC 0x20
2968 #define _SSCON0 0x40
2969 #define _SSCON1 0x80
2971 //==============================================================================
2974 //==============================================================================
2975 // LATA Bits
2977 extern __at(0x0F89) __sfr LATA;
2979 typedef struct
2981 unsigned LATA0 : 1;
2982 unsigned LATA1 : 1;
2983 unsigned LATA2 : 1;
2984 unsigned LATA3 : 1;
2985 unsigned : 1;
2986 unsigned LATA5 : 1;
2987 unsigned LATA6 : 1;
2988 unsigned LATA7 : 1;
2989 } __LATAbits_t;
2991 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2993 #define _LATA0 0x01
2994 #define _LATA1 0x02
2995 #define _LATA2 0x04
2996 #define _LATA3 0x08
2997 #define _LATA5 0x20
2998 #define _LATA6 0x40
2999 #define _LATA7 0x80
3001 //==============================================================================
3004 //==============================================================================
3005 // LATB Bits
3007 extern __at(0x0F8A) __sfr LATB;
3009 typedef struct
3011 unsigned LATB0 : 1;
3012 unsigned LATB1 : 1;
3013 unsigned LATB2 : 1;
3014 unsigned LATB3 : 1;
3015 unsigned LATB4 : 1;
3016 unsigned LATB5 : 1;
3017 unsigned LATB6 : 1;
3018 unsigned LATB7 : 1;
3019 } __LATBbits_t;
3021 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
3023 #define _LATB0 0x01
3024 #define _LATB1 0x02
3025 #define _LATB2 0x04
3026 #define _LATB3 0x08
3027 #define _LATB4 0x10
3028 #define _LATB5 0x20
3029 #define _LATB6 0x40
3030 #define _LATB7 0x80
3032 //==============================================================================
3035 //==============================================================================
3036 // LATC Bits
3038 extern __at(0x0F8B) __sfr LATC;
3040 typedef struct
3042 unsigned LATC0 : 1;
3043 unsigned LATC1 : 1;
3044 unsigned LATC2 : 1;
3045 unsigned LATC3 : 1;
3046 unsigned LATC4 : 1;
3047 unsigned LATC5 : 1;
3048 unsigned LATC6 : 1;
3049 unsigned LATC7 : 1;
3050 } __LATCbits_t;
3052 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
3054 #define _LATC0 0x01
3055 #define _LATC1 0x02
3056 #define _LATC2 0x04
3057 #define _LATC3 0x08
3058 #define _LATC4 0x10
3059 #define _LATC5 0x20
3060 #define _LATC6 0x40
3061 #define _LATC7 0x80
3063 //==============================================================================
3066 //==============================================================================
3067 // PIE4 Bits
3069 extern __at(0x0F8E) __sfr PIE4;
3071 typedef struct
3073 unsigned CCP3IE : 1;
3074 unsigned CCP4IE : 1;
3075 unsigned CCP5IE : 1;
3076 unsigned CCP6IE : 1;
3077 unsigned CCP7IE : 1;
3078 unsigned CCP8IE : 1;
3079 unsigned CCP9IE : 1;
3080 unsigned CCP10IE : 1;
3081 } __PIE4bits_t;
3083 extern __at(0x0F8E) volatile __PIE4bits_t PIE4bits;
3085 #define _CCP3IE 0x01
3086 #define _CCP4IE 0x02
3087 #define _CCP5IE 0x04
3088 #define _CCP6IE 0x08
3089 #define _CCP7IE 0x10
3090 #define _CCP8IE 0x20
3091 #define _CCP9IE 0x40
3092 #define _CCP10IE 0x80
3094 //==============================================================================
3097 //==============================================================================
3098 // PIR4 Bits
3100 extern __at(0x0F8F) __sfr PIR4;
3102 typedef struct
3104 unsigned CCP3IF : 1;
3105 unsigned CCP4IF : 1;
3106 unsigned CCP5IF : 1;
3107 unsigned CCP6IF : 1;
3108 unsigned CCP7IF : 1;
3109 unsigned CCP8IF : 1;
3110 unsigned CCP9IF : 1;
3111 unsigned CCP10IF : 1;
3112 } __PIR4bits_t;
3114 extern __at(0x0F8F) volatile __PIR4bits_t PIR4bits;
3116 #define _CCP3IF 0x01
3117 #define _CCP4IF 0x02
3118 #define _CCP5IF 0x04
3119 #define _CCP6IF 0x08
3120 #define _CCP7IF 0x10
3121 #define _CCP8IF 0x20
3122 #define _CCP9IF 0x40
3123 #define _CCP10IF 0x80
3125 //==============================================================================
3128 //==============================================================================
3129 // IPR4 Bits
3131 extern __at(0x0F90) __sfr IPR4;
3133 typedef struct
3135 unsigned CCP3IP : 1;
3136 unsigned CCP4IP : 1;
3137 unsigned CCP5IP : 1;
3138 unsigned CCP6IP : 1;
3139 unsigned CCP7IP : 1;
3140 unsigned CCP8IP : 1;
3141 unsigned CCP9IP : 1;
3142 unsigned CCP10IP : 1;
3143 } __IPR4bits_t;
3145 extern __at(0x0F90) volatile __IPR4bits_t IPR4bits;
3147 #define _CCP3IP 0x01
3148 #define _CCP4IP 0x02
3149 #define _CCP5IP 0x04
3150 #define _CCP6IP 0x08
3151 #define _CCP7IP 0x10
3152 #define _CCP8IP 0x20
3153 #define _CCP9IP 0x40
3154 #define _CCP10IP 0x80
3156 //==============================================================================
3159 //==============================================================================
3160 // PIE5 Bits
3162 extern __at(0x0F91) __sfr PIE5;
3164 typedef struct
3166 unsigned TMR1GIE : 1;
3167 unsigned TMR5GIE : 1;
3168 unsigned TMR5IE : 1;
3169 unsigned TMR6IE : 1;
3170 unsigned TMR8IE : 1;
3171 unsigned CM3IE : 1;
3172 unsigned : 1;
3173 unsigned : 1;
3174 } __PIE5bits_t;
3176 extern __at(0x0F91) volatile __PIE5bits_t PIE5bits;
3178 #define _TMR1GIE 0x01
3179 #define _TMR5GIE 0x02
3180 #define _TMR5IE 0x04
3181 #define _TMR6IE 0x08
3182 #define _TMR8IE 0x10
3183 #define _CM3IE 0x20
3185 //==============================================================================
3188 //==============================================================================
3189 // TRISA Bits
3191 extern __at(0x0F92) __sfr TRISA;
3193 typedef struct
3195 unsigned TRISA0 : 1;
3196 unsigned TRISA1 : 1;
3197 unsigned TRISA2 : 1;
3198 unsigned TRISA3 : 1;
3199 unsigned : 1;
3200 unsigned TRISA5 : 1;
3201 unsigned TRISA6 : 1;
3202 unsigned TRISA7 : 1;
3203 } __TRISAbits_t;
3205 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
3207 #define _TRISA0 0x01
3208 #define _TRISA1 0x02
3209 #define _TRISA2 0x04
3210 #define _TRISA3 0x08
3211 #define _TRISA5 0x20
3212 #define _TRISA6 0x40
3213 #define _TRISA7 0x80
3215 //==============================================================================
3218 //==============================================================================
3219 // TRISB Bits
3221 extern __at(0x0F93) __sfr TRISB;
3223 typedef struct
3225 unsigned TRISB0 : 1;
3226 unsigned TRISB1 : 1;
3227 unsigned TRISB2 : 1;
3228 unsigned TRISB3 : 1;
3229 unsigned TRISB4 : 1;
3230 unsigned TRISB5 : 1;
3231 unsigned TRISB6 : 1;
3232 unsigned TRISB7 : 1;
3233 } __TRISBbits_t;
3235 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3237 #define _TRISB0 0x01
3238 #define _TRISB1 0x02
3239 #define _TRISB2 0x04
3240 #define _TRISB3 0x08
3241 #define _TRISB4 0x10
3242 #define _TRISB5 0x20
3243 #define _TRISB6 0x40
3244 #define _TRISB7 0x80
3246 //==============================================================================
3249 //==============================================================================
3250 // TRISC Bits
3252 extern __at(0x0F94) __sfr TRISC;
3254 typedef struct
3256 unsigned TRISC0 : 1;
3257 unsigned TRISC1 : 1;
3258 unsigned TRISC2 : 1;
3259 unsigned TRISC3 : 1;
3260 unsigned TRISC4 : 1;
3261 unsigned TRISC5 : 1;
3262 unsigned TRISC6 : 1;
3263 unsigned TRISC7 : 1;
3264 } __TRISCbits_t;
3266 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3268 #define _TRISC0 0x01
3269 #define _TRISC1 0x02
3270 #define _TRISC2 0x04
3271 #define _TRISC3 0x08
3272 #define _TRISC4 0x10
3273 #define _TRISC5 0x20
3274 #define _TRISC6 0x40
3275 #define _TRISC7 0x80
3277 //==============================================================================
3280 //==============================================================================
3281 // T3GCON Bits
3283 extern __at(0x0F97) __sfr T3GCON;
3285 typedef union
3287 struct
3289 unsigned T3GSS0 : 1;
3290 unsigned T3GSS1 : 1;
3291 unsigned T3GVAL : 1;
3292 unsigned T3GGO_T3DONE : 1;
3293 unsigned T3GSPM : 1;
3294 unsigned T3GTM : 1;
3295 unsigned T3GPOL : 1;
3296 unsigned TMR3GE : 1;
3299 struct
3301 unsigned : 1;
3302 unsigned : 1;
3303 unsigned : 1;
3304 unsigned T3GGO : 1;
3305 unsigned : 1;
3306 unsigned : 1;
3307 unsigned : 1;
3308 unsigned : 1;
3311 struct
3313 unsigned : 1;
3314 unsigned : 1;
3315 unsigned : 1;
3316 unsigned T3DONE : 1;
3317 unsigned : 1;
3318 unsigned : 1;
3319 unsigned : 1;
3320 unsigned : 1;
3323 struct
3325 unsigned T3GSS : 2;
3326 unsigned : 6;
3328 } __T3GCONbits_t;
3330 extern __at(0x0F97) volatile __T3GCONbits_t T3GCONbits;
3332 #define _T3GSS0 0x01
3333 #define _T3GSS1 0x02
3334 #define _T3GVAL 0x04
3335 #define _T3GGO_T3DONE 0x08
3336 #define _T3GGO 0x08
3337 #define _T3DONE 0x08
3338 #define _T3GSPM 0x10
3339 #define _T3GTM 0x20
3340 #define _T3GPOL 0x40
3341 #define _TMR3GE 0x80
3343 //==============================================================================
3346 //==============================================================================
3347 // PIR5 Bits
3349 extern __at(0x0F98) __sfr PIR5;
3351 typedef struct
3353 unsigned TMR1GIF : 1;
3354 unsigned TMR5GIF : 1;
3355 unsigned TMR5IF : 1;
3356 unsigned TMR6IF : 1;
3357 unsigned TMR8IF : 1;
3358 unsigned CM3IF : 1;
3359 unsigned : 1;
3360 unsigned : 1;
3361 } __PIR5bits_t;
3363 extern __at(0x0F98) volatile __PIR5bits_t PIR5bits;
3365 #define _TMR1GIF 0x01
3366 #define _TMR5GIF 0x02
3367 #define _TMR5IF 0x04
3368 #define _TMR6IF 0x08
3369 #define _TMR8IF 0x10
3370 #define _CM3IF 0x20
3372 //==============================================================================
3375 //==============================================================================
3376 // IPR5 Bits
3378 extern __at(0x0F99) __sfr IPR5;
3380 typedef struct
3382 unsigned TMR1GIP : 1;
3383 unsigned TMR5GIP : 1;
3384 unsigned TMR5IP : 1;
3385 unsigned TMR6IP : 1;
3386 unsigned TMR8IP : 1;
3387 unsigned CM3IP : 1;
3388 unsigned : 1;
3389 unsigned : 1;
3390 } __IPR5bits_t;
3392 extern __at(0x0F99) volatile __IPR5bits_t IPR5bits;
3394 #define _TMR1GIP 0x01
3395 #define _TMR5GIP 0x02
3396 #define _TMR5IP 0x04
3397 #define _TMR6IP 0x08
3398 #define _TMR8IP 0x10
3399 #define _CM3IP 0x20
3401 //==============================================================================
3404 //==============================================================================
3405 // T1GCON Bits
3407 extern __at(0x0F9A) __sfr T1GCON;
3409 typedef union
3411 struct
3413 unsigned T1GSS0 : 1;
3414 unsigned T1GSS1 : 1;
3415 unsigned T1GVAL : 1;
3416 unsigned T1GGO_NOT_T1DONE : 1;
3417 unsigned T1GSPM : 1;
3418 unsigned T1GTM : 1;
3419 unsigned T1GPOL : 1;
3420 unsigned TMR1GE : 1;
3423 struct
3425 unsigned : 1;
3426 unsigned : 1;
3427 unsigned : 1;
3428 unsigned T1GGO : 1;
3429 unsigned : 1;
3430 unsigned : 1;
3431 unsigned : 1;
3432 unsigned : 1;
3435 struct
3437 unsigned : 1;
3438 unsigned : 1;
3439 unsigned : 1;
3440 unsigned NOT_T1DONE : 1;
3441 unsigned : 1;
3442 unsigned : 1;
3443 unsigned : 1;
3444 unsigned : 1;
3447 struct
3449 unsigned : 1;
3450 unsigned : 1;
3451 unsigned : 1;
3452 unsigned T1DONE : 1;
3453 unsigned : 1;
3454 unsigned : 1;
3455 unsigned : 1;
3456 unsigned : 1;
3459 struct
3461 unsigned T1GSS : 2;
3462 unsigned : 6;
3464 } __T1GCONbits_t;
3466 extern __at(0x0F9A) volatile __T1GCONbits_t T1GCONbits;
3468 #define _T1GSS0 0x01
3469 #define _T1GSS1 0x02
3470 #define _T1GVAL 0x04
3471 #define _T1GGO_NOT_T1DONE 0x08
3472 #define _T1GGO 0x08
3473 #define _NOT_T1DONE 0x08
3474 #define _T1DONE 0x08
3475 #define _T1GSPM 0x10
3476 #define _T1GTM 0x20
3477 #define _T1GPOL 0x40
3478 #define _TMR1GE 0x80
3480 //==============================================================================
3483 //==============================================================================
3484 // OSCTUNE Bits
3486 extern __at(0x0F9B) __sfr OSCTUNE;
3488 typedef union
3490 struct
3492 unsigned TUN0 : 1;
3493 unsigned TUN1 : 1;
3494 unsigned TUN2 : 1;
3495 unsigned TUN3 : 1;
3496 unsigned TUN4 : 1;
3497 unsigned TUN5 : 1;
3498 unsigned PLLEN : 1;
3499 unsigned INTSRC : 1;
3502 struct
3504 unsigned TUN : 6;
3505 unsigned : 2;
3507 } __OSCTUNEbits_t;
3509 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3511 #define _TUN0 0x01
3512 #define _TUN1 0x02
3513 #define _TUN2 0x04
3514 #define _TUN3 0x08
3515 #define _TUN4 0x10
3516 #define _TUN5 0x20
3517 #define _PLLEN 0x40
3518 #define _INTSRC 0x80
3520 //==============================================================================
3523 //==============================================================================
3524 // RCSTA2 Bits
3526 extern __at(0x0F9C) __sfr RCSTA2;
3528 typedef union
3530 struct
3532 unsigned RX9D : 1;
3533 unsigned OERR : 1;
3534 unsigned FERR : 1;
3535 unsigned ADDEN : 1;
3536 unsigned CREN : 1;
3537 unsigned SREN : 1;
3538 unsigned RX9 : 1;
3539 unsigned SPEN : 1;
3542 struct
3544 unsigned RX9D2 : 1;
3545 unsigned OERR2 : 1;
3546 unsigned FERR2 : 1;
3547 unsigned ADDEN2 : 1;
3548 unsigned CREN2 : 1;
3549 unsigned SREN2 : 1;
3550 unsigned RX92 : 1;
3551 unsigned SPEN2 : 1;
3553 } __RCSTA2bits_t;
3555 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
3557 #define _RCSTA2_RX9D 0x01
3558 #define _RCSTA2_RX9D2 0x01
3559 #define _RCSTA2_OERR 0x02
3560 #define _RCSTA2_OERR2 0x02
3561 #define _RCSTA2_FERR 0x04
3562 #define _RCSTA2_FERR2 0x04
3563 #define _RCSTA2_ADDEN 0x08
3564 #define _RCSTA2_ADDEN2 0x08
3565 #define _RCSTA2_CREN 0x10
3566 #define _RCSTA2_CREN2 0x10
3567 #define _RCSTA2_SREN 0x20
3568 #define _RCSTA2_SREN2 0x20
3569 #define _RCSTA2_RX9 0x40
3570 #define _RCSTA2_RX92 0x40
3571 #define _RCSTA2_SPEN 0x80
3572 #define _RCSTA2_SPEN2 0x80
3574 //==============================================================================
3577 //==============================================================================
3578 // PIE1 Bits
3580 extern __at(0x0F9D) __sfr PIE1;
3582 typedef union
3584 struct
3586 unsigned TMR1IE : 1;
3587 unsigned TMR2IE : 1;
3588 unsigned CCP1IE : 1;
3589 unsigned SSP1IE : 1;
3590 unsigned TX1IE : 1;
3591 unsigned RC1IE : 1;
3592 unsigned ADIE : 1;
3593 unsigned : 1;
3596 struct
3598 unsigned : 1;
3599 unsigned : 1;
3600 unsigned : 1;
3601 unsigned SSPIE : 1;
3602 unsigned TXIE : 1;
3603 unsigned RCIE : 1;
3604 unsigned : 1;
3605 unsigned : 1;
3607 } __PIE1bits_t;
3609 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3611 #define _TMR1IE 0x01
3612 #define _TMR2IE 0x02
3613 #define _CCP1IE 0x04
3614 #define _SSP1IE 0x08
3615 #define _SSPIE 0x08
3616 #define _TX1IE 0x10
3617 #define _TXIE 0x10
3618 #define _RC1IE 0x20
3619 #define _RCIE 0x20
3620 #define _ADIE 0x40
3622 //==============================================================================
3625 //==============================================================================
3626 // PIR1 Bits
3628 extern __at(0x0F9E) __sfr PIR1;
3630 typedef union
3632 struct
3634 unsigned TMR1IF : 1;
3635 unsigned TMR2IF : 1;
3636 unsigned CCP1IF : 1;
3637 unsigned SSP1IF : 1;
3638 unsigned TX1IF : 1;
3639 unsigned RC1IF : 1;
3640 unsigned ADIF : 1;
3641 unsigned : 1;
3644 struct
3646 unsigned : 1;
3647 unsigned : 1;
3648 unsigned : 1;
3649 unsigned SSPIF : 1;
3650 unsigned TXIF : 1;
3651 unsigned RCIF : 1;
3652 unsigned : 1;
3653 unsigned : 1;
3655 } __PIR1bits_t;
3657 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3659 #define _TMR1IF 0x01
3660 #define _TMR2IF 0x02
3661 #define _CCP1IF 0x04
3662 #define _SSP1IF 0x08
3663 #define _SSPIF 0x08
3664 #define _TX1IF 0x10
3665 #define _TXIF 0x10
3666 #define _RC1IF 0x20
3667 #define _RCIF 0x20
3668 #define _ADIF 0x40
3670 //==============================================================================
3673 //==============================================================================
3674 // IPR1 Bits
3676 extern __at(0x0F9F) __sfr IPR1;
3678 typedef union
3680 struct
3682 unsigned TMR1IP : 1;
3683 unsigned TMR2IP : 1;
3684 unsigned CCP1IP : 1;
3685 unsigned SSP1IP : 1;
3686 unsigned TX1IP : 1;
3687 unsigned RC1IP : 1;
3688 unsigned ADIP : 1;
3689 unsigned : 1;
3692 struct
3694 unsigned : 1;
3695 unsigned : 1;
3696 unsigned : 1;
3697 unsigned SSPIP : 1;
3698 unsigned TXIP : 1;
3699 unsigned RCIP : 1;
3700 unsigned : 1;
3701 unsigned : 1;
3703 } __IPR1bits_t;
3705 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3707 #define _TMR1IP 0x01
3708 #define _TMR2IP 0x02
3709 #define _CCP1IP 0x04
3710 #define _SSP1IP 0x08
3711 #define _SSPIP 0x08
3712 #define _TX1IP 0x10
3713 #define _TXIP 0x10
3714 #define _RC1IP 0x20
3715 #define _RCIP 0x20
3716 #define _ADIP 0x40
3718 //==============================================================================
3721 //==============================================================================
3722 // PIE2 Bits
3724 extern __at(0x0FA0) __sfr PIE2;
3726 typedef union
3728 struct
3730 unsigned CCP2IE : 1;
3731 unsigned TMR3IE : 1;
3732 unsigned LVDIE : 1;
3733 unsigned BCL1IE : 1;
3734 unsigned : 1;
3735 unsigned CM1IE : 1;
3736 unsigned CM2IE : 1;
3737 unsigned OSCFIE : 1;
3740 struct
3742 unsigned : 1;
3743 unsigned : 1;
3744 unsigned HLVDIE : 1;
3745 unsigned BCLIE : 1;
3746 unsigned : 1;
3747 unsigned : 1;
3748 unsigned : 1;
3749 unsigned : 1;
3751 } __PIE2bits_t;
3753 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3755 #define _CCP2IE 0x01
3756 #define _TMR3IE 0x02
3757 #define _LVDIE 0x04
3758 #define _HLVDIE 0x04
3759 #define _BCL1IE 0x08
3760 #define _BCLIE 0x08
3761 #define _CM1IE 0x20
3762 #define _CM2IE 0x40
3763 #define _OSCFIE 0x80
3765 //==============================================================================
3768 //==============================================================================
3769 // PIR2 Bits
3771 extern __at(0x0FA1) __sfr PIR2;
3773 typedef union
3775 struct
3777 unsigned CCP2IF : 1;
3778 unsigned TMR3IF : 1;
3779 unsigned LVDIF : 1;
3780 unsigned BCL1IF : 1;
3781 unsigned : 1;
3782 unsigned CM1IF : 1;
3783 unsigned CM2IF : 1;
3784 unsigned OSCFIF : 1;
3787 struct
3789 unsigned : 1;
3790 unsigned : 1;
3791 unsigned HLVDIF : 1;
3792 unsigned BCLIF : 1;
3793 unsigned : 1;
3794 unsigned : 1;
3795 unsigned : 1;
3796 unsigned : 1;
3798 } __PIR2bits_t;
3800 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3802 #define _CCP2IF 0x01
3803 #define _TMR3IF 0x02
3804 #define _LVDIF 0x04
3805 #define _HLVDIF 0x04
3806 #define _BCL1IF 0x08
3807 #define _BCLIF 0x08
3808 #define _CM1IF 0x20
3809 #define _CM2IF 0x40
3810 #define _OSCFIF 0x80
3812 //==============================================================================
3815 //==============================================================================
3816 // IPR2 Bits
3818 extern __at(0x0FA2) __sfr IPR2;
3820 typedef union
3822 struct
3824 unsigned CCP2IP : 1;
3825 unsigned TMR3IP : 1;
3826 unsigned LVDIP : 1;
3827 unsigned BCL1IP : 1;
3828 unsigned : 1;
3829 unsigned CM1IP : 1;
3830 unsigned CM2IP : 1;
3831 unsigned OSCFIP : 1;
3834 struct
3836 unsigned : 1;
3837 unsigned : 1;
3838 unsigned HLVDIP : 1;
3839 unsigned BCLIP : 1;
3840 unsigned : 1;
3841 unsigned : 1;
3842 unsigned : 1;
3843 unsigned : 1;
3845 } __IPR2bits_t;
3847 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3849 #define _CCP2IP 0x01
3850 #define _TMR3IP 0x02
3851 #define _LVDIP 0x04
3852 #define _HLVDIP 0x04
3853 #define _BCL1IP 0x08
3854 #define _BCLIP 0x08
3855 #define _CM1IP 0x20
3856 #define _CM2IP 0x40
3857 #define _OSCFIP 0x80
3859 //==============================================================================
3862 //==============================================================================
3863 // PIE3 Bits
3865 extern __at(0x0FA3) __sfr PIE3;
3867 typedef struct
3869 unsigned RTCCIE : 1;
3870 unsigned TMR3GIE : 1;
3871 unsigned CTMUIE : 1;
3872 unsigned TMR4IE : 1;
3873 unsigned TX2IE : 1;
3874 unsigned RC2IE : 1;
3875 unsigned BCL2IE : 1;
3876 unsigned SSP2IE : 1;
3877 } __PIE3bits_t;
3879 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3881 #define _RTCCIE 0x01
3882 #define _TMR3GIE 0x02
3883 #define _CTMUIE 0x04
3884 #define _TMR4IE 0x08
3885 #define _TX2IE 0x10
3886 #define _RC2IE 0x20
3887 #define _BCL2IE 0x40
3888 #define _SSP2IE 0x80
3890 //==============================================================================
3893 //==============================================================================
3894 // PIR3 Bits
3896 extern __at(0x0FA4) __sfr PIR3;
3898 typedef struct
3900 unsigned RTCCIF : 1;
3901 unsigned TMR3GIF : 1;
3902 unsigned CTMUIF : 1;
3903 unsigned TMR4IF : 1;
3904 unsigned TX2IF : 1;
3905 unsigned RC2IF : 1;
3906 unsigned BCL2IF : 1;
3907 unsigned SSP2IF : 1;
3908 } __PIR3bits_t;
3910 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3912 #define _RTCCIF 0x01
3913 #define _TMR3GIF 0x02
3914 #define _CTMUIF 0x04
3915 #define _TMR4IF 0x08
3916 #define _TX2IF 0x10
3917 #define _RC2IF 0x20
3918 #define _BCL2IF 0x40
3919 #define _SSP2IF 0x80
3921 //==============================================================================
3924 //==============================================================================
3925 // IPR3 Bits
3927 extern __at(0x0FA5) __sfr IPR3;
3929 typedef struct
3931 unsigned RTCCIP : 1;
3932 unsigned TMR3GIP : 1;
3933 unsigned CTMUIP : 1;
3934 unsigned TMR4IP : 1;
3935 unsigned TX2IP : 1;
3936 unsigned RC2IP : 1;
3937 unsigned BCL2IP : 1;
3938 unsigned SSP2IP : 1;
3939 } __IPR3bits_t;
3941 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3943 #define _RTCCIP 0x01
3944 #define _TMR3GIP 0x02
3945 #define _CTMUIP 0x04
3946 #define _TMR4IP 0x08
3947 #define _TX2IP 0x10
3948 #define _RC2IP 0x20
3949 #define _BCL2IP 0x40
3950 #define _SSP2IP 0x80
3952 //==============================================================================
3955 //==============================================================================
3956 // EECON1 Bits
3958 extern __at(0x0FA6) __sfr EECON1;
3960 typedef struct
3962 unsigned : 1;
3963 unsigned WR : 1;
3964 unsigned WREN : 1;
3965 unsigned WRERR : 1;
3966 unsigned FREE : 1;
3967 unsigned WPROG : 1;
3968 unsigned : 1;
3969 unsigned : 1;
3970 } __EECON1bits_t;
3972 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3974 #define _WR 0x02
3975 #define _WREN 0x04
3976 #define _WRERR 0x08
3977 #define _FREE 0x10
3978 #define _WPROG 0x20
3980 //==============================================================================
3982 extern __at(0x0FA7) __sfr EECON2;
3984 //==============================================================================
3985 // TXSTA2 Bits
3987 extern __at(0x0FA8) __sfr TXSTA2;
3989 typedef union
3991 struct
3993 unsigned TX9D : 1;
3994 unsigned TRMT : 1;
3995 unsigned BRGH : 1;
3996 unsigned SENDB : 1;
3997 unsigned SYNC : 1;
3998 unsigned TXEN : 1;
3999 unsigned TX9 : 1;
4000 unsigned CSRC : 1;
4003 struct
4005 unsigned TX9D2 : 1;
4006 unsigned TRMT2 : 1;
4007 unsigned BRGH2 : 1;
4008 unsigned SENDB2 : 1;
4009 unsigned SYNC2 : 1;
4010 unsigned TXEN2 : 1;
4011 unsigned TX92 : 1;
4012 unsigned CSRC2 : 1;
4014 } __TXSTA2bits_t;
4016 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
4018 #define _TXSTA2_TX9D 0x01
4019 #define _TXSTA2_TX9D2 0x01
4020 #define _TXSTA2_TRMT 0x02
4021 #define _TXSTA2_TRMT2 0x02
4022 #define _TXSTA2_BRGH 0x04
4023 #define _TXSTA2_BRGH2 0x04
4024 #define _TXSTA2_SENDB 0x08
4025 #define _TXSTA2_SENDB2 0x08
4026 #define _TXSTA2_SYNC 0x10
4027 #define _TXSTA2_SYNC2 0x10
4028 #define _TXSTA2_TXEN 0x20
4029 #define _TXSTA2_TXEN2 0x20
4030 #define _TXSTA2_TX9 0x40
4031 #define _TXSTA2_TX92 0x40
4032 #define _TXSTA2_CSRC 0x80
4033 #define _TXSTA2_CSRC2 0x80
4035 //==============================================================================
4037 extern __at(0x0FA9) __sfr TXREG2;
4038 extern __at(0x0FAA) __sfr RCREG2;
4039 extern __at(0x0FAB) __sfr SPBRG2;
4041 //==============================================================================
4042 // RCSTA Bits
4044 extern __at(0x0FAC) __sfr RCSTA;
4046 typedef union
4048 struct
4050 unsigned RX9D : 1;
4051 unsigned OERR : 1;
4052 unsigned FERR : 1;
4053 unsigned ADDEN : 1;
4054 unsigned CREN : 1;
4055 unsigned SREN : 1;
4056 unsigned RX9 : 1;
4057 unsigned SPEN : 1;
4060 struct
4062 unsigned RCD8 : 1;
4063 unsigned OERR1 : 1;
4064 unsigned FERR1 : 1;
4065 unsigned ADEN : 1;
4066 unsigned CREN1 : 1;
4067 unsigned SREN1 : 1;
4068 unsigned RC9 : 1;
4069 unsigned SPEN1 : 1;
4072 struct
4074 unsigned RX9D1 : 1;
4075 unsigned : 1;
4076 unsigned : 1;
4077 unsigned ADDEN1 : 1;
4078 unsigned : 1;
4079 unsigned : 1;
4080 unsigned NOT_RC8 : 1;
4081 unsigned : 1;
4084 struct
4086 unsigned : 1;
4087 unsigned : 1;
4088 unsigned : 1;
4089 unsigned : 1;
4090 unsigned : 1;
4091 unsigned : 1;
4092 unsigned RC8_9 : 1;
4093 unsigned : 1;
4096 struct
4098 unsigned : 1;
4099 unsigned : 1;
4100 unsigned : 1;
4101 unsigned : 1;
4102 unsigned : 1;
4103 unsigned : 1;
4104 unsigned RX91 : 1;
4105 unsigned : 1;
4107 } __RCSTAbits_t;
4109 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
4111 #define _RX9D 0x01
4112 #define _RCD8 0x01
4113 #define _RX9D1 0x01
4114 #define _OERR 0x02
4115 #define _OERR1 0x02
4116 #define _FERR 0x04
4117 #define _FERR1 0x04
4118 #define _ADDEN 0x08
4119 #define _ADEN 0x08
4120 #define _ADDEN1 0x08
4121 #define _CREN 0x10
4122 #define _CREN1 0x10
4123 #define _SREN 0x20
4124 #define _SREN1 0x20
4125 #define _RX9 0x40
4126 #define _RC9 0x40
4127 #define _NOT_RC8 0x40
4128 #define _RC8_9 0x40
4129 #define _RX91 0x40
4130 #define _SPEN 0x80
4131 #define _SPEN1 0x80
4133 //==============================================================================
4136 //==============================================================================
4137 // RCSTA1 Bits
4139 extern __at(0x0FAC) __sfr RCSTA1;
4141 typedef union
4143 struct
4145 unsigned RX9D : 1;
4146 unsigned OERR : 1;
4147 unsigned FERR : 1;
4148 unsigned ADDEN : 1;
4149 unsigned CREN : 1;
4150 unsigned SREN : 1;
4151 unsigned RX9 : 1;
4152 unsigned SPEN : 1;
4155 struct
4157 unsigned RCD8 : 1;
4158 unsigned OERR1 : 1;
4159 unsigned FERR1 : 1;
4160 unsigned ADEN : 1;
4161 unsigned CREN1 : 1;
4162 unsigned SREN1 : 1;
4163 unsigned RC9 : 1;
4164 unsigned SPEN1 : 1;
4167 struct
4169 unsigned RX9D1 : 1;
4170 unsigned : 1;
4171 unsigned : 1;
4172 unsigned ADDEN1 : 1;
4173 unsigned : 1;
4174 unsigned : 1;
4175 unsigned NOT_RC8 : 1;
4176 unsigned : 1;
4179 struct
4181 unsigned : 1;
4182 unsigned : 1;
4183 unsigned : 1;
4184 unsigned : 1;
4185 unsigned : 1;
4186 unsigned : 1;
4187 unsigned RC8_9 : 1;
4188 unsigned : 1;
4191 struct
4193 unsigned : 1;
4194 unsigned : 1;
4195 unsigned : 1;
4196 unsigned : 1;
4197 unsigned : 1;
4198 unsigned : 1;
4199 unsigned RX91 : 1;
4200 unsigned : 1;
4202 } __RCSTA1bits_t;
4204 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
4206 #define _RCSTA1_RX9D 0x01
4207 #define _RCSTA1_RCD8 0x01
4208 #define _RCSTA1_RX9D1 0x01
4209 #define _RCSTA1_OERR 0x02
4210 #define _RCSTA1_OERR1 0x02
4211 #define _RCSTA1_FERR 0x04
4212 #define _RCSTA1_FERR1 0x04
4213 #define _RCSTA1_ADDEN 0x08
4214 #define _RCSTA1_ADEN 0x08
4215 #define _RCSTA1_ADDEN1 0x08
4216 #define _RCSTA1_CREN 0x10
4217 #define _RCSTA1_CREN1 0x10
4218 #define _RCSTA1_SREN 0x20
4219 #define _RCSTA1_SREN1 0x20
4220 #define _RCSTA1_RX9 0x40
4221 #define _RCSTA1_RC9 0x40
4222 #define _RCSTA1_NOT_RC8 0x40
4223 #define _RCSTA1_RC8_9 0x40
4224 #define _RCSTA1_RX91 0x40
4225 #define _RCSTA1_SPEN 0x80
4226 #define _RCSTA1_SPEN1 0x80
4228 //==============================================================================
4231 //==============================================================================
4232 // TXSTA Bits
4234 extern __at(0x0FAD) __sfr TXSTA;
4236 typedef union
4238 struct
4240 unsigned TX9D : 1;
4241 unsigned TRMT : 1;
4242 unsigned BRGH : 1;
4243 unsigned SENDB : 1;
4244 unsigned SYNC : 1;
4245 unsigned TXEN : 1;
4246 unsigned TX9 : 1;
4247 unsigned CSRC : 1;
4250 struct
4252 unsigned TXD8 : 1;
4253 unsigned TRMT1 : 1;
4254 unsigned BRGH1 : 1;
4255 unsigned SENDB1 : 1;
4256 unsigned SYNC1 : 1;
4257 unsigned TXEN1 : 1;
4258 unsigned TX8_9 : 1;
4259 unsigned CSRC1 : 1;
4262 struct
4264 unsigned TX9D1 : 1;
4265 unsigned : 1;
4266 unsigned : 1;
4267 unsigned : 1;
4268 unsigned : 1;
4269 unsigned : 1;
4270 unsigned NOT_TX8 : 1;
4271 unsigned : 1;
4274 struct
4276 unsigned : 1;
4277 unsigned : 1;
4278 unsigned : 1;
4279 unsigned : 1;
4280 unsigned : 1;
4281 unsigned : 1;
4282 unsigned TX91 : 1;
4283 unsigned : 1;
4285 } __TXSTAbits_t;
4287 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
4289 #define _TX9D 0x01
4290 #define _TXD8 0x01
4291 #define _TX9D1 0x01
4292 #define _TRMT 0x02
4293 #define _TRMT1 0x02
4294 #define _BRGH 0x04
4295 #define _BRGH1 0x04
4296 #define _SENDB 0x08
4297 #define _SENDB1 0x08
4298 #define _SYNC 0x10
4299 #define _SYNC1 0x10
4300 #define _TXEN 0x20
4301 #define _TXEN1 0x20
4302 #define _TX9 0x40
4303 #define _TX8_9 0x40
4304 #define _NOT_TX8 0x40
4305 #define _TX91 0x40
4306 #define _CSRC 0x80
4307 #define _CSRC1 0x80
4309 //==============================================================================
4312 //==============================================================================
4313 // TXSTA1 Bits
4315 extern __at(0x0FAD) __sfr TXSTA1;
4317 typedef union
4319 struct
4321 unsigned TX9D : 1;
4322 unsigned TRMT : 1;
4323 unsigned BRGH : 1;
4324 unsigned SENDB : 1;
4325 unsigned SYNC : 1;
4326 unsigned TXEN : 1;
4327 unsigned TX9 : 1;
4328 unsigned CSRC : 1;
4331 struct
4333 unsigned TXD8 : 1;
4334 unsigned TRMT1 : 1;
4335 unsigned BRGH1 : 1;
4336 unsigned SENDB1 : 1;
4337 unsigned SYNC1 : 1;
4338 unsigned TXEN1 : 1;
4339 unsigned TX8_9 : 1;
4340 unsigned CSRC1 : 1;
4343 struct
4345 unsigned TX9D1 : 1;
4346 unsigned : 1;
4347 unsigned : 1;
4348 unsigned : 1;
4349 unsigned : 1;
4350 unsigned : 1;
4351 unsigned NOT_TX8 : 1;
4352 unsigned : 1;
4355 struct
4357 unsigned : 1;
4358 unsigned : 1;
4359 unsigned : 1;
4360 unsigned : 1;
4361 unsigned : 1;
4362 unsigned : 1;
4363 unsigned TX91 : 1;
4364 unsigned : 1;
4366 } __TXSTA1bits_t;
4368 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
4370 #define _TXSTA1_TX9D 0x01
4371 #define _TXSTA1_TXD8 0x01
4372 #define _TXSTA1_TX9D1 0x01
4373 #define _TXSTA1_TRMT 0x02
4374 #define _TXSTA1_TRMT1 0x02
4375 #define _TXSTA1_BRGH 0x04
4376 #define _TXSTA1_BRGH1 0x04
4377 #define _TXSTA1_SENDB 0x08
4378 #define _TXSTA1_SENDB1 0x08
4379 #define _TXSTA1_SYNC 0x10
4380 #define _TXSTA1_SYNC1 0x10
4381 #define _TXSTA1_TXEN 0x20
4382 #define _TXSTA1_TXEN1 0x20
4383 #define _TXSTA1_TX9 0x40
4384 #define _TXSTA1_TX8_9 0x40
4385 #define _TXSTA1_NOT_TX8 0x40
4386 #define _TXSTA1_TX91 0x40
4387 #define _TXSTA1_CSRC 0x80
4388 #define _TXSTA1_CSRC1 0x80
4390 //==============================================================================
4392 extern __at(0x0FAE) __sfr TXREG;
4393 extern __at(0x0FAE) __sfr TXREG1;
4394 extern __at(0x0FAF) __sfr RCREG;
4395 extern __at(0x0FAF) __sfr RCREG1;
4396 extern __at(0x0FB0) __sfr SPBRG;
4397 extern __at(0x0FB0) __sfr SPBRG1;
4399 //==============================================================================
4400 // CTMUICON Bits
4402 extern __at(0x0FB1) __sfr CTMUICON;
4404 typedef union
4406 struct
4408 unsigned IRNG0 : 1;
4409 unsigned IRNG1 : 1;
4410 unsigned ITRIM0 : 1;
4411 unsigned ITRIM1 : 1;
4412 unsigned ITRIM2 : 1;
4413 unsigned ITRIM3 : 1;
4414 unsigned ITRIM4 : 1;
4415 unsigned ITRIM5 : 1;
4418 struct
4420 unsigned IRNG : 2;
4421 unsigned : 6;
4424 struct
4426 unsigned : 2;
4427 unsigned ITRIM : 6;
4429 } __CTMUICONbits_t;
4431 extern __at(0x0FB1) volatile __CTMUICONbits_t CTMUICONbits;
4433 #define _IRNG0 0x01
4434 #define _IRNG1 0x02
4435 #define _ITRIM0 0x04
4436 #define _ITRIM1 0x08
4437 #define _ITRIM2 0x10
4438 #define _ITRIM3 0x20
4439 #define _ITRIM4 0x40
4440 #define _ITRIM5 0x80
4442 //==============================================================================
4445 //==============================================================================
4446 // CTMUCONL Bits
4448 extern __at(0x0FB2) __sfr CTMUCONL;
4450 typedef union
4452 struct
4454 unsigned EDG1STAT : 1;
4455 unsigned EDG2STAT : 1;
4456 unsigned EDG1SEL0 : 1;
4457 unsigned EDG1SEL1 : 1;
4458 unsigned EDG1POL : 1;
4459 unsigned EDG2SEL0 : 1;
4460 unsigned EDG2SEL1 : 1;
4461 unsigned EDG2POL : 1;
4464 struct
4466 unsigned : 2;
4467 unsigned EDG1SEL : 2;
4468 unsigned : 4;
4471 struct
4473 unsigned : 5;
4474 unsigned EDG2SEL : 2;
4475 unsigned : 1;
4477 } __CTMUCONLbits_t;
4479 extern __at(0x0FB2) volatile __CTMUCONLbits_t CTMUCONLbits;
4481 #define _EDG1STAT 0x01
4482 #define _EDG2STAT 0x02
4483 #define _EDG1SEL0 0x04
4484 #define _EDG1SEL1 0x08
4485 #define _EDG1POL 0x10
4486 #define _EDG2SEL0 0x20
4487 #define _EDG2SEL1 0x40
4488 #define _EDG2POL 0x80
4490 //==============================================================================
4493 //==============================================================================
4494 // CTMUCONH Bits
4496 extern __at(0x0FB3) __sfr CTMUCONH;
4498 typedef struct
4500 unsigned CTTRIG : 1;
4501 unsigned IDISSEN : 1;
4502 unsigned EDGSEQEN : 1;
4503 unsigned EDGEN : 1;
4504 unsigned TGEN : 1;
4505 unsigned CTMUSIDL : 1;
4506 unsigned : 1;
4507 unsigned CTMUEN : 1;
4508 } __CTMUCONHbits_t;
4510 extern __at(0x0FB3) volatile __CTMUCONHbits_t CTMUCONHbits;
4512 #define _CTTRIG 0x01
4513 #define _IDISSEN 0x02
4514 #define _EDGSEQEN 0x04
4515 #define _EDGEN 0x08
4516 #define _TGEN 0x10
4517 #define _CTMUSIDL 0x20
4518 #define _CTMUEN 0x80
4520 //==============================================================================
4523 //==============================================================================
4524 // CCP2CON Bits
4526 extern __at(0x0FB4) __sfr CCP2CON;
4528 typedef union
4530 struct
4532 unsigned CCP2M0 : 1;
4533 unsigned CCP2M1 : 1;
4534 unsigned CCP2M2 : 1;
4535 unsigned CCP2M3 : 1;
4536 unsigned DC2B0 : 1;
4537 unsigned DC2B1 : 1;
4538 unsigned P2M0 : 1;
4539 unsigned P2M1 : 1;
4542 struct
4544 unsigned : 1;
4545 unsigned : 1;
4546 unsigned : 1;
4547 unsigned : 1;
4548 unsigned CCP2Y : 1;
4549 unsigned CCP2X : 1;
4550 unsigned : 1;
4551 unsigned : 1;
4554 struct
4556 unsigned CCP2M : 4;
4557 unsigned : 4;
4560 struct
4562 unsigned : 4;
4563 unsigned DC2B : 2;
4564 unsigned : 2;
4567 struct
4569 unsigned : 6;
4570 unsigned P2M : 2;
4572 } __CCP2CONbits_t;
4574 extern __at(0x0FB4) volatile __CCP2CONbits_t CCP2CONbits;
4576 #define _CCP2M0 0x01
4577 #define _CCP2M1 0x02
4578 #define _CCP2M2 0x04
4579 #define _CCP2M3 0x08
4580 #define _DC2B0 0x10
4581 #define _CCP2Y 0x10
4582 #define _DC2B1 0x20
4583 #define _CCP2X 0x20
4584 #define _P2M0 0x40
4585 #define _P2M1 0x80
4587 //==============================================================================
4590 //==============================================================================
4591 // ECCP2CON Bits
4593 extern __at(0x0FB4) __sfr ECCP2CON;
4595 typedef union
4597 struct
4599 unsigned CCP2M0 : 1;
4600 unsigned CCP2M1 : 1;
4601 unsigned CCP2M2 : 1;
4602 unsigned CCP2M3 : 1;
4603 unsigned DC2B0 : 1;
4604 unsigned DC2B1 : 1;
4605 unsigned P2M0 : 1;
4606 unsigned P2M1 : 1;
4609 struct
4611 unsigned : 1;
4612 unsigned : 1;
4613 unsigned : 1;
4614 unsigned : 1;
4615 unsigned CCP2Y : 1;
4616 unsigned CCP2X : 1;
4617 unsigned : 1;
4618 unsigned : 1;
4621 struct
4623 unsigned CCP2M : 4;
4624 unsigned : 4;
4627 struct
4629 unsigned : 4;
4630 unsigned DC2B : 2;
4631 unsigned : 2;
4634 struct
4636 unsigned : 6;
4637 unsigned P2M : 2;
4639 } __ECCP2CONbits_t;
4641 extern __at(0x0FB4) volatile __ECCP2CONbits_t ECCP2CONbits;
4643 #define _ECCP2CON_CCP2M0 0x01
4644 #define _ECCP2CON_CCP2M1 0x02
4645 #define _ECCP2CON_CCP2M2 0x04
4646 #define _ECCP2CON_CCP2M3 0x08
4647 #define _ECCP2CON_DC2B0 0x10
4648 #define _ECCP2CON_CCP2Y 0x10
4649 #define _ECCP2CON_DC2B1 0x20
4650 #define _ECCP2CON_CCP2X 0x20
4651 #define _ECCP2CON_P2M0 0x40
4652 #define _ECCP2CON_P2M1 0x80
4654 //==============================================================================
4656 extern __at(0x0FB5) __sfr CCPR2;
4657 extern __at(0x0FB5) __sfr CCPR2L;
4658 extern __at(0x0FB6) __sfr CCPR2H;
4660 //==============================================================================
4661 // ECCP2DEL Bits
4663 extern __at(0x0FB7) __sfr ECCP2DEL;
4665 typedef union
4667 struct
4669 unsigned P2DC0 : 1;
4670 unsigned P2DC1 : 1;
4671 unsigned P2DC2 : 1;
4672 unsigned P2DC3 : 1;
4673 unsigned P2DC4 : 1;
4674 unsigned P2DC5 : 1;
4675 unsigned P2DC6 : 1;
4676 unsigned P2RSEN : 1;
4679 struct
4681 unsigned P2DC : 7;
4682 unsigned : 1;
4684 } __ECCP2DELbits_t;
4686 extern __at(0x0FB7) volatile __ECCP2DELbits_t ECCP2DELbits;
4688 #define _P2DC0 0x01
4689 #define _P2DC1 0x02
4690 #define _P2DC2 0x04
4691 #define _P2DC3 0x08
4692 #define _P2DC4 0x10
4693 #define _P2DC5 0x20
4694 #define _P2DC6 0x40
4695 #define _P2RSEN 0x80
4697 //==============================================================================
4700 //==============================================================================
4701 // PWM2CON Bits
4703 extern __at(0x0FB7) __sfr PWM2CON;
4705 typedef union
4707 struct
4709 unsigned P2DC0 : 1;
4710 unsigned P2DC1 : 1;
4711 unsigned P2DC2 : 1;
4712 unsigned P2DC3 : 1;
4713 unsigned P2DC4 : 1;
4714 unsigned P2DC5 : 1;
4715 unsigned P2DC6 : 1;
4716 unsigned P2RSEN : 1;
4719 struct
4721 unsigned P2DC : 7;
4722 unsigned : 1;
4724 } __PWM2CONbits_t;
4726 extern __at(0x0FB7) volatile __PWM2CONbits_t PWM2CONbits;
4728 #define _PWM2CON_P2DC0 0x01
4729 #define _PWM2CON_P2DC1 0x02
4730 #define _PWM2CON_P2DC2 0x04
4731 #define _PWM2CON_P2DC3 0x08
4732 #define _PWM2CON_P2DC4 0x10
4733 #define _PWM2CON_P2DC5 0x20
4734 #define _PWM2CON_P2DC6 0x40
4735 #define _PWM2CON_P2RSEN 0x80
4737 //==============================================================================
4740 //==============================================================================
4741 // ECCP2AS Bits
4743 extern __at(0x0FB8) __sfr ECCP2AS;
4745 typedef union
4747 struct
4749 unsigned PSS2BD0 : 1;
4750 unsigned PSS2BD1 : 1;
4751 unsigned PSS2AC0 : 1;
4752 unsigned PSS2AC1 : 1;
4753 unsigned ECCP2AS0 : 1;
4754 unsigned ECCP2AS1 : 1;
4755 unsigned ECCP2AS2 : 1;
4756 unsigned ECCP2ASE : 1;
4759 struct
4761 unsigned PSS2BD : 2;
4762 unsigned : 6;
4765 struct
4767 unsigned : 2;
4768 unsigned PSS2AC : 2;
4769 unsigned : 4;
4772 struct
4774 unsigned : 4;
4775 unsigned ECCP2AS : 3;
4776 unsigned : 1;
4778 } __ECCP2ASbits_t;
4780 extern __at(0x0FB8) volatile __ECCP2ASbits_t ECCP2ASbits;
4782 #define _PSS2BD0 0x01
4783 #define _PSS2BD1 0x02
4784 #define _PSS2AC0 0x04
4785 #define _PSS2AC1 0x08
4786 #define _ECCP2AS0 0x10
4787 #define _ECCP2AS1 0x20
4788 #define _ECCP2AS2 0x40
4789 #define _ECCP2ASE 0x80
4791 //==============================================================================
4794 //==============================================================================
4795 // PSTR2CON Bits
4797 extern __at(0x0FB9) __sfr PSTR2CON;
4799 typedef union
4801 struct
4803 unsigned STRA : 1;
4804 unsigned STRB : 1;
4805 unsigned STRC : 1;
4806 unsigned STRD : 1;
4807 unsigned STRSYNC : 1;
4808 unsigned P2DC5 : 1;
4809 unsigned CMPL0 : 1;
4810 unsigned CMPL1 : 1;
4813 struct
4815 unsigned P2DC0 : 1;
4816 unsigned P2DC1 : 1;
4817 unsigned P2DC2 : 1;
4818 unsigned P2DC3 : 1;
4819 unsigned P2DC4 : 1;
4820 unsigned : 1;
4821 unsigned P2DC6 : 1;
4822 unsigned : 1;
4825 struct
4827 unsigned P2DC : 7;
4828 unsigned : 1;
4831 struct
4833 unsigned : 6;
4834 unsigned CMPL : 2;
4836 } __PSTR2CONbits_t;
4838 extern __at(0x0FB9) volatile __PSTR2CONbits_t PSTR2CONbits;
4840 #define _PSTR2CON_STRA 0x01
4841 #define _PSTR2CON_P2DC0 0x01
4842 #define _PSTR2CON_STRB 0x02
4843 #define _PSTR2CON_P2DC1 0x02
4844 #define _PSTR2CON_STRC 0x04
4845 #define _PSTR2CON_P2DC2 0x04
4846 #define _PSTR2CON_STRD 0x08
4847 #define _PSTR2CON_P2DC3 0x08
4848 #define _PSTR2CON_STRSYNC 0x10
4849 #define _PSTR2CON_P2DC4 0x10
4850 #define _PSTR2CON_P2DC5 0x20
4851 #define _PSTR2CON_CMPL0 0x40
4852 #define _PSTR2CON_P2DC6 0x40
4853 #define _PSTR2CON_CMPL1 0x80
4855 //==============================================================================
4858 //==============================================================================
4859 // CCP1CON Bits
4861 extern __at(0x0FBA) __sfr CCP1CON;
4863 typedef union
4865 struct
4867 unsigned CCP1M0 : 1;
4868 unsigned CCP1M1 : 1;
4869 unsigned CCP1M2 : 1;
4870 unsigned CCP1M3 : 1;
4871 unsigned DC1B0 : 1;
4872 unsigned DC1B1 : 1;
4873 unsigned P1M0 : 1;
4874 unsigned P1M1 : 1;
4877 struct
4879 unsigned : 1;
4880 unsigned : 1;
4881 unsigned : 1;
4882 unsigned : 1;
4883 unsigned CCP1Y : 1;
4884 unsigned CCP1X : 1;
4885 unsigned : 1;
4886 unsigned : 1;
4889 struct
4891 unsigned CCP1M : 4;
4892 unsigned : 4;
4895 struct
4897 unsigned : 4;
4898 unsigned DC1B : 2;
4899 unsigned : 2;
4902 struct
4904 unsigned : 6;
4905 unsigned P1M : 2;
4907 } __CCP1CONbits_t;
4909 extern __at(0x0FBA) volatile __CCP1CONbits_t CCP1CONbits;
4911 #define _CCP1M0 0x01
4912 #define _CCP1M1 0x02
4913 #define _CCP1M2 0x04
4914 #define _CCP1M3 0x08
4915 #define _DC1B0 0x10
4916 #define _CCP1Y 0x10
4917 #define _DC1B1 0x20
4918 #define _CCP1X 0x20
4919 #define _P1M0 0x40
4920 #define _P1M1 0x80
4922 //==============================================================================
4925 //==============================================================================
4926 // ECCP1CON Bits
4928 extern __at(0x0FBA) __sfr ECCP1CON;
4930 typedef union
4932 struct
4934 unsigned CCP1M0 : 1;
4935 unsigned CCP1M1 : 1;
4936 unsigned CCP1M2 : 1;
4937 unsigned CCP1M3 : 1;
4938 unsigned DC1B0 : 1;
4939 unsigned DC1B1 : 1;
4940 unsigned P1M0 : 1;
4941 unsigned P1M1 : 1;
4944 struct
4946 unsigned : 1;
4947 unsigned : 1;
4948 unsigned : 1;
4949 unsigned : 1;
4950 unsigned CCP1Y : 1;
4951 unsigned CCP1X : 1;
4952 unsigned : 1;
4953 unsigned : 1;
4956 struct
4958 unsigned CCP1M : 4;
4959 unsigned : 4;
4962 struct
4964 unsigned : 4;
4965 unsigned DC1B : 2;
4966 unsigned : 2;
4969 struct
4971 unsigned : 6;
4972 unsigned P1M : 2;
4974 } __ECCP1CONbits_t;
4976 extern __at(0x0FBA) volatile __ECCP1CONbits_t ECCP1CONbits;
4978 #define _ECCP1CON_CCP1M0 0x01
4979 #define _ECCP1CON_CCP1M1 0x02
4980 #define _ECCP1CON_CCP1M2 0x04
4981 #define _ECCP1CON_CCP1M3 0x08
4982 #define _ECCP1CON_DC1B0 0x10
4983 #define _ECCP1CON_CCP1Y 0x10
4984 #define _ECCP1CON_DC1B1 0x20
4985 #define _ECCP1CON_CCP1X 0x20
4986 #define _ECCP1CON_P1M0 0x40
4987 #define _ECCP1CON_P1M1 0x80
4989 //==============================================================================
4991 extern __at(0x0FBB) __sfr CCPR1;
4992 extern __at(0x0FBB) __sfr CCPR1L;
4993 extern __at(0x0FBC) __sfr CCPR1H;
4995 //==============================================================================
4996 // ECCP1DEL Bits
4998 extern __at(0x0FBD) __sfr ECCP1DEL;
5000 typedef union
5002 struct
5004 unsigned P1DC0 : 1;
5005 unsigned P1DC1 : 1;
5006 unsigned P1DC2 : 1;
5007 unsigned P1DC3 : 1;
5008 unsigned P1DC4 : 1;
5009 unsigned P1DC5 : 1;
5010 unsigned P1DC6 : 1;
5011 unsigned P1RSEN : 1;
5014 struct
5016 unsigned P1DC : 7;
5017 unsigned : 1;
5019 } __ECCP1DELbits_t;
5021 extern __at(0x0FBD) volatile __ECCP1DELbits_t ECCP1DELbits;
5023 #define _P1DC0 0x01
5024 #define _P1DC1 0x02
5025 #define _P1DC2 0x04
5026 #define _P1DC3 0x08
5027 #define _P1DC4 0x10
5028 #define _P1DC5 0x20
5029 #define _P1DC6 0x40
5030 #define _P1RSEN 0x80
5032 //==============================================================================
5035 //==============================================================================
5036 // PWM1CON Bits
5038 extern __at(0x0FBD) __sfr PWM1CON;
5040 typedef union
5042 struct
5044 unsigned P1DC0 : 1;
5045 unsigned P1DC1 : 1;
5046 unsigned P1DC2 : 1;
5047 unsigned P1DC3 : 1;
5048 unsigned P1DC4 : 1;
5049 unsigned P1DC5 : 1;
5050 unsigned P1DC6 : 1;
5051 unsigned P1RSEN : 1;
5054 struct
5056 unsigned P1DC : 7;
5057 unsigned : 1;
5059 } __PWM1CONbits_t;
5061 extern __at(0x0FBD) volatile __PWM1CONbits_t PWM1CONbits;
5063 #define _PWM1CON_P1DC0 0x01
5064 #define _PWM1CON_P1DC1 0x02
5065 #define _PWM1CON_P1DC2 0x04
5066 #define _PWM1CON_P1DC3 0x08
5067 #define _PWM1CON_P1DC4 0x10
5068 #define _PWM1CON_P1DC5 0x20
5069 #define _PWM1CON_P1DC6 0x40
5070 #define _PWM1CON_P1RSEN 0x80
5072 //==============================================================================
5075 //==============================================================================
5076 // ECCP1AS Bits
5078 extern __at(0x0FBE) __sfr ECCP1AS;
5080 typedef union
5082 struct
5084 unsigned PSS1BD0 : 1;
5085 unsigned PSS1BD1 : 1;
5086 unsigned PSS1AC0 : 1;
5087 unsigned PSS1AC1 : 1;
5088 unsigned ECCP1AS0 : 1;
5089 unsigned ECCP1AS1 : 1;
5090 unsigned ECCP1AS2 : 1;
5091 unsigned ECCP1ASE : 1;
5094 struct
5096 unsigned PSS1BD : 2;
5097 unsigned : 6;
5100 struct
5102 unsigned : 2;
5103 unsigned PSS1AC : 2;
5104 unsigned : 4;
5107 struct
5109 unsigned : 4;
5110 unsigned ECCP1AS : 3;
5111 unsigned : 1;
5113 } __ECCP1ASbits_t;
5115 extern __at(0x0FBE) volatile __ECCP1ASbits_t ECCP1ASbits;
5117 #define _PSS1BD0 0x01
5118 #define _PSS1BD1 0x02
5119 #define _PSS1AC0 0x04
5120 #define _PSS1AC1 0x08
5121 #define _ECCP1AS0 0x10
5122 #define _ECCP1AS1 0x20
5123 #define _ECCP1AS2 0x40
5124 #define _ECCP1ASE 0x80
5126 //==============================================================================
5129 //==============================================================================
5130 // PSTR1CON Bits
5132 extern __at(0x0FBF) __sfr PSTR1CON;
5134 typedef union
5136 struct
5138 unsigned STRA : 1;
5139 unsigned STRB : 1;
5140 unsigned STRC : 1;
5141 unsigned STRD : 1;
5142 unsigned STRSYNC : 1;
5143 unsigned : 1;
5144 unsigned CMPL0 : 1;
5145 unsigned CMPL1 : 1;
5148 struct
5150 unsigned : 6;
5151 unsigned CMPL : 2;
5153 } __PSTR1CONbits_t;
5155 extern __at(0x0FBF) volatile __PSTR1CONbits_t PSTR1CONbits;
5157 #define _STRA 0x01
5158 #define _STRB 0x02
5159 #define _STRC 0x04
5160 #define _STRD 0x08
5161 #define _STRSYNC 0x10
5162 #define _CMPL0 0x40
5163 #define _CMPL1 0x80
5165 //==============================================================================
5168 //==============================================================================
5169 // WDTCON Bits
5171 extern __at(0x0FC0) __sfr WDTCON;
5173 typedef union
5175 struct
5177 unsigned SWDTEN : 1;
5178 unsigned ULPSINK : 1;
5179 unsigned ULPEN : 1;
5180 unsigned DS : 1;
5181 unsigned VBGOE : 1;
5182 unsigned ULPLVL : 1;
5183 unsigned LVDSTAT : 1;
5184 unsigned REGSLP : 1;
5187 struct
5189 unsigned SWDTE : 1;
5190 unsigned : 1;
5191 unsigned : 1;
5192 unsigned : 1;
5193 unsigned : 1;
5194 unsigned : 1;
5195 unsigned : 1;
5196 unsigned : 1;
5198 } __WDTCONbits_t;
5200 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
5202 #define _SWDTEN 0x01
5203 #define _SWDTE 0x01
5204 #define _ULPSINK 0x02
5205 #define _ULPEN 0x04
5206 #define _DS 0x08
5207 #define _VBGOE 0x10
5208 #define _ULPLVL 0x20
5209 #define _LVDSTAT 0x40
5210 #define _REGSLP 0x80
5212 //==============================================================================
5215 //==============================================================================
5216 // ADCON1 Bits
5218 extern __at(0x0FC1) __sfr ADCON1;
5220 typedef union
5222 struct
5224 unsigned ADCS0 : 1;
5225 unsigned ADCS1 : 1;
5226 unsigned ADCS2 : 1;
5227 unsigned ACQT0 : 1;
5228 unsigned ACQT1 : 1;
5229 unsigned ACQT2 : 1;
5230 unsigned ADCAL : 1;
5231 unsigned ADFM : 1;
5234 struct
5236 unsigned ADCS : 3;
5237 unsigned : 5;
5240 struct
5242 unsigned : 3;
5243 unsigned ACQT : 3;
5244 unsigned : 2;
5246 } __ADCON1bits_t;
5248 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5250 #define _ADCS0 0x01
5251 #define _ADCS1 0x02
5252 #define _ADCS2 0x04
5253 #define _ACQT0 0x08
5254 #define _ACQT1 0x10
5255 #define _ACQT2 0x20
5256 #define _ADCAL 0x40
5257 #define _ADFM 0x80
5259 //==============================================================================
5262 //==============================================================================
5263 // ADCON0 Bits
5265 extern __at(0x0FC2) __sfr ADCON0;
5267 typedef union
5269 struct
5271 unsigned ADON : 1;
5272 unsigned GO_NOT_DONE : 1;
5273 unsigned CHS0 : 1;
5274 unsigned CHS1 : 1;
5275 unsigned CHS2 : 1;
5276 unsigned CHS3 : 1;
5277 unsigned VCFG0 : 1;
5278 unsigned VCFG1 : 1;
5281 struct
5283 unsigned : 1;
5284 unsigned GO_DONE : 1;
5285 unsigned : 1;
5286 unsigned : 1;
5287 unsigned : 1;
5288 unsigned : 1;
5289 unsigned : 1;
5290 unsigned : 1;
5293 struct
5295 unsigned : 1;
5296 unsigned DONE : 1;
5297 unsigned : 1;
5298 unsigned : 1;
5299 unsigned : 1;
5300 unsigned : 1;
5301 unsigned : 1;
5302 unsigned : 1;
5305 struct
5307 unsigned : 1;
5308 unsigned GO : 1;
5309 unsigned : 1;
5310 unsigned : 1;
5311 unsigned : 1;
5312 unsigned : 1;
5313 unsigned : 1;
5314 unsigned : 1;
5317 struct
5319 unsigned : 1;
5320 unsigned NOT_DONE : 1;
5321 unsigned : 1;
5322 unsigned : 1;
5323 unsigned : 1;
5324 unsigned : 1;
5325 unsigned : 1;
5326 unsigned : 1;
5329 struct
5331 unsigned : 2;
5332 unsigned CHS : 4;
5333 unsigned : 2;
5336 struct
5338 unsigned : 6;
5339 unsigned VCFG : 2;
5341 } __ADCON0bits_t;
5343 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5345 #define _ADON 0x01
5346 #define _GO_NOT_DONE 0x02
5347 #define _GO_DONE 0x02
5348 #define _DONE 0x02
5349 #define _GO 0x02
5350 #define _NOT_DONE 0x02
5351 #define _CHS0 0x04
5352 #define _CHS1 0x08
5353 #define _CHS2 0x10
5354 #define _CHS3 0x20
5355 #define _VCFG0 0x40
5356 #define _VCFG1 0x80
5358 //==============================================================================
5360 extern __at(0x0FC3) __sfr ADRES;
5361 extern __at(0x0FC3) __sfr ADRESL;
5362 extern __at(0x0FC4) __sfr ADRESH;
5364 //==============================================================================
5365 // SSP1CON2 Bits
5367 extern __at(0x0FC5) __sfr SSP1CON2;
5369 typedef union
5371 struct
5373 unsigned SEN : 1;
5374 unsigned RSEN : 1;
5375 unsigned PEN : 1;
5376 unsigned RCEN : 1;
5377 unsigned ACKEN : 1;
5378 unsigned ACKDT : 1;
5379 unsigned ACKSTAT : 1;
5380 unsigned GCEN : 1;
5383 struct
5385 unsigned : 1;
5386 unsigned ADMSK1 : 1;
5387 unsigned ADMSK2 : 1;
5388 unsigned ADMSK3 : 1;
5389 unsigned ADMSK4 : 1;
5390 unsigned ADMSK5 : 1;
5391 unsigned : 1;
5392 unsigned : 1;
5394 } __SSP1CON2bits_t;
5396 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5398 #define _SEN 0x01
5399 #define _RSEN 0x02
5400 #define _ADMSK1 0x02
5401 #define _PEN 0x04
5402 #define _ADMSK2 0x04
5403 #define _RCEN 0x08
5404 #define _ADMSK3 0x08
5405 #define _ACKEN 0x10
5406 #define _ADMSK4 0x10
5407 #define _ACKDT 0x20
5408 #define _ADMSK5 0x20
5409 #define _ACKSTAT 0x40
5410 #define _GCEN 0x80
5412 //==============================================================================
5415 //==============================================================================
5416 // SSPCON2 Bits
5418 extern __at(0x0FC5) __sfr SSPCON2;
5420 typedef union
5422 struct
5424 unsigned SEN : 1;
5425 unsigned RSEN : 1;
5426 unsigned PEN : 1;
5427 unsigned RCEN : 1;
5428 unsigned ACKEN : 1;
5429 unsigned ACKDT : 1;
5430 unsigned ACKSTAT : 1;
5431 unsigned GCEN : 1;
5434 struct
5436 unsigned : 1;
5437 unsigned ADMSK1 : 1;
5438 unsigned ADMSK2 : 1;
5439 unsigned ADMSK3 : 1;
5440 unsigned ADMSK4 : 1;
5441 unsigned ADMSK5 : 1;
5442 unsigned : 1;
5443 unsigned : 1;
5445 } __SSPCON2bits_t;
5447 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5449 #define _SSPCON2_SEN 0x01
5450 #define _SSPCON2_RSEN 0x02
5451 #define _SSPCON2_ADMSK1 0x02
5452 #define _SSPCON2_PEN 0x04
5453 #define _SSPCON2_ADMSK2 0x04
5454 #define _SSPCON2_RCEN 0x08
5455 #define _SSPCON2_ADMSK3 0x08
5456 #define _SSPCON2_ACKEN 0x10
5457 #define _SSPCON2_ADMSK4 0x10
5458 #define _SSPCON2_ACKDT 0x20
5459 #define _SSPCON2_ADMSK5 0x20
5460 #define _SSPCON2_ACKSTAT 0x40
5461 #define _SSPCON2_GCEN 0x80
5463 //==============================================================================
5466 //==============================================================================
5467 // SSP1CON1 Bits
5469 extern __at(0x0FC6) __sfr SSP1CON1;
5471 typedef union
5473 struct
5475 unsigned SSPM0 : 1;
5476 unsigned SSPM1 : 1;
5477 unsigned SSPM2 : 1;
5478 unsigned SSPM3 : 1;
5479 unsigned CKP : 1;
5480 unsigned SSPEN : 1;
5481 unsigned SSPOV : 1;
5482 unsigned WCOL : 1;
5485 struct
5487 unsigned SSPM : 4;
5488 unsigned : 4;
5490 } __SSP1CON1bits_t;
5492 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5494 #define _SSPM0 0x01
5495 #define _SSPM1 0x02
5496 #define _SSPM2 0x04
5497 #define _SSPM3 0x08
5498 #define _CKP 0x10
5499 #define _SSPEN 0x20
5500 #define _SSPOV 0x40
5501 #define _WCOL 0x80
5503 //==============================================================================
5506 //==============================================================================
5507 // SSPCON1 Bits
5509 extern __at(0x0FC6) __sfr SSPCON1;
5511 typedef union
5513 struct
5515 unsigned SSPM0 : 1;
5516 unsigned SSPM1 : 1;
5517 unsigned SSPM2 : 1;
5518 unsigned SSPM3 : 1;
5519 unsigned CKP : 1;
5520 unsigned SSPEN : 1;
5521 unsigned SSPOV : 1;
5522 unsigned WCOL : 1;
5525 struct
5527 unsigned SSPM : 4;
5528 unsigned : 4;
5530 } __SSPCON1bits_t;
5532 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5534 #define _SSPCON1_SSPM0 0x01
5535 #define _SSPCON1_SSPM1 0x02
5536 #define _SSPCON1_SSPM2 0x04
5537 #define _SSPCON1_SSPM3 0x08
5538 #define _SSPCON1_CKP 0x10
5539 #define _SSPCON1_SSPEN 0x20
5540 #define _SSPCON1_SSPOV 0x40
5541 #define _SSPCON1_WCOL 0x80
5543 //==============================================================================
5546 //==============================================================================
5547 // SSP1STAT Bits
5549 extern __at(0x0FC7) __sfr SSP1STAT;
5551 typedef union
5553 struct
5555 unsigned BF : 1;
5556 unsigned UA : 1;
5557 unsigned R_NOT_W : 1;
5558 unsigned S : 1;
5559 unsigned P : 1;
5560 unsigned D_NOT_A : 1;
5561 unsigned CKE : 1;
5562 unsigned SMP : 1;
5565 struct
5567 unsigned : 1;
5568 unsigned : 1;
5569 unsigned R : 1;
5570 unsigned I2C_START : 1;
5571 unsigned I2C_STOP : 1;
5572 unsigned D : 1;
5573 unsigned : 1;
5574 unsigned : 1;
5577 struct
5579 unsigned : 1;
5580 unsigned : 1;
5581 unsigned R_W : 1;
5582 unsigned : 1;
5583 unsigned : 1;
5584 unsigned D_A : 1;
5585 unsigned : 1;
5586 unsigned : 1;
5589 struct
5591 unsigned : 1;
5592 unsigned : 1;
5593 unsigned NOT_W : 1;
5594 unsigned : 1;
5595 unsigned : 1;
5596 unsigned NOT_A : 1;
5597 unsigned : 1;
5598 unsigned : 1;
5601 struct
5603 unsigned : 1;
5604 unsigned : 1;
5605 unsigned NOT_WRITE : 1;
5606 unsigned : 1;
5607 unsigned : 1;
5608 unsigned NOT_ADDRESS : 1;
5609 unsigned : 1;
5610 unsigned : 1;
5613 struct
5615 unsigned : 1;
5616 unsigned : 1;
5617 unsigned READ_WRITE : 1;
5618 unsigned : 1;
5619 unsigned : 1;
5620 unsigned DATA_ADDRESS : 1;
5621 unsigned : 1;
5622 unsigned : 1;
5625 struct
5627 unsigned : 1;
5628 unsigned : 1;
5629 unsigned I2C_READ : 1;
5630 unsigned : 1;
5631 unsigned : 1;
5632 unsigned I2C_DAT : 1;
5633 unsigned : 1;
5634 unsigned : 1;
5636 } __SSP1STATbits_t;
5638 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5640 #define _BF 0x01
5641 #define _UA 0x02
5642 #define _R_NOT_W 0x04
5643 #define _R 0x04
5644 #define _R_W 0x04
5645 #define _NOT_W 0x04
5646 #define _NOT_WRITE 0x04
5647 #define _READ_WRITE 0x04
5648 #define _I2C_READ 0x04
5649 #define _S 0x08
5650 #define _I2C_START 0x08
5651 #define _P 0x10
5652 #define _I2C_STOP 0x10
5653 #define _D_NOT_A 0x20
5654 #define _D 0x20
5655 #define _D_A 0x20
5656 #define _NOT_A 0x20
5657 #define _NOT_ADDRESS 0x20
5658 #define _DATA_ADDRESS 0x20
5659 #define _I2C_DAT 0x20
5660 #define _CKE 0x40
5661 #define _SMP 0x80
5663 //==============================================================================
5666 //==============================================================================
5667 // SSPSTAT Bits
5669 extern __at(0x0FC7) __sfr SSPSTAT;
5671 typedef union
5673 struct
5675 unsigned BF : 1;
5676 unsigned UA : 1;
5677 unsigned R_NOT_W : 1;
5678 unsigned S : 1;
5679 unsigned P : 1;
5680 unsigned D_NOT_A : 1;
5681 unsigned CKE : 1;
5682 unsigned SMP : 1;
5685 struct
5687 unsigned : 1;
5688 unsigned : 1;
5689 unsigned R : 1;
5690 unsigned I2C_START : 1;
5691 unsigned I2C_STOP : 1;
5692 unsigned D : 1;
5693 unsigned : 1;
5694 unsigned : 1;
5697 struct
5699 unsigned : 1;
5700 unsigned : 1;
5701 unsigned R_W : 1;
5702 unsigned : 1;
5703 unsigned : 1;
5704 unsigned D_A : 1;
5705 unsigned : 1;
5706 unsigned : 1;
5709 struct
5711 unsigned : 1;
5712 unsigned : 1;
5713 unsigned NOT_W : 1;
5714 unsigned : 1;
5715 unsigned : 1;
5716 unsigned NOT_A : 1;
5717 unsigned : 1;
5718 unsigned : 1;
5721 struct
5723 unsigned : 1;
5724 unsigned : 1;
5725 unsigned NOT_WRITE : 1;
5726 unsigned : 1;
5727 unsigned : 1;
5728 unsigned NOT_ADDRESS : 1;
5729 unsigned : 1;
5730 unsigned : 1;
5733 struct
5735 unsigned : 1;
5736 unsigned : 1;
5737 unsigned READ_WRITE : 1;
5738 unsigned : 1;
5739 unsigned : 1;
5740 unsigned DATA_ADDRESS : 1;
5741 unsigned : 1;
5742 unsigned : 1;
5745 struct
5747 unsigned : 1;
5748 unsigned : 1;
5749 unsigned I2C_READ : 1;
5750 unsigned : 1;
5751 unsigned : 1;
5752 unsigned I2C_DAT : 1;
5753 unsigned : 1;
5754 unsigned : 1;
5756 } __SSPSTATbits_t;
5758 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5760 #define _SSPSTAT_BF 0x01
5761 #define _SSPSTAT_UA 0x02
5762 #define _SSPSTAT_R_NOT_W 0x04
5763 #define _SSPSTAT_R 0x04
5764 #define _SSPSTAT_R_W 0x04
5765 #define _SSPSTAT_NOT_W 0x04
5766 #define _SSPSTAT_NOT_WRITE 0x04
5767 #define _SSPSTAT_READ_WRITE 0x04
5768 #define _SSPSTAT_I2C_READ 0x04
5769 #define _SSPSTAT_S 0x08
5770 #define _SSPSTAT_I2C_START 0x08
5771 #define _SSPSTAT_P 0x10
5772 #define _SSPSTAT_I2C_STOP 0x10
5773 #define _SSPSTAT_D_NOT_A 0x20
5774 #define _SSPSTAT_D 0x20
5775 #define _SSPSTAT_D_A 0x20
5776 #define _SSPSTAT_NOT_A 0x20
5777 #define _SSPSTAT_NOT_ADDRESS 0x20
5778 #define _SSPSTAT_DATA_ADDRESS 0x20
5779 #define _SSPSTAT_I2C_DAT 0x20
5780 #define _SSPSTAT_CKE 0x40
5781 #define _SSPSTAT_SMP 0x80
5783 //==============================================================================
5785 extern __at(0x0FC8) __sfr SSP1ADD;
5787 //==============================================================================
5788 // SSP1MSK Bits
5790 extern __at(0x0FC8) __sfr SSP1MSK;
5792 typedef struct
5794 unsigned MSK0 : 1;
5795 unsigned MSK1 : 1;
5796 unsigned MSK2 : 1;
5797 unsigned MSK3 : 1;
5798 unsigned MSK4 : 1;
5799 unsigned MSK5 : 1;
5800 unsigned MSK6 : 1;
5801 unsigned MSK7 : 1;
5802 } __SSP1MSKbits_t;
5804 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
5806 #define _MSK0 0x01
5807 #define _MSK1 0x02
5808 #define _MSK2 0x04
5809 #define _MSK3 0x08
5810 #define _MSK4 0x10
5811 #define _MSK5 0x20
5812 #define _MSK6 0x40
5813 #define _MSK7 0x80
5815 //==============================================================================
5817 extern __at(0x0FC8) __sfr SSPADD;
5818 extern __at(0x0FC9) __sfr SSP1BUF;
5819 extern __at(0x0FC9) __sfr SSPBUF;
5821 //==============================================================================
5822 // T2CON Bits
5824 extern __at(0x0FCA) __sfr T2CON;
5826 typedef union
5828 struct
5830 unsigned T2CKPS0 : 1;
5831 unsigned T2CKPS1 : 1;
5832 unsigned TMR2ON : 1;
5833 unsigned T2OUTPS0 : 1;
5834 unsigned T2OUTPS1 : 1;
5835 unsigned T2OUTPS2 : 1;
5836 unsigned T2OUTPS3 : 1;
5837 unsigned : 1;
5840 struct
5842 unsigned T2CKPS : 2;
5843 unsigned : 6;
5846 struct
5848 unsigned : 3;
5849 unsigned T2OUTPS : 4;
5850 unsigned : 1;
5852 } __T2CONbits_t;
5854 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5856 #define _T2CKPS0 0x01
5857 #define _T2CKPS1 0x02
5858 #define _TMR2ON 0x04
5859 #define _T2OUTPS0 0x08
5860 #define _T2OUTPS1 0x10
5861 #define _T2OUTPS2 0x20
5862 #define _T2OUTPS3 0x40
5864 //==============================================================================
5866 extern __at(0x0FCB) __sfr PR2;
5867 extern __at(0x0FCC) __sfr TMR2;
5869 //==============================================================================
5870 // T1CON Bits
5872 extern __at(0x0FCD) __sfr T1CON;
5874 typedef union
5876 struct
5878 unsigned TMR1ON : 1;
5879 unsigned RD16 : 1;
5880 unsigned NOT_T1SYNC : 1;
5881 unsigned T1OSCEN : 1;
5882 unsigned T1CKPS0 : 1;
5883 unsigned T1CKPS1 : 1;
5884 unsigned TMR1CS0 : 1;
5885 unsigned TMR1CS1 : 1;
5888 struct
5890 unsigned : 4;
5891 unsigned T1CKPS : 2;
5892 unsigned : 2;
5895 struct
5897 unsigned : 6;
5898 unsigned TMR1CS : 2;
5900 } __T1CONbits_t;
5902 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5904 #define _TMR1ON 0x01
5905 #define _RD16 0x02
5906 #define _NOT_T1SYNC 0x04
5907 #define _T1OSCEN 0x08
5908 #define _T1CKPS0 0x10
5909 #define _T1CKPS1 0x20
5910 #define _TMR1CS0 0x40
5911 #define _TMR1CS1 0x80
5913 //==============================================================================
5915 extern __at(0x0FCE) __sfr TMR1;
5916 extern __at(0x0FCE) __sfr TMR1L;
5917 extern __at(0x0FCF) __sfr TMR1H;
5919 //==============================================================================
5920 // RCON Bits
5922 extern __at(0x0FD0) __sfr RCON;
5924 typedef union
5926 struct
5928 unsigned NOT_BOR : 1;
5929 unsigned NOT_POR : 1;
5930 unsigned NOT_PD : 1;
5931 unsigned NOT_TO : 1;
5932 unsigned NOT_RI : 1;
5933 unsigned NOT_CM : 1;
5934 unsigned : 1;
5935 unsigned IPEN : 1;
5938 struct
5940 unsigned BOR : 1;
5941 unsigned POR : 1;
5942 unsigned PD : 1;
5943 unsigned TO : 1;
5944 unsigned RI : 1;
5945 unsigned CM : 1;
5946 unsigned : 1;
5947 unsigned : 1;
5949 } __RCONbits_t;
5951 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5953 #define _NOT_BOR 0x01
5954 #define _BOR 0x01
5955 #define _NOT_POR 0x02
5956 #define _POR 0x02
5957 #define _NOT_PD 0x04
5958 #define _PD 0x04
5959 #define _NOT_TO 0x08
5960 #define _TO 0x08
5961 #define _NOT_RI 0x10
5962 #define _RI 0x10
5963 #define _NOT_CM 0x20
5964 #define _CM 0x20
5965 #define _IPEN 0x80
5967 //==============================================================================
5970 //==============================================================================
5971 // CM2CON Bits
5973 extern __at(0x0FD1) __sfr CM2CON;
5975 typedef union
5977 struct
5979 unsigned CCH0 : 1;
5980 unsigned CCH1 : 1;
5981 unsigned CREF : 1;
5982 unsigned EVPOL0 : 1;
5983 unsigned EVPOL1 : 1;
5984 unsigned CPOL : 1;
5985 unsigned COE : 1;
5986 unsigned CON : 1;
5989 struct
5991 unsigned CCH : 2;
5992 unsigned : 6;
5995 struct
5997 unsigned : 3;
5998 unsigned EVPOL : 2;
5999 unsigned : 3;
6001 } __CM2CONbits_t;
6003 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
6005 #define _CM2CON_CCH0 0x01
6006 #define _CM2CON_CCH1 0x02
6007 #define _CM2CON_CREF 0x04
6008 #define _CM2CON_EVPOL0 0x08
6009 #define _CM2CON_EVPOL1 0x10
6010 #define _CM2CON_CPOL 0x20
6011 #define _CM2CON_COE 0x40
6012 #define _CM2CON_CON 0x80
6014 //==============================================================================
6017 //==============================================================================
6018 // CM2CON1 Bits
6020 extern __at(0x0FD1) __sfr CM2CON1;
6022 typedef union
6024 struct
6026 unsigned CCH0 : 1;
6027 unsigned CCH1 : 1;
6028 unsigned CREF : 1;
6029 unsigned EVPOL0 : 1;
6030 unsigned EVPOL1 : 1;
6031 unsigned CPOL : 1;
6032 unsigned COE : 1;
6033 unsigned CON : 1;
6036 struct
6038 unsigned CCH : 2;
6039 unsigned : 6;
6042 struct
6044 unsigned : 3;
6045 unsigned EVPOL : 2;
6046 unsigned : 3;
6048 } __CM2CON1bits_t;
6050 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
6052 #define _CM2CON1_CCH0 0x01
6053 #define _CM2CON1_CCH1 0x02
6054 #define _CM2CON1_CREF 0x04
6055 #define _CM2CON1_EVPOL0 0x08
6056 #define _CM2CON1_EVPOL1 0x10
6057 #define _CM2CON1_CPOL 0x20
6058 #define _CM2CON1_COE 0x40
6059 #define _CM2CON1_CON 0x80
6061 //==============================================================================
6064 //==============================================================================
6065 // CM1CON Bits
6067 extern __at(0x0FD2) __sfr CM1CON;
6069 typedef union
6071 struct
6073 unsigned CCH0 : 1;
6074 unsigned CCH1 : 1;
6075 unsigned CREF : 1;
6076 unsigned EVPOL0 : 1;
6077 unsigned EVPOL1 : 1;
6078 unsigned CPOL : 1;
6079 unsigned COE : 1;
6080 unsigned CON : 1;
6083 struct
6085 unsigned CCH : 2;
6086 unsigned : 6;
6089 struct
6091 unsigned : 3;
6092 unsigned EVPOL : 2;
6093 unsigned : 3;
6095 } __CM1CONbits_t;
6097 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
6099 #define _CCH0 0x01
6100 #define _CCH1 0x02
6101 #define _CREF 0x04
6102 #define _EVPOL0 0x08
6103 #define _EVPOL1 0x10
6104 #define _CPOL 0x20
6105 #define _COE 0x40
6106 #define _CON 0x80
6108 //==============================================================================
6111 //==============================================================================
6112 // CM1CON1 Bits
6114 extern __at(0x0FD2) __sfr CM1CON1;
6116 typedef union
6118 struct
6120 unsigned CCH0 : 1;
6121 unsigned CCH1 : 1;
6122 unsigned CREF : 1;
6123 unsigned EVPOL0 : 1;
6124 unsigned EVPOL1 : 1;
6125 unsigned CPOL : 1;
6126 unsigned COE : 1;
6127 unsigned CON : 1;
6130 struct
6132 unsigned CCH : 2;
6133 unsigned : 6;
6136 struct
6138 unsigned : 3;
6139 unsigned EVPOL : 2;
6140 unsigned : 3;
6142 } __CM1CON1bits_t;
6144 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
6146 #define _CM1CON1_CCH0 0x01
6147 #define _CM1CON1_CCH1 0x02
6148 #define _CM1CON1_CREF 0x04
6149 #define _CM1CON1_EVPOL0 0x08
6150 #define _CM1CON1_EVPOL1 0x10
6151 #define _CM1CON1_CPOL 0x20
6152 #define _CM1CON1_COE 0x40
6153 #define _CM1CON1_CON 0x80
6155 //==============================================================================
6158 //==============================================================================
6159 // OSCCON Bits
6161 extern __at(0x0FD3) __sfr OSCCON;
6163 typedef union
6165 struct
6167 unsigned SCS0 : 1;
6168 unsigned SCS1 : 1;
6169 unsigned : 1;
6170 unsigned OSTS : 1;
6171 unsigned IRCF0 : 1;
6172 unsigned IRCF1 : 1;
6173 unsigned IRCF2 : 1;
6174 unsigned IDLEN : 1;
6177 struct
6179 unsigned SCS : 2;
6180 unsigned : 6;
6183 struct
6185 unsigned : 4;
6186 unsigned IRCF : 3;
6187 unsigned : 1;
6189 } __OSCCONbits_t;
6191 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6193 #define _SCS0 0x01
6194 #define _SCS1 0x02
6195 #define _OSTS 0x08
6196 #define _IRCF0 0x10
6197 #define _IRCF1 0x20
6198 #define _IRCF2 0x40
6199 #define _IDLEN 0x80
6201 //==============================================================================
6204 //==============================================================================
6205 // T0CON Bits
6207 extern __at(0x0FD5) __sfr T0CON;
6209 typedef union
6211 struct
6213 unsigned T0PS0 : 1;
6214 unsigned T0PS1 : 1;
6215 unsigned T0PS2 : 1;
6216 unsigned PSA : 1;
6217 unsigned T0SE : 1;
6218 unsigned T0CS : 1;
6219 unsigned T08BIT : 1;
6220 unsigned TMR0ON : 1;
6223 struct
6225 unsigned T0PS : 3;
6226 unsigned : 5;
6228 } __T0CONbits_t;
6230 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6232 #define _T0PS0 0x01
6233 #define _T0PS1 0x02
6234 #define _T0PS2 0x04
6235 #define _PSA 0x08
6236 #define _T0SE 0x10
6237 #define _T0CS 0x20
6238 #define _T08BIT 0x40
6239 #define _TMR0ON 0x80
6241 //==============================================================================
6243 extern __at(0x0FD6) __sfr TMR0;
6244 extern __at(0x0FD6) __sfr TMR0L;
6245 extern __at(0x0FD7) __sfr TMR0H;
6247 //==============================================================================
6248 // STATUS Bits
6250 extern __at(0x0FD8) __sfr STATUS;
6252 typedef struct
6254 unsigned C : 1;
6255 unsigned DC : 1;
6256 unsigned Z : 1;
6257 unsigned OV : 1;
6258 unsigned N : 1;
6259 unsigned : 1;
6260 unsigned : 1;
6261 unsigned : 1;
6262 } __STATUSbits_t;
6264 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6266 #define _C 0x01
6267 #define _DC 0x02
6268 #define _Z 0x04
6269 #define _OV 0x08
6270 #define _N 0x10
6272 //==============================================================================
6274 extern __at(0x0FD9) __sfr FSR2L;
6275 extern __at(0x0FDA) __sfr FSR2H;
6276 extern __at(0x0FDB) __sfr PLUSW2;
6277 extern __at(0x0FDC) __sfr PREINC2;
6278 extern __at(0x0FDD) __sfr POSTDEC2;
6279 extern __at(0x0FDE) __sfr POSTINC2;
6280 extern __at(0x0FDF) __sfr INDF2;
6281 extern __at(0x0FE0) __sfr BSR;
6282 extern __at(0x0FE1) __sfr FSR1L;
6283 extern __at(0x0FE2) __sfr FSR1H;
6284 extern __at(0x0FE3) __sfr PLUSW1;
6285 extern __at(0x0FE4) __sfr PREINC1;
6286 extern __at(0x0FE5) __sfr POSTDEC1;
6287 extern __at(0x0FE6) __sfr POSTINC1;
6288 extern __at(0x0FE7) __sfr INDF1;
6289 extern __at(0x0FE8) __sfr WREG;
6290 extern __at(0x0FE9) __sfr FSR0L;
6291 extern __at(0x0FEA) __sfr FSR0H;
6292 extern __at(0x0FEB) __sfr PLUSW0;
6293 extern __at(0x0FEC) __sfr PREINC0;
6294 extern __at(0x0FED) __sfr POSTDEC0;
6295 extern __at(0x0FEE) __sfr POSTINC0;
6296 extern __at(0x0FEF) __sfr INDF0;
6298 //==============================================================================
6299 // INTCON3 Bits
6301 extern __at(0x0FF0) __sfr INTCON3;
6303 typedef union
6305 struct
6307 unsigned INT1IF : 1;
6308 unsigned INT2IF : 1;
6309 unsigned INT3IF : 1;
6310 unsigned INT1IE : 1;
6311 unsigned INT2IE : 1;
6312 unsigned INT3IE : 1;
6313 unsigned INT1IP : 1;
6314 unsigned INT2IP : 1;
6317 struct
6319 unsigned INT1F : 1;
6320 unsigned INT2F : 1;
6321 unsigned INT3F : 1;
6322 unsigned INT1E : 1;
6323 unsigned INT2E : 1;
6324 unsigned INT3E : 1;
6325 unsigned INT1P : 1;
6326 unsigned INT2P : 1;
6328 } __INTCON3bits_t;
6330 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6332 #define _INT1IF 0x01
6333 #define _INT1F 0x01
6334 #define _INT2IF 0x02
6335 #define _INT2F 0x02
6336 #define _INT3IF 0x04
6337 #define _INT3F 0x04
6338 #define _INT1IE 0x08
6339 #define _INT1E 0x08
6340 #define _INT2IE 0x10
6341 #define _INT2E 0x10
6342 #define _INT3IE 0x20
6343 #define _INT3E 0x20
6344 #define _INT1IP 0x40
6345 #define _INT1P 0x40
6346 #define _INT2IP 0x80
6347 #define _INT2P 0x80
6349 //==============================================================================
6352 //==============================================================================
6353 // INTCON2 Bits
6355 extern __at(0x0FF1) __sfr INTCON2;
6357 typedef union
6359 struct
6361 unsigned RBIP : 1;
6362 unsigned INT3IP : 1;
6363 unsigned TMR0IP : 1;
6364 unsigned INTEDG3 : 1;
6365 unsigned INTEDG2 : 1;
6366 unsigned INTEDG1 : 1;
6367 unsigned INTEDG0 : 1;
6368 unsigned NOT_RBPU : 1;
6371 struct
6373 unsigned : 1;
6374 unsigned INT3P : 1;
6375 unsigned T0IP : 1;
6376 unsigned : 1;
6377 unsigned : 1;
6378 unsigned : 1;
6379 unsigned : 1;
6380 unsigned RBPU : 1;
6382 } __INTCON2bits_t;
6384 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6386 #define _RBIP 0x01
6387 #define _INT3IP 0x02
6388 #define _INT3P 0x02
6389 #define _TMR0IP 0x04
6390 #define _T0IP 0x04
6391 #define _INTEDG3 0x08
6392 #define _INTEDG2 0x10
6393 #define _INTEDG1 0x20
6394 #define _INTEDG0 0x40
6395 #define _NOT_RBPU 0x80
6396 #define _RBPU 0x80
6398 //==============================================================================
6401 //==============================================================================
6402 // INTCON Bits
6404 extern __at(0x0FF2) __sfr INTCON;
6406 typedef union
6408 struct
6410 unsigned RBIF : 1;
6411 unsigned INT0IF : 1;
6412 unsigned TMR0IF : 1;
6413 unsigned RBIE : 1;
6414 unsigned INT0IE : 1;
6415 unsigned TMR0IE : 1;
6416 unsigned PEIE_GIEL : 1;
6417 unsigned GIE_GIEH : 1;
6420 struct
6422 unsigned : 1;
6423 unsigned INT0F : 1;
6424 unsigned T0IF : 1;
6425 unsigned : 1;
6426 unsigned INT0E : 1;
6427 unsigned T0IE : 1;
6428 unsigned PEIE : 1;
6429 unsigned GIE : 1;
6432 struct
6434 unsigned : 1;
6435 unsigned : 1;
6436 unsigned : 1;
6437 unsigned : 1;
6438 unsigned : 1;
6439 unsigned : 1;
6440 unsigned GIEL : 1;
6441 unsigned GIEH : 1;
6443 } __INTCONbits_t;
6445 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6447 #define _RBIF 0x01
6448 #define _INT0IF 0x02
6449 #define _INT0F 0x02
6450 #define _TMR0IF 0x04
6451 #define _T0IF 0x04
6452 #define _RBIE 0x08
6453 #define _INT0IE 0x10
6454 #define _INT0E 0x10
6455 #define _TMR0IE 0x20
6456 #define _T0IE 0x20
6457 #define _PEIE_GIEL 0x40
6458 #define _PEIE 0x40
6459 #define _GIEL 0x40
6460 #define _GIE_GIEH 0x80
6461 #define _GIE 0x80
6462 #define _GIEH 0x80
6464 //==============================================================================
6466 extern __at(0x0FF3) __sfr PROD;
6467 extern __at(0x0FF3) __sfr PRODL;
6468 extern __at(0x0FF4) __sfr PRODH;
6469 extern __at(0x0FF5) __sfr TABLAT;
6470 extern __at(0x0FF6) __sfr TBLPTR;
6471 extern __at(0x0FF6) __sfr TBLPTRL;
6472 extern __at(0x0FF7) __sfr TBLPTRH;
6473 extern __at(0x0FF8) __sfr TBLPTRU;
6474 extern __at(0x0FF9) __sfr PC;
6475 extern __at(0x0FF9) __sfr PCL;
6476 extern __at(0x0FFA) __sfr PCLATH;
6477 extern __at(0x0FFB) __sfr PCLATU;
6479 //==============================================================================
6480 // STKPTR Bits
6482 extern __at(0x0FFC) __sfr STKPTR;
6484 typedef union
6486 struct
6488 unsigned SP0 : 1;
6489 unsigned SP1 : 1;
6490 unsigned SP2 : 1;
6491 unsigned SP3 : 1;
6492 unsigned SP4 : 1;
6493 unsigned : 1;
6494 unsigned STKUNF : 1;
6495 unsigned STKFUL : 1;
6498 struct
6500 unsigned : 1;
6501 unsigned : 1;
6502 unsigned : 1;
6503 unsigned : 1;
6504 unsigned : 1;
6505 unsigned : 1;
6506 unsigned : 1;
6507 unsigned STKOVF : 1;
6510 struct
6512 unsigned SP : 5;
6513 unsigned : 3;
6515 } __STKPTRbits_t;
6517 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6519 #define _SP0 0x01
6520 #define _SP1 0x02
6521 #define _SP2 0x04
6522 #define _SP3 0x08
6523 #define _SP4 0x10
6524 #define _STKUNF 0x40
6525 #define _STKFUL 0x80
6526 #define _STKOVF 0x80
6528 //==============================================================================
6530 extern __at(0x0FFD) __sfr TOS;
6531 extern __at(0x0FFD) __sfr TOSL;
6532 extern __at(0x0FFE) __sfr TOSH;
6533 extern __at(0x0FFF) __sfr TOSU;
6535 //==============================================================================
6537 // Configuration Addresses
6539 //==============================================================================
6541 #define __CONFIG1L 0x00FFF8
6542 #define __CONFIG1H 0x00FFF9
6543 #define __CONFIG2L 0x00FFFA
6544 #define __CONFIG2H 0x00FFFB
6545 #define __CONFIG3L 0x00FFFC
6546 #define __CONFIG3H 0x00FFFD
6547 #define __CONFIG4L 0x00FFFE
6548 #define __CONFIG4H 0x00FFFF
6550 //==============================================================================
6552 #endif // #ifndef __PIC18F26J13_H__