Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18lf4431.h
blob9737d59d8d67baf97ace779340e9326363e5e169
1 /*
2 * This declarations of the PIC18LF4431 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:03 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 __PIC18LF4431_H__
26 #define __PIC18LF4431_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // DFLTCON Bits
40 extern __at(0x0F60) __sfr DFLTCON;
42 typedef union
44 struct
46 unsigned FLTCK0 : 1;
47 unsigned FLTCK1 : 1;
48 unsigned FLTCK2 : 1;
49 unsigned FLT1EN : 1;
50 unsigned FLT2EN : 1;
51 unsigned FLT3EN : 1;
52 unsigned FLT4EN : 1;
53 unsigned : 1;
56 struct
58 unsigned FLTCK : 3;
59 unsigned : 5;
61 } __DFLTCONbits_t;
63 extern __at(0x0F60) volatile __DFLTCONbits_t DFLTCONbits;
65 #define _FLTCK0 0x01
66 #define _FLTCK1 0x02
67 #define _FLTCK2 0x04
68 #define _FLT1EN 0x08
69 #define _FLT2EN 0x10
70 #define _FLT3EN 0x20
71 #define _FLT4EN 0x40
73 //==============================================================================
76 //==============================================================================
77 // CAP3CON Bits
79 extern __at(0x0F61) __sfr CAP3CON;
81 typedef union
83 struct
85 unsigned CAP3M0 : 1;
86 unsigned CAP3M1 : 1;
87 unsigned CAP3M2 : 1;
88 unsigned CAP3M3 : 1;
89 unsigned : 1;
90 unsigned CAP3TMR : 1;
91 unsigned CAP3REN : 1;
92 unsigned : 1;
95 struct
97 unsigned CAP3M : 4;
98 unsigned : 4;
100 } __CAP3CONbits_t;
102 extern __at(0x0F61) volatile __CAP3CONbits_t CAP3CONbits;
104 #define _CAP3M0 0x01
105 #define _CAP3M1 0x02
106 #define _CAP3M2 0x04
107 #define _CAP3M3 0x08
108 #define _CAP3TMR 0x20
109 #define _CAP3REN 0x40
111 //==============================================================================
114 //==============================================================================
115 // CAP2CON Bits
117 extern __at(0x0F62) __sfr CAP2CON;
119 typedef union
121 struct
123 unsigned CAP2M0 : 1;
124 unsigned CAP2M1 : 1;
125 unsigned CAP2M2 : 1;
126 unsigned CAP2M3 : 1;
127 unsigned : 1;
128 unsigned CAP2TMR : 1;
129 unsigned CAP2REN : 1;
130 unsigned : 1;
133 struct
135 unsigned CAP2M : 4;
136 unsigned : 4;
138 } __CAP2CONbits_t;
140 extern __at(0x0F62) volatile __CAP2CONbits_t CAP2CONbits;
142 #define _CAP2M0 0x01
143 #define _CAP2M1 0x02
144 #define _CAP2M2 0x04
145 #define _CAP2M3 0x08
146 #define _CAP2TMR 0x20
147 #define _CAP2REN 0x40
149 //==============================================================================
152 //==============================================================================
153 // CAP1CON Bits
155 extern __at(0x0F63) __sfr CAP1CON;
157 typedef union
159 struct
161 unsigned CAP1M0 : 1;
162 unsigned CAP1M1 : 1;
163 unsigned CAP1M2 : 1;
164 unsigned CAP1M3 : 1;
165 unsigned : 1;
166 unsigned CAP1TMR : 1;
167 unsigned CAP1REN : 1;
168 unsigned : 1;
171 struct
173 unsigned CAP1M : 4;
174 unsigned : 4;
176 } __CAP1CONbits_t;
178 extern __at(0x0F63) volatile __CAP1CONbits_t CAP1CONbits;
180 #define _CAP1M0 0x01
181 #define _CAP1M1 0x02
182 #define _CAP1M2 0x04
183 #define _CAP1M3 0x08
184 #define _CAP1TMR 0x20
185 #define _CAP1REN 0x40
187 //==============================================================================
189 extern __at(0x0F64) __sfr CAP3BUFL;
190 extern __at(0x0F64) __sfr MAXCNTL;
191 extern __at(0x0F65) __sfr CAP3BUFH;
192 extern __at(0x0F65) __sfr MAXCNTH;
193 extern __at(0x0F66) __sfr CAP2BUFL;
194 extern __at(0x0F66) __sfr POSCNTL;
195 extern __at(0x0F67) __sfr CAP2BUFH;
196 extern __at(0x0F67) __sfr POSCNTH;
197 extern __at(0x0F68) __sfr CAP1BUFL;
198 extern __at(0x0F68) __sfr VELRL;
199 extern __at(0x0F69) __sfr CAP1BUFH;
200 extern __at(0x0F69) __sfr VELRH;
202 //==============================================================================
203 // OVDCONS Bits
205 extern __at(0x0F6A) __sfr OVDCONS;
207 typedef struct
209 unsigned POUT0 : 1;
210 unsigned POUT1 : 1;
211 unsigned POUT2 : 1;
212 unsigned POUT3 : 1;
213 unsigned POUT4 : 1;
214 unsigned POUT5 : 1;
215 unsigned POUT6 : 1;
216 unsigned POUT7 : 1;
217 } __OVDCONSbits_t;
219 extern __at(0x0F6A) volatile __OVDCONSbits_t OVDCONSbits;
221 #define _POUT0 0x01
222 #define _POUT1 0x02
223 #define _POUT2 0x04
224 #define _POUT3 0x08
225 #define _POUT4 0x10
226 #define _POUT5 0x20
227 #define _POUT6 0x40
228 #define _POUT7 0x80
230 //==============================================================================
233 //==============================================================================
234 // OVDCOND Bits
236 extern __at(0x0F6B) __sfr OVDCOND;
238 typedef struct
240 unsigned POVD0 : 1;
241 unsigned POVD1 : 1;
242 unsigned POVD2 : 1;
243 unsigned POVD3 : 1;
244 unsigned POVD4 : 1;
245 unsigned POVD5 : 1;
246 unsigned POVD6 : 1;
247 unsigned POVD7 : 1;
248 } __OVDCONDbits_t;
250 extern __at(0x0F6B) volatile __OVDCONDbits_t OVDCONDbits;
252 #define _POVD0 0x01
253 #define _POVD1 0x02
254 #define _POVD2 0x04
255 #define _POVD3 0x08
256 #define _POVD4 0x10
257 #define _POVD5 0x20
258 #define _POVD6 0x40
259 #define _POVD7 0x80
261 //==============================================================================
264 //==============================================================================
265 // FLTCONFIG Bits
267 extern __at(0x0F6C) __sfr FLTCONFIG;
269 typedef struct
271 unsigned FLTAEN : 1;
272 unsigned FLTAMOD : 1;
273 unsigned FLTAS : 1;
274 unsigned FLTCON : 1;
275 unsigned FLTBEN : 1;
276 unsigned FLTBMOD : 1;
277 unsigned FLTBS : 1;
278 unsigned BRFEN : 1;
279 } __FLTCONFIGbits_t;
281 extern __at(0x0F6C) volatile __FLTCONFIGbits_t FLTCONFIGbits;
283 #define _FLTAEN 0x01
284 #define _FLTAMOD 0x02
285 #define _FLTAS 0x04
286 #define _FLTCON 0x08
287 #define _FLTBEN 0x10
288 #define _FLTBMOD 0x20
289 #define _FLTBS 0x40
290 #define _BRFEN 0x80
292 //==============================================================================
295 //==============================================================================
296 // DTCON Bits
298 extern __at(0x0F6D) __sfr DTCON;
300 typedef union
302 struct
304 unsigned DT0 : 1;
305 unsigned DT1 : 1;
306 unsigned DT2 : 1;
307 unsigned DT3 : 1;
308 unsigned DT4 : 1;
309 unsigned DT5 : 1;
310 unsigned DTPS0 : 1;
311 unsigned DTPS1 : 1;
314 struct
316 unsigned DTA0 : 1;
317 unsigned DTA1 : 1;
318 unsigned DTA2 : 1;
319 unsigned DTA3 : 1;
320 unsigned DTA4 : 1;
321 unsigned DTA5 : 1;
322 unsigned DTAPS0 : 1;
323 unsigned DTAPS1 : 1;
326 struct
328 unsigned DTA : 6;
329 unsigned : 2;
332 struct
334 unsigned DT : 6;
335 unsigned : 2;
338 struct
340 unsigned : 6;
341 unsigned DTAPS : 2;
344 struct
346 unsigned : 6;
347 unsigned DTPS : 2;
349 } __DTCONbits_t;
351 extern __at(0x0F6D) volatile __DTCONbits_t DTCONbits;
353 #define _DT0 0x01
354 #define _DTA0 0x01
355 #define _DT1 0x02
356 #define _DTA1 0x02
357 #define _DT2 0x04
358 #define _DTA2 0x04
359 #define _DT3 0x08
360 #define _DTA3 0x08
361 #define _DT4 0x10
362 #define _DTA4 0x10
363 #define _DT5 0x20
364 #define _DTA5 0x20
365 #define _DTPS0 0x40
366 #define _DTAPS0 0x40
367 #define _DTPS1 0x80
368 #define _DTAPS1 0x80
370 //==============================================================================
373 //==============================================================================
374 // PWMCON1 Bits
376 extern __at(0x0F6E) __sfr PWMCON1;
378 typedef union
380 struct
382 unsigned OSYNC : 1;
383 unsigned UDIS : 1;
384 unsigned : 1;
385 unsigned SEVTDIR : 1;
386 unsigned SEVOPS0 : 1;
387 unsigned SEVOPS1 : 1;
388 unsigned SEVOPS2 : 1;
389 unsigned SEVOPS3 : 1;
392 struct
394 unsigned : 4;
395 unsigned SEVOPS : 4;
397 } __PWMCON1bits_t;
399 extern __at(0x0F6E) volatile __PWMCON1bits_t PWMCON1bits;
401 #define _OSYNC 0x01
402 #define _UDIS 0x02
403 #define _SEVTDIR 0x08
404 #define _SEVOPS0 0x10
405 #define _SEVOPS1 0x20
406 #define _SEVOPS2 0x40
407 #define _SEVOPS3 0x80
409 //==============================================================================
412 //==============================================================================
413 // PWMCON0 Bits
415 extern __at(0x0F6F) __sfr PWMCON0;
417 typedef union
419 struct
421 unsigned PMOD0 : 1;
422 unsigned PMOD1 : 1;
423 unsigned PMOD2 : 1;
424 unsigned PMOD3 : 1;
425 unsigned PWMEN0 : 1;
426 unsigned PWMEN1 : 1;
427 unsigned PWMEN2 : 1;
428 unsigned : 1;
431 struct
433 unsigned PMOD : 4;
434 unsigned : 4;
437 struct
439 unsigned : 4;
440 unsigned PWMEN : 3;
441 unsigned : 1;
443 } __PWMCON0bits_t;
445 extern __at(0x0F6F) volatile __PWMCON0bits_t PWMCON0bits;
447 #define _PMOD0 0x01
448 #define _PMOD1 0x02
449 #define _PMOD2 0x04
450 #define _PMOD3 0x08
451 #define _PWMEN0 0x10
452 #define _PWMEN1 0x20
453 #define _PWMEN2 0x40
455 //==============================================================================
457 extern __at(0x0F70) __sfr SEVTCMPH;
458 extern __at(0x0F71) __sfr SEVTCMPL;
459 extern __at(0x0F72) __sfr PDC3H;
460 extern __at(0x0F73) __sfr PDC3L;
461 extern __at(0x0F74) __sfr PDC2H;
462 extern __at(0x0F75) __sfr PDC2L;
463 extern __at(0x0F76) __sfr PDC1H;
464 extern __at(0x0F77) __sfr PDC1L;
465 extern __at(0x0F78) __sfr PDC0H;
466 extern __at(0x0F79) __sfr PDC0L;
467 extern __at(0x0F7A) __sfr PTPERH;
468 extern __at(0x0F7B) __sfr PTPERL;
469 extern __at(0x0F7C) __sfr PTMRH;
470 extern __at(0x0F7D) __sfr PTMRL;
472 //==============================================================================
473 // PTCON1 Bits
475 extern __at(0x0F7E) __sfr PTCON1;
477 typedef struct
479 unsigned : 1;
480 unsigned : 1;
481 unsigned : 1;
482 unsigned : 1;
483 unsigned : 1;
484 unsigned : 1;
485 unsigned PTDIR : 1;
486 unsigned PTEN : 1;
487 } __PTCON1bits_t;
489 extern __at(0x0F7E) volatile __PTCON1bits_t PTCON1bits;
491 #define _PTDIR 0x40
492 #define _PTEN 0x80
494 //==============================================================================
497 //==============================================================================
498 // PTCON0 Bits
500 extern __at(0x0F7F) __sfr PTCON0;
502 typedef union
504 struct
506 unsigned PTMOD0 : 1;
507 unsigned PTMOD1 : 1;
508 unsigned PTCKPS0 : 1;
509 unsigned PTCKPS1 : 1;
510 unsigned PTOPS0 : 1;
511 unsigned PTOPS1 : 1;
512 unsigned PTOPS2 : 1;
513 unsigned PTOPS3 : 1;
516 struct
518 unsigned PTMOD : 2;
519 unsigned : 6;
522 struct
524 unsigned : 2;
525 unsigned PTCKPS : 2;
526 unsigned : 4;
529 struct
531 unsigned : 4;
532 unsigned PTOPS : 4;
534 } __PTCON0bits_t;
536 extern __at(0x0F7F) volatile __PTCON0bits_t PTCON0bits;
538 #define _PTMOD0 0x01
539 #define _PTMOD1 0x02
540 #define _PTCKPS0 0x04
541 #define _PTCKPS1 0x08
542 #define _PTOPS0 0x10
543 #define _PTOPS1 0x20
544 #define _PTOPS2 0x40
545 #define _PTOPS3 0x80
547 //==============================================================================
550 //==============================================================================
551 // PORTA Bits
553 extern __at(0x0F80) __sfr PORTA;
555 typedef union
557 struct
559 unsigned RA0 : 1;
560 unsigned RA1 : 1;
561 unsigned RA2 : 1;
562 unsigned RA3 : 1;
563 unsigned RA4 : 1;
564 unsigned RA5 : 1;
565 unsigned RA6 : 1;
566 unsigned RA7 : 1;
569 struct
571 unsigned AN0 : 1;
572 unsigned AN1 : 1;
573 unsigned AN2 : 1;
574 unsigned AN3 : 1;
575 unsigned AN4 : 1;
576 unsigned AN5 : 1;
577 unsigned OSC2 : 1;
578 unsigned OSC1 : 1;
581 struct
583 unsigned : 1;
584 unsigned : 1;
585 unsigned VREFM : 1;
586 unsigned VREFP : 1;
587 unsigned : 1;
588 unsigned LVDIN : 1;
589 unsigned CLKO : 1;
590 unsigned CLKI : 1;
593 struct
595 unsigned AN : 6;
596 unsigned : 2;
598 } __PORTAbits_t;
600 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
602 #define _PORTA_RA0 0x01
603 #define _PORTA_AN0 0x01
604 #define _PORTA_RA1 0x02
605 #define _PORTA_AN1 0x02
606 #define _PORTA_RA2 0x04
607 #define _PORTA_AN2 0x04
608 #define _PORTA_VREFM 0x04
609 #define _PORTA_RA3 0x08
610 #define _PORTA_AN3 0x08
611 #define _PORTA_VREFP 0x08
612 #define _PORTA_RA4 0x10
613 #define _PORTA_AN4 0x10
614 #define _PORTA_RA5 0x20
615 #define _PORTA_AN5 0x20
616 #define _PORTA_LVDIN 0x20
617 #define _PORTA_RA6 0x40
618 #define _PORTA_OSC2 0x40
619 #define _PORTA_CLKO 0x40
620 #define _PORTA_RA7 0x80
621 #define _PORTA_OSC1 0x80
622 #define _PORTA_CLKI 0x80
624 //==============================================================================
627 //==============================================================================
628 // PORTB Bits
630 extern __at(0x0F81) __sfr PORTB;
632 typedef struct
634 unsigned RB0 : 1;
635 unsigned RB1 : 1;
636 unsigned RB2 : 1;
637 unsigned RB3 : 1;
638 unsigned RB4 : 1;
639 unsigned RB5 : 1;
640 unsigned RB6 : 1;
641 unsigned RB7 : 1;
642 } __PORTBbits_t;
644 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
646 #define _PORTB_RB0 0x01
647 #define _PORTB_RB1 0x02
648 #define _PORTB_RB2 0x04
649 #define _PORTB_RB3 0x08
650 #define _PORTB_RB4 0x10
651 #define _PORTB_RB5 0x20
652 #define _PORTB_RB6 0x40
653 #define _PORTB_RB7 0x80
655 //==============================================================================
658 //==============================================================================
659 // PORTC Bits
661 extern __at(0x0F82) __sfr PORTC;
663 typedef union
665 struct
667 unsigned RC0 : 1;
668 unsigned RC1 : 1;
669 unsigned RC2 : 1;
670 unsigned RC3 : 1;
671 unsigned RC4 : 1;
672 unsigned RC5 : 1;
673 unsigned RC6 : 1;
674 unsigned RC7 : 1;
677 struct
679 unsigned T1OSO : 1;
680 unsigned T1OSI : 1;
681 unsigned CCP1 : 1;
682 unsigned INT0 : 1;
683 unsigned INT1 : 1;
684 unsigned INT2 : 1;
685 unsigned TX : 1;
686 unsigned RX : 1;
689 struct
691 unsigned T13CKI : 1;
692 unsigned CCP2 : 1;
693 unsigned NOT_FLTB : 1;
694 unsigned T0CKI : 1;
695 unsigned SDA : 1;
696 unsigned SCK : 1;
697 unsigned CK : 1;
698 unsigned SDO : 1;
701 struct
703 unsigned : 1;
704 unsigned NOT_FLTA : 1;
705 unsigned FLTB : 1;
706 unsigned T5CKI : 1;
707 unsigned SDI : 1;
708 unsigned SCL : 1;
709 unsigned NOT_SS : 1;
710 unsigned : 1;
713 struct
715 unsigned : 1;
716 unsigned FLTA : 1;
717 unsigned : 1;
718 unsigned : 1;
719 unsigned : 1;
720 unsigned : 1;
721 unsigned SS : 1;
722 unsigned : 1;
725 struct
727 unsigned : 3;
728 unsigned INT : 3;
729 unsigned : 2;
731 } __PORTCbits_t;
733 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
735 #define _PORTC_RC0 0x01
736 #define _PORTC_T1OSO 0x01
737 #define _PORTC_T13CKI 0x01
738 #define _PORTC_RC1 0x02
739 #define _PORTC_T1OSI 0x02
740 #define _PORTC_CCP2 0x02
741 #define _PORTC_NOT_FLTA 0x02
742 #define _PORTC_FLTA 0x02
743 #define _PORTC_RC2 0x04
744 #define _PORTC_CCP1 0x04
745 #define _PORTC_NOT_FLTB 0x04
746 #define _PORTC_FLTB 0x04
747 #define _PORTC_RC3 0x08
748 #define _PORTC_INT0 0x08
749 #define _PORTC_T0CKI 0x08
750 #define _PORTC_T5CKI 0x08
751 #define _PORTC_RC4 0x10
752 #define _PORTC_INT1 0x10
753 #define _PORTC_SDA 0x10
754 #define _PORTC_SDI 0x10
755 #define _PORTC_RC5 0x20
756 #define _PORTC_INT2 0x20
757 #define _PORTC_SCK 0x20
758 #define _PORTC_SCL 0x20
759 #define _PORTC_RC6 0x40
760 #define _PORTC_TX 0x40
761 #define _PORTC_CK 0x40
762 #define _PORTC_NOT_SS 0x40
763 #define _PORTC_SS 0x40
764 #define _PORTC_RC7 0x80
765 #define _PORTC_RX 0x80
766 #define _PORTC_SDO 0x80
768 //==============================================================================
771 //==============================================================================
772 // PORTD Bits
774 extern __at(0x0F83) __sfr PORTD;
776 typedef struct
778 unsigned RD0 : 1;
779 unsigned RD1 : 1;
780 unsigned RD2 : 1;
781 unsigned RD3 : 1;
782 unsigned RD4 : 1;
783 unsigned RD5 : 1;
784 unsigned RD6 : 1;
785 unsigned RD7 : 1;
786 } __PORTDbits_t;
788 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
790 #define _PORTD_RD0 0x01
791 #define _PORTD_RD1 0x02
792 #define _PORTD_RD2 0x04
793 #define _PORTD_RD3 0x08
794 #define _PORTD_RD4 0x10
795 #define _PORTD_RD5 0x20
796 #define _PORTD_RD6 0x40
797 #define _PORTD_RD7 0x80
799 //==============================================================================
802 //==============================================================================
803 // PORTE Bits
805 extern __at(0x0F84) __sfr PORTE;
807 typedef union
809 struct
811 unsigned RE0 : 1;
812 unsigned RE1 : 1;
813 unsigned RE2 : 1;
814 unsigned RE3 : 1;
815 unsigned : 1;
816 unsigned : 1;
817 unsigned : 1;
818 unsigned : 1;
821 struct
823 unsigned : 1;
824 unsigned : 1;
825 unsigned : 1;
826 unsigned NOT_MCLR : 1;
827 unsigned : 1;
828 unsigned : 1;
829 unsigned : 1;
830 unsigned : 1;
833 struct
835 unsigned : 1;
836 unsigned : 1;
837 unsigned : 1;
838 unsigned MCLR : 1;
839 unsigned : 1;
840 unsigned : 1;
841 unsigned : 1;
842 unsigned : 1;
845 struct
847 unsigned RE : 4;
848 unsigned : 4;
850 } __PORTEbits_t;
852 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
854 #define _PORTE_RE0 0x01
855 #define _PORTE_RE1 0x02
856 #define _PORTE_RE2 0x04
857 #define _PORTE_RE3 0x08
858 #define _PORTE_NOT_MCLR 0x08
859 #define _PORTE_MCLR 0x08
861 //==============================================================================
863 extern __at(0x0F87) __sfr TMR5;
864 extern __at(0x0F87) __sfr TMR5L;
865 extern __at(0x0F88) __sfr TMR5H;
867 //==============================================================================
868 // LATA Bits
870 extern __at(0x0F89) __sfr LATA;
872 typedef struct
874 unsigned LATA0 : 1;
875 unsigned LATA1 : 1;
876 unsigned LATA2 : 1;
877 unsigned LATA3 : 1;
878 unsigned LATA4 : 1;
879 unsigned LATA5 : 1;
880 unsigned LATA6 : 1;
881 unsigned LATA7 : 1;
882 } __LATAbits_t;
884 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
886 #define _LATA0 0x01
887 #define _LATA1 0x02
888 #define _LATA2 0x04
889 #define _LATA3 0x08
890 #define _LATA4 0x10
891 #define _LATA5 0x20
892 #define _LATA6 0x40
893 #define _LATA7 0x80
895 //==============================================================================
898 //==============================================================================
899 // LATB Bits
901 extern __at(0x0F8A) __sfr LATB;
903 typedef struct
905 unsigned LATB0 : 1;
906 unsigned LATB1 : 1;
907 unsigned LATB2 : 1;
908 unsigned LATB3 : 1;
909 unsigned LATB4 : 1;
910 unsigned LATB5 : 1;
911 unsigned LATB6 : 1;
912 unsigned LATB7 : 1;
913 } __LATBbits_t;
915 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
917 #define _LATB0 0x01
918 #define _LATB1 0x02
919 #define _LATB2 0x04
920 #define _LATB3 0x08
921 #define _LATB4 0x10
922 #define _LATB5 0x20
923 #define _LATB6 0x40
924 #define _LATB7 0x80
926 //==============================================================================
929 //==============================================================================
930 // LATC Bits
932 extern __at(0x0F8B) __sfr LATC;
934 typedef struct
936 unsigned LATC0 : 1;
937 unsigned LATC1 : 1;
938 unsigned LATC2 : 1;
939 unsigned LATC3 : 1;
940 unsigned LATC4 : 1;
941 unsigned LATC5 : 1;
942 unsigned LATC6 : 1;
943 unsigned LATC7 : 1;
944 } __LATCbits_t;
946 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
948 #define _LATC0 0x01
949 #define _LATC1 0x02
950 #define _LATC2 0x04
951 #define _LATC3 0x08
952 #define _LATC4 0x10
953 #define _LATC5 0x20
954 #define _LATC6 0x40
955 #define _LATC7 0x80
957 //==============================================================================
960 //==============================================================================
961 // LATD Bits
963 extern __at(0x0F8C) __sfr LATD;
965 typedef struct
967 unsigned LATD0 : 1;
968 unsigned LATD1 : 1;
969 unsigned LATD2 : 1;
970 unsigned LATD3 : 1;
971 unsigned LATD4 : 1;
972 unsigned LATD5 : 1;
973 unsigned LATD6 : 1;
974 unsigned LATD7 : 1;
975 } __LATDbits_t;
977 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
979 #define _LATD0 0x01
980 #define _LATD1 0x02
981 #define _LATD2 0x04
982 #define _LATD3 0x08
983 #define _LATD4 0x10
984 #define _LATD5 0x20
985 #define _LATD6 0x40
986 #define _LATD7 0x80
988 //==============================================================================
991 //==============================================================================
992 // LATE Bits
994 extern __at(0x0F8D) __sfr LATE;
996 typedef union
998 struct
1000 unsigned LATE0 : 1;
1001 unsigned LATE1 : 1;
1002 unsigned LATE2 : 1;
1003 unsigned : 1;
1004 unsigned : 1;
1005 unsigned : 1;
1006 unsigned : 1;
1007 unsigned : 1;
1010 struct
1012 unsigned LATE : 3;
1013 unsigned : 5;
1015 } __LATEbits_t;
1017 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1019 #define _LATE0 0x01
1020 #define _LATE1 0x02
1021 #define _LATE2 0x04
1023 //==============================================================================
1025 extern __at(0x0F90) __sfr PR5;
1026 extern __at(0x0F90) __sfr PR5L;
1027 extern __at(0x0F91) __sfr PR5H;
1029 //==============================================================================
1030 // DDRA Bits
1032 extern __at(0x0F92) __sfr DDRA;
1034 typedef union
1036 struct
1038 unsigned TRISA0 : 1;
1039 unsigned TRISA1 : 1;
1040 unsigned TRISA2 : 1;
1041 unsigned TRISA3 : 1;
1042 unsigned TRISA4 : 1;
1043 unsigned TRISA5 : 1;
1044 unsigned TRISA6 : 1;
1045 unsigned TRISA7 : 1;
1048 struct
1050 unsigned RA0 : 1;
1051 unsigned RA1 : 1;
1052 unsigned RA2 : 1;
1053 unsigned RA3 : 1;
1054 unsigned RA4 : 1;
1055 unsigned RA5 : 1;
1056 unsigned RA6 : 1;
1057 unsigned RA7 : 1;
1059 } __DDRAbits_t;
1061 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1063 #define _TRISA0 0x01
1064 #define _RA0 0x01
1065 #define _TRISA1 0x02
1066 #define _RA1 0x02
1067 #define _TRISA2 0x04
1068 #define _RA2 0x04
1069 #define _TRISA3 0x08
1070 #define _RA3 0x08
1071 #define _TRISA4 0x10
1072 #define _RA4 0x10
1073 #define _TRISA5 0x20
1074 #define _RA5 0x20
1075 #define _TRISA6 0x40
1076 #define _RA6 0x40
1077 #define _TRISA7 0x80
1078 #define _RA7 0x80
1080 //==============================================================================
1083 //==============================================================================
1084 // TRISA Bits
1086 extern __at(0x0F92) __sfr TRISA;
1088 typedef union
1090 struct
1092 unsigned TRISA0 : 1;
1093 unsigned TRISA1 : 1;
1094 unsigned TRISA2 : 1;
1095 unsigned TRISA3 : 1;
1096 unsigned TRISA4 : 1;
1097 unsigned TRISA5 : 1;
1098 unsigned TRISA6 : 1;
1099 unsigned TRISA7 : 1;
1102 struct
1104 unsigned RA0 : 1;
1105 unsigned RA1 : 1;
1106 unsigned RA2 : 1;
1107 unsigned RA3 : 1;
1108 unsigned RA4 : 1;
1109 unsigned RA5 : 1;
1110 unsigned RA6 : 1;
1111 unsigned RA7 : 1;
1113 } __TRISAbits_t;
1115 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1117 #define _TRISA_TRISA0 0x01
1118 #define _TRISA_RA0 0x01
1119 #define _TRISA_TRISA1 0x02
1120 #define _TRISA_RA1 0x02
1121 #define _TRISA_TRISA2 0x04
1122 #define _TRISA_RA2 0x04
1123 #define _TRISA_TRISA3 0x08
1124 #define _TRISA_RA3 0x08
1125 #define _TRISA_TRISA4 0x10
1126 #define _TRISA_RA4 0x10
1127 #define _TRISA_TRISA5 0x20
1128 #define _TRISA_RA5 0x20
1129 #define _TRISA_TRISA6 0x40
1130 #define _TRISA_RA6 0x40
1131 #define _TRISA_TRISA7 0x80
1132 #define _TRISA_RA7 0x80
1134 //==============================================================================
1137 //==============================================================================
1138 // DDRB Bits
1140 extern __at(0x0F93) __sfr DDRB;
1142 typedef union
1144 struct
1146 unsigned TRISB0 : 1;
1147 unsigned TRISB1 : 1;
1148 unsigned TRISB2 : 1;
1149 unsigned TRISB3 : 1;
1150 unsigned TRISB4 : 1;
1151 unsigned TRISB5 : 1;
1152 unsigned TRISB6 : 1;
1153 unsigned TRISB7 : 1;
1156 struct
1158 unsigned RB0 : 1;
1159 unsigned RB1 : 1;
1160 unsigned RB2 : 1;
1161 unsigned RB3 : 1;
1162 unsigned RB4 : 1;
1163 unsigned RB5 : 1;
1164 unsigned RB6 : 1;
1165 unsigned RB7 : 1;
1167 } __DDRBbits_t;
1169 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1171 #define _TRISB0 0x01
1172 #define _RB0 0x01
1173 #define _TRISB1 0x02
1174 #define _RB1 0x02
1175 #define _TRISB2 0x04
1176 #define _RB2 0x04
1177 #define _TRISB3 0x08
1178 #define _RB3 0x08
1179 #define _TRISB4 0x10
1180 #define _RB4 0x10
1181 #define _TRISB5 0x20
1182 #define _RB5 0x20
1183 #define _TRISB6 0x40
1184 #define _RB6 0x40
1185 #define _TRISB7 0x80
1186 #define _RB7 0x80
1188 //==============================================================================
1191 //==============================================================================
1192 // TRISB Bits
1194 extern __at(0x0F93) __sfr TRISB;
1196 typedef union
1198 struct
1200 unsigned TRISB0 : 1;
1201 unsigned TRISB1 : 1;
1202 unsigned TRISB2 : 1;
1203 unsigned TRISB3 : 1;
1204 unsigned TRISB4 : 1;
1205 unsigned TRISB5 : 1;
1206 unsigned TRISB6 : 1;
1207 unsigned TRISB7 : 1;
1210 struct
1212 unsigned RB0 : 1;
1213 unsigned RB1 : 1;
1214 unsigned RB2 : 1;
1215 unsigned RB3 : 1;
1216 unsigned RB4 : 1;
1217 unsigned RB5 : 1;
1218 unsigned RB6 : 1;
1219 unsigned RB7 : 1;
1221 } __TRISBbits_t;
1223 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1225 #define _TRISB_TRISB0 0x01
1226 #define _TRISB_RB0 0x01
1227 #define _TRISB_TRISB1 0x02
1228 #define _TRISB_RB1 0x02
1229 #define _TRISB_TRISB2 0x04
1230 #define _TRISB_RB2 0x04
1231 #define _TRISB_TRISB3 0x08
1232 #define _TRISB_RB3 0x08
1233 #define _TRISB_TRISB4 0x10
1234 #define _TRISB_RB4 0x10
1235 #define _TRISB_TRISB5 0x20
1236 #define _TRISB_RB5 0x20
1237 #define _TRISB_TRISB6 0x40
1238 #define _TRISB_RB6 0x40
1239 #define _TRISB_TRISB7 0x80
1240 #define _TRISB_RB7 0x80
1242 //==============================================================================
1245 //==============================================================================
1246 // DDRC Bits
1248 extern __at(0x0F94) __sfr DDRC;
1250 typedef union
1252 struct
1254 unsigned TRISC0 : 1;
1255 unsigned TRISC1 : 1;
1256 unsigned TRISC2 : 1;
1257 unsigned TRISC3 : 1;
1258 unsigned TRISC4 : 1;
1259 unsigned TRISC5 : 1;
1260 unsigned TRISC6 : 1;
1261 unsigned TRISC7 : 1;
1264 struct
1266 unsigned RC0 : 1;
1267 unsigned RC1 : 1;
1268 unsigned RC2 : 1;
1269 unsigned RC3 : 1;
1270 unsigned RC4 : 1;
1271 unsigned RC5 : 1;
1272 unsigned RC6 : 1;
1273 unsigned RC7 : 1;
1275 } __DDRCbits_t;
1277 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1279 #define _TRISC0 0x01
1280 #define _RC0 0x01
1281 #define _TRISC1 0x02
1282 #define _RC1 0x02
1283 #define _TRISC2 0x04
1284 #define _RC2 0x04
1285 #define _TRISC3 0x08
1286 #define _RC3 0x08
1287 #define _TRISC4 0x10
1288 #define _RC4 0x10
1289 #define _TRISC5 0x20
1290 #define _RC5 0x20
1291 #define _TRISC6 0x40
1292 #define _RC6 0x40
1293 #define _TRISC7 0x80
1294 #define _RC7 0x80
1296 //==============================================================================
1299 //==============================================================================
1300 // TRISC Bits
1302 extern __at(0x0F94) __sfr TRISC;
1304 typedef union
1306 struct
1308 unsigned TRISC0 : 1;
1309 unsigned TRISC1 : 1;
1310 unsigned TRISC2 : 1;
1311 unsigned TRISC3 : 1;
1312 unsigned TRISC4 : 1;
1313 unsigned TRISC5 : 1;
1314 unsigned TRISC6 : 1;
1315 unsigned TRISC7 : 1;
1318 struct
1320 unsigned RC0 : 1;
1321 unsigned RC1 : 1;
1322 unsigned RC2 : 1;
1323 unsigned RC3 : 1;
1324 unsigned RC4 : 1;
1325 unsigned RC5 : 1;
1326 unsigned RC6 : 1;
1327 unsigned RC7 : 1;
1329 } __TRISCbits_t;
1331 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1333 #define _TRISC_TRISC0 0x01
1334 #define _TRISC_RC0 0x01
1335 #define _TRISC_TRISC1 0x02
1336 #define _TRISC_RC1 0x02
1337 #define _TRISC_TRISC2 0x04
1338 #define _TRISC_RC2 0x04
1339 #define _TRISC_TRISC3 0x08
1340 #define _TRISC_RC3 0x08
1341 #define _TRISC_TRISC4 0x10
1342 #define _TRISC_RC4 0x10
1343 #define _TRISC_TRISC5 0x20
1344 #define _TRISC_RC5 0x20
1345 #define _TRISC_TRISC6 0x40
1346 #define _TRISC_RC6 0x40
1347 #define _TRISC_TRISC7 0x80
1348 #define _TRISC_RC7 0x80
1350 //==============================================================================
1353 //==============================================================================
1354 // DDRD Bits
1356 extern __at(0x0F95) __sfr DDRD;
1358 typedef union
1360 struct
1362 unsigned TRISD0 : 1;
1363 unsigned TRISD1 : 1;
1364 unsigned TRISD2 : 1;
1365 unsigned TRISD3 : 1;
1366 unsigned TRISD4 : 1;
1367 unsigned TRISD5 : 1;
1368 unsigned TRISD6 : 1;
1369 unsigned TRISD7 : 1;
1372 struct
1374 unsigned RD0 : 1;
1375 unsigned RD1 : 1;
1376 unsigned RD2 : 1;
1377 unsigned RD3 : 1;
1378 unsigned RD4 : 1;
1379 unsigned RD5 : 1;
1380 unsigned RD6 : 1;
1381 unsigned RD7 : 1;
1383 } __DDRDbits_t;
1385 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
1387 #define _TRISD0 0x01
1388 #define _RD0 0x01
1389 #define _TRISD1 0x02
1390 #define _RD1 0x02
1391 #define _TRISD2 0x04
1392 #define _RD2 0x04
1393 #define _TRISD3 0x08
1394 #define _RD3 0x08
1395 #define _TRISD4 0x10
1396 #define _RD4 0x10
1397 #define _TRISD5 0x20
1398 #define _RD5 0x20
1399 #define _TRISD6 0x40
1400 #define _RD6 0x40
1401 #define _TRISD7 0x80
1402 #define _RD7 0x80
1404 //==============================================================================
1407 //==============================================================================
1408 // TRISD Bits
1410 extern __at(0x0F95) __sfr TRISD;
1412 typedef union
1414 struct
1416 unsigned TRISD0 : 1;
1417 unsigned TRISD1 : 1;
1418 unsigned TRISD2 : 1;
1419 unsigned TRISD3 : 1;
1420 unsigned TRISD4 : 1;
1421 unsigned TRISD5 : 1;
1422 unsigned TRISD6 : 1;
1423 unsigned TRISD7 : 1;
1426 struct
1428 unsigned RD0 : 1;
1429 unsigned RD1 : 1;
1430 unsigned RD2 : 1;
1431 unsigned RD3 : 1;
1432 unsigned RD4 : 1;
1433 unsigned RD5 : 1;
1434 unsigned RD6 : 1;
1435 unsigned RD7 : 1;
1437 } __TRISDbits_t;
1439 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
1441 #define _TRISD_TRISD0 0x01
1442 #define _TRISD_RD0 0x01
1443 #define _TRISD_TRISD1 0x02
1444 #define _TRISD_RD1 0x02
1445 #define _TRISD_TRISD2 0x04
1446 #define _TRISD_RD2 0x04
1447 #define _TRISD_TRISD3 0x08
1448 #define _TRISD_RD3 0x08
1449 #define _TRISD_TRISD4 0x10
1450 #define _TRISD_RD4 0x10
1451 #define _TRISD_TRISD5 0x20
1452 #define _TRISD_RD5 0x20
1453 #define _TRISD_TRISD6 0x40
1454 #define _TRISD_RD6 0x40
1455 #define _TRISD_TRISD7 0x80
1456 #define _TRISD_RD7 0x80
1458 //==============================================================================
1461 //==============================================================================
1462 // DDRE Bits
1464 extern __at(0x0F96) __sfr DDRE;
1466 typedef union
1468 struct
1470 unsigned TRISE0 : 1;
1471 unsigned TRISE1 : 1;
1472 unsigned TRISE2 : 1;
1473 unsigned : 1;
1474 unsigned : 1;
1475 unsigned : 1;
1476 unsigned : 1;
1477 unsigned : 1;
1480 struct
1482 unsigned RE0 : 1;
1483 unsigned RE1 : 1;
1484 unsigned RE2 : 1;
1485 unsigned : 1;
1486 unsigned : 1;
1487 unsigned : 1;
1488 unsigned : 1;
1489 unsigned : 1;
1492 struct
1494 unsigned RE : 3;
1495 unsigned : 5;
1498 struct
1500 unsigned TRISE : 3;
1501 unsigned : 5;
1503 } __DDREbits_t;
1505 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
1507 #define _TRISE0 0x01
1508 #define _RE0 0x01
1509 #define _TRISE1 0x02
1510 #define _RE1 0x02
1511 #define _TRISE2 0x04
1512 #define _RE2 0x04
1514 //==============================================================================
1517 //==============================================================================
1518 // TRISE Bits
1520 extern __at(0x0F96) __sfr TRISE;
1522 typedef union
1524 struct
1526 unsigned TRISE0 : 1;
1527 unsigned TRISE1 : 1;
1528 unsigned TRISE2 : 1;
1529 unsigned : 1;
1530 unsigned : 1;
1531 unsigned : 1;
1532 unsigned : 1;
1533 unsigned : 1;
1536 struct
1538 unsigned RE0 : 1;
1539 unsigned RE1 : 1;
1540 unsigned RE2 : 1;
1541 unsigned : 1;
1542 unsigned : 1;
1543 unsigned : 1;
1544 unsigned : 1;
1545 unsigned : 1;
1548 struct
1550 unsigned TRISE : 3;
1551 unsigned : 5;
1554 struct
1556 unsigned RE : 3;
1557 unsigned : 5;
1559 } __TRISEbits_t;
1561 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
1563 #define _TRISE_TRISE0 0x01
1564 #define _TRISE_RE0 0x01
1565 #define _TRISE_TRISE1 0x02
1566 #define _TRISE_RE1 0x02
1567 #define _TRISE_TRISE2 0x04
1568 #define _TRISE_RE2 0x04
1570 //==============================================================================
1573 //==============================================================================
1574 // ADCHS Bits
1576 extern __at(0x0F99) __sfr ADCHS;
1578 typedef union
1580 struct
1582 unsigned GASEL0 : 1;
1583 unsigned GASEL1 : 1;
1584 unsigned GCSEL0 : 1;
1585 unsigned GCSEL1 : 1;
1586 unsigned GBSEL0 : 1;
1587 unsigned GBSEL1 : 1;
1588 unsigned GDSEL0 : 1;
1589 unsigned GDSEL1 : 1;
1592 struct
1594 unsigned SASEL0 : 1;
1595 unsigned SASEL1 : 1;
1596 unsigned SCSEL0 : 1;
1597 unsigned SCSEL1 : 1;
1598 unsigned SBSEL0 : 1;
1599 unsigned SBSEL1 : 1;
1600 unsigned SDSEL0 : 1;
1601 unsigned SDSEL1 : 1;
1604 struct
1606 unsigned GASEL : 2;
1607 unsigned : 6;
1610 struct
1612 unsigned SASEL : 2;
1613 unsigned : 6;
1616 struct
1618 unsigned : 2;
1619 unsigned GCSEL : 2;
1620 unsigned : 4;
1623 struct
1625 unsigned : 2;
1626 unsigned SCSEL : 2;
1627 unsigned : 4;
1630 struct
1632 unsigned : 4;
1633 unsigned SBSEL : 2;
1634 unsigned : 2;
1637 struct
1639 unsigned : 4;
1640 unsigned GBSEL : 2;
1641 unsigned : 2;
1644 struct
1646 unsigned : 6;
1647 unsigned GDSEL : 2;
1650 struct
1652 unsigned : 6;
1653 unsigned SDSEL : 2;
1655 } __ADCHSbits_t;
1657 extern __at(0x0F99) volatile __ADCHSbits_t ADCHSbits;
1659 #define _GASEL0 0x01
1660 #define _SASEL0 0x01
1661 #define _GASEL1 0x02
1662 #define _SASEL1 0x02
1663 #define _GCSEL0 0x04
1664 #define _SCSEL0 0x04
1665 #define _GCSEL1 0x08
1666 #define _SCSEL1 0x08
1667 #define _GBSEL0 0x10
1668 #define _SBSEL0 0x10
1669 #define _GBSEL1 0x20
1670 #define _SBSEL1 0x20
1671 #define _GDSEL0 0x40
1672 #define _SDSEL0 0x40
1673 #define _GDSEL1 0x80
1674 #define _SDSEL1 0x80
1676 //==============================================================================
1679 //==============================================================================
1680 // ADCON3 Bits
1682 extern __at(0x0F9A) __sfr ADCON3;
1684 typedef union
1686 struct
1688 unsigned SSRC0 : 1;
1689 unsigned SSRC1 : 1;
1690 unsigned SSRC2 : 1;
1691 unsigned SSRC3 : 1;
1692 unsigned SSRC4 : 1;
1693 unsigned : 1;
1694 unsigned ADRS0 : 1;
1695 unsigned ADRS1 : 1;
1698 struct
1700 unsigned SSRC : 5;
1701 unsigned : 3;
1704 struct
1706 unsigned : 6;
1707 unsigned ADRS : 2;
1709 } __ADCON3bits_t;
1711 extern __at(0x0F9A) volatile __ADCON3bits_t ADCON3bits;
1713 #define _SSRC0 0x01
1714 #define _SSRC1 0x02
1715 #define _SSRC2 0x04
1716 #define _SSRC3 0x08
1717 #define _SSRC4 0x10
1718 #define _ADRS0 0x40
1719 #define _ADRS1 0x80
1721 //==============================================================================
1724 //==============================================================================
1725 // OSCTUNE Bits
1727 extern __at(0x0F9B) __sfr OSCTUNE;
1729 typedef union
1731 struct
1733 unsigned TUN0 : 1;
1734 unsigned TUN1 : 1;
1735 unsigned TUN2 : 1;
1736 unsigned TUN3 : 1;
1737 unsigned TUN4 : 1;
1738 unsigned TUN5 : 1;
1739 unsigned : 1;
1740 unsigned : 1;
1743 struct
1745 unsigned TUN : 6;
1746 unsigned : 2;
1748 } __OSCTUNEbits_t;
1750 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
1752 #define _TUN0 0x01
1753 #define _TUN1 0x02
1754 #define _TUN2 0x04
1755 #define _TUN3 0x08
1756 #define _TUN4 0x10
1757 #define _TUN5 0x20
1759 //==============================================================================
1762 //==============================================================================
1763 // PIE1 Bits
1765 extern __at(0x0F9D) __sfr PIE1;
1767 typedef union
1769 struct
1771 unsigned TMR1IE : 1;
1772 unsigned TMR2IE : 1;
1773 unsigned CCP1IE : 1;
1774 unsigned SSPIE : 1;
1775 unsigned TXIE : 1;
1776 unsigned RCIE : 1;
1777 unsigned ADIE : 1;
1778 unsigned : 1;
1781 struct
1783 unsigned : 1;
1784 unsigned : 1;
1785 unsigned : 1;
1786 unsigned : 1;
1787 unsigned TBIE : 1;
1788 unsigned : 1;
1789 unsigned : 1;
1790 unsigned : 1;
1792 } __PIE1bits_t;
1794 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1796 #define _TMR1IE 0x01
1797 #define _TMR2IE 0x02
1798 #define _CCP1IE 0x04
1799 #define _SSPIE 0x08
1800 #define _TXIE 0x10
1801 #define _TBIE 0x10
1802 #define _RCIE 0x20
1803 #define _ADIE 0x40
1805 //==============================================================================
1808 //==============================================================================
1809 // PIR1 Bits
1811 extern __at(0x0F9E) __sfr PIR1;
1813 typedef union
1815 struct
1817 unsigned TMR1IF : 1;
1818 unsigned TMR2IF : 1;
1819 unsigned CCP1IF : 1;
1820 unsigned SSPIF : 1;
1821 unsigned TXIF : 1;
1822 unsigned RCIF : 1;
1823 unsigned ADIF : 1;
1824 unsigned : 1;
1827 struct
1829 unsigned : 1;
1830 unsigned : 1;
1831 unsigned : 1;
1832 unsigned : 1;
1833 unsigned TBIF : 1;
1834 unsigned : 1;
1835 unsigned : 1;
1836 unsigned : 1;
1838 } __PIR1bits_t;
1840 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1842 #define _TMR1IF 0x01
1843 #define _TMR2IF 0x02
1844 #define _CCP1IF 0x04
1845 #define _SSPIF 0x08
1846 #define _TXIF 0x10
1847 #define _TBIF 0x10
1848 #define _RCIF 0x20
1849 #define _ADIF 0x40
1851 //==============================================================================
1854 //==============================================================================
1855 // IPR1 Bits
1857 extern __at(0x0F9F) __sfr IPR1;
1859 typedef union
1861 struct
1863 unsigned TMR1IP : 1;
1864 unsigned TMR2IP : 1;
1865 unsigned CCP1IP : 1;
1866 unsigned SSPIP : 1;
1867 unsigned TXIP : 1;
1868 unsigned RCIP : 1;
1869 unsigned ADIP : 1;
1870 unsigned : 1;
1873 struct
1875 unsigned : 1;
1876 unsigned : 1;
1877 unsigned : 1;
1878 unsigned : 1;
1879 unsigned TBIP : 1;
1880 unsigned : 1;
1881 unsigned : 1;
1882 unsigned : 1;
1884 } __IPR1bits_t;
1886 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
1888 #define _TMR1IP 0x01
1889 #define _TMR2IP 0x02
1890 #define _CCP1IP 0x04
1891 #define _SSPIP 0x08
1892 #define _TXIP 0x10
1893 #define _TBIP 0x10
1894 #define _RCIP 0x20
1895 #define _ADIP 0x40
1897 //==============================================================================
1900 //==============================================================================
1901 // PIE2 Bits
1903 extern __at(0x0FA0) __sfr PIE2;
1905 typedef struct
1907 unsigned CCP2IE : 1;
1908 unsigned : 1;
1909 unsigned LVDIE : 1;
1910 unsigned : 1;
1911 unsigned EEIE : 1;
1912 unsigned : 1;
1913 unsigned : 1;
1914 unsigned OSFIE : 1;
1915 } __PIE2bits_t;
1917 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
1919 #define _CCP2IE 0x01
1920 #define _LVDIE 0x04
1921 #define _EEIE 0x10
1922 #define _OSFIE 0x80
1924 //==============================================================================
1927 //==============================================================================
1928 // PIR2 Bits
1930 extern __at(0x0FA1) __sfr PIR2;
1932 typedef struct
1934 unsigned CCP2IF : 1;
1935 unsigned : 1;
1936 unsigned LVDIF : 1;
1937 unsigned : 1;
1938 unsigned EEIF : 1;
1939 unsigned : 1;
1940 unsigned : 1;
1941 unsigned OSFIF : 1;
1942 } __PIR2bits_t;
1944 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
1946 #define _CCP2IF 0x01
1947 #define _LVDIF 0x04
1948 #define _EEIF 0x10
1949 #define _OSFIF 0x80
1951 //==============================================================================
1954 //==============================================================================
1955 // IPR2 Bits
1957 extern __at(0x0FA2) __sfr IPR2;
1959 typedef struct
1961 unsigned CCP2IP : 1;
1962 unsigned : 1;
1963 unsigned LVDIP : 1;
1964 unsigned : 1;
1965 unsigned EEIP : 1;
1966 unsigned : 1;
1967 unsigned : 1;
1968 unsigned OSFIP : 1;
1969 } __IPR2bits_t;
1971 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
1973 #define _CCP2IP 0x01
1974 #define _LVDIP 0x04
1975 #define _EEIP 0x10
1976 #define _OSFIP 0x80
1978 //==============================================================================
1981 //==============================================================================
1982 // PIE3 Bits
1984 extern __at(0x0FA3) __sfr PIE3;
1986 typedef struct
1988 unsigned TMR5IE : 1;
1989 unsigned IC1IE : 1;
1990 unsigned IC2QEIE : 1;
1991 unsigned IC3DRIE : 1;
1992 unsigned PTIE : 1;
1993 unsigned : 1;
1994 unsigned : 1;
1995 unsigned : 1;
1996 } __PIE3bits_t;
1998 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
2000 #define _TMR5IE 0x01
2001 #define _IC1IE 0x02
2002 #define _IC2QEIE 0x04
2003 #define _IC3DRIE 0x08
2004 #define _PTIE 0x10
2006 //==============================================================================
2009 //==============================================================================
2010 // PIR3 Bits
2012 extern __at(0x0FA4) __sfr PIR3;
2014 typedef struct
2016 unsigned TMR5IF : 1;
2017 unsigned IC1IF : 1;
2018 unsigned IC2QEIF : 1;
2019 unsigned IC3DRIF : 1;
2020 unsigned PTIF : 1;
2021 unsigned : 1;
2022 unsigned : 1;
2023 unsigned : 1;
2024 } __PIR3bits_t;
2026 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
2028 #define _TMR5IF 0x01
2029 #define _IC1IF 0x02
2030 #define _IC2QEIF 0x04
2031 #define _IC3DRIF 0x08
2032 #define _PTIF 0x10
2034 //==============================================================================
2037 //==============================================================================
2038 // IPR3 Bits
2040 extern __at(0x0FA5) __sfr IPR3;
2042 typedef struct
2044 unsigned TMR5IP : 1;
2045 unsigned IC1IP : 1;
2046 unsigned IC2QEIP : 1;
2047 unsigned IC3DRIP : 1;
2048 unsigned PTIP : 1;
2049 unsigned : 1;
2050 unsigned : 1;
2051 unsigned : 1;
2052 } __IPR3bits_t;
2054 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
2056 #define _TMR5IP 0x01
2057 #define _IC1IP 0x02
2058 #define _IC2QEIP 0x04
2059 #define _IC3DRIP 0x08
2060 #define _PTIP 0x10
2062 //==============================================================================
2065 //==============================================================================
2066 // EECON1 Bits
2068 extern __at(0x0FA6) __sfr EECON1;
2070 typedef struct
2072 unsigned RD : 1;
2073 unsigned WR : 1;
2074 unsigned WREN : 1;
2075 unsigned WRERR : 1;
2076 unsigned FREE : 1;
2077 unsigned : 1;
2078 unsigned CFGS : 1;
2079 unsigned EEPGD : 1;
2080 } __EECON1bits_t;
2082 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
2084 #define _RD 0x01
2085 #define _WR 0x02
2086 #define _WREN 0x04
2087 #define _WRERR 0x08
2088 #define _FREE 0x10
2089 #define _CFGS 0x40
2090 #define _EEPGD 0x80
2092 //==============================================================================
2094 extern __at(0x0FA7) __sfr EECON2;
2095 extern __at(0x0FA8) __sfr EEDATA;
2096 extern __at(0x0FA9) __sfr EEADR;
2098 //==============================================================================
2099 // BAUDCON Bits
2101 extern __at(0x0FAA) __sfr BAUDCON;
2103 typedef union
2105 struct
2107 unsigned ABDEN : 1;
2108 unsigned WUE : 1;
2109 unsigned : 1;
2110 unsigned BRG16 : 1;
2111 unsigned TXCKP : 1;
2112 unsigned RXDTP : 1;
2113 unsigned RCIDL : 1;
2114 unsigned ABDOVF : 1;
2117 struct
2119 unsigned : 1;
2120 unsigned : 1;
2121 unsigned : 1;
2122 unsigned : 1;
2123 unsigned SCKP : 1;
2124 unsigned : 1;
2125 unsigned RCMT : 1;
2126 unsigned : 1;
2128 } __BAUDCONbits_t;
2130 extern __at(0x0FAA) volatile __BAUDCONbits_t BAUDCONbits;
2132 #define _ABDEN 0x01
2133 #define _WUE 0x02
2134 #define _BRG16 0x08
2135 #define _TXCKP 0x10
2136 #define _SCKP 0x10
2137 #define _RXDTP 0x20
2138 #define _RCIDL 0x40
2139 #define _RCMT 0x40
2140 #define _ABDOVF 0x80
2142 //==============================================================================
2145 //==============================================================================
2146 // BAUDCTL Bits
2148 extern __at(0x0FAA) __sfr BAUDCTL;
2150 typedef union
2152 struct
2154 unsigned ABDEN : 1;
2155 unsigned WUE : 1;
2156 unsigned : 1;
2157 unsigned BRG16 : 1;
2158 unsigned TXCKP : 1;
2159 unsigned RXDTP : 1;
2160 unsigned RCIDL : 1;
2161 unsigned ABDOVF : 1;
2164 struct
2166 unsigned : 1;
2167 unsigned : 1;
2168 unsigned : 1;
2169 unsigned : 1;
2170 unsigned SCKP : 1;
2171 unsigned : 1;
2172 unsigned RCMT : 1;
2173 unsigned : 1;
2175 } __BAUDCTLbits_t;
2177 extern __at(0x0FAA) volatile __BAUDCTLbits_t BAUDCTLbits;
2179 #define _BAUDCTL_ABDEN 0x01
2180 #define _BAUDCTL_WUE 0x02
2181 #define _BAUDCTL_BRG16 0x08
2182 #define _BAUDCTL_TXCKP 0x10
2183 #define _BAUDCTL_SCKP 0x10
2184 #define _BAUDCTL_RXDTP 0x20
2185 #define _BAUDCTL_RCIDL 0x40
2186 #define _BAUDCTL_RCMT 0x40
2187 #define _BAUDCTL_ABDOVF 0x80
2189 //==============================================================================
2192 //==============================================================================
2193 // RCSTA Bits
2195 extern __at(0x0FAB) __sfr RCSTA;
2197 typedef union
2199 struct
2201 unsigned RX9D : 1;
2202 unsigned OERR : 1;
2203 unsigned FERR : 1;
2204 unsigned ADDEN : 1;
2205 unsigned CREN : 1;
2206 unsigned SREN : 1;
2207 unsigned RX9 : 1;
2208 unsigned SPEN : 1;
2211 struct
2213 unsigned : 1;
2214 unsigned : 1;
2215 unsigned : 1;
2216 unsigned ADEN : 1;
2217 unsigned : 1;
2218 unsigned : 1;
2219 unsigned : 1;
2220 unsigned : 1;
2222 } __RCSTAbits_t;
2224 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
2226 #define _RX9D 0x01
2227 #define _OERR 0x02
2228 #define _FERR 0x04
2229 #define _ADDEN 0x08
2230 #define _ADEN 0x08
2231 #define _CREN 0x10
2232 #define _SREN 0x20
2233 #define _RX9 0x40
2234 #define _SPEN 0x80
2236 //==============================================================================
2239 //==============================================================================
2240 // TXSTA Bits
2242 extern __at(0x0FAC) __sfr TXSTA;
2244 typedef struct
2246 unsigned TX9D : 1;
2247 unsigned TRMT : 1;
2248 unsigned BRGH : 1;
2249 unsigned SENDB : 1;
2250 unsigned SYNC : 1;
2251 unsigned TXEN : 1;
2252 unsigned TX9 : 1;
2253 unsigned CSRC : 1;
2254 } __TXSTAbits_t;
2256 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
2258 #define _TX9D 0x01
2259 #define _TRMT 0x02
2260 #define _BRGH 0x04
2261 #define _SENDB 0x08
2262 #define _SYNC 0x10
2263 #define _TXEN 0x20
2264 #define _TX9 0x40
2265 #define _CSRC 0x80
2267 //==============================================================================
2269 extern __at(0x0FAD) __sfr TXREG;
2270 extern __at(0x0FAE) __sfr RCREG;
2271 extern __at(0x0FAF) __sfr SPBRG;
2272 extern __at(0x0FB0) __sfr SPBRGH;
2274 //==============================================================================
2275 // QEICON Bits
2277 extern __at(0x0FB6) __sfr QEICON;
2279 typedef union
2281 struct
2283 unsigned PDEC0 : 1;
2284 unsigned PDEC1 : 1;
2285 unsigned QEIM0 : 1;
2286 unsigned QEIM1 : 1;
2287 unsigned QEIM2 : 1;
2288 unsigned UP_NOT_DOWN : 1;
2289 unsigned QERR : 1;
2290 unsigned NOT_VELM : 1;
2293 struct
2295 unsigned : 1;
2296 unsigned : 1;
2297 unsigned : 1;
2298 unsigned : 1;
2299 unsigned : 1;
2300 unsigned UP_DOWN : 1;
2301 unsigned : 1;
2302 unsigned VELM : 1;
2305 struct
2307 unsigned : 1;
2308 unsigned : 1;
2309 unsigned : 1;
2310 unsigned : 1;
2311 unsigned : 1;
2312 unsigned UP : 1;
2313 unsigned : 1;
2314 unsigned : 1;
2317 struct
2319 unsigned : 1;
2320 unsigned : 1;
2321 unsigned : 1;
2322 unsigned : 1;
2323 unsigned : 1;
2324 unsigned DOWN : 1;
2325 unsigned : 1;
2326 unsigned : 1;
2329 struct
2331 unsigned : 1;
2332 unsigned : 1;
2333 unsigned : 1;
2334 unsigned : 1;
2335 unsigned : 1;
2336 unsigned NOT_DOWN : 1;
2337 unsigned : 1;
2338 unsigned : 1;
2341 struct
2343 unsigned : 1;
2344 unsigned : 1;
2345 unsigned : 1;
2346 unsigned : 1;
2347 unsigned : 1;
2348 unsigned UPDOWN : 1;
2349 unsigned : 1;
2350 unsigned : 1;
2353 struct
2355 unsigned PDEC : 2;
2356 unsigned : 6;
2359 struct
2361 unsigned : 2;
2362 unsigned QEIM : 3;
2363 unsigned : 3;
2365 } __QEICONbits_t;
2367 extern __at(0x0FB6) volatile __QEICONbits_t QEICONbits;
2369 #define _PDEC0 0x01
2370 #define _PDEC1 0x02
2371 #define _QEIM0 0x04
2372 #define _QEIM1 0x08
2373 #define _QEIM2 0x10
2374 #define _UP_NOT_DOWN 0x20
2375 #define _UP_DOWN 0x20
2376 #define _UP 0x20
2377 #define _DOWN 0x20
2378 #define _NOT_DOWN 0x20
2379 #define _UPDOWN 0x20
2380 #define _QERR 0x40
2381 #define _NOT_VELM 0x80
2382 #define _VELM 0x80
2384 //==============================================================================
2387 //==============================================================================
2388 // T5CON Bits
2390 extern __at(0x0FB7) __sfr T5CON;
2392 typedef union
2394 struct
2396 unsigned TMR5ON : 1;
2397 unsigned TMR5CS : 1;
2398 unsigned NOT_T5SYNC : 1;
2399 unsigned T5PS0 : 1;
2400 unsigned T5PS1 : 1;
2401 unsigned T5MOD : 1;
2402 unsigned NOT_RESEN : 1;
2403 unsigned T5SEN : 1;
2406 struct
2408 unsigned : 1;
2409 unsigned : 1;
2410 unsigned T5SYNC : 1;
2411 unsigned : 1;
2412 unsigned : 1;
2413 unsigned : 1;
2414 unsigned RESEN : 1;
2415 unsigned : 1;
2418 struct
2420 unsigned : 3;
2421 unsigned T5PS : 2;
2422 unsigned : 3;
2424 } __T5CONbits_t;
2426 extern __at(0x0FB7) volatile __T5CONbits_t T5CONbits;
2428 #define _TMR5ON 0x01
2429 #define _TMR5CS 0x02
2430 #define _NOT_T5SYNC 0x04
2431 #define _T5SYNC 0x04
2432 #define _T5PS0 0x08
2433 #define _T5PS1 0x10
2434 #define _T5MOD 0x20
2435 #define _NOT_RESEN 0x40
2436 #define _RESEN 0x40
2437 #define _T5SEN 0x80
2439 //==============================================================================
2442 //==============================================================================
2443 // ANSEL0 Bits
2445 extern __at(0x0FB8) __sfr ANSEL0;
2447 typedef struct
2449 unsigned ANS0 : 1;
2450 unsigned ANS1 : 1;
2451 unsigned ANS2 : 1;
2452 unsigned ANS3 : 1;
2453 unsigned ANS4 : 1;
2454 unsigned ANS5 : 1;
2455 unsigned ANS6 : 1;
2456 unsigned ANS7 : 1;
2457 } __ANSEL0bits_t;
2459 extern __at(0x0FB8) volatile __ANSEL0bits_t ANSEL0bits;
2461 #define _ANS0 0x01
2462 #define _ANS1 0x02
2463 #define _ANS2 0x04
2464 #define _ANS3 0x08
2465 #define _ANS4 0x10
2466 #define _ANS5 0x20
2467 #define _ANS6 0x40
2468 #define _ANS7 0x80
2470 //==============================================================================
2473 //==============================================================================
2474 // ANSEL1 Bits
2476 extern __at(0x0FB9) __sfr ANSEL1;
2478 typedef struct
2480 unsigned ANS8 : 1;
2481 unsigned : 1;
2482 unsigned : 1;
2483 unsigned : 1;
2484 unsigned : 1;
2485 unsigned : 1;
2486 unsigned : 1;
2487 unsigned : 1;
2488 } __ANSEL1bits_t;
2490 extern __at(0x0FB9) volatile __ANSEL1bits_t ANSEL1bits;
2492 #define _ANS8 0x01
2494 //==============================================================================
2497 //==============================================================================
2498 // CCP2CON Bits
2500 extern __at(0x0FBA) __sfr CCP2CON;
2502 typedef union
2504 struct
2506 unsigned CCP2M0 : 1;
2507 unsigned CCP2M1 : 1;
2508 unsigned CCP2M2 : 1;
2509 unsigned CCP2M3 : 1;
2510 unsigned CCP2Y : 1;
2511 unsigned CCP2X : 1;
2512 unsigned : 1;
2513 unsigned : 1;
2516 struct
2518 unsigned : 1;
2519 unsigned : 1;
2520 unsigned : 1;
2521 unsigned : 1;
2522 unsigned DC2B0 : 1;
2523 unsigned DC2B1 : 1;
2524 unsigned : 1;
2525 unsigned : 1;
2528 struct
2530 unsigned CCP2M : 4;
2531 unsigned : 4;
2534 struct
2536 unsigned : 4;
2537 unsigned DC2B : 2;
2538 unsigned : 2;
2540 } __CCP2CONbits_t;
2542 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
2544 #define _CCP2M0 0x01
2545 #define _CCP2M1 0x02
2546 #define _CCP2M2 0x04
2547 #define _CCP2M3 0x08
2548 #define _CCP2Y 0x10
2549 #define _DC2B0 0x10
2550 #define _CCP2X 0x20
2551 #define _DC2B1 0x20
2553 //==============================================================================
2555 extern __at(0x0FBB) __sfr CCPR2;
2556 extern __at(0x0FBB) __sfr CCPR2L;
2557 extern __at(0x0FBC) __sfr CCPR2H;
2559 //==============================================================================
2560 // CCP1CON Bits
2562 extern __at(0x0FBD) __sfr CCP1CON;
2564 typedef union
2566 struct
2568 unsigned CCP1M0 : 1;
2569 unsigned CCP1M1 : 1;
2570 unsigned CCP1M2 : 1;
2571 unsigned CCP1M3 : 1;
2572 unsigned CCP1Y : 1;
2573 unsigned CCP1X : 1;
2574 unsigned : 1;
2575 unsigned : 1;
2578 struct
2580 unsigned : 1;
2581 unsigned : 1;
2582 unsigned : 1;
2583 unsigned : 1;
2584 unsigned DC1B0 : 1;
2585 unsigned DC1B1 : 1;
2586 unsigned : 1;
2587 unsigned : 1;
2590 struct
2592 unsigned CCP1M : 4;
2593 unsigned : 4;
2596 struct
2598 unsigned : 4;
2599 unsigned DC1B : 2;
2600 unsigned : 2;
2602 } __CCP1CONbits_t;
2604 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
2606 #define _CCP1M0 0x01
2607 #define _CCP1M1 0x02
2608 #define _CCP1M2 0x04
2609 #define _CCP1M3 0x08
2610 #define _CCP1Y 0x10
2611 #define _DC1B0 0x10
2612 #define _CCP1X 0x20
2613 #define _DC1B1 0x20
2615 //==============================================================================
2617 extern __at(0x0FBE) __sfr CCPR1;
2618 extern __at(0x0FBE) __sfr CCPR1L;
2619 extern __at(0x0FBF) __sfr CCPR1H;
2621 //==============================================================================
2622 // ADCON2 Bits
2624 extern __at(0x0FC0) __sfr ADCON2;
2626 typedef union
2628 struct
2630 unsigned ADCS0 : 1;
2631 unsigned ADCS1 : 1;
2632 unsigned ADCS2 : 1;
2633 unsigned ACQT0 : 1;
2634 unsigned ACQT1 : 1;
2635 unsigned ACQT2 : 1;
2636 unsigned ACQT3 : 1;
2637 unsigned ADFM : 1;
2640 struct
2642 unsigned ADCS : 3;
2643 unsigned : 5;
2646 struct
2648 unsigned : 3;
2649 unsigned ACQT : 4;
2650 unsigned : 1;
2652 } __ADCON2bits_t;
2654 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
2656 #define _ADCS0 0x01
2657 #define _ADCS1 0x02
2658 #define _ADCS2 0x04
2659 #define _ACQT0 0x08
2660 #define _ACQT1 0x10
2661 #define _ACQT2 0x20
2662 #define _ACQT3 0x40
2663 #define _ADFM 0x80
2665 //==============================================================================
2668 //==============================================================================
2669 // ADCON1 Bits
2671 extern __at(0x0FC1) __sfr ADCON1;
2673 typedef union
2675 struct
2677 unsigned ADPNT0 : 1;
2678 unsigned ADPNT1 : 1;
2679 unsigned BFOVFL : 1;
2680 unsigned BFEMT : 1;
2681 unsigned FIFOEN : 1;
2682 unsigned : 1;
2683 unsigned VCFG0 : 1;
2684 unsigned VCFG1 : 1;
2687 struct
2689 unsigned : 1;
2690 unsigned : 1;
2691 unsigned FFOVFL : 1;
2692 unsigned : 1;
2693 unsigned : 1;
2694 unsigned : 1;
2695 unsigned : 1;
2696 unsigned : 1;
2699 struct
2701 unsigned ADPNT : 2;
2702 unsigned : 6;
2705 struct
2707 unsigned : 6;
2708 unsigned VCFG : 2;
2710 } __ADCON1bits_t;
2712 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
2714 #define _ADPNT0 0x01
2715 #define _ADPNT1 0x02
2716 #define _BFOVFL 0x04
2717 #define _FFOVFL 0x04
2718 #define _BFEMT 0x08
2719 #define _FIFOEN 0x10
2720 #define _VCFG0 0x40
2721 #define _VCFG1 0x80
2723 //==============================================================================
2726 //==============================================================================
2727 // ADCON0 Bits
2729 extern __at(0x0FC2) __sfr ADCON0;
2731 typedef union
2733 struct
2735 unsigned ADON : 1;
2736 unsigned GO_NOT_DONE : 1;
2737 unsigned ACMOD0 : 1;
2738 unsigned ACMOD1 : 1;
2739 unsigned ACSCH : 1;
2740 unsigned ACONV : 1;
2741 unsigned : 1;
2742 unsigned : 1;
2745 struct
2747 unsigned : 1;
2748 unsigned GO_DONE : 1;
2749 unsigned : 1;
2750 unsigned : 1;
2751 unsigned : 1;
2752 unsigned : 1;
2753 unsigned : 1;
2754 unsigned : 1;
2757 struct
2759 unsigned : 1;
2760 unsigned DONE : 1;
2761 unsigned : 1;
2762 unsigned : 1;
2763 unsigned : 1;
2764 unsigned : 1;
2765 unsigned : 1;
2766 unsigned : 1;
2769 struct
2771 unsigned : 1;
2772 unsigned GO : 1;
2773 unsigned : 1;
2774 unsigned : 1;
2775 unsigned : 1;
2776 unsigned : 1;
2777 unsigned : 1;
2778 unsigned : 1;
2781 struct
2783 unsigned : 1;
2784 unsigned NOT_DONE : 1;
2785 unsigned : 1;
2786 unsigned : 1;
2787 unsigned : 1;
2788 unsigned : 1;
2789 unsigned : 1;
2790 unsigned : 1;
2793 struct
2795 unsigned : 1;
2796 unsigned GODONE : 1;
2797 unsigned : 1;
2798 unsigned : 1;
2799 unsigned : 1;
2800 unsigned : 1;
2801 unsigned : 1;
2802 unsigned : 1;
2805 struct
2807 unsigned : 2;
2808 unsigned ACMOD : 2;
2809 unsigned : 4;
2811 } __ADCON0bits_t;
2813 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
2815 #define _ADON 0x01
2816 #define _GO_NOT_DONE 0x02
2817 #define _GO_DONE 0x02
2818 #define _DONE 0x02
2819 #define _GO 0x02
2820 #define _NOT_DONE 0x02
2821 #define _GODONE 0x02
2822 #define _ACMOD0 0x04
2823 #define _ACMOD1 0x08
2824 #define _ACSCH 0x10
2825 #define _ACONV 0x20
2827 //==============================================================================
2829 extern __at(0x0FC3) __sfr ADRES;
2830 extern __at(0x0FC3) __sfr ADRESL;
2831 extern __at(0x0FC4) __sfr ADRESH;
2833 //==============================================================================
2834 // SSPCON Bits
2836 extern __at(0x0FC6) __sfr SSPCON;
2838 typedef union
2840 struct
2842 unsigned SSPM0 : 1;
2843 unsigned SSPM1 : 1;
2844 unsigned SSPM2 : 1;
2845 unsigned SSPM3 : 1;
2846 unsigned CKP : 1;
2847 unsigned SSPEN : 1;
2848 unsigned SSPOV : 1;
2849 unsigned WCOL : 1;
2852 struct
2854 unsigned SSPM : 4;
2855 unsigned : 4;
2857 } __SSPCONbits_t;
2859 extern __at(0x0FC6) volatile __SSPCONbits_t SSPCONbits;
2861 #define _SSPM0 0x01
2862 #define _SSPM1 0x02
2863 #define _SSPM2 0x04
2864 #define _SSPM3 0x08
2865 #define _CKP 0x10
2866 #define _SSPEN 0x20
2867 #define _SSPOV 0x40
2868 #define _WCOL 0x80
2870 //==============================================================================
2873 //==============================================================================
2874 // SSPSTAT Bits
2876 extern __at(0x0FC7) __sfr SSPSTAT;
2878 typedef union
2880 struct
2882 unsigned BF : 1;
2883 unsigned UA : 1;
2884 unsigned R_NOT_W : 1;
2885 unsigned S : 1;
2886 unsigned P : 1;
2887 unsigned D_NOT_A : 1;
2888 unsigned CKE : 1;
2889 unsigned SMP : 1;
2892 struct
2894 unsigned : 1;
2895 unsigned : 1;
2896 unsigned R_W : 1;
2897 unsigned : 1;
2898 unsigned : 1;
2899 unsigned D_A : 1;
2900 unsigned : 1;
2901 unsigned : 1;
2904 struct
2906 unsigned : 1;
2907 unsigned : 1;
2908 unsigned NOT_W : 1;
2909 unsigned : 1;
2910 unsigned : 1;
2911 unsigned NOT_A : 1;
2912 unsigned : 1;
2913 unsigned : 1;
2916 struct
2918 unsigned : 1;
2919 unsigned : 1;
2920 unsigned NOT_WRITE : 1;
2921 unsigned : 1;
2922 unsigned : 1;
2923 unsigned NOT_ADDRESS : 1;
2924 unsigned : 1;
2925 unsigned : 1;
2928 struct
2930 unsigned : 1;
2931 unsigned : 1;
2932 unsigned READ_WRITE : 1;
2933 unsigned : 1;
2934 unsigned : 1;
2935 unsigned DATA_ADDRESS : 1;
2936 unsigned : 1;
2937 unsigned : 1;
2940 struct
2942 unsigned : 1;
2943 unsigned : 1;
2944 unsigned R : 1;
2945 unsigned : 1;
2946 unsigned : 1;
2947 unsigned D : 1;
2948 unsigned : 1;
2949 unsigned : 1;
2951 } __SSPSTATbits_t;
2953 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
2955 #define _BF 0x01
2956 #define _UA 0x02
2957 #define _R_NOT_W 0x04
2958 #define _R_W 0x04
2959 #define _NOT_W 0x04
2960 #define _NOT_WRITE 0x04
2961 #define _READ_WRITE 0x04
2962 #define _R 0x04
2963 #define _S 0x08
2964 #define _P 0x10
2965 #define _D_NOT_A 0x20
2966 #define _D_A 0x20
2967 #define _NOT_A 0x20
2968 #define _NOT_ADDRESS 0x20
2969 #define _DATA_ADDRESS 0x20
2970 #define _D 0x20
2971 #define _CKE 0x40
2972 #define _SMP 0x80
2974 //==============================================================================
2976 extern __at(0x0FC8) __sfr SSPADD;
2977 extern __at(0x0FC9) __sfr SSPBUF;
2979 //==============================================================================
2980 // T2CON Bits
2982 extern __at(0x0FCA) __sfr T2CON;
2984 typedef union
2986 struct
2988 unsigned T2CKPS0 : 1;
2989 unsigned T2CKPS1 : 1;
2990 unsigned TMR2ON : 1;
2991 unsigned T2OUTPS0 : 1;
2992 unsigned T2OUTPS1 : 1;
2993 unsigned T2OUTPS2 : 1;
2994 unsigned T2OUTPS3 : 1;
2995 unsigned : 1;
2998 struct
3000 unsigned : 1;
3001 unsigned : 1;
3002 unsigned : 1;
3003 unsigned TOUTPS0 : 1;
3004 unsigned TOUTPS1 : 1;
3005 unsigned TOUTPS2 : 1;
3006 unsigned TOUTPS3 : 1;
3007 unsigned : 1;
3010 struct
3012 unsigned T2CKPS : 2;
3013 unsigned : 6;
3016 struct
3018 unsigned : 3;
3019 unsigned TOUTPS : 4;
3020 unsigned : 1;
3023 struct
3025 unsigned : 3;
3026 unsigned T2OUTPS : 4;
3027 unsigned : 1;
3029 } __T2CONbits_t;
3031 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
3033 #define _T2CKPS0 0x01
3034 #define _T2CKPS1 0x02
3035 #define _TMR2ON 0x04
3036 #define _T2OUTPS0 0x08
3037 #define _TOUTPS0 0x08
3038 #define _T2OUTPS1 0x10
3039 #define _TOUTPS1 0x10
3040 #define _T2OUTPS2 0x20
3041 #define _TOUTPS2 0x20
3042 #define _T2OUTPS3 0x40
3043 #define _TOUTPS3 0x40
3045 //==============================================================================
3047 extern __at(0x0FCB) __sfr PR2;
3048 extern __at(0x0FCC) __sfr TMR2;
3050 //==============================================================================
3051 // T1CON Bits
3053 extern __at(0x0FCD) __sfr T1CON;
3055 typedef union
3057 struct
3059 unsigned TMR1ON : 1;
3060 unsigned TMR1CS : 1;
3061 unsigned NOT_T1SYNC : 1;
3062 unsigned T1OSCEN : 1;
3063 unsigned T1CKPS0 : 1;
3064 unsigned T1CKPS1 : 1;
3065 unsigned T1RUN : 1;
3066 unsigned RD16 : 1;
3069 struct
3071 unsigned : 1;
3072 unsigned : 1;
3073 unsigned T1SYNC : 1;
3074 unsigned : 1;
3075 unsigned : 1;
3076 unsigned : 1;
3077 unsigned : 1;
3078 unsigned : 1;
3081 struct
3083 unsigned : 1;
3084 unsigned : 1;
3085 unsigned T1INSYNC : 1;
3086 unsigned : 1;
3087 unsigned : 1;
3088 unsigned : 1;
3089 unsigned : 1;
3090 unsigned : 1;
3093 struct
3095 unsigned : 4;
3096 unsigned T1CKPS : 2;
3097 unsigned : 2;
3099 } __T1CONbits_t;
3101 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
3103 #define _TMR1ON 0x01
3104 #define _TMR1CS 0x02
3105 #define _NOT_T1SYNC 0x04
3106 #define _T1SYNC 0x04
3107 #define _T1INSYNC 0x04
3108 #define _T1OSCEN 0x08
3109 #define _T1CKPS0 0x10
3110 #define _T1CKPS1 0x20
3111 #define _T1RUN 0x40
3112 #define _RD16 0x80
3114 //==============================================================================
3116 extern __at(0x0FCE) __sfr TMR1;
3117 extern __at(0x0FCE) __sfr TMR1L;
3118 extern __at(0x0FCF) __sfr TMR1H;
3120 //==============================================================================
3121 // RCON Bits
3123 extern __at(0x0FD0) __sfr RCON;
3125 typedef union
3127 struct
3129 unsigned NOT_BOR : 1;
3130 unsigned NOT_POR : 1;
3131 unsigned NOT_PD : 1;
3132 unsigned NOT_TO : 1;
3133 unsigned NOT_RI : 1;
3134 unsigned : 1;
3135 unsigned : 1;
3136 unsigned IPEN : 1;
3139 struct
3141 unsigned BOR : 1;
3142 unsigned POR : 1;
3143 unsigned PD : 1;
3144 unsigned TO : 1;
3145 unsigned RI : 1;
3146 unsigned : 1;
3147 unsigned : 1;
3148 unsigned NOT_IPEN : 1;
3150 } __RCONbits_t;
3152 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
3154 #define _NOT_BOR 0x01
3155 #define _BOR 0x01
3156 #define _NOT_POR 0x02
3157 #define _POR 0x02
3158 #define _NOT_PD 0x04
3159 #define _PD 0x04
3160 #define _NOT_TO 0x08
3161 #define _TO 0x08
3162 #define _NOT_RI 0x10
3163 #define _RI 0x10
3164 #define _IPEN 0x80
3165 #define _NOT_IPEN 0x80
3167 //==============================================================================
3170 //==============================================================================
3171 // WDTCON Bits
3173 extern __at(0x0FD1) __sfr WDTCON;
3175 typedef struct
3177 unsigned SWDTEN : 1;
3178 unsigned : 1;
3179 unsigned : 1;
3180 unsigned : 1;
3181 unsigned : 1;
3182 unsigned : 1;
3183 unsigned : 1;
3184 unsigned WDTW : 1;
3185 } __WDTCONbits_t;
3187 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
3189 #define _SWDTEN 0x01
3190 #define _WDTW 0x80
3192 //==============================================================================
3195 //==============================================================================
3196 // LVDCON Bits
3198 extern __at(0x0FD2) __sfr LVDCON;
3200 typedef union
3202 struct
3204 unsigned LVDL0 : 1;
3205 unsigned LVDL1 : 1;
3206 unsigned LVDL2 : 1;
3207 unsigned LVDL3 : 1;
3208 unsigned LVDEN : 1;
3209 unsigned IRVST : 1;
3210 unsigned : 1;
3211 unsigned : 1;
3214 struct
3216 unsigned : 1;
3217 unsigned : 1;
3218 unsigned : 1;
3219 unsigned : 1;
3220 unsigned : 1;
3221 unsigned IVRST : 1;
3222 unsigned : 1;
3223 unsigned : 1;
3226 struct
3228 unsigned LVDL : 4;
3229 unsigned : 4;
3231 } __LVDCONbits_t;
3233 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
3235 #define _LVDL0 0x01
3236 #define _LVDL1 0x02
3237 #define _LVDL2 0x04
3238 #define _LVDL3 0x08
3239 #define _LVDEN 0x10
3240 #define _IRVST 0x20
3241 #define _IVRST 0x20
3243 //==============================================================================
3246 //==============================================================================
3247 // OSCCON Bits
3249 extern __at(0x0FD3) __sfr OSCCON;
3251 typedef union
3253 struct
3255 unsigned SCS0 : 1;
3256 unsigned SCS1 : 1;
3257 unsigned IOFS : 1;
3258 unsigned OSTS : 1;
3259 unsigned IRCF0 : 1;
3260 unsigned IRCF1 : 1;
3261 unsigned IRCF2 : 1;
3262 unsigned IDLEN : 1;
3265 struct
3267 unsigned : 1;
3268 unsigned : 1;
3269 unsigned FLTS : 1;
3270 unsigned : 1;
3271 unsigned : 1;
3272 unsigned : 1;
3273 unsigned : 1;
3274 unsigned : 1;
3277 struct
3279 unsigned SCS : 2;
3280 unsigned : 6;
3283 struct
3285 unsigned : 4;
3286 unsigned IRCF : 3;
3287 unsigned : 1;
3289 } __OSCCONbits_t;
3291 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
3293 #define _SCS0 0x01
3294 #define _SCS1 0x02
3295 #define _IOFS 0x04
3296 #define _FLTS 0x04
3297 #define _OSTS 0x08
3298 #define _IRCF0 0x10
3299 #define _IRCF1 0x20
3300 #define _IRCF2 0x40
3301 #define _IDLEN 0x80
3303 //==============================================================================
3306 //==============================================================================
3307 // T0CON Bits
3309 extern __at(0x0FD5) __sfr T0CON;
3311 typedef union
3313 struct
3315 unsigned T0PS0 : 1;
3316 unsigned T0PS1 : 1;
3317 unsigned T0PS2 : 1;
3318 unsigned PSA : 1;
3319 unsigned T0SE : 1;
3320 unsigned T0CS : 1;
3321 unsigned T016BIT : 1;
3322 unsigned TMR0ON : 1;
3325 struct
3327 unsigned : 1;
3328 unsigned : 1;
3329 unsigned : 1;
3330 unsigned T0PS3 : 1;
3331 unsigned : 1;
3332 unsigned : 1;
3333 unsigned : 1;
3334 unsigned : 1;
3337 struct
3339 unsigned T0PS : 4;
3340 unsigned : 4;
3342 } __T0CONbits_t;
3344 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
3346 #define _T0PS0 0x01
3347 #define _T0PS1 0x02
3348 #define _T0PS2 0x04
3349 #define _PSA 0x08
3350 #define _T0PS3 0x08
3351 #define _T0SE 0x10
3352 #define _T0CS 0x20
3353 #define _T016BIT 0x40
3354 #define _TMR0ON 0x80
3356 //==============================================================================
3358 extern __at(0x0FD6) __sfr TMR0;
3359 extern __at(0x0FD6) __sfr TMR0L;
3360 extern __at(0x0FD7) __sfr TMR0H;
3362 //==============================================================================
3363 // STATUS Bits
3365 extern __at(0x0FD8) __sfr STATUS;
3367 typedef struct
3369 unsigned C : 1;
3370 unsigned DC : 1;
3371 unsigned Z : 1;
3372 unsigned OV : 1;
3373 unsigned N : 1;
3374 unsigned : 1;
3375 unsigned : 1;
3376 unsigned : 1;
3377 } __STATUSbits_t;
3379 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3381 #define _C 0x01
3382 #define _DC 0x02
3383 #define _Z 0x04
3384 #define _OV 0x08
3385 #define _N 0x10
3387 //==============================================================================
3389 extern __at(0x0FD9) __sfr FSR2L;
3390 extern __at(0x0FDA) __sfr FSR2H;
3391 extern __at(0x0FDB) __sfr PLUSW2;
3392 extern __at(0x0FDC) __sfr PREINC2;
3393 extern __at(0x0FDD) __sfr POSTDEC2;
3394 extern __at(0x0FDE) __sfr POSTINC2;
3395 extern __at(0x0FDF) __sfr INDF2;
3396 extern __at(0x0FE0) __sfr BSR;
3397 extern __at(0x0FE1) __sfr FSR1L;
3398 extern __at(0x0FE2) __sfr FSR1H;
3399 extern __at(0x0FE3) __sfr PLUSW1;
3400 extern __at(0x0FE4) __sfr PREINC1;
3401 extern __at(0x0FE5) __sfr POSTDEC1;
3402 extern __at(0x0FE6) __sfr POSTINC1;
3403 extern __at(0x0FE7) __sfr INDF1;
3404 extern __at(0x0FE8) __sfr WREG;
3405 extern __at(0x0FE9) __sfr FSR0L;
3406 extern __at(0x0FEA) __sfr FSR0H;
3407 extern __at(0x0FEB) __sfr PLUSW0;
3408 extern __at(0x0FEC) __sfr PREINC0;
3409 extern __at(0x0FED) __sfr POSTDEC0;
3410 extern __at(0x0FEE) __sfr POSTINC0;
3411 extern __at(0x0FEF) __sfr INDF0;
3413 //==============================================================================
3414 // INTCON3 Bits
3416 extern __at(0x0FF0) __sfr INTCON3;
3418 typedef union
3420 struct
3422 unsigned INT1IF : 1;
3423 unsigned INT2IF : 1;
3424 unsigned : 1;
3425 unsigned INT1IE : 1;
3426 unsigned INT2IE : 1;
3427 unsigned : 1;
3428 unsigned INT1IP : 1;
3429 unsigned INT2IP : 1;
3432 struct
3434 unsigned INT1F : 1;
3435 unsigned INT2F : 1;
3436 unsigned : 1;
3437 unsigned INT1E : 1;
3438 unsigned INT2E : 1;
3439 unsigned : 1;
3440 unsigned INT1P : 1;
3441 unsigned INT2P : 1;
3443 } __INTCON3bits_t;
3445 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3447 #define _INT1IF 0x01
3448 #define _INT1F 0x01
3449 #define _INT2IF 0x02
3450 #define _INT2F 0x02
3451 #define _INT1IE 0x08
3452 #define _INT1E 0x08
3453 #define _INT2IE 0x10
3454 #define _INT2E 0x10
3455 #define _INT1IP 0x40
3456 #define _INT1P 0x40
3457 #define _INT2IP 0x80
3458 #define _INT2P 0x80
3460 //==============================================================================
3463 //==============================================================================
3464 // INTCON2 Bits
3466 extern __at(0x0FF1) __sfr INTCON2;
3468 typedef union
3470 struct
3472 unsigned RBIP : 1;
3473 unsigned : 1;
3474 unsigned TMR0IP : 1;
3475 unsigned : 1;
3476 unsigned INTEDG2 : 1;
3477 unsigned INTEDG1 : 1;
3478 unsigned INTEDG0 : 1;
3479 unsigned NOT_RBPU : 1;
3482 struct
3484 unsigned : 1;
3485 unsigned : 1;
3486 unsigned T0IP : 1;
3487 unsigned : 1;
3488 unsigned : 1;
3489 unsigned : 1;
3490 unsigned : 1;
3491 unsigned RBPU : 1;
3493 } __INTCON2bits_t;
3495 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3497 #define _RBIP 0x01
3498 #define _TMR0IP 0x04
3499 #define _T0IP 0x04
3500 #define _INTEDG2 0x10
3501 #define _INTEDG1 0x20
3502 #define _INTEDG0 0x40
3503 #define _NOT_RBPU 0x80
3504 #define _RBPU 0x80
3506 //==============================================================================
3509 //==============================================================================
3510 // INTCON Bits
3512 extern __at(0x0FF2) __sfr INTCON;
3514 typedef union
3516 struct
3518 unsigned RBIF : 1;
3519 unsigned INT0IF : 1;
3520 unsigned TMR0IF : 1;
3521 unsigned RBIE : 1;
3522 unsigned INT0IE : 1;
3523 unsigned TMR0IE : 1;
3524 unsigned PEIE_GIEL : 1;
3525 unsigned GIE_GIEH : 1;
3528 struct
3530 unsigned : 1;
3531 unsigned INT0F : 1;
3532 unsigned T0IF : 1;
3533 unsigned : 1;
3534 unsigned INT0E : 1;
3535 unsigned T0IE : 1;
3536 unsigned PEIE : 1;
3537 unsigned GIE : 1;
3540 struct
3542 unsigned : 1;
3543 unsigned : 1;
3544 unsigned : 1;
3545 unsigned : 1;
3546 unsigned : 1;
3547 unsigned : 1;
3548 unsigned GIEL : 1;
3549 unsigned GIEH : 1;
3551 } __INTCONbits_t;
3553 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3555 #define _RBIF 0x01
3556 #define _INT0IF 0x02
3557 #define _INT0F 0x02
3558 #define _TMR0IF 0x04
3559 #define _T0IF 0x04
3560 #define _RBIE 0x08
3561 #define _INT0IE 0x10
3562 #define _INT0E 0x10
3563 #define _TMR0IE 0x20
3564 #define _T0IE 0x20
3565 #define _PEIE_GIEL 0x40
3566 #define _PEIE 0x40
3567 #define _GIEL 0x40
3568 #define _GIE_GIEH 0x80
3569 #define _GIE 0x80
3570 #define _GIEH 0x80
3572 //==============================================================================
3574 extern __at(0x0FF3) __sfr PROD;
3575 extern __at(0x0FF3) __sfr PRODL;
3576 extern __at(0x0FF4) __sfr PRODH;
3577 extern __at(0x0FF5) __sfr TABLAT;
3578 extern __at(0x0FF6) __sfr TBLPTR;
3579 extern __at(0x0FF6) __sfr TBLPTRL;
3580 extern __at(0x0FF7) __sfr TBLPTRH;
3581 extern __at(0x0FF8) __sfr TBLPTRU;
3582 extern __at(0x0FF9) __sfr PC;
3583 extern __at(0x0FF9) __sfr PCL;
3584 extern __at(0x0FFA) __sfr PCLATH;
3585 extern __at(0x0FFB) __sfr PCLATU;
3587 //==============================================================================
3588 // STKPTR Bits
3590 extern __at(0x0FFC) __sfr STKPTR;
3592 typedef union
3594 struct
3596 unsigned STKPTR0 : 1;
3597 unsigned STKPTR1 : 1;
3598 unsigned STKPTR2 : 1;
3599 unsigned STKPTR3 : 1;
3600 unsigned STKPTR4 : 1;
3601 unsigned : 1;
3602 unsigned STKUNF : 1;
3603 unsigned STKFUL : 1;
3606 struct
3608 unsigned : 1;
3609 unsigned : 1;
3610 unsigned : 1;
3611 unsigned : 1;
3612 unsigned : 1;
3613 unsigned : 1;
3614 unsigned : 1;
3615 unsigned STKOVF : 1;
3618 struct
3620 unsigned STKPTR : 5;
3621 unsigned : 3;
3623 } __STKPTRbits_t;
3625 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
3627 #define _STKPTR0 0x01
3628 #define _STKPTR1 0x02
3629 #define _STKPTR2 0x04
3630 #define _STKPTR3 0x08
3631 #define _STKPTR4 0x10
3632 #define _STKUNF 0x40
3633 #define _STKFUL 0x80
3634 #define _STKOVF 0x80
3636 //==============================================================================
3638 extern __at(0x0FFD) __sfr TOS;
3639 extern __at(0x0FFD) __sfr TOSL;
3640 extern __at(0x0FFE) __sfr TOSH;
3641 extern __at(0x0FFF) __sfr TOSU;
3643 //==============================================================================
3645 // Configuration Bits
3647 //==============================================================================
3649 #define __CONFIG1H 0x300001
3650 #define __CONFIG2L 0x300002
3651 #define __CONFIG2H 0x300003
3652 #define __CONFIG3L 0x300004
3653 #define __CONFIG3H 0x300005
3654 #define __CONFIG4L 0x300006
3655 #define __CONFIG5L 0x300008
3656 #define __CONFIG5H 0x300009
3657 #define __CONFIG6L 0x30000A
3658 #define __CONFIG6H 0x30000B
3659 #define __CONFIG7L 0x30000C
3660 #define __CONFIG7H 0x30000D
3662 //----------------------------- CONFIG1H Options -------------------------------
3664 #define _OSC_LP_1H 0xF0 // LP oscillator.
3665 #define _OSC_XT_1H 0xF1 // XT oscillator.
3666 #define _OSC_HS_1H 0xF2 // HS oscillator.
3667 #define _OSC_RC2_1H 0xF3 // External RC oscillator, CLKO function on RA6.
3668 #define _OSC_EC_1H 0xF4 // EC oscillator, CLKO function on RA6.
3669 #define _OSC_ECIO_1H 0xF5 // EC oscillator, port function on RA6.
3670 #define _OSC_HSPLL_1H 0xF6 // HS oscillator, PLL enabled (clock frequency = 4 x FOSC1).
3671 #define _OSC_RCIO_1H 0xF7 // External RC oscillator, port function on RA6.
3672 #define _OSC_IRCIO_1H 0xF8 // Internal oscillator block, port function on RA6 and port function on RA7.
3673 #define _OSC_IRC_1H 0xF9 // Internal oscillator block, CLKO function on RA6 and port function on RA7.
3674 #define _OSC_RC1_1H 0xFA // 101X External RC oscillator, CLKO function on RA6.
3675 #define _OSC_RC_1H 0xFC // 11XX External RC oscillator, CLKO function on RA6.
3676 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
3677 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
3678 #define _IESO_OFF_1H 0x7F // Internal External Switchover mode disabled.
3679 #define _IESO_ON_1H 0xFF // Internal External Switchover mode enabled.
3681 //----------------------------- CONFIG2L Options -------------------------------
3683 #define _PWRTEN_ON_2L 0xFE // PWRT enabled.
3684 #define _PWRTEN_OFF_2L 0xFF // PWRT disabled.
3685 #define _BOREN_OFF_2L 0xFD // Brown-out Reset disabled.
3686 #define _BOREN_ON_2L 0xFF // Brown-out Reset enabled.
3687 #define _BORV_45_2L 0xF3 // VBOR set to 4.5V.
3688 #define _BORV_42_2L 0xF7 // VBOR set to 4.2V.
3689 #define _BORV_27_2L 0xFB // VBOR set to 2.7V.
3690 #define _BORV_20_2L 0xFF // Reserved.
3692 //----------------------------- CONFIG2H Options -------------------------------
3694 #define _WDTEN_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
3695 #define _WDTEN_ON_2H 0xFF // WDT enabled.
3696 #define _WDPS_1_2H 0xE1 // 1:1.
3697 #define _WDPS_2_2H 0xE3 // 1:2.
3698 #define _WDPS_4_2H 0xE5 // 1:4.
3699 #define _WDPS_8_2H 0xE7 // 1:8.
3700 #define _WDPS_16_2H 0xE9 // 1:16.
3701 #define _WDPS_32_2H 0xEB // 1:32.
3702 #define _WDPS_64_2H 0xED // 1:64.
3703 #define _WDPS_128_2H 0xEF // 1:128.
3704 #define _WDPS_256_2H 0xF1 // 1:256.
3705 #define _WDPS_512_2H 0xF3 // 1:512.
3706 #define _WDPS_1024_2H 0xF5 // 1:1024.
3707 #define _WDPS_2048_2H 0xF7 // 1:2048.
3708 #define _WDPS_4096_2H 0xF9 // 1:4096.
3709 #define _WDPS_8192_2H 0xFB // 1:8192.
3710 #define _WDPS_16384_2H 0xFD // 1:16384.
3711 #define _WDPS_32768_2H 0xFF // 1:32768.
3712 #define _WINEN_ON_2H 0xDF // WDT window enabledbled.
3713 #define _WINEN_OFF_2H 0xFF // WDT window disabled.
3715 //----------------------------- CONFIG3L Options -------------------------------
3717 #define _PWMPIN_ON_3L 0xFB // PWM outputs drive active states upon Reset.
3718 #define _PWMPIN_OFF_3L 0xFF // PWM outputs disabled upon Reset (default).
3719 #define _LPOL_LOW_3L 0xF7 // PWM0, 2, 4 and 6 are active-low.
3720 #define _LPOL_HIGH_3L 0xFF // PWM0, 2, 4 and 6 are active-high.
3721 #define _HPOL_LOW_3L 0xEF // PWM1, 3, 5 and 7 are active-low.
3722 #define _HPOL_HIGH_3L 0xFF // PWM1, 3, 5 and 7 are active-high.
3723 #define _T1OSCMX_OFF_3L 0xDF // Standard (legacy) Timer1 oscillator operation.
3724 #define _T1OSCMX_ON_3L 0xFF // Low-power Timer1 operation when microcontroller is in Sleep mode.
3726 //----------------------------- CONFIG3H Options -------------------------------
3728 #define _FLTAMX_RD4_3H 0xFE // FLTA input is multiplexed with RD4.
3729 #define _FLTAMX_RC1_3H 0xFF // FLTA input is multiplexed with RC1.
3730 #define _SSPMX_RD1_3H 0xFB // SCK/SCL clocks and SDA/SDI data are multiplexed with RD3 and RD2, respectively. SDO output is multiplexed with RD1.
3731 #define _SSPMX_RC7_3H 0xFF // SCK/SCL clocks and SDA/SDI data are multiplexed with RC5 and RC4, respectively. SDO output is multiplexed with RC7.
3732 #define _PWM4MX_RD5_3H 0xF7 // PWM4 output is multiplexed with RD5.
3733 #define _PWM4MX_RB5_3H 0xFF // PWM4 output is multiplexed with RB5.
3734 #define _EXCLKMX_RD0_3H 0xEF // TMR0/T5CKI external clock input is multiplexed with RD0.
3735 #define _EXCLKMX_RC3_3H 0xFF // TMR0/T5CKI external clock input is multiplexed with RC3.
3736 #define _MCLRE_OFF_3H 0x7F // Disabled.
3737 #define _MCLRE_ON_3H 0xFF // Enabled.
3739 //----------------------------- CONFIG4L Options -------------------------------
3741 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
3742 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
3743 #define _LVP_OFF_4L 0xFB // Low-voltage ICSP disabled.
3744 #define _LVP_ON_4L 0xFF // Low-voltage ICSP enabled.
3745 #define _DEBUG_ON_4L 0x7F // Background debugger enabled; RB6 and RB7 are dedicated to In-Circuit Debug.
3746 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled; RB6 and RB7 configured as general purpose I/O pins.
3748 //----------------------------- CONFIG5L Options -------------------------------
3750 #define _CP0_ON_5L 0xFE // Block 0 (000200-000FFFh) code-protected.
3751 #define _CP0_OFF_5L 0xFF // Block 0 (000200-000FFFh) not code-protected.
3752 #define _CP1_ON_5L 0xFD // Block 1 (001000-001FFF) code-protected.
3753 #define _CP1_OFF_5L 0xFF // Block 1 (001000-001FFF) not code-protected.
3754 #define _CP2_ON_5L 0xFB // Block 2 (002000-002FFFh) code-protected.
3755 #define _CP2_OFF_5L 0xFF // Block 2 (002000-002FFFh) not code-protected.
3756 #define _CP3_ON_5L 0xF7 // Block 3 (003000-003FFFh) code-protected.
3757 #define _CP3_OFF_5L 0xFF // Block 3 (003000-003FFFh) not code-protected.
3759 //----------------------------- CONFIG5H Options -------------------------------
3761 #define _CPB_ON_5H 0xBF // Boot Block (000000-0001FFh) code-protected.
3762 #define _CPB_OFF_5H 0xFF // Boot Block (000000-0001FFh) not code-protected.
3763 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
3764 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
3766 //----------------------------- CONFIG6L Options -------------------------------
3768 #define _WRT0_ON_6L 0xFE // Block 0 (000200-000FFFh) write-protected.
3769 #define _WRT0_OFF_6L 0xFF // Block 0 (000200-000FFFh) not write-protected.
3770 #define _WRT1_ON_6L 0xFD // Block 1 (001000-001FFF) write-protected.
3771 #define _WRT1_OFF_6L 0xFF // Block 1 (001000-001FFF) not write-protected.
3772 #define _WRT2_ON_6L 0xFB // Block 2 (002000-002FFFh) write-protected.
3773 #define _WRT2_OFF_6L 0xFF // Block 2 (002000-002FFFh) not write-protected.
3774 #define _WRT3_ON_6L 0xF7 // Block 3 (003000-003FFFh) write-protected.
3775 #define _WRT3_OFF_6L 0xFF // Block 3 (003000-003FFFh) not write-protected.
3777 //----------------------------- CONFIG6H Options -------------------------------
3779 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) write-protected.
3780 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) not write-protected.
3781 #define _WRTB_ON_6H 0xBF // Boot Block (000000-0001FFh) write-protected.
3782 #define _WRTB_OFF_6H 0xFF // Boot Block (000000-0001FFh) not write-protected.
3783 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
3784 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
3786 //----------------------------- CONFIG7L Options -------------------------------
3788 #define _EBTR0_ON_7L 0xFE // Block 0 (000200-000FFFh) protected from table reads executed in other blocks.
3789 #define _EBTR0_OFF_7L 0xFF // Block 0 (000200-000FFFh) not protected from table reads executed in other blocks.
3790 #define _EBTR1_ON_7L 0xFD // Block 1 (001000-001FFF) protected from table reads executed in other blocks.
3791 #define _EBTR1_OFF_7L 0xFF // Block 1 (001000-001FFF) not protected from table reads executed in other blocks.
3792 #define _EBTR2_ON_7L 0xFB // Block 2 (002000-002FFFh) protected from table reads executed in other blocks.
3793 #define _EBTR2_OFF_7L 0xFF // Block 2 (002000-002FFFh) not protected from table reads executed in other blocks.
3794 #define _EBTR3_ON_7L 0xF7 // Block 3 (003000-003FFFh) protected from table reads executed in other blocks.
3795 #define _EBTR3_OFF_7L 0xFF // Block 3 (003000-003FFFh) not protected from table reads executed in other blocks.
3797 //----------------------------- CONFIG7H Options -------------------------------
3799 #define _EBTRB_ON_7H 0xBF // Boot Block (000000-0001FFh) not protected from table reads executed in other blocks.
3800 #define _EBTRB_OFF_7H 0xFF // Boot Block (000000-0001FFh) not protected from table reads executed in other blocks.
3802 //==============================================================================
3804 #define __DEVID1 0x3FFFFE
3805 #define __DEVID2 0x3FFFFF
3807 #define __IDLOC0 0x200000
3808 #define __IDLOC1 0x200001
3809 #define __IDLOC2 0x200002
3810 #define __IDLOC3 0x200003
3811 #define __IDLOC4 0x200004
3812 #define __IDLOC5 0x200005
3813 #define __IDLOC6 0x200006
3814 #define __IDLOC7 0x200007
3816 #endif // #ifndef __PIC18LF4431_H__