Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f63j11.h
blob517cb3b3d8162496297372219378933189f08582
1 /*
2 * This declarations of the PIC18F63J11 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 __PIC18F63J11_H__
26 #define __PIC18F63J11_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;
2635 //==============================================================================
2636 // RCREG Bits
2638 extern __at(0x0FAE) __sfr RCREG;
2640 typedef union
2642 struct
2644 unsigned NOT_BOR : 1;
2645 unsigned NOT_POR : 1;
2646 unsigned NOT_PD : 1;
2647 unsigned NOT_TO : 1;
2648 unsigned NOT_RI : 1;
2649 unsigned NOT_CM : 1;
2650 unsigned : 1;
2651 unsigned IPEN : 1;
2654 struct
2656 unsigned BOR : 1;
2657 unsigned POR : 1;
2658 unsigned PD : 1;
2659 unsigned TO : 1;
2660 unsigned RI : 1;
2661 unsigned CM : 1;
2662 unsigned : 1;
2663 unsigned : 1;
2665 } __RCREGbits_t;
2667 extern __at(0x0FAE) volatile __RCREGbits_t RCREGbits;
2669 #define _RCREG_NOT_BOR 0x01
2670 #define _RCREG_BOR 0x01
2671 #define _RCREG_NOT_POR 0x02
2672 #define _RCREG_POR 0x02
2673 #define _RCREG_NOT_PD 0x04
2674 #define _RCREG_PD 0x04
2675 #define _RCREG_NOT_TO 0x08
2676 #define _RCREG_TO 0x08
2677 #define _RCREG_NOT_RI 0x10
2678 #define _RCREG_RI 0x10
2679 #define _RCREG_NOT_CM 0x20
2680 #define _RCREG_CM 0x20
2681 #define _RCREG_IPEN 0x80
2683 //==============================================================================
2685 extern __at(0x0FAE) __sfr RCREG1;
2686 extern __at(0x0FAF) __sfr SPBRG;
2687 extern __at(0x0FAF) __sfr SPBRG1;
2689 //==============================================================================
2690 // PSPCON Bits
2692 extern __at(0x0FB0) __sfr PSPCON;
2694 typedef struct
2696 unsigned : 1;
2697 unsigned : 1;
2698 unsigned : 1;
2699 unsigned : 1;
2700 unsigned PSPMODE : 1;
2701 unsigned IBOV : 1;
2702 unsigned OBF : 1;
2703 unsigned IBF : 1;
2704 } __PSPCONbits_t;
2706 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
2708 #define _PSPMODE 0x10
2709 #define _IBOV 0x20
2710 #define _OBF 0x40
2711 #define _IBF 0x80
2713 //==============================================================================
2716 //==============================================================================
2717 // T3CON Bits
2719 extern __at(0x0FB1) __sfr T3CON;
2721 typedef union
2723 struct
2725 unsigned TMR3ON : 1;
2726 unsigned TMR3CS : 1;
2727 unsigned NOT_T3SYNC : 1;
2728 unsigned T3CCP1 : 1;
2729 unsigned T3CKPS0 : 1;
2730 unsigned T3CKPS1 : 1;
2731 unsigned T3CCP2 : 1;
2732 unsigned RD16 : 1;
2735 struct
2737 unsigned : 1;
2738 unsigned : 1;
2739 unsigned T3SYNC : 1;
2740 unsigned : 1;
2741 unsigned : 1;
2742 unsigned : 1;
2743 unsigned : 1;
2744 unsigned : 1;
2747 struct
2749 unsigned : 1;
2750 unsigned : 1;
2751 unsigned T3INSYNC : 1;
2752 unsigned : 1;
2753 unsigned : 1;
2754 unsigned : 1;
2755 unsigned : 1;
2756 unsigned : 1;
2759 struct
2761 unsigned : 4;
2762 unsigned T3CKPS : 2;
2763 unsigned : 2;
2765 } __T3CONbits_t;
2767 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
2769 #define _T3CON_TMR3ON 0x01
2770 #define _T3CON_TMR3CS 0x02
2771 #define _T3CON_NOT_T3SYNC 0x04
2772 #define _T3CON_T3SYNC 0x04
2773 #define _T3CON_T3INSYNC 0x04
2774 #define _T3CON_T3CCP1 0x08
2775 #define _T3CON_T3CKPS0 0x10
2776 #define _T3CON_T3CKPS1 0x20
2777 #define _T3CON_T3CCP2 0x40
2778 #define _T3CON_RD16 0x80
2780 //==============================================================================
2782 extern __at(0x0FB2) __sfr TMR3;
2783 extern __at(0x0FB2) __sfr TMR3L;
2784 extern __at(0x0FB3) __sfr TMR3H;
2786 //==============================================================================
2787 // CMCON Bits
2789 extern __at(0x0FB4) __sfr CMCON;
2791 typedef union
2793 struct
2795 unsigned CM0 : 1;
2796 unsigned CM1 : 1;
2797 unsigned CM2 : 1;
2798 unsigned CIS : 1;
2799 unsigned C1INV : 1;
2800 unsigned C2INV : 1;
2801 unsigned C1OUT : 1;
2802 unsigned C2OUT : 1;
2805 struct
2807 unsigned CM : 3;
2808 unsigned : 5;
2810 } __CMCONbits_t;
2812 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
2814 #define _CM0 0x01
2815 #define _CM1 0x02
2816 #define _CM2 0x04
2817 #define _CIS 0x08
2818 #define _C1INV 0x10
2819 #define _C2INV 0x20
2820 #define _C1OUT 0x40
2821 #define _C2OUT 0x80
2823 //==============================================================================
2826 //==============================================================================
2827 // CVRCON Bits
2829 extern __at(0x0FB5) __sfr CVRCON;
2831 typedef union
2833 struct
2835 unsigned CVR0 : 1;
2836 unsigned CVR1 : 1;
2837 unsigned CVR2 : 1;
2838 unsigned CVR3 : 1;
2839 unsigned CVRSS : 1;
2840 unsigned CVRR : 1;
2841 unsigned CVROE : 1;
2842 unsigned CVREN : 1;
2845 struct
2847 unsigned CVR : 4;
2848 unsigned : 4;
2850 } __CVRCONbits_t;
2852 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
2854 #define _CVR0 0x01
2855 #define _CVR1 0x02
2856 #define _CVR2 0x04
2857 #define _CVR3 0x08
2858 #define _CVRSS 0x10
2859 #define _CVRR 0x20
2860 #define _CVROE 0x40
2861 #define _CVREN 0x80
2863 //==============================================================================
2866 //==============================================================================
2867 // ADCON2 Bits
2869 extern __at(0x0FC0) __sfr ADCON2;
2871 typedef union
2873 struct
2875 unsigned ADCS0 : 1;
2876 unsigned ADCS1 : 1;
2877 unsigned ADCS2 : 1;
2878 unsigned ACQT0 : 1;
2879 unsigned ACQT1 : 1;
2880 unsigned ACQT2 : 1;
2881 unsigned : 1;
2882 unsigned ADFM : 1;
2885 struct
2887 unsigned ADCS : 3;
2888 unsigned : 5;
2891 struct
2893 unsigned : 3;
2894 unsigned ACQT : 3;
2895 unsigned : 2;
2897 } __ADCON2bits_t;
2899 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
2901 #define _ADCS0 0x01
2902 #define _ADCS1 0x02
2903 #define _ADCS2 0x04
2904 #define _ACQT0 0x08
2905 #define _ACQT1 0x10
2906 #define _ACQT2 0x20
2907 #define _ADFM 0x80
2909 //==============================================================================
2912 //==============================================================================
2913 // ADCON1 Bits
2915 extern __at(0x0FC1) __sfr ADCON1;
2917 typedef union
2919 struct
2921 unsigned PCFG0 : 1;
2922 unsigned PCFG1 : 1;
2923 unsigned PCFG2 : 1;
2924 unsigned PCFG3 : 1;
2925 unsigned VCFG0 : 1;
2926 unsigned VCFG1 : 1;
2927 unsigned : 1;
2928 unsigned : 1;
2931 struct
2933 unsigned PCFG : 4;
2934 unsigned : 4;
2937 struct
2939 unsigned : 4;
2940 unsigned VCFG : 2;
2941 unsigned : 2;
2943 } __ADCON1bits_t;
2945 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
2947 #define _PCFG0 0x01
2948 #define _PCFG1 0x02
2949 #define _PCFG2 0x04
2950 #define _PCFG3 0x08
2951 #define _VCFG0 0x10
2952 #define _VCFG1 0x20
2954 //==============================================================================
2957 //==============================================================================
2958 // ADCON0 Bits
2960 extern __at(0x0FC2) __sfr ADCON0;
2962 typedef union
2964 struct
2966 unsigned ADON : 1;
2967 unsigned GO_NOT_DONE : 1;
2968 unsigned CHS0 : 1;
2969 unsigned CHS1 : 1;
2970 unsigned CHS2 : 1;
2971 unsigned CHS3 : 1;
2972 unsigned : 1;
2973 unsigned ADCAL : 1;
2976 struct
2978 unsigned : 1;
2979 unsigned GO_DONE : 1;
2980 unsigned : 1;
2981 unsigned : 1;
2982 unsigned : 1;
2983 unsigned : 1;
2984 unsigned : 1;
2985 unsigned : 1;
2988 struct
2990 unsigned : 1;
2991 unsigned DONE : 1;
2992 unsigned : 1;
2993 unsigned : 1;
2994 unsigned : 1;
2995 unsigned : 1;
2996 unsigned : 1;
2997 unsigned : 1;
3000 struct
3002 unsigned : 1;
3003 unsigned GO : 1;
3004 unsigned : 1;
3005 unsigned : 1;
3006 unsigned : 1;
3007 unsigned : 1;
3008 unsigned : 1;
3009 unsigned : 1;
3012 struct
3014 unsigned : 1;
3015 unsigned NOT_DONE : 1;
3016 unsigned : 1;
3017 unsigned : 1;
3018 unsigned : 1;
3019 unsigned : 1;
3020 unsigned : 1;
3021 unsigned : 1;
3024 struct
3026 unsigned : 2;
3027 unsigned CHS : 4;
3028 unsigned : 2;
3030 } __ADCON0bits_t;
3032 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
3034 #define _ADON 0x01
3035 #define _GO_NOT_DONE 0x02
3036 #define _GO_DONE 0x02
3037 #define _DONE 0x02
3038 #define _GO 0x02
3039 #define _NOT_DONE 0x02
3040 #define _CHS0 0x04
3041 #define _CHS1 0x08
3042 #define _CHS2 0x10
3043 #define _CHS3 0x20
3044 #define _ADCAL 0x80
3046 //==============================================================================
3048 extern __at(0x0FC3) __sfr ADRES;
3049 extern __at(0x0FC3) __sfr ADRESL;
3050 extern __at(0x0FC4) __sfr ADRESH;
3052 //==============================================================================
3053 // SSP1CON2 Bits
3055 extern __at(0x0FC5) __sfr SSP1CON2;
3057 typedef union
3059 struct
3061 unsigned SEN : 1;
3062 unsigned RSEN : 1;
3063 unsigned PEN : 1;
3064 unsigned RCEN : 1;
3065 unsigned ACKEN : 1;
3066 unsigned ACKDT : 1;
3067 unsigned ACKSTAT : 1;
3068 unsigned GCEN : 1;
3071 struct
3073 unsigned : 1;
3074 unsigned ADMSK1 : 1;
3075 unsigned ADMSK2 : 1;
3076 unsigned ADMSK3 : 1;
3077 unsigned ADMSK4 : 1;
3078 unsigned ADMSK5 : 1;
3079 unsigned : 1;
3080 unsigned : 1;
3082 } __SSP1CON2bits_t;
3084 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
3086 #define _SEN 0x01
3087 #define _RSEN 0x02
3088 #define _ADMSK1 0x02
3089 #define _PEN 0x04
3090 #define _ADMSK2 0x04
3091 #define _RCEN 0x08
3092 #define _ADMSK3 0x08
3093 #define _ACKEN 0x10
3094 #define _ADMSK4 0x10
3095 #define _ACKDT 0x20
3096 #define _ADMSK5 0x20
3097 #define _ACKSTAT 0x40
3098 #define _GCEN 0x80
3100 //==============================================================================
3103 //==============================================================================
3104 // SSPCON2 Bits
3106 extern __at(0x0FC5) __sfr SSPCON2;
3108 typedef union
3110 struct
3112 unsigned SEN : 1;
3113 unsigned RSEN : 1;
3114 unsigned PEN : 1;
3115 unsigned RCEN : 1;
3116 unsigned ACKEN : 1;
3117 unsigned ACKDT : 1;
3118 unsigned ACKSTAT : 1;
3119 unsigned GCEN : 1;
3122 struct
3124 unsigned : 1;
3125 unsigned ADMSK1 : 1;
3126 unsigned ADMSK2 : 1;
3127 unsigned ADMSK3 : 1;
3128 unsigned ADMSK4 : 1;
3129 unsigned ADMSK5 : 1;
3130 unsigned : 1;
3131 unsigned : 1;
3133 } __SSPCON2bits_t;
3135 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
3137 #define _SSPCON2_SEN 0x01
3138 #define _SSPCON2_RSEN 0x02
3139 #define _SSPCON2_ADMSK1 0x02
3140 #define _SSPCON2_PEN 0x04
3141 #define _SSPCON2_ADMSK2 0x04
3142 #define _SSPCON2_RCEN 0x08
3143 #define _SSPCON2_ADMSK3 0x08
3144 #define _SSPCON2_ACKEN 0x10
3145 #define _SSPCON2_ADMSK4 0x10
3146 #define _SSPCON2_ACKDT 0x20
3147 #define _SSPCON2_ADMSK5 0x20
3148 #define _SSPCON2_ACKSTAT 0x40
3149 #define _SSPCON2_GCEN 0x80
3151 //==============================================================================
3154 //==============================================================================
3155 // SSP1CON1 Bits
3157 extern __at(0x0FC6) __sfr SSP1CON1;
3159 typedef union
3161 struct
3163 unsigned SSPM0 : 1;
3164 unsigned SSPM1 : 1;
3165 unsigned SSPM2 : 1;
3166 unsigned SSPM3 : 1;
3167 unsigned CKP : 1;
3168 unsigned SSPEN : 1;
3169 unsigned SSPOV : 1;
3170 unsigned WCOL : 1;
3173 struct
3175 unsigned SSPM : 4;
3176 unsigned : 4;
3178 } __SSP1CON1bits_t;
3180 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
3182 #define _SSPM0 0x01
3183 #define _SSPM1 0x02
3184 #define _SSPM2 0x04
3185 #define _SSPM3 0x08
3186 #define _CKP 0x10
3187 #define _SSPEN 0x20
3188 #define _SSPOV 0x40
3189 #define _WCOL 0x80
3191 //==============================================================================
3194 //==============================================================================
3195 // SSPCON1 Bits
3197 extern __at(0x0FC6) __sfr SSPCON1;
3199 typedef union
3201 struct
3203 unsigned SSPM0 : 1;
3204 unsigned SSPM1 : 1;
3205 unsigned SSPM2 : 1;
3206 unsigned SSPM3 : 1;
3207 unsigned CKP : 1;
3208 unsigned SSPEN : 1;
3209 unsigned SSPOV : 1;
3210 unsigned WCOL : 1;
3213 struct
3215 unsigned SSPM : 4;
3216 unsigned : 4;
3218 } __SSPCON1bits_t;
3220 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
3222 #define _SSPCON1_SSPM0 0x01
3223 #define _SSPCON1_SSPM1 0x02
3224 #define _SSPCON1_SSPM2 0x04
3225 #define _SSPCON1_SSPM3 0x08
3226 #define _SSPCON1_CKP 0x10
3227 #define _SSPCON1_SSPEN 0x20
3228 #define _SSPCON1_SSPOV 0x40
3229 #define _SSPCON1_WCOL 0x80
3231 //==============================================================================
3234 //==============================================================================
3235 // SSP1STAT Bits
3237 extern __at(0x0FC7) __sfr SSP1STAT;
3239 typedef union
3241 struct
3243 unsigned BF : 1;
3244 unsigned UA : 1;
3245 unsigned R_NOT_W : 1;
3246 unsigned S : 1;
3247 unsigned P : 1;
3248 unsigned D_NOT_A : 1;
3249 unsigned CKE : 1;
3250 unsigned SMP : 1;
3253 struct
3255 unsigned : 1;
3256 unsigned : 1;
3257 unsigned R : 1;
3258 unsigned I2C_START : 1;
3259 unsigned I2C_STOP : 1;
3260 unsigned D : 1;
3261 unsigned : 1;
3262 unsigned : 1;
3265 struct
3267 unsigned : 1;
3268 unsigned : 1;
3269 unsigned R_W : 1;
3270 unsigned : 1;
3271 unsigned : 1;
3272 unsigned D_A : 1;
3273 unsigned : 1;
3274 unsigned : 1;
3277 struct
3279 unsigned : 1;
3280 unsigned : 1;
3281 unsigned NOT_W : 1;
3282 unsigned : 1;
3283 unsigned : 1;
3284 unsigned NOT_A : 1;
3285 unsigned : 1;
3286 unsigned : 1;
3289 struct
3291 unsigned : 1;
3292 unsigned : 1;
3293 unsigned NOT_WRITE : 1;
3294 unsigned : 1;
3295 unsigned : 1;
3296 unsigned NOT_ADDRESS : 1;
3297 unsigned : 1;
3298 unsigned : 1;
3301 struct
3303 unsigned : 1;
3304 unsigned : 1;
3305 unsigned READ_WRITE : 1;
3306 unsigned : 1;
3307 unsigned : 1;
3308 unsigned DATA_ADDRESS : 1;
3309 unsigned : 1;
3310 unsigned : 1;
3313 struct
3315 unsigned : 1;
3316 unsigned : 1;
3317 unsigned I2C_READ : 1;
3318 unsigned : 1;
3319 unsigned : 1;
3320 unsigned I2C_DAT : 1;
3321 unsigned : 1;
3322 unsigned : 1;
3324 } __SSP1STATbits_t;
3326 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
3328 #define _BF 0x01
3329 #define _UA 0x02
3330 #define _R_NOT_W 0x04
3331 #define _R 0x04
3332 #define _R_W 0x04
3333 #define _NOT_W 0x04
3334 #define _NOT_WRITE 0x04
3335 #define _READ_WRITE 0x04
3336 #define _I2C_READ 0x04
3337 #define _S 0x08
3338 #define _I2C_START 0x08
3339 #define _P 0x10
3340 #define _I2C_STOP 0x10
3341 #define _D_NOT_A 0x20
3342 #define _D 0x20
3343 #define _D_A 0x20
3344 #define _NOT_A 0x20
3345 #define _NOT_ADDRESS 0x20
3346 #define _DATA_ADDRESS 0x20
3347 #define _I2C_DAT 0x20
3348 #define _CKE 0x40
3349 #define _SMP 0x80
3351 //==============================================================================
3354 //==============================================================================
3355 // SSPSTAT Bits
3357 extern __at(0x0FC7) __sfr SSPSTAT;
3359 typedef union
3361 struct
3363 unsigned BF : 1;
3364 unsigned UA : 1;
3365 unsigned R_NOT_W : 1;
3366 unsigned S : 1;
3367 unsigned P : 1;
3368 unsigned D_NOT_A : 1;
3369 unsigned CKE : 1;
3370 unsigned SMP : 1;
3373 struct
3375 unsigned : 1;
3376 unsigned : 1;
3377 unsigned R : 1;
3378 unsigned I2C_START : 1;
3379 unsigned I2C_STOP : 1;
3380 unsigned D : 1;
3381 unsigned : 1;
3382 unsigned : 1;
3385 struct
3387 unsigned : 1;
3388 unsigned : 1;
3389 unsigned R_W : 1;
3390 unsigned : 1;
3391 unsigned : 1;
3392 unsigned D_A : 1;
3393 unsigned : 1;
3394 unsigned : 1;
3397 struct
3399 unsigned : 1;
3400 unsigned : 1;
3401 unsigned NOT_W : 1;
3402 unsigned : 1;
3403 unsigned : 1;
3404 unsigned NOT_A : 1;
3405 unsigned : 1;
3406 unsigned : 1;
3409 struct
3411 unsigned : 1;
3412 unsigned : 1;
3413 unsigned NOT_WRITE : 1;
3414 unsigned : 1;
3415 unsigned : 1;
3416 unsigned NOT_ADDRESS : 1;
3417 unsigned : 1;
3418 unsigned : 1;
3421 struct
3423 unsigned : 1;
3424 unsigned : 1;
3425 unsigned READ_WRITE : 1;
3426 unsigned : 1;
3427 unsigned : 1;
3428 unsigned DATA_ADDRESS : 1;
3429 unsigned : 1;
3430 unsigned : 1;
3433 struct
3435 unsigned : 1;
3436 unsigned : 1;
3437 unsigned I2C_READ : 1;
3438 unsigned : 1;
3439 unsigned : 1;
3440 unsigned I2C_DAT : 1;
3441 unsigned : 1;
3442 unsigned : 1;
3444 } __SSPSTATbits_t;
3446 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
3448 #define _SSPSTAT_BF 0x01
3449 #define _SSPSTAT_UA 0x02
3450 #define _SSPSTAT_R_NOT_W 0x04
3451 #define _SSPSTAT_R 0x04
3452 #define _SSPSTAT_R_W 0x04
3453 #define _SSPSTAT_NOT_W 0x04
3454 #define _SSPSTAT_NOT_WRITE 0x04
3455 #define _SSPSTAT_READ_WRITE 0x04
3456 #define _SSPSTAT_I2C_READ 0x04
3457 #define _SSPSTAT_S 0x08
3458 #define _SSPSTAT_I2C_START 0x08
3459 #define _SSPSTAT_P 0x10
3460 #define _SSPSTAT_I2C_STOP 0x10
3461 #define _SSPSTAT_D_NOT_A 0x20
3462 #define _SSPSTAT_D 0x20
3463 #define _SSPSTAT_D_A 0x20
3464 #define _SSPSTAT_NOT_A 0x20
3465 #define _SSPSTAT_NOT_ADDRESS 0x20
3466 #define _SSPSTAT_DATA_ADDRESS 0x20
3467 #define _SSPSTAT_I2C_DAT 0x20
3468 #define _SSPSTAT_CKE 0x40
3469 #define _SSPSTAT_SMP 0x80
3471 //==============================================================================
3473 extern __at(0x0FC8) __sfr SSP1ADD;
3474 extern __at(0x0FC8) __sfr SSPADD;
3475 extern __at(0x0FC9) __sfr SSP1BUF;
3476 extern __at(0x0FC9) __sfr SSPBUF;
3478 //==============================================================================
3479 // T2CON Bits
3481 extern __at(0x0FCA) __sfr T2CON;
3483 typedef union
3485 struct
3487 unsigned T2CKPS0 : 1;
3488 unsigned T2CKPS1 : 1;
3489 unsigned TMR2ON : 1;
3490 unsigned T2OUTPS0 : 1;
3491 unsigned T2OUTPS1 : 1;
3492 unsigned T2OUTPS2 : 1;
3493 unsigned T2OUTPS3 : 1;
3494 unsigned : 1;
3497 struct
3499 unsigned T2CKPS : 2;
3500 unsigned : 6;
3503 struct
3505 unsigned : 3;
3506 unsigned T2OUTPS : 4;
3507 unsigned : 1;
3509 } __T2CONbits_t;
3511 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
3513 #define _T2CKPS0 0x01
3514 #define _T2CKPS1 0x02
3515 #define _TMR2ON 0x04
3516 #define _T2OUTPS0 0x08
3517 #define _T2OUTPS1 0x10
3518 #define _T2OUTPS2 0x20
3519 #define _T2OUTPS3 0x40
3521 //==============================================================================
3523 extern __at(0x0FCB) __sfr PR2;
3524 extern __at(0x0FCC) __sfr TMR2;
3526 //==============================================================================
3527 // T1CON Bits
3529 extern __at(0x0FCD) __sfr T1CON;
3531 typedef union
3533 struct
3535 unsigned TMR1ON : 1;
3536 unsigned TMR1CS : 1;
3537 unsigned NOT_T1SYNC : 1;
3538 unsigned T1OSCEN : 1;
3539 unsigned T1CKPS0 : 1;
3540 unsigned T1CKPS1 : 1;
3541 unsigned T1RUN : 1;
3542 unsigned RD16 : 1;
3545 struct
3547 unsigned : 1;
3548 unsigned : 1;
3549 unsigned T1INSYNC : 1;
3550 unsigned : 1;
3551 unsigned : 1;
3552 unsigned : 1;
3553 unsigned : 1;
3554 unsigned : 1;
3557 struct
3559 unsigned : 1;
3560 unsigned : 1;
3561 unsigned T1SYNC : 1;
3562 unsigned : 1;
3563 unsigned : 1;
3564 unsigned : 1;
3565 unsigned : 1;
3566 unsigned : 1;
3569 struct
3571 unsigned : 4;
3572 unsigned T1CKPS : 2;
3573 unsigned : 2;
3575 } __T1CONbits_t;
3577 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
3579 #define _TMR1ON 0x01
3580 #define _TMR1CS 0x02
3581 #define _NOT_T1SYNC 0x04
3582 #define _T1INSYNC 0x04
3583 #define _T1SYNC 0x04
3584 #define _T1OSCEN 0x08
3585 #define _T1CKPS0 0x10
3586 #define _T1CKPS1 0x20
3587 #define _T1RUN 0x40
3588 #define _RD16 0x80
3590 //==============================================================================
3592 extern __at(0x0FCE) __sfr TMR1;
3593 extern __at(0x0FCE) __sfr TMR1L;
3594 extern __at(0x0FCF) __sfr TMR1H;
3596 //==============================================================================
3597 // RCON Bits
3599 extern __at(0x0FD0) __sfr RCON;
3601 typedef union
3603 struct
3605 unsigned NOT_BOR : 1;
3606 unsigned NOT_POR : 1;
3607 unsigned NOT_PD : 1;
3608 unsigned NOT_TO : 1;
3609 unsigned NOT_RI : 1;
3610 unsigned NOT_CM : 1;
3611 unsigned : 1;
3612 unsigned IPEN : 1;
3615 struct
3617 unsigned BOR : 1;
3618 unsigned POR : 1;
3619 unsigned PD : 1;
3620 unsigned TO : 1;
3621 unsigned RI : 1;
3622 unsigned CM : 1;
3623 unsigned : 1;
3624 unsigned : 1;
3626 } __RCONbits_t;
3628 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
3630 #define _NOT_BOR 0x01
3631 #define _BOR 0x01
3632 #define _NOT_POR 0x02
3633 #define _POR 0x02
3634 #define _NOT_PD 0x04
3635 #define _PD 0x04
3636 #define _NOT_TO 0x08
3637 #define _TO 0x08
3638 #define _NOT_RI 0x10
3639 #define _RI 0x10
3640 #define _NOT_CM 0x20
3641 #define _CM 0x20
3642 #define _IPEN 0x80
3644 //==============================================================================
3647 //==============================================================================
3648 // WDTCON Bits
3650 extern __at(0x0FD1) __sfr WDTCON;
3652 typedef union
3654 struct
3656 unsigned SWDTEN : 1;
3657 unsigned : 1;
3658 unsigned : 1;
3659 unsigned : 1;
3660 unsigned : 1;
3661 unsigned : 1;
3662 unsigned : 1;
3663 unsigned REGSLP : 1;
3666 struct
3668 unsigned SWDTE : 1;
3669 unsigned : 1;
3670 unsigned : 1;
3671 unsigned : 1;
3672 unsigned : 1;
3673 unsigned : 1;
3674 unsigned : 1;
3675 unsigned : 1;
3677 } __WDTCONbits_t;
3679 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
3681 #define _SWDTEN 0x01
3682 #define _SWDTE 0x01
3683 #define _REGSLP 0x80
3685 //==============================================================================
3688 //==============================================================================
3689 // OSCCON Bits
3691 extern __at(0x0FD3) __sfr OSCCON;
3693 typedef union
3695 struct
3697 unsigned SCS0 : 1;
3698 unsigned SCS1 : 1;
3699 unsigned IOFS : 1;
3700 unsigned OSTS : 1;
3701 unsigned IRCF0 : 1;
3702 unsigned IRCF1 : 1;
3703 unsigned IRCF2 : 1;
3704 unsigned IDLEN : 1;
3707 struct
3709 unsigned SCS : 2;
3710 unsigned : 6;
3713 struct
3715 unsigned : 4;
3716 unsigned IRCF : 3;
3717 unsigned : 1;
3719 } __OSCCONbits_t;
3721 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
3723 #define _SCS0 0x01
3724 #define _SCS1 0x02
3725 #define _IOFS 0x04
3726 #define _OSTS 0x08
3727 #define _IRCF0 0x10
3728 #define _IRCF1 0x20
3729 #define _IRCF2 0x40
3730 #define _IDLEN 0x80
3732 //==============================================================================
3735 //==============================================================================
3736 // T0CON Bits
3738 extern __at(0x0FD5) __sfr T0CON;
3740 typedef union
3742 struct
3744 unsigned T0PS0 : 1;
3745 unsigned T0PS1 : 1;
3746 unsigned T0PS2 : 1;
3747 unsigned PSA : 1;
3748 unsigned T0SE : 1;
3749 unsigned T0CS : 1;
3750 unsigned T08BIT : 1;
3751 unsigned TMR0ON : 1;
3754 struct
3756 unsigned : 1;
3757 unsigned : 1;
3758 unsigned : 1;
3759 unsigned T0PS3 : 1;
3760 unsigned : 1;
3761 unsigned : 1;
3762 unsigned : 1;
3763 unsigned : 1;
3766 struct
3768 unsigned T0PS : 4;
3769 unsigned : 4;
3771 } __T0CONbits_t;
3773 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
3775 #define _T0PS0 0x01
3776 #define _T0PS1 0x02
3777 #define _T0PS2 0x04
3778 #define _PSA 0x08
3779 #define _T0PS3 0x08
3780 #define _T0SE 0x10
3781 #define _T0CS 0x20
3782 #define _T08BIT 0x40
3783 #define _TMR0ON 0x80
3785 //==============================================================================
3787 extern __at(0x0FD6) __sfr TMR0;
3788 extern __at(0x0FD6) __sfr TMR0L;
3789 extern __at(0x0FD7) __sfr TMR0H;
3791 //==============================================================================
3792 // STATUS Bits
3794 extern __at(0x0FD8) __sfr STATUS;
3796 typedef struct
3798 unsigned C : 1;
3799 unsigned DC : 1;
3800 unsigned Z : 1;
3801 unsigned OV : 1;
3802 unsigned N : 1;
3803 unsigned : 1;
3804 unsigned : 1;
3805 unsigned : 1;
3806 } __STATUSbits_t;
3808 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3810 #define _C 0x01
3811 #define _DC 0x02
3812 #define _Z 0x04
3813 #define _OV 0x08
3814 #define _N 0x10
3816 //==============================================================================
3818 extern __at(0x0FD9) __sfr FSR2L;
3819 extern __at(0x0FDA) __sfr FSR2H;
3820 extern __at(0x0FDB) __sfr PLUSW2;
3821 extern __at(0x0FDC) __sfr PREINC2;
3822 extern __at(0x0FDD) __sfr POSTDEC2;
3823 extern __at(0x0FDE) __sfr POSTINC2;
3824 extern __at(0x0FDF) __sfr INDF2;
3825 extern __at(0x0FE0) __sfr BSR;
3826 extern __at(0x0FE1) __sfr FSR1L;
3827 extern __at(0x0FE2) __sfr FSR1H;
3828 extern __at(0x0FE3) __sfr PLUSW1;
3829 extern __at(0x0FE4) __sfr PREINC1;
3830 extern __at(0x0FE5) __sfr POSTDEC1;
3831 extern __at(0x0FE6) __sfr POSTINC1;
3832 extern __at(0x0FE7) __sfr INDF1;
3833 extern __at(0x0FE8) __sfr WREG;
3834 extern __at(0x0FE9) __sfr FSR0L;
3835 extern __at(0x0FEA) __sfr FSR0H;
3836 extern __at(0x0FEB) __sfr PLUSW0;
3837 extern __at(0x0FEC) __sfr PREINC0;
3838 extern __at(0x0FED) __sfr POSTDEC0;
3839 extern __at(0x0FEE) __sfr POSTINC0;
3840 extern __at(0x0FEF) __sfr INDF0;
3842 //==============================================================================
3843 // INTCON3 Bits
3845 extern __at(0x0FF0) __sfr INTCON3;
3847 typedef union
3849 struct
3851 unsigned INT1IF : 1;
3852 unsigned INT2IF : 1;
3853 unsigned INT3IF : 1;
3854 unsigned INT1IE : 1;
3855 unsigned INT2IE : 1;
3856 unsigned INT3IE : 1;
3857 unsigned INT1IP : 1;
3858 unsigned INT2IP : 1;
3861 struct
3863 unsigned INT1F : 1;
3864 unsigned INT2F : 1;
3865 unsigned INT3F : 1;
3866 unsigned INT1E : 1;
3867 unsigned INT2E : 1;
3868 unsigned INT3E : 1;
3869 unsigned INT1P : 1;
3870 unsigned INT2P : 1;
3872 } __INTCON3bits_t;
3874 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3876 #define _INT1IF 0x01
3877 #define _INT1F 0x01
3878 #define _INT2IF 0x02
3879 #define _INT2F 0x02
3880 #define _INT3IF 0x04
3881 #define _INT3F 0x04
3882 #define _INT1IE 0x08
3883 #define _INT1E 0x08
3884 #define _INT2IE 0x10
3885 #define _INT2E 0x10
3886 #define _INT3IE 0x20
3887 #define _INT3E 0x20
3888 #define _INT1IP 0x40
3889 #define _INT1P 0x40
3890 #define _INT2IP 0x80
3891 #define _INT2P 0x80
3893 //==============================================================================
3896 //==============================================================================
3897 // INTCON2 Bits
3899 extern __at(0x0FF1) __sfr INTCON2;
3901 typedef union
3903 struct
3905 unsigned RBIP : 1;
3906 unsigned INT3IP : 1;
3907 unsigned TMR0IP : 1;
3908 unsigned INTEDG3 : 1;
3909 unsigned INTEDG2 : 1;
3910 unsigned INTEDG1 : 1;
3911 unsigned INTEDG0 : 1;
3912 unsigned NOT_RBPU : 1;
3915 struct
3917 unsigned : 1;
3918 unsigned INT3P : 1;
3919 unsigned T0IP : 1;
3920 unsigned : 1;
3921 unsigned : 1;
3922 unsigned : 1;
3923 unsigned : 1;
3924 unsigned RBPU : 1;
3926 } __INTCON2bits_t;
3928 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3930 #define _RBIP 0x01
3931 #define _INT3IP 0x02
3932 #define _INT3P 0x02
3933 #define _TMR0IP 0x04
3934 #define _T0IP 0x04
3935 #define _INTEDG3 0x08
3936 #define _INTEDG2 0x10
3937 #define _INTEDG1 0x20
3938 #define _INTEDG0 0x40
3939 #define _NOT_RBPU 0x80
3940 #define _RBPU 0x80
3942 //==============================================================================
3945 //==============================================================================
3946 // INTCON Bits
3948 extern __at(0x0FF2) __sfr INTCON;
3950 typedef union
3952 struct
3954 unsigned RBIF : 1;
3955 unsigned INT0IF : 1;
3956 unsigned TMR0IF : 1;
3957 unsigned RBIE : 1;
3958 unsigned INT0IE : 1;
3959 unsigned TMR0IE : 1;
3960 unsigned PEIE_GIEL : 1;
3961 unsigned GIE_GIEH : 1;
3964 struct
3966 unsigned : 1;
3967 unsigned INT0F : 1;
3968 unsigned T0IF : 1;
3969 unsigned : 1;
3970 unsigned INT0E : 1;
3971 unsigned T0IE : 1;
3972 unsigned PEIE : 1;
3973 unsigned GIE : 1;
3976 struct
3978 unsigned : 1;
3979 unsigned : 1;
3980 unsigned : 1;
3981 unsigned : 1;
3982 unsigned : 1;
3983 unsigned : 1;
3984 unsigned GIEL : 1;
3985 unsigned GIEH : 1;
3987 } __INTCONbits_t;
3989 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3991 #define _RBIF 0x01
3992 #define _INT0IF 0x02
3993 #define _INT0F 0x02
3994 #define _TMR0IF 0x04
3995 #define _T0IF 0x04
3996 #define _RBIE 0x08
3997 #define _INT0IE 0x10
3998 #define _INT0E 0x10
3999 #define _TMR0IE 0x20
4000 #define _T0IE 0x20
4001 #define _PEIE_GIEL 0x40
4002 #define _PEIE 0x40
4003 #define _GIEL 0x40
4004 #define _GIE_GIEH 0x80
4005 #define _GIE 0x80
4006 #define _GIEH 0x80
4008 //==============================================================================
4010 extern __at(0x0FF3) __sfr PROD;
4011 extern __at(0x0FF3) __sfr PRODL;
4012 extern __at(0x0FF4) __sfr PRODH;
4013 extern __at(0x0FF5) __sfr TABLAT;
4014 extern __at(0x0FF6) __sfr TBLPTR;
4015 extern __at(0x0FF6) __sfr TBLPTRL;
4016 extern __at(0x0FF7) __sfr TBLPTRH;
4017 extern __at(0x0FF8) __sfr TBLPTRU;
4018 extern __at(0x0FF9) __sfr PC;
4019 extern __at(0x0FF9) __sfr PCL;
4020 extern __at(0x0FFA) __sfr PCLATH;
4021 extern __at(0x0FFB) __sfr PCLATU;
4023 //==============================================================================
4024 // STKPTR Bits
4026 extern __at(0x0FFC) __sfr STKPTR;
4028 typedef union
4030 struct
4032 unsigned SP0 : 1;
4033 unsigned SP1 : 1;
4034 unsigned SP2 : 1;
4035 unsigned SP3 : 1;
4036 unsigned SP4 : 1;
4037 unsigned : 1;
4038 unsigned STKUNF : 1;
4039 unsigned STKFUL : 1;
4042 struct
4044 unsigned STKPTR0 : 1;
4045 unsigned STKPTR1 : 1;
4046 unsigned STKPTR2 : 1;
4047 unsigned STKPTR3 : 1;
4048 unsigned STKPTR4 : 1;
4049 unsigned : 1;
4050 unsigned : 1;
4051 unsigned STKOVF : 1;
4054 struct
4056 unsigned STKPTR : 5;
4057 unsigned : 3;
4060 struct
4062 unsigned SP : 5;
4063 unsigned : 3;
4065 } __STKPTRbits_t;
4067 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
4069 #define _SP0 0x01
4070 #define _STKPTR0 0x01
4071 #define _SP1 0x02
4072 #define _STKPTR1 0x02
4073 #define _SP2 0x04
4074 #define _STKPTR2 0x04
4075 #define _SP3 0x08
4076 #define _STKPTR3 0x08
4077 #define _SP4 0x10
4078 #define _STKPTR4 0x10
4079 #define _STKUNF 0x40
4080 #define _STKFUL 0x80
4081 #define _STKOVF 0x80
4083 //==============================================================================
4085 extern __at(0x0FFD) __sfr TOS;
4086 extern __at(0x0FFD) __sfr TOSL;
4087 extern __at(0x0FFE) __sfr TOSH;
4088 extern __at(0x0FFF) __sfr TOSU;
4090 //==============================================================================
4092 // Configuration Addresses
4094 //==============================================================================
4096 #define __CONFIG1L 0x001FF8
4097 #define __CONFIG1H 0x001FF9
4098 #define __CONFIG2L 0x001FFA
4099 #define __CONFIG2H 0x001FFB
4100 #define __CONFIG3L 0x001FFC
4101 #define __CONFIG3H 0x001FFD
4103 //==============================================================================
4105 #endif // #ifndef __PIC18F63J11_H__