Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f45k50.h
blobdac005f8ccb1e3a813d989c34f52d972ac9fe3ec
1 /*
2 * This declarations of the PIC18F45K50 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:30 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 __PIC18F45K50_H__
26 #define __PIC18F45K50_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // SRCON1 Bits
40 extern __at(0x0F57) __sfr SRCON1;
42 typedef struct
44 unsigned SRRC1E : 1;
45 unsigned SRRC2E : 1;
46 unsigned SRRCKE : 1;
47 unsigned SRRPE : 1;
48 unsigned SRSC1E : 1;
49 unsigned SRSC2E : 1;
50 unsigned SRSCKE : 1;
51 unsigned SRSPE : 1;
52 } __SRCON1bits_t;
54 extern __at(0x0F57) volatile __SRCON1bits_t SRCON1bits;
56 #define _SRRC1E 0x01
57 #define _SRRC2E 0x02
58 #define _SRRCKE 0x04
59 #define _SRRPE 0x08
60 #define _SRSC1E 0x10
61 #define _SRSC2E 0x20
62 #define _SRSCKE 0x40
63 #define _SRSPE 0x80
65 //==============================================================================
68 //==============================================================================
69 // SRCON0 Bits
71 extern __at(0x0F58) __sfr SRCON0;
73 typedef union
75 struct
77 unsigned SRPR : 1;
78 unsigned SRPS : 1;
79 unsigned SRNQEN : 1;
80 unsigned SRQEN : 1;
81 unsigned SRCLK0 : 1;
82 unsigned SRCLK1 : 1;
83 unsigned SRCLK2 : 1;
84 unsigned SRLEN : 1;
87 struct
89 unsigned : 4;
90 unsigned SRCLK : 3;
91 unsigned : 1;
93 } __SRCON0bits_t;
95 extern __at(0x0F58) volatile __SRCON0bits_t SRCON0bits;
97 #define _SRPR 0x01
98 #define _SRPS 0x02
99 #define _SRNQEN 0x04
100 #define _SRQEN 0x08
101 #define _SRCLK0 0x10
102 #define _SRCLK1 0x20
103 #define _SRCLK2 0x40
104 #define _SRLEN 0x80
106 //==============================================================================
109 //==============================================================================
110 // CCPTMRS Bits
112 extern __at(0x0F59) __sfr CCPTMRS;
114 typedef struct
116 unsigned C1TSEL : 1;
117 unsigned : 1;
118 unsigned : 1;
119 unsigned C2TSEL : 1;
120 unsigned : 1;
121 unsigned : 1;
122 unsigned : 1;
123 unsigned : 1;
124 } __CCPTMRSbits_t;
126 extern __at(0x0F59) volatile __CCPTMRSbits_t CCPTMRSbits;
128 #define _C1TSEL 0x01
129 #define _C2TSEL 0x08
131 //==============================================================================
133 extern __at(0x0F5A) __sfr VREGCON;
135 //==============================================================================
136 // ANSELA Bits
138 extern __at(0x0F5B) __sfr ANSELA;
140 typedef struct
142 unsigned ANSA0 : 1;
143 unsigned ANSA1 : 1;
144 unsigned ANSA2 : 1;
145 unsigned ANSA3 : 1;
146 unsigned : 1;
147 unsigned ANSA5 : 1;
148 unsigned : 1;
149 unsigned : 1;
150 } __ANSELAbits_t;
152 extern __at(0x0F5B) volatile __ANSELAbits_t ANSELAbits;
154 #define _ANSA0 0x01
155 #define _ANSA1 0x02
156 #define _ANSA2 0x04
157 #define _ANSA3 0x08
158 #define _ANSA5 0x20
160 //==============================================================================
163 //==============================================================================
164 // ANSELB Bits
166 extern __at(0x0F5C) __sfr ANSELB;
168 typedef union
170 struct
172 unsigned ANSB0 : 1;
173 unsigned ANSB1 : 1;
174 unsigned ANSB2 : 1;
175 unsigned ANSB3 : 1;
176 unsigned ANSB4 : 1;
177 unsigned ANSB5 : 1;
178 unsigned : 1;
179 unsigned : 1;
182 struct
184 unsigned ANSB : 6;
185 unsigned : 2;
187 } __ANSELBbits_t;
189 extern __at(0x0F5C) volatile __ANSELBbits_t ANSELBbits;
191 #define _ANSB0 0x01
192 #define _ANSB1 0x02
193 #define _ANSB2 0x04
194 #define _ANSB3 0x08
195 #define _ANSB4 0x10
196 #define _ANSB5 0x20
198 //==============================================================================
201 //==============================================================================
202 // ANSELC Bits
204 extern __at(0x0F5D) __sfr ANSELC;
206 typedef struct
208 unsigned : 1;
209 unsigned : 1;
210 unsigned ANSC2 : 1;
211 unsigned : 1;
212 unsigned : 1;
213 unsigned : 1;
214 unsigned ANSC6 : 1;
215 unsigned ANSC7 : 1;
216 } __ANSELCbits_t;
218 extern __at(0x0F5D) volatile __ANSELCbits_t ANSELCbits;
220 #define _ANSC2 0x04
221 #define _ANSC6 0x40
222 #define _ANSC7 0x80
224 //==============================================================================
227 //==============================================================================
228 // ANSELD Bits
230 extern __at(0x0F5E) __sfr ANSELD;
232 typedef struct
234 unsigned ANSD0 : 1;
235 unsigned ANSD1 : 1;
236 unsigned ANSD2 : 1;
237 unsigned ANSD3 : 1;
238 unsigned ANSD4 : 1;
239 unsigned ANSD5 : 1;
240 unsigned ANSD6 : 1;
241 unsigned ANSD7 : 1;
242 } __ANSELDbits_t;
244 extern __at(0x0F5E) volatile __ANSELDbits_t ANSELDbits;
246 #define _ANSD0 0x01
247 #define _ANSD1 0x02
248 #define _ANSD2 0x04
249 #define _ANSD3 0x08
250 #define _ANSD4 0x10
251 #define _ANSD5 0x20
252 #define _ANSD6 0x40
253 #define _ANSD7 0x80
255 //==============================================================================
258 //==============================================================================
259 // ANSELE Bits
261 extern __at(0x0F5F) __sfr ANSELE;
263 typedef union
265 struct
267 unsigned ANSE0 : 1;
268 unsigned ANSE1 : 1;
269 unsigned ANSE2 : 1;
270 unsigned : 1;
271 unsigned : 1;
272 unsigned : 1;
273 unsigned : 1;
274 unsigned : 1;
277 struct
279 unsigned ANSE : 3;
280 unsigned : 5;
282 } __ANSELEbits_t;
284 extern __at(0x0F5F) volatile __ANSELEbits_t ANSELEbits;
286 #define _ANSE0 0x01
287 #define _ANSE1 0x02
288 #define _ANSE2 0x04
290 //==============================================================================
293 //==============================================================================
294 // UCON Bits
296 extern __at(0x0F60) __sfr UCON;
298 typedef struct
300 unsigned : 1;
301 unsigned SUSPND : 1;
302 unsigned RESUME : 1;
303 unsigned USBEN : 1;
304 unsigned PKTDIS : 1;
305 unsigned SE0 : 1;
306 unsigned PPBRST : 1;
307 unsigned : 1;
308 } __UCONbits_t;
310 extern __at(0x0F60) volatile __UCONbits_t UCONbits;
312 #define _SUSPND 0x02
313 #define _RESUME 0x04
314 #define _USBEN 0x08
315 #define _PKTDIS 0x10
316 #define _SE0 0x20
317 #define _PPBRST 0x40
319 //==============================================================================
322 //==============================================================================
323 // USTAT Bits
325 extern __at(0x0F61) __sfr USTAT;
327 typedef union
329 struct
331 unsigned : 1;
332 unsigned PPBI : 1;
333 unsigned DIR : 1;
334 unsigned ENDP0 : 1;
335 unsigned ENDP1 : 1;
336 unsigned ENDP2 : 1;
337 unsigned ENDP3 : 1;
338 unsigned : 1;
341 struct
343 unsigned : 3;
344 unsigned ENDP : 4;
345 unsigned : 1;
347 } __USTATbits_t;
349 extern __at(0x0F61) volatile __USTATbits_t USTATbits;
351 #define _PPBI 0x02
352 #define _DIR 0x04
353 #define _ENDP0 0x08
354 #define _ENDP1 0x10
355 #define _ENDP2 0x20
356 #define _ENDP3 0x40
358 //==============================================================================
361 //==============================================================================
362 // UCFG Bits
364 extern __at(0x0F62) __sfr UCFG;
366 typedef union
368 struct
370 unsigned PPB0 : 1;
371 unsigned PPB1 : 1;
372 unsigned FSEN : 1;
373 unsigned UTRDIS : 1;
374 unsigned UPUEN : 1;
375 unsigned : 1;
376 unsigned UOEMON : 1;
377 unsigned UTEYE : 1;
380 struct
382 unsigned PPB : 2;
383 unsigned : 6;
385 } __UCFGbits_t;
387 extern __at(0x0F62) volatile __UCFGbits_t UCFGbits;
389 #define _PPB0 0x01
390 #define _PPB1 0x02
391 #define _FSEN 0x04
392 #define _UTRDIS 0x08
393 #define _UPUEN 0x10
394 #define _UOEMON 0x40
395 #define _UTEYE 0x80
397 //==============================================================================
400 //==============================================================================
401 // UADDR Bits
403 extern __at(0x0F63) __sfr UADDR;
405 typedef union
407 struct
409 unsigned ADDR0 : 1;
410 unsigned ADDR1 : 1;
411 unsigned ADDR2 : 1;
412 unsigned ADDR3 : 1;
413 unsigned ADDR4 : 1;
414 unsigned ADDR5 : 1;
415 unsigned ADDR6 : 1;
416 unsigned : 1;
419 struct
421 unsigned ADDR : 7;
422 unsigned : 1;
424 } __UADDRbits_t;
426 extern __at(0x0F63) volatile __UADDRbits_t UADDRbits;
428 #define _ADDR0 0x01
429 #define _ADDR1 0x02
430 #define _ADDR2 0x04
431 #define _ADDR3 0x08
432 #define _ADDR4 0x10
433 #define _ADDR5 0x20
434 #define _ADDR6 0x40
436 //==============================================================================
439 //==============================================================================
440 // UIE Bits
442 extern __at(0x0F64) __sfr UIE;
444 typedef struct
446 unsigned URSTIE : 1;
447 unsigned UERRIE : 1;
448 unsigned ACTVIE : 1;
449 unsigned TRNIE : 1;
450 unsigned IDLEIE : 1;
451 unsigned STALLIE : 1;
452 unsigned SOFIE : 1;
453 unsigned : 1;
454 } __UIEbits_t;
456 extern __at(0x0F64) volatile __UIEbits_t UIEbits;
458 #define _URSTIE 0x01
459 #define _UERRIE 0x02
460 #define _ACTVIE 0x04
461 #define _TRNIE 0x08
462 #define _IDLEIE 0x10
463 #define _STALLIE 0x20
464 #define _SOFIE 0x40
466 //==============================================================================
469 //==============================================================================
470 // UIR Bits
472 extern __at(0x0F65) __sfr UIR;
474 typedef struct
476 unsigned URSTIF : 1;
477 unsigned UERRIF : 1;
478 unsigned ACTVIF : 1;
479 unsigned TRNIF : 1;
480 unsigned IDLEIF : 1;
481 unsigned STALLIF : 1;
482 unsigned SOFIF : 1;
483 unsigned : 1;
484 } __UIRbits_t;
486 extern __at(0x0F65) volatile __UIRbits_t UIRbits;
488 #define _URSTIF 0x01
489 #define _UERRIF 0x02
490 #define _ACTVIF 0x04
491 #define _TRNIF 0x08
492 #define _IDLEIF 0x10
493 #define _STALLIF 0x20
494 #define _SOFIF 0x40
496 //==============================================================================
499 //==============================================================================
500 // UEIE Bits
502 extern __at(0x0F66) __sfr UEIE;
504 typedef struct
506 unsigned PIDEE : 1;
507 unsigned CRC5EE : 1;
508 unsigned CRC16EE : 1;
509 unsigned DFN8EE : 1;
510 unsigned BTOEE : 1;
511 unsigned : 1;
512 unsigned : 1;
513 unsigned BTSEE : 1;
514 } __UEIEbits_t;
516 extern __at(0x0F66) volatile __UEIEbits_t UEIEbits;
518 #define _PIDEE 0x01
519 #define _CRC5EE 0x02
520 #define _CRC16EE 0x04
521 #define _DFN8EE 0x08
522 #define _BTOEE 0x10
523 #define _BTSEE 0x80
525 //==============================================================================
528 //==============================================================================
529 // UEIR Bits
531 extern __at(0x0F67) __sfr UEIR;
533 typedef struct
535 unsigned PIDEF : 1;
536 unsigned CRC5EF : 1;
537 unsigned CRC16EF : 1;
538 unsigned DFN8EF : 1;
539 unsigned BTOEF : 1;
540 unsigned : 1;
541 unsigned : 1;
542 unsigned BTSEF : 1;
543 } __UEIRbits_t;
545 extern __at(0x0F67) volatile __UEIRbits_t UEIRbits;
547 #define _PIDEF 0x01
548 #define _CRC5EF 0x02
549 #define _CRC16EF 0x04
550 #define _DFN8EF 0x08
551 #define _BTOEF 0x10
552 #define _BTSEF 0x80
554 //==============================================================================
556 extern __at(0x0F68) __sfr UFRM;
558 //==============================================================================
559 // UFRML Bits
561 extern __at(0x0F68) __sfr UFRML;
563 typedef struct
565 unsigned FRM0 : 1;
566 unsigned FRM1 : 1;
567 unsigned FRM2 : 1;
568 unsigned FRM3 : 1;
569 unsigned FRM4 : 1;
570 unsigned FRM5 : 1;
571 unsigned FRM6 : 1;
572 unsigned FRM7 : 1;
573 } __UFRMLbits_t;
575 extern __at(0x0F68) volatile __UFRMLbits_t UFRMLbits;
577 #define _FRM0 0x01
578 #define _FRM1 0x02
579 #define _FRM2 0x04
580 #define _FRM3 0x08
581 #define _FRM4 0x10
582 #define _FRM5 0x20
583 #define _FRM6 0x40
584 #define _FRM7 0x80
586 //==============================================================================
589 //==============================================================================
590 // UFRMH Bits
592 extern __at(0x0F69) __sfr UFRMH;
594 typedef struct
596 unsigned FRM8 : 1;
597 unsigned FRM9 : 1;
598 unsigned FRM10 : 1;
599 unsigned : 1;
600 unsigned : 1;
601 unsigned : 1;
602 unsigned : 1;
603 unsigned : 1;
604 } __UFRMHbits_t;
606 extern __at(0x0F69) volatile __UFRMHbits_t UFRMHbits;
608 #define _FRM8 0x01
609 #define _FRM9 0x02
610 #define _FRM10 0x04
612 //==============================================================================
615 //==============================================================================
616 // UEP0 Bits
618 extern __at(0x0F6A) __sfr UEP0;
620 typedef struct
622 unsigned EPSTALL : 1;
623 unsigned EPINEN : 1;
624 unsigned EPOUTEN : 1;
625 unsigned EPCONDIS : 1;
626 unsigned EPHSHK : 1;
627 unsigned : 1;
628 unsigned : 1;
629 unsigned : 1;
630 } __UEP0bits_t;
632 extern __at(0x0F6A) volatile __UEP0bits_t UEP0bits;
634 #define _EPSTALL 0x01
635 #define _EPINEN 0x02
636 #define _EPOUTEN 0x04
637 #define _EPCONDIS 0x08
638 #define _EPHSHK 0x10
640 //==============================================================================
643 //==============================================================================
644 // UEP1 Bits
646 extern __at(0x0F6B) __sfr UEP1;
648 typedef struct
650 unsigned EPSTALL : 1;
651 unsigned EPINEN : 1;
652 unsigned EPOUTEN : 1;
653 unsigned EPCONDIS : 1;
654 unsigned EPHSHK : 1;
655 unsigned : 1;
656 unsigned : 1;
657 unsigned : 1;
658 } __UEP1bits_t;
660 extern __at(0x0F6B) volatile __UEP1bits_t UEP1bits;
662 #define _UEP1_EPSTALL 0x01
663 #define _UEP1_EPINEN 0x02
664 #define _UEP1_EPOUTEN 0x04
665 #define _UEP1_EPCONDIS 0x08
666 #define _UEP1_EPHSHK 0x10
668 //==============================================================================
671 //==============================================================================
672 // UEP2 Bits
674 extern __at(0x0F6C) __sfr UEP2;
676 typedef struct
678 unsigned EPSTALL : 1;
679 unsigned EPINEN : 1;
680 unsigned EPOUTEN : 1;
681 unsigned EPCONDIS : 1;
682 unsigned EPHSHK : 1;
683 unsigned : 1;
684 unsigned : 1;
685 unsigned : 1;
686 } __UEP2bits_t;
688 extern __at(0x0F6C) volatile __UEP2bits_t UEP2bits;
690 #define _UEP2_EPSTALL 0x01
691 #define _UEP2_EPINEN 0x02
692 #define _UEP2_EPOUTEN 0x04
693 #define _UEP2_EPCONDIS 0x08
694 #define _UEP2_EPHSHK 0x10
696 //==============================================================================
699 //==============================================================================
700 // UEP3 Bits
702 extern __at(0x0F6D) __sfr UEP3;
704 typedef struct
706 unsigned EPSTALL : 1;
707 unsigned EPINEN : 1;
708 unsigned EPOUTEN : 1;
709 unsigned EPCONDIS : 1;
710 unsigned EPHSHK : 1;
711 unsigned : 1;
712 unsigned : 1;
713 unsigned : 1;
714 } __UEP3bits_t;
716 extern __at(0x0F6D) volatile __UEP3bits_t UEP3bits;
718 #define _UEP3_EPSTALL 0x01
719 #define _UEP3_EPINEN 0x02
720 #define _UEP3_EPOUTEN 0x04
721 #define _UEP3_EPCONDIS 0x08
722 #define _UEP3_EPHSHK 0x10
724 //==============================================================================
727 //==============================================================================
728 // UEP4 Bits
730 extern __at(0x0F6E) __sfr UEP4;
732 typedef struct
734 unsigned EPSTALL : 1;
735 unsigned EPINEN : 1;
736 unsigned EPOUTEN : 1;
737 unsigned EPCONDIS : 1;
738 unsigned EPHSHK : 1;
739 unsigned : 1;
740 unsigned : 1;
741 unsigned : 1;
742 } __UEP4bits_t;
744 extern __at(0x0F6E) volatile __UEP4bits_t UEP4bits;
746 #define _UEP4_EPSTALL 0x01
747 #define _UEP4_EPINEN 0x02
748 #define _UEP4_EPOUTEN 0x04
749 #define _UEP4_EPCONDIS 0x08
750 #define _UEP4_EPHSHK 0x10
752 //==============================================================================
755 //==============================================================================
756 // UEP5 Bits
758 extern __at(0x0F6F) __sfr UEP5;
760 typedef struct
762 unsigned EPSTALL : 1;
763 unsigned EPINEN : 1;
764 unsigned EPOUTEN : 1;
765 unsigned EPCONDIS : 1;
766 unsigned EPHSHK : 1;
767 unsigned : 1;
768 unsigned : 1;
769 unsigned : 1;
770 } __UEP5bits_t;
772 extern __at(0x0F6F) volatile __UEP5bits_t UEP5bits;
774 #define _UEP5_EPSTALL 0x01
775 #define _UEP5_EPINEN 0x02
776 #define _UEP5_EPOUTEN 0x04
777 #define _UEP5_EPCONDIS 0x08
778 #define _UEP5_EPHSHK 0x10
780 //==============================================================================
783 //==============================================================================
784 // UEP6 Bits
786 extern __at(0x0F70) __sfr UEP6;
788 typedef struct
790 unsigned EPSTALL : 1;
791 unsigned EPINEN : 1;
792 unsigned EPOUTEN : 1;
793 unsigned EPCONDIS : 1;
794 unsigned EPHSHK : 1;
795 unsigned : 1;
796 unsigned : 1;
797 unsigned : 1;
798 } __UEP6bits_t;
800 extern __at(0x0F70) volatile __UEP6bits_t UEP6bits;
802 #define _UEP6_EPSTALL 0x01
803 #define _UEP6_EPINEN 0x02
804 #define _UEP6_EPOUTEN 0x04
805 #define _UEP6_EPCONDIS 0x08
806 #define _UEP6_EPHSHK 0x10
808 //==============================================================================
811 //==============================================================================
812 // UEP7 Bits
814 extern __at(0x0F71) __sfr UEP7;
816 typedef struct
818 unsigned EPSTALL : 1;
819 unsigned EPINEN : 1;
820 unsigned EPOUTEN : 1;
821 unsigned EPCONDIS : 1;
822 unsigned EPHSHK : 1;
823 unsigned : 1;
824 unsigned : 1;
825 unsigned : 1;
826 } __UEP7bits_t;
828 extern __at(0x0F71) volatile __UEP7bits_t UEP7bits;
830 #define _UEP7_EPSTALL 0x01
831 #define _UEP7_EPINEN 0x02
832 #define _UEP7_EPOUTEN 0x04
833 #define _UEP7_EPCONDIS 0x08
834 #define _UEP7_EPHSHK 0x10
836 //==============================================================================
839 //==============================================================================
840 // UEP8 Bits
842 extern __at(0x0F72) __sfr UEP8;
844 typedef struct
846 unsigned EPSTALL : 1;
847 unsigned EPINEN : 1;
848 unsigned EPOUTEN : 1;
849 unsigned EPCONDIS : 1;
850 unsigned EPHSHK : 1;
851 unsigned : 1;
852 unsigned : 1;
853 unsigned : 1;
854 } __UEP8bits_t;
856 extern __at(0x0F72) volatile __UEP8bits_t UEP8bits;
858 #define _UEP8_EPSTALL 0x01
859 #define _UEP8_EPINEN 0x02
860 #define _UEP8_EPOUTEN 0x04
861 #define _UEP8_EPCONDIS 0x08
862 #define _UEP8_EPHSHK 0x10
864 //==============================================================================
867 //==============================================================================
868 // UEP9 Bits
870 extern __at(0x0F73) __sfr UEP9;
872 typedef struct
874 unsigned EPSTALL : 1;
875 unsigned EPINEN : 1;
876 unsigned EPOUTEN : 1;
877 unsigned EPCONDIS : 1;
878 unsigned EPHSHK : 1;
879 unsigned : 1;
880 unsigned : 1;
881 unsigned : 1;
882 } __UEP9bits_t;
884 extern __at(0x0F73) volatile __UEP9bits_t UEP9bits;
886 #define _UEP9_EPSTALL 0x01
887 #define _UEP9_EPINEN 0x02
888 #define _UEP9_EPOUTEN 0x04
889 #define _UEP9_EPCONDIS 0x08
890 #define _UEP9_EPHSHK 0x10
892 //==============================================================================
895 //==============================================================================
896 // UEP10 Bits
898 extern __at(0x0F74) __sfr UEP10;
900 typedef struct
902 unsigned EPSTALL : 1;
903 unsigned EPINEN : 1;
904 unsigned EPOUTEN : 1;
905 unsigned EPCONDIS : 1;
906 unsigned EPHSHK : 1;
907 unsigned : 1;
908 unsigned : 1;
909 unsigned : 1;
910 } __UEP10bits_t;
912 extern __at(0x0F74) volatile __UEP10bits_t UEP10bits;
914 #define _UEP10_EPSTALL 0x01
915 #define _UEP10_EPINEN 0x02
916 #define _UEP10_EPOUTEN 0x04
917 #define _UEP10_EPCONDIS 0x08
918 #define _UEP10_EPHSHK 0x10
920 //==============================================================================
923 //==============================================================================
924 // UEP11 Bits
926 extern __at(0x0F75) __sfr UEP11;
928 typedef struct
930 unsigned EPSTALL : 1;
931 unsigned EPINEN : 1;
932 unsigned EPOUTEN : 1;
933 unsigned EPCONDIS : 1;
934 unsigned EPHSHK : 1;
935 unsigned : 1;
936 unsigned : 1;
937 unsigned : 1;
938 } __UEP11bits_t;
940 extern __at(0x0F75) volatile __UEP11bits_t UEP11bits;
942 #define _UEP11_EPSTALL 0x01
943 #define _UEP11_EPINEN 0x02
944 #define _UEP11_EPOUTEN 0x04
945 #define _UEP11_EPCONDIS 0x08
946 #define _UEP11_EPHSHK 0x10
948 //==============================================================================
951 //==============================================================================
952 // UEP12 Bits
954 extern __at(0x0F76) __sfr UEP12;
956 typedef struct
958 unsigned EPSTALL : 1;
959 unsigned EPINEN : 1;
960 unsigned EPOUTEN : 1;
961 unsigned EPCONDIS : 1;
962 unsigned EPHSHK : 1;
963 unsigned : 1;
964 unsigned : 1;
965 unsigned : 1;
966 } __UEP12bits_t;
968 extern __at(0x0F76) volatile __UEP12bits_t UEP12bits;
970 #define _UEP12_EPSTALL 0x01
971 #define _UEP12_EPINEN 0x02
972 #define _UEP12_EPOUTEN 0x04
973 #define _UEP12_EPCONDIS 0x08
974 #define _UEP12_EPHSHK 0x10
976 //==============================================================================
979 //==============================================================================
980 // UEP13 Bits
982 extern __at(0x0F77) __sfr UEP13;
984 typedef struct
986 unsigned EPSTALL : 1;
987 unsigned EPINEN : 1;
988 unsigned EPOUTEN : 1;
989 unsigned EPCONDIS : 1;
990 unsigned EPHSHK : 1;
991 unsigned : 1;
992 unsigned : 1;
993 unsigned : 1;
994 } __UEP13bits_t;
996 extern __at(0x0F77) volatile __UEP13bits_t UEP13bits;
998 #define _UEP13_EPSTALL 0x01
999 #define _UEP13_EPINEN 0x02
1000 #define _UEP13_EPOUTEN 0x04
1001 #define _UEP13_EPCONDIS 0x08
1002 #define _UEP13_EPHSHK 0x10
1004 //==============================================================================
1007 //==============================================================================
1008 // UEP14 Bits
1010 extern __at(0x0F78) __sfr UEP14;
1012 typedef struct
1014 unsigned EPSTALL : 1;
1015 unsigned EPINEN : 1;
1016 unsigned EPOUTEN : 1;
1017 unsigned EPCONDIS : 1;
1018 unsigned EPHSHK : 1;
1019 unsigned : 1;
1020 unsigned : 1;
1021 unsigned : 1;
1022 } __UEP14bits_t;
1024 extern __at(0x0F78) volatile __UEP14bits_t UEP14bits;
1026 #define _UEP14_EPSTALL 0x01
1027 #define _UEP14_EPINEN 0x02
1028 #define _UEP14_EPOUTEN 0x04
1029 #define _UEP14_EPCONDIS 0x08
1030 #define _UEP14_EPHSHK 0x10
1032 //==============================================================================
1035 //==============================================================================
1036 // UEP15 Bits
1038 extern __at(0x0F79) __sfr UEP15;
1040 typedef struct
1042 unsigned EPSTALL : 1;
1043 unsigned EPINEN : 1;
1044 unsigned EPOUTEN : 1;
1045 unsigned EPCONDIS : 1;
1046 unsigned EPHSHK : 1;
1047 unsigned : 1;
1048 unsigned : 1;
1049 unsigned : 1;
1050 } __UEP15bits_t;
1052 extern __at(0x0F79) volatile __UEP15bits_t UEP15bits;
1054 #define _UEP15_EPSTALL 0x01
1055 #define _UEP15_EPINEN 0x02
1056 #define _UEP15_EPOUTEN 0x04
1057 #define _UEP15_EPCONDIS 0x08
1058 #define _UEP15_EPHSHK 0x10
1060 //==============================================================================
1063 //==============================================================================
1064 // SLRCON Bits
1066 extern __at(0x0F7A) __sfr SLRCON;
1068 typedef struct
1070 unsigned SLRA : 1;
1071 unsigned SLRB : 1;
1072 unsigned SLRC : 1;
1073 unsigned SLRD : 1;
1074 unsigned SLRE : 1;
1075 unsigned : 1;
1076 unsigned : 1;
1077 unsigned : 1;
1078 } __SLRCONbits_t;
1080 extern __at(0x0F7A) volatile __SLRCONbits_t SLRCONbits;
1082 #define _SLRA 0x01
1083 #define _SLRB 0x02
1084 #define _SLRC 0x04
1085 #define _SLRD 0x08
1086 #define _SLRE 0x10
1088 //==============================================================================
1091 //==============================================================================
1092 // VREFCON2 Bits
1094 extern __at(0x0F7B) __sfr VREFCON2;
1096 typedef union
1098 struct
1100 unsigned DACR0 : 1;
1101 unsigned DACR1 : 1;
1102 unsigned DACR2 : 1;
1103 unsigned DACR3 : 1;
1104 unsigned DACR4 : 1;
1105 unsigned : 1;
1106 unsigned : 1;
1107 unsigned : 1;
1110 struct
1112 unsigned DACR : 5;
1113 unsigned : 3;
1115 } __VREFCON2bits_t;
1117 extern __at(0x0F7B) volatile __VREFCON2bits_t VREFCON2bits;
1119 #define _DACR0 0x01
1120 #define _DACR1 0x02
1121 #define _DACR2 0x04
1122 #define _DACR3 0x08
1123 #define _DACR4 0x10
1125 //==============================================================================
1128 //==============================================================================
1129 // VREFCON1 Bits
1131 extern __at(0x0F7C) __sfr VREFCON1;
1133 typedef union
1135 struct
1137 unsigned DACNSS : 1;
1138 unsigned : 1;
1139 unsigned DACPSS0 : 1;
1140 unsigned DACPSS1 : 1;
1141 unsigned : 1;
1142 unsigned DACOE : 1;
1143 unsigned DACLPS : 1;
1144 unsigned DACEN : 1;
1147 struct
1149 unsigned : 2;
1150 unsigned DACPSS : 2;
1151 unsigned : 4;
1153 } __VREFCON1bits_t;
1155 extern __at(0x0F7C) volatile __VREFCON1bits_t VREFCON1bits;
1157 #define _DACNSS 0x01
1158 #define _DACPSS0 0x04
1159 #define _DACPSS1 0x08
1160 #define _DACOE 0x20
1161 #define _DACLPS 0x40
1162 #define _DACEN 0x80
1164 //==============================================================================
1167 //==============================================================================
1168 // VREFCON0 Bits
1170 extern __at(0x0F7D) __sfr VREFCON0;
1172 typedef union
1174 struct
1176 unsigned : 1;
1177 unsigned : 1;
1178 unsigned TSRNG : 1;
1179 unsigned TSEN : 1;
1180 unsigned FVRS0 : 1;
1181 unsigned FVRS1 : 1;
1182 unsigned FVRST : 1;
1183 unsigned FVREN : 1;
1186 struct
1188 unsigned : 4;
1189 unsigned FVRS : 2;
1190 unsigned : 2;
1192 } __VREFCON0bits_t;
1194 extern __at(0x0F7D) volatile __VREFCON0bits_t VREFCON0bits;
1196 #define _TSRNG 0x04
1197 #define _TSEN 0x08
1198 #define _FVRS0 0x10
1199 #define _FVRS1 0x20
1200 #define _FVRST 0x40
1201 #define _FVREN 0x80
1203 //==============================================================================
1206 //==============================================================================
1207 // PMD0 Bits
1209 extern __at(0x0F7E) __sfr PMD0;
1211 typedef union
1213 struct
1215 unsigned TMR1MD : 1;
1216 unsigned TMR2MD : 1;
1217 unsigned TMR3MD : 1;
1218 unsigned : 1;
1219 unsigned ACTMD : 1;
1220 unsigned USBMD : 1;
1221 unsigned UARTMD : 1;
1222 unsigned : 1;
1225 struct
1227 unsigned : 1;
1228 unsigned : 1;
1229 unsigned : 1;
1230 unsigned : 1;
1231 unsigned STMD : 1;
1232 unsigned : 1;
1233 unsigned UART1MD : 1;
1234 unsigned : 1;
1236 } __PMD0bits_t;
1238 extern __at(0x0F7E) volatile __PMD0bits_t PMD0bits;
1240 #define _TMR1MD 0x01
1241 #define _TMR2MD 0x02
1242 #define _TMR3MD 0x04
1243 #define _ACTMD 0x10
1244 #define _STMD 0x10
1245 #define _USBMD 0x20
1246 #define _UARTMD 0x40
1247 #define _UART1MD 0x40
1249 //==============================================================================
1252 //==============================================================================
1253 // PMD1 Bits
1255 extern __at(0x0F7F) __sfr PMD1;
1257 typedef union
1259 struct
1261 unsigned CCP1MD : 1;
1262 unsigned CCP2MD : 1;
1263 unsigned ADCMD : 1;
1264 unsigned CMP1MD : 1;
1265 unsigned CMP2MD : 1;
1266 unsigned CTMUMD : 1;
1267 unsigned MSSPMD : 1;
1268 unsigned : 1;
1271 struct
1273 unsigned : 1;
1274 unsigned : 1;
1275 unsigned : 1;
1276 unsigned : 1;
1277 unsigned : 1;
1278 unsigned : 1;
1279 unsigned SSP1MD : 1;
1280 unsigned : 1;
1283 struct
1285 unsigned : 1;
1286 unsigned : 1;
1287 unsigned : 1;
1288 unsigned : 1;
1289 unsigned : 1;
1290 unsigned : 1;
1291 unsigned MSSP1MD : 1;
1292 unsigned : 1;
1294 } __PMD1bits_t;
1296 extern __at(0x0F7F) volatile __PMD1bits_t PMD1bits;
1298 #define _CCP1MD 0x01
1299 #define _CCP2MD 0x02
1300 #define _ADCMD 0x04
1301 #define _CMP1MD 0x08
1302 #define _CMP2MD 0x10
1303 #define _CTMUMD 0x20
1304 #define _MSSPMD 0x40
1305 #define _SSP1MD 0x40
1306 #define _MSSP1MD 0x40
1308 //==============================================================================
1311 //==============================================================================
1312 // PORTA Bits
1314 extern __at(0x0F80) __sfr PORTA;
1316 typedef union
1318 struct
1320 unsigned RA0 : 1;
1321 unsigned RA1 : 1;
1322 unsigned RA2 : 1;
1323 unsigned RA3 : 1;
1324 unsigned RA4 : 1;
1325 unsigned RA5 : 1;
1326 unsigned RA6 : 1;
1327 unsigned RA7 : 1;
1330 struct
1332 unsigned AN0 : 1;
1333 unsigned AN1 : 1;
1334 unsigned AN2 : 1;
1335 unsigned AN3 : 1;
1336 unsigned T0CKI : 1;
1337 unsigned AN4 : 1;
1338 unsigned OSC2 : 1;
1339 unsigned : 1;
1342 struct
1344 unsigned : 1;
1345 unsigned : 1;
1346 unsigned VREFM : 1;
1347 unsigned VREFP : 1;
1348 unsigned : 1;
1349 unsigned LVDIN : 1;
1350 unsigned : 1;
1351 unsigned : 1;
1354 struct
1356 unsigned : 1;
1357 unsigned : 1;
1358 unsigned : 1;
1359 unsigned : 1;
1360 unsigned : 1;
1361 unsigned HLVDIN : 1;
1362 unsigned : 1;
1363 unsigned : 1;
1365 } __PORTAbits_t;
1367 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1369 #define _PORTA_RA0 0x01
1370 #define _PORTA_AN0 0x01
1371 #define _PORTA_RA1 0x02
1372 #define _PORTA_AN1 0x02
1373 #define _PORTA_RA2 0x04
1374 #define _PORTA_AN2 0x04
1375 #define _PORTA_VREFM 0x04
1376 #define _PORTA_RA3 0x08
1377 #define _PORTA_AN3 0x08
1378 #define _PORTA_VREFP 0x08
1379 #define _PORTA_RA4 0x10
1380 #define _PORTA_T0CKI 0x10
1381 #define _PORTA_RA5 0x20
1382 #define _PORTA_AN4 0x20
1383 #define _PORTA_LVDIN 0x20
1384 #define _PORTA_HLVDIN 0x20
1385 #define _PORTA_RA6 0x40
1386 #define _PORTA_OSC2 0x40
1387 #define _PORTA_RA7 0x80
1389 //==============================================================================
1392 //==============================================================================
1393 // PORTB Bits
1395 extern __at(0x0F81) __sfr PORTB;
1397 typedef union
1399 struct
1401 unsigned RB0 : 1;
1402 unsigned RB1 : 1;
1403 unsigned RB2 : 1;
1404 unsigned RB3 : 1;
1405 unsigned RB4 : 1;
1406 unsigned RB5 : 1;
1407 unsigned RB6 : 1;
1408 unsigned RB7 : 1;
1411 struct
1413 unsigned INT0 : 1;
1414 unsigned INT1 : 1;
1415 unsigned INT2 : 1;
1416 unsigned : 1;
1417 unsigned : 1;
1418 unsigned PGM : 1;
1419 unsigned PGC : 1;
1420 unsigned PGD : 1;
1423 struct
1425 unsigned INT : 3;
1426 unsigned : 5;
1428 } __PORTBbits_t;
1430 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1432 #define _PORTB_RB0 0x01
1433 #define _PORTB_INT0 0x01
1434 #define _PORTB_RB1 0x02
1435 #define _PORTB_INT1 0x02
1436 #define _PORTB_RB2 0x04
1437 #define _PORTB_INT2 0x04
1438 #define _PORTB_RB3 0x08
1439 #define _PORTB_RB4 0x10
1440 #define _PORTB_RB5 0x20
1441 #define _PORTB_PGM 0x20
1442 #define _PORTB_RB6 0x40
1443 #define _PORTB_PGC 0x40
1444 #define _PORTB_RB7 0x80
1445 #define _PORTB_PGD 0x80
1447 //==============================================================================
1450 //==============================================================================
1451 // PORTC Bits
1453 extern __at(0x0F82) __sfr PORTC;
1455 typedef union
1457 struct
1459 unsigned RC0 : 1;
1460 unsigned RC1 : 1;
1461 unsigned RC2 : 1;
1462 unsigned : 1;
1463 unsigned RC4 : 1;
1464 unsigned RC5 : 1;
1465 unsigned RC6 : 1;
1466 unsigned RC7 : 1;
1469 struct
1471 unsigned T1OSO : 1;
1472 unsigned T1OSI : 1;
1473 unsigned CCP1 : 1;
1474 unsigned : 1;
1475 unsigned : 1;
1476 unsigned : 1;
1477 unsigned TX : 1;
1478 unsigned RX : 1;
1481 struct
1483 unsigned T13CKI : 1;
1484 unsigned : 1;
1485 unsigned P1A : 1;
1486 unsigned : 1;
1487 unsigned : 1;
1488 unsigned : 1;
1489 unsigned CK : 1;
1490 unsigned : 1;
1492 } __PORTCbits_t;
1494 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1496 #define _PORTC_RC0 0x01
1497 #define _PORTC_T1OSO 0x01
1498 #define _PORTC_T13CKI 0x01
1499 #define _PORTC_RC1 0x02
1500 #define _PORTC_T1OSI 0x02
1501 #define _PORTC_RC2 0x04
1502 #define _PORTC_CCP1 0x04
1503 #define _PORTC_P1A 0x04
1504 #define _PORTC_RC4 0x10
1505 #define _PORTC_RC5 0x20
1506 #define _PORTC_RC6 0x40
1507 #define _PORTC_TX 0x40
1508 #define _PORTC_CK 0x40
1509 #define _PORTC_RC7 0x80
1510 #define _PORTC_RX 0x80
1512 //==============================================================================
1515 //==============================================================================
1516 // PORTD Bits
1518 extern __at(0x0F83) __sfr PORTD;
1520 typedef union
1522 struct
1524 unsigned RD0 : 1;
1525 unsigned RD1 : 1;
1526 unsigned RD2 : 1;
1527 unsigned RD3 : 1;
1528 unsigned RD4 : 1;
1529 unsigned RD5 : 1;
1530 unsigned RD6 : 1;
1531 unsigned RD7 : 1;
1534 struct
1536 unsigned SPP0 : 1;
1537 unsigned SPP1 : 1;
1538 unsigned SPP2 : 1;
1539 unsigned SPP3 : 1;
1540 unsigned SPP4 : 1;
1541 unsigned SPP5 : 1;
1542 unsigned SPP6 : 1;
1543 unsigned SPP7 : 1;
1545 } __PORTDbits_t;
1547 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1549 #define _PORTD_RD0 0x01
1550 #define _PORTD_SPP0 0x01
1551 #define _PORTD_RD1 0x02
1552 #define _PORTD_SPP1 0x02
1553 #define _PORTD_RD2 0x04
1554 #define _PORTD_SPP2 0x04
1555 #define _PORTD_RD3 0x08
1556 #define _PORTD_SPP3 0x08
1557 #define _PORTD_RD4 0x10
1558 #define _PORTD_SPP4 0x10
1559 #define _PORTD_RD5 0x20
1560 #define _PORTD_SPP5 0x20
1561 #define _PORTD_RD6 0x40
1562 #define _PORTD_SPP6 0x40
1563 #define _PORTD_RD7 0x80
1564 #define _PORTD_SPP7 0x80
1566 //==============================================================================
1569 //==============================================================================
1570 // PORTE Bits
1572 extern __at(0x0F84) __sfr PORTE;
1574 typedef union
1576 struct
1578 unsigned RE0 : 1;
1579 unsigned RE1 : 1;
1580 unsigned RE2 : 1;
1581 unsigned RE3 : 1;
1582 unsigned : 1;
1583 unsigned : 1;
1584 unsigned : 1;
1585 unsigned : 1;
1588 struct
1590 unsigned CK1SPP : 1;
1591 unsigned CK2SPP : 1;
1592 unsigned OESPP : 1;
1593 unsigned : 1;
1594 unsigned : 1;
1595 unsigned : 1;
1596 unsigned : 1;
1597 unsigned : 1;
1600 struct
1602 unsigned RE : 4;
1603 unsigned : 4;
1605 } __PORTEbits_t;
1607 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1609 #define _PORTE_RE0 0x01
1610 #define _PORTE_CK1SPP 0x01
1611 #define _PORTE_RE1 0x02
1612 #define _PORTE_CK2SPP 0x02
1613 #define _PORTE_RE2 0x04
1614 #define _PORTE_OESPP 0x04
1615 #define _PORTE_RE3 0x08
1617 //==============================================================================
1620 //==============================================================================
1621 // WPUB Bits
1623 extern __at(0x0F85) __sfr WPUB;
1625 typedef struct
1627 unsigned WPUB0 : 1;
1628 unsigned WPUB1 : 1;
1629 unsigned WPUB2 : 1;
1630 unsigned WPUB3 : 1;
1631 unsigned WPUB4 : 1;
1632 unsigned WPUB5 : 1;
1633 unsigned WPUB6 : 1;
1634 unsigned WPUB7 : 1;
1635 } __WPUBbits_t;
1637 extern __at(0x0F85) volatile __WPUBbits_t WPUBbits;
1639 #define _WPUB0 0x01
1640 #define _WPUB1 0x02
1641 #define _WPUB2 0x04
1642 #define _WPUB3 0x08
1643 #define _WPUB4 0x10
1644 #define _WPUB5 0x20
1645 #define _WPUB6 0x40
1646 #define _WPUB7 0x80
1648 //==============================================================================
1651 //==============================================================================
1652 // IOCB Bits
1654 extern __at(0x0F86) __sfr IOCB;
1656 typedef struct
1658 unsigned : 1;
1659 unsigned : 1;
1660 unsigned : 1;
1661 unsigned : 1;
1662 unsigned IOCB4 : 1;
1663 unsigned IOCB5 : 1;
1664 unsigned IOCB6 : 1;
1665 unsigned IOCB7 : 1;
1666 } __IOCBbits_t;
1668 extern __at(0x0F86) volatile __IOCBbits_t IOCBbits;
1670 #define _IOCB4 0x10
1671 #define _IOCB5 0x20
1672 #define _IOCB6 0x40
1673 #define _IOCB7 0x80
1675 //==============================================================================
1678 //==============================================================================
1679 // IOCC Bits
1681 extern __at(0x0F87) __sfr IOCC;
1683 typedef struct
1685 unsigned IOCC0 : 1;
1686 unsigned IOCC1 : 1;
1687 unsigned IOCC2 : 1;
1688 unsigned : 1;
1689 unsigned IOCC4 : 1;
1690 unsigned IOCC5 : 1;
1691 unsigned IOCC6 : 1;
1692 unsigned IOCC7 : 1;
1693 } __IOCCbits_t;
1695 extern __at(0x0F87) volatile __IOCCbits_t IOCCbits;
1697 #define _IOCC0 0x01
1698 #define _IOCC1 0x02
1699 #define _IOCC2 0x04
1700 #define _IOCC4 0x10
1701 #define _IOCC5 0x20
1702 #define _IOCC6 0x40
1703 #define _IOCC7 0x80
1705 //==============================================================================
1708 //==============================================================================
1709 // CTMUICON Bits
1711 extern __at(0x0F88) __sfr CTMUICON;
1713 typedef union
1715 struct
1717 unsigned IRNG0 : 1;
1718 unsigned IRNG1 : 1;
1719 unsigned ITRIM0 : 1;
1720 unsigned ITRIM1 : 1;
1721 unsigned ITRIM2 : 1;
1722 unsigned ITRIM3 : 1;
1723 unsigned ITRIM4 : 1;
1724 unsigned ITRIM5 : 1;
1727 struct
1729 unsigned IRNG : 2;
1730 unsigned : 6;
1733 struct
1735 unsigned : 2;
1736 unsigned ITRIM : 6;
1738 } __CTMUICONbits_t;
1740 extern __at(0x0F88) volatile __CTMUICONbits_t CTMUICONbits;
1742 #define _IRNG0 0x01
1743 #define _IRNG1 0x02
1744 #define _ITRIM0 0x04
1745 #define _ITRIM1 0x08
1746 #define _ITRIM2 0x10
1747 #define _ITRIM3 0x20
1748 #define _ITRIM4 0x40
1749 #define _ITRIM5 0x80
1751 //==============================================================================
1754 //==============================================================================
1755 // LATA Bits
1757 extern __at(0x0F89) __sfr LATA;
1759 typedef struct
1761 unsigned LATA0 : 1;
1762 unsigned LATA1 : 1;
1763 unsigned LATA2 : 1;
1764 unsigned LATA3 : 1;
1765 unsigned LATA4 : 1;
1766 unsigned LATA5 : 1;
1767 unsigned LATA6 : 1;
1768 unsigned LATA7 : 1;
1769 } __LATAbits_t;
1771 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1773 #define _LATA0 0x01
1774 #define _LATA1 0x02
1775 #define _LATA2 0x04
1776 #define _LATA3 0x08
1777 #define _LATA4 0x10
1778 #define _LATA5 0x20
1779 #define _LATA6 0x40
1780 #define _LATA7 0x80
1782 //==============================================================================
1785 //==============================================================================
1786 // LATB Bits
1788 extern __at(0x0F8A) __sfr LATB;
1790 typedef struct
1792 unsigned LATB0 : 1;
1793 unsigned LATB1 : 1;
1794 unsigned LATB2 : 1;
1795 unsigned LATB3 : 1;
1796 unsigned LATB4 : 1;
1797 unsigned LATB5 : 1;
1798 unsigned LATB6 : 1;
1799 unsigned LATB7 : 1;
1800 } __LATBbits_t;
1802 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1804 #define _LATB0 0x01
1805 #define _LATB1 0x02
1806 #define _LATB2 0x04
1807 #define _LATB3 0x08
1808 #define _LATB4 0x10
1809 #define _LATB5 0x20
1810 #define _LATB6 0x40
1811 #define _LATB7 0x80
1813 //==============================================================================
1816 //==============================================================================
1817 // LATC Bits
1819 extern __at(0x0F8B) __sfr LATC;
1821 typedef struct
1823 unsigned LATC0 : 1;
1824 unsigned LATC1 : 1;
1825 unsigned LATC2 : 1;
1826 unsigned : 1;
1827 unsigned LATC4 : 1;
1828 unsigned LATC5 : 1;
1829 unsigned LATC6 : 1;
1830 unsigned LATC7 : 1;
1831 } __LATCbits_t;
1833 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1835 #define _LATC0 0x01
1836 #define _LATC1 0x02
1837 #define _LATC2 0x04
1838 #define _LATC4 0x10
1839 #define _LATC5 0x20
1840 #define _LATC6 0x40
1841 #define _LATC7 0x80
1843 //==============================================================================
1846 //==============================================================================
1847 // LATD Bits
1849 extern __at(0x0F8C) __sfr LATD;
1851 typedef struct
1853 unsigned LATD0 : 1;
1854 unsigned LATD1 : 1;
1855 unsigned LATD2 : 1;
1856 unsigned LATD3 : 1;
1857 unsigned LATD4 : 1;
1858 unsigned LATD5 : 1;
1859 unsigned LATD6 : 1;
1860 unsigned LATD7 : 1;
1861 } __LATDbits_t;
1863 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1865 #define _LATD0 0x01
1866 #define _LATD1 0x02
1867 #define _LATD2 0x04
1868 #define _LATD3 0x08
1869 #define _LATD4 0x10
1870 #define _LATD5 0x20
1871 #define _LATD6 0x40
1872 #define _LATD7 0x80
1874 //==============================================================================
1877 //==============================================================================
1878 // LATE Bits
1880 extern __at(0x0F8D) __sfr LATE;
1882 typedef union
1884 struct
1886 unsigned LATE0 : 1;
1887 unsigned LATE1 : 1;
1888 unsigned LATE2 : 1;
1889 unsigned : 1;
1890 unsigned : 1;
1891 unsigned : 1;
1892 unsigned : 1;
1893 unsigned : 1;
1896 struct
1898 unsigned LATE : 3;
1899 unsigned : 5;
1901 } __LATEbits_t;
1903 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1905 #define _LATE0 0x01
1906 #define _LATE1 0x02
1907 #define _LATE2 0x04
1909 //==============================================================================
1912 //==============================================================================
1913 // CTMUCON1 Bits
1915 extern __at(0x0F8E) __sfr CTMUCON1;
1917 typedef union
1919 struct
1921 unsigned EDG1STAT : 1;
1922 unsigned EDG2STAT : 1;
1923 unsigned EDG1SEL0 : 1;
1924 unsigned EDG1SEL1 : 1;
1925 unsigned EDG1POL : 1;
1926 unsigned EDG2SEL0 : 1;
1927 unsigned EDG2SEL1 : 1;
1928 unsigned EDG2POL : 1;
1931 struct
1933 unsigned : 2;
1934 unsigned EDG1SEL : 2;
1935 unsigned : 4;
1938 struct
1940 unsigned : 5;
1941 unsigned EDG2SEL : 2;
1942 unsigned : 1;
1944 } __CTMUCON1bits_t;
1946 extern __at(0x0F8E) volatile __CTMUCON1bits_t CTMUCON1bits;
1948 #define _EDG1STAT 0x01
1949 #define _EDG2STAT 0x02
1950 #define _EDG1SEL0 0x04
1951 #define _EDG1SEL1 0x08
1952 #define _EDG1POL 0x10
1953 #define _EDG2SEL0 0x20
1954 #define _EDG2SEL1 0x40
1955 #define _EDG2POL 0x80
1957 //==============================================================================
1960 //==============================================================================
1961 // CTMUCONL Bits
1963 extern __at(0x0F8E) __sfr CTMUCONL;
1965 typedef union
1967 struct
1969 unsigned EDG1STAT : 1;
1970 unsigned EDG2STAT : 1;
1971 unsigned EDG1SEL0 : 1;
1972 unsigned EDG1SEL1 : 1;
1973 unsigned EDG1POL : 1;
1974 unsigned EDG2SEL0 : 1;
1975 unsigned EDG2SEL1 : 1;
1976 unsigned EDG2POL : 1;
1979 struct
1981 unsigned : 2;
1982 unsigned EDG1SEL : 2;
1983 unsigned : 4;
1986 struct
1988 unsigned : 5;
1989 unsigned EDG2SEL : 2;
1990 unsigned : 1;
1992 } __CTMUCONLbits_t;
1994 extern __at(0x0F8E) volatile __CTMUCONLbits_t CTMUCONLbits;
1996 #define _CTMUCONL_EDG1STAT 0x01
1997 #define _CTMUCONL_EDG2STAT 0x02
1998 #define _CTMUCONL_EDG1SEL0 0x04
1999 #define _CTMUCONL_EDG1SEL1 0x08
2000 #define _CTMUCONL_EDG1POL 0x10
2001 #define _CTMUCONL_EDG2SEL0 0x20
2002 #define _CTMUCONL_EDG2SEL1 0x40
2003 #define _CTMUCONL_EDG2POL 0x80
2005 //==============================================================================
2008 //==============================================================================
2009 // CTMUCON0 Bits
2011 extern __at(0x0F8F) __sfr CTMUCON0;
2013 typedef union
2015 struct
2017 unsigned CTTRIG : 1;
2018 unsigned IDISSEN : 1;
2019 unsigned EDGSEQEN : 1;
2020 unsigned EDGEN : 1;
2021 unsigned TGEN : 1;
2022 unsigned CTMUSIDL : 1;
2023 unsigned : 1;
2024 unsigned CTMUEN : 1;
2027 struct
2029 unsigned TRIGEN : 1;
2030 unsigned : 1;
2031 unsigned : 1;
2032 unsigned : 1;
2033 unsigned : 1;
2034 unsigned SIDL : 1;
2035 unsigned : 1;
2036 unsigned ON : 1;
2038 } __CTMUCON0bits_t;
2040 extern __at(0x0F8F) volatile __CTMUCON0bits_t CTMUCON0bits;
2042 #define _CTTRIG 0x01
2043 #define _TRIGEN 0x01
2044 #define _IDISSEN 0x02
2045 #define _EDGSEQEN 0x04
2046 #define _EDGEN 0x08
2047 #define _TGEN 0x10
2048 #define _CTMUSIDL 0x20
2049 #define _SIDL 0x20
2050 #define _CTMUEN 0x80
2051 #define _ON 0x80
2053 //==============================================================================
2056 //==============================================================================
2057 // CTMUCONH Bits
2059 extern __at(0x0F8F) __sfr CTMUCONH;
2061 typedef union
2063 struct
2065 unsigned CTTRIG : 1;
2066 unsigned IDISSEN : 1;
2067 unsigned EDGSEQEN : 1;
2068 unsigned EDGEN : 1;
2069 unsigned TGEN : 1;
2070 unsigned CTMUSIDL : 1;
2071 unsigned : 1;
2072 unsigned CTMUEN : 1;
2075 struct
2077 unsigned TRIGEN : 1;
2078 unsigned : 1;
2079 unsigned : 1;
2080 unsigned : 1;
2081 unsigned : 1;
2082 unsigned SIDL : 1;
2083 unsigned : 1;
2084 unsigned ON : 1;
2086 } __CTMUCONHbits_t;
2088 extern __at(0x0F8F) volatile __CTMUCONHbits_t CTMUCONHbits;
2090 #define _CTMUCONH_CTTRIG 0x01
2091 #define _CTMUCONH_TRIGEN 0x01
2092 #define _CTMUCONH_IDISSEN 0x02
2093 #define _CTMUCONH_EDGSEQEN 0x04
2094 #define _CTMUCONH_EDGEN 0x08
2095 #define _CTMUCONH_TGEN 0x10
2096 #define _CTMUCONH_CTMUSIDL 0x20
2097 #define _CTMUCONH_SIDL 0x20
2098 #define _CTMUCONH_CTMUEN 0x80
2099 #define _CTMUCONH_ON 0x80
2101 //==============================================================================
2103 extern __at(0x0F90) __sfr CCPR2;
2104 extern __at(0x0F90) __sfr CCPR2L;
2105 extern __at(0x0F91) __sfr CCPR2H;
2107 //==============================================================================
2108 // DDRA Bits
2110 extern __at(0x0F92) __sfr DDRA;
2112 typedef union
2114 struct
2116 unsigned TRISA0 : 1;
2117 unsigned TRISA1 : 1;
2118 unsigned TRISA2 : 1;
2119 unsigned TRISA3 : 1;
2120 unsigned TRISA4 : 1;
2121 unsigned TRISA5 : 1;
2122 unsigned TRISA6 : 1;
2123 unsigned TRISA7 : 1;
2126 struct
2128 unsigned RA0 : 1;
2129 unsigned RA1 : 1;
2130 unsigned RA2 : 1;
2131 unsigned RA3 : 1;
2132 unsigned RA4 : 1;
2133 unsigned RA5 : 1;
2134 unsigned RA6 : 1;
2135 unsigned RA7 : 1;
2137 } __DDRAbits_t;
2139 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2141 #define _TRISA0 0x01
2142 #define _RA0 0x01
2143 #define _TRISA1 0x02
2144 #define _RA1 0x02
2145 #define _TRISA2 0x04
2146 #define _RA2 0x04
2147 #define _TRISA3 0x08
2148 #define _RA3 0x08
2149 #define _TRISA4 0x10
2150 #define _RA4 0x10
2151 #define _TRISA5 0x20
2152 #define _RA5 0x20
2153 #define _TRISA6 0x40
2154 #define _RA6 0x40
2155 #define _TRISA7 0x80
2156 #define _RA7 0x80
2158 //==============================================================================
2161 //==============================================================================
2162 // TRISA Bits
2164 extern __at(0x0F92) __sfr TRISA;
2166 typedef union
2168 struct
2170 unsigned TRISA0 : 1;
2171 unsigned TRISA1 : 1;
2172 unsigned TRISA2 : 1;
2173 unsigned TRISA3 : 1;
2174 unsigned TRISA4 : 1;
2175 unsigned TRISA5 : 1;
2176 unsigned TRISA6 : 1;
2177 unsigned TRISA7 : 1;
2180 struct
2182 unsigned RA0 : 1;
2183 unsigned RA1 : 1;
2184 unsigned RA2 : 1;
2185 unsigned RA3 : 1;
2186 unsigned RA4 : 1;
2187 unsigned RA5 : 1;
2188 unsigned RA6 : 1;
2189 unsigned RA7 : 1;
2191 } __TRISAbits_t;
2193 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2195 #define _TRISA_TRISA0 0x01
2196 #define _TRISA_RA0 0x01
2197 #define _TRISA_TRISA1 0x02
2198 #define _TRISA_RA1 0x02
2199 #define _TRISA_TRISA2 0x04
2200 #define _TRISA_RA2 0x04
2201 #define _TRISA_TRISA3 0x08
2202 #define _TRISA_RA3 0x08
2203 #define _TRISA_TRISA4 0x10
2204 #define _TRISA_RA4 0x10
2205 #define _TRISA_TRISA5 0x20
2206 #define _TRISA_RA5 0x20
2207 #define _TRISA_TRISA6 0x40
2208 #define _TRISA_RA6 0x40
2209 #define _TRISA_TRISA7 0x80
2210 #define _TRISA_RA7 0x80
2212 //==============================================================================
2215 //==============================================================================
2216 // DDRB Bits
2218 extern __at(0x0F93) __sfr DDRB;
2220 typedef union
2222 struct
2224 unsigned TRISB0 : 1;
2225 unsigned TRISB1 : 1;
2226 unsigned TRISB2 : 1;
2227 unsigned TRISB3 : 1;
2228 unsigned TRISB4 : 1;
2229 unsigned TRISB5 : 1;
2230 unsigned TRISB6 : 1;
2231 unsigned TRISB7 : 1;
2234 struct
2236 unsigned RB0 : 1;
2237 unsigned RB1 : 1;
2238 unsigned RB2 : 1;
2239 unsigned RB3 : 1;
2240 unsigned RB4 : 1;
2241 unsigned RB5 : 1;
2242 unsigned RB6 : 1;
2243 unsigned RB7 : 1;
2245 } __DDRBbits_t;
2247 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2249 #define _TRISB0 0x01
2250 #define _RB0 0x01
2251 #define _TRISB1 0x02
2252 #define _RB1 0x02
2253 #define _TRISB2 0x04
2254 #define _RB2 0x04
2255 #define _TRISB3 0x08
2256 #define _RB3 0x08
2257 #define _TRISB4 0x10
2258 #define _RB4 0x10
2259 #define _TRISB5 0x20
2260 #define _RB5 0x20
2261 #define _TRISB6 0x40
2262 #define _RB6 0x40
2263 #define _TRISB7 0x80
2264 #define _RB7 0x80
2266 //==============================================================================
2269 //==============================================================================
2270 // TRISB Bits
2272 extern __at(0x0F93) __sfr TRISB;
2274 typedef union
2276 struct
2278 unsigned TRISB0 : 1;
2279 unsigned TRISB1 : 1;
2280 unsigned TRISB2 : 1;
2281 unsigned TRISB3 : 1;
2282 unsigned TRISB4 : 1;
2283 unsigned TRISB5 : 1;
2284 unsigned TRISB6 : 1;
2285 unsigned TRISB7 : 1;
2288 struct
2290 unsigned RB0 : 1;
2291 unsigned RB1 : 1;
2292 unsigned RB2 : 1;
2293 unsigned RB3 : 1;
2294 unsigned RB4 : 1;
2295 unsigned RB5 : 1;
2296 unsigned RB6 : 1;
2297 unsigned RB7 : 1;
2299 } __TRISBbits_t;
2301 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2303 #define _TRISB_TRISB0 0x01
2304 #define _TRISB_RB0 0x01
2305 #define _TRISB_TRISB1 0x02
2306 #define _TRISB_RB1 0x02
2307 #define _TRISB_TRISB2 0x04
2308 #define _TRISB_RB2 0x04
2309 #define _TRISB_TRISB3 0x08
2310 #define _TRISB_RB3 0x08
2311 #define _TRISB_TRISB4 0x10
2312 #define _TRISB_RB4 0x10
2313 #define _TRISB_TRISB5 0x20
2314 #define _TRISB_RB5 0x20
2315 #define _TRISB_TRISB6 0x40
2316 #define _TRISB_RB6 0x40
2317 #define _TRISB_TRISB7 0x80
2318 #define _TRISB_RB7 0x80
2320 //==============================================================================
2323 //==============================================================================
2324 // DDRC Bits
2326 extern __at(0x0F94) __sfr DDRC;
2328 typedef union
2330 struct
2332 unsigned TRISC0 : 1;
2333 unsigned TRISC1 : 1;
2334 unsigned TRISC2 : 1;
2335 unsigned : 1;
2336 unsigned TRISC4 : 1;
2337 unsigned TRISC5 : 1;
2338 unsigned TRISC6 : 1;
2339 unsigned TRISC7 : 1;
2342 struct
2344 unsigned RC0 : 1;
2345 unsigned RC1 : 1;
2346 unsigned RC2 : 1;
2347 unsigned : 1;
2348 unsigned : 1;
2349 unsigned : 1;
2350 unsigned RC6 : 1;
2351 unsigned RC7 : 1;
2353 } __DDRCbits_t;
2355 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2357 #define _TRISC0 0x01
2358 #define _RC0 0x01
2359 #define _TRISC1 0x02
2360 #define _RC1 0x02
2361 #define _TRISC2 0x04
2362 #define _RC2 0x04
2363 #define _TRISC4 0x10
2364 #define _TRISC5 0x20
2365 #define _TRISC6 0x40
2366 #define _RC6 0x40
2367 #define _TRISC7 0x80
2368 #define _RC7 0x80
2370 //==============================================================================
2373 //==============================================================================
2374 // TRISC Bits
2376 extern __at(0x0F94) __sfr TRISC;
2378 typedef union
2380 struct
2382 unsigned TRISC0 : 1;
2383 unsigned TRISC1 : 1;
2384 unsigned TRISC2 : 1;
2385 unsigned : 1;
2386 unsigned TRISC4 : 1;
2387 unsigned TRISC5 : 1;
2388 unsigned TRISC6 : 1;
2389 unsigned TRISC7 : 1;
2392 struct
2394 unsigned RC0 : 1;
2395 unsigned RC1 : 1;
2396 unsigned RC2 : 1;
2397 unsigned : 1;
2398 unsigned : 1;
2399 unsigned : 1;
2400 unsigned RC6 : 1;
2401 unsigned RC7 : 1;
2403 } __TRISCbits_t;
2405 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2407 #define _TRISC_TRISC0 0x01
2408 #define _TRISC_RC0 0x01
2409 #define _TRISC_TRISC1 0x02
2410 #define _TRISC_RC1 0x02
2411 #define _TRISC_TRISC2 0x04
2412 #define _TRISC_RC2 0x04
2413 #define _TRISC_TRISC4 0x10
2414 #define _TRISC_TRISC5 0x20
2415 #define _TRISC_TRISC6 0x40
2416 #define _TRISC_RC6 0x40
2417 #define _TRISC_TRISC7 0x80
2418 #define _TRISC_RC7 0x80
2420 //==============================================================================
2423 //==============================================================================
2424 // DDRD Bits
2426 extern __at(0x0F95) __sfr DDRD;
2428 typedef union
2430 struct
2432 unsigned TRISD0 : 1;
2433 unsigned TRISD1 : 1;
2434 unsigned TRISD2 : 1;
2435 unsigned TRISD3 : 1;
2436 unsigned TRISD4 : 1;
2437 unsigned TRISD5 : 1;
2438 unsigned TRISD6 : 1;
2439 unsigned TRISD7 : 1;
2442 struct
2444 unsigned RD0 : 1;
2445 unsigned RD1 : 1;
2446 unsigned RD2 : 1;
2447 unsigned RD3 : 1;
2448 unsigned RD4 : 1;
2449 unsigned RD5 : 1;
2450 unsigned RD6 : 1;
2451 unsigned RD7 : 1;
2453 } __DDRDbits_t;
2455 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2457 #define _TRISD0 0x01
2458 #define _RD0 0x01
2459 #define _TRISD1 0x02
2460 #define _RD1 0x02
2461 #define _TRISD2 0x04
2462 #define _RD2 0x04
2463 #define _TRISD3 0x08
2464 #define _RD3 0x08
2465 #define _TRISD4 0x10
2466 #define _RD4 0x10
2467 #define _TRISD5 0x20
2468 #define _RD5 0x20
2469 #define _TRISD6 0x40
2470 #define _RD6 0x40
2471 #define _TRISD7 0x80
2472 #define _RD7 0x80
2474 //==============================================================================
2477 //==============================================================================
2478 // TRISD Bits
2480 extern __at(0x0F95) __sfr TRISD;
2482 typedef union
2484 struct
2486 unsigned TRISD0 : 1;
2487 unsigned TRISD1 : 1;
2488 unsigned TRISD2 : 1;
2489 unsigned TRISD3 : 1;
2490 unsigned TRISD4 : 1;
2491 unsigned TRISD5 : 1;
2492 unsigned TRISD6 : 1;
2493 unsigned TRISD7 : 1;
2496 struct
2498 unsigned RD0 : 1;
2499 unsigned RD1 : 1;
2500 unsigned RD2 : 1;
2501 unsigned RD3 : 1;
2502 unsigned RD4 : 1;
2503 unsigned RD5 : 1;
2504 unsigned RD6 : 1;
2505 unsigned RD7 : 1;
2507 } __TRISDbits_t;
2509 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2511 #define _TRISD_TRISD0 0x01
2512 #define _TRISD_RD0 0x01
2513 #define _TRISD_TRISD1 0x02
2514 #define _TRISD_RD1 0x02
2515 #define _TRISD_TRISD2 0x04
2516 #define _TRISD_RD2 0x04
2517 #define _TRISD_TRISD3 0x08
2518 #define _TRISD_RD3 0x08
2519 #define _TRISD_TRISD4 0x10
2520 #define _TRISD_RD4 0x10
2521 #define _TRISD_TRISD5 0x20
2522 #define _TRISD_RD5 0x20
2523 #define _TRISD_TRISD6 0x40
2524 #define _TRISD_RD6 0x40
2525 #define _TRISD_TRISD7 0x80
2526 #define _TRISD_RD7 0x80
2528 //==============================================================================
2531 //==============================================================================
2532 // DDRE Bits
2534 extern __at(0x0F96) __sfr DDRE;
2536 typedef union
2538 struct
2540 unsigned TRISE0 : 1;
2541 unsigned TRISE1 : 1;
2542 unsigned TRISE2 : 1;
2543 unsigned : 1;
2544 unsigned : 1;
2545 unsigned : 1;
2546 unsigned : 1;
2547 unsigned WPUE3 : 1;
2550 struct
2552 unsigned RE0 : 1;
2553 unsigned RE1 : 1;
2554 unsigned RE2 : 1;
2555 unsigned : 1;
2556 unsigned : 1;
2557 unsigned : 1;
2558 unsigned : 1;
2559 unsigned : 1;
2562 struct
2564 unsigned RE : 3;
2565 unsigned : 5;
2568 struct
2570 unsigned TRISE : 3;
2571 unsigned : 5;
2573 } __DDREbits_t;
2575 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2577 #define _TRISE0 0x01
2578 #define _RE0 0x01
2579 #define _TRISE1 0x02
2580 #define _RE1 0x02
2581 #define _TRISE2 0x04
2582 #define _RE2 0x04
2583 #define _WPUE3 0x80
2585 //==============================================================================
2588 //==============================================================================
2589 // TRISE Bits
2591 extern __at(0x0F96) __sfr TRISE;
2593 typedef union
2595 struct
2597 unsigned TRISE0 : 1;
2598 unsigned TRISE1 : 1;
2599 unsigned TRISE2 : 1;
2600 unsigned : 1;
2601 unsigned : 1;
2602 unsigned : 1;
2603 unsigned : 1;
2604 unsigned WPUE3 : 1;
2607 struct
2609 unsigned RE0 : 1;
2610 unsigned RE1 : 1;
2611 unsigned RE2 : 1;
2612 unsigned : 1;
2613 unsigned : 1;
2614 unsigned : 1;
2615 unsigned : 1;
2616 unsigned : 1;
2619 struct
2621 unsigned RE : 3;
2622 unsigned : 5;
2625 struct
2627 unsigned TRISE : 3;
2628 unsigned : 5;
2630 } __TRISEbits_t;
2632 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2634 #define _TRISE_TRISE0 0x01
2635 #define _TRISE_RE0 0x01
2636 #define _TRISE_TRISE1 0x02
2637 #define _TRISE_RE1 0x02
2638 #define _TRISE_TRISE2 0x04
2639 #define _TRISE_RE2 0x04
2640 #define _TRISE_WPUE3 0x80
2642 //==============================================================================
2645 //==============================================================================
2646 // CCP2CON Bits
2648 extern __at(0x0F97) __sfr CCP2CON;
2650 typedef union
2652 struct
2654 unsigned CCP2M0 : 1;
2655 unsigned CCP2M1 : 1;
2656 unsigned CCP2M2 : 1;
2657 unsigned CCP2M3 : 1;
2658 unsigned DC2B0 : 1;
2659 unsigned DC2B1 : 1;
2660 unsigned : 1;
2661 unsigned : 1;
2664 struct
2666 unsigned : 1;
2667 unsigned : 1;
2668 unsigned : 1;
2669 unsigned : 1;
2670 unsigned CCP2Y : 1;
2671 unsigned CCP2X : 1;
2672 unsigned : 1;
2673 unsigned : 1;
2676 struct
2678 unsigned CCP2M : 4;
2679 unsigned : 4;
2682 struct
2684 unsigned : 4;
2685 unsigned DC2B : 2;
2686 unsigned : 2;
2688 } __CCP2CONbits_t;
2690 extern __at(0x0F97) volatile __CCP2CONbits_t CCP2CONbits;
2692 #define _CCP2M0 0x01
2693 #define _CCP2M1 0x02
2694 #define _CCP2M2 0x04
2695 #define _CCP2M3 0x08
2696 #define _DC2B0 0x10
2697 #define _CCP2Y 0x10
2698 #define _DC2B1 0x20
2699 #define _CCP2X 0x20
2701 //==============================================================================
2704 //==============================================================================
2705 // ECCP2CON Bits
2707 extern __at(0x0F97) __sfr ECCP2CON;
2709 typedef union
2711 struct
2713 unsigned CCP2M0 : 1;
2714 unsigned CCP2M1 : 1;
2715 unsigned CCP2M2 : 1;
2716 unsigned CCP2M3 : 1;
2717 unsigned DC2B0 : 1;
2718 unsigned DC2B1 : 1;
2719 unsigned : 1;
2720 unsigned : 1;
2723 struct
2725 unsigned : 1;
2726 unsigned : 1;
2727 unsigned : 1;
2728 unsigned : 1;
2729 unsigned CCP2Y : 1;
2730 unsigned CCP2X : 1;
2731 unsigned : 1;
2732 unsigned : 1;
2735 struct
2737 unsigned CCP2M : 4;
2738 unsigned : 4;
2741 struct
2743 unsigned : 4;
2744 unsigned DC2B : 2;
2745 unsigned : 2;
2747 } __ECCP2CONbits_t;
2749 extern __at(0x0F97) volatile __ECCP2CONbits_t ECCP2CONbits;
2751 #define _ECCP2CON_CCP2M0 0x01
2752 #define _ECCP2CON_CCP2M1 0x02
2753 #define _ECCP2CON_CCP2M2 0x04
2754 #define _ECCP2CON_CCP2M3 0x08
2755 #define _ECCP2CON_DC2B0 0x10
2756 #define _ECCP2CON_CCP2Y 0x10
2757 #define _ECCP2CON_DC2B1 0x20
2758 #define _ECCP2CON_CCP2X 0x20
2760 //==============================================================================
2763 //==============================================================================
2764 // CM1CON0 Bits
2766 extern __at(0x0F98) __sfr CM1CON0;
2768 typedef union
2770 struct
2772 unsigned C1CH0 : 1;
2773 unsigned C1CH1 : 1;
2774 unsigned C1R : 1;
2775 unsigned C1SP : 1;
2776 unsigned C1POL : 1;
2777 unsigned C1OE : 1;
2778 unsigned C1OUT : 1;
2779 unsigned C1ON : 1;
2782 struct
2784 unsigned CCH0 : 1;
2785 unsigned CCH1 : 1;
2786 unsigned CREF : 1;
2787 unsigned : 1;
2788 unsigned CPOL : 1;
2789 unsigned COE : 1;
2790 unsigned COUT1 : 1;
2791 unsigned CON : 1;
2794 struct
2796 unsigned C1CH : 2;
2797 unsigned : 6;
2800 struct
2802 unsigned CCH : 2;
2803 unsigned : 6;
2805 } __CM1CON0bits_t;
2807 extern __at(0x0F98) volatile __CM1CON0bits_t CM1CON0bits;
2809 #define _C1CH0 0x01
2810 #define _CCH0 0x01
2811 #define _C1CH1 0x02
2812 #define _CCH1 0x02
2813 #define _C1R 0x04
2814 #define _CREF 0x04
2815 #define _C1SP 0x08
2816 #define _C1POL 0x10
2817 #define _CPOL 0x10
2818 #define _C1OE 0x20
2819 #define _COE 0x20
2820 #define _C1OUT 0x40
2821 #define _COUT1 0x40
2822 #define _C1ON 0x80
2823 #define _CON 0x80
2825 //==============================================================================
2828 //==============================================================================
2829 // CM2CON0 Bits
2831 extern __at(0x0F99) __sfr CM2CON0;
2833 typedef union
2835 struct
2837 unsigned C2CH0 : 1;
2838 unsigned C2CH1 : 1;
2839 unsigned C2R : 1;
2840 unsigned C2SP : 1;
2841 unsigned C2POL : 1;
2842 unsigned C2OE : 1;
2843 unsigned C2OUT : 1;
2844 unsigned C2ON : 1;
2847 struct
2849 unsigned CCH0 : 1;
2850 unsigned CCH1 : 1;
2851 unsigned CREF : 1;
2852 unsigned : 1;
2853 unsigned CPOL : 1;
2854 unsigned COE : 1;
2855 unsigned COUT2 : 1;
2856 unsigned CON : 1;
2859 struct
2861 unsigned C2CH : 2;
2862 unsigned : 6;
2865 struct
2867 unsigned CCH : 2;
2868 unsigned : 6;
2870 } __CM2CON0bits_t;
2872 extern __at(0x0F99) volatile __CM2CON0bits_t CM2CON0bits;
2874 #define _CM2CON0_C2CH0 0x01
2875 #define _CM2CON0_CCH0 0x01
2876 #define _CM2CON0_C2CH1 0x02
2877 #define _CM2CON0_CCH1 0x02
2878 #define _CM2CON0_C2R 0x04
2879 #define _CM2CON0_CREF 0x04
2880 #define _CM2CON0_C2SP 0x08
2881 #define _CM2CON0_C2POL 0x10
2882 #define _CM2CON0_CPOL 0x10
2883 #define _CM2CON0_C2OE 0x20
2884 #define _CM2CON0_COE 0x20
2885 #define _CM2CON0_C2OUT 0x40
2886 #define _CM2CON0_COUT2 0x40
2887 #define _CM2CON0_C2ON 0x80
2888 #define _CM2CON0_CON 0x80
2890 //==============================================================================
2893 //==============================================================================
2894 // CM2CON1 Bits
2896 extern __at(0x0F9A) __sfr CM2CON1;
2898 typedef struct
2900 unsigned C2SYNC : 1;
2901 unsigned C1SYNC : 1;
2902 unsigned C2HYS : 1;
2903 unsigned C1HYS : 1;
2904 unsigned C2RSEL : 1;
2905 unsigned C1RSEL : 1;
2906 unsigned MC2OUT : 1;
2907 unsigned MC1OUT : 1;
2908 } __CM2CON1bits_t;
2910 extern __at(0x0F9A) volatile __CM2CON1bits_t CM2CON1bits;
2912 #define _C2SYNC 0x01
2913 #define _C1SYNC 0x02
2914 #define _C2HYS 0x04
2915 #define _C1HYS 0x08
2916 #define _C2RSEL 0x10
2917 #define _C1RSEL 0x20
2918 #define _MC2OUT 0x40
2919 #define _MC1OUT 0x80
2921 //==============================================================================
2924 //==============================================================================
2925 // OSCTUNE Bits
2927 extern __at(0x0F9B) __sfr OSCTUNE;
2929 typedef union
2931 struct
2933 unsigned TUN0 : 1;
2934 unsigned TUN1 : 1;
2935 unsigned TUN2 : 1;
2936 unsigned TUN3 : 1;
2937 unsigned TUN4 : 1;
2938 unsigned TUN5 : 1;
2939 unsigned TUN6 : 1;
2940 unsigned SPLLMULT : 1;
2943 struct
2945 unsigned TUN : 7;
2946 unsigned : 1;
2948 } __OSCTUNEbits_t;
2950 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2952 #define _TUN0 0x01
2953 #define _TUN1 0x02
2954 #define _TUN2 0x04
2955 #define _TUN3 0x08
2956 #define _TUN4 0x10
2957 #define _TUN5 0x20
2958 #define _TUN6 0x40
2959 #define _SPLLMULT 0x80
2961 //==============================================================================
2964 //==============================================================================
2965 // HLVDCON Bits
2967 extern __at(0x0F9C) __sfr HLVDCON;
2969 typedef union
2971 struct
2973 unsigned HLVDL0 : 1;
2974 unsigned HLVDL1 : 1;
2975 unsigned HLVDL2 : 1;
2976 unsigned HLVDL3 : 1;
2977 unsigned HLVDEN : 1;
2978 unsigned IRVST : 1;
2979 unsigned BGVST : 1;
2980 unsigned VDIRMAG : 1;
2983 struct
2985 unsigned HLVDL : 4;
2986 unsigned : 4;
2988 } __HLVDCONbits_t;
2990 extern __at(0x0F9C) volatile __HLVDCONbits_t HLVDCONbits;
2992 #define _HLVDL0 0x01
2993 #define _HLVDL1 0x02
2994 #define _HLVDL2 0x04
2995 #define _HLVDL3 0x08
2996 #define _HLVDEN 0x10
2997 #define _IRVST 0x20
2998 #define _BGVST 0x40
2999 #define _VDIRMAG 0x80
3001 //==============================================================================
3004 //==============================================================================
3005 // PIE1 Bits
3007 extern __at(0x0F9D) __sfr PIE1;
3009 typedef union
3011 struct
3013 unsigned TMR1IE : 1;
3014 unsigned TMR2IE : 1;
3015 unsigned CCP1IE : 1;
3016 unsigned SSPIE : 1;
3017 unsigned TXIE : 1;
3018 unsigned RCIE : 1;
3019 unsigned ADIE : 1;
3020 unsigned ACTIE : 1;
3023 struct
3025 unsigned : 1;
3026 unsigned : 1;
3027 unsigned : 1;
3028 unsigned SSP1IE : 1;
3029 unsigned TX1IE : 1;
3030 unsigned RC1IE : 1;
3031 unsigned : 1;
3032 unsigned STIE : 1;
3034 } __PIE1bits_t;
3036 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3038 #define _TMR1IE 0x01
3039 #define _TMR2IE 0x02
3040 #define _CCP1IE 0x04
3041 #define _SSPIE 0x08
3042 #define _SSP1IE 0x08
3043 #define _TXIE 0x10
3044 #define _TX1IE 0x10
3045 #define _RCIE 0x20
3046 #define _RC1IE 0x20
3047 #define _ADIE 0x40
3048 #define _ACTIE 0x80
3049 #define _STIE 0x80
3051 //==============================================================================
3054 //==============================================================================
3055 // PIR1 Bits
3057 extern __at(0x0F9E) __sfr PIR1;
3059 typedef union
3061 struct
3063 unsigned TMR1IF : 1;
3064 unsigned TMR2IF : 1;
3065 unsigned CCP1IF : 1;
3066 unsigned SSPIF : 1;
3067 unsigned TXIF : 1;
3068 unsigned RCIF : 1;
3069 unsigned ADIF : 1;
3070 unsigned ACTIF : 1;
3073 struct
3075 unsigned : 1;
3076 unsigned : 1;
3077 unsigned : 1;
3078 unsigned SSP1IF : 1;
3079 unsigned TX1IF : 1;
3080 unsigned RC1IF : 1;
3081 unsigned : 1;
3082 unsigned STIF : 1;
3084 } __PIR1bits_t;
3086 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3088 #define _TMR1IF 0x01
3089 #define _TMR2IF 0x02
3090 #define _CCP1IF 0x04
3091 #define _SSPIF 0x08
3092 #define _SSP1IF 0x08
3093 #define _TXIF 0x10
3094 #define _TX1IF 0x10
3095 #define _RCIF 0x20
3096 #define _RC1IF 0x20
3097 #define _ADIF 0x40
3098 #define _ACTIF 0x80
3099 #define _STIF 0x80
3101 //==============================================================================
3104 //==============================================================================
3105 // IPR1 Bits
3107 extern __at(0x0F9F) __sfr IPR1;
3109 typedef union
3111 struct
3113 unsigned TMR1IP : 1;
3114 unsigned TMR2IP : 1;
3115 unsigned CCP1IP : 1;
3116 unsigned SSPIP : 1;
3117 unsigned TXIP : 1;
3118 unsigned RCIP : 1;
3119 unsigned ADIP : 1;
3120 unsigned ACTIP : 1;
3123 struct
3125 unsigned : 1;
3126 unsigned : 1;
3127 unsigned : 1;
3128 unsigned SSP1IP : 1;
3129 unsigned TX1IP : 1;
3130 unsigned RC1IP : 1;
3131 unsigned : 1;
3132 unsigned STIP : 1;
3134 } __IPR1bits_t;
3136 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3138 #define _TMR1IP 0x01
3139 #define _TMR2IP 0x02
3140 #define _CCP1IP 0x04
3141 #define _SSPIP 0x08
3142 #define _SSP1IP 0x08
3143 #define _TXIP 0x10
3144 #define _TX1IP 0x10
3145 #define _RCIP 0x20
3146 #define _RC1IP 0x20
3147 #define _ADIP 0x40
3148 #define _ACTIP 0x80
3149 #define _STIP 0x80
3151 //==============================================================================
3154 //==============================================================================
3155 // PIE2 Bits
3157 extern __at(0x0FA0) __sfr PIE2;
3159 typedef union
3161 struct
3163 unsigned CCP2IE : 1;
3164 unsigned TMR3IE : 1;
3165 unsigned HLVDIE : 1;
3166 unsigned BCLIE : 1;
3167 unsigned EEIE : 1;
3168 unsigned C2IE : 1;
3169 unsigned C1IE : 1;
3170 unsigned OSCFIE : 1;
3173 struct
3175 unsigned : 1;
3176 unsigned : 1;
3177 unsigned LVDIE : 1;
3178 unsigned BCL1IE : 1;
3179 unsigned : 1;
3180 unsigned CM2IE : 1;
3181 unsigned CM1IE : 1;
3182 unsigned : 1;
3184 } __PIE2bits_t;
3186 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3188 #define _CCP2IE 0x01
3189 #define _TMR3IE 0x02
3190 #define _HLVDIE 0x04
3191 #define _LVDIE 0x04
3192 #define _BCLIE 0x08
3193 #define _BCL1IE 0x08
3194 #define _EEIE 0x10
3195 #define _C2IE 0x20
3196 #define _CM2IE 0x20
3197 #define _C1IE 0x40
3198 #define _CM1IE 0x40
3199 #define _OSCFIE 0x80
3201 //==============================================================================
3204 //==============================================================================
3205 // PIR2 Bits
3207 extern __at(0x0FA1) __sfr PIR2;
3209 typedef union
3211 struct
3213 unsigned CCP2IF : 1;
3214 unsigned TMR3IF : 1;
3215 unsigned HLVDIF : 1;
3216 unsigned BCLIF : 1;
3217 unsigned EEIF : 1;
3218 unsigned C2IF : 1;
3219 unsigned C1IF : 1;
3220 unsigned OSCFIF : 1;
3223 struct
3225 unsigned : 1;
3226 unsigned : 1;
3227 unsigned LVDIF : 1;
3228 unsigned BCL1IF : 1;
3229 unsigned : 1;
3230 unsigned CM2IF : 1;
3231 unsigned CM1IF : 1;
3232 unsigned : 1;
3234 } __PIR2bits_t;
3236 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3238 #define _CCP2IF 0x01
3239 #define _TMR3IF 0x02
3240 #define _HLVDIF 0x04
3241 #define _LVDIF 0x04
3242 #define _BCLIF 0x08
3243 #define _BCL1IF 0x08
3244 #define _EEIF 0x10
3245 #define _C2IF 0x20
3246 #define _CM2IF 0x20
3247 #define _C1IF 0x40
3248 #define _CM1IF 0x40
3249 #define _OSCFIF 0x80
3251 //==============================================================================
3254 //==============================================================================
3255 // IPR2 Bits
3257 extern __at(0x0FA2) __sfr IPR2;
3259 typedef union
3261 struct
3263 unsigned CCP2IP : 1;
3264 unsigned TMR3IP : 1;
3265 unsigned HLVDIP : 1;
3266 unsigned BCLIP : 1;
3267 unsigned EEIP : 1;
3268 unsigned C2IP : 1;
3269 unsigned C1IP : 1;
3270 unsigned OSCFIP : 1;
3273 struct
3275 unsigned : 1;
3276 unsigned : 1;
3277 unsigned LVDIP : 1;
3278 unsigned BCL1IP : 1;
3279 unsigned : 1;
3280 unsigned CM2IP : 1;
3281 unsigned CM1IP : 1;
3282 unsigned : 1;
3284 } __IPR2bits_t;
3286 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3288 #define _CCP2IP 0x01
3289 #define _TMR3IP 0x02
3290 #define _HLVDIP 0x04
3291 #define _LVDIP 0x04
3292 #define _BCLIP 0x08
3293 #define _BCL1IP 0x08
3294 #define _EEIP 0x10
3295 #define _C2IP 0x20
3296 #define _CM2IP 0x20
3297 #define _C1IP 0x40
3298 #define _CM1IP 0x40
3299 #define _OSCFIP 0x80
3301 //==============================================================================
3304 //==============================================================================
3305 // PIE3 Bits
3307 extern __at(0x0FA3) __sfr PIE3;
3309 typedef struct
3311 unsigned TMR1GIE : 1;
3312 unsigned TMR3GIE : 1;
3313 unsigned USBIE : 1;
3314 unsigned CTMUIE : 1;
3315 unsigned : 1;
3316 unsigned : 1;
3317 unsigned : 1;
3318 unsigned : 1;
3319 } __PIE3bits_t;
3321 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3323 #define _TMR1GIE 0x01
3324 #define _TMR3GIE 0x02
3325 #define _USBIE 0x04
3326 #define _CTMUIE 0x08
3328 //==============================================================================
3331 //==============================================================================
3332 // PIR3 Bits
3334 extern __at(0x0FA4) __sfr PIR3;
3336 typedef struct
3338 unsigned TMR1GIF : 1;
3339 unsigned TMR3GIF : 1;
3340 unsigned USBIF : 1;
3341 unsigned CTMUIF : 1;
3342 unsigned : 1;
3343 unsigned : 1;
3344 unsigned : 1;
3345 unsigned : 1;
3346 } __PIR3bits_t;
3348 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3350 #define _TMR1GIF 0x01
3351 #define _TMR3GIF 0x02
3352 #define _USBIF 0x04
3353 #define _CTMUIF 0x08
3355 //==============================================================================
3358 //==============================================================================
3359 // IPR3 Bits
3361 extern __at(0x0FA5) __sfr IPR3;
3363 typedef struct
3365 unsigned TMR1GIP : 1;
3366 unsigned TMR3GIP : 1;
3367 unsigned USBIP : 1;
3368 unsigned CTMUIP : 1;
3369 unsigned : 1;
3370 unsigned : 1;
3371 unsigned : 1;
3372 unsigned : 1;
3373 } __IPR3bits_t;
3375 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3377 #define _TMR1GIP 0x01
3378 #define _TMR3GIP 0x02
3379 #define _USBIP 0x04
3380 #define _CTMUIP 0x08
3382 //==============================================================================
3385 //==============================================================================
3386 // EECON1 Bits
3388 extern __at(0x0FA6) __sfr EECON1;
3390 typedef struct
3392 unsigned RD : 1;
3393 unsigned WR : 1;
3394 unsigned WREN : 1;
3395 unsigned WRERR : 1;
3396 unsigned FREE : 1;
3397 unsigned : 1;
3398 unsigned CFGS : 1;
3399 unsigned EEPGD : 1;
3400 } __EECON1bits_t;
3402 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3404 #define _RD 0x01
3405 #define _WR 0x02
3406 #define _WREN 0x04
3407 #define _WRERR 0x08
3408 #define _FREE 0x10
3409 #define _CFGS 0x40
3410 #define _EEPGD 0x80
3412 //==============================================================================
3414 extern __at(0x0FA7) __sfr EECON2;
3415 extern __at(0x0FA8) __sfr EEDATA;
3416 extern __at(0x0FA9) __sfr EEADR;
3418 //==============================================================================
3419 // RCSTA Bits
3421 extern __at(0x0FAB) __sfr RCSTA;
3423 typedef union
3425 struct
3427 unsigned RX9D : 1;
3428 unsigned OERR : 1;
3429 unsigned FERR : 1;
3430 unsigned ADDEN : 1;
3431 unsigned CREN : 1;
3432 unsigned SREN : 1;
3433 unsigned RX9 : 1;
3434 unsigned SPEN : 1;
3437 struct
3439 unsigned : 1;
3440 unsigned : 1;
3441 unsigned : 1;
3442 unsigned ADEN : 1;
3443 unsigned : 1;
3444 unsigned : 1;
3445 unsigned : 1;
3446 unsigned : 1;
3448 } __RCSTAbits_t;
3450 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3452 #define _RX9D 0x01
3453 #define _OERR 0x02
3454 #define _FERR 0x04
3455 #define _ADDEN 0x08
3456 #define _ADEN 0x08
3457 #define _CREN 0x10
3458 #define _SREN 0x20
3459 #define _RX9 0x40
3460 #define _SPEN 0x80
3462 //==============================================================================
3465 //==============================================================================
3466 // RCSTA1 Bits
3468 extern __at(0x0FAB) __sfr RCSTA1;
3470 typedef union
3472 struct
3474 unsigned RX9D : 1;
3475 unsigned OERR : 1;
3476 unsigned FERR : 1;
3477 unsigned ADDEN : 1;
3478 unsigned CREN : 1;
3479 unsigned SREN : 1;
3480 unsigned RX9 : 1;
3481 unsigned SPEN : 1;
3484 struct
3486 unsigned : 1;
3487 unsigned : 1;
3488 unsigned : 1;
3489 unsigned ADEN : 1;
3490 unsigned : 1;
3491 unsigned : 1;
3492 unsigned : 1;
3493 unsigned : 1;
3495 } __RCSTA1bits_t;
3497 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
3499 #define _RCSTA1_RX9D 0x01
3500 #define _RCSTA1_OERR 0x02
3501 #define _RCSTA1_FERR 0x04
3502 #define _RCSTA1_ADDEN 0x08
3503 #define _RCSTA1_ADEN 0x08
3504 #define _RCSTA1_CREN 0x10
3505 #define _RCSTA1_SREN 0x20
3506 #define _RCSTA1_RX9 0x40
3507 #define _RCSTA1_SPEN 0x80
3509 //==============================================================================
3512 //==============================================================================
3513 // TXSTA Bits
3515 extern __at(0x0FAC) __sfr TXSTA;
3517 typedef struct
3519 unsigned TX9D : 1;
3520 unsigned TRMT : 1;
3521 unsigned BRGH : 1;
3522 unsigned SENDB : 1;
3523 unsigned SYNC : 1;
3524 unsigned TXEN : 1;
3525 unsigned TX9 : 1;
3526 unsigned CSRC : 1;
3527 } __TXSTAbits_t;
3529 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
3531 #define _TX9D 0x01
3532 #define _TRMT 0x02
3533 #define _BRGH 0x04
3534 #define _SENDB 0x08
3535 #define _SYNC 0x10
3536 #define _TXEN 0x20
3537 #define _TX9 0x40
3538 #define _CSRC 0x80
3540 //==============================================================================
3543 //==============================================================================
3544 // TXSTA1 Bits
3546 extern __at(0x0FAC) __sfr TXSTA1;
3548 typedef struct
3550 unsigned TX9D : 1;
3551 unsigned TRMT : 1;
3552 unsigned BRGH : 1;
3553 unsigned SENDB : 1;
3554 unsigned SYNC : 1;
3555 unsigned TXEN : 1;
3556 unsigned TX9 : 1;
3557 unsigned CSRC : 1;
3558 } __TXSTA1bits_t;
3560 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
3562 #define _TXSTA1_TX9D 0x01
3563 #define _TXSTA1_TRMT 0x02
3564 #define _TXSTA1_BRGH 0x04
3565 #define _TXSTA1_SENDB 0x08
3566 #define _TXSTA1_SYNC 0x10
3567 #define _TXSTA1_TXEN 0x20
3568 #define _TXSTA1_TX9 0x40
3569 #define _TXSTA1_CSRC 0x80
3571 //==============================================================================
3573 extern __at(0x0FAD) __sfr TXREG;
3574 extern __at(0x0FAD) __sfr TXREG1;
3575 extern __at(0x0FAE) __sfr RCREG;
3576 extern __at(0x0FAE) __sfr RCREG1;
3578 //==============================================================================
3579 // SPBRG Bits
3581 extern __at(0x0FAF) __sfr SPBRG;
3583 typedef struct
3585 unsigned BRG0 : 1;
3586 unsigned BRG1 : 1;
3587 unsigned BRG2 : 1;
3588 unsigned BRG3 : 1;
3589 unsigned BRG4 : 1;
3590 unsigned BRG5 : 1;
3591 unsigned BRG6 : 1;
3592 unsigned BRG7 : 1;
3593 } __SPBRGbits_t;
3595 extern __at(0x0FAF) volatile __SPBRGbits_t SPBRGbits;
3597 #define _BRG0 0x01
3598 #define _BRG1 0x02
3599 #define _BRG2 0x04
3600 #define _BRG3 0x08
3601 #define _BRG4 0x10
3602 #define _BRG5 0x20
3603 #define _BRG6 0x40
3604 #define _BRG7 0x80
3606 //==============================================================================
3609 //==============================================================================
3610 // SPBRG1 Bits
3612 extern __at(0x0FAF) __sfr SPBRG1;
3614 typedef struct
3616 unsigned BRG0 : 1;
3617 unsigned BRG1 : 1;
3618 unsigned BRG2 : 1;
3619 unsigned BRG3 : 1;
3620 unsigned BRG4 : 1;
3621 unsigned BRG5 : 1;
3622 unsigned BRG6 : 1;
3623 unsigned BRG7 : 1;
3624 } __SPBRG1bits_t;
3626 extern __at(0x0FAF) volatile __SPBRG1bits_t SPBRG1bits;
3628 #define _SPBRG1_BRG0 0x01
3629 #define _SPBRG1_BRG1 0x02
3630 #define _SPBRG1_BRG2 0x04
3631 #define _SPBRG1_BRG3 0x08
3632 #define _SPBRG1_BRG4 0x10
3633 #define _SPBRG1_BRG5 0x20
3634 #define _SPBRG1_BRG6 0x40
3635 #define _SPBRG1_BRG7 0x80
3637 //==============================================================================
3640 //==============================================================================
3641 // SPBRGH Bits
3643 extern __at(0x0FB0) __sfr SPBRGH;
3645 typedef struct
3647 unsigned BRG8 : 1;
3648 unsigned BRG9 : 1;
3649 unsigned BRG10 : 1;
3650 unsigned BRG11 : 1;
3651 unsigned BRG12 : 1;
3652 unsigned BRG13 : 1;
3653 unsigned BRG14 : 1;
3654 unsigned BRG15 : 1;
3655 } __SPBRGHbits_t;
3657 extern __at(0x0FB0) volatile __SPBRGHbits_t SPBRGHbits;
3659 #define _BRG8 0x01
3660 #define _BRG9 0x02
3661 #define _BRG10 0x04
3662 #define _BRG11 0x08
3663 #define _BRG12 0x10
3664 #define _BRG13 0x20
3665 #define _BRG14 0x40
3666 #define _BRG15 0x80
3668 //==============================================================================
3671 //==============================================================================
3672 // SPBRGH1 Bits
3674 extern __at(0x0FB0) __sfr SPBRGH1;
3676 typedef struct
3678 unsigned BRG8 : 1;
3679 unsigned BRG9 : 1;
3680 unsigned BRG10 : 1;
3681 unsigned BRG11 : 1;
3682 unsigned BRG12 : 1;
3683 unsigned BRG13 : 1;
3684 unsigned BRG14 : 1;
3685 unsigned BRG15 : 1;
3686 } __SPBRGH1bits_t;
3688 extern __at(0x0FB0) volatile __SPBRGH1bits_t SPBRGH1bits;
3690 #define _SPBRGH1_BRG8 0x01
3691 #define _SPBRGH1_BRG9 0x02
3692 #define _SPBRGH1_BRG10 0x04
3693 #define _SPBRGH1_BRG11 0x08
3694 #define _SPBRGH1_BRG12 0x10
3695 #define _SPBRGH1_BRG13 0x20
3696 #define _SPBRGH1_BRG14 0x40
3697 #define _SPBRGH1_BRG15 0x80
3699 //==============================================================================
3702 //==============================================================================
3703 // T3CON Bits
3705 extern __at(0x0FB1) __sfr T3CON;
3707 typedef union
3709 struct
3711 unsigned TMR3ON : 1;
3712 unsigned RD16 : 1;
3713 unsigned NOT_T3SYNC : 1;
3714 unsigned SOSCEN : 1;
3715 unsigned T3CKPS0 : 1;
3716 unsigned T3CKPS1 : 1;
3717 unsigned TMR3CS0 : 1;
3718 unsigned TMR3CS1 : 1;
3721 struct
3723 unsigned : 1;
3724 unsigned T3RD16 : 1;
3725 unsigned T3SYNC : 1;
3726 unsigned T3SOSCEN : 1;
3727 unsigned : 1;
3728 unsigned : 1;
3729 unsigned : 1;
3730 unsigned : 1;
3733 struct
3735 unsigned : 1;
3736 unsigned : 1;
3737 unsigned : 1;
3738 unsigned T3OSCEN : 1;
3739 unsigned : 1;
3740 unsigned : 1;
3741 unsigned : 1;
3742 unsigned : 1;
3745 struct
3747 unsigned : 4;
3748 unsigned T3CKPS : 2;
3749 unsigned : 2;
3752 struct
3754 unsigned : 6;
3755 unsigned TMR3CS : 2;
3757 } __T3CONbits_t;
3759 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
3761 #define _T3CON_TMR3ON 0x01
3762 #define _T3CON_RD16 0x02
3763 #define _T3CON_T3RD16 0x02
3764 #define _T3CON_NOT_T3SYNC 0x04
3765 #define _T3CON_T3SYNC 0x04
3766 #define _T3CON_SOSCEN 0x08
3767 #define _T3CON_T3SOSCEN 0x08
3768 #define _T3CON_T3OSCEN 0x08
3769 #define _T3CON_T3CKPS0 0x10
3770 #define _T3CON_T3CKPS1 0x20
3771 #define _T3CON_TMR3CS0 0x40
3772 #define _T3CON_TMR3CS1 0x80
3774 //==============================================================================
3776 extern __at(0x0FB2) __sfr TMR3;
3777 extern __at(0x0FB2) __sfr TMR3L;
3778 extern __at(0x0FB3) __sfr TMR3H;
3780 //==============================================================================
3781 // T3GCON Bits
3783 extern __at(0x0FB4) __sfr T3GCON;
3785 typedef union
3787 struct
3789 unsigned T3GSS0 : 1;
3790 unsigned T3GSS1 : 1;
3791 unsigned T3GVAL : 1;
3792 unsigned T3GGO_NOT_T3DONE : 1;
3793 unsigned T3GSPM : 1;
3794 unsigned T3GTM : 1;
3795 unsigned T3GPOL : 1;
3796 unsigned TMR3GE : 1;
3799 struct
3801 unsigned : 1;
3802 unsigned : 1;
3803 unsigned : 1;
3804 unsigned T3GGO : 1;
3805 unsigned : 1;
3806 unsigned : 1;
3807 unsigned : 1;
3808 unsigned : 1;
3811 struct
3813 unsigned : 1;
3814 unsigned : 1;
3815 unsigned : 1;
3816 unsigned NOT_T3DONE : 1;
3817 unsigned : 1;
3818 unsigned : 1;
3819 unsigned : 1;
3820 unsigned : 1;
3823 struct
3825 unsigned : 1;
3826 unsigned : 1;
3827 unsigned : 1;
3828 unsigned T3DONE : 1;
3829 unsigned : 1;
3830 unsigned : 1;
3831 unsigned : 1;
3832 unsigned : 1;
3835 struct
3837 unsigned : 1;
3838 unsigned : 1;
3839 unsigned : 1;
3840 unsigned T3GGO_NOT_DONE : 1;
3841 unsigned : 1;
3842 unsigned : 1;
3843 unsigned : 1;
3844 unsigned : 1;
3847 struct
3849 unsigned T3GSS : 2;
3850 unsigned : 6;
3852 } __T3GCONbits_t;
3854 extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits;
3856 #define _T3GSS0 0x01
3857 #define _T3GSS1 0x02
3858 #define _T3GVAL 0x04
3859 #define _T3GGO_NOT_T3DONE 0x08
3860 #define _T3GGO 0x08
3861 #define _NOT_T3DONE 0x08
3862 #define _T3DONE 0x08
3863 #define _T3GGO_NOT_DONE 0x08
3864 #define _T3GSPM 0x10
3865 #define _T3GTM 0x20
3866 #define _T3GPOL 0x40
3867 #define _TMR3GE 0x80
3869 //==============================================================================
3872 //==============================================================================
3873 // ACTCON Bits
3875 extern __at(0x0FB5) __sfr ACTCON;
3877 typedef union
3879 struct
3881 unsigned : 1;
3882 unsigned ACTORS : 1;
3883 unsigned : 1;
3884 unsigned ACTLOCK : 1;
3885 unsigned ACTSRC : 1;
3886 unsigned : 1;
3887 unsigned ACTUD : 1;
3888 unsigned ACTEN : 1;
3891 struct
3893 unsigned : 1;
3894 unsigned STOR : 1;
3895 unsigned : 1;
3896 unsigned STLOCK : 1;
3897 unsigned STSRC : 1;
3898 unsigned : 1;
3899 unsigned STUD : 1;
3900 unsigned STEN : 1;
3903 struct
3905 unsigned : 1;
3906 unsigned ACTOR : 1;
3907 unsigned : 1;
3908 unsigned : 1;
3909 unsigned : 1;
3910 unsigned : 1;
3911 unsigned ACTD : 1;
3912 unsigned ACTSEL : 1;
3914 } __ACTCONbits_t;
3916 extern __at(0x0FB5) volatile __ACTCONbits_t ACTCONbits;
3918 #define _ACTORS 0x02
3919 #define _STOR 0x02
3920 #define _ACTOR 0x02
3921 #define _ACTLOCK 0x08
3922 #define _STLOCK 0x08
3923 #define _ACTSRC 0x10
3924 #define _STSRC 0x10
3925 #define _ACTUD 0x40
3926 #define _STUD 0x40
3927 #define _ACTD 0x40
3928 #define _ACTEN 0x80
3929 #define _STEN 0x80
3930 #define _ACTSEL 0x80
3932 //==============================================================================
3935 //==============================================================================
3936 // STCON Bits
3938 extern __at(0x0FB5) __sfr STCON;
3940 typedef union
3942 struct
3944 unsigned : 1;
3945 unsigned ACTORS : 1;
3946 unsigned : 1;
3947 unsigned ACTLOCK : 1;
3948 unsigned ACTSRC : 1;
3949 unsigned : 1;
3950 unsigned ACTUD : 1;
3951 unsigned ACTEN : 1;
3954 struct
3956 unsigned : 1;
3957 unsigned STOR : 1;
3958 unsigned : 1;
3959 unsigned STLOCK : 1;
3960 unsigned STSRC : 1;
3961 unsigned : 1;
3962 unsigned STUD : 1;
3963 unsigned STEN : 1;
3966 struct
3968 unsigned : 1;
3969 unsigned ACTOR : 1;
3970 unsigned : 1;
3971 unsigned : 1;
3972 unsigned : 1;
3973 unsigned : 1;
3974 unsigned ACTD : 1;
3975 unsigned ACTSEL : 1;
3977 } __STCONbits_t;
3979 extern __at(0x0FB5) volatile __STCONbits_t STCONbits;
3981 #define _STCON_ACTORS 0x02
3982 #define _STCON_STOR 0x02
3983 #define _STCON_ACTOR 0x02
3984 #define _STCON_ACTLOCK 0x08
3985 #define _STCON_STLOCK 0x08
3986 #define _STCON_ACTSRC 0x10
3987 #define _STCON_STSRC 0x10
3988 #define _STCON_ACTUD 0x40
3989 #define _STCON_STUD 0x40
3990 #define _STCON_ACTD 0x40
3991 #define _STCON_ACTEN 0x80
3992 #define _STCON_STEN 0x80
3993 #define _STCON_ACTSEL 0x80
3995 //==============================================================================
3998 //==============================================================================
3999 // ECCP1AS Bits
4001 extern __at(0x0FB6) __sfr ECCP1AS;
4003 typedef union
4005 struct
4007 unsigned PSS1BD0 : 1;
4008 unsigned PSS1BD1 : 1;
4009 unsigned PSS1AC0 : 1;
4010 unsigned PSS1AC1 : 1;
4011 unsigned ECCP1AS0 : 1;
4012 unsigned ECCP1AS1 : 1;
4013 unsigned ECCP1AS2 : 1;
4014 unsigned ECCP1ASE : 1;
4017 struct
4019 unsigned PSSBD0 : 1;
4020 unsigned PSSBD1 : 1;
4021 unsigned PSSAC0 : 1;
4022 unsigned PSSAC1 : 1;
4023 unsigned : 1;
4024 unsigned : 1;
4025 unsigned : 1;
4026 unsigned CCP1ASE : 1;
4029 struct
4031 unsigned PSSBD : 2;
4032 unsigned : 6;
4035 struct
4037 unsigned PSS1BD : 2;
4038 unsigned : 6;
4041 struct
4043 unsigned : 2;
4044 unsigned PSS1AC : 2;
4045 unsigned : 4;
4048 struct
4050 unsigned : 2;
4051 unsigned PSSAC : 2;
4052 unsigned : 4;
4055 struct
4057 unsigned : 4;
4058 unsigned ECCP1AS : 3;
4059 unsigned : 1;
4061 } __ECCP1ASbits_t;
4063 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
4065 #define _PSS1BD0 0x01
4066 #define _PSSBD0 0x01
4067 #define _PSS1BD1 0x02
4068 #define _PSSBD1 0x02
4069 #define _PSS1AC0 0x04
4070 #define _PSSAC0 0x04
4071 #define _PSS1AC1 0x08
4072 #define _PSSAC1 0x08
4073 #define _ECCP1AS0 0x10
4074 #define _ECCP1AS1 0x20
4075 #define _ECCP1AS2 0x40
4076 #define _ECCP1ASE 0x80
4077 #define _CCP1ASE 0x80
4079 //==============================================================================
4082 //==============================================================================
4083 // ECCP1DEL Bits
4085 extern __at(0x0FB7) __sfr ECCP1DEL;
4087 typedef union
4089 struct
4091 unsigned PDC0 : 1;
4092 unsigned PDC1 : 1;
4093 unsigned PDC2 : 1;
4094 unsigned PDC3 : 1;
4095 unsigned PDC4 : 1;
4096 unsigned PDC5 : 1;
4097 unsigned PDC6 : 1;
4098 unsigned P1RSEN : 1;
4101 struct
4103 unsigned : 1;
4104 unsigned : 1;
4105 unsigned : 1;
4106 unsigned : 1;
4107 unsigned : 1;
4108 unsigned : 1;
4109 unsigned : 1;
4110 unsigned PR1SEN : 1;
4113 struct
4115 unsigned PDC : 7;
4116 unsigned : 1;
4118 } __ECCP1DELbits_t;
4120 extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits;
4122 #define _PDC0 0x01
4123 #define _PDC1 0x02
4124 #define _PDC2 0x04
4125 #define _PDC3 0x08
4126 #define _PDC4 0x10
4127 #define _PDC5 0x20
4128 #define _PDC6 0x40
4129 #define _P1RSEN 0x80
4130 #define _PR1SEN 0x80
4132 //==============================================================================
4135 //==============================================================================
4136 // PWM1CON Bits
4138 extern __at(0x0FB7) __sfr PWM1CON;
4140 typedef union
4142 struct
4144 unsigned PDC0 : 1;
4145 unsigned PDC1 : 1;
4146 unsigned PDC2 : 1;
4147 unsigned PDC3 : 1;
4148 unsigned PDC4 : 1;
4149 unsigned PDC5 : 1;
4150 unsigned PDC6 : 1;
4151 unsigned P1RSEN : 1;
4154 struct
4156 unsigned : 1;
4157 unsigned : 1;
4158 unsigned : 1;
4159 unsigned : 1;
4160 unsigned : 1;
4161 unsigned : 1;
4162 unsigned : 1;
4163 unsigned PR1SEN : 1;
4166 struct
4168 unsigned PDC : 7;
4169 unsigned : 1;
4171 } __PWM1CONbits_t;
4173 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
4175 #define _PWM1CON_PDC0 0x01
4176 #define _PWM1CON_PDC1 0x02
4177 #define _PWM1CON_PDC2 0x04
4178 #define _PWM1CON_PDC3 0x08
4179 #define _PWM1CON_PDC4 0x10
4180 #define _PWM1CON_PDC5 0x20
4181 #define _PWM1CON_PDC6 0x40
4182 #define _PWM1CON_P1RSEN 0x80
4183 #define _PWM1CON_PR1SEN 0x80
4185 //==============================================================================
4188 //==============================================================================
4189 // BAUDCON Bits
4191 extern __at(0x0FB8) __sfr BAUDCON;
4193 typedef union
4195 struct
4197 unsigned ABDEN : 1;
4198 unsigned WUE : 1;
4199 unsigned : 1;
4200 unsigned BRG16 : 1;
4201 unsigned TXCKP : 1;
4202 unsigned RXDTP : 1;
4203 unsigned RCIDL : 1;
4204 unsigned ABDOVF : 1;
4207 struct
4209 unsigned : 1;
4210 unsigned : 1;
4211 unsigned : 1;
4212 unsigned : 1;
4213 unsigned CKTXP : 1;
4214 unsigned DTRXP : 1;
4215 unsigned RCMT : 1;
4216 unsigned : 1;
4219 struct
4221 unsigned : 1;
4222 unsigned : 1;
4223 unsigned : 1;
4224 unsigned : 1;
4225 unsigned SCKP : 1;
4226 unsigned : 1;
4227 unsigned : 1;
4228 unsigned : 1;
4230 } __BAUDCONbits_t;
4232 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
4234 #define _ABDEN 0x01
4235 #define _WUE 0x02
4236 #define _BRG16 0x08
4237 #define _TXCKP 0x10
4238 #define _CKTXP 0x10
4239 #define _SCKP 0x10
4240 #define _RXDTP 0x20
4241 #define _DTRXP 0x20
4242 #define _RCIDL 0x40
4243 #define _RCMT 0x40
4244 #define _ABDOVF 0x80
4246 //==============================================================================
4249 //==============================================================================
4250 // BAUDCON1 Bits
4252 extern __at(0x0FB8) __sfr BAUDCON1;
4254 typedef union
4256 struct
4258 unsigned ABDEN : 1;
4259 unsigned WUE : 1;
4260 unsigned : 1;
4261 unsigned BRG16 : 1;
4262 unsigned TXCKP : 1;
4263 unsigned RXDTP : 1;
4264 unsigned RCIDL : 1;
4265 unsigned ABDOVF : 1;
4268 struct
4270 unsigned : 1;
4271 unsigned : 1;
4272 unsigned : 1;
4273 unsigned : 1;
4274 unsigned CKTXP : 1;
4275 unsigned DTRXP : 1;
4276 unsigned RCMT : 1;
4277 unsigned : 1;
4280 struct
4282 unsigned : 1;
4283 unsigned : 1;
4284 unsigned : 1;
4285 unsigned : 1;
4286 unsigned SCKP : 1;
4287 unsigned : 1;
4288 unsigned : 1;
4289 unsigned : 1;
4291 } __BAUDCON1bits_t;
4293 extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits;
4295 #define _BAUDCON1_ABDEN 0x01
4296 #define _BAUDCON1_WUE 0x02
4297 #define _BAUDCON1_BRG16 0x08
4298 #define _BAUDCON1_TXCKP 0x10
4299 #define _BAUDCON1_CKTXP 0x10
4300 #define _BAUDCON1_SCKP 0x10
4301 #define _BAUDCON1_RXDTP 0x20
4302 #define _BAUDCON1_DTRXP 0x20
4303 #define _BAUDCON1_RCIDL 0x40
4304 #define _BAUDCON1_RCMT 0x40
4305 #define _BAUDCON1_ABDOVF 0x80
4307 //==============================================================================
4310 //==============================================================================
4311 // PSTR1CON Bits
4313 extern __at(0x0FB9) __sfr PSTR1CON;
4315 typedef union
4317 struct
4319 unsigned STRA : 1;
4320 unsigned STRB : 1;
4321 unsigned STRC : 1;
4322 unsigned STRD : 1;
4323 unsigned STRSYNC : 1;
4324 unsigned : 1;
4325 unsigned : 1;
4326 unsigned : 1;
4329 struct
4331 unsigned STR1A : 1;
4332 unsigned STR1B : 1;
4333 unsigned STR1C : 1;
4334 unsigned STR1D : 1;
4335 unsigned STR1SYNC : 1;
4336 unsigned : 1;
4337 unsigned : 1;
4338 unsigned : 1;
4340 } __PSTR1CONbits_t;
4342 extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits;
4344 #define _STRA 0x01
4345 #define _STR1A 0x01
4346 #define _STRB 0x02
4347 #define _STR1B 0x02
4348 #define _STRC 0x04
4349 #define _STR1C 0x04
4350 #define _STRD 0x08
4351 #define _STR1D 0x08
4352 #define _STRSYNC 0x10
4353 #define _STR1SYNC 0x10
4355 //==============================================================================
4358 //==============================================================================
4359 // T2CON Bits
4361 extern __at(0x0FBA) __sfr T2CON;
4363 typedef union
4365 struct
4367 unsigned T2CKPS0 : 1;
4368 unsigned T2CKPS1 : 1;
4369 unsigned TMR2ON : 1;
4370 unsigned T2OUTPS0 : 1;
4371 unsigned T2OUTPS1 : 1;
4372 unsigned T2OUTPS2 : 1;
4373 unsigned T2OUTPS3 : 1;
4374 unsigned : 1;
4377 struct
4379 unsigned T2CKPS : 2;
4380 unsigned : 6;
4383 struct
4385 unsigned : 3;
4386 unsigned T2OUTPS : 4;
4387 unsigned : 1;
4389 } __T2CONbits_t;
4391 extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits;
4393 #define _T2CKPS0 0x01
4394 #define _T2CKPS1 0x02
4395 #define _TMR2ON 0x04
4396 #define _T2OUTPS0 0x08
4397 #define _T2OUTPS1 0x10
4398 #define _T2OUTPS2 0x20
4399 #define _T2OUTPS3 0x40
4401 //==============================================================================
4403 extern __at(0x0FBB) __sfr PR2;
4404 extern __at(0x0FBC) __sfr TMR2;
4406 //==============================================================================
4407 // CCP1CON Bits
4409 extern __at(0x0FBD) __sfr CCP1CON;
4411 typedef union
4413 struct
4415 unsigned CCP1M0 : 1;
4416 unsigned CCP1M1 : 1;
4417 unsigned CCP1M2 : 1;
4418 unsigned CCP1M3 : 1;
4419 unsigned DC1B0 : 1;
4420 unsigned DC1B1 : 1;
4421 unsigned P1M0 : 1;
4422 unsigned P1M1 : 1;
4425 struct
4427 unsigned : 1;
4428 unsigned : 1;
4429 unsigned : 1;
4430 unsigned : 1;
4431 unsigned CCP1Y : 1;
4432 unsigned CCP1X : 1;
4433 unsigned : 1;
4434 unsigned : 1;
4437 struct
4439 unsigned CCP1M : 4;
4440 unsigned : 4;
4443 struct
4445 unsigned : 4;
4446 unsigned DC1B : 2;
4447 unsigned : 2;
4450 struct
4452 unsigned : 6;
4453 unsigned P1M : 2;
4455 } __CCP1CONbits_t;
4457 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
4459 #define _CCP1M0 0x01
4460 #define _CCP1M1 0x02
4461 #define _CCP1M2 0x04
4462 #define _CCP1M3 0x08
4463 #define _DC1B0 0x10
4464 #define _CCP1Y 0x10
4465 #define _DC1B1 0x20
4466 #define _CCP1X 0x20
4467 #define _P1M0 0x40
4468 #define _P1M1 0x80
4470 //==============================================================================
4473 //==============================================================================
4474 // ECCP1CON Bits
4476 extern __at(0x0FBD) __sfr ECCP1CON;
4478 typedef union
4480 struct
4482 unsigned CCP1M0 : 1;
4483 unsigned CCP1M1 : 1;
4484 unsigned CCP1M2 : 1;
4485 unsigned CCP1M3 : 1;
4486 unsigned DC1B0 : 1;
4487 unsigned DC1B1 : 1;
4488 unsigned P1M0 : 1;
4489 unsigned P1M1 : 1;
4492 struct
4494 unsigned : 1;
4495 unsigned : 1;
4496 unsigned : 1;
4497 unsigned : 1;
4498 unsigned CCP1Y : 1;
4499 unsigned CCP1X : 1;
4500 unsigned : 1;
4501 unsigned : 1;
4504 struct
4506 unsigned CCP1M : 4;
4507 unsigned : 4;
4510 struct
4512 unsigned : 4;
4513 unsigned DC1B : 2;
4514 unsigned : 2;
4517 struct
4519 unsigned : 6;
4520 unsigned P1M : 2;
4522 } __ECCP1CONbits_t;
4524 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
4526 #define _ECCP1CON_CCP1M0 0x01
4527 #define _ECCP1CON_CCP1M1 0x02
4528 #define _ECCP1CON_CCP1M2 0x04
4529 #define _ECCP1CON_CCP1M3 0x08
4530 #define _ECCP1CON_DC1B0 0x10
4531 #define _ECCP1CON_CCP1Y 0x10
4532 #define _ECCP1CON_DC1B1 0x20
4533 #define _ECCP1CON_CCP1X 0x20
4534 #define _ECCP1CON_P1M0 0x40
4535 #define _ECCP1CON_P1M1 0x80
4537 //==============================================================================
4539 extern __at(0x0FBE) __sfr CCPR1;
4540 extern __at(0x0FBE) __sfr CCPR1L;
4541 extern __at(0x0FBF) __sfr CCPR1H;
4543 //==============================================================================
4544 // ADCON2 Bits
4546 extern __at(0x0FC0) __sfr ADCON2;
4548 typedef union
4550 struct
4552 unsigned ADCS0 : 1;
4553 unsigned ADCS1 : 1;
4554 unsigned ADCS2 : 1;
4555 unsigned ACQT0 : 1;
4556 unsigned ACQT1 : 1;
4557 unsigned ACQT2 : 1;
4558 unsigned : 1;
4559 unsigned ADFM : 1;
4562 struct
4564 unsigned ADCS : 3;
4565 unsigned : 5;
4568 struct
4570 unsigned : 3;
4571 unsigned ACQT : 3;
4572 unsigned : 2;
4574 } __ADCON2bits_t;
4576 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4578 #define _ADCS0 0x01
4579 #define _ADCS1 0x02
4580 #define _ADCS2 0x04
4581 #define _ACQT0 0x08
4582 #define _ACQT1 0x10
4583 #define _ACQT2 0x20
4584 #define _ADFM 0x80
4586 //==============================================================================
4589 //==============================================================================
4590 // ADCON1 Bits
4592 extern __at(0x0FC1) __sfr ADCON1;
4594 typedef union
4596 struct
4598 unsigned NVCFG0 : 1;
4599 unsigned NVCFG1 : 1;
4600 unsigned PVCFG0 : 1;
4601 unsigned PVCFG1 : 1;
4602 unsigned : 1;
4603 unsigned : 1;
4604 unsigned : 1;
4605 unsigned TRIGSEL : 1;
4608 struct
4610 unsigned NVCFG : 2;
4611 unsigned : 6;
4614 struct
4616 unsigned : 2;
4617 unsigned PVCFG : 2;
4618 unsigned : 4;
4620 } __ADCON1bits_t;
4622 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4624 #define _NVCFG0 0x01
4625 #define _NVCFG1 0x02
4626 #define _PVCFG0 0x04
4627 #define _PVCFG1 0x08
4628 #define _TRIGSEL 0x80
4630 //==============================================================================
4633 //==============================================================================
4634 // ADCON0 Bits
4636 extern __at(0x0FC2) __sfr ADCON0;
4638 typedef union
4640 struct
4642 unsigned ADON : 1;
4643 unsigned GO_NOT_DONE : 1;
4644 unsigned : 1;
4645 unsigned : 1;
4646 unsigned : 1;
4647 unsigned : 1;
4648 unsigned : 1;
4649 unsigned : 1;
4652 struct
4654 unsigned : 1;
4655 unsigned DONE : 1;
4656 unsigned : 1;
4657 unsigned : 1;
4658 unsigned : 1;
4659 unsigned : 1;
4660 unsigned : 1;
4661 unsigned : 1;
4664 struct
4666 unsigned : 1;
4667 unsigned GO : 1;
4668 unsigned : 1;
4669 unsigned : 1;
4670 unsigned : 1;
4671 unsigned : 1;
4672 unsigned : 1;
4673 unsigned : 1;
4676 struct
4678 unsigned : 1;
4679 unsigned NOT_DONE : 1;
4680 unsigned : 1;
4681 unsigned : 1;
4682 unsigned : 1;
4683 unsigned : 1;
4684 unsigned : 1;
4685 unsigned : 1;
4687 } __ADCON0bits_t;
4689 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4691 #define _ADON 0x01
4692 #define _GO_NOT_DONE 0x02
4693 #define _DONE 0x02
4694 #define _GO 0x02
4695 #define _NOT_DONE 0x02
4697 //==============================================================================
4699 extern __at(0x0FC3) __sfr ADRESL;
4700 extern __at(0x0FC4) __sfr ADRESH;
4702 //==============================================================================
4703 // SSP1CON2 Bits
4705 extern __at(0x0FC5) __sfr SSP1CON2;
4707 typedef struct
4709 unsigned SEN : 1;
4710 unsigned RSEN : 1;
4711 unsigned PEN : 1;
4712 unsigned RCEN : 1;
4713 unsigned ACKEN : 1;
4714 unsigned ACKDT : 1;
4715 unsigned ACKSTAT : 1;
4716 unsigned GCEN : 1;
4717 } __SSP1CON2bits_t;
4719 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4721 #define _SEN 0x01
4722 #define _RSEN 0x02
4723 #define _PEN 0x04
4724 #define _RCEN 0x08
4725 #define _ACKEN 0x10
4726 #define _ACKDT 0x20
4727 #define _ACKSTAT 0x40
4728 #define _GCEN 0x80
4730 //==============================================================================
4733 //==============================================================================
4734 // SSPCON2 Bits
4736 extern __at(0x0FC5) __sfr SSPCON2;
4738 typedef struct
4740 unsigned SEN : 1;
4741 unsigned RSEN : 1;
4742 unsigned PEN : 1;
4743 unsigned RCEN : 1;
4744 unsigned ACKEN : 1;
4745 unsigned ACKDT : 1;
4746 unsigned ACKSTAT : 1;
4747 unsigned GCEN : 1;
4748 } __SSPCON2bits_t;
4750 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4752 #define _SSPCON2_SEN 0x01
4753 #define _SSPCON2_RSEN 0x02
4754 #define _SSPCON2_PEN 0x04
4755 #define _SSPCON2_RCEN 0x08
4756 #define _SSPCON2_ACKEN 0x10
4757 #define _SSPCON2_ACKDT 0x20
4758 #define _SSPCON2_ACKSTAT 0x40
4759 #define _SSPCON2_GCEN 0x80
4761 //==============================================================================
4764 //==============================================================================
4765 // SSP1CON1 Bits
4767 extern __at(0x0FC6) __sfr SSP1CON1;
4769 typedef union
4771 struct
4773 unsigned SSPM0 : 1;
4774 unsigned SSPM1 : 1;
4775 unsigned SSPM2 : 1;
4776 unsigned SSPM3 : 1;
4777 unsigned CKP : 1;
4778 unsigned SSPEN : 1;
4779 unsigned SSPOV : 1;
4780 unsigned WCOL : 1;
4783 struct
4785 unsigned SSPM : 4;
4786 unsigned : 4;
4788 } __SSP1CON1bits_t;
4790 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4792 #define _SSPM0 0x01
4793 #define _SSPM1 0x02
4794 #define _SSPM2 0x04
4795 #define _SSPM3 0x08
4796 #define _CKP 0x10
4797 #define _SSPEN 0x20
4798 #define _SSPOV 0x40
4799 #define _WCOL 0x80
4801 //==============================================================================
4804 //==============================================================================
4805 // SSPCON Bits
4807 extern __at(0x0FC6) __sfr SSPCON;
4809 typedef union
4811 struct
4813 unsigned SSPM0 : 1;
4814 unsigned SSPM1 : 1;
4815 unsigned SSPM2 : 1;
4816 unsigned SSPM3 : 1;
4817 unsigned CKP : 1;
4818 unsigned SSPEN : 1;
4819 unsigned SSPOV : 1;
4820 unsigned WCOL : 1;
4823 struct
4825 unsigned SSPM : 4;
4826 unsigned : 4;
4828 } __SSPCONbits_t;
4830 extern __at(0x0FC6) volatile __SSPCONbits_t SSPCONbits;
4832 #define _SSPCON_SSPM0 0x01
4833 #define _SSPCON_SSPM1 0x02
4834 #define _SSPCON_SSPM2 0x04
4835 #define _SSPCON_SSPM3 0x08
4836 #define _SSPCON_CKP 0x10
4837 #define _SSPCON_SSPEN 0x20
4838 #define _SSPCON_SSPOV 0x40
4839 #define _SSPCON_WCOL 0x80
4841 //==============================================================================
4844 //==============================================================================
4845 // SSPCON1 Bits
4847 extern __at(0x0FC6) __sfr SSPCON1;
4849 typedef union
4851 struct
4853 unsigned SSPM0 : 1;
4854 unsigned SSPM1 : 1;
4855 unsigned SSPM2 : 1;
4856 unsigned SSPM3 : 1;
4857 unsigned CKP : 1;
4858 unsigned SSPEN : 1;
4859 unsigned SSPOV : 1;
4860 unsigned WCOL : 1;
4863 struct
4865 unsigned SSPM : 4;
4866 unsigned : 4;
4868 } __SSPCON1bits_t;
4870 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4872 #define _SSPCON1_SSPM0 0x01
4873 #define _SSPCON1_SSPM1 0x02
4874 #define _SSPCON1_SSPM2 0x04
4875 #define _SSPCON1_SSPM3 0x08
4876 #define _SSPCON1_CKP 0x10
4877 #define _SSPCON1_SSPEN 0x20
4878 #define _SSPCON1_SSPOV 0x40
4879 #define _SSPCON1_WCOL 0x80
4881 //==============================================================================
4884 //==============================================================================
4885 // SSP1STAT Bits
4887 extern __at(0x0FC7) __sfr SSP1STAT;
4889 typedef struct
4891 unsigned BF : 1;
4892 unsigned UA : 1;
4893 unsigned R_NOT_W : 1;
4894 unsigned S : 1;
4895 unsigned P : 1;
4896 unsigned D_NOT_A : 1;
4897 unsigned CKE : 1;
4898 unsigned SMP : 1;
4899 } __SSP1STATbits_t;
4901 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4903 #define _BF 0x01
4904 #define _UA 0x02
4905 #define _R_NOT_W 0x04
4906 #define _S 0x08
4907 #define _P 0x10
4908 #define _D_NOT_A 0x20
4909 #define _CKE 0x40
4910 #define _SMP 0x80
4912 //==============================================================================
4915 //==============================================================================
4916 // SSPSTAT Bits
4918 extern __at(0x0FC7) __sfr SSPSTAT;
4920 typedef struct
4922 unsigned BF : 1;
4923 unsigned UA : 1;
4924 unsigned R_NOT_W : 1;
4925 unsigned S : 1;
4926 unsigned P : 1;
4927 unsigned D_NOT_A : 1;
4928 unsigned CKE : 1;
4929 unsigned SMP : 1;
4930 } __SSPSTATbits_t;
4932 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
4934 #define _SSPSTAT_BF 0x01
4935 #define _SSPSTAT_UA 0x02
4936 #define _SSPSTAT_R_NOT_W 0x04
4937 #define _SSPSTAT_S 0x08
4938 #define _SSPSTAT_P 0x10
4939 #define _SSPSTAT_D_NOT_A 0x20
4940 #define _SSPSTAT_CKE 0x40
4941 #define _SSPSTAT_SMP 0x80
4943 //==============================================================================
4946 //==============================================================================
4947 // SSP1ADD Bits
4949 extern __at(0x0FC8) __sfr SSP1ADD;
4951 typedef struct
4953 unsigned SSP1ADD0 : 1;
4954 unsigned SSP1ADD1 : 1;
4955 unsigned SSP1ADD2 : 1;
4956 unsigned SSP1ADD3 : 1;
4957 unsigned SSP1ADD4 : 1;
4958 unsigned SSP1ADD5 : 1;
4959 unsigned SSP1ADD6 : 1;
4960 unsigned SSP1ADD7 : 1;
4961 } __SSP1ADDbits_t;
4963 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
4965 #define _SSP1ADD0 0x01
4966 #define _SSP1ADD1 0x02
4967 #define _SSP1ADD2 0x04
4968 #define _SSP1ADD3 0x08
4969 #define _SSP1ADD4 0x10
4970 #define _SSP1ADD5 0x20
4971 #define _SSP1ADD6 0x40
4972 #define _SSP1ADD7 0x80
4974 //==============================================================================
4977 //==============================================================================
4978 // SSPADD Bits
4980 extern __at(0x0FC8) __sfr SSPADD;
4982 typedef struct
4984 unsigned SSP1ADD0 : 1;
4985 unsigned SSP1ADD1 : 1;
4986 unsigned SSP1ADD2 : 1;
4987 unsigned SSP1ADD3 : 1;
4988 unsigned SSP1ADD4 : 1;
4989 unsigned SSP1ADD5 : 1;
4990 unsigned SSP1ADD6 : 1;
4991 unsigned SSP1ADD7 : 1;
4992 } __SSPADDbits_t;
4994 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
4996 #define _SSPADD_SSP1ADD0 0x01
4997 #define _SSPADD_SSP1ADD1 0x02
4998 #define _SSPADD_SSP1ADD2 0x04
4999 #define _SSPADD_SSP1ADD3 0x08
5000 #define _SSPADD_SSP1ADD4 0x10
5001 #define _SSPADD_SSP1ADD5 0x20
5002 #define _SSPADD_SSP1ADD6 0x40
5003 #define _SSPADD_SSP1ADD7 0x80
5005 //==============================================================================
5007 extern __at(0x0FC9) __sfr SSP1BUF;
5008 extern __at(0x0FC9) __sfr SSPBUF;
5010 //==============================================================================
5011 // SSP1MSK Bits
5013 extern __at(0x0FCA) __sfr SSP1MSK;
5015 typedef struct
5017 unsigned SSP1MSK0 : 1;
5018 unsigned SSP1MSK1 : 1;
5019 unsigned SSP1MSK2 : 1;
5020 unsigned SSP1MSK3 : 1;
5021 unsigned SSP1MSK4 : 1;
5022 unsigned SSP1MSK5 : 1;
5023 unsigned SSP1MSK6 : 1;
5024 unsigned SSP1MSK7 : 1;
5025 } __SSP1MSKbits_t;
5027 extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits;
5029 #define _SSP1MSK0 0x01
5030 #define _SSP1MSK1 0x02
5031 #define _SSP1MSK2 0x04
5032 #define _SSP1MSK3 0x08
5033 #define _SSP1MSK4 0x10
5034 #define _SSP1MSK5 0x20
5035 #define _SSP1MSK6 0x40
5036 #define _SSP1MSK7 0x80
5038 //==============================================================================
5041 //==============================================================================
5042 // SSPMSK Bits
5044 extern __at(0x0FCA) __sfr SSPMSK;
5046 typedef struct
5048 unsigned SSP1MSK0 : 1;
5049 unsigned SSP1MSK1 : 1;
5050 unsigned SSP1MSK2 : 1;
5051 unsigned SSP1MSK3 : 1;
5052 unsigned SSP1MSK4 : 1;
5053 unsigned SSP1MSK5 : 1;
5054 unsigned SSP1MSK6 : 1;
5055 unsigned SSP1MSK7 : 1;
5056 } __SSPMSKbits_t;
5058 extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits;
5060 #define _SSPMSK_SSP1MSK0 0x01
5061 #define _SSPMSK_SSP1MSK1 0x02
5062 #define _SSPMSK_SSP1MSK2 0x04
5063 #define _SSPMSK_SSP1MSK3 0x08
5064 #define _SSPMSK_SSP1MSK4 0x10
5065 #define _SSPMSK_SSP1MSK5 0x20
5066 #define _SSPMSK_SSP1MSK6 0x40
5067 #define _SSPMSK_SSP1MSK7 0x80
5069 //==============================================================================
5072 //==============================================================================
5073 // SSP1CON3 Bits
5075 extern __at(0x0FCB) __sfr SSP1CON3;
5077 typedef struct
5079 unsigned DHEN : 1;
5080 unsigned AHEN : 1;
5081 unsigned SBCDE : 1;
5082 unsigned SDAHT : 1;
5083 unsigned BOEN : 1;
5084 unsigned SCIE : 1;
5085 unsigned PCIE : 1;
5086 unsigned ACKTIM : 1;
5087 } __SSP1CON3bits_t;
5089 extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits;
5091 #define _DHEN 0x01
5092 #define _AHEN 0x02
5093 #define _SBCDE 0x04
5094 #define _SDAHT 0x08
5095 #define _BOEN 0x10
5096 #define _SCIE 0x20
5097 #define _PCIE 0x40
5098 #define _ACKTIM 0x80
5100 //==============================================================================
5103 //==============================================================================
5104 // SSPCON3 Bits
5106 extern __at(0x0FCB) __sfr SSPCON3;
5108 typedef struct
5110 unsigned DHEN : 1;
5111 unsigned AHEN : 1;
5112 unsigned SBCDE : 1;
5113 unsigned SDAHT : 1;
5114 unsigned BOEN : 1;
5115 unsigned SCIE : 1;
5116 unsigned PCIE : 1;
5117 unsigned ACKTIM : 1;
5118 } __SSPCON3bits_t;
5120 extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits;
5122 #define _SSPCON3_DHEN 0x01
5123 #define _SSPCON3_AHEN 0x02
5124 #define _SSPCON3_SBCDE 0x04
5125 #define _SSPCON3_SDAHT 0x08
5126 #define _SSPCON3_BOEN 0x10
5127 #define _SSPCON3_SCIE 0x20
5128 #define _SSPCON3_PCIE 0x40
5129 #define _SSPCON3_ACKTIM 0x80
5131 //==============================================================================
5134 //==============================================================================
5135 // T1GCON Bits
5137 extern __at(0x0FCC) __sfr T1GCON;
5139 typedef union
5141 struct
5143 unsigned T1GSS0 : 1;
5144 unsigned T1GSS1 : 1;
5145 unsigned T1GVAL : 1;
5146 unsigned T1GGO_NOT_T1DONE : 1;
5147 unsigned T1GSPM : 1;
5148 unsigned T1GTM : 1;
5149 unsigned T1GPOL : 1;
5150 unsigned TMR1GE : 1;
5153 struct
5155 unsigned : 1;
5156 unsigned : 1;
5157 unsigned : 1;
5158 unsigned T1GGO : 1;
5159 unsigned : 1;
5160 unsigned : 1;
5161 unsigned : 1;
5162 unsigned : 1;
5165 struct
5167 unsigned : 1;
5168 unsigned : 1;
5169 unsigned : 1;
5170 unsigned NOT_T1DONE : 1;
5171 unsigned : 1;
5172 unsigned : 1;
5173 unsigned : 1;
5174 unsigned : 1;
5177 struct
5179 unsigned : 1;
5180 unsigned : 1;
5181 unsigned : 1;
5182 unsigned T1DONE : 1;
5183 unsigned : 1;
5184 unsigned : 1;
5185 unsigned : 1;
5186 unsigned : 1;
5189 struct
5191 unsigned : 1;
5192 unsigned : 1;
5193 unsigned : 1;
5194 unsigned T1GGO_NOT_DONE : 1;
5195 unsigned : 1;
5196 unsigned : 1;
5197 unsigned : 1;
5198 unsigned : 1;
5201 struct
5203 unsigned T1GSS : 2;
5204 unsigned : 6;
5206 } __T1GCONbits_t;
5208 extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits;
5210 #define _T1GSS0 0x01
5211 #define _T1GSS1 0x02
5212 #define _T1GVAL 0x04
5213 #define _T1GGO_NOT_T1DONE 0x08
5214 #define _T1GGO 0x08
5215 #define _NOT_T1DONE 0x08
5216 #define _T1DONE 0x08
5217 #define _T1GGO_NOT_DONE 0x08
5218 #define _T1GSPM 0x10
5219 #define _T1GTM 0x20
5220 #define _T1GPOL 0x40
5221 #define _TMR1GE 0x80
5223 //==============================================================================
5226 //==============================================================================
5227 // T1CON Bits
5229 extern __at(0x0FCD) __sfr T1CON;
5231 typedef union
5233 struct
5235 unsigned TMR1ON : 1;
5236 unsigned RD16 : 1;
5237 unsigned NOT_T1SYNC : 1;
5238 unsigned SOSCEN : 1;
5239 unsigned T1CKPS0 : 1;
5240 unsigned T1CKPS1 : 1;
5241 unsigned TMR1CS0 : 1;
5242 unsigned TMR1CS1 : 1;
5245 struct
5247 unsigned : 1;
5248 unsigned T1RD16 : 1;
5249 unsigned T1SYNC : 1;
5250 unsigned T1SOSCEN : 1;
5251 unsigned : 1;
5252 unsigned : 1;
5253 unsigned : 1;
5254 unsigned : 1;
5257 struct
5259 unsigned : 1;
5260 unsigned : 1;
5261 unsigned : 1;
5262 unsigned T1OSCEN : 1;
5263 unsigned : 1;
5264 unsigned : 1;
5265 unsigned : 1;
5266 unsigned : 1;
5269 struct
5271 unsigned : 4;
5272 unsigned T1CKPS : 2;
5273 unsigned : 2;
5276 struct
5278 unsigned : 6;
5279 unsigned TMR1CS : 2;
5281 } __T1CONbits_t;
5283 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5285 #define _TMR1ON 0x01
5286 #define _RD16 0x02
5287 #define _T1RD16 0x02
5288 #define _NOT_T1SYNC 0x04
5289 #define _T1SYNC 0x04
5290 #define _SOSCEN 0x08
5291 #define _T1SOSCEN 0x08
5292 #define _T1OSCEN 0x08
5293 #define _T1CKPS0 0x10
5294 #define _T1CKPS1 0x20
5295 #define _TMR1CS0 0x40
5296 #define _TMR1CS1 0x80
5298 //==============================================================================
5300 extern __at(0x0FCE) __sfr TMR1;
5301 extern __at(0x0FCE) __sfr TMR1L;
5302 extern __at(0x0FCF) __sfr TMR1H;
5304 //==============================================================================
5305 // RCON Bits
5307 extern __at(0x0FD0) __sfr RCON;
5309 typedef union
5311 struct
5313 unsigned NOT_BOR : 1;
5314 unsigned NOT_POR : 1;
5315 unsigned NOT_PD : 1;
5316 unsigned NOT_TO : 1;
5317 unsigned NOT_RI : 1;
5318 unsigned : 1;
5319 unsigned SBOREN : 1;
5320 unsigned IPEN : 1;
5323 struct
5325 unsigned BOR : 1;
5326 unsigned POR : 1;
5327 unsigned PD : 1;
5328 unsigned TO : 1;
5329 unsigned RI : 1;
5330 unsigned : 1;
5331 unsigned : 1;
5332 unsigned : 1;
5334 } __RCONbits_t;
5336 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5338 #define _NOT_BOR 0x01
5339 #define _BOR 0x01
5340 #define _NOT_POR 0x02
5341 #define _POR 0x02
5342 #define _NOT_PD 0x04
5343 #define _PD 0x04
5344 #define _NOT_TO 0x08
5345 #define _TO 0x08
5346 #define _NOT_RI 0x10
5347 #define _RI 0x10
5348 #define _SBOREN 0x40
5349 #define _IPEN 0x80
5351 //==============================================================================
5354 //==============================================================================
5355 // WDTCON Bits
5357 extern __at(0x0FD1) __sfr WDTCON;
5359 typedef union
5361 struct
5363 unsigned SWDTEN : 1;
5364 unsigned : 1;
5365 unsigned : 1;
5366 unsigned : 1;
5367 unsigned : 1;
5368 unsigned : 1;
5369 unsigned : 1;
5370 unsigned : 1;
5373 struct
5375 unsigned SWDTE : 1;
5376 unsigned : 1;
5377 unsigned : 1;
5378 unsigned : 1;
5379 unsigned : 1;
5380 unsigned : 1;
5381 unsigned : 1;
5382 unsigned : 1;
5384 } __WDTCONbits_t;
5386 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5388 #define _SWDTEN 0x01
5389 #define _SWDTE 0x01
5391 //==============================================================================
5394 //==============================================================================
5395 // OSCCON2 Bits
5397 extern __at(0x0FD2) __sfr OSCCON2;
5399 typedef struct
5401 unsigned LFIOFS : 1;
5402 unsigned HFIOFR : 1;
5403 unsigned PRISD : 1;
5404 unsigned SOSCGO : 1;
5405 unsigned PLLEN : 1;
5406 unsigned INTSRC : 1;
5407 unsigned SOSCRUN : 1;
5408 unsigned PLLRDY : 1;
5409 } __OSCCON2bits_t;
5411 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
5413 #define _LFIOFS 0x01
5414 #define _HFIOFR 0x02
5415 #define _PRISD 0x04
5416 #define _SOSCGO 0x08
5417 #define _PLLEN 0x10
5418 #define _INTSRC 0x20
5419 #define _SOSCRUN 0x40
5420 #define _PLLRDY 0x80
5422 //==============================================================================
5425 //==============================================================================
5426 // OSCCON Bits
5428 extern __at(0x0FD3) __sfr OSCCON;
5430 typedef union
5432 struct
5434 unsigned SCS0 : 1;
5435 unsigned SCS1 : 1;
5436 unsigned HFIOFS : 1;
5437 unsigned OSTS : 1;
5438 unsigned IRCF0 : 1;
5439 unsigned IRCF1 : 1;
5440 unsigned IRCF2 : 1;
5441 unsigned IDLEN : 1;
5444 struct
5446 unsigned : 1;
5447 unsigned : 1;
5448 unsigned FLTS : 1;
5449 unsigned : 1;
5450 unsigned : 1;
5451 unsigned : 1;
5452 unsigned : 1;
5453 unsigned : 1;
5456 struct
5458 unsigned SCS : 2;
5459 unsigned : 6;
5462 struct
5464 unsigned : 4;
5465 unsigned IRCF : 3;
5466 unsigned : 1;
5468 } __OSCCONbits_t;
5470 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5472 #define _SCS0 0x01
5473 #define _SCS1 0x02
5474 #define _HFIOFS 0x04
5475 #define _FLTS 0x04
5476 #define _OSTS 0x08
5477 #define _IRCF0 0x10
5478 #define _IRCF1 0x20
5479 #define _IRCF2 0x40
5480 #define _IDLEN 0x80
5482 //==============================================================================
5485 //==============================================================================
5486 // T0CON Bits
5488 extern __at(0x0FD5) __sfr T0CON;
5490 typedef union
5492 struct
5494 unsigned T0PS0 : 1;
5495 unsigned T0PS1 : 1;
5496 unsigned T0PS2 : 1;
5497 unsigned PSA : 1;
5498 unsigned T0SE : 1;
5499 unsigned T0CS : 1;
5500 unsigned T08BIT : 1;
5501 unsigned TMR0ON : 1;
5504 struct
5506 unsigned T0PS : 3;
5507 unsigned : 5;
5509 } __T0CONbits_t;
5511 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5513 #define _T0PS0 0x01
5514 #define _T0PS1 0x02
5515 #define _T0PS2 0x04
5516 #define _PSA 0x08
5517 #define _T0SE 0x10
5518 #define _T0CS 0x20
5519 #define _T08BIT 0x40
5520 #define _TMR0ON 0x80
5522 //==============================================================================
5524 extern __at(0x0FD6) __sfr TMR0;
5525 extern __at(0x0FD6) __sfr TMR0L;
5526 extern __at(0x0FD7) __sfr TMR0H;
5528 //==============================================================================
5529 // STATUS Bits
5531 extern __at(0x0FD8) __sfr STATUS;
5533 typedef struct
5535 unsigned C : 1;
5536 unsigned DC : 1;
5537 unsigned Z : 1;
5538 unsigned OV : 1;
5539 unsigned N : 1;
5540 unsigned : 1;
5541 unsigned : 1;
5542 unsigned : 1;
5543 } __STATUSbits_t;
5545 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5547 #define _C 0x01
5548 #define _DC 0x02
5549 #define _Z 0x04
5550 #define _OV 0x08
5551 #define _N 0x10
5553 //==============================================================================
5555 extern __at(0x0FD9) __sfr FSR2L;
5556 extern __at(0x0FDA) __sfr FSR2H;
5557 extern __at(0x0FDB) __sfr PLUSW2;
5558 extern __at(0x0FDC) __sfr PREINC2;
5559 extern __at(0x0FDD) __sfr POSTDEC2;
5560 extern __at(0x0FDE) __sfr POSTINC2;
5561 extern __at(0x0FDF) __sfr INDF2;
5562 extern __at(0x0FE0) __sfr BSR;
5563 extern __at(0x0FE1) __sfr FSR1L;
5564 extern __at(0x0FE2) __sfr FSR1H;
5565 extern __at(0x0FE3) __sfr PLUSW1;
5566 extern __at(0x0FE4) __sfr PREINC1;
5567 extern __at(0x0FE5) __sfr POSTDEC1;
5568 extern __at(0x0FE6) __sfr POSTINC1;
5569 extern __at(0x0FE7) __sfr INDF1;
5570 extern __at(0x0FE8) __sfr WREG;
5571 extern __at(0x0FE9) __sfr FSR0L;
5572 extern __at(0x0FEA) __sfr FSR0H;
5573 extern __at(0x0FEB) __sfr PLUSW0;
5574 extern __at(0x0FEC) __sfr PREINC0;
5575 extern __at(0x0FED) __sfr POSTDEC0;
5576 extern __at(0x0FEE) __sfr POSTINC0;
5577 extern __at(0x0FEF) __sfr INDF0;
5579 //==============================================================================
5580 // INTCON3 Bits
5582 extern __at(0x0FF0) __sfr INTCON3;
5584 typedef union
5586 struct
5588 unsigned INT1IF : 1;
5589 unsigned INT2IF : 1;
5590 unsigned : 1;
5591 unsigned INT1IE : 1;
5592 unsigned INT2IE : 1;
5593 unsigned : 1;
5594 unsigned INT1IP : 1;
5595 unsigned INT2IP : 1;
5598 struct
5600 unsigned INT1F : 1;
5601 unsigned INT2F : 1;
5602 unsigned : 1;
5603 unsigned INT1E : 1;
5604 unsigned INT2E : 1;
5605 unsigned : 1;
5606 unsigned INT1P : 1;
5607 unsigned INT2P : 1;
5609 } __INTCON3bits_t;
5611 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5613 #define _INT1IF 0x01
5614 #define _INT1F 0x01
5615 #define _INT2IF 0x02
5616 #define _INT2F 0x02
5617 #define _INT1IE 0x08
5618 #define _INT1E 0x08
5619 #define _INT2IE 0x10
5620 #define _INT2E 0x10
5621 #define _INT1IP 0x40
5622 #define _INT1P 0x40
5623 #define _INT2IP 0x80
5624 #define _INT2P 0x80
5626 //==============================================================================
5629 //==============================================================================
5630 // INTCON2 Bits
5632 extern __at(0x0FF1) __sfr INTCON2;
5634 typedef union
5636 struct
5638 unsigned IOCIP : 1;
5639 unsigned : 1;
5640 unsigned TMR0IP : 1;
5641 unsigned : 1;
5642 unsigned INTEDG2 : 1;
5643 unsigned INTEDG1 : 1;
5644 unsigned INTEDG0 : 1;
5645 unsigned NOT_RBPU : 1;
5648 struct
5650 unsigned : 1;
5651 unsigned : 1;
5652 unsigned T0IP : 1;
5653 unsigned : 1;
5654 unsigned : 1;
5655 unsigned : 1;
5656 unsigned : 1;
5657 unsigned RBPU : 1;
5659 } __INTCON2bits_t;
5661 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5663 #define _IOCIP 0x01
5664 #define _TMR0IP 0x04
5665 #define _T0IP 0x04
5666 #define _INTEDG2 0x10
5667 #define _INTEDG1 0x20
5668 #define _INTEDG0 0x40
5669 #define _NOT_RBPU 0x80
5670 #define _RBPU 0x80
5672 //==============================================================================
5675 //==============================================================================
5676 // INTCON Bits
5678 extern __at(0x0FF2) __sfr INTCON;
5680 typedef union
5682 struct
5684 unsigned IOCIF : 1;
5685 unsigned INT0IF : 1;
5686 unsigned TMR0IF : 1;
5687 unsigned IOCIE : 1;
5688 unsigned INT0IE : 1;
5689 unsigned TMR0IE : 1;
5690 unsigned PEIE_GIEL : 1;
5691 unsigned GIE_GIEH : 1;
5694 struct
5696 unsigned : 1;
5697 unsigned INT0F : 1;
5698 unsigned T0IF : 1;
5699 unsigned : 1;
5700 unsigned INT0E : 1;
5701 unsigned T0IE : 1;
5702 unsigned PEIE : 1;
5703 unsigned GIE : 1;
5706 struct
5708 unsigned : 1;
5709 unsigned : 1;
5710 unsigned : 1;
5711 unsigned : 1;
5712 unsigned : 1;
5713 unsigned : 1;
5714 unsigned GIEL : 1;
5715 unsigned GIEH : 1;
5717 } __INTCONbits_t;
5719 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5721 #define _IOCIF 0x01
5722 #define _INT0IF 0x02
5723 #define _INT0F 0x02
5724 #define _TMR0IF 0x04
5725 #define _T0IF 0x04
5726 #define _IOCIE 0x08
5727 #define _INT0IE 0x10
5728 #define _INT0E 0x10
5729 #define _TMR0IE 0x20
5730 #define _T0IE 0x20
5731 #define _PEIE_GIEL 0x40
5732 #define _PEIE 0x40
5733 #define _GIEL 0x40
5734 #define _GIE_GIEH 0x80
5735 #define _GIE 0x80
5736 #define _GIEH 0x80
5738 //==============================================================================
5740 extern __at(0x0FF3) __sfr PROD;
5741 extern __at(0x0FF3) __sfr PRODL;
5742 extern __at(0x0FF4) __sfr PRODH;
5743 extern __at(0x0FF5) __sfr TABLAT;
5744 extern __at(0x0FF6) __sfr TBLPTR;
5745 extern __at(0x0FF6) __sfr TBLPTRL;
5746 extern __at(0x0FF7) __sfr TBLPTRH;
5747 extern __at(0x0FF8) __sfr TBLPTRU;
5748 extern __at(0x0FF9) __sfr PC;
5749 extern __at(0x0FF9) __sfr PCL;
5750 extern __at(0x0FFA) __sfr PCLATH;
5751 extern __at(0x0FFB) __sfr PCLATU;
5753 //==============================================================================
5754 // STKPTR Bits
5756 extern __at(0x0FFC) __sfr STKPTR;
5758 typedef union
5760 struct
5762 unsigned SP0 : 1;
5763 unsigned SP1 : 1;
5764 unsigned SP2 : 1;
5765 unsigned SP3 : 1;
5766 unsigned SP4 : 1;
5767 unsigned : 1;
5768 unsigned STKUNF : 1;
5769 unsigned STKFUL : 1;
5772 struct
5774 unsigned : 1;
5775 unsigned : 1;
5776 unsigned : 1;
5777 unsigned : 1;
5778 unsigned : 1;
5779 unsigned : 1;
5780 unsigned : 1;
5781 unsigned STKOVF : 1;
5784 struct
5786 unsigned SP : 5;
5787 unsigned : 3;
5789 } __STKPTRbits_t;
5791 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5793 #define _SP0 0x01
5794 #define _SP1 0x02
5795 #define _SP2 0x04
5796 #define _SP3 0x08
5797 #define _SP4 0x10
5798 #define _STKUNF 0x40
5799 #define _STKFUL 0x80
5800 #define _STKOVF 0x80
5802 //==============================================================================
5804 extern __at(0x0FFD) __sfr TOS;
5805 extern __at(0x0FFD) __sfr TOSL;
5806 extern __at(0x0FFE) __sfr TOSH;
5807 extern __at(0x0FFF) __sfr TOSU;
5809 //==============================================================================
5811 // Configuration Bits
5813 //==============================================================================
5815 #define __CONFIG1L 0x300000
5816 #define __CONFIG1H 0x300001
5817 #define __CONFIG2L 0x300002
5818 #define __CONFIG2H 0x300003
5819 #define __CONFIG3H 0x300005
5820 #define __CONFIG4L 0x300006
5821 #define __CONFIG5L 0x300008
5822 #define __CONFIG5H 0x300009
5823 #define __CONFIG6L 0x30000A
5824 #define __CONFIG6H 0x30000B
5825 #define __CONFIG7L 0x30000C
5826 #define __CONFIG7H 0x30000D
5828 //----------------------------- CONFIG1L Options -------------------------------
5830 #define _PLLSEL_PLL4X_1L 0xFE // 4x clock multiplier.
5831 #define _PLLSEL_PLL3X_1L 0xFF // 3x clock multiplier.
5832 #define _CFGPLLEN_OFF_1L 0xFD // PLL Disabled (firmware controlled).
5833 #define _CFGPLLEN_ON_1L 0xFF // PLL Enabled.
5834 #define _CPUDIV_NOCLKDIV_1L 0xE7 // CPU uses system clock (no divide).
5835 #define _CPUDIV_CLKDIV2_1L 0xEF // CPU uses system clock divided by 2.
5836 #define _CPUDIV_CLKDIV3_1L 0xF7 // CPU uses system clock divided by 3.
5837 #define _CPUDIV_CLKDIV6_1L 0xFF // CPU uses system clock divided by 6.
5838 #define _LS48MHZ_SYS24X4_1L 0xDF // System clock at 24 MHz, USB clock divider is set to 4.
5839 #define _LS48MHZ_SYS48X8_1L 0xFF // System clock at 48 MHz, USB clock divider is set to 8.
5841 //----------------------------- CONFIG1H Options -------------------------------
5843 #define _FOSC_LP_1H 0xF0 // LP oscillator.
5844 #define _FOSC_XT_1H 0xF1 // XT oscillator.
5845 #define _FOSC_HSH_1H 0xF2 // HS oscillator, high power 16MHz to 25MHz.
5846 #define _FOSC_HSM_1H 0xF3 // HS oscillator, medium power 4MHz to 16MHz.
5847 #define _FOSC_ECHCLKO_1H 0xF4 // EC oscillator, high power 16MHz to 48MHz, clock output on OSC2.
5848 #define _FOSC_ECHIO_1H 0xF5 // EC oscillator, high power 16MHz to 48MHz.
5849 #define _FOSC_RCCLKO_1H 0xF6 // External RC oscillator, clock output on OSC2.
5850 #define _FOSC_RCIO_1H 0xF7 // External RC oscillator.
5851 #define _FOSC_INTOSCIO_1H 0xF8 // Internal oscillator.
5852 #define _FOSC_INTOSCCLKO_1H 0xF9 // Internal oscillator, clock output on OSC2.
5853 #define _FOSC_ECMCLKO_1H 0xFA // EC oscillator, medium power 4MHz to 16MHz, clock output on OSC2.
5854 #define _FOSC_ECMIO_1H 0xFB // EC oscillator, medium power 4MHz to 16MHz.
5855 #define _FOSC_ECLCLKO_1H 0xFC // EC oscillator, low power <4MHz, clock output on OSC2.
5856 #define _FOSC_ECLIO_1H 0xFD // EC oscillator, low power <4MHz.
5857 #define _PCLKEN_OFF_1H 0xDF // Primary oscillator shutdown firmware controlled.
5858 #define _PCLKEN_ON_1H 0xFF // Primary oscillator enabled.
5859 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
5860 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
5861 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
5862 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
5864 //----------------------------- CONFIG2L Options -------------------------------
5866 #define _nPWRTEN_ON_2L 0xFE // Power up timer enabled.
5867 #define _nPWRTEN_OFF_2L 0xFF // Power up timer disabled.
5868 #define _BOREN_OFF_2L 0xF9 // BOR disabled in hardware (SBOREN is ignored).
5869 #define _BOREN_ON_2L 0xFB // BOR controlled by firmware (SBOREN is enabled).
5870 #define _BOREN_NOSLP_2L 0xFD // BOR enabled in hardware, disabled in Sleep mode (SBOREN is ignored).
5871 #define _BOREN_SBORDIS_2L 0xFF // BOR enabled in hardware (SBOREN is ignored).
5872 #define _BORV_285_2L 0xE7 // BOR set to 2.85V nominal.
5873 #define _BORV_250_2L 0xEF // BOR set to 2.5V nominal.
5874 #define _BORV_220_2L 0xF7 // BOR set to 2.2V nominal.
5875 #define _BORV_190_2L 0xFF // BOR set to 1.9V nominal.
5876 #define _nLPBOR_ON_2L 0xBF // Low-Power Brown-out Reset enabled.
5877 #define _nLPBOR_OFF_2L 0xFF // Low-Power Brown-out Reset disabled.
5879 //----------------------------- CONFIG2H Options -------------------------------
5881 #define _WDTEN_OFF_2H 0xFC // WDT disabled in hardware (SWDTEN ignored).
5882 #define _WDTEN_NOSLP_2H 0xFD // WDT enabled in hardware, disabled in Sleep mode (SWDTEN ignored).
5883 #define _WDTEN_SWON_2H 0xFE // WDT controlled by firmware (SWDTEN enabled).
5884 #define _WDTEN_ON_2H 0xFF // WDT enabled in hardware (SWDTEN ignored).
5885 #define _WDTPS_1_2H 0xC3 // 1:1.
5886 #define _WDTPS_2_2H 0xC7 // 1:2.
5887 #define _WDTPS_4_2H 0xCB // 1:4.
5888 #define _WDTPS_8_2H 0xCF // 1:8.
5889 #define _WDTPS_16_2H 0xD3 // 1:16.
5890 #define _WDTPS_32_2H 0xD7 // 1:32.
5891 #define _WDTPS_64_2H 0xDB // 1:64.
5892 #define _WDTPS_128_2H 0xDF // 1:128.
5893 #define _WDTPS_256_2H 0xE3 // 1:256.
5894 #define _WDTPS_512_2H 0xE7 // 1:512.
5895 #define _WDTPS_1024_2H 0xEB // 1:1024.
5896 #define _WDTPS_2048_2H 0xEF // 1:2048.
5897 #define _WDTPS_4096_2H 0xF3 // 1:4096.
5898 #define _WDTPS_8192_2H 0xF7 // 1:8192.
5899 #define _WDTPS_16384_2H 0xFB // 1:16384.
5900 #define _WDTPS_32768_2H 0xFF // 1:32768.
5902 //----------------------------- CONFIG3H Options -------------------------------
5904 #define _CCP2MX_RB3_3H 0xFE // CCP2 input/output is multiplexed with RB3.
5905 #define _CCP2MX_RC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
5906 #define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset.
5907 #define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset.
5908 #define _T3CMX_RB5_3H 0xEF // T3CKI function is on RB5.
5909 #define _T3CMX_RC0_3H 0xFF // T3CKI function is on RC0.
5910 #define _SDOMX_RC7_3H 0xBF // SDO function is on RC7.
5911 #define _SDOMX_RB3_3H 0xFF // SDO function is on RB3.
5912 #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; external MCLR disabled.
5913 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input disabled.
5915 //----------------------------- CONFIG4L Options -------------------------------
5917 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
5918 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
5919 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
5920 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1.
5921 #define _ICPRT_OFF_4L 0xDF // ICPORT disabled.
5922 #define _ICPRT_ON_4L 0xFF // ICPORT enabled.
5923 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled.
5924 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
5925 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
5926 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
5928 //----------------------------- CONFIG5L Options -------------------------------
5930 #define _CP0_ON_5L 0xFE // Block 0 is code-protected.
5931 #define _CP0_OFF_5L 0xFF // Block 0 is not code-protected.
5932 #define _CP1_ON_5L 0xFD // Block 1 is code-protected.
5933 #define _CP1_OFF_5L 0xFF // Block 1 is not code-protected.
5934 #define _CP2_ON_5L 0xFB // Block 2 is code-protected.
5935 #define _CP2_OFF_5L 0xFF // Block 2 is not code-protected.
5936 #define _CP3_ON_5L 0xF7 // Block 3 is code-protected.
5937 #define _CP3_OFF_5L 0xFF // Block 3 is not code-protected.
5939 //----------------------------- CONFIG5H Options -------------------------------
5941 #define _CPB_ON_5H 0xBF // Boot block is code-protected.
5942 #define _CPB_OFF_5H 0xFF // Boot block is not code-protected.
5943 #define _CPD_ON_5H 0x7F // Data EEPROM is code-protected.
5944 #define _CPD_OFF_5H 0xFF // Data EEPROM is not code-protected.
5946 //----------------------------- CONFIG6L Options -------------------------------
5948 #define _WRT0_ON_6L 0xFE // Block 0 (0800-1FFFh) is write-protected.
5949 #define _WRT0_OFF_6L 0xFF // Block 0 (0800-1FFFh) is not write-protected.
5950 #define _WRT1_ON_6L 0xFD // Block 1 (2000-3FFFh) is write-protected.
5951 #define _WRT1_OFF_6L 0xFF // Block 1 (2000-3FFFh) is not write-protected.
5952 #define _WRT2_ON_6L 0xFB // Block 2 (04000-5FFFh) is write-protected.
5953 #define _WRT2_OFF_6L 0xFF // Block 2 (04000-5FFFh) is not write-protected.
5954 #define _WRT3_ON_6L 0xF7 // Block 3 (06000-7FFFh) is write-protected.
5955 #define _WRT3_OFF_6L 0xFF // Block 3 (06000-7FFFh) is not write-protected.
5957 //----------------------------- CONFIG6H Options -------------------------------
5959 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) are write-protected.
5960 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) are not write-protected.
5961 #define _WRTB_ON_6H 0xBF // Boot block (0000-7FFh) is write-protected.
5962 #define _WRTB_OFF_6H 0xFF // Boot block (0000-7FFh) is not write-protected.
5963 #define _WRTD_ON_6H 0x7F // Data EEPROM is write-protected.
5964 #define _WRTD_OFF_6H 0xFF // Data EEPROM is not write-protected.
5966 //----------------------------- CONFIG7L Options -------------------------------
5968 #define _EBTR0_ON_7L 0xFE // Block 0 is protected from table reads executed in other blocks.
5969 #define _EBTR0_OFF_7L 0xFF // Block 0 is not protected from table reads executed in other blocks.
5970 #define _EBTR1_ON_7L 0xFD // Block 1 is protected from table reads executed in other blocks.
5971 #define _EBTR1_OFF_7L 0xFF // Block 1 is not protected from table reads executed in other blocks.
5972 #define _EBTR2_ON_7L 0xFB // Block 2 is protected from table reads executed in other blocks.
5973 #define _EBTR2_OFF_7L 0xFF // Block 2 is not protected from table reads executed in other blocks.
5974 #define _EBTR3_ON_7L 0xF7 // Block 3 is protected from table reads executed in other blocks.
5975 #define _EBTR3_OFF_7L 0xFF // Block 3 is not protected from table reads executed in other blocks.
5977 //----------------------------- CONFIG7H Options -------------------------------
5979 #define _EBTRB_ON_7H 0xBF // Boot block is protected from table reads executed in other blocks.
5980 #define _EBTRB_OFF_7H 0xFF // Boot block is not protected from table reads executed in other blocks.
5982 //==============================================================================
5984 #define __DEVID1 0x3FFFFE
5985 #define __DEVID2 0x3FFFFF
5987 #define __IDLOC0 0x200000
5988 #define __IDLOC1 0x200001
5989 #define __IDLOC2 0x200002
5990 #define __IDLOC3 0x200003
5991 #define __IDLOC4 0x200004
5992 #define __IDLOC5 0x200005
5993 #define __IDLOC6 0x200006
5994 #define __IDLOC7 0x200007
5996 #endif // #ifndef __PIC18F45K50_H__