struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18lf45k50.h
blob92fbe6c47dd591bf078a9e31b9b2c6cf56445ae0
1 /*
2 * This declarations of the PIC18LF45K50 MCU.
4 * This file is part of the GNU PIC library for SDCC, originally
5 * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
7 * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:56 UTC.
9 * SDCC is licensed under the GNU Public license (GPL) v2. Note that
10 * this license covers the code to the compiler and other executables,
11 * but explicitly does not cover any code or objects generated by sdcc.
13 * For pic device libraries and header files which are derived from
14 * Microchip header (.inc) and linker script (.lkr) files Microchip
15 * requires that "The header files should state that they are only to be
16 * used with authentic Microchip devices" which makes them incompatible
17 * with the GPL. Pic device libraries and header files are located at
18 * non-free/lib and non-free/include directories respectively.
19 * Sdcc should be run with the --use-non-free command line option in
20 * order to include non-free header files and libraries.
22 * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
25 #ifndef __PIC18LF45K50_H__
26 #define __PIC18LF45K50_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // SRCON1 Bits
40 extern __at(0x0F57) __sfr SRCON1;
42 typedef struct
44 unsigned SRRC1E : 1;
45 unsigned SRRC2E : 1;
46 unsigned SRRCKE : 1;
47 unsigned SRRPE : 1;
48 unsigned SRSC1E : 1;
49 unsigned SRSC2E : 1;
50 unsigned SRSCKE : 1;
51 unsigned SRSPE : 1;
52 } __SRCON1bits_t;
54 extern __at(0x0F57) volatile __SRCON1bits_t SRCON1bits;
56 #define _SRRC1E 0x01
57 #define _SRRC2E 0x02
58 #define _SRRCKE 0x04
59 #define _SRRPE 0x08
60 #define _SRSC1E 0x10
61 #define _SRSC2E 0x20
62 #define _SRSCKE 0x40
63 #define _SRSPE 0x80
65 //==============================================================================
68 //==============================================================================
69 // SRCON0 Bits
71 extern __at(0x0F58) __sfr SRCON0;
73 typedef union
75 struct
77 unsigned SRPR : 1;
78 unsigned SRPS : 1;
79 unsigned SRNQEN : 1;
80 unsigned SRQEN : 1;
81 unsigned SRCLK0 : 1;
82 unsigned SRCLK1 : 1;
83 unsigned SRCLK2 : 1;
84 unsigned SRLEN : 1;
87 struct
89 unsigned : 4;
90 unsigned SRCLK : 3;
91 unsigned : 1;
93 } __SRCON0bits_t;
95 extern __at(0x0F58) volatile __SRCON0bits_t SRCON0bits;
97 #define _SRPR 0x01
98 #define _SRPS 0x02
99 #define _SRNQEN 0x04
100 #define _SRQEN 0x08
101 #define _SRCLK0 0x10
102 #define _SRCLK1 0x20
103 #define _SRCLK2 0x40
104 #define _SRLEN 0x80
106 //==============================================================================
109 //==============================================================================
110 // CCPTMRS Bits
112 extern __at(0x0F59) __sfr CCPTMRS;
114 typedef struct
116 unsigned C1TSEL : 1;
117 unsigned : 1;
118 unsigned : 1;
119 unsigned C2TSEL : 1;
120 unsigned : 1;
121 unsigned : 1;
122 unsigned : 1;
123 unsigned : 1;
124 } __CCPTMRSbits_t;
126 extern __at(0x0F59) volatile __CCPTMRSbits_t CCPTMRSbits;
128 #define _C1TSEL 0x01
129 #define _C2TSEL 0x08
131 //==============================================================================
134 //==============================================================================
135 // ANSELA Bits
137 extern __at(0x0F5B) __sfr ANSELA;
139 typedef struct
141 unsigned ANSA0 : 1;
142 unsigned ANSA1 : 1;
143 unsigned ANSA2 : 1;
144 unsigned ANSA3 : 1;
145 unsigned : 1;
146 unsigned ANSA5 : 1;
147 unsigned : 1;
148 unsigned : 1;
149 } __ANSELAbits_t;
151 extern __at(0x0F5B) volatile __ANSELAbits_t ANSELAbits;
153 #define _ANSA0 0x01
154 #define _ANSA1 0x02
155 #define _ANSA2 0x04
156 #define _ANSA3 0x08
157 #define _ANSA5 0x20
159 //==============================================================================
162 //==============================================================================
163 // ANSELB Bits
165 extern __at(0x0F5C) __sfr ANSELB;
167 typedef union
169 struct
171 unsigned ANSB0 : 1;
172 unsigned ANSB1 : 1;
173 unsigned ANSB2 : 1;
174 unsigned ANSB3 : 1;
175 unsigned ANSB4 : 1;
176 unsigned ANSB5 : 1;
177 unsigned : 1;
178 unsigned : 1;
181 struct
183 unsigned ANSB : 6;
184 unsigned : 2;
186 } __ANSELBbits_t;
188 extern __at(0x0F5C) volatile __ANSELBbits_t ANSELBbits;
190 #define _ANSB0 0x01
191 #define _ANSB1 0x02
192 #define _ANSB2 0x04
193 #define _ANSB3 0x08
194 #define _ANSB4 0x10
195 #define _ANSB5 0x20
197 //==============================================================================
200 //==============================================================================
201 // ANSELC Bits
203 extern __at(0x0F5D) __sfr ANSELC;
205 typedef struct
207 unsigned : 1;
208 unsigned : 1;
209 unsigned ANSC2 : 1;
210 unsigned : 1;
211 unsigned : 1;
212 unsigned : 1;
213 unsigned ANSC6 : 1;
214 unsigned ANSC7 : 1;
215 } __ANSELCbits_t;
217 extern __at(0x0F5D) volatile __ANSELCbits_t ANSELCbits;
219 #define _ANSC2 0x04
220 #define _ANSC6 0x40
221 #define _ANSC7 0x80
223 //==============================================================================
226 //==============================================================================
227 // ANSELD Bits
229 extern __at(0x0F5E) __sfr ANSELD;
231 typedef struct
233 unsigned ANSD0 : 1;
234 unsigned ANSD1 : 1;
235 unsigned ANSD2 : 1;
236 unsigned ANSD3 : 1;
237 unsigned ANSD4 : 1;
238 unsigned ANSD5 : 1;
239 unsigned ANSD6 : 1;
240 unsigned ANSD7 : 1;
241 } __ANSELDbits_t;
243 extern __at(0x0F5E) volatile __ANSELDbits_t ANSELDbits;
245 #define _ANSD0 0x01
246 #define _ANSD1 0x02
247 #define _ANSD2 0x04
248 #define _ANSD3 0x08
249 #define _ANSD4 0x10
250 #define _ANSD5 0x20
251 #define _ANSD6 0x40
252 #define _ANSD7 0x80
254 //==============================================================================
257 //==============================================================================
258 // ANSELE Bits
260 extern __at(0x0F5F) __sfr ANSELE;
262 typedef union
264 struct
266 unsigned ANSE0 : 1;
267 unsigned ANSE1 : 1;
268 unsigned ANSE2 : 1;
269 unsigned : 1;
270 unsigned : 1;
271 unsigned : 1;
272 unsigned : 1;
273 unsigned : 1;
276 struct
278 unsigned ANSE : 3;
279 unsigned : 5;
281 } __ANSELEbits_t;
283 extern __at(0x0F5F) volatile __ANSELEbits_t ANSELEbits;
285 #define _ANSE0 0x01
286 #define _ANSE1 0x02
287 #define _ANSE2 0x04
289 //==============================================================================
292 //==============================================================================
293 // UCON Bits
295 extern __at(0x0F60) __sfr UCON;
297 typedef struct
299 unsigned : 1;
300 unsigned SUSPND : 1;
301 unsigned RESUME : 1;
302 unsigned USBEN : 1;
303 unsigned PKTDIS : 1;
304 unsigned SE0 : 1;
305 unsigned PPBRST : 1;
306 unsigned : 1;
307 } __UCONbits_t;
309 extern __at(0x0F60) volatile __UCONbits_t UCONbits;
311 #define _SUSPND 0x02
312 #define _RESUME 0x04
313 #define _USBEN 0x08
314 #define _PKTDIS 0x10
315 #define _SE0 0x20
316 #define _PPBRST 0x40
318 //==============================================================================
321 //==============================================================================
322 // USTAT Bits
324 extern __at(0x0F61) __sfr USTAT;
326 typedef union
328 struct
330 unsigned : 1;
331 unsigned PPBI : 1;
332 unsigned DIR : 1;
333 unsigned ENDP0 : 1;
334 unsigned ENDP1 : 1;
335 unsigned ENDP2 : 1;
336 unsigned ENDP3 : 1;
337 unsigned : 1;
340 struct
342 unsigned : 3;
343 unsigned ENDP : 4;
344 unsigned : 1;
346 } __USTATbits_t;
348 extern __at(0x0F61) volatile __USTATbits_t USTATbits;
350 #define _PPBI 0x02
351 #define _DIR 0x04
352 #define _ENDP0 0x08
353 #define _ENDP1 0x10
354 #define _ENDP2 0x20
355 #define _ENDP3 0x40
357 //==============================================================================
360 //==============================================================================
361 // UCFG Bits
363 extern __at(0x0F62) __sfr UCFG;
365 typedef union
367 struct
369 unsigned PPB0 : 1;
370 unsigned PPB1 : 1;
371 unsigned FSEN : 1;
372 unsigned UTRDIS : 1;
373 unsigned UPUEN : 1;
374 unsigned : 1;
375 unsigned UOEMON : 1;
376 unsigned UTEYE : 1;
379 struct
381 unsigned PPB : 2;
382 unsigned : 6;
384 } __UCFGbits_t;
386 extern __at(0x0F62) volatile __UCFGbits_t UCFGbits;
388 #define _PPB0 0x01
389 #define _PPB1 0x02
390 #define _FSEN 0x04
391 #define _UTRDIS 0x08
392 #define _UPUEN 0x10
393 #define _UOEMON 0x40
394 #define _UTEYE 0x80
396 //==============================================================================
399 //==============================================================================
400 // UADDR Bits
402 extern __at(0x0F63) __sfr UADDR;
404 typedef union
406 struct
408 unsigned ADDR0 : 1;
409 unsigned ADDR1 : 1;
410 unsigned ADDR2 : 1;
411 unsigned ADDR3 : 1;
412 unsigned ADDR4 : 1;
413 unsigned ADDR5 : 1;
414 unsigned ADDR6 : 1;
415 unsigned : 1;
418 struct
420 unsigned ADDR : 7;
421 unsigned : 1;
423 } __UADDRbits_t;
425 extern __at(0x0F63) volatile __UADDRbits_t UADDRbits;
427 #define _ADDR0 0x01
428 #define _ADDR1 0x02
429 #define _ADDR2 0x04
430 #define _ADDR3 0x08
431 #define _ADDR4 0x10
432 #define _ADDR5 0x20
433 #define _ADDR6 0x40
435 //==============================================================================
438 //==============================================================================
439 // UIE Bits
441 extern __at(0x0F64) __sfr UIE;
443 typedef struct
445 unsigned URSTIE : 1;
446 unsigned UERRIE : 1;
447 unsigned ACTVIE : 1;
448 unsigned TRNIE : 1;
449 unsigned IDLEIE : 1;
450 unsigned STALLIE : 1;
451 unsigned SOFIE : 1;
452 unsigned : 1;
453 } __UIEbits_t;
455 extern __at(0x0F64) volatile __UIEbits_t UIEbits;
457 #define _URSTIE 0x01
458 #define _UERRIE 0x02
459 #define _ACTVIE 0x04
460 #define _TRNIE 0x08
461 #define _IDLEIE 0x10
462 #define _STALLIE 0x20
463 #define _SOFIE 0x40
465 //==============================================================================
468 //==============================================================================
469 // UIR Bits
471 extern __at(0x0F65) __sfr UIR;
473 typedef struct
475 unsigned URSTIF : 1;
476 unsigned UERRIF : 1;
477 unsigned ACTVIF : 1;
478 unsigned TRNIF : 1;
479 unsigned IDLEIF : 1;
480 unsigned STALLIF : 1;
481 unsigned SOFIF : 1;
482 unsigned : 1;
483 } __UIRbits_t;
485 extern __at(0x0F65) volatile __UIRbits_t UIRbits;
487 #define _URSTIF 0x01
488 #define _UERRIF 0x02
489 #define _ACTVIF 0x04
490 #define _TRNIF 0x08
491 #define _IDLEIF 0x10
492 #define _STALLIF 0x20
493 #define _SOFIF 0x40
495 //==============================================================================
498 //==============================================================================
499 // UEIE Bits
501 extern __at(0x0F66) __sfr UEIE;
503 typedef struct
505 unsigned PIDEE : 1;
506 unsigned CRC5EE : 1;
507 unsigned CRC16EE : 1;
508 unsigned DFN8EE : 1;
509 unsigned BTOEE : 1;
510 unsigned : 1;
511 unsigned : 1;
512 unsigned BTSEE : 1;
513 } __UEIEbits_t;
515 extern __at(0x0F66) volatile __UEIEbits_t UEIEbits;
517 #define _PIDEE 0x01
518 #define _CRC5EE 0x02
519 #define _CRC16EE 0x04
520 #define _DFN8EE 0x08
521 #define _BTOEE 0x10
522 #define _BTSEE 0x80
524 //==============================================================================
527 //==============================================================================
528 // UEIR Bits
530 extern __at(0x0F67) __sfr UEIR;
532 typedef struct
534 unsigned PIDEF : 1;
535 unsigned CRC5EF : 1;
536 unsigned CRC16EF : 1;
537 unsigned DFN8EF : 1;
538 unsigned BTOEF : 1;
539 unsigned : 1;
540 unsigned : 1;
541 unsigned BTSEF : 1;
542 } __UEIRbits_t;
544 extern __at(0x0F67) volatile __UEIRbits_t UEIRbits;
546 #define _PIDEF 0x01
547 #define _CRC5EF 0x02
548 #define _CRC16EF 0x04
549 #define _DFN8EF 0x08
550 #define _BTOEF 0x10
551 #define _BTSEF 0x80
553 //==============================================================================
555 extern __at(0x0F68) __sfr UFRM;
557 //==============================================================================
558 // UFRML Bits
560 extern __at(0x0F68) __sfr UFRML;
562 typedef struct
564 unsigned FRM0 : 1;
565 unsigned FRM1 : 1;
566 unsigned FRM2 : 1;
567 unsigned FRM3 : 1;
568 unsigned FRM4 : 1;
569 unsigned FRM5 : 1;
570 unsigned FRM6 : 1;
571 unsigned FRM7 : 1;
572 } __UFRMLbits_t;
574 extern __at(0x0F68) volatile __UFRMLbits_t UFRMLbits;
576 #define _FRM0 0x01
577 #define _FRM1 0x02
578 #define _FRM2 0x04
579 #define _FRM3 0x08
580 #define _FRM4 0x10
581 #define _FRM5 0x20
582 #define _FRM6 0x40
583 #define _FRM7 0x80
585 //==============================================================================
588 //==============================================================================
589 // UFRMH Bits
591 extern __at(0x0F69) __sfr UFRMH;
593 typedef struct
595 unsigned FRM8 : 1;
596 unsigned FRM9 : 1;
597 unsigned FRM10 : 1;
598 unsigned : 1;
599 unsigned : 1;
600 unsigned : 1;
601 unsigned : 1;
602 unsigned : 1;
603 } __UFRMHbits_t;
605 extern __at(0x0F69) volatile __UFRMHbits_t UFRMHbits;
607 #define _FRM8 0x01
608 #define _FRM9 0x02
609 #define _FRM10 0x04
611 //==============================================================================
614 //==============================================================================
615 // UEP0 Bits
617 extern __at(0x0F6A) __sfr UEP0;
619 typedef struct
621 unsigned EPSTALL : 1;
622 unsigned EPINEN : 1;
623 unsigned EPOUTEN : 1;
624 unsigned EPCONDIS : 1;
625 unsigned EPHSHK : 1;
626 unsigned : 1;
627 unsigned : 1;
628 unsigned : 1;
629 } __UEP0bits_t;
631 extern __at(0x0F6A) volatile __UEP0bits_t UEP0bits;
633 #define _EPSTALL 0x01
634 #define _EPINEN 0x02
635 #define _EPOUTEN 0x04
636 #define _EPCONDIS 0x08
637 #define _EPHSHK 0x10
639 //==============================================================================
642 //==============================================================================
643 // UEP1 Bits
645 extern __at(0x0F6B) __sfr UEP1;
647 typedef struct
649 unsigned EPSTALL : 1;
650 unsigned EPINEN : 1;
651 unsigned EPOUTEN : 1;
652 unsigned EPCONDIS : 1;
653 unsigned EPHSHK : 1;
654 unsigned : 1;
655 unsigned : 1;
656 unsigned : 1;
657 } __UEP1bits_t;
659 extern __at(0x0F6B) volatile __UEP1bits_t UEP1bits;
661 #define _UEP1_EPSTALL 0x01
662 #define _UEP1_EPINEN 0x02
663 #define _UEP1_EPOUTEN 0x04
664 #define _UEP1_EPCONDIS 0x08
665 #define _UEP1_EPHSHK 0x10
667 //==============================================================================
670 //==============================================================================
671 // UEP2 Bits
673 extern __at(0x0F6C) __sfr UEP2;
675 typedef struct
677 unsigned EPSTALL : 1;
678 unsigned EPINEN : 1;
679 unsigned EPOUTEN : 1;
680 unsigned EPCONDIS : 1;
681 unsigned EPHSHK : 1;
682 unsigned : 1;
683 unsigned : 1;
684 unsigned : 1;
685 } __UEP2bits_t;
687 extern __at(0x0F6C) volatile __UEP2bits_t UEP2bits;
689 #define _UEP2_EPSTALL 0x01
690 #define _UEP2_EPINEN 0x02
691 #define _UEP2_EPOUTEN 0x04
692 #define _UEP2_EPCONDIS 0x08
693 #define _UEP2_EPHSHK 0x10
695 //==============================================================================
698 //==============================================================================
699 // UEP3 Bits
701 extern __at(0x0F6D) __sfr UEP3;
703 typedef struct
705 unsigned EPSTALL : 1;
706 unsigned EPINEN : 1;
707 unsigned EPOUTEN : 1;
708 unsigned EPCONDIS : 1;
709 unsigned EPHSHK : 1;
710 unsigned : 1;
711 unsigned : 1;
712 unsigned : 1;
713 } __UEP3bits_t;
715 extern __at(0x0F6D) volatile __UEP3bits_t UEP3bits;
717 #define _UEP3_EPSTALL 0x01
718 #define _UEP3_EPINEN 0x02
719 #define _UEP3_EPOUTEN 0x04
720 #define _UEP3_EPCONDIS 0x08
721 #define _UEP3_EPHSHK 0x10
723 //==============================================================================
726 //==============================================================================
727 // UEP4 Bits
729 extern __at(0x0F6E) __sfr UEP4;
731 typedef struct
733 unsigned EPSTALL : 1;
734 unsigned EPINEN : 1;
735 unsigned EPOUTEN : 1;
736 unsigned EPCONDIS : 1;
737 unsigned EPHSHK : 1;
738 unsigned : 1;
739 unsigned : 1;
740 unsigned : 1;
741 } __UEP4bits_t;
743 extern __at(0x0F6E) volatile __UEP4bits_t UEP4bits;
745 #define _UEP4_EPSTALL 0x01
746 #define _UEP4_EPINEN 0x02
747 #define _UEP4_EPOUTEN 0x04
748 #define _UEP4_EPCONDIS 0x08
749 #define _UEP4_EPHSHK 0x10
751 //==============================================================================
754 //==============================================================================
755 // UEP5 Bits
757 extern __at(0x0F6F) __sfr UEP5;
759 typedef struct
761 unsigned EPSTALL : 1;
762 unsigned EPINEN : 1;
763 unsigned EPOUTEN : 1;
764 unsigned EPCONDIS : 1;
765 unsigned EPHSHK : 1;
766 unsigned : 1;
767 unsigned : 1;
768 unsigned : 1;
769 } __UEP5bits_t;
771 extern __at(0x0F6F) volatile __UEP5bits_t UEP5bits;
773 #define _UEP5_EPSTALL 0x01
774 #define _UEP5_EPINEN 0x02
775 #define _UEP5_EPOUTEN 0x04
776 #define _UEP5_EPCONDIS 0x08
777 #define _UEP5_EPHSHK 0x10
779 //==============================================================================
782 //==============================================================================
783 // UEP6 Bits
785 extern __at(0x0F70) __sfr UEP6;
787 typedef struct
789 unsigned EPSTALL : 1;
790 unsigned EPINEN : 1;
791 unsigned EPOUTEN : 1;
792 unsigned EPCONDIS : 1;
793 unsigned EPHSHK : 1;
794 unsigned : 1;
795 unsigned : 1;
796 unsigned : 1;
797 } __UEP6bits_t;
799 extern __at(0x0F70) volatile __UEP6bits_t UEP6bits;
801 #define _UEP6_EPSTALL 0x01
802 #define _UEP6_EPINEN 0x02
803 #define _UEP6_EPOUTEN 0x04
804 #define _UEP6_EPCONDIS 0x08
805 #define _UEP6_EPHSHK 0x10
807 //==============================================================================
810 //==============================================================================
811 // UEP7 Bits
813 extern __at(0x0F71) __sfr UEP7;
815 typedef struct
817 unsigned EPSTALL : 1;
818 unsigned EPINEN : 1;
819 unsigned EPOUTEN : 1;
820 unsigned EPCONDIS : 1;
821 unsigned EPHSHK : 1;
822 unsigned : 1;
823 unsigned : 1;
824 unsigned : 1;
825 } __UEP7bits_t;
827 extern __at(0x0F71) volatile __UEP7bits_t UEP7bits;
829 #define _UEP7_EPSTALL 0x01
830 #define _UEP7_EPINEN 0x02
831 #define _UEP7_EPOUTEN 0x04
832 #define _UEP7_EPCONDIS 0x08
833 #define _UEP7_EPHSHK 0x10
835 //==============================================================================
838 //==============================================================================
839 // UEP8 Bits
841 extern __at(0x0F72) __sfr UEP8;
843 typedef struct
845 unsigned EPSTALL : 1;
846 unsigned EPINEN : 1;
847 unsigned EPOUTEN : 1;
848 unsigned EPCONDIS : 1;
849 unsigned EPHSHK : 1;
850 unsigned : 1;
851 unsigned : 1;
852 unsigned : 1;
853 } __UEP8bits_t;
855 extern __at(0x0F72) volatile __UEP8bits_t UEP8bits;
857 #define _UEP8_EPSTALL 0x01
858 #define _UEP8_EPINEN 0x02
859 #define _UEP8_EPOUTEN 0x04
860 #define _UEP8_EPCONDIS 0x08
861 #define _UEP8_EPHSHK 0x10
863 //==============================================================================
866 //==============================================================================
867 // UEP9 Bits
869 extern __at(0x0F73) __sfr UEP9;
871 typedef struct
873 unsigned EPSTALL : 1;
874 unsigned EPINEN : 1;
875 unsigned EPOUTEN : 1;
876 unsigned EPCONDIS : 1;
877 unsigned EPHSHK : 1;
878 unsigned : 1;
879 unsigned : 1;
880 unsigned : 1;
881 } __UEP9bits_t;
883 extern __at(0x0F73) volatile __UEP9bits_t UEP9bits;
885 #define _UEP9_EPSTALL 0x01
886 #define _UEP9_EPINEN 0x02
887 #define _UEP9_EPOUTEN 0x04
888 #define _UEP9_EPCONDIS 0x08
889 #define _UEP9_EPHSHK 0x10
891 //==============================================================================
894 //==============================================================================
895 // UEP10 Bits
897 extern __at(0x0F74) __sfr UEP10;
899 typedef struct
901 unsigned EPSTALL : 1;
902 unsigned EPINEN : 1;
903 unsigned EPOUTEN : 1;
904 unsigned EPCONDIS : 1;
905 unsigned EPHSHK : 1;
906 unsigned : 1;
907 unsigned : 1;
908 unsigned : 1;
909 } __UEP10bits_t;
911 extern __at(0x0F74) volatile __UEP10bits_t UEP10bits;
913 #define _UEP10_EPSTALL 0x01
914 #define _UEP10_EPINEN 0x02
915 #define _UEP10_EPOUTEN 0x04
916 #define _UEP10_EPCONDIS 0x08
917 #define _UEP10_EPHSHK 0x10
919 //==============================================================================
922 //==============================================================================
923 // UEP11 Bits
925 extern __at(0x0F75) __sfr UEP11;
927 typedef struct
929 unsigned EPSTALL : 1;
930 unsigned EPINEN : 1;
931 unsigned EPOUTEN : 1;
932 unsigned EPCONDIS : 1;
933 unsigned EPHSHK : 1;
934 unsigned : 1;
935 unsigned : 1;
936 unsigned : 1;
937 } __UEP11bits_t;
939 extern __at(0x0F75) volatile __UEP11bits_t UEP11bits;
941 #define _UEP11_EPSTALL 0x01
942 #define _UEP11_EPINEN 0x02
943 #define _UEP11_EPOUTEN 0x04
944 #define _UEP11_EPCONDIS 0x08
945 #define _UEP11_EPHSHK 0x10
947 //==============================================================================
950 //==============================================================================
951 // UEP12 Bits
953 extern __at(0x0F76) __sfr UEP12;
955 typedef struct
957 unsigned EPSTALL : 1;
958 unsigned EPINEN : 1;
959 unsigned EPOUTEN : 1;
960 unsigned EPCONDIS : 1;
961 unsigned EPHSHK : 1;
962 unsigned : 1;
963 unsigned : 1;
964 unsigned : 1;
965 } __UEP12bits_t;
967 extern __at(0x0F76) volatile __UEP12bits_t UEP12bits;
969 #define _UEP12_EPSTALL 0x01
970 #define _UEP12_EPINEN 0x02
971 #define _UEP12_EPOUTEN 0x04
972 #define _UEP12_EPCONDIS 0x08
973 #define _UEP12_EPHSHK 0x10
975 //==============================================================================
978 //==============================================================================
979 // UEP13 Bits
981 extern __at(0x0F77) __sfr UEP13;
983 typedef struct
985 unsigned EPSTALL : 1;
986 unsigned EPINEN : 1;
987 unsigned EPOUTEN : 1;
988 unsigned EPCONDIS : 1;
989 unsigned EPHSHK : 1;
990 unsigned : 1;
991 unsigned : 1;
992 unsigned : 1;
993 } __UEP13bits_t;
995 extern __at(0x0F77) volatile __UEP13bits_t UEP13bits;
997 #define _UEP13_EPSTALL 0x01
998 #define _UEP13_EPINEN 0x02
999 #define _UEP13_EPOUTEN 0x04
1000 #define _UEP13_EPCONDIS 0x08
1001 #define _UEP13_EPHSHK 0x10
1003 //==============================================================================
1006 //==============================================================================
1007 // UEP14 Bits
1009 extern __at(0x0F78) __sfr UEP14;
1011 typedef struct
1013 unsigned EPSTALL : 1;
1014 unsigned EPINEN : 1;
1015 unsigned EPOUTEN : 1;
1016 unsigned EPCONDIS : 1;
1017 unsigned EPHSHK : 1;
1018 unsigned : 1;
1019 unsigned : 1;
1020 unsigned : 1;
1021 } __UEP14bits_t;
1023 extern __at(0x0F78) volatile __UEP14bits_t UEP14bits;
1025 #define _UEP14_EPSTALL 0x01
1026 #define _UEP14_EPINEN 0x02
1027 #define _UEP14_EPOUTEN 0x04
1028 #define _UEP14_EPCONDIS 0x08
1029 #define _UEP14_EPHSHK 0x10
1031 //==============================================================================
1034 //==============================================================================
1035 // UEP15 Bits
1037 extern __at(0x0F79) __sfr UEP15;
1039 typedef struct
1041 unsigned EPSTALL : 1;
1042 unsigned EPINEN : 1;
1043 unsigned EPOUTEN : 1;
1044 unsigned EPCONDIS : 1;
1045 unsigned EPHSHK : 1;
1046 unsigned : 1;
1047 unsigned : 1;
1048 unsigned : 1;
1049 } __UEP15bits_t;
1051 extern __at(0x0F79) volatile __UEP15bits_t UEP15bits;
1053 #define _UEP15_EPSTALL 0x01
1054 #define _UEP15_EPINEN 0x02
1055 #define _UEP15_EPOUTEN 0x04
1056 #define _UEP15_EPCONDIS 0x08
1057 #define _UEP15_EPHSHK 0x10
1059 //==============================================================================
1062 //==============================================================================
1063 // SLRCON Bits
1065 extern __at(0x0F7A) __sfr SLRCON;
1067 typedef struct
1069 unsigned SLRA : 1;
1070 unsigned SLRB : 1;
1071 unsigned SLRC : 1;
1072 unsigned SLRD : 1;
1073 unsigned SLRE : 1;
1074 unsigned : 1;
1075 unsigned : 1;
1076 unsigned : 1;
1077 } __SLRCONbits_t;
1079 extern __at(0x0F7A) volatile __SLRCONbits_t SLRCONbits;
1081 #define _SLRA 0x01
1082 #define _SLRB 0x02
1083 #define _SLRC 0x04
1084 #define _SLRD 0x08
1085 #define _SLRE 0x10
1087 //==============================================================================
1090 //==============================================================================
1091 // VREFCON2 Bits
1093 extern __at(0x0F7B) __sfr VREFCON2;
1095 typedef union
1097 struct
1099 unsigned DACR0 : 1;
1100 unsigned DACR1 : 1;
1101 unsigned DACR2 : 1;
1102 unsigned DACR3 : 1;
1103 unsigned DACR4 : 1;
1104 unsigned : 1;
1105 unsigned : 1;
1106 unsigned : 1;
1109 struct
1111 unsigned DACR : 5;
1112 unsigned : 3;
1114 } __VREFCON2bits_t;
1116 extern __at(0x0F7B) volatile __VREFCON2bits_t VREFCON2bits;
1118 #define _DACR0 0x01
1119 #define _DACR1 0x02
1120 #define _DACR2 0x04
1121 #define _DACR3 0x08
1122 #define _DACR4 0x10
1124 //==============================================================================
1127 //==============================================================================
1128 // VREFCON1 Bits
1130 extern __at(0x0F7C) __sfr VREFCON1;
1132 typedef union
1134 struct
1136 unsigned DACNSS : 1;
1137 unsigned : 1;
1138 unsigned DACPSS0 : 1;
1139 unsigned DACPSS1 : 1;
1140 unsigned : 1;
1141 unsigned DACOE : 1;
1142 unsigned DACLPS : 1;
1143 unsigned DACEN : 1;
1146 struct
1148 unsigned : 2;
1149 unsigned DACPSS : 2;
1150 unsigned : 4;
1152 } __VREFCON1bits_t;
1154 extern __at(0x0F7C) volatile __VREFCON1bits_t VREFCON1bits;
1156 #define _DACNSS 0x01
1157 #define _DACPSS0 0x04
1158 #define _DACPSS1 0x08
1159 #define _DACOE 0x20
1160 #define _DACLPS 0x40
1161 #define _DACEN 0x80
1163 //==============================================================================
1166 //==============================================================================
1167 // VREFCON0 Bits
1169 extern __at(0x0F7D) __sfr VREFCON0;
1171 typedef union
1173 struct
1175 unsigned : 1;
1176 unsigned : 1;
1177 unsigned TSRNG : 1;
1178 unsigned TSEN : 1;
1179 unsigned FVRS0 : 1;
1180 unsigned FVRS1 : 1;
1181 unsigned FVRST : 1;
1182 unsigned FVREN : 1;
1185 struct
1187 unsigned : 4;
1188 unsigned FVRS : 2;
1189 unsigned : 2;
1191 } __VREFCON0bits_t;
1193 extern __at(0x0F7D) volatile __VREFCON0bits_t VREFCON0bits;
1195 #define _TSRNG 0x04
1196 #define _TSEN 0x08
1197 #define _FVRS0 0x10
1198 #define _FVRS1 0x20
1199 #define _FVRST 0x40
1200 #define _FVREN 0x80
1202 //==============================================================================
1205 //==============================================================================
1206 // PMD0 Bits
1208 extern __at(0x0F7E) __sfr PMD0;
1210 typedef union
1212 struct
1214 unsigned TMR1MD : 1;
1215 unsigned TMR2MD : 1;
1216 unsigned TMR3MD : 1;
1217 unsigned : 1;
1218 unsigned ACTMD : 1;
1219 unsigned USBMD : 1;
1220 unsigned UARTMD : 1;
1221 unsigned : 1;
1224 struct
1226 unsigned : 1;
1227 unsigned : 1;
1228 unsigned : 1;
1229 unsigned : 1;
1230 unsigned STMD : 1;
1231 unsigned : 1;
1232 unsigned UART1MD : 1;
1233 unsigned : 1;
1235 } __PMD0bits_t;
1237 extern __at(0x0F7E) volatile __PMD0bits_t PMD0bits;
1239 #define _TMR1MD 0x01
1240 #define _TMR2MD 0x02
1241 #define _TMR3MD 0x04
1242 #define _ACTMD 0x10
1243 #define _STMD 0x10
1244 #define _USBMD 0x20
1245 #define _UARTMD 0x40
1246 #define _UART1MD 0x40
1248 //==============================================================================
1251 //==============================================================================
1252 // PMD1 Bits
1254 extern __at(0x0F7F) __sfr PMD1;
1256 typedef union
1258 struct
1260 unsigned CCP1MD : 1;
1261 unsigned CCP2MD : 1;
1262 unsigned ADCMD : 1;
1263 unsigned CMP1MD : 1;
1264 unsigned CMP2MD : 1;
1265 unsigned CTMUMD : 1;
1266 unsigned MSSPMD : 1;
1267 unsigned : 1;
1270 struct
1272 unsigned : 1;
1273 unsigned : 1;
1274 unsigned : 1;
1275 unsigned : 1;
1276 unsigned : 1;
1277 unsigned : 1;
1278 unsigned SSP1MD : 1;
1279 unsigned : 1;
1282 struct
1284 unsigned : 1;
1285 unsigned : 1;
1286 unsigned : 1;
1287 unsigned : 1;
1288 unsigned : 1;
1289 unsigned : 1;
1290 unsigned MSSP1MD : 1;
1291 unsigned : 1;
1293 } __PMD1bits_t;
1295 extern __at(0x0F7F) volatile __PMD1bits_t PMD1bits;
1297 #define _CCP1MD 0x01
1298 #define _CCP2MD 0x02
1299 #define _ADCMD 0x04
1300 #define _CMP1MD 0x08
1301 #define _CMP2MD 0x10
1302 #define _CTMUMD 0x20
1303 #define _MSSPMD 0x40
1304 #define _SSP1MD 0x40
1305 #define _MSSP1MD 0x40
1307 //==============================================================================
1310 //==============================================================================
1311 // PORTA Bits
1313 extern __at(0x0F80) __sfr PORTA;
1315 typedef union
1317 struct
1319 unsigned RA0 : 1;
1320 unsigned RA1 : 1;
1321 unsigned RA2 : 1;
1322 unsigned RA3 : 1;
1323 unsigned RA4 : 1;
1324 unsigned RA5 : 1;
1325 unsigned RA6 : 1;
1326 unsigned RA7 : 1;
1329 struct
1331 unsigned AN0 : 1;
1332 unsigned AN1 : 1;
1333 unsigned AN2 : 1;
1334 unsigned AN3 : 1;
1335 unsigned T0CKI : 1;
1336 unsigned AN4 : 1;
1337 unsigned OSC2 : 1;
1338 unsigned : 1;
1341 struct
1343 unsigned : 1;
1344 unsigned : 1;
1345 unsigned VREFM : 1;
1346 unsigned VREFP : 1;
1347 unsigned : 1;
1348 unsigned LVDIN : 1;
1349 unsigned : 1;
1350 unsigned : 1;
1353 struct
1355 unsigned : 1;
1356 unsigned : 1;
1357 unsigned : 1;
1358 unsigned : 1;
1359 unsigned : 1;
1360 unsigned HLVDIN : 1;
1361 unsigned : 1;
1362 unsigned : 1;
1364 } __PORTAbits_t;
1366 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1368 #define _PORTA_RA0 0x01
1369 #define _PORTA_AN0 0x01
1370 #define _PORTA_RA1 0x02
1371 #define _PORTA_AN1 0x02
1372 #define _PORTA_RA2 0x04
1373 #define _PORTA_AN2 0x04
1374 #define _PORTA_VREFM 0x04
1375 #define _PORTA_RA3 0x08
1376 #define _PORTA_AN3 0x08
1377 #define _PORTA_VREFP 0x08
1378 #define _PORTA_RA4 0x10
1379 #define _PORTA_T0CKI 0x10
1380 #define _PORTA_RA5 0x20
1381 #define _PORTA_AN4 0x20
1382 #define _PORTA_LVDIN 0x20
1383 #define _PORTA_HLVDIN 0x20
1384 #define _PORTA_RA6 0x40
1385 #define _PORTA_OSC2 0x40
1386 #define _PORTA_RA7 0x80
1388 //==============================================================================
1391 //==============================================================================
1392 // PORTB Bits
1394 extern __at(0x0F81) __sfr PORTB;
1396 typedef union
1398 struct
1400 unsigned RB0 : 1;
1401 unsigned RB1 : 1;
1402 unsigned RB2 : 1;
1403 unsigned RB3 : 1;
1404 unsigned RB4 : 1;
1405 unsigned RB5 : 1;
1406 unsigned RB6 : 1;
1407 unsigned RB7 : 1;
1410 struct
1412 unsigned INT0 : 1;
1413 unsigned INT1 : 1;
1414 unsigned INT2 : 1;
1415 unsigned : 1;
1416 unsigned : 1;
1417 unsigned PGM : 1;
1418 unsigned PGC : 1;
1419 unsigned PGD : 1;
1422 struct
1424 unsigned INT : 3;
1425 unsigned : 5;
1427 } __PORTBbits_t;
1429 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1431 #define _PORTB_RB0 0x01
1432 #define _PORTB_INT0 0x01
1433 #define _PORTB_RB1 0x02
1434 #define _PORTB_INT1 0x02
1435 #define _PORTB_RB2 0x04
1436 #define _PORTB_INT2 0x04
1437 #define _PORTB_RB3 0x08
1438 #define _PORTB_RB4 0x10
1439 #define _PORTB_RB5 0x20
1440 #define _PORTB_PGM 0x20
1441 #define _PORTB_RB6 0x40
1442 #define _PORTB_PGC 0x40
1443 #define _PORTB_RB7 0x80
1444 #define _PORTB_PGD 0x80
1446 //==============================================================================
1449 //==============================================================================
1450 // PORTC Bits
1452 extern __at(0x0F82) __sfr PORTC;
1454 typedef union
1456 struct
1458 unsigned RC0 : 1;
1459 unsigned RC1 : 1;
1460 unsigned RC2 : 1;
1461 unsigned : 1;
1462 unsigned RC4 : 1;
1463 unsigned RC5 : 1;
1464 unsigned RC6 : 1;
1465 unsigned RC7 : 1;
1468 struct
1470 unsigned T1OSO : 1;
1471 unsigned T1OSI : 1;
1472 unsigned CCP1 : 1;
1473 unsigned : 1;
1474 unsigned : 1;
1475 unsigned : 1;
1476 unsigned TX : 1;
1477 unsigned RX : 1;
1480 struct
1482 unsigned T13CKI : 1;
1483 unsigned : 1;
1484 unsigned P1A : 1;
1485 unsigned : 1;
1486 unsigned : 1;
1487 unsigned : 1;
1488 unsigned CK : 1;
1489 unsigned : 1;
1491 } __PORTCbits_t;
1493 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1495 #define _PORTC_RC0 0x01
1496 #define _PORTC_T1OSO 0x01
1497 #define _PORTC_T13CKI 0x01
1498 #define _PORTC_RC1 0x02
1499 #define _PORTC_T1OSI 0x02
1500 #define _PORTC_RC2 0x04
1501 #define _PORTC_CCP1 0x04
1502 #define _PORTC_P1A 0x04
1503 #define _PORTC_RC4 0x10
1504 #define _PORTC_RC5 0x20
1505 #define _PORTC_RC6 0x40
1506 #define _PORTC_TX 0x40
1507 #define _PORTC_CK 0x40
1508 #define _PORTC_RC7 0x80
1509 #define _PORTC_RX 0x80
1511 //==============================================================================
1514 //==============================================================================
1515 // PORTD Bits
1517 extern __at(0x0F83) __sfr PORTD;
1519 typedef union
1521 struct
1523 unsigned RD0 : 1;
1524 unsigned RD1 : 1;
1525 unsigned RD2 : 1;
1526 unsigned RD3 : 1;
1527 unsigned RD4 : 1;
1528 unsigned RD5 : 1;
1529 unsigned RD6 : 1;
1530 unsigned RD7 : 1;
1533 struct
1535 unsigned SPP0 : 1;
1536 unsigned SPP1 : 1;
1537 unsigned SPP2 : 1;
1538 unsigned SPP3 : 1;
1539 unsigned SPP4 : 1;
1540 unsigned SPP5 : 1;
1541 unsigned SPP6 : 1;
1542 unsigned SPP7 : 1;
1544 } __PORTDbits_t;
1546 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1548 #define _PORTD_RD0 0x01
1549 #define _PORTD_SPP0 0x01
1550 #define _PORTD_RD1 0x02
1551 #define _PORTD_SPP1 0x02
1552 #define _PORTD_RD2 0x04
1553 #define _PORTD_SPP2 0x04
1554 #define _PORTD_RD3 0x08
1555 #define _PORTD_SPP3 0x08
1556 #define _PORTD_RD4 0x10
1557 #define _PORTD_SPP4 0x10
1558 #define _PORTD_RD5 0x20
1559 #define _PORTD_SPP5 0x20
1560 #define _PORTD_RD6 0x40
1561 #define _PORTD_SPP6 0x40
1562 #define _PORTD_RD7 0x80
1563 #define _PORTD_SPP7 0x80
1565 //==============================================================================
1568 //==============================================================================
1569 // PORTE Bits
1571 extern __at(0x0F84) __sfr PORTE;
1573 typedef union
1575 struct
1577 unsigned RE0 : 1;
1578 unsigned RE1 : 1;
1579 unsigned RE2 : 1;
1580 unsigned RE3 : 1;
1581 unsigned : 1;
1582 unsigned : 1;
1583 unsigned : 1;
1584 unsigned : 1;
1587 struct
1589 unsigned CK1SPP : 1;
1590 unsigned CK2SPP : 1;
1591 unsigned OESPP : 1;
1592 unsigned : 1;
1593 unsigned : 1;
1594 unsigned : 1;
1595 unsigned : 1;
1596 unsigned : 1;
1599 struct
1601 unsigned RE : 4;
1602 unsigned : 4;
1604 } __PORTEbits_t;
1606 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1608 #define _PORTE_RE0 0x01
1609 #define _PORTE_CK1SPP 0x01
1610 #define _PORTE_RE1 0x02
1611 #define _PORTE_CK2SPP 0x02
1612 #define _PORTE_RE2 0x04
1613 #define _PORTE_OESPP 0x04
1614 #define _PORTE_RE3 0x08
1616 //==============================================================================
1619 //==============================================================================
1620 // WPUB Bits
1622 extern __at(0x0F85) __sfr WPUB;
1624 typedef struct
1626 unsigned WPUB0 : 1;
1627 unsigned WPUB1 : 1;
1628 unsigned WPUB2 : 1;
1629 unsigned WPUB3 : 1;
1630 unsigned WPUB4 : 1;
1631 unsigned WPUB5 : 1;
1632 unsigned WPUB6 : 1;
1633 unsigned WPUB7 : 1;
1634 } __WPUBbits_t;
1636 extern __at(0x0F85) volatile __WPUBbits_t WPUBbits;
1638 #define _WPUB0 0x01
1639 #define _WPUB1 0x02
1640 #define _WPUB2 0x04
1641 #define _WPUB3 0x08
1642 #define _WPUB4 0x10
1643 #define _WPUB5 0x20
1644 #define _WPUB6 0x40
1645 #define _WPUB7 0x80
1647 //==============================================================================
1650 //==============================================================================
1651 // IOCB Bits
1653 extern __at(0x0F86) __sfr IOCB;
1655 typedef struct
1657 unsigned : 1;
1658 unsigned : 1;
1659 unsigned : 1;
1660 unsigned : 1;
1661 unsigned IOCB4 : 1;
1662 unsigned IOCB5 : 1;
1663 unsigned IOCB6 : 1;
1664 unsigned IOCB7 : 1;
1665 } __IOCBbits_t;
1667 extern __at(0x0F86) volatile __IOCBbits_t IOCBbits;
1669 #define _IOCB4 0x10
1670 #define _IOCB5 0x20
1671 #define _IOCB6 0x40
1672 #define _IOCB7 0x80
1674 //==============================================================================
1677 //==============================================================================
1678 // IOCC Bits
1680 extern __at(0x0F87) __sfr IOCC;
1682 typedef struct
1684 unsigned IOCC0 : 1;
1685 unsigned IOCC1 : 1;
1686 unsigned IOCC2 : 1;
1687 unsigned : 1;
1688 unsigned IOCC4 : 1;
1689 unsigned IOCC5 : 1;
1690 unsigned IOCC6 : 1;
1691 unsigned IOCC7 : 1;
1692 } __IOCCbits_t;
1694 extern __at(0x0F87) volatile __IOCCbits_t IOCCbits;
1696 #define _IOCC0 0x01
1697 #define _IOCC1 0x02
1698 #define _IOCC2 0x04
1699 #define _IOCC4 0x10
1700 #define _IOCC5 0x20
1701 #define _IOCC6 0x40
1702 #define _IOCC7 0x80
1704 //==============================================================================
1707 //==============================================================================
1708 // CTMUICON Bits
1710 extern __at(0x0F88) __sfr CTMUICON;
1712 typedef union
1714 struct
1716 unsigned IRNG0 : 1;
1717 unsigned IRNG1 : 1;
1718 unsigned ITRIM0 : 1;
1719 unsigned ITRIM1 : 1;
1720 unsigned ITRIM2 : 1;
1721 unsigned ITRIM3 : 1;
1722 unsigned ITRIM4 : 1;
1723 unsigned ITRIM5 : 1;
1726 struct
1728 unsigned IRNG : 2;
1729 unsigned : 6;
1732 struct
1734 unsigned : 2;
1735 unsigned ITRIM : 6;
1737 } __CTMUICONbits_t;
1739 extern __at(0x0F88) volatile __CTMUICONbits_t CTMUICONbits;
1741 #define _IRNG0 0x01
1742 #define _IRNG1 0x02
1743 #define _ITRIM0 0x04
1744 #define _ITRIM1 0x08
1745 #define _ITRIM2 0x10
1746 #define _ITRIM3 0x20
1747 #define _ITRIM4 0x40
1748 #define _ITRIM5 0x80
1750 //==============================================================================
1753 //==============================================================================
1754 // LATA Bits
1756 extern __at(0x0F89) __sfr LATA;
1758 typedef struct
1760 unsigned LATA0 : 1;
1761 unsigned LATA1 : 1;
1762 unsigned LATA2 : 1;
1763 unsigned LATA3 : 1;
1764 unsigned LATA4 : 1;
1765 unsigned LATA5 : 1;
1766 unsigned LATA6 : 1;
1767 unsigned LATA7 : 1;
1768 } __LATAbits_t;
1770 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1772 #define _LATA0 0x01
1773 #define _LATA1 0x02
1774 #define _LATA2 0x04
1775 #define _LATA3 0x08
1776 #define _LATA4 0x10
1777 #define _LATA5 0x20
1778 #define _LATA6 0x40
1779 #define _LATA7 0x80
1781 //==============================================================================
1784 //==============================================================================
1785 // LATB Bits
1787 extern __at(0x0F8A) __sfr LATB;
1789 typedef struct
1791 unsigned LATB0 : 1;
1792 unsigned LATB1 : 1;
1793 unsigned LATB2 : 1;
1794 unsigned LATB3 : 1;
1795 unsigned LATB4 : 1;
1796 unsigned LATB5 : 1;
1797 unsigned LATB6 : 1;
1798 unsigned LATB7 : 1;
1799 } __LATBbits_t;
1801 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1803 #define _LATB0 0x01
1804 #define _LATB1 0x02
1805 #define _LATB2 0x04
1806 #define _LATB3 0x08
1807 #define _LATB4 0x10
1808 #define _LATB5 0x20
1809 #define _LATB6 0x40
1810 #define _LATB7 0x80
1812 //==============================================================================
1815 //==============================================================================
1816 // LATC Bits
1818 extern __at(0x0F8B) __sfr LATC;
1820 typedef struct
1822 unsigned LATC0 : 1;
1823 unsigned LATC1 : 1;
1824 unsigned LATC2 : 1;
1825 unsigned : 1;
1826 unsigned LATC4 : 1;
1827 unsigned LATC5 : 1;
1828 unsigned LATC6 : 1;
1829 unsigned LATC7 : 1;
1830 } __LATCbits_t;
1832 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1834 #define _LATC0 0x01
1835 #define _LATC1 0x02
1836 #define _LATC2 0x04
1837 #define _LATC4 0x10
1838 #define _LATC5 0x20
1839 #define _LATC6 0x40
1840 #define _LATC7 0x80
1842 //==============================================================================
1845 //==============================================================================
1846 // LATD Bits
1848 extern __at(0x0F8C) __sfr LATD;
1850 typedef struct
1852 unsigned LATD0 : 1;
1853 unsigned LATD1 : 1;
1854 unsigned LATD2 : 1;
1855 unsigned LATD3 : 1;
1856 unsigned LATD4 : 1;
1857 unsigned LATD5 : 1;
1858 unsigned LATD6 : 1;
1859 unsigned LATD7 : 1;
1860 } __LATDbits_t;
1862 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1864 #define _LATD0 0x01
1865 #define _LATD1 0x02
1866 #define _LATD2 0x04
1867 #define _LATD3 0x08
1868 #define _LATD4 0x10
1869 #define _LATD5 0x20
1870 #define _LATD6 0x40
1871 #define _LATD7 0x80
1873 //==============================================================================
1876 //==============================================================================
1877 // LATE Bits
1879 extern __at(0x0F8D) __sfr LATE;
1881 typedef union
1883 struct
1885 unsigned LATE0 : 1;
1886 unsigned LATE1 : 1;
1887 unsigned LATE2 : 1;
1888 unsigned : 1;
1889 unsigned : 1;
1890 unsigned : 1;
1891 unsigned : 1;
1892 unsigned : 1;
1895 struct
1897 unsigned LATE : 3;
1898 unsigned : 5;
1900 } __LATEbits_t;
1902 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1904 #define _LATE0 0x01
1905 #define _LATE1 0x02
1906 #define _LATE2 0x04
1908 //==============================================================================
1911 //==============================================================================
1912 // CTMUCON1 Bits
1914 extern __at(0x0F8E) __sfr CTMUCON1;
1916 typedef union
1918 struct
1920 unsigned EDG1STAT : 1;
1921 unsigned EDG2STAT : 1;
1922 unsigned EDG1SEL0 : 1;
1923 unsigned EDG1SEL1 : 1;
1924 unsigned EDG1POL : 1;
1925 unsigned EDG2SEL0 : 1;
1926 unsigned EDG2SEL1 : 1;
1927 unsigned EDG2POL : 1;
1930 struct
1932 unsigned : 2;
1933 unsigned EDG1SEL : 2;
1934 unsigned : 4;
1937 struct
1939 unsigned : 5;
1940 unsigned EDG2SEL : 2;
1941 unsigned : 1;
1943 } __CTMUCON1bits_t;
1945 extern __at(0x0F8E) volatile __CTMUCON1bits_t CTMUCON1bits;
1947 #define _EDG1STAT 0x01
1948 #define _EDG2STAT 0x02
1949 #define _EDG1SEL0 0x04
1950 #define _EDG1SEL1 0x08
1951 #define _EDG1POL 0x10
1952 #define _EDG2SEL0 0x20
1953 #define _EDG2SEL1 0x40
1954 #define _EDG2POL 0x80
1956 //==============================================================================
1959 //==============================================================================
1960 // CTMUCONL Bits
1962 extern __at(0x0F8E) __sfr CTMUCONL;
1964 typedef union
1966 struct
1968 unsigned EDG1STAT : 1;
1969 unsigned EDG2STAT : 1;
1970 unsigned EDG1SEL0 : 1;
1971 unsigned EDG1SEL1 : 1;
1972 unsigned EDG1POL : 1;
1973 unsigned EDG2SEL0 : 1;
1974 unsigned EDG2SEL1 : 1;
1975 unsigned EDG2POL : 1;
1978 struct
1980 unsigned : 2;
1981 unsigned EDG1SEL : 2;
1982 unsigned : 4;
1985 struct
1987 unsigned : 5;
1988 unsigned EDG2SEL : 2;
1989 unsigned : 1;
1991 } __CTMUCONLbits_t;
1993 extern __at(0x0F8E) volatile __CTMUCONLbits_t CTMUCONLbits;
1995 #define _CTMUCONL_EDG1STAT 0x01
1996 #define _CTMUCONL_EDG2STAT 0x02
1997 #define _CTMUCONL_EDG1SEL0 0x04
1998 #define _CTMUCONL_EDG1SEL1 0x08
1999 #define _CTMUCONL_EDG1POL 0x10
2000 #define _CTMUCONL_EDG2SEL0 0x20
2001 #define _CTMUCONL_EDG2SEL1 0x40
2002 #define _CTMUCONL_EDG2POL 0x80
2004 //==============================================================================
2007 //==============================================================================
2008 // CTMUCON0 Bits
2010 extern __at(0x0F8F) __sfr CTMUCON0;
2012 typedef union
2014 struct
2016 unsigned CTTRIG : 1;
2017 unsigned IDISSEN : 1;
2018 unsigned EDGSEQEN : 1;
2019 unsigned EDGEN : 1;
2020 unsigned TGEN : 1;
2021 unsigned CTMUSIDL : 1;
2022 unsigned : 1;
2023 unsigned CTMUEN : 1;
2026 struct
2028 unsigned TRIGEN : 1;
2029 unsigned : 1;
2030 unsigned : 1;
2031 unsigned : 1;
2032 unsigned : 1;
2033 unsigned SIDL : 1;
2034 unsigned : 1;
2035 unsigned ON : 1;
2037 } __CTMUCON0bits_t;
2039 extern __at(0x0F8F) volatile __CTMUCON0bits_t CTMUCON0bits;
2041 #define _CTTRIG 0x01
2042 #define _TRIGEN 0x01
2043 #define _IDISSEN 0x02
2044 #define _EDGSEQEN 0x04
2045 #define _EDGEN 0x08
2046 #define _TGEN 0x10
2047 #define _CTMUSIDL 0x20
2048 #define _SIDL 0x20
2049 #define _CTMUEN 0x80
2050 #define _ON 0x80
2052 //==============================================================================
2055 //==============================================================================
2056 // CTMUCONH Bits
2058 extern __at(0x0F8F) __sfr CTMUCONH;
2060 typedef union
2062 struct
2064 unsigned CTTRIG : 1;
2065 unsigned IDISSEN : 1;
2066 unsigned EDGSEQEN : 1;
2067 unsigned EDGEN : 1;
2068 unsigned TGEN : 1;
2069 unsigned CTMUSIDL : 1;
2070 unsigned : 1;
2071 unsigned CTMUEN : 1;
2074 struct
2076 unsigned TRIGEN : 1;
2077 unsigned : 1;
2078 unsigned : 1;
2079 unsigned : 1;
2080 unsigned : 1;
2081 unsigned SIDL : 1;
2082 unsigned : 1;
2083 unsigned ON : 1;
2085 } __CTMUCONHbits_t;
2087 extern __at(0x0F8F) volatile __CTMUCONHbits_t CTMUCONHbits;
2089 #define _CTMUCONH_CTTRIG 0x01
2090 #define _CTMUCONH_TRIGEN 0x01
2091 #define _CTMUCONH_IDISSEN 0x02
2092 #define _CTMUCONH_EDGSEQEN 0x04
2093 #define _CTMUCONH_EDGEN 0x08
2094 #define _CTMUCONH_TGEN 0x10
2095 #define _CTMUCONH_CTMUSIDL 0x20
2096 #define _CTMUCONH_SIDL 0x20
2097 #define _CTMUCONH_CTMUEN 0x80
2098 #define _CTMUCONH_ON 0x80
2100 //==============================================================================
2102 extern __at(0x0F90) __sfr CCPR2;
2103 extern __at(0x0F90) __sfr CCPR2L;
2104 extern __at(0x0F91) __sfr CCPR2H;
2106 //==============================================================================
2107 // DDRA Bits
2109 extern __at(0x0F92) __sfr DDRA;
2111 typedef union
2113 struct
2115 unsigned TRISA0 : 1;
2116 unsigned TRISA1 : 1;
2117 unsigned TRISA2 : 1;
2118 unsigned TRISA3 : 1;
2119 unsigned TRISA4 : 1;
2120 unsigned TRISA5 : 1;
2121 unsigned TRISA6 : 1;
2122 unsigned TRISA7 : 1;
2125 struct
2127 unsigned RA0 : 1;
2128 unsigned RA1 : 1;
2129 unsigned RA2 : 1;
2130 unsigned RA3 : 1;
2131 unsigned RA4 : 1;
2132 unsigned RA5 : 1;
2133 unsigned RA6 : 1;
2134 unsigned RA7 : 1;
2136 } __DDRAbits_t;
2138 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2140 #define _TRISA0 0x01
2141 #define _RA0 0x01
2142 #define _TRISA1 0x02
2143 #define _RA1 0x02
2144 #define _TRISA2 0x04
2145 #define _RA2 0x04
2146 #define _TRISA3 0x08
2147 #define _RA3 0x08
2148 #define _TRISA4 0x10
2149 #define _RA4 0x10
2150 #define _TRISA5 0x20
2151 #define _RA5 0x20
2152 #define _TRISA6 0x40
2153 #define _RA6 0x40
2154 #define _TRISA7 0x80
2155 #define _RA7 0x80
2157 //==============================================================================
2160 //==============================================================================
2161 // TRISA Bits
2163 extern __at(0x0F92) __sfr TRISA;
2165 typedef union
2167 struct
2169 unsigned TRISA0 : 1;
2170 unsigned TRISA1 : 1;
2171 unsigned TRISA2 : 1;
2172 unsigned TRISA3 : 1;
2173 unsigned TRISA4 : 1;
2174 unsigned TRISA5 : 1;
2175 unsigned TRISA6 : 1;
2176 unsigned TRISA7 : 1;
2179 struct
2181 unsigned RA0 : 1;
2182 unsigned RA1 : 1;
2183 unsigned RA2 : 1;
2184 unsigned RA3 : 1;
2185 unsigned RA4 : 1;
2186 unsigned RA5 : 1;
2187 unsigned RA6 : 1;
2188 unsigned RA7 : 1;
2190 } __TRISAbits_t;
2192 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2194 #define _TRISA_TRISA0 0x01
2195 #define _TRISA_RA0 0x01
2196 #define _TRISA_TRISA1 0x02
2197 #define _TRISA_RA1 0x02
2198 #define _TRISA_TRISA2 0x04
2199 #define _TRISA_RA2 0x04
2200 #define _TRISA_TRISA3 0x08
2201 #define _TRISA_RA3 0x08
2202 #define _TRISA_TRISA4 0x10
2203 #define _TRISA_RA4 0x10
2204 #define _TRISA_TRISA5 0x20
2205 #define _TRISA_RA5 0x20
2206 #define _TRISA_TRISA6 0x40
2207 #define _TRISA_RA6 0x40
2208 #define _TRISA_TRISA7 0x80
2209 #define _TRISA_RA7 0x80
2211 //==============================================================================
2214 //==============================================================================
2215 // DDRB Bits
2217 extern __at(0x0F93) __sfr DDRB;
2219 typedef union
2221 struct
2223 unsigned TRISB0 : 1;
2224 unsigned TRISB1 : 1;
2225 unsigned TRISB2 : 1;
2226 unsigned TRISB3 : 1;
2227 unsigned TRISB4 : 1;
2228 unsigned TRISB5 : 1;
2229 unsigned TRISB6 : 1;
2230 unsigned TRISB7 : 1;
2233 struct
2235 unsigned RB0 : 1;
2236 unsigned RB1 : 1;
2237 unsigned RB2 : 1;
2238 unsigned RB3 : 1;
2239 unsigned RB4 : 1;
2240 unsigned RB5 : 1;
2241 unsigned RB6 : 1;
2242 unsigned RB7 : 1;
2244 } __DDRBbits_t;
2246 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2248 #define _TRISB0 0x01
2249 #define _RB0 0x01
2250 #define _TRISB1 0x02
2251 #define _RB1 0x02
2252 #define _TRISB2 0x04
2253 #define _RB2 0x04
2254 #define _TRISB3 0x08
2255 #define _RB3 0x08
2256 #define _TRISB4 0x10
2257 #define _RB4 0x10
2258 #define _TRISB5 0x20
2259 #define _RB5 0x20
2260 #define _TRISB6 0x40
2261 #define _RB6 0x40
2262 #define _TRISB7 0x80
2263 #define _RB7 0x80
2265 //==============================================================================
2268 //==============================================================================
2269 // TRISB Bits
2271 extern __at(0x0F93) __sfr TRISB;
2273 typedef union
2275 struct
2277 unsigned TRISB0 : 1;
2278 unsigned TRISB1 : 1;
2279 unsigned TRISB2 : 1;
2280 unsigned TRISB3 : 1;
2281 unsigned TRISB4 : 1;
2282 unsigned TRISB5 : 1;
2283 unsigned TRISB6 : 1;
2284 unsigned TRISB7 : 1;
2287 struct
2289 unsigned RB0 : 1;
2290 unsigned RB1 : 1;
2291 unsigned RB2 : 1;
2292 unsigned RB3 : 1;
2293 unsigned RB4 : 1;
2294 unsigned RB5 : 1;
2295 unsigned RB6 : 1;
2296 unsigned RB7 : 1;
2298 } __TRISBbits_t;
2300 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2302 #define _TRISB_TRISB0 0x01
2303 #define _TRISB_RB0 0x01
2304 #define _TRISB_TRISB1 0x02
2305 #define _TRISB_RB1 0x02
2306 #define _TRISB_TRISB2 0x04
2307 #define _TRISB_RB2 0x04
2308 #define _TRISB_TRISB3 0x08
2309 #define _TRISB_RB3 0x08
2310 #define _TRISB_TRISB4 0x10
2311 #define _TRISB_RB4 0x10
2312 #define _TRISB_TRISB5 0x20
2313 #define _TRISB_RB5 0x20
2314 #define _TRISB_TRISB6 0x40
2315 #define _TRISB_RB6 0x40
2316 #define _TRISB_TRISB7 0x80
2317 #define _TRISB_RB7 0x80
2319 //==============================================================================
2322 //==============================================================================
2323 // DDRC Bits
2325 extern __at(0x0F94) __sfr DDRC;
2327 typedef union
2329 struct
2331 unsigned TRISC0 : 1;
2332 unsigned TRISC1 : 1;
2333 unsigned TRISC2 : 1;
2334 unsigned : 1;
2335 unsigned TRISC4 : 1;
2336 unsigned TRISC5 : 1;
2337 unsigned TRISC6 : 1;
2338 unsigned TRISC7 : 1;
2341 struct
2343 unsigned RC0 : 1;
2344 unsigned RC1 : 1;
2345 unsigned RC2 : 1;
2346 unsigned : 1;
2347 unsigned : 1;
2348 unsigned : 1;
2349 unsigned RC6 : 1;
2350 unsigned RC7 : 1;
2352 } __DDRCbits_t;
2354 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2356 #define _TRISC0 0x01
2357 #define _RC0 0x01
2358 #define _TRISC1 0x02
2359 #define _RC1 0x02
2360 #define _TRISC2 0x04
2361 #define _RC2 0x04
2362 #define _TRISC4 0x10
2363 #define _TRISC5 0x20
2364 #define _TRISC6 0x40
2365 #define _RC6 0x40
2366 #define _TRISC7 0x80
2367 #define _RC7 0x80
2369 //==============================================================================
2372 //==============================================================================
2373 // TRISC Bits
2375 extern __at(0x0F94) __sfr TRISC;
2377 typedef union
2379 struct
2381 unsigned TRISC0 : 1;
2382 unsigned TRISC1 : 1;
2383 unsigned TRISC2 : 1;
2384 unsigned : 1;
2385 unsigned TRISC4 : 1;
2386 unsigned TRISC5 : 1;
2387 unsigned TRISC6 : 1;
2388 unsigned TRISC7 : 1;
2391 struct
2393 unsigned RC0 : 1;
2394 unsigned RC1 : 1;
2395 unsigned RC2 : 1;
2396 unsigned : 1;
2397 unsigned : 1;
2398 unsigned : 1;
2399 unsigned RC6 : 1;
2400 unsigned RC7 : 1;
2402 } __TRISCbits_t;
2404 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2406 #define _TRISC_TRISC0 0x01
2407 #define _TRISC_RC0 0x01
2408 #define _TRISC_TRISC1 0x02
2409 #define _TRISC_RC1 0x02
2410 #define _TRISC_TRISC2 0x04
2411 #define _TRISC_RC2 0x04
2412 #define _TRISC_TRISC4 0x10
2413 #define _TRISC_TRISC5 0x20
2414 #define _TRISC_TRISC6 0x40
2415 #define _TRISC_RC6 0x40
2416 #define _TRISC_TRISC7 0x80
2417 #define _TRISC_RC7 0x80
2419 //==============================================================================
2422 //==============================================================================
2423 // DDRD Bits
2425 extern __at(0x0F95) __sfr DDRD;
2427 typedef union
2429 struct
2431 unsigned TRISD0 : 1;
2432 unsigned TRISD1 : 1;
2433 unsigned TRISD2 : 1;
2434 unsigned TRISD3 : 1;
2435 unsigned TRISD4 : 1;
2436 unsigned TRISD5 : 1;
2437 unsigned TRISD6 : 1;
2438 unsigned TRISD7 : 1;
2441 struct
2443 unsigned RD0 : 1;
2444 unsigned RD1 : 1;
2445 unsigned RD2 : 1;
2446 unsigned RD3 : 1;
2447 unsigned RD4 : 1;
2448 unsigned RD5 : 1;
2449 unsigned RD6 : 1;
2450 unsigned RD7 : 1;
2452 } __DDRDbits_t;
2454 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2456 #define _TRISD0 0x01
2457 #define _RD0 0x01
2458 #define _TRISD1 0x02
2459 #define _RD1 0x02
2460 #define _TRISD2 0x04
2461 #define _RD2 0x04
2462 #define _TRISD3 0x08
2463 #define _RD3 0x08
2464 #define _TRISD4 0x10
2465 #define _RD4 0x10
2466 #define _TRISD5 0x20
2467 #define _RD5 0x20
2468 #define _TRISD6 0x40
2469 #define _RD6 0x40
2470 #define _TRISD7 0x80
2471 #define _RD7 0x80
2473 //==============================================================================
2476 //==============================================================================
2477 // TRISD Bits
2479 extern __at(0x0F95) __sfr TRISD;
2481 typedef union
2483 struct
2485 unsigned TRISD0 : 1;
2486 unsigned TRISD1 : 1;
2487 unsigned TRISD2 : 1;
2488 unsigned TRISD3 : 1;
2489 unsigned TRISD4 : 1;
2490 unsigned TRISD5 : 1;
2491 unsigned TRISD6 : 1;
2492 unsigned TRISD7 : 1;
2495 struct
2497 unsigned RD0 : 1;
2498 unsigned RD1 : 1;
2499 unsigned RD2 : 1;
2500 unsigned RD3 : 1;
2501 unsigned RD4 : 1;
2502 unsigned RD5 : 1;
2503 unsigned RD6 : 1;
2504 unsigned RD7 : 1;
2506 } __TRISDbits_t;
2508 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2510 #define _TRISD_TRISD0 0x01
2511 #define _TRISD_RD0 0x01
2512 #define _TRISD_TRISD1 0x02
2513 #define _TRISD_RD1 0x02
2514 #define _TRISD_TRISD2 0x04
2515 #define _TRISD_RD2 0x04
2516 #define _TRISD_TRISD3 0x08
2517 #define _TRISD_RD3 0x08
2518 #define _TRISD_TRISD4 0x10
2519 #define _TRISD_RD4 0x10
2520 #define _TRISD_TRISD5 0x20
2521 #define _TRISD_RD5 0x20
2522 #define _TRISD_TRISD6 0x40
2523 #define _TRISD_RD6 0x40
2524 #define _TRISD_TRISD7 0x80
2525 #define _TRISD_RD7 0x80
2527 //==============================================================================
2530 //==============================================================================
2531 // DDRE Bits
2533 extern __at(0x0F96) __sfr DDRE;
2535 typedef union
2537 struct
2539 unsigned TRISE0 : 1;
2540 unsigned TRISE1 : 1;
2541 unsigned TRISE2 : 1;
2542 unsigned : 1;
2543 unsigned : 1;
2544 unsigned : 1;
2545 unsigned : 1;
2546 unsigned WPUE3 : 1;
2549 struct
2551 unsigned RE0 : 1;
2552 unsigned RE1 : 1;
2553 unsigned RE2 : 1;
2554 unsigned : 1;
2555 unsigned : 1;
2556 unsigned : 1;
2557 unsigned : 1;
2558 unsigned : 1;
2561 struct
2563 unsigned RE : 3;
2564 unsigned : 5;
2567 struct
2569 unsigned TRISE : 3;
2570 unsigned : 5;
2572 } __DDREbits_t;
2574 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2576 #define _TRISE0 0x01
2577 #define _RE0 0x01
2578 #define _TRISE1 0x02
2579 #define _RE1 0x02
2580 #define _TRISE2 0x04
2581 #define _RE2 0x04
2582 #define _WPUE3 0x80
2584 //==============================================================================
2587 //==============================================================================
2588 // TRISE Bits
2590 extern __at(0x0F96) __sfr TRISE;
2592 typedef union
2594 struct
2596 unsigned TRISE0 : 1;
2597 unsigned TRISE1 : 1;
2598 unsigned TRISE2 : 1;
2599 unsigned : 1;
2600 unsigned : 1;
2601 unsigned : 1;
2602 unsigned : 1;
2603 unsigned WPUE3 : 1;
2606 struct
2608 unsigned RE0 : 1;
2609 unsigned RE1 : 1;
2610 unsigned RE2 : 1;
2611 unsigned : 1;
2612 unsigned : 1;
2613 unsigned : 1;
2614 unsigned : 1;
2615 unsigned : 1;
2618 struct
2620 unsigned TRISE : 3;
2621 unsigned : 5;
2624 struct
2626 unsigned RE : 3;
2627 unsigned : 5;
2629 } __TRISEbits_t;
2631 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2633 #define _TRISE_TRISE0 0x01
2634 #define _TRISE_RE0 0x01
2635 #define _TRISE_TRISE1 0x02
2636 #define _TRISE_RE1 0x02
2637 #define _TRISE_TRISE2 0x04
2638 #define _TRISE_RE2 0x04
2639 #define _TRISE_WPUE3 0x80
2641 //==============================================================================
2644 //==============================================================================
2645 // CCP2CON Bits
2647 extern __at(0x0F97) __sfr CCP2CON;
2649 typedef union
2651 struct
2653 unsigned CCP2M0 : 1;
2654 unsigned CCP2M1 : 1;
2655 unsigned CCP2M2 : 1;
2656 unsigned CCP2M3 : 1;
2657 unsigned DC2B0 : 1;
2658 unsigned DC2B1 : 1;
2659 unsigned : 1;
2660 unsigned : 1;
2663 struct
2665 unsigned : 1;
2666 unsigned : 1;
2667 unsigned : 1;
2668 unsigned : 1;
2669 unsigned CCP2Y : 1;
2670 unsigned CCP2X : 1;
2671 unsigned : 1;
2672 unsigned : 1;
2675 struct
2677 unsigned CCP2M : 4;
2678 unsigned : 4;
2681 struct
2683 unsigned : 4;
2684 unsigned DC2B : 2;
2685 unsigned : 2;
2687 } __CCP2CONbits_t;
2689 extern __at(0x0F97) volatile __CCP2CONbits_t CCP2CONbits;
2691 #define _CCP2M0 0x01
2692 #define _CCP2M1 0x02
2693 #define _CCP2M2 0x04
2694 #define _CCP2M3 0x08
2695 #define _DC2B0 0x10
2696 #define _CCP2Y 0x10
2697 #define _DC2B1 0x20
2698 #define _CCP2X 0x20
2700 //==============================================================================
2703 //==============================================================================
2704 // ECCP2CON Bits
2706 extern __at(0x0F97) __sfr ECCP2CON;
2708 typedef union
2710 struct
2712 unsigned CCP2M0 : 1;
2713 unsigned CCP2M1 : 1;
2714 unsigned CCP2M2 : 1;
2715 unsigned CCP2M3 : 1;
2716 unsigned DC2B0 : 1;
2717 unsigned DC2B1 : 1;
2718 unsigned : 1;
2719 unsigned : 1;
2722 struct
2724 unsigned : 1;
2725 unsigned : 1;
2726 unsigned : 1;
2727 unsigned : 1;
2728 unsigned CCP2Y : 1;
2729 unsigned CCP2X : 1;
2730 unsigned : 1;
2731 unsigned : 1;
2734 struct
2736 unsigned CCP2M : 4;
2737 unsigned : 4;
2740 struct
2742 unsigned : 4;
2743 unsigned DC2B : 2;
2744 unsigned : 2;
2746 } __ECCP2CONbits_t;
2748 extern __at(0x0F97) volatile __ECCP2CONbits_t ECCP2CONbits;
2750 #define _ECCP2CON_CCP2M0 0x01
2751 #define _ECCP2CON_CCP2M1 0x02
2752 #define _ECCP2CON_CCP2M2 0x04
2753 #define _ECCP2CON_CCP2M3 0x08
2754 #define _ECCP2CON_DC2B0 0x10
2755 #define _ECCP2CON_CCP2Y 0x10
2756 #define _ECCP2CON_DC2B1 0x20
2757 #define _ECCP2CON_CCP2X 0x20
2759 //==============================================================================
2762 //==============================================================================
2763 // CM1CON0 Bits
2765 extern __at(0x0F98) __sfr CM1CON0;
2767 typedef union
2769 struct
2771 unsigned C1CH0 : 1;
2772 unsigned C1CH1 : 1;
2773 unsigned C1R : 1;
2774 unsigned C1SP : 1;
2775 unsigned C1POL : 1;
2776 unsigned C1OE : 1;
2777 unsigned C1OUT : 1;
2778 unsigned C1ON : 1;
2781 struct
2783 unsigned CCH0 : 1;
2784 unsigned CCH1 : 1;
2785 unsigned CREF : 1;
2786 unsigned : 1;
2787 unsigned CPOL : 1;
2788 unsigned COE : 1;
2789 unsigned COUT1 : 1;
2790 unsigned CON : 1;
2793 struct
2795 unsigned CCH : 2;
2796 unsigned : 6;
2799 struct
2801 unsigned C1CH : 2;
2802 unsigned : 6;
2804 } __CM1CON0bits_t;
2806 extern __at(0x0F98) volatile __CM1CON0bits_t CM1CON0bits;
2808 #define _C1CH0 0x01
2809 #define _CCH0 0x01
2810 #define _C1CH1 0x02
2811 #define _CCH1 0x02
2812 #define _C1R 0x04
2813 #define _CREF 0x04
2814 #define _C1SP 0x08
2815 #define _C1POL 0x10
2816 #define _CPOL 0x10
2817 #define _C1OE 0x20
2818 #define _COE 0x20
2819 #define _C1OUT 0x40
2820 #define _COUT1 0x40
2821 #define _C1ON 0x80
2822 #define _CON 0x80
2824 //==============================================================================
2827 //==============================================================================
2828 // CM2CON0 Bits
2830 extern __at(0x0F99) __sfr CM2CON0;
2832 typedef union
2834 struct
2836 unsigned C2CH0 : 1;
2837 unsigned C2CH1 : 1;
2838 unsigned C2R : 1;
2839 unsigned C2SP : 1;
2840 unsigned C2POL : 1;
2841 unsigned C2OE : 1;
2842 unsigned C2OUT : 1;
2843 unsigned C2ON : 1;
2846 struct
2848 unsigned CCH0 : 1;
2849 unsigned CCH1 : 1;
2850 unsigned CREF : 1;
2851 unsigned : 1;
2852 unsigned CPOL : 1;
2853 unsigned COE : 1;
2854 unsigned COUT2 : 1;
2855 unsigned CON : 1;
2858 struct
2860 unsigned CCH : 2;
2861 unsigned : 6;
2864 struct
2866 unsigned C2CH : 2;
2867 unsigned : 6;
2869 } __CM2CON0bits_t;
2871 extern __at(0x0F99) volatile __CM2CON0bits_t CM2CON0bits;
2873 #define _CM2CON0_C2CH0 0x01
2874 #define _CM2CON0_CCH0 0x01
2875 #define _CM2CON0_C2CH1 0x02
2876 #define _CM2CON0_CCH1 0x02
2877 #define _CM2CON0_C2R 0x04
2878 #define _CM2CON0_CREF 0x04
2879 #define _CM2CON0_C2SP 0x08
2880 #define _CM2CON0_C2POL 0x10
2881 #define _CM2CON0_CPOL 0x10
2882 #define _CM2CON0_C2OE 0x20
2883 #define _CM2CON0_COE 0x20
2884 #define _CM2CON0_C2OUT 0x40
2885 #define _CM2CON0_COUT2 0x40
2886 #define _CM2CON0_C2ON 0x80
2887 #define _CM2CON0_CON 0x80
2889 //==============================================================================
2892 //==============================================================================
2893 // CM2CON1 Bits
2895 extern __at(0x0F9A) __sfr CM2CON1;
2897 typedef struct
2899 unsigned C2SYNC : 1;
2900 unsigned C1SYNC : 1;
2901 unsigned C2HYS : 1;
2902 unsigned C1HYS : 1;
2903 unsigned C2RSEL : 1;
2904 unsigned C1RSEL : 1;
2905 unsigned MC2OUT : 1;
2906 unsigned MC1OUT : 1;
2907 } __CM2CON1bits_t;
2909 extern __at(0x0F9A) volatile __CM2CON1bits_t CM2CON1bits;
2911 #define _C2SYNC 0x01
2912 #define _C1SYNC 0x02
2913 #define _C2HYS 0x04
2914 #define _C1HYS 0x08
2915 #define _C2RSEL 0x10
2916 #define _C1RSEL 0x20
2917 #define _MC2OUT 0x40
2918 #define _MC1OUT 0x80
2920 //==============================================================================
2923 //==============================================================================
2924 // OSCTUNE Bits
2926 extern __at(0x0F9B) __sfr OSCTUNE;
2928 typedef union
2930 struct
2932 unsigned TUN0 : 1;
2933 unsigned TUN1 : 1;
2934 unsigned TUN2 : 1;
2935 unsigned TUN3 : 1;
2936 unsigned TUN4 : 1;
2937 unsigned TUN5 : 1;
2938 unsigned TUN6 : 1;
2939 unsigned SPLLMULT : 1;
2942 struct
2944 unsigned TUN : 7;
2945 unsigned : 1;
2947 } __OSCTUNEbits_t;
2949 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2951 #define _TUN0 0x01
2952 #define _TUN1 0x02
2953 #define _TUN2 0x04
2954 #define _TUN3 0x08
2955 #define _TUN4 0x10
2956 #define _TUN5 0x20
2957 #define _TUN6 0x40
2958 #define _SPLLMULT 0x80
2960 //==============================================================================
2963 //==============================================================================
2964 // HLVDCON Bits
2966 extern __at(0x0F9C) __sfr HLVDCON;
2968 typedef union
2970 struct
2972 unsigned HLVDL0 : 1;
2973 unsigned HLVDL1 : 1;
2974 unsigned HLVDL2 : 1;
2975 unsigned HLVDL3 : 1;
2976 unsigned HLVDEN : 1;
2977 unsigned IRVST : 1;
2978 unsigned BGVST : 1;
2979 unsigned VDIRMAG : 1;
2982 struct
2984 unsigned HLVDL : 4;
2985 unsigned : 4;
2987 } __HLVDCONbits_t;
2989 extern __at(0x0F9C) volatile __HLVDCONbits_t HLVDCONbits;
2991 #define _HLVDL0 0x01
2992 #define _HLVDL1 0x02
2993 #define _HLVDL2 0x04
2994 #define _HLVDL3 0x08
2995 #define _HLVDEN 0x10
2996 #define _IRVST 0x20
2997 #define _BGVST 0x40
2998 #define _VDIRMAG 0x80
3000 //==============================================================================
3003 //==============================================================================
3004 // PIE1 Bits
3006 extern __at(0x0F9D) __sfr PIE1;
3008 typedef union
3010 struct
3012 unsigned TMR1IE : 1;
3013 unsigned TMR2IE : 1;
3014 unsigned CCP1IE : 1;
3015 unsigned SSPIE : 1;
3016 unsigned TXIE : 1;
3017 unsigned RCIE : 1;
3018 unsigned ADIE : 1;
3019 unsigned ACTIE : 1;
3022 struct
3024 unsigned : 1;
3025 unsigned : 1;
3026 unsigned : 1;
3027 unsigned SSP1IE : 1;
3028 unsigned TX1IE : 1;
3029 unsigned RC1IE : 1;
3030 unsigned : 1;
3031 unsigned STIE : 1;
3033 } __PIE1bits_t;
3035 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3037 #define _TMR1IE 0x01
3038 #define _TMR2IE 0x02
3039 #define _CCP1IE 0x04
3040 #define _SSPIE 0x08
3041 #define _SSP1IE 0x08
3042 #define _TXIE 0x10
3043 #define _TX1IE 0x10
3044 #define _RCIE 0x20
3045 #define _RC1IE 0x20
3046 #define _ADIE 0x40
3047 #define _ACTIE 0x80
3048 #define _STIE 0x80
3050 //==============================================================================
3053 //==============================================================================
3054 // PIR1 Bits
3056 extern __at(0x0F9E) __sfr PIR1;
3058 typedef union
3060 struct
3062 unsigned TMR1IF : 1;
3063 unsigned TMR2IF : 1;
3064 unsigned CCP1IF : 1;
3065 unsigned SSPIF : 1;
3066 unsigned TXIF : 1;
3067 unsigned RCIF : 1;
3068 unsigned ADIF : 1;
3069 unsigned ACTIF : 1;
3072 struct
3074 unsigned : 1;
3075 unsigned : 1;
3076 unsigned : 1;
3077 unsigned SSP1IF : 1;
3078 unsigned TX1IF : 1;
3079 unsigned RC1IF : 1;
3080 unsigned : 1;
3081 unsigned STIF : 1;
3083 } __PIR1bits_t;
3085 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3087 #define _TMR1IF 0x01
3088 #define _TMR2IF 0x02
3089 #define _CCP1IF 0x04
3090 #define _SSPIF 0x08
3091 #define _SSP1IF 0x08
3092 #define _TXIF 0x10
3093 #define _TX1IF 0x10
3094 #define _RCIF 0x20
3095 #define _RC1IF 0x20
3096 #define _ADIF 0x40
3097 #define _ACTIF 0x80
3098 #define _STIF 0x80
3100 //==============================================================================
3103 //==============================================================================
3104 // IPR1 Bits
3106 extern __at(0x0F9F) __sfr IPR1;
3108 typedef union
3110 struct
3112 unsigned TMR1IP : 1;
3113 unsigned TMR2IP : 1;
3114 unsigned CCP1IP : 1;
3115 unsigned SSPIP : 1;
3116 unsigned TXIP : 1;
3117 unsigned RCIP : 1;
3118 unsigned ADIP : 1;
3119 unsigned ACTIP : 1;
3122 struct
3124 unsigned : 1;
3125 unsigned : 1;
3126 unsigned : 1;
3127 unsigned SSP1IP : 1;
3128 unsigned TX1IP : 1;
3129 unsigned RC1IP : 1;
3130 unsigned : 1;
3131 unsigned STIP : 1;
3133 } __IPR1bits_t;
3135 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3137 #define _TMR1IP 0x01
3138 #define _TMR2IP 0x02
3139 #define _CCP1IP 0x04
3140 #define _SSPIP 0x08
3141 #define _SSP1IP 0x08
3142 #define _TXIP 0x10
3143 #define _TX1IP 0x10
3144 #define _RCIP 0x20
3145 #define _RC1IP 0x20
3146 #define _ADIP 0x40
3147 #define _ACTIP 0x80
3148 #define _STIP 0x80
3150 //==============================================================================
3153 //==============================================================================
3154 // PIE2 Bits
3156 extern __at(0x0FA0) __sfr PIE2;
3158 typedef union
3160 struct
3162 unsigned CCP2IE : 1;
3163 unsigned TMR3IE : 1;
3164 unsigned HLVDIE : 1;
3165 unsigned BCLIE : 1;
3166 unsigned EEIE : 1;
3167 unsigned C2IE : 1;
3168 unsigned C1IE : 1;
3169 unsigned OSCFIE : 1;
3172 struct
3174 unsigned : 1;
3175 unsigned : 1;
3176 unsigned LVDIE : 1;
3177 unsigned BCL1IE : 1;
3178 unsigned : 1;
3179 unsigned CM2IE : 1;
3180 unsigned CM1IE : 1;
3181 unsigned : 1;
3183 } __PIE2bits_t;
3185 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3187 #define _CCP2IE 0x01
3188 #define _TMR3IE 0x02
3189 #define _HLVDIE 0x04
3190 #define _LVDIE 0x04
3191 #define _BCLIE 0x08
3192 #define _BCL1IE 0x08
3193 #define _EEIE 0x10
3194 #define _C2IE 0x20
3195 #define _CM2IE 0x20
3196 #define _C1IE 0x40
3197 #define _CM1IE 0x40
3198 #define _OSCFIE 0x80
3200 //==============================================================================
3203 //==============================================================================
3204 // PIR2 Bits
3206 extern __at(0x0FA1) __sfr PIR2;
3208 typedef union
3210 struct
3212 unsigned CCP2IF : 1;
3213 unsigned TMR3IF : 1;
3214 unsigned HLVDIF : 1;
3215 unsigned BCLIF : 1;
3216 unsigned EEIF : 1;
3217 unsigned C2IF : 1;
3218 unsigned C1IF : 1;
3219 unsigned OSCFIF : 1;
3222 struct
3224 unsigned : 1;
3225 unsigned : 1;
3226 unsigned LVDIF : 1;
3227 unsigned BCL1IF : 1;
3228 unsigned : 1;
3229 unsigned CM2IF : 1;
3230 unsigned CM1IF : 1;
3231 unsigned : 1;
3233 } __PIR2bits_t;
3235 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3237 #define _CCP2IF 0x01
3238 #define _TMR3IF 0x02
3239 #define _HLVDIF 0x04
3240 #define _LVDIF 0x04
3241 #define _BCLIF 0x08
3242 #define _BCL1IF 0x08
3243 #define _EEIF 0x10
3244 #define _C2IF 0x20
3245 #define _CM2IF 0x20
3246 #define _C1IF 0x40
3247 #define _CM1IF 0x40
3248 #define _OSCFIF 0x80
3250 //==============================================================================
3253 //==============================================================================
3254 // IPR2 Bits
3256 extern __at(0x0FA2) __sfr IPR2;
3258 typedef union
3260 struct
3262 unsigned CCP2IP : 1;
3263 unsigned TMR3IP : 1;
3264 unsigned HLVDIP : 1;
3265 unsigned BCLIP : 1;
3266 unsigned EEIP : 1;
3267 unsigned C2IP : 1;
3268 unsigned C1IP : 1;
3269 unsigned OSCFIP : 1;
3272 struct
3274 unsigned : 1;
3275 unsigned : 1;
3276 unsigned LVDIP : 1;
3277 unsigned BCL1IP : 1;
3278 unsigned : 1;
3279 unsigned CM2IP : 1;
3280 unsigned CM1IP : 1;
3281 unsigned : 1;
3283 } __IPR2bits_t;
3285 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3287 #define _CCP2IP 0x01
3288 #define _TMR3IP 0x02
3289 #define _HLVDIP 0x04
3290 #define _LVDIP 0x04
3291 #define _BCLIP 0x08
3292 #define _BCL1IP 0x08
3293 #define _EEIP 0x10
3294 #define _C2IP 0x20
3295 #define _CM2IP 0x20
3296 #define _C1IP 0x40
3297 #define _CM1IP 0x40
3298 #define _OSCFIP 0x80
3300 //==============================================================================
3303 //==============================================================================
3304 // PIE3 Bits
3306 extern __at(0x0FA3) __sfr PIE3;
3308 typedef struct
3310 unsigned TMR1GIE : 1;
3311 unsigned TMR3GIE : 1;
3312 unsigned USBIE : 1;
3313 unsigned CTMUIE : 1;
3314 unsigned : 1;
3315 unsigned : 1;
3316 unsigned : 1;
3317 unsigned : 1;
3318 } __PIE3bits_t;
3320 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3322 #define _TMR1GIE 0x01
3323 #define _TMR3GIE 0x02
3324 #define _USBIE 0x04
3325 #define _CTMUIE 0x08
3327 //==============================================================================
3330 //==============================================================================
3331 // PIR3 Bits
3333 extern __at(0x0FA4) __sfr PIR3;
3335 typedef struct
3337 unsigned TMR1GIF : 1;
3338 unsigned TMR3GIF : 1;
3339 unsigned USBIF : 1;
3340 unsigned CTMUIF : 1;
3341 unsigned : 1;
3342 unsigned : 1;
3343 unsigned : 1;
3344 unsigned : 1;
3345 } __PIR3bits_t;
3347 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3349 #define _TMR1GIF 0x01
3350 #define _TMR3GIF 0x02
3351 #define _USBIF 0x04
3352 #define _CTMUIF 0x08
3354 //==============================================================================
3357 //==============================================================================
3358 // IPR3 Bits
3360 extern __at(0x0FA5) __sfr IPR3;
3362 typedef struct
3364 unsigned TMR1GIP : 1;
3365 unsigned TMR3GIP : 1;
3366 unsigned USBIP : 1;
3367 unsigned CTMUIP : 1;
3368 unsigned : 1;
3369 unsigned : 1;
3370 unsigned : 1;
3371 unsigned : 1;
3372 } __IPR3bits_t;
3374 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3376 #define _TMR1GIP 0x01
3377 #define _TMR3GIP 0x02
3378 #define _USBIP 0x04
3379 #define _CTMUIP 0x08
3381 //==============================================================================
3384 //==============================================================================
3385 // EECON1 Bits
3387 extern __at(0x0FA6) __sfr EECON1;
3389 typedef struct
3391 unsigned RD : 1;
3392 unsigned WR : 1;
3393 unsigned WREN : 1;
3394 unsigned WRERR : 1;
3395 unsigned FREE : 1;
3396 unsigned : 1;
3397 unsigned CFGS : 1;
3398 unsigned EEPGD : 1;
3399 } __EECON1bits_t;
3401 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3403 #define _RD 0x01
3404 #define _WR 0x02
3405 #define _WREN 0x04
3406 #define _WRERR 0x08
3407 #define _FREE 0x10
3408 #define _CFGS 0x40
3409 #define _EEPGD 0x80
3411 //==============================================================================
3413 extern __at(0x0FA7) __sfr EECON2;
3414 extern __at(0x0FA8) __sfr EEDATA;
3415 extern __at(0x0FA9) __sfr EEADR;
3417 //==============================================================================
3418 // RCSTA Bits
3420 extern __at(0x0FAB) __sfr RCSTA;
3422 typedef union
3424 struct
3426 unsigned RX9D : 1;
3427 unsigned OERR : 1;
3428 unsigned FERR : 1;
3429 unsigned ADDEN : 1;
3430 unsigned CREN : 1;
3431 unsigned SREN : 1;
3432 unsigned RX9 : 1;
3433 unsigned SPEN : 1;
3436 struct
3438 unsigned : 1;
3439 unsigned : 1;
3440 unsigned : 1;
3441 unsigned ADEN : 1;
3442 unsigned : 1;
3443 unsigned : 1;
3444 unsigned : 1;
3445 unsigned : 1;
3447 } __RCSTAbits_t;
3449 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3451 #define _RX9D 0x01
3452 #define _OERR 0x02
3453 #define _FERR 0x04
3454 #define _ADDEN 0x08
3455 #define _ADEN 0x08
3456 #define _CREN 0x10
3457 #define _SREN 0x20
3458 #define _RX9 0x40
3459 #define _SPEN 0x80
3461 //==============================================================================
3464 //==============================================================================
3465 // RCSTA1 Bits
3467 extern __at(0x0FAB) __sfr RCSTA1;
3469 typedef union
3471 struct
3473 unsigned RX9D : 1;
3474 unsigned OERR : 1;
3475 unsigned FERR : 1;
3476 unsigned ADDEN : 1;
3477 unsigned CREN : 1;
3478 unsigned SREN : 1;
3479 unsigned RX9 : 1;
3480 unsigned SPEN : 1;
3483 struct
3485 unsigned : 1;
3486 unsigned : 1;
3487 unsigned : 1;
3488 unsigned ADEN : 1;
3489 unsigned : 1;
3490 unsigned : 1;
3491 unsigned : 1;
3492 unsigned : 1;
3494 } __RCSTA1bits_t;
3496 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
3498 #define _RCSTA1_RX9D 0x01
3499 #define _RCSTA1_OERR 0x02
3500 #define _RCSTA1_FERR 0x04
3501 #define _RCSTA1_ADDEN 0x08
3502 #define _RCSTA1_ADEN 0x08
3503 #define _RCSTA1_CREN 0x10
3504 #define _RCSTA1_SREN 0x20
3505 #define _RCSTA1_RX9 0x40
3506 #define _RCSTA1_SPEN 0x80
3508 //==============================================================================
3511 //==============================================================================
3512 // TXSTA Bits
3514 extern __at(0x0FAC) __sfr TXSTA;
3516 typedef struct
3518 unsigned TX9D : 1;
3519 unsigned TRMT : 1;
3520 unsigned BRGH : 1;
3521 unsigned SENDB : 1;
3522 unsigned SYNC : 1;
3523 unsigned TXEN : 1;
3524 unsigned TX9 : 1;
3525 unsigned CSRC : 1;
3526 } __TXSTAbits_t;
3528 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
3530 #define _TX9D 0x01
3531 #define _TRMT 0x02
3532 #define _BRGH 0x04
3533 #define _SENDB 0x08
3534 #define _SYNC 0x10
3535 #define _TXEN 0x20
3536 #define _TX9 0x40
3537 #define _CSRC 0x80
3539 //==============================================================================
3542 //==============================================================================
3543 // TXSTA1 Bits
3545 extern __at(0x0FAC) __sfr TXSTA1;
3547 typedef struct
3549 unsigned TX9D : 1;
3550 unsigned TRMT : 1;
3551 unsigned BRGH : 1;
3552 unsigned SENDB : 1;
3553 unsigned SYNC : 1;
3554 unsigned TXEN : 1;
3555 unsigned TX9 : 1;
3556 unsigned CSRC : 1;
3557 } __TXSTA1bits_t;
3559 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
3561 #define _TXSTA1_TX9D 0x01
3562 #define _TXSTA1_TRMT 0x02
3563 #define _TXSTA1_BRGH 0x04
3564 #define _TXSTA1_SENDB 0x08
3565 #define _TXSTA1_SYNC 0x10
3566 #define _TXSTA1_TXEN 0x20
3567 #define _TXSTA1_TX9 0x40
3568 #define _TXSTA1_CSRC 0x80
3570 //==============================================================================
3572 extern __at(0x0FAD) __sfr TXREG;
3573 extern __at(0x0FAD) __sfr TXREG1;
3574 extern __at(0x0FAE) __sfr RCREG;
3575 extern __at(0x0FAE) __sfr RCREG1;
3577 //==============================================================================
3578 // SPBRG Bits
3580 extern __at(0x0FAF) __sfr SPBRG;
3582 typedef struct
3584 unsigned BRG0 : 1;
3585 unsigned BRG1 : 1;
3586 unsigned BRG2 : 1;
3587 unsigned BRG3 : 1;
3588 unsigned BRG4 : 1;
3589 unsigned BRG5 : 1;
3590 unsigned BRG6 : 1;
3591 unsigned BRG7 : 1;
3592 } __SPBRGbits_t;
3594 extern __at(0x0FAF) volatile __SPBRGbits_t SPBRGbits;
3596 #define _BRG0 0x01
3597 #define _BRG1 0x02
3598 #define _BRG2 0x04
3599 #define _BRG3 0x08
3600 #define _BRG4 0x10
3601 #define _BRG5 0x20
3602 #define _BRG6 0x40
3603 #define _BRG7 0x80
3605 //==============================================================================
3608 //==============================================================================
3609 // SPBRG1 Bits
3611 extern __at(0x0FAF) __sfr SPBRG1;
3613 typedef struct
3615 unsigned BRG0 : 1;
3616 unsigned BRG1 : 1;
3617 unsigned BRG2 : 1;
3618 unsigned BRG3 : 1;
3619 unsigned BRG4 : 1;
3620 unsigned BRG5 : 1;
3621 unsigned BRG6 : 1;
3622 unsigned BRG7 : 1;
3623 } __SPBRG1bits_t;
3625 extern __at(0x0FAF) volatile __SPBRG1bits_t SPBRG1bits;
3627 #define _SPBRG1_BRG0 0x01
3628 #define _SPBRG1_BRG1 0x02
3629 #define _SPBRG1_BRG2 0x04
3630 #define _SPBRG1_BRG3 0x08
3631 #define _SPBRG1_BRG4 0x10
3632 #define _SPBRG1_BRG5 0x20
3633 #define _SPBRG1_BRG6 0x40
3634 #define _SPBRG1_BRG7 0x80
3636 //==============================================================================
3639 //==============================================================================
3640 // SPBRGH Bits
3642 extern __at(0x0FB0) __sfr SPBRGH;
3644 typedef struct
3646 unsigned BRG8 : 1;
3647 unsigned BRG9 : 1;
3648 unsigned BRG10 : 1;
3649 unsigned BRG11 : 1;
3650 unsigned BRG12 : 1;
3651 unsigned BRG13 : 1;
3652 unsigned BRG14 : 1;
3653 unsigned BRG15 : 1;
3654 } __SPBRGHbits_t;
3656 extern __at(0x0FB0) volatile __SPBRGHbits_t SPBRGHbits;
3658 #define _BRG8 0x01
3659 #define _BRG9 0x02
3660 #define _BRG10 0x04
3661 #define _BRG11 0x08
3662 #define _BRG12 0x10
3663 #define _BRG13 0x20
3664 #define _BRG14 0x40
3665 #define _BRG15 0x80
3667 //==============================================================================
3670 //==============================================================================
3671 // SPBRGH1 Bits
3673 extern __at(0x0FB0) __sfr SPBRGH1;
3675 typedef struct
3677 unsigned BRG8 : 1;
3678 unsigned BRG9 : 1;
3679 unsigned BRG10 : 1;
3680 unsigned BRG11 : 1;
3681 unsigned BRG12 : 1;
3682 unsigned BRG13 : 1;
3683 unsigned BRG14 : 1;
3684 unsigned BRG15 : 1;
3685 } __SPBRGH1bits_t;
3687 extern __at(0x0FB0) volatile __SPBRGH1bits_t SPBRGH1bits;
3689 #define _SPBRGH1_BRG8 0x01
3690 #define _SPBRGH1_BRG9 0x02
3691 #define _SPBRGH1_BRG10 0x04
3692 #define _SPBRGH1_BRG11 0x08
3693 #define _SPBRGH1_BRG12 0x10
3694 #define _SPBRGH1_BRG13 0x20
3695 #define _SPBRGH1_BRG14 0x40
3696 #define _SPBRGH1_BRG15 0x80
3698 //==============================================================================
3701 //==============================================================================
3702 // T3CON Bits
3704 extern __at(0x0FB1) __sfr T3CON;
3706 typedef union
3708 struct
3710 unsigned TMR3ON : 1;
3711 unsigned RD16 : 1;
3712 unsigned NOT_T3SYNC : 1;
3713 unsigned SOSCEN : 1;
3714 unsigned T3CKPS0 : 1;
3715 unsigned T3CKPS1 : 1;
3716 unsigned TMR3CS0 : 1;
3717 unsigned TMR3CS1 : 1;
3720 struct
3722 unsigned : 1;
3723 unsigned T3RD16 : 1;
3724 unsigned T3SYNC : 1;
3725 unsigned T3SOSCEN : 1;
3726 unsigned : 1;
3727 unsigned : 1;
3728 unsigned : 1;
3729 unsigned : 1;
3732 struct
3734 unsigned : 1;
3735 unsigned : 1;
3736 unsigned : 1;
3737 unsigned T3OSCEN : 1;
3738 unsigned : 1;
3739 unsigned : 1;
3740 unsigned : 1;
3741 unsigned : 1;
3744 struct
3746 unsigned : 4;
3747 unsigned T3CKPS : 2;
3748 unsigned : 2;
3751 struct
3753 unsigned : 6;
3754 unsigned TMR3CS : 2;
3756 } __T3CONbits_t;
3758 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
3760 #define _T3CON_TMR3ON 0x01
3761 #define _T3CON_RD16 0x02
3762 #define _T3CON_T3RD16 0x02
3763 #define _T3CON_NOT_T3SYNC 0x04
3764 #define _T3CON_T3SYNC 0x04
3765 #define _T3CON_SOSCEN 0x08
3766 #define _T3CON_T3SOSCEN 0x08
3767 #define _T3CON_T3OSCEN 0x08
3768 #define _T3CON_T3CKPS0 0x10
3769 #define _T3CON_T3CKPS1 0x20
3770 #define _T3CON_TMR3CS0 0x40
3771 #define _T3CON_TMR3CS1 0x80
3773 //==============================================================================
3775 extern __at(0x0FB2) __sfr TMR3;
3776 extern __at(0x0FB2) __sfr TMR3L;
3777 extern __at(0x0FB3) __sfr TMR3H;
3779 //==============================================================================
3780 // T3GCON Bits
3782 extern __at(0x0FB4) __sfr T3GCON;
3784 typedef union
3786 struct
3788 unsigned T3GSS0 : 1;
3789 unsigned T3GSS1 : 1;
3790 unsigned T3GVAL : 1;
3791 unsigned T3GGO_NOT_T3DONE : 1;
3792 unsigned T3GSPM : 1;
3793 unsigned T3GTM : 1;
3794 unsigned T3GPOL : 1;
3795 unsigned TMR3GE : 1;
3798 struct
3800 unsigned : 1;
3801 unsigned : 1;
3802 unsigned : 1;
3803 unsigned T3GGO : 1;
3804 unsigned : 1;
3805 unsigned : 1;
3806 unsigned : 1;
3807 unsigned : 1;
3810 struct
3812 unsigned : 1;
3813 unsigned : 1;
3814 unsigned : 1;
3815 unsigned NOT_T3DONE : 1;
3816 unsigned : 1;
3817 unsigned : 1;
3818 unsigned : 1;
3819 unsigned : 1;
3822 struct
3824 unsigned : 1;
3825 unsigned : 1;
3826 unsigned : 1;
3827 unsigned T3DONE : 1;
3828 unsigned : 1;
3829 unsigned : 1;
3830 unsigned : 1;
3831 unsigned : 1;
3834 struct
3836 unsigned : 1;
3837 unsigned : 1;
3838 unsigned : 1;
3839 unsigned T3GGO_NOT_DONE : 1;
3840 unsigned : 1;
3841 unsigned : 1;
3842 unsigned : 1;
3843 unsigned : 1;
3846 struct
3848 unsigned T3GSS : 2;
3849 unsigned : 6;
3851 } __T3GCONbits_t;
3853 extern __at(0x0FB4) volatile __T3GCONbits_t T3GCONbits;
3855 #define _T3GSS0 0x01
3856 #define _T3GSS1 0x02
3857 #define _T3GVAL 0x04
3858 #define _T3GGO_NOT_T3DONE 0x08
3859 #define _T3GGO 0x08
3860 #define _NOT_T3DONE 0x08
3861 #define _T3DONE 0x08
3862 #define _T3GGO_NOT_DONE 0x08
3863 #define _T3GSPM 0x10
3864 #define _T3GTM 0x20
3865 #define _T3GPOL 0x40
3866 #define _TMR3GE 0x80
3868 //==============================================================================
3871 //==============================================================================
3872 // ACTCON Bits
3874 extern __at(0x0FB5) __sfr ACTCON;
3876 typedef union
3878 struct
3880 unsigned : 1;
3881 unsigned ACTORS : 1;
3882 unsigned : 1;
3883 unsigned ACTLOCK : 1;
3884 unsigned ACTSRC : 1;
3885 unsigned : 1;
3886 unsigned ACTUD : 1;
3887 unsigned ACTEN : 1;
3890 struct
3892 unsigned : 1;
3893 unsigned STOR : 1;
3894 unsigned : 1;
3895 unsigned STLOCK : 1;
3896 unsigned STSRC : 1;
3897 unsigned : 1;
3898 unsigned STUD : 1;
3899 unsigned STEN : 1;
3902 struct
3904 unsigned : 1;
3905 unsigned ACTOR : 1;
3906 unsigned : 1;
3907 unsigned : 1;
3908 unsigned : 1;
3909 unsigned : 1;
3910 unsigned ACTD : 1;
3911 unsigned ACTSEL : 1;
3913 } __ACTCONbits_t;
3915 extern __at(0x0FB5) volatile __ACTCONbits_t ACTCONbits;
3917 #define _ACTORS 0x02
3918 #define _STOR 0x02
3919 #define _ACTOR 0x02
3920 #define _ACTLOCK 0x08
3921 #define _STLOCK 0x08
3922 #define _ACTSRC 0x10
3923 #define _STSRC 0x10
3924 #define _ACTUD 0x40
3925 #define _STUD 0x40
3926 #define _ACTD 0x40
3927 #define _ACTEN 0x80
3928 #define _STEN 0x80
3929 #define _ACTSEL 0x80
3931 //==============================================================================
3934 //==============================================================================
3935 // STCON Bits
3937 extern __at(0x0FB5) __sfr STCON;
3939 typedef union
3941 struct
3943 unsigned : 1;
3944 unsigned ACTORS : 1;
3945 unsigned : 1;
3946 unsigned ACTLOCK : 1;
3947 unsigned ACTSRC : 1;
3948 unsigned : 1;
3949 unsigned ACTUD : 1;
3950 unsigned ACTEN : 1;
3953 struct
3955 unsigned : 1;
3956 unsigned STOR : 1;
3957 unsigned : 1;
3958 unsigned STLOCK : 1;
3959 unsigned STSRC : 1;
3960 unsigned : 1;
3961 unsigned STUD : 1;
3962 unsigned STEN : 1;
3965 struct
3967 unsigned : 1;
3968 unsigned ACTOR : 1;
3969 unsigned : 1;
3970 unsigned : 1;
3971 unsigned : 1;
3972 unsigned : 1;
3973 unsigned ACTD : 1;
3974 unsigned ACTSEL : 1;
3976 } __STCONbits_t;
3978 extern __at(0x0FB5) volatile __STCONbits_t STCONbits;
3980 #define _STCON_ACTORS 0x02
3981 #define _STCON_STOR 0x02
3982 #define _STCON_ACTOR 0x02
3983 #define _STCON_ACTLOCK 0x08
3984 #define _STCON_STLOCK 0x08
3985 #define _STCON_ACTSRC 0x10
3986 #define _STCON_STSRC 0x10
3987 #define _STCON_ACTUD 0x40
3988 #define _STCON_STUD 0x40
3989 #define _STCON_ACTD 0x40
3990 #define _STCON_ACTEN 0x80
3991 #define _STCON_STEN 0x80
3992 #define _STCON_ACTSEL 0x80
3994 //==============================================================================
3997 //==============================================================================
3998 // ECCP1AS Bits
4000 extern __at(0x0FB6) __sfr ECCP1AS;
4002 typedef union
4004 struct
4006 unsigned PSS1BD0 : 1;
4007 unsigned PSS1BD1 : 1;
4008 unsigned PSS1AC0 : 1;
4009 unsigned PSS1AC1 : 1;
4010 unsigned ECCP1AS0 : 1;
4011 unsigned ECCP1AS1 : 1;
4012 unsigned ECCP1AS2 : 1;
4013 unsigned ECCP1ASE : 1;
4016 struct
4018 unsigned PSSBD0 : 1;
4019 unsigned PSSBD1 : 1;
4020 unsigned PSSAC0 : 1;
4021 unsigned PSSAC1 : 1;
4022 unsigned : 1;
4023 unsigned : 1;
4024 unsigned : 1;
4025 unsigned CCP1ASE : 1;
4028 struct
4030 unsigned PSSBD : 2;
4031 unsigned : 6;
4034 struct
4036 unsigned PSS1BD : 2;
4037 unsigned : 6;
4040 struct
4042 unsigned : 2;
4043 unsigned PSSAC : 2;
4044 unsigned : 4;
4047 struct
4049 unsigned : 2;
4050 unsigned PSS1AC : 2;
4051 unsigned : 4;
4054 struct
4056 unsigned : 4;
4057 unsigned ECCP1AS : 3;
4058 unsigned : 1;
4060 } __ECCP1ASbits_t;
4062 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
4064 #define _PSS1BD0 0x01
4065 #define _PSSBD0 0x01
4066 #define _PSS1BD1 0x02
4067 #define _PSSBD1 0x02
4068 #define _PSS1AC0 0x04
4069 #define _PSSAC0 0x04
4070 #define _PSS1AC1 0x08
4071 #define _PSSAC1 0x08
4072 #define _ECCP1AS0 0x10
4073 #define _ECCP1AS1 0x20
4074 #define _ECCP1AS2 0x40
4075 #define _ECCP1ASE 0x80
4076 #define _CCP1ASE 0x80
4078 //==============================================================================
4081 //==============================================================================
4082 // ECCP1DEL Bits
4084 extern __at(0x0FB7) __sfr ECCP1DEL;
4086 typedef union
4088 struct
4090 unsigned PDC0 : 1;
4091 unsigned PDC1 : 1;
4092 unsigned PDC2 : 1;
4093 unsigned PDC3 : 1;
4094 unsigned PDC4 : 1;
4095 unsigned PDC5 : 1;
4096 unsigned PDC6 : 1;
4097 unsigned P1RSEN : 1;
4100 struct
4102 unsigned : 1;
4103 unsigned : 1;
4104 unsigned : 1;
4105 unsigned : 1;
4106 unsigned : 1;
4107 unsigned : 1;
4108 unsigned : 1;
4109 unsigned PR1SEN : 1;
4112 struct
4114 unsigned PDC : 7;
4115 unsigned : 1;
4117 } __ECCP1DELbits_t;
4119 extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits;
4121 #define _PDC0 0x01
4122 #define _PDC1 0x02
4123 #define _PDC2 0x04
4124 #define _PDC3 0x08
4125 #define _PDC4 0x10
4126 #define _PDC5 0x20
4127 #define _PDC6 0x40
4128 #define _P1RSEN 0x80
4129 #define _PR1SEN 0x80
4131 //==============================================================================
4134 //==============================================================================
4135 // PWM1CON Bits
4137 extern __at(0x0FB7) __sfr PWM1CON;
4139 typedef union
4141 struct
4143 unsigned PDC0 : 1;
4144 unsigned PDC1 : 1;
4145 unsigned PDC2 : 1;
4146 unsigned PDC3 : 1;
4147 unsigned PDC4 : 1;
4148 unsigned PDC5 : 1;
4149 unsigned PDC6 : 1;
4150 unsigned P1RSEN : 1;
4153 struct
4155 unsigned : 1;
4156 unsigned : 1;
4157 unsigned : 1;
4158 unsigned : 1;
4159 unsigned : 1;
4160 unsigned : 1;
4161 unsigned : 1;
4162 unsigned PR1SEN : 1;
4165 struct
4167 unsigned PDC : 7;
4168 unsigned : 1;
4170 } __PWM1CONbits_t;
4172 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
4174 #define _PWM1CON_PDC0 0x01
4175 #define _PWM1CON_PDC1 0x02
4176 #define _PWM1CON_PDC2 0x04
4177 #define _PWM1CON_PDC3 0x08
4178 #define _PWM1CON_PDC4 0x10
4179 #define _PWM1CON_PDC5 0x20
4180 #define _PWM1CON_PDC6 0x40
4181 #define _PWM1CON_P1RSEN 0x80
4182 #define _PWM1CON_PR1SEN 0x80
4184 //==============================================================================
4187 //==============================================================================
4188 // BAUDCON Bits
4190 extern __at(0x0FB8) __sfr BAUDCON;
4192 typedef union
4194 struct
4196 unsigned ABDEN : 1;
4197 unsigned WUE : 1;
4198 unsigned : 1;
4199 unsigned BRG16 : 1;
4200 unsigned TXCKP : 1;
4201 unsigned RXDTP : 1;
4202 unsigned RCIDL : 1;
4203 unsigned ABDOVF : 1;
4206 struct
4208 unsigned : 1;
4209 unsigned : 1;
4210 unsigned : 1;
4211 unsigned : 1;
4212 unsigned CKTXP : 1;
4213 unsigned DTRXP : 1;
4214 unsigned RCMT : 1;
4215 unsigned : 1;
4218 struct
4220 unsigned : 1;
4221 unsigned : 1;
4222 unsigned : 1;
4223 unsigned : 1;
4224 unsigned SCKP : 1;
4225 unsigned : 1;
4226 unsigned : 1;
4227 unsigned : 1;
4229 } __BAUDCONbits_t;
4231 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
4233 #define _ABDEN 0x01
4234 #define _WUE 0x02
4235 #define _BRG16 0x08
4236 #define _TXCKP 0x10
4237 #define _CKTXP 0x10
4238 #define _SCKP 0x10
4239 #define _RXDTP 0x20
4240 #define _DTRXP 0x20
4241 #define _RCIDL 0x40
4242 #define _RCMT 0x40
4243 #define _ABDOVF 0x80
4245 //==============================================================================
4248 //==============================================================================
4249 // BAUDCON1 Bits
4251 extern __at(0x0FB8) __sfr BAUDCON1;
4253 typedef union
4255 struct
4257 unsigned ABDEN : 1;
4258 unsigned WUE : 1;
4259 unsigned : 1;
4260 unsigned BRG16 : 1;
4261 unsigned TXCKP : 1;
4262 unsigned RXDTP : 1;
4263 unsigned RCIDL : 1;
4264 unsigned ABDOVF : 1;
4267 struct
4269 unsigned : 1;
4270 unsigned : 1;
4271 unsigned : 1;
4272 unsigned : 1;
4273 unsigned CKTXP : 1;
4274 unsigned DTRXP : 1;
4275 unsigned RCMT : 1;
4276 unsigned : 1;
4279 struct
4281 unsigned : 1;
4282 unsigned : 1;
4283 unsigned : 1;
4284 unsigned : 1;
4285 unsigned SCKP : 1;
4286 unsigned : 1;
4287 unsigned : 1;
4288 unsigned : 1;
4290 } __BAUDCON1bits_t;
4292 extern __at(0x0FB8) volatile __BAUDCON1bits_t BAUDCON1bits;
4294 #define _BAUDCON1_ABDEN 0x01
4295 #define _BAUDCON1_WUE 0x02
4296 #define _BAUDCON1_BRG16 0x08
4297 #define _BAUDCON1_TXCKP 0x10
4298 #define _BAUDCON1_CKTXP 0x10
4299 #define _BAUDCON1_SCKP 0x10
4300 #define _BAUDCON1_RXDTP 0x20
4301 #define _BAUDCON1_DTRXP 0x20
4302 #define _BAUDCON1_RCIDL 0x40
4303 #define _BAUDCON1_RCMT 0x40
4304 #define _BAUDCON1_ABDOVF 0x80
4306 //==============================================================================
4309 //==============================================================================
4310 // PSTR1CON Bits
4312 extern __at(0x0FB9) __sfr PSTR1CON;
4314 typedef union
4316 struct
4318 unsigned STRA : 1;
4319 unsigned STRB : 1;
4320 unsigned STRC : 1;
4321 unsigned STRD : 1;
4322 unsigned STRSYNC : 1;
4323 unsigned : 1;
4324 unsigned : 1;
4325 unsigned : 1;
4328 struct
4330 unsigned STR1A : 1;
4331 unsigned STR1B : 1;
4332 unsigned STR1C : 1;
4333 unsigned STR1D : 1;
4334 unsigned STR1SYNC : 1;
4335 unsigned : 1;
4336 unsigned : 1;
4337 unsigned : 1;
4339 } __PSTR1CONbits_t;
4341 extern __at(0x0FB9) volatile __PSTR1CONbits_t PSTR1CONbits;
4343 #define _STRA 0x01
4344 #define _STR1A 0x01
4345 #define _STRB 0x02
4346 #define _STR1B 0x02
4347 #define _STRC 0x04
4348 #define _STR1C 0x04
4349 #define _STRD 0x08
4350 #define _STR1D 0x08
4351 #define _STRSYNC 0x10
4352 #define _STR1SYNC 0x10
4354 //==============================================================================
4357 //==============================================================================
4358 // T2CON Bits
4360 extern __at(0x0FBA) __sfr T2CON;
4362 typedef union
4364 struct
4366 unsigned T2CKPS0 : 1;
4367 unsigned T2CKPS1 : 1;
4368 unsigned TMR2ON : 1;
4369 unsigned T2OUTPS0 : 1;
4370 unsigned T2OUTPS1 : 1;
4371 unsigned T2OUTPS2 : 1;
4372 unsigned T2OUTPS3 : 1;
4373 unsigned : 1;
4376 struct
4378 unsigned T2CKPS : 2;
4379 unsigned : 6;
4382 struct
4384 unsigned : 3;
4385 unsigned T2OUTPS : 4;
4386 unsigned : 1;
4388 } __T2CONbits_t;
4390 extern __at(0x0FBA) volatile __T2CONbits_t T2CONbits;
4392 #define _T2CKPS0 0x01
4393 #define _T2CKPS1 0x02
4394 #define _TMR2ON 0x04
4395 #define _T2OUTPS0 0x08
4396 #define _T2OUTPS1 0x10
4397 #define _T2OUTPS2 0x20
4398 #define _T2OUTPS3 0x40
4400 //==============================================================================
4402 extern __at(0x0FBB) __sfr PR2;
4403 extern __at(0x0FBC) __sfr TMR2;
4405 //==============================================================================
4406 // CCP1CON Bits
4408 extern __at(0x0FBD) __sfr CCP1CON;
4410 typedef union
4412 struct
4414 unsigned CCP1M0 : 1;
4415 unsigned CCP1M1 : 1;
4416 unsigned CCP1M2 : 1;
4417 unsigned CCP1M3 : 1;
4418 unsigned DC1B0 : 1;
4419 unsigned DC1B1 : 1;
4420 unsigned P1M0 : 1;
4421 unsigned P1M1 : 1;
4424 struct
4426 unsigned : 1;
4427 unsigned : 1;
4428 unsigned : 1;
4429 unsigned : 1;
4430 unsigned CCP1Y : 1;
4431 unsigned CCP1X : 1;
4432 unsigned : 1;
4433 unsigned : 1;
4436 struct
4438 unsigned CCP1M : 4;
4439 unsigned : 4;
4442 struct
4444 unsigned : 4;
4445 unsigned DC1B : 2;
4446 unsigned : 2;
4449 struct
4451 unsigned : 6;
4452 unsigned P1M : 2;
4454 } __CCP1CONbits_t;
4456 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
4458 #define _CCP1M0 0x01
4459 #define _CCP1M1 0x02
4460 #define _CCP1M2 0x04
4461 #define _CCP1M3 0x08
4462 #define _DC1B0 0x10
4463 #define _CCP1Y 0x10
4464 #define _DC1B1 0x20
4465 #define _CCP1X 0x20
4466 #define _P1M0 0x40
4467 #define _P1M1 0x80
4469 //==============================================================================
4472 //==============================================================================
4473 // ECCP1CON Bits
4475 extern __at(0x0FBD) __sfr ECCP1CON;
4477 typedef union
4479 struct
4481 unsigned CCP1M0 : 1;
4482 unsigned CCP1M1 : 1;
4483 unsigned CCP1M2 : 1;
4484 unsigned CCP1M3 : 1;
4485 unsigned DC1B0 : 1;
4486 unsigned DC1B1 : 1;
4487 unsigned P1M0 : 1;
4488 unsigned P1M1 : 1;
4491 struct
4493 unsigned : 1;
4494 unsigned : 1;
4495 unsigned : 1;
4496 unsigned : 1;
4497 unsigned CCP1Y : 1;
4498 unsigned CCP1X : 1;
4499 unsigned : 1;
4500 unsigned : 1;
4503 struct
4505 unsigned CCP1M : 4;
4506 unsigned : 4;
4509 struct
4511 unsigned : 4;
4512 unsigned DC1B : 2;
4513 unsigned : 2;
4516 struct
4518 unsigned : 6;
4519 unsigned P1M : 2;
4521 } __ECCP1CONbits_t;
4523 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
4525 #define _ECCP1CON_CCP1M0 0x01
4526 #define _ECCP1CON_CCP1M1 0x02
4527 #define _ECCP1CON_CCP1M2 0x04
4528 #define _ECCP1CON_CCP1M3 0x08
4529 #define _ECCP1CON_DC1B0 0x10
4530 #define _ECCP1CON_CCP1Y 0x10
4531 #define _ECCP1CON_DC1B1 0x20
4532 #define _ECCP1CON_CCP1X 0x20
4533 #define _ECCP1CON_P1M0 0x40
4534 #define _ECCP1CON_P1M1 0x80
4536 //==============================================================================
4538 extern __at(0x0FBE) __sfr CCPR1;
4539 extern __at(0x0FBE) __sfr CCPR1L;
4540 extern __at(0x0FBF) __sfr CCPR1H;
4542 //==============================================================================
4543 // ADCON2 Bits
4545 extern __at(0x0FC0) __sfr ADCON2;
4547 typedef union
4549 struct
4551 unsigned ADCS0 : 1;
4552 unsigned ADCS1 : 1;
4553 unsigned ADCS2 : 1;
4554 unsigned ACQT0 : 1;
4555 unsigned ACQT1 : 1;
4556 unsigned ACQT2 : 1;
4557 unsigned : 1;
4558 unsigned ADFM : 1;
4561 struct
4563 unsigned ADCS : 3;
4564 unsigned : 5;
4567 struct
4569 unsigned : 3;
4570 unsigned ACQT : 3;
4571 unsigned : 2;
4573 } __ADCON2bits_t;
4575 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4577 #define _ADCS0 0x01
4578 #define _ADCS1 0x02
4579 #define _ADCS2 0x04
4580 #define _ACQT0 0x08
4581 #define _ACQT1 0x10
4582 #define _ACQT2 0x20
4583 #define _ADFM 0x80
4585 //==============================================================================
4588 //==============================================================================
4589 // ADCON1 Bits
4591 extern __at(0x0FC1) __sfr ADCON1;
4593 typedef union
4595 struct
4597 unsigned NVCFG0 : 1;
4598 unsigned NVCFG1 : 1;
4599 unsigned PVCFG0 : 1;
4600 unsigned PVCFG1 : 1;
4601 unsigned : 1;
4602 unsigned : 1;
4603 unsigned : 1;
4604 unsigned TRIGSEL : 1;
4607 struct
4609 unsigned NVCFG : 2;
4610 unsigned : 6;
4613 struct
4615 unsigned : 2;
4616 unsigned PVCFG : 2;
4617 unsigned : 4;
4619 } __ADCON1bits_t;
4621 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4623 #define _NVCFG0 0x01
4624 #define _NVCFG1 0x02
4625 #define _PVCFG0 0x04
4626 #define _PVCFG1 0x08
4627 #define _TRIGSEL 0x80
4629 //==============================================================================
4632 //==============================================================================
4633 // ADCON0 Bits
4635 extern __at(0x0FC2) __sfr ADCON0;
4637 typedef union
4639 struct
4641 unsigned ADON : 1;
4642 unsigned GO_NOT_DONE : 1;
4643 unsigned : 1;
4644 unsigned : 1;
4645 unsigned : 1;
4646 unsigned : 1;
4647 unsigned : 1;
4648 unsigned : 1;
4651 struct
4653 unsigned : 1;
4654 unsigned DONE : 1;
4655 unsigned : 1;
4656 unsigned : 1;
4657 unsigned : 1;
4658 unsigned : 1;
4659 unsigned : 1;
4660 unsigned : 1;
4663 struct
4665 unsigned : 1;
4666 unsigned GO : 1;
4667 unsigned : 1;
4668 unsigned : 1;
4669 unsigned : 1;
4670 unsigned : 1;
4671 unsigned : 1;
4672 unsigned : 1;
4675 struct
4677 unsigned : 1;
4678 unsigned NOT_DONE : 1;
4679 unsigned : 1;
4680 unsigned : 1;
4681 unsigned : 1;
4682 unsigned : 1;
4683 unsigned : 1;
4684 unsigned : 1;
4686 } __ADCON0bits_t;
4688 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4690 #define _ADON 0x01
4691 #define _GO_NOT_DONE 0x02
4692 #define _DONE 0x02
4693 #define _GO 0x02
4694 #define _NOT_DONE 0x02
4696 //==============================================================================
4698 extern __at(0x0FC3) __sfr ADRESL;
4699 extern __at(0x0FC4) __sfr ADRESH;
4701 //==============================================================================
4702 // SSP1CON2 Bits
4704 extern __at(0x0FC5) __sfr SSP1CON2;
4706 typedef struct
4708 unsigned SEN : 1;
4709 unsigned RSEN : 1;
4710 unsigned PEN : 1;
4711 unsigned RCEN : 1;
4712 unsigned ACKEN : 1;
4713 unsigned ACKDT : 1;
4714 unsigned ACKSTAT : 1;
4715 unsigned GCEN : 1;
4716 } __SSP1CON2bits_t;
4718 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4720 #define _SEN 0x01
4721 #define _RSEN 0x02
4722 #define _PEN 0x04
4723 #define _RCEN 0x08
4724 #define _ACKEN 0x10
4725 #define _ACKDT 0x20
4726 #define _ACKSTAT 0x40
4727 #define _GCEN 0x80
4729 //==============================================================================
4732 //==============================================================================
4733 // SSPCON2 Bits
4735 extern __at(0x0FC5) __sfr SSPCON2;
4737 typedef struct
4739 unsigned SEN : 1;
4740 unsigned RSEN : 1;
4741 unsigned PEN : 1;
4742 unsigned RCEN : 1;
4743 unsigned ACKEN : 1;
4744 unsigned ACKDT : 1;
4745 unsigned ACKSTAT : 1;
4746 unsigned GCEN : 1;
4747 } __SSPCON2bits_t;
4749 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4751 #define _SSPCON2_SEN 0x01
4752 #define _SSPCON2_RSEN 0x02
4753 #define _SSPCON2_PEN 0x04
4754 #define _SSPCON2_RCEN 0x08
4755 #define _SSPCON2_ACKEN 0x10
4756 #define _SSPCON2_ACKDT 0x20
4757 #define _SSPCON2_ACKSTAT 0x40
4758 #define _SSPCON2_GCEN 0x80
4760 //==============================================================================
4763 //==============================================================================
4764 // SSP1CON1 Bits
4766 extern __at(0x0FC6) __sfr SSP1CON1;
4768 typedef union
4770 struct
4772 unsigned SSPM0 : 1;
4773 unsigned SSPM1 : 1;
4774 unsigned SSPM2 : 1;
4775 unsigned SSPM3 : 1;
4776 unsigned CKP : 1;
4777 unsigned SSPEN : 1;
4778 unsigned SSPOV : 1;
4779 unsigned WCOL : 1;
4782 struct
4784 unsigned SSPM : 4;
4785 unsigned : 4;
4787 } __SSP1CON1bits_t;
4789 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4791 #define _SSPM0 0x01
4792 #define _SSPM1 0x02
4793 #define _SSPM2 0x04
4794 #define _SSPM3 0x08
4795 #define _CKP 0x10
4796 #define _SSPEN 0x20
4797 #define _SSPOV 0x40
4798 #define _WCOL 0x80
4800 //==============================================================================
4803 //==============================================================================
4804 // SSPCON Bits
4806 extern __at(0x0FC6) __sfr SSPCON;
4808 typedef union
4810 struct
4812 unsigned SSPM0 : 1;
4813 unsigned SSPM1 : 1;
4814 unsigned SSPM2 : 1;
4815 unsigned SSPM3 : 1;
4816 unsigned CKP : 1;
4817 unsigned SSPEN : 1;
4818 unsigned SSPOV : 1;
4819 unsigned WCOL : 1;
4822 struct
4824 unsigned SSPM : 4;
4825 unsigned : 4;
4827 } __SSPCONbits_t;
4829 extern __at(0x0FC6) volatile __SSPCONbits_t SSPCONbits;
4831 #define _SSPCON_SSPM0 0x01
4832 #define _SSPCON_SSPM1 0x02
4833 #define _SSPCON_SSPM2 0x04
4834 #define _SSPCON_SSPM3 0x08
4835 #define _SSPCON_CKP 0x10
4836 #define _SSPCON_SSPEN 0x20
4837 #define _SSPCON_SSPOV 0x40
4838 #define _SSPCON_WCOL 0x80
4840 //==============================================================================
4843 //==============================================================================
4844 // SSPCON1 Bits
4846 extern __at(0x0FC6) __sfr SSPCON1;
4848 typedef union
4850 struct
4852 unsigned SSPM0 : 1;
4853 unsigned SSPM1 : 1;
4854 unsigned SSPM2 : 1;
4855 unsigned SSPM3 : 1;
4856 unsigned CKP : 1;
4857 unsigned SSPEN : 1;
4858 unsigned SSPOV : 1;
4859 unsigned WCOL : 1;
4862 struct
4864 unsigned SSPM : 4;
4865 unsigned : 4;
4867 } __SSPCON1bits_t;
4869 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4871 #define _SSPCON1_SSPM0 0x01
4872 #define _SSPCON1_SSPM1 0x02
4873 #define _SSPCON1_SSPM2 0x04
4874 #define _SSPCON1_SSPM3 0x08
4875 #define _SSPCON1_CKP 0x10
4876 #define _SSPCON1_SSPEN 0x20
4877 #define _SSPCON1_SSPOV 0x40
4878 #define _SSPCON1_WCOL 0x80
4880 //==============================================================================
4883 //==============================================================================
4884 // SSP1STAT Bits
4886 extern __at(0x0FC7) __sfr SSP1STAT;
4888 typedef struct
4890 unsigned BF : 1;
4891 unsigned UA : 1;
4892 unsigned R_NOT_W : 1;
4893 unsigned S : 1;
4894 unsigned P : 1;
4895 unsigned D_NOT_A : 1;
4896 unsigned CKE : 1;
4897 unsigned SMP : 1;
4898 } __SSP1STATbits_t;
4900 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
4902 #define _BF 0x01
4903 #define _UA 0x02
4904 #define _R_NOT_W 0x04
4905 #define _S 0x08
4906 #define _P 0x10
4907 #define _D_NOT_A 0x20
4908 #define _CKE 0x40
4909 #define _SMP 0x80
4911 //==============================================================================
4914 //==============================================================================
4915 // SSPSTAT Bits
4917 extern __at(0x0FC7) __sfr SSPSTAT;
4919 typedef struct
4921 unsigned BF : 1;
4922 unsigned UA : 1;
4923 unsigned R_NOT_W : 1;
4924 unsigned S : 1;
4925 unsigned P : 1;
4926 unsigned D_NOT_A : 1;
4927 unsigned CKE : 1;
4928 unsigned SMP : 1;
4929 } __SSPSTATbits_t;
4931 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
4933 #define _SSPSTAT_BF 0x01
4934 #define _SSPSTAT_UA 0x02
4935 #define _SSPSTAT_R_NOT_W 0x04
4936 #define _SSPSTAT_S 0x08
4937 #define _SSPSTAT_P 0x10
4938 #define _SSPSTAT_D_NOT_A 0x20
4939 #define _SSPSTAT_CKE 0x40
4940 #define _SSPSTAT_SMP 0x80
4942 //==============================================================================
4945 //==============================================================================
4946 // SSP1ADD Bits
4948 extern __at(0x0FC8) __sfr SSP1ADD;
4950 typedef struct
4952 unsigned SSP1ADD0 : 1;
4953 unsigned SSP1ADD1 : 1;
4954 unsigned SSP1ADD2 : 1;
4955 unsigned SSP1ADD3 : 1;
4956 unsigned SSP1ADD4 : 1;
4957 unsigned SSP1ADD5 : 1;
4958 unsigned SSP1ADD6 : 1;
4959 unsigned SSP1ADD7 : 1;
4960 } __SSP1ADDbits_t;
4962 extern __at(0x0FC8) volatile __SSP1ADDbits_t SSP1ADDbits;
4964 #define _SSP1ADD0 0x01
4965 #define _SSP1ADD1 0x02
4966 #define _SSP1ADD2 0x04
4967 #define _SSP1ADD3 0x08
4968 #define _SSP1ADD4 0x10
4969 #define _SSP1ADD5 0x20
4970 #define _SSP1ADD6 0x40
4971 #define _SSP1ADD7 0x80
4973 //==============================================================================
4976 //==============================================================================
4977 // SSPADD Bits
4979 extern __at(0x0FC8) __sfr SSPADD;
4981 typedef struct
4983 unsigned SSP1ADD0 : 1;
4984 unsigned SSP1ADD1 : 1;
4985 unsigned SSP1ADD2 : 1;
4986 unsigned SSP1ADD3 : 1;
4987 unsigned SSP1ADD4 : 1;
4988 unsigned SSP1ADD5 : 1;
4989 unsigned SSP1ADD6 : 1;
4990 unsigned SSP1ADD7 : 1;
4991 } __SSPADDbits_t;
4993 extern __at(0x0FC8) volatile __SSPADDbits_t SSPADDbits;
4995 #define _SSPADD_SSP1ADD0 0x01
4996 #define _SSPADD_SSP1ADD1 0x02
4997 #define _SSPADD_SSP1ADD2 0x04
4998 #define _SSPADD_SSP1ADD3 0x08
4999 #define _SSPADD_SSP1ADD4 0x10
5000 #define _SSPADD_SSP1ADD5 0x20
5001 #define _SSPADD_SSP1ADD6 0x40
5002 #define _SSPADD_SSP1ADD7 0x80
5004 //==============================================================================
5006 extern __at(0x0FC9) __sfr SSP1BUF;
5007 extern __at(0x0FC9) __sfr SSPBUF;
5009 //==============================================================================
5010 // SSP1MSK Bits
5012 extern __at(0x0FCA) __sfr SSP1MSK;
5014 typedef struct
5016 unsigned SSP1MSK0 : 1;
5017 unsigned SSP1MSK1 : 1;
5018 unsigned SSP1MSK2 : 1;
5019 unsigned SSP1MSK3 : 1;
5020 unsigned SSP1MSK4 : 1;
5021 unsigned SSP1MSK5 : 1;
5022 unsigned SSP1MSK6 : 1;
5023 unsigned SSP1MSK7 : 1;
5024 } __SSP1MSKbits_t;
5026 extern __at(0x0FCA) volatile __SSP1MSKbits_t SSP1MSKbits;
5028 #define _SSP1MSK0 0x01
5029 #define _SSP1MSK1 0x02
5030 #define _SSP1MSK2 0x04
5031 #define _SSP1MSK3 0x08
5032 #define _SSP1MSK4 0x10
5033 #define _SSP1MSK5 0x20
5034 #define _SSP1MSK6 0x40
5035 #define _SSP1MSK7 0x80
5037 //==============================================================================
5040 //==============================================================================
5041 // SSPMSK Bits
5043 extern __at(0x0FCA) __sfr SSPMSK;
5045 typedef struct
5047 unsigned SSP1MSK0 : 1;
5048 unsigned SSP1MSK1 : 1;
5049 unsigned SSP1MSK2 : 1;
5050 unsigned SSP1MSK3 : 1;
5051 unsigned SSP1MSK4 : 1;
5052 unsigned SSP1MSK5 : 1;
5053 unsigned SSP1MSK6 : 1;
5054 unsigned SSP1MSK7 : 1;
5055 } __SSPMSKbits_t;
5057 extern __at(0x0FCA) volatile __SSPMSKbits_t SSPMSKbits;
5059 #define _SSPMSK_SSP1MSK0 0x01
5060 #define _SSPMSK_SSP1MSK1 0x02
5061 #define _SSPMSK_SSP1MSK2 0x04
5062 #define _SSPMSK_SSP1MSK3 0x08
5063 #define _SSPMSK_SSP1MSK4 0x10
5064 #define _SSPMSK_SSP1MSK5 0x20
5065 #define _SSPMSK_SSP1MSK6 0x40
5066 #define _SSPMSK_SSP1MSK7 0x80
5068 //==============================================================================
5071 //==============================================================================
5072 // SSP1CON3 Bits
5074 extern __at(0x0FCB) __sfr SSP1CON3;
5076 typedef struct
5078 unsigned DHEN : 1;
5079 unsigned AHEN : 1;
5080 unsigned SBCDE : 1;
5081 unsigned SDAHT : 1;
5082 unsigned BOEN : 1;
5083 unsigned SCIE : 1;
5084 unsigned PCIE : 1;
5085 unsigned ACKTIM : 1;
5086 } __SSP1CON3bits_t;
5088 extern __at(0x0FCB) volatile __SSP1CON3bits_t SSP1CON3bits;
5090 #define _DHEN 0x01
5091 #define _AHEN 0x02
5092 #define _SBCDE 0x04
5093 #define _SDAHT 0x08
5094 #define _BOEN 0x10
5095 #define _SCIE 0x20
5096 #define _PCIE 0x40
5097 #define _ACKTIM 0x80
5099 //==============================================================================
5102 //==============================================================================
5103 // SSPCON3 Bits
5105 extern __at(0x0FCB) __sfr SSPCON3;
5107 typedef struct
5109 unsigned DHEN : 1;
5110 unsigned AHEN : 1;
5111 unsigned SBCDE : 1;
5112 unsigned SDAHT : 1;
5113 unsigned BOEN : 1;
5114 unsigned SCIE : 1;
5115 unsigned PCIE : 1;
5116 unsigned ACKTIM : 1;
5117 } __SSPCON3bits_t;
5119 extern __at(0x0FCB) volatile __SSPCON3bits_t SSPCON3bits;
5121 #define _SSPCON3_DHEN 0x01
5122 #define _SSPCON3_AHEN 0x02
5123 #define _SSPCON3_SBCDE 0x04
5124 #define _SSPCON3_SDAHT 0x08
5125 #define _SSPCON3_BOEN 0x10
5126 #define _SSPCON3_SCIE 0x20
5127 #define _SSPCON3_PCIE 0x40
5128 #define _SSPCON3_ACKTIM 0x80
5130 //==============================================================================
5133 //==============================================================================
5134 // T1GCON Bits
5136 extern __at(0x0FCC) __sfr T1GCON;
5138 typedef union
5140 struct
5142 unsigned T1GSS0 : 1;
5143 unsigned T1GSS1 : 1;
5144 unsigned T1GVAL : 1;
5145 unsigned T1GGO_NOT_T1DONE : 1;
5146 unsigned T1GSPM : 1;
5147 unsigned T1GTM : 1;
5148 unsigned T1GPOL : 1;
5149 unsigned TMR1GE : 1;
5152 struct
5154 unsigned : 1;
5155 unsigned : 1;
5156 unsigned : 1;
5157 unsigned T1GGO : 1;
5158 unsigned : 1;
5159 unsigned : 1;
5160 unsigned : 1;
5161 unsigned : 1;
5164 struct
5166 unsigned : 1;
5167 unsigned : 1;
5168 unsigned : 1;
5169 unsigned NOT_T1DONE : 1;
5170 unsigned : 1;
5171 unsigned : 1;
5172 unsigned : 1;
5173 unsigned : 1;
5176 struct
5178 unsigned : 1;
5179 unsigned : 1;
5180 unsigned : 1;
5181 unsigned T1DONE : 1;
5182 unsigned : 1;
5183 unsigned : 1;
5184 unsigned : 1;
5185 unsigned : 1;
5188 struct
5190 unsigned : 1;
5191 unsigned : 1;
5192 unsigned : 1;
5193 unsigned T1GGO_NOT_DONE : 1;
5194 unsigned : 1;
5195 unsigned : 1;
5196 unsigned : 1;
5197 unsigned : 1;
5200 struct
5202 unsigned T1GSS : 2;
5203 unsigned : 6;
5205 } __T1GCONbits_t;
5207 extern __at(0x0FCC) volatile __T1GCONbits_t T1GCONbits;
5209 #define _T1GSS0 0x01
5210 #define _T1GSS1 0x02
5211 #define _T1GVAL 0x04
5212 #define _T1GGO_NOT_T1DONE 0x08
5213 #define _T1GGO 0x08
5214 #define _NOT_T1DONE 0x08
5215 #define _T1DONE 0x08
5216 #define _T1GGO_NOT_DONE 0x08
5217 #define _T1GSPM 0x10
5218 #define _T1GTM 0x20
5219 #define _T1GPOL 0x40
5220 #define _TMR1GE 0x80
5222 //==============================================================================
5225 //==============================================================================
5226 // T1CON Bits
5228 extern __at(0x0FCD) __sfr T1CON;
5230 typedef union
5232 struct
5234 unsigned TMR1ON : 1;
5235 unsigned RD16 : 1;
5236 unsigned NOT_T1SYNC : 1;
5237 unsigned SOSCEN : 1;
5238 unsigned T1CKPS0 : 1;
5239 unsigned T1CKPS1 : 1;
5240 unsigned TMR1CS0 : 1;
5241 unsigned TMR1CS1 : 1;
5244 struct
5246 unsigned : 1;
5247 unsigned T1RD16 : 1;
5248 unsigned T1SYNC : 1;
5249 unsigned T1SOSCEN : 1;
5250 unsigned : 1;
5251 unsigned : 1;
5252 unsigned : 1;
5253 unsigned : 1;
5256 struct
5258 unsigned : 1;
5259 unsigned : 1;
5260 unsigned : 1;
5261 unsigned T1OSCEN : 1;
5262 unsigned : 1;
5263 unsigned : 1;
5264 unsigned : 1;
5265 unsigned : 1;
5268 struct
5270 unsigned : 4;
5271 unsigned T1CKPS : 2;
5272 unsigned : 2;
5275 struct
5277 unsigned : 6;
5278 unsigned TMR1CS : 2;
5280 } __T1CONbits_t;
5282 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5284 #define _TMR1ON 0x01
5285 #define _RD16 0x02
5286 #define _T1RD16 0x02
5287 #define _NOT_T1SYNC 0x04
5288 #define _T1SYNC 0x04
5289 #define _SOSCEN 0x08
5290 #define _T1SOSCEN 0x08
5291 #define _T1OSCEN 0x08
5292 #define _T1CKPS0 0x10
5293 #define _T1CKPS1 0x20
5294 #define _TMR1CS0 0x40
5295 #define _TMR1CS1 0x80
5297 //==============================================================================
5299 extern __at(0x0FCE) __sfr TMR1;
5300 extern __at(0x0FCE) __sfr TMR1L;
5301 extern __at(0x0FCF) __sfr TMR1H;
5303 //==============================================================================
5304 // RCON Bits
5306 extern __at(0x0FD0) __sfr RCON;
5308 typedef union
5310 struct
5312 unsigned NOT_BOR : 1;
5313 unsigned NOT_POR : 1;
5314 unsigned NOT_PD : 1;
5315 unsigned NOT_TO : 1;
5316 unsigned NOT_RI : 1;
5317 unsigned : 1;
5318 unsigned SBOREN : 1;
5319 unsigned IPEN : 1;
5322 struct
5324 unsigned BOR : 1;
5325 unsigned POR : 1;
5326 unsigned PD : 1;
5327 unsigned TO : 1;
5328 unsigned RI : 1;
5329 unsigned : 1;
5330 unsigned : 1;
5331 unsigned : 1;
5333 } __RCONbits_t;
5335 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5337 #define _NOT_BOR 0x01
5338 #define _BOR 0x01
5339 #define _NOT_POR 0x02
5340 #define _POR 0x02
5341 #define _NOT_PD 0x04
5342 #define _PD 0x04
5343 #define _NOT_TO 0x08
5344 #define _TO 0x08
5345 #define _NOT_RI 0x10
5346 #define _RI 0x10
5347 #define _SBOREN 0x40
5348 #define _IPEN 0x80
5350 //==============================================================================
5353 //==============================================================================
5354 // WDTCON Bits
5356 extern __at(0x0FD1) __sfr WDTCON;
5358 typedef union
5360 struct
5362 unsigned SWDTEN : 1;
5363 unsigned : 1;
5364 unsigned : 1;
5365 unsigned : 1;
5366 unsigned : 1;
5367 unsigned : 1;
5368 unsigned : 1;
5369 unsigned : 1;
5372 struct
5374 unsigned SWDTE : 1;
5375 unsigned : 1;
5376 unsigned : 1;
5377 unsigned : 1;
5378 unsigned : 1;
5379 unsigned : 1;
5380 unsigned : 1;
5381 unsigned : 1;
5383 } __WDTCONbits_t;
5385 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5387 #define _SWDTEN 0x01
5388 #define _SWDTE 0x01
5390 //==============================================================================
5393 //==============================================================================
5394 // OSCCON2 Bits
5396 extern __at(0x0FD2) __sfr OSCCON2;
5398 typedef struct
5400 unsigned LFIOFS : 1;
5401 unsigned HFIOFR : 1;
5402 unsigned PRISD : 1;
5403 unsigned SOSCGO : 1;
5404 unsigned PLLEN : 1;
5405 unsigned INTSRC : 1;
5406 unsigned SOSCRUN : 1;
5407 unsigned PLLRDY : 1;
5408 } __OSCCON2bits_t;
5410 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
5412 #define _LFIOFS 0x01
5413 #define _HFIOFR 0x02
5414 #define _PRISD 0x04
5415 #define _SOSCGO 0x08
5416 #define _PLLEN 0x10
5417 #define _INTSRC 0x20
5418 #define _SOSCRUN 0x40
5419 #define _PLLRDY 0x80
5421 //==============================================================================
5424 //==============================================================================
5425 // OSCCON Bits
5427 extern __at(0x0FD3) __sfr OSCCON;
5429 typedef union
5431 struct
5433 unsigned SCS0 : 1;
5434 unsigned SCS1 : 1;
5435 unsigned HFIOFS : 1;
5436 unsigned OSTS : 1;
5437 unsigned IRCF0 : 1;
5438 unsigned IRCF1 : 1;
5439 unsigned IRCF2 : 1;
5440 unsigned IDLEN : 1;
5443 struct
5445 unsigned : 1;
5446 unsigned : 1;
5447 unsigned FLTS : 1;
5448 unsigned : 1;
5449 unsigned : 1;
5450 unsigned : 1;
5451 unsigned : 1;
5452 unsigned : 1;
5455 struct
5457 unsigned SCS : 2;
5458 unsigned : 6;
5461 struct
5463 unsigned : 4;
5464 unsigned IRCF : 3;
5465 unsigned : 1;
5467 } __OSCCONbits_t;
5469 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5471 #define _SCS0 0x01
5472 #define _SCS1 0x02
5473 #define _HFIOFS 0x04
5474 #define _FLTS 0x04
5475 #define _OSTS 0x08
5476 #define _IRCF0 0x10
5477 #define _IRCF1 0x20
5478 #define _IRCF2 0x40
5479 #define _IDLEN 0x80
5481 //==============================================================================
5484 //==============================================================================
5485 // T0CON Bits
5487 extern __at(0x0FD5) __sfr T0CON;
5489 typedef union
5491 struct
5493 unsigned T0PS0 : 1;
5494 unsigned T0PS1 : 1;
5495 unsigned T0PS2 : 1;
5496 unsigned PSA : 1;
5497 unsigned T0SE : 1;
5498 unsigned T0CS : 1;
5499 unsigned T08BIT : 1;
5500 unsigned TMR0ON : 1;
5503 struct
5505 unsigned T0PS : 3;
5506 unsigned : 5;
5508 } __T0CONbits_t;
5510 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5512 #define _T0PS0 0x01
5513 #define _T0PS1 0x02
5514 #define _T0PS2 0x04
5515 #define _PSA 0x08
5516 #define _T0SE 0x10
5517 #define _T0CS 0x20
5518 #define _T08BIT 0x40
5519 #define _TMR0ON 0x80
5521 //==============================================================================
5523 extern __at(0x0FD6) __sfr TMR0;
5524 extern __at(0x0FD6) __sfr TMR0L;
5525 extern __at(0x0FD7) __sfr TMR0H;
5527 //==============================================================================
5528 // STATUS Bits
5530 extern __at(0x0FD8) __sfr STATUS;
5532 typedef struct
5534 unsigned C : 1;
5535 unsigned DC : 1;
5536 unsigned Z : 1;
5537 unsigned OV : 1;
5538 unsigned N : 1;
5539 unsigned : 1;
5540 unsigned : 1;
5541 unsigned : 1;
5542 } __STATUSbits_t;
5544 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5546 #define _C 0x01
5547 #define _DC 0x02
5548 #define _Z 0x04
5549 #define _OV 0x08
5550 #define _N 0x10
5552 //==============================================================================
5554 extern __at(0x0FD9) __sfr FSR2L;
5555 extern __at(0x0FDA) __sfr FSR2H;
5556 extern __at(0x0FDB) __sfr PLUSW2;
5557 extern __at(0x0FDC) __sfr PREINC2;
5558 extern __at(0x0FDD) __sfr POSTDEC2;
5559 extern __at(0x0FDE) __sfr POSTINC2;
5560 extern __at(0x0FDF) __sfr INDF2;
5561 extern __at(0x0FE0) __sfr BSR;
5562 extern __at(0x0FE1) __sfr FSR1L;
5563 extern __at(0x0FE2) __sfr FSR1H;
5564 extern __at(0x0FE3) __sfr PLUSW1;
5565 extern __at(0x0FE4) __sfr PREINC1;
5566 extern __at(0x0FE5) __sfr POSTDEC1;
5567 extern __at(0x0FE6) __sfr POSTINC1;
5568 extern __at(0x0FE7) __sfr INDF1;
5569 extern __at(0x0FE8) __sfr WREG;
5570 extern __at(0x0FE9) __sfr FSR0L;
5571 extern __at(0x0FEA) __sfr FSR0H;
5572 extern __at(0x0FEB) __sfr PLUSW0;
5573 extern __at(0x0FEC) __sfr PREINC0;
5574 extern __at(0x0FED) __sfr POSTDEC0;
5575 extern __at(0x0FEE) __sfr POSTINC0;
5576 extern __at(0x0FEF) __sfr INDF0;
5578 //==============================================================================
5579 // INTCON3 Bits
5581 extern __at(0x0FF0) __sfr INTCON3;
5583 typedef union
5585 struct
5587 unsigned INT1IF : 1;
5588 unsigned INT2IF : 1;
5589 unsigned : 1;
5590 unsigned INT1IE : 1;
5591 unsigned INT2IE : 1;
5592 unsigned : 1;
5593 unsigned INT1IP : 1;
5594 unsigned INT2IP : 1;
5597 struct
5599 unsigned INT1F : 1;
5600 unsigned INT2F : 1;
5601 unsigned : 1;
5602 unsigned INT1E : 1;
5603 unsigned INT2E : 1;
5604 unsigned : 1;
5605 unsigned INT1P : 1;
5606 unsigned INT2P : 1;
5608 } __INTCON3bits_t;
5610 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5612 #define _INT1IF 0x01
5613 #define _INT1F 0x01
5614 #define _INT2IF 0x02
5615 #define _INT2F 0x02
5616 #define _INT1IE 0x08
5617 #define _INT1E 0x08
5618 #define _INT2IE 0x10
5619 #define _INT2E 0x10
5620 #define _INT1IP 0x40
5621 #define _INT1P 0x40
5622 #define _INT2IP 0x80
5623 #define _INT2P 0x80
5625 //==============================================================================
5628 //==============================================================================
5629 // INTCON2 Bits
5631 extern __at(0x0FF1) __sfr INTCON2;
5633 typedef union
5635 struct
5637 unsigned IOCIP : 1;
5638 unsigned : 1;
5639 unsigned TMR0IP : 1;
5640 unsigned : 1;
5641 unsigned INTEDG2 : 1;
5642 unsigned INTEDG1 : 1;
5643 unsigned INTEDG0 : 1;
5644 unsigned NOT_RBPU : 1;
5647 struct
5649 unsigned : 1;
5650 unsigned : 1;
5651 unsigned T0IP : 1;
5652 unsigned : 1;
5653 unsigned : 1;
5654 unsigned : 1;
5655 unsigned : 1;
5656 unsigned RBPU : 1;
5658 } __INTCON2bits_t;
5660 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5662 #define _IOCIP 0x01
5663 #define _TMR0IP 0x04
5664 #define _T0IP 0x04
5665 #define _INTEDG2 0x10
5666 #define _INTEDG1 0x20
5667 #define _INTEDG0 0x40
5668 #define _NOT_RBPU 0x80
5669 #define _RBPU 0x80
5671 //==============================================================================
5674 //==============================================================================
5675 // INTCON Bits
5677 extern __at(0x0FF2) __sfr INTCON;
5679 typedef union
5681 struct
5683 unsigned IOCIF : 1;
5684 unsigned INT0IF : 1;
5685 unsigned TMR0IF : 1;
5686 unsigned IOCIE : 1;
5687 unsigned INT0IE : 1;
5688 unsigned TMR0IE : 1;
5689 unsigned PEIE_GIEL : 1;
5690 unsigned GIE_GIEH : 1;
5693 struct
5695 unsigned : 1;
5696 unsigned INT0F : 1;
5697 unsigned T0IF : 1;
5698 unsigned : 1;
5699 unsigned INT0E : 1;
5700 unsigned T0IE : 1;
5701 unsigned PEIE : 1;
5702 unsigned GIE : 1;
5705 struct
5707 unsigned : 1;
5708 unsigned : 1;
5709 unsigned : 1;
5710 unsigned : 1;
5711 unsigned : 1;
5712 unsigned : 1;
5713 unsigned GIEL : 1;
5714 unsigned GIEH : 1;
5716 } __INTCONbits_t;
5718 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5720 #define _IOCIF 0x01
5721 #define _INT0IF 0x02
5722 #define _INT0F 0x02
5723 #define _TMR0IF 0x04
5724 #define _T0IF 0x04
5725 #define _IOCIE 0x08
5726 #define _INT0IE 0x10
5727 #define _INT0E 0x10
5728 #define _TMR0IE 0x20
5729 #define _T0IE 0x20
5730 #define _PEIE_GIEL 0x40
5731 #define _PEIE 0x40
5732 #define _GIEL 0x40
5733 #define _GIE_GIEH 0x80
5734 #define _GIE 0x80
5735 #define _GIEH 0x80
5737 //==============================================================================
5739 extern __at(0x0FF3) __sfr PROD;
5740 extern __at(0x0FF3) __sfr PRODL;
5741 extern __at(0x0FF4) __sfr PRODH;
5742 extern __at(0x0FF5) __sfr TABLAT;
5743 extern __at(0x0FF6) __sfr TBLPTR;
5744 extern __at(0x0FF6) __sfr TBLPTRL;
5745 extern __at(0x0FF7) __sfr TBLPTRH;
5746 extern __at(0x0FF8) __sfr TBLPTRU;
5747 extern __at(0x0FF9) __sfr PC;
5748 extern __at(0x0FF9) __sfr PCL;
5749 extern __at(0x0FFA) __sfr PCLATH;
5750 extern __at(0x0FFB) __sfr PCLATU;
5752 //==============================================================================
5753 // STKPTR Bits
5755 extern __at(0x0FFC) __sfr STKPTR;
5757 typedef union
5759 struct
5761 unsigned SP0 : 1;
5762 unsigned SP1 : 1;
5763 unsigned SP2 : 1;
5764 unsigned SP3 : 1;
5765 unsigned SP4 : 1;
5766 unsigned : 1;
5767 unsigned STKUNF : 1;
5768 unsigned STKFUL : 1;
5771 struct
5773 unsigned : 1;
5774 unsigned : 1;
5775 unsigned : 1;
5776 unsigned : 1;
5777 unsigned : 1;
5778 unsigned : 1;
5779 unsigned : 1;
5780 unsigned STKOVF : 1;
5783 struct
5785 unsigned SP : 5;
5786 unsigned : 3;
5788 } __STKPTRbits_t;
5790 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5792 #define _SP0 0x01
5793 #define _SP1 0x02
5794 #define _SP2 0x04
5795 #define _SP3 0x08
5796 #define _SP4 0x10
5797 #define _STKUNF 0x40
5798 #define _STKFUL 0x80
5799 #define _STKOVF 0x80
5801 //==============================================================================
5803 extern __at(0x0FFD) __sfr TOS;
5804 extern __at(0x0FFD) __sfr TOSL;
5805 extern __at(0x0FFE) __sfr TOSH;
5806 extern __at(0x0FFF) __sfr TOSU;
5808 //==============================================================================
5810 // Configuration Bits
5812 //==============================================================================
5814 #define __CONFIG1L 0x300000
5815 #define __CONFIG1H 0x300001
5816 #define __CONFIG2L 0x300002
5817 #define __CONFIG2H 0x300003
5818 #define __CONFIG3H 0x300005
5819 #define __CONFIG4L 0x300006
5820 #define __CONFIG5L 0x300008
5821 #define __CONFIG5H 0x300009
5822 #define __CONFIG6L 0x30000A
5823 #define __CONFIG6H 0x30000B
5824 #define __CONFIG7L 0x30000C
5825 #define __CONFIG7H 0x30000D
5827 //----------------------------- CONFIG1L Options -------------------------------
5829 #define _PLLSEL_PLL4X_1L 0xFE // 4x clock multiplier.
5830 #define _PLLSEL_PLL3X_1L 0xFF // 3x clock multiplier.
5831 #define _CFGPLLEN_OFF_1L 0xFD // PLL Disabled (firmware controlled).
5832 #define _CFGPLLEN_ON_1L 0xFF // PLL Enabled.
5833 #define _CPUDIV_NOCLKDIV_1L 0xE7 // CPU uses system clock (no divide).
5834 #define _CPUDIV_CLKDIV2_1L 0xEF // CPU uses system clock divided by 2.
5835 #define _CPUDIV_CLKDIV3_1L 0xF7 // CPU uses system clock divided by 3.
5836 #define _CPUDIV_CLKDIV6_1L 0xFF // CPU uses system clock divided by 6.
5837 #define _LS48MHZ_SYS24X4_1L 0xDF // System clock at 24 MHz, USB clock divider is set to 4.
5838 #define _LS48MHZ_SYS48X8_1L 0xFF // System clock at 48 MHz, USB clock divider is set to 8.
5840 //----------------------------- CONFIG1H Options -------------------------------
5842 #define _FOSC_LP_1H 0xF0 // LP oscillator.
5843 #define _FOSC_XT_1H 0xF1 // XT oscillator.
5844 #define _FOSC_HSH_1H 0xF2 // HS oscillator, high power 16MHz to 25MHz.
5845 #define _FOSC_HSM_1H 0xF3 // HS oscillator, medium power 4MHz to 16MHz.
5846 #define _FOSC_ECHCLKO_1H 0xF4 // EC oscillator, high power 16MHz to 48MHz, clock output on OSC2.
5847 #define _FOSC_ECHIO_1H 0xF5 // EC oscillator, high power 16MHz to 48MHz.
5848 #define _FOSC_RCCLKO_1H 0xF6 // External RC oscillator, clock output on OSC2.
5849 #define _FOSC_RCIO_1H 0xF7 // External RC oscillator.
5850 #define _FOSC_INTOSCIO_1H 0xF8 // Internal oscillator.
5851 #define _FOSC_INTOSCCLKO_1H 0xF9 // Internal oscillator, clock output on OSC2.
5852 #define _FOSC_ECMCLKO_1H 0xFA // EC oscillator, medium power 4MHz to 16MHz, clock output on OSC2.
5853 #define _FOSC_ECMIO_1H 0xFB // EC oscillator, medium power 4MHz to 16MHz.
5854 #define _FOSC_ECLCLKO_1H 0xFC // EC oscillator, low power <4MHz, clock output on OSC2.
5855 #define _FOSC_ECLIO_1H 0xFD // EC oscillator, low power <4MHz.
5856 #define _PCLKEN_OFF_1H 0xDF // Primary oscillator shutdown firmware controlled.
5857 #define _PCLKEN_ON_1H 0xFF // Primary oscillator enabled.
5858 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
5859 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
5860 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
5861 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
5863 //----------------------------- CONFIG2L Options -------------------------------
5865 #define _nPWRTEN_ON_2L 0xFE // Power up timer enabled.
5866 #define _nPWRTEN_OFF_2L 0xFF // Power up timer disabled.
5867 #define _BOREN_OFF_2L 0xF9 // BOR disabled in hardware (SBOREN is ignored).
5868 #define _BOREN_ON_2L 0xFB // BOR controlled by firmware (SBOREN is enabled).
5869 #define _BOREN_NOSLP_2L 0xFD // BOR enabled in hardware, disabled in Sleep mode (SBOREN is ignored).
5870 #define _BOREN_SBORDIS_2L 0xFF // BOR enabled in hardware (SBOREN is ignored).
5871 #define _BORV_285_2L 0xE7 // BOR set to 2.85V nominal.
5872 #define _BORV_250_2L 0xEF // BOR set to 2.5V nominal.
5873 #define _BORV_220_2L 0xF7 // BOR set to 2.2V nominal.
5874 #define _BORV_190_2L 0xFF // BOR set to 1.9V nominal.
5875 #define _nLPBOR_ON_2L 0xBF // Low-Power Brown-out Reset enabled.
5876 #define _nLPBOR_OFF_2L 0xFF // Low-Power Brown-out Reset disabled.
5878 //----------------------------- CONFIG2H Options -------------------------------
5880 #define _WDTEN_OFF_2H 0xFC // WDT disabled in hardware (SWDTEN ignored).
5881 #define _WDTEN_NOSLP_2H 0xFD // WDT enabled in hardware, disabled in Sleep mode (SWDTEN ignored).
5882 #define _WDTEN_SWON_2H 0xFE // WDT controlled by firmware (SWDTEN enabled).
5883 #define _WDTEN_ON_2H 0xFF // WDT enabled in hardware (SWDTEN ignored).
5884 #define _WDTPS_1_2H 0xC3 // 1:1.
5885 #define _WDTPS_2_2H 0xC7 // 1:2.
5886 #define _WDTPS_4_2H 0xCB // 1:4.
5887 #define _WDTPS_8_2H 0xCF // 1:8.
5888 #define _WDTPS_16_2H 0xD3 // 1:16.
5889 #define _WDTPS_32_2H 0xD7 // 1:32.
5890 #define _WDTPS_64_2H 0xDB // 1:64.
5891 #define _WDTPS_128_2H 0xDF // 1:128.
5892 #define _WDTPS_256_2H 0xE3 // 1:256.
5893 #define _WDTPS_512_2H 0xE7 // 1:512.
5894 #define _WDTPS_1024_2H 0xEB // 1:1024.
5895 #define _WDTPS_2048_2H 0xEF // 1:2048.
5896 #define _WDTPS_4096_2H 0xF3 // 1:4096.
5897 #define _WDTPS_8192_2H 0xF7 // 1:8192.
5898 #define _WDTPS_16384_2H 0xFB // 1:16384.
5899 #define _WDTPS_32768_2H 0xFF // 1:32768.
5901 //----------------------------- CONFIG3H Options -------------------------------
5903 #define _CCP2MX_RB3_3H 0xFE // CCP2 input/output is multiplexed with RB3.
5904 #define _CCP2MX_RC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
5905 #define _PBADEN_OFF_3H 0xFD // PORTB<5:0> pins are configured as digital I/O on Reset.
5906 #define _PBADEN_ON_3H 0xFF // PORTB<5:0> pins are configured as analog input channels on Reset.
5907 #define _T3CMX_RB5_3H 0xEF // T3CKI function is on RB5.
5908 #define _T3CMX_RC0_3H 0xFF // T3CKI function is on RC0.
5909 #define _SDOMX_RC7_3H 0xBF // SDO function is on RC7.
5910 #define _SDOMX_RB3_3H 0xFF // SDO function is on RB3.
5911 #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; external MCLR disabled.
5912 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input disabled.
5914 //----------------------------- CONFIG4L Options -------------------------------
5916 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
5917 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
5918 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
5919 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled if MCLRE is also 1.
5920 #define _ICPRT_OFF_4L 0xDF // ICPORT disabled.
5921 #define _ICPRT_ON_4L 0xFF // ICPORT enabled.
5922 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled.
5923 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
5924 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
5925 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
5927 //----------------------------- CONFIG5L Options -------------------------------
5929 #define _CP0_ON_5L 0xFE // Block 0 is code-protected.
5930 #define _CP0_OFF_5L 0xFF // Block 0 is not code-protected.
5931 #define _CP1_ON_5L 0xFD // Block 1 is code-protected.
5932 #define _CP1_OFF_5L 0xFF // Block 1 is not code-protected.
5933 #define _CP2_ON_5L 0xFB // Block 2 is code-protected.
5934 #define _CP2_OFF_5L 0xFF // Block 2 is not code-protected.
5935 #define _CP3_ON_5L 0xF7 // Block 3 is code-protected.
5936 #define _CP3_OFF_5L 0xFF // Block 3 is not code-protected.
5938 //----------------------------- CONFIG5H Options -------------------------------
5940 #define _CPB_ON_5H 0xBF // Boot block is code-protected.
5941 #define _CPB_OFF_5H 0xFF // Boot block is not code-protected.
5942 #define _CPD_ON_5H 0x7F // Data EEPROM is code-protected.
5943 #define _CPD_OFF_5H 0xFF // Data EEPROM is not code-protected.
5945 //----------------------------- CONFIG6L Options -------------------------------
5947 #define _WRT0_ON_6L 0xFE // Block 0 (0800-1FFFh) is write-protected.
5948 #define _WRT0_OFF_6L 0xFF // Block 0 (0800-1FFFh) is not write-protected.
5949 #define _WRT1_ON_6L 0xFD // Block 1 (2000-3FFFh) is write-protected.
5950 #define _WRT1_OFF_6L 0xFF // Block 1 (2000-3FFFh) is not write-protected.
5951 #define _WRT2_ON_6L 0xFB // Block 2 (04000-5FFFh) is write-protected.
5952 #define _WRT2_OFF_6L 0xFF // Block 2 (04000-5FFFh) is not write-protected.
5953 #define _WRT3_ON_6L 0xF7 // Block 3 (06000-7FFFh) is write-protected.
5954 #define _WRT3_OFF_6L 0xFF // Block 3 (06000-7FFFh) is not write-protected.
5956 //----------------------------- CONFIG6H Options -------------------------------
5958 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) are write-protected.
5959 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) are not write-protected.
5960 #define _WRTB_ON_6H 0xBF // Boot block (0000-7FFh) is write-protected.
5961 #define _WRTB_OFF_6H 0xFF // Boot block (0000-7FFh) is not write-protected.
5962 #define _WRTD_ON_6H 0x7F // Data EEPROM is write-protected.
5963 #define _WRTD_OFF_6H 0xFF // Data EEPROM is not write-protected.
5965 //----------------------------- CONFIG7L Options -------------------------------
5967 #define _EBTR0_ON_7L 0xFE // Block 0 is protected from table reads executed in other blocks.
5968 #define _EBTR0_OFF_7L 0xFF // Block 0 is not protected from table reads executed in other blocks.
5969 #define _EBTR1_ON_7L 0xFD // Block 1 is protected from table reads executed in other blocks.
5970 #define _EBTR1_OFF_7L 0xFF // Block 1 is not protected from table reads executed in other blocks.
5971 #define _EBTR2_ON_7L 0xFB // Block 2 is protected from table reads executed in other blocks.
5972 #define _EBTR2_OFF_7L 0xFF // Block 2 is not protected from table reads executed in other blocks.
5973 #define _EBTR3_ON_7L 0xF7 // Block 3 is protected from table reads executed in other blocks.
5974 #define _EBTR3_OFF_7L 0xFF // Block 3 is not protected from table reads executed in other blocks.
5976 //----------------------------- CONFIG7H Options -------------------------------
5978 #define _EBTRB_ON_7H 0xBF // Boot block is protected from table reads executed in other blocks.
5979 #define _EBTRB_OFF_7H 0xFF // Boot block is not protected from table reads executed in other blocks.
5981 //==============================================================================
5983 #define __DEVID1 0x3FFFFE
5984 #define __DEVID2 0x3FFFFF
5986 #define __IDLOC0 0x200000
5987 #define __IDLOC1 0x200001
5988 #define __IDLOC2 0x200002
5989 #define __IDLOC3 0x200003
5990 #define __IDLOC4 0x200004
5991 #define __IDLOC5 0x200005
5992 #define __IDLOC6 0x200006
5993 #define __IDLOC7 0x200007
5995 #endif // #ifndef __PIC18LF45K50_H__