struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18lf14k50.h
blob1a244f096f32c569364d556f700b306ca1f91cd0
1 /*
2 * This declarations of the PIC18LF14K50 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 __PIC18LF14K50_H__
26 #define __PIC18LF14K50_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // UEP0 Bits
40 extern __at(0x0F53) __sfr UEP0;
42 typedef struct
44 unsigned EPSTALL : 1;
45 unsigned EPINEN : 1;
46 unsigned EPOUTEN : 1;
47 unsigned EPCONDIS : 1;
48 unsigned EPHSHK : 1;
49 unsigned : 1;
50 unsigned : 1;
51 unsigned : 1;
52 } __UEP0bits_t;
54 extern __at(0x0F53) volatile __UEP0bits_t UEP0bits;
56 #define _EPSTALL 0x01
57 #define _EPINEN 0x02
58 #define _EPOUTEN 0x04
59 #define _EPCONDIS 0x08
60 #define _EPHSHK 0x10
62 //==============================================================================
65 //==============================================================================
66 // UEP1 Bits
68 extern __at(0x0F54) __sfr UEP1;
70 typedef struct
72 unsigned EPSTALL : 1;
73 unsigned EPINEN : 1;
74 unsigned EPOUTEN : 1;
75 unsigned EPCONDIS : 1;
76 unsigned EPHSHK : 1;
77 unsigned : 1;
78 unsigned : 1;
79 unsigned : 1;
80 } __UEP1bits_t;
82 extern __at(0x0F54) volatile __UEP1bits_t UEP1bits;
84 #define _UEP1_EPSTALL 0x01
85 #define _UEP1_EPINEN 0x02
86 #define _UEP1_EPOUTEN 0x04
87 #define _UEP1_EPCONDIS 0x08
88 #define _UEP1_EPHSHK 0x10
90 //==============================================================================
93 //==============================================================================
94 // UEP2 Bits
96 extern __at(0x0F55) __sfr UEP2;
98 typedef struct
100 unsigned EPSTALL : 1;
101 unsigned EPINEN : 1;
102 unsigned EPOUTEN : 1;
103 unsigned EPCONDIS : 1;
104 unsigned EPHSHK : 1;
105 unsigned : 1;
106 unsigned : 1;
107 unsigned : 1;
108 } __UEP2bits_t;
110 extern __at(0x0F55) volatile __UEP2bits_t UEP2bits;
112 #define _UEP2_EPSTALL 0x01
113 #define _UEP2_EPINEN 0x02
114 #define _UEP2_EPOUTEN 0x04
115 #define _UEP2_EPCONDIS 0x08
116 #define _UEP2_EPHSHK 0x10
118 //==============================================================================
121 //==============================================================================
122 // UEP3 Bits
124 extern __at(0x0F56) __sfr UEP3;
126 typedef struct
128 unsigned EPSTALL : 1;
129 unsigned EPINEN : 1;
130 unsigned EPOUTEN : 1;
131 unsigned EPCONDIS : 1;
132 unsigned EPHSHK : 1;
133 unsigned : 1;
134 unsigned : 1;
135 unsigned : 1;
136 } __UEP3bits_t;
138 extern __at(0x0F56) volatile __UEP3bits_t UEP3bits;
140 #define _UEP3_EPSTALL 0x01
141 #define _UEP3_EPINEN 0x02
142 #define _UEP3_EPOUTEN 0x04
143 #define _UEP3_EPCONDIS 0x08
144 #define _UEP3_EPHSHK 0x10
146 //==============================================================================
149 //==============================================================================
150 // UEP4 Bits
152 extern __at(0x0F57) __sfr UEP4;
154 typedef struct
156 unsigned EPSTALL : 1;
157 unsigned EPINEN : 1;
158 unsigned EPOUTEN : 1;
159 unsigned EPCONDIS : 1;
160 unsigned EPHSHK : 1;
161 unsigned : 1;
162 unsigned : 1;
163 unsigned : 1;
164 } __UEP4bits_t;
166 extern __at(0x0F57) volatile __UEP4bits_t UEP4bits;
168 #define _UEP4_EPSTALL 0x01
169 #define _UEP4_EPINEN 0x02
170 #define _UEP4_EPOUTEN 0x04
171 #define _UEP4_EPCONDIS 0x08
172 #define _UEP4_EPHSHK 0x10
174 //==============================================================================
177 //==============================================================================
178 // UEP5 Bits
180 extern __at(0x0F58) __sfr UEP5;
182 typedef struct
184 unsigned EPSTALL : 1;
185 unsigned EPINEN : 1;
186 unsigned EPOUTEN : 1;
187 unsigned EPCONDIS : 1;
188 unsigned EPHSHK : 1;
189 unsigned : 1;
190 unsigned : 1;
191 unsigned : 1;
192 } __UEP5bits_t;
194 extern __at(0x0F58) volatile __UEP5bits_t UEP5bits;
196 #define _UEP5_EPSTALL 0x01
197 #define _UEP5_EPINEN 0x02
198 #define _UEP5_EPOUTEN 0x04
199 #define _UEP5_EPCONDIS 0x08
200 #define _UEP5_EPHSHK 0x10
202 //==============================================================================
205 //==============================================================================
206 // UEP6 Bits
208 extern __at(0x0F59) __sfr UEP6;
210 typedef struct
212 unsigned EPSTALL : 1;
213 unsigned EPINEN : 1;
214 unsigned EPOUTEN : 1;
215 unsigned EPCONDIS : 1;
216 unsigned EPHSHK : 1;
217 unsigned : 1;
218 unsigned : 1;
219 unsigned : 1;
220 } __UEP6bits_t;
222 extern __at(0x0F59) volatile __UEP6bits_t UEP6bits;
224 #define _UEP6_EPSTALL 0x01
225 #define _UEP6_EPINEN 0x02
226 #define _UEP6_EPOUTEN 0x04
227 #define _UEP6_EPCONDIS 0x08
228 #define _UEP6_EPHSHK 0x10
230 //==============================================================================
233 //==============================================================================
234 // UEP7 Bits
236 extern __at(0x0F5A) __sfr UEP7;
238 typedef struct
240 unsigned EPSTALL : 1;
241 unsigned EPINEN : 1;
242 unsigned EPOUTEN : 1;
243 unsigned EPCONDIS : 1;
244 unsigned EPHSHK : 1;
245 unsigned : 1;
246 unsigned : 1;
247 unsigned : 1;
248 } __UEP7bits_t;
250 extern __at(0x0F5A) volatile __UEP7bits_t UEP7bits;
252 #define _UEP7_EPSTALL 0x01
253 #define _UEP7_EPINEN 0x02
254 #define _UEP7_EPOUTEN 0x04
255 #define _UEP7_EPCONDIS 0x08
256 #define _UEP7_EPHSHK 0x10
258 //==============================================================================
261 //==============================================================================
262 // UEIE Bits
264 extern __at(0x0F5B) __sfr UEIE;
266 typedef struct
268 unsigned PIDEE : 1;
269 unsigned CRC5EE : 1;
270 unsigned CRC16EE : 1;
271 unsigned DFN8EE : 1;
272 unsigned BTOEE : 1;
273 unsigned : 1;
274 unsigned : 1;
275 unsigned BTSEE : 1;
276 } __UEIEbits_t;
278 extern __at(0x0F5B) volatile __UEIEbits_t UEIEbits;
280 #define _PIDEE 0x01
281 #define _CRC5EE 0x02
282 #define _CRC16EE 0x04
283 #define _DFN8EE 0x08
284 #define _BTOEE 0x10
285 #define _BTSEE 0x80
287 //==============================================================================
290 //==============================================================================
291 // UADDR Bits
293 extern __at(0x0F5C) __sfr UADDR;
295 typedef union
297 struct
299 unsigned ADDR0 : 1;
300 unsigned ADDR1 : 1;
301 unsigned ADDR2 : 1;
302 unsigned ADDR3 : 1;
303 unsigned ADDR4 : 1;
304 unsigned ADDR5 : 1;
305 unsigned ADDR6 : 1;
306 unsigned : 1;
309 struct
311 unsigned ADDR : 7;
312 unsigned : 1;
314 } __UADDRbits_t;
316 extern __at(0x0F5C) volatile __UADDRbits_t UADDRbits;
318 #define _ADDR0 0x01
319 #define _ADDR1 0x02
320 #define _ADDR2 0x04
321 #define _ADDR3 0x08
322 #define _ADDR4 0x10
323 #define _ADDR5 0x20
324 #define _ADDR6 0x40
326 //==============================================================================
329 //==============================================================================
330 // UFRML Bits
332 extern __at(0x0F5D) __sfr UFRML;
334 typedef struct
336 unsigned FRM0 : 1;
337 unsigned FRM1 : 1;
338 unsigned FRM2 : 1;
339 unsigned FRM3 : 1;
340 unsigned FRM4 : 1;
341 unsigned FRM5 : 1;
342 unsigned FRM6 : 1;
343 unsigned FRM7 : 1;
344 } __UFRMLbits_t;
346 extern __at(0x0F5D) volatile __UFRMLbits_t UFRMLbits;
348 #define _FRM0 0x01
349 #define _FRM1 0x02
350 #define _FRM2 0x04
351 #define _FRM3 0x08
352 #define _FRM4 0x10
353 #define _FRM5 0x20
354 #define _FRM6 0x40
355 #define _FRM7 0x80
357 //==============================================================================
360 //==============================================================================
361 // UFRMH Bits
363 extern __at(0x0F5E) __sfr UFRMH;
365 typedef struct
367 unsigned FRM8 : 1;
368 unsigned FRM9 : 1;
369 unsigned FRM10 : 1;
370 unsigned : 1;
371 unsigned : 1;
372 unsigned : 1;
373 unsigned : 1;
374 unsigned : 1;
375 } __UFRMHbits_t;
377 extern __at(0x0F5E) volatile __UFRMHbits_t UFRMHbits;
379 #define _FRM8 0x01
380 #define _FRM9 0x02
381 #define _FRM10 0x04
383 //==============================================================================
386 //==============================================================================
387 // UEIR Bits
389 extern __at(0x0F5F) __sfr UEIR;
391 typedef struct
393 unsigned PIDEF : 1;
394 unsigned CRC5EF : 1;
395 unsigned CRC16EF : 1;
396 unsigned DFN8EF : 1;
397 unsigned BTOEF : 1;
398 unsigned : 1;
399 unsigned : 1;
400 unsigned BTSEF : 1;
401 } __UEIRbits_t;
403 extern __at(0x0F5F) volatile __UEIRbits_t UEIRbits;
405 #define _PIDEF 0x01
406 #define _CRC5EF 0x02
407 #define _CRC16EF 0x04
408 #define _DFN8EF 0x08
409 #define _BTOEF 0x10
410 #define _BTSEF 0x80
412 //==============================================================================
415 //==============================================================================
416 // UIE Bits
418 extern __at(0x0F60) __sfr UIE;
420 typedef struct
422 unsigned URSTIE : 1;
423 unsigned UERRIE : 1;
424 unsigned ACTVIE : 1;
425 unsigned TRNIE : 1;
426 unsigned IDLEIE : 1;
427 unsigned STALLIE : 1;
428 unsigned SOFIE : 1;
429 unsigned : 1;
430 } __UIEbits_t;
432 extern __at(0x0F60) volatile __UIEbits_t UIEbits;
434 #define _URSTIE 0x01
435 #define _UERRIE 0x02
436 #define _ACTVIE 0x04
437 #define _TRNIE 0x08
438 #define _IDLEIE 0x10
439 #define _STALLIE 0x20
440 #define _SOFIE 0x40
442 //==============================================================================
445 //==============================================================================
446 // UCFG Bits
448 extern __at(0x0F61) __sfr UCFG;
450 typedef union
452 struct
454 unsigned PPB0 : 1;
455 unsigned PPB1 : 1;
456 unsigned FSEN : 1;
457 unsigned : 1;
458 unsigned UPUEN : 1;
459 unsigned : 1;
460 unsigned : 1;
461 unsigned UTEYE : 1;
464 struct
466 unsigned PPB : 2;
467 unsigned : 6;
469 } __UCFGbits_t;
471 extern __at(0x0F61) volatile __UCFGbits_t UCFGbits;
473 #define _PPB0 0x01
474 #define _PPB1 0x02
475 #define _FSEN 0x04
476 #define _UPUEN 0x10
477 #define _UTEYE 0x80
479 //==============================================================================
482 //==============================================================================
483 // UIR Bits
485 extern __at(0x0F62) __sfr UIR;
487 typedef struct
489 unsigned URSTIF : 1;
490 unsigned UERRIF : 1;
491 unsigned ACTVIF : 1;
492 unsigned TRNIF : 1;
493 unsigned IDLEIF : 1;
494 unsigned STALLIF : 1;
495 unsigned SOFIF : 1;
496 unsigned : 1;
497 } __UIRbits_t;
499 extern __at(0x0F62) volatile __UIRbits_t UIRbits;
501 #define _URSTIF 0x01
502 #define _UERRIF 0x02
503 #define _ACTVIF 0x04
504 #define _TRNIF 0x08
505 #define _IDLEIF 0x10
506 #define _STALLIF 0x20
507 #define _SOFIF 0x40
509 //==============================================================================
512 //==============================================================================
513 // USTAT Bits
515 extern __at(0x0F63) __sfr USTAT;
517 typedef union
519 struct
521 unsigned : 1;
522 unsigned PPBI : 1;
523 unsigned DIR : 1;
524 unsigned ENDP0 : 1;
525 unsigned ENDP1 : 1;
526 unsigned ENDP2 : 1;
527 unsigned ENDP3 : 1;
528 unsigned : 1;
531 struct
533 unsigned : 3;
534 unsigned ENDP : 4;
535 unsigned : 1;
537 } __USTATbits_t;
539 extern __at(0x0F63) volatile __USTATbits_t USTATbits;
541 #define _PPBI 0x02
542 #define _DIR 0x04
543 #define _ENDP0 0x08
544 #define _ENDP1 0x10
545 #define _ENDP2 0x20
546 #define _ENDP3 0x40
548 //==============================================================================
551 //==============================================================================
552 // UCON Bits
554 extern __at(0x0F64) __sfr UCON;
556 typedef struct
558 unsigned : 1;
559 unsigned SUSPND : 1;
560 unsigned RESUME : 1;
561 unsigned USBEN : 1;
562 unsigned PKTDIS : 1;
563 unsigned SE0 : 1;
564 unsigned PPBRST : 1;
565 unsigned : 1;
566 } __UCONbits_t;
568 extern __at(0x0F64) volatile __UCONbits_t UCONbits;
570 #define _SUSPND 0x02
571 #define _RESUME 0x04
572 #define _USBEN 0x08
573 #define _PKTDIS 0x10
574 #define _SE0 0x20
575 #define _PPBRST 0x40
577 //==============================================================================
580 //==============================================================================
581 // SRCON0 Bits
583 extern __at(0x0F68) __sfr SRCON0;
585 typedef union
587 struct
589 unsigned SRPR : 1;
590 unsigned SRPS : 1;
591 unsigned SRNQEN : 1;
592 unsigned SRQEN : 1;
593 unsigned SRCLK0 : 1;
594 unsigned SRCLK1 : 1;
595 unsigned SRCLK2 : 1;
596 unsigned SRLEN : 1;
599 struct
601 unsigned : 4;
602 unsigned SRCLK : 3;
603 unsigned : 1;
605 } __SRCON0bits_t;
607 extern __at(0x0F68) volatile __SRCON0bits_t SRCON0bits;
609 #define _SRPR 0x01
610 #define _SRPS 0x02
611 #define _SRNQEN 0x04
612 #define _SRQEN 0x08
613 #define _SRCLK0 0x10
614 #define _SRCLK1 0x20
615 #define _SRCLK2 0x40
616 #define _SRLEN 0x80
618 //==============================================================================
621 //==============================================================================
622 // SRCON1 Bits
624 extern __at(0x0F69) __sfr SRCON1;
626 typedef struct
628 unsigned SRRC1E : 1;
629 unsigned SRRC2E : 1;
630 unsigned SRRCKE : 1;
631 unsigned SRRPE : 1;
632 unsigned SRSC1E : 1;
633 unsigned SRSC2E : 1;
634 unsigned SRSCKE : 1;
635 unsigned SRSPE : 1;
636 } __SRCON1bits_t;
638 extern __at(0x0F69) volatile __SRCON1bits_t SRCON1bits;
640 #define _SRRC1E 0x01
641 #define _SRRC2E 0x02
642 #define _SRRCKE 0x04
643 #define _SRRPE 0x08
644 #define _SRSC1E 0x10
645 #define _SRSC2E 0x20
646 #define _SRSCKE 0x40
647 #define _SRSPE 0x80
649 //==============================================================================
652 //==============================================================================
653 // CM2CON0 Bits
655 extern __at(0x0F6B) __sfr CM2CON0;
657 typedef union
659 struct
661 unsigned C2CH0 : 1;
662 unsigned C2CH1 : 1;
663 unsigned C2R : 1;
664 unsigned C2SP : 1;
665 unsigned C2POL : 1;
666 unsigned C2OE : 1;
667 unsigned C2OUT : 1;
668 unsigned C2ON : 1;
671 struct
673 unsigned C2CH : 2;
674 unsigned : 6;
676 } __CM2CON0bits_t;
678 extern __at(0x0F6B) volatile __CM2CON0bits_t CM2CON0bits;
680 #define _C2CH0 0x01
681 #define _C2CH1 0x02
682 #define _C2R 0x04
683 #define _C2SP 0x08
684 #define _C2POL 0x10
685 #define _C2OE 0x20
686 #define _C2OUT 0x40
687 #define _C2ON 0x80
689 //==============================================================================
692 //==============================================================================
693 // CM2CON1 Bits
695 extern __at(0x0F6C) __sfr CM2CON1;
697 typedef struct
699 unsigned C2SYNC : 1;
700 unsigned C1SYNC : 1;
701 unsigned C2HYS : 1;
702 unsigned C1HYS : 1;
703 unsigned C2RSEL : 1;
704 unsigned C1RSEL : 1;
705 unsigned MC2OUT : 1;
706 unsigned MC1OUT : 1;
707 } __CM2CON1bits_t;
709 extern __at(0x0F6C) volatile __CM2CON1bits_t CM2CON1bits;
711 #define _C2SYNC 0x01
712 #define _C1SYNC 0x02
713 #define _C2HYS 0x04
714 #define _C1HYS 0x08
715 #define _C2RSEL 0x10
716 #define _C1RSEL 0x20
717 #define _MC2OUT 0x40
718 #define _MC1OUT 0x80
720 //==============================================================================
723 //==============================================================================
724 // CM1CON0 Bits
726 extern __at(0x0F6D) __sfr CM1CON0;
728 typedef union
730 struct
732 unsigned C1CH0 : 1;
733 unsigned C1CH1 : 1;
734 unsigned C1R : 1;
735 unsigned C1SP : 1;
736 unsigned C1POL : 1;
737 unsigned C1OE : 1;
738 unsigned C1OUT : 1;
739 unsigned C1ON : 1;
742 struct
744 unsigned C1CH : 2;
745 unsigned : 6;
747 } __CM1CON0bits_t;
749 extern __at(0x0F6D) volatile __CM1CON0bits_t CM1CON0bits;
751 #define _C1CH0 0x01
752 #define _C1CH1 0x02
753 #define _C1R 0x04
754 #define _C1SP 0x08
755 #define _C1POL 0x10
756 #define _C1OE 0x20
757 #define _C1OUT 0x40
758 #define _C1ON 0x80
760 //==============================================================================
763 //==============================================================================
764 // SSPMSK Bits
766 extern __at(0x0F6F) __sfr SSPMSK;
768 typedef struct
770 unsigned MSK0 : 1;
771 unsigned MSK1 : 1;
772 unsigned MSK2 : 1;
773 unsigned MSK3 : 1;
774 unsigned MSK4 : 1;
775 unsigned MSK5 : 1;
776 unsigned MSK6 : 1;
777 unsigned MSK7 : 1;
778 } __SSPMSKbits_t;
780 extern __at(0x0F6F) volatile __SSPMSKbits_t SSPMSKbits;
782 #define _MSK0 0x01
783 #define _MSK1 0x02
784 #define _MSK2 0x04
785 #define _MSK3 0x08
786 #define _MSK4 0x10
787 #define _MSK5 0x20
788 #define _MSK6 0x40
789 #define _MSK7 0x80
791 //==============================================================================
794 //==============================================================================
795 // SLRCON Bits
797 extern __at(0x0F76) __sfr SLRCON;
799 typedef struct
801 unsigned SLRA : 1;
802 unsigned SLRB : 1;
803 unsigned SLRC : 1;
804 unsigned : 1;
805 unsigned : 1;
806 unsigned : 1;
807 unsigned : 1;
808 unsigned : 1;
809 } __SLRCONbits_t;
811 extern __at(0x0F76) volatile __SLRCONbits_t SLRCONbits;
813 #define _SLRA 0x01
814 #define _SLRB 0x02
815 #define _SLRC 0x04
817 //==============================================================================
820 //==============================================================================
821 // WPUA Bits
823 extern __at(0x0F77) __sfr WPUA;
825 typedef struct
827 unsigned : 1;
828 unsigned : 1;
829 unsigned : 1;
830 unsigned WPUA3 : 1;
831 unsigned WPUA4 : 1;
832 unsigned WPUA5 : 1;
833 unsigned : 1;
834 unsigned : 1;
835 } __WPUAbits_t;
837 extern __at(0x0F77) volatile __WPUAbits_t WPUAbits;
839 #define _WPUA3 0x08
840 #define _WPUA4 0x10
841 #define _WPUA5 0x20
843 //==============================================================================
846 //==============================================================================
847 // WPUB Bits
849 extern __at(0x0F78) __sfr WPUB;
851 typedef struct
853 unsigned : 1;
854 unsigned : 1;
855 unsigned : 1;
856 unsigned : 1;
857 unsigned WPUB4 : 1;
858 unsigned WPUB5 : 1;
859 unsigned WPUB6 : 1;
860 unsigned WPUB7 : 1;
861 } __WPUBbits_t;
863 extern __at(0x0F78) volatile __WPUBbits_t WPUBbits;
865 #define _WPUB4 0x10
866 #define _WPUB5 0x20
867 #define _WPUB6 0x40
868 #define _WPUB7 0x80
870 //==============================================================================
873 //==============================================================================
874 // IOCA Bits
876 extern __at(0x0F79) __sfr IOCA;
878 typedef struct
880 unsigned IOCA0 : 1;
881 unsigned IOCA1 : 1;
882 unsigned : 1;
883 unsigned IOCA3 : 1;
884 unsigned IOCA4 : 1;
885 unsigned IOCA5 : 1;
886 unsigned : 1;
887 unsigned : 1;
888 } __IOCAbits_t;
890 extern __at(0x0F79) volatile __IOCAbits_t IOCAbits;
892 #define _IOCA0 0x01
893 #define _IOCA1 0x02
894 #define _IOCA3 0x08
895 #define _IOCA4 0x10
896 #define _IOCA5 0x20
898 //==============================================================================
901 //==============================================================================
902 // IOCB Bits
904 extern __at(0x0F7A) __sfr IOCB;
906 typedef struct
908 unsigned : 1;
909 unsigned : 1;
910 unsigned : 1;
911 unsigned : 1;
912 unsigned IOCB4 : 1;
913 unsigned IOCB5 : 1;
914 unsigned IOCB6 : 1;
915 unsigned IOCB7 : 1;
916 } __IOCBbits_t;
918 extern __at(0x0F7A) volatile __IOCBbits_t IOCBbits;
920 #define _IOCB4 0x10
921 #define _IOCB5 0x20
922 #define _IOCB6 0x40
923 #define _IOCB7 0x80
925 //==============================================================================
928 //==============================================================================
929 // ANSEL Bits
931 extern __at(0x0F7E) __sfr ANSEL;
933 typedef struct
935 unsigned : 1;
936 unsigned : 1;
937 unsigned : 1;
938 unsigned ANS3 : 1;
939 unsigned ANS4 : 1;
940 unsigned ANS5 : 1;
941 unsigned ANS6 : 1;
942 unsigned ANS7 : 1;
943 } __ANSELbits_t;
945 extern __at(0x0F7E) volatile __ANSELbits_t ANSELbits;
947 #define _ANS3 0x08
948 #define _ANS4 0x10
949 #define _ANS5 0x20
950 #define _ANS6 0x40
951 #define _ANS7 0x80
953 //==============================================================================
956 //==============================================================================
957 // ANSELH Bits
959 extern __at(0x0F7F) __sfr ANSELH;
961 typedef struct
963 unsigned ANS8 : 1;
964 unsigned ANS9 : 1;
965 unsigned ANS10 : 1;
966 unsigned ANS11 : 1;
967 unsigned : 1;
968 unsigned : 1;
969 unsigned : 1;
970 unsigned : 1;
971 } __ANSELHbits_t;
973 extern __at(0x0F7F) volatile __ANSELHbits_t ANSELHbits;
975 #define _ANS8 0x01
976 #define _ANS9 0x02
977 #define _ANS10 0x04
978 #define _ANS11 0x08
980 //==============================================================================
983 //==============================================================================
984 // PORTA Bits
986 extern __at(0x0F80) __sfr PORTA;
988 typedef union
990 struct
992 unsigned RA0 : 1;
993 unsigned RA1 : 1;
994 unsigned : 1;
995 unsigned RA3 : 1;
996 unsigned RA4 : 1;
997 unsigned RA5 : 1;
998 unsigned : 1;
999 unsigned : 1;
1002 struct
1004 unsigned : 1;
1005 unsigned : 1;
1006 unsigned : 1;
1007 unsigned : 1;
1008 unsigned AN3 : 1;
1009 unsigned OSC1 : 1;
1010 unsigned : 1;
1011 unsigned : 1;
1014 struct
1016 unsigned : 1;
1017 unsigned : 1;
1018 unsigned : 1;
1019 unsigned : 1;
1020 unsigned OSC2 : 1;
1021 unsigned CLKIN : 1;
1022 unsigned : 1;
1023 unsigned : 1;
1026 struct
1028 unsigned : 1;
1029 unsigned : 1;
1030 unsigned : 1;
1031 unsigned : 1;
1032 unsigned CLKOUT : 1;
1033 unsigned : 1;
1034 unsigned : 1;
1035 unsigned : 1;
1037 } __PORTAbits_t;
1039 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1041 #define _PORTA_RA0 0x01
1042 #define _PORTA_RA1 0x02
1043 #define _PORTA_RA3 0x08
1044 #define _PORTA_RA4 0x10
1045 #define _PORTA_AN3 0x10
1046 #define _PORTA_OSC2 0x10
1047 #define _PORTA_CLKOUT 0x10
1048 #define _PORTA_RA5 0x20
1049 #define _PORTA_OSC1 0x20
1050 #define _PORTA_CLKIN 0x20
1052 //==============================================================================
1055 //==============================================================================
1056 // PORTB Bits
1058 extern __at(0x0F81) __sfr PORTB;
1060 typedef union
1062 struct
1064 unsigned : 1;
1065 unsigned : 1;
1066 unsigned : 1;
1067 unsigned : 1;
1068 unsigned RB4 : 1;
1069 unsigned RB5 : 1;
1070 unsigned RB6 : 1;
1071 unsigned RB7 : 1;
1074 struct
1076 unsigned : 1;
1077 unsigned : 1;
1078 unsigned : 1;
1079 unsigned : 1;
1080 unsigned SDI : 1;
1081 unsigned RX : 1;
1082 unsigned SCL : 1;
1083 unsigned TX : 1;
1086 struct
1088 unsigned : 1;
1089 unsigned : 1;
1090 unsigned : 1;
1091 unsigned : 1;
1092 unsigned SDA : 1;
1093 unsigned AN11 : 1;
1094 unsigned SCK : 1;
1095 unsigned CK : 1;
1098 struct
1100 unsigned : 1;
1101 unsigned : 1;
1102 unsigned : 1;
1103 unsigned : 1;
1104 unsigned AN10 : 1;
1105 unsigned : 1;
1106 unsigned : 1;
1107 unsigned : 1;
1109 } __PORTBbits_t;
1111 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1113 #define _PORTB_RB4 0x10
1114 #define _PORTB_SDI 0x10
1115 #define _PORTB_SDA 0x10
1116 #define _PORTB_AN10 0x10
1117 #define _PORTB_RB5 0x20
1118 #define _PORTB_RX 0x20
1119 #define _PORTB_AN11 0x20
1120 #define _PORTB_RB6 0x40
1121 #define _PORTB_SCL 0x40
1122 #define _PORTB_SCK 0x40
1123 #define _PORTB_RB7 0x80
1124 #define _PORTB_TX 0x80
1125 #define _PORTB_CK 0x80
1127 //==============================================================================
1130 //==============================================================================
1131 // PORTC Bits
1133 extern __at(0x0F82) __sfr PORTC;
1135 typedef union
1137 struct
1139 unsigned RC0 : 1;
1140 unsigned RC1 : 1;
1141 unsigned RC2 : 1;
1142 unsigned RC3 : 1;
1143 unsigned RC4 : 1;
1144 unsigned RC5 : 1;
1145 unsigned RC6 : 1;
1146 unsigned RC7 : 1;
1149 struct
1151 unsigned AN4 : 1;
1152 unsigned AN5 : 1;
1153 unsigned AN6 : 1;
1154 unsigned AN7 : 1;
1155 unsigned C12OUT : 1;
1156 unsigned CCP1 : 1;
1157 unsigned AN8 : 1;
1158 unsigned AN9 : 1;
1161 struct
1163 unsigned C12INP : 1;
1164 unsigned C12IN1M : 1;
1165 unsigned C12IN2M : 1;
1166 unsigned C12IN3M : 1;
1167 unsigned SRQ : 1;
1168 unsigned T0CKI : 1;
1169 unsigned NOT_SS : 1;
1170 unsigned T1OSCO : 1;
1173 struct
1175 unsigned INT0 : 1;
1176 unsigned INT1 : 1;
1177 unsigned INT2 : 1;
1178 unsigned PGM : 1;
1179 unsigned P1B : 1;
1180 unsigned P1A : 1;
1181 unsigned T13CKI : 1;
1182 unsigned SDO : 1;
1185 struct
1187 unsigned VREFP : 1;
1188 unsigned VREFM : 1;
1189 unsigned CVREF : 1;
1190 unsigned P1C : 1;
1191 unsigned : 1;
1192 unsigned : 1;
1193 unsigned T1OSCI : 1;
1194 unsigned : 1;
1197 struct
1199 unsigned : 1;
1200 unsigned : 1;
1201 unsigned P1D : 1;
1202 unsigned : 1;
1203 unsigned : 1;
1204 unsigned : 1;
1205 unsigned SS : 1;
1206 unsigned : 1;
1209 struct
1211 unsigned INT : 3;
1212 unsigned : 5;
1214 } __PORTCbits_t;
1216 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1218 #define _PORTC_RC0 0x01
1219 #define _PORTC_AN4 0x01
1220 #define _PORTC_C12INP 0x01
1221 #define _PORTC_INT0 0x01
1222 #define _PORTC_VREFP 0x01
1223 #define _PORTC_RC1 0x02
1224 #define _PORTC_AN5 0x02
1225 #define _PORTC_C12IN1M 0x02
1226 #define _PORTC_INT1 0x02
1227 #define _PORTC_VREFM 0x02
1228 #define _PORTC_RC2 0x04
1229 #define _PORTC_AN6 0x04
1230 #define _PORTC_C12IN2M 0x04
1231 #define _PORTC_INT2 0x04
1232 #define _PORTC_CVREF 0x04
1233 #define _PORTC_P1D 0x04
1234 #define _PORTC_RC3 0x08
1235 #define _PORTC_AN7 0x08
1236 #define _PORTC_C12IN3M 0x08
1237 #define _PORTC_PGM 0x08
1238 #define _PORTC_P1C 0x08
1239 #define _PORTC_RC4 0x10
1240 #define _PORTC_C12OUT 0x10
1241 #define _PORTC_SRQ 0x10
1242 #define _PORTC_P1B 0x10
1243 #define _PORTC_RC5 0x20
1244 #define _PORTC_CCP1 0x20
1245 #define _PORTC_T0CKI 0x20
1246 #define _PORTC_P1A 0x20
1247 #define _PORTC_RC6 0x40
1248 #define _PORTC_AN8 0x40
1249 #define _PORTC_NOT_SS 0x40
1250 #define _PORTC_T13CKI 0x40
1251 #define _PORTC_T1OSCI 0x40
1252 #define _PORTC_SS 0x40
1253 #define _PORTC_RC7 0x80
1254 #define _PORTC_AN9 0x80
1255 #define _PORTC_T1OSCO 0x80
1256 #define _PORTC_SDO 0x80
1258 //==============================================================================
1261 //==============================================================================
1262 // LATA Bits
1264 extern __at(0x0F89) __sfr LATA;
1266 typedef struct
1268 unsigned : 1;
1269 unsigned : 1;
1270 unsigned : 1;
1271 unsigned : 1;
1272 unsigned LATA4 : 1;
1273 unsigned LATA5 : 1;
1274 unsigned : 1;
1275 unsigned : 1;
1276 } __LATAbits_t;
1278 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1280 #define _LATA4 0x10
1281 #define _LATA5 0x20
1283 //==============================================================================
1286 //==============================================================================
1287 // LATB Bits
1289 extern __at(0x0F8A) __sfr LATB;
1291 typedef struct
1293 unsigned : 1;
1294 unsigned : 1;
1295 unsigned : 1;
1296 unsigned : 1;
1297 unsigned LATB4 : 1;
1298 unsigned LATB5 : 1;
1299 unsigned LATB6 : 1;
1300 unsigned LATB7 : 1;
1301 } __LATBbits_t;
1303 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1305 #define _LATB4 0x10
1306 #define _LATB5 0x20
1307 #define _LATB6 0x40
1308 #define _LATB7 0x80
1310 //==============================================================================
1313 //==============================================================================
1314 // LATC Bits
1316 extern __at(0x0F8B) __sfr LATC;
1318 typedef struct
1320 unsigned LATC0 : 1;
1321 unsigned LATC1 : 1;
1322 unsigned LATC2 : 1;
1323 unsigned LATC3 : 1;
1324 unsigned LATC4 : 1;
1325 unsigned LATC5 : 1;
1326 unsigned LATC6 : 1;
1327 unsigned LATC7 : 1;
1328 } __LATCbits_t;
1330 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1332 #define _LATC0 0x01
1333 #define _LATC1 0x02
1334 #define _LATC2 0x04
1335 #define _LATC3 0x08
1336 #define _LATC4 0x10
1337 #define _LATC5 0x20
1338 #define _LATC6 0x40
1339 #define _LATC7 0x80
1341 //==============================================================================
1344 //==============================================================================
1345 // DDRA Bits
1347 extern __at(0x0F92) __sfr DDRA;
1349 typedef union
1351 struct
1353 unsigned : 1;
1354 unsigned : 1;
1355 unsigned : 1;
1356 unsigned : 1;
1357 unsigned TRISA4 : 1;
1358 unsigned TRISA5 : 1;
1359 unsigned : 1;
1360 unsigned : 1;
1363 struct
1365 unsigned : 1;
1366 unsigned : 1;
1367 unsigned : 1;
1368 unsigned : 1;
1369 unsigned RA4 : 1;
1370 unsigned RA5 : 1;
1371 unsigned : 1;
1372 unsigned : 1;
1374 } __DDRAbits_t;
1376 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1378 #define _TRISA4 0x10
1379 #define _RA4 0x10
1380 #define _TRISA5 0x20
1381 #define _RA5 0x20
1383 //==============================================================================
1386 //==============================================================================
1387 // TRISA Bits
1389 extern __at(0x0F92) __sfr TRISA;
1391 typedef union
1393 struct
1395 unsigned : 1;
1396 unsigned : 1;
1397 unsigned : 1;
1398 unsigned : 1;
1399 unsigned TRISA4 : 1;
1400 unsigned TRISA5 : 1;
1401 unsigned : 1;
1402 unsigned : 1;
1405 struct
1407 unsigned : 1;
1408 unsigned : 1;
1409 unsigned : 1;
1410 unsigned : 1;
1411 unsigned RA4 : 1;
1412 unsigned RA5 : 1;
1413 unsigned : 1;
1414 unsigned : 1;
1416 } __TRISAbits_t;
1418 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1420 #define _TRISA_TRISA4 0x10
1421 #define _TRISA_RA4 0x10
1422 #define _TRISA_TRISA5 0x20
1423 #define _TRISA_RA5 0x20
1425 //==============================================================================
1428 //==============================================================================
1429 // DDRB Bits
1431 extern __at(0x0F93) __sfr DDRB;
1433 typedef union
1435 struct
1437 unsigned : 1;
1438 unsigned : 1;
1439 unsigned : 1;
1440 unsigned : 1;
1441 unsigned TRISB4 : 1;
1442 unsigned TRISB5 : 1;
1443 unsigned TRISB6 : 1;
1444 unsigned TRISB7 : 1;
1447 struct
1449 unsigned : 1;
1450 unsigned : 1;
1451 unsigned : 1;
1452 unsigned : 1;
1453 unsigned RB4 : 1;
1454 unsigned RB5 : 1;
1455 unsigned RB6 : 1;
1456 unsigned RB7 : 1;
1458 } __DDRBbits_t;
1460 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1462 #define _TRISB4 0x10
1463 #define _RB4 0x10
1464 #define _TRISB5 0x20
1465 #define _RB5 0x20
1466 #define _TRISB6 0x40
1467 #define _RB6 0x40
1468 #define _TRISB7 0x80
1469 #define _RB7 0x80
1471 //==============================================================================
1474 //==============================================================================
1475 // TRISB Bits
1477 extern __at(0x0F93) __sfr TRISB;
1479 typedef union
1481 struct
1483 unsigned : 1;
1484 unsigned : 1;
1485 unsigned : 1;
1486 unsigned : 1;
1487 unsigned TRISB4 : 1;
1488 unsigned TRISB5 : 1;
1489 unsigned TRISB6 : 1;
1490 unsigned TRISB7 : 1;
1493 struct
1495 unsigned : 1;
1496 unsigned : 1;
1497 unsigned : 1;
1498 unsigned : 1;
1499 unsigned RB4 : 1;
1500 unsigned RB5 : 1;
1501 unsigned RB6 : 1;
1502 unsigned RB7 : 1;
1504 } __TRISBbits_t;
1506 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1508 #define _TRISB_TRISB4 0x10
1509 #define _TRISB_RB4 0x10
1510 #define _TRISB_TRISB5 0x20
1511 #define _TRISB_RB5 0x20
1512 #define _TRISB_TRISB6 0x40
1513 #define _TRISB_RB6 0x40
1514 #define _TRISB_TRISB7 0x80
1515 #define _TRISB_RB7 0x80
1517 //==============================================================================
1520 //==============================================================================
1521 // DDRC Bits
1523 extern __at(0x0F94) __sfr DDRC;
1525 typedef union
1527 struct
1529 unsigned TRISC0 : 1;
1530 unsigned TRISC1 : 1;
1531 unsigned TRISC2 : 1;
1532 unsigned TRISC3 : 1;
1533 unsigned TRISC4 : 1;
1534 unsigned TRISC5 : 1;
1535 unsigned TRISC6 : 1;
1536 unsigned TRISC7 : 1;
1539 struct
1541 unsigned RC0 : 1;
1542 unsigned RC1 : 1;
1543 unsigned RC2 : 1;
1544 unsigned RC3 : 1;
1545 unsigned RC4 : 1;
1546 unsigned RC5 : 1;
1547 unsigned RC6 : 1;
1548 unsigned RC7 : 1;
1550 } __DDRCbits_t;
1552 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1554 #define _TRISC0 0x01
1555 #define _RC0 0x01
1556 #define _TRISC1 0x02
1557 #define _RC1 0x02
1558 #define _TRISC2 0x04
1559 #define _RC2 0x04
1560 #define _TRISC3 0x08
1561 #define _RC3 0x08
1562 #define _TRISC4 0x10
1563 #define _RC4 0x10
1564 #define _TRISC5 0x20
1565 #define _RC5 0x20
1566 #define _TRISC6 0x40
1567 #define _RC6 0x40
1568 #define _TRISC7 0x80
1569 #define _RC7 0x80
1571 //==============================================================================
1574 //==============================================================================
1575 // TRISC Bits
1577 extern __at(0x0F94) __sfr TRISC;
1579 typedef union
1581 struct
1583 unsigned TRISC0 : 1;
1584 unsigned TRISC1 : 1;
1585 unsigned TRISC2 : 1;
1586 unsigned TRISC3 : 1;
1587 unsigned TRISC4 : 1;
1588 unsigned TRISC5 : 1;
1589 unsigned TRISC6 : 1;
1590 unsigned TRISC7 : 1;
1593 struct
1595 unsigned RC0 : 1;
1596 unsigned RC1 : 1;
1597 unsigned RC2 : 1;
1598 unsigned RC3 : 1;
1599 unsigned RC4 : 1;
1600 unsigned RC5 : 1;
1601 unsigned RC6 : 1;
1602 unsigned RC7 : 1;
1604 } __TRISCbits_t;
1606 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1608 #define _TRISC_TRISC0 0x01
1609 #define _TRISC_RC0 0x01
1610 #define _TRISC_TRISC1 0x02
1611 #define _TRISC_RC1 0x02
1612 #define _TRISC_TRISC2 0x04
1613 #define _TRISC_RC2 0x04
1614 #define _TRISC_TRISC3 0x08
1615 #define _TRISC_RC3 0x08
1616 #define _TRISC_TRISC4 0x10
1617 #define _TRISC_RC4 0x10
1618 #define _TRISC_TRISC5 0x20
1619 #define _TRISC_RC5 0x20
1620 #define _TRISC_TRISC6 0x40
1621 #define _TRISC_RC6 0x40
1622 #define _TRISC_TRISC7 0x80
1623 #define _TRISC_RC7 0x80
1625 //==============================================================================
1628 //==============================================================================
1629 // OSCTUNE Bits
1631 extern __at(0x0F9B) __sfr OSCTUNE;
1633 typedef union
1635 struct
1637 unsigned TUN0 : 1;
1638 unsigned TUN1 : 1;
1639 unsigned TUN2 : 1;
1640 unsigned TUN3 : 1;
1641 unsigned TUN4 : 1;
1642 unsigned TUN5 : 1;
1643 unsigned SPLLEN : 1;
1644 unsigned INTSRC : 1;
1647 struct
1649 unsigned TUN : 6;
1650 unsigned : 2;
1652 } __OSCTUNEbits_t;
1654 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
1656 #define _TUN0 0x01
1657 #define _TUN1 0x02
1658 #define _TUN2 0x04
1659 #define _TUN3 0x08
1660 #define _TUN4 0x10
1661 #define _TUN5 0x20
1662 #define _SPLLEN 0x40
1663 #define _INTSRC 0x80
1665 //==============================================================================
1668 //==============================================================================
1669 // PIE1 Bits
1671 extern __at(0x0F9D) __sfr PIE1;
1673 typedef struct
1675 unsigned TMR1IE : 1;
1676 unsigned TMR2IE : 1;
1677 unsigned CCP1IE : 1;
1678 unsigned SSPIE : 1;
1679 unsigned TXIE : 1;
1680 unsigned RCIE : 1;
1681 unsigned ADIE : 1;
1682 unsigned : 1;
1683 } __PIE1bits_t;
1685 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1687 #define _TMR1IE 0x01
1688 #define _TMR2IE 0x02
1689 #define _CCP1IE 0x04
1690 #define _SSPIE 0x08
1691 #define _TXIE 0x10
1692 #define _RCIE 0x20
1693 #define _ADIE 0x40
1695 //==============================================================================
1698 //==============================================================================
1699 // PIR1 Bits
1701 extern __at(0x0F9E) __sfr PIR1;
1703 typedef struct
1705 unsigned TMR1IF : 1;
1706 unsigned TMR2IF : 1;
1707 unsigned CCP1IF : 1;
1708 unsigned SSPIF : 1;
1709 unsigned TXIF : 1;
1710 unsigned RCIF : 1;
1711 unsigned ADIF : 1;
1712 unsigned : 1;
1713 } __PIR1bits_t;
1715 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1717 #define _TMR1IF 0x01
1718 #define _TMR2IF 0x02
1719 #define _CCP1IF 0x04
1720 #define _SSPIF 0x08
1721 #define _TXIF 0x10
1722 #define _RCIF 0x20
1723 #define _ADIF 0x40
1725 //==============================================================================
1728 //==============================================================================
1729 // IPR1 Bits
1731 extern __at(0x0F9F) __sfr IPR1;
1733 typedef struct
1735 unsigned TMR1IP : 1;
1736 unsigned TMR2IP : 1;
1737 unsigned CCP1IP : 1;
1738 unsigned SSPIP : 1;
1739 unsigned TXIP : 1;
1740 unsigned RCIP : 1;
1741 unsigned ADIP : 1;
1742 unsigned : 1;
1743 } __IPR1bits_t;
1745 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
1747 #define _TMR1IP 0x01
1748 #define _TMR2IP 0x02
1749 #define _CCP1IP 0x04
1750 #define _SSPIP 0x08
1751 #define _TXIP 0x10
1752 #define _RCIP 0x20
1753 #define _ADIP 0x40
1755 //==============================================================================
1758 //==============================================================================
1759 // PIE2 Bits
1761 extern __at(0x0FA0) __sfr PIE2;
1763 typedef struct
1765 unsigned : 1;
1766 unsigned TMR3IE : 1;
1767 unsigned USBIE : 1;
1768 unsigned BCLIE : 1;
1769 unsigned EEIE : 1;
1770 unsigned C2IE : 1;
1771 unsigned C1IE : 1;
1772 unsigned OSCFIE : 1;
1773 } __PIE2bits_t;
1775 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
1777 #define _TMR3IE 0x02
1778 #define _USBIE 0x04
1779 #define _BCLIE 0x08
1780 #define _EEIE 0x10
1781 #define _C2IE 0x20
1782 #define _C1IE 0x40
1783 #define _OSCFIE 0x80
1785 //==============================================================================
1788 //==============================================================================
1789 // PIR2 Bits
1791 extern __at(0x0FA1) __sfr PIR2;
1793 typedef struct
1795 unsigned : 1;
1796 unsigned TMR3IF : 1;
1797 unsigned USBIF : 1;
1798 unsigned BCLIF : 1;
1799 unsigned EEIF : 1;
1800 unsigned C2IF : 1;
1801 unsigned C1IF : 1;
1802 unsigned OSCFIF : 1;
1803 } __PIR2bits_t;
1805 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
1807 #define _TMR3IF 0x02
1808 #define _USBIF 0x04
1809 #define _BCLIF 0x08
1810 #define _EEIF 0x10
1811 #define _C2IF 0x20
1812 #define _C1IF 0x40
1813 #define _OSCFIF 0x80
1815 //==============================================================================
1818 //==============================================================================
1819 // IPR2 Bits
1821 extern __at(0x0FA2) __sfr IPR2;
1823 typedef struct
1825 unsigned : 1;
1826 unsigned TMR3IP : 1;
1827 unsigned USBIP : 1;
1828 unsigned BCLIP : 1;
1829 unsigned EEIP : 1;
1830 unsigned C2IP : 1;
1831 unsigned C1IP : 1;
1832 unsigned OSCFIP : 1;
1833 } __IPR2bits_t;
1835 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
1837 #define _TMR3IP 0x02
1838 #define _USBIP 0x04
1839 #define _BCLIP 0x08
1840 #define _EEIP 0x10
1841 #define _C2IP 0x20
1842 #define _C1IP 0x40
1843 #define _OSCFIP 0x80
1845 //==============================================================================
1848 //==============================================================================
1849 // EECON1 Bits
1851 extern __at(0x0FA6) __sfr EECON1;
1853 typedef struct
1855 unsigned RD : 1;
1856 unsigned WR : 1;
1857 unsigned WREN : 1;
1858 unsigned WRERR : 1;
1859 unsigned FREE : 1;
1860 unsigned : 1;
1861 unsigned CFGS : 1;
1862 unsigned EEPGD : 1;
1863 } __EECON1bits_t;
1865 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
1867 #define _RD 0x01
1868 #define _WR 0x02
1869 #define _WREN 0x04
1870 #define _WRERR 0x08
1871 #define _FREE 0x10
1872 #define _CFGS 0x40
1873 #define _EEPGD 0x80
1875 //==============================================================================
1877 extern __at(0x0FA7) __sfr EECON2;
1878 extern __at(0x0FA8) __sfr EEDATA;
1880 //==============================================================================
1881 // EEADR Bits
1883 extern __at(0x0FA9) __sfr EEADR;
1885 typedef struct
1887 unsigned EEADR0 : 1;
1888 unsigned EEADR1 : 1;
1889 unsigned EEADR2 : 1;
1890 unsigned EEADR3 : 1;
1891 unsigned EEADR4 : 1;
1892 unsigned EEADR5 : 1;
1893 unsigned EEADR6 : 1;
1894 unsigned EEADR7 : 1;
1895 } __EEADRbits_t;
1897 extern __at(0x0FA9) volatile __EEADRbits_t EEADRbits;
1899 #define _EEADR0 0x01
1900 #define _EEADR1 0x02
1901 #define _EEADR2 0x04
1902 #define _EEADR3 0x08
1903 #define _EEADR4 0x10
1904 #define _EEADR5 0x20
1905 #define _EEADR6 0x40
1906 #define _EEADR7 0x80
1908 //==============================================================================
1911 //==============================================================================
1912 // RCSTA Bits
1914 extern __at(0x0FAB) __sfr RCSTA;
1916 typedef union
1918 struct
1920 unsigned RX9D : 1;
1921 unsigned OERR : 1;
1922 unsigned FERR : 1;
1923 unsigned ADDEN : 1;
1924 unsigned CREN : 1;
1925 unsigned SREN : 1;
1926 unsigned RX9 : 1;
1927 unsigned SPEN : 1;
1930 struct
1932 unsigned : 1;
1933 unsigned : 1;
1934 unsigned : 1;
1935 unsigned ADEN : 1;
1936 unsigned : 1;
1937 unsigned : 1;
1938 unsigned : 1;
1939 unsigned : 1;
1941 } __RCSTAbits_t;
1943 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
1945 #define _RX9D 0x01
1946 #define _OERR 0x02
1947 #define _FERR 0x04
1948 #define _ADDEN 0x08
1949 #define _ADEN 0x08
1950 #define _CREN 0x10
1951 #define _SREN 0x20
1952 #define _RX9 0x40
1953 #define _SPEN 0x80
1955 //==============================================================================
1958 //==============================================================================
1959 // TXSTA Bits
1961 extern __at(0x0FAC) __sfr TXSTA;
1963 typedef struct
1965 unsigned TX9D : 1;
1966 unsigned TRMT : 1;
1967 unsigned BRGH : 1;
1968 unsigned SENDB : 1;
1969 unsigned SYNC : 1;
1970 unsigned TXEN : 1;
1971 unsigned TX9 : 1;
1972 unsigned CSRC : 1;
1973 } __TXSTAbits_t;
1975 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
1977 #define _TX9D 0x01
1978 #define _TRMT 0x02
1979 #define _BRGH 0x04
1980 #define _SENDB 0x08
1981 #define _SYNC 0x10
1982 #define _TXEN 0x20
1983 #define _TX9 0x40
1984 #define _CSRC 0x80
1986 //==============================================================================
1988 extern __at(0x0FAD) __sfr TXREG;
1989 extern __at(0x0FAE) __sfr RCREG;
1990 extern __at(0x0FAF) __sfr SPBRG;
1991 extern __at(0x0FB0) __sfr SPBRGH;
1993 //==============================================================================
1994 // T3CON Bits
1996 extern __at(0x0FB1) __sfr T3CON;
1998 typedef union
2000 struct
2002 unsigned TMR3ON : 1;
2003 unsigned TMR3CS : 1;
2004 unsigned NOT_T3SYNC : 1;
2005 unsigned T3CCP1 : 1;
2006 unsigned T3CKPS0 : 1;
2007 unsigned T3CKPS1 : 1;
2008 unsigned : 1;
2009 unsigned RD16 : 1;
2012 struct
2014 unsigned : 1;
2015 unsigned : 1;
2016 unsigned T3SYNC : 1;
2017 unsigned : 1;
2018 unsigned : 1;
2019 unsigned : 1;
2020 unsigned : 1;
2021 unsigned : 1;
2024 struct
2026 unsigned : 4;
2027 unsigned T3CKPS : 2;
2028 unsigned : 2;
2030 } __T3CONbits_t;
2032 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
2034 #define _T3CON_TMR3ON 0x01
2035 #define _T3CON_TMR3CS 0x02
2036 #define _T3CON_NOT_T3SYNC 0x04
2037 #define _T3CON_T3SYNC 0x04
2038 #define _T3CON_T3CCP1 0x08
2039 #define _T3CON_T3CKPS0 0x10
2040 #define _T3CON_T3CKPS1 0x20
2041 #define _T3CON_RD16 0x80
2043 //==============================================================================
2045 extern __at(0x0FB2) __sfr TMR3;
2046 extern __at(0x0FB2) __sfr TMR3L;
2047 extern __at(0x0FB3) __sfr TMR3H;
2049 //==============================================================================
2050 // ECCP1AS Bits
2052 extern __at(0x0FB6) __sfr ECCP1AS;
2054 typedef union
2056 struct
2058 unsigned PSSBD0 : 1;
2059 unsigned PSSBD1 : 1;
2060 unsigned PSSAC0 : 1;
2061 unsigned PSSAC1 : 1;
2062 unsigned ECCPAS0 : 1;
2063 unsigned ECCPAS1 : 1;
2064 unsigned ECCPAS2 : 1;
2065 unsigned ECCPASE : 1;
2068 struct
2070 unsigned PSSBD : 2;
2071 unsigned : 6;
2074 struct
2076 unsigned : 2;
2077 unsigned PSSAC : 2;
2078 unsigned : 4;
2081 struct
2083 unsigned : 4;
2084 unsigned ECCPAS : 3;
2085 unsigned : 1;
2087 } __ECCP1ASbits_t;
2089 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
2091 #define _PSSBD0 0x01
2092 #define _PSSBD1 0x02
2093 #define _PSSAC0 0x04
2094 #define _PSSAC1 0x08
2095 #define _ECCPAS0 0x10
2096 #define _ECCPAS1 0x20
2097 #define _ECCPAS2 0x40
2098 #define _ECCPASE 0x80
2100 //==============================================================================
2103 //==============================================================================
2104 // PWM1CON Bits
2106 extern __at(0x0FB7) __sfr PWM1CON;
2108 typedef union
2110 struct
2112 unsigned PDC0 : 1;
2113 unsigned PDC1 : 1;
2114 unsigned PDC2 : 1;
2115 unsigned PDC3 : 1;
2116 unsigned PDC4 : 1;
2117 unsigned PDC5 : 1;
2118 unsigned PDC6 : 1;
2119 unsigned PRSEN : 1;
2122 struct
2124 unsigned PDC : 7;
2125 unsigned : 1;
2127 } __PWM1CONbits_t;
2129 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
2131 #define _PDC0 0x01
2132 #define _PDC1 0x02
2133 #define _PDC2 0x04
2134 #define _PDC3 0x08
2135 #define _PDC4 0x10
2136 #define _PDC5 0x20
2137 #define _PDC6 0x40
2138 #define _PRSEN 0x80
2140 //==============================================================================
2143 //==============================================================================
2144 // BAUDCON Bits
2146 extern __at(0x0FB8) __sfr BAUDCON;
2148 typedef union
2150 struct
2152 unsigned ABDEN : 1;
2153 unsigned WUE : 1;
2154 unsigned : 1;
2155 unsigned BRG16 : 1;
2156 unsigned CKTXP : 1;
2157 unsigned DTRXP : 1;
2158 unsigned RCIDL : 1;
2159 unsigned ABDOVF : 1;
2162 struct
2164 unsigned : 1;
2165 unsigned : 1;
2166 unsigned : 1;
2167 unsigned : 1;
2168 unsigned SCKP : 1;
2169 unsigned : 1;
2170 unsigned : 1;
2171 unsigned : 1;
2173 } __BAUDCONbits_t;
2175 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
2177 #define _ABDEN 0x01
2178 #define _WUE 0x02
2179 #define _BRG16 0x08
2180 #define _CKTXP 0x10
2181 #define _SCKP 0x10
2182 #define _DTRXP 0x20
2183 #define _RCIDL 0x40
2184 #define _ABDOVF 0x80
2186 //==============================================================================
2189 //==============================================================================
2190 // BAUDCTL Bits
2192 extern __at(0x0FB8) __sfr BAUDCTL;
2194 typedef union
2196 struct
2198 unsigned ABDEN : 1;
2199 unsigned WUE : 1;
2200 unsigned : 1;
2201 unsigned BRG16 : 1;
2202 unsigned CKTXP : 1;
2203 unsigned DTRXP : 1;
2204 unsigned RCIDL : 1;
2205 unsigned ABDOVF : 1;
2208 struct
2210 unsigned : 1;
2211 unsigned : 1;
2212 unsigned : 1;
2213 unsigned : 1;
2214 unsigned SCKP : 1;
2215 unsigned : 1;
2216 unsigned : 1;
2217 unsigned : 1;
2219 } __BAUDCTLbits_t;
2221 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
2223 #define _BAUDCTL_ABDEN 0x01
2224 #define _BAUDCTL_WUE 0x02
2225 #define _BAUDCTL_BRG16 0x08
2226 #define _BAUDCTL_CKTXP 0x10
2227 #define _BAUDCTL_SCKP 0x10
2228 #define _BAUDCTL_DTRXP 0x20
2229 #define _BAUDCTL_RCIDL 0x40
2230 #define _BAUDCTL_ABDOVF 0x80
2232 //==============================================================================
2235 //==============================================================================
2236 // PSTRCON Bits
2238 extern __at(0x0FB9) __sfr PSTRCON;
2240 typedef struct
2242 unsigned STRA : 1;
2243 unsigned STRB : 1;
2244 unsigned STRC : 1;
2245 unsigned STRD : 1;
2246 unsigned STRSYNC : 1;
2247 unsigned : 1;
2248 unsigned : 1;
2249 unsigned : 1;
2250 } __PSTRCONbits_t;
2252 extern __at(0x0FB9) volatile __PSTRCONbits_t PSTRCONbits;
2254 #define _STRA 0x01
2255 #define _STRB 0x02
2256 #define _STRC 0x04
2257 #define _STRD 0x08
2258 #define _STRSYNC 0x10
2260 //==============================================================================
2263 //==============================================================================
2264 // REFCON0 Bits
2266 extern __at(0x0FBA) __sfr REFCON0;
2268 typedef union
2270 struct
2272 unsigned : 1;
2273 unsigned : 1;
2274 unsigned : 1;
2275 unsigned : 1;
2276 unsigned FVR1S0 : 1;
2277 unsigned FVR1S1 : 1;
2278 unsigned FVR1ST : 1;
2279 unsigned FVR1EN : 1;
2282 struct
2284 unsigned : 4;
2285 unsigned FVR1S : 2;
2286 unsigned : 2;
2288 } __REFCON0bits_t;
2290 extern __at(0x0FBA) volatile __REFCON0bits_t REFCON0bits;
2292 #define _FVR1S0 0x10
2293 #define _FVR1S1 0x20
2294 #define _FVR1ST 0x40
2295 #define _FVR1EN 0x80
2297 //==============================================================================
2300 //==============================================================================
2301 // VREFCON0 Bits
2303 extern __at(0x0FBA) __sfr VREFCON0;
2305 typedef union
2307 struct
2309 unsigned : 1;
2310 unsigned : 1;
2311 unsigned : 1;
2312 unsigned : 1;
2313 unsigned FVR1S0 : 1;
2314 unsigned FVR1S1 : 1;
2315 unsigned FVR1ST : 1;
2316 unsigned FVR1EN : 1;
2319 struct
2321 unsigned : 4;
2322 unsigned FVR1S : 2;
2323 unsigned : 2;
2325 } __VREFCON0bits_t;
2327 extern __at(0x0FBA) volatile __VREFCON0bits_t VREFCON0bits;
2329 #define _VREFCON0_FVR1S0 0x10
2330 #define _VREFCON0_FVR1S1 0x20
2331 #define _VREFCON0_FVR1ST 0x40
2332 #define _VREFCON0_FVR1EN 0x80
2334 //==============================================================================
2337 //==============================================================================
2338 // REFCON1 Bits
2340 extern __at(0x0FBB) __sfr REFCON1;
2342 typedef union
2344 struct
2346 unsigned D1NSS : 1;
2347 unsigned : 1;
2348 unsigned D1PSS0 : 1;
2349 unsigned D1PSS1 : 1;
2350 unsigned : 1;
2351 unsigned DAC1OE : 1;
2352 unsigned D1LPS : 1;
2353 unsigned D1EN : 1;
2356 struct
2358 unsigned : 2;
2359 unsigned D1PSS : 2;
2360 unsigned : 4;
2362 } __REFCON1bits_t;
2364 extern __at(0x0FBB) volatile __REFCON1bits_t REFCON1bits;
2366 #define _D1NSS 0x01
2367 #define _D1PSS0 0x04
2368 #define _D1PSS1 0x08
2369 #define _DAC1OE 0x20
2370 #define _D1LPS 0x40
2371 #define _D1EN 0x80
2373 //==============================================================================
2376 //==============================================================================
2377 // VREFCON1 Bits
2379 extern __at(0x0FBB) __sfr VREFCON1;
2381 typedef union
2383 struct
2385 unsigned D1NSS : 1;
2386 unsigned : 1;
2387 unsigned D1PSS0 : 1;
2388 unsigned D1PSS1 : 1;
2389 unsigned : 1;
2390 unsigned DAC1OE : 1;
2391 unsigned D1LPS : 1;
2392 unsigned D1EN : 1;
2395 struct
2397 unsigned : 2;
2398 unsigned D1PSS : 2;
2399 unsigned : 4;
2401 } __VREFCON1bits_t;
2403 extern __at(0x0FBB) volatile __VREFCON1bits_t VREFCON1bits;
2405 #define _VREFCON1_D1NSS 0x01
2406 #define _VREFCON1_D1PSS0 0x04
2407 #define _VREFCON1_D1PSS1 0x08
2408 #define _VREFCON1_DAC1OE 0x20
2409 #define _VREFCON1_D1LPS 0x40
2410 #define _VREFCON1_D1EN 0x80
2412 //==============================================================================
2415 //==============================================================================
2416 // REFCON2 Bits
2418 extern __at(0x0FBC) __sfr REFCON2;
2420 typedef union
2422 struct
2424 unsigned DAC1R0 : 1;
2425 unsigned DAC1R1 : 1;
2426 unsigned DAC1R2 : 1;
2427 unsigned DAC1R3 : 1;
2428 unsigned DAC1R4 : 1;
2429 unsigned : 1;
2430 unsigned : 1;
2431 unsigned : 1;
2434 struct
2436 unsigned DAC1R : 5;
2437 unsigned : 3;
2439 } __REFCON2bits_t;
2441 extern __at(0x0FBC) volatile __REFCON2bits_t REFCON2bits;
2443 #define _DAC1R0 0x01
2444 #define _DAC1R1 0x02
2445 #define _DAC1R2 0x04
2446 #define _DAC1R3 0x08
2447 #define _DAC1R4 0x10
2449 //==============================================================================
2452 //==============================================================================
2453 // VREFCON2 Bits
2455 extern __at(0x0FBC) __sfr VREFCON2;
2457 typedef union
2459 struct
2461 unsigned DAC1R0 : 1;
2462 unsigned DAC1R1 : 1;
2463 unsigned DAC1R2 : 1;
2464 unsigned DAC1R3 : 1;
2465 unsigned DAC1R4 : 1;
2466 unsigned : 1;
2467 unsigned : 1;
2468 unsigned : 1;
2471 struct
2473 unsigned DAC1R : 5;
2474 unsigned : 3;
2476 } __VREFCON2bits_t;
2478 extern __at(0x0FBC) volatile __VREFCON2bits_t VREFCON2bits;
2480 #define _VREFCON2_DAC1R0 0x01
2481 #define _VREFCON2_DAC1R1 0x02
2482 #define _VREFCON2_DAC1R2 0x04
2483 #define _VREFCON2_DAC1R3 0x08
2484 #define _VREFCON2_DAC1R4 0x10
2486 //==============================================================================
2489 //==============================================================================
2490 // CCP1CON Bits
2492 extern __at(0x0FBD) __sfr CCP1CON;
2494 typedef union
2496 struct
2498 unsigned CCP1M0 : 1;
2499 unsigned CCP1M1 : 1;
2500 unsigned CCP1M2 : 1;
2501 unsigned CCP1M3 : 1;
2502 unsigned DC1B0 : 1;
2503 unsigned DC1B1 : 1;
2504 unsigned P1M0 : 1;
2505 unsigned P1M1 : 1;
2508 struct
2510 unsigned CCP1M : 4;
2511 unsigned : 4;
2514 struct
2516 unsigned : 4;
2517 unsigned DC1B : 2;
2518 unsigned : 2;
2521 struct
2523 unsigned : 6;
2524 unsigned P1M : 2;
2526 } __CCP1CONbits_t;
2528 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
2530 #define _CCP1M0 0x01
2531 #define _CCP1M1 0x02
2532 #define _CCP1M2 0x04
2533 #define _CCP1M3 0x08
2534 #define _DC1B0 0x10
2535 #define _DC1B1 0x20
2536 #define _P1M0 0x40
2537 #define _P1M1 0x80
2539 //==============================================================================
2541 extern __at(0x0FBE) __sfr CCPR1;
2542 extern __at(0x0FBE) __sfr CCPR1L;
2543 extern __at(0x0FBF) __sfr CCPR1H;
2545 //==============================================================================
2546 // ADCON2 Bits
2548 extern __at(0x0FC0) __sfr ADCON2;
2550 typedef union
2552 struct
2554 unsigned ADCS0 : 1;
2555 unsigned ADCS1 : 1;
2556 unsigned ADCS2 : 1;
2557 unsigned ACQT0 : 1;
2558 unsigned ACQT1 : 1;
2559 unsigned ACQT2 : 1;
2560 unsigned : 1;
2561 unsigned ADFM : 1;
2564 struct
2566 unsigned ADCS : 3;
2567 unsigned : 5;
2570 struct
2572 unsigned : 3;
2573 unsigned ACQT : 3;
2574 unsigned : 2;
2576 } __ADCON2bits_t;
2578 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
2580 #define _ADCS0 0x01
2581 #define _ADCS1 0x02
2582 #define _ADCS2 0x04
2583 #define _ACQT0 0x08
2584 #define _ACQT1 0x10
2585 #define _ACQT2 0x20
2586 #define _ADFM 0x80
2588 //==============================================================================
2591 //==============================================================================
2592 // ADCON1 Bits
2594 extern __at(0x0FC1) __sfr ADCON1;
2596 typedef union
2598 struct
2600 unsigned NVCFG0 : 1;
2601 unsigned NVCFG1 : 1;
2602 unsigned PVCFG0 : 1;
2603 unsigned PVCFG1 : 1;
2604 unsigned : 1;
2605 unsigned : 1;
2606 unsigned : 1;
2607 unsigned : 1;
2610 struct
2612 unsigned NVCFG : 2;
2613 unsigned : 6;
2616 struct
2618 unsigned : 2;
2619 unsigned PVCFG : 2;
2620 unsigned : 4;
2622 } __ADCON1bits_t;
2624 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
2626 #define _NVCFG0 0x01
2627 #define _NVCFG1 0x02
2628 #define _PVCFG0 0x04
2629 #define _PVCFG1 0x08
2631 //==============================================================================
2634 //==============================================================================
2635 // ADCON0 Bits
2637 extern __at(0x0FC2) __sfr ADCON0;
2639 typedef union
2641 struct
2643 unsigned ADON : 1;
2644 unsigned GO_NOT_DONE : 1;
2645 unsigned CHS0 : 1;
2646 unsigned CHS1 : 1;
2647 unsigned CHS2 : 1;
2648 unsigned CHS3 : 1;
2649 unsigned : 1;
2650 unsigned : 1;
2653 struct
2655 unsigned : 1;
2656 unsigned GO : 1;
2657 unsigned : 1;
2658 unsigned : 1;
2659 unsigned : 1;
2660 unsigned : 1;
2661 unsigned : 1;
2662 unsigned : 1;
2665 struct
2667 unsigned : 1;
2668 unsigned DONE : 1;
2669 unsigned : 1;
2670 unsigned : 1;
2671 unsigned : 1;
2672 unsigned : 1;
2673 unsigned : 1;
2674 unsigned : 1;
2677 struct
2679 unsigned : 1;
2680 unsigned NOT_DONE : 1;
2681 unsigned : 1;
2682 unsigned : 1;
2683 unsigned : 1;
2684 unsigned : 1;
2685 unsigned : 1;
2686 unsigned : 1;
2689 struct
2691 unsigned : 1;
2692 unsigned GO_DONE : 1;
2693 unsigned : 1;
2694 unsigned : 1;
2695 unsigned : 1;
2696 unsigned : 1;
2697 unsigned : 1;
2698 unsigned : 1;
2701 struct
2703 unsigned : 2;
2704 unsigned CHS : 4;
2705 unsigned : 2;
2707 } __ADCON0bits_t;
2709 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
2711 #define _ADON 0x01
2712 #define _GO_NOT_DONE 0x02
2713 #define _GO 0x02
2714 #define _DONE 0x02
2715 #define _NOT_DONE 0x02
2716 #define _GO_DONE 0x02
2717 #define _CHS0 0x04
2718 #define _CHS1 0x08
2719 #define _CHS2 0x10
2720 #define _CHS3 0x20
2722 //==============================================================================
2724 extern __at(0x0FC3) __sfr ADRES;
2725 extern __at(0x0FC3) __sfr ADRESL;
2726 extern __at(0x0FC4) __sfr ADRESH;
2728 //==============================================================================
2729 // SSPCON2 Bits
2731 extern __at(0x0FC5) __sfr SSPCON2;
2733 typedef struct
2735 unsigned SEN : 1;
2736 unsigned RSEN : 1;
2737 unsigned PEN : 1;
2738 unsigned RCEN : 1;
2739 unsigned ACKEN : 1;
2740 unsigned ACKDT : 1;
2741 unsigned ACKSTAT : 1;
2742 unsigned GCEN : 1;
2743 } __SSPCON2bits_t;
2745 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
2747 #define _SEN 0x01
2748 #define _RSEN 0x02
2749 #define _PEN 0x04
2750 #define _RCEN 0x08
2751 #define _ACKEN 0x10
2752 #define _ACKDT 0x20
2753 #define _ACKSTAT 0x40
2754 #define _GCEN 0x80
2756 //==============================================================================
2759 //==============================================================================
2760 // SSPCON1 Bits
2762 extern __at(0x0FC6) __sfr SSPCON1;
2764 typedef union
2766 struct
2768 unsigned SSPM0 : 1;
2769 unsigned SSPM1 : 1;
2770 unsigned SSPM2 : 1;
2771 unsigned SSPM3 : 1;
2772 unsigned CKP : 1;
2773 unsigned SSPEN : 1;
2774 unsigned SSPOV : 1;
2775 unsigned WCOL : 1;
2778 struct
2780 unsigned SSPM : 4;
2781 unsigned : 4;
2783 } __SSPCON1bits_t;
2785 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
2787 #define _SSPM0 0x01
2788 #define _SSPM1 0x02
2789 #define _SSPM2 0x04
2790 #define _SSPM3 0x08
2791 #define _CKP 0x10
2792 #define _SSPEN 0x20
2793 #define _SSPOV 0x40
2794 #define _WCOL 0x80
2796 //==============================================================================
2799 //==============================================================================
2800 // SSPSTAT Bits
2802 extern __at(0x0FC7) __sfr SSPSTAT;
2804 typedef union
2806 struct
2808 unsigned BF : 1;
2809 unsigned UA : 1;
2810 unsigned R_NOT_W : 1;
2811 unsigned S : 1;
2812 unsigned P : 1;
2813 unsigned D_NOT_A : 1;
2814 unsigned CKE : 1;
2815 unsigned SMP : 1;
2818 struct
2820 unsigned : 1;
2821 unsigned : 1;
2822 unsigned R : 1;
2823 unsigned : 1;
2824 unsigned : 1;
2825 unsigned D : 1;
2826 unsigned : 1;
2827 unsigned : 1;
2830 struct
2832 unsigned : 1;
2833 unsigned : 1;
2834 unsigned NOT_W : 1;
2835 unsigned : 1;
2836 unsigned : 1;
2837 unsigned NOT_A : 1;
2838 unsigned : 1;
2839 unsigned : 1;
2842 struct
2844 unsigned : 1;
2845 unsigned : 1;
2846 unsigned R_W : 1;
2847 unsigned : 1;
2848 unsigned : 1;
2849 unsigned D_A : 1;
2850 unsigned : 1;
2851 unsigned : 1;
2854 struct
2856 unsigned : 1;
2857 unsigned : 1;
2858 unsigned NOT_WRITE : 1;
2859 unsigned : 1;
2860 unsigned : 1;
2861 unsigned NOT_ADDRESS : 1;
2862 unsigned : 1;
2863 unsigned : 1;
2865 } __SSPSTATbits_t;
2867 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
2869 #define _BF 0x01
2870 #define _UA 0x02
2871 #define _R_NOT_W 0x04
2872 #define _R 0x04
2873 #define _NOT_W 0x04
2874 #define _R_W 0x04
2875 #define _NOT_WRITE 0x04
2876 #define _S 0x08
2877 #define _P 0x10
2878 #define _D_NOT_A 0x20
2879 #define _D 0x20
2880 #define _NOT_A 0x20
2881 #define _D_A 0x20
2882 #define _NOT_ADDRESS 0x20
2883 #define _CKE 0x40
2884 #define _SMP 0x80
2886 //==============================================================================
2888 extern __at(0x0FC8) __sfr SSPADD;
2889 extern __at(0x0FC9) __sfr SSPBUF;
2891 //==============================================================================
2892 // T2CON Bits
2894 extern __at(0x0FCA) __sfr T2CON;
2896 typedef union
2898 struct
2900 unsigned T2CKPS0 : 1;
2901 unsigned T2CKPS1 : 1;
2902 unsigned TMR2ON : 1;
2903 unsigned T2OUTPS0 : 1;
2904 unsigned T2OUTPS1 : 1;
2905 unsigned T2OUTPS2 : 1;
2906 unsigned T2OUTPS3 : 1;
2907 unsigned : 1;
2910 struct
2912 unsigned T2CKPS : 2;
2913 unsigned : 6;
2916 struct
2918 unsigned : 3;
2919 unsigned T2OUTPS : 4;
2920 unsigned : 1;
2922 } __T2CONbits_t;
2924 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
2926 #define _T2CKPS0 0x01
2927 #define _T2CKPS1 0x02
2928 #define _TMR2ON 0x04
2929 #define _T2OUTPS0 0x08
2930 #define _T2OUTPS1 0x10
2931 #define _T2OUTPS2 0x20
2932 #define _T2OUTPS3 0x40
2934 //==============================================================================
2936 extern __at(0x0FCB) __sfr PR2;
2937 extern __at(0x0FCC) __sfr TMR2;
2939 //==============================================================================
2940 // T1CON Bits
2942 extern __at(0x0FCD) __sfr T1CON;
2944 typedef union
2946 struct
2948 unsigned TMR1ON : 1;
2949 unsigned TMR1CS : 1;
2950 unsigned NOT_T1SYNC : 1;
2951 unsigned T1OSCEN : 1;
2952 unsigned T1CKPS0 : 1;
2953 unsigned T1CKPS1 : 1;
2954 unsigned T1RUN : 1;
2955 unsigned RD16 : 1;
2958 struct
2960 unsigned : 1;
2961 unsigned : 1;
2962 unsigned T1SYNC : 1;
2963 unsigned : 1;
2964 unsigned : 1;
2965 unsigned : 1;
2966 unsigned : 1;
2967 unsigned : 1;
2970 struct
2972 unsigned : 4;
2973 unsigned T1CKPS : 2;
2974 unsigned : 2;
2976 } __T1CONbits_t;
2978 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
2980 #define _TMR1ON 0x01
2981 #define _TMR1CS 0x02
2982 #define _NOT_T1SYNC 0x04
2983 #define _T1SYNC 0x04
2984 #define _T1OSCEN 0x08
2985 #define _T1CKPS0 0x10
2986 #define _T1CKPS1 0x20
2987 #define _T1RUN 0x40
2988 #define _RD16 0x80
2990 //==============================================================================
2992 extern __at(0x0FCE) __sfr TMR1;
2993 extern __at(0x0FCE) __sfr TMR1L;
2994 extern __at(0x0FCF) __sfr TMR1H;
2996 //==============================================================================
2997 // RCON Bits
2999 extern __at(0x0FD0) __sfr RCON;
3001 typedef union
3003 struct
3005 unsigned NOT_BOR : 1;
3006 unsigned NOT_POR : 1;
3007 unsigned NOT_PD : 1;
3008 unsigned NOT_TO : 1;
3009 unsigned NOT_RI : 1;
3010 unsigned : 1;
3011 unsigned SBOREN : 1;
3012 unsigned IPEN : 1;
3015 struct
3017 unsigned BOR : 1;
3018 unsigned POR : 1;
3019 unsigned PD : 1;
3020 unsigned TO : 1;
3021 unsigned RI : 1;
3022 unsigned : 1;
3023 unsigned : 1;
3024 unsigned : 1;
3026 } __RCONbits_t;
3028 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
3030 #define _NOT_BOR 0x01
3031 #define _BOR 0x01
3032 #define _NOT_POR 0x02
3033 #define _POR 0x02
3034 #define _NOT_PD 0x04
3035 #define _PD 0x04
3036 #define _NOT_TO 0x08
3037 #define _TO 0x08
3038 #define _NOT_RI 0x10
3039 #define _RI 0x10
3040 #define _SBOREN 0x40
3041 #define _IPEN 0x80
3043 //==============================================================================
3046 //==============================================================================
3047 // WDTCON Bits
3049 extern __at(0x0FD1) __sfr WDTCON;
3051 typedef union
3053 struct
3055 unsigned SWDTEN : 1;
3056 unsigned : 1;
3057 unsigned : 1;
3058 unsigned : 1;
3059 unsigned : 1;
3060 unsigned : 1;
3061 unsigned : 1;
3062 unsigned : 1;
3065 struct
3067 unsigned SWDTE : 1;
3068 unsigned : 1;
3069 unsigned : 1;
3070 unsigned : 1;
3071 unsigned : 1;
3072 unsigned : 1;
3073 unsigned : 1;
3074 unsigned : 1;
3076 } __WDTCONbits_t;
3078 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
3080 #define _SWDTEN 0x01
3081 #define _SWDTE 0x01
3083 //==============================================================================
3086 //==============================================================================
3087 // OSCCON2 Bits
3089 extern __at(0x0FD2) __sfr OSCCON2;
3091 typedef struct
3093 unsigned LFIOFS : 1;
3094 unsigned HFIOFL : 1;
3095 unsigned PRI_SD : 1;
3096 unsigned : 1;
3097 unsigned : 1;
3098 unsigned : 1;
3099 unsigned : 1;
3100 unsigned : 1;
3101 } __OSCCON2bits_t;
3103 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
3105 #define _LFIOFS 0x01
3106 #define _HFIOFL 0x02
3107 #define _PRI_SD 0x04
3109 //==============================================================================
3112 //==============================================================================
3113 // OSCCON Bits
3115 extern __at(0x0FD3) __sfr OSCCON;
3117 typedef union
3119 struct
3121 unsigned SCS0 : 1;
3122 unsigned SCS1 : 1;
3123 unsigned IOFS : 1;
3124 unsigned OSTS : 1;
3125 unsigned IRCF0 : 1;
3126 unsigned IRCF1 : 1;
3127 unsigned IRCF2 : 1;
3128 unsigned IDLEN : 1;
3131 struct
3133 unsigned SCS : 2;
3134 unsigned : 6;
3137 struct
3139 unsigned : 4;
3140 unsigned IRCF : 3;
3141 unsigned : 1;
3143 } __OSCCONbits_t;
3145 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
3147 #define _SCS0 0x01
3148 #define _SCS1 0x02
3149 #define _IOFS 0x04
3150 #define _OSTS 0x08
3151 #define _IRCF0 0x10
3152 #define _IRCF1 0x20
3153 #define _IRCF2 0x40
3154 #define _IDLEN 0x80
3156 //==============================================================================
3159 //==============================================================================
3160 // T0CON Bits
3162 extern __at(0x0FD5) __sfr T0CON;
3164 typedef union
3166 struct
3168 unsigned T0PS0 : 1;
3169 unsigned T0PS1 : 1;
3170 unsigned T0PS2 : 1;
3171 unsigned PSA : 1;
3172 unsigned T0SE : 1;
3173 unsigned T0CS : 1;
3174 unsigned T08BIT : 1;
3175 unsigned TMR0ON : 1;
3178 struct
3180 unsigned T0PS : 3;
3181 unsigned : 5;
3183 } __T0CONbits_t;
3185 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
3187 #define _T0PS0 0x01
3188 #define _T0PS1 0x02
3189 #define _T0PS2 0x04
3190 #define _PSA 0x08
3191 #define _T0SE 0x10
3192 #define _T0CS 0x20
3193 #define _T08BIT 0x40
3194 #define _TMR0ON 0x80
3196 //==============================================================================
3198 extern __at(0x0FD6) __sfr TMR0;
3199 extern __at(0x0FD6) __sfr TMR0L;
3200 extern __at(0x0FD7) __sfr TMR0H;
3202 //==============================================================================
3203 // STATUS Bits
3205 extern __at(0x0FD8) __sfr STATUS;
3207 typedef struct
3209 unsigned C : 1;
3210 unsigned DC : 1;
3211 unsigned Z : 1;
3212 unsigned OV : 1;
3213 unsigned N : 1;
3214 unsigned : 1;
3215 unsigned : 1;
3216 unsigned : 1;
3217 } __STATUSbits_t;
3219 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3221 #define _C 0x01
3222 #define _DC 0x02
3223 #define _Z 0x04
3224 #define _OV 0x08
3225 #define _N 0x10
3227 //==============================================================================
3229 extern __at(0x0FD9) __sfr FSR2L;
3230 extern __at(0x0FDA) __sfr FSR2H;
3231 extern __at(0x0FDB) __sfr PLUSW2;
3232 extern __at(0x0FDC) __sfr PREINC2;
3233 extern __at(0x0FDD) __sfr POSTDEC2;
3234 extern __at(0x0FDE) __sfr POSTINC2;
3235 extern __at(0x0FDF) __sfr INDF2;
3236 extern __at(0x0FE0) __sfr BSR;
3237 extern __at(0x0FE1) __sfr FSR1L;
3238 extern __at(0x0FE2) __sfr FSR1H;
3239 extern __at(0x0FE3) __sfr PLUSW1;
3240 extern __at(0x0FE4) __sfr PREINC1;
3241 extern __at(0x0FE5) __sfr POSTDEC1;
3242 extern __at(0x0FE6) __sfr POSTINC1;
3243 extern __at(0x0FE7) __sfr INDF1;
3244 extern __at(0x0FE8) __sfr WREG;
3245 extern __at(0x0FE9) __sfr FSR0L;
3246 extern __at(0x0FEA) __sfr FSR0H;
3247 extern __at(0x0FEB) __sfr PLUSW0;
3248 extern __at(0x0FEC) __sfr PREINC0;
3249 extern __at(0x0FED) __sfr POSTDEC0;
3250 extern __at(0x0FEE) __sfr POSTINC0;
3251 extern __at(0x0FEF) __sfr INDF0;
3253 //==============================================================================
3254 // INTCON3 Bits
3256 extern __at(0x0FF0) __sfr INTCON3;
3258 typedef union
3260 struct
3262 unsigned INT1IF : 1;
3263 unsigned INT2IF : 1;
3264 unsigned : 1;
3265 unsigned INT1IE : 1;
3266 unsigned INT2IE : 1;
3267 unsigned : 1;
3268 unsigned INT1IP : 1;
3269 unsigned INT2IP : 1;
3272 struct
3274 unsigned INT1F : 1;
3275 unsigned INT2F : 1;
3276 unsigned : 1;
3277 unsigned INT1E : 1;
3278 unsigned INT2E : 1;
3279 unsigned : 1;
3280 unsigned INT1P : 1;
3281 unsigned INT2P : 1;
3283 } __INTCON3bits_t;
3285 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3287 #define _INT1IF 0x01
3288 #define _INT1F 0x01
3289 #define _INT2IF 0x02
3290 #define _INT2F 0x02
3291 #define _INT1IE 0x08
3292 #define _INT1E 0x08
3293 #define _INT2IE 0x10
3294 #define _INT2E 0x10
3295 #define _INT1IP 0x40
3296 #define _INT1P 0x40
3297 #define _INT2IP 0x80
3298 #define _INT2P 0x80
3300 //==============================================================================
3303 //==============================================================================
3304 // INTCON2 Bits
3306 extern __at(0x0FF1) __sfr INTCON2;
3308 typedef union
3310 struct
3312 unsigned RABIP : 1;
3313 unsigned : 1;
3314 unsigned TMR0IP : 1;
3315 unsigned : 1;
3316 unsigned INTEDG2 : 1;
3317 unsigned INTEDG1 : 1;
3318 unsigned INTEDG0 : 1;
3319 unsigned NOT_RABPU : 1;
3322 struct
3324 unsigned : 1;
3325 unsigned : 1;
3326 unsigned : 1;
3327 unsigned : 1;
3328 unsigned : 1;
3329 unsigned : 1;
3330 unsigned : 1;
3331 unsigned RABPU : 1;
3333 } __INTCON2bits_t;
3335 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3337 #define _RABIP 0x01
3338 #define _TMR0IP 0x04
3339 #define _INTEDG2 0x10
3340 #define _INTEDG1 0x20
3341 #define _INTEDG0 0x40
3342 #define _NOT_RABPU 0x80
3343 #define _RABPU 0x80
3345 //==============================================================================
3348 //==============================================================================
3349 // INTCON Bits
3351 extern __at(0x0FF2) __sfr INTCON;
3353 typedef union
3355 struct
3357 unsigned RABIF : 1;
3358 unsigned INT0IF : 1;
3359 unsigned TMR0IF : 1;
3360 unsigned RABIE : 1;
3361 unsigned INT0IE : 1;
3362 unsigned TMR0IE : 1;
3363 unsigned PEIE_GIEL : 1;
3364 unsigned GIE_GIEH : 1;
3367 struct
3369 unsigned : 1;
3370 unsigned INT0F : 1;
3371 unsigned T0IF : 1;
3372 unsigned : 1;
3373 unsigned INT0E : 1;
3374 unsigned T0IE : 1;
3375 unsigned PEIE : 1;
3376 unsigned GIE : 1;
3379 struct
3381 unsigned : 1;
3382 unsigned : 1;
3383 unsigned : 1;
3384 unsigned : 1;
3385 unsigned : 1;
3386 unsigned : 1;
3387 unsigned GIEL : 1;
3388 unsigned GIEH : 1;
3390 } __INTCONbits_t;
3392 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3394 #define _RABIF 0x01
3395 #define _INT0IF 0x02
3396 #define _INT0F 0x02
3397 #define _TMR0IF 0x04
3398 #define _T0IF 0x04
3399 #define _RABIE 0x08
3400 #define _INT0IE 0x10
3401 #define _INT0E 0x10
3402 #define _TMR0IE 0x20
3403 #define _T0IE 0x20
3404 #define _PEIE_GIEL 0x40
3405 #define _PEIE 0x40
3406 #define _GIEL 0x40
3407 #define _GIE_GIEH 0x80
3408 #define _GIE 0x80
3409 #define _GIEH 0x80
3411 //==============================================================================
3413 extern __at(0x0FF3) __sfr PROD;
3414 extern __at(0x0FF3) __sfr PRODL;
3415 extern __at(0x0FF4) __sfr PRODH;
3416 extern __at(0x0FF5) __sfr TABLAT;
3417 extern __at(0x0FF6) __sfr TBLPTR;
3418 extern __at(0x0FF6) __sfr TBLPTRL;
3419 extern __at(0x0FF7) __sfr TBLPTRH;
3420 extern __at(0x0FF8) __sfr TBLPTRU;
3421 extern __at(0x0FF9) __sfr PC;
3422 extern __at(0x0FF9) __sfr PCL;
3423 extern __at(0x0FFA) __sfr PCLATH;
3424 extern __at(0x0FFB) __sfr PCLATU;
3426 //==============================================================================
3427 // STKPTR Bits
3429 extern __at(0x0FFC) __sfr STKPTR;
3431 typedef union
3433 struct
3435 unsigned SP0 : 1;
3436 unsigned SP1 : 1;
3437 unsigned SP2 : 1;
3438 unsigned SP3 : 1;
3439 unsigned SP4 : 1;
3440 unsigned : 1;
3441 unsigned STKUNF : 1;
3442 unsigned STKFUL : 1;
3445 struct
3447 unsigned : 1;
3448 unsigned : 1;
3449 unsigned : 1;
3450 unsigned : 1;
3451 unsigned : 1;
3452 unsigned : 1;
3453 unsigned : 1;
3454 unsigned STKOVF : 1;
3457 struct
3459 unsigned SP : 5;
3460 unsigned : 3;
3462 } __STKPTRbits_t;
3464 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
3466 #define _SP0 0x01
3467 #define _SP1 0x02
3468 #define _SP2 0x04
3469 #define _SP3 0x08
3470 #define _SP4 0x10
3471 #define _STKUNF 0x40
3472 #define _STKFUL 0x80
3473 #define _STKOVF 0x80
3475 //==============================================================================
3477 extern __at(0x0FFD) __sfr TOS;
3478 extern __at(0x0FFD) __sfr TOSL;
3479 extern __at(0x0FFE) __sfr TOSH;
3480 extern __at(0x0FFF) __sfr TOSU;
3482 //==============================================================================
3484 // Configuration Bits
3486 //==============================================================================
3488 #define __CONFIG1L 0x300000
3489 #define __CONFIG1H 0x300001
3490 #define __CONFIG2L 0x300002
3491 #define __CONFIG2H 0x300003
3492 #define __CONFIG3H 0x300005
3493 #define __CONFIG4L 0x300006
3494 #define __CONFIG5L 0x300008
3495 #define __CONFIG5H 0x300009
3496 #define __CONFIG6L 0x30000A
3497 #define __CONFIG6H 0x30000B
3498 #define __CONFIG7L 0x30000C
3499 #define __CONFIG7H 0x30000D
3501 //----------------------------- CONFIG1L Options -------------------------------
3503 #define _CPUDIV_NOCLKDIV_1L 0xE7 // No CPU System Clock divide.
3504 #define _CPUDIV_CLKDIV2_1L 0xEF // CPU System Clock divided by 2.
3505 #define _CPUDIV_CLKDIV3_1L 0xF7 // CPU System Clock divided by 3.
3506 #define _CPUDIV_CLKDIV4_1L 0xFF // CPU System Clock divided by 4.
3507 #define _USBDIV_OFF_1L 0xDF // USB clock comes directly from the OSC1/OSC2 oscillator block; no divide.
3508 #define _USBDIV_ON_1L 0xFF // USB clock comes from the OSC1/OSC2 divided by 2.
3510 //----------------------------- CONFIG1H Options -------------------------------
3512 #define _FOSC_LP_1H 0xF0 // LP oscillator.
3513 #define _FOSC_XT_1H 0xF1 // XT oscillator.
3514 #define _FOSC_HS_1H 0xF2 // HS oscillator.
3515 #define _FOSC_ERCCLKOUT_1H 0xF3 // External RC oscillator, CLKOUT function on OSC2.
3516 #define _FOSC_ECCLKOUTH_1H 0xF4 // EC, CLKOUT function on OSC2 (high).
3517 #define _FOSC_ECH_1H 0xF5 // EC (high).
3518 #define _FOSC_ERC_1H 0xF7 // External RC oscillator.
3519 #define _FOSC_IRC_1H 0xF8 // Internal RC oscillator.
3520 #define _FOSC_IRCCLKOUT_1H 0xF9 // Internal RC oscillator, CLKOUT function on OSC2.
3521 #define _FOSC_ECCLKOUTM_1H 0xFA // EC, CLKOUT function on OSC2 (medium).
3522 #define _FOSC_ECM_1H 0xFB // EC (medium).
3523 #define _FOSC_ECCLKOUTL_1H 0xFC // EC, CLKOUT function on OSC2 (low).
3524 #define _FOSC_ECL_1H 0xFD // EC (low).
3525 #define _PLLEN_OFF_1H 0xEF // PLL is under software control.
3526 #define _PLLEN_ON_1H 0xFF // Oscillator multiplied by 4.
3527 #define _PCLKEN_OFF_1H 0xDF // Primary clock is under software control.
3528 #define _PCLKEN_ON_1H 0xFF // Primary clock enabled.
3529 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
3530 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
3531 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
3532 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
3534 //----------------------------- CONFIG2L Options -------------------------------
3536 #define _PWRTEN_ON_2L 0xFE // PWRT enabled.
3537 #define _PWRTEN_OFF_2L 0xFF // PWRT disabled.
3538 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
3539 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
3540 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
3541 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
3542 #define _BORV_30_2L 0xE7 // VBOR set to 3.0 V nominal.
3543 #define _BORV_27_2L 0xEF // VBOR set to 2.7 V nominal.
3544 #define _BORV_22_2L 0xF7 // VBOR set to 2.2 V nominal.
3545 #define _BORV_19_2L 0xFF // VBOR set to 1.9 V nominal.
3547 //----------------------------- CONFIG2H Options -------------------------------
3549 #define _WDTEN_OFF_2H 0xFE // WDT is controlled by SWDTEN bit of the WDTCON register.
3550 #define _WDTEN_ON_2H 0xFF // WDT is always enabled. SWDTEN bit has no effect.
3551 #define _WDTPS_1_2H 0xE1 // 1:1.
3552 #define _WDTPS_2_2H 0xE3 // 1:2.
3553 #define _WDTPS_4_2H 0xE5 // 1:4.
3554 #define _WDTPS_8_2H 0xE7 // 1:8.
3555 #define _WDTPS_16_2H 0xE9 // 1:16.
3556 #define _WDTPS_32_2H 0xEB // 1:32.
3557 #define _WDTPS_64_2H 0xED // 1:64.
3558 #define _WDTPS_128_2H 0xEF // 1:128.
3559 #define _WDTPS_256_2H 0xF1 // 1:256.
3560 #define _WDTPS_512_2H 0xF3 // 1:512.
3561 #define _WDTPS_1024_2H 0xF5 // 1:1024.
3562 #define _WDTPS_2048_2H 0xF7 // 1:2048.
3563 #define _WDTPS_4096_2H 0xF9 // 1:4096.
3564 #define _WDTPS_8192_2H 0xFB // 1:8192.
3565 #define _WDTPS_16384_2H 0xFD // 1:16384.
3566 #define _WDTPS_32768_2H 0xFF // 1:32768.
3568 //----------------------------- CONFIG3H Options -------------------------------
3570 #define _HFOFST_OFF_3H 0xF7 // The system clock is held off until the HFINTOSC is stable.
3571 #define _HFOFST_ON_3H 0xFF // HFINTOSC starts clocking the CPU without waiting for the oscillator to stablize.
3572 #define _MCLRE_OFF_3H 0x7F // RA3 input pin enabled; MCLR disabled.
3573 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RA3 input pin disabled.
3575 //----------------------------- CONFIG4L Options -------------------------------
3577 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
3578 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
3579 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
3580 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled.
3581 #define _BBSIZ_OFF_4L 0xF7 // 1kW boot block size.
3582 #define _BBSIZ_ON_4L 0xFF // 2kW boot block size.
3583 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
3584 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
3585 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RA0 and RA1 are dedicated to In-Circuit Debug.
3586 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RA0 and RA1 configured as general purpose I/O pins.
3588 //----------------------------- CONFIG5L Options -------------------------------
3590 #define _CP0_ON_5L 0xFE // Block 0 code-protected.
3591 #define _CP0_OFF_5L 0xFF // Block 0 not code-protected.
3592 #define _CP1_ON_5L 0xFD // Block 1 code-protected.
3593 #define _CP1_OFF_5L 0xFF // Block 1 not code-protected.
3595 //----------------------------- CONFIG5H Options -------------------------------
3597 #define _CPB_ON_5H 0xBF // Boot block code-protected.
3598 #define _CPB_OFF_5H 0xFF // Boot block not code-protected.
3599 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
3600 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
3602 //----------------------------- CONFIG6L Options -------------------------------
3604 #define _WRT0_ON_6L 0xFE // Block 0 write-protected.
3605 #define _WRT0_OFF_6L 0xFF // Block 0 not write-protected.
3606 #define _WRT1_ON_6L 0xFD // Block 1 write-protected.
3607 #define _WRT1_OFF_6L 0xFF // Block 1 not write-protected.
3609 //----------------------------- CONFIG6H Options -------------------------------
3611 #define _WRTC_ON_6H 0xDF // Configuration registers write-protected.
3612 #define _WRTC_OFF_6H 0xFF // Configuration registers not write-protected.
3613 #define _WRTB_ON_6H 0xBF // Boot block write-protected.
3614 #define _WRTB_OFF_6H 0xFF // Boot block not write-protected.
3615 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
3616 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
3618 //----------------------------- CONFIG7L Options -------------------------------
3620 #define _EBTR0_ON_7L 0xFE // Block 0 protected from table reads executed in other blocks.
3621 #define _EBTR0_OFF_7L 0xFF // Block 0 not protected from table reads executed in other blocks.
3622 #define _EBTR1_ON_7L 0xFD // Block 1 protected from table reads executed in other blocks.
3623 #define _EBTR1_OFF_7L 0xFF // Block 1 not protected from table reads executed in other blocks.
3625 //----------------------------- CONFIG7H Options -------------------------------
3627 #define _EBTRB_ON_7H 0xBF // Boot block protected from table reads executed in other blocks.
3628 #define _EBTRB_OFF_7H 0xFF // Boot block not protected from table reads executed in other blocks.
3630 //==============================================================================
3632 #define __DEVID1 0x3FFFFE
3633 #define __DEVID2 0x3FFFFF
3635 #define __IDLOC0 0x200000
3636 #define __IDLOC1 0x200001
3637 #define __IDLOC2 0x200002
3638 #define __IDLOC3 0x200003
3639 #define __IDLOC4 0x200004
3640 #define __IDLOC5 0x200005
3641 #define __IDLOC6 0x200006
3642 #define __IDLOC7 0x200007
3644 #endif // #ifndef __PIC18LF14K50_H__