struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f24k50.h
blob1638a23842f73237d322efaeccb85114a727cb58
1 /*
2 * This declarations of the PIC18F24K50 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:27 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 __PIC18F24K50_H__
26 #define __PIC18F24K50_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // SRCON1 Bits
40 extern __at(0x0F57) __sfr SRCON1;
42 typedef struct
44 unsigned SRRC1E : 1;
45 unsigned SRRC2E : 1;
46 unsigned SRRCKE : 1;
47 unsigned SRRPE : 1;
48 unsigned SRSC1E : 1;
49 unsigned SRSC2E : 1;
50 unsigned SRSCKE : 1;
51 unsigned SRSPE : 1;
52 } __SRCON1bits_t;
54 extern __at(0x0F57) volatile __SRCON1bits_t SRCON1bits;
56 #define _SRRC1E 0x01
57 #define _SRRC2E 0x02
58 #define _SRRCKE 0x04
59 #define _SRRPE 0x08
60 #define _SRSC1E 0x10
61 #define _SRSC2E 0x20
62 #define _SRSCKE 0x40
63 #define _SRSPE 0x80
65 //==============================================================================
68 //==============================================================================
69 // SRCON0 Bits
71 extern __at(0x0F58) __sfr SRCON0;
73 typedef union
75 struct
77 unsigned SRPR : 1;
78 unsigned SRPS : 1;
79 unsigned SRNQEN : 1;
80 unsigned SRQEN : 1;
81 unsigned SRCLK0 : 1;
82 unsigned SRCLK1 : 1;
83 unsigned SRCLK2 : 1;
84 unsigned SRLEN : 1;
87 struct
89 unsigned : 4;
90 unsigned SRCLK : 3;
91 unsigned : 1;
93 } __SRCON0bits_t;
95 extern __at(0x0F58) volatile __SRCON0bits_t SRCON0bits;
97 #define _SRPR 0x01
98 #define _SRPS 0x02
99 #define _SRNQEN 0x04
100 #define _SRQEN 0x08
101 #define _SRCLK0 0x10
102 #define _SRCLK1 0x20
103 #define _SRCLK2 0x40
104 #define _SRLEN 0x80
106 //==============================================================================
109 //==============================================================================
110 // CCPTMRS Bits
112 extern __at(0x0F59) __sfr CCPTMRS;
114 typedef struct
116 unsigned C1TSEL : 1;
117 unsigned : 1;
118 unsigned : 1;
119 unsigned C2TSEL : 1;
120 unsigned : 1;
121 unsigned : 1;
122 unsigned : 1;
123 unsigned : 1;
124 } __CCPTMRSbits_t;
126 extern __at(0x0F59) volatile __CCPTMRSbits_t CCPTMRSbits;
128 #define _C1TSEL 0x01
129 #define _C2TSEL 0x08
131 //==============================================================================
133 extern __at(0x0F5A) __sfr VREGCON;
135 //==============================================================================
136 // ANSELA Bits
138 extern __at(0x0F5B) __sfr ANSELA;
140 typedef struct
142 unsigned ANSA0 : 1;
143 unsigned ANSA1 : 1;
144 unsigned ANSA2 : 1;
145 unsigned ANSA3 : 1;
146 unsigned : 1;
147 unsigned ANSA5 : 1;
148 unsigned : 1;
149 unsigned : 1;
150 } __ANSELAbits_t;
152 extern __at(0x0F5B) volatile __ANSELAbits_t ANSELAbits;
154 #define _ANSA0 0x01
155 #define _ANSA1 0x02
156 #define _ANSA2 0x04
157 #define _ANSA3 0x08
158 #define _ANSA5 0x20
160 //==============================================================================
163 //==============================================================================
164 // ANSELB Bits
166 extern __at(0x0F5C) __sfr ANSELB;
168 typedef union
170 struct
172 unsigned ANSB0 : 1;
173 unsigned ANSB1 : 1;
174 unsigned ANSB2 : 1;
175 unsigned ANSB3 : 1;
176 unsigned ANSB4 : 1;
177 unsigned ANSB5 : 1;
178 unsigned : 1;
179 unsigned : 1;
182 struct
184 unsigned ANSB : 6;
185 unsigned : 2;
187 } __ANSELBbits_t;
189 extern __at(0x0F5C) volatile __ANSELBbits_t ANSELBbits;
191 #define _ANSB0 0x01
192 #define _ANSB1 0x02
193 #define _ANSB2 0x04
194 #define _ANSB3 0x08
195 #define _ANSB4 0x10
196 #define _ANSB5 0x20
198 //==============================================================================
201 //==============================================================================
202 // ANSELC Bits
204 extern __at(0x0F5D) __sfr ANSELC;
206 typedef struct
208 unsigned : 1;
209 unsigned : 1;
210 unsigned ANSC2 : 1;
211 unsigned : 1;
212 unsigned : 1;
213 unsigned : 1;
214 unsigned ANSC6 : 1;
215 unsigned ANSC7 : 1;
216 } __ANSELCbits_t;
218 extern __at(0x0F5D) volatile __ANSELCbits_t ANSELCbits;
220 #define _ANSC2 0x04
221 #define _ANSC6 0x40
222 #define _ANSC7 0x80
224 //==============================================================================
227 //==============================================================================
228 // UCON Bits
230 extern __at(0x0F60) __sfr UCON;
232 typedef struct
234 unsigned : 1;
235 unsigned SUSPND : 1;
236 unsigned RESUME : 1;
237 unsigned USBEN : 1;
238 unsigned PKTDIS : 1;
239 unsigned SE0 : 1;
240 unsigned PPBRST : 1;
241 unsigned : 1;
242 } __UCONbits_t;
244 extern __at(0x0F60) volatile __UCONbits_t UCONbits;
246 #define _SUSPND 0x02
247 #define _RESUME 0x04
248 #define _USBEN 0x08
249 #define _PKTDIS 0x10
250 #define _SE0 0x20
251 #define _PPBRST 0x40
253 //==============================================================================
256 //==============================================================================
257 // USTAT Bits
259 extern __at(0x0F61) __sfr USTAT;
261 typedef union
263 struct
265 unsigned : 1;
266 unsigned PPBI : 1;
267 unsigned DIR : 1;
268 unsigned ENDP0 : 1;
269 unsigned ENDP1 : 1;
270 unsigned ENDP2 : 1;
271 unsigned ENDP3 : 1;
272 unsigned : 1;
275 struct
277 unsigned : 3;
278 unsigned ENDP : 4;
279 unsigned : 1;
281 } __USTATbits_t;
283 extern __at(0x0F61) volatile __USTATbits_t USTATbits;
285 #define _PPBI 0x02
286 #define _DIR 0x04
287 #define _ENDP0 0x08
288 #define _ENDP1 0x10
289 #define _ENDP2 0x20
290 #define _ENDP3 0x40
292 //==============================================================================
295 //==============================================================================
296 // UCFG Bits
298 extern __at(0x0F62) __sfr UCFG;
300 typedef union
302 struct
304 unsigned PPB0 : 1;
305 unsigned PPB1 : 1;
306 unsigned FSEN : 1;
307 unsigned UTRDIS : 1;
308 unsigned UPUEN : 1;
309 unsigned : 1;
310 unsigned UOEMON : 1;
311 unsigned UTEYE : 1;
314 struct
316 unsigned PPB : 2;
317 unsigned : 6;
319 } __UCFGbits_t;
321 extern __at(0x0F62) volatile __UCFGbits_t UCFGbits;
323 #define _PPB0 0x01
324 #define _PPB1 0x02
325 #define _FSEN 0x04
326 #define _UTRDIS 0x08
327 #define _UPUEN 0x10
328 #define _UOEMON 0x40
329 #define _UTEYE 0x80
331 //==============================================================================
334 //==============================================================================
335 // UADDR Bits
337 extern __at(0x0F63) __sfr UADDR;
339 typedef union
341 struct
343 unsigned ADDR0 : 1;
344 unsigned ADDR1 : 1;
345 unsigned ADDR2 : 1;
346 unsigned ADDR3 : 1;
347 unsigned ADDR4 : 1;
348 unsigned ADDR5 : 1;
349 unsigned ADDR6 : 1;
350 unsigned : 1;
353 struct
355 unsigned ADDR : 7;
356 unsigned : 1;
358 } __UADDRbits_t;
360 extern __at(0x0F63) volatile __UADDRbits_t UADDRbits;
362 #define _ADDR0 0x01
363 #define _ADDR1 0x02
364 #define _ADDR2 0x04
365 #define _ADDR3 0x08
366 #define _ADDR4 0x10
367 #define _ADDR5 0x20
368 #define _ADDR6 0x40
370 //==============================================================================
373 //==============================================================================
374 // UIE Bits
376 extern __at(0x0F64) __sfr UIE;
378 typedef struct
380 unsigned URSTIE : 1;
381 unsigned UERRIE : 1;
382 unsigned ACTVIE : 1;
383 unsigned TRNIE : 1;
384 unsigned IDLEIE : 1;
385 unsigned STALLIE : 1;
386 unsigned SOFIE : 1;
387 unsigned : 1;
388 } __UIEbits_t;
390 extern __at(0x0F64) volatile __UIEbits_t UIEbits;
392 #define _URSTIE 0x01
393 #define _UERRIE 0x02
394 #define _ACTVIE 0x04
395 #define _TRNIE 0x08
396 #define _IDLEIE 0x10
397 #define _STALLIE 0x20
398 #define _SOFIE 0x40
400 //==============================================================================
403 //==============================================================================
404 // UIR Bits
406 extern __at(0x0F65) __sfr UIR;
408 typedef struct
410 unsigned URSTIF : 1;
411 unsigned UERRIF : 1;
412 unsigned ACTVIF : 1;
413 unsigned TRNIF : 1;
414 unsigned IDLEIF : 1;
415 unsigned STALLIF : 1;
416 unsigned SOFIF : 1;
417 unsigned : 1;
418 } __UIRbits_t;
420 extern __at(0x0F65) volatile __UIRbits_t UIRbits;
422 #define _URSTIF 0x01
423 #define _UERRIF 0x02
424 #define _ACTVIF 0x04
425 #define _TRNIF 0x08
426 #define _IDLEIF 0x10
427 #define _STALLIF 0x20
428 #define _SOFIF 0x40
430 //==============================================================================
433 //==============================================================================
434 // UEIE Bits
436 extern __at(0x0F66) __sfr UEIE;
438 typedef struct
440 unsigned PIDEE : 1;
441 unsigned CRC5EE : 1;
442 unsigned CRC16EE : 1;
443 unsigned DFN8EE : 1;
444 unsigned BTOEE : 1;
445 unsigned : 1;
446 unsigned : 1;
447 unsigned BTSEE : 1;
448 } __UEIEbits_t;
450 extern __at(0x0F66) volatile __UEIEbits_t UEIEbits;
452 #define _PIDEE 0x01
453 #define _CRC5EE 0x02
454 #define _CRC16EE 0x04
455 #define _DFN8EE 0x08
456 #define _BTOEE 0x10
457 #define _BTSEE 0x80
459 //==============================================================================
462 //==============================================================================
463 // UEIR Bits
465 extern __at(0x0F67) __sfr UEIR;
467 typedef struct
469 unsigned PIDEF : 1;
470 unsigned CRC5EF : 1;
471 unsigned CRC16EF : 1;
472 unsigned DFN8EF : 1;
473 unsigned BTOEF : 1;
474 unsigned : 1;
475 unsigned : 1;
476 unsigned BTSEF : 1;
477 } __UEIRbits_t;
479 extern __at(0x0F67) volatile __UEIRbits_t UEIRbits;
481 #define _PIDEF 0x01
482 #define _CRC5EF 0x02
483 #define _CRC16EF 0x04
484 #define _DFN8EF 0x08
485 #define _BTOEF 0x10
486 #define _BTSEF 0x80
488 //==============================================================================
490 extern __at(0x0F68) __sfr UFRM;
492 //==============================================================================
493 // UFRML Bits
495 extern __at(0x0F68) __sfr UFRML;
497 typedef struct
499 unsigned FRM0 : 1;
500 unsigned FRM1 : 1;
501 unsigned FRM2 : 1;
502 unsigned FRM3 : 1;
503 unsigned FRM4 : 1;
504 unsigned FRM5 : 1;
505 unsigned FRM6 : 1;
506 unsigned FRM7 : 1;
507 } __UFRMLbits_t;
509 extern __at(0x0F68) volatile __UFRMLbits_t UFRMLbits;
511 #define _FRM0 0x01
512 #define _FRM1 0x02
513 #define _FRM2 0x04
514 #define _FRM3 0x08
515 #define _FRM4 0x10
516 #define _FRM5 0x20
517 #define _FRM6 0x40
518 #define _FRM7 0x80
520 //==============================================================================
523 //==============================================================================
524 // UFRMH Bits
526 extern __at(0x0F69) __sfr UFRMH;
528 typedef struct
530 unsigned FRM8 : 1;
531 unsigned FRM9 : 1;
532 unsigned FRM10 : 1;
533 unsigned : 1;
534 unsigned : 1;
535 unsigned : 1;
536 unsigned : 1;
537 unsigned : 1;
538 } __UFRMHbits_t;
540 extern __at(0x0F69) volatile __UFRMHbits_t UFRMHbits;
542 #define _FRM8 0x01
543 #define _FRM9 0x02
544 #define _FRM10 0x04
546 //==============================================================================
549 //==============================================================================
550 // UEP0 Bits
552 extern __at(0x0F6A) __sfr UEP0;
554 typedef struct
556 unsigned EPSTALL : 1;
557 unsigned EPINEN : 1;
558 unsigned EPOUTEN : 1;
559 unsigned EPCONDIS : 1;
560 unsigned EPHSHK : 1;
561 unsigned : 1;
562 unsigned : 1;
563 unsigned : 1;
564 } __UEP0bits_t;
566 extern __at(0x0F6A) volatile __UEP0bits_t UEP0bits;
568 #define _EPSTALL 0x01
569 #define _EPINEN 0x02
570 #define _EPOUTEN 0x04
571 #define _EPCONDIS 0x08
572 #define _EPHSHK 0x10
574 //==============================================================================
577 //==============================================================================
578 // UEP1 Bits
580 extern __at(0x0F6B) __sfr UEP1;
582 typedef struct
584 unsigned EPSTALL : 1;
585 unsigned EPINEN : 1;
586 unsigned EPOUTEN : 1;
587 unsigned EPCONDIS : 1;
588 unsigned EPHSHK : 1;
589 unsigned : 1;
590 unsigned : 1;
591 unsigned : 1;
592 } __UEP1bits_t;
594 extern __at(0x0F6B) volatile __UEP1bits_t UEP1bits;
596 #define _UEP1_EPSTALL 0x01
597 #define _UEP1_EPINEN 0x02
598 #define _UEP1_EPOUTEN 0x04
599 #define _UEP1_EPCONDIS 0x08
600 #define _UEP1_EPHSHK 0x10
602 //==============================================================================
605 //==============================================================================
606 // UEP2 Bits
608 extern __at(0x0F6C) __sfr UEP2;
610 typedef struct
612 unsigned EPSTALL : 1;
613 unsigned EPINEN : 1;
614 unsigned EPOUTEN : 1;
615 unsigned EPCONDIS : 1;
616 unsigned EPHSHK : 1;
617 unsigned : 1;
618 unsigned : 1;
619 unsigned : 1;
620 } __UEP2bits_t;
622 extern __at(0x0F6C) volatile __UEP2bits_t UEP2bits;
624 #define _UEP2_EPSTALL 0x01
625 #define _UEP2_EPINEN 0x02
626 #define _UEP2_EPOUTEN 0x04
627 #define _UEP2_EPCONDIS 0x08
628 #define _UEP2_EPHSHK 0x10
630 //==============================================================================
633 //==============================================================================
634 // UEP3 Bits
636 extern __at(0x0F6D) __sfr UEP3;
638 typedef struct
640 unsigned EPSTALL : 1;
641 unsigned EPINEN : 1;
642 unsigned EPOUTEN : 1;
643 unsigned EPCONDIS : 1;
644 unsigned EPHSHK : 1;
645 unsigned : 1;
646 unsigned : 1;
647 unsigned : 1;
648 } __UEP3bits_t;
650 extern __at(0x0F6D) volatile __UEP3bits_t UEP3bits;
652 #define _UEP3_EPSTALL 0x01
653 #define _UEP3_EPINEN 0x02
654 #define _UEP3_EPOUTEN 0x04
655 #define _UEP3_EPCONDIS 0x08
656 #define _UEP3_EPHSHK 0x10
658 //==============================================================================
661 //==============================================================================
662 // UEP4 Bits
664 extern __at(0x0F6E) __sfr UEP4;
666 typedef struct
668 unsigned EPSTALL : 1;
669 unsigned EPINEN : 1;
670 unsigned EPOUTEN : 1;
671 unsigned EPCONDIS : 1;
672 unsigned EPHSHK : 1;
673 unsigned : 1;
674 unsigned : 1;
675 unsigned : 1;
676 } __UEP4bits_t;
678 extern __at(0x0F6E) volatile __UEP4bits_t UEP4bits;
680 #define _UEP4_EPSTALL 0x01
681 #define _UEP4_EPINEN 0x02
682 #define _UEP4_EPOUTEN 0x04
683 #define _UEP4_EPCONDIS 0x08
684 #define _UEP4_EPHSHK 0x10
686 //==============================================================================
689 //==============================================================================
690 // UEP5 Bits
692 extern __at(0x0F6F) __sfr UEP5;
694 typedef struct
696 unsigned EPSTALL : 1;
697 unsigned EPINEN : 1;
698 unsigned EPOUTEN : 1;
699 unsigned EPCONDIS : 1;
700 unsigned EPHSHK : 1;
701 unsigned : 1;
702 unsigned : 1;
703 unsigned : 1;
704 } __UEP5bits_t;
706 extern __at(0x0F6F) volatile __UEP5bits_t UEP5bits;
708 #define _UEP5_EPSTALL 0x01
709 #define _UEP5_EPINEN 0x02
710 #define _UEP5_EPOUTEN 0x04
711 #define _UEP5_EPCONDIS 0x08
712 #define _UEP5_EPHSHK 0x10
714 //==============================================================================
717 //==============================================================================
718 // UEP6 Bits
720 extern __at(0x0F70) __sfr UEP6;
722 typedef struct
724 unsigned EPSTALL : 1;
725 unsigned EPINEN : 1;
726 unsigned EPOUTEN : 1;
727 unsigned EPCONDIS : 1;
728 unsigned EPHSHK : 1;
729 unsigned : 1;
730 unsigned : 1;
731 unsigned : 1;
732 } __UEP6bits_t;
734 extern __at(0x0F70) volatile __UEP6bits_t UEP6bits;
736 #define _UEP6_EPSTALL 0x01
737 #define _UEP6_EPINEN 0x02
738 #define _UEP6_EPOUTEN 0x04
739 #define _UEP6_EPCONDIS 0x08
740 #define _UEP6_EPHSHK 0x10
742 //==============================================================================
745 //==============================================================================
746 // UEP7 Bits
748 extern __at(0x0F71) __sfr UEP7;
750 typedef struct
752 unsigned EPSTALL : 1;
753 unsigned EPINEN : 1;
754 unsigned EPOUTEN : 1;
755 unsigned EPCONDIS : 1;
756 unsigned EPHSHK : 1;
757 unsigned : 1;
758 unsigned : 1;
759 unsigned : 1;
760 } __UEP7bits_t;
762 extern __at(0x0F71) volatile __UEP7bits_t UEP7bits;
764 #define _UEP7_EPSTALL 0x01
765 #define _UEP7_EPINEN 0x02
766 #define _UEP7_EPOUTEN 0x04
767 #define _UEP7_EPCONDIS 0x08
768 #define _UEP7_EPHSHK 0x10
770 //==============================================================================
773 //==============================================================================
774 // UEP8 Bits
776 extern __at(0x0F72) __sfr UEP8;
778 typedef struct
780 unsigned EPSTALL : 1;
781 unsigned EPINEN : 1;
782 unsigned EPOUTEN : 1;
783 unsigned EPCONDIS : 1;
784 unsigned EPHSHK : 1;
785 unsigned : 1;
786 unsigned : 1;
787 unsigned : 1;
788 } __UEP8bits_t;
790 extern __at(0x0F72) volatile __UEP8bits_t UEP8bits;
792 #define _UEP8_EPSTALL 0x01
793 #define _UEP8_EPINEN 0x02
794 #define _UEP8_EPOUTEN 0x04
795 #define _UEP8_EPCONDIS 0x08
796 #define _UEP8_EPHSHK 0x10
798 //==============================================================================
801 //==============================================================================
802 // UEP9 Bits
804 extern __at(0x0F73) __sfr UEP9;
806 typedef struct
808 unsigned EPSTALL : 1;
809 unsigned EPINEN : 1;
810 unsigned EPOUTEN : 1;
811 unsigned EPCONDIS : 1;
812 unsigned EPHSHK : 1;
813 unsigned : 1;
814 unsigned : 1;
815 unsigned : 1;
816 } __UEP9bits_t;
818 extern __at(0x0F73) volatile __UEP9bits_t UEP9bits;
820 #define _UEP9_EPSTALL 0x01
821 #define _UEP9_EPINEN 0x02
822 #define _UEP9_EPOUTEN 0x04
823 #define _UEP9_EPCONDIS 0x08
824 #define _UEP9_EPHSHK 0x10
826 //==============================================================================
829 //==============================================================================
830 // UEP10 Bits
832 extern __at(0x0F74) __sfr UEP10;
834 typedef struct
836 unsigned EPSTALL : 1;
837 unsigned EPINEN : 1;
838 unsigned EPOUTEN : 1;
839 unsigned EPCONDIS : 1;
840 unsigned EPHSHK : 1;
841 unsigned : 1;
842 unsigned : 1;
843 unsigned : 1;
844 } __UEP10bits_t;
846 extern __at(0x0F74) volatile __UEP10bits_t UEP10bits;
848 #define _UEP10_EPSTALL 0x01
849 #define _UEP10_EPINEN 0x02
850 #define _UEP10_EPOUTEN 0x04
851 #define _UEP10_EPCONDIS 0x08
852 #define _UEP10_EPHSHK 0x10
854 //==============================================================================
857 //==============================================================================
858 // UEP11 Bits
860 extern __at(0x0F75) __sfr UEP11;
862 typedef struct
864 unsigned EPSTALL : 1;
865 unsigned EPINEN : 1;
866 unsigned EPOUTEN : 1;
867 unsigned EPCONDIS : 1;
868 unsigned EPHSHK : 1;
869 unsigned : 1;
870 unsigned : 1;
871 unsigned : 1;
872 } __UEP11bits_t;
874 extern __at(0x0F75) volatile __UEP11bits_t UEP11bits;
876 #define _UEP11_EPSTALL 0x01
877 #define _UEP11_EPINEN 0x02
878 #define _UEP11_EPOUTEN 0x04
879 #define _UEP11_EPCONDIS 0x08
880 #define _UEP11_EPHSHK 0x10
882 //==============================================================================
885 //==============================================================================
886 // UEP12 Bits
888 extern __at(0x0F76) __sfr UEP12;
890 typedef struct
892 unsigned EPSTALL : 1;
893 unsigned EPINEN : 1;
894 unsigned EPOUTEN : 1;
895 unsigned EPCONDIS : 1;
896 unsigned EPHSHK : 1;
897 unsigned : 1;
898 unsigned : 1;
899 unsigned : 1;
900 } __UEP12bits_t;
902 extern __at(0x0F76) volatile __UEP12bits_t UEP12bits;
904 #define _UEP12_EPSTALL 0x01
905 #define _UEP12_EPINEN 0x02
906 #define _UEP12_EPOUTEN 0x04
907 #define _UEP12_EPCONDIS 0x08
908 #define _UEP12_EPHSHK 0x10
910 //==============================================================================
913 //==============================================================================
914 // UEP13 Bits
916 extern __at(0x0F77) __sfr UEP13;
918 typedef struct
920 unsigned EPSTALL : 1;
921 unsigned EPINEN : 1;
922 unsigned EPOUTEN : 1;
923 unsigned EPCONDIS : 1;
924 unsigned EPHSHK : 1;
925 unsigned : 1;
926 unsigned : 1;
927 unsigned : 1;
928 } __UEP13bits_t;
930 extern __at(0x0F77) volatile __UEP13bits_t UEP13bits;
932 #define _UEP13_EPSTALL 0x01
933 #define _UEP13_EPINEN 0x02
934 #define _UEP13_EPOUTEN 0x04
935 #define _UEP13_EPCONDIS 0x08
936 #define _UEP13_EPHSHK 0x10
938 //==============================================================================
941 //==============================================================================
942 // UEP14 Bits
944 extern __at(0x0F78) __sfr UEP14;
946 typedef struct
948 unsigned EPSTALL : 1;
949 unsigned EPINEN : 1;
950 unsigned EPOUTEN : 1;
951 unsigned EPCONDIS : 1;
952 unsigned EPHSHK : 1;
953 unsigned : 1;
954 unsigned : 1;
955 unsigned : 1;
956 } __UEP14bits_t;
958 extern __at(0x0F78) volatile __UEP14bits_t UEP14bits;
960 #define _UEP14_EPSTALL 0x01
961 #define _UEP14_EPINEN 0x02
962 #define _UEP14_EPOUTEN 0x04
963 #define _UEP14_EPCONDIS 0x08
964 #define _UEP14_EPHSHK 0x10
966 //==============================================================================
969 //==============================================================================
970 // UEP15 Bits
972 extern __at(0x0F79) __sfr UEP15;
974 typedef struct
976 unsigned EPSTALL : 1;
977 unsigned EPINEN : 1;
978 unsigned EPOUTEN : 1;
979 unsigned EPCONDIS : 1;
980 unsigned EPHSHK : 1;
981 unsigned : 1;
982 unsigned : 1;
983 unsigned : 1;
984 } __UEP15bits_t;
986 extern __at(0x0F79) volatile __UEP15bits_t UEP15bits;
988 #define _UEP15_EPSTALL 0x01
989 #define _UEP15_EPINEN 0x02
990 #define _UEP15_EPOUTEN 0x04
991 #define _UEP15_EPCONDIS 0x08
992 #define _UEP15_EPHSHK 0x10
994 //==============================================================================
997 //==============================================================================
998 // SLRCON Bits
1000 extern __at(0x0F7A) __sfr SLRCON;
1002 typedef struct
1004 unsigned SLRA : 1;
1005 unsigned SLRB : 1;
1006 unsigned SLRC : 1;
1007 unsigned : 1;
1008 unsigned : 1;
1009 unsigned : 1;
1010 unsigned : 1;
1011 unsigned : 1;
1012 } __SLRCONbits_t;
1014 extern __at(0x0F7A) volatile __SLRCONbits_t SLRCONbits;
1016 #define _SLRA 0x01
1017 #define _SLRB 0x02
1018 #define _SLRC 0x04
1020 //==============================================================================
1023 //==============================================================================
1024 // VREFCON2 Bits
1026 extern __at(0x0F7B) __sfr VREFCON2;
1028 typedef union
1030 struct
1032 unsigned DACR0 : 1;
1033 unsigned DACR1 : 1;
1034 unsigned DACR2 : 1;
1035 unsigned DACR3 : 1;
1036 unsigned DACR4 : 1;
1037 unsigned : 1;
1038 unsigned : 1;
1039 unsigned : 1;
1042 struct
1044 unsigned DACR : 5;
1045 unsigned : 3;
1047 } __VREFCON2bits_t;
1049 extern __at(0x0F7B) volatile __VREFCON2bits_t VREFCON2bits;
1051 #define _DACR0 0x01
1052 #define _DACR1 0x02
1053 #define _DACR2 0x04
1054 #define _DACR3 0x08
1055 #define _DACR4 0x10
1057 //==============================================================================
1060 //==============================================================================
1061 // VREFCON1 Bits
1063 extern __at(0x0F7C) __sfr VREFCON1;
1065 typedef union
1067 struct
1069 unsigned DACNSS : 1;
1070 unsigned : 1;
1071 unsigned DACPSS0 : 1;
1072 unsigned DACPSS1 : 1;
1073 unsigned : 1;
1074 unsigned DACOE : 1;
1075 unsigned DACLPS : 1;
1076 unsigned DACEN : 1;
1079 struct
1081 unsigned : 2;
1082 unsigned DACPSS : 2;
1083 unsigned : 4;
1085 } __VREFCON1bits_t;
1087 extern __at(0x0F7C) volatile __VREFCON1bits_t VREFCON1bits;
1089 #define _DACNSS 0x01
1090 #define _DACPSS0 0x04
1091 #define _DACPSS1 0x08
1092 #define _DACOE 0x20
1093 #define _DACLPS 0x40
1094 #define _DACEN 0x80
1096 //==============================================================================
1099 //==============================================================================
1100 // VREFCON0 Bits
1102 extern __at(0x0F7D) __sfr VREFCON0;
1104 typedef union
1106 struct
1108 unsigned : 1;
1109 unsigned : 1;
1110 unsigned TSRNG : 1;
1111 unsigned TSEN : 1;
1112 unsigned FVRS0 : 1;
1113 unsigned FVRS1 : 1;
1114 unsigned FVRST : 1;
1115 unsigned FVREN : 1;
1118 struct
1120 unsigned : 4;
1121 unsigned FVRS : 2;
1122 unsigned : 2;
1124 } __VREFCON0bits_t;
1126 extern __at(0x0F7D) volatile __VREFCON0bits_t VREFCON0bits;
1128 #define _TSRNG 0x04
1129 #define _TSEN 0x08
1130 #define _FVRS0 0x10
1131 #define _FVRS1 0x20
1132 #define _FVRST 0x40
1133 #define _FVREN 0x80
1135 //==============================================================================
1138 //==============================================================================
1139 // PMD0 Bits
1141 extern __at(0x0F7E) __sfr PMD0;
1143 typedef union
1145 struct
1147 unsigned TMR1MD : 1;
1148 unsigned TMR2MD : 1;
1149 unsigned TMR3MD : 1;
1150 unsigned : 1;
1151 unsigned ACTMD : 1;
1152 unsigned USBMD : 1;
1153 unsigned UARTMD : 1;
1154 unsigned : 1;
1157 struct
1159 unsigned : 1;
1160 unsigned : 1;
1161 unsigned : 1;
1162 unsigned : 1;
1163 unsigned STMD : 1;
1164 unsigned : 1;
1165 unsigned UART1MD : 1;
1166 unsigned : 1;
1168 } __PMD0bits_t;
1170 extern __at(0x0F7E) volatile __PMD0bits_t PMD0bits;
1172 #define _TMR1MD 0x01
1173 #define _TMR2MD 0x02
1174 #define _TMR3MD 0x04
1175 #define _ACTMD 0x10
1176 #define _STMD 0x10
1177 #define _USBMD 0x20
1178 #define _UARTMD 0x40
1179 #define _UART1MD 0x40
1181 //==============================================================================
1184 //==============================================================================
1185 // PMD1 Bits
1187 extern __at(0x0F7F) __sfr PMD1;
1189 typedef union
1191 struct
1193 unsigned CCP1MD : 1;
1194 unsigned CCP2MD : 1;
1195 unsigned ADCMD : 1;
1196 unsigned CMP1MD : 1;
1197 unsigned CMP2MD : 1;
1198 unsigned CTMUMD : 1;
1199 unsigned MSSPMD : 1;
1200 unsigned : 1;
1203 struct
1205 unsigned : 1;
1206 unsigned : 1;
1207 unsigned : 1;
1208 unsigned : 1;
1209 unsigned : 1;
1210 unsigned : 1;
1211 unsigned SSP1MD : 1;
1212 unsigned : 1;
1215 struct
1217 unsigned : 1;
1218 unsigned : 1;
1219 unsigned : 1;
1220 unsigned : 1;
1221 unsigned : 1;
1222 unsigned : 1;
1223 unsigned MSSP1MD : 1;
1224 unsigned : 1;
1226 } __PMD1bits_t;
1228 extern __at(0x0F7F) volatile __PMD1bits_t PMD1bits;
1230 #define _CCP1MD 0x01
1231 #define _CCP2MD 0x02
1232 #define _ADCMD 0x04
1233 #define _CMP1MD 0x08
1234 #define _CMP2MD 0x10
1235 #define _CTMUMD 0x20
1236 #define _MSSPMD 0x40
1237 #define _SSP1MD 0x40
1238 #define _MSSP1MD 0x40
1240 //==============================================================================
1243 //==============================================================================
1244 // PORTA Bits
1246 extern __at(0x0F80) __sfr PORTA;
1248 typedef union
1250 struct
1252 unsigned RA0 : 1;
1253 unsigned RA1 : 1;
1254 unsigned RA2 : 1;
1255 unsigned RA3 : 1;
1256 unsigned RA4 : 1;
1257 unsigned RA5 : 1;
1258 unsigned RA6 : 1;
1259 unsigned RA7 : 1;
1262 struct
1264 unsigned AN0 : 1;
1265 unsigned AN1 : 1;
1266 unsigned AN2 : 1;
1267 unsigned AN3 : 1;
1268 unsigned T0CKI : 1;
1269 unsigned AN4 : 1;
1270 unsigned OSC2 : 1;
1271 unsigned : 1;
1274 struct
1276 unsigned : 1;
1277 unsigned : 1;
1278 unsigned VREFM : 1;
1279 unsigned VREFP : 1;
1280 unsigned : 1;
1281 unsigned LVDIN : 1;
1282 unsigned : 1;
1283 unsigned : 1;
1286 struct
1288 unsigned : 1;
1289 unsigned : 1;
1290 unsigned : 1;
1291 unsigned : 1;
1292 unsigned : 1;
1293 unsigned HLVDIN : 1;
1294 unsigned : 1;
1295 unsigned : 1;
1297 } __PORTAbits_t;
1299 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1301 #define _PORTA_RA0 0x01
1302 #define _PORTA_AN0 0x01
1303 #define _PORTA_RA1 0x02
1304 #define _PORTA_AN1 0x02
1305 #define _PORTA_RA2 0x04
1306 #define _PORTA_AN2 0x04
1307 #define _PORTA_VREFM 0x04
1308 #define _PORTA_RA3 0x08
1309 #define _PORTA_AN3 0x08
1310 #define _PORTA_VREFP 0x08
1311 #define _PORTA_RA4 0x10
1312 #define _PORTA_T0CKI 0x10
1313 #define _PORTA_RA5 0x20
1314 #define _PORTA_AN4 0x20
1315 #define _PORTA_LVDIN 0x20
1316 #define _PORTA_HLVDIN 0x20
1317 #define _PORTA_RA6 0x40
1318 #define _PORTA_OSC2 0x40
1319 #define _PORTA_RA7 0x80
1321 //==============================================================================
1324 //==============================================================================
1325 // PORTB Bits
1327 extern __at(0x0F81) __sfr PORTB;
1329 typedef union
1331 struct
1333 unsigned RB0 : 1;
1334 unsigned RB1 : 1;
1335 unsigned RB2 : 1;
1336 unsigned RB3 : 1;
1337 unsigned RB4 : 1;
1338 unsigned RB5 : 1;
1339 unsigned RB6 : 1;
1340 unsigned RB7 : 1;
1343 struct
1345 unsigned INT0 : 1;
1346 unsigned INT1 : 1;
1347 unsigned INT2 : 1;
1348 unsigned : 1;
1349 unsigned : 1;
1350 unsigned PGM : 1;
1351 unsigned PGC : 1;
1352 unsigned PGD : 1;
1355 struct
1357 unsigned INT : 3;
1358 unsigned : 5;
1360 } __PORTBbits_t;
1362 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1364 #define _PORTB_RB0 0x01
1365 #define _PORTB_INT0 0x01
1366 #define _PORTB_RB1 0x02
1367 #define _PORTB_INT1 0x02
1368 #define _PORTB_RB2 0x04
1369 #define _PORTB_INT2 0x04
1370 #define _PORTB_RB3 0x08
1371 #define _PORTB_RB4 0x10
1372 #define _PORTB_RB5 0x20
1373 #define _PORTB_PGM 0x20
1374 #define _PORTB_RB6 0x40
1375 #define _PORTB_PGC 0x40
1376 #define _PORTB_RB7 0x80
1377 #define _PORTB_PGD 0x80
1379 //==============================================================================
1382 //==============================================================================
1383 // PORTC Bits
1385 extern __at(0x0F82) __sfr PORTC;
1387 typedef union
1389 struct
1391 unsigned RC0 : 1;
1392 unsigned RC1 : 1;
1393 unsigned RC2 : 1;
1394 unsigned : 1;
1395 unsigned RC4 : 1;
1396 unsigned RC5 : 1;
1397 unsigned RC6 : 1;
1398 unsigned RC7 : 1;
1401 struct
1403 unsigned T1OSO : 1;
1404 unsigned T1OSI : 1;
1405 unsigned CCP1 : 1;
1406 unsigned : 1;
1407 unsigned : 1;
1408 unsigned : 1;
1409 unsigned TX : 1;
1410 unsigned RX : 1;
1413 struct
1415 unsigned T13CKI : 1;
1416 unsigned : 1;
1417 unsigned P1A : 1;
1418 unsigned : 1;
1419 unsigned : 1;
1420 unsigned : 1;
1421 unsigned CK : 1;
1422 unsigned : 1;
1424 } __PORTCbits_t;
1426 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1428 #define _PORTC_RC0 0x01
1429 #define _PORTC_T1OSO 0x01
1430 #define _PORTC_T13CKI 0x01
1431 #define _PORTC_RC1 0x02
1432 #define _PORTC_T1OSI 0x02
1433 #define _PORTC_RC2 0x04
1434 #define _PORTC_CCP1 0x04
1435 #define _PORTC_P1A 0x04
1436 #define _PORTC_RC4 0x10
1437 #define _PORTC_RC5 0x20
1438 #define _PORTC_RC6 0x40
1439 #define _PORTC_TX 0x40
1440 #define _PORTC_CK 0x40
1441 #define _PORTC_RC7 0x80
1442 #define _PORTC_RX 0x80
1444 //==============================================================================
1447 //==============================================================================
1448 // PORTE Bits
1450 extern __at(0x0F84) __sfr PORTE;
1452 typedef struct
1454 unsigned : 1;
1455 unsigned : 1;
1456 unsigned : 1;
1457 unsigned RE3 : 1;
1458 unsigned : 1;
1459 unsigned : 1;
1460 unsigned : 1;
1461 unsigned : 1;
1462 } __PORTEbits_t;
1464 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1466 #define _RE3 0x08
1468 //==============================================================================
1471 //==============================================================================
1472 // WPUB Bits
1474 extern __at(0x0F85) __sfr WPUB;
1476 typedef struct
1478 unsigned WPUB0 : 1;
1479 unsigned WPUB1 : 1;
1480 unsigned WPUB2 : 1;
1481 unsigned WPUB3 : 1;
1482 unsigned WPUB4 : 1;
1483 unsigned WPUB5 : 1;
1484 unsigned WPUB6 : 1;
1485 unsigned WPUB7 : 1;
1486 } __WPUBbits_t;
1488 extern __at(0x0F85) volatile __WPUBbits_t WPUBbits;
1490 #define _WPUB0 0x01
1491 #define _WPUB1 0x02
1492 #define _WPUB2 0x04
1493 #define _WPUB3 0x08
1494 #define _WPUB4 0x10
1495 #define _WPUB5 0x20
1496 #define _WPUB6 0x40
1497 #define _WPUB7 0x80
1499 //==============================================================================
1502 //==============================================================================
1503 // IOCB Bits
1505 extern __at(0x0F86) __sfr IOCB;
1507 typedef struct
1509 unsigned : 1;
1510 unsigned : 1;
1511 unsigned : 1;
1512 unsigned : 1;
1513 unsigned IOCB4 : 1;
1514 unsigned IOCB5 : 1;
1515 unsigned IOCB6 : 1;
1516 unsigned IOCB7 : 1;
1517 } __IOCBbits_t;
1519 extern __at(0x0F86) volatile __IOCBbits_t IOCBbits;
1521 #define _IOCB4 0x10
1522 #define _IOCB5 0x20
1523 #define _IOCB6 0x40
1524 #define _IOCB7 0x80
1526 //==============================================================================
1529 //==============================================================================
1530 // IOCC Bits
1532 extern __at(0x0F87) __sfr IOCC;
1534 typedef struct
1536 unsigned IOCC0 : 1;
1537 unsigned IOCC1 : 1;
1538 unsigned IOCC2 : 1;
1539 unsigned : 1;
1540 unsigned IOCC4 : 1;
1541 unsigned IOCC5 : 1;
1542 unsigned IOCC6 : 1;
1543 unsigned IOCC7 : 1;
1544 } __IOCCbits_t;
1546 extern __at(0x0F87) volatile __IOCCbits_t IOCCbits;
1548 #define _IOCC0 0x01
1549 #define _IOCC1 0x02
1550 #define _IOCC2 0x04
1551 #define _IOCC4 0x10
1552 #define _IOCC5 0x20
1553 #define _IOCC6 0x40
1554 #define _IOCC7 0x80
1556 //==============================================================================
1559 //==============================================================================
1560 // CTMUICON Bits
1562 extern __at(0x0F88) __sfr CTMUICON;
1564 typedef union
1566 struct
1568 unsigned IRNG0 : 1;
1569 unsigned IRNG1 : 1;
1570 unsigned ITRIM0 : 1;
1571 unsigned ITRIM1 : 1;
1572 unsigned ITRIM2 : 1;
1573 unsigned ITRIM3 : 1;
1574 unsigned ITRIM4 : 1;
1575 unsigned ITRIM5 : 1;
1578 struct
1580 unsigned IRNG : 2;
1581 unsigned : 6;
1584 struct
1586 unsigned : 2;
1587 unsigned ITRIM : 6;
1589 } __CTMUICONbits_t;
1591 extern __at(0x0F88) volatile __CTMUICONbits_t CTMUICONbits;
1593 #define _IRNG0 0x01
1594 #define _IRNG1 0x02
1595 #define _ITRIM0 0x04
1596 #define _ITRIM1 0x08
1597 #define _ITRIM2 0x10
1598 #define _ITRIM3 0x20
1599 #define _ITRIM4 0x40
1600 #define _ITRIM5 0x80
1602 //==============================================================================
1605 //==============================================================================
1606 // LATA Bits
1608 extern __at(0x0F89) __sfr LATA;
1610 typedef struct
1612 unsigned LATA0 : 1;
1613 unsigned LATA1 : 1;
1614 unsigned LATA2 : 1;
1615 unsigned LATA3 : 1;
1616 unsigned LATA4 : 1;
1617 unsigned LATA5 : 1;
1618 unsigned LATA6 : 1;
1619 unsigned LATA7 : 1;
1620 } __LATAbits_t;
1622 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1624 #define _LATA0 0x01
1625 #define _LATA1 0x02
1626 #define _LATA2 0x04
1627 #define _LATA3 0x08
1628 #define _LATA4 0x10
1629 #define _LATA5 0x20
1630 #define _LATA6 0x40
1631 #define _LATA7 0x80
1633 //==============================================================================
1636 //==============================================================================
1637 // LATB Bits
1639 extern __at(0x0F8A) __sfr LATB;
1641 typedef struct
1643 unsigned LATB0 : 1;
1644 unsigned LATB1 : 1;
1645 unsigned LATB2 : 1;
1646 unsigned LATB3 : 1;
1647 unsigned LATB4 : 1;
1648 unsigned LATB5 : 1;
1649 unsigned LATB6 : 1;
1650 unsigned LATB7 : 1;
1651 } __LATBbits_t;
1653 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1655 #define _LATB0 0x01
1656 #define _LATB1 0x02
1657 #define _LATB2 0x04
1658 #define _LATB3 0x08
1659 #define _LATB4 0x10
1660 #define _LATB5 0x20
1661 #define _LATB6 0x40
1662 #define _LATB7 0x80
1664 //==============================================================================
1667 //==============================================================================
1668 // LATC Bits
1670 extern __at(0x0F8B) __sfr LATC;
1672 typedef struct
1674 unsigned LATC0 : 1;
1675 unsigned LATC1 : 1;
1676 unsigned LATC2 : 1;
1677 unsigned : 1;
1678 unsigned LATC4 : 1;
1679 unsigned LATC5 : 1;
1680 unsigned LATC6 : 1;
1681 unsigned LATC7 : 1;
1682 } __LATCbits_t;
1684 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1686 #define _LATC0 0x01
1687 #define _LATC1 0x02
1688 #define _LATC2 0x04
1689 #define _LATC4 0x10
1690 #define _LATC5 0x20
1691 #define _LATC6 0x40
1692 #define _LATC7 0x80
1694 //==============================================================================
1697 //==============================================================================
1698 // CTMUCON1 Bits
1700 extern __at(0x0F8E) __sfr CTMUCON1;
1702 typedef union
1704 struct
1706 unsigned EDG1STAT : 1;
1707 unsigned EDG2STAT : 1;
1708 unsigned EDG1SEL0 : 1;
1709 unsigned EDG1SEL1 : 1;
1710 unsigned EDG1POL : 1;
1711 unsigned EDG2SEL0 : 1;
1712 unsigned EDG2SEL1 : 1;
1713 unsigned EDG2POL : 1;
1716 struct
1718 unsigned : 2;
1719 unsigned EDG1SEL : 2;
1720 unsigned : 4;
1723 struct
1725 unsigned : 5;
1726 unsigned EDG2SEL : 2;
1727 unsigned : 1;
1729 } __CTMUCON1bits_t;
1731 extern __at(0x0F8E) volatile __CTMUCON1bits_t CTMUCON1bits;
1733 #define _EDG1STAT 0x01
1734 #define _EDG2STAT 0x02
1735 #define _EDG1SEL0 0x04
1736 #define _EDG1SEL1 0x08
1737 #define _EDG1POL 0x10
1738 #define _EDG2SEL0 0x20
1739 #define _EDG2SEL1 0x40
1740 #define _EDG2POL 0x80
1742 //==============================================================================
1745 //==============================================================================
1746 // CTMUCONL Bits
1748 extern __at(0x0F8E) __sfr CTMUCONL;
1750 typedef union
1752 struct
1754 unsigned EDG1STAT : 1;
1755 unsigned EDG2STAT : 1;
1756 unsigned EDG1SEL0 : 1;
1757 unsigned EDG1SEL1 : 1;
1758 unsigned EDG1POL : 1;
1759 unsigned EDG2SEL0 : 1;
1760 unsigned EDG2SEL1 : 1;
1761 unsigned EDG2POL : 1;
1764 struct
1766 unsigned : 2;
1767 unsigned EDG1SEL : 2;
1768 unsigned : 4;
1771 struct
1773 unsigned : 5;
1774 unsigned EDG2SEL : 2;
1775 unsigned : 1;
1777 } __CTMUCONLbits_t;
1779 extern __at(0x0F8E) volatile __CTMUCONLbits_t CTMUCONLbits;
1781 #define _CTMUCONL_EDG1STAT 0x01
1782 #define _CTMUCONL_EDG2STAT 0x02
1783 #define _CTMUCONL_EDG1SEL0 0x04
1784 #define _CTMUCONL_EDG1SEL1 0x08
1785 #define _CTMUCONL_EDG1POL 0x10
1786 #define _CTMUCONL_EDG2SEL0 0x20
1787 #define _CTMUCONL_EDG2SEL1 0x40
1788 #define _CTMUCONL_EDG2POL 0x80
1790 //==============================================================================
1793 //==============================================================================
1794 // CTMUCON0 Bits
1796 extern __at(0x0F8F) __sfr CTMUCON0;
1798 typedef union
1800 struct
1802 unsigned CTTRIG : 1;
1803 unsigned IDISSEN : 1;
1804 unsigned EDGSEQEN : 1;
1805 unsigned EDGEN : 1;
1806 unsigned TGEN : 1;
1807 unsigned CTMUSIDL : 1;
1808 unsigned : 1;
1809 unsigned CTMUEN : 1;
1812 struct
1814 unsigned TRIGEN : 1;
1815 unsigned : 1;
1816 unsigned : 1;
1817 unsigned : 1;
1818 unsigned : 1;
1819 unsigned SIDL : 1;
1820 unsigned : 1;
1821 unsigned ON : 1;
1823 } __CTMUCON0bits_t;
1825 extern __at(0x0F8F) volatile __CTMUCON0bits_t CTMUCON0bits;
1827 #define _CTTRIG 0x01
1828 #define _TRIGEN 0x01
1829 #define _IDISSEN 0x02
1830 #define _EDGSEQEN 0x04
1831 #define _EDGEN 0x08
1832 #define _TGEN 0x10
1833 #define _CTMUSIDL 0x20
1834 #define _SIDL 0x20
1835 #define _CTMUEN 0x80
1836 #define _ON 0x80
1838 //==============================================================================
1841 //==============================================================================
1842 // CTMUCONH Bits
1844 extern __at(0x0F8F) __sfr CTMUCONH;
1846 typedef union
1848 struct
1850 unsigned CTTRIG : 1;
1851 unsigned IDISSEN : 1;
1852 unsigned EDGSEQEN : 1;
1853 unsigned EDGEN : 1;
1854 unsigned TGEN : 1;
1855 unsigned CTMUSIDL : 1;
1856 unsigned : 1;
1857 unsigned CTMUEN : 1;
1860 struct
1862 unsigned TRIGEN : 1;
1863 unsigned : 1;
1864 unsigned : 1;
1865 unsigned : 1;
1866 unsigned : 1;
1867 unsigned SIDL : 1;
1868 unsigned : 1;
1869 unsigned ON : 1;
1871 } __CTMUCONHbits_t;
1873 extern __at(0x0F8F) volatile __CTMUCONHbits_t CTMUCONHbits;
1875 #define _CTMUCONH_CTTRIG 0x01
1876 #define _CTMUCONH_TRIGEN 0x01
1877 #define _CTMUCONH_IDISSEN 0x02
1878 #define _CTMUCONH_EDGSEQEN 0x04
1879 #define _CTMUCONH_EDGEN 0x08
1880 #define _CTMUCONH_TGEN 0x10
1881 #define _CTMUCONH_CTMUSIDL 0x20
1882 #define _CTMUCONH_SIDL 0x20
1883 #define _CTMUCONH_CTMUEN 0x80
1884 #define _CTMUCONH_ON 0x80
1886 //==============================================================================
1888 extern __at(0x0F90) __sfr CCPR2;
1889 extern __at(0x0F90) __sfr CCPR2L;
1890 extern __at(0x0F91) __sfr CCPR2H;
1892 //==============================================================================
1893 // DDRA Bits
1895 extern __at(0x0F92) __sfr DDRA;
1897 typedef union
1899 struct
1901 unsigned TRISA0 : 1;
1902 unsigned TRISA1 : 1;
1903 unsigned TRISA2 : 1;
1904 unsigned TRISA3 : 1;
1905 unsigned TRISA4 : 1;
1906 unsigned TRISA5 : 1;
1907 unsigned TRISA6 : 1;
1908 unsigned TRISA7 : 1;
1911 struct
1913 unsigned RA0 : 1;
1914 unsigned RA1 : 1;
1915 unsigned RA2 : 1;
1916 unsigned RA3 : 1;
1917 unsigned RA4 : 1;
1918 unsigned RA5 : 1;
1919 unsigned RA6 : 1;
1920 unsigned RA7 : 1;
1922 } __DDRAbits_t;
1924 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1926 #define _TRISA0 0x01
1927 #define _RA0 0x01
1928 #define _TRISA1 0x02
1929 #define _RA1 0x02
1930 #define _TRISA2 0x04
1931 #define _RA2 0x04
1932 #define _TRISA3 0x08
1933 #define _RA3 0x08
1934 #define _TRISA4 0x10
1935 #define _RA4 0x10
1936 #define _TRISA5 0x20
1937 #define _RA5 0x20
1938 #define _TRISA6 0x40
1939 #define _RA6 0x40
1940 #define _TRISA7 0x80
1941 #define _RA7 0x80
1943 //==============================================================================
1946 //==============================================================================
1947 // TRISA Bits
1949 extern __at(0x0F92) __sfr TRISA;
1951 typedef union
1953 struct
1955 unsigned TRISA0 : 1;
1956 unsigned TRISA1 : 1;
1957 unsigned TRISA2 : 1;
1958 unsigned TRISA3 : 1;
1959 unsigned TRISA4 : 1;
1960 unsigned TRISA5 : 1;
1961 unsigned TRISA6 : 1;
1962 unsigned TRISA7 : 1;
1965 struct
1967 unsigned RA0 : 1;
1968 unsigned RA1 : 1;
1969 unsigned RA2 : 1;
1970 unsigned RA3 : 1;
1971 unsigned RA4 : 1;
1972 unsigned RA5 : 1;
1973 unsigned RA6 : 1;
1974 unsigned RA7 : 1;
1976 } __TRISAbits_t;
1978 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1980 #define _TRISA_TRISA0 0x01
1981 #define _TRISA_RA0 0x01
1982 #define _TRISA_TRISA1 0x02
1983 #define _TRISA_RA1 0x02
1984 #define _TRISA_TRISA2 0x04
1985 #define _TRISA_RA2 0x04
1986 #define _TRISA_TRISA3 0x08
1987 #define _TRISA_RA3 0x08
1988 #define _TRISA_TRISA4 0x10
1989 #define _TRISA_RA4 0x10
1990 #define _TRISA_TRISA5 0x20
1991 #define _TRISA_RA5 0x20
1992 #define _TRISA_TRISA6 0x40
1993 #define _TRISA_RA6 0x40
1994 #define _TRISA_TRISA7 0x80
1995 #define _TRISA_RA7 0x80
1997 //==============================================================================
2000 //==============================================================================
2001 // DDRB Bits
2003 extern __at(0x0F93) __sfr DDRB;
2005 typedef union
2007 struct
2009 unsigned TRISB0 : 1;
2010 unsigned TRISB1 : 1;
2011 unsigned TRISB2 : 1;
2012 unsigned TRISB3 : 1;
2013 unsigned TRISB4 : 1;
2014 unsigned TRISB5 : 1;
2015 unsigned TRISB6 : 1;
2016 unsigned TRISB7 : 1;
2019 struct
2021 unsigned RB0 : 1;
2022 unsigned RB1 : 1;
2023 unsigned RB2 : 1;
2024 unsigned RB3 : 1;
2025 unsigned RB4 : 1;
2026 unsigned RB5 : 1;
2027 unsigned RB6 : 1;
2028 unsigned RB7 : 1;
2030 } __DDRBbits_t;
2032 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2034 #define _TRISB0 0x01
2035 #define _RB0 0x01
2036 #define _TRISB1 0x02
2037 #define _RB1 0x02
2038 #define _TRISB2 0x04
2039 #define _RB2 0x04
2040 #define _TRISB3 0x08
2041 #define _RB3 0x08
2042 #define _TRISB4 0x10
2043 #define _RB4 0x10
2044 #define _TRISB5 0x20
2045 #define _RB5 0x20
2046 #define _TRISB6 0x40
2047 #define _RB6 0x40
2048 #define _TRISB7 0x80
2049 #define _RB7 0x80
2051 //==============================================================================
2054 //==============================================================================
2055 // TRISB Bits
2057 extern __at(0x0F93) __sfr TRISB;
2059 typedef union
2061 struct
2063 unsigned TRISB0 : 1;
2064 unsigned TRISB1 : 1;
2065 unsigned TRISB2 : 1;
2066 unsigned TRISB3 : 1;
2067 unsigned TRISB4 : 1;
2068 unsigned TRISB5 : 1;
2069 unsigned TRISB6 : 1;
2070 unsigned TRISB7 : 1;
2073 struct
2075 unsigned RB0 : 1;
2076 unsigned RB1 : 1;
2077 unsigned RB2 : 1;
2078 unsigned RB3 : 1;
2079 unsigned RB4 : 1;
2080 unsigned RB5 : 1;
2081 unsigned RB6 : 1;
2082 unsigned RB7 : 1;
2084 } __TRISBbits_t;
2086 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2088 #define _TRISB_TRISB0 0x01
2089 #define _TRISB_RB0 0x01
2090 #define _TRISB_TRISB1 0x02
2091 #define _TRISB_RB1 0x02
2092 #define _TRISB_TRISB2 0x04
2093 #define _TRISB_RB2 0x04
2094 #define _TRISB_TRISB3 0x08
2095 #define _TRISB_RB3 0x08
2096 #define _TRISB_TRISB4 0x10
2097 #define _TRISB_RB4 0x10
2098 #define _TRISB_TRISB5 0x20
2099 #define _TRISB_RB5 0x20
2100 #define _TRISB_TRISB6 0x40
2101 #define _TRISB_RB6 0x40
2102 #define _TRISB_TRISB7 0x80
2103 #define _TRISB_RB7 0x80
2105 //==============================================================================
2108 //==============================================================================
2109 // DDRC Bits
2111 extern __at(0x0F94) __sfr DDRC;
2113 typedef union
2115 struct
2117 unsigned TRISC0 : 1;
2118 unsigned TRISC1 : 1;
2119 unsigned TRISC2 : 1;
2120 unsigned : 1;
2121 unsigned TRISC4 : 1;
2122 unsigned TRISC5 : 1;
2123 unsigned TRISC6 : 1;
2124 unsigned TRISC7 : 1;
2127 struct
2129 unsigned RC0 : 1;
2130 unsigned RC1 : 1;
2131 unsigned RC2 : 1;
2132 unsigned : 1;
2133 unsigned : 1;
2134 unsigned : 1;
2135 unsigned RC6 : 1;
2136 unsigned RC7 : 1;
2138 } __DDRCbits_t;
2140 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2142 #define _TRISC0 0x01
2143 #define _RC0 0x01
2144 #define _TRISC1 0x02
2145 #define _RC1 0x02
2146 #define _TRISC2 0x04
2147 #define _RC2 0x04
2148 #define _TRISC4 0x10
2149 #define _TRISC5 0x20
2150 #define _TRISC6 0x40
2151 #define _RC6 0x40
2152 #define _TRISC7 0x80
2153 #define _RC7 0x80
2155 //==============================================================================
2158 //==============================================================================
2159 // TRISC Bits
2161 extern __at(0x0F94) __sfr TRISC;
2163 typedef union
2165 struct
2167 unsigned TRISC0 : 1;
2168 unsigned TRISC1 : 1;
2169 unsigned TRISC2 : 1;
2170 unsigned : 1;
2171 unsigned TRISC4 : 1;
2172 unsigned TRISC5 : 1;
2173 unsigned TRISC6 : 1;
2174 unsigned TRISC7 : 1;
2177 struct
2179 unsigned RC0 : 1;
2180 unsigned RC1 : 1;
2181 unsigned RC2 : 1;
2182 unsigned : 1;
2183 unsigned : 1;
2184 unsigned : 1;
2185 unsigned RC6 : 1;
2186 unsigned RC7 : 1;
2188 } __TRISCbits_t;
2190 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2192 #define _TRISC_TRISC0 0x01
2193 #define _TRISC_RC0 0x01
2194 #define _TRISC_TRISC1 0x02
2195 #define _TRISC_RC1 0x02
2196 #define _TRISC_TRISC2 0x04
2197 #define _TRISC_RC2 0x04
2198 #define _TRISC_TRISC4 0x10
2199 #define _TRISC_TRISC5 0x20
2200 #define _TRISC_TRISC6 0x40
2201 #define _TRISC_RC6 0x40
2202 #define _TRISC_TRISC7 0x80
2203 #define _TRISC_RC7 0x80
2205 //==============================================================================
2208 //==============================================================================
2209 // CCP2CON Bits
2211 extern __at(0x0F97) __sfr CCP2CON;
2213 typedef union
2215 struct
2217 unsigned CCP2M0 : 1;
2218 unsigned CCP2M1 : 1;
2219 unsigned CCP2M2 : 1;
2220 unsigned CCP2M3 : 1;
2221 unsigned DC2B0 : 1;
2222 unsigned DC2B1 : 1;
2223 unsigned : 1;
2224 unsigned : 1;
2227 struct
2229 unsigned : 1;
2230 unsigned : 1;
2231 unsigned : 1;
2232 unsigned : 1;
2233 unsigned CCP2Y : 1;
2234 unsigned CCP2X : 1;
2235 unsigned : 1;
2236 unsigned : 1;
2239 struct
2241 unsigned CCP2M : 4;
2242 unsigned : 4;
2245 struct
2247 unsigned : 4;
2248 unsigned DC2B : 2;
2249 unsigned : 2;
2251 } __CCP2CONbits_t;
2253 extern __at(0x0F97) volatile __CCP2CONbits_t CCP2CONbits;
2255 #define _CCP2M0 0x01
2256 #define _CCP2M1 0x02
2257 #define _CCP2M2 0x04
2258 #define _CCP2M3 0x08
2259 #define _DC2B0 0x10
2260 #define _CCP2Y 0x10
2261 #define _DC2B1 0x20
2262 #define _CCP2X 0x20
2264 //==============================================================================
2267 //==============================================================================
2268 // ECCP2CON Bits
2270 extern __at(0x0F97) __sfr ECCP2CON;
2272 typedef union
2274 struct
2276 unsigned CCP2M0 : 1;
2277 unsigned CCP2M1 : 1;
2278 unsigned CCP2M2 : 1;
2279 unsigned CCP2M3 : 1;
2280 unsigned DC2B0 : 1;
2281 unsigned DC2B1 : 1;
2282 unsigned : 1;
2283 unsigned : 1;
2286 struct
2288 unsigned : 1;
2289 unsigned : 1;
2290 unsigned : 1;
2291 unsigned : 1;
2292 unsigned CCP2Y : 1;
2293 unsigned CCP2X : 1;
2294 unsigned : 1;
2295 unsigned : 1;
2298 struct
2300 unsigned CCP2M : 4;
2301 unsigned : 4;
2304 struct
2306 unsigned : 4;
2307 unsigned DC2B : 2;
2308 unsigned : 2;
2310 } __ECCP2CONbits_t;
2312 extern __at(0x0F97) volatile __ECCP2CONbits_t ECCP2CONbits;
2314 #define _ECCP2CON_CCP2M0 0x01
2315 #define _ECCP2CON_CCP2M1 0x02
2316 #define _ECCP2CON_CCP2M2 0x04
2317 #define _ECCP2CON_CCP2M3 0x08
2318 #define _ECCP2CON_DC2B0 0x10
2319 #define _ECCP2CON_CCP2Y 0x10
2320 #define _ECCP2CON_DC2B1 0x20
2321 #define _ECCP2CON_CCP2X 0x20
2323 //==============================================================================
2326 //==============================================================================
2327 // CM1CON0 Bits
2329 extern __at(0x0F98) __sfr CM1CON0;
2331 typedef union
2333 struct
2335 unsigned C1CH0 : 1;
2336 unsigned C1CH1 : 1;
2337 unsigned C1R : 1;
2338 unsigned C1SP : 1;
2339 unsigned C1POL : 1;
2340 unsigned C1OE : 1;
2341 unsigned C1OUT : 1;
2342 unsigned C1ON : 1;
2345 struct
2347 unsigned CCH0 : 1;
2348 unsigned CCH1 : 1;
2349 unsigned CREF : 1;
2350 unsigned : 1;
2351 unsigned CPOL : 1;
2352 unsigned COE : 1;
2353 unsigned COUT1 : 1;
2354 unsigned CON : 1;
2357 struct
2359 unsigned CCH : 2;
2360 unsigned : 6;
2363 struct
2365 unsigned C1CH : 2;
2366 unsigned : 6;
2368 } __CM1CON0bits_t;
2370 extern __at(0x0F98) volatile __CM1CON0bits_t CM1CON0bits;
2372 #define _C1CH0 0x01
2373 #define _CCH0 0x01
2374 #define _C1CH1 0x02
2375 #define _CCH1 0x02
2376 #define _C1R 0x04
2377 #define _CREF 0x04
2378 #define _C1SP 0x08
2379 #define _C1POL 0x10
2380 #define _CPOL 0x10
2381 #define _C1OE 0x20
2382 #define _COE 0x20
2383 #define _C1OUT 0x40
2384 #define _COUT1 0x40
2385 #define _C1ON 0x80
2386 #define _CON 0x80
2388 //==============================================================================
2391 //==============================================================================
2392 // CM2CON0 Bits
2394 extern __at(0x0F99) __sfr CM2CON0;
2396 typedef union
2398 struct
2400 unsigned C2CH0 : 1;
2401 unsigned C2CH1 : 1;
2402 unsigned C2R : 1;
2403 unsigned C2SP : 1;
2404 unsigned C2POL : 1;
2405 unsigned C2OE : 1;
2406 unsigned C2OUT : 1;
2407 unsigned C2ON : 1;
2410 struct
2412 unsigned CCH0 : 1;
2413 unsigned CCH1 : 1;
2414 unsigned CREF : 1;
2415 unsigned : 1;
2416 unsigned CPOL : 1;
2417 unsigned COE : 1;
2418 unsigned COUT2 : 1;
2419 unsigned CON : 1;
2422 struct
2424 unsigned CCH : 2;
2425 unsigned : 6;
2428 struct
2430 unsigned C2CH : 2;
2431 unsigned : 6;
2433 } __CM2CON0bits_t;
2435 extern __at(0x0F99) volatile __CM2CON0bits_t CM2CON0bits;
2437 #define _CM2CON0_C2CH0 0x01
2438 #define _CM2CON0_CCH0 0x01
2439 #define _CM2CON0_C2CH1 0x02
2440 #define _CM2CON0_CCH1 0x02
2441 #define _CM2CON0_C2R 0x04
2442 #define _CM2CON0_CREF 0x04
2443 #define _CM2CON0_C2SP 0x08
2444 #define _CM2CON0_C2POL 0x10
2445 #define _CM2CON0_CPOL 0x10
2446 #define _CM2CON0_C2OE 0x20
2447 #define _CM2CON0_COE 0x20
2448 #define _CM2CON0_C2OUT 0x40
2449 #define _CM2CON0_COUT2 0x40
2450 #define _CM2CON0_C2ON 0x80
2451 #define _CM2CON0_CON 0x80
2453 //==============================================================================
2456 //==============================================================================
2457 // CM2CON1 Bits
2459 extern __at(0x0F9A) __sfr CM2CON1;
2461 typedef struct
2463 unsigned C2SYNC : 1;
2464 unsigned C1SYNC : 1;
2465 unsigned C2HYS : 1;
2466 unsigned C1HYS : 1;
2467 unsigned C2RSEL : 1;
2468 unsigned C1RSEL : 1;
2469 unsigned MC2OUT : 1;
2470 unsigned MC1OUT : 1;
2471 } __CM2CON1bits_t;
2473 extern __at(0x0F9A) volatile __CM2CON1bits_t CM2CON1bits;
2475 #define _C2SYNC 0x01
2476 #define _C1SYNC 0x02
2477 #define _C2HYS 0x04
2478 #define _C1HYS 0x08
2479 #define _C2RSEL 0x10
2480 #define _C1RSEL 0x20
2481 #define _MC2OUT 0x40
2482 #define _MC1OUT 0x80
2484 //==============================================================================
2487 //==============================================================================
2488 // OSCTUNE Bits
2490 extern __at(0x0F9B) __sfr OSCTUNE;
2492 typedef union
2494 struct
2496 unsigned TUN0 : 1;
2497 unsigned TUN1 : 1;
2498 unsigned TUN2 : 1;
2499 unsigned TUN3 : 1;
2500 unsigned TUN4 : 1;
2501 unsigned TUN5 : 1;
2502 unsigned TUN6 : 1;
2503 unsigned SPLLMULT : 1;
2506 struct
2508 unsigned TUN : 7;
2509 unsigned : 1;
2511 } __OSCTUNEbits_t;
2513 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2515 #define _TUN0 0x01
2516 #define _TUN1 0x02
2517 #define _TUN2 0x04
2518 #define _TUN3 0x08
2519 #define _TUN4 0x10
2520 #define _TUN5 0x20
2521 #define _TUN6 0x40
2522 #define _SPLLMULT 0x80
2524 //==============================================================================
2527 //==============================================================================
2528 // HLVDCON Bits
2530 extern __at(0x0F9C) __sfr HLVDCON;
2532 typedef union
2534 struct
2536 unsigned HLVDL0 : 1;
2537 unsigned HLVDL1 : 1;
2538 unsigned HLVDL2 : 1;
2539 unsigned HLVDL3 : 1;
2540 unsigned HLVDEN : 1;
2541 unsigned IRVST : 1;
2542 unsigned BGVST : 1;
2543 unsigned VDIRMAG : 1;
2546 struct
2548 unsigned HLVDL : 4;
2549 unsigned : 4;
2551 } __HLVDCONbits_t;
2553 extern __at(0x0F9C) volatile __HLVDCONbits_t HLVDCONbits;
2555 #define _HLVDL0 0x01
2556 #define _HLVDL1 0x02
2557 #define _HLVDL2 0x04
2558 #define _HLVDL3 0x08
2559 #define _HLVDEN 0x10
2560 #define _IRVST 0x20
2561 #define _BGVST 0x40
2562 #define _VDIRMAG 0x80
2564 //==============================================================================
2567 //==============================================================================
2568 // PIE1 Bits
2570 extern __at(0x0F9D) __sfr PIE1;
2572 typedef union
2574 struct
2576 unsigned TMR1IE : 1;
2577 unsigned TMR2IE : 1;
2578 unsigned CCP1IE : 1;
2579 unsigned SSPIE : 1;
2580 unsigned TXIE : 1;
2581 unsigned RCIE : 1;
2582 unsigned ADIE : 1;
2583 unsigned ACTIE : 1;
2586 struct
2588 unsigned : 1;
2589 unsigned : 1;
2590 unsigned : 1;
2591 unsigned SSP1IE : 1;
2592 unsigned TX1IE : 1;
2593 unsigned RC1IE : 1;
2594 unsigned : 1;
2595 unsigned STIE : 1;
2597 } __PIE1bits_t;
2599 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
2601 #define _TMR1IE 0x01
2602 #define _TMR2IE 0x02
2603 #define _CCP1IE 0x04
2604 #define _SSPIE 0x08
2605 #define _SSP1IE 0x08
2606 #define _TXIE 0x10
2607 #define _TX1IE 0x10
2608 #define _RCIE 0x20
2609 #define _RC1IE 0x20
2610 #define _ADIE 0x40
2611 #define _ACTIE 0x80
2612 #define _STIE 0x80
2614 //==============================================================================
2617 //==============================================================================
2618 // PIR1 Bits
2620 extern __at(0x0F9E) __sfr PIR1;
2622 typedef union
2624 struct
2626 unsigned TMR1IF : 1;
2627 unsigned TMR2IF : 1;
2628 unsigned CCP1IF : 1;
2629 unsigned SSPIF : 1;
2630 unsigned TXIF : 1;
2631 unsigned RCIF : 1;
2632 unsigned ADIF : 1;
2633 unsigned ACTIF : 1;
2636 struct
2638 unsigned : 1;
2639 unsigned : 1;
2640 unsigned : 1;
2641 unsigned SSP1IF : 1;
2642 unsigned TX1IF : 1;
2643 unsigned RC1IF : 1;
2644 unsigned : 1;
2645 unsigned STIF : 1;
2647 } __PIR1bits_t;
2649 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2651 #define _TMR1IF 0x01
2652 #define _TMR2IF 0x02
2653 #define _CCP1IF 0x04
2654 #define _SSPIF 0x08
2655 #define _SSP1IF 0x08
2656 #define _TXIF 0x10
2657 #define _TX1IF 0x10
2658 #define _RCIF 0x20
2659 #define _RC1IF 0x20
2660 #define _ADIF 0x40
2661 #define _ACTIF 0x80
2662 #define _STIF 0x80
2664 //==============================================================================
2667 //==============================================================================
2668 // IPR1 Bits
2670 extern __at(0x0F9F) __sfr IPR1;
2672 typedef union
2674 struct
2676 unsigned TMR1IP : 1;
2677 unsigned TMR2IP : 1;
2678 unsigned CCP1IP : 1;
2679 unsigned SSPIP : 1;
2680 unsigned TXIP : 1;
2681 unsigned RCIP : 1;
2682 unsigned ADIP : 1;
2683 unsigned ACTIP : 1;
2686 struct
2688 unsigned : 1;
2689 unsigned : 1;
2690 unsigned : 1;
2691 unsigned SSP1IP : 1;
2692 unsigned TX1IP : 1;
2693 unsigned RC1IP : 1;
2694 unsigned : 1;
2695 unsigned STIP : 1;
2697 } __IPR1bits_t;
2699 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2701 #define _TMR1IP 0x01
2702 #define _TMR2IP 0x02
2703 #define _CCP1IP 0x04
2704 #define _SSPIP 0x08
2705 #define _SSP1IP 0x08
2706 #define _TXIP 0x10
2707 #define _TX1IP 0x10
2708 #define _RCIP 0x20
2709 #define _RC1IP 0x20
2710 #define _ADIP 0x40
2711 #define _ACTIP 0x80
2712 #define _STIP 0x80
2714 //==============================================================================
2717 //==============================================================================
2718 // PIE2 Bits
2720 extern __at(0x0FA0) __sfr PIE2;
2722 typedef union
2724 struct
2726 unsigned CCP2IE : 1;
2727 unsigned TMR3IE : 1;
2728 unsigned HLVDIE : 1;
2729 unsigned BCLIE : 1;
2730 unsigned EEIE : 1;
2731 unsigned C2IE : 1;
2732 unsigned C1IE : 1;
2733 unsigned OSCFIE : 1;
2736 struct
2738 unsigned : 1;
2739 unsigned : 1;
2740 unsigned LVDIE : 1;
2741 unsigned BCL1IE : 1;
2742 unsigned : 1;
2743 unsigned CM2IE : 1;
2744 unsigned CM1IE : 1;
2745 unsigned : 1;
2747 } __PIE2bits_t;
2749 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2751 #define _CCP2IE 0x01
2752 #define _TMR3IE 0x02
2753 #define _HLVDIE 0x04
2754 #define _LVDIE 0x04
2755 #define _BCLIE 0x08
2756 #define _BCL1IE 0x08
2757 #define _EEIE 0x10
2758 #define _C2IE 0x20
2759 #define _CM2IE 0x20
2760 #define _C1IE 0x40
2761 #define _CM1IE 0x40
2762 #define _OSCFIE 0x80
2764 //==============================================================================
2767 //==============================================================================
2768 // PIR2 Bits
2770 extern __at(0x0FA1) __sfr PIR2;
2772 typedef union
2774 struct
2776 unsigned CCP2IF : 1;
2777 unsigned TMR3IF : 1;
2778 unsigned HLVDIF : 1;
2779 unsigned BCLIF : 1;
2780 unsigned EEIF : 1;
2781 unsigned C2IF : 1;
2782 unsigned C1IF : 1;
2783 unsigned OSCFIF : 1;
2786 struct
2788 unsigned : 1;
2789 unsigned : 1;
2790 unsigned LVDIF : 1;
2791 unsigned BCL1IF : 1;
2792 unsigned : 1;
2793 unsigned CM2IF : 1;
2794 unsigned CM1IF : 1;
2795 unsigned : 1;
2797 } __PIR2bits_t;
2799 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2801 #define _CCP2IF 0x01
2802 #define _TMR3IF 0x02
2803 #define _HLVDIF 0x04
2804 #define _LVDIF 0x04
2805 #define _BCLIF 0x08
2806 #define _BCL1IF 0x08
2807 #define _EEIF 0x10
2808 #define _C2IF 0x20
2809 #define _CM2IF 0x20
2810 #define _C1IF 0x40
2811 #define _CM1IF 0x40
2812 #define _OSCFIF 0x80
2814 //==============================================================================
2817 //==============================================================================
2818 // IPR2 Bits
2820 extern __at(0x0FA2) __sfr IPR2;
2822 typedef union
2824 struct
2826 unsigned CCP2IP : 1;
2827 unsigned TMR3IP : 1;
2828 unsigned HLVDIP : 1;
2829 unsigned BCLIP : 1;
2830 unsigned EEIP : 1;
2831 unsigned C2IP : 1;
2832 unsigned C1IP : 1;
2833 unsigned OSCFIP : 1;
2836 struct
2838 unsigned : 1;
2839 unsigned : 1;
2840 unsigned LVDIP : 1;
2841 unsigned BCL1IP : 1;
2842 unsigned : 1;
2843 unsigned CM2IP : 1;
2844 unsigned CM1IP : 1;
2845 unsigned : 1;
2847 } __IPR2bits_t;
2849 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
2851 #define _CCP2IP 0x01
2852 #define _TMR3IP 0x02
2853 #define _HLVDIP 0x04
2854 #define _LVDIP 0x04
2855 #define _BCLIP 0x08
2856 #define _BCL1IP 0x08
2857 #define _EEIP 0x10
2858 #define _C2IP 0x20
2859 #define _CM2IP 0x20
2860 #define _C1IP 0x40
2861 #define _CM1IP 0x40
2862 #define _OSCFIP 0x80
2864 //==============================================================================
2867 //==============================================================================
2868 // PIE3 Bits
2870 extern __at(0x0FA3) __sfr PIE3;
2872 typedef struct
2874 unsigned TMR1GIE : 1;
2875 unsigned TMR3GIE : 1;
2876 unsigned USBIE : 1;
2877 unsigned CTMUIE : 1;
2878 unsigned : 1;
2879 unsigned : 1;
2880 unsigned : 1;
2881 unsigned : 1;
2882 } __PIE3bits_t;
2884 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
2886 #define _TMR1GIE 0x01
2887 #define _TMR3GIE 0x02
2888 #define _USBIE 0x04
2889 #define _CTMUIE 0x08
2891 //==============================================================================
2894 //==============================================================================
2895 // PIR3 Bits
2897 extern __at(0x0FA4) __sfr PIR3;
2899 typedef struct
2901 unsigned TMR1GIF : 1;
2902 unsigned TMR3GIF : 1;
2903 unsigned USBIF : 1;
2904 unsigned CTMUIF : 1;
2905 unsigned : 1;
2906 unsigned : 1;
2907 unsigned : 1;
2908 unsigned : 1;
2909 } __PIR3bits_t;
2911 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
2913 #define _TMR1GIF 0x01
2914 #define _TMR3GIF 0x02
2915 #define _USBIF 0x04
2916 #define _CTMUIF 0x08
2918 //==============================================================================
2921 //==============================================================================
2922 // IPR3 Bits
2924 extern __at(0x0FA5) __sfr IPR3;
2926 typedef struct
2928 unsigned TMR1GIP : 1;
2929 unsigned TMR3GIP : 1;
2930 unsigned USBIP : 1;
2931 unsigned CTMUIP : 1;
2932 unsigned : 1;
2933 unsigned : 1;
2934 unsigned : 1;
2935 unsigned : 1;
2936 } __IPR3bits_t;
2938 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
2940 #define _TMR1GIP 0x01
2941 #define _TMR3GIP 0x02
2942 #define _USBIP 0x04
2943 #define _CTMUIP 0x08
2945 //==============================================================================
2948 //==============================================================================
2949 // EECON1 Bits
2951 extern __at(0x0FA6) __sfr EECON1;
2953 typedef struct
2955 unsigned RD : 1;
2956 unsigned WR : 1;
2957 unsigned WREN : 1;
2958 unsigned WRERR : 1;
2959 unsigned FREE : 1;
2960 unsigned : 1;
2961 unsigned CFGS : 1;
2962 unsigned EEPGD : 1;
2963 } __EECON1bits_t;
2965 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
2967 #define _RD 0x01
2968 #define _WR 0x02
2969 #define _WREN 0x04
2970 #define _WRERR 0x08
2971 #define _FREE 0x10
2972 #define _CFGS 0x40
2973 #define _EEPGD 0x80
2975 //==============================================================================
2977 extern __at(0x0FA7) __sfr EECON2;
2978 extern __at(0x0FA8) __sfr EEDATA;
2979 extern __at(0x0FA9) __sfr EEADR;
2981 //==============================================================================
2982 // RCSTA Bits
2984 extern __at(0x0FAB) __sfr RCSTA;
2986 typedef union
2988 struct
2990 unsigned RX9D : 1;
2991 unsigned OERR : 1;
2992 unsigned FERR : 1;
2993 unsigned ADDEN : 1;
2994 unsigned CREN : 1;
2995 unsigned SREN : 1;
2996 unsigned RX9 : 1;
2997 unsigned SPEN : 1;
3000 struct
3002 unsigned : 1;
3003 unsigned : 1;
3004 unsigned : 1;
3005 unsigned ADEN : 1;
3006 unsigned : 1;
3007 unsigned : 1;
3008 unsigned : 1;
3009 unsigned : 1;
3011 } __RCSTAbits_t;
3013 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3015 #define _RX9D 0x01
3016 #define _OERR 0x02
3017 #define _FERR 0x04
3018 #define _ADDEN 0x08
3019 #define _ADEN 0x08
3020 #define _CREN 0x10
3021 #define _SREN 0x20
3022 #define _RX9 0x40
3023 #define _SPEN 0x80
3025 //==============================================================================
3028 //==============================================================================
3029 // RCSTA1 Bits
3031 extern __at(0x0FAB) __sfr RCSTA1;
3033 typedef union
3035 struct
3037 unsigned RX9D : 1;
3038 unsigned OERR : 1;
3039 unsigned FERR : 1;
3040 unsigned ADDEN : 1;
3041 unsigned CREN : 1;
3042 unsigned SREN : 1;
3043 unsigned RX9 : 1;
3044 unsigned SPEN : 1;
3047 struct
3049 unsigned : 1;
3050 unsigned : 1;
3051 unsigned : 1;
3052 unsigned ADEN : 1;
3053 unsigned : 1;
3054 unsigned : 1;
3055 unsigned : 1;
3056 unsigned : 1;
3058 } __RCSTA1bits_t;
3060 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
3062 #define _RCSTA1_RX9D 0x01
3063 #define _RCSTA1_OERR 0x02
3064 #define _RCSTA1_FERR 0x04
3065 #define _RCSTA1_ADDEN 0x08
3066 #define _RCSTA1_ADEN 0x08
3067 #define _RCSTA1_CREN 0x10
3068 #define _RCSTA1_SREN 0x20
3069 #define _RCSTA1_RX9 0x40
3070 #define _RCSTA1_SPEN 0x80
3072 //==============================================================================
3075 //==============================================================================
3076 // TXSTA Bits
3078 extern __at(0x0FAC) __sfr TXSTA;
3080 typedef struct
3082 unsigned TX9D : 1;
3083 unsigned TRMT : 1;
3084 unsigned BRGH : 1;
3085 unsigned SENDB : 1;
3086 unsigned SYNC : 1;
3087 unsigned TXEN : 1;
3088 unsigned TX9 : 1;
3089 unsigned CSRC : 1;
3090 } __TXSTAbits_t;
3092 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
3094 #define _TX9D 0x01
3095 #define _TRMT 0x02
3096 #define _BRGH 0x04
3097 #define _SENDB 0x08
3098 #define _SYNC 0x10
3099 #define _TXEN 0x20
3100 #define _TX9 0x40
3101 #define _CSRC 0x80
3103 //==============================================================================
3106 //==============================================================================
3107 // TXSTA1 Bits
3109 extern __at(0x0FAC) __sfr TXSTA1;
3111 typedef struct
3113 unsigned TX9D : 1;
3114 unsigned TRMT : 1;
3115 unsigned BRGH : 1;
3116 unsigned SENDB : 1;
3117 unsigned SYNC : 1;
3118 unsigned TXEN : 1;
3119 unsigned TX9 : 1;
3120 unsigned CSRC : 1;
3121 } __TXSTA1bits_t;
3123 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
3125 #define _TXSTA1_TX9D 0x01
3126 #define _TXSTA1_TRMT 0x02
3127 #define _TXSTA1_BRGH 0x04
3128 #define _TXSTA1_SENDB 0x08
3129 #define _TXSTA1_SYNC 0x10
3130 #define _TXSTA1_TXEN 0x20
3131 #define _TXSTA1_TX9 0x40
3132 #define _TXSTA1_CSRC 0x80
3134 //==============================================================================
3136 extern __at(0x0FAD) __sfr TXREG;
3137 extern __at(0x0FAD) __sfr TXREG1;
3138 extern __at(0x0FAE) __sfr RCREG;
3139 extern __at(0x0FAE) __sfr RCREG1;
3141 //==============================================================================
3142 // SPBRG Bits
3144 extern __at(0x0FAF) __sfr SPBRG;
3146 typedef struct
3148 unsigned BRG0 : 1;
3149 unsigned BRG1 : 1;
3150 unsigned BRG2 : 1;
3151 unsigned BRG3 : 1;
3152 unsigned BRG4 : 1;
3153 unsigned BRG5 : 1;
3154 unsigned BRG6 : 1;
3155 unsigned BRG7 : 1;
3156 } __SPBRGbits_t;
3158 extern __at(0x0FAF) volatile __SPBRGbits_t SPBRGbits;
3160 #define _BRG0 0x01
3161 #define _BRG1 0x02
3162 #define _BRG2 0x04
3163 #define _BRG3 0x08
3164 #define _BRG4 0x10
3165 #define _BRG5 0x20
3166 #define _BRG6 0x40
3167 #define _BRG7 0x80
3169 //==============================================================================
3172 //==============================================================================
3173 // SPBRG1 Bits
3175 extern __at(0x0FAF) __sfr SPBRG1;
3177 typedef struct
3179 unsigned BRG0 : 1;
3180 unsigned BRG1 : 1;
3181 unsigned BRG2 : 1;
3182 unsigned BRG3 : 1;
3183 unsigned BRG4 : 1;
3184 unsigned BRG5 : 1;
3185 unsigned BRG6 : 1;
3186 unsigned BRG7 : 1;
3187 } __SPBRG1bits_t;
3189 extern __at(0x0FAF) volatile __SPBRG1bits_t SPBRG1bits;
3191 #define _SPBRG1_BRG0 0x01
3192 #define _SPBRG1_BRG1 0x02
3193 #define _SPBRG1_BRG2 0x04
3194 #define _SPBRG1_BRG3 0x08
3195 #define _SPBRG1_BRG4 0x10
3196 #define _SPBRG1_BRG5 0x20
3197 #define _SPBRG1_BRG6 0x40
3198 #define _SPBRG1_BRG7 0x80
3200 //==============================================================================
3203 //==============================================================================
3204 // SPBRGH Bits
3206 extern __at(0x0FB0) __sfr SPBRGH;
3208 typedef struct
3210 unsigned BRG8 : 1;
3211 unsigned BRG9 : 1;
3212 unsigned BRG10 : 1;
3213 unsigned BRG11 : 1;
3214 unsigned BRG12 : 1;
3215 unsigned BRG13 : 1;
3216 unsigned BRG14 : 1;
3217 unsigned BRG15 : 1;
3218 } __SPBRGHbits_t;
3220 extern __at(0x0FB0) volatile __SPBRGHbits_t SPBRGHbits;
3222 #define _BRG8 0x01
3223 #define _BRG9 0x02
3224 #define _BRG10 0x04
3225 #define _BRG11 0x08
3226 #define _BRG12 0x10
3227 #define _BRG13 0x20
3228 #define _BRG14 0x40
3229 #define _BRG15 0x80
3231 //==============================================================================
3234 //==============================================================================
3235 // SPBRGH1 Bits
3237 extern __at(0x0FB0) __sfr SPBRGH1;
3239 typedef struct
3241 unsigned BRG8 : 1;
3242 unsigned BRG9 : 1;
3243 unsigned BRG10 : 1;
3244 unsigned BRG11 : 1;
3245 unsigned BRG12 : 1;
3246 unsigned BRG13 : 1;
3247 unsigned BRG14 : 1;
3248 unsigned BRG15 : 1;
3249 } __SPBRGH1bits_t;
3251 extern __at(0x0FB0) volatile __SPBRGH1bits_t SPBRGH1bits;
3253 #define _SPBRGH1_BRG8 0x01
3254 #define _SPBRGH1_BRG9 0x02
3255 #define _SPBRGH1_BRG10 0x04
3256 #define _SPBRGH1_BRG11 0x08
3257 #define _SPBRGH1_BRG12 0x10
3258 #define _SPBRGH1_BRG13 0x20
3259 #define _SPBRGH1_BRG14 0x40
3260 #define _SPBRGH1_BRG15 0x80
3262 //==============================================================================
3265 //==============================================================================
3266 // T3CON Bits
3268 extern __at(0x0FB1) __sfr T3CON;
3270 typedef union
3272 struct
3274 unsigned TMR3ON : 1;
3275 unsigned RD16 : 1;
3276 unsigned NOT_T3SYNC : 1;
3277 unsigned SOSCEN : 1;
3278 unsigned T3CKPS0 : 1;
3279 unsigned T3CKPS1 : 1;
3280 unsigned TMR3CS0 : 1;
3281 unsigned TMR3CS1 : 1;
3284 struct
3286 unsigned : 1;
3287 unsigned T3RD16 : 1;
3288 unsigned T3SYNC : 1;
3289 unsigned T3SOSCEN : 1;
3290 unsigned : 1;
3291 unsigned : 1;
3292 unsigned : 1;
3293 unsigned : 1;
3296 struct
3298 unsigned : 1;
3299 unsigned : 1;
3300 unsigned : 1;
3301 unsigned T3OSCEN : 1;
3302 unsigned : 1;
3303 unsigned : 1;
3304 unsigned : 1;
3305 unsigned : 1;
3308 struct
3310 unsigned : 4;
3311 unsigned T3CKPS : 2;
3312 unsigned : 2;
3315 struct
3317 unsigned : 6;
3318 unsigned TMR3CS : 2;
3320 } __T3CONbits_t;
3322 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
3324 #define _T3CON_TMR3ON 0x01
3325 #define _T3CON_RD16 0x02
3326 #define _T3CON_T3RD16 0x02
3327 #define _T3CON_NOT_T3SYNC 0x04
3328 #define _T3CON_T3SYNC 0x04
3329 #define _T3CON_SOSCEN 0x08
3330 #define _T3CON_T3SOSCEN 0x08
3331 #define _T3CON_T3OSCEN 0x08
3332 #define _T3CON_T3CKPS0 0x10
3333 #define _T3CON_T3CKPS1 0x20
3334 #define _T3CON_TMR3CS0 0x40
3335 #define _T3CON_TMR3CS1 0x80
3337 //==============================================================================
3339 extern __at(0x0FB2) __sfr TMR3;
3340 extern __at(0x0FB2) __sfr TMR3L;
3341 extern __at(0x0FB3) __sfr TMR3H;
3343 //==============================================================================
3344 // T3GCON Bits
3346 extern __at(0x0FB4) __sfr T3GCON;
3348 typedef union
3350 struct
3352 unsigned T3GSS0 : 1;
3353 unsigned T3GSS1 : 1;
3354 unsigned T3GVAL : 1;
3355 unsigned T3GGO_NOT_T3DONE : 1;
3356 unsigned T3GSPM : 1;
3357 unsigned T3GTM : 1;
3358 unsigned T3GPOL : 1;
3359 unsigned TMR3GE : 1;
3362 struct
3364 unsigned : 1;
3365 unsigned : 1;
3366 unsigned : 1;
3367 unsigned T3GGO : 1;
3368 unsigned : 1;
3369 unsigned : 1;
3370 unsigned : 1;
3371 unsigned : 1;
3374 struct
3376 unsigned : 1;
3377 unsigned : 1;
3378 unsigned : 1;
3379 unsigned NOT_T3DONE : 1;
3380 unsigned : 1;
3381 unsigned : 1;
3382 unsigned : 1;
3383 unsigned : 1;
3386 struct
3388 unsigned : 1;
3389 unsigned : 1;
3390 unsigned : 1;
3391 unsigned T3DONE : 1;
3392 unsigned : 1;
3393 unsigned : 1;
3394 unsigned : 1;
3395 unsigned : 1;
3398 struct
3400 unsigned : 1;
3401 unsigned : 1;
3402 unsigned : 1;
3403 unsigned T3GGO_NOT_DONE : 1;
3404 unsigned : 1;
3405 unsigned : 1;
3406 unsigned : 1;
3407 unsigned : 1;
3410 struct
3412 unsigned T3GSS : 2;
3413 unsigned : 6;
3415 } __T3GCONbits_t;
3417 extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits;
3419 #define _T3GSS0 0x01
3420 #define _T3GSS1 0x02
3421 #define _T3GVAL 0x04
3422 #define _T3GGO_NOT_T3DONE 0x08
3423 #define _T3GGO 0x08
3424 #define _NOT_T3DONE 0x08
3425 #define _T3DONE 0x08
3426 #define _T3GGO_NOT_DONE 0x08
3427 #define _T3GSPM 0x10
3428 #define _T3GTM 0x20
3429 #define _T3GPOL 0x40
3430 #define _TMR3GE 0x80
3432 //==============================================================================
3435 //==============================================================================
3436 // ACTCON Bits
3438 extern __at(0x0FB5) __sfr ACTCON;
3440 typedef union
3442 struct
3444 unsigned : 1;
3445 unsigned ACTORS : 1;
3446 unsigned : 1;
3447 unsigned ACTLOCK : 1;
3448 unsigned ACTSRC : 1;
3449 unsigned : 1;
3450 unsigned ACTUD : 1;
3451 unsigned ACTEN : 1;
3454 struct
3456 unsigned : 1;
3457 unsigned STOR : 1;
3458 unsigned : 1;
3459 unsigned STLOCK : 1;
3460 unsigned STSRC : 1;
3461 unsigned : 1;
3462 unsigned STUD : 1;
3463 unsigned STEN : 1;
3466 struct
3468 unsigned : 1;
3469 unsigned ACTOR : 1;
3470 unsigned : 1;
3471 unsigned : 1;
3472 unsigned : 1;
3473 unsigned : 1;
3474 unsigned ACTD : 1;
3475 unsigned ACTSEL : 1;
3477 } __ACTCONbits_t;
3479 extern __at(0x0FB5) volatile __ACTCONbits_t ACTCONbits;
3481 #define _ACTORS 0x02
3482 #define _STOR 0x02
3483 #define _ACTOR 0x02
3484 #define _ACTLOCK 0x08
3485 #define _STLOCK 0x08
3486 #define _ACTSRC 0x10
3487 #define _STSRC 0x10
3488 #define _ACTUD 0x40
3489 #define _STUD 0x40
3490 #define _ACTD 0x40
3491 #define _ACTEN 0x80
3492 #define _STEN 0x80
3493 #define _ACTSEL 0x80
3495 //==============================================================================
3498 //==============================================================================
3499 // STCON Bits
3501 extern __at(0x0FB5) __sfr STCON;
3503 typedef union
3505 struct
3507 unsigned : 1;
3508 unsigned ACTORS : 1;
3509 unsigned : 1;
3510 unsigned ACTLOCK : 1;
3511 unsigned ACTSRC : 1;
3512 unsigned : 1;
3513 unsigned ACTUD : 1;
3514 unsigned ACTEN : 1;
3517 struct
3519 unsigned : 1;
3520 unsigned STOR : 1;
3521 unsigned : 1;
3522 unsigned STLOCK : 1;
3523 unsigned STSRC : 1;
3524 unsigned : 1;
3525 unsigned STUD : 1;
3526 unsigned STEN : 1;
3529 struct
3531 unsigned : 1;
3532 unsigned ACTOR : 1;
3533 unsigned : 1;
3534 unsigned : 1;
3535 unsigned : 1;
3536 unsigned : 1;
3537 unsigned ACTD : 1;
3538 unsigned ACTSEL : 1;
3540 } __STCONbits_t;
3542 extern __at(0x0FB5) volatile __STCONbits_t STCONbits;
3544 #define _STCON_ACTORS 0x02
3545 #define _STCON_STOR 0x02
3546 #define _STCON_ACTOR 0x02
3547 #define _STCON_ACTLOCK 0x08
3548 #define _STCON_STLOCK 0x08
3549 #define _STCON_ACTSRC 0x10
3550 #define _STCON_STSRC 0x10
3551 #define _STCON_ACTUD 0x40
3552 #define _STCON_STUD 0x40
3553 #define _STCON_ACTD 0x40
3554 #define _STCON_ACTEN 0x80
3555 #define _STCON_STEN 0x80
3556 #define _STCON_ACTSEL 0x80
3558 //==============================================================================
3561 //==============================================================================
3562 // ECCP1AS Bits
3564 extern __at(0x0FB6) __sfr ECCP1AS;
3566 typedef union
3568 struct
3570 unsigned PSS1BD0 : 1;
3571 unsigned PSS1BD1 : 1;
3572 unsigned PSS1AC0 : 1;
3573 unsigned PSS1AC1 : 1;
3574 unsigned ECCP1AS0 : 1;
3575 unsigned ECCP1AS1 : 1;
3576 unsigned ECCP1AS2 : 1;
3577 unsigned ECCP1ASE : 1;
3580 struct
3582 unsigned PSSBD0 : 1;
3583 unsigned PSSBD1 : 1;
3584 unsigned PSSAC0 : 1;
3585 unsigned PSSAC1 : 1;
3586 unsigned : 1;
3587 unsigned : 1;
3588 unsigned : 1;
3589 unsigned CCP1ASE : 1;
3592 struct
3594 unsigned PSS1BD : 2;
3595 unsigned : 6;
3598 struct
3600 unsigned PSSBD : 2;
3601 unsigned : 6;
3604 struct
3606 unsigned : 2;
3607 unsigned PSSAC : 2;
3608 unsigned : 4;
3611 struct
3613 unsigned : 2;
3614 unsigned PSS1AC : 2;
3615 unsigned : 4;
3618 struct
3620 unsigned : 4;
3621 unsigned ECCP1AS : 3;
3622 unsigned : 1;
3624 } __ECCP1ASbits_t;
3626 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
3628 #define _PSS1BD0 0x01
3629 #define _PSSBD0 0x01
3630 #define _PSS1BD1 0x02
3631 #define _PSSBD1 0x02
3632 #define _PSS1AC0 0x04
3633 #define _PSSAC0 0x04
3634 #define _PSS1AC1 0x08
3635 #define _PSSAC1 0x08
3636 #define _ECCP1AS0 0x10
3637 #define _ECCP1AS1 0x20
3638 #define _ECCP1AS2 0x40
3639 #define _ECCP1ASE 0x80
3640 #define _CCP1ASE 0x80
3642 //==============================================================================
3645 //==============================================================================
3646 // ECCP1DEL Bits
3648 extern __at(0x0FB7) __sfr ECCP1DEL;
3650 typedef union
3652 struct
3654 unsigned PDC0 : 1;
3655 unsigned PDC1 : 1;
3656 unsigned PDC2 : 1;
3657 unsigned PDC3 : 1;
3658 unsigned PDC4 : 1;
3659 unsigned PDC5 : 1;
3660 unsigned PDC6 : 1;
3661 unsigned P1RSEN : 1;
3664 struct
3666 unsigned : 1;
3667 unsigned : 1;
3668 unsigned : 1;
3669 unsigned : 1;
3670 unsigned : 1;
3671 unsigned : 1;
3672 unsigned : 1;
3673 unsigned PR1SEN : 1;
3676 struct
3678 unsigned PDC : 7;
3679 unsigned : 1;
3681 } __ECCP1DELbits_t;
3683 extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits;
3685 #define _PDC0 0x01
3686 #define _PDC1 0x02
3687 #define _PDC2 0x04
3688 #define _PDC3 0x08
3689 #define _PDC4 0x10
3690 #define _PDC5 0x20
3691 #define _PDC6 0x40
3692 #define _P1RSEN 0x80
3693 #define _PR1SEN 0x80
3695 //==============================================================================
3698 //==============================================================================
3699 // PWM1CON Bits
3701 extern __at(0x0FB7) __sfr PWM1CON;
3703 typedef union
3705 struct
3707 unsigned PDC0 : 1;
3708 unsigned PDC1 : 1;
3709 unsigned PDC2 : 1;
3710 unsigned PDC3 : 1;
3711 unsigned PDC4 : 1;
3712 unsigned PDC5 : 1;
3713 unsigned PDC6 : 1;
3714 unsigned P1RSEN : 1;
3717 struct
3719 unsigned : 1;
3720 unsigned : 1;
3721 unsigned : 1;
3722 unsigned : 1;
3723 unsigned : 1;
3724 unsigned : 1;
3725 unsigned : 1;
3726 unsigned PR1SEN : 1;
3729 struct
3731 unsigned PDC : 7;
3732 unsigned : 1;
3734 } __PWM1CONbits_t;
3736 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
3738 #define _PWM1CON_PDC0 0x01
3739 #define _PWM1CON_PDC1 0x02
3740 #define _PWM1CON_PDC2 0x04
3741 #define _PWM1CON_PDC3 0x08
3742 #define _PWM1CON_PDC4 0x10
3743 #define _PWM1CON_PDC5 0x20
3744 #define _PWM1CON_PDC6 0x40
3745 #define _PWM1CON_P1RSEN 0x80
3746 #define _PWM1CON_PR1SEN 0x80
3748 //==============================================================================
3751 //==============================================================================
3752 // BAUDCON Bits
3754 extern __at(0x0FB8) __sfr BAUDCON;
3756 typedef union
3758 struct
3760 unsigned ABDEN : 1;
3761 unsigned WUE : 1;
3762 unsigned : 1;
3763 unsigned BRG16 : 1;
3764 unsigned TXCKP : 1;
3765 unsigned RXDTP : 1;
3766 unsigned RCIDL : 1;
3767 unsigned ABDOVF : 1;
3770 struct
3772 unsigned : 1;
3773 unsigned : 1;
3774 unsigned : 1;
3775 unsigned : 1;
3776 unsigned CKTXP : 1;
3777 unsigned DTRXP : 1;
3778 unsigned RCMT : 1;
3779 unsigned : 1;
3782 struct
3784 unsigned : 1;
3785 unsigned : 1;
3786 unsigned : 1;
3787 unsigned : 1;
3788 unsigned SCKP : 1;
3789 unsigned : 1;
3790 unsigned : 1;
3791 unsigned : 1;
3793 } __BAUDCONbits_t;
3795 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
3797 #define _ABDEN 0x01
3798 #define _WUE 0x02
3799 #define _BRG16 0x08
3800 #define _TXCKP 0x10
3801 #define _CKTXP 0x10
3802 #define _SCKP 0x10
3803 #define _RXDTP 0x20
3804 #define _DTRXP 0x20
3805 #define _RCIDL 0x40
3806 #define _RCMT 0x40
3807 #define _ABDOVF 0x80
3809 //==============================================================================
3812 //==============================================================================
3813 // BAUDCON1 Bits
3815 extern __at(0x0FB8) __sfr BAUDCON1;
3817 typedef union
3819 struct
3821 unsigned ABDEN : 1;
3822 unsigned WUE : 1;
3823 unsigned : 1;
3824 unsigned BRG16 : 1;
3825 unsigned TXCKP : 1;
3826 unsigned RXDTP : 1;
3827 unsigned RCIDL : 1;
3828 unsigned ABDOVF : 1;
3831 struct
3833 unsigned : 1;
3834 unsigned : 1;
3835 unsigned : 1;
3836 unsigned : 1;
3837 unsigned CKTXP : 1;
3838 unsigned DTRXP : 1;
3839 unsigned RCMT : 1;
3840 unsigned : 1;
3843 struct
3845 unsigned : 1;
3846 unsigned : 1;
3847 unsigned : 1;
3848 unsigned : 1;
3849 unsigned SCKP : 1;
3850 unsigned : 1;
3851 unsigned : 1;
3852 unsigned : 1;
3854 } __BAUDCON1bits_t;
3856 extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits;
3858 #define _BAUDCON1_ABDEN 0x01
3859 #define _BAUDCON1_WUE 0x02
3860 #define _BAUDCON1_BRG16 0x08
3861 #define _BAUDCON1_TXCKP 0x10
3862 #define _BAUDCON1_CKTXP 0x10
3863 #define _BAUDCON1_SCKP 0x10
3864 #define _BAUDCON1_RXDTP 0x20
3865 #define _BAUDCON1_DTRXP 0x20
3866 #define _BAUDCON1_RCIDL 0x40
3867 #define _BAUDCON1_RCMT 0x40
3868 #define _BAUDCON1_ABDOVF 0x80
3870 //==============================================================================
3873 //==============================================================================
3874 // PSTR1CON Bits
3876 extern __at(0x0FB9) __sfr PSTR1CON;
3878 typedef union
3880 struct
3882 unsigned STRA : 1;
3883 unsigned STRB : 1;
3884 unsigned STRC : 1;
3885 unsigned STRD : 1;
3886 unsigned STRSYNC : 1;
3887 unsigned : 1;
3888 unsigned : 1;
3889 unsigned : 1;
3892 struct
3894 unsigned STR1A : 1;
3895 unsigned STR1B : 1;
3896 unsigned STR1C : 1;
3897 unsigned STR1D : 1;
3898 unsigned STR1SYNC : 1;
3899 unsigned : 1;
3900 unsigned : 1;
3901 unsigned : 1;
3903 } __PSTR1CONbits_t;
3905 extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits;
3907 #define _STRA 0x01
3908 #define _STR1A 0x01
3909 #define _STRB 0x02
3910 #define _STR1B 0x02
3911 #define _STRC 0x04
3912 #define _STR1C 0x04
3913 #define _STRD 0x08
3914 #define _STR1D 0x08
3915 #define _STRSYNC 0x10
3916 #define _STR1SYNC 0x10
3918 //==============================================================================
3921 //==============================================================================
3922 // T2CON Bits
3924 extern __at(0x0FBA) __sfr T2CON;
3926 typedef union
3928 struct
3930 unsigned T2CKPS0 : 1;
3931 unsigned T2CKPS1 : 1;
3932 unsigned TMR2ON : 1;
3933 unsigned T2OUTPS0 : 1;
3934 unsigned T2OUTPS1 : 1;
3935 unsigned T2OUTPS2 : 1;
3936 unsigned T2OUTPS3 : 1;
3937 unsigned : 1;
3940 struct
3942 unsigned T2CKPS : 2;
3943 unsigned : 6;
3946 struct
3948 unsigned : 3;
3949 unsigned T2OUTPS : 4;
3950 unsigned : 1;
3952 } __T2CONbits_t;
3954 extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits;
3956 #define _T2CKPS0 0x01
3957 #define _T2CKPS1 0x02
3958 #define _TMR2ON 0x04
3959 #define _T2OUTPS0 0x08
3960 #define _T2OUTPS1 0x10
3961 #define _T2OUTPS2 0x20
3962 #define _T2OUTPS3 0x40
3964 //==============================================================================
3966 extern __at(0x0FBB) __sfr PR2;
3967 extern __at(0x0FBC) __sfr TMR2;
3969 //==============================================================================
3970 // CCP1CON Bits
3972 extern __at(0x0FBD) __sfr CCP1CON;
3974 typedef union
3976 struct
3978 unsigned CCP1M0 : 1;
3979 unsigned CCP1M1 : 1;
3980 unsigned CCP1M2 : 1;
3981 unsigned CCP1M3 : 1;
3982 unsigned DC1B0 : 1;
3983 unsigned DC1B1 : 1;
3984 unsigned P1M0 : 1;
3985 unsigned P1M1 : 1;
3988 struct
3990 unsigned : 1;
3991 unsigned : 1;
3992 unsigned : 1;
3993 unsigned : 1;
3994 unsigned CCP1Y : 1;
3995 unsigned CCP1X : 1;
3996 unsigned : 1;
3997 unsigned : 1;
4000 struct
4002 unsigned CCP1M : 4;
4003 unsigned : 4;
4006 struct
4008 unsigned : 4;
4009 unsigned DC1B : 2;
4010 unsigned : 2;
4013 struct
4015 unsigned : 6;
4016 unsigned P1M : 2;
4018 } __CCP1CONbits_t;
4020 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
4022 #define _CCP1M0 0x01
4023 #define _CCP1M1 0x02
4024 #define _CCP1M2 0x04
4025 #define _CCP1M3 0x08
4026 #define _DC1B0 0x10
4027 #define _CCP1Y 0x10
4028 #define _DC1B1 0x20
4029 #define _CCP1X 0x20
4030 #define _P1M0 0x40
4031 #define _P1M1 0x80
4033 //==============================================================================
4036 //==============================================================================
4037 // ECCP1CON Bits
4039 extern __at(0x0FBD) __sfr ECCP1CON;
4041 typedef union
4043 struct
4045 unsigned CCP1M0 : 1;
4046 unsigned CCP1M1 : 1;
4047 unsigned CCP1M2 : 1;
4048 unsigned CCP1M3 : 1;
4049 unsigned DC1B0 : 1;
4050 unsigned DC1B1 : 1;
4051 unsigned P1M0 : 1;
4052 unsigned P1M1 : 1;
4055 struct
4057 unsigned : 1;
4058 unsigned : 1;
4059 unsigned : 1;
4060 unsigned : 1;
4061 unsigned CCP1Y : 1;
4062 unsigned CCP1X : 1;
4063 unsigned : 1;
4064 unsigned : 1;
4067 struct
4069 unsigned CCP1M : 4;
4070 unsigned : 4;
4073 struct
4075 unsigned : 4;
4076 unsigned DC1B : 2;
4077 unsigned : 2;
4080 struct
4082 unsigned : 6;
4083 unsigned P1M : 2;
4085 } __ECCP1CONbits_t;
4087 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
4089 #define _ECCP1CON_CCP1M0 0x01
4090 #define _ECCP1CON_CCP1M1 0x02
4091 #define _ECCP1CON_CCP1M2 0x04
4092 #define _ECCP1CON_CCP1M3 0x08
4093 #define _ECCP1CON_DC1B0 0x10
4094 #define _ECCP1CON_CCP1Y 0x10
4095 #define _ECCP1CON_DC1B1 0x20
4096 #define _ECCP1CON_CCP1X 0x20
4097 #define _ECCP1CON_P1M0 0x40
4098 #define _ECCP1CON_P1M1 0x80
4100 //==============================================================================
4102 extern __at(0x0FBE) __sfr CCPR1;
4103 extern __at(0x0FBE) __sfr CCPR1L;
4104 extern __at(0x0FBF) __sfr CCPR1H;
4106 //==============================================================================
4107 // ADCON2 Bits
4109 extern __at(0x0FC0) __sfr ADCON2;
4111 typedef union
4113 struct
4115 unsigned ADCS0 : 1;
4116 unsigned ADCS1 : 1;
4117 unsigned ADCS2 : 1;
4118 unsigned ACQT0 : 1;
4119 unsigned ACQT1 : 1;
4120 unsigned ACQT2 : 1;
4121 unsigned : 1;
4122 unsigned ADFM : 1;
4125 struct
4127 unsigned ADCS : 3;
4128 unsigned : 5;
4131 struct
4133 unsigned : 3;
4134 unsigned ACQT : 3;
4135 unsigned : 2;
4137 } __ADCON2bits_t;
4139 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4141 #define _ADCS0 0x01
4142 #define _ADCS1 0x02
4143 #define _ADCS2 0x04
4144 #define _ACQT0 0x08
4145 #define _ACQT1 0x10
4146 #define _ACQT2 0x20
4147 #define _ADFM 0x80
4149 //==============================================================================
4152 //==============================================================================
4153 // ADCON1 Bits
4155 extern __at(0x0FC1) __sfr ADCON1;
4157 typedef union
4159 struct
4161 unsigned NVCFG0 : 1;
4162 unsigned NVCFG1 : 1;
4163 unsigned PVCFG0 : 1;
4164 unsigned PVCFG1 : 1;
4165 unsigned : 1;
4166 unsigned : 1;
4167 unsigned : 1;
4168 unsigned TRIGSEL : 1;
4171 struct
4173 unsigned NVCFG : 2;
4174 unsigned : 6;
4177 struct
4179 unsigned : 2;
4180 unsigned PVCFG : 2;
4181 unsigned : 4;
4183 } __ADCON1bits_t;
4185 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4187 #define _NVCFG0 0x01
4188 #define _NVCFG1 0x02
4189 #define _PVCFG0 0x04
4190 #define _PVCFG1 0x08
4191 #define _TRIGSEL 0x80
4193 //==============================================================================
4196 //==============================================================================
4197 // ADCON0 Bits
4199 extern __at(0x0FC2) __sfr ADCON0;
4201 typedef union
4203 struct
4205 unsigned ADON : 1;
4206 unsigned GO_NOT_DONE : 1;
4207 unsigned : 1;
4208 unsigned : 1;
4209 unsigned : 1;
4210 unsigned : 1;
4211 unsigned : 1;
4212 unsigned : 1;
4215 struct
4217 unsigned : 1;
4218 unsigned DONE : 1;
4219 unsigned : 1;
4220 unsigned : 1;
4221 unsigned : 1;
4222 unsigned : 1;
4223 unsigned : 1;
4224 unsigned : 1;
4227 struct
4229 unsigned : 1;
4230 unsigned GO : 1;
4231 unsigned : 1;
4232 unsigned : 1;
4233 unsigned : 1;
4234 unsigned : 1;
4235 unsigned : 1;
4236 unsigned : 1;
4239 struct
4241 unsigned : 1;
4242 unsigned NOT_DONE : 1;
4243 unsigned : 1;
4244 unsigned : 1;
4245 unsigned : 1;
4246 unsigned : 1;
4247 unsigned : 1;
4248 unsigned : 1;
4250 } __ADCON0bits_t;
4252 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4254 #define _ADON 0x01
4255 #define _GO_NOT_DONE 0x02
4256 #define _DONE 0x02
4257 #define _GO 0x02
4258 #define _NOT_DONE 0x02
4260 //==============================================================================
4262 extern __at(0x0FC3) __sfr ADRESL;
4263 extern __at(0x0FC4) __sfr ADRESH;
4265 //==============================================================================
4266 // SSP1CON2 Bits
4268 extern __at(0x0FC5) __sfr SSP1CON2;
4270 typedef struct
4272 unsigned SEN : 1;
4273 unsigned RSEN : 1;
4274 unsigned PEN : 1;
4275 unsigned RCEN : 1;
4276 unsigned ACKEN : 1;
4277 unsigned ACKDT : 1;
4278 unsigned ACKSTAT : 1;
4279 unsigned GCEN : 1;
4280 } __SSP1CON2bits_t;
4282 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4284 #define _SEN 0x01
4285 #define _RSEN 0x02
4286 #define _PEN 0x04
4287 #define _RCEN 0x08
4288 #define _ACKEN 0x10
4289 #define _ACKDT 0x20
4290 #define _ACKSTAT 0x40
4291 #define _GCEN 0x80
4293 //==============================================================================
4296 //==============================================================================
4297 // SSPCON2 Bits
4299 extern __at(0x0FC5) __sfr SSPCON2;
4301 typedef struct
4303 unsigned SEN : 1;
4304 unsigned RSEN : 1;
4305 unsigned PEN : 1;
4306 unsigned RCEN : 1;
4307 unsigned ACKEN : 1;
4308 unsigned ACKDT : 1;
4309 unsigned ACKSTAT : 1;
4310 unsigned GCEN : 1;
4311 } __SSPCON2bits_t;
4313 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4315 #define _SSPCON2_SEN 0x01
4316 #define _SSPCON2_RSEN 0x02
4317 #define _SSPCON2_PEN 0x04
4318 #define _SSPCON2_RCEN 0x08
4319 #define _SSPCON2_ACKEN 0x10
4320 #define _SSPCON2_ACKDT 0x20
4321 #define _SSPCON2_ACKSTAT 0x40
4322 #define _SSPCON2_GCEN 0x80
4324 //==============================================================================
4327 //==============================================================================
4328 // SSP1CON1 Bits
4330 extern __at(0x0FC6) __sfr SSP1CON1;
4332 typedef union
4334 struct
4336 unsigned SSPM0 : 1;
4337 unsigned SSPM1 : 1;
4338 unsigned SSPM2 : 1;
4339 unsigned SSPM3 : 1;
4340 unsigned CKP : 1;
4341 unsigned SSPEN : 1;
4342 unsigned SSPOV : 1;
4343 unsigned WCOL : 1;
4346 struct
4348 unsigned SSPM : 4;
4349 unsigned : 4;
4351 } __SSP1CON1bits_t;
4353 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4355 #define _SSPM0 0x01
4356 #define _SSPM1 0x02
4357 #define _SSPM2 0x04
4358 #define _SSPM3 0x08
4359 #define _CKP 0x10
4360 #define _SSPEN 0x20
4361 #define _SSPOV 0x40
4362 #define _WCOL 0x80
4364 //==============================================================================
4367 //==============================================================================
4368 // SSPCON Bits
4370 extern __at(0x0FC6) __sfr SSPCON;
4372 typedef union
4374 struct
4376 unsigned SSPM0 : 1;
4377 unsigned SSPM1 : 1;
4378 unsigned SSPM2 : 1;
4379 unsigned SSPM3 : 1;
4380 unsigned CKP : 1;
4381 unsigned SSPEN : 1;
4382 unsigned SSPOV : 1;
4383 unsigned WCOL : 1;
4386 struct
4388 unsigned SSPM : 4;
4389 unsigned : 4;
4391 } __SSPCONbits_t;
4393 extern __at(0x0FC6) volatile __SSPCONbits_t SSPCONbits;
4395 #define _SSPCON_SSPM0 0x01
4396 #define _SSPCON_SSPM1 0x02
4397 #define _SSPCON_SSPM2 0x04
4398 #define _SSPCON_SSPM3 0x08
4399 #define _SSPCON_CKP 0x10
4400 #define _SSPCON_SSPEN 0x20
4401 #define _SSPCON_SSPOV 0x40
4402 #define _SSPCON_WCOL 0x80
4404 //==============================================================================
4407 //==============================================================================
4408 // SSPCON1 Bits
4410 extern __at(0x0FC6) __sfr SSPCON1;
4412 typedef union
4414 struct
4416 unsigned SSPM0 : 1;
4417 unsigned SSPM1 : 1;
4418 unsigned SSPM2 : 1;
4419 unsigned SSPM3 : 1;
4420 unsigned CKP : 1;
4421 unsigned SSPEN : 1;
4422 unsigned SSPOV : 1;
4423 unsigned WCOL : 1;
4426 struct
4428 unsigned SSPM : 4;
4429 unsigned : 4;
4431 } __SSPCON1bits_t;
4433 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4435 #define _SSPCON1_SSPM0 0x01
4436 #define _SSPCON1_SSPM1 0x02
4437 #define _SSPCON1_SSPM2 0x04
4438 #define _SSPCON1_SSPM3 0x08
4439 #define _SSPCON1_CKP 0x10
4440 #define _SSPCON1_SSPEN 0x20
4441 #define _SSPCON1_SSPOV 0x40
4442 #define _SSPCON1_WCOL 0x80
4444 //==============================================================================
4447 //==============================================================================
4448 // SSP1STAT Bits
4450 extern __at(0x0FC7) __sfr SSP1STAT;
4452 typedef struct
4454 unsigned BF : 1;
4455 unsigned UA : 1;
4456 unsigned R_NOT_W : 1;
4457 unsigned S : 1;
4458 unsigned P : 1;
4459 unsigned D_NOT_A : 1;
4460 unsigned CKE : 1;
4461 unsigned SMP : 1;
4462 } __SSP1STATbits_t;
4464 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4466 #define _BF 0x01
4467 #define _UA 0x02
4468 #define _R_NOT_W 0x04
4469 #define _S 0x08
4470 #define _P 0x10
4471 #define _D_NOT_A 0x20
4472 #define _CKE 0x40
4473 #define _SMP 0x80
4475 //==============================================================================
4478 //==============================================================================
4479 // SSPSTAT Bits
4481 extern __at(0x0FC7) __sfr SSPSTAT;
4483 typedef struct
4485 unsigned BF : 1;
4486 unsigned UA : 1;
4487 unsigned R_NOT_W : 1;
4488 unsigned S : 1;
4489 unsigned P : 1;
4490 unsigned D_NOT_A : 1;
4491 unsigned CKE : 1;
4492 unsigned SMP : 1;
4493 } __SSPSTATbits_t;
4495 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
4497 #define _SSPSTAT_BF 0x01
4498 #define _SSPSTAT_UA 0x02
4499 #define _SSPSTAT_R_NOT_W 0x04
4500 #define _SSPSTAT_S 0x08
4501 #define _SSPSTAT_P 0x10
4502 #define _SSPSTAT_D_NOT_A 0x20
4503 #define _SSPSTAT_CKE 0x40
4504 #define _SSPSTAT_SMP 0x80
4506 //==============================================================================
4509 //==============================================================================
4510 // SSP1ADD Bits
4512 extern __at(0x0FC8) __sfr SSP1ADD;
4514 typedef struct
4516 unsigned SSP1ADD0 : 1;
4517 unsigned SSP1ADD1 : 1;
4518 unsigned SSP1ADD2 : 1;
4519 unsigned SSP1ADD3 : 1;
4520 unsigned SSP1ADD4 : 1;
4521 unsigned SSP1ADD5 : 1;
4522 unsigned SSP1ADD6 : 1;
4523 unsigned SSP1ADD7 : 1;
4524 } __SSP1ADDbits_t;
4526 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
4528 #define _SSP1ADD0 0x01
4529 #define _SSP1ADD1 0x02
4530 #define _SSP1ADD2 0x04
4531 #define _SSP1ADD3 0x08
4532 #define _SSP1ADD4 0x10
4533 #define _SSP1ADD5 0x20
4534 #define _SSP1ADD6 0x40
4535 #define _SSP1ADD7 0x80
4537 //==============================================================================
4540 //==============================================================================
4541 // SSPADD Bits
4543 extern __at(0x0FC8) __sfr SSPADD;
4545 typedef struct
4547 unsigned SSP1ADD0 : 1;
4548 unsigned SSP1ADD1 : 1;
4549 unsigned SSP1ADD2 : 1;
4550 unsigned SSP1ADD3 : 1;
4551 unsigned SSP1ADD4 : 1;
4552 unsigned SSP1ADD5 : 1;
4553 unsigned SSP1ADD6 : 1;
4554 unsigned SSP1ADD7 : 1;
4555 } __SSPADDbits_t;
4557 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
4559 #define _SSPADD_SSP1ADD0 0x01
4560 #define _SSPADD_SSP1ADD1 0x02
4561 #define _SSPADD_SSP1ADD2 0x04
4562 #define _SSPADD_SSP1ADD3 0x08
4563 #define _SSPADD_SSP1ADD4 0x10
4564 #define _SSPADD_SSP1ADD5 0x20
4565 #define _SSPADD_SSP1ADD6 0x40
4566 #define _SSPADD_SSP1ADD7 0x80
4568 //==============================================================================
4570 extern __at(0x0FC9) __sfr SSP1BUF;
4571 extern __at(0x0FC9) __sfr SSPBUF;
4573 //==============================================================================
4574 // SSP1MSK Bits
4576 extern __at(0x0FCA) __sfr SSP1MSK;
4578 typedef struct
4580 unsigned SSP1MSK0 : 1;
4581 unsigned SSP1MSK1 : 1;
4582 unsigned SSP1MSK2 : 1;
4583 unsigned SSP1MSK3 : 1;
4584 unsigned SSP1MSK4 : 1;
4585 unsigned SSP1MSK5 : 1;
4586 unsigned SSP1MSK6 : 1;
4587 unsigned SSP1MSK7 : 1;
4588 } __SSP1MSKbits_t;
4590 extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits;
4592 #define _SSP1MSK0 0x01
4593 #define _SSP1MSK1 0x02
4594 #define _SSP1MSK2 0x04
4595 #define _SSP1MSK3 0x08
4596 #define _SSP1MSK4 0x10
4597 #define _SSP1MSK5 0x20
4598 #define _SSP1MSK6 0x40
4599 #define _SSP1MSK7 0x80
4601 //==============================================================================
4604 //==============================================================================
4605 // SSPMSK Bits
4607 extern __at(0x0FCA) __sfr SSPMSK;
4609 typedef struct
4611 unsigned SSP1MSK0 : 1;
4612 unsigned SSP1MSK1 : 1;
4613 unsigned SSP1MSK2 : 1;
4614 unsigned SSP1MSK3 : 1;
4615 unsigned SSP1MSK4 : 1;
4616 unsigned SSP1MSK5 : 1;
4617 unsigned SSP1MSK6 : 1;
4618 unsigned SSP1MSK7 : 1;
4619 } __SSPMSKbits_t;
4621 extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits;
4623 #define _SSPMSK_SSP1MSK0 0x01
4624 #define _SSPMSK_SSP1MSK1 0x02
4625 #define _SSPMSK_SSP1MSK2 0x04
4626 #define _SSPMSK_SSP1MSK3 0x08
4627 #define _SSPMSK_SSP1MSK4 0x10
4628 #define _SSPMSK_SSP1MSK5 0x20
4629 #define _SSPMSK_SSP1MSK6 0x40
4630 #define _SSPMSK_SSP1MSK7 0x80
4632 //==============================================================================
4635 //==============================================================================
4636 // SSP1CON3 Bits
4638 extern __at(0x0FCB) __sfr SSP1CON3;
4640 typedef struct
4642 unsigned DHEN : 1;
4643 unsigned AHEN : 1;
4644 unsigned SBCDE : 1;
4645 unsigned SDAHT : 1;
4646 unsigned BOEN : 1;
4647 unsigned SCIE : 1;
4648 unsigned PCIE : 1;
4649 unsigned ACKTIM : 1;
4650 } __SSP1CON3bits_t;
4652 extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits;
4654 #define _DHEN 0x01
4655 #define _AHEN 0x02
4656 #define _SBCDE 0x04
4657 #define _SDAHT 0x08
4658 #define _BOEN 0x10
4659 #define _SCIE 0x20
4660 #define _PCIE 0x40
4661 #define _ACKTIM 0x80
4663 //==============================================================================
4666 //==============================================================================
4667 // SSPCON3 Bits
4669 extern __at(0x0FCB) __sfr SSPCON3;
4671 typedef struct
4673 unsigned DHEN : 1;
4674 unsigned AHEN : 1;
4675 unsigned SBCDE : 1;
4676 unsigned SDAHT : 1;
4677 unsigned BOEN : 1;
4678 unsigned SCIE : 1;
4679 unsigned PCIE : 1;
4680 unsigned ACKTIM : 1;
4681 } __SSPCON3bits_t;
4683 extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits;
4685 #define _SSPCON3_DHEN 0x01
4686 #define _SSPCON3_AHEN 0x02
4687 #define _SSPCON3_SBCDE 0x04
4688 #define _SSPCON3_SDAHT 0x08
4689 #define _SSPCON3_BOEN 0x10
4690 #define _SSPCON3_SCIE 0x20
4691 #define _SSPCON3_PCIE 0x40
4692 #define _SSPCON3_ACKTIM 0x80
4694 //==============================================================================
4697 //==============================================================================
4698 // T1GCON Bits
4700 extern __at(0x0FCC) __sfr T1GCON;
4702 typedef union
4704 struct
4706 unsigned T1GSS0 : 1;
4707 unsigned T1GSS1 : 1;
4708 unsigned T1GVAL : 1;
4709 unsigned T1GGO_NOT_T1DONE : 1;
4710 unsigned T1GSPM : 1;
4711 unsigned T1GTM : 1;
4712 unsigned T1GPOL : 1;
4713 unsigned TMR1GE : 1;
4716 struct
4718 unsigned : 1;
4719 unsigned : 1;
4720 unsigned : 1;
4721 unsigned T1GGO : 1;
4722 unsigned : 1;
4723 unsigned : 1;
4724 unsigned : 1;
4725 unsigned : 1;
4728 struct
4730 unsigned : 1;
4731 unsigned : 1;
4732 unsigned : 1;
4733 unsigned NOT_T1DONE : 1;
4734 unsigned : 1;
4735 unsigned : 1;
4736 unsigned : 1;
4737 unsigned : 1;
4740 struct
4742 unsigned : 1;
4743 unsigned : 1;
4744 unsigned : 1;
4745 unsigned T1DONE : 1;
4746 unsigned : 1;
4747 unsigned : 1;
4748 unsigned : 1;
4749 unsigned : 1;
4752 struct
4754 unsigned : 1;
4755 unsigned : 1;
4756 unsigned : 1;
4757 unsigned T1GGO_NOT_DONE : 1;
4758 unsigned : 1;
4759 unsigned : 1;
4760 unsigned : 1;
4761 unsigned : 1;
4764 struct
4766 unsigned T1GSS : 2;
4767 unsigned : 6;
4769 } __T1GCONbits_t;
4771 extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits;
4773 #define _T1GSS0 0x01
4774 #define _T1GSS1 0x02
4775 #define _T1GVAL 0x04
4776 #define _T1GGO_NOT_T1DONE 0x08
4777 #define _T1GGO 0x08
4778 #define _NOT_T1DONE 0x08
4779 #define _T1DONE 0x08
4780 #define _T1GGO_NOT_DONE 0x08
4781 #define _T1GSPM 0x10
4782 #define _T1GTM 0x20
4783 #define _T1GPOL 0x40
4784 #define _TMR1GE 0x80
4786 //==============================================================================
4789 //==============================================================================
4790 // T1CON Bits
4792 extern __at(0x0FCD) __sfr T1CON;
4794 typedef union
4796 struct
4798 unsigned TMR1ON : 1;
4799 unsigned RD16 : 1;
4800 unsigned NOT_T1SYNC : 1;
4801 unsigned SOSCEN : 1;
4802 unsigned T1CKPS0 : 1;
4803 unsigned T1CKPS1 : 1;
4804 unsigned TMR1CS0 : 1;
4805 unsigned TMR1CS1 : 1;
4808 struct
4810 unsigned : 1;
4811 unsigned T1RD16 : 1;
4812 unsigned T1SYNC : 1;
4813 unsigned T1SOSCEN : 1;
4814 unsigned : 1;
4815 unsigned : 1;
4816 unsigned : 1;
4817 unsigned : 1;
4820 struct
4822 unsigned : 1;
4823 unsigned : 1;
4824 unsigned : 1;
4825 unsigned T1OSCEN : 1;
4826 unsigned : 1;
4827 unsigned : 1;
4828 unsigned : 1;
4829 unsigned : 1;
4832 struct
4834 unsigned : 4;
4835 unsigned T1CKPS : 2;
4836 unsigned : 2;
4839 struct
4841 unsigned : 6;
4842 unsigned TMR1CS : 2;
4844 } __T1CONbits_t;
4846 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
4848 #define _TMR1ON 0x01
4849 #define _RD16 0x02
4850 #define _T1RD16 0x02
4851 #define _NOT_T1SYNC 0x04
4852 #define _T1SYNC 0x04
4853 #define _SOSCEN 0x08
4854 #define _T1SOSCEN 0x08
4855 #define _T1OSCEN 0x08
4856 #define _T1CKPS0 0x10
4857 #define _T1CKPS1 0x20
4858 #define _TMR1CS0 0x40
4859 #define _TMR1CS1 0x80
4861 //==============================================================================
4863 extern __at(0x0FCE) __sfr TMR1;
4864 extern __at(0x0FCE) __sfr TMR1L;
4865 extern __at(0x0FCF) __sfr TMR1H;
4867 //==============================================================================
4868 // RCON Bits
4870 extern __at(0x0FD0) __sfr RCON;
4872 typedef union
4874 struct
4876 unsigned NOT_BOR : 1;
4877 unsigned NOT_POR : 1;
4878 unsigned NOT_PD : 1;
4879 unsigned NOT_TO : 1;
4880 unsigned NOT_RI : 1;
4881 unsigned : 1;
4882 unsigned SBOREN : 1;
4883 unsigned IPEN : 1;
4886 struct
4888 unsigned BOR : 1;
4889 unsigned POR : 1;
4890 unsigned PD : 1;
4891 unsigned TO : 1;
4892 unsigned RI : 1;
4893 unsigned : 1;
4894 unsigned : 1;
4895 unsigned : 1;
4897 } __RCONbits_t;
4899 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
4901 #define _NOT_BOR 0x01
4902 #define _BOR 0x01
4903 #define _NOT_POR 0x02
4904 #define _POR 0x02
4905 #define _NOT_PD 0x04
4906 #define _PD 0x04
4907 #define _NOT_TO 0x08
4908 #define _TO 0x08
4909 #define _NOT_RI 0x10
4910 #define _RI 0x10
4911 #define _SBOREN 0x40
4912 #define _IPEN 0x80
4914 //==============================================================================
4917 //==============================================================================
4918 // WDTCON Bits
4920 extern __at(0x0FD1) __sfr WDTCON;
4922 typedef union
4924 struct
4926 unsigned SWDTEN : 1;
4927 unsigned : 1;
4928 unsigned : 1;
4929 unsigned : 1;
4930 unsigned : 1;
4931 unsigned : 1;
4932 unsigned : 1;
4933 unsigned : 1;
4936 struct
4938 unsigned SWDTE : 1;
4939 unsigned : 1;
4940 unsigned : 1;
4941 unsigned : 1;
4942 unsigned : 1;
4943 unsigned : 1;
4944 unsigned : 1;
4945 unsigned : 1;
4947 } __WDTCONbits_t;
4949 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
4951 #define _SWDTEN 0x01
4952 #define _SWDTE 0x01
4954 //==============================================================================
4957 //==============================================================================
4958 // OSCCON2 Bits
4960 extern __at(0x0FD2) __sfr OSCCON2;
4962 typedef struct
4964 unsigned LFIOFS : 1;
4965 unsigned HFIOFR : 1;
4966 unsigned PRISD : 1;
4967 unsigned SOSCGO : 1;
4968 unsigned PLLEN : 1;
4969 unsigned INTSRC : 1;
4970 unsigned SOSCRUN : 1;
4971 unsigned PLLRDY : 1;
4972 } __OSCCON2bits_t;
4974 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
4976 #define _LFIOFS 0x01
4977 #define _HFIOFR 0x02
4978 #define _PRISD 0x04
4979 #define _SOSCGO 0x08
4980 #define _PLLEN 0x10
4981 #define _INTSRC 0x20
4982 #define _SOSCRUN 0x40
4983 #define _PLLRDY 0x80
4985 //==============================================================================
4988 //==============================================================================
4989 // OSCCON Bits
4991 extern __at(0x0FD3) __sfr OSCCON;
4993 typedef union
4995 struct
4997 unsigned SCS0 : 1;
4998 unsigned SCS1 : 1;
4999 unsigned HFIOFS : 1;
5000 unsigned OSTS : 1;
5001 unsigned IRCF0 : 1;
5002 unsigned IRCF1 : 1;
5003 unsigned IRCF2 : 1;
5004 unsigned IDLEN : 1;
5007 struct
5009 unsigned : 1;
5010 unsigned : 1;
5011 unsigned FLTS : 1;
5012 unsigned : 1;
5013 unsigned : 1;
5014 unsigned : 1;
5015 unsigned : 1;
5016 unsigned : 1;
5019 struct
5021 unsigned SCS : 2;
5022 unsigned : 6;
5025 struct
5027 unsigned : 4;
5028 unsigned IRCF : 3;
5029 unsigned : 1;
5031 } __OSCCONbits_t;
5033 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5035 #define _SCS0 0x01
5036 #define _SCS1 0x02
5037 #define _HFIOFS 0x04
5038 #define _FLTS 0x04
5039 #define _OSTS 0x08
5040 #define _IRCF0 0x10
5041 #define _IRCF1 0x20
5042 #define _IRCF2 0x40
5043 #define _IDLEN 0x80
5045 //==============================================================================
5048 //==============================================================================
5049 // T0CON Bits
5051 extern __at(0x0FD5) __sfr T0CON;
5053 typedef union
5055 struct
5057 unsigned T0PS0 : 1;
5058 unsigned T0PS1 : 1;
5059 unsigned T0PS2 : 1;
5060 unsigned PSA : 1;
5061 unsigned T0SE : 1;
5062 unsigned T0CS : 1;
5063 unsigned T08BIT : 1;
5064 unsigned TMR0ON : 1;
5067 struct
5069 unsigned T0PS : 3;
5070 unsigned : 5;
5072 } __T0CONbits_t;
5074 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5076 #define _T0PS0 0x01
5077 #define _T0PS1 0x02
5078 #define _T0PS2 0x04
5079 #define _PSA 0x08
5080 #define _T0SE 0x10
5081 #define _T0CS 0x20
5082 #define _T08BIT 0x40
5083 #define _TMR0ON 0x80
5085 //==============================================================================
5087 extern __at(0x0FD6) __sfr TMR0;
5088 extern __at(0x0FD6) __sfr TMR0L;
5089 extern __at(0x0FD7) __sfr TMR0H;
5091 //==============================================================================
5092 // STATUS Bits
5094 extern __at(0x0FD8) __sfr STATUS;
5096 typedef struct
5098 unsigned C : 1;
5099 unsigned DC : 1;
5100 unsigned Z : 1;
5101 unsigned OV : 1;
5102 unsigned N : 1;
5103 unsigned : 1;
5104 unsigned : 1;
5105 unsigned : 1;
5106 } __STATUSbits_t;
5108 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5110 #define _C 0x01
5111 #define _DC 0x02
5112 #define _Z 0x04
5113 #define _OV 0x08
5114 #define _N 0x10
5116 //==============================================================================
5118 extern __at(0x0FD9) __sfr FSR2L;
5119 extern __at(0x0FDA) __sfr FSR2H;
5120 extern __at(0x0FDB) __sfr PLUSW2;
5121 extern __at(0x0FDC) __sfr PREINC2;
5122 extern __at(0x0FDD) __sfr POSTDEC2;
5123 extern __at(0x0FDE) __sfr POSTINC2;
5124 extern __at(0x0FDF) __sfr INDF2;
5125 extern __at(0x0FE0) __sfr BSR;
5126 extern __at(0x0FE1) __sfr FSR1L;
5127 extern __at(0x0FE2) __sfr FSR1H;
5128 extern __at(0x0FE3) __sfr PLUSW1;
5129 extern __at(0x0FE4) __sfr PREINC1;
5130 extern __at(0x0FE5) __sfr POSTDEC1;
5131 extern __at(0x0FE6) __sfr POSTINC1;
5132 extern __at(0x0FE7) __sfr INDF1;
5133 extern __at(0x0FE8) __sfr WREG;
5134 extern __at(0x0FE9) __sfr FSR0L;
5135 extern __at(0x0FEA) __sfr FSR0H;
5136 extern __at(0x0FEB) __sfr PLUSW0;
5137 extern __at(0x0FEC) __sfr PREINC0;
5138 extern __at(0x0FED) __sfr POSTDEC0;
5139 extern __at(0x0FEE) __sfr POSTINC0;
5140 extern __at(0x0FEF) __sfr INDF0;
5142 //==============================================================================
5143 // INTCON3 Bits
5145 extern __at(0x0FF0) __sfr INTCON3;
5147 typedef union
5149 struct
5151 unsigned INT1IF : 1;
5152 unsigned INT2IF : 1;
5153 unsigned : 1;
5154 unsigned INT1IE : 1;
5155 unsigned INT2IE : 1;
5156 unsigned : 1;
5157 unsigned INT1IP : 1;
5158 unsigned INT2IP : 1;
5161 struct
5163 unsigned INT1F : 1;
5164 unsigned INT2F : 1;
5165 unsigned : 1;
5166 unsigned INT1E : 1;
5167 unsigned INT2E : 1;
5168 unsigned : 1;
5169 unsigned INT1P : 1;
5170 unsigned INT2P : 1;
5172 } __INTCON3bits_t;
5174 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5176 #define _INT1IF 0x01
5177 #define _INT1F 0x01
5178 #define _INT2IF 0x02
5179 #define _INT2F 0x02
5180 #define _INT1IE 0x08
5181 #define _INT1E 0x08
5182 #define _INT2IE 0x10
5183 #define _INT2E 0x10
5184 #define _INT1IP 0x40
5185 #define _INT1P 0x40
5186 #define _INT2IP 0x80
5187 #define _INT2P 0x80
5189 //==============================================================================
5192 //==============================================================================
5193 // INTCON2 Bits
5195 extern __at(0x0FF1) __sfr INTCON2;
5197 typedef union
5199 struct
5201 unsigned IOCIP : 1;
5202 unsigned : 1;
5203 unsigned TMR0IP : 1;
5204 unsigned : 1;
5205 unsigned INTEDG2 : 1;
5206 unsigned INTEDG1 : 1;
5207 unsigned INTEDG0 : 1;
5208 unsigned NOT_RBPU : 1;
5211 struct
5213 unsigned : 1;
5214 unsigned : 1;
5215 unsigned T0IP : 1;
5216 unsigned : 1;
5217 unsigned : 1;
5218 unsigned : 1;
5219 unsigned : 1;
5220 unsigned RBPU : 1;
5222 } __INTCON2bits_t;
5224 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5226 #define _IOCIP 0x01
5227 #define _TMR0IP 0x04
5228 #define _T0IP 0x04
5229 #define _INTEDG2 0x10
5230 #define _INTEDG1 0x20
5231 #define _INTEDG0 0x40
5232 #define _NOT_RBPU 0x80
5233 #define _RBPU 0x80
5235 //==============================================================================
5238 //==============================================================================
5239 // INTCON Bits
5241 extern __at(0x0FF2) __sfr INTCON;
5243 typedef union
5245 struct
5247 unsigned IOCIF : 1;
5248 unsigned INT0IF : 1;
5249 unsigned TMR0IF : 1;
5250 unsigned IOCIE : 1;
5251 unsigned INT0IE : 1;
5252 unsigned TMR0IE : 1;
5253 unsigned PEIE_GIEL : 1;
5254 unsigned GIE_GIEH : 1;
5257 struct
5259 unsigned : 1;
5260 unsigned INT0F : 1;
5261 unsigned T0IF : 1;
5262 unsigned : 1;
5263 unsigned INT0E : 1;
5264 unsigned T0IE : 1;
5265 unsigned PEIE : 1;
5266 unsigned GIE : 1;
5269 struct
5271 unsigned : 1;
5272 unsigned : 1;
5273 unsigned : 1;
5274 unsigned : 1;
5275 unsigned : 1;
5276 unsigned : 1;
5277 unsigned GIEL : 1;
5278 unsigned GIEH : 1;
5280 } __INTCONbits_t;
5282 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5284 #define _IOCIF 0x01
5285 #define _INT0IF 0x02
5286 #define _INT0F 0x02
5287 #define _TMR0IF 0x04
5288 #define _T0IF 0x04
5289 #define _IOCIE 0x08
5290 #define _INT0IE 0x10
5291 #define _INT0E 0x10
5292 #define _TMR0IE 0x20
5293 #define _T0IE 0x20
5294 #define _PEIE_GIEL 0x40
5295 #define _PEIE 0x40
5296 #define _GIEL 0x40
5297 #define _GIE_GIEH 0x80
5298 #define _GIE 0x80
5299 #define _GIEH 0x80
5301 //==============================================================================
5303 extern __at(0x0FF3) __sfr PROD;
5304 extern __at(0x0FF3) __sfr PRODL;
5305 extern __at(0x0FF4) __sfr PRODH;
5306 extern __at(0x0FF5) __sfr TABLAT;
5307 extern __at(0x0FF6) __sfr TBLPTR;
5308 extern __at(0x0FF6) __sfr TBLPTRL;
5309 extern __at(0x0FF7) __sfr TBLPTRH;
5310 extern __at(0x0FF8) __sfr TBLPTRU;
5311 extern __at(0x0FF9) __sfr PC;
5312 extern __at(0x0FF9) __sfr PCL;
5313 extern __at(0x0FFA) __sfr PCLATH;
5314 extern __at(0x0FFB) __sfr PCLATU;
5316 //==============================================================================
5317 // STKPTR Bits
5319 extern __at(0x0FFC) __sfr STKPTR;
5321 typedef union
5323 struct
5325 unsigned SP0 : 1;
5326 unsigned SP1 : 1;
5327 unsigned SP2 : 1;
5328 unsigned SP3 : 1;
5329 unsigned SP4 : 1;
5330 unsigned : 1;
5331 unsigned STKUNF : 1;
5332 unsigned STKFUL : 1;
5335 struct
5337 unsigned : 1;
5338 unsigned : 1;
5339 unsigned : 1;
5340 unsigned : 1;
5341 unsigned : 1;
5342 unsigned : 1;
5343 unsigned : 1;
5344 unsigned STKOVF : 1;
5347 struct
5349 unsigned SP : 5;
5350 unsigned : 3;
5352 } __STKPTRbits_t;
5354 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5356 #define _SP0 0x01
5357 #define _SP1 0x02
5358 #define _SP2 0x04
5359 #define _SP3 0x08
5360 #define _SP4 0x10
5361 #define _STKUNF 0x40
5362 #define _STKFUL 0x80
5363 #define _STKOVF 0x80
5365 //==============================================================================
5367 extern __at(0x0FFD) __sfr TOS;
5368 extern __at(0x0FFD) __sfr TOSL;
5369 extern __at(0x0FFE) __sfr TOSH;
5370 extern __at(0x0FFF) __sfr TOSU;
5372 //==============================================================================
5374 // Configuration Bits
5376 //==============================================================================
5378 #define __CONFIG1L 0x300000
5379 #define __CONFIG1H 0x300001
5380 #define __CONFIG2L 0x300002
5381 #define __CONFIG2H 0x300003
5382 #define __CONFIG3H 0x300005
5383 #define __CONFIG4L 0x300006
5384 #define __CONFIG5L 0x300008
5385 #define __CONFIG5H 0x300009
5386 #define __CONFIG6L 0x30000A
5387 #define __CONFIG6H 0x30000B
5388 #define __CONFIG7L 0x30000C
5389 #define __CONFIG7H 0x30000D
5391 //----------------------------- CONFIG1L Options -------------------------------
5393 #define _PLLSEL_PLL4X_1L 0xFE // 4x clock multiplier.
5394 #define _PLLSEL_PLL3X_1L 0xFF // 3x clock multiplier.
5395 #define _CFGPLLEN_OFF_1L 0xFD // PLL Disabled (firmware controlled).
5396 #define _CFGPLLEN_ON_1L 0xFF // PLL Enabled.
5397 #define _CPUDIV_NOCLKDIV_1L 0xE7 // CPU uses system clock (no divide).
5398 #define _CPUDIV_CLKDIV2_1L 0xEF // CPU uses system clock divided by 2.
5399 #define _CPUDIV_CLKDIV3_1L 0xF7 // CPU uses system clock divided by 3.
5400 #define _CPUDIV_CLKDIV6_1L 0xFF // CPU uses system clock divided by 6.
5401 #define _LS48MHZ_SYS24X4_1L 0xDF // System clock at 24 MHz, USB clock divider is set to 4.
5402 #define _LS48MHZ_SYS48X8_1L 0xFF // System clock at 48 MHz, USB clock divider is set to 8.
5404 //----------------------------- CONFIG1H Options -------------------------------
5406 #define _FOSC_LP_1H 0xF0 // LP oscillator.
5407 #define _FOSC_XT_1H 0xF1 // XT oscillator.
5408 #define _FOSC_HSH_1H 0xF2 // HS oscillator, high power 16MHz to 25MHz.
5409 #define _FOSC_HSM_1H 0xF3 // HS oscillator, medium power 4MHz to 16MHz.
5410 #define _FOSC_ECHCLKO_1H 0xF4 // EC oscillator, high power 16MHz to 48MHz, clock output on OSC2.
5411 #define _FOSC_ECHIO_1H 0xF5 // EC oscillator, high power 16MHz to 48MHz.
5412 #define _FOSC_RCCLKO_1H 0xF6 // External RC oscillator, clock output on OSC2.
5413 #define _FOSC_RCIO_1H 0xF7 // External RC oscillator.
5414 #define _FOSC_INTOSCIO_1H 0xF8 // Internal oscillator.
5415 #define _FOSC_INTOSCCLKO_1H 0xF9 // Internal oscillator, clock output on OSC2.
5416 #define _FOSC_ECMCLKO_1H 0xFA // EC oscillator, medium power 4MHz to 16MHz, clock output on OSC2.
5417 #define _FOSC_ECMIO_1H 0xFB // EC oscillator, medium power 4MHz to 16MHz.
5418 #define _FOSC_ECLCLKO_1H 0xFC // EC oscillator, low power <4MHz, clock output on OSC2.
5419 #define _FOSC_ECLIO_1H 0xFD // EC oscillator, low power <4MHz.
5420 #define _PCLKEN_OFF_1H 0xDF // Primary oscillator shutdown firmware controlled.
5421 #define _PCLKEN_ON_1H 0xFF // Primary oscillator enabled.
5422 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
5423 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
5424 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
5425 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
5427 //----------------------------- CONFIG2L Options -------------------------------
5429 #define _nPWRTEN_ON_2L 0xFE // Power up timer enabled.
5430 #define _nPWRTEN_OFF_2L 0xFF // Power up timer disabled.
5431 #define _BOREN_OFF_2L 0xF9 // BOR disabled in hardware (SBOREN is ignored).
5432 #define _BOREN_ON_2L 0xFB // BOR controlled by firmware (SBOREN is enabled).
5433 #define _BOREN_NOSLP_2L 0xFD // BOR enabled in hardware, disabled in Sleep mode (SBOREN is ignored).
5434 #define _BOREN_SBORDIS_2L 0xFF // BOR enabled in hardware (SBOREN is ignored).
5435 #define _BORV_285_2L 0xE7 // BOR set to 2.85V nominal.
5436 #define _BORV_250_2L 0xEF // BOR set to 2.5V nominal.
5437 #define _BORV_220_2L 0xF7 // BOR set to 2.2V nominal.
5438 #define _BORV_190_2L 0xFF // BOR set to 1.9V nominal.
5439 #define _nLPBOR_ON_2L 0xBF // Low-Power Brown-out Reset enabled.
5440 #define _nLPBOR_OFF_2L 0xFF // Low-Power Brown-out Reset disabled.
5442 //----------------------------- CONFIG2H Options -------------------------------
5444 #define _WDTEN_OFF_2H 0xFC // WDT disabled in hardware (SWDTEN ignored).
5445 #define _WDTEN_NOSLP_2H 0xFD // WDT enabled in hardware, disabled in Sleep mode (SWDTEN ignored).
5446 #define _WDTEN_SWON_2H 0xFE // WDT controlled by firmware (SWDTEN enabled).
5447 #define _WDTEN_ON_2H 0xFF // WDT enabled in hardware (SWDTEN ignored).
5448 #define _WDTPS_1_2H 0xC3 // 1:1.
5449 #define _WDTPS_2_2H 0xC7 // 1:2.
5450 #define _WDTPS_4_2H 0xCB // 1:4.
5451 #define _WDTPS_8_2H 0xCF // 1:8.
5452 #define _WDTPS_16_2H 0xD3 // 1:16.
5453 #define _WDTPS_32_2H 0xD7 // 1:32.
5454 #define _WDTPS_64_2H 0xDB // 1:64.
5455 #define _WDTPS_128_2H 0xDF // 1:128.
5456 #define _WDTPS_256_2H 0xE3 // 1:256.
5457 #define _WDTPS_512_2H 0xE7 // 1:512.
5458 #define _WDTPS_1024_2H 0xEB // 1:1024.
5459 #define _WDTPS_2048_2H 0xEF // 1:2048.
5460 #define _WDTPS_4096_2H 0xF3 // 1:4096.
5461 #define _WDTPS_8192_2H 0xF7 // 1:8192.
5462 #define _WDTPS_16384_2H 0xFB // 1:16384.
5463 #define _WDTPS_32768_2H 0xFF // 1:32768.
5465 //----------------------------- CONFIG3H Options -------------------------------
5467 #define _CCP2MX_RB3_3H 0xFE // CCP2 input/output is multiplexed with RB3.
5468 #define _CCP2MX_RC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
5469 #define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset.
5470 #define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset.
5471 #define _T3CMX_RB5_3H 0xEF // T3CKI function is on RB5.
5472 #define _T3CMX_RC0_3H 0xFF // T3CKI function is on RC0.
5473 #define _SDOMX_RC7_3H 0xBF // SDO function is on RC7.
5474 #define _SDOMX_RB3_3H 0xFF // SDO function is on RB3.
5475 #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; external MCLR disabled.
5476 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input disabled.
5478 //----------------------------- CONFIG4L Options -------------------------------
5480 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
5481 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
5482 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
5483 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1.
5484 #define _ICPRT_OFF_4L 0xDF // ICPORT disabled.
5485 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled.
5486 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
5487 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
5488 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
5490 //----------------------------- CONFIG5L Options -------------------------------
5492 #define _CP0_ON_5L 0xFE // Block 0 is code-protected.
5493 #define _CP0_OFF_5L 0xFF // Block 0 is not code-protected.
5494 #define _CP1_ON_5L 0xFD // Block 1 is code-protected.
5495 #define _CP1_OFF_5L 0xFF // Block 1 is not code-protected.
5497 //----------------------------- CONFIG5H Options -------------------------------
5499 #define _CPB_ON_5H 0xBF // Boot block is code-protected.
5500 #define _CPB_OFF_5H 0xFF // Boot block is not code-protected.
5501 #define _CPD_ON_5H 0x7F // Data EEPROM is code-protected.
5502 #define _CPD_OFF_5H 0xFF // Data EEPROM is not code-protected.
5504 //----------------------------- CONFIG6L Options -------------------------------
5506 #define _WRT0_ON_6L 0xFE // Block 0 (0800-1FFFh) is write-protected.
5507 #define _WRT0_OFF_6L 0xFF // Block 0 (0800-1FFFh) is not write-protected.
5508 #define _WRT1_ON_6L 0xFD // Block 1 (2000-3FFFh) is write-protected.
5509 #define _WRT1_OFF_6L 0xFF // Block 1 (2000-3FFFh) is not write-protected.
5511 //----------------------------- CONFIG6H Options -------------------------------
5513 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) are write-protected.
5514 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) are not write-protected.
5515 #define _WRTB_ON_6H 0xBF // Boot block (0000-7FFh) is write-protected.
5516 #define _WRTB_OFF_6H 0xFF // Boot block (0000-7FFh) is not write-protected.
5517 #define _WRTD_ON_6H 0x7F // Data EEPROM is write-protected.
5518 #define _WRTD_OFF_6H 0xFF // Data EEPROM is not write-protected.
5520 //----------------------------- CONFIG7L Options -------------------------------
5522 #define _EBTR0_ON_7L 0xFE // Block 0 is protected from table reads executed in other blocks.
5523 #define _EBTR0_OFF_7L 0xFF // Block 0 is not protected from table reads executed in other blocks.
5524 #define _EBTR1_ON_7L 0xFD // Block 1 is protected from table reads executed in other blocks.
5525 #define _EBTR1_OFF_7L 0xFF // Block 1 is not protected from table reads executed in other blocks.
5527 //----------------------------- CONFIG7H Options -------------------------------
5529 #define _EBTRB_ON_7H 0xBF // Boot block is protected from table reads executed in other blocks.
5530 #define _EBTRB_OFF_7H 0xFF // Boot block is not protected from table reads executed in other blocks.
5532 //==============================================================================
5534 #define __DEVID1 0x3FFFFE
5535 #define __DEVID2 0x3FFFFF
5537 #define __IDLOC0 0x200000
5538 #define __IDLOC1 0x200001
5539 #define __IDLOC2 0x200002
5540 #define __IDLOC3 0x200003
5541 #define __IDLOC4 0x200004
5542 #define __IDLOC5 0x200005
5543 #define __IDLOC6 0x200006
5544 #define __IDLOC7 0x200007
5546 #endif // #ifndef __PIC18F24K50_H__