struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18lf25j50.h
blobfca4e89cb864c952dbd8bc600a613b1c6b650ab1
1 /*
2 * This declarations of the PIC18LF25J50 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:54 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 __PIC18LF25J50_H__
26 #define __PIC18LF25J50_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(0x0EE7) __sfr RPINR1;
53 extern __at(0x0EE8) __sfr RPINR2;
54 extern __at(0x0EE9) __sfr RPINR3;
55 extern __at(0x0EEA) __sfr RPINR4;
56 extern __at(0x0EEC) __sfr RPINR6;
57 extern __at(0x0EED) __sfr RPINR7;
58 extern __at(0x0EEE) __sfr RPINR8;
59 extern __at(0x0EF2) __sfr RPINR12;
60 extern __at(0x0EF3) __sfr RPINR13;
61 extern __at(0x0EF6) __sfr RPINR16;
62 extern __at(0x0EF7) __sfr RPINR17;
63 extern __at(0x0EFB) __sfr RPINR21;
64 extern __at(0x0EFC) __sfr RPINR22;
65 extern __at(0x0EFD) __sfr RPINR23;
66 extern __at(0x0EFE) __sfr RPINR24;
68 //==============================================================================
69 // PPSCON Bits
71 extern __at(0x0EFF) __sfr PPSCON;
73 typedef struct
75 unsigned IOLOCK : 1;
76 unsigned : 1;
77 unsigned : 1;
78 unsigned : 1;
79 unsigned : 1;
80 unsigned : 1;
81 unsigned : 1;
82 unsigned : 1;
83 } __PPSCONbits_t;
85 extern __at(0x0EFF) volatile __PPSCONbits_t PPSCONbits;
87 #define _IOLOCK 0x01
89 //==============================================================================
92 //==============================================================================
93 // UEP0 Bits
95 extern __at(0x0F26) __sfr UEP0;
97 typedef struct
99 unsigned EPSTALL : 1;
100 unsigned EPINEN : 1;
101 unsigned EPOUTEN : 1;
102 unsigned EPCONDIS : 1;
103 unsigned EPHSHK : 1;
104 unsigned : 1;
105 unsigned : 1;
106 unsigned : 1;
107 } __UEP0bits_t;
109 extern __at(0x0F26) volatile __UEP0bits_t UEP0bits;
111 #define _EPSTALL 0x01
112 #define _EPINEN 0x02
113 #define _EPOUTEN 0x04
114 #define _EPCONDIS 0x08
115 #define _EPHSHK 0x10
117 //==============================================================================
120 //==============================================================================
121 // UEP1 Bits
123 extern __at(0x0F27) __sfr UEP1;
125 typedef struct
127 unsigned EPSTALL : 1;
128 unsigned EPINEN : 1;
129 unsigned EPOUTEN : 1;
130 unsigned EPCONDIS : 1;
131 unsigned EPHSHK : 1;
132 unsigned : 1;
133 unsigned : 1;
134 unsigned : 1;
135 } __UEP1bits_t;
137 extern __at(0x0F27) volatile __UEP1bits_t UEP1bits;
139 #define _UEP1_EPSTALL 0x01
140 #define _UEP1_EPINEN 0x02
141 #define _UEP1_EPOUTEN 0x04
142 #define _UEP1_EPCONDIS 0x08
143 #define _UEP1_EPHSHK 0x10
145 //==============================================================================
148 //==============================================================================
149 // UEP2 Bits
151 extern __at(0x0F28) __sfr UEP2;
153 typedef struct
155 unsigned EPSTALL : 1;
156 unsigned EPINEN : 1;
157 unsigned EPOUTEN : 1;
158 unsigned EPCONDIS : 1;
159 unsigned EPHSHK : 1;
160 unsigned : 1;
161 unsigned : 1;
162 unsigned : 1;
163 } __UEP2bits_t;
165 extern __at(0x0F28) volatile __UEP2bits_t UEP2bits;
167 #define _UEP2_EPSTALL 0x01
168 #define _UEP2_EPINEN 0x02
169 #define _UEP2_EPOUTEN 0x04
170 #define _UEP2_EPCONDIS 0x08
171 #define _UEP2_EPHSHK 0x10
173 //==============================================================================
176 //==============================================================================
177 // UEP3 Bits
179 extern __at(0x0F29) __sfr UEP3;
181 typedef struct
183 unsigned EPSTALL : 1;
184 unsigned EPINEN : 1;
185 unsigned EPOUTEN : 1;
186 unsigned EPCONDIS : 1;
187 unsigned EPHSHK : 1;
188 unsigned : 1;
189 unsigned : 1;
190 unsigned : 1;
191 } __UEP3bits_t;
193 extern __at(0x0F29) volatile __UEP3bits_t UEP3bits;
195 #define _UEP3_EPSTALL 0x01
196 #define _UEP3_EPINEN 0x02
197 #define _UEP3_EPOUTEN 0x04
198 #define _UEP3_EPCONDIS 0x08
199 #define _UEP3_EPHSHK 0x10
201 //==============================================================================
204 //==============================================================================
205 // UEP4 Bits
207 extern __at(0x0F2A) __sfr UEP4;
209 typedef struct
211 unsigned EPSTALL : 1;
212 unsigned EPINEN : 1;
213 unsigned EPOUTEN : 1;
214 unsigned EPCONDIS : 1;
215 unsigned EPHSHK : 1;
216 unsigned : 1;
217 unsigned : 1;
218 unsigned : 1;
219 } __UEP4bits_t;
221 extern __at(0x0F2A) volatile __UEP4bits_t UEP4bits;
223 #define _UEP4_EPSTALL 0x01
224 #define _UEP4_EPINEN 0x02
225 #define _UEP4_EPOUTEN 0x04
226 #define _UEP4_EPCONDIS 0x08
227 #define _UEP4_EPHSHK 0x10
229 //==============================================================================
232 //==============================================================================
233 // UEP5 Bits
235 extern __at(0x0F2B) __sfr UEP5;
237 typedef struct
239 unsigned EPSTALL : 1;
240 unsigned EPINEN : 1;
241 unsigned EPOUTEN : 1;
242 unsigned EPCONDIS : 1;
243 unsigned EPHSHK : 1;
244 unsigned : 1;
245 unsigned : 1;
246 unsigned : 1;
247 } __UEP5bits_t;
249 extern __at(0x0F2B) volatile __UEP5bits_t UEP5bits;
251 #define _UEP5_EPSTALL 0x01
252 #define _UEP5_EPINEN 0x02
253 #define _UEP5_EPOUTEN 0x04
254 #define _UEP5_EPCONDIS 0x08
255 #define _UEP5_EPHSHK 0x10
257 //==============================================================================
260 //==============================================================================
261 // UEP6 Bits
263 extern __at(0x0F2C) __sfr UEP6;
265 typedef struct
267 unsigned EPSTALL : 1;
268 unsigned EPINEN : 1;
269 unsigned EPOUTEN : 1;
270 unsigned EPCONDIS : 1;
271 unsigned EPHSHK : 1;
272 unsigned : 1;
273 unsigned : 1;
274 unsigned : 1;
275 } __UEP6bits_t;
277 extern __at(0x0F2C) volatile __UEP6bits_t UEP6bits;
279 #define _UEP6_EPSTALL 0x01
280 #define _UEP6_EPINEN 0x02
281 #define _UEP6_EPOUTEN 0x04
282 #define _UEP6_EPCONDIS 0x08
283 #define _UEP6_EPHSHK 0x10
285 //==============================================================================
288 //==============================================================================
289 // UEP7 Bits
291 extern __at(0x0F2D) __sfr UEP7;
293 typedef struct
295 unsigned EPSTALL : 1;
296 unsigned EPINEN : 1;
297 unsigned EPOUTEN : 1;
298 unsigned EPCONDIS : 1;
299 unsigned EPHSHK : 1;
300 unsigned : 1;
301 unsigned : 1;
302 unsigned : 1;
303 } __UEP7bits_t;
305 extern __at(0x0F2D) volatile __UEP7bits_t UEP7bits;
307 #define _UEP7_EPSTALL 0x01
308 #define _UEP7_EPINEN 0x02
309 #define _UEP7_EPOUTEN 0x04
310 #define _UEP7_EPCONDIS 0x08
311 #define _UEP7_EPHSHK 0x10
313 //==============================================================================
316 //==============================================================================
317 // UEP8 Bits
319 extern __at(0x0F2E) __sfr UEP8;
321 typedef struct
323 unsigned EPSTALL : 1;
324 unsigned EPINEN : 1;
325 unsigned EPOUTEN : 1;
326 unsigned EPCONDIS : 1;
327 unsigned EPHSHK : 1;
328 unsigned : 1;
329 unsigned : 1;
330 unsigned : 1;
331 } __UEP8bits_t;
333 extern __at(0x0F2E) volatile __UEP8bits_t UEP8bits;
335 #define _UEP8_EPSTALL 0x01
336 #define _UEP8_EPINEN 0x02
337 #define _UEP8_EPOUTEN 0x04
338 #define _UEP8_EPCONDIS 0x08
339 #define _UEP8_EPHSHK 0x10
341 //==============================================================================
344 //==============================================================================
345 // UEP9 Bits
347 extern __at(0x0F2F) __sfr UEP9;
349 typedef struct
351 unsigned EPSTALL : 1;
352 unsigned EPINEN : 1;
353 unsigned EPOUTEN : 1;
354 unsigned EPCONDIS : 1;
355 unsigned EPHSHK : 1;
356 unsigned : 1;
357 unsigned : 1;
358 unsigned : 1;
359 } __UEP9bits_t;
361 extern __at(0x0F2F) volatile __UEP9bits_t UEP9bits;
363 #define _UEP9_EPSTALL 0x01
364 #define _UEP9_EPINEN 0x02
365 #define _UEP9_EPOUTEN 0x04
366 #define _UEP9_EPCONDIS 0x08
367 #define _UEP9_EPHSHK 0x10
369 //==============================================================================
372 //==============================================================================
373 // UEP10 Bits
375 extern __at(0x0F30) __sfr UEP10;
377 typedef struct
379 unsigned EPSTALL : 1;
380 unsigned EPINEN : 1;
381 unsigned EPOUTEN : 1;
382 unsigned EPCONDIS : 1;
383 unsigned EPHSHK : 1;
384 unsigned : 1;
385 unsigned : 1;
386 unsigned : 1;
387 } __UEP10bits_t;
389 extern __at(0x0F30) volatile __UEP10bits_t UEP10bits;
391 #define _UEP10_EPSTALL 0x01
392 #define _UEP10_EPINEN 0x02
393 #define _UEP10_EPOUTEN 0x04
394 #define _UEP10_EPCONDIS 0x08
395 #define _UEP10_EPHSHK 0x10
397 //==============================================================================
400 //==============================================================================
401 // UEP11 Bits
403 extern __at(0x0F31) __sfr UEP11;
405 typedef struct
407 unsigned EPSTALL : 1;
408 unsigned EPINEN : 1;
409 unsigned EPOUTEN : 1;
410 unsigned EPCONDIS : 1;
411 unsigned EPHSHK : 1;
412 unsigned : 1;
413 unsigned : 1;
414 unsigned : 1;
415 } __UEP11bits_t;
417 extern __at(0x0F31) volatile __UEP11bits_t UEP11bits;
419 #define _UEP11_EPSTALL 0x01
420 #define _UEP11_EPINEN 0x02
421 #define _UEP11_EPOUTEN 0x04
422 #define _UEP11_EPCONDIS 0x08
423 #define _UEP11_EPHSHK 0x10
425 //==============================================================================
428 //==============================================================================
429 // UEP12 Bits
431 extern __at(0x0F32) __sfr UEP12;
433 typedef struct
435 unsigned EPSTALL : 1;
436 unsigned EPINEN : 1;
437 unsigned EPOUTEN : 1;
438 unsigned EPCONDIS : 1;
439 unsigned EPHSHK : 1;
440 unsigned : 1;
441 unsigned : 1;
442 unsigned : 1;
443 } __UEP12bits_t;
445 extern __at(0x0F32) volatile __UEP12bits_t UEP12bits;
447 #define _UEP12_EPSTALL 0x01
448 #define _UEP12_EPINEN 0x02
449 #define _UEP12_EPOUTEN 0x04
450 #define _UEP12_EPCONDIS 0x08
451 #define _UEP12_EPHSHK 0x10
453 //==============================================================================
456 //==============================================================================
457 // UEP13 Bits
459 extern __at(0x0F33) __sfr UEP13;
461 typedef struct
463 unsigned EPSTALL : 1;
464 unsigned EPINEN : 1;
465 unsigned EPOUTEN : 1;
466 unsigned EPCONDIS : 1;
467 unsigned EPHSHK : 1;
468 unsigned : 1;
469 unsigned : 1;
470 unsigned : 1;
471 } __UEP13bits_t;
473 extern __at(0x0F33) volatile __UEP13bits_t UEP13bits;
475 #define _UEP13_EPSTALL 0x01
476 #define _UEP13_EPINEN 0x02
477 #define _UEP13_EPOUTEN 0x04
478 #define _UEP13_EPCONDIS 0x08
479 #define _UEP13_EPHSHK 0x10
481 //==============================================================================
484 //==============================================================================
485 // UEP14 Bits
487 extern __at(0x0F34) __sfr UEP14;
489 typedef struct
491 unsigned EPSTALL : 1;
492 unsigned EPINEN : 1;
493 unsigned EPOUTEN : 1;
494 unsigned EPCONDIS : 1;
495 unsigned EPHSHK : 1;
496 unsigned : 1;
497 unsigned : 1;
498 unsigned : 1;
499 } __UEP14bits_t;
501 extern __at(0x0F34) volatile __UEP14bits_t UEP14bits;
503 #define _UEP14_EPSTALL 0x01
504 #define _UEP14_EPINEN 0x02
505 #define _UEP14_EPOUTEN 0x04
506 #define _UEP14_EPCONDIS 0x08
507 #define _UEP14_EPHSHK 0x10
509 //==============================================================================
512 //==============================================================================
513 // UEP15 Bits
515 extern __at(0x0F35) __sfr UEP15;
517 typedef struct
519 unsigned EPSTALL : 1;
520 unsigned EPINEN : 1;
521 unsigned EPOUTEN : 1;
522 unsigned EPCONDIS : 1;
523 unsigned EPHSHK : 1;
524 unsigned : 1;
525 unsigned : 1;
526 unsigned : 1;
527 } __UEP15bits_t;
529 extern __at(0x0F35) volatile __UEP15bits_t UEP15bits;
531 #define _UEP15_EPSTALL 0x01
532 #define _UEP15_EPINEN 0x02
533 #define _UEP15_EPOUTEN 0x04
534 #define _UEP15_EPCONDIS 0x08
535 #define _UEP15_EPHSHK 0x10
537 //==============================================================================
540 //==============================================================================
541 // UIE Bits
543 extern __at(0x0F36) __sfr UIE;
545 typedef struct
547 unsigned URSTIE : 1;
548 unsigned UERRIE : 1;
549 unsigned ACTVIE : 1;
550 unsigned TRNIE : 1;
551 unsigned IDLEIE : 1;
552 unsigned STALLIE : 1;
553 unsigned SOFIE : 1;
554 unsigned : 1;
555 } __UIEbits_t;
557 extern __at(0x0F36) volatile __UIEbits_t UIEbits;
559 #define _URSTIE 0x01
560 #define _UERRIE 0x02
561 #define _ACTVIE 0x04
562 #define _TRNIE 0x08
563 #define _IDLEIE 0x10
564 #define _STALLIE 0x20
565 #define _SOFIE 0x40
567 //==============================================================================
570 //==============================================================================
571 // UEIE Bits
573 extern __at(0x0F37) __sfr UEIE;
575 typedef struct
577 unsigned PIDEE : 1;
578 unsigned CRC5EE : 1;
579 unsigned CRC16EE : 1;
580 unsigned DFN8EE : 1;
581 unsigned BTOEE : 1;
582 unsigned : 1;
583 unsigned : 1;
584 unsigned BTSEE : 1;
585 } __UEIEbits_t;
587 extern __at(0x0F37) volatile __UEIEbits_t UEIEbits;
589 #define _PIDEE 0x01
590 #define _CRC5EE 0x02
591 #define _CRC16EE 0x04
592 #define _DFN8EE 0x08
593 #define _BTOEE 0x10
594 #define _BTSEE 0x80
596 //==============================================================================
599 //==============================================================================
600 // UADDR Bits
602 extern __at(0x0F38) __sfr UADDR;
604 typedef union
606 struct
608 unsigned ADDR0 : 1;
609 unsigned ADDR1 : 1;
610 unsigned ADDR2 : 1;
611 unsigned ADDR3 : 1;
612 unsigned ADDR4 : 1;
613 unsigned ADDR5 : 1;
614 unsigned ADDR6 : 1;
615 unsigned : 1;
618 struct
620 unsigned ADDR : 7;
621 unsigned : 1;
623 } __UADDRbits_t;
625 extern __at(0x0F38) volatile __UADDRbits_t UADDRbits;
627 #define _ADDR0 0x01
628 #define _ADDR1 0x02
629 #define _ADDR2 0x04
630 #define _ADDR3 0x08
631 #define _ADDR4 0x10
632 #define _ADDR5 0x20
633 #define _ADDR6 0x40
635 //==============================================================================
638 //==============================================================================
639 // UCFG Bits
641 extern __at(0x0F39) __sfr UCFG;
643 typedef union
645 struct
647 unsigned PPB0 : 1;
648 unsigned PPB1 : 1;
649 unsigned FSEN : 1;
650 unsigned UTRDIS : 1;
651 unsigned UPUEN : 1;
652 unsigned : 1;
653 unsigned UOEMON : 1;
654 unsigned UTEYE : 1;
657 struct
659 unsigned PPB : 2;
660 unsigned : 6;
662 } __UCFGbits_t;
664 extern __at(0x0F39) volatile __UCFGbits_t UCFGbits;
666 #define _PPB0 0x01
667 #define _PPB1 0x02
668 #define _FSEN 0x04
669 #define _UTRDIS 0x08
670 #define _UPUEN 0x10
671 #define _UOEMON 0x40
672 #define _UTEYE 0x80
674 //==============================================================================
677 //==============================================================================
678 // PADCFG1 Bits
680 extern __at(0x0F3C) __sfr PADCFG1;
682 typedef union
684 struct
686 unsigned PMPTTL : 1;
687 unsigned RTSECSEL0 : 1;
688 unsigned RTSECSEL1 : 1;
689 unsigned : 1;
690 unsigned : 1;
691 unsigned : 1;
692 unsigned : 1;
693 unsigned : 1;
696 struct
698 unsigned : 1;
699 unsigned RTSECSEL : 2;
700 unsigned : 5;
702 } __PADCFG1bits_t;
704 extern __at(0x0F3C) volatile __PADCFG1bits_t PADCFG1bits;
706 #define _PMPTTL 0x01
707 #define _RTSECSEL0 0x02
708 #define _RTSECSEL1 0x04
710 //==============================================================================
713 //==============================================================================
714 // REFOCON Bits
716 extern __at(0x0F3D) __sfr REFOCON;
718 typedef union
720 struct
722 unsigned RODIV0 : 1;
723 unsigned RODIV1 : 1;
724 unsigned RODIV2 : 1;
725 unsigned RODIV3 : 1;
726 unsigned ROSEL : 1;
727 unsigned ROSSLP : 1;
728 unsigned : 1;
729 unsigned ROON : 1;
732 struct
734 unsigned RODIV : 4;
735 unsigned : 4;
737 } __REFOCONbits_t;
739 extern __at(0x0F3D) volatile __REFOCONbits_t REFOCONbits;
741 #define _RODIV0 0x01
742 #define _RODIV1 0x02
743 #define _RODIV2 0x04
744 #define _RODIV3 0x08
745 #define _ROSEL 0x10
746 #define _ROSSLP 0x20
747 #define _ROON 0x80
749 //==============================================================================
752 //==============================================================================
753 // RTCCAL Bits
755 extern __at(0x0F3E) __sfr RTCCAL;
757 typedef struct
759 unsigned CAL0 : 1;
760 unsigned CAL1 : 1;
761 unsigned CAL2 : 1;
762 unsigned CAL3 : 1;
763 unsigned CAL4 : 1;
764 unsigned CAL5 : 1;
765 unsigned CAL6 : 1;
766 unsigned CAL7 : 1;
767 } __RTCCALbits_t;
769 extern __at(0x0F3E) volatile __RTCCALbits_t RTCCALbits;
771 #define _CAL0 0x01
772 #define _CAL1 0x02
773 #define _CAL2 0x04
774 #define _CAL3 0x08
775 #define _CAL4 0x10
776 #define _CAL5 0x20
777 #define _CAL6 0x40
778 #define _CAL7 0x80
780 //==============================================================================
783 //==============================================================================
784 // RTCCFG Bits
786 extern __at(0x0F3F) __sfr RTCCFG;
788 typedef union
790 struct
792 unsigned RTCPTR0 : 1;
793 unsigned RTCPTR1 : 1;
794 unsigned RTCOE : 1;
795 unsigned HALFSEC : 1;
796 unsigned RTCSYNC : 1;
797 unsigned RTCWREN : 1;
798 unsigned : 1;
799 unsigned RTCEN : 1;
802 struct
804 unsigned RTCPTR : 2;
805 unsigned : 6;
807 } __RTCCFGbits_t;
809 extern __at(0x0F3F) volatile __RTCCFGbits_t RTCCFGbits;
811 #define _RTCPTR0 0x01
812 #define _RTCPTR1 0x02
813 #define _RTCOE 0x04
814 #define _HALFSEC 0x08
815 #define _RTCSYNC 0x10
816 #define _RTCWREN 0x20
817 #define _RTCEN 0x80
819 //==============================================================================
822 //==============================================================================
823 // ODCON3 Bits
825 extern __at(0x0F40) __sfr ODCON3;
827 typedef struct
829 unsigned SPI1OD : 1;
830 unsigned SPI2OD : 1;
831 unsigned : 1;
832 unsigned : 1;
833 unsigned : 1;
834 unsigned : 1;
835 unsigned : 1;
836 unsigned : 1;
837 } __ODCON3bits_t;
839 extern __at(0x0F40) volatile __ODCON3bits_t ODCON3bits;
841 #define _SPI1OD 0x01
842 #define _SPI2OD 0x02
844 //==============================================================================
847 //==============================================================================
848 // ODCON2 Bits
850 extern __at(0x0F41) __sfr ODCON2;
852 typedef struct
854 unsigned U1OD : 1;
855 unsigned U2OD : 1;
856 unsigned : 1;
857 unsigned : 1;
858 unsigned : 1;
859 unsigned : 1;
860 unsigned : 1;
861 unsigned : 1;
862 } __ODCON2bits_t;
864 extern __at(0x0F41) volatile __ODCON2bits_t ODCON2bits;
866 #define _U1OD 0x01
867 #define _U2OD 0x02
869 //==============================================================================
872 //==============================================================================
873 // ODCON1 Bits
875 extern __at(0x0F42) __sfr ODCON1;
877 typedef struct
879 unsigned ECCP1OD : 1;
880 unsigned ECCP2OD : 1;
881 unsigned : 1;
882 unsigned : 1;
883 unsigned : 1;
884 unsigned : 1;
885 unsigned : 1;
886 unsigned : 1;
887 } __ODCON1bits_t;
889 extern __at(0x0F42) volatile __ODCON1bits_t ODCON1bits;
891 #define _ECCP1OD 0x01
892 #define _ECCP2OD 0x02
894 //==============================================================================
897 //==============================================================================
898 // ANCON0 Bits
900 extern __at(0x0F48) __sfr ANCON0;
902 typedef union
904 struct
906 unsigned PCFG0 : 1;
907 unsigned PCFG1 : 1;
908 unsigned PCFG2 : 1;
909 unsigned PCFG3 : 1;
910 unsigned PCFG4 : 1;
911 unsigned : 1;
912 unsigned : 1;
913 unsigned : 1;
916 struct
918 unsigned PCFG : 5;
919 unsigned : 3;
921 } __ANCON0bits_t;
923 extern __at(0x0F48) volatile __ANCON0bits_t ANCON0bits;
925 #define _PCFG0 0x01
926 #define _PCFG1 0x02
927 #define _PCFG2 0x04
928 #define _PCFG3 0x08
929 #define _PCFG4 0x10
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 //==============================================================================
1135 extern __at(0x0F60) __sfr UFRM;
1137 //==============================================================================
1138 // UFRML Bits
1140 extern __at(0x0F60) __sfr UFRML;
1142 typedef struct
1144 unsigned FRM0 : 1;
1145 unsigned FRM1 : 1;
1146 unsigned FRM2 : 1;
1147 unsigned FRM3 : 1;
1148 unsigned FRM4 : 1;
1149 unsigned FRM5 : 1;
1150 unsigned FRM6 : 1;
1151 unsigned FRM7 : 1;
1152 } __UFRMLbits_t;
1154 extern __at(0x0F60) volatile __UFRMLbits_t UFRMLbits;
1156 #define _FRM0 0x01
1157 #define _FRM1 0x02
1158 #define _FRM2 0x04
1159 #define _FRM3 0x08
1160 #define _FRM4 0x10
1161 #define _FRM5 0x20
1162 #define _FRM6 0x40
1163 #define _FRM7 0x80
1165 //==============================================================================
1168 //==============================================================================
1169 // UFRMH Bits
1171 extern __at(0x0F61) __sfr UFRMH;
1173 typedef struct
1175 unsigned FRM8 : 1;
1176 unsigned FRM9 : 1;
1177 unsigned FRM10 : 1;
1178 unsigned : 1;
1179 unsigned : 1;
1180 unsigned : 1;
1181 unsigned : 1;
1182 unsigned : 1;
1183 } __UFRMHbits_t;
1185 extern __at(0x0F61) volatile __UFRMHbits_t UFRMHbits;
1187 #define _FRM8 0x01
1188 #define _FRM9 0x02
1189 #define _FRM10 0x04
1191 //==============================================================================
1194 //==============================================================================
1195 // UIR Bits
1197 extern __at(0x0F62) __sfr UIR;
1199 typedef struct
1201 unsigned URSTIF : 1;
1202 unsigned UERRIF : 1;
1203 unsigned ACTVIF : 1;
1204 unsigned TRNIF : 1;
1205 unsigned IDLEIF : 1;
1206 unsigned STALLIF : 1;
1207 unsigned SOFIF : 1;
1208 unsigned : 1;
1209 } __UIRbits_t;
1211 extern __at(0x0F62) volatile __UIRbits_t UIRbits;
1213 #define _URSTIF 0x01
1214 #define _UERRIF 0x02
1215 #define _ACTVIF 0x04
1216 #define _TRNIF 0x08
1217 #define _IDLEIF 0x10
1218 #define _STALLIF 0x20
1219 #define _SOFIF 0x40
1221 //==============================================================================
1224 //==============================================================================
1225 // UEIR Bits
1227 extern __at(0x0F63) __sfr UEIR;
1229 typedef struct
1231 unsigned PIDEF : 1;
1232 unsigned CRC5EF : 1;
1233 unsigned CRC16EF : 1;
1234 unsigned DFN8EF : 1;
1235 unsigned BTOEF : 1;
1236 unsigned : 1;
1237 unsigned : 1;
1238 unsigned BTSEF : 1;
1239 } __UEIRbits_t;
1241 extern __at(0x0F63) volatile __UEIRbits_t UEIRbits;
1243 #define _PIDEF 0x01
1244 #define _CRC5EF 0x02
1245 #define _CRC16EF 0x04
1246 #define _DFN8EF 0x08
1247 #define _BTOEF 0x10
1248 #define _BTSEF 0x80
1250 //==============================================================================
1253 //==============================================================================
1254 // USTAT Bits
1256 extern __at(0x0F64) __sfr USTAT;
1258 typedef union
1260 struct
1262 unsigned : 1;
1263 unsigned PPBI : 1;
1264 unsigned DIR : 1;
1265 unsigned ENDP0 : 1;
1266 unsigned ENDP1 : 1;
1267 unsigned ENDP2 : 1;
1268 unsigned ENDP3 : 1;
1269 unsigned : 1;
1272 struct
1274 unsigned : 3;
1275 unsigned ENDP : 4;
1276 unsigned : 1;
1278 } __USTATbits_t;
1280 extern __at(0x0F64) volatile __USTATbits_t USTATbits;
1282 #define _PPBI 0x02
1283 #define _DIR 0x04
1284 #define _ENDP0 0x08
1285 #define _ENDP1 0x10
1286 #define _ENDP2 0x20
1287 #define _ENDP3 0x40
1289 //==============================================================================
1292 //==============================================================================
1293 // UCON Bits
1295 extern __at(0x0F65) __sfr UCON;
1297 typedef struct
1299 unsigned : 1;
1300 unsigned SUSPND : 1;
1301 unsigned RESUME : 1;
1302 unsigned USBEN : 1;
1303 unsigned PKTDIS : 1;
1304 unsigned SE0 : 1;
1305 unsigned PPBRST : 1;
1306 unsigned : 1;
1307 } __UCONbits_t;
1309 extern __at(0x0F65) volatile __UCONbits_t UCONbits;
1311 #define _SUSPND 0x02
1312 #define _RESUME 0x04
1313 #define _USBEN 0x08
1314 #define _PKTDIS 0x10
1315 #define _SE0 0x20
1316 #define _PPBRST 0x40
1318 //==============================================================================
1320 extern __at(0x0F66) __sfr DMABCH;
1321 extern __at(0x0F67) __sfr DMABCL;
1322 extern __at(0x0F68) __sfr RXADDRH;
1323 extern __at(0x0F69) __sfr RXADDRL;
1324 extern __at(0x0F6A) __sfr TXADDRH;
1325 extern __at(0x0F6B) __sfr TXADDRL;
1327 //==============================================================================
1328 // CMSTAT Bits
1330 extern __at(0x0F70) __sfr CMSTAT;
1332 typedef struct
1334 unsigned COUT1 : 1;
1335 unsigned COUT2 : 1;
1336 unsigned : 1;
1337 unsigned : 1;
1338 unsigned : 1;
1339 unsigned : 1;
1340 unsigned : 1;
1341 unsigned : 1;
1342 } __CMSTATbits_t;
1344 extern __at(0x0F70) volatile __CMSTATbits_t CMSTATbits;
1346 #define _COUT1 0x01
1347 #define _COUT2 0x02
1349 //==============================================================================
1352 //==============================================================================
1353 // CMSTATUS Bits
1355 extern __at(0x0F70) __sfr CMSTATUS;
1357 typedef struct
1359 unsigned COUT1 : 1;
1360 unsigned COUT2 : 1;
1361 unsigned : 1;
1362 unsigned : 1;
1363 unsigned : 1;
1364 unsigned : 1;
1365 unsigned : 1;
1366 unsigned : 1;
1367 } __CMSTATUSbits_t;
1369 extern __at(0x0F70) volatile __CMSTATUSbits_t CMSTATUSbits;
1371 #define _CMSTATUS_COUT1 0x01
1372 #define _CMSTATUS_COUT2 0x02
1374 //==============================================================================
1377 //==============================================================================
1378 // SSP2CON2 Bits
1380 extern __at(0x0F71) __sfr SSP2CON2;
1382 typedef union
1384 struct
1386 unsigned SEN : 1;
1387 unsigned RSEN : 1;
1388 unsigned PEN : 1;
1389 unsigned RCEN : 1;
1390 unsigned ACKEN : 1;
1391 unsigned ACKDT : 1;
1392 unsigned ACKSTAT : 1;
1393 unsigned GCEN : 1;
1396 struct
1398 unsigned : 1;
1399 unsigned ADMSK1 : 1;
1400 unsigned ADMSK2 : 1;
1401 unsigned ADMSK3 : 1;
1402 unsigned ADMSK4 : 1;
1403 unsigned ADMSK5 : 1;
1404 unsigned : 1;
1405 unsigned : 1;
1407 } __SSP2CON2bits_t;
1409 extern __at(0x0F71) volatile __SSP2CON2bits_t SSP2CON2bits;
1411 #define _SSP2CON2_SEN 0x01
1412 #define _SSP2CON2_RSEN 0x02
1413 #define _SSP2CON2_ADMSK1 0x02
1414 #define _SSP2CON2_PEN 0x04
1415 #define _SSP2CON2_ADMSK2 0x04
1416 #define _SSP2CON2_RCEN 0x08
1417 #define _SSP2CON2_ADMSK3 0x08
1418 #define _SSP2CON2_ACKEN 0x10
1419 #define _SSP2CON2_ADMSK4 0x10
1420 #define _SSP2CON2_ACKDT 0x20
1421 #define _SSP2CON2_ADMSK5 0x20
1422 #define _SSP2CON2_ACKSTAT 0x40
1423 #define _SSP2CON2_GCEN 0x80
1425 //==============================================================================
1428 //==============================================================================
1429 // SSP2CON1 Bits
1431 extern __at(0x0F72) __sfr SSP2CON1;
1433 typedef union
1435 struct
1437 unsigned SSPM0 : 1;
1438 unsigned SSPM1 : 1;
1439 unsigned SSPM2 : 1;
1440 unsigned SSPM3 : 1;
1441 unsigned CKP : 1;
1442 unsigned SSPEN : 1;
1443 unsigned SSPOV : 1;
1444 unsigned WCOL : 1;
1447 struct
1449 unsigned SSPM : 4;
1450 unsigned : 4;
1452 } __SSP2CON1bits_t;
1454 extern __at(0x0F72) volatile __SSP2CON1bits_t SSP2CON1bits;
1456 #define _SSP2CON1_SSPM0 0x01
1457 #define _SSP2CON1_SSPM1 0x02
1458 #define _SSP2CON1_SSPM2 0x04
1459 #define _SSP2CON1_SSPM3 0x08
1460 #define _SSP2CON1_CKP 0x10
1461 #define _SSP2CON1_SSPEN 0x20
1462 #define _SSP2CON1_SSPOV 0x40
1463 #define _SSP2CON1_WCOL 0x80
1465 //==============================================================================
1468 //==============================================================================
1469 // SSP2STAT Bits
1471 extern __at(0x0F73) __sfr SSP2STAT;
1473 typedef struct
1475 unsigned BF : 1;
1476 unsigned UA : 1;
1477 unsigned R_NOT_W : 1;
1478 unsigned S : 1;
1479 unsigned P : 1;
1480 unsigned D_NOT_A : 1;
1481 unsigned CKE : 1;
1482 unsigned SMP : 1;
1483 } __SSP2STATbits_t;
1485 extern __at(0x0F73) volatile __SSP2STATbits_t SSP2STATbits;
1487 #define _SSP2STAT_BF 0x01
1488 #define _SSP2STAT_UA 0x02
1489 #define _SSP2STAT_R_NOT_W 0x04
1490 #define _SSP2STAT_S 0x08
1491 #define _SSP2STAT_P 0x10
1492 #define _SSP2STAT_D_NOT_A 0x20
1493 #define _SSP2STAT_CKE 0x40
1494 #define _SSP2STAT_SMP 0x80
1496 //==============================================================================
1499 //==============================================================================
1500 // SSP2ADD Bits
1502 extern __at(0x0F74) __sfr SSP2ADD;
1504 typedef struct
1506 unsigned MSK0 : 1;
1507 unsigned MSK1 : 1;
1508 unsigned MSK2 : 1;
1509 unsigned MSK3 : 1;
1510 unsigned MSK4 : 1;
1511 unsigned MSK5 : 1;
1512 unsigned MSK6 : 1;
1513 unsigned MSK7 : 1;
1514 } __SSP2ADDbits_t;
1516 extern __at(0x0F74) volatile __SSP2ADDbits_t SSP2ADDbits;
1518 #define _SSP2ADD_MSK0 0x01
1519 #define _SSP2ADD_MSK1 0x02
1520 #define _SSP2ADD_MSK2 0x04
1521 #define _SSP2ADD_MSK3 0x08
1522 #define _SSP2ADD_MSK4 0x10
1523 #define _SSP2ADD_MSK5 0x20
1524 #define _SSP2ADD_MSK6 0x40
1525 #define _SSP2ADD_MSK7 0x80
1527 //==============================================================================
1530 //==============================================================================
1531 // SSP2MSK Bits
1533 extern __at(0x0F74) __sfr SSP2MSK;
1535 typedef struct
1537 unsigned MSK0 : 1;
1538 unsigned MSK1 : 1;
1539 unsigned MSK2 : 1;
1540 unsigned MSK3 : 1;
1541 unsigned MSK4 : 1;
1542 unsigned MSK5 : 1;
1543 unsigned MSK6 : 1;
1544 unsigned MSK7 : 1;
1545 } __SSP2MSKbits_t;
1547 extern __at(0x0F74) volatile __SSP2MSKbits_t SSP2MSKbits;
1549 #define _SSP2MSK_MSK0 0x01
1550 #define _SSP2MSK_MSK1 0x02
1551 #define _SSP2MSK_MSK2 0x04
1552 #define _SSP2MSK_MSK3 0x08
1553 #define _SSP2MSK_MSK4 0x10
1554 #define _SSP2MSK_MSK5 0x20
1555 #define _SSP2MSK_MSK6 0x40
1556 #define _SSP2MSK_MSK7 0x80
1558 //==============================================================================
1560 extern __at(0x0F75) __sfr SSP2BUF;
1562 //==============================================================================
1563 // T4CON Bits
1565 extern __at(0x0F76) __sfr T4CON;
1567 typedef union
1569 struct
1571 unsigned T4CKPS0 : 1;
1572 unsigned T4CKPS1 : 1;
1573 unsigned TMR4ON : 1;
1574 unsigned T4OUTPS0 : 1;
1575 unsigned T4OUTPS1 : 1;
1576 unsigned T4OUTPS2 : 1;
1577 unsigned T4OUTPS3 : 1;
1578 unsigned : 1;
1581 struct
1583 unsigned T4CKPS : 2;
1584 unsigned : 6;
1587 struct
1589 unsigned : 3;
1590 unsigned T4OUTPS : 4;
1591 unsigned : 1;
1593 } __T4CONbits_t;
1595 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
1597 #define _T4CKPS0 0x01
1598 #define _T4CKPS1 0x02
1599 #define _TMR4ON 0x04
1600 #define _T4OUTPS0 0x08
1601 #define _T4OUTPS1 0x10
1602 #define _T4OUTPS2 0x20
1603 #define _T4OUTPS3 0x40
1605 //==============================================================================
1607 extern __at(0x0F77) __sfr PR4;
1608 extern __at(0x0F78) __sfr TMR4;
1610 //==============================================================================
1611 // T3CON Bits
1613 extern __at(0x0F79) __sfr T3CON;
1615 typedef union
1617 struct
1619 unsigned TMR3ON : 1;
1620 unsigned RD16 : 1;
1621 unsigned T3SYNC : 1;
1622 unsigned T3OSCEN : 1;
1623 unsigned T3CKPS0 : 1;
1624 unsigned T3CKPS1 : 1;
1625 unsigned TMR3CS0 : 1;
1626 unsigned TMR3CS1 : 1;
1629 struct
1631 unsigned : 4;
1632 unsigned T3CKPS : 2;
1633 unsigned : 2;
1636 struct
1638 unsigned : 6;
1639 unsigned TMR3CS : 2;
1641 } __T3CONbits_t;
1643 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits;
1645 #define _T3CON_TMR3ON 0x01
1646 #define _T3CON_RD16 0x02
1647 #define _T3CON_T3SYNC 0x04
1648 #define _T3CON_T3OSCEN 0x08
1649 #define _T3CON_T3CKPS0 0x10
1650 #define _T3CON_T3CKPS1 0x20
1651 #define _T3CON_TMR3CS0 0x40
1652 #define _T3CON_TMR3CS1 0x80
1654 //==============================================================================
1656 extern __at(0x0F7A) __sfr TMR3;
1657 extern __at(0x0F7A) __sfr TMR3L;
1658 extern __at(0x0F7B) __sfr TMR3H;
1660 //==============================================================================
1661 // BAUDCON2 Bits
1663 extern __at(0x0F7C) __sfr BAUDCON2;
1665 typedef struct
1667 unsigned ABDEN : 1;
1668 unsigned WUE : 1;
1669 unsigned : 1;
1670 unsigned BRG16 : 1;
1671 unsigned TXCKP : 1;
1672 unsigned RXDTP : 1;
1673 unsigned RCIDL : 1;
1674 unsigned ABDOVF : 1;
1675 } __BAUDCON2bits_t;
1677 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
1679 #define _BAUDCON2_ABDEN 0x01
1680 #define _BAUDCON2_WUE 0x02
1681 #define _BAUDCON2_BRG16 0x08
1682 #define _BAUDCON2_TXCKP 0x10
1683 #define _BAUDCON2_RXDTP 0x20
1684 #define _BAUDCON2_RCIDL 0x40
1685 #define _BAUDCON2_ABDOVF 0x80
1687 //==============================================================================
1689 extern __at(0x0F7D) __sfr SPBRGH2;
1691 //==============================================================================
1692 // BAUDCON Bits
1694 extern __at(0x0F7E) __sfr BAUDCON;
1696 typedef struct
1698 unsigned ABDEN : 1;
1699 unsigned WUE : 1;
1700 unsigned : 1;
1701 unsigned BRG16 : 1;
1702 unsigned TXCKP : 1;
1703 unsigned RXDTP : 1;
1704 unsigned RCIDL : 1;
1705 unsigned ABDOVF : 1;
1706 } __BAUDCONbits_t;
1708 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1710 #define _ABDEN 0x01
1711 #define _WUE 0x02
1712 #define _BRG16 0x08
1713 #define _TXCKP 0x10
1714 #define _RXDTP 0x20
1715 #define _RCIDL 0x40
1716 #define _ABDOVF 0x80
1718 //==============================================================================
1721 //==============================================================================
1722 // BAUDCON1 Bits
1724 extern __at(0x0F7E) __sfr BAUDCON1;
1726 typedef struct
1728 unsigned ABDEN : 1;
1729 unsigned WUE : 1;
1730 unsigned : 1;
1731 unsigned BRG16 : 1;
1732 unsigned TXCKP : 1;
1733 unsigned RXDTP : 1;
1734 unsigned RCIDL : 1;
1735 unsigned ABDOVF : 1;
1736 } __BAUDCON1bits_t;
1738 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1740 #define _BAUDCON1_ABDEN 0x01
1741 #define _BAUDCON1_WUE 0x02
1742 #define _BAUDCON1_BRG16 0x08
1743 #define _BAUDCON1_TXCKP 0x10
1744 #define _BAUDCON1_RXDTP 0x20
1745 #define _BAUDCON1_RCIDL 0x40
1746 #define _BAUDCON1_ABDOVF 0x80
1748 //==============================================================================
1751 //==============================================================================
1752 // BAUDCTL Bits
1754 extern __at(0x0F7E) __sfr BAUDCTL;
1756 typedef struct
1758 unsigned ABDEN : 1;
1759 unsigned WUE : 1;
1760 unsigned : 1;
1761 unsigned BRG16 : 1;
1762 unsigned TXCKP : 1;
1763 unsigned RXDTP : 1;
1764 unsigned RCIDL : 1;
1765 unsigned ABDOVF : 1;
1766 } __BAUDCTLbits_t;
1768 extern __at(0x0F7E) volatile __BAUDCTLbits_t BAUDCTLbits;
1770 #define _BAUDCTL_ABDEN 0x01
1771 #define _BAUDCTL_WUE 0x02
1772 #define _BAUDCTL_BRG16 0x08
1773 #define _BAUDCTL_TXCKP 0x10
1774 #define _BAUDCTL_RXDTP 0x20
1775 #define _BAUDCTL_RCIDL 0x40
1776 #define _BAUDCTL_ABDOVF 0x80
1778 //==============================================================================
1780 extern __at(0x0F7F) __sfr SPBRGH;
1781 extern __at(0x0F7F) __sfr SPBRGH1;
1783 //==============================================================================
1784 // PORTA Bits
1786 extern __at(0x0F80) __sfr PORTA;
1788 typedef union
1790 struct
1792 unsigned RA0 : 1;
1793 unsigned RA1 : 1;
1794 unsigned RA2 : 1;
1795 unsigned RA3 : 1;
1796 unsigned : 1;
1797 unsigned RA5 : 1;
1798 unsigned RA6 : 1;
1799 unsigned RA7 : 1;
1802 struct
1804 unsigned AN0 : 1;
1805 unsigned AN1 : 1;
1806 unsigned AN2 : 1;
1807 unsigned AN3 : 1;
1808 unsigned : 1;
1809 unsigned AN4 : 1;
1810 unsigned OSC2 : 1;
1811 unsigned OSC1 : 1;
1814 struct
1816 unsigned C1INA : 1;
1817 unsigned C2INA : 1;
1818 unsigned VREF_MINUS : 1;
1819 unsigned VREF_PLUS : 1;
1820 unsigned : 1;
1821 unsigned NOT_SS1 : 1;
1822 unsigned CLKO : 1;
1823 unsigned CLKI : 1;
1826 struct
1828 unsigned RP0 : 1;
1829 unsigned RP1 : 1;
1830 unsigned CVREF_MINUS : 1;
1831 unsigned C1INB : 1;
1832 unsigned : 1;
1833 unsigned HLVDIN : 1;
1834 unsigned : 1;
1835 unsigned : 1;
1838 struct
1840 unsigned ULPWU : 1;
1841 unsigned : 1;
1842 unsigned C2INB : 1;
1843 unsigned : 1;
1844 unsigned : 1;
1845 unsigned RCV : 1;
1846 unsigned : 1;
1847 unsigned : 1;
1850 struct
1852 unsigned : 1;
1853 unsigned : 1;
1854 unsigned : 1;
1855 unsigned : 1;
1856 unsigned : 1;
1857 unsigned RP2 : 1;
1858 unsigned : 1;
1859 unsigned : 1;
1861 } __PORTAbits_t;
1863 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1865 #define _RA0 0x01
1866 #define _AN0 0x01
1867 #define _C1INA 0x01
1868 #define _RP0 0x01
1869 #define _ULPWU 0x01
1870 #define _RA1 0x02
1871 #define _AN1 0x02
1872 #define _C2INA 0x02
1873 #define _RP1 0x02
1874 #define _RA2 0x04
1875 #define _AN2 0x04
1876 #define _VREF_MINUS 0x04
1877 #define _CVREF_MINUS 0x04
1878 #define _C2INB 0x04
1879 #define _RA3 0x08
1880 #define _AN3 0x08
1881 #define _VREF_PLUS 0x08
1882 #define _C1INB 0x08
1883 #define _RA5 0x20
1884 #define _AN4 0x20
1885 #define _NOT_SS1 0x20
1886 #define _HLVDIN 0x20
1887 #define _RCV 0x20
1888 #define _RP2 0x20
1889 #define _RA6 0x40
1890 #define _OSC2 0x40
1891 #define _CLKO 0x40
1892 #define _RA7 0x80
1893 #define _OSC1 0x80
1894 #define _CLKI 0x80
1896 //==============================================================================
1899 //==============================================================================
1900 // PORTB Bits
1902 extern __at(0x0F81) __sfr PORTB;
1904 typedef union
1906 struct
1908 unsigned RB0 : 1;
1909 unsigned RB1 : 1;
1910 unsigned RB2 : 1;
1911 unsigned RB3 : 1;
1912 unsigned RB4 : 1;
1913 unsigned RB5 : 1;
1914 unsigned RB6 : 1;
1915 unsigned RB7 : 1;
1918 struct
1920 unsigned AN12 : 1;
1921 unsigned AN10 : 1;
1922 unsigned AN8 : 1;
1923 unsigned AN9 : 1;
1924 unsigned KBI0 : 1;
1925 unsigned KBI1 : 1;
1926 unsigned KBI2 : 1;
1927 unsigned KBI3 : 1;
1930 struct
1932 unsigned INT0 : 1;
1933 unsigned RTCC : 1;
1934 unsigned CTEDG1 : 1;
1935 unsigned CTEDG2 : 1;
1936 unsigned SCK1 : 1;
1937 unsigned SDI1 : 1;
1938 unsigned PGC : 1;
1939 unsigned PGD : 1;
1942 struct
1944 unsigned RP3 : 1;
1945 unsigned RP4 : 1;
1946 unsigned VMO : 1;
1947 unsigned VPO : 1;
1948 unsigned SCL1 : 1;
1949 unsigned SDA1 : 1;
1950 unsigned RP9 : 1;
1951 unsigned RP10 : 1;
1954 struct
1956 unsigned : 1;
1957 unsigned : 1;
1958 unsigned REFO : 1;
1959 unsigned RP6 : 1;
1960 unsigned RP7 : 1;
1961 unsigned RP8 : 1;
1962 unsigned : 1;
1963 unsigned : 1;
1966 struct
1968 unsigned : 1;
1969 unsigned : 1;
1970 unsigned RP5 : 1;
1971 unsigned : 1;
1972 unsigned : 1;
1973 unsigned : 1;
1974 unsigned : 1;
1975 unsigned : 1;
1978 struct
1980 unsigned : 4;
1981 unsigned KBI : 4;
1983 } __PORTBbits_t;
1985 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1987 #define _RB0 0x01
1988 #define _AN12 0x01
1989 #define _INT0 0x01
1990 #define _RP3 0x01
1991 #define _RB1 0x02
1992 #define _AN10 0x02
1993 #define _RTCC 0x02
1994 #define _RP4 0x02
1995 #define _RB2 0x04
1996 #define _AN8 0x04
1997 #define _CTEDG1 0x04
1998 #define _VMO 0x04
1999 #define _REFO 0x04
2000 #define _RP5 0x04
2001 #define _RB3 0x08
2002 #define _AN9 0x08
2003 #define _CTEDG2 0x08
2004 #define _VPO 0x08
2005 #define _RP6 0x08
2006 #define _RB4 0x10
2007 #define _KBI0 0x10
2008 #define _SCK1 0x10
2009 #define _SCL1 0x10
2010 #define _RP7 0x10
2011 #define _RB5 0x20
2012 #define _KBI1 0x20
2013 #define _SDI1 0x20
2014 #define _SDA1 0x20
2015 #define _RP8 0x20
2016 #define _RB6 0x40
2017 #define _KBI2 0x40
2018 #define _PGC 0x40
2019 #define _RP9 0x40
2020 #define _RB7 0x80
2021 #define _KBI3 0x80
2022 #define _PGD 0x80
2023 #define _RP10 0x80
2025 //==============================================================================
2028 //==============================================================================
2029 // PORTC Bits
2031 extern __at(0x0F82) __sfr PORTC;
2033 typedef union
2035 struct
2037 unsigned RC0 : 1;
2038 unsigned RC1 : 1;
2039 unsigned RC2 : 1;
2040 unsigned : 1;
2041 unsigned RC4 : 1;
2042 unsigned RC5 : 1;
2043 unsigned RC6 : 1;
2044 unsigned RC7 : 1;
2047 struct
2049 unsigned T1OSO : 1;
2050 unsigned T1OSI : 1;
2051 unsigned AN11 : 1;
2052 unsigned : 1;
2053 unsigned D_MINUS : 1;
2054 unsigned D_PLUS : 1;
2055 unsigned TX1 : 1;
2056 unsigned RX1 : 1;
2059 struct
2061 unsigned T1CK : 1;
2062 unsigned NOT_UOE : 1;
2063 unsigned CTPLS : 1;
2064 unsigned : 1;
2065 unsigned VM : 1;
2066 unsigned VP : 1;
2067 unsigned CK1 : 1;
2068 unsigned DT1 : 1;
2071 struct
2073 unsigned RP11 : 1;
2074 unsigned RP12 : 1;
2075 unsigned RP13 : 1;
2076 unsigned : 1;
2077 unsigned : 1;
2078 unsigned : 1;
2079 unsigned RP17 : 1;
2080 unsigned SDO1 : 1;
2083 struct
2085 unsigned : 1;
2086 unsigned : 1;
2087 unsigned : 1;
2088 unsigned : 1;
2089 unsigned : 1;
2090 unsigned : 1;
2091 unsigned : 1;
2092 unsigned RP18 : 1;
2094 } __PORTCbits_t;
2096 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
2098 #define _RC0 0x01
2099 #define _T1OSO 0x01
2100 #define _T1CK 0x01
2101 #define _RP11 0x01
2102 #define _RC1 0x02
2103 #define _T1OSI 0x02
2104 #define _NOT_UOE 0x02
2105 #define _RP12 0x02
2106 #define _RC2 0x04
2107 #define _AN11 0x04
2108 #define _CTPLS 0x04
2109 #define _RP13 0x04
2110 #define _RC4 0x10
2111 #define _D_MINUS 0x10
2112 #define _VM 0x10
2113 #define _RC5 0x20
2114 #define _D_PLUS 0x20
2115 #define _VP 0x20
2116 #define _RC6 0x40
2117 #define _TX1 0x40
2118 #define _CK1 0x40
2119 #define _RP17 0x40
2120 #define _RC7 0x80
2121 #define _RX1 0x80
2122 #define _DT1 0x80
2123 #define _SDO1 0x80
2124 #define _RP18 0x80
2126 //==============================================================================
2129 //==============================================================================
2130 // HLVDCON Bits
2132 extern __at(0x0F85) __sfr HLVDCON;
2134 typedef union
2136 struct
2138 unsigned HLVDL0 : 1;
2139 unsigned HLVDL1 : 1;
2140 unsigned HLVDL2 : 1;
2141 unsigned HLVDL3 : 1;
2142 unsigned HLVDEN : 1;
2143 unsigned IRVST : 1;
2144 unsigned BGVST : 1;
2145 unsigned VDIRMAG : 1;
2148 struct
2150 unsigned HLVDL : 4;
2151 unsigned : 4;
2153 } __HLVDCONbits_t;
2155 extern __at(0x0F85) volatile __HLVDCONbits_t HLVDCONbits;
2157 #define _HLVDL0 0x01
2158 #define _HLVDL1 0x02
2159 #define _HLVDL2 0x04
2160 #define _HLVDL3 0x08
2161 #define _HLVDEN 0x10
2162 #define _IRVST 0x20
2163 #define _BGVST 0x40
2164 #define _VDIRMAG 0x80
2166 //==============================================================================
2169 //==============================================================================
2170 // DMACON2 Bits
2172 extern __at(0x0F86) __sfr DMACON2;
2174 typedef union
2176 struct
2178 unsigned INTLVL0 : 1;
2179 unsigned INTLVL1 : 1;
2180 unsigned INTLVL2 : 1;
2181 unsigned INTLVL3 : 1;
2182 unsigned DLYCYC0 : 1;
2183 unsigned DLYCYC1 : 1;
2184 unsigned DLYCYC2 : 1;
2185 unsigned DLYCYC3 : 1;
2188 struct
2190 unsigned INTLVL : 4;
2191 unsigned : 4;
2194 struct
2196 unsigned : 4;
2197 unsigned DLYCYC : 4;
2199 } __DMACON2bits_t;
2201 extern __at(0x0F86) volatile __DMACON2bits_t DMACON2bits;
2203 #define _INTLVL0 0x01
2204 #define _INTLVL1 0x02
2205 #define _INTLVL2 0x04
2206 #define _INTLVL3 0x08
2207 #define _DLYCYC0 0x10
2208 #define _DLYCYC1 0x20
2209 #define _DLYCYC2 0x40
2210 #define _DLYCYC3 0x80
2212 //==============================================================================
2215 //==============================================================================
2216 // DMACON1 Bits
2218 extern __at(0x0F88) __sfr DMACON1;
2220 typedef union
2222 struct
2224 unsigned DMAEN : 1;
2225 unsigned DLYINTEN : 1;
2226 unsigned DUPLEX0 : 1;
2227 unsigned DUPLEX1 : 1;
2228 unsigned RXINC : 1;
2229 unsigned TXINC : 1;
2230 unsigned SSCON0 : 1;
2231 unsigned SSCON1 : 1;
2234 struct
2236 unsigned : 2;
2237 unsigned DUPLEX : 2;
2238 unsigned : 4;
2241 struct
2243 unsigned : 6;
2244 unsigned SSCON : 2;
2246 } __DMACON1bits_t;
2248 extern __at(0x0F88) volatile __DMACON1bits_t DMACON1bits;
2250 #define _DMAEN 0x01
2251 #define _DLYINTEN 0x02
2252 #define _DUPLEX0 0x04
2253 #define _DUPLEX1 0x08
2254 #define _RXINC 0x10
2255 #define _TXINC 0x20
2256 #define _SSCON0 0x40
2257 #define _SSCON1 0x80
2259 //==============================================================================
2262 //==============================================================================
2263 // LATA Bits
2265 extern __at(0x0F89) __sfr LATA;
2267 typedef struct
2269 unsigned LATA0 : 1;
2270 unsigned LATA1 : 1;
2271 unsigned LATA2 : 1;
2272 unsigned LATA3 : 1;
2273 unsigned : 1;
2274 unsigned LATA5 : 1;
2275 unsigned LATA6 : 1;
2276 unsigned LATA7 : 1;
2277 } __LATAbits_t;
2279 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2281 #define _LATA0 0x01
2282 #define _LATA1 0x02
2283 #define _LATA2 0x04
2284 #define _LATA3 0x08
2285 #define _LATA5 0x20
2286 #define _LATA6 0x40
2287 #define _LATA7 0x80
2289 //==============================================================================
2292 //==============================================================================
2293 // LATB Bits
2295 extern __at(0x0F8A) __sfr LATB;
2297 typedef struct
2299 unsigned LATB0 : 1;
2300 unsigned LATB1 : 1;
2301 unsigned LATB2 : 1;
2302 unsigned LATB3 : 1;
2303 unsigned LATB4 : 1;
2304 unsigned LATB5 : 1;
2305 unsigned LATB6 : 1;
2306 unsigned LATB7 : 1;
2307 } __LATBbits_t;
2309 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2311 #define _LATB0 0x01
2312 #define _LATB1 0x02
2313 #define _LATB2 0x04
2314 #define _LATB3 0x08
2315 #define _LATB4 0x10
2316 #define _LATB5 0x20
2317 #define _LATB6 0x40
2318 #define _LATB7 0x80
2320 //==============================================================================
2323 //==============================================================================
2324 // LATC Bits
2326 extern __at(0x0F8B) __sfr LATC;
2328 typedef struct
2330 unsigned LATC0 : 1;
2331 unsigned LATC1 : 1;
2332 unsigned LATC2 : 1;
2333 unsigned : 1;
2334 unsigned LATC4 : 1;
2335 unsigned LATC5 : 1;
2336 unsigned LATC6 : 1;
2337 unsigned LATC7 : 1;
2338 } __LATCbits_t;
2340 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2342 #define _LATC0 0x01
2343 #define _LATC1 0x02
2344 #define _LATC2 0x04
2345 #define _LATC4 0x10
2346 #define _LATC5 0x20
2347 #define _LATC6 0x40
2348 #define _LATC7 0x80
2350 //==============================================================================
2352 extern __at(0x0F8E) __sfr ALRMVALL;
2353 extern __at(0x0F8F) __sfr ALRMVALH;
2355 //==============================================================================
2356 // ALRMRPT Bits
2358 extern __at(0x0F90) __sfr ALRMRPT;
2360 typedef struct
2362 unsigned ARPT0 : 1;
2363 unsigned ARPT1 : 1;
2364 unsigned ARPT2 : 1;
2365 unsigned ARPT3 : 1;
2366 unsigned ARPT4 : 1;
2367 unsigned ARPT5 : 1;
2368 unsigned ARPT6 : 1;
2369 unsigned ARPT7 : 1;
2370 } __ALRMRPTbits_t;
2372 extern __at(0x0F90) volatile __ALRMRPTbits_t ALRMRPTbits;
2374 #define _ARPT0 0x01
2375 #define _ARPT1 0x02
2376 #define _ARPT2 0x04
2377 #define _ARPT3 0x08
2378 #define _ARPT4 0x10
2379 #define _ARPT5 0x20
2380 #define _ARPT6 0x40
2381 #define _ARPT7 0x80
2383 //==============================================================================
2386 //==============================================================================
2387 // ALRMCFG Bits
2389 extern __at(0x0F91) __sfr ALRMCFG;
2391 typedef union
2393 struct
2395 unsigned ALRMPTR0 : 1;
2396 unsigned ALRMPTR1 : 1;
2397 unsigned AMASK0 : 1;
2398 unsigned AMASK1 : 1;
2399 unsigned AMASK2 : 1;
2400 unsigned AMASK3 : 1;
2401 unsigned CHIME : 1;
2402 unsigned ALRMEN : 1;
2405 struct
2407 unsigned ALRMPTR : 2;
2408 unsigned : 6;
2411 struct
2413 unsigned : 2;
2414 unsigned AMASK : 4;
2415 unsigned : 2;
2417 } __ALRMCFGbits_t;
2419 extern __at(0x0F91) volatile __ALRMCFGbits_t ALRMCFGbits;
2421 #define _ALRMPTR0 0x01
2422 #define _ALRMPTR1 0x02
2423 #define _AMASK0 0x04
2424 #define _AMASK1 0x08
2425 #define _AMASK2 0x10
2426 #define _AMASK3 0x20
2427 #define _CHIME 0x40
2428 #define _ALRMEN 0x80
2430 //==============================================================================
2433 //==============================================================================
2434 // TRISA Bits
2436 extern __at(0x0F92) __sfr TRISA;
2438 typedef struct
2440 unsigned TRISA0 : 1;
2441 unsigned TRISA1 : 1;
2442 unsigned TRISA2 : 1;
2443 unsigned TRISA3 : 1;
2444 unsigned : 1;
2445 unsigned TRISA5 : 1;
2446 unsigned TRISA6 : 1;
2447 unsigned TRISA7 : 1;
2448 } __TRISAbits_t;
2450 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2452 #define _TRISA0 0x01
2453 #define _TRISA1 0x02
2454 #define _TRISA2 0x04
2455 #define _TRISA3 0x08
2456 #define _TRISA5 0x20
2457 #define _TRISA6 0x40
2458 #define _TRISA7 0x80
2460 //==============================================================================
2463 //==============================================================================
2464 // TRISB Bits
2466 extern __at(0x0F93) __sfr TRISB;
2468 typedef struct
2470 unsigned TRISB0 : 1;
2471 unsigned TRISB1 : 1;
2472 unsigned TRISB2 : 1;
2473 unsigned TRISB3 : 1;
2474 unsigned TRISB4 : 1;
2475 unsigned TRISB5 : 1;
2476 unsigned TRISB6 : 1;
2477 unsigned TRISB7 : 1;
2478 } __TRISBbits_t;
2480 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2482 #define _TRISB0 0x01
2483 #define _TRISB1 0x02
2484 #define _TRISB2 0x04
2485 #define _TRISB3 0x08
2486 #define _TRISB4 0x10
2487 #define _TRISB5 0x20
2488 #define _TRISB6 0x40
2489 #define _TRISB7 0x80
2491 //==============================================================================
2494 //==============================================================================
2495 // TRISC Bits
2497 extern __at(0x0F94) __sfr TRISC;
2499 typedef struct
2501 unsigned TRISC0 : 1;
2502 unsigned TRISC1 : 1;
2503 unsigned TRISC2 : 1;
2504 unsigned : 1;
2505 unsigned TRISC4 : 1;
2506 unsigned TRISC5 : 1;
2507 unsigned TRISC6 : 1;
2508 unsigned TRISC7 : 1;
2509 } __TRISCbits_t;
2511 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2513 #define _TRISC0 0x01
2514 #define _TRISC1 0x02
2515 #define _TRISC2 0x04
2516 #define _TRISC4 0x10
2517 #define _TRISC5 0x20
2518 #define _TRISC6 0x40
2519 #define _TRISC7 0x80
2521 //==============================================================================
2524 //==============================================================================
2525 // T3GCON Bits
2527 extern __at(0x0F97) __sfr T3GCON;
2529 typedef union
2531 struct
2533 unsigned T3GSS0 : 1;
2534 unsigned T3GSS1 : 1;
2535 unsigned T3GVAL : 1;
2536 unsigned T3GGO_T3DONE : 1;
2537 unsigned T3GSPM : 1;
2538 unsigned T3GTM : 1;
2539 unsigned T3GPOL : 1;
2540 unsigned TMR3GE : 1;
2543 struct
2545 unsigned : 1;
2546 unsigned : 1;
2547 unsigned : 1;
2548 unsigned T3GGO : 1;
2549 unsigned : 1;
2550 unsigned : 1;
2551 unsigned : 1;
2552 unsigned : 1;
2555 struct
2557 unsigned : 1;
2558 unsigned : 1;
2559 unsigned : 1;
2560 unsigned T3DONE : 1;
2561 unsigned : 1;
2562 unsigned : 1;
2563 unsigned : 1;
2564 unsigned : 1;
2567 struct
2569 unsigned T3GSS : 2;
2570 unsigned : 6;
2572 } __T3GCONbits_t;
2574 extern __at(0x0F97) volatile __T3GCONbits_t T3GCONbits;
2576 #define _T3GSS0 0x01
2577 #define _T3GSS1 0x02
2578 #define _T3GVAL 0x04
2579 #define _T3GGO_T3DONE 0x08
2580 #define _T3GGO 0x08
2581 #define _T3DONE 0x08
2582 #define _T3GSPM 0x10
2583 #define _T3GTM 0x20
2584 #define _T3GPOL 0x40
2585 #define _TMR3GE 0x80
2587 //==============================================================================
2589 extern __at(0x0F98) __sfr RTCVALL;
2590 extern __at(0x0F99) __sfr RTCVALH;
2592 //==============================================================================
2593 // T1GCON Bits
2595 extern __at(0x0F9A) __sfr T1GCON;
2597 typedef union
2599 struct
2601 unsigned T1GSS0 : 1;
2602 unsigned T1GSS1 : 1;
2603 unsigned T1GVAL : 1;
2604 unsigned T1GGO_T1DONE : 1;
2605 unsigned T1GSPM : 1;
2606 unsigned T1GTM : 1;
2607 unsigned T1GPOL : 1;
2608 unsigned TMR1GE : 1;
2611 struct
2613 unsigned : 1;
2614 unsigned : 1;
2615 unsigned : 1;
2616 unsigned T1GGO : 1;
2617 unsigned : 1;
2618 unsigned : 1;
2619 unsigned : 1;
2620 unsigned : 1;
2623 struct
2625 unsigned : 1;
2626 unsigned : 1;
2627 unsigned : 1;
2628 unsigned T1DONE : 1;
2629 unsigned : 1;
2630 unsigned : 1;
2631 unsigned : 1;
2632 unsigned : 1;
2635 struct
2637 unsigned T1GSS : 2;
2638 unsigned : 6;
2640 } __T1GCONbits_t;
2642 extern __at(0x0F9A) volatile __T1GCONbits_t T1GCONbits;
2644 #define _T1GSS0 0x01
2645 #define _T1GSS1 0x02
2646 #define _T1GVAL 0x04
2647 #define _T1GGO_T1DONE 0x08
2648 #define _T1GGO 0x08
2649 #define _T1DONE 0x08
2650 #define _T1GSPM 0x10
2651 #define _T1GTM 0x20
2652 #define _T1GPOL 0x40
2653 #define _TMR1GE 0x80
2655 //==============================================================================
2658 //==============================================================================
2659 // OSCTUNE Bits
2661 extern __at(0x0F9B) __sfr OSCTUNE;
2663 typedef union
2665 struct
2667 unsigned TUN0 : 1;
2668 unsigned TUN1 : 1;
2669 unsigned TUN2 : 1;
2670 unsigned TUN3 : 1;
2671 unsigned TUN4 : 1;
2672 unsigned TUN5 : 1;
2673 unsigned PLLEN : 1;
2674 unsigned INTSRC : 1;
2677 struct
2679 unsigned TUN : 6;
2680 unsigned : 2;
2682 } __OSCTUNEbits_t;
2684 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2686 #define _TUN0 0x01
2687 #define _TUN1 0x02
2688 #define _TUN2 0x04
2689 #define _TUN3 0x08
2690 #define _TUN4 0x10
2691 #define _TUN5 0x20
2692 #define _PLLEN 0x40
2693 #define _INTSRC 0x80
2695 //==============================================================================
2698 //==============================================================================
2699 // RCSTA2 Bits
2701 extern __at(0x0F9C) __sfr RCSTA2;
2703 typedef union
2705 struct
2707 unsigned RX9D : 1;
2708 unsigned OERR : 1;
2709 unsigned FERR : 1;
2710 unsigned ADDEN : 1;
2711 unsigned CREN : 1;
2712 unsigned SREN : 1;
2713 unsigned RX9 : 1;
2714 unsigned SPEN : 1;
2717 struct
2719 unsigned RX9D2 : 1;
2720 unsigned OERR2 : 1;
2721 unsigned FERR2 : 1;
2722 unsigned ADDEN2 : 1;
2723 unsigned CREN2 : 1;
2724 unsigned SREN2 : 1;
2725 unsigned RX92 : 1;
2726 unsigned SPEN2 : 1;
2728 } __RCSTA2bits_t;
2730 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
2732 #define _RCSTA2_RX9D 0x01
2733 #define _RCSTA2_RX9D2 0x01
2734 #define _RCSTA2_OERR 0x02
2735 #define _RCSTA2_OERR2 0x02
2736 #define _RCSTA2_FERR 0x04
2737 #define _RCSTA2_FERR2 0x04
2738 #define _RCSTA2_ADDEN 0x08
2739 #define _RCSTA2_ADDEN2 0x08
2740 #define _RCSTA2_CREN 0x10
2741 #define _RCSTA2_CREN2 0x10
2742 #define _RCSTA2_SREN 0x20
2743 #define _RCSTA2_SREN2 0x20
2744 #define _RCSTA2_RX9 0x40
2745 #define _RCSTA2_RX92 0x40
2746 #define _RCSTA2_SPEN 0x80
2747 #define _RCSTA2_SPEN2 0x80
2749 //==============================================================================
2752 //==============================================================================
2753 // PIE1 Bits
2755 extern __at(0x0F9D) __sfr PIE1;
2757 typedef union
2759 struct
2761 unsigned TMR1IE : 1;
2762 unsigned TMR2IE : 1;
2763 unsigned CCP1IE : 1;
2764 unsigned SSP1IE : 1;
2765 unsigned TX1IE : 1;
2766 unsigned RC1IE : 1;
2767 unsigned ADIE : 1;
2768 unsigned : 1;
2771 struct
2773 unsigned : 1;
2774 unsigned : 1;
2775 unsigned : 1;
2776 unsigned SSPIE : 1;
2777 unsigned TXIE : 1;
2778 unsigned RCIE : 1;
2779 unsigned : 1;
2780 unsigned : 1;
2782 } __PIE1bits_t;
2784 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
2786 #define _TMR1IE 0x01
2787 #define _TMR2IE 0x02
2788 #define _CCP1IE 0x04
2789 #define _SSP1IE 0x08
2790 #define _SSPIE 0x08
2791 #define _TX1IE 0x10
2792 #define _TXIE 0x10
2793 #define _RC1IE 0x20
2794 #define _RCIE 0x20
2795 #define _ADIE 0x40
2797 //==============================================================================
2800 //==============================================================================
2801 // PIR1 Bits
2803 extern __at(0x0F9E) __sfr PIR1;
2805 typedef union
2807 struct
2809 unsigned TMR1IF : 1;
2810 unsigned TMR2IF : 1;
2811 unsigned CCP1IF : 1;
2812 unsigned SSP1IF : 1;
2813 unsigned TX1IF : 1;
2814 unsigned RC1IF : 1;
2815 unsigned ADIF : 1;
2816 unsigned : 1;
2819 struct
2821 unsigned : 1;
2822 unsigned : 1;
2823 unsigned : 1;
2824 unsigned SSPIF : 1;
2825 unsigned TXIF : 1;
2826 unsigned RCIF : 1;
2827 unsigned : 1;
2828 unsigned : 1;
2830 } __PIR1bits_t;
2832 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2834 #define _TMR1IF 0x01
2835 #define _TMR2IF 0x02
2836 #define _CCP1IF 0x04
2837 #define _SSP1IF 0x08
2838 #define _SSPIF 0x08
2839 #define _TX1IF 0x10
2840 #define _TXIF 0x10
2841 #define _RC1IF 0x20
2842 #define _RCIF 0x20
2843 #define _ADIF 0x40
2845 //==============================================================================
2848 //==============================================================================
2849 // IPR1 Bits
2851 extern __at(0x0F9F) __sfr IPR1;
2853 typedef union
2855 struct
2857 unsigned TMR1IP : 1;
2858 unsigned TMR2IP : 1;
2859 unsigned CCP1IP : 1;
2860 unsigned SSP1IP : 1;
2861 unsigned TX1IP : 1;
2862 unsigned RC1IP : 1;
2863 unsigned ADIP : 1;
2864 unsigned : 1;
2867 struct
2869 unsigned : 1;
2870 unsigned : 1;
2871 unsigned : 1;
2872 unsigned SSPIP : 1;
2873 unsigned TXIP : 1;
2874 unsigned RCIP : 1;
2875 unsigned : 1;
2876 unsigned : 1;
2878 } __IPR1bits_t;
2880 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2882 #define _TMR1IP 0x01
2883 #define _TMR2IP 0x02
2884 #define _CCP1IP 0x04
2885 #define _SSP1IP 0x08
2886 #define _SSPIP 0x08
2887 #define _TX1IP 0x10
2888 #define _TXIP 0x10
2889 #define _RC1IP 0x20
2890 #define _RCIP 0x20
2891 #define _ADIP 0x40
2893 //==============================================================================
2896 //==============================================================================
2897 // PIE2 Bits
2899 extern __at(0x0FA0) __sfr PIE2;
2901 typedef union
2903 struct
2905 unsigned CCP2IE : 1;
2906 unsigned TMR3IE : 1;
2907 unsigned LVDIE : 1;
2908 unsigned BCL1IE : 1;
2909 unsigned USBIE : 1;
2910 unsigned CM1IE : 1;
2911 unsigned CM2IE : 1;
2912 unsigned OSCFIE : 1;
2915 struct
2917 unsigned : 1;
2918 unsigned : 1;
2919 unsigned : 1;
2920 unsigned BCLIE : 1;
2921 unsigned : 1;
2922 unsigned : 1;
2923 unsigned : 1;
2924 unsigned : 1;
2926 } __PIE2bits_t;
2928 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2930 #define _CCP2IE 0x01
2931 #define _TMR3IE 0x02
2932 #define _LVDIE 0x04
2933 #define _BCL1IE 0x08
2934 #define _BCLIE 0x08
2935 #define _USBIE 0x10
2936 #define _CM1IE 0x20
2937 #define _CM2IE 0x40
2938 #define _OSCFIE 0x80
2940 //==============================================================================
2943 //==============================================================================
2944 // PIR2 Bits
2946 extern __at(0x0FA1) __sfr PIR2;
2948 typedef union
2950 struct
2952 unsigned CCP2IF : 1;
2953 unsigned TMR3IF : 1;
2954 unsigned LVDIF : 1;
2955 unsigned BCL1IF : 1;
2956 unsigned USBIF : 1;
2957 unsigned CM1IF : 1;
2958 unsigned CM2IF : 1;
2959 unsigned OSCFIF : 1;
2962 struct
2964 unsigned : 1;
2965 unsigned : 1;
2966 unsigned : 1;
2967 unsigned BCLIF : 1;
2968 unsigned : 1;
2969 unsigned : 1;
2970 unsigned : 1;
2971 unsigned : 1;
2973 } __PIR2bits_t;
2975 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2977 #define _CCP2IF 0x01
2978 #define _TMR3IF 0x02
2979 #define _LVDIF 0x04
2980 #define _BCL1IF 0x08
2981 #define _BCLIF 0x08
2982 #define _USBIF 0x10
2983 #define _CM1IF 0x20
2984 #define _CM2IF 0x40
2985 #define _OSCFIF 0x80
2987 //==============================================================================
2990 //==============================================================================
2991 // IPR2 Bits
2993 extern __at(0x0FA2) __sfr IPR2;
2995 typedef union
2997 struct
2999 unsigned CCP2IP : 1;
3000 unsigned TMR3IP : 1;
3001 unsigned LVDIP : 1;
3002 unsigned BCL1IP : 1;
3003 unsigned USBIP : 1;
3004 unsigned CM1IP : 1;
3005 unsigned CM2IP : 1;
3006 unsigned OSCFIP : 1;
3009 struct
3011 unsigned : 1;
3012 unsigned : 1;
3013 unsigned : 1;
3014 unsigned BCLIP : 1;
3015 unsigned : 1;
3016 unsigned : 1;
3017 unsigned : 1;
3018 unsigned : 1;
3020 } __IPR2bits_t;
3022 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3024 #define _CCP2IP 0x01
3025 #define _TMR3IP 0x02
3026 #define _LVDIP 0x04
3027 #define _BCL1IP 0x08
3028 #define _BCLIP 0x08
3029 #define _USBIP 0x10
3030 #define _CM1IP 0x20
3031 #define _CM2IP 0x40
3032 #define _OSCFIP 0x80
3034 //==============================================================================
3037 //==============================================================================
3038 // PIE3 Bits
3040 extern __at(0x0FA3) __sfr PIE3;
3042 typedef struct
3044 unsigned RTCCIE : 1;
3045 unsigned TMR3GIE : 1;
3046 unsigned CTMUIE : 1;
3047 unsigned TMR4IE : 1;
3048 unsigned TX2IE : 1;
3049 unsigned RC2IE : 1;
3050 unsigned BCL2IE : 1;
3051 unsigned SSP2IE : 1;
3052 } __PIE3bits_t;
3054 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3056 #define _RTCCIE 0x01
3057 #define _TMR3GIE 0x02
3058 #define _CTMUIE 0x04
3059 #define _TMR4IE 0x08
3060 #define _TX2IE 0x10
3061 #define _RC2IE 0x20
3062 #define _BCL2IE 0x40
3063 #define _SSP2IE 0x80
3065 //==============================================================================
3068 //==============================================================================
3069 // PIR3 Bits
3071 extern __at(0x0FA4) __sfr PIR3;
3073 typedef struct
3075 unsigned RTCCIF : 1;
3076 unsigned TMR3GIF : 1;
3077 unsigned CTMUIF : 1;
3078 unsigned TMR4IF : 1;
3079 unsigned TX2IF : 1;
3080 unsigned RC2IF : 1;
3081 unsigned BCL2IF : 1;
3082 unsigned SSP2IF : 1;
3083 } __PIR3bits_t;
3085 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3087 #define _RTCCIF 0x01
3088 #define _TMR3GIF 0x02
3089 #define _CTMUIF 0x04
3090 #define _TMR4IF 0x08
3091 #define _TX2IF 0x10
3092 #define _RC2IF 0x20
3093 #define _BCL2IF 0x40
3094 #define _SSP2IF 0x80
3096 //==============================================================================
3099 //==============================================================================
3100 // IPR3 Bits
3102 extern __at(0x0FA5) __sfr IPR3;
3104 typedef struct
3106 unsigned RTCCIP : 1;
3107 unsigned TMR3GIP : 1;
3108 unsigned CTMUIP : 1;
3109 unsigned TMR4IP : 1;
3110 unsigned TX2IP : 1;
3111 unsigned RC2IP : 1;
3112 unsigned BCL2IP : 1;
3113 unsigned SSP2IP : 1;
3114 } __IPR3bits_t;
3116 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3118 #define _RTCCIP 0x01
3119 #define _TMR3GIP 0x02
3120 #define _CTMUIP 0x04
3121 #define _TMR4IP 0x08
3122 #define _TX2IP 0x10
3123 #define _RC2IP 0x20
3124 #define _BCL2IP 0x40
3125 #define _SSP2IP 0x80
3127 //==============================================================================
3130 //==============================================================================
3131 // EECON1 Bits
3133 extern __at(0x0FA6) __sfr EECON1;
3135 typedef struct
3137 unsigned : 1;
3138 unsigned WR : 1;
3139 unsigned WREN : 1;
3140 unsigned WRERR : 1;
3141 unsigned FREE : 1;
3142 unsigned WPROG : 1;
3143 unsigned : 1;
3144 unsigned : 1;
3145 } __EECON1bits_t;
3147 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3149 #define _WR 0x02
3150 #define _WREN 0x04
3151 #define _WRERR 0x08
3152 #define _FREE 0x10
3153 #define _WPROG 0x20
3155 //==============================================================================
3157 extern __at(0x0FA7) __sfr EECON2;
3159 //==============================================================================
3160 // TXSTA2 Bits
3162 extern __at(0x0FA8) __sfr TXSTA2;
3164 typedef union
3166 struct
3168 unsigned TX9D : 1;
3169 unsigned TRMT : 1;
3170 unsigned BRGH : 1;
3171 unsigned SENDB : 1;
3172 unsigned SYNC : 1;
3173 unsigned TXEN : 1;
3174 unsigned TX9 : 1;
3175 unsigned CSRC : 1;
3178 struct
3180 unsigned TX9D2 : 1;
3181 unsigned TRMT2 : 1;
3182 unsigned BRGH2 : 1;
3183 unsigned SENDB2 : 1;
3184 unsigned SYNC2 : 1;
3185 unsigned TXEN2 : 1;
3186 unsigned TX92 : 1;
3187 unsigned CSRC2 : 1;
3189 } __TXSTA2bits_t;
3191 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
3193 #define _TXSTA2_TX9D 0x01
3194 #define _TXSTA2_TX9D2 0x01
3195 #define _TXSTA2_TRMT 0x02
3196 #define _TXSTA2_TRMT2 0x02
3197 #define _TXSTA2_BRGH 0x04
3198 #define _TXSTA2_BRGH2 0x04
3199 #define _TXSTA2_SENDB 0x08
3200 #define _TXSTA2_SENDB2 0x08
3201 #define _TXSTA2_SYNC 0x10
3202 #define _TXSTA2_SYNC2 0x10
3203 #define _TXSTA2_TXEN 0x20
3204 #define _TXSTA2_TXEN2 0x20
3205 #define _TXSTA2_TX9 0x40
3206 #define _TXSTA2_TX92 0x40
3207 #define _TXSTA2_CSRC 0x80
3208 #define _TXSTA2_CSRC2 0x80
3210 //==============================================================================
3212 extern __at(0x0FA9) __sfr TXREG2;
3213 extern __at(0x0FAA) __sfr RCREG2;
3214 extern __at(0x0FAB) __sfr SPBRG2;
3216 //==============================================================================
3217 // RCSTA Bits
3219 extern __at(0x0FAC) __sfr RCSTA;
3221 typedef union
3223 struct
3225 unsigned RX9D : 1;
3226 unsigned OERR : 1;
3227 unsigned FERR : 1;
3228 unsigned ADDEN : 1;
3229 unsigned CREN : 1;
3230 unsigned SREN : 1;
3231 unsigned RX9 : 1;
3232 unsigned SPEN : 1;
3235 struct
3237 unsigned RCD8 : 1;
3238 unsigned OERR1 : 1;
3239 unsigned FERR1 : 1;
3240 unsigned ADEN : 1;
3241 unsigned CREN1 : 1;
3242 unsigned SREN1 : 1;
3243 unsigned RC9 : 1;
3244 unsigned SPEN1 : 1;
3247 struct
3249 unsigned RX9D1 : 1;
3250 unsigned : 1;
3251 unsigned : 1;
3252 unsigned ADDEN1 : 1;
3253 unsigned : 1;
3254 unsigned : 1;
3255 unsigned NOT_RC8 : 1;
3256 unsigned : 1;
3259 struct
3261 unsigned : 1;
3262 unsigned : 1;
3263 unsigned : 1;
3264 unsigned : 1;
3265 unsigned : 1;
3266 unsigned : 1;
3267 unsigned RC8_9 : 1;
3268 unsigned : 1;
3271 struct
3273 unsigned : 1;
3274 unsigned : 1;
3275 unsigned : 1;
3276 unsigned : 1;
3277 unsigned : 1;
3278 unsigned : 1;
3279 unsigned RX91 : 1;
3280 unsigned : 1;
3282 } __RCSTAbits_t;
3284 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
3286 #define _RX9D 0x01
3287 #define _RCD8 0x01
3288 #define _RX9D1 0x01
3289 #define _OERR 0x02
3290 #define _OERR1 0x02
3291 #define _FERR 0x04
3292 #define _FERR1 0x04
3293 #define _ADDEN 0x08
3294 #define _ADEN 0x08
3295 #define _ADDEN1 0x08
3296 #define _CREN 0x10
3297 #define _CREN1 0x10
3298 #define _SREN 0x20
3299 #define _SREN1 0x20
3300 #define _RX9 0x40
3301 #define _RC9 0x40
3302 #define _NOT_RC8 0x40
3303 #define _RC8_9 0x40
3304 #define _RX91 0x40
3305 #define _SPEN 0x80
3306 #define _SPEN1 0x80
3308 //==============================================================================
3311 //==============================================================================
3312 // RCSTA1 Bits
3314 extern __at(0x0FAC) __sfr RCSTA1;
3316 typedef union
3318 struct
3320 unsigned RX9D : 1;
3321 unsigned OERR : 1;
3322 unsigned FERR : 1;
3323 unsigned ADDEN : 1;
3324 unsigned CREN : 1;
3325 unsigned SREN : 1;
3326 unsigned RX9 : 1;
3327 unsigned SPEN : 1;
3330 struct
3332 unsigned RCD8 : 1;
3333 unsigned OERR1 : 1;
3334 unsigned FERR1 : 1;
3335 unsigned ADEN : 1;
3336 unsigned CREN1 : 1;
3337 unsigned SREN1 : 1;
3338 unsigned RC9 : 1;
3339 unsigned SPEN1 : 1;
3342 struct
3344 unsigned RX9D1 : 1;
3345 unsigned : 1;
3346 unsigned : 1;
3347 unsigned ADDEN1 : 1;
3348 unsigned : 1;
3349 unsigned : 1;
3350 unsigned NOT_RC8 : 1;
3351 unsigned : 1;
3354 struct
3356 unsigned : 1;
3357 unsigned : 1;
3358 unsigned : 1;
3359 unsigned : 1;
3360 unsigned : 1;
3361 unsigned : 1;
3362 unsigned RC8_9 : 1;
3363 unsigned : 1;
3366 struct
3368 unsigned : 1;
3369 unsigned : 1;
3370 unsigned : 1;
3371 unsigned : 1;
3372 unsigned : 1;
3373 unsigned : 1;
3374 unsigned RX91 : 1;
3375 unsigned : 1;
3377 } __RCSTA1bits_t;
3379 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
3381 #define _RCSTA1_RX9D 0x01
3382 #define _RCSTA1_RCD8 0x01
3383 #define _RCSTA1_RX9D1 0x01
3384 #define _RCSTA1_OERR 0x02
3385 #define _RCSTA1_OERR1 0x02
3386 #define _RCSTA1_FERR 0x04
3387 #define _RCSTA1_FERR1 0x04
3388 #define _RCSTA1_ADDEN 0x08
3389 #define _RCSTA1_ADEN 0x08
3390 #define _RCSTA1_ADDEN1 0x08
3391 #define _RCSTA1_CREN 0x10
3392 #define _RCSTA1_CREN1 0x10
3393 #define _RCSTA1_SREN 0x20
3394 #define _RCSTA1_SREN1 0x20
3395 #define _RCSTA1_RX9 0x40
3396 #define _RCSTA1_RC9 0x40
3397 #define _RCSTA1_NOT_RC8 0x40
3398 #define _RCSTA1_RC8_9 0x40
3399 #define _RCSTA1_RX91 0x40
3400 #define _RCSTA1_SPEN 0x80
3401 #define _RCSTA1_SPEN1 0x80
3403 //==============================================================================
3406 //==============================================================================
3407 // TXSTA Bits
3409 extern __at(0x0FAD) __sfr TXSTA;
3411 typedef union
3413 struct
3415 unsigned TX9D : 1;
3416 unsigned TRMT : 1;
3417 unsigned BRGH : 1;
3418 unsigned SENDB : 1;
3419 unsigned SYNC : 1;
3420 unsigned TXEN : 1;
3421 unsigned TX9 : 1;
3422 unsigned CSRC : 1;
3425 struct
3427 unsigned TXD8 : 1;
3428 unsigned TRMT1 : 1;
3429 unsigned BRGH1 : 1;
3430 unsigned SENDB1 : 1;
3431 unsigned SYNC1 : 1;
3432 unsigned TXEN1 : 1;
3433 unsigned TX8_9 : 1;
3434 unsigned CSRC1 : 1;
3437 struct
3439 unsigned TX9D1 : 1;
3440 unsigned : 1;
3441 unsigned : 1;
3442 unsigned : 1;
3443 unsigned : 1;
3444 unsigned : 1;
3445 unsigned NOT_TX8 : 1;
3446 unsigned : 1;
3449 struct
3451 unsigned : 1;
3452 unsigned : 1;
3453 unsigned : 1;
3454 unsigned : 1;
3455 unsigned : 1;
3456 unsigned : 1;
3457 unsigned TX91 : 1;
3458 unsigned : 1;
3460 } __TXSTAbits_t;
3462 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
3464 #define _TX9D 0x01
3465 #define _TXD8 0x01
3466 #define _TX9D1 0x01
3467 #define _TRMT 0x02
3468 #define _TRMT1 0x02
3469 #define _BRGH 0x04
3470 #define _BRGH1 0x04
3471 #define _SENDB 0x08
3472 #define _SENDB1 0x08
3473 #define _SYNC 0x10
3474 #define _SYNC1 0x10
3475 #define _TXEN 0x20
3476 #define _TXEN1 0x20
3477 #define _TX9 0x40
3478 #define _TX8_9 0x40
3479 #define _NOT_TX8 0x40
3480 #define _TX91 0x40
3481 #define _CSRC 0x80
3482 #define _CSRC1 0x80
3484 //==============================================================================
3487 //==============================================================================
3488 // TXSTA1 Bits
3490 extern __at(0x0FAD) __sfr TXSTA1;
3492 typedef union
3494 struct
3496 unsigned TX9D : 1;
3497 unsigned TRMT : 1;
3498 unsigned BRGH : 1;
3499 unsigned SENDB : 1;
3500 unsigned SYNC : 1;
3501 unsigned TXEN : 1;
3502 unsigned TX9 : 1;
3503 unsigned CSRC : 1;
3506 struct
3508 unsigned TXD8 : 1;
3509 unsigned TRMT1 : 1;
3510 unsigned BRGH1 : 1;
3511 unsigned SENDB1 : 1;
3512 unsigned SYNC1 : 1;
3513 unsigned TXEN1 : 1;
3514 unsigned TX8_9 : 1;
3515 unsigned CSRC1 : 1;
3518 struct
3520 unsigned TX9D1 : 1;
3521 unsigned : 1;
3522 unsigned : 1;
3523 unsigned : 1;
3524 unsigned : 1;
3525 unsigned : 1;
3526 unsigned NOT_TX8 : 1;
3527 unsigned : 1;
3530 struct
3532 unsigned : 1;
3533 unsigned : 1;
3534 unsigned : 1;
3535 unsigned : 1;
3536 unsigned : 1;
3537 unsigned : 1;
3538 unsigned TX91 : 1;
3539 unsigned : 1;
3541 } __TXSTA1bits_t;
3543 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
3545 #define _TXSTA1_TX9D 0x01
3546 #define _TXSTA1_TXD8 0x01
3547 #define _TXSTA1_TX9D1 0x01
3548 #define _TXSTA1_TRMT 0x02
3549 #define _TXSTA1_TRMT1 0x02
3550 #define _TXSTA1_BRGH 0x04
3551 #define _TXSTA1_BRGH1 0x04
3552 #define _TXSTA1_SENDB 0x08
3553 #define _TXSTA1_SENDB1 0x08
3554 #define _TXSTA1_SYNC 0x10
3555 #define _TXSTA1_SYNC1 0x10
3556 #define _TXSTA1_TXEN 0x20
3557 #define _TXSTA1_TXEN1 0x20
3558 #define _TXSTA1_TX9 0x40
3559 #define _TXSTA1_TX8_9 0x40
3560 #define _TXSTA1_NOT_TX8 0x40
3561 #define _TXSTA1_TX91 0x40
3562 #define _TXSTA1_CSRC 0x80
3563 #define _TXSTA1_CSRC1 0x80
3565 //==============================================================================
3567 extern __at(0x0FAE) __sfr TXREG;
3568 extern __at(0x0FAE) __sfr TXREG1;
3569 extern __at(0x0FAF) __sfr RCREG;
3570 extern __at(0x0FAF) __sfr RCREG1;
3571 extern __at(0x0FB0) __sfr SPBRG;
3572 extern __at(0x0FB0) __sfr SPBRG1;
3574 //==============================================================================
3575 // CTMUICON Bits
3577 extern __at(0x0FB1) __sfr CTMUICON;
3579 typedef union
3581 struct
3583 unsigned IRNG0 : 1;
3584 unsigned IRNG1 : 1;
3585 unsigned ITRIM0 : 1;
3586 unsigned ITRIM1 : 1;
3587 unsigned ITRIM2 : 1;
3588 unsigned ITRIM3 : 1;
3589 unsigned ITRIM4 : 1;
3590 unsigned ITRIM5 : 1;
3593 struct
3595 unsigned IRNG : 2;
3596 unsigned : 6;
3599 struct
3601 unsigned : 2;
3602 unsigned ITRIM : 6;
3604 } __CTMUICONbits_t;
3606 extern __at(0x0FB1) volatile __CTMUICONbits_t CTMUICONbits;
3608 #define _IRNG0 0x01
3609 #define _IRNG1 0x02
3610 #define _ITRIM0 0x04
3611 #define _ITRIM1 0x08
3612 #define _ITRIM2 0x10
3613 #define _ITRIM3 0x20
3614 #define _ITRIM4 0x40
3615 #define _ITRIM5 0x80
3617 //==============================================================================
3620 //==============================================================================
3621 // CTMUCONL Bits
3623 extern __at(0x0FB2) __sfr CTMUCONL;
3625 typedef union
3627 struct
3629 unsigned EDG1STAT : 1;
3630 unsigned EDG2STAT : 1;
3631 unsigned EDG1SEL0 : 1;
3632 unsigned EDG1SEL1 : 1;
3633 unsigned EDG1POL : 1;
3634 unsigned EDG2SEL0 : 1;
3635 unsigned EDG2SEL1 : 1;
3636 unsigned EDG2POL : 1;
3639 struct
3641 unsigned : 2;
3642 unsigned EDG1SEL : 2;
3643 unsigned : 4;
3646 struct
3648 unsigned : 5;
3649 unsigned EDG2SEL : 2;
3650 unsigned : 1;
3652 } __CTMUCONLbits_t;
3654 extern __at(0x0FB2) volatile __CTMUCONLbits_t CTMUCONLbits;
3656 #define _EDG1STAT 0x01
3657 #define _EDG2STAT 0x02
3658 #define _EDG1SEL0 0x04
3659 #define _EDG1SEL1 0x08
3660 #define _EDG1POL 0x10
3661 #define _EDG2SEL0 0x20
3662 #define _EDG2SEL1 0x40
3663 #define _EDG2POL 0x80
3665 //==============================================================================
3668 //==============================================================================
3669 // CTMUCONH Bits
3671 extern __at(0x0FB3) __sfr CTMUCONH;
3673 typedef struct
3675 unsigned CTTRIG : 1;
3676 unsigned IDISSEN : 1;
3677 unsigned EDGSEQEN : 1;
3678 unsigned EDGEN : 1;
3679 unsigned TGEN : 1;
3680 unsigned CTMUSIDL : 1;
3681 unsigned : 1;
3682 unsigned CTMUEN : 1;
3683 } __CTMUCONHbits_t;
3685 extern __at(0x0FB3) volatile __CTMUCONHbits_t CTMUCONHbits;
3687 #define _CTTRIG 0x01
3688 #define _IDISSEN 0x02
3689 #define _EDGSEQEN 0x04
3690 #define _EDGEN 0x08
3691 #define _TGEN 0x10
3692 #define _CTMUSIDL 0x20
3693 #define _CTMUEN 0x80
3695 //==============================================================================
3698 //==============================================================================
3699 // CCP2CON Bits
3701 extern __at(0x0FB4) __sfr CCP2CON;
3703 typedef union
3705 struct
3707 unsigned CCP2M0 : 1;
3708 unsigned CCP2M1 : 1;
3709 unsigned CCP2M2 : 1;
3710 unsigned CCP2M3 : 1;
3711 unsigned DC2B0 : 1;
3712 unsigned DC2B1 : 1;
3713 unsigned P2M0 : 1;
3714 unsigned P2M1 : 1;
3717 struct
3719 unsigned : 1;
3720 unsigned : 1;
3721 unsigned : 1;
3722 unsigned : 1;
3723 unsigned CCP2Y : 1;
3724 unsigned CCP2X : 1;
3725 unsigned : 1;
3726 unsigned : 1;
3729 struct
3731 unsigned CCP2M : 4;
3732 unsigned : 4;
3735 struct
3737 unsigned : 4;
3738 unsigned DC2B : 2;
3739 unsigned : 2;
3742 struct
3744 unsigned : 6;
3745 unsigned P2M : 2;
3747 } __CCP2CONbits_t;
3749 extern __at(0x0FB4) volatile __CCP2CONbits_t CCP2CONbits;
3751 #define _CCP2M0 0x01
3752 #define _CCP2M1 0x02
3753 #define _CCP2M2 0x04
3754 #define _CCP2M3 0x08
3755 #define _DC2B0 0x10
3756 #define _CCP2Y 0x10
3757 #define _DC2B1 0x20
3758 #define _CCP2X 0x20
3759 #define _P2M0 0x40
3760 #define _P2M1 0x80
3762 //==============================================================================
3765 //==============================================================================
3766 // ECCP2CON Bits
3768 extern __at(0x0FB4) __sfr ECCP2CON;
3770 typedef union
3772 struct
3774 unsigned CCP2M0 : 1;
3775 unsigned CCP2M1 : 1;
3776 unsigned CCP2M2 : 1;
3777 unsigned CCP2M3 : 1;
3778 unsigned DC2B0 : 1;
3779 unsigned DC2B1 : 1;
3780 unsigned P2M0 : 1;
3781 unsigned P2M1 : 1;
3784 struct
3786 unsigned : 1;
3787 unsigned : 1;
3788 unsigned : 1;
3789 unsigned : 1;
3790 unsigned CCP2Y : 1;
3791 unsigned CCP2X : 1;
3792 unsigned : 1;
3793 unsigned : 1;
3796 struct
3798 unsigned CCP2M : 4;
3799 unsigned : 4;
3802 struct
3804 unsigned : 4;
3805 unsigned DC2B : 2;
3806 unsigned : 2;
3809 struct
3811 unsigned : 6;
3812 unsigned P2M : 2;
3814 } __ECCP2CONbits_t;
3816 extern __at(0x0FB4) volatile __ECCP2CONbits_t ECCP2CONbits;
3818 #define _ECCP2CON_CCP2M0 0x01
3819 #define _ECCP2CON_CCP2M1 0x02
3820 #define _ECCP2CON_CCP2M2 0x04
3821 #define _ECCP2CON_CCP2M3 0x08
3822 #define _ECCP2CON_DC2B0 0x10
3823 #define _ECCP2CON_CCP2Y 0x10
3824 #define _ECCP2CON_DC2B1 0x20
3825 #define _ECCP2CON_CCP2X 0x20
3826 #define _ECCP2CON_P2M0 0x40
3827 #define _ECCP2CON_P2M1 0x80
3829 //==============================================================================
3831 extern __at(0x0FB5) __sfr CCPR2;
3832 extern __at(0x0FB5) __sfr CCPR2L;
3833 extern __at(0x0FB6) __sfr CCPR2H;
3835 //==============================================================================
3836 // ECCP2DEL Bits
3838 extern __at(0x0FB7) __sfr ECCP2DEL;
3840 typedef union
3842 struct
3844 unsigned P2DC0 : 1;
3845 unsigned P2DC1 : 1;
3846 unsigned P2DC2 : 1;
3847 unsigned P2DC3 : 1;
3848 unsigned P2DC4 : 1;
3849 unsigned P2DC5 : 1;
3850 unsigned P2DC6 : 1;
3851 unsigned P2RSEN : 1;
3854 struct
3856 unsigned P2DC : 7;
3857 unsigned : 1;
3859 } __ECCP2DELbits_t;
3861 extern __at(0x0FB7) volatile __ECCP2DELbits_t ECCP2DELbits;
3863 #define _P2DC0 0x01
3864 #define _P2DC1 0x02
3865 #define _P2DC2 0x04
3866 #define _P2DC3 0x08
3867 #define _P2DC4 0x10
3868 #define _P2DC5 0x20
3869 #define _P2DC6 0x40
3870 #define _P2RSEN 0x80
3872 //==============================================================================
3875 //==============================================================================
3876 // PWM2CON Bits
3878 extern __at(0x0FB7) __sfr PWM2CON;
3880 typedef union
3882 struct
3884 unsigned P2DC0 : 1;
3885 unsigned P2DC1 : 1;
3886 unsigned P2DC2 : 1;
3887 unsigned P2DC3 : 1;
3888 unsigned P2DC4 : 1;
3889 unsigned P2DC5 : 1;
3890 unsigned P2DC6 : 1;
3891 unsigned P2RSEN : 1;
3894 struct
3896 unsigned P2DC : 7;
3897 unsigned : 1;
3899 } __PWM2CONbits_t;
3901 extern __at(0x0FB7) volatile __PWM2CONbits_t PWM2CONbits;
3903 #define _PWM2CON_P2DC0 0x01
3904 #define _PWM2CON_P2DC1 0x02
3905 #define _PWM2CON_P2DC2 0x04
3906 #define _PWM2CON_P2DC3 0x08
3907 #define _PWM2CON_P2DC4 0x10
3908 #define _PWM2CON_P2DC5 0x20
3909 #define _PWM2CON_P2DC6 0x40
3910 #define _PWM2CON_P2RSEN 0x80
3912 //==============================================================================
3915 //==============================================================================
3916 // ECCP2AS Bits
3918 extern __at(0x0FB8) __sfr ECCP2AS;
3920 typedef union
3922 struct
3924 unsigned PSS2BD0 : 1;
3925 unsigned PSS2BD1 : 1;
3926 unsigned PSS2AC0 : 1;
3927 unsigned PSS2AC1 : 1;
3928 unsigned ECCP2AS0 : 1;
3929 unsigned ECCP2AS1 : 1;
3930 unsigned ECCP2AS2 : 1;
3931 unsigned ECCP2ASE : 1;
3934 struct
3936 unsigned PSS2BD : 2;
3937 unsigned : 6;
3940 struct
3942 unsigned : 2;
3943 unsigned PSS2AC : 2;
3944 unsigned : 4;
3947 struct
3949 unsigned : 4;
3950 unsigned ECCP2AS : 3;
3951 unsigned : 1;
3953 } __ECCP2ASbits_t;
3955 extern __at(0x0FB8) volatile __ECCP2ASbits_t ECCP2ASbits;
3957 #define _PSS2BD0 0x01
3958 #define _PSS2BD1 0x02
3959 #define _PSS2AC0 0x04
3960 #define _PSS2AC1 0x08
3961 #define _ECCP2AS0 0x10
3962 #define _ECCP2AS1 0x20
3963 #define _ECCP2AS2 0x40
3964 #define _ECCP2ASE 0x80
3966 //==============================================================================
3969 //==============================================================================
3970 // PSTR2CON Bits
3972 extern __at(0x0FB9) __sfr PSTR2CON;
3974 typedef union
3976 struct
3978 unsigned STRA : 1;
3979 unsigned STRB : 1;
3980 unsigned STRC : 1;
3981 unsigned STRD : 1;
3982 unsigned STRSYNC : 1;
3983 unsigned P2DC5 : 1;
3984 unsigned CMPL0 : 1;
3985 unsigned CMPL1 : 1;
3988 struct
3990 unsigned P2DC0 : 1;
3991 unsigned P2DC1 : 1;
3992 unsigned P2DC2 : 1;
3993 unsigned P2DC3 : 1;
3994 unsigned P2DC4 : 1;
3995 unsigned : 1;
3996 unsigned P2DC6 : 1;
3997 unsigned : 1;
4000 struct
4002 unsigned P2DC : 7;
4003 unsigned : 1;
4006 struct
4008 unsigned : 6;
4009 unsigned CMPL : 2;
4011 } __PSTR2CONbits_t;
4013 extern __at(0x0FB9) volatile __PSTR2CONbits_t PSTR2CONbits;
4015 #define _PSTR2CON_STRA 0x01
4016 #define _PSTR2CON_P2DC0 0x01
4017 #define _PSTR2CON_STRB 0x02
4018 #define _PSTR2CON_P2DC1 0x02
4019 #define _PSTR2CON_STRC 0x04
4020 #define _PSTR2CON_P2DC2 0x04
4021 #define _PSTR2CON_STRD 0x08
4022 #define _PSTR2CON_P2DC3 0x08
4023 #define _PSTR2CON_STRSYNC 0x10
4024 #define _PSTR2CON_P2DC4 0x10
4025 #define _PSTR2CON_P2DC5 0x20
4026 #define _PSTR2CON_CMPL0 0x40
4027 #define _PSTR2CON_P2DC6 0x40
4028 #define _PSTR2CON_CMPL1 0x80
4030 //==============================================================================
4033 //==============================================================================
4034 // CCP1CON Bits
4036 extern __at(0x0FBA) __sfr CCP1CON;
4038 typedef union
4040 struct
4042 unsigned CCP1M0 : 1;
4043 unsigned CCP1M1 : 1;
4044 unsigned CCP1M2 : 1;
4045 unsigned CCP1M3 : 1;
4046 unsigned DC1B0 : 1;
4047 unsigned DC1B1 : 1;
4048 unsigned P1M0 : 1;
4049 unsigned P1M1 : 1;
4052 struct
4054 unsigned : 1;
4055 unsigned : 1;
4056 unsigned : 1;
4057 unsigned : 1;
4058 unsigned CCP1Y : 1;
4059 unsigned CCP1X : 1;
4060 unsigned : 1;
4061 unsigned : 1;
4064 struct
4066 unsigned CCP1M : 4;
4067 unsigned : 4;
4070 struct
4072 unsigned : 4;
4073 unsigned DC1B : 2;
4074 unsigned : 2;
4077 struct
4079 unsigned : 6;
4080 unsigned P1M : 2;
4082 } __CCP1CONbits_t;
4084 extern __at(0x0FBA) volatile __CCP1CONbits_t CCP1CONbits;
4086 #define _CCP1M0 0x01
4087 #define _CCP1M1 0x02
4088 #define _CCP1M2 0x04
4089 #define _CCP1M3 0x08
4090 #define _DC1B0 0x10
4091 #define _CCP1Y 0x10
4092 #define _DC1B1 0x20
4093 #define _CCP1X 0x20
4094 #define _P1M0 0x40
4095 #define _P1M1 0x80
4097 //==============================================================================
4100 //==============================================================================
4101 // ECCP1CON Bits
4103 extern __at(0x0FBA) __sfr ECCP1CON;
4105 typedef union
4107 struct
4109 unsigned CCP1M0 : 1;
4110 unsigned CCP1M1 : 1;
4111 unsigned CCP1M2 : 1;
4112 unsigned CCP1M3 : 1;
4113 unsigned DC1B0 : 1;
4114 unsigned DC1B1 : 1;
4115 unsigned P1M0 : 1;
4116 unsigned P1M1 : 1;
4119 struct
4121 unsigned : 1;
4122 unsigned : 1;
4123 unsigned : 1;
4124 unsigned : 1;
4125 unsigned CCP1Y : 1;
4126 unsigned CCP1X : 1;
4127 unsigned : 1;
4128 unsigned : 1;
4131 struct
4133 unsigned CCP1M : 4;
4134 unsigned : 4;
4137 struct
4139 unsigned : 4;
4140 unsigned DC1B : 2;
4141 unsigned : 2;
4144 struct
4146 unsigned : 6;
4147 unsigned P1M : 2;
4149 } __ECCP1CONbits_t;
4151 extern __at(0x0FBA) volatile __ECCP1CONbits_t ECCP1CONbits;
4153 #define _ECCP1CON_CCP1M0 0x01
4154 #define _ECCP1CON_CCP1M1 0x02
4155 #define _ECCP1CON_CCP1M2 0x04
4156 #define _ECCP1CON_CCP1M3 0x08
4157 #define _ECCP1CON_DC1B0 0x10
4158 #define _ECCP1CON_CCP1Y 0x10
4159 #define _ECCP1CON_DC1B1 0x20
4160 #define _ECCP1CON_CCP1X 0x20
4161 #define _ECCP1CON_P1M0 0x40
4162 #define _ECCP1CON_P1M1 0x80
4164 //==============================================================================
4166 extern __at(0x0FBB) __sfr CCPR1;
4167 extern __at(0x0FBB) __sfr CCPR1L;
4168 extern __at(0x0FBC) __sfr CCPR1H;
4170 //==============================================================================
4171 // ECCP1DEL Bits
4173 extern __at(0x0FBD) __sfr ECCP1DEL;
4175 typedef union
4177 struct
4179 unsigned P1DC0 : 1;
4180 unsigned P1DC1 : 1;
4181 unsigned P1DC2 : 1;
4182 unsigned P1DC3 : 1;
4183 unsigned P1DC4 : 1;
4184 unsigned P1DC5 : 1;
4185 unsigned P1DC6 : 1;
4186 unsigned P1RSEN : 1;
4189 struct
4191 unsigned P1DC : 7;
4192 unsigned : 1;
4194 } __ECCP1DELbits_t;
4196 extern __at(0x0FBD) volatile __ECCP1DELbits_t ECCP1DELbits;
4198 #define _P1DC0 0x01
4199 #define _P1DC1 0x02
4200 #define _P1DC2 0x04
4201 #define _P1DC3 0x08
4202 #define _P1DC4 0x10
4203 #define _P1DC5 0x20
4204 #define _P1DC6 0x40
4205 #define _P1RSEN 0x80
4207 //==============================================================================
4210 //==============================================================================
4211 // PWM1CON Bits
4213 extern __at(0x0FBD) __sfr PWM1CON;
4215 typedef union
4217 struct
4219 unsigned P1DC0 : 1;
4220 unsigned P1DC1 : 1;
4221 unsigned P1DC2 : 1;
4222 unsigned P1DC3 : 1;
4223 unsigned P1DC4 : 1;
4224 unsigned P1DC5 : 1;
4225 unsigned P1DC6 : 1;
4226 unsigned P1RSEN : 1;
4229 struct
4231 unsigned P1DC : 7;
4232 unsigned : 1;
4234 } __PWM1CONbits_t;
4236 extern __at(0x0FBD) volatile __PWM1CONbits_t PWM1CONbits;
4238 #define _PWM1CON_P1DC0 0x01
4239 #define _PWM1CON_P1DC1 0x02
4240 #define _PWM1CON_P1DC2 0x04
4241 #define _PWM1CON_P1DC3 0x08
4242 #define _PWM1CON_P1DC4 0x10
4243 #define _PWM1CON_P1DC5 0x20
4244 #define _PWM1CON_P1DC6 0x40
4245 #define _PWM1CON_P1RSEN 0x80
4247 //==============================================================================
4250 //==============================================================================
4251 // ECCP1AS Bits
4253 extern __at(0x0FBE) __sfr ECCP1AS;
4255 typedef union
4257 struct
4259 unsigned PSS1BD0 : 1;
4260 unsigned PSS1BD1 : 1;
4261 unsigned PSS1AC0 : 1;
4262 unsigned PSS1AC1 : 1;
4263 unsigned ECCP1AS0 : 1;
4264 unsigned ECCP1AS1 : 1;
4265 unsigned ECCP1AS2 : 1;
4266 unsigned ECCP1ASE : 1;
4269 struct
4271 unsigned PSS1BD : 2;
4272 unsigned : 6;
4275 struct
4277 unsigned : 2;
4278 unsigned PSS1AC : 2;
4279 unsigned : 4;
4282 struct
4284 unsigned : 4;
4285 unsigned ECCP1AS : 3;
4286 unsigned : 1;
4288 } __ECCP1ASbits_t;
4290 extern __at(0x0FBE) volatile __ECCP1ASbits_t ECCP1ASbits;
4292 #define _PSS1BD0 0x01
4293 #define _PSS1BD1 0x02
4294 #define _PSS1AC0 0x04
4295 #define _PSS1AC1 0x08
4296 #define _ECCP1AS0 0x10
4297 #define _ECCP1AS1 0x20
4298 #define _ECCP1AS2 0x40
4299 #define _ECCP1ASE 0x80
4301 //==============================================================================
4304 //==============================================================================
4305 // PSTR1CON Bits
4307 extern __at(0x0FBF) __sfr PSTR1CON;
4309 typedef union
4311 struct
4313 unsigned STRA : 1;
4314 unsigned STRB : 1;
4315 unsigned STRC : 1;
4316 unsigned STRD : 1;
4317 unsigned STRSYNC : 1;
4318 unsigned : 1;
4319 unsigned CMPL0 : 1;
4320 unsigned CMPL1 : 1;
4323 struct
4325 unsigned : 6;
4326 unsigned CMPL : 2;
4328 } __PSTR1CONbits_t;
4330 extern __at(0x0FBF) volatile __PSTR1CONbits_t PSTR1CONbits;
4332 #define _STRA 0x01
4333 #define _STRB 0x02
4334 #define _STRC 0x04
4335 #define _STRD 0x08
4336 #define _STRSYNC 0x10
4337 #define _CMPL0 0x40
4338 #define _CMPL1 0x80
4340 //==============================================================================
4343 //==============================================================================
4344 // WDTCON Bits
4346 extern __at(0x0FC0) __sfr WDTCON;
4348 typedef union
4350 struct
4352 unsigned SWDTEN : 1;
4353 unsigned ULPSINK : 1;
4354 unsigned ULPEN : 1;
4355 unsigned DS : 1;
4356 unsigned : 1;
4357 unsigned ULPLVL : 1;
4358 unsigned LVDSTAT : 1;
4359 unsigned REGSLP : 1;
4362 struct
4364 unsigned SWDTE : 1;
4365 unsigned : 1;
4366 unsigned : 1;
4367 unsigned : 1;
4368 unsigned : 1;
4369 unsigned : 1;
4370 unsigned : 1;
4371 unsigned : 1;
4373 } __WDTCONbits_t;
4375 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
4377 #define _SWDTEN 0x01
4378 #define _SWDTE 0x01
4379 #define _ULPSINK 0x02
4380 #define _ULPEN 0x04
4381 #define _DS 0x08
4382 #define _ULPLVL 0x20
4383 #define _LVDSTAT 0x40
4384 #define _REGSLP 0x80
4386 //==============================================================================
4389 //==============================================================================
4390 // ADCON1 Bits
4392 extern __at(0x0FC1) __sfr ADCON1;
4394 typedef union
4396 struct
4398 unsigned ADCS0 : 1;
4399 unsigned ADCS1 : 1;
4400 unsigned ADCS2 : 1;
4401 unsigned ACQT0 : 1;
4402 unsigned ACQT1 : 1;
4403 unsigned ACQT2 : 1;
4404 unsigned ADCAL : 1;
4405 unsigned ADFM : 1;
4408 struct
4410 unsigned ADCS : 3;
4411 unsigned : 5;
4414 struct
4416 unsigned : 3;
4417 unsigned ACQT : 3;
4418 unsigned : 2;
4420 } __ADCON1bits_t;
4422 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4424 #define _ADCS0 0x01
4425 #define _ADCS1 0x02
4426 #define _ADCS2 0x04
4427 #define _ACQT0 0x08
4428 #define _ACQT1 0x10
4429 #define _ACQT2 0x20
4430 #define _ADCAL 0x40
4431 #define _ADFM 0x80
4433 //==============================================================================
4436 //==============================================================================
4437 // ADCON0 Bits
4439 extern __at(0x0FC2) __sfr ADCON0;
4441 typedef union
4443 struct
4445 unsigned ADON : 1;
4446 unsigned GO_NOT_DONE : 1;
4447 unsigned CHS0 : 1;
4448 unsigned CHS1 : 1;
4449 unsigned CHS2 : 1;
4450 unsigned CHS3 : 1;
4451 unsigned VCFG0 : 1;
4452 unsigned VCFG1 : 1;
4455 struct
4457 unsigned : 1;
4458 unsigned GO_DONE : 1;
4459 unsigned : 1;
4460 unsigned : 1;
4461 unsigned : 1;
4462 unsigned : 1;
4463 unsigned : 1;
4464 unsigned : 1;
4467 struct
4469 unsigned : 1;
4470 unsigned DONE : 1;
4471 unsigned : 1;
4472 unsigned : 1;
4473 unsigned : 1;
4474 unsigned : 1;
4475 unsigned : 1;
4476 unsigned : 1;
4479 struct
4481 unsigned : 1;
4482 unsigned GO : 1;
4483 unsigned : 1;
4484 unsigned : 1;
4485 unsigned : 1;
4486 unsigned : 1;
4487 unsigned : 1;
4488 unsigned : 1;
4491 struct
4493 unsigned : 1;
4494 unsigned NOT_DONE : 1;
4495 unsigned : 1;
4496 unsigned : 1;
4497 unsigned : 1;
4498 unsigned : 1;
4499 unsigned : 1;
4500 unsigned : 1;
4503 struct
4505 unsigned : 2;
4506 unsigned CHS : 4;
4507 unsigned : 2;
4510 struct
4512 unsigned : 6;
4513 unsigned VCFG : 2;
4515 } __ADCON0bits_t;
4517 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4519 #define _ADON 0x01
4520 #define _GO_NOT_DONE 0x02
4521 #define _GO_DONE 0x02
4522 #define _DONE 0x02
4523 #define _GO 0x02
4524 #define _NOT_DONE 0x02
4525 #define _CHS0 0x04
4526 #define _CHS1 0x08
4527 #define _CHS2 0x10
4528 #define _CHS3 0x20
4529 #define _VCFG0 0x40
4530 #define _VCFG1 0x80
4532 //==============================================================================
4534 extern __at(0x0FC3) __sfr ADRES;
4535 extern __at(0x0FC3) __sfr ADRESL;
4536 extern __at(0x0FC4) __sfr ADRESH;
4538 //==============================================================================
4539 // SSP1CON2 Bits
4541 extern __at(0x0FC5) __sfr SSP1CON2;
4543 typedef union
4545 struct
4547 unsigned SEN : 1;
4548 unsigned RSEN : 1;
4549 unsigned PEN : 1;
4550 unsigned RCEN : 1;
4551 unsigned ACKEN : 1;
4552 unsigned ACKDT : 1;
4553 unsigned ACKSTAT : 1;
4554 unsigned GCEN : 1;
4557 struct
4559 unsigned : 1;
4560 unsigned ADMSK1 : 1;
4561 unsigned ADMSK2 : 1;
4562 unsigned ADMSK3 : 1;
4563 unsigned ADMSK4 : 1;
4564 unsigned ADMSK5 : 1;
4565 unsigned : 1;
4566 unsigned : 1;
4568 } __SSP1CON2bits_t;
4570 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4572 #define _SEN 0x01
4573 #define _RSEN 0x02
4574 #define _ADMSK1 0x02
4575 #define _PEN 0x04
4576 #define _ADMSK2 0x04
4577 #define _RCEN 0x08
4578 #define _ADMSK3 0x08
4579 #define _ACKEN 0x10
4580 #define _ADMSK4 0x10
4581 #define _ACKDT 0x20
4582 #define _ADMSK5 0x20
4583 #define _ACKSTAT 0x40
4584 #define _GCEN 0x80
4586 //==============================================================================
4589 //==============================================================================
4590 // SSPCON2 Bits
4592 extern __at(0x0FC5) __sfr SSPCON2;
4594 typedef union
4596 struct
4598 unsigned SEN : 1;
4599 unsigned RSEN : 1;
4600 unsigned PEN : 1;
4601 unsigned RCEN : 1;
4602 unsigned ACKEN : 1;
4603 unsigned ACKDT : 1;
4604 unsigned ACKSTAT : 1;
4605 unsigned GCEN : 1;
4608 struct
4610 unsigned : 1;
4611 unsigned ADMSK1 : 1;
4612 unsigned ADMSK2 : 1;
4613 unsigned ADMSK3 : 1;
4614 unsigned ADMSK4 : 1;
4615 unsigned ADMSK5 : 1;
4616 unsigned : 1;
4617 unsigned : 1;
4619 } __SSPCON2bits_t;
4621 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4623 #define _SSPCON2_SEN 0x01
4624 #define _SSPCON2_RSEN 0x02
4625 #define _SSPCON2_ADMSK1 0x02
4626 #define _SSPCON2_PEN 0x04
4627 #define _SSPCON2_ADMSK2 0x04
4628 #define _SSPCON2_RCEN 0x08
4629 #define _SSPCON2_ADMSK3 0x08
4630 #define _SSPCON2_ACKEN 0x10
4631 #define _SSPCON2_ADMSK4 0x10
4632 #define _SSPCON2_ACKDT 0x20
4633 #define _SSPCON2_ADMSK5 0x20
4634 #define _SSPCON2_ACKSTAT 0x40
4635 #define _SSPCON2_GCEN 0x80
4637 //==============================================================================
4640 //==============================================================================
4641 // SSP1CON1 Bits
4643 extern __at(0x0FC6) __sfr SSP1CON1;
4645 typedef union
4647 struct
4649 unsigned SSPM0 : 1;
4650 unsigned SSPM1 : 1;
4651 unsigned SSPM2 : 1;
4652 unsigned SSPM3 : 1;
4653 unsigned CKP : 1;
4654 unsigned SSPEN : 1;
4655 unsigned SSPOV : 1;
4656 unsigned WCOL : 1;
4659 struct
4661 unsigned SSPM01 : 1;
4662 unsigned SSPM11 : 1;
4663 unsigned SSPM21 : 1;
4664 unsigned SSPM31 : 1;
4665 unsigned CKP1 : 1;
4666 unsigned SSPEN1 : 1;
4667 unsigned SSPOV1 : 1;
4668 unsigned WCOL1 : 1;
4670 } __SSP1CON1bits_t;
4672 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4674 #define _SSPM0 0x01
4675 #define _SSPM01 0x01
4676 #define _SSPM1 0x02
4677 #define _SSPM11 0x02
4678 #define _SSPM2 0x04
4679 #define _SSPM21 0x04
4680 #define _SSPM3 0x08
4681 #define _SSPM31 0x08
4682 #define _CKP 0x10
4683 #define _CKP1 0x10
4684 #define _SSPEN 0x20
4685 #define _SSPEN1 0x20
4686 #define _SSPOV 0x40
4687 #define _SSPOV1 0x40
4688 #define _WCOL 0x80
4689 #define _WCOL1 0x80
4691 //==============================================================================
4694 //==============================================================================
4695 // SSPCON1 Bits
4697 extern __at(0x0FC6) __sfr SSPCON1;
4699 typedef union
4701 struct
4703 unsigned SSPM0 : 1;
4704 unsigned SSPM1 : 1;
4705 unsigned SSPM2 : 1;
4706 unsigned SSPM3 : 1;
4707 unsigned CKP : 1;
4708 unsigned SSPEN : 1;
4709 unsigned SSPOV : 1;
4710 unsigned WCOL : 1;
4713 struct
4715 unsigned SSPM01 : 1;
4716 unsigned SSPM11 : 1;
4717 unsigned SSPM21 : 1;
4718 unsigned SSPM31 : 1;
4719 unsigned CKP1 : 1;
4720 unsigned SSPEN1 : 1;
4721 unsigned SSPOV1 : 1;
4722 unsigned WCOL1 : 1;
4724 } __SSPCON1bits_t;
4726 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4728 #define _SSPCON1_SSPM0 0x01
4729 #define _SSPCON1_SSPM01 0x01
4730 #define _SSPCON1_SSPM1 0x02
4731 #define _SSPCON1_SSPM11 0x02
4732 #define _SSPCON1_SSPM2 0x04
4733 #define _SSPCON1_SSPM21 0x04
4734 #define _SSPCON1_SSPM3 0x08
4735 #define _SSPCON1_SSPM31 0x08
4736 #define _SSPCON1_CKP 0x10
4737 #define _SSPCON1_CKP1 0x10
4738 #define _SSPCON1_SSPEN 0x20
4739 #define _SSPCON1_SSPEN1 0x20
4740 #define _SSPCON1_SSPOV 0x40
4741 #define _SSPCON1_SSPOV1 0x40
4742 #define _SSPCON1_WCOL 0x80
4743 #define _SSPCON1_WCOL1 0x80
4745 //==============================================================================
4748 //==============================================================================
4749 // SSP1STAT Bits
4751 extern __at(0x0FC7) __sfr SSP1STAT;
4753 typedef union
4755 struct
4757 unsigned BF : 1;
4758 unsigned UA : 1;
4759 unsigned R_NOT_W : 1;
4760 unsigned S : 1;
4761 unsigned P : 1;
4762 unsigned D_NOT_A : 1;
4763 unsigned CKE : 1;
4764 unsigned SMP : 1;
4767 struct
4769 unsigned BF1 : 1;
4770 unsigned UA1 : 1;
4771 unsigned R : 1;
4772 unsigned I2C_START : 1;
4773 unsigned I2C_STOP : 1;
4774 unsigned D : 1;
4775 unsigned CKE1 : 1;
4776 unsigned SMP1 : 1;
4779 struct
4781 unsigned : 1;
4782 unsigned : 1;
4783 unsigned R_W : 1;
4784 unsigned S1 : 1;
4785 unsigned P1 : 1;
4786 unsigned D_A : 1;
4787 unsigned : 1;
4788 unsigned : 1;
4791 struct
4793 unsigned : 1;
4794 unsigned : 1;
4795 unsigned NOT_W : 1;
4796 unsigned I2C_START1 : 1;
4797 unsigned I2C_STOP1 : 1;
4798 unsigned NOT_A : 1;
4799 unsigned : 1;
4800 unsigned : 1;
4803 struct
4805 unsigned : 1;
4806 unsigned : 1;
4807 unsigned NOT_WRITE : 1;
4808 unsigned : 1;
4809 unsigned : 1;
4810 unsigned NOT_ADDRESS : 1;
4811 unsigned : 1;
4812 unsigned : 1;
4815 struct
4817 unsigned : 1;
4818 unsigned : 1;
4819 unsigned READ_WRITE : 1;
4820 unsigned : 1;
4821 unsigned : 1;
4822 unsigned DATA_ADDRESS : 1;
4823 unsigned : 1;
4824 unsigned : 1;
4827 struct
4829 unsigned : 1;
4830 unsigned : 1;
4831 unsigned I2C_READ : 1;
4832 unsigned : 1;
4833 unsigned : 1;
4834 unsigned I2C_DAT : 1;
4835 unsigned : 1;
4836 unsigned : 1;
4839 struct
4841 unsigned : 1;
4842 unsigned : 1;
4843 unsigned R_NOT_W1 : 1;
4844 unsigned : 1;
4845 unsigned : 1;
4846 unsigned D_NOT_A1 : 1;
4847 unsigned : 1;
4848 unsigned : 1;
4851 struct
4853 unsigned : 1;
4854 unsigned : 1;
4855 unsigned R1 : 1;
4856 unsigned : 1;
4857 unsigned : 1;
4858 unsigned D1 : 1;
4859 unsigned : 1;
4860 unsigned : 1;
4863 struct
4865 unsigned : 1;
4866 unsigned : 1;
4867 unsigned D_A1 : 1;
4868 unsigned : 1;
4869 unsigned : 1;
4870 unsigned R_W1 : 1;
4871 unsigned : 1;
4872 unsigned : 1;
4875 struct
4877 unsigned : 1;
4878 unsigned : 1;
4879 unsigned NOT_W1 : 1;
4880 unsigned : 1;
4881 unsigned : 1;
4882 unsigned NOT_A1 : 1;
4883 unsigned : 1;
4884 unsigned : 1;
4887 struct
4889 unsigned : 1;
4890 unsigned : 1;
4891 unsigned NOT_WRITE1 : 1;
4892 unsigned : 1;
4893 unsigned : 1;
4894 unsigned NOT_ADDRESS1 : 1;
4895 unsigned : 1;
4896 unsigned : 1;
4899 struct
4901 unsigned : 1;
4902 unsigned : 1;
4903 unsigned READ_WRITE1 : 1;
4904 unsigned : 1;
4905 unsigned : 1;
4906 unsigned DATA_ADDRESS1 : 1;
4907 unsigned : 1;
4908 unsigned : 1;
4911 struct
4913 unsigned : 1;
4914 unsigned : 1;
4915 unsigned I2C_READ1 : 1;
4916 unsigned : 1;
4917 unsigned : 1;
4918 unsigned I2C_DAT1 : 1;
4919 unsigned : 1;
4920 unsigned : 1;
4922 } __SSP1STATbits_t;
4924 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4926 #define _BF 0x01
4927 #define _BF1 0x01
4928 #define _UA 0x02
4929 #define _UA1 0x02
4930 #define _R_NOT_W 0x04
4931 #define _R 0x04
4932 #define _R_W 0x04
4933 #define _NOT_W 0x04
4934 #define _NOT_WRITE 0x04
4935 #define _READ_WRITE 0x04
4936 #define _I2C_READ 0x04
4937 #define _R_NOT_W1 0x04
4938 #define _R1 0x04
4939 #define _D_A1 0x04
4940 #define _NOT_W1 0x04
4941 #define _NOT_WRITE1 0x04
4942 #define _READ_WRITE1 0x04
4943 #define _I2C_READ1 0x04
4944 #define _S 0x08
4945 #define _I2C_START 0x08
4946 #define _S1 0x08
4947 #define _I2C_START1 0x08
4948 #define _P 0x10
4949 #define _I2C_STOP 0x10
4950 #define _P1 0x10
4951 #define _I2C_STOP1 0x10
4952 #define _D_NOT_A 0x20
4953 #define _D 0x20
4954 #define _D_A 0x20
4955 #define _NOT_A 0x20
4956 #define _NOT_ADDRESS 0x20
4957 #define _DATA_ADDRESS 0x20
4958 #define _I2C_DAT 0x20
4959 #define _D_NOT_A1 0x20
4960 #define _D1 0x20
4961 #define _R_W1 0x20
4962 #define _NOT_A1 0x20
4963 #define _NOT_ADDRESS1 0x20
4964 #define _DATA_ADDRESS1 0x20
4965 #define _I2C_DAT1 0x20
4966 #define _CKE 0x40
4967 #define _CKE1 0x40
4968 #define _SMP 0x80
4969 #define _SMP1 0x80
4971 //==============================================================================
4974 //==============================================================================
4975 // SSPSTAT Bits
4977 extern __at(0x0FC7) __sfr SSPSTAT;
4979 typedef union
4981 struct
4983 unsigned BF : 1;
4984 unsigned UA : 1;
4985 unsigned R_NOT_W : 1;
4986 unsigned S : 1;
4987 unsigned P : 1;
4988 unsigned D_NOT_A : 1;
4989 unsigned CKE : 1;
4990 unsigned SMP : 1;
4993 struct
4995 unsigned BF1 : 1;
4996 unsigned UA1 : 1;
4997 unsigned R : 1;
4998 unsigned I2C_START : 1;
4999 unsigned I2C_STOP : 1;
5000 unsigned D : 1;
5001 unsigned CKE1 : 1;
5002 unsigned SMP1 : 1;
5005 struct
5007 unsigned : 1;
5008 unsigned : 1;
5009 unsigned R_W : 1;
5010 unsigned S1 : 1;
5011 unsigned P1 : 1;
5012 unsigned D_A : 1;
5013 unsigned : 1;
5014 unsigned : 1;
5017 struct
5019 unsigned : 1;
5020 unsigned : 1;
5021 unsigned NOT_W : 1;
5022 unsigned I2C_START1 : 1;
5023 unsigned I2C_STOP1 : 1;
5024 unsigned NOT_A : 1;
5025 unsigned : 1;
5026 unsigned : 1;
5029 struct
5031 unsigned : 1;
5032 unsigned : 1;
5033 unsigned NOT_WRITE : 1;
5034 unsigned : 1;
5035 unsigned : 1;
5036 unsigned NOT_ADDRESS : 1;
5037 unsigned : 1;
5038 unsigned : 1;
5041 struct
5043 unsigned : 1;
5044 unsigned : 1;
5045 unsigned READ_WRITE : 1;
5046 unsigned : 1;
5047 unsigned : 1;
5048 unsigned DATA_ADDRESS : 1;
5049 unsigned : 1;
5050 unsigned : 1;
5053 struct
5055 unsigned : 1;
5056 unsigned : 1;
5057 unsigned I2C_READ : 1;
5058 unsigned : 1;
5059 unsigned : 1;
5060 unsigned I2C_DAT : 1;
5061 unsigned : 1;
5062 unsigned : 1;
5065 struct
5067 unsigned : 1;
5068 unsigned : 1;
5069 unsigned R_NOT_W1 : 1;
5070 unsigned : 1;
5071 unsigned : 1;
5072 unsigned D_NOT_A1 : 1;
5073 unsigned : 1;
5074 unsigned : 1;
5077 struct
5079 unsigned : 1;
5080 unsigned : 1;
5081 unsigned R1 : 1;
5082 unsigned : 1;
5083 unsigned : 1;
5084 unsigned D1 : 1;
5085 unsigned : 1;
5086 unsigned : 1;
5089 struct
5091 unsigned : 1;
5092 unsigned : 1;
5093 unsigned D_A1 : 1;
5094 unsigned : 1;
5095 unsigned : 1;
5096 unsigned R_W1 : 1;
5097 unsigned : 1;
5098 unsigned : 1;
5101 struct
5103 unsigned : 1;
5104 unsigned : 1;
5105 unsigned NOT_W1 : 1;
5106 unsigned : 1;
5107 unsigned : 1;
5108 unsigned NOT_A1 : 1;
5109 unsigned : 1;
5110 unsigned : 1;
5113 struct
5115 unsigned : 1;
5116 unsigned : 1;
5117 unsigned NOT_WRITE1 : 1;
5118 unsigned : 1;
5119 unsigned : 1;
5120 unsigned NOT_ADDRESS1 : 1;
5121 unsigned : 1;
5122 unsigned : 1;
5125 struct
5127 unsigned : 1;
5128 unsigned : 1;
5129 unsigned READ_WRITE1 : 1;
5130 unsigned : 1;
5131 unsigned : 1;
5132 unsigned DATA_ADDRESS1 : 1;
5133 unsigned : 1;
5134 unsigned : 1;
5137 struct
5139 unsigned : 1;
5140 unsigned : 1;
5141 unsigned I2C_READ1 : 1;
5142 unsigned : 1;
5143 unsigned : 1;
5144 unsigned I2C_DAT1 : 1;
5145 unsigned : 1;
5146 unsigned : 1;
5148 } __SSPSTATbits_t;
5150 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5152 #define _SSPSTAT_BF 0x01
5153 #define _SSPSTAT_BF1 0x01
5154 #define _SSPSTAT_UA 0x02
5155 #define _SSPSTAT_UA1 0x02
5156 #define _SSPSTAT_R_NOT_W 0x04
5157 #define _SSPSTAT_R 0x04
5158 #define _SSPSTAT_R_W 0x04
5159 #define _SSPSTAT_NOT_W 0x04
5160 #define _SSPSTAT_NOT_WRITE 0x04
5161 #define _SSPSTAT_READ_WRITE 0x04
5162 #define _SSPSTAT_I2C_READ 0x04
5163 #define _SSPSTAT_R_NOT_W1 0x04
5164 #define _SSPSTAT_R1 0x04
5165 #define _SSPSTAT_D_A1 0x04
5166 #define _SSPSTAT_NOT_W1 0x04
5167 #define _SSPSTAT_NOT_WRITE1 0x04
5168 #define _SSPSTAT_READ_WRITE1 0x04
5169 #define _SSPSTAT_I2C_READ1 0x04
5170 #define _SSPSTAT_S 0x08
5171 #define _SSPSTAT_I2C_START 0x08
5172 #define _SSPSTAT_S1 0x08
5173 #define _SSPSTAT_I2C_START1 0x08
5174 #define _SSPSTAT_P 0x10
5175 #define _SSPSTAT_I2C_STOP 0x10
5176 #define _SSPSTAT_P1 0x10
5177 #define _SSPSTAT_I2C_STOP1 0x10
5178 #define _SSPSTAT_D_NOT_A 0x20
5179 #define _SSPSTAT_D 0x20
5180 #define _SSPSTAT_D_A 0x20
5181 #define _SSPSTAT_NOT_A 0x20
5182 #define _SSPSTAT_NOT_ADDRESS 0x20
5183 #define _SSPSTAT_DATA_ADDRESS 0x20
5184 #define _SSPSTAT_I2C_DAT 0x20
5185 #define _SSPSTAT_D_NOT_A1 0x20
5186 #define _SSPSTAT_D1 0x20
5187 #define _SSPSTAT_R_W1 0x20
5188 #define _SSPSTAT_NOT_A1 0x20
5189 #define _SSPSTAT_NOT_ADDRESS1 0x20
5190 #define _SSPSTAT_DATA_ADDRESS1 0x20
5191 #define _SSPSTAT_I2C_DAT1 0x20
5192 #define _SSPSTAT_CKE 0x40
5193 #define _SSPSTAT_CKE1 0x40
5194 #define _SSPSTAT_SMP 0x80
5195 #define _SSPSTAT_SMP1 0x80
5197 //==============================================================================
5200 //==============================================================================
5201 // SSP1ADD Bits
5203 extern __at(0x0FC8) __sfr SSP1ADD;
5205 typedef union
5207 struct
5209 unsigned MSK0 : 1;
5210 unsigned MSK1 : 1;
5211 unsigned MSK2 : 1;
5212 unsigned MSK3 : 1;
5213 unsigned MSK4 : 1;
5214 unsigned MSK5 : 1;
5215 unsigned MSK6 : 1;
5216 unsigned MSK7 : 1;
5219 struct
5221 unsigned MSK01 : 1;
5222 unsigned MSK11 : 1;
5223 unsigned MSK21 : 1;
5224 unsigned MSK31 : 1;
5225 unsigned MSK41 : 1;
5226 unsigned MSK51 : 1;
5227 unsigned MSK61 : 1;
5228 unsigned MSK71 : 1;
5230 } __SSP1ADDbits_t;
5232 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
5234 #define _MSK0 0x01
5235 #define _MSK01 0x01
5236 #define _MSK1 0x02
5237 #define _MSK11 0x02
5238 #define _MSK2 0x04
5239 #define _MSK21 0x04
5240 #define _MSK3 0x08
5241 #define _MSK31 0x08
5242 #define _MSK4 0x10
5243 #define _MSK41 0x10
5244 #define _MSK5 0x20
5245 #define _MSK51 0x20
5246 #define _MSK6 0x40
5247 #define _MSK61 0x40
5248 #define _MSK7 0x80
5249 #define _MSK71 0x80
5251 //==============================================================================
5254 //==============================================================================
5255 // SSP1MSK Bits
5257 extern __at(0x0FC8) __sfr SSP1MSK;
5259 typedef union
5261 struct
5263 unsigned MSK0 : 1;
5264 unsigned MSK1 : 1;
5265 unsigned MSK2 : 1;
5266 unsigned MSK3 : 1;
5267 unsigned MSK4 : 1;
5268 unsigned MSK5 : 1;
5269 unsigned MSK6 : 1;
5270 unsigned MSK7 : 1;
5273 struct
5275 unsigned MSK01 : 1;
5276 unsigned MSK11 : 1;
5277 unsigned MSK21 : 1;
5278 unsigned MSK31 : 1;
5279 unsigned MSK41 : 1;
5280 unsigned MSK51 : 1;
5281 unsigned MSK61 : 1;
5282 unsigned MSK71 : 1;
5284 } __SSP1MSKbits_t;
5286 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
5288 #define _SSP1MSK_MSK0 0x01
5289 #define _SSP1MSK_MSK01 0x01
5290 #define _SSP1MSK_MSK1 0x02
5291 #define _SSP1MSK_MSK11 0x02
5292 #define _SSP1MSK_MSK2 0x04
5293 #define _SSP1MSK_MSK21 0x04
5294 #define _SSP1MSK_MSK3 0x08
5295 #define _SSP1MSK_MSK31 0x08
5296 #define _SSP1MSK_MSK4 0x10
5297 #define _SSP1MSK_MSK41 0x10
5298 #define _SSP1MSK_MSK5 0x20
5299 #define _SSP1MSK_MSK51 0x20
5300 #define _SSP1MSK_MSK6 0x40
5301 #define _SSP1MSK_MSK61 0x40
5302 #define _SSP1MSK_MSK7 0x80
5303 #define _SSP1MSK_MSK71 0x80
5305 //==============================================================================
5308 //==============================================================================
5309 // SSPADD Bits
5311 extern __at(0x0FC8) __sfr SSPADD;
5313 typedef union
5315 struct
5317 unsigned MSK0 : 1;
5318 unsigned MSK1 : 1;
5319 unsigned MSK2 : 1;
5320 unsigned MSK3 : 1;
5321 unsigned MSK4 : 1;
5322 unsigned MSK5 : 1;
5323 unsigned MSK6 : 1;
5324 unsigned MSK7 : 1;
5327 struct
5329 unsigned MSK01 : 1;
5330 unsigned MSK11 : 1;
5331 unsigned MSK21 : 1;
5332 unsigned MSK31 : 1;
5333 unsigned MSK41 : 1;
5334 unsigned MSK51 : 1;
5335 unsigned MSK61 : 1;
5336 unsigned MSK71 : 1;
5338 } __SSPADDbits_t;
5340 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
5342 #define _SSPADD_MSK0 0x01
5343 #define _SSPADD_MSK01 0x01
5344 #define _SSPADD_MSK1 0x02
5345 #define _SSPADD_MSK11 0x02
5346 #define _SSPADD_MSK2 0x04
5347 #define _SSPADD_MSK21 0x04
5348 #define _SSPADD_MSK3 0x08
5349 #define _SSPADD_MSK31 0x08
5350 #define _SSPADD_MSK4 0x10
5351 #define _SSPADD_MSK41 0x10
5352 #define _SSPADD_MSK5 0x20
5353 #define _SSPADD_MSK51 0x20
5354 #define _SSPADD_MSK6 0x40
5355 #define _SSPADD_MSK61 0x40
5356 #define _SSPADD_MSK7 0x80
5357 #define _SSPADD_MSK71 0x80
5359 //==============================================================================
5361 extern __at(0x0FC9) __sfr SSP1BUF;
5362 extern __at(0x0FC9) __sfr SSPBUF;
5364 //==============================================================================
5365 // T2CON Bits
5367 extern __at(0x0FCA) __sfr T2CON;
5369 typedef union
5371 struct
5373 unsigned T2CKPS0 : 1;
5374 unsigned T2CKPS1 : 1;
5375 unsigned TMR2ON : 1;
5376 unsigned T2OUTPS0 : 1;
5377 unsigned T2OUTPS1 : 1;
5378 unsigned T2OUTPS2 : 1;
5379 unsigned T2OUTPS3 : 1;
5380 unsigned : 1;
5383 struct
5385 unsigned T2CKPS : 2;
5386 unsigned : 6;
5389 struct
5391 unsigned : 3;
5392 unsigned T2OUTPS : 4;
5393 unsigned : 1;
5395 } __T2CONbits_t;
5397 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5399 #define _T2CKPS0 0x01
5400 #define _T2CKPS1 0x02
5401 #define _TMR2ON 0x04
5402 #define _T2OUTPS0 0x08
5403 #define _T2OUTPS1 0x10
5404 #define _T2OUTPS2 0x20
5405 #define _T2OUTPS3 0x40
5407 //==============================================================================
5409 extern __at(0x0FCB) __sfr PR2;
5410 extern __at(0x0FCC) __sfr TMR2;
5412 //==============================================================================
5413 // T1CON Bits
5415 extern __at(0x0FCD) __sfr T1CON;
5417 typedef union
5419 struct
5421 unsigned TMR1ON : 1;
5422 unsigned RD16 : 1;
5423 unsigned T1SYNC : 1;
5424 unsigned T1OSCEN : 1;
5425 unsigned T1CKPS0 : 1;
5426 unsigned T1CKPS1 : 1;
5427 unsigned TMR1CS0 : 1;
5428 unsigned TMR1CS1 : 1;
5431 struct
5433 unsigned : 1;
5434 unsigned RD161 : 1;
5435 unsigned T1SYNC1 : 1;
5436 unsigned T1OSCEN1 : 1;
5437 unsigned T1CKPS01 : 1;
5438 unsigned T1CKPS11 : 1;
5439 unsigned TMR1CS01 : 1;
5440 unsigned TMR1CS11 : 1;
5442 } __T1CONbits_t;
5444 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5446 #define _TMR1ON 0x01
5447 #define _RD16 0x02
5448 #define _RD161 0x02
5449 #define _T1SYNC 0x04
5450 #define _T1SYNC1 0x04
5451 #define _T1OSCEN 0x08
5452 #define _T1OSCEN1 0x08
5453 #define _T1CKPS0 0x10
5454 #define _T1CKPS01 0x10
5455 #define _T1CKPS1 0x20
5456 #define _T1CKPS11 0x20
5457 #define _TMR1CS0 0x40
5458 #define _TMR1CS01 0x40
5459 #define _TMR1CS1 0x80
5460 #define _TMR1CS11 0x80
5462 //==============================================================================
5464 extern __at(0x0FCE) __sfr TMR1;
5465 extern __at(0x0FCE) __sfr TMR1L;
5466 extern __at(0x0FCF) __sfr TMR1H;
5468 //==============================================================================
5469 // RCON Bits
5471 extern __at(0x0FD0) __sfr RCON;
5473 typedef union
5475 struct
5477 unsigned NOT_BOR : 1;
5478 unsigned NOT_POR : 1;
5479 unsigned NOT_PD : 1;
5480 unsigned NOT_TO : 1;
5481 unsigned NOT_RI : 1;
5482 unsigned NOT_CM : 1;
5483 unsigned : 1;
5484 unsigned IPEN : 1;
5487 struct
5489 unsigned BOR : 1;
5490 unsigned POR : 1;
5491 unsigned PD : 1;
5492 unsigned TO : 1;
5493 unsigned RI : 1;
5494 unsigned CM : 1;
5495 unsigned : 1;
5496 unsigned : 1;
5498 } __RCONbits_t;
5500 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5502 #define _NOT_BOR 0x01
5503 #define _BOR 0x01
5504 #define _NOT_POR 0x02
5505 #define _POR 0x02
5506 #define _NOT_PD 0x04
5507 #define _PD 0x04
5508 #define _NOT_TO 0x08
5509 #define _TO 0x08
5510 #define _NOT_RI 0x10
5511 #define _RI 0x10
5512 #define _NOT_CM 0x20
5513 #define _CM 0x20
5514 #define _IPEN 0x80
5516 //==============================================================================
5519 //==============================================================================
5520 // CM2CON Bits
5522 extern __at(0x0FD1) __sfr CM2CON;
5524 typedef union
5526 struct
5528 unsigned CCH0 : 1;
5529 unsigned CCH1 : 1;
5530 unsigned CREF : 1;
5531 unsigned EVPOL0 : 1;
5532 unsigned EVPOL1 : 1;
5533 unsigned CPOL : 1;
5534 unsigned COE : 1;
5535 unsigned CON : 1;
5538 struct
5540 unsigned CCH : 2;
5541 unsigned : 6;
5544 struct
5546 unsigned : 3;
5547 unsigned EVPOL : 2;
5548 unsigned : 3;
5550 } __CM2CONbits_t;
5552 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
5554 #define _CM2CON_CCH0 0x01
5555 #define _CM2CON_CCH1 0x02
5556 #define _CM2CON_CREF 0x04
5557 #define _CM2CON_EVPOL0 0x08
5558 #define _CM2CON_EVPOL1 0x10
5559 #define _CM2CON_CPOL 0x20
5560 #define _CM2CON_COE 0x40
5561 #define _CM2CON_CON 0x80
5563 //==============================================================================
5566 //==============================================================================
5567 // CM2CON1 Bits
5569 extern __at(0x0FD1) __sfr CM2CON1;
5571 typedef union
5573 struct
5575 unsigned CCH0 : 1;
5576 unsigned CCH1 : 1;
5577 unsigned CREF : 1;
5578 unsigned EVPOL0 : 1;
5579 unsigned EVPOL1 : 1;
5580 unsigned CPOL : 1;
5581 unsigned COE : 1;
5582 unsigned CON : 1;
5585 struct
5587 unsigned CCH : 2;
5588 unsigned : 6;
5591 struct
5593 unsigned : 3;
5594 unsigned EVPOL : 2;
5595 unsigned : 3;
5597 } __CM2CON1bits_t;
5599 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
5601 #define _CM2CON1_CCH0 0x01
5602 #define _CM2CON1_CCH1 0x02
5603 #define _CM2CON1_CREF 0x04
5604 #define _CM2CON1_EVPOL0 0x08
5605 #define _CM2CON1_EVPOL1 0x10
5606 #define _CM2CON1_CPOL 0x20
5607 #define _CM2CON1_COE 0x40
5608 #define _CM2CON1_CON 0x80
5610 //==============================================================================
5613 //==============================================================================
5614 // CM1CON Bits
5616 extern __at(0x0FD2) __sfr CM1CON;
5618 typedef union
5620 struct
5622 unsigned CCH0 : 1;
5623 unsigned CCH1 : 1;
5624 unsigned CREF : 1;
5625 unsigned EVPOL0 : 1;
5626 unsigned EVPOL1 : 1;
5627 unsigned CPOL : 1;
5628 unsigned COE : 1;
5629 unsigned CON : 1;
5632 struct
5634 unsigned CCH01 : 1;
5635 unsigned CCH11 : 1;
5636 unsigned CREF1 : 1;
5637 unsigned EVPOL01 : 1;
5638 unsigned EVPOL11 : 1;
5639 unsigned CPOL1 : 1;
5640 unsigned COE1 : 1;
5641 unsigned CON1 : 1;
5643 } __CM1CONbits_t;
5645 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
5647 #define _CCH0 0x01
5648 #define _CCH01 0x01
5649 #define _CCH1 0x02
5650 #define _CCH11 0x02
5651 #define _CREF 0x04
5652 #define _CREF1 0x04
5653 #define _EVPOL0 0x08
5654 #define _EVPOL01 0x08
5655 #define _EVPOL1 0x10
5656 #define _EVPOL11 0x10
5657 #define _CPOL 0x20
5658 #define _CPOL1 0x20
5659 #define _COE 0x40
5660 #define _COE1 0x40
5661 #define _CON 0x80
5662 #define _CON1 0x80
5664 //==============================================================================
5667 //==============================================================================
5668 // CM1CON1 Bits
5670 extern __at(0x0FD2) __sfr CM1CON1;
5672 typedef union
5674 struct
5676 unsigned CCH0 : 1;
5677 unsigned CCH1 : 1;
5678 unsigned CREF : 1;
5679 unsigned EVPOL0 : 1;
5680 unsigned EVPOL1 : 1;
5681 unsigned CPOL : 1;
5682 unsigned COE : 1;
5683 unsigned CON : 1;
5686 struct
5688 unsigned CCH01 : 1;
5689 unsigned CCH11 : 1;
5690 unsigned CREF1 : 1;
5691 unsigned EVPOL01 : 1;
5692 unsigned EVPOL11 : 1;
5693 unsigned CPOL1 : 1;
5694 unsigned COE1 : 1;
5695 unsigned CON1 : 1;
5697 } __CM1CON1bits_t;
5699 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
5701 #define _CM1CON1_CCH0 0x01
5702 #define _CM1CON1_CCH01 0x01
5703 #define _CM1CON1_CCH1 0x02
5704 #define _CM1CON1_CCH11 0x02
5705 #define _CM1CON1_CREF 0x04
5706 #define _CM1CON1_CREF1 0x04
5707 #define _CM1CON1_EVPOL0 0x08
5708 #define _CM1CON1_EVPOL01 0x08
5709 #define _CM1CON1_EVPOL1 0x10
5710 #define _CM1CON1_EVPOL11 0x10
5711 #define _CM1CON1_CPOL 0x20
5712 #define _CM1CON1_CPOL1 0x20
5713 #define _CM1CON1_COE 0x40
5714 #define _CM1CON1_COE1 0x40
5715 #define _CM1CON1_CON 0x80
5716 #define _CM1CON1_CON1 0x80
5718 //==============================================================================
5721 //==============================================================================
5722 // OSCCON Bits
5724 extern __at(0x0FD3) __sfr OSCCON;
5726 typedef union
5728 struct
5730 unsigned SCS0 : 1;
5731 unsigned SCS1 : 1;
5732 unsigned : 1;
5733 unsigned OSTS : 1;
5734 unsigned IRCF0 : 1;
5735 unsigned IRCF1 : 1;
5736 unsigned IRCF2 : 1;
5737 unsigned IDLEN : 1;
5740 struct
5742 unsigned SCS : 2;
5743 unsigned : 6;
5746 struct
5748 unsigned : 4;
5749 unsigned IRCF : 3;
5750 unsigned : 1;
5752 } __OSCCONbits_t;
5754 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5756 #define _SCS0 0x01
5757 #define _SCS1 0x02
5758 #define _OSTS 0x08
5759 #define _IRCF0 0x10
5760 #define _IRCF1 0x20
5761 #define _IRCF2 0x40
5762 #define _IDLEN 0x80
5764 //==============================================================================
5767 //==============================================================================
5768 // T0CON Bits
5770 extern __at(0x0FD5) __sfr T0CON;
5772 typedef union
5774 struct
5776 unsigned T0PS0 : 1;
5777 unsigned T0PS1 : 1;
5778 unsigned T0PS2 : 1;
5779 unsigned PSA : 1;
5780 unsigned T0SE : 1;
5781 unsigned T0CS : 1;
5782 unsigned T08BIT : 1;
5783 unsigned TMR0ON : 1;
5786 struct
5788 unsigned T0PS : 3;
5789 unsigned : 5;
5791 } __T0CONbits_t;
5793 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5795 #define _T0PS0 0x01
5796 #define _T0PS1 0x02
5797 #define _T0PS2 0x04
5798 #define _PSA 0x08
5799 #define _T0SE 0x10
5800 #define _T0CS 0x20
5801 #define _T08BIT 0x40
5802 #define _TMR0ON 0x80
5804 //==============================================================================
5806 extern __at(0x0FD6) __sfr TMR0;
5807 extern __at(0x0FD6) __sfr TMR0L;
5808 extern __at(0x0FD7) __sfr TMR0H;
5810 //==============================================================================
5811 // STATUS Bits
5813 extern __at(0x0FD8) __sfr STATUS;
5815 typedef struct
5817 unsigned C : 1;
5818 unsigned DC : 1;
5819 unsigned Z : 1;
5820 unsigned OV : 1;
5821 unsigned N : 1;
5822 unsigned : 1;
5823 unsigned : 1;
5824 unsigned : 1;
5825 } __STATUSbits_t;
5827 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5829 #define _C 0x01
5830 #define _DC 0x02
5831 #define _Z 0x04
5832 #define _OV 0x08
5833 #define _N 0x10
5835 //==============================================================================
5837 extern __at(0x0FD9) __sfr FSR2L;
5838 extern __at(0x0FDA) __sfr FSR2H;
5839 extern __at(0x0FDB) __sfr PLUSW2;
5840 extern __at(0x0FDC) __sfr PREINC2;
5841 extern __at(0x0FDD) __sfr POSTDEC2;
5842 extern __at(0x0FDE) __sfr POSTINC2;
5843 extern __at(0x0FDF) __sfr INDF2;
5844 extern __at(0x0FE0) __sfr BSR;
5845 extern __at(0x0FE1) __sfr FSR1L;
5846 extern __at(0x0FE2) __sfr FSR1H;
5847 extern __at(0x0FE3) __sfr PLUSW1;
5848 extern __at(0x0FE4) __sfr PREINC1;
5849 extern __at(0x0FE5) __sfr POSTDEC1;
5850 extern __at(0x0FE6) __sfr POSTINC1;
5851 extern __at(0x0FE7) __sfr INDF1;
5852 extern __at(0x0FE8) __sfr WREG;
5853 extern __at(0x0FE9) __sfr FSR0L;
5854 extern __at(0x0FEA) __sfr FSR0H;
5855 extern __at(0x0FEB) __sfr PLUSW0;
5856 extern __at(0x0FEC) __sfr PREINC0;
5857 extern __at(0x0FED) __sfr POSTDEC0;
5858 extern __at(0x0FEE) __sfr POSTINC0;
5859 extern __at(0x0FEF) __sfr INDF0;
5861 //==============================================================================
5862 // INTCON3 Bits
5864 extern __at(0x0FF0) __sfr INTCON3;
5866 typedef union
5868 struct
5870 unsigned INT1IF : 1;
5871 unsigned INT2IF : 1;
5872 unsigned INT3IF : 1;
5873 unsigned INT1IE : 1;
5874 unsigned INT2IE : 1;
5875 unsigned INT3IE : 1;
5876 unsigned INT1IP : 1;
5877 unsigned INT2IP : 1;
5880 struct
5882 unsigned INT1F : 1;
5883 unsigned INT2F : 1;
5884 unsigned INT3F : 1;
5885 unsigned INT1E : 1;
5886 unsigned INT2E : 1;
5887 unsigned INT3E : 1;
5888 unsigned INT1P : 1;
5889 unsigned INT2P : 1;
5891 } __INTCON3bits_t;
5893 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5895 #define _INT1IF 0x01
5896 #define _INT1F 0x01
5897 #define _INT2IF 0x02
5898 #define _INT2F 0x02
5899 #define _INT3IF 0x04
5900 #define _INT3F 0x04
5901 #define _INT1IE 0x08
5902 #define _INT1E 0x08
5903 #define _INT2IE 0x10
5904 #define _INT2E 0x10
5905 #define _INT3IE 0x20
5906 #define _INT3E 0x20
5907 #define _INT1IP 0x40
5908 #define _INT1P 0x40
5909 #define _INT2IP 0x80
5910 #define _INT2P 0x80
5912 //==============================================================================
5915 //==============================================================================
5916 // INTCON2 Bits
5918 extern __at(0x0FF1) __sfr INTCON2;
5920 typedef union
5922 struct
5924 unsigned RBIP : 1;
5925 unsigned INT3IP : 1;
5926 unsigned TMR0IP : 1;
5927 unsigned INTEDG3 : 1;
5928 unsigned INTEDG2 : 1;
5929 unsigned INTEDG1 : 1;
5930 unsigned INTEDG0 : 1;
5931 unsigned NOT_RBPU : 1;
5934 struct
5936 unsigned : 1;
5937 unsigned INT3P : 1;
5938 unsigned T0IP : 1;
5939 unsigned : 1;
5940 unsigned : 1;
5941 unsigned : 1;
5942 unsigned : 1;
5943 unsigned RBPU : 1;
5945 } __INTCON2bits_t;
5947 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5949 #define _RBIP 0x01
5950 #define _INT3IP 0x02
5951 #define _INT3P 0x02
5952 #define _TMR0IP 0x04
5953 #define _T0IP 0x04
5954 #define _INTEDG3 0x08
5955 #define _INTEDG2 0x10
5956 #define _INTEDG1 0x20
5957 #define _INTEDG0 0x40
5958 #define _NOT_RBPU 0x80
5959 #define _RBPU 0x80
5961 //==============================================================================
5964 //==============================================================================
5965 // INTCON Bits
5967 extern __at(0x0FF2) __sfr INTCON;
5969 typedef union
5971 struct
5973 unsigned RBIF : 1;
5974 unsigned INT0IF : 1;
5975 unsigned TMR0IF : 1;
5976 unsigned RBIE : 1;
5977 unsigned INT0IE : 1;
5978 unsigned TMR0IE : 1;
5979 unsigned PEIE_GIEL : 1;
5980 unsigned GIE_GIEH : 1;
5983 struct
5985 unsigned : 1;
5986 unsigned INT0F : 1;
5987 unsigned T0IF : 1;
5988 unsigned : 1;
5989 unsigned INT0E : 1;
5990 unsigned T0IE : 1;
5991 unsigned PEIE : 1;
5992 unsigned GIE : 1;
5995 struct
5997 unsigned : 1;
5998 unsigned : 1;
5999 unsigned : 1;
6000 unsigned : 1;
6001 unsigned : 1;
6002 unsigned : 1;
6003 unsigned GIEL : 1;
6004 unsigned GIEH : 1;
6006 } __INTCONbits_t;
6008 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
6010 #define _RBIF 0x01
6011 #define _INT0IF 0x02
6012 #define _INT0F 0x02
6013 #define _TMR0IF 0x04
6014 #define _T0IF 0x04
6015 #define _RBIE 0x08
6016 #define _INT0IE 0x10
6017 #define _INT0E 0x10
6018 #define _TMR0IE 0x20
6019 #define _T0IE 0x20
6020 #define _PEIE_GIEL 0x40
6021 #define _PEIE 0x40
6022 #define _GIEL 0x40
6023 #define _GIE_GIEH 0x80
6024 #define _GIE 0x80
6025 #define _GIEH 0x80
6027 //==============================================================================
6029 extern __at(0x0FF3) __sfr PROD;
6030 extern __at(0x0FF3) __sfr PRODL;
6031 extern __at(0x0FF4) __sfr PRODH;
6032 extern __at(0x0FF5) __sfr TABLAT;
6033 extern __at(0x0FF6) __sfr TBLPTR;
6034 extern __at(0x0FF6) __sfr TBLPTRL;
6035 extern __at(0x0FF7) __sfr TBLPTRH;
6036 extern __at(0x0FF8) __sfr TBLPTRU;
6037 extern __at(0x0FF9) __sfr PC;
6038 extern __at(0x0FF9) __sfr PCL;
6039 extern __at(0x0FFA) __sfr PCLATH;
6040 extern __at(0x0FFB) __sfr PCLATU;
6042 //==============================================================================
6043 // STKPTR Bits
6045 extern __at(0x0FFC) __sfr STKPTR;
6047 typedef union
6049 struct
6051 unsigned SP0 : 1;
6052 unsigned SP1 : 1;
6053 unsigned SP2 : 1;
6054 unsigned SP3 : 1;
6055 unsigned SP4 : 1;
6056 unsigned : 1;
6057 unsigned STKUNF : 1;
6058 unsigned STKFUL : 1;
6061 struct
6063 unsigned : 1;
6064 unsigned : 1;
6065 unsigned : 1;
6066 unsigned : 1;
6067 unsigned : 1;
6068 unsigned : 1;
6069 unsigned : 1;
6070 unsigned STKOVF : 1;
6073 struct
6075 unsigned SP : 5;
6076 unsigned : 3;
6078 } __STKPTRbits_t;
6080 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
6082 #define _SP0 0x01
6083 #define _SP1 0x02
6084 #define _SP2 0x04
6085 #define _SP3 0x08
6086 #define _SP4 0x10
6087 #define _STKUNF 0x40
6088 #define _STKFUL 0x80
6089 #define _STKOVF 0x80
6091 //==============================================================================
6093 extern __at(0x0FFD) __sfr TOS;
6094 extern __at(0x0FFD) __sfr TOSL;
6095 extern __at(0x0FFE) __sfr TOSH;
6096 extern __at(0x0FFF) __sfr TOSU;
6098 //==============================================================================
6100 // Configuration Addresses
6102 //==============================================================================
6104 #define __CONFIG1L 0x007FF8
6105 #define __CONFIG1H 0x007FF9
6106 #define __CONFIG2L 0x007FFA
6107 #define __CONFIG2H 0x007FFB
6108 #define __CONFIG3L 0x007FFC
6109 #define __CONFIG3H 0x007FFD
6110 #define __CONFIG4L 0x007FFE
6111 #define __CONFIG4H 0x007FFF
6113 //==============================================================================
6115 #endif // #ifndef __PIC18LF25J50_H__