struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18lf44j50.h
blob872e621137be17ef94b6859a858dfd79df7722b7
1 /*
2 * This declarations of the PIC18LF44J50 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 __PIC18LF44J50_H__
26 #define __PIC18LF44J50_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(0x0ED7) __sfr RPOR17;
51 extern __at(0x0ED8) __sfr RPOR18;
52 extern __at(0x0ED9) __sfr RPOR19;
53 extern __at(0x0EDA) __sfr RPOR20;
54 extern __at(0x0EDB) __sfr RPOR21;
55 extern __at(0x0EDC) __sfr RPOR22;
56 extern __at(0x0EDD) __sfr RPOR23;
57 extern __at(0x0EDE) __sfr RPOR24;
58 extern __at(0x0EE7) __sfr RPINR1;
59 extern __at(0x0EE8) __sfr RPINR2;
60 extern __at(0x0EE9) __sfr RPINR3;
61 extern __at(0x0EEA) __sfr RPINR4;
62 extern __at(0x0EEC) __sfr RPINR6;
63 extern __at(0x0EED) __sfr RPINR7;
64 extern __at(0x0EEE) __sfr RPINR8;
65 extern __at(0x0EF2) __sfr RPINR12;
66 extern __at(0x0EF3) __sfr RPINR13;
67 extern __at(0x0EF6) __sfr RPINR16;
68 extern __at(0x0EF7) __sfr RPINR17;
69 extern __at(0x0EFB) __sfr RPINR21;
70 extern __at(0x0EFC) __sfr RPINR22;
71 extern __at(0x0EFD) __sfr RPINR23;
72 extern __at(0x0EFE) __sfr RPINR24;
74 //==============================================================================
75 // PPSCON Bits
77 extern __at(0x0EFF) __sfr PPSCON;
79 typedef struct
81 unsigned IOLOCK : 1;
82 unsigned : 1;
83 unsigned : 1;
84 unsigned : 1;
85 unsigned : 1;
86 unsigned : 1;
87 unsigned : 1;
88 unsigned : 1;
89 } __PPSCONbits_t;
91 extern __at(0x0EFF) volatile __PPSCONbits_t PPSCONbits;
93 #define _IOLOCK 0x01
95 //==============================================================================
98 //==============================================================================
99 // UEP0 Bits
101 extern __at(0x0F26) __sfr UEP0;
103 typedef struct
105 unsigned EPSTALL : 1;
106 unsigned EPINEN : 1;
107 unsigned EPOUTEN : 1;
108 unsigned EPCONDIS : 1;
109 unsigned EPHSHK : 1;
110 unsigned : 1;
111 unsigned : 1;
112 unsigned : 1;
113 } __UEP0bits_t;
115 extern __at(0x0F26) volatile __UEP0bits_t UEP0bits;
117 #define _EPSTALL 0x01
118 #define _EPINEN 0x02
119 #define _EPOUTEN 0x04
120 #define _EPCONDIS 0x08
121 #define _EPHSHK 0x10
123 //==============================================================================
126 //==============================================================================
127 // UEP1 Bits
129 extern __at(0x0F27) __sfr UEP1;
131 typedef struct
133 unsigned EPSTALL : 1;
134 unsigned EPINEN : 1;
135 unsigned EPOUTEN : 1;
136 unsigned EPCONDIS : 1;
137 unsigned EPHSHK : 1;
138 unsigned : 1;
139 unsigned : 1;
140 unsigned : 1;
141 } __UEP1bits_t;
143 extern __at(0x0F27) volatile __UEP1bits_t UEP1bits;
145 #define _UEP1_EPSTALL 0x01
146 #define _UEP1_EPINEN 0x02
147 #define _UEP1_EPOUTEN 0x04
148 #define _UEP1_EPCONDIS 0x08
149 #define _UEP1_EPHSHK 0x10
151 //==============================================================================
154 //==============================================================================
155 // UEP2 Bits
157 extern __at(0x0F28) __sfr UEP2;
159 typedef struct
161 unsigned EPSTALL : 1;
162 unsigned EPINEN : 1;
163 unsigned EPOUTEN : 1;
164 unsigned EPCONDIS : 1;
165 unsigned EPHSHK : 1;
166 unsigned : 1;
167 unsigned : 1;
168 unsigned : 1;
169 } __UEP2bits_t;
171 extern __at(0x0F28) volatile __UEP2bits_t UEP2bits;
173 #define _UEP2_EPSTALL 0x01
174 #define _UEP2_EPINEN 0x02
175 #define _UEP2_EPOUTEN 0x04
176 #define _UEP2_EPCONDIS 0x08
177 #define _UEP2_EPHSHK 0x10
179 //==============================================================================
182 //==============================================================================
183 // UEP3 Bits
185 extern __at(0x0F29) __sfr UEP3;
187 typedef struct
189 unsigned EPSTALL : 1;
190 unsigned EPINEN : 1;
191 unsigned EPOUTEN : 1;
192 unsigned EPCONDIS : 1;
193 unsigned EPHSHK : 1;
194 unsigned : 1;
195 unsigned : 1;
196 unsigned : 1;
197 } __UEP3bits_t;
199 extern __at(0x0F29) volatile __UEP3bits_t UEP3bits;
201 #define _UEP3_EPSTALL 0x01
202 #define _UEP3_EPINEN 0x02
203 #define _UEP3_EPOUTEN 0x04
204 #define _UEP3_EPCONDIS 0x08
205 #define _UEP3_EPHSHK 0x10
207 //==============================================================================
210 //==============================================================================
211 // UEP4 Bits
213 extern __at(0x0F2A) __sfr UEP4;
215 typedef struct
217 unsigned EPSTALL : 1;
218 unsigned EPINEN : 1;
219 unsigned EPOUTEN : 1;
220 unsigned EPCONDIS : 1;
221 unsigned EPHSHK : 1;
222 unsigned : 1;
223 unsigned : 1;
224 unsigned : 1;
225 } __UEP4bits_t;
227 extern __at(0x0F2A) volatile __UEP4bits_t UEP4bits;
229 #define _UEP4_EPSTALL 0x01
230 #define _UEP4_EPINEN 0x02
231 #define _UEP4_EPOUTEN 0x04
232 #define _UEP4_EPCONDIS 0x08
233 #define _UEP4_EPHSHK 0x10
235 //==============================================================================
238 //==============================================================================
239 // UEP5 Bits
241 extern __at(0x0F2B) __sfr UEP5;
243 typedef struct
245 unsigned EPSTALL : 1;
246 unsigned EPINEN : 1;
247 unsigned EPOUTEN : 1;
248 unsigned EPCONDIS : 1;
249 unsigned EPHSHK : 1;
250 unsigned : 1;
251 unsigned : 1;
252 unsigned : 1;
253 } __UEP5bits_t;
255 extern __at(0x0F2B) volatile __UEP5bits_t UEP5bits;
257 #define _UEP5_EPSTALL 0x01
258 #define _UEP5_EPINEN 0x02
259 #define _UEP5_EPOUTEN 0x04
260 #define _UEP5_EPCONDIS 0x08
261 #define _UEP5_EPHSHK 0x10
263 //==============================================================================
266 //==============================================================================
267 // UEP6 Bits
269 extern __at(0x0F2C) __sfr UEP6;
271 typedef struct
273 unsigned EPSTALL : 1;
274 unsigned EPINEN : 1;
275 unsigned EPOUTEN : 1;
276 unsigned EPCONDIS : 1;
277 unsigned EPHSHK : 1;
278 unsigned : 1;
279 unsigned : 1;
280 unsigned : 1;
281 } __UEP6bits_t;
283 extern __at(0x0F2C) volatile __UEP6bits_t UEP6bits;
285 #define _UEP6_EPSTALL 0x01
286 #define _UEP6_EPINEN 0x02
287 #define _UEP6_EPOUTEN 0x04
288 #define _UEP6_EPCONDIS 0x08
289 #define _UEP6_EPHSHK 0x10
291 //==============================================================================
294 //==============================================================================
295 // UEP7 Bits
297 extern __at(0x0F2D) __sfr UEP7;
299 typedef struct
301 unsigned EPSTALL : 1;
302 unsigned EPINEN : 1;
303 unsigned EPOUTEN : 1;
304 unsigned EPCONDIS : 1;
305 unsigned EPHSHK : 1;
306 unsigned : 1;
307 unsigned : 1;
308 unsigned : 1;
309 } __UEP7bits_t;
311 extern __at(0x0F2D) volatile __UEP7bits_t UEP7bits;
313 #define _UEP7_EPSTALL 0x01
314 #define _UEP7_EPINEN 0x02
315 #define _UEP7_EPOUTEN 0x04
316 #define _UEP7_EPCONDIS 0x08
317 #define _UEP7_EPHSHK 0x10
319 //==============================================================================
322 //==============================================================================
323 // UEP8 Bits
325 extern __at(0x0F2E) __sfr UEP8;
327 typedef struct
329 unsigned EPSTALL : 1;
330 unsigned EPINEN : 1;
331 unsigned EPOUTEN : 1;
332 unsigned EPCONDIS : 1;
333 unsigned EPHSHK : 1;
334 unsigned : 1;
335 unsigned : 1;
336 unsigned : 1;
337 } __UEP8bits_t;
339 extern __at(0x0F2E) volatile __UEP8bits_t UEP8bits;
341 #define _UEP8_EPSTALL 0x01
342 #define _UEP8_EPINEN 0x02
343 #define _UEP8_EPOUTEN 0x04
344 #define _UEP8_EPCONDIS 0x08
345 #define _UEP8_EPHSHK 0x10
347 //==============================================================================
350 //==============================================================================
351 // UEP9 Bits
353 extern __at(0x0F2F) __sfr UEP9;
355 typedef struct
357 unsigned EPSTALL : 1;
358 unsigned EPINEN : 1;
359 unsigned EPOUTEN : 1;
360 unsigned EPCONDIS : 1;
361 unsigned EPHSHK : 1;
362 unsigned : 1;
363 unsigned : 1;
364 unsigned : 1;
365 } __UEP9bits_t;
367 extern __at(0x0F2F) volatile __UEP9bits_t UEP9bits;
369 #define _UEP9_EPSTALL 0x01
370 #define _UEP9_EPINEN 0x02
371 #define _UEP9_EPOUTEN 0x04
372 #define _UEP9_EPCONDIS 0x08
373 #define _UEP9_EPHSHK 0x10
375 //==============================================================================
378 //==============================================================================
379 // UEP10 Bits
381 extern __at(0x0F30) __sfr UEP10;
383 typedef struct
385 unsigned EPSTALL : 1;
386 unsigned EPINEN : 1;
387 unsigned EPOUTEN : 1;
388 unsigned EPCONDIS : 1;
389 unsigned EPHSHK : 1;
390 unsigned : 1;
391 unsigned : 1;
392 unsigned : 1;
393 } __UEP10bits_t;
395 extern __at(0x0F30) volatile __UEP10bits_t UEP10bits;
397 #define _UEP10_EPSTALL 0x01
398 #define _UEP10_EPINEN 0x02
399 #define _UEP10_EPOUTEN 0x04
400 #define _UEP10_EPCONDIS 0x08
401 #define _UEP10_EPHSHK 0x10
403 //==============================================================================
406 //==============================================================================
407 // UEP11 Bits
409 extern __at(0x0F31) __sfr UEP11;
411 typedef struct
413 unsigned EPSTALL : 1;
414 unsigned EPINEN : 1;
415 unsigned EPOUTEN : 1;
416 unsigned EPCONDIS : 1;
417 unsigned EPHSHK : 1;
418 unsigned : 1;
419 unsigned : 1;
420 unsigned : 1;
421 } __UEP11bits_t;
423 extern __at(0x0F31) volatile __UEP11bits_t UEP11bits;
425 #define _UEP11_EPSTALL 0x01
426 #define _UEP11_EPINEN 0x02
427 #define _UEP11_EPOUTEN 0x04
428 #define _UEP11_EPCONDIS 0x08
429 #define _UEP11_EPHSHK 0x10
431 //==============================================================================
434 //==============================================================================
435 // UEP12 Bits
437 extern __at(0x0F32) __sfr UEP12;
439 typedef struct
441 unsigned EPSTALL : 1;
442 unsigned EPINEN : 1;
443 unsigned EPOUTEN : 1;
444 unsigned EPCONDIS : 1;
445 unsigned EPHSHK : 1;
446 unsigned : 1;
447 unsigned : 1;
448 unsigned : 1;
449 } __UEP12bits_t;
451 extern __at(0x0F32) volatile __UEP12bits_t UEP12bits;
453 #define _UEP12_EPSTALL 0x01
454 #define _UEP12_EPINEN 0x02
455 #define _UEP12_EPOUTEN 0x04
456 #define _UEP12_EPCONDIS 0x08
457 #define _UEP12_EPHSHK 0x10
459 //==============================================================================
462 //==============================================================================
463 // UEP13 Bits
465 extern __at(0x0F33) __sfr UEP13;
467 typedef struct
469 unsigned EPSTALL : 1;
470 unsigned EPINEN : 1;
471 unsigned EPOUTEN : 1;
472 unsigned EPCONDIS : 1;
473 unsigned EPHSHK : 1;
474 unsigned : 1;
475 unsigned : 1;
476 unsigned : 1;
477 } __UEP13bits_t;
479 extern __at(0x0F33) volatile __UEP13bits_t UEP13bits;
481 #define _UEP13_EPSTALL 0x01
482 #define _UEP13_EPINEN 0x02
483 #define _UEP13_EPOUTEN 0x04
484 #define _UEP13_EPCONDIS 0x08
485 #define _UEP13_EPHSHK 0x10
487 //==============================================================================
490 //==============================================================================
491 // UEP14 Bits
493 extern __at(0x0F34) __sfr UEP14;
495 typedef struct
497 unsigned EPSTALL : 1;
498 unsigned EPINEN : 1;
499 unsigned EPOUTEN : 1;
500 unsigned EPCONDIS : 1;
501 unsigned EPHSHK : 1;
502 unsigned : 1;
503 unsigned : 1;
504 unsigned : 1;
505 } __UEP14bits_t;
507 extern __at(0x0F34) volatile __UEP14bits_t UEP14bits;
509 #define _UEP14_EPSTALL 0x01
510 #define _UEP14_EPINEN 0x02
511 #define _UEP14_EPOUTEN 0x04
512 #define _UEP14_EPCONDIS 0x08
513 #define _UEP14_EPHSHK 0x10
515 //==============================================================================
518 //==============================================================================
519 // UEP15 Bits
521 extern __at(0x0F35) __sfr UEP15;
523 typedef struct
525 unsigned EPSTALL : 1;
526 unsigned EPINEN : 1;
527 unsigned EPOUTEN : 1;
528 unsigned EPCONDIS : 1;
529 unsigned EPHSHK : 1;
530 unsigned : 1;
531 unsigned : 1;
532 unsigned : 1;
533 } __UEP15bits_t;
535 extern __at(0x0F35) volatile __UEP15bits_t UEP15bits;
537 #define _UEP15_EPSTALL 0x01
538 #define _UEP15_EPINEN 0x02
539 #define _UEP15_EPOUTEN 0x04
540 #define _UEP15_EPCONDIS 0x08
541 #define _UEP15_EPHSHK 0x10
543 //==============================================================================
546 //==============================================================================
547 // UIE Bits
549 extern __at(0x0F36) __sfr UIE;
551 typedef struct
553 unsigned URSTIE : 1;
554 unsigned UERRIE : 1;
555 unsigned ACTVIE : 1;
556 unsigned TRNIE : 1;
557 unsigned IDLEIE : 1;
558 unsigned STALLIE : 1;
559 unsigned SOFIE : 1;
560 unsigned : 1;
561 } __UIEbits_t;
563 extern __at(0x0F36) volatile __UIEbits_t UIEbits;
565 #define _URSTIE 0x01
566 #define _UERRIE 0x02
567 #define _ACTVIE 0x04
568 #define _TRNIE 0x08
569 #define _IDLEIE 0x10
570 #define _STALLIE 0x20
571 #define _SOFIE 0x40
573 //==============================================================================
576 //==============================================================================
577 // UEIE Bits
579 extern __at(0x0F37) __sfr UEIE;
581 typedef struct
583 unsigned PIDEE : 1;
584 unsigned CRC5EE : 1;
585 unsigned CRC16EE : 1;
586 unsigned DFN8EE : 1;
587 unsigned BTOEE : 1;
588 unsigned : 1;
589 unsigned : 1;
590 unsigned BTSEE : 1;
591 } __UEIEbits_t;
593 extern __at(0x0F37) volatile __UEIEbits_t UEIEbits;
595 #define _PIDEE 0x01
596 #define _CRC5EE 0x02
597 #define _CRC16EE 0x04
598 #define _DFN8EE 0x08
599 #define _BTOEE 0x10
600 #define _BTSEE 0x80
602 //==============================================================================
605 //==============================================================================
606 // UADDR Bits
608 extern __at(0x0F38) __sfr UADDR;
610 typedef union
612 struct
614 unsigned ADDR0 : 1;
615 unsigned ADDR1 : 1;
616 unsigned ADDR2 : 1;
617 unsigned ADDR3 : 1;
618 unsigned ADDR4 : 1;
619 unsigned ADDR5 : 1;
620 unsigned ADDR6 : 1;
621 unsigned : 1;
624 struct
626 unsigned ADDR : 7;
627 unsigned : 1;
629 } __UADDRbits_t;
631 extern __at(0x0F38) volatile __UADDRbits_t UADDRbits;
633 #define _ADDR0 0x01
634 #define _ADDR1 0x02
635 #define _ADDR2 0x04
636 #define _ADDR3 0x08
637 #define _ADDR4 0x10
638 #define _ADDR5 0x20
639 #define _ADDR6 0x40
641 //==============================================================================
644 //==============================================================================
645 // UCFG Bits
647 extern __at(0x0F39) __sfr UCFG;
649 typedef union
651 struct
653 unsigned PPB0 : 1;
654 unsigned PPB1 : 1;
655 unsigned FSEN : 1;
656 unsigned UTRDIS : 1;
657 unsigned UPUEN : 1;
658 unsigned : 1;
659 unsigned UOEMON : 1;
660 unsigned UTEYE : 1;
663 struct
665 unsigned PPB : 2;
666 unsigned : 6;
668 } __UCFGbits_t;
670 extern __at(0x0F39) volatile __UCFGbits_t UCFGbits;
672 #define _PPB0 0x01
673 #define _PPB1 0x02
674 #define _FSEN 0x04
675 #define _UTRDIS 0x08
676 #define _UPUEN 0x10
677 #define _UOEMON 0x40
678 #define _UTEYE 0x80
680 //==============================================================================
683 //==============================================================================
684 // PADCFG1 Bits
686 extern __at(0x0F3C) __sfr PADCFG1;
688 typedef union
690 struct
692 unsigned PMPTTL : 1;
693 unsigned RTSECSEL0 : 1;
694 unsigned RTSECSEL1 : 1;
695 unsigned : 1;
696 unsigned : 1;
697 unsigned : 1;
698 unsigned : 1;
699 unsigned : 1;
702 struct
704 unsigned : 1;
705 unsigned RTSECSEL : 2;
706 unsigned : 5;
708 } __PADCFG1bits_t;
710 extern __at(0x0F3C) volatile __PADCFG1bits_t PADCFG1bits;
712 #define _PMPTTL 0x01
713 #define _RTSECSEL0 0x02
714 #define _RTSECSEL1 0x04
716 //==============================================================================
719 //==============================================================================
720 // REFOCON Bits
722 extern __at(0x0F3D) __sfr REFOCON;
724 typedef union
726 struct
728 unsigned RODIV0 : 1;
729 unsigned RODIV1 : 1;
730 unsigned RODIV2 : 1;
731 unsigned RODIV3 : 1;
732 unsigned ROSEL : 1;
733 unsigned ROSSLP : 1;
734 unsigned : 1;
735 unsigned ROON : 1;
738 struct
740 unsigned RODIV : 4;
741 unsigned : 4;
743 } __REFOCONbits_t;
745 extern __at(0x0F3D) volatile __REFOCONbits_t REFOCONbits;
747 #define _RODIV0 0x01
748 #define _RODIV1 0x02
749 #define _RODIV2 0x04
750 #define _RODIV3 0x08
751 #define _ROSEL 0x10
752 #define _ROSSLP 0x20
753 #define _ROON 0x80
755 //==============================================================================
758 //==============================================================================
759 // RTCCAL Bits
761 extern __at(0x0F3E) __sfr RTCCAL;
763 typedef struct
765 unsigned CAL0 : 1;
766 unsigned CAL1 : 1;
767 unsigned CAL2 : 1;
768 unsigned CAL3 : 1;
769 unsigned CAL4 : 1;
770 unsigned CAL5 : 1;
771 unsigned CAL6 : 1;
772 unsigned CAL7 : 1;
773 } __RTCCALbits_t;
775 extern __at(0x0F3E) volatile __RTCCALbits_t RTCCALbits;
777 #define _CAL0 0x01
778 #define _CAL1 0x02
779 #define _CAL2 0x04
780 #define _CAL3 0x08
781 #define _CAL4 0x10
782 #define _CAL5 0x20
783 #define _CAL6 0x40
784 #define _CAL7 0x80
786 //==============================================================================
789 //==============================================================================
790 // RTCCFG Bits
792 extern __at(0x0F3F) __sfr RTCCFG;
794 typedef union
796 struct
798 unsigned RTCPTR0 : 1;
799 unsigned RTCPTR1 : 1;
800 unsigned RTCOE : 1;
801 unsigned HALFSEC : 1;
802 unsigned RTCSYNC : 1;
803 unsigned RTCWREN : 1;
804 unsigned : 1;
805 unsigned RTCEN : 1;
808 struct
810 unsigned RTCPTR : 2;
811 unsigned : 6;
813 } __RTCCFGbits_t;
815 extern __at(0x0F3F) volatile __RTCCFGbits_t RTCCFGbits;
817 #define _RTCPTR0 0x01
818 #define _RTCPTR1 0x02
819 #define _RTCOE 0x04
820 #define _HALFSEC 0x08
821 #define _RTCSYNC 0x10
822 #define _RTCWREN 0x20
823 #define _RTCEN 0x80
825 //==============================================================================
828 //==============================================================================
829 // ODCON3 Bits
831 extern __at(0x0F40) __sfr ODCON3;
833 typedef struct
835 unsigned SPI1OD : 1;
836 unsigned SPI2OD : 1;
837 unsigned : 1;
838 unsigned : 1;
839 unsigned : 1;
840 unsigned : 1;
841 unsigned : 1;
842 unsigned : 1;
843 } __ODCON3bits_t;
845 extern __at(0x0F40) volatile __ODCON3bits_t ODCON3bits;
847 #define _SPI1OD 0x01
848 #define _SPI2OD 0x02
850 //==============================================================================
853 //==============================================================================
854 // ODCON2 Bits
856 extern __at(0x0F41) __sfr ODCON2;
858 typedef struct
860 unsigned U1OD : 1;
861 unsigned U2OD : 1;
862 unsigned : 1;
863 unsigned : 1;
864 unsigned : 1;
865 unsigned : 1;
866 unsigned : 1;
867 unsigned : 1;
868 } __ODCON2bits_t;
870 extern __at(0x0F41) volatile __ODCON2bits_t ODCON2bits;
872 #define _U1OD 0x01
873 #define _U2OD 0x02
875 //==============================================================================
878 //==============================================================================
879 // ODCON1 Bits
881 extern __at(0x0F42) __sfr ODCON1;
883 typedef struct
885 unsigned ECCP1OD : 1;
886 unsigned ECCP2OD : 1;
887 unsigned : 1;
888 unsigned : 1;
889 unsigned : 1;
890 unsigned : 1;
891 unsigned : 1;
892 unsigned : 1;
893 } __ODCON1bits_t;
895 extern __at(0x0F42) volatile __ODCON1bits_t ODCON1bits;
897 #define _ECCP1OD 0x01
898 #define _ECCP2OD 0x02
900 //==============================================================================
903 //==============================================================================
904 // ANCON0 Bits
906 extern __at(0x0F48) __sfr ANCON0;
908 typedef struct
910 unsigned PCFG0 : 1;
911 unsigned PCFG1 : 1;
912 unsigned PCFG2 : 1;
913 unsigned PCFG3 : 1;
914 unsigned PCFG4 : 1;
915 unsigned PCFG5 : 1;
916 unsigned PCFG6 : 1;
917 unsigned PCFG7 : 1;
918 } __ANCON0bits_t;
920 extern __at(0x0F48) volatile __ANCON0bits_t ANCON0bits;
922 #define _PCFG0 0x01
923 #define _PCFG1 0x02
924 #define _PCFG2 0x04
925 #define _PCFG3 0x08
926 #define _PCFG4 0x10
927 #define _PCFG5 0x20
928 #define _PCFG6 0x40
929 #define _PCFG7 0x80
931 //==============================================================================
934 //==============================================================================
935 // ANCON1 Bits
937 extern __at(0x0F49) __sfr ANCON1;
939 typedef struct
941 unsigned PCFG8 : 1;
942 unsigned PCFG9 : 1;
943 unsigned PCFG10 : 1;
944 unsigned PCFG11 : 1;
945 unsigned PCFG12 : 1;
946 unsigned : 1;
947 unsigned : 1;
948 unsigned VBGEN : 1;
949 } __ANCON1bits_t;
951 extern __at(0x0F49) volatile __ANCON1bits_t ANCON1bits;
953 #define _PCFG8 0x01
954 #define _PCFG9 0x02
955 #define _PCFG10 0x04
956 #define _PCFG11 0x08
957 #define _PCFG12 0x10
958 #define _VBGEN 0x80
960 //==============================================================================
963 //==============================================================================
964 // DSWAKEL Bits
966 extern __at(0x0F4A) __sfr DSWAKEL;
968 typedef struct
970 unsigned DSPOR : 1;
971 unsigned : 1;
972 unsigned DSMCLR : 1;
973 unsigned DSRTC : 1;
974 unsigned DSWDT : 1;
975 unsigned DSULP : 1;
976 unsigned : 1;
977 unsigned DSFLT : 1;
978 } __DSWAKELbits_t;
980 extern __at(0x0F4A) volatile __DSWAKELbits_t DSWAKELbits;
982 #define _DSPOR 0x01
983 #define _DSMCLR 0x04
984 #define _DSRTC 0x08
985 #define _DSWDT 0x10
986 #define _DSULP 0x20
987 #define _DSFLT 0x80
989 //==============================================================================
992 //==============================================================================
993 // DSWAKEH Bits
995 extern __at(0x0F4B) __sfr DSWAKEH;
997 typedef struct
999 unsigned DSINT0 : 1;
1000 unsigned : 1;
1001 unsigned : 1;
1002 unsigned : 1;
1003 unsigned : 1;
1004 unsigned : 1;
1005 unsigned : 1;
1006 unsigned : 1;
1007 } __DSWAKEHbits_t;
1009 extern __at(0x0F4B) volatile __DSWAKEHbits_t DSWAKEHbits;
1011 #define _DSINT0 0x01
1013 //==============================================================================
1016 //==============================================================================
1017 // DSCONL Bits
1019 extern __at(0x0F4C) __sfr DSCONL;
1021 typedef struct
1023 unsigned RELEASE : 1;
1024 unsigned DSBOR : 1;
1025 unsigned ULPWDIS : 1;
1026 unsigned : 1;
1027 unsigned : 1;
1028 unsigned : 1;
1029 unsigned : 1;
1030 unsigned : 1;
1031 } __DSCONLbits_t;
1033 extern __at(0x0F4C) volatile __DSCONLbits_t DSCONLbits;
1035 #define _RELEASE 0x01
1036 #define _DSBOR 0x02
1037 #define _ULPWDIS 0x04
1039 //==============================================================================
1042 //==============================================================================
1043 // DSCONH Bits
1045 extern __at(0x0F4D) __sfr DSCONH;
1047 typedef struct
1049 unsigned RTCWDIS : 1;
1050 unsigned DSULPEN : 1;
1051 unsigned : 1;
1052 unsigned : 1;
1053 unsigned : 1;
1054 unsigned : 1;
1055 unsigned : 1;
1056 unsigned DSEN : 1;
1057 } __DSCONHbits_t;
1059 extern __at(0x0F4D) volatile __DSCONHbits_t DSCONHbits;
1061 #define _RTCWDIS 0x01
1062 #define _DSULPEN 0x02
1063 #define _DSEN 0x80
1065 //==============================================================================
1067 extern __at(0x0F4E) __sfr DSGPR0;
1068 extern __at(0x0F4F) __sfr DSGPR1;
1070 //==============================================================================
1071 // TCLKCON Bits
1073 extern __at(0x0F52) __sfr TCLKCON;
1075 typedef struct
1077 unsigned T3CCP1 : 1;
1078 unsigned T3CCP2 : 1;
1079 unsigned : 1;
1080 unsigned : 1;
1081 unsigned T1RUN : 1;
1082 unsigned : 1;
1083 unsigned : 1;
1084 unsigned : 1;
1085 } __TCLKCONbits_t;
1087 extern __at(0x0F52) volatile __TCLKCONbits_t TCLKCONbits;
1089 #define _T3CCP1 0x01
1090 #define _T3CCP2 0x02
1091 #define _T1RUN 0x10
1093 //==============================================================================
1096 //==============================================================================
1097 // CVRCON Bits
1099 extern __at(0x0F53) __sfr CVRCON;
1101 typedef union
1103 struct
1105 unsigned CVR0 : 1;
1106 unsigned CVR1 : 1;
1107 unsigned CVR2 : 1;
1108 unsigned CVR3 : 1;
1109 unsigned CVRSS : 1;
1110 unsigned CVRR : 1;
1111 unsigned CVROE : 1;
1112 unsigned CVREN : 1;
1115 struct
1117 unsigned CVR : 4;
1118 unsigned : 4;
1120 } __CVRCONbits_t;
1122 extern __at(0x0F53) volatile __CVRCONbits_t CVRCONbits;
1124 #define _CVR0 0x01
1125 #define _CVR1 0x02
1126 #define _CVR2 0x04
1127 #define _CVR3 0x08
1128 #define _CVRSS 0x10
1129 #define _CVRR 0x20
1130 #define _CVROE 0x40
1131 #define _CVREN 0x80
1133 //==============================================================================
1136 //==============================================================================
1137 // PMSTATL Bits
1139 extern __at(0x0F54) __sfr PMSTATL;
1141 typedef struct
1143 unsigned OB0E : 1;
1144 unsigned OB1E : 1;
1145 unsigned OB2E : 1;
1146 unsigned OB3E : 1;
1147 unsigned : 1;
1148 unsigned : 1;
1149 unsigned OBUF : 1;
1150 unsigned OBE : 1;
1151 } __PMSTATLbits_t;
1153 extern __at(0x0F54) volatile __PMSTATLbits_t PMSTATLbits;
1155 #define _OB0E 0x01
1156 #define _OB1E 0x02
1157 #define _OB2E 0x04
1158 #define _OB3E 0x08
1159 #define _OBUF 0x40
1160 #define _OBE 0x80
1162 //==============================================================================
1165 //==============================================================================
1166 // PMSTATH Bits
1168 extern __at(0x0F55) __sfr PMSTATH;
1170 typedef struct
1172 unsigned IB0F : 1;
1173 unsigned IB1F : 1;
1174 unsigned IB2F : 1;
1175 unsigned IB3F : 1;
1176 unsigned : 1;
1177 unsigned : 1;
1178 unsigned IBOV : 1;
1179 unsigned IBF : 1;
1180 } __PMSTATHbits_t;
1182 extern __at(0x0F55) volatile __PMSTATHbits_t PMSTATHbits;
1184 #define _IB0F 0x01
1185 #define _IB1F 0x02
1186 #define _IB2F 0x04
1187 #define _IB3F 0x08
1188 #define _IBOV 0x40
1189 #define _IBF 0x80
1191 //==============================================================================
1194 //==============================================================================
1195 // PMEL Bits
1197 extern __at(0x0F56) __sfr PMEL;
1199 typedef struct
1201 unsigned PTEN0 : 1;
1202 unsigned PTEN1 : 1;
1203 unsigned PTEN2 : 1;
1204 unsigned PTEN3 : 1;
1205 unsigned PTEN4 : 1;
1206 unsigned PTEN5 : 1;
1207 unsigned PTEN6 : 1;
1208 unsigned PTEN7 : 1;
1209 } __PMELbits_t;
1211 extern __at(0x0F56) volatile __PMELbits_t PMELbits;
1213 #define _PTEN0 0x01
1214 #define _PTEN1 0x02
1215 #define _PTEN2 0x04
1216 #define _PTEN3 0x08
1217 #define _PTEN4 0x10
1218 #define _PTEN5 0x20
1219 #define _PTEN6 0x40
1220 #define _PTEN7 0x80
1222 //==============================================================================
1225 //==============================================================================
1226 // PMEH Bits
1228 extern __at(0x0F57) __sfr PMEH;
1230 typedef struct
1232 unsigned PTEN8 : 1;
1233 unsigned PTEN9 : 1;
1234 unsigned PTEN10 : 1;
1235 unsigned PTEN11 : 1;
1236 unsigned PTEN12 : 1;
1237 unsigned PTEN13 : 1;
1238 unsigned PTEN14 : 1;
1239 unsigned PTEN15 : 1;
1240 } __PMEHbits_t;
1242 extern __at(0x0F57) volatile __PMEHbits_t PMEHbits;
1244 #define _PTEN8 0x01
1245 #define _PTEN9 0x02
1246 #define _PTEN10 0x04
1247 #define _PTEN11 0x08
1248 #define _PTEN12 0x10
1249 #define _PTEN13 0x20
1250 #define _PTEN14 0x40
1251 #define _PTEN15 0x80
1253 //==============================================================================
1255 extern __at(0x0F58) __sfr PMDIN2L;
1256 extern __at(0x0F59) __sfr PMDIN2H;
1257 extern __at(0x0F5A) __sfr PMDOUT2L;
1258 extern __at(0x0F5B) __sfr PMDOUT2H;
1260 //==============================================================================
1261 // PMMODEL Bits
1263 extern __at(0x0F5C) __sfr PMMODEL;
1265 typedef union
1267 struct
1269 unsigned WAITE0 : 1;
1270 unsigned WAITE1 : 1;
1271 unsigned WAITM0 : 1;
1272 unsigned WAITM1 : 1;
1273 unsigned WAITM2 : 1;
1274 unsigned WAITM3 : 1;
1275 unsigned WAITB0 : 1;
1276 unsigned WAITB1 : 1;
1279 struct
1281 unsigned WAITE : 2;
1282 unsigned : 6;
1285 struct
1287 unsigned : 2;
1288 unsigned WAITM : 4;
1289 unsigned : 2;
1292 struct
1294 unsigned : 6;
1295 unsigned WAITB : 2;
1297 } __PMMODELbits_t;
1299 extern __at(0x0F5C) volatile __PMMODELbits_t PMMODELbits;
1301 #define _WAITE0 0x01
1302 #define _WAITE1 0x02
1303 #define _WAITM0 0x04
1304 #define _WAITM1 0x08
1305 #define _WAITM2 0x10
1306 #define _WAITM3 0x20
1307 #define _WAITB0 0x40
1308 #define _WAITB1 0x80
1310 //==============================================================================
1313 //==============================================================================
1314 // PMMODEH Bits
1316 extern __at(0x0F5D) __sfr PMMODEH;
1318 typedef union
1320 struct
1322 unsigned MODE0 : 1;
1323 unsigned MODE1 : 1;
1324 unsigned MODE16 : 1;
1325 unsigned INCM0 : 1;
1326 unsigned INCM1 : 1;
1327 unsigned IRQM0 : 1;
1328 unsigned IRQM1 : 1;
1329 unsigned BUSY : 1;
1332 struct
1334 unsigned : 3;
1335 unsigned INCM : 2;
1336 unsigned : 3;
1339 struct
1341 unsigned : 5;
1342 unsigned IRQM : 2;
1343 unsigned : 1;
1345 } __PMMODEHbits_t;
1347 extern __at(0x0F5D) volatile __PMMODEHbits_t PMMODEHbits;
1349 #define _MODE0 0x01
1350 #define _MODE1 0x02
1351 #define _MODE16 0x04
1352 #define _INCM0 0x08
1353 #define _INCM1 0x10
1354 #define _IRQM0 0x20
1355 #define _IRQM1 0x40
1356 #define _BUSY 0x80
1358 //==============================================================================
1361 //==============================================================================
1362 // PMCONL Bits
1364 extern __at(0x0F5E) __sfr PMCONL;
1366 typedef union
1368 struct
1370 unsigned RDSP : 1;
1371 unsigned WRSP : 1;
1372 unsigned BEP : 1;
1373 unsigned CS1P : 1;
1374 unsigned CS2P : 1;
1375 unsigned ALP : 1;
1376 unsigned CSF0 : 1;
1377 unsigned CSF1 : 1;
1380 struct
1382 unsigned : 6;
1383 unsigned CSF : 2;
1385 } __PMCONLbits_t;
1387 extern __at(0x0F5E) volatile __PMCONLbits_t PMCONLbits;
1389 #define _RDSP 0x01
1390 #define _WRSP 0x02
1391 #define _BEP 0x04
1392 #define _CS1P 0x08
1393 #define _CS2P 0x10
1394 #define _ALP 0x20
1395 #define _CSF0 0x40
1396 #define _CSF1 0x80
1398 //==============================================================================
1401 //==============================================================================
1402 // PMCONH Bits
1404 extern __at(0x0F5F) __sfr PMCONH;
1406 typedef union
1408 struct
1410 unsigned PTRDEN : 1;
1411 unsigned PTWREN : 1;
1412 unsigned PTBEEN : 1;
1413 unsigned ADRMUX0 : 1;
1414 unsigned ADRMUX1 : 1;
1415 unsigned PSIDL : 1;
1416 unsigned : 1;
1417 unsigned PMPEN : 1;
1420 struct
1422 unsigned : 3;
1423 unsigned ADRMUX : 2;
1424 unsigned : 3;
1426 } __PMCONHbits_t;
1428 extern __at(0x0F5F) volatile __PMCONHbits_t PMCONHbits;
1430 #define _PTRDEN 0x01
1431 #define _PTWREN 0x02
1432 #define _PTBEEN 0x04
1433 #define _ADRMUX0 0x08
1434 #define _ADRMUX1 0x10
1435 #define _PSIDL 0x20
1436 #define _PMPEN 0x80
1438 //==============================================================================
1440 extern __at(0x0F60) __sfr UFRM;
1442 //==============================================================================
1443 // UFRML Bits
1445 extern __at(0x0F60) __sfr UFRML;
1447 typedef struct
1449 unsigned FRM0 : 1;
1450 unsigned FRM1 : 1;
1451 unsigned FRM2 : 1;
1452 unsigned FRM3 : 1;
1453 unsigned FRM4 : 1;
1454 unsigned FRM5 : 1;
1455 unsigned FRM6 : 1;
1456 unsigned FRM7 : 1;
1457 } __UFRMLbits_t;
1459 extern __at(0x0F60) volatile __UFRMLbits_t UFRMLbits;
1461 #define _FRM0 0x01
1462 #define _FRM1 0x02
1463 #define _FRM2 0x04
1464 #define _FRM3 0x08
1465 #define _FRM4 0x10
1466 #define _FRM5 0x20
1467 #define _FRM6 0x40
1468 #define _FRM7 0x80
1470 //==============================================================================
1473 //==============================================================================
1474 // UFRMH Bits
1476 extern __at(0x0F61) __sfr UFRMH;
1478 typedef struct
1480 unsigned FRM8 : 1;
1481 unsigned FRM9 : 1;
1482 unsigned FRM10 : 1;
1483 unsigned : 1;
1484 unsigned : 1;
1485 unsigned : 1;
1486 unsigned : 1;
1487 unsigned : 1;
1488 } __UFRMHbits_t;
1490 extern __at(0x0F61) volatile __UFRMHbits_t UFRMHbits;
1492 #define _FRM8 0x01
1493 #define _FRM9 0x02
1494 #define _FRM10 0x04
1496 //==============================================================================
1499 //==============================================================================
1500 // UIR Bits
1502 extern __at(0x0F62) __sfr UIR;
1504 typedef struct
1506 unsigned URSTIF : 1;
1507 unsigned UERRIF : 1;
1508 unsigned ACTVIF : 1;
1509 unsigned TRNIF : 1;
1510 unsigned IDLEIF : 1;
1511 unsigned STALLIF : 1;
1512 unsigned SOFIF : 1;
1513 unsigned : 1;
1514 } __UIRbits_t;
1516 extern __at(0x0F62) volatile __UIRbits_t UIRbits;
1518 #define _URSTIF 0x01
1519 #define _UERRIF 0x02
1520 #define _ACTVIF 0x04
1521 #define _TRNIF 0x08
1522 #define _IDLEIF 0x10
1523 #define _STALLIF 0x20
1524 #define _SOFIF 0x40
1526 //==============================================================================
1529 //==============================================================================
1530 // UEIR Bits
1532 extern __at(0x0F63) __sfr UEIR;
1534 typedef struct
1536 unsigned PIDEF : 1;
1537 unsigned CRC5EF : 1;
1538 unsigned CRC16EF : 1;
1539 unsigned DFN8EF : 1;
1540 unsigned BTOEF : 1;
1541 unsigned : 1;
1542 unsigned : 1;
1543 unsigned BTSEF : 1;
1544 } __UEIRbits_t;
1546 extern __at(0x0F63) volatile __UEIRbits_t UEIRbits;
1548 #define _PIDEF 0x01
1549 #define _CRC5EF 0x02
1550 #define _CRC16EF 0x04
1551 #define _DFN8EF 0x08
1552 #define _BTOEF 0x10
1553 #define _BTSEF 0x80
1555 //==============================================================================
1558 //==============================================================================
1559 // USTAT Bits
1561 extern __at(0x0F64) __sfr USTAT;
1563 typedef union
1565 struct
1567 unsigned : 1;
1568 unsigned PPBI : 1;
1569 unsigned DIR : 1;
1570 unsigned ENDP0 : 1;
1571 unsigned ENDP1 : 1;
1572 unsigned ENDP2 : 1;
1573 unsigned ENDP3 : 1;
1574 unsigned : 1;
1577 struct
1579 unsigned : 3;
1580 unsigned ENDP : 4;
1581 unsigned : 1;
1583 } __USTATbits_t;
1585 extern __at(0x0F64) volatile __USTATbits_t USTATbits;
1587 #define _PPBI 0x02
1588 #define _DIR 0x04
1589 #define _ENDP0 0x08
1590 #define _ENDP1 0x10
1591 #define _ENDP2 0x20
1592 #define _ENDP3 0x40
1594 //==============================================================================
1597 //==============================================================================
1598 // UCON Bits
1600 extern __at(0x0F65) __sfr UCON;
1602 typedef struct
1604 unsigned : 1;
1605 unsigned SUSPND : 1;
1606 unsigned RESUME : 1;
1607 unsigned USBEN : 1;
1608 unsigned PKTDIS : 1;
1609 unsigned SE0 : 1;
1610 unsigned PPBRST : 1;
1611 unsigned : 1;
1612 } __UCONbits_t;
1614 extern __at(0x0F65) volatile __UCONbits_t UCONbits;
1616 #define _SUSPND 0x02
1617 #define _RESUME 0x04
1618 #define _USBEN 0x08
1619 #define _PKTDIS 0x10
1620 #define _SE0 0x20
1621 #define _PPBRST 0x40
1623 //==============================================================================
1625 extern __at(0x0F66) __sfr DMABCH;
1626 extern __at(0x0F67) __sfr DMABCL;
1627 extern __at(0x0F68) __sfr RXADDRH;
1628 extern __at(0x0F69) __sfr RXADDRL;
1629 extern __at(0x0F6A) __sfr TXADDRH;
1630 extern __at(0x0F6B) __sfr TXADDRL;
1631 extern __at(0x0F6C) __sfr PMDIN1L;
1632 extern __at(0x0F6D) __sfr PMDIN1H;
1633 extern __at(0x0F6E) __sfr PMADDRL;
1634 extern __at(0x0F6E) __sfr PMDOUT1L;
1636 //==============================================================================
1637 // PMADDRH Bits
1639 extern __at(0x0F6F) __sfr PMADDRH;
1641 typedef struct
1643 unsigned : 1;
1644 unsigned : 1;
1645 unsigned : 1;
1646 unsigned : 1;
1647 unsigned : 1;
1648 unsigned : 1;
1649 unsigned CS1 : 1;
1650 unsigned : 1;
1651 } __PMADDRHbits_t;
1653 extern __at(0x0F6F) volatile __PMADDRHbits_t PMADDRHbits;
1655 #define _CS1 0x40
1657 //==============================================================================
1659 extern __at(0x0F6F) __sfr PMDOUT1H;
1661 //==============================================================================
1662 // CMSTAT Bits
1664 extern __at(0x0F70) __sfr CMSTAT;
1666 typedef struct
1668 unsigned COUT1 : 1;
1669 unsigned COUT2 : 1;
1670 unsigned : 1;
1671 unsigned : 1;
1672 unsigned : 1;
1673 unsigned : 1;
1674 unsigned : 1;
1675 unsigned : 1;
1676 } __CMSTATbits_t;
1678 extern __at(0x0F70) volatile __CMSTATbits_t CMSTATbits;
1680 #define _COUT1 0x01
1681 #define _COUT2 0x02
1683 //==============================================================================
1686 //==============================================================================
1687 // CMSTATUS Bits
1689 extern __at(0x0F70) __sfr CMSTATUS;
1691 typedef struct
1693 unsigned COUT1 : 1;
1694 unsigned COUT2 : 1;
1695 unsigned : 1;
1696 unsigned : 1;
1697 unsigned : 1;
1698 unsigned : 1;
1699 unsigned : 1;
1700 unsigned : 1;
1701 } __CMSTATUSbits_t;
1703 extern __at(0x0F70) volatile __CMSTATUSbits_t CMSTATUSbits;
1705 #define _CMSTATUS_COUT1 0x01
1706 #define _CMSTATUS_COUT2 0x02
1708 //==============================================================================
1711 //==============================================================================
1712 // SSP2CON2 Bits
1714 extern __at(0x0F71) __sfr SSP2CON2;
1716 typedef union
1718 struct
1720 unsigned SEN : 1;
1721 unsigned RSEN : 1;
1722 unsigned PEN : 1;
1723 unsigned RCEN : 1;
1724 unsigned ACKEN : 1;
1725 unsigned ACKDT : 1;
1726 unsigned ACKSTAT : 1;
1727 unsigned GCEN : 1;
1730 struct
1732 unsigned : 1;
1733 unsigned ADMSK1 : 1;
1734 unsigned ADMSK2 : 1;
1735 unsigned ADMSK3 : 1;
1736 unsigned ADMSK4 : 1;
1737 unsigned ADMSK5 : 1;
1738 unsigned : 1;
1739 unsigned : 1;
1741 } __SSP2CON2bits_t;
1743 extern __at(0x0F71) volatile __SSP2CON2bits_t SSP2CON2bits;
1745 #define _SSP2CON2_SEN 0x01
1746 #define _SSP2CON2_RSEN 0x02
1747 #define _SSP2CON2_ADMSK1 0x02
1748 #define _SSP2CON2_PEN 0x04
1749 #define _SSP2CON2_ADMSK2 0x04
1750 #define _SSP2CON2_RCEN 0x08
1751 #define _SSP2CON2_ADMSK3 0x08
1752 #define _SSP2CON2_ACKEN 0x10
1753 #define _SSP2CON2_ADMSK4 0x10
1754 #define _SSP2CON2_ACKDT 0x20
1755 #define _SSP2CON2_ADMSK5 0x20
1756 #define _SSP2CON2_ACKSTAT 0x40
1757 #define _SSP2CON2_GCEN 0x80
1759 //==============================================================================
1762 //==============================================================================
1763 // SSP2CON1 Bits
1765 extern __at(0x0F72) __sfr SSP2CON1;
1767 typedef union
1769 struct
1771 unsigned SSPM0 : 1;
1772 unsigned SSPM1 : 1;
1773 unsigned SSPM2 : 1;
1774 unsigned SSPM3 : 1;
1775 unsigned CKP : 1;
1776 unsigned SSPEN : 1;
1777 unsigned SSPOV : 1;
1778 unsigned WCOL : 1;
1781 struct
1783 unsigned SSPM : 4;
1784 unsigned : 4;
1786 } __SSP2CON1bits_t;
1788 extern __at(0x0F72) volatile __SSP2CON1bits_t SSP2CON1bits;
1790 #define _SSP2CON1_SSPM0 0x01
1791 #define _SSP2CON1_SSPM1 0x02
1792 #define _SSP2CON1_SSPM2 0x04
1793 #define _SSP2CON1_SSPM3 0x08
1794 #define _SSP2CON1_CKP 0x10
1795 #define _SSP2CON1_SSPEN 0x20
1796 #define _SSP2CON1_SSPOV 0x40
1797 #define _SSP2CON1_WCOL 0x80
1799 //==============================================================================
1802 //==============================================================================
1803 // SSP2STAT Bits
1805 extern __at(0x0F73) __sfr SSP2STAT;
1807 typedef struct
1809 unsigned BF : 1;
1810 unsigned UA : 1;
1811 unsigned R_NOT_W : 1;
1812 unsigned S : 1;
1813 unsigned P : 1;
1814 unsigned D_NOT_A : 1;
1815 unsigned CKE : 1;
1816 unsigned SMP : 1;
1817 } __SSP2STATbits_t;
1819 extern __at(0x0F73) volatile __SSP2STATbits_t SSP2STATbits;
1821 #define _SSP2STAT_BF 0x01
1822 #define _SSP2STAT_UA 0x02
1823 #define _SSP2STAT_R_NOT_W 0x04
1824 #define _SSP2STAT_S 0x08
1825 #define _SSP2STAT_P 0x10
1826 #define _SSP2STAT_D_NOT_A 0x20
1827 #define _SSP2STAT_CKE 0x40
1828 #define _SSP2STAT_SMP 0x80
1830 //==============================================================================
1833 //==============================================================================
1834 // SSP2ADD Bits
1836 extern __at(0x0F74) __sfr SSP2ADD;
1838 typedef struct
1840 unsigned MSK0 : 1;
1841 unsigned MSK1 : 1;
1842 unsigned MSK2 : 1;
1843 unsigned MSK3 : 1;
1844 unsigned MSK4 : 1;
1845 unsigned MSK5 : 1;
1846 unsigned MSK6 : 1;
1847 unsigned MSK7 : 1;
1848 } __SSP2ADDbits_t;
1850 extern __at(0x0F74) volatile __SSP2ADDbits_t SSP2ADDbits;
1852 #define _SSP2ADD_MSK0 0x01
1853 #define _SSP2ADD_MSK1 0x02
1854 #define _SSP2ADD_MSK2 0x04
1855 #define _SSP2ADD_MSK3 0x08
1856 #define _SSP2ADD_MSK4 0x10
1857 #define _SSP2ADD_MSK5 0x20
1858 #define _SSP2ADD_MSK6 0x40
1859 #define _SSP2ADD_MSK7 0x80
1861 //==============================================================================
1864 //==============================================================================
1865 // SSP2MSK Bits
1867 extern __at(0x0F74) __sfr SSP2MSK;
1869 typedef struct
1871 unsigned MSK0 : 1;
1872 unsigned MSK1 : 1;
1873 unsigned MSK2 : 1;
1874 unsigned MSK3 : 1;
1875 unsigned MSK4 : 1;
1876 unsigned MSK5 : 1;
1877 unsigned MSK6 : 1;
1878 unsigned MSK7 : 1;
1879 } __SSP2MSKbits_t;
1881 extern __at(0x0F74) volatile __SSP2MSKbits_t SSP2MSKbits;
1883 #define _SSP2MSK_MSK0 0x01
1884 #define _SSP2MSK_MSK1 0x02
1885 #define _SSP2MSK_MSK2 0x04
1886 #define _SSP2MSK_MSK3 0x08
1887 #define _SSP2MSK_MSK4 0x10
1888 #define _SSP2MSK_MSK5 0x20
1889 #define _SSP2MSK_MSK6 0x40
1890 #define _SSP2MSK_MSK7 0x80
1892 //==============================================================================
1894 extern __at(0x0F75) __sfr SSP2BUF;
1896 //==============================================================================
1897 // T4CON Bits
1899 extern __at(0x0F76) __sfr T4CON;
1901 typedef union
1903 struct
1905 unsigned T4CKPS0 : 1;
1906 unsigned T4CKPS1 : 1;
1907 unsigned TMR4ON : 1;
1908 unsigned T4OUTPS0 : 1;
1909 unsigned T4OUTPS1 : 1;
1910 unsigned T4OUTPS2 : 1;
1911 unsigned T4OUTPS3 : 1;
1912 unsigned : 1;
1915 struct
1917 unsigned T4CKPS : 2;
1918 unsigned : 6;
1921 struct
1923 unsigned : 3;
1924 unsigned T4OUTPS : 4;
1925 unsigned : 1;
1927 } __T4CONbits_t;
1929 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
1931 #define _T4CKPS0 0x01
1932 #define _T4CKPS1 0x02
1933 #define _TMR4ON 0x04
1934 #define _T4OUTPS0 0x08
1935 #define _T4OUTPS1 0x10
1936 #define _T4OUTPS2 0x20
1937 #define _T4OUTPS3 0x40
1939 //==============================================================================
1941 extern __at(0x0F77) __sfr PR4;
1942 extern __at(0x0F78) __sfr TMR4;
1944 //==============================================================================
1945 // T3CON Bits
1947 extern __at(0x0F79) __sfr T3CON;
1949 typedef union
1951 struct
1953 unsigned TMR3ON : 1;
1954 unsigned RD16 : 1;
1955 unsigned T3SYNC : 1;
1956 unsigned T3OSCEN : 1;
1957 unsigned T3CKPS0 : 1;
1958 unsigned T3CKPS1 : 1;
1959 unsigned TMR3CS0 : 1;
1960 unsigned TMR3CS1 : 1;
1963 struct
1965 unsigned : 4;
1966 unsigned T3CKPS : 2;
1967 unsigned : 2;
1970 struct
1972 unsigned : 6;
1973 unsigned TMR3CS : 2;
1975 } __T3CONbits_t;
1977 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits;
1979 #define _T3CON_TMR3ON 0x01
1980 #define _T3CON_RD16 0x02
1981 #define _T3CON_T3SYNC 0x04
1982 #define _T3CON_T3OSCEN 0x08
1983 #define _T3CON_T3CKPS0 0x10
1984 #define _T3CON_T3CKPS1 0x20
1985 #define _T3CON_TMR3CS0 0x40
1986 #define _T3CON_TMR3CS1 0x80
1988 //==============================================================================
1990 extern __at(0x0F7A) __sfr TMR3;
1991 extern __at(0x0F7A) __sfr TMR3L;
1992 extern __at(0x0F7B) __sfr TMR3H;
1994 //==============================================================================
1995 // BAUDCON2 Bits
1997 extern __at(0x0F7C) __sfr BAUDCON2;
1999 typedef struct
2001 unsigned ABDEN : 1;
2002 unsigned WUE : 1;
2003 unsigned : 1;
2004 unsigned BRG16 : 1;
2005 unsigned TXCKP : 1;
2006 unsigned RXDTP : 1;
2007 unsigned RCIDL : 1;
2008 unsigned ABDOVF : 1;
2009 } __BAUDCON2bits_t;
2011 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
2013 #define _BAUDCON2_ABDEN 0x01
2014 #define _BAUDCON2_WUE 0x02
2015 #define _BAUDCON2_BRG16 0x08
2016 #define _BAUDCON2_TXCKP 0x10
2017 #define _BAUDCON2_RXDTP 0x20
2018 #define _BAUDCON2_RCIDL 0x40
2019 #define _BAUDCON2_ABDOVF 0x80
2021 //==============================================================================
2023 extern __at(0x0F7D) __sfr SPBRGH2;
2025 //==============================================================================
2026 // BAUDCON Bits
2028 extern __at(0x0F7E) __sfr BAUDCON;
2030 typedef struct
2032 unsigned ABDEN : 1;
2033 unsigned WUE : 1;
2034 unsigned : 1;
2035 unsigned BRG16 : 1;
2036 unsigned TXCKP : 1;
2037 unsigned RXDTP : 1;
2038 unsigned RCIDL : 1;
2039 unsigned ABDOVF : 1;
2040 } __BAUDCONbits_t;
2042 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
2044 #define _ABDEN 0x01
2045 #define _WUE 0x02
2046 #define _BRG16 0x08
2047 #define _TXCKP 0x10
2048 #define _RXDTP 0x20
2049 #define _RCIDL 0x40
2050 #define _ABDOVF 0x80
2052 //==============================================================================
2055 //==============================================================================
2056 // BAUDCON1 Bits
2058 extern __at(0x0F7E) __sfr BAUDCON1;
2060 typedef struct
2062 unsigned ABDEN : 1;
2063 unsigned WUE : 1;
2064 unsigned : 1;
2065 unsigned BRG16 : 1;
2066 unsigned TXCKP : 1;
2067 unsigned RXDTP : 1;
2068 unsigned RCIDL : 1;
2069 unsigned ABDOVF : 1;
2070 } __BAUDCON1bits_t;
2072 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
2074 #define _BAUDCON1_ABDEN 0x01
2075 #define _BAUDCON1_WUE 0x02
2076 #define _BAUDCON1_BRG16 0x08
2077 #define _BAUDCON1_TXCKP 0x10
2078 #define _BAUDCON1_RXDTP 0x20
2079 #define _BAUDCON1_RCIDL 0x40
2080 #define _BAUDCON1_ABDOVF 0x80
2082 //==============================================================================
2085 //==============================================================================
2086 // BAUDCTL Bits
2088 extern __at(0x0F7E) __sfr BAUDCTL;
2090 typedef struct
2092 unsigned ABDEN : 1;
2093 unsigned WUE : 1;
2094 unsigned : 1;
2095 unsigned BRG16 : 1;
2096 unsigned TXCKP : 1;
2097 unsigned RXDTP : 1;
2098 unsigned RCIDL : 1;
2099 unsigned ABDOVF : 1;
2100 } __BAUDCTLbits_t;
2102 extern __at(0x0F7E) volatile __BAUDCTLbits_t BAUDCTLbits;
2104 #define _BAUDCTL_ABDEN 0x01
2105 #define _BAUDCTL_WUE 0x02
2106 #define _BAUDCTL_BRG16 0x08
2107 #define _BAUDCTL_TXCKP 0x10
2108 #define _BAUDCTL_RXDTP 0x20
2109 #define _BAUDCTL_RCIDL 0x40
2110 #define _BAUDCTL_ABDOVF 0x80
2112 //==============================================================================
2114 extern __at(0x0F7F) __sfr SPBRGH;
2115 extern __at(0x0F7F) __sfr SPBRGH1;
2117 //==============================================================================
2118 // PORTA Bits
2120 extern __at(0x0F80) __sfr PORTA;
2122 typedef union
2124 struct
2126 unsigned RA0 : 1;
2127 unsigned RA1 : 1;
2128 unsigned RA2 : 1;
2129 unsigned RA3 : 1;
2130 unsigned : 1;
2131 unsigned RA5 : 1;
2132 unsigned RA6 : 1;
2133 unsigned RA7 : 1;
2136 struct
2138 unsigned AN0 : 1;
2139 unsigned AN1 : 1;
2140 unsigned AN2 : 1;
2141 unsigned AN3 : 1;
2142 unsigned : 1;
2143 unsigned AN4 : 1;
2144 unsigned OSC2 : 1;
2145 unsigned OSC1 : 1;
2148 struct
2150 unsigned C1INA : 1;
2151 unsigned C2INA : 1;
2152 unsigned VREF_MINUS : 1;
2153 unsigned VREF_PLUS : 1;
2154 unsigned : 1;
2155 unsigned NOT_SS1 : 1;
2156 unsigned CLKO : 1;
2157 unsigned CLKI : 1;
2160 struct
2162 unsigned PMA6 : 1;
2163 unsigned PMA7 : 1;
2164 unsigned CVREF_MINUS : 1;
2165 unsigned C1INB : 1;
2166 unsigned : 1;
2167 unsigned HLVDIN : 1;
2168 unsigned : 1;
2169 unsigned : 1;
2172 struct
2174 unsigned RP0 : 1;
2175 unsigned RP1 : 1;
2176 unsigned C2INB : 1;
2177 unsigned : 1;
2178 unsigned : 1;
2179 unsigned RCV : 1;
2180 unsigned : 1;
2181 unsigned : 1;
2184 struct
2186 unsigned ULPWU : 1;
2187 unsigned : 1;
2188 unsigned : 1;
2189 unsigned : 1;
2190 unsigned : 1;
2191 unsigned RP2 : 1;
2192 unsigned : 1;
2193 unsigned : 1;
2195 } __PORTAbits_t;
2197 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
2199 #define _RA0 0x01
2200 #define _AN0 0x01
2201 #define _C1INA 0x01
2202 #define _PMA6 0x01
2203 #define _RP0 0x01
2204 #define _ULPWU 0x01
2205 #define _RA1 0x02
2206 #define _AN1 0x02
2207 #define _C2INA 0x02
2208 #define _PMA7 0x02
2209 #define _RP1 0x02
2210 #define _RA2 0x04
2211 #define _AN2 0x04
2212 #define _VREF_MINUS 0x04
2213 #define _CVREF_MINUS 0x04
2214 #define _C2INB 0x04
2215 #define _RA3 0x08
2216 #define _AN3 0x08
2217 #define _VREF_PLUS 0x08
2218 #define _C1INB 0x08
2219 #define _RA5 0x20
2220 #define _AN4 0x20
2221 #define _NOT_SS1 0x20
2222 #define _HLVDIN 0x20
2223 #define _RCV 0x20
2224 #define _RP2 0x20
2225 #define _RA6 0x40
2226 #define _OSC2 0x40
2227 #define _CLKO 0x40
2228 #define _RA7 0x80
2229 #define _OSC1 0x80
2230 #define _CLKI 0x80
2232 //==============================================================================
2235 //==============================================================================
2236 // PORTB Bits
2238 extern __at(0x0F81) __sfr PORTB;
2240 typedef union
2242 struct
2244 unsigned RB0 : 1;
2245 unsigned RB1 : 1;
2246 unsigned RB2 : 1;
2247 unsigned RB3 : 1;
2248 unsigned RB4 : 1;
2249 unsigned RB5 : 1;
2250 unsigned RB6 : 1;
2251 unsigned RB7 : 1;
2254 struct
2256 unsigned AN12 : 1;
2257 unsigned AN10 : 1;
2258 unsigned AN8 : 1;
2259 unsigned AN9 : 1;
2260 unsigned PMA1 : 1;
2261 unsigned PMA0 : 1;
2262 unsigned KBI2 : 1;
2263 unsigned KBI3 : 1;
2266 struct
2268 unsigned INT0 : 1;
2269 unsigned PMPBE : 1;
2270 unsigned CTEDG1 : 1;
2271 unsigned CTEDG2 : 1;
2272 unsigned KBI0 : 1;
2273 unsigned KBI1 : 1;
2274 unsigned PGC : 1;
2275 unsigned PGD : 1;
2278 struct
2280 unsigned RP3 : 1;
2281 unsigned RTCC : 1;
2282 unsigned PMA3 : 1;
2283 unsigned PMA2 : 1;
2284 unsigned SCK1 : 1;
2285 unsigned SDI1 : 1;
2286 unsigned RP9 : 1;
2287 unsigned RP10 : 1;
2290 struct
2292 unsigned : 1;
2293 unsigned RP4 : 1;
2294 unsigned VMO : 1;
2295 unsigned VPO : 1;
2296 unsigned SCL1 : 1;
2297 unsigned SDA1 : 1;
2298 unsigned : 1;
2299 unsigned : 1;
2302 struct
2304 unsigned : 1;
2305 unsigned : 1;
2306 unsigned REFO : 1;
2307 unsigned RP6 : 1;
2308 unsigned RP7 : 1;
2309 unsigned RP8 : 1;
2310 unsigned : 1;
2311 unsigned : 1;
2314 struct
2316 unsigned : 1;
2317 unsigned : 1;
2318 unsigned RP5 : 1;
2319 unsigned : 1;
2320 unsigned : 1;
2321 unsigned : 1;
2322 unsigned : 1;
2323 unsigned : 1;
2326 struct
2328 unsigned : 4;
2329 unsigned KBI : 4;
2331 } __PORTBbits_t;
2333 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
2335 #define _RB0 0x01
2336 #define _AN12 0x01
2337 #define _INT0 0x01
2338 #define _RP3 0x01
2339 #define _RB1 0x02
2340 #define _AN10 0x02
2341 #define _PMPBE 0x02
2342 #define _RTCC 0x02
2343 #define _RP4 0x02
2344 #define _RB2 0x04
2345 #define _AN8 0x04
2346 #define _CTEDG1 0x04
2347 #define _PMA3 0x04
2348 #define _VMO 0x04
2349 #define _REFO 0x04
2350 #define _RP5 0x04
2351 #define _RB3 0x08
2352 #define _AN9 0x08
2353 #define _CTEDG2 0x08
2354 #define _PMA2 0x08
2355 #define _VPO 0x08
2356 #define _RP6 0x08
2357 #define _RB4 0x10
2358 #define _PMA1 0x10
2359 #define _KBI0 0x10
2360 #define _SCK1 0x10
2361 #define _SCL1 0x10
2362 #define _RP7 0x10
2363 #define _RB5 0x20
2364 #define _PMA0 0x20
2365 #define _KBI1 0x20
2366 #define _SDI1 0x20
2367 #define _SDA1 0x20
2368 #define _RP8 0x20
2369 #define _RB6 0x40
2370 #define _KBI2 0x40
2371 #define _PGC 0x40
2372 #define _RP9 0x40
2373 #define _RB7 0x80
2374 #define _KBI3 0x80
2375 #define _PGD 0x80
2376 #define _RP10 0x80
2378 //==============================================================================
2381 //==============================================================================
2382 // PORTC Bits
2384 extern __at(0x0F82) __sfr PORTC;
2386 typedef union
2388 struct
2390 unsigned RC0 : 1;
2391 unsigned RC1 : 1;
2392 unsigned RC2 : 1;
2393 unsigned : 1;
2394 unsigned RC4 : 1;
2395 unsigned RC5 : 1;
2396 unsigned RC6 : 1;
2397 unsigned RC7 : 1;
2400 struct
2402 unsigned T1OSO : 1;
2403 unsigned T1OSI : 1;
2404 unsigned AN11 : 1;
2405 unsigned : 1;
2406 unsigned D_MINUS : 1;
2407 unsigned D_PLUS : 1;
2408 unsigned PMA5 : 1;
2409 unsigned PMA4 : 1;
2412 struct
2414 unsigned T1CK : 1;
2415 unsigned NOT_UOE : 1;
2416 unsigned CTPLS : 1;
2417 unsigned : 1;
2418 unsigned VM : 1;
2419 unsigned VP : 1;
2420 unsigned TX1 : 1;
2421 unsigned RX1 : 1;
2424 struct
2426 unsigned RP11 : 1;
2427 unsigned RP12 : 1;
2428 unsigned RP13 : 1;
2429 unsigned : 1;
2430 unsigned : 1;
2431 unsigned : 1;
2432 unsigned CK1 : 1;
2433 unsigned DT1 : 1;
2436 struct
2438 unsigned : 1;
2439 unsigned : 1;
2440 unsigned : 1;
2441 unsigned : 1;
2442 unsigned : 1;
2443 unsigned : 1;
2444 unsigned RP17 : 1;
2445 unsigned SDO1 : 1;
2448 struct
2450 unsigned : 1;
2451 unsigned : 1;
2452 unsigned : 1;
2453 unsigned : 1;
2454 unsigned : 1;
2455 unsigned : 1;
2456 unsigned : 1;
2457 unsigned RP18 : 1;
2459 } __PORTCbits_t;
2461 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
2463 #define _RC0 0x01
2464 #define _T1OSO 0x01
2465 #define _T1CK 0x01
2466 #define _RP11 0x01
2467 #define _RC1 0x02
2468 #define _T1OSI 0x02
2469 #define _NOT_UOE 0x02
2470 #define _RP12 0x02
2471 #define _RC2 0x04
2472 #define _AN11 0x04
2473 #define _CTPLS 0x04
2474 #define _RP13 0x04
2475 #define _RC4 0x10
2476 #define _D_MINUS 0x10
2477 #define _VM 0x10
2478 #define _RC5 0x20
2479 #define _D_PLUS 0x20
2480 #define _VP 0x20
2481 #define _RC6 0x40
2482 #define _PMA5 0x40
2483 #define _TX1 0x40
2484 #define _CK1 0x40
2485 #define _RP17 0x40
2486 #define _RC7 0x80
2487 #define _PMA4 0x80
2488 #define _RX1 0x80
2489 #define _DT1 0x80
2490 #define _SDO1 0x80
2491 #define _RP18 0x80
2493 //==============================================================================
2496 //==============================================================================
2497 // PORTD Bits
2499 extern __at(0x0F83) __sfr PORTD;
2501 typedef union
2503 struct
2505 unsigned RD0 : 1;
2506 unsigned RD1 : 1;
2507 unsigned RD2 : 1;
2508 unsigned RD3 : 1;
2509 unsigned RD4 : 1;
2510 unsigned RD5 : 1;
2511 unsigned RD6 : 1;
2512 unsigned RD7 : 1;
2515 struct
2517 unsigned PMD0 : 1;
2518 unsigned PMD1 : 1;
2519 unsigned PMD2 : 1;
2520 unsigned PMD3 : 1;
2521 unsigned PMD4 : 1;
2522 unsigned PMD5 : 1;
2523 unsigned PMD6 : 1;
2524 unsigned PMD7 : 1;
2527 struct
2529 unsigned SCL2 : 1;
2530 unsigned SDA2 : 1;
2531 unsigned RP19 : 1;
2532 unsigned RP20 : 1;
2533 unsigned RP21 : 1;
2534 unsigned RP22 : 1;
2535 unsigned RP23 : 1;
2536 unsigned RP24 : 1;
2538 } __PORTDbits_t;
2540 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
2542 #define _RD0 0x01
2543 #define _PMD0 0x01
2544 #define _SCL2 0x01
2545 #define _RD1 0x02
2546 #define _PMD1 0x02
2547 #define _SDA2 0x02
2548 #define _RD2 0x04
2549 #define _PMD2 0x04
2550 #define _RP19 0x04
2551 #define _RD3 0x08
2552 #define _PMD3 0x08
2553 #define _RP20 0x08
2554 #define _RD4 0x10
2555 #define _PMD4 0x10
2556 #define _RP21 0x10
2557 #define _RD5 0x20
2558 #define _PMD5 0x20
2559 #define _RP22 0x20
2560 #define _RD6 0x40
2561 #define _PMD6 0x40
2562 #define _RP23 0x40
2563 #define _RD7 0x80
2564 #define _PMD7 0x80
2565 #define _RP24 0x80
2567 //==============================================================================
2570 //==============================================================================
2571 // PORTE Bits
2573 extern __at(0x0F84) __sfr PORTE;
2575 typedef union
2577 struct
2579 unsigned RE0 : 1;
2580 unsigned RE1 : 1;
2581 unsigned RE2 : 1;
2582 unsigned : 1;
2583 unsigned : 1;
2584 unsigned : 1;
2585 unsigned REPU : 1;
2586 unsigned RDPU : 1;
2589 struct
2591 unsigned AN5 : 1;
2592 unsigned AN6 : 1;
2593 unsigned AN7 : 1;
2594 unsigned : 1;
2595 unsigned : 1;
2596 unsigned : 1;
2597 unsigned : 1;
2598 unsigned : 1;
2601 struct
2603 unsigned PMPRD : 1;
2604 unsigned PMPWR : 1;
2605 unsigned PMPCS : 1;
2606 unsigned : 1;
2607 unsigned : 1;
2608 unsigned : 1;
2609 unsigned : 1;
2610 unsigned : 1;
2613 struct
2615 unsigned RE : 3;
2616 unsigned : 5;
2618 } __PORTEbits_t;
2620 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
2622 #define _RE0 0x01
2623 #define _AN5 0x01
2624 #define _PMPRD 0x01
2625 #define _RE1 0x02
2626 #define _AN6 0x02
2627 #define _PMPWR 0x02
2628 #define _RE2 0x04
2629 #define _AN7 0x04
2630 #define _PMPCS 0x04
2631 #define _REPU 0x40
2632 #define _RDPU 0x80
2634 //==============================================================================
2637 //==============================================================================
2638 // HLVDCON Bits
2640 extern __at(0x0F85) __sfr HLVDCON;
2642 typedef union
2644 struct
2646 unsigned HLVDL0 : 1;
2647 unsigned HLVDL1 : 1;
2648 unsigned HLVDL2 : 1;
2649 unsigned HLVDL3 : 1;
2650 unsigned HLVDEN : 1;
2651 unsigned IRVST : 1;
2652 unsigned BGVST : 1;
2653 unsigned VDIRMAG : 1;
2656 struct
2658 unsigned HLVDL : 4;
2659 unsigned : 4;
2661 } __HLVDCONbits_t;
2663 extern __at(0x0F85) volatile __HLVDCONbits_t HLVDCONbits;
2665 #define _HLVDL0 0x01
2666 #define _HLVDL1 0x02
2667 #define _HLVDL2 0x04
2668 #define _HLVDL3 0x08
2669 #define _HLVDEN 0x10
2670 #define _IRVST 0x20
2671 #define _BGVST 0x40
2672 #define _VDIRMAG 0x80
2674 //==============================================================================
2677 //==============================================================================
2678 // DMACON2 Bits
2680 extern __at(0x0F86) __sfr DMACON2;
2682 typedef union
2684 struct
2686 unsigned INTLVL0 : 1;
2687 unsigned INTLVL1 : 1;
2688 unsigned INTLVL2 : 1;
2689 unsigned INTLVL3 : 1;
2690 unsigned DLYCYC0 : 1;
2691 unsigned DLYCYC1 : 1;
2692 unsigned DLYCYC2 : 1;
2693 unsigned DLYCYC3 : 1;
2696 struct
2698 unsigned INTLVL : 4;
2699 unsigned : 4;
2702 struct
2704 unsigned : 4;
2705 unsigned DLYCYC : 4;
2707 } __DMACON2bits_t;
2709 extern __at(0x0F86) volatile __DMACON2bits_t DMACON2bits;
2711 #define _INTLVL0 0x01
2712 #define _INTLVL1 0x02
2713 #define _INTLVL2 0x04
2714 #define _INTLVL3 0x08
2715 #define _DLYCYC0 0x10
2716 #define _DLYCYC1 0x20
2717 #define _DLYCYC2 0x40
2718 #define _DLYCYC3 0x80
2720 //==============================================================================
2723 //==============================================================================
2724 // DMACON1 Bits
2726 extern __at(0x0F88) __sfr DMACON1;
2728 typedef union
2730 struct
2732 unsigned DMAEN : 1;
2733 unsigned DLYINTEN : 1;
2734 unsigned DUPLEX0 : 1;
2735 unsigned DUPLEX1 : 1;
2736 unsigned RXINC : 1;
2737 unsigned TXINC : 1;
2738 unsigned SSCON0 : 1;
2739 unsigned SSCON1 : 1;
2742 struct
2744 unsigned : 2;
2745 unsigned DUPLEX : 2;
2746 unsigned : 4;
2749 struct
2751 unsigned : 6;
2752 unsigned SSCON : 2;
2754 } __DMACON1bits_t;
2756 extern __at(0x0F88) volatile __DMACON1bits_t DMACON1bits;
2758 #define _DMAEN 0x01
2759 #define _DLYINTEN 0x02
2760 #define _DUPLEX0 0x04
2761 #define _DUPLEX1 0x08
2762 #define _RXINC 0x10
2763 #define _TXINC 0x20
2764 #define _SSCON0 0x40
2765 #define _SSCON1 0x80
2767 //==============================================================================
2770 //==============================================================================
2771 // LATA Bits
2773 extern __at(0x0F89) __sfr LATA;
2775 typedef struct
2777 unsigned LATA0 : 1;
2778 unsigned LATA1 : 1;
2779 unsigned LATA2 : 1;
2780 unsigned LATA3 : 1;
2781 unsigned : 1;
2782 unsigned LATA5 : 1;
2783 unsigned LATA6 : 1;
2784 unsigned LATA7 : 1;
2785 } __LATAbits_t;
2787 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2789 #define _LATA0 0x01
2790 #define _LATA1 0x02
2791 #define _LATA2 0x04
2792 #define _LATA3 0x08
2793 #define _LATA5 0x20
2794 #define _LATA6 0x40
2795 #define _LATA7 0x80
2797 //==============================================================================
2800 //==============================================================================
2801 // LATB Bits
2803 extern __at(0x0F8A) __sfr LATB;
2805 typedef struct
2807 unsigned LATB0 : 1;
2808 unsigned LATB1 : 1;
2809 unsigned LATB2 : 1;
2810 unsigned LATB3 : 1;
2811 unsigned LATB4 : 1;
2812 unsigned LATB5 : 1;
2813 unsigned LATB6 : 1;
2814 unsigned LATB7 : 1;
2815 } __LATBbits_t;
2817 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2819 #define _LATB0 0x01
2820 #define _LATB1 0x02
2821 #define _LATB2 0x04
2822 #define _LATB3 0x08
2823 #define _LATB4 0x10
2824 #define _LATB5 0x20
2825 #define _LATB6 0x40
2826 #define _LATB7 0x80
2828 //==============================================================================
2831 //==============================================================================
2832 // LATC Bits
2834 extern __at(0x0F8B) __sfr LATC;
2836 typedef struct
2838 unsigned LATC0 : 1;
2839 unsigned LATC1 : 1;
2840 unsigned LATC2 : 1;
2841 unsigned : 1;
2842 unsigned LATC4 : 1;
2843 unsigned LATC5 : 1;
2844 unsigned LATC6 : 1;
2845 unsigned LATC7 : 1;
2846 } __LATCbits_t;
2848 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2850 #define _LATC0 0x01
2851 #define _LATC1 0x02
2852 #define _LATC2 0x04
2853 #define _LATC4 0x10
2854 #define _LATC5 0x20
2855 #define _LATC6 0x40
2856 #define _LATC7 0x80
2858 //==============================================================================
2861 //==============================================================================
2862 // LATD Bits
2864 extern __at(0x0F8C) __sfr LATD;
2866 typedef struct
2868 unsigned LATD0 : 1;
2869 unsigned LATD1 : 1;
2870 unsigned LATD2 : 1;
2871 unsigned LATD3 : 1;
2872 unsigned LATD4 : 1;
2873 unsigned LATD5 : 1;
2874 unsigned LATD6 : 1;
2875 unsigned LATD7 : 1;
2876 } __LATDbits_t;
2878 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2880 #define _LATD0 0x01
2881 #define _LATD1 0x02
2882 #define _LATD2 0x04
2883 #define _LATD3 0x08
2884 #define _LATD4 0x10
2885 #define _LATD5 0x20
2886 #define _LATD6 0x40
2887 #define _LATD7 0x80
2889 //==============================================================================
2892 //==============================================================================
2893 // LATE Bits
2895 extern __at(0x0F8D) __sfr LATE;
2897 typedef union
2899 struct
2901 unsigned LATE0 : 1;
2902 unsigned LATE1 : 1;
2903 unsigned LATE2 : 1;
2904 unsigned : 1;
2905 unsigned : 1;
2906 unsigned : 1;
2907 unsigned : 1;
2908 unsigned : 1;
2911 struct
2913 unsigned LATE : 3;
2914 unsigned : 5;
2916 } __LATEbits_t;
2918 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2920 #define _LATE0 0x01
2921 #define _LATE1 0x02
2922 #define _LATE2 0x04
2924 //==============================================================================
2926 extern __at(0x0F8E) __sfr ALRMVALL;
2927 extern __at(0x0F8F) __sfr ALRMVALH;
2929 //==============================================================================
2930 // ALRMRPT Bits
2932 extern __at(0x0F90) __sfr ALRMRPT;
2934 typedef struct
2936 unsigned ARPT0 : 1;
2937 unsigned ARPT1 : 1;
2938 unsigned ARPT2 : 1;
2939 unsigned ARPT3 : 1;
2940 unsigned ARPT4 : 1;
2941 unsigned ARPT5 : 1;
2942 unsigned ARPT6 : 1;
2943 unsigned ARPT7 : 1;
2944 } __ALRMRPTbits_t;
2946 extern __at(0x0F90) volatile __ALRMRPTbits_t ALRMRPTbits;
2948 #define _ARPT0 0x01
2949 #define _ARPT1 0x02
2950 #define _ARPT2 0x04
2951 #define _ARPT3 0x08
2952 #define _ARPT4 0x10
2953 #define _ARPT5 0x20
2954 #define _ARPT6 0x40
2955 #define _ARPT7 0x80
2957 //==============================================================================
2960 //==============================================================================
2961 // ALRMCFG Bits
2963 extern __at(0x0F91) __sfr ALRMCFG;
2965 typedef union
2967 struct
2969 unsigned ALRMPTR0 : 1;
2970 unsigned ALRMPTR1 : 1;
2971 unsigned AMASK0 : 1;
2972 unsigned AMASK1 : 1;
2973 unsigned AMASK2 : 1;
2974 unsigned AMASK3 : 1;
2975 unsigned CHIME : 1;
2976 unsigned ALRMEN : 1;
2979 struct
2981 unsigned ALRMPTR : 2;
2982 unsigned : 6;
2985 struct
2987 unsigned : 2;
2988 unsigned AMASK : 4;
2989 unsigned : 2;
2991 } __ALRMCFGbits_t;
2993 extern __at(0x0F91) volatile __ALRMCFGbits_t ALRMCFGbits;
2995 #define _ALRMPTR0 0x01
2996 #define _ALRMPTR1 0x02
2997 #define _AMASK0 0x04
2998 #define _AMASK1 0x08
2999 #define _AMASK2 0x10
3000 #define _AMASK3 0x20
3001 #define _CHIME 0x40
3002 #define _ALRMEN 0x80
3004 //==============================================================================
3007 //==============================================================================
3008 // TRISA Bits
3010 extern __at(0x0F92) __sfr TRISA;
3012 typedef struct
3014 unsigned TRISA0 : 1;
3015 unsigned TRISA1 : 1;
3016 unsigned TRISA2 : 1;
3017 unsigned TRISA3 : 1;
3018 unsigned : 1;
3019 unsigned TRISA5 : 1;
3020 unsigned TRISA6 : 1;
3021 unsigned TRISA7 : 1;
3022 } __TRISAbits_t;
3024 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
3026 #define _TRISA0 0x01
3027 #define _TRISA1 0x02
3028 #define _TRISA2 0x04
3029 #define _TRISA3 0x08
3030 #define _TRISA5 0x20
3031 #define _TRISA6 0x40
3032 #define _TRISA7 0x80
3034 //==============================================================================
3037 //==============================================================================
3038 // TRISB Bits
3040 extern __at(0x0F93) __sfr TRISB;
3042 typedef struct
3044 unsigned TRISB0 : 1;
3045 unsigned TRISB1 : 1;
3046 unsigned TRISB2 : 1;
3047 unsigned TRISB3 : 1;
3048 unsigned TRISB4 : 1;
3049 unsigned TRISB5 : 1;
3050 unsigned TRISB6 : 1;
3051 unsigned TRISB7 : 1;
3052 } __TRISBbits_t;
3054 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3056 #define _TRISB0 0x01
3057 #define _TRISB1 0x02
3058 #define _TRISB2 0x04
3059 #define _TRISB3 0x08
3060 #define _TRISB4 0x10
3061 #define _TRISB5 0x20
3062 #define _TRISB6 0x40
3063 #define _TRISB7 0x80
3065 //==============================================================================
3068 //==============================================================================
3069 // TRISC Bits
3071 extern __at(0x0F94) __sfr TRISC;
3073 typedef struct
3075 unsigned TRISC0 : 1;
3076 unsigned TRISC1 : 1;
3077 unsigned TRISC2 : 1;
3078 unsigned : 1;
3079 unsigned TRISC4 : 1;
3080 unsigned TRISC5 : 1;
3081 unsigned TRISC6 : 1;
3082 unsigned TRISC7 : 1;
3083 } __TRISCbits_t;
3085 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3087 #define _TRISC0 0x01
3088 #define _TRISC1 0x02
3089 #define _TRISC2 0x04
3090 #define _TRISC4 0x10
3091 #define _TRISC5 0x20
3092 #define _TRISC6 0x40
3093 #define _TRISC7 0x80
3095 //==============================================================================
3098 //==============================================================================
3099 // TRISD Bits
3101 extern __at(0x0F95) __sfr TRISD;
3103 typedef struct
3105 unsigned TRISD0 : 1;
3106 unsigned TRISD1 : 1;
3107 unsigned TRISD2 : 1;
3108 unsigned TRISD3 : 1;
3109 unsigned TRISD4 : 1;
3110 unsigned TRISD5 : 1;
3111 unsigned TRISD6 : 1;
3112 unsigned TRISD7 : 1;
3113 } __TRISDbits_t;
3115 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
3117 #define _TRISD0 0x01
3118 #define _TRISD1 0x02
3119 #define _TRISD2 0x04
3120 #define _TRISD3 0x08
3121 #define _TRISD4 0x10
3122 #define _TRISD5 0x20
3123 #define _TRISD6 0x40
3124 #define _TRISD7 0x80
3126 //==============================================================================
3129 //==============================================================================
3130 // TRISE Bits
3132 extern __at(0x0F96) __sfr TRISE;
3134 typedef union
3136 struct
3138 unsigned TRISE0 : 1;
3139 unsigned TRISE1 : 1;
3140 unsigned TRISE2 : 1;
3141 unsigned : 1;
3142 unsigned : 1;
3143 unsigned : 1;
3144 unsigned : 1;
3145 unsigned : 1;
3148 struct
3150 unsigned TRISE : 3;
3151 unsigned : 5;
3153 } __TRISEbits_t;
3155 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
3157 #define _TRISE0 0x01
3158 #define _TRISE1 0x02
3159 #define _TRISE2 0x04
3161 //==============================================================================
3164 //==============================================================================
3165 // T3GCON Bits
3167 extern __at(0x0F97) __sfr T3GCON;
3169 typedef union
3171 struct
3173 unsigned T3GSS0 : 1;
3174 unsigned T3GSS1 : 1;
3175 unsigned T3GVAL : 1;
3176 unsigned T3GGO_T3DONE : 1;
3177 unsigned T3GSPM : 1;
3178 unsigned T3GTM : 1;
3179 unsigned T3GPOL : 1;
3180 unsigned TMR3GE : 1;
3183 struct
3185 unsigned : 1;
3186 unsigned : 1;
3187 unsigned : 1;
3188 unsigned T3GGO : 1;
3189 unsigned : 1;
3190 unsigned : 1;
3191 unsigned : 1;
3192 unsigned : 1;
3195 struct
3197 unsigned : 1;
3198 unsigned : 1;
3199 unsigned : 1;
3200 unsigned T3DONE : 1;
3201 unsigned : 1;
3202 unsigned : 1;
3203 unsigned : 1;
3204 unsigned : 1;
3207 struct
3209 unsigned T3GSS : 2;
3210 unsigned : 6;
3212 } __T3GCONbits_t;
3214 extern __at(0x0F97) volatile __T3GCONbits_t T3GCONbits;
3216 #define _T3GSS0 0x01
3217 #define _T3GSS1 0x02
3218 #define _T3GVAL 0x04
3219 #define _T3GGO_T3DONE 0x08
3220 #define _T3GGO 0x08
3221 #define _T3DONE 0x08
3222 #define _T3GSPM 0x10
3223 #define _T3GTM 0x20
3224 #define _T3GPOL 0x40
3225 #define _TMR3GE 0x80
3227 //==============================================================================
3229 extern __at(0x0F98) __sfr RTCVALL;
3230 extern __at(0x0F99) __sfr RTCVALH;
3232 //==============================================================================
3233 // T1GCON Bits
3235 extern __at(0x0F9A) __sfr T1GCON;
3237 typedef union
3239 struct
3241 unsigned T1GSS0 : 1;
3242 unsigned T1GSS1 : 1;
3243 unsigned T1GVAL : 1;
3244 unsigned T1GGO_T1DONE : 1;
3245 unsigned T1GSPM : 1;
3246 unsigned T1GTM : 1;
3247 unsigned T1GPOL : 1;
3248 unsigned TMR1GE : 1;
3251 struct
3253 unsigned : 1;
3254 unsigned : 1;
3255 unsigned : 1;
3256 unsigned T1GGO : 1;
3257 unsigned : 1;
3258 unsigned : 1;
3259 unsigned : 1;
3260 unsigned : 1;
3263 struct
3265 unsigned : 1;
3266 unsigned : 1;
3267 unsigned : 1;
3268 unsigned T1DONE : 1;
3269 unsigned : 1;
3270 unsigned : 1;
3271 unsigned : 1;
3272 unsigned : 1;
3275 struct
3277 unsigned T1GSS : 2;
3278 unsigned : 6;
3280 } __T1GCONbits_t;
3282 extern __at(0x0F9A) volatile __T1GCONbits_t T1GCONbits;
3284 #define _T1GSS0 0x01
3285 #define _T1GSS1 0x02
3286 #define _T1GVAL 0x04
3287 #define _T1GGO_T1DONE 0x08
3288 #define _T1GGO 0x08
3289 #define _T1DONE 0x08
3290 #define _T1GSPM 0x10
3291 #define _T1GTM 0x20
3292 #define _T1GPOL 0x40
3293 #define _TMR1GE 0x80
3295 //==============================================================================
3298 //==============================================================================
3299 // OSCTUNE Bits
3301 extern __at(0x0F9B) __sfr OSCTUNE;
3303 typedef union
3305 struct
3307 unsigned TUN0 : 1;
3308 unsigned TUN1 : 1;
3309 unsigned TUN2 : 1;
3310 unsigned TUN3 : 1;
3311 unsigned TUN4 : 1;
3312 unsigned TUN5 : 1;
3313 unsigned PLLEN : 1;
3314 unsigned INTSRC : 1;
3317 struct
3319 unsigned TUN : 6;
3320 unsigned : 2;
3322 } __OSCTUNEbits_t;
3324 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3326 #define _TUN0 0x01
3327 #define _TUN1 0x02
3328 #define _TUN2 0x04
3329 #define _TUN3 0x08
3330 #define _TUN4 0x10
3331 #define _TUN5 0x20
3332 #define _PLLEN 0x40
3333 #define _INTSRC 0x80
3335 //==============================================================================
3338 //==============================================================================
3339 // RCSTA2 Bits
3341 extern __at(0x0F9C) __sfr RCSTA2;
3343 typedef union
3345 struct
3347 unsigned RX9D : 1;
3348 unsigned OERR : 1;
3349 unsigned FERR : 1;
3350 unsigned ADDEN : 1;
3351 unsigned CREN : 1;
3352 unsigned SREN : 1;
3353 unsigned RX9 : 1;
3354 unsigned SPEN : 1;
3357 struct
3359 unsigned RX9D2 : 1;
3360 unsigned OERR2 : 1;
3361 unsigned FERR2 : 1;
3362 unsigned ADDEN2 : 1;
3363 unsigned CREN2 : 1;
3364 unsigned SREN2 : 1;
3365 unsigned RX92 : 1;
3366 unsigned SPEN2 : 1;
3368 } __RCSTA2bits_t;
3370 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
3372 #define _RCSTA2_RX9D 0x01
3373 #define _RCSTA2_RX9D2 0x01
3374 #define _RCSTA2_OERR 0x02
3375 #define _RCSTA2_OERR2 0x02
3376 #define _RCSTA2_FERR 0x04
3377 #define _RCSTA2_FERR2 0x04
3378 #define _RCSTA2_ADDEN 0x08
3379 #define _RCSTA2_ADDEN2 0x08
3380 #define _RCSTA2_CREN 0x10
3381 #define _RCSTA2_CREN2 0x10
3382 #define _RCSTA2_SREN 0x20
3383 #define _RCSTA2_SREN2 0x20
3384 #define _RCSTA2_RX9 0x40
3385 #define _RCSTA2_RX92 0x40
3386 #define _RCSTA2_SPEN 0x80
3387 #define _RCSTA2_SPEN2 0x80
3389 //==============================================================================
3392 //==============================================================================
3393 // PIE1 Bits
3395 extern __at(0x0F9D) __sfr PIE1;
3397 typedef union
3399 struct
3401 unsigned TMR1IE : 1;
3402 unsigned TMR2IE : 1;
3403 unsigned CCP1IE : 1;
3404 unsigned SSP1IE : 1;
3405 unsigned TX1IE : 1;
3406 unsigned RC1IE : 1;
3407 unsigned ADIE : 1;
3408 unsigned PMPIE : 1;
3411 struct
3413 unsigned : 1;
3414 unsigned : 1;
3415 unsigned : 1;
3416 unsigned SSPIE : 1;
3417 unsigned TXIE : 1;
3418 unsigned RCIE : 1;
3419 unsigned : 1;
3420 unsigned : 1;
3422 } __PIE1bits_t;
3424 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3426 #define _TMR1IE 0x01
3427 #define _TMR2IE 0x02
3428 #define _CCP1IE 0x04
3429 #define _SSP1IE 0x08
3430 #define _SSPIE 0x08
3431 #define _TX1IE 0x10
3432 #define _TXIE 0x10
3433 #define _RC1IE 0x20
3434 #define _RCIE 0x20
3435 #define _ADIE 0x40
3436 #define _PMPIE 0x80
3438 //==============================================================================
3441 //==============================================================================
3442 // PIR1 Bits
3444 extern __at(0x0F9E) __sfr PIR1;
3446 typedef union
3448 struct
3450 unsigned TMR1IF : 1;
3451 unsigned TMR2IF : 1;
3452 unsigned CCP1IF : 1;
3453 unsigned SSP1IF : 1;
3454 unsigned TX1IF : 1;
3455 unsigned RC1IF : 1;
3456 unsigned ADIF : 1;
3457 unsigned PMPIF : 1;
3460 struct
3462 unsigned : 1;
3463 unsigned : 1;
3464 unsigned : 1;
3465 unsigned SSPIF : 1;
3466 unsigned TXIF : 1;
3467 unsigned RCIF : 1;
3468 unsigned : 1;
3469 unsigned : 1;
3471 } __PIR1bits_t;
3473 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3475 #define _TMR1IF 0x01
3476 #define _TMR2IF 0x02
3477 #define _CCP1IF 0x04
3478 #define _SSP1IF 0x08
3479 #define _SSPIF 0x08
3480 #define _TX1IF 0x10
3481 #define _TXIF 0x10
3482 #define _RC1IF 0x20
3483 #define _RCIF 0x20
3484 #define _ADIF 0x40
3485 #define _PMPIF 0x80
3487 //==============================================================================
3490 //==============================================================================
3491 // IPR1 Bits
3493 extern __at(0x0F9F) __sfr IPR1;
3495 typedef union
3497 struct
3499 unsigned TMR1IP : 1;
3500 unsigned TMR2IP : 1;
3501 unsigned CCP1IP : 1;
3502 unsigned SSP1IP : 1;
3503 unsigned TX1IP : 1;
3504 unsigned RC1IP : 1;
3505 unsigned ADIP : 1;
3506 unsigned PMPIP : 1;
3509 struct
3511 unsigned : 1;
3512 unsigned : 1;
3513 unsigned : 1;
3514 unsigned SSPIP : 1;
3515 unsigned TXIP : 1;
3516 unsigned RCIP : 1;
3517 unsigned : 1;
3518 unsigned : 1;
3520 } __IPR1bits_t;
3522 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3524 #define _TMR1IP 0x01
3525 #define _TMR2IP 0x02
3526 #define _CCP1IP 0x04
3527 #define _SSP1IP 0x08
3528 #define _SSPIP 0x08
3529 #define _TX1IP 0x10
3530 #define _TXIP 0x10
3531 #define _RC1IP 0x20
3532 #define _RCIP 0x20
3533 #define _ADIP 0x40
3534 #define _PMPIP 0x80
3536 //==============================================================================
3539 //==============================================================================
3540 // PIE2 Bits
3542 extern __at(0x0FA0) __sfr PIE2;
3544 typedef union
3546 struct
3548 unsigned CCP2IE : 1;
3549 unsigned TMR3IE : 1;
3550 unsigned LVDIE : 1;
3551 unsigned BCL1IE : 1;
3552 unsigned USBIE : 1;
3553 unsigned CM1IE : 1;
3554 unsigned CM2IE : 1;
3555 unsigned OSCFIE : 1;
3558 struct
3560 unsigned : 1;
3561 unsigned : 1;
3562 unsigned : 1;
3563 unsigned BCLIE : 1;
3564 unsigned : 1;
3565 unsigned : 1;
3566 unsigned : 1;
3567 unsigned : 1;
3569 } __PIE2bits_t;
3571 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3573 #define _CCP2IE 0x01
3574 #define _TMR3IE 0x02
3575 #define _LVDIE 0x04
3576 #define _BCL1IE 0x08
3577 #define _BCLIE 0x08
3578 #define _USBIE 0x10
3579 #define _CM1IE 0x20
3580 #define _CM2IE 0x40
3581 #define _OSCFIE 0x80
3583 //==============================================================================
3586 //==============================================================================
3587 // PIR2 Bits
3589 extern __at(0x0FA1) __sfr PIR2;
3591 typedef union
3593 struct
3595 unsigned CCP2IF : 1;
3596 unsigned TMR3IF : 1;
3597 unsigned LVDIF : 1;
3598 unsigned BCL1IF : 1;
3599 unsigned USBIF : 1;
3600 unsigned CM1IF : 1;
3601 unsigned CM2IF : 1;
3602 unsigned OSCFIF : 1;
3605 struct
3607 unsigned : 1;
3608 unsigned : 1;
3609 unsigned : 1;
3610 unsigned BCLIF : 1;
3611 unsigned : 1;
3612 unsigned : 1;
3613 unsigned : 1;
3614 unsigned : 1;
3616 } __PIR2bits_t;
3618 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3620 #define _CCP2IF 0x01
3621 #define _TMR3IF 0x02
3622 #define _LVDIF 0x04
3623 #define _BCL1IF 0x08
3624 #define _BCLIF 0x08
3625 #define _USBIF 0x10
3626 #define _CM1IF 0x20
3627 #define _CM2IF 0x40
3628 #define _OSCFIF 0x80
3630 //==============================================================================
3633 //==============================================================================
3634 // IPR2 Bits
3636 extern __at(0x0FA2) __sfr IPR2;
3638 typedef union
3640 struct
3642 unsigned CCP2IP : 1;
3643 unsigned TMR3IP : 1;
3644 unsigned LVDIP : 1;
3645 unsigned BCL1IP : 1;
3646 unsigned USBIP : 1;
3647 unsigned CM1IP : 1;
3648 unsigned CM2IP : 1;
3649 unsigned OSCFIP : 1;
3652 struct
3654 unsigned : 1;
3655 unsigned : 1;
3656 unsigned : 1;
3657 unsigned BCLIP : 1;
3658 unsigned : 1;
3659 unsigned : 1;
3660 unsigned : 1;
3661 unsigned : 1;
3663 } __IPR2bits_t;
3665 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3667 #define _CCP2IP 0x01
3668 #define _TMR3IP 0x02
3669 #define _LVDIP 0x04
3670 #define _BCL1IP 0x08
3671 #define _BCLIP 0x08
3672 #define _USBIP 0x10
3673 #define _CM1IP 0x20
3674 #define _CM2IP 0x40
3675 #define _OSCFIP 0x80
3677 //==============================================================================
3680 //==============================================================================
3681 // PIE3 Bits
3683 extern __at(0x0FA3) __sfr PIE3;
3685 typedef struct
3687 unsigned RTCCIE : 1;
3688 unsigned TMR3GIE : 1;
3689 unsigned CTMUIE : 1;
3690 unsigned TMR4IE : 1;
3691 unsigned TX2IE : 1;
3692 unsigned RC2IE : 1;
3693 unsigned BCL2IE : 1;
3694 unsigned SSP2IE : 1;
3695 } __PIE3bits_t;
3697 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3699 #define _RTCCIE 0x01
3700 #define _TMR3GIE 0x02
3701 #define _CTMUIE 0x04
3702 #define _TMR4IE 0x08
3703 #define _TX2IE 0x10
3704 #define _RC2IE 0x20
3705 #define _BCL2IE 0x40
3706 #define _SSP2IE 0x80
3708 //==============================================================================
3711 //==============================================================================
3712 // PIR3 Bits
3714 extern __at(0x0FA4) __sfr PIR3;
3716 typedef struct
3718 unsigned RTCCIF : 1;
3719 unsigned TMR3GIF : 1;
3720 unsigned CTMUIF : 1;
3721 unsigned TMR4IF : 1;
3722 unsigned TX2IF : 1;
3723 unsigned RC2IF : 1;
3724 unsigned BCL2IF : 1;
3725 unsigned SSP2IF : 1;
3726 } __PIR3bits_t;
3728 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3730 #define _RTCCIF 0x01
3731 #define _TMR3GIF 0x02
3732 #define _CTMUIF 0x04
3733 #define _TMR4IF 0x08
3734 #define _TX2IF 0x10
3735 #define _RC2IF 0x20
3736 #define _BCL2IF 0x40
3737 #define _SSP2IF 0x80
3739 //==============================================================================
3742 //==============================================================================
3743 // IPR3 Bits
3745 extern __at(0x0FA5) __sfr IPR3;
3747 typedef struct
3749 unsigned RTCCIP : 1;
3750 unsigned TMR3GIP : 1;
3751 unsigned CTMUIP : 1;
3752 unsigned TMR4IP : 1;
3753 unsigned TX2IP : 1;
3754 unsigned RC2IP : 1;
3755 unsigned BCL2IP : 1;
3756 unsigned SSP2IP : 1;
3757 } __IPR3bits_t;
3759 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3761 #define _RTCCIP 0x01
3762 #define _TMR3GIP 0x02
3763 #define _CTMUIP 0x04
3764 #define _TMR4IP 0x08
3765 #define _TX2IP 0x10
3766 #define _RC2IP 0x20
3767 #define _BCL2IP 0x40
3768 #define _SSP2IP 0x80
3770 //==============================================================================
3773 //==============================================================================
3774 // EECON1 Bits
3776 extern __at(0x0FA6) __sfr EECON1;
3778 typedef struct
3780 unsigned : 1;
3781 unsigned WR : 1;
3782 unsigned WREN : 1;
3783 unsigned WRERR : 1;
3784 unsigned FREE : 1;
3785 unsigned WPROG : 1;
3786 unsigned : 1;
3787 unsigned : 1;
3788 } __EECON1bits_t;
3790 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3792 #define _WR 0x02
3793 #define _WREN 0x04
3794 #define _WRERR 0x08
3795 #define _FREE 0x10
3796 #define _WPROG 0x20
3798 //==============================================================================
3800 extern __at(0x0FA7) __sfr EECON2;
3802 //==============================================================================
3803 // TXSTA2 Bits
3805 extern __at(0x0FA8) __sfr TXSTA2;
3807 typedef union
3809 struct
3811 unsigned TX9D : 1;
3812 unsigned TRMT : 1;
3813 unsigned BRGH : 1;
3814 unsigned SENDB : 1;
3815 unsigned SYNC : 1;
3816 unsigned TXEN : 1;
3817 unsigned TX9 : 1;
3818 unsigned CSRC : 1;
3821 struct
3823 unsigned TX9D2 : 1;
3824 unsigned TRMT2 : 1;
3825 unsigned BRGH2 : 1;
3826 unsigned SENDB2 : 1;
3827 unsigned SYNC2 : 1;
3828 unsigned TXEN2 : 1;
3829 unsigned TX92 : 1;
3830 unsigned CSRC2 : 1;
3832 } __TXSTA2bits_t;
3834 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
3836 #define _TXSTA2_TX9D 0x01
3837 #define _TXSTA2_TX9D2 0x01
3838 #define _TXSTA2_TRMT 0x02
3839 #define _TXSTA2_TRMT2 0x02
3840 #define _TXSTA2_BRGH 0x04
3841 #define _TXSTA2_BRGH2 0x04
3842 #define _TXSTA2_SENDB 0x08
3843 #define _TXSTA2_SENDB2 0x08
3844 #define _TXSTA2_SYNC 0x10
3845 #define _TXSTA2_SYNC2 0x10
3846 #define _TXSTA2_TXEN 0x20
3847 #define _TXSTA2_TXEN2 0x20
3848 #define _TXSTA2_TX9 0x40
3849 #define _TXSTA2_TX92 0x40
3850 #define _TXSTA2_CSRC 0x80
3851 #define _TXSTA2_CSRC2 0x80
3853 //==============================================================================
3855 extern __at(0x0FA9) __sfr TXREG2;
3856 extern __at(0x0FAA) __sfr RCREG2;
3857 extern __at(0x0FAB) __sfr SPBRG2;
3859 //==============================================================================
3860 // RCSTA Bits
3862 extern __at(0x0FAC) __sfr RCSTA;
3864 typedef union
3866 struct
3868 unsigned RX9D : 1;
3869 unsigned OERR : 1;
3870 unsigned FERR : 1;
3871 unsigned ADDEN : 1;
3872 unsigned CREN : 1;
3873 unsigned SREN : 1;
3874 unsigned RX9 : 1;
3875 unsigned SPEN : 1;
3878 struct
3880 unsigned RCD8 : 1;
3881 unsigned OERR1 : 1;
3882 unsigned FERR1 : 1;
3883 unsigned ADEN : 1;
3884 unsigned CREN1 : 1;
3885 unsigned SREN1 : 1;
3886 unsigned RC9 : 1;
3887 unsigned SPEN1 : 1;
3890 struct
3892 unsigned RX9D1 : 1;
3893 unsigned : 1;
3894 unsigned : 1;
3895 unsigned ADDEN1 : 1;
3896 unsigned : 1;
3897 unsigned : 1;
3898 unsigned NOT_RC8 : 1;
3899 unsigned : 1;
3902 struct
3904 unsigned : 1;
3905 unsigned : 1;
3906 unsigned : 1;
3907 unsigned : 1;
3908 unsigned : 1;
3909 unsigned : 1;
3910 unsigned RC8_9 : 1;
3911 unsigned : 1;
3914 struct
3916 unsigned : 1;
3917 unsigned : 1;
3918 unsigned : 1;
3919 unsigned : 1;
3920 unsigned : 1;
3921 unsigned : 1;
3922 unsigned RX91 : 1;
3923 unsigned : 1;
3925 } __RCSTAbits_t;
3927 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
3929 #define _RX9D 0x01
3930 #define _RCD8 0x01
3931 #define _RX9D1 0x01
3932 #define _OERR 0x02
3933 #define _OERR1 0x02
3934 #define _FERR 0x04
3935 #define _FERR1 0x04
3936 #define _ADDEN 0x08
3937 #define _ADEN 0x08
3938 #define _ADDEN1 0x08
3939 #define _CREN 0x10
3940 #define _CREN1 0x10
3941 #define _SREN 0x20
3942 #define _SREN1 0x20
3943 #define _RX9 0x40
3944 #define _RC9 0x40
3945 #define _NOT_RC8 0x40
3946 #define _RC8_9 0x40
3947 #define _RX91 0x40
3948 #define _SPEN 0x80
3949 #define _SPEN1 0x80
3951 //==============================================================================
3954 //==============================================================================
3955 // RCSTA1 Bits
3957 extern __at(0x0FAC) __sfr RCSTA1;
3959 typedef union
3961 struct
3963 unsigned RX9D : 1;
3964 unsigned OERR : 1;
3965 unsigned FERR : 1;
3966 unsigned ADDEN : 1;
3967 unsigned CREN : 1;
3968 unsigned SREN : 1;
3969 unsigned RX9 : 1;
3970 unsigned SPEN : 1;
3973 struct
3975 unsigned RCD8 : 1;
3976 unsigned OERR1 : 1;
3977 unsigned FERR1 : 1;
3978 unsigned ADEN : 1;
3979 unsigned CREN1 : 1;
3980 unsigned SREN1 : 1;
3981 unsigned RC9 : 1;
3982 unsigned SPEN1 : 1;
3985 struct
3987 unsigned RX9D1 : 1;
3988 unsigned : 1;
3989 unsigned : 1;
3990 unsigned ADDEN1 : 1;
3991 unsigned : 1;
3992 unsigned : 1;
3993 unsigned NOT_RC8 : 1;
3994 unsigned : 1;
3997 struct
3999 unsigned : 1;
4000 unsigned : 1;
4001 unsigned : 1;
4002 unsigned : 1;
4003 unsigned : 1;
4004 unsigned : 1;
4005 unsigned RC8_9 : 1;
4006 unsigned : 1;
4009 struct
4011 unsigned : 1;
4012 unsigned : 1;
4013 unsigned : 1;
4014 unsigned : 1;
4015 unsigned : 1;
4016 unsigned : 1;
4017 unsigned RX91 : 1;
4018 unsigned : 1;
4020 } __RCSTA1bits_t;
4022 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
4024 #define _RCSTA1_RX9D 0x01
4025 #define _RCSTA1_RCD8 0x01
4026 #define _RCSTA1_RX9D1 0x01
4027 #define _RCSTA1_OERR 0x02
4028 #define _RCSTA1_OERR1 0x02
4029 #define _RCSTA1_FERR 0x04
4030 #define _RCSTA1_FERR1 0x04
4031 #define _RCSTA1_ADDEN 0x08
4032 #define _RCSTA1_ADEN 0x08
4033 #define _RCSTA1_ADDEN1 0x08
4034 #define _RCSTA1_CREN 0x10
4035 #define _RCSTA1_CREN1 0x10
4036 #define _RCSTA1_SREN 0x20
4037 #define _RCSTA1_SREN1 0x20
4038 #define _RCSTA1_RX9 0x40
4039 #define _RCSTA1_RC9 0x40
4040 #define _RCSTA1_NOT_RC8 0x40
4041 #define _RCSTA1_RC8_9 0x40
4042 #define _RCSTA1_RX91 0x40
4043 #define _RCSTA1_SPEN 0x80
4044 #define _RCSTA1_SPEN1 0x80
4046 //==============================================================================
4049 //==============================================================================
4050 // TXSTA Bits
4052 extern __at(0x0FAD) __sfr TXSTA;
4054 typedef union
4056 struct
4058 unsigned TX9D : 1;
4059 unsigned TRMT : 1;
4060 unsigned BRGH : 1;
4061 unsigned SENDB : 1;
4062 unsigned SYNC : 1;
4063 unsigned TXEN : 1;
4064 unsigned TX9 : 1;
4065 unsigned CSRC : 1;
4068 struct
4070 unsigned TXD8 : 1;
4071 unsigned TRMT1 : 1;
4072 unsigned BRGH1 : 1;
4073 unsigned SENDB1 : 1;
4074 unsigned SYNC1 : 1;
4075 unsigned TXEN1 : 1;
4076 unsigned TX8_9 : 1;
4077 unsigned CSRC1 : 1;
4080 struct
4082 unsigned TX9D1 : 1;
4083 unsigned : 1;
4084 unsigned : 1;
4085 unsigned : 1;
4086 unsigned : 1;
4087 unsigned : 1;
4088 unsigned NOT_TX8 : 1;
4089 unsigned : 1;
4092 struct
4094 unsigned : 1;
4095 unsigned : 1;
4096 unsigned : 1;
4097 unsigned : 1;
4098 unsigned : 1;
4099 unsigned : 1;
4100 unsigned TX91 : 1;
4101 unsigned : 1;
4103 } __TXSTAbits_t;
4105 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
4107 #define _TX9D 0x01
4108 #define _TXD8 0x01
4109 #define _TX9D1 0x01
4110 #define _TRMT 0x02
4111 #define _TRMT1 0x02
4112 #define _BRGH 0x04
4113 #define _BRGH1 0x04
4114 #define _SENDB 0x08
4115 #define _SENDB1 0x08
4116 #define _SYNC 0x10
4117 #define _SYNC1 0x10
4118 #define _TXEN 0x20
4119 #define _TXEN1 0x20
4120 #define _TX9 0x40
4121 #define _TX8_9 0x40
4122 #define _NOT_TX8 0x40
4123 #define _TX91 0x40
4124 #define _CSRC 0x80
4125 #define _CSRC1 0x80
4127 //==============================================================================
4130 //==============================================================================
4131 // TXSTA1 Bits
4133 extern __at(0x0FAD) __sfr TXSTA1;
4135 typedef union
4137 struct
4139 unsigned TX9D : 1;
4140 unsigned TRMT : 1;
4141 unsigned BRGH : 1;
4142 unsigned SENDB : 1;
4143 unsigned SYNC : 1;
4144 unsigned TXEN : 1;
4145 unsigned TX9 : 1;
4146 unsigned CSRC : 1;
4149 struct
4151 unsigned TXD8 : 1;
4152 unsigned TRMT1 : 1;
4153 unsigned BRGH1 : 1;
4154 unsigned SENDB1 : 1;
4155 unsigned SYNC1 : 1;
4156 unsigned TXEN1 : 1;
4157 unsigned TX8_9 : 1;
4158 unsigned CSRC1 : 1;
4161 struct
4163 unsigned TX9D1 : 1;
4164 unsigned : 1;
4165 unsigned : 1;
4166 unsigned : 1;
4167 unsigned : 1;
4168 unsigned : 1;
4169 unsigned NOT_TX8 : 1;
4170 unsigned : 1;
4173 struct
4175 unsigned : 1;
4176 unsigned : 1;
4177 unsigned : 1;
4178 unsigned : 1;
4179 unsigned : 1;
4180 unsigned : 1;
4181 unsigned TX91 : 1;
4182 unsigned : 1;
4184 } __TXSTA1bits_t;
4186 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
4188 #define _TXSTA1_TX9D 0x01
4189 #define _TXSTA1_TXD8 0x01
4190 #define _TXSTA1_TX9D1 0x01
4191 #define _TXSTA1_TRMT 0x02
4192 #define _TXSTA1_TRMT1 0x02
4193 #define _TXSTA1_BRGH 0x04
4194 #define _TXSTA1_BRGH1 0x04
4195 #define _TXSTA1_SENDB 0x08
4196 #define _TXSTA1_SENDB1 0x08
4197 #define _TXSTA1_SYNC 0x10
4198 #define _TXSTA1_SYNC1 0x10
4199 #define _TXSTA1_TXEN 0x20
4200 #define _TXSTA1_TXEN1 0x20
4201 #define _TXSTA1_TX9 0x40
4202 #define _TXSTA1_TX8_9 0x40
4203 #define _TXSTA1_NOT_TX8 0x40
4204 #define _TXSTA1_TX91 0x40
4205 #define _TXSTA1_CSRC 0x80
4206 #define _TXSTA1_CSRC1 0x80
4208 //==============================================================================
4210 extern __at(0x0FAE) __sfr TXREG;
4211 extern __at(0x0FAE) __sfr TXREG1;
4212 extern __at(0x0FAF) __sfr RCREG;
4213 extern __at(0x0FAF) __sfr RCREG1;
4214 extern __at(0x0FB0) __sfr SPBRG;
4215 extern __at(0x0FB0) __sfr SPBRG1;
4217 //==============================================================================
4218 // CTMUICON Bits
4220 extern __at(0x0FB1) __sfr CTMUICON;
4222 typedef union
4224 struct
4226 unsigned IRNG0 : 1;
4227 unsigned IRNG1 : 1;
4228 unsigned ITRIM0 : 1;
4229 unsigned ITRIM1 : 1;
4230 unsigned ITRIM2 : 1;
4231 unsigned ITRIM3 : 1;
4232 unsigned ITRIM4 : 1;
4233 unsigned ITRIM5 : 1;
4236 struct
4238 unsigned IRNG : 2;
4239 unsigned : 6;
4242 struct
4244 unsigned : 2;
4245 unsigned ITRIM : 6;
4247 } __CTMUICONbits_t;
4249 extern __at(0x0FB1) volatile __CTMUICONbits_t CTMUICONbits;
4251 #define _IRNG0 0x01
4252 #define _IRNG1 0x02
4253 #define _ITRIM0 0x04
4254 #define _ITRIM1 0x08
4255 #define _ITRIM2 0x10
4256 #define _ITRIM3 0x20
4257 #define _ITRIM4 0x40
4258 #define _ITRIM5 0x80
4260 //==============================================================================
4263 //==============================================================================
4264 // CTMUCONL Bits
4266 extern __at(0x0FB2) __sfr CTMUCONL;
4268 typedef union
4270 struct
4272 unsigned EDG1STAT : 1;
4273 unsigned EDG2STAT : 1;
4274 unsigned EDG1SEL0 : 1;
4275 unsigned EDG1SEL1 : 1;
4276 unsigned EDG1POL : 1;
4277 unsigned EDG2SEL0 : 1;
4278 unsigned EDG2SEL1 : 1;
4279 unsigned EDG2POL : 1;
4282 struct
4284 unsigned : 2;
4285 unsigned EDG1SEL : 2;
4286 unsigned : 4;
4289 struct
4291 unsigned : 5;
4292 unsigned EDG2SEL : 2;
4293 unsigned : 1;
4295 } __CTMUCONLbits_t;
4297 extern __at(0x0FB2) volatile __CTMUCONLbits_t CTMUCONLbits;
4299 #define _EDG1STAT 0x01
4300 #define _EDG2STAT 0x02
4301 #define _EDG1SEL0 0x04
4302 #define _EDG1SEL1 0x08
4303 #define _EDG1POL 0x10
4304 #define _EDG2SEL0 0x20
4305 #define _EDG2SEL1 0x40
4306 #define _EDG2POL 0x80
4308 //==============================================================================
4311 //==============================================================================
4312 // CTMUCONH Bits
4314 extern __at(0x0FB3) __sfr CTMUCONH;
4316 typedef struct
4318 unsigned CTTRIG : 1;
4319 unsigned IDISSEN : 1;
4320 unsigned EDGSEQEN : 1;
4321 unsigned EDGEN : 1;
4322 unsigned TGEN : 1;
4323 unsigned CTMUSIDL : 1;
4324 unsigned : 1;
4325 unsigned CTMUEN : 1;
4326 } __CTMUCONHbits_t;
4328 extern __at(0x0FB3) volatile __CTMUCONHbits_t CTMUCONHbits;
4330 #define _CTTRIG 0x01
4331 #define _IDISSEN 0x02
4332 #define _EDGSEQEN 0x04
4333 #define _EDGEN 0x08
4334 #define _TGEN 0x10
4335 #define _CTMUSIDL 0x20
4336 #define _CTMUEN 0x80
4338 //==============================================================================
4341 //==============================================================================
4342 // CCP2CON Bits
4344 extern __at(0x0FB4) __sfr CCP2CON;
4346 typedef union
4348 struct
4350 unsigned CCP2M0 : 1;
4351 unsigned CCP2M1 : 1;
4352 unsigned CCP2M2 : 1;
4353 unsigned CCP2M3 : 1;
4354 unsigned DC2B0 : 1;
4355 unsigned DC2B1 : 1;
4356 unsigned P2M0 : 1;
4357 unsigned P2M1 : 1;
4360 struct
4362 unsigned : 1;
4363 unsigned : 1;
4364 unsigned : 1;
4365 unsigned : 1;
4366 unsigned CCP2Y : 1;
4367 unsigned CCP2X : 1;
4368 unsigned : 1;
4369 unsigned : 1;
4372 struct
4374 unsigned CCP2M : 4;
4375 unsigned : 4;
4378 struct
4380 unsigned : 4;
4381 unsigned DC2B : 2;
4382 unsigned : 2;
4385 struct
4387 unsigned : 6;
4388 unsigned P2M : 2;
4390 } __CCP2CONbits_t;
4392 extern __at(0x0FB4) volatile __CCP2CONbits_t CCP2CONbits;
4394 #define _CCP2M0 0x01
4395 #define _CCP2M1 0x02
4396 #define _CCP2M2 0x04
4397 #define _CCP2M3 0x08
4398 #define _DC2B0 0x10
4399 #define _CCP2Y 0x10
4400 #define _DC2B1 0x20
4401 #define _CCP2X 0x20
4402 #define _P2M0 0x40
4403 #define _P2M1 0x80
4405 //==============================================================================
4408 //==============================================================================
4409 // ECCP2CON Bits
4411 extern __at(0x0FB4) __sfr ECCP2CON;
4413 typedef union
4415 struct
4417 unsigned CCP2M0 : 1;
4418 unsigned CCP2M1 : 1;
4419 unsigned CCP2M2 : 1;
4420 unsigned CCP2M3 : 1;
4421 unsigned DC2B0 : 1;
4422 unsigned DC2B1 : 1;
4423 unsigned P2M0 : 1;
4424 unsigned P2M1 : 1;
4427 struct
4429 unsigned : 1;
4430 unsigned : 1;
4431 unsigned : 1;
4432 unsigned : 1;
4433 unsigned CCP2Y : 1;
4434 unsigned CCP2X : 1;
4435 unsigned : 1;
4436 unsigned : 1;
4439 struct
4441 unsigned CCP2M : 4;
4442 unsigned : 4;
4445 struct
4447 unsigned : 4;
4448 unsigned DC2B : 2;
4449 unsigned : 2;
4452 struct
4454 unsigned : 6;
4455 unsigned P2M : 2;
4457 } __ECCP2CONbits_t;
4459 extern __at(0x0FB4) volatile __ECCP2CONbits_t ECCP2CONbits;
4461 #define _ECCP2CON_CCP2M0 0x01
4462 #define _ECCP2CON_CCP2M1 0x02
4463 #define _ECCP2CON_CCP2M2 0x04
4464 #define _ECCP2CON_CCP2M3 0x08
4465 #define _ECCP2CON_DC2B0 0x10
4466 #define _ECCP2CON_CCP2Y 0x10
4467 #define _ECCP2CON_DC2B1 0x20
4468 #define _ECCP2CON_CCP2X 0x20
4469 #define _ECCP2CON_P2M0 0x40
4470 #define _ECCP2CON_P2M1 0x80
4472 //==============================================================================
4474 extern __at(0x0FB5) __sfr CCPR2;
4475 extern __at(0x0FB5) __sfr CCPR2L;
4476 extern __at(0x0FB6) __sfr CCPR2H;
4478 //==============================================================================
4479 // ECCP2DEL Bits
4481 extern __at(0x0FB7) __sfr ECCP2DEL;
4483 typedef union
4485 struct
4487 unsigned P2DC0 : 1;
4488 unsigned P2DC1 : 1;
4489 unsigned P2DC2 : 1;
4490 unsigned P2DC3 : 1;
4491 unsigned P2DC4 : 1;
4492 unsigned P2DC5 : 1;
4493 unsigned P2DC6 : 1;
4494 unsigned P2RSEN : 1;
4497 struct
4499 unsigned P2DC : 7;
4500 unsigned : 1;
4502 } __ECCP2DELbits_t;
4504 extern __at(0x0FB7) volatile __ECCP2DELbits_t ECCP2DELbits;
4506 #define _P2DC0 0x01
4507 #define _P2DC1 0x02
4508 #define _P2DC2 0x04
4509 #define _P2DC3 0x08
4510 #define _P2DC4 0x10
4511 #define _P2DC5 0x20
4512 #define _P2DC6 0x40
4513 #define _P2RSEN 0x80
4515 //==============================================================================
4518 //==============================================================================
4519 // PWM2CON Bits
4521 extern __at(0x0FB7) __sfr PWM2CON;
4523 typedef union
4525 struct
4527 unsigned P2DC0 : 1;
4528 unsigned P2DC1 : 1;
4529 unsigned P2DC2 : 1;
4530 unsigned P2DC3 : 1;
4531 unsigned P2DC4 : 1;
4532 unsigned P2DC5 : 1;
4533 unsigned P2DC6 : 1;
4534 unsigned P2RSEN : 1;
4537 struct
4539 unsigned P2DC : 7;
4540 unsigned : 1;
4542 } __PWM2CONbits_t;
4544 extern __at(0x0FB7) volatile __PWM2CONbits_t PWM2CONbits;
4546 #define _PWM2CON_P2DC0 0x01
4547 #define _PWM2CON_P2DC1 0x02
4548 #define _PWM2CON_P2DC2 0x04
4549 #define _PWM2CON_P2DC3 0x08
4550 #define _PWM2CON_P2DC4 0x10
4551 #define _PWM2CON_P2DC5 0x20
4552 #define _PWM2CON_P2DC6 0x40
4553 #define _PWM2CON_P2RSEN 0x80
4555 //==============================================================================
4558 //==============================================================================
4559 // ECCP2AS Bits
4561 extern __at(0x0FB8) __sfr ECCP2AS;
4563 typedef union
4565 struct
4567 unsigned PSS2BD0 : 1;
4568 unsigned PSS2BD1 : 1;
4569 unsigned PSS2AC0 : 1;
4570 unsigned PSS2AC1 : 1;
4571 unsigned ECCP2AS0 : 1;
4572 unsigned ECCP2AS1 : 1;
4573 unsigned ECCP2AS2 : 1;
4574 unsigned ECCP2ASE : 1;
4577 struct
4579 unsigned PSS2BD : 2;
4580 unsigned : 6;
4583 struct
4585 unsigned : 2;
4586 unsigned PSS2AC : 2;
4587 unsigned : 4;
4590 struct
4592 unsigned : 4;
4593 unsigned ECCP2AS : 3;
4594 unsigned : 1;
4596 } __ECCP2ASbits_t;
4598 extern __at(0x0FB8) volatile __ECCP2ASbits_t ECCP2ASbits;
4600 #define _PSS2BD0 0x01
4601 #define _PSS2BD1 0x02
4602 #define _PSS2AC0 0x04
4603 #define _PSS2AC1 0x08
4604 #define _ECCP2AS0 0x10
4605 #define _ECCP2AS1 0x20
4606 #define _ECCP2AS2 0x40
4607 #define _ECCP2ASE 0x80
4609 //==============================================================================
4612 //==============================================================================
4613 // PSTR2CON Bits
4615 extern __at(0x0FB9) __sfr PSTR2CON;
4617 typedef union
4619 struct
4621 unsigned STRA : 1;
4622 unsigned STRB : 1;
4623 unsigned STRC : 1;
4624 unsigned STRD : 1;
4625 unsigned STRSYNC : 1;
4626 unsigned P2DC5 : 1;
4627 unsigned CMPL0 : 1;
4628 unsigned CMPL1 : 1;
4631 struct
4633 unsigned P2DC0 : 1;
4634 unsigned P2DC1 : 1;
4635 unsigned P2DC2 : 1;
4636 unsigned P2DC3 : 1;
4637 unsigned P2DC4 : 1;
4638 unsigned : 1;
4639 unsigned P2DC6 : 1;
4640 unsigned : 1;
4643 struct
4645 unsigned P2DC : 7;
4646 unsigned : 1;
4649 struct
4651 unsigned : 6;
4652 unsigned CMPL : 2;
4654 } __PSTR2CONbits_t;
4656 extern __at(0x0FB9) volatile __PSTR2CONbits_t PSTR2CONbits;
4658 #define _PSTR2CON_STRA 0x01
4659 #define _PSTR2CON_P2DC0 0x01
4660 #define _PSTR2CON_STRB 0x02
4661 #define _PSTR2CON_P2DC1 0x02
4662 #define _PSTR2CON_STRC 0x04
4663 #define _PSTR2CON_P2DC2 0x04
4664 #define _PSTR2CON_STRD 0x08
4665 #define _PSTR2CON_P2DC3 0x08
4666 #define _PSTR2CON_STRSYNC 0x10
4667 #define _PSTR2CON_P2DC4 0x10
4668 #define _PSTR2CON_P2DC5 0x20
4669 #define _PSTR2CON_CMPL0 0x40
4670 #define _PSTR2CON_P2DC6 0x40
4671 #define _PSTR2CON_CMPL1 0x80
4673 //==============================================================================
4676 //==============================================================================
4677 // CCP1CON Bits
4679 extern __at(0x0FBA) __sfr CCP1CON;
4681 typedef union
4683 struct
4685 unsigned CCP1M0 : 1;
4686 unsigned CCP1M1 : 1;
4687 unsigned CCP1M2 : 1;
4688 unsigned CCP1M3 : 1;
4689 unsigned DC1B0 : 1;
4690 unsigned DC1B1 : 1;
4691 unsigned P1M0 : 1;
4692 unsigned P1M1 : 1;
4695 struct
4697 unsigned : 1;
4698 unsigned : 1;
4699 unsigned : 1;
4700 unsigned : 1;
4701 unsigned CCP1Y : 1;
4702 unsigned CCP1X : 1;
4703 unsigned : 1;
4704 unsigned : 1;
4707 struct
4709 unsigned CCP1M : 4;
4710 unsigned : 4;
4713 struct
4715 unsigned : 4;
4716 unsigned DC1B : 2;
4717 unsigned : 2;
4720 struct
4722 unsigned : 6;
4723 unsigned P1M : 2;
4725 } __CCP1CONbits_t;
4727 extern __at(0x0FBA) volatile __CCP1CONbits_t CCP1CONbits;
4729 #define _CCP1M0 0x01
4730 #define _CCP1M1 0x02
4731 #define _CCP1M2 0x04
4732 #define _CCP1M3 0x08
4733 #define _DC1B0 0x10
4734 #define _CCP1Y 0x10
4735 #define _DC1B1 0x20
4736 #define _CCP1X 0x20
4737 #define _P1M0 0x40
4738 #define _P1M1 0x80
4740 //==============================================================================
4743 //==============================================================================
4744 // ECCP1CON Bits
4746 extern __at(0x0FBA) __sfr ECCP1CON;
4748 typedef union
4750 struct
4752 unsigned CCP1M0 : 1;
4753 unsigned CCP1M1 : 1;
4754 unsigned CCP1M2 : 1;
4755 unsigned CCP1M3 : 1;
4756 unsigned DC1B0 : 1;
4757 unsigned DC1B1 : 1;
4758 unsigned P1M0 : 1;
4759 unsigned P1M1 : 1;
4762 struct
4764 unsigned : 1;
4765 unsigned : 1;
4766 unsigned : 1;
4767 unsigned : 1;
4768 unsigned CCP1Y : 1;
4769 unsigned CCP1X : 1;
4770 unsigned : 1;
4771 unsigned : 1;
4774 struct
4776 unsigned CCP1M : 4;
4777 unsigned : 4;
4780 struct
4782 unsigned : 4;
4783 unsigned DC1B : 2;
4784 unsigned : 2;
4787 struct
4789 unsigned : 6;
4790 unsigned P1M : 2;
4792 } __ECCP1CONbits_t;
4794 extern __at(0x0FBA) volatile __ECCP1CONbits_t ECCP1CONbits;
4796 #define _ECCP1CON_CCP1M0 0x01
4797 #define _ECCP1CON_CCP1M1 0x02
4798 #define _ECCP1CON_CCP1M2 0x04
4799 #define _ECCP1CON_CCP1M3 0x08
4800 #define _ECCP1CON_DC1B0 0x10
4801 #define _ECCP1CON_CCP1Y 0x10
4802 #define _ECCP1CON_DC1B1 0x20
4803 #define _ECCP1CON_CCP1X 0x20
4804 #define _ECCP1CON_P1M0 0x40
4805 #define _ECCP1CON_P1M1 0x80
4807 //==============================================================================
4809 extern __at(0x0FBB) __sfr CCPR1;
4810 extern __at(0x0FBB) __sfr CCPR1L;
4811 extern __at(0x0FBC) __sfr CCPR1H;
4813 //==============================================================================
4814 // ECCP1DEL Bits
4816 extern __at(0x0FBD) __sfr ECCP1DEL;
4818 typedef union
4820 struct
4822 unsigned P1DC0 : 1;
4823 unsigned P1DC1 : 1;
4824 unsigned P1DC2 : 1;
4825 unsigned P1DC3 : 1;
4826 unsigned P1DC4 : 1;
4827 unsigned P1DC5 : 1;
4828 unsigned P1DC6 : 1;
4829 unsigned P1RSEN : 1;
4832 struct
4834 unsigned P1DC : 7;
4835 unsigned : 1;
4837 } __ECCP1DELbits_t;
4839 extern __at(0x0FBD) volatile __ECCP1DELbits_t ECCP1DELbits;
4841 #define _P1DC0 0x01
4842 #define _P1DC1 0x02
4843 #define _P1DC2 0x04
4844 #define _P1DC3 0x08
4845 #define _P1DC4 0x10
4846 #define _P1DC5 0x20
4847 #define _P1DC6 0x40
4848 #define _P1RSEN 0x80
4850 //==============================================================================
4853 //==============================================================================
4854 // PWM1CON Bits
4856 extern __at(0x0FBD) __sfr PWM1CON;
4858 typedef union
4860 struct
4862 unsigned P1DC0 : 1;
4863 unsigned P1DC1 : 1;
4864 unsigned P1DC2 : 1;
4865 unsigned P1DC3 : 1;
4866 unsigned P1DC4 : 1;
4867 unsigned P1DC5 : 1;
4868 unsigned P1DC6 : 1;
4869 unsigned P1RSEN : 1;
4872 struct
4874 unsigned P1DC : 7;
4875 unsigned : 1;
4877 } __PWM1CONbits_t;
4879 extern __at(0x0FBD) volatile __PWM1CONbits_t PWM1CONbits;
4881 #define _PWM1CON_P1DC0 0x01
4882 #define _PWM1CON_P1DC1 0x02
4883 #define _PWM1CON_P1DC2 0x04
4884 #define _PWM1CON_P1DC3 0x08
4885 #define _PWM1CON_P1DC4 0x10
4886 #define _PWM1CON_P1DC5 0x20
4887 #define _PWM1CON_P1DC6 0x40
4888 #define _PWM1CON_P1RSEN 0x80
4890 //==============================================================================
4893 //==============================================================================
4894 // ECCP1AS Bits
4896 extern __at(0x0FBE) __sfr ECCP1AS;
4898 typedef union
4900 struct
4902 unsigned PSS1BD0 : 1;
4903 unsigned PSS1BD1 : 1;
4904 unsigned PSS1AC0 : 1;
4905 unsigned PSS1AC1 : 1;
4906 unsigned ECCP1AS0 : 1;
4907 unsigned ECCP1AS1 : 1;
4908 unsigned ECCP1AS2 : 1;
4909 unsigned ECCP1ASE : 1;
4912 struct
4914 unsigned PSS1BD : 2;
4915 unsigned : 6;
4918 struct
4920 unsigned : 2;
4921 unsigned PSS1AC : 2;
4922 unsigned : 4;
4925 struct
4927 unsigned : 4;
4928 unsigned ECCP1AS : 3;
4929 unsigned : 1;
4931 } __ECCP1ASbits_t;
4933 extern __at(0x0FBE) volatile __ECCP1ASbits_t ECCP1ASbits;
4935 #define _PSS1BD0 0x01
4936 #define _PSS1BD1 0x02
4937 #define _PSS1AC0 0x04
4938 #define _PSS1AC1 0x08
4939 #define _ECCP1AS0 0x10
4940 #define _ECCP1AS1 0x20
4941 #define _ECCP1AS2 0x40
4942 #define _ECCP1ASE 0x80
4944 //==============================================================================
4947 //==============================================================================
4948 // PSTR1CON Bits
4950 extern __at(0x0FBF) __sfr PSTR1CON;
4952 typedef union
4954 struct
4956 unsigned STRA : 1;
4957 unsigned STRB : 1;
4958 unsigned STRC : 1;
4959 unsigned STRD : 1;
4960 unsigned STRSYNC : 1;
4961 unsigned : 1;
4962 unsigned CMPL0 : 1;
4963 unsigned CMPL1 : 1;
4966 struct
4968 unsigned : 6;
4969 unsigned CMPL : 2;
4971 } __PSTR1CONbits_t;
4973 extern __at(0x0FBF) volatile __PSTR1CONbits_t PSTR1CONbits;
4975 #define _STRA 0x01
4976 #define _STRB 0x02
4977 #define _STRC 0x04
4978 #define _STRD 0x08
4979 #define _STRSYNC 0x10
4980 #define _CMPL0 0x40
4981 #define _CMPL1 0x80
4983 //==============================================================================
4986 //==============================================================================
4987 // WDTCON Bits
4989 extern __at(0x0FC0) __sfr WDTCON;
4991 typedef union
4993 struct
4995 unsigned SWDTEN : 1;
4996 unsigned ULPSINK : 1;
4997 unsigned ULPEN : 1;
4998 unsigned DS : 1;
4999 unsigned : 1;
5000 unsigned ULPLVL : 1;
5001 unsigned LVDSTAT : 1;
5002 unsigned REGSLP : 1;
5005 struct
5007 unsigned SWDTE : 1;
5008 unsigned : 1;
5009 unsigned : 1;
5010 unsigned : 1;
5011 unsigned : 1;
5012 unsigned : 1;
5013 unsigned : 1;
5014 unsigned : 1;
5016 } __WDTCONbits_t;
5018 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
5020 #define _SWDTEN 0x01
5021 #define _SWDTE 0x01
5022 #define _ULPSINK 0x02
5023 #define _ULPEN 0x04
5024 #define _DS 0x08
5025 #define _ULPLVL 0x20
5026 #define _LVDSTAT 0x40
5027 #define _REGSLP 0x80
5029 //==============================================================================
5032 //==============================================================================
5033 // ADCON1 Bits
5035 extern __at(0x0FC1) __sfr ADCON1;
5037 typedef union
5039 struct
5041 unsigned ADCS0 : 1;
5042 unsigned ADCS1 : 1;
5043 unsigned ADCS2 : 1;
5044 unsigned ACQT0 : 1;
5045 unsigned ACQT1 : 1;
5046 unsigned ACQT2 : 1;
5047 unsigned ADCAL : 1;
5048 unsigned ADFM : 1;
5051 struct
5053 unsigned ADCS : 3;
5054 unsigned : 5;
5057 struct
5059 unsigned : 3;
5060 unsigned ACQT : 3;
5061 unsigned : 2;
5063 } __ADCON1bits_t;
5065 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5067 #define _ADCS0 0x01
5068 #define _ADCS1 0x02
5069 #define _ADCS2 0x04
5070 #define _ACQT0 0x08
5071 #define _ACQT1 0x10
5072 #define _ACQT2 0x20
5073 #define _ADCAL 0x40
5074 #define _ADFM 0x80
5076 //==============================================================================
5079 //==============================================================================
5080 // ADCON0 Bits
5082 extern __at(0x0FC2) __sfr ADCON0;
5084 typedef union
5086 struct
5088 unsigned ADON : 1;
5089 unsigned GO_NOT_DONE : 1;
5090 unsigned CHS0 : 1;
5091 unsigned CHS1 : 1;
5092 unsigned CHS2 : 1;
5093 unsigned CHS3 : 1;
5094 unsigned VCFG0 : 1;
5095 unsigned VCFG1 : 1;
5098 struct
5100 unsigned : 1;
5101 unsigned GO_DONE : 1;
5102 unsigned : 1;
5103 unsigned : 1;
5104 unsigned : 1;
5105 unsigned : 1;
5106 unsigned : 1;
5107 unsigned : 1;
5110 struct
5112 unsigned : 1;
5113 unsigned DONE : 1;
5114 unsigned : 1;
5115 unsigned : 1;
5116 unsigned : 1;
5117 unsigned : 1;
5118 unsigned : 1;
5119 unsigned : 1;
5122 struct
5124 unsigned : 1;
5125 unsigned GO : 1;
5126 unsigned : 1;
5127 unsigned : 1;
5128 unsigned : 1;
5129 unsigned : 1;
5130 unsigned : 1;
5131 unsigned : 1;
5134 struct
5136 unsigned : 1;
5137 unsigned NOT_DONE : 1;
5138 unsigned : 1;
5139 unsigned : 1;
5140 unsigned : 1;
5141 unsigned : 1;
5142 unsigned : 1;
5143 unsigned : 1;
5146 struct
5148 unsigned : 2;
5149 unsigned CHS : 4;
5150 unsigned : 2;
5153 struct
5155 unsigned : 6;
5156 unsigned VCFG : 2;
5158 } __ADCON0bits_t;
5160 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
5162 #define _ADON 0x01
5163 #define _GO_NOT_DONE 0x02
5164 #define _GO_DONE 0x02
5165 #define _DONE 0x02
5166 #define _GO 0x02
5167 #define _NOT_DONE 0x02
5168 #define _CHS0 0x04
5169 #define _CHS1 0x08
5170 #define _CHS2 0x10
5171 #define _CHS3 0x20
5172 #define _VCFG0 0x40
5173 #define _VCFG1 0x80
5175 //==============================================================================
5177 extern __at(0x0FC3) __sfr ADRES;
5178 extern __at(0x0FC3) __sfr ADRESL;
5179 extern __at(0x0FC4) __sfr ADRESH;
5181 //==============================================================================
5182 // SSP1CON2 Bits
5184 extern __at(0x0FC5) __sfr SSP1CON2;
5186 typedef union
5188 struct
5190 unsigned SEN : 1;
5191 unsigned RSEN : 1;
5192 unsigned PEN : 1;
5193 unsigned RCEN : 1;
5194 unsigned ACKEN : 1;
5195 unsigned ACKDT : 1;
5196 unsigned ACKSTAT : 1;
5197 unsigned GCEN : 1;
5200 struct
5202 unsigned : 1;
5203 unsigned ADMSK1 : 1;
5204 unsigned ADMSK2 : 1;
5205 unsigned ADMSK3 : 1;
5206 unsigned ADMSK4 : 1;
5207 unsigned ADMSK5 : 1;
5208 unsigned : 1;
5209 unsigned : 1;
5211 } __SSP1CON2bits_t;
5213 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
5215 #define _SEN 0x01
5216 #define _RSEN 0x02
5217 #define _ADMSK1 0x02
5218 #define _PEN 0x04
5219 #define _ADMSK2 0x04
5220 #define _RCEN 0x08
5221 #define _ADMSK3 0x08
5222 #define _ACKEN 0x10
5223 #define _ADMSK4 0x10
5224 #define _ACKDT 0x20
5225 #define _ADMSK5 0x20
5226 #define _ACKSTAT 0x40
5227 #define _GCEN 0x80
5229 //==============================================================================
5232 //==============================================================================
5233 // SSPCON2 Bits
5235 extern __at(0x0FC5) __sfr SSPCON2;
5237 typedef union
5239 struct
5241 unsigned SEN : 1;
5242 unsigned RSEN : 1;
5243 unsigned PEN : 1;
5244 unsigned RCEN : 1;
5245 unsigned ACKEN : 1;
5246 unsigned ACKDT : 1;
5247 unsigned ACKSTAT : 1;
5248 unsigned GCEN : 1;
5251 struct
5253 unsigned : 1;
5254 unsigned ADMSK1 : 1;
5255 unsigned ADMSK2 : 1;
5256 unsigned ADMSK3 : 1;
5257 unsigned ADMSK4 : 1;
5258 unsigned ADMSK5 : 1;
5259 unsigned : 1;
5260 unsigned : 1;
5262 } __SSPCON2bits_t;
5264 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
5266 #define _SSPCON2_SEN 0x01
5267 #define _SSPCON2_RSEN 0x02
5268 #define _SSPCON2_ADMSK1 0x02
5269 #define _SSPCON2_PEN 0x04
5270 #define _SSPCON2_ADMSK2 0x04
5271 #define _SSPCON2_RCEN 0x08
5272 #define _SSPCON2_ADMSK3 0x08
5273 #define _SSPCON2_ACKEN 0x10
5274 #define _SSPCON2_ADMSK4 0x10
5275 #define _SSPCON2_ACKDT 0x20
5276 #define _SSPCON2_ADMSK5 0x20
5277 #define _SSPCON2_ACKSTAT 0x40
5278 #define _SSPCON2_GCEN 0x80
5280 //==============================================================================
5283 //==============================================================================
5284 // SSP1CON1 Bits
5286 extern __at(0x0FC6) __sfr SSP1CON1;
5288 typedef union
5290 struct
5292 unsigned SSPM0 : 1;
5293 unsigned SSPM1 : 1;
5294 unsigned SSPM2 : 1;
5295 unsigned SSPM3 : 1;
5296 unsigned CKP : 1;
5297 unsigned SSPEN : 1;
5298 unsigned SSPOV : 1;
5299 unsigned WCOL : 1;
5302 struct
5304 unsigned SSPM01 : 1;
5305 unsigned SSPM11 : 1;
5306 unsigned SSPM21 : 1;
5307 unsigned SSPM31 : 1;
5308 unsigned CKP1 : 1;
5309 unsigned SSPEN1 : 1;
5310 unsigned SSPOV1 : 1;
5311 unsigned WCOL1 : 1;
5313 } __SSP1CON1bits_t;
5315 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
5317 #define _SSPM0 0x01
5318 #define _SSPM01 0x01
5319 #define _SSPM1 0x02
5320 #define _SSPM11 0x02
5321 #define _SSPM2 0x04
5322 #define _SSPM21 0x04
5323 #define _SSPM3 0x08
5324 #define _SSPM31 0x08
5325 #define _CKP 0x10
5326 #define _CKP1 0x10
5327 #define _SSPEN 0x20
5328 #define _SSPEN1 0x20
5329 #define _SSPOV 0x40
5330 #define _SSPOV1 0x40
5331 #define _WCOL 0x80
5332 #define _WCOL1 0x80
5334 //==============================================================================
5337 //==============================================================================
5338 // SSPCON1 Bits
5340 extern __at(0x0FC6) __sfr SSPCON1;
5342 typedef union
5344 struct
5346 unsigned SSPM0 : 1;
5347 unsigned SSPM1 : 1;
5348 unsigned SSPM2 : 1;
5349 unsigned SSPM3 : 1;
5350 unsigned CKP : 1;
5351 unsigned SSPEN : 1;
5352 unsigned SSPOV : 1;
5353 unsigned WCOL : 1;
5356 struct
5358 unsigned SSPM01 : 1;
5359 unsigned SSPM11 : 1;
5360 unsigned SSPM21 : 1;
5361 unsigned SSPM31 : 1;
5362 unsigned CKP1 : 1;
5363 unsigned SSPEN1 : 1;
5364 unsigned SSPOV1 : 1;
5365 unsigned WCOL1 : 1;
5367 } __SSPCON1bits_t;
5369 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
5371 #define _SSPCON1_SSPM0 0x01
5372 #define _SSPCON1_SSPM01 0x01
5373 #define _SSPCON1_SSPM1 0x02
5374 #define _SSPCON1_SSPM11 0x02
5375 #define _SSPCON1_SSPM2 0x04
5376 #define _SSPCON1_SSPM21 0x04
5377 #define _SSPCON1_SSPM3 0x08
5378 #define _SSPCON1_SSPM31 0x08
5379 #define _SSPCON1_CKP 0x10
5380 #define _SSPCON1_CKP1 0x10
5381 #define _SSPCON1_SSPEN 0x20
5382 #define _SSPCON1_SSPEN1 0x20
5383 #define _SSPCON1_SSPOV 0x40
5384 #define _SSPCON1_SSPOV1 0x40
5385 #define _SSPCON1_WCOL 0x80
5386 #define _SSPCON1_WCOL1 0x80
5388 //==============================================================================
5391 //==============================================================================
5392 // SSP1STAT Bits
5394 extern __at(0x0FC7) __sfr SSP1STAT;
5396 typedef union
5398 struct
5400 unsigned BF : 1;
5401 unsigned UA : 1;
5402 unsigned R_NOT_W : 1;
5403 unsigned S : 1;
5404 unsigned P : 1;
5405 unsigned D_NOT_A : 1;
5406 unsigned CKE : 1;
5407 unsigned SMP : 1;
5410 struct
5412 unsigned BF1 : 1;
5413 unsigned UA1 : 1;
5414 unsigned R : 1;
5415 unsigned I2C_START : 1;
5416 unsigned I2C_STOP : 1;
5417 unsigned D : 1;
5418 unsigned CKE1 : 1;
5419 unsigned SMP1 : 1;
5422 struct
5424 unsigned : 1;
5425 unsigned : 1;
5426 unsigned R_W : 1;
5427 unsigned S1 : 1;
5428 unsigned P1 : 1;
5429 unsigned D_A : 1;
5430 unsigned : 1;
5431 unsigned : 1;
5434 struct
5436 unsigned : 1;
5437 unsigned : 1;
5438 unsigned NOT_W : 1;
5439 unsigned I2C_START1 : 1;
5440 unsigned I2C_STOP1 : 1;
5441 unsigned NOT_A : 1;
5442 unsigned : 1;
5443 unsigned : 1;
5446 struct
5448 unsigned : 1;
5449 unsigned : 1;
5450 unsigned NOT_WRITE : 1;
5451 unsigned : 1;
5452 unsigned : 1;
5453 unsigned NOT_ADDRESS : 1;
5454 unsigned : 1;
5455 unsigned : 1;
5458 struct
5460 unsigned : 1;
5461 unsigned : 1;
5462 unsigned READ_WRITE : 1;
5463 unsigned : 1;
5464 unsigned : 1;
5465 unsigned DATA_ADDRESS : 1;
5466 unsigned : 1;
5467 unsigned : 1;
5470 struct
5472 unsigned : 1;
5473 unsigned : 1;
5474 unsigned I2C_READ : 1;
5475 unsigned : 1;
5476 unsigned : 1;
5477 unsigned I2C_DAT : 1;
5478 unsigned : 1;
5479 unsigned : 1;
5482 struct
5484 unsigned : 1;
5485 unsigned : 1;
5486 unsigned R_NOT_W1 : 1;
5487 unsigned : 1;
5488 unsigned : 1;
5489 unsigned D_NOT_A1 : 1;
5490 unsigned : 1;
5491 unsigned : 1;
5494 struct
5496 unsigned : 1;
5497 unsigned : 1;
5498 unsigned R1 : 1;
5499 unsigned : 1;
5500 unsigned : 1;
5501 unsigned D1 : 1;
5502 unsigned : 1;
5503 unsigned : 1;
5506 struct
5508 unsigned : 1;
5509 unsigned : 1;
5510 unsigned D_A1 : 1;
5511 unsigned : 1;
5512 unsigned : 1;
5513 unsigned R_W1 : 1;
5514 unsigned : 1;
5515 unsigned : 1;
5518 struct
5520 unsigned : 1;
5521 unsigned : 1;
5522 unsigned NOT_W1 : 1;
5523 unsigned : 1;
5524 unsigned : 1;
5525 unsigned NOT_A1 : 1;
5526 unsigned : 1;
5527 unsigned : 1;
5530 struct
5532 unsigned : 1;
5533 unsigned : 1;
5534 unsigned NOT_WRITE1 : 1;
5535 unsigned : 1;
5536 unsigned : 1;
5537 unsigned NOT_ADDRESS1 : 1;
5538 unsigned : 1;
5539 unsigned : 1;
5542 struct
5544 unsigned : 1;
5545 unsigned : 1;
5546 unsigned READ_WRITE1 : 1;
5547 unsigned : 1;
5548 unsigned : 1;
5549 unsigned DATA_ADDRESS1 : 1;
5550 unsigned : 1;
5551 unsigned : 1;
5554 struct
5556 unsigned : 1;
5557 unsigned : 1;
5558 unsigned I2C_READ1 : 1;
5559 unsigned : 1;
5560 unsigned : 1;
5561 unsigned I2C_DAT1 : 1;
5562 unsigned : 1;
5563 unsigned : 1;
5565 } __SSP1STATbits_t;
5567 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5569 #define _BF 0x01
5570 #define _BF1 0x01
5571 #define _UA 0x02
5572 #define _UA1 0x02
5573 #define _R_NOT_W 0x04
5574 #define _R 0x04
5575 #define _R_W 0x04
5576 #define _NOT_W 0x04
5577 #define _NOT_WRITE 0x04
5578 #define _READ_WRITE 0x04
5579 #define _I2C_READ 0x04
5580 #define _R_NOT_W1 0x04
5581 #define _R1 0x04
5582 #define _D_A1 0x04
5583 #define _NOT_W1 0x04
5584 #define _NOT_WRITE1 0x04
5585 #define _READ_WRITE1 0x04
5586 #define _I2C_READ1 0x04
5587 #define _S 0x08
5588 #define _I2C_START 0x08
5589 #define _S1 0x08
5590 #define _I2C_START1 0x08
5591 #define _P 0x10
5592 #define _I2C_STOP 0x10
5593 #define _P1 0x10
5594 #define _I2C_STOP1 0x10
5595 #define _D_NOT_A 0x20
5596 #define _D 0x20
5597 #define _D_A 0x20
5598 #define _NOT_A 0x20
5599 #define _NOT_ADDRESS 0x20
5600 #define _DATA_ADDRESS 0x20
5601 #define _I2C_DAT 0x20
5602 #define _D_NOT_A1 0x20
5603 #define _D1 0x20
5604 #define _R_W1 0x20
5605 #define _NOT_A1 0x20
5606 #define _NOT_ADDRESS1 0x20
5607 #define _DATA_ADDRESS1 0x20
5608 #define _I2C_DAT1 0x20
5609 #define _CKE 0x40
5610 #define _CKE1 0x40
5611 #define _SMP 0x80
5612 #define _SMP1 0x80
5614 //==============================================================================
5617 //==============================================================================
5618 // SSPSTAT Bits
5620 extern __at(0x0FC7) __sfr SSPSTAT;
5622 typedef union
5624 struct
5626 unsigned BF : 1;
5627 unsigned UA : 1;
5628 unsigned R_NOT_W : 1;
5629 unsigned S : 1;
5630 unsigned P : 1;
5631 unsigned D_NOT_A : 1;
5632 unsigned CKE : 1;
5633 unsigned SMP : 1;
5636 struct
5638 unsigned BF1 : 1;
5639 unsigned UA1 : 1;
5640 unsigned R : 1;
5641 unsigned I2C_START : 1;
5642 unsigned I2C_STOP : 1;
5643 unsigned D : 1;
5644 unsigned CKE1 : 1;
5645 unsigned SMP1 : 1;
5648 struct
5650 unsigned : 1;
5651 unsigned : 1;
5652 unsigned R_W : 1;
5653 unsigned S1 : 1;
5654 unsigned P1 : 1;
5655 unsigned D_A : 1;
5656 unsigned : 1;
5657 unsigned : 1;
5660 struct
5662 unsigned : 1;
5663 unsigned : 1;
5664 unsigned NOT_W : 1;
5665 unsigned I2C_START1 : 1;
5666 unsigned I2C_STOP1 : 1;
5667 unsigned NOT_A : 1;
5668 unsigned : 1;
5669 unsigned : 1;
5672 struct
5674 unsigned : 1;
5675 unsigned : 1;
5676 unsigned NOT_WRITE : 1;
5677 unsigned : 1;
5678 unsigned : 1;
5679 unsigned NOT_ADDRESS : 1;
5680 unsigned : 1;
5681 unsigned : 1;
5684 struct
5686 unsigned : 1;
5687 unsigned : 1;
5688 unsigned READ_WRITE : 1;
5689 unsigned : 1;
5690 unsigned : 1;
5691 unsigned DATA_ADDRESS : 1;
5692 unsigned : 1;
5693 unsigned : 1;
5696 struct
5698 unsigned : 1;
5699 unsigned : 1;
5700 unsigned I2C_READ : 1;
5701 unsigned : 1;
5702 unsigned : 1;
5703 unsigned I2C_DAT : 1;
5704 unsigned : 1;
5705 unsigned : 1;
5708 struct
5710 unsigned : 1;
5711 unsigned : 1;
5712 unsigned R_NOT_W1 : 1;
5713 unsigned : 1;
5714 unsigned : 1;
5715 unsigned D_NOT_A1 : 1;
5716 unsigned : 1;
5717 unsigned : 1;
5720 struct
5722 unsigned : 1;
5723 unsigned : 1;
5724 unsigned R1 : 1;
5725 unsigned : 1;
5726 unsigned : 1;
5727 unsigned D1 : 1;
5728 unsigned : 1;
5729 unsigned : 1;
5732 struct
5734 unsigned : 1;
5735 unsigned : 1;
5736 unsigned D_A1 : 1;
5737 unsigned : 1;
5738 unsigned : 1;
5739 unsigned R_W1 : 1;
5740 unsigned : 1;
5741 unsigned : 1;
5744 struct
5746 unsigned : 1;
5747 unsigned : 1;
5748 unsigned NOT_W1 : 1;
5749 unsigned : 1;
5750 unsigned : 1;
5751 unsigned NOT_A1 : 1;
5752 unsigned : 1;
5753 unsigned : 1;
5756 struct
5758 unsigned : 1;
5759 unsigned : 1;
5760 unsigned NOT_WRITE1 : 1;
5761 unsigned : 1;
5762 unsigned : 1;
5763 unsigned NOT_ADDRESS1 : 1;
5764 unsigned : 1;
5765 unsigned : 1;
5768 struct
5770 unsigned : 1;
5771 unsigned : 1;
5772 unsigned READ_WRITE1 : 1;
5773 unsigned : 1;
5774 unsigned : 1;
5775 unsigned DATA_ADDRESS1 : 1;
5776 unsigned : 1;
5777 unsigned : 1;
5780 struct
5782 unsigned : 1;
5783 unsigned : 1;
5784 unsigned I2C_READ1 : 1;
5785 unsigned : 1;
5786 unsigned : 1;
5787 unsigned I2C_DAT1 : 1;
5788 unsigned : 1;
5789 unsigned : 1;
5791 } __SSPSTATbits_t;
5793 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5795 #define _SSPSTAT_BF 0x01
5796 #define _SSPSTAT_BF1 0x01
5797 #define _SSPSTAT_UA 0x02
5798 #define _SSPSTAT_UA1 0x02
5799 #define _SSPSTAT_R_NOT_W 0x04
5800 #define _SSPSTAT_R 0x04
5801 #define _SSPSTAT_R_W 0x04
5802 #define _SSPSTAT_NOT_W 0x04
5803 #define _SSPSTAT_NOT_WRITE 0x04
5804 #define _SSPSTAT_READ_WRITE 0x04
5805 #define _SSPSTAT_I2C_READ 0x04
5806 #define _SSPSTAT_R_NOT_W1 0x04
5807 #define _SSPSTAT_R1 0x04
5808 #define _SSPSTAT_D_A1 0x04
5809 #define _SSPSTAT_NOT_W1 0x04
5810 #define _SSPSTAT_NOT_WRITE1 0x04
5811 #define _SSPSTAT_READ_WRITE1 0x04
5812 #define _SSPSTAT_I2C_READ1 0x04
5813 #define _SSPSTAT_S 0x08
5814 #define _SSPSTAT_I2C_START 0x08
5815 #define _SSPSTAT_S1 0x08
5816 #define _SSPSTAT_I2C_START1 0x08
5817 #define _SSPSTAT_P 0x10
5818 #define _SSPSTAT_I2C_STOP 0x10
5819 #define _SSPSTAT_P1 0x10
5820 #define _SSPSTAT_I2C_STOP1 0x10
5821 #define _SSPSTAT_D_NOT_A 0x20
5822 #define _SSPSTAT_D 0x20
5823 #define _SSPSTAT_D_A 0x20
5824 #define _SSPSTAT_NOT_A 0x20
5825 #define _SSPSTAT_NOT_ADDRESS 0x20
5826 #define _SSPSTAT_DATA_ADDRESS 0x20
5827 #define _SSPSTAT_I2C_DAT 0x20
5828 #define _SSPSTAT_D_NOT_A1 0x20
5829 #define _SSPSTAT_D1 0x20
5830 #define _SSPSTAT_R_W1 0x20
5831 #define _SSPSTAT_NOT_A1 0x20
5832 #define _SSPSTAT_NOT_ADDRESS1 0x20
5833 #define _SSPSTAT_DATA_ADDRESS1 0x20
5834 #define _SSPSTAT_I2C_DAT1 0x20
5835 #define _SSPSTAT_CKE 0x40
5836 #define _SSPSTAT_CKE1 0x40
5837 #define _SSPSTAT_SMP 0x80
5838 #define _SSPSTAT_SMP1 0x80
5840 //==============================================================================
5843 //==============================================================================
5844 // SSP1ADD Bits
5846 extern __at(0x0FC8) __sfr SSP1ADD;
5848 typedef union
5850 struct
5852 unsigned MSK0 : 1;
5853 unsigned MSK1 : 1;
5854 unsigned MSK2 : 1;
5855 unsigned MSK3 : 1;
5856 unsigned MSK4 : 1;
5857 unsigned MSK5 : 1;
5858 unsigned MSK6 : 1;
5859 unsigned MSK7 : 1;
5862 struct
5864 unsigned MSK01 : 1;
5865 unsigned MSK11 : 1;
5866 unsigned MSK21 : 1;
5867 unsigned MSK31 : 1;
5868 unsigned MSK41 : 1;
5869 unsigned MSK51 : 1;
5870 unsigned MSK61 : 1;
5871 unsigned MSK71 : 1;
5873 } __SSP1ADDbits_t;
5875 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
5877 #define _MSK0 0x01
5878 #define _MSK01 0x01
5879 #define _MSK1 0x02
5880 #define _MSK11 0x02
5881 #define _MSK2 0x04
5882 #define _MSK21 0x04
5883 #define _MSK3 0x08
5884 #define _MSK31 0x08
5885 #define _MSK4 0x10
5886 #define _MSK41 0x10
5887 #define _MSK5 0x20
5888 #define _MSK51 0x20
5889 #define _MSK6 0x40
5890 #define _MSK61 0x40
5891 #define _MSK7 0x80
5892 #define _MSK71 0x80
5894 //==============================================================================
5897 //==============================================================================
5898 // SSP1MSK Bits
5900 extern __at(0x0FC8) __sfr SSP1MSK;
5902 typedef union
5904 struct
5906 unsigned MSK0 : 1;
5907 unsigned MSK1 : 1;
5908 unsigned MSK2 : 1;
5909 unsigned MSK3 : 1;
5910 unsigned MSK4 : 1;
5911 unsigned MSK5 : 1;
5912 unsigned MSK6 : 1;
5913 unsigned MSK7 : 1;
5916 struct
5918 unsigned MSK01 : 1;
5919 unsigned MSK11 : 1;
5920 unsigned MSK21 : 1;
5921 unsigned MSK31 : 1;
5922 unsigned MSK41 : 1;
5923 unsigned MSK51 : 1;
5924 unsigned MSK61 : 1;
5925 unsigned MSK71 : 1;
5927 } __SSP1MSKbits_t;
5929 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
5931 #define _SSP1MSK_MSK0 0x01
5932 #define _SSP1MSK_MSK01 0x01
5933 #define _SSP1MSK_MSK1 0x02
5934 #define _SSP1MSK_MSK11 0x02
5935 #define _SSP1MSK_MSK2 0x04
5936 #define _SSP1MSK_MSK21 0x04
5937 #define _SSP1MSK_MSK3 0x08
5938 #define _SSP1MSK_MSK31 0x08
5939 #define _SSP1MSK_MSK4 0x10
5940 #define _SSP1MSK_MSK41 0x10
5941 #define _SSP1MSK_MSK5 0x20
5942 #define _SSP1MSK_MSK51 0x20
5943 #define _SSP1MSK_MSK6 0x40
5944 #define _SSP1MSK_MSK61 0x40
5945 #define _SSP1MSK_MSK7 0x80
5946 #define _SSP1MSK_MSK71 0x80
5948 //==============================================================================
5951 //==============================================================================
5952 // SSPADD Bits
5954 extern __at(0x0FC8) __sfr SSPADD;
5956 typedef union
5958 struct
5960 unsigned MSK0 : 1;
5961 unsigned MSK1 : 1;
5962 unsigned MSK2 : 1;
5963 unsigned MSK3 : 1;
5964 unsigned MSK4 : 1;
5965 unsigned MSK5 : 1;
5966 unsigned MSK6 : 1;
5967 unsigned MSK7 : 1;
5970 struct
5972 unsigned MSK01 : 1;
5973 unsigned MSK11 : 1;
5974 unsigned MSK21 : 1;
5975 unsigned MSK31 : 1;
5976 unsigned MSK41 : 1;
5977 unsigned MSK51 : 1;
5978 unsigned MSK61 : 1;
5979 unsigned MSK71 : 1;
5981 } __SSPADDbits_t;
5983 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
5985 #define _SSPADD_MSK0 0x01
5986 #define _SSPADD_MSK01 0x01
5987 #define _SSPADD_MSK1 0x02
5988 #define _SSPADD_MSK11 0x02
5989 #define _SSPADD_MSK2 0x04
5990 #define _SSPADD_MSK21 0x04
5991 #define _SSPADD_MSK3 0x08
5992 #define _SSPADD_MSK31 0x08
5993 #define _SSPADD_MSK4 0x10
5994 #define _SSPADD_MSK41 0x10
5995 #define _SSPADD_MSK5 0x20
5996 #define _SSPADD_MSK51 0x20
5997 #define _SSPADD_MSK6 0x40
5998 #define _SSPADD_MSK61 0x40
5999 #define _SSPADD_MSK7 0x80
6000 #define _SSPADD_MSK71 0x80
6002 //==============================================================================
6004 extern __at(0x0FC9) __sfr SSP1BUF;
6005 extern __at(0x0FC9) __sfr SSPBUF;
6007 //==============================================================================
6008 // T2CON Bits
6010 extern __at(0x0FCA) __sfr T2CON;
6012 typedef union
6014 struct
6016 unsigned T2CKPS0 : 1;
6017 unsigned T2CKPS1 : 1;
6018 unsigned TMR2ON : 1;
6019 unsigned T2OUTPS0 : 1;
6020 unsigned T2OUTPS1 : 1;
6021 unsigned T2OUTPS2 : 1;
6022 unsigned T2OUTPS3 : 1;
6023 unsigned : 1;
6026 struct
6028 unsigned T2CKPS : 2;
6029 unsigned : 6;
6032 struct
6034 unsigned : 3;
6035 unsigned T2OUTPS : 4;
6036 unsigned : 1;
6038 } __T2CONbits_t;
6040 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
6042 #define _T2CKPS0 0x01
6043 #define _T2CKPS1 0x02
6044 #define _TMR2ON 0x04
6045 #define _T2OUTPS0 0x08
6046 #define _T2OUTPS1 0x10
6047 #define _T2OUTPS2 0x20
6048 #define _T2OUTPS3 0x40
6050 //==============================================================================
6052 extern __at(0x0FCB) __sfr PR2;
6053 extern __at(0x0FCC) __sfr TMR2;
6055 //==============================================================================
6056 // T1CON Bits
6058 extern __at(0x0FCD) __sfr T1CON;
6060 typedef union
6062 struct
6064 unsigned TMR1ON : 1;
6065 unsigned RD16 : 1;
6066 unsigned T1SYNC : 1;
6067 unsigned T1OSCEN : 1;
6068 unsigned T1CKPS0 : 1;
6069 unsigned T1CKPS1 : 1;
6070 unsigned TMR1CS0 : 1;
6071 unsigned TMR1CS1 : 1;
6074 struct
6076 unsigned : 1;
6077 unsigned RD161 : 1;
6078 unsigned T1SYNC1 : 1;
6079 unsigned T1OSCEN1 : 1;
6080 unsigned T1CKPS01 : 1;
6081 unsigned T1CKPS11 : 1;
6082 unsigned TMR1CS01 : 1;
6083 unsigned TMR1CS11 : 1;
6085 } __T1CONbits_t;
6087 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6089 #define _TMR1ON 0x01
6090 #define _RD16 0x02
6091 #define _RD161 0x02
6092 #define _T1SYNC 0x04
6093 #define _T1SYNC1 0x04
6094 #define _T1OSCEN 0x08
6095 #define _T1OSCEN1 0x08
6096 #define _T1CKPS0 0x10
6097 #define _T1CKPS01 0x10
6098 #define _T1CKPS1 0x20
6099 #define _T1CKPS11 0x20
6100 #define _TMR1CS0 0x40
6101 #define _TMR1CS01 0x40
6102 #define _TMR1CS1 0x80
6103 #define _TMR1CS11 0x80
6105 //==============================================================================
6107 extern __at(0x0FCE) __sfr TMR1;
6108 extern __at(0x0FCE) __sfr TMR1L;
6109 extern __at(0x0FCF) __sfr TMR1H;
6111 //==============================================================================
6112 // RCON Bits
6114 extern __at(0x0FD0) __sfr RCON;
6116 typedef union
6118 struct
6120 unsigned NOT_BOR : 1;
6121 unsigned NOT_POR : 1;
6122 unsigned NOT_PD : 1;
6123 unsigned NOT_TO : 1;
6124 unsigned NOT_RI : 1;
6125 unsigned NOT_CM : 1;
6126 unsigned : 1;
6127 unsigned IPEN : 1;
6130 struct
6132 unsigned BOR : 1;
6133 unsigned POR : 1;
6134 unsigned PD : 1;
6135 unsigned TO : 1;
6136 unsigned RI : 1;
6137 unsigned CM : 1;
6138 unsigned : 1;
6139 unsigned : 1;
6141 } __RCONbits_t;
6143 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6145 #define _NOT_BOR 0x01
6146 #define _BOR 0x01
6147 #define _NOT_POR 0x02
6148 #define _POR 0x02
6149 #define _NOT_PD 0x04
6150 #define _PD 0x04
6151 #define _NOT_TO 0x08
6152 #define _TO 0x08
6153 #define _NOT_RI 0x10
6154 #define _RI 0x10
6155 #define _NOT_CM 0x20
6156 #define _CM 0x20
6157 #define _IPEN 0x80
6159 //==============================================================================
6162 //==============================================================================
6163 // CM2CON Bits
6165 extern __at(0x0FD1) __sfr CM2CON;
6167 typedef union
6169 struct
6171 unsigned CCH0 : 1;
6172 unsigned CCH1 : 1;
6173 unsigned CREF : 1;
6174 unsigned EVPOL0 : 1;
6175 unsigned EVPOL1 : 1;
6176 unsigned CPOL : 1;
6177 unsigned COE : 1;
6178 unsigned CON : 1;
6181 struct
6183 unsigned CCH : 2;
6184 unsigned : 6;
6187 struct
6189 unsigned : 3;
6190 unsigned EVPOL : 2;
6191 unsigned : 3;
6193 } __CM2CONbits_t;
6195 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
6197 #define _CM2CON_CCH0 0x01
6198 #define _CM2CON_CCH1 0x02
6199 #define _CM2CON_CREF 0x04
6200 #define _CM2CON_EVPOL0 0x08
6201 #define _CM2CON_EVPOL1 0x10
6202 #define _CM2CON_CPOL 0x20
6203 #define _CM2CON_COE 0x40
6204 #define _CM2CON_CON 0x80
6206 //==============================================================================
6209 //==============================================================================
6210 // CM2CON1 Bits
6212 extern __at(0x0FD1) __sfr CM2CON1;
6214 typedef union
6216 struct
6218 unsigned CCH0 : 1;
6219 unsigned CCH1 : 1;
6220 unsigned CREF : 1;
6221 unsigned EVPOL0 : 1;
6222 unsigned EVPOL1 : 1;
6223 unsigned CPOL : 1;
6224 unsigned COE : 1;
6225 unsigned CON : 1;
6228 struct
6230 unsigned CCH : 2;
6231 unsigned : 6;
6234 struct
6236 unsigned : 3;
6237 unsigned EVPOL : 2;
6238 unsigned : 3;
6240 } __CM2CON1bits_t;
6242 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
6244 #define _CM2CON1_CCH0 0x01
6245 #define _CM2CON1_CCH1 0x02
6246 #define _CM2CON1_CREF 0x04
6247 #define _CM2CON1_EVPOL0 0x08
6248 #define _CM2CON1_EVPOL1 0x10
6249 #define _CM2CON1_CPOL 0x20
6250 #define _CM2CON1_COE 0x40
6251 #define _CM2CON1_CON 0x80
6253 //==============================================================================
6256 //==============================================================================
6257 // CM1CON Bits
6259 extern __at(0x0FD2) __sfr CM1CON;
6261 typedef union
6263 struct
6265 unsigned CCH0 : 1;
6266 unsigned CCH1 : 1;
6267 unsigned CREF : 1;
6268 unsigned EVPOL0 : 1;
6269 unsigned EVPOL1 : 1;
6270 unsigned CPOL : 1;
6271 unsigned COE : 1;
6272 unsigned CON : 1;
6275 struct
6277 unsigned CCH01 : 1;
6278 unsigned CCH11 : 1;
6279 unsigned CREF1 : 1;
6280 unsigned EVPOL01 : 1;
6281 unsigned EVPOL11 : 1;
6282 unsigned CPOL1 : 1;
6283 unsigned COE1 : 1;
6284 unsigned CON1 : 1;
6286 } __CM1CONbits_t;
6288 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
6290 #define _CCH0 0x01
6291 #define _CCH01 0x01
6292 #define _CCH1 0x02
6293 #define _CCH11 0x02
6294 #define _CREF 0x04
6295 #define _CREF1 0x04
6296 #define _EVPOL0 0x08
6297 #define _EVPOL01 0x08
6298 #define _EVPOL1 0x10
6299 #define _EVPOL11 0x10
6300 #define _CPOL 0x20
6301 #define _CPOL1 0x20
6302 #define _COE 0x40
6303 #define _COE1 0x40
6304 #define _CON 0x80
6305 #define _CON1 0x80
6307 //==============================================================================
6310 //==============================================================================
6311 // CM1CON1 Bits
6313 extern __at(0x0FD2) __sfr CM1CON1;
6315 typedef union
6317 struct
6319 unsigned CCH0 : 1;
6320 unsigned CCH1 : 1;
6321 unsigned CREF : 1;
6322 unsigned EVPOL0 : 1;
6323 unsigned EVPOL1 : 1;
6324 unsigned CPOL : 1;
6325 unsigned COE : 1;
6326 unsigned CON : 1;
6329 struct
6331 unsigned CCH01 : 1;
6332 unsigned CCH11 : 1;
6333 unsigned CREF1 : 1;
6334 unsigned EVPOL01 : 1;
6335 unsigned EVPOL11 : 1;
6336 unsigned CPOL1 : 1;
6337 unsigned COE1 : 1;
6338 unsigned CON1 : 1;
6340 } __CM1CON1bits_t;
6342 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
6344 #define _CM1CON1_CCH0 0x01
6345 #define _CM1CON1_CCH01 0x01
6346 #define _CM1CON1_CCH1 0x02
6347 #define _CM1CON1_CCH11 0x02
6348 #define _CM1CON1_CREF 0x04
6349 #define _CM1CON1_CREF1 0x04
6350 #define _CM1CON1_EVPOL0 0x08
6351 #define _CM1CON1_EVPOL01 0x08
6352 #define _CM1CON1_EVPOL1 0x10
6353 #define _CM1CON1_EVPOL11 0x10
6354 #define _CM1CON1_CPOL 0x20
6355 #define _CM1CON1_CPOL1 0x20
6356 #define _CM1CON1_COE 0x40
6357 #define _CM1CON1_COE1 0x40
6358 #define _CM1CON1_CON 0x80
6359 #define _CM1CON1_CON1 0x80
6361 //==============================================================================
6364 //==============================================================================
6365 // OSCCON Bits
6367 extern __at(0x0FD3) __sfr OSCCON;
6369 typedef union
6371 struct
6373 unsigned SCS0 : 1;
6374 unsigned SCS1 : 1;
6375 unsigned : 1;
6376 unsigned OSTS : 1;
6377 unsigned IRCF0 : 1;
6378 unsigned IRCF1 : 1;
6379 unsigned IRCF2 : 1;
6380 unsigned IDLEN : 1;
6383 struct
6385 unsigned SCS : 2;
6386 unsigned : 6;
6389 struct
6391 unsigned : 4;
6392 unsigned IRCF : 3;
6393 unsigned : 1;
6395 } __OSCCONbits_t;
6397 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6399 #define _SCS0 0x01
6400 #define _SCS1 0x02
6401 #define _OSTS 0x08
6402 #define _IRCF0 0x10
6403 #define _IRCF1 0x20
6404 #define _IRCF2 0x40
6405 #define _IDLEN 0x80
6407 //==============================================================================
6410 //==============================================================================
6411 // T0CON Bits
6413 extern __at(0x0FD5) __sfr T0CON;
6415 typedef union
6417 struct
6419 unsigned T0PS0 : 1;
6420 unsigned T0PS1 : 1;
6421 unsigned T0PS2 : 1;
6422 unsigned PSA : 1;
6423 unsigned T0SE : 1;
6424 unsigned T0CS : 1;
6425 unsigned T08BIT : 1;
6426 unsigned TMR0ON : 1;
6429 struct
6431 unsigned T0PS : 3;
6432 unsigned : 5;
6434 } __T0CONbits_t;
6436 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6438 #define _T0PS0 0x01
6439 #define _T0PS1 0x02
6440 #define _T0PS2 0x04
6441 #define _PSA 0x08
6442 #define _T0SE 0x10
6443 #define _T0CS 0x20
6444 #define _T08BIT 0x40
6445 #define _TMR0ON 0x80
6447 //==============================================================================
6449 extern __at(0x0FD6) __sfr TMR0;
6450 extern __at(0x0FD6) __sfr TMR0L;
6451 extern __at(0x0FD7) __sfr TMR0H;
6453 //==============================================================================
6454 // STATUS Bits
6456 extern __at(0x0FD8) __sfr STATUS;
6458 typedef struct
6460 unsigned C : 1;
6461 unsigned DC : 1;
6462 unsigned Z : 1;
6463 unsigned OV : 1;
6464 unsigned N : 1;
6465 unsigned : 1;
6466 unsigned : 1;
6467 unsigned : 1;
6468 } __STATUSbits_t;
6470 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6472 #define _C 0x01
6473 #define _DC 0x02
6474 #define _Z 0x04
6475 #define _OV 0x08
6476 #define _N 0x10
6478 //==============================================================================
6480 extern __at(0x0FD9) __sfr FSR2L;
6481 extern __at(0x0FDA) __sfr FSR2H;
6482 extern __at(0x0FDB) __sfr PLUSW2;
6483 extern __at(0x0FDC) __sfr PREINC2;
6484 extern __at(0x0FDD) __sfr POSTDEC2;
6485 extern __at(0x0FDE) __sfr POSTINC2;
6486 extern __at(0x0FDF) __sfr INDF2;
6487 extern __at(0x0FE0) __sfr BSR;
6488 extern __at(0x0FE1) __sfr FSR1L;
6489 extern __at(0x0FE2) __sfr FSR1H;
6490 extern __at(0x0FE3) __sfr PLUSW1;
6491 extern __at(0x0FE4) __sfr PREINC1;
6492 extern __at(0x0FE5) __sfr POSTDEC1;
6493 extern __at(0x0FE6) __sfr POSTINC1;
6494 extern __at(0x0FE7) __sfr INDF1;
6495 extern __at(0x0FE8) __sfr WREG;
6496 extern __at(0x0FE9) __sfr FSR0L;
6497 extern __at(0x0FEA) __sfr FSR0H;
6498 extern __at(0x0FEB) __sfr PLUSW0;
6499 extern __at(0x0FEC) __sfr PREINC0;
6500 extern __at(0x0FED) __sfr POSTDEC0;
6501 extern __at(0x0FEE) __sfr POSTINC0;
6502 extern __at(0x0FEF) __sfr INDF0;
6504 //==============================================================================
6505 // INTCON3 Bits
6507 extern __at(0x0FF0) __sfr INTCON3;
6509 typedef union
6511 struct
6513 unsigned INT1IF : 1;
6514 unsigned INT2IF : 1;
6515 unsigned INT3IF : 1;
6516 unsigned INT1IE : 1;
6517 unsigned INT2IE : 1;
6518 unsigned INT3IE : 1;
6519 unsigned INT1IP : 1;
6520 unsigned INT2IP : 1;
6523 struct
6525 unsigned INT1F : 1;
6526 unsigned INT2F : 1;
6527 unsigned INT3F : 1;
6528 unsigned INT1E : 1;
6529 unsigned INT2E : 1;
6530 unsigned INT3E : 1;
6531 unsigned INT1P : 1;
6532 unsigned INT2P : 1;
6534 } __INTCON3bits_t;
6536 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6538 #define _INT1IF 0x01
6539 #define _INT1F 0x01
6540 #define _INT2IF 0x02
6541 #define _INT2F 0x02
6542 #define _INT3IF 0x04
6543 #define _INT3F 0x04
6544 #define _INT1IE 0x08
6545 #define _INT1E 0x08
6546 #define _INT2IE 0x10
6547 #define _INT2E 0x10
6548 #define _INT3IE 0x20
6549 #define _INT3E 0x20
6550 #define _INT1IP 0x40
6551 #define _INT1P 0x40
6552 #define _INT2IP 0x80
6553 #define _INT2P 0x80
6555 //==============================================================================
6558 //==============================================================================
6559 // INTCON2 Bits
6561 extern __at(0x0FF1) __sfr INTCON2;
6563 typedef union
6565 struct
6567 unsigned RBIP : 1;
6568 unsigned INT3IP : 1;
6569 unsigned TMR0IP : 1;
6570 unsigned INTEDG3 : 1;
6571 unsigned INTEDG2 : 1;
6572 unsigned INTEDG1 : 1;
6573 unsigned INTEDG0 : 1;
6574 unsigned NOT_RBPU : 1;
6577 struct
6579 unsigned : 1;
6580 unsigned INT3P : 1;
6581 unsigned T0IP : 1;
6582 unsigned : 1;
6583 unsigned : 1;
6584 unsigned : 1;
6585 unsigned : 1;
6586 unsigned RBPU : 1;
6588 } __INTCON2bits_t;
6590 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6592 #define _RBIP 0x01
6593 #define _INT3IP 0x02
6594 #define _INT3P 0x02
6595 #define _TMR0IP 0x04
6596 #define _T0IP 0x04
6597 #define _INTEDG3 0x08
6598 #define _INTEDG2 0x10
6599 #define _INTEDG1 0x20
6600 #define _INTEDG0 0x40
6601 #define _NOT_RBPU 0x80
6602 #define _RBPU 0x80
6604 //==============================================================================
6607 //==============================================================================
6608 // INTCON Bits
6610 extern __at(0x0FF2) __sfr INTCON;
6612 typedef union
6614 struct
6616 unsigned RBIF : 1;
6617 unsigned INT0IF : 1;
6618 unsigned TMR0IF : 1;
6619 unsigned RBIE : 1;
6620 unsigned INT0IE : 1;
6621 unsigned TMR0IE : 1;
6622 unsigned PEIE_GIEL : 1;
6623 unsigned GIE_GIEH : 1;
6626 struct
6628 unsigned : 1;
6629 unsigned INT0F : 1;
6630 unsigned T0IF : 1;
6631 unsigned : 1;
6632 unsigned INT0E : 1;
6633 unsigned T0IE : 1;
6634 unsigned PEIE : 1;
6635 unsigned GIE : 1;
6638 struct
6640 unsigned : 1;
6641 unsigned : 1;
6642 unsigned : 1;
6643 unsigned : 1;
6644 unsigned : 1;
6645 unsigned : 1;
6646 unsigned GIEL : 1;
6647 unsigned GIEH : 1;
6649 } __INTCONbits_t;
6651 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6653 #define _RBIF 0x01
6654 #define _INT0IF 0x02
6655 #define _INT0F 0x02
6656 #define _TMR0IF 0x04
6657 #define _T0IF 0x04
6658 #define _RBIE 0x08
6659 #define _INT0IE 0x10
6660 #define _INT0E 0x10
6661 #define _TMR0IE 0x20
6662 #define _T0IE 0x20
6663 #define _PEIE_GIEL 0x40
6664 #define _PEIE 0x40
6665 #define _GIEL 0x40
6666 #define _GIE_GIEH 0x80
6667 #define _GIE 0x80
6668 #define _GIEH 0x80
6670 //==============================================================================
6672 extern __at(0x0FF3) __sfr PROD;
6673 extern __at(0x0FF3) __sfr PRODL;
6674 extern __at(0x0FF4) __sfr PRODH;
6675 extern __at(0x0FF5) __sfr TABLAT;
6676 extern __at(0x0FF6) __sfr TBLPTR;
6677 extern __at(0x0FF6) __sfr TBLPTRL;
6678 extern __at(0x0FF7) __sfr TBLPTRH;
6679 extern __at(0x0FF8) __sfr TBLPTRU;
6680 extern __at(0x0FF9) __sfr PC;
6681 extern __at(0x0FF9) __sfr PCL;
6682 extern __at(0x0FFA) __sfr PCLATH;
6683 extern __at(0x0FFB) __sfr PCLATU;
6685 //==============================================================================
6686 // STKPTR Bits
6688 extern __at(0x0FFC) __sfr STKPTR;
6690 typedef union
6692 struct
6694 unsigned SP0 : 1;
6695 unsigned SP1 : 1;
6696 unsigned SP2 : 1;
6697 unsigned SP3 : 1;
6698 unsigned SP4 : 1;
6699 unsigned : 1;
6700 unsigned STKUNF : 1;
6701 unsigned STKFUL : 1;
6704 struct
6706 unsigned : 1;
6707 unsigned : 1;
6708 unsigned : 1;
6709 unsigned : 1;
6710 unsigned : 1;
6711 unsigned : 1;
6712 unsigned : 1;
6713 unsigned STKOVF : 1;
6716 struct
6718 unsigned SP : 5;
6719 unsigned : 3;
6721 } __STKPTRbits_t;
6723 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6725 #define _SP0 0x01
6726 #define _SP1 0x02
6727 #define _SP2 0x04
6728 #define _SP3 0x08
6729 #define _SP4 0x10
6730 #define _STKUNF 0x40
6731 #define _STKFUL 0x80
6732 #define _STKOVF 0x80
6734 //==============================================================================
6736 extern __at(0x0FFD) __sfr TOS;
6737 extern __at(0x0FFD) __sfr TOSL;
6738 extern __at(0x0FFE) __sfr TOSH;
6739 extern __at(0x0FFF) __sfr TOSU;
6741 //==============================================================================
6743 // Configuration Addresses
6745 //==============================================================================
6747 #define __CONFIG1L 0x003FF8
6748 #define __CONFIG1H 0x003FF9
6749 #define __CONFIG2L 0x003FFA
6750 #define __CONFIG2H 0x003FFB
6751 #define __CONFIG3L 0x003FFC
6752 #define __CONFIG3H 0x003FFD
6753 #define __CONFIG4L 0x003FFE
6754 #define __CONFIG4H 0x003FFF
6756 //==============================================================================
6758 #endif // #ifndef __PIC18LF44J50_H__