struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f6410.h
blob9b7f4ec4bc54b72b8656ce2194e201b62b19b097
1 /*
2 * This declarations of the PIC18F6410 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:49 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 __PIC18F6410_H__
26 #define __PIC18F6410_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // RCSTA2 Bits
40 extern __at(0x0F6B) __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 ADEN : 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 ADDEN2 : 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(0x0F6B) 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_ADEN 0x08
116 #define _RCSTA2_ADDEN2 0x08
117 #define _RCSTA2_CREN 0x10
118 #define _RCSTA2_CREN2 0x10
119 #define _RCSTA2_SREN 0x20
120 #define _RCSTA2_SREN2 0x20
121 #define _RCSTA2_RX9 0x40
122 #define _RCSTA2_RC9 0x40
123 #define _RCSTA2_NOT_RC8 0x40
124 #define _RCSTA2_RC8_9 0x40
125 #define _RCSTA2_RX92 0x40
126 #define _RCSTA2_SPEN 0x80
127 #define _RCSTA2_SPEN2 0x80
129 //==============================================================================
132 //==============================================================================
133 // TXSTA2 Bits
135 extern __at(0x0F6C) __sfr TXSTA2;
137 typedef union
139 struct
141 unsigned TX9D : 1;
142 unsigned TRMT : 1;
143 unsigned BRGH : 1;
144 unsigned SENDB2 : 1;
145 unsigned SYNC : 1;
146 unsigned TXEN : 1;
147 unsigned TX9 : 1;
148 unsigned CSRC : 1;
151 struct
153 unsigned TXD8 : 1;
154 unsigned TRMT2 : 1;
155 unsigned BRGH2 : 1;
156 unsigned : 1;
157 unsigned SYNC2 : 1;
158 unsigned TXEN2 : 1;
159 unsigned TX8_9 : 1;
160 unsigned CSRC2 : 1;
163 struct
165 unsigned TX9D2 : 1;
166 unsigned : 1;
167 unsigned : 1;
168 unsigned : 1;
169 unsigned : 1;
170 unsigned : 1;
171 unsigned NOT_TX8 : 1;
172 unsigned : 1;
175 struct
177 unsigned : 1;
178 unsigned : 1;
179 unsigned : 1;
180 unsigned : 1;
181 unsigned : 1;
182 unsigned : 1;
183 unsigned TX92 : 1;
184 unsigned : 1;
186 } __TXSTA2bits_t;
188 extern __at(0x0F6C) volatile __TXSTA2bits_t TXSTA2bits;
190 #define _TXSTA2_TX9D 0x01
191 #define _TXSTA2_TXD8 0x01
192 #define _TXSTA2_TX9D2 0x01
193 #define _TXSTA2_TRMT 0x02
194 #define _TXSTA2_TRMT2 0x02
195 #define _TXSTA2_BRGH 0x04
196 #define _TXSTA2_BRGH2 0x04
197 #define _TXSTA2_SENDB2 0x08
198 #define _TXSTA2_SYNC 0x10
199 #define _TXSTA2_SYNC2 0x10
200 #define _TXSTA2_TXEN 0x20
201 #define _TXSTA2_TXEN2 0x20
202 #define _TXSTA2_TX9 0x40
203 #define _TXSTA2_TX8_9 0x40
204 #define _TXSTA2_NOT_TX8 0x40
205 #define _TXSTA2_TX92 0x40
206 #define _TXSTA2_CSRC 0x80
207 #define _TXSTA2_CSRC2 0x80
209 //==============================================================================
211 extern __at(0x0F6D) __sfr TXREG2;
212 extern __at(0x0F6E) __sfr RCREG2;
213 extern __at(0x0F6F) __sfr SPBRG2;
215 //==============================================================================
216 // BAUDCON1 Bits
218 extern __at(0x0F7E) __sfr BAUDCON1;
220 typedef union
222 struct
224 unsigned ABDEN : 1;
225 unsigned WUE : 1;
226 unsigned : 1;
227 unsigned BRG16 : 1;
228 unsigned SCKP : 1;
229 unsigned : 1;
230 unsigned RCIDL : 1;
231 unsigned ABDOVF : 1;
234 struct
236 unsigned : 1;
237 unsigned : 1;
238 unsigned : 1;
239 unsigned : 1;
240 unsigned : 1;
241 unsigned : 1;
242 unsigned RCMT : 1;
243 unsigned : 1;
245 } __BAUDCON1bits_t;
247 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
249 #define _ABDEN 0x01
250 #define _WUE 0x02
251 #define _BRG16 0x08
252 #define _SCKP 0x10
253 #define _RCIDL 0x40
254 #define _RCMT 0x40
255 #define _ABDOVF 0x80
257 //==============================================================================
260 //==============================================================================
261 // BAUDCTL1 Bits
263 extern __at(0x0F7E) __sfr BAUDCTL1;
265 typedef union
267 struct
269 unsigned ABDEN : 1;
270 unsigned WUE : 1;
271 unsigned : 1;
272 unsigned BRG16 : 1;
273 unsigned SCKP : 1;
274 unsigned : 1;
275 unsigned RCIDL : 1;
276 unsigned ABDOVF : 1;
279 struct
281 unsigned : 1;
282 unsigned : 1;
283 unsigned : 1;
284 unsigned : 1;
285 unsigned : 1;
286 unsigned : 1;
287 unsigned RCMT : 1;
288 unsigned : 1;
290 } __BAUDCTL1bits_t;
292 extern __at(0x0F7E) volatile __BAUDCTL1bits_t BAUDCTL1bits;
294 #define _BAUDCTL1_ABDEN 0x01
295 #define _BAUDCTL1_WUE 0x02
296 #define _BAUDCTL1_BRG16 0x08
297 #define _BAUDCTL1_SCKP 0x10
298 #define _BAUDCTL1_RCIDL 0x40
299 #define _BAUDCTL1_RCMT 0x40
300 #define _BAUDCTL1_ABDOVF 0x80
302 //==============================================================================
304 extern __at(0x0F7F) __sfr SPBRGH1;
306 //==============================================================================
307 // PORTA Bits
309 extern __at(0x0F80) __sfr PORTA;
311 typedef union
313 struct
315 unsigned RA0 : 1;
316 unsigned RA1 : 1;
317 unsigned RA2 : 1;
318 unsigned RA3 : 1;
319 unsigned RA4 : 1;
320 unsigned RA5 : 1;
321 unsigned RA6 : 1;
322 unsigned RA7 : 1;
325 struct
327 unsigned AN0 : 1;
328 unsigned AN1 : 1;
329 unsigned AN2 : 1;
330 unsigned AN3 : 1;
331 unsigned T0CKI : 1;
332 unsigned AN4 : 1;
333 unsigned OSC2 : 1;
334 unsigned OSC1 : 1;
337 struct
339 unsigned : 1;
340 unsigned : 1;
341 unsigned VREFM : 1;
342 unsigned VREFP : 1;
343 unsigned : 1;
344 unsigned LVDIN : 1;
345 unsigned CLKO : 1;
346 unsigned CLKI : 1;
348 } __PORTAbits_t;
350 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
352 #define _PORTA_RA0 0x01
353 #define _PORTA_AN0 0x01
354 #define _PORTA_RA1 0x02
355 #define _PORTA_AN1 0x02
356 #define _PORTA_RA2 0x04
357 #define _PORTA_AN2 0x04
358 #define _PORTA_VREFM 0x04
359 #define _PORTA_RA3 0x08
360 #define _PORTA_AN3 0x08
361 #define _PORTA_VREFP 0x08
362 #define _PORTA_RA4 0x10
363 #define _PORTA_T0CKI 0x10
364 #define _PORTA_RA5 0x20
365 #define _PORTA_AN4 0x20
366 #define _PORTA_LVDIN 0x20
367 #define _PORTA_RA6 0x40
368 #define _PORTA_OSC2 0x40
369 #define _PORTA_CLKO 0x40
370 #define _PORTA_RA7 0x80
371 #define _PORTA_OSC1 0x80
372 #define _PORTA_CLKI 0x80
374 //==============================================================================
377 //==============================================================================
378 // PORTB Bits
380 extern __at(0x0F81) __sfr PORTB;
382 typedef union
384 struct
386 unsigned RB0 : 1;
387 unsigned RB1 : 1;
388 unsigned RB2 : 1;
389 unsigned RB3 : 1;
390 unsigned RB4 : 1;
391 unsigned RB5 : 1;
392 unsigned RB6 : 1;
393 unsigned RB7 : 1;
396 struct
398 unsigned INT0 : 1;
399 unsigned INT1 : 1;
400 unsigned INT2 : 1;
401 unsigned INT3 : 1;
402 unsigned KBI0 : 1;
403 unsigned KBI1 : 1;
404 unsigned KBI2 : 1;
405 unsigned KBI3 : 1;
408 struct
410 unsigned : 1;
411 unsigned : 1;
412 unsigned : 1;
413 unsigned CCP2B : 1;
414 unsigned : 1;
415 unsigned PGM : 1;
416 unsigned PGC : 1;
417 unsigned PGD : 1;
420 struct
422 unsigned INT : 4;
423 unsigned : 4;
426 struct
428 unsigned : 4;
429 unsigned KBI : 4;
431 } __PORTBbits_t;
433 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
435 #define _PORTB_RB0 0x01
436 #define _PORTB_INT0 0x01
437 #define _PORTB_RB1 0x02
438 #define _PORTB_INT1 0x02
439 #define _PORTB_RB2 0x04
440 #define _PORTB_INT2 0x04
441 #define _PORTB_RB3 0x08
442 #define _PORTB_INT3 0x08
443 #define _PORTB_CCP2B 0x08
444 #define _PORTB_RB4 0x10
445 #define _PORTB_KBI0 0x10
446 #define _PORTB_RB5 0x20
447 #define _PORTB_KBI1 0x20
448 #define _PORTB_PGM 0x20
449 #define _PORTB_RB6 0x40
450 #define _PORTB_KBI2 0x40
451 #define _PORTB_PGC 0x40
452 #define _PORTB_RB7 0x80
453 #define _PORTB_KBI3 0x80
454 #define _PORTB_PGD 0x80
456 //==============================================================================
459 //==============================================================================
460 // PORTC Bits
462 extern __at(0x0F82) __sfr PORTC;
464 typedef union
466 struct
468 unsigned RC0 : 1;
469 unsigned RC1 : 1;
470 unsigned RC2 : 1;
471 unsigned RC3 : 1;
472 unsigned RC4 : 1;
473 unsigned RC5 : 1;
474 unsigned RC6 : 1;
475 unsigned RC7 : 1;
478 struct
480 unsigned T1OSO : 1;
481 unsigned T1OSI : 1;
482 unsigned CCP1 : 1;
483 unsigned SCK : 1;
484 unsigned SDI : 1;
485 unsigned SDO : 1;
486 unsigned TX : 1;
487 unsigned RX : 1;
490 struct
492 unsigned T13CKI : 1;
493 unsigned CCP2C : 1;
494 unsigned : 1;
495 unsigned SCL : 1;
496 unsigned SDA : 1;
497 unsigned : 1;
498 unsigned CK : 1;
499 unsigned : 1;
501 } __PORTCbits_t;
503 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
505 #define _PORTC_RC0 0x01
506 #define _PORTC_T1OSO 0x01
507 #define _PORTC_T13CKI 0x01
508 #define _PORTC_RC1 0x02
509 #define _PORTC_T1OSI 0x02
510 #define _PORTC_CCP2C 0x02
511 #define _PORTC_RC2 0x04
512 #define _PORTC_CCP1 0x04
513 #define _PORTC_RC3 0x08
514 #define _PORTC_SCK 0x08
515 #define _PORTC_SCL 0x08
516 #define _PORTC_RC4 0x10
517 #define _PORTC_SDI 0x10
518 #define _PORTC_SDA 0x10
519 #define _PORTC_RC5 0x20
520 #define _PORTC_SDO 0x20
521 #define _PORTC_RC6 0x40
522 #define _PORTC_TX 0x40
523 #define _PORTC_CK 0x40
524 #define _PORTC_RC7 0x80
525 #define _PORTC_RX 0x80
527 //==============================================================================
530 //==============================================================================
531 // PORTD Bits
533 extern __at(0x0F83) __sfr PORTD;
535 typedef union
537 struct
539 unsigned RD0 : 1;
540 unsigned RD1 : 1;
541 unsigned RD2 : 1;
542 unsigned RD3 : 1;
543 unsigned RD4 : 1;
544 unsigned RD5 : 1;
545 unsigned RD6 : 1;
546 unsigned RD7 : 1;
549 struct
551 unsigned PSP0 : 1;
552 unsigned PSP1 : 1;
553 unsigned PSP2 : 1;
554 unsigned PSP3 : 1;
555 unsigned PSP4 : 1;
556 unsigned PSP5 : 1;
557 unsigned PSP6 : 1;
558 unsigned PSP7 : 1;
560 } __PORTDbits_t;
562 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
564 #define _PORTD_RD0 0x01
565 #define _PORTD_PSP0 0x01
566 #define _PORTD_RD1 0x02
567 #define _PORTD_PSP1 0x02
568 #define _PORTD_RD2 0x04
569 #define _PORTD_PSP2 0x04
570 #define _PORTD_RD3 0x08
571 #define _PORTD_PSP3 0x08
572 #define _PORTD_RD4 0x10
573 #define _PORTD_PSP4 0x10
574 #define _PORTD_RD5 0x20
575 #define _PORTD_PSP5 0x20
576 #define _PORTD_RD6 0x40
577 #define _PORTD_PSP6 0x40
578 #define _PORTD_RD7 0x80
579 #define _PORTD_PSP7 0x80
581 //==============================================================================
584 //==============================================================================
585 // PORTE Bits
587 extern __at(0x0F84) __sfr PORTE;
589 typedef union
591 struct
593 unsigned RE0 : 1;
594 unsigned RE1 : 1;
595 unsigned RE2 : 1;
596 unsigned RE3 : 1;
597 unsigned RE4 : 1;
598 unsigned RE5 : 1;
599 unsigned RE6 : 1;
600 unsigned RE7 : 1;
603 struct
605 unsigned RD : 1;
606 unsigned WR : 1;
607 unsigned CS : 1;
608 unsigned : 1;
609 unsigned : 1;
610 unsigned : 1;
611 unsigned : 1;
612 unsigned CCP2E : 1;
614 } __PORTEbits_t;
616 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
618 #define _PORTE_RE0 0x01
619 #define _PORTE_RD 0x01
620 #define _PORTE_RE1 0x02
621 #define _PORTE_WR 0x02
622 #define _PORTE_RE2 0x04
623 #define _PORTE_CS 0x04
624 #define _PORTE_RE3 0x08
625 #define _PORTE_RE4 0x10
626 #define _PORTE_RE5 0x20
627 #define _PORTE_RE6 0x40
628 #define _PORTE_RE7 0x80
629 #define _PORTE_CCP2E 0x80
631 //==============================================================================
634 //==============================================================================
635 // PORTF Bits
637 extern __at(0x0F85) __sfr PORTF;
639 typedef union
641 struct
643 unsigned RF0 : 1;
644 unsigned RF1 : 1;
645 unsigned RF2 : 1;
646 unsigned RF3 : 1;
647 unsigned RF4 : 1;
648 unsigned RF5 : 1;
649 unsigned RF6 : 1;
650 unsigned RF7 : 1;
653 struct
655 unsigned AN5 : 1;
656 unsigned AN6 : 1;
657 unsigned AN7 : 1;
658 unsigned AN8 : 1;
659 unsigned AN9 : 1;
660 unsigned AN10 : 1;
661 unsigned AN11 : 1;
662 unsigned SS : 1;
665 struct
667 unsigned : 1;
668 unsigned C2OUTF : 1;
669 unsigned C1OUTF : 1;
670 unsigned : 1;
671 unsigned : 1;
672 unsigned CVREFF : 1;
673 unsigned : 1;
674 unsigned : 1;
676 } __PORTFbits_t;
678 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
680 #define _PORTF_RF0 0x01
681 #define _PORTF_AN5 0x01
682 #define _PORTF_RF1 0x02
683 #define _PORTF_AN6 0x02
684 #define _PORTF_C2OUTF 0x02
685 #define _PORTF_RF2 0x04
686 #define _PORTF_AN7 0x04
687 #define _PORTF_C1OUTF 0x04
688 #define _PORTF_RF3 0x08
689 #define _PORTF_AN8 0x08
690 #define _PORTF_RF4 0x10
691 #define _PORTF_AN9 0x10
692 #define _PORTF_RF5 0x20
693 #define _PORTF_AN10 0x20
694 #define _PORTF_CVREFF 0x20
695 #define _PORTF_RF6 0x40
696 #define _PORTF_AN11 0x40
697 #define _PORTF_RF7 0x80
698 #define _PORTF_SS 0x80
700 //==============================================================================
703 //==============================================================================
704 // PORTG Bits
706 extern __at(0x0F86) __sfr PORTG;
708 typedef union
710 struct
712 unsigned RG0 : 1;
713 unsigned RG1 : 1;
714 unsigned RG2 : 1;
715 unsigned RG3 : 1;
716 unsigned RG4 : 1;
717 unsigned RG5 : 1;
718 unsigned : 1;
719 unsigned : 1;
722 struct
724 unsigned CCP3 : 1;
725 unsigned TX2 : 1;
726 unsigned RX2 : 1;
727 unsigned : 1;
728 unsigned : 1;
729 unsigned MCLR : 1;
730 unsigned : 1;
731 unsigned : 1;
734 struct
736 unsigned : 1;
737 unsigned CK2 : 1;
738 unsigned DT2 : 1;
739 unsigned : 1;
740 unsigned : 1;
741 unsigned VPP : 1;
742 unsigned : 1;
743 unsigned : 1;
746 struct
748 unsigned RG : 6;
749 unsigned : 2;
751 } __PORTGbits_t;
753 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
755 #define _PORTG_RG0 0x01
756 #define _PORTG_CCP3 0x01
757 #define _PORTG_RG1 0x02
758 #define _PORTG_TX2 0x02
759 #define _PORTG_CK2 0x02
760 #define _PORTG_RG2 0x04
761 #define _PORTG_RX2 0x04
762 #define _PORTG_DT2 0x04
763 #define _PORTG_RG3 0x08
764 #define _PORTG_RG4 0x10
765 #define _PORTG_RG5 0x20
766 #define _PORTG_MCLR 0x20
767 #define _PORTG_VPP 0x20
769 //==============================================================================
772 //==============================================================================
773 // LATA Bits
775 extern __at(0x0F89) __sfr LATA;
777 typedef struct
779 unsigned LATA0 : 1;
780 unsigned LATA1 : 1;
781 unsigned LATA2 : 1;
782 unsigned LATA3 : 1;
783 unsigned LATA4 : 1;
784 unsigned LATA5 : 1;
785 unsigned LATA6 : 1;
786 unsigned LATA7 : 1;
787 } __LATAbits_t;
789 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
791 #define _LATA0 0x01
792 #define _LATA1 0x02
793 #define _LATA2 0x04
794 #define _LATA3 0x08
795 #define _LATA4 0x10
796 #define _LATA5 0x20
797 #define _LATA6 0x40
798 #define _LATA7 0x80
800 //==============================================================================
803 //==============================================================================
804 // LATB Bits
806 extern __at(0x0F8A) __sfr LATB;
808 typedef struct
810 unsigned LATB0 : 1;
811 unsigned LATB1 : 1;
812 unsigned LATB2 : 1;
813 unsigned LATB3 : 1;
814 unsigned LATB4 : 1;
815 unsigned LATB5 : 1;
816 unsigned LATB6 : 1;
817 unsigned LATB7 : 1;
818 } __LATBbits_t;
820 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
822 #define _LATB0 0x01
823 #define _LATB1 0x02
824 #define _LATB2 0x04
825 #define _LATB3 0x08
826 #define _LATB4 0x10
827 #define _LATB5 0x20
828 #define _LATB6 0x40
829 #define _LATB7 0x80
831 //==============================================================================
834 //==============================================================================
835 // LATC Bits
837 extern __at(0x0F8B) __sfr LATC;
839 typedef struct
841 unsigned LATC0 : 1;
842 unsigned LATC1 : 1;
843 unsigned LATC2 : 1;
844 unsigned LATC3 : 1;
845 unsigned LATC4 : 1;
846 unsigned LATC5 : 1;
847 unsigned LATC6 : 1;
848 unsigned LATC7 : 1;
849 } __LATCbits_t;
851 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
853 #define _LATC0 0x01
854 #define _LATC1 0x02
855 #define _LATC2 0x04
856 #define _LATC3 0x08
857 #define _LATC4 0x10
858 #define _LATC5 0x20
859 #define _LATC6 0x40
860 #define _LATC7 0x80
862 //==============================================================================
865 //==============================================================================
866 // LATD Bits
868 extern __at(0x0F8C) __sfr LATD;
870 typedef struct
872 unsigned LATD0 : 1;
873 unsigned LATD1 : 1;
874 unsigned LATD2 : 1;
875 unsigned LATD3 : 1;
876 unsigned LATD4 : 1;
877 unsigned LATD5 : 1;
878 unsigned LATD6 : 1;
879 unsigned LATD7 : 1;
880 } __LATDbits_t;
882 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
884 #define _LATD0 0x01
885 #define _LATD1 0x02
886 #define _LATD2 0x04
887 #define _LATD3 0x08
888 #define _LATD4 0x10
889 #define _LATD5 0x20
890 #define _LATD6 0x40
891 #define _LATD7 0x80
893 //==============================================================================
896 //==============================================================================
897 // LATE Bits
899 extern __at(0x0F8D) __sfr LATE;
901 typedef struct
903 unsigned LATE0 : 1;
904 unsigned LATE1 : 1;
905 unsigned LATE2 : 1;
906 unsigned LATE3 : 1;
907 unsigned LATE4 : 1;
908 unsigned LATE5 : 1;
909 unsigned LATE6 : 1;
910 unsigned LATE7 : 1;
911 } __LATEbits_t;
913 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
915 #define _LATE0 0x01
916 #define _LATE1 0x02
917 #define _LATE2 0x04
918 #define _LATE3 0x08
919 #define _LATE4 0x10
920 #define _LATE5 0x20
921 #define _LATE6 0x40
922 #define _LATE7 0x80
924 //==============================================================================
927 //==============================================================================
928 // LATF Bits
930 extern __at(0x0F8E) __sfr LATF;
932 typedef struct
934 unsigned LATF0 : 1;
935 unsigned LATF1 : 1;
936 unsigned LATF2 : 1;
937 unsigned LATF3 : 1;
938 unsigned LATF4 : 1;
939 unsigned LATF5 : 1;
940 unsigned LATF6 : 1;
941 unsigned LATF7 : 1;
942 } __LATFbits_t;
944 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
946 #define _LATF0 0x01
947 #define _LATF1 0x02
948 #define _LATF2 0x04
949 #define _LATF3 0x08
950 #define _LATF4 0x10
951 #define _LATF5 0x20
952 #define _LATF6 0x40
953 #define _LATF7 0x80
955 //==============================================================================
958 //==============================================================================
959 // LATG Bits
961 extern __at(0x0F8F) __sfr LATG;
963 typedef union
965 struct
967 unsigned LATG0 : 1;
968 unsigned LATG1 : 1;
969 unsigned LATG2 : 1;
970 unsigned LATG3 : 1;
971 unsigned LATG4 : 1;
972 unsigned : 1;
973 unsigned : 1;
974 unsigned : 1;
977 struct
979 unsigned LATG : 5;
980 unsigned : 3;
982 } __LATGbits_t;
984 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
986 #define _LATG0 0x01
987 #define _LATG1 0x02
988 #define _LATG2 0x04
989 #define _LATG3 0x08
990 #define _LATG4 0x10
992 //==============================================================================
995 //==============================================================================
996 // DDRA Bits
998 extern __at(0x0F92) __sfr DDRA;
1000 typedef union
1002 struct
1004 unsigned TRISA0 : 1;
1005 unsigned TRISA1 : 1;
1006 unsigned TRISA2 : 1;
1007 unsigned TRISA3 : 1;
1008 unsigned TRISA4 : 1;
1009 unsigned TRISA5 : 1;
1010 unsigned TRISA6 : 1;
1011 unsigned TRISA7 : 1;
1014 struct
1016 unsigned RA0 : 1;
1017 unsigned RA1 : 1;
1018 unsigned RA2 : 1;
1019 unsigned RA3 : 1;
1020 unsigned RA4 : 1;
1021 unsigned RA5 : 1;
1022 unsigned RA6 : 1;
1023 unsigned RA7 : 1;
1025 } __DDRAbits_t;
1027 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1029 #define _TRISA0 0x01
1030 #define _RA0 0x01
1031 #define _TRISA1 0x02
1032 #define _RA1 0x02
1033 #define _TRISA2 0x04
1034 #define _RA2 0x04
1035 #define _TRISA3 0x08
1036 #define _RA3 0x08
1037 #define _TRISA4 0x10
1038 #define _RA4 0x10
1039 #define _TRISA5 0x20
1040 #define _RA5 0x20
1041 #define _TRISA6 0x40
1042 #define _RA6 0x40
1043 #define _TRISA7 0x80
1044 #define _RA7 0x80
1046 //==============================================================================
1049 //==============================================================================
1050 // TRISA Bits
1052 extern __at(0x0F92) __sfr TRISA;
1054 typedef union
1056 struct
1058 unsigned TRISA0 : 1;
1059 unsigned TRISA1 : 1;
1060 unsigned TRISA2 : 1;
1061 unsigned TRISA3 : 1;
1062 unsigned TRISA4 : 1;
1063 unsigned TRISA5 : 1;
1064 unsigned TRISA6 : 1;
1065 unsigned TRISA7 : 1;
1068 struct
1070 unsigned RA0 : 1;
1071 unsigned RA1 : 1;
1072 unsigned RA2 : 1;
1073 unsigned RA3 : 1;
1074 unsigned RA4 : 1;
1075 unsigned RA5 : 1;
1076 unsigned RA6 : 1;
1077 unsigned RA7 : 1;
1079 } __TRISAbits_t;
1081 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1083 #define _TRISA_TRISA0 0x01
1084 #define _TRISA_RA0 0x01
1085 #define _TRISA_TRISA1 0x02
1086 #define _TRISA_RA1 0x02
1087 #define _TRISA_TRISA2 0x04
1088 #define _TRISA_RA2 0x04
1089 #define _TRISA_TRISA3 0x08
1090 #define _TRISA_RA3 0x08
1091 #define _TRISA_TRISA4 0x10
1092 #define _TRISA_RA4 0x10
1093 #define _TRISA_TRISA5 0x20
1094 #define _TRISA_RA5 0x20
1095 #define _TRISA_TRISA6 0x40
1096 #define _TRISA_RA6 0x40
1097 #define _TRISA_TRISA7 0x80
1098 #define _TRISA_RA7 0x80
1100 //==============================================================================
1103 //==============================================================================
1104 // DDRB Bits
1106 extern __at(0x0F93) __sfr DDRB;
1108 typedef union
1110 struct
1112 unsigned TRISB0 : 1;
1113 unsigned TRISB1 : 1;
1114 unsigned TRISB2 : 1;
1115 unsigned TRISB3 : 1;
1116 unsigned TRISB4 : 1;
1117 unsigned TRISB5 : 1;
1118 unsigned TRISB6 : 1;
1119 unsigned TRISB7 : 1;
1122 struct
1124 unsigned RB0 : 1;
1125 unsigned RB1 : 1;
1126 unsigned RB2 : 1;
1127 unsigned RB3 : 1;
1128 unsigned RB4 : 1;
1129 unsigned RB5 : 1;
1130 unsigned RB6 : 1;
1131 unsigned RB7 : 1;
1133 } __DDRBbits_t;
1135 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1137 #define _TRISB0 0x01
1138 #define _RB0 0x01
1139 #define _TRISB1 0x02
1140 #define _RB1 0x02
1141 #define _TRISB2 0x04
1142 #define _RB2 0x04
1143 #define _TRISB3 0x08
1144 #define _RB3 0x08
1145 #define _TRISB4 0x10
1146 #define _RB4 0x10
1147 #define _TRISB5 0x20
1148 #define _RB5 0x20
1149 #define _TRISB6 0x40
1150 #define _RB6 0x40
1151 #define _TRISB7 0x80
1152 #define _RB7 0x80
1154 //==============================================================================
1157 //==============================================================================
1158 // TRISB Bits
1160 extern __at(0x0F93) __sfr TRISB;
1162 typedef union
1164 struct
1166 unsigned TRISB0 : 1;
1167 unsigned TRISB1 : 1;
1168 unsigned TRISB2 : 1;
1169 unsigned TRISB3 : 1;
1170 unsigned TRISB4 : 1;
1171 unsigned TRISB5 : 1;
1172 unsigned TRISB6 : 1;
1173 unsigned TRISB7 : 1;
1176 struct
1178 unsigned RB0 : 1;
1179 unsigned RB1 : 1;
1180 unsigned RB2 : 1;
1181 unsigned RB3 : 1;
1182 unsigned RB4 : 1;
1183 unsigned RB5 : 1;
1184 unsigned RB6 : 1;
1185 unsigned RB7 : 1;
1187 } __TRISBbits_t;
1189 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1191 #define _TRISB_TRISB0 0x01
1192 #define _TRISB_RB0 0x01
1193 #define _TRISB_TRISB1 0x02
1194 #define _TRISB_RB1 0x02
1195 #define _TRISB_TRISB2 0x04
1196 #define _TRISB_RB2 0x04
1197 #define _TRISB_TRISB3 0x08
1198 #define _TRISB_RB3 0x08
1199 #define _TRISB_TRISB4 0x10
1200 #define _TRISB_RB4 0x10
1201 #define _TRISB_TRISB5 0x20
1202 #define _TRISB_RB5 0x20
1203 #define _TRISB_TRISB6 0x40
1204 #define _TRISB_RB6 0x40
1205 #define _TRISB_TRISB7 0x80
1206 #define _TRISB_RB7 0x80
1208 //==============================================================================
1211 //==============================================================================
1212 // DDRC Bits
1214 extern __at(0x0F94) __sfr DDRC;
1216 typedef union
1218 struct
1220 unsigned TRISC0 : 1;
1221 unsigned TRISC1 : 1;
1222 unsigned TRISC2 : 1;
1223 unsigned TRISC3 : 1;
1224 unsigned TRISC4 : 1;
1225 unsigned TRISC5 : 1;
1226 unsigned TRISC6 : 1;
1227 unsigned TRISC7 : 1;
1230 struct
1232 unsigned RC0 : 1;
1233 unsigned RC1 : 1;
1234 unsigned RC2 : 1;
1235 unsigned RC3 : 1;
1236 unsigned RC4 : 1;
1237 unsigned RC5 : 1;
1238 unsigned RC6 : 1;
1239 unsigned RC7 : 1;
1241 } __DDRCbits_t;
1243 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1245 #define _TRISC0 0x01
1246 #define _RC0 0x01
1247 #define _TRISC1 0x02
1248 #define _RC1 0x02
1249 #define _TRISC2 0x04
1250 #define _RC2 0x04
1251 #define _TRISC3 0x08
1252 #define _RC3 0x08
1253 #define _TRISC4 0x10
1254 #define _RC4 0x10
1255 #define _TRISC5 0x20
1256 #define _RC5 0x20
1257 #define _TRISC6 0x40
1258 #define _RC6 0x40
1259 #define _TRISC7 0x80
1260 #define _RC7 0x80
1262 //==============================================================================
1265 //==============================================================================
1266 // TRISC Bits
1268 extern __at(0x0F94) __sfr TRISC;
1270 typedef union
1272 struct
1274 unsigned TRISC0 : 1;
1275 unsigned TRISC1 : 1;
1276 unsigned TRISC2 : 1;
1277 unsigned TRISC3 : 1;
1278 unsigned TRISC4 : 1;
1279 unsigned TRISC5 : 1;
1280 unsigned TRISC6 : 1;
1281 unsigned TRISC7 : 1;
1284 struct
1286 unsigned RC0 : 1;
1287 unsigned RC1 : 1;
1288 unsigned RC2 : 1;
1289 unsigned RC3 : 1;
1290 unsigned RC4 : 1;
1291 unsigned RC5 : 1;
1292 unsigned RC6 : 1;
1293 unsigned RC7 : 1;
1295 } __TRISCbits_t;
1297 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1299 #define _TRISC_TRISC0 0x01
1300 #define _TRISC_RC0 0x01
1301 #define _TRISC_TRISC1 0x02
1302 #define _TRISC_RC1 0x02
1303 #define _TRISC_TRISC2 0x04
1304 #define _TRISC_RC2 0x04
1305 #define _TRISC_TRISC3 0x08
1306 #define _TRISC_RC3 0x08
1307 #define _TRISC_TRISC4 0x10
1308 #define _TRISC_RC4 0x10
1309 #define _TRISC_TRISC5 0x20
1310 #define _TRISC_RC5 0x20
1311 #define _TRISC_TRISC6 0x40
1312 #define _TRISC_RC6 0x40
1313 #define _TRISC_TRISC7 0x80
1314 #define _TRISC_RC7 0x80
1316 //==============================================================================
1319 //==============================================================================
1320 // DDRD Bits
1322 extern __at(0x0F95) __sfr DDRD;
1324 typedef union
1326 struct
1328 unsigned TRISD0 : 1;
1329 unsigned TRISD1 : 1;
1330 unsigned TRISD2 : 1;
1331 unsigned TRISD3 : 1;
1332 unsigned TRISD4 : 1;
1333 unsigned TRISD5 : 1;
1334 unsigned TRISD6 : 1;
1335 unsigned TRISD7 : 1;
1338 struct
1340 unsigned RD0 : 1;
1341 unsigned RD1 : 1;
1342 unsigned RD2 : 1;
1343 unsigned RD3 : 1;
1344 unsigned RD4 : 1;
1345 unsigned RD5 : 1;
1346 unsigned RD6 : 1;
1347 unsigned RD7 : 1;
1349 } __DDRDbits_t;
1351 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
1353 #define _TRISD0 0x01
1354 #define _RD0 0x01
1355 #define _TRISD1 0x02
1356 #define _RD1 0x02
1357 #define _TRISD2 0x04
1358 #define _RD2 0x04
1359 #define _TRISD3 0x08
1360 #define _RD3 0x08
1361 #define _TRISD4 0x10
1362 #define _RD4 0x10
1363 #define _TRISD5 0x20
1364 #define _RD5 0x20
1365 #define _TRISD6 0x40
1366 #define _RD6 0x40
1367 #define _TRISD7 0x80
1368 #define _RD7 0x80
1370 //==============================================================================
1373 //==============================================================================
1374 // TRISD Bits
1376 extern __at(0x0F95) __sfr TRISD;
1378 typedef union
1380 struct
1382 unsigned TRISD0 : 1;
1383 unsigned TRISD1 : 1;
1384 unsigned TRISD2 : 1;
1385 unsigned TRISD3 : 1;
1386 unsigned TRISD4 : 1;
1387 unsigned TRISD5 : 1;
1388 unsigned TRISD6 : 1;
1389 unsigned TRISD7 : 1;
1392 struct
1394 unsigned RD0 : 1;
1395 unsigned RD1 : 1;
1396 unsigned RD2 : 1;
1397 unsigned RD3 : 1;
1398 unsigned RD4 : 1;
1399 unsigned RD5 : 1;
1400 unsigned RD6 : 1;
1401 unsigned RD7 : 1;
1403 } __TRISDbits_t;
1405 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
1407 #define _TRISD_TRISD0 0x01
1408 #define _TRISD_RD0 0x01
1409 #define _TRISD_TRISD1 0x02
1410 #define _TRISD_RD1 0x02
1411 #define _TRISD_TRISD2 0x04
1412 #define _TRISD_RD2 0x04
1413 #define _TRISD_TRISD3 0x08
1414 #define _TRISD_RD3 0x08
1415 #define _TRISD_TRISD4 0x10
1416 #define _TRISD_RD4 0x10
1417 #define _TRISD_TRISD5 0x20
1418 #define _TRISD_RD5 0x20
1419 #define _TRISD_TRISD6 0x40
1420 #define _TRISD_RD6 0x40
1421 #define _TRISD_TRISD7 0x80
1422 #define _TRISD_RD7 0x80
1424 //==============================================================================
1427 //==============================================================================
1428 // DDRE Bits
1430 extern __at(0x0F96) __sfr DDRE;
1432 typedef union
1434 struct
1436 unsigned TRISE0 : 1;
1437 unsigned TRISE1 : 1;
1438 unsigned TRISE2 : 1;
1439 unsigned TRISE3 : 1;
1440 unsigned TRISE4 : 1;
1441 unsigned TRISE5 : 1;
1442 unsigned TRISE6 : 1;
1443 unsigned TRISE7 : 1;
1446 struct
1448 unsigned RE0 : 1;
1449 unsigned RE1 : 1;
1450 unsigned RE2 : 1;
1451 unsigned RE3 : 1;
1452 unsigned RE4 : 1;
1453 unsigned RE5 : 1;
1454 unsigned RE6 : 1;
1455 unsigned RE7 : 1;
1457 } __DDREbits_t;
1459 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
1461 #define _TRISE0 0x01
1462 #define _RE0 0x01
1463 #define _TRISE1 0x02
1464 #define _RE1 0x02
1465 #define _TRISE2 0x04
1466 #define _RE2 0x04
1467 #define _TRISE3 0x08
1468 #define _RE3 0x08
1469 #define _TRISE4 0x10
1470 #define _RE4 0x10
1471 #define _TRISE5 0x20
1472 #define _RE5 0x20
1473 #define _TRISE6 0x40
1474 #define _RE6 0x40
1475 #define _TRISE7 0x80
1476 #define _RE7 0x80
1478 //==============================================================================
1481 //==============================================================================
1482 // TRISE Bits
1484 extern __at(0x0F96) __sfr TRISE;
1486 typedef union
1488 struct
1490 unsigned TRISE0 : 1;
1491 unsigned TRISE1 : 1;
1492 unsigned TRISE2 : 1;
1493 unsigned TRISE3 : 1;
1494 unsigned TRISE4 : 1;
1495 unsigned TRISE5 : 1;
1496 unsigned TRISE6 : 1;
1497 unsigned TRISE7 : 1;
1500 struct
1502 unsigned RE0 : 1;
1503 unsigned RE1 : 1;
1504 unsigned RE2 : 1;
1505 unsigned RE3 : 1;
1506 unsigned RE4 : 1;
1507 unsigned RE5 : 1;
1508 unsigned RE6 : 1;
1509 unsigned RE7 : 1;
1511 } __TRISEbits_t;
1513 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
1515 #define _TRISE_TRISE0 0x01
1516 #define _TRISE_RE0 0x01
1517 #define _TRISE_TRISE1 0x02
1518 #define _TRISE_RE1 0x02
1519 #define _TRISE_TRISE2 0x04
1520 #define _TRISE_RE2 0x04
1521 #define _TRISE_TRISE3 0x08
1522 #define _TRISE_RE3 0x08
1523 #define _TRISE_TRISE4 0x10
1524 #define _TRISE_RE4 0x10
1525 #define _TRISE_TRISE5 0x20
1526 #define _TRISE_RE5 0x20
1527 #define _TRISE_TRISE6 0x40
1528 #define _TRISE_RE6 0x40
1529 #define _TRISE_TRISE7 0x80
1530 #define _TRISE_RE7 0x80
1532 //==============================================================================
1535 //==============================================================================
1536 // DDRF Bits
1538 extern __at(0x0F97) __sfr DDRF;
1540 typedef union
1542 struct
1544 unsigned TRISF0 : 1;
1545 unsigned TRISF1 : 1;
1546 unsigned TRISF2 : 1;
1547 unsigned TRISF3 : 1;
1548 unsigned TRISF4 : 1;
1549 unsigned TRISF5 : 1;
1550 unsigned TRISF6 : 1;
1551 unsigned TRISF7 : 1;
1554 struct
1556 unsigned RF0 : 1;
1557 unsigned RF1 : 1;
1558 unsigned RF2 : 1;
1559 unsigned RF3 : 1;
1560 unsigned RF4 : 1;
1561 unsigned RF5 : 1;
1562 unsigned RF6 : 1;
1563 unsigned RF7 : 1;
1565 } __DDRFbits_t;
1567 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
1569 #define _TRISF0 0x01
1570 #define _RF0 0x01
1571 #define _TRISF1 0x02
1572 #define _RF1 0x02
1573 #define _TRISF2 0x04
1574 #define _RF2 0x04
1575 #define _TRISF3 0x08
1576 #define _RF3 0x08
1577 #define _TRISF4 0x10
1578 #define _RF4 0x10
1579 #define _TRISF5 0x20
1580 #define _RF5 0x20
1581 #define _TRISF6 0x40
1582 #define _RF6 0x40
1583 #define _TRISF7 0x80
1584 #define _RF7 0x80
1586 //==============================================================================
1589 //==============================================================================
1590 // TRISF Bits
1592 extern __at(0x0F97) __sfr TRISF;
1594 typedef union
1596 struct
1598 unsigned TRISF0 : 1;
1599 unsigned TRISF1 : 1;
1600 unsigned TRISF2 : 1;
1601 unsigned TRISF3 : 1;
1602 unsigned TRISF4 : 1;
1603 unsigned TRISF5 : 1;
1604 unsigned TRISF6 : 1;
1605 unsigned TRISF7 : 1;
1608 struct
1610 unsigned RF0 : 1;
1611 unsigned RF1 : 1;
1612 unsigned RF2 : 1;
1613 unsigned RF3 : 1;
1614 unsigned RF4 : 1;
1615 unsigned RF5 : 1;
1616 unsigned RF6 : 1;
1617 unsigned RF7 : 1;
1619 } __TRISFbits_t;
1621 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
1623 #define _TRISF_TRISF0 0x01
1624 #define _TRISF_RF0 0x01
1625 #define _TRISF_TRISF1 0x02
1626 #define _TRISF_RF1 0x02
1627 #define _TRISF_TRISF2 0x04
1628 #define _TRISF_RF2 0x04
1629 #define _TRISF_TRISF3 0x08
1630 #define _TRISF_RF3 0x08
1631 #define _TRISF_TRISF4 0x10
1632 #define _TRISF_RF4 0x10
1633 #define _TRISF_TRISF5 0x20
1634 #define _TRISF_RF5 0x20
1635 #define _TRISF_TRISF6 0x40
1636 #define _TRISF_RF6 0x40
1637 #define _TRISF_TRISF7 0x80
1638 #define _TRISF_RF7 0x80
1640 //==============================================================================
1643 //==============================================================================
1644 // DDRG Bits
1646 extern __at(0x0F98) __sfr DDRG;
1648 typedef union
1650 struct
1652 unsigned TRISG0 : 1;
1653 unsigned TRISG1 : 1;
1654 unsigned TRISG2 : 1;
1655 unsigned TRISG3 : 1;
1656 unsigned TRISG4 : 1;
1657 unsigned : 1;
1658 unsigned : 1;
1659 unsigned : 1;
1662 struct
1664 unsigned RG0 : 1;
1665 unsigned RG1 : 1;
1666 unsigned RG2 : 1;
1667 unsigned RG3 : 1;
1668 unsigned RG4 : 1;
1669 unsigned : 1;
1670 unsigned : 1;
1671 unsigned : 1;
1674 struct
1676 unsigned RG : 5;
1677 unsigned : 3;
1680 struct
1682 unsigned TRISG : 5;
1683 unsigned : 3;
1685 } __DDRGbits_t;
1687 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
1689 #define _TRISG0 0x01
1690 #define _RG0 0x01
1691 #define _TRISG1 0x02
1692 #define _RG1 0x02
1693 #define _TRISG2 0x04
1694 #define _RG2 0x04
1695 #define _TRISG3 0x08
1696 #define _RG3 0x08
1697 #define _TRISG4 0x10
1698 #define _RG4 0x10
1700 //==============================================================================
1703 //==============================================================================
1704 // TRISG Bits
1706 extern __at(0x0F98) __sfr TRISG;
1708 typedef union
1710 struct
1712 unsigned TRISG0 : 1;
1713 unsigned TRISG1 : 1;
1714 unsigned TRISG2 : 1;
1715 unsigned TRISG3 : 1;
1716 unsigned TRISG4 : 1;
1717 unsigned : 1;
1718 unsigned : 1;
1719 unsigned : 1;
1722 struct
1724 unsigned RG0 : 1;
1725 unsigned RG1 : 1;
1726 unsigned RG2 : 1;
1727 unsigned RG3 : 1;
1728 unsigned RG4 : 1;
1729 unsigned : 1;
1730 unsigned : 1;
1731 unsigned : 1;
1734 struct
1736 unsigned TRISG : 5;
1737 unsigned : 3;
1740 struct
1742 unsigned RG : 5;
1743 unsigned : 3;
1745 } __TRISGbits_t;
1747 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
1749 #define _TRISG_TRISG0 0x01
1750 #define _TRISG_RG0 0x01
1751 #define _TRISG_TRISG1 0x02
1752 #define _TRISG_RG1 0x02
1753 #define _TRISG_TRISG2 0x04
1754 #define _TRISG_RG2 0x04
1755 #define _TRISG_TRISG3 0x08
1756 #define _TRISG_RG3 0x08
1757 #define _TRISG_TRISG4 0x10
1758 #define _TRISG_RG4 0x10
1760 //==============================================================================
1763 //==============================================================================
1764 // OSCTUNE Bits
1766 extern __at(0x0F9B) __sfr OSCTUNE;
1768 typedef union
1770 struct
1772 unsigned TUN0 : 1;
1773 unsigned TUN1 : 1;
1774 unsigned TUN2 : 1;
1775 unsigned TUN3 : 1;
1776 unsigned TUN4 : 1;
1777 unsigned : 1;
1778 unsigned PLLEN : 1;
1779 unsigned INTSRC : 1;
1782 struct
1784 unsigned TUN : 5;
1785 unsigned : 3;
1787 } __OSCTUNEbits_t;
1789 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
1791 #define _TUN0 0x01
1792 #define _TUN1 0x02
1793 #define _TUN2 0x04
1794 #define _TUN3 0x08
1795 #define _TUN4 0x10
1796 #define _PLLEN 0x40
1797 #define _INTSRC 0x80
1799 //==============================================================================
1802 //==============================================================================
1803 // PIE1 Bits
1805 extern __at(0x0F9D) __sfr PIE1;
1807 typedef union
1809 struct
1811 unsigned TMR1IE : 1;
1812 unsigned TMR2IE : 1;
1813 unsigned CCP1IE : 1;
1814 unsigned SSPIE : 1;
1815 unsigned TXIE : 1;
1816 unsigned RCIE : 1;
1817 unsigned ADIE : 1;
1818 unsigned PSPIE : 1;
1821 struct
1823 unsigned : 1;
1824 unsigned : 1;
1825 unsigned : 1;
1826 unsigned : 1;
1827 unsigned TX1IE : 1;
1828 unsigned RC1IE : 1;
1829 unsigned : 1;
1830 unsigned : 1;
1832 } __PIE1bits_t;
1834 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1836 #define _TMR1IE 0x01
1837 #define _TMR2IE 0x02
1838 #define _CCP1IE 0x04
1839 #define _SSPIE 0x08
1840 #define _TXIE 0x10
1841 #define _TX1IE 0x10
1842 #define _RCIE 0x20
1843 #define _RC1IE 0x20
1844 #define _ADIE 0x40
1845 #define _PSPIE 0x80
1847 //==============================================================================
1850 //==============================================================================
1851 // PIR1 Bits
1853 extern __at(0x0F9E) __sfr PIR1;
1855 typedef union
1857 struct
1859 unsigned TMR1IF : 1;
1860 unsigned TMR2IF : 1;
1861 unsigned CCP1IF : 1;
1862 unsigned SSPIF : 1;
1863 unsigned TXIF : 1;
1864 unsigned RCIF : 1;
1865 unsigned ADIF : 1;
1866 unsigned PSPIF : 1;
1869 struct
1871 unsigned : 1;
1872 unsigned : 1;
1873 unsigned : 1;
1874 unsigned : 1;
1875 unsigned TX1IF : 1;
1876 unsigned RC1IF : 1;
1877 unsigned : 1;
1878 unsigned : 1;
1880 } __PIR1bits_t;
1882 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1884 #define _TMR1IF 0x01
1885 #define _TMR2IF 0x02
1886 #define _CCP1IF 0x04
1887 #define _SSPIF 0x08
1888 #define _TXIF 0x10
1889 #define _TX1IF 0x10
1890 #define _RCIF 0x20
1891 #define _RC1IF 0x20
1892 #define _ADIF 0x40
1893 #define _PSPIF 0x80
1895 //==============================================================================
1898 //==============================================================================
1899 // IPR1 Bits
1901 extern __at(0x0F9F) __sfr IPR1;
1903 typedef union
1905 struct
1907 unsigned TMR1IP : 1;
1908 unsigned TMR2IP : 1;
1909 unsigned CCP1IP : 1;
1910 unsigned SSPIP : 1;
1911 unsigned TXIP : 1;
1912 unsigned RCIP : 1;
1913 unsigned ADIP : 1;
1914 unsigned PSPIP : 1;
1917 struct
1919 unsigned : 1;
1920 unsigned : 1;
1921 unsigned : 1;
1922 unsigned : 1;
1923 unsigned TX1IP : 1;
1924 unsigned RC1IP : 1;
1925 unsigned : 1;
1926 unsigned : 1;
1928 } __IPR1bits_t;
1930 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
1932 #define _TMR1IP 0x01
1933 #define _TMR2IP 0x02
1934 #define _CCP1IP 0x04
1935 #define _SSPIP 0x08
1936 #define _TXIP 0x10
1937 #define _TX1IP 0x10
1938 #define _RCIP 0x20
1939 #define _RC1IP 0x20
1940 #define _ADIP 0x40
1941 #define _PSPIP 0x80
1943 //==============================================================================
1946 //==============================================================================
1947 // PIE2 Bits
1949 extern __at(0x0FA0) __sfr PIE2;
1951 typedef union
1953 struct
1955 unsigned CCP2IE : 1;
1956 unsigned TMR3IE : 1;
1957 unsigned HLVDIE : 1;
1958 unsigned BCLIE : 1;
1959 unsigned : 1;
1960 unsigned : 1;
1961 unsigned CMIE : 1;
1962 unsigned OSCFIE : 1;
1965 struct
1967 unsigned : 1;
1968 unsigned : 1;
1969 unsigned LVDIE : 1;
1970 unsigned : 1;
1971 unsigned : 1;
1972 unsigned : 1;
1973 unsigned : 1;
1974 unsigned : 1;
1976 } __PIE2bits_t;
1978 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
1980 #define _CCP2IE 0x01
1981 #define _TMR3IE 0x02
1982 #define _HLVDIE 0x04
1983 #define _LVDIE 0x04
1984 #define _BCLIE 0x08
1985 #define _CMIE 0x40
1986 #define _OSCFIE 0x80
1988 //==============================================================================
1991 //==============================================================================
1992 // PIR2 Bits
1994 extern __at(0x0FA1) __sfr PIR2;
1996 typedef union
1998 struct
2000 unsigned CCP2IF : 1;
2001 unsigned TMR3IF : 1;
2002 unsigned HLVDIF : 1;
2003 unsigned BCLIF : 1;
2004 unsigned : 1;
2005 unsigned : 1;
2006 unsigned CMIF : 1;
2007 unsigned OSCFIF : 1;
2010 struct
2012 unsigned : 1;
2013 unsigned : 1;
2014 unsigned LVDIF : 1;
2015 unsigned : 1;
2016 unsigned : 1;
2017 unsigned : 1;
2018 unsigned : 1;
2019 unsigned : 1;
2021 } __PIR2bits_t;
2023 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2025 #define _CCP2IF 0x01
2026 #define _TMR3IF 0x02
2027 #define _HLVDIF 0x04
2028 #define _LVDIF 0x04
2029 #define _BCLIF 0x08
2030 #define _CMIF 0x40
2031 #define _OSCFIF 0x80
2033 //==============================================================================
2036 //==============================================================================
2037 // IPR2 Bits
2039 extern __at(0x0FA2) __sfr IPR2;
2041 typedef union
2043 struct
2045 unsigned CCP2IP : 1;
2046 unsigned TMR3IP : 1;
2047 unsigned HLVDIP : 1;
2048 unsigned BCLIP : 1;
2049 unsigned : 1;
2050 unsigned : 1;
2051 unsigned CMIP : 1;
2052 unsigned OSCFIP : 1;
2055 struct
2057 unsigned : 1;
2058 unsigned : 1;
2059 unsigned LVDIP : 1;
2060 unsigned : 1;
2061 unsigned : 1;
2062 unsigned : 1;
2063 unsigned : 1;
2064 unsigned : 1;
2066 } __IPR2bits_t;
2068 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
2070 #define _CCP2IP 0x01
2071 #define _TMR3IP 0x02
2072 #define _HLVDIP 0x04
2073 #define _LVDIP 0x04
2074 #define _BCLIP 0x08
2075 #define _CMIP 0x40
2076 #define _OSCFIP 0x80
2078 //==============================================================================
2081 //==============================================================================
2082 // PIE3 Bits
2084 extern __at(0x0FA3) __sfr PIE3;
2086 typedef struct
2088 unsigned CCP3IE : 1;
2089 unsigned : 1;
2090 unsigned : 1;
2091 unsigned : 1;
2092 unsigned TX2IE : 1;
2093 unsigned RC2IE : 1;
2094 unsigned : 1;
2095 unsigned : 1;
2096 } __PIE3bits_t;
2098 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
2100 #define _CCP3IE 0x01
2101 #define _TX2IE 0x10
2102 #define _RC2IE 0x20
2104 //==============================================================================
2107 //==============================================================================
2108 // PIR3 Bits
2110 extern __at(0x0FA4) __sfr PIR3;
2112 typedef struct
2114 unsigned CCP3IF : 1;
2115 unsigned : 1;
2116 unsigned : 1;
2117 unsigned : 1;
2118 unsigned TX2IF : 1;
2119 unsigned RC2IF : 1;
2120 unsigned : 1;
2121 unsigned : 1;
2122 } __PIR3bits_t;
2124 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
2126 #define _CCP3IF 0x01
2127 #define _TX2IF 0x10
2128 #define _RC2IF 0x20
2130 //==============================================================================
2133 //==============================================================================
2134 // IPR3 Bits
2136 extern __at(0x0FA5) __sfr IPR3;
2138 typedef struct
2140 unsigned CCP3IP : 1;
2141 unsigned : 1;
2142 unsigned : 1;
2143 unsigned : 1;
2144 unsigned TX2IP : 1;
2145 unsigned RC2IP : 1;
2146 unsigned : 1;
2147 unsigned : 1;
2148 } __IPR3bits_t;
2150 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
2152 #define _CCP3IP 0x01
2153 #define _TX2IP 0x10
2154 #define _RC2IP 0x20
2156 //==============================================================================
2159 //==============================================================================
2160 // RCSTA Bits
2162 extern __at(0x0FAB) __sfr RCSTA;
2164 typedef union
2166 struct
2168 unsigned RX9D : 1;
2169 unsigned OERR : 1;
2170 unsigned FERR : 1;
2171 unsigned ADDEN : 1;
2172 unsigned CREN : 1;
2173 unsigned SREN : 1;
2174 unsigned RX9 : 1;
2175 unsigned SPEN : 1;
2178 struct
2180 unsigned RX9D1 : 1;
2181 unsigned OERR1 : 1;
2182 unsigned FERR1 : 1;
2183 unsigned ADEN : 1;
2184 unsigned CREN1 : 1;
2185 unsigned SREN1 : 1;
2186 unsigned RX91 : 1;
2187 unsigned SPEN1 : 1;
2190 struct
2192 unsigned : 1;
2193 unsigned : 1;
2194 unsigned : 1;
2195 unsigned ADDEN1 : 1;
2196 unsigned : 1;
2197 unsigned : 1;
2198 unsigned : 1;
2199 unsigned : 1;
2201 } __RCSTAbits_t;
2203 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
2205 #define _RX9D 0x01
2206 #define _RX9D1 0x01
2207 #define _OERR 0x02
2208 #define _OERR1 0x02
2209 #define _FERR 0x04
2210 #define _FERR1 0x04
2211 #define _ADDEN 0x08
2212 #define _ADEN 0x08
2213 #define _ADDEN1 0x08
2214 #define _CREN 0x10
2215 #define _CREN1 0x10
2216 #define _SREN 0x20
2217 #define _SREN1 0x20
2218 #define _RX9 0x40
2219 #define _RX91 0x40
2220 #define _SPEN 0x80
2221 #define _SPEN1 0x80
2223 //==============================================================================
2226 //==============================================================================
2227 // RCSTA1 Bits
2229 extern __at(0x0FAB) __sfr RCSTA1;
2231 typedef union
2233 struct
2235 unsigned RX9D : 1;
2236 unsigned OERR : 1;
2237 unsigned FERR : 1;
2238 unsigned ADDEN : 1;
2239 unsigned CREN : 1;
2240 unsigned SREN : 1;
2241 unsigned RX9 : 1;
2242 unsigned SPEN : 1;
2245 struct
2247 unsigned RX9D1 : 1;
2248 unsigned OERR1 : 1;
2249 unsigned FERR1 : 1;
2250 unsigned ADEN : 1;
2251 unsigned CREN1 : 1;
2252 unsigned SREN1 : 1;
2253 unsigned RX91 : 1;
2254 unsigned SPEN1 : 1;
2257 struct
2259 unsigned : 1;
2260 unsigned : 1;
2261 unsigned : 1;
2262 unsigned ADDEN1 : 1;
2263 unsigned : 1;
2264 unsigned : 1;
2265 unsigned : 1;
2266 unsigned : 1;
2268 } __RCSTA1bits_t;
2270 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
2272 #define _RCSTA1_RX9D 0x01
2273 #define _RCSTA1_RX9D1 0x01
2274 #define _RCSTA1_OERR 0x02
2275 #define _RCSTA1_OERR1 0x02
2276 #define _RCSTA1_FERR 0x04
2277 #define _RCSTA1_FERR1 0x04
2278 #define _RCSTA1_ADDEN 0x08
2279 #define _RCSTA1_ADEN 0x08
2280 #define _RCSTA1_ADDEN1 0x08
2281 #define _RCSTA1_CREN 0x10
2282 #define _RCSTA1_CREN1 0x10
2283 #define _RCSTA1_SREN 0x20
2284 #define _RCSTA1_SREN1 0x20
2285 #define _RCSTA1_RX9 0x40
2286 #define _RCSTA1_RX91 0x40
2287 #define _RCSTA1_SPEN 0x80
2288 #define _RCSTA1_SPEN1 0x80
2290 //==============================================================================
2293 //==============================================================================
2294 // TXSTA Bits
2296 extern __at(0x0FAC) __sfr TXSTA;
2298 typedef union
2300 struct
2302 unsigned TX9D : 1;
2303 unsigned TRMT : 1;
2304 unsigned BRGH : 1;
2305 unsigned SENDB : 1;
2306 unsigned SYNC : 1;
2307 unsigned TXEN : 1;
2308 unsigned TX9 : 1;
2309 unsigned CSRC : 1;
2312 struct
2314 unsigned TX9D1 : 1;
2315 unsigned TRMT1 : 1;
2316 unsigned BRGH1 : 1;
2317 unsigned SENDB1 : 1;
2318 unsigned SYNC1 : 1;
2319 unsigned TXEN1 : 1;
2320 unsigned TX91 : 1;
2321 unsigned CSRC1 : 1;
2323 } __TXSTAbits_t;
2325 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
2327 #define _TX9D 0x01
2328 #define _TX9D1 0x01
2329 #define _TRMT 0x02
2330 #define _TRMT1 0x02
2331 #define _BRGH 0x04
2332 #define _BRGH1 0x04
2333 #define _SENDB 0x08
2334 #define _SENDB1 0x08
2335 #define _SYNC 0x10
2336 #define _SYNC1 0x10
2337 #define _TXEN 0x20
2338 #define _TXEN1 0x20
2339 #define _TX9 0x40
2340 #define _TX91 0x40
2341 #define _CSRC 0x80
2342 #define _CSRC1 0x80
2344 //==============================================================================
2347 //==============================================================================
2348 // TXSTA1 Bits
2350 extern __at(0x0FAC) __sfr TXSTA1;
2352 typedef union
2354 struct
2356 unsigned TX9D : 1;
2357 unsigned TRMT : 1;
2358 unsigned BRGH : 1;
2359 unsigned SENDB : 1;
2360 unsigned SYNC : 1;
2361 unsigned TXEN : 1;
2362 unsigned TX9 : 1;
2363 unsigned CSRC : 1;
2366 struct
2368 unsigned TX9D1 : 1;
2369 unsigned TRMT1 : 1;
2370 unsigned BRGH1 : 1;
2371 unsigned SENDB1 : 1;
2372 unsigned SYNC1 : 1;
2373 unsigned TXEN1 : 1;
2374 unsigned TX91 : 1;
2375 unsigned CSRC1 : 1;
2377 } __TXSTA1bits_t;
2379 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
2381 #define _TXSTA1_TX9D 0x01
2382 #define _TXSTA1_TX9D1 0x01
2383 #define _TXSTA1_TRMT 0x02
2384 #define _TXSTA1_TRMT1 0x02
2385 #define _TXSTA1_BRGH 0x04
2386 #define _TXSTA1_BRGH1 0x04
2387 #define _TXSTA1_SENDB 0x08
2388 #define _TXSTA1_SENDB1 0x08
2389 #define _TXSTA1_SYNC 0x10
2390 #define _TXSTA1_SYNC1 0x10
2391 #define _TXSTA1_TXEN 0x20
2392 #define _TXSTA1_TXEN1 0x20
2393 #define _TXSTA1_TX9 0x40
2394 #define _TXSTA1_TX91 0x40
2395 #define _TXSTA1_CSRC 0x80
2396 #define _TXSTA1_CSRC1 0x80
2398 //==============================================================================
2400 extern __at(0x0FAD) __sfr TXREG;
2401 extern __at(0x0FAD) __sfr TXREG1;
2402 extern __at(0x0FAE) __sfr RCREG;
2403 extern __at(0x0FAE) __sfr RCREG1;
2404 extern __at(0x0FAF) __sfr SPBRG;
2405 extern __at(0x0FAF) __sfr SPBRG1;
2407 //==============================================================================
2408 // PSPCON Bits
2410 extern __at(0x0FB0) __sfr PSPCON;
2412 typedef struct
2414 unsigned : 1;
2415 unsigned : 1;
2416 unsigned : 1;
2417 unsigned : 1;
2418 unsigned PSPMODE : 1;
2419 unsigned IBOV : 1;
2420 unsigned OBF : 1;
2421 unsigned IBF : 1;
2422 } __PSPCONbits_t;
2424 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
2426 #define _PSPMODE 0x10
2427 #define _IBOV 0x20
2428 #define _OBF 0x40
2429 #define _IBF 0x80
2431 //==============================================================================
2434 //==============================================================================
2435 // T3CON Bits
2437 extern __at(0x0FB1) __sfr T3CON;
2439 typedef union
2441 struct
2443 unsigned TMR3ON : 1;
2444 unsigned TMR3CS : 1;
2445 unsigned NOT_T3SYNC : 1;
2446 unsigned T3CCP1 : 1;
2447 unsigned T3CKPS0 : 1;
2448 unsigned T3CKPS1 : 1;
2449 unsigned T3CCP2 : 1;
2450 unsigned RD16 : 1;
2453 struct
2455 unsigned : 1;
2456 unsigned : 1;
2457 unsigned T3SYNC : 1;
2458 unsigned : 1;
2459 unsigned : 1;
2460 unsigned : 1;
2461 unsigned : 1;
2462 unsigned : 1;
2465 struct
2467 unsigned : 1;
2468 unsigned : 1;
2469 unsigned T3INSYNC : 1;
2470 unsigned : 1;
2471 unsigned : 1;
2472 unsigned : 1;
2473 unsigned : 1;
2474 unsigned : 1;
2477 struct
2479 unsigned : 4;
2480 unsigned T3CKPS : 2;
2481 unsigned : 2;
2483 } __T3CONbits_t;
2485 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
2487 #define _T3CON_TMR3ON 0x01
2488 #define _T3CON_TMR3CS 0x02
2489 #define _T3CON_NOT_T3SYNC 0x04
2490 #define _T3CON_T3SYNC 0x04
2491 #define _T3CON_T3INSYNC 0x04
2492 #define _T3CON_T3CCP1 0x08
2493 #define _T3CON_T3CKPS0 0x10
2494 #define _T3CON_T3CKPS1 0x20
2495 #define _T3CON_T3CCP2 0x40
2496 #define _T3CON_RD16 0x80
2498 //==============================================================================
2500 extern __at(0x0FB2) __sfr TMR3;
2501 extern __at(0x0FB2) __sfr TMR3L;
2502 extern __at(0x0FB3) __sfr TMR3H;
2504 //==============================================================================
2505 // CMCON Bits
2507 extern __at(0x0FB4) __sfr CMCON;
2509 typedef union
2511 struct
2513 unsigned CM0 : 1;
2514 unsigned CM1 : 1;
2515 unsigned CM2 : 1;
2516 unsigned CIS : 1;
2517 unsigned C1INV : 1;
2518 unsigned C2INV : 1;
2519 unsigned C1OUT : 1;
2520 unsigned C2OUT : 1;
2523 struct
2525 unsigned CM : 3;
2526 unsigned : 5;
2528 } __CMCONbits_t;
2530 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
2532 #define _CM0 0x01
2533 #define _CM1 0x02
2534 #define _CM2 0x04
2535 #define _CIS 0x08
2536 #define _C1INV 0x10
2537 #define _C2INV 0x20
2538 #define _C1OUT 0x40
2539 #define _C2OUT 0x80
2541 //==============================================================================
2544 //==============================================================================
2545 // CVRCON Bits
2547 extern __at(0x0FB5) __sfr CVRCON;
2549 typedef union
2551 struct
2553 unsigned CVR0 : 1;
2554 unsigned CVR1 : 1;
2555 unsigned CVR2 : 1;
2556 unsigned CVR3 : 1;
2557 unsigned CVRSS : 1;
2558 unsigned CVRR : 1;
2559 unsigned CVROE : 1;
2560 unsigned CVREN : 1;
2563 struct
2565 unsigned : 1;
2566 unsigned : 1;
2567 unsigned : 1;
2568 unsigned : 1;
2569 unsigned CVREF : 1;
2570 unsigned : 1;
2571 unsigned : 1;
2572 unsigned : 1;
2575 struct
2577 unsigned CVR : 4;
2578 unsigned : 4;
2580 } __CVRCONbits_t;
2582 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
2584 #define _CVR0 0x01
2585 #define _CVR1 0x02
2586 #define _CVR2 0x04
2587 #define _CVR3 0x08
2588 #define _CVRSS 0x10
2589 #define _CVREF 0x10
2590 #define _CVRR 0x20
2591 #define _CVROE 0x40
2592 #define _CVREN 0x80
2594 //==============================================================================
2597 //==============================================================================
2598 // CCP3CON Bits
2600 extern __at(0x0FB7) __sfr CCP3CON;
2602 typedef union
2604 struct
2606 unsigned CCP3M0 : 1;
2607 unsigned CCP3M1 : 1;
2608 unsigned CCP3M2 : 1;
2609 unsigned CCP3M3 : 1;
2610 unsigned DCCP3Y : 1;
2611 unsigned DCCP3X : 1;
2612 unsigned : 1;
2613 unsigned : 1;
2616 struct
2618 unsigned : 1;
2619 unsigned : 1;
2620 unsigned : 1;
2621 unsigned : 1;
2622 unsigned DC3B0 : 1;
2623 unsigned DC3B1 : 1;
2624 unsigned : 1;
2625 unsigned : 1;
2628 struct
2630 unsigned CCP3M : 4;
2631 unsigned : 4;
2634 struct
2636 unsigned : 4;
2637 unsigned DC3B : 2;
2638 unsigned : 2;
2640 } __CCP3CONbits_t;
2642 extern __at(0x0FB7) volatile __CCP3CONbits_t CCP3CONbits;
2644 #define _CCP3M0 0x01
2645 #define _CCP3M1 0x02
2646 #define _CCP3M2 0x04
2647 #define _CCP3M3 0x08
2648 #define _DCCP3Y 0x10
2649 #define _DC3B0 0x10
2650 #define _DCCP3X 0x20
2651 #define _DC3B1 0x20
2653 //==============================================================================
2655 extern __at(0x0FB8) __sfr CCPR3;
2656 extern __at(0x0FB8) __sfr CCPR3L;
2657 extern __at(0x0FB9) __sfr CCPR3H;
2659 //==============================================================================
2660 // CCP2CON Bits
2662 extern __at(0x0FBA) __sfr CCP2CON;
2664 typedef union
2666 struct
2668 unsigned CCP2M0 : 1;
2669 unsigned CCP2M1 : 1;
2670 unsigned CCP2M2 : 1;
2671 unsigned CCP2M3 : 1;
2672 unsigned DCCP2Y : 1;
2673 unsigned DCCP2X : 1;
2674 unsigned : 1;
2675 unsigned : 1;
2678 struct
2680 unsigned : 1;
2681 unsigned : 1;
2682 unsigned : 1;
2683 unsigned : 1;
2684 unsigned CCP2Y : 1;
2685 unsigned CCP2X : 1;
2686 unsigned : 1;
2687 unsigned : 1;
2690 struct
2692 unsigned : 1;
2693 unsigned : 1;
2694 unsigned : 1;
2695 unsigned : 1;
2696 unsigned DC2B0 : 1;
2697 unsigned DC2B1 : 1;
2698 unsigned : 1;
2699 unsigned : 1;
2702 struct
2704 unsigned CCP2M : 4;
2705 unsigned : 4;
2708 struct
2710 unsigned : 4;
2711 unsigned DC2B : 2;
2712 unsigned : 2;
2714 } __CCP2CONbits_t;
2716 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
2718 #define _CCP2M0 0x01
2719 #define _CCP2M1 0x02
2720 #define _CCP2M2 0x04
2721 #define _CCP2M3 0x08
2722 #define _DCCP2Y 0x10
2723 #define _CCP2Y 0x10
2724 #define _DC2B0 0x10
2725 #define _DCCP2X 0x20
2726 #define _CCP2X 0x20
2727 #define _DC2B1 0x20
2729 //==============================================================================
2731 extern __at(0x0FBB) __sfr CCPR2;
2732 extern __at(0x0FBB) __sfr CCPR2L;
2733 extern __at(0x0FBC) __sfr CCPR2H;
2735 //==============================================================================
2736 // CCP1CON Bits
2738 extern __at(0x0FBD) __sfr CCP1CON;
2740 typedef union
2742 struct
2744 unsigned CCP1M0 : 1;
2745 unsigned CCP1M1 : 1;
2746 unsigned CCP1M2 : 1;
2747 unsigned CCP1M3 : 1;
2748 unsigned DCCP1Y : 1;
2749 unsigned DCCP1X : 1;
2750 unsigned : 1;
2751 unsigned : 1;
2754 struct
2756 unsigned : 1;
2757 unsigned : 1;
2758 unsigned : 1;
2759 unsigned : 1;
2760 unsigned CCP1Y : 1;
2761 unsigned CCP1X : 1;
2762 unsigned : 1;
2763 unsigned : 1;
2766 struct
2768 unsigned : 1;
2769 unsigned : 1;
2770 unsigned : 1;
2771 unsigned : 1;
2772 unsigned DC1B0 : 1;
2773 unsigned DC1B1 : 1;
2774 unsigned : 1;
2775 unsigned : 1;
2778 struct
2780 unsigned CCP1M : 4;
2781 unsigned : 4;
2784 struct
2786 unsigned : 4;
2787 unsigned DC1B : 2;
2788 unsigned : 2;
2790 } __CCP1CONbits_t;
2792 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
2794 #define _CCP1M0 0x01
2795 #define _CCP1M1 0x02
2796 #define _CCP1M2 0x04
2797 #define _CCP1M3 0x08
2798 #define _DCCP1Y 0x10
2799 #define _CCP1Y 0x10
2800 #define _DC1B0 0x10
2801 #define _DCCP1X 0x20
2802 #define _CCP1X 0x20
2803 #define _DC1B1 0x20
2805 //==============================================================================
2807 extern __at(0x0FBE) __sfr CCPR1;
2808 extern __at(0x0FBE) __sfr CCPR1L;
2809 extern __at(0x0FBF) __sfr CCPR1H;
2811 //==============================================================================
2812 // ADCON2 Bits
2814 extern __at(0x0FC0) __sfr ADCON2;
2816 typedef union
2818 struct
2820 unsigned ADCS0 : 1;
2821 unsigned ADCS1 : 1;
2822 unsigned ADCS2 : 1;
2823 unsigned ACQT0 : 1;
2824 unsigned ACQT1 : 1;
2825 unsigned ACQT2 : 1;
2826 unsigned : 1;
2827 unsigned ADFM : 1;
2830 struct
2832 unsigned ADCS : 3;
2833 unsigned : 5;
2836 struct
2838 unsigned : 3;
2839 unsigned ACQT : 3;
2840 unsigned : 2;
2842 } __ADCON2bits_t;
2844 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
2846 #define _ADCS0 0x01
2847 #define _ADCS1 0x02
2848 #define _ADCS2 0x04
2849 #define _ACQT0 0x08
2850 #define _ACQT1 0x10
2851 #define _ACQT2 0x20
2852 #define _ADFM 0x80
2854 //==============================================================================
2857 //==============================================================================
2858 // ADCON1 Bits
2860 extern __at(0x0FC1) __sfr ADCON1;
2862 typedef union
2864 struct
2866 unsigned PCFG0 : 1;
2867 unsigned PCFG1 : 1;
2868 unsigned PCFG2 : 1;
2869 unsigned PCFG3 : 1;
2870 unsigned VCFG0 : 1;
2871 unsigned VCFG1 : 1;
2872 unsigned : 1;
2873 unsigned : 1;
2876 struct
2878 unsigned PCFG : 4;
2879 unsigned : 4;
2882 struct
2884 unsigned : 4;
2885 unsigned VCFG : 2;
2886 unsigned : 2;
2888 } __ADCON1bits_t;
2890 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
2892 #define _PCFG0 0x01
2893 #define _PCFG1 0x02
2894 #define _PCFG2 0x04
2895 #define _PCFG3 0x08
2896 #define _VCFG0 0x10
2897 #define _VCFG1 0x20
2899 //==============================================================================
2902 //==============================================================================
2903 // ADCON0 Bits
2905 extern __at(0x0FC2) __sfr ADCON0;
2907 typedef union
2909 struct
2911 unsigned ADON : 1;
2912 unsigned GO_NOT_DONE : 1;
2913 unsigned CHS0 : 1;
2914 unsigned CHS1 : 1;
2915 unsigned CHS2 : 1;
2916 unsigned CHS3 : 1;
2917 unsigned : 1;
2918 unsigned : 1;
2921 struct
2923 unsigned : 1;
2924 unsigned GO_DONE : 1;
2925 unsigned : 1;
2926 unsigned : 1;
2927 unsigned : 1;
2928 unsigned : 1;
2929 unsigned : 1;
2930 unsigned : 1;
2933 struct
2935 unsigned : 1;
2936 unsigned DONE : 1;
2937 unsigned : 1;
2938 unsigned : 1;
2939 unsigned : 1;
2940 unsigned : 1;
2941 unsigned : 1;
2942 unsigned : 1;
2945 struct
2947 unsigned : 1;
2948 unsigned GO : 1;
2949 unsigned : 1;
2950 unsigned : 1;
2951 unsigned : 1;
2952 unsigned : 1;
2953 unsigned : 1;
2954 unsigned : 1;
2957 struct
2959 unsigned : 1;
2960 unsigned NOT_DONE : 1;
2961 unsigned : 1;
2962 unsigned : 1;
2963 unsigned : 1;
2964 unsigned : 1;
2965 unsigned : 1;
2966 unsigned : 1;
2969 struct
2971 unsigned : 2;
2972 unsigned CHS : 4;
2973 unsigned : 2;
2975 } __ADCON0bits_t;
2977 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
2979 #define _ADON 0x01
2980 #define _GO_NOT_DONE 0x02
2981 #define _GO_DONE 0x02
2982 #define _DONE 0x02
2983 #define _GO 0x02
2984 #define _NOT_DONE 0x02
2985 #define _CHS0 0x04
2986 #define _CHS1 0x08
2987 #define _CHS2 0x10
2988 #define _CHS3 0x20
2990 //==============================================================================
2992 extern __at(0x0FC3) __sfr ADRES;
2993 extern __at(0x0FC3) __sfr ADRESL;
2994 extern __at(0x0FC4) __sfr ADRESH;
2996 //==============================================================================
2997 // SSPCON2 Bits
2999 extern __at(0x0FC5) __sfr SSPCON2;
3001 typedef struct
3003 unsigned SEN : 1;
3004 unsigned RSEN : 1;
3005 unsigned PEN : 1;
3006 unsigned RCEN : 1;
3007 unsigned ACKEN : 1;
3008 unsigned ACKDT : 1;
3009 unsigned ACKSTAT : 1;
3010 unsigned GCEN : 1;
3011 } __SSPCON2bits_t;
3013 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
3015 #define _SEN 0x01
3016 #define _RSEN 0x02
3017 #define _PEN 0x04
3018 #define _RCEN 0x08
3019 #define _ACKEN 0x10
3020 #define _ACKDT 0x20
3021 #define _ACKSTAT 0x40
3022 #define _GCEN 0x80
3024 //==============================================================================
3027 //==============================================================================
3028 // SSPCON1 Bits
3030 extern __at(0x0FC6) __sfr SSPCON1;
3032 typedef union
3034 struct
3036 unsigned SSPM0 : 1;
3037 unsigned SSPM1 : 1;
3038 unsigned SSPM2 : 1;
3039 unsigned SSPM3 : 1;
3040 unsigned CKP : 1;
3041 unsigned SSPEN : 1;
3042 unsigned SSPOV : 1;
3043 unsigned WCOL : 1;
3046 struct
3048 unsigned SSPM : 4;
3049 unsigned : 4;
3051 } __SSPCON1bits_t;
3053 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
3055 #define _SSPM0 0x01
3056 #define _SSPM1 0x02
3057 #define _SSPM2 0x04
3058 #define _SSPM3 0x08
3059 #define _CKP 0x10
3060 #define _SSPEN 0x20
3061 #define _SSPOV 0x40
3062 #define _WCOL 0x80
3064 //==============================================================================
3067 //==============================================================================
3068 // SSPSTAT Bits
3070 extern __at(0x0FC7) __sfr SSPSTAT;
3072 typedef union
3074 struct
3076 unsigned BF : 1;
3077 unsigned UA : 1;
3078 unsigned R_NOT_W : 1;
3079 unsigned S : 1;
3080 unsigned P : 1;
3081 unsigned D_NOT_A : 1;
3082 unsigned CKE : 1;
3083 unsigned SMP : 1;
3086 struct
3088 unsigned : 1;
3089 unsigned : 1;
3090 unsigned R_W : 1;
3091 unsigned I2C_START : 1;
3092 unsigned I2C_STOP : 1;
3093 unsigned D_A : 1;
3094 unsigned : 1;
3095 unsigned : 1;
3098 struct
3100 unsigned : 1;
3101 unsigned : 1;
3102 unsigned I2C_READ : 1;
3103 unsigned : 1;
3104 unsigned : 1;
3105 unsigned I2C_DAT : 1;
3106 unsigned : 1;
3107 unsigned : 1;
3110 struct
3112 unsigned : 1;
3113 unsigned : 1;
3114 unsigned NOT_W : 1;
3115 unsigned : 1;
3116 unsigned : 1;
3117 unsigned NOT_A : 1;
3118 unsigned : 1;
3119 unsigned : 1;
3122 struct
3124 unsigned : 1;
3125 unsigned : 1;
3126 unsigned NOT_WRITE : 1;
3127 unsigned : 1;
3128 unsigned : 1;
3129 unsigned NOT_ADDRESS : 1;
3130 unsigned : 1;
3131 unsigned : 1;
3134 struct
3136 unsigned : 1;
3137 unsigned : 1;
3138 unsigned READ_WRITE : 1;
3139 unsigned : 1;
3140 unsigned : 1;
3141 unsigned DATA_ADDRESS : 1;
3142 unsigned : 1;
3143 unsigned : 1;
3146 struct
3148 unsigned : 1;
3149 unsigned : 1;
3150 unsigned R : 1;
3151 unsigned : 1;
3152 unsigned : 1;
3153 unsigned D : 1;
3154 unsigned : 1;
3155 unsigned : 1;
3157 } __SSPSTATbits_t;
3159 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
3161 #define _BF 0x01
3162 #define _UA 0x02
3163 #define _R_NOT_W 0x04
3164 #define _R_W 0x04
3165 #define _I2C_READ 0x04
3166 #define _NOT_W 0x04
3167 #define _NOT_WRITE 0x04
3168 #define _READ_WRITE 0x04
3169 #define _R 0x04
3170 #define _S 0x08
3171 #define _I2C_START 0x08
3172 #define _P 0x10
3173 #define _I2C_STOP 0x10
3174 #define _D_NOT_A 0x20
3175 #define _D_A 0x20
3176 #define _I2C_DAT 0x20
3177 #define _NOT_A 0x20
3178 #define _NOT_ADDRESS 0x20
3179 #define _DATA_ADDRESS 0x20
3180 #define _D 0x20
3181 #define _CKE 0x40
3182 #define _SMP 0x80
3184 //==============================================================================
3186 extern __at(0x0FC8) __sfr SSPADD;
3187 extern __at(0x0FC9) __sfr SSPBUF;
3189 //==============================================================================
3190 // T2CON Bits
3192 extern __at(0x0FCA) __sfr T2CON;
3194 typedef union
3196 struct
3198 unsigned T2CKPS0 : 1;
3199 unsigned T2CKPS1 : 1;
3200 unsigned TMR2ON : 1;
3201 unsigned T2OUTPS0 : 1;
3202 unsigned T2OUTPS1 : 1;
3203 unsigned T2OUTPS2 : 1;
3204 unsigned T2OUTPS3 : 1;
3205 unsigned : 1;
3208 struct
3210 unsigned T2CKPS : 2;
3211 unsigned : 6;
3214 struct
3216 unsigned : 3;
3217 unsigned T2OUTPS : 4;
3218 unsigned : 1;
3220 } __T2CONbits_t;
3222 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
3224 #define _T2CKPS0 0x01
3225 #define _T2CKPS1 0x02
3226 #define _TMR2ON 0x04
3227 #define _T2OUTPS0 0x08
3228 #define _T2OUTPS1 0x10
3229 #define _T2OUTPS2 0x20
3230 #define _T2OUTPS3 0x40
3232 //==============================================================================
3234 extern __at(0x0FCB) __sfr PR2;
3235 extern __at(0x0FCC) __sfr TMR2;
3237 //==============================================================================
3238 // T1CON Bits
3240 extern __at(0x0FCD) __sfr T1CON;
3242 typedef union
3244 struct
3246 unsigned TMR1ON : 1;
3247 unsigned TMR1CS : 1;
3248 unsigned NOT_T1SYNC : 1;
3249 unsigned T1OSCEN : 1;
3250 unsigned T1CKPS0 : 1;
3251 unsigned T1CKPS1 : 1;
3252 unsigned T1RUN : 1;
3253 unsigned RD16 : 1;
3256 struct
3258 unsigned : 1;
3259 unsigned : 1;
3260 unsigned T1INSYNC : 1;
3261 unsigned : 1;
3262 unsigned : 1;
3263 unsigned : 1;
3264 unsigned : 1;
3265 unsigned : 1;
3268 struct
3270 unsigned : 1;
3271 unsigned : 1;
3272 unsigned T1SYNC : 1;
3273 unsigned : 1;
3274 unsigned : 1;
3275 unsigned : 1;
3276 unsigned : 1;
3277 unsigned : 1;
3280 struct
3282 unsigned : 4;
3283 unsigned T1CKPS : 2;
3284 unsigned : 2;
3286 } __T1CONbits_t;
3288 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
3290 #define _TMR1ON 0x01
3291 #define _TMR1CS 0x02
3292 #define _NOT_T1SYNC 0x04
3293 #define _T1INSYNC 0x04
3294 #define _T1SYNC 0x04
3295 #define _T1OSCEN 0x08
3296 #define _T1CKPS0 0x10
3297 #define _T1CKPS1 0x20
3298 #define _T1RUN 0x40
3299 #define _RD16 0x80
3301 //==============================================================================
3303 extern __at(0x0FCE) __sfr TMR1;
3304 extern __at(0x0FCE) __sfr TMR1L;
3305 extern __at(0x0FCF) __sfr TMR1H;
3307 //==============================================================================
3308 // RCON Bits
3310 extern __at(0x0FD0) __sfr RCON;
3312 typedef union
3314 struct
3316 unsigned NOT_BOR : 1;
3317 unsigned NOT_POR : 1;
3318 unsigned NOT_PD : 1;
3319 unsigned NOT_TO : 1;
3320 unsigned NOT_RI : 1;
3321 unsigned : 1;
3322 unsigned SBOREN : 1;
3323 unsigned IPEN : 1;
3326 struct
3328 unsigned BOR : 1;
3329 unsigned POR : 1;
3330 unsigned PD : 1;
3331 unsigned TO : 1;
3332 unsigned RI : 1;
3333 unsigned : 1;
3334 unsigned : 1;
3335 unsigned : 1;
3337 } __RCONbits_t;
3339 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
3341 #define _NOT_BOR 0x01
3342 #define _BOR 0x01
3343 #define _NOT_POR 0x02
3344 #define _POR 0x02
3345 #define _NOT_PD 0x04
3346 #define _PD 0x04
3347 #define _NOT_TO 0x08
3348 #define _TO 0x08
3349 #define _NOT_RI 0x10
3350 #define _RI 0x10
3351 #define _SBOREN 0x40
3352 #define _IPEN 0x80
3354 //==============================================================================
3357 //==============================================================================
3358 // WDTCON Bits
3360 extern __at(0x0FD1) __sfr WDTCON;
3362 typedef union
3364 struct
3366 unsigned SWDTEN : 1;
3367 unsigned : 1;
3368 unsigned : 1;
3369 unsigned : 1;
3370 unsigned : 1;
3371 unsigned : 1;
3372 unsigned : 1;
3373 unsigned : 1;
3376 struct
3378 unsigned SWDTE : 1;
3379 unsigned : 1;
3380 unsigned : 1;
3381 unsigned : 1;
3382 unsigned : 1;
3383 unsigned : 1;
3384 unsigned : 1;
3385 unsigned : 1;
3387 } __WDTCONbits_t;
3389 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
3391 #define _SWDTEN 0x01
3392 #define _SWDTE 0x01
3394 //==============================================================================
3397 //==============================================================================
3398 // HLVDCON Bits
3400 extern __at(0x0FD2) __sfr HLVDCON;
3402 typedef union
3404 struct
3406 unsigned HLVDL0 : 1;
3407 unsigned HLVDL1 : 1;
3408 unsigned HLVDL2 : 1;
3409 unsigned HLVDL3 : 1;
3410 unsigned HLVDEN : 1;
3411 unsigned IRVST : 1;
3412 unsigned : 1;
3413 unsigned VDIRMAG : 1;
3416 struct
3418 unsigned LVDL0 : 1;
3419 unsigned LVDL1 : 1;
3420 unsigned LVDL2 : 1;
3421 unsigned LVDL3 : 1;
3422 unsigned LVDEN : 1;
3423 unsigned BGST : 1;
3424 unsigned : 1;
3425 unsigned : 1;
3428 struct
3430 unsigned LVV0 : 1;
3431 unsigned LVV1 : 1;
3432 unsigned LVV2 : 1;
3433 unsigned LVV3 : 1;
3434 unsigned : 1;
3435 unsigned : 1;
3436 unsigned : 1;
3437 unsigned : 1;
3440 struct
3442 unsigned HLVDL : 4;
3443 unsigned : 4;
3446 struct
3448 unsigned LVV : 4;
3449 unsigned : 4;
3452 struct
3454 unsigned LVDL : 4;
3455 unsigned : 4;
3457 } __HLVDCONbits_t;
3459 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
3461 #define _HLVDL0 0x01
3462 #define _LVDL0 0x01
3463 #define _LVV0 0x01
3464 #define _HLVDL1 0x02
3465 #define _LVDL1 0x02
3466 #define _LVV1 0x02
3467 #define _HLVDL2 0x04
3468 #define _LVDL2 0x04
3469 #define _LVV2 0x04
3470 #define _HLVDL3 0x08
3471 #define _LVDL3 0x08
3472 #define _LVV3 0x08
3473 #define _HLVDEN 0x10
3474 #define _LVDEN 0x10
3475 #define _IRVST 0x20
3476 #define _BGST 0x20
3477 #define _VDIRMAG 0x80
3479 //==============================================================================
3482 //==============================================================================
3483 // LVDCON Bits
3485 extern __at(0x0FD2) __sfr LVDCON;
3487 typedef union
3489 struct
3491 unsigned HLVDL0 : 1;
3492 unsigned HLVDL1 : 1;
3493 unsigned HLVDL2 : 1;
3494 unsigned HLVDL3 : 1;
3495 unsigned HLVDEN : 1;
3496 unsigned IRVST : 1;
3497 unsigned : 1;
3498 unsigned VDIRMAG : 1;
3501 struct
3503 unsigned LVDL0 : 1;
3504 unsigned LVDL1 : 1;
3505 unsigned LVDL2 : 1;
3506 unsigned LVDL3 : 1;
3507 unsigned LVDEN : 1;
3508 unsigned BGST : 1;
3509 unsigned : 1;
3510 unsigned : 1;
3513 struct
3515 unsigned LVV0 : 1;
3516 unsigned LVV1 : 1;
3517 unsigned LVV2 : 1;
3518 unsigned LVV3 : 1;
3519 unsigned : 1;
3520 unsigned : 1;
3521 unsigned : 1;
3522 unsigned : 1;
3525 struct
3527 unsigned LVV : 4;
3528 unsigned : 4;
3531 struct
3533 unsigned LVDL : 4;
3534 unsigned : 4;
3537 struct
3539 unsigned HLVDL : 4;
3540 unsigned : 4;
3542 } __LVDCONbits_t;
3544 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
3546 #define _LVDCON_HLVDL0 0x01
3547 #define _LVDCON_LVDL0 0x01
3548 #define _LVDCON_LVV0 0x01
3549 #define _LVDCON_HLVDL1 0x02
3550 #define _LVDCON_LVDL1 0x02
3551 #define _LVDCON_LVV1 0x02
3552 #define _LVDCON_HLVDL2 0x04
3553 #define _LVDCON_LVDL2 0x04
3554 #define _LVDCON_LVV2 0x04
3555 #define _LVDCON_HLVDL3 0x08
3556 #define _LVDCON_LVDL3 0x08
3557 #define _LVDCON_LVV3 0x08
3558 #define _LVDCON_HLVDEN 0x10
3559 #define _LVDCON_LVDEN 0x10
3560 #define _LVDCON_IRVST 0x20
3561 #define _LVDCON_BGST 0x20
3562 #define _LVDCON_VDIRMAG 0x80
3564 //==============================================================================
3567 //==============================================================================
3568 // OSCCON Bits
3570 extern __at(0x0FD3) __sfr OSCCON;
3572 typedef union
3574 struct
3576 unsigned SCS0 : 1;
3577 unsigned SCS1 : 1;
3578 unsigned IOFS : 1;
3579 unsigned OSTS : 1;
3580 unsigned IRCF0 : 1;
3581 unsigned IRCF1 : 1;
3582 unsigned IRCF2 : 1;
3583 unsigned IDLEN : 1;
3586 struct
3588 unsigned : 1;
3589 unsigned : 1;
3590 unsigned FLTS : 1;
3591 unsigned : 1;
3592 unsigned : 1;
3593 unsigned : 1;
3594 unsigned : 1;
3595 unsigned : 1;
3598 struct
3600 unsigned SCS : 2;
3601 unsigned : 6;
3604 struct
3606 unsigned : 4;
3607 unsigned IRCF : 3;
3608 unsigned : 1;
3610 } __OSCCONbits_t;
3612 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
3614 #define _SCS0 0x01
3615 #define _SCS1 0x02
3616 #define _IOFS 0x04
3617 #define _FLTS 0x04
3618 #define _OSTS 0x08
3619 #define _IRCF0 0x10
3620 #define _IRCF1 0x20
3621 #define _IRCF2 0x40
3622 #define _IDLEN 0x80
3624 //==============================================================================
3627 //==============================================================================
3628 // T0CON Bits
3630 extern __at(0x0FD5) __sfr T0CON;
3632 typedef union
3634 struct
3636 unsigned T0PS0 : 1;
3637 unsigned T0PS1 : 1;
3638 unsigned T0PS2 : 1;
3639 unsigned PSA : 1;
3640 unsigned T0SE : 1;
3641 unsigned T0CS : 1;
3642 unsigned T08BIT : 1;
3643 unsigned TMR0ON : 1;
3646 struct
3648 unsigned T0PS : 3;
3649 unsigned : 5;
3651 } __T0CONbits_t;
3653 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
3655 #define _T0PS0 0x01
3656 #define _T0PS1 0x02
3657 #define _T0PS2 0x04
3658 #define _PSA 0x08
3659 #define _T0SE 0x10
3660 #define _T0CS 0x20
3661 #define _T08BIT 0x40
3662 #define _TMR0ON 0x80
3664 //==============================================================================
3666 extern __at(0x0FD6) __sfr TMR0;
3667 extern __at(0x0FD6) __sfr TMR0L;
3668 extern __at(0x0FD7) __sfr TMR0H;
3670 //==============================================================================
3671 // STATUS Bits
3673 extern __at(0x0FD8) __sfr STATUS;
3675 typedef struct
3677 unsigned C : 1;
3678 unsigned DC : 1;
3679 unsigned Z : 1;
3680 unsigned OV : 1;
3681 unsigned N : 1;
3682 unsigned : 1;
3683 unsigned : 1;
3684 unsigned : 1;
3685 } __STATUSbits_t;
3687 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3689 #define _C 0x01
3690 #define _DC 0x02
3691 #define _Z 0x04
3692 #define _OV 0x08
3693 #define _N 0x10
3695 //==============================================================================
3697 extern __at(0x0FD9) __sfr FSR2L;
3698 extern __at(0x0FDA) __sfr FSR2H;
3699 extern __at(0x0FDB) __sfr PLUSW2;
3700 extern __at(0x0FDC) __sfr PREINC2;
3701 extern __at(0x0FDD) __sfr POSTDEC2;
3702 extern __at(0x0FDE) __sfr POSTINC2;
3703 extern __at(0x0FDF) __sfr INDF2;
3704 extern __at(0x0FE0) __sfr BSR;
3705 extern __at(0x0FE1) __sfr FSR1L;
3706 extern __at(0x0FE2) __sfr FSR1H;
3707 extern __at(0x0FE3) __sfr PLUSW1;
3708 extern __at(0x0FE4) __sfr PREINC1;
3709 extern __at(0x0FE5) __sfr POSTDEC1;
3710 extern __at(0x0FE6) __sfr POSTINC1;
3711 extern __at(0x0FE7) __sfr INDF1;
3712 extern __at(0x0FE8) __sfr WREG;
3713 extern __at(0x0FE9) __sfr FSR0L;
3714 extern __at(0x0FEA) __sfr FSR0H;
3715 extern __at(0x0FEB) __sfr PLUSW0;
3716 extern __at(0x0FEC) __sfr PREINC0;
3717 extern __at(0x0FED) __sfr POSTDEC0;
3718 extern __at(0x0FEE) __sfr POSTINC0;
3719 extern __at(0x0FEF) __sfr INDF0;
3721 //==============================================================================
3722 // INTCON3 Bits
3724 extern __at(0x0FF0) __sfr INTCON3;
3726 typedef union
3728 struct
3730 unsigned INT1IF : 1;
3731 unsigned INT2IF : 1;
3732 unsigned INT3IF : 1;
3733 unsigned INT1IE : 1;
3734 unsigned INT2IE : 1;
3735 unsigned INT3IE : 1;
3736 unsigned INT1IP : 1;
3737 unsigned INT2IP : 1;
3740 struct
3742 unsigned INT1F : 1;
3743 unsigned INT2F : 1;
3744 unsigned INT3F : 1;
3745 unsigned INT1E : 1;
3746 unsigned INT2E : 1;
3747 unsigned INT3E : 1;
3748 unsigned INT1P : 1;
3749 unsigned INT2P : 1;
3751 } __INTCON3bits_t;
3753 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3755 #define _INT1IF 0x01
3756 #define _INT1F 0x01
3757 #define _INT2IF 0x02
3758 #define _INT2F 0x02
3759 #define _INT3IF 0x04
3760 #define _INT3F 0x04
3761 #define _INT1IE 0x08
3762 #define _INT1E 0x08
3763 #define _INT2IE 0x10
3764 #define _INT2E 0x10
3765 #define _INT3IE 0x20
3766 #define _INT3E 0x20
3767 #define _INT1IP 0x40
3768 #define _INT1P 0x40
3769 #define _INT2IP 0x80
3770 #define _INT2P 0x80
3772 //==============================================================================
3775 //==============================================================================
3776 // INTCON2 Bits
3778 extern __at(0x0FF1) __sfr INTCON2;
3780 typedef union
3782 struct
3784 unsigned RBIP : 1;
3785 unsigned INT3IP : 1;
3786 unsigned TMR0IP : 1;
3787 unsigned INTEDG3 : 1;
3788 unsigned INTEDG2 : 1;
3789 unsigned INTEDG1 : 1;
3790 unsigned INTEDG0 : 1;
3791 unsigned NOT_RBPU : 1;
3794 struct
3796 unsigned : 1;
3797 unsigned INT3P : 1;
3798 unsigned T0IP : 1;
3799 unsigned : 1;
3800 unsigned : 1;
3801 unsigned : 1;
3802 unsigned : 1;
3803 unsigned RBPU : 1;
3805 } __INTCON2bits_t;
3807 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3809 #define _RBIP 0x01
3810 #define _INT3IP 0x02
3811 #define _INT3P 0x02
3812 #define _TMR0IP 0x04
3813 #define _T0IP 0x04
3814 #define _INTEDG3 0x08
3815 #define _INTEDG2 0x10
3816 #define _INTEDG1 0x20
3817 #define _INTEDG0 0x40
3818 #define _NOT_RBPU 0x80
3819 #define _RBPU 0x80
3821 //==============================================================================
3824 //==============================================================================
3825 // INTCON Bits
3827 extern __at(0x0FF2) __sfr INTCON;
3829 typedef union
3831 struct
3833 unsigned RBIF : 1;
3834 unsigned INT0IF : 1;
3835 unsigned TMR0IF : 1;
3836 unsigned RBIE : 1;
3837 unsigned INT0IE : 1;
3838 unsigned TMR0IE : 1;
3839 unsigned PEIE_GIEL : 1;
3840 unsigned GIE_GIEH : 1;
3843 struct
3845 unsigned : 1;
3846 unsigned INT0F : 1;
3847 unsigned T0IF : 1;
3848 unsigned : 1;
3849 unsigned INT0E : 1;
3850 unsigned T0IE : 1;
3851 unsigned PEIE : 1;
3852 unsigned GIE : 1;
3855 struct
3857 unsigned : 1;
3858 unsigned : 1;
3859 unsigned : 1;
3860 unsigned : 1;
3861 unsigned : 1;
3862 unsigned : 1;
3863 unsigned GIEL : 1;
3864 unsigned GIEH : 1;
3866 } __INTCONbits_t;
3868 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3870 #define _RBIF 0x01
3871 #define _INT0IF 0x02
3872 #define _INT0F 0x02
3873 #define _TMR0IF 0x04
3874 #define _T0IF 0x04
3875 #define _RBIE 0x08
3876 #define _INT0IE 0x10
3877 #define _INT0E 0x10
3878 #define _TMR0IE 0x20
3879 #define _T0IE 0x20
3880 #define _PEIE_GIEL 0x40
3881 #define _PEIE 0x40
3882 #define _GIEL 0x40
3883 #define _GIE_GIEH 0x80
3884 #define _GIE 0x80
3885 #define _GIEH 0x80
3887 //==============================================================================
3889 extern __at(0x0FF3) __sfr PROD;
3890 extern __at(0x0FF3) __sfr PRODL;
3891 extern __at(0x0FF4) __sfr PRODH;
3892 extern __at(0x0FF5) __sfr TABLAT;
3893 extern __at(0x0FF6) __sfr TBLPTR;
3894 extern __at(0x0FF6) __sfr TBLPTRL;
3895 extern __at(0x0FF7) __sfr TBLPTRH;
3896 extern __at(0x0FF8) __sfr TBLPTRU;
3897 extern __at(0x0FF9) __sfr PC;
3898 extern __at(0x0FF9) __sfr PCL;
3899 extern __at(0x0FFA) __sfr PCLATH;
3900 extern __at(0x0FFB) __sfr PCLATU;
3902 //==============================================================================
3903 // STKPTR Bits
3905 extern __at(0x0FFC) __sfr STKPTR;
3907 typedef union
3909 struct
3911 unsigned STKPTR0 : 1;
3912 unsigned STKPTR1 : 1;
3913 unsigned STKPTR2 : 1;
3914 unsigned STKPTR3 : 1;
3915 unsigned STKPTR4 : 1;
3916 unsigned : 1;
3917 unsigned STKUNF : 1;
3918 unsigned STKFUL : 1;
3921 struct
3923 unsigned : 1;
3924 unsigned : 1;
3925 unsigned : 1;
3926 unsigned : 1;
3927 unsigned : 1;
3928 unsigned : 1;
3929 unsigned : 1;
3930 unsigned STKOVF : 1;
3933 struct
3935 unsigned STKPTR : 5;
3936 unsigned : 3;
3938 } __STKPTRbits_t;
3940 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
3942 #define _STKPTR0 0x01
3943 #define _STKPTR1 0x02
3944 #define _STKPTR2 0x04
3945 #define _STKPTR3 0x08
3946 #define _STKPTR4 0x10
3947 #define _STKUNF 0x40
3948 #define _STKFUL 0x80
3949 #define _STKOVF 0x80
3951 //==============================================================================
3953 extern __at(0x0FFD) __sfr TOS;
3954 extern __at(0x0FFD) __sfr TOSL;
3955 extern __at(0x0FFE) __sfr TOSH;
3956 extern __at(0x0FFF) __sfr TOSU;
3958 //==============================================================================
3960 // Configuration Bits
3962 //==============================================================================
3964 #define __CONFIG1H 0x300001
3965 #define __CONFIG2L 0x300002
3966 #define __CONFIG2H 0x300003
3967 #define __CONFIG3L 0x300004
3968 #define __CONFIG3H 0x300005
3969 #define __CONFIG4L 0x300006
3970 #define __CONFIG5L 0x300008
3971 #define __CONFIG7L 0x30000C
3973 //----------------------------- CONFIG1H Options -------------------------------
3975 #define _OSC_LP_1H 0xF0 // LP oscillator.
3976 #define _OSC_XT_1H 0xF1 // XT oscillator.
3977 #define _OSC_HS_1H 0xF2 // HS oscillator.
3978 #define _OSC_RC_1H 0xF3 // External RC oscillator, CLKO function on RA6.
3979 #define _OSC_EC_1H 0xF4 // EC oscillator, CLKO function on RA6.
3980 #define _OSC_ECIO_1H 0xF5 // EC oscillator, port function on RA6.
3981 #define _OSC_HSPLL_1H 0xF6 // HS oscillator, PLL enabled (clock frequency = 4 x FOSC1).
3982 #define _OSC_RCIO_1H 0xF7 // External RC oscillator, port function on RA6.
3983 #define _OSC_INTIO67_1H 0xF8 // Internal oscillator block, port function on RA6 and RA7.
3984 #define _OSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKO function on RA6, port function on RA7.
3985 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
3986 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
3987 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
3988 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
3990 //----------------------------- CONFIG2L Options -------------------------------
3992 #define _PWRT_ON_2L 0xFE // PWRT enabled.
3993 #define _PWRT_OFF_2L 0xFF // PWRT disabled.
3994 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
3995 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
3996 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
3997 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
3998 #define _BORV_0_2L 0xE7 // VBOR set to 4.6V.
3999 #define _BORV_1_2L 0xEF // VBOR set to 4.3V.
4000 #define _BORV_2_2L 0xF7 // VBOR set to 2.8V.
4001 #define _BORV_3_2L 0xFF // VBOR set to 2.1V.
4003 //----------------------------- CONFIG2H Options -------------------------------
4005 #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
4006 #define _WDT_ON_2H 0xFF // WDT enabled.
4007 #define _WDTPS_1_2H 0xE1 // 1:1.
4008 #define _WDTPS_2_2H 0xE3 // 1:2.
4009 #define _WDTPS_4_2H 0xE5 // 1:4.
4010 #define _WDTPS_8_2H 0xE7 // 1:8.
4011 #define _WDTPS_16_2H 0xE9 // 1:16.
4012 #define _WDTPS_32_2H 0xEB // 1:32.
4013 #define _WDTPS_64_2H 0xED // 1:64.
4014 #define _WDTPS_128_2H 0xEF // 1:128.
4015 #define _WDTPS_256_2H 0xF1 // 1:256.
4016 #define _WDTPS_512_2H 0xF3 // 1:512.
4017 #define _WDTPS_1024_2H 0xF5 // 1:1024.
4018 #define _WDTPS_2048_2H 0xF7 // 1:2048.
4019 #define _WDTPS_4096_2H 0xF9 // 1:4096.
4020 #define _WDTPS_8192_2H 0xFB // 1:8192.
4021 #define _WDTPS_16384_2H 0xFD // 1:16384.
4022 #define _WDTPS_32768_2H 0xFF // 1:32768.
4024 //----------------------------- CONFIG3L Options -------------------------------
4026 #define _CCP2MX_PORTE_3H 0xFE // CCP2 input/output is multiplexed with RE7.
4027 #define _CCP2MX_PORTC_3H 0xFF // CCP2 input/output is multiplexed with RC1.
4028 #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
4029 #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
4030 #define _MCLRE_OFF_3H 0x7F // RG5 input pin enabled; MCLR disabled.
4031 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RG5 input pin disabled.
4033 //----------------------------- CONFIG3H Options -------------------------------
4035 #define _CCP2MX_PORTE_3H 0xFE // CCP2 input/output is multiplexed with RE7.
4036 #define _CCP2MX_PORTC_3H 0xFF // CCP2 input/output is multiplexed with RC1.
4037 #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
4038 #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
4039 #define _MCLRE_OFF_3H 0x7F // RG5 input pin enabled; MCLR disabled.
4040 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RG5 input pin disabled.
4042 //----------------------------- CONFIG4L Options -------------------------------
4044 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
4045 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
4046 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
4047 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
4048 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
4049 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
4051 //----------------------------- CONFIG5L Options -------------------------------
4053 #define _CP_ON_5L 0xFE // Program memory block code-protected.
4054 #define _CP_OFF_5L 0xFF // Program memory block not code-protected.
4056 //==============================================================================
4058 #define __DEVID1 0x3FFFFE
4059 #define __DEVID2 0x3FFFFF
4061 #define __IDLOC0 0x200000
4062 #define __IDLOC1 0x200001
4063 #define __IDLOC2 0x200002
4064 #define __IDLOC3 0x200003
4065 #define __IDLOC4 0x200004
4066 #define __IDLOC5 0x200005
4067 #define __IDLOC6 0x200006
4068 #define __IDLOC7 0x200007
4070 #endif // #ifndef __PIC18F6410_H__