Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18lf24j10.h
blob4737b572d6627b77069425255342907a203ccf81
1 /*
2 * This declarations of the PIC18LF24J10 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:53 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 __PIC18LF24J10_H__
26 #define __PIC18LF24J10_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 : 1;
51 unsigned RA5 : 1;
52 unsigned : 1;
53 unsigned : 1;
56 struct
58 unsigned AN0 : 1;
59 unsigned AN1 : 1;
60 unsigned AN2 : 1;
61 unsigned AN3 : 1;
62 unsigned : 1;
63 unsigned AN4 : 1;
64 unsigned : 1;
65 unsigned : 1;
68 struct
70 unsigned : 1;
71 unsigned : 1;
72 unsigned VREFM : 1;
73 unsigned VREFP : 1;
74 unsigned : 1;
75 unsigned SS1 : 1;
76 unsigned : 1;
77 unsigned : 1;
80 struct
82 unsigned : 1;
83 unsigned : 1;
84 unsigned CVREF : 1;
85 unsigned : 1;
86 unsigned : 1;
87 unsigned C2OUT : 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 NOT_SS1 : 1;
100 unsigned : 1;
101 unsigned : 1;
103 } __PORTAbits_t;
105 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
107 #define _PORTA_RA0 0x01
108 #define _PORTA_AN0 0x01
109 #define _PORTA_RA1 0x02
110 #define _PORTA_AN1 0x02
111 #define _PORTA_RA2 0x04
112 #define _PORTA_AN2 0x04
113 #define _PORTA_VREFM 0x04
114 #define _PORTA_CVREF 0x04
115 #define _PORTA_RA3 0x08
116 #define _PORTA_AN3 0x08
117 #define _PORTA_VREFP 0x08
118 #define _PORTA_RA5 0x20
119 #define _PORTA_AN4 0x20
120 #define _PORTA_SS1 0x20
121 #define _PORTA_C2OUT 0x20
122 #define _PORTA_NOT_SS1 0x20
124 //==============================================================================
127 //==============================================================================
128 // PORTB Bits
130 extern __at(0x0F81) __sfr PORTB;
132 typedef union
134 struct
136 unsigned RB0 : 1;
137 unsigned RB1 : 1;
138 unsigned RB2 : 1;
139 unsigned RB3 : 1;
140 unsigned RB4 : 1;
141 unsigned RB5 : 1;
142 unsigned RB6 : 1;
143 unsigned RB7 : 1;
146 struct
148 unsigned INT0 : 1;
149 unsigned INT1 : 1;
150 unsigned INT2 : 1;
151 unsigned CCP2 : 1;
152 unsigned KBI0 : 1;
153 unsigned KBI1 : 1;
154 unsigned KBI2 : 1;
155 unsigned KBI3 : 1;
158 struct
160 unsigned AN12 : 1;
161 unsigned AN10 : 1;
162 unsigned AN8 : 1;
163 unsigned AN9 : 1;
164 unsigned AN11 : 1;
165 unsigned T0CKI : 1;
166 unsigned PGC : 1;
167 unsigned PGD : 1;
170 struct
172 unsigned FLT0 : 1;
173 unsigned : 1;
174 unsigned : 1;
175 unsigned : 1;
176 unsigned : 1;
177 unsigned C1OUT : 1;
178 unsigned : 1;
179 unsigned : 1;
182 struct
184 unsigned INT : 3;
185 unsigned : 5;
188 struct
190 unsigned : 4;
191 unsigned KBI : 4;
193 } __PORTBbits_t;
195 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
197 #define _PORTB_RB0 0x01
198 #define _PORTB_INT0 0x01
199 #define _PORTB_AN12 0x01
200 #define _PORTB_FLT0 0x01
201 #define _PORTB_RB1 0x02
202 #define _PORTB_INT1 0x02
203 #define _PORTB_AN10 0x02
204 #define _PORTB_RB2 0x04
205 #define _PORTB_INT2 0x04
206 #define _PORTB_AN8 0x04
207 #define _PORTB_RB3 0x08
208 #define _PORTB_CCP2 0x08
209 #define _PORTB_AN9 0x08
210 #define _PORTB_RB4 0x10
211 #define _PORTB_KBI0 0x10
212 #define _PORTB_AN11 0x10
213 #define _PORTB_RB5 0x20
214 #define _PORTB_KBI1 0x20
215 #define _PORTB_T0CKI 0x20
216 #define _PORTB_C1OUT 0x20
217 #define _PORTB_RB6 0x40
218 #define _PORTB_KBI2 0x40
219 #define _PORTB_PGC 0x40
220 #define _PORTB_RB7 0x80
221 #define _PORTB_KBI3 0x80
222 #define _PORTB_PGD 0x80
224 //==============================================================================
227 //==============================================================================
228 // PORTC Bits
230 extern __at(0x0F82) __sfr PORTC;
232 typedef union
234 struct
236 unsigned RC0 : 1;
237 unsigned RC1 : 1;
238 unsigned RC2 : 1;
239 unsigned RC3 : 1;
240 unsigned RC4 : 1;
241 unsigned RC5 : 1;
242 unsigned RC6 : 1;
243 unsigned RC7 : 1;
246 struct
248 unsigned T1OSO : 1;
249 unsigned T1OSI : 1;
250 unsigned CCP1 : 1;
251 unsigned SCK1 : 1;
252 unsigned SDI1 : 1;
253 unsigned SDO1 : 1;
254 unsigned TX : 1;
255 unsigned RX : 1;
258 struct
260 unsigned T1CKI : 1;
261 unsigned CCP2 : 1;
262 unsigned P1A : 1;
263 unsigned SCL1 : 1;
264 unsigned SDA1 : 1;
265 unsigned SDO : 1;
266 unsigned CK : 1;
267 unsigned : 1;
270 struct
272 unsigned : 1;
273 unsigned : 1;
274 unsigned : 1;
275 unsigned SCK : 1;
276 unsigned SDI : 1;
277 unsigned : 1;
278 unsigned : 1;
279 unsigned : 1;
282 struct
284 unsigned : 1;
285 unsigned : 1;
286 unsigned : 1;
287 unsigned SCL : 1;
288 unsigned SDA : 1;
289 unsigned : 1;
290 unsigned : 1;
291 unsigned : 1;
293 } __PORTCbits_t;
295 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
297 #define _PORTC_RC0 0x01
298 #define _PORTC_T1OSO 0x01
299 #define _PORTC_T1CKI 0x01
300 #define _PORTC_RC1 0x02
301 #define _PORTC_T1OSI 0x02
302 #define _PORTC_CCP2 0x02
303 #define _PORTC_RC2 0x04
304 #define _PORTC_CCP1 0x04
305 #define _PORTC_P1A 0x04
306 #define _PORTC_RC3 0x08
307 #define _PORTC_SCK1 0x08
308 #define _PORTC_SCL1 0x08
309 #define _PORTC_SCK 0x08
310 #define _PORTC_SCL 0x08
311 #define _PORTC_RC4 0x10
312 #define _PORTC_SDI1 0x10
313 #define _PORTC_SDA1 0x10
314 #define _PORTC_SDI 0x10
315 #define _PORTC_SDA 0x10
316 #define _PORTC_RC5 0x20
317 #define _PORTC_SDO1 0x20
318 #define _PORTC_SDO 0x20
319 #define _PORTC_RC6 0x40
320 #define _PORTC_TX 0x40
321 #define _PORTC_CK 0x40
322 #define _PORTC_RC7 0x80
323 #define _PORTC_RX 0x80
325 //==============================================================================
328 //==============================================================================
329 // LATA Bits
331 extern __at(0x0F89) __sfr LATA;
333 typedef struct
335 unsigned LATA0 : 1;
336 unsigned LATA1 : 1;
337 unsigned LATA2 : 1;
338 unsigned LATA3 : 1;
339 unsigned : 1;
340 unsigned LATA5 : 1;
341 unsigned : 1;
342 unsigned : 1;
343 } __LATAbits_t;
345 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
347 #define _LATA0 0x01
348 #define _LATA1 0x02
349 #define _LATA2 0x04
350 #define _LATA3 0x08
351 #define _LATA5 0x20
353 //==============================================================================
356 //==============================================================================
357 // LATB Bits
359 extern __at(0x0F8A) __sfr LATB;
361 typedef struct
363 unsigned LATB0 : 1;
364 unsigned LATB1 : 1;
365 unsigned LATB2 : 1;
366 unsigned LATB3 : 1;
367 unsigned LATB4 : 1;
368 unsigned LATB5 : 1;
369 unsigned LATB6 : 1;
370 unsigned LATB7 : 1;
371 } __LATBbits_t;
373 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
375 #define _LATB0 0x01
376 #define _LATB1 0x02
377 #define _LATB2 0x04
378 #define _LATB3 0x08
379 #define _LATB4 0x10
380 #define _LATB5 0x20
381 #define _LATB6 0x40
382 #define _LATB7 0x80
384 //==============================================================================
387 //==============================================================================
388 // LATC Bits
390 extern __at(0x0F8B) __sfr LATC;
392 typedef struct
394 unsigned LATC0 : 1;
395 unsigned LATC1 : 1;
396 unsigned LATC2 : 1;
397 unsigned LATC3 : 1;
398 unsigned LATC4 : 1;
399 unsigned LATC5 : 1;
400 unsigned LATC6 : 1;
401 unsigned LATC7 : 1;
402 } __LATCbits_t;
404 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
406 #define _LATC0 0x01
407 #define _LATC1 0x02
408 #define _LATC2 0x04
409 #define _LATC3 0x08
410 #define _LATC4 0x10
411 #define _LATC5 0x20
412 #define _LATC6 0x40
413 #define _LATC7 0x80
415 //==============================================================================
418 //==============================================================================
419 // DDRA Bits
421 extern __at(0x0F92) __sfr DDRA;
423 typedef union
425 struct
427 unsigned TRISA0 : 1;
428 unsigned TRISA1 : 1;
429 unsigned TRISA2 : 1;
430 unsigned TRISA3 : 1;
431 unsigned : 1;
432 unsigned TRISA5 : 1;
433 unsigned : 1;
434 unsigned : 1;
437 struct
439 unsigned RA0 : 1;
440 unsigned RA1 : 1;
441 unsigned RA2 : 1;
442 unsigned RA3 : 1;
443 unsigned : 1;
444 unsigned RA5 : 1;
445 unsigned : 1;
446 unsigned : 1;
448 } __DDRAbits_t;
450 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
452 #define _TRISA0 0x01
453 #define _RA0 0x01
454 #define _TRISA1 0x02
455 #define _RA1 0x02
456 #define _TRISA2 0x04
457 #define _RA2 0x04
458 #define _TRISA3 0x08
459 #define _RA3 0x08
460 #define _TRISA5 0x20
461 #define _RA5 0x20
463 //==============================================================================
466 //==============================================================================
467 // TRISA Bits
469 extern __at(0x0F92) __sfr TRISA;
471 typedef union
473 struct
475 unsigned TRISA0 : 1;
476 unsigned TRISA1 : 1;
477 unsigned TRISA2 : 1;
478 unsigned TRISA3 : 1;
479 unsigned : 1;
480 unsigned TRISA5 : 1;
481 unsigned : 1;
482 unsigned : 1;
485 struct
487 unsigned RA0 : 1;
488 unsigned RA1 : 1;
489 unsigned RA2 : 1;
490 unsigned RA3 : 1;
491 unsigned : 1;
492 unsigned RA5 : 1;
493 unsigned : 1;
494 unsigned : 1;
496 } __TRISAbits_t;
498 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
500 #define _TRISA_TRISA0 0x01
501 #define _TRISA_RA0 0x01
502 #define _TRISA_TRISA1 0x02
503 #define _TRISA_RA1 0x02
504 #define _TRISA_TRISA2 0x04
505 #define _TRISA_RA2 0x04
506 #define _TRISA_TRISA3 0x08
507 #define _TRISA_RA3 0x08
508 #define _TRISA_TRISA5 0x20
509 #define _TRISA_RA5 0x20
511 //==============================================================================
514 //==============================================================================
515 // DDRB Bits
517 extern __at(0x0F93) __sfr DDRB;
519 typedef union
521 struct
523 unsigned TRISB0 : 1;
524 unsigned TRISB1 : 1;
525 unsigned TRISB2 : 1;
526 unsigned TRISB3 : 1;
527 unsigned TRISB4 : 1;
528 unsigned TRISB5 : 1;
529 unsigned TRISB6 : 1;
530 unsigned TRISB7 : 1;
533 struct
535 unsigned RB0 : 1;
536 unsigned RB1 : 1;
537 unsigned RB2 : 1;
538 unsigned RB3 : 1;
539 unsigned RB4 : 1;
540 unsigned RB5 : 1;
541 unsigned RB6 : 1;
542 unsigned RB7 : 1;
544 } __DDRBbits_t;
546 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
548 #define _TRISB0 0x01
549 #define _RB0 0x01
550 #define _TRISB1 0x02
551 #define _RB1 0x02
552 #define _TRISB2 0x04
553 #define _RB2 0x04
554 #define _TRISB3 0x08
555 #define _RB3 0x08
556 #define _TRISB4 0x10
557 #define _RB4 0x10
558 #define _TRISB5 0x20
559 #define _RB5 0x20
560 #define _TRISB6 0x40
561 #define _RB6 0x40
562 #define _TRISB7 0x80
563 #define _RB7 0x80
565 //==============================================================================
568 //==============================================================================
569 // TRISB Bits
571 extern __at(0x0F93) __sfr TRISB;
573 typedef union
575 struct
577 unsigned TRISB0 : 1;
578 unsigned TRISB1 : 1;
579 unsigned TRISB2 : 1;
580 unsigned TRISB3 : 1;
581 unsigned TRISB4 : 1;
582 unsigned TRISB5 : 1;
583 unsigned TRISB6 : 1;
584 unsigned TRISB7 : 1;
587 struct
589 unsigned RB0 : 1;
590 unsigned RB1 : 1;
591 unsigned RB2 : 1;
592 unsigned RB3 : 1;
593 unsigned RB4 : 1;
594 unsigned RB5 : 1;
595 unsigned RB6 : 1;
596 unsigned RB7 : 1;
598 } __TRISBbits_t;
600 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
602 #define _TRISB_TRISB0 0x01
603 #define _TRISB_RB0 0x01
604 #define _TRISB_TRISB1 0x02
605 #define _TRISB_RB1 0x02
606 #define _TRISB_TRISB2 0x04
607 #define _TRISB_RB2 0x04
608 #define _TRISB_TRISB3 0x08
609 #define _TRISB_RB3 0x08
610 #define _TRISB_TRISB4 0x10
611 #define _TRISB_RB4 0x10
612 #define _TRISB_TRISB5 0x20
613 #define _TRISB_RB5 0x20
614 #define _TRISB_TRISB6 0x40
615 #define _TRISB_RB6 0x40
616 #define _TRISB_TRISB7 0x80
617 #define _TRISB_RB7 0x80
619 //==============================================================================
622 //==============================================================================
623 // DDRC Bits
625 extern __at(0x0F94) __sfr DDRC;
627 typedef union
629 struct
631 unsigned TRISC0 : 1;
632 unsigned TRISC1 : 1;
633 unsigned TRISC2 : 1;
634 unsigned TRISC3 : 1;
635 unsigned TRISC4 : 1;
636 unsigned TRISC5 : 1;
637 unsigned TRISC6 : 1;
638 unsigned TRISC7 : 1;
641 struct
643 unsigned RC0 : 1;
644 unsigned RC1 : 1;
645 unsigned RC2 : 1;
646 unsigned RC3 : 1;
647 unsigned RC4 : 1;
648 unsigned RC5 : 1;
649 unsigned RC6 : 1;
650 unsigned RC7 : 1;
652 } __DDRCbits_t;
654 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
656 #define _TRISC0 0x01
657 #define _RC0 0x01
658 #define _TRISC1 0x02
659 #define _RC1 0x02
660 #define _TRISC2 0x04
661 #define _RC2 0x04
662 #define _TRISC3 0x08
663 #define _RC3 0x08
664 #define _TRISC4 0x10
665 #define _RC4 0x10
666 #define _TRISC5 0x20
667 #define _RC5 0x20
668 #define _TRISC6 0x40
669 #define _RC6 0x40
670 #define _TRISC7 0x80
671 #define _RC7 0x80
673 //==============================================================================
676 //==============================================================================
677 // TRISC Bits
679 extern __at(0x0F94) __sfr TRISC;
681 typedef union
683 struct
685 unsigned TRISC0 : 1;
686 unsigned TRISC1 : 1;
687 unsigned TRISC2 : 1;
688 unsigned TRISC3 : 1;
689 unsigned TRISC4 : 1;
690 unsigned TRISC5 : 1;
691 unsigned TRISC6 : 1;
692 unsigned TRISC7 : 1;
695 struct
697 unsigned RC0 : 1;
698 unsigned RC1 : 1;
699 unsigned RC2 : 1;
700 unsigned RC3 : 1;
701 unsigned RC4 : 1;
702 unsigned RC5 : 1;
703 unsigned RC6 : 1;
704 unsigned RC7 : 1;
706 } __TRISCbits_t;
708 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
710 #define _TRISC_TRISC0 0x01
711 #define _TRISC_RC0 0x01
712 #define _TRISC_TRISC1 0x02
713 #define _TRISC_RC1 0x02
714 #define _TRISC_TRISC2 0x04
715 #define _TRISC_RC2 0x04
716 #define _TRISC_TRISC3 0x08
717 #define _TRISC_RC3 0x08
718 #define _TRISC_TRISC4 0x10
719 #define _TRISC_RC4 0x10
720 #define _TRISC_TRISC5 0x20
721 #define _TRISC_RC5 0x20
722 #define _TRISC_TRISC6 0x40
723 #define _TRISC_RC6 0x40
724 #define _TRISC_TRISC7 0x80
725 #define _TRISC_RC7 0x80
727 //==============================================================================
730 //==============================================================================
731 // OSCTUNE Bits
733 extern __at(0x0F9B) __sfr OSCTUNE;
735 typedef struct
737 unsigned : 1;
738 unsigned : 1;
739 unsigned : 1;
740 unsigned : 1;
741 unsigned : 1;
742 unsigned : 1;
743 unsigned PLLEN : 1;
744 unsigned : 1;
745 } __OSCTUNEbits_t;
747 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
749 #define _PLLEN 0x40
751 //==============================================================================
754 //==============================================================================
755 // PIE1 Bits
757 extern __at(0x0F9D) __sfr PIE1;
759 typedef union
761 struct
763 unsigned TMR1IE : 1;
764 unsigned TMR2IE : 1;
765 unsigned CCP1IE : 1;
766 unsigned SSP1IE : 1;
767 unsigned TXIE : 1;
768 unsigned RCIE : 1;
769 unsigned ADIE : 1;
770 unsigned : 1;
773 struct
775 unsigned : 1;
776 unsigned : 1;
777 unsigned : 1;
778 unsigned SSPIE : 1;
779 unsigned TX1IE : 1;
780 unsigned RC1IE : 1;
781 unsigned : 1;
782 unsigned : 1;
784 } __PIE1bits_t;
786 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
788 #define _TMR1IE 0x01
789 #define _TMR2IE 0x02
790 #define _CCP1IE 0x04
791 #define _SSP1IE 0x08
792 #define _SSPIE 0x08
793 #define _TXIE 0x10
794 #define _TX1IE 0x10
795 #define _RCIE 0x20
796 #define _RC1IE 0x20
797 #define _ADIE 0x40
799 //==============================================================================
802 //==============================================================================
803 // PIR1 Bits
805 extern __at(0x0F9E) __sfr PIR1;
807 typedef union
809 struct
811 unsigned TMR1IF : 1;
812 unsigned TMR2IF : 1;
813 unsigned CCP1IF : 1;
814 unsigned SSP1IF : 1;
815 unsigned TXIF : 1;
816 unsigned RCIF : 1;
817 unsigned ADIF : 1;
818 unsigned : 1;
821 struct
823 unsigned : 1;
824 unsigned : 1;
825 unsigned : 1;
826 unsigned SSPIF : 1;
827 unsigned TX1IF : 1;
828 unsigned RC1IF : 1;
829 unsigned : 1;
830 unsigned : 1;
832 } __PIR1bits_t;
834 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
836 #define _TMR1IF 0x01
837 #define _TMR2IF 0x02
838 #define _CCP1IF 0x04
839 #define _SSP1IF 0x08
840 #define _SSPIF 0x08
841 #define _TXIF 0x10
842 #define _TX1IF 0x10
843 #define _RCIF 0x20
844 #define _RC1IF 0x20
845 #define _ADIF 0x40
847 //==============================================================================
850 //==============================================================================
851 // IPR1 Bits
853 extern __at(0x0F9F) __sfr IPR1;
855 typedef union
857 struct
859 unsigned TMR1IP : 1;
860 unsigned TMR2IP : 1;
861 unsigned CCP1IP : 1;
862 unsigned SSP1IP : 1;
863 unsigned TXIP : 1;
864 unsigned RCIP : 1;
865 unsigned ADIP : 1;
866 unsigned : 1;
869 struct
871 unsigned : 1;
872 unsigned : 1;
873 unsigned : 1;
874 unsigned SSPIP : 1;
875 unsigned TX1IP : 1;
876 unsigned RC1IP : 1;
877 unsigned : 1;
878 unsigned : 1;
880 } __IPR1bits_t;
882 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
884 #define _TMR1IP 0x01
885 #define _TMR2IP 0x02
886 #define _CCP1IP 0x04
887 #define _SSP1IP 0x08
888 #define _SSPIP 0x08
889 #define _TXIP 0x10
890 #define _TX1IP 0x10
891 #define _RCIP 0x20
892 #define _RC1IP 0x20
893 #define _ADIP 0x40
895 //==============================================================================
898 //==============================================================================
899 // PIE2 Bits
901 extern __at(0x0FA0) __sfr PIE2;
903 typedef union
905 struct
907 unsigned CCP2IE : 1;
908 unsigned : 1;
909 unsigned : 1;
910 unsigned BCL1IE : 1;
911 unsigned : 1;
912 unsigned : 1;
913 unsigned CMIE : 1;
914 unsigned OSCFIE : 1;
917 struct
919 unsigned : 1;
920 unsigned : 1;
921 unsigned : 1;
922 unsigned BCLIE : 1;
923 unsigned : 1;
924 unsigned : 1;
925 unsigned : 1;
926 unsigned : 1;
928 } __PIE2bits_t;
930 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
932 #define _CCP2IE 0x01
933 #define _BCL1IE 0x08
934 #define _BCLIE 0x08
935 #define _CMIE 0x40
936 #define _OSCFIE 0x80
938 //==============================================================================
941 //==============================================================================
942 // PIR2 Bits
944 extern __at(0x0FA1) __sfr PIR2;
946 typedef union
948 struct
950 unsigned CCP2IF : 1;
951 unsigned : 1;
952 unsigned : 1;
953 unsigned BCL1IF : 1;
954 unsigned : 1;
955 unsigned : 1;
956 unsigned CMIF : 1;
957 unsigned OSCFIF : 1;
960 struct
962 unsigned : 1;
963 unsigned : 1;
964 unsigned : 1;
965 unsigned BCLIF : 1;
966 unsigned : 1;
967 unsigned : 1;
968 unsigned : 1;
969 unsigned : 1;
971 } __PIR2bits_t;
973 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
975 #define _CCP2IF 0x01
976 #define _BCL1IF 0x08
977 #define _BCLIF 0x08
978 #define _CMIF 0x40
979 #define _OSCFIF 0x80
981 //==============================================================================
984 //==============================================================================
985 // IPR2 Bits
987 extern __at(0x0FA2) __sfr IPR2;
989 typedef union
991 struct
993 unsigned CCP2IP : 1;
994 unsigned : 1;
995 unsigned : 1;
996 unsigned BCL1IP : 1;
997 unsigned : 1;
998 unsigned : 1;
999 unsigned CMIP : 1;
1000 unsigned OSCFIP : 1;
1003 struct
1005 unsigned : 1;
1006 unsigned : 1;
1007 unsigned : 1;
1008 unsigned BCLIP : 1;
1009 unsigned : 1;
1010 unsigned : 1;
1011 unsigned : 1;
1012 unsigned : 1;
1014 } __IPR2bits_t;
1016 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
1018 #define _CCP2IP 0x01
1019 #define _BCL1IP 0x08
1020 #define _BCLIP 0x08
1021 #define _CMIP 0x40
1022 #define _OSCFIP 0x80
1024 //==============================================================================
1027 //==============================================================================
1028 // EECON1 Bits
1030 extern __at(0x0FA6) __sfr EECON1;
1032 typedef struct
1034 unsigned : 1;
1035 unsigned WR : 1;
1036 unsigned WREN : 1;
1037 unsigned WRERR : 1;
1038 unsigned FREE : 1;
1039 unsigned : 1;
1040 unsigned : 1;
1041 unsigned : 1;
1042 } __EECON1bits_t;
1044 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
1046 #define _WR 0x02
1047 #define _WREN 0x04
1048 #define _WRERR 0x08
1049 #define _FREE 0x10
1051 //==============================================================================
1053 extern __at(0x0FA7) __sfr EECON2;
1055 //==============================================================================
1056 // RCSTA Bits
1058 extern __at(0x0FAB) __sfr RCSTA;
1060 typedef union
1062 struct
1064 unsigned RX9D : 1;
1065 unsigned OERR : 1;
1066 unsigned FERR : 1;
1067 unsigned ADDEN : 1;
1068 unsigned CREN : 1;
1069 unsigned SREN : 1;
1070 unsigned RX9 : 1;
1071 unsigned SPEN : 1;
1074 struct
1076 unsigned RCD8 : 1;
1077 unsigned OERR1 : 1;
1078 unsigned FERR1 : 1;
1079 unsigned ADEN : 1;
1080 unsigned CREN1 : 1;
1081 unsigned SREN1 : 1;
1082 unsigned RC9 : 1;
1083 unsigned SPEN1 : 1;
1086 struct
1088 unsigned RX9D1 : 1;
1089 unsigned : 1;
1090 unsigned : 1;
1091 unsigned ADDEN1 : 1;
1092 unsigned : 1;
1093 unsigned : 1;
1094 unsigned NOT_RC8 : 1;
1095 unsigned : 1;
1098 struct
1100 unsigned : 1;
1101 unsigned : 1;
1102 unsigned : 1;
1103 unsigned : 1;
1104 unsigned : 1;
1105 unsigned : 1;
1106 unsigned RC8_9 : 1;
1107 unsigned : 1;
1110 struct
1112 unsigned : 1;
1113 unsigned : 1;
1114 unsigned : 1;
1115 unsigned : 1;
1116 unsigned : 1;
1117 unsigned : 1;
1118 unsigned RX91 : 1;
1119 unsigned : 1;
1121 } __RCSTAbits_t;
1123 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
1125 #define _RX9D 0x01
1126 #define _RCD8 0x01
1127 #define _RX9D1 0x01
1128 #define _OERR 0x02
1129 #define _OERR1 0x02
1130 #define _FERR 0x04
1131 #define _FERR1 0x04
1132 #define _ADDEN 0x08
1133 #define _ADEN 0x08
1134 #define _ADDEN1 0x08
1135 #define _CREN 0x10
1136 #define _CREN1 0x10
1137 #define _SREN 0x20
1138 #define _SREN1 0x20
1139 #define _RX9 0x40
1140 #define _RC9 0x40
1141 #define _NOT_RC8 0x40
1142 #define _RC8_9 0x40
1143 #define _RX91 0x40
1144 #define _SPEN 0x80
1145 #define _SPEN1 0x80
1147 //==============================================================================
1150 //==============================================================================
1151 // RCSTA1 Bits
1153 extern __at(0x0FAB) __sfr RCSTA1;
1155 typedef union
1157 struct
1159 unsigned RX9D : 1;
1160 unsigned OERR : 1;
1161 unsigned FERR : 1;
1162 unsigned ADDEN : 1;
1163 unsigned CREN : 1;
1164 unsigned SREN : 1;
1165 unsigned RX9 : 1;
1166 unsigned SPEN : 1;
1169 struct
1171 unsigned RCD8 : 1;
1172 unsigned OERR1 : 1;
1173 unsigned FERR1 : 1;
1174 unsigned ADEN : 1;
1175 unsigned CREN1 : 1;
1176 unsigned SREN1 : 1;
1177 unsigned RC9 : 1;
1178 unsigned SPEN1 : 1;
1181 struct
1183 unsigned RX9D1 : 1;
1184 unsigned : 1;
1185 unsigned : 1;
1186 unsigned ADDEN1 : 1;
1187 unsigned : 1;
1188 unsigned : 1;
1189 unsigned NOT_RC8 : 1;
1190 unsigned : 1;
1193 struct
1195 unsigned : 1;
1196 unsigned : 1;
1197 unsigned : 1;
1198 unsigned : 1;
1199 unsigned : 1;
1200 unsigned : 1;
1201 unsigned RC8_9 : 1;
1202 unsigned : 1;
1205 struct
1207 unsigned : 1;
1208 unsigned : 1;
1209 unsigned : 1;
1210 unsigned : 1;
1211 unsigned : 1;
1212 unsigned : 1;
1213 unsigned RX91 : 1;
1214 unsigned : 1;
1216 } __RCSTA1bits_t;
1218 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
1220 #define _RCSTA1_RX9D 0x01
1221 #define _RCSTA1_RCD8 0x01
1222 #define _RCSTA1_RX9D1 0x01
1223 #define _RCSTA1_OERR 0x02
1224 #define _RCSTA1_OERR1 0x02
1225 #define _RCSTA1_FERR 0x04
1226 #define _RCSTA1_FERR1 0x04
1227 #define _RCSTA1_ADDEN 0x08
1228 #define _RCSTA1_ADEN 0x08
1229 #define _RCSTA1_ADDEN1 0x08
1230 #define _RCSTA1_CREN 0x10
1231 #define _RCSTA1_CREN1 0x10
1232 #define _RCSTA1_SREN 0x20
1233 #define _RCSTA1_SREN1 0x20
1234 #define _RCSTA1_RX9 0x40
1235 #define _RCSTA1_RC9 0x40
1236 #define _RCSTA1_NOT_RC8 0x40
1237 #define _RCSTA1_RC8_9 0x40
1238 #define _RCSTA1_RX91 0x40
1239 #define _RCSTA1_SPEN 0x80
1240 #define _RCSTA1_SPEN1 0x80
1242 //==============================================================================
1245 //==============================================================================
1246 // TXSTA Bits
1248 extern __at(0x0FAC) __sfr TXSTA;
1250 typedef union
1252 struct
1254 unsigned TX9D : 1;
1255 unsigned TRMT : 1;
1256 unsigned BRGH : 1;
1257 unsigned SENDB : 1;
1258 unsigned SYNC : 1;
1259 unsigned TXEN : 1;
1260 unsigned TX9 : 1;
1261 unsigned CSRC : 1;
1264 struct
1266 unsigned TXD8 : 1;
1267 unsigned TRMT1 : 1;
1268 unsigned BRGH1 : 1;
1269 unsigned SENDB1 : 1;
1270 unsigned SYNC1 : 1;
1271 unsigned TXEN1 : 1;
1272 unsigned TX8_9 : 1;
1273 unsigned CSRC1 : 1;
1276 struct
1278 unsigned TX9D1 : 1;
1279 unsigned : 1;
1280 unsigned : 1;
1281 unsigned : 1;
1282 unsigned : 1;
1283 unsigned : 1;
1284 unsigned NOT_TX8 : 1;
1285 unsigned : 1;
1288 struct
1290 unsigned : 1;
1291 unsigned : 1;
1292 unsigned : 1;
1293 unsigned : 1;
1294 unsigned : 1;
1295 unsigned : 1;
1296 unsigned TX91 : 1;
1297 unsigned : 1;
1299 } __TXSTAbits_t;
1301 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
1303 #define _TX9D 0x01
1304 #define _TXD8 0x01
1305 #define _TX9D1 0x01
1306 #define _TRMT 0x02
1307 #define _TRMT1 0x02
1308 #define _BRGH 0x04
1309 #define _BRGH1 0x04
1310 #define _SENDB 0x08
1311 #define _SENDB1 0x08
1312 #define _SYNC 0x10
1313 #define _SYNC1 0x10
1314 #define _TXEN 0x20
1315 #define _TXEN1 0x20
1316 #define _TX9 0x40
1317 #define _TX8_9 0x40
1318 #define _NOT_TX8 0x40
1319 #define _TX91 0x40
1320 #define _CSRC 0x80
1321 #define _CSRC1 0x80
1323 //==============================================================================
1326 //==============================================================================
1327 // TXSTA1 Bits
1329 extern __at(0x0FAC) __sfr TXSTA1;
1331 typedef union
1333 struct
1335 unsigned TX9D : 1;
1336 unsigned TRMT : 1;
1337 unsigned BRGH : 1;
1338 unsigned SENDB : 1;
1339 unsigned SYNC : 1;
1340 unsigned TXEN : 1;
1341 unsigned TX9 : 1;
1342 unsigned CSRC : 1;
1345 struct
1347 unsigned TXD8 : 1;
1348 unsigned TRMT1 : 1;
1349 unsigned BRGH1 : 1;
1350 unsigned SENDB1 : 1;
1351 unsigned SYNC1 : 1;
1352 unsigned TXEN1 : 1;
1353 unsigned TX8_9 : 1;
1354 unsigned CSRC1 : 1;
1357 struct
1359 unsigned TX9D1 : 1;
1360 unsigned : 1;
1361 unsigned : 1;
1362 unsigned : 1;
1363 unsigned : 1;
1364 unsigned : 1;
1365 unsigned NOT_TX8 : 1;
1366 unsigned : 1;
1369 struct
1371 unsigned : 1;
1372 unsigned : 1;
1373 unsigned : 1;
1374 unsigned : 1;
1375 unsigned : 1;
1376 unsigned : 1;
1377 unsigned TX91 : 1;
1378 unsigned : 1;
1380 } __TXSTA1bits_t;
1382 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
1384 #define _TXSTA1_TX9D 0x01
1385 #define _TXSTA1_TXD8 0x01
1386 #define _TXSTA1_TX9D1 0x01
1387 #define _TXSTA1_TRMT 0x02
1388 #define _TXSTA1_TRMT1 0x02
1389 #define _TXSTA1_BRGH 0x04
1390 #define _TXSTA1_BRGH1 0x04
1391 #define _TXSTA1_SENDB 0x08
1392 #define _TXSTA1_SENDB1 0x08
1393 #define _TXSTA1_SYNC 0x10
1394 #define _TXSTA1_SYNC1 0x10
1395 #define _TXSTA1_TXEN 0x20
1396 #define _TXSTA1_TXEN1 0x20
1397 #define _TXSTA1_TX9 0x40
1398 #define _TXSTA1_TX8_9 0x40
1399 #define _TXSTA1_NOT_TX8 0x40
1400 #define _TXSTA1_TX91 0x40
1401 #define _TXSTA1_CSRC 0x80
1402 #define _TXSTA1_CSRC1 0x80
1404 //==============================================================================
1406 extern __at(0x0FAD) __sfr TXREG;
1407 extern __at(0x0FAD) __sfr TXREG1;
1408 extern __at(0x0FAE) __sfr RCREG;
1409 extern __at(0x0FAE) __sfr RCREG1;
1410 extern __at(0x0FAF) __sfr SPBRG;
1411 extern __at(0x0FAF) __sfr SPBRG1;
1412 extern __at(0x0FB0) __sfr SPBRGH;
1414 //==============================================================================
1415 // CMCON Bits
1417 extern __at(0x0FB4) __sfr CMCON;
1419 typedef union
1421 struct
1423 unsigned CM0 : 1;
1424 unsigned CM1 : 1;
1425 unsigned CM2 : 1;
1426 unsigned CIS : 1;
1427 unsigned C1INV : 1;
1428 unsigned C2INV : 1;
1429 unsigned C1OUT : 1;
1430 unsigned C2OUT : 1;
1433 struct
1435 unsigned CM : 3;
1436 unsigned : 5;
1438 } __CMCONbits_t;
1440 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
1442 #define _CM0 0x01
1443 #define _CM1 0x02
1444 #define _CM2 0x04
1445 #define _CIS 0x08
1446 #define _C1INV 0x10
1447 #define _C2INV 0x20
1448 #define _C1OUT 0x40
1449 #define _C2OUT 0x80
1451 //==============================================================================
1454 //==============================================================================
1455 // CVRCON Bits
1457 extern __at(0x0FB5) __sfr CVRCON;
1459 typedef union
1461 struct
1463 unsigned CVR0 : 1;
1464 unsigned CVR1 : 1;
1465 unsigned CVR2 : 1;
1466 unsigned CVR3 : 1;
1467 unsigned CVRSS : 1;
1468 unsigned CVRR : 1;
1469 unsigned CVROE : 1;
1470 unsigned CVREN : 1;
1473 struct
1475 unsigned CVR : 4;
1476 unsigned : 4;
1478 } __CVRCONbits_t;
1480 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
1482 #define _CVR0 0x01
1483 #define _CVR1 0x02
1484 #define _CVR2 0x04
1485 #define _CVR3 0x08
1486 #define _CVRSS 0x10
1487 #define _CVRR 0x20
1488 #define _CVROE 0x40
1489 #define _CVREN 0x80
1491 //==============================================================================
1494 //==============================================================================
1495 // ECCP1AS Bits
1497 extern __at(0x0FB6) __sfr ECCP1AS;
1499 typedef union
1501 struct
1503 unsigned : 1;
1504 unsigned : 1;
1505 unsigned PSSAC0 : 1;
1506 unsigned PSSAC1 : 1;
1507 unsigned ECCPAS0 : 1;
1508 unsigned ECCPAS1 : 1;
1509 unsigned ECCPAS2 : 1;
1510 unsigned ECCPASE : 1;
1513 struct
1515 unsigned : 2;
1516 unsigned PSSAC : 2;
1517 unsigned : 4;
1520 struct
1522 unsigned : 4;
1523 unsigned ECCPAS : 3;
1524 unsigned : 1;
1526 } __ECCP1ASbits_t;
1528 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
1530 #define _PSSAC0 0x04
1531 #define _PSSAC1 0x08
1532 #define _ECCPAS0 0x10
1533 #define _ECCPAS1 0x20
1534 #define _ECCPAS2 0x40
1535 #define _ECCPASE 0x80
1537 //==============================================================================
1540 //==============================================================================
1541 // ECCP1DEL Bits
1543 extern __at(0x0FB7) __sfr ECCP1DEL;
1545 typedef struct
1547 unsigned : 1;
1548 unsigned : 1;
1549 unsigned : 1;
1550 unsigned : 1;
1551 unsigned : 1;
1552 unsigned : 1;
1553 unsigned : 1;
1554 unsigned PRSEN : 1;
1555 } __ECCP1DELbits_t;
1557 extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits;
1559 #define _PRSEN 0x80
1561 //==============================================================================
1564 //==============================================================================
1565 // PWM1CON Bits
1567 extern __at(0x0FB7) __sfr PWM1CON;
1569 typedef struct
1571 unsigned : 1;
1572 unsigned : 1;
1573 unsigned : 1;
1574 unsigned : 1;
1575 unsigned : 1;
1576 unsigned : 1;
1577 unsigned : 1;
1578 unsigned PRSEN : 1;
1579 } __PWM1CONbits_t;
1581 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
1583 #define _PWM1CON_PRSEN 0x80
1585 //==============================================================================
1588 //==============================================================================
1589 // BAUDCON Bits
1591 extern __at(0x0FB8) __sfr BAUDCON;
1593 typedef union
1595 struct
1597 unsigned ABDEN : 1;
1598 unsigned WUE : 1;
1599 unsigned : 1;
1600 unsigned BRG16 : 1;
1601 unsigned SCKP : 1;
1602 unsigned : 1;
1603 unsigned RCMT : 1;
1604 unsigned ABDOVF : 1;
1607 struct
1609 unsigned : 1;
1610 unsigned : 1;
1611 unsigned : 1;
1612 unsigned : 1;
1613 unsigned : 1;
1614 unsigned : 1;
1615 unsigned RCIDL : 1;
1616 unsigned : 1;
1618 } __BAUDCONbits_t;
1620 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
1622 #define _ABDEN 0x01
1623 #define _WUE 0x02
1624 #define _BRG16 0x08
1625 #define _SCKP 0x10
1626 #define _RCMT 0x40
1627 #define _RCIDL 0x40
1628 #define _ABDOVF 0x80
1630 //==============================================================================
1633 //==============================================================================
1634 // BAUDCTL Bits
1636 extern __at(0x0FB8) __sfr BAUDCTL;
1638 typedef union
1640 struct
1642 unsigned ABDEN : 1;
1643 unsigned WUE : 1;
1644 unsigned : 1;
1645 unsigned BRG16 : 1;
1646 unsigned SCKP : 1;
1647 unsigned : 1;
1648 unsigned RCMT : 1;
1649 unsigned ABDOVF : 1;
1652 struct
1654 unsigned : 1;
1655 unsigned : 1;
1656 unsigned : 1;
1657 unsigned : 1;
1658 unsigned : 1;
1659 unsigned : 1;
1660 unsigned RCIDL : 1;
1661 unsigned : 1;
1663 } __BAUDCTLbits_t;
1665 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
1667 #define _BAUDCTL_ABDEN 0x01
1668 #define _BAUDCTL_WUE 0x02
1669 #define _BAUDCTL_BRG16 0x08
1670 #define _BAUDCTL_SCKP 0x10
1671 #define _BAUDCTL_RCMT 0x40
1672 #define _BAUDCTL_RCIDL 0x40
1673 #define _BAUDCTL_ABDOVF 0x80
1675 //==============================================================================
1678 //==============================================================================
1679 // CCP2CON Bits
1681 extern __at(0x0FBA) __sfr CCP2CON;
1683 typedef union
1685 struct
1687 unsigned CCP2M0 : 1;
1688 unsigned CCP2M1 : 1;
1689 unsigned CCP2M2 : 1;
1690 unsigned CCP2M3 : 1;
1691 unsigned DC2B0 : 1;
1692 unsigned DC2B1 : 1;
1693 unsigned : 1;
1694 unsigned : 1;
1697 struct
1699 unsigned : 1;
1700 unsigned : 1;
1701 unsigned : 1;
1702 unsigned : 1;
1703 unsigned CCP2Y : 1;
1704 unsigned CCP2X : 1;
1705 unsigned : 1;
1706 unsigned : 1;
1709 struct
1711 unsigned CCP2M : 4;
1712 unsigned : 4;
1715 struct
1717 unsigned : 4;
1718 unsigned DC2B : 2;
1719 unsigned : 2;
1721 } __CCP2CONbits_t;
1723 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
1725 #define _CCP2M0 0x01
1726 #define _CCP2M1 0x02
1727 #define _CCP2M2 0x04
1728 #define _CCP2M3 0x08
1729 #define _DC2B0 0x10
1730 #define _CCP2Y 0x10
1731 #define _DC2B1 0x20
1732 #define _CCP2X 0x20
1734 //==============================================================================
1736 extern __at(0x0FBB) __sfr CCPR2;
1737 extern __at(0x0FBB) __sfr CCPR2L;
1738 extern __at(0x0FBC) __sfr CCPR2H;
1740 //==============================================================================
1741 // CCP1CON Bits
1743 extern __at(0x0FBD) __sfr CCP1CON;
1745 typedef union
1747 struct
1749 unsigned CCP1M0 : 1;
1750 unsigned CCP1M1 : 1;
1751 unsigned CCP1M2 : 1;
1752 unsigned CCP1M3 : 1;
1753 unsigned DC1B0 : 1;
1754 unsigned DC1B1 : 1;
1755 unsigned : 1;
1756 unsigned : 1;
1759 struct
1761 unsigned : 1;
1762 unsigned : 1;
1763 unsigned : 1;
1764 unsigned : 1;
1765 unsigned CCP1Y : 1;
1766 unsigned CCP1X : 1;
1767 unsigned : 1;
1768 unsigned : 1;
1771 struct
1773 unsigned CCP1M : 4;
1774 unsigned : 4;
1777 struct
1779 unsigned : 4;
1780 unsigned DC1B : 2;
1781 unsigned : 2;
1783 } __CCP1CONbits_t;
1785 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
1787 #define _CCP1M0 0x01
1788 #define _CCP1M1 0x02
1789 #define _CCP1M2 0x04
1790 #define _CCP1M3 0x08
1791 #define _DC1B0 0x10
1792 #define _CCP1Y 0x10
1793 #define _DC1B1 0x20
1794 #define _CCP1X 0x20
1796 //==============================================================================
1798 extern __at(0x0FBE) __sfr CCPR1;
1799 extern __at(0x0FBE) __sfr CCPR1L;
1800 extern __at(0x0FBF) __sfr CCPR1H;
1802 //==============================================================================
1803 // ADCON2 Bits
1805 extern __at(0x0FC0) __sfr ADCON2;
1807 typedef union
1809 struct
1811 unsigned ADCS0 : 1;
1812 unsigned ADCS1 : 1;
1813 unsigned ADCS2 : 1;
1814 unsigned ACQT0 : 1;
1815 unsigned ACQT1 : 1;
1816 unsigned ACQT2 : 1;
1817 unsigned : 1;
1818 unsigned ADFM : 1;
1821 struct
1823 unsigned ADCS : 3;
1824 unsigned : 5;
1827 struct
1829 unsigned : 3;
1830 unsigned ACQT : 3;
1831 unsigned : 2;
1833 } __ADCON2bits_t;
1835 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
1837 #define _ADCS0 0x01
1838 #define _ADCS1 0x02
1839 #define _ADCS2 0x04
1840 #define _ACQT0 0x08
1841 #define _ACQT1 0x10
1842 #define _ACQT2 0x20
1843 #define _ADFM 0x80
1845 //==============================================================================
1848 //==============================================================================
1849 // ADCON1 Bits
1851 extern __at(0x0FC1) __sfr ADCON1;
1853 typedef union
1855 struct
1857 unsigned PCFG0 : 1;
1858 unsigned PCFG1 : 1;
1859 unsigned PCFG2 : 1;
1860 unsigned PCFG3 : 1;
1861 unsigned VCFG0 : 1;
1862 unsigned VCFG1 : 1;
1863 unsigned : 1;
1864 unsigned : 1;
1867 struct
1869 unsigned PCFG : 4;
1870 unsigned : 4;
1873 struct
1875 unsigned : 4;
1876 unsigned VCFG : 2;
1877 unsigned : 2;
1879 } __ADCON1bits_t;
1881 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
1883 #define _PCFG0 0x01
1884 #define _PCFG1 0x02
1885 #define _PCFG2 0x04
1886 #define _PCFG3 0x08
1887 #define _VCFG0 0x10
1888 #define _VCFG1 0x20
1890 //==============================================================================
1893 //==============================================================================
1894 // ADCON0 Bits
1896 extern __at(0x0FC2) __sfr ADCON0;
1898 typedef union
1900 struct
1902 unsigned ADON : 1;
1903 unsigned GO_NOT_DONE : 1;
1904 unsigned CHS0 : 1;
1905 unsigned CHS1 : 1;
1906 unsigned CHS2 : 1;
1907 unsigned CHS3 : 1;
1908 unsigned : 1;
1909 unsigned ADCAL : 1;
1912 struct
1914 unsigned : 1;
1915 unsigned DONE : 1;
1916 unsigned : 1;
1917 unsigned : 1;
1918 unsigned : 1;
1919 unsigned : 1;
1920 unsigned : 1;
1921 unsigned : 1;
1924 struct
1926 unsigned : 1;
1927 unsigned GO_DONE : 1;
1928 unsigned : 1;
1929 unsigned : 1;
1930 unsigned : 1;
1931 unsigned : 1;
1932 unsigned : 1;
1933 unsigned : 1;
1936 struct
1938 unsigned : 1;
1939 unsigned GO : 1;
1940 unsigned : 1;
1941 unsigned : 1;
1942 unsigned : 1;
1943 unsigned : 1;
1944 unsigned : 1;
1945 unsigned : 1;
1948 struct
1950 unsigned : 1;
1951 unsigned NOT_DONE : 1;
1952 unsigned : 1;
1953 unsigned : 1;
1954 unsigned : 1;
1955 unsigned : 1;
1956 unsigned : 1;
1957 unsigned : 1;
1960 struct
1962 unsigned : 2;
1963 unsigned CHS : 4;
1964 unsigned : 2;
1966 } __ADCON0bits_t;
1968 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
1970 #define _ADON 0x01
1971 #define _GO_NOT_DONE 0x02
1972 #define _DONE 0x02
1973 #define _GO_DONE 0x02
1974 #define _GO 0x02
1975 #define _NOT_DONE 0x02
1976 #define _CHS0 0x04
1977 #define _CHS1 0x08
1978 #define _CHS2 0x10
1979 #define _CHS3 0x20
1980 #define _ADCAL 0x80
1982 //==============================================================================
1984 extern __at(0x0FC3) __sfr ADRES;
1985 extern __at(0x0FC3) __sfr ADRESL;
1986 extern __at(0x0FC4) __sfr ADRESH;
1988 //==============================================================================
1989 // SSP1CON2 Bits
1991 extern __at(0x0FC5) __sfr SSP1CON2;
1993 typedef struct
1995 unsigned SEN : 1;
1996 unsigned RSEN : 1;
1997 unsigned PEN : 1;
1998 unsigned RCEN : 1;
1999 unsigned ACKEN : 1;
2000 unsigned ACKDT : 1;
2001 unsigned ACKSTAT : 1;
2002 unsigned GCEN : 1;
2003 } __SSP1CON2bits_t;
2005 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
2007 #define _SEN 0x01
2008 #define _RSEN 0x02
2009 #define _PEN 0x04
2010 #define _RCEN 0x08
2011 #define _ACKEN 0x10
2012 #define _ACKDT 0x20
2013 #define _ACKSTAT 0x40
2014 #define _GCEN 0x80
2016 //==============================================================================
2019 //==============================================================================
2020 // SSPCON2 Bits
2022 extern __at(0x0FC5) __sfr SSPCON2;
2024 typedef struct
2026 unsigned SEN : 1;
2027 unsigned RSEN : 1;
2028 unsigned PEN : 1;
2029 unsigned RCEN : 1;
2030 unsigned ACKEN : 1;
2031 unsigned ACKDT : 1;
2032 unsigned ACKSTAT : 1;
2033 unsigned GCEN : 1;
2034 } __SSPCON2bits_t;
2036 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
2038 #define _SSPCON2_SEN 0x01
2039 #define _SSPCON2_RSEN 0x02
2040 #define _SSPCON2_PEN 0x04
2041 #define _SSPCON2_RCEN 0x08
2042 #define _SSPCON2_ACKEN 0x10
2043 #define _SSPCON2_ACKDT 0x20
2044 #define _SSPCON2_ACKSTAT 0x40
2045 #define _SSPCON2_GCEN 0x80
2047 //==============================================================================
2050 //==============================================================================
2051 // SSP1CON1 Bits
2053 extern __at(0x0FC6) __sfr SSP1CON1;
2055 typedef union
2057 struct
2059 unsigned SSPM0 : 1;
2060 unsigned SSPM1 : 1;
2061 unsigned SSPM2 : 1;
2062 unsigned SSPM3 : 1;
2063 unsigned CKP : 1;
2064 unsigned SSPEN : 1;
2065 unsigned SSPOV : 1;
2066 unsigned WCOL : 1;
2069 struct
2071 unsigned SSPM : 4;
2072 unsigned : 4;
2074 } __SSP1CON1bits_t;
2076 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
2078 #define _SSPM0 0x01
2079 #define _SSPM1 0x02
2080 #define _SSPM2 0x04
2081 #define _SSPM3 0x08
2082 #define _CKP 0x10
2083 #define _SSPEN 0x20
2084 #define _SSPOV 0x40
2085 #define _WCOL 0x80
2087 //==============================================================================
2090 //==============================================================================
2091 // SSPCON1 Bits
2093 extern __at(0x0FC6) __sfr SSPCON1;
2095 typedef union
2097 struct
2099 unsigned SSPM0 : 1;
2100 unsigned SSPM1 : 1;
2101 unsigned SSPM2 : 1;
2102 unsigned SSPM3 : 1;
2103 unsigned CKP : 1;
2104 unsigned SSPEN : 1;
2105 unsigned SSPOV : 1;
2106 unsigned WCOL : 1;
2109 struct
2111 unsigned SSPM : 4;
2112 unsigned : 4;
2114 } __SSPCON1bits_t;
2116 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
2118 #define _SSPCON1_SSPM0 0x01
2119 #define _SSPCON1_SSPM1 0x02
2120 #define _SSPCON1_SSPM2 0x04
2121 #define _SSPCON1_SSPM3 0x08
2122 #define _SSPCON1_CKP 0x10
2123 #define _SSPCON1_SSPEN 0x20
2124 #define _SSPCON1_SSPOV 0x40
2125 #define _SSPCON1_WCOL 0x80
2127 //==============================================================================
2130 //==============================================================================
2131 // SSP1STAT Bits
2133 extern __at(0x0FC7) __sfr SSP1STAT;
2135 typedef union
2137 struct
2139 unsigned BF : 1;
2140 unsigned UA : 1;
2141 unsigned R_NOT_W : 1;
2142 unsigned S : 1;
2143 unsigned P : 1;
2144 unsigned D_NOT_A : 1;
2145 unsigned CKE : 1;
2146 unsigned SMP : 1;
2149 struct
2151 unsigned : 1;
2152 unsigned : 1;
2153 unsigned R_W : 1;
2154 unsigned I2C_START : 1;
2155 unsigned I2C_STOP : 1;
2156 unsigned D_A : 1;
2157 unsigned : 1;
2158 unsigned : 1;
2161 struct
2163 unsigned : 1;
2164 unsigned : 1;
2165 unsigned I2C_READ : 1;
2166 unsigned : 1;
2167 unsigned : 1;
2168 unsigned I2C_DAT : 1;
2169 unsigned : 1;
2170 unsigned : 1;
2173 struct
2175 unsigned : 1;
2176 unsigned : 1;
2177 unsigned NOT_W : 1;
2178 unsigned : 1;
2179 unsigned : 1;
2180 unsigned NOT_A : 1;
2181 unsigned : 1;
2182 unsigned : 1;
2185 struct
2187 unsigned : 1;
2188 unsigned : 1;
2189 unsigned NOT_WRITE : 1;
2190 unsigned : 1;
2191 unsigned : 1;
2192 unsigned NOT_ADDRESS : 1;
2193 unsigned : 1;
2194 unsigned : 1;
2197 struct
2199 unsigned : 1;
2200 unsigned : 1;
2201 unsigned READ_WRITE : 1;
2202 unsigned : 1;
2203 unsigned : 1;
2204 unsigned DATA_ADDRESS : 1;
2205 unsigned : 1;
2206 unsigned : 1;
2209 struct
2211 unsigned : 1;
2212 unsigned : 1;
2213 unsigned R : 1;
2214 unsigned : 1;
2215 unsigned : 1;
2216 unsigned D : 1;
2217 unsigned : 1;
2218 unsigned : 1;
2220 } __SSP1STATbits_t;
2222 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
2224 #define _BF 0x01
2225 #define _UA 0x02
2226 #define _R_NOT_W 0x04
2227 #define _R_W 0x04
2228 #define _I2C_READ 0x04
2229 #define _NOT_W 0x04
2230 #define _NOT_WRITE 0x04
2231 #define _READ_WRITE 0x04
2232 #define _R 0x04
2233 #define _S 0x08
2234 #define _I2C_START 0x08
2235 #define _P 0x10
2236 #define _I2C_STOP 0x10
2237 #define _D_NOT_A 0x20
2238 #define _D_A 0x20
2239 #define _I2C_DAT 0x20
2240 #define _NOT_A 0x20
2241 #define _NOT_ADDRESS 0x20
2242 #define _DATA_ADDRESS 0x20
2243 #define _D 0x20
2244 #define _CKE 0x40
2245 #define _SMP 0x80
2247 //==============================================================================
2250 //==============================================================================
2251 // SSPSTAT Bits
2253 extern __at(0x0FC7) __sfr SSPSTAT;
2255 typedef union
2257 struct
2259 unsigned BF : 1;
2260 unsigned UA : 1;
2261 unsigned R_NOT_W : 1;
2262 unsigned S : 1;
2263 unsigned P : 1;
2264 unsigned D_NOT_A : 1;
2265 unsigned CKE : 1;
2266 unsigned SMP : 1;
2269 struct
2271 unsigned : 1;
2272 unsigned : 1;
2273 unsigned R_W : 1;
2274 unsigned I2C_START : 1;
2275 unsigned I2C_STOP : 1;
2276 unsigned D_A : 1;
2277 unsigned : 1;
2278 unsigned : 1;
2281 struct
2283 unsigned : 1;
2284 unsigned : 1;
2285 unsigned I2C_READ : 1;
2286 unsigned : 1;
2287 unsigned : 1;
2288 unsigned I2C_DAT : 1;
2289 unsigned : 1;
2290 unsigned : 1;
2293 struct
2295 unsigned : 1;
2296 unsigned : 1;
2297 unsigned NOT_W : 1;
2298 unsigned : 1;
2299 unsigned : 1;
2300 unsigned NOT_A : 1;
2301 unsigned : 1;
2302 unsigned : 1;
2305 struct
2307 unsigned : 1;
2308 unsigned : 1;
2309 unsigned NOT_WRITE : 1;
2310 unsigned : 1;
2311 unsigned : 1;
2312 unsigned NOT_ADDRESS : 1;
2313 unsigned : 1;
2314 unsigned : 1;
2317 struct
2319 unsigned : 1;
2320 unsigned : 1;
2321 unsigned READ_WRITE : 1;
2322 unsigned : 1;
2323 unsigned : 1;
2324 unsigned DATA_ADDRESS : 1;
2325 unsigned : 1;
2326 unsigned : 1;
2329 struct
2331 unsigned : 1;
2332 unsigned : 1;
2333 unsigned R : 1;
2334 unsigned : 1;
2335 unsigned : 1;
2336 unsigned D : 1;
2337 unsigned : 1;
2338 unsigned : 1;
2340 } __SSPSTATbits_t;
2342 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
2344 #define _SSPSTAT_BF 0x01
2345 #define _SSPSTAT_UA 0x02
2346 #define _SSPSTAT_R_NOT_W 0x04
2347 #define _SSPSTAT_R_W 0x04
2348 #define _SSPSTAT_I2C_READ 0x04
2349 #define _SSPSTAT_NOT_W 0x04
2350 #define _SSPSTAT_NOT_WRITE 0x04
2351 #define _SSPSTAT_READ_WRITE 0x04
2352 #define _SSPSTAT_R 0x04
2353 #define _SSPSTAT_S 0x08
2354 #define _SSPSTAT_I2C_START 0x08
2355 #define _SSPSTAT_P 0x10
2356 #define _SSPSTAT_I2C_STOP 0x10
2357 #define _SSPSTAT_D_NOT_A 0x20
2358 #define _SSPSTAT_D_A 0x20
2359 #define _SSPSTAT_I2C_DAT 0x20
2360 #define _SSPSTAT_NOT_A 0x20
2361 #define _SSPSTAT_NOT_ADDRESS 0x20
2362 #define _SSPSTAT_DATA_ADDRESS 0x20
2363 #define _SSPSTAT_D 0x20
2364 #define _SSPSTAT_CKE 0x40
2365 #define _SSPSTAT_SMP 0x80
2367 //==============================================================================
2369 extern __at(0x0FC8) __sfr SSP1ADD;
2370 extern __at(0x0FC8) __sfr SSPADD;
2371 extern __at(0x0FC9) __sfr SSP1BUF;
2372 extern __at(0x0FC9) __sfr SSPBUF;
2374 //==============================================================================
2375 // T2CON Bits
2377 extern __at(0x0FCA) __sfr T2CON;
2379 typedef union
2381 struct
2383 unsigned T2CKPS0 : 1;
2384 unsigned T2CKPS1 : 1;
2385 unsigned TMR2ON : 1;
2386 unsigned T2OUTPS0 : 1;
2387 unsigned T2OUTPS1 : 1;
2388 unsigned T2OUTPS2 : 1;
2389 unsigned T2OUTPS3 : 1;
2390 unsigned : 1;
2393 struct
2395 unsigned : 1;
2396 unsigned : 1;
2397 unsigned : 1;
2398 unsigned TOUTPS0 : 1;
2399 unsigned TOUTPS1 : 1;
2400 unsigned TOUTPS2 : 1;
2401 unsigned TOUTPS3 : 1;
2402 unsigned : 1;
2405 struct
2407 unsigned T2CKPS : 2;
2408 unsigned : 6;
2411 struct
2413 unsigned : 3;
2414 unsigned T2OUTPS : 4;
2415 unsigned : 1;
2418 struct
2420 unsigned : 3;
2421 unsigned TOUTPS : 4;
2422 unsigned : 1;
2424 } __T2CONbits_t;
2426 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
2428 #define _T2CKPS0 0x01
2429 #define _T2CKPS1 0x02
2430 #define _TMR2ON 0x04
2431 #define _T2OUTPS0 0x08
2432 #define _TOUTPS0 0x08
2433 #define _T2OUTPS1 0x10
2434 #define _TOUTPS1 0x10
2435 #define _T2OUTPS2 0x20
2436 #define _TOUTPS2 0x20
2437 #define _T2OUTPS3 0x40
2438 #define _TOUTPS3 0x40
2440 //==============================================================================
2442 extern __at(0x0FCB) __sfr PR2;
2443 extern __at(0x0FCC) __sfr TMR2;
2445 //==============================================================================
2446 // T1CON Bits
2448 extern __at(0x0FCD) __sfr T1CON;
2450 typedef union
2452 struct
2454 unsigned TMR1ON : 1;
2455 unsigned TMR1CS : 1;
2456 unsigned NOT_T1SYNC : 1;
2457 unsigned T1OSCEN : 1;
2458 unsigned T1CKPS0 : 1;
2459 unsigned T1CKPS1 : 1;
2460 unsigned T1RUN : 1;
2461 unsigned RD16 : 1;
2464 struct
2466 unsigned : 1;
2467 unsigned : 1;
2468 unsigned T1SYNC : 1;
2469 unsigned : 1;
2470 unsigned : 1;
2471 unsigned : 1;
2472 unsigned : 1;
2473 unsigned : 1;
2476 struct
2478 unsigned : 1;
2479 unsigned : 1;
2480 unsigned T1INSYNC : 1;
2481 unsigned : 1;
2482 unsigned : 1;
2483 unsigned : 1;
2484 unsigned : 1;
2485 unsigned : 1;
2488 struct
2490 unsigned : 4;
2491 unsigned T1CKPS : 2;
2492 unsigned : 2;
2494 } __T1CONbits_t;
2496 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
2498 #define _TMR1ON 0x01
2499 #define _TMR1CS 0x02
2500 #define _NOT_T1SYNC 0x04
2501 #define _T1SYNC 0x04
2502 #define _T1INSYNC 0x04
2503 #define _T1OSCEN 0x08
2504 #define _T1CKPS0 0x10
2505 #define _T1CKPS1 0x20
2506 #define _T1RUN 0x40
2507 #define _RD16 0x80
2509 //==============================================================================
2511 extern __at(0x0FCE) __sfr TMR1;
2512 extern __at(0x0FCE) __sfr TMR1L;
2513 extern __at(0x0FCF) __sfr TMR1H;
2515 //==============================================================================
2516 // RCON Bits
2518 extern __at(0x0FD0) __sfr RCON;
2520 typedef union
2522 struct
2524 unsigned NOT_BOR : 1;
2525 unsigned NOT_POR : 1;
2526 unsigned NOT_PD : 1;
2527 unsigned NOT_TO : 1;
2528 unsigned NOT_RI : 1;
2529 unsigned : 1;
2530 unsigned : 1;
2531 unsigned IPEN : 1;
2534 struct
2536 unsigned BOR : 1;
2537 unsigned POR : 1;
2538 unsigned PD : 1;
2539 unsigned TO : 1;
2540 unsigned RI : 1;
2541 unsigned : 1;
2542 unsigned : 1;
2543 unsigned : 1;
2545 } __RCONbits_t;
2547 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
2549 #define _NOT_BOR 0x01
2550 #define _BOR 0x01
2551 #define _NOT_POR 0x02
2552 #define _POR 0x02
2553 #define _NOT_PD 0x04
2554 #define _PD 0x04
2555 #define _NOT_TO 0x08
2556 #define _TO 0x08
2557 #define _NOT_RI 0x10
2558 #define _RI 0x10
2559 #define _IPEN 0x80
2561 //==============================================================================
2564 //==============================================================================
2565 // WDTCON Bits
2567 extern __at(0x0FD1) __sfr WDTCON;
2569 typedef union
2571 struct
2573 unsigned SWDTEN : 1;
2574 unsigned : 1;
2575 unsigned : 1;
2576 unsigned : 1;
2577 unsigned : 1;
2578 unsigned : 1;
2579 unsigned : 1;
2580 unsigned : 1;
2583 struct
2585 unsigned SWDTE : 1;
2586 unsigned : 1;
2587 unsigned : 1;
2588 unsigned : 1;
2589 unsigned : 1;
2590 unsigned : 1;
2591 unsigned : 1;
2592 unsigned : 1;
2594 } __WDTCONbits_t;
2596 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
2598 #define _SWDTEN 0x01
2599 #define _SWDTE 0x01
2601 //==============================================================================
2604 //==============================================================================
2605 // OSCCON Bits
2607 extern __at(0x0FD3) __sfr OSCCON;
2609 typedef union
2611 struct
2613 unsigned SCS0 : 1;
2614 unsigned SCS1 : 1;
2615 unsigned : 1;
2616 unsigned OSTS : 1;
2617 unsigned : 1;
2618 unsigned : 1;
2619 unsigned : 1;
2620 unsigned IDLEN : 1;
2623 struct
2625 unsigned SCS : 2;
2626 unsigned : 6;
2628 } __OSCCONbits_t;
2630 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
2632 #define _SCS0 0x01
2633 #define _SCS1 0x02
2634 #define _OSTS 0x08
2635 #define _IDLEN 0x80
2637 //==============================================================================
2640 //==============================================================================
2641 // T0CON Bits
2643 extern __at(0x0FD5) __sfr T0CON;
2645 typedef union
2647 struct
2649 unsigned T0PS0 : 1;
2650 unsigned T0PS1 : 1;
2651 unsigned T0PS2 : 1;
2652 unsigned PSA : 1;
2653 unsigned T0SE : 1;
2654 unsigned T0CS : 1;
2655 unsigned T08BIT : 1;
2656 unsigned TMR0ON : 1;
2659 struct
2661 unsigned T0PS : 3;
2662 unsigned : 5;
2664 } __T0CONbits_t;
2666 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
2668 #define _T0PS0 0x01
2669 #define _T0PS1 0x02
2670 #define _T0PS2 0x04
2671 #define _PSA 0x08
2672 #define _T0SE 0x10
2673 #define _T0CS 0x20
2674 #define _T08BIT 0x40
2675 #define _TMR0ON 0x80
2677 //==============================================================================
2679 extern __at(0x0FD6) __sfr TMR0;
2680 extern __at(0x0FD6) __sfr TMR0L;
2681 extern __at(0x0FD7) __sfr TMR0H;
2683 //==============================================================================
2684 // STATUS Bits
2686 extern __at(0x0FD8) __sfr STATUS;
2688 typedef struct
2690 unsigned C : 1;
2691 unsigned DC : 1;
2692 unsigned Z : 1;
2693 unsigned OV : 1;
2694 unsigned N : 1;
2695 unsigned : 1;
2696 unsigned : 1;
2697 unsigned : 1;
2698 } __STATUSbits_t;
2700 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
2702 #define _C 0x01
2703 #define _DC 0x02
2704 #define _Z 0x04
2705 #define _OV 0x08
2706 #define _N 0x10
2708 //==============================================================================
2710 extern __at(0x0FD9) __sfr FSR2L;
2711 extern __at(0x0FDA) __sfr FSR2H;
2712 extern __at(0x0FDB) __sfr PLUSW2;
2713 extern __at(0x0FDC) __sfr PREINC2;
2714 extern __at(0x0FDD) __sfr POSTDEC2;
2715 extern __at(0x0FDE) __sfr POSTINC2;
2716 extern __at(0x0FDF) __sfr INDF2;
2717 extern __at(0x0FE0) __sfr BSR;
2718 extern __at(0x0FE1) __sfr FSR1L;
2719 extern __at(0x0FE2) __sfr FSR1H;
2720 extern __at(0x0FE3) __sfr PLUSW1;
2721 extern __at(0x0FE4) __sfr PREINC1;
2722 extern __at(0x0FE5) __sfr POSTDEC1;
2723 extern __at(0x0FE6) __sfr POSTINC1;
2724 extern __at(0x0FE7) __sfr INDF1;
2725 extern __at(0x0FE8) __sfr WREG;
2726 extern __at(0x0FE9) __sfr FSR0L;
2727 extern __at(0x0FEA) __sfr FSR0H;
2728 extern __at(0x0FEB) __sfr PLUSW0;
2729 extern __at(0x0FEC) __sfr PREINC0;
2730 extern __at(0x0FED) __sfr POSTDEC0;
2731 extern __at(0x0FEE) __sfr POSTINC0;
2732 extern __at(0x0FEF) __sfr INDF0;
2734 //==============================================================================
2735 // INTCON3 Bits
2737 extern __at(0x0FF0) __sfr INTCON3;
2739 typedef union
2741 struct
2743 unsigned INT1IF : 1;
2744 unsigned INT2IF : 1;
2745 unsigned : 1;
2746 unsigned INT1IE : 1;
2747 unsigned INT2IE : 1;
2748 unsigned : 1;
2749 unsigned INT1IP : 1;
2750 unsigned INT2IP : 1;
2753 struct
2755 unsigned INT1F : 1;
2756 unsigned INT2F : 1;
2757 unsigned : 1;
2758 unsigned INT1E : 1;
2759 unsigned INT2E : 1;
2760 unsigned : 1;
2761 unsigned INT1P : 1;
2762 unsigned INT2P : 1;
2764 } __INTCON3bits_t;
2766 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
2768 #define _INT1IF 0x01
2769 #define _INT1F 0x01
2770 #define _INT2IF 0x02
2771 #define _INT2F 0x02
2772 #define _INT1IE 0x08
2773 #define _INT1E 0x08
2774 #define _INT2IE 0x10
2775 #define _INT2E 0x10
2776 #define _INT1IP 0x40
2777 #define _INT1P 0x40
2778 #define _INT2IP 0x80
2779 #define _INT2P 0x80
2781 //==============================================================================
2784 //==============================================================================
2785 // INTCON2 Bits
2787 extern __at(0x0FF1) __sfr INTCON2;
2789 typedef union
2791 struct
2793 unsigned RBIP : 1;
2794 unsigned : 1;
2795 unsigned TMR0IP : 1;
2796 unsigned : 1;
2797 unsigned INTEDG2 : 1;
2798 unsigned INTEDG1 : 1;
2799 unsigned INTEDG0 : 1;
2800 unsigned NOT_RBPU : 1;
2803 struct
2805 unsigned : 1;
2806 unsigned : 1;
2807 unsigned T0IP : 1;
2808 unsigned : 1;
2809 unsigned : 1;
2810 unsigned : 1;
2811 unsigned : 1;
2812 unsigned RBPU : 1;
2814 } __INTCON2bits_t;
2816 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
2818 #define _RBIP 0x01
2819 #define _TMR0IP 0x04
2820 #define _T0IP 0x04
2821 #define _INTEDG2 0x10
2822 #define _INTEDG1 0x20
2823 #define _INTEDG0 0x40
2824 #define _NOT_RBPU 0x80
2825 #define _RBPU 0x80
2827 //==============================================================================
2830 //==============================================================================
2831 // INTCON Bits
2833 extern __at(0x0FF2) __sfr INTCON;
2835 typedef union
2837 struct
2839 unsigned RBIF : 1;
2840 unsigned INT0IF : 1;
2841 unsigned TMR0IF : 1;
2842 unsigned RBIE : 1;
2843 unsigned INT0IE : 1;
2844 unsigned TMR0IE : 1;
2845 unsigned PEIE_GIEL : 1;
2846 unsigned GIE_GIEH : 1;
2849 struct
2851 unsigned : 1;
2852 unsigned INT0F : 1;
2853 unsigned T0IF : 1;
2854 unsigned : 1;
2855 unsigned INT0E : 1;
2856 unsigned T0IE : 1;
2857 unsigned PEIE : 1;
2858 unsigned GIE : 1;
2861 struct
2863 unsigned : 1;
2864 unsigned : 1;
2865 unsigned : 1;
2866 unsigned : 1;
2867 unsigned : 1;
2868 unsigned : 1;
2869 unsigned GIEL : 1;
2870 unsigned GIEH : 1;
2872 } __INTCONbits_t;
2874 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
2876 #define _RBIF 0x01
2877 #define _INT0IF 0x02
2878 #define _INT0F 0x02
2879 #define _TMR0IF 0x04
2880 #define _T0IF 0x04
2881 #define _RBIE 0x08
2882 #define _INT0IE 0x10
2883 #define _INT0E 0x10
2884 #define _TMR0IE 0x20
2885 #define _T0IE 0x20
2886 #define _PEIE_GIEL 0x40
2887 #define _PEIE 0x40
2888 #define _GIEL 0x40
2889 #define _GIE_GIEH 0x80
2890 #define _GIE 0x80
2891 #define _GIEH 0x80
2893 //==============================================================================
2895 extern __at(0x0FF3) __sfr PROD;
2896 extern __at(0x0FF3) __sfr PRODL;
2897 extern __at(0x0FF4) __sfr PRODH;
2898 extern __at(0x0FF5) __sfr TABLAT;
2899 extern __at(0x0FF6) __sfr TBLPTR;
2900 extern __at(0x0FF6) __sfr TBLPTRL;
2901 extern __at(0x0FF7) __sfr TBLPTRH;
2902 extern __at(0x0FF8) __sfr TBLPTRU;
2903 extern __at(0x0FF9) __sfr PC;
2904 extern __at(0x0FF9) __sfr PCL;
2905 extern __at(0x0FFA) __sfr PCLATH;
2906 extern __at(0x0FFB) __sfr PCLATU;
2908 //==============================================================================
2909 // STKPTR Bits
2911 extern __at(0x0FFC) __sfr STKPTR;
2913 typedef union
2915 struct
2917 unsigned STKPTR0 : 1;
2918 unsigned STKPTR1 : 1;
2919 unsigned STKPTR2 : 1;
2920 unsigned STKPTR3 : 1;
2921 unsigned STKPTR4 : 1;
2922 unsigned : 1;
2923 unsigned STKUNF : 1;
2924 unsigned STKFUL : 1;
2927 struct
2929 unsigned : 1;
2930 unsigned : 1;
2931 unsigned : 1;
2932 unsigned : 1;
2933 unsigned : 1;
2934 unsigned : 1;
2935 unsigned : 1;
2936 unsigned STKOVF : 1;
2939 struct
2941 unsigned STKPTR : 5;
2942 unsigned : 3;
2944 } __STKPTRbits_t;
2946 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
2948 #define _STKPTR0 0x01
2949 #define _STKPTR1 0x02
2950 #define _STKPTR2 0x04
2951 #define _STKPTR3 0x08
2952 #define _STKPTR4 0x10
2953 #define _STKUNF 0x40
2954 #define _STKFUL 0x80
2955 #define _STKOVF 0x80
2957 //==============================================================================
2959 extern __at(0x0FFD) __sfr TOS;
2960 extern __at(0x0FFD) __sfr TOSL;
2961 extern __at(0x0FFE) __sfr TOSH;
2962 extern __at(0x0FFF) __sfr TOSU;
2964 //==============================================================================
2966 // Configuration Addresses
2968 //==============================================================================
2970 #define __CONFIG1L 0x003FF8
2971 #define __CONFIG1H 0x003FF9
2972 #define __CONFIG2L 0x003FFA
2973 #define __CONFIG2H 0x003FFB
2974 #define __CONFIG3L 0x003FFC
2975 #define __CONFIG3H 0x003FFD
2977 //==============================================================================
2979 #endif // #ifndef __PIC18LF24J10_H__