struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f83j11.h
blob172926a81119a3619a9281476c3e2b1cf3d0c996
1 /*
2 * This declarations of the PIC18F83J11 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:36 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 __PIC18F83J11_H__
26 #define __PIC18F83J11_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // RCSTA2 Bits
40 extern __at(0x0F60) __sfr RCSTA2;
42 typedef union
44 struct
46 unsigned RX9D : 1;
47 unsigned OERR : 1;
48 unsigned FERR : 1;
49 unsigned ADDEN : 1;
50 unsigned CREN : 1;
51 unsigned SREN : 1;
52 unsigned RX9 : 1;
53 unsigned SPEN : 1;
56 struct
58 unsigned RCD8 : 1;
59 unsigned OERR2 : 1;
60 unsigned FERR2 : 1;
61 unsigned ADDEN2 : 1;
62 unsigned CREN2 : 1;
63 unsigned SREN2 : 1;
64 unsigned RC9 : 1;
65 unsigned SPEN2 : 1;
68 struct
70 unsigned RX9D2 : 1;
71 unsigned : 1;
72 unsigned : 1;
73 unsigned : 1;
74 unsigned : 1;
75 unsigned : 1;
76 unsigned NOT_RC8 : 1;
77 unsigned : 1;
80 struct
82 unsigned : 1;
83 unsigned : 1;
84 unsigned : 1;
85 unsigned : 1;
86 unsigned : 1;
87 unsigned : 1;
88 unsigned RC8_9 : 1;
89 unsigned : 1;
92 struct
94 unsigned : 1;
95 unsigned : 1;
96 unsigned : 1;
97 unsigned : 1;
98 unsigned : 1;
99 unsigned : 1;
100 unsigned RX92 : 1;
101 unsigned : 1;
103 } __RCSTA2bits_t;
105 extern __at(0x0F60) volatile __RCSTA2bits_t RCSTA2bits;
107 #define _RCSTA2_RX9D 0x01
108 #define _RCSTA2_RCD8 0x01
109 #define _RCSTA2_RX9D2 0x01
110 #define _RCSTA2_OERR 0x02
111 #define _RCSTA2_OERR2 0x02
112 #define _RCSTA2_FERR 0x04
113 #define _RCSTA2_FERR2 0x04
114 #define _RCSTA2_ADDEN 0x08
115 #define _RCSTA2_ADDEN2 0x08
116 #define _RCSTA2_CREN 0x10
117 #define _RCSTA2_CREN2 0x10
118 #define _RCSTA2_SREN 0x20
119 #define _RCSTA2_SREN2 0x20
120 #define _RCSTA2_RX9 0x40
121 #define _RCSTA2_RC9 0x40
122 #define _RCSTA2_NOT_RC8 0x40
123 #define _RCSTA2_RC8_9 0x40
124 #define _RCSTA2_RX92 0x40
125 #define _RCSTA2_SPEN 0x80
126 #define _RCSTA2_SPEN2 0x80
128 //==============================================================================
131 //==============================================================================
132 // TXSTA2 Bits
134 extern __at(0x0F61) __sfr TXSTA2;
136 typedef union
138 struct
140 unsigned TX9D : 1;
141 unsigned TRMT : 1;
142 unsigned BRGH : 1;
143 unsigned SENDB2 : 1;
144 unsigned SYNC : 1;
145 unsigned TXEN : 1;
146 unsigned TX9 : 1;
147 unsigned CSRC : 1;
150 struct
152 unsigned TXD8 : 1;
153 unsigned TRMT2 : 1;
154 unsigned BRGH2 : 1;
155 unsigned : 1;
156 unsigned SYNC2 : 1;
157 unsigned TXEN2 : 1;
158 unsigned TX8_9 : 1;
159 unsigned CSRC2 : 1;
162 struct
164 unsigned TX9D2 : 1;
165 unsigned : 1;
166 unsigned : 1;
167 unsigned : 1;
168 unsigned : 1;
169 unsigned : 1;
170 unsigned NOT_TX8 : 1;
171 unsigned : 1;
174 struct
176 unsigned : 1;
177 unsigned : 1;
178 unsigned : 1;
179 unsigned : 1;
180 unsigned : 1;
181 unsigned : 1;
182 unsigned TX92 : 1;
183 unsigned : 1;
185 } __TXSTA2bits_t;
187 extern __at(0x0F61) volatile __TXSTA2bits_t TXSTA2bits;
189 #define _TXSTA2_TX9D 0x01
190 #define _TXSTA2_TXD8 0x01
191 #define _TXSTA2_TX9D2 0x01
192 #define _TXSTA2_TRMT 0x02
193 #define _TXSTA2_TRMT2 0x02
194 #define _TXSTA2_BRGH 0x04
195 #define _TXSTA2_BRGH2 0x04
196 #define _TXSTA2_SENDB2 0x08
197 #define _TXSTA2_SYNC 0x10
198 #define _TXSTA2_SYNC2 0x10
199 #define _TXSTA2_TXEN 0x20
200 #define _TXSTA2_TXEN2 0x20
201 #define _TXSTA2_TX9 0x40
202 #define _TXSTA2_TX8_9 0x40
203 #define _TXSTA2_NOT_TX8 0x40
204 #define _TXSTA2_TX92 0x40
205 #define _TXSTA2_CSRC 0x80
206 #define _TXSTA2_CSRC2 0x80
208 //==============================================================================
210 extern __at(0x0F62) __sfr TXREG2;
211 extern __at(0x0F63) __sfr RCREG2;
212 extern __at(0x0F64) __sfr SPBRG2;
214 //==============================================================================
215 // CCP2CON Bits
217 extern __at(0x0F65) __sfr CCP2CON;
219 typedef union
221 struct
223 unsigned CCP2M0 : 1;
224 unsigned CCP2M1 : 1;
225 unsigned CCP2M2 : 1;
226 unsigned CCP2M3 : 1;
227 unsigned DC2B0 : 1;
228 unsigned DC2B1 : 1;
229 unsigned : 1;
230 unsigned : 1;
233 struct
235 unsigned : 1;
236 unsigned : 1;
237 unsigned : 1;
238 unsigned : 1;
239 unsigned DCCP2Y : 1;
240 unsigned DCCP2X : 1;
241 unsigned : 1;
242 unsigned : 1;
245 struct
247 unsigned CCP2M : 4;
248 unsigned : 4;
251 struct
253 unsigned : 4;
254 unsigned DC2B : 2;
255 unsigned : 2;
257 } __CCP2CONbits_t;
259 extern __at(0x0F65) volatile __CCP2CONbits_t CCP2CONbits;
261 #define _CCP2M0 0x01
262 #define _CCP2M1 0x02
263 #define _CCP2M2 0x04
264 #define _CCP2M3 0x08
265 #define _DC2B0 0x10
266 #define _DCCP2Y 0x10
267 #define _DC2B1 0x20
268 #define _DCCP2X 0x20
270 //==============================================================================
272 extern __at(0x0F66) __sfr CCPR2;
273 extern __at(0x0F66) __sfr CCPR2L;
274 extern __at(0x0F67) __sfr CCPR2H;
276 //==============================================================================
277 // CCP1CON Bits
279 extern __at(0x0F68) __sfr CCP1CON;
281 typedef union
283 struct
285 unsigned CCP1M0 : 1;
286 unsigned CCP1M1 : 1;
287 unsigned CCP1M2 : 1;
288 unsigned CCP1M3 : 1;
289 unsigned DC1B0 : 1;
290 unsigned DC1B1 : 1;
291 unsigned : 1;
292 unsigned : 1;
295 struct
297 unsigned : 1;
298 unsigned : 1;
299 unsigned : 1;
300 unsigned : 1;
301 unsigned DCCP1Y : 1;
302 unsigned DCCP1X : 1;
303 unsigned : 1;
304 unsigned : 1;
307 struct
309 unsigned CCP1M : 4;
310 unsigned : 4;
313 struct
315 unsigned : 4;
316 unsigned DC1B : 2;
317 unsigned : 2;
319 } __CCP1CONbits_t;
321 extern __at(0x0F68) volatile __CCP1CONbits_t CCP1CONbits;
323 #define _CCP1M0 0x01
324 #define _CCP1M1 0x02
325 #define _CCP1M2 0x04
326 #define _CCP1M3 0x08
327 #define _DC1B0 0x10
328 #define _DCCP1Y 0x10
329 #define _DC1B1 0x20
330 #define _DCCP1X 0x20
332 //==============================================================================
334 extern __at(0x0F69) __sfr CCPR1;
335 extern __at(0x0F69) __sfr CCPR1L;
336 extern __at(0x0F6A) __sfr CCPR1H;
338 //==============================================================================
339 // BAUDCON1 Bits
341 extern __at(0x0F7E) __sfr BAUDCON1;
343 typedef union
345 struct
347 unsigned ABDEN : 1;
348 unsigned WUE : 1;
349 unsigned : 1;
350 unsigned BRG16 : 1;
351 unsigned TXCKP : 1;
352 unsigned RXDTP : 1;
353 unsigned RCIDL : 1;
354 unsigned ABDOVF : 1;
357 struct
359 unsigned : 1;
360 unsigned : 1;
361 unsigned : 1;
362 unsigned : 1;
363 unsigned SCKP : 1;
364 unsigned : 1;
365 unsigned RCMT : 1;
366 unsigned : 1;
368 } __BAUDCON1bits_t;
370 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
372 #define _ABDEN 0x01
373 #define _WUE 0x02
374 #define _BRG16 0x08
375 #define _TXCKP 0x10
376 #define _SCKP 0x10
377 #define _RXDTP 0x20
378 #define _RCIDL 0x40
379 #define _RCMT 0x40
380 #define _ABDOVF 0x80
382 //==============================================================================
384 extern __at(0x0F7F) __sfr SPBRGH1;
386 //==============================================================================
387 // PORTA Bits
389 extern __at(0x0F80) __sfr PORTA;
391 typedef union
393 struct
395 unsigned RA0 : 1;
396 unsigned RA1 : 1;
397 unsigned RA2 : 1;
398 unsigned RA3 : 1;
399 unsigned RA4 : 1;
400 unsigned RA5 : 1;
401 unsigned RA6 : 1;
402 unsigned RA7 : 1;
405 struct
407 unsigned AN0 : 1;
408 unsigned AN1 : 1;
409 unsigned AN2 : 1;
410 unsigned AN3 : 1;
411 unsigned T0CKI : 1;
412 unsigned AN4 : 1;
413 unsigned OSC2 : 1;
414 unsigned OSC1 : 1;
417 struct
419 unsigned : 1;
420 unsigned : 1;
421 unsigned VREFM : 1;
422 unsigned VREFP : 1;
423 unsigned : 1;
424 unsigned : 1;
425 unsigned CLKO : 1;
426 unsigned CLKI : 1;
428 } __PORTAbits_t;
430 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
432 #define _PORTA_RA0 0x01
433 #define _PORTA_AN0 0x01
434 #define _PORTA_RA1 0x02
435 #define _PORTA_AN1 0x02
436 #define _PORTA_RA2 0x04
437 #define _PORTA_AN2 0x04
438 #define _PORTA_VREFM 0x04
439 #define _PORTA_RA3 0x08
440 #define _PORTA_AN3 0x08
441 #define _PORTA_VREFP 0x08
442 #define _PORTA_RA4 0x10
443 #define _PORTA_T0CKI 0x10
444 #define _PORTA_RA5 0x20
445 #define _PORTA_AN4 0x20
446 #define _PORTA_RA6 0x40
447 #define _PORTA_OSC2 0x40
448 #define _PORTA_CLKO 0x40
449 #define _PORTA_RA7 0x80
450 #define _PORTA_OSC1 0x80
451 #define _PORTA_CLKI 0x80
453 //==============================================================================
456 //==============================================================================
457 // PORTB Bits
459 extern __at(0x0F81) __sfr PORTB;
461 typedef union
463 struct
465 unsigned RB0 : 1;
466 unsigned RB1 : 1;
467 unsigned RB2 : 1;
468 unsigned RB3 : 1;
469 unsigned RB4 : 1;
470 unsigned RB5 : 1;
471 unsigned RB6 : 1;
472 unsigned RB7 : 1;
475 struct
477 unsigned INT0 : 1;
478 unsigned INT1 : 1;
479 unsigned INT2 : 1;
480 unsigned INT3 : 1;
481 unsigned KBI0 : 1;
482 unsigned KBI1 : 1;
483 unsigned KBI2 : 1;
484 unsigned KBI3 : 1;
487 struct
489 unsigned : 1;
490 unsigned : 1;
491 unsigned : 1;
492 unsigned CCP2 : 1;
493 unsigned : 1;
494 unsigned : 1;
495 unsigned PGC : 1;
496 unsigned PGD : 1;
499 struct
501 unsigned INT : 4;
502 unsigned : 4;
505 struct
507 unsigned : 4;
508 unsigned KBI : 4;
510 } __PORTBbits_t;
512 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
514 #define _PORTB_RB0 0x01
515 #define _PORTB_INT0 0x01
516 #define _PORTB_RB1 0x02
517 #define _PORTB_INT1 0x02
518 #define _PORTB_RB2 0x04
519 #define _PORTB_INT2 0x04
520 #define _PORTB_RB3 0x08
521 #define _PORTB_INT3 0x08
522 #define _PORTB_CCP2 0x08
523 #define _PORTB_RB4 0x10
524 #define _PORTB_KBI0 0x10
525 #define _PORTB_RB5 0x20
526 #define _PORTB_KBI1 0x20
527 #define _PORTB_RB6 0x40
528 #define _PORTB_KBI2 0x40
529 #define _PORTB_PGC 0x40
530 #define _PORTB_RB7 0x80
531 #define _PORTB_KBI3 0x80
532 #define _PORTB_PGD 0x80
534 //==============================================================================
537 //==============================================================================
538 // PORTC Bits
540 extern __at(0x0F82) __sfr PORTC;
542 typedef union
544 struct
546 unsigned RC0 : 1;
547 unsigned RC1 : 1;
548 unsigned RC2 : 1;
549 unsigned RC3 : 1;
550 unsigned RC4 : 1;
551 unsigned RC5 : 1;
552 unsigned RC6 : 1;
553 unsigned RC7 : 1;
556 struct
558 unsigned T1OSO : 1;
559 unsigned T1OSI : 1;
560 unsigned CCP1 : 1;
561 unsigned SCL : 1;
562 unsigned SDA : 1;
563 unsigned SDO : 1;
564 unsigned CK1 : 1;
565 unsigned DT1 : 1;
568 struct
570 unsigned T13CKI : 1;
571 unsigned CCP2 : 1;
572 unsigned : 1;
573 unsigned SCK : 1;
574 unsigned SDI : 1;
575 unsigned : 1;
576 unsigned TX1 : 1;
577 unsigned RX1 : 1;
579 } __PORTCbits_t;
581 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
583 #define _PORTC_RC0 0x01
584 #define _PORTC_T1OSO 0x01
585 #define _PORTC_T13CKI 0x01
586 #define _PORTC_RC1 0x02
587 #define _PORTC_T1OSI 0x02
588 #define _PORTC_CCP2 0x02
589 #define _PORTC_RC2 0x04
590 #define _PORTC_CCP1 0x04
591 #define _PORTC_RC3 0x08
592 #define _PORTC_SCL 0x08
593 #define _PORTC_SCK 0x08
594 #define _PORTC_RC4 0x10
595 #define _PORTC_SDA 0x10
596 #define _PORTC_SDI 0x10
597 #define _PORTC_RC5 0x20
598 #define _PORTC_SDO 0x20
599 #define _PORTC_RC6 0x40
600 #define _PORTC_CK1 0x40
601 #define _PORTC_TX1 0x40
602 #define _PORTC_RC7 0x80
603 #define _PORTC_DT1 0x80
604 #define _PORTC_RX1 0x80
606 //==============================================================================
609 //==============================================================================
610 // PORTD Bits
612 extern __at(0x0F83) __sfr PORTD;
614 typedef union
616 struct
618 unsigned RD0 : 1;
619 unsigned RD1 : 1;
620 unsigned RD2 : 1;
621 unsigned RD3 : 1;
622 unsigned RD4 : 1;
623 unsigned RD5 : 1;
624 unsigned RD6 : 1;
625 unsigned RD7 : 1;
628 struct
630 unsigned PSP0 : 1;
631 unsigned PSP1 : 1;
632 unsigned PSP2 : 1;
633 unsigned PSP3 : 1;
634 unsigned PSP4 : 1;
635 unsigned PSP5 : 1;
636 unsigned PSP6 : 1;
637 unsigned PSP7 : 1;
640 struct
642 unsigned AD0 : 1;
643 unsigned AD1 : 1;
644 unsigned AD2 : 1;
645 unsigned AD3 : 1;
646 unsigned AD4 : 1;
647 unsigned AD5 : 1;
648 unsigned AD6 : 1;
649 unsigned AD7 : 1;
651 } __PORTDbits_t;
653 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
655 #define _PORTD_RD0 0x01
656 #define _PORTD_PSP0 0x01
657 #define _PORTD_AD0 0x01
658 #define _PORTD_RD1 0x02
659 #define _PORTD_PSP1 0x02
660 #define _PORTD_AD1 0x02
661 #define _PORTD_RD2 0x04
662 #define _PORTD_PSP2 0x04
663 #define _PORTD_AD2 0x04
664 #define _PORTD_RD3 0x08
665 #define _PORTD_PSP3 0x08
666 #define _PORTD_AD3 0x08
667 #define _PORTD_RD4 0x10
668 #define _PORTD_PSP4 0x10
669 #define _PORTD_AD4 0x10
670 #define _PORTD_RD5 0x20
671 #define _PORTD_PSP5 0x20
672 #define _PORTD_AD5 0x20
673 #define _PORTD_RD6 0x40
674 #define _PORTD_PSP6 0x40
675 #define _PORTD_AD6 0x40
676 #define _PORTD_RD7 0x80
677 #define _PORTD_PSP7 0x80
678 #define _PORTD_AD7 0x80
680 //==============================================================================
683 //==============================================================================
684 // PORTE Bits
686 extern __at(0x0F84) __sfr PORTE;
688 typedef union
690 struct
692 unsigned RE0 : 1;
693 unsigned RE1 : 1;
694 unsigned RE2 : 1;
695 unsigned RE3 : 1;
696 unsigned RE4 : 1;
697 unsigned RE5 : 1;
698 unsigned RE6 : 1;
699 unsigned RE7 : 1;
702 struct
704 unsigned RD : 1;
705 unsigned WR : 1;
706 unsigned CS : 1;
707 unsigned AD11 : 1;
708 unsigned AD12 : 1;
709 unsigned AD13 : 1;
710 unsigned AD14 : 1;
711 unsigned CCP2 : 1;
714 struct
716 unsigned AD8 : 1;
717 unsigned AD9 : 1;
718 unsigned AD10 : 1;
719 unsigned : 1;
720 unsigned : 1;
721 unsigned : 1;
722 unsigned : 1;
723 unsigned AD15 : 1;
725 } __PORTEbits_t;
727 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
729 #define _PORTE_RE0 0x01
730 #define _PORTE_RD 0x01
731 #define _PORTE_AD8 0x01
732 #define _PORTE_RE1 0x02
733 #define _PORTE_WR 0x02
734 #define _PORTE_AD9 0x02
735 #define _PORTE_RE2 0x04
736 #define _PORTE_CS 0x04
737 #define _PORTE_AD10 0x04
738 #define _PORTE_RE3 0x08
739 #define _PORTE_AD11 0x08
740 #define _PORTE_RE4 0x10
741 #define _PORTE_AD12 0x10
742 #define _PORTE_RE5 0x20
743 #define _PORTE_AD13 0x20
744 #define _PORTE_RE6 0x40
745 #define _PORTE_AD14 0x40
746 #define _PORTE_RE7 0x80
747 #define _PORTE_CCP2 0x80
748 #define _PORTE_AD15 0x80
750 //==============================================================================
753 //==============================================================================
754 // PORTF Bits
756 extern __at(0x0F85) __sfr PORTF;
758 typedef union
760 struct
762 unsigned : 1;
763 unsigned RF1 : 1;
764 unsigned RF2 : 1;
765 unsigned RF3 : 1;
766 unsigned RF4 : 1;
767 unsigned RF5 : 1;
768 unsigned RF6 : 1;
769 unsigned RF7 : 1;
772 struct
774 unsigned : 1;
775 unsigned AN6 : 1;
776 unsigned AN7 : 1;
777 unsigned AN8 : 1;
778 unsigned AN9 : 1;
779 unsigned AN10 : 1;
780 unsigned AN11 : 1;
781 unsigned AN5 : 1;
784 struct
786 unsigned : 1;
787 unsigned C2OUT : 1;
788 unsigned C1OUT : 1;
789 unsigned C2INB : 1;
790 unsigned C2INA : 1;
791 unsigned C1INB : 1;
792 unsigned C1INA : 1;
793 unsigned SS1 : 1;
796 struct
798 unsigned : 1;
799 unsigned : 1;
800 unsigned : 1;
801 unsigned : 1;
802 unsigned : 1;
803 unsigned CVREF : 1;
804 unsigned : 1;
805 unsigned : 1;
807 } __PORTFbits_t;
809 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
811 #define _PORTF_RF1 0x02
812 #define _PORTF_AN6 0x02
813 #define _PORTF_C2OUT 0x02
814 #define _PORTF_RF2 0x04
815 #define _PORTF_AN7 0x04
816 #define _PORTF_C1OUT 0x04
817 #define _PORTF_RF3 0x08
818 #define _PORTF_AN8 0x08
819 #define _PORTF_C2INB 0x08
820 #define _PORTF_RF4 0x10
821 #define _PORTF_AN9 0x10
822 #define _PORTF_C2INA 0x10
823 #define _PORTF_RF5 0x20
824 #define _PORTF_AN10 0x20
825 #define _PORTF_C1INB 0x20
826 #define _PORTF_CVREF 0x20
827 #define _PORTF_RF6 0x40
828 #define _PORTF_AN11 0x40
829 #define _PORTF_C1INA 0x40
830 #define _PORTF_RF7 0x80
831 #define _PORTF_AN5 0x80
832 #define _PORTF_SS1 0x80
834 //==============================================================================
837 //==============================================================================
838 // PORTG Bits
840 extern __at(0x0F86) __sfr PORTG;
842 typedef union
844 struct
846 unsigned RG0 : 1;
847 unsigned RG1 : 1;
848 unsigned RG2 : 1;
849 unsigned RG3 : 1;
850 unsigned RG4 : 1;
851 unsigned RJPU : 1;
852 unsigned REPU : 1;
853 unsigned RDPU : 1;
856 struct
858 unsigned : 1;
859 unsigned CK2 : 1;
860 unsigned DT2 : 1;
861 unsigned : 1;
862 unsigned : 1;
863 unsigned : 1;
864 unsigned : 1;
865 unsigned : 1;
868 struct
870 unsigned : 1;
871 unsigned TX2 : 1;
872 unsigned RX2 : 1;
873 unsigned : 1;
874 unsigned : 1;
875 unsigned : 1;
876 unsigned : 1;
877 unsigned : 1;
880 struct
882 unsigned RG : 5;
883 unsigned : 3;
885 } __PORTGbits_t;
887 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
889 #define _PORTG_RG0 0x01
890 #define _PORTG_RG1 0x02
891 #define _PORTG_CK2 0x02
892 #define _PORTG_TX2 0x02
893 #define _PORTG_RG2 0x04
894 #define _PORTG_DT2 0x04
895 #define _PORTG_RX2 0x04
896 #define _PORTG_RG3 0x08
897 #define _PORTG_RG4 0x10
898 #define _PORTG_RJPU 0x20
899 #define _PORTG_REPU 0x40
900 #define _PORTG_RDPU 0x80
902 //==============================================================================
905 //==============================================================================
906 // PORTH Bits
908 extern __at(0x0F87) __sfr PORTH;
910 typedef union
912 struct
914 unsigned RH0 : 1;
915 unsigned RH1 : 1;
916 unsigned RH2 : 1;
917 unsigned RH3 : 1;
918 unsigned RH4 : 1;
919 unsigned RH5 : 1;
920 unsigned RH6 : 1;
921 unsigned RH7 : 1;
924 struct
926 unsigned A16 : 1;
927 unsigned A17 : 1;
928 unsigned A18 : 1;
929 unsigned A19 : 1;
930 unsigned : 1;
931 unsigned : 1;
932 unsigned : 1;
933 unsigned : 1;
935 } __PORTHbits_t;
937 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
939 #define _PORTH_RH0 0x01
940 #define _PORTH_A16 0x01
941 #define _PORTH_RH1 0x02
942 #define _PORTH_A17 0x02
943 #define _PORTH_RH2 0x04
944 #define _PORTH_A18 0x04
945 #define _PORTH_RH3 0x08
946 #define _PORTH_A19 0x08
947 #define _PORTH_RH4 0x10
948 #define _PORTH_RH5 0x20
949 #define _PORTH_RH6 0x40
950 #define _PORTH_RH7 0x80
952 //==============================================================================
955 //==============================================================================
956 // PORTJ Bits
958 extern __at(0x0F88) __sfr PORTJ;
960 typedef union
962 struct
964 unsigned RJ0 : 1;
965 unsigned RJ1 : 1;
966 unsigned RJ2 : 1;
967 unsigned RJ3 : 1;
968 unsigned RJ4 : 1;
969 unsigned RJ5 : 1;
970 unsigned RJ6 : 1;
971 unsigned RJ7 : 1;
974 struct
976 unsigned ALE : 1;
977 unsigned OE : 1;
978 unsigned WRL : 1;
979 unsigned WRH : 1;
980 unsigned BA0 : 1;
981 unsigned CE : 1;
982 unsigned LB : 1;
983 unsigned UB : 1;
985 } __PORTJbits_t;
987 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
989 #define _PORTJ_RJ0 0x01
990 #define _PORTJ_ALE 0x01
991 #define _PORTJ_RJ1 0x02
992 #define _PORTJ_OE 0x02
993 #define _PORTJ_RJ2 0x04
994 #define _PORTJ_WRL 0x04
995 #define _PORTJ_RJ3 0x08
996 #define _PORTJ_WRH 0x08
997 #define _PORTJ_RJ4 0x10
998 #define _PORTJ_BA0 0x10
999 #define _PORTJ_RJ5 0x20
1000 #define _PORTJ_CE 0x20
1001 #define _PORTJ_RJ6 0x40
1002 #define _PORTJ_LB 0x40
1003 #define _PORTJ_RJ7 0x80
1004 #define _PORTJ_UB 0x80
1006 //==============================================================================
1009 //==============================================================================
1010 // LATA Bits
1012 extern __at(0x0F89) __sfr LATA;
1014 typedef struct
1016 unsigned LATA0 : 1;
1017 unsigned LATA1 : 1;
1018 unsigned LATA2 : 1;
1019 unsigned LATA3 : 1;
1020 unsigned LATA4 : 1;
1021 unsigned LATA5 : 1;
1022 unsigned LATA6 : 1;
1023 unsigned LATA7 : 1;
1024 } __LATAbits_t;
1026 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1028 #define _LATA0 0x01
1029 #define _LATA1 0x02
1030 #define _LATA2 0x04
1031 #define _LATA3 0x08
1032 #define _LATA4 0x10
1033 #define _LATA5 0x20
1034 #define _LATA6 0x40
1035 #define _LATA7 0x80
1037 //==============================================================================
1040 //==============================================================================
1041 // LATB Bits
1043 extern __at(0x0F8A) __sfr LATB;
1045 typedef struct
1047 unsigned LATB0 : 1;
1048 unsigned LATB1 : 1;
1049 unsigned LATB2 : 1;
1050 unsigned LATB3 : 1;
1051 unsigned LATB4 : 1;
1052 unsigned LATB5 : 1;
1053 unsigned LATB6 : 1;
1054 unsigned LATB7 : 1;
1055 } __LATBbits_t;
1057 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1059 #define _LATB0 0x01
1060 #define _LATB1 0x02
1061 #define _LATB2 0x04
1062 #define _LATB3 0x08
1063 #define _LATB4 0x10
1064 #define _LATB5 0x20
1065 #define _LATB6 0x40
1066 #define _LATB7 0x80
1068 //==============================================================================
1071 //==============================================================================
1072 // LATC Bits
1074 extern __at(0x0F8B) __sfr LATC;
1076 typedef struct
1078 unsigned LATC0 : 1;
1079 unsigned LATC1 : 1;
1080 unsigned LATC2 : 1;
1081 unsigned LATC3 : 1;
1082 unsigned LATC4 : 1;
1083 unsigned LATC5 : 1;
1084 unsigned LATC6 : 1;
1085 unsigned LATC7 : 1;
1086 } __LATCbits_t;
1088 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1090 #define _LATC0 0x01
1091 #define _LATC1 0x02
1092 #define _LATC2 0x04
1093 #define _LATC3 0x08
1094 #define _LATC4 0x10
1095 #define _LATC5 0x20
1096 #define _LATC6 0x40
1097 #define _LATC7 0x80
1099 //==============================================================================
1102 //==============================================================================
1103 // LATD Bits
1105 extern __at(0x0F8C) __sfr LATD;
1107 typedef struct
1109 unsigned LATD0 : 1;
1110 unsigned LATD1 : 1;
1111 unsigned LATD2 : 1;
1112 unsigned LATD3 : 1;
1113 unsigned LATD4 : 1;
1114 unsigned LATD5 : 1;
1115 unsigned LATD6 : 1;
1116 unsigned LATD7 : 1;
1117 } __LATDbits_t;
1119 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1121 #define _LATD0 0x01
1122 #define _LATD1 0x02
1123 #define _LATD2 0x04
1124 #define _LATD3 0x08
1125 #define _LATD4 0x10
1126 #define _LATD5 0x20
1127 #define _LATD6 0x40
1128 #define _LATD7 0x80
1130 //==============================================================================
1133 //==============================================================================
1134 // LATE Bits
1136 extern __at(0x0F8D) __sfr LATE;
1138 typedef struct
1140 unsigned LATE0 : 1;
1141 unsigned LATE1 : 1;
1142 unsigned LATE2 : 1;
1143 unsigned LATE3 : 1;
1144 unsigned LATE4 : 1;
1145 unsigned LATE5 : 1;
1146 unsigned LATE6 : 1;
1147 unsigned LATE7 : 1;
1148 } __LATEbits_t;
1150 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1152 #define _LATE0 0x01
1153 #define _LATE1 0x02
1154 #define _LATE2 0x04
1155 #define _LATE3 0x08
1156 #define _LATE4 0x10
1157 #define _LATE5 0x20
1158 #define _LATE6 0x40
1159 #define _LATE7 0x80
1161 //==============================================================================
1164 //==============================================================================
1165 // LATF Bits
1167 extern __at(0x0F8E) __sfr LATF;
1169 typedef struct
1171 unsigned : 1;
1172 unsigned LATF1 : 1;
1173 unsigned LATF2 : 1;
1174 unsigned LATF3 : 1;
1175 unsigned LATF4 : 1;
1176 unsigned LATF5 : 1;
1177 unsigned LATF6 : 1;
1178 unsigned LATF7 : 1;
1179 } __LATFbits_t;
1181 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
1183 #define _LATF1 0x02
1184 #define _LATF2 0x04
1185 #define _LATF3 0x08
1186 #define _LATF4 0x10
1187 #define _LATF5 0x20
1188 #define _LATF6 0x40
1189 #define _LATF7 0x80
1191 //==============================================================================
1194 //==============================================================================
1195 // LATG Bits
1197 extern __at(0x0F8F) __sfr LATG;
1199 typedef union
1201 struct
1203 unsigned LATG0 : 1;
1204 unsigned LATG1 : 1;
1205 unsigned LATG2 : 1;
1206 unsigned LATG3 : 1;
1207 unsigned LATG4 : 1;
1208 unsigned : 1;
1209 unsigned U1OD : 1;
1210 unsigned U2OD : 1;
1213 struct
1215 unsigned LATG : 5;
1216 unsigned : 3;
1218 } __LATGbits_t;
1220 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
1222 #define _LATG0 0x01
1223 #define _LATG1 0x02
1224 #define _LATG2 0x04
1225 #define _LATG3 0x08
1226 #define _LATG4 0x10
1227 #define _U1OD 0x40
1228 #define _U2OD 0x80
1230 //==============================================================================
1233 //==============================================================================
1234 // LATH Bits
1236 extern __at(0x0F90) __sfr LATH;
1238 typedef struct
1240 unsigned LATH0 : 1;
1241 unsigned LATH1 : 1;
1242 unsigned LATH2 : 1;
1243 unsigned LATH3 : 1;
1244 unsigned LATH4 : 1;
1245 unsigned LATH5 : 1;
1246 unsigned LATH6 : 1;
1247 unsigned LATH7 : 1;
1248 } __LATHbits_t;
1250 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
1252 #define _LATH0 0x01
1253 #define _LATH1 0x02
1254 #define _LATH2 0x04
1255 #define _LATH3 0x08
1256 #define _LATH4 0x10
1257 #define _LATH5 0x20
1258 #define _LATH6 0x40
1259 #define _LATH7 0x80
1261 //==============================================================================
1264 //==============================================================================
1265 // LATJ Bits
1267 extern __at(0x0F91) __sfr LATJ;
1269 typedef struct
1271 unsigned LATJ0 : 1;
1272 unsigned LATJ1 : 1;
1273 unsigned LATJ2 : 1;
1274 unsigned LATJ3 : 1;
1275 unsigned LATJ4 : 1;
1276 unsigned LATJ5 : 1;
1277 unsigned LATJ6 : 1;
1278 unsigned LATJ7 : 1;
1279 } __LATJbits_t;
1281 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
1283 #define _LATJ0 0x01
1284 #define _LATJ1 0x02
1285 #define _LATJ2 0x04
1286 #define _LATJ3 0x08
1287 #define _LATJ4 0x10
1288 #define _LATJ5 0x20
1289 #define _LATJ6 0x40
1290 #define _LATJ7 0x80
1292 //==============================================================================
1295 //==============================================================================
1296 // DDRA Bits
1298 extern __at(0x0F92) __sfr DDRA;
1300 typedef union
1302 struct
1304 unsigned TRISA0 : 1;
1305 unsigned TRISA1 : 1;
1306 unsigned TRISA2 : 1;
1307 unsigned TRISA3 : 1;
1308 unsigned TRISA4 : 1;
1309 unsigned TRISA5 : 1;
1310 unsigned TRISA6 : 1;
1311 unsigned TRISA7 : 1;
1314 struct
1316 unsigned RA0 : 1;
1317 unsigned RA1 : 1;
1318 unsigned RA2 : 1;
1319 unsigned RA3 : 1;
1320 unsigned RA4 : 1;
1321 unsigned RA5 : 1;
1322 unsigned RA6 : 1;
1323 unsigned RA7 : 1;
1325 } __DDRAbits_t;
1327 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1329 #define _TRISA0 0x01
1330 #define _RA0 0x01
1331 #define _TRISA1 0x02
1332 #define _RA1 0x02
1333 #define _TRISA2 0x04
1334 #define _RA2 0x04
1335 #define _TRISA3 0x08
1336 #define _RA3 0x08
1337 #define _TRISA4 0x10
1338 #define _RA4 0x10
1339 #define _TRISA5 0x20
1340 #define _RA5 0x20
1341 #define _TRISA6 0x40
1342 #define _RA6 0x40
1343 #define _TRISA7 0x80
1344 #define _RA7 0x80
1346 //==============================================================================
1349 //==============================================================================
1350 // TRISA Bits
1352 extern __at(0x0F92) __sfr TRISA;
1354 typedef union
1356 struct
1358 unsigned TRISA0 : 1;
1359 unsigned TRISA1 : 1;
1360 unsigned TRISA2 : 1;
1361 unsigned TRISA3 : 1;
1362 unsigned TRISA4 : 1;
1363 unsigned TRISA5 : 1;
1364 unsigned TRISA6 : 1;
1365 unsigned TRISA7 : 1;
1368 struct
1370 unsigned RA0 : 1;
1371 unsigned RA1 : 1;
1372 unsigned RA2 : 1;
1373 unsigned RA3 : 1;
1374 unsigned RA4 : 1;
1375 unsigned RA5 : 1;
1376 unsigned RA6 : 1;
1377 unsigned RA7 : 1;
1379 } __TRISAbits_t;
1381 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1383 #define _TRISA_TRISA0 0x01
1384 #define _TRISA_RA0 0x01
1385 #define _TRISA_TRISA1 0x02
1386 #define _TRISA_RA1 0x02
1387 #define _TRISA_TRISA2 0x04
1388 #define _TRISA_RA2 0x04
1389 #define _TRISA_TRISA3 0x08
1390 #define _TRISA_RA3 0x08
1391 #define _TRISA_TRISA4 0x10
1392 #define _TRISA_RA4 0x10
1393 #define _TRISA_TRISA5 0x20
1394 #define _TRISA_RA5 0x20
1395 #define _TRISA_TRISA6 0x40
1396 #define _TRISA_RA6 0x40
1397 #define _TRISA_TRISA7 0x80
1398 #define _TRISA_RA7 0x80
1400 //==============================================================================
1403 //==============================================================================
1404 // DDRB Bits
1406 extern __at(0x0F93) __sfr DDRB;
1408 typedef union
1410 struct
1412 unsigned TRISB0 : 1;
1413 unsigned TRISB1 : 1;
1414 unsigned TRISB2 : 1;
1415 unsigned TRISB3 : 1;
1416 unsigned TRISB4 : 1;
1417 unsigned TRISB5 : 1;
1418 unsigned TRISB6 : 1;
1419 unsigned TRISB7 : 1;
1422 struct
1424 unsigned RB0 : 1;
1425 unsigned RB1 : 1;
1426 unsigned RB2 : 1;
1427 unsigned RB3 : 1;
1428 unsigned RB4 : 1;
1429 unsigned RB5 : 1;
1430 unsigned RB6 : 1;
1431 unsigned RB7 : 1;
1433 } __DDRBbits_t;
1435 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1437 #define _TRISB0 0x01
1438 #define _RB0 0x01
1439 #define _TRISB1 0x02
1440 #define _RB1 0x02
1441 #define _TRISB2 0x04
1442 #define _RB2 0x04
1443 #define _TRISB3 0x08
1444 #define _RB3 0x08
1445 #define _TRISB4 0x10
1446 #define _RB4 0x10
1447 #define _TRISB5 0x20
1448 #define _RB5 0x20
1449 #define _TRISB6 0x40
1450 #define _RB6 0x40
1451 #define _TRISB7 0x80
1452 #define _RB7 0x80
1454 //==============================================================================
1457 //==============================================================================
1458 // TRISB Bits
1460 extern __at(0x0F93) __sfr TRISB;
1462 typedef union
1464 struct
1466 unsigned TRISB0 : 1;
1467 unsigned TRISB1 : 1;
1468 unsigned TRISB2 : 1;
1469 unsigned TRISB3 : 1;
1470 unsigned TRISB4 : 1;
1471 unsigned TRISB5 : 1;
1472 unsigned TRISB6 : 1;
1473 unsigned TRISB7 : 1;
1476 struct
1478 unsigned RB0 : 1;
1479 unsigned RB1 : 1;
1480 unsigned RB2 : 1;
1481 unsigned RB3 : 1;
1482 unsigned RB4 : 1;
1483 unsigned RB5 : 1;
1484 unsigned RB6 : 1;
1485 unsigned RB7 : 1;
1487 } __TRISBbits_t;
1489 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1491 #define _TRISB_TRISB0 0x01
1492 #define _TRISB_RB0 0x01
1493 #define _TRISB_TRISB1 0x02
1494 #define _TRISB_RB1 0x02
1495 #define _TRISB_TRISB2 0x04
1496 #define _TRISB_RB2 0x04
1497 #define _TRISB_TRISB3 0x08
1498 #define _TRISB_RB3 0x08
1499 #define _TRISB_TRISB4 0x10
1500 #define _TRISB_RB4 0x10
1501 #define _TRISB_TRISB5 0x20
1502 #define _TRISB_RB5 0x20
1503 #define _TRISB_TRISB6 0x40
1504 #define _TRISB_RB6 0x40
1505 #define _TRISB_TRISB7 0x80
1506 #define _TRISB_RB7 0x80
1508 //==============================================================================
1511 //==============================================================================
1512 // DDRC Bits
1514 extern __at(0x0F94) __sfr DDRC;
1516 typedef union
1518 struct
1520 unsigned TRISC0 : 1;
1521 unsigned TRISC1 : 1;
1522 unsigned TRISC2 : 1;
1523 unsigned TRISC3 : 1;
1524 unsigned TRISC4 : 1;
1525 unsigned TRISC5 : 1;
1526 unsigned TRISC6 : 1;
1527 unsigned TRISC7 : 1;
1530 struct
1532 unsigned RC0 : 1;
1533 unsigned RC1 : 1;
1534 unsigned RC2 : 1;
1535 unsigned RC3 : 1;
1536 unsigned RC4 : 1;
1537 unsigned RC5 : 1;
1538 unsigned RC6 : 1;
1539 unsigned RC7 : 1;
1541 } __DDRCbits_t;
1543 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1545 #define _TRISC0 0x01
1546 #define _RC0 0x01
1547 #define _TRISC1 0x02
1548 #define _RC1 0x02
1549 #define _TRISC2 0x04
1550 #define _RC2 0x04
1551 #define _TRISC3 0x08
1552 #define _RC3 0x08
1553 #define _TRISC4 0x10
1554 #define _RC4 0x10
1555 #define _TRISC5 0x20
1556 #define _RC5 0x20
1557 #define _TRISC6 0x40
1558 #define _RC6 0x40
1559 #define _TRISC7 0x80
1560 #define _RC7 0x80
1562 //==============================================================================
1565 //==============================================================================
1566 // TRISC Bits
1568 extern __at(0x0F94) __sfr TRISC;
1570 typedef union
1572 struct
1574 unsigned TRISC0 : 1;
1575 unsigned TRISC1 : 1;
1576 unsigned TRISC2 : 1;
1577 unsigned TRISC3 : 1;
1578 unsigned TRISC4 : 1;
1579 unsigned TRISC5 : 1;
1580 unsigned TRISC6 : 1;
1581 unsigned TRISC7 : 1;
1584 struct
1586 unsigned RC0 : 1;
1587 unsigned RC1 : 1;
1588 unsigned RC2 : 1;
1589 unsigned RC3 : 1;
1590 unsigned RC4 : 1;
1591 unsigned RC5 : 1;
1592 unsigned RC6 : 1;
1593 unsigned RC7 : 1;
1595 } __TRISCbits_t;
1597 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1599 #define _TRISC_TRISC0 0x01
1600 #define _TRISC_RC0 0x01
1601 #define _TRISC_TRISC1 0x02
1602 #define _TRISC_RC1 0x02
1603 #define _TRISC_TRISC2 0x04
1604 #define _TRISC_RC2 0x04
1605 #define _TRISC_TRISC3 0x08
1606 #define _TRISC_RC3 0x08
1607 #define _TRISC_TRISC4 0x10
1608 #define _TRISC_RC4 0x10
1609 #define _TRISC_TRISC5 0x20
1610 #define _TRISC_RC5 0x20
1611 #define _TRISC_TRISC6 0x40
1612 #define _TRISC_RC6 0x40
1613 #define _TRISC_TRISC7 0x80
1614 #define _TRISC_RC7 0x80
1616 //==============================================================================
1619 //==============================================================================
1620 // DDRD Bits
1622 extern __at(0x0F95) __sfr DDRD;
1624 typedef union
1626 struct
1628 unsigned TRISD0 : 1;
1629 unsigned TRISD1 : 1;
1630 unsigned TRISD2 : 1;
1631 unsigned TRISD3 : 1;
1632 unsigned TRISD4 : 1;
1633 unsigned TRISD5 : 1;
1634 unsigned TRISD6 : 1;
1635 unsigned TRISD7 : 1;
1638 struct
1640 unsigned RD0 : 1;
1641 unsigned RD1 : 1;
1642 unsigned RD2 : 1;
1643 unsigned RD3 : 1;
1644 unsigned RD4 : 1;
1645 unsigned RD5 : 1;
1646 unsigned RD6 : 1;
1647 unsigned RD7 : 1;
1649 } __DDRDbits_t;
1651 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
1653 #define _TRISD0 0x01
1654 #define _RD0 0x01
1655 #define _TRISD1 0x02
1656 #define _RD1 0x02
1657 #define _TRISD2 0x04
1658 #define _RD2 0x04
1659 #define _TRISD3 0x08
1660 #define _RD3 0x08
1661 #define _TRISD4 0x10
1662 #define _RD4 0x10
1663 #define _TRISD5 0x20
1664 #define _RD5 0x20
1665 #define _TRISD6 0x40
1666 #define _RD6 0x40
1667 #define _TRISD7 0x80
1668 #define _RD7 0x80
1670 //==============================================================================
1673 //==============================================================================
1674 // TRISD Bits
1676 extern __at(0x0F95) __sfr TRISD;
1678 typedef union
1680 struct
1682 unsigned TRISD0 : 1;
1683 unsigned TRISD1 : 1;
1684 unsigned TRISD2 : 1;
1685 unsigned TRISD3 : 1;
1686 unsigned TRISD4 : 1;
1687 unsigned TRISD5 : 1;
1688 unsigned TRISD6 : 1;
1689 unsigned TRISD7 : 1;
1692 struct
1694 unsigned RD0 : 1;
1695 unsigned RD1 : 1;
1696 unsigned RD2 : 1;
1697 unsigned RD3 : 1;
1698 unsigned RD4 : 1;
1699 unsigned RD5 : 1;
1700 unsigned RD6 : 1;
1701 unsigned RD7 : 1;
1703 } __TRISDbits_t;
1705 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
1707 #define _TRISD_TRISD0 0x01
1708 #define _TRISD_RD0 0x01
1709 #define _TRISD_TRISD1 0x02
1710 #define _TRISD_RD1 0x02
1711 #define _TRISD_TRISD2 0x04
1712 #define _TRISD_RD2 0x04
1713 #define _TRISD_TRISD3 0x08
1714 #define _TRISD_RD3 0x08
1715 #define _TRISD_TRISD4 0x10
1716 #define _TRISD_RD4 0x10
1717 #define _TRISD_TRISD5 0x20
1718 #define _TRISD_RD5 0x20
1719 #define _TRISD_TRISD6 0x40
1720 #define _TRISD_RD6 0x40
1721 #define _TRISD_TRISD7 0x80
1722 #define _TRISD_RD7 0x80
1724 //==============================================================================
1727 //==============================================================================
1728 // DDRE Bits
1730 extern __at(0x0F96) __sfr DDRE;
1732 typedef union
1734 struct
1736 unsigned TRISE0 : 1;
1737 unsigned TRISE1 : 1;
1738 unsigned TRISE2 : 1;
1739 unsigned TRISE3 : 1;
1740 unsigned TRISE4 : 1;
1741 unsigned TRISE5 : 1;
1742 unsigned TRISE6 : 1;
1743 unsigned TRISE7 : 1;
1746 struct
1748 unsigned RE0 : 1;
1749 unsigned RE1 : 1;
1750 unsigned RE2 : 1;
1751 unsigned RE3 : 1;
1752 unsigned RE4 : 1;
1753 unsigned RE5 : 1;
1754 unsigned RE6 : 1;
1755 unsigned RE7 : 1;
1757 } __DDREbits_t;
1759 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
1761 #define _TRISE0 0x01
1762 #define _RE0 0x01
1763 #define _TRISE1 0x02
1764 #define _RE1 0x02
1765 #define _TRISE2 0x04
1766 #define _RE2 0x04
1767 #define _TRISE3 0x08
1768 #define _RE3 0x08
1769 #define _TRISE4 0x10
1770 #define _RE4 0x10
1771 #define _TRISE5 0x20
1772 #define _RE5 0x20
1773 #define _TRISE6 0x40
1774 #define _RE6 0x40
1775 #define _TRISE7 0x80
1776 #define _RE7 0x80
1778 //==============================================================================
1781 //==============================================================================
1782 // TRISE Bits
1784 extern __at(0x0F96) __sfr TRISE;
1786 typedef union
1788 struct
1790 unsigned TRISE0 : 1;
1791 unsigned TRISE1 : 1;
1792 unsigned TRISE2 : 1;
1793 unsigned TRISE3 : 1;
1794 unsigned TRISE4 : 1;
1795 unsigned TRISE5 : 1;
1796 unsigned TRISE6 : 1;
1797 unsigned TRISE7 : 1;
1800 struct
1802 unsigned RE0 : 1;
1803 unsigned RE1 : 1;
1804 unsigned RE2 : 1;
1805 unsigned RE3 : 1;
1806 unsigned RE4 : 1;
1807 unsigned RE5 : 1;
1808 unsigned RE6 : 1;
1809 unsigned RE7 : 1;
1811 } __TRISEbits_t;
1813 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
1815 #define _TRISE_TRISE0 0x01
1816 #define _TRISE_RE0 0x01
1817 #define _TRISE_TRISE1 0x02
1818 #define _TRISE_RE1 0x02
1819 #define _TRISE_TRISE2 0x04
1820 #define _TRISE_RE2 0x04
1821 #define _TRISE_TRISE3 0x08
1822 #define _TRISE_RE3 0x08
1823 #define _TRISE_TRISE4 0x10
1824 #define _TRISE_RE4 0x10
1825 #define _TRISE_TRISE5 0x20
1826 #define _TRISE_RE5 0x20
1827 #define _TRISE_TRISE6 0x40
1828 #define _TRISE_RE6 0x40
1829 #define _TRISE_TRISE7 0x80
1830 #define _TRISE_RE7 0x80
1832 //==============================================================================
1835 //==============================================================================
1836 // DDRF Bits
1838 extern __at(0x0F97) __sfr DDRF;
1840 typedef union
1842 struct
1844 unsigned : 1;
1845 unsigned TRISF1 : 1;
1846 unsigned TRISF2 : 1;
1847 unsigned TRISF3 : 1;
1848 unsigned TRISF4 : 1;
1849 unsigned TRISF5 : 1;
1850 unsigned TRISF6 : 1;
1851 unsigned TRISF7 : 1;
1854 struct
1856 unsigned : 1;
1857 unsigned RF1 : 1;
1858 unsigned RF2 : 1;
1859 unsigned RF3 : 1;
1860 unsigned RF4 : 1;
1861 unsigned RF5 : 1;
1862 unsigned RF6 : 1;
1863 unsigned RF7 : 1;
1865 } __DDRFbits_t;
1867 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
1869 #define _TRISF1 0x02
1870 #define _RF1 0x02
1871 #define _TRISF2 0x04
1872 #define _RF2 0x04
1873 #define _TRISF3 0x08
1874 #define _RF3 0x08
1875 #define _TRISF4 0x10
1876 #define _RF4 0x10
1877 #define _TRISF5 0x20
1878 #define _RF5 0x20
1879 #define _TRISF6 0x40
1880 #define _RF6 0x40
1881 #define _TRISF7 0x80
1882 #define _RF7 0x80
1884 //==============================================================================
1887 //==============================================================================
1888 // TRISF Bits
1890 extern __at(0x0F97) __sfr TRISF;
1892 typedef union
1894 struct
1896 unsigned : 1;
1897 unsigned TRISF1 : 1;
1898 unsigned TRISF2 : 1;
1899 unsigned TRISF3 : 1;
1900 unsigned TRISF4 : 1;
1901 unsigned TRISF5 : 1;
1902 unsigned TRISF6 : 1;
1903 unsigned TRISF7 : 1;
1906 struct
1908 unsigned : 1;
1909 unsigned RF1 : 1;
1910 unsigned RF2 : 1;
1911 unsigned RF3 : 1;
1912 unsigned RF4 : 1;
1913 unsigned RF5 : 1;
1914 unsigned RF6 : 1;
1915 unsigned RF7 : 1;
1917 } __TRISFbits_t;
1919 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
1921 #define _TRISF_TRISF1 0x02
1922 #define _TRISF_RF1 0x02
1923 #define _TRISF_TRISF2 0x04
1924 #define _TRISF_RF2 0x04
1925 #define _TRISF_TRISF3 0x08
1926 #define _TRISF_RF3 0x08
1927 #define _TRISF_TRISF4 0x10
1928 #define _TRISF_RF4 0x10
1929 #define _TRISF_TRISF5 0x20
1930 #define _TRISF_RF5 0x20
1931 #define _TRISF_TRISF6 0x40
1932 #define _TRISF_RF6 0x40
1933 #define _TRISF_TRISF7 0x80
1934 #define _TRISF_RF7 0x80
1936 //==============================================================================
1939 //==============================================================================
1940 // DDRG Bits
1942 extern __at(0x0F98) __sfr DDRG;
1944 typedef union
1946 struct
1948 unsigned TRISG0 : 1;
1949 unsigned TRISG1 : 1;
1950 unsigned TRISG2 : 1;
1951 unsigned TRISG3 : 1;
1952 unsigned TRISG4 : 1;
1953 unsigned CCP1OD : 1;
1954 unsigned CCP2OD : 1;
1955 unsigned SPIOD : 1;
1958 struct
1960 unsigned RG0 : 1;
1961 unsigned RG1 : 1;
1962 unsigned RG2 : 1;
1963 unsigned RG3 : 1;
1964 unsigned RG4 : 1;
1965 unsigned : 1;
1966 unsigned : 1;
1967 unsigned : 1;
1970 struct
1972 unsigned TRISG : 5;
1973 unsigned : 3;
1976 struct
1978 unsigned RG : 5;
1979 unsigned : 3;
1981 } __DDRGbits_t;
1983 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
1985 #define _TRISG0 0x01
1986 #define _RG0 0x01
1987 #define _TRISG1 0x02
1988 #define _RG1 0x02
1989 #define _TRISG2 0x04
1990 #define _RG2 0x04
1991 #define _TRISG3 0x08
1992 #define _RG3 0x08
1993 #define _TRISG4 0x10
1994 #define _RG4 0x10
1995 #define _CCP1OD 0x20
1996 #define _CCP2OD 0x40
1997 #define _SPIOD 0x80
1999 //==============================================================================
2002 //==============================================================================
2003 // TRISG Bits
2005 extern __at(0x0F98) __sfr TRISG;
2007 typedef union
2009 struct
2011 unsigned TRISG0 : 1;
2012 unsigned TRISG1 : 1;
2013 unsigned TRISG2 : 1;
2014 unsigned TRISG3 : 1;
2015 unsigned TRISG4 : 1;
2016 unsigned CCP1OD : 1;
2017 unsigned CCP2OD : 1;
2018 unsigned SPIOD : 1;
2021 struct
2023 unsigned RG0 : 1;
2024 unsigned RG1 : 1;
2025 unsigned RG2 : 1;
2026 unsigned RG3 : 1;
2027 unsigned RG4 : 1;
2028 unsigned : 1;
2029 unsigned : 1;
2030 unsigned : 1;
2033 struct
2035 unsigned RG : 5;
2036 unsigned : 3;
2039 struct
2041 unsigned TRISG : 5;
2042 unsigned : 3;
2044 } __TRISGbits_t;
2046 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
2048 #define _TRISG_TRISG0 0x01
2049 #define _TRISG_RG0 0x01
2050 #define _TRISG_TRISG1 0x02
2051 #define _TRISG_RG1 0x02
2052 #define _TRISG_TRISG2 0x04
2053 #define _TRISG_RG2 0x04
2054 #define _TRISG_TRISG3 0x08
2055 #define _TRISG_RG3 0x08
2056 #define _TRISG_TRISG4 0x10
2057 #define _TRISG_RG4 0x10
2058 #define _TRISG_CCP1OD 0x20
2059 #define _TRISG_CCP2OD 0x40
2060 #define _TRISG_SPIOD 0x80
2062 //==============================================================================
2065 //==============================================================================
2066 // DDRH Bits
2068 extern __at(0x0F99) __sfr DDRH;
2070 typedef union
2072 struct
2074 unsigned TRISH0 : 1;
2075 unsigned TRISH1 : 1;
2076 unsigned TRISH2 : 1;
2077 unsigned TRISH3 : 1;
2078 unsigned TRISH4 : 1;
2079 unsigned TRISH5 : 1;
2080 unsigned TRISH6 : 1;
2081 unsigned TRISH7 : 1;
2084 struct
2086 unsigned RH0 : 1;
2087 unsigned RH1 : 1;
2088 unsigned RH2 : 1;
2089 unsigned RH3 : 1;
2090 unsigned RH4 : 1;
2091 unsigned RH5 : 1;
2092 unsigned RH6 : 1;
2093 unsigned RH7 : 1;
2095 } __DDRHbits_t;
2097 extern __at(0x0F99) volatile __DDRHbits_t DDRHbits;
2099 #define _TRISH0 0x01
2100 #define _RH0 0x01
2101 #define _TRISH1 0x02
2102 #define _RH1 0x02
2103 #define _TRISH2 0x04
2104 #define _RH2 0x04
2105 #define _TRISH3 0x08
2106 #define _RH3 0x08
2107 #define _TRISH4 0x10
2108 #define _RH4 0x10
2109 #define _TRISH5 0x20
2110 #define _RH5 0x20
2111 #define _TRISH6 0x40
2112 #define _RH6 0x40
2113 #define _TRISH7 0x80
2114 #define _RH7 0x80
2116 //==============================================================================
2119 //==============================================================================
2120 // TRISH Bits
2122 extern __at(0x0F99) __sfr TRISH;
2124 typedef union
2126 struct
2128 unsigned TRISH0 : 1;
2129 unsigned TRISH1 : 1;
2130 unsigned TRISH2 : 1;
2131 unsigned TRISH3 : 1;
2132 unsigned TRISH4 : 1;
2133 unsigned TRISH5 : 1;
2134 unsigned TRISH6 : 1;
2135 unsigned TRISH7 : 1;
2138 struct
2140 unsigned RH0 : 1;
2141 unsigned RH1 : 1;
2142 unsigned RH2 : 1;
2143 unsigned RH3 : 1;
2144 unsigned RH4 : 1;
2145 unsigned RH5 : 1;
2146 unsigned RH6 : 1;
2147 unsigned RH7 : 1;
2149 } __TRISHbits_t;
2151 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
2153 #define _TRISH_TRISH0 0x01
2154 #define _TRISH_RH0 0x01
2155 #define _TRISH_TRISH1 0x02
2156 #define _TRISH_RH1 0x02
2157 #define _TRISH_TRISH2 0x04
2158 #define _TRISH_RH2 0x04
2159 #define _TRISH_TRISH3 0x08
2160 #define _TRISH_RH3 0x08
2161 #define _TRISH_TRISH4 0x10
2162 #define _TRISH_RH4 0x10
2163 #define _TRISH_TRISH5 0x20
2164 #define _TRISH_RH5 0x20
2165 #define _TRISH_TRISH6 0x40
2166 #define _TRISH_RH6 0x40
2167 #define _TRISH_TRISH7 0x80
2168 #define _TRISH_RH7 0x80
2170 //==============================================================================
2173 //==============================================================================
2174 // DDRJ Bits
2176 extern __at(0x0F9A) __sfr DDRJ;
2178 typedef union
2180 struct
2182 unsigned TRISJ0 : 1;
2183 unsigned TRISJ1 : 1;
2184 unsigned TRISJ2 : 1;
2185 unsigned TRISJ3 : 1;
2186 unsigned TRISJ4 : 1;
2187 unsigned TRISJ5 : 1;
2188 unsigned TRISJ6 : 1;
2189 unsigned TRISJ7 : 1;
2192 struct
2194 unsigned RJ0 : 1;
2195 unsigned RJ1 : 1;
2196 unsigned RJ2 : 1;
2197 unsigned RJ3 : 1;
2198 unsigned RJ4 : 1;
2199 unsigned RJ5 : 1;
2200 unsigned RJ6 : 1;
2201 unsigned RJ7 : 1;
2203 } __DDRJbits_t;
2205 extern __at(0x0F9A) volatile __DDRJbits_t DDRJbits;
2207 #define _TRISJ0 0x01
2208 #define _RJ0 0x01
2209 #define _TRISJ1 0x02
2210 #define _RJ1 0x02
2211 #define _TRISJ2 0x04
2212 #define _RJ2 0x04
2213 #define _TRISJ3 0x08
2214 #define _RJ3 0x08
2215 #define _TRISJ4 0x10
2216 #define _RJ4 0x10
2217 #define _TRISJ5 0x20
2218 #define _RJ5 0x20
2219 #define _TRISJ6 0x40
2220 #define _RJ6 0x40
2221 #define _TRISJ7 0x80
2222 #define _RJ7 0x80
2224 //==============================================================================
2227 //==============================================================================
2228 // TRISJ Bits
2230 extern __at(0x0F9A) __sfr TRISJ;
2232 typedef union
2234 struct
2236 unsigned TRISJ0 : 1;
2237 unsigned TRISJ1 : 1;
2238 unsigned TRISJ2 : 1;
2239 unsigned TRISJ3 : 1;
2240 unsigned TRISJ4 : 1;
2241 unsigned TRISJ5 : 1;
2242 unsigned TRISJ6 : 1;
2243 unsigned TRISJ7 : 1;
2246 struct
2248 unsigned RJ0 : 1;
2249 unsigned RJ1 : 1;
2250 unsigned RJ2 : 1;
2251 unsigned RJ3 : 1;
2252 unsigned RJ4 : 1;
2253 unsigned RJ5 : 1;
2254 unsigned RJ6 : 1;
2255 unsigned RJ7 : 1;
2257 } __TRISJbits_t;
2259 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
2261 #define _TRISJ_TRISJ0 0x01
2262 #define _TRISJ_RJ0 0x01
2263 #define _TRISJ_TRISJ1 0x02
2264 #define _TRISJ_RJ1 0x02
2265 #define _TRISJ_TRISJ2 0x04
2266 #define _TRISJ_RJ2 0x04
2267 #define _TRISJ_TRISJ3 0x08
2268 #define _TRISJ_RJ3 0x08
2269 #define _TRISJ_TRISJ4 0x10
2270 #define _TRISJ_RJ4 0x10
2271 #define _TRISJ_TRISJ5 0x20
2272 #define _TRISJ_RJ5 0x20
2273 #define _TRISJ_TRISJ6 0x40
2274 #define _TRISJ_RJ6 0x40
2275 #define _TRISJ_TRISJ7 0x80
2276 #define _TRISJ_RJ7 0x80
2278 //==============================================================================
2281 //==============================================================================
2282 // OSCTUNE Bits
2284 extern __at(0x0F9B) __sfr OSCTUNE;
2286 typedef union
2288 struct
2290 unsigned TUN0 : 1;
2291 unsigned TUN1 : 1;
2292 unsigned TUN2 : 1;
2293 unsigned TUN3 : 1;
2294 unsigned TUN4 : 1;
2295 unsigned TUN5 : 1;
2296 unsigned PLLEN : 1;
2297 unsigned INTSRC : 1;
2300 struct
2302 unsigned TUN : 6;
2303 unsigned : 2;
2305 } __OSCTUNEbits_t;
2307 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2309 #define _TUN0 0x01
2310 #define _TUN1 0x02
2311 #define _TUN2 0x04
2312 #define _TUN3 0x08
2313 #define _TUN4 0x10
2314 #define _TUN5 0x20
2315 #define _PLLEN 0x40
2316 #define _INTSRC 0x80
2318 //==============================================================================
2321 //==============================================================================
2322 // MEMCON Bits
2324 extern __at(0x0F9C) __sfr MEMCON;
2326 typedef union
2328 struct
2330 unsigned WM0 : 1;
2331 unsigned WM1 : 1;
2332 unsigned : 1;
2333 unsigned : 1;
2334 unsigned WAIT0 : 1;
2335 unsigned WAIT1 : 1;
2336 unsigned : 1;
2337 unsigned EBDIS : 1;
2340 struct
2342 unsigned WM : 2;
2343 unsigned : 6;
2346 struct
2348 unsigned : 4;
2349 unsigned WAIT : 2;
2350 unsigned : 2;
2352 } __MEMCONbits_t;
2354 extern __at(0x0F9C) volatile __MEMCONbits_t MEMCONbits;
2356 #define _WM0 0x01
2357 #define _WM1 0x02
2358 #define _WAIT0 0x10
2359 #define _WAIT1 0x20
2360 #define _EBDIS 0x80
2362 //==============================================================================
2365 //==============================================================================
2366 // PIE1 Bits
2368 extern __at(0x0F9D) __sfr PIE1;
2370 typedef union
2372 struct
2374 unsigned TMR1IE : 1;
2375 unsigned TMR2IE : 1;
2376 unsigned : 1;
2377 unsigned SSPIE : 1;
2378 unsigned TX1IE : 1;
2379 unsigned RC1IE : 1;
2380 unsigned ADIE : 1;
2381 unsigned PSPIE : 1;
2384 struct
2386 unsigned : 1;
2387 unsigned : 1;
2388 unsigned : 1;
2389 unsigned SSP1IE : 1;
2390 unsigned TXIE : 1;
2391 unsigned RCIE : 1;
2392 unsigned : 1;
2393 unsigned : 1;
2395 } __PIE1bits_t;
2397 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
2399 #define _TMR1IE 0x01
2400 #define _TMR2IE 0x02
2401 #define _SSPIE 0x08
2402 #define _SSP1IE 0x08
2403 #define _TX1IE 0x10
2404 #define _TXIE 0x10
2405 #define _RC1IE 0x20
2406 #define _RCIE 0x20
2407 #define _ADIE 0x40
2408 #define _PSPIE 0x80
2410 //==============================================================================
2413 //==============================================================================
2414 // PIR1 Bits
2416 extern __at(0x0F9E) __sfr PIR1;
2418 typedef union
2420 struct
2422 unsigned TMR1IF : 1;
2423 unsigned TMR2IF : 1;
2424 unsigned : 1;
2425 unsigned SSPIF : 1;
2426 unsigned TX1IF : 1;
2427 unsigned RC1IF : 1;
2428 unsigned ADIF : 1;
2429 unsigned PSPIF : 1;
2432 struct
2434 unsigned : 1;
2435 unsigned : 1;
2436 unsigned : 1;
2437 unsigned SSP1IF : 1;
2438 unsigned TXIF : 1;
2439 unsigned RCIF : 1;
2440 unsigned : 1;
2441 unsigned : 1;
2443 } __PIR1bits_t;
2445 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2447 #define _TMR1IF 0x01
2448 #define _TMR2IF 0x02
2449 #define _SSPIF 0x08
2450 #define _SSP1IF 0x08
2451 #define _TX1IF 0x10
2452 #define _TXIF 0x10
2453 #define _RC1IF 0x20
2454 #define _RCIF 0x20
2455 #define _ADIF 0x40
2456 #define _PSPIF 0x80
2458 //==============================================================================
2461 //==============================================================================
2462 // IPR1 Bits
2464 extern __at(0x0F9F) __sfr IPR1;
2466 typedef union
2468 struct
2470 unsigned TMR1IP : 1;
2471 unsigned TMR2IP : 1;
2472 unsigned : 1;
2473 unsigned SSPIP : 1;
2474 unsigned TX1IP : 1;
2475 unsigned RC1IP : 1;
2476 unsigned ADIP : 1;
2477 unsigned PSPIP : 1;
2480 struct
2482 unsigned : 1;
2483 unsigned : 1;
2484 unsigned : 1;
2485 unsigned SSP1IP : 1;
2486 unsigned TXIP : 1;
2487 unsigned RCIP : 1;
2488 unsigned : 1;
2489 unsigned : 1;
2491 } __IPR1bits_t;
2493 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2495 #define _TMR1IP 0x01
2496 #define _TMR2IP 0x02
2497 #define _SSPIP 0x08
2498 #define _SSP1IP 0x08
2499 #define _TX1IP 0x10
2500 #define _TXIP 0x10
2501 #define _RC1IP 0x20
2502 #define _RCIP 0x20
2503 #define _ADIP 0x40
2504 #define _PSPIP 0x80
2506 //==============================================================================
2509 //==============================================================================
2510 // PIE2 Bits
2512 extern __at(0x0FA0) __sfr PIE2;
2514 typedef union
2516 struct
2518 unsigned : 1;
2519 unsigned TMR3IE : 1;
2520 unsigned LVDIE : 1;
2521 unsigned BCLIE : 1;
2522 unsigned : 1;
2523 unsigned : 1;
2524 unsigned CMIE : 1;
2525 unsigned OSCFIE : 1;
2528 struct
2530 unsigned : 1;
2531 unsigned : 1;
2532 unsigned : 1;
2533 unsigned BCL1IE : 1;
2534 unsigned : 1;
2535 unsigned : 1;
2536 unsigned : 1;
2537 unsigned : 1;
2539 } __PIE2bits_t;
2541 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2543 #define _TMR3IE 0x02
2544 #define _LVDIE 0x04
2545 #define _BCLIE 0x08
2546 #define _BCL1IE 0x08
2547 #define _CMIE 0x40
2548 #define _OSCFIE 0x80
2550 //==============================================================================
2553 //==============================================================================
2554 // PIR2 Bits
2556 extern __at(0x0FA1) __sfr PIR2;
2558 typedef union
2560 struct
2562 unsigned : 1;
2563 unsigned TMR3IF : 1;
2564 unsigned LVDIF : 1;
2565 unsigned BCLIF : 1;
2566 unsigned : 1;
2567 unsigned : 1;
2568 unsigned CMIF : 1;
2569 unsigned OSCFIF : 1;
2572 struct
2574 unsigned : 1;
2575 unsigned : 1;
2576 unsigned : 1;
2577 unsigned BCL1IF : 1;
2578 unsigned : 1;
2579 unsigned : 1;
2580 unsigned : 1;
2581 unsigned : 1;
2583 } __PIR2bits_t;
2585 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2587 #define _TMR3IF 0x02
2588 #define _LVDIF 0x04
2589 #define _BCLIF 0x08
2590 #define _BCL1IF 0x08
2591 #define _CMIF 0x40
2592 #define _OSCFIF 0x80
2594 //==============================================================================
2597 //==============================================================================
2598 // IPR2 Bits
2600 extern __at(0x0FA2) __sfr IPR2;
2602 typedef union
2604 struct
2606 unsigned : 1;
2607 unsigned TMR3IP : 1;
2608 unsigned LVDIP : 1;
2609 unsigned BCLIP : 1;
2610 unsigned : 1;
2611 unsigned : 1;
2612 unsigned CMIP : 1;
2613 unsigned OSCFIP : 1;
2616 struct
2618 unsigned : 1;
2619 unsigned : 1;
2620 unsigned : 1;
2621 unsigned BCL1IP : 1;
2622 unsigned : 1;
2623 unsigned : 1;
2624 unsigned : 1;
2625 unsigned : 1;
2627 } __IPR2bits_t;
2629 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
2631 #define _TMR3IP 0x02
2632 #define _LVDIP 0x04
2633 #define _BCLIP 0x08
2634 #define _BCL1IP 0x08
2635 #define _CMIP 0x40
2636 #define _OSCFIP 0x80
2638 //==============================================================================
2641 //==============================================================================
2642 // PIE3 Bits
2644 extern __at(0x0FA3) __sfr PIE3;
2646 typedef struct
2648 unsigned : 1;
2649 unsigned CCP1IE : 1;
2650 unsigned CCP2IE : 1;
2651 unsigned : 1;
2652 unsigned TX2IE : 1;
2653 unsigned RC2IE : 1;
2654 unsigned : 1;
2655 unsigned : 1;
2656 } __PIE3bits_t;
2658 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
2660 #define _CCP1IE 0x02
2661 #define _CCP2IE 0x04
2662 #define _TX2IE 0x10
2663 #define _RC2IE 0x20
2665 //==============================================================================
2668 //==============================================================================
2669 // PIR3 Bits
2671 extern __at(0x0FA4) __sfr PIR3;
2673 typedef struct
2675 unsigned : 1;
2676 unsigned CCP1IF : 1;
2677 unsigned CCP2IF : 1;
2678 unsigned : 1;
2679 unsigned TX2IF : 1;
2680 unsigned RC2IF : 1;
2681 unsigned : 1;
2682 unsigned : 1;
2683 } __PIR3bits_t;
2685 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
2687 #define _CCP1IF 0x02
2688 #define _CCP2IF 0x04
2689 #define _TX2IF 0x10
2690 #define _RC2IF 0x20
2692 //==============================================================================
2695 //==============================================================================
2696 // IPR3 Bits
2698 extern __at(0x0FA5) __sfr IPR3;
2700 typedef struct
2702 unsigned : 1;
2703 unsigned CCP1IP : 1;
2704 unsigned CCP2IP : 1;
2705 unsigned : 1;
2706 unsigned TX2IP : 1;
2707 unsigned RC2IP : 1;
2708 unsigned : 1;
2709 unsigned : 1;
2710 } __IPR3bits_t;
2712 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
2714 #define _CCP1IP 0x02
2715 #define _CCP2IP 0x04
2716 #define _TX2IP 0x10
2717 #define _RC2IP 0x20
2719 //==============================================================================
2722 //==============================================================================
2723 // EECON1 Bits
2725 extern __at(0x0FA6) __sfr EECON1;
2727 typedef struct
2729 unsigned : 1;
2730 unsigned WR : 1;
2731 unsigned WREN : 1;
2732 unsigned WRERR : 1;
2733 unsigned FREE : 1;
2734 unsigned : 1;
2735 unsigned : 1;
2736 unsigned : 1;
2737 } __EECON1bits_t;
2739 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
2741 #define _WR 0x02
2742 #define _WREN 0x04
2743 #define _WRERR 0x08
2744 #define _FREE 0x10
2746 //==============================================================================
2748 extern __at(0x0FA7) __sfr EECON2;
2750 //==============================================================================
2751 // RCSTA Bits
2753 extern __at(0x0FAB) __sfr RCSTA;
2755 typedef union
2757 struct
2759 unsigned RX9D : 1;
2760 unsigned OERR : 1;
2761 unsigned FERR : 1;
2762 unsigned ADDEN : 1;
2763 unsigned CREN : 1;
2764 unsigned SREN : 1;
2765 unsigned RX9 : 1;
2766 unsigned SPEN : 1;
2769 struct
2771 unsigned RCD8 : 1;
2772 unsigned OERR1 : 1;
2773 unsigned FERR1 : 1;
2774 unsigned ADDEN1 : 1;
2775 unsigned CREN1 : 1;
2776 unsigned SREN1 : 1;
2777 unsigned RC9 : 1;
2778 unsigned SPEN1 : 1;
2781 struct
2783 unsigned RX9D1 : 1;
2784 unsigned : 1;
2785 unsigned : 1;
2786 unsigned : 1;
2787 unsigned : 1;
2788 unsigned : 1;
2789 unsigned NOT_RC8 : 1;
2790 unsigned : 1;
2793 struct
2795 unsigned : 1;
2796 unsigned : 1;
2797 unsigned : 1;
2798 unsigned : 1;
2799 unsigned : 1;
2800 unsigned : 1;
2801 unsigned RC8_9 : 1;
2802 unsigned : 1;
2805 struct
2807 unsigned : 1;
2808 unsigned : 1;
2809 unsigned : 1;
2810 unsigned : 1;
2811 unsigned : 1;
2812 unsigned : 1;
2813 unsigned RX91 : 1;
2814 unsigned : 1;
2816 } __RCSTAbits_t;
2818 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
2820 #define _RX9D 0x01
2821 #define _RCD8 0x01
2822 #define _RX9D1 0x01
2823 #define _OERR 0x02
2824 #define _OERR1 0x02
2825 #define _FERR 0x04
2826 #define _FERR1 0x04
2827 #define _ADDEN 0x08
2828 #define _ADDEN1 0x08
2829 #define _CREN 0x10
2830 #define _CREN1 0x10
2831 #define _SREN 0x20
2832 #define _SREN1 0x20
2833 #define _RX9 0x40
2834 #define _RC9 0x40
2835 #define _NOT_RC8 0x40
2836 #define _RC8_9 0x40
2837 #define _RX91 0x40
2838 #define _SPEN 0x80
2839 #define _SPEN1 0x80
2841 //==============================================================================
2844 //==============================================================================
2845 // RCSTA1 Bits
2847 extern __at(0x0FAB) __sfr RCSTA1;
2849 typedef union
2851 struct
2853 unsigned RX9D : 1;
2854 unsigned OERR : 1;
2855 unsigned FERR : 1;
2856 unsigned ADDEN : 1;
2857 unsigned CREN : 1;
2858 unsigned SREN : 1;
2859 unsigned RX9 : 1;
2860 unsigned SPEN : 1;
2863 struct
2865 unsigned RCD8 : 1;
2866 unsigned OERR1 : 1;
2867 unsigned FERR1 : 1;
2868 unsigned ADDEN1 : 1;
2869 unsigned CREN1 : 1;
2870 unsigned SREN1 : 1;
2871 unsigned RC9 : 1;
2872 unsigned SPEN1 : 1;
2875 struct
2877 unsigned RX9D1 : 1;
2878 unsigned : 1;
2879 unsigned : 1;
2880 unsigned : 1;
2881 unsigned : 1;
2882 unsigned : 1;
2883 unsigned NOT_RC8 : 1;
2884 unsigned : 1;
2887 struct
2889 unsigned : 1;
2890 unsigned : 1;
2891 unsigned : 1;
2892 unsigned : 1;
2893 unsigned : 1;
2894 unsigned : 1;
2895 unsigned RC8_9 : 1;
2896 unsigned : 1;
2899 struct
2901 unsigned : 1;
2902 unsigned : 1;
2903 unsigned : 1;
2904 unsigned : 1;
2905 unsigned : 1;
2906 unsigned : 1;
2907 unsigned RX91 : 1;
2908 unsigned : 1;
2910 } __RCSTA1bits_t;
2912 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
2914 #define _RCSTA1_RX9D 0x01
2915 #define _RCSTA1_RCD8 0x01
2916 #define _RCSTA1_RX9D1 0x01
2917 #define _RCSTA1_OERR 0x02
2918 #define _RCSTA1_OERR1 0x02
2919 #define _RCSTA1_FERR 0x04
2920 #define _RCSTA1_FERR1 0x04
2921 #define _RCSTA1_ADDEN 0x08
2922 #define _RCSTA1_ADDEN1 0x08
2923 #define _RCSTA1_CREN 0x10
2924 #define _RCSTA1_CREN1 0x10
2925 #define _RCSTA1_SREN 0x20
2926 #define _RCSTA1_SREN1 0x20
2927 #define _RCSTA1_RX9 0x40
2928 #define _RCSTA1_RC9 0x40
2929 #define _RCSTA1_NOT_RC8 0x40
2930 #define _RCSTA1_RC8_9 0x40
2931 #define _RCSTA1_RX91 0x40
2932 #define _RCSTA1_SPEN 0x80
2933 #define _RCSTA1_SPEN1 0x80
2935 //==============================================================================
2938 //==============================================================================
2939 // TXSTA Bits
2941 extern __at(0x0FAC) __sfr TXSTA;
2943 typedef union
2945 struct
2947 unsigned TX9D : 1;
2948 unsigned TRMT : 1;
2949 unsigned BRGH : 1;
2950 unsigned SENDB : 1;
2951 unsigned SYNC : 1;
2952 unsigned TXEN : 1;
2953 unsigned TX9 : 1;
2954 unsigned CSRC : 1;
2957 struct
2959 unsigned TXD8 : 1;
2960 unsigned TRMT1 : 1;
2961 unsigned BRGH1 : 1;
2962 unsigned SENDB1 : 1;
2963 unsigned SYNC1 : 1;
2964 unsigned TXEN1 : 1;
2965 unsigned TX8_9 : 1;
2966 unsigned CSRC1 : 1;
2969 struct
2971 unsigned TX9D1 : 1;
2972 unsigned : 1;
2973 unsigned : 1;
2974 unsigned : 1;
2975 unsigned : 1;
2976 unsigned : 1;
2977 unsigned NOT_TX8 : 1;
2978 unsigned : 1;
2981 struct
2983 unsigned : 1;
2984 unsigned : 1;
2985 unsigned : 1;
2986 unsigned : 1;
2987 unsigned : 1;
2988 unsigned : 1;
2989 unsigned TX91 : 1;
2990 unsigned : 1;
2992 } __TXSTAbits_t;
2994 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
2996 #define _TX9D 0x01
2997 #define _TXD8 0x01
2998 #define _TX9D1 0x01
2999 #define _TRMT 0x02
3000 #define _TRMT1 0x02
3001 #define _BRGH 0x04
3002 #define _BRGH1 0x04
3003 #define _SENDB 0x08
3004 #define _SENDB1 0x08
3005 #define _SYNC 0x10
3006 #define _SYNC1 0x10
3007 #define _TXEN 0x20
3008 #define _TXEN1 0x20
3009 #define _TX9 0x40
3010 #define _TX8_9 0x40
3011 #define _NOT_TX8 0x40
3012 #define _TX91 0x40
3013 #define _CSRC 0x80
3014 #define _CSRC1 0x80
3016 //==============================================================================
3019 //==============================================================================
3020 // TXSTA1 Bits
3022 extern __at(0x0FAC) __sfr TXSTA1;
3024 typedef union
3026 struct
3028 unsigned TX9D : 1;
3029 unsigned TRMT : 1;
3030 unsigned BRGH : 1;
3031 unsigned SENDB : 1;
3032 unsigned SYNC : 1;
3033 unsigned TXEN : 1;
3034 unsigned TX9 : 1;
3035 unsigned CSRC : 1;
3038 struct
3040 unsigned TXD8 : 1;
3041 unsigned TRMT1 : 1;
3042 unsigned BRGH1 : 1;
3043 unsigned SENDB1 : 1;
3044 unsigned SYNC1 : 1;
3045 unsigned TXEN1 : 1;
3046 unsigned TX8_9 : 1;
3047 unsigned CSRC1 : 1;
3050 struct
3052 unsigned TX9D1 : 1;
3053 unsigned : 1;
3054 unsigned : 1;
3055 unsigned : 1;
3056 unsigned : 1;
3057 unsigned : 1;
3058 unsigned NOT_TX8 : 1;
3059 unsigned : 1;
3062 struct
3064 unsigned : 1;
3065 unsigned : 1;
3066 unsigned : 1;
3067 unsigned : 1;
3068 unsigned : 1;
3069 unsigned : 1;
3070 unsigned TX91 : 1;
3071 unsigned : 1;
3073 } __TXSTA1bits_t;
3075 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
3077 #define _TXSTA1_TX9D 0x01
3078 #define _TXSTA1_TXD8 0x01
3079 #define _TXSTA1_TX9D1 0x01
3080 #define _TXSTA1_TRMT 0x02
3081 #define _TXSTA1_TRMT1 0x02
3082 #define _TXSTA1_BRGH 0x04
3083 #define _TXSTA1_BRGH1 0x04
3084 #define _TXSTA1_SENDB 0x08
3085 #define _TXSTA1_SENDB1 0x08
3086 #define _TXSTA1_SYNC 0x10
3087 #define _TXSTA1_SYNC1 0x10
3088 #define _TXSTA1_TXEN 0x20
3089 #define _TXSTA1_TXEN1 0x20
3090 #define _TXSTA1_TX9 0x40
3091 #define _TXSTA1_TX8_9 0x40
3092 #define _TXSTA1_NOT_TX8 0x40
3093 #define _TXSTA1_TX91 0x40
3094 #define _TXSTA1_CSRC 0x80
3095 #define _TXSTA1_CSRC1 0x80
3097 //==============================================================================
3099 extern __at(0x0FAD) __sfr TXREG;
3100 extern __at(0x0FAD) __sfr TXREG1;
3101 extern __at(0x0FAE) __sfr RCREG;
3102 extern __at(0x0FAE) __sfr RCREG1;
3103 extern __at(0x0FAF) __sfr SPBRG;
3104 extern __at(0x0FAF) __sfr SPBRG1;
3106 //==============================================================================
3107 // PSPCON Bits
3109 extern __at(0x0FB0) __sfr PSPCON;
3111 typedef struct
3113 unsigned : 1;
3114 unsigned : 1;
3115 unsigned : 1;
3116 unsigned : 1;
3117 unsigned PSPMODE : 1;
3118 unsigned IBOV : 1;
3119 unsigned OBF : 1;
3120 unsigned IBF : 1;
3121 } __PSPCONbits_t;
3123 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
3125 #define _PSPMODE 0x10
3126 #define _IBOV 0x20
3127 #define _OBF 0x40
3128 #define _IBF 0x80
3130 //==============================================================================
3133 //==============================================================================
3134 // T3CON Bits
3136 extern __at(0x0FB1) __sfr T3CON;
3138 typedef union
3140 struct
3142 unsigned TMR3ON : 1;
3143 unsigned TMR3CS : 1;
3144 unsigned NOT_T3SYNC : 1;
3145 unsigned T3CCP1 : 1;
3146 unsigned T3CKPS0 : 1;
3147 unsigned T3CKPS1 : 1;
3148 unsigned T3CCP2 : 1;
3149 unsigned RD16 : 1;
3152 struct
3154 unsigned : 1;
3155 unsigned : 1;
3156 unsigned T3SYNC : 1;
3157 unsigned : 1;
3158 unsigned : 1;
3159 unsigned : 1;
3160 unsigned : 1;
3161 unsigned : 1;
3164 struct
3166 unsigned : 1;
3167 unsigned : 1;
3168 unsigned T3INSYNC : 1;
3169 unsigned : 1;
3170 unsigned : 1;
3171 unsigned : 1;
3172 unsigned : 1;
3173 unsigned : 1;
3176 struct
3178 unsigned : 4;
3179 unsigned T3CKPS : 2;
3180 unsigned : 2;
3182 } __T3CONbits_t;
3184 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
3186 #define _T3CON_TMR3ON 0x01
3187 #define _T3CON_TMR3CS 0x02
3188 #define _T3CON_NOT_T3SYNC 0x04
3189 #define _T3CON_T3SYNC 0x04
3190 #define _T3CON_T3INSYNC 0x04
3191 #define _T3CON_T3CCP1 0x08
3192 #define _T3CON_T3CKPS0 0x10
3193 #define _T3CON_T3CKPS1 0x20
3194 #define _T3CON_T3CCP2 0x40
3195 #define _T3CON_RD16 0x80
3197 //==============================================================================
3199 extern __at(0x0FB2) __sfr TMR3;
3200 extern __at(0x0FB2) __sfr TMR3L;
3201 extern __at(0x0FB3) __sfr TMR3H;
3203 //==============================================================================
3204 // CMCON Bits
3206 extern __at(0x0FB4) __sfr CMCON;
3208 typedef union
3210 struct
3212 unsigned CM0 : 1;
3213 unsigned CM1 : 1;
3214 unsigned CM2 : 1;
3215 unsigned CIS : 1;
3216 unsigned C1INV : 1;
3217 unsigned C2INV : 1;
3218 unsigned C1OUT : 1;
3219 unsigned C2OUT : 1;
3222 struct
3224 unsigned CM : 3;
3225 unsigned : 5;
3227 } __CMCONbits_t;
3229 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
3231 #define _CM0 0x01
3232 #define _CM1 0x02
3233 #define _CM2 0x04
3234 #define _CIS 0x08
3235 #define _C1INV 0x10
3236 #define _C2INV 0x20
3237 #define _C1OUT 0x40
3238 #define _C2OUT 0x80
3240 //==============================================================================
3243 //==============================================================================
3244 // CVRCON Bits
3246 extern __at(0x0FB5) __sfr CVRCON;
3248 typedef union
3250 struct
3252 unsigned CVR0 : 1;
3253 unsigned CVR1 : 1;
3254 unsigned CVR2 : 1;
3255 unsigned CVR3 : 1;
3256 unsigned CVRSS : 1;
3257 unsigned CVRR : 1;
3258 unsigned CVROE : 1;
3259 unsigned CVREN : 1;
3262 struct
3264 unsigned CVR : 4;
3265 unsigned : 4;
3267 } __CVRCONbits_t;
3269 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
3271 #define _CVR0 0x01
3272 #define _CVR1 0x02
3273 #define _CVR2 0x04
3274 #define _CVR3 0x08
3275 #define _CVRSS 0x10
3276 #define _CVRR 0x20
3277 #define _CVROE 0x40
3278 #define _CVREN 0x80
3280 //==============================================================================
3283 //==============================================================================
3284 // ADCON2 Bits
3286 extern __at(0x0FC0) __sfr ADCON2;
3288 typedef union
3290 struct
3292 unsigned ADCS0 : 1;
3293 unsigned ADCS1 : 1;
3294 unsigned ADCS2 : 1;
3295 unsigned ACQT0 : 1;
3296 unsigned ACQT1 : 1;
3297 unsigned ACQT2 : 1;
3298 unsigned : 1;
3299 unsigned ADFM : 1;
3302 struct
3304 unsigned ADCS : 3;
3305 unsigned : 5;
3308 struct
3310 unsigned : 3;
3311 unsigned ACQT : 3;
3312 unsigned : 2;
3314 } __ADCON2bits_t;
3316 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
3318 #define _ADCS0 0x01
3319 #define _ADCS1 0x02
3320 #define _ADCS2 0x04
3321 #define _ACQT0 0x08
3322 #define _ACQT1 0x10
3323 #define _ACQT2 0x20
3324 #define _ADFM 0x80
3326 //==============================================================================
3329 //==============================================================================
3330 // ADCON1 Bits
3332 extern __at(0x0FC1) __sfr ADCON1;
3334 typedef union
3336 struct
3338 unsigned PCFG0 : 1;
3339 unsigned PCFG1 : 1;
3340 unsigned PCFG2 : 1;
3341 unsigned PCFG3 : 1;
3342 unsigned VCFG0 : 1;
3343 unsigned VCFG1 : 1;
3344 unsigned : 1;
3345 unsigned : 1;
3348 struct
3350 unsigned PCFG : 4;
3351 unsigned : 4;
3354 struct
3356 unsigned : 4;
3357 unsigned VCFG : 2;
3358 unsigned : 2;
3360 } __ADCON1bits_t;
3362 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
3364 #define _PCFG0 0x01
3365 #define _PCFG1 0x02
3366 #define _PCFG2 0x04
3367 #define _PCFG3 0x08
3368 #define _VCFG0 0x10
3369 #define _VCFG1 0x20
3371 //==============================================================================
3374 //==============================================================================
3375 // ADCON0 Bits
3377 extern __at(0x0FC2) __sfr ADCON0;
3379 typedef union
3381 struct
3383 unsigned ADON : 1;
3384 unsigned GO_NOT_DONE : 1;
3385 unsigned CHS0 : 1;
3386 unsigned CHS1 : 1;
3387 unsigned CHS2 : 1;
3388 unsigned CHS3 : 1;
3389 unsigned : 1;
3390 unsigned ADCAL : 1;
3393 struct
3395 unsigned : 1;
3396 unsigned GO_DONE : 1;
3397 unsigned : 1;
3398 unsigned : 1;
3399 unsigned : 1;
3400 unsigned : 1;
3401 unsigned : 1;
3402 unsigned : 1;
3405 struct
3407 unsigned : 1;
3408 unsigned DONE : 1;
3409 unsigned : 1;
3410 unsigned : 1;
3411 unsigned : 1;
3412 unsigned : 1;
3413 unsigned : 1;
3414 unsigned : 1;
3417 struct
3419 unsigned : 1;
3420 unsigned GO : 1;
3421 unsigned : 1;
3422 unsigned : 1;
3423 unsigned : 1;
3424 unsigned : 1;
3425 unsigned : 1;
3426 unsigned : 1;
3429 struct
3431 unsigned : 1;
3432 unsigned NOT_DONE : 1;
3433 unsigned : 1;
3434 unsigned : 1;
3435 unsigned : 1;
3436 unsigned : 1;
3437 unsigned : 1;
3438 unsigned : 1;
3441 struct
3443 unsigned : 2;
3444 unsigned CHS : 4;
3445 unsigned : 2;
3447 } __ADCON0bits_t;
3449 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
3451 #define _ADON 0x01
3452 #define _GO_NOT_DONE 0x02
3453 #define _GO_DONE 0x02
3454 #define _DONE 0x02
3455 #define _GO 0x02
3456 #define _NOT_DONE 0x02
3457 #define _CHS0 0x04
3458 #define _CHS1 0x08
3459 #define _CHS2 0x10
3460 #define _CHS3 0x20
3461 #define _ADCAL 0x80
3463 //==============================================================================
3465 extern __at(0x0FC3) __sfr ADRES;
3466 extern __at(0x0FC3) __sfr ADRESL;
3467 extern __at(0x0FC4) __sfr ADRESH;
3469 //==============================================================================
3470 // SSP1CON2 Bits
3472 extern __at(0x0FC5) __sfr SSP1CON2;
3474 typedef union
3476 struct
3478 unsigned SEN : 1;
3479 unsigned RSEN : 1;
3480 unsigned PEN : 1;
3481 unsigned RCEN : 1;
3482 unsigned ACKEN : 1;
3483 unsigned ACKDT : 1;
3484 unsigned ACKSTAT : 1;
3485 unsigned GCEN : 1;
3488 struct
3490 unsigned : 1;
3491 unsigned ADMSK1 : 1;
3492 unsigned ADMSK2 : 1;
3493 unsigned ADMSK3 : 1;
3494 unsigned ADMSK4 : 1;
3495 unsigned ADMSK5 : 1;
3496 unsigned : 1;
3497 unsigned : 1;
3499 } __SSP1CON2bits_t;
3501 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
3503 #define _SEN 0x01
3504 #define _RSEN 0x02
3505 #define _ADMSK1 0x02
3506 #define _PEN 0x04
3507 #define _ADMSK2 0x04
3508 #define _RCEN 0x08
3509 #define _ADMSK3 0x08
3510 #define _ACKEN 0x10
3511 #define _ADMSK4 0x10
3512 #define _ACKDT 0x20
3513 #define _ADMSK5 0x20
3514 #define _ACKSTAT 0x40
3515 #define _GCEN 0x80
3517 //==============================================================================
3520 //==============================================================================
3521 // SSPCON2 Bits
3523 extern __at(0x0FC5) __sfr SSPCON2;
3525 typedef union
3527 struct
3529 unsigned SEN : 1;
3530 unsigned RSEN : 1;
3531 unsigned PEN : 1;
3532 unsigned RCEN : 1;
3533 unsigned ACKEN : 1;
3534 unsigned ACKDT : 1;
3535 unsigned ACKSTAT : 1;
3536 unsigned GCEN : 1;
3539 struct
3541 unsigned : 1;
3542 unsigned ADMSK1 : 1;
3543 unsigned ADMSK2 : 1;
3544 unsigned ADMSK3 : 1;
3545 unsigned ADMSK4 : 1;
3546 unsigned ADMSK5 : 1;
3547 unsigned : 1;
3548 unsigned : 1;
3550 } __SSPCON2bits_t;
3552 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
3554 #define _SSPCON2_SEN 0x01
3555 #define _SSPCON2_RSEN 0x02
3556 #define _SSPCON2_ADMSK1 0x02
3557 #define _SSPCON2_PEN 0x04
3558 #define _SSPCON2_ADMSK2 0x04
3559 #define _SSPCON2_RCEN 0x08
3560 #define _SSPCON2_ADMSK3 0x08
3561 #define _SSPCON2_ACKEN 0x10
3562 #define _SSPCON2_ADMSK4 0x10
3563 #define _SSPCON2_ACKDT 0x20
3564 #define _SSPCON2_ADMSK5 0x20
3565 #define _SSPCON2_ACKSTAT 0x40
3566 #define _SSPCON2_GCEN 0x80
3568 //==============================================================================
3571 //==============================================================================
3572 // SSP1CON1 Bits
3574 extern __at(0x0FC6) __sfr SSP1CON1;
3576 typedef union
3578 struct
3580 unsigned SSPM0 : 1;
3581 unsigned SSPM1 : 1;
3582 unsigned SSPM2 : 1;
3583 unsigned SSPM3 : 1;
3584 unsigned CKP : 1;
3585 unsigned SSPEN : 1;
3586 unsigned SSPOV : 1;
3587 unsigned WCOL : 1;
3590 struct
3592 unsigned SSPM : 4;
3593 unsigned : 4;
3595 } __SSP1CON1bits_t;
3597 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
3599 #define _SSPM0 0x01
3600 #define _SSPM1 0x02
3601 #define _SSPM2 0x04
3602 #define _SSPM3 0x08
3603 #define _CKP 0x10
3604 #define _SSPEN 0x20
3605 #define _SSPOV 0x40
3606 #define _WCOL 0x80
3608 //==============================================================================
3611 //==============================================================================
3612 // SSPCON1 Bits
3614 extern __at(0x0FC6) __sfr SSPCON1;
3616 typedef union
3618 struct
3620 unsigned SSPM0 : 1;
3621 unsigned SSPM1 : 1;
3622 unsigned SSPM2 : 1;
3623 unsigned SSPM3 : 1;
3624 unsigned CKP : 1;
3625 unsigned SSPEN : 1;
3626 unsigned SSPOV : 1;
3627 unsigned WCOL : 1;
3630 struct
3632 unsigned SSPM : 4;
3633 unsigned : 4;
3635 } __SSPCON1bits_t;
3637 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
3639 #define _SSPCON1_SSPM0 0x01
3640 #define _SSPCON1_SSPM1 0x02
3641 #define _SSPCON1_SSPM2 0x04
3642 #define _SSPCON1_SSPM3 0x08
3643 #define _SSPCON1_CKP 0x10
3644 #define _SSPCON1_SSPEN 0x20
3645 #define _SSPCON1_SSPOV 0x40
3646 #define _SSPCON1_WCOL 0x80
3648 //==============================================================================
3651 //==============================================================================
3652 // SSP1STAT Bits
3654 extern __at(0x0FC7) __sfr SSP1STAT;
3656 typedef union
3658 struct
3660 unsigned BF : 1;
3661 unsigned UA : 1;
3662 unsigned R_NOT_W : 1;
3663 unsigned S : 1;
3664 unsigned P : 1;
3665 unsigned D_NOT_A : 1;
3666 unsigned CKE : 1;
3667 unsigned SMP : 1;
3670 struct
3672 unsigned : 1;
3673 unsigned : 1;
3674 unsigned R : 1;
3675 unsigned I2C_START : 1;
3676 unsigned I2C_STOP : 1;
3677 unsigned D : 1;
3678 unsigned : 1;
3679 unsigned : 1;
3682 struct
3684 unsigned : 1;
3685 unsigned : 1;
3686 unsigned R_W : 1;
3687 unsigned : 1;
3688 unsigned : 1;
3689 unsigned D_A : 1;
3690 unsigned : 1;
3691 unsigned : 1;
3694 struct
3696 unsigned : 1;
3697 unsigned : 1;
3698 unsigned NOT_W : 1;
3699 unsigned : 1;
3700 unsigned : 1;
3701 unsigned NOT_A : 1;
3702 unsigned : 1;
3703 unsigned : 1;
3706 struct
3708 unsigned : 1;
3709 unsigned : 1;
3710 unsigned NOT_WRITE : 1;
3711 unsigned : 1;
3712 unsigned : 1;
3713 unsigned NOT_ADDRESS : 1;
3714 unsigned : 1;
3715 unsigned : 1;
3718 struct
3720 unsigned : 1;
3721 unsigned : 1;
3722 unsigned READ_WRITE : 1;
3723 unsigned : 1;
3724 unsigned : 1;
3725 unsigned DATA_ADDRESS : 1;
3726 unsigned : 1;
3727 unsigned : 1;
3730 struct
3732 unsigned : 1;
3733 unsigned : 1;
3734 unsigned I2C_READ : 1;
3735 unsigned : 1;
3736 unsigned : 1;
3737 unsigned I2C_DAT : 1;
3738 unsigned : 1;
3739 unsigned : 1;
3741 } __SSP1STATbits_t;
3743 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
3745 #define _BF 0x01
3746 #define _UA 0x02
3747 #define _R_NOT_W 0x04
3748 #define _R 0x04
3749 #define _R_W 0x04
3750 #define _NOT_W 0x04
3751 #define _NOT_WRITE 0x04
3752 #define _READ_WRITE 0x04
3753 #define _I2C_READ 0x04
3754 #define _S 0x08
3755 #define _I2C_START 0x08
3756 #define _P 0x10
3757 #define _I2C_STOP 0x10
3758 #define _D_NOT_A 0x20
3759 #define _D 0x20
3760 #define _D_A 0x20
3761 #define _NOT_A 0x20
3762 #define _NOT_ADDRESS 0x20
3763 #define _DATA_ADDRESS 0x20
3764 #define _I2C_DAT 0x20
3765 #define _CKE 0x40
3766 #define _SMP 0x80
3768 //==============================================================================
3771 //==============================================================================
3772 // SSPSTAT Bits
3774 extern __at(0x0FC7) __sfr SSPSTAT;
3776 typedef union
3778 struct
3780 unsigned BF : 1;
3781 unsigned UA : 1;
3782 unsigned R_NOT_W : 1;
3783 unsigned S : 1;
3784 unsigned P : 1;
3785 unsigned D_NOT_A : 1;
3786 unsigned CKE : 1;
3787 unsigned SMP : 1;
3790 struct
3792 unsigned : 1;
3793 unsigned : 1;
3794 unsigned R : 1;
3795 unsigned I2C_START : 1;
3796 unsigned I2C_STOP : 1;
3797 unsigned D : 1;
3798 unsigned : 1;
3799 unsigned : 1;
3802 struct
3804 unsigned : 1;
3805 unsigned : 1;
3806 unsigned R_W : 1;
3807 unsigned : 1;
3808 unsigned : 1;
3809 unsigned D_A : 1;
3810 unsigned : 1;
3811 unsigned : 1;
3814 struct
3816 unsigned : 1;
3817 unsigned : 1;
3818 unsigned NOT_W : 1;
3819 unsigned : 1;
3820 unsigned : 1;
3821 unsigned NOT_A : 1;
3822 unsigned : 1;
3823 unsigned : 1;
3826 struct
3828 unsigned : 1;
3829 unsigned : 1;
3830 unsigned NOT_WRITE : 1;
3831 unsigned : 1;
3832 unsigned : 1;
3833 unsigned NOT_ADDRESS : 1;
3834 unsigned : 1;
3835 unsigned : 1;
3838 struct
3840 unsigned : 1;
3841 unsigned : 1;
3842 unsigned READ_WRITE : 1;
3843 unsigned : 1;
3844 unsigned : 1;
3845 unsigned DATA_ADDRESS : 1;
3846 unsigned : 1;
3847 unsigned : 1;
3850 struct
3852 unsigned : 1;
3853 unsigned : 1;
3854 unsigned I2C_READ : 1;
3855 unsigned : 1;
3856 unsigned : 1;
3857 unsigned I2C_DAT : 1;
3858 unsigned : 1;
3859 unsigned : 1;
3861 } __SSPSTATbits_t;
3863 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
3865 #define _SSPSTAT_BF 0x01
3866 #define _SSPSTAT_UA 0x02
3867 #define _SSPSTAT_R_NOT_W 0x04
3868 #define _SSPSTAT_R 0x04
3869 #define _SSPSTAT_R_W 0x04
3870 #define _SSPSTAT_NOT_W 0x04
3871 #define _SSPSTAT_NOT_WRITE 0x04
3872 #define _SSPSTAT_READ_WRITE 0x04
3873 #define _SSPSTAT_I2C_READ 0x04
3874 #define _SSPSTAT_S 0x08
3875 #define _SSPSTAT_I2C_START 0x08
3876 #define _SSPSTAT_P 0x10
3877 #define _SSPSTAT_I2C_STOP 0x10
3878 #define _SSPSTAT_D_NOT_A 0x20
3879 #define _SSPSTAT_D 0x20
3880 #define _SSPSTAT_D_A 0x20
3881 #define _SSPSTAT_NOT_A 0x20
3882 #define _SSPSTAT_NOT_ADDRESS 0x20
3883 #define _SSPSTAT_DATA_ADDRESS 0x20
3884 #define _SSPSTAT_I2C_DAT 0x20
3885 #define _SSPSTAT_CKE 0x40
3886 #define _SSPSTAT_SMP 0x80
3888 //==============================================================================
3890 extern __at(0x0FC8) __sfr SSP1ADD;
3891 extern __at(0x0FC8) __sfr SSPADD;
3892 extern __at(0x0FC9) __sfr SSP1BUF;
3893 extern __at(0x0FC9) __sfr SSPBUF;
3895 //==============================================================================
3896 // T2CON Bits
3898 extern __at(0x0FCA) __sfr T2CON;
3900 typedef union
3902 struct
3904 unsigned T2CKPS0 : 1;
3905 unsigned T2CKPS1 : 1;
3906 unsigned TMR2ON : 1;
3907 unsigned T2OUTPS0 : 1;
3908 unsigned T2OUTPS1 : 1;
3909 unsigned T2OUTPS2 : 1;
3910 unsigned T2OUTPS3 : 1;
3911 unsigned : 1;
3914 struct
3916 unsigned T2CKPS : 2;
3917 unsigned : 6;
3920 struct
3922 unsigned : 3;
3923 unsigned T2OUTPS : 4;
3924 unsigned : 1;
3926 } __T2CONbits_t;
3928 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
3930 #define _T2CKPS0 0x01
3931 #define _T2CKPS1 0x02
3932 #define _TMR2ON 0x04
3933 #define _T2OUTPS0 0x08
3934 #define _T2OUTPS1 0x10
3935 #define _T2OUTPS2 0x20
3936 #define _T2OUTPS3 0x40
3938 //==============================================================================
3940 extern __at(0x0FCB) __sfr PR2;
3941 extern __at(0x0FCC) __sfr TMR2;
3943 //==============================================================================
3944 // T1CON Bits
3946 extern __at(0x0FCD) __sfr T1CON;
3948 typedef union
3950 struct
3952 unsigned TMR1ON : 1;
3953 unsigned TMR1CS : 1;
3954 unsigned NOT_T1SYNC : 1;
3955 unsigned T1OSCEN : 1;
3956 unsigned T1CKPS0 : 1;
3957 unsigned T1CKPS1 : 1;
3958 unsigned T1RUN : 1;
3959 unsigned RD16 : 1;
3962 struct
3964 unsigned : 1;
3965 unsigned : 1;
3966 unsigned T1INSYNC : 1;
3967 unsigned : 1;
3968 unsigned : 1;
3969 unsigned : 1;
3970 unsigned : 1;
3971 unsigned : 1;
3974 struct
3976 unsigned : 1;
3977 unsigned : 1;
3978 unsigned T1SYNC : 1;
3979 unsigned : 1;
3980 unsigned : 1;
3981 unsigned : 1;
3982 unsigned : 1;
3983 unsigned : 1;
3986 struct
3988 unsigned : 4;
3989 unsigned T1CKPS : 2;
3990 unsigned : 2;
3992 } __T1CONbits_t;
3994 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
3996 #define _TMR1ON 0x01
3997 #define _TMR1CS 0x02
3998 #define _NOT_T1SYNC 0x04
3999 #define _T1INSYNC 0x04
4000 #define _T1SYNC 0x04
4001 #define _T1OSCEN 0x08
4002 #define _T1CKPS0 0x10
4003 #define _T1CKPS1 0x20
4004 #define _T1RUN 0x40
4005 #define _RD16 0x80
4007 //==============================================================================
4009 extern __at(0x0FCE) __sfr TMR1;
4010 extern __at(0x0FCE) __sfr TMR1L;
4011 extern __at(0x0FCF) __sfr TMR1H;
4013 //==============================================================================
4014 // RCON Bits
4016 extern __at(0x0FD0) __sfr RCON;
4018 typedef union
4020 struct
4022 unsigned NOT_BOR : 1;
4023 unsigned NOT_POR : 1;
4024 unsigned NOT_PD : 1;
4025 unsigned NOT_TO : 1;
4026 unsigned NOT_RI : 1;
4027 unsigned NOT_CM : 1;
4028 unsigned : 1;
4029 unsigned IPEN : 1;
4032 struct
4034 unsigned BOR : 1;
4035 unsigned POR : 1;
4036 unsigned PD : 1;
4037 unsigned TO : 1;
4038 unsigned RI : 1;
4039 unsigned CM : 1;
4040 unsigned : 1;
4041 unsigned : 1;
4043 } __RCONbits_t;
4045 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
4047 #define _NOT_BOR 0x01
4048 #define _BOR 0x01
4049 #define _NOT_POR 0x02
4050 #define _POR 0x02
4051 #define _NOT_PD 0x04
4052 #define _PD 0x04
4053 #define _NOT_TO 0x08
4054 #define _TO 0x08
4055 #define _NOT_RI 0x10
4056 #define _RI 0x10
4057 #define _NOT_CM 0x20
4058 #define _CM 0x20
4059 #define _IPEN 0x80
4061 //==============================================================================
4064 //==============================================================================
4065 // WDTCON Bits
4067 extern __at(0x0FD1) __sfr WDTCON;
4069 typedef union
4071 struct
4073 unsigned SWDTEN : 1;
4074 unsigned : 1;
4075 unsigned : 1;
4076 unsigned : 1;
4077 unsigned : 1;
4078 unsigned : 1;
4079 unsigned : 1;
4080 unsigned REGSLP : 1;
4083 struct
4085 unsigned SWDTE : 1;
4086 unsigned : 1;
4087 unsigned : 1;
4088 unsigned : 1;
4089 unsigned : 1;
4090 unsigned : 1;
4091 unsigned : 1;
4092 unsigned : 1;
4094 } __WDTCONbits_t;
4096 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
4098 #define _SWDTEN 0x01
4099 #define _SWDTE 0x01
4100 #define _REGSLP 0x80
4102 //==============================================================================
4105 //==============================================================================
4106 // OSCCON Bits
4108 extern __at(0x0FD3) __sfr OSCCON;
4110 typedef union
4112 struct
4114 unsigned SCS0 : 1;
4115 unsigned SCS1 : 1;
4116 unsigned IOFS : 1;
4117 unsigned OSTS : 1;
4118 unsigned IRCF0 : 1;
4119 unsigned IRCF1 : 1;
4120 unsigned IRCF2 : 1;
4121 unsigned IDLEN : 1;
4124 struct
4126 unsigned SCS : 2;
4127 unsigned : 6;
4130 struct
4132 unsigned : 4;
4133 unsigned IRCF : 3;
4134 unsigned : 1;
4136 } __OSCCONbits_t;
4138 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
4140 #define _SCS0 0x01
4141 #define _SCS1 0x02
4142 #define _IOFS 0x04
4143 #define _OSTS 0x08
4144 #define _IRCF0 0x10
4145 #define _IRCF1 0x20
4146 #define _IRCF2 0x40
4147 #define _IDLEN 0x80
4149 //==============================================================================
4152 //==============================================================================
4153 // T0CON Bits
4155 extern __at(0x0FD5) __sfr T0CON;
4157 typedef union
4159 struct
4161 unsigned T0PS0 : 1;
4162 unsigned T0PS1 : 1;
4163 unsigned T0PS2 : 1;
4164 unsigned PSA : 1;
4165 unsigned T0SE : 1;
4166 unsigned T0CS : 1;
4167 unsigned T08BIT : 1;
4168 unsigned TMR0ON : 1;
4171 struct
4173 unsigned : 1;
4174 unsigned : 1;
4175 unsigned : 1;
4176 unsigned T0PS3 : 1;
4177 unsigned : 1;
4178 unsigned : 1;
4179 unsigned : 1;
4180 unsigned : 1;
4183 struct
4185 unsigned T0PS : 4;
4186 unsigned : 4;
4188 } __T0CONbits_t;
4190 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
4192 #define _T0PS0 0x01
4193 #define _T0PS1 0x02
4194 #define _T0PS2 0x04
4195 #define _PSA 0x08
4196 #define _T0PS3 0x08
4197 #define _T0SE 0x10
4198 #define _T0CS 0x20
4199 #define _T08BIT 0x40
4200 #define _TMR0ON 0x80
4202 //==============================================================================
4204 extern __at(0x0FD6) __sfr TMR0;
4205 extern __at(0x0FD6) __sfr TMR0L;
4206 extern __at(0x0FD7) __sfr TMR0H;
4208 //==============================================================================
4209 // STATUS Bits
4211 extern __at(0x0FD8) __sfr STATUS;
4213 typedef struct
4215 unsigned C : 1;
4216 unsigned DC : 1;
4217 unsigned Z : 1;
4218 unsigned OV : 1;
4219 unsigned N : 1;
4220 unsigned : 1;
4221 unsigned : 1;
4222 unsigned : 1;
4223 } __STATUSbits_t;
4225 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
4227 #define _C 0x01
4228 #define _DC 0x02
4229 #define _Z 0x04
4230 #define _OV 0x08
4231 #define _N 0x10
4233 //==============================================================================
4235 extern __at(0x0FD9) __sfr FSR2L;
4236 extern __at(0x0FDA) __sfr FSR2H;
4237 extern __at(0x0FDB) __sfr PLUSW2;
4238 extern __at(0x0FDC) __sfr PREINC2;
4239 extern __at(0x0FDD) __sfr POSTDEC2;
4240 extern __at(0x0FDE) __sfr POSTINC2;
4241 extern __at(0x0FDF) __sfr INDF2;
4242 extern __at(0x0FE0) __sfr BSR;
4243 extern __at(0x0FE1) __sfr FSR1L;
4244 extern __at(0x0FE2) __sfr FSR1H;
4245 extern __at(0x0FE3) __sfr PLUSW1;
4246 extern __at(0x0FE4) __sfr PREINC1;
4247 extern __at(0x0FE5) __sfr POSTDEC1;
4248 extern __at(0x0FE6) __sfr POSTINC1;
4249 extern __at(0x0FE7) __sfr INDF1;
4250 extern __at(0x0FE8) __sfr WREG;
4251 extern __at(0x0FE9) __sfr FSR0L;
4252 extern __at(0x0FEA) __sfr FSR0H;
4253 extern __at(0x0FEB) __sfr PLUSW0;
4254 extern __at(0x0FEC) __sfr PREINC0;
4255 extern __at(0x0FED) __sfr POSTDEC0;
4256 extern __at(0x0FEE) __sfr POSTINC0;
4257 extern __at(0x0FEF) __sfr INDF0;
4259 //==============================================================================
4260 // INTCON3 Bits
4262 extern __at(0x0FF0) __sfr INTCON3;
4264 typedef union
4266 struct
4268 unsigned INT1IF : 1;
4269 unsigned INT2IF : 1;
4270 unsigned INT3IF : 1;
4271 unsigned INT1IE : 1;
4272 unsigned INT2IE : 1;
4273 unsigned INT3IE : 1;
4274 unsigned INT1IP : 1;
4275 unsigned INT2IP : 1;
4278 struct
4280 unsigned INT1F : 1;
4281 unsigned INT2F : 1;
4282 unsigned INT3F : 1;
4283 unsigned INT1E : 1;
4284 unsigned INT2E : 1;
4285 unsigned INT3E : 1;
4286 unsigned INT1P : 1;
4287 unsigned INT2P : 1;
4289 } __INTCON3bits_t;
4291 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
4293 #define _INT1IF 0x01
4294 #define _INT1F 0x01
4295 #define _INT2IF 0x02
4296 #define _INT2F 0x02
4297 #define _INT3IF 0x04
4298 #define _INT3F 0x04
4299 #define _INT1IE 0x08
4300 #define _INT1E 0x08
4301 #define _INT2IE 0x10
4302 #define _INT2E 0x10
4303 #define _INT3IE 0x20
4304 #define _INT3E 0x20
4305 #define _INT1IP 0x40
4306 #define _INT1P 0x40
4307 #define _INT2IP 0x80
4308 #define _INT2P 0x80
4310 //==============================================================================
4313 //==============================================================================
4314 // INTCON2 Bits
4316 extern __at(0x0FF1) __sfr INTCON2;
4318 typedef union
4320 struct
4322 unsigned RBIP : 1;
4323 unsigned INT3IP : 1;
4324 unsigned TMR0IP : 1;
4325 unsigned INTEDG3 : 1;
4326 unsigned INTEDG2 : 1;
4327 unsigned INTEDG1 : 1;
4328 unsigned INTEDG0 : 1;
4329 unsigned NOT_RBPU : 1;
4332 struct
4334 unsigned : 1;
4335 unsigned INT3P : 1;
4336 unsigned T0IP : 1;
4337 unsigned : 1;
4338 unsigned : 1;
4339 unsigned : 1;
4340 unsigned : 1;
4341 unsigned RBPU : 1;
4343 } __INTCON2bits_t;
4345 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
4347 #define _RBIP 0x01
4348 #define _INT3IP 0x02
4349 #define _INT3P 0x02
4350 #define _TMR0IP 0x04
4351 #define _T0IP 0x04
4352 #define _INTEDG3 0x08
4353 #define _INTEDG2 0x10
4354 #define _INTEDG1 0x20
4355 #define _INTEDG0 0x40
4356 #define _NOT_RBPU 0x80
4357 #define _RBPU 0x80
4359 //==============================================================================
4362 //==============================================================================
4363 // INTCON Bits
4365 extern __at(0x0FF2) __sfr INTCON;
4367 typedef union
4369 struct
4371 unsigned RBIF : 1;
4372 unsigned INT0IF : 1;
4373 unsigned TMR0IF : 1;
4374 unsigned RBIE : 1;
4375 unsigned INT0IE : 1;
4376 unsigned TMR0IE : 1;
4377 unsigned PEIE_GIEL : 1;
4378 unsigned GIE_GIEH : 1;
4381 struct
4383 unsigned : 1;
4384 unsigned INT0F : 1;
4385 unsigned T0IF : 1;
4386 unsigned : 1;
4387 unsigned INT0E : 1;
4388 unsigned T0IE : 1;
4389 unsigned PEIE : 1;
4390 unsigned GIE : 1;
4393 struct
4395 unsigned : 1;
4396 unsigned : 1;
4397 unsigned : 1;
4398 unsigned : 1;
4399 unsigned : 1;
4400 unsigned : 1;
4401 unsigned GIEL : 1;
4402 unsigned GIEH : 1;
4404 } __INTCONbits_t;
4406 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
4408 #define _RBIF 0x01
4409 #define _INT0IF 0x02
4410 #define _INT0F 0x02
4411 #define _TMR0IF 0x04
4412 #define _T0IF 0x04
4413 #define _RBIE 0x08
4414 #define _INT0IE 0x10
4415 #define _INT0E 0x10
4416 #define _TMR0IE 0x20
4417 #define _T0IE 0x20
4418 #define _PEIE_GIEL 0x40
4419 #define _PEIE 0x40
4420 #define _GIEL 0x40
4421 #define _GIE_GIEH 0x80
4422 #define _GIE 0x80
4423 #define _GIEH 0x80
4425 //==============================================================================
4427 extern __at(0x0FF3) __sfr PROD;
4428 extern __at(0x0FF3) __sfr PRODL;
4429 extern __at(0x0FF4) __sfr PRODH;
4430 extern __at(0x0FF5) __sfr TABLAT;
4431 extern __at(0x0FF6) __sfr TBLPTR;
4432 extern __at(0x0FF6) __sfr TBLPTRL;
4433 extern __at(0x0FF7) __sfr TBLPTRH;
4434 extern __at(0x0FF8) __sfr TBLPTRU;
4435 extern __at(0x0FF9) __sfr PC;
4436 extern __at(0x0FF9) __sfr PCL;
4437 extern __at(0x0FFA) __sfr PCLATH;
4438 extern __at(0x0FFB) __sfr PCLATU;
4440 //==============================================================================
4441 // STKPTR Bits
4443 extern __at(0x0FFC) __sfr STKPTR;
4445 typedef union
4447 struct
4449 unsigned SP0 : 1;
4450 unsigned SP1 : 1;
4451 unsigned SP2 : 1;
4452 unsigned SP3 : 1;
4453 unsigned SP4 : 1;
4454 unsigned : 1;
4455 unsigned STKUNF : 1;
4456 unsigned STKFUL : 1;
4459 struct
4461 unsigned STKPTR0 : 1;
4462 unsigned STKPTR1 : 1;
4463 unsigned STKPTR2 : 1;
4464 unsigned STKPTR3 : 1;
4465 unsigned STKPTR4 : 1;
4466 unsigned : 1;
4467 unsigned : 1;
4468 unsigned STKOVF : 1;
4471 struct
4473 unsigned STKPTR : 5;
4474 unsigned : 3;
4477 struct
4479 unsigned SP : 5;
4480 unsigned : 3;
4482 } __STKPTRbits_t;
4484 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
4486 #define _SP0 0x01
4487 #define _STKPTR0 0x01
4488 #define _SP1 0x02
4489 #define _STKPTR1 0x02
4490 #define _SP2 0x04
4491 #define _STKPTR2 0x04
4492 #define _SP3 0x08
4493 #define _STKPTR3 0x08
4494 #define _SP4 0x10
4495 #define _STKPTR4 0x10
4496 #define _STKUNF 0x40
4497 #define _STKFUL 0x80
4498 #define _STKOVF 0x80
4500 //==============================================================================
4502 extern __at(0x0FFD) __sfr TOS;
4503 extern __at(0x0FFD) __sfr TOSL;
4504 extern __at(0x0FFE) __sfr TOSH;
4505 extern __at(0x0FFF) __sfr TOSU;
4507 //==============================================================================
4509 // Configuration Addresses
4511 //==============================================================================
4513 #define __CONFIG1L 0x001FF8
4514 #define __CONFIG1H 0x001FF9
4515 #define __CONFIG2L 0x001FFA
4516 #define __CONFIG2H 0x001FFB
4517 #define __CONFIG3L 0x001FFC
4518 #define __CONFIG3H 0x001FFD
4520 //==============================================================================
4522 #endif // #ifndef __PIC18F83J11_H__