struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f64j11.h
blob233e342d937858cf4ab55d491126cf183a52d445
1 /*
2 * This declarations of the PIC18F64J11 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:31 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 __PIC18F64J11_H__
26 #define __PIC18F64J11_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;
639 } __PORTDbits_t;
641 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
643 #define _PORTD_RD0 0x01
644 #define _PORTD_PSP0 0x01
645 #define _PORTD_RD1 0x02
646 #define _PORTD_PSP1 0x02
647 #define _PORTD_RD2 0x04
648 #define _PORTD_PSP2 0x04
649 #define _PORTD_RD3 0x08
650 #define _PORTD_PSP3 0x08
651 #define _PORTD_RD4 0x10
652 #define _PORTD_PSP4 0x10
653 #define _PORTD_RD5 0x20
654 #define _PORTD_PSP5 0x20
655 #define _PORTD_RD6 0x40
656 #define _PORTD_PSP6 0x40
657 #define _PORTD_RD7 0x80
658 #define _PORTD_PSP7 0x80
660 //==============================================================================
663 //==============================================================================
664 // PORTE Bits
666 extern __at(0x0F84) __sfr PORTE;
668 typedef union
670 struct
672 unsigned RE0 : 1;
673 unsigned RE1 : 1;
674 unsigned RE2 : 1;
675 unsigned RE3 : 1;
676 unsigned RE4 : 1;
677 unsigned RE5 : 1;
678 unsigned RE6 : 1;
679 unsigned RE7 : 1;
682 struct
684 unsigned RD : 1;
685 unsigned WR : 1;
686 unsigned CS : 1;
687 unsigned : 1;
688 unsigned : 1;
689 unsigned : 1;
690 unsigned : 1;
691 unsigned CCP2 : 1;
693 } __PORTEbits_t;
695 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
697 #define _PORTE_RE0 0x01
698 #define _PORTE_RD 0x01
699 #define _PORTE_RE1 0x02
700 #define _PORTE_WR 0x02
701 #define _PORTE_RE2 0x04
702 #define _PORTE_CS 0x04
703 #define _PORTE_RE3 0x08
704 #define _PORTE_RE4 0x10
705 #define _PORTE_RE5 0x20
706 #define _PORTE_RE6 0x40
707 #define _PORTE_RE7 0x80
708 #define _PORTE_CCP2 0x80
710 //==============================================================================
713 //==============================================================================
714 // PORTF Bits
716 extern __at(0x0F85) __sfr PORTF;
718 typedef union
720 struct
722 unsigned : 1;
723 unsigned RF1 : 1;
724 unsigned RF2 : 1;
725 unsigned RF3 : 1;
726 unsigned RF4 : 1;
727 unsigned RF5 : 1;
728 unsigned RF6 : 1;
729 unsigned RF7 : 1;
732 struct
734 unsigned : 1;
735 unsigned AN6 : 1;
736 unsigned AN7 : 1;
737 unsigned AN8 : 1;
738 unsigned AN9 : 1;
739 unsigned AN10 : 1;
740 unsigned AN11 : 1;
741 unsigned AN5 : 1;
744 struct
746 unsigned : 1;
747 unsigned C2OUT : 1;
748 unsigned C1OUT : 1;
749 unsigned C2INB : 1;
750 unsigned C2INA : 1;
751 unsigned C1INB : 1;
752 unsigned C1INA : 1;
753 unsigned SS1 : 1;
756 struct
758 unsigned : 1;
759 unsigned : 1;
760 unsigned : 1;
761 unsigned : 1;
762 unsigned : 1;
763 unsigned CVREF : 1;
764 unsigned : 1;
765 unsigned : 1;
767 } __PORTFbits_t;
769 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
771 #define _PORTF_RF1 0x02
772 #define _PORTF_AN6 0x02
773 #define _PORTF_C2OUT 0x02
774 #define _PORTF_RF2 0x04
775 #define _PORTF_AN7 0x04
776 #define _PORTF_C1OUT 0x04
777 #define _PORTF_RF3 0x08
778 #define _PORTF_AN8 0x08
779 #define _PORTF_C2INB 0x08
780 #define _PORTF_RF4 0x10
781 #define _PORTF_AN9 0x10
782 #define _PORTF_C2INA 0x10
783 #define _PORTF_RF5 0x20
784 #define _PORTF_AN10 0x20
785 #define _PORTF_C1INB 0x20
786 #define _PORTF_CVREF 0x20
787 #define _PORTF_RF6 0x40
788 #define _PORTF_AN11 0x40
789 #define _PORTF_C1INA 0x40
790 #define _PORTF_RF7 0x80
791 #define _PORTF_AN5 0x80
792 #define _PORTF_SS1 0x80
794 //==============================================================================
797 //==============================================================================
798 // PORTG Bits
800 extern __at(0x0F86) __sfr PORTG;
802 typedef union
804 struct
806 unsigned RG0 : 1;
807 unsigned RG1 : 1;
808 unsigned RG2 : 1;
809 unsigned RG3 : 1;
810 unsigned RG4 : 1;
811 unsigned : 1;
812 unsigned REPU : 1;
813 unsigned RDPU : 1;
816 struct
818 unsigned : 1;
819 unsigned CK2 : 1;
820 unsigned DT2 : 1;
821 unsigned : 1;
822 unsigned : 1;
823 unsigned : 1;
824 unsigned : 1;
825 unsigned : 1;
828 struct
830 unsigned : 1;
831 unsigned TX2 : 1;
832 unsigned RX2 : 1;
833 unsigned : 1;
834 unsigned : 1;
835 unsigned : 1;
836 unsigned : 1;
837 unsigned : 1;
840 struct
842 unsigned RG : 5;
843 unsigned : 3;
845 } __PORTGbits_t;
847 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
849 #define _PORTG_RG0 0x01
850 #define _PORTG_RG1 0x02
851 #define _PORTG_CK2 0x02
852 #define _PORTG_TX2 0x02
853 #define _PORTG_RG2 0x04
854 #define _PORTG_DT2 0x04
855 #define _PORTG_RX2 0x04
856 #define _PORTG_RG3 0x08
857 #define _PORTG_RG4 0x10
858 #define _PORTG_REPU 0x40
859 #define _PORTG_RDPU 0x80
861 //==============================================================================
864 //==============================================================================
865 // LATA Bits
867 extern __at(0x0F89) __sfr LATA;
869 typedef struct
871 unsigned LATA0 : 1;
872 unsigned LATA1 : 1;
873 unsigned LATA2 : 1;
874 unsigned LATA3 : 1;
875 unsigned LATA4 : 1;
876 unsigned LATA5 : 1;
877 unsigned LATA6 : 1;
878 unsigned LATA7 : 1;
879 } __LATAbits_t;
881 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
883 #define _LATA0 0x01
884 #define _LATA1 0x02
885 #define _LATA2 0x04
886 #define _LATA3 0x08
887 #define _LATA4 0x10
888 #define _LATA5 0x20
889 #define _LATA6 0x40
890 #define _LATA7 0x80
892 //==============================================================================
895 //==============================================================================
896 // LATB Bits
898 extern __at(0x0F8A) __sfr LATB;
900 typedef struct
902 unsigned LATB0 : 1;
903 unsigned LATB1 : 1;
904 unsigned LATB2 : 1;
905 unsigned LATB3 : 1;
906 unsigned LATB4 : 1;
907 unsigned LATB5 : 1;
908 unsigned LATB6 : 1;
909 unsigned LATB7 : 1;
910 } __LATBbits_t;
912 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
914 #define _LATB0 0x01
915 #define _LATB1 0x02
916 #define _LATB2 0x04
917 #define _LATB3 0x08
918 #define _LATB4 0x10
919 #define _LATB5 0x20
920 #define _LATB6 0x40
921 #define _LATB7 0x80
923 //==============================================================================
926 //==============================================================================
927 // LATC Bits
929 extern __at(0x0F8B) __sfr LATC;
931 typedef struct
933 unsigned LATC0 : 1;
934 unsigned LATC1 : 1;
935 unsigned LATC2 : 1;
936 unsigned LATC3 : 1;
937 unsigned LATC4 : 1;
938 unsigned LATC5 : 1;
939 unsigned LATC6 : 1;
940 unsigned LATC7 : 1;
941 } __LATCbits_t;
943 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
945 #define _LATC0 0x01
946 #define _LATC1 0x02
947 #define _LATC2 0x04
948 #define _LATC3 0x08
949 #define _LATC4 0x10
950 #define _LATC5 0x20
951 #define _LATC6 0x40
952 #define _LATC7 0x80
954 //==============================================================================
957 //==============================================================================
958 // LATD Bits
960 extern __at(0x0F8C) __sfr LATD;
962 typedef struct
964 unsigned LATD0 : 1;
965 unsigned LATD1 : 1;
966 unsigned LATD2 : 1;
967 unsigned LATD3 : 1;
968 unsigned LATD4 : 1;
969 unsigned LATD5 : 1;
970 unsigned LATD6 : 1;
971 unsigned LATD7 : 1;
972 } __LATDbits_t;
974 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
976 #define _LATD0 0x01
977 #define _LATD1 0x02
978 #define _LATD2 0x04
979 #define _LATD3 0x08
980 #define _LATD4 0x10
981 #define _LATD5 0x20
982 #define _LATD6 0x40
983 #define _LATD7 0x80
985 //==============================================================================
988 //==============================================================================
989 // LATE Bits
991 extern __at(0x0F8D) __sfr LATE;
993 typedef struct
995 unsigned LATE0 : 1;
996 unsigned LATE1 : 1;
997 unsigned LATE2 : 1;
998 unsigned LATE3 : 1;
999 unsigned LATE4 : 1;
1000 unsigned LATE5 : 1;
1001 unsigned LATE6 : 1;
1002 unsigned LATE7 : 1;
1003 } __LATEbits_t;
1005 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1007 #define _LATE0 0x01
1008 #define _LATE1 0x02
1009 #define _LATE2 0x04
1010 #define _LATE3 0x08
1011 #define _LATE4 0x10
1012 #define _LATE5 0x20
1013 #define _LATE6 0x40
1014 #define _LATE7 0x80
1016 //==============================================================================
1019 //==============================================================================
1020 // LATF Bits
1022 extern __at(0x0F8E) __sfr LATF;
1024 typedef struct
1026 unsigned : 1;
1027 unsigned LATF1 : 1;
1028 unsigned LATF2 : 1;
1029 unsigned LATF3 : 1;
1030 unsigned LATF4 : 1;
1031 unsigned LATF5 : 1;
1032 unsigned LATF6 : 1;
1033 unsigned LATF7 : 1;
1034 } __LATFbits_t;
1036 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
1038 #define _LATF1 0x02
1039 #define _LATF2 0x04
1040 #define _LATF3 0x08
1041 #define _LATF4 0x10
1042 #define _LATF5 0x20
1043 #define _LATF6 0x40
1044 #define _LATF7 0x80
1046 //==============================================================================
1049 //==============================================================================
1050 // LATG Bits
1052 extern __at(0x0F8F) __sfr LATG;
1054 typedef union
1056 struct
1058 unsigned LATG0 : 1;
1059 unsigned LATG1 : 1;
1060 unsigned LATG2 : 1;
1061 unsigned LATG3 : 1;
1062 unsigned LATG4 : 1;
1063 unsigned : 1;
1064 unsigned U1OD : 1;
1065 unsigned U2OD : 1;
1068 struct
1070 unsigned LATG : 5;
1071 unsigned : 3;
1073 } __LATGbits_t;
1075 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
1077 #define _LATG0 0x01
1078 #define _LATG1 0x02
1079 #define _LATG2 0x04
1080 #define _LATG3 0x08
1081 #define _LATG4 0x10
1082 #define _U1OD 0x40
1083 #define _U2OD 0x80
1085 //==============================================================================
1088 //==============================================================================
1089 // DDRA Bits
1091 extern __at(0x0F92) __sfr DDRA;
1093 typedef union
1095 struct
1097 unsigned TRISA0 : 1;
1098 unsigned TRISA1 : 1;
1099 unsigned TRISA2 : 1;
1100 unsigned TRISA3 : 1;
1101 unsigned TRISA4 : 1;
1102 unsigned TRISA5 : 1;
1103 unsigned TRISA6 : 1;
1104 unsigned TRISA7 : 1;
1107 struct
1109 unsigned RA0 : 1;
1110 unsigned RA1 : 1;
1111 unsigned RA2 : 1;
1112 unsigned RA3 : 1;
1113 unsigned RA4 : 1;
1114 unsigned RA5 : 1;
1115 unsigned RA6 : 1;
1116 unsigned RA7 : 1;
1118 } __DDRAbits_t;
1120 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1122 #define _TRISA0 0x01
1123 #define _RA0 0x01
1124 #define _TRISA1 0x02
1125 #define _RA1 0x02
1126 #define _TRISA2 0x04
1127 #define _RA2 0x04
1128 #define _TRISA3 0x08
1129 #define _RA3 0x08
1130 #define _TRISA4 0x10
1131 #define _RA4 0x10
1132 #define _TRISA5 0x20
1133 #define _RA5 0x20
1134 #define _TRISA6 0x40
1135 #define _RA6 0x40
1136 #define _TRISA7 0x80
1137 #define _RA7 0x80
1139 //==============================================================================
1142 //==============================================================================
1143 // TRISA Bits
1145 extern __at(0x0F92) __sfr TRISA;
1147 typedef union
1149 struct
1151 unsigned TRISA0 : 1;
1152 unsigned TRISA1 : 1;
1153 unsigned TRISA2 : 1;
1154 unsigned TRISA3 : 1;
1155 unsigned TRISA4 : 1;
1156 unsigned TRISA5 : 1;
1157 unsigned TRISA6 : 1;
1158 unsigned TRISA7 : 1;
1161 struct
1163 unsigned RA0 : 1;
1164 unsigned RA1 : 1;
1165 unsigned RA2 : 1;
1166 unsigned RA3 : 1;
1167 unsigned RA4 : 1;
1168 unsigned RA5 : 1;
1169 unsigned RA6 : 1;
1170 unsigned RA7 : 1;
1172 } __TRISAbits_t;
1174 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1176 #define _TRISA_TRISA0 0x01
1177 #define _TRISA_RA0 0x01
1178 #define _TRISA_TRISA1 0x02
1179 #define _TRISA_RA1 0x02
1180 #define _TRISA_TRISA2 0x04
1181 #define _TRISA_RA2 0x04
1182 #define _TRISA_TRISA3 0x08
1183 #define _TRISA_RA3 0x08
1184 #define _TRISA_TRISA4 0x10
1185 #define _TRISA_RA4 0x10
1186 #define _TRISA_TRISA5 0x20
1187 #define _TRISA_RA5 0x20
1188 #define _TRISA_TRISA6 0x40
1189 #define _TRISA_RA6 0x40
1190 #define _TRISA_TRISA7 0x80
1191 #define _TRISA_RA7 0x80
1193 //==============================================================================
1196 //==============================================================================
1197 // DDRB Bits
1199 extern __at(0x0F93) __sfr DDRB;
1201 typedef union
1203 struct
1205 unsigned TRISB0 : 1;
1206 unsigned TRISB1 : 1;
1207 unsigned TRISB2 : 1;
1208 unsigned TRISB3 : 1;
1209 unsigned TRISB4 : 1;
1210 unsigned TRISB5 : 1;
1211 unsigned TRISB6 : 1;
1212 unsigned TRISB7 : 1;
1215 struct
1217 unsigned RB0 : 1;
1218 unsigned RB1 : 1;
1219 unsigned RB2 : 1;
1220 unsigned RB3 : 1;
1221 unsigned RB4 : 1;
1222 unsigned RB5 : 1;
1223 unsigned RB6 : 1;
1224 unsigned RB7 : 1;
1226 } __DDRBbits_t;
1228 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1230 #define _TRISB0 0x01
1231 #define _RB0 0x01
1232 #define _TRISB1 0x02
1233 #define _RB1 0x02
1234 #define _TRISB2 0x04
1235 #define _RB2 0x04
1236 #define _TRISB3 0x08
1237 #define _RB3 0x08
1238 #define _TRISB4 0x10
1239 #define _RB4 0x10
1240 #define _TRISB5 0x20
1241 #define _RB5 0x20
1242 #define _TRISB6 0x40
1243 #define _RB6 0x40
1244 #define _TRISB7 0x80
1245 #define _RB7 0x80
1247 //==============================================================================
1250 //==============================================================================
1251 // TRISB Bits
1253 extern __at(0x0F93) __sfr TRISB;
1255 typedef union
1257 struct
1259 unsigned TRISB0 : 1;
1260 unsigned TRISB1 : 1;
1261 unsigned TRISB2 : 1;
1262 unsigned TRISB3 : 1;
1263 unsigned TRISB4 : 1;
1264 unsigned TRISB5 : 1;
1265 unsigned TRISB6 : 1;
1266 unsigned TRISB7 : 1;
1269 struct
1271 unsigned RB0 : 1;
1272 unsigned RB1 : 1;
1273 unsigned RB2 : 1;
1274 unsigned RB3 : 1;
1275 unsigned RB4 : 1;
1276 unsigned RB5 : 1;
1277 unsigned RB6 : 1;
1278 unsigned RB7 : 1;
1280 } __TRISBbits_t;
1282 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1284 #define _TRISB_TRISB0 0x01
1285 #define _TRISB_RB0 0x01
1286 #define _TRISB_TRISB1 0x02
1287 #define _TRISB_RB1 0x02
1288 #define _TRISB_TRISB2 0x04
1289 #define _TRISB_RB2 0x04
1290 #define _TRISB_TRISB3 0x08
1291 #define _TRISB_RB3 0x08
1292 #define _TRISB_TRISB4 0x10
1293 #define _TRISB_RB4 0x10
1294 #define _TRISB_TRISB5 0x20
1295 #define _TRISB_RB5 0x20
1296 #define _TRISB_TRISB6 0x40
1297 #define _TRISB_RB6 0x40
1298 #define _TRISB_TRISB7 0x80
1299 #define _TRISB_RB7 0x80
1301 //==============================================================================
1304 //==============================================================================
1305 // DDRC Bits
1307 extern __at(0x0F94) __sfr DDRC;
1309 typedef union
1311 struct
1313 unsigned TRISC0 : 1;
1314 unsigned TRISC1 : 1;
1315 unsigned TRISC2 : 1;
1316 unsigned TRISC3 : 1;
1317 unsigned TRISC4 : 1;
1318 unsigned TRISC5 : 1;
1319 unsigned TRISC6 : 1;
1320 unsigned TRISC7 : 1;
1323 struct
1325 unsigned RC0 : 1;
1326 unsigned RC1 : 1;
1327 unsigned RC2 : 1;
1328 unsigned RC3 : 1;
1329 unsigned RC4 : 1;
1330 unsigned RC5 : 1;
1331 unsigned RC6 : 1;
1332 unsigned RC7 : 1;
1334 } __DDRCbits_t;
1336 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1338 #define _TRISC0 0x01
1339 #define _RC0 0x01
1340 #define _TRISC1 0x02
1341 #define _RC1 0x02
1342 #define _TRISC2 0x04
1343 #define _RC2 0x04
1344 #define _TRISC3 0x08
1345 #define _RC3 0x08
1346 #define _TRISC4 0x10
1347 #define _RC4 0x10
1348 #define _TRISC5 0x20
1349 #define _RC5 0x20
1350 #define _TRISC6 0x40
1351 #define _RC6 0x40
1352 #define _TRISC7 0x80
1353 #define _RC7 0x80
1355 //==============================================================================
1358 //==============================================================================
1359 // TRISC Bits
1361 extern __at(0x0F94) __sfr TRISC;
1363 typedef union
1365 struct
1367 unsigned TRISC0 : 1;
1368 unsigned TRISC1 : 1;
1369 unsigned TRISC2 : 1;
1370 unsigned TRISC3 : 1;
1371 unsigned TRISC4 : 1;
1372 unsigned TRISC5 : 1;
1373 unsigned TRISC6 : 1;
1374 unsigned TRISC7 : 1;
1377 struct
1379 unsigned RC0 : 1;
1380 unsigned RC1 : 1;
1381 unsigned RC2 : 1;
1382 unsigned RC3 : 1;
1383 unsigned RC4 : 1;
1384 unsigned RC5 : 1;
1385 unsigned RC6 : 1;
1386 unsigned RC7 : 1;
1388 } __TRISCbits_t;
1390 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1392 #define _TRISC_TRISC0 0x01
1393 #define _TRISC_RC0 0x01
1394 #define _TRISC_TRISC1 0x02
1395 #define _TRISC_RC1 0x02
1396 #define _TRISC_TRISC2 0x04
1397 #define _TRISC_RC2 0x04
1398 #define _TRISC_TRISC3 0x08
1399 #define _TRISC_RC3 0x08
1400 #define _TRISC_TRISC4 0x10
1401 #define _TRISC_RC4 0x10
1402 #define _TRISC_TRISC5 0x20
1403 #define _TRISC_RC5 0x20
1404 #define _TRISC_TRISC6 0x40
1405 #define _TRISC_RC6 0x40
1406 #define _TRISC_TRISC7 0x80
1407 #define _TRISC_RC7 0x80
1409 //==============================================================================
1412 //==============================================================================
1413 // DDRD Bits
1415 extern __at(0x0F95) __sfr DDRD;
1417 typedef union
1419 struct
1421 unsigned TRISD0 : 1;
1422 unsigned TRISD1 : 1;
1423 unsigned TRISD2 : 1;
1424 unsigned TRISD3 : 1;
1425 unsigned TRISD4 : 1;
1426 unsigned TRISD5 : 1;
1427 unsigned TRISD6 : 1;
1428 unsigned TRISD7 : 1;
1431 struct
1433 unsigned RD0 : 1;
1434 unsigned RD1 : 1;
1435 unsigned RD2 : 1;
1436 unsigned RD3 : 1;
1437 unsigned RD4 : 1;
1438 unsigned RD5 : 1;
1439 unsigned RD6 : 1;
1440 unsigned RD7 : 1;
1442 } __DDRDbits_t;
1444 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
1446 #define _TRISD0 0x01
1447 #define _RD0 0x01
1448 #define _TRISD1 0x02
1449 #define _RD1 0x02
1450 #define _TRISD2 0x04
1451 #define _RD2 0x04
1452 #define _TRISD3 0x08
1453 #define _RD3 0x08
1454 #define _TRISD4 0x10
1455 #define _RD4 0x10
1456 #define _TRISD5 0x20
1457 #define _RD5 0x20
1458 #define _TRISD6 0x40
1459 #define _RD6 0x40
1460 #define _TRISD7 0x80
1461 #define _RD7 0x80
1463 //==============================================================================
1466 //==============================================================================
1467 // TRISD Bits
1469 extern __at(0x0F95) __sfr TRISD;
1471 typedef union
1473 struct
1475 unsigned TRISD0 : 1;
1476 unsigned TRISD1 : 1;
1477 unsigned TRISD2 : 1;
1478 unsigned TRISD3 : 1;
1479 unsigned TRISD4 : 1;
1480 unsigned TRISD5 : 1;
1481 unsigned TRISD6 : 1;
1482 unsigned TRISD7 : 1;
1485 struct
1487 unsigned RD0 : 1;
1488 unsigned RD1 : 1;
1489 unsigned RD2 : 1;
1490 unsigned RD3 : 1;
1491 unsigned RD4 : 1;
1492 unsigned RD5 : 1;
1493 unsigned RD6 : 1;
1494 unsigned RD7 : 1;
1496 } __TRISDbits_t;
1498 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
1500 #define _TRISD_TRISD0 0x01
1501 #define _TRISD_RD0 0x01
1502 #define _TRISD_TRISD1 0x02
1503 #define _TRISD_RD1 0x02
1504 #define _TRISD_TRISD2 0x04
1505 #define _TRISD_RD2 0x04
1506 #define _TRISD_TRISD3 0x08
1507 #define _TRISD_RD3 0x08
1508 #define _TRISD_TRISD4 0x10
1509 #define _TRISD_RD4 0x10
1510 #define _TRISD_TRISD5 0x20
1511 #define _TRISD_RD5 0x20
1512 #define _TRISD_TRISD6 0x40
1513 #define _TRISD_RD6 0x40
1514 #define _TRISD_TRISD7 0x80
1515 #define _TRISD_RD7 0x80
1517 //==============================================================================
1520 //==============================================================================
1521 // DDRE Bits
1523 extern __at(0x0F96) __sfr DDRE;
1525 typedef union
1527 struct
1529 unsigned TRISE0 : 1;
1530 unsigned TRISE1 : 1;
1531 unsigned TRISE2 : 1;
1532 unsigned TRISE3 : 1;
1533 unsigned TRISE4 : 1;
1534 unsigned TRISE5 : 1;
1535 unsigned TRISE6 : 1;
1536 unsigned TRISE7 : 1;
1539 struct
1541 unsigned RE0 : 1;
1542 unsigned RE1 : 1;
1543 unsigned RE2 : 1;
1544 unsigned RE3 : 1;
1545 unsigned RE4 : 1;
1546 unsigned RE5 : 1;
1547 unsigned RE6 : 1;
1548 unsigned RE7 : 1;
1550 } __DDREbits_t;
1552 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
1554 #define _TRISE0 0x01
1555 #define _RE0 0x01
1556 #define _TRISE1 0x02
1557 #define _RE1 0x02
1558 #define _TRISE2 0x04
1559 #define _RE2 0x04
1560 #define _TRISE3 0x08
1561 #define _RE3 0x08
1562 #define _TRISE4 0x10
1563 #define _RE4 0x10
1564 #define _TRISE5 0x20
1565 #define _RE5 0x20
1566 #define _TRISE6 0x40
1567 #define _RE6 0x40
1568 #define _TRISE7 0x80
1569 #define _RE7 0x80
1571 //==============================================================================
1574 //==============================================================================
1575 // TRISE Bits
1577 extern __at(0x0F96) __sfr TRISE;
1579 typedef union
1581 struct
1583 unsigned TRISE0 : 1;
1584 unsigned TRISE1 : 1;
1585 unsigned TRISE2 : 1;
1586 unsigned TRISE3 : 1;
1587 unsigned TRISE4 : 1;
1588 unsigned TRISE5 : 1;
1589 unsigned TRISE6 : 1;
1590 unsigned TRISE7 : 1;
1593 struct
1595 unsigned RE0 : 1;
1596 unsigned RE1 : 1;
1597 unsigned RE2 : 1;
1598 unsigned RE3 : 1;
1599 unsigned RE4 : 1;
1600 unsigned RE5 : 1;
1601 unsigned RE6 : 1;
1602 unsigned RE7 : 1;
1604 } __TRISEbits_t;
1606 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
1608 #define _TRISE_TRISE0 0x01
1609 #define _TRISE_RE0 0x01
1610 #define _TRISE_TRISE1 0x02
1611 #define _TRISE_RE1 0x02
1612 #define _TRISE_TRISE2 0x04
1613 #define _TRISE_RE2 0x04
1614 #define _TRISE_TRISE3 0x08
1615 #define _TRISE_RE3 0x08
1616 #define _TRISE_TRISE4 0x10
1617 #define _TRISE_RE4 0x10
1618 #define _TRISE_TRISE5 0x20
1619 #define _TRISE_RE5 0x20
1620 #define _TRISE_TRISE6 0x40
1621 #define _TRISE_RE6 0x40
1622 #define _TRISE_TRISE7 0x80
1623 #define _TRISE_RE7 0x80
1625 //==============================================================================
1628 //==============================================================================
1629 // DDRF Bits
1631 extern __at(0x0F97) __sfr DDRF;
1633 typedef union
1635 struct
1637 unsigned : 1;
1638 unsigned TRISF1 : 1;
1639 unsigned TRISF2 : 1;
1640 unsigned TRISF3 : 1;
1641 unsigned TRISF4 : 1;
1642 unsigned TRISF5 : 1;
1643 unsigned TRISF6 : 1;
1644 unsigned TRISF7 : 1;
1647 struct
1649 unsigned : 1;
1650 unsigned RF1 : 1;
1651 unsigned RF2 : 1;
1652 unsigned RF3 : 1;
1653 unsigned RF4 : 1;
1654 unsigned RF5 : 1;
1655 unsigned RF6 : 1;
1656 unsigned RF7 : 1;
1658 } __DDRFbits_t;
1660 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
1662 #define _TRISF1 0x02
1663 #define _RF1 0x02
1664 #define _TRISF2 0x04
1665 #define _RF2 0x04
1666 #define _TRISF3 0x08
1667 #define _RF3 0x08
1668 #define _TRISF4 0x10
1669 #define _RF4 0x10
1670 #define _TRISF5 0x20
1671 #define _RF5 0x20
1672 #define _TRISF6 0x40
1673 #define _RF6 0x40
1674 #define _TRISF7 0x80
1675 #define _RF7 0x80
1677 //==============================================================================
1680 //==============================================================================
1681 // TRISF Bits
1683 extern __at(0x0F97) __sfr TRISF;
1685 typedef union
1687 struct
1689 unsigned : 1;
1690 unsigned TRISF1 : 1;
1691 unsigned TRISF2 : 1;
1692 unsigned TRISF3 : 1;
1693 unsigned TRISF4 : 1;
1694 unsigned TRISF5 : 1;
1695 unsigned TRISF6 : 1;
1696 unsigned TRISF7 : 1;
1699 struct
1701 unsigned : 1;
1702 unsigned RF1 : 1;
1703 unsigned RF2 : 1;
1704 unsigned RF3 : 1;
1705 unsigned RF4 : 1;
1706 unsigned RF5 : 1;
1707 unsigned RF6 : 1;
1708 unsigned RF7 : 1;
1710 } __TRISFbits_t;
1712 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
1714 #define _TRISF_TRISF1 0x02
1715 #define _TRISF_RF1 0x02
1716 #define _TRISF_TRISF2 0x04
1717 #define _TRISF_RF2 0x04
1718 #define _TRISF_TRISF3 0x08
1719 #define _TRISF_RF3 0x08
1720 #define _TRISF_TRISF4 0x10
1721 #define _TRISF_RF4 0x10
1722 #define _TRISF_TRISF5 0x20
1723 #define _TRISF_RF5 0x20
1724 #define _TRISF_TRISF6 0x40
1725 #define _TRISF_RF6 0x40
1726 #define _TRISF_TRISF7 0x80
1727 #define _TRISF_RF7 0x80
1729 //==============================================================================
1732 //==============================================================================
1733 // DDRG Bits
1735 extern __at(0x0F98) __sfr DDRG;
1737 typedef union
1739 struct
1741 unsigned TRISG0 : 1;
1742 unsigned TRISG1 : 1;
1743 unsigned TRISG2 : 1;
1744 unsigned TRISG3 : 1;
1745 unsigned TRISG4 : 1;
1746 unsigned CCP1OD : 1;
1747 unsigned CCP2OD : 1;
1748 unsigned SPIOD : 1;
1751 struct
1753 unsigned RG0 : 1;
1754 unsigned RG1 : 1;
1755 unsigned RG2 : 1;
1756 unsigned RG3 : 1;
1757 unsigned RG4 : 1;
1758 unsigned : 1;
1759 unsigned : 1;
1760 unsigned : 1;
1763 struct
1765 unsigned RG : 5;
1766 unsigned : 3;
1769 struct
1771 unsigned TRISG : 5;
1772 unsigned : 3;
1774 } __DDRGbits_t;
1776 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
1778 #define _TRISG0 0x01
1779 #define _RG0 0x01
1780 #define _TRISG1 0x02
1781 #define _RG1 0x02
1782 #define _TRISG2 0x04
1783 #define _RG2 0x04
1784 #define _TRISG3 0x08
1785 #define _RG3 0x08
1786 #define _TRISG4 0x10
1787 #define _RG4 0x10
1788 #define _CCP1OD 0x20
1789 #define _CCP2OD 0x40
1790 #define _SPIOD 0x80
1792 //==============================================================================
1795 //==============================================================================
1796 // TRISG Bits
1798 extern __at(0x0F98) __sfr TRISG;
1800 typedef union
1802 struct
1804 unsigned TRISG0 : 1;
1805 unsigned TRISG1 : 1;
1806 unsigned TRISG2 : 1;
1807 unsigned TRISG3 : 1;
1808 unsigned TRISG4 : 1;
1809 unsigned CCP1OD : 1;
1810 unsigned CCP2OD : 1;
1811 unsigned SPIOD : 1;
1814 struct
1816 unsigned RG0 : 1;
1817 unsigned RG1 : 1;
1818 unsigned RG2 : 1;
1819 unsigned RG3 : 1;
1820 unsigned RG4 : 1;
1821 unsigned : 1;
1822 unsigned : 1;
1823 unsigned : 1;
1826 struct
1828 unsigned TRISG : 5;
1829 unsigned : 3;
1832 struct
1834 unsigned RG : 5;
1835 unsigned : 3;
1837 } __TRISGbits_t;
1839 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
1841 #define _TRISG_TRISG0 0x01
1842 #define _TRISG_RG0 0x01
1843 #define _TRISG_TRISG1 0x02
1844 #define _TRISG_RG1 0x02
1845 #define _TRISG_TRISG2 0x04
1846 #define _TRISG_RG2 0x04
1847 #define _TRISG_TRISG3 0x08
1848 #define _TRISG_RG3 0x08
1849 #define _TRISG_TRISG4 0x10
1850 #define _TRISG_RG4 0x10
1851 #define _TRISG_CCP1OD 0x20
1852 #define _TRISG_CCP2OD 0x40
1853 #define _TRISG_SPIOD 0x80
1855 //==============================================================================
1858 //==============================================================================
1859 // OSCTUNE Bits
1861 extern __at(0x0F9B) __sfr OSCTUNE;
1863 typedef union
1865 struct
1867 unsigned TUN0 : 1;
1868 unsigned TUN1 : 1;
1869 unsigned TUN2 : 1;
1870 unsigned TUN3 : 1;
1871 unsigned TUN4 : 1;
1872 unsigned TUN5 : 1;
1873 unsigned PLLEN : 1;
1874 unsigned INTSRC : 1;
1877 struct
1879 unsigned TUN : 6;
1880 unsigned : 2;
1882 } __OSCTUNEbits_t;
1884 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
1886 #define _TUN0 0x01
1887 #define _TUN1 0x02
1888 #define _TUN2 0x04
1889 #define _TUN3 0x08
1890 #define _TUN4 0x10
1891 #define _TUN5 0x20
1892 #define _PLLEN 0x40
1893 #define _INTSRC 0x80
1895 //==============================================================================
1898 //==============================================================================
1899 // PIE1 Bits
1901 extern __at(0x0F9D) __sfr PIE1;
1903 typedef union
1905 struct
1907 unsigned TMR1IE : 1;
1908 unsigned TMR2IE : 1;
1909 unsigned : 1;
1910 unsigned SSPIE : 1;
1911 unsigned TX1IE : 1;
1912 unsigned RC1IE : 1;
1913 unsigned ADIE : 1;
1914 unsigned PSPIE : 1;
1917 struct
1919 unsigned : 1;
1920 unsigned : 1;
1921 unsigned : 1;
1922 unsigned SSP1IE : 1;
1923 unsigned TXIE : 1;
1924 unsigned RCIE : 1;
1925 unsigned : 1;
1926 unsigned : 1;
1928 } __PIE1bits_t;
1930 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1932 #define _TMR1IE 0x01
1933 #define _TMR2IE 0x02
1934 #define _SSPIE 0x08
1935 #define _SSP1IE 0x08
1936 #define _TX1IE 0x10
1937 #define _TXIE 0x10
1938 #define _RC1IE 0x20
1939 #define _RCIE 0x20
1940 #define _ADIE 0x40
1941 #define _PSPIE 0x80
1943 //==============================================================================
1946 //==============================================================================
1947 // PIR1 Bits
1949 extern __at(0x0F9E) __sfr PIR1;
1951 typedef union
1953 struct
1955 unsigned TMR1IF : 1;
1956 unsigned TMR2IF : 1;
1957 unsigned : 1;
1958 unsigned SSPIF : 1;
1959 unsigned TX1IF : 1;
1960 unsigned RC1IF : 1;
1961 unsigned ADIF : 1;
1962 unsigned PSPIF : 1;
1965 struct
1967 unsigned : 1;
1968 unsigned : 1;
1969 unsigned : 1;
1970 unsigned SSP1IF : 1;
1971 unsigned TXIF : 1;
1972 unsigned RCIF : 1;
1973 unsigned : 1;
1974 unsigned : 1;
1976 } __PIR1bits_t;
1978 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1980 #define _TMR1IF 0x01
1981 #define _TMR2IF 0x02
1982 #define _SSPIF 0x08
1983 #define _SSP1IF 0x08
1984 #define _TX1IF 0x10
1985 #define _TXIF 0x10
1986 #define _RC1IF 0x20
1987 #define _RCIF 0x20
1988 #define _ADIF 0x40
1989 #define _PSPIF 0x80
1991 //==============================================================================
1994 //==============================================================================
1995 // IPR1 Bits
1997 extern __at(0x0F9F) __sfr IPR1;
1999 typedef union
2001 struct
2003 unsigned TMR1IP : 1;
2004 unsigned TMR2IP : 1;
2005 unsigned : 1;
2006 unsigned SSPIP : 1;
2007 unsigned TX1IP : 1;
2008 unsigned RC1IP : 1;
2009 unsigned ADIP : 1;
2010 unsigned PSPIP : 1;
2013 struct
2015 unsigned : 1;
2016 unsigned : 1;
2017 unsigned : 1;
2018 unsigned SSP1IP : 1;
2019 unsigned TXIP : 1;
2020 unsigned RCIP : 1;
2021 unsigned : 1;
2022 unsigned : 1;
2024 } __IPR1bits_t;
2026 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2028 #define _TMR1IP 0x01
2029 #define _TMR2IP 0x02
2030 #define _SSPIP 0x08
2031 #define _SSP1IP 0x08
2032 #define _TX1IP 0x10
2033 #define _TXIP 0x10
2034 #define _RC1IP 0x20
2035 #define _RCIP 0x20
2036 #define _ADIP 0x40
2037 #define _PSPIP 0x80
2039 //==============================================================================
2042 //==============================================================================
2043 // PIE2 Bits
2045 extern __at(0x0FA0) __sfr PIE2;
2047 typedef union
2049 struct
2051 unsigned : 1;
2052 unsigned TMR3IE : 1;
2053 unsigned LVDIE : 1;
2054 unsigned BCLIE : 1;
2055 unsigned : 1;
2056 unsigned : 1;
2057 unsigned CMIE : 1;
2058 unsigned OSCFIE : 1;
2061 struct
2063 unsigned : 1;
2064 unsigned : 1;
2065 unsigned : 1;
2066 unsigned BCL1IE : 1;
2067 unsigned : 1;
2068 unsigned : 1;
2069 unsigned : 1;
2070 unsigned : 1;
2072 } __PIE2bits_t;
2074 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2076 #define _TMR3IE 0x02
2077 #define _LVDIE 0x04
2078 #define _BCLIE 0x08
2079 #define _BCL1IE 0x08
2080 #define _CMIE 0x40
2081 #define _OSCFIE 0x80
2083 //==============================================================================
2086 //==============================================================================
2087 // PIR2 Bits
2089 extern __at(0x0FA1) __sfr PIR2;
2091 typedef union
2093 struct
2095 unsigned : 1;
2096 unsigned TMR3IF : 1;
2097 unsigned LVDIF : 1;
2098 unsigned BCLIF : 1;
2099 unsigned : 1;
2100 unsigned : 1;
2101 unsigned CMIF : 1;
2102 unsigned OSCFIF : 1;
2105 struct
2107 unsigned : 1;
2108 unsigned : 1;
2109 unsigned : 1;
2110 unsigned BCL1IF : 1;
2111 unsigned : 1;
2112 unsigned : 1;
2113 unsigned : 1;
2114 unsigned : 1;
2116 } __PIR2bits_t;
2118 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2120 #define _TMR3IF 0x02
2121 #define _LVDIF 0x04
2122 #define _BCLIF 0x08
2123 #define _BCL1IF 0x08
2124 #define _CMIF 0x40
2125 #define _OSCFIF 0x80
2127 //==============================================================================
2130 //==============================================================================
2131 // IPR2 Bits
2133 extern __at(0x0FA2) __sfr IPR2;
2135 typedef union
2137 struct
2139 unsigned : 1;
2140 unsigned TMR3IP : 1;
2141 unsigned LVDIP : 1;
2142 unsigned BCLIP : 1;
2143 unsigned : 1;
2144 unsigned : 1;
2145 unsigned CMIP : 1;
2146 unsigned OSCFIP : 1;
2149 struct
2151 unsigned : 1;
2152 unsigned : 1;
2153 unsigned : 1;
2154 unsigned BCL1IP : 1;
2155 unsigned : 1;
2156 unsigned : 1;
2157 unsigned : 1;
2158 unsigned : 1;
2160 } __IPR2bits_t;
2162 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
2164 #define _TMR3IP 0x02
2165 #define _LVDIP 0x04
2166 #define _BCLIP 0x08
2167 #define _BCL1IP 0x08
2168 #define _CMIP 0x40
2169 #define _OSCFIP 0x80
2171 //==============================================================================
2174 //==============================================================================
2175 // PIE3 Bits
2177 extern __at(0x0FA3) __sfr PIE3;
2179 typedef struct
2181 unsigned : 1;
2182 unsigned CCP1IE : 1;
2183 unsigned CCP2IE : 1;
2184 unsigned : 1;
2185 unsigned TX2IE : 1;
2186 unsigned RC2IE : 1;
2187 unsigned : 1;
2188 unsigned : 1;
2189 } __PIE3bits_t;
2191 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
2193 #define _CCP1IE 0x02
2194 #define _CCP2IE 0x04
2195 #define _TX2IE 0x10
2196 #define _RC2IE 0x20
2198 //==============================================================================
2201 //==============================================================================
2202 // PIR3 Bits
2204 extern __at(0x0FA4) __sfr PIR3;
2206 typedef struct
2208 unsigned : 1;
2209 unsigned CCP1IF : 1;
2210 unsigned CCP2IF : 1;
2211 unsigned : 1;
2212 unsigned TX2IF : 1;
2213 unsigned RC2IF : 1;
2214 unsigned : 1;
2215 unsigned : 1;
2216 } __PIR3bits_t;
2218 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
2220 #define _CCP1IF 0x02
2221 #define _CCP2IF 0x04
2222 #define _TX2IF 0x10
2223 #define _RC2IF 0x20
2225 //==============================================================================
2228 //==============================================================================
2229 // IPR3 Bits
2231 extern __at(0x0FA5) __sfr IPR3;
2233 typedef struct
2235 unsigned : 1;
2236 unsigned CCP1IP : 1;
2237 unsigned CCP2IP : 1;
2238 unsigned : 1;
2239 unsigned TX2IP : 1;
2240 unsigned RC2IP : 1;
2241 unsigned : 1;
2242 unsigned : 1;
2243 } __IPR3bits_t;
2245 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
2247 #define _CCP1IP 0x02
2248 #define _CCP2IP 0x04
2249 #define _TX2IP 0x10
2250 #define _RC2IP 0x20
2252 //==============================================================================
2255 //==============================================================================
2256 // EECON1 Bits
2258 extern __at(0x0FA6) __sfr EECON1;
2260 typedef struct
2262 unsigned : 1;
2263 unsigned WR : 1;
2264 unsigned WREN : 1;
2265 unsigned WRERR : 1;
2266 unsigned FREE : 1;
2267 unsigned : 1;
2268 unsigned : 1;
2269 unsigned : 1;
2270 } __EECON1bits_t;
2272 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
2274 #define _WR 0x02
2275 #define _WREN 0x04
2276 #define _WRERR 0x08
2277 #define _FREE 0x10
2279 //==============================================================================
2281 extern __at(0x0FA7) __sfr EECON2;
2283 //==============================================================================
2284 // RCSTA Bits
2286 extern __at(0x0FAB) __sfr RCSTA;
2288 typedef union
2290 struct
2292 unsigned RX9D : 1;
2293 unsigned OERR : 1;
2294 unsigned FERR : 1;
2295 unsigned ADDEN : 1;
2296 unsigned CREN : 1;
2297 unsigned SREN : 1;
2298 unsigned RX9 : 1;
2299 unsigned SPEN : 1;
2302 struct
2304 unsigned RCD8 : 1;
2305 unsigned OERR1 : 1;
2306 unsigned FERR1 : 1;
2307 unsigned ADDEN1 : 1;
2308 unsigned CREN1 : 1;
2309 unsigned SREN1 : 1;
2310 unsigned RC9 : 1;
2311 unsigned SPEN1 : 1;
2314 struct
2316 unsigned RX9D1 : 1;
2317 unsigned : 1;
2318 unsigned : 1;
2319 unsigned : 1;
2320 unsigned : 1;
2321 unsigned : 1;
2322 unsigned NOT_RC8 : 1;
2323 unsigned : 1;
2326 struct
2328 unsigned : 1;
2329 unsigned : 1;
2330 unsigned : 1;
2331 unsigned : 1;
2332 unsigned : 1;
2333 unsigned : 1;
2334 unsigned RC8_9 : 1;
2335 unsigned : 1;
2338 struct
2340 unsigned : 1;
2341 unsigned : 1;
2342 unsigned : 1;
2343 unsigned : 1;
2344 unsigned : 1;
2345 unsigned : 1;
2346 unsigned RX91 : 1;
2347 unsigned : 1;
2349 } __RCSTAbits_t;
2351 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
2353 #define _RX9D 0x01
2354 #define _RCD8 0x01
2355 #define _RX9D1 0x01
2356 #define _OERR 0x02
2357 #define _OERR1 0x02
2358 #define _FERR 0x04
2359 #define _FERR1 0x04
2360 #define _ADDEN 0x08
2361 #define _ADDEN1 0x08
2362 #define _CREN 0x10
2363 #define _CREN1 0x10
2364 #define _SREN 0x20
2365 #define _SREN1 0x20
2366 #define _RX9 0x40
2367 #define _RC9 0x40
2368 #define _NOT_RC8 0x40
2369 #define _RC8_9 0x40
2370 #define _RX91 0x40
2371 #define _SPEN 0x80
2372 #define _SPEN1 0x80
2374 //==============================================================================
2377 //==============================================================================
2378 // RCSTA1 Bits
2380 extern __at(0x0FAB) __sfr RCSTA1;
2382 typedef union
2384 struct
2386 unsigned RX9D : 1;
2387 unsigned OERR : 1;
2388 unsigned FERR : 1;
2389 unsigned ADDEN : 1;
2390 unsigned CREN : 1;
2391 unsigned SREN : 1;
2392 unsigned RX9 : 1;
2393 unsigned SPEN : 1;
2396 struct
2398 unsigned RCD8 : 1;
2399 unsigned OERR1 : 1;
2400 unsigned FERR1 : 1;
2401 unsigned ADDEN1 : 1;
2402 unsigned CREN1 : 1;
2403 unsigned SREN1 : 1;
2404 unsigned RC9 : 1;
2405 unsigned SPEN1 : 1;
2408 struct
2410 unsigned RX9D1 : 1;
2411 unsigned : 1;
2412 unsigned : 1;
2413 unsigned : 1;
2414 unsigned : 1;
2415 unsigned : 1;
2416 unsigned NOT_RC8 : 1;
2417 unsigned : 1;
2420 struct
2422 unsigned : 1;
2423 unsigned : 1;
2424 unsigned : 1;
2425 unsigned : 1;
2426 unsigned : 1;
2427 unsigned : 1;
2428 unsigned RC8_9 : 1;
2429 unsigned : 1;
2432 struct
2434 unsigned : 1;
2435 unsigned : 1;
2436 unsigned : 1;
2437 unsigned : 1;
2438 unsigned : 1;
2439 unsigned : 1;
2440 unsigned RX91 : 1;
2441 unsigned : 1;
2443 } __RCSTA1bits_t;
2445 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
2447 #define _RCSTA1_RX9D 0x01
2448 #define _RCSTA1_RCD8 0x01
2449 #define _RCSTA1_RX9D1 0x01
2450 #define _RCSTA1_OERR 0x02
2451 #define _RCSTA1_OERR1 0x02
2452 #define _RCSTA1_FERR 0x04
2453 #define _RCSTA1_FERR1 0x04
2454 #define _RCSTA1_ADDEN 0x08
2455 #define _RCSTA1_ADDEN1 0x08
2456 #define _RCSTA1_CREN 0x10
2457 #define _RCSTA1_CREN1 0x10
2458 #define _RCSTA1_SREN 0x20
2459 #define _RCSTA1_SREN1 0x20
2460 #define _RCSTA1_RX9 0x40
2461 #define _RCSTA1_RC9 0x40
2462 #define _RCSTA1_NOT_RC8 0x40
2463 #define _RCSTA1_RC8_9 0x40
2464 #define _RCSTA1_RX91 0x40
2465 #define _RCSTA1_SPEN 0x80
2466 #define _RCSTA1_SPEN1 0x80
2468 //==============================================================================
2471 //==============================================================================
2472 // TXSTA Bits
2474 extern __at(0x0FAC) __sfr TXSTA;
2476 typedef union
2478 struct
2480 unsigned TX9D : 1;
2481 unsigned TRMT : 1;
2482 unsigned BRGH : 1;
2483 unsigned SENDB : 1;
2484 unsigned SYNC : 1;
2485 unsigned TXEN : 1;
2486 unsigned TX9 : 1;
2487 unsigned CSRC : 1;
2490 struct
2492 unsigned TXD8 : 1;
2493 unsigned TRMT1 : 1;
2494 unsigned BRGH1 : 1;
2495 unsigned SENDB1 : 1;
2496 unsigned SYNC1 : 1;
2497 unsigned TXEN1 : 1;
2498 unsigned TX8_9 : 1;
2499 unsigned CSRC1 : 1;
2502 struct
2504 unsigned TX9D1 : 1;
2505 unsigned : 1;
2506 unsigned : 1;
2507 unsigned : 1;
2508 unsigned : 1;
2509 unsigned : 1;
2510 unsigned NOT_TX8 : 1;
2511 unsigned : 1;
2514 struct
2516 unsigned : 1;
2517 unsigned : 1;
2518 unsigned : 1;
2519 unsigned : 1;
2520 unsigned : 1;
2521 unsigned : 1;
2522 unsigned TX91 : 1;
2523 unsigned : 1;
2525 } __TXSTAbits_t;
2527 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
2529 #define _TX9D 0x01
2530 #define _TXD8 0x01
2531 #define _TX9D1 0x01
2532 #define _TRMT 0x02
2533 #define _TRMT1 0x02
2534 #define _BRGH 0x04
2535 #define _BRGH1 0x04
2536 #define _SENDB 0x08
2537 #define _SENDB1 0x08
2538 #define _SYNC 0x10
2539 #define _SYNC1 0x10
2540 #define _TXEN 0x20
2541 #define _TXEN1 0x20
2542 #define _TX9 0x40
2543 #define _TX8_9 0x40
2544 #define _NOT_TX8 0x40
2545 #define _TX91 0x40
2546 #define _CSRC 0x80
2547 #define _CSRC1 0x80
2549 //==============================================================================
2552 //==============================================================================
2553 // TXSTA1 Bits
2555 extern __at(0x0FAC) __sfr TXSTA1;
2557 typedef union
2559 struct
2561 unsigned TX9D : 1;
2562 unsigned TRMT : 1;
2563 unsigned BRGH : 1;
2564 unsigned SENDB : 1;
2565 unsigned SYNC : 1;
2566 unsigned TXEN : 1;
2567 unsigned TX9 : 1;
2568 unsigned CSRC : 1;
2571 struct
2573 unsigned TXD8 : 1;
2574 unsigned TRMT1 : 1;
2575 unsigned BRGH1 : 1;
2576 unsigned SENDB1 : 1;
2577 unsigned SYNC1 : 1;
2578 unsigned TXEN1 : 1;
2579 unsigned TX8_9 : 1;
2580 unsigned CSRC1 : 1;
2583 struct
2585 unsigned TX9D1 : 1;
2586 unsigned : 1;
2587 unsigned : 1;
2588 unsigned : 1;
2589 unsigned : 1;
2590 unsigned : 1;
2591 unsigned NOT_TX8 : 1;
2592 unsigned : 1;
2595 struct
2597 unsigned : 1;
2598 unsigned : 1;
2599 unsigned : 1;
2600 unsigned : 1;
2601 unsigned : 1;
2602 unsigned : 1;
2603 unsigned TX91 : 1;
2604 unsigned : 1;
2606 } __TXSTA1bits_t;
2608 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
2610 #define _TXSTA1_TX9D 0x01
2611 #define _TXSTA1_TXD8 0x01
2612 #define _TXSTA1_TX9D1 0x01
2613 #define _TXSTA1_TRMT 0x02
2614 #define _TXSTA1_TRMT1 0x02
2615 #define _TXSTA1_BRGH 0x04
2616 #define _TXSTA1_BRGH1 0x04
2617 #define _TXSTA1_SENDB 0x08
2618 #define _TXSTA1_SENDB1 0x08
2619 #define _TXSTA1_SYNC 0x10
2620 #define _TXSTA1_SYNC1 0x10
2621 #define _TXSTA1_TXEN 0x20
2622 #define _TXSTA1_TXEN1 0x20
2623 #define _TXSTA1_TX9 0x40
2624 #define _TXSTA1_TX8_9 0x40
2625 #define _TXSTA1_NOT_TX8 0x40
2626 #define _TXSTA1_TX91 0x40
2627 #define _TXSTA1_CSRC 0x80
2628 #define _TXSTA1_CSRC1 0x80
2630 //==============================================================================
2632 extern __at(0x0FAD) __sfr TXREG;
2633 extern __at(0x0FAD) __sfr TXREG1;
2634 extern __at(0x0FAE) __sfr RCREG;
2635 extern __at(0x0FAE) __sfr RCREG1;
2636 extern __at(0x0FAF) __sfr SPBRG;
2637 extern __at(0x0FAF) __sfr SPBRG1;
2639 //==============================================================================
2640 // PSPCON Bits
2642 extern __at(0x0FB0) __sfr PSPCON;
2644 typedef struct
2646 unsigned : 1;
2647 unsigned : 1;
2648 unsigned : 1;
2649 unsigned : 1;
2650 unsigned PSPMODE : 1;
2651 unsigned IBOV : 1;
2652 unsigned OBF : 1;
2653 unsigned IBF : 1;
2654 } __PSPCONbits_t;
2656 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
2658 #define _PSPMODE 0x10
2659 #define _IBOV 0x20
2660 #define _OBF 0x40
2661 #define _IBF 0x80
2663 //==============================================================================
2666 //==============================================================================
2667 // T3CON Bits
2669 extern __at(0x0FB1) __sfr T3CON;
2671 typedef union
2673 struct
2675 unsigned TMR3ON : 1;
2676 unsigned TMR3CS : 1;
2677 unsigned NOT_T3SYNC : 1;
2678 unsigned T3CCP1 : 1;
2679 unsigned T3CKPS0 : 1;
2680 unsigned T3CKPS1 : 1;
2681 unsigned T3CCP2 : 1;
2682 unsigned RD16 : 1;
2685 struct
2687 unsigned : 1;
2688 unsigned : 1;
2689 unsigned T3SYNC : 1;
2690 unsigned : 1;
2691 unsigned : 1;
2692 unsigned : 1;
2693 unsigned : 1;
2694 unsigned : 1;
2697 struct
2699 unsigned : 1;
2700 unsigned : 1;
2701 unsigned T3INSYNC : 1;
2702 unsigned : 1;
2703 unsigned : 1;
2704 unsigned : 1;
2705 unsigned : 1;
2706 unsigned : 1;
2709 struct
2711 unsigned : 4;
2712 unsigned T3CKPS : 2;
2713 unsigned : 2;
2715 } __T3CONbits_t;
2717 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
2719 #define _T3CON_TMR3ON 0x01
2720 #define _T3CON_TMR3CS 0x02
2721 #define _T3CON_NOT_T3SYNC 0x04
2722 #define _T3CON_T3SYNC 0x04
2723 #define _T3CON_T3INSYNC 0x04
2724 #define _T3CON_T3CCP1 0x08
2725 #define _T3CON_T3CKPS0 0x10
2726 #define _T3CON_T3CKPS1 0x20
2727 #define _T3CON_T3CCP2 0x40
2728 #define _T3CON_RD16 0x80
2730 //==============================================================================
2732 extern __at(0x0FB2) __sfr TMR3;
2733 extern __at(0x0FB2) __sfr TMR3L;
2734 extern __at(0x0FB3) __sfr TMR3H;
2736 //==============================================================================
2737 // CMCON Bits
2739 extern __at(0x0FB4) __sfr CMCON;
2741 typedef union
2743 struct
2745 unsigned CM0 : 1;
2746 unsigned CM1 : 1;
2747 unsigned CM2 : 1;
2748 unsigned CIS : 1;
2749 unsigned C1INV : 1;
2750 unsigned C2INV : 1;
2751 unsigned C1OUT : 1;
2752 unsigned C2OUT : 1;
2755 struct
2757 unsigned CM : 3;
2758 unsigned : 5;
2760 } __CMCONbits_t;
2762 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
2764 #define _CM0 0x01
2765 #define _CM1 0x02
2766 #define _CM2 0x04
2767 #define _CIS 0x08
2768 #define _C1INV 0x10
2769 #define _C2INV 0x20
2770 #define _C1OUT 0x40
2771 #define _C2OUT 0x80
2773 //==============================================================================
2776 //==============================================================================
2777 // CVRCON Bits
2779 extern __at(0x0FB5) __sfr CVRCON;
2781 typedef union
2783 struct
2785 unsigned CVR0 : 1;
2786 unsigned CVR1 : 1;
2787 unsigned CVR2 : 1;
2788 unsigned CVR3 : 1;
2789 unsigned CVRSS : 1;
2790 unsigned CVRR : 1;
2791 unsigned CVROE : 1;
2792 unsigned CVREN : 1;
2795 struct
2797 unsigned CVR : 4;
2798 unsigned : 4;
2800 } __CVRCONbits_t;
2802 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
2804 #define _CVR0 0x01
2805 #define _CVR1 0x02
2806 #define _CVR2 0x04
2807 #define _CVR3 0x08
2808 #define _CVRSS 0x10
2809 #define _CVRR 0x20
2810 #define _CVROE 0x40
2811 #define _CVREN 0x80
2813 //==============================================================================
2816 //==============================================================================
2817 // ADCON2 Bits
2819 extern __at(0x0FC0) __sfr ADCON2;
2821 typedef union
2823 struct
2825 unsigned ADCS0 : 1;
2826 unsigned ADCS1 : 1;
2827 unsigned ADCS2 : 1;
2828 unsigned ACQT0 : 1;
2829 unsigned ACQT1 : 1;
2830 unsigned ACQT2 : 1;
2831 unsigned : 1;
2832 unsigned ADFM : 1;
2835 struct
2837 unsigned ADCS : 3;
2838 unsigned : 5;
2841 struct
2843 unsigned : 3;
2844 unsigned ACQT : 3;
2845 unsigned : 2;
2847 } __ADCON2bits_t;
2849 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
2851 #define _ADCS0 0x01
2852 #define _ADCS1 0x02
2853 #define _ADCS2 0x04
2854 #define _ACQT0 0x08
2855 #define _ACQT1 0x10
2856 #define _ACQT2 0x20
2857 #define _ADFM 0x80
2859 //==============================================================================
2862 //==============================================================================
2863 // ADCON1 Bits
2865 extern __at(0x0FC1) __sfr ADCON1;
2867 typedef union
2869 struct
2871 unsigned PCFG0 : 1;
2872 unsigned PCFG1 : 1;
2873 unsigned PCFG2 : 1;
2874 unsigned PCFG3 : 1;
2875 unsigned VCFG0 : 1;
2876 unsigned VCFG1 : 1;
2877 unsigned : 1;
2878 unsigned : 1;
2881 struct
2883 unsigned PCFG : 4;
2884 unsigned : 4;
2887 struct
2889 unsigned : 4;
2890 unsigned VCFG : 2;
2891 unsigned : 2;
2893 } __ADCON1bits_t;
2895 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
2897 #define _PCFG0 0x01
2898 #define _PCFG1 0x02
2899 #define _PCFG2 0x04
2900 #define _PCFG3 0x08
2901 #define _VCFG0 0x10
2902 #define _VCFG1 0x20
2904 //==============================================================================
2907 //==============================================================================
2908 // ADCON0 Bits
2910 extern __at(0x0FC2) __sfr ADCON0;
2912 typedef union
2914 struct
2916 unsigned ADON : 1;
2917 unsigned GO_NOT_DONE : 1;
2918 unsigned CHS0 : 1;
2919 unsigned CHS1 : 1;
2920 unsigned CHS2 : 1;
2921 unsigned CHS3 : 1;
2922 unsigned : 1;
2923 unsigned ADCAL : 1;
2926 struct
2928 unsigned : 1;
2929 unsigned GO_DONE : 1;
2930 unsigned : 1;
2931 unsigned : 1;
2932 unsigned : 1;
2933 unsigned : 1;
2934 unsigned : 1;
2935 unsigned : 1;
2938 struct
2940 unsigned : 1;
2941 unsigned DONE : 1;
2942 unsigned : 1;
2943 unsigned : 1;
2944 unsigned : 1;
2945 unsigned : 1;
2946 unsigned : 1;
2947 unsigned : 1;
2950 struct
2952 unsigned : 1;
2953 unsigned GO : 1;
2954 unsigned : 1;
2955 unsigned : 1;
2956 unsigned : 1;
2957 unsigned : 1;
2958 unsigned : 1;
2959 unsigned : 1;
2962 struct
2964 unsigned : 1;
2965 unsigned NOT_DONE : 1;
2966 unsigned : 1;
2967 unsigned : 1;
2968 unsigned : 1;
2969 unsigned : 1;
2970 unsigned : 1;
2971 unsigned : 1;
2974 struct
2976 unsigned : 2;
2977 unsigned CHS : 4;
2978 unsigned : 2;
2980 } __ADCON0bits_t;
2982 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
2984 #define _ADON 0x01
2985 #define _GO_NOT_DONE 0x02
2986 #define _GO_DONE 0x02
2987 #define _DONE 0x02
2988 #define _GO 0x02
2989 #define _NOT_DONE 0x02
2990 #define _CHS0 0x04
2991 #define _CHS1 0x08
2992 #define _CHS2 0x10
2993 #define _CHS3 0x20
2994 #define _ADCAL 0x80
2996 //==============================================================================
2998 extern __at(0x0FC3) __sfr ADRES;
2999 extern __at(0x0FC3) __sfr ADRESL;
3000 extern __at(0x0FC4) __sfr ADRESH;
3002 //==============================================================================
3003 // SSP1CON2 Bits
3005 extern __at(0x0FC5) __sfr SSP1CON2;
3007 typedef union
3009 struct
3011 unsigned SEN : 1;
3012 unsigned RSEN : 1;
3013 unsigned PEN : 1;
3014 unsigned RCEN : 1;
3015 unsigned ACKEN : 1;
3016 unsigned ACKDT : 1;
3017 unsigned ACKSTAT : 1;
3018 unsigned GCEN : 1;
3021 struct
3023 unsigned : 1;
3024 unsigned ADMSK1 : 1;
3025 unsigned ADMSK2 : 1;
3026 unsigned ADMSK3 : 1;
3027 unsigned ADMSK4 : 1;
3028 unsigned ADMSK5 : 1;
3029 unsigned : 1;
3030 unsigned : 1;
3032 } __SSP1CON2bits_t;
3034 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
3036 #define _SEN 0x01
3037 #define _RSEN 0x02
3038 #define _ADMSK1 0x02
3039 #define _PEN 0x04
3040 #define _ADMSK2 0x04
3041 #define _RCEN 0x08
3042 #define _ADMSK3 0x08
3043 #define _ACKEN 0x10
3044 #define _ADMSK4 0x10
3045 #define _ACKDT 0x20
3046 #define _ADMSK5 0x20
3047 #define _ACKSTAT 0x40
3048 #define _GCEN 0x80
3050 //==============================================================================
3053 //==============================================================================
3054 // SSPCON2 Bits
3056 extern __at(0x0FC5) __sfr SSPCON2;
3058 typedef union
3060 struct
3062 unsigned SEN : 1;
3063 unsigned RSEN : 1;
3064 unsigned PEN : 1;
3065 unsigned RCEN : 1;
3066 unsigned ACKEN : 1;
3067 unsigned ACKDT : 1;
3068 unsigned ACKSTAT : 1;
3069 unsigned GCEN : 1;
3072 struct
3074 unsigned : 1;
3075 unsigned ADMSK1 : 1;
3076 unsigned ADMSK2 : 1;
3077 unsigned ADMSK3 : 1;
3078 unsigned ADMSK4 : 1;
3079 unsigned ADMSK5 : 1;
3080 unsigned : 1;
3081 unsigned : 1;
3083 } __SSPCON2bits_t;
3085 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
3087 #define _SSPCON2_SEN 0x01
3088 #define _SSPCON2_RSEN 0x02
3089 #define _SSPCON2_ADMSK1 0x02
3090 #define _SSPCON2_PEN 0x04
3091 #define _SSPCON2_ADMSK2 0x04
3092 #define _SSPCON2_RCEN 0x08
3093 #define _SSPCON2_ADMSK3 0x08
3094 #define _SSPCON2_ACKEN 0x10
3095 #define _SSPCON2_ADMSK4 0x10
3096 #define _SSPCON2_ACKDT 0x20
3097 #define _SSPCON2_ADMSK5 0x20
3098 #define _SSPCON2_ACKSTAT 0x40
3099 #define _SSPCON2_GCEN 0x80
3101 //==============================================================================
3104 //==============================================================================
3105 // SSP1CON1 Bits
3107 extern __at(0x0FC6) __sfr SSP1CON1;
3109 typedef union
3111 struct
3113 unsigned SSPM0 : 1;
3114 unsigned SSPM1 : 1;
3115 unsigned SSPM2 : 1;
3116 unsigned SSPM3 : 1;
3117 unsigned CKP : 1;
3118 unsigned SSPEN : 1;
3119 unsigned SSPOV : 1;
3120 unsigned WCOL : 1;
3123 struct
3125 unsigned SSPM : 4;
3126 unsigned : 4;
3128 } __SSP1CON1bits_t;
3130 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
3132 #define _SSPM0 0x01
3133 #define _SSPM1 0x02
3134 #define _SSPM2 0x04
3135 #define _SSPM3 0x08
3136 #define _CKP 0x10
3137 #define _SSPEN 0x20
3138 #define _SSPOV 0x40
3139 #define _WCOL 0x80
3141 //==============================================================================
3144 //==============================================================================
3145 // SSPCON1 Bits
3147 extern __at(0x0FC6) __sfr SSPCON1;
3149 typedef union
3151 struct
3153 unsigned SSPM0 : 1;
3154 unsigned SSPM1 : 1;
3155 unsigned SSPM2 : 1;
3156 unsigned SSPM3 : 1;
3157 unsigned CKP : 1;
3158 unsigned SSPEN : 1;
3159 unsigned SSPOV : 1;
3160 unsigned WCOL : 1;
3163 struct
3165 unsigned SSPM : 4;
3166 unsigned : 4;
3168 } __SSPCON1bits_t;
3170 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
3172 #define _SSPCON1_SSPM0 0x01
3173 #define _SSPCON1_SSPM1 0x02
3174 #define _SSPCON1_SSPM2 0x04
3175 #define _SSPCON1_SSPM3 0x08
3176 #define _SSPCON1_CKP 0x10
3177 #define _SSPCON1_SSPEN 0x20
3178 #define _SSPCON1_SSPOV 0x40
3179 #define _SSPCON1_WCOL 0x80
3181 //==============================================================================
3184 //==============================================================================
3185 // SSP1STAT Bits
3187 extern __at(0x0FC7) __sfr SSP1STAT;
3189 typedef union
3191 struct
3193 unsigned BF : 1;
3194 unsigned UA : 1;
3195 unsigned R_NOT_W : 1;
3196 unsigned S : 1;
3197 unsigned P : 1;
3198 unsigned D_NOT_A : 1;
3199 unsigned CKE : 1;
3200 unsigned SMP : 1;
3203 struct
3205 unsigned : 1;
3206 unsigned : 1;
3207 unsigned R : 1;
3208 unsigned I2C_START : 1;
3209 unsigned I2C_STOP : 1;
3210 unsigned D : 1;
3211 unsigned : 1;
3212 unsigned : 1;
3215 struct
3217 unsigned : 1;
3218 unsigned : 1;
3219 unsigned R_W : 1;
3220 unsigned : 1;
3221 unsigned : 1;
3222 unsigned D_A : 1;
3223 unsigned : 1;
3224 unsigned : 1;
3227 struct
3229 unsigned : 1;
3230 unsigned : 1;
3231 unsigned NOT_W : 1;
3232 unsigned : 1;
3233 unsigned : 1;
3234 unsigned NOT_A : 1;
3235 unsigned : 1;
3236 unsigned : 1;
3239 struct
3241 unsigned : 1;
3242 unsigned : 1;
3243 unsigned NOT_WRITE : 1;
3244 unsigned : 1;
3245 unsigned : 1;
3246 unsigned NOT_ADDRESS : 1;
3247 unsigned : 1;
3248 unsigned : 1;
3251 struct
3253 unsigned : 1;
3254 unsigned : 1;
3255 unsigned READ_WRITE : 1;
3256 unsigned : 1;
3257 unsigned : 1;
3258 unsigned DATA_ADDRESS : 1;
3259 unsigned : 1;
3260 unsigned : 1;
3263 struct
3265 unsigned : 1;
3266 unsigned : 1;
3267 unsigned I2C_READ : 1;
3268 unsigned : 1;
3269 unsigned : 1;
3270 unsigned I2C_DAT : 1;
3271 unsigned : 1;
3272 unsigned : 1;
3274 } __SSP1STATbits_t;
3276 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
3278 #define _BF 0x01
3279 #define _UA 0x02
3280 #define _R_NOT_W 0x04
3281 #define _R 0x04
3282 #define _R_W 0x04
3283 #define _NOT_W 0x04
3284 #define _NOT_WRITE 0x04
3285 #define _READ_WRITE 0x04
3286 #define _I2C_READ 0x04
3287 #define _S 0x08
3288 #define _I2C_START 0x08
3289 #define _P 0x10
3290 #define _I2C_STOP 0x10
3291 #define _D_NOT_A 0x20
3292 #define _D 0x20
3293 #define _D_A 0x20
3294 #define _NOT_A 0x20
3295 #define _NOT_ADDRESS 0x20
3296 #define _DATA_ADDRESS 0x20
3297 #define _I2C_DAT 0x20
3298 #define _CKE 0x40
3299 #define _SMP 0x80
3301 //==============================================================================
3304 //==============================================================================
3305 // SSPSTAT Bits
3307 extern __at(0x0FC7) __sfr SSPSTAT;
3309 typedef union
3311 struct
3313 unsigned BF : 1;
3314 unsigned UA : 1;
3315 unsigned R_NOT_W : 1;
3316 unsigned S : 1;
3317 unsigned P : 1;
3318 unsigned D_NOT_A : 1;
3319 unsigned CKE : 1;
3320 unsigned SMP : 1;
3323 struct
3325 unsigned : 1;
3326 unsigned : 1;
3327 unsigned R : 1;
3328 unsigned I2C_START : 1;
3329 unsigned I2C_STOP : 1;
3330 unsigned D : 1;
3331 unsigned : 1;
3332 unsigned : 1;
3335 struct
3337 unsigned : 1;
3338 unsigned : 1;
3339 unsigned R_W : 1;
3340 unsigned : 1;
3341 unsigned : 1;
3342 unsigned D_A : 1;
3343 unsigned : 1;
3344 unsigned : 1;
3347 struct
3349 unsigned : 1;
3350 unsigned : 1;
3351 unsigned NOT_W : 1;
3352 unsigned : 1;
3353 unsigned : 1;
3354 unsigned NOT_A : 1;
3355 unsigned : 1;
3356 unsigned : 1;
3359 struct
3361 unsigned : 1;
3362 unsigned : 1;
3363 unsigned NOT_WRITE : 1;
3364 unsigned : 1;
3365 unsigned : 1;
3366 unsigned NOT_ADDRESS : 1;
3367 unsigned : 1;
3368 unsigned : 1;
3371 struct
3373 unsigned : 1;
3374 unsigned : 1;
3375 unsigned READ_WRITE : 1;
3376 unsigned : 1;
3377 unsigned : 1;
3378 unsigned DATA_ADDRESS : 1;
3379 unsigned : 1;
3380 unsigned : 1;
3383 struct
3385 unsigned : 1;
3386 unsigned : 1;
3387 unsigned I2C_READ : 1;
3388 unsigned : 1;
3389 unsigned : 1;
3390 unsigned I2C_DAT : 1;
3391 unsigned : 1;
3392 unsigned : 1;
3394 } __SSPSTATbits_t;
3396 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
3398 #define _SSPSTAT_BF 0x01
3399 #define _SSPSTAT_UA 0x02
3400 #define _SSPSTAT_R_NOT_W 0x04
3401 #define _SSPSTAT_R 0x04
3402 #define _SSPSTAT_R_W 0x04
3403 #define _SSPSTAT_NOT_W 0x04
3404 #define _SSPSTAT_NOT_WRITE 0x04
3405 #define _SSPSTAT_READ_WRITE 0x04
3406 #define _SSPSTAT_I2C_READ 0x04
3407 #define _SSPSTAT_S 0x08
3408 #define _SSPSTAT_I2C_START 0x08
3409 #define _SSPSTAT_P 0x10
3410 #define _SSPSTAT_I2C_STOP 0x10
3411 #define _SSPSTAT_D_NOT_A 0x20
3412 #define _SSPSTAT_D 0x20
3413 #define _SSPSTAT_D_A 0x20
3414 #define _SSPSTAT_NOT_A 0x20
3415 #define _SSPSTAT_NOT_ADDRESS 0x20
3416 #define _SSPSTAT_DATA_ADDRESS 0x20
3417 #define _SSPSTAT_I2C_DAT 0x20
3418 #define _SSPSTAT_CKE 0x40
3419 #define _SSPSTAT_SMP 0x80
3421 //==============================================================================
3423 extern __at(0x0FC8) __sfr SSP1ADD;
3424 extern __at(0x0FC8) __sfr SSPADD;
3425 extern __at(0x0FC9) __sfr SSP1BUF;
3426 extern __at(0x0FC9) __sfr SSPBUF;
3428 //==============================================================================
3429 // T2CON Bits
3431 extern __at(0x0FCA) __sfr T2CON;
3433 typedef union
3435 struct
3437 unsigned T2CKPS0 : 1;
3438 unsigned T2CKPS1 : 1;
3439 unsigned TMR2ON : 1;
3440 unsigned T2OUTPS0 : 1;
3441 unsigned T2OUTPS1 : 1;
3442 unsigned T2OUTPS2 : 1;
3443 unsigned T2OUTPS3 : 1;
3444 unsigned : 1;
3447 struct
3449 unsigned T2CKPS : 2;
3450 unsigned : 6;
3453 struct
3455 unsigned : 3;
3456 unsigned T2OUTPS : 4;
3457 unsigned : 1;
3459 } __T2CONbits_t;
3461 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
3463 #define _T2CKPS0 0x01
3464 #define _T2CKPS1 0x02
3465 #define _TMR2ON 0x04
3466 #define _T2OUTPS0 0x08
3467 #define _T2OUTPS1 0x10
3468 #define _T2OUTPS2 0x20
3469 #define _T2OUTPS3 0x40
3471 //==============================================================================
3473 extern __at(0x0FCB) __sfr PR2;
3474 extern __at(0x0FCC) __sfr TMR2;
3476 //==============================================================================
3477 // T1CON Bits
3479 extern __at(0x0FCD) __sfr T1CON;
3481 typedef union
3483 struct
3485 unsigned TMR1ON : 1;
3486 unsigned TMR1CS : 1;
3487 unsigned NOT_T1SYNC : 1;
3488 unsigned T1OSCEN : 1;
3489 unsigned T1CKPS0 : 1;
3490 unsigned T1CKPS1 : 1;
3491 unsigned T1RUN : 1;
3492 unsigned RD16 : 1;
3495 struct
3497 unsigned : 1;
3498 unsigned : 1;
3499 unsigned T1INSYNC : 1;
3500 unsigned : 1;
3501 unsigned : 1;
3502 unsigned : 1;
3503 unsigned : 1;
3504 unsigned : 1;
3507 struct
3509 unsigned : 1;
3510 unsigned : 1;
3511 unsigned T1SYNC : 1;
3512 unsigned : 1;
3513 unsigned : 1;
3514 unsigned : 1;
3515 unsigned : 1;
3516 unsigned : 1;
3519 struct
3521 unsigned : 4;
3522 unsigned T1CKPS : 2;
3523 unsigned : 2;
3525 } __T1CONbits_t;
3527 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
3529 #define _TMR1ON 0x01
3530 #define _TMR1CS 0x02
3531 #define _NOT_T1SYNC 0x04
3532 #define _T1INSYNC 0x04
3533 #define _T1SYNC 0x04
3534 #define _T1OSCEN 0x08
3535 #define _T1CKPS0 0x10
3536 #define _T1CKPS1 0x20
3537 #define _T1RUN 0x40
3538 #define _RD16 0x80
3540 //==============================================================================
3542 extern __at(0x0FCE) __sfr TMR1;
3543 extern __at(0x0FCE) __sfr TMR1L;
3544 extern __at(0x0FCF) __sfr TMR1H;
3546 //==============================================================================
3547 // RCON Bits
3549 extern __at(0x0FD0) __sfr RCON;
3551 typedef union
3553 struct
3555 unsigned NOT_BOR : 1;
3556 unsigned NOT_POR : 1;
3557 unsigned NOT_PD : 1;
3558 unsigned NOT_TO : 1;
3559 unsigned NOT_RI : 1;
3560 unsigned NOT_CM : 1;
3561 unsigned : 1;
3562 unsigned IPEN : 1;
3565 struct
3567 unsigned BOR : 1;
3568 unsigned POR : 1;
3569 unsigned PD : 1;
3570 unsigned TO : 1;
3571 unsigned RI : 1;
3572 unsigned CM : 1;
3573 unsigned : 1;
3574 unsigned : 1;
3576 } __RCONbits_t;
3578 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
3580 #define _NOT_BOR 0x01
3581 #define _BOR 0x01
3582 #define _NOT_POR 0x02
3583 #define _POR 0x02
3584 #define _NOT_PD 0x04
3585 #define _PD 0x04
3586 #define _NOT_TO 0x08
3587 #define _TO 0x08
3588 #define _NOT_RI 0x10
3589 #define _RI 0x10
3590 #define _NOT_CM 0x20
3591 #define _CM 0x20
3592 #define _IPEN 0x80
3594 //==============================================================================
3597 //==============================================================================
3598 // WDTCON Bits
3600 extern __at(0x0FD1) __sfr WDTCON;
3602 typedef union
3604 struct
3606 unsigned SWDTEN : 1;
3607 unsigned : 1;
3608 unsigned : 1;
3609 unsigned : 1;
3610 unsigned : 1;
3611 unsigned : 1;
3612 unsigned : 1;
3613 unsigned REGSLP : 1;
3616 struct
3618 unsigned SWDTE : 1;
3619 unsigned : 1;
3620 unsigned : 1;
3621 unsigned : 1;
3622 unsigned : 1;
3623 unsigned : 1;
3624 unsigned : 1;
3625 unsigned : 1;
3627 } __WDTCONbits_t;
3629 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
3631 #define _SWDTEN 0x01
3632 #define _SWDTE 0x01
3633 #define _REGSLP 0x80
3635 //==============================================================================
3638 //==============================================================================
3639 // OSCCON Bits
3641 extern __at(0x0FD3) __sfr OSCCON;
3643 typedef union
3645 struct
3647 unsigned SCS0 : 1;
3648 unsigned SCS1 : 1;
3649 unsigned IOFS : 1;
3650 unsigned OSTS : 1;
3651 unsigned IRCF0 : 1;
3652 unsigned IRCF1 : 1;
3653 unsigned IRCF2 : 1;
3654 unsigned IDLEN : 1;
3657 struct
3659 unsigned SCS : 2;
3660 unsigned : 6;
3663 struct
3665 unsigned : 4;
3666 unsigned IRCF : 3;
3667 unsigned : 1;
3669 } __OSCCONbits_t;
3671 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
3673 #define _SCS0 0x01
3674 #define _SCS1 0x02
3675 #define _IOFS 0x04
3676 #define _OSTS 0x08
3677 #define _IRCF0 0x10
3678 #define _IRCF1 0x20
3679 #define _IRCF2 0x40
3680 #define _IDLEN 0x80
3682 //==============================================================================
3685 //==============================================================================
3686 // T0CON Bits
3688 extern __at(0x0FD5) __sfr T0CON;
3690 typedef union
3692 struct
3694 unsigned T0PS0 : 1;
3695 unsigned T0PS1 : 1;
3696 unsigned T0PS2 : 1;
3697 unsigned PSA : 1;
3698 unsigned T0SE : 1;
3699 unsigned T0CS : 1;
3700 unsigned T08BIT : 1;
3701 unsigned TMR0ON : 1;
3704 struct
3706 unsigned : 1;
3707 unsigned : 1;
3708 unsigned : 1;
3709 unsigned T0PS3 : 1;
3710 unsigned : 1;
3711 unsigned : 1;
3712 unsigned : 1;
3713 unsigned : 1;
3716 struct
3718 unsigned T0PS : 4;
3719 unsigned : 4;
3721 } __T0CONbits_t;
3723 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
3725 #define _T0PS0 0x01
3726 #define _T0PS1 0x02
3727 #define _T0PS2 0x04
3728 #define _PSA 0x08
3729 #define _T0PS3 0x08
3730 #define _T0SE 0x10
3731 #define _T0CS 0x20
3732 #define _T08BIT 0x40
3733 #define _TMR0ON 0x80
3735 //==============================================================================
3737 extern __at(0x0FD6) __sfr TMR0;
3738 extern __at(0x0FD6) __sfr TMR0L;
3739 extern __at(0x0FD7) __sfr TMR0H;
3741 //==============================================================================
3742 // STATUS Bits
3744 extern __at(0x0FD8) __sfr STATUS;
3746 typedef struct
3748 unsigned C : 1;
3749 unsigned DC : 1;
3750 unsigned Z : 1;
3751 unsigned OV : 1;
3752 unsigned N : 1;
3753 unsigned : 1;
3754 unsigned : 1;
3755 unsigned : 1;
3756 } __STATUSbits_t;
3758 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3760 #define _C 0x01
3761 #define _DC 0x02
3762 #define _Z 0x04
3763 #define _OV 0x08
3764 #define _N 0x10
3766 //==============================================================================
3768 extern __at(0x0FD9) __sfr FSR2L;
3769 extern __at(0x0FDA) __sfr FSR2H;
3770 extern __at(0x0FDB) __sfr PLUSW2;
3771 extern __at(0x0FDC) __sfr PREINC2;
3772 extern __at(0x0FDD) __sfr POSTDEC2;
3773 extern __at(0x0FDE) __sfr POSTINC2;
3774 extern __at(0x0FDF) __sfr INDF2;
3775 extern __at(0x0FE0) __sfr BSR;
3776 extern __at(0x0FE1) __sfr FSR1L;
3777 extern __at(0x0FE2) __sfr FSR1H;
3778 extern __at(0x0FE3) __sfr PLUSW1;
3779 extern __at(0x0FE4) __sfr PREINC1;
3780 extern __at(0x0FE5) __sfr POSTDEC1;
3781 extern __at(0x0FE6) __sfr POSTINC1;
3782 extern __at(0x0FE7) __sfr INDF1;
3783 extern __at(0x0FE8) __sfr WREG;
3784 extern __at(0x0FE9) __sfr FSR0L;
3785 extern __at(0x0FEA) __sfr FSR0H;
3786 extern __at(0x0FEB) __sfr PLUSW0;
3787 extern __at(0x0FEC) __sfr PREINC0;
3788 extern __at(0x0FED) __sfr POSTDEC0;
3789 extern __at(0x0FEE) __sfr POSTINC0;
3790 extern __at(0x0FEF) __sfr INDF0;
3792 //==============================================================================
3793 // INTCON3 Bits
3795 extern __at(0x0FF0) __sfr INTCON3;
3797 typedef union
3799 struct
3801 unsigned INT1IF : 1;
3802 unsigned INT2IF : 1;
3803 unsigned INT3IF : 1;
3804 unsigned INT1IE : 1;
3805 unsigned INT2IE : 1;
3806 unsigned INT3IE : 1;
3807 unsigned INT1IP : 1;
3808 unsigned INT2IP : 1;
3811 struct
3813 unsigned INT1F : 1;
3814 unsigned INT2F : 1;
3815 unsigned INT3F : 1;
3816 unsigned INT1E : 1;
3817 unsigned INT2E : 1;
3818 unsigned INT3E : 1;
3819 unsigned INT1P : 1;
3820 unsigned INT2P : 1;
3822 } __INTCON3bits_t;
3824 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3826 #define _INT1IF 0x01
3827 #define _INT1F 0x01
3828 #define _INT2IF 0x02
3829 #define _INT2F 0x02
3830 #define _INT3IF 0x04
3831 #define _INT3F 0x04
3832 #define _INT1IE 0x08
3833 #define _INT1E 0x08
3834 #define _INT2IE 0x10
3835 #define _INT2E 0x10
3836 #define _INT3IE 0x20
3837 #define _INT3E 0x20
3838 #define _INT1IP 0x40
3839 #define _INT1P 0x40
3840 #define _INT2IP 0x80
3841 #define _INT2P 0x80
3843 //==============================================================================
3846 //==============================================================================
3847 // INTCON2 Bits
3849 extern __at(0x0FF1) __sfr INTCON2;
3851 typedef union
3853 struct
3855 unsigned RBIP : 1;
3856 unsigned INT3IP : 1;
3857 unsigned TMR0IP : 1;
3858 unsigned INTEDG3 : 1;
3859 unsigned INTEDG2 : 1;
3860 unsigned INTEDG1 : 1;
3861 unsigned INTEDG0 : 1;
3862 unsigned NOT_RBPU : 1;
3865 struct
3867 unsigned : 1;
3868 unsigned INT3P : 1;
3869 unsigned T0IP : 1;
3870 unsigned : 1;
3871 unsigned : 1;
3872 unsigned : 1;
3873 unsigned : 1;
3874 unsigned RBPU : 1;
3876 } __INTCON2bits_t;
3878 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3880 #define _RBIP 0x01
3881 #define _INT3IP 0x02
3882 #define _INT3P 0x02
3883 #define _TMR0IP 0x04
3884 #define _T0IP 0x04
3885 #define _INTEDG3 0x08
3886 #define _INTEDG2 0x10
3887 #define _INTEDG1 0x20
3888 #define _INTEDG0 0x40
3889 #define _NOT_RBPU 0x80
3890 #define _RBPU 0x80
3892 //==============================================================================
3895 //==============================================================================
3896 // INTCON Bits
3898 extern __at(0x0FF2) __sfr INTCON;
3900 typedef union
3902 struct
3904 unsigned RBIF : 1;
3905 unsigned INT0IF : 1;
3906 unsigned TMR0IF : 1;
3907 unsigned RBIE : 1;
3908 unsigned INT0IE : 1;
3909 unsigned TMR0IE : 1;
3910 unsigned PEIE_GIEL : 1;
3911 unsigned GIE_GIEH : 1;
3914 struct
3916 unsigned : 1;
3917 unsigned INT0F : 1;
3918 unsigned T0IF : 1;
3919 unsigned : 1;
3920 unsigned INT0E : 1;
3921 unsigned T0IE : 1;
3922 unsigned PEIE : 1;
3923 unsigned GIE : 1;
3926 struct
3928 unsigned : 1;
3929 unsigned : 1;
3930 unsigned : 1;
3931 unsigned : 1;
3932 unsigned : 1;
3933 unsigned : 1;
3934 unsigned GIEL : 1;
3935 unsigned GIEH : 1;
3937 } __INTCONbits_t;
3939 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3941 #define _RBIF 0x01
3942 #define _INT0IF 0x02
3943 #define _INT0F 0x02
3944 #define _TMR0IF 0x04
3945 #define _T0IF 0x04
3946 #define _RBIE 0x08
3947 #define _INT0IE 0x10
3948 #define _INT0E 0x10
3949 #define _TMR0IE 0x20
3950 #define _T0IE 0x20
3951 #define _PEIE_GIEL 0x40
3952 #define _PEIE 0x40
3953 #define _GIEL 0x40
3954 #define _GIE_GIEH 0x80
3955 #define _GIE 0x80
3956 #define _GIEH 0x80
3958 //==============================================================================
3960 extern __at(0x0FF3) __sfr PROD;
3961 extern __at(0x0FF3) __sfr PRODL;
3962 extern __at(0x0FF4) __sfr PRODH;
3963 extern __at(0x0FF5) __sfr TABLAT;
3964 extern __at(0x0FF6) __sfr TBLPTR;
3965 extern __at(0x0FF6) __sfr TBLPTRL;
3966 extern __at(0x0FF7) __sfr TBLPTRH;
3967 extern __at(0x0FF8) __sfr TBLPTRU;
3968 extern __at(0x0FF9) __sfr PC;
3969 extern __at(0x0FF9) __sfr PCL;
3970 extern __at(0x0FFA) __sfr PCLATH;
3971 extern __at(0x0FFB) __sfr PCLATU;
3973 //==============================================================================
3974 // STKPTR Bits
3976 extern __at(0x0FFC) __sfr STKPTR;
3978 typedef union
3980 struct
3982 unsigned SP0 : 1;
3983 unsigned SP1 : 1;
3984 unsigned SP2 : 1;
3985 unsigned SP3 : 1;
3986 unsigned SP4 : 1;
3987 unsigned : 1;
3988 unsigned STKUNF : 1;
3989 unsigned STKFUL : 1;
3992 struct
3994 unsigned STKPTR0 : 1;
3995 unsigned STKPTR1 : 1;
3996 unsigned STKPTR2 : 1;
3997 unsigned STKPTR3 : 1;
3998 unsigned STKPTR4 : 1;
3999 unsigned : 1;
4000 unsigned : 1;
4001 unsigned STKOVF : 1;
4004 struct
4006 unsigned SP : 5;
4007 unsigned : 3;
4010 struct
4012 unsigned STKPTR : 5;
4013 unsigned : 3;
4015 } __STKPTRbits_t;
4017 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
4019 #define _SP0 0x01
4020 #define _STKPTR0 0x01
4021 #define _SP1 0x02
4022 #define _STKPTR1 0x02
4023 #define _SP2 0x04
4024 #define _STKPTR2 0x04
4025 #define _SP3 0x08
4026 #define _STKPTR3 0x08
4027 #define _SP4 0x10
4028 #define _STKPTR4 0x10
4029 #define _STKUNF 0x40
4030 #define _STKFUL 0x80
4031 #define _STKOVF 0x80
4033 //==============================================================================
4035 extern __at(0x0FFD) __sfr TOS;
4036 extern __at(0x0FFD) __sfr TOSL;
4037 extern __at(0x0FFE) __sfr TOSH;
4038 extern __at(0x0FFF) __sfr TOSU;
4040 //==============================================================================
4042 // Configuration Addresses
4044 //==============================================================================
4046 #define __CONFIG1L 0x003FF8
4047 #define __CONFIG1H 0x003FF9
4048 #define __CONFIG2L 0x003FFA
4049 #define __CONFIG2H 0x003FFB
4050 #define __CONFIG3L 0x003FFC
4051 #define __CONFIG3H 0x003FFD
4053 //==============================================================================
4055 #endif // #ifndef __PIC18F64J11_H__