struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f87j50.h
blob285dee0b1db83dd57e0376b45e660e06c0e57312
1 /*
2 * This declarations of the PIC18F87J50 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:39 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 __PIC18F87J50_H__
26 #define __PIC18F87J50_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
36 extern __at(0x0F40) __sfr PMSTAT;
38 //==============================================================================
39 // PMSTATL Bits
41 extern __at(0x0F40) __sfr PMSTATL;
43 typedef struct
45 unsigned OB0E : 1;
46 unsigned OB1E : 1;
47 unsigned OB2E : 1;
48 unsigned OB3E : 1;
49 unsigned : 1;
50 unsigned : 1;
51 unsigned OBUF : 1;
52 unsigned OBE : 1;
53 } __PMSTATLbits_t;
55 extern __at(0x0F40) volatile __PMSTATLbits_t PMSTATLbits;
57 #define _OB0E 0x01
58 #define _OB1E 0x02
59 #define _OB2E 0x04
60 #define _OB3E 0x08
61 #define _OBUF 0x40
62 #define _OBE 0x80
64 //==============================================================================
67 //==============================================================================
68 // PMSTATH Bits
70 extern __at(0x0F41) __sfr PMSTATH;
72 typedef struct
74 unsigned IB0F : 1;
75 unsigned IB1F : 1;
76 unsigned IB2F : 1;
77 unsigned IB3F : 1;
78 unsigned : 1;
79 unsigned : 1;
80 unsigned IBOV : 1;
81 unsigned IBF : 1;
82 } __PMSTATHbits_t;
84 extern __at(0x0F41) volatile __PMSTATHbits_t PMSTATHbits;
86 #define _IB0F 0x01
87 #define _IB1F 0x02
88 #define _IB2F 0x04
89 #define _IB3F 0x08
90 #define _IBOV 0x40
91 #define _IBF 0x80
93 //==============================================================================
96 //==============================================================================
97 // PMEL Bits
99 extern __at(0x0F42) __sfr PMEL;
101 typedef struct
103 unsigned PTEN0 : 1;
104 unsigned PTEN1 : 1;
105 unsigned PTEN2 : 1;
106 unsigned PTEN3 : 1;
107 unsigned PTEN4 : 1;
108 unsigned PTEN5 : 1;
109 unsigned PTEN6 : 1;
110 unsigned PTEN7 : 1;
111 } __PMELbits_t;
113 extern __at(0x0F42) volatile __PMELbits_t PMELbits;
115 #define _PTEN0 0x01
116 #define _PTEN1 0x02
117 #define _PTEN2 0x04
118 #define _PTEN3 0x08
119 #define _PTEN4 0x10
120 #define _PTEN5 0x20
121 #define _PTEN6 0x40
122 #define _PTEN7 0x80
124 //==============================================================================
126 extern __at(0x0F42) __sfr PMEN;
128 //==============================================================================
129 // PMEH Bits
131 extern __at(0x0F43) __sfr PMEH;
133 typedef struct
135 unsigned PTEN8 : 1;
136 unsigned PTEN9 : 1;
137 unsigned PTEN10 : 1;
138 unsigned PTEN11 : 1;
139 unsigned PTEN12 : 1;
140 unsigned PTEN13 : 1;
141 unsigned PTEN14 : 1;
142 unsigned PTEN15 : 1;
143 } __PMEHbits_t;
145 extern __at(0x0F43) volatile __PMEHbits_t PMEHbits;
147 #define _PTEN8 0x01
148 #define _PTEN9 0x02
149 #define _PTEN10 0x04
150 #define _PTEN11 0x08
151 #define _PTEN12 0x10
152 #define _PTEN13 0x20
153 #define _PTEN14 0x40
154 #define _PTEN15 0x80
156 //==============================================================================
158 extern __at(0x0F44) __sfr PMDIN2;
159 extern __at(0x0F44) __sfr PMDIN2L;
160 extern __at(0x0F45) __sfr PMDIN2H;
161 extern __at(0x0F46) __sfr PMDOUT2;
162 extern __at(0x0F46) __sfr PMDOUT2L;
163 extern __at(0x0F47) __sfr PMDOUT2H;
164 extern __at(0x0F48) __sfr PMMODE;
166 //==============================================================================
167 // PMMODEL Bits
169 extern __at(0x0F48) __sfr PMMODEL;
171 typedef union
173 struct
175 unsigned WAITE0 : 1;
176 unsigned WAITE1 : 1;
177 unsigned WAITM0 : 1;
178 unsigned WAITM1 : 1;
179 unsigned WAITM2 : 1;
180 unsigned WAITM3 : 1;
181 unsigned WAITB0 : 1;
182 unsigned WAITB1 : 1;
185 struct
187 unsigned WAITE : 2;
188 unsigned : 6;
191 struct
193 unsigned : 2;
194 unsigned WAITM : 4;
195 unsigned : 2;
198 struct
200 unsigned : 6;
201 unsigned WAITB : 2;
203 } __PMMODELbits_t;
205 extern __at(0x0F48) volatile __PMMODELbits_t PMMODELbits;
207 #define _WAITE0 0x01
208 #define _WAITE1 0x02
209 #define _WAITM0 0x04
210 #define _WAITM1 0x08
211 #define _WAITM2 0x10
212 #define _WAITM3 0x20
213 #define _WAITB0 0x40
214 #define _WAITB1 0x80
216 //==============================================================================
219 //==============================================================================
220 // PMMODEH Bits
222 extern __at(0x0F49) __sfr PMMODEH;
224 typedef union
226 struct
228 unsigned MODE0 : 1;
229 unsigned MODE1 : 1;
230 unsigned MODE16 : 1;
231 unsigned INCM0 : 1;
232 unsigned INCM1 : 1;
233 unsigned IRQM0 : 1;
234 unsigned IRQM1 : 1;
235 unsigned BUSY : 1;
238 struct
240 unsigned : 3;
241 unsigned INCM : 2;
242 unsigned : 3;
245 struct
247 unsigned : 5;
248 unsigned IRQM : 2;
249 unsigned : 1;
251 } __PMMODEHbits_t;
253 extern __at(0x0F49) volatile __PMMODEHbits_t PMMODEHbits;
255 #define _MODE0 0x01
256 #define _MODE1 0x02
257 #define _MODE16 0x04
258 #define _INCM0 0x08
259 #define _INCM1 0x10
260 #define _IRQM0 0x20
261 #define _IRQM1 0x40
262 #define _BUSY 0x80
264 //==============================================================================
266 extern __at(0x0F4A) __sfr PMCON;
268 //==============================================================================
269 // PMCONL Bits
271 extern __at(0x0F4A) __sfr PMCONL;
273 typedef union
275 struct
277 unsigned RDSP : 1;
278 unsigned WRSP : 1;
279 unsigned BEP : 1;
280 unsigned CS1P : 1;
281 unsigned CS2P : 1;
282 unsigned ALP : 1;
283 unsigned CSF0 : 1;
284 unsigned CSF1 : 1;
287 struct
289 unsigned : 6;
290 unsigned CSF : 2;
292 } __PMCONLbits_t;
294 extern __at(0x0F4A) volatile __PMCONLbits_t PMCONLbits;
296 #define _RDSP 0x01
297 #define _WRSP 0x02
298 #define _BEP 0x04
299 #define _CS1P 0x08
300 #define _CS2P 0x10
301 #define _ALP 0x20
302 #define _CSF0 0x40
303 #define _CSF1 0x80
305 //==============================================================================
308 //==============================================================================
309 // PMCONH Bits
311 extern __at(0x0F4B) __sfr PMCONH;
313 typedef union
315 struct
317 unsigned PTRDEN : 1;
318 unsigned PTWREN : 1;
319 unsigned PTBEEN : 1;
320 unsigned ADRMUX0 : 1;
321 unsigned ADRMUX1 : 1;
322 unsigned PSIDL : 1;
323 unsigned : 1;
324 unsigned PMPEN : 1;
327 struct
329 unsigned : 3;
330 unsigned ADRMUX : 2;
331 unsigned : 3;
333 } __PMCONHbits_t;
335 extern __at(0x0F4B) volatile __PMCONHbits_t PMCONHbits;
337 #define _PTRDEN 0x01
338 #define _PTWREN 0x02
339 #define _PTBEEN 0x04
340 #define _ADRMUX0 0x08
341 #define _ADRMUX1 0x10
342 #define _PSIDL 0x20
343 #define _PMPEN 0x80
345 //==============================================================================
348 //==============================================================================
349 // UEP0 Bits
351 extern __at(0x0F4C) __sfr UEP0;
353 typedef struct
355 unsigned EPSTALL : 1;
356 unsigned EPINEN : 1;
357 unsigned EPOUTEN : 1;
358 unsigned EPCONDIS : 1;
359 unsigned EPHSHK : 1;
360 unsigned : 1;
361 unsigned : 1;
362 unsigned : 1;
363 } __UEP0bits_t;
365 extern __at(0x0F4C) volatile __UEP0bits_t UEP0bits;
367 #define _EPSTALL 0x01
368 #define _EPINEN 0x02
369 #define _EPOUTEN 0x04
370 #define _EPCONDIS 0x08
371 #define _EPHSHK 0x10
373 //==============================================================================
376 //==============================================================================
377 // UEP1 Bits
379 extern __at(0x0F4D) __sfr UEP1;
381 typedef struct
383 unsigned EPSTALL : 1;
384 unsigned EPINEN : 1;
385 unsigned EPOUTEN : 1;
386 unsigned EPCONDIS : 1;
387 unsigned EPHSHK : 1;
388 unsigned : 1;
389 unsigned : 1;
390 unsigned : 1;
391 } __UEP1bits_t;
393 extern __at(0x0F4D) volatile __UEP1bits_t UEP1bits;
395 #define _UEP1_EPSTALL 0x01
396 #define _UEP1_EPINEN 0x02
397 #define _UEP1_EPOUTEN 0x04
398 #define _UEP1_EPCONDIS 0x08
399 #define _UEP1_EPHSHK 0x10
401 //==============================================================================
404 //==============================================================================
405 // UEP2 Bits
407 extern __at(0x0F4E) __sfr UEP2;
409 typedef struct
411 unsigned EPSTALL : 1;
412 unsigned EPINEN : 1;
413 unsigned EPOUTEN : 1;
414 unsigned EPCONDIS : 1;
415 unsigned EPHSHK : 1;
416 unsigned : 1;
417 unsigned : 1;
418 unsigned : 1;
419 } __UEP2bits_t;
421 extern __at(0x0F4E) volatile __UEP2bits_t UEP2bits;
423 #define _UEP2_EPSTALL 0x01
424 #define _UEP2_EPINEN 0x02
425 #define _UEP2_EPOUTEN 0x04
426 #define _UEP2_EPCONDIS 0x08
427 #define _UEP2_EPHSHK 0x10
429 //==============================================================================
432 //==============================================================================
433 // UEP3 Bits
435 extern __at(0x0F4F) __sfr UEP3;
437 typedef struct
439 unsigned EPSTALL : 1;
440 unsigned EPINEN : 1;
441 unsigned EPOUTEN : 1;
442 unsigned EPCONDIS : 1;
443 unsigned EPHSHK : 1;
444 unsigned : 1;
445 unsigned : 1;
446 unsigned : 1;
447 } __UEP3bits_t;
449 extern __at(0x0F4F) volatile __UEP3bits_t UEP3bits;
451 #define _UEP3_EPSTALL 0x01
452 #define _UEP3_EPINEN 0x02
453 #define _UEP3_EPOUTEN 0x04
454 #define _UEP3_EPCONDIS 0x08
455 #define _UEP3_EPHSHK 0x10
457 //==============================================================================
460 //==============================================================================
461 // UEP4 Bits
463 extern __at(0x0F50) __sfr UEP4;
465 typedef struct
467 unsigned EPSTALL : 1;
468 unsigned EPINEN : 1;
469 unsigned EPOUTEN : 1;
470 unsigned EPCONDIS : 1;
471 unsigned EPHSHK : 1;
472 unsigned : 1;
473 unsigned : 1;
474 unsigned : 1;
475 } __UEP4bits_t;
477 extern __at(0x0F50) volatile __UEP4bits_t UEP4bits;
479 #define _UEP4_EPSTALL 0x01
480 #define _UEP4_EPINEN 0x02
481 #define _UEP4_EPOUTEN 0x04
482 #define _UEP4_EPCONDIS 0x08
483 #define _UEP4_EPHSHK 0x10
485 //==============================================================================
488 //==============================================================================
489 // UEP5 Bits
491 extern __at(0x0F51) __sfr UEP5;
493 typedef struct
495 unsigned EPSTALL : 1;
496 unsigned EPINEN : 1;
497 unsigned EPOUTEN : 1;
498 unsigned EPCONDIS : 1;
499 unsigned EPHSHK : 1;
500 unsigned : 1;
501 unsigned : 1;
502 unsigned : 1;
503 } __UEP5bits_t;
505 extern __at(0x0F51) volatile __UEP5bits_t UEP5bits;
507 #define _UEP5_EPSTALL 0x01
508 #define _UEP5_EPINEN 0x02
509 #define _UEP5_EPOUTEN 0x04
510 #define _UEP5_EPCONDIS 0x08
511 #define _UEP5_EPHSHK 0x10
513 //==============================================================================
516 //==============================================================================
517 // UEP6 Bits
519 extern __at(0x0F52) __sfr UEP6;
521 typedef struct
523 unsigned EPSTALL : 1;
524 unsigned EPINEN : 1;
525 unsigned EPOUTEN : 1;
526 unsigned EPCONDIS : 1;
527 unsigned EPHSHK : 1;
528 unsigned : 1;
529 unsigned : 1;
530 unsigned : 1;
531 } __UEP6bits_t;
533 extern __at(0x0F52) volatile __UEP6bits_t UEP6bits;
535 #define _UEP6_EPSTALL 0x01
536 #define _UEP6_EPINEN 0x02
537 #define _UEP6_EPOUTEN 0x04
538 #define _UEP6_EPCONDIS 0x08
539 #define _UEP6_EPHSHK 0x10
541 //==============================================================================
544 //==============================================================================
545 // UEP7 Bits
547 extern __at(0x0F53) __sfr UEP7;
549 typedef struct
551 unsigned EPSTALL : 1;
552 unsigned EPINEN : 1;
553 unsigned EPOUTEN : 1;
554 unsigned EPCONDIS : 1;
555 unsigned EPHSHK : 1;
556 unsigned : 1;
557 unsigned : 1;
558 unsigned : 1;
559 } __UEP7bits_t;
561 extern __at(0x0F53) volatile __UEP7bits_t UEP7bits;
563 #define _UEP7_EPSTALL 0x01
564 #define _UEP7_EPINEN 0x02
565 #define _UEP7_EPOUTEN 0x04
566 #define _UEP7_EPCONDIS 0x08
567 #define _UEP7_EPHSHK 0x10
569 //==============================================================================
572 //==============================================================================
573 // UEP8 Bits
575 extern __at(0x0F54) __sfr UEP8;
577 typedef struct
579 unsigned EPSTALL : 1;
580 unsigned EPINEN : 1;
581 unsigned EPOUTEN : 1;
582 unsigned EPCONDIS : 1;
583 unsigned EPHSHK : 1;
584 unsigned : 1;
585 unsigned : 1;
586 unsigned : 1;
587 } __UEP8bits_t;
589 extern __at(0x0F54) volatile __UEP8bits_t UEP8bits;
591 #define _UEP8_EPSTALL 0x01
592 #define _UEP8_EPINEN 0x02
593 #define _UEP8_EPOUTEN 0x04
594 #define _UEP8_EPCONDIS 0x08
595 #define _UEP8_EPHSHK 0x10
597 //==============================================================================
600 //==============================================================================
601 // UEP9 Bits
603 extern __at(0x0F55) __sfr UEP9;
605 typedef struct
607 unsigned EPSTALL : 1;
608 unsigned EPINEN : 1;
609 unsigned EPOUTEN : 1;
610 unsigned EPCONDIS : 1;
611 unsigned EPHSHK : 1;
612 unsigned : 1;
613 unsigned : 1;
614 unsigned : 1;
615 } __UEP9bits_t;
617 extern __at(0x0F55) volatile __UEP9bits_t UEP9bits;
619 #define _UEP9_EPSTALL 0x01
620 #define _UEP9_EPINEN 0x02
621 #define _UEP9_EPOUTEN 0x04
622 #define _UEP9_EPCONDIS 0x08
623 #define _UEP9_EPHSHK 0x10
625 //==============================================================================
628 //==============================================================================
629 // UEP10 Bits
631 extern __at(0x0F56) __sfr UEP10;
633 typedef struct
635 unsigned EPSTALL : 1;
636 unsigned EPINEN : 1;
637 unsigned EPOUTEN : 1;
638 unsigned EPCONDIS : 1;
639 unsigned EPHSHK : 1;
640 unsigned : 1;
641 unsigned : 1;
642 unsigned : 1;
643 } __UEP10bits_t;
645 extern __at(0x0F56) volatile __UEP10bits_t UEP10bits;
647 #define _UEP10_EPSTALL 0x01
648 #define _UEP10_EPINEN 0x02
649 #define _UEP10_EPOUTEN 0x04
650 #define _UEP10_EPCONDIS 0x08
651 #define _UEP10_EPHSHK 0x10
653 //==============================================================================
656 //==============================================================================
657 // UEP11 Bits
659 extern __at(0x0F57) __sfr UEP11;
661 typedef struct
663 unsigned EPSTALL : 1;
664 unsigned EPINEN : 1;
665 unsigned EPOUTEN : 1;
666 unsigned EPCONDIS : 1;
667 unsigned EPHSHK : 1;
668 unsigned : 1;
669 unsigned : 1;
670 unsigned : 1;
671 } __UEP11bits_t;
673 extern __at(0x0F57) volatile __UEP11bits_t UEP11bits;
675 #define _UEP11_EPSTALL 0x01
676 #define _UEP11_EPINEN 0x02
677 #define _UEP11_EPOUTEN 0x04
678 #define _UEP11_EPCONDIS 0x08
679 #define _UEP11_EPHSHK 0x10
681 //==============================================================================
684 //==============================================================================
685 // UEP12 Bits
687 extern __at(0x0F58) __sfr UEP12;
689 typedef struct
691 unsigned EPSTALL : 1;
692 unsigned EPINEN : 1;
693 unsigned EPOUTEN : 1;
694 unsigned EPCONDIS : 1;
695 unsigned EPHSHK : 1;
696 unsigned : 1;
697 unsigned : 1;
698 unsigned : 1;
699 } __UEP12bits_t;
701 extern __at(0x0F58) volatile __UEP12bits_t UEP12bits;
703 #define _UEP12_EPSTALL 0x01
704 #define _UEP12_EPINEN 0x02
705 #define _UEP12_EPOUTEN 0x04
706 #define _UEP12_EPCONDIS 0x08
707 #define _UEP12_EPHSHK 0x10
709 //==============================================================================
712 //==============================================================================
713 // UEP13 Bits
715 extern __at(0x0F59) __sfr UEP13;
717 typedef struct
719 unsigned EPSTALL : 1;
720 unsigned EPINEN : 1;
721 unsigned EPOUTEN : 1;
722 unsigned EPCONDIS : 1;
723 unsigned EPHSHK : 1;
724 unsigned : 1;
725 unsigned : 1;
726 unsigned : 1;
727 } __UEP13bits_t;
729 extern __at(0x0F59) volatile __UEP13bits_t UEP13bits;
731 #define _UEP13_EPSTALL 0x01
732 #define _UEP13_EPINEN 0x02
733 #define _UEP13_EPOUTEN 0x04
734 #define _UEP13_EPCONDIS 0x08
735 #define _UEP13_EPHSHK 0x10
737 //==============================================================================
740 //==============================================================================
741 // UEP14 Bits
743 extern __at(0x0F5A) __sfr UEP14;
745 typedef struct
747 unsigned EPSTALL : 1;
748 unsigned EPINEN : 1;
749 unsigned EPOUTEN : 1;
750 unsigned EPCONDIS : 1;
751 unsigned EPHSHK : 1;
752 unsigned : 1;
753 unsigned : 1;
754 unsigned : 1;
755 } __UEP14bits_t;
757 extern __at(0x0F5A) volatile __UEP14bits_t UEP14bits;
759 #define _UEP14_EPSTALL 0x01
760 #define _UEP14_EPINEN 0x02
761 #define _UEP14_EPOUTEN 0x04
762 #define _UEP14_EPCONDIS 0x08
763 #define _UEP14_EPHSHK 0x10
765 //==============================================================================
768 //==============================================================================
769 // UEP15 Bits
771 extern __at(0x0F5B) __sfr UEP15;
773 typedef struct
775 unsigned EPSTALL : 1;
776 unsigned EPINEN : 1;
777 unsigned EPOUTEN : 1;
778 unsigned EPCONDIS : 1;
779 unsigned EPHSHK : 1;
780 unsigned : 1;
781 unsigned : 1;
782 unsigned : 1;
783 } __UEP15bits_t;
785 extern __at(0x0F5B) volatile __UEP15bits_t UEP15bits;
787 #define _UEP15_EPSTALL 0x01
788 #define _UEP15_EPINEN 0x02
789 #define _UEP15_EPOUTEN 0x04
790 #define _UEP15_EPCONDIS 0x08
791 #define _UEP15_EPHSHK 0x10
793 //==============================================================================
796 //==============================================================================
797 // UIE Bits
799 extern __at(0x0F5C) __sfr UIE;
801 typedef struct
803 unsigned URSTIE : 1;
804 unsigned UERRIE : 1;
805 unsigned ACTVIE : 1;
806 unsigned TRNIE : 1;
807 unsigned IDLEIE : 1;
808 unsigned STALLIE : 1;
809 unsigned SOFIE : 1;
810 unsigned : 1;
811 } __UIEbits_t;
813 extern __at(0x0F5C) volatile __UIEbits_t UIEbits;
815 #define _URSTIE 0x01
816 #define _UERRIE 0x02
817 #define _ACTVIE 0x04
818 #define _TRNIE 0x08
819 #define _IDLEIE 0x10
820 #define _STALLIE 0x20
821 #define _SOFIE 0x40
823 //==============================================================================
826 //==============================================================================
827 // UEIE Bits
829 extern __at(0x0F5D) __sfr UEIE;
831 typedef struct
833 unsigned PIDEE : 1;
834 unsigned CRC5EE : 1;
835 unsigned CRC16EE : 1;
836 unsigned DFN8EE : 1;
837 unsigned BTOEE : 1;
838 unsigned : 1;
839 unsigned : 1;
840 unsigned BTSEE : 1;
841 } __UEIEbits_t;
843 extern __at(0x0F5D) volatile __UEIEbits_t UEIEbits;
845 #define _PIDEE 0x01
846 #define _CRC5EE 0x02
847 #define _CRC16EE 0x04
848 #define _DFN8EE 0x08
849 #define _BTOEE 0x10
850 #define _BTSEE 0x80
852 //==============================================================================
855 //==============================================================================
856 // UADDR Bits
858 extern __at(0x0F5E) __sfr UADDR;
860 typedef union
862 struct
864 unsigned ADDR0 : 1;
865 unsigned ADDR1 : 1;
866 unsigned ADDR2 : 1;
867 unsigned ADDR3 : 1;
868 unsigned ADDR4 : 1;
869 unsigned ADDR5 : 1;
870 unsigned ADDR6 : 1;
871 unsigned : 1;
874 struct
876 unsigned ADDR : 7;
877 unsigned : 1;
879 } __UADDRbits_t;
881 extern __at(0x0F5E) volatile __UADDRbits_t UADDRbits;
883 #define _ADDR0 0x01
884 #define _ADDR1 0x02
885 #define _ADDR2 0x04
886 #define _ADDR3 0x08
887 #define _ADDR4 0x10
888 #define _ADDR5 0x20
889 #define _ADDR6 0x40
891 //==============================================================================
894 //==============================================================================
895 // UCFG Bits
897 extern __at(0x0F5F) __sfr UCFG;
899 typedef union
901 struct
903 unsigned PPB0 : 1;
904 unsigned PPB1 : 1;
905 unsigned FSEN : 1;
906 unsigned UTRDIS : 1;
907 unsigned UPUEN : 1;
908 unsigned : 1;
909 unsigned UOEMON : 1;
910 unsigned UTEYE : 1;
913 struct
915 unsigned PPB : 2;
916 unsigned : 6;
918 } __UCFGbits_t;
920 extern __at(0x0F5F) volatile __UCFGbits_t UCFGbits;
922 #define _PPB0 0x01
923 #define _PPB1 0x02
924 #define _FSEN 0x04
925 #define _UTRDIS 0x08
926 #define _UPUEN 0x10
927 #define _UOEMON 0x40
928 #define _UTEYE 0x80
930 //==============================================================================
932 extern __at(0x0F60) __sfr UFRM;
934 //==============================================================================
935 // UFRML Bits
937 extern __at(0x0F60) __sfr UFRML;
939 typedef struct
941 unsigned FRM0 : 1;
942 unsigned FRM1 : 1;
943 unsigned FRM2 : 1;
944 unsigned FRM3 : 1;
945 unsigned FRM4 : 1;
946 unsigned FRM5 : 1;
947 unsigned FRM6 : 1;
948 unsigned FRM7 : 1;
949 } __UFRMLbits_t;
951 extern __at(0x0F60) volatile __UFRMLbits_t UFRMLbits;
953 #define _FRM0 0x01
954 #define _FRM1 0x02
955 #define _FRM2 0x04
956 #define _FRM3 0x08
957 #define _FRM4 0x10
958 #define _FRM5 0x20
959 #define _FRM6 0x40
960 #define _FRM7 0x80
962 //==============================================================================
965 //==============================================================================
966 // UFRMH Bits
968 extern __at(0x0F61) __sfr UFRMH;
970 typedef struct
972 unsigned FRM8 : 1;
973 unsigned FRM9 : 1;
974 unsigned FRM10 : 1;
975 unsigned : 1;
976 unsigned : 1;
977 unsigned : 1;
978 unsigned : 1;
979 unsigned : 1;
980 } __UFRMHbits_t;
982 extern __at(0x0F61) volatile __UFRMHbits_t UFRMHbits;
984 #define _FRM8 0x01
985 #define _FRM9 0x02
986 #define _FRM10 0x04
988 //==============================================================================
991 //==============================================================================
992 // UIR Bits
994 extern __at(0x0F62) __sfr UIR;
996 typedef struct
998 unsigned URSTIF : 1;
999 unsigned UERRIF : 1;
1000 unsigned ACTVIF : 1;
1001 unsigned TRNIF : 1;
1002 unsigned IDLEIF : 1;
1003 unsigned STALLIF : 1;
1004 unsigned SOFIF : 1;
1005 unsigned : 1;
1006 } __UIRbits_t;
1008 extern __at(0x0F62) volatile __UIRbits_t UIRbits;
1010 #define _URSTIF 0x01
1011 #define _UERRIF 0x02
1012 #define _ACTVIF 0x04
1013 #define _TRNIF 0x08
1014 #define _IDLEIF 0x10
1015 #define _STALLIF 0x20
1016 #define _SOFIF 0x40
1018 //==============================================================================
1021 //==============================================================================
1022 // UEIR Bits
1024 extern __at(0x0F63) __sfr UEIR;
1026 typedef struct
1028 unsigned PIDEF : 1;
1029 unsigned CRC5EF : 1;
1030 unsigned CRC16EF : 1;
1031 unsigned DFN8EF : 1;
1032 unsigned BTOEF : 1;
1033 unsigned : 1;
1034 unsigned : 1;
1035 unsigned BTSEF : 1;
1036 } __UEIRbits_t;
1038 extern __at(0x0F63) volatile __UEIRbits_t UEIRbits;
1040 #define _PIDEF 0x01
1041 #define _CRC5EF 0x02
1042 #define _CRC16EF 0x04
1043 #define _DFN8EF 0x08
1044 #define _BTOEF 0x10
1045 #define _BTSEF 0x80
1047 //==============================================================================
1050 //==============================================================================
1051 // USTAT Bits
1053 extern __at(0x0F64) __sfr USTAT;
1055 typedef union
1057 struct
1059 unsigned : 1;
1060 unsigned PPBI : 1;
1061 unsigned DIR : 1;
1062 unsigned ENDP0 : 1;
1063 unsigned ENDP1 : 1;
1064 unsigned ENDP2 : 1;
1065 unsigned ENDP3 : 1;
1066 unsigned : 1;
1069 struct
1071 unsigned : 3;
1072 unsigned ENDP : 4;
1073 unsigned : 1;
1075 } __USTATbits_t;
1077 extern __at(0x0F64) volatile __USTATbits_t USTATbits;
1079 #define _PPBI 0x02
1080 #define _DIR 0x04
1081 #define _ENDP0 0x08
1082 #define _ENDP1 0x10
1083 #define _ENDP2 0x20
1084 #define _ENDP3 0x40
1086 //==============================================================================
1089 //==============================================================================
1090 // UCON Bits
1092 extern __at(0x0F65) __sfr UCON;
1094 typedef struct
1096 unsigned : 1;
1097 unsigned SUSPND : 1;
1098 unsigned RESUME : 1;
1099 unsigned USBEN : 1;
1100 unsigned PKTDIS : 1;
1101 unsigned SE0 : 1;
1102 unsigned PPBRST : 1;
1103 unsigned : 1;
1104 } __UCONbits_t;
1106 extern __at(0x0F65) volatile __UCONbits_t UCONbits;
1108 #define _SUSPND 0x02
1109 #define _RESUME 0x04
1110 #define _USBEN 0x08
1111 #define _PKTDIS 0x10
1112 #define _SE0 0x20
1113 #define _PPBRST 0x40
1115 //==============================================================================
1117 extern __at(0x0F66) __sfr PMDIN1;
1118 extern __at(0x0F66) __sfr PMDIN1L;
1119 extern __at(0x0F67) __sfr PMDIN1H;
1120 extern __at(0x0F68) __sfr PMADDR;
1121 extern __at(0x0F68) __sfr PMADDRL;
1122 extern __at(0x0F68) __sfr PMDOUT1;
1123 extern __at(0x0F68) __sfr PMDOUT1L;
1125 //==============================================================================
1126 // PMADDRH Bits
1128 extern __at(0x0F69) __sfr PMADDRH;
1130 typedef struct
1132 unsigned : 1;
1133 unsigned : 1;
1134 unsigned : 1;
1135 unsigned : 1;
1136 unsigned : 1;
1137 unsigned : 1;
1138 unsigned CS1 : 1;
1139 unsigned CS2 : 1;
1140 } __PMADDRHbits_t;
1142 extern __at(0x0F69) volatile __PMADDRHbits_t PMADDRHbits;
1144 #define _CS1 0x40
1145 #define _CS2 0x80
1147 //==============================================================================
1149 extern __at(0x0F69) __sfr PMDOUT1H;
1151 //==============================================================================
1152 // CMSTAT Bits
1154 extern __at(0x0F6A) __sfr CMSTAT;
1156 typedef struct
1158 unsigned COUT1 : 1;
1159 unsigned COUT2 : 1;
1160 unsigned : 1;
1161 unsigned : 1;
1162 unsigned : 1;
1163 unsigned : 1;
1164 unsigned : 1;
1165 unsigned : 1;
1166 } __CMSTATbits_t;
1168 extern __at(0x0F6A) volatile __CMSTATbits_t CMSTATbits;
1170 #define _COUT1 0x01
1171 #define _COUT2 0x02
1173 //==============================================================================
1176 //==============================================================================
1177 // CMSTATUS Bits
1179 extern __at(0x0F6A) __sfr CMSTATUS;
1181 typedef struct
1183 unsigned COUT1 : 1;
1184 unsigned COUT2 : 1;
1185 unsigned : 1;
1186 unsigned : 1;
1187 unsigned : 1;
1188 unsigned : 1;
1189 unsigned : 1;
1190 unsigned : 1;
1191 } __CMSTATUSbits_t;
1193 extern __at(0x0F6A) volatile __CMSTATUSbits_t CMSTATUSbits;
1195 #define _CMSTATUS_COUT1 0x01
1196 #define _CMSTATUS_COUT2 0x02
1198 //==============================================================================
1201 //==============================================================================
1202 // SSP2CON2 Bits
1204 extern __at(0x0F6B) __sfr SSP2CON2;
1206 typedef union
1208 struct
1210 unsigned SEN : 1;
1211 unsigned RSEN : 1;
1212 unsigned PEN : 1;
1213 unsigned RCEN : 1;
1214 unsigned ACKEN : 1;
1215 unsigned ACKDT : 1;
1216 unsigned ACKSTAT : 1;
1217 unsigned GCEN : 1;
1220 struct
1222 unsigned : 1;
1223 unsigned ADMSK1 : 1;
1224 unsigned ADMSK2 : 1;
1225 unsigned ADMSK3 : 1;
1226 unsigned ADMSK4 : 1;
1227 unsigned ADMSK5 : 1;
1228 unsigned : 1;
1229 unsigned : 1;
1231 } __SSP2CON2bits_t;
1233 extern __at(0x0F6B) volatile __SSP2CON2bits_t SSP2CON2bits;
1235 #define _SSP2CON2_SEN 0x01
1236 #define _SSP2CON2_RSEN 0x02
1237 #define _SSP2CON2_ADMSK1 0x02
1238 #define _SSP2CON2_PEN 0x04
1239 #define _SSP2CON2_ADMSK2 0x04
1240 #define _SSP2CON2_RCEN 0x08
1241 #define _SSP2CON2_ADMSK3 0x08
1242 #define _SSP2CON2_ACKEN 0x10
1243 #define _SSP2CON2_ADMSK4 0x10
1244 #define _SSP2CON2_ACKDT 0x20
1245 #define _SSP2CON2_ADMSK5 0x20
1246 #define _SSP2CON2_ACKSTAT 0x40
1247 #define _SSP2CON2_GCEN 0x80
1249 //==============================================================================
1252 //==============================================================================
1253 // SSP2CON1 Bits
1255 extern __at(0x0F6C) __sfr SSP2CON1;
1257 typedef union
1259 struct
1261 unsigned SSPM0 : 1;
1262 unsigned SSPM1 : 1;
1263 unsigned SSPM2 : 1;
1264 unsigned SSPM3 : 1;
1265 unsigned CKP : 1;
1266 unsigned SSPEN : 1;
1267 unsigned SSPOV : 1;
1268 unsigned WCOL : 1;
1271 struct
1273 unsigned SSPM : 4;
1274 unsigned : 4;
1276 } __SSP2CON1bits_t;
1278 extern __at(0x0F6C) volatile __SSP2CON1bits_t SSP2CON1bits;
1280 #define _SSP2CON1_SSPM0 0x01
1281 #define _SSP2CON1_SSPM1 0x02
1282 #define _SSP2CON1_SSPM2 0x04
1283 #define _SSP2CON1_SSPM3 0x08
1284 #define _SSP2CON1_CKP 0x10
1285 #define _SSP2CON1_SSPEN 0x20
1286 #define _SSP2CON1_SSPOV 0x40
1287 #define _SSP2CON1_WCOL 0x80
1289 //==============================================================================
1292 //==============================================================================
1293 // SSP2STAT Bits
1295 extern __at(0x0F6D) __sfr SSP2STAT;
1297 typedef union
1299 struct
1301 unsigned BF : 1;
1302 unsigned UA : 1;
1303 unsigned R_NOT_W : 1;
1304 unsigned S : 1;
1305 unsigned P : 1;
1306 unsigned D_NOT_A : 1;
1307 unsigned CKE : 1;
1308 unsigned SMP : 1;
1311 struct
1313 unsigned : 1;
1314 unsigned : 1;
1315 unsigned R_W : 1;
1316 unsigned I2C_START : 1;
1317 unsigned I2C_STOP : 1;
1318 unsigned D_A : 1;
1319 unsigned : 1;
1320 unsigned : 1;
1323 struct
1325 unsigned : 1;
1326 unsigned : 1;
1327 unsigned I2C_READ : 1;
1328 unsigned : 1;
1329 unsigned : 1;
1330 unsigned I2C_DAT : 1;
1331 unsigned : 1;
1332 unsigned : 1;
1335 struct
1337 unsigned : 1;
1338 unsigned : 1;
1339 unsigned NOT_W : 1;
1340 unsigned : 1;
1341 unsigned : 1;
1342 unsigned NOT_A : 1;
1343 unsigned : 1;
1344 unsigned : 1;
1347 struct
1349 unsigned : 1;
1350 unsigned : 1;
1351 unsigned NOT_WRITE : 1;
1352 unsigned : 1;
1353 unsigned : 1;
1354 unsigned NOT_ADDRESS : 1;
1355 unsigned : 1;
1356 unsigned : 1;
1359 struct
1361 unsigned : 1;
1362 unsigned : 1;
1363 unsigned READ_WRITE : 1;
1364 unsigned : 1;
1365 unsigned : 1;
1366 unsigned DATA_ADDRESS : 1;
1367 unsigned : 1;
1368 unsigned : 1;
1371 struct
1373 unsigned : 1;
1374 unsigned : 1;
1375 unsigned R : 1;
1376 unsigned : 1;
1377 unsigned : 1;
1378 unsigned D : 1;
1379 unsigned : 1;
1380 unsigned : 1;
1382 } __SSP2STATbits_t;
1384 extern __at(0x0F6D) volatile __SSP2STATbits_t SSP2STATbits;
1386 #define _SSP2STAT_BF 0x01
1387 #define _SSP2STAT_UA 0x02
1388 #define _SSP2STAT_R_NOT_W 0x04
1389 #define _SSP2STAT_R_W 0x04
1390 #define _SSP2STAT_I2C_READ 0x04
1391 #define _SSP2STAT_NOT_W 0x04
1392 #define _SSP2STAT_NOT_WRITE 0x04
1393 #define _SSP2STAT_READ_WRITE 0x04
1394 #define _SSP2STAT_R 0x04
1395 #define _SSP2STAT_S 0x08
1396 #define _SSP2STAT_I2C_START 0x08
1397 #define _SSP2STAT_P 0x10
1398 #define _SSP2STAT_I2C_STOP 0x10
1399 #define _SSP2STAT_D_NOT_A 0x20
1400 #define _SSP2STAT_D_A 0x20
1401 #define _SSP2STAT_I2C_DAT 0x20
1402 #define _SSP2STAT_NOT_A 0x20
1403 #define _SSP2STAT_NOT_ADDRESS 0x20
1404 #define _SSP2STAT_DATA_ADDRESS 0x20
1405 #define _SSP2STAT_D 0x20
1406 #define _SSP2STAT_CKE 0x40
1407 #define _SSP2STAT_SMP 0x80
1409 //==============================================================================
1411 extern __at(0x0F6E) __sfr SSP2ADD;
1413 //==============================================================================
1414 // SSP2MSK Bits
1416 extern __at(0x0F6E) __sfr SSP2MSK;
1418 typedef struct
1420 unsigned MSK0 : 1;
1421 unsigned MSK1 : 1;
1422 unsigned MSK2 : 1;
1423 unsigned MSK3 : 1;
1424 unsigned MSK4 : 1;
1425 unsigned MSK5 : 1;
1426 unsigned MSK6 : 1;
1427 unsigned MSK7 : 1;
1428 } __SSP2MSKbits_t;
1430 extern __at(0x0F6E) volatile __SSP2MSKbits_t SSP2MSKbits;
1432 #define _SSP2MSK_MSK0 0x01
1433 #define _SSP2MSK_MSK1 0x02
1434 #define _SSP2MSK_MSK2 0x04
1435 #define _SSP2MSK_MSK3 0x08
1436 #define _SSP2MSK_MSK4 0x10
1437 #define _SSP2MSK_MSK5 0x20
1438 #define _SSP2MSK_MSK6 0x40
1439 #define _SSP2MSK_MSK7 0x80
1441 //==============================================================================
1443 extern __at(0x0F6F) __sfr SSP2BUF;
1445 //==============================================================================
1446 // CCP5CON Bits
1448 extern __at(0x0F70) __sfr CCP5CON;
1450 typedef union
1452 struct
1454 unsigned CCP5M0 : 1;
1455 unsigned CCP5M1 : 1;
1456 unsigned CCP5M2 : 1;
1457 unsigned CCP5M3 : 1;
1458 unsigned DC5B0 : 1;
1459 unsigned DC5B1 : 1;
1460 unsigned : 1;
1461 unsigned : 1;
1464 struct
1466 unsigned : 1;
1467 unsigned : 1;
1468 unsigned : 1;
1469 unsigned : 1;
1470 unsigned DCCP5Y : 1;
1471 unsigned DCCP5X : 1;
1472 unsigned : 1;
1473 unsigned : 1;
1476 struct
1478 unsigned : 1;
1479 unsigned : 1;
1480 unsigned : 1;
1481 unsigned : 1;
1482 unsigned DC5Y : 1;
1483 unsigned DC5X : 1;
1484 unsigned : 1;
1485 unsigned : 1;
1488 struct
1490 unsigned CCP5M : 4;
1491 unsigned : 4;
1494 struct
1496 unsigned : 4;
1497 unsigned DC5B : 2;
1498 unsigned : 2;
1500 } __CCP5CONbits_t;
1502 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits;
1504 #define _CCP5M0 0x01
1505 #define _CCP5M1 0x02
1506 #define _CCP5M2 0x04
1507 #define _CCP5M3 0x08
1508 #define _DC5B0 0x10
1509 #define _DCCP5Y 0x10
1510 #define _DC5Y 0x10
1511 #define _DC5B1 0x20
1512 #define _DCCP5X 0x20
1513 #define _DC5X 0x20
1515 //==============================================================================
1517 extern __at(0x0F71) __sfr CCPR5;
1518 extern __at(0x0F71) __sfr CCPR5L;
1519 extern __at(0x0F72) __sfr CCPR5H;
1521 //==============================================================================
1522 // CCP4CON Bits
1524 extern __at(0x0F73) __sfr CCP4CON;
1526 typedef union
1528 struct
1530 unsigned CCP4M0 : 1;
1531 unsigned CCP4M1 : 1;
1532 unsigned CCP4M2 : 1;
1533 unsigned CCP4M3 : 1;
1534 unsigned DC4B0 : 1;
1535 unsigned DC4B1 : 1;
1536 unsigned : 1;
1537 unsigned : 1;
1540 struct
1542 unsigned : 1;
1543 unsigned : 1;
1544 unsigned : 1;
1545 unsigned : 1;
1546 unsigned DCCP4Y : 1;
1547 unsigned DCCP4X : 1;
1548 unsigned : 1;
1549 unsigned : 1;
1552 struct
1554 unsigned : 1;
1555 unsigned : 1;
1556 unsigned : 1;
1557 unsigned : 1;
1558 unsigned DC4Y : 1;
1559 unsigned DC4X : 1;
1560 unsigned : 1;
1561 unsigned : 1;
1564 struct
1566 unsigned CCP4M : 4;
1567 unsigned : 4;
1570 struct
1572 unsigned : 4;
1573 unsigned DC4B : 2;
1574 unsigned : 2;
1576 } __CCP4CONbits_t;
1578 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits;
1580 #define _CCP4M0 0x01
1581 #define _CCP4M1 0x02
1582 #define _CCP4M2 0x04
1583 #define _CCP4M3 0x08
1584 #define _DC4B0 0x10
1585 #define _DCCP4Y 0x10
1586 #define _DC4Y 0x10
1587 #define _DC4B1 0x20
1588 #define _DCCP4X 0x20
1589 #define _DC4X 0x20
1591 //==============================================================================
1593 extern __at(0x0F74) __sfr CCPR4;
1594 extern __at(0x0F74) __sfr CCPR4L;
1595 extern __at(0x0F75) __sfr CCPR4H;
1597 //==============================================================================
1598 // T4CON Bits
1600 extern __at(0x0F76) __sfr T4CON;
1602 typedef union
1604 struct
1606 unsigned T4CKPS0 : 1;
1607 unsigned T4CKPS1 : 1;
1608 unsigned TMR4ON : 1;
1609 unsigned T4OUTPS0 : 1;
1610 unsigned T4OUTPS1 : 1;
1611 unsigned T4OUTPS2 : 1;
1612 unsigned T4OUTPS3 : 1;
1613 unsigned : 1;
1616 struct
1618 unsigned T4CKPS : 2;
1619 unsigned : 6;
1622 struct
1624 unsigned : 3;
1625 unsigned T4OUTPS : 4;
1626 unsigned : 1;
1628 } __T4CONbits_t;
1630 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
1632 #define _T4CKPS0 0x01
1633 #define _T4CKPS1 0x02
1634 #define _TMR4ON 0x04
1635 #define _T4OUTPS0 0x08
1636 #define _T4OUTPS1 0x10
1637 #define _T4OUTPS2 0x20
1638 #define _T4OUTPS3 0x40
1640 //==============================================================================
1643 //==============================================================================
1644 // CVRCON Bits
1646 extern __at(0x0F77) __sfr CVRCON;
1648 typedef union
1650 struct
1652 unsigned CVR0 : 1;
1653 unsigned CVR1 : 1;
1654 unsigned CVR2 : 1;
1655 unsigned CVR3 : 1;
1656 unsigned CVRSS : 1;
1657 unsigned CVRR : 1;
1658 unsigned CVROE : 1;
1659 unsigned CVREN : 1;
1662 struct
1664 unsigned CVR : 4;
1665 unsigned : 4;
1667 } __CVRCONbits_t;
1669 extern __at(0x0F77) volatile __CVRCONbits_t CVRCONbits;
1671 #define _CVR0 0x01
1672 #define _CVR1 0x02
1673 #define _CVR2 0x04
1674 #define _CVR3 0x08
1675 #define _CVRSS 0x10
1676 #define _CVRR 0x20
1677 #define _CVROE 0x40
1678 #define _CVREN 0x80
1680 //==============================================================================
1682 extern __at(0x0F77) __sfr PR4;
1683 extern __at(0x0F78) __sfr TMR4;
1685 //==============================================================================
1686 // T3CON Bits
1688 extern __at(0x0F79) __sfr T3CON;
1690 typedef union
1692 struct
1694 unsigned TMR3ON : 1;
1695 unsigned TMR3CS : 1;
1696 unsigned NOT_T3SYNC : 1;
1697 unsigned T3CCP1 : 1;
1698 unsigned T3CKPS0 : 1;
1699 unsigned T3CKPS1 : 1;
1700 unsigned T3CCP2 : 1;
1701 unsigned RD16 : 1;
1704 struct
1706 unsigned : 1;
1707 unsigned : 1;
1708 unsigned T3SYNC : 1;
1709 unsigned : 1;
1710 unsigned : 1;
1711 unsigned : 1;
1712 unsigned : 1;
1713 unsigned : 1;
1716 struct
1718 unsigned : 1;
1719 unsigned : 1;
1720 unsigned T3INSYNC : 1;
1721 unsigned : 1;
1722 unsigned : 1;
1723 unsigned : 1;
1724 unsigned : 1;
1725 unsigned : 1;
1728 struct
1730 unsigned : 4;
1731 unsigned T3CKPS : 2;
1732 unsigned : 2;
1734 } __T3CONbits_t;
1736 extern __at(0x0F79) volatile __T3CONbits_t T3CONbits;
1738 #define _T3CON_TMR3ON 0x01
1739 #define _T3CON_TMR3CS 0x02
1740 #define _T3CON_NOT_T3SYNC 0x04
1741 #define _T3CON_T3SYNC 0x04
1742 #define _T3CON_T3INSYNC 0x04
1743 #define _T3CON_T3CCP1 0x08
1744 #define _T3CON_T3CKPS0 0x10
1745 #define _T3CON_T3CKPS1 0x20
1746 #define _T3CON_T3CCP2 0x40
1747 #define _T3CON_RD16 0x80
1749 //==============================================================================
1751 extern __at(0x0F7A) __sfr TMR3;
1752 extern __at(0x0F7A) __sfr TMR3L;
1753 extern __at(0x0F7B) __sfr TMR3H;
1755 //==============================================================================
1756 // BAUDCON2 Bits
1758 extern __at(0x0F7C) __sfr BAUDCON2;
1760 typedef union
1762 struct
1764 unsigned ABDEN : 1;
1765 unsigned WUE : 1;
1766 unsigned : 1;
1767 unsigned BRG16 : 1;
1768 unsigned TXCKP : 1;
1769 unsigned RXDTP : 1;
1770 unsigned RCIDL : 1;
1771 unsigned ABDOVF : 1;
1774 struct
1776 unsigned : 1;
1777 unsigned : 1;
1778 unsigned : 1;
1779 unsigned : 1;
1780 unsigned SCKP : 1;
1781 unsigned DTRXP : 1;
1782 unsigned RCMT : 1;
1783 unsigned : 1;
1785 } __BAUDCON2bits_t;
1787 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
1789 #define _BAUDCON2_ABDEN 0x01
1790 #define _BAUDCON2_WUE 0x02
1791 #define _BAUDCON2_BRG16 0x08
1792 #define _BAUDCON2_TXCKP 0x10
1793 #define _BAUDCON2_SCKP 0x10
1794 #define _BAUDCON2_RXDTP 0x20
1795 #define _BAUDCON2_DTRXP 0x20
1796 #define _BAUDCON2_RCIDL 0x40
1797 #define _BAUDCON2_RCMT 0x40
1798 #define _BAUDCON2_ABDOVF 0x80
1800 //==============================================================================
1802 extern __at(0x0F7D) __sfr SPBRGH2;
1804 //==============================================================================
1805 // BAUDCON Bits
1807 extern __at(0x0F7E) __sfr BAUDCON;
1809 typedef union
1811 struct
1813 unsigned ABDEN : 1;
1814 unsigned WUE : 1;
1815 unsigned : 1;
1816 unsigned BRG16 : 1;
1817 unsigned TXCKP : 1;
1818 unsigned RXDTP : 1;
1819 unsigned RCIDL : 1;
1820 unsigned ABDOVF : 1;
1823 struct
1825 unsigned : 1;
1826 unsigned : 1;
1827 unsigned : 1;
1828 unsigned : 1;
1829 unsigned SCKP : 1;
1830 unsigned DTRXP : 1;
1831 unsigned RCMT : 1;
1832 unsigned : 1;
1834 } __BAUDCONbits_t;
1836 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1838 #define _ABDEN 0x01
1839 #define _WUE 0x02
1840 #define _BRG16 0x08
1841 #define _TXCKP 0x10
1842 #define _SCKP 0x10
1843 #define _RXDTP 0x20
1844 #define _DTRXP 0x20
1845 #define _RCIDL 0x40
1846 #define _RCMT 0x40
1847 #define _ABDOVF 0x80
1849 //==============================================================================
1852 //==============================================================================
1853 // BAUDCON1 Bits
1855 extern __at(0x0F7E) __sfr BAUDCON1;
1857 typedef union
1859 struct
1861 unsigned ABDEN : 1;
1862 unsigned WUE : 1;
1863 unsigned : 1;
1864 unsigned BRG16 : 1;
1865 unsigned TXCKP : 1;
1866 unsigned RXDTP : 1;
1867 unsigned RCIDL : 1;
1868 unsigned ABDOVF : 1;
1871 struct
1873 unsigned : 1;
1874 unsigned : 1;
1875 unsigned : 1;
1876 unsigned : 1;
1877 unsigned SCKP : 1;
1878 unsigned DTRXP : 1;
1879 unsigned RCMT : 1;
1880 unsigned : 1;
1882 } __BAUDCON1bits_t;
1884 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1886 #define _BAUDCON1_ABDEN 0x01
1887 #define _BAUDCON1_WUE 0x02
1888 #define _BAUDCON1_BRG16 0x08
1889 #define _BAUDCON1_TXCKP 0x10
1890 #define _BAUDCON1_SCKP 0x10
1891 #define _BAUDCON1_RXDTP 0x20
1892 #define _BAUDCON1_DTRXP 0x20
1893 #define _BAUDCON1_RCIDL 0x40
1894 #define _BAUDCON1_RCMT 0x40
1895 #define _BAUDCON1_ABDOVF 0x80
1897 //==============================================================================
1899 extern __at(0x0F7F) __sfr SPBRGH;
1900 extern __at(0x0F7F) __sfr SPBRGH1;
1902 //==============================================================================
1903 // PORTA Bits
1905 extern __at(0x0F80) __sfr PORTA;
1907 typedef union
1909 struct
1911 unsigned RA0 : 1;
1912 unsigned RA1 : 1;
1913 unsigned RA2 : 1;
1914 unsigned RA3 : 1;
1915 unsigned RA4 : 1;
1916 unsigned RA5 : 1;
1917 unsigned RA6 : 1;
1918 unsigned RA7 : 1;
1921 struct
1923 unsigned AN0 : 1;
1924 unsigned AN1 : 1;
1925 unsigned AN2 : 1;
1926 unsigned AN3 : 1;
1927 unsigned T0CKI : 1;
1928 unsigned AN4 : 1;
1929 unsigned OSC2 : 1;
1930 unsigned : 1;
1933 struct
1935 unsigned : 1;
1936 unsigned : 1;
1937 unsigned VREFM : 1;
1938 unsigned VREFP : 1;
1939 unsigned PMD5 : 1;
1940 unsigned C2INA : 1;
1941 unsigned CLKO : 1;
1942 unsigned : 1;
1945 struct
1947 unsigned : 1;
1948 unsigned : 1;
1949 unsigned : 1;
1950 unsigned : 1;
1951 unsigned : 1;
1952 unsigned PMD4 : 1;
1953 unsigned : 1;
1954 unsigned : 1;
1956 } __PORTAbits_t;
1958 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1960 #define _PORTA_RA0 0x01
1961 #define _PORTA_AN0 0x01
1962 #define _PORTA_RA1 0x02
1963 #define _PORTA_AN1 0x02
1964 #define _PORTA_RA2 0x04
1965 #define _PORTA_AN2 0x04
1966 #define _PORTA_VREFM 0x04
1967 #define _PORTA_RA3 0x08
1968 #define _PORTA_AN3 0x08
1969 #define _PORTA_VREFP 0x08
1970 #define _PORTA_RA4 0x10
1971 #define _PORTA_T0CKI 0x10
1972 #define _PORTA_PMD5 0x10
1973 #define _PORTA_RA5 0x20
1974 #define _PORTA_AN4 0x20
1975 #define _PORTA_C2INA 0x20
1976 #define _PORTA_PMD4 0x20
1977 #define _PORTA_RA6 0x40
1978 #define _PORTA_OSC2 0x40
1979 #define _PORTA_CLKO 0x40
1980 #define _PORTA_RA7 0x80
1982 //==============================================================================
1985 //==============================================================================
1986 // PORTB Bits
1988 extern __at(0x0F81) __sfr PORTB;
1990 typedef union
1992 struct
1994 unsigned RB0 : 1;
1995 unsigned RB1 : 1;
1996 unsigned RB2 : 1;
1997 unsigned RB3 : 1;
1998 unsigned RB4 : 1;
1999 unsigned RB5 : 1;
2000 unsigned RB6 : 1;
2001 unsigned RB7 : 1;
2004 struct
2006 unsigned INT0 : 1;
2007 unsigned INT1 : 1;
2008 unsigned INT2 : 1;
2009 unsigned INT3 : 1;
2010 unsigned KBI0 : 1;
2011 unsigned KBI1 : 1;
2012 unsigned KBI2 : 1;
2013 unsigned KBI3 : 1;
2016 struct
2018 unsigned FLT0 : 1;
2019 unsigned PMA4 : 1;
2020 unsigned PMA3 : 1;
2021 unsigned PMA2 : 1;
2022 unsigned PMA1 : 1;
2023 unsigned PMA0 : 1;
2024 unsigned PGD : 1;
2025 unsigned : 1;
2028 struct
2030 unsigned : 1;
2031 unsigned : 1;
2032 unsigned : 1;
2033 unsigned CCP2 : 1;
2034 unsigned : 1;
2035 unsigned PGC : 1;
2036 unsigned : 1;
2037 unsigned : 1;
2040 struct
2042 unsigned INT : 4;
2043 unsigned : 4;
2046 struct
2048 unsigned : 4;
2049 unsigned KBI : 4;
2051 } __PORTBbits_t;
2053 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
2055 #define _PORTB_RB0 0x01
2056 #define _PORTB_INT0 0x01
2057 #define _PORTB_FLT0 0x01
2058 #define _PORTB_RB1 0x02
2059 #define _PORTB_INT1 0x02
2060 #define _PORTB_PMA4 0x02
2061 #define _PORTB_RB2 0x04
2062 #define _PORTB_INT2 0x04
2063 #define _PORTB_PMA3 0x04
2064 #define _PORTB_RB3 0x08
2065 #define _PORTB_INT3 0x08
2066 #define _PORTB_PMA2 0x08
2067 #define _PORTB_CCP2 0x08
2068 #define _PORTB_RB4 0x10
2069 #define _PORTB_KBI0 0x10
2070 #define _PORTB_PMA1 0x10
2071 #define _PORTB_RB5 0x20
2072 #define _PORTB_KBI1 0x20
2073 #define _PORTB_PMA0 0x20
2074 #define _PORTB_PGC 0x20
2075 #define _PORTB_RB6 0x40
2076 #define _PORTB_KBI2 0x40
2077 #define _PORTB_PGD 0x40
2078 #define _PORTB_RB7 0x80
2079 #define _PORTB_KBI3 0x80
2081 //==============================================================================
2084 //==============================================================================
2085 // PORTC Bits
2087 extern __at(0x0F82) __sfr PORTC;
2089 typedef union
2091 struct
2093 unsigned RC0 : 1;
2094 unsigned RC1 : 1;
2095 unsigned RC2 : 1;
2096 unsigned RC3 : 1;
2097 unsigned RC4 : 1;
2098 unsigned RC5 : 1;
2099 unsigned RC6 : 1;
2100 unsigned RC7 : 1;
2103 struct
2105 unsigned T1OSO : 1;
2106 unsigned T1OSI : 1;
2107 unsigned CCP1 : 1;
2108 unsigned SCK : 1;
2109 unsigned SDI : 1;
2110 unsigned SDO : 1;
2111 unsigned TX : 1;
2112 unsigned RX : 1;
2115 struct
2117 unsigned T13CKI : 1;
2118 unsigned CCP2 : 1;
2119 unsigned : 1;
2120 unsigned SCL : 1;
2121 unsigned SDA : 1;
2122 unsigned C2OUT : 1;
2123 unsigned CK : 1;
2124 unsigned : 1;
2126 } __PORTCbits_t;
2128 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
2130 #define _PORTC_RC0 0x01
2131 #define _PORTC_T1OSO 0x01
2132 #define _PORTC_T13CKI 0x01
2133 #define _PORTC_RC1 0x02
2134 #define _PORTC_T1OSI 0x02
2135 #define _PORTC_CCP2 0x02
2136 #define _PORTC_RC2 0x04
2137 #define _PORTC_CCP1 0x04
2138 #define _PORTC_RC3 0x08
2139 #define _PORTC_SCK 0x08
2140 #define _PORTC_SCL 0x08
2141 #define _PORTC_RC4 0x10
2142 #define _PORTC_SDI 0x10
2143 #define _PORTC_SDA 0x10
2144 #define _PORTC_RC5 0x20
2145 #define _PORTC_SDO 0x20
2146 #define _PORTC_C2OUT 0x20
2147 #define _PORTC_RC6 0x40
2148 #define _PORTC_TX 0x40
2149 #define _PORTC_CK 0x40
2150 #define _PORTC_RC7 0x80
2151 #define _PORTC_RX 0x80
2153 //==============================================================================
2156 //==============================================================================
2157 // PORTD Bits
2159 extern __at(0x0F83) __sfr PORTD;
2161 typedef union
2163 struct
2165 unsigned RD0 : 1;
2166 unsigned RD1 : 1;
2167 unsigned RD2 : 1;
2168 unsigned RD3 : 1;
2169 unsigned RD4 : 1;
2170 unsigned RD5 : 1;
2171 unsigned RD6 : 1;
2172 unsigned RD7 : 1;
2175 struct
2177 unsigned PMD0 : 1;
2178 unsigned PMD1 : 1;
2179 unsigned PMD2 : 1;
2180 unsigned PMD3 : 1;
2181 unsigned PMD4 : 1;
2182 unsigned PMD5 : 1;
2183 unsigned PMD6 : 1;
2184 unsigned PMD7 : 1;
2187 struct
2189 unsigned AD0 : 1;
2190 unsigned AD1 : 1;
2191 unsigned AD2 : 1;
2192 unsigned AD3 : 1;
2193 unsigned AD4 : 1;
2194 unsigned AD5 : 1;
2195 unsigned AD6 : 1;
2196 unsigned AD7 : 1;
2199 struct
2201 unsigned : 1;
2202 unsigned : 1;
2203 unsigned : 1;
2204 unsigned : 1;
2205 unsigned SDO2 : 1;
2206 unsigned SDA2 : 1;
2207 unsigned SCL2 : 1;
2208 unsigned SS2 : 1;
2211 struct
2213 unsigned : 1;
2214 unsigned : 1;
2215 unsigned : 1;
2216 unsigned : 1;
2217 unsigned : 1;
2218 unsigned SDI2 : 1;
2219 unsigned SCK2 : 1;
2220 unsigned : 1;
2222 } __PORTDbits_t;
2224 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
2226 #define _PORTD_RD0 0x01
2227 #define _PORTD_PMD0 0x01
2228 #define _PORTD_AD0 0x01
2229 #define _PORTD_RD1 0x02
2230 #define _PORTD_PMD1 0x02
2231 #define _PORTD_AD1 0x02
2232 #define _PORTD_RD2 0x04
2233 #define _PORTD_PMD2 0x04
2234 #define _PORTD_AD2 0x04
2235 #define _PORTD_RD3 0x08
2236 #define _PORTD_PMD3 0x08
2237 #define _PORTD_AD3 0x08
2238 #define _PORTD_RD4 0x10
2239 #define _PORTD_PMD4 0x10
2240 #define _PORTD_AD4 0x10
2241 #define _PORTD_SDO2 0x10
2242 #define _PORTD_RD5 0x20
2243 #define _PORTD_PMD5 0x20
2244 #define _PORTD_AD5 0x20
2245 #define _PORTD_SDA2 0x20
2246 #define _PORTD_SDI2 0x20
2247 #define _PORTD_RD6 0x40
2248 #define _PORTD_PMD6 0x40
2249 #define _PORTD_AD6 0x40
2250 #define _PORTD_SCL2 0x40
2251 #define _PORTD_SCK2 0x40
2252 #define _PORTD_RD7 0x80
2253 #define _PORTD_PMD7 0x80
2254 #define _PORTD_AD7 0x80
2255 #define _PORTD_SS2 0x80
2257 //==============================================================================
2260 //==============================================================================
2261 // PORTE Bits
2263 extern __at(0x0F84) __sfr PORTE;
2265 typedef union
2267 struct
2269 unsigned RE0 : 1;
2270 unsigned RE1 : 1;
2271 unsigned RE2 : 1;
2272 unsigned RE3 : 1;
2273 unsigned RE4 : 1;
2274 unsigned RE5 : 1;
2275 unsigned RE6 : 1;
2276 unsigned RE7 : 1;
2279 struct
2281 unsigned AD8 : 1;
2282 unsigned AD9 : 1;
2283 unsigned AD10 : 1;
2284 unsigned AD11 : 1;
2285 unsigned AD12 : 1;
2286 unsigned AD13 : 1;
2287 unsigned AD14 : 1;
2288 unsigned AD15 : 1;
2291 struct
2293 unsigned PMRD : 1;
2294 unsigned PMWR : 1;
2295 unsigned PMBE : 1;
2296 unsigned PMA13 : 1;
2297 unsigned PMA12 : 1;
2298 unsigned PMA11 : 1;
2299 unsigned PMA10 : 1;
2300 unsigned PMA9 : 1;
2303 struct
2305 unsigned : 1;
2306 unsigned : 1;
2307 unsigned : 1;
2308 unsigned REFO : 1;
2309 unsigned : 1;
2310 unsigned : 1;
2311 unsigned : 1;
2312 unsigned CCP2 : 1;
2314 } __PORTEbits_t;
2316 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
2318 #define _PORTE_RE0 0x01
2319 #define _PORTE_AD8 0x01
2320 #define _PORTE_PMRD 0x01
2321 #define _PORTE_RE1 0x02
2322 #define _PORTE_AD9 0x02
2323 #define _PORTE_PMWR 0x02
2324 #define _PORTE_RE2 0x04
2325 #define _PORTE_AD10 0x04
2326 #define _PORTE_PMBE 0x04
2327 #define _PORTE_RE3 0x08
2328 #define _PORTE_AD11 0x08
2329 #define _PORTE_PMA13 0x08
2330 #define _PORTE_REFO 0x08
2331 #define _PORTE_RE4 0x10
2332 #define _PORTE_AD12 0x10
2333 #define _PORTE_PMA12 0x10
2334 #define _PORTE_RE5 0x20
2335 #define _PORTE_AD13 0x20
2336 #define _PORTE_PMA11 0x20
2337 #define _PORTE_RE6 0x40
2338 #define _PORTE_AD14 0x40
2339 #define _PORTE_PMA10 0x40
2340 #define _PORTE_RE7 0x80
2341 #define _PORTE_AD15 0x80
2342 #define _PORTE_PMA9 0x80
2343 #define _PORTE_CCP2 0x80
2345 //==============================================================================
2348 //==============================================================================
2349 // PORTF Bits
2351 extern __at(0x0F85) __sfr PORTF;
2353 typedef union
2355 struct
2357 unsigned : 1;
2358 unsigned : 1;
2359 unsigned RF2 : 1;
2360 unsigned RF3 : 1;
2361 unsigned RF4 : 1;
2362 unsigned RF5 : 1;
2363 unsigned RF6 : 1;
2364 unsigned RF7 : 1;
2367 struct
2369 unsigned : 1;
2370 unsigned : 1;
2371 unsigned AN7 : 1;
2372 unsigned : 1;
2373 unsigned : 1;
2374 unsigned AN10 : 1;
2375 unsigned AN11 : 1;
2376 unsigned SS : 1;
2379 struct
2381 unsigned : 1;
2382 unsigned : 1;
2383 unsigned C2INB : 1;
2384 unsigned : 1;
2385 unsigned : 1;
2386 unsigned CVREF : 1;
2387 unsigned C1INA : 1;
2388 unsigned C1OUT : 1;
2391 struct
2393 unsigned : 1;
2394 unsigned : 1;
2395 unsigned PMA5 : 1;
2396 unsigned : 1;
2397 unsigned : 1;
2398 unsigned C1INB : 1;
2399 unsigned PMD1 : 1;
2400 unsigned PMD0 : 1;
2403 struct
2405 unsigned : 1;
2406 unsigned : 1;
2407 unsigned : 1;
2408 unsigned : 1;
2409 unsigned : 1;
2410 unsigned PMD2 : 1;
2411 unsigned : 1;
2412 unsigned : 1;
2414 } __PORTFbits_t;
2416 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
2418 #define _PORTF_RF2 0x04
2419 #define _PORTF_AN7 0x04
2420 #define _PORTF_C2INB 0x04
2421 #define _PORTF_PMA5 0x04
2422 #define _PORTF_RF3 0x08
2423 #define _PORTF_RF4 0x10
2424 #define _PORTF_RF5 0x20
2425 #define _PORTF_AN10 0x20
2426 #define _PORTF_CVREF 0x20
2427 #define _PORTF_C1INB 0x20
2428 #define _PORTF_PMD2 0x20
2429 #define _PORTF_RF6 0x40
2430 #define _PORTF_AN11 0x40
2431 #define _PORTF_C1INA 0x40
2432 #define _PORTF_PMD1 0x40
2433 #define _PORTF_RF7 0x80
2434 #define _PORTF_SS 0x80
2435 #define _PORTF_C1OUT 0x80
2436 #define _PORTF_PMD0 0x80
2438 //==============================================================================
2441 //==============================================================================
2442 // PORTG Bits
2444 extern __at(0x0F86) __sfr PORTG;
2446 typedef union
2448 struct
2450 unsigned RG0 : 1;
2451 unsigned RG1 : 1;
2452 unsigned RG2 : 1;
2453 unsigned RG3 : 1;
2454 unsigned RG4 : 1;
2455 unsigned RJPU : 1;
2456 unsigned REPU : 1;
2457 unsigned RDPU : 1;
2460 struct
2462 unsigned CCP3 : 1;
2463 unsigned TX2 : 1;
2464 unsigned RX2 : 1;
2465 unsigned CCP4 : 1;
2466 unsigned CCP5 : 1;
2467 unsigned : 1;
2468 unsigned : 1;
2469 unsigned : 1;
2472 struct
2474 unsigned PMA8 : 1;
2475 unsigned CK2 : 1;
2476 unsigned DT2 : 1;
2477 unsigned PMCS1 : 1;
2478 unsigned PMCS2 : 1;
2479 unsigned : 1;
2480 unsigned : 1;
2481 unsigned : 1;
2484 struct
2486 unsigned : 1;
2487 unsigned PMA7 : 1;
2488 unsigned PMA6 : 1;
2489 unsigned : 1;
2490 unsigned : 1;
2491 unsigned : 1;
2492 unsigned : 1;
2493 unsigned : 1;
2496 struct
2498 unsigned RG : 5;
2499 unsigned : 3;
2501 } __PORTGbits_t;
2503 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
2505 #define _PORTG_RG0 0x01
2506 #define _PORTG_CCP3 0x01
2507 #define _PORTG_PMA8 0x01
2508 #define _PORTG_RG1 0x02
2509 #define _PORTG_TX2 0x02
2510 #define _PORTG_CK2 0x02
2511 #define _PORTG_PMA7 0x02
2512 #define _PORTG_RG2 0x04
2513 #define _PORTG_RX2 0x04
2514 #define _PORTG_DT2 0x04
2515 #define _PORTG_PMA6 0x04
2516 #define _PORTG_RG3 0x08
2517 #define _PORTG_CCP4 0x08
2518 #define _PORTG_PMCS1 0x08
2519 #define _PORTG_RG4 0x10
2520 #define _PORTG_CCP5 0x10
2521 #define _PORTG_PMCS2 0x10
2522 #define _PORTG_RJPU 0x20
2523 #define _PORTG_REPU 0x40
2524 #define _PORTG_RDPU 0x80
2526 //==============================================================================
2529 //==============================================================================
2530 // PORTH Bits
2532 extern __at(0x0F87) __sfr PORTH;
2534 typedef union
2536 struct
2538 unsigned RH0 : 1;
2539 unsigned RH1 : 1;
2540 unsigned RH2 : 1;
2541 unsigned RH3 : 1;
2542 unsigned RH4 : 1;
2543 unsigned RH5 : 1;
2544 unsigned RH6 : 1;
2545 unsigned RH7 : 1;
2548 struct
2550 unsigned A16 : 1;
2551 unsigned A17 : 1;
2552 unsigned A18 : 1;
2553 unsigned A19 : 1;
2554 unsigned AN12 : 1;
2555 unsigned AN13 : 1;
2556 unsigned AN14 : 1;
2557 unsigned AN15 : 1;
2560 struct
2562 unsigned : 1;
2563 unsigned : 1;
2564 unsigned PMD7 : 1;
2565 unsigned PMD6 : 1;
2566 unsigned PMD3 : 1;
2567 unsigned PMBE : 1;
2568 unsigned PMRD : 1;
2569 unsigned PMWR : 1;
2572 struct
2574 unsigned : 1;
2575 unsigned : 1;
2576 unsigned : 1;
2577 unsigned : 1;
2578 unsigned C2INC : 1;
2579 unsigned C2IND : 1;
2580 unsigned C1INC : 1;
2581 unsigned : 1;
2583 } __PORTHbits_t;
2585 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
2587 #define _PORTH_RH0 0x01
2588 #define _PORTH_A16 0x01
2589 #define _PORTH_RH1 0x02
2590 #define _PORTH_A17 0x02
2591 #define _PORTH_RH2 0x04
2592 #define _PORTH_A18 0x04
2593 #define _PORTH_PMD7 0x04
2594 #define _PORTH_RH3 0x08
2595 #define _PORTH_A19 0x08
2596 #define _PORTH_PMD6 0x08
2597 #define _PORTH_RH4 0x10
2598 #define _PORTH_AN12 0x10
2599 #define _PORTH_PMD3 0x10
2600 #define _PORTH_C2INC 0x10
2601 #define _PORTH_RH5 0x20
2602 #define _PORTH_AN13 0x20
2603 #define _PORTH_PMBE 0x20
2604 #define _PORTH_C2IND 0x20
2605 #define _PORTH_RH6 0x40
2606 #define _PORTH_AN14 0x40
2607 #define _PORTH_PMRD 0x40
2608 #define _PORTH_C1INC 0x40
2609 #define _PORTH_RH7 0x80
2610 #define _PORTH_AN15 0x80
2611 #define _PORTH_PMWR 0x80
2613 //==============================================================================
2616 //==============================================================================
2617 // PORTJ Bits
2619 extern __at(0x0F88) __sfr PORTJ;
2621 typedef union
2623 struct
2625 unsigned RJ0 : 1;
2626 unsigned RJ1 : 1;
2627 unsigned RJ2 : 1;
2628 unsigned RJ3 : 1;
2629 unsigned RJ4 : 1;
2630 unsigned RJ5 : 1;
2631 unsigned RJ6 : 1;
2632 unsigned RJ7 : 1;
2635 struct
2637 unsigned ALE : 1;
2638 unsigned OE : 1;
2639 unsigned WRL : 1;
2640 unsigned WRH : 1;
2641 unsigned BA0 : 1;
2642 unsigned CE : 1;
2643 unsigned LB : 1;
2644 unsigned UB : 1;
2646 } __PORTJbits_t;
2648 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
2650 #define _PORTJ_RJ0 0x01
2651 #define _PORTJ_ALE 0x01
2652 #define _PORTJ_RJ1 0x02
2653 #define _PORTJ_OE 0x02
2654 #define _PORTJ_RJ2 0x04
2655 #define _PORTJ_WRL 0x04
2656 #define _PORTJ_RJ3 0x08
2657 #define _PORTJ_WRH 0x08
2658 #define _PORTJ_RJ4 0x10
2659 #define _PORTJ_BA0 0x10
2660 #define _PORTJ_RJ5 0x20
2661 #define _PORTJ_CE 0x20
2662 #define _PORTJ_RJ6 0x40
2663 #define _PORTJ_LB 0x40
2664 #define _PORTJ_RJ7 0x80
2665 #define _PORTJ_UB 0x80
2667 //==============================================================================
2670 //==============================================================================
2671 // LATA Bits
2673 extern __at(0x0F89) __sfr LATA;
2675 typedef struct
2677 unsigned LATA0 : 1;
2678 unsigned LATA1 : 1;
2679 unsigned LATA2 : 1;
2680 unsigned LATA3 : 1;
2681 unsigned LATA4 : 1;
2682 unsigned LATA5 : 1;
2683 unsigned LATA6 : 1;
2684 unsigned LATA7 : 1;
2685 } __LATAbits_t;
2687 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
2689 #define _LATA0 0x01
2690 #define _LATA1 0x02
2691 #define _LATA2 0x04
2692 #define _LATA3 0x08
2693 #define _LATA4 0x10
2694 #define _LATA5 0x20
2695 #define _LATA6 0x40
2696 #define _LATA7 0x80
2698 //==============================================================================
2701 //==============================================================================
2702 // LATB Bits
2704 extern __at(0x0F8A) __sfr LATB;
2706 typedef struct
2708 unsigned LATB0 : 1;
2709 unsigned LATB1 : 1;
2710 unsigned LATB2 : 1;
2711 unsigned LATB3 : 1;
2712 unsigned LATB4 : 1;
2713 unsigned LATB5 : 1;
2714 unsigned LATB6 : 1;
2715 unsigned LATB7 : 1;
2716 } __LATBbits_t;
2718 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
2720 #define _LATB0 0x01
2721 #define _LATB1 0x02
2722 #define _LATB2 0x04
2723 #define _LATB3 0x08
2724 #define _LATB4 0x10
2725 #define _LATB5 0x20
2726 #define _LATB6 0x40
2727 #define _LATB7 0x80
2729 //==============================================================================
2732 //==============================================================================
2733 // LATC Bits
2735 extern __at(0x0F8B) __sfr LATC;
2737 typedef struct
2739 unsigned LATC0 : 1;
2740 unsigned LATC1 : 1;
2741 unsigned LATC2 : 1;
2742 unsigned LATC3 : 1;
2743 unsigned LATC4 : 1;
2744 unsigned LATC5 : 1;
2745 unsigned LATC6 : 1;
2746 unsigned LATC7 : 1;
2747 } __LATCbits_t;
2749 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
2751 #define _LATC0 0x01
2752 #define _LATC1 0x02
2753 #define _LATC2 0x04
2754 #define _LATC3 0x08
2755 #define _LATC4 0x10
2756 #define _LATC5 0x20
2757 #define _LATC6 0x40
2758 #define _LATC7 0x80
2760 //==============================================================================
2763 //==============================================================================
2764 // LATD Bits
2766 extern __at(0x0F8C) __sfr LATD;
2768 typedef struct
2770 unsigned LATD0 : 1;
2771 unsigned LATD1 : 1;
2772 unsigned LATD2 : 1;
2773 unsigned LATD3 : 1;
2774 unsigned LATD4 : 1;
2775 unsigned LATD5 : 1;
2776 unsigned LATD6 : 1;
2777 unsigned LATD7 : 1;
2778 } __LATDbits_t;
2780 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
2782 #define _LATD0 0x01
2783 #define _LATD1 0x02
2784 #define _LATD2 0x04
2785 #define _LATD3 0x08
2786 #define _LATD4 0x10
2787 #define _LATD5 0x20
2788 #define _LATD6 0x40
2789 #define _LATD7 0x80
2791 //==============================================================================
2794 //==============================================================================
2795 // LATE Bits
2797 extern __at(0x0F8D) __sfr LATE;
2799 typedef struct
2801 unsigned LATE0 : 1;
2802 unsigned LATE1 : 1;
2803 unsigned LATE2 : 1;
2804 unsigned LATE3 : 1;
2805 unsigned LATE4 : 1;
2806 unsigned LATE5 : 1;
2807 unsigned LATE6 : 1;
2808 unsigned LATE7 : 1;
2809 } __LATEbits_t;
2811 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
2813 #define _LATE0 0x01
2814 #define _LATE1 0x02
2815 #define _LATE2 0x04
2816 #define _LATE3 0x08
2817 #define _LATE4 0x10
2818 #define _LATE5 0x20
2819 #define _LATE6 0x40
2820 #define _LATE7 0x80
2822 //==============================================================================
2825 //==============================================================================
2826 // LATF Bits
2828 extern __at(0x0F8E) __sfr LATF;
2830 typedef struct
2832 unsigned : 1;
2833 unsigned : 1;
2834 unsigned LATF2 : 1;
2835 unsigned LATF3 : 1;
2836 unsigned LATF4 : 1;
2837 unsigned LATF5 : 1;
2838 unsigned LATF6 : 1;
2839 unsigned LATF7 : 1;
2840 } __LATFbits_t;
2842 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
2844 #define _LATF2 0x04
2845 #define _LATF3 0x08
2846 #define _LATF4 0x10
2847 #define _LATF5 0x20
2848 #define _LATF6 0x40
2849 #define _LATF7 0x80
2851 //==============================================================================
2854 //==============================================================================
2855 // LATG Bits
2857 extern __at(0x0F8F) __sfr LATG;
2859 typedef union
2861 struct
2863 unsigned LATG0 : 1;
2864 unsigned LATG1 : 1;
2865 unsigned LATG2 : 1;
2866 unsigned LATG3 : 1;
2867 unsigned LATG4 : 1;
2868 unsigned : 1;
2869 unsigned : 1;
2870 unsigned : 1;
2873 struct
2875 unsigned LATG : 5;
2876 unsigned : 3;
2878 } __LATGbits_t;
2880 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
2882 #define _LATG0 0x01
2883 #define _LATG1 0x02
2884 #define _LATG2 0x04
2885 #define _LATG3 0x08
2886 #define _LATG4 0x10
2888 //==============================================================================
2891 //==============================================================================
2892 // LATH Bits
2894 extern __at(0x0F90) __sfr LATH;
2896 typedef struct
2898 unsigned LATH0 : 1;
2899 unsigned LATH1 : 1;
2900 unsigned LATH2 : 1;
2901 unsigned LATH3 : 1;
2902 unsigned LATH4 : 1;
2903 unsigned LATH5 : 1;
2904 unsigned LATH6 : 1;
2905 unsigned LATH7 : 1;
2906 } __LATHbits_t;
2908 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
2910 #define _LATH0 0x01
2911 #define _LATH1 0x02
2912 #define _LATH2 0x04
2913 #define _LATH3 0x08
2914 #define _LATH4 0x10
2915 #define _LATH5 0x20
2916 #define _LATH6 0x40
2917 #define _LATH7 0x80
2919 //==============================================================================
2922 //==============================================================================
2923 // LATJ Bits
2925 extern __at(0x0F91) __sfr LATJ;
2927 typedef struct
2929 unsigned LATJ0 : 1;
2930 unsigned LATJ1 : 1;
2931 unsigned LATJ2 : 1;
2932 unsigned LATJ3 : 1;
2933 unsigned LATJ4 : 1;
2934 unsigned LATJ5 : 1;
2935 unsigned LATJ6 : 1;
2936 unsigned LATJ7 : 1;
2937 } __LATJbits_t;
2939 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
2941 #define _LATJ0 0x01
2942 #define _LATJ1 0x02
2943 #define _LATJ2 0x04
2944 #define _LATJ3 0x08
2945 #define _LATJ4 0x10
2946 #define _LATJ5 0x20
2947 #define _LATJ6 0x40
2948 #define _LATJ7 0x80
2950 //==============================================================================
2953 //==============================================================================
2954 // DDRA Bits
2956 extern __at(0x0F92) __sfr DDRA;
2958 typedef union
2960 struct
2962 unsigned TRISA0 : 1;
2963 unsigned TRISA1 : 1;
2964 unsigned TRISA2 : 1;
2965 unsigned TRISA3 : 1;
2966 unsigned TRISA4 : 1;
2967 unsigned TRISA5 : 1;
2968 unsigned TRISA6 : 1;
2969 unsigned TRISA7 : 1;
2972 struct
2974 unsigned RA0 : 1;
2975 unsigned RA1 : 1;
2976 unsigned RA2 : 1;
2977 unsigned RA3 : 1;
2978 unsigned RA4 : 1;
2979 unsigned RA5 : 1;
2980 unsigned RA6 : 1;
2981 unsigned RA7 : 1;
2983 } __DDRAbits_t;
2985 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2987 #define _TRISA0 0x01
2988 #define _RA0 0x01
2989 #define _TRISA1 0x02
2990 #define _RA1 0x02
2991 #define _TRISA2 0x04
2992 #define _RA2 0x04
2993 #define _TRISA3 0x08
2994 #define _RA3 0x08
2995 #define _TRISA4 0x10
2996 #define _RA4 0x10
2997 #define _TRISA5 0x20
2998 #define _RA5 0x20
2999 #define _TRISA6 0x40
3000 #define _RA6 0x40
3001 #define _TRISA7 0x80
3002 #define _RA7 0x80
3004 //==============================================================================
3007 //==============================================================================
3008 // TRISA Bits
3010 extern __at(0x0F92) __sfr TRISA;
3012 typedef union
3014 struct
3016 unsigned TRISA0 : 1;
3017 unsigned TRISA1 : 1;
3018 unsigned TRISA2 : 1;
3019 unsigned TRISA3 : 1;
3020 unsigned TRISA4 : 1;
3021 unsigned TRISA5 : 1;
3022 unsigned TRISA6 : 1;
3023 unsigned TRISA7 : 1;
3026 struct
3028 unsigned RA0 : 1;
3029 unsigned RA1 : 1;
3030 unsigned RA2 : 1;
3031 unsigned RA3 : 1;
3032 unsigned RA4 : 1;
3033 unsigned RA5 : 1;
3034 unsigned RA6 : 1;
3035 unsigned RA7 : 1;
3037 } __TRISAbits_t;
3039 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
3041 #define _TRISA_TRISA0 0x01
3042 #define _TRISA_RA0 0x01
3043 #define _TRISA_TRISA1 0x02
3044 #define _TRISA_RA1 0x02
3045 #define _TRISA_TRISA2 0x04
3046 #define _TRISA_RA2 0x04
3047 #define _TRISA_TRISA3 0x08
3048 #define _TRISA_RA3 0x08
3049 #define _TRISA_TRISA4 0x10
3050 #define _TRISA_RA4 0x10
3051 #define _TRISA_TRISA5 0x20
3052 #define _TRISA_RA5 0x20
3053 #define _TRISA_TRISA6 0x40
3054 #define _TRISA_RA6 0x40
3055 #define _TRISA_TRISA7 0x80
3056 #define _TRISA_RA7 0x80
3058 //==============================================================================
3061 //==============================================================================
3062 // DDRB Bits
3064 extern __at(0x0F93) __sfr DDRB;
3066 typedef union
3068 struct
3070 unsigned TRISB0 : 1;
3071 unsigned TRISB1 : 1;
3072 unsigned TRISB2 : 1;
3073 unsigned TRISB3 : 1;
3074 unsigned TRISB4 : 1;
3075 unsigned TRISB5 : 1;
3076 unsigned TRISB6 : 1;
3077 unsigned TRISB7 : 1;
3080 struct
3082 unsigned RB0 : 1;
3083 unsigned RB1 : 1;
3084 unsigned RB2 : 1;
3085 unsigned RB3 : 1;
3086 unsigned RB4 : 1;
3087 unsigned RB5 : 1;
3088 unsigned RB6 : 1;
3089 unsigned RB7 : 1;
3091 } __DDRBbits_t;
3093 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
3095 #define _TRISB0 0x01
3096 #define _RB0 0x01
3097 #define _TRISB1 0x02
3098 #define _RB1 0x02
3099 #define _TRISB2 0x04
3100 #define _RB2 0x04
3101 #define _TRISB3 0x08
3102 #define _RB3 0x08
3103 #define _TRISB4 0x10
3104 #define _RB4 0x10
3105 #define _TRISB5 0x20
3106 #define _RB5 0x20
3107 #define _TRISB6 0x40
3108 #define _RB6 0x40
3109 #define _TRISB7 0x80
3110 #define _RB7 0x80
3112 //==============================================================================
3115 //==============================================================================
3116 // TRISB Bits
3118 extern __at(0x0F93) __sfr TRISB;
3120 typedef union
3122 struct
3124 unsigned TRISB0 : 1;
3125 unsigned TRISB1 : 1;
3126 unsigned TRISB2 : 1;
3127 unsigned TRISB3 : 1;
3128 unsigned TRISB4 : 1;
3129 unsigned TRISB5 : 1;
3130 unsigned TRISB6 : 1;
3131 unsigned TRISB7 : 1;
3134 struct
3136 unsigned RB0 : 1;
3137 unsigned RB1 : 1;
3138 unsigned RB2 : 1;
3139 unsigned RB3 : 1;
3140 unsigned RB4 : 1;
3141 unsigned RB5 : 1;
3142 unsigned RB6 : 1;
3143 unsigned RB7 : 1;
3145 } __TRISBbits_t;
3147 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
3149 #define _TRISB_TRISB0 0x01
3150 #define _TRISB_RB0 0x01
3151 #define _TRISB_TRISB1 0x02
3152 #define _TRISB_RB1 0x02
3153 #define _TRISB_TRISB2 0x04
3154 #define _TRISB_RB2 0x04
3155 #define _TRISB_TRISB3 0x08
3156 #define _TRISB_RB3 0x08
3157 #define _TRISB_TRISB4 0x10
3158 #define _TRISB_RB4 0x10
3159 #define _TRISB_TRISB5 0x20
3160 #define _TRISB_RB5 0x20
3161 #define _TRISB_TRISB6 0x40
3162 #define _TRISB_RB6 0x40
3163 #define _TRISB_TRISB7 0x80
3164 #define _TRISB_RB7 0x80
3166 //==============================================================================
3169 //==============================================================================
3170 // DDRC Bits
3172 extern __at(0x0F94) __sfr DDRC;
3174 typedef union
3176 struct
3178 unsigned TRISC0 : 1;
3179 unsigned TRISC1 : 1;
3180 unsigned TRISC2 : 1;
3181 unsigned TRISC3 : 1;
3182 unsigned TRISC4 : 1;
3183 unsigned TRISC5 : 1;
3184 unsigned TRISC6 : 1;
3185 unsigned TRISC7 : 1;
3188 struct
3190 unsigned RC0 : 1;
3191 unsigned RC1 : 1;
3192 unsigned RC2 : 1;
3193 unsigned RC3 : 1;
3194 unsigned RC4 : 1;
3195 unsigned RC5 : 1;
3196 unsigned RC6 : 1;
3197 unsigned RC7 : 1;
3199 } __DDRCbits_t;
3201 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
3203 #define _TRISC0 0x01
3204 #define _RC0 0x01
3205 #define _TRISC1 0x02
3206 #define _RC1 0x02
3207 #define _TRISC2 0x04
3208 #define _RC2 0x04
3209 #define _TRISC3 0x08
3210 #define _RC3 0x08
3211 #define _TRISC4 0x10
3212 #define _RC4 0x10
3213 #define _TRISC5 0x20
3214 #define _RC5 0x20
3215 #define _TRISC6 0x40
3216 #define _RC6 0x40
3217 #define _TRISC7 0x80
3218 #define _RC7 0x80
3220 //==============================================================================
3223 //==============================================================================
3224 // TRISC Bits
3226 extern __at(0x0F94) __sfr TRISC;
3228 typedef union
3230 struct
3232 unsigned TRISC0 : 1;
3233 unsigned TRISC1 : 1;
3234 unsigned TRISC2 : 1;
3235 unsigned TRISC3 : 1;
3236 unsigned TRISC4 : 1;
3237 unsigned TRISC5 : 1;
3238 unsigned TRISC6 : 1;
3239 unsigned TRISC7 : 1;
3242 struct
3244 unsigned RC0 : 1;
3245 unsigned RC1 : 1;
3246 unsigned RC2 : 1;
3247 unsigned RC3 : 1;
3248 unsigned RC4 : 1;
3249 unsigned RC5 : 1;
3250 unsigned RC6 : 1;
3251 unsigned RC7 : 1;
3253 } __TRISCbits_t;
3255 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
3257 #define _TRISC_TRISC0 0x01
3258 #define _TRISC_RC0 0x01
3259 #define _TRISC_TRISC1 0x02
3260 #define _TRISC_RC1 0x02
3261 #define _TRISC_TRISC2 0x04
3262 #define _TRISC_RC2 0x04
3263 #define _TRISC_TRISC3 0x08
3264 #define _TRISC_RC3 0x08
3265 #define _TRISC_TRISC4 0x10
3266 #define _TRISC_RC4 0x10
3267 #define _TRISC_TRISC5 0x20
3268 #define _TRISC_RC5 0x20
3269 #define _TRISC_TRISC6 0x40
3270 #define _TRISC_RC6 0x40
3271 #define _TRISC_TRISC7 0x80
3272 #define _TRISC_RC7 0x80
3274 //==============================================================================
3277 //==============================================================================
3278 // DDRD Bits
3280 extern __at(0x0F95) __sfr DDRD;
3282 typedef union
3284 struct
3286 unsigned TRISD0 : 1;
3287 unsigned TRISD1 : 1;
3288 unsigned TRISD2 : 1;
3289 unsigned TRISD3 : 1;
3290 unsigned TRISD4 : 1;
3291 unsigned TRISD5 : 1;
3292 unsigned TRISD6 : 1;
3293 unsigned TRISD7 : 1;
3296 struct
3298 unsigned RD0 : 1;
3299 unsigned RD1 : 1;
3300 unsigned RD2 : 1;
3301 unsigned RD3 : 1;
3302 unsigned RD4 : 1;
3303 unsigned RD5 : 1;
3304 unsigned RD6 : 1;
3305 unsigned RD7 : 1;
3307 } __DDRDbits_t;
3309 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
3311 #define _TRISD0 0x01
3312 #define _RD0 0x01
3313 #define _TRISD1 0x02
3314 #define _RD1 0x02
3315 #define _TRISD2 0x04
3316 #define _RD2 0x04
3317 #define _TRISD3 0x08
3318 #define _RD3 0x08
3319 #define _TRISD4 0x10
3320 #define _RD4 0x10
3321 #define _TRISD5 0x20
3322 #define _RD5 0x20
3323 #define _TRISD6 0x40
3324 #define _RD6 0x40
3325 #define _TRISD7 0x80
3326 #define _RD7 0x80
3328 //==============================================================================
3331 //==============================================================================
3332 // TRISD Bits
3334 extern __at(0x0F95) __sfr TRISD;
3336 typedef union
3338 struct
3340 unsigned TRISD0 : 1;
3341 unsigned TRISD1 : 1;
3342 unsigned TRISD2 : 1;
3343 unsigned TRISD3 : 1;
3344 unsigned TRISD4 : 1;
3345 unsigned TRISD5 : 1;
3346 unsigned TRISD6 : 1;
3347 unsigned TRISD7 : 1;
3350 struct
3352 unsigned RD0 : 1;
3353 unsigned RD1 : 1;
3354 unsigned RD2 : 1;
3355 unsigned RD3 : 1;
3356 unsigned RD4 : 1;
3357 unsigned RD5 : 1;
3358 unsigned RD6 : 1;
3359 unsigned RD7 : 1;
3361 } __TRISDbits_t;
3363 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
3365 #define _TRISD_TRISD0 0x01
3366 #define _TRISD_RD0 0x01
3367 #define _TRISD_TRISD1 0x02
3368 #define _TRISD_RD1 0x02
3369 #define _TRISD_TRISD2 0x04
3370 #define _TRISD_RD2 0x04
3371 #define _TRISD_TRISD3 0x08
3372 #define _TRISD_RD3 0x08
3373 #define _TRISD_TRISD4 0x10
3374 #define _TRISD_RD4 0x10
3375 #define _TRISD_TRISD5 0x20
3376 #define _TRISD_RD5 0x20
3377 #define _TRISD_TRISD6 0x40
3378 #define _TRISD_RD6 0x40
3379 #define _TRISD_TRISD7 0x80
3380 #define _TRISD_RD7 0x80
3382 //==============================================================================
3385 //==============================================================================
3386 // DDRE Bits
3388 extern __at(0x0F96) __sfr DDRE;
3390 typedef union
3392 struct
3394 unsigned TRISE0 : 1;
3395 unsigned TRISE1 : 1;
3396 unsigned TRISE2 : 1;
3397 unsigned TRISE3 : 1;
3398 unsigned TRISE4 : 1;
3399 unsigned TRISE5 : 1;
3400 unsigned TRISE6 : 1;
3401 unsigned TRISE7 : 1;
3404 struct
3406 unsigned RE0 : 1;
3407 unsigned RE1 : 1;
3408 unsigned RE2 : 1;
3409 unsigned RE3 : 1;
3410 unsigned RE4 : 1;
3411 unsigned RE5 : 1;
3412 unsigned RE6 : 1;
3413 unsigned RE7 : 1;
3415 } __DDREbits_t;
3417 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
3419 #define _TRISE0 0x01
3420 #define _RE0 0x01
3421 #define _TRISE1 0x02
3422 #define _RE1 0x02
3423 #define _TRISE2 0x04
3424 #define _RE2 0x04
3425 #define _TRISE3 0x08
3426 #define _RE3 0x08
3427 #define _TRISE4 0x10
3428 #define _RE4 0x10
3429 #define _TRISE5 0x20
3430 #define _RE5 0x20
3431 #define _TRISE6 0x40
3432 #define _RE6 0x40
3433 #define _TRISE7 0x80
3434 #define _RE7 0x80
3436 //==============================================================================
3439 //==============================================================================
3440 // TRISE Bits
3442 extern __at(0x0F96) __sfr TRISE;
3444 typedef union
3446 struct
3448 unsigned TRISE0 : 1;
3449 unsigned TRISE1 : 1;
3450 unsigned TRISE2 : 1;
3451 unsigned TRISE3 : 1;
3452 unsigned TRISE4 : 1;
3453 unsigned TRISE5 : 1;
3454 unsigned TRISE6 : 1;
3455 unsigned TRISE7 : 1;
3458 struct
3460 unsigned RE0 : 1;
3461 unsigned RE1 : 1;
3462 unsigned RE2 : 1;
3463 unsigned RE3 : 1;
3464 unsigned RE4 : 1;
3465 unsigned RE5 : 1;
3466 unsigned RE6 : 1;
3467 unsigned RE7 : 1;
3469 } __TRISEbits_t;
3471 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
3473 #define _TRISE_TRISE0 0x01
3474 #define _TRISE_RE0 0x01
3475 #define _TRISE_TRISE1 0x02
3476 #define _TRISE_RE1 0x02
3477 #define _TRISE_TRISE2 0x04
3478 #define _TRISE_RE2 0x04
3479 #define _TRISE_TRISE3 0x08
3480 #define _TRISE_RE3 0x08
3481 #define _TRISE_TRISE4 0x10
3482 #define _TRISE_RE4 0x10
3483 #define _TRISE_TRISE5 0x20
3484 #define _TRISE_RE5 0x20
3485 #define _TRISE_TRISE6 0x40
3486 #define _TRISE_RE6 0x40
3487 #define _TRISE_TRISE7 0x80
3488 #define _TRISE_RE7 0x80
3490 //==============================================================================
3493 //==============================================================================
3494 // DDRF Bits
3496 extern __at(0x0F97) __sfr DDRF;
3498 typedef union
3500 struct
3502 unsigned : 1;
3503 unsigned : 1;
3504 unsigned TRISF2 : 1;
3505 unsigned TRISF3 : 1;
3506 unsigned TRISF4 : 1;
3507 unsigned TRISF5 : 1;
3508 unsigned TRISF6 : 1;
3509 unsigned TRISF7 : 1;
3512 struct
3514 unsigned : 1;
3515 unsigned : 1;
3516 unsigned RF2 : 1;
3517 unsigned RF3 : 1;
3518 unsigned RF4 : 1;
3519 unsigned RF5 : 1;
3520 unsigned RF6 : 1;
3521 unsigned RF7 : 1;
3523 } __DDRFbits_t;
3525 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
3527 #define _TRISF2 0x04
3528 #define _RF2 0x04
3529 #define _TRISF3 0x08
3530 #define _RF3 0x08
3531 #define _TRISF4 0x10
3532 #define _RF4 0x10
3533 #define _TRISF5 0x20
3534 #define _RF5 0x20
3535 #define _TRISF6 0x40
3536 #define _RF6 0x40
3537 #define _TRISF7 0x80
3538 #define _RF7 0x80
3540 //==============================================================================
3543 //==============================================================================
3544 // TRISF Bits
3546 extern __at(0x0F97) __sfr TRISF;
3548 typedef union
3550 struct
3552 unsigned : 1;
3553 unsigned : 1;
3554 unsigned TRISF2 : 1;
3555 unsigned TRISF3 : 1;
3556 unsigned TRISF4 : 1;
3557 unsigned TRISF5 : 1;
3558 unsigned TRISF6 : 1;
3559 unsigned TRISF7 : 1;
3562 struct
3564 unsigned : 1;
3565 unsigned : 1;
3566 unsigned RF2 : 1;
3567 unsigned RF3 : 1;
3568 unsigned RF4 : 1;
3569 unsigned RF5 : 1;
3570 unsigned RF6 : 1;
3571 unsigned RF7 : 1;
3573 } __TRISFbits_t;
3575 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
3577 #define _TRISF_TRISF2 0x04
3578 #define _TRISF_RF2 0x04
3579 #define _TRISF_TRISF3 0x08
3580 #define _TRISF_RF3 0x08
3581 #define _TRISF_TRISF4 0x10
3582 #define _TRISF_RF4 0x10
3583 #define _TRISF_TRISF5 0x20
3584 #define _TRISF_RF5 0x20
3585 #define _TRISF_TRISF6 0x40
3586 #define _TRISF_RF6 0x40
3587 #define _TRISF_TRISF7 0x80
3588 #define _TRISF_RF7 0x80
3590 //==============================================================================
3593 //==============================================================================
3594 // DDRG Bits
3596 extern __at(0x0F98) __sfr DDRG;
3598 typedef union
3600 struct
3602 unsigned TRISG0 : 1;
3603 unsigned TRISG1 : 1;
3604 unsigned TRISG2 : 1;
3605 unsigned TRISG3 : 1;
3606 unsigned TRISG4 : 1;
3607 unsigned : 1;
3608 unsigned : 1;
3609 unsigned : 1;
3612 struct
3614 unsigned RG0 : 1;
3615 unsigned RG1 : 1;
3616 unsigned RG2 : 1;
3617 unsigned RG3 : 1;
3618 unsigned RG4 : 1;
3619 unsigned : 1;
3620 unsigned : 1;
3621 unsigned : 1;
3624 struct
3626 unsigned RG : 5;
3627 unsigned : 3;
3630 struct
3632 unsigned TRISG : 5;
3633 unsigned : 3;
3635 } __DDRGbits_t;
3637 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
3639 #define _TRISG0 0x01
3640 #define _RG0 0x01
3641 #define _TRISG1 0x02
3642 #define _RG1 0x02
3643 #define _TRISG2 0x04
3644 #define _RG2 0x04
3645 #define _TRISG3 0x08
3646 #define _RG3 0x08
3647 #define _TRISG4 0x10
3648 #define _RG4 0x10
3650 //==============================================================================
3653 //==============================================================================
3654 // TRISG Bits
3656 extern __at(0x0F98) __sfr TRISG;
3658 typedef union
3660 struct
3662 unsigned TRISG0 : 1;
3663 unsigned TRISG1 : 1;
3664 unsigned TRISG2 : 1;
3665 unsigned TRISG3 : 1;
3666 unsigned TRISG4 : 1;
3667 unsigned : 1;
3668 unsigned : 1;
3669 unsigned : 1;
3672 struct
3674 unsigned RG0 : 1;
3675 unsigned RG1 : 1;
3676 unsigned RG2 : 1;
3677 unsigned RG3 : 1;
3678 unsigned RG4 : 1;
3679 unsigned : 1;
3680 unsigned : 1;
3681 unsigned : 1;
3684 struct
3686 unsigned RG : 5;
3687 unsigned : 3;
3690 struct
3692 unsigned TRISG : 5;
3693 unsigned : 3;
3695 } __TRISGbits_t;
3697 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
3699 #define _TRISG_TRISG0 0x01
3700 #define _TRISG_RG0 0x01
3701 #define _TRISG_TRISG1 0x02
3702 #define _TRISG_RG1 0x02
3703 #define _TRISG_TRISG2 0x04
3704 #define _TRISG_RG2 0x04
3705 #define _TRISG_TRISG3 0x08
3706 #define _TRISG_RG3 0x08
3707 #define _TRISG_TRISG4 0x10
3708 #define _TRISG_RG4 0x10
3710 //==============================================================================
3713 //==============================================================================
3714 // DDRH Bits
3716 extern __at(0x0F99) __sfr DDRH;
3718 typedef union
3720 struct
3722 unsigned TRISH0 : 1;
3723 unsigned TRISH1 : 1;
3724 unsigned TRISH2 : 1;
3725 unsigned TRISH3 : 1;
3726 unsigned TRISH4 : 1;
3727 unsigned TRISH5 : 1;
3728 unsigned TRISH6 : 1;
3729 unsigned TRISH7 : 1;
3732 struct
3734 unsigned RH0 : 1;
3735 unsigned RH1 : 1;
3736 unsigned RH2 : 1;
3737 unsigned RH3 : 1;
3738 unsigned RH4 : 1;
3739 unsigned RH5 : 1;
3740 unsigned RH6 : 1;
3741 unsigned RH7 : 1;
3743 } __DDRHbits_t;
3745 extern __at(0x0F99) volatile __DDRHbits_t DDRHbits;
3747 #define _TRISH0 0x01
3748 #define _RH0 0x01
3749 #define _TRISH1 0x02
3750 #define _RH1 0x02
3751 #define _TRISH2 0x04
3752 #define _RH2 0x04
3753 #define _TRISH3 0x08
3754 #define _RH3 0x08
3755 #define _TRISH4 0x10
3756 #define _RH4 0x10
3757 #define _TRISH5 0x20
3758 #define _RH5 0x20
3759 #define _TRISH6 0x40
3760 #define _RH6 0x40
3761 #define _TRISH7 0x80
3762 #define _RH7 0x80
3764 //==============================================================================
3767 //==============================================================================
3768 // TRISH Bits
3770 extern __at(0x0F99) __sfr TRISH;
3772 typedef union
3774 struct
3776 unsigned TRISH0 : 1;
3777 unsigned TRISH1 : 1;
3778 unsigned TRISH2 : 1;
3779 unsigned TRISH3 : 1;
3780 unsigned TRISH4 : 1;
3781 unsigned TRISH5 : 1;
3782 unsigned TRISH6 : 1;
3783 unsigned TRISH7 : 1;
3786 struct
3788 unsigned RH0 : 1;
3789 unsigned RH1 : 1;
3790 unsigned RH2 : 1;
3791 unsigned RH3 : 1;
3792 unsigned RH4 : 1;
3793 unsigned RH5 : 1;
3794 unsigned RH6 : 1;
3795 unsigned RH7 : 1;
3797 } __TRISHbits_t;
3799 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
3801 #define _TRISH_TRISH0 0x01
3802 #define _TRISH_RH0 0x01
3803 #define _TRISH_TRISH1 0x02
3804 #define _TRISH_RH1 0x02
3805 #define _TRISH_TRISH2 0x04
3806 #define _TRISH_RH2 0x04
3807 #define _TRISH_TRISH3 0x08
3808 #define _TRISH_RH3 0x08
3809 #define _TRISH_TRISH4 0x10
3810 #define _TRISH_RH4 0x10
3811 #define _TRISH_TRISH5 0x20
3812 #define _TRISH_RH5 0x20
3813 #define _TRISH_TRISH6 0x40
3814 #define _TRISH_RH6 0x40
3815 #define _TRISH_TRISH7 0x80
3816 #define _TRISH_RH7 0x80
3818 //==============================================================================
3821 //==============================================================================
3822 // DDRJ Bits
3824 extern __at(0x0F9A) __sfr DDRJ;
3826 typedef union
3828 struct
3830 unsigned TRISJ0 : 1;
3831 unsigned TRISJ1 : 1;
3832 unsigned TRISJ2 : 1;
3833 unsigned TRISJ3 : 1;
3834 unsigned TRISJ4 : 1;
3835 unsigned TRISJ5 : 1;
3836 unsigned TRISJ6 : 1;
3837 unsigned TRISJ7 : 1;
3840 struct
3842 unsigned RJ0 : 1;
3843 unsigned RJ1 : 1;
3844 unsigned RJ2 : 1;
3845 unsigned RJ3 : 1;
3846 unsigned RJ4 : 1;
3847 unsigned RJ5 : 1;
3848 unsigned RJ6 : 1;
3849 unsigned RJ7 : 1;
3851 } __DDRJbits_t;
3853 extern __at(0x0F9A) volatile __DDRJbits_t DDRJbits;
3855 #define _TRISJ0 0x01
3856 #define _RJ0 0x01
3857 #define _TRISJ1 0x02
3858 #define _RJ1 0x02
3859 #define _TRISJ2 0x04
3860 #define _RJ2 0x04
3861 #define _TRISJ3 0x08
3862 #define _RJ3 0x08
3863 #define _TRISJ4 0x10
3864 #define _RJ4 0x10
3865 #define _TRISJ5 0x20
3866 #define _RJ5 0x20
3867 #define _TRISJ6 0x40
3868 #define _RJ6 0x40
3869 #define _TRISJ7 0x80
3870 #define _RJ7 0x80
3872 //==============================================================================
3875 //==============================================================================
3876 // TRISJ Bits
3878 extern __at(0x0F9A) __sfr TRISJ;
3880 typedef union
3882 struct
3884 unsigned TRISJ0 : 1;
3885 unsigned TRISJ1 : 1;
3886 unsigned TRISJ2 : 1;
3887 unsigned TRISJ3 : 1;
3888 unsigned TRISJ4 : 1;
3889 unsigned TRISJ5 : 1;
3890 unsigned TRISJ6 : 1;
3891 unsigned TRISJ7 : 1;
3894 struct
3896 unsigned RJ0 : 1;
3897 unsigned RJ1 : 1;
3898 unsigned RJ2 : 1;
3899 unsigned RJ3 : 1;
3900 unsigned RJ4 : 1;
3901 unsigned RJ5 : 1;
3902 unsigned RJ6 : 1;
3903 unsigned RJ7 : 1;
3905 } __TRISJbits_t;
3907 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
3909 #define _TRISJ_TRISJ0 0x01
3910 #define _TRISJ_RJ0 0x01
3911 #define _TRISJ_TRISJ1 0x02
3912 #define _TRISJ_RJ1 0x02
3913 #define _TRISJ_TRISJ2 0x04
3914 #define _TRISJ_RJ2 0x04
3915 #define _TRISJ_TRISJ3 0x08
3916 #define _TRISJ_RJ3 0x08
3917 #define _TRISJ_TRISJ4 0x10
3918 #define _TRISJ_RJ4 0x10
3919 #define _TRISJ_TRISJ5 0x20
3920 #define _TRISJ_RJ5 0x20
3921 #define _TRISJ_TRISJ6 0x40
3922 #define _TRISJ_RJ6 0x40
3923 #define _TRISJ_TRISJ7 0x80
3924 #define _TRISJ_RJ7 0x80
3926 //==============================================================================
3929 //==============================================================================
3930 // OSCTUNE Bits
3932 extern __at(0x0F9B) __sfr OSCTUNE;
3934 typedef union
3936 struct
3938 unsigned TUN0 : 1;
3939 unsigned TUN1 : 1;
3940 unsigned TUN2 : 1;
3941 unsigned TUN3 : 1;
3942 unsigned TUN4 : 1;
3943 unsigned TUN5 : 1;
3944 unsigned PLLEN : 1;
3945 unsigned INTSRC : 1;
3948 struct
3950 unsigned TUN : 6;
3951 unsigned : 2;
3953 } __OSCTUNEbits_t;
3955 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3957 #define _TUN0 0x01
3958 #define _TUN1 0x02
3959 #define _TUN2 0x04
3960 #define _TUN3 0x08
3961 #define _TUN4 0x10
3962 #define _TUN5 0x20
3963 #define _PLLEN 0x40
3964 #define _INTSRC 0x80
3966 //==============================================================================
3969 //==============================================================================
3970 // RCSTA2 Bits
3972 extern __at(0x0F9C) __sfr RCSTA2;
3974 typedef union
3976 struct
3978 unsigned RX9D : 1;
3979 unsigned OERR : 1;
3980 unsigned FERR : 1;
3981 unsigned ADDEN : 1;
3982 unsigned CREN : 1;
3983 unsigned SREN : 1;
3984 unsigned RX9 : 1;
3985 unsigned SPEN : 1;
3988 struct
3990 unsigned RCD8 : 1;
3991 unsigned OERR2 : 1;
3992 unsigned FERR2 : 1;
3993 unsigned ADDEN2 : 1;
3994 unsigned CREN2 : 1;
3995 unsigned SREN2 : 1;
3996 unsigned RC9 : 1;
3997 unsigned SPEN2 : 1;
4000 struct
4002 unsigned RX9D2 : 1;
4003 unsigned : 1;
4004 unsigned : 1;
4005 unsigned : 1;
4006 unsigned : 1;
4007 unsigned : 1;
4008 unsigned NOT_RC8 : 1;
4009 unsigned : 1;
4012 struct
4014 unsigned : 1;
4015 unsigned : 1;
4016 unsigned : 1;
4017 unsigned : 1;
4018 unsigned : 1;
4019 unsigned : 1;
4020 unsigned RC8_9 : 1;
4021 unsigned : 1;
4024 struct
4026 unsigned : 1;
4027 unsigned : 1;
4028 unsigned : 1;
4029 unsigned : 1;
4030 unsigned : 1;
4031 unsigned : 1;
4032 unsigned RX92 : 1;
4033 unsigned : 1;
4035 } __RCSTA2bits_t;
4037 extern __at(0x0F9C) volatile __RCSTA2bits_t RCSTA2bits;
4039 #define _RCSTA2_RX9D 0x01
4040 #define _RCSTA2_RCD8 0x01
4041 #define _RCSTA2_RX9D2 0x01
4042 #define _RCSTA2_OERR 0x02
4043 #define _RCSTA2_OERR2 0x02
4044 #define _RCSTA2_FERR 0x04
4045 #define _RCSTA2_FERR2 0x04
4046 #define _RCSTA2_ADDEN 0x08
4047 #define _RCSTA2_ADDEN2 0x08
4048 #define _RCSTA2_CREN 0x10
4049 #define _RCSTA2_CREN2 0x10
4050 #define _RCSTA2_SREN 0x20
4051 #define _RCSTA2_SREN2 0x20
4052 #define _RCSTA2_RX9 0x40
4053 #define _RCSTA2_RC9 0x40
4054 #define _RCSTA2_NOT_RC8 0x40
4055 #define _RCSTA2_RC8_9 0x40
4056 #define _RCSTA2_RX92 0x40
4057 #define _RCSTA2_SPEN 0x80
4058 #define _RCSTA2_SPEN2 0x80
4060 //==============================================================================
4063 //==============================================================================
4064 // PIE1 Bits
4066 extern __at(0x0F9D) __sfr PIE1;
4068 typedef union
4070 struct
4072 unsigned TMR1IE : 1;
4073 unsigned TMR2IE : 1;
4074 unsigned CCP1IE : 1;
4075 unsigned SSP1IE : 1;
4076 unsigned TX1IE : 1;
4077 unsigned RC1IE : 1;
4078 unsigned ADIE : 1;
4079 unsigned PMPIE : 1;
4082 struct
4084 unsigned : 1;
4085 unsigned : 1;
4086 unsigned : 1;
4087 unsigned SSPIE : 1;
4088 unsigned TXIE : 1;
4089 unsigned RCIE : 1;
4090 unsigned : 1;
4091 unsigned : 1;
4093 } __PIE1bits_t;
4095 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
4097 #define _TMR1IE 0x01
4098 #define _TMR2IE 0x02
4099 #define _CCP1IE 0x04
4100 #define _SSP1IE 0x08
4101 #define _SSPIE 0x08
4102 #define _TX1IE 0x10
4103 #define _TXIE 0x10
4104 #define _RC1IE 0x20
4105 #define _RCIE 0x20
4106 #define _ADIE 0x40
4107 #define _PMPIE 0x80
4109 //==============================================================================
4112 //==============================================================================
4113 // PIR1 Bits
4115 extern __at(0x0F9E) __sfr PIR1;
4117 typedef union
4119 struct
4121 unsigned TMR1IF : 1;
4122 unsigned TMR2IF : 1;
4123 unsigned CCP1IF : 1;
4124 unsigned SSP1IF : 1;
4125 unsigned TX1IF : 1;
4126 unsigned RC1IF : 1;
4127 unsigned ADIF : 1;
4128 unsigned PMPIF : 1;
4131 struct
4133 unsigned : 1;
4134 unsigned : 1;
4135 unsigned : 1;
4136 unsigned SSPIF : 1;
4137 unsigned TXIF : 1;
4138 unsigned RCIF : 1;
4139 unsigned : 1;
4140 unsigned : 1;
4142 } __PIR1bits_t;
4144 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4146 #define _TMR1IF 0x01
4147 #define _TMR2IF 0x02
4148 #define _CCP1IF 0x04
4149 #define _SSP1IF 0x08
4150 #define _SSPIF 0x08
4151 #define _TX1IF 0x10
4152 #define _TXIF 0x10
4153 #define _RC1IF 0x20
4154 #define _RCIF 0x20
4155 #define _ADIF 0x40
4156 #define _PMPIF 0x80
4158 //==============================================================================
4161 //==============================================================================
4162 // IPR1 Bits
4164 extern __at(0x0F9F) __sfr IPR1;
4166 typedef union
4168 struct
4170 unsigned TMR1IP : 1;
4171 unsigned TMR2IP : 1;
4172 unsigned CCP1IP : 1;
4173 unsigned SSP1IP : 1;
4174 unsigned TX1IP : 1;
4175 unsigned RC1IP : 1;
4176 unsigned ADIP : 1;
4177 unsigned PMPIP : 1;
4180 struct
4182 unsigned : 1;
4183 unsigned : 1;
4184 unsigned : 1;
4185 unsigned SSPIP : 1;
4186 unsigned TXIP : 1;
4187 unsigned RCIP : 1;
4188 unsigned : 1;
4189 unsigned : 1;
4191 } __IPR1bits_t;
4193 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4195 #define _TMR1IP 0x01
4196 #define _TMR2IP 0x02
4197 #define _CCP1IP 0x04
4198 #define _SSP1IP 0x08
4199 #define _SSPIP 0x08
4200 #define _TX1IP 0x10
4201 #define _TXIP 0x10
4202 #define _RC1IP 0x20
4203 #define _RCIP 0x20
4204 #define _ADIP 0x40
4205 #define _PMPIP 0x80
4207 //==============================================================================
4210 //==============================================================================
4211 // PIE2 Bits
4213 extern __at(0x0FA0) __sfr PIE2;
4215 typedef union
4217 struct
4219 unsigned CCP2IE : 1;
4220 unsigned TMR3IE : 1;
4221 unsigned LVDIE : 1;
4222 unsigned BCL1IE : 1;
4223 unsigned USBIE : 1;
4224 unsigned CM1IE : 1;
4225 unsigned CM2IE : 1;
4226 unsigned OSCFIE : 1;
4229 struct
4231 unsigned : 1;
4232 unsigned : 1;
4233 unsigned : 1;
4234 unsigned BCLIE : 1;
4235 unsigned : 1;
4236 unsigned : 1;
4237 unsigned : 1;
4238 unsigned : 1;
4240 } __PIE2bits_t;
4242 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4244 #define _CCP2IE 0x01
4245 #define _TMR3IE 0x02
4246 #define _LVDIE 0x04
4247 #define _BCL1IE 0x08
4248 #define _BCLIE 0x08
4249 #define _USBIE 0x10
4250 #define _CM1IE 0x20
4251 #define _CM2IE 0x40
4252 #define _OSCFIE 0x80
4254 //==============================================================================
4257 //==============================================================================
4258 // PIR2 Bits
4260 extern __at(0x0FA1) __sfr PIR2;
4262 typedef union
4264 struct
4266 unsigned CCP2IF : 1;
4267 unsigned TMR3IF : 1;
4268 unsigned LVDIF : 1;
4269 unsigned BCL1IF : 1;
4270 unsigned USBIF : 1;
4271 unsigned CM1IF : 1;
4272 unsigned CM2IF : 1;
4273 unsigned OSCFIF : 1;
4276 struct
4278 unsigned : 1;
4279 unsigned : 1;
4280 unsigned : 1;
4281 unsigned BCLIF : 1;
4282 unsigned : 1;
4283 unsigned : 1;
4284 unsigned : 1;
4285 unsigned : 1;
4287 } __PIR2bits_t;
4289 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4291 #define _CCP2IF 0x01
4292 #define _TMR3IF 0x02
4293 #define _LVDIF 0x04
4294 #define _BCL1IF 0x08
4295 #define _BCLIF 0x08
4296 #define _USBIF 0x10
4297 #define _CM1IF 0x20
4298 #define _CM2IF 0x40
4299 #define _OSCFIF 0x80
4301 //==============================================================================
4304 //==============================================================================
4305 // IPR2 Bits
4307 extern __at(0x0FA2) __sfr IPR2;
4309 typedef union
4311 struct
4313 unsigned CCP2IP : 1;
4314 unsigned TMR3IP : 1;
4315 unsigned LVDIP : 1;
4316 unsigned BCL1IP : 1;
4317 unsigned USBIP : 1;
4318 unsigned CM1IP : 1;
4319 unsigned CM2IP : 1;
4320 unsigned OSCFIP : 1;
4323 struct
4325 unsigned : 1;
4326 unsigned : 1;
4327 unsigned : 1;
4328 unsigned BCLIP : 1;
4329 unsigned : 1;
4330 unsigned : 1;
4331 unsigned : 1;
4332 unsigned : 1;
4334 } __IPR2bits_t;
4336 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4338 #define _CCP2IP 0x01
4339 #define _TMR3IP 0x02
4340 #define _LVDIP 0x04
4341 #define _BCL1IP 0x08
4342 #define _BCLIP 0x08
4343 #define _USBIP 0x10
4344 #define _CM1IP 0x20
4345 #define _CM2IP 0x40
4346 #define _OSCFIP 0x80
4348 //==============================================================================
4351 //==============================================================================
4352 // PIE3 Bits
4354 extern __at(0x0FA3) __sfr PIE3;
4356 typedef struct
4358 unsigned CCP3IE : 1;
4359 unsigned CCP4IE : 1;
4360 unsigned CCP5IE : 1;
4361 unsigned TMR4IE : 1;
4362 unsigned TX2IE : 1;
4363 unsigned RC2IE : 1;
4364 unsigned BCL2IE : 1;
4365 unsigned SSP2IE : 1;
4366 } __PIE3bits_t;
4368 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4370 #define _CCP3IE 0x01
4371 #define _CCP4IE 0x02
4372 #define _CCP5IE 0x04
4373 #define _TMR4IE 0x08
4374 #define _TX2IE 0x10
4375 #define _RC2IE 0x20
4376 #define _BCL2IE 0x40
4377 #define _SSP2IE 0x80
4379 //==============================================================================
4382 //==============================================================================
4383 // PIR3 Bits
4385 extern __at(0x0FA4) __sfr PIR3;
4387 typedef struct
4389 unsigned CCP3IF : 1;
4390 unsigned CCP4IF : 1;
4391 unsigned CCP5IF : 1;
4392 unsigned TMR4IF : 1;
4393 unsigned TX2IF : 1;
4394 unsigned RC2IF : 1;
4395 unsigned BCL2IF : 1;
4396 unsigned SSP2IF : 1;
4397 } __PIR3bits_t;
4399 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
4401 #define _CCP3IF 0x01
4402 #define _CCP4IF 0x02
4403 #define _CCP5IF 0x04
4404 #define _TMR4IF 0x08
4405 #define _TX2IF 0x10
4406 #define _RC2IF 0x20
4407 #define _BCL2IF 0x40
4408 #define _SSP2IF 0x80
4410 //==============================================================================
4413 //==============================================================================
4414 // IPR3 Bits
4416 extern __at(0x0FA5) __sfr IPR3;
4418 typedef struct
4420 unsigned CCP3IP : 1;
4421 unsigned CCP4IP : 1;
4422 unsigned CCP5IP : 1;
4423 unsigned TMR4IP : 1;
4424 unsigned TX2IP : 1;
4425 unsigned RC2IP : 1;
4426 unsigned BCL2IP : 1;
4427 unsigned SSP2IP : 1;
4428 } __IPR3bits_t;
4430 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4432 #define _CCP3IP 0x01
4433 #define _CCP4IP 0x02
4434 #define _CCP5IP 0x04
4435 #define _TMR4IP 0x08
4436 #define _TX2IP 0x10
4437 #define _RC2IP 0x20
4438 #define _BCL2IP 0x40
4439 #define _SSP2IP 0x80
4441 //==============================================================================
4444 //==============================================================================
4445 // EECON1 Bits
4447 extern __at(0x0FA6) __sfr EECON1;
4449 typedef struct
4451 unsigned : 1;
4452 unsigned WR : 1;
4453 unsigned WREN : 1;
4454 unsigned WRERR : 1;
4455 unsigned FREE : 1;
4456 unsigned WPROG : 1;
4457 unsigned : 1;
4458 unsigned : 1;
4459 } __EECON1bits_t;
4461 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
4463 #define _WR 0x02
4464 #define _WREN 0x04
4465 #define _WRERR 0x08
4466 #define _FREE 0x10
4467 #define _WPROG 0x20
4469 //==============================================================================
4471 extern __at(0x0FA7) __sfr EECON2;
4473 //==============================================================================
4474 // TXSTA2 Bits
4476 extern __at(0x0FA8) __sfr TXSTA2;
4478 typedef union
4480 struct
4482 unsigned TX9D : 1;
4483 unsigned TRMT : 1;
4484 unsigned BRGH : 1;
4485 unsigned SENDB : 1;
4486 unsigned SYNC : 1;
4487 unsigned TXEN : 1;
4488 unsigned TX9 : 1;
4489 unsigned CSRC : 1;
4492 struct
4494 unsigned TXD8 : 1;
4495 unsigned TRMT2 : 1;
4496 unsigned BRGH2 : 1;
4497 unsigned SENDB2 : 1;
4498 unsigned SYNC2 : 1;
4499 unsigned TXEN2 : 1;
4500 unsigned TX8_9 : 1;
4501 unsigned CSRC2 : 1;
4504 struct
4506 unsigned TX9D2 : 1;
4507 unsigned : 1;
4508 unsigned : 1;
4509 unsigned : 1;
4510 unsigned : 1;
4511 unsigned : 1;
4512 unsigned NOT_TX8 : 1;
4513 unsigned : 1;
4516 struct
4518 unsigned : 1;
4519 unsigned : 1;
4520 unsigned : 1;
4521 unsigned : 1;
4522 unsigned : 1;
4523 unsigned : 1;
4524 unsigned TX92 : 1;
4525 unsigned : 1;
4527 } __TXSTA2bits_t;
4529 extern __at(0x0FA8) volatile __TXSTA2bits_t TXSTA2bits;
4531 #define _TXSTA2_TX9D 0x01
4532 #define _TXSTA2_TXD8 0x01
4533 #define _TXSTA2_TX9D2 0x01
4534 #define _TXSTA2_TRMT 0x02
4535 #define _TXSTA2_TRMT2 0x02
4536 #define _TXSTA2_BRGH 0x04
4537 #define _TXSTA2_BRGH2 0x04
4538 #define _TXSTA2_SENDB 0x08
4539 #define _TXSTA2_SENDB2 0x08
4540 #define _TXSTA2_SYNC 0x10
4541 #define _TXSTA2_SYNC2 0x10
4542 #define _TXSTA2_TXEN 0x20
4543 #define _TXSTA2_TXEN2 0x20
4544 #define _TXSTA2_TX9 0x40
4545 #define _TXSTA2_TX8_9 0x40
4546 #define _TXSTA2_NOT_TX8 0x40
4547 #define _TXSTA2_TX92 0x40
4548 #define _TXSTA2_CSRC 0x80
4549 #define _TXSTA2_CSRC2 0x80
4551 //==============================================================================
4553 extern __at(0x0FA9) __sfr TXREG2;
4554 extern __at(0x0FAA) __sfr RCREG2;
4555 extern __at(0x0FAB) __sfr SPBRG2;
4557 //==============================================================================
4558 // RCSTA Bits
4560 extern __at(0x0FAC) __sfr RCSTA;
4562 typedef union
4564 struct
4566 unsigned RX9D : 1;
4567 unsigned OERR : 1;
4568 unsigned FERR : 1;
4569 unsigned ADDEN : 1;
4570 unsigned CREN : 1;
4571 unsigned SREN : 1;
4572 unsigned RX9 : 1;
4573 unsigned SPEN : 1;
4576 struct
4578 unsigned RCD8 : 1;
4579 unsigned OERR1 : 1;
4580 unsigned FERR1 : 1;
4581 unsigned ADDEN1 : 1;
4582 unsigned CREN1 : 1;
4583 unsigned SREN1 : 1;
4584 unsigned RC9 : 1;
4585 unsigned SPEN1 : 1;
4588 struct
4590 unsigned RX9D1 : 1;
4591 unsigned : 1;
4592 unsigned : 1;
4593 unsigned : 1;
4594 unsigned : 1;
4595 unsigned : 1;
4596 unsigned NOT_RC8 : 1;
4597 unsigned : 1;
4600 struct
4602 unsigned : 1;
4603 unsigned : 1;
4604 unsigned : 1;
4605 unsigned : 1;
4606 unsigned : 1;
4607 unsigned : 1;
4608 unsigned RC8_9 : 1;
4609 unsigned : 1;
4612 struct
4614 unsigned : 1;
4615 unsigned : 1;
4616 unsigned : 1;
4617 unsigned : 1;
4618 unsigned : 1;
4619 unsigned : 1;
4620 unsigned RX91 : 1;
4621 unsigned : 1;
4623 } __RCSTAbits_t;
4625 extern __at(0x0FAC) volatile __RCSTAbits_t RCSTAbits;
4627 #define _RX9D 0x01
4628 #define _RCD8 0x01
4629 #define _RX9D1 0x01
4630 #define _OERR 0x02
4631 #define _OERR1 0x02
4632 #define _FERR 0x04
4633 #define _FERR1 0x04
4634 #define _ADDEN 0x08
4635 #define _ADDEN1 0x08
4636 #define _CREN 0x10
4637 #define _CREN1 0x10
4638 #define _SREN 0x20
4639 #define _SREN1 0x20
4640 #define _RX9 0x40
4641 #define _RC9 0x40
4642 #define _NOT_RC8 0x40
4643 #define _RC8_9 0x40
4644 #define _RX91 0x40
4645 #define _SPEN 0x80
4646 #define _SPEN1 0x80
4648 //==============================================================================
4651 //==============================================================================
4652 // RCSTA1 Bits
4654 extern __at(0x0FAC) __sfr RCSTA1;
4656 typedef union
4658 struct
4660 unsigned RX9D : 1;
4661 unsigned OERR : 1;
4662 unsigned FERR : 1;
4663 unsigned ADDEN : 1;
4664 unsigned CREN : 1;
4665 unsigned SREN : 1;
4666 unsigned RX9 : 1;
4667 unsigned SPEN : 1;
4670 struct
4672 unsigned RCD8 : 1;
4673 unsigned OERR1 : 1;
4674 unsigned FERR1 : 1;
4675 unsigned ADDEN1 : 1;
4676 unsigned CREN1 : 1;
4677 unsigned SREN1 : 1;
4678 unsigned RC9 : 1;
4679 unsigned SPEN1 : 1;
4682 struct
4684 unsigned RX9D1 : 1;
4685 unsigned : 1;
4686 unsigned : 1;
4687 unsigned : 1;
4688 unsigned : 1;
4689 unsigned : 1;
4690 unsigned NOT_RC8 : 1;
4691 unsigned : 1;
4694 struct
4696 unsigned : 1;
4697 unsigned : 1;
4698 unsigned : 1;
4699 unsigned : 1;
4700 unsigned : 1;
4701 unsigned : 1;
4702 unsigned RC8_9 : 1;
4703 unsigned : 1;
4706 struct
4708 unsigned : 1;
4709 unsigned : 1;
4710 unsigned : 1;
4711 unsigned : 1;
4712 unsigned : 1;
4713 unsigned : 1;
4714 unsigned RX91 : 1;
4715 unsigned : 1;
4717 } __RCSTA1bits_t;
4719 extern __at(0x0FAC) volatile __RCSTA1bits_t RCSTA1bits;
4721 #define _RCSTA1_RX9D 0x01
4722 #define _RCSTA1_RCD8 0x01
4723 #define _RCSTA1_RX9D1 0x01
4724 #define _RCSTA1_OERR 0x02
4725 #define _RCSTA1_OERR1 0x02
4726 #define _RCSTA1_FERR 0x04
4727 #define _RCSTA1_FERR1 0x04
4728 #define _RCSTA1_ADDEN 0x08
4729 #define _RCSTA1_ADDEN1 0x08
4730 #define _RCSTA1_CREN 0x10
4731 #define _RCSTA1_CREN1 0x10
4732 #define _RCSTA1_SREN 0x20
4733 #define _RCSTA1_SREN1 0x20
4734 #define _RCSTA1_RX9 0x40
4735 #define _RCSTA1_RC9 0x40
4736 #define _RCSTA1_NOT_RC8 0x40
4737 #define _RCSTA1_RC8_9 0x40
4738 #define _RCSTA1_RX91 0x40
4739 #define _RCSTA1_SPEN 0x80
4740 #define _RCSTA1_SPEN1 0x80
4742 //==============================================================================
4745 //==============================================================================
4746 // TXSTA Bits
4748 extern __at(0x0FAD) __sfr TXSTA;
4750 typedef union
4752 struct
4754 unsigned TX9D : 1;
4755 unsigned TRMT : 1;
4756 unsigned BRGH : 1;
4757 unsigned SENDB : 1;
4758 unsigned SYNC : 1;
4759 unsigned TXEN : 1;
4760 unsigned TX9 : 1;
4761 unsigned CSRC : 1;
4764 struct
4766 unsigned TXD8 : 1;
4767 unsigned TRMT1 : 1;
4768 unsigned BRGH1 : 1;
4769 unsigned SENDB1 : 1;
4770 unsigned SYNC1 : 1;
4771 unsigned TXEN1 : 1;
4772 unsigned TX8_9 : 1;
4773 unsigned CSRC1 : 1;
4776 struct
4778 unsigned TX9D1 : 1;
4779 unsigned : 1;
4780 unsigned : 1;
4781 unsigned : 1;
4782 unsigned : 1;
4783 unsigned : 1;
4784 unsigned NOT_TX8 : 1;
4785 unsigned : 1;
4788 struct
4790 unsigned : 1;
4791 unsigned : 1;
4792 unsigned : 1;
4793 unsigned : 1;
4794 unsigned : 1;
4795 unsigned : 1;
4796 unsigned TX91 : 1;
4797 unsigned : 1;
4799 } __TXSTAbits_t;
4801 extern __at(0x0FAD) volatile __TXSTAbits_t TXSTAbits;
4803 #define _TX9D 0x01
4804 #define _TXD8 0x01
4805 #define _TX9D1 0x01
4806 #define _TRMT 0x02
4807 #define _TRMT1 0x02
4808 #define _BRGH 0x04
4809 #define _BRGH1 0x04
4810 #define _SENDB 0x08
4811 #define _SENDB1 0x08
4812 #define _SYNC 0x10
4813 #define _SYNC1 0x10
4814 #define _TXEN 0x20
4815 #define _TXEN1 0x20
4816 #define _TX9 0x40
4817 #define _TX8_9 0x40
4818 #define _NOT_TX8 0x40
4819 #define _TX91 0x40
4820 #define _CSRC 0x80
4821 #define _CSRC1 0x80
4823 //==============================================================================
4826 //==============================================================================
4827 // TXSTA1 Bits
4829 extern __at(0x0FAD) __sfr TXSTA1;
4831 typedef union
4833 struct
4835 unsigned TX9D : 1;
4836 unsigned TRMT : 1;
4837 unsigned BRGH : 1;
4838 unsigned SENDB : 1;
4839 unsigned SYNC : 1;
4840 unsigned TXEN : 1;
4841 unsigned TX9 : 1;
4842 unsigned CSRC : 1;
4845 struct
4847 unsigned TXD8 : 1;
4848 unsigned TRMT1 : 1;
4849 unsigned BRGH1 : 1;
4850 unsigned SENDB1 : 1;
4851 unsigned SYNC1 : 1;
4852 unsigned TXEN1 : 1;
4853 unsigned TX8_9 : 1;
4854 unsigned CSRC1 : 1;
4857 struct
4859 unsigned TX9D1 : 1;
4860 unsigned : 1;
4861 unsigned : 1;
4862 unsigned : 1;
4863 unsigned : 1;
4864 unsigned : 1;
4865 unsigned NOT_TX8 : 1;
4866 unsigned : 1;
4869 struct
4871 unsigned : 1;
4872 unsigned : 1;
4873 unsigned : 1;
4874 unsigned : 1;
4875 unsigned : 1;
4876 unsigned : 1;
4877 unsigned TX91 : 1;
4878 unsigned : 1;
4880 } __TXSTA1bits_t;
4882 extern __at(0x0FAD) volatile __TXSTA1bits_t TXSTA1bits;
4884 #define _TXSTA1_TX9D 0x01
4885 #define _TXSTA1_TXD8 0x01
4886 #define _TXSTA1_TX9D1 0x01
4887 #define _TXSTA1_TRMT 0x02
4888 #define _TXSTA1_TRMT1 0x02
4889 #define _TXSTA1_BRGH 0x04
4890 #define _TXSTA1_BRGH1 0x04
4891 #define _TXSTA1_SENDB 0x08
4892 #define _TXSTA1_SENDB1 0x08
4893 #define _TXSTA1_SYNC 0x10
4894 #define _TXSTA1_SYNC1 0x10
4895 #define _TXSTA1_TXEN 0x20
4896 #define _TXSTA1_TXEN1 0x20
4897 #define _TXSTA1_TX9 0x40
4898 #define _TXSTA1_TX8_9 0x40
4899 #define _TXSTA1_NOT_TX8 0x40
4900 #define _TXSTA1_TX91 0x40
4901 #define _TXSTA1_CSRC 0x80
4902 #define _TXSTA1_CSRC1 0x80
4904 //==============================================================================
4906 extern __at(0x0FAE) __sfr TXREG;
4907 extern __at(0x0FAE) __sfr TXREG1;
4908 extern __at(0x0FAF) __sfr RCREG;
4909 extern __at(0x0FAF) __sfr RCREG1;
4910 extern __at(0x0FB0) __sfr SPBRG;
4911 extern __at(0x0FB0) __sfr SPBRG1;
4913 //==============================================================================
4914 // CCP3CON Bits
4916 extern __at(0x0FB1) __sfr CCP3CON;
4918 typedef union
4920 struct
4922 unsigned CCP3M0 : 1;
4923 unsigned CCP3M1 : 1;
4924 unsigned CCP3M2 : 1;
4925 unsigned CCP3M3 : 1;
4926 unsigned DC3B0 : 1;
4927 unsigned DC3B1 : 1;
4928 unsigned P3M0 : 1;
4929 unsigned P3M1 : 1;
4932 struct
4934 unsigned : 1;
4935 unsigned : 1;
4936 unsigned : 1;
4937 unsigned : 1;
4938 unsigned CCP3Y : 1;
4939 unsigned CCP3X : 1;
4940 unsigned : 1;
4941 unsigned : 1;
4944 struct
4946 unsigned CCP3M : 4;
4947 unsigned : 4;
4950 struct
4952 unsigned : 4;
4953 unsigned DC3B : 2;
4954 unsigned : 2;
4957 struct
4959 unsigned : 6;
4960 unsigned P3M : 2;
4962 } __CCP3CONbits_t;
4964 extern __at(0x0FB1) volatile __CCP3CONbits_t CCP3CONbits;
4966 #define _CCP3M0 0x01
4967 #define _CCP3M1 0x02
4968 #define _CCP3M2 0x04
4969 #define _CCP3M3 0x08
4970 #define _DC3B0 0x10
4971 #define _CCP3Y 0x10
4972 #define _DC3B1 0x20
4973 #define _CCP3X 0x20
4974 #define _P3M0 0x40
4975 #define _P3M1 0x80
4977 //==============================================================================
4980 //==============================================================================
4981 // ECCP3CON Bits
4983 extern __at(0x0FB1) __sfr ECCP3CON;
4985 typedef union
4987 struct
4989 unsigned CCP3M0 : 1;
4990 unsigned CCP3M1 : 1;
4991 unsigned CCP3M2 : 1;
4992 unsigned CCP3M3 : 1;
4993 unsigned DC3B0 : 1;
4994 unsigned DC3B1 : 1;
4995 unsigned P3M0 : 1;
4996 unsigned P3M1 : 1;
4999 struct
5001 unsigned : 1;
5002 unsigned : 1;
5003 unsigned : 1;
5004 unsigned : 1;
5005 unsigned CCP3Y : 1;
5006 unsigned CCP3X : 1;
5007 unsigned : 1;
5008 unsigned : 1;
5011 struct
5013 unsigned CCP3M : 4;
5014 unsigned : 4;
5017 struct
5019 unsigned : 4;
5020 unsigned DC3B : 2;
5021 unsigned : 2;
5024 struct
5026 unsigned : 6;
5027 unsigned P3M : 2;
5029 } __ECCP3CONbits_t;
5031 extern __at(0x0FB1) volatile __ECCP3CONbits_t ECCP3CONbits;
5033 #define _ECCP3CON_CCP3M0 0x01
5034 #define _ECCP3CON_CCP3M1 0x02
5035 #define _ECCP3CON_CCP3M2 0x04
5036 #define _ECCP3CON_CCP3M3 0x08
5037 #define _ECCP3CON_DC3B0 0x10
5038 #define _ECCP3CON_CCP3Y 0x10
5039 #define _ECCP3CON_DC3B1 0x20
5040 #define _ECCP3CON_CCP3X 0x20
5041 #define _ECCP3CON_P3M0 0x40
5042 #define _ECCP3CON_P3M1 0x80
5044 //==============================================================================
5046 extern __at(0x0FB2) __sfr CCPR3;
5047 extern __at(0x0FB2) __sfr CCPR3L;
5048 extern __at(0x0FB3) __sfr CCPR3H;
5050 //==============================================================================
5051 // ECCP3DEL Bits
5053 extern __at(0x0FB4) __sfr ECCP3DEL;
5055 typedef union
5057 struct
5059 unsigned PDC0 : 1;
5060 unsigned PDC1 : 1;
5061 unsigned PDC2 : 1;
5062 unsigned PDC3 : 1;
5063 unsigned PDC4 : 1;
5064 unsigned PDC5 : 1;
5065 unsigned PDC6 : 1;
5066 unsigned PRSEN : 1;
5069 struct
5071 unsigned P3DC0 : 1;
5072 unsigned P3DC1 : 1;
5073 unsigned P3DC2 : 1;
5074 unsigned P3DC3 : 1;
5075 unsigned P3DC4 : 1;
5076 unsigned P3DC5 : 1;
5077 unsigned P3DC6 : 1;
5078 unsigned P3RSEN : 1;
5081 struct
5083 unsigned P3DC : 7;
5084 unsigned : 1;
5087 struct
5089 unsigned PDC : 7;
5090 unsigned : 1;
5092 } __ECCP3DELbits_t;
5094 extern __at(0x0FB4) volatile __ECCP3DELbits_t ECCP3DELbits;
5096 #define _ECCP3DEL_PDC0 0x01
5097 #define _ECCP3DEL_P3DC0 0x01
5098 #define _ECCP3DEL_PDC1 0x02
5099 #define _ECCP3DEL_P3DC1 0x02
5100 #define _ECCP3DEL_PDC2 0x04
5101 #define _ECCP3DEL_P3DC2 0x04
5102 #define _ECCP3DEL_PDC3 0x08
5103 #define _ECCP3DEL_P3DC3 0x08
5104 #define _ECCP3DEL_PDC4 0x10
5105 #define _ECCP3DEL_P3DC4 0x10
5106 #define _ECCP3DEL_PDC5 0x20
5107 #define _ECCP3DEL_P3DC5 0x20
5108 #define _ECCP3DEL_PDC6 0x40
5109 #define _ECCP3DEL_P3DC6 0x40
5110 #define _ECCP3DEL_PRSEN 0x80
5111 #define _ECCP3DEL_P3RSEN 0x80
5113 //==============================================================================
5116 //==============================================================================
5117 // ECCP3AS Bits
5119 extern __at(0x0FB5) __sfr ECCP3AS;
5121 typedef union
5123 struct
5125 unsigned PSSBD0 : 1;
5126 unsigned PSSBD1 : 1;
5127 unsigned PSSAC0 : 1;
5128 unsigned PSSAC1 : 1;
5129 unsigned ECCPAS0 : 1;
5130 unsigned ECCPAS1 : 1;
5131 unsigned ECCPAS2 : 1;
5132 unsigned ECCPASE : 1;
5135 struct
5137 unsigned PSS3BD0 : 1;
5138 unsigned PSS3BD1 : 1;
5139 unsigned PSS3AC0 : 1;
5140 unsigned PSS3AC1 : 1;
5141 unsigned ECCP3AS0 : 1;
5142 unsigned ECCP3AS1 : 1;
5143 unsigned ECCP3AS2 : 1;
5144 unsigned ECCP3ASE : 1;
5147 struct
5149 unsigned PSSBD : 2;
5150 unsigned : 6;
5153 struct
5155 unsigned PSS3BD : 2;
5156 unsigned : 6;
5159 struct
5161 unsigned : 2;
5162 unsigned PSSAC : 2;
5163 unsigned : 4;
5166 struct
5168 unsigned : 2;
5169 unsigned PSS3AC : 2;
5170 unsigned : 4;
5173 struct
5175 unsigned : 4;
5176 unsigned ECCP3AS : 3;
5177 unsigned : 1;
5180 struct
5182 unsigned : 4;
5183 unsigned ECCPAS : 3;
5184 unsigned : 1;
5186 } __ECCP3ASbits_t;
5188 extern __at(0x0FB5) volatile __ECCP3ASbits_t ECCP3ASbits;
5190 #define _ECCP3AS_PSSBD0 0x01
5191 #define _ECCP3AS_PSS3BD0 0x01
5192 #define _ECCP3AS_PSSBD1 0x02
5193 #define _ECCP3AS_PSS3BD1 0x02
5194 #define _ECCP3AS_PSSAC0 0x04
5195 #define _ECCP3AS_PSS3AC0 0x04
5196 #define _ECCP3AS_PSSAC1 0x08
5197 #define _ECCP3AS_PSS3AC1 0x08
5198 #define _ECCP3AS_ECCPAS0 0x10
5199 #define _ECCP3AS_ECCP3AS0 0x10
5200 #define _ECCP3AS_ECCPAS1 0x20
5201 #define _ECCP3AS_ECCP3AS1 0x20
5202 #define _ECCP3AS_ECCPAS2 0x40
5203 #define _ECCP3AS_ECCP3AS2 0x40
5204 #define _ECCP3AS_ECCPASE 0x80
5205 #define _ECCP3AS_ECCP3ASE 0x80
5207 //==============================================================================
5210 //==============================================================================
5211 // CCP2CON Bits
5213 extern __at(0x0FB6) __sfr CCP2CON;
5215 typedef union
5217 struct
5219 unsigned CCP2M0 : 1;
5220 unsigned CCP2M1 : 1;
5221 unsigned CCP2M2 : 1;
5222 unsigned CCP2M3 : 1;
5223 unsigned DC2B0 : 1;
5224 unsigned DC2B1 : 1;
5225 unsigned P2M0 : 1;
5226 unsigned P2M1 : 1;
5229 struct
5231 unsigned : 1;
5232 unsigned : 1;
5233 unsigned : 1;
5234 unsigned : 1;
5235 unsigned CCP2Y : 1;
5236 unsigned CCP2X : 1;
5237 unsigned : 1;
5238 unsigned : 1;
5241 struct
5243 unsigned CCP2M : 4;
5244 unsigned : 4;
5247 struct
5249 unsigned : 4;
5250 unsigned DC2B : 2;
5251 unsigned : 2;
5254 struct
5256 unsigned : 6;
5257 unsigned P2M : 2;
5259 } __CCP2CONbits_t;
5261 extern __at(0x0FB6) volatile __CCP2CONbits_t CCP2CONbits;
5263 #define _CCP2M0 0x01
5264 #define _CCP2M1 0x02
5265 #define _CCP2M2 0x04
5266 #define _CCP2M3 0x08
5267 #define _DC2B0 0x10
5268 #define _CCP2Y 0x10
5269 #define _DC2B1 0x20
5270 #define _CCP2X 0x20
5271 #define _P2M0 0x40
5272 #define _P2M1 0x80
5274 //==============================================================================
5277 //==============================================================================
5278 // ECCP2CON Bits
5280 extern __at(0x0FB6) __sfr ECCP2CON;
5282 typedef union
5284 struct
5286 unsigned CCP2M0 : 1;
5287 unsigned CCP2M1 : 1;
5288 unsigned CCP2M2 : 1;
5289 unsigned CCP2M3 : 1;
5290 unsigned DC2B0 : 1;
5291 unsigned DC2B1 : 1;
5292 unsigned P2M0 : 1;
5293 unsigned P2M1 : 1;
5296 struct
5298 unsigned : 1;
5299 unsigned : 1;
5300 unsigned : 1;
5301 unsigned : 1;
5302 unsigned CCP2Y : 1;
5303 unsigned CCP2X : 1;
5304 unsigned : 1;
5305 unsigned : 1;
5308 struct
5310 unsigned CCP2M : 4;
5311 unsigned : 4;
5314 struct
5316 unsigned : 4;
5317 unsigned DC2B : 2;
5318 unsigned : 2;
5321 struct
5323 unsigned : 6;
5324 unsigned P2M : 2;
5326 } __ECCP2CONbits_t;
5328 extern __at(0x0FB6) volatile __ECCP2CONbits_t ECCP2CONbits;
5330 #define _ECCP2CON_CCP2M0 0x01
5331 #define _ECCP2CON_CCP2M1 0x02
5332 #define _ECCP2CON_CCP2M2 0x04
5333 #define _ECCP2CON_CCP2M3 0x08
5334 #define _ECCP2CON_DC2B0 0x10
5335 #define _ECCP2CON_CCP2Y 0x10
5336 #define _ECCP2CON_DC2B1 0x20
5337 #define _ECCP2CON_CCP2X 0x20
5338 #define _ECCP2CON_P2M0 0x40
5339 #define _ECCP2CON_P2M1 0x80
5341 //==============================================================================
5343 extern __at(0x0FB7) __sfr CCPR2;
5344 extern __at(0x0FB7) __sfr CCPR2L;
5345 extern __at(0x0FB8) __sfr CCPR2H;
5347 //==============================================================================
5348 // ECCP2DEL Bits
5350 extern __at(0x0FB9) __sfr ECCP2DEL;
5352 typedef union
5354 struct
5356 unsigned PDC0 : 1;
5357 unsigned PDC1 : 1;
5358 unsigned PDC2 : 1;
5359 unsigned PDC3 : 1;
5360 unsigned PDC4 : 1;
5361 unsigned PDC5 : 1;
5362 unsigned PDC6 : 1;
5363 unsigned PRSEN : 1;
5366 struct
5368 unsigned P2DC0 : 1;
5369 unsigned P2DC1 : 1;
5370 unsigned P2DC2 : 1;
5371 unsigned P2DC3 : 1;
5372 unsigned P2DC4 : 1;
5373 unsigned P2DC5 : 1;
5374 unsigned P2DC6 : 1;
5375 unsigned P2RSEN : 1;
5378 struct
5380 unsigned P2DC : 7;
5381 unsigned : 1;
5384 struct
5386 unsigned PDC : 7;
5387 unsigned : 1;
5389 } __ECCP2DELbits_t;
5391 extern __at(0x0FB9) volatile __ECCP2DELbits_t ECCP2DELbits;
5393 #define _ECCP2DEL_PDC0 0x01
5394 #define _ECCP2DEL_P2DC0 0x01
5395 #define _ECCP2DEL_PDC1 0x02
5396 #define _ECCP2DEL_P2DC1 0x02
5397 #define _ECCP2DEL_PDC2 0x04
5398 #define _ECCP2DEL_P2DC2 0x04
5399 #define _ECCP2DEL_PDC3 0x08
5400 #define _ECCP2DEL_P2DC3 0x08
5401 #define _ECCP2DEL_PDC4 0x10
5402 #define _ECCP2DEL_P2DC4 0x10
5403 #define _ECCP2DEL_PDC5 0x20
5404 #define _ECCP2DEL_P2DC5 0x20
5405 #define _ECCP2DEL_PDC6 0x40
5406 #define _ECCP2DEL_P2DC6 0x40
5407 #define _ECCP2DEL_PRSEN 0x80
5408 #define _ECCP2DEL_P2RSEN 0x80
5410 //==============================================================================
5413 //==============================================================================
5414 // ECCP2AS Bits
5416 extern __at(0x0FBA) __sfr ECCP2AS;
5418 typedef union
5420 struct
5422 unsigned PSSBD0 : 1;
5423 unsigned PSSBD1 : 1;
5424 unsigned PSSAC0 : 1;
5425 unsigned PSSAC1 : 1;
5426 unsigned ECCPAS0 : 1;
5427 unsigned ECCPAS1 : 1;
5428 unsigned ECCPAS2 : 1;
5429 unsigned ECCPASE : 1;
5432 struct
5434 unsigned PSS2BD0 : 1;
5435 unsigned PSS2BD1 : 1;
5436 unsigned PSS2AC0 : 1;
5437 unsigned PSS2AC1 : 1;
5438 unsigned ECCP2AS0 : 1;
5439 unsigned ECCP2AS1 : 1;
5440 unsigned ECCP2AS2 : 1;
5441 unsigned ECCP2ASE : 1;
5444 struct
5446 unsigned PSS2BD : 2;
5447 unsigned : 6;
5450 struct
5452 unsigned PSSBD : 2;
5453 unsigned : 6;
5456 struct
5458 unsigned : 2;
5459 unsigned PSS2AC : 2;
5460 unsigned : 4;
5463 struct
5465 unsigned : 2;
5466 unsigned PSSAC : 2;
5467 unsigned : 4;
5470 struct
5472 unsigned : 4;
5473 unsigned ECCP2AS : 3;
5474 unsigned : 1;
5477 struct
5479 unsigned : 4;
5480 unsigned ECCPAS : 3;
5481 unsigned : 1;
5483 } __ECCP2ASbits_t;
5485 extern __at(0x0FBA) volatile __ECCP2ASbits_t ECCP2ASbits;
5487 #define _ECCP2AS_PSSBD0 0x01
5488 #define _ECCP2AS_PSS2BD0 0x01
5489 #define _ECCP2AS_PSSBD1 0x02
5490 #define _ECCP2AS_PSS2BD1 0x02
5491 #define _ECCP2AS_PSSAC0 0x04
5492 #define _ECCP2AS_PSS2AC0 0x04
5493 #define _ECCP2AS_PSSAC1 0x08
5494 #define _ECCP2AS_PSS2AC1 0x08
5495 #define _ECCP2AS_ECCPAS0 0x10
5496 #define _ECCP2AS_ECCP2AS0 0x10
5497 #define _ECCP2AS_ECCPAS1 0x20
5498 #define _ECCP2AS_ECCP2AS1 0x20
5499 #define _ECCP2AS_ECCPAS2 0x40
5500 #define _ECCP2AS_ECCP2AS2 0x40
5501 #define _ECCP2AS_ECCPASE 0x80
5502 #define _ECCP2AS_ECCP2ASE 0x80
5504 //==============================================================================
5507 //==============================================================================
5508 // CCP1CON Bits
5510 extern __at(0x0FBB) __sfr CCP1CON;
5512 typedef union
5514 struct
5516 unsigned CCP1M0 : 1;
5517 unsigned CCP1M1 : 1;
5518 unsigned CCP1M2 : 1;
5519 unsigned CCP1M3 : 1;
5520 unsigned DC1B0 : 1;
5521 unsigned DC1B1 : 1;
5522 unsigned P1M0 : 1;
5523 unsigned P1M1 : 1;
5526 struct
5528 unsigned : 1;
5529 unsigned : 1;
5530 unsigned : 1;
5531 unsigned : 1;
5532 unsigned CCP1Y : 1;
5533 unsigned CCP1X : 1;
5534 unsigned : 1;
5535 unsigned : 1;
5538 struct
5540 unsigned CCP1M : 4;
5541 unsigned : 4;
5544 struct
5546 unsigned : 4;
5547 unsigned DC1B : 2;
5548 unsigned : 2;
5551 struct
5553 unsigned : 6;
5554 unsigned P1M : 2;
5556 } __CCP1CONbits_t;
5558 extern __at(0x0FBB) volatile __CCP1CONbits_t CCP1CONbits;
5560 #define _CCP1M0 0x01
5561 #define _CCP1M1 0x02
5562 #define _CCP1M2 0x04
5563 #define _CCP1M3 0x08
5564 #define _DC1B0 0x10
5565 #define _CCP1Y 0x10
5566 #define _DC1B1 0x20
5567 #define _CCP1X 0x20
5568 #define _P1M0 0x40
5569 #define _P1M1 0x80
5571 //==============================================================================
5574 //==============================================================================
5575 // ECCP1CON Bits
5577 extern __at(0x0FBB) __sfr ECCP1CON;
5579 typedef union
5581 struct
5583 unsigned CCP1M0 : 1;
5584 unsigned CCP1M1 : 1;
5585 unsigned CCP1M2 : 1;
5586 unsigned CCP1M3 : 1;
5587 unsigned DC1B0 : 1;
5588 unsigned DC1B1 : 1;
5589 unsigned P1M0 : 1;
5590 unsigned P1M1 : 1;
5593 struct
5595 unsigned : 1;
5596 unsigned : 1;
5597 unsigned : 1;
5598 unsigned : 1;
5599 unsigned CCP1Y : 1;
5600 unsigned CCP1X : 1;
5601 unsigned : 1;
5602 unsigned : 1;
5605 struct
5607 unsigned CCP1M : 4;
5608 unsigned : 4;
5611 struct
5613 unsigned : 4;
5614 unsigned DC1B : 2;
5615 unsigned : 2;
5618 struct
5620 unsigned : 6;
5621 unsigned P1M : 2;
5623 } __ECCP1CONbits_t;
5625 extern __at(0x0FBB) volatile __ECCP1CONbits_t ECCP1CONbits;
5627 #define _ECCP1CON_CCP1M0 0x01
5628 #define _ECCP1CON_CCP1M1 0x02
5629 #define _ECCP1CON_CCP1M2 0x04
5630 #define _ECCP1CON_CCP1M3 0x08
5631 #define _ECCP1CON_DC1B0 0x10
5632 #define _ECCP1CON_CCP1Y 0x10
5633 #define _ECCP1CON_DC1B1 0x20
5634 #define _ECCP1CON_CCP1X 0x20
5635 #define _ECCP1CON_P1M0 0x40
5636 #define _ECCP1CON_P1M1 0x80
5638 //==============================================================================
5640 extern __at(0x0FBC) __sfr CCPR1;
5641 extern __at(0x0FBC) __sfr CCPR1L;
5642 extern __at(0x0FBD) __sfr CCPR1H;
5644 //==============================================================================
5645 // ECCP1DEL Bits
5647 extern __at(0x0FBE) __sfr ECCP1DEL;
5649 typedef union
5651 struct
5653 unsigned PDC0 : 1;
5654 unsigned PDC1 : 1;
5655 unsigned PDC2 : 1;
5656 unsigned PDC3 : 1;
5657 unsigned PDC4 : 1;
5658 unsigned PDC5 : 1;
5659 unsigned PDC6 : 1;
5660 unsigned PRSEN : 1;
5663 struct
5665 unsigned P1DC0 : 1;
5666 unsigned P1DC1 : 1;
5667 unsigned P1DC2 : 1;
5668 unsigned P1DC3 : 1;
5669 unsigned P1DC4 : 1;
5670 unsigned P1DC5 : 1;
5671 unsigned P1DC6 : 1;
5672 unsigned P1RSEN : 1;
5675 struct
5677 unsigned PDC : 7;
5678 unsigned : 1;
5681 struct
5683 unsigned P1DC : 7;
5684 unsigned : 1;
5686 } __ECCP1DELbits_t;
5688 extern __at(0x0FBE) volatile __ECCP1DELbits_t ECCP1DELbits;
5690 #define _PDC0 0x01
5691 #define _P1DC0 0x01
5692 #define _PDC1 0x02
5693 #define _P1DC1 0x02
5694 #define _PDC2 0x04
5695 #define _P1DC2 0x04
5696 #define _PDC3 0x08
5697 #define _P1DC3 0x08
5698 #define _PDC4 0x10
5699 #define _P1DC4 0x10
5700 #define _PDC5 0x20
5701 #define _P1DC5 0x20
5702 #define _PDC6 0x40
5703 #define _P1DC6 0x40
5704 #define _PRSEN 0x80
5705 #define _P1RSEN 0x80
5707 //==============================================================================
5710 //==============================================================================
5711 // ECCP1AS Bits
5713 extern __at(0x0FBF) __sfr ECCP1AS;
5715 typedef union
5717 struct
5719 unsigned PSSBD0 : 1;
5720 unsigned PSSBD1 : 1;
5721 unsigned PSSAC0 : 1;
5722 unsigned PSSAC1 : 1;
5723 unsigned ECCPAS0 : 1;
5724 unsigned ECCPAS1 : 1;
5725 unsigned ECCPAS2 : 1;
5726 unsigned ECCPASE : 1;
5729 struct
5731 unsigned PSS1BD0 : 1;
5732 unsigned PSS1BD1 : 1;
5733 unsigned PSS1AC0 : 1;
5734 unsigned PSS1AC1 : 1;
5735 unsigned ECCP1AS0 : 1;
5736 unsigned ECCP1AS1 : 1;
5737 unsigned ECCP1AS2 : 1;
5738 unsigned ECCP1ASE : 1;
5741 struct
5743 unsigned PSS1BD : 2;
5744 unsigned : 6;
5747 struct
5749 unsigned PSSBD : 2;
5750 unsigned : 6;
5753 struct
5755 unsigned : 2;
5756 unsigned PSS1AC : 2;
5757 unsigned : 4;
5760 struct
5762 unsigned : 2;
5763 unsigned PSSAC : 2;
5764 unsigned : 4;
5767 struct
5769 unsigned : 4;
5770 unsigned ECCPAS : 3;
5771 unsigned : 1;
5774 struct
5776 unsigned : 4;
5777 unsigned ECCP1AS : 3;
5778 unsigned : 1;
5780 } __ECCP1ASbits_t;
5782 extern __at(0x0FBF) volatile __ECCP1ASbits_t ECCP1ASbits;
5784 #define _PSSBD0 0x01
5785 #define _PSS1BD0 0x01
5786 #define _PSSBD1 0x02
5787 #define _PSS1BD1 0x02
5788 #define _PSSAC0 0x04
5789 #define _PSS1AC0 0x04
5790 #define _PSSAC1 0x08
5791 #define _PSS1AC1 0x08
5792 #define _ECCPAS0 0x10
5793 #define _ECCP1AS0 0x10
5794 #define _ECCPAS1 0x20
5795 #define _ECCP1AS1 0x20
5796 #define _ECCPAS2 0x40
5797 #define _ECCP1AS2 0x40
5798 #define _ECCPASE 0x80
5799 #define _ECCP1ASE 0x80
5801 //==============================================================================
5804 //==============================================================================
5805 // WDTCON Bits
5807 extern __at(0x0FC0) __sfr WDTCON;
5809 typedef union
5811 struct
5813 unsigned SWDTEN : 1;
5814 unsigned : 1;
5815 unsigned : 1;
5816 unsigned : 1;
5817 unsigned ADSHR : 1;
5818 unsigned : 1;
5819 unsigned LVDSTAT : 1;
5820 unsigned REGSLP : 1;
5823 struct
5825 unsigned SWDTE : 1;
5826 unsigned : 1;
5827 unsigned : 1;
5828 unsigned : 1;
5829 unsigned DEVCFG : 1;
5830 unsigned : 1;
5831 unsigned : 1;
5832 unsigned : 1;
5834 } __WDTCONbits_t;
5836 extern __at(0x0FC0) volatile __WDTCONbits_t WDTCONbits;
5838 #define _SWDTEN 0x01
5839 #define _SWDTE 0x01
5840 #define _ADSHR 0x10
5841 #define _DEVCFG 0x10
5842 #define _LVDSTAT 0x40
5843 #define _REGSLP 0x80
5845 //==============================================================================
5848 //==============================================================================
5849 // ADCON1 Bits
5851 extern __at(0x0FC1) __sfr ADCON1;
5853 typedef union
5855 struct
5857 unsigned ADCS0 : 1;
5858 unsigned ADCS1 : 1;
5859 unsigned ADCS2 : 1;
5860 unsigned ACQT0 : 1;
5861 unsigned ACQT1 : 1;
5862 unsigned ACQT2 : 1;
5863 unsigned ADCAL : 1;
5864 unsigned ADFM : 1;
5867 struct
5869 unsigned ADCS : 3;
5870 unsigned : 5;
5873 struct
5875 unsigned : 3;
5876 unsigned ACQT : 3;
5877 unsigned : 2;
5879 } __ADCON1bits_t;
5881 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5883 #define _ADCS0 0x01
5884 #define _ADCS1 0x02
5885 #define _ADCS2 0x04
5886 #define _ACQT0 0x08
5887 #define _ACQT1 0x10
5888 #define _ACQT2 0x20
5889 #define _ADCAL 0x40
5890 #define _ADFM 0x80
5892 //==============================================================================
5895 //==============================================================================
5896 // ANCON0 Bits
5898 extern __at(0x0FC1) __sfr ANCON0;
5900 typedef struct
5902 unsigned PCFG0 : 1;
5903 unsigned PCFG1 : 1;
5904 unsigned PCFG2 : 1;
5905 unsigned PCFG3 : 1;
5906 unsigned PCFG4 : 1;
5907 unsigned : 1;
5908 unsigned : 1;
5909 unsigned PCFG7 : 1;
5910 } __ANCON0bits_t;
5912 extern __at(0x0FC1) volatile __ANCON0bits_t ANCON0bits;
5914 #define _PCFG0 0x01
5915 #define _PCFG1 0x02
5916 #define _PCFG2 0x04
5917 #define _PCFG3 0x08
5918 #define _PCFG4 0x10
5919 #define _PCFG7 0x80
5921 //==============================================================================
5924 //==============================================================================
5925 // ADCON0 Bits
5927 extern __at(0x0FC2) __sfr ADCON0;
5929 typedef union
5931 struct
5933 unsigned ADON : 1;
5934 unsigned GO_NOT_DONE : 1;
5935 unsigned CHS0 : 1;
5936 unsigned CHS1 : 1;
5937 unsigned CHS2 : 1;
5938 unsigned CHS3 : 1;
5939 unsigned VCFG0 : 1;
5940 unsigned VCFG1 : 1;
5943 struct
5945 unsigned : 1;
5946 unsigned DONE : 1;
5947 unsigned : 1;
5948 unsigned : 1;
5949 unsigned : 1;
5950 unsigned : 1;
5951 unsigned : 1;
5952 unsigned : 1;
5955 struct
5957 unsigned : 1;
5958 unsigned GO_DONE : 1;
5959 unsigned : 1;
5960 unsigned : 1;
5961 unsigned : 1;
5962 unsigned : 1;
5963 unsigned : 1;
5964 unsigned : 1;
5967 struct
5969 unsigned : 1;
5970 unsigned GO : 1;
5971 unsigned : 1;
5972 unsigned : 1;
5973 unsigned : 1;
5974 unsigned : 1;
5975 unsigned : 1;
5976 unsigned : 1;
5979 struct
5981 unsigned : 1;
5982 unsigned NOT_DONE : 1;
5983 unsigned : 1;
5984 unsigned : 1;
5985 unsigned : 1;
5986 unsigned : 1;
5987 unsigned : 1;
5988 unsigned : 1;
5991 struct
5993 unsigned : 2;
5994 unsigned CHS : 4;
5995 unsigned : 2;
5998 struct
6000 unsigned : 6;
6001 unsigned VCFG : 2;
6003 } __ADCON0bits_t;
6005 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
6007 #define _ADON 0x01
6008 #define _GO_NOT_DONE 0x02
6009 #define _DONE 0x02
6010 #define _GO_DONE 0x02
6011 #define _GO 0x02
6012 #define _NOT_DONE 0x02
6013 #define _CHS0 0x04
6014 #define _CHS1 0x08
6015 #define _CHS2 0x10
6016 #define _CHS3 0x20
6017 #define _VCFG0 0x40
6018 #define _VCFG1 0x80
6020 //==============================================================================
6023 //==============================================================================
6024 // ANCON1 Bits
6026 extern __at(0x0FC2) __sfr ANCON1;
6028 typedef struct
6030 unsigned : 1;
6031 unsigned : 1;
6032 unsigned PCFG10 : 1;
6033 unsigned PCFG11 : 1;
6034 unsigned PCFG12 : 1;
6035 unsigned PCFG13 : 1;
6036 unsigned PCFG14 : 1;
6037 unsigned PCFG15 : 1;
6038 } __ANCON1bits_t;
6040 extern __at(0x0FC2) volatile __ANCON1bits_t ANCON1bits;
6042 #define _PCFG10 0x04
6043 #define _PCFG11 0x08
6044 #define _PCFG12 0x10
6045 #define _PCFG13 0x20
6046 #define _PCFG14 0x40
6047 #define _PCFG15 0x80
6049 //==============================================================================
6051 extern __at(0x0FC3) __sfr ADRES;
6052 extern __at(0x0FC3) __sfr ADRESL;
6053 extern __at(0x0FC4) __sfr ADRESH;
6055 //==============================================================================
6056 // SSP1CON2 Bits
6058 extern __at(0x0FC5) __sfr SSP1CON2;
6060 typedef union
6062 struct
6064 unsigned SEN : 1;
6065 unsigned RSEN : 1;
6066 unsigned PEN : 1;
6067 unsigned RCEN : 1;
6068 unsigned ACKEN : 1;
6069 unsigned ACKDT : 1;
6070 unsigned ACKSTAT : 1;
6071 unsigned GCEN : 1;
6074 struct
6076 unsigned : 1;
6077 unsigned ADMSK1 : 1;
6078 unsigned ADMSK2 : 1;
6079 unsigned ADMSK3 : 1;
6080 unsigned ADMSK4 : 1;
6081 unsigned ADMSK5 : 1;
6082 unsigned : 1;
6083 unsigned : 1;
6085 } __SSP1CON2bits_t;
6087 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
6089 #define _SEN 0x01
6090 #define _RSEN 0x02
6091 #define _ADMSK1 0x02
6092 #define _PEN 0x04
6093 #define _ADMSK2 0x04
6094 #define _RCEN 0x08
6095 #define _ADMSK3 0x08
6096 #define _ACKEN 0x10
6097 #define _ADMSK4 0x10
6098 #define _ACKDT 0x20
6099 #define _ADMSK5 0x20
6100 #define _ACKSTAT 0x40
6101 #define _GCEN 0x80
6103 //==============================================================================
6106 //==============================================================================
6107 // SSPCON2 Bits
6109 extern __at(0x0FC5) __sfr SSPCON2;
6111 typedef union
6113 struct
6115 unsigned SEN : 1;
6116 unsigned RSEN : 1;
6117 unsigned PEN : 1;
6118 unsigned RCEN : 1;
6119 unsigned ACKEN : 1;
6120 unsigned ACKDT : 1;
6121 unsigned ACKSTAT : 1;
6122 unsigned GCEN : 1;
6125 struct
6127 unsigned : 1;
6128 unsigned ADMSK1 : 1;
6129 unsigned ADMSK2 : 1;
6130 unsigned ADMSK3 : 1;
6131 unsigned ADMSK4 : 1;
6132 unsigned ADMSK5 : 1;
6133 unsigned : 1;
6134 unsigned : 1;
6136 } __SSPCON2bits_t;
6138 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
6140 #define _SSPCON2_SEN 0x01
6141 #define _SSPCON2_RSEN 0x02
6142 #define _SSPCON2_ADMSK1 0x02
6143 #define _SSPCON2_PEN 0x04
6144 #define _SSPCON2_ADMSK2 0x04
6145 #define _SSPCON2_RCEN 0x08
6146 #define _SSPCON2_ADMSK3 0x08
6147 #define _SSPCON2_ACKEN 0x10
6148 #define _SSPCON2_ADMSK4 0x10
6149 #define _SSPCON2_ACKDT 0x20
6150 #define _SSPCON2_ADMSK5 0x20
6151 #define _SSPCON2_ACKSTAT 0x40
6152 #define _SSPCON2_GCEN 0x80
6154 //==============================================================================
6157 //==============================================================================
6158 // SSP1CON1 Bits
6160 extern __at(0x0FC6) __sfr SSP1CON1;
6162 typedef union
6164 struct
6166 unsigned SSPM0 : 1;
6167 unsigned SSPM1 : 1;
6168 unsigned SSPM2 : 1;
6169 unsigned SSPM3 : 1;
6170 unsigned CKP : 1;
6171 unsigned SSPEN : 1;
6172 unsigned SSPOV : 1;
6173 unsigned WCOL : 1;
6176 struct
6178 unsigned SSPM : 4;
6179 unsigned : 4;
6181 } __SSP1CON1bits_t;
6183 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
6185 #define _SSPM0 0x01
6186 #define _SSPM1 0x02
6187 #define _SSPM2 0x04
6188 #define _SSPM3 0x08
6189 #define _CKP 0x10
6190 #define _SSPEN 0x20
6191 #define _SSPOV 0x40
6192 #define _WCOL 0x80
6194 //==============================================================================
6197 //==============================================================================
6198 // SSPCON1 Bits
6200 extern __at(0x0FC6) __sfr SSPCON1;
6202 typedef union
6204 struct
6206 unsigned SSPM0 : 1;
6207 unsigned SSPM1 : 1;
6208 unsigned SSPM2 : 1;
6209 unsigned SSPM3 : 1;
6210 unsigned CKP : 1;
6211 unsigned SSPEN : 1;
6212 unsigned SSPOV : 1;
6213 unsigned WCOL : 1;
6216 struct
6218 unsigned SSPM : 4;
6219 unsigned : 4;
6221 } __SSPCON1bits_t;
6223 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
6225 #define _SSPCON1_SSPM0 0x01
6226 #define _SSPCON1_SSPM1 0x02
6227 #define _SSPCON1_SSPM2 0x04
6228 #define _SSPCON1_SSPM3 0x08
6229 #define _SSPCON1_CKP 0x10
6230 #define _SSPCON1_SSPEN 0x20
6231 #define _SSPCON1_SSPOV 0x40
6232 #define _SSPCON1_WCOL 0x80
6234 //==============================================================================
6237 //==============================================================================
6238 // SSP1STAT Bits
6240 extern __at(0x0FC7) __sfr SSP1STAT;
6242 typedef union
6244 struct
6246 unsigned BF : 1;
6247 unsigned UA : 1;
6248 unsigned R_NOT_W : 1;
6249 unsigned S : 1;
6250 unsigned P : 1;
6251 unsigned D_NOT_A : 1;
6252 unsigned CKE : 1;
6253 unsigned SMP : 1;
6256 struct
6258 unsigned : 1;
6259 unsigned : 1;
6260 unsigned R_W : 1;
6261 unsigned I2C_START : 1;
6262 unsigned I2C_STOP : 1;
6263 unsigned D_A : 1;
6264 unsigned : 1;
6265 unsigned : 1;
6268 struct
6270 unsigned : 1;
6271 unsigned : 1;
6272 unsigned I2C_READ : 1;
6273 unsigned : 1;
6274 unsigned : 1;
6275 unsigned I2C_DAT : 1;
6276 unsigned : 1;
6277 unsigned : 1;
6280 struct
6282 unsigned : 1;
6283 unsigned : 1;
6284 unsigned NOT_W : 1;
6285 unsigned : 1;
6286 unsigned : 1;
6287 unsigned NOT_A : 1;
6288 unsigned : 1;
6289 unsigned : 1;
6292 struct
6294 unsigned : 1;
6295 unsigned : 1;
6296 unsigned NOT_WRITE : 1;
6297 unsigned : 1;
6298 unsigned : 1;
6299 unsigned NOT_ADDRESS : 1;
6300 unsigned : 1;
6301 unsigned : 1;
6304 struct
6306 unsigned : 1;
6307 unsigned : 1;
6308 unsigned READ_WRITE : 1;
6309 unsigned : 1;
6310 unsigned : 1;
6311 unsigned DATA_ADDRESS : 1;
6312 unsigned : 1;
6313 unsigned : 1;
6316 struct
6318 unsigned : 1;
6319 unsigned : 1;
6320 unsigned R : 1;
6321 unsigned : 1;
6322 unsigned : 1;
6323 unsigned D : 1;
6324 unsigned : 1;
6325 unsigned : 1;
6327 } __SSP1STATbits_t;
6329 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
6331 #define _BF 0x01
6332 #define _UA 0x02
6333 #define _R_NOT_W 0x04
6334 #define _R_W 0x04
6335 #define _I2C_READ 0x04
6336 #define _NOT_W 0x04
6337 #define _NOT_WRITE 0x04
6338 #define _READ_WRITE 0x04
6339 #define _R 0x04
6340 #define _S 0x08
6341 #define _I2C_START 0x08
6342 #define _P 0x10
6343 #define _I2C_STOP 0x10
6344 #define _D_NOT_A 0x20
6345 #define _D_A 0x20
6346 #define _I2C_DAT 0x20
6347 #define _NOT_A 0x20
6348 #define _NOT_ADDRESS 0x20
6349 #define _DATA_ADDRESS 0x20
6350 #define _D 0x20
6351 #define _CKE 0x40
6352 #define _SMP 0x80
6354 //==============================================================================
6357 //==============================================================================
6358 // SSPSTAT Bits
6360 extern __at(0x0FC7) __sfr SSPSTAT;
6362 typedef union
6364 struct
6366 unsigned BF : 1;
6367 unsigned UA : 1;
6368 unsigned R_NOT_W : 1;
6369 unsigned S : 1;
6370 unsigned P : 1;
6371 unsigned D_NOT_A : 1;
6372 unsigned CKE : 1;
6373 unsigned SMP : 1;
6376 struct
6378 unsigned : 1;
6379 unsigned : 1;
6380 unsigned R_W : 1;
6381 unsigned I2C_START : 1;
6382 unsigned I2C_STOP : 1;
6383 unsigned D_A : 1;
6384 unsigned : 1;
6385 unsigned : 1;
6388 struct
6390 unsigned : 1;
6391 unsigned : 1;
6392 unsigned I2C_READ : 1;
6393 unsigned : 1;
6394 unsigned : 1;
6395 unsigned I2C_DAT : 1;
6396 unsigned : 1;
6397 unsigned : 1;
6400 struct
6402 unsigned : 1;
6403 unsigned : 1;
6404 unsigned NOT_W : 1;
6405 unsigned : 1;
6406 unsigned : 1;
6407 unsigned NOT_A : 1;
6408 unsigned : 1;
6409 unsigned : 1;
6412 struct
6414 unsigned : 1;
6415 unsigned : 1;
6416 unsigned NOT_WRITE : 1;
6417 unsigned : 1;
6418 unsigned : 1;
6419 unsigned NOT_ADDRESS : 1;
6420 unsigned : 1;
6421 unsigned : 1;
6424 struct
6426 unsigned : 1;
6427 unsigned : 1;
6428 unsigned READ_WRITE : 1;
6429 unsigned : 1;
6430 unsigned : 1;
6431 unsigned DATA_ADDRESS : 1;
6432 unsigned : 1;
6433 unsigned : 1;
6436 struct
6438 unsigned : 1;
6439 unsigned : 1;
6440 unsigned R : 1;
6441 unsigned : 1;
6442 unsigned : 1;
6443 unsigned D : 1;
6444 unsigned : 1;
6445 unsigned : 1;
6447 } __SSPSTATbits_t;
6449 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
6451 #define _SSPSTAT_BF 0x01
6452 #define _SSPSTAT_UA 0x02
6453 #define _SSPSTAT_R_NOT_W 0x04
6454 #define _SSPSTAT_R_W 0x04
6455 #define _SSPSTAT_I2C_READ 0x04
6456 #define _SSPSTAT_NOT_W 0x04
6457 #define _SSPSTAT_NOT_WRITE 0x04
6458 #define _SSPSTAT_READ_WRITE 0x04
6459 #define _SSPSTAT_R 0x04
6460 #define _SSPSTAT_S 0x08
6461 #define _SSPSTAT_I2C_START 0x08
6462 #define _SSPSTAT_P 0x10
6463 #define _SSPSTAT_I2C_STOP 0x10
6464 #define _SSPSTAT_D_NOT_A 0x20
6465 #define _SSPSTAT_D_A 0x20
6466 #define _SSPSTAT_I2C_DAT 0x20
6467 #define _SSPSTAT_NOT_A 0x20
6468 #define _SSPSTAT_NOT_ADDRESS 0x20
6469 #define _SSPSTAT_DATA_ADDRESS 0x20
6470 #define _SSPSTAT_D 0x20
6471 #define _SSPSTAT_CKE 0x40
6472 #define _SSPSTAT_SMP 0x80
6474 //==============================================================================
6476 extern __at(0x0FC8) __sfr SSP1ADD;
6478 //==============================================================================
6479 // SSP1MSK Bits
6481 extern __at(0x0FC8) __sfr SSP1MSK;
6483 typedef struct
6485 unsigned MSK0 : 1;
6486 unsigned MSK1 : 1;
6487 unsigned MSK2 : 1;
6488 unsigned MSK3 : 1;
6489 unsigned MSK4 : 1;
6490 unsigned MSK5 : 1;
6491 unsigned MSK6 : 1;
6492 unsigned MSK7 : 1;
6493 } __SSP1MSKbits_t;
6495 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
6497 #define _MSK0 0x01
6498 #define _MSK1 0x02
6499 #define _MSK2 0x04
6500 #define _MSK3 0x08
6501 #define _MSK4 0x10
6502 #define _MSK5 0x20
6503 #define _MSK6 0x40
6504 #define _MSK7 0x80
6506 //==============================================================================
6508 extern __at(0x0FC8) __sfr SSPADD;
6509 extern __at(0x0FC9) __sfr SSP1BUF;
6510 extern __at(0x0FC9) __sfr SSPBUF;
6512 //==============================================================================
6513 // T2CON Bits
6515 extern __at(0x0FCA) __sfr T2CON;
6517 typedef union
6519 struct
6521 unsigned T2CKPS0 : 1;
6522 unsigned T2CKPS1 : 1;
6523 unsigned TMR2ON : 1;
6524 unsigned T2OUTPS0 : 1;
6525 unsigned T2OUTPS1 : 1;
6526 unsigned T2OUTPS2 : 1;
6527 unsigned T2OUTPS3 : 1;
6528 unsigned : 1;
6531 struct
6533 unsigned T2CKPS : 2;
6534 unsigned : 6;
6537 struct
6539 unsigned : 3;
6540 unsigned T2OUTPS : 4;
6541 unsigned : 1;
6543 } __T2CONbits_t;
6545 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
6547 #define _T2CKPS0 0x01
6548 #define _T2CKPS1 0x02
6549 #define _TMR2ON 0x04
6550 #define _T2OUTPS0 0x08
6551 #define _T2OUTPS1 0x10
6552 #define _T2OUTPS2 0x20
6553 #define _T2OUTPS3 0x40
6555 //==============================================================================
6558 //==============================================================================
6559 // MEMCON Bits
6561 extern __at(0x0FCB) __sfr MEMCON;
6563 typedef union
6565 struct
6567 unsigned WM0 : 1;
6568 unsigned WM1 : 1;
6569 unsigned : 1;
6570 unsigned : 1;
6571 unsigned WAIT0 : 1;
6572 unsigned WAIT1 : 1;
6573 unsigned : 1;
6574 unsigned EBDIS : 1;
6577 struct
6579 unsigned : 1;
6580 unsigned : 1;
6581 unsigned : 1;
6582 unsigned : 1;
6583 unsigned : 1;
6584 unsigned : 1;
6585 unsigned : 1;
6586 unsigned EDBIS : 1;
6589 struct
6591 unsigned WM : 2;
6592 unsigned : 6;
6595 struct
6597 unsigned : 4;
6598 unsigned WAIT : 2;
6599 unsigned : 2;
6601 } __MEMCONbits_t;
6603 extern __at(0x0FCB) volatile __MEMCONbits_t MEMCONbits;
6605 #define _WM0 0x01
6606 #define _WM1 0x02
6607 #define _WAIT0 0x10
6608 #define _WAIT1 0x20
6609 #define _EBDIS 0x80
6610 #define _EDBIS 0x80
6612 //==============================================================================
6614 extern __at(0x0FCB) __sfr PR2;
6616 //==============================================================================
6617 // PADCFG1 Bits
6619 extern __at(0x0FCC) __sfr PADCFG1;
6621 typedef union
6623 struct
6625 unsigned PMPTL : 1;
6626 unsigned : 1;
6627 unsigned : 1;
6628 unsigned : 1;
6629 unsigned : 1;
6630 unsigned : 1;
6631 unsigned : 1;
6632 unsigned : 1;
6635 struct
6637 unsigned PMPTTL : 1;
6638 unsigned : 1;
6639 unsigned : 1;
6640 unsigned : 1;
6641 unsigned : 1;
6642 unsigned : 1;
6643 unsigned : 1;
6644 unsigned : 1;
6646 } __PADCFG1bits_t;
6648 extern __at(0x0FCC) volatile __PADCFG1bits_t PADCFG1bits;
6650 #define _PMPTL 0x01
6651 #define _PMPTTL 0x01
6653 //==============================================================================
6655 extern __at(0x0FCC) __sfr TMR2;
6657 //==============================================================================
6658 // ODCON3 Bits
6660 extern __at(0x0FCD) __sfr ODCON3;
6662 typedef struct
6664 unsigned SPI1OD : 1;
6665 unsigned SPI2OD : 1;
6666 unsigned : 1;
6667 unsigned : 1;
6668 unsigned : 1;
6669 unsigned : 1;
6670 unsigned : 1;
6671 unsigned : 1;
6672 } __ODCON3bits_t;
6674 extern __at(0x0FCD) volatile __ODCON3bits_t ODCON3bits;
6676 #define _SPI1OD 0x01
6677 #define _SPI2OD 0x02
6679 //==============================================================================
6682 //==============================================================================
6683 // T1CON Bits
6685 extern __at(0x0FCD) __sfr T1CON;
6687 typedef union
6689 struct
6691 unsigned TMR1ON : 1;
6692 unsigned TMR1CS : 1;
6693 unsigned NOT_T1SYNC : 1;
6694 unsigned T1OSCEN : 1;
6695 unsigned T1CKPS0 : 1;
6696 unsigned T1CKPS1 : 1;
6697 unsigned T1RUN : 1;
6698 unsigned RD16 : 1;
6701 struct
6703 unsigned : 1;
6704 unsigned : 1;
6705 unsigned T1SYNC : 1;
6706 unsigned : 1;
6707 unsigned : 1;
6708 unsigned : 1;
6709 unsigned : 1;
6710 unsigned : 1;
6713 struct
6715 unsigned : 1;
6716 unsigned : 1;
6717 unsigned T1INSYNC : 1;
6718 unsigned : 1;
6719 unsigned : 1;
6720 unsigned : 1;
6721 unsigned : 1;
6722 unsigned : 1;
6725 struct
6727 unsigned : 4;
6728 unsigned T1CKPS : 2;
6729 unsigned : 2;
6731 } __T1CONbits_t;
6733 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6735 #define _TMR1ON 0x01
6736 #define _TMR1CS 0x02
6737 #define _NOT_T1SYNC 0x04
6738 #define _T1SYNC 0x04
6739 #define _T1INSYNC 0x04
6740 #define _T1OSCEN 0x08
6741 #define _T1CKPS0 0x10
6742 #define _T1CKPS1 0x20
6743 #define _T1RUN 0x40
6744 #define _RD16 0x80
6746 //==============================================================================
6749 //==============================================================================
6750 // ODCON2 Bits
6752 extern __at(0x0FCE) __sfr ODCON2;
6754 typedef union
6756 struct
6758 unsigned USART1OD : 1;
6759 unsigned USART2OD : 1;
6760 unsigned : 1;
6761 unsigned : 1;
6762 unsigned : 1;
6763 unsigned : 1;
6764 unsigned : 1;
6765 unsigned : 1;
6768 struct
6770 unsigned U1OD : 1;
6771 unsigned U2OD : 1;
6772 unsigned : 1;
6773 unsigned : 1;
6774 unsigned : 1;
6775 unsigned : 1;
6776 unsigned : 1;
6777 unsigned : 1;
6779 } __ODCON2bits_t;
6781 extern __at(0x0FCE) volatile __ODCON2bits_t ODCON2bits;
6783 #define _USART1OD 0x01
6784 #define _U1OD 0x01
6785 #define _USART2OD 0x02
6786 #define _U2OD 0x02
6788 //==============================================================================
6790 extern __at(0x0FCE) __sfr TMR1;
6791 extern __at(0x0FCE) __sfr TMR1L;
6793 //==============================================================================
6794 // ODCON1 Bits
6796 extern __at(0x0FCF) __sfr ODCON1;
6798 typedef struct
6800 unsigned ECCP1OD : 1;
6801 unsigned ECCP2OD : 1;
6802 unsigned ECCP3OD : 1;
6803 unsigned CCP4OD : 1;
6804 unsigned CCP5OD : 1;
6805 unsigned : 1;
6806 unsigned : 1;
6807 unsigned : 1;
6808 } __ODCON1bits_t;
6810 extern __at(0x0FCF) volatile __ODCON1bits_t ODCON1bits;
6812 #define _ECCP1OD 0x01
6813 #define _ECCP2OD 0x02
6814 #define _ECCP3OD 0x04
6815 #define _CCP4OD 0x08
6816 #define _CCP5OD 0x10
6818 //==============================================================================
6820 extern __at(0x0FCF) __sfr TMR1H;
6822 //==============================================================================
6823 // RCON Bits
6825 extern __at(0x0FD0) __sfr RCON;
6827 typedef union
6829 struct
6831 unsigned NOT_BOR : 1;
6832 unsigned NOT_POR : 1;
6833 unsigned NOT_PD : 1;
6834 unsigned NOT_TO : 1;
6835 unsigned NOT_RI : 1;
6836 unsigned NOT_CM : 1;
6837 unsigned : 1;
6838 unsigned IPEN : 1;
6841 struct
6843 unsigned BOR : 1;
6844 unsigned POR : 1;
6845 unsigned PD : 1;
6846 unsigned TO : 1;
6847 unsigned RI : 1;
6848 unsigned CM : 1;
6849 unsigned : 1;
6850 unsigned : 1;
6852 } __RCONbits_t;
6854 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6856 #define _NOT_BOR 0x01
6857 #define _BOR 0x01
6858 #define _NOT_POR 0x02
6859 #define _POR 0x02
6860 #define _NOT_PD 0x04
6861 #define _PD 0x04
6862 #define _NOT_TO 0x08
6863 #define _TO 0x08
6864 #define _NOT_RI 0x10
6865 #define _RI 0x10
6866 #define _NOT_CM 0x20
6867 #define _CM 0x20
6868 #define _IPEN 0x80
6870 //==============================================================================
6873 //==============================================================================
6874 // CM2CON Bits
6876 extern __at(0x0FD1) __sfr CM2CON;
6878 typedef union
6880 struct
6882 unsigned C1CH0 : 1;
6883 unsigned C1CH1 : 1;
6884 unsigned CREF : 1;
6885 unsigned EVPOL0 : 1;
6886 unsigned EVPOL1 : 1;
6887 unsigned CPOL : 1;
6888 unsigned COE : 1;
6889 unsigned CON : 1;
6892 struct
6894 unsigned CCH0 : 1;
6895 unsigned CCH1 : 1;
6896 unsigned CREF2 : 1;
6897 unsigned EVPOL02 : 1;
6898 unsigned EVPOL12 : 1;
6899 unsigned CPOL2 : 1;
6900 unsigned COE2 : 1;
6901 unsigned CON2 : 1;
6904 struct
6906 unsigned C1CH02 : 1;
6907 unsigned C1CH12 : 1;
6908 unsigned : 1;
6909 unsigned : 1;
6910 unsigned : 1;
6911 unsigned : 1;
6912 unsigned : 1;
6913 unsigned : 1;
6916 struct
6918 unsigned CCH : 2;
6919 unsigned : 6;
6921 } __CM2CONbits_t;
6923 extern __at(0x0FD1) volatile __CM2CONbits_t CM2CONbits;
6925 #define _CM2CON_C1CH0 0x01
6926 #define _CM2CON_CCH0 0x01
6927 #define _CM2CON_C1CH02 0x01
6928 #define _CM2CON_C1CH1 0x02
6929 #define _CM2CON_CCH1 0x02
6930 #define _CM2CON_C1CH12 0x02
6931 #define _CM2CON_CREF 0x04
6932 #define _CM2CON_CREF2 0x04
6933 #define _CM2CON_EVPOL0 0x08
6934 #define _CM2CON_EVPOL02 0x08
6935 #define _CM2CON_EVPOL1 0x10
6936 #define _CM2CON_EVPOL12 0x10
6937 #define _CM2CON_CPOL 0x20
6938 #define _CM2CON_CPOL2 0x20
6939 #define _CM2CON_COE 0x40
6940 #define _CM2CON_COE2 0x40
6941 #define _CM2CON_CON 0x80
6942 #define _CM2CON_CON2 0x80
6944 //==============================================================================
6947 //==============================================================================
6948 // CM2CON1 Bits
6950 extern __at(0x0FD1) __sfr CM2CON1;
6952 typedef union
6954 struct
6956 unsigned C1CH0 : 1;
6957 unsigned C1CH1 : 1;
6958 unsigned CREF : 1;
6959 unsigned EVPOL0 : 1;
6960 unsigned EVPOL1 : 1;
6961 unsigned CPOL : 1;
6962 unsigned COE : 1;
6963 unsigned CON : 1;
6966 struct
6968 unsigned CCH0 : 1;
6969 unsigned CCH1 : 1;
6970 unsigned CREF2 : 1;
6971 unsigned EVPOL02 : 1;
6972 unsigned EVPOL12 : 1;
6973 unsigned CPOL2 : 1;
6974 unsigned COE2 : 1;
6975 unsigned CON2 : 1;
6978 struct
6980 unsigned C1CH02 : 1;
6981 unsigned C1CH12 : 1;
6982 unsigned : 1;
6983 unsigned : 1;
6984 unsigned : 1;
6985 unsigned : 1;
6986 unsigned : 1;
6987 unsigned : 1;
6990 struct
6992 unsigned CCH : 2;
6993 unsigned : 6;
6995 } __CM2CON1bits_t;
6997 extern __at(0x0FD1) volatile __CM2CON1bits_t CM2CON1bits;
6999 #define _CM2CON1_C1CH0 0x01
7000 #define _CM2CON1_CCH0 0x01
7001 #define _CM2CON1_C1CH02 0x01
7002 #define _CM2CON1_C1CH1 0x02
7003 #define _CM2CON1_CCH1 0x02
7004 #define _CM2CON1_C1CH12 0x02
7005 #define _CM2CON1_CREF 0x04
7006 #define _CM2CON1_CREF2 0x04
7007 #define _CM2CON1_EVPOL0 0x08
7008 #define _CM2CON1_EVPOL02 0x08
7009 #define _CM2CON1_EVPOL1 0x10
7010 #define _CM2CON1_EVPOL12 0x10
7011 #define _CM2CON1_CPOL 0x20
7012 #define _CM2CON1_CPOL2 0x20
7013 #define _CM2CON1_COE 0x40
7014 #define _CM2CON1_COE2 0x40
7015 #define _CM2CON1_CON 0x80
7016 #define _CM2CON1_CON2 0x80
7018 //==============================================================================
7021 //==============================================================================
7022 // CM1CON Bits
7024 extern __at(0x0FD2) __sfr CM1CON;
7026 typedef union
7028 struct
7030 unsigned C1CH0 : 1;
7031 unsigned C1CH1 : 1;
7032 unsigned CREF : 1;
7033 unsigned EVPOL0 : 1;
7034 unsigned EVPOL1 : 1;
7035 unsigned CPOL : 1;
7036 unsigned COE : 1;
7037 unsigned CON : 1;
7040 struct
7042 unsigned CCH0 : 1;
7043 unsigned CCH1 : 1;
7044 unsigned : 1;
7045 unsigned : 1;
7046 unsigned : 1;
7047 unsigned : 1;
7048 unsigned : 1;
7049 unsigned : 1;
7052 struct
7054 unsigned CCH : 2;
7055 unsigned : 6;
7058 struct
7060 unsigned C1CH : 2;
7061 unsigned : 6;
7064 struct
7066 unsigned : 3;
7067 unsigned EVPOL : 2;
7068 unsigned : 3;
7070 } __CM1CONbits_t;
7072 extern __at(0x0FD2) volatile __CM1CONbits_t CM1CONbits;
7074 #define _C1CH0 0x01
7075 #define _CCH0 0x01
7076 #define _C1CH1 0x02
7077 #define _CCH1 0x02
7078 #define _CREF 0x04
7079 #define _EVPOL0 0x08
7080 #define _EVPOL1 0x10
7081 #define _CPOL 0x20
7082 #define _COE 0x40
7083 #define _CON 0x80
7085 //==============================================================================
7088 //==============================================================================
7089 // CM1CON1 Bits
7091 extern __at(0x0FD2) __sfr CM1CON1;
7093 typedef union
7095 struct
7097 unsigned C1CH0 : 1;
7098 unsigned C1CH1 : 1;
7099 unsigned CREF : 1;
7100 unsigned EVPOL0 : 1;
7101 unsigned EVPOL1 : 1;
7102 unsigned CPOL : 1;
7103 unsigned COE : 1;
7104 unsigned CON : 1;
7107 struct
7109 unsigned CCH0 : 1;
7110 unsigned CCH1 : 1;
7111 unsigned : 1;
7112 unsigned : 1;
7113 unsigned : 1;
7114 unsigned : 1;
7115 unsigned : 1;
7116 unsigned : 1;
7119 struct
7121 unsigned CCH : 2;
7122 unsigned : 6;
7125 struct
7127 unsigned C1CH : 2;
7128 unsigned : 6;
7131 struct
7133 unsigned : 3;
7134 unsigned EVPOL : 2;
7135 unsigned : 3;
7137 } __CM1CON1bits_t;
7139 extern __at(0x0FD2) volatile __CM1CON1bits_t CM1CON1bits;
7141 #define _CM1CON1_C1CH0 0x01
7142 #define _CM1CON1_CCH0 0x01
7143 #define _CM1CON1_C1CH1 0x02
7144 #define _CM1CON1_CCH1 0x02
7145 #define _CM1CON1_CREF 0x04
7146 #define _CM1CON1_EVPOL0 0x08
7147 #define _CM1CON1_EVPOL1 0x10
7148 #define _CM1CON1_CPOL 0x20
7149 #define _CM1CON1_COE 0x40
7150 #define _CM1CON1_CON 0x80
7152 //==============================================================================
7155 //==============================================================================
7156 // OSCCON Bits
7158 extern __at(0x0FD3) __sfr OSCCON;
7160 typedef union
7162 struct
7164 unsigned SCS0 : 1;
7165 unsigned SCS1 : 1;
7166 unsigned : 1;
7167 unsigned OSTS : 1;
7168 unsigned IRCF0 : 1;
7169 unsigned IRCF1 : 1;
7170 unsigned IRCF2 : 1;
7171 unsigned IDLEN : 1;
7174 struct
7176 unsigned SCS : 2;
7177 unsigned : 6;
7180 struct
7182 unsigned : 4;
7183 unsigned IRCF : 3;
7184 unsigned : 1;
7186 } __OSCCONbits_t;
7188 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
7190 #define _SCS0 0x01
7191 #define _SCS1 0x02
7192 #define _OSTS 0x08
7193 #define _IRCF0 0x10
7194 #define _IRCF1 0x20
7195 #define _IRCF2 0x40
7196 #define _IDLEN 0x80
7198 //==============================================================================
7201 //==============================================================================
7202 // REFOCON Bits
7204 extern __at(0x0FD3) __sfr REFOCON;
7206 typedef union
7208 struct
7210 unsigned RODIV0 : 1;
7211 unsigned RODIV1 : 1;
7212 unsigned RODIV2 : 1;
7213 unsigned RODIV3 : 1;
7214 unsigned ROSEL : 1;
7215 unsigned ROSSLP : 1;
7216 unsigned : 1;
7217 unsigned ROON : 1;
7220 struct
7222 unsigned RODIV : 4;
7223 unsigned : 4;
7225 } __REFOCONbits_t;
7227 extern __at(0x0FD3) volatile __REFOCONbits_t REFOCONbits;
7229 #define _RODIV0 0x01
7230 #define _RODIV1 0x02
7231 #define _RODIV2 0x04
7232 #define _RODIV3 0x08
7233 #define _ROSEL 0x10
7234 #define _ROSSLP 0x20
7235 #define _ROON 0x80
7237 //==============================================================================
7240 //==============================================================================
7241 // T0CON Bits
7243 extern __at(0x0FD5) __sfr T0CON;
7245 typedef union
7247 struct
7249 unsigned T0PS0 : 1;
7250 unsigned T0PS1 : 1;
7251 unsigned T0PS2 : 1;
7252 unsigned PSA : 1;
7253 unsigned T0SE : 1;
7254 unsigned T0CS : 1;
7255 unsigned T08BIT : 1;
7256 unsigned TMR0ON : 1;
7259 struct
7261 unsigned : 1;
7262 unsigned : 1;
7263 unsigned : 1;
7264 unsigned T0PS3 : 1;
7265 unsigned : 1;
7266 unsigned : 1;
7267 unsigned : 1;
7268 unsigned : 1;
7271 struct
7273 unsigned T0PS : 4;
7274 unsigned : 4;
7276 } __T0CONbits_t;
7278 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
7280 #define _T0PS0 0x01
7281 #define _T0PS1 0x02
7282 #define _T0PS2 0x04
7283 #define _PSA 0x08
7284 #define _T0PS3 0x08
7285 #define _T0SE 0x10
7286 #define _T0CS 0x20
7287 #define _T08BIT 0x40
7288 #define _TMR0ON 0x80
7290 //==============================================================================
7292 extern __at(0x0FD6) __sfr TMR0;
7293 extern __at(0x0FD6) __sfr TMR0L;
7294 extern __at(0x0FD7) __sfr TMR0H;
7296 //==============================================================================
7297 // STATUS Bits
7299 extern __at(0x0FD8) __sfr STATUS;
7301 typedef struct
7303 unsigned C : 1;
7304 unsigned DC : 1;
7305 unsigned Z : 1;
7306 unsigned OV : 1;
7307 unsigned N : 1;
7308 unsigned : 1;
7309 unsigned : 1;
7310 unsigned : 1;
7311 } __STATUSbits_t;
7313 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
7315 #define _C 0x01
7316 #define _DC 0x02
7317 #define _Z 0x04
7318 #define _OV 0x08
7319 #define _N 0x10
7321 //==============================================================================
7323 extern __at(0x0FD9) __sfr FSR2L;
7324 extern __at(0x0FDA) __sfr FSR2H;
7325 extern __at(0x0FDB) __sfr PLUSW2;
7326 extern __at(0x0FDC) __sfr PREINC2;
7327 extern __at(0x0FDD) __sfr POSTDEC2;
7328 extern __at(0x0FDE) __sfr POSTINC2;
7329 extern __at(0x0FDF) __sfr INDF2;
7330 extern __at(0x0FE0) __sfr BSR;
7331 extern __at(0x0FE1) __sfr FSR1L;
7332 extern __at(0x0FE2) __sfr FSR1H;
7333 extern __at(0x0FE3) __sfr PLUSW1;
7334 extern __at(0x0FE4) __sfr PREINC1;
7335 extern __at(0x0FE5) __sfr POSTDEC1;
7336 extern __at(0x0FE6) __sfr POSTINC1;
7337 extern __at(0x0FE7) __sfr INDF1;
7338 extern __at(0x0FE8) __sfr WREG;
7339 extern __at(0x0FE9) __sfr FSR0L;
7340 extern __at(0x0FEA) __sfr FSR0H;
7341 extern __at(0x0FEB) __sfr PLUSW0;
7342 extern __at(0x0FEC) __sfr PREINC0;
7343 extern __at(0x0FED) __sfr POSTDEC0;
7344 extern __at(0x0FEE) __sfr POSTINC0;
7345 extern __at(0x0FEF) __sfr INDF0;
7347 //==============================================================================
7348 // INTCON3 Bits
7350 extern __at(0x0FF0) __sfr INTCON3;
7352 typedef union
7354 struct
7356 unsigned INT1IF : 1;
7357 unsigned INT2IF : 1;
7358 unsigned INT3IF : 1;
7359 unsigned INT1IE : 1;
7360 unsigned INT2IE : 1;
7361 unsigned INT3IE : 1;
7362 unsigned INT1IP : 1;
7363 unsigned INT2IP : 1;
7366 struct
7368 unsigned INT1F : 1;
7369 unsigned INT2F : 1;
7370 unsigned INT3F : 1;
7371 unsigned INT1E : 1;
7372 unsigned INT2E : 1;
7373 unsigned INT3E : 1;
7374 unsigned INT1P : 1;
7375 unsigned INT2P : 1;
7377 } __INTCON3bits_t;
7379 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
7381 #define _INT1IF 0x01
7382 #define _INT1F 0x01
7383 #define _INT2IF 0x02
7384 #define _INT2F 0x02
7385 #define _INT3IF 0x04
7386 #define _INT3F 0x04
7387 #define _INT1IE 0x08
7388 #define _INT1E 0x08
7389 #define _INT2IE 0x10
7390 #define _INT2E 0x10
7391 #define _INT3IE 0x20
7392 #define _INT3E 0x20
7393 #define _INT1IP 0x40
7394 #define _INT1P 0x40
7395 #define _INT2IP 0x80
7396 #define _INT2P 0x80
7398 //==============================================================================
7401 //==============================================================================
7402 // INTCON2 Bits
7404 extern __at(0x0FF1) __sfr INTCON2;
7406 typedef union
7408 struct
7410 unsigned RBIP : 1;
7411 unsigned INT3IP : 1;
7412 unsigned TMR0IP : 1;
7413 unsigned INTEDG3 : 1;
7414 unsigned INTEDG2 : 1;
7415 unsigned INTEDG1 : 1;
7416 unsigned INTEDG0 : 1;
7417 unsigned NOT_RBPU : 1;
7420 struct
7422 unsigned : 1;
7423 unsigned INT3P : 1;
7424 unsigned T0IP : 1;
7425 unsigned : 1;
7426 unsigned : 1;
7427 unsigned : 1;
7428 unsigned : 1;
7429 unsigned RBPU : 1;
7431 } __INTCON2bits_t;
7433 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
7435 #define _RBIP 0x01
7436 #define _INT3IP 0x02
7437 #define _INT3P 0x02
7438 #define _TMR0IP 0x04
7439 #define _T0IP 0x04
7440 #define _INTEDG3 0x08
7441 #define _INTEDG2 0x10
7442 #define _INTEDG1 0x20
7443 #define _INTEDG0 0x40
7444 #define _NOT_RBPU 0x80
7445 #define _RBPU 0x80
7447 //==============================================================================
7450 //==============================================================================
7451 // INTCON Bits
7453 extern __at(0x0FF2) __sfr INTCON;
7455 typedef union
7457 struct
7459 unsigned RBIF : 1;
7460 unsigned INT0IF : 1;
7461 unsigned TMR0IF : 1;
7462 unsigned RBIE : 1;
7463 unsigned INT0IE : 1;
7464 unsigned TMR0IE : 1;
7465 unsigned PEIE_GIEL : 1;
7466 unsigned GIE_GIEH : 1;
7469 struct
7471 unsigned : 1;
7472 unsigned INT0F : 1;
7473 unsigned T0IF : 1;
7474 unsigned : 1;
7475 unsigned INT0E : 1;
7476 unsigned T0IE : 1;
7477 unsigned PEIE : 1;
7478 unsigned GIE : 1;
7481 struct
7483 unsigned : 1;
7484 unsigned : 1;
7485 unsigned : 1;
7486 unsigned : 1;
7487 unsigned : 1;
7488 unsigned : 1;
7489 unsigned GIEL : 1;
7490 unsigned GIEH : 1;
7492 } __INTCONbits_t;
7494 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
7496 #define _RBIF 0x01
7497 #define _INT0IF 0x02
7498 #define _INT0F 0x02
7499 #define _TMR0IF 0x04
7500 #define _T0IF 0x04
7501 #define _RBIE 0x08
7502 #define _INT0IE 0x10
7503 #define _INT0E 0x10
7504 #define _TMR0IE 0x20
7505 #define _T0IE 0x20
7506 #define _PEIE_GIEL 0x40
7507 #define _PEIE 0x40
7508 #define _GIEL 0x40
7509 #define _GIE_GIEH 0x80
7510 #define _GIE 0x80
7511 #define _GIEH 0x80
7513 //==============================================================================
7515 extern __at(0x0FF3) __sfr PROD;
7516 extern __at(0x0FF3) __sfr PRODL;
7517 extern __at(0x0FF4) __sfr PRODH;
7518 extern __at(0x0FF5) __sfr TABLAT;
7519 extern __at(0x0FF6) __sfr TBLPTR;
7520 extern __at(0x0FF6) __sfr TBLPTRL;
7521 extern __at(0x0FF7) __sfr TBLPTRH;
7522 extern __at(0x0FF8) __sfr TBLPTRU;
7523 extern __at(0x0FF9) __sfr PC;
7524 extern __at(0x0FF9) __sfr PCL;
7525 extern __at(0x0FFA) __sfr PCLATH;
7526 extern __at(0x0FFB) __sfr PCLATU;
7528 //==============================================================================
7529 // STKPTR Bits
7531 extern __at(0x0FFC) __sfr STKPTR;
7533 typedef union
7535 struct
7537 unsigned STKPTR0 : 1;
7538 unsigned STKPTR1 : 1;
7539 unsigned STKPTR2 : 1;
7540 unsigned STKPTR3 : 1;
7541 unsigned STKPTR4 : 1;
7542 unsigned : 1;
7543 unsigned STKUNF : 1;
7544 unsigned STKFUL : 1;
7547 struct
7549 unsigned SP0 : 1;
7550 unsigned SP1 : 1;
7551 unsigned SP2 : 1;
7552 unsigned SP3 : 1;
7553 unsigned SP4 : 1;
7554 unsigned : 1;
7555 unsigned : 1;
7556 unsigned STKOVF : 1;
7559 struct
7561 unsigned SP : 5;
7562 unsigned : 3;
7565 struct
7567 unsigned STKPTR : 5;
7568 unsigned : 3;
7570 } __STKPTRbits_t;
7572 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
7574 #define _STKPTR0 0x01
7575 #define _SP0 0x01
7576 #define _STKPTR1 0x02
7577 #define _SP1 0x02
7578 #define _STKPTR2 0x04
7579 #define _SP2 0x04
7580 #define _STKPTR3 0x08
7581 #define _SP3 0x08
7582 #define _STKPTR4 0x10
7583 #define _SP4 0x10
7584 #define _STKUNF 0x40
7585 #define _STKFUL 0x80
7586 #define _STKOVF 0x80
7588 //==============================================================================
7590 extern __at(0x0FFD) __sfr TOS;
7591 extern __at(0x0FFD) __sfr TOSL;
7592 extern __at(0x0FFE) __sfr TOSH;
7593 extern __at(0x0FFF) __sfr TOSU;
7595 //==============================================================================
7597 // Configuration Addresses
7599 //==============================================================================
7601 #define __CONFIG1L 0x01FFF8
7602 #define __CONFIG1H 0x01FFF9
7603 #define __CONFIG2L 0x01FFFA
7604 #define __CONFIG2H 0x01FFFB
7605 #define __CONFIG3L 0x01FFFC
7606 #define __CONFIG3H 0x01FFFD
7608 //==============================================================================
7610 #endif // #ifndef __PIC18F87J50_H__