struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f14k50.h
blobd66b0cbceef2a5535e4055511e3115ea620af79d
1 /*
2 * This declarations of the PIC18F14K50 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:26 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 __PIC18F14K50_H__
26 #define __PIC18F14K50_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 LATA0 : 1;
1269 unsigned LATA1 : 1;
1270 unsigned : 1;
1271 unsigned LATA3 : 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 _LATA0 0x01
1281 #define _LATA1 0x02
1282 #define _LATA3 0x08
1283 #define _LATA4 0x10
1284 #define _LATA5 0x20
1286 //==============================================================================
1289 //==============================================================================
1290 // LATB Bits
1292 extern __at(0x0F8A) __sfr LATB;
1294 typedef struct
1296 unsigned : 1;
1297 unsigned : 1;
1298 unsigned : 1;
1299 unsigned : 1;
1300 unsigned LATB4 : 1;
1301 unsigned LATB5 : 1;
1302 unsigned LATB6 : 1;
1303 unsigned LATB7 : 1;
1304 } __LATBbits_t;
1306 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1308 #define _LATB4 0x10
1309 #define _LATB5 0x20
1310 #define _LATB6 0x40
1311 #define _LATB7 0x80
1313 //==============================================================================
1316 //==============================================================================
1317 // LATC Bits
1319 extern __at(0x0F8B) __sfr LATC;
1321 typedef struct
1323 unsigned LATC0 : 1;
1324 unsigned LATC1 : 1;
1325 unsigned LATC2 : 1;
1326 unsigned LATC3 : 1;
1327 unsigned LATC4 : 1;
1328 unsigned LATC5 : 1;
1329 unsigned LATC6 : 1;
1330 unsigned LATC7 : 1;
1331 } __LATCbits_t;
1333 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1335 #define _LATC0 0x01
1336 #define _LATC1 0x02
1337 #define _LATC2 0x04
1338 #define _LATC3 0x08
1339 #define _LATC4 0x10
1340 #define _LATC5 0x20
1341 #define _LATC6 0x40
1342 #define _LATC7 0x80
1344 //==============================================================================
1347 //==============================================================================
1348 // DDRA Bits
1350 extern __at(0x0F92) __sfr DDRA;
1352 typedef union
1354 struct
1356 unsigned : 1;
1357 unsigned : 1;
1358 unsigned : 1;
1359 unsigned : 1;
1360 unsigned TRISA4 : 1;
1361 unsigned TRISA5 : 1;
1362 unsigned : 1;
1363 unsigned : 1;
1366 struct
1368 unsigned : 1;
1369 unsigned : 1;
1370 unsigned : 1;
1371 unsigned : 1;
1372 unsigned RA4 : 1;
1373 unsigned RA5 : 1;
1374 unsigned : 1;
1375 unsigned : 1;
1377 } __DDRAbits_t;
1379 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1381 #define _TRISA4 0x10
1382 #define _RA4 0x10
1383 #define _TRISA5 0x20
1384 #define _RA5 0x20
1386 //==============================================================================
1389 //==============================================================================
1390 // TRISA Bits
1392 extern __at(0x0F92) __sfr TRISA;
1394 typedef union
1396 struct
1398 unsigned : 1;
1399 unsigned : 1;
1400 unsigned : 1;
1401 unsigned : 1;
1402 unsigned TRISA4 : 1;
1403 unsigned TRISA5 : 1;
1404 unsigned : 1;
1405 unsigned : 1;
1408 struct
1410 unsigned : 1;
1411 unsigned : 1;
1412 unsigned : 1;
1413 unsigned : 1;
1414 unsigned RA4 : 1;
1415 unsigned RA5 : 1;
1416 unsigned : 1;
1417 unsigned : 1;
1419 } __TRISAbits_t;
1421 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1423 #define _TRISA_TRISA4 0x10
1424 #define _TRISA_RA4 0x10
1425 #define _TRISA_TRISA5 0x20
1426 #define _TRISA_RA5 0x20
1428 //==============================================================================
1431 //==============================================================================
1432 // DDRB Bits
1434 extern __at(0x0F93) __sfr DDRB;
1436 typedef union
1438 struct
1440 unsigned : 1;
1441 unsigned : 1;
1442 unsigned : 1;
1443 unsigned : 1;
1444 unsigned TRISB4 : 1;
1445 unsigned TRISB5 : 1;
1446 unsigned TRISB6 : 1;
1447 unsigned TRISB7 : 1;
1450 struct
1452 unsigned : 1;
1453 unsigned : 1;
1454 unsigned : 1;
1455 unsigned : 1;
1456 unsigned RB4 : 1;
1457 unsigned RB5 : 1;
1458 unsigned RB6 : 1;
1459 unsigned RB7 : 1;
1461 } __DDRBbits_t;
1463 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1465 #define _TRISB4 0x10
1466 #define _RB4 0x10
1467 #define _TRISB5 0x20
1468 #define _RB5 0x20
1469 #define _TRISB6 0x40
1470 #define _RB6 0x40
1471 #define _TRISB7 0x80
1472 #define _RB7 0x80
1474 //==============================================================================
1477 //==============================================================================
1478 // TRISB Bits
1480 extern __at(0x0F93) __sfr TRISB;
1482 typedef union
1484 struct
1486 unsigned : 1;
1487 unsigned : 1;
1488 unsigned : 1;
1489 unsigned : 1;
1490 unsigned TRISB4 : 1;
1491 unsigned TRISB5 : 1;
1492 unsigned TRISB6 : 1;
1493 unsigned TRISB7 : 1;
1496 struct
1498 unsigned : 1;
1499 unsigned : 1;
1500 unsigned : 1;
1501 unsigned : 1;
1502 unsigned RB4 : 1;
1503 unsigned RB5 : 1;
1504 unsigned RB6 : 1;
1505 unsigned RB7 : 1;
1507 } __TRISBbits_t;
1509 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1511 #define _TRISB_TRISB4 0x10
1512 #define _TRISB_RB4 0x10
1513 #define _TRISB_TRISB5 0x20
1514 #define _TRISB_RB5 0x20
1515 #define _TRISB_TRISB6 0x40
1516 #define _TRISB_RB6 0x40
1517 #define _TRISB_TRISB7 0x80
1518 #define _TRISB_RB7 0x80
1520 //==============================================================================
1523 //==============================================================================
1524 // DDRC Bits
1526 extern __at(0x0F94) __sfr DDRC;
1528 typedef union
1530 struct
1532 unsigned TRISC0 : 1;
1533 unsigned TRISC1 : 1;
1534 unsigned TRISC2 : 1;
1535 unsigned TRISC3 : 1;
1536 unsigned TRISC4 : 1;
1537 unsigned TRISC5 : 1;
1538 unsigned TRISC6 : 1;
1539 unsigned TRISC7 : 1;
1542 struct
1544 unsigned RC0 : 1;
1545 unsigned RC1 : 1;
1546 unsigned RC2 : 1;
1547 unsigned RC3 : 1;
1548 unsigned RC4 : 1;
1549 unsigned RC5 : 1;
1550 unsigned RC6 : 1;
1551 unsigned RC7 : 1;
1553 } __DDRCbits_t;
1555 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1557 #define _TRISC0 0x01
1558 #define _RC0 0x01
1559 #define _TRISC1 0x02
1560 #define _RC1 0x02
1561 #define _TRISC2 0x04
1562 #define _RC2 0x04
1563 #define _TRISC3 0x08
1564 #define _RC3 0x08
1565 #define _TRISC4 0x10
1566 #define _RC4 0x10
1567 #define _TRISC5 0x20
1568 #define _RC5 0x20
1569 #define _TRISC6 0x40
1570 #define _RC6 0x40
1571 #define _TRISC7 0x80
1572 #define _RC7 0x80
1574 //==============================================================================
1577 //==============================================================================
1578 // TRISC Bits
1580 extern __at(0x0F94) __sfr TRISC;
1582 typedef union
1584 struct
1586 unsigned TRISC0 : 1;
1587 unsigned TRISC1 : 1;
1588 unsigned TRISC2 : 1;
1589 unsigned TRISC3 : 1;
1590 unsigned TRISC4 : 1;
1591 unsigned TRISC5 : 1;
1592 unsigned TRISC6 : 1;
1593 unsigned TRISC7 : 1;
1596 struct
1598 unsigned RC0 : 1;
1599 unsigned RC1 : 1;
1600 unsigned RC2 : 1;
1601 unsigned RC3 : 1;
1602 unsigned RC4 : 1;
1603 unsigned RC5 : 1;
1604 unsigned RC6 : 1;
1605 unsigned RC7 : 1;
1607 } __TRISCbits_t;
1609 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1611 #define _TRISC_TRISC0 0x01
1612 #define _TRISC_RC0 0x01
1613 #define _TRISC_TRISC1 0x02
1614 #define _TRISC_RC1 0x02
1615 #define _TRISC_TRISC2 0x04
1616 #define _TRISC_RC2 0x04
1617 #define _TRISC_TRISC3 0x08
1618 #define _TRISC_RC3 0x08
1619 #define _TRISC_TRISC4 0x10
1620 #define _TRISC_RC4 0x10
1621 #define _TRISC_TRISC5 0x20
1622 #define _TRISC_RC5 0x20
1623 #define _TRISC_TRISC6 0x40
1624 #define _TRISC_RC6 0x40
1625 #define _TRISC_TRISC7 0x80
1626 #define _TRISC_RC7 0x80
1628 //==============================================================================
1631 //==============================================================================
1632 // OSCTUNE Bits
1634 extern __at(0x0F9B) __sfr OSCTUNE;
1636 typedef union
1638 struct
1640 unsigned TUN0 : 1;
1641 unsigned TUN1 : 1;
1642 unsigned TUN2 : 1;
1643 unsigned TUN3 : 1;
1644 unsigned TUN4 : 1;
1645 unsigned TUN5 : 1;
1646 unsigned SPLLEN : 1;
1647 unsigned INTSRC : 1;
1650 struct
1652 unsigned TUN : 6;
1653 unsigned : 2;
1655 } __OSCTUNEbits_t;
1657 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
1659 #define _TUN0 0x01
1660 #define _TUN1 0x02
1661 #define _TUN2 0x04
1662 #define _TUN3 0x08
1663 #define _TUN4 0x10
1664 #define _TUN5 0x20
1665 #define _SPLLEN 0x40
1666 #define _INTSRC 0x80
1668 //==============================================================================
1671 //==============================================================================
1672 // PIE1 Bits
1674 extern __at(0x0F9D) __sfr PIE1;
1676 typedef struct
1678 unsigned TMR1IE : 1;
1679 unsigned TMR2IE : 1;
1680 unsigned CCP1IE : 1;
1681 unsigned SSPIE : 1;
1682 unsigned TXIE : 1;
1683 unsigned RCIE : 1;
1684 unsigned ADIE : 1;
1685 unsigned : 1;
1686 } __PIE1bits_t;
1688 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1690 #define _TMR1IE 0x01
1691 #define _TMR2IE 0x02
1692 #define _CCP1IE 0x04
1693 #define _SSPIE 0x08
1694 #define _TXIE 0x10
1695 #define _RCIE 0x20
1696 #define _ADIE 0x40
1698 //==============================================================================
1701 //==============================================================================
1702 // PIR1 Bits
1704 extern __at(0x0F9E) __sfr PIR1;
1706 typedef struct
1708 unsigned TMR1IF : 1;
1709 unsigned TMR2IF : 1;
1710 unsigned CCP1IF : 1;
1711 unsigned SSPIF : 1;
1712 unsigned TXIF : 1;
1713 unsigned RCIF : 1;
1714 unsigned ADIF : 1;
1715 unsigned : 1;
1716 } __PIR1bits_t;
1718 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1720 #define _TMR1IF 0x01
1721 #define _TMR2IF 0x02
1722 #define _CCP1IF 0x04
1723 #define _SSPIF 0x08
1724 #define _TXIF 0x10
1725 #define _RCIF 0x20
1726 #define _ADIF 0x40
1728 //==============================================================================
1731 //==============================================================================
1732 // IPR1 Bits
1734 extern __at(0x0F9F) __sfr IPR1;
1736 typedef struct
1738 unsigned TMR1IP : 1;
1739 unsigned TMR2IP : 1;
1740 unsigned CCP1IP : 1;
1741 unsigned SSPIP : 1;
1742 unsigned TXIP : 1;
1743 unsigned RCIP : 1;
1744 unsigned ADIP : 1;
1745 unsigned : 1;
1746 } __IPR1bits_t;
1748 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
1750 #define _TMR1IP 0x01
1751 #define _TMR2IP 0x02
1752 #define _CCP1IP 0x04
1753 #define _SSPIP 0x08
1754 #define _TXIP 0x10
1755 #define _RCIP 0x20
1756 #define _ADIP 0x40
1758 //==============================================================================
1761 //==============================================================================
1762 // PIE2 Bits
1764 extern __at(0x0FA0) __sfr PIE2;
1766 typedef struct
1768 unsigned : 1;
1769 unsigned TMR3IE : 1;
1770 unsigned USBIE : 1;
1771 unsigned BCLIE : 1;
1772 unsigned EEIE : 1;
1773 unsigned C2IE : 1;
1774 unsigned C1IE : 1;
1775 unsigned OSCFIE : 1;
1776 } __PIE2bits_t;
1778 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
1780 #define _TMR3IE 0x02
1781 #define _USBIE 0x04
1782 #define _BCLIE 0x08
1783 #define _EEIE 0x10
1784 #define _C2IE 0x20
1785 #define _C1IE 0x40
1786 #define _OSCFIE 0x80
1788 //==============================================================================
1791 //==============================================================================
1792 // PIR2 Bits
1794 extern __at(0x0FA1) __sfr PIR2;
1796 typedef struct
1798 unsigned : 1;
1799 unsigned TMR3IF : 1;
1800 unsigned USBIF : 1;
1801 unsigned BCLIF : 1;
1802 unsigned EEIF : 1;
1803 unsigned C2IF : 1;
1804 unsigned C1IF : 1;
1805 unsigned OSCFIF : 1;
1806 } __PIR2bits_t;
1808 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
1810 #define _TMR3IF 0x02
1811 #define _USBIF 0x04
1812 #define _BCLIF 0x08
1813 #define _EEIF 0x10
1814 #define _C2IF 0x20
1815 #define _C1IF 0x40
1816 #define _OSCFIF 0x80
1818 //==============================================================================
1821 //==============================================================================
1822 // IPR2 Bits
1824 extern __at(0x0FA2) __sfr IPR2;
1826 typedef struct
1828 unsigned : 1;
1829 unsigned TMR3IP : 1;
1830 unsigned USBIP : 1;
1831 unsigned BCLIP : 1;
1832 unsigned EEIP : 1;
1833 unsigned C2IP : 1;
1834 unsigned C1IP : 1;
1835 unsigned OSCFIP : 1;
1836 } __IPR2bits_t;
1838 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
1840 #define _TMR3IP 0x02
1841 #define _USBIP 0x04
1842 #define _BCLIP 0x08
1843 #define _EEIP 0x10
1844 #define _C2IP 0x20
1845 #define _C1IP 0x40
1846 #define _OSCFIP 0x80
1848 //==============================================================================
1851 //==============================================================================
1852 // EECON1 Bits
1854 extern __at(0x0FA6) __sfr EECON1;
1856 typedef struct
1858 unsigned RD : 1;
1859 unsigned WR : 1;
1860 unsigned WREN : 1;
1861 unsigned WRERR : 1;
1862 unsigned FREE : 1;
1863 unsigned : 1;
1864 unsigned CFGS : 1;
1865 unsigned EEPGD : 1;
1866 } __EECON1bits_t;
1868 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
1870 #define _RD 0x01
1871 #define _WR 0x02
1872 #define _WREN 0x04
1873 #define _WRERR 0x08
1874 #define _FREE 0x10
1875 #define _CFGS 0x40
1876 #define _EEPGD 0x80
1878 //==============================================================================
1880 extern __at(0x0FA7) __sfr EECON2;
1881 extern __at(0x0FA8) __sfr EEDATA;
1883 //==============================================================================
1884 // EEADR Bits
1886 extern __at(0x0FA9) __sfr EEADR;
1888 typedef struct
1890 unsigned EEADR0 : 1;
1891 unsigned EEADR1 : 1;
1892 unsigned EEADR2 : 1;
1893 unsigned EEADR3 : 1;
1894 unsigned EEADR4 : 1;
1895 unsigned EEADR5 : 1;
1896 unsigned EEADR6 : 1;
1897 unsigned EEADR7 : 1;
1898 } __EEADRbits_t;
1900 extern __at(0x0FA9) volatile __EEADRbits_t EEADRbits;
1902 #define _EEADR0 0x01
1903 #define _EEADR1 0x02
1904 #define _EEADR2 0x04
1905 #define _EEADR3 0x08
1906 #define _EEADR4 0x10
1907 #define _EEADR5 0x20
1908 #define _EEADR6 0x40
1909 #define _EEADR7 0x80
1911 //==============================================================================
1914 //==============================================================================
1915 // RCSTA Bits
1917 extern __at(0x0FAB) __sfr RCSTA;
1919 typedef union
1921 struct
1923 unsigned RX9D : 1;
1924 unsigned OERR : 1;
1925 unsigned FERR : 1;
1926 unsigned ADDEN : 1;
1927 unsigned CREN : 1;
1928 unsigned SREN : 1;
1929 unsigned RX9 : 1;
1930 unsigned SPEN : 1;
1933 struct
1935 unsigned : 1;
1936 unsigned : 1;
1937 unsigned : 1;
1938 unsigned ADEN : 1;
1939 unsigned : 1;
1940 unsigned : 1;
1941 unsigned : 1;
1942 unsigned : 1;
1944 } __RCSTAbits_t;
1946 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
1948 #define _RX9D 0x01
1949 #define _OERR 0x02
1950 #define _FERR 0x04
1951 #define _ADDEN 0x08
1952 #define _ADEN 0x08
1953 #define _CREN 0x10
1954 #define _SREN 0x20
1955 #define _RX9 0x40
1956 #define _SPEN 0x80
1958 //==============================================================================
1961 //==============================================================================
1962 // TXSTA Bits
1964 extern __at(0x0FAC) __sfr TXSTA;
1966 typedef struct
1968 unsigned TX9D : 1;
1969 unsigned TRMT : 1;
1970 unsigned BRGH : 1;
1971 unsigned SENDB : 1;
1972 unsigned SYNC : 1;
1973 unsigned TXEN : 1;
1974 unsigned TX9 : 1;
1975 unsigned CSRC : 1;
1976 } __TXSTAbits_t;
1978 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
1980 #define _TX9D 0x01
1981 #define _TRMT 0x02
1982 #define _BRGH 0x04
1983 #define _SENDB 0x08
1984 #define _SYNC 0x10
1985 #define _TXEN 0x20
1986 #define _TX9 0x40
1987 #define _CSRC 0x80
1989 //==============================================================================
1991 extern __at(0x0FAD) __sfr TXREG;
1992 extern __at(0x0FAE) __sfr RCREG;
1993 extern __at(0x0FAF) __sfr SPBRG;
1994 extern __at(0x0FB0) __sfr SPBRGH;
1996 //==============================================================================
1997 // T3CON Bits
1999 extern __at(0x0FB1) __sfr T3CON;
2001 typedef union
2003 struct
2005 unsigned TMR3ON : 1;
2006 unsigned TMR3CS : 1;
2007 unsigned NOT_T3SYNC : 1;
2008 unsigned T3CCP1 : 1;
2009 unsigned T3CKPS0 : 1;
2010 unsigned T3CKPS1 : 1;
2011 unsigned : 1;
2012 unsigned RD16 : 1;
2015 struct
2017 unsigned : 1;
2018 unsigned : 1;
2019 unsigned T3SYNC : 1;
2020 unsigned : 1;
2021 unsigned : 1;
2022 unsigned : 1;
2023 unsigned : 1;
2024 unsigned : 1;
2027 struct
2029 unsigned : 4;
2030 unsigned T3CKPS : 2;
2031 unsigned : 2;
2033 } __T3CONbits_t;
2035 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
2037 #define _T3CON_TMR3ON 0x01
2038 #define _T3CON_TMR3CS 0x02
2039 #define _T3CON_NOT_T3SYNC 0x04
2040 #define _T3CON_T3SYNC 0x04
2041 #define _T3CON_T3CCP1 0x08
2042 #define _T3CON_T3CKPS0 0x10
2043 #define _T3CON_T3CKPS1 0x20
2044 #define _T3CON_RD16 0x80
2046 //==============================================================================
2048 extern __at(0x0FB2) __sfr TMR3;
2049 extern __at(0x0FB2) __sfr TMR3L;
2050 extern __at(0x0FB3) __sfr TMR3H;
2052 //==============================================================================
2053 // ECCP1AS Bits
2055 extern __at(0x0FB6) __sfr ECCP1AS;
2057 typedef union
2059 struct
2061 unsigned PSSBD0 : 1;
2062 unsigned PSSBD1 : 1;
2063 unsigned PSSAC0 : 1;
2064 unsigned PSSAC1 : 1;
2065 unsigned ECCPAS0 : 1;
2066 unsigned ECCPAS1 : 1;
2067 unsigned ECCPAS2 : 1;
2068 unsigned ECCPASE : 1;
2071 struct
2073 unsigned PSSBD : 2;
2074 unsigned : 6;
2077 struct
2079 unsigned : 2;
2080 unsigned PSSAC : 2;
2081 unsigned : 4;
2084 struct
2086 unsigned : 4;
2087 unsigned ECCPAS : 3;
2088 unsigned : 1;
2090 } __ECCP1ASbits_t;
2092 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
2094 #define _PSSBD0 0x01
2095 #define _PSSBD1 0x02
2096 #define _PSSAC0 0x04
2097 #define _PSSAC1 0x08
2098 #define _ECCPAS0 0x10
2099 #define _ECCPAS1 0x20
2100 #define _ECCPAS2 0x40
2101 #define _ECCPASE 0x80
2103 //==============================================================================
2106 //==============================================================================
2107 // PWM1CON Bits
2109 extern __at(0x0FB7) __sfr PWM1CON;
2111 typedef union
2113 struct
2115 unsigned PDC0 : 1;
2116 unsigned PDC1 : 1;
2117 unsigned PDC2 : 1;
2118 unsigned PDC3 : 1;
2119 unsigned PDC4 : 1;
2120 unsigned PDC5 : 1;
2121 unsigned PDC6 : 1;
2122 unsigned PRSEN : 1;
2125 struct
2127 unsigned PDC : 7;
2128 unsigned : 1;
2130 } __PWM1CONbits_t;
2132 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
2134 #define _PDC0 0x01
2135 #define _PDC1 0x02
2136 #define _PDC2 0x04
2137 #define _PDC3 0x08
2138 #define _PDC4 0x10
2139 #define _PDC5 0x20
2140 #define _PDC6 0x40
2141 #define _PRSEN 0x80
2143 //==============================================================================
2146 //==============================================================================
2147 // BAUDCON Bits
2149 extern __at(0x0FB8) __sfr BAUDCON;
2151 typedef union
2153 struct
2155 unsigned ABDEN : 1;
2156 unsigned WUE : 1;
2157 unsigned : 1;
2158 unsigned BRG16 : 1;
2159 unsigned CKTXP : 1;
2160 unsigned DTRXP : 1;
2161 unsigned RCIDL : 1;
2162 unsigned ABDOVF : 1;
2165 struct
2167 unsigned : 1;
2168 unsigned : 1;
2169 unsigned : 1;
2170 unsigned : 1;
2171 unsigned SCKP : 1;
2172 unsigned : 1;
2173 unsigned : 1;
2174 unsigned : 1;
2176 } __BAUDCONbits_t;
2178 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
2180 #define _ABDEN 0x01
2181 #define _WUE 0x02
2182 #define _BRG16 0x08
2183 #define _CKTXP 0x10
2184 #define _SCKP 0x10
2185 #define _DTRXP 0x20
2186 #define _RCIDL 0x40
2187 #define _ABDOVF 0x80
2189 //==============================================================================
2192 //==============================================================================
2193 // BAUDCTL Bits
2195 extern __at(0x0FB8) __sfr BAUDCTL;
2197 typedef union
2199 struct
2201 unsigned ABDEN : 1;
2202 unsigned WUE : 1;
2203 unsigned : 1;
2204 unsigned BRG16 : 1;
2205 unsigned CKTXP : 1;
2206 unsigned DTRXP : 1;
2207 unsigned RCIDL : 1;
2208 unsigned ABDOVF : 1;
2211 struct
2213 unsigned : 1;
2214 unsigned : 1;
2215 unsigned : 1;
2216 unsigned : 1;
2217 unsigned SCKP : 1;
2218 unsigned : 1;
2219 unsigned : 1;
2220 unsigned : 1;
2222 } __BAUDCTLbits_t;
2224 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
2226 #define _BAUDCTL_ABDEN 0x01
2227 #define _BAUDCTL_WUE 0x02
2228 #define _BAUDCTL_BRG16 0x08
2229 #define _BAUDCTL_CKTXP 0x10
2230 #define _BAUDCTL_SCKP 0x10
2231 #define _BAUDCTL_DTRXP 0x20
2232 #define _BAUDCTL_RCIDL 0x40
2233 #define _BAUDCTL_ABDOVF 0x80
2235 //==============================================================================
2238 //==============================================================================
2239 // PSTRCON Bits
2241 extern __at(0x0FB9) __sfr PSTRCON;
2243 typedef struct
2245 unsigned STRA : 1;
2246 unsigned STRB : 1;
2247 unsigned STRC : 1;
2248 unsigned STRD : 1;
2249 unsigned STRSYNC : 1;
2250 unsigned : 1;
2251 unsigned : 1;
2252 unsigned : 1;
2253 } __PSTRCONbits_t;
2255 extern __at(0x0FB9) volatile __PSTRCONbits_t PSTRCONbits;
2257 #define _STRA 0x01
2258 #define _STRB 0x02
2259 #define _STRC 0x04
2260 #define _STRD 0x08
2261 #define _STRSYNC 0x10
2263 //==============================================================================
2266 //==============================================================================
2267 // REFCON0 Bits
2269 extern __at(0x0FBA) __sfr REFCON0;
2271 typedef union
2273 struct
2275 unsigned : 1;
2276 unsigned : 1;
2277 unsigned : 1;
2278 unsigned : 1;
2279 unsigned FVR1S0 : 1;
2280 unsigned FVR1S1 : 1;
2281 unsigned FVR1ST : 1;
2282 unsigned FVR1EN : 1;
2285 struct
2287 unsigned : 4;
2288 unsigned FVR1S : 2;
2289 unsigned : 2;
2291 } __REFCON0bits_t;
2293 extern __at(0x0FBA) volatile __REFCON0bits_t REFCON0bits;
2295 #define _FVR1S0 0x10
2296 #define _FVR1S1 0x20
2297 #define _FVR1ST 0x40
2298 #define _FVR1EN 0x80
2300 //==============================================================================
2303 //==============================================================================
2304 // VREFCON0 Bits
2306 extern __at(0x0FBA) __sfr VREFCON0;
2308 typedef union
2310 struct
2312 unsigned : 1;
2313 unsigned : 1;
2314 unsigned : 1;
2315 unsigned : 1;
2316 unsigned FVR1S0 : 1;
2317 unsigned FVR1S1 : 1;
2318 unsigned FVR1ST : 1;
2319 unsigned FVR1EN : 1;
2322 struct
2324 unsigned : 4;
2325 unsigned FVR1S : 2;
2326 unsigned : 2;
2328 } __VREFCON0bits_t;
2330 extern __at(0x0FBA) volatile __VREFCON0bits_t VREFCON0bits;
2332 #define _VREFCON0_FVR1S0 0x10
2333 #define _VREFCON0_FVR1S1 0x20
2334 #define _VREFCON0_FVR1ST 0x40
2335 #define _VREFCON0_FVR1EN 0x80
2337 //==============================================================================
2340 //==============================================================================
2341 // REFCON1 Bits
2343 extern __at(0x0FBB) __sfr REFCON1;
2345 typedef union
2347 struct
2349 unsigned D1NSS : 1;
2350 unsigned : 1;
2351 unsigned D1PSS0 : 1;
2352 unsigned D1PSS1 : 1;
2353 unsigned : 1;
2354 unsigned DAC1OE : 1;
2355 unsigned D1LPS : 1;
2356 unsigned D1EN : 1;
2359 struct
2361 unsigned : 2;
2362 unsigned D1PSS : 2;
2363 unsigned : 4;
2365 } __REFCON1bits_t;
2367 extern __at(0x0FBB) volatile __REFCON1bits_t REFCON1bits;
2369 #define _D1NSS 0x01
2370 #define _D1PSS0 0x04
2371 #define _D1PSS1 0x08
2372 #define _DAC1OE 0x20
2373 #define _D1LPS 0x40
2374 #define _D1EN 0x80
2376 //==============================================================================
2379 //==============================================================================
2380 // VREFCON1 Bits
2382 extern __at(0x0FBB) __sfr VREFCON1;
2384 typedef union
2386 struct
2388 unsigned D1NSS : 1;
2389 unsigned : 1;
2390 unsigned D1PSS0 : 1;
2391 unsigned D1PSS1 : 1;
2392 unsigned : 1;
2393 unsigned DAC1OE : 1;
2394 unsigned D1LPS : 1;
2395 unsigned D1EN : 1;
2398 struct
2400 unsigned : 2;
2401 unsigned D1PSS : 2;
2402 unsigned : 4;
2404 } __VREFCON1bits_t;
2406 extern __at(0x0FBB) volatile __VREFCON1bits_t VREFCON1bits;
2408 #define _VREFCON1_D1NSS 0x01
2409 #define _VREFCON1_D1PSS0 0x04
2410 #define _VREFCON1_D1PSS1 0x08
2411 #define _VREFCON1_DAC1OE 0x20
2412 #define _VREFCON1_D1LPS 0x40
2413 #define _VREFCON1_D1EN 0x80
2415 //==============================================================================
2418 //==============================================================================
2419 // REFCON2 Bits
2421 extern __at(0x0FBC) __sfr REFCON2;
2423 typedef union
2425 struct
2427 unsigned DAC1R0 : 1;
2428 unsigned DAC1R1 : 1;
2429 unsigned DAC1R2 : 1;
2430 unsigned DAC1R3 : 1;
2431 unsigned DAC1R4 : 1;
2432 unsigned : 1;
2433 unsigned : 1;
2434 unsigned : 1;
2437 struct
2439 unsigned DAC1R : 5;
2440 unsigned : 3;
2442 } __REFCON2bits_t;
2444 extern __at(0x0FBC) volatile __REFCON2bits_t REFCON2bits;
2446 #define _DAC1R0 0x01
2447 #define _DAC1R1 0x02
2448 #define _DAC1R2 0x04
2449 #define _DAC1R3 0x08
2450 #define _DAC1R4 0x10
2452 //==============================================================================
2455 //==============================================================================
2456 // VREFCON2 Bits
2458 extern __at(0x0FBC) __sfr VREFCON2;
2460 typedef union
2462 struct
2464 unsigned DAC1R0 : 1;
2465 unsigned DAC1R1 : 1;
2466 unsigned DAC1R2 : 1;
2467 unsigned DAC1R3 : 1;
2468 unsigned DAC1R4 : 1;
2469 unsigned : 1;
2470 unsigned : 1;
2471 unsigned : 1;
2474 struct
2476 unsigned DAC1R : 5;
2477 unsigned : 3;
2479 } __VREFCON2bits_t;
2481 extern __at(0x0FBC) volatile __VREFCON2bits_t VREFCON2bits;
2483 #define _VREFCON2_DAC1R0 0x01
2484 #define _VREFCON2_DAC1R1 0x02
2485 #define _VREFCON2_DAC1R2 0x04
2486 #define _VREFCON2_DAC1R3 0x08
2487 #define _VREFCON2_DAC1R4 0x10
2489 //==============================================================================
2492 //==============================================================================
2493 // CCP1CON Bits
2495 extern __at(0x0FBD) __sfr CCP1CON;
2497 typedef union
2499 struct
2501 unsigned CCP1M0 : 1;
2502 unsigned CCP1M1 : 1;
2503 unsigned CCP1M2 : 1;
2504 unsigned CCP1M3 : 1;
2505 unsigned DC1B0 : 1;
2506 unsigned DC1B1 : 1;
2507 unsigned P1M0 : 1;
2508 unsigned P1M1 : 1;
2511 struct
2513 unsigned CCP1M : 4;
2514 unsigned : 4;
2517 struct
2519 unsigned : 4;
2520 unsigned DC1B : 2;
2521 unsigned : 2;
2524 struct
2526 unsigned : 6;
2527 unsigned P1M : 2;
2529 } __CCP1CONbits_t;
2531 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
2533 #define _CCP1M0 0x01
2534 #define _CCP1M1 0x02
2535 #define _CCP1M2 0x04
2536 #define _CCP1M3 0x08
2537 #define _DC1B0 0x10
2538 #define _DC1B1 0x20
2539 #define _P1M0 0x40
2540 #define _P1M1 0x80
2542 //==============================================================================
2544 extern __at(0x0FBE) __sfr CCPR1;
2545 extern __at(0x0FBE) __sfr CCPR1L;
2546 extern __at(0x0FBF) __sfr CCPR1H;
2548 //==============================================================================
2549 // ADCON2 Bits
2551 extern __at(0x0FC0) __sfr ADCON2;
2553 typedef union
2555 struct
2557 unsigned ADCS0 : 1;
2558 unsigned ADCS1 : 1;
2559 unsigned ADCS2 : 1;
2560 unsigned ACQT0 : 1;
2561 unsigned ACQT1 : 1;
2562 unsigned ACQT2 : 1;
2563 unsigned : 1;
2564 unsigned ADFM : 1;
2567 struct
2569 unsigned ADCS : 3;
2570 unsigned : 5;
2573 struct
2575 unsigned : 3;
2576 unsigned ACQT : 3;
2577 unsigned : 2;
2579 } __ADCON2bits_t;
2581 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
2583 #define _ADCS0 0x01
2584 #define _ADCS1 0x02
2585 #define _ADCS2 0x04
2586 #define _ACQT0 0x08
2587 #define _ACQT1 0x10
2588 #define _ACQT2 0x20
2589 #define _ADFM 0x80
2591 //==============================================================================
2594 //==============================================================================
2595 // ADCON1 Bits
2597 extern __at(0x0FC1) __sfr ADCON1;
2599 typedef union
2601 struct
2603 unsigned NVCFG0 : 1;
2604 unsigned NVCFG1 : 1;
2605 unsigned PVCFG0 : 1;
2606 unsigned PVCFG1 : 1;
2607 unsigned : 1;
2608 unsigned : 1;
2609 unsigned : 1;
2610 unsigned : 1;
2613 struct
2615 unsigned NVCFG : 2;
2616 unsigned : 6;
2619 struct
2621 unsigned : 2;
2622 unsigned PVCFG : 2;
2623 unsigned : 4;
2625 } __ADCON1bits_t;
2627 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
2629 #define _NVCFG0 0x01
2630 #define _NVCFG1 0x02
2631 #define _PVCFG0 0x04
2632 #define _PVCFG1 0x08
2634 //==============================================================================
2637 //==============================================================================
2638 // ADCON0 Bits
2640 extern __at(0x0FC2) __sfr ADCON0;
2642 typedef union
2644 struct
2646 unsigned ADON : 1;
2647 unsigned GO_NOT_DONE : 1;
2648 unsigned CHS0 : 1;
2649 unsigned CHS1 : 1;
2650 unsigned CHS2 : 1;
2651 unsigned CHS3 : 1;
2652 unsigned : 1;
2653 unsigned : 1;
2656 struct
2658 unsigned : 1;
2659 unsigned GO : 1;
2660 unsigned : 1;
2661 unsigned : 1;
2662 unsigned : 1;
2663 unsigned : 1;
2664 unsigned : 1;
2665 unsigned : 1;
2668 struct
2670 unsigned : 1;
2671 unsigned DONE : 1;
2672 unsigned : 1;
2673 unsigned : 1;
2674 unsigned : 1;
2675 unsigned : 1;
2676 unsigned : 1;
2677 unsigned : 1;
2680 struct
2682 unsigned : 1;
2683 unsigned NOT_DONE : 1;
2684 unsigned : 1;
2685 unsigned : 1;
2686 unsigned : 1;
2687 unsigned : 1;
2688 unsigned : 1;
2689 unsigned : 1;
2692 struct
2694 unsigned : 1;
2695 unsigned GO_DONE : 1;
2696 unsigned : 1;
2697 unsigned : 1;
2698 unsigned : 1;
2699 unsigned : 1;
2700 unsigned : 1;
2701 unsigned : 1;
2704 struct
2706 unsigned : 2;
2707 unsigned CHS : 4;
2708 unsigned : 2;
2710 } __ADCON0bits_t;
2712 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
2714 #define _ADON 0x01
2715 #define _GO_NOT_DONE 0x02
2716 #define _GO 0x02
2717 #define _DONE 0x02
2718 #define _NOT_DONE 0x02
2719 #define _GO_DONE 0x02
2720 #define _CHS0 0x04
2721 #define _CHS1 0x08
2722 #define _CHS2 0x10
2723 #define _CHS3 0x20
2725 //==============================================================================
2727 extern __at(0x0FC3) __sfr ADRES;
2728 extern __at(0x0FC3) __sfr ADRESL;
2729 extern __at(0x0FC4) __sfr ADRESH;
2731 //==============================================================================
2732 // SSPCON2 Bits
2734 extern __at(0x0FC5) __sfr SSPCON2;
2736 typedef struct
2738 unsigned SEN : 1;
2739 unsigned RSEN : 1;
2740 unsigned PEN : 1;
2741 unsigned RCEN : 1;
2742 unsigned ACKEN : 1;
2743 unsigned ACKDT : 1;
2744 unsigned ACKSTAT : 1;
2745 unsigned GCEN : 1;
2746 } __SSPCON2bits_t;
2748 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
2750 #define _SEN 0x01
2751 #define _RSEN 0x02
2752 #define _PEN 0x04
2753 #define _RCEN 0x08
2754 #define _ACKEN 0x10
2755 #define _ACKDT 0x20
2756 #define _ACKSTAT 0x40
2757 #define _GCEN 0x80
2759 //==============================================================================
2762 //==============================================================================
2763 // SSPCON1 Bits
2765 extern __at(0x0FC6) __sfr SSPCON1;
2767 typedef union
2769 struct
2771 unsigned SSPM0 : 1;
2772 unsigned SSPM1 : 1;
2773 unsigned SSPM2 : 1;
2774 unsigned SSPM3 : 1;
2775 unsigned CKP : 1;
2776 unsigned SSPEN : 1;
2777 unsigned SSPOV : 1;
2778 unsigned WCOL : 1;
2781 struct
2783 unsigned SSPM : 4;
2784 unsigned : 4;
2786 } __SSPCON1bits_t;
2788 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
2790 #define _SSPM0 0x01
2791 #define _SSPM1 0x02
2792 #define _SSPM2 0x04
2793 #define _SSPM3 0x08
2794 #define _CKP 0x10
2795 #define _SSPEN 0x20
2796 #define _SSPOV 0x40
2797 #define _WCOL 0x80
2799 //==============================================================================
2802 //==============================================================================
2803 // SSPSTAT Bits
2805 extern __at(0x0FC7) __sfr SSPSTAT;
2807 typedef union
2809 struct
2811 unsigned BF : 1;
2812 unsigned UA : 1;
2813 unsigned R_NOT_W : 1;
2814 unsigned S : 1;
2815 unsigned P : 1;
2816 unsigned D_NOT_A : 1;
2817 unsigned CKE : 1;
2818 unsigned SMP : 1;
2821 struct
2823 unsigned : 1;
2824 unsigned : 1;
2825 unsigned R : 1;
2826 unsigned : 1;
2827 unsigned : 1;
2828 unsigned D : 1;
2829 unsigned : 1;
2830 unsigned : 1;
2833 struct
2835 unsigned : 1;
2836 unsigned : 1;
2837 unsigned NOT_W : 1;
2838 unsigned : 1;
2839 unsigned : 1;
2840 unsigned NOT_A : 1;
2841 unsigned : 1;
2842 unsigned : 1;
2845 struct
2847 unsigned : 1;
2848 unsigned : 1;
2849 unsigned R_W : 1;
2850 unsigned : 1;
2851 unsigned : 1;
2852 unsigned D_A : 1;
2853 unsigned : 1;
2854 unsigned : 1;
2857 struct
2859 unsigned : 1;
2860 unsigned : 1;
2861 unsigned NOT_WRITE : 1;
2862 unsigned : 1;
2863 unsigned : 1;
2864 unsigned NOT_ADDRESS : 1;
2865 unsigned : 1;
2866 unsigned : 1;
2868 } __SSPSTATbits_t;
2870 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
2872 #define _BF 0x01
2873 #define _UA 0x02
2874 #define _R_NOT_W 0x04
2875 #define _R 0x04
2876 #define _NOT_W 0x04
2877 #define _R_W 0x04
2878 #define _NOT_WRITE 0x04
2879 #define _S 0x08
2880 #define _P 0x10
2881 #define _D_NOT_A 0x20
2882 #define _D 0x20
2883 #define _NOT_A 0x20
2884 #define _D_A 0x20
2885 #define _NOT_ADDRESS 0x20
2886 #define _CKE 0x40
2887 #define _SMP 0x80
2889 //==============================================================================
2891 extern __at(0x0FC8) __sfr SSPADD;
2892 extern __at(0x0FC9) __sfr SSPBUF;
2894 //==============================================================================
2895 // T2CON Bits
2897 extern __at(0x0FCA) __sfr T2CON;
2899 typedef union
2901 struct
2903 unsigned T2CKPS0 : 1;
2904 unsigned T2CKPS1 : 1;
2905 unsigned TMR2ON : 1;
2906 unsigned T2OUTPS0 : 1;
2907 unsigned T2OUTPS1 : 1;
2908 unsigned T2OUTPS2 : 1;
2909 unsigned T2OUTPS3 : 1;
2910 unsigned : 1;
2913 struct
2915 unsigned T2CKPS : 2;
2916 unsigned : 6;
2919 struct
2921 unsigned : 3;
2922 unsigned T2OUTPS : 4;
2923 unsigned : 1;
2925 } __T2CONbits_t;
2927 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
2929 #define _T2CKPS0 0x01
2930 #define _T2CKPS1 0x02
2931 #define _TMR2ON 0x04
2932 #define _T2OUTPS0 0x08
2933 #define _T2OUTPS1 0x10
2934 #define _T2OUTPS2 0x20
2935 #define _T2OUTPS3 0x40
2937 //==============================================================================
2939 extern __at(0x0FCB) __sfr PR2;
2940 extern __at(0x0FCC) __sfr TMR2;
2942 //==============================================================================
2943 // T1CON Bits
2945 extern __at(0x0FCD) __sfr T1CON;
2947 typedef union
2949 struct
2951 unsigned TMR1ON : 1;
2952 unsigned TMR1CS : 1;
2953 unsigned NOT_T1SYNC : 1;
2954 unsigned T1OSCEN : 1;
2955 unsigned T1CKPS0 : 1;
2956 unsigned T1CKPS1 : 1;
2957 unsigned T1RUN : 1;
2958 unsigned RD16 : 1;
2961 struct
2963 unsigned : 1;
2964 unsigned : 1;
2965 unsigned T1SYNC : 1;
2966 unsigned : 1;
2967 unsigned : 1;
2968 unsigned : 1;
2969 unsigned : 1;
2970 unsigned : 1;
2973 struct
2975 unsigned : 4;
2976 unsigned T1CKPS : 2;
2977 unsigned : 2;
2979 } __T1CONbits_t;
2981 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
2983 #define _TMR1ON 0x01
2984 #define _TMR1CS 0x02
2985 #define _NOT_T1SYNC 0x04
2986 #define _T1SYNC 0x04
2987 #define _T1OSCEN 0x08
2988 #define _T1CKPS0 0x10
2989 #define _T1CKPS1 0x20
2990 #define _T1RUN 0x40
2991 #define _RD16 0x80
2993 //==============================================================================
2995 extern __at(0x0FCE) __sfr TMR1;
2996 extern __at(0x0FCE) __sfr TMR1L;
2997 extern __at(0x0FCF) __sfr TMR1H;
2999 //==============================================================================
3000 // RCON Bits
3002 extern __at(0x0FD0) __sfr RCON;
3004 typedef union
3006 struct
3008 unsigned NOT_BOR : 1;
3009 unsigned NOT_POR : 1;
3010 unsigned NOT_PD : 1;
3011 unsigned NOT_TO : 1;
3012 unsigned NOT_RI : 1;
3013 unsigned : 1;
3014 unsigned SBOREN : 1;
3015 unsigned IPEN : 1;
3018 struct
3020 unsigned BOR : 1;
3021 unsigned POR : 1;
3022 unsigned PD : 1;
3023 unsigned TO : 1;
3024 unsigned RI : 1;
3025 unsigned : 1;
3026 unsigned : 1;
3027 unsigned : 1;
3029 } __RCONbits_t;
3031 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
3033 #define _NOT_BOR 0x01
3034 #define _BOR 0x01
3035 #define _NOT_POR 0x02
3036 #define _POR 0x02
3037 #define _NOT_PD 0x04
3038 #define _PD 0x04
3039 #define _NOT_TO 0x08
3040 #define _TO 0x08
3041 #define _NOT_RI 0x10
3042 #define _RI 0x10
3043 #define _SBOREN 0x40
3044 #define _IPEN 0x80
3046 //==============================================================================
3049 //==============================================================================
3050 // WDTCON Bits
3052 extern __at(0x0FD1) __sfr WDTCON;
3054 typedef union
3056 struct
3058 unsigned SWDTEN : 1;
3059 unsigned : 1;
3060 unsigned : 1;
3061 unsigned : 1;
3062 unsigned : 1;
3063 unsigned : 1;
3064 unsigned : 1;
3065 unsigned : 1;
3068 struct
3070 unsigned SWDTE : 1;
3071 unsigned : 1;
3072 unsigned : 1;
3073 unsigned : 1;
3074 unsigned : 1;
3075 unsigned : 1;
3076 unsigned : 1;
3077 unsigned : 1;
3079 } __WDTCONbits_t;
3081 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
3083 #define _SWDTEN 0x01
3084 #define _SWDTE 0x01
3086 //==============================================================================
3089 //==============================================================================
3090 // OSCCON2 Bits
3092 extern __at(0x0FD2) __sfr OSCCON2;
3094 typedef struct
3096 unsigned LFIOFS : 1;
3097 unsigned HFIOFL : 1;
3098 unsigned PRI_SD : 1;
3099 unsigned : 1;
3100 unsigned : 1;
3101 unsigned : 1;
3102 unsigned : 1;
3103 unsigned : 1;
3104 } __OSCCON2bits_t;
3106 extern __at(0x0FD2) volatile __OSCCON2bits_t OSCCON2bits;
3108 #define _LFIOFS 0x01
3109 #define _HFIOFL 0x02
3110 #define _PRI_SD 0x04
3112 //==============================================================================
3115 //==============================================================================
3116 // OSCCON Bits
3118 extern __at(0x0FD3) __sfr OSCCON;
3120 typedef union
3122 struct
3124 unsigned SCS0 : 1;
3125 unsigned SCS1 : 1;
3126 unsigned IOFS : 1;
3127 unsigned OSTS : 1;
3128 unsigned IRCF0 : 1;
3129 unsigned IRCF1 : 1;
3130 unsigned IRCF2 : 1;
3131 unsigned IDLEN : 1;
3134 struct
3136 unsigned SCS : 2;
3137 unsigned : 6;
3140 struct
3142 unsigned : 4;
3143 unsigned IRCF : 3;
3144 unsigned : 1;
3146 } __OSCCONbits_t;
3148 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
3150 #define _SCS0 0x01
3151 #define _SCS1 0x02
3152 #define _IOFS 0x04
3153 #define _OSTS 0x08
3154 #define _IRCF0 0x10
3155 #define _IRCF1 0x20
3156 #define _IRCF2 0x40
3157 #define _IDLEN 0x80
3159 //==============================================================================
3162 //==============================================================================
3163 // T0CON Bits
3165 extern __at(0x0FD5) __sfr T0CON;
3167 typedef union
3169 struct
3171 unsigned T0PS0 : 1;
3172 unsigned T0PS1 : 1;
3173 unsigned T0PS2 : 1;
3174 unsigned PSA : 1;
3175 unsigned T0SE : 1;
3176 unsigned T0CS : 1;
3177 unsigned T08BIT : 1;
3178 unsigned TMR0ON : 1;
3181 struct
3183 unsigned T0PS : 3;
3184 unsigned : 5;
3186 } __T0CONbits_t;
3188 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
3190 #define _T0PS0 0x01
3191 #define _T0PS1 0x02
3192 #define _T0PS2 0x04
3193 #define _PSA 0x08
3194 #define _T0SE 0x10
3195 #define _T0CS 0x20
3196 #define _T08BIT 0x40
3197 #define _TMR0ON 0x80
3199 //==============================================================================
3201 extern __at(0x0FD6) __sfr TMR0;
3202 extern __at(0x0FD6) __sfr TMR0L;
3203 extern __at(0x0FD7) __sfr TMR0H;
3205 //==============================================================================
3206 // STATUS Bits
3208 extern __at(0x0FD8) __sfr STATUS;
3210 typedef struct
3212 unsigned C : 1;
3213 unsigned DC : 1;
3214 unsigned Z : 1;
3215 unsigned OV : 1;
3216 unsigned N : 1;
3217 unsigned : 1;
3218 unsigned : 1;
3219 unsigned : 1;
3220 } __STATUSbits_t;
3222 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3224 #define _C 0x01
3225 #define _DC 0x02
3226 #define _Z 0x04
3227 #define _OV 0x08
3228 #define _N 0x10
3230 //==============================================================================
3232 extern __at(0x0FD9) __sfr FSR2L;
3233 extern __at(0x0FDA) __sfr FSR2H;
3234 extern __at(0x0FDB) __sfr PLUSW2;
3235 extern __at(0x0FDC) __sfr PREINC2;
3236 extern __at(0x0FDD) __sfr POSTDEC2;
3237 extern __at(0x0FDE) __sfr POSTINC2;
3238 extern __at(0x0FDF) __sfr INDF2;
3239 extern __at(0x0FE0) __sfr BSR;
3240 extern __at(0x0FE1) __sfr FSR1L;
3241 extern __at(0x0FE2) __sfr FSR1H;
3242 extern __at(0x0FE3) __sfr PLUSW1;
3243 extern __at(0x0FE4) __sfr PREINC1;
3244 extern __at(0x0FE5) __sfr POSTDEC1;
3245 extern __at(0x0FE6) __sfr POSTINC1;
3246 extern __at(0x0FE7) __sfr INDF1;
3247 extern __at(0x0FE8) __sfr WREG;
3248 extern __at(0x0FE9) __sfr FSR0L;
3249 extern __at(0x0FEA) __sfr FSR0H;
3250 extern __at(0x0FEB) __sfr PLUSW0;
3251 extern __at(0x0FEC) __sfr PREINC0;
3252 extern __at(0x0FED) __sfr POSTDEC0;
3253 extern __at(0x0FEE) __sfr POSTINC0;
3254 extern __at(0x0FEF) __sfr INDF0;
3256 //==============================================================================
3257 // INTCON3 Bits
3259 extern __at(0x0FF0) __sfr INTCON3;
3261 typedef union
3263 struct
3265 unsigned INT1IF : 1;
3266 unsigned INT2IF : 1;
3267 unsigned : 1;
3268 unsigned INT1IE : 1;
3269 unsigned INT2IE : 1;
3270 unsigned : 1;
3271 unsigned INT1IP : 1;
3272 unsigned INT2IP : 1;
3275 struct
3277 unsigned INT1F : 1;
3278 unsigned INT2F : 1;
3279 unsigned : 1;
3280 unsigned INT1E : 1;
3281 unsigned INT2E : 1;
3282 unsigned : 1;
3283 unsigned INT1P : 1;
3284 unsigned INT2P : 1;
3286 } __INTCON3bits_t;
3288 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3290 #define _INT1IF 0x01
3291 #define _INT1F 0x01
3292 #define _INT2IF 0x02
3293 #define _INT2F 0x02
3294 #define _INT1IE 0x08
3295 #define _INT1E 0x08
3296 #define _INT2IE 0x10
3297 #define _INT2E 0x10
3298 #define _INT1IP 0x40
3299 #define _INT1P 0x40
3300 #define _INT2IP 0x80
3301 #define _INT2P 0x80
3303 //==============================================================================
3306 //==============================================================================
3307 // INTCON2 Bits
3309 extern __at(0x0FF1) __sfr INTCON2;
3311 typedef union
3313 struct
3315 unsigned RABIP : 1;
3316 unsigned : 1;
3317 unsigned TMR0IP : 1;
3318 unsigned : 1;
3319 unsigned INTEDG2 : 1;
3320 unsigned INTEDG1 : 1;
3321 unsigned INTEDG0 : 1;
3322 unsigned NOT_RABPU : 1;
3325 struct
3327 unsigned : 1;
3328 unsigned : 1;
3329 unsigned : 1;
3330 unsigned : 1;
3331 unsigned : 1;
3332 unsigned : 1;
3333 unsigned : 1;
3334 unsigned RABPU : 1;
3336 } __INTCON2bits_t;
3338 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3340 #define _RABIP 0x01
3341 #define _TMR0IP 0x04
3342 #define _INTEDG2 0x10
3343 #define _INTEDG1 0x20
3344 #define _INTEDG0 0x40
3345 #define _NOT_RABPU 0x80
3346 #define _RABPU 0x80
3348 //==============================================================================
3351 //==============================================================================
3352 // INTCON Bits
3354 extern __at(0x0FF2) __sfr INTCON;
3356 typedef union
3358 struct
3360 unsigned RABIF : 1;
3361 unsigned INT0IF : 1;
3362 unsigned TMR0IF : 1;
3363 unsigned RABIE : 1;
3364 unsigned INT0IE : 1;
3365 unsigned TMR0IE : 1;
3366 unsigned PEIE_GIEL : 1;
3367 unsigned GIE_GIEH : 1;
3370 struct
3372 unsigned : 1;
3373 unsigned INT0F : 1;
3374 unsigned T0IF : 1;
3375 unsigned : 1;
3376 unsigned INT0E : 1;
3377 unsigned T0IE : 1;
3378 unsigned PEIE : 1;
3379 unsigned GIE : 1;
3382 struct
3384 unsigned : 1;
3385 unsigned : 1;
3386 unsigned : 1;
3387 unsigned : 1;
3388 unsigned : 1;
3389 unsigned : 1;
3390 unsigned GIEL : 1;
3391 unsigned GIEH : 1;
3393 } __INTCONbits_t;
3395 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3397 #define _RABIF 0x01
3398 #define _INT0IF 0x02
3399 #define _INT0F 0x02
3400 #define _TMR0IF 0x04
3401 #define _T0IF 0x04
3402 #define _RABIE 0x08
3403 #define _INT0IE 0x10
3404 #define _INT0E 0x10
3405 #define _TMR0IE 0x20
3406 #define _T0IE 0x20
3407 #define _PEIE_GIEL 0x40
3408 #define _PEIE 0x40
3409 #define _GIEL 0x40
3410 #define _GIE_GIEH 0x80
3411 #define _GIE 0x80
3412 #define _GIEH 0x80
3414 //==============================================================================
3416 extern __at(0x0FF3) __sfr PROD;
3417 extern __at(0x0FF3) __sfr PRODL;
3418 extern __at(0x0FF4) __sfr PRODH;
3419 extern __at(0x0FF5) __sfr TABLAT;
3420 extern __at(0x0FF6) __sfr TBLPTR;
3421 extern __at(0x0FF6) __sfr TBLPTRL;
3422 extern __at(0x0FF7) __sfr TBLPTRH;
3423 extern __at(0x0FF8) __sfr TBLPTRU;
3424 extern __at(0x0FF9) __sfr PC;
3425 extern __at(0x0FF9) __sfr PCL;
3426 extern __at(0x0FFA) __sfr PCLATH;
3427 extern __at(0x0FFB) __sfr PCLATU;
3429 //==============================================================================
3430 // STKPTR Bits
3432 extern __at(0x0FFC) __sfr STKPTR;
3434 typedef union
3436 struct
3438 unsigned SP0 : 1;
3439 unsigned SP1 : 1;
3440 unsigned SP2 : 1;
3441 unsigned SP3 : 1;
3442 unsigned SP4 : 1;
3443 unsigned : 1;
3444 unsigned STKUNF : 1;
3445 unsigned STKFUL : 1;
3448 struct
3450 unsigned : 1;
3451 unsigned : 1;
3452 unsigned : 1;
3453 unsigned : 1;
3454 unsigned : 1;
3455 unsigned : 1;
3456 unsigned : 1;
3457 unsigned STKOVF : 1;
3460 struct
3462 unsigned SP : 5;
3463 unsigned : 3;
3465 } __STKPTRbits_t;
3467 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
3469 #define _SP0 0x01
3470 #define _SP1 0x02
3471 #define _SP2 0x04
3472 #define _SP3 0x08
3473 #define _SP4 0x10
3474 #define _STKUNF 0x40
3475 #define _STKFUL 0x80
3476 #define _STKOVF 0x80
3478 //==============================================================================
3480 extern __at(0x0FFD) __sfr TOS;
3481 extern __at(0x0FFD) __sfr TOSL;
3482 extern __at(0x0FFE) __sfr TOSH;
3483 extern __at(0x0FFF) __sfr TOSU;
3485 //==============================================================================
3487 // Configuration Bits
3489 //==============================================================================
3491 #define __CONFIG1L 0x300000
3492 #define __CONFIG1H 0x300001
3493 #define __CONFIG2L 0x300002
3494 #define __CONFIG2H 0x300003
3495 #define __CONFIG3H 0x300005
3496 #define __CONFIG4L 0x300006
3497 #define __CONFIG5L 0x300008
3498 #define __CONFIG5H 0x300009
3499 #define __CONFIG6L 0x30000A
3500 #define __CONFIG6H 0x30000B
3501 #define __CONFIG7L 0x30000C
3502 #define __CONFIG7H 0x30000D
3504 //----------------------------- CONFIG1L Options -------------------------------
3506 #define _CPUDIV_NOCLKDIV_1L 0xE7 // No CPU System Clock divide.
3507 #define _CPUDIV_CLKDIV2_1L 0xEF // CPU System Clock divided by 2.
3508 #define _CPUDIV_CLKDIV3_1L 0xF7 // CPU System Clock divided by 3.
3509 #define _CPUDIV_CLKDIV4_1L 0xFF // CPU System Clock divided by 4.
3510 #define _USBDIV_OFF_1L 0xDF // USB clock comes directly from the OSC1/OSC2 oscillator block; no divide.
3511 #define _USBDIV_ON_1L 0xFF // USB clock comes from the OSC1/OSC2 divided by 2.
3513 //----------------------------- CONFIG1H Options -------------------------------
3515 #define _FOSC_LP_1H 0xF0 // LP oscillator.
3516 #define _FOSC_XT_1H 0xF1 // XT oscillator.
3517 #define _FOSC_HS_1H 0xF2 // HS oscillator.
3518 #define _FOSC_ERCCLKOUT_1H 0xF3 // External RC oscillator, CLKOUT function on OSC2.
3519 #define _FOSC_ECCLKOUTH_1H 0xF4 // EC, CLKOUT function on OSC2 (high).
3520 #define _FOSC_ECH_1H 0xF5 // EC (high).
3521 #define _FOSC_ERC_1H 0xF7 // External RC oscillator.
3522 #define _FOSC_IRC_1H 0xF8 // Internal RC oscillator.
3523 #define _FOSC_IRCCLKOUT_1H 0xF9 // Internal RC oscillator, CLKOUT function on OSC2.
3524 #define _FOSC_ECCLKOUTM_1H 0xFA // EC, CLKOUT function on OSC2 (medium).
3525 #define _FOSC_ECM_1H 0xFB // EC (medium).
3526 #define _FOSC_ECCLKOUTL_1H 0xFC // EC, CLKOUT function on OSC2 (low).
3527 #define _FOSC_ECL_1H 0xFD // EC (low).
3528 #define _PLLEN_OFF_1H 0xEF // PLL is under software control.
3529 #define _PLLEN_ON_1H 0xFF // Oscillator multiplied by 4.
3530 #define _PCLKEN_OFF_1H 0xDF // Primary clock is under software control.
3531 #define _PCLKEN_ON_1H 0xFF // Primary clock enabled.
3532 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
3533 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
3534 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
3535 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
3537 //----------------------------- CONFIG2L Options -------------------------------
3539 #define _PWRTEN_ON_2L 0xFE // PWRT enabled.
3540 #define _PWRTEN_OFF_2L 0xFF // PWRT disabled.
3541 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
3542 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
3543 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
3544 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
3545 #define _BORV_30_2L 0xE7 // VBOR set to 3.0 V nominal.
3546 #define _BORV_27_2L 0xEF // VBOR set to 2.7 V nominal.
3547 #define _BORV_22_2L 0xF7 // VBOR set to 2.2 V nominal.
3548 #define _BORV_19_2L 0xFF // VBOR set to 1.9 V nominal.
3550 //----------------------------- CONFIG2H Options -------------------------------
3552 #define _WDTEN_OFF_2H 0xFE // WDT is controlled by SWDTEN bit of the WDTCON register.
3553 #define _WDTEN_ON_2H 0xFF // WDT is always enabled. SWDTEN bit has no effect.
3554 #define _WDTPS_1_2H 0xE1 // 1:1.
3555 #define _WDTPS_2_2H 0xE3 // 1:2.
3556 #define _WDTPS_4_2H 0xE5 // 1:4.
3557 #define _WDTPS_8_2H 0xE7 // 1:8.
3558 #define _WDTPS_16_2H 0xE9 // 1:16.
3559 #define _WDTPS_32_2H 0xEB // 1:32.
3560 #define _WDTPS_64_2H 0xED // 1:64.
3561 #define _WDTPS_128_2H 0xEF // 1:128.
3562 #define _WDTPS_256_2H 0xF1 // 1:256.
3563 #define _WDTPS_512_2H 0xF3 // 1:512.
3564 #define _WDTPS_1024_2H 0xF5 // 1:1024.
3565 #define _WDTPS_2048_2H 0xF7 // 1:2048.
3566 #define _WDTPS_4096_2H 0xF9 // 1:4096.
3567 #define _WDTPS_8192_2H 0xFB // 1:8192.
3568 #define _WDTPS_16384_2H 0xFD // 1:16384.
3569 #define _WDTPS_32768_2H 0xFF // 1:32768.
3571 //----------------------------- CONFIG3H Options -------------------------------
3573 #define _HFOFST_OFF_3H 0xF7 // The system clock is held off until the HFINTOSC is stable.
3574 #define _HFOFST_ON_3H 0xFF // HFINTOSC starts clocking the CPU without waiting for the oscillator to stablize.
3575 #define _MCLRE_OFF_3H 0x7F // RA3 input pin enabled; MCLR disabled.
3576 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RA3 input pin disabled.
3578 //----------------------------- CONFIG4L Options -------------------------------
3580 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
3581 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
3582 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
3583 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled.
3584 #define _BBSIZ_OFF_4L 0xF7 // 1kW boot block size.
3585 #define _BBSIZ_ON_4L 0xFF // 2kW boot block size.
3586 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
3587 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
3588 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RA0 and RA1 are dedicated to In-Circuit Debug.
3589 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RA0 and RA1 configured as general purpose I/O pins.
3591 //----------------------------- CONFIG5L Options -------------------------------
3593 #define _CP0_ON_5L 0xFE // Block 0 code-protected.
3594 #define _CP0_OFF_5L 0xFF // Block 0 not code-protected.
3595 #define _CP1_ON_5L 0xFD // Block 1 code-protected.
3596 #define _CP1_OFF_5L 0xFF // Block 1 not code-protected.
3598 //----------------------------- CONFIG5H Options -------------------------------
3600 #define _CPB_ON_5H 0xBF // Boot block code-protected.
3601 #define _CPB_OFF_5H 0xFF // Boot block not code-protected.
3602 #define _CPD_ON_5H 0x7F // Data EEPROM code-protected.
3603 #define _CPD_OFF_5H 0xFF // Data EEPROM not code-protected.
3605 //----------------------------- CONFIG6L Options -------------------------------
3607 #define _WRT0_ON_6L 0xFE // Block 0 write-protected.
3608 #define _WRT0_OFF_6L 0xFF // Block 0 not write-protected.
3609 #define _WRT1_ON_6L 0xFD // Block 1 write-protected.
3610 #define _WRT1_OFF_6L 0xFF // Block 1 not write-protected.
3612 //----------------------------- CONFIG6H Options -------------------------------
3614 #define _WRTC_ON_6H 0xDF // Configuration registers write-protected.
3615 #define _WRTC_OFF_6H 0xFF // Configuration registers not write-protected.
3616 #define _WRTB_ON_6H 0xBF // Boot block write-protected.
3617 #define _WRTB_OFF_6H 0xFF // Boot block not write-protected.
3618 #define _WRTD_ON_6H 0x7F // Data EEPROM write-protected.
3619 #define _WRTD_OFF_6H 0xFF // Data EEPROM not write-protected.
3621 //----------------------------- CONFIG7L Options -------------------------------
3623 #define _EBTR0_ON_7L 0xFE // Block 0 protected from table reads executed in other blocks.
3624 #define _EBTR0_OFF_7L 0xFF // Block 0 not protected from table reads executed in other blocks.
3625 #define _EBTR1_ON_7L 0xFD // Block 1 protected from table reads executed in other blocks.
3626 #define _EBTR1_OFF_7L 0xFF // Block 1 not protected from table reads executed in other blocks.
3628 //----------------------------- CONFIG7H Options -------------------------------
3630 #define _EBTRB_ON_7H 0xBF // Boot block protected from table reads executed in other blocks.
3631 #define _EBTRB_OFF_7H 0xFF // Boot block not protected from table reads executed in other blocks.
3633 //==============================================================================
3635 #define __DEVID1 0x3FFFFE
3636 #define __DEVID2 0x3FFFFF
3638 #define __IDLOC0 0x200000
3639 #define __IDLOC1 0x200001
3640 #define __IDLOC2 0x200002
3641 #define __IDLOC3 0x200003
3642 #define __IDLOC4 0x200004
3643 #define __IDLOC5 0x200005
3644 #define __IDLOC6 0x200006
3645 #define __IDLOC7 0x200007
3647 #endif // #ifndef __PIC18F14K50_H__