Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f24j11.h
blob187ff9be721b2cf32dd3225965340c78be519302
1 /*
2 * This declarations of the PIC18F24J11 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:26 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 __PIC18F24J11_H__
26 #define __PIC18F24J11_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
36 extern __at(0x0EC6) __sfr RPOR0;
37 extern __at(0x0EC7) __sfr RPOR1;
38 extern __at(0x0EC8) __sfr RPOR2;
39 extern __at(0x0EC9) __sfr RPOR3;
40 extern __at(0x0ECA) __sfr RPOR4;
41 extern __at(0x0ECB) __sfr RPOR5;
42 extern __at(0x0ECC) __sfr RPOR6;
43 extern __at(0x0ECD) __sfr RPOR7;
44 extern __at(0x0ECE) __sfr RPOR8;
45 extern __at(0x0ECF) __sfr RPOR9;
46 extern __at(0x0ED0) __sfr RPOR10;
47 extern __at(0x0ED1) __sfr RPOR11;
48 extern __at(0x0ED2) __sfr RPOR12;
49 extern __at(0x0ED3) __sfr RPOR13;
50 extern __at(0x0ED4) __sfr RPOR14;
51 extern __at(0x0ED5) __sfr RPOR15;
52 extern __at(0x0ED6) __sfr RPOR16;
53 extern __at(0x0ED7) __sfr RPOR17;
54 extern __at(0x0ED8) __sfr RPOR18;
55 extern __at(0x0EE7) __sfr RPINR1;
56 extern __at(0x0EE8) __sfr RPINR2;
57 extern __at(0x0EE9) __sfr RPINR3;
58 extern __at(0x0EEA) __sfr RPINR4;
59 extern __at(0x0EEC) __sfr RPINR6;
60 extern __at(0x0EED) __sfr RPINR7;
61 extern __at(0x0EEE) __sfr RPINR8;
62 extern __at(0x0EF2) __sfr RPINR12;
63 extern __at(0x0EF3) __sfr RPINR13;
64 extern __at(0x0EF6) __sfr RPINR16;
65 extern __at(0x0EF7) __sfr RPINR17;
66 extern __at(0x0EFB) __sfr RPINR21;
67 extern __at(0x0EFC) __sfr RPINR22;
68 extern __at(0x0EFD) __sfr RPINR23;
69 extern __at(0x0EFE) __sfr RPINR24;
71 //==============================================================================
72 // PPSCON Bits
74 extern __at(0x0EFF) __sfr PPSCON;
76 typedef struct
78 unsigned IOLOCK : 1;
79 unsigned : 1;
80 unsigned : 1;
81 unsigned : 1;
82 unsigned : 1;
83 unsigned : 1;
84 unsigned : 1;
85 unsigned : 1;
86 } __PPSCONbits_t;
88 extern __at(0x0EFF) volatile __PPSCONbits_t PPSCONbits;
90 #define _IOLOCK 0x01
92 //==============================================================================
95 //==============================================================================
96 // PADCFG1 Bits
98 extern __at(0x0F3C) __sfr PADCFG1;
100 typedef union
102 struct
104 unsigned PMPTTL : 1;
105 unsigned RTSECSEL0 : 1;
106 unsigned RTSECSEL1 : 1;
107 unsigned : 1;
108 unsigned : 1;
109 unsigned : 1;
110 unsigned : 1;
111 unsigned : 1;
114 struct
116 unsigned : 1;
117 unsigned RTSECSEL : 2;
118 unsigned : 5;
120 } __PADCFG1bits_t;
122 extern __at(0x0F3C) volatile __PADCFG1bits_t PADCFG1bits;
124 #define _PMPTTL 0x01
125 #define _RTSECSEL0 0x02
126 #define _RTSECSEL1 0x04
128 //==============================================================================
131 //==============================================================================
132 // REFOCON Bits
134 extern __at(0x0F3D) __sfr REFOCON;
136 typedef union
138 struct
140 unsigned RODIV0 : 1;
141 unsigned RODIV1 : 1;
142 unsigned RODIV2 : 1;
143 unsigned RODIV3 : 1;
144 unsigned ROSEL : 1;
145 unsigned ROSSLP : 1;
146 unsigned : 1;
147 unsigned ROON : 1;
150 struct
152 unsigned RODIV : 4;
153 unsigned : 4;
155 } __REFOCONbits_t;
157 extern __at(0x0F3D) volatile __REFOCONbits_t REFOCONbits;
159 #define _RODIV0 0x01
160 #define _RODIV1 0x02
161 #define _RODIV2 0x04
162 #define _RODIV3 0x08
163 #define _ROSEL 0x10
164 #define _ROSSLP 0x20
165 #define _ROON 0x80
167 //==============================================================================
170 //==============================================================================
171 // RTCCAL Bits
173 extern __at(0x0F3E) __sfr RTCCAL;
175 typedef struct
177 unsigned CAL0 : 1;
178 unsigned CAL1 : 1;
179 unsigned CAL2 : 1;
180 unsigned CAL3 : 1;
181 unsigned CAL4 : 1;
182 unsigned CAL5 : 1;
183 unsigned CAL6 : 1;
184 unsigned CAL7 : 1;
185 } __RTCCALbits_t;
187 extern __at(0x0F3E) volatile __RTCCALbits_t RTCCALbits;
189 #define _CAL0 0x01
190 #define _CAL1 0x02
191 #define _CAL2 0x04
192 #define _CAL3 0x08
193 #define _CAL4 0x10
194 #define _CAL5 0x20
195 #define _CAL6 0x40
196 #define _CAL7 0x80
198 //==============================================================================
201 //==============================================================================
202 // RTCCFG Bits
204 extern __at(0x0F3F) __sfr RTCCFG;
206 typedef union
208 struct
210 unsigned RTCPTR0 : 1;
211 unsigned RTCPTR1 : 1;
212 unsigned RTCOE : 1;
213 unsigned HALFSEC : 1;
214 unsigned RTCSYNC : 1;
215 unsigned RTCWREN : 1;
216 unsigned : 1;
217 unsigned RTCEN : 1;
220 struct
222 unsigned RTCPTR : 2;
223 unsigned : 6;
225 } __RTCCFGbits_t;
227 extern __at(0x0F3F) volatile __RTCCFGbits_t RTCCFGbits;
229 #define _RTCPTR0 0x01
230 #define _RTCPTR1 0x02
231 #define _RTCOE 0x04
232 #define _HALFSEC 0x08
233 #define _RTCSYNC 0x10
234 #define _RTCWREN 0x20
235 #define _RTCEN 0x80
237 //==============================================================================
240 //==============================================================================
241 // ODCON3 Bits
243 extern __at(0x0F40) __sfr ODCON3;
245 typedef struct
247 unsigned SPI1OD : 1;
248 unsigned SPI2OD : 1;
249 unsigned : 1;
250 unsigned : 1;
251 unsigned : 1;
252 unsigned : 1;
253 unsigned : 1;
254 unsigned : 1;
255 } __ODCON3bits_t;
257 extern __at(0x0F40) volatile __ODCON3bits_t ODCON3bits;
259 #define _SPI1OD 0x01
260 #define _SPI2OD 0x02
262 //==============================================================================
265 //==============================================================================
266 // ODCON2 Bits
268 extern __at(0x0F41) __sfr ODCON2;
270 typedef struct
272 unsigned U1OD : 1;
273 unsigned U2OD : 1;
274 unsigned : 1;
275 unsigned : 1;
276 unsigned : 1;
277 unsigned : 1;
278 unsigned : 1;
279 unsigned : 1;
280 } __ODCON2bits_t;
282 extern __at(0x0F41) volatile __ODCON2bits_t ODCON2bits;
284 #define _U1OD 0x01
285 #define _U2OD 0x02
287 //==============================================================================
290 //==============================================================================
291 // ODCON1 Bits
293 extern __at(0x0F42) __sfr ODCON1;
295 typedef struct
297 unsigned ECCP1OD : 1;
298 unsigned ECCP2OD : 1;
299 unsigned : 1;
300 unsigned : 1;
301 unsigned : 1;
302 unsigned : 1;
303 unsigned : 1;
304 unsigned : 1;
305 } __ODCON1bits_t;
307 extern __at(0x0F42) volatile __ODCON1bits_t ODCON1bits;
309 #define _ECCP1OD 0x01
310 #define _ECCP2OD 0x02
312 //==============================================================================
315 //==============================================================================
316 // ANCON0 Bits
318 extern __at(0x0F48) __sfr ANCON0;
320 typedef union
322 struct
324 unsigned PCFG0 : 1;
325 unsigned PCFG1 : 1;
326 unsigned PCFG2 : 1;
327 unsigned PCFG3 : 1;
328 unsigned PCFG4 : 1;
329 unsigned : 1;
330 unsigned : 1;
331 unsigned : 1;
334 struct
336 unsigned PCFG : 5;
337 unsigned : 3;
339 } __ANCON0bits_t;
341 extern __at(0x0F48) volatile __ANCON0bits_t ANCON0bits;
343 #define _PCFG0 0x01
344 #define _PCFG1 0x02
345 #define _PCFG2 0x04
346 #define _PCFG3 0x08
347 #define _PCFG4 0x10
349 //==============================================================================
352 //==============================================================================
353 // ANCON1 Bits
355 extern __at(0x0F49) __sfr ANCON1;
357 typedef struct
359 unsigned PCFG8 : 1;
360 unsigned PCFG9 : 1;
361 unsigned PCFG10 : 1;
362 unsigned PCFG11 : 1;
363 unsigned PCFG12 : 1;
364 unsigned : 1;
365 unsigned : 1;
366 unsigned VBGEN : 1;
367 } __ANCON1bits_t;
369 extern __at(0x0F49) volatile __ANCON1bits_t ANCON1bits;
371 #define _PCFG8 0x01
372 #define _PCFG9 0x02
373 #define _PCFG10 0x04
374 #define _PCFG11 0x08
375 #define _PCFG12 0x10
376 #define _VBGEN 0x80
378 //==============================================================================
381 //==============================================================================
382 // DSWAKEL Bits
384 extern __at(0x0F4A) __sfr DSWAKEL;
386 typedef struct
388 unsigned DSPOR : 1;
389 unsigned : 1;
390 unsigned DSMCLR : 1;
391 unsigned DSRTC : 1;
392 unsigned DSWDT : 1;
393 unsigned DSULP : 1;
394 unsigned : 1;
395 unsigned DSFLT : 1;
396 } __DSWAKELbits_t;
398 extern __at(0x0F4A) volatile __DSWAKELbits_t DSWAKELbits;
400 #define _DSPOR 0x01
401 #define _DSMCLR 0x04
402 #define _DSRTC 0x08
403 #define _DSWDT 0x10
404 #define _DSULP 0x20
405 #define _DSFLT 0x80
407 //==============================================================================
410 //==============================================================================
411 // DSWAKEH Bits
413 extern __at(0x0F4B) __sfr DSWAKEH;
415 typedef struct
417 unsigned DSINT0 : 1;
418 unsigned : 1;
419 unsigned : 1;
420 unsigned : 1;
421 unsigned : 1;
422 unsigned : 1;
423 unsigned : 1;
424 unsigned : 1;
425 } __DSWAKEHbits_t;
427 extern __at(0x0F4B) volatile __DSWAKEHbits_t DSWAKEHbits;
429 #define _DSINT0 0x01
431 //==============================================================================
434 //==============================================================================
435 // DSCONL Bits
437 extern __at(0x0F4C) __sfr DSCONL;
439 typedef struct
441 unsigned RELEASE : 1;
442 unsigned DSBOR : 1;
443 unsigned ULPWDIS : 1;
444 unsigned : 1;
445 unsigned : 1;
446 unsigned : 1;
447 unsigned : 1;
448 unsigned : 1;
449 } __DSCONLbits_t;
451 extern __at(0x0F4C) volatile __DSCONLbits_t DSCONLbits;
453 #define _RELEASE 0x01
454 #define _DSBOR 0x02
455 #define _ULPWDIS 0x04
457 //==============================================================================
460 //==============================================================================
461 // DSCONH Bits
463 extern __at(0x0F4D) __sfr DSCONH;
465 typedef struct
467 unsigned RTCWDIS : 1;
468 unsigned DSULPEN : 1;
469 unsigned : 1;
470 unsigned : 1;
471 unsigned : 1;
472 unsigned : 1;
473 unsigned : 1;
474 unsigned DSEN : 1;
475 } __DSCONHbits_t;
477 extern __at(0x0F4D) volatile __DSCONHbits_t DSCONHbits;
479 #define _RTCWDIS 0x01
480 #define _DSULPEN 0x02
481 #define _DSEN 0x80
483 //==============================================================================
485 extern __at(0x0F4E) __sfr DSGPR0;
486 extern __at(0x0F4F) __sfr DSGPR1;
488 //==============================================================================
489 // TCLKCON Bits
491 extern __at(0x0F52) __sfr TCLKCON;
493 typedef struct
495 unsigned T3CCP1 : 1;
496 unsigned T3CCP2 : 1;
497 unsigned : 1;
498 unsigned : 1;
499 unsigned T1RUN : 1;
500 unsigned : 1;
501 unsigned : 1;
502 unsigned : 1;
503 } __TCLKCONbits_t;
505 extern __at(0x0F52) volatile __TCLKCONbits_t TCLKCONbits;
507 #define _T3CCP1 0x01
508 #define _T3CCP2 0x02
509 #define _T1RUN 0x10
511 //==============================================================================
514 //==============================================================================
515 // CVRCON Bits
517 extern __at(0x0F53) __sfr CVRCON;
519 typedef union
521 struct
523 unsigned CVR0 : 1;
524 unsigned CVR1 : 1;
525 unsigned CVR2 : 1;
526 unsigned CVR3 : 1;
527 unsigned CVRSS : 1;
528 unsigned CVRR : 1;
529 unsigned CVROE : 1;
530 unsigned CVREN : 1;
533 struct
535 unsigned CVR : 4;
536 unsigned : 4;
538 } __CVRCONbits_t;
540 extern __at(0x0F53) volatile __CVRCONbits_t CVRCONbits;
542 #define _CVR0 0x01
543 #define _CVR1 0x02
544 #define _CVR2 0x04
545 #define _CVR3 0x08
546 #define _CVRSS 0x10
547 #define _CVRR 0x20
548 #define _CVROE 0x40
549 #define _CVREN 0x80
551 //==============================================================================
553 extern __at(0x0F66) __sfr DMABCH;
554 extern __at(0x0F67) __sfr DMABCL;
555 extern __at(0x0F68) __sfr RXADDRH;
556 extern __at(0x0F69) __sfr RXADDRL;
557 extern __at(0x0F6A) __sfr TXADDRH;
558 extern __at(0x0F6B) __sfr TXADDRL;
560 //==============================================================================
561 // CMSTAT Bits
563 extern __at(0x0F70) __sfr CMSTAT;
565 typedef struct
567 unsigned COUT1 : 1;
568 unsigned COUT2 : 1;
569 unsigned : 1;
570 unsigned : 1;
571 unsigned : 1;
572 unsigned : 1;
573 unsigned : 1;
574 unsigned : 1;
575 } __CMSTATbits_t;
577 extern __at(0x0F70) volatile __CMSTATbits_t CMSTATbits;
579 #define _COUT1 0x01
580 #define _COUT2 0x02
582 //==============================================================================
585 //==============================================================================
586 // CMSTATUS Bits
588 extern __at(0x0F70) __sfr CMSTATUS;
590 typedef struct
592 unsigned COUT1 : 1;
593 unsigned COUT2 : 1;
594 unsigned : 1;
595 unsigned : 1;
596 unsigned : 1;
597 unsigned : 1;
598 unsigned : 1;
599 unsigned : 1;
600 } __CMSTATUSbits_t;
602 extern __at(0x0F70) volatile __CMSTATUSbits_t CMSTATUSbits;
604 #define _CMSTATUS_COUT1 0x01
605 #define _CMSTATUS_COUT2 0x02
607 //==============================================================================
610 //==============================================================================
611 // SSP2CON2 Bits
613 extern __at(0x0F71) __sfr SSP2CON2;
615 typedef union
617 struct
619 unsigned SEN : 1;
620 unsigned RSEN : 1;
621 unsigned PEN : 1;
622 unsigned RCEN : 1;
623 unsigned ACKEN : 1;
624 unsigned ACKDT : 1;
625 unsigned ACKSTAT : 1;
626 unsigned GCEN : 1;
629 struct
631 unsigned : 1;
632 unsigned ADMSK1 : 1;
633 unsigned ADMSK2 : 1;
634 unsigned ADMSK3 : 1;
635 unsigned ADMSK4 : 1;
636 unsigned ADMSK5 : 1;
637 unsigned : 1;
638 unsigned : 1;
640 } __SSP2CON2bits_t;
642 extern __at(0x0F71) volatile __SSP2CON2bits_t SSP2CON2bits;
644 #define _SSP2CON2_SEN 0x01
645 #define _SSP2CON2_RSEN 0x02
646 #define _SSP2CON2_ADMSK1 0x02
647 #define _SSP2CON2_PEN 0x04
648 #define _SSP2CON2_ADMSK2 0x04
649 #define _SSP2CON2_RCEN 0x08
650 #define _SSP2CON2_ADMSK3 0x08
651 #define _SSP2CON2_ACKEN 0x10
652 #define _SSP2CON2_ADMSK4 0x10
653 #define _SSP2CON2_ACKDT 0x20
654 #define _SSP2CON2_ADMSK5 0x20
655 #define _SSP2CON2_ACKSTAT 0x40
656 #define _SSP2CON2_GCEN 0x80
658 //==============================================================================
661 //==============================================================================
662 // SSP2CON1 Bits
664 extern __at(0x0F72) __sfr SSP2CON1;
666 typedef union
668 struct
670 unsigned SSPM0 : 1;
671 unsigned SSPM1 : 1;
672 unsigned SSPM2 : 1;
673 unsigned SSPM3 : 1;
674 unsigned CKP : 1;
675 unsigned SSPEN : 1;
676 unsigned SSPOV : 1;
677 unsigned WCOL : 1;
680 struct
682 unsigned SSPM : 4;
683 unsigned : 4;
685 } __SSP2CON1bits_t;
687 extern __at(0x0F72) volatile __SSP2CON1bits_t SSP2CON1bits;
689 #define _SSP2CON1_SSPM0 0x01
690 #define _SSP2CON1_SSPM1 0x02
691 #define _SSP2CON1_SSPM2 0x04
692 #define _SSP2CON1_SSPM3 0x08
693 #define _SSP2CON1_CKP 0x10
694 #define _SSP2CON1_SSPEN 0x20
695 #define _SSP2CON1_SSPOV 0x40
696 #define _SSP2CON1_WCOL 0x80
698 //==============================================================================
701 //==============================================================================
702 // SSP2STAT Bits
704 extern __at(0x0F73) __sfr SSP2STAT;
706 typedef struct
708 unsigned BF : 1;
709 unsigned UA : 1;
710 unsigned R_NOT_W : 1;
711 unsigned S : 1;
712 unsigned P : 1;
713 unsigned D_NOT_A : 1;
714 unsigned CKE : 1;
715 unsigned SMP : 1;
716 } __SSP2STATbits_t;
718 extern __at(0x0F73) volatile __SSP2STATbits_t SSP2STATbits;
720 #define _SSP2STAT_BF 0x01
721 #define _SSP2STAT_UA 0x02
722 #define _SSP2STAT_R_NOT_W 0x04
723 #define _SSP2STAT_S 0x08
724 #define _SSP2STAT_P 0x10
725 #define _SSP2STAT_D_NOT_A 0x20
726 #define _SSP2STAT_CKE 0x40
727 #define _SSP2STAT_SMP 0x80
729 //==============================================================================
732 //==============================================================================
733 // SSP2ADD Bits
735 extern __at(0x0F74) __sfr SSP2ADD;
737 typedef struct
739 unsigned MSK0 : 1;
740 unsigned MSK1 : 1;
741 unsigned MSK2 : 1;
742 unsigned MSK3 : 1;
743 unsigned MSK4 : 1;
744 unsigned MSK5 : 1;
745 unsigned MSK6 : 1;
746 unsigned MSK7 : 1;
747 } __SSP2ADDbits_t;
749 extern __at(0x0F74) volatile __SSP2ADDbits_t SSP2ADDbits;
751 #define _SSP2ADD_MSK0 0x01
752 #define _SSP2ADD_MSK1 0x02
753 #define _SSP2ADD_MSK2 0x04
754 #define _SSP2ADD_MSK3 0x08
755 #define _SSP2ADD_MSK4 0x10
756 #define _SSP2ADD_MSK5 0x20
757 #define _SSP2ADD_MSK6 0x40
758 #define _SSP2ADD_MSK7 0x80
760 //==============================================================================
763 //==============================================================================
764 // SSP2MSK Bits
766 extern __at(0x0F74) __sfr SSP2MSK;
768 typedef struct
770 unsigned MSK0 : 1;
771 unsigned MSK1 : 1;
772 unsigned MSK2 : 1;
773 unsigned MSK3 : 1;
774 unsigned MSK4 : 1;
775 unsigned MSK5 : 1;
776 unsigned MSK6 : 1;
777 unsigned MSK7 : 1;
778 } __SSP2MSKbits_t;
780 extern __at(0x0F74) volatile __SSP2MSKbits_t SSP2MSKbits;
782 #define _SSP2MSK_MSK0 0x01
783 #define _SSP2MSK_MSK1 0x02
784 #define _SSP2MSK_MSK2 0x04
785 #define _SSP2MSK_MSK3 0x08
786 #define _SSP2MSK_MSK4 0x10
787 #define _SSP2MSK_MSK5 0x20
788 #define _SSP2MSK_MSK6 0x40
789 #define _SSP2MSK_MSK7 0x80
791 //==============================================================================
793 extern __at(0x0F75) __sfr SSP2BUF;
795 //==============================================================================
796 // T4CON Bits
798 extern __at(0x0F76) __sfr T4CON;
800 typedef union
802 struct
804 unsigned T4CKPS0 : 1;
805 unsigned T4CKPS1 : 1;
806 unsigned TMR4ON : 1;
807 unsigned T4OUTPS0 : 1;
808 unsigned T4OUTPS1 : 1;
809 unsigned T4OUTPS2 : 1;
810 unsigned T4OUTPS3 : 1;
811 unsigned : 1;
814 struct
816 unsigned T4CKPS : 2;
817 unsigned : 6;
820 struct
822 unsigned : 3;
823 unsigned T4OUTPS : 4;
824 unsigned : 1;
826 } __T4CONbits_t;
828 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
830 #define _T4CKPS0 0x01
831 #define _T4CKPS1 0x02
832 #define _TMR4ON 0x04
833 #define _T4OUTPS0 0x08
834 #define _T4OUTPS1 0x10
835 #define _T4OUTPS2 0x20
836 #define _T4OUTPS3 0x40
838 //==============================================================================
840 extern __at(0x0F77) __sfr PR4;
841 extern __at(0x0F78) __sfr TMR4;
843 //==============================================================================
844 // T3CON Bits
846 extern __at(0x0F79) __sfr T3CON;
848 typedef union
850 struct
852 unsigned TMR3ON : 1;
853 unsigned RD16 : 1;
854 unsigned T3SYNC : 1;
855 unsigned : 1;
856 unsigned T3CKPS0 : 1;
857 unsigned T3CKPS1 : 1;
858 unsigned TMR3CS0 : 1;
859 unsigned TMR3CS1 : 1;
862 struct
864 unsigned : 4;
865 unsigned T3CKPS : 2;
866 unsigned : 2;
869 struct
871 unsigned : 6;
872 unsigned TMR3CS : 2;
874 } __T3CONbits_t;
876 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits;
878 #define _T3CON_TMR3ON 0x01
879 #define _T3CON_RD16 0x02
880 #define _T3CON_T3SYNC 0x04
881 #define _T3CON_T3CKPS0 0x10
882 #define _T3CON_T3CKPS1 0x20
883 #define _T3CON_TMR3CS0 0x40
884 #define _T3CON_TMR3CS1 0x80
886 //==============================================================================
888 extern __at(0x0F7A) __sfr TMR3;
889 extern __at(0x0F7A) __sfr TMR3L;
890 extern __at(0x0F7B) __sfr TMR3H;
892 //==============================================================================
893 // BAUDCON2 Bits
895 extern __at(0x0F7C) __sfr BAUDCON2;
897 typedef struct
899 unsigned ABDEN : 1;
900 unsigned WUE : 1;
901 unsigned : 1;
902 unsigned BRG16 : 1;
903 unsigned TXCKP : 1;
904 unsigned RXDTP : 1;
905 unsigned RCIDL : 1;
906 unsigned ABDOVF : 1;
907 } __BAUDCON2bits_t;
909 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
911 #define _BAUDCON2_ABDEN 0x01
912 #define _BAUDCON2_WUE 0x02
913 #define _BAUDCON2_BRG16 0x08
914 #define _BAUDCON2_TXCKP 0x10
915 #define _BAUDCON2_RXDTP 0x20
916 #define _BAUDCON2_RCIDL 0x40
917 #define _BAUDCON2_ABDOVF 0x80
919 //==============================================================================
921 extern __at(0x0F7D) __sfr SPBRGH2;
923 //==============================================================================
924 // BAUDCON Bits
926 extern __at(0x0F7E) __sfr BAUDCON;
928 typedef struct
930 unsigned ABDEN : 1;
931 unsigned WUE : 1;
932 unsigned : 1;
933 unsigned BRG16 : 1;
934 unsigned TXCKP : 1;
935 unsigned RXDTP : 1;
936 unsigned RCIDL : 1;
937 unsigned ABDOVF : 1;
938 } __BAUDCONbits_t;
940 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
942 #define _ABDEN 0x01
943 #define _WUE 0x02
944 #define _BRG16 0x08
945 #define _TXCKP 0x10
946 #define _RXDTP 0x20
947 #define _RCIDL 0x40
948 #define _ABDOVF 0x80
950 //==============================================================================
953 //==============================================================================
954 // BAUDCON1 Bits
956 extern __at(0x0F7E) __sfr BAUDCON1;
958 typedef struct
960 unsigned ABDEN : 1;
961 unsigned WUE : 1;
962 unsigned : 1;
963 unsigned BRG16 : 1;
964 unsigned TXCKP : 1;
965 unsigned RXDTP : 1;
966 unsigned RCIDL : 1;
967 unsigned ABDOVF : 1;
968 } __BAUDCON1bits_t;
970 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
972 #define _BAUDCON1_ABDEN 0x01
973 #define _BAUDCON1_WUE 0x02
974 #define _BAUDCON1_BRG16 0x08
975 #define _BAUDCON1_TXCKP 0x10
976 #define _BAUDCON1_RXDTP 0x20
977 #define _BAUDCON1_RCIDL 0x40
978 #define _BAUDCON1_ABDOVF 0x80
980 //==============================================================================
983 //==============================================================================
984 // BAUDCTL Bits
986 extern __at(0x0F7E) __sfr BAUDCTL;
988 typedef struct
990 unsigned ABDEN : 1;
991 unsigned WUE : 1;
992 unsigned : 1;
993 unsigned BRG16 : 1;
994 unsigned TXCKP : 1;
995 unsigned RXDTP : 1;
996 unsigned RCIDL : 1;
997 unsigned ABDOVF : 1;
998 } __BAUDCTLbits_t;
1000 extern __at(0x0F7E) volatile __BAUDCTLbits_t BAUDCTLbits;
1002 #define _BAUDCTL_ABDEN 0x01
1003 #define _BAUDCTL_WUE 0x02
1004 #define _BAUDCTL_BRG16 0x08
1005 #define _BAUDCTL_TXCKP 0x10
1006 #define _BAUDCTL_RXDTP 0x20
1007 #define _BAUDCTL_RCIDL 0x40
1008 #define _BAUDCTL_ABDOVF 0x80
1010 //==============================================================================
1012 extern __at(0x0F7F) __sfr SPBRGH;
1013 extern __at(0x0F7F) __sfr SPBRGH1;
1015 //==============================================================================
1016 // PORTA Bits
1018 extern __at(0x0F80) __sfr PORTA;
1020 typedef union
1022 struct
1024 unsigned RA0 : 1;
1025 unsigned RA1 : 1;
1026 unsigned RA2 : 1;
1027 unsigned RA3 : 1;
1028 unsigned : 1;
1029 unsigned RA5 : 1;
1030 unsigned RA6 : 1;
1031 unsigned RA7 : 1;
1034 struct
1036 unsigned AN0 : 1;
1037 unsigned AN1 : 1;
1038 unsigned AN2 : 1;
1039 unsigned AN3 : 1;
1040 unsigned : 1;
1041 unsigned AN4 : 1;
1042 unsigned OSC2 : 1;
1043 unsigned OSC1 : 1;
1046 struct
1048 unsigned C1INA : 1;
1049 unsigned C2INA : 1;
1050 unsigned VREF_MINUS : 1;
1051 unsigned VREF_PLUS : 1;
1052 unsigned : 1;
1053 unsigned NOT_SS1 : 1;
1054 unsigned CLKO : 1;
1055 unsigned CLKI : 1;
1058 struct
1060 unsigned ULPWU : 1;
1061 unsigned RP1 : 1;
1062 unsigned CVREF_MINUS : 1;
1063 unsigned C1INB : 1;
1064 unsigned : 1;
1065 unsigned HLVDIN : 1;
1066 unsigned : 1;
1067 unsigned : 1;
1070 struct
1072 unsigned RP0 : 1;
1073 unsigned : 1;
1074 unsigned C2INB : 1;
1075 unsigned : 1;
1076 unsigned : 1;
1077 unsigned RP2 : 1;
1078 unsigned : 1;
1079 unsigned : 1;
1081 } __PORTAbits_t;
1083 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1085 #define _RA0 0x01
1086 #define _AN0 0x01
1087 #define _C1INA 0x01
1088 #define _ULPWU 0x01
1089 #define _RP0 0x01
1090 #define _RA1 0x02
1091 #define _AN1 0x02
1092 #define _C2INA 0x02
1093 #define _RP1 0x02
1094 #define _RA2 0x04
1095 #define _AN2 0x04
1096 #define _VREF_MINUS 0x04
1097 #define _CVREF_MINUS 0x04
1098 #define _C2INB 0x04
1099 #define _RA3 0x08
1100 #define _AN3 0x08
1101 #define _VREF_PLUS 0x08
1102 #define _C1INB 0x08
1103 #define _RA5 0x20
1104 #define _AN4 0x20
1105 #define _NOT_SS1 0x20
1106 #define _HLVDIN 0x20
1107 #define _RP2 0x20
1108 #define _RA6 0x40
1109 #define _OSC2 0x40
1110 #define _CLKO 0x40
1111 #define _RA7 0x80
1112 #define _OSC1 0x80
1113 #define _CLKI 0x80
1115 //==============================================================================
1118 //==============================================================================
1119 // PORTB Bits
1121 extern __at(0x0F81) __sfr PORTB;
1123 typedef union
1125 struct
1127 unsigned RB0 : 1;
1128 unsigned RB1 : 1;
1129 unsigned RB2 : 1;
1130 unsigned RB3 : 1;
1131 unsigned RB4 : 1;
1132 unsigned RB5 : 1;
1133 unsigned RB6 : 1;
1134 unsigned RB7 : 1;
1137 struct
1139 unsigned AN12 : 1;
1140 unsigned AN10 : 1;
1141 unsigned AN8 : 1;
1142 unsigned AN9 : 1;
1143 unsigned KBI0 : 1;
1144 unsigned KBI1 : 1;
1145 unsigned KBI2 : 1;
1146 unsigned KBI3 : 1;
1149 struct
1151 unsigned INT0 : 1;
1152 unsigned RTCC : 1;
1153 unsigned CTEDG1 : 1;
1154 unsigned CTEDG2 : 1;
1155 unsigned RP7 : 1;
1156 unsigned RP8 : 1;
1157 unsigned PGC : 1;
1158 unsigned PGD : 1;
1161 struct
1163 unsigned RP3 : 1;
1164 unsigned RP4 : 1;
1165 unsigned REFO : 1;
1166 unsigned RP6 : 1;
1167 unsigned : 1;
1168 unsigned : 1;
1169 unsigned RP9 : 1;
1170 unsigned RP10 : 1;
1173 struct
1175 unsigned : 1;
1176 unsigned : 1;
1177 unsigned RP5 : 1;
1178 unsigned : 1;
1179 unsigned : 1;
1180 unsigned : 1;
1181 unsigned : 1;
1182 unsigned : 1;
1185 struct
1187 unsigned : 4;
1188 unsigned KBI : 4;
1190 } __PORTBbits_t;
1192 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1194 #define _RB0 0x01
1195 #define _AN12 0x01
1196 #define _INT0 0x01
1197 #define _RP3 0x01
1198 #define _RB1 0x02
1199 #define _AN10 0x02
1200 #define _RTCC 0x02
1201 #define _RP4 0x02
1202 #define _RB2 0x04
1203 #define _AN8 0x04
1204 #define _CTEDG1 0x04
1205 #define _REFO 0x04
1206 #define _RP5 0x04
1207 #define _RB3 0x08
1208 #define _AN9 0x08
1209 #define _CTEDG2 0x08
1210 #define _RP6 0x08
1211 #define _RB4 0x10
1212 #define _KBI0 0x10
1213 #define _RP7 0x10
1214 #define _RB5 0x20
1215 #define _KBI1 0x20
1216 #define _RP8 0x20
1217 #define _RB6 0x40
1218 #define _KBI2 0x40
1219 #define _PGC 0x40
1220 #define _RP9 0x40
1221 #define _RB7 0x80
1222 #define _KBI3 0x80
1223 #define _PGD 0x80
1224 #define _RP10 0x80
1226 //==============================================================================
1229 //==============================================================================
1230 // PORTC Bits
1232 extern __at(0x0F82) __sfr PORTC;
1234 typedef union
1236 struct
1238 unsigned RC0 : 1;
1239 unsigned RC1 : 1;
1240 unsigned RC2 : 1;
1241 unsigned RC3 : 1;
1242 unsigned RC4 : 1;
1243 unsigned RC5 : 1;
1244 unsigned RC6 : 1;
1245 unsigned RC7 : 1;
1248 struct
1250 unsigned T1OSO : 1;
1251 unsigned T1OSI : 1;
1252 unsigned AN11 : 1;
1253 unsigned SCK1 : 1;
1254 unsigned SDI1 : 1;
1255 unsigned SDO1 : 1;
1256 unsigned TX1 : 1;
1257 unsigned RX1 : 1;
1260 struct
1262 unsigned T1CKI : 1;
1263 unsigned RP12 : 1;
1264 unsigned CTPLS : 1;
1265 unsigned SCL1 : 1;
1266 unsigned RP15 : 1;
1267 unsigned RP16 : 1;
1268 unsigned CK1 : 1;
1269 unsigned DT1 : 1;
1272 struct
1274 unsigned RP11 : 1;
1275 unsigned : 1;
1276 unsigned RP13 : 1;
1277 unsigned RP14 : 1;
1278 unsigned : 1;
1279 unsigned : 1;
1280 unsigned RP17 : 1;
1281 unsigned RP18 : 1;
1283 } __PORTCbits_t;
1285 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1287 #define _RC0 0x01
1288 #define _T1OSO 0x01
1289 #define _T1CKI 0x01
1290 #define _RP11 0x01
1291 #define _RC1 0x02
1292 #define _T1OSI 0x02
1293 #define _RP12 0x02
1294 #define _RC2 0x04
1295 #define _AN11 0x04
1296 #define _CTPLS 0x04
1297 #define _RP13 0x04
1298 #define _RC3 0x08
1299 #define _SCK1 0x08
1300 #define _SCL1 0x08
1301 #define _RP14 0x08
1302 #define _RC4 0x10
1303 #define _SDI1 0x10
1304 #define _RP15 0x10
1305 #define _RC5 0x20
1306 #define _SDO1 0x20
1307 #define _RP16 0x20
1308 #define _RC6 0x40
1309 #define _TX1 0x40
1310 #define _CK1 0x40
1311 #define _RP17 0x40
1312 #define _RC7 0x80
1313 #define _RX1 0x80
1314 #define _DT1 0x80
1315 #define _RP18 0x80
1317 //==============================================================================
1320 //==============================================================================
1321 // HLVDCON Bits
1323 extern __at(0x0F85) __sfr HLVDCON;
1325 typedef union
1327 struct
1329 unsigned HLVDL0 : 1;
1330 unsigned HLVDL1 : 1;
1331 unsigned HLVDL2 : 1;
1332 unsigned HLVDL3 : 1;
1333 unsigned HLVDEN : 1;
1334 unsigned IRVST : 1;
1335 unsigned BGVST : 1;
1336 unsigned VDIRMAG : 1;
1339 struct
1341 unsigned HLVDL : 4;
1342 unsigned : 4;
1344 } __HLVDCONbits_t;
1346 extern __at(0x0F85) volatile __HLVDCONbits_t HLVDCONbits;
1348 #define _HLVDL0 0x01
1349 #define _HLVDL1 0x02
1350 #define _HLVDL2 0x04
1351 #define _HLVDL3 0x08
1352 #define _HLVDEN 0x10
1353 #define _IRVST 0x20
1354 #define _BGVST 0x40
1355 #define _VDIRMAG 0x80
1357 //==============================================================================
1360 //==============================================================================
1361 // DMACON2 Bits
1363 extern __at(0x0F86) __sfr DMACON2;
1365 typedef union
1367 struct
1369 unsigned INTLVL0 : 1;
1370 unsigned INTLVL1 : 1;
1371 unsigned INTLVL2 : 1;
1372 unsigned INTLVL3 : 1;
1373 unsigned DLYCYC0 : 1;
1374 unsigned DLYCYC1 : 1;
1375 unsigned DLYCYC2 : 1;
1376 unsigned DLYCYC3 : 1;
1379 struct
1381 unsigned INTLVL : 4;
1382 unsigned : 4;
1385 struct
1387 unsigned : 4;
1388 unsigned DLYCYC : 4;
1390 } __DMACON2bits_t;
1392 extern __at(0x0F86) volatile __DMACON2bits_t DMACON2bits;
1394 #define _INTLVL0 0x01
1395 #define _INTLVL1 0x02
1396 #define _INTLVL2 0x04
1397 #define _INTLVL3 0x08
1398 #define _DLYCYC0 0x10
1399 #define _DLYCYC1 0x20
1400 #define _DLYCYC2 0x40
1401 #define _DLYCYC3 0x80
1403 //==============================================================================
1406 //==============================================================================
1407 // DMACON1 Bits
1409 extern __at(0x0F88) __sfr DMACON1;
1411 typedef union
1413 struct
1415 unsigned DMAEN : 1;
1416 unsigned DLYINTEN : 1;
1417 unsigned DUPLEX0 : 1;
1418 unsigned DUPLEX1 : 1;
1419 unsigned RXINC : 1;
1420 unsigned TXINC : 1;
1421 unsigned SSCON0 : 1;
1422 unsigned SSCON1 : 1;
1425 struct
1427 unsigned : 2;
1428 unsigned DUPLEX : 2;
1429 unsigned : 4;
1432 struct
1434 unsigned : 6;
1435 unsigned SSCON : 2;
1437 } __DMACON1bits_t;
1439 extern __at(0x0F88) volatile __DMACON1bits_t DMACON1bits;
1441 #define _DMAEN 0x01
1442 #define _DLYINTEN 0x02
1443 #define _DUPLEX0 0x04
1444 #define _DUPLEX1 0x08
1445 #define _RXINC 0x10
1446 #define _TXINC 0x20
1447 #define _SSCON0 0x40
1448 #define _SSCON1 0x80
1450 //==============================================================================
1453 //==============================================================================
1454 // LATA Bits
1456 extern __at(0x0F89) __sfr LATA;
1458 typedef struct
1460 unsigned LATA0 : 1;
1461 unsigned LATA1 : 1;
1462 unsigned LATA2 : 1;
1463 unsigned LATA3 : 1;
1464 unsigned : 1;
1465 unsigned LATA5 : 1;
1466 unsigned LATA6 : 1;
1467 unsigned LATA7 : 1;
1468 } __LATAbits_t;
1470 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1472 #define _LATA0 0x01
1473 #define _LATA1 0x02
1474 #define _LATA2 0x04
1475 #define _LATA3 0x08
1476 #define _LATA5 0x20
1477 #define _LATA6 0x40
1478 #define _LATA7 0x80
1480 //==============================================================================
1483 //==============================================================================
1484 // LATB Bits
1486 extern __at(0x0F8A) __sfr LATB;
1488 typedef struct
1490 unsigned LATB0 : 1;
1491 unsigned LATB1 : 1;
1492 unsigned LATB2 : 1;
1493 unsigned LATB3 : 1;
1494 unsigned LATB4 : 1;
1495 unsigned LATB5 : 1;
1496 unsigned LATB6 : 1;
1497 unsigned LATB7 : 1;
1498 } __LATBbits_t;
1500 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1502 #define _LATB0 0x01
1503 #define _LATB1 0x02
1504 #define _LATB2 0x04
1505 #define _LATB3 0x08
1506 #define _LATB4 0x10
1507 #define _LATB5 0x20
1508 #define _LATB6 0x40
1509 #define _LATB7 0x80
1511 //==============================================================================
1514 //==============================================================================
1515 // LATC Bits
1517 extern __at(0x0F8B) __sfr LATC;
1519 typedef struct
1521 unsigned LATC0 : 1;
1522 unsigned LATC1 : 1;
1523 unsigned LATC2 : 1;
1524 unsigned LATC3 : 1;
1525 unsigned LATC4 : 1;
1526 unsigned LATC5 : 1;
1527 unsigned LATC6 : 1;
1528 unsigned LATC7 : 1;
1529 } __LATCbits_t;
1531 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1533 #define _LATC0 0x01
1534 #define _LATC1 0x02
1535 #define _LATC2 0x04
1536 #define _LATC3 0x08
1537 #define _LATC4 0x10
1538 #define _LATC5 0x20
1539 #define _LATC6 0x40
1540 #define _LATC7 0x80
1542 //==============================================================================
1544 extern __at(0x0F8E) __sfr ALRMVALL;
1545 extern __at(0x0F8F) __sfr ALRMVALH;
1547 //==============================================================================
1548 // ALRMRPT Bits
1550 extern __at(0x0F90) __sfr ALRMRPT;
1552 typedef struct
1554 unsigned ARPT0 : 1;
1555 unsigned ARPT1 : 1;
1556 unsigned ARPT2 : 1;
1557 unsigned ARPT3 : 1;
1558 unsigned ARPT4 : 1;
1559 unsigned ARPT5 : 1;
1560 unsigned ARPT6 : 1;
1561 unsigned ARPT7 : 1;
1562 } __ALRMRPTbits_t;
1564 extern __at(0x0F90) volatile __ALRMRPTbits_t ALRMRPTbits;
1566 #define _ARPT0 0x01
1567 #define _ARPT1 0x02
1568 #define _ARPT2 0x04
1569 #define _ARPT3 0x08
1570 #define _ARPT4 0x10
1571 #define _ARPT5 0x20
1572 #define _ARPT6 0x40
1573 #define _ARPT7 0x80
1575 //==============================================================================
1578 //==============================================================================
1579 // ALRMCFG Bits
1581 extern __at(0x0F91) __sfr ALRMCFG;
1583 typedef union
1585 struct
1587 unsigned ALRMPTR0 : 1;
1588 unsigned ALRMPTR1 : 1;
1589 unsigned AMASK0 : 1;
1590 unsigned AMASK1 : 1;
1591 unsigned AMASK2 : 1;
1592 unsigned AMASK3 : 1;
1593 unsigned CHIME : 1;
1594 unsigned ALRMEN : 1;
1597 struct
1599 unsigned ALRMPTR : 2;
1600 unsigned : 6;
1603 struct
1605 unsigned : 2;
1606 unsigned AMASK : 4;
1607 unsigned : 2;
1609 } __ALRMCFGbits_t;
1611 extern __at(0x0F91) volatile __ALRMCFGbits_t ALRMCFGbits;
1613 #define _ALRMPTR0 0x01
1614 #define _ALRMPTR1 0x02
1615 #define _AMASK0 0x04
1616 #define _AMASK1 0x08
1617 #define _AMASK2 0x10
1618 #define _AMASK3 0x20
1619 #define _CHIME 0x40
1620 #define _ALRMEN 0x80
1622 //==============================================================================
1625 //==============================================================================
1626 // TRISA Bits
1628 extern __at(0x0F92) __sfr TRISA;
1630 typedef struct
1632 unsigned TRISA0 : 1;
1633 unsigned TRISA1 : 1;
1634 unsigned TRISA2 : 1;
1635 unsigned TRISA3 : 1;
1636 unsigned : 1;
1637 unsigned TRISA5 : 1;
1638 unsigned TRISA6 : 1;
1639 unsigned TRISA7 : 1;
1640 } __TRISAbits_t;
1642 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1644 #define _TRISA0 0x01
1645 #define _TRISA1 0x02
1646 #define _TRISA2 0x04
1647 #define _TRISA3 0x08
1648 #define _TRISA5 0x20
1649 #define _TRISA6 0x40
1650 #define _TRISA7 0x80
1652 //==============================================================================
1655 //==============================================================================
1656 // TRISB Bits
1658 extern __at(0x0F93) __sfr TRISB;
1660 typedef struct
1662 unsigned TRISB0 : 1;
1663 unsigned TRISB1 : 1;
1664 unsigned TRISB2 : 1;
1665 unsigned TRISB3 : 1;
1666 unsigned TRISB4 : 1;
1667 unsigned TRISB5 : 1;
1668 unsigned TRISB6 : 1;
1669 unsigned TRISB7 : 1;
1670 } __TRISBbits_t;
1672 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1674 #define _TRISB0 0x01
1675 #define _TRISB1 0x02
1676 #define _TRISB2 0x04
1677 #define _TRISB3 0x08
1678 #define _TRISB4 0x10
1679 #define _TRISB5 0x20
1680 #define _TRISB6 0x40
1681 #define _TRISB7 0x80
1683 //==============================================================================
1686 //==============================================================================
1687 // TRISC Bits
1689 extern __at(0x0F94) __sfr TRISC;
1691 typedef struct
1693 unsigned TRISC0 : 1;
1694 unsigned TRISC1 : 1;
1695 unsigned TRISC2 : 1;
1696 unsigned TRISC3 : 1;
1697 unsigned TRISC4 : 1;
1698 unsigned TRISC5 : 1;
1699 unsigned TRISC6 : 1;
1700 unsigned TRISC7 : 1;
1701 } __TRISCbits_t;
1703 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1705 #define _TRISC0 0x01
1706 #define _TRISC1 0x02
1707 #define _TRISC2 0x04
1708 #define _TRISC3 0x08
1709 #define _TRISC4 0x10
1710 #define _TRISC5 0x20
1711 #define _TRISC6 0x40
1712 #define _TRISC7 0x80
1714 //==============================================================================
1717 //==============================================================================
1718 // T3GCON Bits
1720 extern __at(0x0F97) __sfr T3GCON;
1722 typedef union
1724 struct
1726 unsigned T3GSS0 : 1;
1727 unsigned T3GSS1 : 1;
1728 unsigned T3GVAL : 1;
1729 unsigned T3GGO_T3DONE : 1;
1730 unsigned T3GSPM : 1;
1731 unsigned T3GTM : 1;
1732 unsigned T3GPOL : 1;
1733 unsigned TMR3GE : 1;
1736 struct
1738 unsigned : 1;
1739 unsigned : 1;
1740 unsigned : 1;
1741 unsigned T3GGO : 1;
1742 unsigned : 1;
1743 unsigned : 1;
1744 unsigned : 1;
1745 unsigned : 1;
1748 struct
1750 unsigned : 1;
1751 unsigned : 1;
1752 unsigned : 1;
1753 unsigned T3DONE : 1;
1754 unsigned : 1;
1755 unsigned : 1;
1756 unsigned : 1;
1757 unsigned : 1;
1760 struct
1762 unsigned T3GSS : 2;
1763 unsigned : 6;
1765 } __T3GCONbits_t;
1767 extern __at(0x0F97) volatile __T3GCONbits_t T3GCONbits;
1769 #define _T3GSS0 0x01
1770 #define _T3GSS1 0x02
1771 #define _T3GVAL 0x04
1772 #define _T3GGO_T3DONE 0x08
1773 #define _T3GGO 0x08
1774 #define _T3DONE 0x08
1775 #define _T3GSPM 0x10
1776 #define _T3GTM 0x20
1777 #define _T3GPOL 0x40
1778 #define _TMR3GE 0x80
1780 //==============================================================================
1782 extern __at(0x0F98) __sfr RTCVALL;
1783 extern __at(0x0F99) __sfr RTCVALH;
1785 //==============================================================================
1786 // T1GCON Bits
1788 extern __at(0x0F9A) __sfr T1GCON;
1790 typedef union
1792 struct
1794 unsigned T1GSS0 : 1;
1795 unsigned T1GSS1 : 1;
1796 unsigned T1GVAL : 1;
1797 unsigned T1GGO_T1DONE : 1;
1798 unsigned T1GSPM : 1;
1799 unsigned T1GTM : 1;
1800 unsigned T1GPOL : 1;
1801 unsigned TMR1GE : 1;
1804 struct
1806 unsigned : 1;
1807 unsigned : 1;
1808 unsigned : 1;
1809 unsigned T1GGO : 1;
1810 unsigned : 1;
1811 unsigned : 1;
1812 unsigned : 1;
1813 unsigned : 1;
1816 struct
1818 unsigned : 1;
1819 unsigned : 1;
1820 unsigned : 1;
1821 unsigned T1DONE : 1;
1822 unsigned : 1;
1823 unsigned : 1;
1824 unsigned : 1;
1825 unsigned : 1;
1828 struct
1830 unsigned T1GSS : 2;
1831 unsigned : 6;
1833 } __T1GCONbits_t;
1835 extern __at(0x0F9A) volatile __T1GCONbits_t T1GCONbits;
1837 #define _T1GSS0 0x01
1838 #define _T1GSS1 0x02
1839 #define _T1GVAL 0x04
1840 #define _T1GGO_T1DONE 0x08
1841 #define _T1GGO 0x08
1842 #define _T1DONE 0x08
1843 #define _T1GSPM 0x10
1844 #define _T1GTM 0x20
1845 #define _T1GPOL 0x40
1846 #define _TMR1GE 0x80
1848 //==============================================================================
1851 //==============================================================================
1852 // OSCTUNE Bits
1854 extern __at(0x0F9B) __sfr OSCTUNE;
1856 typedef union
1858 struct
1860 unsigned TUN0 : 1;
1861 unsigned TUN1 : 1;
1862 unsigned TUN2 : 1;
1863 unsigned TUN3 : 1;
1864 unsigned TUN4 : 1;
1865 unsigned TUN5 : 1;
1866 unsigned PLLEN : 1;
1867 unsigned INTSRC : 1;
1870 struct
1872 unsigned TUN : 6;
1873 unsigned : 2;
1875 } __OSCTUNEbits_t;
1877 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
1879 #define _TUN0 0x01
1880 #define _TUN1 0x02
1881 #define _TUN2 0x04
1882 #define _TUN3 0x08
1883 #define _TUN4 0x10
1884 #define _TUN5 0x20
1885 #define _PLLEN 0x40
1886 #define _INTSRC 0x80
1888 //==============================================================================
1891 //==============================================================================
1892 // RCSTA2 Bits
1894 extern __at(0x0F9C) __sfr RCSTA2;
1896 typedef union
1898 struct
1900 unsigned RX9D : 1;
1901 unsigned OERR : 1;
1902 unsigned FERR : 1;
1903 unsigned ADDEN : 1;
1904 unsigned CREN : 1;
1905 unsigned SREN : 1;
1906 unsigned RX9 : 1;
1907 unsigned SPEN : 1;
1910 struct
1912 unsigned RX9D2 : 1;
1913 unsigned OERR2 : 1;
1914 unsigned FERR2 : 1;
1915 unsigned ADDEN2 : 1;
1916 unsigned CREN2 : 1;
1917 unsigned SREN2 : 1;
1918 unsigned RX92 : 1;
1919 unsigned SPEN2 : 1;
1921 } __RCSTA2bits_t;
1923 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
1925 #define _RCSTA2_RX9D 0x01
1926 #define _RCSTA2_RX9D2 0x01
1927 #define _RCSTA2_OERR 0x02
1928 #define _RCSTA2_OERR2 0x02
1929 #define _RCSTA2_FERR 0x04
1930 #define _RCSTA2_FERR2 0x04
1931 #define _RCSTA2_ADDEN 0x08
1932 #define _RCSTA2_ADDEN2 0x08
1933 #define _RCSTA2_CREN 0x10
1934 #define _RCSTA2_CREN2 0x10
1935 #define _RCSTA2_SREN 0x20
1936 #define _RCSTA2_SREN2 0x20
1937 #define _RCSTA2_RX9 0x40
1938 #define _RCSTA2_RX92 0x40
1939 #define _RCSTA2_SPEN 0x80
1940 #define _RCSTA2_SPEN2 0x80
1942 //==============================================================================
1945 //==============================================================================
1946 // PIE1 Bits
1948 extern __at(0x0F9D) __sfr PIE1;
1950 typedef union
1952 struct
1954 unsigned TMR1IE : 1;
1955 unsigned TMR2IE : 1;
1956 unsigned CCP1IE : 1;
1957 unsigned SSP1IE : 1;
1958 unsigned TX1IE : 1;
1959 unsigned RC1IE : 1;
1960 unsigned ADIE : 1;
1961 unsigned : 1;
1964 struct
1966 unsigned : 1;
1967 unsigned : 1;
1968 unsigned : 1;
1969 unsigned SSPIE : 1;
1970 unsigned TXIE : 1;
1971 unsigned RCIE : 1;
1972 unsigned : 1;
1973 unsigned : 1;
1975 } __PIE1bits_t;
1977 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1979 #define _TMR1IE 0x01
1980 #define _TMR2IE 0x02
1981 #define _CCP1IE 0x04
1982 #define _SSP1IE 0x08
1983 #define _SSPIE 0x08
1984 #define _TX1IE 0x10
1985 #define _TXIE 0x10
1986 #define _RC1IE 0x20
1987 #define _RCIE 0x20
1988 #define _ADIE 0x40
1990 //==============================================================================
1993 //==============================================================================
1994 // PIR1 Bits
1996 extern __at(0x0F9E) __sfr PIR1;
1998 typedef union
2000 struct
2002 unsigned TMR1IF : 1;
2003 unsigned TMR2IF : 1;
2004 unsigned CCP1IF : 1;
2005 unsigned SSP1IF : 1;
2006 unsigned TX1IF : 1;
2007 unsigned RC1IF : 1;
2008 unsigned ADIF : 1;
2009 unsigned : 1;
2012 struct
2014 unsigned : 1;
2015 unsigned : 1;
2016 unsigned : 1;
2017 unsigned SSPIF : 1;
2018 unsigned TXIF : 1;
2019 unsigned RCIF : 1;
2020 unsigned : 1;
2021 unsigned : 1;
2023 } __PIR1bits_t;
2025 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2027 #define _TMR1IF 0x01
2028 #define _TMR2IF 0x02
2029 #define _CCP1IF 0x04
2030 #define _SSP1IF 0x08
2031 #define _SSPIF 0x08
2032 #define _TX1IF 0x10
2033 #define _TXIF 0x10
2034 #define _RC1IF 0x20
2035 #define _RCIF 0x20
2036 #define _ADIF 0x40
2038 //==============================================================================
2041 //==============================================================================
2042 // IPR1 Bits
2044 extern __at(0x0F9F) __sfr IPR1;
2046 typedef union
2048 struct
2050 unsigned TMR1IP : 1;
2051 unsigned TMR2IP : 1;
2052 unsigned CCP1IP : 1;
2053 unsigned SSP1IP : 1;
2054 unsigned TX1IP : 1;
2055 unsigned RC1IP : 1;
2056 unsigned ADIP : 1;
2057 unsigned : 1;
2060 struct
2062 unsigned : 1;
2063 unsigned : 1;
2064 unsigned : 1;
2065 unsigned SSPIP : 1;
2066 unsigned TXIP : 1;
2067 unsigned RCIP : 1;
2068 unsigned : 1;
2069 unsigned : 1;
2071 } __IPR1bits_t;
2073 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2075 #define _TMR1IP 0x01
2076 #define _TMR2IP 0x02
2077 #define _CCP1IP 0x04
2078 #define _SSP1IP 0x08
2079 #define _SSPIP 0x08
2080 #define _TX1IP 0x10
2081 #define _TXIP 0x10
2082 #define _RC1IP 0x20
2083 #define _RCIP 0x20
2084 #define _ADIP 0x40
2086 //==============================================================================
2089 //==============================================================================
2090 // PIE2 Bits
2092 extern __at(0x0FA0) __sfr PIE2;
2094 typedef union
2096 struct
2098 unsigned CCP2IE : 1;
2099 unsigned TMR3IE : 1;
2100 unsigned LVDIE : 1;
2101 unsigned BCL1IE : 1;
2102 unsigned : 1;
2103 unsigned CM1IE : 1;
2104 unsigned CM2IE : 1;
2105 unsigned OSCFIE : 1;
2108 struct
2110 unsigned : 1;
2111 unsigned : 1;
2112 unsigned : 1;
2113 unsigned BCLIE : 1;
2114 unsigned : 1;
2115 unsigned : 1;
2116 unsigned : 1;
2117 unsigned : 1;
2119 } __PIE2bits_t;
2121 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2123 #define _CCP2IE 0x01
2124 #define _TMR3IE 0x02
2125 #define _LVDIE 0x04
2126 #define _BCL1IE 0x08
2127 #define _BCLIE 0x08
2128 #define _CM1IE 0x20
2129 #define _CM2IE 0x40
2130 #define _OSCFIE 0x80
2132 //==============================================================================
2135 //==============================================================================
2136 // PIR2 Bits
2138 extern __at(0x0FA1) __sfr PIR2;
2140 typedef union
2142 struct
2144 unsigned CCP2IF : 1;
2145 unsigned TMR3IF : 1;
2146 unsigned LVDIF : 1;
2147 unsigned BCL1IF : 1;
2148 unsigned : 1;
2149 unsigned CM1IF : 1;
2150 unsigned CM2IF : 1;
2151 unsigned OSCFIF : 1;
2154 struct
2156 unsigned : 1;
2157 unsigned : 1;
2158 unsigned : 1;
2159 unsigned BCLIF : 1;
2160 unsigned : 1;
2161 unsigned : 1;
2162 unsigned : 1;
2163 unsigned : 1;
2165 } __PIR2bits_t;
2167 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2169 #define _CCP2IF 0x01
2170 #define _TMR3IF 0x02
2171 #define _LVDIF 0x04
2172 #define _BCL1IF 0x08
2173 #define _BCLIF 0x08
2174 #define _CM1IF 0x20
2175 #define _CM2IF 0x40
2176 #define _OSCFIF 0x80
2178 //==============================================================================
2181 //==============================================================================
2182 // IPR2 Bits
2184 extern __at(0x0FA2) __sfr IPR2;
2186 typedef union
2188 struct
2190 unsigned CCP2IP : 1;
2191 unsigned TMR3IP : 1;
2192 unsigned LVDIP : 1;
2193 unsigned BCL1IP : 1;
2194 unsigned : 1;
2195 unsigned CM1IP : 1;
2196 unsigned CM2IP : 1;
2197 unsigned OSCFIP : 1;
2200 struct
2202 unsigned : 1;
2203 unsigned : 1;
2204 unsigned : 1;
2205 unsigned BCLIP : 1;
2206 unsigned : 1;
2207 unsigned : 1;
2208 unsigned : 1;
2209 unsigned : 1;
2211 } __IPR2bits_t;
2213 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
2215 #define _CCP2IP 0x01
2216 #define _TMR3IP 0x02
2217 #define _LVDIP 0x04
2218 #define _BCL1IP 0x08
2219 #define _BCLIP 0x08
2220 #define _CM1IP 0x20
2221 #define _CM2IP 0x40
2222 #define _OSCFIP 0x80
2224 //==============================================================================
2227 //==============================================================================
2228 // PIE3 Bits
2230 extern __at(0x0FA3) __sfr PIE3;
2232 typedef struct
2234 unsigned RTCCIE : 1;
2235 unsigned TMR3GIE : 1;
2236 unsigned CTMUIE : 1;
2237 unsigned TMR4IE : 1;
2238 unsigned TX2IE : 1;
2239 unsigned RC2IE : 1;
2240 unsigned BCL2IE : 1;
2241 unsigned SSP2IE : 1;
2242 } __PIE3bits_t;
2244 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
2246 #define _RTCCIE 0x01
2247 #define _TMR3GIE 0x02
2248 #define _CTMUIE 0x04
2249 #define _TMR4IE 0x08
2250 #define _TX2IE 0x10
2251 #define _RC2IE 0x20
2252 #define _BCL2IE 0x40
2253 #define _SSP2IE 0x80
2255 //==============================================================================
2258 //==============================================================================
2259 // PIR3 Bits
2261 extern __at(0x0FA4) __sfr PIR3;
2263 typedef struct
2265 unsigned RTCCIF : 1;
2266 unsigned TMR3GIF : 1;
2267 unsigned CTMUIF : 1;
2268 unsigned TMR4IF : 1;
2269 unsigned TX2IF : 1;
2270 unsigned RC2IF : 1;
2271 unsigned BCL2IF : 1;
2272 unsigned SSP2IF : 1;
2273 } __PIR3bits_t;
2275 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
2277 #define _RTCCIF 0x01
2278 #define _TMR3GIF 0x02
2279 #define _CTMUIF 0x04
2280 #define _TMR4IF 0x08
2281 #define _TX2IF 0x10
2282 #define _RC2IF 0x20
2283 #define _BCL2IF 0x40
2284 #define _SSP2IF 0x80
2286 //==============================================================================
2289 //==============================================================================
2290 // IPR3 Bits
2292 extern __at(0x0FA5) __sfr IPR3;
2294 typedef struct
2296 unsigned RTCCIP : 1;
2297 unsigned TMR3GIP : 1;
2298 unsigned CTMUIP : 1;
2299 unsigned TMR4IP : 1;
2300 unsigned TX2IP : 1;
2301 unsigned RC2IP : 1;
2302 unsigned BCL2IP : 1;
2303 unsigned SSP2IP : 1;
2304 } __IPR3bits_t;
2306 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
2308 #define _RTCCIP 0x01
2309 #define _TMR3GIP 0x02
2310 #define _CTMUIP 0x04
2311 #define _TMR4IP 0x08
2312 #define _TX2IP 0x10
2313 #define _RC2IP 0x20
2314 #define _BCL2IP 0x40
2315 #define _SSP2IP 0x80
2317 //==============================================================================
2320 //==============================================================================
2321 // EECON1 Bits
2323 extern __at(0x0FA6) __sfr EECON1;
2325 typedef struct
2327 unsigned : 1;
2328 unsigned WR : 1;
2329 unsigned WREN : 1;
2330 unsigned WRERR : 1;
2331 unsigned FREE : 1;
2332 unsigned WPROG : 1;
2333 unsigned : 1;
2334 unsigned : 1;
2335 } __EECON1bits_t;
2337 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
2339 #define _WR 0x02
2340 #define _WREN 0x04
2341 #define _WRERR 0x08
2342 #define _FREE 0x10
2343 #define _WPROG 0x20
2345 //==============================================================================
2347 extern __at(0x0FA7) __sfr EECON2;
2349 //==============================================================================
2350 // TXSTA2 Bits
2352 extern __at(0x0FA8) __sfr TXSTA2;
2354 typedef union
2356 struct
2358 unsigned TX9D : 1;
2359 unsigned TRMT : 1;
2360 unsigned BRGH : 1;
2361 unsigned SENDB : 1;
2362 unsigned SYNC : 1;
2363 unsigned TXEN : 1;
2364 unsigned TX9 : 1;
2365 unsigned CSRC : 1;
2368 struct
2370 unsigned TX9D2 : 1;
2371 unsigned TRMT2 : 1;
2372 unsigned BRGH2 : 1;
2373 unsigned SENDB2 : 1;
2374 unsigned SYNC2 : 1;
2375 unsigned TXEN2 : 1;
2376 unsigned TX92 : 1;
2377 unsigned CSRC2 : 1;
2379 } __TXSTA2bits_t;
2381 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
2383 #define _TXSTA2_TX9D 0x01
2384 #define _TXSTA2_TX9D2 0x01
2385 #define _TXSTA2_TRMT 0x02
2386 #define _TXSTA2_TRMT2 0x02
2387 #define _TXSTA2_BRGH 0x04
2388 #define _TXSTA2_BRGH2 0x04
2389 #define _TXSTA2_SENDB 0x08
2390 #define _TXSTA2_SENDB2 0x08
2391 #define _TXSTA2_SYNC 0x10
2392 #define _TXSTA2_SYNC2 0x10
2393 #define _TXSTA2_TXEN 0x20
2394 #define _TXSTA2_TXEN2 0x20
2395 #define _TXSTA2_TX9 0x40
2396 #define _TXSTA2_TX92 0x40
2397 #define _TXSTA2_CSRC 0x80
2398 #define _TXSTA2_CSRC2 0x80
2400 //==============================================================================
2402 extern __at(0x0FA9) __sfr TXREG2;
2403 extern __at(0x0FAA) __sfr RCREG2;
2404 extern __at(0x0FAB) __sfr SPBRG2;
2406 //==============================================================================
2407 // RCSTA Bits
2409 extern __at(0x0FAC) __sfr RCSTA;
2411 typedef union
2413 struct
2415 unsigned RX9D : 1;
2416 unsigned OERR : 1;
2417 unsigned FERR : 1;
2418 unsigned ADDEN : 1;
2419 unsigned CREN : 1;
2420 unsigned SREN : 1;
2421 unsigned RX9 : 1;
2422 unsigned SPEN : 1;
2425 struct
2427 unsigned RCD8 : 1;
2428 unsigned OERR1 : 1;
2429 unsigned FERR1 : 1;
2430 unsigned ADEN : 1;
2431 unsigned CREN1 : 1;
2432 unsigned SREN1 : 1;
2433 unsigned RC9 : 1;
2434 unsigned SPEN1 : 1;
2437 struct
2439 unsigned RX9D1 : 1;
2440 unsigned : 1;
2441 unsigned : 1;
2442 unsigned ADDEN1 : 1;
2443 unsigned : 1;
2444 unsigned : 1;
2445 unsigned NOT_RC8 : 1;
2446 unsigned : 1;
2449 struct
2451 unsigned : 1;
2452 unsigned : 1;
2453 unsigned : 1;
2454 unsigned : 1;
2455 unsigned : 1;
2456 unsigned : 1;
2457 unsigned RC8_9 : 1;
2458 unsigned : 1;
2461 struct
2463 unsigned : 1;
2464 unsigned : 1;
2465 unsigned : 1;
2466 unsigned : 1;
2467 unsigned : 1;
2468 unsigned : 1;
2469 unsigned RX91 : 1;
2470 unsigned : 1;
2472 } __RCSTAbits_t;
2474 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
2476 #define _RX9D 0x01
2477 #define _RCD8 0x01
2478 #define _RX9D1 0x01
2479 #define _OERR 0x02
2480 #define _OERR1 0x02
2481 #define _FERR 0x04
2482 #define _FERR1 0x04
2483 #define _ADDEN 0x08
2484 #define _ADEN 0x08
2485 #define _ADDEN1 0x08
2486 #define _CREN 0x10
2487 #define _CREN1 0x10
2488 #define _SREN 0x20
2489 #define _SREN1 0x20
2490 #define _RX9 0x40
2491 #define _RC9 0x40
2492 #define _NOT_RC8 0x40
2493 #define _RC8_9 0x40
2494 #define _RX91 0x40
2495 #define _SPEN 0x80
2496 #define _SPEN1 0x80
2498 //==============================================================================
2501 //==============================================================================
2502 // RCSTA1 Bits
2504 extern __at(0x0FAC) __sfr RCSTA1;
2506 typedef union
2508 struct
2510 unsigned RX9D : 1;
2511 unsigned OERR : 1;
2512 unsigned FERR : 1;
2513 unsigned ADDEN : 1;
2514 unsigned CREN : 1;
2515 unsigned SREN : 1;
2516 unsigned RX9 : 1;
2517 unsigned SPEN : 1;
2520 struct
2522 unsigned RCD8 : 1;
2523 unsigned OERR1 : 1;
2524 unsigned FERR1 : 1;
2525 unsigned ADEN : 1;
2526 unsigned CREN1 : 1;
2527 unsigned SREN1 : 1;
2528 unsigned RC9 : 1;
2529 unsigned SPEN1 : 1;
2532 struct
2534 unsigned RX9D1 : 1;
2535 unsigned : 1;
2536 unsigned : 1;
2537 unsigned ADDEN1 : 1;
2538 unsigned : 1;
2539 unsigned : 1;
2540 unsigned NOT_RC8 : 1;
2541 unsigned : 1;
2544 struct
2546 unsigned : 1;
2547 unsigned : 1;
2548 unsigned : 1;
2549 unsigned : 1;
2550 unsigned : 1;
2551 unsigned : 1;
2552 unsigned RC8_9 : 1;
2553 unsigned : 1;
2556 struct
2558 unsigned : 1;
2559 unsigned : 1;
2560 unsigned : 1;
2561 unsigned : 1;
2562 unsigned : 1;
2563 unsigned : 1;
2564 unsigned RX91 : 1;
2565 unsigned : 1;
2567 } __RCSTA1bits_t;
2569 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
2571 #define _RCSTA1_RX9D 0x01
2572 #define _RCSTA1_RCD8 0x01
2573 #define _RCSTA1_RX9D1 0x01
2574 #define _RCSTA1_OERR 0x02
2575 #define _RCSTA1_OERR1 0x02
2576 #define _RCSTA1_FERR 0x04
2577 #define _RCSTA1_FERR1 0x04
2578 #define _RCSTA1_ADDEN 0x08
2579 #define _RCSTA1_ADEN 0x08
2580 #define _RCSTA1_ADDEN1 0x08
2581 #define _RCSTA1_CREN 0x10
2582 #define _RCSTA1_CREN1 0x10
2583 #define _RCSTA1_SREN 0x20
2584 #define _RCSTA1_SREN1 0x20
2585 #define _RCSTA1_RX9 0x40
2586 #define _RCSTA1_RC9 0x40
2587 #define _RCSTA1_NOT_RC8 0x40
2588 #define _RCSTA1_RC8_9 0x40
2589 #define _RCSTA1_RX91 0x40
2590 #define _RCSTA1_SPEN 0x80
2591 #define _RCSTA1_SPEN1 0x80
2593 //==============================================================================
2596 //==============================================================================
2597 // TXSTA Bits
2599 extern __at(0x0FAD) __sfr TXSTA;
2601 typedef union
2603 struct
2605 unsigned TX9D : 1;
2606 unsigned TRMT : 1;
2607 unsigned BRGH : 1;
2608 unsigned SENDB : 1;
2609 unsigned SYNC : 1;
2610 unsigned TXEN : 1;
2611 unsigned TX9 : 1;
2612 unsigned CSRC : 1;
2615 struct
2617 unsigned TXD8 : 1;
2618 unsigned TRMT1 : 1;
2619 unsigned BRGH1 : 1;
2620 unsigned SENDB1 : 1;
2621 unsigned SYNC1 : 1;
2622 unsigned TXEN1 : 1;
2623 unsigned TX8_9 : 1;
2624 unsigned CSRC1 : 1;
2627 struct
2629 unsigned TX9D1 : 1;
2630 unsigned : 1;
2631 unsigned : 1;
2632 unsigned : 1;
2633 unsigned : 1;
2634 unsigned : 1;
2635 unsigned NOT_TX8 : 1;
2636 unsigned : 1;
2639 struct
2641 unsigned : 1;
2642 unsigned : 1;
2643 unsigned : 1;
2644 unsigned : 1;
2645 unsigned : 1;
2646 unsigned : 1;
2647 unsigned TX91 : 1;
2648 unsigned : 1;
2650 } __TXSTAbits_t;
2652 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
2654 #define _TX9D 0x01
2655 #define _TXD8 0x01
2656 #define _TX9D1 0x01
2657 #define _TRMT 0x02
2658 #define _TRMT1 0x02
2659 #define _BRGH 0x04
2660 #define _BRGH1 0x04
2661 #define _SENDB 0x08
2662 #define _SENDB1 0x08
2663 #define _SYNC 0x10
2664 #define _SYNC1 0x10
2665 #define _TXEN 0x20
2666 #define _TXEN1 0x20
2667 #define _TX9 0x40
2668 #define _TX8_9 0x40
2669 #define _NOT_TX8 0x40
2670 #define _TX91 0x40
2671 #define _CSRC 0x80
2672 #define _CSRC1 0x80
2674 //==============================================================================
2677 //==============================================================================
2678 // TXSTA1 Bits
2680 extern __at(0x0FAD) __sfr TXSTA1;
2682 typedef union
2684 struct
2686 unsigned TX9D : 1;
2687 unsigned TRMT : 1;
2688 unsigned BRGH : 1;
2689 unsigned SENDB : 1;
2690 unsigned SYNC : 1;
2691 unsigned TXEN : 1;
2692 unsigned TX9 : 1;
2693 unsigned CSRC : 1;
2696 struct
2698 unsigned TXD8 : 1;
2699 unsigned TRMT1 : 1;
2700 unsigned BRGH1 : 1;
2701 unsigned SENDB1 : 1;
2702 unsigned SYNC1 : 1;
2703 unsigned TXEN1 : 1;
2704 unsigned TX8_9 : 1;
2705 unsigned CSRC1 : 1;
2708 struct
2710 unsigned TX9D1 : 1;
2711 unsigned : 1;
2712 unsigned : 1;
2713 unsigned : 1;
2714 unsigned : 1;
2715 unsigned : 1;
2716 unsigned NOT_TX8 : 1;
2717 unsigned : 1;
2720 struct
2722 unsigned : 1;
2723 unsigned : 1;
2724 unsigned : 1;
2725 unsigned : 1;
2726 unsigned : 1;
2727 unsigned : 1;
2728 unsigned TX91 : 1;
2729 unsigned : 1;
2731 } __TXSTA1bits_t;
2733 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
2735 #define _TXSTA1_TX9D 0x01
2736 #define _TXSTA1_TXD8 0x01
2737 #define _TXSTA1_TX9D1 0x01
2738 #define _TXSTA1_TRMT 0x02
2739 #define _TXSTA1_TRMT1 0x02
2740 #define _TXSTA1_BRGH 0x04
2741 #define _TXSTA1_BRGH1 0x04
2742 #define _TXSTA1_SENDB 0x08
2743 #define _TXSTA1_SENDB1 0x08
2744 #define _TXSTA1_SYNC 0x10
2745 #define _TXSTA1_SYNC1 0x10
2746 #define _TXSTA1_TXEN 0x20
2747 #define _TXSTA1_TXEN1 0x20
2748 #define _TXSTA1_TX9 0x40
2749 #define _TXSTA1_TX8_9 0x40
2750 #define _TXSTA1_NOT_TX8 0x40
2751 #define _TXSTA1_TX91 0x40
2752 #define _TXSTA1_CSRC 0x80
2753 #define _TXSTA1_CSRC1 0x80
2755 //==============================================================================
2757 extern __at(0x0FAE) __sfr TXREG;
2758 extern __at(0x0FAE) __sfr TXREG1;
2759 extern __at(0x0FAF) __sfr RCREG;
2760 extern __at(0x0FAF) __sfr RCREG1;
2761 extern __at(0x0FB0) __sfr SPBRG;
2762 extern __at(0x0FB0) __sfr SPBRG1;
2764 //==============================================================================
2765 // CTMUICON Bits
2767 extern __at(0x0FB1) __sfr CTMUICON;
2769 typedef union
2771 struct
2773 unsigned IRNG0 : 1;
2774 unsigned IRNG1 : 1;
2775 unsigned ITRIM0 : 1;
2776 unsigned ITRIM1 : 1;
2777 unsigned ITRIM2 : 1;
2778 unsigned ITRIM3 : 1;
2779 unsigned ITRIM4 : 1;
2780 unsigned ITRIM5 : 1;
2783 struct
2785 unsigned IRNG : 2;
2786 unsigned : 6;
2789 struct
2791 unsigned : 2;
2792 unsigned ITRIM : 6;
2794 } __CTMUICONbits_t;
2796 extern __at(0x0FB1) volatile __CTMUICONbits_t CTMUICONbits;
2798 #define _IRNG0 0x01
2799 #define _IRNG1 0x02
2800 #define _ITRIM0 0x04
2801 #define _ITRIM1 0x08
2802 #define _ITRIM2 0x10
2803 #define _ITRIM3 0x20
2804 #define _ITRIM4 0x40
2805 #define _ITRIM5 0x80
2807 //==============================================================================
2810 //==============================================================================
2811 // CTMUCONL Bits
2813 extern __at(0x0FB2) __sfr CTMUCONL;
2815 typedef union
2817 struct
2819 unsigned EDG1STAT : 1;
2820 unsigned EDG2STAT : 1;
2821 unsigned EDG1SEL0 : 1;
2822 unsigned EDG1SEL1 : 1;
2823 unsigned EDG1POL : 1;
2824 unsigned EDG2SEL0 : 1;
2825 unsigned EDG2SEL1 : 1;
2826 unsigned EDG2POL : 1;
2829 struct
2831 unsigned : 2;
2832 unsigned EDG1SEL : 2;
2833 unsigned : 4;
2836 struct
2838 unsigned : 5;
2839 unsigned EDG2SEL : 2;
2840 unsigned : 1;
2842 } __CTMUCONLbits_t;
2844 extern __at(0x0FB2) volatile __CTMUCONLbits_t CTMUCONLbits;
2846 #define _EDG1STAT 0x01
2847 #define _EDG2STAT 0x02
2848 #define _EDG1SEL0 0x04
2849 #define _EDG1SEL1 0x08
2850 #define _EDG1POL 0x10
2851 #define _EDG2SEL0 0x20
2852 #define _EDG2SEL1 0x40
2853 #define _EDG2POL 0x80
2855 //==============================================================================
2858 //==============================================================================
2859 // CTMUCONH Bits
2861 extern __at(0x0FB3) __sfr CTMUCONH;
2863 typedef struct
2865 unsigned CTTRIG : 1;
2866 unsigned IDISSEN : 1;
2867 unsigned EDGSEQEN : 1;
2868 unsigned EDGEN : 1;
2869 unsigned TGEN : 1;
2870 unsigned CTMUSIDL : 1;
2871 unsigned : 1;
2872 unsigned CTMUEN : 1;
2873 } __CTMUCONHbits_t;
2875 extern __at(0x0FB3) volatile __CTMUCONHbits_t CTMUCONHbits;
2877 #define _CTTRIG 0x01
2878 #define _IDISSEN 0x02
2879 #define _EDGSEQEN 0x04
2880 #define _EDGEN 0x08
2881 #define _TGEN 0x10
2882 #define _CTMUSIDL 0x20
2883 #define _CTMUEN 0x80
2885 //==============================================================================
2888 //==============================================================================
2889 // CCP2CON Bits
2891 extern __at(0x0FB4) __sfr CCP2CON;
2893 typedef union
2895 struct
2897 unsigned CCP2M0 : 1;
2898 unsigned CCP2M1 : 1;
2899 unsigned CCP2M2 : 1;
2900 unsigned CCP2M3 : 1;
2901 unsigned DC2B0 : 1;
2902 unsigned DC2B1 : 1;
2903 unsigned P2M0 : 1;
2904 unsigned P2M1 : 1;
2907 struct
2909 unsigned : 1;
2910 unsigned : 1;
2911 unsigned : 1;
2912 unsigned : 1;
2913 unsigned CCP2Y : 1;
2914 unsigned CCP2X : 1;
2915 unsigned : 1;
2916 unsigned : 1;
2919 struct
2921 unsigned CCP2M : 4;
2922 unsigned : 4;
2925 struct
2927 unsigned : 4;
2928 unsigned DC2B : 2;
2929 unsigned : 2;
2932 struct
2934 unsigned : 6;
2935 unsigned P2M : 2;
2937 } __CCP2CONbits_t;
2939 extern __at(0x0FB4) volatile __CCP2CONbits_t CCP2CONbits;
2941 #define _CCP2M0 0x01
2942 #define _CCP2M1 0x02
2943 #define _CCP2M2 0x04
2944 #define _CCP2M3 0x08
2945 #define _DC2B0 0x10
2946 #define _CCP2Y 0x10
2947 #define _DC2B1 0x20
2948 #define _CCP2X 0x20
2949 #define _P2M0 0x40
2950 #define _P2M1 0x80
2952 //==============================================================================
2955 //==============================================================================
2956 // ECCP2CON Bits
2958 extern __at(0x0FB4) __sfr ECCP2CON;
2960 typedef union
2962 struct
2964 unsigned CCP2M0 : 1;
2965 unsigned CCP2M1 : 1;
2966 unsigned CCP2M2 : 1;
2967 unsigned CCP2M3 : 1;
2968 unsigned DC2B0 : 1;
2969 unsigned DC2B1 : 1;
2970 unsigned P2M0 : 1;
2971 unsigned P2M1 : 1;
2974 struct
2976 unsigned : 1;
2977 unsigned : 1;
2978 unsigned : 1;
2979 unsigned : 1;
2980 unsigned CCP2Y : 1;
2981 unsigned CCP2X : 1;
2982 unsigned : 1;
2983 unsigned : 1;
2986 struct
2988 unsigned CCP2M : 4;
2989 unsigned : 4;
2992 struct
2994 unsigned : 4;
2995 unsigned DC2B : 2;
2996 unsigned : 2;
2999 struct
3001 unsigned : 6;
3002 unsigned P2M : 2;
3004 } __ECCP2CONbits_t;
3006 extern __at(0x0FB4) volatile __ECCP2CONbits_t ECCP2CONbits;
3008 #define _ECCP2CON_CCP2M0 0x01
3009 #define _ECCP2CON_CCP2M1 0x02
3010 #define _ECCP2CON_CCP2M2 0x04
3011 #define _ECCP2CON_CCP2M3 0x08
3012 #define _ECCP2CON_DC2B0 0x10
3013 #define _ECCP2CON_CCP2Y 0x10
3014 #define _ECCP2CON_DC2B1 0x20
3015 #define _ECCP2CON_CCP2X 0x20
3016 #define _ECCP2CON_P2M0 0x40
3017 #define _ECCP2CON_P2M1 0x80
3019 //==============================================================================
3021 extern __at(0x0FB5) __sfr CCPR2;
3022 extern __at(0x0FB5) __sfr CCPR2L;
3023 extern __at(0x0FB6) __sfr CCPR2H;
3025 //==============================================================================
3026 // ECCP2DEL Bits
3028 extern __at(0x0FB7) __sfr ECCP2DEL;
3030 typedef union
3032 struct
3034 unsigned P2DC0 : 1;
3035 unsigned P2DC1 : 1;
3036 unsigned P2DC2 : 1;
3037 unsigned P2DC3 : 1;
3038 unsigned P2DC4 : 1;
3039 unsigned P2DC5 : 1;
3040 unsigned P2DC6 : 1;
3041 unsigned P2RSEN : 1;
3044 struct
3046 unsigned P2DC : 7;
3047 unsigned : 1;
3049 } __ECCP2DELbits_t;
3051 extern __at(0x0FB7) volatile __ECCP2DELbits_t ECCP2DELbits;
3053 #define _P2DC0 0x01
3054 #define _P2DC1 0x02
3055 #define _P2DC2 0x04
3056 #define _P2DC3 0x08
3057 #define _P2DC4 0x10
3058 #define _P2DC5 0x20
3059 #define _P2DC6 0x40
3060 #define _P2RSEN 0x80
3062 //==============================================================================
3065 //==============================================================================
3066 // PWM2CON Bits
3068 extern __at(0x0FB7) __sfr PWM2CON;
3070 typedef union
3072 struct
3074 unsigned P2DC0 : 1;
3075 unsigned P2DC1 : 1;
3076 unsigned P2DC2 : 1;
3077 unsigned P2DC3 : 1;
3078 unsigned P2DC4 : 1;
3079 unsigned P2DC5 : 1;
3080 unsigned P2DC6 : 1;
3081 unsigned P2RSEN : 1;
3084 struct
3086 unsigned P2DC : 7;
3087 unsigned : 1;
3089 } __PWM2CONbits_t;
3091 extern __at(0x0FB7) volatile __PWM2CONbits_t PWM2CONbits;
3093 #define _PWM2CON_P2DC0 0x01
3094 #define _PWM2CON_P2DC1 0x02
3095 #define _PWM2CON_P2DC2 0x04
3096 #define _PWM2CON_P2DC3 0x08
3097 #define _PWM2CON_P2DC4 0x10
3098 #define _PWM2CON_P2DC5 0x20
3099 #define _PWM2CON_P2DC6 0x40
3100 #define _PWM2CON_P2RSEN 0x80
3102 //==============================================================================
3105 //==============================================================================
3106 // ECCP2AS Bits
3108 extern __at(0x0FB8) __sfr ECCP2AS;
3110 typedef union
3112 struct
3114 unsigned PSS2BD0 : 1;
3115 unsigned PSS2BD1 : 1;
3116 unsigned PSS2AC0 : 1;
3117 unsigned PSS2AC1 : 1;
3118 unsigned ECCP2AS0 : 1;
3119 unsigned ECCP2AS1 : 1;
3120 unsigned ECCP2AS2 : 1;
3121 unsigned ECCP2ASE : 1;
3124 struct
3126 unsigned PSS2BD : 2;
3127 unsigned : 6;
3130 struct
3132 unsigned : 2;
3133 unsigned PSS2AC : 2;
3134 unsigned : 4;
3137 struct
3139 unsigned : 4;
3140 unsigned ECCP2AS : 3;
3141 unsigned : 1;
3143 } __ECCP2ASbits_t;
3145 extern __at(0x0FB8) volatile __ECCP2ASbits_t ECCP2ASbits;
3147 #define _PSS2BD0 0x01
3148 #define _PSS2BD1 0x02
3149 #define _PSS2AC0 0x04
3150 #define _PSS2AC1 0x08
3151 #define _ECCP2AS0 0x10
3152 #define _ECCP2AS1 0x20
3153 #define _ECCP2AS2 0x40
3154 #define _ECCP2ASE 0x80
3156 //==============================================================================
3159 //==============================================================================
3160 // PSTR2CON Bits
3162 extern __at(0x0FB9) __sfr PSTR2CON;
3164 typedef union
3166 struct
3168 unsigned STRA : 1;
3169 unsigned STRB : 1;
3170 unsigned STRC : 1;
3171 unsigned STRD : 1;
3172 unsigned STRSYNC : 1;
3173 unsigned P2DC5 : 1;
3174 unsigned CMPL0 : 1;
3175 unsigned CMPL1 : 1;
3178 struct
3180 unsigned P2DC0 : 1;
3181 unsigned P2DC1 : 1;
3182 unsigned P2DC2 : 1;
3183 unsigned P2DC3 : 1;
3184 unsigned P2DC4 : 1;
3185 unsigned : 1;
3186 unsigned P2DC6 : 1;
3187 unsigned : 1;
3190 struct
3192 unsigned P2DC : 7;
3193 unsigned : 1;
3196 struct
3198 unsigned : 6;
3199 unsigned CMPL : 2;
3201 } __PSTR2CONbits_t;
3203 extern __at(0x0FB9) volatile __PSTR2CONbits_t PSTR2CONbits;
3205 #define _PSTR2CON_STRA 0x01
3206 #define _PSTR2CON_P2DC0 0x01
3207 #define _PSTR2CON_STRB 0x02
3208 #define _PSTR2CON_P2DC1 0x02
3209 #define _PSTR2CON_STRC 0x04
3210 #define _PSTR2CON_P2DC2 0x04
3211 #define _PSTR2CON_STRD 0x08
3212 #define _PSTR2CON_P2DC3 0x08
3213 #define _PSTR2CON_STRSYNC 0x10
3214 #define _PSTR2CON_P2DC4 0x10
3215 #define _PSTR2CON_P2DC5 0x20
3216 #define _PSTR2CON_CMPL0 0x40
3217 #define _PSTR2CON_P2DC6 0x40
3218 #define _PSTR2CON_CMPL1 0x80
3220 //==============================================================================
3223 //==============================================================================
3224 // CCP1CON Bits
3226 extern __at(0x0FBA) __sfr CCP1CON;
3228 typedef union
3230 struct
3232 unsigned CCP1M0 : 1;
3233 unsigned CCP1M1 : 1;
3234 unsigned CCP1M2 : 1;
3235 unsigned CCP1M3 : 1;
3236 unsigned DC1B0 : 1;
3237 unsigned DC1B1 : 1;
3238 unsigned P1M0 : 1;
3239 unsigned P1M1 : 1;
3242 struct
3244 unsigned : 1;
3245 unsigned : 1;
3246 unsigned : 1;
3247 unsigned : 1;
3248 unsigned CCP1Y : 1;
3249 unsigned CCP1X : 1;
3250 unsigned : 1;
3251 unsigned : 1;
3254 struct
3256 unsigned CCP1M : 4;
3257 unsigned : 4;
3260 struct
3262 unsigned : 4;
3263 unsigned DC1B : 2;
3264 unsigned : 2;
3267 struct
3269 unsigned : 6;
3270 unsigned P1M : 2;
3272 } __CCP1CONbits_t;
3274 extern __at(0x0FBA) volatile __CCP1CONbits_t CCP1CONbits;
3276 #define _CCP1M0 0x01
3277 #define _CCP1M1 0x02
3278 #define _CCP1M2 0x04
3279 #define _CCP1M3 0x08
3280 #define _DC1B0 0x10
3281 #define _CCP1Y 0x10
3282 #define _DC1B1 0x20
3283 #define _CCP1X 0x20
3284 #define _P1M0 0x40
3285 #define _P1M1 0x80
3287 //==============================================================================
3290 //==============================================================================
3291 // ECCP1CON Bits
3293 extern __at(0x0FBA) __sfr ECCP1CON;
3295 typedef union
3297 struct
3299 unsigned CCP1M0 : 1;
3300 unsigned CCP1M1 : 1;
3301 unsigned CCP1M2 : 1;
3302 unsigned CCP1M3 : 1;
3303 unsigned DC1B0 : 1;
3304 unsigned DC1B1 : 1;
3305 unsigned P1M0 : 1;
3306 unsigned P1M1 : 1;
3309 struct
3311 unsigned : 1;
3312 unsigned : 1;
3313 unsigned : 1;
3314 unsigned : 1;
3315 unsigned CCP1Y : 1;
3316 unsigned CCP1X : 1;
3317 unsigned : 1;
3318 unsigned : 1;
3321 struct
3323 unsigned CCP1M : 4;
3324 unsigned : 4;
3327 struct
3329 unsigned : 4;
3330 unsigned DC1B : 2;
3331 unsigned : 2;
3334 struct
3336 unsigned : 6;
3337 unsigned P1M : 2;
3339 } __ECCP1CONbits_t;
3341 extern __at(0x0FBA) volatile __ECCP1CONbits_t ECCP1CONbits;
3343 #define _ECCP1CON_CCP1M0 0x01
3344 #define _ECCP1CON_CCP1M1 0x02
3345 #define _ECCP1CON_CCP1M2 0x04
3346 #define _ECCP1CON_CCP1M3 0x08
3347 #define _ECCP1CON_DC1B0 0x10
3348 #define _ECCP1CON_CCP1Y 0x10
3349 #define _ECCP1CON_DC1B1 0x20
3350 #define _ECCP1CON_CCP1X 0x20
3351 #define _ECCP1CON_P1M0 0x40
3352 #define _ECCP1CON_P1M1 0x80
3354 //==============================================================================
3356 extern __at(0x0FBB) __sfr CCPR1;
3357 extern __at(0x0FBB) __sfr CCPR1L;
3358 extern __at(0x0FBC) __sfr CCPR1H;
3360 //==============================================================================
3361 // ECCP1DEL Bits
3363 extern __at(0x0FBD) __sfr ECCP1DEL;
3365 typedef union
3367 struct
3369 unsigned P1DC0 : 1;
3370 unsigned P1DC1 : 1;
3371 unsigned P1DC2 : 1;
3372 unsigned P1DC3 : 1;
3373 unsigned P1DC4 : 1;
3374 unsigned P1DC5 : 1;
3375 unsigned P1DC6 : 1;
3376 unsigned P1RSEN : 1;
3379 struct
3381 unsigned P1DC : 7;
3382 unsigned : 1;
3384 } __ECCP1DELbits_t;
3386 extern __at(0x0FBD) volatile __ECCP1DELbits_t ECCP1DELbits;
3388 #define _P1DC0 0x01
3389 #define _P1DC1 0x02
3390 #define _P1DC2 0x04
3391 #define _P1DC3 0x08
3392 #define _P1DC4 0x10
3393 #define _P1DC5 0x20
3394 #define _P1DC6 0x40
3395 #define _P1RSEN 0x80
3397 //==============================================================================
3400 //==============================================================================
3401 // PWM1CON Bits
3403 extern __at(0x0FBD) __sfr PWM1CON;
3405 typedef union
3407 struct
3409 unsigned P1DC0 : 1;
3410 unsigned P1DC1 : 1;
3411 unsigned P1DC2 : 1;
3412 unsigned P1DC3 : 1;
3413 unsigned P1DC4 : 1;
3414 unsigned P1DC5 : 1;
3415 unsigned P1DC6 : 1;
3416 unsigned P1RSEN : 1;
3419 struct
3421 unsigned P1DC : 7;
3422 unsigned : 1;
3424 } __PWM1CONbits_t;
3426 extern __at(0x0FBD) volatile __PWM1CONbits_t PWM1CONbits;
3428 #define _PWM1CON_P1DC0 0x01
3429 #define _PWM1CON_P1DC1 0x02
3430 #define _PWM1CON_P1DC2 0x04
3431 #define _PWM1CON_P1DC3 0x08
3432 #define _PWM1CON_P1DC4 0x10
3433 #define _PWM1CON_P1DC5 0x20
3434 #define _PWM1CON_P1DC6 0x40
3435 #define _PWM1CON_P1RSEN 0x80
3437 //==============================================================================
3440 //==============================================================================
3441 // ECCP1AS Bits
3443 extern __at(0x0FBE) __sfr ECCP1AS;
3445 typedef union
3447 struct
3449 unsigned PSS1BD0 : 1;
3450 unsigned PSS1BD1 : 1;
3451 unsigned PSS1AC0 : 1;
3452 unsigned PSS1AC1 : 1;
3453 unsigned ECCP1AS0 : 1;
3454 unsigned ECCP1AS1 : 1;
3455 unsigned ECCP1AS2 : 1;
3456 unsigned ECCP1ASE : 1;
3459 struct
3461 unsigned PSS1BD : 2;
3462 unsigned : 6;
3465 struct
3467 unsigned : 2;
3468 unsigned PSS1AC : 2;
3469 unsigned : 4;
3472 struct
3474 unsigned : 4;
3475 unsigned ECCP1AS : 3;
3476 unsigned : 1;
3478 } __ECCP1ASbits_t;
3480 extern __at(0x0FBE) volatile __ECCP1ASbits_t ECCP1ASbits;
3482 #define _PSS1BD0 0x01
3483 #define _PSS1BD1 0x02
3484 #define _PSS1AC0 0x04
3485 #define _PSS1AC1 0x08
3486 #define _ECCP1AS0 0x10
3487 #define _ECCP1AS1 0x20
3488 #define _ECCP1AS2 0x40
3489 #define _ECCP1ASE 0x80
3491 //==============================================================================
3494 //==============================================================================
3495 // PSTR1CON Bits
3497 extern __at(0x0FBF) __sfr PSTR1CON;
3499 typedef union
3501 struct
3503 unsigned STRA : 1;
3504 unsigned STRB : 1;
3505 unsigned STRC : 1;
3506 unsigned STRD : 1;
3507 unsigned STRSYNC : 1;
3508 unsigned : 1;
3509 unsigned CMPL0 : 1;
3510 unsigned CMPL1 : 1;
3513 struct
3515 unsigned : 6;
3516 unsigned CMPL : 2;
3518 } __PSTR1CONbits_t;
3520 extern __at(0x0FBF) volatile __PSTR1CONbits_t PSTR1CONbits;
3522 #define _STRA 0x01
3523 #define _STRB 0x02
3524 #define _STRC 0x04
3525 #define _STRD 0x08
3526 #define _STRSYNC 0x10
3527 #define _CMPL0 0x40
3528 #define _CMPL1 0x80
3530 //==============================================================================
3533 //==============================================================================
3534 // WDTCON Bits
3536 extern __at(0x0FC0) __sfr WDTCON;
3538 typedef union
3540 struct
3542 unsigned SWDTEN : 1;
3543 unsigned ULPSINK : 1;
3544 unsigned ULPEN : 1;
3545 unsigned DS : 1;
3546 unsigned : 1;
3547 unsigned ULPLVL : 1;
3548 unsigned LVDSTAT : 1;
3549 unsigned REGSLP : 1;
3552 struct
3554 unsigned SWDTE : 1;
3555 unsigned : 1;
3556 unsigned : 1;
3557 unsigned : 1;
3558 unsigned : 1;
3559 unsigned : 1;
3560 unsigned : 1;
3561 unsigned : 1;
3563 } __WDTCONbits_t;
3565 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
3567 #define _SWDTEN 0x01
3568 #define _SWDTE 0x01
3569 #define _ULPSINK 0x02
3570 #define _ULPEN 0x04
3571 #define _DS 0x08
3572 #define _ULPLVL 0x20
3573 #define _LVDSTAT 0x40
3574 #define _REGSLP 0x80
3576 //==============================================================================
3579 //==============================================================================
3580 // ADCON1 Bits
3582 extern __at(0x0FC1) __sfr ADCON1;
3584 typedef union
3586 struct
3588 unsigned ADCS0 : 1;
3589 unsigned ADCS1 : 1;
3590 unsigned ADCS2 : 1;
3591 unsigned ACQT0 : 1;
3592 unsigned ACQT1 : 1;
3593 unsigned ACQT2 : 1;
3594 unsigned ADCAL : 1;
3595 unsigned ADFM : 1;
3598 struct
3600 unsigned ADCS : 3;
3601 unsigned : 5;
3604 struct
3606 unsigned : 3;
3607 unsigned ACQT : 3;
3608 unsigned : 2;
3610 } __ADCON1bits_t;
3612 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
3614 #define _ADCS0 0x01
3615 #define _ADCS1 0x02
3616 #define _ADCS2 0x04
3617 #define _ACQT0 0x08
3618 #define _ACQT1 0x10
3619 #define _ACQT2 0x20
3620 #define _ADCAL 0x40
3621 #define _ADFM 0x80
3623 //==============================================================================
3626 //==============================================================================
3627 // ADCON0 Bits
3629 extern __at(0x0FC2) __sfr ADCON0;
3631 typedef union
3633 struct
3635 unsigned ADON : 1;
3636 unsigned GO_NOT_DONE : 1;
3637 unsigned CHS0 : 1;
3638 unsigned CHS1 : 1;
3639 unsigned CHS2 : 1;
3640 unsigned CHS3 : 1;
3641 unsigned VCFG0 : 1;
3642 unsigned VCFG1 : 1;
3645 struct
3647 unsigned : 1;
3648 unsigned GO_DONE : 1;
3649 unsigned : 1;
3650 unsigned : 1;
3651 unsigned : 1;
3652 unsigned : 1;
3653 unsigned : 1;
3654 unsigned : 1;
3657 struct
3659 unsigned : 1;
3660 unsigned DONE : 1;
3661 unsigned : 1;
3662 unsigned : 1;
3663 unsigned : 1;
3664 unsigned : 1;
3665 unsigned : 1;
3666 unsigned : 1;
3669 struct
3671 unsigned : 1;
3672 unsigned GO : 1;
3673 unsigned : 1;
3674 unsigned : 1;
3675 unsigned : 1;
3676 unsigned : 1;
3677 unsigned : 1;
3678 unsigned : 1;
3681 struct
3683 unsigned : 1;
3684 unsigned NOT_DONE : 1;
3685 unsigned : 1;
3686 unsigned : 1;
3687 unsigned : 1;
3688 unsigned : 1;
3689 unsigned : 1;
3690 unsigned : 1;
3693 struct
3695 unsigned : 2;
3696 unsigned CHS : 4;
3697 unsigned : 2;
3700 struct
3702 unsigned : 6;
3703 unsigned VCFG : 2;
3705 } __ADCON0bits_t;
3707 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
3709 #define _ADON 0x01
3710 #define _GO_NOT_DONE 0x02
3711 #define _GO_DONE 0x02
3712 #define _DONE 0x02
3713 #define _GO 0x02
3714 #define _NOT_DONE 0x02
3715 #define _CHS0 0x04
3716 #define _CHS1 0x08
3717 #define _CHS2 0x10
3718 #define _CHS3 0x20
3719 #define _VCFG0 0x40
3720 #define _VCFG1 0x80
3722 //==============================================================================
3724 extern __at(0x0FC3) __sfr ADRES;
3725 extern __at(0x0FC3) __sfr ADRESL;
3726 extern __at(0x0FC4) __sfr ADRESH;
3728 //==============================================================================
3729 // SSP1CON2 Bits
3731 extern __at(0x0FC5) __sfr SSP1CON2;
3733 typedef union
3735 struct
3737 unsigned SEN : 1;
3738 unsigned RSEN : 1;
3739 unsigned PEN : 1;
3740 unsigned RCEN : 1;
3741 unsigned ACKEN : 1;
3742 unsigned ACKDT : 1;
3743 unsigned ACKSTAT : 1;
3744 unsigned GCEN : 1;
3747 struct
3749 unsigned : 1;
3750 unsigned ADMSK1 : 1;
3751 unsigned ADMSK2 : 1;
3752 unsigned ADMSK3 : 1;
3753 unsigned ADMSK4 : 1;
3754 unsigned ADMSK5 : 1;
3755 unsigned : 1;
3756 unsigned : 1;
3758 } __SSP1CON2bits_t;
3760 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
3762 #define _SEN 0x01
3763 #define _RSEN 0x02
3764 #define _ADMSK1 0x02
3765 #define _PEN 0x04
3766 #define _ADMSK2 0x04
3767 #define _RCEN 0x08
3768 #define _ADMSK3 0x08
3769 #define _ACKEN 0x10
3770 #define _ADMSK4 0x10
3771 #define _ACKDT 0x20
3772 #define _ADMSK5 0x20
3773 #define _ACKSTAT 0x40
3774 #define _GCEN 0x80
3776 //==============================================================================
3779 //==============================================================================
3780 // SSPCON2 Bits
3782 extern __at(0x0FC5) __sfr SSPCON2;
3784 typedef union
3786 struct
3788 unsigned SEN : 1;
3789 unsigned RSEN : 1;
3790 unsigned PEN : 1;
3791 unsigned RCEN : 1;
3792 unsigned ACKEN : 1;
3793 unsigned ACKDT : 1;
3794 unsigned ACKSTAT : 1;
3795 unsigned GCEN : 1;
3798 struct
3800 unsigned : 1;
3801 unsigned ADMSK1 : 1;
3802 unsigned ADMSK2 : 1;
3803 unsigned ADMSK3 : 1;
3804 unsigned ADMSK4 : 1;
3805 unsigned ADMSK5 : 1;
3806 unsigned : 1;
3807 unsigned : 1;
3809 } __SSPCON2bits_t;
3811 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
3813 #define _SSPCON2_SEN 0x01
3814 #define _SSPCON2_RSEN 0x02
3815 #define _SSPCON2_ADMSK1 0x02
3816 #define _SSPCON2_PEN 0x04
3817 #define _SSPCON2_ADMSK2 0x04
3818 #define _SSPCON2_RCEN 0x08
3819 #define _SSPCON2_ADMSK3 0x08
3820 #define _SSPCON2_ACKEN 0x10
3821 #define _SSPCON2_ADMSK4 0x10
3822 #define _SSPCON2_ACKDT 0x20
3823 #define _SSPCON2_ADMSK5 0x20
3824 #define _SSPCON2_ACKSTAT 0x40
3825 #define _SSPCON2_GCEN 0x80
3827 //==============================================================================
3830 //==============================================================================
3831 // SSP1CON1 Bits
3833 extern __at(0x0FC6) __sfr SSP1CON1;
3835 typedef union
3837 struct
3839 unsigned SSPM0 : 1;
3840 unsigned SSPM1 : 1;
3841 unsigned SSPM2 : 1;
3842 unsigned SSPM3 : 1;
3843 unsigned CKP : 1;
3844 unsigned SSPEN : 1;
3845 unsigned SSPOV : 1;
3846 unsigned WCOL : 1;
3849 struct
3851 unsigned SSPM : 4;
3852 unsigned : 4;
3854 } __SSP1CON1bits_t;
3856 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
3858 #define _SSPM0 0x01
3859 #define _SSPM1 0x02
3860 #define _SSPM2 0x04
3861 #define _SSPM3 0x08
3862 #define _CKP 0x10
3863 #define _SSPEN 0x20
3864 #define _SSPOV 0x40
3865 #define _WCOL 0x80
3867 //==============================================================================
3870 //==============================================================================
3871 // SSPCON1 Bits
3873 extern __at(0x0FC6) __sfr SSPCON1;
3875 typedef union
3877 struct
3879 unsigned SSPM0 : 1;
3880 unsigned SSPM1 : 1;
3881 unsigned SSPM2 : 1;
3882 unsigned SSPM3 : 1;
3883 unsigned CKP : 1;
3884 unsigned SSPEN : 1;
3885 unsigned SSPOV : 1;
3886 unsigned WCOL : 1;
3889 struct
3891 unsigned SSPM : 4;
3892 unsigned : 4;
3894 } __SSPCON1bits_t;
3896 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
3898 #define _SSPCON1_SSPM0 0x01
3899 #define _SSPCON1_SSPM1 0x02
3900 #define _SSPCON1_SSPM2 0x04
3901 #define _SSPCON1_SSPM3 0x08
3902 #define _SSPCON1_CKP 0x10
3903 #define _SSPCON1_SSPEN 0x20
3904 #define _SSPCON1_SSPOV 0x40
3905 #define _SSPCON1_WCOL 0x80
3907 //==============================================================================
3910 //==============================================================================
3911 // SSP1STAT Bits
3913 extern __at(0x0FC7) __sfr SSP1STAT;
3915 typedef union
3917 struct
3919 unsigned BF : 1;
3920 unsigned UA : 1;
3921 unsigned R_NOT_W : 1;
3922 unsigned S : 1;
3923 unsigned P : 1;
3924 unsigned D_NOT_A : 1;
3925 unsigned CKE : 1;
3926 unsigned SMP : 1;
3929 struct
3931 unsigned : 1;
3932 unsigned : 1;
3933 unsigned R : 1;
3934 unsigned I2C_START : 1;
3935 unsigned I2C_STOP : 1;
3936 unsigned D : 1;
3937 unsigned : 1;
3938 unsigned : 1;
3941 struct
3943 unsigned : 1;
3944 unsigned : 1;
3945 unsigned R_W : 1;
3946 unsigned : 1;
3947 unsigned : 1;
3948 unsigned D_A : 1;
3949 unsigned : 1;
3950 unsigned : 1;
3953 struct
3955 unsigned : 1;
3956 unsigned : 1;
3957 unsigned NOT_W : 1;
3958 unsigned : 1;
3959 unsigned : 1;
3960 unsigned NOT_A : 1;
3961 unsigned : 1;
3962 unsigned : 1;
3965 struct
3967 unsigned : 1;
3968 unsigned : 1;
3969 unsigned NOT_WRITE : 1;
3970 unsigned : 1;
3971 unsigned : 1;
3972 unsigned NOT_ADDRESS : 1;
3973 unsigned : 1;
3974 unsigned : 1;
3977 struct
3979 unsigned : 1;
3980 unsigned : 1;
3981 unsigned READ_WRITE : 1;
3982 unsigned : 1;
3983 unsigned : 1;
3984 unsigned DATA_ADDRESS : 1;
3985 unsigned : 1;
3986 unsigned : 1;
3989 struct
3991 unsigned : 1;
3992 unsigned : 1;
3993 unsigned I2C_READ : 1;
3994 unsigned : 1;
3995 unsigned : 1;
3996 unsigned I2C_DAT : 1;
3997 unsigned : 1;
3998 unsigned : 1;
4000 } __SSP1STATbits_t;
4002 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4004 #define _BF 0x01
4005 #define _UA 0x02
4006 #define _R_NOT_W 0x04
4007 #define _R 0x04
4008 #define _R_W 0x04
4009 #define _NOT_W 0x04
4010 #define _NOT_WRITE 0x04
4011 #define _READ_WRITE 0x04
4012 #define _I2C_READ 0x04
4013 #define _S 0x08
4014 #define _I2C_START 0x08
4015 #define _P 0x10
4016 #define _I2C_STOP 0x10
4017 #define _D_NOT_A 0x20
4018 #define _D 0x20
4019 #define _D_A 0x20
4020 #define _NOT_A 0x20
4021 #define _NOT_ADDRESS 0x20
4022 #define _DATA_ADDRESS 0x20
4023 #define _I2C_DAT 0x20
4024 #define _CKE 0x40
4025 #define _SMP 0x80
4027 //==============================================================================
4030 //==============================================================================
4031 // SSPSTAT Bits
4033 extern __at(0x0FC7) __sfr SSPSTAT;
4035 typedef union
4037 struct
4039 unsigned BF : 1;
4040 unsigned UA : 1;
4041 unsigned R_NOT_W : 1;
4042 unsigned S : 1;
4043 unsigned P : 1;
4044 unsigned D_NOT_A : 1;
4045 unsigned CKE : 1;
4046 unsigned SMP : 1;
4049 struct
4051 unsigned : 1;
4052 unsigned : 1;
4053 unsigned R : 1;
4054 unsigned I2C_START : 1;
4055 unsigned I2C_STOP : 1;
4056 unsigned D : 1;
4057 unsigned : 1;
4058 unsigned : 1;
4061 struct
4063 unsigned : 1;
4064 unsigned : 1;
4065 unsigned R_W : 1;
4066 unsigned : 1;
4067 unsigned : 1;
4068 unsigned D_A : 1;
4069 unsigned : 1;
4070 unsigned : 1;
4073 struct
4075 unsigned : 1;
4076 unsigned : 1;
4077 unsigned NOT_W : 1;
4078 unsigned : 1;
4079 unsigned : 1;
4080 unsigned NOT_A : 1;
4081 unsigned : 1;
4082 unsigned : 1;
4085 struct
4087 unsigned : 1;
4088 unsigned : 1;
4089 unsigned NOT_WRITE : 1;
4090 unsigned : 1;
4091 unsigned : 1;
4092 unsigned NOT_ADDRESS : 1;
4093 unsigned : 1;
4094 unsigned : 1;
4097 struct
4099 unsigned : 1;
4100 unsigned : 1;
4101 unsigned READ_WRITE : 1;
4102 unsigned : 1;
4103 unsigned : 1;
4104 unsigned DATA_ADDRESS : 1;
4105 unsigned : 1;
4106 unsigned : 1;
4109 struct
4111 unsigned : 1;
4112 unsigned : 1;
4113 unsigned I2C_READ : 1;
4114 unsigned : 1;
4115 unsigned : 1;
4116 unsigned I2C_DAT : 1;
4117 unsigned : 1;
4118 unsigned : 1;
4120 } __SSPSTATbits_t;
4122 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
4124 #define _SSPSTAT_BF 0x01
4125 #define _SSPSTAT_UA 0x02
4126 #define _SSPSTAT_R_NOT_W 0x04
4127 #define _SSPSTAT_R 0x04
4128 #define _SSPSTAT_R_W 0x04
4129 #define _SSPSTAT_NOT_W 0x04
4130 #define _SSPSTAT_NOT_WRITE 0x04
4131 #define _SSPSTAT_READ_WRITE 0x04
4132 #define _SSPSTAT_I2C_READ 0x04
4133 #define _SSPSTAT_S 0x08
4134 #define _SSPSTAT_I2C_START 0x08
4135 #define _SSPSTAT_P 0x10
4136 #define _SSPSTAT_I2C_STOP 0x10
4137 #define _SSPSTAT_D_NOT_A 0x20
4138 #define _SSPSTAT_D 0x20
4139 #define _SSPSTAT_D_A 0x20
4140 #define _SSPSTAT_NOT_A 0x20
4141 #define _SSPSTAT_NOT_ADDRESS 0x20
4142 #define _SSPSTAT_DATA_ADDRESS 0x20
4143 #define _SSPSTAT_I2C_DAT 0x20
4144 #define _SSPSTAT_CKE 0x40
4145 #define _SSPSTAT_SMP 0x80
4147 //==============================================================================
4150 //==============================================================================
4151 // SSP1ADD Bits
4153 extern __at(0x0FC8) __sfr SSP1ADD;
4155 typedef struct
4157 unsigned MSK0 : 1;
4158 unsigned MSK1 : 1;
4159 unsigned MSK2 : 1;
4160 unsigned MSK3 : 1;
4161 unsigned MSK4 : 1;
4162 unsigned MSK5 : 1;
4163 unsigned MSK6 : 1;
4164 unsigned MSK7 : 1;
4165 } __SSP1ADDbits_t;
4167 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
4169 #define _MSK0 0x01
4170 #define _MSK1 0x02
4171 #define _MSK2 0x04
4172 #define _MSK3 0x08
4173 #define _MSK4 0x10
4174 #define _MSK5 0x20
4175 #define _MSK6 0x40
4176 #define _MSK7 0x80
4178 //==============================================================================
4181 //==============================================================================
4182 // SSP1MSK Bits
4184 extern __at(0x0FC8) __sfr SSP1MSK;
4186 typedef struct
4188 unsigned MSK0 : 1;
4189 unsigned MSK1 : 1;
4190 unsigned MSK2 : 1;
4191 unsigned MSK3 : 1;
4192 unsigned MSK4 : 1;
4193 unsigned MSK5 : 1;
4194 unsigned MSK6 : 1;
4195 unsigned MSK7 : 1;
4196 } __SSP1MSKbits_t;
4198 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
4200 #define _SSP1MSK_MSK0 0x01
4201 #define _SSP1MSK_MSK1 0x02
4202 #define _SSP1MSK_MSK2 0x04
4203 #define _SSP1MSK_MSK3 0x08
4204 #define _SSP1MSK_MSK4 0x10
4205 #define _SSP1MSK_MSK5 0x20
4206 #define _SSP1MSK_MSK6 0x40
4207 #define _SSP1MSK_MSK7 0x80
4209 //==============================================================================
4212 //==============================================================================
4213 // SSPADD Bits
4215 extern __at(0x0FC8) __sfr SSPADD;
4217 typedef struct
4219 unsigned MSK0 : 1;
4220 unsigned MSK1 : 1;
4221 unsigned MSK2 : 1;
4222 unsigned MSK3 : 1;
4223 unsigned MSK4 : 1;
4224 unsigned MSK5 : 1;
4225 unsigned MSK6 : 1;
4226 unsigned MSK7 : 1;
4227 } __SSPADDbits_t;
4229 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
4231 #define _SSPADD_MSK0 0x01
4232 #define _SSPADD_MSK1 0x02
4233 #define _SSPADD_MSK2 0x04
4234 #define _SSPADD_MSK3 0x08
4235 #define _SSPADD_MSK4 0x10
4236 #define _SSPADD_MSK5 0x20
4237 #define _SSPADD_MSK6 0x40
4238 #define _SSPADD_MSK7 0x80
4240 //==============================================================================
4242 extern __at(0x0FC9) __sfr SSP1BUF;
4243 extern __at(0x0FC9) __sfr SSPBUF;
4245 //==============================================================================
4246 // T2CON Bits
4248 extern __at(0x0FCA) __sfr T2CON;
4250 typedef union
4252 struct
4254 unsigned T2CKPS0 : 1;
4255 unsigned T2CKPS1 : 1;
4256 unsigned TMR2ON : 1;
4257 unsigned T2OUTPS0 : 1;
4258 unsigned T2OUTPS1 : 1;
4259 unsigned T2OUTPS2 : 1;
4260 unsigned T2OUTPS3 : 1;
4261 unsigned : 1;
4264 struct
4266 unsigned T2CKPS : 2;
4267 unsigned : 6;
4270 struct
4272 unsigned : 3;
4273 unsigned T2OUTPS : 4;
4274 unsigned : 1;
4276 } __T2CONbits_t;
4278 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
4280 #define _T2CKPS0 0x01
4281 #define _T2CKPS1 0x02
4282 #define _TMR2ON 0x04
4283 #define _T2OUTPS0 0x08
4284 #define _T2OUTPS1 0x10
4285 #define _T2OUTPS2 0x20
4286 #define _T2OUTPS3 0x40
4288 //==============================================================================
4290 extern __at(0x0FCB) __sfr PR2;
4291 extern __at(0x0FCC) __sfr TMR2;
4293 //==============================================================================
4294 // T1CON Bits
4296 extern __at(0x0FCD) __sfr T1CON;
4298 typedef union
4300 struct
4302 unsigned TMR1ON : 1;
4303 unsigned RD16 : 1;
4304 unsigned T1SYNC : 1;
4305 unsigned T1OSCEN : 1;
4306 unsigned T1CKPS0 : 1;
4307 unsigned T1CKPS1 : 1;
4308 unsigned TMR1CS0 : 1;
4309 unsigned TMR1CS1 : 1;
4312 struct
4314 unsigned : 4;
4315 unsigned T1CKPS : 2;
4316 unsigned : 2;
4319 struct
4321 unsigned : 6;
4322 unsigned TMR1CS : 2;
4324 } __T1CONbits_t;
4326 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
4328 #define _TMR1ON 0x01
4329 #define _RD16 0x02
4330 #define _T1SYNC 0x04
4331 #define _T1OSCEN 0x08
4332 #define _T1CKPS0 0x10
4333 #define _T1CKPS1 0x20
4334 #define _TMR1CS0 0x40
4335 #define _TMR1CS1 0x80
4337 //==============================================================================
4339 extern __at(0x0FCE) __sfr TMR1;
4340 extern __at(0x0FCE) __sfr TMR1L;
4341 extern __at(0x0FCF) __sfr TMR1H;
4343 //==============================================================================
4344 // RCON Bits
4346 extern __at(0x0FD0) __sfr RCON;
4348 typedef union
4350 struct
4352 unsigned NOT_BOR : 1;
4353 unsigned NOT_POR : 1;
4354 unsigned NOT_PD : 1;
4355 unsigned NOT_TO : 1;
4356 unsigned NOT_RI : 1;
4357 unsigned NOT_CM : 1;
4358 unsigned : 1;
4359 unsigned IPEN : 1;
4362 struct
4364 unsigned BOR : 1;
4365 unsigned POR : 1;
4366 unsigned PD : 1;
4367 unsigned TO : 1;
4368 unsigned RI : 1;
4369 unsigned CM : 1;
4370 unsigned : 1;
4371 unsigned : 1;
4373 } __RCONbits_t;
4375 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
4377 #define _NOT_BOR 0x01
4378 #define _BOR 0x01
4379 #define _NOT_POR 0x02
4380 #define _POR 0x02
4381 #define _NOT_PD 0x04
4382 #define _PD 0x04
4383 #define _NOT_TO 0x08
4384 #define _TO 0x08
4385 #define _NOT_RI 0x10
4386 #define _RI 0x10
4387 #define _NOT_CM 0x20
4388 #define _CM 0x20
4389 #define _IPEN 0x80
4391 //==============================================================================
4394 //==============================================================================
4395 // CM2CON Bits
4397 extern __at(0x0FD1) __sfr CM2CON;
4399 typedef union
4401 struct
4403 unsigned CCH0 : 1;
4404 unsigned CCH1 : 1;
4405 unsigned CREF : 1;
4406 unsigned EVPOL0 : 1;
4407 unsigned EVPOL1 : 1;
4408 unsigned CPOL : 1;
4409 unsigned COE : 1;
4410 unsigned CON : 1;
4413 struct
4415 unsigned CCH : 2;
4416 unsigned : 6;
4419 struct
4421 unsigned : 3;
4422 unsigned EVPOL : 2;
4423 unsigned : 3;
4425 } __CM2CONbits_t;
4427 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
4429 #define _CM2CON_CCH0 0x01
4430 #define _CM2CON_CCH1 0x02
4431 #define _CM2CON_CREF 0x04
4432 #define _CM2CON_EVPOL0 0x08
4433 #define _CM2CON_EVPOL1 0x10
4434 #define _CM2CON_CPOL 0x20
4435 #define _CM2CON_COE 0x40
4436 #define _CM2CON_CON 0x80
4438 //==============================================================================
4441 //==============================================================================
4442 // CM2CON1 Bits
4444 extern __at(0x0FD1) __sfr CM2CON1;
4446 typedef union
4448 struct
4450 unsigned CCH0 : 1;
4451 unsigned CCH1 : 1;
4452 unsigned CREF : 1;
4453 unsigned EVPOL0 : 1;
4454 unsigned EVPOL1 : 1;
4455 unsigned CPOL : 1;
4456 unsigned COE : 1;
4457 unsigned CON : 1;
4460 struct
4462 unsigned CCH : 2;
4463 unsigned : 6;
4466 struct
4468 unsigned : 3;
4469 unsigned EVPOL : 2;
4470 unsigned : 3;
4472 } __CM2CON1bits_t;
4474 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
4476 #define _CM2CON1_CCH0 0x01
4477 #define _CM2CON1_CCH1 0x02
4478 #define _CM2CON1_CREF 0x04
4479 #define _CM2CON1_EVPOL0 0x08
4480 #define _CM2CON1_EVPOL1 0x10
4481 #define _CM2CON1_CPOL 0x20
4482 #define _CM2CON1_COE 0x40
4483 #define _CM2CON1_CON 0x80
4485 //==============================================================================
4488 //==============================================================================
4489 // CM1CON Bits
4491 extern __at(0x0FD2) __sfr CM1CON;
4493 typedef union
4495 struct
4497 unsigned CCH0 : 1;
4498 unsigned CCH1 : 1;
4499 unsigned CREF : 1;
4500 unsigned EVPOL0 : 1;
4501 unsigned EVPOL1 : 1;
4502 unsigned CPOL : 1;
4503 unsigned COE : 1;
4504 unsigned CON : 1;
4507 struct
4509 unsigned CCH : 2;
4510 unsigned : 6;
4513 struct
4515 unsigned : 3;
4516 unsigned EVPOL : 2;
4517 unsigned : 3;
4519 } __CM1CONbits_t;
4521 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
4523 #define _CCH0 0x01
4524 #define _CCH1 0x02
4525 #define _CREF 0x04
4526 #define _EVPOL0 0x08
4527 #define _EVPOL1 0x10
4528 #define _CPOL 0x20
4529 #define _COE 0x40
4530 #define _CON 0x80
4532 //==============================================================================
4535 //==============================================================================
4536 // CM1CON1 Bits
4538 extern __at(0x0FD2) __sfr CM1CON1;
4540 typedef union
4542 struct
4544 unsigned CCH0 : 1;
4545 unsigned CCH1 : 1;
4546 unsigned CREF : 1;
4547 unsigned EVPOL0 : 1;
4548 unsigned EVPOL1 : 1;
4549 unsigned CPOL : 1;
4550 unsigned COE : 1;
4551 unsigned CON : 1;
4554 struct
4556 unsigned CCH : 2;
4557 unsigned : 6;
4560 struct
4562 unsigned : 3;
4563 unsigned EVPOL : 2;
4564 unsigned : 3;
4566 } __CM1CON1bits_t;
4568 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
4570 #define _CM1CON1_CCH0 0x01
4571 #define _CM1CON1_CCH1 0x02
4572 #define _CM1CON1_CREF 0x04
4573 #define _CM1CON1_EVPOL0 0x08
4574 #define _CM1CON1_EVPOL1 0x10
4575 #define _CM1CON1_CPOL 0x20
4576 #define _CM1CON1_COE 0x40
4577 #define _CM1CON1_CON 0x80
4579 //==============================================================================
4582 //==============================================================================
4583 // OSCCON Bits
4585 extern __at(0x0FD3) __sfr OSCCON;
4587 typedef union
4589 struct
4591 unsigned SCS0 : 1;
4592 unsigned SCS1 : 1;
4593 unsigned : 1;
4594 unsigned OSTS : 1;
4595 unsigned IRCF0 : 1;
4596 unsigned IRCF1 : 1;
4597 unsigned IRCF2 : 1;
4598 unsigned IDLEN : 1;
4601 struct
4603 unsigned SCS : 2;
4604 unsigned : 6;
4607 struct
4609 unsigned : 4;
4610 unsigned IRCF : 3;
4611 unsigned : 1;
4613 } __OSCCONbits_t;
4615 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
4617 #define _SCS0 0x01
4618 #define _SCS1 0x02
4619 #define _OSTS 0x08
4620 #define _IRCF0 0x10
4621 #define _IRCF1 0x20
4622 #define _IRCF2 0x40
4623 #define _IDLEN 0x80
4625 //==============================================================================
4628 //==============================================================================
4629 // T0CON Bits
4631 extern __at(0x0FD5) __sfr T0CON;
4633 typedef union
4635 struct
4637 unsigned T0PS0 : 1;
4638 unsigned T0PS1 : 1;
4639 unsigned T0PS2 : 1;
4640 unsigned PSA : 1;
4641 unsigned T0SE : 1;
4642 unsigned T0CS : 1;
4643 unsigned T08BIT : 1;
4644 unsigned TMR0ON : 1;
4647 struct
4649 unsigned T0PS : 3;
4650 unsigned : 5;
4652 } __T0CONbits_t;
4654 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
4656 #define _T0PS0 0x01
4657 #define _T0PS1 0x02
4658 #define _T0PS2 0x04
4659 #define _PSA 0x08
4660 #define _T0SE 0x10
4661 #define _T0CS 0x20
4662 #define _T08BIT 0x40
4663 #define _TMR0ON 0x80
4665 //==============================================================================
4667 extern __at(0x0FD6) __sfr TMR0;
4668 extern __at(0x0FD6) __sfr TMR0L;
4669 extern __at(0x0FD7) __sfr TMR0H;
4671 //==============================================================================
4672 // STATUS Bits
4674 extern __at(0x0FD8) __sfr STATUS;
4676 typedef struct
4678 unsigned C : 1;
4679 unsigned DC : 1;
4680 unsigned Z : 1;
4681 unsigned OV : 1;
4682 unsigned N : 1;
4683 unsigned : 1;
4684 unsigned : 1;
4685 unsigned : 1;
4686 } __STATUSbits_t;
4688 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
4690 #define _C 0x01
4691 #define _DC 0x02
4692 #define _Z 0x04
4693 #define _OV 0x08
4694 #define _N 0x10
4696 //==============================================================================
4698 extern __at(0x0FD9) __sfr FSR2L;
4699 extern __at(0x0FDA) __sfr FSR2H;
4700 extern __at(0x0FDB) __sfr PLUSW2;
4701 extern __at(0x0FDC) __sfr PREINC2;
4702 extern __at(0x0FDD) __sfr POSTDEC2;
4703 extern __at(0x0FDE) __sfr POSTINC2;
4704 extern __at(0x0FDF) __sfr INDF2;
4705 extern __at(0x0FE0) __sfr BSR;
4706 extern __at(0x0FE1) __sfr FSR1L;
4707 extern __at(0x0FE2) __sfr FSR1H;
4708 extern __at(0x0FE3) __sfr PLUSW1;
4709 extern __at(0x0FE4) __sfr PREINC1;
4710 extern __at(0x0FE5) __sfr POSTDEC1;
4711 extern __at(0x0FE6) __sfr POSTINC1;
4712 extern __at(0x0FE7) __sfr INDF1;
4713 extern __at(0x0FE8) __sfr WREG;
4714 extern __at(0x0FE9) __sfr FSR0L;
4715 extern __at(0x0FEA) __sfr FSR0H;
4716 extern __at(0x0FEB) __sfr PLUSW0;
4717 extern __at(0x0FEC) __sfr PREINC0;
4718 extern __at(0x0FED) __sfr POSTDEC0;
4719 extern __at(0x0FEE) __sfr POSTINC0;
4720 extern __at(0x0FEF) __sfr INDF0;
4722 //==============================================================================
4723 // INTCON3 Bits
4725 extern __at(0x0FF0) __sfr INTCON3;
4727 typedef union
4729 struct
4731 unsigned INT1IF : 1;
4732 unsigned INT2IF : 1;
4733 unsigned INT3IF : 1;
4734 unsigned INT1IE : 1;
4735 unsigned INT2IE : 1;
4736 unsigned INT3IE : 1;
4737 unsigned INT1IP : 1;
4738 unsigned INT2IP : 1;
4741 struct
4743 unsigned INT1F : 1;
4744 unsigned INT2F : 1;
4745 unsigned INT3F : 1;
4746 unsigned INT1E : 1;
4747 unsigned INT2E : 1;
4748 unsigned INT3E : 1;
4749 unsigned INT1P : 1;
4750 unsigned INT2P : 1;
4752 } __INTCON3bits_t;
4754 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
4756 #define _INT1IF 0x01
4757 #define _INT1F 0x01
4758 #define _INT2IF 0x02
4759 #define _INT2F 0x02
4760 #define _INT3IF 0x04
4761 #define _INT3F 0x04
4762 #define _INT1IE 0x08
4763 #define _INT1E 0x08
4764 #define _INT2IE 0x10
4765 #define _INT2E 0x10
4766 #define _INT3IE 0x20
4767 #define _INT3E 0x20
4768 #define _INT1IP 0x40
4769 #define _INT1P 0x40
4770 #define _INT2IP 0x80
4771 #define _INT2P 0x80
4773 //==============================================================================
4776 //==============================================================================
4777 // INTCON2 Bits
4779 extern __at(0x0FF1) __sfr INTCON2;
4781 typedef union
4783 struct
4785 unsigned RBIP : 1;
4786 unsigned INT3IP : 1;
4787 unsigned TMR0IP : 1;
4788 unsigned INTEDG3 : 1;
4789 unsigned INTEDG2 : 1;
4790 unsigned INTEDG1 : 1;
4791 unsigned INTEDG0 : 1;
4792 unsigned NOT_RBPU : 1;
4795 struct
4797 unsigned : 1;
4798 unsigned INT3P : 1;
4799 unsigned T0IP : 1;
4800 unsigned : 1;
4801 unsigned : 1;
4802 unsigned : 1;
4803 unsigned : 1;
4804 unsigned RBPU : 1;
4806 } __INTCON2bits_t;
4808 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
4810 #define _RBIP 0x01
4811 #define _INT3IP 0x02
4812 #define _INT3P 0x02
4813 #define _TMR0IP 0x04
4814 #define _T0IP 0x04
4815 #define _INTEDG3 0x08
4816 #define _INTEDG2 0x10
4817 #define _INTEDG1 0x20
4818 #define _INTEDG0 0x40
4819 #define _NOT_RBPU 0x80
4820 #define _RBPU 0x80
4822 //==============================================================================
4825 //==============================================================================
4826 // INTCON Bits
4828 extern __at(0x0FF2) __sfr INTCON;
4830 typedef union
4832 struct
4834 unsigned RBIF : 1;
4835 unsigned INT0IF : 1;
4836 unsigned TMR0IF : 1;
4837 unsigned RBIE : 1;
4838 unsigned INT0IE : 1;
4839 unsigned TMR0IE : 1;
4840 unsigned PEIE_GIEL : 1;
4841 unsigned GIE_GIEH : 1;
4844 struct
4846 unsigned : 1;
4847 unsigned INT0F : 1;
4848 unsigned T0IF : 1;
4849 unsigned : 1;
4850 unsigned INT0E : 1;
4851 unsigned T0IE : 1;
4852 unsigned PEIE : 1;
4853 unsigned GIE : 1;
4856 struct
4858 unsigned : 1;
4859 unsigned : 1;
4860 unsigned : 1;
4861 unsigned : 1;
4862 unsigned : 1;
4863 unsigned : 1;
4864 unsigned GIEL : 1;
4865 unsigned GIEH : 1;
4867 } __INTCONbits_t;
4869 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
4871 #define _RBIF 0x01
4872 #define _INT0IF 0x02
4873 #define _INT0F 0x02
4874 #define _TMR0IF 0x04
4875 #define _T0IF 0x04
4876 #define _RBIE 0x08
4877 #define _INT0IE 0x10
4878 #define _INT0E 0x10
4879 #define _TMR0IE 0x20
4880 #define _T0IE 0x20
4881 #define _PEIE_GIEL 0x40
4882 #define _PEIE 0x40
4883 #define _GIEL 0x40
4884 #define _GIE_GIEH 0x80
4885 #define _GIE 0x80
4886 #define _GIEH 0x80
4888 //==============================================================================
4890 extern __at(0x0FF3) __sfr PROD;
4891 extern __at(0x0FF3) __sfr PRODL;
4892 extern __at(0x0FF4) __sfr PRODH;
4893 extern __at(0x0FF5) __sfr TABLAT;
4894 extern __at(0x0FF6) __sfr TBLPTR;
4895 extern __at(0x0FF6) __sfr TBLPTRL;
4896 extern __at(0x0FF7) __sfr TBLPTRH;
4897 extern __at(0x0FF8) __sfr TBLPTRU;
4898 extern __at(0x0FF9) __sfr PC;
4899 extern __at(0x0FF9) __sfr PCL;
4900 extern __at(0x0FFA) __sfr PCLATH;
4901 extern __at(0x0FFB) __sfr PCLATU;
4903 //==============================================================================
4904 // STKPTR Bits
4906 extern __at(0x0FFC) __sfr STKPTR;
4908 typedef union
4910 struct
4912 unsigned SP0 : 1;
4913 unsigned SP1 : 1;
4914 unsigned SP2 : 1;
4915 unsigned SP3 : 1;
4916 unsigned SP4 : 1;
4917 unsigned : 1;
4918 unsigned STKUNF : 1;
4919 unsigned STKFUL : 1;
4922 struct
4924 unsigned : 1;
4925 unsigned : 1;
4926 unsigned : 1;
4927 unsigned : 1;
4928 unsigned : 1;
4929 unsigned : 1;
4930 unsigned : 1;
4931 unsigned STKOVF : 1;
4934 struct
4936 unsigned SP : 5;
4937 unsigned : 3;
4939 } __STKPTRbits_t;
4941 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
4943 #define _SP0 0x01
4944 #define _SP1 0x02
4945 #define _SP2 0x04
4946 #define _SP3 0x08
4947 #define _SP4 0x10
4948 #define _STKUNF 0x40
4949 #define _STKFUL 0x80
4950 #define _STKOVF 0x80
4952 //==============================================================================
4954 extern __at(0x0FFD) __sfr TOS;
4955 extern __at(0x0FFD) __sfr TOSL;
4956 extern __at(0x0FFE) __sfr TOSH;
4957 extern __at(0x0FFF) __sfr TOSU;
4959 //==============================================================================
4961 // Configuration Addresses
4963 //==============================================================================
4965 #define __CONFIG1L 0x003FF8
4966 #define __CONFIG1H 0x003FF9
4967 #define __CONFIG2L 0x003FFA
4968 #define __CONFIG2H 0x003FFB
4969 #define __CONFIG3L 0x003FFC
4970 #define __CONFIG3H 0x003FFD
4971 #define __CONFIG4L 0x003FFE
4972 #define __CONFIG4H 0x003FFF
4974 //==============================================================================
4976 #endif // #ifndef __PIC18F24J11_H__