struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f2550.h
blob0f97df148a4f6d8365abe10a01b72f10d4e5a2ec
1 /*
2 * This declarations of the PIC18F2550 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:44 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 __PIC18F2550_H__
26 #define __PIC18F2550_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
36 extern __at(0x0F66) __sfr UFRM;
38 //==============================================================================
39 // UFRML Bits
41 extern __at(0x0F66) __sfr UFRML;
43 typedef struct
45 unsigned FRM0 : 1;
46 unsigned FRM1 : 1;
47 unsigned FRM2 : 1;
48 unsigned FRM3 : 1;
49 unsigned FRM4 : 1;
50 unsigned FRM5 : 1;
51 unsigned FRM6 : 1;
52 unsigned FRM7 : 1;
53 } __UFRMLbits_t;
55 extern __at(0x0F66) volatile __UFRMLbits_t UFRMLbits;
57 #define _FRM0 0x01
58 #define _FRM1 0x02
59 #define _FRM2 0x04
60 #define _FRM3 0x08
61 #define _FRM4 0x10
62 #define _FRM5 0x20
63 #define _FRM6 0x40
64 #define _FRM7 0x80
66 //==============================================================================
69 //==============================================================================
70 // UFRMH Bits
72 extern __at(0x0F67) __sfr UFRMH;
74 typedef struct
76 unsigned FRM8 : 1;
77 unsigned FRM9 : 1;
78 unsigned FRM10 : 1;
79 unsigned : 1;
80 unsigned : 1;
81 unsigned : 1;
82 unsigned : 1;
83 unsigned : 1;
84 } __UFRMHbits_t;
86 extern __at(0x0F67) volatile __UFRMHbits_t UFRMHbits;
88 #define _FRM8 0x01
89 #define _FRM9 0x02
90 #define _FRM10 0x04
92 //==============================================================================
95 //==============================================================================
96 // UIR Bits
98 extern __at(0x0F68) __sfr UIR;
100 typedef struct
102 unsigned URSTIF : 1;
103 unsigned UERRIF : 1;
104 unsigned ACTVIF : 1;
105 unsigned TRNIF : 1;
106 unsigned IDLEIF : 1;
107 unsigned STALLIF : 1;
108 unsigned SOFIF : 1;
109 unsigned : 1;
110 } __UIRbits_t;
112 extern __at(0x0F68) volatile __UIRbits_t UIRbits;
114 #define _URSTIF 0x01
115 #define _UERRIF 0x02
116 #define _ACTVIF 0x04
117 #define _TRNIF 0x08
118 #define _IDLEIF 0x10
119 #define _STALLIF 0x20
120 #define _SOFIF 0x40
122 //==============================================================================
125 //==============================================================================
126 // UIE Bits
128 extern __at(0x0F69) __sfr UIE;
130 typedef struct
132 unsigned URSTIE : 1;
133 unsigned UERRIE : 1;
134 unsigned ACTVIE : 1;
135 unsigned TRNIE : 1;
136 unsigned IDLEIE : 1;
137 unsigned STALLIE : 1;
138 unsigned SOFIE : 1;
139 unsigned : 1;
140 } __UIEbits_t;
142 extern __at(0x0F69) volatile __UIEbits_t UIEbits;
144 #define _URSTIE 0x01
145 #define _UERRIE 0x02
146 #define _ACTVIE 0x04
147 #define _TRNIE 0x08
148 #define _IDLEIE 0x10
149 #define _STALLIE 0x20
150 #define _SOFIE 0x40
152 //==============================================================================
155 //==============================================================================
156 // UEIR Bits
158 extern __at(0x0F6A) __sfr UEIR;
160 typedef struct
162 unsigned PIDEF : 1;
163 unsigned CRC5EF : 1;
164 unsigned CRC16EF : 1;
165 unsigned DFN8EF : 1;
166 unsigned BTOEF : 1;
167 unsigned : 1;
168 unsigned : 1;
169 unsigned BTSEF : 1;
170 } __UEIRbits_t;
172 extern __at(0x0F6A) volatile __UEIRbits_t UEIRbits;
174 #define _PIDEF 0x01
175 #define _CRC5EF 0x02
176 #define _CRC16EF 0x04
177 #define _DFN8EF 0x08
178 #define _BTOEF 0x10
179 #define _BTSEF 0x80
181 //==============================================================================
184 //==============================================================================
185 // UEIE Bits
187 extern __at(0x0F6B) __sfr UEIE;
189 typedef struct
191 unsigned PIDEE : 1;
192 unsigned CRC5EE : 1;
193 unsigned CRC16EE : 1;
194 unsigned DFN8EE : 1;
195 unsigned BTOEE : 1;
196 unsigned : 1;
197 unsigned : 1;
198 unsigned BTSEE : 1;
199 } __UEIEbits_t;
201 extern __at(0x0F6B) volatile __UEIEbits_t UEIEbits;
203 #define _PIDEE 0x01
204 #define _CRC5EE 0x02
205 #define _CRC16EE 0x04
206 #define _DFN8EE 0x08
207 #define _BTOEE 0x10
208 #define _BTSEE 0x80
210 //==============================================================================
213 //==============================================================================
214 // USTAT Bits
216 extern __at(0x0F6C) __sfr USTAT;
218 typedef union
220 struct
222 unsigned : 1;
223 unsigned PPBI : 1;
224 unsigned DIR : 1;
225 unsigned ENDP0 : 1;
226 unsigned ENDP1 : 1;
227 unsigned ENDP2 : 1;
228 unsigned ENDP3 : 1;
229 unsigned : 1;
232 struct
234 unsigned : 3;
235 unsigned ENDP : 4;
236 unsigned : 1;
238 } __USTATbits_t;
240 extern __at(0x0F6C) volatile __USTATbits_t USTATbits;
242 #define _PPBI 0x02
243 #define _DIR 0x04
244 #define _ENDP0 0x08
245 #define _ENDP1 0x10
246 #define _ENDP2 0x20
247 #define _ENDP3 0x40
249 //==============================================================================
252 //==============================================================================
253 // UCON Bits
255 extern __at(0x0F6D) __sfr UCON;
257 typedef struct
259 unsigned : 1;
260 unsigned SUSPND : 1;
261 unsigned RESUME : 1;
262 unsigned USBEN : 1;
263 unsigned PKTDIS : 1;
264 unsigned SE0 : 1;
265 unsigned PPBRST : 1;
266 unsigned : 1;
267 } __UCONbits_t;
269 extern __at(0x0F6D) volatile __UCONbits_t UCONbits;
271 #define _SUSPND 0x02
272 #define _RESUME 0x04
273 #define _USBEN 0x08
274 #define _PKTDIS 0x10
275 #define _SE0 0x20
276 #define _PPBRST 0x40
278 //==============================================================================
281 //==============================================================================
282 // UADDR Bits
284 extern __at(0x0F6E) __sfr UADDR;
286 typedef union
288 struct
290 unsigned ADDR0 : 1;
291 unsigned ADDR1 : 1;
292 unsigned ADDR2 : 1;
293 unsigned ADDR3 : 1;
294 unsigned ADDR4 : 1;
295 unsigned ADDR5 : 1;
296 unsigned ADDR6 : 1;
297 unsigned : 1;
300 struct
302 unsigned ADDR : 7;
303 unsigned : 1;
305 } __UADDRbits_t;
307 extern __at(0x0F6E) volatile __UADDRbits_t UADDRbits;
309 #define _ADDR0 0x01
310 #define _ADDR1 0x02
311 #define _ADDR2 0x04
312 #define _ADDR3 0x08
313 #define _ADDR4 0x10
314 #define _ADDR5 0x20
315 #define _ADDR6 0x40
317 //==============================================================================
320 //==============================================================================
321 // UCFG Bits
323 extern __at(0x0F6F) __sfr UCFG;
325 typedef union
327 struct
329 unsigned PPB0 : 1;
330 unsigned PPB1 : 1;
331 unsigned FSEN : 1;
332 unsigned UTRDIS : 1;
333 unsigned UPUEN : 1;
334 unsigned : 1;
335 unsigned UOEMON : 1;
336 unsigned UTEYE : 1;
339 struct
341 unsigned PPB : 2;
342 unsigned : 6;
344 } __UCFGbits_t;
346 extern __at(0x0F6F) volatile __UCFGbits_t UCFGbits;
348 #define _PPB0 0x01
349 #define _PPB1 0x02
350 #define _FSEN 0x04
351 #define _UTRDIS 0x08
352 #define _UPUEN 0x10
353 #define _UOEMON 0x40
354 #define _UTEYE 0x80
356 //==============================================================================
359 //==============================================================================
360 // UEP0 Bits
362 extern __at(0x0F70) __sfr UEP0;
364 typedef struct
366 unsigned EPSTALL : 1;
367 unsigned EPINEN : 1;
368 unsigned EPOUTEN : 1;
369 unsigned EPCONDIS : 1;
370 unsigned EPHSHK : 1;
371 unsigned : 1;
372 unsigned : 1;
373 unsigned : 1;
374 } __UEP0bits_t;
376 extern __at(0x0F70) volatile __UEP0bits_t UEP0bits;
378 #define _EPSTALL 0x01
379 #define _EPINEN 0x02
380 #define _EPOUTEN 0x04
381 #define _EPCONDIS 0x08
382 #define _EPHSHK 0x10
384 //==============================================================================
387 //==============================================================================
388 // UEP1 Bits
390 extern __at(0x0F71) __sfr UEP1;
392 typedef struct
394 unsigned EPSTALL : 1;
395 unsigned EPINEN : 1;
396 unsigned EPOUTEN : 1;
397 unsigned EPCONDIS : 1;
398 unsigned EPHSHK : 1;
399 unsigned : 1;
400 unsigned : 1;
401 unsigned : 1;
402 } __UEP1bits_t;
404 extern __at(0x0F71) volatile __UEP1bits_t UEP1bits;
406 #define _UEP1_EPSTALL 0x01
407 #define _UEP1_EPINEN 0x02
408 #define _UEP1_EPOUTEN 0x04
409 #define _UEP1_EPCONDIS 0x08
410 #define _UEP1_EPHSHK 0x10
412 //==============================================================================
415 //==============================================================================
416 // UEP2 Bits
418 extern __at(0x0F72) __sfr UEP2;
420 typedef struct
422 unsigned EPSTALL : 1;
423 unsigned EPINEN : 1;
424 unsigned EPOUTEN : 1;
425 unsigned EPCONDIS : 1;
426 unsigned EPHSHK : 1;
427 unsigned : 1;
428 unsigned : 1;
429 unsigned : 1;
430 } __UEP2bits_t;
432 extern __at(0x0F72) volatile __UEP2bits_t UEP2bits;
434 #define _UEP2_EPSTALL 0x01
435 #define _UEP2_EPINEN 0x02
436 #define _UEP2_EPOUTEN 0x04
437 #define _UEP2_EPCONDIS 0x08
438 #define _UEP2_EPHSHK 0x10
440 //==============================================================================
443 //==============================================================================
444 // UEP3 Bits
446 extern __at(0x0F73) __sfr UEP3;
448 typedef struct
450 unsigned EPSTALL : 1;
451 unsigned EPINEN : 1;
452 unsigned EPOUTEN : 1;
453 unsigned EPCONDIS : 1;
454 unsigned EPHSHK : 1;
455 unsigned : 1;
456 unsigned : 1;
457 unsigned : 1;
458 } __UEP3bits_t;
460 extern __at(0x0F73) volatile __UEP3bits_t UEP3bits;
462 #define _UEP3_EPSTALL 0x01
463 #define _UEP3_EPINEN 0x02
464 #define _UEP3_EPOUTEN 0x04
465 #define _UEP3_EPCONDIS 0x08
466 #define _UEP3_EPHSHK 0x10
468 //==============================================================================
471 //==============================================================================
472 // UEP4 Bits
474 extern __at(0x0F74) __sfr UEP4;
476 typedef struct
478 unsigned EPSTALL : 1;
479 unsigned EPINEN : 1;
480 unsigned EPOUTEN : 1;
481 unsigned EPCONDIS : 1;
482 unsigned EPHSHK : 1;
483 unsigned : 1;
484 unsigned : 1;
485 unsigned : 1;
486 } __UEP4bits_t;
488 extern __at(0x0F74) volatile __UEP4bits_t UEP4bits;
490 #define _UEP4_EPSTALL 0x01
491 #define _UEP4_EPINEN 0x02
492 #define _UEP4_EPOUTEN 0x04
493 #define _UEP4_EPCONDIS 0x08
494 #define _UEP4_EPHSHK 0x10
496 //==============================================================================
499 //==============================================================================
500 // UEP5 Bits
502 extern __at(0x0F75) __sfr UEP5;
504 typedef struct
506 unsigned EPSTALL : 1;
507 unsigned EPINEN : 1;
508 unsigned EPOUTEN : 1;
509 unsigned EPCONDIS : 1;
510 unsigned EPHSHK : 1;
511 unsigned : 1;
512 unsigned : 1;
513 unsigned : 1;
514 } __UEP5bits_t;
516 extern __at(0x0F75) volatile __UEP5bits_t UEP5bits;
518 #define _UEP5_EPSTALL 0x01
519 #define _UEP5_EPINEN 0x02
520 #define _UEP5_EPOUTEN 0x04
521 #define _UEP5_EPCONDIS 0x08
522 #define _UEP5_EPHSHK 0x10
524 //==============================================================================
527 //==============================================================================
528 // UEP6 Bits
530 extern __at(0x0F76) __sfr UEP6;
532 typedef struct
534 unsigned EPSTALL : 1;
535 unsigned EPINEN : 1;
536 unsigned EPOUTEN : 1;
537 unsigned EPCONDIS : 1;
538 unsigned EPHSHK : 1;
539 unsigned : 1;
540 unsigned : 1;
541 unsigned : 1;
542 } __UEP6bits_t;
544 extern __at(0x0F76) volatile __UEP6bits_t UEP6bits;
546 #define _UEP6_EPSTALL 0x01
547 #define _UEP6_EPINEN 0x02
548 #define _UEP6_EPOUTEN 0x04
549 #define _UEP6_EPCONDIS 0x08
550 #define _UEP6_EPHSHK 0x10
552 //==============================================================================
555 //==============================================================================
556 // UEP7 Bits
558 extern __at(0x0F77) __sfr UEP7;
560 typedef struct
562 unsigned EPSTALL : 1;
563 unsigned EPINEN : 1;
564 unsigned EPOUTEN : 1;
565 unsigned EPCONDIS : 1;
566 unsigned EPHSHK : 1;
567 unsigned : 1;
568 unsigned : 1;
569 unsigned : 1;
570 } __UEP7bits_t;
572 extern __at(0x0F77) volatile __UEP7bits_t UEP7bits;
574 #define _UEP7_EPSTALL 0x01
575 #define _UEP7_EPINEN 0x02
576 #define _UEP7_EPOUTEN 0x04
577 #define _UEP7_EPCONDIS 0x08
578 #define _UEP7_EPHSHK 0x10
580 //==============================================================================
583 //==============================================================================
584 // UEP8 Bits
586 extern __at(0x0F78) __sfr UEP8;
588 typedef struct
590 unsigned EPSTALL : 1;
591 unsigned EPINEN : 1;
592 unsigned EPOUTEN : 1;
593 unsigned EPCONDIS : 1;
594 unsigned EPHSHK : 1;
595 unsigned : 1;
596 unsigned : 1;
597 unsigned : 1;
598 } __UEP8bits_t;
600 extern __at(0x0F78) volatile __UEP8bits_t UEP8bits;
602 #define _UEP8_EPSTALL 0x01
603 #define _UEP8_EPINEN 0x02
604 #define _UEP8_EPOUTEN 0x04
605 #define _UEP8_EPCONDIS 0x08
606 #define _UEP8_EPHSHK 0x10
608 //==============================================================================
611 //==============================================================================
612 // UEP9 Bits
614 extern __at(0x0F79) __sfr UEP9;
616 typedef struct
618 unsigned EPSTALL : 1;
619 unsigned EPINEN : 1;
620 unsigned EPOUTEN : 1;
621 unsigned EPCONDIS : 1;
622 unsigned EPHSHK : 1;
623 unsigned : 1;
624 unsigned : 1;
625 unsigned : 1;
626 } __UEP9bits_t;
628 extern __at(0x0F79) volatile __UEP9bits_t UEP9bits;
630 #define _UEP9_EPSTALL 0x01
631 #define _UEP9_EPINEN 0x02
632 #define _UEP9_EPOUTEN 0x04
633 #define _UEP9_EPCONDIS 0x08
634 #define _UEP9_EPHSHK 0x10
636 //==============================================================================
639 //==============================================================================
640 // UEP10 Bits
642 extern __at(0x0F7A) __sfr UEP10;
644 typedef struct
646 unsigned EPSTALL : 1;
647 unsigned EPINEN : 1;
648 unsigned EPOUTEN : 1;
649 unsigned EPCONDIS : 1;
650 unsigned EPHSHK : 1;
651 unsigned : 1;
652 unsigned : 1;
653 unsigned : 1;
654 } __UEP10bits_t;
656 extern __at(0x0F7A) volatile __UEP10bits_t UEP10bits;
658 #define _UEP10_EPSTALL 0x01
659 #define _UEP10_EPINEN 0x02
660 #define _UEP10_EPOUTEN 0x04
661 #define _UEP10_EPCONDIS 0x08
662 #define _UEP10_EPHSHK 0x10
664 //==============================================================================
667 //==============================================================================
668 // UEP11 Bits
670 extern __at(0x0F7B) __sfr UEP11;
672 typedef struct
674 unsigned EPSTALL : 1;
675 unsigned EPINEN : 1;
676 unsigned EPOUTEN : 1;
677 unsigned EPCONDIS : 1;
678 unsigned EPHSHK : 1;
679 unsigned : 1;
680 unsigned : 1;
681 unsigned : 1;
682 } __UEP11bits_t;
684 extern __at(0x0F7B) volatile __UEP11bits_t UEP11bits;
686 #define _UEP11_EPSTALL 0x01
687 #define _UEP11_EPINEN 0x02
688 #define _UEP11_EPOUTEN 0x04
689 #define _UEP11_EPCONDIS 0x08
690 #define _UEP11_EPHSHK 0x10
692 //==============================================================================
695 //==============================================================================
696 // UEP12 Bits
698 extern __at(0x0F7C) __sfr UEP12;
700 typedef struct
702 unsigned EPSTALL : 1;
703 unsigned EPINEN : 1;
704 unsigned EPOUTEN : 1;
705 unsigned EPCONDIS : 1;
706 unsigned EPHSHK : 1;
707 unsigned : 1;
708 unsigned : 1;
709 unsigned : 1;
710 } __UEP12bits_t;
712 extern __at(0x0F7C) volatile __UEP12bits_t UEP12bits;
714 #define _UEP12_EPSTALL 0x01
715 #define _UEP12_EPINEN 0x02
716 #define _UEP12_EPOUTEN 0x04
717 #define _UEP12_EPCONDIS 0x08
718 #define _UEP12_EPHSHK 0x10
720 //==============================================================================
723 //==============================================================================
724 // UEP13 Bits
726 extern __at(0x0F7D) __sfr UEP13;
728 typedef struct
730 unsigned EPSTALL : 1;
731 unsigned EPINEN : 1;
732 unsigned EPOUTEN : 1;
733 unsigned EPCONDIS : 1;
734 unsigned EPHSHK : 1;
735 unsigned : 1;
736 unsigned : 1;
737 unsigned : 1;
738 } __UEP13bits_t;
740 extern __at(0x0F7D) volatile __UEP13bits_t UEP13bits;
742 #define _UEP13_EPSTALL 0x01
743 #define _UEP13_EPINEN 0x02
744 #define _UEP13_EPOUTEN 0x04
745 #define _UEP13_EPCONDIS 0x08
746 #define _UEP13_EPHSHK 0x10
748 //==============================================================================
751 //==============================================================================
752 // UEP14 Bits
754 extern __at(0x0F7E) __sfr UEP14;
756 typedef struct
758 unsigned EPSTALL : 1;
759 unsigned EPINEN : 1;
760 unsigned EPOUTEN : 1;
761 unsigned EPCONDIS : 1;
762 unsigned EPHSHK : 1;
763 unsigned : 1;
764 unsigned : 1;
765 unsigned : 1;
766 } __UEP14bits_t;
768 extern __at(0x0F7E) volatile __UEP14bits_t UEP14bits;
770 #define _UEP14_EPSTALL 0x01
771 #define _UEP14_EPINEN 0x02
772 #define _UEP14_EPOUTEN 0x04
773 #define _UEP14_EPCONDIS 0x08
774 #define _UEP14_EPHSHK 0x10
776 //==============================================================================
779 //==============================================================================
780 // UEP15 Bits
782 extern __at(0x0F7F) __sfr UEP15;
784 typedef struct
786 unsigned EPSTALL : 1;
787 unsigned EPINEN : 1;
788 unsigned EPOUTEN : 1;
789 unsigned EPCONDIS : 1;
790 unsigned EPHSHK : 1;
791 unsigned : 1;
792 unsigned : 1;
793 unsigned : 1;
794 } __UEP15bits_t;
796 extern __at(0x0F7F) volatile __UEP15bits_t UEP15bits;
798 #define _UEP15_EPSTALL 0x01
799 #define _UEP15_EPINEN 0x02
800 #define _UEP15_EPOUTEN 0x04
801 #define _UEP15_EPCONDIS 0x08
802 #define _UEP15_EPHSHK 0x10
804 //==============================================================================
807 //==============================================================================
808 // PORTA Bits
810 extern __at(0x0F80) __sfr PORTA;
812 typedef union
814 struct
816 unsigned RA0 : 1;
817 unsigned RA1 : 1;
818 unsigned RA2 : 1;
819 unsigned RA3 : 1;
820 unsigned RA4 : 1;
821 unsigned RA5 : 1;
822 unsigned RA6 : 1;
823 unsigned : 1;
826 struct
828 unsigned AN0 : 1;
829 unsigned AN1 : 1;
830 unsigned AN2 : 1;
831 unsigned AN3 : 1;
832 unsigned T0CKI : 1;
833 unsigned AN4 : 1;
834 unsigned OSC2 : 1;
835 unsigned : 1;
838 struct
840 unsigned : 1;
841 unsigned : 1;
842 unsigned VREFM : 1;
843 unsigned VREFP : 1;
844 unsigned : 1;
845 unsigned LVDIN : 1;
846 unsigned : 1;
847 unsigned : 1;
850 struct
852 unsigned : 1;
853 unsigned : 1;
854 unsigned : 1;
855 unsigned : 1;
856 unsigned : 1;
857 unsigned HLVDIN : 1;
858 unsigned : 1;
859 unsigned : 1;
862 struct
864 unsigned RA : 7;
865 unsigned : 1;
867 } __PORTAbits_t;
869 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
871 #define _PORTA_RA0 0x01
872 #define _PORTA_AN0 0x01
873 #define _PORTA_RA1 0x02
874 #define _PORTA_AN1 0x02
875 #define _PORTA_RA2 0x04
876 #define _PORTA_AN2 0x04
877 #define _PORTA_VREFM 0x04
878 #define _PORTA_RA3 0x08
879 #define _PORTA_AN3 0x08
880 #define _PORTA_VREFP 0x08
881 #define _PORTA_RA4 0x10
882 #define _PORTA_T0CKI 0x10
883 #define _PORTA_RA5 0x20
884 #define _PORTA_AN4 0x20
885 #define _PORTA_LVDIN 0x20
886 #define _PORTA_HLVDIN 0x20
887 #define _PORTA_RA6 0x40
888 #define _PORTA_OSC2 0x40
890 //==============================================================================
893 //==============================================================================
894 // PORTB Bits
896 extern __at(0x0F81) __sfr PORTB;
898 typedef union
900 struct
902 unsigned RB0 : 1;
903 unsigned RB1 : 1;
904 unsigned RB2 : 1;
905 unsigned RB3 : 1;
906 unsigned RB4 : 1;
907 unsigned RB5 : 1;
908 unsigned RB6 : 1;
909 unsigned RB7 : 1;
912 struct
914 unsigned INT0 : 1;
915 unsigned INT1 : 1;
916 unsigned INT2 : 1;
917 unsigned : 1;
918 unsigned : 1;
919 unsigned PGM : 1;
920 unsigned PGC : 1;
921 unsigned PGD : 1;
924 struct
926 unsigned INT : 3;
927 unsigned : 5;
929 } __PORTBbits_t;
931 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
933 #define _PORTB_RB0 0x01
934 #define _PORTB_INT0 0x01
935 #define _PORTB_RB1 0x02
936 #define _PORTB_INT1 0x02
937 #define _PORTB_RB2 0x04
938 #define _PORTB_INT2 0x04
939 #define _PORTB_RB3 0x08
940 #define _PORTB_RB4 0x10
941 #define _PORTB_RB5 0x20
942 #define _PORTB_PGM 0x20
943 #define _PORTB_RB6 0x40
944 #define _PORTB_PGC 0x40
945 #define _PORTB_RB7 0x80
946 #define _PORTB_PGD 0x80
948 //==============================================================================
951 //==============================================================================
952 // PORTC Bits
954 extern __at(0x0F82) __sfr PORTC;
956 typedef union
958 struct
960 unsigned RC0 : 1;
961 unsigned RC1 : 1;
962 unsigned RC2 : 1;
963 unsigned : 1;
964 unsigned RC4 : 1;
965 unsigned RC5 : 1;
966 unsigned RC6 : 1;
967 unsigned RC7 : 1;
970 struct
972 unsigned T1OSO : 1;
973 unsigned T1OSI : 1;
974 unsigned CCP1 : 1;
975 unsigned : 1;
976 unsigned : 1;
977 unsigned : 1;
978 unsigned TX : 1;
979 unsigned RX : 1;
982 struct
984 unsigned T13CKI : 1;
985 unsigned : 1;
986 unsigned P1A : 1;
987 unsigned : 1;
988 unsigned : 1;
989 unsigned : 1;
990 unsigned CK : 1;
991 unsigned : 1;
993 } __PORTCbits_t;
995 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
997 #define _PORTC_RC0 0x01
998 #define _PORTC_T1OSO 0x01
999 #define _PORTC_T13CKI 0x01
1000 #define _PORTC_RC1 0x02
1001 #define _PORTC_T1OSI 0x02
1002 #define _PORTC_RC2 0x04
1003 #define _PORTC_CCP1 0x04
1004 #define _PORTC_P1A 0x04
1005 #define _PORTC_RC4 0x10
1006 #define _PORTC_RC5 0x20
1007 #define _PORTC_RC6 0x40
1008 #define _PORTC_TX 0x40
1009 #define _PORTC_CK 0x40
1010 #define _PORTC_RC7 0x80
1011 #define _PORTC_RX 0x80
1013 //==============================================================================
1016 //==============================================================================
1017 // PORTE Bits
1019 extern __at(0x0F84) __sfr PORTE;
1021 typedef struct
1023 unsigned : 1;
1024 unsigned : 1;
1025 unsigned : 1;
1026 unsigned RE3 : 1;
1027 unsigned : 1;
1028 unsigned : 1;
1029 unsigned : 1;
1030 unsigned : 1;
1031 } __PORTEbits_t;
1033 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1035 #define _RE3 0x08
1037 //==============================================================================
1040 //==============================================================================
1041 // LATA Bits
1043 extern __at(0x0F89) __sfr LATA;
1045 typedef union
1047 struct
1049 unsigned LATA0 : 1;
1050 unsigned LATA1 : 1;
1051 unsigned LATA2 : 1;
1052 unsigned LATA3 : 1;
1053 unsigned LATA4 : 1;
1054 unsigned LATA5 : 1;
1055 unsigned LATA6 : 1;
1056 unsigned : 1;
1059 struct
1061 unsigned LATA : 7;
1062 unsigned : 1;
1064 } __LATAbits_t;
1066 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1068 #define _LATA0 0x01
1069 #define _LATA1 0x02
1070 #define _LATA2 0x04
1071 #define _LATA3 0x08
1072 #define _LATA4 0x10
1073 #define _LATA5 0x20
1074 #define _LATA6 0x40
1076 //==============================================================================
1079 //==============================================================================
1080 // LATB Bits
1082 extern __at(0x0F8A) __sfr LATB;
1084 typedef struct
1086 unsigned LATB0 : 1;
1087 unsigned LATB1 : 1;
1088 unsigned LATB2 : 1;
1089 unsigned LATB3 : 1;
1090 unsigned LATB4 : 1;
1091 unsigned LATB5 : 1;
1092 unsigned LATB6 : 1;
1093 unsigned LATB7 : 1;
1094 } __LATBbits_t;
1096 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1098 #define _LATB0 0x01
1099 #define _LATB1 0x02
1100 #define _LATB2 0x04
1101 #define _LATB3 0x08
1102 #define _LATB4 0x10
1103 #define _LATB5 0x20
1104 #define _LATB6 0x40
1105 #define _LATB7 0x80
1107 //==============================================================================
1110 //==============================================================================
1111 // LATC Bits
1113 extern __at(0x0F8B) __sfr LATC;
1115 typedef struct
1117 unsigned LATC0 : 1;
1118 unsigned LATC1 : 1;
1119 unsigned LATC2 : 1;
1120 unsigned : 1;
1121 unsigned : 1;
1122 unsigned : 1;
1123 unsigned LATC6 : 1;
1124 unsigned LATC7 : 1;
1125 } __LATCbits_t;
1127 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1129 #define _LATC0 0x01
1130 #define _LATC1 0x02
1131 #define _LATC2 0x04
1132 #define _LATC6 0x40
1133 #define _LATC7 0x80
1135 //==============================================================================
1138 //==============================================================================
1139 // DDRA Bits
1141 extern __at(0x0F92) __sfr DDRA;
1143 typedef union
1145 struct
1147 unsigned TRISA0 : 1;
1148 unsigned TRISA1 : 1;
1149 unsigned TRISA2 : 1;
1150 unsigned TRISA3 : 1;
1151 unsigned TRISA4 : 1;
1152 unsigned TRISA5 : 1;
1153 unsigned TRISA6 : 1;
1154 unsigned : 1;
1157 struct
1159 unsigned RA0 : 1;
1160 unsigned RA1 : 1;
1161 unsigned RA2 : 1;
1162 unsigned RA3 : 1;
1163 unsigned RA4 : 1;
1164 unsigned RA5 : 1;
1165 unsigned RA6 : 1;
1166 unsigned : 1;
1169 struct
1171 unsigned RA : 7;
1172 unsigned : 1;
1175 struct
1177 unsigned TRISA : 7;
1178 unsigned : 1;
1180 } __DDRAbits_t;
1182 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1184 #define _TRISA0 0x01
1185 #define _RA0 0x01
1186 #define _TRISA1 0x02
1187 #define _RA1 0x02
1188 #define _TRISA2 0x04
1189 #define _RA2 0x04
1190 #define _TRISA3 0x08
1191 #define _RA3 0x08
1192 #define _TRISA4 0x10
1193 #define _RA4 0x10
1194 #define _TRISA5 0x20
1195 #define _RA5 0x20
1196 #define _TRISA6 0x40
1197 #define _RA6 0x40
1199 //==============================================================================
1202 //==============================================================================
1203 // TRISA Bits
1205 extern __at(0x0F92) __sfr TRISA;
1207 typedef union
1209 struct
1211 unsigned TRISA0 : 1;
1212 unsigned TRISA1 : 1;
1213 unsigned TRISA2 : 1;
1214 unsigned TRISA3 : 1;
1215 unsigned TRISA4 : 1;
1216 unsigned TRISA5 : 1;
1217 unsigned TRISA6 : 1;
1218 unsigned : 1;
1221 struct
1223 unsigned RA0 : 1;
1224 unsigned RA1 : 1;
1225 unsigned RA2 : 1;
1226 unsigned RA3 : 1;
1227 unsigned RA4 : 1;
1228 unsigned RA5 : 1;
1229 unsigned RA6 : 1;
1230 unsigned : 1;
1233 struct
1235 unsigned RA : 7;
1236 unsigned : 1;
1239 struct
1241 unsigned TRISA : 7;
1242 unsigned : 1;
1244 } __TRISAbits_t;
1246 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1248 #define _TRISA_TRISA0 0x01
1249 #define _TRISA_RA0 0x01
1250 #define _TRISA_TRISA1 0x02
1251 #define _TRISA_RA1 0x02
1252 #define _TRISA_TRISA2 0x04
1253 #define _TRISA_RA2 0x04
1254 #define _TRISA_TRISA3 0x08
1255 #define _TRISA_RA3 0x08
1256 #define _TRISA_TRISA4 0x10
1257 #define _TRISA_RA4 0x10
1258 #define _TRISA_TRISA5 0x20
1259 #define _TRISA_RA5 0x20
1260 #define _TRISA_TRISA6 0x40
1261 #define _TRISA_RA6 0x40
1263 //==============================================================================
1266 //==============================================================================
1267 // DDRB Bits
1269 extern __at(0x0F93) __sfr DDRB;
1271 typedef union
1273 struct
1275 unsigned TRISB0 : 1;
1276 unsigned TRISB1 : 1;
1277 unsigned TRISB2 : 1;
1278 unsigned TRISB3 : 1;
1279 unsigned TRISB4 : 1;
1280 unsigned TRISB5 : 1;
1281 unsigned TRISB6 : 1;
1282 unsigned TRISB7 : 1;
1285 struct
1287 unsigned RB0 : 1;
1288 unsigned RB1 : 1;
1289 unsigned RB2 : 1;
1290 unsigned RB3 : 1;
1291 unsigned RB4 : 1;
1292 unsigned RB5 : 1;
1293 unsigned RB6 : 1;
1294 unsigned RB7 : 1;
1296 } __DDRBbits_t;
1298 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1300 #define _TRISB0 0x01
1301 #define _RB0 0x01
1302 #define _TRISB1 0x02
1303 #define _RB1 0x02
1304 #define _TRISB2 0x04
1305 #define _RB2 0x04
1306 #define _TRISB3 0x08
1307 #define _RB3 0x08
1308 #define _TRISB4 0x10
1309 #define _RB4 0x10
1310 #define _TRISB5 0x20
1311 #define _RB5 0x20
1312 #define _TRISB6 0x40
1313 #define _RB6 0x40
1314 #define _TRISB7 0x80
1315 #define _RB7 0x80
1317 //==============================================================================
1320 //==============================================================================
1321 // TRISB Bits
1323 extern __at(0x0F93) __sfr TRISB;
1325 typedef union
1327 struct
1329 unsigned TRISB0 : 1;
1330 unsigned TRISB1 : 1;
1331 unsigned TRISB2 : 1;
1332 unsigned TRISB3 : 1;
1333 unsigned TRISB4 : 1;
1334 unsigned TRISB5 : 1;
1335 unsigned TRISB6 : 1;
1336 unsigned TRISB7 : 1;
1339 struct
1341 unsigned RB0 : 1;
1342 unsigned RB1 : 1;
1343 unsigned RB2 : 1;
1344 unsigned RB3 : 1;
1345 unsigned RB4 : 1;
1346 unsigned RB5 : 1;
1347 unsigned RB6 : 1;
1348 unsigned RB7 : 1;
1350 } __TRISBbits_t;
1352 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1354 #define _TRISB_TRISB0 0x01
1355 #define _TRISB_RB0 0x01
1356 #define _TRISB_TRISB1 0x02
1357 #define _TRISB_RB1 0x02
1358 #define _TRISB_TRISB2 0x04
1359 #define _TRISB_RB2 0x04
1360 #define _TRISB_TRISB3 0x08
1361 #define _TRISB_RB3 0x08
1362 #define _TRISB_TRISB4 0x10
1363 #define _TRISB_RB4 0x10
1364 #define _TRISB_TRISB5 0x20
1365 #define _TRISB_RB5 0x20
1366 #define _TRISB_TRISB6 0x40
1367 #define _TRISB_RB6 0x40
1368 #define _TRISB_TRISB7 0x80
1369 #define _TRISB_RB7 0x80
1371 //==============================================================================
1374 //==============================================================================
1375 // DDRC Bits
1377 extern __at(0x0F94) __sfr DDRC;
1379 typedef union
1381 struct
1383 unsigned TRISC0 : 1;
1384 unsigned TRISC1 : 1;
1385 unsigned TRISC2 : 1;
1386 unsigned : 1;
1387 unsigned : 1;
1388 unsigned : 1;
1389 unsigned TRISC6 : 1;
1390 unsigned TRISC7 : 1;
1393 struct
1395 unsigned RC0 : 1;
1396 unsigned RC1 : 1;
1397 unsigned RC2 : 1;
1398 unsigned : 1;
1399 unsigned : 1;
1400 unsigned : 1;
1401 unsigned RC6 : 1;
1402 unsigned RC7 : 1;
1404 } __DDRCbits_t;
1406 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1408 #define _TRISC0 0x01
1409 #define _RC0 0x01
1410 #define _TRISC1 0x02
1411 #define _RC1 0x02
1412 #define _TRISC2 0x04
1413 #define _RC2 0x04
1414 #define _TRISC6 0x40
1415 #define _RC6 0x40
1416 #define _TRISC7 0x80
1417 #define _RC7 0x80
1419 //==============================================================================
1422 //==============================================================================
1423 // TRISC Bits
1425 extern __at(0x0F94) __sfr TRISC;
1427 typedef union
1429 struct
1431 unsigned TRISC0 : 1;
1432 unsigned TRISC1 : 1;
1433 unsigned TRISC2 : 1;
1434 unsigned : 1;
1435 unsigned : 1;
1436 unsigned : 1;
1437 unsigned TRISC6 : 1;
1438 unsigned TRISC7 : 1;
1441 struct
1443 unsigned RC0 : 1;
1444 unsigned RC1 : 1;
1445 unsigned RC2 : 1;
1446 unsigned : 1;
1447 unsigned : 1;
1448 unsigned : 1;
1449 unsigned RC6 : 1;
1450 unsigned RC7 : 1;
1452 } __TRISCbits_t;
1454 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1456 #define _TRISC_TRISC0 0x01
1457 #define _TRISC_RC0 0x01
1458 #define _TRISC_TRISC1 0x02
1459 #define _TRISC_RC1 0x02
1460 #define _TRISC_TRISC2 0x04
1461 #define _TRISC_RC2 0x04
1462 #define _TRISC_TRISC6 0x40
1463 #define _TRISC_RC6 0x40
1464 #define _TRISC_TRISC7 0x80
1465 #define _TRISC_RC7 0x80
1467 //==============================================================================
1470 //==============================================================================
1471 // OSCTUNE Bits
1473 extern __at(0x0F9B) __sfr OSCTUNE;
1475 typedef union
1477 struct
1479 unsigned TUN0 : 1;
1480 unsigned TUN1 : 1;
1481 unsigned TUN2 : 1;
1482 unsigned TUN3 : 1;
1483 unsigned TUN4 : 1;
1484 unsigned : 1;
1485 unsigned : 1;
1486 unsigned INTSRC : 1;
1489 struct
1491 unsigned TUN : 5;
1492 unsigned : 3;
1494 } __OSCTUNEbits_t;
1496 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
1498 #define _TUN0 0x01
1499 #define _TUN1 0x02
1500 #define _TUN2 0x04
1501 #define _TUN3 0x08
1502 #define _TUN4 0x10
1503 #define _INTSRC 0x80
1505 //==============================================================================
1508 //==============================================================================
1509 // PIE1 Bits
1511 extern __at(0x0F9D) __sfr PIE1;
1513 typedef struct
1515 unsigned TMR1IE : 1;
1516 unsigned TMR2IE : 1;
1517 unsigned CCP1IE : 1;
1518 unsigned SSPIE : 1;
1519 unsigned TXIE : 1;
1520 unsigned RCIE : 1;
1521 unsigned ADIE : 1;
1522 unsigned : 1;
1523 } __PIE1bits_t;
1525 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1527 #define _TMR1IE 0x01
1528 #define _TMR2IE 0x02
1529 #define _CCP1IE 0x04
1530 #define _SSPIE 0x08
1531 #define _TXIE 0x10
1532 #define _RCIE 0x20
1533 #define _ADIE 0x40
1535 //==============================================================================
1538 //==============================================================================
1539 // PIR1 Bits
1541 extern __at(0x0F9E) __sfr PIR1;
1543 typedef struct
1545 unsigned TMR1IF : 1;
1546 unsigned TMR2IF : 1;
1547 unsigned CCP1IF : 1;
1548 unsigned SSPIF : 1;
1549 unsigned TXIF : 1;
1550 unsigned RCIF : 1;
1551 unsigned ADIF : 1;
1552 unsigned : 1;
1553 } __PIR1bits_t;
1555 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1557 #define _TMR1IF 0x01
1558 #define _TMR2IF 0x02
1559 #define _CCP1IF 0x04
1560 #define _SSPIF 0x08
1561 #define _TXIF 0x10
1562 #define _RCIF 0x20
1563 #define _ADIF 0x40
1565 //==============================================================================
1568 //==============================================================================
1569 // IPR1 Bits
1571 extern __at(0x0F9F) __sfr IPR1;
1573 typedef struct
1575 unsigned TMR1IP : 1;
1576 unsigned TMR2IP : 1;
1577 unsigned CCP1IP : 1;
1578 unsigned SSPIP : 1;
1579 unsigned TXIP : 1;
1580 unsigned RCIP : 1;
1581 unsigned ADIP : 1;
1582 unsigned : 1;
1583 } __IPR1bits_t;
1585 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
1587 #define _TMR1IP 0x01
1588 #define _TMR2IP 0x02
1589 #define _CCP1IP 0x04
1590 #define _SSPIP 0x08
1591 #define _TXIP 0x10
1592 #define _RCIP 0x20
1593 #define _ADIP 0x40
1595 //==============================================================================
1598 //==============================================================================
1599 // PIE2 Bits
1601 extern __at(0x0FA0) __sfr PIE2;
1603 typedef union
1605 struct
1607 unsigned CCP2IE : 1;
1608 unsigned TMR3IE : 1;
1609 unsigned HLVDIE : 1;
1610 unsigned BCLIE : 1;
1611 unsigned EEIE : 1;
1612 unsigned USBIE : 1;
1613 unsigned CMIE : 1;
1614 unsigned OSCFIE : 1;
1617 struct
1619 unsigned : 1;
1620 unsigned : 1;
1621 unsigned LVDIE : 1;
1622 unsigned : 1;
1623 unsigned : 1;
1624 unsigned : 1;
1625 unsigned : 1;
1626 unsigned : 1;
1628 } __PIE2bits_t;
1630 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
1632 #define _CCP2IE 0x01
1633 #define _TMR3IE 0x02
1634 #define _HLVDIE 0x04
1635 #define _LVDIE 0x04
1636 #define _BCLIE 0x08
1637 #define _EEIE 0x10
1638 #define _USBIE 0x20
1639 #define _CMIE 0x40
1640 #define _OSCFIE 0x80
1642 //==============================================================================
1645 //==============================================================================
1646 // PIR2 Bits
1648 extern __at(0x0FA1) __sfr PIR2;
1650 typedef union
1652 struct
1654 unsigned CCP2IF : 1;
1655 unsigned TMR3IF : 1;
1656 unsigned HLVDIF : 1;
1657 unsigned BCLIF : 1;
1658 unsigned EEIF : 1;
1659 unsigned USBIF : 1;
1660 unsigned CMIF : 1;
1661 unsigned OSCFIF : 1;
1664 struct
1666 unsigned : 1;
1667 unsigned : 1;
1668 unsigned LVDIF : 1;
1669 unsigned : 1;
1670 unsigned : 1;
1671 unsigned : 1;
1672 unsigned : 1;
1673 unsigned : 1;
1675 } __PIR2bits_t;
1677 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
1679 #define _CCP2IF 0x01
1680 #define _TMR3IF 0x02
1681 #define _HLVDIF 0x04
1682 #define _LVDIF 0x04
1683 #define _BCLIF 0x08
1684 #define _EEIF 0x10
1685 #define _USBIF 0x20
1686 #define _CMIF 0x40
1687 #define _OSCFIF 0x80
1689 //==============================================================================
1692 //==============================================================================
1693 // IPR2 Bits
1695 extern __at(0x0FA2) __sfr IPR2;
1697 typedef union
1699 struct
1701 unsigned CCP2IP : 1;
1702 unsigned TMR3IP : 1;
1703 unsigned HLVDIP : 1;
1704 unsigned BCLIP : 1;
1705 unsigned EEIP : 1;
1706 unsigned USBIP : 1;
1707 unsigned CMIP : 1;
1708 unsigned OSCFIP : 1;
1711 struct
1713 unsigned : 1;
1714 unsigned : 1;
1715 unsigned LVDIP : 1;
1716 unsigned : 1;
1717 unsigned : 1;
1718 unsigned : 1;
1719 unsigned : 1;
1720 unsigned : 1;
1722 } __IPR2bits_t;
1724 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
1726 #define _CCP2IP 0x01
1727 #define _TMR3IP 0x02
1728 #define _HLVDIP 0x04
1729 #define _LVDIP 0x04
1730 #define _BCLIP 0x08
1731 #define _EEIP 0x10
1732 #define _USBIP 0x20
1733 #define _CMIP 0x40
1734 #define _OSCFIP 0x80
1736 //==============================================================================
1739 //==============================================================================
1740 // EECON1 Bits
1742 extern __at(0x0FA6) __sfr EECON1;
1744 typedef struct
1746 unsigned RD : 1;
1747 unsigned WR : 1;
1748 unsigned WREN : 1;
1749 unsigned WRERR : 1;
1750 unsigned FREE : 1;
1751 unsigned : 1;
1752 unsigned CFGS : 1;
1753 unsigned EEPGD : 1;
1754 } __EECON1bits_t;
1756 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
1758 #define _RD 0x01
1759 #define _WR 0x02
1760 #define _WREN 0x04
1761 #define _WRERR 0x08
1762 #define _FREE 0x10
1763 #define _CFGS 0x40
1764 #define _EEPGD 0x80
1766 //==============================================================================
1768 extern __at(0x0FA7) __sfr EECON2;
1769 extern __at(0x0FA8) __sfr EEDATA;
1770 extern __at(0x0FA9) __sfr EEADR;
1772 //==============================================================================
1773 // RCSTA Bits
1775 extern __at(0x0FAB) __sfr RCSTA;
1777 typedef union
1779 struct
1781 unsigned RX9D : 1;
1782 unsigned OERR : 1;
1783 unsigned FERR : 1;
1784 unsigned ADDEN : 1;
1785 unsigned CREN : 1;
1786 unsigned SREN : 1;
1787 unsigned RX9 : 1;
1788 unsigned SPEN : 1;
1791 struct
1793 unsigned : 1;
1794 unsigned : 1;
1795 unsigned : 1;
1796 unsigned ADEN : 1;
1797 unsigned : 1;
1798 unsigned : 1;
1799 unsigned : 1;
1800 unsigned : 1;
1802 } __RCSTAbits_t;
1804 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
1806 #define _RX9D 0x01
1807 #define _OERR 0x02
1808 #define _FERR 0x04
1809 #define _ADDEN 0x08
1810 #define _ADEN 0x08
1811 #define _CREN 0x10
1812 #define _SREN 0x20
1813 #define _RX9 0x40
1814 #define _SPEN 0x80
1816 //==============================================================================
1819 //==============================================================================
1820 // TXSTA Bits
1822 extern __at(0x0FAC) __sfr TXSTA;
1824 typedef struct
1826 unsigned TX9D : 1;
1827 unsigned TRMT : 1;
1828 unsigned BRGH : 1;
1829 unsigned SENDB : 1;
1830 unsigned SYNC : 1;
1831 unsigned TXEN : 1;
1832 unsigned TX9 : 1;
1833 unsigned CSRC : 1;
1834 } __TXSTAbits_t;
1836 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
1838 #define _TX9D 0x01
1839 #define _TRMT 0x02
1840 #define _BRGH 0x04
1841 #define _SENDB 0x08
1842 #define _SYNC 0x10
1843 #define _TXEN 0x20
1844 #define _TX9 0x40
1845 #define _CSRC 0x80
1847 //==============================================================================
1849 extern __at(0x0FAD) __sfr TXREG;
1850 extern __at(0x0FAE) __sfr RCREG;
1851 extern __at(0x0FAF) __sfr SPBRG;
1852 extern __at(0x0FB0) __sfr SPBRGH;
1854 //==============================================================================
1855 // T3CON Bits
1857 extern __at(0x0FB1) __sfr T3CON;
1859 typedef union
1861 struct
1863 unsigned TMR3ON : 1;
1864 unsigned TMR3CS : 1;
1865 unsigned NOT_T3SYNC : 1;
1866 unsigned T3CCP1 : 1;
1867 unsigned T3CKPS0 : 1;
1868 unsigned T3CKPS1 : 1;
1869 unsigned T3CCP2 : 1;
1870 unsigned RD16 : 1;
1873 struct
1875 unsigned : 1;
1876 unsigned : 1;
1877 unsigned T3SYNC : 1;
1878 unsigned : 1;
1879 unsigned : 1;
1880 unsigned : 1;
1881 unsigned : 1;
1882 unsigned : 1;
1885 struct
1887 unsigned : 1;
1888 unsigned : 1;
1889 unsigned T3NSYNC : 1;
1890 unsigned : 1;
1891 unsigned : 1;
1892 unsigned : 1;
1893 unsigned : 1;
1894 unsigned : 1;
1897 struct
1899 unsigned : 4;
1900 unsigned T3CKPS : 2;
1901 unsigned : 2;
1903 } __T3CONbits_t;
1905 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
1907 #define _T3CON_TMR3ON 0x01
1908 #define _T3CON_TMR3CS 0x02
1909 #define _T3CON_NOT_T3SYNC 0x04
1910 #define _T3CON_T3SYNC 0x04
1911 #define _T3CON_T3NSYNC 0x04
1912 #define _T3CON_T3CCP1 0x08
1913 #define _T3CON_T3CKPS0 0x10
1914 #define _T3CON_T3CKPS1 0x20
1915 #define _T3CON_T3CCP2 0x40
1916 #define _T3CON_RD16 0x80
1918 //==============================================================================
1920 extern __at(0x0FB2) __sfr TMR3;
1921 extern __at(0x0FB2) __sfr TMR3L;
1922 extern __at(0x0FB3) __sfr TMR3H;
1924 //==============================================================================
1925 // CMCON Bits
1927 extern __at(0x0FB4) __sfr CMCON;
1929 typedef union
1931 struct
1933 unsigned CM0 : 1;
1934 unsigned CM1 : 1;
1935 unsigned CM2 : 1;
1936 unsigned CIS : 1;
1937 unsigned C1INV : 1;
1938 unsigned C2INV : 1;
1939 unsigned C1OUT : 1;
1940 unsigned C2OUT : 1;
1943 struct
1945 unsigned CM : 3;
1946 unsigned : 5;
1948 } __CMCONbits_t;
1950 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
1952 #define _CM0 0x01
1953 #define _CM1 0x02
1954 #define _CM2 0x04
1955 #define _CIS 0x08
1956 #define _C1INV 0x10
1957 #define _C2INV 0x20
1958 #define _C1OUT 0x40
1959 #define _C2OUT 0x80
1961 //==============================================================================
1964 //==============================================================================
1965 // CVRCON Bits
1967 extern __at(0x0FB5) __sfr CVRCON;
1969 typedef union
1971 struct
1973 unsigned CVR0 : 1;
1974 unsigned CVR1 : 1;
1975 unsigned CVR2 : 1;
1976 unsigned CVR3 : 1;
1977 unsigned CVRSS : 1;
1978 unsigned CVRR : 1;
1979 unsigned CVROE : 1;
1980 unsigned CVREN : 1;
1983 struct
1985 unsigned : 1;
1986 unsigned : 1;
1987 unsigned : 1;
1988 unsigned : 1;
1989 unsigned CVREF : 1;
1990 unsigned : 1;
1991 unsigned : 1;
1992 unsigned : 1;
1995 struct
1997 unsigned CVR : 4;
1998 unsigned : 4;
2000 } __CVRCONbits_t;
2002 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
2004 #define _CVR0 0x01
2005 #define _CVR1 0x02
2006 #define _CVR2 0x04
2007 #define _CVR3 0x08
2008 #define _CVRSS 0x10
2009 #define _CVREF 0x10
2010 #define _CVRR 0x20
2011 #define _CVROE 0x40
2012 #define _CVREN 0x80
2014 //==============================================================================
2017 //==============================================================================
2018 // CCP1AS Bits
2020 extern __at(0x0FB6) __sfr CCP1AS;
2022 typedef union
2024 struct
2026 unsigned : 1;
2027 unsigned : 1;
2028 unsigned PSSAC0 : 1;
2029 unsigned PSSAC1 : 1;
2030 unsigned ECCPAS0 : 1;
2031 unsigned ECCPAS1 : 1;
2032 unsigned ECCPAS2 : 1;
2033 unsigned ECCPASE : 1;
2036 struct
2038 unsigned : 2;
2039 unsigned PSSAC : 2;
2040 unsigned : 4;
2043 struct
2045 unsigned : 4;
2046 unsigned ECCPAS : 3;
2047 unsigned : 1;
2049 } __CCP1ASbits_t;
2051 extern __at(0x0FB6) volatile __CCP1ASbits_t CCP1ASbits;
2053 #define _PSSAC0 0x04
2054 #define _PSSAC1 0x08
2055 #define _ECCPAS0 0x10
2056 #define _ECCPAS1 0x20
2057 #define _ECCPAS2 0x40
2058 #define _ECCPASE 0x80
2060 //==============================================================================
2063 //==============================================================================
2064 // ECCP1AS Bits
2066 extern __at(0x0FB6) __sfr ECCP1AS;
2068 typedef union
2070 struct
2072 unsigned : 1;
2073 unsigned : 1;
2074 unsigned PSSAC0 : 1;
2075 unsigned PSSAC1 : 1;
2076 unsigned ECCPAS0 : 1;
2077 unsigned ECCPAS1 : 1;
2078 unsigned ECCPAS2 : 1;
2079 unsigned ECCPASE : 1;
2082 struct
2084 unsigned : 2;
2085 unsigned PSSAC : 2;
2086 unsigned : 4;
2089 struct
2091 unsigned : 4;
2092 unsigned ECCPAS : 3;
2093 unsigned : 1;
2095 } __ECCP1ASbits_t;
2097 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
2099 #define _ECCP1AS_PSSAC0 0x04
2100 #define _ECCP1AS_PSSAC1 0x08
2101 #define _ECCP1AS_ECCPAS0 0x10
2102 #define _ECCP1AS_ECCPAS1 0x20
2103 #define _ECCP1AS_ECCPAS2 0x40
2104 #define _ECCP1AS_ECCPASE 0x80
2106 //==============================================================================
2109 //==============================================================================
2110 // CCP1DEL Bits
2112 extern __at(0x0FB7) __sfr CCP1DEL;
2114 typedef struct
2116 unsigned : 1;
2117 unsigned : 1;
2118 unsigned : 1;
2119 unsigned : 1;
2120 unsigned : 1;
2121 unsigned : 1;
2122 unsigned : 1;
2123 unsigned PRSEN : 1;
2124 } __CCP1DELbits_t;
2126 extern __at(0x0FB7) volatile __CCP1DELbits_t CCP1DELbits;
2128 #define _PRSEN 0x80
2130 //==============================================================================
2133 //==============================================================================
2134 // ECCP1DEL Bits
2136 extern __at(0x0FB7) __sfr ECCP1DEL;
2138 typedef struct
2140 unsigned : 1;
2141 unsigned : 1;
2142 unsigned : 1;
2143 unsigned : 1;
2144 unsigned : 1;
2145 unsigned : 1;
2146 unsigned : 1;
2147 unsigned PRSEN : 1;
2148 } __ECCP1DELbits_t;
2150 extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits;
2152 #define _ECCP1DEL_PRSEN 0x80
2154 //==============================================================================
2157 //==============================================================================
2158 // BAUDCON Bits
2160 extern __at(0x0FB8) __sfr BAUDCON;
2162 typedef union
2164 struct
2166 unsigned ABDEN : 1;
2167 unsigned WUE : 1;
2168 unsigned : 1;
2169 unsigned BRG16 : 1;
2170 unsigned TXCKP : 1;
2171 unsigned RXDTP : 1;
2172 unsigned RCIDL : 1;
2173 unsigned ABDOVF : 1;
2176 struct
2178 unsigned : 1;
2179 unsigned : 1;
2180 unsigned : 1;
2181 unsigned : 1;
2182 unsigned SCKP : 1;
2183 unsigned : 1;
2184 unsigned RCMT : 1;
2185 unsigned : 1;
2187 } __BAUDCONbits_t;
2189 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
2191 #define _ABDEN 0x01
2192 #define _WUE 0x02
2193 #define _BRG16 0x08
2194 #define _TXCKP 0x10
2195 #define _SCKP 0x10
2196 #define _RXDTP 0x20
2197 #define _RCIDL 0x40
2198 #define _RCMT 0x40
2199 #define _ABDOVF 0x80
2201 //==============================================================================
2204 //==============================================================================
2205 // BAUDCTL Bits
2207 extern __at(0x0FB8) __sfr BAUDCTL;
2209 typedef union
2211 struct
2213 unsigned ABDEN : 1;
2214 unsigned WUE : 1;
2215 unsigned : 1;
2216 unsigned BRG16 : 1;
2217 unsigned TXCKP : 1;
2218 unsigned RXDTP : 1;
2219 unsigned RCIDL : 1;
2220 unsigned ABDOVF : 1;
2223 struct
2225 unsigned : 1;
2226 unsigned : 1;
2227 unsigned : 1;
2228 unsigned : 1;
2229 unsigned SCKP : 1;
2230 unsigned : 1;
2231 unsigned RCMT : 1;
2232 unsigned : 1;
2234 } __BAUDCTLbits_t;
2236 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
2238 #define _BAUDCTL_ABDEN 0x01
2239 #define _BAUDCTL_WUE 0x02
2240 #define _BAUDCTL_BRG16 0x08
2241 #define _BAUDCTL_TXCKP 0x10
2242 #define _BAUDCTL_SCKP 0x10
2243 #define _BAUDCTL_RXDTP 0x20
2244 #define _BAUDCTL_RCIDL 0x40
2245 #define _BAUDCTL_RCMT 0x40
2246 #define _BAUDCTL_ABDOVF 0x80
2248 //==============================================================================
2251 //==============================================================================
2252 // CCP2CON Bits
2254 extern __at(0x0FBA) __sfr CCP2CON;
2256 typedef union
2258 struct
2260 unsigned CCP2M0 : 1;
2261 unsigned CCP2M1 : 1;
2262 unsigned CCP2M2 : 1;
2263 unsigned CCP2M3 : 1;
2264 unsigned DC2B0 : 1;
2265 unsigned DC2B1 : 1;
2266 unsigned : 1;
2267 unsigned : 1;
2270 struct
2272 unsigned CCP2M : 4;
2273 unsigned : 4;
2276 struct
2278 unsigned : 4;
2279 unsigned DC2B : 2;
2280 unsigned : 2;
2282 } __CCP2CONbits_t;
2284 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
2286 #define _CCP2M0 0x01
2287 #define _CCP2M1 0x02
2288 #define _CCP2M2 0x04
2289 #define _CCP2M3 0x08
2290 #define _DC2B0 0x10
2291 #define _DC2B1 0x20
2293 //==============================================================================
2295 extern __at(0x0FBB) __sfr CCPR2;
2296 extern __at(0x0FBB) __sfr CCPR2L;
2297 extern __at(0x0FBC) __sfr CCPR2H;
2299 //==============================================================================
2300 // CCP1CON Bits
2302 extern __at(0x0FBD) __sfr CCP1CON;
2304 typedef union
2306 struct
2308 unsigned CCP1M0 : 1;
2309 unsigned CCP1M1 : 1;
2310 unsigned CCP1M2 : 1;
2311 unsigned CCP1M3 : 1;
2312 unsigned DC1B0 : 1;
2313 unsigned DC1B1 : 1;
2314 unsigned : 1;
2315 unsigned : 1;
2318 struct
2320 unsigned CCP1M : 4;
2321 unsigned : 4;
2324 struct
2326 unsigned : 4;
2327 unsigned DC1B : 2;
2328 unsigned : 2;
2330 } __CCP1CONbits_t;
2332 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
2334 #define _CCP1M0 0x01
2335 #define _CCP1M1 0x02
2336 #define _CCP1M2 0x04
2337 #define _CCP1M3 0x08
2338 #define _DC1B0 0x10
2339 #define _DC1B1 0x20
2341 //==============================================================================
2343 extern __at(0x0FBE) __sfr CCPR1;
2344 extern __at(0x0FBE) __sfr CCPR1L;
2345 extern __at(0x0FBF) __sfr CCPR1H;
2347 //==============================================================================
2348 // ADCON2 Bits
2350 extern __at(0x0FC0) __sfr ADCON2;
2352 typedef union
2354 struct
2356 unsigned ADCS0 : 1;
2357 unsigned ADCS1 : 1;
2358 unsigned ADCS2 : 1;
2359 unsigned ACQT0 : 1;
2360 unsigned ACQT1 : 1;
2361 unsigned ACQT2 : 1;
2362 unsigned : 1;
2363 unsigned ADFM : 1;
2366 struct
2368 unsigned ADCS : 3;
2369 unsigned : 5;
2372 struct
2374 unsigned : 3;
2375 unsigned ACQT : 3;
2376 unsigned : 2;
2378 } __ADCON2bits_t;
2380 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
2382 #define _ADCS0 0x01
2383 #define _ADCS1 0x02
2384 #define _ADCS2 0x04
2385 #define _ACQT0 0x08
2386 #define _ACQT1 0x10
2387 #define _ACQT2 0x20
2388 #define _ADFM 0x80
2390 //==============================================================================
2393 //==============================================================================
2394 // ADCON1 Bits
2396 extern __at(0x0FC1) __sfr ADCON1;
2398 typedef union
2400 struct
2402 unsigned PCFG0 : 1;
2403 unsigned PCFG1 : 1;
2404 unsigned PCFG2 : 1;
2405 unsigned PCFG3 : 1;
2406 unsigned VCFG0 : 1;
2407 unsigned VCFG1 : 1;
2408 unsigned : 1;
2409 unsigned : 1;
2412 struct
2414 unsigned PCFG : 4;
2415 unsigned : 4;
2418 struct
2420 unsigned : 4;
2421 unsigned VCFG : 2;
2422 unsigned : 2;
2424 } __ADCON1bits_t;
2426 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
2428 #define _PCFG0 0x01
2429 #define _PCFG1 0x02
2430 #define _PCFG2 0x04
2431 #define _PCFG3 0x08
2432 #define _VCFG0 0x10
2433 #define _VCFG1 0x20
2435 //==============================================================================
2438 //==============================================================================
2439 // ADCON0 Bits
2441 extern __at(0x0FC2) __sfr ADCON0;
2443 typedef union
2445 struct
2447 unsigned ADON : 1;
2448 unsigned GO_NOT_DONE : 1;
2449 unsigned CHS0 : 1;
2450 unsigned CHS1 : 1;
2451 unsigned CHS2 : 1;
2452 unsigned CHS3 : 1;
2453 unsigned : 1;
2454 unsigned : 1;
2457 struct
2459 unsigned : 1;
2460 unsigned GO_DONE : 1;
2461 unsigned : 1;
2462 unsigned : 1;
2463 unsigned : 1;
2464 unsigned : 1;
2465 unsigned : 1;
2466 unsigned : 1;
2469 struct
2471 unsigned : 1;
2472 unsigned DONE : 1;
2473 unsigned : 1;
2474 unsigned : 1;
2475 unsigned : 1;
2476 unsigned : 1;
2477 unsigned : 1;
2478 unsigned : 1;
2481 struct
2483 unsigned : 1;
2484 unsigned GO : 1;
2485 unsigned : 1;
2486 unsigned : 1;
2487 unsigned : 1;
2488 unsigned : 1;
2489 unsigned : 1;
2490 unsigned : 1;
2493 struct
2495 unsigned : 1;
2496 unsigned NOT_DONE : 1;
2497 unsigned : 1;
2498 unsigned : 1;
2499 unsigned : 1;
2500 unsigned : 1;
2501 unsigned : 1;
2502 unsigned : 1;
2505 struct
2507 unsigned : 2;
2508 unsigned CHS : 4;
2509 unsigned : 2;
2511 } __ADCON0bits_t;
2513 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
2515 #define _ADON 0x01
2516 #define _GO_NOT_DONE 0x02
2517 #define _GO_DONE 0x02
2518 #define _DONE 0x02
2519 #define _GO 0x02
2520 #define _NOT_DONE 0x02
2521 #define _CHS0 0x04
2522 #define _CHS1 0x08
2523 #define _CHS2 0x10
2524 #define _CHS3 0x20
2526 //==============================================================================
2528 extern __at(0x0FC3) __sfr ADRES;
2529 extern __at(0x0FC3) __sfr ADRESL;
2530 extern __at(0x0FC4) __sfr ADRESH;
2532 //==============================================================================
2533 // SSPCON2 Bits
2535 extern __at(0x0FC5) __sfr SSPCON2;
2537 typedef struct
2539 unsigned SEN : 1;
2540 unsigned RSEN : 1;
2541 unsigned PEN : 1;
2542 unsigned RCEN : 1;
2543 unsigned ACKEN : 1;
2544 unsigned ACKDT : 1;
2545 unsigned ACKSTAT : 1;
2546 unsigned GCEN : 1;
2547 } __SSPCON2bits_t;
2549 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
2551 #define _SEN 0x01
2552 #define _RSEN 0x02
2553 #define _PEN 0x04
2554 #define _RCEN 0x08
2555 #define _ACKEN 0x10
2556 #define _ACKDT 0x20
2557 #define _ACKSTAT 0x40
2558 #define _GCEN 0x80
2560 //==============================================================================
2563 //==============================================================================
2564 // SSPCON1 Bits
2566 extern __at(0x0FC6) __sfr SSPCON1;
2568 typedef union
2570 struct
2572 unsigned SSPM0 : 1;
2573 unsigned SSPM1 : 1;
2574 unsigned SSPM2 : 1;
2575 unsigned SSPM3 : 1;
2576 unsigned CKP : 1;
2577 unsigned SSPEN : 1;
2578 unsigned SSPOV : 1;
2579 unsigned WCOL : 1;
2582 struct
2584 unsigned SSPM : 4;
2585 unsigned : 4;
2587 } __SSPCON1bits_t;
2589 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
2591 #define _SSPM0 0x01
2592 #define _SSPM1 0x02
2593 #define _SSPM2 0x04
2594 #define _SSPM3 0x08
2595 #define _CKP 0x10
2596 #define _SSPEN 0x20
2597 #define _SSPOV 0x40
2598 #define _WCOL 0x80
2600 //==============================================================================
2603 //==============================================================================
2604 // SSPSTAT Bits
2606 extern __at(0x0FC7) __sfr SSPSTAT;
2608 typedef union
2610 struct
2612 unsigned BF : 1;
2613 unsigned UA : 1;
2614 unsigned R_NOT_W : 1;
2615 unsigned S : 1;
2616 unsigned P : 1;
2617 unsigned D_NOT_A : 1;
2618 unsigned CKE : 1;
2619 unsigned SMP : 1;
2622 struct
2624 unsigned : 1;
2625 unsigned : 1;
2626 unsigned R_W : 1;
2627 unsigned I2C_START : 1;
2628 unsigned I2C_STOP : 1;
2629 unsigned D_A : 1;
2630 unsigned : 1;
2631 unsigned : 1;
2634 struct
2636 unsigned : 1;
2637 unsigned : 1;
2638 unsigned I2C_READ : 1;
2639 unsigned : 1;
2640 unsigned : 1;
2641 unsigned I2C_DAT : 1;
2642 unsigned : 1;
2643 unsigned : 1;
2646 struct
2648 unsigned : 1;
2649 unsigned : 1;
2650 unsigned NOT_W : 1;
2651 unsigned : 1;
2652 unsigned : 1;
2653 unsigned NOT_A : 1;
2654 unsigned : 1;
2655 unsigned : 1;
2658 struct
2660 unsigned : 1;
2661 unsigned : 1;
2662 unsigned NOT_WRITE : 1;
2663 unsigned : 1;
2664 unsigned : 1;
2665 unsigned NOT_ADDRESS : 1;
2666 unsigned : 1;
2667 unsigned : 1;
2670 struct
2672 unsigned : 1;
2673 unsigned : 1;
2674 unsigned READ_WRITE : 1;
2675 unsigned : 1;
2676 unsigned : 1;
2677 unsigned DATA_ADDRESS : 1;
2678 unsigned : 1;
2679 unsigned : 1;
2682 struct
2684 unsigned : 1;
2685 unsigned : 1;
2686 unsigned R : 1;
2687 unsigned : 1;
2688 unsigned : 1;
2689 unsigned D : 1;
2690 unsigned : 1;
2691 unsigned : 1;
2693 } __SSPSTATbits_t;
2695 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
2697 #define _BF 0x01
2698 #define _UA 0x02
2699 #define _R_NOT_W 0x04
2700 #define _R_W 0x04
2701 #define _I2C_READ 0x04
2702 #define _NOT_W 0x04
2703 #define _NOT_WRITE 0x04
2704 #define _READ_WRITE 0x04
2705 #define _R 0x04
2706 #define _S 0x08
2707 #define _I2C_START 0x08
2708 #define _P 0x10
2709 #define _I2C_STOP 0x10
2710 #define _D_NOT_A 0x20
2711 #define _D_A 0x20
2712 #define _I2C_DAT 0x20
2713 #define _NOT_A 0x20
2714 #define _NOT_ADDRESS 0x20
2715 #define _DATA_ADDRESS 0x20
2716 #define _D 0x20
2717 #define _CKE 0x40
2718 #define _SMP 0x80
2720 //==============================================================================
2722 extern __at(0x0FC8) __sfr SSPADD;
2723 extern __at(0x0FC9) __sfr SSPBUF;
2725 //==============================================================================
2726 // T2CON Bits
2728 extern __at(0x0FCA) __sfr T2CON;
2730 typedef union
2732 struct
2734 unsigned T2CKPS0 : 1;
2735 unsigned T2CKPS1 : 1;
2736 unsigned TMR2ON : 1;
2737 unsigned T2OUTPS0 : 1;
2738 unsigned T2OUTPS1 : 1;
2739 unsigned T2OUTPS2 : 1;
2740 unsigned T2OUTPS3 : 1;
2741 unsigned : 1;
2744 struct
2746 unsigned : 1;
2747 unsigned : 1;
2748 unsigned : 1;
2749 unsigned TOUTPS0 : 1;
2750 unsigned TOUTPS1 : 1;
2751 unsigned TOUTPS2 : 1;
2752 unsigned TOUTPS3 : 1;
2753 unsigned : 1;
2756 struct
2758 unsigned T2CKPS : 2;
2759 unsigned : 6;
2762 struct
2764 unsigned : 3;
2765 unsigned T2OUTPS : 4;
2766 unsigned : 1;
2769 struct
2771 unsigned : 3;
2772 unsigned TOUTPS : 4;
2773 unsigned : 1;
2775 } __T2CONbits_t;
2777 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
2779 #define _T2CKPS0 0x01
2780 #define _T2CKPS1 0x02
2781 #define _TMR2ON 0x04
2782 #define _T2OUTPS0 0x08
2783 #define _TOUTPS0 0x08
2784 #define _T2OUTPS1 0x10
2785 #define _TOUTPS1 0x10
2786 #define _T2OUTPS2 0x20
2787 #define _TOUTPS2 0x20
2788 #define _T2OUTPS3 0x40
2789 #define _TOUTPS3 0x40
2791 //==============================================================================
2793 extern __at(0x0FCB) __sfr PR2;
2794 extern __at(0x0FCC) __sfr TMR2;
2796 //==============================================================================
2797 // T1CON Bits
2799 extern __at(0x0FCD) __sfr T1CON;
2801 typedef union
2803 struct
2805 unsigned TMR1ON : 1;
2806 unsigned TMR1CS : 1;
2807 unsigned NOT_T1SYNC : 1;
2808 unsigned T1OSCEN : 1;
2809 unsigned T1CKPS0 : 1;
2810 unsigned T1CKPS1 : 1;
2811 unsigned T1RUN : 1;
2812 unsigned RD16 : 1;
2815 struct
2817 unsigned : 1;
2818 unsigned : 1;
2819 unsigned T1SYNC : 1;
2820 unsigned : 1;
2821 unsigned : 1;
2822 unsigned : 1;
2823 unsigned : 1;
2824 unsigned : 1;
2827 struct
2829 unsigned : 4;
2830 unsigned T1CKPS : 2;
2831 unsigned : 2;
2833 } __T1CONbits_t;
2835 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
2837 #define _TMR1ON 0x01
2838 #define _TMR1CS 0x02
2839 #define _NOT_T1SYNC 0x04
2840 #define _T1SYNC 0x04
2841 #define _T1OSCEN 0x08
2842 #define _T1CKPS0 0x10
2843 #define _T1CKPS1 0x20
2844 #define _T1RUN 0x40
2845 #define _RD16 0x80
2847 //==============================================================================
2849 extern __at(0x0FCE) __sfr TMR1;
2850 extern __at(0x0FCE) __sfr TMR1L;
2851 extern __at(0x0FCF) __sfr TMR1H;
2853 //==============================================================================
2854 // RCON Bits
2856 extern __at(0x0FD0) __sfr RCON;
2858 typedef union
2860 struct
2862 unsigned NOT_BOR : 1;
2863 unsigned NOT_POR : 1;
2864 unsigned NOT_PD : 1;
2865 unsigned NOT_TO : 1;
2866 unsigned NOT_RI : 1;
2867 unsigned : 1;
2868 unsigned SBOREN : 1;
2869 unsigned IPEN : 1;
2872 struct
2874 unsigned BOR : 1;
2875 unsigned POR : 1;
2876 unsigned PD : 1;
2877 unsigned TO : 1;
2878 unsigned RI : 1;
2879 unsigned : 1;
2880 unsigned : 1;
2881 unsigned NOT_IPEN : 1;
2883 } __RCONbits_t;
2885 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
2887 #define _NOT_BOR 0x01
2888 #define _BOR 0x01
2889 #define _NOT_POR 0x02
2890 #define _POR 0x02
2891 #define _NOT_PD 0x04
2892 #define _PD 0x04
2893 #define _NOT_TO 0x08
2894 #define _TO 0x08
2895 #define _NOT_RI 0x10
2896 #define _RI 0x10
2897 #define _SBOREN 0x40
2898 #define _IPEN 0x80
2899 #define _NOT_IPEN 0x80
2901 //==============================================================================
2904 //==============================================================================
2905 // WDTCON Bits
2907 extern __at(0x0FD1) __sfr WDTCON;
2909 typedef union
2911 struct
2913 unsigned SWDTEN : 1;
2914 unsigned : 1;
2915 unsigned : 1;
2916 unsigned : 1;
2917 unsigned : 1;
2918 unsigned : 1;
2919 unsigned : 1;
2920 unsigned : 1;
2923 struct
2925 unsigned SWDTE : 1;
2926 unsigned : 1;
2927 unsigned : 1;
2928 unsigned : 1;
2929 unsigned : 1;
2930 unsigned : 1;
2931 unsigned : 1;
2932 unsigned : 1;
2934 } __WDTCONbits_t;
2936 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
2938 #define _SWDTEN 0x01
2939 #define _SWDTE 0x01
2941 //==============================================================================
2944 //==============================================================================
2945 // HLVDCON Bits
2947 extern __at(0x0FD2) __sfr HLVDCON;
2949 typedef union
2951 struct
2953 unsigned HLVDL0 : 1;
2954 unsigned HLVDL1 : 1;
2955 unsigned HLVDL2 : 1;
2956 unsigned HLVDL3 : 1;
2957 unsigned HLVDEN : 1;
2958 unsigned IRVST : 1;
2959 unsigned : 1;
2960 unsigned VDIRMAG : 1;
2963 struct
2965 unsigned LVDL0 : 1;
2966 unsigned LVDL1 : 1;
2967 unsigned LVDL2 : 1;
2968 unsigned LVDL3 : 1;
2969 unsigned LVDEN : 1;
2970 unsigned IVRST : 1;
2971 unsigned : 1;
2972 unsigned : 1;
2975 struct
2977 unsigned LVV0 : 1;
2978 unsigned LVV1 : 1;
2979 unsigned LVV2 : 1;
2980 unsigned LVV3 : 1;
2981 unsigned : 1;
2982 unsigned BGST : 1;
2983 unsigned : 1;
2984 unsigned : 1;
2987 struct
2989 unsigned LVV : 4;
2990 unsigned : 4;
2993 struct
2995 unsigned HLVDL : 4;
2996 unsigned : 4;
2999 struct
3001 unsigned LVDL : 4;
3002 unsigned : 4;
3004 } __HLVDCONbits_t;
3006 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
3008 #define _HLVDL0 0x01
3009 #define _LVDL0 0x01
3010 #define _LVV0 0x01
3011 #define _HLVDL1 0x02
3012 #define _LVDL1 0x02
3013 #define _LVV1 0x02
3014 #define _HLVDL2 0x04
3015 #define _LVDL2 0x04
3016 #define _LVV2 0x04
3017 #define _HLVDL3 0x08
3018 #define _LVDL3 0x08
3019 #define _LVV3 0x08
3020 #define _HLVDEN 0x10
3021 #define _LVDEN 0x10
3022 #define _IRVST 0x20
3023 #define _IVRST 0x20
3024 #define _BGST 0x20
3025 #define _VDIRMAG 0x80
3027 //==============================================================================
3030 //==============================================================================
3031 // LVDCON Bits
3033 extern __at(0x0FD2) __sfr LVDCON;
3035 typedef union
3037 struct
3039 unsigned HLVDL0 : 1;
3040 unsigned HLVDL1 : 1;
3041 unsigned HLVDL2 : 1;
3042 unsigned HLVDL3 : 1;
3043 unsigned HLVDEN : 1;
3044 unsigned IRVST : 1;
3045 unsigned : 1;
3046 unsigned VDIRMAG : 1;
3049 struct
3051 unsigned LVDL0 : 1;
3052 unsigned LVDL1 : 1;
3053 unsigned LVDL2 : 1;
3054 unsigned LVDL3 : 1;
3055 unsigned LVDEN : 1;
3056 unsigned IVRST : 1;
3057 unsigned : 1;
3058 unsigned : 1;
3061 struct
3063 unsigned LVV0 : 1;
3064 unsigned LVV1 : 1;
3065 unsigned LVV2 : 1;
3066 unsigned LVV3 : 1;
3067 unsigned : 1;
3068 unsigned BGST : 1;
3069 unsigned : 1;
3070 unsigned : 1;
3073 struct
3075 unsigned LVDL : 4;
3076 unsigned : 4;
3079 struct
3081 unsigned HLVDL : 4;
3082 unsigned : 4;
3085 struct
3087 unsigned LVV : 4;
3088 unsigned : 4;
3090 } __LVDCONbits_t;
3092 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
3094 #define _LVDCON_HLVDL0 0x01
3095 #define _LVDCON_LVDL0 0x01
3096 #define _LVDCON_LVV0 0x01
3097 #define _LVDCON_HLVDL1 0x02
3098 #define _LVDCON_LVDL1 0x02
3099 #define _LVDCON_LVV1 0x02
3100 #define _LVDCON_HLVDL2 0x04
3101 #define _LVDCON_LVDL2 0x04
3102 #define _LVDCON_LVV2 0x04
3103 #define _LVDCON_HLVDL3 0x08
3104 #define _LVDCON_LVDL3 0x08
3105 #define _LVDCON_LVV3 0x08
3106 #define _LVDCON_HLVDEN 0x10
3107 #define _LVDCON_LVDEN 0x10
3108 #define _LVDCON_IRVST 0x20
3109 #define _LVDCON_IVRST 0x20
3110 #define _LVDCON_BGST 0x20
3111 #define _LVDCON_VDIRMAG 0x80
3113 //==============================================================================
3116 //==============================================================================
3117 // OSCCON Bits
3119 extern __at(0x0FD3) __sfr OSCCON;
3121 typedef union
3123 struct
3125 unsigned SCS0 : 1;
3126 unsigned SCS1 : 1;
3127 unsigned IOFS : 1;
3128 unsigned OSTS : 1;
3129 unsigned IRCF0 : 1;
3130 unsigned IRCF1 : 1;
3131 unsigned IRCF2 : 1;
3132 unsigned IDLEN : 1;
3135 struct
3137 unsigned : 1;
3138 unsigned : 1;
3139 unsigned FLTS : 1;
3140 unsigned : 1;
3141 unsigned : 1;
3142 unsigned : 1;
3143 unsigned : 1;
3144 unsigned : 1;
3147 struct
3149 unsigned SCS : 2;
3150 unsigned : 6;
3153 struct
3155 unsigned : 4;
3156 unsigned IRCF : 3;
3157 unsigned : 1;
3159 } __OSCCONbits_t;
3161 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
3163 #define _SCS0 0x01
3164 #define _SCS1 0x02
3165 #define _IOFS 0x04
3166 #define _FLTS 0x04
3167 #define _OSTS 0x08
3168 #define _IRCF0 0x10
3169 #define _IRCF1 0x20
3170 #define _IRCF2 0x40
3171 #define _IDLEN 0x80
3173 //==============================================================================
3176 //==============================================================================
3177 // T0CON Bits
3179 extern __at(0x0FD5) __sfr T0CON;
3181 typedef union
3183 struct
3185 unsigned T0PS0 : 1;
3186 unsigned T0PS1 : 1;
3187 unsigned T0PS2 : 1;
3188 unsigned PSA : 1;
3189 unsigned T0SE : 1;
3190 unsigned T0CS : 1;
3191 unsigned T08BIT : 1;
3192 unsigned TMR0ON : 1;
3195 struct
3197 unsigned T0PS : 3;
3198 unsigned : 5;
3200 } __T0CONbits_t;
3202 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
3204 #define _T0PS0 0x01
3205 #define _T0PS1 0x02
3206 #define _T0PS2 0x04
3207 #define _PSA 0x08
3208 #define _T0SE 0x10
3209 #define _T0CS 0x20
3210 #define _T08BIT 0x40
3211 #define _TMR0ON 0x80
3213 //==============================================================================
3215 extern __at(0x0FD6) __sfr TMR0;
3216 extern __at(0x0FD6) __sfr TMR0L;
3217 extern __at(0x0FD7) __sfr TMR0H;
3219 //==============================================================================
3220 // STATUS Bits
3222 extern __at(0x0FD8) __sfr STATUS;
3224 typedef struct
3226 unsigned C : 1;
3227 unsigned DC : 1;
3228 unsigned Z : 1;
3229 unsigned OV : 1;
3230 unsigned N : 1;
3231 unsigned : 1;
3232 unsigned : 1;
3233 unsigned : 1;
3234 } __STATUSbits_t;
3236 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3238 #define _C 0x01
3239 #define _DC 0x02
3240 #define _Z 0x04
3241 #define _OV 0x08
3242 #define _N 0x10
3244 //==============================================================================
3246 extern __at(0x0FD9) __sfr FSR2L;
3247 extern __at(0x0FDA) __sfr FSR2H;
3248 extern __at(0x0FDB) __sfr PLUSW2;
3249 extern __at(0x0FDC) __sfr PREINC2;
3250 extern __at(0x0FDD) __sfr POSTDEC2;
3251 extern __at(0x0FDE) __sfr POSTINC2;
3252 extern __at(0x0FDF) __sfr INDF2;
3253 extern __at(0x0FE0) __sfr BSR;
3254 extern __at(0x0FE1) __sfr FSR1L;
3255 extern __at(0x0FE2) __sfr FSR1H;
3256 extern __at(0x0FE3) __sfr PLUSW1;
3257 extern __at(0x0FE4) __sfr PREINC1;
3258 extern __at(0x0FE5) __sfr POSTDEC1;
3259 extern __at(0x0FE6) __sfr POSTINC1;
3260 extern __at(0x0FE7) __sfr INDF1;
3261 extern __at(0x0FE8) __sfr WREG;
3262 extern __at(0x0FE9) __sfr FSR0L;
3263 extern __at(0x0FEA) __sfr FSR0H;
3264 extern __at(0x0FEB) __sfr PLUSW0;
3265 extern __at(0x0FEC) __sfr PREINC0;
3266 extern __at(0x0FED) __sfr POSTDEC0;
3267 extern __at(0x0FEE) __sfr POSTINC0;
3268 extern __at(0x0FEF) __sfr INDF0;
3270 //==============================================================================
3271 // INTCON3 Bits
3273 extern __at(0x0FF0) __sfr INTCON3;
3275 typedef union
3277 struct
3279 unsigned INT1IF : 1;
3280 unsigned INT2IF : 1;
3281 unsigned : 1;
3282 unsigned INT1IE : 1;
3283 unsigned INT2IE : 1;
3284 unsigned : 1;
3285 unsigned INT1IP : 1;
3286 unsigned INT2IP : 1;
3289 struct
3291 unsigned INT1F : 1;
3292 unsigned INT2F : 1;
3293 unsigned : 1;
3294 unsigned INT1E : 1;
3295 unsigned INT2E : 1;
3296 unsigned : 1;
3297 unsigned INT1P : 1;
3298 unsigned INT2P : 1;
3300 } __INTCON3bits_t;
3302 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3304 #define _INT1IF 0x01
3305 #define _INT1F 0x01
3306 #define _INT2IF 0x02
3307 #define _INT2F 0x02
3308 #define _INT1IE 0x08
3309 #define _INT1E 0x08
3310 #define _INT2IE 0x10
3311 #define _INT2E 0x10
3312 #define _INT1IP 0x40
3313 #define _INT1P 0x40
3314 #define _INT2IP 0x80
3315 #define _INT2P 0x80
3317 //==============================================================================
3320 //==============================================================================
3321 // INTCON2 Bits
3323 extern __at(0x0FF1) __sfr INTCON2;
3325 typedef union
3327 struct
3329 unsigned RBIP : 1;
3330 unsigned : 1;
3331 unsigned TMR0IP : 1;
3332 unsigned : 1;
3333 unsigned INTEDG2 : 1;
3334 unsigned INTEDG1 : 1;
3335 unsigned INTEDG0 : 1;
3336 unsigned NOT_RBPU : 1;
3339 struct
3341 unsigned : 1;
3342 unsigned : 1;
3343 unsigned T0IP : 1;
3344 unsigned : 1;
3345 unsigned : 1;
3346 unsigned : 1;
3347 unsigned : 1;
3348 unsigned RBPU : 1;
3350 } __INTCON2bits_t;
3352 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3354 #define _RBIP 0x01
3355 #define _TMR0IP 0x04
3356 #define _T0IP 0x04
3357 #define _INTEDG2 0x10
3358 #define _INTEDG1 0x20
3359 #define _INTEDG0 0x40
3360 #define _NOT_RBPU 0x80
3361 #define _RBPU 0x80
3363 //==============================================================================
3366 //==============================================================================
3367 // INTCON Bits
3369 extern __at(0x0FF2) __sfr INTCON;
3371 typedef union
3373 struct
3375 unsigned RBIF : 1;
3376 unsigned INT0IF : 1;
3377 unsigned TMR0IF : 1;
3378 unsigned RBIE : 1;
3379 unsigned INT0IE : 1;
3380 unsigned TMR0IE : 1;
3381 unsigned PEIE_GIEL : 1;
3382 unsigned GIE_GIEH : 1;
3385 struct
3387 unsigned : 1;
3388 unsigned INT0F : 1;
3389 unsigned T0IF : 1;
3390 unsigned : 1;
3391 unsigned INT0E : 1;
3392 unsigned T0IE : 1;
3393 unsigned PEIE : 1;
3394 unsigned GIE : 1;
3397 struct
3399 unsigned : 1;
3400 unsigned : 1;
3401 unsigned : 1;
3402 unsigned : 1;
3403 unsigned : 1;
3404 unsigned : 1;
3405 unsigned GIEL : 1;
3406 unsigned GIEH : 1;
3408 } __INTCONbits_t;
3410 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3412 #define _RBIF 0x01
3413 #define _INT0IF 0x02
3414 #define _INT0F 0x02
3415 #define _TMR0IF 0x04
3416 #define _T0IF 0x04
3417 #define _RBIE 0x08
3418 #define _INT0IE 0x10
3419 #define _INT0E 0x10
3420 #define _TMR0IE 0x20
3421 #define _T0IE 0x20
3422 #define _PEIE_GIEL 0x40
3423 #define _PEIE 0x40
3424 #define _GIEL 0x40
3425 #define _GIE_GIEH 0x80
3426 #define _GIE 0x80
3427 #define _GIEH 0x80
3429 //==============================================================================
3431 extern __at(0x0FF3) __sfr PROD;
3432 extern __at(0x0FF3) __sfr PRODL;
3433 extern __at(0x0FF4) __sfr PRODH;
3434 extern __at(0x0FF5) __sfr TABLAT;
3435 extern __at(0x0FF6) __sfr TBLPTR;
3436 extern __at(0x0FF6) __sfr TBLPTRL;
3437 extern __at(0x0FF7) __sfr TBLPTRH;
3438 extern __at(0x0FF8) __sfr TBLPTRU;
3439 extern __at(0x0FF9) __sfr PC;
3440 extern __at(0x0FF9) __sfr PCL;
3441 extern __at(0x0FFA) __sfr PCLATH;
3442 extern __at(0x0FFB) __sfr PCLATU;
3444 //==============================================================================
3445 // STKPTR Bits
3447 extern __at(0x0FFC) __sfr STKPTR;
3449 typedef union
3451 struct
3453 unsigned STKPTR0 : 1;
3454 unsigned STKPTR1 : 1;
3455 unsigned STKPTR2 : 1;
3456 unsigned STKPTR3 : 1;
3457 unsigned STKPTR4 : 1;
3458 unsigned : 1;
3459 unsigned STKUNF : 1;
3460 unsigned STKFUL : 1;
3463 struct
3465 unsigned : 1;
3466 unsigned : 1;
3467 unsigned : 1;
3468 unsigned : 1;
3469 unsigned : 1;
3470 unsigned : 1;
3471 unsigned : 1;
3472 unsigned STKOVF : 1;
3475 struct
3477 unsigned STKPTR : 5;
3478 unsigned : 3;
3480 } __STKPTRbits_t;
3482 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
3484 #define _STKPTR0 0x01
3485 #define _STKPTR1 0x02
3486 #define _STKPTR2 0x04
3487 #define _STKPTR3 0x08
3488 #define _STKPTR4 0x10
3489 #define _STKUNF 0x40
3490 #define _STKFUL 0x80
3491 #define _STKOVF 0x80
3493 //==============================================================================
3495 extern __at(0x0FFD) __sfr TOS;
3496 extern __at(0x0FFD) __sfr TOSL;
3497 extern __at(0x0FFE) __sfr TOSH;
3498 extern __at(0x0FFF) __sfr TOSU;
3500 //==============================================================================
3502 // Configuration Bits
3504 //==============================================================================
3506 #define __CONFIG1L 0x300000
3507 #define __CONFIG1H 0x300001
3508 #define __CONFIG2L 0x300002
3509 #define __CONFIG2H 0x300003
3510 #define __CONFIG3H 0x300005
3511 #define __CONFIG4L 0x300006
3512 #define __CONFIG5L 0x300008
3513 #define __CONFIG5H 0x300009
3514 #define __CONFIG6L 0x30000A
3515 #define __CONFIG6H 0x30000B
3516 #define __CONFIG7L 0x30000C
3517 #define __CONFIG7H 0x30000D
3519 //----------------------------- CONFIG1L Options -------------------------------
3521 #define _PLLDIV_1_1L 0xF8 // No prescale (4 MHz oscillator input drives PLL directly).
3522 #define _PLLDIV_2_1L 0xF9 // Divide by 2 (8 MHz oscillator input).
3523 #define _PLLDIV_3_1L 0xFA // Divide by 3 (12 MHz oscillator input).
3524 #define _PLLDIV_4_1L 0xFB // Divide by 4 (16 MHz oscillator input).
3525 #define _PLLDIV_5_1L 0xFC // Divide by 5 (20 MHz oscillator input).
3526 #define _PLLDIV_6_1L 0xFD // Divide by 6 (24 MHz oscillator input).
3527 #define _PLLDIV_10_1L 0xFE // Divide by 10 (40 MHz oscillator input).
3528 #define _PLLDIV_12_1L 0xFF // Divide by 12 (48 MHz oscillator input).
3529 #define _CPUDIV_OSC1_PLL2_1L 0xE7 // [Primary Oscillator Src: /1][96 MHz PLL Src: /2].
3530 #define _CPUDIV_OSC2_PLL3_1L 0xEF // [Primary Oscillator Src: /2][96 MHz PLL Src: /3].
3531 #define _CPUDIV_OSC3_PLL4_1L 0xF7 // [Primary Oscillator Src: /3][96 MHz PLL Src: /4].
3532 #define _CPUDIV_OSC4_PLL6_1L 0xFF // [Primary Oscillator Src: /4][96 MHz PLL Src: /6].
3533 #define _USBDIV_1_1L 0xDF // USB clock source comes directly from the primary oscillator block with no postscale.
3534 #define _USBDIV_2_1L 0xFF // USB clock source comes from the 96 MHz PLL divided by 2.
3536 //----------------------------- CONFIG1H Options -------------------------------
3538 #define _FOSC_XT_XT_1H 0xF0 // XT oscillator (XT).
3539 #define _FOSC_XTPLL_XT_1H 0xF2 // XT oscillator, PLL enabled (XTPLL).
3540 #define _FOSC_ECIO_EC_1H 0xF4 // EC oscillator, port function on RA6 (ECIO).
3541 #define _FOSC_EC_EC_1H 0xF5 // EC oscillator, CLKO function on RA6 (EC).
3542 #define _FOSC_ECPLLIO_EC_1H 0xF6 // EC oscillator, PLL enabled, port function on RA6 (ECPIO).
3543 #define _FOSC_ECPLL_EC_1H 0xF7 // EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL).
3544 #define _FOSC_INTOSCIO_EC_1H 0xF8 // Internal oscillator, port function on RA6, EC used by USB (INTIO).
3545 #define _FOSC_INTOSC_EC_1H 0xF9 // Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO).
3546 #define _FOSC_INTOSC_XT_1H 0xFA // Internal oscillator, XT used by USB (INTXT).
3547 #define _FOSC_INTOSC_HS_1H 0xFB // Internal oscillator, HS oscillator used by USB (INTHS).
3548 #define _FOSC_HS_1H 0xFC // HS oscillator (HS).
3549 #define _FOSC_HSPLL_HS_1H 0xFE // HS oscillator, PLL enabled (HSPLL).
3550 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
3551 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
3552 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
3553 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
3555 //----------------------------- CONFIG2L Options -------------------------------
3557 #define _PWRT_ON_2L 0xFE // PWRT enabled.
3558 #define _PWRT_OFF_2L 0xFF // PWRT disabled.
3559 #define _BOR_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
3560 #define _BOR_SOFT_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
3561 #define _BOR_ON_ACTIVE_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
3562 #define _BOR_ON_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
3563 #define _BORV_0_2L 0xE7 // Maximum setting 4.59V.
3564 #define _BORV_1_2L 0xEF // Setting 2 4.33V.
3565 #define _BORV_2_2L 0xF7 // Setting 1 2.79V.
3566 #define _BORV_3_2L 0xFF // Minimum setting 2.05V.
3567 #define _VREGEN_OFF_2L 0xDF // USB voltage regulator disabled.
3568 #define _VREGEN_ON_2L 0xFF // USB voltage regulator enabled.
3570 //----------------------------- CONFIG2H Options -------------------------------
3572 #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
3573 #define _WDT_ON_2H 0xFF // WDT enabled.
3574 #define _WDTPS_1_2H 0xE1 // 1:1.
3575 #define _WDTPS_2_2H 0xE3 // 1:2.
3576 #define _WDTPS_4_2H 0xE5 // 1:4.
3577 #define _WDTPS_8_2H 0xE7 // 1:8.
3578 #define _WDTPS_16_2H 0xE9 // 1:16.
3579 #define _WDTPS_32_2H 0xEB // 1:32.
3580 #define _WDTPS_64_2H 0xED // 1:64.
3581 #define _WDTPS_128_2H 0xEF // 1:128.
3582 #define _WDTPS_256_2H 0xF1 // 1:256.
3583 #define _WDTPS_512_2H 0xF3 // 1:512.
3584 #define _WDTPS_1024_2H 0xF5 // 1:1024.
3585 #define _WDTPS_2048_2H 0xF7 // 1:2048.
3586 #define _WDTPS_4096_2H 0xF9 // 1:4096.
3587 #define _WDTPS_8192_2H 0xFB // 1:8192.
3588 #define _WDTPS_16384_2H 0xFD // 1:16384.
3589 #define _WDTPS_32768_2H 0xFF // 1:32768.
3591 //----------------------------- CONFIG3H Options -------------------------------
3593 #define _CCP2MX_OFF_3H 0xFE // CCP2 input/output is multiplexed with RB3.
3594 #define _CCP2MX_ON_3H 0xFF // CCP2 input/output is multiplexed with RC1.
3595 #define _PBADEN_OFF_3H 0xFD // PORTB<4:0> pins are configured as digital I/O on Reset.
3596 #define _PBADEN_ON_3H 0xFF // PORTB<4:0> pins are configured as analog input channels on Reset.
3597 #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
3598 #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
3599 #define _MCLRE_OFF_3H 0x7F // RE3 input pin enabled; MCLR pin disabled.
3600 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RE3 input pin disabled.
3602 //----------------------------- CONFIG4L Options -------------------------------
3604 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
3605 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
3606 #define _LVP_OFF_4L 0xFB // Single-Supply ICSP disabled.
3607 #define _LVP_ON_4L 0xFF // Single-Supply ICSP enabled.
3608 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
3609 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
3610 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
3611 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
3613 //----------------------------- CONFIG5L Options -------------------------------
3615 #define _CP0_ON_5L 0xFE // Block 0 (000800-001FFFh) is code-protected.
3616 #define _CP0_OFF_5L 0xFF // Block 0 (000800-001FFFh) is not code-protected.
3617 #define _CP1_ON_5L 0xFD // Block 1 (002000-003FFFh) is code-protected.
3618 #define _CP1_OFF_5L 0xFF // Block 1 (002000-003FFFh) is not code-protected.
3619 #define _CP2_ON_5L 0xFB // Block 2 (004000-005FFFh) is code-protected.
3620 #define _CP2_OFF_5L 0xFF // Block 2 (004000-005FFFh) is not code-protected.
3621 #define _CP3_ON_5L 0xF7 // Block 3 (006000-007FFFh) is code-protected.
3622 #define _CP3_OFF_5L 0xFF // Block 3 (006000-007FFFh) is not code-protected.
3624 //----------------------------- CONFIG5H Options -------------------------------
3626 #define _CPB_ON_5H 0xBF // Boot block (000000-0007FFh) is code-protected.
3627 #define _CPB_OFF_5H 0xFF // Boot block (000000-0007FFh) is not code-protected.
3628 #define _CPD_ON_5H 0x7F // Data EEPROM is code-protected.
3629 #define _CPD_OFF_5H 0xFF // Data EEPROM is not code-protected.
3631 //----------------------------- CONFIG6L Options -------------------------------
3633 #define _WRT0_ON_6L 0xFE // Block 0 (000800-001FFFh) is write-protected.
3634 #define _WRT0_OFF_6L 0xFF // Block 0 (000800-001FFFh) is not write-protected.
3635 #define _WRT1_ON_6L 0xFD // Block 1 (002000-003FFFh) is write-protected.
3636 #define _WRT1_OFF_6L 0xFF // Block 1 (002000-003FFFh) is not write-protected.
3637 #define _WRT2_ON_6L 0xFB // Block 2 (004000-005FFFh) is write-protected.
3638 #define _WRT2_OFF_6L 0xFF // Block 2 (004000-005FFFh) is not write-protected.
3639 #define _WRT3_ON_6L 0xF7 // Block 3 (006000-007FFFh) is write-protected.
3640 #define _WRT3_OFF_6L 0xFF // Block 3 (006000-007FFFh) is not write-protected.
3642 //----------------------------- CONFIG6H Options -------------------------------
3644 #define _WRTC_ON_6H 0xDF // Configuration registers (300000-3000FFh) are write-protected.
3645 #define _WRTC_OFF_6H 0xFF // Configuration registers (300000-3000FFh) are not write-protected.
3646 #define _WRTB_ON_6H 0xBF // Boot block (000000-0007FFh) is write-protected.
3647 #define _WRTB_OFF_6H 0xFF // Boot block (000000-0007FFh) is not write-protected.
3648 #define _WRTD_ON_6H 0x7F // Data EEPROM is write-protected.
3649 #define _WRTD_OFF_6H 0xFF // Data EEPROM is not write-protected.
3651 //----------------------------- CONFIG7L Options -------------------------------
3653 #define _EBTR0_ON_7L 0xFE // Block 0 (000800-001FFFh) is protected from table reads executed in other blocks.
3654 #define _EBTR0_OFF_7L 0xFF // Block 0 (000800-001FFFh) is not protected from table reads executed in other blocks.
3655 #define _EBTR1_ON_7L 0xFD // Block 1 (002000-003FFFh) is protected from table reads executed in other blocks.
3656 #define _EBTR1_OFF_7L 0xFF // Block 1 (002000-003FFFh) is not protected from table reads executed in other blocks.
3657 #define _EBTR2_ON_7L 0xFB // Block 2 (004000-005FFFh) is protected from table reads executed in other blocks.
3658 #define _EBTR2_OFF_7L 0xFF // Block 2 (004000-005FFFh) is not protected from table reads executed in other blocks.
3659 #define _EBTR3_ON_7L 0xF7 // Block 3 (006000-007FFFh) is protected from table reads executed in other blocks.
3660 #define _EBTR3_OFF_7L 0xFF // Block 3 (006000-007FFFh) is not protected from table reads executed in other blocks.
3662 //----------------------------- CONFIG7H Options -------------------------------
3664 #define _EBTRB_ON_7H 0xBF // Boot block (000000-0007FFh) is protected from table reads executed in other blocks.
3665 #define _EBTRB_OFF_7H 0xFF // Boot block (000000-0007FFh) is not protected from table reads executed in other blocks.
3667 //==============================================================================
3669 #define __DEVID1 0x3FFFFE
3670 #define __DEVID2 0x3FFFFF
3672 #define __IDLOC0 0x200000
3673 #define __IDLOC1 0x200001
3674 #define __IDLOC2 0x200002
3675 #define __IDLOC3 0x200003
3676 #define __IDLOC4 0x200004
3677 #define __IDLOC5 0x200005
3678 #define __IDLOC6 0x200006
3679 #define __IDLOC7 0x200007
3681 #endif // #ifndef __PIC18F2550_H__