Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18lf45j11.h
bloba1729556d4e2ea49332d58e67cc8cfdc85fb438a
1 /*
2 * This declarations of the PIC18LF45J11 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:56 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 __PIC18LF45J11_H__
26 #define __PIC18LF45J11_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(0x0ED9) __sfr RPOR19;
56 extern __at(0x0EDA) __sfr RPOR20;
57 extern __at(0x0EDB) __sfr RPOR21;
58 extern __at(0x0EDC) __sfr RPOR22;
59 extern __at(0x0EDD) __sfr RPOR23;
60 extern __at(0x0EDE) __sfr RPOR24;
61 extern __at(0x0EE7) __sfr RPINR1;
62 extern __at(0x0EE8) __sfr RPINR2;
63 extern __at(0x0EE9) __sfr RPINR3;
64 extern __at(0x0EEA) __sfr RPINR4;
65 extern __at(0x0EEC) __sfr RPINR6;
66 extern __at(0x0EED) __sfr RPINR7;
67 extern __at(0x0EEE) __sfr RPINR8;
68 extern __at(0x0EF2) __sfr RPINR12;
69 extern __at(0x0EF3) __sfr RPINR13;
70 extern __at(0x0EF6) __sfr RPINR16;
71 extern __at(0x0EF7) __sfr RPINR17;
72 extern __at(0x0EFB) __sfr RPINR21;
73 extern __at(0x0EFC) __sfr RPINR22;
74 extern __at(0x0EFD) __sfr RPINR23;
75 extern __at(0x0EFE) __sfr RPINR24;
77 //==============================================================================
78 // PPSCON Bits
80 extern __at(0x0EFF) __sfr PPSCON;
82 typedef struct
84 unsigned IOLOCK : 1;
85 unsigned : 1;
86 unsigned : 1;
87 unsigned : 1;
88 unsigned : 1;
89 unsigned : 1;
90 unsigned : 1;
91 unsigned : 1;
92 } __PPSCONbits_t;
94 extern __at(0x0EFF) volatile __PPSCONbits_t PPSCONbits;
96 #define _IOLOCK 0x01
98 //==============================================================================
101 //==============================================================================
102 // PADCFG1 Bits
104 extern __at(0x0F3C) __sfr PADCFG1;
106 typedef union
108 struct
110 unsigned PMPTTL : 1;
111 unsigned RTSECSEL0 : 1;
112 unsigned RTSECSEL1 : 1;
113 unsigned : 1;
114 unsigned : 1;
115 unsigned : 1;
116 unsigned : 1;
117 unsigned : 1;
120 struct
122 unsigned : 1;
123 unsigned RTSECSEL : 2;
124 unsigned : 5;
126 } __PADCFG1bits_t;
128 extern __at(0x0F3C) volatile __PADCFG1bits_t PADCFG1bits;
130 #define _PMPTTL 0x01
131 #define _RTSECSEL0 0x02
132 #define _RTSECSEL1 0x04
134 //==============================================================================
137 //==============================================================================
138 // REFOCON Bits
140 extern __at(0x0F3D) __sfr REFOCON;
142 typedef union
144 struct
146 unsigned RODIV0 : 1;
147 unsigned RODIV1 : 1;
148 unsigned RODIV2 : 1;
149 unsigned RODIV3 : 1;
150 unsigned ROSEL : 1;
151 unsigned ROSSLP : 1;
152 unsigned : 1;
153 unsigned ROON : 1;
156 struct
158 unsigned RODIV : 4;
159 unsigned : 4;
161 } __REFOCONbits_t;
163 extern __at(0x0F3D) volatile __REFOCONbits_t REFOCONbits;
165 #define _RODIV0 0x01
166 #define _RODIV1 0x02
167 #define _RODIV2 0x04
168 #define _RODIV3 0x08
169 #define _ROSEL 0x10
170 #define _ROSSLP 0x20
171 #define _ROON 0x80
173 //==============================================================================
176 //==============================================================================
177 // RTCCAL Bits
179 extern __at(0x0F3E) __sfr RTCCAL;
181 typedef struct
183 unsigned CAL0 : 1;
184 unsigned CAL1 : 1;
185 unsigned CAL2 : 1;
186 unsigned CAL3 : 1;
187 unsigned CAL4 : 1;
188 unsigned CAL5 : 1;
189 unsigned CAL6 : 1;
190 unsigned CAL7 : 1;
191 } __RTCCALbits_t;
193 extern __at(0x0F3E) volatile __RTCCALbits_t RTCCALbits;
195 #define _CAL0 0x01
196 #define _CAL1 0x02
197 #define _CAL2 0x04
198 #define _CAL3 0x08
199 #define _CAL4 0x10
200 #define _CAL5 0x20
201 #define _CAL6 0x40
202 #define _CAL7 0x80
204 //==============================================================================
207 //==============================================================================
208 // RTCCFG Bits
210 extern __at(0x0F3F) __sfr RTCCFG;
212 typedef union
214 struct
216 unsigned RTCPTR0 : 1;
217 unsigned RTCPTR1 : 1;
218 unsigned RTCOE : 1;
219 unsigned HALFSEC : 1;
220 unsigned RTCSYNC : 1;
221 unsigned RTCWREN : 1;
222 unsigned : 1;
223 unsigned RTCEN : 1;
226 struct
228 unsigned RTCPTR : 2;
229 unsigned : 6;
231 } __RTCCFGbits_t;
233 extern __at(0x0F3F) volatile __RTCCFGbits_t RTCCFGbits;
235 #define _RTCPTR0 0x01
236 #define _RTCPTR1 0x02
237 #define _RTCOE 0x04
238 #define _HALFSEC 0x08
239 #define _RTCSYNC 0x10
240 #define _RTCWREN 0x20
241 #define _RTCEN 0x80
243 //==============================================================================
246 //==============================================================================
247 // ODCON3 Bits
249 extern __at(0x0F40) __sfr ODCON3;
251 typedef struct
253 unsigned SPI1OD : 1;
254 unsigned SPI2OD : 1;
255 unsigned : 1;
256 unsigned : 1;
257 unsigned : 1;
258 unsigned : 1;
259 unsigned : 1;
260 unsigned : 1;
261 } __ODCON3bits_t;
263 extern __at(0x0F40) volatile __ODCON3bits_t ODCON3bits;
265 #define _SPI1OD 0x01
266 #define _SPI2OD 0x02
268 //==============================================================================
271 //==============================================================================
272 // ODCON2 Bits
274 extern __at(0x0F41) __sfr ODCON2;
276 typedef struct
278 unsigned U1OD : 1;
279 unsigned U2OD : 1;
280 unsigned : 1;
281 unsigned : 1;
282 unsigned : 1;
283 unsigned : 1;
284 unsigned : 1;
285 unsigned : 1;
286 } __ODCON2bits_t;
288 extern __at(0x0F41) volatile __ODCON2bits_t ODCON2bits;
290 #define _U1OD 0x01
291 #define _U2OD 0x02
293 //==============================================================================
296 //==============================================================================
297 // ODCON1 Bits
299 extern __at(0x0F42) __sfr ODCON1;
301 typedef struct
303 unsigned ECCP1OD : 1;
304 unsigned ECCP2OD : 1;
305 unsigned : 1;
306 unsigned : 1;
307 unsigned : 1;
308 unsigned : 1;
309 unsigned : 1;
310 unsigned : 1;
311 } __ODCON1bits_t;
313 extern __at(0x0F42) volatile __ODCON1bits_t ODCON1bits;
315 #define _ECCP1OD 0x01
316 #define _ECCP2OD 0x02
318 //==============================================================================
321 //==============================================================================
322 // ANCON0 Bits
324 extern __at(0x0F48) __sfr ANCON0;
326 typedef struct
328 unsigned PCFG0 : 1;
329 unsigned PCFG1 : 1;
330 unsigned PCFG2 : 1;
331 unsigned PCFG3 : 1;
332 unsigned PCFG4 : 1;
333 unsigned PCFG5 : 1;
334 unsigned PCFG6 : 1;
335 unsigned PCFG7 : 1;
336 } __ANCON0bits_t;
338 extern __at(0x0F48) volatile __ANCON0bits_t ANCON0bits;
340 #define _PCFG0 0x01
341 #define _PCFG1 0x02
342 #define _PCFG2 0x04
343 #define _PCFG3 0x08
344 #define _PCFG4 0x10
345 #define _PCFG5 0x20
346 #define _PCFG6 0x40
347 #define _PCFG7 0x80
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 //==============================================================================
554 //==============================================================================
555 // PMSTATL Bits
557 extern __at(0x0F54) __sfr PMSTATL;
559 typedef struct
561 unsigned OB0E : 1;
562 unsigned OB1E : 1;
563 unsigned OB2E : 1;
564 unsigned OB3E : 1;
565 unsigned : 1;
566 unsigned : 1;
567 unsigned OBUF : 1;
568 unsigned OBE : 1;
569 } __PMSTATLbits_t;
571 extern __at(0x0F54) volatile __PMSTATLbits_t PMSTATLbits;
573 #define _OB0E 0x01
574 #define _OB1E 0x02
575 #define _OB2E 0x04
576 #define _OB3E 0x08
577 #define _OBUF 0x40
578 #define _OBE 0x80
580 //==============================================================================
583 //==============================================================================
584 // PMSTATH Bits
586 extern __at(0x0F55) __sfr PMSTATH;
588 typedef struct
590 unsigned IB0F : 1;
591 unsigned IB1F : 1;
592 unsigned IB2F : 1;
593 unsigned IB3F : 1;
594 unsigned : 1;
595 unsigned : 1;
596 unsigned IBOV : 1;
597 unsigned IBF : 1;
598 } __PMSTATHbits_t;
600 extern __at(0x0F55) volatile __PMSTATHbits_t PMSTATHbits;
602 #define _IB0F 0x01
603 #define _IB1F 0x02
604 #define _IB2F 0x04
605 #define _IB3F 0x08
606 #define _IBOV 0x40
607 #define _IBF 0x80
609 //==============================================================================
612 //==============================================================================
613 // PMEL Bits
615 extern __at(0x0F56) __sfr PMEL;
617 typedef struct
619 unsigned PTEN0 : 1;
620 unsigned PTEN1 : 1;
621 unsigned PTEN2 : 1;
622 unsigned PTEN3 : 1;
623 unsigned PTEN4 : 1;
624 unsigned PTEN5 : 1;
625 unsigned PTEN6 : 1;
626 unsigned PTEN7 : 1;
627 } __PMELbits_t;
629 extern __at(0x0F56) volatile __PMELbits_t PMELbits;
631 #define _PTEN0 0x01
632 #define _PTEN1 0x02
633 #define _PTEN2 0x04
634 #define _PTEN3 0x08
635 #define _PTEN4 0x10
636 #define _PTEN5 0x20
637 #define _PTEN6 0x40
638 #define _PTEN7 0x80
640 //==============================================================================
643 //==============================================================================
644 // PMEH Bits
646 extern __at(0x0F57) __sfr PMEH;
648 typedef struct
650 unsigned PTEN8 : 1;
651 unsigned PTEN9 : 1;
652 unsigned PTEN10 : 1;
653 unsigned PTEN11 : 1;
654 unsigned PTEN12 : 1;
655 unsigned PTEN13 : 1;
656 unsigned PTEN14 : 1;
657 unsigned PTEN15 : 1;
658 } __PMEHbits_t;
660 extern __at(0x0F57) volatile __PMEHbits_t PMEHbits;
662 #define _PTEN8 0x01
663 #define _PTEN9 0x02
664 #define _PTEN10 0x04
665 #define _PTEN11 0x08
666 #define _PTEN12 0x10
667 #define _PTEN13 0x20
668 #define _PTEN14 0x40
669 #define _PTEN15 0x80
671 //==============================================================================
673 extern __at(0x0F58) __sfr PMDIN2L;
674 extern __at(0x0F59) __sfr PMDIN2H;
675 extern __at(0x0F5A) __sfr PMDOUT2L;
676 extern __at(0x0F5B) __sfr PMDOUT2H;
678 //==============================================================================
679 // PMMODEL Bits
681 extern __at(0x0F5C) __sfr PMMODEL;
683 typedef union
685 struct
687 unsigned WAITE0 : 1;
688 unsigned WAITE1 : 1;
689 unsigned WAITM0 : 1;
690 unsigned WAITM1 : 1;
691 unsigned WAITM2 : 1;
692 unsigned WAITM3 : 1;
693 unsigned WAITB0 : 1;
694 unsigned WAITB1 : 1;
697 struct
699 unsigned WAITE : 2;
700 unsigned : 6;
703 struct
705 unsigned : 2;
706 unsigned WAITM : 4;
707 unsigned : 2;
710 struct
712 unsigned : 6;
713 unsigned WAITB : 2;
715 } __PMMODELbits_t;
717 extern __at(0x0F5C) volatile __PMMODELbits_t PMMODELbits;
719 #define _WAITE0 0x01
720 #define _WAITE1 0x02
721 #define _WAITM0 0x04
722 #define _WAITM1 0x08
723 #define _WAITM2 0x10
724 #define _WAITM3 0x20
725 #define _WAITB0 0x40
726 #define _WAITB1 0x80
728 //==============================================================================
731 //==============================================================================
732 // PMMODEH Bits
734 extern __at(0x0F5D) __sfr PMMODEH;
736 typedef union
738 struct
740 unsigned MODE0 : 1;
741 unsigned MODE1 : 1;
742 unsigned MODE16 : 1;
743 unsigned INCM0 : 1;
744 unsigned INCM1 : 1;
745 unsigned IRQM0 : 1;
746 unsigned IRQM1 : 1;
747 unsigned BUSY : 1;
750 struct
752 unsigned : 3;
753 unsigned INCM : 2;
754 unsigned : 3;
757 struct
759 unsigned : 5;
760 unsigned IRQM : 2;
761 unsigned : 1;
763 } __PMMODEHbits_t;
765 extern __at(0x0F5D) volatile __PMMODEHbits_t PMMODEHbits;
767 #define _MODE0 0x01
768 #define _MODE1 0x02
769 #define _MODE16 0x04
770 #define _INCM0 0x08
771 #define _INCM1 0x10
772 #define _IRQM0 0x20
773 #define _IRQM1 0x40
774 #define _BUSY 0x80
776 //==============================================================================
779 //==============================================================================
780 // PMCONL Bits
782 extern __at(0x0F5E) __sfr PMCONL;
784 typedef union
786 struct
788 unsigned RDSP : 1;
789 unsigned WRSP : 1;
790 unsigned BEP : 1;
791 unsigned CS1P : 1;
792 unsigned CS2P : 1;
793 unsigned ALP : 1;
794 unsigned CSF0 : 1;
795 unsigned CSF1 : 1;
798 struct
800 unsigned : 6;
801 unsigned CSF : 2;
803 } __PMCONLbits_t;
805 extern __at(0x0F5E) volatile __PMCONLbits_t PMCONLbits;
807 #define _RDSP 0x01
808 #define _WRSP 0x02
809 #define _BEP 0x04
810 #define _CS1P 0x08
811 #define _CS2P 0x10
812 #define _ALP 0x20
813 #define _CSF0 0x40
814 #define _CSF1 0x80
816 //==============================================================================
819 //==============================================================================
820 // PMCONH Bits
822 extern __at(0x0F5F) __sfr PMCONH;
824 typedef union
826 struct
828 unsigned PTRDEN : 1;
829 unsigned PTWREN : 1;
830 unsigned PTBEEN : 1;
831 unsigned ADRMUX0 : 1;
832 unsigned ADRMUX1 : 1;
833 unsigned PSIDL : 1;
834 unsigned : 1;
835 unsigned PMPEN : 1;
838 struct
840 unsigned : 3;
841 unsigned ADRMUX : 2;
842 unsigned : 3;
844 } __PMCONHbits_t;
846 extern __at(0x0F5F) volatile __PMCONHbits_t PMCONHbits;
848 #define _PTRDEN 0x01
849 #define _PTWREN 0x02
850 #define _PTBEEN 0x04
851 #define _ADRMUX0 0x08
852 #define _ADRMUX1 0x10
853 #define _PSIDL 0x20
854 #define _PMPEN 0x80
856 //==============================================================================
858 extern __at(0x0F66) __sfr DMABCH;
859 extern __at(0x0F67) __sfr DMABCL;
860 extern __at(0x0F68) __sfr RXADDRH;
861 extern __at(0x0F69) __sfr RXADDRL;
862 extern __at(0x0F6A) __sfr TXADDRH;
863 extern __at(0x0F6B) __sfr TXADDRL;
864 extern __at(0x0F6C) __sfr PMDIN1L;
865 extern __at(0x0F6D) __sfr PMDIN1H;
866 extern __at(0x0F6E) __sfr PMADDRL;
867 extern __at(0x0F6E) __sfr PMDOUT1L;
869 //==============================================================================
870 // PMADDRH Bits
872 extern __at(0x0F6F) __sfr PMADDRH;
874 typedef struct
876 unsigned : 1;
877 unsigned : 1;
878 unsigned : 1;
879 unsigned : 1;
880 unsigned : 1;
881 unsigned : 1;
882 unsigned CS1 : 1;
883 unsigned : 1;
884 } __PMADDRHbits_t;
886 extern __at(0x0F6F) volatile __PMADDRHbits_t PMADDRHbits;
888 #define _CS1 0x40
890 //==============================================================================
892 extern __at(0x0F6F) __sfr PMDOUT1H;
894 //==============================================================================
895 // CMSTAT Bits
897 extern __at(0x0F70) __sfr CMSTAT;
899 typedef struct
901 unsigned COUT1 : 1;
902 unsigned COUT2 : 1;
903 unsigned : 1;
904 unsigned : 1;
905 unsigned : 1;
906 unsigned : 1;
907 unsigned : 1;
908 unsigned : 1;
909 } __CMSTATbits_t;
911 extern __at(0x0F70) volatile __CMSTATbits_t CMSTATbits;
913 #define _COUT1 0x01
914 #define _COUT2 0x02
916 //==============================================================================
919 //==============================================================================
920 // CMSTATUS Bits
922 extern __at(0x0F70) __sfr CMSTATUS;
924 typedef struct
926 unsigned COUT1 : 1;
927 unsigned COUT2 : 1;
928 unsigned : 1;
929 unsigned : 1;
930 unsigned : 1;
931 unsigned : 1;
932 unsigned : 1;
933 unsigned : 1;
934 } __CMSTATUSbits_t;
936 extern __at(0x0F70) volatile __CMSTATUSbits_t CMSTATUSbits;
938 #define _CMSTATUS_COUT1 0x01
939 #define _CMSTATUS_COUT2 0x02
941 //==============================================================================
944 //==============================================================================
945 // SSP2CON2 Bits
947 extern __at(0x0F71) __sfr SSP2CON2;
949 typedef union
951 struct
953 unsigned SEN : 1;
954 unsigned RSEN : 1;
955 unsigned PEN : 1;
956 unsigned RCEN : 1;
957 unsigned ACKEN : 1;
958 unsigned ACKDT : 1;
959 unsigned ACKSTAT : 1;
960 unsigned GCEN : 1;
963 struct
965 unsigned : 1;
966 unsigned ADMSK1 : 1;
967 unsigned ADMSK2 : 1;
968 unsigned ADMSK3 : 1;
969 unsigned ADMSK4 : 1;
970 unsigned ADMSK5 : 1;
971 unsigned : 1;
972 unsigned : 1;
974 } __SSP2CON2bits_t;
976 extern __at(0x0F71) volatile __SSP2CON2bits_t SSP2CON2bits;
978 #define _SSP2CON2_SEN 0x01
979 #define _SSP2CON2_RSEN 0x02
980 #define _SSP2CON2_ADMSK1 0x02
981 #define _SSP2CON2_PEN 0x04
982 #define _SSP2CON2_ADMSK2 0x04
983 #define _SSP2CON2_RCEN 0x08
984 #define _SSP2CON2_ADMSK3 0x08
985 #define _SSP2CON2_ACKEN 0x10
986 #define _SSP2CON2_ADMSK4 0x10
987 #define _SSP2CON2_ACKDT 0x20
988 #define _SSP2CON2_ADMSK5 0x20
989 #define _SSP2CON2_ACKSTAT 0x40
990 #define _SSP2CON2_GCEN 0x80
992 //==============================================================================
995 //==============================================================================
996 // SSP2CON1 Bits
998 extern __at(0x0F72) __sfr SSP2CON1;
1000 typedef union
1002 struct
1004 unsigned SSPM0 : 1;
1005 unsigned SSPM1 : 1;
1006 unsigned SSPM2 : 1;
1007 unsigned SSPM3 : 1;
1008 unsigned CKP : 1;
1009 unsigned SSPEN : 1;
1010 unsigned SSPOV : 1;
1011 unsigned WCOL : 1;
1014 struct
1016 unsigned SSPM : 4;
1017 unsigned : 4;
1019 } __SSP2CON1bits_t;
1021 extern __at(0x0F72) volatile __SSP2CON1bits_t SSP2CON1bits;
1023 #define _SSP2CON1_SSPM0 0x01
1024 #define _SSP2CON1_SSPM1 0x02
1025 #define _SSP2CON1_SSPM2 0x04
1026 #define _SSP2CON1_SSPM3 0x08
1027 #define _SSP2CON1_CKP 0x10
1028 #define _SSP2CON1_SSPEN 0x20
1029 #define _SSP2CON1_SSPOV 0x40
1030 #define _SSP2CON1_WCOL 0x80
1032 //==============================================================================
1035 //==============================================================================
1036 // SSP2STAT Bits
1038 extern __at(0x0F73) __sfr SSP2STAT;
1040 typedef struct
1042 unsigned BF : 1;
1043 unsigned UA : 1;
1044 unsigned R_NOT_W : 1;
1045 unsigned S : 1;
1046 unsigned P : 1;
1047 unsigned D_NOT_A : 1;
1048 unsigned CKE : 1;
1049 unsigned SMP : 1;
1050 } __SSP2STATbits_t;
1052 extern __at(0x0F73) volatile __SSP2STATbits_t SSP2STATbits;
1054 #define _SSP2STAT_BF 0x01
1055 #define _SSP2STAT_UA 0x02
1056 #define _SSP2STAT_R_NOT_W 0x04
1057 #define _SSP2STAT_S 0x08
1058 #define _SSP2STAT_P 0x10
1059 #define _SSP2STAT_D_NOT_A 0x20
1060 #define _SSP2STAT_CKE 0x40
1061 #define _SSP2STAT_SMP 0x80
1063 //==============================================================================
1066 //==============================================================================
1067 // SSP2ADD Bits
1069 extern __at(0x0F74) __sfr SSP2ADD;
1071 typedef struct
1073 unsigned MSK0 : 1;
1074 unsigned MSK1 : 1;
1075 unsigned MSK2 : 1;
1076 unsigned MSK3 : 1;
1077 unsigned MSK4 : 1;
1078 unsigned MSK5 : 1;
1079 unsigned MSK6 : 1;
1080 unsigned MSK7 : 1;
1081 } __SSP2ADDbits_t;
1083 extern __at(0x0F74) volatile __SSP2ADDbits_t SSP2ADDbits;
1085 #define _SSP2ADD_MSK0 0x01
1086 #define _SSP2ADD_MSK1 0x02
1087 #define _SSP2ADD_MSK2 0x04
1088 #define _SSP2ADD_MSK3 0x08
1089 #define _SSP2ADD_MSK4 0x10
1090 #define _SSP2ADD_MSK5 0x20
1091 #define _SSP2ADD_MSK6 0x40
1092 #define _SSP2ADD_MSK7 0x80
1094 //==============================================================================
1097 //==============================================================================
1098 // SSP2MSK Bits
1100 extern __at(0x0F74) __sfr SSP2MSK;
1102 typedef struct
1104 unsigned MSK0 : 1;
1105 unsigned MSK1 : 1;
1106 unsigned MSK2 : 1;
1107 unsigned MSK3 : 1;
1108 unsigned MSK4 : 1;
1109 unsigned MSK5 : 1;
1110 unsigned MSK6 : 1;
1111 unsigned MSK7 : 1;
1112 } __SSP2MSKbits_t;
1114 extern __at(0x0F74) volatile __SSP2MSKbits_t SSP2MSKbits;
1116 #define _SSP2MSK_MSK0 0x01
1117 #define _SSP2MSK_MSK1 0x02
1118 #define _SSP2MSK_MSK2 0x04
1119 #define _SSP2MSK_MSK3 0x08
1120 #define _SSP2MSK_MSK4 0x10
1121 #define _SSP2MSK_MSK5 0x20
1122 #define _SSP2MSK_MSK6 0x40
1123 #define _SSP2MSK_MSK7 0x80
1125 //==============================================================================
1127 extern __at(0x0F75) __sfr SSP2BUF;
1129 //==============================================================================
1130 // T4CON Bits
1132 extern __at(0x0F76) __sfr T4CON;
1134 typedef union
1136 struct
1138 unsigned T4CKPS0 : 1;
1139 unsigned T4CKPS1 : 1;
1140 unsigned TMR4ON : 1;
1141 unsigned T4OUTPS0 : 1;
1142 unsigned T4OUTPS1 : 1;
1143 unsigned T4OUTPS2 : 1;
1144 unsigned T4OUTPS3 : 1;
1145 unsigned : 1;
1148 struct
1150 unsigned T4CKPS : 2;
1151 unsigned : 6;
1154 struct
1156 unsigned : 3;
1157 unsigned T4OUTPS : 4;
1158 unsigned : 1;
1160 } __T4CONbits_t;
1162 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
1164 #define _T4CKPS0 0x01
1165 #define _T4CKPS1 0x02
1166 #define _TMR4ON 0x04
1167 #define _T4OUTPS0 0x08
1168 #define _T4OUTPS1 0x10
1169 #define _T4OUTPS2 0x20
1170 #define _T4OUTPS3 0x40
1172 //==============================================================================
1174 extern __at(0x0F77) __sfr PR4;
1175 extern __at(0x0F78) __sfr TMR4;
1177 //==============================================================================
1178 // T3CON Bits
1180 extern __at(0x0F79) __sfr T3CON;
1182 typedef union
1184 struct
1186 unsigned TMR3ON : 1;
1187 unsigned RD16 : 1;
1188 unsigned T3SYNC : 1;
1189 unsigned : 1;
1190 unsigned T3CKPS0 : 1;
1191 unsigned T3CKPS1 : 1;
1192 unsigned TMR3CS0 : 1;
1193 unsigned TMR3CS1 : 1;
1196 struct
1198 unsigned : 4;
1199 unsigned T3CKPS : 2;
1200 unsigned : 2;
1203 struct
1205 unsigned : 6;
1206 unsigned TMR3CS : 2;
1208 } __T3CONbits_t;
1210 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits;
1212 #define _T3CON_TMR3ON 0x01
1213 #define _T3CON_RD16 0x02
1214 #define _T3CON_T3SYNC 0x04
1215 #define _T3CON_T3CKPS0 0x10
1216 #define _T3CON_T3CKPS1 0x20
1217 #define _T3CON_TMR3CS0 0x40
1218 #define _T3CON_TMR3CS1 0x80
1220 //==============================================================================
1222 extern __at(0x0F7A) __sfr TMR3;
1223 extern __at(0x0F7A) __sfr TMR3L;
1224 extern __at(0x0F7B) __sfr TMR3H;
1226 //==============================================================================
1227 // BAUDCON2 Bits
1229 extern __at(0x0F7C) __sfr BAUDCON2;
1231 typedef struct
1233 unsigned ABDEN : 1;
1234 unsigned WUE : 1;
1235 unsigned : 1;
1236 unsigned BRG16 : 1;
1237 unsigned TXCKP : 1;
1238 unsigned RXDTP : 1;
1239 unsigned RCIDL : 1;
1240 unsigned ABDOVF : 1;
1241 } __BAUDCON2bits_t;
1243 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
1245 #define _BAUDCON2_ABDEN 0x01
1246 #define _BAUDCON2_WUE 0x02
1247 #define _BAUDCON2_BRG16 0x08
1248 #define _BAUDCON2_TXCKP 0x10
1249 #define _BAUDCON2_RXDTP 0x20
1250 #define _BAUDCON2_RCIDL 0x40
1251 #define _BAUDCON2_ABDOVF 0x80
1253 //==============================================================================
1255 extern __at(0x0F7D) __sfr SPBRGH2;
1257 //==============================================================================
1258 // BAUDCON Bits
1260 extern __at(0x0F7E) __sfr BAUDCON;
1262 typedef struct
1264 unsigned ABDEN : 1;
1265 unsigned WUE : 1;
1266 unsigned : 1;
1267 unsigned BRG16 : 1;
1268 unsigned TXCKP : 1;
1269 unsigned RXDTP : 1;
1270 unsigned RCIDL : 1;
1271 unsigned ABDOVF : 1;
1272 } __BAUDCONbits_t;
1274 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1276 #define _ABDEN 0x01
1277 #define _WUE 0x02
1278 #define _BRG16 0x08
1279 #define _TXCKP 0x10
1280 #define _RXDTP 0x20
1281 #define _RCIDL 0x40
1282 #define _ABDOVF 0x80
1284 //==============================================================================
1287 //==============================================================================
1288 // BAUDCON1 Bits
1290 extern __at(0x0F7E) __sfr BAUDCON1;
1292 typedef struct
1294 unsigned ABDEN : 1;
1295 unsigned WUE : 1;
1296 unsigned : 1;
1297 unsigned BRG16 : 1;
1298 unsigned TXCKP : 1;
1299 unsigned RXDTP : 1;
1300 unsigned RCIDL : 1;
1301 unsigned ABDOVF : 1;
1302 } __BAUDCON1bits_t;
1304 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1306 #define _BAUDCON1_ABDEN 0x01
1307 #define _BAUDCON1_WUE 0x02
1308 #define _BAUDCON1_BRG16 0x08
1309 #define _BAUDCON1_TXCKP 0x10
1310 #define _BAUDCON1_RXDTP 0x20
1311 #define _BAUDCON1_RCIDL 0x40
1312 #define _BAUDCON1_ABDOVF 0x80
1314 //==============================================================================
1317 //==============================================================================
1318 // BAUDCTL Bits
1320 extern __at(0x0F7E) __sfr BAUDCTL;
1322 typedef struct
1324 unsigned ABDEN : 1;
1325 unsigned WUE : 1;
1326 unsigned : 1;
1327 unsigned BRG16 : 1;
1328 unsigned TXCKP : 1;
1329 unsigned RXDTP : 1;
1330 unsigned RCIDL : 1;
1331 unsigned ABDOVF : 1;
1332 } __BAUDCTLbits_t;
1334 extern __at(0x0F7E) volatile __BAUDCTLbits_t BAUDCTLbits;
1336 #define _BAUDCTL_ABDEN 0x01
1337 #define _BAUDCTL_WUE 0x02
1338 #define _BAUDCTL_BRG16 0x08
1339 #define _BAUDCTL_TXCKP 0x10
1340 #define _BAUDCTL_RXDTP 0x20
1341 #define _BAUDCTL_RCIDL 0x40
1342 #define _BAUDCTL_ABDOVF 0x80
1344 //==============================================================================
1346 extern __at(0x0F7F) __sfr SPBRGH;
1347 extern __at(0x0F7F) __sfr SPBRGH1;
1349 //==============================================================================
1350 // PORTA Bits
1352 extern __at(0x0F80) __sfr PORTA;
1354 typedef union
1356 struct
1358 unsigned RA0 : 1;
1359 unsigned RA1 : 1;
1360 unsigned RA2 : 1;
1361 unsigned RA3 : 1;
1362 unsigned : 1;
1363 unsigned RA5 : 1;
1364 unsigned RA6 : 1;
1365 unsigned RA7 : 1;
1368 struct
1370 unsigned AN0 : 1;
1371 unsigned AN1 : 1;
1372 unsigned AN2 : 1;
1373 unsigned AN3 : 1;
1374 unsigned : 1;
1375 unsigned AN4 : 1;
1376 unsigned OSC2 : 1;
1377 unsigned OSC1 : 1;
1380 struct
1382 unsigned C1INA : 1;
1383 unsigned C2INA : 1;
1384 unsigned VREF_MINUS : 1;
1385 unsigned VREF_PLUS : 1;
1386 unsigned : 1;
1387 unsigned NOT_SS1 : 1;
1388 unsigned CLKO : 1;
1389 unsigned CLKI : 1;
1392 struct
1394 unsigned PMA6 : 1;
1395 unsigned PMA7 : 1;
1396 unsigned CVREF_MINUS : 1;
1397 unsigned C1INB : 1;
1398 unsigned : 1;
1399 unsigned HLVDIN : 1;
1400 unsigned : 1;
1401 unsigned : 1;
1404 struct
1406 unsigned RP0 : 1;
1407 unsigned RP1 : 1;
1408 unsigned C2INB : 1;
1409 unsigned : 1;
1410 unsigned : 1;
1411 unsigned RCV : 1;
1412 unsigned : 1;
1413 unsigned : 1;
1416 struct
1418 unsigned ULPWU : 1;
1419 unsigned : 1;
1420 unsigned : 1;
1421 unsigned : 1;
1422 unsigned : 1;
1423 unsigned RP2 : 1;
1424 unsigned : 1;
1425 unsigned : 1;
1427 } __PORTAbits_t;
1429 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1431 #define _RA0 0x01
1432 #define _AN0 0x01
1433 #define _C1INA 0x01
1434 #define _PMA6 0x01
1435 #define _RP0 0x01
1436 #define _ULPWU 0x01
1437 #define _RA1 0x02
1438 #define _AN1 0x02
1439 #define _C2INA 0x02
1440 #define _PMA7 0x02
1441 #define _RP1 0x02
1442 #define _RA2 0x04
1443 #define _AN2 0x04
1444 #define _VREF_MINUS 0x04
1445 #define _CVREF_MINUS 0x04
1446 #define _C2INB 0x04
1447 #define _RA3 0x08
1448 #define _AN3 0x08
1449 #define _VREF_PLUS 0x08
1450 #define _C1INB 0x08
1451 #define _RA5 0x20
1452 #define _AN4 0x20
1453 #define _NOT_SS1 0x20
1454 #define _HLVDIN 0x20
1455 #define _RCV 0x20
1456 #define _RP2 0x20
1457 #define _RA6 0x40
1458 #define _OSC2 0x40
1459 #define _CLKO 0x40
1460 #define _RA7 0x80
1461 #define _OSC1 0x80
1462 #define _CLKI 0x80
1464 //==============================================================================
1467 //==============================================================================
1468 // PORTB Bits
1470 extern __at(0x0F81) __sfr PORTB;
1472 typedef union
1474 struct
1476 unsigned RB0 : 1;
1477 unsigned RB1 : 1;
1478 unsigned RB2 : 1;
1479 unsigned RB3 : 1;
1480 unsigned RB4 : 1;
1481 unsigned RB5 : 1;
1482 unsigned RB6 : 1;
1483 unsigned RB7 : 1;
1486 struct
1488 unsigned AN12 : 1;
1489 unsigned AN10 : 1;
1490 unsigned AN8 : 1;
1491 unsigned AN9 : 1;
1492 unsigned PMA1 : 1;
1493 unsigned PMA0 : 1;
1494 unsigned KBI2 : 1;
1495 unsigned KBI3 : 1;
1498 struct
1500 unsigned INT0 : 1;
1501 unsigned PMPBE : 1;
1502 unsigned CTEDG1 : 1;
1503 unsigned CTEDG2 : 1;
1504 unsigned KBI0 : 1;
1505 unsigned KBI1 : 1;
1506 unsigned PGC : 1;
1507 unsigned PGD : 1;
1510 struct
1512 unsigned RP3 : 1;
1513 unsigned RTCC : 1;
1514 unsigned PMA3 : 1;
1515 unsigned PMA2 : 1;
1516 unsigned RP7 : 1;
1517 unsigned RP8 : 1;
1518 unsigned RP9 : 1;
1519 unsigned RP10 : 1;
1522 struct
1524 unsigned : 1;
1525 unsigned RP4 : 1;
1526 unsigned REFO : 1;
1527 unsigned RP6 : 1;
1528 unsigned : 1;
1529 unsigned : 1;
1530 unsigned : 1;
1531 unsigned : 1;
1534 struct
1536 unsigned : 1;
1537 unsigned : 1;
1538 unsigned RP5 : 1;
1539 unsigned : 1;
1540 unsigned : 1;
1541 unsigned : 1;
1542 unsigned : 1;
1543 unsigned : 1;
1546 struct
1548 unsigned : 4;
1549 unsigned KBI : 4;
1551 } __PORTBbits_t;
1553 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1555 #define _RB0 0x01
1556 #define _AN12 0x01
1557 #define _INT0 0x01
1558 #define _RP3 0x01
1559 #define _RB1 0x02
1560 #define _AN10 0x02
1561 #define _PMPBE 0x02
1562 #define _RTCC 0x02
1563 #define _RP4 0x02
1564 #define _RB2 0x04
1565 #define _AN8 0x04
1566 #define _CTEDG1 0x04
1567 #define _PMA3 0x04
1568 #define _REFO 0x04
1569 #define _RP5 0x04
1570 #define _RB3 0x08
1571 #define _AN9 0x08
1572 #define _CTEDG2 0x08
1573 #define _PMA2 0x08
1574 #define _RP6 0x08
1575 #define _RB4 0x10
1576 #define _PMA1 0x10
1577 #define _KBI0 0x10
1578 #define _RP7 0x10
1579 #define _RB5 0x20
1580 #define _PMA0 0x20
1581 #define _KBI1 0x20
1582 #define _RP8 0x20
1583 #define _RB6 0x40
1584 #define _KBI2 0x40
1585 #define _PGC 0x40
1586 #define _RP9 0x40
1587 #define _RB7 0x80
1588 #define _KBI3 0x80
1589 #define _PGD 0x80
1590 #define _RP10 0x80
1592 //==============================================================================
1595 //==============================================================================
1596 // PORTC Bits
1598 extern __at(0x0F82) __sfr PORTC;
1600 typedef union
1602 struct
1604 unsigned RC0 : 1;
1605 unsigned RC1 : 1;
1606 unsigned RC2 : 1;
1607 unsigned RC3 : 1;
1608 unsigned RC4 : 1;
1609 unsigned RC5 : 1;
1610 unsigned RC6 : 1;
1611 unsigned RC7 : 1;
1614 struct
1616 unsigned T1OSO : 1;
1617 unsigned T1OSI : 1;
1618 unsigned AN11 : 1;
1619 unsigned SCK1 : 1;
1620 unsigned SDI1 : 1;
1621 unsigned SDO1 : 1;
1622 unsigned PMA5 : 1;
1623 unsigned PMA4 : 1;
1626 struct
1628 unsigned T1CKI : 1;
1629 unsigned RP12 : 1;
1630 unsigned CTPLS : 1;
1631 unsigned SCL1 : 1;
1632 unsigned RP15 : 1;
1633 unsigned RP16 : 1;
1634 unsigned TX1 : 1;
1635 unsigned RX1 : 1;
1638 struct
1640 unsigned RP11 : 1;
1641 unsigned : 1;
1642 unsigned RP13 : 1;
1643 unsigned RP14 : 1;
1644 unsigned : 1;
1645 unsigned : 1;
1646 unsigned CK1 : 1;
1647 unsigned DT1 : 1;
1650 struct
1652 unsigned : 1;
1653 unsigned : 1;
1654 unsigned : 1;
1655 unsigned : 1;
1656 unsigned : 1;
1657 unsigned : 1;
1658 unsigned RP17 : 1;
1659 unsigned RP18 : 1;
1661 } __PORTCbits_t;
1663 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1665 #define _RC0 0x01
1666 #define _T1OSO 0x01
1667 #define _T1CKI 0x01
1668 #define _RP11 0x01
1669 #define _RC1 0x02
1670 #define _T1OSI 0x02
1671 #define _RP12 0x02
1672 #define _RC2 0x04
1673 #define _AN11 0x04
1674 #define _CTPLS 0x04
1675 #define _RP13 0x04
1676 #define _RC3 0x08
1677 #define _SCK1 0x08
1678 #define _SCL1 0x08
1679 #define _RP14 0x08
1680 #define _RC4 0x10
1681 #define _SDI1 0x10
1682 #define _RP15 0x10
1683 #define _RC5 0x20
1684 #define _SDO1 0x20
1685 #define _RP16 0x20
1686 #define _RC6 0x40
1687 #define _PMA5 0x40
1688 #define _TX1 0x40
1689 #define _CK1 0x40
1690 #define _RP17 0x40
1691 #define _RC7 0x80
1692 #define _PMA4 0x80
1693 #define _RX1 0x80
1694 #define _DT1 0x80
1695 #define _RP18 0x80
1697 //==============================================================================
1700 //==============================================================================
1701 // PORTD Bits
1703 extern __at(0x0F83) __sfr PORTD;
1705 typedef union
1707 struct
1709 unsigned RD0 : 1;
1710 unsigned RD1 : 1;
1711 unsigned RD2 : 1;
1712 unsigned RD3 : 1;
1713 unsigned RD4 : 1;
1714 unsigned RD5 : 1;
1715 unsigned RD6 : 1;
1716 unsigned RD7 : 1;
1719 struct
1721 unsigned PMD0 : 1;
1722 unsigned PMD1 : 1;
1723 unsigned PMD2 : 1;
1724 unsigned PMD3 : 1;
1725 unsigned PMD4 : 1;
1726 unsigned PMD5 : 1;
1727 unsigned PMD6 : 1;
1728 unsigned PMD7 : 1;
1731 struct
1733 unsigned SCL2 : 1;
1734 unsigned SDA2 : 1;
1735 unsigned RP19 : 1;
1736 unsigned RP20 : 1;
1737 unsigned RP21 : 1;
1738 unsigned RP22 : 1;
1739 unsigned RP23 : 1;
1740 unsigned RP24 : 1;
1742 } __PORTDbits_t;
1744 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1746 #define _RD0 0x01
1747 #define _PMD0 0x01
1748 #define _SCL2 0x01
1749 #define _RD1 0x02
1750 #define _PMD1 0x02
1751 #define _SDA2 0x02
1752 #define _RD2 0x04
1753 #define _PMD2 0x04
1754 #define _RP19 0x04
1755 #define _RD3 0x08
1756 #define _PMD3 0x08
1757 #define _RP20 0x08
1758 #define _RD4 0x10
1759 #define _PMD4 0x10
1760 #define _RP21 0x10
1761 #define _RD5 0x20
1762 #define _PMD5 0x20
1763 #define _RP22 0x20
1764 #define _RD6 0x40
1765 #define _PMD6 0x40
1766 #define _RP23 0x40
1767 #define _RD7 0x80
1768 #define _PMD7 0x80
1769 #define _RP24 0x80
1771 //==============================================================================
1774 //==============================================================================
1775 // PORTE Bits
1777 extern __at(0x0F84) __sfr PORTE;
1779 typedef union
1781 struct
1783 unsigned RE0 : 1;
1784 unsigned RE1 : 1;
1785 unsigned RE2 : 1;
1786 unsigned : 1;
1787 unsigned : 1;
1788 unsigned : 1;
1789 unsigned REPU : 1;
1790 unsigned RDPU : 1;
1793 struct
1795 unsigned AN5 : 1;
1796 unsigned AN6 : 1;
1797 unsigned AN7 : 1;
1798 unsigned : 1;
1799 unsigned : 1;
1800 unsigned : 1;
1801 unsigned : 1;
1802 unsigned : 1;
1805 struct
1807 unsigned PMPRD : 1;
1808 unsigned PMPWR : 1;
1809 unsigned PMPCS : 1;
1810 unsigned : 1;
1811 unsigned : 1;
1812 unsigned : 1;
1813 unsigned : 1;
1814 unsigned : 1;
1817 struct
1819 unsigned RE : 3;
1820 unsigned : 5;
1822 } __PORTEbits_t;
1824 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1826 #define _RE0 0x01
1827 #define _AN5 0x01
1828 #define _PMPRD 0x01
1829 #define _RE1 0x02
1830 #define _AN6 0x02
1831 #define _PMPWR 0x02
1832 #define _RE2 0x04
1833 #define _AN7 0x04
1834 #define _PMPCS 0x04
1835 #define _REPU 0x40
1836 #define _RDPU 0x80
1838 //==============================================================================
1841 //==============================================================================
1842 // HLVDCON Bits
1844 extern __at(0x0F85) __sfr HLVDCON;
1846 typedef union
1848 struct
1850 unsigned HLVDL0 : 1;
1851 unsigned HLVDL1 : 1;
1852 unsigned HLVDL2 : 1;
1853 unsigned HLVDL3 : 1;
1854 unsigned HLVDEN : 1;
1855 unsigned IRVST : 1;
1856 unsigned BGVST : 1;
1857 unsigned VDIRMAG : 1;
1860 struct
1862 unsigned HLVDL : 4;
1863 unsigned : 4;
1865 } __HLVDCONbits_t;
1867 extern __at(0x0F85) volatile __HLVDCONbits_t HLVDCONbits;
1869 #define _HLVDL0 0x01
1870 #define _HLVDL1 0x02
1871 #define _HLVDL2 0x04
1872 #define _HLVDL3 0x08
1873 #define _HLVDEN 0x10
1874 #define _IRVST 0x20
1875 #define _BGVST 0x40
1876 #define _VDIRMAG 0x80
1878 //==============================================================================
1881 //==============================================================================
1882 // DMACON2 Bits
1884 extern __at(0x0F86) __sfr DMACON2;
1886 typedef union
1888 struct
1890 unsigned INTLVL0 : 1;
1891 unsigned INTLVL1 : 1;
1892 unsigned INTLVL2 : 1;
1893 unsigned INTLVL3 : 1;
1894 unsigned DLYCYC0 : 1;
1895 unsigned DLYCYC1 : 1;
1896 unsigned DLYCYC2 : 1;
1897 unsigned DLYCYC3 : 1;
1900 struct
1902 unsigned INTLVL : 4;
1903 unsigned : 4;
1906 struct
1908 unsigned : 4;
1909 unsigned DLYCYC : 4;
1911 } __DMACON2bits_t;
1913 extern __at(0x0F86) volatile __DMACON2bits_t DMACON2bits;
1915 #define _INTLVL0 0x01
1916 #define _INTLVL1 0x02
1917 #define _INTLVL2 0x04
1918 #define _INTLVL3 0x08
1919 #define _DLYCYC0 0x10
1920 #define _DLYCYC1 0x20
1921 #define _DLYCYC2 0x40
1922 #define _DLYCYC3 0x80
1924 //==============================================================================
1927 //==============================================================================
1928 // DMACON1 Bits
1930 extern __at(0x0F88) __sfr DMACON1;
1932 typedef union
1934 struct
1936 unsigned DMAEN : 1;
1937 unsigned DLYINTEN : 1;
1938 unsigned DUPLEX0 : 1;
1939 unsigned DUPLEX1 : 1;
1940 unsigned RXINC : 1;
1941 unsigned TXINC : 1;
1942 unsigned SSCON0 : 1;
1943 unsigned SSCON1 : 1;
1946 struct
1948 unsigned : 2;
1949 unsigned DUPLEX : 2;
1950 unsigned : 4;
1953 struct
1955 unsigned : 6;
1956 unsigned SSCON : 2;
1958 } __DMACON1bits_t;
1960 extern __at(0x0F88) volatile __DMACON1bits_t DMACON1bits;
1962 #define _DMAEN 0x01
1963 #define _DLYINTEN 0x02
1964 #define _DUPLEX0 0x04
1965 #define _DUPLEX1 0x08
1966 #define _RXINC 0x10
1967 #define _TXINC 0x20
1968 #define _SSCON0 0x40
1969 #define _SSCON1 0x80
1971 //==============================================================================
1974 //==============================================================================
1975 // LATA Bits
1977 extern __at(0x0F89) __sfr LATA;
1979 typedef struct
1981 unsigned LATA0 : 1;
1982 unsigned LATA1 : 1;
1983 unsigned LATA2 : 1;
1984 unsigned LATA3 : 1;
1985 unsigned : 1;
1986 unsigned LATA5 : 1;
1987 unsigned LATA6 : 1;
1988 unsigned LATA7 : 1;
1989 } __LATAbits_t;
1991 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1993 #define _LATA0 0x01
1994 #define _LATA1 0x02
1995 #define _LATA2 0x04
1996 #define _LATA3 0x08
1997 #define _LATA5 0x20
1998 #define _LATA6 0x40
1999 #define _LATA7 0x80
2001 //==============================================================================
2004 //==============================================================================
2005 // LATB Bits
2007 extern __at(0x0F8A) __sfr LATB;
2009 typedef struct
2011 unsigned LATB0 : 1;
2012 unsigned LATB1 : 1;
2013 unsigned LATB2 : 1;
2014 unsigned LATB3 : 1;
2015 unsigned LATB4 : 1;
2016 unsigned LATB5 : 1;
2017 unsigned LATB6 : 1;
2018 unsigned LATB7 : 1;
2019 } __LATBbits_t;
2021 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2023 #define _LATB0 0x01
2024 #define _LATB1 0x02
2025 #define _LATB2 0x04
2026 #define _LATB3 0x08
2027 #define _LATB4 0x10
2028 #define _LATB5 0x20
2029 #define _LATB6 0x40
2030 #define _LATB7 0x80
2032 //==============================================================================
2035 //==============================================================================
2036 // LATC Bits
2038 extern __at(0x0F8B) __sfr LATC;
2040 typedef struct
2042 unsigned LATC0 : 1;
2043 unsigned LATC1 : 1;
2044 unsigned LATC2 : 1;
2045 unsigned LATC3 : 1;
2046 unsigned LATC4 : 1;
2047 unsigned LATC5 : 1;
2048 unsigned LATC6 : 1;
2049 unsigned LATC7 : 1;
2050 } __LATCbits_t;
2052 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2054 #define _LATC0 0x01
2055 #define _LATC1 0x02
2056 #define _LATC2 0x04
2057 #define _LATC3 0x08
2058 #define _LATC4 0x10
2059 #define _LATC5 0x20
2060 #define _LATC6 0x40
2061 #define _LATC7 0x80
2063 //==============================================================================
2066 //==============================================================================
2067 // LATD Bits
2069 extern __at(0x0F8C) __sfr LATD;
2071 typedef struct
2073 unsigned LATD0 : 1;
2074 unsigned LATD1 : 1;
2075 unsigned LATD2 : 1;
2076 unsigned LATD3 : 1;
2077 unsigned LATD4 : 1;
2078 unsigned LATD5 : 1;
2079 unsigned LATD6 : 1;
2080 unsigned LATD7 : 1;
2081 } __LATDbits_t;
2083 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2085 #define _LATD0 0x01
2086 #define _LATD1 0x02
2087 #define _LATD2 0x04
2088 #define _LATD3 0x08
2089 #define _LATD4 0x10
2090 #define _LATD5 0x20
2091 #define _LATD6 0x40
2092 #define _LATD7 0x80
2094 //==============================================================================
2097 //==============================================================================
2098 // LATE Bits
2100 extern __at(0x0F8D) __sfr LATE;
2102 typedef union
2104 struct
2106 unsigned LATE0 : 1;
2107 unsigned LATE1 : 1;
2108 unsigned LATE2 : 1;
2109 unsigned : 1;
2110 unsigned : 1;
2111 unsigned : 1;
2112 unsigned : 1;
2113 unsigned : 1;
2116 struct
2118 unsigned LATE : 3;
2119 unsigned : 5;
2121 } __LATEbits_t;
2123 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2125 #define _LATE0 0x01
2126 #define _LATE1 0x02
2127 #define _LATE2 0x04
2129 //==============================================================================
2131 extern __at(0x0F8E) __sfr ALRMVALL;
2132 extern __at(0x0F8F) __sfr ALRMVALH;
2134 //==============================================================================
2135 // ALRMRPT Bits
2137 extern __at(0x0F90) __sfr ALRMRPT;
2139 typedef struct
2141 unsigned ARPT0 : 1;
2142 unsigned ARPT1 : 1;
2143 unsigned ARPT2 : 1;
2144 unsigned ARPT3 : 1;
2145 unsigned ARPT4 : 1;
2146 unsigned ARPT5 : 1;
2147 unsigned ARPT6 : 1;
2148 unsigned ARPT7 : 1;
2149 } __ALRMRPTbits_t;
2151 extern __at(0x0F90) volatile __ALRMRPTbits_t ALRMRPTbits;
2153 #define _ARPT0 0x01
2154 #define _ARPT1 0x02
2155 #define _ARPT2 0x04
2156 #define _ARPT3 0x08
2157 #define _ARPT4 0x10
2158 #define _ARPT5 0x20
2159 #define _ARPT6 0x40
2160 #define _ARPT7 0x80
2162 //==============================================================================
2165 //==============================================================================
2166 // ALRMCFG Bits
2168 extern __at(0x0F91) __sfr ALRMCFG;
2170 typedef union
2172 struct
2174 unsigned ALRMPTR0 : 1;
2175 unsigned ALRMPTR1 : 1;
2176 unsigned AMASK0 : 1;
2177 unsigned AMASK1 : 1;
2178 unsigned AMASK2 : 1;
2179 unsigned AMASK3 : 1;
2180 unsigned CHIME : 1;
2181 unsigned ALRMEN : 1;
2184 struct
2186 unsigned ALRMPTR : 2;
2187 unsigned : 6;
2190 struct
2192 unsigned : 2;
2193 unsigned AMASK : 4;
2194 unsigned : 2;
2196 } __ALRMCFGbits_t;
2198 extern __at(0x0F91) volatile __ALRMCFGbits_t ALRMCFGbits;
2200 #define _ALRMPTR0 0x01
2201 #define _ALRMPTR1 0x02
2202 #define _AMASK0 0x04
2203 #define _AMASK1 0x08
2204 #define _AMASK2 0x10
2205 #define _AMASK3 0x20
2206 #define _CHIME 0x40
2207 #define _ALRMEN 0x80
2209 //==============================================================================
2212 //==============================================================================
2213 // TRISA Bits
2215 extern __at(0x0F92) __sfr TRISA;
2217 typedef struct
2219 unsigned TRISA0 : 1;
2220 unsigned TRISA1 : 1;
2221 unsigned TRISA2 : 1;
2222 unsigned TRISA3 : 1;
2223 unsigned : 1;
2224 unsigned TRISA5 : 1;
2225 unsigned TRISA6 : 1;
2226 unsigned TRISA7 : 1;
2227 } __TRISAbits_t;
2229 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2231 #define _TRISA0 0x01
2232 #define _TRISA1 0x02
2233 #define _TRISA2 0x04
2234 #define _TRISA3 0x08
2235 #define _TRISA5 0x20
2236 #define _TRISA6 0x40
2237 #define _TRISA7 0x80
2239 //==============================================================================
2242 //==============================================================================
2243 // TRISB Bits
2245 extern __at(0x0F93) __sfr TRISB;
2247 typedef struct
2249 unsigned TRISB0 : 1;
2250 unsigned TRISB1 : 1;
2251 unsigned TRISB2 : 1;
2252 unsigned TRISB3 : 1;
2253 unsigned TRISB4 : 1;
2254 unsigned TRISB5 : 1;
2255 unsigned TRISB6 : 1;
2256 unsigned TRISB7 : 1;
2257 } __TRISBbits_t;
2259 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2261 #define _TRISB0 0x01
2262 #define _TRISB1 0x02
2263 #define _TRISB2 0x04
2264 #define _TRISB3 0x08
2265 #define _TRISB4 0x10
2266 #define _TRISB5 0x20
2267 #define _TRISB6 0x40
2268 #define _TRISB7 0x80
2270 //==============================================================================
2273 //==============================================================================
2274 // TRISC Bits
2276 extern __at(0x0F94) __sfr TRISC;
2278 typedef struct
2280 unsigned TRISC0 : 1;
2281 unsigned TRISC1 : 1;
2282 unsigned TRISC2 : 1;
2283 unsigned TRISC3 : 1;
2284 unsigned TRISC4 : 1;
2285 unsigned TRISC5 : 1;
2286 unsigned TRISC6 : 1;
2287 unsigned TRISC7 : 1;
2288 } __TRISCbits_t;
2290 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2292 #define _TRISC0 0x01
2293 #define _TRISC1 0x02
2294 #define _TRISC2 0x04
2295 #define _TRISC3 0x08
2296 #define _TRISC4 0x10
2297 #define _TRISC5 0x20
2298 #define _TRISC6 0x40
2299 #define _TRISC7 0x80
2301 //==============================================================================
2304 //==============================================================================
2305 // TRISD Bits
2307 extern __at(0x0F95) __sfr TRISD;
2309 typedef struct
2311 unsigned TRISD0 : 1;
2312 unsigned TRISD1 : 1;
2313 unsigned TRISD2 : 1;
2314 unsigned TRISD3 : 1;
2315 unsigned TRISD4 : 1;
2316 unsigned TRISD5 : 1;
2317 unsigned TRISD6 : 1;
2318 unsigned TRISD7 : 1;
2319 } __TRISDbits_t;
2321 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2323 #define _TRISD0 0x01
2324 #define _TRISD1 0x02
2325 #define _TRISD2 0x04
2326 #define _TRISD3 0x08
2327 #define _TRISD4 0x10
2328 #define _TRISD5 0x20
2329 #define _TRISD6 0x40
2330 #define _TRISD7 0x80
2332 //==============================================================================
2335 //==============================================================================
2336 // TRISE Bits
2338 extern __at(0x0F96) __sfr TRISE;
2340 typedef union
2342 struct
2344 unsigned TRISE0 : 1;
2345 unsigned TRISE1 : 1;
2346 unsigned TRISE2 : 1;
2347 unsigned : 1;
2348 unsigned : 1;
2349 unsigned : 1;
2350 unsigned : 1;
2351 unsigned : 1;
2354 struct
2356 unsigned TRISE : 3;
2357 unsigned : 5;
2359 } __TRISEbits_t;
2361 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2363 #define _TRISE0 0x01
2364 #define _TRISE1 0x02
2365 #define _TRISE2 0x04
2367 //==============================================================================
2370 //==============================================================================
2371 // T3GCON Bits
2373 extern __at(0x0F97) __sfr T3GCON;
2375 typedef union
2377 struct
2379 unsigned T3GSS0 : 1;
2380 unsigned T3GSS1 : 1;
2381 unsigned T3GVAL : 1;
2382 unsigned T3GGO_T3DONE : 1;
2383 unsigned T3GSPM : 1;
2384 unsigned T3GTM : 1;
2385 unsigned T3GPOL : 1;
2386 unsigned TMR3GE : 1;
2389 struct
2391 unsigned : 1;
2392 unsigned : 1;
2393 unsigned : 1;
2394 unsigned T3GGO : 1;
2395 unsigned : 1;
2396 unsigned : 1;
2397 unsigned : 1;
2398 unsigned : 1;
2401 struct
2403 unsigned : 1;
2404 unsigned : 1;
2405 unsigned : 1;
2406 unsigned T3DONE : 1;
2407 unsigned : 1;
2408 unsigned : 1;
2409 unsigned : 1;
2410 unsigned : 1;
2413 struct
2415 unsigned T3GSS : 2;
2416 unsigned : 6;
2418 } __T3GCONbits_t;
2420 extern __at(0x0F97) volatile __T3GCONbits_t T3GCONbits;
2422 #define _T3GSS0 0x01
2423 #define _T3GSS1 0x02
2424 #define _T3GVAL 0x04
2425 #define _T3GGO_T3DONE 0x08
2426 #define _T3GGO 0x08
2427 #define _T3DONE 0x08
2428 #define _T3GSPM 0x10
2429 #define _T3GTM 0x20
2430 #define _T3GPOL 0x40
2431 #define _TMR3GE 0x80
2433 //==============================================================================
2435 extern __at(0x0F98) __sfr RTCVALL;
2436 extern __at(0x0F99) __sfr RTCVALH;
2438 //==============================================================================
2439 // T1GCON Bits
2441 extern __at(0x0F9A) __sfr T1GCON;
2443 typedef union
2445 struct
2447 unsigned T1GSS0 : 1;
2448 unsigned T1GSS1 : 1;
2449 unsigned T1GVAL : 1;
2450 unsigned T1GGO_T1DONE : 1;
2451 unsigned T1GSPM : 1;
2452 unsigned T1GTM : 1;
2453 unsigned T1GPOL : 1;
2454 unsigned TMR1GE : 1;
2457 struct
2459 unsigned : 1;
2460 unsigned : 1;
2461 unsigned : 1;
2462 unsigned T1GGO : 1;
2463 unsigned : 1;
2464 unsigned : 1;
2465 unsigned : 1;
2466 unsigned : 1;
2469 struct
2471 unsigned : 1;
2472 unsigned : 1;
2473 unsigned : 1;
2474 unsigned T1DONE : 1;
2475 unsigned : 1;
2476 unsigned : 1;
2477 unsigned : 1;
2478 unsigned : 1;
2481 struct
2483 unsigned T1GSS : 2;
2484 unsigned : 6;
2486 } __T1GCONbits_t;
2488 extern __at(0x0F9A) volatile __T1GCONbits_t T1GCONbits;
2490 #define _T1GSS0 0x01
2491 #define _T1GSS1 0x02
2492 #define _T1GVAL 0x04
2493 #define _T1GGO_T1DONE 0x08
2494 #define _T1GGO 0x08
2495 #define _T1DONE 0x08
2496 #define _T1GSPM 0x10
2497 #define _T1GTM 0x20
2498 #define _T1GPOL 0x40
2499 #define _TMR1GE 0x80
2501 //==============================================================================
2504 //==============================================================================
2505 // OSCTUNE Bits
2507 extern __at(0x0F9B) __sfr OSCTUNE;
2509 typedef union
2511 struct
2513 unsigned TUN0 : 1;
2514 unsigned TUN1 : 1;
2515 unsigned TUN2 : 1;
2516 unsigned TUN3 : 1;
2517 unsigned TUN4 : 1;
2518 unsigned TUN5 : 1;
2519 unsigned PLLEN : 1;
2520 unsigned INTSRC : 1;
2523 struct
2525 unsigned TUN : 6;
2526 unsigned : 2;
2528 } __OSCTUNEbits_t;
2530 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2532 #define _TUN0 0x01
2533 #define _TUN1 0x02
2534 #define _TUN2 0x04
2535 #define _TUN3 0x08
2536 #define _TUN4 0x10
2537 #define _TUN5 0x20
2538 #define _PLLEN 0x40
2539 #define _INTSRC 0x80
2541 //==============================================================================
2544 //==============================================================================
2545 // RCSTA2 Bits
2547 extern __at(0x0F9C) __sfr RCSTA2;
2549 typedef union
2551 struct
2553 unsigned RX9D : 1;
2554 unsigned OERR : 1;
2555 unsigned FERR : 1;
2556 unsigned ADDEN : 1;
2557 unsigned CREN : 1;
2558 unsigned SREN : 1;
2559 unsigned RX9 : 1;
2560 unsigned SPEN : 1;
2563 struct
2565 unsigned RX9D2 : 1;
2566 unsigned OERR2 : 1;
2567 unsigned FERR2 : 1;
2568 unsigned ADDEN2 : 1;
2569 unsigned CREN2 : 1;
2570 unsigned SREN2 : 1;
2571 unsigned RX92 : 1;
2572 unsigned SPEN2 : 1;
2574 } __RCSTA2bits_t;
2576 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
2578 #define _RCSTA2_RX9D 0x01
2579 #define _RCSTA2_RX9D2 0x01
2580 #define _RCSTA2_OERR 0x02
2581 #define _RCSTA2_OERR2 0x02
2582 #define _RCSTA2_FERR 0x04
2583 #define _RCSTA2_FERR2 0x04
2584 #define _RCSTA2_ADDEN 0x08
2585 #define _RCSTA2_ADDEN2 0x08
2586 #define _RCSTA2_CREN 0x10
2587 #define _RCSTA2_CREN2 0x10
2588 #define _RCSTA2_SREN 0x20
2589 #define _RCSTA2_SREN2 0x20
2590 #define _RCSTA2_RX9 0x40
2591 #define _RCSTA2_RX92 0x40
2592 #define _RCSTA2_SPEN 0x80
2593 #define _RCSTA2_SPEN2 0x80
2595 //==============================================================================
2598 //==============================================================================
2599 // PIE1 Bits
2601 extern __at(0x0F9D) __sfr PIE1;
2603 typedef union
2605 struct
2607 unsigned TMR1IE : 1;
2608 unsigned TMR2IE : 1;
2609 unsigned CCP1IE : 1;
2610 unsigned SSP1IE : 1;
2611 unsigned TX1IE : 1;
2612 unsigned RC1IE : 1;
2613 unsigned ADIE : 1;
2614 unsigned PMPIE : 1;
2617 struct
2619 unsigned : 1;
2620 unsigned : 1;
2621 unsigned : 1;
2622 unsigned SSPIE : 1;
2623 unsigned TXIE : 1;
2624 unsigned RCIE : 1;
2625 unsigned : 1;
2626 unsigned : 1;
2628 } __PIE1bits_t;
2630 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
2632 #define _TMR1IE 0x01
2633 #define _TMR2IE 0x02
2634 #define _CCP1IE 0x04
2635 #define _SSP1IE 0x08
2636 #define _SSPIE 0x08
2637 #define _TX1IE 0x10
2638 #define _TXIE 0x10
2639 #define _RC1IE 0x20
2640 #define _RCIE 0x20
2641 #define _ADIE 0x40
2642 #define _PMPIE 0x80
2644 //==============================================================================
2647 //==============================================================================
2648 // PIR1 Bits
2650 extern __at(0x0F9E) __sfr PIR1;
2652 typedef union
2654 struct
2656 unsigned TMR1IF : 1;
2657 unsigned TMR2IF : 1;
2658 unsigned CCP1IF : 1;
2659 unsigned SSP1IF : 1;
2660 unsigned TX1IF : 1;
2661 unsigned RC1IF : 1;
2662 unsigned ADIF : 1;
2663 unsigned PMPIF : 1;
2666 struct
2668 unsigned : 1;
2669 unsigned : 1;
2670 unsigned : 1;
2671 unsigned SSPIF : 1;
2672 unsigned TXIF : 1;
2673 unsigned RCIF : 1;
2674 unsigned : 1;
2675 unsigned : 1;
2677 } __PIR1bits_t;
2679 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2681 #define _TMR1IF 0x01
2682 #define _TMR2IF 0x02
2683 #define _CCP1IF 0x04
2684 #define _SSP1IF 0x08
2685 #define _SSPIF 0x08
2686 #define _TX1IF 0x10
2687 #define _TXIF 0x10
2688 #define _RC1IF 0x20
2689 #define _RCIF 0x20
2690 #define _ADIF 0x40
2691 #define _PMPIF 0x80
2693 //==============================================================================
2696 //==============================================================================
2697 // IPR1 Bits
2699 extern __at(0x0F9F) __sfr IPR1;
2701 typedef union
2703 struct
2705 unsigned TMR1IP : 1;
2706 unsigned TMR2IP : 1;
2707 unsigned CCP1IP : 1;
2708 unsigned SSP1IP : 1;
2709 unsigned TX1IP : 1;
2710 unsigned RC1IP : 1;
2711 unsigned ADIP : 1;
2712 unsigned PMPIP : 1;
2715 struct
2717 unsigned : 1;
2718 unsigned : 1;
2719 unsigned : 1;
2720 unsigned SSPIP : 1;
2721 unsigned TXIP : 1;
2722 unsigned RCIP : 1;
2723 unsigned : 1;
2724 unsigned : 1;
2726 } __IPR1bits_t;
2728 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2730 #define _TMR1IP 0x01
2731 #define _TMR2IP 0x02
2732 #define _CCP1IP 0x04
2733 #define _SSP1IP 0x08
2734 #define _SSPIP 0x08
2735 #define _TX1IP 0x10
2736 #define _TXIP 0x10
2737 #define _RC1IP 0x20
2738 #define _RCIP 0x20
2739 #define _ADIP 0x40
2740 #define _PMPIP 0x80
2742 //==============================================================================
2745 //==============================================================================
2746 // PIE2 Bits
2748 extern __at(0x0FA0) __sfr PIE2;
2750 typedef union
2752 struct
2754 unsigned CCP2IE : 1;
2755 unsigned TMR3IE : 1;
2756 unsigned LVDIE : 1;
2757 unsigned BCL1IE : 1;
2758 unsigned : 1;
2759 unsigned CM1IE : 1;
2760 unsigned CM2IE : 1;
2761 unsigned OSCFIE : 1;
2764 struct
2766 unsigned : 1;
2767 unsigned : 1;
2768 unsigned : 1;
2769 unsigned BCLIE : 1;
2770 unsigned : 1;
2771 unsigned : 1;
2772 unsigned : 1;
2773 unsigned : 1;
2775 } __PIE2bits_t;
2777 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2779 #define _CCP2IE 0x01
2780 #define _TMR3IE 0x02
2781 #define _LVDIE 0x04
2782 #define _BCL1IE 0x08
2783 #define _BCLIE 0x08
2784 #define _CM1IE 0x20
2785 #define _CM2IE 0x40
2786 #define _OSCFIE 0x80
2788 //==============================================================================
2791 //==============================================================================
2792 // PIR2 Bits
2794 extern __at(0x0FA1) __sfr PIR2;
2796 typedef union
2798 struct
2800 unsigned CCP2IF : 1;
2801 unsigned TMR3IF : 1;
2802 unsigned LVDIF : 1;
2803 unsigned BCL1IF : 1;
2804 unsigned : 1;
2805 unsigned CM1IF : 1;
2806 unsigned CM2IF : 1;
2807 unsigned OSCFIF : 1;
2810 struct
2812 unsigned : 1;
2813 unsigned : 1;
2814 unsigned : 1;
2815 unsigned BCLIF : 1;
2816 unsigned : 1;
2817 unsigned : 1;
2818 unsigned : 1;
2819 unsigned : 1;
2821 } __PIR2bits_t;
2823 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2825 #define _CCP2IF 0x01
2826 #define _TMR3IF 0x02
2827 #define _LVDIF 0x04
2828 #define _BCL1IF 0x08
2829 #define _BCLIF 0x08
2830 #define _CM1IF 0x20
2831 #define _CM2IF 0x40
2832 #define _OSCFIF 0x80
2834 //==============================================================================
2837 //==============================================================================
2838 // IPR2 Bits
2840 extern __at(0x0FA2) __sfr IPR2;
2842 typedef union
2844 struct
2846 unsigned CCP2IP : 1;
2847 unsigned TMR3IP : 1;
2848 unsigned LVDIP : 1;
2849 unsigned BCL1IP : 1;
2850 unsigned : 1;
2851 unsigned CM1IP : 1;
2852 unsigned CM2IP : 1;
2853 unsigned OSCFIP : 1;
2856 struct
2858 unsigned : 1;
2859 unsigned : 1;
2860 unsigned : 1;
2861 unsigned BCLIP : 1;
2862 unsigned : 1;
2863 unsigned : 1;
2864 unsigned : 1;
2865 unsigned : 1;
2867 } __IPR2bits_t;
2869 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
2871 #define _CCP2IP 0x01
2872 #define _TMR3IP 0x02
2873 #define _LVDIP 0x04
2874 #define _BCL1IP 0x08
2875 #define _BCLIP 0x08
2876 #define _CM1IP 0x20
2877 #define _CM2IP 0x40
2878 #define _OSCFIP 0x80
2880 //==============================================================================
2883 //==============================================================================
2884 // PIE3 Bits
2886 extern __at(0x0FA3) __sfr PIE3;
2888 typedef struct
2890 unsigned RTCCIE : 1;
2891 unsigned TMR3GIE : 1;
2892 unsigned CTMUIE : 1;
2893 unsigned TMR4IE : 1;
2894 unsigned TX2IE : 1;
2895 unsigned RC2IE : 1;
2896 unsigned BCL2IE : 1;
2897 unsigned SSP2IE : 1;
2898 } __PIE3bits_t;
2900 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
2902 #define _RTCCIE 0x01
2903 #define _TMR3GIE 0x02
2904 #define _CTMUIE 0x04
2905 #define _TMR4IE 0x08
2906 #define _TX2IE 0x10
2907 #define _RC2IE 0x20
2908 #define _BCL2IE 0x40
2909 #define _SSP2IE 0x80
2911 //==============================================================================
2914 //==============================================================================
2915 // PIR3 Bits
2917 extern __at(0x0FA4) __sfr PIR3;
2919 typedef struct
2921 unsigned RTCCIF : 1;
2922 unsigned TMR3GIF : 1;
2923 unsigned CTMUIF : 1;
2924 unsigned TMR4IF : 1;
2925 unsigned TX2IF : 1;
2926 unsigned RC2IF : 1;
2927 unsigned BCL2IF : 1;
2928 unsigned SSP2IF : 1;
2929 } __PIR3bits_t;
2931 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
2933 #define _RTCCIF 0x01
2934 #define _TMR3GIF 0x02
2935 #define _CTMUIF 0x04
2936 #define _TMR4IF 0x08
2937 #define _TX2IF 0x10
2938 #define _RC2IF 0x20
2939 #define _BCL2IF 0x40
2940 #define _SSP2IF 0x80
2942 //==============================================================================
2945 //==============================================================================
2946 // IPR3 Bits
2948 extern __at(0x0FA5) __sfr IPR3;
2950 typedef struct
2952 unsigned RTCCIP : 1;
2953 unsigned TMR3GIP : 1;
2954 unsigned CTMUIP : 1;
2955 unsigned TMR4IP : 1;
2956 unsigned TX2IP : 1;
2957 unsigned RC2IP : 1;
2958 unsigned BCL2IP : 1;
2959 unsigned SSP2IP : 1;
2960 } __IPR3bits_t;
2962 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
2964 #define _RTCCIP 0x01
2965 #define _TMR3GIP 0x02
2966 #define _CTMUIP 0x04
2967 #define _TMR4IP 0x08
2968 #define _TX2IP 0x10
2969 #define _RC2IP 0x20
2970 #define _BCL2IP 0x40
2971 #define _SSP2IP 0x80
2973 //==============================================================================
2976 //==============================================================================
2977 // EECON1 Bits
2979 extern __at(0x0FA6) __sfr EECON1;
2981 typedef struct
2983 unsigned : 1;
2984 unsigned WR : 1;
2985 unsigned WREN : 1;
2986 unsigned WRERR : 1;
2987 unsigned FREE : 1;
2988 unsigned WPROG : 1;
2989 unsigned : 1;
2990 unsigned : 1;
2991 } __EECON1bits_t;
2993 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
2995 #define _WR 0x02
2996 #define _WREN 0x04
2997 #define _WRERR 0x08
2998 #define _FREE 0x10
2999 #define _WPROG 0x20
3001 //==============================================================================
3003 extern __at(0x0FA7) __sfr EECON2;
3005 //==============================================================================
3006 // TXSTA2 Bits
3008 extern __at(0x0FA8) __sfr TXSTA2;
3010 typedef union
3012 struct
3014 unsigned TX9D : 1;
3015 unsigned TRMT : 1;
3016 unsigned BRGH : 1;
3017 unsigned SENDB : 1;
3018 unsigned SYNC : 1;
3019 unsigned TXEN : 1;
3020 unsigned TX9 : 1;
3021 unsigned CSRC : 1;
3024 struct
3026 unsigned TX9D2 : 1;
3027 unsigned TRMT2 : 1;
3028 unsigned BRGH2 : 1;
3029 unsigned SENDB2 : 1;
3030 unsigned SYNC2 : 1;
3031 unsigned TXEN2 : 1;
3032 unsigned TX92 : 1;
3033 unsigned CSRC2 : 1;
3035 } __TXSTA2bits_t;
3037 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
3039 #define _TXSTA2_TX9D 0x01
3040 #define _TXSTA2_TX9D2 0x01
3041 #define _TXSTA2_TRMT 0x02
3042 #define _TXSTA2_TRMT2 0x02
3043 #define _TXSTA2_BRGH 0x04
3044 #define _TXSTA2_BRGH2 0x04
3045 #define _TXSTA2_SENDB 0x08
3046 #define _TXSTA2_SENDB2 0x08
3047 #define _TXSTA2_SYNC 0x10
3048 #define _TXSTA2_SYNC2 0x10
3049 #define _TXSTA2_TXEN 0x20
3050 #define _TXSTA2_TXEN2 0x20
3051 #define _TXSTA2_TX9 0x40
3052 #define _TXSTA2_TX92 0x40
3053 #define _TXSTA2_CSRC 0x80
3054 #define _TXSTA2_CSRC2 0x80
3056 //==============================================================================
3058 extern __at(0x0FA9) __sfr TXREG2;
3059 extern __at(0x0FAA) __sfr RCREG2;
3060 extern __at(0x0FAB) __sfr SPBRG2;
3062 //==============================================================================
3063 // RCSTA Bits
3065 extern __at(0x0FAC) __sfr RCSTA;
3067 typedef union
3069 struct
3071 unsigned RX9D : 1;
3072 unsigned OERR : 1;
3073 unsigned FERR : 1;
3074 unsigned ADDEN : 1;
3075 unsigned CREN : 1;
3076 unsigned SREN : 1;
3077 unsigned RX9 : 1;
3078 unsigned SPEN : 1;
3081 struct
3083 unsigned RCD8 : 1;
3084 unsigned OERR1 : 1;
3085 unsigned FERR1 : 1;
3086 unsigned ADEN : 1;
3087 unsigned CREN1 : 1;
3088 unsigned SREN1 : 1;
3089 unsigned RC9 : 1;
3090 unsigned SPEN1 : 1;
3093 struct
3095 unsigned RX9D1 : 1;
3096 unsigned : 1;
3097 unsigned : 1;
3098 unsigned ADDEN1 : 1;
3099 unsigned : 1;
3100 unsigned : 1;
3101 unsigned NOT_RC8 : 1;
3102 unsigned : 1;
3105 struct
3107 unsigned : 1;
3108 unsigned : 1;
3109 unsigned : 1;
3110 unsigned : 1;
3111 unsigned : 1;
3112 unsigned : 1;
3113 unsigned RC8_9 : 1;
3114 unsigned : 1;
3117 struct
3119 unsigned : 1;
3120 unsigned : 1;
3121 unsigned : 1;
3122 unsigned : 1;
3123 unsigned : 1;
3124 unsigned : 1;
3125 unsigned RX91 : 1;
3126 unsigned : 1;
3128 } __RCSTAbits_t;
3130 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
3132 #define _RX9D 0x01
3133 #define _RCD8 0x01
3134 #define _RX9D1 0x01
3135 #define _OERR 0x02
3136 #define _OERR1 0x02
3137 #define _FERR 0x04
3138 #define _FERR1 0x04
3139 #define _ADDEN 0x08
3140 #define _ADEN 0x08
3141 #define _ADDEN1 0x08
3142 #define _CREN 0x10
3143 #define _CREN1 0x10
3144 #define _SREN 0x20
3145 #define _SREN1 0x20
3146 #define _RX9 0x40
3147 #define _RC9 0x40
3148 #define _NOT_RC8 0x40
3149 #define _RC8_9 0x40
3150 #define _RX91 0x40
3151 #define _SPEN 0x80
3152 #define _SPEN1 0x80
3154 //==============================================================================
3157 //==============================================================================
3158 // RCSTA1 Bits
3160 extern __at(0x0FAC) __sfr RCSTA1;
3162 typedef union
3164 struct
3166 unsigned RX9D : 1;
3167 unsigned OERR : 1;
3168 unsigned FERR : 1;
3169 unsigned ADDEN : 1;
3170 unsigned CREN : 1;
3171 unsigned SREN : 1;
3172 unsigned RX9 : 1;
3173 unsigned SPEN : 1;
3176 struct
3178 unsigned RCD8 : 1;
3179 unsigned OERR1 : 1;
3180 unsigned FERR1 : 1;
3181 unsigned ADEN : 1;
3182 unsigned CREN1 : 1;
3183 unsigned SREN1 : 1;
3184 unsigned RC9 : 1;
3185 unsigned SPEN1 : 1;
3188 struct
3190 unsigned RX9D1 : 1;
3191 unsigned : 1;
3192 unsigned : 1;
3193 unsigned ADDEN1 : 1;
3194 unsigned : 1;
3195 unsigned : 1;
3196 unsigned NOT_RC8 : 1;
3197 unsigned : 1;
3200 struct
3202 unsigned : 1;
3203 unsigned : 1;
3204 unsigned : 1;
3205 unsigned : 1;
3206 unsigned : 1;
3207 unsigned : 1;
3208 unsigned RC8_9 : 1;
3209 unsigned : 1;
3212 struct
3214 unsigned : 1;
3215 unsigned : 1;
3216 unsigned : 1;
3217 unsigned : 1;
3218 unsigned : 1;
3219 unsigned : 1;
3220 unsigned RX91 : 1;
3221 unsigned : 1;
3223 } __RCSTA1bits_t;
3225 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
3227 #define _RCSTA1_RX9D 0x01
3228 #define _RCSTA1_RCD8 0x01
3229 #define _RCSTA1_RX9D1 0x01
3230 #define _RCSTA1_OERR 0x02
3231 #define _RCSTA1_OERR1 0x02
3232 #define _RCSTA1_FERR 0x04
3233 #define _RCSTA1_FERR1 0x04
3234 #define _RCSTA1_ADDEN 0x08
3235 #define _RCSTA1_ADEN 0x08
3236 #define _RCSTA1_ADDEN1 0x08
3237 #define _RCSTA1_CREN 0x10
3238 #define _RCSTA1_CREN1 0x10
3239 #define _RCSTA1_SREN 0x20
3240 #define _RCSTA1_SREN1 0x20
3241 #define _RCSTA1_RX9 0x40
3242 #define _RCSTA1_RC9 0x40
3243 #define _RCSTA1_NOT_RC8 0x40
3244 #define _RCSTA1_RC8_9 0x40
3245 #define _RCSTA1_RX91 0x40
3246 #define _RCSTA1_SPEN 0x80
3247 #define _RCSTA1_SPEN1 0x80
3249 //==============================================================================
3252 //==============================================================================
3253 // TXSTA Bits
3255 extern __at(0x0FAD) __sfr TXSTA;
3257 typedef union
3259 struct
3261 unsigned TX9D : 1;
3262 unsigned TRMT : 1;
3263 unsigned BRGH : 1;
3264 unsigned SENDB : 1;
3265 unsigned SYNC : 1;
3266 unsigned TXEN : 1;
3267 unsigned TX9 : 1;
3268 unsigned CSRC : 1;
3271 struct
3273 unsigned TXD8 : 1;
3274 unsigned TRMT1 : 1;
3275 unsigned BRGH1 : 1;
3276 unsigned SENDB1 : 1;
3277 unsigned SYNC1 : 1;
3278 unsigned TXEN1 : 1;
3279 unsigned TX8_9 : 1;
3280 unsigned CSRC1 : 1;
3283 struct
3285 unsigned TX9D1 : 1;
3286 unsigned : 1;
3287 unsigned : 1;
3288 unsigned : 1;
3289 unsigned : 1;
3290 unsigned : 1;
3291 unsigned NOT_TX8 : 1;
3292 unsigned : 1;
3295 struct
3297 unsigned : 1;
3298 unsigned : 1;
3299 unsigned : 1;
3300 unsigned : 1;
3301 unsigned : 1;
3302 unsigned : 1;
3303 unsigned TX91 : 1;
3304 unsigned : 1;
3306 } __TXSTAbits_t;
3308 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
3310 #define _TX9D 0x01
3311 #define _TXD8 0x01
3312 #define _TX9D1 0x01
3313 #define _TRMT 0x02
3314 #define _TRMT1 0x02
3315 #define _BRGH 0x04
3316 #define _BRGH1 0x04
3317 #define _SENDB 0x08
3318 #define _SENDB1 0x08
3319 #define _SYNC 0x10
3320 #define _SYNC1 0x10
3321 #define _TXEN 0x20
3322 #define _TXEN1 0x20
3323 #define _TX9 0x40
3324 #define _TX8_9 0x40
3325 #define _NOT_TX8 0x40
3326 #define _TX91 0x40
3327 #define _CSRC 0x80
3328 #define _CSRC1 0x80
3330 //==============================================================================
3333 //==============================================================================
3334 // TXSTA1 Bits
3336 extern __at(0x0FAD) __sfr TXSTA1;
3338 typedef union
3340 struct
3342 unsigned TX9D : 1;
3343 unsigned TRMT : 1;
3344 unsigned BRGH : 1;
3345 unsigned SENDB : 1;
3346 unsigned SYNC : 1;
3347 unsigned TXEN : 1;
3348 unsigned TX9 : 1;
3349 unsigned CSRC : 1;
3352 struct
3354 unsigned TXD8 : 1;
3355 unsigned TRMT1 : 1;
3356 unsigned BRGH1 : 1;
3357 unsigned SENDB1 : 1;
3358 unsigned SYNC1 : 1;
3359 unsigned TXEN1 : 1;
3360 unsigned TX8_9 : 1;
3361 unsigned CSRC1 : 1;
3364 struct
3366 unsigned TX9D1 : 1;
3367 unsigned : 1;
3368 unsigned : 1;
3369 unsigned : 1;
3370 unsigned : 1;
3371 unsigned : 1;
3372 unsigned NOT_TX8 : 1;
3373 unsigned : 1;
3376 struct
3378 unsigned : 1;
3379 unsigned : 1;
3380 unsigned : 1;
3381 unsigned : 1;
3382 unsigned : 1;
3383 unsigned : 1;
3384 unsigned TX91 : 1;
3385 unsigned : 1;
3387 } __TXSTA1bits_t;
3389 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
3391 #define _TXSTA1_TX9D 0x01
3392 #define _TXSTA1_TXD8 0x01
3393 #define _TXSTA1_TX9D1 0x01
3394 #define _TXSTA1_TRMT 0x02
3395 #define _TXSTA1_TRMT1 0x02
3396 #define _TXSTA1_BRGH 0x04
3397 #define _TXSTA1_BRGH1 0x04
3398 #define _TXSTA1_SENDB 0x08
3399 #define _TXSTA1_SENDB1 0x08
3400 #define _TXSTA1_SYNC 0x10
3401 #define _TXSTA1_SYNC1 0x10
3402 #define _TXSTA1_TXEN 0x20
3403 #define _TXSTA1_TXEN1 0x20
3404 #define _TXSTA1_TX9 0x40
3405 #define _TXSTA1_TX8_9 0x40
3406 #define _TXSTA1_NOT_TX8 0x40
3407 #define _TXSTA1_TX91 0x40
3408 #define _TXSTA1_CSRC 0x80
3409 #define _TXSTA1_CSRC1 0x80
3411 //==============================================================================
3413 extern __at(0x0FAE) __sfr TXREG;
3414 extern __at(0x0FAE) __sfr TXREG1;
3415 extern __at(0x0FAF) __sfr RCREG;
3416 extern __at(0x0FAF) __sfr RCREG1;
3417 extern __at(0x0FB0) __sfr SPBRG;
3418 extern __at(0x0FB0) __sfr SPBRG1;
3420 //==============================================================================
3421 // CTMUICON Bits
3423 extern __at(0x0FB1) __sfr CTMUICON;
3425 typedef union
3427 struct
3429 unsigned IRNG0 : 1;
3430 unsigned IRNG1 : 1;
3431 unsigned ITRIM0 : 1;
3432 unsigned ITRIM1 : 1;
3433 unsigned ITRIM2 : 1;
3434 unsigned ITRIM3 : 1;
3435 unsigned ITRIM4 : 1;
3436 unsigned ITRIM5 : 1;
3439 struct
3441 unsigned IRNG : 2;
3442 unsigned : 6;
3445 struct
3447 unsigned : 2;
3448 unsigned ITRIM : 6;
3450 } __CTMUICONbits_t;
3452 extern __at(0x0FB1) volatile __CTMUICONbits_t CTMUICONbits;
3454 #define _IRNG0 0x01
3455 #define _IRNG1 0x02
3456 #define _ITRIM0 0x04
3457 #define _ITRIM1 0x08
3458 #define _ITRIM2 0x10
3459 #define _ITRIM3 0x20
3460 #define _ITRIM4 0x40
3461 #define _ITRIM5 0x80
3463 //==============================================================================
3466 //==============================================================================
3467 // CTMUCONL Bits
3469 extern __at(0x0FB2) __sfr CTMUCONL;
3471 typedef union
3473 struct
3475 unsigned EDG1STAT : 1;
3476 unsigned EDG2STAT : 1;
3477 unsigned EDG1SEL0 : 1;
3478 unsigned EDG1SEL1 : 1;
3479 unsigned EDG1POL : 1;
3480 unsigned EDG2SEL0 : 1;
3481 unsigned EDG2SEL1 : 1;
3482 unsigned EDG2POL : 1;
3485 struct
3487 unsigned : 2;
3488 unsigned EDG1SEL : 2;
3489 unsigned : 4;
3492 struct
3494 unsigned : 5;
3495 unsigned EDG2SEL : 2;
3496 unsigned : 1;
3498 } __CTMUCONLbits_t;
3500 extern __at(0x0FB2) volatile __CTMUCONLbits_t CTMUCONLbits;
3502 #define _EDG1STAT 0x01
3503 #define _EDG2STAT 0x02
3504 #define _EDG1SEL0 0x04
3505 #define _EDG1SEL1 0x08
3506 #define _EDG1POL 0x10
3507 #define _EDG2SEL0 0x20
3508 #define _EDG2SEL1 0x40
3509 #define _EDG2POL 0x80
3511 //==============================================================================
3514 //==============================================================================
3515 // CTMUCONH Bits
3517 extern __at(0x0FB3) __sfr CTMUCONH;
3519 typedef struct
3521 unsigned CTTRIG : 1;
3522 unsigned IDISSEN : 1;
3523 unsigned EDGSEQEN : 1;
3524 unsigned EDGEN : 1;
3525 unsigned TGEN : 1;
3526 unsigned CTMUSIDL : 1;
3527 unsigned : 1;
3528 unsigned CTMUEN : 1;
3529 } __CTMUCONHbits_t;
3531 extern __at(0x0FB3) volatile __CTMUCONHbits_t CTMUCONHbits;
3533 #define _CTTRIG 0x01
3534 #define _IDISSEN 0x02
3535 #define _EDGSEQEN 0x04
3536 #define _EDGEN 0x08
3537 #define _TGEN 0x10
3538 #define _CTMUSIDL 0x20
3539 #define _CTMUEN 0x80
3541 //==============================================================================
3544 //==============================================================================
3545 // CCP2CON Bits
3547 extern __at(0x0FB4) __sfr CCP2CON;
3549 typedef union
3551 struct
3553 unsigned CCP2M0 : 1;
3554 unsigned CCP2M1 : 1;
3555 unsigned CCP2M2 : 1;
3556 unsigned CCP2M3 : 1;
3557 unsigned DC2B0 : 1;
3558 unsigned DC2B1 : 1;
3559 unsigned P2M0 : 1;
3560 unsigned P2M1 : 1;
3563 struct
3565 unsigned : 1;
3566 unsigned : 1;
3567 unsigned : 1;
3568 unsigned : 1;
3569 unsigned CCP2Y : 1;
3570 unsigned CCP2X : 1;
3571 unsigned : 1;
3572 unsigned : 1;
3575 struct
3577 unsigned CCP2M : 4;
3578 unsigned : 4;
3581 struct
3583 unsigned : 4;
3584 unsigned DC2B : 2;
3585 unsigned : 2;
3588 struct
3590 unsigned : 6;
3591 unsigned P2M : 2;
3593 } __CCP2CONbits_t;
3595 extern __at(0x0FB4) volatile __CCP2CONbits_t CCP2CONbits;
3597 #define _CCP2M0 0x01
3598 #define _CCP2M1 0x02
3599 #define _CCP2M2 0x04
3600 #define _CCP2M3 0x08
3601 #define _DC2B0 0x10
3602 #define _CCP2Y 0x10
3603 #define _DC2B1 0x20
3604 #define _CCP2X 0x20
3605 #define _P2M0 0x40
3606 #define _P2M1 0x80
3608 //==============================================================================
3611 //==============================================================================
3612 // ECCP2CON Bits
3614 extern __at(0x0FB4) __sfr ECCP2CON;
3616 typedef union
3618 struct
3620 unsigned CCP2M0 : 1;
3621 unsigned CCP2M1 : 1;
3622 unsigned CCP2M2 : 1;
3623 unsigned CCP2M3 : 1;
3624 unsigned DC2B0 : 1;
3625 unsigned DC2B1 : 1;
3626 unsigned P2M0 : 1;
3627 unsigned P2M1 : 1;
3630 struct
3632 unsigned : 1;
3633 unsigned : 1;
3634 unsigned : 1;
3635 unsigned : 1;
3636 unsigned CCP2Y : 1;
3637 unsigned CCP2X : 1;
3638 unsigned : 1;
3639 unsigned : 1;
3642 struct
3644 unsigned CCP2M : 4;
3645 unsigned : 4;
3648 struct
3650 unsigned : 4;
3651 unsigned DC2B : 2;
3652 unsigned : 2;
3655 struct
3657 unsigned : 6;
3658 unsigned P2M : 2;
3660 } __ECCP2CONbits_t;
3662 extern __at(0x0FB4) volatile __ECCP2CONbits_t ECCP2CONbits;
3664 #define _ECCP2CON_CCP2M0 0x01
3665 #define _ECCP2CON_CCP2M1 0x02
3666 #define _ECCP2CON_CCP2M2 0x04
3667 #define _ECCP2CON_CCP2M3 0x08
3668 #define _ECCP2CON_DC2B0 0x10
3669 #define _ECCP2CON_CCP2Y 0x10
3670 #define _ECCP2CON_DC2B1 0x20
3671 #define _ECCP2CON_CCP2X 0x20
3672 #define _ECCP2CON_P2M0 0x40
3673 #define _ECCP2CON_P2M1 0x80
3675 //==============================================================================
3677 extern __at(0x0FB5) __sfr CCPR2;
3678 extern __at(0x0FB5) __sfr CCPR2L;
3679 extern __at(0x0FB6) __sfr CCPR2H;
3681 //==============================================================================
3682 // ECCP2DEL Bits
3684 extern __at(0x0FB7) __sfr ECCP2DEL;
3686 typedef union
3688 struct
3690 unsigned P2DC0 : 1;
3691 unsigned P2DC1 : 1;
3692 unsigned P2DC2 : 1;
3693 unsigned P2DC3 : 1;
3694 unsigned P2DC4 : 1;
3695 unsigned P2DC5 : 1;
3696 unsigned P2DC6 : 1;
3697 unsigned P2RSEN : 1;
3700 struct
3702 unsigned P2DC : 7;
3703 unsigned : 1;
3705 } __ECCP2DELbits_t;
3707 extern __at(0x0FB7) volatile __ECCP2DELbits_t ECCP2DELbits;
3709 #define _P2DC0 0x01
3710 #define _P2DC1 0x02
3711 #define _P2DC2 0x04
3712 #define _P2DC3 0x08
3713 #define _P2DC4 0x10
3714 #define _P2DC5 0x20
3715 #define _P2DC6 0x40
3716 #define _P2RSEN 0x80
3718 //==============================================================================
3721 //==============================================================================
3722 // PWM2CON Bits
3724 extern __at(0x0FB7) __sfr PWM2CON;
3726 typedef union
3728 struct
3730 unsigned P2DC0 : 1;
3731 unsigned P2DC1 : 1;
3732 unsigned P2DC2 : 1;
3733 unsigned P2DC3 : 1;
3734 unsigned P2DC4 : 1;
3735 unsigned P2DC5 : 1;
3736 unsigned P2DC6 : 1;
3737 unsigned P2RSEN : 1;
3740 struct
3742 unsigned P2DC : 7;
3743 unsigned : 1;
3745 } __PWM2CONbits_t;
3747 extern __at(0x0FB7) volatile __PWM2CONbits_t PWM2CONbits;
3749 #define _PWM2CON_P2DC0 0x01
3750 #define _PWM2CON_P2DC1 0x02
3751 #define _PWM2CON_P2DC2 0x04
3752 #define _PWM2CON_P2DC3 0x08
3753 #define _PWM2CON_P2DC4 0x10
3754 #define _PWM2CON_P2DC5 0x20
3755 #define _PWM2CON_P2DC6 0x40
3756 #define _PWM2CON_P2RSEN 0x80
3758 //==============================================================================
3761 //==============================================================================
3762 // ECCP2AS Bits
3764 extern __at(0x0FB8) __sfr ECCP2AS;
3766 typedef union
3768 struct
3770 unsigned PSS2BD0 : 1;
3771 unsigned PSS2BD1 : 1;
3772 unsigned PSS2AC0 : 1;
3773 unsigned PSS2AC1 : 1;
3774 unsigned ECCP2AS0 : 1;
3775 unsigned ECCP2AS1 : 1;
3776 unsigned ECCP2AS2 : 1;
3777 unsigned ECCP2ASE : 1;
3780 struct
3782 unsigned PSS2BD : 2;
3783 unsigned : 6;
3786 struct
3788 unsigned : 2;
3789 unsigned PSS2AC : 2;
3790 unsigned : 4;
3793 struct
3795 unsigned : 4;
3796 unsigned ECCP2AS : 3;
3797 unsigned : 1;
3799 } __ECCP2ASbits_t;
3801 extern __at(0x0FB8) volatile __ECCP2ASbits_t ECCP2ASbits;
3803 #define _PSS2BD0 0x01
3804 #define _PSS2BD1 0x02
3805 #define _PSS2AC0 0x04
3806 #define _PSS2AC1 0x08
3807 #define _ECCP2AS0 0x10
3808 #define _ECCP2AS1 0x20
3809 #define _ECCP2AS2 0x40
3810 #define _ECCP2ASE 0x80
3812 //==============================================================================
3815 //==============================================================================
3816 // PSTR2CON Bits
3818 extern __at(0x0FB9) __sfr PSTR2CON;
3820 typedef union
3822 struct
3824 unsigned STRA : 1;
3825 unsigned STRB : 1;
3826 unsigned STRC : 1;
3827 unsigned STRD : 1;
3828 unsigned STRSYNC : 1;
3829 unsigned P2DC5 : 1;
3830 unsigned CMPL0 : 1;
3831 unsigned CMPL1 : 1;
3834 struct
3836 unsigned P2DC0 : 1;
3837 unsigned P2DC1 : 1;
3838 unsigned P2DC2 : 1;
3839 unsigned P2DC3 : 1;
3840 unsigned P2DC4 : 1;
3841 unsigned P2DC52 : 1;
3842 unsigned P2DC6 : 1;
3843 unsigned : 1;
3846 struct
3848 unsigned P2DC02 : 1;
3849 unsigned P2DC12 : 1;
3850 unsigned P2DC22 : 1;
3851 unsigned P2DC32 : 1;
3852 unsigned P2DC42 : 1;
3853 unsigned : 1;
3854 unsigned P2DC62 : 1;
3855 unsigned : 1;
3858 struct
3860 unsigned : 6;
3861 unsigned CMPL : 2;
3863 } __PSTR2CONbits_t;
3865 extern __at(0x0FB9) volatile __PSTR2CONbits_t PSTR2CONbits;
3867 #define _PSTR2CON_STRA 0x01
3868 #define _PSTR2CON_P2DC0 0x01
3869 #define _PSTR2CON_P2DC02 0x01
3870 #define _PSTR2CON_STRB 0x02
3871 #define _PSTR2CON_P2DC1 0x02
3872 #define _PSTR2CON_P2DC12 0x02
3873 #define _PSTR2CON_STRC 0x04
3874 #define _PSTR2CON_P2DC2 0x04
3875 #define _PSTR2CON_P2DC22 0x04
3876 #define _PSTR2CON_STRD 0x08
3877 #define _PSTR2CON_P2DC3 0x08
3878 #define _PSTR2CON_P2DC32 0x08
3879 #define _PSTR2CON_STRSYNC 0x10
3880 #define _PSTR2CON_P2DC4 0x10
3881 #define _PSTR2CON_P2DC42 0x10
3882 #define _PSTR2CON_P2DC5 0x20
3883 #define _PSTR2CON_P2DC52 0x20
3884 #define _PSTR2CON_CMPL0 0x40
3885 #define _PSTR2CON_P2DC6 0x40
3886 #define _PSTR2CON_P2DC62 0x40
3887 #define _PSTR2CON_CMPL1 0x80
3889 //==============================================================================
3892 //==============================================================================
3893 // CCP1CON Bits
3895 extern __at(0x0FBA) __sfr CCP1CON;
3897 typedef union
3899 struct
3901 unsigned CCP1M0 : 1;
3902 unsigned CCP1M1 : 1;
3903 unsigned CCP1M2 : 1;
3904 unsigned CCP1M3 : 1;
3905 unsigned DC1B0 : 1;
3906 unsigned DC1B1 : 1;
3907 unsigned P1M0 : 1;
3908 unsigned P1M1 : 1;
3911 struct
3913 unsigned : 1;
3914 unsigned : 1;
3915 unsigned : 1;
3916 unsigned : 1;
3917 unsigned CCP1Y : 1;
3918 unsigned CCP1X : 1;
3919 unsigned : 1;
3920 unsigned : 1;
3923 struct
3925 unsigned CCP1M : 4;
3926 unsigned : 4;
3929 struct
3931 unsigned : 4;
3932 unsigned DC1B : 2;
3933 unsigned : 2;
3936 struct
3938 unsigned : 6;
3939 unsigned P1M : 2;
3941 } __CCP1CONbits_t;
3943 extern __at(0x0FBA) volatile __CCP1CONbits_t CCP1CONbits;
3945 #define _CCP1M0 0x01
3946 #define _CCP1M1 0x02
3947 #define _CCP1M2 0x04
3948 #define _CCP1M3 0x08
3949 #define _DC1B0 0x10
3950 #define _CCP1Y 0x10
3951 #define _DC1B1 0x20
3952 #define _CCP1X 0x20
3953 #define _P1M0 0x40
3954 #define _P1M1 0x80
3956 //==============================================================================
3959 //==============================================================================
3960 // ECCP1CON Bits
3962 extern __at(0x0FBA) __sfr ECCP1CON;
3964 typedef union
3966 struct
3968 unsigned CCP1M0 : 1;
3969 unsigned CCP1M1 : 1;
3970 unsigned CCP1M2 : 1;
3971 unsigned CCP1M3 : 1;
3972 unsigned DC1B0 : 1;
3973 unsigned DC1B1 : 1;
3974 unsigned P1M0 : 1;
3975 unsigned P1M1 : 1;
3978 struct
3980 unsigned : 1;
3981 unsigned : 1;
3982 unsigned : 1;
3983 unsigned : 1;
3984 unsigned CCP1Y : 1;
3985 unsigned CCP1X : 1;
3986 unsigned : 1;
3987 unsigned : 1;
3990 struct
3992 unsigned CCP1M : 4;
3993 unsigned : 4;
3996 struct
3998 unsigned : 4;
3999 unsigned DC1B : 2;
4000 unsigned : 2;
4003 struct
4005 unsigned : 6;
4006 unsigned P1M : 2;
4008 } __ECCP1CONbits_t;
4010 extern __at(0x0FBA) volatile __ECCP1CONbits_t ECCP1CONbits;
4012 #define _ECCP1CON_CCP1M0 0x01
4013 #define _ECCP1CON_CCP1M1 0x02
4014 #define _ECCP1CON_CCP1M2 0x04
4015 #define _ECCP1CON_CCP1M3 0x08
4016 #define _ECCP1CON_DC1B0 0x10
4017 #define _ECCP1CON_CCP1Y 0x10
4018 #define _ECCP1CON_DC1B1 0x20
4019 #define _ECCP1CON_CCP1X 0x20
4020 #define _ECCP1CON_P1M0 0x40
4021 #define _ECCP1CON_P1M1 0x80
4023 //==============================================================================
4025 extern __at(0x0FBB) __sfr CCPR1;
4026 extern __at(0x0FBB) __sfr CCPR1L;
4027 extern __at(0x0FBC) __sfr CCPR1H;
4029 //==============================================================================
4030 // ECCP1DEL Bits
4032 extern __at(0x0FBD) __sfr ECCP1DEL;
4034 typedef union
4036 struct
4038 unsigned P1DC0 : 1;
4039 unsigned P1DC1 : 1;
4040 unsigned P1DC2 : 1;
4041 unsigned P1DC3 : 1;
4042 unsigned P1DC4 : 1;
4043 unsigned P1DC5 : 1;
4044 unsigned P1DC6 : 1;
4045 unsigned P1RSEN : 1;
4048 struct
4050 unsigned P1DC : 7;
4051 unsigned : 1;
4053 } __ECCP1DELbits_t;
4055 extern __at(0x0FBD) volatile __ECCP1DELbits_t ECCP1DELbits;
4057 #define _P1DC0 0x01
4058 #define _P1DC1 0x02
4059 #define _P1DC2 0x04
4060 #define _P1DC3 0x08
4061 #define _P1DC4 0x10
4062 #define _P1DC5 0x20
4063 #define _P1DC6 0x40
4064 #define _P1RSEN 0x80
4066 //==============================================================================
4069 //==============================================================================
4070 // PWM1CON Bits
4072 extern __at(0x0FBD) __sfr PWM1CON;
4074 typedef union
4076 struct
4078 unsigned P1DC0 : 1;
4079 unsigned P1DC1 : 1;
4080 unsigned P1DC2 : 1;
4081 unsigned P1DC3 : 1;
4082 unsigned P1DC4 : 1;
4083 unsigned P1DC5 : 1;
4084 unsigned P1DC6 : 1;
4085 unsigned P1RSEN : 1;
4088 struct
4090 unsigned P1DC : 7;
4091 unsigned : 1;
4093 } __PWM1CONbits_t;
4095 extern __at(0x0FBD) volatile __PWM1CONbits_t PWM1CONbits;
4097 #define _PWM1CON_P1DC0 0x01
4098 #define _PWM1CON_P1DC1 0x02
4099 #define _PWM1CON_P1DC2 0x04
4100 #define _PWM1CON_P1DC3 0x08
4101 #define _PWM1CON_P1DC4 0x10
4102 #define _PWM1CON_P1DC5 0x20
4103 #define _PWM1CON_P1DC6 0x40
4104 #define _PWM1CON_P1RSEN 0x80
4106 //==============================================================================
4109 //==============================================================================
4110 // ECCP1AS Bits
4112 extern __at(0x0FBE) __sfr ECCP1AS;
4114 typedef union
4116 struct
4118 unsigned PSS1BD0 : 1;
4119 unsigned PSS1BD1 : 1;
4120 unsigned PSS1AC0 : 1;
4121 unsigned PSS1AC1 : 1;
4122 unsigned ECCP1AS0 : 1;
4123 unsigned ECCP1AS1 : 1;
4124 unsigned ECCP1AS2 : 1;
4125 unsigned ECCP1ASE : 1;
4128 struct
4130 unsigned PSS1BD : 2;
4131 unsigned : 6;
4134 struct
4136 unsigned : 2;
4137 unsigned PSS1AC : 2;
4138 unsigned : 4;
4141 struct
4143 unsigned : 4;
4144 unsigned ECCP1AS : 3;
4145 unsigned : 1;
4147 } __ECCP1ASbits_t;
4149 extern __at(0x0FBE) volatile __ECCP1ASbits_t ECCP1ASbits;
4151 #define _PSS1BD0 0x01
4152 #define _PSS1BD1 0x02
4153 #define _PSS1AC0 0x04
4154 #define _PSS1AC1 0x08
4155 #define _ECCP1AS0 0x10
4156 #define _ECCP1AS1 0x20
4157 #define _ECCP1AS2 0x40
4158 #define _ECCP1ASE 0x80
4160 //==============================================================================
4163 //==============================================================================
4164 // PSTR1CON Bits
4166 extern __at(0x0FBF) __sfr PSTR1CON;
4168 typedef union
4170 struct
4172 unsigned STRA : 1;
4173 unsigned STRB : 1;
4174 unsigned STRC : 1;
4175 unsigned STRD : 1;
4176 unsigned STRSYNC : 1;
4177 unsigned : 1;
4178 unsigned CMPL0 : 1;
4179 unsigned CMPL1 : 1;
4182 struct
4184 unsigned : 6;
4185 unsigned CMPL : 2;
4187 } __PSTR1CONbits_t;
4189 extern __at(0x0FBF) volatile __PSTR1CONbits_t PSTR1CONbits;
4191 #define _STRA 0x01
4192 #define _STRB 0x02
4193 #define _STRC 0x04
4194 #define _STRD 0x08
4195 #define _STRSYNC 0x10
4196 #define _CMPL0 0x40
4197 #define _CMPL1 0x80
4199 //==============================================================================
4202 //==============================================================================
4203 // WDTCON Bits
4205 extern __at(0x0FC0) __sfr WDTCON;
4207 typedef union
4209 struct
4211 unsigned SWDTEN : 1;
4212 unsigned ULPSINK : 1;
4213 unsigned ULPEN : 1;
4214 unsigned DS : 1;
4215 unsigned : 1;
4216 unsigned ULPLVL : 1;
4217 unsigned LVDSTAT : 1;
4218 unsigned REGSLP : 1;
4221 struct
4223 unsigned SWDTE : 1;
4224 unsigned : 1;
4225 unsigned : 1;
4226 unsigned : 1;
4227 unsigned : 1;
4228 unsigned : 1;
4229 unsigned : 1;
4230 unsigned : 1;
4232 } __WDTCONbits_t;
4234 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
4236 #define _SWDTEN 0x01
4237 #define _SWDTE 0x01
4238 #define _ULPSINK 0x02
4239 #define _ULPEN 0x04
4240 #define _DS 0x08
4241 #define _ULPLVL 0x20
4242 #define _LVDSTAT 0x40
4243 #define _REGSLP 0x80
4245 //==============================================================================
4248 //==============================================================================
4249 // ADCON1 Bits
4251 extern __at(0x0FC1) __sfr ADCON1;
4253 typedef union
4255 struct
4257 unsigned ADCS0 : 1;
4258 unsigned ADCS1 : 1;
4259 unsigned ADCS2 : 1;
4260 unsigned ACQT0 : 1;
4261 unsigned ACQT1 : 1;
4262 unsigned ACQT2 : 1;
4263 unsigned ADCAL : 1;
4264 unsigned ADFM : 1;
4267 struct
4269 unsigned ADCS : 3;
4270 unsigned : 5;
4273 struct
4275 unsigned : 3;
4276 unsigned ACQT : 3;
4277 unsigned : 2;
4279 } __ADCON1bits_t;
4281 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4283 #define _ADCS0 0x01
4284 #define _ADCS1 0x02
4285 #define _ADCS2 0x04
4286 #define _ACQT0 0x08
4287 #define _ACQT1 0x10
4288 #define _ACQT2 0x20
4289 #define _ADCAL 0x40
4290 #define _ADFM 0x80
4292 //==============================================================================
4295 //==============================================================================
4296 // ADCON0 Bits
4298 extern __at(0x0FC2) __sfr ADCON0;
4300 typedef union
4302 struct
4304 unsigned ADON : 1;
4305 unsigned GO_NOT_DONE : 1;
4306 unsigned CHS0 : 1;
4307 unsigned CHS1 : 1;
4308 unsigned CHS2 : 1;
4309 unsigned CHS3 : 1;
4310 unsigned VCFG0 : 1;
4311 unsigned VCFG1 : 1;
4314 struct
4316 unsigned : 1;
4317 unsigned GO_DONE : 1;
4318 unsigned : 1;
4319 unsigned : 1;
4320 unsigned : 1;
4321 unsigned : 1;
4322 unsigned : 1;
4323 unsigned : 1;
4326 struct
4328 unsigned : 1;
4329 unsigned DONE : 1;
4330 unsigned : 1;
4331 unsigned : 1;
4332 unsigned : 1;
4333 unsigned : 1;
4334 unsigned : 1;
4335 unsigned : 1;
4338 struct
4340 unsigned : 1;
4341 unsigned GO : 1;
4342 unsigned : 1;
4343 unsigned : 1;
4344 unsigned : 1;
4345 unsigned : 1;
4346 unsigned : 1;
4347 unsigned : 1;
4350 struct
4352 unsigned : 1;
4353 unsigned NOT_DONE : 1;
4354 unsigned : 1;
4355 unsigned : 1;
4356 unsigned : 1;
4357 unsigned : 1;
4358 unsigned : 1;
4359 unsigned : 1;
4362 struct
4364 unsigned : 2;
4365 unsigned CHS : 4;
4366 unsigned : 2;
4369 struct
4371 unsigned : 6;
4372 unsigned VCFG : 2;
4374 } __ADCON0bits_t;
4376 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4378 #define _ADON 0x01
4379 #define _GO_NOT_DONE 0x02
4380 #define _GO_DONE 0x02
4381 #define _DONE 0x02
4382 #define _GO 0x02
4383 #define _NOT_DONE 0x02
4384 #define _CHS0 0x04
4385 #define _CHS1 0x08
4386 #define _CHS2 0x10
4387 #define _CHS3 0x20
4388 #define _VCFG0 0x40
4389 #define _VCFG1 0x80
4391 //==============================================================================
4393 extern __at(0x0FC3) __sfr ADRES;
4394 extern __at(0x0FC3) __sfr ADRESL;
4395 extern __at(0x0FC4) __sfr ADRESH;
4397 //==============================================================================
4398 // SSP1CON2 Bits
4400 extern __at(0x0FC5) __sfr SSP1CON2;
4402 typedef union
4404 struct
4406 unsigned SEN : 1;
4407 unsigned RSEN : 1;
4408 unsigned PEN : 1;
4409 unsigned RCEN : 1;
4410 unsigned ACKEN : 1;
4411 unsigned ACKDT : 1;
4412 unsigned ACKSTAT : 1;
4413 unsigned GCEN : 1;
4416 struct
4418 unsigned : 1;
4419 unsigned ADMSK1 : 1;
4420 unsigned ADMSK2 : 1;
4421 unsigned ADMSK3 : 1;
4422 unsigned ADMSK4 : 1;
4423 unsigned ADMSK5 : 1;
4424 unsigned : 1;
4425 unsigned : 1;
4427 } __SSP1CON2bits_t;
4429 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4431 #define _SEN 0x01
4432 #define _RSEN 0x02
4433 #define _ADMSK1 0x02
4434 #define _PEN 0x04
4435 #define _ADMSK2 0x04
4436 #define _RCEN 0x08
4437 #define _ADMSK3 0x08
4438 #define _ACKEN 0x10
4439 #define _ADMSK4 0x10
4440 #define _ACKDT 0x20
4441 #define _ADMSK5 0x20
4442 #define _ACKSTAT 0x40
4443 #define _GCEN 0x80
4445 //==============================================================================
4448 //==============================================================================
4449 // SSPCON2 Bits
4451 extern __at(0x0FC5) __sfr SSPCON2;
4453 typedef union
4455 struct
4457 unsigned SEN : 1;
4458 unsigned RSEN : 1;
4459 unsigned PEN : 1;
4460 unsigned RCEN : 1;
4461 unsigned ACKEN : 1;
4462 unsigned ACKDT : 1;
4463 unsigned ACKSTAT : 1;
4464 unsigned GCEN : 1;
4467 struct
4469 unsigned : 1;
4470 unsigned ADMSK1 : 1;
4471 unsigned ADMSK2 : 1;
4472 unsigned ADMSK3 : 1;
4473 unsigned ADMSK4 : 1;
4474 unsigned ADMSK5 : 1;
4475 unsigned : 1;
4476 unsigned : 1;
4478 } __SSPCON2bits_t;
4480 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4482 #define _SSPCON2_SEN 0x01
4483 #define _SSPCON2_RSEN 0x02
4484 #define _SSPCON2_ADMSK1 0x02
4485 #define _SSPCON2_PEN 0x04
4486 #define _SSPCON2_ADMSK2 0x04
4487 #define _SSPCON2_RCEN 0x08
4488 #define _SSPCON2_ADMSK3 0x08
4489 #define _SSPCON2_ACKEN 0x10
4490 #define _SSPCON2_ADMSK4 0x10
4491 #define _SSPCON2_ACKDT 0x20
4492 #define _SSPCON2_ADMSK5 0x20
4493 #define _SSPCON2_ACKSTAT 0x40
4494 #define _SSPCON2_GCEN 0x80
4496 //==============================================================================
4499 //==============================================================================
4500 // SSP1CON1 Bits
4502 extern __at(0x0FC6) __sfr SSP1CON1;
4504 typedef union
4506 struct
4508 unsigned SSPM0 : 1;
4509 unsigned SSPM1 : 1;
4510 unsigned SSPM2 : 1;
4511 unsigned SSPM3 : 1;
4512 unsigned CKP : 1;
4513 unsigned SSPEN : 1;
4514 unsigned SSPOV : 1;
4515 unsigned WCOL : 1;
4518 struct
4520 unsigned SSPM : 4;
4521 unsigned : 4;
4523 } __SSP1CON1bits_t;
4525 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4527 #define _SSPM0 0x01
4528 #define _SSPM1 0x02
4529 #define _SSPM2 0x04
4530 #define _SSPM3 0x08
4531 #define _CKP 0x10
4532 #define _SSPEN 0x20
4533 #define _SSPOV 0x40
4534 #define _WCOL 0x80
4536 //==============================================================================
4539 //==============================================================================
4540 // SSPCON1 Bits
4542 extern __at(0x0FC6) __sfr SSPCON1;
4544 typedef union
4546 struct
4548 unsigned SSPM0 : 1;
4549 unsigned SSPM1 : 1;
4550 unsigned SSPM2 : 1;
4551 unsigned SSPM3 : 1;
4552 unsigned CKP : 1;
4553 unsigned SSPEN : 1;
4554 unsigned SSPOV : 1;
4555 unsigned WCOL : 1;
4558 struct
4560 unsigned SSPM : 4;
4561 unsigned : 4;
4563 } __SSPCON1bits_t;
4565 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4567 #define _SSPCON1_SSPM0 0x01
4568 #define _SSPCON1_SSPM1 0x02
4569 #define _SSPCON1_SSPM2 0x04
4570 #define _SSPCON1_SSPM3 0x08
4571 #define _SSPCON1_CKP 0x10
4572 #define _SSPCON1_SSPEN 0x20
4573 #define _SSPCON1_SSPOV 0x40
4574 #define _SSPCON1_WCOL 0x80
4576 //==============================================================================
4579 //==============================================================================
4580 // SSP1STAT Bits
4582 extern __at(0x0FC7) __sfr SSP1STAT;
4584 typedef union
4586 struct
4588 unsigned BF : 1;
4589 unsigned UA : 1;
4590 unsigned R_NOT_W : 1;
4591 unsigned S : 1;
4592 unsigned P : 1;
4593 unsigned D_NOT_A : 1;
4594 unsigned CKE : 1;
4595 unsigned SMP : 1;
4598 struct
4600 unsigned : 1;
4601 unsigned : 1;
4602 unsigned R : 1;
4603 unsigned I2C_START : 1;
4604 unsigned I2C_STOP : 1;
4605 unsigned D : 1;
4606 unsigned : 1;
4607 unsigned : 1;
4610 struct
4612 unsigned : 1;
4613 unsigned : 1;
4614 unsigned R_W : 1;
4615 unsigned : 1;
4616 unsigned : 1;
4617 unsigned D_A : 1;
4618 unsigned : 1;
4619 unsigned : 1;
4622 struct
4624 unsigned : 1;
4625 unsigned : 1;
4626 unsigned NOT_W : 1;
4627 unsigned : 1;
4628 unsigned : 1;
4629 unsigned NOT_A : 1;
4630 unsigned : 1;
4631 unsigned : 1;
4634 struct
4636 unsigned : 1;
4637 unsigned : 1;
4638 unsigned NOT_WRITE : 1;
4639 unsigned : 1;
4640 unsigned : 1;
4641 unsigned NOT_ADDRESS : 1;
4642 unsigned : 1;
4643 unsigned : 1;
4646 struct
4648 unsigned : 1;
4649 unsigned : 1;
4650 unsigned READ_WRITE : 1;
4651 unsigned : 1;
4652 unsigned : 1;
4653 unsigned DATA_ADDRESS : 1;
4654 unsigned : 1;
4655 unsigned : 1;
4658 struct
4660 unsigned : 1;
4661 unsigned : 1;
4662 unsigned I2C_READ : 1;
4663 unsigned : 1;
4664 unsigned : 1;
4665 unsigned I2C_DAT : 1;
4666 unsigned : 1;
4667 unsigned : 1;
4669 } __SSP1STATbits_t;
4671 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4673 #define _BF 0x01
4674 #define _UA 0x02
4675 #define _R_NOT_W 0x04
4676 #define _R 0x04
4677 #define _R_W 0x04
4678 #define _NOT_W 0x04
4679 #define _NOT_WRITE 0x04
4680 #define _READ_WRITE 0x04
4681 #define _I2C_READ 0x04
4682 #define _S 0x08
4683 #define _I2C_START 0x08
4684 #define _P 0x10
4685 #define _I2C_STOP 0x10
4686 #define _D_NOT_A 0x20
4687 #define _D 0x20
4688 #define _D_A 0x20
4689 #define _NOT_A 0x20
4690 #define _NOT_ADDRESS 0x20
4691 #define _DATA_ADDRESS 0x20
4692 #define _I2C_DAT 0x20
4693 #define _CKE 0x40
4694 #define _SMP 0x80
4696 //==============================================================================
4699 //==============================================================================
4700 // SSPSTAT Bits
4702 extern __at(0x0FC7) __sfr SSPSTAT;
4704 typedef union
4706 struct
4708 unsigned BF : 1;
4709 unsigned UA : 1;
4710 unsigned R_NOT_W : 1;
4711 unsigned S : 1;
4712 unsigned P : 1;
4713 unsigned D_NOT_A : 1;
4714 unsigned CKE : 1;
4715 unsigned SMP : 1;
4718 struct
4720 unsigned : 1;
4721 unsigned : 1;
4722 unsigned R : 1;
4723 unsigned I2C_START : 1;
4724 unsigned I2C_STOP : 1;
4725 unsigned D : 1;
4726 unsigned : 1;
4727 unsigned : 1;
4730 struct
4732 unsigned : 1;
4733 unsigned : 1;
4734 unsigned R_W : 1;
4735 unsigned : 1;
4736 unsigned : 1;
4737 unsigned D_A : 1;
4738 unsigned : 1;
4739 unsigned : 1;
4742 struct
4744 unsigned : 1;
4745 unsigned : 1;
4746 unsigned NOT_W : 1;
4747 unsigned : 1;
4748 unsigned : 1;
4749 unsigned NOT_A : 1;
4750 unsigned : 1;
4751 unsigned : 1;
4754 struct
4756 unsigned : 1;
4757 unsigned : 1;
4758 unsigned NOT_WRITE : 1;
4759 unsigned : 1;
4760 unsigned : 1;
4761 unsigned NOT_ADDRESS : 1;
4762 unsigned : 1;
4763 unsigned : 1;
4766 struct
4768 unsigned : 1;
4769 unsigned : 1;
4770 unsigned READ_WRITE : 1;
4771 unsigned : 1;
4772 unsigned : 1;
4773 unsigned DATA_ADDRESS : 1;
4774 unsigned : 1;
4775 unsigned : 1;
4778 struct
4780 unsigned : 1;
4781 unsigned : 1;
4782 unsigned I2C_READ : 1;
4783 unsigned : 1;
4784 unsigned : 1;
4785 unsigned I2C_DAT : 1;
4786 unsigned : 1;
4787 unsigned : 1;
4789 } __SSPSTATbits_t;
4791 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
4793 #define _SSPSTAT_BF 0x01
4794 #define _SSPSTAT_UA 0x02
4795 #define _SSPSTAT_R_NOT_W 0x04
4796 #define _SSPSTAT_R 0x04
4797 #define _SSPSTAT_R_W 0x04
4798 #define _SSPSTAT_NOT_W 0x04
4799 #define _SSPSTAT_NOT_WRITE 0x04
4800 #define _SSPSTAT_READ_WRITE 0x04
4801 #define _SSPSTAT_I2C_READ 0x04
4802 #define _SSPSTAT_S 0x08
4803 #define _SSPSTAT_I2C_START 0x08
4804 #define _SSPSTAT_P 0x10
4805 #define _SSPSTAT_I2C_STOP 0x10
4806 #define _SSPSTAT_D_NOT_A 0x20
4807 #define _SSPSTAT_D 0x20
4808 #define _SSPSTAT_D_A 0x20
4809 #define _SSPSTAT_NOT_A 0x20
4810 #define _SSPSTAT_NOT_ADDRESS 0x20
4811 #define _SSPSTAT_DATA_ADDRESS 0x20
4812 #define _SSPSTAT_I2C_DAT 0x20
4813 #define _SSPSTAT_CKE 0x40
4814 #define _SSPSTAT_SMP 0x80
4816 //==============================================================================
4819 //==============================================================================
4820 // SSP1ADD Bits
4822 extern __at(0x0FC8) __sfr SSP1ADD;
4824 typedef struct
4826 unsigned MSK0 : 1;
4827 unsigned MSK1 : 1;
4828 unsigned MSK2 : 1;
4829 unsigned MSK3 : 1;
4830 unsigned MSK4 : 1;
4831 unsigned MSK5 : 1;
4832 unsigned MSK6 : 1;
4833 unsigned MSK7 : 1;
4834 } __SSP1ADDbits_t;
4836 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
4838 #define _MSK0 0x01
4839 #define _MSK1 0x02
4840 #define _MSK2 0x04
4841 #define _MSK3 0x08
4842 #define _MSK4 0x10
4843 #define _MSK5 0x20
4844 #define _MSK6 0x40
4845 #define _MSK7 0x80
4847 //==============================================================================
4850 //==============================================================================
4851 // SSP1MSK Bits
4853 extern __at(0x0FC8) __sfr SSP1MSK;
4855 typedef struct
4857 unsigned MSK0 : 1;
4858 unsigned MSK1 : 1;
4859 unsigned MSK2 : 1;
4860 unsigned MSK3 : 1;
4861 unsigned MSK4 : 1;
4862 unsigned MSK5 : 1;
4863 unsigned MSK6 : 1;
4864 unsigned MSK7 : 1;
4865 } __SSP1MSKbits_t;
4867 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
4869 #define _SSP1MSK_MSK0 0x01
4870 #define _SSP1MSK_MSK1 0x02
4871 #define _SSP1MSK_MSK2 0x04
4872 #define _SSP1MSK_MSK3 0x08
4873 #define _SSP1MSK_MSK4 0x10
4874 #define _SSP1MSK_MSK5 0x20
4875 #define _SSP1MSK_MSK6 0x40
4876 #define _SSP1MSK_MSK7 0x80
4878 //==============================================================================
4881 //==============================================================================
4882 // SSPADD Bits
4884 extern __at(0x0FC8) __sfr SSPADD;
4886 typedef struct
4888 unsigned MSK0 : 1;
4889 unsigned MSK1 : 1;
4890 unsigned MSK2 : 1;
4891 unsigned MSK3 : 1;
4892 unsigned MSK4 : 1;
4893 unsigned MSK5 : 1;
4894 unsigned MSK6 : 1;
4895 unsigned MSK7 : 1;
4896 } __SSPADDbits_t;
4898 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
4900 #define _SSPADD_MSK0 0x01
4901 #define _SSPADD_MSK1 0x02
4902 #define _SSPADD_MSK2 0x04
4903 #define _SSPADD_MSK3 0x08
4904 #define _SSPADD_MSK4 0x10
4905 #define _SSPADD_MSK5 0x20
4906 #define _SSPADD_MSK6 0x40
4907 #define _SSPADD_MSK7 0x80
4909 //==============================================================================
4911 extern __at(0x0FC9) __sfr SSP1BUF;
4912 extern __at(0x0FC9) __sfr SSPBUF;
4914 //==============================================================================
4915 // T2CON Bits
4917 extern __at(0x0FCA) __sfr T2CON;
4919 typedef union
4921 struct
4923 unsigned T2CKPS0 : 1;
4924 unsigned T2CKPS1 : 1;
4925 unsigned TMR2ON : 1;
4926 unsigned T2OUTPS0 : 1;
4927 unsigned T2OUTPS1 : 1;
4928 unsigned T2OUTPS2 : 1;
4929 unsigned T2OUTPS3 : 1;
4930 unsigned : 1;
4933 struct
4935 unsigned T2CKPS : 2;
4936 unsigned : 6;
4939 struct
4941 unsigned : 3;
4942 unsigned T2OUTPS : 4;
4943 unsigned : 1;
4945 } __T2CONbits_t;
4947 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
4949 #define _T2CKPS0 0x01
4950 #define _T2CKPS1 0x02
4951 #define _TMR2ON 0x04
4952 #define _T2OUTPS0 0x08
4953 #define _T2OUTPS1 0x10
4954 #define _T2OUTPS2 0x20
4955 #define _T2OUTPS3 0x40
4957 //==============================================================================
4959 extern __at(0x0FCB) __sfr PR2;
4960 extern __at(0x0FCC) __sfr TMR2;
4962 //==============================================================================
4963 // T1CON Bits
4965 extern __at(0x0FCD) __sfr T1CON;
4967 typedef union
4969 struct
4971 unsigned TMR1ON : 1;
4972 unsigned RD16 : 1;
4973 unsigned T1SYNC : 1;
4974 unsigned T1OSCEN : 1;
4975 unsigned T1CKPS0 : 1;
4976 unsigned T1CKPS1 : 1;
4977 unsigned TMR1CS0 : 1;
4978 unsigned TMR1CS1 : 1;
4981 struct
4983 unsigned : 4;
4984 unsigned T1CKPS : 2;
4985 unsigned : 2;
4988 struct
4990 unsigned : 6;
4991 unsigned TMR1CS : 2;
4993 } __T1CONbits_t;
4995 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
4997 #define _TMR1ON 0x01
4998 #define _RD16 0x02
4999 #define _T1SYNC 0x04
5000 #define _T1OSCEN 0x08
5001 #define _T1CKPS0 0x10
5002 #define _T1CKPS1 0x20
5003 #define _TMR1CS0 0x40
5004 #define _TMR1CS1 0x80
5006 //==============================================================================
5008 extern __at(0x0FCE) __sfr TMR1;
5009 extern __at(0x0FCE) __sfr TMR1L;
5010 extern __at(0x0FCF) __sfr TMR1H;
5012 //==============================================================================
5013 // RCON Bits
5015 extern __at(0x0FD0) __sfr RCON;
5017 typedef union
5019 struct
5021 unsigned NOT_BOR : 1;
5022 unsigned NOT_POR : 1;
5023 unsigned NOT_PD : 1;
5024 unsigned NOT_TO : 1;
5025 unsigned NOT_RI : 1;
5026 unsigned NOT_CM : 1;
5027 unsigned : 1;
5028 unsigned IPEN : 1;
5031 struct
5033 unsigned BOR : 1;
5034 unsigned POR : 1;
5035 unsigned PD : 1;
5036 unsigned TO : 1;
5037 unsigned RI : 1;
5038 unsigned CM : 1;
5039 unsigned : 1;
5040 unsigned : 1;
5042 } __RCONbits_t;
5044 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5046 #define _NOT_BOR 0x01
5047 #define _BOR 0x01
5048 #define _NOT_POR 0x02
5049 #define _POR 0x02
5050 #define _NOT_PD 0x04
5051 #define _PD 0x04
5052 #define _NOT_TO 0x08
5053 #define _TO 0x08
5054 #define _NOT_RI 0x10
5055 #define _RI 0x10
5056 #define _NOT_CM 0x20
5057 #define _CM 0x20
5058 #define _IPEN 0x80
5060 //==============================================================================
5063 //==============================================================================
5064 // CM2CON Bits
5066 extern __at(0x0FD1) __sfr CM2CON;
5068 typedef union
5070 struct
5072 unsigned CCH0 : 1;
5073 unsigned CCH1 : 1;
5074 unsigned CREF : 1;
5075 unsigned EVPOL0 : 1;
5076 unsigned EVPOL1 : 1;
5077 unsigned CPOL : 1;
5078 unsigned COE : 1;
5079 unsigned CON : 1;
5082 struct
5084 unsigned CCH : 2;
5085 unsigned : 6;
5088 struct
5090 unsigned : 3;
5091 unsigned EVPOL : 2;
5092 unsigned : 3;
5094 } __CM2CONbits_t;
5096 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
5098 #define _CM2CON_CCH0 0x01
5099 #define _CM2CON_CCH1 0x02
5100 #define _CM2CON_CREF 0x04
5101 #define _CM2CON_EVPOL0 0x08
5102 #define _CM2CON_EVPOL1 0x10
5103 #define _CM2CON_CPOL 0x20
5104 #define _CM2CON_COE 0x40
5105 #define _CM2CON_CON 0x80
5107 //==============================================================================
5110 //==============================================================================
5111 // CM2CON1 Bits
5113 extern __at(0x0FD1) __sfr CM2CON1;
5115 typedef union
5117 struct
5119 unsigned CCH0 : 1;
5120 unsigned CCH1 : 1;
5121 unsigned CREF : 1;
5122 unsigned EVPOL0 : 1;
5123 unsigned EVPOL1 : 1;
5124 unsigned CPOL : 1;
5125 unsigned COE : 1;
5126 unsigned CON : 1;
5129 struct
5131 unsigned CCH : 2;
5132 unsigned : 6;
5135 struct
5137 unsigned : 3;
5138 unsigned EVPOL : 2;
5139 unsigned : 3;
5141 } __CM2CON1bits_t;
5143 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
5145 #define _CM2CON1_CCH0 0x01
5146 #define _CM2CON1_CCH1 0x02
5147 #define _CM2CON1_CREF 0x04
5148 #define _CM2CON1_EVPOL0 0x08
5149 #define _CM2CON1_EVPOL1 0x10
5150 #define _CM2CON1_CPOL 0x20
5151 #define _CM2CON1_COE 0x40
5152 #define _CM2CON1_CON 0x80
5154 //==============================================================================
5157 //==============================================================================
5158 // CM1CON Bits
5160 extern __at(0x0FD2) __sfr CM1CON;
5162 typedef union
5164 struct
5166 unsigned CCH0 : 1;
5167 unsigned CCH1 : 1;
5168 unsigned CREF : 1;
5169 unsigned EVPOL0 : 1;
5170 unsigned EVPOL1 : 1;
5171 unsigned CPOL : 1;
5172 unsigned COE : 1;
5173 unsigned CON : 1;
5176 struct
5178 unsigned CCH : 2;
5179 unsigned : 6;
5182 struct
5184 unsigned : 3;
5185 unsigned EVPOL : 2;
5186 unsigned : 3;
5188 } __CM1CONbits_t;
5190 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
5192 #define _CCH0 0x01
5193 #define _CCH1 0x02
5194 #define _CREF 0x04
5195 #define _EVPOL0 0x08
5196 #define _EVPOL1 0x10
5197 #define _CPOL 0x20
5198 #define _COE 0x40
5199 #define _CON 0x80
5201 //==============================================================================
5204 //==============================================================================
5205 // CM1CON1 Bits
5207 extern __at(0x0FD2) __sfr CM1CON1;
5209 typedef union
5211 struct
5213 unsigned CCH0 : 1;
5214 unsigned CCH1 : 1;
5215 unsigned CREF : 1;
5216 unsigned EVPOL0 : 1;
5217 unsigned EVPOL1 : 1;
5218 unsigned CPOL : 1;
5219 unsigned COE : 1;
5220 unsigned CON : 1;
5223 struct
5225 unsigned CCH : 2;
5226 unsigned : 6;
5229 struct
5231 unsigned : 3;
5232 unsigned EVPOL : 2;
5233 unsigned : 3;
5235 } __CM1CON1bits_t;
5237 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
5239 #define _CM1CON1_CCH0 0x01
5240 #define _CM1CON1_CCH1 0x02
5241 #define _CM1CON1_CREF 0x04
5242 #define _CM1CON1_EVPOL0 0x08
5243 #define _CM1CON1_EVPOL1 0x10
5244 #define _CM1CON1_CPOL 0x20
5245 #define _CM1CON1_COE 0x40
5246 #define _CM1CON1_CON 0x80
5248 //==============================================================================
5251 //==============================================================================
5252 // OSCCON Bits
5254 extern __at(0x0FD3) __sfr OSCCON;
5256 typedef union
5258 struct
5260 unsigned SCS0 : 1;
5261 unsigned SCS1 : 1;
5262 unsigned : 1;
5263 unsigned OSTS : 1;
5264 unsigned IRCF0 : 1;
5265 unsigned IRCF1 : 1;
5266 unsigned IRCF2 : 1;
5267 unsigned IDLEN : 1;
5270 struct
5272 unsigned SCS : 2;
5273 unsigned : 6;
5276 struct
5278 unsigned : 4;
5279 unsigned IRCF : 3;
5280 unsigned : 1;
5282 } __OSCCONbits_t;
5284 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5286 #define _SCS0 0x01
5287 #define _SCS1 0x02
5288 #define _OSTS 0x08
5289 #define _IRCF0 0x10
5290 #define _IRCF1 0x20
5291 #define _IRCF2 0x40
5292 #define _IDLEN 0x80
5294 //==============================================================================
5297 //==============================================================================
5298 // T0CON Bits
5300 extern __at(0x0FD5) __sfr T0CON;
5302 typedef union
5304 struct
5306 unsigned T0PS0 : 1;
5307 unsigned T0PS1 : 1;
5308 unsigned T0PS2 : 1;
5309 unsigned PSA : 1;
5310 unsigned T0SE : 1;
5311 unsigned T0CS : 1;
5312 unsigned T08BIT : 1;
5313 unsigned TMR0ON : 1;
5316 struct
5318 unsigned T0PS : 3;
5319 unsigned : 5;
5321 } __T0CONbits_t;
5323 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5325 #define _T0PS0 0x01
5326 #define _T0PS1 0x02
5327 #define _T0PS2 0x04
5328 #define _PSA 0x08
5329 #define _T0SE 0x10
5330 #define _T0CS 0x20
5331 #define _T08BIT 0x40
5332 #define _TMR0ON 0x80
5334 //==============================================================================
5336 extern __at(0x0FD6) __sfr TMR0;
5337 extern __at(0x0FD6) __sfr TMR0L;
5338 extern __at(0x0FD7) __sfr TMR0H;
5340 //==============================================================================
5341 // STATUS Bits
5343 extern __at(0x0FD8) __sfr STATUS;
5345 typedef struct
5347 unsigned C : 1;
5348 unsigned DC : 1;
5349 unsigned Z : 1;
5350 unsigned OV : 1;
5351 unsigned N : 1;
5352 unsigned : 1;
5353 unsigned : 1;
5354 unsigned : 1;
5355 } __STATUSbits_t;
5357 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5359 #define _C 0x01
5360 #define _DC 0x02
5361 #define _Z 0x04
5362 #define _OV 0x08
5363 #define _N 0x10
5365 //==============================================================================
5367 extern __at(0x0FD9) __sfr FSR2L;
5368 extern __at(0x0FDA) __sfr FSR2H;
5369 extern __at(0x0FDB) __sfr PLUSW2;
5370 extern __at(0x0FDC) __sfr PREINC2;
5371 extern __at(0x0FDD) __sfr POSTDEC2;
5372 extern __at(0x0FDE) __sfr POSTINC2;
5373 extern __at(0x0FDF) __sfr INDF2;
5374 extern __at(0x0FE0) __sfr BSR;
5375 extern __at(0x0FE1) __sfr FSR1L;
5376 extern __at(0x0FE2) __sfr FSR1H;
5377 extern __at(0x0FE3) __sfr PLUSW1;
5378 extern __at(0x0FE4) __sfr PREINC1;
5379 extern __at(0x0FE5) __sfr POSTDEC1;
5380 extern __at(0x0FE6) __sfr POSTINC1;
5381 extern __at(0x0FE7) __sfr INDF1;
5382 extern __at(0x0FE8) __sfr WREG;
5383 extern __at(0x0FE9) __sfr FSR0L;
5384 extern __at(0x0FEA) __sfr FSR0H;
5385 extern __at(0x0FEB) __sfr PLUSW0;
5386 extern __at(0x0FEC) __sfr PREINC0;
5387 extern __at(0x0FED) __sfr POSTDEC0;
5388 extern __at(0x0FEE) __sfr POSTINC0;
5389 extern __at(0x0FEF) __sfr INDF0;
5391 //==============================================================================
5392 // INTCON3 Bits
5394 extern __at(0x0FF0) __sfr INTCON3;
5396 typedef union
5398 struct
5400 unsigned INT1IF : 1;
5401 unsigned INT2IF : 1;
5402 unsigned INT3IF : 1;
5403 unsigned INT1IE : 1;
5404 unsigned INT2IE : 1;
5405 unsigned INT3IE : 1;
5406 unsigned INT1IP : 1;
5407 unsigned INT2IP : 1;
5410 struct
5412 unsigned INT1F : 1;
5413 unsigned INT2F : 1;
5414 unsigned INT3F : 1;
5415 unsigned INT1E : 1;
5416 unsigned INT2E : 1;
5417 unsigned INT3E : 1;
5418 unsigned INT1P : 1;
5419 unsigned INT2P : 1;
5421 } __INTCON3bits_t;
5423 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5425 #define _INT1IF 0x01
5426 #define _INT1F 0x01
5427 #define _INT2IF 0x02
5428 #define _INT2F 0x02
5429 #define _INT3IF 0x04
5430 #define _INT3F 0x04
5431 #define _INT1IE 0x08
5432 #define _INT1E 0x08
5433 #define _INT2IE 0x10
5434 #define _INT2E 0x10
5435 #define _INT3IE 0x20
5436 #define _INT3E 0x20
5437 #define _INT1IP 0x40
5438 #define _INT1P 0x40
5439 #define _INT2IP 0x80
5440 #define _INT2P 0x80
5442 //==============================================================================
5445 //==============================================================================
5446 // INTCON2 Bits
5448 extern __at(0x0FF1) __sfr INTCON2;
5450 typedef union
5452 struct
5454 unsigned RBIP : 1;
5455 unsigned INT3IP : 1;
5456 unsigned TMR0IP : 1;
5457 unsigned INTEDG3 : 1;
5458 unsigned INTEDG2 : 1;
5459 unsigned INTEDG1 : 1;
5460 unsigned INTEDG0 : 1;
5461 unsigned NOT_RBPU : 1;
5464 struct
5466 unsigned : 1;
5467 unsigned INT3P : 1;
5468 unsigned T0IP : 1;
5469 unsigned : 1;
5470 unsigned : 1;
5471 unsigned : 1;
5472 unsigned : 1;
5473 unsigned RBPU : 1;
5475 } __INTCON2bits_t;
5477 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5479 #define _RBIP 0x01
5480 #define _INT3IP 0x02
5481 #define _INT3P 0x02
5482 #define _TMR0IP 0x04
5483 #define _T0IP 0x04
5484 #define _INTEDG3 0x08
5485 #define _INTEDG2 0x10
5486 #define _INTEDG1 0x20
5487 #define _INTEDG0 0x40
5488 #define _NOT_RBPU 0x80
5489 #define _RBPU 0x80
5491 //==============================================================================
5494 //==============================================================================
5495 // INTCON Bits
5497 extern __at(0x0FF2) __sfr INTCON;
5499 typedef union
5501 struct
5503 unsigned RBIF : 1;
5504 unsigned INT0IF : 1;
5505 unsigned TMR0IF : 1;
5506 unsigned RBIE : 1;
5507 unsigned INT0IE : 1;
5508 unsigned TMR0IE : 1;
5509 unsigned PEIE_GIEL : 1;
5510 unsigned GIE_GIEH : 1;
5513 struct
5515 unsigned : 1;
5516 unsigned INT0F : 1;
5517 unsigned T0IF : 1;
5518 unsigned : 1;
5519 unsigned INT0E : 1;
5520 unsigned T0IE : 1;
5521 unsigned PEIE : 1;
5522 unsigned GIE : 1;
5525 struct
5527 unsigned : 1;
5528 unsigned : 1;
5529 unsigned : 1;
5530 unsigned : 1;
5531 unsigned : 1;
5532 unsigned : 1;
5533 unsigned GIEL : 1;
5534 unsigned GIEH : 1;
5536 } __INTCONbits_t;
5538 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5540 #define _RBIF 0x01
5541 #define _INT0IF 0x02
5542 #define _INT0F 0x02
5543 #define _TMR0IF 0x04
5544 #define _T0IF 0x04
5545 #define _RBIE 0x08
5546 #define _INT0IE 0x10
5547 #define _INT0E 0x10
5548 #define _TMR0IE 0x20
5549 #define _T0IE 0x20
5550 #define _PEIE_GIEL 0x40
5551 #define _PEIE 0x40
5552 #define _GIEL 0x40
5553 #define _GIE_GIEH 0x80
5554 #define _GIE 0x80
5555 #define _GIEH 0x80
5557 //==============================================================================
5559 extern __at(0x0FF3) __sfr PROD;
5560 extern __at(0x0FF3) __sfr PRODL;
5561 extern __at(0x0FF4) __sfr PRODH;
5562 extern __at(0x0FF5) __sfr TABLAT;
5563 extern __at(0x0FF6) __sfr TBLPTR;
5564 extern __at(0x0FF6) __sfr TBLPTRL;
5565 extern __at(0x0FF7) __sfr TBLPTRH;
5566 extern __at(0x0FF8) __sfr TBLPTRU;
5567 extern __at(0x0FF9) __sfr PC;
5568 extern __at(0x0FF9) __sfr PCL;
5569 extern __at(0x0FFA) __sfr PCLATH;
5570 extern __at(0x0FFB) __sfr PCLATU;
5572 //==============================================================================
5573 // STKPTR Bits
5575 extern __at(0x0FFC) __sfr STKPTR;
5577 typedef union
5579 struct
5581 unsigned SP0 : 1;
5582 unsigned SP1 : 1;
5583 unsigned SP2 : 1;
5584 unsigned SP3 : 1;
5585 unsigned SP4 : 1;
5586 unsigned : 1;
5587 unsigned STKUNF : 1;
5588 unsigned STKFUL : 1;
5591 struct
5593 unsigned : 1;
5594 unsigned : 1;
5595 unsigned : 1;
5596 unsigned : 1;
5597 unsigned : 1;
5598 unsigned : 1;
5599 unsigned : 1;
5600 unsigned STKOVF : 1;
5603 struct
5605 unsigned SP : 5;
5606 unsigned : 3;
5608 } __STKPTRbits_t;
5610 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5612 #define _SP0 0x01
5613 #define _SP1 0x02
5614 #define _SP2 0x04
5615 #define _SP3 0x08
5616 #define _SP4 0x10
5617 #define _STKUNF 0x40
5618 #define _STKFUL 0x80
5619 #define _STKOVF 0x80
5621 //==============================================================================
5623 extern __at(0x0FFD) __sfr TOS;
5624 extern __at(0x0FFD) __sfr TOSL;
5625 extern __at(0x0FFE) __sfr TOSH;
5626 extern __at(0x0FFF) __sfr TOSU;
5628 //==============================================================================
5630 // Configuration Addresses
5632 //==============================================================================
5634 #define __CONFIG1L 0x007FF8
5635 #define __CONFIG1H 0x007FF9
5636 #define __CONFIG2L 0x007FFA
5637 #define __CONFIG2H 0x007FFB
5638 #define __CONFIG3L 0x007FFC
5639 #define __CONFIG3H 0x007FFD
5640 #define __CONFIG4L 0x007FFE
5641 #define __CONFIG4H 0x007FFF
5643 //==============================================================================
5645 #endif // #ifndef __PIC18LF45J11_H__