Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f4221.h
blobeda57a244f82bc5b875b41e32032eb4f46b1fb3f
1 /*
2 * This declarations of the PIC18F4221 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:45 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 __PIC18F4221_H__
26 #define __PIC18F4221_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // PORTA Bits
40 extern __at(0x0F80) __sfr PORTA;
42 typedef union
44 struct
46 unsigned RA0 : 1;
47 unsigned RA1 : 1;
48 unsigned RA2 : 1;
49 unsigned RA3 : 1;
50 unsigned RA4 : 1;
51 unsigned RA5 : 1;
52 unsigned RA6 : 1;
53 unsigned RA7 : 1;
56 struct
58 unsigned AN0 : 1;
59 unsigned AN1 : 1;
60 unsigned AN2 : 1;
61 unsigned AN3 : 1;
62 unsigned C1OUT : 1;
63 unsigned AN4 : 1;
64 unsigned OSC2 : 1;
65 unsigned OSC1 : 1;
68 struct
70 unsigned C1N : 1;
71 unsigned C2N : 1;
72 unsigned C2P : 1;
73 unsigned C1P : 1;
74 unsigned T0CKI : 1;
75 unsigned C2OUT : 1;
76 unsigned CLKO : 1;
77 unsigned CLKI : 1;
80 struct
82 unsigned : 1;
83 unsigned : 1;
84 unsigned VREFM : 1;
85 unsigned VREFP : 1;
86 unsigned : 1;
87 unsigned HLVDIN : 1;
88 unsigned : 1;
89 unsigned : 1;
92 struct
94 unsigned : 1;
95 unsigned : 1;
96 unsigned CVREF : 1;
97 unsigned : 1;
98 unsigned : 1;
99 unsigned NOT_SS : 1;
100 unsigned : 1;
101 unsigned : 1;
103 } __PORTAbits_t;
105 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
107 #define _PORTA_RA0 0x01
108 #define _PORTA_AN0 0x01
109 #define _PORTA_C1N 0x01
110 #define _PORTA_RA1 0x02
111 #define _PORTA_AN1 0x02
112 #define _PORTA_C2N 0x02
113 #define _PORTA_RA2 0x04
114 #define _PORTA_AN2 0x04
115 #define _PORTA_C2P 0x04
116 #define _PORTA_VREFM 0x04
117 #define _PORTA_CVREF 0x04
118 #define _PORTA_RA3 0x08
119 #define _PORTA_AN3 0x08
120 #define _PORTA_C1P 0x08
121 #define _PORTA_VREFP 0x08
122 #define _PORTA_RA4 0x10
123 #define _PORTA_C1OUT 0x10
124 #define _PORTA_T0CKI 0x10
125 #define _PORTA_RA5 0x20
126 #define _PORTA_AN4 0x20
127 #define _PORTA_C2OUT 0x20
128 #define _PORTA_HLVDIN 0x20
129 #define _PORTA_NOT_SS 0x20
130 #define _PORTA_RA6 0x40
131 #define _PORTA_OSC2 0x40
132 #define _PORTA_CLKO 0x40
133 #define _PORTA_RA7 0x80
134 #define _PORTA_OSC1 0x80
135 #define _PORTA_CLKI 0x80
137 //==============================================================================
140 //==============================================================================
141 // PORTB Bits
143 extern __at(0x0F81) __sfr PORTB;
145 typedef union
147 struct
149 unsigned RB0 : 1;
150 unsigned RB1 : 1;
151 unsigned RB2 : 1;
152 unsigned RB3 : 1;
153 unsigned RB4 : 1;
154 unsigned RB5 : 1;
155 unsigned RB6 : 1;
156 unsigned RB7 : 1;
159 struct
161 unsigned INT0 : 1;
162 unsigned INT1 : 1;
163 unsigned INT2 : 1;
164 unsigned CCP2 : 1;
165 unsigned KBI0 : 1;
166 unsigned KBI1 : 1;
167 unsigned KBI2 : 1;
168 unsigned KBI3 : 1;
171 struct
173 unsigned AN12 : 1;
174 unsigned AN10 : 1;
175 unsigned AN8 : 1;
176 unsigned AN9 : 1;
177 unsigned AN11 : 1;
178 unsigned PGM : 1;
179 unsigned PGC : 1;
180 unsigned PGD : 1;
183 struct
185 unsigned FLT0 : 1;
186 unsigned : 1;
187 unsigned : 1;
188 unsigned : 1;
189 unsigned : 1;
190 unsigned : 1;
191 unsigned : 1;
192 unsigned : 1;
195 struct
197 unsigned INT : 3;
198 unsigned : 5;
201 struct
203 unsigned : 4;
204 unsigned KBI : 4;
206 } __PORTBbits_t;
208 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
210 #define _PORTB_RB0 0x01
211 #define _PORTB_INT0 0x01
212 #define _PORTB_AN12 0x01
213 #define _PORTB_FLT0 0x01
214 #define _PORTB_RB1 0x02
215 #define _PORTB_INT1 0x02
216 #define _PORTB_AN10 0x02
217 #define _PORTB_RB2 0x04
218 #define _PORTB_INT2 0x04
219 #define _PORTB_AN8 0x04
220 #define _PORTB_RB3 0x08
221 #define _PORTB_CCP2 0x08
222 #define _PORTB_AN9 0x08
223 #define _PORTB_RB4 0x10
224 #define _PORTB_KBI0 0x10
225 #define _PORTB_AN11 0x10
226 #define _PORTB_RB5 0x20
227 #define _PORTB_KBI1 0x20
228 #define _PORTB_PGM 0x20
229 #define _PORTB_RB6 0x40
230 #define _PORTB_KBI2 0x40
231 #define _PORTB_PGC 0x40
232 #define _PORTB_RB7 0x80
233 #define _PORTB_KBI3 0x80
234 #define _PORTB_PGD 0x80
236 //==============================================================================
239 //==============================================================================
240 // PORTC Bits
242 extern __at(0x0F82) __sfr PORTC;
244 typedef union
246 struct
248 unsigned RC0 : 1;
249 unsigned RC1 : 1;
250 unsigned RC2 : 1;
251 unsigned RC3 : 1;
252 unsigned RC4 : 1;
253 unsigned RC5 : 1;
254 unsigned RC6 : 1;
255 unsigned RC7 : 1;
258 struct
260 unsigned T1OSO : 1;
261 unsigned T1OSI : 1;
262 unsigned CCP1 : 1;
263 unsigned SCK : 1;
264 unsigned SDI : 1;
265 unsigned SDO : 1;
266 unsigned TX : 1;
267 unsigned RX : 1;
270 struct
272 unsigned T13CKI : 1;
273 unsigned CCP2 : 1;
274 unsigned P1A : 1;
275 unsigned SCL : 1;
276 unsigned SDA : 1;
277 unsigned : 1;
278 unsigned CK : 1;
279 unsigned : 1;
282 struct
284 unsigned T1CKI : 1;
285 unsigned : 1;
286 unsigned : 1;
287 unsigned : 1;
288 unsigned : 1;
289 unsigned : 1;
290 unsigned : 1;
291 unsigned : 1;
293 } __PORTCbits_t;
295 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
297 #define _PORTC_RC0 0x01
298 #define _PORTC_T1OSO 0x01
299 #define _PORTC_T13CKI 0x01
300 #define _PORTC_T1CKI 0x01
301 #define _PORTC_RC1 0x02
302 #define _PORTC_T1OSI 0x02
303 #define _PORTC_CCP2 0x02
304 #define _PORTC_RC2 0x04
305 #define _PORTC_CCP1 0x04
306 #define _PORTC_P1A 0x04
307 #define _PORTC_RC3 0x08
308 #define _PORTC_SCK 0x08
309 #define _PORTC_SCL 0x08
310 #define _PORTC_RC4 0x10
311 #define _PORTC_SDI 0x10
312 #define _PORTC_SDA 0x10
313 #define _PORTC_RC5 0x20
314 #define _PORTC_SDO 0x20
315 #define _PORTC_RC6 0x40
316 #define _PORTC_TX 0x40
317 #define _PORTC_CK 0x40
318 #define _PORTC_RC7 0x80
319 #define _PORTC_RX 0x80
321 //==============================================================================
324 //==============================================================================
325 // PORTD Bits
327 extern __at(0x0F83) __sfr PORTD;
329 typedef union
331 struct
333 unsigned RD0 : 1;
334 unsigned RD1 : 1;
335 unsigned RD2 : 1;
336 unsigned RD3 : 1;
337 unsigned RD4 : 1;
338 unsigned RD5 : 1;
339 unsigned RD6 : 1;
340 unsigned RD7 : 1;
343 struct
345 unsigned PSP0 : 1;
346 unsigned PSP1 : 1;
347 unsigned PSP2 : 1;
348 unsigned PSP3 : 1;
349 unsigned PSP4 : 1;
350 unsigned PSP5 : 1;
351 unsigned PSP6 : 1;
352 unsigned PSP7 : 1;
355 struct
357 unsigned : 1;
358 unsigned : 1;
359 unsigned : 1;
360 unsigned : 1;
361 unsigned : 1;
362 unsigned P1B : 1;
363 unsigned P1C : 1;
364 unsigned P1D : 1;
366 } __PORTDbits_t;
368 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
370 #define _PORTD_RD0 0x01
371 #define _PORTD_PSP0 0x01
372 #define _PORTD_RD1 0x02
373 #define _PORTD_PSP1 0x02
374 #define _PORTD_RD2 0x04
375 #define _PORTD_PSP2 0x04
376 #define _PORTD_RD3 0x08
377 #define _PORTD_PSP3 0x08
378 #define _PORTD_RD4 0x10
379 #define _PORTD_PSP4 0x10
380 #define _PORTD_RD5 0x20
381 #define _PORTD_PSP5 0x20
382 #define _PORTD_P1B 0x20
383 #define _PORTD_RD6 0x40
384 #define _PORTD_PSP6 0x40
385 #define _PORTD_P1C 0x40
386 #define _PORTD_RD7 0x80
387 #define _PORTD_PSP7 0x80
388 #define _PORTD_P1D 0x80
390 //==============================================================================
393 //==============================================================================
394 // PORTE Bits
396 extern __at(0x0F84) __sfr PORTE;
398 typedef union
400 struct
402 unsigned RE0 : 1;
403 unsigned RE1 : 1;
404 unsigned RE2 : 1;
405 unsigned RE3 : 1;
406 unsigned : 1;
407 unsigned : 1;
408 unsigned : 1;
409 unsigned : 1;
412 struct
414 unsigned RD : 1;
415 unsigned WR : 1;
416 unsigned CS : 1;
417 unsigned MCLR : 1;
418 unsigned : 1;
419 unsigned : 1;
420 unsigned : 1;
421 unsigned : 1;
424 struct
426 unsigned NOT_RD : 1;
427 unsigned NOT_WR : 1;
428 unsigned NOT_CS : 1;
429 unsigned NOT_MCLR : 1;
430 unsigned : 1;
431 unsigned : 1;
432 unsigned : 1;
433 unsigned : 1;
436 struct
438 unsigned AN5 : 1;
439 unsigned AN6 : 1;
440 unsigned AN7 : 1;
441 unsigned VPP : 1;
442 unsigned : 1;
443 unsigned : 1;
444 unsigned : 1;
445 unsigned : 1;
448 struct
450 unsigned RE : 4;
451 unsigned : 4;
453 } __PORTEbits_t;
455 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
457 #define _PORTE_RE0 0x01
458 #define _PORTE_RD 0x01
459 #define _PORTE_NOT_RD 0x01
460 #define _PORTE_AN5 0x01
461 #define _PORTE_RE1 0x02
462 #define _PORTE_WR 0x02
463 #define _PORTE_NOT_WR 0x02
464 #define _PORTE_AN6 0x02
465 #define _PORTE_RE2 0x04
466 #define _PORTE_CS 0x04
467 #define _PORTE_NOT_CS 0x04
468 #define _PORTE_AN7 0x04
469 #define _PORTE_RE3 0x08
470 #define _PORTE_MCLR 0x08
471 #define _PORTE_NOT_MCLR 0x08
472 #define _PORTE_VPP 0x08
474 //==============================================================================
477 //==============================================================================
478 // LATA Bits
480 extern __at(0x0F89) __sfr LATA;
482 typedef struct
484 unsigned LATA0 : 1;
485 unsigned LATA1 : 1;
486 unsigned LATA2 : 1;
487 unsigned LATA3 : 1;
488 unsigned LATA4 : 1;
489 unsigned LATA5 : 1;
490 unsigned LATA6 : 1;
491 unsigned LATA7 : 1;
492 } __LATAbits_t;
494 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
496 #define _LATA0 0x01
497 #define _LATA1 0x02
498 #define _LATA2 0x04
499 #define _LATA3 0x08
500 #define _LATA4 0x10
501 #define _LATA5 0x20
502 #define _LATA6 0x40
503 #define _LATA7 0x80
505 //==============================================================================
508 //==============================================================================
509 // LATB Bits
511 extern __at(0x0F8A) __sfr LATB;
513 typedef struct
515 unsigned LATB0 : 1;
516 unsigned LATB1 : 1;
517 unsigned LATB2 : 1;
518 unsigned LATB3 : 1;
519 unsigned LATB4 : 1;
520 unsigned LATB5 : 1;
521 unsigned LATB6 : 1;
522 unsigned LATB7 : 1;
523 } __LATBbits_t;
525 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
527 #define _LATB0 0x01
528 #define _LATB1 0x02
529 #define _LATB2 0x04
530 #define _LATB3 0x08
531 #define _LATB4 0x10
532 #define _LATB5 0x20
533 #define _LATB6 0x40
534 #define _LATB7 0x80
536 //==============================================================================
539 //==============================================================================
540 // LATC Bits
542 extern __at(0x0F8B) __sfr LATC;
544 typedef struct
546 unsigned LATC0 : 1;
547 unsigned LATC1 : 1;
548 unsigned LATC2 : 1;
549 unsigned LATC3 : 1;
550 unsigned LATC4 : 1;
551 unsigned LATC5 : 1;
552 unsigned LATC6 : 1;
553 unsigned LATC7 : 1;
554 } __LATCbits_t;
556 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
558 #define _LATC0 0x01
559 #define _LATC1 0x02
560 #define _LATC2 0x04
561 #define _LATC3 0x08
562 #define _LATC4 0x10
563 #define _LATC5 0x20
564 #define _LATC6 0x40
565 #define _LATC7 0x80
567 //==============================================================================
570 //==============================================================================
571 // LATD Bits
573 extern __at(0x0F8C) __sfr LATD;
575 typedef struct
577 unsigned LATD0 : 1;
578 unsigned LATD1 : 1;
579 unsigned LATD2 : 1;
580 unsigned LATD3 : 1;
581 unsigned LATD4 : 1;
582 unsigned LATD5 : 1;
583 unsigned LATD6 : 1;
584 unsigned LATD7 : 1;
585 } __LATDbits_t;
587 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
589 #define _LATD0 0x01
590 #define _LATD1 0x02
591 #define _LATD2 0x04
592 #define _LATD3 0x08
593 #define _LATD4 0x10
594 #define _LATD5 0x20
595 #define _LATD6 0x40
596 #define _LATD7 0x80
598 //==============================================================================
601 //==============================================================================
602 // LATE Bits
604 extern __at(0x0F8D) __sfr LATE;
606 typedef union
608 struct
610 unsigned LATE0 : 1;
611 unsigned LATE1 : 1;
612 unsigned LATE2 : 1;
613 unsigned : 1;
614 unsigned : 1;
615 unsigned : 1;
616 unsigned : 1;
617 unsigned : 1;
620 struct
622 unsigned LATE : 3;
623 unsigned : 5;
625 } __LATEbits_t;
627 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
629 #define _LATE0 0x01
630 #define _LATE1 0x02
631 #define _LATE2 0x04
633 //==============================================================================
636 //==============================================================================
637 // DDRA Bits
639 extern __at(0x0F92) __sfr DDRA;
641 typedef union
643 struct
645 unsigned TRISA0 : 1;
646 unsigned TRISA1 : 1;
647 unsigned TRISA2 : 1;
648 unsigned TRISA3 : 1;
649 unsigned TRISA4 : 1;
650 unsigned TRISA5 : 1;
651 unsigned TRISA6 : 1;
652 unsigned TRISA7 : 1;
655 struct
657 unsigned RA0 : 1;
658 unsigned RA1 : 1;
659 unsigned RA2 : 1;
660 unsigned RA3 : 1;
661 unsigned RA4 : 1;
662 unsigned RA5 : 1;
663 unsigned RA6 : 1;
664 unsigned RA7 : 1;
666 } __DDRAbits_t;
668 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
670 #define _TRISA0 0x01
671 #define _RA0 0x01
672 #define _TRISA1 0x02
673 #define _RA1 0x02
674 #define _TRISA2 0x04
675 #define _RA2 0x04
676 #define _TRISA3 0x08
677 #define _RA3 0x08
678 #define _TRISA4 0x10
679 #define _RA4 0x10
680 #define _TRISA5 0x20
681 #define _RA5 0x20
682 #define _TRISA6 0x40
683 #define _RA6 0x40
684 #define _TRISA7 0x80
685 #define _RA7 0x80
687 //==============================================================================
690 //==============================================================================
691 // TRISA Bits
693 extern __at(0x0F92) __sfr TRISA;
695 typedef union
697 struct
699 unsigned TRISA0 : 1;
700 unsigned TRISA1 : 1;
701 unsigned TRISA2 : 1;
702 unsigned TRISA3 : 1;
703 unsigned TRISA4 : 1;
704 unsigned TRISA5 : 1;
705 unsigned TRISA6 : 1;
706 unsigned TRISA7 : 1;
709 struct
711 unsigned RA0 : 1;
712 unsigned RA1 : 1;
713 unsigned RA2 : 1;
714 unsigned RA3 : 1;
715 unsigned RA4 : 1;
716 unsigned RA5 : 1;
717 unsigned RA6 : 1;
718 unsigned RA7 : 1;
720 } __TRISAbits_t;
722 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
724 #define _TRISA_TRISA0 0x01
725 #define _TRISA_RA0 0x01
726 #define _TRISA_TRISA1 0x02
727 #define _TRISA_RA1 0x02
728 #define _TRISA_TRISA2 0x04
729 #define _TRISA_RA2 0x04
730 #define _TRISA_TRISA3 0x08
731 #define _TRISA_RA3 0x08
732 #define _TRISA_TRISA4 0x10
733 #define _TRISA_RA4 0x10
734 #define _TRISA_TRISA5 0x20
735 #define _TRISA_RA5 0x20
736 #define _TRISA_TRISA6 0x40
737 #define _TRISA_RA6 0x40
738 #define _TRISA_TRISA7 0x80
739 #define _TRISA_RA7 0x80
741 //==============================================================================
744 //==============================================================================
745 // DDRB Bits
747 extern __at(0x0F93) __sfr DDRB;
749 typedef union
751 struct
753 unsigned TRISB0 : 1;
754 unsigned TRISB1 : 1;
755 unsigned TRISB2 : 1;
756 unsigned TRISB3 : 1;
757 unsigned TRISB4 : 1;
758 unsigned TRISB5 : 1;
759 unsigned TRISB6 : 1;
760 unsigned TRISB7 : 1;
763 struct
765 unsigned RB0 : 1;
766 unsigned RB1 : 1;
767 unsigned RB2 : 1;
768 unsigned RB3 : 1;
769 unsigned RB4 : 1;
770 unsigned RB5 : 1;
771 unsigned RB6 : 1;
772 unsigned RB7 : 1;
774 } __DDRBbits_t;
776 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
778 #define _TRISB0 0x01
779 #define _RB0 0x01
780 #define _TRISB1 0x02
781 #define _RB1 0x02
782 #define _TRISB2 0x04
783 #define _RB2 0x04
784 #define _TRISB3 0x08
785 #define _RB3 0x08
786 #define _TRISB4 0x10
787 #define _RB4 0x10
788 #define _TRISB5 0x20
789 #define _RB5 0x20
790 #define _TRISB6 0x40
791 #define _RB6 0x40
792 #define _TRISB7 0x80
793 #define _RB7 0x80
795 //==============================================================================
798 //==============================================================================
799 // TRISB Bits
801 extern __at(0x0F93) __sfr TRISB;
803 typedef union
805 struct
807 unsigned TRISB0 : 1;
808 unsigned TRISB1 : 1;
809 unsigned TRISB2 : 1;
810 unsigned TRISB3 : 1;
811 unsigned TRISB4 : 1;
812 unsigned TRISB5 : 1;
813 unsigned TRISB6 : 1;
814 unsigned TRISB7 : 1;
817 struct
819 unsigned RB0 : 1;
820 unsigned RB1 : 1;
821 unsigned RB2 : 1;
822 unsigned RB3 : 1;
823 unsigned RB4 : 1;
824 unsigned RB5 : 1;
825 unsigned RB6 : 1;
826 unsigned RB7 : 1;
828 } __TRISBbits_t;
830 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
832 #define _TRISB_TRISB0 0x01
833 #define _TRISB_RB0 0x01
834 #define _TRISB_TRISB1 0x02
835 #define _TRISB_RB1 0x02
836 #define _TRISB_TRISB2 0x04
837 #define _TRISB_RB2 0x04
838 #define _TRISB_TRISB3 0x08
839 #define _TRISB_RB3 0x08
840 #define _TRISB_TRISB4 0x10
841 #define _TRISB_RB4 0x10
842 #define _TRISB_TRISB5 0x20
843 #define _TRISB_RB5 0x20
844 #define _TRISB_TRISB6 0x40
845 #define _TRISB_RB6 0x40
846 #define _TRISB_TRISB7 0x80
847 #define _TRISB_RB7 0x80
849 //==============================================================================
852 //==============================================================================
853 // DDRC Bits
855 extern __at(0x0F94) __sfr DDRC;
857 typedef union
859 struct
861 unsigned TRISC0 : 1;
862 unsigned TRISC1 : 1;
863 unsigned TRISC2 : 1;
864 unsigned TRISC3 : 1;
865 unsigned TRISC4 : 1;
866 unsigned TRISC5 : 1;
867 unsigned TRISC6 : 1;
868 unsigned TRISC7 : 1;
871 struct
873 unsigned RC0 : 1;
874 unsigned RC1 : 1;
875 unsigned RC2 : 1;
876 unsigned RC3 : 1;
877 unsigned RC4 : 1;
878 unsigned RC5 : 1;
879 unsigned RC6 : 1;
880 unsigned RC7 : 1;
882 } __DDRCbits_t;
884 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
886 #define _TRISC0 0x01
887 #define _RC0 0x01
888 #define _TRISC1 0x02
889 #define _RC1 0x02
890 #define _TRISC2 0x04
891 #define _RC2 0x04
892 #define _TRISC3 0x08
893 #define _RC3 0x08
894 #define _TRISC4 0x10
895 #define _RC4 0x10
896 #define _TRISC5 0x20
897 #define _RC5 0x20
898 #define _TRISC6 0x40
899 #define _RC6 0x40
900 #define _TRISC7 0x80
901 #define _RC7 0x80
903 //==============================================================================
906 //==============================================================================
907 // TRISC Bits
909 extern __at(0x0F94) __sfr TRISC;
911 typedef union
913 struct
915 unsigned TRISC0 : 1;
916 unsigned TRISC1 : 1;
917 unsigned TRISC2 : 1;
918 unsigned TRISC3 : 1;
919 unsigned TRISC4 : 1;
920 unsigned TRISC5 : 1;
921 unsigned TRISC6 : 1;
922 unsigned TRISC7 : 1;
925 struct
927 unsigned RC0 : 1;
928 unsigned RC1 : 1;
929 unsigned RC2 : 1;
930 unsigned RC3 : 1;
931 unsigned RC4 : 1;
932 unsigned RC5 : 1;
933 unsigned RC6 : 1;
934 unsigned RC7 : 1;
936 } __TRISCbits_t;
938 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
940 #define _TRISC_TRISC0 0x01
941 #define _TRISC_RC0 0x01
942 #define _TRISC_TRISC1 0x02
943 #define _TRISC_RC1 0x02
944 #define _TRISC_TRISC2 0x04
945 #define _TRISC_RC2 0x04
946 #define _TRISC_TRISC3 0x08
947 #define _TRISC_RC3 0x08
948 #define _TRISC_TRISC4 0x10
949 #define _TRISC_RC4 0x10
950 #define _TRISC_TRISC5 0x20
951 #define _TRISC_RC5 0x20
952 #define _TRISC_TRISC6 0x40
953 #define _TRISC_RC6 0x40
954 #define _TRISC_TRISC7 0x80
955 #define _TRISC_RC7 0x80
957 //==============================================================================
960 //==============================================================================
961 // DDRD Bits
963 extern __at(0x0F95) __sfr DDRD;
965 typedef union
967 struct
969 unsigned TRISD0 : 1;
970 unsigned TRISD1 : 1;
971 unsigned TRISD2 : 1;
972 unsigned TRISD3 : 1;
973 unsigned TRISD4 : 1;
974 unsigned TRISD5 : 1;
975 unsigned TRISD6 : 1;
976 unsigned TRISD7 : 1;
979 struct
981 unsigned RD0 : 1;
982 unsigned RD1 : 1;
983 unsigned RD2 : 1;
984 unsigned RD3 : 1;
985 unsigned RD4 : 1;
986 unsigned RD5 : 1;
987 unsigned RD6 : 1;
988 unsigned RD7 : 1;
990 } __DDRDbits_t;
992 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
994 #define _TRISD0 0x01
995 #define _RD0 0x01
996 #define _TRISD1 0x02
997 #define _RD1 0x02
998 #define _TRISD2 0x04
999 #define _RD2 0x04
1000 #define _TRISD3 0x08
1001 #define _RD3 0x08
1002 #define _TRISD4 0x10
1003 #define _RD4 0x10
1004 #define _TRISD5 0x20
1005 #define _RD5 0x20
1006 #define _TRISD6 0x40
1007 #define _RD6 0x40
1008 #define _TRISD7 0x80
1009 #define _RD7 0x80
1011 //==============================================================================
1014 //==============================================================================
1015 // TRISD Bits
1017 extern __at(0x0F95) __sfr TRISD;
1019 typedef union
1021 struct
1023 unsigned TRISD0 : 1;
1024 unsigned TRISD1 : 1;
1025 unsigned TRISD2 : 1;
1026 unsigned TRISD3 : 1;
1027 unsigned TRISD4 : 1;
1028 unsigned TRISD5 : 1;
1029 unsigned TRISD6 : 1;
1030 unsigned TRISD7 : 1;
1033 struct
1035 unsigned RD0 : 1;
1036 unsigned RD1 : 1;
1037 unsigned RD2 : 1;
1038 unsigned RD3 : 1;
1039 unsigned RD4 : 1;
1040 unsigned RD5 : 1;
1041 unsigned RD6 : 1;
1042 unsigned RD7 : 1;
1044 } __TRISDbits_t;
1046 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
1048 #define _TRISD_TRISD0 0x01
1049 #define _TRISD_RD0 0x01
1050 #define _TRISD_TRISD1 0x02
1051 #define _TRISD_RD1 0x02
1052 #define _TRISD_TRISD2 0x04
1053 #define _TRISD_RD2 0x04
1054 #define _TRISD_TRISD3 0x08
1055 #define _TRISD_RD3 0x08
1056 #define _TRISD_TRISD4 0x10
1057 #define _TRISD_RD4 0x10
1058 #define _TRISD_TRISD5 0x20
1059 #define _TRISD_RD5 0x20
1060 #define _TRISD_TRISD6 0x40
1061 #define _TRISD_RD6 0x40
1062 #define _TRISD_TRISD7 0x80
1063 #define _TRISD_RD7 0x80
1065 //==============================================================================
1068 //==============================================================================
1069 // DDRE Bits
1071 extern __at(0x0F96) __sfr DDRE;
1073 typedef union
1075 struct
1077 unsigned TRISE0 : 1;
1078 unsigned TRISE1 : 1;
1079 unsigned TRISE2 : 1;
1080 unsigned RE3 : 1;
1081 unsigned PSPMODE : 1;
1082 unsigned IBOV : 1;
1083 unsigned OBF : 1;
1084 unsigned IBF : 1;
1087 struct
1089 unsigned RE0 : 1;
1090 unsigned RE1 : 1;
1091 unsigned RE2 : 1;
1092 unsigned : 1;
1093 unsigned : 1;
1094 unsigned : 1;
1095 unsigned : 1;
1096 unsigned : 1;
1099 struct
1101 unsigned RE : 4;
1102 unsigned : 4;
1105 struct
1107 unsigned TRISE : 3;
1108 unsigned : 5;
1110 } __DDREbits_t;
1112 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
1114 #define _TRISE0 0x01
1115 #define _RE0 0x01
1116 #define _TRISE1 0x02
1117 #define _RE1 0x02
1118 #define _TRISE2 0x04
1119 #define _RE2 0x04
1120 #define _RE3 0x08
1121 #define _PSPMODE 0x10
1122 #define _IBOV 0x20
1123 #define _OBF 0x40
1124 #define _IBF 0x80
1126 //==============================================================================
1129 //==============================================================================
1130 // TRISE Bits
1132 extern __at(0x0F96) __sfr TRISE;
1134 typedef union
1136 struct
1138 unsigned TRISE0 : 1;
1139 unsigned TRISE1 : 1;
1140 unsigned TRISE2 : 1;
1141 unsigned RE3 : 1;
1142 unsigned PSPMODE : 1;
1143 unsigned IBOV : 1;
1144 unsigned OBF : 1;
1145 unsigned IBF : 1;
1148 struct
1150 unsigned RE0 : 1;
1151 unsigned RE1 : 1;
1152 unsigned RE2 : 1;
1153 unsigned : 1;
1154 unsigned : 1;
1155 unsigned : 1;
1156 unsigned : 1;
1157 unsigned : 1;
1160 struct
1162 unsigned RE : 4;
1163 unsigned : 4;
1166 struct
1168 unsigned TRISE : 3;
1169 unsigned : 5;
1171 } __TRISEbits_t;
1173 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
1175 #define _TRISE_TRISE0 0x01
1176 #define _TRISE_RE0 0x01
1177 #define _TRISE_TRISE1 0x02
1178 #define _TRISE_RE1 0x02
1179 #define _TRISE_TRISE2 0x04
1180 #define _TRISE_RE2 0x04
1181 #define _TRISE_RE3 0x08
1182 #define _TRISE_PSPMODE 0x10
1183 #define _TRISE_IBOV 0x20
1184 #define _TRISE_OBF 0x40
1185 #define _TRISE_IBF 0x80
1187 //==============================================================================
1190 //==============================================================================
1191 // OSCTUNE Bits
1193 extern __at(0x0F9B) __sfr OSCTUNE;
1195 typedef union
1197 struct
1199 unsigned TUN0 : 1;
1200 unsigned TUN1 : 1;
1201 unsigned TUN2 : 1;
1202 unsigned TUN3 : 1;
1203 unsigned TUN4 : 1;
1204 unsigned : 1;
1205 unsigned PLLEN : 1;
1206 unsigned INTSRC : 1;
1209 struct
1211 unsigned TUN : 5;
1212 unsigned : 3;
1214 } __OSCTUNEbits_t;
1216 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
1218 #define _TUN0 0x01
1219 #define _TUN1 0x02
1220 #define _TUN2 0x04
1221 #define _TUN3 0x08
1222 #define _TUN4 0x10
1223 #define _PLLEN 0x40
1224 #define _INTSRC 0x80
1226 //==============================================================================
1229 //==============================================================================
1230 // PIE1 Bits
1232 extern __at(0x0F9D) __sfr PIE1;
1234 typedef struct
1236 unsigned TMR1IE : 1;
1237 unsigned TMR2IE : 1;
1238 unsigned CCP1IE : 1;
1239 unsigned SSPIE : 1;
1240 unsigned TXIE : 1;
1241 unsigned RCIE : 1;
1242 unsigned ADIE : 1;
1243 unsigned PSPIE : 1;
1244 } __PIE1bits_t;
1246 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1248 #define _TMR1IE 0x01
1249 #define _TMR2IE 0x02
1250 #define _CCP1IE 0x04
1251 #define _SSPIE 0x08
1252 #define _TXIE 0x10
1253 #define _RCIE 0x20
1254 #define _ADIE 0x40
1255 #define _PSPIE 0x80
1257 //==============================================================================
1260 //==============================================================================
1261 // PIR1 Bits
1263 extern __at(0x0F9E) __sfr PIR1;
1265 typedef struct
1267 unsigned TMR1IF : 1;
1268 unsigned TMR2IF : 1;
1269 unsigned CCP1IF : 1;
1270 unsigned SSPIF : 1;
1271 unsigned TXIF : 1;
1272 unsigned RCIF : 1;
1273 unsigned ADIF : 1;
1274 unsigned PSPIF : 1;
1275 } __PIR1bits_t;
1277 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1279 #define _TMR1IF 0x01
1280 #define _TMR2IF 0x02
1281 #define _CCP1IF 0x04
1282 #define _SSPIF 0x08
1283 #define _TXIF 0x10
1284 #define _RCIF 0x20
1285 #define _ADIF 0x40
1286 #define _PSPIF 0x80
1288 //==============================================================================
1291 //==============================================================================
1292 // IPR1 Bits
1294 extern __at(0x0F9F) __sfr IPR1;
1296 typedef struct
1298 unsigned TMR1IP : 1;
1299 unsigned TMR2IP : 1;
1300 unsigned CCP1IP : 1;
1301 unsigned SSPIP : 1;
1302 unsigned TXIP : 1;
1303 unsigned RCIP : 1;
1304 unsigned ADIP : 1;
1305 unsigned PSPIP : 1;
1306 } __IPR1bits_t;
1308 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
1310 #define _TMR1IP 0x01
1311 #define _TMR2IP 0x02
1312 #define _CCP1IP 0x04
1313 #define _SSPIP 0x08
1314 #define _TXIP 0x10
1315 #define _RCIP 0x20
1316 #define _ADIP 0x40
1317 #define _PSPIP 0x80
1319 //==============================================================================
1322 //==============================================================================
1323 // PIE2 Bits
1325 extern __at(0x0FA0) __sfr PIE2;
1327 typedef union
1329 struct
1331 unsigned CCP2IE : 1;
1332 unsigned TMR3IE : 1;
1333 unsigned HLVDIE : 1;
1334 unsigned BCLIE : 1;
1335 unsigned EEIE : 1;
1336 unsigned : 1;
1337 unsigned CMIE : 1;
1338 unsigned OSCFIE : 1;
1341 struct
1343 unsigned : 1;
1344 unsigned : 1;
1345 unsigned LVDIE : 1;
1346 unsigned : 1;
1347 unsigned : 1;
1348 unsigned : 1;
1349 unsigned : 1;
1350 unsigned : 1;
1352 } __PIE2bits_t;
1354 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
1356 #define _CCP2IE 0x01
1357 #define _TMR3IE 0x02
1358 #define _HLVDIE 0x04
1359 #define _LVDIE 0x04
1360 #define _BCLIE 0x08
1361 #define _EEIE 0x10
1362 #define _CMIE 0x40
1363 #define _OSCFIE 0x80
1365 //==============================================================================
1368 //==============================================================================
1369 // PIR2 Bits
1371 extern __at(0x0FA1) __sfr PIR2;
1373 typedef union
1375 struct
1377 unsigned CCP2IF : 1;
1378 unsigned TMR3IF : 1;
1379 unsigned HLVDIF : 1;
1380 unsigned BCLIF : 1;
1381 unsigned EEIF : 1;
1382 unsigned : 1;
1383 unsigned CMIF : 1;
1384 unsigned OSCFIF : 1;
1387 struct
1389 unsigned : 1;
1390 unsigned : 1;
1391 unsigned LVDIF : 1;
1392 unsigned : 1;
1393 unsigned : 1;
1394 unsigned : 1;
1395 unsigned : 1;
1396 unsigned : 1;
1398 } __PIR2bits_t;
1400 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
1402 #define _CCP2IF 0x01
1403 #define _TMR3IF 0x02
1404 #define _HLVDIF 0x04
1405 #define _LVDIF 0x04
1406 #define _BCLIF 0x08
1407 #define _EEIF 0x10
1408 #define _CMIF 0x40
1409 #define _OSCFIF 0x80
1411 //==============================================================================
1414 //==============================================================================
1415 // IPR2 Bits
1417 extern __at(0x0FA2) __sfr IPR2;
1419 typedef union
1421 struct
1423 unsigned CCP2IP : 1;
1424 unsigned TMR3IP : 1;
1425 unsigned HLVDIP : 1;
1426 unsigned BCLIP : 1;
1427 unsigned EEIP : 1;
1428 unsigned : 1;
1429 unsigned CMIP : 1;
1430 unsigned OSCFIP : 1;
1433 struct
1435 unsigned : 1;
1436 unsigned : 1;
1437 unsigned LVDIP : 1;
1438 unsigned : 1;
1439 unsigned : 1;
1440 unsigned : 1;
1441 unsigned : 1;
1442 unsigned : 1;
1444 } __IPR2bits_t;
1446 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
1448 #define _CCP2IP 0x01
1449 #define _TMR3IP 0x02
1450 #define _HLVDIP 0x04
1451 #define _LVDIP 0x04
1452 #define _BCLIP 0x08
1453 #define _EEIP 0x10
1454 #define _CMIP 0x40
1455 #define _OSCFIP 0x80
1457 //==============================================================================
1460 //==============================================================================
1461 // EECON1 Bits
1463 extern __at(0x0FA6) __sfr EECON1;
1465 typedef struct
1467 unsigned RD : 1;
1468 unsigned WR : 1;
1469 unsigned WREN : 1;
1470 unsigned WRERR : 1;
1471 unsigned FREE : 1;
1472 unsigned : 1;
1473 unsigned CFGS : 1;
1474 unsigned EEPGD : 1;
1475 } __EECON1bits_t;
1477 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
1479 #define _RD 0x01
1480 #define _WR 0x02
1481 #define _WREN 0x04
1482 #define _WRERR 0x08
1483 #define _FREE 0x10
1484 #define _CFGS 0x40
1485 #define _EEPGD 0x80
1487 //==============================================================================
1489 extern __at(0x0FA7) __sfr EECON2;
1490 extern __at(0x0FA8) __sfr EEDATA;
1491 extern __at(0x0FA9) __sfr EEADR;
1493 //==============================================================================
1494 // RCSTA Bits
1496 extern __at(0x0FAB) __sfr RCSTA;
1498 typedef union
1500 struct
1502 unsigned RX9D : 1;
1503 unsigned OERR : 1;
1504 unsigned FERR : 1;
1505 unsigned ADDEN : 1;
1506 unsigned CREN : 1;
1507 unsigned SREN : 1;
1508 unsigned RX9 : 1;
1509 unsigned SPEN : 1;
1512 struct
1514 unsigned : 1;
1515 unsigned : 1;
1516 unsigned : 1;
1517 unsigned ADEN : 1;
1518 unsigned : 1;
1519 unsigned : 1;
1520 unsigned : 1;
1521 unsigned : 1;
1523 } __RCSTAbits_t;
1525 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
1527 #define _RX9D 0x01
1528 #define _OERR 0x02
1529 #define _FERR 0x04
1530 #define _ADDEN 0x08
1531 #define _ADEN 0x08
1532 #define _CREN 0x10
1533 #define _SREN 0x20
1534 #define _RX9 0x40
1535 #define _SPEN 0x80
1537 //==============================================================================
1540 //==============================================================================
1541 // TXSTA Bits
1543 extern __at(0x0FAC) __sfr TXSTA;
1545 typedef struct
1547 unsigned TX9D : 1;
1548 unsigned TRMT : 1;
1549 unsigned BRGH : 1;
1550 unsigned SENDB : 1;
1551 unsigned SYNC : 1;
1552 unsigned TXEN : 1;
1553 unsigned TX9 : 1;
1554 unsigned CSRC : 1;
1555 } __TXSTAbits_t;
1557 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
1559 #define _TX9D 0x01
1560 #define _TRMT 0x02
1561 #define _BRGH 0x04
1562 #define _SENDB 0x08
1563 #define _SYNC 0x10
1564 #define _TXEN 0x20
1565 #define _TX9 0x40
1566 #define _CSRC 0x80
1568 //==============================================================================
1570 extern __at(0x0FAD) __sfr TXREG;
1571 extern __at(0x0FAE) __sfr RCREG;
1572 extern __at(0x0FAF) __sfr SPBRG;
1573 extern __at(0x0FB0) __sfr SPBRGH;
1575 //==============================================================================
1576 // T3CON Bits
1578 extern __at(0x0FB1) __sfr T3CON;
1580 typedef union
1582 struct
1584 unsigned TMR3ON : 1;
1585 unsigned TMR3CS : 1;
1586 unsigned NOT_T3SYNC : 1;
1587 unsigned T3CCP1 : 1;
1588 unsigned T3CKPS0 : 1;
1589 unsigned T3CKPS1 : 1;
1590 unsigned T3CCP2 : 1;
1591 unsigned RD16 : 1;
1594 struct
1596 unsigned : 1;
1597 unsigned : 1;
1598 unsigned T3SYNC : 1;
1599 unsigned : 1;
1600 unsigned : 1;
1601 unsigned : 1;
1602 unsigned : 1;
1603 unsigned : 1;
1606 struct
1608 unsigned : 4;
1609 unsigned T3CKPS : 2;
1610 unsigned : 2;
1612 } __T3CONbits_t;
1614 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
1616 #define _T3CON_TMR3ON 0x01
1617 #define _T3CON_TMR3CS 0x02
1618 #define _T3CON_NOT_T3SYNC 0x04
1619 #define _T3CON_T3SYNC 0x04
1620 #define _T3CON_T3CCP1 0x08
1621 #define _T3CON_T3CKPS0 0x10
1622 #define _T3CON_T3CKPS1 0x20
1623 #define _T3CON_T3CCP2 0x40
1624 #define _T3CON_RD16 0x80
1626 //==============================================================================
1628 extern __at(0x0FB2) __sfr TMR3;
1629 extern __at(0x0FB2) __sfr TMR3L;
1630 extern __at(0x0FB3) __sfr TMR3H;
1632 //==============================================================================
1633 // CMCON Bits
1635 extern __at(0x0FB4) __sfr CMCON;
1637 typedef union
1639 struct
1641 unsigned CM0 : 1;
1642 unsigned CM1 : 1;
1643 unsigned CM2 : 1;
1644 unsigned CIS : 1;
1645 unsigned C1INV : 1;
1646 unsigned C2INV : 1;
1647 unsigned C1OUT : 1;
1648 unsigned C2OUT : 1;
1651 struct
1653 unsigned CM : 3;
1654 unsigned : 5;
1656 } __CMCONbits_t;
1658 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
1660 #define _CM0 0x01
1661 #define _CM1 0x02
1662 #define _CM2 0x04
1663 #define _CIS 0x08
1664 #define _C1INV 0x10
1665 #define _C2INV 0x20
1666 #define _C1OUT 0x40
1667 #define _C2OUT 0x80
1669 //==============================================================================
1672 //==============================================================================
1673 // CVRCON Bits
1675 extern __at(0x0FB5) __sfr CVRCON;
1677 typedef union
1679 struct
1681 unsigned CVR0 : 1;
1682 unsigned CVR1 : 1;
1683 unsigned CVR2 : 1;
1684 unsigned CVR3 : 1;
1685 unsigned CVRSS : 1;
1686 unsigned CVRR : 1;
1687 unsigned CVROE : 1;
1688 unsigned CVREN : 1;
1691 struct
1693 unsigned CVR : 4;
1694 unsigned : 4;
1696 } __CVRCONbits_t;
1698 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
1700 #define _CVR0 0x01
1701 #define _CVR1 0x02
1702 #define _CVR2 0x04
1703 #define _CVR3 0x08
1704 #define _CVRSS 0x10
1705 #define _CVRR 0x20
1706 #define _CVROE 0x40
1707 #define _CVREN 0x80
1709 //==============================================================================
1712 //==============================================================================
1713 // ECCP1AS Bits
1715 extern __at(0x0FB6) __sfr ECCP1AS;
1717 typedef union
1719 struct
1721 unsigned PSSBD0 : 1;
1722 unsigned PSSBD1 : 1;
1723 unsigned PSSAC0 : 1;
1724 unsigned PSSAC1 : 1;
1725 unsigned ECCPAS0 : 1;
1726 unsigned ECCPAS1 : 1;
1727 unsigned ECCPAS2 : 1;
1728 unsigned ECCPASE : 1;
1731 struct
1733 unsigned PSSBD : 2;
1734 unsigned : 6;
1737 struct
1739 unsigned : 2;
1740 unsigned PSSAC : 2;
1741 unsigned : 4;
1744 struct
1746 unsigned : 4;
1747 unsigned ECCPAS : 3;
1748 unsigned : 1;
1750 } __ECCP1ASbits_t;
1752 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
1754 #define _PSSBD0 0x01
1755 #define _PSSBD1 0x02
1756 #define _PSSAC0 0x04
1757 #define _PSSAC1 0x08
1758 #define _ECCPAS0 0x10
1759 #define _ECCPAS1 0x20
1760 #define _ECCPAS2 0x40
1761 #define _ECCPASE 0x80
1763 //==============================================================================
1766 //==============================================================================
1767 // ECCP1DEL Bits
1769 extern __at(0x0FB7) __sfr ECCP1DEL;
1771 typedef union
1773 struct
1775 unsigned PDC0 : 1;
1776 unsigned PDC1 : 1;
1777 unsigned PDC2 : 1;
1778 unsigned PDC3 : 1;
1779 unsigned PDC4 : 1;
1780 unsigned PDC5 : 1;
1781 unsigned PDC6 : 1;
1782 unsigned PRSEN : 1;
1785 struct
1787 unsigned PDC : 7;
1788 unsigned : 1;
1790 } __ECCP1DELbits_t;
1792 extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits;
1794 #define _PDC0 0x01
1795 #define _PDC1 0x02
1796 #define _PDC2 0x04
1797 #define _PDC3 0x08
1798 #define _PDC4 0x10
1799 #define _PDC5 0x20
1800 #define _PDC6 0x40
1801 #define _PRSEN 0x80
1803 //==============================================================================
1806 //==============================================================================
1807 // PWM1CON Bits
1809 extern __at(0x0FB7) __sfr PWM1CON;
1811 typedef union
1813 struct
1815 unsigned PDC0 : 1;
1816 unsigned PDC1 : 1;
1817 unsigned PDC2 : 1;
1818 unsigned PDC3 : 1;
1819 unsigned PDC4 : 1;
1820 unsigned PDC5 : 1;
1821 unsigned PDC6 : 1;
1822 unsigned PRSEN : 1;
1825 struct
1827 unsigned PDC : 7;
1828 unsigned : 1;
1830 } __PWM1CONbits_t;
1832 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
1834 #define _PWM1CON_PDC0 0x01
1835 #define _PWM1CON_PDC1 0x02
1836 #define _PWM1CON_PDC2 0x04
1837 #define _PWM1CON_PDC3 0x08
1838 #define _PWM1CON_PDC4 0x10
1839 #define _PWM1CON_PDC5 0x20
1840 #define _PWM1CON_PDC6 0x40
1841 #define _PWM1CON_PRSEN 0x80
1843 //==============================================================================
1846 //==============================================================================
1847 // BAUDCON Bits
1849 extern __at(0x0FB8) __sfr BAUDCON;
1851 typedef union
1853 struct
1855 unsigned ABDEN : 1;
1856 unsigned WUE : 1;
1857 unsigned : 1;
1858 unsigned BRG16 : 1;
1859 unsigned TXCKP : 1;
1860 unsigned RXDTP : 1;
1861 unsigned RCIDL : 1;
1862 unsigned ABDOVF : 1;
1865 struct
1867 unsigned : 1;
1868 unsigned : 1;
1869 unsigned : 1;
1870 unsigned : 1;
1871 unsigned SCKP : 1;
1872 unsigned : 1;
1873 unsigned RCMT : 1;
1874 unsigned : 1;
1876 } __BAUDCONbits_t;
1878 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
1880 #define _ABDEN 0x01
1881 #define _WUE 0x02
1882 #define _BRG16 0x08
1883 #define _TXCKP 0x10
1884 #define _SCKP 0x10
1885 #define _RXDTP 0x20
1886 #define _RCIDL 0x40
1887 #define _RCMT 0x40
1888 #define _ABDOVF 0x80
1890 //==============================================================================
1893 //==============================================================================
1894 // BAUDCTL Bits
1896 extern __at(0x0FB8) __sfr BAUDCTL;
1898 typedef union
1900 struct
1902 unsigned ABDEN : 1;
1903 unsigned WUE : 1;
1904 unsigned : 1;
1905 unsigned BRG16 : 1;
1906 unsigned TXCKP : 1;
1907 unsigned RXDTP : 1;
1908 unsigned RCIDL : 1;
1909 unsigned ABDOVF : 1;
1912 struct
1914 unsigned : 1;
1915 unsigned : 1;
1916 unsigned : 1;
1917 unsigned : 1;
1918 unsigned SCKP : 1;
1919 unsigned : 1;
1920 unsigned RCMT : 1;
1921 unsigned : 1;
1923 } __BAUDCTLbits_t;
1925 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
1927 #define _BAUDCTL_ABDEN 0x01
1928 #define _BAUDCTL_WUE 0x02
1929 #define _BAUDCTL_BRG16 0x08
1930 #define _BAUDCTL_TXCKP 0x10
1931 #define _BAUDCTL_SCKP 0x10
1932 #define _BAUDCTL_RXDTP 0x20
1933 #define _BAUDCTL_RCIDL 0x40
1934 #define _BAUDCTL_RCMT 0x40
1935 #define _BAUDCTL_ABDOVF 0x80
1937 //==============================================================================
1940 //==============================================================================
1941 // CCP2CON Bits
1943 extern __at(0x0FBA) __sfr CCP2CON;
1945 typedef union
1947 struct
1949 unsigned CCP2M0 : 1;
1950 unsigned CCP2M1 : 1;
1951 unsigned CCP2M2 : 1;
1952 unsigned CCP2M3 : 1;
1953 unsigned DC2B0 : 1;
1954 unsigned DC2B1 : 1;
1955 unsigned : 1;
1956 unsigned : 1;
1959 struct
1961 unsigned : 1;
1962 unsigned : 1;
1963 unsigned : 1;
1964 unsigned : 1;
1965 unsigned CCP2Y : 1;
1966 unsigned CCP2X : 1;
1967 unsigned : 1;
1968 unsigned : 1;
1971 struct
1973 unsigned CCP2M : 4;
1974 unsigned : 4;
1977 struct
1979 unsigned : 4;
1980 unsigned DC2B : 2;
1981 unsigned : 2;
1983 } __CCP2CONbits_t;
1985 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
1987 #define _CCP2M0 0x01
1988 #define _CCP2M1 0x02
1989 #define _CCP2M2 0x04
1990 #define _CCP2M3 0x08
1991 #define _DC2B0 0x10
1992 #define _CCP2Y 0x10
1993 #define _DC2B1 0x20
1994 #define _CCP2X 0x20
1996 //==============================================================================
1998 extern __at(0x0FBB) __sfr CCPR2;
1999 extern __at(0x0FBB) __sfr CCPR2L;
2000 extern __at(0x0FBC) __sfr CCPR2H;
2002 //==============================================================================
2003 // CCP1CON Bits
2005 extern __at(0x0FBD) __sfr CCP1CON;
2007 typedef union
2009 struct
2011 unsigned CCP1M0 : 1;
2012 unsigned CCP1M1 : 1;
2013 unsigned CCP1M2 : 1;
2014 unsigned CCP1M3 : 1;
2015 unsigned DC1B0 : 1;
2016 unsigned DC1B1 : 1;
2017 unsigned P1M0 : 1;
2018 unsigned P1M1 : 1;
2021 struct
2023 unsigned : 1;
2024 unsigned : 1;
2025 unsigned : 1;
2026 unsigned : 1;
2027 unsigned CCP1Y : 1;
2028 unsigned CCP1X : 1;
2029 unsigned : 1;
2030 unsigned : 1;
2033 struct
2035 unsigned CCP1M : 4;
2036 unsigned : 4;
2039 struct
2041 unsigned : 4;
2042 unsigned DC1B : 2;
2043 unsigned : 2;
2046 struct
2048 unsigned : 6;
2049 unsigned P1M : 2;
2051 } __CCP1CONbits_t;
2053 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
2055 #define _CCP1M0 0x01
2056 #define _CCP1M1 0x02
2057 #define _CCP1M2 0x04
2058 #define _CCP1M3 0x08
2059 #define _DC1B0 0x10
2060 #define _CCP1Y 0x10
2061 #define _DC1B1 0x20
2062 #define _CCP1X 0x20
2063 #define _P1M0 0x40
2064 #define _P1M1 0x80
2066 //==============================================================================
2069 //==============================================================================
2070 // ECCP1CON Bits
2072 extern __at(0x0FBD) __sfr ECCP1CON;
2074 typedef union
2076 struct
2078 unsigned CCP1M0 : 1;
2079 unsigned CCP1M1 : 1;
2080 unsigned CCP1M2 : 1;
2081 unsigned CCP1M3 : 1;
2082 unsigned DC1B0 : 1;
2083 unsigned DC1B1 : 1;
2084 unsigned P1M0 : 1;
2085 unsigned P1M1 : 1;
2088 struct
2090 unsigned : 1;
2091 unsigned : 1;
2092 unsigned : 1;
2093 unsigned : 1;
2094 unsigned CCP1Y : 1;
2095 unsigned CCP1X : 1;
2096 unsigned : 1;
2097 unsigned : 1;
2100 struct
2102 unsigned CCP1M : 4;
2103 unsigned : 4;
2106 struct
2108 unsigned : 4;
2109 unsigned DC1B : 2;
2110 unsigned : 2;
2113 struct
2115 unsigned : 6;
2116 unsigned P1M : 2;
2118 } __ECCP1CONbits_t;
2120 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
2122 #define _ECCP1CON_CCP1M0 0x01
2123 #define _ECCP1CON_CCP1M1 0x02
2124 #define _ECCP1CON_CCP1M2 0x04
2125 #define _ECCP1CON_CCP1M3 0x08
2126 #define _ECCP1CON_DC1B0 0x10
2127 #define _ECCP1CON_CCP1Y 0x10
2128 #define _ECCP1CON_DC1B1 0x20
2129 #define _ECCP1CON_CCP1X 0x20
2130 #define _ECCP1CON_P1M0 0x40
2131 #define _ECCP1CON_P1M1 0x80
2133 //==============================================================================
2135 extern __at(0x0FBE) __sfr CCPR1;
2136 extern __at(0x0FBE) __sfr CCPR1L;
2137 extern __at(0x0FBF) __sfr CCPR1H;
2139 //==============================================================================
2140 // ADCON2 Bits
2142 extern __at(0x0FC0) __sfr ADCON2;
2144 typedef union
2146 struct
2148 unsigned ADCS0 : 1;
2149 unsigned ADCS1 : 1;
2150 unsigned ADCS2 : 1;
2151 unsigned ACQT0 : 1;
2152 unsigned ACQT1 : 1;
2153 unsigned ACQT2 : 1;
2154 unsigned : 1;
2155 unsigned ADFM : 1;
2158 struct
2160 unsigned ADCS : 3;
2161 unsigned : 5;
2164 struct
2166 unsigned : 3;
2167 unsigned ACQT : 3;
2168 unsigned : 2;
2170 } __ADCON2bits_t;
2172 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
2174 #define _ADCS0 0x01
2175 #define _ADCS1 0x02
2176 #define _ADCS2 0x04
2177 #define _ACQT0 0x08
2178 #define _ACQT1 0x10
2179 #define _ACQT2 0x20
2180 #define _ADFM 0x80
2182 //==============================================================================
2185 //==============================================================================
2186 // ADCON1 Bits
2188 extern __at(0x0FC1) __sfr ADCON1;
2190 typedef union
2192 struct
2194 unsigned PCFG0 : 1;
2195 unsigned PCFG1 : 1;
2196 unsigned PCFG2 : 1;
2197 unsigned PCFG3 : 1;
2198 unsigned VCFG0 : 1;
2199 unsigned VCFG1 : 1;
2200 unsigned : 1;
2201 unsigned : 1;
2204 struct
2206 unsigned PCFG : 4;
2207 unsigned : 4;
2210 struct
2212 unsigned : 4;
2213 unsigned VCFG : 2;
2214 unsigned : 2;
2216 } __ADCON1bits_t;
2218 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
2220 #define _PCFG0 0x01
2221 #define _PCFG1 0x02
2222 #define _PCFG2 0x04
2223 #define _PCFG3 0x08
2224 #define _VCFG0 0x10
2225 #define _VCFG1 0x20
2227 //==============================================================================
2230 //==============================================================================
2231 // ADCON0 Bits
2233 extern __at(0x0FC2) __sfr ADCON0;
2235 typedef union
2237 struct
2239 unsigned ADON : 1;
2240 unsigned GO_NOT_DONE : 1;
2241 unsigned CHS0 : 1;
2242 unsigned CHS1 : 1;
2243 unsigned CHS2 : 1;
2244 unsigned CHS3 : 1;
2245 unsigned : 1;
2246 unsigned : 1;
2249 struct
2251 unsigned : 1;
2252 unsigned GO : 1;
2253 unsigned : 1;
2254 unsigned : 1;
2255 unsigned : 1;
2256 unsigned : 1;
2257 unsigned : 1;
2258 unsigned : 1;
2261 struct
2263 unsigned : 1;
2264 unsigned DONE : 1;
2265 unsigned : 1;
2266 unsigned : 1;
2267 unsigned : 1;
2268 unsigned : 1;
2269 unsigned : 1;
2270 unsigned : 1;
2273 struct
2275 unsigned : 1;
2276 unsigned NOT_DONE : 1;
2277 unsigned : 1;
2278 unsigned : 1;
2279 unsigned : 1;
2280 unsigned : 1;
2281 unsigned : 1;
2282 unsigned : 1;
2285 struct
2287 unsigned : 1;
2288 unsigned GO_DONE : 1;
2289 unsigned : 1;
2290 unsigned : 1;
2291 unsigned : 1;
2292 unsigned : 1;
2293 unsigned : 1;
2294 unsigned : 1;
2297 struct
2299 unsigned : 2;
2300 unsigned CHS : 4;
2301 unsigned : 2;
2303 } __ADCON0bits_t;
2305 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
2307 #define _ADON 0x01
2308 #define _GO_NOT_DONE 0x02
2309 #define _GO 0x02
2310 #define _DONE 0x02
2311 #define _NOT_DONE 0x02
2312 #define _GO_DONE 0x02
2313 #define _CHS0 0x04
2314 #define _CHS1 0x08
2315 #define _CHS2 0x10
2316 #define _CHS3 0x20
2318 //==============================================================================
2320 extern __at(0x0FC3) __sfr ADRES;
2321 extern __at(0x0FC3) __sfr ADRESL;
2322 extern __at(0x0FC4) __sfr ADRESH;
2324 //==============================================================================
2325 // SSPCON2 Bits
2327 extern __at(0x0FC5) __sfr SSPCON2;
2329 typedef union
2331 struct
2333 unsigned SEN : 1;
2334 unsigned RSEN : 1;
2335 unsigned PEN : 1;
2336 unsigned RCEN : 1;
2337 unsigned ACKEN : 1;
2338 unsigned ACKDT : 1;
2339 unsigned ACKSTAT : 1;
2340 unsigned GCEN : 1;
2343 struct
2345 unsigned : 1;
2346 unsigned ADMSK1 : 1;
2347 unsigned ADMSK2 : 1;
2348 unsigned ADMSK3 : 1;
2349 unsigned ADMSK4 : 1;
2350 unsigned ADMSK5 : 1;
2351 unsigned : 1;
2352 unsigned : 1;
2354 } __SSPCON2bits_t;
2356 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
2358 #define _SEN 0x01
2359 #define _RSEN 0x02
2360 #define _ADMSK1 0x02
2361 #define _PEN 0x04
2362 #define _ADMSK2 0x04
2363 #define _RCEN 0x08
2364 #define _ADMSK3 0x08
2365 #define _ACKEN 0x10
2366 #define _ADMSK4 0x10
2367 #define _ACKDT 0x20
2368 #define _ADMSK5 0x20
2369 #define _ACKSTAT 0x40
2370 #define _GCEN 0x80
2372 //==============================================================================
2375 //==============================================================================
2376 // SSPCON1 Bits
2378 extern __at(0x0FC6) __sfr SSPCON1;
2380 typedef union
2382 struct
2384 unsigned SSPM0 : 1;
2385 unsigned SSPM1 : 1;
2386 unsigned SSPM2 : 1;
2387 unsigned SSPM3 : 1;
2388 unsigned CKP : 1;
2389 unsigned SSPEN : 1;
2390 unsigned SSPOV : 1;
2391 unsigned WCOL : 1;
2394 struct
2396 unsigned SSPM : 4;
2397 unsigned : 4;
2399 } __SSPCON1bits_t;
2401 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
2403 #define _SSPM0 0x01
2404 #define _SSPM1 0x02
2405 #define _SSPM2 0x04
2406 #define _SSPM3 0x08
2407 #define _CKP 0x10
2408 #define _SSPEN 0x20
2409 #define _SSPOV 0x40
2410 #define _WCOL 0x80
2412 //==============================================================================
2415 //==============================================================================
2416 // SSPSTAT Bits
2418 extern __at(0x0FC7) __sfr SSPSTAT;
2420 typedef union
2422 struct
2424 unsigned BF : 1;
2425 unsigned UA : 1;
2426 unsigned R_NOT_W : 1;
2427 unsigned S : 1;
2428 unsigned P : 1;
2429 unsigned D_NOT_A : 1;
2430 unsigned CKE : 1;
2431 unsigned SMP : 1;
2434 struct
2436 unsigned : 1;
2437 unsigned : 1;
2438 unsigned R : 1;
2439 unsigned : 1;
2440 unsigned : 1;
2441 unsigned D : 1;
2442 unsigned : 1;
2443 unsigned : 1;
2446 struct
2448 unsigned : 1;
2449 unsigned : 1;
2450 unsigned NOT_W : 1;
2451 unsigned : 1;
2452 unsigned : 1;
2453 unsigned NOT_A : 1;
2454 unsigned : 1;
2455 unsigned : 1;
2458 struct
2460 unsigned : 1;
2461 unsigned : 1;
2462 unsigned R_W : 1;
2463 unsigned : 1;
2464 unsigned : 1;
2465 unsigned D_A : 1;
2466 unsigned : 1;
2467 unsigned : 1;
2470 struct
2472 unsigned : 1;
2473 unsigned : 1;
2474 unsigned NOT_WRITE : 1;
2475 unsigned : 1;
2476 unsigned : 1;
2477 unsigned NOT_ADDRESS : 1;
2478 unsigned : 1;
2479 unsigned : 1;
2481 } __SSPSTATbits_t;
2483 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
2485 #define _BF 0x01
2486 #define _UA 0x02
2487 #define _R_NOT_W 0x04
2488 #define _R 0x04
2489 #define _NOT_W 0x04
2490 #define _R_W 0x04
2491 #define _NOT_WRITE 0x04
2492 #define _S 0x08
2493 #define _P 0x10
2494 #define _D_NOT_A 0x20
2495 #define _D 0x20
2496 #define _NOT_A 0x20
2497 #define _D_A 0x20
2498 #define _NOT_ADDRESS 0x20
2499 #define _CKE 0x40
2500 #define _SMP 0x80
2502 //==============================================================================
2504 extern __at(0x0FC8) __sfr SSPADD;
2505 extern __at(0x0FC9) __sfr SSPBUF;
2507 //==============================================================================
2508 // T2CON Bits
2510 extern __at(0x0FCA) __sfr T2CON;
2512 typedef union
2514 struct
2516 unsigned T2CKPS0 : 1;
2517 unsigned T2CKPS1 : 1;
2518 unsigned TMR2ON : 1;
2519 unsigned TOUTPS0 : 1;
2520 unsigned TOUTPS1 : 1;
2521 unsigned TOUTPS2 : 1;
2522 unsigned TOUTPS3 : 1;
2523 unsigned : 1;
2526 struct
2528 unsigned : 1;
2529 unsigned : 1;
2530 unsigned : 1;
2531 unsigned T2OUTPS0 : 1;
2532 unsigned T2OUTPS1 : 1;
2533 unsigned T2OUTPS2 : 1;
2534 unsigned T2OUTPS3 : 1;
2535 unsigned : 1;
2538 struct
2540 unsigned T2CKPS : 2;
2541 unsigned : 6;
2544 struct
2546 unsigned : 3;
2547 unsigned TOUTPS : 4;
2548 unsigned : 1;
2551 struct
2553 unsigned : 3;
2554 unsigned T2OUTPS : 4;
2555 unsigned : 1;
2557 } __T2CONbits_t;
2559 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
2561 #define _T2CKPS0 0x01
2562 #define _T2CKPS1 0x02
2563 #define _TMR2ON 0x04
2564 #define _TOUTPS0 0x08
2565 #define _T2OUTPS0 0x08
2566 #define _TOUTPS1 0x10
2567 #define _T2OUTPS1 0x10
2568 #define _TOUTPS2 0x20
2569 #define _T2OUTPS2 0x20
2570 #define _TOUTPS3 0x40
2571 #define _T2OUTPS3 0x40
2573 //==============================================================================
2575 extern __at(0x0FCB) __sfr PR2;
2576 extern __at(0x0FCC) __sfr TMR2;
2578 //==============================================================================
2579 // T1CON Bits
2581 extern __at(0x0FCD) __sfr T1CON;
2583 typedef union
2585 struct
2587 unsigned TMR1ON : 1;
2588 unsigned TMR1CS : 1;
2589 unsigned NOT_T1SYNC : 1;
2590 unsigned T1OSCEN : 1;
2591 unsigned T1CKPS0 : 1;
2592 unsigned T1CKPS1 : 1;
2593 unsigned T1RUN : 1;
2594 unsigned RD16 : 1;
2597 struct
2599 unsigned : 1;
2600 unsigned : 1;
2601 unsigned T1SYNC : 1;
2602 unsigned : 1;
2603 unsigned : 1;
2604 unsigned : 1;
2605 unsigned : 1;
2606 unsigned : 1;
2609 struct
2611 unsigned : 4;
2612 unsigned T1CKPS : 2;
2613 unsigned : 2;
2615 } __T1CONbits_t;
2617 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
2619 #define _TMR1ON 0x01
2620 #define _TMR1CS 0x02
2621 #define _NOT_T1SYNC 0x04
2622 #define _T1SYNC 0x04
2623 #define _T1OSCEN 0x08
2624 #define _T1CKPS0 0x10
2625 #define _T1CKPS1 0x20
2626 #define _T1RUN 0x40
2627 #define _RD16 0x80
2629 //==============================================================================
2631 extern __at(0x0FCE) __sfr TMR1;
2632 extern __at(0x0FCE) __sfr TMR1L;
2633 extern __at(0x0FCF) __sfr TMR1H;
2635 //==============================================================================
2636 // RCON Bits
2638 extern __at(0x0FD0) __sfr RCON;
2640 typedef union
2642 struct
2644 unsigned NOT_BOR : 1;
2645 unsigned NOT_POR : 1;
2646 unsigned NOT_PD : 1;
2647 unsigned NOT_TO : 1;
2648 unsigned NOT_RI : 1;
2649 unsigned : 1;
2650 unsigned SBOREN : 1;
2651 unsigned IPEN : 1;
2654 struct
2656 unsigned BOR : 1;
2657 unsigned POR : 1;
2658 unsigned PD : 1;
2659 unsigned TO : 1;
2660 unsigned RI : 1;
2661 unsigned : 1;
2662 unsigned : 1;
2663 unsigned : 1;
2665 } __RCONbits_t;
2667 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
2669 #define _NOT_BOR 0x01
2670 #define _BOR 0x01
2671 #define _NOT_POR 0x02
2672 #define _POR 0x02
2673 #define _NOT_PD 0x04
2674 #define _PD 0x04
2675 #define _NOT_TO 0x08
2676 #define _TO 0x08
2677 #define _NOT_RI 0x10
2678 #define _RI 0x10
2679 #define _SBOREN 0x40
2680 #define _IPEN 0x80
2682 //==============================================================================
2685 //==============================================================================
2686 // WDTCON Bits
2688 extern __at(0x0FD1) __sfr WDTCON;
2690 typedef union
2692 struct
2694 unsigned SWDTEN : 1;
2695 unsigned : 1;
2696 unsigned : 1;
2697 unsigned : 1;
2698 unsigned : 1;
2699 unsigned : 1;
2700 unsigned : 1;
2701 unsigned : 1;
2704 struct
2706 unsigned SWDTE : 1;
2707 unsigned : 1;
2708 unsigned : 1;
2709 unsigned : 1;
2710 unsigned : 1;
2711 unsigned : 1;
2712 unsigned : 1;
2713 unsigned : 1;
2715 } __WDTCONbits_t;
2717 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
2719 #define _SWDTEN 0x01
2720 #define _SWDTE 0x01
2722 //==============================================================================
2725 //==============================================================================
2726 // HLVDCON Bits
2728 extern __at(0x0FD2) __sfr HLVDCON;
2730 typedef union
2732 struct
2734 unsigned HLVDL0 : 1;
2735 unsigned HLVDL1 : 1;
2736 unsigned HLVDL2 : 1;
2737 unsigned HLVDL3 : 1;
2738 unsigned HLVDEN : 1;
2739 unsigned IRVST : 1;
2740 unsigned : 1;
2741 unsigned VDIRMAG : 1;
2744 struct
2746 unsigned LVDL0 : 1;
2747 unsigned LVDL1 : 1;
2748 unsigned LVDL2 : 1;
2749 unsigned LVDL3 : 1;
2750 unsigned LVDEN : 1;
2751 unsigned BGST : 1;
2752 unsigned : 1;
2753 unsigned : 1;
2756 struct
2758 unsigned LVV0 : 1;
2759 unsigned LVV1 : 1;
2760 unsigned LVV2 : 1;
2761 unsigned LVV3 : 1;
2762 unsigned : 1;
2763 unsigned : 1;
2764 unsigned : 1;
2765 unsigned : 1;
2768 struct
2770 unsigned LVV : 4;
2771 unsigned : 4;
2774 struct
2776 unsigned HLVDL : 4;
2777 unsigned : 4;
2780 struct
2782 unsigned LVDL : 4;
2783 unsigned : 4;
2785 } __HLVDCONbits_t;
2787 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
2789 #define _HLVDL0 0x01
2790 #define _LVDL0 0x01
2791 #define _LVV0 0x01
2792 #define _HLVDL1 0x02
2793 #define _LVDL1 0x02
2794 #define _LVV1 0x02
2795 #define _HLVDL2 0x04
2796 #define _LVDL2 0x04
2797 #define _LVV2 0x04
2798 #define _HLVDL3 0x08
2799 #define _LVDL3 0x08
2800 #define _LVV3 0x08
2801 #define _HLVDEN 0x10
2802 #define _LVDEN 0x10
2803 #define _IRVST 0x20
2804 #define _BGST 0x20
2805 #define _VDIRMAG 0x80
2807 //==============================================================================
2810 //==============================================================================
2811 // LVDCON Bits
2813 extern __at(0x0FD2) __sfr LVDCON;
2815 typedef union
2817 struct
2819 unsigned HLVDL0 : 1;
2820 unsigned HLVDL1 : 1;
2821 unsigned HLVDL2 : 1;
2822 unsigned HLVDL3 : 1;
2823 unsigned HLVDEN : 1;
2824 unsigned IRVST : 1;
2825 unsigned : 1;
2826 unsigned VDIRMAG : 1;
2829 struct
2831 unsigned LVDL0 : 1;
2832 unsigned LVDL1 : 1;
2833 unsigned LVDL2 : 1;
2834 unsigned LVDL3 : 1;
2835 unsigned LVDEN : 1;
2836 unsigned BGST : 1;
2837 unsigned : 1;
2838 unsigned : 1;
2841 struct
2843 unsigned LVV0 : 1;
2844 unsigned LVV1 : 1;
2845 unsigned LVV2 : 1;
2846 unsigned LVV3 : 1;
2847 unsigned : 1;
2848 unsigned : 1;
2849 unsigned : 1;
2850 unsigned : 1;
2853 struct
2855 unsigned LVDL : 4;
2856 unsigned : 4;
2859 struct
2861 unsigned HLVDL : 4;
2862 unsigned : 4;
2865 struct
2867 unsigned LVV : 4;
2868 unsigned : 4;
2870 } __LVDCONbits_t;
2872 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
2874 #define _LVDCON_HLVDL0 0x01
2875 #define _LVDCON_LVDL0 0x01
2876 #define _LVDCON_LVV0 0x01
2877 #define _LVDCON_HLVDL1 0x02
2878 #define _LVDCON_LVDL1 0x02
2879 #define _LVDCON_LVV1 0x02
2880 #define _LVDCON_HLVDL2 0x04
2881 #define _LVDCON_LVDL2 0x04
2882 #define _LVDCON_LVV2 0x04
2883 #define _LVDCON_HLVDL3 0x08
2884 #define _LVDCON_LVDL3 0x08
2885 #define _LVDCON_LVV3 0x08
2886 #define _LVDCON_HLVDEN 0x10
2887 #define _LVDCON_LVDEN 0x10
2888 #define _LVDCON_IRVST 0x20
2889 #define _LVDCON_BGST 0x20
2890 #define _LVDCON_VDIRMAG 0x80
2892 //==============================================================================
2895 //==============================================================================
2896 // OSCCON Bits
2898 extern __at(0x0FD3) __sfr OSCCON;
2900 typedef union
2902 struct
2904 unsigned SCS0 : 1;
2905 unsigned SCS1 : 1;
2906 unsigned IOFS : 1;
2907 unsigned OSTS : 1;
2908 unsigned IRCF0 : 1;
2909 unsigned IRCF1 : 1;
2910 unsigned IRCF2 : 1;
2911 unsigned IDLEN : 1;
2914 struct
2916 unsigned : 1;
2917 unsigned : 1;
2918 unsigned FLTS : 1;
2919 unsigned : 1;
2920 unsigned : 1;
2921 unsigned : 1;
2922 unsigned : 1;
2923 unsigned : 1;
2926 struct
2928 unsigned SCS : 2;
2929 unsigned : 6;
2932 struct
2934 unsigned : 4;
2935 unsigned IRCF : 3;
2936 unsigned : 1;
2938 } __OSCCONbits_t;
2940 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
2942 #define _SCS0 0x01
2943 #define _SCS1 0x02
2944 #define _IOFS 0x04
2945 #define _FLTS 0x04
2946 #define _OSTS 0x08
2947 #define _IRCF0 0x10
2948 #define _IRCF1 0x20
2949 #define _IRCF2 0x40
2950 #define _IDLEN 0x80
2952 //==============================================================================
2955 //==============================================================================
2956 // T0CON Bits
2958 extern __at(0x0FD5) __sfr T0CON;
2960 typedef union
2962 struct
2964 unsigned T0PS0 : 1;
2965 unsigned T0PS1 : 1;
2966 unsigned T0PS2 : 1;
2967 unsigned PSA : 1;
2968 unsigned T0SE : 1;
2969 unsigned T0CS : 1;
2970 unsigned T08BIT : 1;
2971 unsigned TMR0ON : 1;
2974 struct
2976 unsigned : 1;
2977 unsigned : 1;
2978 unsigned : 1;
2979 unsigned : 1;
2980 unsigned : 1;
2981 unsigned : 1;
2982 unsigned T016BIT : 1;
2983 unsigned : 1;
2986 struct
2988 unsigned T0PS : 3;
2989 unsigned : 5;
2991 } __T0CONbits_t;
2993 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
2995 #define _T0PS0 0x01
2996 #define _T0PS1 0x02
2997 #define _T0PS2 0x04
2998 #define _PSA 0x08
2999 #define _T0SE 0x10
3000 #define _T0CS 0x20
3001 #define _T08BIT 0x40
3002 #define _T016BIT 0x40
3003 #define _TMR0ON 0x80
3005 //==============================================================================
3007 extern __at(0x0FD6) __sfr TMR0;
3008 extern __at(0x0FD6) __sfr TMR0L;
3009 extern __at(0x0FD7) __sfr TMR0H;
3011 //==============================================================================
3012 // STATUS Bits
3014 extern __at(0x0FD8) __sfr STATUS;
3016 typedef struct
3018 unsigned C : 1;
3019 unsigned DC : 1;
3020 unsigned Z : 1;
3021 unsigned OV : 1;
3022 unsigned N : 1;
3023 unsigned : 1;
3024 unsigned : 1;
3025 unsigned : 1;
3026 } __STATUSbits_t;
3028 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3030 #define _C 0x01
3031 #define _DC 0x02
3032 #define _Z 0x04
3033 #define _OV 0x08
3034 #define _N 0x10
3036 //==============================================================================
3038 extern __at(0x0FD9) __sfr FSR2L;
3039 extern __at(0x0FDA) __sfr FSR2H;
3040 extern __at(0x0FDB) __sfr PLUSW2;
3041 extern __at(0x0FDC) __sfr PREINC2;
3042 extern __at(0x0FDD) __sfr POSTDEC2;
3043 extern __at(0x0FDE) __sfr POSTINC2;
3044 extern __at(0x0FDF) __sfr INDF2;
3045 extern __at(0x0FE0) __sfr BSR;
3046 extern __at(0x0FE1) __sfr FSR1L;
3047 extern __at(0x0FE2) __sfr FSR1H;
3048 extern __at(0x0FE3) __sfr PLUSW1;
3049 extern __at(0x0FE4) __sfr PREINC1;
3050 extern __at(0x0FE5) __sfr POSTDEC1;
3051 extern __at(0x0FE6) __sfr POSTINC1;
3052 extern __at(0x0FE7) __sfr INDF1;
3053 extern __at(0x0FE8) __sfr WREG;
3054 extern __at(0x0FE9) __sfr FSR0L;
3055 extern __at(0x0FEA) __sfr FSR0H;
3056 extern __at(0x0FEB) __sfr PLUSW0;
3057 extern __at(0x0FEC) __sfr PREINC0;
3058 extern __at(0x0FED) __sfr POSTDEC0;
3059 extern __at(0x0FEE) __sfr POSTINC0;
3060 extern __at(0x0FEF) __sfr INDF0;
3062 //==============================================================================
3063 // INTCON3 Bits
3065 extern __at(0x0FF0) __sfr INTCON3;
3067 typedef union
3069 struct
3071 unsigned INT1IF : 1;
3072 unsigned INT2IF : 1;
3073 unsigned : 1;
3074 unsigned INT1IE : 1;
3075 unsigned INT2IE : 1;
3076 unsigned : 1;
3077 unsigned INT1IP : 1;
3078 unsigned INT2IP : 1;
3081 struct
3083 unsigned INT1F : 1;
3084 unsigned INT2F : 1;
3085 unsigned : 1;
3086 unsigned INT1E : 1;
3087 unsigned INT2E : 1;
3088 unsigned : 1;
3089 unsigned INT1P : 1;
3090 unsigned INT2P : 1;
3092 } __INTCON3bits_t;
3094 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3096 #define _INT1IF 0x01
3097 #define _INT1F 0x01
3098 #define _INT2IF 0x02
3099 #define _INT2F 0x02
3100 #define _INT1IE 0x08
3101 #define _INT1E 0x08
3102 #define _INT2IE 0x10
3103 #define _INT2E 0x10
3104 #define _INT1IP 0x40
3105 #define _INT1P 0x40
3106 #define _INT2IP 0x80
3107 #define _INT2P 0x80
3109 //==============================================================================
3112 //==============================================================================
3113 // INTCON2 Bits
3115 extern __at(0x0FF1) __sfr INTCON2;
3117 typedef union
3119 struct
3121 unsigned RBIP : 1;
3122 unsigned : 1;
3123 unsigned TMR0IP : 1;
3124 unsigned : 1;
3125 unsigned INTEDG2 : 1;
3126 unsigned INTEDG1 : 1;
3127 unsigned INTEDG0 : 1;
3128 unsigned NOT_RBPU : 1;
3131 struct
3133 unsigned : 1;
3134 unsigned : 1;
3135 unsigned : 1;
3136 unsigned : 1;
3137 unsigned : 1;
3138 unsigned : 1;
3139 unsigned : 1;
3140 unsigned RBPU : 1;
3142 } __INTCON2bits_t;
3144 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3146 #define _RBIP 0x01
3147 #define _TMR0IP 0x04
3148 #define _INTEDG2 0x10
3149 #define _INTEDG1 0x20
3150 #define _INTEDG0 0x40
3151 #define _NOT_RBPU 0x80
3152 #define _RBPU 0x80
3154 //==============================================================================
3157 //==============================================================================
3158 // INTCON Bits
3160 extern __at(0x0FF2) __sfr INTCON;
3162 typedef union
3164 struct
3166 unsigned RBIF : 1;
3167 unsigned INT0IF : 1;
3168 unsigned TMR0IF : 1;
3169 unsigned RBIE : 1;
3170 unsigned INT0IE : 1;
3171 unsigned TMR0IE : 1;
3172 unsigned PEIE_GIEL : 1;
3173 unsigned GIE_GIEH : 1;
3176 struct
3178 unsigned : 1;
3179 unsigned INT0F : 1;
3180 unsigned T0IF : 1;
3181 unsigned : 1;
3182 unsigned INT0E : 1;
3183 unsigned T0IE : 1;
3184 unsigned PEIE : 1;
3185 unsigned GIE : 1;
3188 struct
3190 unsigned : 1;
3191 unsigned : 1;
3192 unsigned : 1;
3193 unsigned : 1;
3194 unsigned : 1;
3195 unsigned : 1;
3196 unsigned GIEL : 1;
3197 unsigned GIEH : 1;
3199 } __INTCONbits_t;
3201 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3203 #define _RBIF 0x01
3204 #define _INT0IF 0x02
3205 #define _INT0F 0x02
3206 #define _TMR0IF 0x04
3207 #define _T0IF 0x04
3208 #define _RBIE 0x08
3209 #define _INT0IE 0x10
3210 #define _INT0E 0x10
3211 #define _TMR0IE 0x20
3212 #define _T0IE 0x20
3213 #define _PEIE_GIEL 0x40
3214 #define _PEIE 0x40
3215 #define _GIEL 0x40
3216 #define _GIE_GIEH 0x80
3217 #define _GIE 0x80
3218 #define _GIEH 0x80
3220 //==============================================================================
3222 extern __at(0x0FF3) __sfr PROD;
3223 extern __at(0x0FF3) __sfr PRODL;
3224 extern __at(0x0FF4) __sfr PRODH;
3225 extern __at(0x0FF5) __sfr TABLAT;
3226 extern __at(0x0FF6) __sfr TBLPTR;
3227 extern __at(0x0FF6) __sfr TBLPTRL;
3228 extern __at(0x0FF7) __sfr TBLPTRH;
3229 extern __at(0x0FF8) __sfr TBLPTRU;
3230 extern __at(0x0FF9) __sfr PC;
3231 extern __at(0x0FF9) __sfr PCL;
3232 extern __at(0x0FFA) __sfr PCLATH;
3233 extern __at(0x0FFB) __sfr PCLATU;
3235 //==============================================================================
3236 // STKPTR Bits
3238 extern __at(0x0FFC) __sfr STKPTR;
3240 typedef union
3242 struct
3244 unsigned SP0 : 1;
3245 unsigned SP1 : 1;
3246 unsigned SP2 : 1;
3247 unsigned SP3 : 1;
3248 unsigned SP4 : 1;
3249 unsigned : 1;
3250 unsigned STKUNF : 1;
3251 unsigned STKFUL : 1;
3254 struct
3256 unsigned : 1;
3257 unsigned : 1;
3258 unsigned : 1;
3259 unsigned : 1;
3260 unsigned : 1;
3261 unsigned : 1;
3262 unsigned : 1;
3263 unsigned STKOVF : 1;
3266 struct
3268 unsigned SP : 5;
3269 unsigned : 3;
3271 } __STKPTRbits_t;
3273 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
3275 #define _SP0 0x01
3276 #define _SP1 0x02
3277 #define _SP2 0x04
3278 #define _SP3 0x08
3279 #define _SP4 0x10
3280 #define _STKUNF 0x40
3281 #define _STKFUL 0x80
3282 #define _STKOVF 0x80
3284 //==============================================================================
3286 extern __at(0x0FFD) __sfr TOS;
3287 extern __at(0x0FFD) __sfr TOSL;
3288 extern __at(0x0FFE) __sfr TOSH;
3289 extern __at(0x0FFF) __sfr TOSU;
3291 //==============================================================================
3293 // Configuration Bits
3295 //==============================================================================
3297 #define __CONFIG1H 0x300001
3298 #define __CONFIG2L 0x300002
3299 #define __CONFIG2H 0x300003
3300 #define __CONFIG3H 0x300005
3301 #define __CONFIG4L 0x300006
3302 #define __CONFIG5L 0x300008
3303 #define __CONFIG5H 0x300009
3304 #define __CONFIG6L 0x30000A
3305 #define __CONFIG6H 0x30000B
3306 #define __CONFIG7L 0x30000C
3307 #define __CONFIG7H 0x30000D
3309 //----------------------------- CONFIG1H Options -------------------------------
3311 #define _OSC_LP_1H 0xF0 // LP Oscillator.
3312 #define _OSC_XT_1H 0xF1 // XT Oscillator.
3313 #define _OSC_HS_1H 0xF2 // HS Oscillator.
3314 #define _OSC_RC_1H 0xF3 // External RC oscillator, CLKO function on RA6.
3315 #define _OSC_EC_1H 0xF4 // EC oscillator, CLKO function on RA6.
3316 #define _OSC_ECIO_1H 0xF5 // EC oscillator, port function on RA6.
3317 #define _OSC_HSPLL_1H 0xF6 // HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1).
3318 #define _OSC_RCIO_1H 0xF7 // External RC oscillator, port function on RA6.
3319 #define _OSC_INTIO2_1H 0xF8 // Internal oscillator block, port function on RA6 and RA7.
3320 #define _OSC_INTIO1_1H 0xF9 // Internal oscillator block, CLKO function on RA6, port function on RA7.
3321 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
3322 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
3323 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
3324 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
3326 //----------------------------- CONFIG2L Options -------------------------------
3328 #define _PWRT_ON_2L 0xFE // PWRT enabled.
3329 #define _PWRT_OFF_2L 0xFF // PWRT disabled.
3330 #define _BOR_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
3331 #define _BOR_SOFT_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
3332 #define _BOR_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
3333 #define _BOR_ON_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
3334 #define _BORV_0_2L 0xE7 // Maximum Setting.
3335 #define _BORV_1_2L 0xEF
3336 #define _BORV_2_2L 0xF7
3337 #define _BORV_3_2L 0xFF // Minimum Setting.
3339 //----------------------------- CONFIG2H Options -------------------------------
3341 #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
3342 #define _WDT_ON_2H 0xFF // WDT enabled.
3343 #define _WDTPS_1_2H 0xE1 // 1:1.
3344 #define _WDTPS_2_2H 0xE3 // 1:2.
3345 #define _WDTPS_4_2H 0xE5 // 1:4.
3346 #define _WDTPS_8_2H 0xE7 // 1:8.
3347 #define _WDTPS_16_2H 0xE9 // 1:16.
3348 #define _WDTPS_32_2H 0xEB // 1:32.
3349 #define _WDTPS_64_2H 0xED // 1:64.
3350 #define _WDTPS_128_2H 0xEF // 1:128.
3351 #define _WDTPS_256_2H 0xF1 // 1:256.
3352 #define _WDTPS_512_2H 0xF3 // 1:512.
3353 #define _WDTPS_1024_2H 0xF5 // 1:1024.
3354 #define _WDTPS_2048_2H 0xF7 // 1:2048.
3355 #define _WDTPS_4096_2H 0xF9 // 1:4096.
3356 #define _WDTPS_8192_2H 0xFB // 1:8192.
3357 #define _WDTPS_16384_2H 0xFD // 1:16384.
3358 #define _WDTPS_32768_2H 0xFF // 1:32768.
3360 //----------------------------- CONFIG3H Options -------------------------------
3362 #define _CCP2MX_RB3_3H 0xFE // CCP2 input/output is multiplexed with RB3.
3363 #define _CCP2MX_RC1_3H 0xFF // CCP2 input/output is multiplexed with RC1.
3364 #define _PBADEN_DIG_3H 0xFD // PORTB<4:0> pins are configured as digital I/O on Reset.
3365 #define _PBADEN_ANA_3H 0xFF // PORTB<4:0> pins are configured as analog input channels on Reset.
3366 #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
3367 #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
3368 #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; MCLR disabled.
3369 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input pin disabled.
3371 //----------------------------- CONFIG4L Options -------------------------------
3373 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
3374 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
3375 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
3376 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled.
3377 #define _BBSIZ_BB256_4L 0xCF // 256 Word.
3378 #define _BBSIZ_BB512_4L 0xFF // 512 Word.
3379 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
3380 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
3381 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
3382 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
3384 //----------------------------- CONFIG5L Options -------------------------------
3386 #define _CP0_ON_5L 0xFE // Block 0 code-protected.
3387 #define _CP0_OFF_5L 0xFF // Block 0 not code-protected.
3388 #define _CP1_ON_5L 0xFD // Block 1 code-protected.
3389 #define _CP1_OFF_5L 0xFF // Block 1 not code-protected.
3391 //----------------------------- CONFIG5H Options -------------------------------
3393 #define _CPB_ON_5H 0xBF // Boot block code-protected.
3394 #define _CPB_OFF_5H 0xFF // Boot block not code-protected.
3395 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
3396 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
3398 //----------------------------- CONFIG6L Options -------------------------------
3400 #define _WRT0_ON_6L 0xFE // Block 0 write-protected.
3401 #define _WRT0_OFF_6L 0xFF // Block 0 not write-protected.
3402 #define _WRT1_ON_6L 0xFD // Block 1 write-protected.
3403 #define _WRT1_OFF_6L 0xFF // Block 1 not write-protected.
3405 //----------------------------- CONFIG6H Options -------------------------------
3407 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
3408 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
3409 #define _WRTB_ON_6H 0xBF // Boot block write-protected.
3410 #define _WRTB_OFF_6H 0xFF // Boot block not write-protected.
3411 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
3412 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
3414 //----------------------------- CONFIG7L Options -------------------------------
3416 #define _EBTR0_ON_7L 0xFE // Block 0 protected from table reads executed in other blocks.
3417 #define _EBTR0_OFF_7L 0xFF // Block 0 not protected from table reads executed in other blocks.
3418 #define _EBTR1_ON_7L 0xFD // Block 1 protected from table reads executed in other blocks.
3419 #define _EBTR1_OFF_7L 0xFF // Block 1 not protected from table reads executed in other blocks.
3421 //----------------------------- CONFIG7H Options -------------------------------
3423 #define _EBTRB_ON_7H 0xBF // Boot block protected from table reads executed in other blocks.
3424 #define _EBTRB_OFF_7H 0xFF // Boot block not protected from table reads executed in other blocks.
3426 //==============================================================================
3428 #define __DEVID1 0x3FFFFE
3429 #define __DEVID2 0x3FFFFF
3431 #define __IDLOC0 0x200000
3432 #define __IDLOC1 0x200001
3433 #define __IDLOC2 0x200002
3434 #define __IDLOC3 0x200003
3435 #define __IDLOC4 0x200004
3436 #define __IDLOC5 0x200005
3437 #define __IDLOC6 0x200006
3438 #define __IDLOC7 0x200007
3440 #endif // #ifndef __PIC18F4221_H__