struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18lf25k50.h
blob5aaa084d8661989a57759db012fc8250b17bbbea
1 /*
2 * This declarations of the PIC18LF25K50 MCU.
4 * This file is part of the GNU PIC library for SDCC, originally
5 * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
7 * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:54 UTC.
9 * SDCC is licensed under the GNU Public license (GPL) v2. Note that
10 * this license covers the code to the compiler and other executables,
11 * but explicitly does not cover any code or objects generated by sdcc.
13 * For pic device libraries and header files which are derived from
14 * Microchip header (.inc) and linker script (.lkr) files Microchip
15 * requires that "The header files should state that they are only to be
16 * used with authentic Microchip devices" which makes them incompatible
17 * with the GPL. Pic device libraries and header files are located at
18 * non-free/lib and non-free/include directories respectively.
19 * Sdcc should be run with the --use-non-free command line option in
20 * order to include non-free header files and libraries.
22 * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
25 #ifndef __PIC18LF25K50_H__
26 #define __PIC18LF25K50_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 //==============================================================================
134 //==============================================================================
135 // ANSELA Bits
137 extern __at(0x0F5B) __sfr ANSELA;
139 typedef struct
141 unsigned ANSA0 : 1;
142 unsigned ANSA1 : 1;
143 unsigned ANSA2 : 1;
144 unsigned ANSA3 : 1;
145 unsigned : 1;
146 unsigned ANSA5 : 1;
147 unsigned : 1;
148 unsigned : 1;
149 } __ANSELAbits_t;
151 extern __at(0x0F5B) volatile __ANSELAbits_t ANSELAbits;
153 #define _ANSA0 0x01
154 #define _ANSA1 0x02
155 #define _ANSA2 0x04
156 #define _ANSA3 0x08
157 #define _ANSA5 0x20
159 //==============================================================================
162 //==============================================================================
163 // ANSELB Bits
165 extern __at(0x0F5C) __sfr ANSELB;
167 typedef union
169 struct
171 unsigned ANSB0 : 1;
172 unsigned ANSB1 : 1;
173 unsigned ANSB2 : 1;
174 unsigned ANSB3 : 1;
175 unsigned ANSB4 : 1;
176 unsigned ANSB5 : 1;
177 unsigned : 1;
178 unsigned : 1;
181 struct
183 unsigned ANSB : 6;
184 unsigned : 2;
186 } __ANSELBbits_t;
188 extern __at(0x0F5C) volatile __ANSELBbits_t ANSELBbits;
190 #define _ANSB0 0x01
191 #define _ANSB1 0x02
192 #define _ANSB2 0x04
193 #define _ANSB3 0x08
194 #define _ANSB4 0x10
195 #define _ANSB5 0x20
197 //==============================================================================
200 //==============================================================================
201 // ANSELC Bits
203 extern __at(0x0F5D) __sfr ANSELC;
205 typedef struct
207 unsigned : 1;
208 unsigned : 1;
209 unsigned ANSC2 : 1;
210 unsigned : 1;
211 unsigned : 1;
212 unsigned : 1;
213 unsigned ANSC6 : 1;
214 unsigned ANSC7 : 1;
215 } __ANSELCbits_t;
217 extern __at(0x0F5D) volatile __ANSELCbits_t ANSELCbits;
219 #define _ANSC2 0x04
220 #define _ANSC6 0x40
221 #define _ANSC7 0x80
223 //==============================================================================
226 //==============================================================================
227 // UCON Bits
229 extern __at(0x0F60) __sfr UCON;
231 typedef struct
233 unsigned : 1;
234 unsigned SUSPND : 1;
235 unsigned RESUME : 1;
236 unsigned USBEN : 1;
237 unsigned PKTDIS : 1;
238 unsigned SE0 : 1;
239 unsigned PPBRST : 1;
240 unsigned : 1;
241 } __UCONbits_t;
243 extern __at(0x0F60) volatile __UCONbits_t UCONbits;
245 #define _SUSPND 0x02
246 #define _RESUME 0x04
247 #define _USBEN 0x08
248 #define _PKTDIS 0x10
249 #define _SE0 0x20
250 #define _PPBRST 0x40
252 //==============================================================================
255 //==============================================================================
256 // USTAT Bits
258 extern __at(0x0F61) __sfr USTAT;
260 typedef union
262 struct
264 unsigned : 1;
265 unsigned PPBI : 1;
266 unsigned DIR : 1;
267 unsigned ENDP0 : 1;
268 unsigned ENDP1 : 1;
269 unsigned ENDP2 : 1;
270 unsigned ENDP3 : 1;
271 unsigned : 1;
274 struct
276 unsigned : 3;
277 unsigned ENDP : 4;
278 unsigned : 1;
280 } __USTATbits_t;
282 extern __at(0x0F61) volatile __USTATbits_t USTATbits;
284 #define _PPBI 0x02
285 #define _DIR 0x04
286 #define _ENDP0 0x08
287 #define _ENDP1 0x10
288 #define _ENDP2 0x20
289 #define _ENDP3 0x40
291 //==============================================================================
294 //==============================================================================
295 // UCFG Bits
297 extern __at(0x0F62) __sfr UCFG;
299 typedef union
301 struct
303 unsigned PPB0 : 1;
304 unsigned PPB1 : 1;
305 unsigned FSEN : 1;
306 unsigned UTRDIS : 1;
307 unsigned UPUEN : 1;
308 unsigned : 1;
309 unsigned UOEMON : 1;
310 unsigned UTEYE : 1;
313 struct
315 unsigned PPB : 2;
316 unsigned : 6;
318 } __UCFGbits_t;
320 extern __at(0x0F62) volatile __UCFGbits_t UCFGbits;
322 #define _PPB0 0x01
323 #define _PPB1 0x02
324 #define _FSEN 0x04
325 #define _UTRDIS 0x08
326 #define _UPUEN 0x10
327 #define _UOEMON 0x40
328 #define _UTEYE 0x80
330 //==============================================================================
333 //==============================================================================
334 // UADDR Bits
336 extern __at(0x0F63) __sfr UADDR;
338 typedef union
340 struct
342 unsigned ADDR0 : 1;
343 unsigned ADDR1 : 1;
344 unsigned ADDR2 : 1;
345 unsigned ADDR3 : 1;
346 unsigned ADDR4 : 1;
347 unsigned ADDR5 : 1;
348 unsigned ADDR6 : 1;
349 unsigned : 1;
352 struct
354 unsigned ADDR : 7;
355 unsigned : 1;
357 } __UADDRbits_t;
359 extern __at(0x0F63) volatile __UADDRbits_t UADDRbits;
361 #define _ADDR0 0x01
362 #define _ADDR1 0x02
363 #define _ADDR2 0x04
364 #define _ADDR3 0x08
365 #define _ADDR4 0x10
366 #define _ADDR5 0x20
367 #define _ADDR6 0x40
369 //==============================================================================
372 //==============================================================================
373 // UIE Bits
375 extern __at(0x0F64) __sfr UIE;
377 typedef struct
379 unsigned URSTIE : 1;
380 unsigned UERRIE : 1;
381 unsigned ACTVIE : 1;
382 unsigned TRNIE : 1;
383 unsigned IDLEIE : 1;
384 unsigned STALLIE : 1;
385 unsigned SOFIE : 1;
386 unsigned : 1;
387 } __UIEbits_t;
389 extern __at(0x0F64) volatile __UIEbits_t UIEbits;
391 #define _URSTIE 0x01
392 #define _UERRIE 0x02
393 #define _ACTVIE 0x04
394 #define _TRNIE 0x08
395 #define _IDLEIE 0x10
396 #define _STALLIE 0x20
397 #define _SOFIE 0x40
399 //==============================================================================
402 //==============================================================================
403 // UIR Bits
405 extern __at(0x0F65) __sfr UIR;
407 typedef struct
409 unsigned URSTIF : 1;
410 unsigned UERRIF : 1;
411 unsigned ACTVIF : 1;
412 unsigned TRNIF : 1;
413 unsigned IDLEIF : 1;
414 unsigned STALLIF : 1;
415 unsigned SOFIF : 1;
416 unsigned : 1;
417 } __UIRbits_t;
419 extern __at(0x0F65) volatile __UIRbits_t UIRbits;
421 #define _URSTIF 0x01
422 #define _UERRIF 0x02
423 #define _ACTVIF 0x04
424 #define _TRNIF 0x08
425 #define _IDLEIF 0x10
426 #define _STALLIF 0x20
427 #define _SOFIF 0x40
429 //==============================================================================
432 //==============================================================================
433 // UEIE Bits
435 extern __at(0x0F66) __sfr UEIE;
437 typedef struct
439 unsigned PIDEE : 1;
440 unsigned CRC5EE : 1;
441 unsigned CRC16EE : 1;
442 unsigned DFN8EE : 1;
443 unsigned BTOEE : 1;
444 unsigned : 1;
445 unsigned : 1;
446 unsigned BTSEE : 1;
447 } __UEIEbits_t;
449 extern __at(0x0F66) volatile __UEIEbits_t UEIEbits;
451 #define _PIDEE 0x01
452 #define _CRC5EE 0x02
453 #define _CRC16EE 0x04
454 #define _DFN8EE 0x08
455 #define _BTOEE 0x10
456 #define _BTSEE 0x80
458 //==============================================================================
461 //==============================================================================
462 // UEIR Bits
464 extern __at(0x0F67) __sfr UEIR;
466 typedef struct
468 unsigned PIDEF : 1;
469 unsigned CRC5EF : 1;
470 unsigned CRC16EF : 1;
471 unsigned DFN8EF : 1;
472 unsigned BTOEF : 1;
473 unsigned : 1;
474 unsigned : 1;
475 unsigned BTSEF : 1;
476 } __UEIRbits_t;
478 extern __at(0x0F67) volatile __UEIRbits_t UEIRbits;
480 #define _PIDEF 0x01
481 #define _CRC5EF 0x02
482 #define _CRC16EF 0x04
483 #define _DFN8EF 0x08
484 #define _BTOEF 0x10
485 #define _BTSEF 0x80
487 //==============================================================================
489 extern __at(0x0F68) __sfr UFRM;
491 //==============================================================================
492 // UFRML Bits
494 extern __at(0x0F68) __sfr UFRML;
496 typedef struct
498 unsigned FRM0 : 1;
499 unsigned FRM1 : 1;
500 unsigned FRM2 : 1;
501 unsigned FRM3 : 1;
502 unsigned FRM4 : 1;
503 unsigned FRM5 : 1;
504 unsigned FRM6 : 1;
505 unsigned FRM7 : 1;
506 } __UFRMLbits_t;
508 extern __at(0x0F68) volatile __UFRMLbits_t UFRMLbits;
510 #define _FRM0 0x01
511 #define _FRM1 0x02
512 #define _FRM2 0x04
513 #define _FRM3 0x08
514 #define _FRM4 0x10
515 #define _FRM5 0x20
516 #define _FRM6 0x40
517 #define _FRM7 0x80
519 //==============================================================================
522 //==============================================================================
523 // UFRMH Bits
525 extern __at(0x0F69) __sfr UFRMH;
527 typedef struct
529 unsigned FRM8 : 1;
530 unsigned FRM9 : 1;
531 unsigned FRM10 : 1;
532 unsigned : 1;
533 unsigned : 1;
534 unsigned : 1;
535 unsigned : 1;
536 unsigned : 1;
537 } __UFRMHbits_t;
539 extern __at(0x0F69) volatile __UFRMHbits_t UFRMHbits;
541 #define _FRM8 0x01
542 #define _FRM9 0x02
543 #define _FRM10 0x04
545 //==============================================================================
548 //==============================================================================
549 // UEP0 Bits
551 extern __at(0x0F6A) __sfr UEP0;
553 typedef struct
555 unsigned EPSTALL : 1;
556 unsigned EPINEN : 1;
557 unsigned EPOUTEN : 1;
558 unsigned EPCONDIS : 1;
559 unsigned EPHSHK : 1;
560 unsigned : 1;
561 unsigned : 1;
562 unsigned : 1;
563 } __UEP0bits_t;
565 extern __at(0x0F6A) volatile __UEP0bits_t UEP0bits;
567 #define _EPSTALL 0x01
568 #define _EPINEN 0x02
569 #define _EPOUTEN 0x04
570 #define _EPCONDIS 0x08
571 #define _EPHSHK 0x10
573 //==============================================================================
576 //==============================================================================
577 // UEP1 Bits
579 extern __at(0x0F6B) __sfr UEP1;
581 typedef struct
583 unsigned EPSTALL : 1;
584 unsigned EPINEN : 1;
585 unsigned EPOUTEN : 1;
586 unsigned EPCONDIS : 1;
587 unsigned EPHSHK : 1;
588 unsigned : 1;
589 unsigned : 1;
590 unsigned : 1;
591 } __UEP1bits_t;
593 extern __at(0x0F6B) volatile __UEP1bits_t UEP1bits;
595 #define _UEP1_EPSTALL 0x01
596 #define _UEP1_EPINEN 0x02
597 #define _UEP1_EPOUTEN 0x04
598 #define _UEP1_EPCONDIS 0x08
599 #define _UEP1_EPHSHK 0x10
601 //==============================================================================
604 //==============================================================================
605 // UEP2 Bits
607 extern __at(0x0F6C) __sfr UEP2;
609 typedef struct
611 unsigned EPSTALL : 1;
612 unsigned EPINEN : 1;
613 unsigned EPOUTEN : 1;
614 unsigned EPCONDIS : 1;
615 unsigned EPHSHK : 1;
616 unsigned : 1;
617 unsigned : 1;
618 unsigned : 1;
619 } __UEP2bits_t;
621 extern __at(0x0F6C) volatile __UEP2bits_t UEP2bits;
623 #define _UEP2_EPSTALL 0x01
624 #define _UEP2_EPINEN 0x02
625 #define _UEP2_EPOUTEN 0x04
626 #define _UEP2_EPCONDIS 0x08
627 #define _UEP2_EPHSHK 0x10
629 //==============================================================================
632 //==============================================================================
633 // UEP3 Bits
635 extern __at(0x0F6D) __sfr UEP3;
637 typedef struct
639 unsigned EPSTALL : 1;
640 unsigned EPINEN : 1;
641 unsigned EPOUTEN : 1;
642 unsigned EPCONDIS : 1;
643 unsigned EPHSHK : 1;
644 unsigned : 1;
645 unsigned : 1;
646 unsigned : 1;
647 } __UEP3bits_t;
649 extern __at(0x0F6D) volatile __UEP3bits_t UEP3bits;
651 #define _UEP3_EPSTALL 0x01
652 #define _UEP3_EPINEN 0x02
653 #define _UEP3_EPOUTEN 0x04
654 #define _UEP3_EPCONDIS 0x08
655 #define _UEP3_EPHSHK 0x10
657 //==============================================================================
660 //==============================================================================
661 // UEP4 Bits
663 extern __at(0x0F6E) __sfr UEP4;
665 typedef struct
667 unsigned EPSTALL : 1;
668 unsigned EPINEN : 1;
669 unsigned EPOUTEN : 1;
670 unsigned EPCONDIS : 1;
671 unsigned EPHSHK : 1;
672 unsigned : 1;
673 unsigned : 1;
674 unsigned : 1;
675 } __UEP4bits_t;
677 extern __at(0x0F6E) volatile __UEP4bits_t UEP4bits;
679 #define _UEP4_EPSTALL 0x01
680 #define _UEP4_EPINEN 0x02
681 #define _UEP4_EPOUTEN 0x04
682 #define _UEP4_EPCONDIS 0x08
683 #define _UEP4_EPHSHK 0x10
685 //==============================================================================
688 //==============================================================================
689 // UEP5 Bits
691 extern __at(0x0F6F) __sfr UEP5;
693 typedef struct
695 unsigned EPSTALL : 1;
696 unsigned EPINEN : 1;
697 unsigned EPOUTEN : 1;
698 unsigned EPCONDIS : 1;
699 unsigned EPHSHK : 1;
700 unsigned : 1;
701 unsigned : 1;
702 unsigned : 1;
703 } __UEP5bits_t;
705 extern __at(0x0F6F) volatile __UEP5bits_t UEP5bits;
707 #define _UEP5_EPSTALL 0x01
708 #define _UEP5_EPINEN 0x02
709 #define _UEP5_EPOUTEN 0x04
710 #define _UEP5_EPCONDIS 0x08
711 #define _UEP5_EPHSHK 0x10
713 //==============================================================================
716 //==============================================================================
717 // UEP6 Bits
719 extern __at(0x0F70) __sfr UEP6;
721 typedef struct
723 unsigned EPSTALL : 1;
724 unsigned EPINEN : 1;
725 unsigned EPOUTEN : 1;
726 unsigned EPCONDIS : 1;
727 unsigned EPHSHK : 1;
728 unsigned : 1;
729 unsigned : 1;
730 unsigned : 1;
731 } __UEP6bits_t;
733 extern __at(0x0F70) volatile __UEP6bits_t UEP6bits;
735 #define _UEP6_EPSTALL 0x01
736 #define _UEP6_EPINEN 0x02
737 #define _UEP6_EPOUTEN 0x04
738 #define _UEP6_EPCONDIS 0x08
739 #define _UEP6_EPHSHK 0x10
741 //==============================================================================
744 //==============================================================================
745 // UEP7 Bits
747 extern __at(0x0F71) __sfr UEP7;
749 typedef struct
751 unsigned EPSTALL : 1;
752 unsigned EPINEN : 1;
753 unsigned EPOUTEN : 1;
754 unsigned EPCONDIS : 1;
755 unsigned EPHSHK : 1;
756 unsigned : 1;
757 unsigned : 1;
758 unsigned : 1;
759 } __UEP7bits_t;
761 extern __at(0x0F71) volatile __UEP7bits_t UEP7bits;
763 #define _UEP7_EPSTALL 0x01
764 #define _UEP7_EPINEN 0x02
765 #define _UEP7_EPOUTEN 0x04
766 #define _UEP7_EPCONDIS 0x08
767 #define _UEP7_EPHSHK 0x10
769 //==============================================================================
772 //==============================================================================
773 // UEP8 Bits
775 extern __at(0x0F72) __sfr UEP8;
777 typedef struct
779 unsigned EPSTALL : 1;
780 unsigned EPINEN : 1;
781 unsigned EPOUTEN : 1;
782 unsigned EPCONDIS : 1;
783 unsigned EPHSHK : 1;
784 unsigned : 1;
785 unsigned : 1;
786 unsigned : 1;
787 } __UEP8bits_t;
789 extern __at(0x0F72) volatile __UEP8bits_t UEP8bits;
791 #define _UEP8_EPSTALL 0x01
792 #define _UEP8_EPINEN 0x02
793 #define _UEP8_EPOUTEN 0x04
794 #define _UEP8_EPCONDIS 0x08
795 #define _UEP8_EPHSHK 0x10
797 //==============================================================================
800 //==============================================================================
801 // UEP9 Bits
803 extern __at(0x0F73) __sfr UEP9;
805 typedef struct
807 unsigned EPSTALL : 1;
808 unsigned EPINEN : 1;
809 unsigned EPOUTEN : 1;
810 unsigned EPCONDIS : 1;
811 unsigned EPHSHK : 1;
812 unsigned : 1;
813 unsigned : 1;
814 unsigned : 1;
815 } __UEP9bits_t;
817 extern __at(0x0F73) volatile __UEP9bits_t UEP9bits;
819 #define _UEP9_EPSTALL 0x01
820 #define _UEP9_EPINEN 0x02
821 #define _UEP9_EPOUTEN 0x04
822 #define _UEP9_EPCONDIS 0x08
823 #define _UEP9_EPHSHK 0x10
825 //==============================================================================
828 //==============================================================================
829 // UEP10 Bits
831 extern __at(0x0F74) __sfr UEP10;
833 typedef struct
835 unsigned EPSTALL : 1;
836 unsigned EPINEN : 1;
837 unsigned EPOUTEN : 1;
838 unsigned EPCONDIS : 1;
839 unsigned EPHSHK : 1;
840 unsigned : 1;
841 unsigned : 1;
842 unsigned : 1;
843 } __UEP10bits_t;
845 extern __at(0x0F74) volatile __UEP10bits_t UEP10bits;
847 #define _UEP10_EPSTALL 0x01
848 #define _UEP10_EPINEN 0x02
849 #define _UEP10_EPOUTEN 0x04
850 #define _UEP10_EPCONDIS 0x08
851 #define _UEP10_EPHSHK 0x10
853 //==============================================================================
856 //==============================================================================
857 // UEP11 Bits
859 extern __at(0x0F75) __sfr UEP11;
861 typedef struct
863 unsigned EPSTALL : 1;
864 unsigned EPINEN : 1;
865 unsigned EPOUTEN : 1;
866 unsigned EPCONDIS : 1;
867 unsigned EPHSHK : 1;
868 unsigned : 1;
869 unsigned : 1;
870 unsigned : 1;
871 } __UEP11bits_t;
873 extern __at(0x0F75) volatile __UEP11bits_t UEP11bits;
875 #define _UEP11_EPSTALL 0x01
876 #define _UEP11_EPINEN 0x02
877 #define _UEP11_EPOUTEN 0x04
878 #define _UEP11_EPCONDIS 0x08
879 #define _UEP11_EPHSHK 0x10
881 //==============================================================================
884 //==============================================================================
885 // UEP12 Bits
887 extern __at(0x0F76) __sfr UEP12;
889 typedef struct
891 unsigned EPSTALL : 1;
892 unsigned EPINEN : 1;
893 unsigned EPOUTEN : 1;
894 unsigned EPCONDIS : 1;
895 unsigned EPHSHK : 1;
896 unsigned : 1;
897 unsigned : 1;
898 unsigned : 1;
899 } __UEP12bits_t;
901 extern __at(0x0F76) volatile __UEP12bits_t UEP12bits;
903 #define _UEP12_EPSTALL 0x01
904 #define _UEP12_EPINEN 0x02
905 #define _UEP12_EPOUTEN 0x04
906 #define _UEP12_EPCONDIS 0x08
907 #define _UEP12_EPHSHK 0x10
909 //==============================================================================
912 //==============================================================================
913 // UEP13 Bits
915 extern __at(0x0F77) __sfr UEP13;
917 typedef struct
919 unsigned EPSTALL : 1;
920 unsigned EPINEN : 1;
921 unsigned EPOUTEN : 1;
922 unsigned EPCONDIS : 1;
923 unsigned EPHSHK : 1;
924 unsigned : 1;
925 unsigned : 1;
926 unsigned : 1;
927 } __UEP13bits_t;
929 extern __at(0x0F77) volatile __UEP13bits_t UEP13bits;
931 #define _UEP13_EPSTALL 0x01
932 #define _UEP13_EPINEN 0x02
933 #define _UEP13_EPOUTEN 0x04
934 #define _UEP13_EPCONDIS 0x08
935 #define _UEP13_EPHSHK 0x10
937 //==============================================================================
940 //==============================================================================
941 // UEP14 Bits
943 extern __at(0x0F78) __sfr UEP14;
945 typedef struct
947 unsigned EPSTALL : 1;
948 unsigned EPINEN : 1;
949 unsigned EPOUTEN : 1;
950 unsigned EPCONDIS : 1;
951 unsigned EPHSHK : 1;
952 unsigned : 1;
953 unsigned : 1;
954 unsigned : 1;
955 } __UEP14bits_t;
957 extern __at(0x0F78) volatile __UEP14bits_t UEP14bits;
959 #define _UEP14_EPSTALL 0x01
960 #define _UEP14_EPINEN 0x02
961 #define _UEP14_EPOUTEN 0x04
962 #define _UEP14_EPCONDIS 0x08
963 #define _UEP14_EPHSHK 0x10
965 //==============================================================================
968 //==============================================================================
969 // UEP15 Bits
971 extern __at(0x0F79) __sfr UEP15;
973 typedef struct
975 unsigned EPSTALL : 1;
976 unsigned EPINEN : 1;
977 unsigned EPOUTEN : 1;
978 unsigned EPCONDIS : 1;
979 unsigned EPHSHK : 1;
980 unsigned : 1;
981 unsigned : 1;
982 unsigned : 1;
983 } __UEP15bits_t;
985 extern __at(0x0F79) volatile __UEP15bits_t UEP15bits;
987 #define _UEP15_EPSTALL 0x01
988 #define _UEP15_EPINEN 0x02
989 #define _UEP15_EPOUTEN 0x04
990 #define _UEP15_EPCONDIS 0x08
991 #define _UEP15_EPHSHK 0x10
993 //==============================================================================
996 //==============================================================================
997 // SLRCON Bits
999 extern __at(0x0F7A) __sfr SLRCON;
1001 typedef struct
1003 unsigned SLRA : 1;
1004 unsigned SLRB : 1;
1005 unsigned SLRC : 1;
1006 unsigned : 1;
1007 unsigned : 1;
1008 unsigned : 1;
1009 unsigned : 1;
1010 unsigned : 1;
1011 } __SLRCONbits_t;
1013 extern __at(0x0F7A) volatile __SLRCONbits_t SLRCONbits;
1015 #define _SLRA 0x01
1016 #define _SLRB 0x02
1017 #define _SLRC 0x04
1019 //==============================================================================
1022 //==============================================================================
1023 // VREFCON2 Bits
1025 extern __at(0x0F7B) __sfr VREFCON2;
1027 typedef union
1029 struct
1031 unsigned DACR0 : 1;
1032 unsigned DACR1 : 1;
1033 unsigned DACR2 : 1;
1034 unsigned DACR3 : 1;
1035 unsigned DACR4 : 1;
1036 unsigned : 1;
1037 unsigned : 1;
1038 unsigned : 1;
1041 struct
1043 unsigned DACR : 5;
1044 unsigned : 3;
1046 } __VREFCON2bits_t;
1048 extern __at(0x0F7B) volatile __VREFCON2bits_t VREFCON2bits;
1050 #define _DACR0 0x01
1051 #define _DACR1 0x02
1052 #define _DACR2 0x04
1053 #define _DACR3 0x08
1054 #define _DACR4 0x10
1056 //==============================================================================
1059 //==============================================================================
1060 // VREFCON1 Bits
1062 extern __at(0x0F7C) __sfr VREFCON1;
1064 typedef union
1066 struct
1068 unsigned DACNSS : 1;
1069 unsigned : 1;
1070 unsigned DACPSS0 : 1;
1071 unsigned DACPSS1 : 1;
1072 unsigned : 1;
1073 unsigned DACOE : 1;
1074 unsigned DACLPS : 1;
1075 unsigned DACEN : 1;
1078 struct
1080 unsigned : 2;
1081 unsigned DACPSS : 2;
1082 unsigned : 4;
1084 } __VREFCON1bits_t;
1086 extern __at(0x0F7C) volatile __VREFCON1bits_t VREFCON1bits;
1088 #define _DACNSS 0x01
1089 #define _DACPSS0 0x04
1090 #define _DACPSS1 0x08
1091 #define _DACOE 0x20
1092 #define _DACLPS 0x40
1093 #define _DACEN 0x80
1095 //==============================================================================
1098 //==============================================================================
1099 // VREFCON0 Bits
1101 extern __at(0x0F7D) __sfr VREFCON0;
1103 typedef union
1105 struct
1107 unsigned : 1;
1108 unsigned : 1;
1109 unsigned TSRNG : 1;
1110 unsigned TSEN : 1;
1111 unsigned FVRS0 : 1;
1112 unsigned FVRS1 : 1;
1113 unsigned FVRST : 1;
1114 unsigned FVREN : 1;
1117 struct
1119 unsigned : 4;
1120 unsigned FVRS : 2;
1121 unsigned : 2;
1123 } __VREFCON0bits_t;
1125 extern __at(0x0F7D) volatile __VREFCON0bits_t VREFCON0bits;
1127 #define _TSRNG 0x04
1128 #define _TSEN 0x08
1129 #define _FVRS0 0x10
1130 #define _FVRS1 0x20
1131 #define _FVRST 0x40
1132 #define _FVREN 0x80
1134 //==============================================================================
1137 //==============================================================================
1138 // PMD0 Bits
1140 extern __at(0x0F7E) __sfr PMD0;
1142 typedef union
1144 struct
1146 unsigned TMR1MD : 1;
1147 unsigned TMR2MD : 1;
1148 unsigned TMR3MD : 1;
1149 unsigned : 1;
1150 unsigned ACTMD : 1;
1151 unsigned USBMD : 1;
1152 unsigned UARTMD : 1;
1153 unsigned : 1;
1156 struct
1158 unsigned : 1;
1159 unsigned : 1;
1160 unsigned : 1;
1161 unsigned : 1;
1162 unsigned STMD : 1;
1163 unsigned : 1;
1164 unsigned UART1MD : 1;
1165 unsigned : 1;
1167 } __PMD0bits_t;
1169 extern __at(0x0F7E) volatile __PMD0bits_t PMD0bits;
1171 #define _TMR1MD 0x01
1172 #define _TMR2MD 0x02
1173 #define _TMR3MD 0x04
1174 #define _ACTMD 0x10
1175 #define _STMD 0x10
1176 #define _USBMD 0x20
1177 #define _UARTMD 0x40
1178 #define _UART1MD 0x40
1180 //==============================================================================
1183 //==============================================================================
1184 // PMD1 Bits
1186 extern __at(0x0F7F) __sfr PMD1;
1188 typedef union
1190 struct
1192 unsigned CCP1MD : 1;
1193 unsigned CCP2MD : 1;
1194 unsigned ADCMD : 1;
1195 unsigned CMP1MD : 1;
1196 unsigned CMP2MD : 1;
1197 unsigned CTMUMD : 1;
1198 unsigned MSSPMD : 1;
1199 unsigned : 1;
1202 struct
1204 unsigned : 1;
1205 unsigned : 1;
1206 unsigned : 1;
1207 unsigned : 1;
1208 unsigned : 1;
1209 unsigned : 1;
1210 unsigned SSP1MD : 1;
1211 unsigned : 1;
1214 struct
1216 unsigned : 1;
1217 unsigned : 1;
1218 unsigned : 1;
1219 unsigned : 1;
1220 unsigned : 1;
1221 unsigned : 1;
1222 unsigned MSSP1MD : 1;
1223 unsigned : 1;
1225 } __PMD1bits_t;
1227 extern __at(0x0F7F) volatile __PMD1bits_t PMD1bits;
1229 #define _CCP1MD 0x01
1230 #define _CCP2MD 0x02
1231 #define _ADCMD 0x04
1232 #define _CMP1MD 0x08
1233 #define _CMP2MD 0x10
1234 #define _CTMUMD 0x20
1235 #define _MSSPMD 0x40
1236 #define _SSP1MD 0x40
1237 #define _MSSP1MD 0x40
1239 //==============================================================================
1242 //==============================================================================
1243 // PORTA Bits
1245 extern __at(0x0F80) __sfr PORTA;
1247 typedef union
1249 struct
1251 unsigned RA0 : 1;
1252 unsigned RA1 : 1;
1253 unsigned RA2 : 1;
1254 unsigned RA3 : 1;
1255 unsigned RA4 : 1;
1256 unsigned RA5 : 1;
1257 unsigned RA6 : 1;
1258 unsigned RA7 : 1;
1261 struct
1263 unsigned AN0 : 1;
1264 unsigned AN1 : 1;
1265 unsigned AN2 : 1;
1266 unsigned AN3 : 1;
1267 unsigned T0CKI : 1;
1268 unsigned AN4 : 1;
1269 unsigned OSC2 : 1;
1270 unsigned : 1;
1273 struct
1275 unsigned : 1;
1276 unsigned : 1;
1277 unsigned VREFM : 1;
1278 unsigned VREFP : 1;
1279 unsigned : 1;
1280 unsigned LVDIN : 1;
1281 unsigned : 1;
1282 unsigned : 1;
1285 struct
1287 unsigned : 1;
1288 unsigned : 1;
1289 unsigned : 1;
1290 unsigned : 1;
1291 unsigned : 1;
1292 unsigned HLVDIN : 1;
1293 unsigned : 1;
1294 unsigned : 1;
1296 } __PORTAbits_t;
1298 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1300 #define _PORTA_RA0 0x01
1301 #define _PORTA_AN0 0x01
1302 #define _PORTA_RA1 0x02
1303 #define _PORTA_AN1 0x02
1304 #define _PORTA_RA2 0x04
1305 #define _PORTA_AN2 0x04
1306 #define _PORTA_VREFM 0x04
1307 #define _PORTA_RA3 0x08
1308 #define _PORTA_AN3 0x08
1309 #define _PORTA_VREFP 0x08
1310 #define _PORTA_RA4 0x10
1311 #define _PORTA_T0CKI 0x10
1312 #define _PORTA_RA5 0x20
1313 #define _PORTA_AN4 0x20
1314 #define _PORTA_LVDIN 0x20
1315 #define _PORTA_HLVDIN 0x20
1316 #define _PORTA_RA6 0x40
1317 #define _PORTA_OSC2 0x40
1318 #define _PORTA_RA7 0x80
1320 //==============================================================================
1323 //==============================================================================
1324 // PORTB Bits
1326 extern __at(0x0F81) __sfr PORTB;
1328 typedef union
1330 struct
1332 unsigned RB0 : 1;
1333 unsigned RB1 : 1;
1334 unsigned RB2 : 1;
1335 unsigned RB3 : 1;
1336 unsigned RB4 : 1;
1337 unsigned RB5 : 1;
1338 unsigned RB6 : 1;
1339 unsigned RB7 : 1;
1342 struct
1344 unsigned INT0 : 1;
1345 unsigned INT1 : 1;
1346 unsigned INT2 : 1;
1347 unsigned : 1;
1348 unsigned : 1;
1349 unsigned PGM : 1;
1350 unsigned PGC : 1;
1351 unsigned PGD : 1;
1354 struct
1356 unsigned INT : 3;
1357 unsigned : 5;
1359 } __PORTBbits_t;
1361 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1363 #define _PORTB_RB0 0x01
1364 #define _PORTB_INT0 0x01
1365 #define _PORTB_RB1 0x02
1366 #define _PORTB_INT1 0x02
1367 #define _PORTB_RB2 0x04
1368 #define _PORTB_INT2 0x04
1369 #define _PORTB_RB3 0x08
1370 #define _PORTB_RB4 0x10
1371 #define _PORTB_RB5 0x20
1372 #define _PORTB_PGM 0x20
1373 #define _PORTB_RB6 0x40
1374 #define _PORTB_PGC 0x40
1375 #define _PORTB_RB7 0x80
1376 #define _PORTB_PGD 0x80
1378 //==============================================================================
1381 //==============================================================================
1382 // PORTC Bits
1384 extern __at(0x0F82) __sfr PORTC;
1386 typedef union
1388 struct
1390 unsigned RC0 : 1;
1391 unsigned RC1 : 1;
1392 unsigned RC2 : 1;
1393 unsigned : 1;
1394 unsigned RC4 : 1;
1395 unsigned RC5 : 1;
1396 unsigned RC6 : 1;
1397 unsigned RC7 : 1;
1400 struct
1402 unsigned T1OSO : 1;
1403 unsigned T1OSI : 1;
1404 unsigned CCP1 : 1;
1405 unsigned : 1;
1406 unsigned : 1;
1407 unsigned : 1;
1408 unsigned TX : 1;
1409 unsigned RX : 1;
1412 struct
1414 unsigned T13CKI : 1;
1415 unsigned : 1;
1416 unsigned P1A : 1;
1417 unsigned : 1;
1418 unsigned : 1;
1419 unsigned : 1;
1420 unsigned CK : 1;
1421 unsigned : 1;
1423 } __PORTCbits_t;
1425 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1427 #define _PORTC_RC0 0x01
1428 #define _PORTC_T1OSO 0x01
1429 #define _PORTC_T13CKI 0x01
1430 #define _PORTC_RC1 0x02
1431 #define _PORTC_T1OSI 0x02
1432 #define _PORTC_RC2 0x04
1433 #define _PORTC_CCP1 0x04
1434 #define _PORTC_P1A 0x04
1435 #define _PORTC_RC4 0x10
1436 #define _PORTC_RC5 0x20
1437 #define _PORTC_RC6 0x40
1438 #define _PORTC_TX 0x40
1439 #define _PORTC_CK 0x40
1440 #define _PORTC_RC7 0x80
1441 #define _PORTC_RX 0x80
1443 //==============================================================================
1446 //==============================================================================
1447 // PORTE Bits
1449 extern __at(0x0F84) __sfr PORTE;
1451 typedef struct
1453 unsigned : 1;
1454 unsigned : 1;
1455 unsigned : 1;
1456 unsigned RE3 : 1;
1457 unsigned : 1;
1458 unsigned : 1;
1459 unsigned : 1;
1460 unsigned : 1;
1461 } __PORTEbits_t;
1463 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1465 #define _RE3 0x08
1467 //==============================================================================
1470 //==============================================================================
1471 // WPUB Bits
1473 extern __at(0x0F85) __sfr WPUB;
1475 typedef struct
1477 unsigned WPUB0 : 1;
1478 unsigned WPUB1 : 1;
1479 unsigned WPUB2 : 1;
1480 unsigned WPUB3 : 1;
1481 unsigned WPUB4 : 1;
1482 unsigned WPUB5 : 1;
1483 unsigned WPUB6 : 1;
1484 unsigned WPUB7 : 1;
1485 } __WPUBbits_t;
1487 extern __at(0x0F85) volatile __WPUBbits_t WPUBbits;
1489 #define _WPUB0 0x01
1490 #define _WPUB1 0x02
1491 #define _WPUB2 0x04
1492 #define _WPUB3 0x08
1493 #define _WPUB4 0x10
1494 #define _WPUB5 0x20
1495 #define _WPUB6 0x40
1496 #define _WPUB7 0x80
1498 //==============================================================================
1501 //==============================================================================
1502 // IOCB Bits
1504 extern __at(0x0F86) __sfr IOCB;
1506 typedef struct
1508 unsigned : 1;
1509 unsigned : 1;
1510 unsigned : 1;
1511 unsigned : 1;
1512 unsigned IOCB4 : 1;
1513 unsigned IOCB5 : 1;
1514 unsigned IOCB6 : 1;
1515 unsigned IOCB7 : 1;
1516 } __IOCBbits_t;
1518 extern __at(0x0F86) volatile __IOCBbits_t IOCBbits;
1520 #define _IOCB4 0x10
1521 #define _IOCB5 0x20
1522 #define _IOCB6 0x40
1523 #define _IOCB7 0x80
1525 //==============================================================================
1528 //==============================================================================
1529 // IOCC Bits
1531 extern __at(0x0F87) __sfr IOCC;
1533 typedef struct
1535 unsigned IOCC0 : 1;
1536 unsigned IOCC1 : 1;
1537 unsigned IOCC2 : 1;
1538 unsigned : 1;
1539 unsigned IOCC4 : 1;
1540 unsigned IOCC5 : 1;
1541 unsigned IOCC6 : 1;
1542 unsigned IOCC7 : 1;
1543 } __IOCCbits_t;
1545 extern __at(0x0F87) volatile __IOCCbits_t IOCCbits;
1547 #define _IOCC0 0x01
1548 #define _IOCC1 0x02
1549 #define _IOCC2 0x04
1550 #define _IOCC4 0x10
1551 #define _IOCC5 0x20
1552 #define _IOCC6 0x40
1553 #define _IOCC7 0x80
1555 //==============================================================================
1558 //==============================================================================
1559 // CTMUICON Bits
1561 extern __at(0x0F88) __sfr CTMUICON;
1563 typedef union
1565 struct
1567 unsigned IRNG0 : 1;
1568 unsigned IRNG1 : 1;
1569 unsigned ITRIM0 : 1;
1570 unsigned ITRIM1 : 1;
1571 unsigned ITRIM2 : 1;
1572 unsigned ITRIM3 : 1;
1573 unsigned ITRIM4 : 1;
1574 unsigned ITRIM5 : 1;
1577 struct
1579 unsigned IRNG : 2;
1580 unsigned : 6;
1583 struct
1585 unsigned : 2;
1586 unsigned ITRIM : 6;
1588 } __CTMUICONbits_t;
1590 extern __at(0x0F88) volatile __CTMUICONbits_t CTMUICONbits;
1592 #define _IRNG0 0x01
1593 #define _IRNG1 0x02
1594 #define _ITRIM0 0x04
1595 #define _ITRIM1 0x08
1596 #define _ITRIM2 0x10
1597 #define _ITRIM3 0x20
1598 #define _ITRIM4 0x40
1599 #define _ITRIM5 0x80
1601 //==============================================================================
1604 //==============================================================================
1605 // LATA Bits
1607 extern __at(0x0F89) __sfr LATA;
1609 typedef struct
1611 unsigned LATA0 : 1;
1612 unsigned LATA1 : 1;
1613 unsigned LATA2 : 1;
1614 unsigned LATA3 : 1;
1615 unsigned LATA4 : 1;
1616 unsigned LATA5 : 1;
1617 unsigned LATA6 : 1;
1618 unsigned LATA7 : 1;
1619 } __LATAbits_t;
1621 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1623 #define _LATA0 0x01
1624 #define _LATA1 0x02
1625 #define _LATA2 0x04
1626 #define _LATA3 0x08
1627 #define _LATA4 0x10
1628 #define _LATA5 0x20
1629 #define _LATA6 0x40
1630 #define _LATA7 0x80
1632 //==============================================================================
1635 //==============================================================================
1636 // LATB Bits
1638 extern __at(0x0F8A) __sfr LATB;
1640 typedef struct
1642 unsigned LATB0 : 1;
1643 unsigned LATB1 : 1;
1644 unsigned LATB2 : 1;
1645 unsigned LATB3 : 1;
1646 unsigned LATB4 : 1;
1647 unsigned LATB5 : 1;
1648 unsigned LATB6 : 1;
1649 unsigned LATB7 : 1;
1650 } __LATBbits_t;
1652 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1654 #define _LATB0 0x01
1655 #define _LATB1 0x02
1656 #define _LATB2 0x04
1657 #define _LATB3 0x08
1658 #define _LATB4 0x10
1659 #define _LATB5 0x20
1660 #define _LATB6 0x40
1661 #define _LATB7 0x80
1663 //==============================================================================
1666 //==============================================================================
1667 // LATC Bits
1669 extern __at(0x0F8B) __sfr LATC;
1671 typedef struct
1673 unsigned LATC0 : 1;
1674 unsigned LATC1 : 1;
1675 unsigned LATC2 : 1;
1676 unsigned : 1;
1677 unsigned LATC4 : 1;
1678 unsigned LATC5 : 1;
1679 unsigned LATC6 : 1;
1680 unsigned LATC7 : 1;
1681 } __LATCbits_t;
1683 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1685 #define _LATC0 0x01
1686 #define _LATC1 0x02
1687 #define _LATC2 0x04
1688 #define _LATC4 0x10
1689 #define _LATC5 0x20
1690 #define _LATC6 0x40
1691 #define _LATC7 0x80
1693 //==============================================================================
1696 //==============================================================================
1697 // CTMUCON1 Bits
1699 extern __at(0x0F8E) __sfr CTMUCON1;
1701 typedef union
1703 struct
1705 unsigned EDG1STAT : 1;
1706 unsigned EDG2STAT : 1;
1707 unsigned EDG1SEL0 : 1;
1708 unsigned EDG1SEL1 : 1;
1709 unsigned EDG1POL : 1;
1710 unsigned EDG2SEL0 : 1;
1711 unsigned EDG2SEL1 : 1;
1712 unsigned EDG2POL : 1;
1715 struct
1717 unsigned : 2;
1718 unsigned EDG1SEL : 2;
1719 unsigned : 4;
1722 struct
1724 unsigned : 5;
1725 unsigned EDG2SEL : 2;
1726 unsigned : 1;
1728 } __CTMUCON1bits_t;
1730 extern __at(0x0F8E) volatile __CTMUCON1bits_t CTMUCON1bits;
1732 #define _EDG1STAT 0x01
1733 #define _EDG2STAT 0x02
1734 #define _EDG1SEL0 0x04
1735 #define _EDG1SEL1 0x08
1736 #define _EDG1POL 0x10
1737 #define _EDG2SEL0 0x20
1738 #define _EDG2SEL1 0x40
1739 #define _EDG2POL 0x80
1741 //==============================================================================
1744 //==============================================================================
1745 // CTMUCONL Bits
1747 extern __at(0x0F8E) __sfr CTMUCONL;
1749 typedef union
1751 struct
1753 unsigned EDG1STAT : 1;
1754 unsigned EDG2STAT : 1;
1755 unsigned EDG1SEL0 : 1;
1756 unsigned EDG1SEL1 : 1;
1757 unsigned EDG1POL : 1;
1758 unsigned EDG2SEL0 : 1;
1759 unsigned EDG2SEL1 : 1;
1760 unsigned EDG2POL : 1;
1763 struct
1765 unsigned : 2;
1766 unsigned EDG1SEL : 2;
1767 unsigned : 4;
1770 struct
1772 unsigned : 5;
1773 unsigned EDG2SEL : 2;
1774 unsigned : 1;
1776 } __CTMUCONLbits_t;
1778 extern __at(0x0F8E) volatile __CTMUCONLbits_t CTMUCONLbits;
1780 #define _CTMUCONL_EDG1STAT 0x01
1781 #define _CTMUCONL_EDG2STAT 0x02
1782 #define _CTMUCONL_EDG1SEL0 0x04
1783 #define _CTMUCONL_EDG1SEL1 0x08
1784 #define _CTMUCONL_EDG1POL 0x10
1785 #define _CTMUCONL_EDG2SEL0 0x20
1786 #define _CTMUCONL_EDG2SEL1 0x40
1787 #define _CTMUCONL_EDG2POL 0x80
1789 //==============================================================================
1792 //==============================================================================
1793 // CTMUCON0 Bits
1795 extern __at(0x0F8F) __sfr CTMUCON0;
1797 typedef union
1799 struct
1801 unsigned CTTRIG : 1;
1802 unsigned IDISSEN : 1;
1803 unsigned EDGSEQEN : 1;
1804 unsigned EDGEN : 1;
1805 unsigned TGEN : 1;
1806 unsigned CTMUSIDL : 1;
1807 unsigned : 1;
1808 unsigned CTMUEN : 1;
1811 struct
1813 unsigned TRIGEN : 1;
1814 unsigned : 1;
1815 unsigned : 1;
1816 unsigned : 1;
1817 unsigned : 1;
1818 unsigned SIDL : 1;
1819 unsigned : 1;
1820 unsigned ON : 1;
1822 } __CTMUCON0bits_t;
1824 extern __at(0x0F8F) volatile __CTMUCON0bits_t CTMUCON0bits;
1826 #define _CTTRIG 0x01
1827 #define _TRIGEN 0x01
1828 #define _IDISSEN 0x02
1829 #define _EDGSEQEN 0x04
1830 #define _EDGEN 0x08
1831 #define _TGEN 0x10
1832 #define _CTMUSIDL 0x20
1833 #define _SIDL 0x20
1834 #define _CTMUEN 0x80
1835 #define _ON 0x80
1837 //==============================================================================
1840 //==============================================================================
1841 // CTMUCONH Bits
1843 extern __at(0x0F8F) __sfr CTMUCONH;
1845 typedef union
1847 struct
1849 unsigned CTTRIG : 1;
1850 unsigned IDISSEN : 1;
1851 unsigned EDGSEQEN : 1;
1852 unsigned EDGEN : 1;
1853 unsigned TGEN : 1;
1854 unsigned CTMUSIDL : 1;
1855 unsigned : 1;
1856 unsigned CTMUEN : 1;
1859 struct
1861 unsigned TRIGEN : 1;
1862 unsigned : 1;
1863 unsigned : 1;
1864 unsigned : 1;
1865 unsigned : 1;
1866 unsigned SIDL : 1;
1867 unsigned : 1;
1868 unsigned ON : 1;
1870 } __CTMUCONHbits_t;
1872 extern __at(0x0F8F) volatile __CTMUCONHbits_t CTMUCONHbits;
1874 #define _CTMUCONH_CTTRIG 0x01
1875 #define _CTMUCONH_TRIGEN 0x01
1876 #define _CTMUCONH_IDISSEN 0x02
1877 #define _CTMUCONH_EDGSEQEN 0x04
1878 #define _CTMUCONH_EDGEN 0x08
1879 #define _CTMUCONH_TGEN 0x10
1880 #define _CTMUCONH_CTMUSIDL 0x20
1881 #define _CTMUCONH_SIDL 0x20
1882 #define _CTMUCONH_CTMUEN 0x80
1883 #define _CTMUCONH_ON 0x80
1885 //==============================================================================
1887 extern __at(0x0F90) __sfr CCPR2;
1888 extern __at(0x0F90) __sfr CCPR2L;
1889 extern __at(0x0F91) __sfr CCPR2H;
1891 //==============================================================================
1892 // DDRA Bits
1894 extern __at(0x0F92) __sfr DDRA;
1896 typedef union
1898 struct
1900 unsigned TRISA0 : 1;
1901 unsigned TRISA1 : 1;
1902 unsigned TRISA2 : 1;
1903 unsigned TRISA3 : 1;
1904 unsigned TRISA4 : 1;
1905 unsigned TRISA5 : 1;
1906 unsigned TRISA6 : 1;
1907 unsigned TRISA7 : 1;
1910 struct
1912 unsigned RA0 : 1;
1913 unsigned RA1 : 1;
1914 unsigned RA2 : 1;
1915 unsigned RA3 : 1;
1916 unsigned RA4 : 1;
1917 unsigned RA5 : 1;
1918 unsigned RA6 : 1;
1919 unsigned RA7 : 1;
1921 } __DDRAbits_t;
1923 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1925 #define _TRISA0 0x01
1926 #define _RA0 0x01
1927 #define _TRISA1 0x02
1928 #define _RA1 0x02
1929 #define _TRISA2 0x04
1930 #define _RA2 0x04
1931 #define _TRISA3 0x08
1932 #define _RA3 0x08
1933 #define _TRISA4 0x10
1934 #define _RA4 0x10
1935 #define _TRISA5 0x20
1936 #define _RA5 0x20
1937 #define _TRISA6 0x40
1938 #define _RA6 0x40
1939 #define _TRISA7 0x80
1940 #define _RA7 0x80
1942 //==============================================================================
1945 //==============================================================================
1946 // TRISA Bits
1948 extern __at(0x0F92) __sfr TRISA;
1950 typedef union
1952 struct
1954 unsigned TRISA0 : 1;
1955 unsigned TRISA1 : 1;
1956 unsigned TRISA2 : 1;
1957 unsigned TRISA3 : 1;
1958 unsigned TRISA4 : 1;
1959 unsigned TRISA5 : 1;
1960 unsigned TRISA6 : 1;
1961 unsigned TRISA7 : 1;
1964 struct
1966 unsigned RA0 : 1;
1967 unsigned RA1 : 1;
1968 unsigned RA2 : 1;
1969 unsigned RA3 : 1;
1970 unsigned RA4 : 1;
1971 unsigned RA5 : 1;
1972 unsigned RA6 : 1;
1973 unsigned RA7 : 1;
1975 } __TRISAbits_t;
1977 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1979 #define _TRISA_TRISA0 0x01
1980 #define _TRISA_RA0 0x01
1981 #define _TRISA_TRISA1 0x02
1982 #define _TRISA_RA1 0x02
1983 #define _TRISA_TRISA2 0x04
1984 #define _TRISA_RA2 0x04
1985 #define _TRISA_TRISA3 0x08
1986 #define _TRISA_RA3 0x08
1987 #define _TRISA_TRISA4 0x10
1988 #define _TRISA_RA4 0x10
1989 #define _TRISA_TRISA5 0x20
1990 #define _TRISA_RA5 0x20
1991 #define _TRISA_TRISA6 0x40
1992 #define _TRISA_RA6 0x40
1993 #define _TRISA_TRISA7 0x80
1994 #define _TRISA_RA7 0x80
1996 //==============================================================================
1999 //==============================================================================
2000 // DDRB Bits
2002 extern __at(0x0F93) __sfr DDRB;
2004 typedef union
2006 struct
2008 unsigned TRISB0 : 1;
2009 unsigned TRISB1 : 1;
2010 unsigned TRISB2 : 1;
2011 unsigned TRISB3 : 1;
2012 unsigned TRISB4 : 1;
2013 unsigned TRISB5 : 1;
2014 unsigned TRISB6 : 1;
2015 unsigned TRISB7 : 1;
2018 struct
2020 unsigned RB0 : 1;
2021 unsigned RB1 : 1;
2022 unsigned RB2 : 1;
2023 unsigned RB3 : 1;
2024 unsigned RB4 : 1;
2025 unsigned RB5 : 1;
2026 unsigned RB6 : 1;
2027 unsigned RB7 : 1;
2029 } __DDRBbits_t;
2031 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2033 #define _TRISB0 0x01
2034 #define _RB0 0x01
2035 #define _TRISB1 0x02
2036 #define _RB1 0x02
2037 #define _TRISB2 0x04
2038 #define _RB2 0x04
2039 #define _TRISB3 0x08
2040 #define _RB3 0x08
2041 #define _TRISB4 0x10
2042 #define _RB4 0x10
2043 #define _TRISB5 0x20
2044 #define _RB5 0x20
2045 #define _TRISB6 0x40
2046 #define _RB6 0x40
2047 #define _TRISB7 0x80
2048 #define _RB7 0x80
2050 //==============================================================================
2053 //==============================================================================
2054 // TRISB Bits
2056 extern __at(0x0F93) __sfr TRISB;
2058 typedef union
2060 struct
2062 unsigned TRISB0 : 1;
2063 unsigned TRISB1 : 1;
2064 unsigned TRISB2 : 1;
2065 unsigned TRISB3 : 1;
2066 unsigned TRISB4 : 1;
2067 unsigned TRISB5 : 1;
2068 unsigned TRISB6 : 1;
2069 unsigned TRISB7 : 1;
2072 struct
2074 unsigned RB0 : 1;
2075 unsigned RB1 : 1;
2076 unsigned RB2 : 1;
2077 unsigned RB3 : 1;
2078 unsigned RB4 : 1;
2079 unsigned RB5 : 1;
2080 unsigned RB6 : 1;
2081 unsigned RB7 : 1;
2083 } __TRISBbits_t;
2085 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2087 #define _TRISB_TRISB0 0x01
2088 #define _TRISB_RB0 0x01
2089 #define _TRISB_TRISB1 0x02
2090 #define _TRISB_RB1 0x02
2091 #define _TRISB_TRISB2 0x04
2092 #define _TRISB_RB2 0x04
2093 #define _TRISB_TRISB3 0x08
2094 #define _TRISB_RB3 0x08
2095 #define _TRISB_TRISB4 0x10
2096 #define _TRISB_RB4 0x10
2097 #define _TRISB_TRISB5 0x20
2098 #define _TRISB_RB5 0x20
2099 #define _TRISB_TRISB6 0x40
2100 #define _TRISB_RB6 0x40
2101 #define _TRISB_TRISB7 0x80
2102 #define _TRISB_RB7 0x80
2104 //==============================================================================
2107 //==============================================================================
2108 // DDRC Bits
2110 extern __at(0x0F94) __sfr DDRC;
2112 typedef union
2114 struct
2116 unsigned TRISC0 : 1;
2117 unsigned TRISC1 : 1;
2118 unsigned TRISC2 : 1;
2119 unsigned : 1;
2120 unsigned TRISC4 : 1;
2121 unsigned TRISC5 : 1;
2122 unsigned TRISC6 : 1;
2123 unsigned TRISC7 : 1;
2126 struct
2128 unsigned RC0 : 1;
2129 unsigned RC1 : 1;
2130 unsigned RC2 : 1;
2131 unsigned : 1;
2132 unsigned : 1;
2133 unsigned : 1;
2134 unsigned RC6 : 1;
2135 unsigned RC7 : 1;
2137 } __DDRCbits_t;
2139 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2141 #define _TRISC0 0x01
2142 #define _RC0 0x01
2143 #define _TRISC1 0x02
2144 #define _RC1 0x02
2145 #define _TRISC2 0x04
2146 #define _RC2 0x04
2147 #define _TRISC4 0x10
2148 #define _TRISC5 0x20
2149 #define _TRISC6 0x40
2150 #define _RC6 0x40
2151 #define _TRISC7 0x80
2152 #define _RC7 0x80
2154 //==============================================================================
2157 //==============================================================================
2158 // TRISC Bits
2160 extern __at(0x0F94) __sfr TRISC;
2162 typedef union
2164 struct
2166 unsigned TRISC0 : 1;
2167 unsigned TRISC1 : 1;
2168 unsigned TRISC2 : 1;
2169 unsigned : 1;
2170 unsigned TRISC4 : 1;
2171 unsigned TRISC5 : 1;
2172 unsigned TRISC6 : 1;
2173 unsigned TRISC7 : 1;
2176 struct
2178 unsigned RC0 : 1;
2179 unsigned RC1 : 1;
2180 unsigned RC2 : 1;
2181 unsigned : 1;
2182 unsigned : 1;
2183 unsigned : 1;
2184 unsigned RC6 : 1;
2185 unsigned RC7 : 1;
2187 } __TRISCbits_t;
2189 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2191 #define _TRISC_TRISC0 0x01
2192 #define _TRISC_RC0 0x01
2193 #define _TRISC_TRISC1 0x02
2194 #define _TRISC_RC1 0x02
2195 #define _TRISC_TRISC2 0x04
2196 #define _TRISC_RC2 0x04
2197 #define _TRISC_TRISC4 0x10
2198 #define _TRISC_TRISC5 0x20
2199 #define _TRISC_TRISC6 0x40
2200 #define _TRISC_RC6 0x40
2201 #define _TRISC_TRISC7 0x80
2202 #define _TRISC_RC7 0x80
2204 //==============================================================================
2207 //==============================================================================
2208 // CCP2CON Bits
2210 extern __at(0x0F97) __sfr CCP2CON;
2212 typedef union
2214 struct
2216 unsigned CCP2M0 : 1;
2217 unsigned CCP2M1 : 1;
2218 unsigned CCP2M2 : 1;
2219 unsigned CCP2M3 : 1;
2220 unsigned DC2B0 : 1;
2221 unsigned DC2B1 : 1;
2222 unsigned : 1;
2223 unsigned : 1;
2226 struct
2228 unsigned : 1;
2229 unsigned : 1;
2230 unsigned : 1;
2231 unsigned : 1;
2232 unsigned CCP2Y : 1;
2233 unsigned CCP2X : 1;
2234 unsigned : 1;
2235 unsigned : 1;
2238 struct
2240 unsigned CCP2M : 4;
2241 unsigned : 4;
2244 struct
2246 unsigned : 4;
2247 unsigned DC2B : 2;
2248 unsigned : 2;
2250 } __CCP2CONbits_t;
2252 extern __at(0x0F97) volatile __CCP2CONbits_t CCP2CONbits;
2254 #define _CCP2M0 0x01
2255 #define _CCP2M1 0x02
2256 #define _CCP2M2 0x04
2257 #define _CCP2M3 0x08
2258 #define _DC2B0 0x10
2259 #define _CCP2Y 0x10
2260 #define _DC2B1 0x20
2261 #define _CCP2X 0x20
2263 //==============================================================================
2266 //==============================================================================
2267 // ECCP2CON Bits
2269 extern __at(0x0F97) __sfr ECCP2CON;
2271 typedef union
2273 struct
2275 unsigned CCP2M0 : 1;
2276 unsigned CCP2M1 : 1;
2277 unsigned CCP2M2 : 1;
2278 unsigned CCP2M3 : 1;
2279 unsigned DC2B0 : 1;
2280 unsigned DC2B1 : 1;
2281 unsigned : 1;
2282 unsigned : 1;
2285 struct
2287 unsigned : 1;
2288 unsigned : 1;
2289 unsigned : 1;
2290 unsigned : 1;
2291 unsigned CCP2Y : 1;
2292 unsigned CCP2X : 1;
2293 unsigned : 1;
2294 unsigned : 1;
2297 struct
2299 unsigned CCP2M : 4;
2300 unsigned : 4;
2303 struct
2305 unsigned : 4;
2306 unsigned DC2B : 2;
2307 unsigned : 2;
2309 } __ECCP2CONbits_t;
2311 extern __at(0x0F97) volatile __ECCP2CONbits_t ECCP2CONbits;
2313 #define _ECCP2CON_CCP2M0 0x01
2314 #define _ECCP2CON_CCP2M1 0x02
2315 #define _ECCP2CON_CCP2M2 0x04
2316 #define _ECCP2CON_CCP2M3 0x08
2317 #define _ECCP2CON_DC2B0 0x10
2318 #define _ECCP2CON_CCP2Y 0x10
2319 #define _ECCP2CON_DC2B1 0x20
2320 #define _ECCP2CON_CCP2X 0x20
2322 //==============================================================================
2325 //==============================================================================
2326 // CM1CON0 Bits
2328 extern __at(0x0F98) __sfr CM1CON0;
2330 typedef union
2332 struct
2334 unsigned C1CH0 : 1;
2335 unsigned C1CH1 : 1;
2336 unsigned C1R : 1;
2337 unsigned C1SP : 1;
2338 unsigned C1POL : 1;
2339 unsigned C1OE : 1;
2340 unsigned C1OUT : 1;
2341 unsigned C1ON : 1;
2344 struct
2346 unsigned CCH0 : 1;
2347 unsigned CCH1 : 1;
2348 unsigned CREF : 1;
2349 unsigned : 1;
2350 unsigned CPOL : 1;
2351 unsigned COE : 1;
2352 unsigned COUT1 : 1;
2353 unsigned CON : 1;
2356 struct
2358 unsigned C1CH : 2;
2359 unsigned : 6;
2362 struct
2364 unsigned CCH : 2;
2365 unsigned : 6;
2367 } __CM1CON0bits_t;
2369 extern __at(0x0F98) volatile __CM1CON0bits_t CM1CON0bits;
2371 #define _C1CH0 0x01
2372 #define _CCH0 0x01
2373 #define _C1CH1 0x02
2374 #define _CCH1 0x02
2375 #define _C1R 0x04
2376 #define _CREF 0x04
2377 #define _C1SP 0x08
2378 #define _C1POL 0x10
2379 #define _CPOL 0x10
2380 #define _C1OE 0x20
2381 #define _COE 0x20
2382 #define _C1OUT 0x40
2383 #define _COUT1 0x40
2384 #define _C1ON 0x80
2385 #define _CON 0x80
2387 //==============================================================================
2390 //==============================================================================
2391 // CM2CON0 Bits
2393 extern __at(0x0F99) __sfr CM2CON0;
2395 typedef union
2397 struct
2399 unsigned C2CH0 : 1;
2400 unsigned C2CH1 : 1;
2401 unsigned C2R : 1;
2402 unsigned C2SP : 1;
2403 unsigned C2POL : 1;
2404 unsigned C2OE : 1;
2405 unsigned C2OUT : 1;
2406 unsigned C2ON : 1;
2409 struct
2411 unsigned CCH0 : 1;
2412 unsigned CCH1 : 1;
2413 unsigned CREF : 1;
2414 unsigned : 1;
2415 unsigned CPOL : 1;
2416 unsigned COE : 1;
2417 unsigned COUT2 : 1;
2418 unsigned CON : 1;
2421 struct
2423 unsigned C2CH : 2;
2424 unsigned : 6;
2427 struct
2429 unsigned CCH : 2;
2430 unsigned : 6;
2432 } __CM2CON0bits_t;
2434 extern __at(0x0F99) volatile __CM2CON0bits_t CM2CON0bits;
2436 #define _CM2CON0_C2CH0 0x01
2437 #define _CM2CON0_CCH0 0x01
2438 #define _CM2CON0_C2CH1 0x02
2439 #define _CM2CON0_CCH1 0x02
2440 #define _CM2CON0_C2R 0x04
2441 #define _CM2CON0_CREF 0x04
2442 #define _CM2CON0_C2SP 0x08
2443 #define _CM2CON0_C2POL 0x10
2444 #define _CM2CON0_CPOL 0x10
2445 #define _CM2CON0_C2OE 0x20
2446 #define _CM2CON0_COE 0x20
2447 #define _CM2CON0_C2OUT 0x40
2448 #define _CM2CON0_COUT2 0x40
2449 #define _CM2CON0_C2ON 0x80
2450 #define _CM2CON0_CON 0x80
2452 //==============================================================================
2455 //==============================================================================
2456 // CM2CON1 Bits
2458 extern __at(0x0F9A) __sfr CM2CON1;
2460 typedef struct
2462 unsigned C2SYNC : 1;
2463 unsigned C1SYNC : 1;
2464 unsigned C2HYS : 1;
2465 unsigned C1HYS : 1;
2466 unsigned C2RSEL : 1;
2467 unsigned C1RSEL : 1;
2468 unsigned MC2OUT : 1;
2469 unsigned MC1OUT : 1;
2470 } __CM2CON1bits_t;
2472 extern __at(0x0F9A) volatile __CM2CON1bits_t CM2CON1bits;
2474 #define _C2SYNC 0x01
2475 #define _C1SYNC 0x02
2476 #define _C2HYS 0x04
2477 #define _C1HYS 0x08
2478 #define _C2RSEL 0x10
2479 #define _C1RSEL 0x20
2480 #define _MC2OUT 0x40
2481 #define _MC1OUT 0x80
2483 //==============================================================================
2486 //==============================================================================
2487 // OSCTUNE Bits
2489 extern __at(0x0F9B) __sfr OSCTUNE;
2491 typedef union
2493 struct
2495 unsigned TUN0 : 1;
2496 unsigned TUN1 : 1;
2497 unsigned TUN2 : 1;
2498 unsigned TUN3 : 1;
2499 unsigned TUN4 : 1;
2500 unsigned TUN5 : 1;
2501 unsigned TUN6 : 1;
2502 unsigned SPLLMULT : 1;
2505 struct
2507 unsigned TUN : 7;
2508 unsigned : 1;
2510 } __OSCTUNEbits_t;
2512 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2514 #define _TUN0 0x01
2515 #define _TUN1 0x02
2516 #define _TUN2 0x04
2517 #define _TUN3 0x08
2518 #define _TUN4 0x10
2519 #define _TUN5 0x20
2520 #define _TUN6 0x40
2521 #define _SPLLMULT 0x80
2523 //==============================================================================
2526 //==============================================================================
2527 // HLVDCON Bits
2529 extern __at(0x0F9C) __sfr HLVDCON;
2531 typedef union
2533 struct
2535 unsigned HLVDL0 : 1;
2536 unsigned HLVDL1 : 1;
2537 unsigned HLVDL2 : 1;
2538 unsigned HLVDL3 : 1;
2539 unsigned HLVDEN : 1;
2540 unsigned IRVST : 1;
2541 unsigned BGVST : 1;
2542 unsigned VDIRMAG : 1;
2545 struct
2547 unsigned HLVDL : 4;
2548 unsigned : 4;
2550 } __HLVDCONbits_t;
2552 extern __at(0x0F9C) volatile __HLVDCONbits_t HLVDCONbits;
2554 #define _HLVDL0 0x01
2555 #define _HLVDL1 0x02
2556 #define _HLVDL2 0x04
2557 #define _HLVDL3 0x08
2558 #define _HLVDEN 0x10
2559 #define _IRVST 0x20
2560 #define _BGVST 0x40
2561 #define _VDIRMAG 0x80
2563 //==============================================================================
2566 //==============================================================================
2567 // PIE1 Bits
2569 extern __at(0x0F9D) __sfr PIE1;
2571 typedef union
2573 struct
2575 unsigned TMR1IE : 1;
2576 unsigned TMR2IE : 1;
2577 unsigned CCP1IE : 1;
2578 unsigned SSPIE : 1;
2579 unsigned TXIE : 1;
2580 unsigned RCIE : 1;
2581 unsigned ADIE : 1;
2582 unsigned ACTIE : 1;
2585 struct
2587 unsigned : 1;
2588 unsigned : 1;
2589 unsigned : 1;
2590 unsigned SSP1IE : 1;
2591 unsigned TX1IE : 1;
2592 unsigned RC1IE : 1;
2593 unsigned : 1;
2594 unsigned STIE : 1;
2596 } __PIE1bits_t;
2598 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
2600 #define _TMR1IE 0x01
2601 #define _TMR2IE 0x02
2602 #define _CCP1IE 0x04
2603 #define _SSPIE 0x08
2604 #define _SSP1IE 0x08
2605 #define _TXIE 0x10
2606 #define _TX1IE 0x10
2607 #define _RCIE 0x20
2608 #define _RC1IE 0x20
2609 #define _ADIE 0x40
2610 #define _ACTIE 0x80
2611 #define _STIE 0x80
2613 //==============================================================================
2616 //==============================================================================
2617 // PIR1 Bits
2619 extern __at(0x0F9E) __sfr PIR1;
2621 typedef union
2623 struct
2625 unsigned TMR1IF : 1;
2626 unsigned TMR2IF : 1;
2627 unsigned CCP1IF : 1;
2628 unsigned SSPIF : 1;
2629 unsigned TXIF : 1;
2630 unsigned RCIF : 1;
2631 unsigned ADIF : 1;
2632 unsigned ACTIF : 1;
2635 struct
2637 unsigned : 1;
2638 unsigned : 1;
2639 unsigned : 1;
2640 unsigned SSP1IF : 1;
2641 unsigned TX1IF : 1;
2642 unsigned RC1IF : 1;
2643 unsigned : 1;
2644 unsigned STIF : 1;
2646 } __PIR1bits_t;
2648 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2650 #define _TMR1IF 0x01
2651 #define _TMR2IF 0x02
2652 #define _CCP1IF 0x04
2653 #define _SSPIF 0x08
2654 #define _SSP1IF 0x08
2655 #define _TXIF 0x10
2656 #define _TX1IF 0x10
2657 #define _RCIF 0x20
2658 #define _RC1IF 0x20
2659 #define _ADIF 0x40
2660 #define _ACTIF 0x80
2661 #define _STIF 0x80
2663 //==============================================================================
2666 //==============================================================================
2667 // IPR1 Bits
2669 extern __at(0x0F9F) __sfr IPR1;
2671 typedef union
2673 struct
2675 unsigned TMR1IP : 1;
2676 unsigned TMR2IP : 1;
2677 unsigned CCP1IP : 1;
2678 unsigned SSPIP : 1;
2679 unsigned TXIP : 1;
2680 unsigned RCIP : 1;
2681 unsigned ADIP : 1;
2682 unsigned ACTIP : 1;
2685 struct
2687 unsigned : 1;
2688 unsigned : 1;
2689 unsigned : 1;
2690 unsigned SSP1IP : 1;
2691 unsigned TX1IP : 1;
2692 unsigned RC1IP : 1;
2693 unsigned : 1;
2694 unsigned STIP : 1;
2696 } __IPR1bits_t;
2698 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2700 #define _TMR1IP 0x01
2701 #define _TMR2IP 0x02
2702 #define _CCP1IP 0x04
2703 #define _SSPIP 0x08
2704 #define _SSP1IP 0x08
2705 #define _TXIP 0x10
2706 #define _TX1IP 0x10
2707 #define _RCIP 0x20
2708 #define _RC1IP 0x20
2709 #define _ADIP 0x40
2710 #define _ACTIP 0x80
2711 #define _STIP 0x80
2713 //==============================================================================
2716 //==============================================================================
2717 // PIE2 Bits
2719 extern __at(0x0FA0) __sfr PIE2;
2721 typedef union
2723 struct
2725 unsigned CCP2IE : 1;
2726 unsigned TMR3IE : 1;
2727 unsigned HLVDIE : 1;
2728 unsigned BCLIE : 1;
2729 unsigned EEIE : 1;
2730 unsigned C2IE : 1;
2731 unsigned C1IE : 1;
2732 unsigned OSCFIE : 1;
2735 struct
2737 unsigned : 1;
2738 unsigned : 1;
2739 unsigned LVDIE : 1;
2740 unsigned BCL1IE : 1;
2741 unsigned : 1;
2742 unsigned CM2IE : 1;
2743 unsigned CM1IE : 1;
2744 unsigned : 1;
2746 } __PIE2bits_t;
2748 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2750 #define _CCP2IE 0x01
2751 #define _TMR3IE 0x02
2752 #define _HLVDIE 0x04
2753 #define _LVDIE 0x04
2754 #define _BCLIE 0x08
2755 #define _BCL1IE 0x08
2756 #define _EEIE 0x10
2757 #define _C2IE 0x20
2758 #define _CM2IE 0x20
2759 #define _C1IE 0x40
2760 #define _CM1IE 0x40
2761 #define _OSCFIE 0x80
2763 //==============================================================================
2766 //==============================================================================
2767 // PIR2 Bits
2769 extern __at(0x0FA1) __sfr PIR2;
2771 typedef union
2773 struct
2775 unsigned CCP2IF : 1;
2776 unsigned TMR3IF : 1;
2777 unsigned HLVDIF : 1;
2778 unsigned BCLIF : 1;
2779 unsigned EEIF : 1;
2780 unsigned C2IF : 1;
2781 unsigned C1IF : 1;
2782 unsigned OSCFIF : 1;
2785 struct
2787 unsigned : 1;
2788 unsigned : 1;
2789 unsigned LVDIF : 1;
2790 unsigned BCL1IF : 1;
2791 unsigned : 1;
2792 unsigned CM2IF : 1;
2793 unsigned CM1IF : 1;
2794 unsigned : 1;
2796 } __PIR2bits_t;
2798 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2800 #define _CCP2IF 0x01
2801 #define _TMR3IF 0x02
2802 #define _HLVDIF 0x04
2803 #define _LVDIF 0x04
2804 #define _BCLIF 0x08
2805 #define _BCL1IF 0x08
2806 #define _EEIF 0x10
2807 #define _C2IF 0x20
2808 #define _CM2IF 0x20
2809 #define _C1IF 0x40
2810 #define _CM1IF 0x40
2811 #define _OSCFIF 0x80
2813 //==============================================================================
2816 //==============================================================================
2817 // IPR2 Bits
2819 extern __at(0x0FA2) __sfr IPR2;
2821 typedef union
2823 struct
2825 unsigned CCP2IP : 1;
2826 unsigned TMR3IP : 1;
2827 unsigned HLVDIP : 1;
2828 unsigned BCLIP : 1;
2829 unsigned EEIP : 1;
2830 unsigned C2IP : 1;
2831 unsigned C1IP : 1;
2832 unsigned OSCFIP : 1;
2835 struct
2837 unsigned : 1;
2838 unsigned : 1;
2839 unsigned LVDIP : 1;
2840 unsigned BCL1IP : 1;
2841 unsigned : 1;
2842 unsigned CM2IP : 1;
2843 unsigned CM1IP : 1;
2844 unsigned : 1;
2846 } __IPR2bits_t;
2848 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
2850 #define _CCP2IP 0x01
2851 #define _TMR3IP 0x02
2852 #define _HLVDIP 0x04
2853 #define _LVDIP 0x04
2854 #define _BCLIP 0x08
2855 #define _BCL1IP 0x08
2856 #define _EEIP 0x10
2857 #define _C2IP 0x20
2858 #define _CM2IP 0x20
2859 #define _C1IP 0x40
2860 #define _CM1IP 0x40
2861 #define _OSCFIP 0x80
2863 //==============================================================================
2866 //==============================================================================
2867 // PIE3 Bits
2869 extern __at(0x0FA3) __sfr PIE3;
2871 typedef struct
2873 unsigned TMR1GIE : 1;
2874 unsigned TMR3GIE : 1;
2875 unsigned USBIE : 1;
2876 unsigned CTMUIE : 1;
2877 unsigned : 1;
2878 unsigned : 1;
2879 unsigned : 1;
2880 unsigned : 1;
2881 } __PIE3bits_t;
2883 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
2885 #define _TMR1GIE 0x01
2886 #define _TMR3GIE 0x02
2887 #define _USBIE 0x04
2888 #define _CTMUIE 0x08
2890 //==============================================================================
2893 //==============================================================================
2894 // PIR3 Bits
2896 extern __at(0x0FA4) __sfr PIR3;
2898 typedef struct
2900 unsigned TMR1GIF : 1;
2901 unsigned TMR3GIF : 1;
2902 unsigned USBIF : 1;
2903 unsigned CTMUIF : 1;
2904 unsigned : 1;
2905 unsigned : 1;
2906 unsigned : 1;
2907 unsigned : 1;
2908 } __PIR3bits_t;
2910 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
2912 #define _TMR1GIF 0x01
2913 #define _TMR3GIF 0x02
2914 #define _USBIF 0x04
2915 #define _CTMUIF 0x08
2917 //==============================================================================
2920 //==============================================================================
2921 // IPR3 Bits
2923 extern __at(0x0FA5) __sfr IPR3;
2925 typedef struct
2927 unsigned TMR1GIP : 1;
2928 unsigned TMR3GIP : 1;
2929 unsigned USBIP : 1;
2930 unsigned CTMUIP : 1;
2931 unsigned : 1;
2932 unsigned : 1;
2933 unsigned : 1;
2934 unsigned : 1;
2935 } __IPR3bits_t;
2937 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
2939 #define _TMR1GIP 0x01
2940 #define _TMR3GIP 0x02
2941 #define _USBIP 0x04
2942 #define _CTMUIP 0x08
2944 //==============================================================================
2947 //==============================================================================
2948 // EECON1 Bits
2950 extern __at(0x0FA6) __sfr EECON1;
2952 typedef struct
2954 unsigned RD : 1;
2955 unsigned WR : 1;
2956 unsigned WREN : 1;
2957 unsigned WRERR : 1;
2958 unsigned FREE : 1;
2959 unsigned : 1;
2960 unsigned CFGS : 1;
2961 unsigned EEPGD : 1;
2962 } __EECON1bits_t;
2964 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
2966 #define _RD 0x01
2967 #define _WR 0x02
2968 #define _WREN 0x04
2969 #define _WRERR 0x08
2970 #define _FREE 0x10
2971 #define _CFGS 0x40
2972 #define _EEPGD 0x80
2974 //==============================================================================
2976 extern __at(0x0FA7) __sfr EECON2;
2977 extern __at(0x0FA8) __sfr EEDATA;
2978 extern __at(0x0FA9) __sfr EEADR;
2980 //==============================================================================
2981 // RCSTA Bits
2983 extern __at(0x0FAB) __sfr RCSTA;
2985 typedef union
2987 struct
2989 unsigned RX9D : 1;
2990 unsigned OERR : 1;
2991 unsigned FERR : 1;
2992 unsigned ADDEN : 1;
2993 unsigned CREN : 1;
2994 unsigned SREN : 1;
2995 unsigned RX9 : 1;
2996 unsigned SPEN : 1;
2999 struct
3001 unsigned : 1;
3002 unsigned : 1;
3003 unsigned : 1;
3004 unsigned ADEN : 1;
3005 unsigned : 1;
3006 unsigned : 1;
3007 unsigned : 1;
3008 unsigned : 1;
3010 } __RCSTAbits_t;
3012 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3014 #define _RX9D 0x01
3015 #define _OERR 0x02
3016 #define _FERR 0x04
3017 #define _ADDEN 0x08
3018 #define _ADEN 0x08
3019 #define _CREN 0x10
3020 #define _SREN 0x20
3021 #define _RX9 0x40
3022 #define _SPEN 0x80
3024 //==============================================================================
3027 //==============================================================================
3028 // RCSTA1 Bits
3030 extern __at(0x0FAB) __sfr RCSTA1;
3032 typedef union
3034 struct
3036 unsigned RX9D : 1;
3037 unsigned OERR : 1;
3038 unsigned FERR : 1;
3039 unsigned ADDEN : 1;
3040 unsigned CREN : 1;
3041 unsigned SREN : 1;
3042 unsigned RX9 : 1;
3043 unsigned SPEN : 1;
3046 struct
3048 unsigned : 1;
3049 unsigned : 1;
3050 unsigned : 1;
3051 unsigned ADEN : 1;
3052 unsigned : 1;
3053 unsigned : 1;
3054 unsigned : 1;
3055 unsigned : 1;
3057 } __RCSTA1bits_t;
3059 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
3061 #define _RCSTA1_RX9D 0x01
3062 #define _RCSTA1_OERR 0x02
3063 #define _RCSTA1_FERR 0x04
3064 #define _RCSTA1_ADDEN 0x08
3065 #define _RCSTA1_ADEN 0x08
3066 #define _RCSTA1_CREN 0x10
3067 #define _RCSTA1_SREN 0x20
3068 #define _RCSTA1_RX9 0x40
3069 #define _RCSTA1_SPEN 0x80
3071 //==============================================================================
3074 //==============================================================================
3075 // TXSTA Bits
3077 extern __at(0x0FAC) __sfr TXSTA;
3079 typedef struct
3081 unsigned TX9D : 1;
3082 unsigned TRMT : 1;
3083 unsigned BRGH : 1;
3084 unsigned SENDB : 1;
3085 unsigned SYNC : 1;
3086 unsigned TXEN : 1;
3087 unsigned TX9 : 1;
3088 unsigned CSRC : 1;
3089 } __TXSTAbits_t;
3091 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
3093 #define _TX9D 0x01
3094 #define _TRMT 0x02
3095 #define _BRGH 0x04
3096 #define _SENDB 0x08
3097 #define _SYNC 0x10
3098 #define _TXEN 0x20
3099 #define _TX9 0x40
3100 #define _CSRC 0x80
3102 //==============================================================================
3105 //==============================================================================
3106 // TXSTA1 Bits
3108 extern __at(0x0FAC) __sfr TXSTA1;
3110 typedef struct
3112 unsigned TX9D : 1;
3113 unsigned TRMT : 1;
3114 unsigned BRGH : 1;
3115 unsigned SENDB : 1;
3116 unsigned SYNC : 1;
3117 unsigned TXEN : 1;
3118 unsigned TX9 : 1;
3119 unsigned CSRC : 1;
3120 } __TXSTA1bits_t;
3122 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
3124 #define _TXSTA1_TX9D 0x01
3125 #define _TXSTA1_TRMT 0x02
3126 #define _TXSTA1_BRGH 0x04
3127 #define _TXSTA1_SENDB 0x08
3128 #define _TXSTA1_SYNC 0x10
3129 #define _TXSTA1_TXEN 0x20
3130 #define _TXSTA1_TX9 0x40
3131 #define _TXSTA1_CSRC 0x80
3133 //==============================================================================
3135 extern __at(0x0FAD) __sfr TXREG;
3136 extern __at(0x0FAD) __sfr TXREG1;
3137 extern __at(0x0FAE) __sfr RCREG;
3138 extern __at(0x0FAE) __sfr RCREG1;
3140 //==============================================================================
3141 // SPBRG Bits
3143 extern __at(0x0FAF) __sfr SPBRG;
3145 typedef struct
3147 unsigned BRG0 : 1;
3148 unsigned BRG1 : 1;
3149 unsigned BRG2 : 1;
3150 unsigned BRG3 : 1;
3151 unsigned BRG4 : 1;
3152 unsigned BRG5 : 1;
3153 unsigned BRG6 : 1;
3154 unsigned BRG7 : 1;
3155 } __SPBRGbits_t;
3157 extern __at(0x0FAF) volatile __SPBRGbits_t SPBRGbits;
3159 #define _BRG0 0x01
3160 #define _BRG1 0x02
3161 #define _BRG2 0x04
3162 #define _BRG3 0x08
3163 #define _BRG4 0x10
3164 #define _BRG5 0x20
3165 #define _BRG6 0x40
3166 #define _BRG7 0x80
3168 //==============================================================================
3171 //==============================================================================
3172 // SPBRG1 Bits
3174 extern __at(0x0FAF) __sfr SPBRG1;
3176 typedef struct
3178 unsigned BRG0 : 1;
3179 unsigned BRG1 : 1;
3180 unsigned BRG2 : 1;
3181 unsigned BRG3 : 1;
3182 unsigned BRG4 : 1;
3183 unsigned BRG5 : 1;
3184 unsigned BRG6 : 1;
3185 unsigned BRG7 : 1;
3186 } __SPBRG1bits_t;
3188 extern __at(0x0FAF) volatile __SPBRG1bits_t SPBRG1bits;
3190 #define _SPBRG1_BRG0 0x01
3191 #define _SPBRG1_BRG1 0x02
3192 #define _SPBRG1_BRG2 0x04
3193 #define _SPBRG1_BRG3 0x08
3194 #define _SPBRG1_BRG4 0x10
3195 #define _SPBRG1_BRG5 0x20
3196 #define _SPBRG1_BRG6 0x40
3197 #define _SPBRG1_BRG7 0x80
3199 //==============================================================================
3202 //==============================================================================
3203 // SPBRGH Bits
3205 extern __at(0x0FB0) __sfr SPBRGH;
3207 typedef struct
3209 unsigned BRG8 : 1;
3210 unsigned BRG9 : 1;
3211 unsigned BRG10 : 1;
3212 unsigned BRG11 : 1;
3213 unsigned BRG12 : 1;
3214 unsigned BRG13 : 1;
3215 unsigned BRG14 : 1;
3216 unsigned BRG15 : 1;
3217 } __SPBRGHbits_t;
3219 extern __at(0x0FB0) volatile __SPBRGHbits_t SPBRGHbits;
3221 #define _BRG8 0x01
3222 #define _BRG9 0x02
3223 #define _BRG10 0x04
3224 #define _BRG11 0x08
3225 #define _BRG12 0x10
3226 #define _BRG13 0x20
3227 #define _BRG14 0x40
3228 #define _BRG15 0x80
3230 //==============================================================================
3233 //==============================================================================
3234 // SPBRGH1 Bits
3236 extern __at(0x0FB0) __sfr SPBRGH1;
3238 typedef struct
3240 unsigned BRG8 : 1;
3241 unsigned BRG9 : 1;
3242 unsigned BRG10 : 1;
3243 unsigned BRG11 : 1;
3244 unsigned BRG12 : 1;
3245 unsigned BRG13 : 1;
3246 unsigned BRG14 : 1;
3247 unsigned BRG15 : 1;
3248 } __SPBRGH1bits_t;
3250 extern __at(0x0FB0) volatile __SPBRGH1bits_t SPBRGH1bits;
3252 #define _SPBRGH1_BRG8 0x01
3253 #define _SPBRGH1_BRG9 0x02
3254 #define _SPBRGH1_BRG10 0x04
3255 #define _SPBRGH1_BRG11 0x08
3256 #define _SPBRGH1_BRG12 0x10
3257 #define _SPBRGH1_BRG13 0x20
3258 #define _SPBRGH1_BRG14 0x40
3259 #define _SPBRGH1_BRG15 0x80
3261 //==============================================================================
3264 //==============================================================================
3265 // T3CON Bits
3267 extern __at(0x0FB1) __sfr T3CON;
3269 typedef union
3271 struct
3273 unsigned TMR3ON : 1;
3274 unsigned RD16 : 1;
3275 unsigned NOT_T3SYNC : 1;
3276 unsigned SOSCEN : 1;
3277 unsigned T3CKPS0 : 1;
3278 unsigned T3CKPS1 : 1;
3279 unsigned TMR3CS0 : 1;
3280 unsigned TMR3CS1 : 1;
3283 struct
3285 unsigned : 1;
3286 unsigned T3RD16 : 1;
3287 unsigned T3SYNC : 1;
3288 unsigned T3SOSCEN : 1;
3289 unsigned : 1;
3290 unsigned : 1;
3291 unsigned : 1;
3292 unsigned : 1;
3295 struct
3297 unsigned : 1;
3298 unsigned : 1;
3299 unsigned : 1;
3300 unsigned T3OSCEN : 1;
3301 unsigned : 1;
3302 unsigned : 1;
3303 unsigned : 1;
3304 unsigned : 1;
3307 struct
3309 unsigned : 4;
3310 unsigned T3CKPS : 2;
3311 unsigned : 2;
3314 struct
3316 unsigned : 6;
3317 unsigned TMR3CS : 2;
3319 } __T3CONbits_t;
3321 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
3323 #define _T3CON_TMR3ON 0x01
3324 #define _T3CON_RD16 0x02
3325 #define _T3CON_T3RD16 0x02
3326 #define _T3CON_NOT_T3SYNC 0x04
3327 #define _T3CON_T3SYNC 0x04
3328 #define _T3CON_SOSCEN 0x08
3329 #define _T3CON_T3SOSCEN 0x08
3330 #define _T3CON_T3OSCEN 0x08
3331 #define _T3CON_T3CKPS0 0x10
3332 #define _T3CON_T3CKPS1 0x20
3333 #define _T3CON_TMR3CS0 0x40
3334 #define _T3CON_TMR3CS1 0x80
3336 //==============================================================================
3338 extern __at(0x0FB2) __sfr TMR3;
3339 extern __at(0x0FB2) __sfr TMR3L;
3340 extern __at(0x0FB3) __sfr TMR3H;
3342 //==============================================================================
3343 // T3GCON Bits
3345 extern __at(0x0FB4) __sfr T3GCON;
3347 typedef union
3349 struct
3351 unsigned T3GSS0 : 1;
3352 unsigned T3GSS1 : 1;
3353 unsigned T3GVAL : 1;
3354 unsigned T3GGO_NOT_T3DONE : 1;
3355 unsigned T3GSPM : 1;
3356 unsigned T3GTM : 1;
3357 unsigned T3GPOL : 1;
3358 unsigned TMR3GE : 1;
3361 struct
3363 unsigned : 1;
3364 unsigned : 1;
3365 unsigned : 1;
3366 unsigned T3GGO : 1;
3367 unsigned : 1;
3368 unsigned : 1;
3369 unsigned : 1;
3370 unsigned : 1;
3373 struct
3375 unsigned : 1;
3376 unsigned : 1;
3377 unsigned : 1;
3378 unsigned NOT_T3DONE : 1;
3379 unsigned : 1;
3380 unsigned : 1;
3381 unsigned : 1;
3382 unsigned : 1;
3385 struct
3387 unsigned : 1;
3388 unsigned : 1;
3389 unsigned : 1;
3390 unsigned T3DONE : 1;
3391 unsigned : 1;
3392 unsigned : 1;
3393 unsigned : 1;
3394 unsigned : 1;
3397 struct
3399 unsigned : 1;
3400 unsigned : 1;
3401 unsigned : 1;
3402 unsigned T3GGO_NOT_DONE : 1;
3403 unsigned : 1;
3404 unsigned : 1;
3405 unsigned : 1;
3406 unsigned : 1;
3409 struct
3411 unsigned T3GSS : 2;
3412 unsigned : 6;
3414 } __T3GCONbits_t;
3416 extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits;
3418 #define _T3GSS0 0x01
3419 #define _T3GSS1 0x02
3420 #define _T3GVAL 0x04
3421 #define _T3GGO_NOT_T3DONE 0x08
3422 #define _T3GGO 0x08
3423 #define _NOT_T3DONE 0x08
3424 #define _T3DONE 0x08
3425 #define _T3GGO_NOT_DONE 0x08
3426 #define _T3GSPM 0x10
3427 #define _T3GTM 0x20
3428 #define _T3GPOL 0x40
3429 #define _TMR3GE 0x80
3431 //==============================================================================
3434 //==============================================================================
3435 // ACTCON Bits
3437 extern __at(0x0FB5) __sfr ACTCON;
3439 typedef union
3441 struct
3443 unsigned : 1;
3444 unsigned ACTORS : 1;
3445 unsigned : 1;
3446 unsigned ACTLOCK : 1;
3447 unsigned ACTSRC : 1;
3448 unsigned : 1;
3449 unsigned ACTUD : 1;
3450 unsigned ACTEN : 1;
3453 struct
3455 unsigned : 1;
3456 unsigned STOR : 1;
3457 unsigned : 1;
3458 unsigned STLOCK : 1;
3459 unsigned STSRC : 1;
3460 unsigned : 1;
3461 unsigned STUD : 1;
3462 unsigned STEN : 1;
3465 struct
3467 unsigned : 1;
3468 unsigned ACTOR : 1;
3469 unsigned : 1;
3470 unsigned : 1;
3471 unsigned : 1;
3472 unsigned : 1;
3473 unsigned ACTD : 1;
3474 unsigned ACTSEL : 1;
3476 } __ACTCONbits_t;
3478 extern __at(0x0FB5) volatile __ACTCONbits_t ACTCONbits;
3480 #define _ACTORS 0x02
3481 #define _STOR 0x02
3482 #define _ACTOR 0x02
3483 #define _ACTLOCK 0x08
3484 #define _STLOCK 0x08
3485 #define _ACTSRC 0x10
3486 #define _STSRC 0x10
3487 #define _ACTUD 0x40
3488 #define _STUD 0x40
3489 #define _ACTD 0x40
3490 #define _ACTEN 0x80
3491 #define _STEN 0x80
3492 #define _ACTSEL 0x80
3494 //==============================================================================
3497 //==============================================================================
3498 // STCON Bits
3500 extern __at(0x0FB5) __sfr STCON;
3502 typedef union
3504 struct
3506 unsigned : 1;
3507 unsigned ACTORS : 1;
3508 unsigned : 1;
3509 unsigned ACTLOCK : 1;
3510 unsigned ACTSRC : 1;
3511 unsigned : 1;
3512 unsigned ACTUD : 1;
3513 unsigned ACTEN : 1;
3516 struct
3518 unsigned : 1;
3519 unsigned STOR : 1;
3520 unsigned : 1;
3521 unsigned STLOCK : 1;
3522 unsigned STSRC : 1;
3523 unsigned : 1;
3524 unsigned STUD : 1;
3525 unsigned STEN : 1;
3528 struct
3530 unsigned : 1;
3531 unsigned ACTOR : 1;
3532 unsigned : 1;
3533 unsigned : 1;
3534 unsigned : 1;
3535 unsigned : 1;
3536 unsigned ACTD : 1;
3537 unsigned ACTSEL : 1;
3539 } __STCONbits_t;
3541 extern __at(0x0FB5) volatile __STCONbits_t STCONbits;
3543 #define _STCON_ACTORS 0x02
3544 #define _STCON_STOR 0x02
3545 #define _STCON_ACTOR 0x02
3546 #define _STCON_ACTLOCK 0x08
3547 #define _STCON_STLOCK 0x08
3548 #define _STCON_ACTSRC 0x10
3549 #define _STCON_STSRC 0x10
3550 #define _STCON_ACTUD 0x40
3551 #define _STCON_STUD 0x40
3552 #define _STCON_ACTD 0x40
3553 #define _STCON_ACTEN 0x80
3554 #define _STCON_STEN 0x80
3555 #define _STCON_ACTSEL 0x80
3557 //==============================================================================
3560 //==============================================================================
3561 // ECCP1AS Bits
3563 extern __at(0x0FB6) __sfr ECCP1AS;
3565 typedef union
3567 struct
3569 unsigned PSS1BD0 : 1;
3570 unsigned PSS1BD1 : 1;
3571 unsigned PSS1AC0 : 1;
3572 unsigned PSS1AC1 : 1;
3573 unsigned ECCP1AS0 : 1;
3574 unsigned ECCP1AS1 : 1;
3575 unsigned ECCP1AS2 : 1;
3576 unsigned ECCP1ASE : 1;
3579 struct
3581 unsigned PSSBD0 : 1;
3582 unsigned PSSBD1 : 1;
3583 unsigned PSSAC0 : 1;
3584 unsigned PSSAC1 : 1;
3585 unsigned : 1;
3586 unsigned : 1;
3587 unsigned : 1;
3588 unsigned CCP1ASE : 1;
3591 struct
3593 unsigned PSS1BD : 2;
3594 unsigned : 6;
3597 struct
3599 unsigned PSSBD : 2;
3600 unsigned : 6;
3603 struct
3605 unsigned : 2;
3606 unsigned PSSAC : 2;
3607 unsigned : 4;
3610 struct
3612 unsigned : 2;
3613 unsigned PSS1AC : 2;
3614 unsigned : 4;
3617 struct
3619 unsigned : 4;
3620 unsigned ECCP1AS : 3;
3621 unsigned : 1;
3623 } __ECCP1ASbits_t;
3625 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
3627 #define _PSS1BD0 0x01
3628 #define _PSSBD0 0x01
3629 #define _PSS1BD1 0x02
3630 #define _PSSBD1 0x02
3631 #define _PSS1AC0 0x04
3632 #define _PSSAC0 0x04
3633 #define _PSS1AC1 0x08
3634 #define _PSSAC1 0x08
3635 #define _ECCP1AS0 0x10
3636 #define _ECCP1AS1 0x20
3637 #define _ECCP1AS2 0x40
3638 #define _ECCP1ASE 0x80
3639 #define _CCP1ASE 0x80
3641 //==============================================================================
3644 //==============================================================================
3645 // ECCP1DEL Bits
3647 extern __at(0x0FB7) __sfr ECCP1DEL;
3649 typedef union
3651 struct
3653 unsigned PDC0 : 1;
3654 unsigned PDC1 : 1;
3655 unsigned PDC2 : 1;
3656 unsigned PDC3 : 1;
3657 unsigned PDC4 : 1;
3658 unsigned PDC5 : 1;
3659 unsigned PDC6 : 1;
3660 unsigned P1RSEN : 1;
3663 struct
3665 unsigned : 1;
3666 unsigned : 1;
3667 unsigned : 1;
3668 unsigned : 1;
3669 unsigned : 1;
3670 unsigned : 1;
3671 unsigned : 1;
3672 unsigned PR1SEN : 1;
3675 struct
3677 unsigned PDC : 7;
3678 unsigned : 1;
3680 } __ECCP1DELbits_t;
3682 extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits;
3684 #define _PDC0 0x01
3685 #define _PDC1 0x02
3686 #define _PDC2 0x04
3687 #define _PDC3 0x08
3688 #define _PDC4 0x10
3689 #define _PDC5 0x20
3690 #define _PDC6 0x40
3691 #define _P1RSEN 0x80
3692 #define _PR1SEN 0x80
3694 //==============================================================================
3697 //==============================================================================
3698 // PWM1CON Bits
3700 extern __at(0x0FB7) __sfr PWM1CON;
3702 typedef union
3704 struct
3706 unsigned PDC0 : 1;
3707 unsigned PDC1 : 1;
3708 unsigned PDC2 : 1;
3709 unsigned PDC3 : 1;
3710 unsigned PDC4 : 1;
3711 unsigned PDC5 : 1;
3712 unsigned PDC6 : 1;
3713 unsigned P1RSEN : 1;
3716 struct
3718 unsigned : 1;
3719 unsigned : 1;
3720 unsigned : 1;
3721 unsigned : 1;
3722 unsigned : 1;
3723 unsigned : 1;
3724 unsigned : 1;
3725 unsigned PR1SEN : 1;
3728 struct
3730 unsigned PDC : 7;
3731 unsigned : 1;
3733 } __PWM1CONbits_t;
3735 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
3737 #define _PWM1CON_PDC0 0x01
3738 #define _PWM1CON_PDC1 0x02
3739 #define _PWM1CON_PDC2 0x04
3740 #define _PWM1CON_PDC3 0x08
3741 #define _PWM1CON_PDC4 0x10
3742 #define _PWM1CON_PDC5 0x20
3743 #define _PWM1CON_PDC6 0x40
3744 #define _PWM1CON_P1RSEN 0x80
3745 #define _PWM1CON_PR1SEN 0x80
3747 //==============================================================================
3750 //==============================================================================
3751 // BAUDCON Bits
3753 extern __at(0x0FB8) __sfr BAUDCON;
3755 typedef union
3757 struct
3759 unsigned ABDEN : 1;
3760 unsigned WUE : 1;
3761 unsigned : 1;
3762 unsigned BRG16 : 1;
3763 unsigned TXCKP : 1;
3764 unsigned RXDTP : 1;
3765 unsigned RCIDL : 1;
3766 unsigned ABDOVF : 1;
3769 struct
3771 unsigned : 1;
3772 unsigned : 1;
3773 unsigned : 1;
3774 unsigned : 1;
3775 unsigned CKTXP : 1;
3776 unsigned DTRXP : 1;
3777 unsigned RCMT : 1;
3778 unsigned : 1;
3781 struct
3783 unsigned : 1;
3784 unsigned : 1;
3785 unsigned : 1;
3786 unsigned : 1;
3787 unsigned SCKP : 1;
3788 unsigned : 1;
3789 unsigned : 1;
3790 unsigned : 1;
3792 } __BAUDCONbits_t;
3794 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
3796 #define _ABDEN 0x01
3797 #define _WUE 0x02
3798 #define _BRG16 0x08
3799 #define _TXCKP 0x10
3800 #define _CKTXP 0x10
3801 #define _SCKP 0x10
3802 #define _RXDTP 0x20
3803 #define _DTRXP 0x20
3804 #define _RCIDL 0x40
3805 #define _RCMT 0x40
3806 #define _ABDOVF 0x80
3808 //==============================================================================
3811 //==============================================================================
3812 // BAUDCON1 Bits
3814 extern __at(0x0FB8) __sfr BAUDCON1;
3816 typedef union
3818 struct
3820 unsigned ABDEN : 1;
3821 unsigned WUE : 1;
3822 unsigned : 1;
3823 unsigned BRG16 : 1;
3824 unsigned TXCKP : 1;
3825 unsigned RXDTP : 1;
3826 unsigned RCIDL : 1;
3827 unsigned ABDOVF : 1;
3830 struct
3832 unsigned : 1;
3833 unsigned : 1;
3834 unsigned : 1;
3835 unsigned : 1;
3836 unsigned CKTXP : 1;
3837 unsigned DTRXP : 1;
3838 unsigned RCMT : 1;
3839 unsigned : 1;
3842 struct
3844 unsigned : 1;
3845 unsigned : 1;
3846 unsigned : 1;
3847 unsigned : 1;
3848 unsigned SCKP : 1;
3849 unsigned : 1;
3850 unsigned : 1;
3851 unsigned : 1;
3853 } __BAUDCON1bits_t;
3855 extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits;
3857 #define _BAUDCON1_ABDEN 0x01
3858 #define _BAUDCON1_WUE 0x02
3859 #define _BAUDCON1_BRG16 0x08
3860 #define _BAUDCON1_TXCKP 0x10
3861 #define _BAUDCON1_CKTXP 0x10
3862 #define _BAUDCON1_SCKP 0x10
3863 #define _BAUDCON1_RXDTP 0x20
3864 #define _BAUDCON1_DTRXP 0x20
3865 #define _BAUDCON1_RCIDL 0x40
3866 #define _BAUDCON1_RCMT 0x40
3867 #define _BAUDCON1_ABDOVF 0x80
3869 //==============================================================================
3872 //==============================================================================
3873 // PSTR1CON Bits
3875 extern __at(0x0FB9) __sfr PSTR1CON;
3877 typedef union
3879 struct
3881 unsigned STRA : 1;
3882 unsigned STRB : 1;
3883 unsigned STRC : 1;
3884 unsigned STRD : 1;
3885 unsigned STRSYNC : 1;
3886 unsigned : 1;
3887 unsigned : 1;
3888 unsigned : 1;
3891 struct
3893 unsigned STR1A : 1;
3894 unsigned STR1B : 1;
3895 unsigned STR1C : 1;
3896 unsigned STR1D : 1;
3897 unsigned STR1SYNC : 1;
3898 unsigned : 1;
3899 unsigned : 1;
3900 unsigned : 1;
3902 } __PSTR1CONbits_t;
3904 extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits;
3906 #define _STRA 0x01
3907 #define _STR1A 0x01
3908 #define _STRB 0x02
3909 #define _STR1B 0x02
3910 #define _STRC 0x04
3911 #define _STR1C 0x04
3912 #define _STRD 0x08
3913 #define _STR1D 0x08
3914 #define _STRSYNC 0x10
3915 #define _STR1SYNC 0x10
3917 //==============================================================================
3920 //==============================================================================
3921 // T2CON Bits
3923 extern __at(0x0FBA) __sfr T2CON;
3925 typedef union
3927 struct
3929 unsigned T2CKPS0 : 1;
3930 unsigned T2CKPS1 : 1;
3931 unsigned TMR2ON : 1;
3932 unsigned T2OUTPS0 : 1;
3933 unsigned T2OUTPS1 : 1;
3934 unsigned T2OUTPS2 : 1;
3935 unsigned T2OUTPS3 : 1;
3936 unsigned : 1;
3939 struct
3941 unsigned T2CKPS : 2;
3942 unsigned : 6;
3945 struct
3947 unsigned : 3;
3948 unsigned T2OUTPS : 4;
3949 unsigned : 1;
3951 } __T2CONbits_t;
3953 extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits;
3955 #define _T2CKPS0 0x01
3956 #define _T2CKPS1 0x02
3957 #define _TMR2ON 0x04
3958 #define _T2OUTPS0 0x08
3959 #define _T2OUTPS1 0x10
3960 #define _T2OUTPS2 0x20
3961 #define _T2OUTPS3 0x40
3963 //==============================================================================
3965 extern __at(0x0FBB) __sfr PR2;
3966 extern __at(0x0FBC) __sfr TMR2;
3968 //==============================================================================
3969 // CCP1CON Bits
3971 extern __at(0x0FBD) __sfr CCP1CON;
3973 typedef union
3975 struct
3977 unsigned CCP1M0 : 1;
3978 unsigned CCP1M1 : 1;
3979 unsigned CCP1M2 : 1;
3980 unsigned CCP1M3 : 1;
3981 unsigned DC1B0 : 1;
3982 unsigned DC1B1 : 1;
3983 unsigned P1M0 : 1;
3984 unsigned P1M1 : 1;
3987 struct
3989 unsigned : 1;
3990 unsigned : 1;
3991 unsigned : 1;
3992 unsigned : 1;
3993 unsigned CCP1Y : 1;
3994 unsigned CCP1X : 1;
3995 unsigned : 1;
3996 unsigned : 1;
3999 struct
4001 unsigned CCP1M : 4;
4002 unsigned : 4;
4005 struct
4007 unsigned : 4;
4008 unsigned DC1B : 2;
4009 unsigned : 2;
4012 struct
4014 unsigned : 6;
4015 unsigned P1M : 2;
4017 } __CCP1CONbits_t;
4019 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
4021 #define _CCP1M0 0x01
4022 #define _CCP1M1 0x02
4023 #define _CCP1M2 0x04
4024 #define _CCP1M3 0x08
4025 #define _DC1B0 0x10
4026 #define _CCP1Y 0x10
4027 #define _DC1B1 0x20
4028 #define _CCP1X 0x20
4029 #define _P1M0 0x40
4030 #define _P1M1 0x80
4032 //==============================================================================
4035 //==============================================================================
4036 // ECCP1CON Bits
4038 extern __at(0x0FBD) __sfr ECCP1CON;
4040 typedef union
4042 struct
4044 unsigned CCP1M0 : 1;
4045 unsigned CCP1M1 : 1;
4046 unsigned CCP1M2 : 1;
4047 unsigned CCP1M3 : 1;
4048 unsigned DC1B0 : 1;
4049 unsigned DC1B1 : 1;
4050 unsigned P1M0 : 1;
4051 unsigned P1M1 : 1;
4054 struct
4056 unsigned : 1;
4057 unsigned : 1;
4058 unsigned : 1;
4059 unsigned : 1;
4060 unsigned CCP1Y : 1;
4061 unsigned CCP1X : 1;
4062 unsigned : 1;
4063 unsigned : 1;
4066 struct
4068 unsigned CCP1M : 4;
4069 unsigned : 4;
4072 struct
4074 unsigned : 4;
4075 unsigned DC1B : 2;
4076 unsigned : 2;
4079 struct
4081 unsigned : 6;
4082 unsigned P1M : 2;
4084 } __ECCP1CONbits_t;
4086 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
4088 #define _ECCP1CON_CCP1M0 0x01
4089 #define _ECCP1CON_CCP1M1 0x02
4090 #define _ECCP1CON_CCP1M2 0x04
4091 #define _ECCP1CON_CCP1M3 0x08
4092 #define _ECCP1CON_DC1B0 0x10
4093 #define _ECCP1CON_CCP1Y 0x10
4094 #define _ECCP1CON_DC1B1 0x20
4095 #define _ECCP1CON_CCP1X 0x20
4096 #define _ECCP1CON_P1M0 0x40
4097 #define _ECCP1CON_P1M1 0x80
4099 //==============================================================================
4101 extern __at(0x0FBE) __sfr CCPR1;
4102 extern __at(0x0FBE) __sfr CCPR1L;
4103 extern __at(0x0FBF) __sfr CCPR1H;
4105 //==============================================================================
4106 // ADCON2 Bits
4108 extern __at(0x0FC0) __sfr ADCON2;
4110 typedef union
4112 struct
4114 unsigned ADCS0 : 1;
4115 unsigned ADCS1 : 1;
4116 unsigned ADCS2 : 1;
4117 unsigned ACQT0 : 1;
4118 unsigned ACQT1 : 1;
4119 unsigned ACQT2 : 1;
4120 unsigned : 1;
4121 unsigned ADFM : 1;
4124 struct
4126 unsigned ADCS : 3;
4127 unsigned : 5;
4130 struct
4132 unsigned : 3;
4133 unsigned ACQT : 3;
4134 unsigned : 2;
4136 } __ADCON2bits_t;
4138 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4140 #define _ADCS0 0x01
4141 #define _ADCS1 0x02
4142 #define _ADCS2 0x04
4143 #define _ACQT0 0x08
4144 #define _ACQT1 0x10
4145 #define _ACQT2 0x20
4146 #define _ADFM 0x80
4148 //==============================================================================
4151 //==============================================================================
4152 // ADCON1 Bits
4154 extern __at(0x0FC1) __sfr ADCON1;
4156 typedef union
4158 struct
4160 unsigned NVCFG0 : 1;
4161 unsigned NVCFG1 : 1;
4162 unsigned PVCFG0 : 1;
4163 unsigned PVCFG1 : 1;
4164 unsigned : 1;
4165 unsigned : 1;
4166 unsigned : 1;
4167 unsigned TRIGSEL : 1;
4170 struct
4172 unsigned NVCFG : 2;
4173 unsigned : 6;
4176 struct
4178 unsigned : 2;
4179 unsigned PVCFG : 2;
4180 unsigned : 4;
4182 } __ADCON1bits_t;
4184 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4186 #define _NVCFG0 0x01
4187 #define _NVCFG1 0x02
4188 #define _PVCFG0 0x04
4189 #define _PVCFG1 0x08
4190 #define _TRIGSEL 0x80
4192 //==============================================================================
4195 //==============================================================================
4196 // ADCON0 Bits
4198 extern __at(0x0FC2) __sfr ADCON0;
4200 typedef union
4202 struct
4204 unsigned ADON : 1;
4205 unsigned GO_NOT_DONE : 1;
4206 unsigned : 1;
4207 unsigned : 1;
4208 unsigned : 1;
4209 unsigned : 1;
4210 unsigned : 1;
4211 unsigned : 1;
4214 struct
4216 unsigned : 1;
4217 unsigned DONE : 1;
4218 unsigned : 1;
4219 unsigned : 1;
4220 unsigned : 1;
4221 unsigned : 1;
4222 unsigned : 1;
4223 unsigned : 1;
4226 struct
4228 unsigned : 1;
4229 unsigned GO : 1;
4230 unsigned : 1;
4231 unsigned : 1;
4232 unsigned : 1;
4233 unsigned : 1;
4234 unsigned : 1;
4235 unsigned : 1;
4238 struct
4240 unsigned : 1;
4241 unsigned NOT_DONE : 1;
4242 unsigned : 1;
4243 unsigned : 1;
4244 unsigned : 1;
4245 unsigned : 1;
4246 unsigned : 1;
4247 unsigned : 1;
4249 } __ADCON0bits_t;
4251 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4253 #define _ADON 0x01
4254 #define _GO_NOT_DONE 0x02
4255 #define _DONE 0x02
4256 #define _GO 0x02
4257 #define _NOT_DONE 0x02
4259 //==============================================================================
4261 extern __at(0x0FC3) __sfr ADRESL;
4262 extern __at(0x0FC4) __sfr ADRESH;
4264 //==============================================================================
4265 // SSP1CON2 Bits
4267 extern __at(0x0FC5) __sfr SSP1CON2;
4269 typedef struct
4271 unsigned SEN : 1;
4272 unsigned RSEN : 1;
4273 unsigned PEN : 1;
4274 unsigned RCEN : 1;
4275 unsigned ACKEN : 1;
4276 unsigned ACKDT : 1;
4277 unsigned ACKSTAT : 1;
4278 unsigned GCEN : 1;
4279 } __SSP1CON2bits_t;
4281 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4283 #define _SEN 0x01
4284 #define _RSEN 0x02
4285 #define _PEN 0x04
4286 #define _RCEN 0x08
4287 #define _ACKEN 0x10
4288 #define _ACKDT 0x20
4289 #define _ACKSTAT 0x40
4290 #define _GCEN 0x80
4292 //==============================================================================
4295 //==============================================================================
4296 // SSPCON2 Bits
4298 extern __at(0x0FC5) __sfr SSPCON2;
4300 typedef struct
4302 unsigned SEN : 1;
4303 unsigned RSEN : 1;
4304 unsigned PEN : 1;
4305 unsigned RCEN : 1;
4306 unsigned ACKEN : 1;
4307 unsigned ACKDT : 1;
4308 unsigned ACKSTAT : 1;
4309 unsigned GCEN : 1;
4310 } __SSPCON2bits_t;
4312 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4314 #define _SSPCON2_SEN 0x01
4315 #define _SSPCON2_RSEN 0x02
4316 #define _SSPCON2_PEN 0x04
4317 #define _SSPCON2_RCEN 0x08
4318 #define _SSPCON2_ACKEN 0x10
4319 #define _SSPCON2_ACKDT 0x20
4320 #define _SSPCON2_ACKSTAT 0x40
4321 #define _SSPCON2_GCEN 0x80
4323 //==============================================================================
4326 //==============================================================================
4327 // SSP1CON1 Bits
4329 extern __at(0x0FC6) __sfr SSP1CON1;
4331 typedef union
4333 struct
4335 unsigned SSPM0 : 1;
4336 unsigned SSPM1 : 1;
4337 unsigned SSPM2 : 1;
4338 unsigned SSPM3 : 1;
4339 unsigned CKP : 1;
4340 unsigned SSPEN : 1;
4341 unsigned SSPOV : 1;
4342 unsigned WCOL : 1;
4345 struct
4347 unsigned SSPM : 4;
4348 unsigned : 4;
4350 } __SSP1CON1bits_t;
4352 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4354 #define _SSPM0 0x01
4355 #define _SSPM1 0x02
4356 #define _SSPM2 0x04
4357 #define _SSPM3 0x08
4358 #define _CKP 0x10
4359 #define _SSPEN 0x20
4360 #define _SSPOV 0x40
4361 #define _WCOL 0x80
4363 //==============================================================================
4366 //==============================================================================
4367 // SSPCON Bits
4369 extern __at(0x0FC6) __sfr SSPCON;
4371 typedef union
4373 struct
4375 unsigned SSPM0 : 1;
4376 unsigned SSPM1 : 1;
4377 unsigned SSPM2 : 1;
4378 unsigned SSPM3 : 1;
4379 unsigned CKP : 1;
4380 unsigned SSPEN : 1;
4381 unsigned SSPOV : 1;
4382 unsigned WCOL : 1;
4385 struct
4387 unsigned SSPM : 4;
4388 unsigned : 4;
4390 } __SSPCONbits_t;
4392 extern __at(0x0FC6) volatile __SSPCONbits_t SSPCONbits;
4394 #define _SSPCON_SSPM0 0x01
4395 #define _SSPCON_SSPM1 0x02
4396 #define _SSPCON_SSPM2 0x04
4397 #define _SSPCON_SSPM3 0x08
4398 #define _SSPCON_CKP 0x10
4399 #define _SSPCON_SSPEN 0x20
4400 #define _SSPCON_SSPOV 0x40
4401 #define _SSPCON_WCOL 0x80
4403 //==============================================================================
4406 //==============================================================================
4407 // SSPCON1 Bits
4409 extern __at(0x0FC6) __sfr SSPCON1;
4411 typedef union
4413 struct
4415 unsigned SSPM0 : 1;
4416 unsigned SSPM1 : 1;
4417 unsigned SSPM2 : 1;
4418 unsigned SSPM3 : 1;
4419 unsigned CKP : 1;
4420 unsigned SSPEN : 1;
4421 unsigned SSPOV : 1;
4422 unsigned WCOL : 1;
4425 struct
4427 unsigned SSPM : 4;
4428 unsigned : 4;
4430 } __SSPCON1bits_t;
4432 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4434 #define _SSPCON1_SSPM0 0x01
4435 #define _SSPCON1_SSPM1 0x02
4436 #define _SSPCON1_SSPM2 0x04
4437 #define _SSPCON1_SSPM3 0x08
4438 #define _SSPCON1_CKP 0x10
4439 #define _SSPCON1_SSPEN 0x20
4440 #define _SSPCON1_SSPOV 0x40
4441 #define _SSPCON1_WCOL 0x80
4443 //==============================================================================
4446 //==============================================================================
4447 // SSP1STAT Bits
4449 extern __at(0x0FC7) __sfr SSP1STAT;
4451 typedef struct
4453 unsigned BF : 1;
4454 unsigned UA : 1;
4455 unsigned R_NOT_W : 1;
4456 unsigned S : 1;
4457 unsigned P : 1;
4458 unsigned D_NOT_A : 1;
4459 unsigned CKE : 1;
4460 unsigned SMP : 1;
4461 } __SSP1STATbits_t;
4463 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4465 #define _BF 0x01
4466 #define _UA 0x02
4467 #define _R_NOT_W 0x04
4468 #define _S 0x08
4469 #define _P 0x10
4470 #define _D_NOT_A 0x20
4471 #define _CKE 0x40
4472 #define _SMP 0x80
4474 //==============================================================================
4477 //==============================================================================
4478 // SSPSTAT Bits
4480 extern __at(0x0FC7) __sfr SSPSTAT;
4482 typedef struct
4484 unsigned BF : 1;
4485 unsigned UA : 1;
4486 unsigned R_NOT_W : 1;
4487 unsigned S : 1;
4488 unsigned P : 1;
4489 unsigned D_NOT_A : 1;
4490 unsigned CKE : 1;
4491 unsigned SMP : 1;
4492 } __SSPSTATbits_t;
4494 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
4496 #define _SSPSTAT_BF 0x01
4497 #define _SSPSTAT_UA 0x02
4498 #define _SSPSTAT_R_NOT_W 0x04
4499 #define _SSPSTAT_S 0x08
4500 #define _SSPSTAT_P 0x10
4501 #define _SSPSTAT_D_NOT_A 0x20
4502 #define _SSPSTAT_CKE 0x40
4503 #define _SSPSTAT_SMP 0x80
4505 //==============================================================================
4508 //==============================================================================
4509 // SSP1ADD Bits
4511 extern __at(0x0FC8) __sfr SSP1ADD;
4513 typedef struct
4515 unsigned SSP1ADD0 : 1;
4516 unsigned SSP1ADD1 : 1;
4517 unsigned SSP1ADD2 : 1;
4518 unsigned SSP1ADD3 : 1;
4519 unsigned SSP1ADD4 : 1;
4520 unsigned SSP1ADD5 : 1;
4521 unsigned SSP1ADD6 : 1;
4522 unsigned SSP1ADD7 : 1;
4523 } __SSP1ADDbits_t;
4525 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
4527 #define _SSP1ADD0 0x01
4528 #define _SSP1ADD1 0x02
4529 #define _SSP1ADD2 0x04
4530 #define _SSP1ADD3 0x08
4531 #define _SSP1ADD4 0x10
4532 #define _SSP1ADD5 0x20
4533 #define _SSP1ADD6 0x40
4534 #define _SSP1ADD7 0x80
4536 //==============================================================================
4539 //==============================================================================
4540 // SSPADD Bits
4542 extern __at(0x0FC8) __sfr SSPADD;
4544 typedef struct
4546 unsigned SSP1ADD0 : 1;
4547 unsigned SSP1ADD1 : 1;
4548 unsigned SSP1ADD2 : 1;
4549 unsigned SSP1ADD3 : 1;
4550 unsigned SSP1ADD4 : 1;
4551 unsigned SSP1ADD5 : 1;
4552 unsigned SSP1ADD6 : 1;
4553 unsigned SSP1ADD7 : 1;
4554 } __SSPADDbits_t;
4556 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
4558 #define _SSPADD_SSP1ADD0 0x01
4559 #define _SSPADD_SSP1ADD1 0x02
4560 #define _SSPADD_SSP1ADD2 0x04
4561 #define _SSPADD_SSP1ADD3 0x08
4562 #define _SSPADD_SSP1ADD4 0x10
4563 #define _SSPADD_SSP1ADD5 0x20
4564 #define _SSPADD_SSP1ADD6 0x40
4565 #define _SSPADD_SSP1ADD7 0x80
4567 //==============================================================================
4569 extern __at(0x0FC9) __sfr SSP1BUF;
4570 extern __at(0x0FC9) __sfr SSPBUF;
4572 //==============================================================================
4573 // SSP1MSK Bits
4575 extern __at(0x0FCA) __sfr SSP1MSK;
4577 typedef struct
4579 unsigned SSP1MSK0 : 1;
4580 unsigned SSP1MSK1 : 1;
4581 unsigned SSP1MSK2 : 1;
4582 unsigned SSP1MSK3 : 1;
4583 unsigned SSP1MSK4 : 1;
4584 unsigned SSP1MSK5 : 1;
4585 unsigned SSP1MSK6 : 1;
4586 unsigned SSP1MSK7 : 1;
4587 } __SSP1MSKbits_t;
4589 extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits;
4591 #define _SSP1MSK0 0x01
4592 #define _SSP1MSK1 0x02
4593 #define _SSP1MSK2 0x04
4594 #define _SSP1MSK3 0x08
4595 #define _SSP1MSK4 0x10
4596 #define _SSP1MSK5 0x20
4597 #define _SSP1MSK6 0x40
4598 #define _SSP1MSK7 0x80
4600 //==============================================================================
4603 //==============================================================================
4604 // SSPMSK Bits
4606 extern __at(0x0FCA) __sfr SSPMSK;
4608 typedef struct
4610 unsigned SSP1MSK0 : 1;
4611 unsigned SSP1MSK1 : 1;
4612 unsigned SSP1MSK2 : 1;
4613 unsigned SSP1MSK3 : 1;
4614 unsigned SSP1MSK4 : 1;
4615 unsigned SSP1MSK5 : 1;
4616 unsigned SSP1MSK6 : 1;
4617 unsigned SSP1MSK7 : 1;
4618 } __SSPMSKbits_t;
4620 extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits;
4622 #define _SSPMSK_SSP1MSK0 0x01
4623 #define _SSPMSK_SSP1MSK1 0x02
4624 #define _SSPMSK_SSP1MSK2 0x04
4625 #define _SSPMSK_SSP1MSK3 0x08
4626 #define _SSPMSK_SSP1MSK4 0x10
4627 #define _SSPMSK_SSP1MSK5 0x20
4628 #define _SSPMSK_SSP1MSK6 0x40
4629 #define _SSPMSK_SSP1MSK7 0x80
4631 //==============================================================================
4634 //==============================================================================
4635 // SSP1CON3 Bits
4637 extern __at(0x0FCB) __sfr SSP1CON3;
4639 typedef struct
4641 unsigned DHEN : 1;
4642 unsigned AHEN : 1;
4643 unsigned SBCDE : 1;
4644 unsigned SDAHT : 1;
4645 unsigned BOEN : 1;
4646 unsigned SCIE : 1;
4647 unsigned PCIE : 1;
4648 unsigned ACKTIM : 1;
4649 } __SSP1CON3bits_t;
4651 extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits;
4653 #define _DHEN 0x01
4654 #define _AHEN 0x02
4655 #define _SBCDE 0x04
4656 #define _SDAHT 0x08
4657 #define _BOEN 0x10
4658 #define _SCIE 0x20
4659 #define _PCIE 0x40
4660 #define _ACKTIM 0x80
4662 //==============================================================================
4665 //==============================================================================
4666 // SSPCON3 Bits
4668 extern __at(0x0FCB) __sfr SSPCON3;
4670 typedef struct
4672 unsigned DHEN : 1;
4673 unsigned AHEN : 1;
4674 unsigned SBCDE : 1;
4675 unsigned SDAHT : 1;
4676 unsigned BOEN : 1;
4677 unsigned SCIE : 1;
4678 unsigned PCIE : 1;
4679 unsigned ACKTIM : 1;
4680 } __SSPCON3bits_t;
4682 extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits;
4684 #define _SSPCON3_DHEN 0x01
4685 #define _SSPCON3_AHEN 0x02
4686 #define _SSPCON3_SBCDE 0x04
4687 #define _SSPCON3_SDAHT 0x08
4688 #define _SSPCON3_BOEN 0x10
4689 #define _SSPCON3_SCIE 0x20
4690 #define _SSPCON3_PCIE 0x40
4691 #define _SSPCON3_ACKTIM 0x80
4693 //==============================================================================
4696 //==============================================================================
4697 // T1GCON Bits
4699 extern __at(0x0FCC) __sfr T1GCON;
4701 typedef union
4703 struct
4705 unsigned T1GSS0 : 1;
4706 unsigned T1GSS1 : 1;
4707 unsigned T1GVAL : 1;
4708 unsigned T1GGO_NOT_T1DONE : 1;
4709 unsigned T1GSPM : 1;
4710 unsigned T1GTM : 1;
4711 unsigned T1GPOL : 1;
4712 unsigned TMR1GE : 1;
4715 struct
4717 unsigned : 1;
4718 unsigned : 1;
4719 unsigned : 1;
4720 unsigned T1GGO : 1;
4721 unsigned : 1;
4722 unsigned : 1;
4723 unsigned : 1;
4724 unsigned : 1;
4727 struct
4729 unsigned : 1;
4730 unsigned : 1;
4731 unsigned : 1;
4732 unsigned NOT_T1DONE : 1;
4733 unsigned : 1;
4734 unsigned : 1;
4735 unsigned : 1;
4736 unsigned : 1;
4739 struct
4741 unsigned : 1;
4742 unsigned : 1;
4743 unsigned : 1;
4744 unsigned T1DONE : 1;
4745 unsigned : 1;
4746 unsigned : 1;
4747 unsigned : 1;
4748 unsigned : 1;
4751 struct
4753 unsigned : 1;
4754 unsigned : 1;
4755 unsigned : 1;
4756 unsigned T1GGO_NOT_DONE : 1;
4757 unsigned : 1;
4758 unsigned : 1;
4759 unsigned : 1;
4760 unsigned : 1;
4763 struct
4765 unsigned T1GSS : 2;
4766 unsigned : 6;
4768 } __T1GCONbits_t;
4770 extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits;
4772 #define _T1GSS0 0x01
4773 #define _T1GSS1 0x02
4774 #define _T1GVAL 0x04
4775 #define _T1GGO_NOT_T1DONE 0x08
4776 #define _T1GGO 0x08
4777 #define _NOT_T1DONE 0x08
4778 #define _T1DONE 0x08
4779 #define _T1GGO_NOT_DONE 0x08
4780 #define _T1GSPM 0x10
4781 #define _T1GTM 0x20
4782 #define _T1GPOL 0x40
4783 #define _TMR1GE 0x80
4785 //==============================================================================
4788 //==============================================================================
4789 // T1CON Bits
4791 extern __at(0x0FCD) __sfr T1CON;
4793 typedef union
4795 struct
4797 unsigned TMR1ON : 1;
4798 unsigned RD16 : 1;
4799 unsigned NOT_T1SYNC : 1;
4800 unsigned SOSCEN : 1;
4801 unsigned T1CKPS0 : 1;
4802 unsigned T1CKPS1 : 1;
4803 unsigned TMR1CS0 : 1;
4804 unsigned TMR1CS1 : 1;
4807 struct
4809 unsigned : 1;
4810 unsigned T1RD16 : 1;
4811 unsigned T1SYNC : 1;
4812 unsigned T1SOSCEN : 1;
4813 unsigned : 1;
4814 unsigned : 1;
4815 unsigned : 1;
4816 unsigned : 1;
4819 struct
4821 unsigned : 1;
4822 unsigned : 1;
4823 unsigned : 1;
4824 unsigned T1OSCEN : 1;
4825 unsigned : 1;
4826 unsigned : 1;
4827 unsigned : 1;
4828 unsigned : 1;
4831 struct
4833 unsigned : 4;
4834 unsigned T1CKPS : 2;
4835 unsigned : 2;
4838 struct
4840 unsigned : 6;
4841 unsigned TMR1CS : 2;
4843 } __T1CONbits_t;
4845 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
4847 #define _TMR1ON 0x01
4848 #define _RD16 0x02
4849 #define _T1RD16 0x02
4850 #define _NOT_T1SYNC 0x04
4851 #define _T1SYNC 0x04
4852 #define _SOSCEN 0x08
4853 #define _T1SOSCEN 0x08
4854 #define _T1OSCEN 0x08
4855 #define _T1CKPS0 0x10
4856 #define _T1CKPS1 0x20
4857 #define _TMR1CS0 0x40
4858 #define _TMR1CS1 0x80
4860 //==============================================================================
4862 extern __at(0x0FCE) __sfr TMR1;
4863 extern __at(0x0FCE) __sfr TMR1L;
4864 extern __at(0x0FCF) __sfr TMR1H;
4866 //==============================================================================
4867 // RCON Bits
4869 extern __at(0x0FD0) __sfr RCON;
4871 typedef union
4873 struct
4875 unsigned NOT_BOR : 1;
4876 unsigned NOT_POR : 1;
4877 unsigned NOT_PD : 1;
4878 unsigned NOT_TO : 1;
4879 unsigned NOT_RI : 1;
4880 unsigned : 1;
4881 unsigned SBOREN : 1;
4882 unsigned IPEN : 1;
4885 struct
4887 unsigned BOR : 1;
4888 unsigned POR : 1;
4889 unsigned PD : 1;
4890 unsigned TO : 1;
4891 unsigned RI : 1;
4892 unsigned : 1;
4893 unsigned : 1;
4894 unsigned : 1;
4896 } __RCONbits_t;
4898 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
4900 #define _NOT_BOR 0x01
4901 #define _BOR 0x01
4902 #define _NOT_POR 0x02
4903 #define _POR 0x02
4904 #define _NOT_PD 0x04
4905 #define _PD 0x04
4906 #define _NOT_TO 0x08
4907 #define _TO 0x08
4908 #define _NOT_RI 0x10
4909 #define _RI 0x10
4910 #define _SBOREN 0x40
4911 #define _IPEN 0x80
4913 //==============================================================================
4916 //==============================================================================
4917 // WDTCON Bits
4919 extern __at(0x0FD1) __sfr WDTCON;
4921 typedef union
4923 struct
4925 unsigned SWDTEN : 1;
4926 unsigned : 1;
4927 unsigned : 1;
4928 unsigned : 1;
4929 unsigned : 1;
4930 unsigned : 1;
4931 unsigned : 1;
4932 unsigned : 1;
4935 struct
4937 unsigned SWDTE : 1;
4938 unsigned : 1;
4939 unsigned : 1;
4940 unsigned : 1;
4941 unsigned : 1;
4942 unsigned : 1;
4943 unsigned : 1;
4944 unsigned : 1;
4946 } __WDTCONbits_t;
4948 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
4950 #define _SWDTEN 0x01
4951 #define _SWDTE 0x01
4953 //==============================================================================
4956 //==============================================================================
4957 // OSCCON2 Bits
4959 extern __at(0x0FD2) __sfr OSCCON2;
4961 typedef struct
4963 unsigned LFIOFS : 1;
4964 unsigned HFIOFR : 1;
4965 unsigned PRISD : 1;
4966 unsigned SOSCGO : 1;
4967 unsigned PLLEN : 1;
4968 unsigned INTSRC : 1;
4969 unsigned SOSCRUN : 1;
4970 unsigned PLLRDY : 1;
4971 } __OSCCON2bits_t;
4973 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
4975 #define _LFIOFS 0x01
4976 #define _HFIOFR 0x02
4977 #define _PRISD 0x04
4978 #define _SOSCGO 0x08
4979 #define _PLLEN 0x10
4980 #define _INTSRC 0x20
4981 #define _SOSCRUN 0x40
4982 #define _PLLRDY 0x80
4984 //==============================================================================
4987 //==============================================================================
4988 // OSCCON Bits
4990 extern __at(0x0FD3) __sfr OSCCON;
4992 typedef union
4994 struct
4996 unsigned SCS0 : 1;
4997 unsigned SCS1 : 1;
4998 unsigned HFIOFS : 1;
4999 unsigned OSTS : 1;
5000 unsigned IRCF0 : 1;
5001 unsigned IRCF1 : 1;
5002 unsigned IRCF2 : 1;
5003 unsigned IDLEN : 1;
5006 struct
5008 unsigned : 1;
5009 unsigned : 1;
5010 unsigned FLTS : 1;
5011 unsigned : 1;
5012 unsigned : 1;
5013 unsigned : 1;
5014 unsigned : 1;
5015 unsigned : 1;
5018 struct
5020 unsigned SCS : 2;
5021 unsigned : 6;
5024 struct
5026 unsigned : 4;
5027 unsigned IRCF : 3;
5028 unsigned : 1;
5030 } __OSCCONbits_t;
5032 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5034 #define _SCS0 0x01
5035 #define _SCS1 0x02
5036 #define _HFIOFS 0x04
5037 #define _FLTS 0x04
5038 #define _OSTS 0x08
5039 #define _IRCF0 0x10
5040 #define _IRCF1 0x20
5041 #define _IRCF2 0x40
5042 #define _IDLEN 0x80
5044 //==============================================================================
5047 //==============================================================================
5048 // T0CON Bits
5050 extern __at(0x0FD5) __sfr T0CON;
5052 typedef union
5054 struct
5056 unsigned T0PS0 : 1;
5057 unsigned T0PS1 : 1;
5058 unsigned T0PS2 : 1;
5059 unsigned PSA : 1;
5060 unsigned T0SE : 1;
5061 unsigned T0CS : 1;
5062 unsigned T08BIT : 1;
5063 unsigned TMR0ON : 1;
5066 struct
5068 unsigned T0PS : 3;
5069 unsigned : 5;
5071 } __T0CONbits_t;
5073 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5075 #define _T0PS0 0x01
5076 #define _T0PS1 0x02
5077 #define _T0PS2 0x04
5078 #define _PSA 0x08
5079 #define _T0SE 0x10
5080 #define _T0CS 0x20
5081 #define _T08BIT 0x40
5082 #define _TMR0ON 0x80
5084 //==============================================================================
5086 extern __at(0x0FD6) __sfr TMR0;
5087 extern __at(0x0FD6) __sfr TMR0L;
5088 extern __at(0x0FD7) __sfr TMR0H;
5090 //==============================================================================
5091 // STATUS Bits
5093 extern __at(0x0FD8) __sfr STATUS;
5095 typedef struct
5097 unsigned C : 1;
5098 unsigned DC : 1;
5099 unsigned Z : 1;
5100 unsigned OV : 1;
5101 unsigned N : 1;
5102 unsigned : 1;
5103 unsigned : 1;
5104 unsigned : 1;
5105 } __STATUSbits_t;
5107 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5109 #define _C 0x01
5110 #define _DC 0x02
5111 #define _Z 0x04
5112 #define _OV 0x08
5113 #define _N 0x10
5115 //==============================================================================
5117 extern __at(0x0FD9) __sfr FSR2L;
5118 extern __at(0x0FDA) __sfr FSR2H;
5119 extern __at(0x0FDB) __sfr PLUSW2;
5120 extern __at(0x0FDC) __sfr PREINC2;
5121 extern __at(0x0FDD) __sfr POSTDEC2;
5122 extern __at(0x0FDE) __sfr POSTINC2;
5123 extern __at(0x0FDF) __sfr INDF2;
5124 extern __at(0x0FE0) __sfr BSR;
5125 extern __at(0x0FE1) __sfr FSR1L;
5126 extern __at(0x0FE2) __sfr FSR1H;
5127 extern __at(0x0FE3) __sfr PLUSW1;
5128 extern __at(0x0FE4) __sfr PREINC1;
5129 extern __at(0x0FE5) __sfr POSTDEC1;
5130 extern __at(0x0FE6) __sfr POSTINC1;
5131 extern __at(0x0FE7) __sfr INDF1;
5132 extern __at(0x0FE8) __sfr WREG;
5133 extern __at(0x0FE9) __sfr FSR0L;
5134 extern __at(0x0FEA) __sfr FSR0H;
5135 extern __at(0x0FEB) __sfr PLUSW0;
5136 extern __at(0x0FEC) __sfr PREINC0;
5137 extern __at(0x0FED) __sfr POSTDEC0;
5138 extern __at(0x0FEE) __sfr POSTINC0;
5139 extern __at(0x0FEF) __sfr INDF0;
5141 //==============================================================================
5142 // INTCON3 Bits
5144 extern __at(0x0FF0) __sfr INTCON3;
5146 typedef union
5148 struct
5150 unsigned INT1IF : 1;
5151 unsigned INT2IF : 1;
5152 unsigned : 1;
5153 unsigned INT1IE : 1;
5154 unsigned INT2IE : 1;
5155 unsigned : 1;
5156 unsigned INT1IP : 1;
5157 unsigned INT2IP : 1;
5160 struct
5162 unsigned INT1F : 1;
5163 unsigned INT2F : 1;
5164 unsigned : 1;
5165 unsigned INT1E : 1;
5166 unsigned INT2E : 1;
5167 unsigned : 1;
5168 unsigned INT1P : 1;
5169 unsigned INT2P : 1;
5171 } __INTCON3bits_t;
5173 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5175 #define _INT1IF 0x01
5176 #define _INT1F 0x01
5177 #define _INT2IF 0x02
5178 #define _INT2F 0x02
5179 #define _INT1IE 0x08
5180 #define _INT1E 0x08
5181 #define _INT2IE 0x10
5182 #define _INT2E 0x10
5183 #define _INT1IP 0x40
5184 #define _INT1P 0x40
5185 #define _INT2IP 0x80
5186 #define _INT2P 0x80
5188 //==============================================================================
5191 //==============================================================================
5192 // INTCON2 Bits
5194 extern __at(0x0FF1) __sfr INTCON2;
5196 typedef union
5198 struct
5200 unsigned IOCIP : 1;
5201 unsigned : 1;
5202 unsigned TMR0IP : 1;
5203 unsigned : 1;
5204 unsigned INTEDG2 : 1;
5205 unsigned INTEDG1 : 1;
5206 unsigned INTEDG0 : 1;
5207 unsigned NOT_RBPU : 1;
5210 struct
5212 unsigned : 1;
5213 unsigned : 1;
5214 unsigned T0IP : 1;
5215 unsigned : 1;
5216 unsigned : 1;
5217 unsigned : 1;
5218 unsigned : 1;
5219 unsigned RBPU : 1;
5221 } __INTCON2bits_t;
5223 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5225 #define _IOCIP 0x01
5226 #define _TMR0IP 0x04
5227 #define _T0IP 0x04
5228 #define _INTEDG2 0x10
5229 #define _INTEDG1 0x20
5230 #define _INTEDG0 0x40
5231 #define _NOT_RBPU 0x80
5232 #define _RBPU 0x80
5234 //==============================================================================
5237 //==============================================================================
5238 // INTCON Bits
5240 extern __at(0x0FF2) __sfr INTCON;
5242 typedef union
5244 struct
5246 unsigned IOCIF : 1;
5247 unsigned INT0IF : 1;
5248 unsigned TMR0IF : 1;
5249 unsigned IOCIE : 1;
5250 unsigned INT0IE : 1;
5251 unsigned TMR0IE : 1;
5252 unsigned PEIE_GIEL : 1;
5253 unsigned GIE_GIEH : 1;
5256 struct
5258 unsigned : 1;
5259 unsigned INT0F : 1;
5260 unsigned T0IF : 1;
5261 unsigned : 1;
5262 unsigned INT0E : 1;
5263 unsigned T0IE : 1;
5264 unsigned PEIE : 1;
5265 unsigned GIE : 1;
5268 struct
5270 unsigned : 1;
5271 unsigned : 1;
5272 unsigned : 1;
5273 unsigned : 1;
5274 unsigned : 1;
5275 unsigned : 1;
5276 unsigned GIEL : 1;
5277 unsigned GIEH : 1;
5279 } __INTCONbits_t;
5281 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5283 #define _IOCIF 0x01
5284 #define _INT0IF 0x02
5285 #define _INT0F 0x02
5286 #define _TMR0IF 0x04
5287 #define _T0IF 0x04
5288 #define _IOCIE 0x08
5289 #define _INT0IE 0x10
5290 #define _INT0E 0x10
5291 #define _TMR0IE 0x20
5292 #define _T0IE 0x20
5293 #define _PEIE_GIEL 0x40
5294 #define _PEIE 0x40
5295 #define _GIEL 0x40
5296 #define _GIE_GIEH 0x80
5297 #define _GIE 0x80
5298 #define _GIEH 0x80
5300 //==============================================================================
5302 extern __at(0x0FF3) __sfr PROD;
5303 extern __at(0x0FF3) __sfr PRODL;
5304 extern __at(0x0FF4) __sfr PRODH;
5305 extern __at(0x0FF5) __sfr TABLAT;
5306 extern __at(0x0FF6) __sfr TBLPTR;
5307 extern __at(0x0FF6) __sfr TBLPTRL;
5308 extern __at(0x0FF7) __sfr TBLPTRH;
5309 extern __at(0x0FF8) __sfr TBLPTRU;
5310 extern __at(0x0FF9) __sfr PC;
5311 extern __at(0x0FF9) __sfr PCL;
5312 extern __at(0x0FFA) __sfr PCLATH;
5313 extern __at(0x0FFB) __sfr PCLATU;
5315 //==============================================================================
5316 // STKPTR Bits
5318 extern __at(0x0FFC) __sfr STKPTR;
5320 typedef union
5322 struct
5324 unsigned SP0 : 1;
5325 unsigned SP1 : 1;
5326 unsigned SP2 : 1;
5327 unsigned SP3 : 1;
5328 unsigned SP4 : 1;
5329 unsigned : 1;
5330 unsigned STKUNF : 1;
5331 unsigned STKFUL : 1;
5334 struct
5336 unsigned : 1;
5337 unsigned : 1;
5338 unsigned : 1;
5339 unsigned : 1;
5340 unsigned : 1;
5341 unsigned : 1;
5342 unsigned : 1;
5343 unsigned STKOVF : 1;
5346 struct
5348 unsigned SP : 5;
5349 unsigned : 3;
5351 } __STKPTRbits_t;
5353 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5355 #define _SP0 0x01
5356 #define _SP1 0x02
5357 #define _SP2 0x04
5358 #define _SP3 0x08
5359 #define _SP4 0x10
5360 #define _STKUNF 0x40
5361 #define _STKFUL 0x80
5362 #define _STKOVF 0x80
5364 //==============================================================================
5366 extern __at(0x0FFD) __sfr TOS;
5367 extern __at(0x0FFD) __sfr TOSL;
5368 extern __at(0x0FFE) __sfr TOSH;
5369 extern __at(0x0FFF) __sfr TOSU;
5371 //==============================================================================
5373 // Configuration Bits
5375 //==============================================================================
5377 #define __CONFIG1L 0x300000
5378 #define __CONFIG1H 0x300001
5379 #define __CONFIG2L 0x300002
5380 #define __CONFIG2H 0x300003
5381 #define __CONFIG3H 0x300005
5382 #define __CONFIG4L 0x300006
5383 #define __CONFIG5L 0x300008
5384 #define __CONFIG5H 0x300009
5385 #define __CONFIG6L 0x30000A
5386 #define __CONFIG6H 0x30000B
5387 #define __CONFIG7L 0x30000C
5388 #define __CONFIG7H 0x30000D
5390 //----------------------------- CONFIG1L Options -------------------------------
5392 #define _PLLSEL_PLL4X_1L 0xFE // 4x clock multiplier.
5393 #define _PLLSEL_PLL3X_1L 0xFF // 3x clock multiplier.
5394 #define _CFGPLLEN_OFF_1L 0xFD // PLL Disabled (firmware controlled).
5395 #define _CFGPLLEN_ON_1L 0xFF // PLL Enabled.
5396 #define _CPUDIV_NOCLKDIV_1L 0xE7 // CPU uses system clock (no divide).
5397 #define _CPUDIV_CLKDIV2_1L 0xEF // CPU uses system clock divided by 2.
5398 #define _CPUDIV_CLKDIV3_1L 0xF7 // CPU uses system clock divided by 3.
5399 #define _CPUDIV_CLKDIV6_1L 0xFF // CPU uses system clock divided by 6.
5400 #define _LS48MHZ_SYS24X4_1L 0xDF // System clock at 24 MHz, USB clock divider is set to 4.
5401 #define _LS48MHZ_SYS48X8_1L 0xFF // System clock at 48 MHz, USB clock divider is set to 8.
5403 //----------------------------- CONFIG1H Options -------------------------------
5405 #define _FOSC_LP_1H 0xF0 // LP oscillator.
5406 #define _FOSC_XT_1H 0xF1 // XT oscillator.
5407 #define _FOSC_HSH_1H 0xF2 // HS oscillator, high power 16MHz to 25MHz.
5408 #define _FOSC_HSM_1H 0xF3 // HS oscillator, medium power 4MHz to 16MHz.
5409 #define _FOSC_ECHCLKO_1H 0xF4 // EC oscillator, high power 16MHz to 48MHz, clock output on OSC2.
5410 #define _FOSC_ECHIO_1H 0xF5 // EC oscillator, high power 16MHz to 48MHz.
5411 #define _FOSC_RCCLKO_1H 0xF6 // External RC oscillator, clock output on OSC2.
5412 #define _FOSC_RCIO_1H 0xF7 // External RC oscillator.
5413 #define _FOSC_INTOSCIO_1H 0xF8 // Internal oscillator.
5414 #define _FOSC_INTOSCCLKO_1H 0xF9 // Internal oscillator, clock output on OSC2.
5415 #define _FOSC_ECMCLKO_1H 0xFA // EC oscillator, medium power 4MHz to 16MHz, clock output on OSC2.
5416 #define _FOSC_ECMIO_1H 0xFB // EC oscillator, medium power 4MHz to 16MHz.
5417 #define _FOSC_ECLCLKO_1H 0xFC // EC oscillator, low power <4MHz, clock output on OSC2.
5418 #define _FOSC_ECLIO_1H 0xFD // EC oscillator, low power <4MHz.
5419 #define _PCLKEN_OFF_1H 0xDF // Primary oscillator shutdown firmware controlled.
5420 #define _PCLKEN_ON_1H 0xFF // Primary oscillator enabled.
5421 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
5422 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
5423 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
5424 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
5426 //----------------------------- CONFIG2L Options -------------------------------
5428 #define _nPWRTEN_ON_2L 0xFE // Power up timer enabled.
5429 #define _nPWRTEN_OFF_2L 0xFF // Power up timer disabled.
5430 #define _BOREN_OFF_2L 0xF9 // BOR disabled in hardware (SBOREN is ignored).
5431 #define _BOREN_ON_2L 0xFB // BOR controlled by firmware (SBOREN is enabled).
5432 #define _BOREN_NOSLP_2L 0xFD // BOR enabled in hardware, disabled in Sleep mode (SBOREN is ignored).
5433 #define _BOREN_SBORDIS_2L 0xFF // BOR enabled in hardware (SBOREN is ignored).
5434 #define _BORV_285_2L 0xE7 // BOR set to 2.85V nominal.
5435 #define _BORV_250_2L 0xEF // BOR set to 2.5V nominal.
5436 #define _BORV_220_2L 0xF7 // BOR set to 2.2V nominal.
5437 #define _BORV_190_2L 0xFF // BOR set to 1.9V nominal.
5438 #define _nLPBOR_ON_2L 0xBF // Low-Power Brown-out Reset enabled.
5439 #define _nLPBOR_OFF_2L 0xFF // Low-Power Brown-out Reset disabled.
5441 //----------------------------- CONFIG2H Options -------------------------------
5443 #define _WDTEN_OFF_2H 0xFC // WDT disabled in hardware (SWDTEN ignored).
5444 #define _WDTEN_NOSLP_2H 0xFD // WDT enabled in hardware, disabled in Sleep mode (SWDTEN ignored).
5445 #define _WDTEN_SWON_2H 0xFE // WDT controlled by firmware (SWDTEN enabled).
5446 #define _WDTEN_ON_2H 0xFF // WDT enabled in hardware (SWDTEN ignored).
5447 #define _WDTPS_1_2H 0xC3 // 1:1.
5448 #define _WDTPS_2_2H 0xC7 // 1:2.
5449 #define _WDTPS_4_2H 0xCB // 1:4.
5450 #define _WDTPS_8_2H 0xCF // 1:8.
5451 #define _WDTPS_16_2H 0xD3 // 1:16.
5452 #define _WDTPS_32_2H 0xD7 // 1:32.
5453 #define _WDTPS_64_2H 0xDB // 1:64.
5454 #define _WDTPS_128_2H 0xDF // 1:128.
5455 #define _WDTPS_256_2H 0xE3 // 1:256.
5456 #define _WDTPS_512_2H 0xE7 // 1:512.
5457 #define _WDTPS_1024_2H 0xEB // 1:1024.
5458 #define _WDTPS_2048_2H 0xEF // 1:2048.
5459 #define _WDTPS_4096_2H 0xF3 // 1:4096.
5460 #define _WDTPS_8192_2H 0xF7 // 1:8192.
5461 #define _WDTPS_16384_2H 0xFB // 1:16384.
5462 #define _WDTPS_32768_2H 0xFF // 1:32768.
5464 //----------------------------- CONFIG3H Options -------------------------------
5466 #define _CCP2MX_RB3_3H 0xFE // CCP2 input/output is multiplexed with RB3.
5467 #define _CCP2MX_RC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
5468 #define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset.
5469 #define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset.
5470 #define _T3CMX_RB5_3H 0xEF // T3CKI function is on RB5.
5471 #define _T3CMX_RC0_3H 0xFF // T3CKI function is on RC0.
5472 #define _SDOMX_RC7_3H 0xBF // SDO function is on RC7.
5473 #define _SDOMX_RB3_3H 0xFF // SDO function is on RB3.
5474 #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; external MCLR disabled.
5475 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input disabled.
5477 //----------------------------- CONFIG4L Options -------------------------------
5479 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
5480 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
5481 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
5482 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1.
5483 #define _ICPRT_OFF_4L 0xDF // ICPORT disabled.
5484 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled.
5485 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
5486 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
5487 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
5489 //----------------------------- CONFIG5L Options -------------------------------
5491 #define _CP0_ON_5L 0xFE // Block 0 is code-protected.
5492 #define _CP0_OFF_5L 0xFF // Block 0 is not code-protected.
5493 #define _CP1_ON_5L 0xFD // Block 1 is code-protected.
5494 #define _CP1_OFF_5L 0xFF // Block 1 is not code-protected.
5495 #define _CP2_ON_5L 0xFB // Block 2 is code-protected.
5496 #define _CP2_OFF_5L 0xFF // Block 2 is not code-protected.
5497 #define _CP3_ON_5L 0xF7 // Block 3 is code-protected.
5498 #define _CP3_OFF_5L 0xFF // Block 3 is not code-protected.
5500 //----------------------------- CONFIG5H Options -------------------------------
5502 #define _CPB_ON_5H 0xBF // Boot block is code-protected.
5503 #define _CPB_OFF_5H 0xFF // Boot block is not code-protected.
5504 #define _CPD_ON_5H 0x7F // Data EEPROM is code-protected.
5505 #define _CPD_OFF_5H 0xFF // Data EEPROM is not code-protected.
5507 //----------------------------- CONFIG6L Options -------------------------------
5509 #define _WRT0_ON_6L 0xFE // Block 0 (0800-1FFFh) is write-protected.
5510 #define _WRT0_OFF_6L 0xFF // Block 0 (0800-1FFFh) is not write-protected.
5511 #define _WRT1_ON_6L 0xFD // Block 1 (2000-3FFFh) is write-protected.
5512 #define _WRT1_OFF_6L 0xFF // Block 1 (2000-3FFFh) is not write-protected.
5513 #define _WRT2_ON_6L 0xFB // Block 2 (04000-5FFFh) is write-protected.
5514 #define _WRT2_OFF_6L 0xFF // Block 2 (04000-5FFFh) is not write-protected.
5515 #define _WRT3_ON_6L 0xF7 // Block 3 (06000-7FFFh) is write-protected.
5516 #define _WRT3_OFF_6L 0xFF // Block 3 (06000-7FFFh) is not write-protected.
5518 //----------------------------- CONFIG6H Options -------------------------------
5520 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) are write-protected.
5521 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) are not write-protected.
5522 #define _WRTB_ON_6H 0xBF // Boot block (0000-7FFh) is write-protected.
5523 #define _WRTB_OFF_6H 0xFF // Boot block (0000-7FFh) is not write-protected.
5524 #define _WRTD_ON_6H 0x7F // Data EEPROM is write-protected.
5525 #define _WRTD_OFF_6H 0xFF // Data EEPROM is not write-protected.
5527 //----------------------------- CONFIG7L Options -------------------------------
5529 #define _EBTR0_ON_7L 0xFE // Block 0 is protected from table reads executed in other blocks.
5530 #define _EBTR0_OFF_7L 0xFF // Block 0 is not protected from table reads executed in other blocks.
5531 #define _EBTR1_ON_7L 0xFD // Block 1 is protected from table reads executed in other blocks.
5532 #define _EBTR1_OFF_7L 0xFF // Block 1 is not protected from table reads executed in other blocks.
5533 #define _EBTR2_ON_7L 0xFB // Block 2 is protected from table reads executed in other blocks.
5534 #define _EBTR2_OFF_7L 0xFF // Block 2 is not protected from table reads executed in other blocks.
5535 #define _EBTR3_ON_7L 0xF7 // Block 3 is protected from table reads executed in other blocks.
5536 #define _EBTR3_OFF_7L 0xFF // Block 3 is not protected from table reads executed in other blocks.
5538 //----------------------------- CONFIG7H Options -------------------------------
5540 #define _EBTRB_ON_7H 0xBF // Boot block is protected from table reads executed in other blocks.
5541 #define _EBTRB_OFF_7H 0xFF // Boot block is not protected from table reads executed in other blocks.
5543 //==============================================================================
5545 #define __DEVID1 0x3FFFFE
5546 #define __DEVID2 0x3FFFFF
5548 #define __IDLOC0 0x200000
5549 #define __IDLOC1 0x200001
5550 #define __IDLOC2 0x200002
5551 #define __IDLOC3 0x200003
5552 #define __IDLOC4 0x200004
5553 #define __IDLOC5 0x200005
5554 #define __IDLOC6 0x200006
5555 #define __IDLOC7 0x200007
5557 #endif // #ifndef __PIC18LF25K50_H__