Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f6520.h
blobdf71d3f8fa2ca7928b1e838965ae40d919f5368d
1 /*
2 * This declarations of the PIC18F6520 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:49 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 __PIC18F6520_H__
26 #define __PIC18F6520_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // RCSTA2 Bits
40 extern __at(0x0F6B) __sfr RCSTA2;
42 typedef union
44 struct
46 unsigned RX9D : 1;
47 unsigned OERR : 1;
48 unsigned FERR : 1;
49 unsigned ADDEN : 1;
50 unsigned CREN : 1;
51 unsigned SREN : 1;
52 unsigned RX9 : 1;
53 unsigned SPEN : 1;
56 struct
58 unsigned RCD8 : 1;
59 unsigned OERR2 : 1;
60 unsigned FERR2 : 1;
61 unsigned ADEN : 1;
62 unsigned CREN2 : 1;
63 unsigned SREN2 : 1;
64 unsigned RC9 : 1;
65 unsigned SPEN2 : 1;
68 struct
70 unsigned RX9D2 : 1;
71 unsigned : 1;
72 unsigned : 1;
73 unsigned ADDEN2 : 1;
74 unsigned : 1;
75 unsigned : 1;
76 unsigned NOT_RC8 : 1;
77 unsigned : 1;
80 struct
82 unsigned : 1;
83 unsigned : 1;
84 unsigned : 1;
85 unsigned : 1;
86 unsigned : 1;
87 unsigned : 1;
88 unsigned RC8_9 : 1;
89 unsigned : 1;
92 struct
94 unsigned : 1;
95 unsigned : 1;
96 unsigned : 1;
97 unsigned : 1;
98 unsigned : 1;
99 unsigned : 1;
100 unsigned RX92 : 1;
101 unsigned : 1;
103 } __RCSTA2bits_t;
105 extern __at(0x0F6B) volatile __RCSTA2bits_t RCSTA2bits;
107 #define _RCSTA2_RX9D 0x01
108 #define _RCSTA2_RCD8 0x01
109 #define _RCSTA2_RX9D2 0x01
110 #define _RCSTA2_OERR 0x02
111 #define _RCSTA2_OERR2 0x02
112 #define _RCSTA2_FERR 0x04
113 #define _RCSTA2_FERR2 0x04
114 #define _RCSTA2_ADDEN 0x08
115 #define _RCSTA2_ADEN 0x08
116 #define _RCSTA2_ADDEN2 0x08
117 #define _RCSTA2_CREN 0x10
118 #define _RCSTA2_CREN2 0x10
119 #define _RCSTA2_SREN 0x20
120 #define _RCSTA2_SREN2 0x20
121 #define _RCSTA2_RX9 0x40
122 #define _RCSTA2_RC9 0x40
123 #define _RCSTA2_NOT_RC8 0x40
124 #define _RCSTA2_RC8_9 0x40
125 #define _RCSTA2_RX92 0x40
126 #define _RCSTA2_SPEN 0x80
127 #define _RCSTA2_SPEN2 0x80
129 //==============================================================================
132 //==============================================================================
133 // TXSTA2 Bits
135 extern __at(0x0F6C) __sfr TXSTA2;
137 typedef union
139 struct
141 unsigned TX9D : 1;
142 unsigned TRMT : 1;
143 unsigned BRGH : 1;
144 unsigned SENDB2 : 1;
145 unsigned SYNC : 1;
146 unsigned TXEN : 1;
147 unsigned TX9 : 1;
148 unsigned CSRC : 1;
151 struct
153 unsigned TXD8 : 1;
154 unsigned TRMT2 : 1;
155 unsigned BRGH2 : 1;
156 unsigned : 1;
157 unsigned SYNC2 : 1;
158 unsigned TXEN2 : 1;
159 unsigned TX8_9 : 1;
160 unsigned CSRC2 : 1;
163 struct
165 unsigned TX9D2 : 1;
166 unsigned : 1;
167 unsigned : 1;
168 unsigned : 1;
169 unsigned : 1;
170 unsigned : 1;
171 unsigned NOT_TX8 : 1;
172 unsigned : 1;
175 struct
177 unsigned : 1;
178 unsigned : 1;
179 unsigned : 1;
180 unsigned : 1;
181 unsigned : 1;
182 unsigned : 1;
183 unsigned TX92 : 1;
184 unsigned : 1;
186 } __TXSTA2bits_t;
188 extern __at(0x0F6C) volatile __TXSTA2bits_t TXSTA2bits;
190 #define _TXSTA2_TX9D 0x01
191 #define _TXSTA2_TXD8 0x01
192 #define _TXSTA2_TX9D2 0x01
193 #define _TXSTA2_TRMT 0x02
194 #define _TXSTA2_TRMT2 0x02
195 #define _TXSTA2_BRGH 0x04
196 #define _TXSTA2_BRGH2 0x04
197 #define _TXSTA2_SENDB2 0x08
198 #define _TXSTA2_SYNC 0x10
199 #define _TXSTA2_SYNC2 0x10
200 #define _TXSTA2_TXEN 0x20
201 #define _TXSTA2_TXEN2 0x20
202 #define _TXSTA2_TX9 0x40
203 #define _TXSTA2_TX8_9 0x40
204 #define _TXSTA2_NOT_TX8 0x40
205 #define _TXSTA2_TX92 0x40
206 #define _TXSTA2_CSRC 0x80
207 #define _TXSTA2_CSRC2 0x80
209 //==============================================================================
211 extern __at(0x0F6D) __sfr TXREG2;
212 extern __at(0x0F6E) __sfr RCREG2;
213 extern __at(0x0F6F) __sfr SPBRG2;
215 //==============================================================================
216 // CCP5CON Bits
218 extern __at(0x0F70) __sfr CCP5CON;
220 typedef union
222 struct
224 unsigned CCP5M0 : 1;
225 unsigned CCP5M1 : 1;
226 unsigned CCP5M2 : 1;
227 unsigned CCP5M3 : 1;
228 unsigned DC5B0 : 1;
229 unsigned DC5B1 : 1;
230 unsigned : 1;
231 unsigned : 1;
234 struct
236 unsigned : 1;
237 unsigned : 1;
238 unsigned : 1;
239 unsigned : 1;
240 unsigned DCCP5Y : 1;
241 unsigned DCCP5X : 1;
242 unsigned : 1;
243 unsigned : 1;
246 struct
248 unsigned CCP5M : 4;
249 unsigned : 4;
252 struct
254 unsigned : 4;
255 unsigned DC5B : 2;
256 unsigned : 2;
258 } __CCP5CONbits_t;
260 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits;
262 #define _CCP5M0 0x01
263 #define _CCP5M1 0x02
264 #define _CCP5M2 0x04
265 #define _CCP5M3 0x08
266 #define _DC5B0 0x10
267 #define _DCCP5Y 0x10
268 #define _DC5B1 0x20
269 #define _DCCP5X 0x20
271 //==============================================================================
273 extern __at(0x0F71) __sfr CCPR5;
274 extern __at(0x0F71) __sfr CCPR5L;
275 extern __at(0x0F72) __sfr CCPR5H;
277 //==============================================================================
278 // CCP4CON Bits
280 extern __at(0x0F73) __sfr CCP4CON;
282 typedef union
284 struct
286 unsigned CCP4M0 : 1;
287 unsigned CCP4M1 : 1;
288 unsigned CCP4M2 : 1;
289 unsigned CCP4M3 : 1;
290 unsigned DC4B0 : 1;
291 unsigned DC4B1 : 1;
292 unsigned : 1;
293 unsigned : 1;
296 struct
298 unsigned : 1;
299 unsigned : 1;
300 unsigned : 1;
301 unsigned : 1;
302 unsigned DCCP4Y : 1;
303 unsigned DCCP4X : 1;
304 unsigned : 1;
305 unsigned : 1;
308 struct
310 unsigned CCP4M : 4;
311 unsigned : 4;
314 struct
316 unsigned : 4;
317 unsigned DC4B : 2;
318 unsigned : 2;
320 } __CCP4CONbits_t;
322 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits;
324 #define _CCP4M0 0x01
325 #define _CCP4M1 0x02
326 #define _CCP4M2 0x04
327 #define _CCP4M3 0x08
328 #define _DC4B0 0x10
329 #define _DCCP4Y 0x10
330 #define _DC4B1 0x20
331 #define _DCCP4X 0x20
333 //==============================================================================
335 extern __at(0x0F74) __sfr CCPR4;
336 extern __at(0x0F74) __sfr CCPR4L;
337 extern __at(0x0F75) __sfr CCPR4H;
339 //==============================================================================
340 // T4CON Bits
342 extern __at(0x0F76) __sfr T4CON;
344 typedef union
346 struct
348 unsigned T4CKPS0 : 1;
349 unsigned T4CKPS1 : 1;
350 unsigned TMR4ON : 1;
351 unsigned T4OUTPS0 : 1;
352 unsigned T4OUTPS1 : 1;
353 unsigned T4OUTPS2 : 1;
354 unsigned T4OUTPS3 : 1;
355 unsigned : 1;
358 struct
360 unsigned T4CKPS : 2;
361 unsigned : 6;
364 struct
366 unsigned : 3;
367 unsigned T4OUTPS : 4;
368 unsigned : 1;
370 } __T4CONbits_t;
372 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
374 #define _T4CKPS0 0x01
375 #define _T4CKPS1 0x02
376 #define _TMR4ON 0x04
377 #define _T4OUTPS0 0x08
378 #define _T4OUTPS1 0x10
379 #define _T4OUTPS2 0x20
380 #define _T4OUTPS3 0x40
382 //==============================================================================
384 extern __at(0x0F77) __sfr PR4;
385 extern __at(0x0F78) __sfr TMR4;
387 //==============================================================================
388 // PORTA Bits
390 extern __at(0x0F80) __sfr PORTA;
392 typedef union
394 struct
396 unsigned RA0 : 1;
397 unsigned RA1 : 1;
398 unsigned RA2 : 1;
399 unsigned RA3 : 1;
400 unsigned RA4 : 1;
401 unsigned RA5 : 1;
402 unsigned RA6 : 1;
403 unsigned : 1;
406 struct
408 unsigned AN0 : 1;
409 unsigned AN1 : 1;
410 unsigned AN2 : 1;
411 unsigned AN3 : 1;
412 unsigned T0CKI : 1;
413 unsigned AN4 : 1;
414 unsigned OSC2 : 1;
415 unsigned : 1;
418 struct
420 unsigned : 1;
421 unsigned : 1;
422 unsigned VREFM : 1;
423 unsigned VREFP : 1;
424 unsigned : 1;
425 unsigned LVDIN : 1;
426 unsigned CLKO : 1;
427 unsigned : 1;
430 struct
432 unsigned RA : 7;
433 unsigned : 1;
435 } __PORTAbits_t;
437 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
439 #define _PORTA_RA0 0x01
440 #define _PORTA_AN0 0x01
441 #define _PORTA_RA1 0x02
442 #define _PORTA_AN1 0x02
443 #define _PORTA_RA2 0x04
444 #define _PORTA_AN2 0x04
445 #define _PORTA_VREFM 0x04
446 #define _PORTA_RA3 0x08
447 #define _PORTA_AN3 0x08
448 #define _PORTA_VREFP 0x08
449 #define _PORTA_RA4 0x10
450 #define _PORTA_T0CKI 0x10
451 #define _PORTA_RA5 0x20
452 #define _PORTA_AN4 0x20
453 #define _PORTA_LVDIN 0x20
454 #define _PORTA_RA6 0x40
455 #define _PORTA_OSC2 0x40
456 #define _PORTA_CLKO 0x40
458 //==============================================================================
461 //==============================================================================
462 // PORTB Bits
464 extern __at(0x0F81) __sfr PORTB;
466 typedef union
468 struct
470 unsigned RB0 : 1;
471 unsigned RB1 : 1;
472 unsigned RB2 : 1;
473 unsigned RB3 : 1;
474 unsigned RB4 : 1;
475 unsigned RB5 : 1;
476 unsigned RB6 : 1;
477 unsigned RB7 : 1;
480 struct
482 unsigned INT0 : 1;
483 unsigned INT1 : 1;
484 unsigned INT2 : 1;
485 unsigned INT3 : 1;
486 unsigned KBI0 : 1;
487 unsigned KBI1 : 1;
488 unsigned KBI2 : 1;
489 unsigned KBI3 : 1;
492 struct
494 unsigned : 1;
495 unsigned : 1;
496 unsigned : 1;
497 unsigned : 1;
498 unsigned : 1;
499 unsigned PGM : 1;
500 unsigned PGC : 1;
501 unsigned PGD : 1;
504 struct
506 unsigned INT : 4;
507 unsigned : 4;
510 struct
512 unsigned : 4;
513 unsigned KBI : 4;
515 } __PORTBbits_t;
517 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
519 #define _PORTB_RB0 0x01
520 #define _PORTB_INT0 0x01
521 #define _PORTB_RB1 0x02
522 #define _PORTB_INT1 0x02
523 #define _PORTB_RB2 0x04
524 #define _PORTB_INT2 0x04
525 #define _PORTB_RB3 0x08
526 #define _PORTB_INT3 0x08
527 #define _PORTB_RB4 0x10
528 #define _PORTB_KBI0 0x10
529 #define _PORTB_RB5 0x20
530 #define _PORTB_KBI1 0x20
531 #define _PORTB_PGM 0x20
532 #define _PORTB_RB6 0x40
533 #define _PORTB_KBI2 0x40
534 #define _PORTB_PGC 0x40
535 #define _PORTB_RB7 0x80
536 #define _PORTB_KBI3 0x80
537 #define _PORTB_PGD 0x80
539 //==============================================================================
542 //==============================================================================
543 // PORTC Bits
545 extern __at(0x0F82) __sfr PORTC;
547 typedef union
549 struct
551 unsigned RC0 : 1;
552 unsigned RC1 : 1;
553 unsigned RC2 : 1;
554 unsigned RC3 : 1;
555 unsigned RC4 : 1;
556 unsigned RC5 : 1;
557 unsigned RC6 : 1;
558 unsigned RC7 : 1;
561 struct
563 unsigned T1OSO : 1;
564 unsigned T1OSI : 1;
565 unsigned CCP1 : 1;
566 unsigned SCK : 1;
567 unsigned SDI : 1;
568 unsigned SDO : 1;
569 unsigned TX : 1;
570 unsigned RX : 1;
573 struct
575 unsigned T13CKI : 1;
576 unsigned CCP2 : 1;
577 unsigned : 1;
578 unsigned SCL : 1;
579 unsigned SDA : 1;
580 unsigned : 1;
581 unsigned CK : 1;
582 unsigned : 1;
585 struct
587 unsigned : 1;
588 unsigned CCP2A : 1;
589 unsigned : 1;
590 unsigned : 1;
591 unsigned : 1;
592 unsigned : 1;
593 unsigned : 1;
594 unsigned : 1;
596 } __PORTCbits_t;
598 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
600 #define _PORTC_RC0 0x01
601 #define _PORTC_T1OSO 0x01
602 #define _PORTC_T13CKI 0x01
603 #define _PORTC_RC1 0x02
604 #define _PORTC_T1OSI 0x02
605 #define _PORTC_CCP2 0x02
606 #define _PORTC_CCP2A 0x02
607 #define _PORTC_RC2 0x04
608 #define _PORTC_CCP1 0x04
609 #define _PORTC_RC3 0x08
610 #define _PORTC_SCK 0x08
611 #define _PORTC_SCL 0x08
612 #define _PORTC_RC4 0x10
613 #define _PORTC_SDI 0x10
614 #define _PORTC_SDA 0x10
615 #define _PORTC_RC5 0x20
616 #define _PORTC_SDO 0x20
617 #define _PORTC_RC6 0x40
618 #define _PORTC_TX 0x40
619 #define _PORTC_CK 0x40
620 #define _PORTC_RC7 0x80
621 #define _PORTC_RX 0x80
623 //==============================================================================
626 //==============================================================================
627 // PORTD Bits
629 extern __at(0x0F83) __sfr PORTD;
631 typedef union
633 struct
635 unsigned RD0 : 1;
636 unsigned RD1 : 1;
637 unsigned RD2 : 1;
638 unsigned RD3 : 1;
639 unsigned RD4 : 1;
640 unsigned RD5 : 1;
641 unsigned RD6 : 1;
642 unsigned RD7 : 1;
645 struct
647 unsigned PSP0 : 1;
648 unsigned PSP1 : 1;
649 unsigned PSP2 : 1;
650 unsigned PSP3 : 1;
651 unsigned PSP4 : 1;
652 unsigned PSP5 : 1;
653 unsigned PSP6 : 1;
654 unsigned PSP7 : 1;
656 } __PORTDbits_t;
658 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
660 #define _PORTD_RD0 0x01
661 #define _PORTD_PSP0 0x01
662 #define _PORTD_RD1 0x02
663 #define _PORTD_PSP1 0x02
664 #define _PORTD_RD2 0x04
665 #define _PORTD_PSP2 0x04
666 #define _PORTD_RD3 0x08
667 #define _PORTD_PSP3 0x08
668 #define _PORTD_RD4 0x10
669 #define _PORTD_PSP4 0x10
670 #define _PORTD_RD5 0x20
671 #define _PORTD_PSP5 0x20
672 #define _PORTD_RD6 0x40
673 #define _PORTD_PSP6 0x40
674 #define _PORTD_RD7 0x80
675 #define _PORTD_PSP7 0x80
677 //==============================================================================
680 //==============================================================================
681 // PORTE Bits
683 extern __at(0x0F84) __sfr PORTE;
685 typedef union
687 struct
689 unsigned RE0 : 1;
690 unsigned RE1 : 1;
691 unsigned RE2 : 1;
692 unsigned RE3 : 1;
693 unsigned RE4 : 1;
694 unsigned RE5 : 1;
695 unsigned RE6 : 1;
696 unsigned RE7 : 1;
699 struct
701 unsigned RD : 1;
702 unsigned WR : 1;
703 unsigned CS : 1;
704 unsigned : 1;
705 unsigned : 1;
706 unsigned : 1;
707 unsigned : 1;
708 unsigned CCP2 : 1;
711 struct
713 unsigned : 1;
714 unsigned : 1;
715 unsigned : 1;
716 unsigned : 1;
717 unsigned : 1;
718 unsigned : 1;
719 unsigned : 1;
720 unsigned CCP2C : 1;
722 } __PORTEbits_t;
724 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
726 #define _PORTE_RE0 0x01
727 #define _PORTE_RD 0x01
728 #define _PORTE_RE1 0x02
729 #define _PORTE_WR 0x02
730 #define _PORTE_RE2 0x04
731 #define _PORTE_CS 0x04
732 #define _PORTE_RE3 0x08
733 #define _PORTE_RE4 0x10
734 #define _PORTE_RE5 0x20
735 #define _PORTE_RE6 0x40
736 #define _PORTE_RE7 0x80
737 #define _PORTE_CCP2 0x80
738 #define _PORTE_CCP2C 0x80
740 //==============================================================================
743 //==============================================================================
744 // PORTF Bits
746 extern __at(0x0F85) __sfr PORTF;
748 typedef union
750 struct
752 unsigned RF0 : 1;
753 unsigned RF1 : 1;
754 unsigned RF2 : 1;
755 unsigned RF3 : 1;
756 unsigned RF4 : 1;
757 unsigned RF5 : 1;
758 unsigned RF6 : 1;
759 unsigned RF7 : 1;
762 struct
764 unsigned AN5 : 1;
765 unsigned AN6 : 1;
766 unsigned AN7 : 1;
767 unsigned AN8 : 1;
768 unsigned AN9 : 1;
769 unsigned AN10 : 1;
770 unsigned AN11 : 1;
771 unsigned SS : 1;
774 struct
776 unsigned : 1;
777 unsigned C2OUT : 1;
778 unsigned C1OUT : 1;
779 unsigned : 1;
780 unsigned : 1;
781 unsigned CVREF : 1;
782 unsigned : 1;
783 unsigned : 1;
785 } __PORTFbits_t;
787 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
789 #define _PORTF_RF0 0x01
790 #define _PORTF_AN5 0x01
791 #define _PORTF_RF1 0x02
792 #define _PORTF_AN6 0x02
793 #define _PORTF_C2OUT 0x02
794 #define _PORTF_RF2 0x04
795 #define _PORTF_AN7 0x04
796 #define _PORTF_C1OUT 0x04
797 #define _PORTF_RF3 0x08
798 #define _PORTF_AN8 0x08
799 #define _PORTF_RF4 0x10
800 #define _PORTF_AN9 0x10
801 #define _PORTF_RF5 0x20
802 #define _PORTF_AN10 0x20
803 #define _PORTF_CVREF 0x20
804 #define _PORTF_RF6 0x40
805 #define _PORTF_AN11 0x40
806 #define _PORTF_RF7 0x80
807 #define _PORTF_SS 0x80
809 //==============================================================================
812 //==============================================================================
813 // PORTG Bits
815 extern __at(0x0F86) __sfr PORTG;
817 typedef union
819 struct
821 unsigned RG0 : 1;
822 unsigned RG1 : 1;
823 unsigned RG2 : 1;
824 unsigned RG3 : 1;
825 unsigned RG4 : 1;
826 unsigned : 1;
827 unsigned : 1;
828 unsigned : 1;
831 struct
833 unsigned CCP3 : 1;
834 unsigned TX2 : 1;
835 unsigned RX2 : 1;
836 unsigned CCP4 : 1;
837 unsigned CCP5 : 1;
838 unsigned : 1;
839 unsigned : 1;
840 unsigned : 1;
843 struct
845 unsigned : 1;
846 unsigned CK2 : 1;
847 unsigned DT2 : 1;
848 unsigned : 1;
849 unsigned : 1;
850 unsigned : 1;
851 unsigned : 1;
852 unsigned : 1;
855 struct
857 unsigned RG : 5;
858 unsigned : 3;
860 } __PORTGbits_t;
862 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
864 #define _PORTG_RG0 0x01
865 #define _PORTG_CCP3 0x01
866 #define _PORTG_RG1 0x02
867 #define _PORTG_TX2 0x02
868 #define _PORTG_CK2 0x02
869 #define _PORTG_RG2 0x04
870 #define _PORTG_RX2 0x04
871 #define _PORTG_DT2 0x04
872 #define _PORTG_RG3 0x08
873 #define _PORTG_CCP4 0x08
874 #define _PORTG_RG4 0x10
875 #define _PORTG_CCP5 0x10
877 //==============================================================================
880 //==============================================================================
881 // LATA Bits
883 extern __at(0x0F89) __sfr LATA;
885 typedef union
887 struct
889 unsigned LATA0 : 1;
890 unsigned LATA1 : 1;
891 unsigned LATA2 : 1;
892 unsigned LATA3 : 1;
893 unsigned LATA4 : 1;
894 unsigned LATA5 : 1;
895 unsigned LATA6 : 1;
896 unsigned : 1;
899 struct
901 unsigned LATA : 7;
902 unsigned : 1;
904 } __LATAbits_t;
906 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
908 #define _LATA0 0x01
909 #define _LATA1 0x02
910 #define _LATA2 0x04
911 #define _LATA3 0x08
912 #define _LATA4 0x10
913 #define _LATA5 0x20
914 #define _LATA6 0x40
916 //==============================================================================
919 //==============================================================================
920 // LATB Bits
922 extern __at(0x0F8A) __sfr LATB;
924 typedef struct
926 unsigned LATB0 : 1;
927 unsigned LATB1 : 1;
928 unsigned LATB2 : 1;
929 unsigned LATB3 : 1;
930 unsigned LATB4 : 1;
931 unsigned LATB5 : 1;
932 unsigned LATB6 : 1;
933 unsigned LATB7 : 1;
934 } __LATBbits_t;
936 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
938 #define _LATB0 0x01
939 #define _LATB1 0x02
940 #define _LATB2 0x04
941 #define _LATB3 0x08
942 #define _LATB4 0x10
943 #define _LATB5 0x20
944 #define _LATB6 0x40
945 #define _LATB7 0x80
947 //==============================================================================
950 //==============================================================================
951 // LATC Bits
953 extern __at(0x0F8B) __sfr LATC;
955 typedef struct
957 unsigned LATC0 : 1;
958 unsigned LATC1 : 1;
959 unsigned LATC2 : 1;
960 unsigned LATC3 : 1;
961 unsigned LATC4 : 1;
962 unsigned LATC5 : 1;
963 unsigned LATC6 : 1;
964 unsigned LATC7 : 1;
965 } __LATCbits_t;
967 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
969 #define _LATC0 0x01
970 #define _LATC1 0x02
971 #define _LATC2 0x04
972 #define _LATC3 0x08
973 #define _LATC4 0x10
974 #define _LATC5 0x20
975 #define _LATC6 0x40
976 #define _LATC7 0x80
978 //==============================================================================
981 //==============================================================================
982 // LATD Bits
984 extern __at(0x0F8C) __sfr LATD;
986 typedef struct
988 unsigned LATD0 : 1;
989 unsigned LATD1 : 1;
990 unsigned LATD2 : 1;
991 unsigned LATD3 : 1;
992 unsigned LATD4 : 1;
993 unsigned LATD5 : 1;
994 unsigned LATD6 : 1;
995 unsigned LATD7 : 1;
996 } __LATDbits_t;
998 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1000 #define _LATD0 0x01
1001 #define _LATD1 0x02
1002 #define _LATD2 0x04
1003 #define _LATD3 0x08
1004 #define _LATD4 0x10
1005 #define _LATD5 0x20
1006 #define _LATD6 0x40
1007 #define _LATD7 0x80
1009 //==============================================================================
1012 //==============================================================================
1013 // LATE Bits
1015 extern __at(0x0F8D) __sfr LATE;
1017 typedef struct
1019 unsigned LATE0 : 1;
1020 unsigned LATE1 : 1;
1021 unsigned LATE2 : 1;
1022 unsigned LATE3 : 1;
1023 unsigned LATE4 : 1;
1024 unsigned LATE5 : 1;
1025 unsigned LATE6 : 1;
1026 unsigned LATE7 : 1;
1027 } __LATEbits_t;
1029 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1031 #define _LATE0 0x01
1032 #define _LATE1 0x02
1033 #define _LATE2 0x04
1034 #define _LATE3 0x08
1035 #define _LATE4 0x10
1036 #define _LATE5 0x20
1037 #define _LATE6 0x40
1038 #define _LATE7 0x80
1040 //==============================================================================
1043 //==============================================================================
1044 // LATF Bits
1046 extern __at(0x0F8E) __sfr LATF;
1048 typedef struct
1050 unsigned LATF0 : 1;
1051 unsigned LATF1 : 1;
1052 unsigned LATF2 : 1;
1053 unsigned LATF3 : 1;
1054 unsigned LATF4 : 1;
1055 unsigned LATF5 : 1;
1056 unsigned LATF6 : 1;
1057 unsigned LATF7 : 1;
1058 } __LATFbits_t;
1060 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
1062 #define _LATF0 0x01
1063 #define _LATF1 0x02
1064 #define _LATF2 0x04
1065 #define _LATF3 0x08
1066 #define _LATF4 0x10
1067 #define _LATF5 0x20
1068 #define _LATF6 0x40
1069 #define _LATF7 0x80
1071 //==============================================================================
1074 //==============================================================================
1075 // LATG Bits
1077 extern __at(0x0F8F) __sfr LATG;
1079 typedef union
1081 struct
1083 unsigned LATG0 : 1;
1084 unsigned LATG1 : 1;
1085 unsigned LATG2 : 1;
1086 unsigned LATG3 : 1;
1087 unsigned LATG4 : 1;
1088 unsigned : 1;
1089 unsigned : 1;
1090 unsigned : 1;
1093 struct
1095 unsigned LATG : 5;
1096 unsigned : 3;
1098 } __LATGbits_t;
1100 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
1102 #define _LATG0 0x01
1103 #define _LATG1 0x02
1104 #define _LATG2 0x04
1105 #define _LATG3 0x08
1106 #define _LATG4 0x10
1108 //==============================================================================
1111 //==============================================================================
1112 // DDRA Bits
1114 extern __at(0x0F92) __sfr DDRA;
1116 typedef union
1118 struct
1120 unsigned TRISA0 : 1;
1121 unsigned TRISA1 : 1;
1122 unsigned TRISA2 : 1;
1123 unsigned TRISA3 : 1;
1124 unsigned TRISA4 : 1;
1125 unsigned TRISA5 : 1;
1126 unsigned TRISA6 : 1;
1127 unsigned : 1;
1130 struct
1132 unsigned RA0 : 1;
1133 unsigned RA1 : 1;
1134 unsigned RA2 : 1;
1135 unsigned RA3 : 1;
1136 unsigned RA4 : 1;
1137 unsigned RA5 : 1;
1138 unsigned RA6 : 1;
1139 unsigned : 1;
1142 struct
1144 unsigned TRISA : 7;
1145 unsigned : 1;
1148 struct
1150 unsigned RA : 7;
1151 unsigned : 1;
1153 } __DDRAbits_t;
1155 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1157 #define _TRISA0 0x01
1158 #define _RA0 0x01
1159 #define _TRISA1 0x02
1160 #define _RA1 0x02
1161 #define _TRISA2 0x04
1162 #define _RA2 0x04
1163 #define _TRISA3 0x08
1164 #define _RA3 0x08
1165 #define _TRISA4 0x10
1166 #define _RA4 0x10
1167 #define _TRISA5 0x20
1168 #define _RA5 0x20
1169 #define _TRISA6 0x40
1170 #define _RA6 0x40
1172 //==============================================================================
1175 //==============================================================================
1176 // TRISA Bits
1178 extern __at(0x0F92) __sfr TRISA;
1180 typedef union
1182 struct
1184 unsigned TRISA0 : 1;
1185 unsigned TRISA1 : 1;
1186 unsigned TRISA2 : 1;
1187 unsigned TRISA3 : 1;
1188 unsigned TRISA4 : 1;
1189 unsigned TRISA5 : 1;
1190 unsigned TRISA6 : 1;
1191 unsigned : 1;
1194 struct
1196 unsigned RA0 : 1;
1197 unsigned RA1 : 1;
1198 unsigned RA2 : 1;
1199 unsigned RA3 : 1;
1200 unsigned RA4 : 1;
1201 unsigned RA5 : 1;
1202 unsigned RA6 : 1;
1203 unsigned : 1;
1206 struct
1208 unsigned RA : 7;
1209 unsigned : 1;
1212 struct
1214 unsigned TRISA : 7;
1215 unsigned : 1;
1217 } __TRISAbits_t;
1219 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1221 #define _TRISA_TRISA0 0x01
1222 #define _TRISA_RA0 0x01
1223 #define _TRISA_TRISA1 0x02
1224 #define _TRISA_RA1 0x02
1225 #define _TRISA_TRISA2 0x04
1226 #define _TRISA_RA2 0x04
1227 #define _TRISA_TRISA3 0x08
1228 #define _TRISA_RA3 0x08
1229 #define _TRISA_TRISA4 0x10
1230 #define _TRISA_RA4 0x10
1231 #define _TRISA_TRISA5 0x20
1232 #define _TRISA_RA5 0x20
1233 #define _TRISA_TRISA6 0x40
1234 #define _TRISA_RA6 0x40
1236 //==============================================================================
1239 //==============================================================================
1240 // DDRB Bits
1242 extern __at(0x0F93) __sfr DDRB;
1244 typedef union
1246 struct
1248 unsigned TRISB0 : 1;
1249 unsigned TRISB1 : 1;
1250 unsigned TRISB2 : 1;
1251 unsigned TRISB3 : 1;
1252 unsigned TRISB4 : 1;
1253 unsigned TRISB5 : 1;
1254 unsigned TRISB6 : 1;
1255 unsigned TRISB7 : 1;
1258 struct
1260 unsigned RB0 : 1;
1261 unsigned RB1 : 1;
1262 unsigned RB2 : 1;
1263 unsigned RB3 : 1;
1264 unsigned RB4 : 1;
1265 unsigned RB5 : 1;
1266 unsigned RB6 : 1;
1267 unsigned RB7 : 1;
1269 } __DDRBbits_t;
1271 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1273 #define _TRISB0 0x01
1274 #define _RB0 0x01
1275 #define _TRISB1 0x02
1276 #define _RB1 0x02
1277 #define _TRISB2 0x04
1278 #define _RB2 0x04
1279 #define _TRISB3 0x08
1280 #define _RB3 0x08
1281 #define _TRISB4 0x10
1282 #define _RB4 0x10
1283 #define _TRISB5 0x20
1284 #define _RB5 0x20
1285 #define _TRISB6 0x40
1286 #define _RB6 0x40
1287 #define _TRISB7 0x80
1288 #define _RB7 0x80
1290 //==============================================================================
1293 //==============================================================================
1294 // TRISB Bits
1296 extern __at(0x0F93) __sfr TRISB;
1298 typedef union
1300 struct
1302 unsigned TRISB0 : 1;
1303 unsigned TRISB1 : 1;
1304 unsigned TRISB2 : 1;
1305 unsigned TRISB3 : 1;
1306 unsigned TRISB4 : 1;
1307 unsigned TRISB5 : 1;
1308 unsigned TRISB6 : 1;
1309 unsigned TRISB7 : 1;
1312 struct
1314 unsigned RB0 : 1;
1315 unsigned RB1 : 1;
1316 unsigned RB2 : 1;
1317 unsigned RB3 : 1;
1318 unsigned RB4 : 1;
1319 unsigned RB5 : 1;
1320 unsigned RB6 : 1;
1321 unsigned RB7 : 1;
1323 } __TRISBbits_t;
1325 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1327 #define _TRISB_TRISB0 0x01
1328 #define _TRISB_RB0 0x01
1329 #define _TRISB_TRISB1 0x02
1330 #define _TRISB_RB1 0x02
1331 #define _TRISB_TRISB2 0x04
1332 #define _TRISB_RB2 0x04
1333 #define _TRISB_TRISB3 0x08
1334 #define _TRISB_RB3 0x08
1335 #define _TRISB_TRISB4 0x10
1336 #define _TRISB_RB4 0x10
1337 #define _TRISB_TRISB5 0x20
1338 #define _TRISB_RB5 0x20
1339 #define _TRISB_TRISB6 0x40
1340 #define _TRISB_RB6 0x40
1341 #define _TRISB_TRISB7 0x80
1342 #define _TRISB_RB7 0x80
1344 //==============================================================================
1347 //==============================================================================
1348 // DDRC Bits
1350 extern __at(0x0F94) __sfr DDRC;
1352 typedef union
1354 struct
1356 unsigned TRISC0 : 1;
1357 unsigned TRISC1 : 1;
1358 unsigned TRISC2 : 1;
1359 unsigned TRISC3 : 1;
1360 unsigned TRISC4 : 1;
1361 unsigned TRISC5 : 1;
1362 unsigned TRISC6 : 1;
1363 unsigned TRISC7 : 1;
1366 struct
1368 unsigned RC0 : 1;
1369 unsigned RC1 : 1;
1370 unsigned RC2 : 1;
1371 unsigned RC3 : 1;
1372 unsigned RC4 : 1;
1373 unsigned RC5 : 1;
1374 unsigned RC6 : 1;
1375 unsigned RC7 : 1;
1377 } __DDRCbits_t;
1379 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1381 #define _TRISC0 0x01
1382 #define _RC0 0x01
1383 #define _TRISC1 0x02
1384 #define _RC1 0x02
1385 #define _TRISC2 0x04
1386 #define _RC2 0x04
1387 #define _TRISC3 0x08
1388 #define _RC3 0x08
1389 #define _TRISC4 0x10
1390 #define _RC4 0x10
1391 #define _TRISC5 0x20
1392 #define _RC5 0x20
1393 #define _TRISC6 0x40
1394 #define _RC6 0x40
1395 #define _TRISC7 0x80
1396 #define _RC7 0x80
1398 //==============================================================================
1401 //==============================================================================
1402 // TRISC Bits
1404 extern __at(0x0F94) __sfr TRISC;
1406 typedef union
1408 struct
1410 unsigned TRISC0 : 1;
1411 unsigned TRISC1 : 1;
1412 unsigned TRISC2 : 1;
1413 unsigned TRISC3 : 1;
1414 unsigned TRISC4 : 1;
1415 unsigned TRISC5 : 1;
1416 unsigned TRISC6 : 1;
1417 unsigned TRISC7 : 1;
1420 struct
1422 unsigned RC0 : 1;
1423 unsigned RC1 : 1;
1424 unsigned RC2 : 1;
1425 unsigned RC3 : 1;
1426 unsigned RC4 : 1;
1427 unsigned RC5 : 1;
1428 unsigned RC6 : 1;
1429 unsigned RC7 : 1;
1431 } __TRISCbits_t;
1433 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1435 #define _TRISC_TRISC0 0x01
1436 #define _TRISC_RC0 0x01
1437 #define _TRISC_TRISC1 0x02
1438 #define _TRISC_RC1 0x02
1439 #define _TRISC_TRISC2 0x04
1440 #define _TRISC_RC2 0x04
1441 #define _TRISC_TRISC3 0x08
1442 #define _TRISC_RC3 0x08
1443 #define _TRISC_TRISC4 0x10
1444 #define _TRISC_RC4 0x10
1445 #define _TRISC_TRISC5 0x20
1446 #define _TRISC_RC5 0x20
1447 #define _TRISC_TRISC6 0x40
1448 #define _TRISC_RC6 0x40
1449 #define _TRISC_TRISC7 0x80
1450 #define _TRISC_RC7 0x80
1452 //==============================================================================
1455 //==============================================================================
1456 // DDRD Bits
1458 extern __at(0x0F95) __sfr DDRD;
1460 typedef union
1462 struct
1464 unsigned TRISD0 : 1;
1465 unsigned TRISD1 : 1;
1466 unsigned TRISD2 : 1;
1467 unsigned TRISD3 : 1;
1468 unsigned TRISD4 : 1;
1469 unsigned TRISD5 : 1;
1470 unsigned TRISD6 : 1;
1471 unsigned TRISD7 : 1;
1474 struct
1476 unsigned RD0 : 1;
1477 unsigned RD1 : 1;
1478 unsigned RD2 : 1;
1479 unsigned RD3 : 1;
1480 unsigned RD4 : 1;
1481 unsigned RD5 : 1;
1482 unsigned RD6 : 1;
1483 unsigned RD7 : 1;
1485 } __DDRDbits_t;
1487 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
1489 #define _TRISD0 0x01
1490 #define _RD0 0x01
1491 #define _TRISD1 0x02
1492 #define _RD1 0x02
1493 #define _TRISD2 0x04
1494 #define _RD2 0x04
1495 #define _TRISD3 0x08
1496 #define _RD3 0x08
1497 #define _TRISD4 0x10
1498 #define _RD4 0x10
1499 #define _TRISD5 0x20
1500 #define _RD5 0x20
1501 #define _TRISD6 0x40
1502 #define _RD6 0x40
1503 #define _TRISD7 0x80
1504 #define _RD7 0x80
1506 //==============================================================================
1509 //==============================================================================
1510 // TRISD Bits
1512 extern __at(0x0F95) __sfr TRISD;
1514 typedef union
1516 struct
1518 unsigned TRISD0 : 1;
1519 unsigned TRISD1 : 1;
1520 unsigned TRISD2 : 1;
1521 unsigned TRISD3 : 1;
1522 unsigned TRISD4 : 1;
1523 unsigned TRISD5 : 1;
1524 unsigned TRISD6 : 1;
1525 unsigned TRISD7 : 1;
1528 struct
1530 unsigned RD0 : 1;
1531 unsigned RD1 : 1;
1532 unsigned RD2 : 1;
1533 unsigned RD3 : 1;
1534 unsigned RD4 : 1;
1535 unsigned RD5 : 1;
1536 unsigned RD6 : 1;
1537 unsigned RD7 : 1;
1539 } __TRISDbits_t;
1541 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
1543 #define _TRISD_TRISD0 0x01
1544 #define _TRISD_RD0 0x01
1545 #define _TRISD_TRISD1 0x02
1546 #define _TRISD_RD1 0x02
1547 #define _TRISD_TRISD2 0x04
1548 #define _TRISD_RD2 0x04
1549 #define _TRISD_TRISD3 0x08
1550 #define _TRISD_RD3 0x08
1551 #define _TRISD_TRISD4 0x10
1552 #define _TRISD_RD4 0x10
1553 #define _TRISD_TRISD5 0x20
1554 #define _TRISD_RD5 0x20
1555 #define _TRISD_TRISD6 0x40
1556 #define _TRISD_RD6 0x40
1557 #define _TRISD_TRISD7 0x80
1558 #define _TRISD_RD7 0x80
1560 //==============================================================================
1563 //==============================================================================
1564 // DDRE Bits
1566 extern __at(0x0F96) __sfr DDRE;
1568 typedef union
1570 struct
1572 unsigned TRISE0 : 1;
1573 unsigned TRISE1 : 1;
1574 unsigned TRISE2 : 1;
1575 unsigned TRISE3 : 1;
1576 unsigned TRISE4 : 1;
1577 unsigned TRISE5 : 1;
1578 unsigned TRISE6 : 1;
1579 unsigned TRISE7 : 1;
1582 struct
1584 unsigned RE0 : 1;
1585 unsigned RE1 : 1;
1586 unsigned RE2 : 1;
1587 unsigned RE3 : 1;
1588 unsigned RE4 : 1;
1589 unsigned RE5 : 1;
1590 unsigned RE6 : 1;
1591 unsigned RE7 : 1;
1593 } __DDREbits_t;
1595 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
1597 #define _TRISE0 0x01
1598 #define _RE0 0x01
1599 #define _TRISE1 0x02
1600 #define _RE1 0x02
1601 #define _TRISE2 0x04
1602 #define _RE2 0x04
1603 #define _TRISE3 0x08
1604 #define _RE3 0x08
1605 #define _TRISE4 0x10
1606 #define _RE4 0x10
1607 #define _TRISE5 0x20
1608 #define _RE5 0x20
1609 #define _TRISE6 0x40
1610 #define _RE6 0x40
1611 #define _TRISE7 0x80
1612 #define _RE7 0x80
1614 //==============================================================================
1617 //==============================================================================
1618 // TRISE Bits
1620 extern __at(0x0F96) __sfr TRISE;
1622 typedef union
1624 struct
1626 unsigned TRISE0 : 1;
1627 unsigned TRISE1 : 1;
1628 unsigned TRISE2 : 1;
1629 unsigned TRISE3 : 1;
1630 unsigned TRISE4 : 1;
1631 unsigned TRISE5 : 1;
1632 unsigned TRISE6 : 1;
1633 unsigned TRISE7 : 1;
1636 struct
1638 unsigned RE0 : 1;
1639 unsigned RE1 : 1;
1640 unsigned RE2 : 1;
1641 unsigned RE3 : 1;
1642 unsigned RE4 : 1;
1643 unsigned RE5 : 1;
1644 unsigned RE6 : 1;
1645 unsigned RE7 : 1;
1647 } __TRISEbits_t;
1649 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
1651 #define _TRISE_TRISE0 0x01
1652 #define _TRISE_RE0 0x01
1653 #define _TRISE_TRISE1 0x02
1654 #define _TRISE_RE1 0x02
1655 #define _TRISE_TRISE2 0x04
1656 #define _TRISE_RE2 0x04
1657 #define _TRISE_TRISE3 0x08
1658 #define _TRISE_RE3 0x08
1659 #define _TRISE_TRISE4 0x10
1660 #define _TRISE_RE4 0x10
1661 #define _TRISE_TRISE5 0x20
1662 #define _TRISE_RE5 0x20
1663 #define _TRISE_TRISE6 0x40
1664 #define _TRISE_RE6 0x40
1665 #define _TRISE_TRISE7 0x80
1666 #define _TRISE_RE7 0x80
1668 //==============================================================================
1671 //==============================================================================
1672 // DDRF Bits
1674 extern __at(0x0F97) __sfr DDRF;
1676 typedef union
1678 struct
1680 unsigned TRISF0 : 1;
1681 unsigned TRISF1 : 1;
1682 unsigned TRISF2 : 1;
1683 unsigned TRISF3 : 1;
1684 unsigned TRISF4 : 1;
1685 unsigned TRISF5 : 1;
1686 unsigned TRISF6 : 1;
1687 unsigned TRISF7 : 1;
1690 struct
1692 unsigned RF0 : 1;
1693 unsigned RF1 : 1;
1694 unsigned RF2 : 1;
1695 unsigned RF3 : 1;
1696 unsigned RF4 : 1;
1697 unsigned RF5 : 1;
1698 unsigned RF6 : 1;
1699 unsigned RF7 : 1;
1701 } __DDRFbits_t;
1703 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
1705 #define _TRISF0 0x01
1706 #define _RF0 0x01
1707 #define _TRISF1 0x02
1708 #define _RF1 0x02
1709 #define _TRISF2 0x04
1710 #define _RF2 0x04
1711 #define _TRISF3 0x08
1712 #define _RF3 0x08
1713 #define _TRISF4 0x10
1714 #define _RF4 0x10
1715 #define _TRISF5 0x20
1716 #define _RF5 0x20
1717 #define _TRISF6 0x40
1718 #define _RF6 0x40
1719 #define _TRISF7 0x80
1720 #define _RF7 0x80
1722 //==============================================================================
1725 //==============================================================================
1726 // TRISF Bits
1728 extern __at(0x0F97) __sfr TRISF;
1730 typedef union
1732 struct
1734 unsigned TRISF0 : 1;
1735 unsigned TRISF1 : 1;
1736 unsigned TRISF2 : 1;
1737 unsigned TRISF3 : 1;
1738 unsigned TRISF4 : 1;
1739 unsigned TRISF5 : 1;
1740 unsigned TRISF6 : 1;
1741 unsigned TRISF7 : 1;
1744 struct
1746 unsigned RF0 : 1;
1747 unsigned RF1 : 1;
1748 unsigned RF2 : 1;
1749 unsigned RF3 : 1;
1750 unsigned RF4 : 1;
1751 unsigned RF5 : 1;
1752 unsigned RF6 : 1;
1753 unsigned RF7 : 1;
1755 } __TRISFbits_t;
1757 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
1759 #define _TRISF_TRISF0 0x01
1760 #define _TRISF_RF0 0x01
1761 #define _TRISF_TRISF1 0x02
1762 #define _TRISF_RF1 0x02
1763 #define _TRISF_TRISF2 0x04
1764 #define _TRISF_RF2 0x04
1765 #define _TRISF_TRISF3 0x08
1766 #define _TRISF_RF3 0x08
1767 #define _TRISF_TRISF4 0x10
1768 #define _TRISF_RF4 0x10
1769 #define _TRISF_TRISF5 0x20
1770 #define _TRISF_RF5 0x20
1771 #define _TRISF_TRISF6 0x40
1772 #define _TRISF_RF6 0x40
1773 #define _TRISF_TRISF7 0x80
1774 #define _TRISF_RF7 0x80
1776 //==============================================================================
1779 //==============================================================================
1780 // DDRG Bits
1782 extern __at(0x0F98) __sfr DDRG;
1784 typedef union
1786 struct
1788 unsigned TRISG0 : 1;
1789 unsigned TRISG1 : 1;
1790 unsigned TRISG2 : 1;
1791 unsigned TRISG3 : 1;
1792 unsigned TRISG4 : 1;
1793 unsigned : 1;
1794 unsigned : 1;
1795 unsigned : 1;
1798 struct
1800 unsigned RG0 : 1;
1801 unsigned RG1 : 1;
1802 unsigned RG2 : 1;
1803 unsigned RG3 : 1;
1804 unsigned RG4 : 1;
1805 unsigned : 1;
1806 unsigned : 1;
1807 unsigned : 1;
1810 struct
1812 unsigned RG : 5;
1813 unsigned : 3;
1816 struct
1818 unsigned TRISG : 5;
1819 unsigned : 3;
1821 } __DDRGbits_t;
1823 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
1825 #define _TRISG0 0x01
1826 #define _RG0 0x01
1827 #define _TRISG1 0x02
1828 #define _RG1 0x02
1829 #define _TRISG2 0x04
1830 #define _RG2 0x04
1831 #define _TRISG3 0x08
1832 #define _RG3 0x08
1833 #define _TRISG4 0x10
1834 #define _RG4 0x10
1836 //==============================================================================
1839 //==============================================================================
1840 // TRISG Bits
1842 extern __at(0x0F98) __sfr TRISG;
1844 typedef union
1846 struct
1848 unsigned TRISG0 : 1;
1849 unsigned TRISG1 : 1;
1850 unsigned TRISG2 : 1;
1851 unsigned TRISG3 : 1;
1852 unsigned TRISG4 : 1;
1853 unsigned : 1;
1854 unsigned : 1;
1855 unsigned : 1;
1858 struct
1860 unsigned RG0 : 1;
1861 unsigned RG1 : 1;
1862 unsigned RG2 : 1;
1863 unsigned RG3 : 1;
1864 unsigned RG4 : 1;
1865 unsigned : 1;
1866 unsigned : 1;
1867 unsigned : 1;
1870 struct
1872 unsigned RG : 5;
1873 unsigned : 3;
1876 struct
1878 unsigned TRISG : 5;
1879 unsigned : 3;
1881 } __TRISGbits_t;
1883 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
1885 #define _TRISG_TRISG0 0x01
1886 #define _TRISG_RG0 0x01
1887 #define _TRISG_TRISG1 0x02
1888 #define _TRISG_RG1 0x02
1889 #define _TRISG_TRISG2 0x04
1890 #define _TRISG_RG2 0x04
1891 #define _TRISG_TRISG3 0x08
1892 #define _TRISG_RG3 0x08
1893 #define _TRISG_TRISG4 0x10
1894 #define _TRISG_RG4 0x10
1896 //==============================================================================
1899 //==============================================================================
1900 // PIE1 Bits
1902 extern __at(0x0F9D) __sfr PIE1;
1904 typedef union
1906 struct
1908 unsigned TMR1IE : 1;
1909 unsigned TMR2IE : 1;
1910 unsigned CCP1IE : 1;
1911 unsigned SSPIE : 1;
1912 unsigned TXIE : 1;
1913 unsigned RCIE : 1;
1914 unsigned ADIE : 1;
1915 unsigned PSPIE : 1;
1918 struct
1920 unsigned : 1;
1921 unsigned : 1;
1922 unsigned : 1;
1923 unsigned : 1;
1924 unsigned TX1IE : 1;
1925 unsigned RC1IE : 1;
1926 unsigned : 1;
1927 unsigned : 1;
1929 } __PIE1bits_t;
1931 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1933 #define _TMR1IE 0x01
1934 #define _TMR2IE 0x02
1935 #define _CCP1IE 0x04
1936 #define _SSPIE 0x08
1937 #define _TXIE 0x10
1938 #define _TX1IE 0x10
1939 #define _RCIE 0x20
1940 #define _RC1IE 0x20
1941 #define _ADIE 0x40
1942 #define _PSPIE 0x80
1944 //==============================================================================
1947 //==============================================================================
1948 // PIR1 Bits
1950 extern __at(0x0F9E) __sfr PIR1;
1952 typedef union
1954 struct
1956 unsigned TMR1IF : 1;
1957 unsigned TMR2IF : 1;
1958 unsigned CCP1IF : 1;
1959 unsigned SSPIF : 1;
1960 unsigned TXIF : 1;
1961 unsigned RCIF : 1;
1962 unsigned ADIF : 1;
1963 unsigned PSPIF : 1;
1966 struct
1968 unsigned : 1;
1969 unsigned : 1;
1970 unsigned : 1;
1971 unsigned : 1;
1972 unsigned TX1IF : 1;
1973 unsigned RC1IF : 1;
1974 unsigned : 1;
1975 unsigned : 1;
1977 } __PIR1bits_t;
1979 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1981 #define _TMR1IF 0x01
1982 #define _TMR2IF 0x02
1983 #define _CCP1IF 0x04
1984 #define _SSPIF 0x08
1985 #define _TXIF 0x10
1986 #define _TX1IF 0x10
1987 #define _RCIF 0x20
1988 #define _RC1IF 0x20
1989 #define _ADIF 0x40
1990 #define _PSPIF 0x80
1992 //==============================================================================
1995 //==============================================================================
1996 // IPR1 Bits
1998 extern __at(0x0F9F) __sfr IPR1;
2000 typedef union
2002 struct
2004 unsigned TMR1IP : 1;
2005 unsigned TMR2IP : 1;
2006 unsigned CCP1IP : 1;
2007 unsigned SSPIP : 1;
2008 unsigned TXIP : 1;
2009 unsigned RCIP : 1;
2010 unsigned ADIP : 1;
2011 unsigned PSPIP : 1;
2014 struct
2016 unsigned : 1;
2017 unsigned : 1;
2018 unsigned : 1;
2019 unsigned : 1;
2020 unsigned TX1IP : 1;
2021 unsigned RC1IP : 1;
2022 unsigned : 1;
2023 unsigned : 1;
2025 } __IPR1bits_t;
2027 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2029 #define _TMR1IP 0x01
2030 #define _TMR2IP 0x02
2031 #define _CCP1IP 0x04
2032 #define _SSPIP 0x08
2033 #define _TXIP 0x10
2034 #define _TX1IP 0x10
2035 #define _RCIP 0x20
2036 #define _RC1IP 0x20
2037 #define _ADIP 0x40
2038 #define _PSPIP 0x80
2040 //==============================================================================
2043 //==============================================================================
2044 // PIE2 Bits
2046 extern __at(0x0FA0) __sfr PIE2;
2048 typedef struct
2050 unsigned CCP2IE : 1;
2051 unsigned TMR3IE : 1;
2052 unsigned LVDIE : 1;
2053 unsigned BCLIE : 1;
2054 unsigned EEIE : 1;
2055 unsigned : 1;
2056 unsigned CMIE : 1;
2057 unsigned : 1;
2058 } __PIE2bits_t;
2060 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2062 #define _CCP2IE 0x01
2063 #define _TMR3IE 0x02
2064 #define _LVDIE 0x04
2065 #define _BCLIE 0x08
2066 #define _EEIE 0x10
2067 #define _CMIE 0x40
2069 //==============================================================================
2072 //==============================================================================
2073 // PIR2 Bits
2075 extern __at(0x0FA1) __sfr PIR2;
2077 typedef struct
2079 unsigned CCP2IF : 1;
2080 unsigned TMR3IF : 1;
2081 unsigned LVDIF : 1;
2082 unsigned BCLIF : 1;
2083 unsigned EEIF : 1;
2084 unsigned : 1;
2085 unsigned CMIF : 1;
2086 unsigned : 1;
2087 } __PIR2bits_t;
2089 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2091 #define _CCP2IF 0x01
2092 #define _TMR3IF 0x02
2093 #define _LVDIF 0x04
2094 #define _BCLIF 0x08
2095 #define _EEIF 0x10
2096 #define _CMIF 0x40
2098 //==============================================================================
2101 //==============================================================================
2102 // IPR2 Bits
2104 extern __at(0x0FA2) __sfr IPR2;
2106 typedef struct
2108 unsigned CCP2IP : 1;
2109 unsigned TMR3IP : 1;
2110 unsigned LVDIP : 1;
2111 unsigned BCLIP : 1;
2112 unsigned EEIP : 1;
2113 unsigned : 1;
2114 unsigned CMIP : 1;
2115 unsigned : 1;
2116 } __IPR2bits_t;
2118 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
2120 #define _CCP2IP 0x01
2121 #define _TMR3IP 0x02
2122 #define _LVDIP 0x04
2123 #define _BCLIP 0x08
2124 #define _EEIP 0x10
2125 #define _CMIP 0x40
2127 //==============================================================================
2130 //==============================================================================
2131 // PIE3 Bits
2133 extern __at(0x0FA3) __sfr PIE3;
2135 typedef struct
2137 unsigned CCP3IE : 1;
2138 unsigned CCP4IE : 1;
2139 unsigned CCP5IE : 1;
2140 unsigned TMR4IE : 1;
2141 unsigned TX2IE : 1;
2142 unsigned RC2IE : 1;
2143 unsigned : 1;
2144 unsigned : 1;
2145 } __PIE3bits_t;
2147 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
2149 #define _CCP3IE 0x01
2150 #define _CCP4IE 0x02
2151 #define _CCP5IE 0x04
2152 #define _TMR4IE 0x08
2153 #define _TX2IE 0x10
2154 #define _RC2IE 0x20
2156 //==============================================================================
2159 //==============================================================================
2160 // PIR3 Bits
2162 extern __at(0x0FA4) __sfr PIR3;
2164 typedef struct
2166 unsigned CCP3IF : 1;
2167 unsigned CCP4IF : 1;
2168 unsigned CCP5IF : 1;
2169 unsigned TMR4IF : 1;
2170 unsigned TX2IF : 1;
2171 unsigned RC2IF : 1;
2172 unsigned : 1;
2173 unsigned : 1;
2174 } __PIR3bits_t;
2176 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
2178 #define _CCP3IF 0x01
2179 #define _CCP4IF 0x02
2180 #define _CCP5IF 0x04
2181 #define _TMR4IF 0x08
2182 #define _TX2IF 0x10
2183 #define _RC2IF 0x20
2185 //==============================================================================
2188 //==============================================================================
2189 // IPR3 Bits
2191 extern __at(0x0FA5) __sfr IPR3;
2193 typedef struct
2195 unsigned CCP3IP : 1;
2196 unsigned CCP4IP : 1;
2197 unsigned CCP5IP : 1;
2198 unsigned TMR4IP : 1;
2199 unsigned TX2IP : 1;
2200 unsigned RC2IP : 1;
2201 unsigned : 1;
2202 unsigned : 1;
2203 } __IPR3bits_t;
2205 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
2207 #define _CCP3IP 0x01
2208 #define _CCP4IP 0x02
2209 #define _CCP5IP 0x04
2210 #define _TMR4IP 0x08
2211 #define _TX2IP 0x10
2212 #define _RC2IP 0x20
2214 //==============================================================================
2217 //==============================================================================
2218 // EECON1 Bits
2220 extern __at(0x0FA6) __sfr EECON1;
2222 typedef union
2224 struct
2226 unsigned RD : 1;
2227 unsigned WR : 1;
2228 unsigned WREN : 1;
2229 unsigned WRERR : 1;
2230 unsigned FREE : 1;
2231 unsigned : 1;
2232 unsigned CFGS : 1;
2233 unsigned EEPGD : 1;
2236 struct
2238 unsigned : 1;
2239 unsigned : 1;
2240 unsigned : 1;
2241 unsigned : 1;
2242 unsigned : 1;
2243 unsigned : 1;
2244 unsigned EEFS : 1;
2245 unsigned : 1;
2247 } __EECON1bits_t;
2249 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
2251 #define _RD 0x01
2252 #define _WR 0x02
2253 #define _WREN 0x04
2254 #define _WRERR 0x08
2255 #define _FREE 0x10
2256 #define _CFGS 0x40
2257 #define _EEFS 0x40
2258 #define _EEPGD 0x80
2260 //==============================================================================
2262 extern __at(0x0FA7) __sfr EECON2;
2263 extern __at(0x0FA8) __sfr EEDATA;
2264 extern __at(0x0FA9) __sfr EEADR;
2265 extern __at(0x0FAA) __sfr EEADRH;
2267 //==============================================================================
2268 // RCSTA Bits
2270 extern __at(0x0FAB) __sfr RCSTA;
2272 typedef union
2274 struct
2276 unsigned RX9D : 1;
2277 unsigned OERR : 1;
2278 unsigned FERR : 1;
2279 unsigned ADDEN : 1;
2280 unsigned CREN : 1;
2281 unsigned SREN : 1;
2282 unsigned RX9 : 1;
2283 unsigned SPEN : 1;
2286 struct
2288 unsigned RCD8 : 1;
2289 unsigned OERR1 : 1;
2290 unsigned FERR1 : 1;
2291 unsigned ADEN : 1;
2292 unsigned CREN1 : 1;
2293 unsigned SREN1 : 1;
2294 unsigned RC9 : 1;
2295 unsigned SPEN1 : 1;
2298 struct
2300 unsigned RX9D1 : 1;
2301 unsigned : 1;
2302 unsigned : 1;
2303 unsigned ADDEN1 : 1;
2304 unsigned : 1;
2305 unsigned : 1;
2306 unsigned NOT_RC8 : 1;
2307 unsigned : 1;
2310 struct
2312 unsigned : 1;
2313 unsigned : 1;
2314 unsigned : 1;
2315 unsigned : 1;
2316 unsigned : 1;
2317 unsigned : 1;
2318 unsigned RC8_9 : 1;
2319 unsigned : 1;
2322 struct
2324 unsigned : 1;
2325 unsigned : 1;
2326 unsigned : 1;
2327 unsigned : 1;
2328 unsigned : 1;
2329 unsigned : 1;
2330 unsigned RX91 : 1;
2331 unsigned : 1;
2333 } __RCSTAbits_t;
2335 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
2337 #define _RX9D 0x01
2338 #define _RCD8 0x01
2339 #define _RX9D1 0x01
2340 #define _OERR 0x02
2341 #define _OERR1 0x02
2342 #define _FERR 0x04
2343 #define _FERR1 0x04
2344 #define _ADDEN 0x08
2345 #define _ADEN 0x08
2346 #define _ADDEN1 0x08
2347 #define _CREN 0x10
2348 #define _CREN1 0x10
2349 #define _SREN 0x20
2350 #define _SREN1 0x20
2351 #define _RX9 0x40
2352 #define _RC9 0x40
2353 #define _NOT_RC8 0x40
2354 #define _RC8_9 0x40
2355 #define _RX91 0x40
2356 #define _SPEN 0x80
2357 #define _SPEN1 0x80
2359 //==============================================================================
2362 //==============================================================================
2363 // RCSTA1 Bits
2365 extern __at(0x0FAB) __sfr RCSTA1;
2367 typedef union
2369 struct
2371 unsigned RX9D : 1;
2372 unsigned OERR : 1;
2373 unsigned FERR : 1;
2374 unsigned ADDEN : 1;
2375 unsigned CREN : 1;
2376 unsigned SREN : 1;
2377 unsigned RX9 : 1;
2378 unsigned SPEN : 1;
2381 struct
2383 unsigned RCD8 : 1;
2384 unsigned OERR1 : 1;
2385 unsigned FERR1 : 1;
2386 unsigned ADEN : 1;
2387 unsigned CREN1 : 1;
2388 unsigned SREN1 : 1;
2389 unsigned RC9 : 1;
2390 unsigned SPEN1 : 1;
2393 struct
2395 unsigned RX9D1 : 1;
2396 unsigned : 1;
2397 unsigned : 1;
2398 unsigned ADDEN1 : 1;
2399 unsigned : 1;
2400 unsigned : 1;
2401 unsigned NOT_RC8 : 1;
2402 unsigned : 1;
2405 struct
2407 unsigned : 1;
2408 unsigned : 1;
2409 unsigned : 1;
2410 unsigned : 1;
2411 unsigned : 1;
2412 unsigned : 1;
2413 unsigned RC8_9 : 1;
2414 unsigned : 1;
2417 struct
2419 unsigned : 1;
2420 unsigned : 1;
2421 unsigned : 1;
2422 unsigned : 1;
2423 unsigned : 1;
2424 unsigned : 1;
2425 unsigned RX91 : 1;
2426 unsigned : 1;
2428 } __RCSTA1bits_t;
2430 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
2432 #define _RCSTA1_RX9D 0x01
2433 #define _RCSTA1_RCD8 0x01
2434 #define _RCSTA1_RX9D1 0x01
2435 #define _RCSTA1_OERR 0x02
2436 #define _RCSTA1_OERR1 0x02
2437 #define _RCSTA1_FERR 0x04
2438 #define _RCSTA1_FERR1 0x04
2439 #define _RCSTA1_ADDEN 0x08
2440 #define _RCSTA1_ADEN 0x08
2441 #define _RCSTA1_ADDEN1 0x08
2442 #define _RCSTA1_CREN 0x10
2443 #define _RCSTA1_CREN1 0x10
2444 #define _RCSTA1_SREN 0x20
2445 #define _RCSTA1_SREN1 0x20
2446 #define _RCSTA1_RX9 0x40
2447 #define _RCSTA1_RC9 0x40
2448 #define _RCSTA1_NOT_RC8 0x40
2449 #define _RCSTA1_RC8_9 0x40
2450 #define _RCSTA1_RX91 0x40
2451 #define _RCSTA1_SPEN 0x80
2452 #define _RCSTA1_SPEN1 0x80
2454 //==============================================================================
2457 //==============================================================================
2458 // TXSTA Bits
2460 extern __at(0x0FAC) __sfr TXSTA;
2462 typedef union
2464 struct
2466 unsigned TX9D : 1;
2467 unsigned TRMT : 1;
2468 unsigned BRGH : 1;
2469 unsigned SENDB1 : 1;
2470 unsigned SYNC : 1;
2471 unsigned TXEN : 1;
2472 unsigned TX9 : 1;
2473 unsigned CSRC : 1;
2476 struct
2478 unsigned TXD8 : 1;
2479 unsigned TRMT1 : 1;
2480 unsigned BRGH1 : 1;
2481 unsigned : 1;
2482 unsigned SYNC1 : 1;
2483 unsigned TXEN1 : 1;
2484 unsigned TX8_9 : 1;
2485 unsigned CSRC1 : 1;
2488 struct
2490 unsigned TX9D1 : 1;
2491 unsigned : 1;
2492 unsigned : 1;
2493 unsigned : 1;
2494 unsigned : 1;
2495 unsigned : 1;
2496 unsigned NOT_TX8 : 1;
2497 unsigned : 1;
2500 struct
2502 unsigned : 1;
2503 unsigned : 1;
2504 unsigned : 1;
2505 unsigned : 1;
2506 unsigned : 1;
2507 unsigned : 1;
2508 unsigned TX91 : 1;
2509 unsigned : 1;
2511 } __TXSTAbits_t;
2513 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
2515 #define _TX9D 0x01
2516 #define _TXD8 0x01
2517 #define _TX9D1 0x01
2518 #define _TRMT 0x02
2519 #define _TRMT1 0x02
2520 #define _BRGH 0x04
2521 #define _BRGH1 0x04
2522 #define _SENDB1 0x08
2523 #define _SYNC 0x10
2524 #define _SYNC1 0x10
2525 #define _TXEN 0x20
2526 #define _TXEN1 0x20
2527 #define _TX9 0x40
2528 #define _TX8_9 0x40
2529 #define _NOT_TX8 0x40
2530 #define _TX91 0x40
2531 #define _CSRC 0x80
2532 #define _CSRC1 0x80
2534 //==============================================================================
2537 //==============================================================================
2538 // TXSTA1 Bits
2540 extern __at(0x0FAC) __sfr TXSTA1;
2542 typedef union
2544 struct
2546 unsigned TX9D : 1;
2547 unsigned TRMT : 1;
2548 unsigned BRGH : 1;
2549 unsigned SENDB1 : 1;
2550 unsigned SYNC : 1;
2551 unsigned TXEN : 1;
2552 unsigned TX9 : 1;
2553 unsigned CSRC : 1;
2556 struct
2558 unsigned TXD8 : 1;
2559 unsigned TRMT1 : 1;
2560 unsigned BRGH1 : 1;
2561 unsigned : 1;
2562 unsigned SYNC1 : 1;
2563 unsigned TXEN1 : 1;
2564 unsigned TX8_9 : 1;
2565 unsigned CSRC1 : 1;
2568 struct
2570 unsigned TX9D1 : 1;
2571 unsigned : 1;
2572 unsigned : 1;
2573 unsigned : 1;
2574 unsigned : 1;
2575 unsigned : 1;
2576 unsigned NOT_TX8 : 1;
2577 unsigned : 1;
2580 struct
2582 unsigned : 1;
2583 unsigned : 1;
2584 unsigned : 1;
2585 unsigned : 1;
2586 unsigned : 1;
2587 unsigned : 1;
2588 unsigned TX91 : 1;
2589 unsigned : 1;
2591 } __TXSTA1bits_t;
2593 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
2595 #define _TXSTA1_TX9D 0x01
2596 #define _TXSTA1_TXD8 0x01
2597 #define _TXSTA1_TX9D1 0x01
2598 #define _TXSTA1_TRMT 0x02
2599 #define _TXSTA1_TRMT1 0x02
2600 #define _TXSTA1_BRGH 0x04
2601 #define _TXSTA1_BRGH1 0x04
2602 #define _TXSTA1_SENDB1 0x08
2603 #define _TXSTA1_SYNC 0x10
2604 #define _TXSTA1_SYNC1 0x10
2605 #define _TXSTA1_TXEN 0x20
2606 #define _TXSTA1_TXEN1 0x20
2607 #define _TXSTA1_TX9 0x40
2608 #define _TXSTA1_TX8_9 0x40
2609 #define _TXSTA1_NOT_TX8 0x40
2610 #define _TXSTA1_TX91 0x40
2611 #define _TXSTA1_CSRC 0x80
2612 #define _TXSTA1_CSRC1 0x80
2614 //==============================================================================
2616 extern __at(0x0FAD) __sfr TXREG;
2617 extern __at(0x0FAD) __sfr TXREG1;
2618 extern __at(0x0FAE) __sfr RCREG;
2619 extern __at(0x0FAE) __sfr RCREG1;
2620 extern __at(0x0FAF) __sfr SPBRG;
2621 extern __at(0x0FAF) __sfr SPBRG1;
2623 //==============================================================================
2624 // PSPCON Bits
2626 extern __at(0x0FB0) __sfr PSPCON;
2628 typedef struct
2630 unsigned : 1;
2631 unsigned : 1;
2632 unsigned : 1;
2633 unsigned : 1;
2634 unsigned PSPMODE : 1;
2635 unsigned IBOV : 1;
2636 unsigned OBF : 1;
2637 unsigned IBF : 1;
2638 } __PSPCONbits_t;
2640 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
2642 #define _PSPMODE 0x10
2643 #define _IBOV 0x20
2644 #define _OBF 0x40
2645 #define _IBF 0x80
2647 //==============================================================================
2650 //==============================================================================
2651 // T3CON Bits
2653 extern __at(0x0FB1) __sfr T3CON;
2655 typedef union
2657 struct
2659 unsigned TMR3ON : 1;
2660 unsigned TMR3CS : 1;
2661 unsigned NOT_T3SYNC : 1;
2662 unsigned T3CCP1 : 1;
2663 unsigned T3CKPS0 : 1;
2664 unsigned T3CKPS1 : 1;
2665 unsigned T3CCP2 : 1;
2666 unsigned RD16 : 1;
2669 struct
2671 unsigned : 1;
2672 unsigned : 1;
2673 unsigned T3SYNC : 1;
2674 unsigned : 1;
2675 unsigned : 1;
2676 unsigned : 1;
2677 unsigned : 1;
2678 unsigned : 1;
2681 struct
2683 unsigned : 1;
2684 unsigned : 1;
2685 unsigned T3INSYNC : 1;
2686 unsigned : 1;
2687 unsigned : 1;
2688 unsigned : 1;
2689 unsigned : 1;
2690 unsigned : 1;
2693 struct
2695 unsigned : 1;
2696 unsigned : 1;
2697 unsigned T3NSYNC : 1;
2698 unsigned : 1;
2699 unsigned : 1;
2700 unsigned : 1;
2701 unsigned : 1;
2702 unsigned : 1;
2705 struct
2707 unsigned : 4;
2708 unsigned T3CKPS : 2;
2709 unsigned : 2;
2711 } __T3CONbits_t;
2713 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
2715 #define _T3CON_TMR3ON 0x01
2716 #define _T3CON_TMR3CS 0x02
2717 #define _T3CON_NOT_T3SYNC 0x04
2718 #define _T3CON_T3SYNC 0x04
2719 #define _T3CON_T3INSYNC 0x04
2720 #define _T3CON_T3NSYNC 0x04
2721 #define _T3CON_T3CCP1 0x08
2722 #define _T3CON_T3CKPS0 0x10
2723 #define _T3CON_T3CKPS1 0x20
2724 #define _T3CON_T3CCP2 0x40
2725 #define _T3CON_RD16 0x80
2727 //==============================================================================
2729 extern __at(0x0FB2) __sfr TMR3;
2730 extern __at(0x0FB2) __sfr TMR3L;
2731 extern __at(0x0FB3) __sfr TMR3H;
2733 //==============================================================================
2734 // CMCON Bits
2736 extern __at(0x0FB4) __sfr CMCON;
2738 typedef union
2740 struct
2742 unsigned CM0 : 1;
2743 unsigned CM1 : 1;
2744 unsigned CM2 : 1;
2745 unsigned CIS : 1;
2746 unsigned C1INV : 1;
2747 unsigned C2INV : 1;
2748 unsigned C1OUT : 1;
2749 unsigned C2OUT : 1;
2752 struct
2754 unsigned CM : 3;
2755 unsigned : 5;
2757 } __CMCONbits_t;
2759 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
2761 #define _CM0 0x01
2762 #define _CM1 0x02
2763 #define _CM2 0x04
2764 #define _CIS 0x08
2765 #define _C1INV 0x10
2766 #define _C2INV 0x20
2767 #define _C1OUT 0x40
2768 #define _C2OUT 0x80
2770 //==============================================================================
2773 //==============================================================================
2774 // CVRCON Bits
2776 extern __at(0x0FB5) __sfr CVRCON;
2778 typedef union
2780 struct
2782 unsigned CVR0 : 1;
2783 unsigned CVR1 : 1;
2784 unsigned CVR2 : 1;
2785 unsigned CVR3 : 1;
2786 unsigned CVRSS : 1;
2787 unsigned CVRR : 1;
2788 unsigned CVROE : 1;
2789 unsigned CVREN : 1;
2792 struct
2794 unsigned : 1;
2795 unsigned : 1;
2796 unsigned : 1;
2797 unsigned : 1;
2798 unsigned CVREF : 1;
2799 unsigned : 1;
2800 unsigned : 1;
2801 unsigned : 1;
2804 struct
2806 unsigned CVR : 4;
2807 unsigned : 4;
2809 } __CVRCONbits_t;
2811 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
2813 #define _CVR0 0x01
2814 #define _CVR1 0x02
2815 #define _CVR2 0x04
2816 #define _CVR3 0x08
2817 #define _CVRSS 0x10
2818 #define _CVREF 0x10
2819 #define _CVRR 0x20
2820 #define _CVROE 0x40
2821 #define _CVREN 0x80
2823 //==============================================================================
2826 //==============================================================================
2827 // CCP3CON Bits
2829 extern __at(0x0FB7) __sfr CCP3CON;
2831 typedef union
2833 struct
2835 unsigned CCP3M0 : 1;
2836 unsigned CCP3M1 : 1;
2837 unsigned CCP3M2 : 1;
2838 unsigned CCP3M3 : 1;
2839 unsigned DC3B0 : 1;
2840 unsigned DC3B1 : 1;
2841 unsigned : 1;
2842 unsigned : 1;
2845 struct
2847 unsigned : 1;
2848 unsigned : 1;
2849 unsigned : 1;
2850 unsigned : 1;
2851 unsigned DCCP3Y : 1;
2852 unsigned DCCP3X : 1;
2853 unsigned : 1;
2854 unsigned : 1;
2857 struct
2859 unsigned CCP3M : 4;
2860 unsigned : 4;
2863 struct
2865 unsigned : 4;
2866 unsigned DC3B : 2;
2867 unsigned : 2;
2869 } __CCP3CONbits_t;
2871 extern __at(0x0FB7) volatile __CCP3CONbits_t CCP3CONbits;
2873 #define _CCP3M0 0x01
2874 #define _CCP3M1 0x02
2875 #define _CCP3M2 0x04
2876 #define _CCP3M3 0x08
2877 #define _DC3B0 0x10
2878 #define _DCCP3Y 0x10
2879 #define _DC3B1 0x20
2880 #define _DCCP3X 0x20
2882 //==============================================================================
2884 extern __at(0x0FB8) __sfr CCPR3;
2885 extern __at(0x0FB8) __sfr CCPR3L;
2886 extern __at(0x0FB9) __sfr CCPR3H;
2888 //==============================================================================
2889 // CCP2CON Bits
2891 extern __at(0x0FBA) __sfr CCP2CON;
2893 typedef union
2895 struct
2897 unsigned CCP2M0 : 1;
2898 unsigned CCP2M1 : 1;
2899 unsigned CCP2M2 : 1;
2900 unsigned CCP2M3 : 1;
2901 unsigned DC2B0 : 1;
2902 unsigned DC2B1 : 1;
2903 unsigned : 1;
2904 unsigned : 1;
2907 struct
2909 unsigned : 1;
2910 unsigned : 1;
2911 unsigned : 1;
2912 unsigned : 1;
2913 unsigned CCP2Y : 1;
2914 unsigned CCP2X : 1;
2915 unsigned : 1;
2916 unsigned : 1;
2919 struct
2921 unsigned : 1;
2922 unsigned : 1;
2923 unsigned : 1;
2924 unsigned : 1;
2925 unsigned DCCP2Y : 1;
2926 unsigned DCCP2X : 1;
2927 unsigned : 1;
2928 unsigned : 1;
2931 struct
2933 unsigned CCP2M : 4;
2934 unsigned : 4;
2937 struct
2939 unsigned : 4;
2940 unsigned DC2B : 2;
2941 unsigned : 2;
2943 } __CCP2CONbits_t;
2945 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
2947 #define _CCP2M0 0x01
2948 #define _CCP2M1 0x02
2949 #define _CCP2M2 0x04
2950 #define _CCP2M3 0x08
2951 #define _DC2B0 0x10
2952 #define _CCP2Y 0x10
2953 #define _DCCP2Y 0x10
2954 #define _DC2B1 0x20
2955 #define _CCP2X 0x20
2956 #define _DCCP2X 0x20
2958 //==============================================================================
2960 extern __at(0x0FBB) __sfr CCPR2;
2961 extern __at(0x0FBB) __sfr CCPR2L;
2962 extern __at(0x0FBC) __sfr CCPR2H;
2964 //==============================================================================
2965 // CCP1CON Bits
2967 extern __at(0x0FBD) __sfr CCP1CON;
2969 typedef union
2971 struct
2973 unsigned CCP1M0 : 1;
2974 unsigned CCP1M1 : 1;
2975 unsigned CCP1M2 : 1;
2976 unsigned CCP1M3 : 1;
2977 unsigned DC1B0 : 1;
2978 unsigned DC1B1 : 1;
2979 unsigned : 1;
2980 unsigned : 1;
2983 struct
2985 unsigned : 1;
2986 unsigned : 1;
2987 unsigned : 1;
2988 unsigned : 1;
2989 unsigned CCP1Y : 1;
2990 unsigned CCP1X : 1;
2991 unsigned : 1;
2992 unsigned : 1;
2995 struct
2997 unsigned : 1;
2998 unsigned : 1;
2999 unsigned : 1;
3000 unsigned : 1;
3001 unsigned DCCP1Y : 1;
3002 unsigned DCCP1X : 1;
3003 unsigned : 1;
3004 unsigned : 1;
3007 struct
3009 unsigned CCP1M : 4;
3010 unsigned : 4;
3013 struct
3015 unsigned : 4;
3016 unsigned DC1B : 2;
3017 unsigned : 2;
3019 } __CCP1CONbits_t;
3021 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
3023 #define _CCP1M0 0x01
3024 #define _CCP1M1 0x02
3025 #define _CCP1M2 0x04
3026 #define _CCP1M3 0x08
3027 #define _DC1B0 0x10
3028 #define _CCP1Y 0x10
3029 #define _DCCP1Y 0x10
3030 #define _DC1B1 0x20
3031 #define _CCP1X 0x20
3032 #define _DCCP1X 0x20
3034 //==============================================================================
3036 extern __at(0x0FBE) __sfr CCPR1;
3037 extern __at(0x0FBE) __sfr CCPR1L;
3038 extern __at(0x0FBF) __sfr CCPR1H;
3040 //==============================================================================
3041 // ADCON2 Bits
3043 extern __at(0x0FC0) __sfr ADCON2;
3045 typedef union
3047 struct
3049 unsigned ADCS0 : 1;
3050 unsigned ADCS1 : 1;
3051 unsigned ADCS2 : 1;
3052 unsigned : 1;
3053 unsigned : 1;
3054 unsigned : 1;
3055 unsigned : 1;
3056 unsigned ADFM : 1;
3059 struct
3061 unsigned ADCS : 3;
3062 unsigned : 5;
3064 } __ADCON2bits_t;
3066 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
3068 #define _ADCS0 0x01
3069 #define _ADCS1 0x02
3070 #define _ADCS2 0x04
3071 #define _ADFM 0x80
3073 //==============================================================================
3076 //==============================================================================
3077 // ADCON1 Bits
3079 extern __at(0x0FC1) __sfr ADCON1;
3081 typedef union
3083 struct
3085 unsigned PCFG0 : 1;
3086 unsigned PCFG1 : 1;
3087 unsigned PCFG2 : 1;
3088 unsigned PCFG3 : 1;
3089 unsigned VCFG0 : 1;
3090 unsigned VCFG1 : 1;
3091 unsigned : 1;
3092 unsigned : 1;
3095 struct
3097 unsigned PCFG : 4;
3098 unsigned : 4;
3101 struct
3103 unsigned : 4;
3104 unsigned VCFG : 2;
3105 unsigned : 2;
3107 } __ADCON1bits_t;
3109 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
3111 #define _PCFG0 0x01
3112 #define _PCFG1 0x02
3113 #define _PCFG2 0x04
3114 #define _PCFG3 0x08
3115 #define _VCFG0 0x10
3116 #define _VCFG1 0x20
3118 //==============================================================================
3121 //==============================================================================
3122 // ADCON0 Bits
3124 extern __at(0x0FC2) __sfr ADCON0;
3126 typedef union
3128 struct
3130 unsigned ADON : 1;
3131 unsigned GO_NOT_DONE : 1;
3132 unsigned CHS0 : 1;
3133 unsigned CHS1 : 1;
3134 unsigned CHS2 : 1;
3135 unsigned CHS3 : 1;
3136 unsigned : 1;
3137 unsigned : 1;
3140 struct
3142 unsigned : 1;
3143 unsigned DONE : 1;
3144 unsigned : 1;
3145 unsigned : 1;
3146 unsigned : 1;
3147 unsigned : 1;
3148 unsigned : 1;
3149 unsigned : 1;
3152 struct
3154 unsigned : 1;
3155 unsigned GO_DONE : 1;
3156 unsigned : 1;
3157 unsigned : 1;
3158 unsigned : 1;
3159 unsigned : 1;
3160 unsigned : 1;
3161 unsigned : 1;
3164 struct
3166 unsigned : 1;
3167 unsigned GO : 1;
3168 unsigned : 1;
3169 unsigned : 1;
3170 unsigned : 1;
3171 unsigned : 1;
3172 unsigned : 1;
3173 unsigned : 1;
3176 struct
3178 unsigned : 1;
3179 unsigned NOT_DONE : 1;
3180 unsigned : 1;
3181 unsigned : 1;
3182 unsigned : 1;
3183 unsigned : 1;
3184 unsigned : 1;
3185 unsigned : 1;
3188 struct
3190 unsigned : 1;
3191 unsigned GODONE : 1;
3192 unsigned : 1;
3193 unsigned : 1;
3194 unsigned : 1;
3195 unsigned : 1;
3196 unsigned : 1;
3197 unsigned : 1;
3200 struct
3202 unsigned : 2;
3203 unsigned CHS : 4;
3204 unsigned : 2;
3206 } __ADCON0bits_t;
3208 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
3210 #define _ADON 0x01
3211 #define _GO_NOT_DONE 0x02
3212 #define _DONE 0x02
3213 #define _GO_DONE 0x02
3214 #define _GO 0x02
3215 #define _NOT_DONE 0x02
3216 #define _GODONE 0x02
3217 #define _CHS0 0x04
3218 #define _CHS1 0x08
3219 #define _CHS2 0x10
3220 #define _CHS3 0x20
3222 //==============================================================================
3224 extern __at(0x0FC3) __sfr ADRES;
3225 extern __at(0x0FC3) __sfr ADRESL;
3226 extern __at(0x0FC4) __sfr ADRESH;
3228 //==============================================================================
3229 // SSPCON2 Bits
3231 extern __at(0x0FC5) __sfr SSPCON2;
3233 typedef struct
3235 unsigned SEN : 1;
3236 unsigned RSEN : 1;
3237 unsigned PEN : 1;
3238 unsigned RCEN : 1;
3239 unsigned ACKEN : 1;
3240 unsigned ACKDT : 1;
3241 unsigned ACKSTAT : 1;
3242 unsigned GCEN : 1;
3243 } __SSPCON2bits_t;
3245 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
3247 #define _SEN 0x01
3248 #define _RSEN 0x02
3249 #define _PEN 0x04
3250 #define _RCEN 0x08
3251 #define _ACKEN 0x10
3252 #define _ACKDT 0x20
3253 #define _ACKSTAT 0x40
3254 #define _GCEN 0x80
3256 //==============================================================================
3259 //==============================================================================
3260 // SSPCON1 Bits
3262 extern __at(0x0FC6) __sfr SSPCON1;
3264 typedef union
3266 struct
3268 unsigned SSPM0 : 1;
3269 unsigned SSPM1 : 1;
3270 unsigned SSPM2 : 1;
3271 unsigned SSPM3 : 1;
3272 unsigned CKP : 1;
3273 unsigned SSPEN : 1;
3274 unsigned SSPOV : 1;
3275 unsigned WCOL : 1;
3278 struct
3280 unsigned SSPM : 4;
3281 unsigned : 4;
3283 } __SSPCON1bits_t;
3285 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
3287 #define _SSPM0 0x01
3288 #define _SSPM1 0x02
3289 #define _SSPM2 0x04
3290 #define _SSPM3 0x08
3291 #define _CKP 0x10
3292 #define _SSPEN 0x20
3293 #define _SSPOV 0x40
3294 #define _WCOL 0x80
3296 //==============================================================================
3299 //==============================================================================
3300 // SSPSTAT Bits
3302 extern __at(0x0FC7) __sfr SSPSTAT;
3304 typedef union
3306 struct
3308 unsigned BF : 1;
3309 unsigned UA : 1;
3310 unsigned R_NOT_W : 1;
3311 unsigned S : 1;
3312 unsigned P : 1;
3313 unsigned D_NOT_A : 1;
3314 unsigned CKE : 1;
3315 unsigned SMP : 1;
3318 struct
3320 unsigned : 1;
3321 unsigned : 1;
3322 unsigned R_W : 1;
3323 unsigned I2C_START : 1;
3324 unsigned I2C_STOP : 1;
3325 unsigned D_A : 1;
3326 unsigned : 1;
3327 unsigned : 1;
3330 struct
3332 unsigned : 1;
3333 unsigned : 1;
3334 unsigned I2C_READ : 1;
3335 unsigned : 1;
3336 unsigned : 1;
3337 unsigned I2C_DAT : 1;
3338 unsigned : 1;
3339 unsigned : 1;
3342 struct
3344 unsigned : 1;
3345 unsigned : 1;
3346 unsigned NOT_W : 1;
3347 unsigned : 1;
3348 unsigned : 1;
3349 unsigned NOT_A : 1;
3350 unsigned : 1;
3351 unsigned : 1;
3354 struct
3356 unsigned : 1;
3357 unsigned : 1;
3358 unsigned NOT_WRITE : 1;
3359 unsigned : 1;
3360 unsigned : 1;
3361 unsigned NOT_ADDRESS : 1;
3362 unsigned : 1;
3363 unsigned : 1;
3366 struct
3368 unsigned : 1;
3369 unsigned : 1;
3370 unsigned READ_WRITE : 1;
3371 unsigned : 1;
3372 unsigned : 1;
3373 unsigned DATA_ADDRESS : 1;
3374 unsigned : 1;
3375 unsigned : 1;
3378 struct
3380 unsigned : 1;
3381 unsigned : 1;
3382 unsigned R : 1;
3383 unsigned : 1;
3384 unsigned : 1;
3385 unsigned D : 1;
3386 unsigned : 1;
3387 unsigned : 1;
3389 } __SSPSTATbits_t;
3391 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
3393 #define _BF 0x01
3394 #define _UA 0x02
3395 #define _R_NOT_W 0x04
3396 #define _R_W 0x04
3397 #define _I2C_READ 0x04
3398 #define _NOT_W 0x04
3399 #define _NOT_WRITE 0x04
3400 #define _READ_WRITE 0x04
3401 #define _R 0x04
3402 #define _S 0x08
3403 #define _I2C_START 0x08
3404 #define _P 0x10
3405 #define _I2C_STOP 0x10
3406 #define _D_NOT_A 0x20
3407 #define _D_A 0x20
3408 #define _I2C_DAT 0x20
3409 #define _NOT_A 0x20
3410 #define _NOT_ADDRESS 0x20
3411 #define _DATA_ADDRESS 0x20
3412 #define _D 0x20
3413 #define _CKE 0x40
3414 #define _SMP 0x80
3416 //==============================================================================
3418 extern __at(0x0FC8) __sfr SSPADD;
3419 extern __at(0x0FC9) __sfr SSPBUF;
3421 //==============================================================================
3422 // T2CON Bits
3424 extern __at(0x0FCA) __sfr T2CON;
3426 typedef union
3428 struct
3430 unsigned T2CKPS0 : 1;
3431 unsigned T2CKPS1 : 1;
3432 unsigned TMR2ON : 1;
3433 unsigned T2OUTPS0 : 1;
3434 unsigned T2OUTPS1 : 1;
3435 unsigned T2OUTPS2 : 1;
3436 unsigned T2OUTPS3 : 1;
3437 unsigned : 1;
3440 struct
3442 unsigned T2CKPS : 2;
3443 unsigned : 6;
3446 struct
3448 unsigned : 3;
3449 unsigned T2OUTPS : 4;
3450 unsigned : 1;
3452 } __T2CONbits_t;
3454 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
3456 #define _T2CKPS0 0x01
3457 #define _T2CKPS1 0x02
3458 #define _TMR2ON 0x04
3459 #define _T2OUTPS0 0x08
3460 #define _T2OUTPS1 0x10
3461 #define _T2OUTPS2 0x20
3462 #define _T2OUTPS3 0x40
3464 //==============================================================================
3466 extern __at(0x0FCB) __sfr PR2;
3467 extern __at(0x0FCC) __sfr TMR2;
3469 //==============================================================================
3470 // T1CON Bits
3472 extern __at(0x0FCD) __sfr T1CON;
3474 typedef union
3476 struct
3478 unsigned TMR1ON : 1;
3479 unsigned TMR1CS : 1;
3480 unsigned NOT_T1SYNC : 1;
3481 unsigned T1OSCEN : 1;
3482 unsigned T1CKPS0 : 1;
3483 unsigned T1CKPS1 : 1;
3484 unsigned : 1;
3485 unsigned RD16 : 1;
3488 struct
3490 unsigned : 1;
3491 unsigned : 1;
3492 unsigned T1SYNC : 1;
3493 unsigned : 1;
3494 unsigned : 1;
3495 unsigned : 1;
3496 unsigned : 1;
3497 unsigned : 1;
3500 struct
3502 unsigned : 1;
3503 unsigned : 1;
3504 unsigned T1INSYNC : 1;
3505 unsigned : 1;
3506 unsigned : 1;
3507 unsigned : 1;
3508 unsigned : 1;
3509 unsigned : 1;
3512 struct
3514 unsigned : 4;
3515 unsigned T1CKPS : 2;
3516 unsigned : 2;
3518 } __T1CONbits_t;
3520 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
3522 #define _TMR1ON 0x01
3523 #define _TMR1CS 0x02
3524 #define _NOT_T1SYNC 0x04
3525 #define _T1SYNC 0x04
3526 #define _T1INSYNC 0x04
3527 #define _T1OSCEN 0x08
3528 #define _T1CKPS0 0x10
3529 #define _T1CKPS1 0x20
3530 #define _RD16 0x80
3532 //==============================================================================
3534 extern __at(0x0FCE) __sfr TMR1;
3535 extern __at(0x0FCE) __sfr TMR1L;
3536 extern __at(0x0FCF) __sfr TMR1H;
3538 //==============================================================================
3539 // RCON Bits
3541 extern __at(0x0FD0) __sfr RCON;
3543 typedef union
3545 struct
3547 unsigned NOT_BOR : 1;
3548 unsigned NOT_POR : 1;
3549 unsigned NOT_PD : 1;
3550 unsigned NOT_TO : 1;
3551 unsigned NOT_RI : 1;
3552 unsigned : 1;
3553 unsigned : 1;
3554 unsigned IPEN : 1;
3557 struct
3559 unsigned BOR : 1;
3560 unsigned POR : 1;
3561 unsigned PD : 1;
3562 unsigned TO : 1;
3563 unsigned RI : 1;
3564 unsigned : 1;
3565 unsigned : 1;
3566 unsigned NOT_IPEN : 1;
3568 } __RCONbits_t;
3570 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
3572 #define _NOT_BOR 0x01
3573 #define _BOR 0x01
3574 #define _NOT_POR 0x02
3575 #define _POR 0x02
3576 #define _NOT_PD 0x04
3577 #define _PD 0x04
3578 #define _NOT_TO 0x08
3579 #define _TO 0x08
3580 #define _NOT_RI 0x10
3581 #define _RI 0x10
3582 #define _IPEN 0x80
3583 #define _NOT_IPEN 0x80
3585 //==============================================================================
3588 //==============================================================================
3589 // WDTCON Bits
3591 extern __at(0x0FD1) __sfr WDTCON;
3593 typedef union
3595 struct
3597 unsigned SWDTEN : 1;
3598 unsigned : 1;
3599 unsigned : 1;
3600 unsigned : 1;
3601 unsigned : 1;
3602 unsigned : 1;
3603 unsigned : 1;
3604 unsigned : 1;
3607 struct
3609 unsigned SWDTE : 1;
3610 unsigned : 1;
3611 unsigned : 1;
3612 unsigned : 1;
3613 unsigned : 1;
3614 unsigned : 1;
3615 unsigned : 1;
3616 unsigned : 1;
3618 } __WDTCONbits_t;
3620 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
3622 #define _SWDTEN 0x01
3623 #define _SWDTE 0x01
3625 //==============================================================================
3628 //==============================================================================
3629 // LVDCON Bits
3631 extern __at(0x0FD2) __sfr LVDCON;
3633 typedef union
3635 struct
3637 unsigned LVDL0 : 1;
3638 unsigned LVDL1 : 1;
3639 unsigned LVDL2 : 1;
3640 unsigned LVDL3 : 1;
3641 unsigned LVDEN : 1;
3642 unsigned IRVST : 1;
3643 unsigned : 1;
3644 unsigned : 1;
3647 struct
3649 unsigned LVV0 : 1;
3650 unsigned LVV1 : 1;
3651 unsigned LVV2 : 1;
3652 unsigned LVV3 : 1;
3653 unsigned : 1;
3654 unsigned BGST : 1;
3655 unsigned : 1;
3656 unsigned : 1;
3659 struct
3661 unsigned LVV : 4;
3662 unsigned : 4;
3665 struct
3667 unsigned LVDL : 4;
3668 unsigned : 4;
3670 } __LVDCONbits_t;
3672 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
3674 #define _LVDL0 0x01
3675 #define _LVV0 0x01
3676 #define _LVDL1 0x02
3677 #define _LVV1 0x02
3678 #define _LVDL2 0x04
3679 #define _LVV2 0x04
3680 #define _LVDL3 0x08
3681 #define _LVV3 0x08
3682 #define _LVDEN 0x10
3683 #define _IRVST 0x20
3684 #define _BGST 0x20
3686 //==============================================================================
3689 //==============================================================================
3690 // OSCCON Bits
3692 extern __at(0x0FD3) __sfr OSCCON;
3694 typedef struct
3696 unsigned SCS : 1;
3697 unsigned : 1;
3698 unsigned : 1;
3699 unsigned : 1;
3700 unsigned : 1;
3701 unsigned : 1;
3702 unsigned : 1;
3703 unsigned : 1;
3704 } __OSCCONbits_t;
3706 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
3708 #define _SCS 0x01
3710 //==============================================================================
3713 //==============================================================================
3714 // T0CON Bits
3716 extern __at(0x0FD5) __sfr T0CON;
3718 typedef union
3720 struct
3722 unsigned T0PS0 : 1;
3723 unsigned T0PS1 : 1;
3724 unsigned T0PS2 : 1;
3725 unsigned PSA : 1;
3726 unsigned T0SE : 1;
3727 unsigned T0CS : 1;
3728 unsigned T08BIT : 1;
3729 unsigned TMR0ON : 1;
3732 struct
3734 unsigned T0PS : 3;
3735 unsigned : 5;
3737 } __T0CONbits_t;
3739 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
3741 #define _T0PS0 0x01
3742 #define _T0PS1 0x02
3743 #define _T0PS2 0x04
3744 #define _PSA 0x08
3745 #define _T0SE 0x10
3746 #define _T0CS 0x20
3747 #define _T08BIT 0x40
3748 #define _TMR0ON 0x80
3750 //==============================================================================
3752 extern __at(0x0FD6) __sfr TMR0;
3753 extern __at(0x0FD6) __sfr TMR0L;
3754 extern __at(0x0FD7) __sfr TMR0H;
3756 //==============================================================================
3757 // STATUS Bits
3759 extern __at(0x0FD8) __sfr STATUS;
3761 typedef struct
3763 unsigned C : 1;
3764 unsigned DC : 1;
3765 unsigned Z : 1;
3766 unsigned OV : 1;
3767 unsigned N : 1;
3768 unsigned : 1;
3769 unsigned : 1;
3770 unsigned : 1;
3771 } __STATUSbits_t;
3773 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3775 #define _C 0x01
3776 #define _DC 0x02
3777 #define _Z 0x04
3778 #define _OV 0x08
3779 #define _N 0x10
3781 //==============================================================================
3783 extern __at(0x0FD9) __sfr FSR2L;
3784 extern __at(0x0FDA) __sfr FSR2H;
3785 extern __at(0x0FDB) __sfr PLUSW2;
3786 extern __at(0x0FDC) __sfr PREINC2;
3787 extern __at(0x0FDD) __sfr POSTDEC2;
3788 extern __at(0x0FDE) __sfr POSTINC2;
3789 extern __at(0x0FDF) __sfr INDF2;
3790 extern __at(0x0FE0) __sfr BSR;
3791 extern __at(0x0FE1) __sfr FSR1L;
3792 extern __at(0x0FE2) __sfr FSR1H;
3793 extern __at(0x0FE3) __sfr PLUSW1;
3794 extern __at(0x0FE4) __sfr PREINC1;
3795 extern __at(0x0FE5) __sfr POSTDEC1;
3796 extern __at(0x0FE6) __sfr POSTINC1;
3797 extern __at(0x0FE7) __sfr INDF1;
3798 extern __at(0x0FE8) __sfr WREG;
3799 extern __at(0x0FE9) __sfr FSR0L;
3800 extern __at(0x0FEA) __sfr FSR0H;
3801 extern __at(0x0FEB) __sfr PLUSW0;
3802 extern __at(0x0FEC) __sfr PREINC0;
3803 extern __at(0x0FED) __sfr POSTDEC0;
3804 extern __at(0x0FEE) __sfr POSTINC0;
3805 extern __at(0x0FEF) __sfr INDF0;
3807 //==============================================================================
3808 // INTCON3 Bits
3810 extern __at(0x0FF0) __sfr INTCON3;
3812 typedef union
3814 struct
3816 unsigned INT1IF : 1;
3817 unsigned INT2IF : 1;
3818 unsigned INT3IF : 1;
3819 unsigned INT1IE : 1;
3820 unsigned INT2IE : 1;
3821 unsigned INT3IE : 1;
3822 unsigned INT1IP : 1;
3823 unsigned INT2IP : 1;
3826 struct
3828 unsigned INT1F : 1;
3829 unsigned INT2F : 1;
3830 unsigned INT3F : 1;
3831 unsigned INT1E : 1;
3832 unsigned INT2E : 1;
3833 unsigned INT3E : 1;
3834 unsigned INT1P : 1;
3835 unsigned INT2P : 1;
3837 } __INTCON3bits_t;
3839 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3841 #define _INT1IF 0x01
3842 #define _INT1F 0x01
3843 #define _INT2IF 0x02
3844 #define _INT2F 0x02
3845 #define _INT3IF 0x04
3846 #define _INT3F 0x04
3847 #define _INT1IE 0x08
3848 #define _INT1E 0x08
3849 #define _INT2IE 0x10
3850 #define _INT2E 0x10
3851 #define _INT3IE 0x20
3852 #define _INT3E 0x20
3853 #define _INT1IP 0x40
3854 #define _INT1P 0x40
3855 #define _INT2IP 0x80
3856 #define _INT2P 0x80
3858 //==============================================================================
3861 //==============================================================================
3862 // INTCON2 Bits
3864 extern __at(0x0FF1) __sfr INTCON2;
3866 typedef union
3868 struct
3870 unsigned RBIP : 1;
3871 unsigned INT3IP : 1;
3872 unsigned TMR0IP : 1;
3873 unsigned INTEDG3 : 1;
3874 unsigned INTEDG2 : 1;
3875 unsigned INTEDG1 : 1;
3876 unsigned INTEDG0 : 1;
3877 unsigned NOT_RBPU : 1;
3880 struct
3882 unsigned : 1;
3883 unsigned INT3P : 1;
3884 unsigned T0IP : 1;
3885 unsigned : 1;
3886 unsigned : 1;
3887 unsigned : 1;
3888 unsigned : 1;
3889 unsigned RBPU : 1;
3891 } __INTCON2bits_t;
3893 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3895 #define _RBIP 0x01
3896 #define _INT3IP 0x02
3897 #define _INT3P 0x02
3898 #define _TMR0IP 0x04
3899 #define _T0IP 0x04
3900 #define _INTEDG3 0x08
3901 #define _INTEDG2 0x10
3902 #define _INTEDG1 0x20
3903 #define _INTEDG0 0x40
3904 #define _NOT_RBPU 0x80
3905 #define _RBPU 0x80
3907 //==============================================================================
3910 //==============================================================================
3911 // INTCON Bits
3913 extern __at(0x0FF2) __sfr INTCON;
3915 typedef union
3917 struct
3919 unsigned RBIF : 1;
3920 unsigned INT0IF : 1;
3921 unsigned TMR0IF : 1;
3922 unsigned RBIE : 1;
3923 unsigned INT0IE : 1;
3924 unsigned TMR0IE : 1;
3925 unsigned PEIE_GIEL : 1;
3926 unsigned GIE_GIEH : 1;
3929 struct
3931 unsigned : 1;
3932 unsigned INT0F : 1;
3933 unsigned T0IF : 1;
3934 unsigned : 1;
3935 unsigned INT0E : 1;
3936 unsigned T0IE : 1;
3937 unsigned PEIE : 1;
3938 unsigned GIE : 1;
3941 struct
3943 unsigned : 1;
3944 unsigned : 1;
3945 unsigned : 1;
3946 unsigned : 1;
3947 unsigned : 1;
3948 unsigned : 1;
3949 unsigned GIEL : 1;
3950 unsigned GIEH : 1;
3952 } __INTCONbits_t;
3954 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3956 #define _RBIF 0x01
3957 #define _INT0IF 0x02
3958 #define _INT0F 0x02
3959 #define _TMR0IF 0x04
3960 #define _T0IF 0x04
3961 #define _RBIE 0x08
3962 #define _INT0IE 0x10
3963 #define _INT0E 0x10
3964 #define _TMR0IE 0x20
3965 #define _T0IE 0x20
3966 #define _PEIE_GIEL 0x40
3967 #define _PEIE 0x40
3968 #define _GIEL 0x40
3969 #define _GIE_GIEH 0x80
3970 #define _GIE 0x80
3971 #define _GIEH 0x80
3973 //==============================================================================
3976 //==============================================================================
3977 // INTCON1 Bits
3979 extern __at(0x0FF2) __sfr INTCON1;
3981 typedef union
3983 struct
3985 unsigned RBIF : 1;
3986 unsigned INT0IF : 1;
3987 unsigned TMR0IF : 1;
3988 unsigned RBIE : 1;
3989 unsigned INT0IE : 1;
3990 unsigned TMR0IE : 1;
3991 unsigned PEIE_GIEL : 1;
3992 unsigned GIE_GIEH : 1;
3995 struct
3997 unsigned : 1;
3998 unsigned INT0F : 1;
3999 unsigned T0IF : 1;
4000 unsigned : 1;
4001 unsigned INT0E : 1;
4002 unsigned T0IE : 1;
4003 unsigned PEIE : 1;
4004 unsigned GIE : 1;
4007 struct
4009 unsigned : 1;
4010 unsigned : 1;
4011 unsigned : 1;
4012 unsigned : 1;
4013 unsigned : 1;
4014 unsigned : 1;
4015 unsigned GIEL : 1;
4016 unsigned GIEH : 1;
4018 } __INTCON1bits_t;
4020 extern __at(0x0FF2) volatile __INTCON1bits_t INTCON1bits;
4022 #define _INTCON1_RBIF 0x01
4023 #define _INTCON1_INT0IF 0x02
4024 #define _INTCON1_INT0F 0x02
4025 #define _INTCON1_TMR0IF 0x04
4026 #define _INTCON1_T0IF 0x04
4027 #define _INTCON1_RBIE 0x08
4028 #define _INTCON1_INT0IE 0x10
4029 #define _INTCON1_INT0E 0x10
4030 #define _INTCON1_TMR0IE 0x20
4031 #define _INTCON1_T0IE 0x20
4032 #define _INTCON1_PEIE_GIEL 0x40
4033 #define _INTCON1_PEIE 0x40
4034 #define _INTCON1_GIEL 0x40
4035 #define _INTCON1_GIE_GIEH 0x80
4036 #define _INTCON1_GIE 0x80
4037 #define _INTCON1_GIEH 0x80
4039 //==============================================================================
4041 extern __at(0x0FF3) __sfr PROD;
4042 extern __at(0x0FF3) __sfr PRODL;
4043 extern __at(0x0FF4) __sfr PRODH;
4044 extern __at(0x0FF5) __sfr TABLAT;
4045 extern __at(0x0FF6) __sfr TBLPTR;
4046 extern __at(0x0FF6) __sfr TBLPTRL;
4047 extern __at(0x0FF7) __sfr TBLPTRH;
4048 extern __at(0x0FF8) __sfr TBLPTRU;
4049 extern __at(0x0FF9) __sfr PC;
4050 extern __at(0x0FF9) __sfr PCL;
4051 extern __at(0x0FFA) __sfr PCLATH;
4052 extern __at(0x0FFB) __sfr PCLATU;
4054 //==============================================================================
4055 // STKPTR Bits
4057 extern __at(0x0FFC) __sfr STKPTR;
4059 typedef union
4061 struct
4063 unsigned STKPTR0 : 1;
4064 unsigned STKPTR1 : 1;
4065 unsigned STKPTR2 : 1;
4066 unsigned STKPTR3 : 1;
4067 unsigned STKPTR4 : 1;
4068 unsigned : 1;
4069 unsigned STKUNF : 1;
4070 unsigned STKFUL : 1;
4073 struct
4075 unsigned SP0 : 1;
4076 unsigned SP1 : 1;
4077 unsigned SP2 : 1;
4078 unsigned SP3 : 1;
4079 unsigned SP4 : 1;
4080 unsigned : 1;
4081 unsigned : 1;
4082 unsigned STKOVF : 1;
4085 struct
4087 unsigned SP : 5;
4088 unsigned : 3;
4091 struct
4093 unsigned STKPTR : 5;
4094 unsigned : 3;
4096 } __STKPTRbits_t;
4098 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
4100 #define _STKPTR0 0x01
4101 #define _SP0 0x01
4102 #define _STKPTR1 0x02
4103 #define _SP1 0x02
4104 #define _STKPTR2 0x04
4105 #define _SP2 0x04
4106 #define _STKPTR3 0x08
4107 #define _SP3 0x08
4108 #define _STKPTR4 0x10
4109 #define _SP4 0x10
4110 #define _STKUNF 0x40
4111 #define _STKFUL 0x80
4112 #define _STKOVF 0x80
4114 //==============================================================================
4116 extern __at(0x0FFD) __sfr TOS;
4117 extern __at(0x0FFD) __sfr TOSL;
4118 extern __at(0x0FFE) __sfr TOSH;
4119 extern __at(0x0FFF) __sfr TOSU;
4121 //==============================================================================
4123 // Configuration Bits
4125 //==============================================================================
4127 #define __CONFIG1H 0x300001
4128 #define __CONFIG2L 0x300002
4129 #define __CONFIG2H 0x300003
4130 #define __CONFIG3L 0x300004
4131 #define __CONFIG3H 0x300005
4132 #define __CONFIG4L 0x300006
4133 #define __CONFIG5L 0x300008
4134 #define __CONFIG5H 0x300009
4135 #define __CONFIG6L 0x30000A
4136 #define __CONFIG6H 0x30000B
4137 #define __CONFIG7L 0x30000C
4138 #define __CONFIG7H 0x30000D
4140 //----------------------------- CONFIG1H Options -------------------------------
4142 #define _LP_OSC 0xF8 // LP oscillator.
4143 #define _OSC_LP_1H 0xF8 // LP oscillator.
4144 #define _XT_OSC 0xF9 // XT oscillator.
4145 #define _OSC_XT_1H 0xF9 // XT oscillator.
4146 #define _HS_OSC 0xFA // HS oscillator.
4147 #define _OSC_HS_1H 0xFA // HS oscillator.
4148 #define _RC_OSC 0xFB // RC oscillator w/ OSC2 configured as divide-by-4 clock output.
4149 #define _OSC_RC_1H 0xFB // RC oscillator w/ OSC2 configured as divide-by-4 clock output.
4150 #define _EC_OSC 0xFC // EC oscillator w/ OSC2 configured as divide-by-4 clock output.
4151 #define _OSC_EC_1H 0xFC // EC oscillator w/ OSC2 configured as divide-by-4 clock output.
4152 #define _ECIO_OSC 0xFD // EC oscillator w/ OSC2 configured as RA6.
4153 #define _OSC_ECIO_1H 0xFD // EC oscillator w/ OSC2 configured as RA6.
4154 #define _HSPLL_OSC 0xFE // HS oscillator with PLL enabled; clock frequency = (4 x FOSC).
4155 #define _OSC_HSPLL_1H 0xFE // HS oscillator with PLL enabled; clock frequency = (4 x FOSC).
4156 #define _RCIO_OSC 0xFF // RC oscillator w/ OSC2 configured as RA6.
4157 #define _OSC_RCIO_1H 0xFF // RC oscillator w/ OSC2 configured as RA6.
4158 #define _OSCS_ON_1H 0xDF // Timer1 Oscillator system clock switch option is enabled (oscillator switching is enabled).
4159 #define _OSCS_OFF_1H 0xFF // Oscillator system clock switch option is disabled (main oscillator is source).
4161 //----------------------------- CONFIG2L Options -------------------------------
4163 #define _PWRT_ON_2L 0xFE // PWRT enabled.
4164 #define _PWRT_OFF_2L 0xFF // PWRT disabled.
4165 #define _BOR_OFF_2L 0xFD // Brown-out Reset disabled.
4166 #define _BOR_ON_2L 0xFF // Brown-out Reset enabled.
4167 #define _BORV_45_2L 0xF3 // VBOR set to 4.5V.
4168 #define _BORV_42_2L 0xF7 // VBOR set to 4.2V.
4169 #define _BORV_27_2L 0xFB // VBOR set to 2.7V.
4170 #define _BORV_20 0xFF // VBOR set to 2.5V.
4171 #define _BORV_25_2L 0xFF // VBOR set to 2.5V.
4173 //----------------------------- CONFIG2H Options -------------------------------
4175 #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
4176 #define _WDT_ON_2H 0xFF // WDT enabled.
4177 #define _WDTPS_1_2H 0xF1 // 1:1.
4178 #define _WDTPS_2_2H 0xF3 // 1:2.
4179 #define _WDTPS_4_2H 0xF5 // 1:4.
4180 #define _WDTPS_8_2H 0xF7 // 1:8.
4181 #define _WDTPS_16_2H 0xF9 // 1:16.
4182 #define _WDTPS_32_2H 0xFB // 1:32.
4183 #define _WDTPS_64_2H 0xFD // 1:64.
4184 #define _WDTPS_128_2H 0xFF // 1:128.
4186 //----------------------------- CONFIG3L Options -------------------------------
4188 #define _CCP2MX_RE7 0xFE // CCP2 input/output is multiplexed with RE7.
4189 #define _CCP2MX_OFF 0xFE // CCP2 input/output is multiplexed with RE7.
4190 #define _CCP2MUX_OFF_3H 0xFE // CCP2 input/output is multiplexed with RE7.
4191 #define _CCP2MX_RE7_3H 0xFE // CCP2 input/output is multiplexed with RE7.
4192 #define _CCP2MUX_RE7_3H 0xFE // CCP2 input/output is multiplexed with RE7.
4193 #define _CCP2MX_RC1 0xFF // CCP2 input/output is multiplexed with RC1.
4194 #define _CCP2MX_ON 0xFF // CCP2 input/output is multiplexed with RC1.
4195 #define _CCP2MUX_ON_3H 0xFF // CCP2 input/output is multiplexed with RC1.
4196 #define _CCP2MX_RC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
4197 #define _CCP2MUX_RC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
4199 //----------------------------- CONFIG3H Options -------------------------------
4201 #define _CCP2MX_RE7 0xFE // CCP2 input/output is multiplexed with RE7.
4202 #define _CCP2MX_OFF 0xFE // CCP2 input/output is multiplexed with RE7.
4203 #define _CCP2MUX_OFF_3H 0xFE // CCP2 input/output is multiplexed with RE7.
4204 #define _CCP2MX_RE7_3H 0xFE // CCP2 input/output is multiplexed with RE7.
4205 #define _CCP2MUX_RE7_3H 0xFE // CCP2 input/output is multiplexed with RE7.
4206 #define _CCP2MX_RC1 0xFF // CCP2 input/output is multiplexed with RC1.
4207 #define _CCP2MX_ON 0xFF // CCP2 input/output is multiplexed with RC1.
4208 #define _CCP2MUX_ON_3H 0xFF // CCP2 input/output is multiplexed with RC1.
4209 #define _CCP2MX_RC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
4210 #define _CCP2MUX_RC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
4212 //----------------------------- CONFIG4L Options -------------------------------
4214 #define _STVR_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
4215 #define _STVR_ON_4L 0xFF // Stack full/underflow will cause Reset.
4216 #define _LVP_OFF_4L 0xFB // Low-voltage ICSP disabled.
4217 #define _LVP_ON_4L 0xFF // Low-voltage ICSP enabled.
4218 #define _DEBUG_ON_4L 0x7F // Background debugger enabled. RB6 and RB7 are dedicated to In-Circuit Debug.
4219 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled. RB6 and RB7 configured as general purpose I/O pins.
4221 //----------------------------- CONFIG5L Options -------------------------------
4223 #define _CP0_ON_5L 0xFE // Block 0 (000800-001FFFh) code-protected.
4224 #define _CP0_OFF_5L 0xFF // Block 0 (000800-001FFFh) not code-protected.
4225 #define _CP1_ON_5L 0xFD // Block 1 (002000-003FFFh) code-protected.
4226 #define _CP1_OFF_5L 0xFF // Block 1 (002000-003FFFh) not code-protected.
4227 #define _CP2_ON_5L 0xFB // Block 2 (004000-005FFFh) code-protected.
4228 #define _CP2_OFF_5L 0xFF // Block 2 (004000-005FFFh) not code-protected.
4229 #define _CP3_ON_5L 0xF7 // Block 3 (006000-007FFFh) code-protected.
4230 #define _CP3_OFF_5L 0xFF // Block 3 (006000-007FFFh) not code-protected.
4232 //----------------------------- CONFIG5H Options -------------------------------
4234 #define _CPB_ON_5H 0xBF // Boot Block (000000-0007FFh) code-protected.
4235 #define _CPB_OFF_5H 0xFF // Boot Block (000000-0007FFh) not code-protected.
4236 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
4237 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
4239 //----------------------------- CONFIG6L Options -------------------------------
4241 #define _WRT0_ON_6L 0xFE // Block 0 (000800-001FFFh) write-protected.
4242 #define _WRT0_OFF_6L 0xFF // Block 0 (000800-001FFFh) not write-protected.
4243 #define _WRT1_ON_6L 0xFD // Block 1 (002000-003FFFh) write-protected.
4244 #define _WRT1_OFF_6L 0xFF // Block 1 (002000-003FFFh) not write-protected.
4245 #define _WRT2_ON_6L 0xFB // Block 2 (004000-005FFFh) write-protected.
4246 #define _WRT2_OFF_6L 0xFF // Block 2 (004000-005FFFh) not write-protected.
4247 #define _WRT3_ON_6L 0xF7 // Block 3 (006000-007FFFh) write-protected.
4248 #define _WRT3_OFF_6L 0xFF // Block 3 (006000-007FFFh) not write-protected.
4250 //----------------------------- CONFIG6H Options -------------------------------
4252 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
4253 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
4254 #define _WRTB_ON_6H 0xBF // Boot Block (000000-0007FFh) write-protected.
4255 #define _WRTB_OFF_6H 0xFF // Boot Block (000000-0007FFh) not write-protected.
4256 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
4257 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
4259 //----------------------------- CONFIG7L Options -------------------------------
4261 #define _EBTR0_ON_7L 0xFE // Block 0 (000800-001FFFh) protected from table reads executed in other blocks.
4262 #define _EBTR0_OFF_7L 0xFF // Block 0 (000800-001FFFh) not protected from table reads executed in other blocks.
4263 #define _EBTR1_ON_7L 0xFD // Block 1 (002000-003FFFh) protected from table reads executed in other blocks.
4264 #define _EBTR1_OFF_7L 0xFF // Block 1 (002000-003FFFh) not protected from table reads executed in other blocks.
4265 #define _EBTR2_ON_7L 0xFB // Block 2 (004000-005FFFh) protected from table reads executed in other blocks.
4266 #define _EBTR2_OFF_7L 0xFF // Block 2 (004000-005FFFh) not protected from table reads executed in other blocks.
4267 #define _EBTR3_ON_7L 0xF7 // Block 3 (006000-007FFFh) protected from table reads executed in other blocks.
4268 #define _EBTR3_OFF_7L 0xFF // Block 3 (006000-007FFFh) not protected from table reads executed in other blocks.
4270 //----------------------------- CONFIG7H Options -------------------------------
4272 #define _EBTRB_ON_7H 0xBF // Boot Block (000000-0007FFh) protected from table reads executed in other blocks.
4273 #define _EBTRB_OFF_7H 0xFF // Boot Block (000000-0007FFh) not protected from table reads executed in other blocks.
4275 //==============================================================================
4277 #define __DEVID1 0x3FFFFE
4278 #define __DEVID2 0x3FFFFF
4280 #define __IDLOC0 0x200000
4281 #define __IDLOC1 0x200001
4282 #define __IDLOC2 0x200002
4283 #define __IDLOC3 0x200003
4284 #define __IDLOC4 0x200004
4285 #define __IDLOC5 0x200005
4286 #define __IDLOC6 0x200006
4287 #define __IDLOC7 0x200007
4289 #endif // #ifndef __PIC18F6520_H__