struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f4450.h
blobeb8703848b379bd33d061f5a0bba9a7dcd7dd18c
1 /*
2 * This declarations of the PIC18F4450 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:46 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 __PIC18F4450_H__
26 #define __PIC18F4450_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
36 extern __at(0x0F66) __sfr UFRM;
38 //==============================================================================
39 // UFRML Bits
41 extern __at(0x0F66) __sfr UFRML;
43 typedef struct
45 unsigned FRM0 : 1;
46 unsigned FRM1 : 1;
47 unsigned FRM2 : 1;
48 unsigned FRM3 : 1;
49 unsigned FRM4 : 1;
50 unsigned FRM5 : 1;
51 unsigned FRM6 : 1;
52 unsigned FRM7 : 1;
53 } __UFRMLbits_t;
55 extern __at(0x0F66) volatile __UFRMLbits_t UFRMLbits;
57 #define _FRM0 0x01
58 #define _FRM1 0x02
59 #define _FRM2 0x04
60 #define _FRM3 0x08
61 #define _FRM4 0x10
62 #define _FRM5 0x20
63 #define _FRM6 0x40
64 #define _FRM7 0x80
66 //==============================================================================
69 //==============================================================================
70 // UFRMH Bits
72 extern __at(0x0F67) __sfr UFRMH;
74 typedef struct
76 unsigned FRM8 : 1;
77 unsigned FRM9 : 1;
78 unsigned FRM10 : 1;
79 unsigned : 1;
80 unsigned : 1;
81 unsigned : 1;
82 unsigned : 1;
83 unsigned : 1;
84 } __UFRMHbits_t;
86 extern __at(0x0F67) volatile __UFRMHbits_t UFRMHbits;
88 #define _FRM8 0x01
89 #define _FRM9 0x02
90 #define _FRM10 0x04
92 //==============================================================================
95 //==============================================================================
96 // UIR Bits
98 extern __at(0x0F68) __sfr UIR;
100 typedef struct
102 unsigned URSTIF : 1;
103 unsigned UERRIF : 1;
104 unsigned ACTVIF : 1;
105 unsigned TRNIF : 1;
106 unsigned IDLEIF : 1;
107 unsigned STALLIF : 1;
108 unsigned SOFIF : 1;
109 unsigned : 1;
110 } __UIRbits_t;
112 extern __at(0x0F68) volatile __UIRbits_t UIRbits;
114 #define _URSTIF 0x01
115 #define _UERRIF 0x02
116 #define _ACTVIF 0x04
117 #define _TRNIF 0x08
118 #define _IDLEIF 0x10
119 #define _STALLIF 0x20
120 #define _SOFIF 0x40
122 //==============================================================================
125 //==============================================================================
126 // UIE Bits
128 extern __at(0x0F69) __sfr UIE;
130 typedef struct
132 unsigned URSTIE : 1;
133 unsigned UERRIE : 1;
134 unsigned ACTVIE : 1;
135 unsigned TRNIE : 1;
136 unsigned IDLEIE : 1;
137 unsigned STALLIE : 1;
138 unsigned SOFIE : 1;
139 unsigned : 1;
140 } __UIEbits_t;
142 extern __at(0x0F69) volatile __UIEbits_t UIEbits;
144 #define _URSTIE 0x01
145 #define _UERRIE 0x02
146 #define _ACTVIE 0x04
147 #define _TRNIE 0x08
148 #define _IDLEIE 0x10
149 #define _STALLIE 0x20
150 #define _SOFIE 0x40
152 //==============================================================================
155 //==============================================================================
156 // UEIR Bits
158 extern __at(0x0F6A) __sfr UEIR;
160 typedef struct
162 unsigned PIDEF : 1;
163 unsigned CRC5EF : 1;
164 unsigned CRC16EF : 1;
165 unsigned DFN8EF : 1;
166 unsigned BTOEF : 1;
167 unsigned : 1;
168 unsigned : 1;
169 unsigned BTSEF : 1;
170 } __UEIRbits_t;
172 extern __at(0x0F6A) volatile __UEIRbits_t UEIRbits;
174 #define _PIDEF 0x01
175 #define _CRC5EF 0x02
176 #define _CRC16EF 0x04
177 #define _DFN8EF 0x08
178 #define _BTOEF 0x10
179 #define _BTSEF 0x80
181 //==============================================================================
184 //==============================================================================
185 // UEIE Bits
187 extern __at(0x0F6B) __sfr UEIE;
189 typedef struct
191 unsigned PIDEE : 1;
192 unsigned CRC5EE : 1;
193 unsigned CRC16EE : 1;
194 unsigned DFN8EE : 1;
195 unsigned BTOEE : 1;
196 unsigned : 1;
197 unsigned : 1;
198 unsigned BTSEE : 1;
199 } __UEIEbits_t;
201 extern __at(0x0F6B) volatile __UEIEbits_t UEIEbits;
203 #define _PIDEE 0x01
204 #define _CRC5EE 0x02
205 #define _CRC16EE 0x04
206 #define _DFN8EE 0x08
207 #define _BTOEE 0x10
208 #define _BTSEE 0x80
210 //==============================================================================
213 //==============================================================================
214 // USTAT Bits
216 extern __at(0x0F6C) __sfr USTAT;
218 typedef union
220 struct
222 unsigned : 1;
223 unsigned PPBI : 1;
224 unsigned DIR : 1;
225 unsigned ENDP0 : 1;
226 unsigned ENDP1 : 1;
227 unsigned ENDP2 : 1;
228 unsigned ENDP3 : 1;
229 unsigned : 1;
232 struct
234 unsigned : 3;
235 unsigned ENDP : 4;
236 unsigned : 1;
238 } __USTATbits_t;
240 extern __at(0x0F6C) volatile __USTATbits_t USTATbits;
242 #define _PPBI 0x02
243 #define _DIR 0x04
244 #define _ENDP0 0x08
245 #define _ENDP1 0x10
246 #define _ENDP2 0x20
247 #define _ENDP3 0x40
249 //==============================================================================
252 //==============================================================================
253 // UCON Bits
255 extern __at(0x0F6D) __sfr UCON;
257 typedef struct
259 unsigned : 1;
260 unsigned SUSPND : 1;
261 unsigned RESUME : 1;
262 unsigned USBEN : 1;
263 unsigned PKTDIS : 1;
264 unsigned SE0 : 1;
265 unsigned PPBRST : 1;
266 unsigned : 1;
267 } __UCONbits_t;
269 extern __at(0x0F6D) volatile __UCONbits_t UCONbits;
271 #define _SUSPND 0x02
272 #define _RESUME 0x04
273 #define _USBEN 0x08
274 #define _PKTDIS 0x10
275 #define _SE0 0x20
276 #define _PPBRST 0x40
278 //==============================================================================
281 //==============================================================================
282 // UADDR Bits
284 extern __at(0x0F6E) __sfr UADDR;
286 typedef union
288 struct
290 unsigned ADDR0 : 1;
291 unsigned ADDR1 : 1;
292 unsigned ADDR2 : 1;
293 unsigned ADDR3 : 1;
294 unsigned ADDR4 : 1;
295 unsigned ADDR5 : 1;
296 unsigned ADDR6 : 1;
297 unsigned : 1;
300 struct
302 unsigned ADDR : 7;
303 unsigned : 1;
305 } __UADDRbits_t;
307 extern __at(0x0F6E) volatile __UADDRbits_t UADDRbits;
309 #define _ADDR0 0x01
310 #define _ADDR1 0x02
311 #define _ADDR2 0x04
312 #define _ADDR3 0x08
313 #define _ADDR4 0x10
314 #define _ADDR5 0x20
315 #define _ADDR6 0x40
317 //==============================================================================
320 //==============================================================================
321 // UCFG Bits
323 extern __at(0x0F6F) __sfr UCFG;
325 typedef union
327 struct
329 unsigned PPB0 : 1;
330 unsigned PPB1 : 1;
331 unsigned FSEN : 1;
332 unsigned UTRDIS : 1;
333 unsigned UPUEN : 1;
334 unsigned : 1;
335 unsigned UOEMON : 1;
336 unsigned UTEYE : 1;
339 struct
341 unsigned PPB : 2;
342 unsigned : 6;
344 } __UCFGbits_t;
346 extern __at(0x0F6F) volatile __UCFGbits_t UCFGbits;
348 #define _PPB0 0x01
349 #define _PPB1 0x02
350 #define _FSEN 0x04
351 #define _UTRDIS 0x08
352 #define _UPUEN 0x10
353 #define _UOEMON 0x40
354 #define _UTEYE 0x80
356 //==============================================================================
359 //==============================================================================
360 // UEP0 Bits
362 extern __at(0x0F70) __sfr UEP0;
364 typedef struct
366 unsigned EPSTALL : 1;
367 unsigned EPINEN : 1;
368 unsigned EPOUTEN : 1;
369 unsigned EPCONDIS : 1;
370 unsigned EPHSHK : 1;
371 unsigned : 1;
372 unsigned : 1;
373 unsigned : 1;
374 } __UEP0bits_t;
376 extern __at(0x0F70) volatile __UEP0bits_t UEP0bits;
378 #define _EPSTALL 0x01
379 #define _EPINEN 0x02
380 #define _EPOUTEN 0x04
381 #define _EPCONDIS 0x08
382 #define _EPHSHK 0x10
384 //==============================================================================
387 //==============================================================================
388 // UEP1 Bits
390 extern __at(0x0F71) __sfr UEP1;
392 typedef struct
394 unsigned EPSTALL : 1;
395 unsigned EPINEN : 1;
396 unsigned EPOUTEN : 1;
397 unsigned EPCONDIS : 1;
398 unsigned EPHSHK : 1;
399 unsigned : 1;
400 unsigned : 1;
401 unsigned : 1;
402 } __UEP1bits_t;
404 extern __at(0x0F71) volatile __UEP1bits_t UEP1bits;
406 #define _UEP1_EPSTALL 0x01
407 #define _UEP1_EPINEN 0x02
408 #define _UEP1_EPOUTEN 0x04
409 #define _UEP1_EPCONDIS 0x08
410 #define _UEP1_EPHSHK 0x10
412 //==============================================================================
415 //==============================================================================
416 // UEP2 Bits
418 extern __at(0x0F72) __sfr UEP2;
420 typedef struct
422 unsigned EPSTALL : 1;
423 unsigned EPINEN : 1;
424 unsigned EPOUTEN : 1;
425 unsigned EPCONDIS : 1;
426 unsigned EPHSHK : 1;
427 unsigned : 1;
428 unsigned : 1;
429 unsigned : 1;
430 } __UEP2bits_t;
432 extern __at(0x0F72) volatile __UEP2bits_t UEP2bits;
434 #define _UEP2_EPSTALL 0x01
435 #define _UEP2_EPINEN 0x02
436 #define _UEP2_EPOUTEN 0x04
437 #define _UEP2_EPCONDIS 0x08
438 #define _UEP2_EPHSHK 0x10
440 //==============================================================================
443 //==============================================================================
444 // UEP3 Bits
446 extern __at(0x0F73) __sfr UEP3;
448 typedef struct
450 unsigned EPSTALL : 1;
451 unsigned EPINEN : 1;
452 unsigned EPOUTEN : 1;
453 unsigned EPCONDIS : 1;
454 unsigned EPHSHK : 1;
455 unsigned : 1;
456 unsigned : 1;
457 unsigned : 1;
458 } __UEP3bits_t;
460 extern __at(0x0F73) volatile __UEP3bits_t UEP3bits;
462 #define _UEP3_EPSTALL 0x01
463 #define _UEP3_EPINEN 0x02
464 #define _UEP3_EPOUTEN 0x04
465 #define _UEP3_EPCONDIS 0x08
466 #define _UEP3_EPHSHK 0x10
468 //==============================================================================
471 //==============================================================================
472 // UEP4 Bits
474 extern __at(0x0F74) __sfr UEP4;
476 typedef struct
478 unsigned EPSTALL : 1;
479 unsigned EPINEN : 1;
480 unsigned EPOUTEN : 1;
481 unsigned EPCONDIS : 1;
482 unsigned EPHSHK : 1;
483 unsigned : 1;
484 unsigned : 1;
485 unsigned : 1;
486 } __UEP4bits_t;
488 extern __at(0x0F74) volatile __UEP4bits_t UEP4bits;
490 #define _UEP4_EPSTALL 0x01
491 #define _UEP4_EPINEN 0x02
492 #define _UEP4_EPOUTEN 0x04
493 #define _UEP4_EPCONDIS 0x08
494 #define _UEP4_EPHSHK 0x10
496 //==============================================================================
499 //==============================================================================
500 // UEP5 Bits
502 extern __at(0x0F75) __sfr UEP5;
504 typedef struct
506 unsigned EPSTALL : 1;
507 unsigned EPINEN : 1;
508 unsigned EPOUTEN : 1;
509 unsigned EPCONDIS : 1;
510 unsigned EPHSHK : 1;
511 unsigned : 1;
512 unsigned : 1;
513 unsigned : 1;
514 } __UEP5bits_t;
516 extern __at(0x0F75) volatile __UEP5bits_t UEP5bits;
518 #define _UEP5_EPSTALL 0x01
519 #define _UEP5_EPINEN 0x02
520 #define _UEP5_EPOUTEN 0x04
521 #define _UEP5_EPCONDIS 0x08
522 #define _UEP5_EPHSHK 0x10
524 //==============================================================================
527 //==============================================================================
528 // UEP6 Bits
530 extern __at(0x0F76) __sfr UEP6;
532 typedef struct
534 unsigned EPSTALL : 1;
535 unsigned EPINEN : 1;
536 unsigned EPOUTEN : 1;
537 unsigned EPCONDIS : 1;
538 unsigned EPHSHK : 1;
539 unsigned : 1;
540 unsigned : 1;
541 unsigned : 1;
542 } __UEP6bits_t;
544 extern __at(0x0F76) volatile __UEP6bits_t UEP6bits;
546 #define _UEP6_EPSTALL 0x01
547 #define _UEP6_EPINEN 0x02
548 #define _UEP6_EPOUTEN 0x04
549 #define _UEP6_EPCONDIS 0x08
550 #define _UEP6_EPHSHK 0x10
552 //==============================================================================
555 //==============================================================================
556 // UEP7 Bits
558 extern __at(0x0F77) __sfr UEP7;
560 typedef struct
562 unsigned EPSTALL : 1;
563 unsigned EPINEN : 1;
564 unsigned EPOUTEN : 1;
565 unsigned EPCONDIS : 1;
566 unsigned EPHSHK : 1;
567 unsigned : 1;
568 unsigned : 1;
569 unsigned : 1;
570 } __UEP7bits_t;
572 extern __at(0x0F77) volatile __UEP7bits_t UEP7bits;
574 #define _UEP7_EPSTALL 0x01
575 #define _UEP7_EPINEN 0x02
576 #define _UEP7_EPOUTEN 0x04
577 #define _UEP7_EPCONDIS 0x08
578 #define _UEP7_EPHSHK 0x10
580 //==============================================================================
583 //==============================================================================
584 // UEP8 Bits
586 extern __at(0x0F78) __sfr UEP8;
588 typedef struct
590 unsigned EPSTALL : 1;
591 unsigned EPINEN : 1;
592 unsigned EPOUTEN : 1;
593 unsigned EPCONDIS : 1;
594 unsigned EPHSHK : 1;
595 unsigned : 1;
596 unsigned : 1;
597 unsigned : 1;
598 } __UEP8bits_t;
600 extern __at(0x0F78) volatile __UEP8bits_t UEP8bits;
602 #define _UEP8_EPSTALL 0x01
603 #define _UEP8_EPINEN 0x02
604 #define _UEP8_EPOUTEN 0x04
605 #define _UEP8_EPCONDIS 0x08
606 #define _UEP8_EPHSHK 0x10
608 //==============================================================================
611 //==============================================================================
612 // UEP9 Bits
614 extern __at(0x0F79) __sfr UEP9;
616 typedef struct
618 unsigned EPSTALL : 1;
619 unsigned EPINEN : 1;
620 unsigned EPOUTEN : 1;
621 unsigned EPCONDIS : 1;
622 unsigned EPHSHK : 1;
623 unsigned : 1;
624 unsigned : 1;
625 unsigned : 1;
626 } __UEP9bits_t;
628 extern __at(0x0F79) volatile __UEP9bits_t UEP9bits;
630 #define _UEP9_EPSTALL 0x01
631 #define _UEP9_EPINEN 0x02
632 #define _UEP9_EPOUTEN 0x04
633 #define _UEP9_EPCONDIS 0x08
634 #define _UEP9_EPHSHK 0x10
636 //==============================================================================
639 //==============================================================================
640 // UEP10 Bits
642 extern __at(0x0F7A) __sfr UEP10;
644 typedef struct
646 unsigned EPSTALL : 1;
647 unsigned EPINEN : 1;
648 unsigned EPOUTEN : 1;
649 unsigned EPCONDIS : 1;
650 unsigned EPHSHK : 1;
651 unsigned : 1;
652 unsigned : 1;
653 unsigned : 1;
654 } __UEP10bits_t;
656 extern __at(0x0F7A) volatile __UEP10bits_t UEP10bits;
658 #define _UEP10_EPSTALL 0x01
659 #define _UEP10_EPINEN 0x02
660 #define _UEP10_EPOUTEN 0x04
661 #define _UEP10_EPCONDIS 0x08
662 #define _UEP10_EPHSHK 0x10
664 //==============================================================================
667 //==============================================================================
668 // UEP11 Bits
670 extern __at(0x0F7B) __sfr UEP11;
672 typedef struct
674 unsigned EPSTALL : 1;
675 unsigned EPINEN : 1;
676 unsigned EPOUTEN : 1;
677 unsigned EPCONDIS : 1;
678 unsigned EPHSHK : 1;
679 unsigned : 1;
680 unsigned : 1;
681 unsigned : 1;
682 } __UEP11bits_t;
684 extern __at(0x0F7B) volatile __UEP11bits_t UEP11bits;
686 #define _UEP11_EPSTALL 0x01
687 #define _UEP11_EPINEN 0x02
688 #define _UEP11_EPOUTEN 0x04
689 #define _UEP11_EPCONDIS 0x08
690 #define _UEP11_EPHSHK 0x10
692 //==============================================================================
695 //==============================================================================
696 // UEP12 Bits
698 extern __at(0x0F7C) __sfr UEP12;
700 typedef struct
702 unsigned EPSTALL : 1;
703 unsigned EPINEN : 1;
704 unsigned EPOUTEN : 1;
705 unsigned EPCONDIS : 1;
706 unsigned EPHSHK : 1;
707 unsigned : 1;
708 unsigned : 1;
709 unsigned : 1;
710 } __UEP12bits_t;
712 extern __at(0x0F7C) volatile __UEP12bits_t UEP12bits;
714 #define _UEP12_EPSTALL 0x01
715 #define _UEP12_EPINEN 0x02
716 #define _UEP12_EPOUTEN 0x04
717 #define _UEP12_EPCONDIS 0x08
718 #define _UEP12_EPHSHK 0x10
720 //==============================================================================
723 //==============================================================================
724 // UEP13 Bits
726 extern __at(0x0F7D) __sfr UEP13;
728 typedef struct
730 unsigned EPSTALL : 1;
731 unsigned EPINEN : 1;
732 unsigned EPOUTEN : 1;
733 unsigned EPCONDIS : 1;
734 unsigned EPHSHK : 1;
735 unsigned : 1;
736 unsigned : 1;
737 unsigned : 1;
738 } __UEP13bits_t;
740 extern __at(0x0F7D) volatile __UEP13bits_t UEP13bits;
742 #define _UEP13_EPSTALL 0x01
743 #define _UEP13_EPINEN 0x02
744 #define _UEP13_EPOUTEN 0x04
745 #define _UEP13_EPCONDIS 0x08
746 #define _UEP13_EPHSHK 0x10
748 //==============================================================================
751 //==============================================================================
752 // UEP14 Bits
754 extern __at(0x0F7E) __sfr UEP14;
756 typedef struct
758 unsigned EPSTALL : 1;
759 unsigned EPINEN : 1;
760 unsigned EPOUTEN : 1;
761 unsigned EPCONDIS : 1;
762 unsigned EPHSHK : 1;
763 unsigned : 1;
764 unsigned : 1;
765 unsigned : 1;
766 } __UEP14bits_t;
768 extern __at(0x0F7E) volatile __UEP14bits_t UEP14bits;
770 #define _UEP14_EPSTALL 0x01
771 #define _UEP14_EPINEN 0x02
772 #define _UEP14_EPOUTEN 0x04
773 #define _UEP14_EPCONDIS 0x08
774 #define _UEP14_EPHSHK 0x10
776 //==============================================================================
779 //==============================================================================
780 // UEP15 Bits
782 extern __at(0x0F7F) __sfr UEP15;
784 typedef struct
786 unsigned EPSTALL : 1;
787 unsigned EPINEN : 1;
788 unsigned EPOUTEN : 1;
789 unsigned EPCONDIS : 1;
790 unsigned EPHSHK : 1;
791 unsigned : 1;
792 unsigned : 1;
793 unsigned : 1;
794 } __UEP15bits_t;
796 extern __at(0x0F7F) volatile __UEP15bits_t UEP15bits;
798 #define _UEP15_EPSTALL 0x01
799 #define _UEP15_EPINEN 0x02
800 #define _UEP15_EPOUTEN 0x04
801 #define _UEP15_EPCONDIS 0x08
802 #define _UEP15_EPHSHK 0x10
804 //==============================================================================
807 //==============================================================================
808 // PORTA Bits
810 extern __at(0x0F80) __sfr PORTA;
812 typedef union
814 struct
816 unsigned RA0 : 1;
817 unsigned RA1 : 1;
818 unsigned RA2 : 1;
819 unsigned RA3 : 1;
820 unsigned RA4 : 1;
821 unsigned RA5 : 1;
822 unsigned RA6 : 1;
823 unsigned : 1;
826 struct
828 unsigned AN0 : 1;
829 unsigned AN1 : 1;
830 unsigned AN2 : 1;
831 unsigned AN3 : 1;
832 unsigned T0CKI : 1;
833 unsigned AN4 : 1;
834 unsigned OSC2 : 1;
835 unsigned : 1;
838 struct
840 unsigned : 1;
841 unsigned : 1;
842 unsigned VREFM : 1;
843 unsigned VREFP : 1;
844 unsigned RCV : 1;
845 unsigned LVDIN : 1;
846 unsigned : 1;
847 unsigned : 1;
850 struct
852 unsigned : 1;
853 unsigned : 1;
854 unsigned : 1;
855 unsigned : 1;
856 unsigned : 1;
857 unsigned HLVDIN : 1;
858 unsigned : 1;
859 unsigned : 1;
862 struct
864 unsigned RA : 7;
865 unsigned : 1;
867 } __PORTAbits_t;
869 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
871 #define _PORTA_RA0 0x01
872 #define _PORTA_AN0 0x01
873 #define _PORTA_RA1 0x02
874 #define _PORTA_AN1 0x02
875 #define _PORTA_RA2 0x04
876 #define _PORTA_AN2 0x04
877 #define _PORTA_VREFM 0x04
878 #define _PORTA_RA3 0x08
879 #define _PORTA_AN3 0x08
880 #define _PORTA_VREFP 0x08
881 #define _PORTA_RA4 0x10
882 #define _PORTA_T0CKI 0x10
883 #define _PORTA_RCV 0x10
884 #define _PORTA_RA5 0x20
885 #define _PORTA_AN4 0x20
886 #define _PORTA_LVDIN 0x20
887 #define _PORTA_HLVDIN 0x20
888 #define _PORTA_RA6 0x40
889 #define _PORTA_OSC2 0x40
891 //==============================================================================
894 //==============================================================================
895 // PORTB Bits
897 extern __at(0x0F81) __sfr PORTB;
899 typedef union
901 struct
903 unsigned RB0 : 1;
904 unsigned RB1 : 1;
905 unsigned RB2 : 1;
906 unsigned RB3 : 1;
907 unsigned RB4 : 1;
908 unsigned RB5 : 1;
909 unsigned RB6 : 1;
910 unsigned RB7 : 1;
913 struct
915 unsigned INT0 : 1;
916 unsigned INT1 : 1;
917 unsigned INT2 : 1;
918 unsigned AN9 : 1;
919 unsigned KBI0 : 1;
920 unsigned KBI1 : 1;
921 unsigned KBI2 : 1;
922 unsigned KBI3 : 1;
925 struct
927 unsigned AN12 : 1;
928 unsigned AN10 : 1;
929 unsigned AN8 : 1;
930 unsigned VPO : 1;
931 unsigned AN11 : 1;
932 unsigned PGM : 1;
933 unsigned PGC : 1;
934 unsigned PGD : 1;
937 struct
939 unsigned : 1;
940 unsigned : 1;
941 unsigned VMO : 1;
942 unsigned : 1;
943 unsigned : 1;
944 unsigned : 1;
945 unsigned : 1;
946 unsigned : 1;
949 struct
951 unsigned INT : 3;
952 unsigned : 5;
955 struct
957 unsigned : 4;
958 unsigned KBI : 4;
960 } __PORTBbits_t;
962 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
964 #define _PORTB_RB0 0x01
965 #define _PORTB_INT0 0x01
966 #define _PORTB_AN12 0x01
967 #define _PORTB_RB1 0x02
968 #define _PORTB_INT1 0x02
969 #define _PORTB_AN10 0x02
970 #define _PORTB_RB2 0x04
971 #define _PORTB_INT2 0x04
972 #define _PORTB_AN8 0x04
973 #define _PORTB_VMO 0x04
974 #define _PORTB_RB3 0x08
975 #define _PORTB_AN9 0x08
976 #define _PORTB_VPO 0x08
977 #define _PORTB_RB4 0x10
978 #define _PORTB_KBI0 0x10
979 #define _PORTB_AN11 0x10
980 #define _PORTB_RB5 0x20
981 #define _PORTB_KBI1 0x20
982 #define _PORTB_PGM 0x20
983 #define _PORTB_RB6 0x40
984 #define _PORTB_KBI2 0x40
985 #define _PORTB_PGC 0x40
986 #define _PORTB_RB7 0x80
987 #define _PORTB_KBI3 0x80
988 #define _PORTB_PGD 0x80
990 //==============================================================================
993 //==============================================================================
994 // PORTC Bits
996 extern __at(0x0F82) __sfr PORTC;
998 typedef union
1000 struct
1002 unsigned RC0 : 1;
1003 unsigned RC1 : 1;
1004 unsigned RC2 : 1;
1005 unsigned : 1;
1006 unsigned RC4 : 1;
1007 unsigned RC5 : 1;
1008 unsigned RC6 : 1;
1009 unsigned RC7 : 1;
1012 struct
1014 unsigned T1OSO : 1;
1015 unsigned T1OSI : 1;
1016 unsigned CCP1 : 1;
1017 unsigned : 1;
1018 unsigned : 1;
1019 unsigned : 1;
1020 unsigned TX : 1;
1021 unsigned RX : 1;
1024 struct
1026 unsigned T1CKI : 1;
1027 unsigned NOT_UOE : 1;
1028 unsigned P1A : 1;
1029 unsigned : 1;
1030 unsigned : 1;
1031 unsigned : 1;
1032 unsigned CK : 1;
1033 unsigned : 1;
1036 struct
1038 unsigned : 1;
1039 unsigned UOE : 1;
1040 unsigned : 1;
1041 unsigned : 1;
1042 unsigned : 1;
1043 unsigned : 1;
1044 unsigned : 1;
1045 unsigned : 1;
1047 } __PORTCbits_t;
1049 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1051 #define _PORTC_RC0 0x01
1052 #define _PORTC_T1OSO 0x01
1053 #define _PORTC_T1CKI 0x01
1054 #define _PORTC_RC1 0x02
1055 #define _PORTC_T1OSI 0x02
1056 #define _PORTC_NOT_UOE 0x02
1057 #define _PORTC_UOE 0x02
1058 #define _PORTC_RC2 0x04
1059 #define _PORTC_CCP1 0x04
1060 #define _PORTC_P1A 0x04
1061 #define _PORTC_RC4 0x10
1062 #define _PORTC_RC5 0x20
1063 #define _PORTC_RC6 0x40
1064 #define _PORTC_TX 0x40
1065 #define _PORTC_CK 0x40
1066 #define _PORTC_RC7 0x80
1067 #define _PORTC_RX 0x80
1069 //==============================================================================
1072 //==============================================================================
1073 // PORTD Bits
1075 extern __at(0x0F83) __sfr PORTD;
1077 typedef struct
1079 unsigned RD0 : 1;
1080 unsigned RD1 : 1;
1081 unsigned RD2 : 1;
1082 unsigned RD3 : 1;
1083 unsigned RD4 : 1;
1084 unsigned RD5 : 1;
1085 unsigned RD6 : 1;
1086 unsigned RD7 : 1;
1087 } __PORTDbits_t;
1089 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1091 #define _PORTD_RD0 0x01
1092 #define _PORTD_RD1 0x02
1093 #define _PORTD_RD2 0x04
1094 #define _PORTD_RD3 0x08
1095 #define _PORTD_RD4 0x10
1096 #define _PORTD_RD5 0x20
1097 #define _PORTD_RD6 0x40
1098 #define _PORTD_RD7 0x80
1100 //==============================================================================
1103 //==============================================================================
1104 // PORTE Bits
1106 extern __at(0x0F84) __sfr PORTE;
1108 typedef union
1110 struct
1112 unsigned RE0 : 1;
1113 unsigned RE1 : 1;
1114 unsigned RE2 : 1;
1115 unsigned RE3 : 1;
1116 unsigned : 1;
1117 unsigned : 1;
1118 unsigned : 1;
1119 unsigned : 1;
1122 struct
1124 unsigned AN5 : 1;
1125 unsigned AN6 : 1;
1126 unsigned AN7 : 1;
1127 unsigned : 1;
1128 unsigned : 1;
1129 unsigned : 1;
1130 unsigned : 1;
1131 unsigned : 1;
1134 struct
1136 unsigned RE : 4;
1137 unsigned : 4;
1139 } __PORTEbits_t;
1141 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1143 #define _PORTE_RE0 0x01
1144 #define _PORTE_AN5 0x01
1145 #define _PORTE_RE1 0x02
1146 #define _PORTE_AN6 0x02
1147 #define _PORTE_RE2 0x04
1148 #define _PORTE_AN7 0x04
1149 #define _PORTE_RE3 0x08
1151 //==============================================================================
1154 //==============================================================================
1155 // LATA Bits
1157 extern __at(0x0F89) __sfr LATA;
1159 typedef union
1161 struct
1163 unsigned LATA0 : 1;
1164 unsigned LATA1 : 1;
1165 unsigned LATA2 : 1;
1166 unsigned LATA3 : 1;
1167 unsigned LATA4 : 1;
1168 unsigned LATA5 : 1;
1169 unsigned LATA6 : 1;
1170 unsigned : 1;
1173 struct
1175 unsigned LATA : 7;
1176 unsigned : 1;
1178 } __LATAbits_t;
1180 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1182 #define _LATA0 0x01
1183 #define _LATA1 0x02
1184 #define _LATA2 0x04
1185 #define _LATA3 0x08
1186 #define _LATA4 0x10
1187 #define _LATA5 0x20
1188 #define _LATA6 0x40
1190 //==============================================================================
1193 //==============================================================================
1194 // LATB Bits
1196 extern __at(0x0F8A) __sfr LATB;
1198 typedef struct
1200 unsigned LATB0 : 1;
1201 unsigned LATB1 : 1;
1202 unsigned LATB2 : 1;
1203 unsigned LATB3 : 1;
1204 unsigned LATB4 : 1;
1205 unsigned LATB5 : 1;
1206 unsigned LATB6 : 1;
1207 unsigned LATB7 : 1;
1208 } __LATBbits_t;
1210 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1212 #define _LATB0 0x01
1213 #define _LATB1 0x02
1214 #define _LATB2 0x04
1215 #define _LATB3 0x08
1216 #define _LATB4 0x10
1217 #define _LATB5 0x20
1218 #define _LATB6 0x40
1219 #define _LATB7 0x80
1221 //==============================================================================
1224 //==============================================================================
1225 // LATC Bits
1227 extern __at(0x0F8B) __sfr LATC;
1229 typedef struct
1231 unsigned LATC0 : 1;
1232 unsigned LATC1 : 1;
1233 unsigned LATC2 : 1;
1234 unsigned : 1;
1235 unsigned : 1;
1236 unsigned : 1;
1237 unsigned LATC6 : 1;
1238 unsigned LATC7 : 1;
1239 } __LATCbits_t;
1241 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1243 #define _LATC0 0x01
1244 #define _LATC1 0x02
1245 #define _LATC2 0x04
1246 #define _LATC6 0x40
1247 #define _LATC7 0x80
1249 //==============================================================================
1252 //==============================================================================
1253 // LATD Bits
1255 extern __at(0x0F8C) __sfr LATD;
1257 typedef struct
1259 unsigned LATD0 : 1;
1260 unsigned LATD1 : 1;
1261 unsigned LATD2 : 1;
1262 unsigned LATD3 : 1;
1263 unsigned LATD4 : 1;
1264 unsigned LATD5 : 1;
1265 unsigned LATD6 : 1;
1266 unsigned LATD7 : 1;
1267 } __LATDbits_t;
1269 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1271 #define _LATD0 0x01
1272 #define _LATD1 0x02
1273 #define _LATD2 0x04
1274 #define _LATD3 0x08
1275 #define _LATD4 0x10
1276 #define _LATD5 0x20
1277 #define _LATD6 0x40
1278 #define _LATD7 0x80
1280 //==============================================================================
1283 //==============================================================================
1284 // LATE Bits
1286 extern __at(0x0F8D) __sfr LATE;
1288 typedef union
1290 struct
1292 unsigned LATE0 : 1;
1293 unsigned LATE1 : 1;
1294 unsigned LATE2 : 1;
1295 unsigned : 1;
1296 unsigned : 1;
1297 unsigned : 1;
1298 unsigned : 1;
1299 unsigned : 1;
1302 struct
1304 unsigned LATE : 3;
1305 unsigned : 5;
1307 } __LATEbits_t;
1309 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1311 #define _LATE0 0x01
1312 #define _LATE1 0x02
1313 #define _LATE2 0x04
1315 //==============================================================================
1318 //==============================================================================
1319 // DDRA Bits
1321 extern __at(0x0F92) __sfr DDRA;
1323 typedef union
1325 struct
1327 unsigned TRISA0 : 1;
1328 unsigned TRISA1 : 1;
1329 unsigned TRISA2 : 1;
1330 unsigned TRISA3 : 1;
1331 unsigned TRISA4 : 1;
1332 unsigned TRISA5 : 1;
1333 unsigned TRISA6 : 1;
1334 unsigned : 1;
1337 struct
1339 unsigned RA0 : 1;
1340 unsigned RA1 : 1;
1341 unsigned RA2 : 1;
1342 unsigned RA3 : 1;
1343 unsigned RA4 : 1;
1344 unsigned RA5 : 1;
1345 unsigned RA6 : 1;
1346 unsigned : 1;
1349 struct
1351 unsigned TRISA : 7;
1352 unsigned : 1;
1355 struct
1357 unsigned RA : 7;
1358 unsigned : 1;
1360 } __DDRAbits_t;
1362 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1364 #define _TRISA0 0x01
1365 #define _RA0 0x01
1366 #define _TRISA1 0x02
1367 #define _RA1 0x02
1368 #define _TRISA2 0x04
1369 #define _RA2 0x04
1370 #define _TRISA3 0x08
1371 #define _RA3 0x08
1372 #define _TRISA4 0x10
1373 #define _RA4 0x10
1374 #define _TRISA5 0x20
1375 #define _RA5 0x20
1376 #define _TRISA6 0x40
1377 #define _RA6 0x40
1379 //==============================================================================
1382 //==============================================================================
1383 // TRISA Bits
1385 extern __at(0x0F92) __sfr TRISA;
1387 typedef union
1389 struct
1391 unsigned TRISA0 : 1;
1392 unsigned TRISA1 : 1;
1393 unsigned TRISA2 : 1;
1394 unsigned TRISA3 : 1;
1395 unsigned TRISA4 : 1;
1396 unsigned TRISA5 : 1;
1397 unsigned TRISA6 : 1;
1398 unsigned : 1;
1401 struct
1403 unsigned RA0 : 1;
1404 unsigned RA1 : 1;
1405 unsigned RA2 : 1;
1406 unsigned RA3 : 1;
1407 unsigned RA4 : 1;
1408 unsigned RA5 : 1;
1409 unsigned RA6 : 1;
1410 unsigned : 1;
1413 struct
1415 unsigned TRISA : 7;
1416 unsigned : 1;
1419 struct
1421 unsigned RA : 7;
1422 unsigned : 1;
1424 } __TRISAbits_t;
1426 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1428 #define _TRISA_TRISA0 0x01
1429 #define _TRISA_RA0 0x01
1430 #define _TRISA_TRISA1 0x02
1431 #define _TRISA_RA1 0x02
1432 #define _TRISA_TRISA2 0x04
1433 #define _TRISA_RA2 0x04
1434 #define _TRISA_TRISA3 0x08
1435 #define _TRISA_RA3 0x08
1436 #define _TRISA_TRISA4 0x10
1437 #define _TRISA_RA4 0x10
1438 #define _TRISA_TRISA5 0x20
1439 #define _TRISA_RA5 0x20
1440 #define _TRISA_TRISA6 0x40
1441 #define _TRISA_RA6 0x40
1443 //==============================================================================
1446 //==============================================================================
1447 // DDRB Bits
1449 extern __at(0x0F93) __sfr DDRB;
1451 typedef union
1453 struct
1455 unsigned TRISB0 : 1;
1456 unsigned TRISB1 : 1;
1457 unsigned TRISB2 : 1;
1458 unsigned TRISB3 : 1;
1459 unsigned TRISB4 : 1;
1460 unsigned TRISB5 : 1;
1461 unsigned TRISB6 : 1;
1462 unsigned TRISB7 : 1;
1465 struct
1467 unsigned RB0 : 1;
1468 unsigned RB1 : 1;
1469 unsigned RB2 : 1;
1470 unsigned RB3 : 1;
1471 unsigned RB4 : 1;
1472 unsigned RB5 : 1;
1473 unsigned RB6 : 1;
1474 unsigned RB7 : 1;
1476 } __DDRBbits_t;
1478 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1480 #define _TRISB0 0x01
1481 #define _RB0 0x01
1482 #define _TRISB1 0x02
1483 #define _RB1 0x02
1484 #define _TRISB2 0x04
1485 #define _RB2 0x04
1486 #define _TRISB3 0x08
1487 #define _RB3 0x08
1488 #define _TRISB4 0x10
1489 #define _RB4 0x10
1490 #define _TRISB5 0x20
1491 #define _RB5 0x20
1492 #define _TRISB6 0x40
1493 #define _RB6 0x40
1494 #define _TRISB7 0x80
1495 #define _RB7 0x80
1497 //==============================================================================
1500 //==============================================================================
1501 // TRISB Bits
1503 extern __at(0x0F93) __sfr TRISB;
1505 typedef union
1507 struct
1509 unsigned TRISB0 : 1;
1510 unsigned TRISB1 : 1;
1511 unsigned TRISB2 : 1;
1512 unsigned TRISB3 : 1;
1513 unsigned TRISB4 : 1;
1514 unsigned TRISB5 : 1;
1515 unsigned TRISB6 : 1;
1516 unsigned TRISB7 : 1;
1519 struct
1521 unsigned RB0 : 1;
1522 unsigned RB1 : 1;
1523 unsigned RB2 : 1;
1524 unsigned RB3 : 1;
1525 unsigned RB4 : 1;
1526 unsigned RB5 : 1;
1527 unsigned RB6 : 1;
1528 unsigned RB7 : 1;
1530 } __TRISBbits_t;
1532 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1534 #define _TRISB_TRISB0 0x01
1535 #define _TRISB_RB0 0x01
1536 #define _TRISB_TRISB1 0x02
1537 #define _TRISB_RB1 0x02
1538 #define _TRISB_TRISB2 0x04
1539 #define _TRISB_RB2 0x04
1540 #define _TRISB_TRISB3 0x08
1541 #define _TRISB_RB3 0x08
1542 #define _TRISB_TRISB4 0x10
1543 #define _TRISB_RB4 0x10
1544 #define _TRISB_TRISB5 0x20
1545 #define _TRISB_RB5 0x20
1546 #define _TRISB_TRISB6 0x40
1547 #define _TRISB_RB6 0x40
1548 #define _TRISB_TRISB7 0x80
1549 #define _TRISB_RB7 0x80
1551 //==============================================================================
1554 //==============================================================================
1555 // DDRC Bits
1557 extern __at(0x0F94) __sfr DDRC;
1559 typedef union
1561 struct
1563 unsigned TRISC0 : 1;
1564 unsigned TRISC1 : 1;
1565 unsigned TRISC2 : 1;
1566 unsigned : 1;
1567 unsigned : 1;
1568 unsigned : 1;
1569 unsigned TRISC6 : 1;
1570 unsigned TRISC7 : 1;
1573 struct
1575 unsigned RC0 : 1;
1576 unsigned RC1 : 1;
1577 unsigned RC2 : 1;
1578 unsigned : 1;
1579 unsigned : 1;
1580 unsigned : 1;
1581 unsigned RC6 : 1;
1582 unsigned RC7 : 1;
1584 } __DDRCbits_t;
1586 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1588 #define _TRISC0 0x01
1589 #define _RC0 0x01
1590 #define _TRISC1 0x02
1591 #define _RC1 0x02
1592 #define _TRISC2 0x04
1593 #define _RC2 0x04
1594 #define _TRISC6 0x40
1595 #define _RC6 0x40
1596 #define _TRISC7 0x80
1597 #define _RC7 0x80
1599 //==============================================================================
1602 //==============================================================================
1603 // TRISC Bits
1605 extern __at(0x0F94) __sfr TRISC;
1607 typedef union
1609 struct
1611 unsigned TRISC0 : 1;
1612 unsigned TRISC1 : 1;
1613 unsigned TRISC2 : 1;
1614 unsigned : 1;
1615 unsigned : 1;
1616 unsigned : 1;
1617 unsigned TRISC6 : 1;
1618 unsigned TRISC7 : 1;
1621 struct
1623 unsigned RC0 : 1;
1624 unsigned RC1 : 1;
1625 unsigned RC2 : 1;
1626 unsigned : 1;
1627 unsigned : 1;
1628 unsigned : 1;
1629 unsigned RC6 : 1;
1630 unsigned RC7 : 1;
1632 } __TRISCbits_t;
1634 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1636 #define _TRISC_TRISC0 0x01
1637 #define _TRISC_RC0 0x01
1638 #define _TRISC_TRISC1 0x02
1639 #define _TRISC_RC1 0x02
1640 #define _TRISC_TRISC2 0x04
1641 #define _TRISC_RC2 0x04
1642 #define _TRISC_TRISC6 0x40
1643 #define _TRISC_RC6 0x40
1644 #define _TRISC_TRISC7 0x80
1645 #define _TRISC_RC7 0x80
1647 //==============================================================================
1650 //==============================================================================
1651 // DDRD Bits
1653 extern __at(0x0F95) __sfr DDRD;
1655 typedef union
1657 struct
1659 unsigned TRISD0 : 1;
1660 unsigned TRISD1 : 1;
1661 unsigned TRISD2 : 1;
1662 unsigned TRISD3 : 1;
1663 unsigned TRISD4 : 1;
1664 unsigned TRISD5 : 1;
1665 unsigned TRISD6 : 1;
1666 unsigned TRISD7 : 1;
1669 struct
1671 unsigned RD0 : 1;
1672 unsigned RD1 : 1;
1673 unsigned RD2 : 1;
1674 unsigned RD3 : 1;
1675 unsigned RD4 : 1;
1676 unsigned RD5 : 1;
1677 unsigned RD6 : 1;
1678 unsigned RD7 : 1;
1680 } __DDRDbits_t;
1682 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
1684 #define _TRISD0 0x01
1685 #define _RD0 0x01
1686 #define _TRISD1 0x02
1687 #define _RD1 0x02
1688 #define _TRISD2 0x04
1689 #define _RD2 0x04
1690 #define _TRISD3 0x08
1691 #define _RD3 0x08
1692 #define _TRISD4 0x10
1693 #define _RD4 0x10
1694 #define _TRISD5 0x20
1695 #define _RD5 0x20
1696 #define _TRISD6 0x40
1697 #define _RD6 0x40
1698 #define _TRISD7 0x80
1699 #define _RD7 0x80
1701 //==============================================================================
1704 //==============================================================================
1705 // TRISD Bits
1707 extern __at(0x0F95) __sfr TRISD;
1709 typedef union
1711 struct
1713 unsigned TRISD0 : 1;
1714 unsigned TRISD1 : 1;
1715 unsigned TRISD2 : 1;
1716 unsigned TRISD3 : 1;
1717 unsigned TRISD4 : 1;
1718 unsigned TRISD5 : 1;
1719 unsigned TRISD6 : 1;
1720 unsigned TRISD7 : 1;
1723 struct
1725 unsigned RD0 : 1;
1726 unsigned RD1 : 1;
1727 unsigned RD2 : 1;
1728 unsigned RD3 : 1;
1729 unsigned RD4 : 1;
1730 unsigned RD5 : 1;
1731 unsigned RD6 : 1;
1732 unsigned RD7 : 1;
1734 } __TRISDbits_t;
1736 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
1738 #define _TRISD_TRISD0 0x01
1739 #define _TRISD_RD0 0x01
1740 #define _TRISD_TRISD1 0x02
1741 #define _TRISD_RD1 0x02
1742 #define _TRISD_TRISD2 0x04
1743 #define _TRISD_RD2 0x04
1744 #define _TRISD_TRISD3 0x08
1745 #define _TRISD_RD3 0x08
1746 #define _TRISD_TRISD4 0x10
1747 #define _TRISD_RD4 0x10
1748 #define _TRISD_TRISD5 0x20
1749 #define _TRISD_RD5 0x20
1750 #define _TRISD_TRISD6 0x40
1751 #define _TRISD_RD6 0x40
1752 #define _TRISD_TRISD7 0x80
1753 #define _TRISD_RD7 0x80
1755 //==============================================================================
1758 //==============================================================================
1759 // DDRE Bits
1761 extern __at(0x0F96) __sfr DDRE;
1763 typedef union
1765 struct
1767 unsigned TRISE0 : 1;
1768 unsigned TRISE1 : 1;
1769 unsigned TRISE2 : 1;
1770 unsigned : 1;
1771 unsigned : 1;
1772 unsigned : 1;
1773 unsigned : 1;
1774 unsigned : 1;
1777 struct
1779 unsigned RE0 : 1;
1780 unsigned RE1 : 1;
1781 unsigned RE2 : 1;
1782 unsigned : 1;
1783 unsigned : 1;
1784 unsigned : 1;
1785 unsigned : 1;
1786 unsigned : 1;
1789 struct
1791 unsigned TRISE : 3;
1792 unsigned : 5;
1795 struct
1797 unsigned RE : 3;
1798 unsigned : 5;
1800 } __DDREbits_t;
1802 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
1804 #define _TRISE0 0x01
1805 #define _RE0 0x01
1806 #define _TRISE1 0x02
1807 #define _RE1 0x02
1808 #define _TRISE2 0x04
1809 #define _RE2 0x04
1811 //==============================================================================
1814 //==============================================================================
1815 // TRISE Bits
1817 extern __at(0x0F96) __sfr TRISE;
1819 typedef union
1821 struct
1823 unsigned TRISE0 : 1;
1824 unsigned TRISE1 : 1;
1825 unsigned TRISE2 : 1;
1826 unsigned : 1;
1827 unsigned : 1;
1828 unsigned : 1;
1829 unsigned : 1;
1830 unsigned : 1;
1833 struct
1835 unsigned RE0 : 1;
1836 unsigned RE1 : 1;
1837 unsigned RE2 : 1;
1838 unsigned : 1;
1839 unsigned : 1;
1840 unsigned : 1;
1841 unsigned : 1;
1842 unsigned : 1;
1845 struct
1847 unsigned RE : 3;
1848 unsigned : 5;
1851 struct
1853 unsigned TRISE : 3;
1854 unsigned : 5;
1856 } __TRISEbits_t;
1858 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
1860 #define _TRISE_TRISE0 0x01
1861 #define _TRISE_RE0 0x01
1862 #define _TRISE_TRISE1 0x02
1863 #define _TRISE_RE1 0x02
1864 #define _TRISE_TRISE2 0x04
1865 #define _TRISE_RE2 0x04
1867 //==============================================================================
1870 //==============================================================================
1871 // PIE1 Bits
1873 extern __at(0x0F9D) __sfr PIE1;
1875 typedef struct
1877 unsigned TMR1IE : 1;
1878 unsigned TMR2IE : 1;
1879 unsigned CCP1IE : 1;
1880 unsigned : 1;
1881 unsigned TXIE : 1;
1882 unsigned RCIE : 1;
1883 unsigned ADIE : 1;
1884 unsigned : 1;
1885 } __PIE1bits_t;
1887 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1889 #define _TMR1IE 0x01
1890 #define _TMR2IE 0x02
1891 #define _CCP1IE 0x04
1892 #define _TXIE 0x10
1893 #define _RCIE 0x20
1894 #define _ADIE 0x40
1896 //==============================================================================
1899 //==============================================================================
1900 // PIR1 Bits
1902 extern __at(0x0F9E) __sfr PIR1;
1904 typedef struct
1906 unsigned TMR1IF : 1;
1907 unsigned TMR2IF : 1;
1908 unsigned CCP1IF : 1;
1909 unsigned : 1;
1910 unsigned TXIF : 1;
1911 unsigned RCIF : 1;
1912 unsigned ADIF : 1;
1913 unsigned : 1;
1914 } __PIR1bits_t;
1916 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1918 #define _TMR1IF 0x01
1919 #define _TMR2IF 0x02
1920 #define _CCP1IF 0x04
1921 #define _TXIF 0x10
1922 #define _RCIF 0x20
1923 #define _ADIF 0x40
1925 //==============================================================================
1928 //==============================================================================
1929 // IPR1 Bits
1931 extern __at(0x0F9F) __sfr IPR1;
1933 typedef struct
1935 unsigned TMR1IP : 1;
1936 unsigned TMR2IP : 1;
1937 unsigned CCP1IP : 1;
1938 unsigned : 1;
1939 unsigned TXIP : 1;
1940 unsigned RCIP : 1;
1941 unsigned ADIP : 1;
1942 unsigned : 1;
1943 } __IPR1bits_t;
1945 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
1947 #define _TMR1IP 0x01
1948 #define _TMR2IP 0x02
1949 #define _CCP1IP 0x04
1950 #define _TXIP 0x10
1951 #define _RCIP 0x20
1952 #define _ADIP 0x40
1954 //==============================================================================
1957 //==============================================================================
1958 // PIE2 Bits
1960 extern __at(0x0FA0) __sfr PIE2;
1962 typedef union
1964 struct
1966 unsigned : 1;
1967 unsigned : 1;
1968 unsigned HLVDIE : 1;
1969 unsigned : 1;
1970 unsigned : 1;
1971 unsigned USBIE : 1;
1972 unsigned : 1;
1973 unsigned OSCFIE : 1;
1976 struct
1978 unsigned : 1;
1979 unsigned : 1;
1980 unsigned LVDIE : 1;
1981 unsigned : 1;
1982 unsigned : 1;
1983 unsigned : 1;
1984 unsigned : 1;
1985 unsigned : 1;
1987 } __PIE2bits_t;
1989 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
1991 #define _HLVDIE 0x04
1992 #define _LVDIE 0x04
1993 #define _USBIE 0x20
1994 #define _OSCFIE 0x80
1996 //==============================================================================
1999 //==============================================================================
2000 // PIR2 Bits
2002 extern __at(0x0FA1) __sfr PIR2;
2004 typedef union
2006 struct
2008 unsigned : 1;
2009 unsigned : 1;
2010 unsigned HLVDIF : 1;
2011 unsigned : 1;
2012 unsigned : 1;
2013 unsigned USBIF : 1;
2014 unsigned : 1;
2015 unsigned OSCFIF : 1;
2018 struct
2020 unsigned : 1;
2021 unsigned : 1;
2022 unsigned LVDIF : 1;
2023 unsigned : 1;
2024 unsigned : 1;
2025 unsigned : 1;
2026 unsigned : 1;
2027 unsigned : 1;
2029 } __PIR2bits_t;
2031 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2033 #define _HLVDIF 0x04
2034 #define _LVDIF 0x04
2035 #define _USBIF 0x20
2036 #define _OSCFIF 0x80
2038 //==============================================================================
2041 //==============================================================================
2042 // IPR2 Bits
2044 extern __at(0x0FA2) __sfr IPR2;
2046 typedef union
2048 struct
2050 unsigned : 1;
2051 unsigned : 1;
2052 unsigned HLVDIP : 1;
2053 unsigned : 1;
2054 unsigned : 1;
2055 unsigned USBIP : 1;
2056 unsigned : 1;
2057 unsigned OSCFIP : 1;
2060 struct
2062 unsigned : 1;
2063 unsigned : 1;
2064 unsigned LVDIP : 1;
2065 unsigned : 1;
2066 unsigned : 1;
2067 unsigned : 1;
2068 unsigned : 1;
2069 unsigned : 1;
2071 } __IPR2bits_t;
2073 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
2075 #define _HLVDIP 0x04
2076 #define _LVDIP 0x04
2077 #define _USBIP 0x20
2078 #define _OSCFIP 0x80
2080 //==============================================================================
2083 //==============================================================================
2084 // EECON1 Bits
2086 extern __at(0x0FA6) __sfr EECON1;
2088 typedef struct
2090 unsigned : 1;
2091 unsigned WR : 1;
2092 unsigned WREN : 1;
2093 unsigned WRERR : 1;
2094 unsigned FREE : 1;
2095 unsigned : 1;
2096 unsigned CFGS : 1;
2097 unsigned : 1;
2098 } __EECON1bits_t;
2100 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
2102 #define _WR 0x02
2103 #define _WREN 0x04
2104 #define _WRERR 0x08
2105 #define _FREE 0x10
2106 #define _CFGS 0x40
2108 //==============================================================================
2110 extern __at(0x0FA7) __sfr EECON2;
2112 //==============================================================================
2113 // RCSTA Bits
2115 extern __at(0x0FAB) __sfr RCSTA;
2117 typedef union
2119 struct
2121 unsigned RX9D : 1;
2122 unsigned OERR : 1;
2123 unsigned FERR : 1;
2124 unsigned ADDEN : 1;
2125 unsigned CREN : 1;
2126 unsigned SREN : 1;
2127 unsigned RX9 : 1;
2128 unsigned SPEN : 1;
2131 struct
2133 unsigned : 1;
2134 unsigned : 1;
2135 unsigned : 1;
2136 unsigned ADEN : 1;
2137 unsigned : 1;
2138 unsigned : 1;
2139 unsigned : 1;
2140 unsigned : 1;
2142 } __RCSTAbits_t;
2144 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
2146 #define _RX9D 0x01
2147 #define _OERR 0x02
2148 #define _FERR 0x04
2149 #define _ADDEN 0x08
2150 #define _ADEN 0x08
2151 #define _CREN 0x10
2152 #define _SREN 0x20
2153 #define _RX9 0x40
2154 #define _SPEN 0x80
2156 //==============================================================================
2159 //==============================================================================
2160 // TXSTA Bits
2162 extern __at(0x0FAC) __sfr TXSTA;
2164 typedef struct
2166 unsigned TX9D : 1;
2167 unsigned TRMT : 1;
2168 unsigned BRGH : 1;
2169 unsigned SENDB : 1;
2170 unsigned SYNC : 1;
2171 unsigned TXEN : 1;
2172 unsigned TX9 : 1;
2173 unsigned CSRC : 1;
2174 } __TXSTAbits_t;
2176 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
2178 #define _TX9D 0x01
2179 #define _TRMT 0x02
2180 #define _BRGH 0x04
2181 #define _SENDB 0x08
2182 #define _SYNC 0x10
2183 #define _TXEN 0x20
2184 #define _TX9 0x40
2185 #define _CSRC 0x80
2187 //==============================================================================
2189 extern __at(0x0FAD) __sfr TXREG;
2190 extern __at(0x0FAE) __sfr RCREG;
2191 extern __at(0x0FAF) __sfr SPBRG;
2192 extern __at(0x0FB0) __sfr SPBRGH;
2194 //==============================================================================
2195 // BAUDCON Bits
2197 extern __at(0x0FB8) __sfr BAUDCON;
2199 typedef union
2201 struct
2203 unsigned ABDEN : 1;
2204 unsigned WUE : 1;
2205 unsigned : 1;
2206 unsigned BRG16 : 1;
2207 unsigned TXCKP : 1;
2208 unsigned RXDTP : 1;
2209 unsigned RCIDL : 1;
2210 unsigned ABDOVF : 1;
2213 struct
2215 unsigned : 1;
2216 unsigned : 1;
2217 unsigned : 1;
2218 unsigned : 1;
2219 unsigned SCKP : 1;
2220 unsigned : 1;
2221 unsigned RCMT : 1;
2222 unsigned : 1;
2224 } __BAUDCONbits_t;
2226 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
2228 #define _ABDEN 0x01
2229 #define _WUE 0x02
2230 #define _BRG16 0x08
2231 #define _TXCKP 0x10
2232 #define _SCKP 0x10
2233 #define _RXDTP 0x20
2234 #define _RCIDL 0x40
2235 #define _RCMT 0x40
2236 #define _ABDOVF 0x80
2238 //==============================================================================
2241 //==============================================================================
2242 // BAUDCTL Bits
2244 extern __at(0x0FB8) __sfr BAUDCTL;
2246 typedef union
2248 struct
2250 unsigned ABDEN : 1;
2251 unsigned WUE : 1;
2252 unsigned : 1;
2253 unsigned BRG16 : 1;
2254 unsigned TXCKP : 1;
2255 unsigned RXDTP : 1;
2256 unsigned RCIDL : 1;
2257 unsigned ABDOVF : 1;
2260 struct
2262 unsigned : 1;
2263 unsigned : 1;
2264 unsigned : 1;
2265 unsigned : 1;
2266 unsigned SCKP : 1;
2267 unsigned : 1;
2268 unsigned RCMT : 1;
2269 unsigned : 1;
2271 } __BAUDCTLbits_t;
2273 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
2275 #define _BAUDCTL_ABDEN 0x01
2276 #define _BAUDCTL_WUE 0x02
2277 #define _BAUDCTL_BRG16 0x08
2278 #define _BAUDCTL_TXCKP 0x10
2279 #define _BAUDCTL_SCKP 0x10
2280 #define _BAUDCTL_RXDTP 0x20
2281 #define _BAUDCTL_RCIDL 0x40
2282 #define _BAUDCTL_RCMT 0x40
2283 #define _BAUDCTL_ABDOVF 0x80
2285 //==============================================================================
2288 //==============================================================================
2289 // CCP1CON Bits
2291 extern __at(0x0FBD) __sfr CCP1CON;
2293 typedef union
2295 struct
2297 unsigned CCP1M0 : 1;
2298 unsigned CCP1M1 : 1;
2299 unsigned CCP1M2 : 1;
2300 unsigned CCP1M3 : 1;
2301 unsigned DC1B0 : 1;
2302 unsigned DC1B1 : 1;
2303 unsigned : 1;
2304 unsigned : 1;
2307 struct
2309 unsigned CCP1M : 4;
2310 unsigned : 4;
2313 struct
2315 unsigned : 4;
2316 unsigned DC1B : 2;
2317 unsigned : 2;
2319 } __CCP1CONbits_t;
2321 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
2323 #define _CCP1M0 0x01
2324 #define _CCP1M1 0x02
2325 #define _CCP1M2 0x04
2326 #define _CCP1M3 0x08
2327 #define _DC1B0 0x10
2328 #define _DC1B1 0x20
2330 //==============================================================================
2332 extern __at(0x0FBE) __sfr CCPR1;
2333 extern __at(0x0FBE) __sfr CCPR1L;
2334 extern __at(0x0FBF) __sfr CCPR1H;
2336 //==============================================================================
2337 // ADCON2 Bits
2339 extern __at(0x0FC0) __sfr ADCON2;
2341 typedef union
2343 struct
2345 unsigned ADCS0 : 1;
2346 unsigned ADCS1 : 1;
2347 unsigned ADCS2 : 1;
2348 unsigned ACQT0 : 1;
2349 unsigned ACQT1 : 1;
2350 unsigned ACQT2 : 1;
2351 unsigned : 1;
2352 unsigned ADFM : 1;
2355 struct
2357 unsigned ADCS : 3;
2358 unsigned : 5;
2361 struct
2363 unsigned : 3;
2364 unsigned ACQT : 3;
2365 unsigned : 2;
2367 } __ADCON2bits_t;
2369 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
2371 #define _ADCS0 0x01
2372 #define _ADCS1 0x02
2373 #define _ADCS2 0x04
2374 #define _ACQT0 0x08
2375 #define _ACQT1 0x10
2376 #define _ACQT2 0x20
2377 #define _ADFM 0x80
2379 //==============================================================================
2382 //==============================================================================
2383 // ADCON1 Bits
2385 extern __at(0x0FC1) __sfr ADCON1;
2387 typedef union
2389 struct
2391 unsigned PCFG0 : 1;
2392 unsigned PCFG1 : 1;
2393 unsigned PCFG2 : 1;
2394 unsigned PCFG3 : 1;
2395 unsigned VCFG0 : 1;
2396 unsigned VCFG1 : 1;
2397 unsigned : 1;
2398 unsigned : 1;
2401 struct
2403 unsigned PCFG : 4;
2404 unsigned : 4;
2407 struct
2409 unsigned : 4;
2410 unsigned VCFG : 2;
2411 unsigned : 2;
2413 } __ADCON1bits_t;
2415 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
2417 #define _PCFG0 0x01
2418 #define _PCFG1 0x02
2419 #define _PCFG2 0x04
2420 #define _PCFG3 0x08
2421 #define _VCFG0 0x10
2422 #define _VCFG1 0x20
2424 //==============================================================================
2427 //==============================================================================
2428 // ADCON0 Bits
2430 extern __at(0x0FC2) __sfr ADCON0;
2432 typedef union
2434 struct
2436 unsigned ADON : 1;
2437 unsigned GO_NOT_DONE : 1;
2438 unsigned CHS0 : 1;
2439 unsigned CHS1 : 1;
2440 unsigned CHS2 : 1;
2441 unsigned CHS3 : 1;
2442 unsigned : 1;
2443 unsigned : 1;
2446 struct
2448 unsigned : 1;
2449 unsigned GO_DONE : 1;
2450 unsigned : 1;
2451 unsigned : 1;
2452 unsigned : 1;
2453 unsigned : 1;
2454 unsigned : 1;
2455 unsigned : 1;
2458 struct
2460 unsigned : 1;
2461 unsigned DONE : 1;
2462 unsigned : 1;
2463 unsigned : 1;
2464 unsigned : 1;
2465 unsigned : 1;
2466 unsigned : 1;
2467 unsigned : 1;
2470 struct
2472 unsigned : 1;
2473 unsigned GO : 1;
2474 unsigned : 1;
2475 unsigned : 1;
2476 unsigned : 1;
2477 unsigned : 1;
2478 unsigned : 1;
2479 unsigned : 1;
2482 struct
2484 unsigned : 1;
2485 unsigned NOT_DONE : 1;
2486 unsigned : 1;
2487 unsigned : 1;
2488 unsigned : 1;
2489 unsigned : 1;
2490 unsigned : 1;
2491 unsigned : 1;
2494 struct
2496 unsigned : 2;
2497 unsigned CHS : 4;
2498 unsigned : 2;
2500 } __ADCON0bits_t;
2502 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
2504 #define _ADON 0x01
2505 #define _GO_NOT_DONE 0x02
2506 #define _GO_DONE 0x02
2507 #define _DONE 0x02
2508 #define _GO 0x02
2509 #define _NOT_DONE 0x02
2510 #define _CHS0 0x04
2511 #define _CHS1 0x08
2512 #define _CHS2 0x10
2513 #define _CHS3 0x20
2515 //==============================================================================
2517 extern __at(0x0FC3) __sfr ADRES;
2518 extern __at(0x0FC3) __sfr ADRESL;
2519 extern __at(0x0FC4) __sfr ADRESH;
2521 //==============================================================================
2522 // T2CON Bits
2524 extern __at(0x0FCA) __sfr T2CON;
2526 typedef union
2528 struct
2530 unsigned T2CKPS0 : 1;
2531 unsigned T2CKPS1 : 1;
2532 unsigned TMR2ON : 1;
2533 unsigned T2OUTPS0 : 1;
2534 unsigned T2OUTPS1 : 1;
2535 unsigned T2OUTPS2 : 1;
2536 unsigned T2OUTPS3 : 1;
2537 unsigned : 1;
2540 struct
2542 unsigned T2CKPS : 2;
2543 unsigned : 6;
2546 struct
2548 unsigned : 3;
2549 unsigned T2OUTPS : 4;
2550 unsigned : 1;
2552 } __T2CONbits_t;
2554 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
2556 #define _T2CKPS0 0x01
2557 #define _T2CKPS1 0x02
2558 #define _TMR2ON 0x04
2559 #define _T2OUTPS0 0x08
2560 #define _T2OUTPS1 0x10
2561 #define _T2OUTPS2 0x20
2562 #define _T2OUTPS3 0x40
2564 //==============================================================================
2566 extern __at(0x0FCB) __sfr PR2;
2567 extern __at(0x0FCC) __sfr TMR2;
2569 //==============================================================================
2570 // T1CON Bits
2572 extern __at(0x0FCD) __sfr T1CON;
2574 typedef union
2576 struct
2578 unsigned TMR1ON : 1;
2579 unsigned TMR1CS : 1;
2580 unsigned NOT_T1SYNC : 1;
2581 unsigned T1OSCEN : 1;
2582 unsigned T1CKPS0 : 1;
2583 unsigned T1CKPS1 : 1;
2584 unsigned T1RUN : 1;
2585 unsigned RD16 : 1;
2588 struct
2590 unsigned : 1;
2591 unsigned : 1;
2592 unsigned T1SYNC : 1;
2593 unsigned : 1;
2594 unsigned : 1;
2595 unsigned : 1;
2596 unsigned : 1;
2597 unsigned : 1;
2600 struct
2602 unsigned : 4;
2603 unsigned T1CKPS : 2;
2604 unsigned : 2;
2606 } __T1CONbits_t;
2608 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
2610 #define _TMR1ON 0x01
2611 #define _TMR1CS 0x02
2612 #define _NOT_T1SYNC 0x04
2613 #define _T1SYNC 0x04
2614 #define _T1OSCEN 0x08
2615 #define _T1CKPS0 0x10
2616 #define _T1CKPS1 0x20
2617 #define _T1RUN 0x40
2618 #define _RD16 0x80
2620 //==============================================================================
2622 extern __at(0x0FCE) __sfr TMR1;
2623 extern __at(0x0FCE) __sfr TMR1L;
2624 extern __at(0x0FCF) __sfr TMR1H;
2626 //==============================================================================
2627 // RCON Bits
2629 extern __at(0x0FD0) __sfr RCON;
2631 typedef union
2633 struct
2635 unsigned NOT_BOR : 1;
2636 unsigned NOT_POR : 1;
2637 unsigned NOT_PD : 1;
2638 unsigned NOT_TO : 1;
2639 unsigned NOT_RI : 1;
2640 unsigned : 1;
2641 unsigned SBOREN : 1;
2642 unsigned IPEN : 1;
2645 struct
2647 unsigned BOR : 1;
2648 unsigned POR : 1;
2649 unsigned PD : 1;
2650 unsigned TO : 1;
2651 unsigned RI : 1;
2652 unsigned : 1;
2653 unsigned : 1;
2654 unsigned NOT_IPEN : 1;
2656 } __RCONbits_t;
2658 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
2660 #define _NOT_BOR 0x01
2661 #define _BOR 0x01
2662 #define _NOT_POR 0x02
2663 #define _POR 0x02
2664 #define _NOT_PD 0x04
2665 #define _PD 0x04
2666 #define _NOT_TO 0x08
2667 #define _TO 0x08
2668 #define _NOT_RI 0x10
2669 #define _RI 0x10
2670 #define _SBOREN 0x40
2671 #define _IPEN 0x80
2672 #define _NOT_IPEN 0x80
2674 //==============================================================================
2677 //==============================================================================
2678 // WDTCON Bits
2680 extern __at(0x0FD1) __sfr WDTCON;
2682 typedef union
2684 struct
2686 unsigned SWDTEN : 1;
2687 unsigned : 1;
2688 unsigned : 1;
2689 unsigned : 1;
2690 unsigned : 1;
2691 unsigned : 1;
2692 unsigned : 1;
2693 unsigned : 1;
2696 struct
2698 unsigned SWDTE : 1;
2699 unsigned : 1;
2700 unsigned : 1;
2701 unsigned : 1;
2702 unsigned : 1;
2703 unsigned : 1;
2704 unsigned : 1;
2705 unsigned : 1;
2707 } __WDTCONbits_t;
2709 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
2711 #define _SWDTEN 0x01
2712 #define _SWDTE 0x01
2714 //==============================================================================
2717 //==============================================================================
2718 // HLVDCON Bits
2720 extern __at(0x0FD2) __sfr HLVDCON;
2722 typedef union
2724 struct
2726 unsigned HLVDL0 : 1;
2727 unsigned HLVDL1 : 1;
2728 unsigned HLVDL2 : 1;
2729 unsigned HLVDL3 : 1;
2730 unsigned HLVDEN : 1;
2731 unsigned IRVST : 1;
2732 unsigned : 1;
2733 unsigned VDIRMAG : 1;
2736 struct
2738 unsigned LVDL0 : 1;
2739 unsigned LVDL1 : 1;
2740 unsigned LVDL2 : 1;
2741 unsigned LVDL3 : 1;
2742 unsigned LVDEN : 1;
2743 unsigned IVRST : 1;
2744 unsigned : 1;
2745 unsigned : 1;
2748 struct
2750 unsigned LVV0 : 1;
2751 unsigned LVV1 : 1;
2752 unsigned LVV2 : 1;
2753 unsigned LVV3 : 1;
2754 unsigned : 1;
2755 unsigned BGST : 1;
2756 unsigned : 1;
2757 unsigned : 1;
2760 struct
2762 unsigned HLVDL : 4;
2763 unsigned : 4;
2766 struct
2768 unsigned LVV : 4;
2769 unsigned : 4;
2772 struct
2774 unsigned LVDL : 4;
2775 unsigned : 4;
2777 } __HLVDCONbits_t;
2779 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
2781 #define _HLVDL0 0x01
2782 #define _LVDL0 0x01
2783 #define _LVV0 0x01
2784 #define _HLVDL1 0x02
2785 #define _LVDL1 0x02
2786 #define _LVV1 0x02
2787 #define _HLVDL2 0x04
2788 #define _LVDL2 0x04
2789 #define _LVV2 0x04
2790 #define _HLVDL3 0x08
2791 #define _LVDL3 0x08
2792 #define _LVV3 0x08
2793 #define _HLVDEN 0x10
2794 #define _LVDEN 0x10
2795 #define _IRVST 0x20
2796 #define _IVRST 0x20
2797 #define _BGST 0x20
2798 #define _VDIRMAG 0x80
2800 //==============================================================================
2803 //==============================================================================
2804 // LVDCON Bits
2806 extern __at(0x0FD2) __sfr LVDCON;
2808 typedef union
2810 struct
2812 unsigned HLVDL0 : 1;
2813 unsigned HLVDL1 : 1;
2814 unsigned HLVDL2 : 1;
2815 unsigned HLVDL3 : 1;
2816 unsigned HLVDEN : 1;
2817 unsigned IRVST : 1;
2818 unsigned : 1;
2819 unsigned VDIRMAG : 1;
2822 struct
2824 unsigned LVDL0 : 1;
2825 unsigned LVDL1 : 1;
2826 unsigned LVDL2 : 1;
2827 unsigned LVDL3 : 1;
2828 unsigned LVDEN : 1;
2829 unsigned IVRST : 1;
2830 unsigned : 1;
2831 unsigned : 1;
2834 struct
2836 unsigned LVV0 : 1;
2837 unsigned LVV1 : 1;
2838 unsigned LVV2 : 1;
2839 unsigned LVV3 : 1;
2840 unsigned : 1;
2841 unsigned BGST : 1;
2842 unsigned : 1;
2843 unsigned : 1;
2846 struct
2848 unsigned LVDL : 4;
2849 unsigned : 4;
2852 struct
2854 unsigned LVV : 4;
2855 unsigned : 4;
2858 struct
2860 unsigned HLVDL : 4;
2861 unsigned : 4;
2863 } __LVDCONbits_t;
2865 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
2867 #define _LVDCON_HLVDL0 0x01
2868 #define _LVDCON_LVDL0 0x01
2869 #define _LVDCON_LVV0 0x01
2870 #define _LVDCON_HLVDL1 0x02
2871 #define _LVDCON_LVDL1 0x02
2872 #define _LVDCON_LVV1 0x02
2873 #define _LVDCON_HLVDL2 0x04
2874 #define _LVDCON_LVDL2 0x04
2875 #define _LVDCON_LVV2 0x04
2876 #define _LVDCON_HLVDL3 0x08
2877 #define _LVDCON_LVDL3 0x08
2878 #define _LVDCON_LVV3 0x08
2879 #define _LVDCON_HLVDEN 0x10
2880 #define _LVDCON_LVDEN 0x10
2881 #define _LVDCON_IRVST 0x20
2882 #define _LVDCON_IVRST 0x20
2883 #define _LVDCON_BGST 0x20
2884 #define _LVDCON_VDIRMAG 0x80
2886 //==============================================================================
2889 //==============================================================================
2890 // OSCCON Bits
2892 extern __at(0x0FD3) __sfr OSCCON;
2894 typedef union
2896 struct
2898 unsigned SCS0 : 1;
2899 unsigned SCS1 : 1;
2900 unsigned : 1;
2901 unsigned OSTS : 1;
2902 unsigned : 1;
2903 unsigned : 1;
2904 unsigned : 1;
2905 unsigned IDLEN : 1;
2908 struct
2910 unsigned SCS : 2;
2911 unsigned : 6;
2913 } __OSCCONbits_t;
2915 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
2917 #define _SCS0 0x01
2918 #define _SCS1 0x02
2919 #define _OSTS 0x08
2920 #define _IDLEN 0x80
2922 //==============================================================================
2925 //==============================================================================
2926 // T0CON Bits
2928 extern __at(0x0FD5) __sfr T0CON;
2930 typedef union
2932 struct
2934 unsigned T0PS0 : 1;
2935 unsigned T0PS1 : 1;
2936 unsigned T0PS2 : 1;
2937 unsigned PSA : 1;
2938 unsigned T0SE : 1;
2939 unsigned T0CS : 1;
2940 unsigned T08BIT : 1;
2941 unsigned TMR0ON : 1;
2944 struct
2946 unsigned T0PS : 3;
2947 unsigned : 5;
2949 } __T0CONbits_t;
2951 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
2953 #define _T0PS0 0x01
2954 #define _T0PS1 0x02
2955 #define _T0PS2 0x04
2956 #define _PSA 0x08
2957 #define _T0SE 0x10
2958 #define _T0CS 0x20
2959 #define _T08BIT 0x40
2960 #define _TMR0ON 0x80
2962 //==============================================================================
2964 extern __at(0x0FD6) __sfr TMR0;
2965 extern __at(0x0FD6) __sfr TMR0L;
2966 extern __at(0x0FD7) __sfr TMR0H;
2968 //==============================================================================
2969 // STATUS Bits
2971 extern __at(0x0FD8) __sfr STATUS;
2973 typedef struct
2975 unsigned C : 1;
2976 unsigned DC : 1;
2977 unsigned Z : 1;
2978 unsigned OV : 1;
2979 unsigned N : 1;
2980 unsigned : 1;
2981 unsigned : 1;
2982 unsigned : 1;
2983 } __STATUSbits_t;
2985 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
2987 #define _C 0x01
2988 #define _DC 0x02
2989 #define _Z 0x04
2990 #define _OV 0x08
2991 #define _N 0x10
2993 //==============================================================================
2995 extern __at(0x0FD9) __sfr FSR2L;
2996 extern __at(0x0FDA) __sfr FSR2H;
2997 extern __at(0x0FDB) __sfr PLUSW2;
2998 extern __at(0x0FDC) __sfr PREINC2;
2999 extern __at(0x0FDD) __sfr POSTDEC2;
3000 extern __at(0x0FDE) __sfr POSTINC2;
3001 extern __at(0x0FDF) __sfr INDF2;
3002 extern __at(0x0FE0) __sfr BSR;
3003 extern __at(0x0FE1) __sfr FSR1L;
3004 extern __at(0x0FE2) __sfr FSR1H;
3005 extern __at(0x0FE3) __sfr PLUSW1;
3006 extern __at(0x0FE4) __sfr PREINC1;
3007 extern __at(0x0FE5) __sfr POSTDEC1;
3008 extern __at(0x0FE6) __sfr POSTINC1;
3009 extern __at(0x0FE7) __sfr INDF1;
3010 extern __at(0x0FE8) __sfr WREG;
3011 extern __at(0x0FE9) __sfr FSR0L;
3012 extern __at(0x0FEA) __sfr FSR0H;
3013 extern __at(0x0FEB) __sfr PLUSW0;
3014 extern __at(0x0FEC) __sfr PREINC0;
3015 extern __at(0x0FED) __sfr POSTDEC0;
3016 extern __at(0x0FEE) __sfr POSTINC0;
3017 extern __at(0x0FEF) __sfr INDF0;
3019 //==============================================================================
3020 // INTCON3 Bits
3022 extern __at(0x0FF0) __sfr INTCON3;
3024 typedef union
3026 struct
3028 unsigned INT1IF : 1;
3029 unsigned INT2IF : 1;
3030 unsigned : 1;
3031 unsigned INT1IE : 1;
3032 unsigned INT2IE : 1;
3033 unsigned : 1;
3034 unsigned INT1IP : 1;
3035 unsigned INT2IP : 1;
3038 struct
3040 unsigned INT1F : 1;
3041 unsigned INT2F : 1;
3042 unsigned : 1;
3043 unsigned INT1E : 1;
3044 unsigned INT2E : 1;
3045 unsigned : 1;
3046 unsigned INT1P : 1;
3047 unsigned INT2P : 1;
3049 } __INTCON3bits_t;
3051 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3053 #define _INT1IF 0x01
3054 #define _INT1F 0x01
3055 #define _INT2IF 0x02
3056 #define _INT2F 0x02
3057 #define _INT1IE 0x08
3058 #define _INT1E 0x08
3059 #define _INT2IE 0x10
3060 #define _INT2E 0x10
3061 #define _INT1IP 0x40
3062 #define _INT1P 0x40
3063 #define _INT2IP 0x80
3064 #define _INT2P 0x80
3066 //==============================================================================
3069 //==============================================================================
3070 // INTCON2 Bits
3072 extern __at(0x0FF1) __sfr INTCON2;
3074 typedef union
3076 struct
3078 unsigned RBIP : 1;
3079 unsigned : 1;
3080 unsigned TMR0IP : 1;
3081 unsigned : 1;
3082 unsigned INTEDG2 : 1;
3083 unsigned INTEDG1 : 1;
3084 unsigned INTEDG0 : 1;
3085 unsigned NOT_RBPU : 1;
3088 struct
3090 unsigned : 1;
3091 unsigned : 1;
3092 unsigned T0IP : 1;
3093 unsigned : 1;
3094 unsigned : 1;
3095 unsigned : 1;
3096 unsigned : 1;
3097 unsigned RBPU : 1;
3099 } __INTCON2bits_t;
3101 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3103 #define _RBIP 0x01
3104 #define _TMR0IP 0x04
3105 #define _T0IP 0x04
3106 #define _INTEDG2 0x10
3107 #define _INTEDG1 0x20
3108 #define _INTEDG0 0x40
3109 #define _NOT_RBPU 0x80
3110 #define _RBPU 0x80
3112 //==============================================================================
3115 //==============================================================================
3116 // INTCON Bits
3118 extern __at(0x0FF2) __sfr INTCON;
3120 typedef union
3122 struct
3124 unsigned RBIF : 1;
3125 unsigned INT0IF : 1;
3126 unsigned TMR0IF : 1;
3127 unsigned RBIE : 1;
3128 unsigned INT0IE : 1;
3129 unsigned TMR0IE : 1;
3130 unsigned PEIE_GIEL : 1;
3131 unsigned GIE_GIEH : 1;
3134 struct
3136 unsigned : 1;
3137 unsigned INT0F : 1;
3138 unsigned T0IF : 1;
3139 unsigned : 1;
3140 unsigned INT0E : 1;
3141 unsigned T0IE : 1;
3142 unsigned PEIE : 1;
3143 unsigned GIE : 1;
3146 struct
3148 unsigned : 1;
3149 unsigned : 1;
3150 unsigned : 1;
3151 unsigned : 1;
3152 unsigned : 1;
3153 unsigned : 1;
3154 unsigned GIEL : 1;
3155 unsigned GIEH : 1;
3157 } __INTCONbits_t;
3159 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3161 #define _RBIF 0x01
3162 #define _INT0IF 0x02
3163 #define _INT0F 0x02
3164 #define _TMR0IF 0x04
3165 #define _T0IF 0x04
3166 #define _RBIE 0x08
3167 #define _INT0IE 0x10
3168 #define _INT0E 0x10
3169 #define _TMR0IE 0x20
3170 #define _T0IE 0x20
3171 #define _PEIE_GIEL 0x40
3172 #define _PEIE 0x40
3173 #define _GIEL 0x40
3174 #define _GIE_GIEH 0x80
3175 #define _GIE 0x80
3176 #define _GIEH 0x80
3178 //==============================================================================
3180 extern __at(0x0FF3) __sfr PROD;
3181 extern __at(0x0FF3) __sfr PRODL;
3182 extern __at(0x0FF4) __sfr PRODH;
3183 extern __at(0x0FF5) __sfr TABLAT;
3184 extern __at(0x0FF6) __sfr TBLPTR;
3185 extern __at(0x0FF6) __sfr TBLPTRL;
3186 extern __at(0x0FF7) __sfr TBLPTRH;
3187 extern __at(0x0FF8) __sfr TBLPTRU;
3188 extern __at(0x0FF9) __sfr PC;
3189 extern __at(0x0FF9) __sfr PCL;
3190 extern __at(0x0FFA) __sfr PCLATH;
3191 extern __at(0x0FFB) __sfr PCLATU;
3193 //==============================================================================
3194 // STKPTR Bits
3196 extern __at(0x0FFC) __sfr STKPTR;
3198 typedef union
3200 struct
3202 unsigned STKPTR0 : 1;
3203 unsigned STKPTR1 : 1;
3204 unsigned STKPTR2 : 1;
3205 unsigned STKPTR3 : 1;
3206 unsigned STKPTR4 : 1;
3207 unsigned : 1;
3208 unsigned STKUNF : 1;
3209 unsigned STKFUL : 1;
3212 struct
3214 unsigned : 1;
3215 unsigned : 1;
3216 unsigned : 1;
3217 unsigned : 1;
3218 unsigned : 1;
3219 unsigned : 1;
3220 unsigned : 1;
3221 unsigned STKOVF : 1;
3224 struct
3226 unsigned STKPTR : 5;
3227 unsigned : 3;
3229 } __STKPTRbits_t;
3231 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
3233 #define _STKPTR0 0x01
3234 #define _STKPTR1 0x02
3235 #define _STKPTR2 0x04
3236 #define _STKPTR3 0x08
3237 #define _STKPTR4 0x10
3238 #define _STKUNF 0x40
3239 #define _STKFUL 0x80
3240 #define _STKOVF 0x80
3242 //==============================================================================
3244 extern __at(0x0FFD) __sfr TOS;
3245 extern __at(0x0FFD) __sfr TOSL;
3246 extern __at(0x0FFE) __sfr TOSH;
3247 extern __at(0x0FFF) __sfr TOSU;
3249 //==============================================================================
3251 // Configuration Bits
3253 //==============================================================================
3255 #define __CONFIG1L 0x300000
3256 #define __CONFIG1H 0x300001
3257 #define __CONFIG2L 0x300002
3258 #define __CONFIG2H 0x300003
3259 #define __CONFIG3H 0x300005
3260 #define __CONFIG4L 0x300006
3261 #define __CONFIG5L 0x300008
3262 #define __CONFIG5H 0x300009
3263 #define __CONFIG6L 0x30000A
3264 #define __CONFIG6H 0x30000B
3265 #define __CONFIG7L 0x30000C
3266 #define __CONFIG7H 0x30000D
3268 //----------------------------- CONFIG1L Options -------------------------------
3270 #define _PLLDIV_1_1L 0xF8 // No prescale (4 MHz oscillator input drives PLL directly).
3271 #define _PLLDIV_2_1L 0xF9 // Divide by 2 (8 MHz oscillator input).
3272 #define _PLLDIV_3_1L 0xFA // Divide by 3 (12 MHz oscillator input).
3273 #define _PLLDIV_4_1L 0xFB // Divide by 4 (16 MHz oscillator input).
3274 #define _PLLDIV_5_1L 0xFC // Divide by 5 (20 MHz oscillator input).
3275 #define _PLLDIV_6_1L 0xFD // Divide by 6 (24 MHz oscillator input).
3276 #define _PLLDIV_10_1L 0xFE // Divide by 10 (40 MHz oscillator input).
3277 #define _PLLDIV_12_1L 0xFF // Divide by 12 (48 MHz oscillator input).
3278 #define _CPUDIV_OSC1_PLL2_1L 0xE7 // [Primary Oscillator Src: /1][96 MHz PLL Src: /2].
3279 #define _CPUDIV_OSC2_PLL3_1L 0xEF // [Primary Oscillator Src: /2][96 MHz PLL Src: /3].
3280 #define _CPUDIV_OSC3_PLL4_1L 0xF7 // [Primary Oscillator Src: /3][96 MHz PLL Src: /4].
3281 #define _CPUDIV_OSC4_PLL6_1L 0xFF // [Primary Oscillator Src: /4][96 MHz PLL Src: /6].
3282 #define _USBDIV_1_1L 0xDF // USB clock source comes directly from the primary oscillator block with no postscale.
3283 #define _USBDIV_2_1L 0xFF // USB clock source comes from the 96 MHz PLL divided by 2.
3285 //----------------------------- CONFIG1H Options -------------------------------
3287 #define _FOSC_XT_XT_1H 0xF0 // XT oscillator (XT).
3288 #define _FOSC_XTPLL_XT_1H 0xF2 // XT oscillator, PLL enabled (XTPLL).
3289 #define _FOSC_ECIO_EC_1H 0xF4 // EC oscillator, port function on RA6 (ECIO).
3290 #define _FOSC_EC_EC_1H 0xF5 // EC oscillator, CLKO function on RA6 (EC).
3291 #define _FOSC_ECPLLIO_EC_1H 0xF6 // EC oscillator, PLL enabled, port function on RA6 (ECPIO).
3292 #define _FOSC_ECPLL_EC_1H 0xF7 // EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL).
3293 #define _FOSC_INTOSCIO_EC_1H 0xF8 // Internal oscillator, port function on RA6, EC used by USB (INTIO).
3294 #define _FOSC_INTOSC_EC_1H 0xF9 // Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO).
3295 #define _FOSC_INTOSC_XT_1H 0xFA // Internal oscillator, XT used by USB (INTXT).
3296 #define _FOSC_INTOSC_HS_1H 0xFB // Internal oscillator, HS oscillator used by USB (INTHS).
3297 #define _FOSC_HS_1H 0xFC // HS oscillator (HS).
3298 #define _FOSC_HSPLL_HS_1H 0xFE // HS oscillator, PLL enabled (HSPLL).
3299 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
3300 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
3301 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
3302 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
3304 //----------------------------- CONFIG2L Options -------------------------------
3306 #define _PWRT_ON_2L 0xFE // PWRT enabled.
3307 #define _PWRT_OFF_2L 0xFF // PWRT disabled.
3308 #define _BOR_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
3309 #define _BOR_SOFT_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
3310 #define _BOR_ON_ACTIVE_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
3311 #define _BOR_ON_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
3312 #define _BORV_46_2L 0xE7 // 4.6V.
3313 #define _BORV_43_2L 0xEF // 4.3V.
3314 #define _BORV_28_2L 0xF7 // 2.8V.
3315 #define _BORV_21_2L 0xFF // 2.1V.
3316 #define _VREGEN_OFF_2L 0xDF // USB voltage regulator disabled.
3317 #define _VREGEN_ON_2L 0xFF // USB voltage regulator enabled.
3319 //----------------------------- CONFIG2H Options -------------------------------
3321 #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
3322 #define _WDT_ON_2H 0xFF // WDT enabled.
3323 #define _WDTPS_1_2H 0xE1 // 1:1.
3324 #define _WDTPS_2_2H 0xE3 // 1:2.
3325 #define _WDTPS_4_2H 0xE5 // 1:4.
3326 #define _WDTPS_8_2H 0xE7 // 1:8.
3327 #define _WDTPS_16_2H 0xE9 // 1:16.
3328 #define _WDTPS_32_2H 0xEB // 1:32.
3329 #define _WDTPS_64_2H 0xED // 1:64.
3330 #define _WDTPS_128_2H 0xEF // 1:128.
3331 #define _WDTPS_256_2H 0xF1 // 1:256.
3332 #define _WDTPS_512_2H 0xF3 // 1:512.
3333 #define _WDTPS_1024_2H 0xF5 // 1:1024.
3334 #define _WDTPS_2048_2H 0xF7 // 1:2048.
3335 #define _WDTPS_4096_2H 0xF9 // 1:4096.
3336 #define _WDTPS_8192_2H 0xFB // 1:8192.
3337 #define _WDTPS_16384_2H 0xFD // 1:16384.
3338 #define _WDTPS_32768_2H 0xFF // 1:32768.
3340 //----------------------------- CONFIG3H Options -------------------------------
3342 #define _PBADEN_OFF_3H 0xFD // PORTB<4:0> pins are configured as digital I/O on Reset.
3343 #define _PBADEN_ON_3H 0xFF // PORTB<4:0> pins are configured as analog input channels on Reset.
3344 #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
3345 #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
3346 #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; MCLR pin disabled.
3347 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input pin disabled.
3349 //----------------------------- CONFIG4L Options -------------------------------
3351 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
3352 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
3353 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
3354 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled.
3355 #define _BBSIZ_BB1K_4L 0xF7 // 1KW Boot block size.
3356 #define _BBSIZ_BB2K_4L 0xFF // 2KW Boot block size.
3357 #define _ICPRT_OFF_4L 0xDF // ICPORT disabled.
3358 #define _ICPRT_ON_4L 0xFF // ICPORT enabled.
3359 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
3360 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
3361 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
3362 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
3364 //----------------------------- CONFIG5L Options -------------------------------
3366 #define _CP0_ON_5L 0xFE // Block 0 (000800-001FFFh) or (001000-001FFFh) is code-protected.
3367 #define _CP0_OFF_5L 0xFF // Block 0 (000800-001FFFh) or (001000-001FFFh) is not code-protected.
3368 #define _CP1_ON_5L 0xFD // Block 1 (002000-003FFFh) is code-protected.
3369 #define _CP1_OFF_5L 0xFF // Block 1 (002000-003FFFh) is not code-protected.
3371 //----------------------------- CONFIG5H Options -------------------------------
3373 #define _CPB_ON_5H 0xBF // Boot block (000000-0007FFh) or (000000-000FFFh) is code-protected.
3374 #define _CPB_OFF_5H 0xFF // Boot block (000000-0007FFh) or (000000-000FFFh) is not code-protected.
3376 //----------------------------- CONFIG6L Options -------------------------------
3378 #define _WRT0_ON_6L 0xFE // Block 0 (000800-001FFFh) or (001000-001FFFh) is write-protected.
3379 #define _WRT0_OFF_6L 0xFF // Block 0 (000800-001FFFh) or (001000-001FFFh) is not write-protected.
3380 #define _WRT1_ON_6L 0xFD // Block 1 (002000-003FFFh) is write-protected.
3381 #define _WRT1_OFF_6L 0xFF // Block 1 (002000-003FFFh) is not write-protected.
3383 //----------------------------- CONFIG6H Options -------------------------------
3385 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) are write-protected.
3386 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) are not write-protected.
3387 #define _WRTB_ON_6H 0xBF // Boot block (000000-0007FFh) or (000000-000FFFh) is write-protected.
3388 #define _WRTB_OFF_6H 0xFF // Boot block (000000-0007FFh) or (000000-000FFFh) is not write-protected.
3390 //----------------------------- CONFIG7L Options -------------------------------
3392 #define _EBTR0_ON_7L 0xFE // Block 0 (000800-001FFFh) or (001000-001FFFh) is protected from table reads executed in other blocks.
3393 #define _EBTR0_OFF_7L 0xFF // Block 0 (000800-001FFFh) or (001000-001FFFh) is not protected from table reads executed in other blocks.
3394 #define _EBTR1_ON_7L 0xFD // Block 1 (002000-003FFFh) is protected from table reads executed in other blocks.
3395 #define _EBTR1_OFF_7L 0xFF // Block 1 (002000-003FFFh) is not protected from table reads executed in other blocks.
3397 //----------------------------- CONFIG7H Options -------------------------------
3399 #define _EBTRB_ON_7H 0xBF // Boot block (000000-0007FFh) or (000000-000FFFh) is protected from table reads executed in other blocks.
3400 #define _EBTRB_OFF_7H 0xFF // Boot block (000000-0007FFh) or (000000-000FFFh) is not protected from table reads executed in other blocks.
3402 //==============================================================================
3404 #define __DEVID1 0x3FFFFE
3405 #define __DEVID2 0x3FFFFF
3407 #define __IDLOC0 0x200000
3408 #define __IDLOC1 0x200001
3409 #define __IDLOC2 0x200002
3410 #define __IDLOC3 0x200003
3411 #define __IDLOC4 0x200004
3412 #define __IDLOC5 0x200005
3413 #define __IDLOC6 0x200006
3414 #define __IDLOC7 0x200007
3416 #endif // #ifndef __PIC18F4450_H__