Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f45k20.h
blobc6ee577fd90fc92ebb1897f1590921462485e5e3
1 /*
2 * This declarations of the PIC18F45K20 MCU.
4 * This file is part of the GNU PIC library for SDCC, originally
5 * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
7 * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:30 UTC.
9 * SDCC is licensed under the GNU Public license (GPL) v2. Note that
10 * this license covers the code to the compiler and other executables,
11 * but explicitly does not cover any code or objects generated by sdcc.
13 * For pic device libraries and header files which are derived from
14 * Microchip header (.inc) and linker script (.lkr) files Microchip
15 * requires that "The header files should state that they are only to be
16 * used with authentic Microchip devices" which makes them incompatible
17 * with the GPL. Pic device libraries and header files are located at
18 * non-free/lib and non-free/include directories respectively.
19 * Sdcc should be run with the --use-non-free command line option in
20 * order to include non-free header files and libraries.
22 * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
25 #ifndef __PIC18F45K20_H__
26 #define __PIC18F45K20_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // SSPMSK Bits
40 extern __at(0x0F77) __sfr SSPMSK;
42 typedef struct
44 unsigned MSK0 : 1;
45 unsigned MSK1 : 1;
46 unsigned MSK2 : 1;
47 unsigned MSK3 : 1;
48 unsigned MSK4 : 1;
49 unsigned MSK5 : 1;
50 unsigned MSK6 : 1;
51 unsigned MSK7 : 1;
52 } __SSPMSKbits_t;
54 extern __at(0x0F77) volatile __SSPMSKbits_t SSPMSKbits;
56 #define _MSK0 0x01
57 #define _MSK1 0x02
58 #define _MSK2 0x04
59 #define _MSK3 0x08
60 #define _MSK4 0x10
61 #define _MSK5 0x20
62 #define _MSK6 0x40
63 #define _MSK7 0x80
65 //==============================================================================
68 //==============================================================================
69 // SLRCON Bits
71 extern __at(0x0F78) __sfr SLRCON;
73 typedef struct
75 unsigned SLRA : 1;
76 unsigned SLRB : 1;
77 unsigned SLRC : 1;
78 unsigned SLRD : 1;
79 unsigned SLRE : 1;
80 unsigned : 1;
81 unsigned : 1;
82 unsigned : 1;
83 } __SLRCONbits_t;
85 extern __at(0x0F78) volatile __SLRCONbits_t SLRCONbits;
87 #define _SLRA 0x01
88 #define _SLRB 0x02
89 #define _SLRC 0x04
90 #define _SLRD 0x08
91 #define _SLRE 0x10
93 //==============================================================================
96 //==============================================================================
97 // CM2CON1 Bits
99 extern __at(0x0F79) __sfr CM2CON1;
101 typedef struct
103 unsigned : 1;
104 unsigned : 1;
105 unsigned : 1;
106 unsigned : 1;
107 unsigned C2RSEL : 1;
108 unsigned C1RSEL : 1;
109 unsigned MC2OUT : 1;
110 unsigned MC1OUT : 1;
111 } __CM2CON1bits_t;
113 extern __at(0x0F79) volatile __CM2CON1bits_t CM2CON1bits;
115 #define _C2RSEL 0x10
116 #define _C1RSEL 0x20
117 #define _MC2OUT 0x40
118 #define _MC1OUT 0x80
120 //==============================================================================
123 //==============================================================================
124 // CM2CON0 Bits
126 extern __at(0x0F7A) __sfr CM2CON0;
128 typedef union
130 struct
132 unsigned C2CH0 : 1;
133 unsigned C2CH1 : 1;
134 unsigned C2R : 1;
135 unsigned C2SP : 1;
136 unsigned C2POL : 1;
137 unsigned C2OE : 1;
138 unsigned C2OUT : 1;
139 unsigned C2ON : 1;
142 struct
144 unsigned C2CH : 2;
145 unsigned : 6;
147 } __CM2CON0bits_t;
149 extern __at(0x0F7A) volatile __CM2CON0bits_t CM2CON0bits;
151 #define _C2CH0 0x01
152 #define _C2CH1 0x02
153 #define _C2R 0x04
154 #define _C2SP 0x08
155 #define _C2POL 0x10
156 #define _C2OE 0x20
157 #define _C2OUT 0x40
158 #define _C2ON 0x80
160 //==============================================================================
163 //==============================================================================
164 // CM1CON0 Bits
166 extern __at(0x0F7B) __sfr CM1CON0;
168 typedef union
170 struct
172 unsigned C1CH0 : 1;
173 unsigned C1CH1 : 1;
174 unsigned C1R : 1;
175 unsigned C1SP : 1;
176 unsigned C1POL : 1;
177 unsigned C1OE : 1;
178 unsigned C1OUT : 1;
179 unsigned C1ON : 1;
182 struct
184 unsigned C1CH : 2;
185 unsigned : 6;
187 } __CM1CON0bits_t;
189 extern __at(0x0F7B) volatile __CM1CON0bits_t CM1CON0bits;
191 #define _C1CH0 0x01
192 #define _C1CH1 0x02
193 #define _C1R 0x04
194 #define _C1SP 0x08
195 #define _C1POL 0x10
196 #define _C1OE 0x20
197 #define _C1OUT 0x40
198 #define _C1ON 0x80
200 //==============================================================================
203 //==============================================================================
204 // WPUB Bits
206 extern __at(0x0F7C) __sfr WPUB;
208 typedef struct
210 unsigned WPUB0 : 1;
211 unsigned WPUB1 : 1;
212 unsigned WPUB2 : 1;
213 unsigned WPUB3 : 1;
214 unsigned WPUB4 : 1;
215 unsigned WPUB5 : 1;
216 unsigned WPUB6 : 1;
217 unsigned WPUB7 : 1;
218 } __WPUBbits_t;
220 extern __at(0x0F7C) volatile __WPUBbits_t WPUBbits;
222 #define _WPUB0 0x01
223 #define _WPUB1 0x02
224 #define _WPUB2 0x04
225 #define _WPUB3 0x08
226 #define _WPUB4 0x10
227 #define _WPUB5 0x20
228 #define _WPUB6 0x40
229 #define _WPUB7 0x80
231 //==============================================================================
234 //==============================================================================
235 // IOCB Bits
237 extern __at(0x0F7D) __sfr IOCB;
239 typedef struct
241 unsigned : 1;
242 unsigned : 1;
243 unsigned : 1;
244 unsigned : 1;
245 unsigned IOCB4 : 1;
246 unsigned IOCB5 : 1;
247 unsigned IOCB6 : 1;
248 unsigned IOCB7 : 1;
249 } __IOCBbits_t;
251 extern __at(0x0F7D) volatile __IOCBbits_t IOCBbits;
253 #define _IOCB4 0x10
254 #define _IOCB5 0x20
255 #define _IOCB6 0x40
256 #define _IOCB7 0x80
258 //==============================================================================
261 //==============================================================================
262 // ANSEL Bits
264 extern __at(0x0F7E) __sfr ANSEL;
266 typedef struct
268 unsigned ANS0 : 1;
269 unsigned ANS1 : 1;
270 unsigned ANS2 : 1;
271 unsigned ANS3 : 1;
272 unsigned ANS4 : 1;
273 unsigned ANS5 : 1;
274 unsigned ANS6 : 1;
275 unsigned ANS7 : 1;
276 } __ANSELbits_t;
278 extern __at(0x0F7E) volatile __ANSELbits_t ANSELbits;
280 #define _ANS0 0x01
281 #define _ANS1 0x02
282 #define _ANS2 0x04
283 #define _ANS3 0x08
284 #define _ANS4 0x10
285 #define _ANS5 0x20
286 #define _ANS6 0x40
287 #define _ANS7 0x80
289 //==============================================================================
292 //==============================================================================
293 // ANSELH Bits
295 extern __at(0x0F7F) __sfr ANSELH;
297 typedef struct
299 unsigned ANS8 : 1;
300 unsigned ANS9 : 1;
301 unsigned ANS10 : 1;
302 unsigned ANS11 : 1;
303 unsigned ANS12 : 1;
304 unsigned : 1;
305 unsigned : 1;
306 unsigned : 1;
307 } __ANSELHbits_t;
309 extern __at(0x0F7F) volatile __ANSELHbits_t ANSELHbits;
311 #define _ANS8 0x01
312 #define _ANS9 0x02
313 #define _ANS10 0x04
314 #define _ANS11 0x08
315 #define _ANS12 0x10
317 //==============================================================================
320 //==============================================================================
321 // PORTA Bits
323 extern __at(0x0F80) __sfr PORTA;
325 typedef union
327 struct
329 unsigned RA0 : 1;
330 unsigned RA1 : 1;
331 unsigned RA2 : 1;
332 unsigned RA3 : 1;
333 unsigned RA4 : 1;
334 unsigned RA5 : 1;
335 unsigned RA6 : 1;
336 unsigned RA7 : 1;
339 struct
341 unsigned AN0 : 1;
342 unsigned AN1 : 1;
343 unsigned AN2 : 1;
344 unsigned AN3 : 1;
345 unsigned C1OUT : 1;
346 unsigned AN4 : 1;
347 unsigned : 1;
348 unsigned : 1;
351 struct
353 unsigned C12IN0M : 1;
354 unsigned C12IN1M : 1;
355 unsigned C2INP : 1;
356 unsigned C1INP : 1;
357 unsigned T0CKI : 1;
358 unsigned C2OUT : 1;
359 unsigned : 1;
360 unsigned : 1;
363 struct
365 unsigned C12IN0N : 1;
366 unsigned C12IN1N : 1;
367 unsigned VREFM : 1;
368 unsigned VREFP : 1;
369 unsigned : 1;
370 unsigned SS : 1;
371 unsigned : 1;
372 unsigned : 1;
375 struct
377 unsigned : 1;
378 unsigned : 1;
379 unsigned VREFN : 1;
380 unsigned : 1;
381 unsigned : 1;
382 unsigned NOT_SS : 1;
383 unsigned : 1;
384 unsigned : 1;
387 struct
389 unsigned : 1;
390 unsigned : 1;
391 unsigned CVREF : 1;
392 unsigned : 1;
393 unsigned : 1;
394 unsigned LVDIN : 1;
395 unsigned : 1;
396 unsigned : 1;
399 struct
401 unsigned : 1;
402 unsigned : 1;
403 unsigned : 1;
404 unsigned : 1;
405 unsigned : 1;
406 unsigned HLVDIN : 1;
407 unsigned : 1;
408 unsigned : 1;
410 } __PORTAbits_t;
412 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
414 #define _PORTA_RA0 0x01
415 #define _PORTA_AN0 0x01
416 #define _PORTA_C12IN0M 0x01
417 #define _PORTA_C12IN0N 0x01
418 #define _PORTA_RA1 0x02
419 #define _PORTA_AN1 0x02
420 #define _PORTA_C12IN1M 0x02
421 #define _PORTA_C12IN1N 0x02
422 #define _PORTA_RA2 0x04
423 #define _PORTA_AN2 0x04
424 #define _PORTA_C2INP 0x04
425 #define _PORTA_VREFM 0x04
426 #define _PORTA_VREFN 0x04
427 #define _PORTA_CVREF 0x04
428 #define _PORTA_RA3 0x08
429 #define _PORTA_AN3 0x08
430 #define _PORTA_C1INP 0x08
431 #define _PORTA_VREFP 0x08
432 #define _PORTA_RA4 0x10
433 #define _PORTA_C1OUT 0x10
434 #define _PORTA_T0CKI 0x10
435 #define _PORTA_RA5 0x20
436 #define _PORTA_AN4 0x20
437 #define _PORTA_C2OUT 0x20
438 #define _PORTA_SS 0x20
439 #define _PORTA_NOT_SS 0x20
440 #define _PORTA_LVDIN 0x20
441 #define _PORTA_HLVDIN 0x20
442 #define _PORTA_RA6 0x40
443 #define _PORTA_RA7 0x80
445 //==============================================================================
448 //==============================================================================
449 // PORTB Bits
451 extern __at(0x0F81) __sfr PORTB;
453 typedef union
455 struct
457 unsigned RB0 : 1;
458 unsigned RB1 : 1;
459 unsigned RB2 : 1;
460 unsigned RB3 : 1;
461 unsigned RB4 : 1;
462 unsigned RB5 : 1;
463 unsigned RB6 : 1;
464 unsigned RB7 : 1;
467 struct
469 unsigned INT0 : 1;
470 unsigned INT1 : 1;
471 unsigned INT2 : 1;
472 unsigned CCP2 : 1;
473 unsigned KBI0 : 1;
474 unsigned KBI1 : 1;
475 unsigned KBI2 : 1;
476 unsigned KBI3 : 1;
479 struct
481 unsigned AN12 : 1;
482 unsigned AN10 : 1;
483 unsigned AN8 : 1;
484 unsigned AN9 : 1;
485 unsigned AN11 : 1;
486 unsigned PGM : 1;
487 unsigned PGC : 1;
488 unsigned PGD : 1;
491 struct
493 unsigned FLT0 : 1;
494 unsigned C12IN3M : 1;
495 unsigned : 1;
496 unsigned C12IN2M : 1;
497 unsigned : 1;
498 unsigned : 1;
499 unsigned : 1;
500 unsigned : 1;
503 struct
505 unsigned : 1;
506 unsigned C12IN3N : 1;
507 unsigned : 1;
508 unsigned C12IN2N : 1;
509 unsigned : 1;
510 unsigned : 1;
511 unsigned : 1;
512 unsigned : 1;
515 struct
517 unsigned INT : 3;
518 unsigned : 5;
521 struct
523 unsigned : 4;
524 unsigned KBI : 4;
526 } __PORTBbits_t;
528 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
530 #define _PORTB_RB0 0x01
531 #define _PORTB_INT0 0x01
532 #define _PORTB_AN12 0x01
533 #define _PORTB_FLT0 0x01
534 #define _PORTB_RB1 0x02
535 #define _PORTB_INT1 0x02
536 #define _PORTB_AN10 0x02
537 #define _PORTB_C12IN3M 0x02
538 #define _PORTB_C12IN3N 0x02
539 #define _PORTB_RB2 0x04
540 #define _PORTB_INT2 0x04
541 #define _PORTB_AN8 0x04
542 #define _PORTB_RB3 0x08
543 #define _PORTB_CCP2 0x08
544 #define _PORTB_AN9 0x08
545 #define _PORTB_C12IN2M 0x08
546 #define _PORTB_C12IN2N 0x08
547 #define _PORTB_RB4 0x10
548 #define _PORTB_KBI0 0x10
549 #define _PORTB_AN11 0x10
550 #define _PORTB_RB5 0x20
551 #define _PORTB_KBI1 0x20
552 #define _PORTB_PGM 0x20
553 #define _PORTB_RB6 0x40
554 #define _PORTB_KBI2 0x40
555 #define _PORTB_PGC 0x40
556 #define _PORTB_RB7 0x80
557 #define _PORTB_KBI3 0x80
558 #define _PORTB_PGD 0x80
560 //==============================================================================
563 //==============================================================================
564 // PORTC Bits
566 extern __at(0x0F82) __sfr PORTC;
568 typedef union
570 struct
572 unsigned RC0 : 1;
573 unsigned RC1 : 1;
574 unsigned RC2 : 1;
575 unsigned RC3 : 1;
576 unsigned RC4 : 1;
577 unsigned RC5 : 1;
578 unsigned RC6 : 1;
579 unsigned RC7 : 1;
582 struct
584 unsigned T1OSO : 1;
585 unsigned T1OSI : 1;
586 unsigned CCP1 : 1;
587 unsigned SCK : 1;
588 unsigned SDI : 1;
589 unsigned SDO : 1;
590 unsigned TX : 1;
591 unsigned RX : 1;
594 struct
596 unsigned T13CKI : 1;
597 unsigned CCP2 : 1;
598 unsigned P1A : 1;
599 unsigned SCL : 1;
600 unsigned SDA : 1;
601 unsigned : 1;
602 unsigned CK : 1;
603 unsigned : 1;
606 struct
608 unsigned T1CKI : 1;
609 unsigned : 1;
610 unsigned : 1;
611 unsigned : 1;
612 unsigned : 1;
613 unsigned : 1;
614 unsigned : 1;
615 unsigned : 1;
618 struct
620 unsigned T3CKI : 1;
621 unsigned : 1;
622 unsigned : 1;
623 unsigned : 1;
624 unsigned : 1;
625 unsigned : 1;
626 unsigned : 1;
627 unsigned : 1;
629 } __PORTCbits_t;
631 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
633 #define _PORTC_RC0 0x01
634 #define _PORTC_T1OSO 0x01
635 #define _PORTC_T13CKI 0x01
636 #define _PORTC_T1CKI 0x01
637 #define _PORTC_T3CKI 0x01
638 #define _PORTC_RC1 0x02
639 #define _PORTC_T1OSI 0x02
640 #define _PORTC_CCP2 0x02
641 #define _PORTC_RC2 0x04
642 #define _PORTC_CCP1 0x04
643 #define _PORTC_P1A 0x04
644 #define _PORTC_RC3 0x08
645 #define _PORTC_SCK 0x08
646 #define _PORTC_SCL 0x08
647 #define _PORTC_RC4 0x10
648 #define _PORTC_SDI 0x10
649 #define _PORTC_SDA 0x10
650 #define _PORTC_RC5 0x20
651 #define _PORTC_SDO 0x20
652 #define _PORTC_RC6 0x40
653 #define _PORTC_TX 0x40
654 #define _PORTC_CK 0x40
655 #define _PORTC_RC7 0x80
656 #define _PORTC_RX 0x80
658 //==============================================================================
661 //==============================================================================
662 // PORTD Bits
664 extern __at(0x0F83) __sfr PORTD;
666 typedef union
668 struct
670 unsigned RD0 : 1;
671 unsigned RD1 : 1;
672 unsigned RD2 : 1;
673 unsigned RD3 : 1;
674 unsigned RD4 : 1;
675 unsigned RD5 : 1;
676 unsigned RD6 : 1;
677 unsigned RD7 : 1;
680 struct
682 unsigned PSP0 : 1;
683 unsigned PSP1 : 1;
684 unsigned PSP2 : 1;
685 unsigned PSP3 : 1;
686 unsigned PSP4 : 1;
687 unsigned PSP5 : 1;
688 unsigned PSP6 : 1;
689 unsigned PSP7 : 1;
692 struct
694 unsigned : 1;
695 unsigned : 1;
696 unsigned : 1;
697 unsigned : 1;
698 unsigned : 1;
699 unsigned P1B : 1;
700 unsigned P1C : 1;
701 unsigned P1D : 1;
703 } __PORTDbits_t;
705 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
707 #define _PORTD_RD0 0x01
708 #define _PORTD_PSP0 0x01
709 #define _PORTD_RD1 0x02
710 #define _PORTD_PSP1 0x02
711 #define _PORTD_RD2 0x04
712 #define _PORTD_PSP2 0x04
713 #define _PORTD_RD3 0x08
714 #define _PORTD_PSP3 0x08
715 #define _PORTD_RD4 0x10
716 #define _PORTD_PSP4 0x10
717 #define _PORTD_RD5 0x20
718 #define _PORTD_PSP5 0x20
719 #define _PORTD_P1B 0x20
720 #define _PORTD_RD6 0x40
721 #define _PORTD_PSP6 0x40
722 #define _PORTD_P1C 0x40
723 #define _PORTD_RD7 0x80
724 #define _PORTD_PSP7 0x80
725 #define _PORTD_P1D 0x80
727 //==============================================================================
730 //==============================================================================
731 // PORTE Bits
733 extern __at(0x0F84) __sfr PORTE;
735 typedef union
737 struct
739 unsigned RE0 : 1;
740 unsigned RE1 : 1;
741 unsigned RE2 : 1;
742 unsigned RE3 : 1;
743 unsigned : 1;
744 unsigned : 1;
745 unsigned : 1;
746 unsigned : 1;
749 struct
751 unsigned RD : 1;
752 unsigned WR : 1;
753 unsigned CS : 1;
754 unsigned MCLR : 1;
755 unsigned : 1;
756 unsigned : 1;
757 unsigned : 1;
758 unsigned : 1;
761 struct
763 unsigned NOT_RD : 1;
764 unsigned NOT_WR : 1;
765 unsigned NOT_CS : 1;
766 unsigned NOT_MCLR : 1;
767 unsigned : 1;
768 unsigned : 1;
769 unsigned : 1;
770 unsigned : 1;
773 struct
775 unsigned AN5 : 1;
776 unsigned AN6 : 1;
777 unsigned AN7 : 1;
778 unsigned VPP : 1;
779 unsigned : 1;
780 unsigned : 1;
781 unsigned : 1;
782 unsigned : 1;
785 struct
787 unsigned RE : 4;
788 unsigned : 4;
790 } __PORTEbits_t;
792 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
794 #define _PORTE_RE0 0x01
795 #define _PORTE_RD 0x01
796 #define _PORTE_NOT_RD 0x01
797 #define _PORTE_AN5 0x01
798 #define _PORTE_RE1 0x02
799 #define _PORTE_WR 0x02
800 #define _PORTE_NOT_WR 0x02
801 #define _PORTE_AN6 0x02
802 #define _PORTE_RE2 0x04
803 #define _PORTE_CS 0x04
804 #define _PORTE_NOT_CS 0x04
805 #define _PORTE_AN7 0x04
806 #define _PORTE_RE3 0x08
807 #define _PORTE_MCLR 0x08
808 #define _PORTE_NOT_MCLR 0x08
809 #define _PORTE_VPP 0x08
811 //==============================================================================
814 //==============================================================================
815 // LATA Bits
817 extern __at(0x0F89) __sfr LATA;
819 typedef struct
821 unsigned LATA0 : 1;
822 unsigned LATA1 : 1;
823 unsigned LATA2 : 1;
824 unsigned LATA3 : 1;
825 unsigned LATA4 : 1;
826 unsigned LATA5 : 1;
827 unsigned LATA6 : 1;
828 unsigned LATA7 : 1;
829 } __LATAbits_t;
831 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
833 #define _LATA0 0x01
834 #define _LATA1 0x02
835 #define _LATA2 0x04
836 #define _LATA3 0x08
837 #define _LATA4 0x10
838 #define _LATA5 0x20
839 #define _LATA6 0x40
840 #define _LATA7 0x80
842 //==============================================================================
845 //==============================================================================
846 // LATB Bits
848 extern __at(0x0F8A) __sfr LATB;
850 typedef struct
852 unsigned LATB0 : 1;
853 unsigned LATB1 : 1;
854 unsigned LATB2 : 1;
855 unsigned LATB3 : 1;
856 unsigned LATB4 : 1;
857 unsigned LATB5 : 1;
858 unsigned LATB6 : 1;
859 unsigned LATB7 : 1;
860 } __LATBbits_t;
862 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
864 #define _LATB0 0x01
865 #define _LATB1 0x02
866 #define _LATB2 0x04
867 #define _LATB3 0x08
868 #define _LATB4 0x10
869 #define _LATB5 0x20
870 #define _LATB6 0x40
871 #define _LATB7 0x80
873 //==============================================================================
876 //==============================================================================
877 // LATC Bits
879 extern __at(0x0F8B) __sfr LATC;
881 typedef struct
883 unsigned LATC0 : 1;
884 unsigned LATC1 : 1;
885 unsigned LATC2 : 1;
886 unsigned LATC3 : 1;
887 unsigned LATC4 : 1;
888 unsigned LATC5 : 1;
889 unsigned LATC6 : 1;
890 unsigned LATC7 : 1;
891 } __LATCbits_t;
893 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
895 #define _LATC0 0x01
896 #define _LATC1 0x02
897 #define _LATC2 0x04
898 #define _LATC3 0x08
899 #define _LATC4 0x10
900 #define _LATC5 0x20
901 #define _LATC6 0x40
902 #define _LATC7 0x80
904 //==============================================================================
907 //==============================================================================
908 // LATD Bits
910 extern __at(0x0F8C) __sfr LATD;
912 typedef struct
914 unsigned LATD0 : 1;
915 unsigned LATD1 : 1;
916 unsigned LATD2 : 1;
917 unsigned LATD3 : 1;
918 unsigned LATD4 : 1;
919 unsigned LATD5 : 1;
920 unsigned LATD6 : 1;
921 unsigned LATD7 : 1;
922 } __LATDbits_t;
924 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
926 #define _LATD0 0x01
927 #define _LATD1 0x02
928 #define _LATD2 0x04
929 #define _LATD3 0x08
930 #define _LATD4 0x10
931 #define _LATD5 0x20
932 #define _LATD6 0x40
933 #define _LATD7 0x80
935 //==============================================================================
938 //==============================================================================
939 // LATE Bits
941 extern __at(0x0F8D) __sfr LATE;
943 typedef union
945 struct
947 unsigned LATE0 : 1;
948 unsigned LATE1 : 1;
949 unsigned LATE2 : 1;
950 unsigned : 1;
951 unsigned : 1;
952 unsigned : 1;
953 unsigned : 1;
954 unsigned : 1;
957 struct
959 unsigned LATE : 3;
960 unsigned : 5;
962 } __LATEbits_t;
964 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
966 #define _LATE0 0x01
967 #define _LATE1 0x02
968 #define _LATE2 0x04
970 //==============================================================================
973 //==============================================================================
974 // DDRA Bits
976 extern __at(0x0F92) __sfr DDRA;
978 typedef union
980 struct
982 unsigned TRISA0 : 1;
983 unsigned TRISA1 : 1;
984 unsigned TRISA2 : 1;
985 unsigned TRISA3 : 1;
986 unsigned TRISA4 : 1;
987 unsigned TRISA5 : 1;
988 unsigned TRISA6 : 1;
989 unsigned TRISA7 : 1;
992 struct
994 unsigned RA0 : 1;
995 unsigned RA1 : 1;
996 unsigned RA2 : 1;
997 unsigned RA3 : 1;
998 unsigned RA4 : 1;
999 unsigned RA5 : 1;
1000 unsigned RA6 : 1;
1001 unsigned RA7 : 1;
1003 } __DDRAbits_t;
1005 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1007 #define _TRISA0 0x01
1008 #define _RA0 0x01
1009 #define _TRISA1 0x02
1010 #define _RA1 0x02
1011 #define _TRISA2 0x04
1012 #define _RA2 0x04
1013 #define _TRISA3 0x08
1014 #define _RA3 0x08
1015 #define _TRISA4 0x10
1016 #define _RA4 0x10
1017 #define _TRISA5 0x20
1018 #define _RA5 0x20
1019 #define _TRISA6 0x40
1020 #define _RA6 0x40
1021 #define _TRISA7 0x80
1022 #define _RA7 0x80
1024 //==============================================================================
1027 //==============================================================================
1028 // TRISA Bits
1030 extern __at(0x0F92) __sfr TRISA;
1032 typedef union
1034 struct
1036 unsigned TRISA0 : 1;
1037 unsigned TRISA1 : 1;
1038 unsigned TRISA2 : 1;
1039 unsigned TRISA3 : 1;
1040 unsigned TRISA4 : 1;
1041 unsigned TRISA5 : 1;
1042 unsigned TRISA6 : 1;
1043 unsigned TRISA7 : 1;
1046 struct
1048 unsigned RA0 : 1;
1049 unsigned RA1 : 1;
1050 unsigned RA2 : 1;
1051 unsigned RA3 : 1;
1052 unsigned RA4 : 1;
1053 unsigned RA5 : 1;
1054 unsigned RA6 : 1;
1055 unsigned RA7 : 1;
1057 } __TRISAbits_t;
1059 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1061 #define _TRISA_TRISA0 0x01
1062 #define _TRISA_RA0 0x01
1063 #define _TRISA_TRISA1 0x02
1064 #define _TRISA_RA1 0x02
1065 #define _TRISA_TRISA2 0x04
1066 #define _TRISA_RA2 0x04
1067 #define _TRISA_TRISA3 0x08
1068 #define _TRISA_RA3 0x08
1069 #define _TRISA_TRISA4 0x10
1070 #define _TRISA_RA4 0x10
1071 #define _TRISA_TRISA5 0x20
1072 #define _TRISA_RA5 0x20
1073 #define _TRISA_TRISA6 0x40
1074 #define _TRISA_RA6 0x40
1075 #define _TRISA_TRISA7 0x80
1076 #define _TRISA_RA7 0x80
1078 //==============================================================================
1081 //==============================================================================
1082 // DDRB Bits
1084 extern __at(0x0F93) __sfr DDRB;
1086 typedef union
1088 struct
1090 unsigned TRISB0 : 1;
1091 unsigned TRISB1 : 1;
1092 unsigned TRISB2 : 1;
1093 unsigned TRISB3 : 1;
1094 unsigned TRISB4 : 1;
1095 unsigned TRISB5 : 1;
1096 unsigned TRISB6 : 1;
1097 unsigned TRISB7 : 1;
1100 struct
1102 unsigned RB0 : 1;
1103 unsigned RB1 : 1;
1104 unsigned RB2 : 1;
1105 unsigned RB3 : 1;
1106 unsigned RB4 : 1;
1107 unsigned RB5 : 1;
1108 unsigned RB6 : 1;
1109 unsigned RB7 : 1;
1111 } __DDRBbits_t;
1113 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1115 #define _TRISB0 0x01
1116 #define _RB0 0x01
1117 #define _TRISB1 0x02
1118 #define _RB1 0x02
1119 #define _TRISB2 0x04
1120 #define _RB2 0x04
1121 #define _TRISB3 0x08
1122 #define _RB3 0x08
1123 #define _TRISB4 0x10
1124 #define _RB4 0x10
1125 #define _TRISB5 0x20
1126 #define _RB5 0x20
1127 #define _TRISB6 0x40
1128 #define _RB6 0x40
1129 #define _TRISB7 0x80
1130 #define _RB7 0x80
1132 //==============================================================================
1135 //==============================================================================
1136 // TRISB Bits
1138 extern __at(0x0F93) __sfr TRISB;
1140 typedef union
1142 struct
1144 unsigned TRISB0 : 1;
1145 unsigned TRISB1 : 1;
1146 unsigned TRISB2 : 1;
1147 unsigned TRISB3 : 1;
1148 unsigned TRISB4 : 1;
1149 unsigned TRISB5 : 1;
1150 unsigned TRISB6 : 1;
1151 unsigned TRISB7 : 1;
1154 struct
1156 unsigned RB0 : 1;
1157 unsigned RB1 : 1;
1158 unsigned RB2 : 1;
1159 unsigned RB3 : 1;
1160 unsigned RB4 : 1;
1161 unsigned RB5 : 1;
1162 unsigned RB6 : 1;
1163 unsigned RB7 : 1;
1165 } __TRISBbits_t;
1167 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1169 #define _TRISB_TRISB0 0x01
1170 #define _TRISB_RB0 0x01
1171 #define _TRISB_TRISB1 0x02
1172 #define _TRISB_RB1 0x02
1173 #define _TRISB_TRISB2 0x04
1174 #define _TRISB_RB2 0x04
1175 #define _TRISB_TRISB3 0x08
1176 #define _TRISB_RB3 0x08
1177 #define _TRISB_TRISB4 0x10
1178 #define _TRISB_RB4 0x10
1179 #define _TRISB_TRISB5 0x20
1180 #define _TRISB_RB5 0x20
1181 #define _TRISB_TRISB6 0x40
1182 #define _TRISB_RB6 0x40
1183 #define _TRISB_TRISB7 0x80
1184 #define _TRISB_RB7 0x80
1186 //==============================================================================
1189 //==============================================================================
1190 // DDRC Bits
1192 extern __at(0x0F94) __sfr DDRC;
1194 typedef union
1196 struct
1198 unsigned TRISC0 : 1;
1199 unsigned TRISC1 : 1;
1200 unsigned TRISC2 : 1;
1201 unsigned TRISC3 : 1;
1202 unsigned TRISC4 : 1;
1203 unsigned TRISC5 : 1;
1204 unsigned TRISC6 : 1;
1205 unsigned TRISC7 : 1;
1208 struct
1210 unsigned RC0 : 1;
1211 unsigned RC1 : 1;
1212 unsigned RC2 : 1;
1213 unsigned RC3 : 1;
1214 unsigned RC4 : 1;
1215 unsigned RC5 : 1;
1216 unsigned RC6 : 1;
1217 unsigned RC7 : 1;
1219 } __DDRCbits_t;
1221 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1223 #define _TRISC0 0x01
1224 #define _RC0 0x01
1225 #define _TRISC1 0x02
1226 #define _RC1 0x02
1227 #define _TRISC2 0x04
1228 #define _RC2 0x04
1229 #define _TRISC3 0x08
1230 #define _RC3 0x08
1231 #define _TRISC4 0x10
1232 #define _RC4 0x10
1233 #define _TRISC5 0x20
1234 #define _RC5 0x20
1235 #define _TRISC6 0x40
1236 #define _RC6 0x40
1237 #define _TRISC7 0x80
1238 #define _RC7 0x80
1240 //==============================================================================
1243 //==============================================================================
1244 // TRISC Bits
1246 extern __at(0x0F94) __sfr TRISC;
1248 typedef union
1250 struct
1252 unsigned TRISC0 : 1;
1253 unsigned TRISC1 : 1;
1254 unsigned TRISC2 : 1;
1255 unsigned TRISC3 : 1;
1256 unsigned TRISC4 : 1;
1257 unsigned TRISC5 : 1;
1258 unsigned TRISC6 : 1;
1259 unsigned TRISC7 : 1;
1262 struct
1264 unsigned RC0 : 1;
1265 unsigned RC1 : 1;
1266 unsigned RC2 : 1;
1267 unsigned RC3 : 1;
1268 unsigned RC4 : 1;
1269 unsigned RC5 : 1;
1270 unsigned RC6 : 1;
1271 unsigned RC7 : 1;
1273 } __TRISCbits_t;
1275 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1277 #define _TRISC_TRISC0 0x01
1278 #define _TRISC_RC0 0x01
1279 #define _TRISC_TRISC1 0x02
1280 #define _TRISC_RC1 0x02
1281 #define _TRISC_TRISC2 0x04
1282 #define _TRISC_RC2 0x04
1283 #define _TRISC_TRISC3 0x08
1284 #define _TRISC_RC3 0x08
1285 #define _TRISC_TRISC4 0x10
1286 #define _TRISC_RC4 0x10
1287 #define _TRISC_TRISC5 0x20
1288 #define _TRISC_RC5 0x20
1289 #define _TRISC_TRISC6 0x40
1290 #define _TRISC_RC6 0x40
1291 #define _TRISC_TRISC7 0x80
1292 #define _TRISC_RC7 0x80
1294 //==============================================================================
1297 //==============================================================================
1298 // DDRD Bits
1300 extern __at(0x0F95) __sfr DDRD;
1302 typedef union
1304 struct
1306 unsigned TRISD0 : 1;
1307 unsigned TRISD1 : 1;
1308 unsigned TRISD2 : 1;
1309 unsigned TRISD3 : 1;
1310 unsigned TRISD4 : 1;
1311 unsigned TRISD5 : 1;
1312 unsigned TRISD6 : 1;
1313 unsigned TRISD7 : 1;
1316 struct
1318 unsigned RD0 : 1;
1319 unsigned RD1 : 1;
1320 unsigned RD2 : 1;
1321 unsigned RD3 : 1;
1322 unsigned RD4 : 1;
1323 unsigned RD5 : 1;
1324 unsigned RD6 : 1;
1325 unsigned RD7 : 1;
1327 } __DDRDbits_t;
1329 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
1331 #define _TRISD0 0x01
1332 #define _RD0 0x01
1333 #define _TRISD1 0x02
1334 #define _RD1 0x02
1335 #define _TRISD2 0x04
1336 #define _RD2 0x04
1337 #define _TRISD3 0x08
1338 #define _RD3 0x08
1339 #define _TRISD4 0x10
1340 #define _RD4 0x10
1341 #define _TRISD5 0x20
1342 #define _RD5 0x20
1343 #define _TRISD6 0x40
1344 #define _RD6 0x40
1345 #define _TRISD7 0x80
1346 #define _RD7 0x80
1348 //==============================================================================
1351 //==============================================================================
1352 // TRISD Bits
1354 extern __at(0x0F95) __sfr TRISD;
1356 typedef union
1358 struct
1360 unsigned TRISD0 : 1;
1361 unsigned TRISD1 : 1;
1362 unsigned TRISD2 : 1;
1363 unsigned TRISD3 : 1;
1364 unsigned TRISD4 : 1;
1365 unsigned TRISD5 : 1;
1366 unsigned TRISD6 : 1;
1367 unsigned TRISD7 : 1;
1370 struct
1372 unsigned RD0 : 1;
1373 unsigned RD1 : 1;
1374 unsigned RD2 : 1;
1375 unsigned RD3 : 1;
1376 unsigned RD4 : 1;
1377 unsigned RD5 : 1;
1378 unsigned RD6 : 1;
1379 unsigned RD7 : 1;
1381 } __TRISDbits_t;
1383 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
1385 #define _TRISD_TRISD0 0x01
1386 #define _TRISD_RD0 0x01
1387 #define _TRISD_TRISD1 0x02
1388 #define _TRISD_RD1 0x02
1389 #define _TRISD_TRISD2 0x04
1390 #define _TRISD_RD2 0x04
1391 #define _TRISD_TRISD3 0x08
1392 #define _TRISD_RD3 0x08
1393 #define _TRISD_TRISD4 0x10
1394 #define _TRISD_RD4 0x10
1395 #define _TRISD_TRISD5 0x20
1396 #define _TRISD_RD5 0x20
1397 #define _TRISD_TRISD6 0x40
1398 #define _TRISD_RD6 0x40
1399 #define _TRISD_TRISD7 0x80
1400 #define _TRISD_RD7 0x80
1402 //==============================================================================
1405 //==============================================================================
1406 // DDRE Bits
1408 extern __at(0x0F96) __sfr DDRE;
1410 typedef union
1412 struct
1414 unsigned TRISE0 : 1;
1415 unsigned TRISE1 : 1;
1416 unsigned TRISE2 : 1;
1417 unsigned : 1;
1418 unsigned PSPMODE : 1;
1419 unsigned IBOV : 1;
1420 unsigned OBF : 1;
1421 unsigned IBF : 1;
1424 struct
1426 unsigned RE0 : 1;
1427 unsigned RE1 : 1;
1428 unsigned RE2 : 1;
1429 unsigned : 1;
1430 unsigned : 1;
1431 unsigned : 1;
1432 unsigned : 1;
1433 unsigned : 1;
1436 struct
1438 unsigned TRISE : 3;
1439 unsigned : 5;
1442 struct
1444 unsigned RE : 3;
1445 unsigned : 5;
1447 } __DDREbits_t;
1449 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
1451 #define _TRISE0 0x01
1452 #define _RE0 0x01
1453 #define _TRISE1 0x02
1454 #define _RE1 0x02
1455 #define _TRISE2 0x04
1456 #define _RE2 0x04
1457 #define _PSPMODE 0x10
1458 #define _IBOV 0x20
1459 #define _OBF 0x40
1460 #define _IBF 0x80
1462 //==============================================================================
1465 //==============================================================================
1466 // TRISE Bits
1468 extern __at(0x0F96) __sfr TRISE;
1470 typedef union
1472 struct
1474 unsigned TRISE0 : 1;
1475 unsigned TRISE1 : 1;
1476 unsigned TRISE2 : 1;
1477 unsigned : 1;
1478 unsigned PSPMODE : 1;
1479 unsigned IBOV : 1;
1480 unsigned OBF : 1;
1481 unsigned IBF : 1;
1484 struct
1486 unsigned RE0 : 1;
1487 unsigned RE1 : 1;
1488 unsigned RE2 : 1;
1489 unsigned : 1;
1490 unsigned : 1;
1491 unsigned : 1;
1492 unsigned : 1;
1493 unsigned : 1;
1496 struct
1498 unsigned TRISE : 3;
1499 unsigned : 5;
1502 struct
1504 unsigned RE : 3;
1505 unsigned : 5;
1507 } __TRISEbits_t;
1509 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
1511 #define _TRISE_TRISE0 0x01
1512 #define _TRISE_RE0 0x01
1513 #define _TRISE_TRISE1 0x02
1514 #define _TRISE_RE1 0x02
1515 #define _TRISE_TRISE2 0x04
1516 #define _TRISE_RE2 0x04
1517 #define _TRISE_PSPMODE 0x10
1518 #define _TRISE_IBOV 0x20
1519 #define _TRISE_OBF 0x40
1520 #define _TRISE_IBF 0x80
1522 //==============================================================================
1525 //==============================================================================
1526 // OSCTUNE Bits
1528 extern __at(0x0F9B) __sfr OSCTUNE;
1530 typedef union
1532 struct
1534 unsigned TUN0 : 1;
1535 unsigned TUN1 : 1;
1536 unsigned TUN2 : 1;
1537 unsigned TUN3 : 1;
1538 unsigned TUN4 : 1;
1539 unsigned TUN5 : 1;
1540 unsigned PLLEN : 1;
1541 unsigned INTSRC : 1;
1544 struct
1546 unsigned TUN : 6;
1547 unsigned : 2;
1549 } __OSCTUNEbits_t;
1551 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
1553 #define _TUN0 0x01
1554 #define _TUN1 0x02
1555 #define _TUN2 0x04
1556 #define _TUN3 0x08
1557 #define _TUN4 0x10
1558 #define _TUN5 0x20
1559 #define _PLLEN 0x40
1560 #define _INTSRC 0x80
1562 //==============================================================================
1565 //==============================================================================
1566 // PIE1 Bits
1568 extern __at(0x0F9D) __sfr PIE1;
1570 typedef struct
1572 unsigned TMR1IE : 1;
1573 unsigned TMR2IE : 1;
1574 unsigned CCP1IE : 1;
1575 unsigned SSPIE : 1;
1576 unsigned TXIE : 1;
1577 unsigned RCIE : 1;
1578 unsigned ADIE : 1;
1579 unsigned PSPIE : 1;
1580 } __PIE1bits_t;
1582 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1584 #define _TMR1IE 0x01
1585 #define _TMR2IE 0x02
1586 #define _CCP1IE 0x04
1587 #define _SSPIE 0x08
1588 #define _TXIE 0x10
1589 #define _RCIE 0x20
1590 #define _ADIE 0x40
1591 #define _PSPIE 0x80
1593 //==============================================================================
1596 //==============================================================================
1597 // PIR1 Bits
1599 extern __at(0x0F9E) __sfr PIR1;
1601 typedef struct
1603 unsigned TMR1IF : 1;
1604 unsigned TMR2IF : 1;
1605 unsigned CCP1IF : 1;
1606 unsigned SSPIF : 1;
1607 unsigned TXIF : 1;
1608 unsigned RCIF : 1;
1609 unsigned ADIF : 1;
1610 unsigned PSPIF : 1;
1611 } __PIR1bits_t;
1613 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1615 #define _TMR1IF 0x01
1616 #define _TMR2IF 0x02
1617 #define _CCP1IF 0x04
1618 #define _SSPIF 0x08
1619 #define _TXIF 0x10
1620 #define _RCIF 0x20
1621 #define _ADIF 0x40
1622 #define _PSPIF 0x80
1624 //==============================================================================
1627 //==============================================================================
1628 // IPR1 Bits
1630 extern __at(0x0F9F) __sfr IPR1;
1632 typedef struct
1634 unsigned TMR1IP : 1;
1635 unsigned TMR2IP : 1;
1636 unsigned CCP1IP : 1;
1637 unsigned SSPIP : 1;
1638 unsigned TXIP : 1;
1639 unsigned RCIP : 1;
1640 unsigned ADIP : 1;
1641 unsigned PSPIP : 1;
1642 } __IPR1bits_t;
1644 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
1646 #define _TMR1IP 0x01
1647 #define _TMR2IP 0x02
1648 #define _CCP1IP 0x04
1649 #define _SSPIP 0x08
1650 #define _TXIP 0x10
1651 #define _RCIP 0x20
1652 #define _ADIP 0x40
1653 #define _PSPIP 0x80
1655 //==============================================================================
1658 //==============================================================================
1659 // PIE2 Bits
1661 extern __at(0x0FA0) __sfr PIE2;
1663 typedef union
1665 struct
1667 unsigned CCP2IE : 1;
1668 unsigned TMR3IE : 1;
1669 unsigned HLVDIE : 1;
1670 unsigned BCLIE : 1;
1671 unsigned EEIE : 1;
1672 unsigned C2IE : 1;
1673 unsigned C1IE : 1;
1674 unsigned OSCFIE : 1;
1677 struct
1679 unsigned : 1;
1680 unsigned : 1;
1681 unsigned LVDIE : 1;
1682 unsigned : 1;
1683 unsigned : 1;
1684 unsigned : 1;
1685 unsigned : 1;
1686 unsigned : 1;
1688 } __PIE2bits_t;
1690 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
1692 #define _CCP2IE 0x01
1693 #define _TMR3IE 0x02
1694 #define _HLVDIE 0x04
1695 #define _LVDIE 0x04
1696 #define _BCLIE 0x08
1697 #define _EEIE 0x10
1698 #define _C2IE 0x20
1699 #define _C1IE 0x40
1700 #define _OSCFIE 0x80
1702 //==============================================================================
1705 //==============================================================================
1706 // PIR2 Bits
1708 extern __at(0x0FA1) __sfr PIR2;
1710 typedef union
1712 struct
1714 unsigned CCP2IF : 1;
1715 unsigned TMR3IF : 1;
1716 unsigned HLVDIF : 1;
1717 unsigned BCLIF : 1;
1718 unsigned EEIF : 1;
1719 unsigned C2IF : 1;
1720 unsigned C1IF : 1;
1721 unsigned OSCFIF : 1;
1724 struct
1726 unsigned : 1;
1727 unsigned : 1;
1728 unsigned LVDIF : 1;
1729 unsigned : 1;
1730 unsigned : 1;
1731 unsigned : 1;
1732 unsigned : 1;
1733 unsigned : 1;
1735 } __PIR2bits_t;
1737 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
1739 #define _CCP2IF 0x01
1740 #define _TMR3IF 0x02
1741 #define _HLVDIF 0x04
1742 #define _LVDIF 0x04
1743 #define _BCLIF 0x08
1744 #define _EEIF 0x10
1745 #define _C2IF 0x20
1746 #define _C1IF 0x40
1747 #define _OSCFIF 0x80
1749 //==============================================================================
1752 //==============================================================================
1753 // IPR2 Bits
1755 extern __at(0x0FA2) __sfr IPR2;
1757 typedef union
1759 struct
1761 unsigned CCP2IP : 1;
1762 unsigned TMR3IP : 1;
1763 unsigned HLVDIP : 1;
1764 unsigned BCLIP : 1;
1765 unsigned EEIP : 1;
1766 unsigned C2IP : 1;
1767 unsigned C1IP : 1;
1768 unsigned OSCFIP : 1;
1771 struct
1773 unsigned : 1;
1774 unsigned : 1;
1775 unsigned LVDIP : 1;
1776 unsigned : 1;
1777 unsigned : 1;
1778 unsigned : 1;
1779 unsigned : 1;
1780 unsigned : 1;
1782 } __IPR2bits_t;
1784 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
1786 #define _CCP2IP 0x01
1787 #define _TMR3IP 0x02
1788 #define _HLVDIP 0x04
1789 #define _LVDIP 0x04
1790 #define _BCLIP 0x08
1791 #define _EEIP 0x10
1792 #define _C2IP 0x20
1793 #define _C1IP 0x40
1794 #define _OSCFIP 0x80
1796 //==============================================================================
1799 //==============================================================================
1800 // EECON1 Bits
1802 extern __at(0x0FA6) __sfr EECON1;
1804 typedef struct
1806 unsigned RD : 1;
1807 unsigned WR : 1;
1808 unsigned WREN : 1;
1809 unsigned WRERR : 1;
1810 unsigned FREE : 1;
1811 unsigned : 1;
1812 unsigned CFGS : 1;
1813 unsigned EEPGD : 1;
1814 } __EECON1bits_t;
1816 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
1818 #define _RD 0x01
1819 #define _WR 0x02
1820 #define _WREN 0x04
1821 #define _WRERR 0x08
1822 #define _FREE 0x10
1823 #define _CFGS 0x40
1824 #define _EEPGD 0x80
1826 //==============================================================================
1828 extern __at(0x0FA7) __sfr EECON2;
1829 extern __at(0x0FA8) __sfr EEDATA;
1831 //==============================================================================
1832 // EEADR Bits
1834 extern __at(0x0FA9) __sfr EEADR;
1836 typedef struct
1838 unsigned EEADR0 : 1;
1839 unsigned EEADR1 : 1;
1840 unsigned EEADR2 : 1;
1841 unsigned EEADR3 : 1;
1842 unsigned EEADR4 : 1;
1843 unsigned EEADR5 : 1;
1844 unsigned EEADR6 : 1;
1845 unsigned EEADR7 : 1;
1846 } __EEADRbits_t;
1848 extern __at(0x0FA9) volatile __EEADRbits_t EEADRbits;
1850 #define _EEADR0 0x01
1851 #define _EEADR1 0x02
1852 #define _EEADR2 0x04
1853 #define _EEADR3 0x08
1854 #define _EEADR4 0x10
1855 #define _EEADR5 0x20
1856 #define _EEADR6 0x40
1857 #define _EEADR7 0x80
1859 //==============================================================================
1862 //==============================================================================
1863 // RCSTA Bits
1865 extern __at(0x0FAB) __sfr RCSTA;
1867 typedef union
1869 struct
1871 unsigned RX9D : 1;
1872 unsigned OERR : 1;
1873 unsigned FERR : 1;
1874 unsigned ADDEN : 1;
1875 unsigned CREN : 1;
1876 unsigned SREN : 1;
1877 unsigned RX9 : 1;
1878 unsigned SPEN : 1;
1881 struct
1883 unsigned : 1;
1884 unsigned : 1;
1885 unsigned : 1;
1886 unsigned ADEN : 1;
1887 unsigned : 1;
1888 unsigned : 1;
1889 unsigned : 1;
1890 unsigned : 1;
1892 } __RCSTAbits_t;
1894 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
1896 #define _RX9D 0x01
1897 #define _OERR 0x02
1898 #define _FERR 0x04
1899 #define _ADDEN 0x08
1900 #define _ADEN 0x08
1901 #define _CREN 0x10
1902 #define _SREN 0x20
1903 #define _RX9 0x40
1904 #define _SPEN 0x80
1906 //==============================================================================
1909 //==============================================================================
1910 // TXSTA Bits
1912 extern __at(0x0FAC) __sfr TXSTA;
1914 typedef struct
1916 unsigned TX9D : 1;
1917 unsigned TRMT : 1;
1918 unsigned BRGH : 1;
1919 unsigned SENDB : 1;
1920 unsigned SYNC : 1;
1921 unsigned TXEN : 1;
1922 unsigned TX9 : 1;
1923 unsigned CSRC : 1;
1924 } __TXSTAbits_t;
1926 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
1928 #define _TX9D 0x01
1929 #define _TRMT 0x02
1930 #define _BRGH 0x04
1931 #define _SENDB 0x08
1932 #define _SYNC 0x10
1933 #define _TXEN 0x20
1934 #define _TX9 0x40
1935 #define _CSRC 0x80
1937 //==============================================================================
1939 extern __at(0x0FAD) __sfr TXREG;
1940 extern __at(0x0FAE) __sfr RCREG;
1941 extern __at(0x0FAF) __sfr SPBRG;
1942 extern __at(0x0FB0) __sfr SPBRGH;
1944 //==============================================================================
1945 // T3CON Bits
1947 extern __at(0x0FB1) __sfr T3CON;
1949 typedef union
1951 struct
1953 unsigned TMR3ON : 1;
1954 unsigned TMR3CS : 1;
1955 unsigned NOT_T3SYNC : 1;
1956 unsigned T3CCP1 : 1;
1957 unsigned T3CKPS0 : 1;
1958 unsigned T3CKPS1 : 1;
1959 unsigned T3CCP2 : 1;
1960 unsigned RD16 : 1;
1963 struct
1965 unsigned : 1;
1966 unsigned : 1;
1967 unsigned T3SYNC : 1;
1968 unsigned : 1;
1969 unsigned : 1;
1970 unsigned : 1;
1971 unsigned : 1;
1972 unsigned : 1;
1975 struct
1977 unsigned : 4;
1978 unsigned T3CKPS : 2;
1979 unsigned : 2;
1981 } __T3CONbits_t;
1983 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
1985 #define _T3CON_TMR3ON 0x01
1986 #define _T3CON_TMR3CS 0x02
1987 #define _T3CON_NOT_T3SYNC 0x04
1988 #define _T3CON_T3SYNC 0x04
1989 #define _T3CON_T3CCP1 0x08
1990 #define _T3CON_T3CKPS0 0x10
1991 #define _T3CON_T3CKPS1 0x20
1992 #define _T3CON_T3CCP2 0x40
1993 #define _T3CON_RD16 0x80
1995 //==============================================================================
1997 extern __at(0x0FB2) __sfr TMR3;
1998 extern __at(0x0FB2) __sfr TMR3L;
1999 extern __at(0x0FB3) __sfr TMR3H;
2001 //==============================================================================
2002 // CVRCON2 Bits
2004 extern __at(0x0FB4) __sfr CVRCON2;
2006 typedef struct
2008 unsigned : 1;
2009 unsigned : 1;
2010 unsigned : 1;
2011 unsigned : 1;
2012 unsigned : 1;
2013 unsigned : 1;
2014 unsigned FVRST : 1;
2015 unsigned FVREN : 1;
2016 } __CVRCON2bits_t;
2018 extern __at(0x0FB4) volatile __CVRCON2bits_t CVRCON2bits;
2020 #define _FVRST 0x40
2021 #define _FVREN 0x80
2023 //==============================================================================
2026 //==============================================================================
2027 // CVRCON Bits
2029 extern __at(0x0FB5) __sfr CVRCON;
2031 typedef union
2033 struct
2035 unsigned CVR0 : 1;
2036 unsigned CVR1 : 1;
2037 unsigned CVR2 : 1;
2038 unsigned CVR3 : 1;
2039 unsigned CVRSS : 1;
2040 unsigned CVRR : 1;
2041 unsigned CVROE : 1;
2042 unsigned CVREN : 1;
2045 struct
2047 unsigned CVR : 4;
2048 unsigned : 4;
2050 } __CVRCONbits_t;
2052 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
2054 #define _CVR0 0x01
2055 #define _CVR1 0x02
2056 #define _CVR2 0x04
2057 #define _CVR3 0x08
2058 #define _CVRSS 0x10
2059 #define _CVRR 0x20
2060 #define _CVROE 0x40
2061 #define _CVREN 0x80
2063 //==============================================================================
2066 //==============================================================================
2067 // ECCP1AS Bits
2069 extern __at(0x0FB6) __sfr ECCP1AS;
2071 typedef union
2073 struct
2075 unsigned PSSBD0 : 1;
2076 unsigned PSSBD1 : 1;
2077 unsigned PSSAC0 : 1;
2078 unsigned PSSAC1 : 1;
2079 unsigned ECCPAS0 : 1;
2080 unsigned ECCPAS1 : 1;
2081 unsigned ECCPAS2 : 1;
2082 unsigned ECCPASE : 1;
2085 struct
2087 unsigned PSSBD : 2;
2088 unsigned : 6;
2091 struct
2093 unsigned : 2;
2094 unsigned PSSAC : 2;
2095 unsigned : 4;
2098 struct
2100 unsigned : 4;
2101 unsigned ECCPAS : 3;
2102 unsigned : 1;
2104 } __ECCP1ASbits_t;
2106 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
2108 #define _PSSBD0 0x01
2109 #define _PSSBD1 0x02
2110 #define _PSSAC0 0x04
2111 #define _PSSAC1 0x08
2112 #define _ECCPAS0 0x10
2113 #define _ECCPAS1 0x20
2114 #define _ECCPAS2 0x40
2115 #define _ECCPASE 0x80
2117 //==============================================================================
2120 //==============================================================================
2121 // PWM1CON Bits
2123 extern __at(0x0FB7) __sfr PWM1CON;
2125 typedef union
2127 struct
2129 unsigned PDC0 : 1;
2130 unsigned PDC1 : 1;
2131 unsigned PDC2 : 1;
2132 unsigned PDC3 : 1;
2133 unsigned PDC4 : 1;
2134 unsigned PDC5 : 1;
2135 unsigned PDC6 : 1;
2136 unsigned PRSEN : 1;
2139 struct
2141 unsigned PDC : 7;
2142 unsigned : 1;
2144 } __PWM1CONbits_t;
2146 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
2148 #define _PDC0 0x01
2149 #define _PDC1 0x02
2150 #define _PDC2 0x04
2151 #define _PDC3 0x08
2152 #define _PDC4 0x10
2153 #define _PDC5 0x20
2154 #define _PDC6 0x40
2155 #define _PRSEN 0x80
2157 //==============================================================================
2160 //==============================================================================
2161 // BAUDCON Bits
2163 extern __at(0x0FB8) __sfr BAUDCON;
2165 typedef union
2167 struct
2169 unsigned ABDEN : 1;
2170 unsigned WUE : 1;
2171 unsigned : 1;
2172 unsigned BRG16 : 1;
2173 unsigned CKTXP : 1;
2174 unsigned DTRXP : 1;
2175 unsigned RCIDL : 1;
2176 unsigned ABDOVF : 1;
2179 struct
2181 unsigned : 1;
2182 unsigned : 1;
2183 unsigned : 1;
2184 unsigned : 1;
2185 unsigned SCKP : 1;
2186 unsigned : 1;
2187 unsigned : 1;
2188 unsigned : 1;
2190 } __BAUDCONbits_t;
2192 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
2194 #define _ABDEN 0x01
2195 #define _WUE 0x02
2196 #define _BRG16 0x08
2197 #define _CKTXP 0x10
2198 #define _SCKP 0x10
2199 #define _DTRXP 0x20
2200 #define _RCIDL 0x40
2201 #define _ABDOVF 0x80
2203 //==============================================================================
2206 //==============================================================================
2207 // BAUDCTL Bits
2209 extern __at(0x0FB8) __sfr BAUDCTL;
2211 typedef union
2213 struct
2215 unsigned ABDEN : 1;
2216 unsigned WUE : 1;
2217 unsigned : 1;
2218 unsigned BRG16 : 1;
2219 unsigned CKTXP : 1;
2220 unsigned DTRXP : 1;
2221 unsigned RCIDL : 1;
2222 unsigned ABDOVF : 1;
2225 struct
2227 unsigned : 1;
2228 unsigned : 1;
2229 unsigned : 1;
2230 unsigned : 1;
2231 unsigned SCKP : 1;
2232 unsigned : 1;
2233 unsigned : 1;
2234 unsigned : 1;
2236 } __BAUDCTLbits_t;
2238 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
2240 #define _BAUDCTL_ABDEN 0x01
2241 #define _BAUDCTL_WUE 0x02
2242 #define _BAUDCTL_BRG16 0x08
2243 #define _BAUDCTL_CKTXP 0x10
2244 #define _BAUDCTL_SCKP 0x10
2245 #define _BAUDCTL_DTRXP 0x20
2246 #define _BAUDCTL_RCIDL 0x40
2247 #define _BAUDCTL_ABDOVF 0x80
2249 //==============================================================================
2252 //==============================================================================
2253 // PSTRCON Bits
2255 extern __at(0x0FB9) __sfr PSTRCON;
2257 typedef struct
2259 unsigned STRA : 1;
2260 unsigned STRB : 1;
2261 unsigned STRC : 1;
2262 unsigned STRD : 1;
2263 unsigned STRSYNC : 1;
2264 unsigned : 1;
2265 unsigned : 1;
2266 unsigned : 1;
2267 } __PSTRCONbits_t;
2269 extern __at(0x0FB9) volatile __PSTRCONbits_t PSTRCONbits;
2271 #define _STRA 0x01
2272 #define _STRB 0x02
2273 #define _STRC 0x04
2274 #define _STRD 0x08
2275 #define _STRSYNC 0x10
2277 //==============================================================================
2280 //==============================================================================
2281 // CCP2CON Bits
2283 extern __at(0x0FBA) __sfr CCP2CON;
2285 typedef union
2287 struct
2289 unsigned CCP2M0 : 1;
2290 unsigned CCP2M1 : 1;
2291 unsigned CCP2M2 : 1;
2292 unsigned CCP2M3 : 1;
2293 unsigned DC2B0 : 1;
2294 unsigned DC2B1 : 1;
2295 unsigned : 1;
2296 unsigned : 1;
2299 struct
2301 unsigned CCP2M : 4;
2302 unsigned : 4;
2305 struct
2307 unsigned : 4;
2308 unsigned DC2B : 2;
2309 unsigned : 2;
2311 } __CCP2CONbits_t;
2313 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
2315 #define _CCP2M0 0x01
2316 #define _CCP2M1 0x02
2317 #define _CCP2M2 0x04
2318 #define _CCP2M3 0x08
2319 #define _DC2B0 0x10
2320 #define _DC2B1 0x20
2322 //==============================================================================
2324 extern __at(0x0FBB) __sfr CCPR2;
2325 extern __at(0x0FBB) __sfr CCPR2L;
2326 extern __at(0x0FBC) __sfr CCPR2H;
2328 //==============================================================================
2329 // CCP1CON Bits
2331 extern __at(0x0FBD) __sfr CCP1CON;
2333 typedef union
2335 struct
2337 unsigned CCP1M0 : 1;
2338 unsigned CCP1M1 : 1;
2339 unsigned CCP1M2 : 1;
2340 unsigned CCP1M3 : 1;
2341 unsigned DC1B0 : 1;
2342 unsigned DC1B1 : 1;
2343 unsigned P1M0 : 1;
2344 unsigned P1M1 : 1;
2347 struct
2349 unsigned CCP1M : 4;
2350 unsigned : 4;
2353 struct
2355 unsigned : 4;
2356 unsigned DC1B : 2;
2357 unsigned : 2;
2360 struct
2362 unsigned : 6;
2363 unsigned P1M : 2;
2365 } __CCP1CONbits_t;
2367 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
2369 #define _CCP1M0 0x01
2370 #define _CCP1M1 0x02
2371 #define _CCP1M2 0x04
2372 #define _CCP1M3 0x08
2373 #define _DC1B0 0x10
2374 #define _DC1B1 0x20
2375 #define _P1M0 0x40
2376 #define _P1M1 0x80
2378 //==============================================================================
2380 extern __at(0x0FBE) __sfr CCPR1;
2381 extern __at(0x0FBE) __sfr CCPR1L;
2382 extern __at(0x0FBF) __sfr CCPR1H;
2384 //==============================================================================
2385 // ADCON2 Bits
2387 extern __at(0x0FC0) __sfr ADCON2;
2389 typedef union
2391 struct
2393 unsigned ADCS0 : 1;
2394 unsigned ADCS1 : 1;
2395 unsigned ADCS2 : 1;
2396 unsigned ACQT0 : 1;
2397 unsigned ACQT1 : 1;
2398 unsigned ACQT2 : 1;
2399 unsigned : 1;
2400 unsigned ADFM : 1;
2403 struct
2405 unsigned ADCS : 3;
2406 unsigned : 5;
2409 struct
2411 unsigned : 3;
2412 unsigned ACQT : 3;
2413 unsigned : 2;
2415 } __ADCON2bits_t;
2417 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
2419 #define _ADCS0 0x01
2420 #define _ADCS1 0x02
2421 #define _ADCS2 0x04
2422 #define _ACQT0 0x08
2423 #define _ACQT1 0x10
2424 #define _ACQT2 0x20
2425 #define _ADFM 0x80
2427 //==============================================================================
2430 //==============================================================================
2431 // ADCON1 Bits
2433 extern __at(0x0FC1) __sfr ADCON1;
2435 typedef union
2437 struct
2439 unsigned : 1;
2440 unsigned : 1;
2441 unsigned : 1;
2442 unsigned : 1;
2443 unsigned VCFG0 : 1;
2444 unsigned VCFG1 : 1;
2445 unsigned : 1;
2446 unsigned : 1;
2449 struct
2451 unsigned : 4;
2452 unsigned VCFG : 2;
2453 unsigned : 2;
2455 } __ADCON1bits_t;
2457 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
2459 #define _VCFG0 0x10
2460 #define _VCFG1 0x20
2462 //==============================================================================
2465 //==============================================================================
2466 // ADCON0 Bits
2468 extern __at(0x0FC2) __sfr ADCON0;
2470 typedef union
2472 struct
2474 unsigned ADON : 1;
2475 unsigned GO_NOT_DONE : 1;
2476 unsigned CHS0 : 1;
2477 unsigned CHS1 : 1;
2478 unsigned CHS2 : 1;
2479 unsigned CHS3 : 1;
2480 unsigned : 1;
2481 unsigned : 1;
2484 struct
2486 unsigned : 1;
2487 unsigned DONE : 1;
2488 unsigned : 1;
2489 unsigned : 1;
2490 unsigned : 1;
2491 unsigned : 1;
2492 unsigned : 1;
2493 unsigned : 1;
2496 struct
2498 unsigned : 1;
2499 unsigned NOT_DONE : 1;
2500 unsigned : 1;
2501 unsigned : 1;
2502 unsigned : 1;
2503 unsigned : 1;
2504 unsigned : 1;
2505 unsigned : 1;
2508 struct
2510 unsigned : 1;
2511 unsigned GO_DONE : 1;
2512 unsigned : 1;
2513 unsigned : 1;
2514 unsigned : 1;
2515 unsigned : 1;
2516 unsigned : 1;
2517 unsigned : 1;
2520 struct
2522 unsigned : 1;
2523 unsigned GO : 1;
2524 unsigned : 1;
2525 unsigned : 1;
2526 unsigned : 1;
2527 unsigned : 1;
2528 unsigned : 1;
2529 unsigned : 1;
2532 struct
2534 unsigned : 2;
2535 unsigned CHS : 4;
2536 unsigned : 2;
2538 } __ADCON0bits_t;
2540 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
2542 #define _ADON 0x01
2543 #define _GO_NOT_DONE 0x02
2544 #define _DONE 0x02
2545 #define _NOT_DONE 0x02
2546 #define _GO_DONE 0x02
2547 #define _GO 0x02
2548 #define _CHS0 0x04
2549 #define _CHS1 0x08
2550 #define _CHS2 0x10
2551 #define _CHS3 0x20
2553 //==============================================================================
2555 extern __at(0x0FC3) __sfr ADRES;
2556 extern __at(0x0FC3) __sfr ADRESL;
2557 extern __at(0x0FC4) __sfr ADRESH;
2559 //==============================================================================
2560 // SSPCON2 Bits
2562 extern __at(0x0FC5) __sfr SSPCON2;
2564 typedef struct
2566 unsigned SEN : 1;
2567 unsigned RSEN : 1;
2568 unsigned PEN : 1;
2569 unsigned RCEN : 1;
2570 unsigned ACKEN : 1;
2571 unsigned ACKDT : 1;
2572 unsigned ACKSTAT : 1;
2573 unsigned GCEN : 1;
2574 } __SSPCON2bits_t;
2576 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
2578 #define _SEN 0x01
2579 #define _RSEN 0x02
2580 #define _PEN 0x04
2581 #define _RCEN 0x08
2582 #define _ACKEN 0x10
2583 #define _ACKDT 0x20
2584 #define _ACKSTAT 0x40
2585 #define _GCEN 0x80
2587 //==============================================================================
2590 //==============================================================================
2591 // SSPCON1 Bits
2593 extern __at(0x0FC6) __sfr SSPCON1;
2595 typedef union
2597 struct
2599 unsigned SSPM0 : 1;
2600 unsigned SSPM1 : 1;
2601 unsigned SSPM2 : 1;
2602 unsigned SSPM3 : 1;
2603 unsigned CKP : 1;
2604 unsigned SSPEN : 1;
2605 unsigned SSPOV : 1;
2606 unsigned WCOL : 1;
2609 struct
2611 unsigned SSPM : 4;
2612 unsigned : 4;
2614 } __SSPCON1bits_t;
2616 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
2618 #define _SSPM0 0x01
2619 #define _SSPM1 0x02
2620 #define _SSPM2 0x04
2621 #define _SSPM3 0x08
2622 #define _CKP 0x10
2623 #define _SSPEN 0x20
2624 #define _SSPOV 0x40
2625 #define _WCOL 0x80
2627 //==============================================================================
2630 //==============================================================================
2631 // SSPSTAT Bits
2633 extern __at(0x0FC7) __sfr SSPSTAT;
2635 typedef union
2637 struct
2639 unsigned BF : 1;
2640 unsigned UA : 1;
2641 unsigned R_NOT_W : 1;
2642 unsigned S : 1;
2643 unsigned P : 1;
2644 unsigned D_NOT_A : 1;
2645 unsigned CKE : 1;
2646 unsigned SMP : 1;
2649 struct
2651 unsigned : 1;
2652 unsigned : 1;
2653 unsigned R : 1;
2654 unsigned START : 1;
2655 unsigned STOP : 1;
2656 unsigned D : 1;
2657 unsigned : 1;
2658 unsigned : 1;
2661 struct
2663 unsigned : 1;
2664 unsigned : 1;
2665 unsigned NOT_W : 1;
2666 unsigned : 1;
2667 unsigned : 1;
2668 unsigned NOT_A : 1;
2669 unsigned : 1;
2670 unsigned : 1;
2673 struct
2675 unsigned : 1;
2676 unsigned : 1;
2677 unsigned R_W : 1;
2678 unsigned : 1;
2679 unsigned : 1;
2680 unsigned D_A : 1;
2681 unsigned : 1;
2682 unsigned : 1;
2685 struct
2687 unsigned : 1;
2688 unsigned : 1;
2689 unsigned NOT_WRITE : 1;
2690 unsigned : 1;
2691 unsigned : 1;
2692 unsigned NOT_ADDRESS : 1;
2693 unsigned : 1;
2694 unsigned : 1;
2696 } __SSPSTATbits_t;
2698 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
2700 #define _BF 0x01
2701 #define _UA 0x02
2702 #define _R_NOT_W 0x04
2703 #define _R 0x04
2704 #define _NOT_W 0x04
2705 #define _R_W 0x04
2706 #define _NOT_WRITE 0x04
2707 #define _S 0x08
2708 #define _START 0x08
2709 #define _P 0x10
2710 #define _STOP 0x10
2711 #define _D_NOT_A 0x20
2712 #define _D 0x20
2713 #define _NOT_A 0x20
2714 #define _D_A 0x20
2715 #define _NOT_ADDRESS 0x20
2716 #define _CKE 0x40
2717 #define _SMP 0x80
2719 //==============================================================================
2721 extern __at(0x0FC8) __sfr SSPADD;
2722 extern __at(0x0FC9) __sfr SSPBUF;
2724 //==============================================================================
2725 // T2CON Bits
2727 extern __at(0x0FCA) __sfr T2CON;
2729 typedef union
2731 struct
2733 unsigned T2CKPS0 : 1;
2734 unsigned T2CKPS1 : 1;
2735 unsigned TMR2ON : 1;
2736 unsigned T2OUTPS0 : 1;
2737 unsigned T2OUTPS1 : 1;
2738 unsigned T2OUTPS2 : 1;
2739 unsigned T2OUTPS3 : 1;
2740 unsigned : 1;
2743 struct
2745 unsigned T2CKPS : 2;
2746 unsigned : 6;
2749 struct
2751 unsigned : 3;
2752 unsigned T2OUTPS : 4;
2753 unsigned : 1;
2755 } __T2CONbits_t;
2757 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
2759 #define _T2CKPS0 0x01
2760 #define _T2CKPS1 0x02
2761 #define _TMR2ON 0x04
2762 #define _T2OUTPS0 0x08
2763 #define _T2OUTPS1 0x10
2764 #define _T2OUTPS2 0x20
2765 #define _T2OUTPS3 0x40
2767 //==============================================================================
2769 extern __at(0x0FCB) __sfr PR2;
2770 extern __at(0x0FCC) __sfr TMR2;
2772 //==============================================================================
2773 // T1CON Bits
2775 extern __at(0x0FCD) __sfr T1CON;
2777 typedef union
2779 struct
2781 unsigned TMR1ON : 1;
2782 unsigned TMR1CS : 1;
2783 unsigned NOT_T1SYNC : 1;
2784 unsigned T1OSCEN : 1;
2785 unsigned T1CKPS0 : 1;
2786 unsigned T1CKPS1 : 1;
2787 unsigned T1RUN : 1;
2788 unsigned RD16 : 1;
2791 struct
2793 unsigned : 1;
2794 unsigned : 1;
2795 unsigned T1SYNC : 1;
2796 unsigned : 1;
2797 unsigned : 1;
2798 unsigned : 1;
2799 unsigned : 1;
2800 unsigned : 1;
2803 struct
2805 unsigned : 4;
2806 unsigned T1CKPS : 2;
2807 unsigned : 2;
2809 } __T1CONbits_t;
2811 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
2813 #define _TMR1ON 0x01
2814 #define _TMR1CS 0x02
2815 #define _NOT_T1SYNC 0x04
2816 #define _T1SYNC 0x04
2817 #define _T1OSCEN 0x08
2818 #define _T1CKPS0 0x10
2819 #define _T1CKPS1 0x20
2820 #define _T1RUN 0x40
2821 #define _RD16 0x80
2823 //==============================================================================
2825 extern __at(0x0FCE) __sfr TMR1;
2826 extern __at(0x0FCE) __sfr TMR1L;
2827 extern __at(0x0FCF) __sfr TMR1H;
2829 //==============================================================================
2830 // RCON Bits
2832 extern __at(0x0FD0) __sfr RCON;
2834 typedef union
2836 struct
2838 unsigned NOT_BOR : 1;
2839 unsigned NOT_POR : 1;
2840 unsigned NOT_PD : 1;
2841 unsigned NOT_TO : 1;
2842 unsigned NOT_RI : 1;
2843 unsigned : 1;
2844 unsigned SBOREN : 1;
2845 unsigned IPEN : 1;
2848 struct
2850 unsigned BOR : 1;
2851 unsigned POR : 1;
2852 unsigned PD : 1;
2853 unsigned TO : 1;
2854 unsigned RI : 1;
2855 unsigned : 1;
2856 unsigned : 1;
2857 unsigned : 1;
2859 } __RCONbits_t;
2861 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
2863 #define _NOT_BOR 0x01
2864 #define _BOR 0x01
2865 #define _NOT_POR 0x02
2866 #define _POR 0x02
2867 #define _NOT_PD 0x04
2868 #define _PD 0x04
2869 #define _NOT_TO 0x08
2870 #define _TO 0x08
2871 #define _NOT_RI 0x10
2872 #define _RI 0x10
2873 #define _SBOREN 0x40
2874 #define _IPEN 0x80
2876 //==============================================================================
2879 //==============================================================================
2880 // WDTCON Bits
2882 extern __at(0x0FD1) __sfr WDTCON;
2884 typedef union
2886 struct
2888 unsigned SWDTEN : 1;
2889 unsigned : 1;
2890 unsigned : 1;
2891 unsigned : 1;
2892 unsigned : 1;
2893 unsigned : 1;
2894 unsigned : 1;
2895 unsigned : 1;
2898 struct
2900 unsigned SWDTE : 1;
2901 unsigned : 1;
2902 unsigned : 1;
2903 unsigned : 1;
2904 unsigned : 1;
2905 unsigned : 1;
2906 unsigned : 1;
2907 unsigned : 1;
2909 } __WDTCONbits_t;
2911 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
2913 #define _SWDTEN 0x01
2914 #define _SWDTE 0x01
2916 //==============================================================================
2919 //==============================================================================
2920 // HLVDCON Bits
2922 extern __at(0x0FD2) __sfr HLVDCON;
2924 typedef union
2926 struct
2928 unsigned HLVDL0 : 1;
2929 unsigned HLVDL1 : 1;
2930 unsigned HLVDL2 : 1;
2931 unsigned HLVDL3 : 1;
2932 unsigned HLVDEN : 1;
2933 unsigned IRVST : 1;
2934 unsigned : 1;
2935 unsigned VDIRMAG : 1;
2938 struct
2940 unsigned LVDL0 : 1;
2941 unsigned LVDL1 : 1;
2942 unsigned LVDL2 : 1;
2943 unsigned LVDL3 : 1;
2944 unsigned LVDEN : 1;
2945 unsigned IVRST : 1;
2946 unsigned : 1;
2947 unsigned : 1;
2950 struct
2952 unsigned LVV0 : 1;
2953 unsigned LVV1 : 1;
2954 unsigned LVV2 : 1;
2955 unsigned LVV3 : 1;
2956 unsigned : 1;
2957 unsigned BGST : 1;
2958 unsigned : 1;
2959 unsigned : 1;
2962 struct
2964 unsigned LVDL : 4;
2965 unsigned : 4;
2968 struct
2970 unsigned HLVDL : 4;
2971 unsigned : 4;
2974 struct
2976 unsigned LVV : 4;
2977 unsigned : 4;
2979 } __HLVDCONbits_t;
2981 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
2983 #define _HLVDL0 0x01
2984 #define _LVDL0 0x01
2985 #define _LVV0 0x01
2986 #define _HLVDL1 0x02
2987 #define _LVDL1 0x02
2988 #define _LVV1 0x02
2989 #define _HLVDL2 0x04
2990 #define _LVDL2 0x04
2991 #define _LVV2 0x04
2992 #define _HLVDL3 0x08
2993 #define _LVDL3 0x08
2994 #define _LVV3 0x08
2995 #define _HLVDEN 0x10
2996 #define _LVDEN 0x10
2997 #define _IRVST 0x20
2998 #define _IVRST 0x20
2999 #define _BGST 0x20
3000 #define _VDIRMAG 0x80
3002 //==============================================================================
3005 //==============================================================================
3006 // LVDCON Bits
3008 extern __at(0x0FD2) __sfr LVDCON;
3010 typedef union
3012 struct
3014 unsigned HLVDL0 : 1;
3015 unsigned HLVDL1 : 1;
3016 unsigned HLVDL2 : 1;
3017 unsigned HLVDL3 : 1;
3018 unsigned HLVDEN : 1;
3019 unsigned IRVST : 1;
3020 unsigned : 1;
3021 unsigned VDIRMAG : 1;
3024 struct
3026 unsigned LVDL0 : 1;
3027 unsigned LVDL1 : 1;
3028 unsigned LVDL2 : 1;
3029 unsigned LVDL3 : 1;
3030 unsigned LVDEN : 1;
3031 unsigned IVRST : 1;
3032 unsigned : 1;
3033 unsigned : 1;
3036 struct
3038 unsigned LVV0 : 1;
3039 unsigned LVV1 : 1;
3040 unsigned LVV2 : 1;
3041 unsigned LVV3 : 1;
3042 unsigned : 1;
3043 unsigned BGST : 1;
3044 unsigned : 1;
3045 unsigned : 1;
3048 struct
3050 unsigned HLVDL : 4;
3051 unsigned : 4;
3054 struct
3056 unsigned LVV : 4;
3057 unsigned : 4;
3060 struct
3062 unsigned LVDL : 4;
3063 unsigned : 4;
3065 } __LVDCONbits_t;
3067 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
3069 #define _LVDCON_HLVDL0 0x01
3070 #define _LVDCON_LVDL0 0x01
3071 #define _LVDCON_LVV0 0x01
3072 #define _LVDCON_HLVDL1 0x02
3073 #define _LVDCON_LVDL1 0x02
3074 #define _LVDCON_LVV1 0x02
3075 #define _LVDCON_HLVDL2 0x04
3076 #define _LVDCON_LVDL2 0x04
3077 #define _LVDCON_LVV2 0x04
3078 #define _LVDCON_HLVDL3 0x08
3079 #define _LVDCON_LVDL3 0x08
3080 #define _LVDCON_LVV3 0x08
3081 #define _LVDCON_HLVDEN 0x10
3082 #define _LVDCON_LVDEN 0x10
3083 #define _LVDCON_IRVST 0x20
3084 #define _LVDCON_IVRST 0x20
3085 #define _LVDCON_BGST 0x20
3086 #define _LVDCON_VDIRMAG 0x80
3088 //==============================================================================
3091 //==============================================================================
3092 // OSCCON Bits
3094 extern __at(0x0FD3) __sfr OSCCON;
3096 typedef union
3098 struct
3100 unsigned SCS0 : 1;
3101 unsigned SCS1 : 1;
3102 unsigned IOFS : 1;
3103 unsigned OSTS : 1;
3104 unsigned IRCF0 : 1;
3105 unsigned IRCF1 : 1;
3106 unsigned IRCF2 : 1;
3107 unsigned IDLEN : 1;
3110 struct
3112 unsigned SCS : 2;
3113 unsigned : 6;
3116 struct
3118 unsigned : 4;
3119 unsigned IRCF : 3;
3120 unsigned : 1;
3122 } __OSCCONbits_t;
3124 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
3126 #define _SCS0 0x01
3127 #define _SCS1 0x02
3128 #define _IOFS 0x04
3129 #define _OSTS 0x08
3130 #define _IRCF0 0x10
3131 #define _IRCF1 0x20
3132 #define _IRCF2 0x40
3133 #define _IDLEN 0x80
3135 //==============================================================================
3138 //==============================================================================
3139 // T0CON Bits
3141 extern __at(0x0FD5) __sfr T0CON;
3143 typedef union
3145 struct
3147 unsigned T0PS0 : 1;
3148 unsigned T0PS1 : 1;
3149 unsigned T0PS2 : 1;
3150 unsigned PSA : 1;
3151 unsigned T0SE : 1;
3152 unsigned T0CS : 1;
3153 unsigned T08BIT : 1;
3154 unsigned TMR0ON : 1;
3157 struct
3159 unsigned T0PS : 3;
3160 unsigned : 5;
3162 } __T0CONbits_t;
3164 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
3166 #define _T0PS0 0x01
3167 #define _T0PS1 0x02
3168 #define _T0PS2 0x04
3169 #define _PSA 0x08
3170 #define _T0SE 0x10
3171 #define _T0CS 0x20
3172 #define _T08BIT 0x40
3173 #define _TMR0ON 0x80
3175 //==============================================================================
3177 extern __at(0x0FD6) __sfr TMR0;
3178 extern __at(0x0FD6) __sfr TMR0L;
3179 extern __at(0x0FD7) __sfr TMR0H;
3181 //==============================================================================
3182 // STATUS Bits
3184 extern __at(0x0FD8) __sfr STATUS;
3186 typedef struct
3188 unsigned C : 1;
3189 unsigned DC : 1;
3190 unsigned Z : 1;
3191 unsigned OV : 1;
3192 unsigned N : 1;
3193 unsigned : 1;
3194 unsigned : 1;
3195 unsigned : 1;
3196 } __STATUSbits_t;
3198 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3200 #define _C 0x01
3201 #define _DC 0x02
3202 #define _Z 0x04
3203 #define _OV 0x08
3204 #define _N 0x10
3206 //==============================================================================
3208 extern __at(0x0FD9) __sfr FSR2L;
3209 extern __at(0x0FDA) __sfr FSR2H;
3210 extern __at(0x0FDB) __sfr PLUSW2;
3211 extern __at(0x0FDC) __sfr PREINC2;
3212 extern __at(0x0FDD) __sfr POSTDEC2;
3213 extern __at(0x0FDE) __sfr POSTINC2;
3214 extern __at(0x0FDF) __sfr INDF2;
3215 extern __at(0x0FE0) __sfr BSR;
3216 extern __at(0x0FE1) __sfr FSR1L;
3217 extern __at(0x0FE2) __sfr FSR1H;
3218 extern __at(0x0FE3) __sfr PLUSW1;
3219 extern __at(0x0FE4) __sfr PREINC1;
3220 extern __at(0x0FE5) __sfr POSTDEC1;
3221 extern __at(0x0FE6) __sfr POSTINC1;
3222 extern __at(0x0FE7) __sfr INDF1;
3223 extern __at(0x0FE8) __sfr WREG;
3224 extern __at(0x0FE9) __sfr FSR0L;
3225 extern __at(0x0FEA) __sfr FSR0H;
3226 extern __at(0x0FEB) __sfr PLUSW0;
3227 extern __at(0x0FEC) __sfr PREINC0;
3228 extern __at(0x0FED) __sfr POSTDEC0;
3229 extern __at(0x0FEE) __sfr POSTINC0;
3230 extern __at(0x0FEF) __sfr INDF0;
3232 //==============================================================================
3233 // INTCON3 Bits
3235 extern __at(0x0FF0) __sfr INTCON3;
3237 typedef union
3239 struct
3241 unsigned INT1IF : 1;
3242 unsigned INT2IF : 1;
3243 unsigned : 1;
3244 unsigned INT1IE : 1;
3245 unsigned INT2IE : 1;
3246 unsigned : 1;
3247 unsigned INT1IP : 1;
3248 unsigned INT2IP : 1;
3251 struct
3253 unsigned INT1F : 1;
3254 unsigned INT2F : 1;
3255 unsigned : 1;
3256 unsigned INT1E : 1;
3257 unsigned INT2E : 1;
3258 unsigned : 1;
3259 unsigned INT1P : 1;
3260 unsigned INT2P : 1;
3262 } __INTCON3bits_t;
3264 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3266 #define _INT1IF 0x01
3267 #define _INT1F 0x01
3268 #define _INT2IF 0x02
3269 #define _INT2F 0x02
3270 #define _INT1IE 0x08
3271 #define _INT1E 0x08
3272 #define _INT2IE 0x10
3273 #define _INT2E 0x10
3274 #define _INT1IP 0x40
3275 #define _INT1P 0x40
3276 #define _INT2IP 0x80
3277 #define _INT2P 0x80
3279 //==============================================================================
3282 //==============================================================================
3283 // INTCON2 Bits
3285 extern __at(0x0FF1) __sfr INTCON2;
3287 typedef union
3289 struct
3291 unsigned RBIP : 1;
3292 unsigned : 1;
3293 unsigned TMR0IP : 1;
3294 unsigned : 1;
3295 unsigned INTEDG2 : 1;
3296 unsigned INTEDG1 : 1;
3297 unsigned INTEDG0 : 1;
3298 unsigned NOT_RBPU : 1;
3301 struct
3303 unsigned : 1;
3304 unsigned : 1;
3305 unsigned : 1;
3306 unsigned : 1;
3307 unsigned : 1;
3308 unsigned : 1;
3309 unsigned : 1;
3310 unsigned RBPU : 1;
3312 } __INTCON2bits_t;
3314 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3316 #define _RBIP 0x01
3317 #define _TMR0IP 0x04
3318 #define _INTEDG2 0x10
3319 #define _INTEDG1 0x20
3320 #define _INTEDG0 0x40
3321 #define _NOT_RBPU 0x80
3322 #define _RBPU 0x80
3324 //==============================================================================
3327 //==============================================================================
3328 // INTCON Bits
3330 extern __at(0x0FF2) __sfr INTCON;
3332 typedef union
3334 struct
3336 unsigned RBIF : 1;
3337 unsigned INT0IF : 1;
3338 unsigned TMR0IF : 1;
3339 unsigned RBIE : 1;
3340 unsigned INT0IE : 1;
3341 unsigned TMR0IE : 1;
3342 unsigned PEIE_GIEL : 1;
3343 unsigned GIE_GIEH : 1;
3346 struct
3348 unsigned : 1;
3349 unsigned INT0F : 1;
3350 unsigned T0IF : 1;
3351 unsigned : 1;
3352 unsigned INT0E : 1;
3353 unsigned T0IE : 1;
3354 unsigned PEIE : 1;
3355 unsigned GIE : 1;
3358 struct
3360 unsigned : 1;
3361 unsigned : 1;
3362 unsigned : 1;
3363 unsigned : 1;
3364 unsigned : 1;
3365 unsigned : 1;
3366 unsigned GIEL : 1;
3367 unsigned GIEH : 1;
3369 } __INTCONbits_t;
3371 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3373 #define _RBIF 0x01
3374 #define _INT0IF 0x02
3375 #define _INT0F 0x02
3376 #define _TMR0IF 0x04
3377 #define _T0IF 0x04
3378 #define _RBIE 0x08
3379 #define _INT0IE 0x10
3380 #define _INT0E 0x10
3381 #define _TMR0IE 0x20
3382 #define _T0IE 0x20
3383 #define _PEIE_GIEL 0x40
3384 #define _PEIE 0x40
3385 #define _GIEL 0x40
3386 #define _GIE_GIEH 0x80
3387 #define _GIE 0x80
3388 #define _GIEH 0x80
3390 //==============================================================================
3392 extern __at(0x0FF3) __sfr PROD;
3393 extern __at(0x0FF3) __sfr PRODL;
3394 extern __at(0x0FF4) __sfr PRODH;
3395 extern __at(0x0FF5) __sfr TABLAT;
3396 extern __at(0x0FF6) __sfr TBLPTR;
3397 extern __at(0x0FF6) __sfr TBLPTRL;
3398 extern __at(0x0FF7) __sfr TBLPTRH;
3399 extern __at(0x0FF8) __sfr TBLPTRU;
3400 extern __at(0x0FF9) __sfr PC;
3401 extern __at(0x0FF9) __sfr PCL;
3402 extern __at(0x0FFA) __sfr PCLATH;
3403 extern __at(0x0FFB) __sfr PCLATU;
3405 //==============================================================================
3406 // STKPTR Bits
3408 extern __at(0x0FFC) __sfr STKPTR;
3410 typedef union
3412 struct
3414 unsigned SP0 : 1;
3415 unsigned SP1 : 1;
3416 unsigned SP2 : 1;
3417 unsigned SP3 : 1;
3418 unsigned SP4 : 1;
3419 unsigned : 1;
3420 unsigned STKUNF : 1;
3421 unsigned STKFUL : 1;
3424 struct
3426 unsigned : 1;
3427 unsigned : 1;
3428 unsigned : 1;
3429 unsigned : 1;
3430 unsigned : 1;
3431 unsigned : 1;
3432 unsigned : 1;
3433 unsigned STKOVF : 1;
3436 struct
3438 unsigned SP : 5;
3439 unsigned : 3;
3441 } __STKPTRbits_t;
3443 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
3445 #define _SP0 0x01
3446 #define _SP1 0x02
3447 #define _SP2 0x04
3448 #define _SP3 0x08
3449 #define _SP4 0x10
3450 #define _STKUNF 0x40
3451 #define _STKFUL 0x80
3452 #define _STKOVF 0x80
3454 //==============================================================================
3456 extern __at(0x0FFD) __sfr TOS;
3457 extern __at(0x0FFD) __sfr TOSL;
3458 extern __at(0x0FFE) __sfr TOSH;
3459 extern __at(0x0FFF) __sfr TOSU;
3461 //==============================================================================
3463 // Configuration Bits
3465 //==============================================================================
3467 #define __CONFIG1H 0x300001
3468 #define __CONFIG2L 0x300002
3469 #define __CONFIG2H 0x300003
3470 #define __CONFIG3H 0x300005
3471 #define __CONFIG4L 0x300006
3472 #define __CONFIG5L 0x300008
3473 #define __CONFIG5H 0x300009
3474 #define __CONFIG6L 0x30000A
3475 #define __CONFIG6H 0x30000B
3476 #define __CONFIG7L 0x30000C
3477 #define __CONFIG7H 0x30000D
3479 //----------------------------- CONFIG1H Options -------------------------------
3481 #define _FOSC_LP_1H 0xF0 // LP oscillator.
3482 #define _FOSC_XT_1H 0xF1 // XT oscillator.
3483 #define _FOSC_HS_1H 0xF2 // HS oscillator.
3484 #define _FOSC_RC_1H 0xF3 // External RC oscillator, CLKOUT function on RA6.
3485 #define _FOSC_EC_1H 0xF4 // EC oscillator, CLKOUT function on RA6.
3486 #define _FOSC_ECIO6_1H 0xF5 // EC oscillator, port function on RA6.
3487 #define _FOSC_HSPLL_1H 0xF6 // HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1).
3488 #define _FOSC_RCIO6_1H 0xF7 // External RC oscillator, port function on RA6.
3489 #define _FOSC_INTIO67_1H 0xF8 // Internal oscillator block, port function on RA6 and RA7.
3490 #define _FOSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKOUT function on RA6, port function on RA7.
3491 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
3492 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
3493 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
3494 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
3496 //----------------------------- CONFIG2L Options -------------------------------
3498 #define _PWRT_ON_2L 0xFE // PWRT enabled.
3499 #define _PWRT_OFF_2L 0xFF // PWRT disabled.
3500 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
3501 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
3502 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
3503 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
3504 #define _BORV_30_2L 0xE7 // VBOR set to 3.0 V nominal.
3505 #define _BORV_27_2L 0xEF // VBOR set to 2.7 V nominal.
3506 #define _BORV_22_2L 0xF7 // VBOR set to 2.2 V nominal.
3507 #define _BORV_18_2L 0xFF // VBOR set to 1.8 V nominal.
3509 //----------------------------- CONFIG2H Options -------------------------------
3511 #define _WDTEN_OFF_2H 0xFE // WDT is controlled by SWDTEN bit of the WDTCON register.
3512 #define _WDTEN_ON_2H 0xFF // WDT is always enabled. SWDTEN bit has no effect.
3513 #define _WDTPS_1_2H 0xE1 // 1:1.
3514 #define _WDTPS_2_2H 0xE3 // 1:2.
3515 #define _WDTPS_4_2H 0xE5 // 1:4.
3516 #define _WDTPS_8_2H 0xE7 // 1:8.
3517 #define _WDTPS_16_2H 0xE9 // 1:16.
3518 #define _WDTPS_32_2H 0xEB // 1:32.
3519 #define _WDTPS_64_2H 0xED // 1:64.
3520 #define _WDTPS_128_2H 0xEF // 1:128.
3521 #define _WDTPS_256_2H 0xF1 // 1:256.
3522 #define _WDTPS_512_2H 0xF3 // 1:512.
3523 #define _WDTPS_1024_2H 0xF5 // 1:1024.
3524 #define _WDTPS_2048_2H 0xF7 // 1:2048.
3525 #define _WDTPS_4096_2H 0xF9 // 1:4096.
3526 #define _WDTPS_8192_2H 0xFB // 1:8192.
3527 #define _WDTPS_16384_2H 0xFD // 1:16384.
3528 #define _WDTPS_32768_2H 0xFF // 1:32768.
3530 //----------------------------- CONFIG3H Options -------------------------------
3532 #define _CCP2MX_PORTBE_3H 0xFE // CCP2 input/output is multiplexed with RB3.
3533 #define _CCP2MX_PORTC_3H 0xFF // CCP2 input/output is multiplexed with RC1.
3534 #define _PBADEN_OFF_3H 0xFD // PORTB<4:0> pins are configured as digital I/O on Reset.
3535 #define _PBADEN_ON_3H 0xFF // PORTB<4:0> pins are configured as analog input channels on Reset.
3536 #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
3537 #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
3538 #define _HFOFST_OFF_3H 0xF7 // The system clock is held off until the HFINTOSC is stable.
3539 #define _HFOFST_ON_3H 0xFF // HFINTOSC starts clocking the CPU without waiting for the oscillator to stablize.
3540 #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; MCLR disabled.
3541 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input pin disabled.
3543 //----------------------------- CONFIG4L Options -------------------------------
3545 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
3546 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
3547 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
3548 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled.
3549 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
3550 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
3551 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
3552 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
3554 //----------------------------- CONFIG5L Options -------------------------------
3556 #define _CP0_ON_5L 0xFE // Block 0 (000800-001FFFh) code-protected.
3557 #define _CP0_OFF_5L 0xFF // Block 0 (000800-001FFFh) not code-protected.
3558 #define _CP1_ON_5L 0xFD // Block 1 (002000-003FFFh) code-protected.
3559 #define _CP1_OFF_5L 0xFF // Block 1 (002000-003FFFh) not code-protected.
3560 #define _CP2_ON_5L 0xFB // Block 2 (004000-005FFFh) code-protected.
3561 #define _CP2_OFF_5L 0xFF // Block 2 (004000-005FFFh) not code-protected.
3562 #define _CP3_ON_5L 0xF7 // Block 3 (006000-007FFFh) code-protected.
3563 #define _CP3_OFF_5L 0xFF // Block 3 (006000-007FFFh) not code-protected.
3565 //----------------------------- CONFIG5H Options -------------------------------
3567 #define _CPB_ON_5H 0xBF // Boot block (000000-0007FFh) code-protected.
3568 #define _CPB_OFF_5H 0xFF // Boot block (000000-0007FFh) not code-protected.
3569 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
3570 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
3572 //----------------------------- CONFIG6L Options -------------------------------
3574 #define _WRT0_ON_6L 0xFE // Block 0 (000800-001FFFh) write-protected.
3575 #define _WRT0_OFF_6L 0xFF // Block 0 (000800-001FFFh) not write-protected.
3576 #define _WRT1_ON_6L 0xFD // Block 1 (002000-003FFFh) write-protected.
3577 #define _WRT1_OFF_6L 0xFF // Block 1 (002000-003FFFh) not write-protected.
3578 #define _WRT2_ON_6L 0xFB // Block 2 (004000-005FFFh) write-protected.
3579 #define _WRT2_OFF_6L 0xFF // Block 2 (004000-005FFFh) not write-protected.
3580 #define _WRT3_ON_6L 0xF7 // Block 3 (006000-007FFFh) write-protected.
3581 #define _WRT3_OFF_6L 0xFF // Block 3 (006000-007FFFh) not write-protected.
3583 //----------------------------- CONFIG6H Options -------------------------------
3585 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
3586 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
3587 #define _WRTB_ON_6H 0xBF // Boot Block (000000-0007FFh) write-protected.
3588 #define _WRTB_OFF_6H 0xFF // Boot Block (000000-0007FFh) not write-protected.
3589 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
3590 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
3592 //----------------------------- CONFIG7L Options -------------------------------
3594 #define _EBTR0_ON_7L 0xFE // Block 0 (000800-001FFFh) protected from table reads executed in other blocks.
3595 #define _EBTR0_OFF_7L 0xFF // Block 0 (000800-001FFFh) not protected from table reads executed in other blocks.
3596 #define _EBTR1_ON_7L 0xFD // Block 1 (002000-003FFFh) protected from table reads executed in other blocks.
3597 #define _EBTR1_OFF_7L 0xFF // Block 1 (002000-003FFFh) not protected from table reads executed in other blocks.
3598 #define _EBTR2_ON_7L 0xFB // Block 2 (004000-005FFFh) protected from table reads executed in other blocks.
3599 #define _EBTR2_OFF_7L 0xFF // Block 2 (004000-005FFFh) not protected from table reads executed in other blocks.
3600 #define _EBTR3_ON_7L 0xF7 // Block 3 (006000-007FFFh) protected from table reads executed in other blocks.
3601 #define _EBTR3_OFF_7L 0xFF // Block 3 (006000-007FFFh) not protected from table reads executed in other blocks.
3603 //----------------------------- CONFIG7H Options -------------------------------
3605 #define _EBTRB_ON_7H 0xBF // Boot Block (000000-0007FFh) protected from table reads executed in other blocks.
3606 #define _EBTRB_OFF_7H 0xFF // Boot Block (000000-0007FFh) not protected from table reads executed in other blocks.
3608 //==============================================================================
3610 #define __DEVID1 0x3FFFFE
3611 #define __DEVID2 0x3FFFFF
3613 #define __IDLOC0 0x200000
3614 #define __IDLOC1 0x200001
3615 #define __IDLOC2 0x200002
3616 #define __IDLOC3 0x200003
3617 #define __IDLOC4 0x200004
3618 #define __IDLOC5 0x200005
3619 #define __IDLOC6 0x200006
3620 #define __IDLOC7 0x200007
3622 #endif // #ifndef __PIC18F45K20_H__