Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18lf2525.h
blobb0c9a56be21de604a5597e3605f9700869578708
1 /*
2 * This declarations of the PIC18LF2525 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:24:01 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 __PIC18LF2525_H__
26 #define __PIC18LF2525_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 : 1;
59 unsigned : 1;
60 unsigned : 1;
61 unsigned : 1;
62 unsigned T0CKI : 1;
63 unsigned AN4 : 1;
64 unsigned : 1;
65 unsigned : 1;
68 struct
70 unsigned : 1;
71 unsigned : 1;
72 unsigned : 1;
73 unsigned : 1;
74 unsigned : 1;
75 unsigned SS : 1;
76 unsigned : 1;
77 unsigned : 1;
80 struct
82 unsigned : 1;
83 unsigned : 1;
84 unsigned : 1;
85 unsigned : 1;
86 unsigned : 1;
87 unsigned NOT_SS : 1;
88 unsigned : 1;
89 unsigned : 1;
92 struct
94 unsigned : 1;
95 unsigned : 1;
96 unsigned : 1;
97 unsigned : 1;
98 unsigned : 1;
99 unsigned LVDIN : 1;
100 unsigned : 1;
101 unsigned : 1;
104 struct
106 unsigned : 1;
107 unsigned : 1;
108 unsigned : 1;
109 unsigned : 1;
110 unsigned : 1;
111 unsigned HLVDIN : 1;
112 unsigned : 1;
113 unsigned : 1;
115 } __PORTAbits_t;
117 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
119 #define _PORTA_RA0 0x01
120 #define _PORTA_RA1 0x02
121 #define _PORTA_RA2 0x04
122 #define _PORTA_RA3 0x08
123 #define _PORTA_RA4 0x10
124 #define _PORTA_T0CKI 0x10
125 #define _PORTA_RA5 0x20
126 #define _PORTA_AN4 0x20
127 #define _PORTA_SS 0x20
128 #define _PORTA_NOT_SS 0x20
129 #define _PORTA_LVDIN 0x20
130 #define _PORTA_HLVDIN 0x20
131 #define _PORTA_RA6 0x40
132 #define _PORTA_RA7 0x80
134 //==============================================================================
137 //==============================================================================
138 // PORTB Bits
140 extern __at(0x0F81) __sfr PORTB;
142 typedef union
144 struct
146 unsigned RB0 : 1;
147 unsigned RB1 : 1;
148 unsigned RB2 : 1;
149 unsigned RB3 : 1;
150 unsigned RB4 : 1;
151 unsigned RB5 : 1;
152 unsigned RB6 : 1;
153 unsigned RB7 : 1;
156 struct
158 unsigned INT0 : 1;
159 unsigned INT1 : 1;
160 unsigned INT2 : 1;
161 unsigned CCP2 : 1;
162 unsigned KBI0 : 1;
163 unsigned KBI1 : 1;
164 unsigned KBI2 : 1;
165 unsigned KBI3 : 1;
168 struct
170 unsigned AN12 : 1;
171 unsigned AN10 : 1;
172 unsigned AN8 : 1;
173 unsigned AN9 : 1;
174 unsigned AN11 : 1;
175 unsigned PGM : 1;
176 unsigned PGC : 1;
177 unsigned PGD : 1;
180 struct
182 unsigned INT : 3;
183 unsigned : 5;
186 struct
188 unsigned : 4;
189 unsigned KBI : 4;
191 } __PORTBbits_t;
193 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
195 #define _PORTB_RB0 0x01
196 #define _PORTB_INT0 0x01
197 #define _PORTB_AN12 0x01
198 #define _PORTB_RB1 0x02
199 #define _PORTB_INT1 0x02
200 #define _PORTB_AN10 0x02
201 #define _PORTB_RB2 0x04
202 #define _PORTB_INT2 0x04
203 #define _PORTB_AN8 0x04
204 #define _PORTB_RB3 0x08
205 #define _PORTB_CCP2 0x08
206 #define _PORTB_AN9 0x08
207 #define _PORTB_RB4 0x10
208 #define _PORTB_KBI0 0x10
209 #define _PORTB_AN11 0x10
210 #define _PORTB_RB5 0x20
211 #define _PORTB_KBI1 0x20
212 #define _PORTB_PGM 0x20
213 #define _PORTB_RB6 0x40
214 #define _PORTB_KBI2 0x40
215 #define _PORTB_PGC 0x40
216 #define _PORTB_RB7 0x80
217 #define _PORTB_KBI3 0x80
218 #define _PORTB_PGD 0x80
220 //==============================================================================
223 //==============================================================================
224 // PORTC Bits
226 extern __at(0x0F82) __sfr PORTC;
228 typedef union
230 struct
232 unsigned RC0 : 1;
233 unsigned RC1 : 1;
234 unsigned RC2 : 1;
235 unsigned RC3 : 1;
236 unsigned RC4 : 1;
237 unsigned RC5 : 1;
238 unsigned RC6 : 1;
239 unsigned RC7 : 1;
242 struct
244 unsigned T1OSO : 1;
245 unsigned T1OSI : 1;
246 unsigned CCP1 : 1;
247 unsigned SCK : 1;
248 unsigned SDI : 1;
249 unsigned SDO : 1;
250 unsigned TX : 1;
251 unsigned RX : 1;
254 struct
256 unsigned T13CKI : 1;
257 unsigned CCP2 : 1;
258 unsigned : 1;
259 unsigned SCL : 1;
260 unsigned SDA : 1;
261 unsigned : 1;
262 unsigned CK : 1;
263 unsigned : 1;
266 struct
268 unsigned T1CKI : 1;
269 unsigned : 1;
270 unsigned : 1;
271 unsigned : 1;
272 unsigned : 1;
273 unsigned : 1;
274 unsigned : 1;
275 unsigned : 1;
277 } __PORTCbits_t;
279 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
281 #define _PORTC_RC0 0x01
282 #define _PORTC_T1OSO 0x01
283 #define _PORTC_T13CKI 0x01
284 #define _PORTC_T1CKI 0x01
285 #define _PORTC_RC1 0x02
286 #define _PORTC_T1OSI 0x02
287 #define _PORTC_CCP2 0x02
288 #define _PORTC_RC2 0x04
289 #define _PORTC_CCP1 0x04
290 #define _PORTC_RC3 0x08
291 #define _PORTC_SCK 0x08
292 #define _PORTC_SCL 0x08
293 #define _PORTC_RC4 0x10
294 #define _PORTC_SDI 0x10
295 #define _PORTC_SDA 0x10
296 #define _PORTC_RC5 0x20
297 #define _PORTC_SDO 0x20
298 #define _PORTC_RC6 0x40
299 #define _PORTC_TX 0x40
300 #define _PORTC_CK 0x40
301 #define _PORTC_RC7 0x80
302 #define _PORTC_RX 0x80
304 //==============================================================================
307 //==============================================================================
308 // PORTE Bits
310 extern __at(0x0F84) __sfr PORTE;
312 typedef union
314 struct
316 unsigned : 1;
317 unsigned : 1;
318 unsigned : 1;
319 unsigned RE3 : 1;
320 unsigned : 1;
321 unsigned : 1;
322 unsigned : 1;
323 unsigned : 1;
326 struct
328 unsigned : 1;
329 unsigned : 1;
330 unsigned : 1;
331 unsigned MCLR : 1;
332 unsigned : 1;
333 unsigned : 1;
334 unsigned : 1;
335 unsigned : 1;
338 struct
340 unsigned : 1;
341 unsigned : 1;
342 unsigned : 1;
343 unsigned NOT_MCLR : 1;
344 unsigned : 1;
345 unsigned : 1;
346 unsigned : 1;
347 unsigned : 1;
350 struct
352 unsigned : 1;
353 unsigned : 1;
354 unsigned : 1;
355 unsigned VPP : 1;
356 unsigned : 1;
357 unsigned : 1;
358 unsigned : 1;
359 unsigned : 1;
361 } __PORTEbits_t;
363 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
365 #define _RE3 0x08
366 #define _MCLR 0x08
367 #define _NOT_MCLR 0x08
368 #define _VPP 0x08
370 //==============================================================================
373 //==============================================================================
374 // LATA Bits
376 extern __at(0x0F89) __sfr LATA;
378 typedef struct
380 unsigned LATA0 : 1;
381 unsigned LATA1 : 1;
382 unsigned LATA2 : 1;
383 unsigned LATA3 : 1;
384 unsigned LATA4 : 1;
385 unsigned LATA5 : 1;
386 unsigned LATA6 : 1;
387 unsigned LATA7 : 1;
388 } __LATAbits_t;
390 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
392 #define _LATA0 0x01
393 #define _LATA1 0x02
394 #define _LATA2 0x04
395 #define _LATA3 0x08
396 #define _LATA4 0x10
397 #define _LATA5 0x20
398 #define _LATA6 0x40
399 #define _LATA7 0x80
401 //==============================================================================
404 //==============================================================================
405 // LATB Bits
407 extern __at(0x0F8A) __sfr LATB;
409 typedef struct
411 unsigned LATB0 : 1;
412 unsigned LATB1 : 1;
413 unsigned LATB2 : 1;
414 unsigned LATB3 : 1;
415 unsigned LATB4 : 1;
416 unsigned LATB5 : 1;
417 unsigned LATB6 : 1;
418 unsigned LATB7 : 1;
419 } __LATBbits_t;
421 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
423 #define _LATB0 0x01
424 #define _LATB1 0x02
425 #define _LATB2 0x04
426 #define _LATB3 0x08
427 #define _LATB4 0x10
428 #define _LATB5 0x20
429 #define _LATB6 0x40
430 #define _LATB7 0x80
432 //==============================================================================
435 //==============================================================================
436 // LATC Bits
438 extern __at(0x0F8B) __sfr LATC;
440 typedef struct
442 unsigned LATC0 : 1;
443 unsigned LATC1 : 1;
444 unsigned LATC2 : 1;
445 unsigned LATC3 : 1;
446 unsigned LATC4 : 1;
447 unsigned LATC5 : 1;
448 unsigned LATC6 : 1;
449 unsigned LATC7 : 1;
450 } __LATCbits_t;
452 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
454 #define _LATC0 0x01
455 #define _LATC1 0x02
456 #define _LATC2 0x04
457 #define _LATC3 0x08
458 #define _LATC4 0x10
459 #define _LATC5 0x20
460 #define _LATC6 0x40
461 #define _LATC7 0x80
463 //==============================================================================
466 //==============================================================================
467 // DDRA Bits
469 extern __at(0x0F92) __sfr DDRA;
471 typedef union
473 struct
475 unsigned TRISA0 : 1;
476 unsigned TRISA1 : 1;
477 unsigned TRISA2 : 1;
478 unsigned TRISA3 : 1;
479 unsigned TRISA4 : 1;
480 unsigned TRISA5 : 1;
481 unsigned TRISA6 : 1;
482 unsigned TRISA7 : 1;
485 struct
487 unsigned RA0 : 1;
488 unsigned RA1 : 1;
489 unsigned RA2 : 1;
490 unsigned RA3 : 1;
491 unsigned RA4 : 1;
492 unsigned RA5 : 1;
493 unsigned RA6 : 1;
494 unsigned RA7 : 1;
496 } __DDRAbits_t;
498 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
500 #define _TRISA0 0x01
501 #define _RA0 0x01
502 #define _TRISA1 0x02
503 #define _RA1 0x02
504 #define _TRISA2 0x04
505 #define _RA2 0x04
506 #define _TRISA3 0x08
507 #define _RA3 0x08
508 #define _TRISA4 0x10
509 #define _RA4 0x10
510 #define _TRISA5 0x20
511 #define _RA5 0x20
512 #define _TRISA6 0x40
513 #define _RA6 0x40
514 #define _TRISA7 0x80
515 #define _RA7 0x80
517 //==============================================================================
520 //==============================================================================
521 // TRISA Bits
523 extern __at(0x0F92) __sfr TRISA;
525 typedef union
527 struct
529 unsigned TRISA0 : 1;
530 unsigned TRISA1 : 1;
531 unsigned TRISA2 : 1;
532 unsigned TRISA3 : 1;
533 unsigned TRISA4 : 1;
534 unsigned TRISA5 : 1;
535 unsigned TRISA6 : 1;
536 unsigned TRISA7 : 1;
539 struct
541 unsigned RA0 : 1;
542 unsigned RA1 : 1;
543 unsigned RA2 : 1;
544 unsigned RA3 : 1;
545 unsigned RA4 : 1;
546 unsigned RA5 : 1;
547 unsigned RA6 : 1;
548 unsigned RA7 : 1;
550 } __TRISAbits_t;
552 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
554 #define _TRISA_TRISA0 0x01
555 #define _TRISA_RA0 0x01
556 #define _TRISA_TRISA1 0x02
557 #define _TRISA_RA1 0x02
558 #define _TRISA_TRISA2 0x04
559 #define _TRISA_RA2 0x04
560 #define _TRISA_TRISA3 0x08
561 #define _TRISA_RA3 0x08
562 #define _TRISA_TRISA4 0x10
563 #define _TRISA_RA4 0x10
564 #define _TRISA_TRISA5 0x20
565 #define _TRISA_RA5 0x20
566 #define _TRISA_TRISA6 0x40
567 #define _TRISA_RA6 0x40
568 #define _TRISA_TRISA7 0x80
569 #define _TRISA_RA7 0x80
571 //==============================================================================
574 //==============================================================================
575 // DDRB Bits
577 extern __at(0x0F93) __sfr DDRB;
579 typedef union
581 struct
583 unsigned TRISB0 : 1;
584 unsigned TRISB1 : 1;
585 unsigned TRISB2 : 1;
586 unsigned TRISB3 : 1;
587 unsigned TRISB4 : 1;
588 unsigned TRISB5 : 1;
589 unsigned TRISB6 : 1;
590 unsigned TRISB7 : 1;
593 struct
595 unsigned RB0 : 1;
596 unsigned RB1 : 1;
597 unsigned RB2 : 1;
598 unsigned RB3 : 1;
599 unsigned RB4 : 1;
600 unsigned RB5 : 1;
601 unsigned RB6 : 1;
602 unsigned RB7 : 1;
604 } __DDRBbits_t;
606 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
608 #define _TRISB0 0x01
609 #define _RB0 0x01
610 #define _TRISB1 0x02
611 #define _RB1 0x02
612 #define _TRISB2 0x04
613 #define _RB2 0x04
614 #define _TRISB3 0x08
615 #define _RB3 0x08
616 #define _TRISB4 0x10
617 #define _RB4 0x10
618 #define _TRISB5 0x20
619 #define _RB5 0x20
620 #define _TRISB6 0x40
621 #define _RB6 0x40
622 #define _TRISB7 0x80
623 #define _RB7 0x80
625 //==============================================================================
628 //==============================================================================
629 // TRISB Bits
631 extern __at(0x0F93) __sfr TRISB;
633 typedef union
635 struct
637 unsigned TRISB0 : 1;
638 unsigned TRISB1 : 1;
639 unsigned TRISB2 : 1;
640 unsigned TRISB3 : 1;
641 unsigned TRISB4 : 1;
642 unsigned TRISB5 : 1;
643 unsigned TRISB6 : 1;
644 unsigned TRISB7 : 1;
647 struct
649 unsigned RB0 : 1;
650 unsigned RB1 : 1;
651 unsigned RB2 : 1;
652 unsigned RB3 : 1;
653 unsigned RB4 : 1;
654 unsigned RB5 : 1;
655 unsigned RB6 : 1;
656 unsigned RB7 : 1;
658 } __TRISBbits_t;
660 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
662 #define _TRISB_TRISB0 0x01
663 #define _TRISB_RB0 0x01
664 #define _TRISB_TRISB1 0x02
665 #define _TRISB_RB1 0x02
666 #define _TRISB_TRISB2 0x04
667 #define _TRISB_RB2 0x04
668 #define _TRISB_TRISB3 0x08
669 #define _TRISB_RB3 0x08
670 #define _TRISB_TRISB4 0x10
671 #define _TRISB_RB4 0x10
672 #define _TRISB_TRISB5 0x20
673 #define _TRISB_RB5 0x20
674 #define _TRISB_TRISB6 0x40
675 #define _TRISB_RB6 0x40
676 #define _TRISB_TRISB7 0x80
677 #define _TRISB_RB7 0x80
679 //==============================================================================
682 //==============================================================================
683 // DDRC Bits
685 extern __at(0x0F94) __sfr DDRC;
687 typedef union
689 struct
691 unsigned TRISC0 : 1;
692 unsigned TRISC1 : 1;
693 unsigned TRISC2 : 1;
694 unsigned TRISC3 : 1;
695 unsigned TRISC4 : 1;
696 unsigned TRISC5 : 1;
697 unsigned TRISC6 : 1;
698 unsigned TRISC7 : 1;
701 struct
703 unsigned RC0 : 1;
704 unsigned RC1 : 1;
705 unsigned RC2 : 1;
706 unsigned RC3 : 1;
707 unsigned RC4 : 1;
708 unsigned RC5 : 1;
709 unsigned RC6 : 1;
710 unsigned RC7 : 1;
712 } __DDRCbits_t;
714 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
716 #define _TRISC0 0x01
717 #define _RC0 0x01
718 #define _TRISC1 0x02
719 #define _RC1 0x02
720 #define _TRISC2 0x04
721 #define _RC2 0x04
722 #define _TRISC3 0x08
723 #define _RC3 0x08
724 #define _TRISC4 0x10
725 #define _RC4 0x10
726 #define _TRISC5 0x20
727 #define _RC5 0x20
728 #define _TRISC6 0x40
729 #define _RC6 0x40
730 #define _TRISC7 0x80
731 #define _RC7 0x80
733 //==============================================================================
736 //==============================================================================
737 // TRISC Bits
739 extern __at(0x0F94) __sfr TRISC;
741 typedef union
743 struct
745 unsigned TRISC0 : 1;
746 unsigned TRISC1 : 1;
747 unsigned TRISC2 : 1;
748 unsigned TRISC3 : 1;
749 unsigned TRISC4 : 1;
750 unsigned TRISC5 : 1;
751 unsigned TRISC6 : 1;
752 unsigned TRISC7 : 1;
755 struct
757 unsigned RC0 : 1;
758 unsigned RC1 : 1;
759 unsigned RC2 : 1;
760 unsigned RC3 : 1;
761 unsigned RC4 : 1;
762 unsigned RC5 : 1;
763 unsigned RC6 : 1;
764 unsigned RC7 : 1;
766 } __TRISCbits_t;
768 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
770 #define _TRISC_TRISC0 0x01
771 #define _TRISC_RC0 0x01
772 #define _TRISC_TRISC1 0x02
773 #define _TRISC_RC1 0x02
774 #define _TRISC_TRISC2 0x04
775 #define _TRISC_RC2 0x04
776 #define _TRISC_TRISC3 0x08
777 #define _TRISC_RC3 0x08
778 #define _TRISC_TRISC4 0x10
779 #define _TRISC_RC4 0x10
780 #define _TRISC_TRISC5 0x20
781 #define _TRISC_RC5 0x20
782 #define _TRISC_TRISC6 0x40
783 #define _TRISC_RC6 0x40
784 #define _TRISC_TRISC7 0x80
785 #define _TRISC_RC7 0x80
787 //==============================================================================
790 //==============================================================================
791 // OSCTUNE Bits
793 extern __at(0x0F9B) __sfr OSCTUNE;
795 typedef union
797 struct
799 unsigned TUN0 : 1;
800 unsigned TUN1 : 1;
801 unsigned TUN2 : 1;
802 unsigned TUN3 : 1;
803 unsigned TUN4 : 1;
804 unsigned : 1;
805 unsigned PLLEN : 1;
806 unsigned INTSRC : 1;
809 struct
811 unsigned TUN : 5;
812 unsigned : 3;
814 } __OSCTUNEbits_t;
816 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
818 #define _TUN0 0x01
819 #define _TUN1 0x02
820 #define _TUN2 0x04
821 #define _TUN3 0x08
822 #define _TUN4 0x10
823 #define _PLLEN 0x40
824 #define _INTSRC 0x80
826 //==============================================================================
829 //==============================================================================
830 // PIE1 Bits
832 extern __at(0x0F9D) __sfr PIE1;
834 typedef struct
836 unsigned TMR1IE : 1;
837 unsigned TMR2IE : 1;
838 unsigned CCP1IE : 1;
839 unsigned SSPIE : 1;
840 unsigned TXIE : 1;
841 unsigned RCIE : 1;
842 unsigned ADIE : 1;
843 unsigned : 1;
844 } __PIE1bits_t;
846 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
848 #define _TMR1IE 0x01
849 #define _TMR2IE 0x02
850 #define _CCP1IE 0x04
851 #define _SSPIE 0x08
852 #define _TXIE 0x10
853 #define _RCIE 0x20
854 #define _ADIE 0x40
856 //==============================================================================
859 //==============================================================================
860 // PIR1 Bits
862 extern __at(0x0F9E) __sfr PIR1;
864 typedef struct
866 unsigned TMR1IF : 1;
867 unsigned TMR2IF : 1;
868 unsigned CCP1IF : 1;
869 unsigned SSPIF : 1;
870 unsigned TXIF : 1;
871 unsigned RCIF : 1;
872 unsigned ADIF : 1;
873 unsigned : 1;
874 } __PIR1bits_t;
876 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
878 #define _TMR1IF 0x01
879 #define _TMR2IF 0x02
880 #define _CCP1IF 0x04
881 #define _SSPIF 0x08
882 #define _TXIF 0x10
883 #define _RCIF 0x20
884 #define _ADIF 0x40
886 //==============================================================================
889 //==============================================================================
890 // IPR1 Bits
892 extern __at(0x0F9F) __sfr IPR1;
894 typedef struct
896 unsigned TMR1IP : 1;
897 unsigned TMR2IP : 1;
898 unsigned CCP1IP : 1;
899 unsigned SSPIP : 1;
900 unsigned TXIP : 1;
901 unsigned RCIP : 1;
902 unsigned ADIP : 1;
903 unsigned : 1;
904 } __IPR1bits_t;
906 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
908 #define _TMR1IP 0x01
909 #define _TMR2IP 0x02
910 #define _CCP1IP 0x04
911 #define _SSPIP 0x08
912 #define _TXIP 0x10
913 #define _RCIP 0x20
914 #define _ADIP 0x40
916 //==============================================================================
919 //==============================================================================
920 // PIE2 Bits
922 extern __at(0x0FA0) __sfr PIE2;
924 typedef union
926 struct
928 unsigned CCP2IE : 1;
929 unsigned TMR3IE : 1;
930 unsigned HLVDIE : 1;
931 unsigned BCLIE : 1;
932 unsigned EEIE : 1;
933 unsigned : 1;
934 unsigned CMIE : 1;
935 unsigned OSCFIE : 1;
938 struct
940 unsigned : 1;
941 unsigned : 1;
942 unsigned LVDIE : 1;
943 unsigned : 1;
944 unsigned : 1;
945 unsigned : 1;
946 unsigned : 1;
947 unsigned : 1;
949 } __PIE2bits_t;
951 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
953 #define _CCP2IE 0x01
954 #define _TMR3IE 0x02
955 #define _HLVDIE 0x04
956 #define _LVDIE 0x04
957 #define _BCLIE 0x08
958 #define _EEIE 0x10
959 #define _CMIE 0x40
960 #define _OSCFIE 0x80
962 //==============================================================================
965 //==============================================================================
966 // PIR2 Bits
968 extern __at(0x0FA1) __sfr PIR2;
970 typedef union
972 struct
974 unsigned CCP2IF : 1;
975 unsigned TMR3IF : 1;
976 unsigned HLVDIF : 1;
977 unsigned BCLIF : 1;
978 unsigned EEIF : 1;
979 unsigned : 1;
980 unsigned CMIF : 1;
981 unsigned OSCFIF : 1;
984 struct
986 unsigned : 1;
987 unsigned : 1;
988 unsigned LVDIF : 1;
989 unsigned : 1;
990 unsigned : 1;
991 unsigned : 1;
992 unsigned : 1;
993 unsigned : 1;
995 } __PIR2bits_t;
997 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
999 #define _CCP2IF 0x01
1000 #define _TMR3IF 0x02
1001 #define _HLVDIF 0x04
1002 #define _LVDIF 0x04
1003 #define _BCLIF 0x08
1004 #define _EEIF 0x10
1005 #define _CMIF 0x40
1006 #define _OSCFIF 0x80
1008 //==============================================================================
1011 //==============================================================================
1012 // IPR2 Bits
1014 extern __at(0x0FA2) __sfr IPR2;
1016 typedef union
1018 struct
1020 unsigned CCP2IP : 1;
1021 unsigned TMR3IP : 1;
1022 unsigned HLVDIP : 1;
1023 unsigned BCLIP : 1;
1024 unsigned EEIP : 1;
1025 unsigned : 1;
1026 unsigned CMIP : 1;
1027 unsigned OSCFIP : 1;
1030 struct
1032 unsigned : 1;
1033 unsigned : 1;
1034 unsigned LVDIP : 1;
1035 unsigned : 1;
1036 unsigned : 1;
1037 unsigned : 1;
1038 unsigned : 1;
1039 unsigned : 1;
1041 } __IPR2bits_t;
1043 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
1045 #define _CCP2IP 0x01
1046 #define _TMR3IP 0x02
1047 #define _HLVDIP 0x04
1048 #define _LVDIP 0x04
1049 #define _BCLIP 0x08
1050 #define _EEIP 0x10
1051 #define _CMIP 0x40
1052 #define _OSCFIP 0x80
1054 //==============================================================================
1057 //==============================================================================
1058 // EECON1 Bits
1060 extern __at(0x0FA6) __sfr EECON1;
1062 typedef struct
1064 unsigned RD : 1;
1065 unsigned WR : 1;
1066 unsigned WREN : 1;
1067 unsigned WRERR : 1;
1068 unsigned FREE : 1;
1069 unsigned : 1;
1070 unsigned CFGS : 1;
1071 unsigned EEPGD : 1;
1072 } __EECON1bits_t;
1074 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
1076 #define _RD 0x01
1077 #define _WR 0x02
1078 #define _WREN 0x04
1079 #define _WRERR 0x08
1080 #define _FREE 0x10
1081 #define _CFGS 0x40
1082 #define _EEPGD 0x80
1084 //==============================================================================
1086 extern __at(0x0FA7) __sfr EECON2;
1087 extern __at(0x0FA8) __sfr EEDATA;
1088 extern __at(0x0FA9) __sfr EEADR;
1089 extern __at(0x0FAA) __sfr EEADRH;
1091 //==============================================================================
1092 // RCSTA Bits
1094 extern __at(0x0FAB) __sfr RCSTA;
1096 typedef union
1098 struct
1100 unsigned RX9D : 1;
1101 unsigned OERR : 1;
1102 unsigned FERR : 1;
1103 unsigned ADDEN : 1;
1104 unsigned CREN : 1;
1105 unsigned SREN : 1;
1106 unsigned RX9 : 1;
1107 unsigned SPEN : 1;
1110 struct
1112 unsigned : 1;
1113 unsigned : 1;
1114 unsigned : 1;
1115 unsigned ADEN : 1;
1116 unsigned : 1;
1117 unsigned : 1;
1118 unsigned : 1;
1119 unsigned : 1;
1121 } __RCSTAbits_t;
1123 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
1125 #define _RX9D 0x01
1126 #define _OERR 0x02
1127 #define _FERR 0x04
1128 #define _ADDEN 0x08
1129 #define _ADEN 0x08
1130 #define _CREN 0x10
1131 #define _SREN 0x20
1132 #define _RX9 0x40
1133 #define _SPEN 0x80
1135 //==============================================================================
1138 //==============================================================================
1139 // TXSTA Bits
1141 extern __at(0x0FAC) __sfr TXSTA;
1143 typedef struct
1145 unsigned TX9D : 1;
1146 unsigned TRMT : 1;
1147 unsigned BRGH : 1;
1148 unsigned SENDB : 1;
1149 unsigned SYNC : 1;
1150 unsigned TXEN : 1;
1151 unsigned TX9 : 1;
1152 unsigned CSRC : 1;
1153 } __TXSTAbits_t;
1155 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
1157 #define _TX9D 0x01
1158 #define _TRMT 0x02
1159 #define _BRGH 0x04
1160 #define _SENDB 0x08
1161 #define _SYNC 0x10
1162 #define _TXEN 0x20
1163 #define _TX9 0x40
1164 #define _CSRC 0x80
1166 //==============================================================================
1168 extern __at(0x0FAD) __sfr TXREG;
1169 extern __at(0x0FAE) __sfr RCREG;
1170 extern __at(0x0FAF) __sfr SPBRG;
1171 extern __at(0x0FB0) __sfr SPBRGH;
1173 //==============================================================================
1174 // T3CON Bits
1176 extern __at(0x0FB1) __sfr T3CON;
1178 typedef union
1180 struct
1182 unsigned TMR3ON : 1;
1183 unsigned TMR3CS : 1;
1184 unsigned NOT_T3SYNC : 1;
1185 unsigned T3CCP1 : 1;
1186 unsigned T3CKPS0 : 1;
1187 unsigned T3CKPS1 : 1;
1188 unsigned T3CCP2 : 1;
1189 unsigned RD16 : 1;
1192 struct
1194 unsigned : 1;
1195 unsigned : 1;
1196 unsigned T3SYNC : 1;
1197 unsigned : 1;
1198 unsigned : 1;
1199 unsigned : 1;
1200 unsigned : 1;
1201 unsigned : 1;
1204 struct
1206 unsigned : 4;
1207 unsigned T3CKPS : 2;
1208 unsigned : 2;
1210 } __T3CONbits_t;
1212 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
1214 #define _T3CON_TMR3ON 0x01
1215 #define _T3CON_TMR3CS 0x02
1216 #define _T3CON_NOT_T3SYNC 0x04
1217 #define _T3CON_T3SYNC 0x04
1218 #define _T3CON_T3CCP1 0x08
1219 #define _T3CON_T3CKPS0 0x10
1220 #define _T3CON_T3CKPS1 0x20
1221 #define _T3CON_T3CCP2 0x40
1222 #define _T3CON_RD16 0x80
1224 //==============================================================================
1226 extern __at(0x0FB2) __sfr TMR3;
1227 extern __at(0x0FB2) __sfr TMR3L;
1228 extern __at(0x0FB3) __sfr TMR3H;
1230 //==============================================================================
1231 // CMCON Bits
1233 extern __at(0x0FB4) __sfr CMCON;
1235 typedef union
1237 struct
1239 unsigned CM0 : 1;
1240 unsigned CM1 : 1;
1241 unsigned CM2 : 1;
1242 unsigned CIS : 1;
1243 unsigned C1INV : 1;
1244 unsigned C2INV : 1;
1245 unsigned C1OUT : 1;
1246 unsigned C2OUT : 1;
1249 struct
1251 unsigned CM : 3;
1252 unsigned : 5;
1254 } __CMCONbits_t;
1256 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
1258 #define _CM0 0x01
1259 #define _CM1 0x02
1260 #define _CM2 0x04
1261 #define _CIS 0x08
1262 #define _C1INV 0x10
1263 #define _C2INV 0x20
1264 #define _C1OUT 0x40
1265 #define _C2OUT 0x80
1267 //==============================================================================
1270 //==============================================================================
1271 // CVRCON Bits
1273 extern __at(0x0FB5) __sfr CVRCON;
1275 typedef union
1277 struct
1279 unsigned CVR0 : 1;
1280 unsigned CVR1 : 1;
1281 unsigned CVR2 : 1;
1282 unsigned CVR3 : 1;
1283 unsigned CVRSS : 1;
1284 unsigned CVRR : 1;
1285 unsigned CVROE : 1;
1286 unsigned CVREN : 1;
1289 struct
1291 unsigned CVR : 4;
1292 unsigned : 4;
1294 } __CVRCONbits_t;
1296 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
1298 #define _CVR0 0x01
1299 #define _CVR1 0x02
1300 #define _CVR2 0x04
1301 #define _CVR3 0x08
1302 #define _CVRSS 0x10
1303 #define _CVRR 0x20
1304 #define _CVROE 0x40
1305 #define _CVREN 0x80
1307 //==============================================================================
1310 //==============================================================================
1311 // ECCP1AS Bits
1313 extern __at(0x0FB6) __sfr ECCP1AS;
1315 typedef union
1317 struct
1319 unsigned : 1;
1320 unsigned : 1;
1321 unsigned PSSAC0 : 1;
1322 unsigned PSSAC1 : 1;
1323 unsigned ECCPAS0 : 1;
1324 unsigned ECCPAS1 : 1;
1325 unsigned ECCPAS2 : 1;
1326 unsigned ECCPASE : 1;
1329 struct
1331 unsigned : 2;
1332 unsigned PSSAC : 2;
1333 unsigned : 4;
1336 struct
1338 unsigned : 4;
1339 unsigned ECCPAS : 3;
1340 unsigned : 1;
1342 } __ECCP1ASbits_t;
1344 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
1346 #define _PSSAC0 0x04
1347 #define _PSSAC1 0x08
1348 #define _ECCPAS0 0x10
1349 #define _ECCPAS1 0x20
1350 #define _ECCPAS2 0x40
1351 #define _ECCPASE 0x80
1353 //==============================================================================
1356 //==============================================================================
1357 // ECCPAS Bits
1359 extern __at(0x0FB6) __sfr ECCPAS;
1361 typedef union
1363 struct
1365 unsigned : 1;
1366 unsigned : 1;
1367 unsigned PSSAC0 : 1;
1368 unsigned PSSAC1 : 1;
1369 unsigned ECCPAS0 : 1;
1370 unsigned ECCPAS1 : 1;
1371 unsigned ECCPAS2 : 1;
1372 unsigned ECCPASE : 1;
1375 struct
1377 unsigned : 2;
1378 unsigned PSSAC : 2;
1379 unsigned : 4;
1382 struct
1384 unsigned : 4;
1385 unsigned ECCPAS : 3;
1386 unsigned : 1;
1388 } __ECCPASbits_t;
1390 extern __at(0x0FB6) volatile __ECCPASbits_t ECCPASbits;
1392 #define _ECCPAS_PSSAC0 0x04
1393 #define _ECCPAS_PSSAC1 0x08
1394 #define _ECCPAS_ECCPAS0 0x10
1395 #define _ECCPAS_ECCPAS1 0x20
1396 #define _ECCPAS_ECCPAS2 0x40
1397 #define _ECCPAS_ECCPASE 0x80
1399 //==============================================================================
1402 //==============================================================================
1403 // ECCP1DEL Bits
1405 extern __at(0x0FB7) __sfr ECCP1DEL;
1407 typedef struct
1409 unsigned : 1;
1410 unsigned : 1;
1411 unsigned : 1;
1412 unsigned : 1;
1413 unsigned : 1;
1414 unsigned : 1;
1415 unsigned : 1;
1416 unsigned PRSEN : 1;
1417 } __ECCP1DELbits_t;
1419 extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits;
1421 #define _PRSEN 0x80
1423 //==============================================================================
1426 //==============================================================================
1427 // PWM1CON Bits
1429 extern __at(0x0FB7) __sfr PWM1CON;
1431 typedef struct
1433 unsigned : 1;
1434 unsigned : 1;
1435 unsigned : 1;
1436 unsigned : 1;
1437 unsigned : 1;
1438 unsigned : 1;
1439 unsigned : 1;
1440 unsigned PRSEN : 1;
1441 } __PWM1CONbits_t;
1443 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
1445 #define _PWM1CON_PRSEN 0x80
1447 //==============================================================================
1450 //==============================================================================
1451 // BAUDCON Bits
1453 extern __at(0x0FB8) __sfr BAUDCON;
1455 typedef union
1457 struct
1459 unsigned ABDEN : 1;
1460 unsigned WUE : 1;
1461 unsigned : 1;
1462 unsigned BRG16 : 1;
1463 unsigned TXCKP : 1;
1464 unsigned RXDTP : 1;
1465 unsigned RCIDL : 1;
1466 unsigned ABDOVF : 1;
1469 struct
1471 unsigned : 1;
1472 unsigned : 1;
1473 unsigned : 1;
1474 unsigned : 1;
1475 unsigned SCKP : 1;
1476 unsigned RXCKP : 1;
1477 unsigned RCMT : 1;
1478 unsigned : 1;
1480 } __BAUDCONbits_t;
1482 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
1484 #define _ABDEN 0x01
1485 #define _WUE 0x02
1486 #define _BRG16 0x08
1487 #define _TXCKP 0x10
1488 #define _SCKP 0x10
1489 #define _RXDTP 0x20
1490 #define _RXCKP 0x20
1491 #define _RCIDL 0x40
1492 #define _RCMT 0x40
1493 #define _ABDOVF 0x80
1495 //==============================================================================
1498 //==============================================================================
1499 // BAUDCTL Bits
1501 extern __at(0x0FB8) __sfr BAUDCTL;
1503 typedef union
1505 struct
1507 unsigned ABDEN : 1;
1508 unsigned WUE : 1;
1509 unsigned : 1;
1510 unsigned BRG16 : 1;
1511 unsigned TXCKP : 1;
1512 unsigned RXDTP : 1;
1513 unsigned RCIDL : 1;
1514 unsigned ABDOVF : 1;
1517 struct
1519 unsigned : 1;
1520 unsigned : 1;
1521 unsigned : 1;
1522 unsigned : 1;
1523 unsigned SCKP : 1;
1524 unsigned RXCKP : 1;
1525 unsigned RCMT : 1;
1526 unsigned : 1;
1528 } __BAUDCTLbits_t;
1530 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
1532 #define _BAUDCTL_ABDEN 0x01
1533 #define _BAUDCTL_WUE 0x02
1534 #define _BAUDCTL_BRG16 0x08
1535 #define _BAUDCTL_TXCKP 0x10
1536 #define _BAUDCTL_SCKP 0x10
1537 #define _BAUDCTL_RXDTP 0x20
1538 #define _BAUDCTL_RXCKP 0x20
1539 #define _BAUDCTL_RCIDL 0x40
1540 #define _BAUDCTL_RCMT 0x40
1541 #define _BAUDCTL_ABDOVF 0x80
1543 //==============================================================================
1546 //==============================================================================
1547 // CCP2CON Bits
1549 extern __at(0x0FBA) __sfr CCP2CON;
1551 typedef union
1553 struct
1555 unsigned CCP2M0 : 1;
1556 unsigned CCP2M1 : 1;
1557 unsigned CCP2M2 : 1;
1558 unsigned CCP2M3 : 1;
1559 unsigned CCP2Y : 1;
1560 unsigned CCP2X : 1;
1561 unsigned : 1;
1562 unsigned : 1;
1565 struct
1567 unsigned : 1;
1568 unsigned : 1;
1569 unsigned : 1;
1570 unsigned : 1;
1571 unsigned DC2B0 : 1;
1572 unsigned DC2B1 : 1;
1573 unsigned : 1;
1574 unsigned : 1;
1577 struct
1579 unsigned CCP2M : 4;
1580 unsigned : 4;
1583 struct
1585 unsigned : 4;
1586 unsigned DC2B : 2;
1587 unsigned : 2;
1589 } __CCP2CONbits_t;
1591 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
1593 #define _CCP2M0 0x01
1594 #define _CCP2M1 0x02
1595 #define _CCP2M2 0x04
1596 #define _CCP2M3 0x08
1597 #define _CCP2Y 0x10
1598 #define _DC2B0 0x10
1599 #define _CCP2X 0x20
1600 #define _DC2B1 0x20
1602 //==============================================================================
1604 extern __at(0x0FBB) __sfr CCPR2;
1605 extern __at(0x0FBB) __sfr CCPR2L;
1606 extern __at(0x0FBC) __sfr CCPR2H;
1608 //==============================================================================
1609 // CCP1CON Bits
1611 extern __at(0x0FBD) __sfr CCP1CON;
1613 typedef union
1615 struct
1617 unsigned CCP1M0 : 1;
1618 unsigned CCP1M1 : 1;
1619 unsigned CCP1M2 : 1;
1620 unsigned CCP1M3 : 1;
1621 unsigned CCP1Y : 1;
1622 unsigned CCP1X : 1;
1623 unsigned : 1;
1624 unsigned : 1;
1627 struct
1629 unsigned : 1;
1630 unsigned : 1;
1631 unsigned : 1;
1632 unsigned : 1;
1633 unsigned DC1B0 : 1;
1634 unsigned DC1B1 : 1;
1635 unsigned : 1;
1636 unsigned : 1;
1639 struct
1641 unsigned CCP1M : 4;
1642 unsigned : 4;
1645 struct
1647 unsigned : 4;
1648 unsigned DC1B : 2;
1649 unsigned : 2;
1651 } __CCP1CONbits_t;
1653 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
1655 #define _CCP1M0 0x01
1656 #define _CCP1M1 0x02
1657 #define _CCP1M2 0x04
1658 #define _CCP1M3 0x08
1659 #define _CCP1Y 0x10
1660 #define _DC1B0 0x10
1661 #define _CCP1X 0x20
1662 #define _DC1B1 0x20
1664 //==============================================================================
1666 extern __at(0x0FBE) __sfr CCPR1;
1667 extern __at(0x0FBE) __sfr CCPR1L;
1668 extern __at(0x0FBF) __sfr CCPR1H;
1670 //==============================================================================
1671 // ADCON2 Bits
1673 extern __at(0x0FC0) __sfr ADCON2;
1675 typedef union
1677 struct
1679 unsigned ADCS0 : 1;
1680 unsigned ADCS1 : 1;
1681 unsigned ADCS2 : 1;
1682 unsigned ACQT0 : 1;
1683 unsigned ACQT1 : 1;
1684 unsigned ACQT2 : 1;
1685 unsigned : 1;
1686 unsigned ADFM : 1;
1689 struct
1691 unsigned ADCS : 3;
1692 unsigned : 5;
1695 struct
1697 unsigned : 3;
1698 unsigned ACQT : 3;
1699 unsigned : 2;
1701 } __ADCON2bits_t;
1703 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
1705 #define _ADCS0 0x01
1706 #define _ADCS1 0x02
1707 #define _ADCS2 0x04
1708 #define _ACQT0 0x08
1709 #define _ACQT1 0x10
1710 #define _ACQT2 0x20
1711 #define _ADFM 0x80
1713 //==============================================================================
1716 //==============================================================================
1717 // ADCON1 Bits
1719 extern __at(0x0FC1) __sfr ADCON1;
1721 typedef union
1723 struct
1725 unsigned PCFG0 : 1;
1726 unsigned PCFG1 : 1;
1727 unsigned PCFG2 : 1;
1728 unsigned PCFG3 : 1;
1729 unsigned VCFG0 : 1;
1730 unsigned VCFG1 : 1;
1731 unsigned : 1;
1732 unsigned : 1;
1735 struct
1737 unsigned PCFG : 4;
1738 unsigned : 4;
1741 struct
1743 unsigned : 4;
1744 unsigned VCFG : 2;
1745 unsigned : 2;
1747 } __ADCON1bits_t;
1749 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
1751 #define _PCFG0 0x01
1752 #define _PCFG1 0x02
1753 #define _PCFG2 0x04
1754 #define _PCFG3 0x08
1755 #define _VCFG0 0x10
1756 #define _VCFG1 0x20
1758 //==============================================================================
1761 //==============================================================================
1762 // ADCON0 Bits
1764 extern __at(0x0FC2) __sfr ADCON0;
1766 typedef union
1768 struct
1770 unsigned ADON : 1;
1771 unsigned GO_NOT_DONE : 1;
1772 unsigned CHS0 : 1;
1773 unsigned CHS1 : 1;
1774 unsigned CHS2 : 1;
1775 unsigned CHS3 : 1;
1776 unsigned : 1;
1777 unsigned : 1;
1780 struct
1782 unsigned : 1;
1783 unsigned GO : 1;
1784 unsigned : 1;
1785 unsigned : 1;
1786 unsigned : 1;
1787 unsigned : 1;
1788 unsigned : 1;
1789 unsigned : 1;
1792 struct
1794 unsigned : 1;
1795 unsigned DONE : 1;
1796 unsigned : 1;
1797 unsigned : 1;
1798 unsigned : 1;
1799 unsigned : 1;
1800 unsigned : 1;
1801 unsigned : 1;
1804 struct
1806 unsigned : 1;
1807 unsigned NOT_DONE : 1;
1808 unsigned : 1;
1809 unsigned : 1;
1810 unsigned : 1;
1811 unsigned : 1;
1812 unsigned : 1;
1813 unsigned : 1;
1816 struct
1818 unsigned : 1;
1819 unsigned GO_DONE : 1;
1820 unsigned : 1;
1821 unsigned : 1;
1822 unsigned : 1;
1823 unsigned : 1;
1824 unsigned : 1;
1825 unsigned : 1;
1828 struct
1830 unsigned : 2;
1831 unsigned CHS : 4;
1832 unsigned : 2;
1834 } __ADCON0bits_t;
1836 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
1838 #define _ADON 0x01
1839 #define _GO_NOT_DONE 0x02
1840 #define _GO 0x02
1841 #define _DONE 0x02
1842 #define _NOT_DONE 0x02
1843 #define _GO_DONE 0x02
1844 #define _CHS0 0x04
1845 #define _CHS1 0x08
1846 #define _CHS2 0x10
1847 #define _CHS3 0x20
1849 //==============================================================================
1851 extern __at(0x0FC3) __sfr ADRES;
1852 extern __at(0x0FC3) __sfr ADRESL;
1853 extern __at(0x0FC4) __sfr ADRESH;
1855 //==============================================================================
1856 // SSPCON2 Bits
1858 extern __at(0x0FC5) __sfr SSPCON2;
1860 typedef struct
1862 unsigned SEN : 1;
1863 unsigned RSEN : 1;
1864 unsigned PEN : 1;
1865 unsigned RCEN : 1;
1866 unsigned ACKEN : 1;
1867 unsigned ACKDT : 1;
1868 unsigned ACKSTAT : 1;
1869 unsigned GCEN : 1;
1870 } __SSPCON2bits_t;
1872 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
1874 #define _SEN 0x01
1875 #define _RSEN 0x02
1876 #define _PEN 0x04
1877 #define _RCEN 0x08
1878 #define _ACKEN 0x10
1879 #define _ACKDT 0x20
1880 #define _ACKSTAT 0x40
1881 #define _GCEN 0x80
1883 //==============================================================================
1886 //==============================================================================
1887 // SSPCON1 Bits
1889 extern __at(0x0FC6) __sfr SSPCON1;
1891 typedef union
1893 struct
1895 unsigned SSPM0 : 1;
1896 unsigned SSPM1 : 1;
1897 unsigned SSPM2 : 1;
1898 unsigned SSPM3 : 1;
1899 unsigned CKP : 1;
1900 unsigned SSPEN : 1;
1901 unsigned SSPOV : 1;
1902 unsigned WCOL : 1;
1905 struct
1907 unsigned SSPM : 4;
1908 unsigned : 4;
1910 } __SSPCON1bits_t;
1912 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
1914 #define _SSPM0 0x01
1915 #define _SSPM1 0x02
1916 #define _SSPM2 0x04
1917 #define _SSPM3 0x08
1918 #define _CKP 0x10
1919 #define _SSPEN 0x20
1920 #define _SSPOV 0x40
1921 #define _WCOL 0x80
1923 //==============================================================================
1926 //==============================================================================
1927 // SSPSTAT Bits
1929 extern __at(0x0FC7) __sfr SSPSTAT;
1931 typedef union
1933 struct
1935 unsigned BF : 1;
1936 unsigned UA : 1;
1937 unsigned R_NOT_W : 1;
1938 unsigned S : 1;
1939 unsigned P : 1;
1940 unsigned D_NOT_A : 1;
1941 unsigned CKE : 1;
1942 unsigned SMP : 1;
1945 struct
1947 unsigned : 1;
1948 unsigned : 1;
1949 unsigned R : 1;
1950 unsigned : 1;
1951 unsigned : 1;
1952 unsigned D : 1;
1953 unsigned : 1;
1954 unsigned : 1;
1957 struct
1959 unsigned : 1;
1960 unsigned : 1;
1961 unsigned NOT_W : 1;
1962 unsigned : 1;
1963 unsigned : 1;
1964 unsigned NOT_A : 1;
1965 unsigned : 1;
1966 unsigned : 1;
1969 struct
1971 unsigned : 1;
1972 unsigned : 1;
1973 unsigned R_W : 1;
1974 unsigned : 1;
1975 unsigned : 1;
1976 unsigned D_A : 1;
1977 unsigned : 1;
1978 unsigned : 1;
1981 struct
1983 unsigned : 1;
1984 unsigned : 1;
1985 unsigned NOT_WRITE : 1;
1986 unsigned : 1;
1987 unsigned : 1;
1988 unsigned NOT_ADDRESS : 1;
1989 unsigned : 1;
1990 unsigned : 1;
1992 } __SSPSTATbits_t;
1994 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
1996 #define _BF 0x01
1997 #define _UA 0x02
1998 #define _R_NOT_W 0x04
1999 #define _R 0x04
2000 #define _NOT_W 0x04
2001 #define _R_W 0x04
2002 #define _NOT_WRITE 0x04
2003 #define _S 0x08
2004 #define _P 0x10
2005 #define _D_NOT_A 0x20
2006 #define _D 0x20
2007 #define _NOT_A 0x20
2008 #define _D_A 0x20
2009 #define _NOT_ADDRESS 0x20
2010 #define _CKE 0x40
2011 #define _SMP 0x80
2013 //==============================================================================
2015 extern __at(0x0FC8) __sfr SSPADD;
2016 extern __at(0x0FC9) __sfr SSPBUF;
2018 //==============================================================================
2019 // T2CON Bits
2021 extern __at(0x0FCA) __sfr T2CON;
2023 typedef union
2025 struct
2027 unsigned T2CKPS0 : 1;
2028 unsigned T2CKPS1 : 1;
2029 unsigned TMR2ON : 1;
2030 unsigned T2OUTPS0 : 1;
2031 unsigned T2OUTPS1 : 1;
2032 unsigned T2OUTPS2 : 1;
2033 unsigned T2OUTPS3 : 1;
2034 unsigned : 1;
2037 struct
2039 unsigned : 1;
2040 unsigned : 1;
2041 unsigned : 1;
2042 unsigned TOUTPS0 : 1;
2043 unsigned TOUTPS1 : 1;
2044 unsigned TOUTPS2 : 1;
2045 unsigned TOUTPS3 : 1;
2046 unsigned : 1;
2049 struct
2051 unsigned T2CKPS : 2;
2052 unsigned : 6;
2055 struct
2057 unsigned : 3;
2058 unsigned T2OUTPS : 4;
2059 unsigned : 1;
2062 struct
2064 unsigned : 3;
2065 unsigned TOUTPS : 4;
2066 unsigned : 1;
2068 } __T2CONbits_t;
2070 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
2072 #define _T2CKPS0 0x01
2073 #define _T2CKPS1 0x02
2074 #define _TMR2ON 0x04
2075 #define _T2OUTPS0 0x08
2076 #define _TOUTPS0 0x08
2077 #define _T2OUTPS1 0x10
2078 #define _TOUTPS1 0x10
2079 #define _T2OUTPS2 0x20
2080 #define _TOUTPS2 0x20
2081 #define _T2OUTPS3 0x40
2082 #define _TOUTPS3 0x40
2084 //==============================================================================
2086 extern __at(0x0FCB) __sfr PR2;
2087 extern __at(0x0FCC) __sfr TMR2;
2089 //==============================================================================
2090 // T1CON Bits
2092 extern __at(0x0FCD) __sfr T1CON;
2094 typedef union
2096 struct
2098 unsigned TMR1ON : 1;
2099 unsigned TMR1CS : 1;
2100 unsigned NOT_T1SYNC : 1;
2101 unsigned T1OSCEN : 1;
2102 unsigned T1CKPS0 : 1;
2103 unsigned T1CKPS1 : 1;
2104 unsigned T1RUN : 1;
2105 unsigned RD16 : 1;
2108 struct
2110 unsigned : 1;
2111 unsigned : 1;
2112 unsigned T1SYNC : 1;
2113 unsigned : 1;
2114 unsigned : 1;
2115 unsigned : 1;
2116 unsigned : 1;
2117 unsigned : 1;
2120 struct
2122 unsigned : 4;
2123 unsigned T1CKPS : 2;
2124 unsigned : 2;
2126 } __T1CONbits_t;
2128 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
2130 #define _TMR1ON 0x01
2131 #define _TMR1CS 0x02
2132 #define _NOT_T1SYNC 0x04
2133 #define _T1SYNC 0x04
2134 #define _T1OSCEN 0x08
2135 #define _T1CKPS0 0x10
2136 #define _T1CKPS1 0x20
2137 #define _T1RUN 0x40
2138 #define _RD16 0x80
2140 //==============================================================================
2142 extern __at(0x0FCE) __sfr TMR1;
2143 extern __at(0x0FCE) __sfr TMR1L;
2144 extern __at(0x0FCF) __sfr TMR1H;
2146 //==============================================================================
2147 // RCON Bits
2149 extern __at(0x0FD0) __sfr RCON;
2151 typedef union
2153 struct
2155 unsigned NOT_BOR : 1;
2156 unsigned NOT_POR : 1;
2157 unsigned NOT_PD : 1;
2158 unsigned NOT_TO : 1;
2159 unsigned NOT_RI : 1;
2160 unsigned : 1;
2161 unsigned SBOREN : 1;
2162 unsigned IPEN : 1;
2165 struct
2167 unsigned BOR : 1;
2168 unsigned POR : 1;
2169 unsigned PD : 1;
2170 unsigned TO : 1;
2171 unsigned RI : 1;
2172 unsigned : 1;
2173 unsigned : 1;
2174 unsigned : 1;
2176 } __RCONbits_t;
2178 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
2180 #define _NOT_BOR 0x01
2181 #define _BOR 0x01
2182 #define _NOT_POR 0x02
2183 #define _POR 0x02
2184 #define _NOT_PD 0x04
2185 #define _PD 0x04
2186 #define _NOT_TO 0x08
2187 #define _TO 0x08
2188 #define _NOT_RI 0x10
2189 #define _RI 0x10
2190 #define _SBOREN 0x40
2191 #define _IPEN 0x80
2193 //==============================================================================
2196 //==============================================================================
2197 // WDTCON Bits
2199 extern __at(0x0FD1) __sfr WDTCON;
2201 typedef union
2203 struct
2205 unsigned SWDTEN : 1;
2206 unsigned : 1;
2207 unsigned : 1;
2208 unsigned : 1;
2209 unsigned : 1;
2210 unsigned : 1;
2211 unsigned : 1;
2212 unsigned : 1;
2215 struct
2217 unsigned SWDTE : 1;
2218 unsigned : 1;
2219 unsigned : 1;
2220 unsigned : 1;
2221 unsigned : 1;
2222 unsigned : 1;
2223 unsigned : 1;
2224 unsigned : 1;
2226 } __WDTCONbits_t;
2228 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
2230 #define _SWDTEN 0x01
2231 #define _SWDTE 0x01
2233 //==============================================================================
2236 //==============================================================================
2237 // HLVDCON Bits
2239 extern __at(0x0FD2) __sfr HLVDCON;
2241 typedef union
2243 struct
2245 unsigned HLVDL0 : 1;
2246 unsigned HLVDL1 : 1;
2247 unsigned HLVDL2 : 1;
2248 unsigned HLVDL3 : 1;
2249 unsigned HLVDEN : 1;
2250 unsigned IVRST : 1;
2251 unsigned : 1;
2252 unsigned VDIRMAG : 1;
2255 struct
2257 unsigned LVDL0 : 1;
2258 unsigned LVDL1 : 1;
2259 unsigned LVDL2 : 1;
2260 unsigned LVDL3 : 1;
2261 unsigned LVDEN : 1;
2262 unsigned IRVST : 1;
2263 unsigned : 1;
2264 unsigned : 1;
2267 struct
2269 unsigned LVV0 : 1;
2270 unsigned LVV1 : 1;
2271 unsigned LVV2 : 1;
2272 unsigned LVV3 : 1;
2273 unsigned : 1;
2274 unsigned BGST : 1;
2275 unsigned : 1;
2276 unsigned : 1;
2279 struct
2281 unsigned HLVDL : 4;
2282 unsigned : 4;
2285 struct
2287 unsigned LVV : 4;
2288 unsigned : 4;
2291 struct
2293 unsigned LVDL : 4;
2294 unsigned : 4;
2296 } __HLVDCONbits_t;
2298 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
2300 #define _HLVDL0 0x01
2301 #define _LVDL0 0x01
2302 #define _LVV0 0x01
2303 #define _HLVDL1 0x02
2304 #define _LVDL1 0x02
2305 #define _LVV1 0x02
2306 #define _HLVDL2 0x04
2307 #define _LVDL2 0x04
2308 #define _LVV2 0x04
2309 #define _HLVDL3 0x08
2310 #define _LVDL3 0x08
2311 #define _LVV3 0x08
2312 #define _HLVDEN 0x10
2313 #define _LVDEN 0x10
2314 #define _IVRST 0x20
2315 #define _IRVST 0x20
2316 #define _BGST 0x20
2317 #define _VDIRMAG 0x80
2319 //==============================================================================
2322 //==============================================================================
2323 // LVDCON Bits
2325 extern __at(0x0FD2) __sfr LVDCON;
2327 typedef union
2329 struct
2331 unsigned HLVDL0 : 1;
2332 unsigned HLVDL1 : 1;
2333 unsigned HLVDL2 : 1;
2334 unsigned HLVDL3 : 1;
2335 unsigned HLVDEN : 1;
2336 unsigned IVRST : 1;
2337 unsigned : 1;
2338 unsigned VDIRMAG : 1;
2341 struct
2343 unsigned LVDL0 : 1;
2344 unsigned LVDL1 : 1;
2345 unsigned LVDL2 : 1;
2346 unsigned LVDL3 : 1;
2347 unsigned LVDEN : 1;
2348 unsigned IRVST : 1;
2349 unsigned : 1;
2350 unsigned : 1;
2353 struct
2355 unsigned LVV0 : 1;
2356 unsigned LVV1 : 1;
2357 unsigned LVV2 : 1;
2358 unsigned LVV3 : 1;
2359 unsigned : 1;
2360 unsigned BGST : 1;
2361 unsigned : 1;
2362 unsigned : 1;
2365 struct
2367 unsigned LVV : 4;
2368 unsigned : 4;
2371 struct
2373 unsigned HLVDL : 4;
2374 unsigned : 4;
2377 struct
2379 unsigned LVDL : 4;
2380 unsigned : 4;
2382 } __LVDCONbits_t;
2384 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
2386 #define _LVDCON_HLVDL0 0x01
2387 #define _LVDCON_LVDL0 0x01
2388 #define _LVDCON_LVV0 0x01
2389 #define _LVDCON_HLVDL1 0x02
2390 #define _LVDCON_LVDL1 0x02
2391 #define _LVDCON_LVV1 0x02
2392 #define _LVDCON_HLVDL2 0x04
2393 #define _LVDCON_LVDL2 0x04
2394 #define _LVDCON_LVV2 0x04
2395 #define _LVDCON_HLVDL3 0x08
2396 #define _LVDCON_LVDL3 0x08
2397 #define _LVDCON_LVV3 0x08
2398 #define _LVDCON_HLVDEN 0x10
2399 #define _LVDCON_LVDEN 0x10
2400 #define _LVDCON_IVRST 0x20
2401 #define _LVDCON_IRVST 0x20
2402 #define _LVDCON_BGST 0x20
2403 #define _LVDCON_VDIRMAG 0x80
2405 //==============================================================================
2408 //==============================================================================
2409 // OSCCON Bits
2411 extern __at(0x0FD3) __sfr OSCCON;
2413 typedef union
2415 struct
2417 unsigned SCS0 : 1;
2418 unsigned SCS1 : 1;
2419 unsigned IOFS : 1;
2420 unsigned OSTS : 1;
2421 unsigned IRCF0 : 1;
2422 unsigned IRCF1 : 1;
2423 unsigned IRCF2 : 1;
2424 unsigned IDLEN : 1;
2427 struct
2429 unsigned : 1;
2430 unsigned : 1;
2431 unsigned FLTS : 1;
2432 unsigned : 1;
2433 unsigned : 1;
2434 unsigned : 1;
2435 unsigned : 1;
2436 unsigned : 1;
2439 struct
2441 unsigned SCS : 2;
2442 unsigned : 6;
2445 struct
2447 unsigned : 4;
2448 unsigned IRCF : 3;
2449 unsigned : 1;
2451 } __OSCCONbits_t;
2453 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
2455 #define _SCS0 0x01
2456 #define _SCS1 0x02
2457 #define _IOFS 0x04
2458 #define _FLTS 0x04
2459 #define _OSTS 0x08
2460 #define _IRCF0 0x10
2461 #define _IRCF1 0x20
2462 #define _IRCF2 0x40
2463 #define _IDLEN 0x80
2465 //==============================================================================
2468 //==============================================================================
2469 // T0CON Bits
2471 extern __at(0x0FD5) __sfr T0CON;
2473 typedef union
2475 struct
2477 unsigned T0PS0 : 1;
2478 unsigned T0PS1 : 1;
2479 unsigned T0PS2 : 1;
2480 unsigned PSA : 1;
2481 unsigned T0SE : 1;
2482 unsigned T0CS : 1;
2483 unsigned T08BIT : 1;
2484 unsigned TMR0ON : 1;
2487 struct
2489 unsigned : 1;
2490 unsigned : 1;
2491 unsigned : 1;
2492 unsigned : 1;
2493 unsigned : 1;
2494 unsigned : 1;
2495 unsigned T016BIT : 1;
2496 unsigned : 1;
2499 struct
2501 unsigned T0PS : 3;
2502 unsigned : 5;
2504 } __T0CONbits_t;
2506 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
2508 #define _T0PS0 0x01
2509 #define _T0PS1 0x02
2510 #define _T0PS2 0x04
2511 #define _PSA 0x08
2512 #define _T0SE 0x10
2513 #define _T0CS 0x20
2514 #define _T08BIT 0x40
2515 #define _T016BIT 0x40
2516 #define _TMR0ON 0x80
2518 //==============================================================================
2520 extern __at(0x0FD6) __sfr TMR0;
2521 extern __at(0x0FD6) __sfr TMR0L;
2522 extern __at(0x0FD7) __sfr TMR0H;
2524 //==============================================================================
2525 // STATUS Bits
2527 extern __at(0x0FD8) __sfr STATUS;
2529 typedef struct
2531 unsigned C : 1;
2532 unsigned DC : 1;
2533 unsigned Z : 1;
2534 unsigned OV : 1;
2535 unsigned N : 1;
2536 unsigned : 1;
2537 unsigned : 1;
2538 unsigned : 1;
2539 } __STATUSbits_t;
2541 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
2543 #define _C 0x01
2544 #define _DC 0x02
2545 #define _Z 0x04
2546 #define _OV 0x08
2547 #define _N 0x10
2549 //==============================================================================
2551 extern __at(0x0FD9) __sfr FSR2L;
2552 extern __at(0x0FDA) __sfr FSR2H;
2553 extern __at(0x0FDB) __sfr PLUSW2;
2554 extern __at(0x0FDC) __sfr PREINC2;
2555 extern __at(0x0FDD) __sfr POSTDEC2;
2556 extern __at(0x0FDE) __sfr POSTINC2;
2557 extern __at(0x0FDF) __sfr INDF2;
2558 extern __at(0x0FE0) __sfr BSR;
2559 extern __at(0x0FE1) __sfr FSR1L;
2560 extern __at(0x0FE2) __sfr FSR1H;
2561 extern __at(0x0FE3) __sfr PLUSW1;
2562 extern __at(0x0FE4) __sfr PREINC1;
2563 extern __at(0x0FE5) __sfr POSTDEC1;
2564 extern __at(0x0FE6) __sfr POSTINC1;
2565 extern __at(0x0FE7) __sfr INDF1;
2566 extern __at(0x0FE8) __sfr WREG;
2567 extern __at(0x0FE9) __sfr FSR0L;
2568 extern __at(0x0FEA) __sfr FSR0H;
2569 extern __at(0x0FEB) __sfr PLUSW0;
2570 extern __at(0x0FEC) __sfr PREINC0;
2571 extern __at(0x0FED) __sfr POSTDEC0;
2572 extern __at(0x0FEE) __sfr POSTINC0;
2573 extern __at(0x0FEF) __sfr INDF0;
2575 //==============================================================================
2576 // INTCON3 Bits
2578 extern __at(0x0FF0) __sfr INTCON3;
2580 typedef union
2582 struct
2584 unsigned INT1IF : 1;
2585 unsigned INT2IF : 1;
2586 unsigned : 1;
2587 unsigned INT1IE : 1;
2588 unsigned INT2IE : 1;
2589 unsigned : 1;
2590 unsigned INT1IP : 1;
2591 unsigned INT2IP : 1;
2594 struct
2596 unsigned INT1F : 1;
2597 unsigned INT2F : 1;
2598 unsigned : 1;
2599 unsigned INT1E : 1;
2600 unsigned INT2E : 1;
2601 unsigned : 1;
2602 unsigned INT1P : 1;
2603 unsigned INT2P : 1;
2605 } __INTCON3bits_t;
2607 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
2609 #define _INT1IF 0x01
2610 #define _INT1F 0x01
2611 #define _INT2IF 0x02
2612 #define _INT2F 0x02
2613 #define _INT1IE 0x08
2614 #define _INT1E 0x08
2615 #define _INT2IE 0x10
2616 #define _INT2E 0x10
2617 #define _INT1IP 0x40
2618 #define _INT1P 0x40
2619 #define _INT2IP 0x80
2620 #define _INT2P 0x80
2622 //==============================================================================
2625 //==============================================================================
2626 // INTCON2 Bits
2628 extern __at(0x0FF1) __sfr INTCON2;
2630 typedef union
2632 struct
2634 unsigned RBIP : 1;
2635 unsigned : 1;
2636 unsigned TMR0IP : 1;
2637 unsigned : 1;
2638 unsigned INTEDG2 : 1;
2639 unsigned INTEDG1 : 1;
2640 unsigned INTEDG0 : 1;
2641 unsigned NOT_RBPU : 1;
2644 struct
2646 unsigned : 1;
2647 unsigned : 1;
2648 unsigned : 1;
2649 unsigned : 1;
2650 unsigned : 1;
2651 unsigned : 1;
2652 unsigned : 1;
2653 unsigned RBPU : 1;
2655 } __INTCON2bits_t;
2657 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
2659 #define _RBIP 0x01
2660 #define _TMR0IP 0x04
2661 #define _INTEDG2 0x10
2662 #define _INTEDG1 0x20
2663 #define _INTEDG0 0x40
2664 #define _NOT_RBPU 0x80
2665 #define _RBPU 0x80
2667 //==============================================================================
2670 //==============================================================================
2671 // INTCON Bits
2673 extern __at(0x0FF2) __sfr INTCON;
2675 typedef union
2677 struct
2679 unsigned RBIF : 1;
2680 unsigned INT0IF : 1;
2681 unsigned TMR0IF : 1;
2682 unsigned RBIE : 1;
2683 unsigned INT0IE : 1;
2684 unsigned TMR0IE : 1;
2685 unsigned PEIE_GIEL : 1;
2686 unsigned GIE_GIEH : 1;
2689 struct
2691 unsigned : 1;
2692 unsigned INT0F : 1;
2693 unsigned T0IF : 1;
2694 unsigned : 1;
2695 unsigned INT0E : 1;
2696 unsigned T0IE : 1;
2697 unsigned PEIE : 1;
2698 unsigned GIE : 1;
2701 struct
2703 unsigned : 1;
2704 unsigned : 1;
2705 unsigned : 1;
2706 unsigned : 1;
2707 unsigned : 1;
2708 unsigned : 1;
2709 unsigned GIEL : 1;
2710 unsigned GIEH : 1;
2712 } __INTCONbits_t;
2714 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
2716 #define _RBIF 0x01
2717 #define _INT0IF 0x02
2718 #define _INT0F 0x02
2719 #define _TMR0IF 0x04
2720 #define _T0IF 0x04
2721 #define _RBIE 0x08
2722 #define _INT0IE 0x10
2723 #define _INT0E 0x10
2724 #define _TMR0IE 0x20
2725 #define _T0IE 0x20
2726 #define _PEIE_GIEL 0x40
2727 #define _PEIE 0x40
2728 #define _GIEL 0x40
2729 #define _GIE_GIEH 0x80
2730 #define _GIE 0x80
2731 #define _GIEH 0x80
2733 //==============================================================================
2735 extern __at(0x0FF3) __sfr PROD;
2736 extern __at(0x0FF3) __sfr PRODL;
2737 extern __at(0x0FF4) __sfr PRODH;
2738 extern __at(0x0FF5) __sfr TABLAT;
2739 extern __at(0x0FF6) __sfr TBLPTR;
2740 extern __at(0x0FF6) __sfr TBLPTRL;
2741 extern __at(0x0FF7) __sfr TBLPTRH;
2742 extern __at(0x0FF8) __sfr TBLPTRU;
2743 extern __at(0x0FF9) __sfr PC;
2744 extern __at(0x0FF9) __sfr PCL;
2745 extern __at(0x0FFA) __sfr PCLATH;
2746 extern __at(0x0FFB) __sfr PCLATU;
2748 //==============================================================================
2749 // STKPTR Bits
2751 extern __at(0x0FFC) __sfr STKPTR;
2753 typedef union
2755 struct
2757 unsigned STKPTR0 : 1;
2758 unsigned STKPTR1 : 1;
2759 unsigned STKPTR2 : 1;
2760 unsigned STKPTR3 : 1;
2761 unsigned STKPTR4 : 1;
2762 unsigned : 1;
2763 unsigned STKUNF : 1;
2764 unsigned STKFUL : 1;
2767 struct
2769 unsigned SP0 : 1;
2770 unsigned SP1 : 1;
2771 unsigned SP2 : 1;
2772 unsigned SP3 : 1;
2773 unsigned SP4 : 1;
2774 unsigned : 1;
2775 unsigned : 1;
2776 unsigned STKOVF : 1;
2779 struct
2781 unsigned STKPTR : 5;
2782 unsigned : 3;
2785 struct
2787 unsigned SP : 5;
2788 unsigned : 3;
2790 } __STKPTRbits_t;
2792 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
2794 #define _STKPTR0 0x01
2795 #define _SP0 0x01
2796 #define _STKPTR1 0x02
2797 #define _SP1 0x02
2798 #define _STKPTR2 0x04
2799 #define _SP2 0x04
2800 #define _STKPTR3 0x08
2801 #define _SP3 0x08
2802 #define _STKPTR4 0x10
2803 #define _SP4 0x10
2804 #define _STKUNF 0x40
2805 #define _STKFUL 0x80
2806 #define _STKOVF 0x80
2808 //==============================================================================
2810 extern __at(0x0FFD) __sfr TOS;
2811 extern __at(0x0FFD) __sfr TOSL;
2812 extern __at(0x0FFE) __sfr TOSH;
2813 extern __at(0x0FFF) __sfr TOSU;
2815 //==============================================================================
2817 // Configuration Bits
2819 //==============================================================================
2821 #define __CONFIG1H 0x300001
2822 #define __CONFIG2L 0x300002
2823 #define __CONFIG2H 0x300003
2824 #define __CONFIG3H 0x300005
2825 #define __CONFIG4L 0x300006
2826 #define __CONFIG5L 0x300008
2827 #define __CONFIG5H 0x300009
2828 #define __CONFIG6L 0x30000A
2829 #define __CONFIG6H 0x30000B
2830 #define __CONFIG7L 0x30000C
2831 #define __CONFIG7H 0x30000D
2833 //----------------------------- CONFIG1H Options -------------------------------
2835 #define _OSC_LP_1H 0xF0 // LP oscillator.
2836 #define _OSC_XT_1H 0xF1 // XT oscillator.
2837 #define _OSC_HS_1H 0xF2 // HS oscillator.
2838 #define _OSC_RC_1H 0xF3 // External RC oscillator, CLKO function on RA6.
2839 #define _OSC_EC_1H 0xF4 // EC oscillator, CLKOUT function on RA6.
2840 #define _OSC_ECIO6_1H 0xF5 // EC oscillator, port function on RA6.
2841 #define _OSC_HSPLL_1H 0xF6 // HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1).
2842 #define _OSC_RCIO6_1H 0xF7 // External RC oscillator, port function on RA6.
2843 #define _OSC_INTIO67_1H 0xF8 // Internal oscillator block, port function on RA6 and RA7.
2844 #define _OSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKOUT function on RA6, port function on RA7.
2845 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
2846 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
2847 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
2848 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
2850 //----------------------------- CONFIG2L Options -------------------------------
2852 #define _PWRT_ON_2L 0xFE // PWRT enabled.
2853 #define _PWRT_OFF_2L 0xFF // PWRT disabled.
2854 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
2855 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
2856 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
2857 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
2858 #define _BORV_0_2L 0xE7 // Maximum setting.
2859 #define _BORV_1_2L 0xEF
2860 #define _BORV_2_2L 0xF7
2861 #define _BORV_3_2L 0xFF // Minimum setting.
2863 //----------------------------- CONFIG2H Options -------------------------------
2865 #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
2866 #define _WDT_ON_2H 0xFF // WDT enabled.
2867 #define _WDTPS_1_2H 0xE1 // 1:1.
2868 #define _WDTPS_2_2H 0xE3 // 1:2.
2869 #define _WDTPS_4_2H 0xE5 // 1:4.
2870 #define _WDTPS_8_2H 0xE7 // 1:8.
2871 #define _WDTPS_16_2H 0xE9 // 1:16.
2872 #define _WDTPS_32_2H 0xEB // 1:32.
2873 #define _WDTPS_64_2H 0xED // 1:64.
2874 #define _WDTPS_128_2H 0xEF // 1:128.
2875 #define _WDTPS_256_2H 0xF1 // 1:256.
2876 #define _WDTPS_512_2H 0xF3 // 1:512.
2877 #define _WDTPS_1024_2H 0xF5 // 1:1024.
2878 #define _WDTPS_2048_2H 0xF7 // 1:2048.
2879 #define _WDTPS_4096_2H 0xF9 // 1:4096.
2880 #define _WDTPS_8192_2H 0xFB // 1:8192.
2881 #define _WDTPS_16384_2H 0xFD // 1:16384.
2882 #define _WDTPS_32768_2H 0xFF // 1:32768.
2884 //----------------------------- CONFIG3H Options -------------------------------
2886 #define _CCP2MX_PORTBE_3H 0xFE // CCP2 input/output is multiplexed with RB3.
2887 #define _CCP2MX_PORTC_3H 0xFF // CCP2 input/output is multiplexed with RC1.
2888 #define _PBADEN_OFF_3H 0xFD // PORTB<4:0> pins are configured as digital I/O on Reset.
2889 #define _PBADEN_ON_3H 0xFF // PORTB<4:0> pins are configured as analog input channels on Reset.
2890 #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
2891 #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
2892 #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; MCLR disabled.
2893 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input pin disabled.
2895 //----------------------------- CONFIG4L Options -------------------------------
2897 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
2898 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
2899 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
2900 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled.
2901 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
2902 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
2903 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
2904 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
2906 //----------------------------- CONFIG5L Options -------------------------------
2908 #define _CP0_ON_5L 0xFE // Block 0 (000800-003FFFh) code-protected.
2909 #define _CP0_OFF_5L 0xFF // Block 0 (000800-003FFFh) not code-protected.
2910 #define _CP1_ON_5L 0xFD // Block 1 (004000-007FFFh) code-protected.
2911 #define _CP1_OFF_5L 0xFF // Block 1 (004000-007FFFh) not code-protected.
2912 #define _CP2_ON_5L 0xFB // Block 2 (008000-00BFFFh) code-protected.
2913 #define _CP2_OFF_5L 0xFF // Block 2 (008000-00BFFFh) not code-protected.
2915 //----------------------------- CONFIG5H Options -------------------------------
2917 #define _CPB_ON_5H 0xBF // Boot block (000000-0007FFh) code-protected.
2918 #define _CPB_OFF_5H 0xFF // Boot block (000000-0007FFh) not code-protected.
2919 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
2920 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
2922 //----------------------------- CONFIG6L Options -------------------------------
2924 #define _WRT0_ON_6L 0xFE // Block 0 (000800-003FFFh) write-protected.
2925 #define _WRT0_OFF_6L 0xFF // Block 0 (000800-003FFFh) not write-protected.
2926 #define _WRT1_ON_6L 0xFD // Block 1 (004000-007FFFh) write-protected.
2927 #define _WRT1_OFF_6L 0xFF // Block 1 (004000-007FFFh) not write-protected.
2928 #define _WRT2_ON_6L 0xFB // Block 2 (008000-00BFFFh) write-protected.
2929 #define _WRT2_OFF_6L 0xFF // Block 2 (008000-00BFFFh) not write-protected.
2931 //----------------------------- CONFIG6H Options -------------------------------
2933 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
2934 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
2935 #define _WRTB_ON_6H 0xBF // Boot Block (000000-0007FFh) write-protected.
2936 #define _WRTB_OFF_6H 0xFF // Boot Block (000000-0007FFh) not write-protected.
2937 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
2938 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
2940 //----------------------------- CONFIG7L Options -------------------------------
2942 #define _EBTR0_ON_7L 0xFE // Block 0 (000800-003FFFh) protected from table reads executed in other blocks.
2943 #define _EBTR0_OFF_7L 0xFF // Block 0 (000800-003FFFh) not protected from table reads executed in other blocks.
2944 #define _EBTR1_ON_7L 0xFD // Block 1 (004000-007FFFh) protected from table reads executed in other blocks.
2945 #define _EBTR1_OFF_7L 0xFF // Block 1 (004000-007FFFh) not protected from table reads executed in other blocks.
2946 #define _EBTR2_ON_7L 0xFB // Block 2 (008000-00BFFFh) protected from table reads executed in other blocks.
2947 #define _EBTR2_OFF_7L 0xFF // Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks.
2949 //----------------------------- CONFIG7H Options -------------------------------
2951 #define _EBTRB_ON_7H 0xBF // Boot Block (000000-0007FFh) protected from table reads executed in other blocks.
2952 #define _EBTRB_OFF_7H 0xFF // Boot Block (000000-0007FFh) not protected from table reads executed in other blocks.
2954 //==============================================================================
2956 #define __DEVID1 0x3FFFFE
2957 #define __DEVID2 0x3FFFFF
2959 #define __IDLOC0 0x200000
2960 #define __IDLOC1 0x200001
2961 #define __IDLOC2 0x200002
2962 #define __IDLOC3 0x200003
2963 #define __IDLOC4 0x200004
2964 #define __IDLOC5 0x200005
2965 #define __IDLOC6 0x200006
2966 #define __IDLOC7 0x200007
2968 #endif // #ifndef __PIC18LF2525_H__