struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f8310.h
blob32e0bac8b353dd8cce6720224a260fc80466c6b9
1 /*
2 * This declarations of the PIC18F8310 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:51 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 __PIC18F8310_H__
26 #define __PIC18F8310_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;
561 struct
563 unsigned AD0 : 1;
564 unsigned AD1 : 1;
565 unsigned AD2 : 1;
566 unsigned AD3 : 1;
567 unsigned AD4 : 1;
568 unsigned AD5 : 1;
569 unsigned AD6 : 1;
570 unsigned AD7 : 1;
572 } __PORTDbits_t;
574 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
576 #define _PORTD_RD0 0x01
577 #define _PORTD_PSP0 0x01
578 #define _PORTD_AD0 0x01
579 #define _PORTD_RD1 0x02
580 #define _PORTD_PSP1 0x02
581 #define _PORTD_AD1 0x02
582 #define _PORTD_RD2 0x04
583 #define _PORTD_PSP2 0x04
584 #define _PORTD_AD2 0x04
585 #define _PORTD_RD3 0x08
586 #define _PORTD_PSP3 0x08
587 #define _PORTD_AD3 0x08
588 #define _PORTD_RD4 0x10
589 #define _PORTD_PSP4 0x10
590 #define _PORTD_AD4 0x10
591 #define _PORTD_RD5 0x20
592 #define _PORTD_PSP5 0x20
593 #define _PORTD_AD5 0x20
594 #define _PORTD_RD6 0x40
595 #define _PORTD_PSP6 0x40
596 #define _PORTD_AD6 0x40
597 #define _PORTD_RD7 0x80
598 #define _PORTD_PSP7 0x80
599 #define _PORTD_AD7 0x80
601 //==============================================================================
604 //==============================================================================
605 // PORTE Bits
607 extern __at(0x0F84) __sfr PORTE;
609 typedef union
611 struct
613 unsigned RE0 : 1;
614 unsigned RE1 : 1;
615 unsigned RE2 : 1;
616 unsigned RE3 : 1;
617 unsigned RE4 : 1;
618 unsigned RE5 : 1;
619 unsigned RE6 : 1;
620 unsigned RE7 : 1;
623 struct
625 unsigned RD : 1;
626 unsigned WR : 1;
627 unsigned CS : 1;
628 unsigned AD11 : 1;
629 unsigned AD12 : 1;
630 unsigned AD13 : 1;
631 unsigned AD14 : 1;
632 unsigned CCP2E : 1;
635 struct
637 unsigned AD8 : 1;
638 unsigned AD9 : 1;
639 unsigned AD10 : 1;
640 unsigned : 1;
641 unsigned : 1;
642 unsigned : 1;
643 unsigned : 1;
644 unsigned AD15 : 1;
646 } __PORTEbits_t;
648 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
650 #define _PORTE_RE0 0x01
651 #define _PORTE_RD 0x01
652 #define _PORTE_AD8 0x01
653 #define _PORTE_RE1 0x02
654 #define _PORTE_WR 0x02
655 #define _PORTE_AD9 0x02
656 #define _PORTE_RE2 0x04
657 #define _PORTE_CS 0x04
658 #define _PORTE_AD10 0x04
659 #define _PORTE_RE3 0x08
660 #define _PORTE_AD11 0x08
661 #define _PORTE_RE4 0x10
662 #define _PORTE_AD12 0x10
663 #define _PORTE_RE5 0x20
664 #define _PORTE_AD13 0x20
665 #define _PORTE_RE6 0x40
666 #define _PORTE_AD14 0x40
667 #define _PORTE_RE7 0x80
668 #define _PORTE_CCP2E 0x80
669 #define _PORTE_AD15 0x80
671 //==============================================================================
674 //==============================================================================
675 // PORTF Bits
677 extern __at(0x0F85) __sfr PORTF;
679 typedef union
681 struct
683 unsigned RF0 : 1;
684 unsigned RF1 : 1;
685 unsigned RF2 : 1;
686 unsigned RF3 : 1;
687 unsigned RF4 : 1;
688 unsigned RF5 : 1;
689 unsigned RF6 : 1;
690 unsigned RF7 : 1;
693 struct
695 unsigned AN5 : 1;
696 unsigned AN6 : 1;
697 unsigned AN7 : 1;
698 unsigned AN8 : 1;
699 unsigned AN9 : 1;
700 unsigned AN10 : 1;
701 unsigned AN11 : 1;
702 unsigned SS : 1;
705 struct
707 unsigned : 1;
708 unsigned C2OUTF : 1;
709 unsigned C1OUTF : 1;
710 unsigned : 1;
711 unsigned : 1;
712 unsigned CVREFF : 1;
713 unsigned : 1;
714 unsigned : 1;
716 } __PORTFbits_t;
718 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
720 #define _PORTF_RF0 0x01
721 #define _PORTF_AN5 0x01
722 #define _PORTF_RF1 0x02
723 #define _PORTF_AN6 0x02
724 #define _PORTF_C2OUTF 0x02
725 #define _PORTF_RF2 0x04
726 #define _PORTF_AN7 0x04
727 #define _PORTF_C1OUTF 0x04
728 #define _PORTF_RF3 0x08
729 #define _PORTF_AN8 0x08
730 #define _PORTF_RF4 0x10
731 #define _PORTF_AN9 0x10
732 #define _PORTF_RF5 0x20
733 #define _PORTF_AN10 0x20
734 #define _PORTF_CVREFF 0x20
735 #define _PORTF_RF6 0x40
736 #define _PORTF_AN11 0x40
737 #define _PORTF_RF7 0x80
738 #define _PORTF_SS 0x80
740 //==============================================================================
743 //==============================================================================
744 // PORTG Bits
746 extern __at(0x0F86) __sfr PORTG;
748 typedef union
750 struct
752 unsigned RG0 : 1;
753 unsigned RG1 : 1;
754 unsigned RG2 : 1;
755 unsigned RG3 : 1;
756 unsigned RG4 : 1;
757 unsigned RG5 : 1;
758 unsigned : 1;
759 unsigned : 1;
762 struct
764 unsigned CCP3 : 1;
765 unsigned TX2 : 1;
766 unsigned RX2 : 1;
767 unsigned : 1;
768 unsigned : 1;
769 unsigned MCLR : 1;
770 unsigned : 1;
771 unsigned : 1;
774 struct
776 unsigned : 1;
777 unsigned CK2 : 1;
778 unsigned DT2 : 1;
779 unsigned : 1;
780 unsigned : 1;
781 unsigned VPP : 1;
782 unsigned : 1;
783 unsigned : 1;
786 struct
788 unsigned RG : 6;
789 unsigned : 2;
791 } __PORTGbits_t;
793 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
795 #define _PORTG_RG0 0x01
796 #define _PORTG_CCP3 0x01
797 #define _PORTG_RG1 0x02
798 #define _PORTG_TX2 0x02
799 #define _PORTG_CK2 0x02
800 #define _PORTG_RG2 0x04
801 #define _PORTG_RX2 0x04
802 #define _PORTG_DT2 0x04
803 #define _PORTG_RG3 0x08
804 #define _PORTG_RG4 0x10
805 #define _PORTG_RG5 0x20
806 #define _PORTG_MCLR 0x20
807 #define _PORTG_VPP 0x20
809 //==============================================================================
812 //==============================================================================
813 // PORTH Bits
815 extern __at(0x0F87) __sfr PORTH;
817 typedef union
819 struct
821 unsigned RH0 : 1;
822 unsigned RH1 : 1;
823 unsigned RH2 : 1;
824 unsigned RH3 : 1;
825 unsigned RH4 : 1;
826 unsigned RH5 : 1;
827 unsigned RH6 : 1;
828 unsigned RH7 : 1;
831 struct
833 unsigned A16 : 1;
834 unsigned A17 : 1;
835 unsigned A18 : 1;
836 unsigned A19 : 1;
837 unsigned : 1;
838 unsigned : 1;
839 unsigned : 1;
840 unsigned : 1;
842 } __PORTHbits_t;
844 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
846 #define _PORTH_RH0 0x01
847 #define _PORTH_A16 0x01
848 #define _PORTH_RH1 0x02
849 #define _PORTH_A17 0x02
850 #define _PORTH_RH2 0x04
851 #define _PORTH_A18 0x04
852 #define _PORTH_RH3 0x08
853 #define _PORTH_A19 0x08
854 #define _PORTH_RH4 0x10
855 #define _PORTH_RH5 0x20
856 #define _PORTH_RH6 0x40
857 #define _PORTH_RH7 0x80
859 //==============================================================================
862 //==============================================================================
863 // PORTJ Bits
865 extern __at(0x0F88) __sfr PORTJ;
867 typedef union
869 struct
871 unsigned RJ0 : 1;
872 unsigned RJ1 : 1;
873 unsigned RJ2 : 1;
874 unsigned RJ3 : 1;
875 unsigned RJ4 : 1;
876 unsigned RJ5 : 1;
877 unsigned RJ6 : 1;
878 unsigned RJ7 : 1;
881 struct
883 unsigned ALE : 1;
884 unsigned OE : 1;
885 unsigned WRL : 1;
886 unsigned WRH : 1;
887 unsigned BA0 : 1;
888 unsigned CE : 1;
889 unsigned LB : 1;
890 unsigned UB : 1;
892 } __PORTJbits_t;
894 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
896 #define _PORTJ_RJ0 0x01
897 #define _PORTJ_ALE 0x01
898 #define _PORTJ_RJ1 0x02
899 #define _PORTJ_OE 0x02
900 #define _PORTJ_RJ2 0x04
901 #define _PORTJ_WRL 0x04
902 #define _PORTJ_RJ3 0x08
903 #define _PORTJ_WRH 0x08
904 #define _PORTJ_RJ4 0x10
905 #define _PORTJ_BA0 0x10
906 #define _PORTJ_RJ5 0x20
907 #define _PORTJ_CE 0x20
908 #define _PORTJ_RJ6 0x40
909 #define _PORTJ_LB 0x40
910 #define _PORTJ_RJ7 0x80
911 #define _PORTJ_UB 0x80
913 //==============================================================================
916 //==============================================================================
917 // LATA Bits
919 extern __at(0x0F89) __sfr LATA;
921 typedef struct
923 unsigned LATA0 : 1;
924 unsigned LATA1 : 1;
925 unsigned LATA2 : 1;
926 unsigned LATA3 : 1;
927 unsigned LATA4 : 1;
928 unsigned LATA5 : 1;
929 unsigned LATA6 : 1;
930 unsigned LATA7 : 1;
931 } __LATAbits_t;
933 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
935 #define _LATA0 0x01
936 #define _LATA1 0x02
937 #define _LATA2 0x04
938 #define _LATA3 0x08
939 #define _LATA4 0x10
940 #define _LATA5 0x20
941 #define _LATA6 0x40
942 #define _LATA7 0x80
944 //==============================================================================
947 //==============================================================================
948 // LATB Bits
950 extern __at(0x0F8A) __sfr LATB;
952 typedef struct
954 unsigned LATB0 : 1;
955 unsigned LATB1 : 1;
956 unsigned LATB2 : 1;
957 unsigned LATB3 : 1;
958 unsigned LATB4 : 1;
959 unsigned LATB5 : 1;
960 unsigned LATB6 : 1;
961 unsigned LATB7 : 1;
962 } __LATBbits_t;
964 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
966 #define _LATB0 0x01
967 #define _LATB1 0x02
968 #define _LATB2 0x04
969 #define _LATB3 0x08
970 #define _LATB4 0x10
971 #define _LATB5 0x20
972 #define _LATB6 0x40
973 #define _LATB7 0x80
975 //==============================================================================
978 //==============================================================================
979 // LATC Bits
981 extern __at(0x0F8B) __sfr LATC;
983 typedef struct
985 unsigned LATC0 : 1;
986 unsigned LATC1 : 1;
987 unsigned LATC2 : 1;
988 unsigned LATC3 : 1;
989 unsigned LATC4 : 1;
990 unsigned LATC5 : 1;
991 unsigned LATC6 : 1;
992 unsigned LATC7 : 1;
993 } __LATCbits_t;
995 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
997 #define _LATC0 0x01
998 #define _LATC1 0x02
999 #define _LATC2 0x04
1000 #define _LATC3 0x08
1001 #define _LATC4 0x10
1002 #define _LATC5 0x20
1003 #define _LATC6 0x40
1004 #define _LATC7 0x80
1006 //==============================================================================
1009 //==============================================================================
1010 // LATD Bits
1012 extern __at(0x0F8C) __sfr LATD;
1014 typedef struct
1016 unsigned LATD0 : 1;
1017 unsigned LATD1 : 1;
1018 unsigned LATD2 : 1;
1019 unsigned LATD3 : 1;
1020 unsigned LATD4 : 1;
1021 unsigned LATD5 : 1;
1022 unsigned LATD6 : 1;
1023 unsigned LATD7 : 1;
1024 } __LATDbits_t;
1026 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1028 #define _LATD0 0x01
1029 #define _LATD1 0x02
1030 #define _LATD2 0x04
1031 #define _LATD3 0x08
1032 #define _LATD4 0x10
1033 #define _LATD5 0x20
1034 #define _LATD6 0x40
1035 #define _LATD7 0x80
1037 //==============================================================================
1040 //==============================================================================
1041 // LATE Bits
1043 extern __at(0x0F8D) __sfr LATE;
1045 typedef struct
1047 unsigned LATE0 : 1;
1048 unsigned LATE1 : 1;
1049 unsigned LATE2 : 1;
1050 unsigned LATE3 : 1;
1051 unsigned LATE4 : 1;
1052 unsigned LATE5 : 1;
1053 unsigned LATE6 : 1;
1054 unsigned LATE7 : 1;
1055 } __LATEbits_t;
1057 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1059 #define _LATE0 0x01
1060 #define _LATE1 0x02
1061 #define _LATE2 0x04
1062 #define _LATE3 0x08
1063 #define _LATE4 0x10
1064 #define _LATE5 0x20
1065 #define _LATE6 0x40
1066 #define _LATE7 0x80
1068 //==============================================================================
1071 //==============================================================================
1072 // LATF Bits
1074 extern __at(0x0F8E) __sfr LATF;
1076 typedef struct
1078 unsigned LATF0 : 1;
1079 unsigned LATF1 : 1;
1080 unsigned LATF2 : 1;
1081 unsigned LATF3 : 1;
1082 unsigned LATF4 : 1;
1083 unsigned LATF5 : 1;
1084 unsigned LATF6 : 1;
1085 unsigned LATF7 : 1;
1086 } __LATFbits_t;
1088 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
1090 #define _LATF0 0x01
1091 #define _LATF1 0x02
1092 #define _LATF2 0x04
1093 #define _LATF3 0x08
1094 #define _LATF4 0x10
1095 #define _LATF5 0x20
1096 #define _LATF6 0x40
1097 #define _LATF7 0x80
1099 //==============================================================================
1102 //==============================================================================
1103 // LATG Bits
1105 extern __at(0x0F8F) __sfr LATG;
1107 typedef union
1109 struct
1111 unsigned LATG0 : 1;
1112 unsigned LATG1 : 1;
1113 unsigned LATG2 : 1;
1114 unsigned LATG3 : 1;
1115 unsigned LATG4 : 1;
1116 unsigned : 1;
1117 unsigned : 1;
1118 unsigned : 1;
1121 struct
1123 unsigned LATG : 5;
1124 unsigned : 3;
1126 } __LATGbits_t;
1128 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
1130 #define _LATG0 0x01
1131 #define _LATG1 0x02
1132 #define _LATG2 0x04
1133 #define _LATG3 0x08
1134 #define _LATG4 0x10
1136 //==============================================================================
1139 //==============================================================================
1140 // LATH Bits
1142 extern __at(0x0F90) __sfr LATH;
1144 typedef struct
1146 unsigned LATH0 : 1;
1147 unsigned LATH1 : 1;
1148 unsigned LATH2 : 1;
1149 unsigned LATH3 : 1;
1150 unsigned LATH4 : 1;
1151 unsigned LATH5 : 1;
1152 unsigned LATH6 : 1;
1153 unsigned LATH7 : 1;
1154 } __LATHbits_t;
1156 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
1158 #define _LATH0 0x01
1159 #define _LATH1 0x02
1160 #define _LATH2 0x04
1161 #define _LATH3 0x08
1162 #define _LATH4 0x10
1163 #define _LATH5 0x20
1164 #define _LATH6 0x40
1165 #define _LATH7 0x80
1167 //==============================================================================
1170 //==============================================================================
1171 // LATJ Bits
1173 extern __at(0x0F91) __sfr LATJ;
1175 typedef struct
1177 unsigned LATJ0 : 1;
1178 unsigned LATJ1 : 1;
1179 unsigned LATJ2 : 1;
1180 unsigned LATJ3 : 1;
1181 unsigned LATJ4 : 1;
1182 unsigned LATJ5 : 1;
1183 unsigned LATJ6 : 1;
1184 unsigned LATJ7 : 1;
1185 } __LATJbits_t;
1187 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
1189 #define _LATJ0 0x01
1190 #define _LATJ1 0x02
1191 #define _LATJ2 0x04
1192 #define _LATJ3 0x08
1193 #define _LATJ4 0x10
1194 #define _LATJ5 0x20
1195 #define _LATJ6 0x40
1196 #define _LATJ7 0x80
1198 //==============================================================================
1201 //==============================================================================
1202 // DDRA Bits
1204 extern __at(0x0F92) __sfr DDRA;
1206 typedef union
1208 struct
1210 unsigned TRISA0 : 1;
1211 unsigned TRISA1 : 1;
1212 unsigned TRISA2 : 1;
1213 unsigned TRISA3 : 1;
1214 unsigned TRISA4 : 1;
1215 unsigned TRISA5 : 1;
1216 unsigned TRISA6 : 1;
1217 unsigned TRISA7 : 1;
1220 struct
1222 unsigned RA0 : 1;
1223 unsigned RA1 : 1;
1224 unsigned RA2 : 1;
1225 unsigned RA3 : 1;
1226 unsigned RA4 : 1;
1227 unsigned RA5 : 1;
1228 unsigned RA6 : 1;
1229 unsigned RA7 : 1;
1231 } __DDRAbits_t;
1233 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
1235 #define _TRISA0 0x01
1236 #define _RA0 0x01
1237 #define _TRISA1 0x02
1238 #define _RA1 0x02
1239 #define _TRISA2 0x04
1240 #define _RA2 0x04
1241 #define _TRISA3 0x08
1242 #define _RA3 0x08
1243 #define _TRISA4 0x10
1244 #define _RA4 0x10
1245 #define _TRISA5 0x20
1246 #define _RA5 0x20
1247 #define _TRISA6 0x40
1248 #define _RA6 0x40
1249 #define _TRISA7 0x80
1250 #define _RA7 0x80
1252 //==============================================================================
1255 //==============================================================================
1256 // TRISA Bits
1258 extern __at(0x0F92) __sfr TRISA;
1260 typedef union
1262 struct
1264 unsigned TRISA0 : 1;
1265 unsigned TRISA1 : 1;
1266 unsigned TRISA2 : 1;
1267 unsigned TRISA3 : 1;
1268 unsigned TRISA4 : 1;
1269 unsigned TRISA5 : 1;
1270 unsigned TRISA6 : 1;
1271 unsigned TRISA7 : 1;
1274 struct
1276 unsigned RA0 : 1;
1277 unsigned RA1 : 1;
1278 unsigned RA2 : 1;
1279 unsigned RA3 : 1;
1280 unsigned RA4 : 1;
1281 unsigned RA5 : 1;
1282 unsigned RA6 : 1;
1283 unsigned RA7 : 1;
1285 } __TRISAbits_t;
1287 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
1289 #define _TRISA_TRISA0 0x01
1290 #define _TRISA_RA0 0x01
1291 #define _TRISA_TRISA1 0x02
1292 #define _TRISA_RA1 0x02
1293 #define _TRISA_TRISA2 0x04
1294 #define _TRISA_RA2 0x04
1295 #define _TRISA_TRISA3 0x08
1296 #define _TRISA_RA3 0x08
1297 #define _TRISA_TRISA4 0x10
1298 #define _TRISA_RA4 0x10
1299 #define _TRISA_TRISA5 0x20
1300 #define _TRISA_RA5 0x20
1301 #define _TRISA_TRISA6 0x40
1302 #define _TRISA_RA6 0x40
1303 #define _TRISA_TRISA7 0x80
1304 #define _TRISA_RA7 0x80
1306 //==============================================================================
1309 //==============================================================================
1310 // DDRB Bits
1312 extern __at(0x0F93) __sfr DDRB;
1314 typedef union
1316 struct
1318 unsigned TRISB0 : 1;
1319 unsigned TRISB1 : 1;
1320 unsigned TRISB2 : 1;
1321 unsigned TRISB3 : 1;
1322 unsigned TRISB4 : 1;
1323 unsigned TRISB5 : 1;
1324 unsigned TRISB6 : 1;
1325 unsigned TRISB7 : 1;
1328 struct
1330 unsigned RB0 : 1;
1331 unsigned RB1 : 1;
1332 unsigned RB2 : 1;
1333 unsigned RB3 : 1;
1334 unsigned RB4 : 1;
1335 unsigned RB5 : 1;
1336 unsigned RB6 : 1;
1337 unsigned RB7 : 1;
1339 } __DDRBbits_t;
1341 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
1343 #define _TRISB0 0x01
1344 #define _RB0 0x01
1345 #define _TRISB1 0x02
1346 #define _RB1 0x02
1347 #define _TRISB2 0x04
1348 #define _RB2 0x04
1349 #define _TRISB3 0x08
1350 #define _RB3 0x08
1351 #define _TRISB4 0x10
1352 #define _RB4 0x10
1353 #define _TRISB5 0x20
1354 #define _RB5 0x20
1355 #define _TRISB6 0x40
1356 #define _RB6 0x40
1357 #define _TRISB7 0x80
1358 #define _RB7 0x80
1360 //==============================================================================
1363 //==============================================================================
1364 // TRISB Bits
1366 extern __at(0x0F93) __sfr TRISB;
1368 typedef union
1370 struct
1372 unsigned TRISB0 : 1;
1373 unsigned TRISB1 : 1;
1374 unsigned TRISB2 : 1;
1375 unsigned TRISB3 : 1;
1376 unsigned TRISB4 : 1;
1377 unsigned TRISB5 : 1;
1378 unsigned TRISB6 : 1;
1379 unsigned TRISB7 : 1;
1382 struct
1384 unsigned RB0 : 1;
1385 unsigned RB1 : 1;
1386 unsigned RB2 : 1;
1387 unsigned RB3 : 1;
1388 unsigned RB4 : 1;
1389 unsigned RB5 : 1;
1390 unsigned RB6 : 1;
1391 unsigned RB7 : 1;
1393 } __TRISBbits_t;
1395 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1397 #define _TRISB_TRISB0 0x01
1398 #define _TRISB_RB0 0x01
1399 #define _TRISB_TRISB1 0x02
1400 #define _TRISB_RB1 0x02
1401 #define _TRISB_TRISB2 0x04
1402 #define _TRISB_RB2 0x04
1403 #define _TRISB_TRISB3 0x08
1404 #define _TRISB_RB3 0x08
1405 #define _TRISB_TRISB4 0x10
1406 #define _TRISB_RB4 0x10
1407 #define _TRISB_TRISB5 0x20
1408 #define _TRISB_RB5 0x20
1409 #define _TRISB_TRISB6 0x40
1410 #define _TRISB_RB6 0x40
1411 #define _TRISB_TRISB7 0x80
1412 #define _TRISB_RB7 0x80
1414 //==============================================================================
1417 //==============================================================================
1418 // DDRC Bits
1420 extern __at(0x0F94) __sfr DDRC;
1422 typedef union
1424 struct
1426 unsigned TRISC0 : 1;
1427 unsigned TRISC1 : 1;
1428 unsigned TRISC2 : 1;
1429 unsigned TRISC3 : 1;
1430 unsigned TRISC4 : 1;
1431 unsigned TRISC5 : 1;
1432 unsigned TRISC6 : 1;
1433 unsigned TRISC7 : 1;
1436 struct
1438 unsigned RC0 : 1;
1439 unsigned RC1 : 1;
1440 unsigned RC2 : 1;
1441 unsigned RC3 : 1;
1442 unsigned RC4 : 1;
1443 unsigned RC5 : 1;
1444 unsigned RC6 : 1;
1445 unsigned RC7 : 1;
1447 } __DDRCbits_t;
1449 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1451 #define _TRISC0 0x01
1452 #define _RC0 0x01
1453 #define _TRISC1 0x02
1454 #define _RC1 0x02
1455 #define _TRISC2 0x04
1456 #define _RC2 0x04
1457 #define _TRISC3 0x08
1458 #define _RC3 0x08
1459 #define _TRISC4 0x10
1460 #define _RC4 0x10
1461 #define _TRISC5 0x20
1462 #define _RC5 0x20
1463 #define _TRISC6 0x40
1464 #define _RC6 0x40
1465 #define _TRISC7 0x80
1466 #define _RC7 0x80
1468 //==============================================================================
1471 //==============================================================================
1472 // TRISC Bits
1474 extern __at(0x0F94) __sfr TRISC;
1476 typedef union
1478 struct
1480 unsigned TRISC0 : 1;
1481 unsigned TRISC1 : 1;
1482 unsigned TRISC2 : 1;
1483 unsigned TRISC3 : 1;
1484 unsigned TRISC4 : 1;
1485 unsigned TRISC5 : 1;
1486 unsigned TRISC6 : 1;
1487 unsigned TRISC7 : 1;
1490 struct
1492 unsigned RC0 : 1;
1493 unsigned RC1 : 1;
1494 unsigned RC2 : 1;
1495 unsigned RC3 : 1;
1496 unsigned RC4 : 1;
1497 unsigned RC5 : 1;
1498 unsigned RC6 : 1;
1499 unsigned RC7 : 1;
1501 } __TRISCbits_t;
1503 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1505 #define _TRISC_TRISC0 0x01
1506 #define _TRISC_RC0 0x01
1507 #define _TRISC_TRISC1 0x02
1508 #define _TRISC_RC1 0x02
1509 #define _TRISC_TRISC2 0x04
1510 #define _TRISC_RC2 0x04
1511 #define _TRISC_TRISC3 0x08
1512 #define _TRISC_RC3 0x08
1513 #define _TRISC_TRISC4 0x10
1514 #define _TRISC_RC4 0x10
1515 #define _TRISC_TRISC5 0x20
1516 #define _TRISC_RC5 0x20
1517 #define _TRISC_TRISC6 0x40
1518 #define _TRISC_RC6 0x40
1519 #define _TRISC_TRISC7 0x80
1520 #define _TRISC_RC7 0x80
1522 //==============================================================================
1525 //==============================================================================
1526 // DDRD Bits
1528 extern __at(0x0F95) __sfr DDRD;
1530 typedef union
1532 struct
1534 unsigned TRISD0 : 1;
1535 unsigned TRISD1 : 1;
1536 unsigned TRISD2 : 1;
1537 unsigned TRISD3 : 1;
1538 unsigned TRISD4 : 1;
1539 unsigned TRISD5 : 1;
1540 unsigned TRISD6 : 1;
1541 unsigned TRISD7 : 1;
1544 struct
1546 unsigned RD0 : 1;
1547 unsigned RD1 : 1;
1548 unsigned RD2 : 1;
1549 unsigned RD3 : 1;
1550 unsigned RD4 : 1;
1551 unsigned RD5 : 1;
1552 unsigned RD6 : 1;
1553 unsigned RD7 : 1;
1555 } __DDRDbits_t;
1557 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
1559 #define _TRISD0 0x01
1560 #define _RD0 0x01
1561 #define _TRISD1 0x02
1562 #define _RD1 0x02
1563 #define _TRISD2 0x04
1564 #define _RD2 0x04
1565 #define _TRISD3 0x08
1566 #define _RD3 0x08
1567 #define _TRISD4 0x10
1568 #define _RD4 0x10
1569 #define _TRISD5 0x20
1570 #define _RD5 0x20
1571 #define _TRISD6 0x40
1572 #define _RD6 0x40
1573 #define _TRISD7 0x80
1574 #define _RD7 0x80
1576 //==============================================================================
1579 //==============================================================================
1580 // TRISD Bits
1582 extern __at(0x0F95) __sfr TRISD;
1584 typedef union
1586 struct
1588 unsigned TRISD0 : 1;
1589 unsigned TRISD1 : 1;
1590 unsigned TRISD2 : 1;
1591 unsigned TRISD3 : 1;
1592 unsigned TRISD4 : 1;
1593 unsigned TRISD5 : 1;
1594 unsigned TRISD6 : 1;
1595 unsigned TRISD7 : 1;
1598 struct
1600 unsigned RD0 : 1;
1601 unsigned RD1 : 1;
1602 unsigned RD2 : 1;
1603 unsigned RD3 : 1;
1604 unsigned RD4 : 1;
1605 unsigned RD5 : 1;
1606 unsigned RD6 : 1;
1607 unsigned RD7 : 1;
1609 } __TRISDbits_t;
1611 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
1613 #define _TRISD_TRISD0 0x01
1614 #define _TRISD_RD0 0x01
1615 #define _TRISD_TRISD1 0x02
1616 #define _TRISD_RD1 0x02
1617 #define _TRISD_TRISD2 0x04
1618 #define _TRISD_RD2 0x04
1619 #define _TRISD_TRISD3 0x08
1620 #define _TRISD_RD3 0x08
1621 #define _TRISD_TRISD4 0x10
1622 #define _TRISD_RD4 0x10
1623 #define _TRISD_TRISD5 0x20
1624 #define _TRISD_RD5 0x20
1625 #define _TRISD_TRISD6 0x40
1626 #define _TRISD_RD6 0x40
1627 #define _TRISD_TRISD7 0x80
1628 #define _TRISD_RD7 0x80
1630 //==============================================================================
1633 //==============================================================================
1634 // DDRE Bits
1636 extern __at(0x0F96) __sfr DDRE;
1638 typedef union
1640 struct
1642 unsigned TRISE0 : 1;
1643 unsigned TRISE1 : 1;
1644 unsigned TRISE2 : 1;
1645 unsigned TRISE3 : 1;
1646 unsigned TRISE4 : 1;
1647 unsigned TRISE5 : 1;
1648 unsigned TRISE6 : 1;
1649 unsigned TRISE7 : 1;
1652 struct
1654 unsigned RE0 : 1;
1655 unsigned RE1 : 1;
1656 unsigned RE2 : 1;
1657 unsigned RE3 : 1;
1658 unsigned RE4 : 1;
1659 unsigned RE5 : 1;
1660 unsigned RE6 : 1;
1661 unsigned RE7 : 1;
1663 } __DDREbits_t;
1665 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
1667 #define _TRISE0 0x01
1668 #define _RE0 0x01
1669 #define _TRISE1 0x02
1670 #define _RE1 0x02
1671 #define _TRISE2 0x04
1672 #define _RE2 0x04
1673 #define _TRISE3 0x08
1674 #define _RE3 0x08
1675 #define _TRISE4 0x10
1676 #define _RE4 0x10
1677 #define _TRISE5 0x20
1678 #define _RE5 0x20
1679 #define _TRISE6 0x40
1680 #define _RE6 0x40
1681 #define _TRISE7 0x80
1682 #define _RE7 0x80
1684 //==============================================================================
1687 //==============================================================================
1688 // TRISE Bits
1690 extern __at(0x0F96) __sfr TRISE;
1692 typedef union
1694 struct
1696 unsigned TRISE0 : 1;
1697 unsigned TRISE1 : 1;
1698 unsigned TRISE2 : 1;
1699 unsigned TRISE3 : 1;
1700 unsigned TRISE4 : 1;
1701 unsigned TRISE5 : 1;
1702 unsigned TRISE6 : 1;
1703 unsigned TRISE7 : 1;
1706 struct
1708 unsigned RE0 : 1;
1709 unsigned RE1 : 1;
1710 unsigned RE2 : 1;
1711 unsigned RE3 : 1;
1712 unsigned RE4 : 1;
1713 unsigned RE5 : 1;
1714 unsigned RE6 : 1;
1715 unsigned RE7 : 1;
1717 } __TRISEbits_t;
1719 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
1721 #define _TRISE_TRISE0 0x01
1722 #define _TRISE_RE0 0x01
1723 #define _TRISE_TRISE1 0x02
1724 #define _TRISE_RE1 0x02
1725 #define _TRISE_TRISE2 0x04
1726 #define _TRISE_RE2 0x04
1727 #define _TRISE_TRISE3 0x08
1728 #define _TRISE_RE3 0x08
1729 #define _TRISE_TRISE4 0x10
1730 #define _TRISE_RE4 0x10
1731 #define _TRISE_TRISE5 0x20
1732 #define _TRISE_RE5 0x20
1733 #define _TRISE_TRISE6 0x40
1734 #define _TRISE_RE6 0x40
1735 #define _TRISE_TRISE7 0x80
1736 #define _TRISE_RE7 0x80
1738 //==============================================================================
1741 //==============================================================================
1742 // DDRF Bits
1744 extern __at(0x0F97) __sfr DDRF;
1746 typedef union
1748 struct
1750 unsigned TRISF0 : 1;
1751 unsigned TRISF1 : 1;
1752 unsigned TRISF2 : 1;
1753 unsigned TRISF3 : 1;
1754 unsigned TRISF4 : 1;
1755 unsigned TRISF5 : 1;
1756 unsigned TRISF6 : 1;
1757 unsigned TRISF7 : 1;
1760 struct
1762 unsigned RF0 : 1;
1763 unsigned RF1 : 1;
1764 unsigned RF2 : 1;
1765 unsigned RF3 : 1;
1766 unsigned RF4 : 1;
1767 unsigned RF5 : 1;
1768 unsigned RF6 : 1;
1769 unsigned RF7 : 1;
1771 } __DDRFbits_t;
1773 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
1775 #define _TRISF0 0x01
1776 #define _RF0 0x01
1777 #define _TRISF1 0x02
1778 #define _RF1 0x02
1779 #define _TRISF2 0x04
1780 #define _RF2 0x04
1781 #define _TRISF3 0x08
1782 #define _RF3 0x08
1783 #define _TRISF4 0x10
1784 #define _RF4 0x10
1785 #define _TRISF5 0x20
1786 #define _RF5 0x20
1787 #define _TRISF6 0x40
1788 #define _RF6 0x40
1789 #define _TRISF7 0x80
1790 #define _RF7 0x80
1792 //==============================================================================
1795 //==============================================================================
1796 // TRISF Bits
1798 extern __at(0x0F97) __sfr TRISF;
1800 typedef union
1802 struct
1804 unsigned TRISF0 : 1;
1805 unsigned TRISF1 : 1;
1806 unsigned TRISF2 : 1;
1807 unsigned TRISF3 : 1;
1808 unsigned TRISF4 : 1;
1809 unsigned TRISF5 : 1;
1810 unsigned TRISF6 : 1;
1811 unsigned TRISF7 : 1;
1814 struct
1816 unsigned RF0 : 1;
1817 unsigned RF1 : 1;
1818 unsigned RF2 : 1;
1819 unsigned RF3 : 1;
1820 unsigned RF4 : 1;
1821 unsigned RF5 : 1;
1822 unsigned RF6 : 1;
1823 unsigned RF7 : 1;
1825 } __TRISFbits_t;
1827 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
1829 #define _TRISF_TRISF0 0x01
1830 #define _TRISF_RF0 0x01
1831 #define _TRISF_TRISF1 0x02
1832 #define _TRISF_RF1 0x02
1833 #define _TRISF_TRISF2 0x04
1834 #define _TRISF_RF2 0x04
1835 #define _TRISF_TRISF3 0x08
1836 #define _TRISF_RF3 0x08
1837 #define _TRISF_TRISF4 0x10
1838 #define _TRISF_RF4 0x10
1839 #define _TRISF_TRISF5 0x20
1840 #define _TRISF_RF5 0x20
1841 #define _TRISF_TRISF6 0x40
1842 #define _TRISF_RF6 0x40
1843 #define _TRISF_TRISF7 0x80
1844 #define _TRISF_RF7 0x80
1846 //==============================================================================
1849 //==============================================================================
1850 // DDRG Bits
1852 extern __at(0x0F98) __sfr DDRG;
1854 typedef union
1856 struct
1858 unsigned TRISG0 : 1;
1859 unsigned TRISG1 : 1;
1860 unsigned TRISG2 : 1;
1861 unsigned TRISG3 : 1;
1862 unsigned TRISG4 : 1;
1863 unsigned : 1;
1864 unsigned : 1;
1865 unsigned : 1;
1868 struct
1870 unsigned RG0 : 1;
1871 unsigned RG1 : 1;
1872 unsigned RG2 : 1;
1873 unsigned RG3 : 1;
1874 unsigned RG4 : 1;
1875 unsigned : 1;
1876 unsigned : 1;
1877 unsigned : 1;
1880 struct
1882 unsigned TRISG : 5;
1883 unsigned : 3;
1886 struct
1888 unsigned RG : 5;
1889 unsigned : 3;
1891 } __DDRGbits_t;
1893 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
1895 #define _TRISG0 0x01
1896 #define _RG0 0x01
1897 #define _TRISG1 0x02
1898 #define _RG1 0x02
1899 #define _TRISG2 0x04
1900 #define _RG2 0x04
1901 #define _TRISG3 0x08
1902 #define _RG3 0x08
1903 #define _TRISG4 0x10
1904 #define _RG4 0x10
1906 //==============================================================================
1909 //==============================================================================
1910 // TRISG Bits
1912 extern __at(0x0F98) __sfr TRISG;
1914 typedef union
1916 struct
1918 unsigned TRISG0 : 1;
1919 unsigned TRISG1 : 1;
1920 unsigned TRISG2 : 1;
1921 unsigned TRISG3 : 1;
1922 unsigned TRISG4 : 1;
1923 unsigned : 1;
1924 unsigned : 1;
1925 unsigned : 1;
1928 struct
1930 unsigned RG0 : 1;
1931 unsigned RG1 : 1;
1932 unsigned RG2 : 1;
1933 unsigned RG3 : 1;
1934 unsigned RG4 : 1;
1935 unsigned : 1;
1936 unsigned : 1;
1937 unsigned : 1;
1940 struct
1942 unsigned TRISG : 5;
1943 unsigned : 3;
1946 struct
1948 unsigned RG : 5;
1949 unsigned : 3;
1951 } __TRISGbits_t;
1953 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
1955 #define _TRISG_TRISG0 0x01
1956 #define _TRISG_RG0 0x01
1957 #define _TRISG_TRISG1 0x02
1958 #define _TRISG_RG1 0x02
1959 #define _TRISG_TRISG2 0x04
1960 #define _TRISG_RG2 0x04
1961 #define _TRISG_TRISG3 0x08
1962 #define _TRISG_RG3 0x08
1963 #define _TRISG_TRISG4 0x10
1964 #define _TRISG_RG4 0x10
1966 //==============================================================================
1969 //==============================================================================
1970 // DDRH Bits
1972 extern __at(0x0F99) __sfr DDRH;
1974 typedef union
1976 struct
1978 unsigned TRISH0 : 1;
1979 unsigned TRISH1 : 1;
1980 unsigned TRISH2 : 1;
1981 unsigned TRISH3 : 1;
1982 unsigned TRISH4 : 1;
1983 unsigned TRISH5 : 1;
1984 unsigned TRISH6 : 1;
1985 unsigned TRISH7 : 1;
1988 struct
1990 unsigned RH0 : 1;
1991 unsigned RH1 : 1;
1992 unsigned RH2 : 1;
1993 unsigned RH3 : 1;
1994 unsigned RH4 : 1;
1995 unsigned RH5 : 1;
1996 unsigned RH6 : 1;
1997 unsigned RH7 : 1;
1999 } __DDRHbits_t;
2001 extern __at(0x0F99) volatile __DDRHbits_t DDRHbits;
2003 #define _TRISH0 0x01
2004 #define _RH0 0x01
2005 #define _TRISH1 0x02
2006 #define _RH1 0x02
2007 #define _TRISH2 0x04
2008 #define _RH2 0x04
2009 #define _TRISH3 0x08
2010 #define _RH3 0x08
2011 #define _TRISH4 0x10
2012 #define _RH4 0x10
2013 #define _TRISH5 0x20
2014 #define _RH5 0x20
2015 #define _TRISH6 0x40
2016 #define _RH6 0x40
2017 #define _TRISH7 0x80
2018 #define _RH7 0x80
2020 //==============================================================================
2023 //==============================================================================
2024 // TRISH Bits
2026 extern __at(0x0F99) __sfr TRISH;
2028 typedef union
2030 struct
2032 unsigned TRISH0 : 1;
2033 unsigned TRISH1 : 1;
2034 unsigned TRISH2 : 1;
2035 unsigned TRISH3 : 1;
2036 unsigned TRISH4 : 1;
2037 unsigned TRISH5 : 1;
2038 unsigned TRISH6 : 1;
2039 unsigned TRISH7 : 1;
2042 struct
2044 unsigned RH0 : 1;
2045 unsigned RH1 : 1;
2046 unsigned RH2 : 1;
2047 unsigned RH3 : 1;
2048 unsigned RH4 : 1;
2049 unsigned RH5 : 1;
2050 unsigned RH6 : 1;
2051 unsigned RH7 : 1;
2053 } __TRISHbits_t;
2055 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
2057 #define _TRISH_TRISH0 0x01
2058 #define _TRISH_RH0 0x01
2059 #define _TRISH_TRISH1 0x02
2060 #define _TRISH_RH1 0x02
2061 #define _TRISH_TRISH2 0x04
2062 #define _TRISH_RH2 0x04
2063 #define _TRISH_TRISH3 0x08
2064 #define _TRISH_RH3 0x08
2065 #define _TRISH_TRISH4 0x10
2066 #define _TRISH_RH4 0x10
2067 #define _TRISH_TRISH5 0x20
2068 #define _TRISH_RH5 0x20
2069 #define _TRISH_TRISH6 0x40
2070 #define _TRISH_RH6 0x40
2071 #define _TRISH_TRISH7 0x80
2072 #define _TRISH_RH7 0x80
2074 //==============================================================================
2077 //==============================================================================
2078 // DDRJ Bits
2080 extern __at(0x0F9A) __sfr DDRJ;
2082 typedef union
2084 struct
2086 unsigned TRISJ0 : 1;
2087 unsigned TRISJ1 : 1;
2088 unsigned TRISJ2 : 1;
2089 unsigned TRISJ3 : 1;
2090 unsigned TRISJ4 : 1;
2091 unsigned TRISJ5 : 1;
2092 unsigned TRISJ6 : 1;
2093 unsigned TRISJ7 : 1;
2096 struct
2098 unsigned RJ0 : 1;
2099 unsigned RJ1 : 1;
2100 unsigned RJ2 : 1;
2101 unsigned RJ3 : 1;
2102 unsigned RJ4 : 1;
2103 unsigned RJ5 : 1;
2104 unsigned RJ6 : 1;
2105 unsigned RJ7 : 1;
2107 } __DDRJbits_t;
2109 extern __at(0x0F9A) volatile __DDRJbits_t DDRJbits;
2111 #define _TRISJ0 0x01
2112 #define _RJ0 0x01
2113 #define _TRISJ1 0x02
2114 #define _RJ1 0x02
2115 #define _TRISJ2 0x04
2116 #define _RJ2 0x04
2117 #define _TRISJ3 0x08
2118 #define _RJ3 0x08
2119 #define _TRISJ4 0x10
2120 #define _RJ4 0x10
2121 #define _TRISJ5 0x20
2122 #define _RJ5 0x20
2123 #define _TRISJ6 0x40
2124 #define _RJ6 0x40
2125 #define _TRISJ7 0x80
2126 #define _RJ7 0x80
2128 //==============================================================================
2131 //==============================================================================
2132 // TRISJ Bits
2134 extern __at(0x0F9A) __sfr TRISJ;
2136 typedef union
2138 struct
2140 unsigned TRISJ0 : 1;
2141 unsigned TRISJ1 : 1;
2142 unsigned TRISJ2 : 1;
2143 unsigned TRISJ3 : 1;
2144 unsigned TRISJ4 : 1;
2145 unsigned TRISJ5 : 1;
2146 unsigned TRISJ6 : 1;
2147 unsigned TRISJ7 : 1;
2150 struct
2152 unsigned RJ0 : 1;
2153 unsigned RJ1 : 1;
2154 unsigned RJ2 : 1;
2155 unsigned RJ3 : 1;
2156 unsigned RJ4 : 1;
2157 unsigned RJ5 : 1;
2158 unsigned RJ6 : 1;
2159 unsigned RJ7 : 1;
2161 } __TRISJbits_t;
2163 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
2165 #define _TRISJ_TRISJ0 0x01
2166 #define _TRISJ_RJ0 0x01
2167 #define _TRISJ_TRISJ1 0x02
2168 #define _TRISJ_RJ1 0x02
2169 #define _TRISJ_TRISJ2 0x04
2170 #define _TRISJ_RJ2 0x04
2171 #define _TRISJ_TRISJ3 0x08
2172 #define _TRISJ_RJ3 0x08
2173 #define _TRISJ_TRISJ4 0x10
2174 #define _TRISJ_RJ4 0x10
2175 #define _TRISJ_TRISJ5 0x20
2176 #define _TRISJ_RJ5 0x20
2177 #define _TRISJ_TRISJ6 0x40
2178 #define _TRISJ_RJ6 0x40
2179 #define _TRISJ_TRISJ7 0x80
2180 #define _TRISJ_RJ7 0x80
2182 //==============================================================================
2185 //==============================================================================
2186 // OSCTUNE Bits
2188 extern __at(0x0F9B) __sfr OSCTUNE;
2190 typedef union
2192 struct
2194 unsigned TUN0 : 1;
2195 unsigned TUN1 : 1;
2196 unsigned TUN2 : 1;
2197 unsigned TUN3 : 1;
2198 unsigned TUN4 : 1;
2199 unsigned : 1;
2200 unsigned PLLEN : 1;
2201 unsigned INTSRC : 1;
2204 struct
2206 unsigned TUN : 5;
2207 unsigned : 3;
2209 } __OSCTUNEbits_t;
2211 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
2213 #define _TUN0 0x01
2214 #define _TUN1 0x02
2215 #define _TUN2 0x04
2216 #define _TUN3 0x08
2217 #define _TUN4 0x10
2218 #define _PLLEN 0x40
2219 #define _INTSRC 0x80
2221 //==============================================================================
2224 //==============================================================================
2225 // MEMCON Bits
2227 extern __at(0x0F9C) __sfr MEMCON;
2229 typedef union
2231 struct
2233 unsigned WM0 : 1;
2234 unsigned WM1 : 1;
2235 unsigned : 1;
2236 unsigned : 1;
2237 unsigned WAIT0 : 1;
2238 unsigned WAIT1 : 1;
2239 unsigned : 1;
2240 unsigned EBDIS : 1;
2243 struct
2245 unsigned WM : 2;
2246 unsigned : 6;
2249 struct
2251 unsigned : 4;
2252 unsigned WAIT : 2;
2253 unsigned : 2;
2255 } __MEMCONbits_t;
2257 extern __at(0x0F9C) volatile __MEMCONbits_t MEMCONbits;
2259 #define _WM0 0x01
2260 #define _WM1 0x02
2261 #define _WAIT0 0x10
2262 #define _WAIT1 0x20
2263 #define _EBDIS 0x80
2265 //==============================================================================
2268 //==============================================================================
2269 // PIE1 Bits
2271 extern __at(0x0F9D) __sfr PIE1;
2273 typedef union
2275 struct
2277 unsigned TMR1IE : 1;
2278 unsigned TMR2IE : 1;
2279 unsigned CCP1IE : 1;
2280 unsigned SSPIE : 1;
2281 unsigned TXIE : 1;
2282 unsigned RCIE : 1;
2283 unsigned ADIE : 1;
2284 unsigned PSPIE : 1;
2287 struct
2289 unsigned : 1;
2290 unsigned : 1;
2291 unsigned : 1;
2292 unsigned : 1;
2293 unsigned TX1IE : 1;
2294 unsigned RC1IE : 1;
2295 unsigned : 1;
2296 unsigned : 1;
2298 } __PIE1bits_t;
2300 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
2302 #define _TMR1IE 0x01
2303 #define _TMR2IE 0x02
2304 #define _CCP1IE 0x04
2305 #define _SSPIE 0x08
2306 #define _TXIE 0x10
2307 #define _TX1IE 0x10
2308 #define _RCIE 0x20
2309 #define _RC1IE 0x20
2310 #define _ADIE 0x40
2311 #define _PSPIE 0x80
2313 //==============================================================================
2316 //==============================================================================
2317 // PIR1 Bits
2319 extern __at(0x0F9E) __sfr PIR1;
2321 typedef union
2323 struct
2325 unsigned TMR1IF : 1;
2326 unsigned TMR2IF : 1;
2327 unsigned CCP1IF : 1;
2328 unsigned SSPIF : 1;
2329 unsigned TXIF : 1;
2330 unsigned RCIF : 1;
2331 unsigned ADIF : 1;
2332 unsigned PSPIF : 1;
2335 struct
2337 unsigned : 1;
2338 unsigned : 1;
2339 unsigned : 1;
2340 unsigned : 1;
2341 unsigned TX1IF : 1;
2342 unsigned RC1IF : 1;
2343 unsigned : 1;
2344 unsigned : 1;
2346 } __PIR1bits_t;
2348 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
2350 #define _TMR1IF 0x01
2351 #define _TMR2IF 0x02
2352 #define _CCP1IF 0x04
2353 #define _SSPIF 0x08
2354 #define _TXIF 0x10
2355 #define _TX1IF 0x10
2356 #define _RCIF 0x20
2357 #define _RC1IF 0x20
2358 #define _ADIF 0x40
2359 #define _PSPIF 0x80
2361 //==============================================================================
2364 //==============================================================================
2365 // IPR1 Bits
2367 extern __at(0x0F9F) __sfr IPR1;
2369 typedef union
2371 struct
2373 unsigned TMR1IP : 1;
2374 unsigned TMR2IP : 1;
2375 unsigned CCP1IP : 1;
2376 unsigned SSPIP : 1;
2377 unsigned TXIP : 1;
2378 unsigned RCIP : 1;
2379 unsigned ADIP : 1;
2380 unsigned PSPIP : 1;
2383 struct
2385 unsigned : 1;
2386 unsigned : 1;
2387 unsigned : 1;
2388 unsigned : 1;
2389 unsigned TX1IP : 1;
2390 unsigned RC1IP : 1;
2391 unsigned : 1;
2392 unsigned : 1;
2394 } __IPR1bits_t;
2396 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
2398 #define _TMR1IP 0x01
2399 #define _TMR2IP 0x02
2400 #define _CCP1IP 0x04
2401 #define _SSPIP 0x08
2402 #define _TXIP 0x10
2403 #define _TX1IP 0x10
2404 #define _RCIP 0x20
2405 #define _RC1IP 0x20
2406 #define _ADIP 0x40
2407 #define _PSPIP 0x80
2409 //==============================================================================
2412 //==============================================================================
2413 // PIE2 Bits
2415 extern __at(0x0FA0) __sfr PIE2;
2417 typedef union
2419 struct
2421 unsigned CCP2IE : 1;
2422 unsigned TMR3IE : 1;
2423 unsigned HLVDIE : 1;
2424 unsigned BCLIE : 1;
2425 unsigned : 1;
2426 unsigned : 1;
2427 unsigned CMIE : 1;
2428 unsigned OSCFIE : 1;
2431 struct
2433 unsigned : 1;
2434 unsigned : 1;
2435 unsigned LVDIE : 1;
2436 unsigned : 1;
2437 unsigned : 1;
2438 unsigned : 1;
2439 unsigned : 1;
2440 unsigned : 1;
2442 } __PIE2bits_t;
2444 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
2446 #define _CCP2IE 0x01
2447 #define _TMR3IE 0x02
2448 #define _HLVDIE 0x04
2449 #define _LVDIE 0x04
2450 #define _BCLIE 0x08
2451 #define _CMIE 0x40
2452 #define _OSCFIE 0x80
2454 //==============================================================================
2457 //==============================================================================
2458 // PIR2 Bits
2460 extern __at(0x0FA1) __sfr PIR2;
2462 typedef union
2464 struct
2466 unsigned CCP2IF : 1;
2467 unsigned TMR3IF : 1;
2468 unsigned HLVDIF : 1;
2469 unsigned BCLIF : 1;
2470 unsigned : 1;
2471 unsigned : 1;
2472 unsigned CMIF : 1;
2473 unsigned OSCFIF : 1;
2476 struct
2478 unsigned : 1;
2479 unsigned : 1;
2480 unsigned LVDIF : 1;
2481 unsigned : 1;
2482 unsigned : 1;
2483 unsigned : 1;
2484 unsigned : 1;
2485 unsigned : 1;
2487 } __PIR2bits_t;
2489 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
2491 #define _CCP2IF 0x01
2492 #define _TMR3IF 0x02
2493 #define _HLVDIF 0x04
2494 #define _LVDIF 0x04
2495 #define _BCLIF 0x08
2496 #define _CMIF 0x40
2497 #define _OSCFIF 0x80
2499 //==============================================================================
2502 //==============================================================================
2503 // IPR2 Bits
2505 extern __at(0x0FA2) __sfr IPR2;
2507 typedef union
2509 struct
2511 unsigned CCP2IP : 1;
2512 unsigned TMR3IP : 1;
2513 unsigned HLVDIP : 1;
2514 unsigned BCLIP : 1;
2515 unsigned : 1;
2516 unsigned : 1;
2517 unsigned CMIP : 1;
2518 unsigned OSCFIP : 1;
2521 struct
2523 unsigned : 1;
2524 unsigned : 1;
2525 unsigned LVDIP : 1;
2526 unsigned : 1;
2527 unsigned : 1;
2528 unsigned : 1;
2529 unsigned : 1;
2530 unsigned : 1;
2532 } __IPR2bits_t;
2534 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
2536 #define _CCP2IP 0x01
2537 #define _TMR3IP 0x02
2538 #define _HLVDIP 0x04
2539 #define _LVDIP 0x04
2540 #define _BCLIP 0x08
2541 #define _CMIP 0x40
2542 #define _OSCFIP 0x80
2544 //==============================================================================
2547 //==============================================================================
2548 // PIE3 Bits
2550 extern __at(0x0FA3) __sfr PIE3;
2552 typedef struct
2554 unsigned CCP3IE : 1;
2555 unsigned : 1;
2556 unsigned : 1;
2557 unsigned : 1;
2558 unsigned TX2IE : 1;
2559 unsigned RC2IE : 1;
2560 unsigned : 1;
2561 unsigned : 1;
2562 } __PIE3bits_t;
2564 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
2566 #define _CCP3IE 0x01
2567 #define _TX2IE 0x10
2568 #define _RC2IE 0x20
2570 //==============================================================================
2573 //==============================================================================
2574 // PIR3 Bits
2576 extern __at(0x0FA4) __sfr PIR3;
2578 typedef struct
2580 unsigned CCP3IF : 1;
2581 unsigned : 1;
2582 unsigned : 1;
2583 unsigned : 1;
2584 unsigned TX2IF : 1;
2585 unsigned RC2IF : 1;
2586 unsigned : 1;
2587 unsigned : 1;
2588 } __PIR3bits_t;
2590 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
2592 #define _CCP3IF 0x01
2593 #define _TX2IF 0x10
2594 #define _RC2IF 0x20
2596 //==============================================================================
2599 //==============================================================================
2600 // IPR3 Bits
2602 extern __at(0x0FA5) __sfr IPR3;
2604 typedef struct
2606 unsigned CCP3IP : 1;
2607 unsigned : 1;
2608 unsigned : 1;
2609 unsigned : 1;
2610 unsigned TX2IP : 1;
2611 unsigned RC2IP : 1;
2612 unsigned : 1;
2613 unsigned : 1;
2614 } __IPR3bits_t;
2616 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
2618 #define _CCP3IP 0x01
2619 #define _TX2IP 0x10
2620 #define _RC2IP 0x20
2622 //==============================================================================
2625 //==============================================================================
2626 // RCSTA Bits
2628 extern __at(0x0FAB) __sfr RCSTA;
2630 typedef union
2632 struct
2634 unsigned RX9D : 1;
2635 unsigned OERR : 1;
2636 unsigned FERR : 1;
2637 unsigned ADDEN : 1;
2638 unsigned CREN : 1;
2639 unsigned SREN : 1;
2640 unsigned RX9 : 1;
2641 unsigned SPEN : 1;
2644 struct
2646 unsigned RX9D1 : 1;
2647 unsigned OERR1 : 1;
2648 unsigned FERR1 : 1;
2649 unsigned ADEN : 1;
2650 unsigned CREN1 : 1;
2651 unsigned SREN1 : 1;
2652 unsigned RX91 : 1;
2653 unsigned SPEN1 : 1;
2656 struct
2658 unsigned : 1;
2659 unsigned : 1;
2660 unsigned : 1;
2661 unsigned ADDEN1 : 1;
2662 unsigned : 1;
2663 unsigned : 1;
2664 unsigned : 1;
2665 unsigned : 1;
2667 } __RCSTAbits_t;
2669 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
2671 #define _RX9D 0x01
2672 #define _RX9D1 0x01
2673 #define _OERR 0x02
2674 #define _OERR1 0x02
2675 #define _FERR 0x04
2676 #define _FERR1 0x04
2677 #define _ADDEN 0x08
2678 #define _ADEN 0x08
2679 #define _ADDEN1 0x08
2680 #define _CREN 0x10
2681 #define _CREN1 0x10
2682 #define _SREN 0x20
2683 #define _SREN1 0x20
2684 #define _RX9 0x40
2685 #define _RX91 0x40
2686 #define _SPEN 0x80
2687 #define _SPEN1 0x80
2689 //==============================================================================
2692 //==============================================================================
2693 // RCSTA1 Bits
2695 extern __at(0x0FAB) __sfr RCSTA1;
2697 typedef union
2699 struct
2701 unsigned RX9D : 1;
2702 unsigned OERR : 1;
2703 unsigned FERR : 1;
2704 unsigned ADDEN : 1;
2705 unsigned CREN : 1;
2706 unsigned SREN : 1;
2707 unsigned RX9 : 1;
2708 unsigned SPEN : 1;
2711 struct
2713 unsigned RX9D1 : 1;
2714 unsigned OERR1 : 1;
2715 unsigned FERR1 : 1;
2716 unsigned ADEN : 1;
2717 unsigned CREN1 : 1;
2718 unsigned SREN1 : 1;
2719 unsigned RX91 : 1;
2720 unsigned SPEN1 : 1;
2723 struct
2725 unsigned : 1;
2726 unsigned : 1;
2727 unsigned : 1;
2728 unsigned ADDEN1 : 1;
2729 unsigned : 1;
2730 unsigned : 1;
2731 unsigned : 1;
2732 unsigned : 1;
2734 } __RCSTA1bits_t;
2736 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
2738 #define _RCSTA1_RX9D 0x01
2739 #define _RCSTA1_RX9D1 0x01
2740 #define _RCSTA1_OERR 0x02
2741 #define _RCSTA1_OERR1 0x02
2742 #define _RCSTA1_FERR 0x04
2743 #define _RCSTA1_FERR1 0x04
2744 #define _RCSTA1_ADDEN 0x08
2745 #define _RCSTA1_ADEN 0x08
2746 #define _RCSTA1_ADDEN1 0x08
2747 #define _RCSTA1_CREN 0x10
2748 #define _RCSTA1_CREN1 0x10
2749 #define _RCSTA1_SREN 0x20
2750 #define _RCSTA1_SREN1 0x20
2751 #define _RCSTA1_RX9 0x40
2752 #define _RCSTA1_RX91 0x40
2753 #define _RCSTA1_SPEN 0x80
2754 #define _RCSTA1_SPEN1 0x80
2756 //==============================================================================
2759 //==============================================================================
2760 // TXSTA Bits
2762 extern __at(0x0FAC) __sfr TXSTA;
2764 typedef union
2766 struct
2768 unsigned TX9D : 1;
2769 unsigned TRMT : 1;
2770 unsigned BRGH : 1;
2771 unsigned SENDB : 1;
2772 unsigned SYNC : 1;
2773 unsigned TXEN : 1;
2774 unsigned TX9 : 1;
2775 unsigned CSRC : 1;
2778 struct
2780 unsigned TX9D1 : 1;
2781 unsigned TRMT1 : 1;
2782 unsigned BRGH1 : 1;
2783 unsigned SENDB1 : 1;
2784 unsigned SYNC1 : 1;
2785 unsigned TXEN1 : 1;
2786 unsigned TX91 : 1;
2787 unsigned CSRC1 : 1;
2789 } __TXSTAbits_t;
2791 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
2793 #define _TX9D 0x01
2794 #define _TX9D1 0x01
2795 #define _TRMT 0x02
2796 #define _TRMT1 0x02
2797 #define _BRGH 0x04
2798 #define _BRGH1 0x04
2799 #define _SENDB 0x08
2800 #define _SENDB1 0x08
2801 #define _SYNC 0x10
2802 #define _SYNC1 0x10
2803 #define _TXEN 0x20
2804 #define _TXEN1 0x20
2805 #define _TX9 0x40
2806 #define _TX91 0x40
2807 #define _CSRC 0x80
2808 #define _CSRC1 0x80
2810 //==============================================================================
2813 //==============================================================================
2814 // TXSTA1 Bits
2816 extern __at(0x0FAC) __sfr TXSTA1;
2818 typedef union
2820 struct
2822 unsigned TX9D : 1;
2823 unsigned TRMT : 1;
2824 unsigned BRGH : 1;
2825 unsigned SENDB : 1;
2826 unsigned SYNC : 1;
2827 unsigned TXEN : 1;
2828 unsigned TX9 : 1;
2829 unsigned CSRC : 1;
2832 struct
2834 unsigned TX9D1 : 1;
2835 unsigned TRMT1 : 1;
2836 unsigned BRGH1 : 1;
2837 unsigned SENDB1 : 1;
2838 unsigned SYNC1 : 1;
2839 unsigned TXEN1 : 1;
2840 unsigned TX91 : 1;
2841 unsigned CSRC1 : 1;
2843 } __TXSTA1bits_t;
2845 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
2847 #define _TXSTA1_TX9D 0x01
2848 #define _TXSTA1_TX9D1 0x01
2849 #define _TXSTA1_TRMT 0x02
2850 #define _TXSTA1_TRMT1 0x02
2851 #define _TXSTA1_BRGH 0x04
2852 #define _TXSTA1_BRGH1 0x04
2853 #define _TXSTA1_SENDB 0x08
2854 #define _TXSTA1_SENDB1 0x08
2855 #define _TXSTA1_SYNC 0x10
2856 #define _TXSTA1_SYNC1 0x10
2857 #define _TXSTA1_TXEN 0x20
2858 #define _TXSTA1_TXEN1 0x20
2859 #define _TXSTA1_TX9 0x40
2860 #define _TXSTA1_TX91 0x40
2861 #define _TXSTA1_CSRC 0x80
2862 #define _TXSTA1_CSRC1 0x80
2864 //==============================================================================
2866 extern __at(0x0FAD) __sfr TXREG;
2867 extern __at(0x0FAD) __sfr TXREG1;
2868 extern __at(0x0FAE) __sfr RCREG;
2869 extern __at(0x0FAE) __sfr RCREG1;
2870 extern __at(0x0FAF) __sfr SPBRG;
2871 extern __at(0x0FAF) __sfr SPBRG1;
2873 //==============================================================================
2874 // PSPCON Bits
2876 extern __at(0x0FB0) __sfr PSPCON;
2878 typedef struct
2880 unsigned : 1;
2881 unsigned : 1;
2882 unsigned : 1;
2883 unsigned : 1;
2884 unsigned PSPMODE : 1;
2885 unsigned IBOV : 1;
2886 unsigned OBF : 1;
2887 unsigned IBF : 1;
2888 } __PSPCONbits_t;
2890 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
2892 #define _PSPMODE 0x10
2893 #define _IBOV 0x20
2894 #define _OBF 0x40
2895 #define _IBF 0x80
2897 //==============================================================================
2900 //==============================================================================
2901 // T3CON Bits
2903 extern __at(0x0FB1) __sfr T3CON;
2905 typedef union
2907 struct
2909 unsigned TMR3ON : 1;
2910 unsigned TMR3CS : 1;
2911 unsigned NOT_T3SYNC : 1;
2912 unsigned T3CCP1 : 1;
2913 unsigned T3CKPS0 : 1;
2914 unsigned T3CKPS1 : 1;
2915 unsigned T3CCP2 : 1;
2916 unsigned RD16 : 1;
2919 struct
2921 unsigned : 1;
2922 unsigned : 1;
2923 unsigned T3SYNC : 1;
2924 unsigned : 1;
2925 unsigned : 1;
2926 unsigned : 1;
2927 unsigned : 1;
2928 unsigned : 1;
2931 struct
2933 unsigned : 1;
2934 unsigned : 1;
2935 unsigned T3INSYNC : 1;
2936 unsigned : 1;
2937 unsigned : 1;
2938 unsigned : 1;
2939 unsigned : 1;
2940 unsigned : 1;
2943 struct
2945 unsigned : 4;
2946 unsigned T3CKPS : 2;
2947 unsigned : 2;
2949 } __T3CONbits_t;
2951 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
2953 #define _T3CON_TMR3ON 0x01
2954 #define _T3CON_TMR3CS 0x02
2955 #define _T3CON_NOT_T3SYNC 0x04
2956 #define _T3CON_T3SYNC 0x04
2957 #define _T3CON_T3INSYNC 0x04
2958 #define _T3CON_T3CCP1 0x08
2959 #define _T3CON_T3CKPS0 0x10
2960 #define _T3CON_T3CKPS1 0x20
2961 #define _T3CON_T3CCP2 0x40
2962 #define _T3CON_RD16 0x80
2964 //==============================================================================
2966 extern __at(0x0FB2) __sfr TMR3;
2967 extern __at(0x0FB2) __sfr TMR3L;
2968 extern __at(0x0FB3) __sfr TMR3H;
2970 //==============================================================================
2971 // CMCON Bits
2973 extern __at(0x0FB4) __sfr CMCON;
2975 typedef union
2977 struct
2979 unsigned CM0 : 1;
2980 unsigned CM1 : 1;
2981 unsigned CM2 : 1;
2982 unsigned CIS : 1;
2983 unsigned C1INV : 1;
2984 unsigned C2INV : 1;
2985 unsigned C1OUT : 1;
2986 unsigned C2OUT : 1;
2989 struct
2991 unsigned CM : 3;
2992 unsigned : 5;
2994 } __CMCONbits_t;
2996 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
2998 #define _CM0 0x01
2999 #define _CM1 0x02
3000 #define _CM2 0x04
3001 #define _CIS 0x08
3002 #define _C1INV 0x10
3003 #define _C2INV 0x20
3004 #define _C1OUT 0x40
3005 #define _C2OUT 0x80
3007 //==============================================================================
3010 //==============================================================================
3011 // CVRCON Bits
3013 extern __at(0x0FB5) __sfr CVRCON;
3015 typedef union
3017 struct
3019 unsigned CVR0 : 1;
3020 unsigned CVR1 : 1;
3021 unsigned CVR2 : 1;
3022 unsigned CVR3 : 1;
3023 unsigned CVRSS : 1;
3024 unsigned CVRR : 1;
3025 unsigned CVROE : 1;
3026 unsigned CVREN : 1;
3029 struct
3031 unsigned : 1;
3032 unsigned : 1;
3033 unsigned : 1;
3034 unsigned : 1;
3035 unsigned CVREF : 1;
3036 unsigned : 1;
3037 unsigned : 1;
3038 unsigned : 1;
3041 struct
3043 unsigned CVR : 4;
3044 unsigned : 4;
3046 } __CVRCONbits_t;
3048 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
3050 #define _CVR0 0x01
3051 #define _CVR1 0x02
3052 #define _CVR2 0x04
3053 #define _CVR3 0x08
3054 #define _CVRSS 0x10
3055 #define _CVREF 0x10
3056 #define _CVRR 0x20
3057 #define _CVROE 0x40
3058 #define _CVREN 0x80
3060 //==============================================================================
3063 //==============================================================================
3064 // CCP3CON Bits
3066 extern __at(0x0FB7) __sfr CCP3CON;
3068 typedef union
3070 struct
3072 unsigned CCP3M0 : 1;
3073 unsigned CCP3M1 : 1;
3074 unsigned CCP3M2 : 1;
3075 unsigned CCP3M3 : 1;
3076 unsigned DCCP3Y : 1;
3077 unsigned DCCP3X : 1;
3078 unsigned : 1;
3079 unsigned : 1;
3082 struct
3084 unsigned : 1;
3085 unsigned : 1;
3086 unsigned : 1;
3087 unsigned : 1;
3088 unsigned DC3B0 : 1;
3089 unsigned DC3B1 : 1;
3090 unsigned : 1;
3091 unsigned : 1;
3094 struct
3096 unsigned CCP3M : 4;
3097 unsigned : 4;
3100 struct
3102 unsigned : 4;
3103 unsigned DC3B : 2;
3104 unsigned : 2;
3106 } __CCP3CONbits_t;
3108 extern __at(0x0FB7) volatile __CCP3CONbits_t CCP3CONbits;
3110 #define _CCP3M0 0x01
3111 #define _CCP3M1 0x02
3112 #define _CCP3M2 0x04
3113 #define _CCP3M3 0x08
3114 #define _DCCP3Y 0x10
3115 #define _DC3B0 0x10
3116 #define _DCCP3X 0x20
3117 #define _DC3B1 0x20
3119 //==============================================================================
3121 extern __at(0x0FB8) __sfr CCPR3;
3122 extern __at(0x0FB8) __sfr CCPR3L;
3123 extern __at(0x0FB9) __sfr CCPR3H;
3125 //==============================================================================
3126 // CCP2CON Bits
3128 extern __at(0x0FBA) __sfr CCP2CON;
3130 typedef union
3132 struct
3134 unsigned CCP2M0 : 1;
3135 unsigned CCP2M1 : 1;
3136 unsigned CCP2M2 : 1;
3137 unsigned CCP2M3 : 1;
3138 unsigned DCCP2Y : 1;
3139 unsigned DCCP2X : 1;
3140 unsigned : 1;
3141 unsigned : 1;
3144 struct
3146 unsigned : 1;
3147 unsigned : 1;
3148 unsigned : 1;
3149 unsigned : 1;
3150 unsigned CCP2Y : 1;
3151 unsigned CCP2X : 1;
3152 unsigned : 1;
3153 unsigned : 1;
3156 struct
3158 unsigned : 1;
3159 unsigned : 1;
3160 unsigned : 1;
3161 unsigned : 1;
3162 unsigned DC2B0 : 1;
3163 unsigned DC2B1 : 1;
3164 unsigned : 1;
3165 unsigned : 1;
3168 struct
3170 unsigned CCP2M : 4;
3171 unsigned : 4;
3174 struct
3176 unsigned : 4;
3177 unsigned DC2B : 2;
3178 unsigned : 2;
3180 } __CCP2CONbits_t;
3182 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
3184 #define _CCP2M0 0x01
3185 #define _CCP2M1 0x02
3186 #define _CCP2M2 0x04
3187 #define _CCP2M3 0x08
3188 #define _DCCP2Y 0x10
3189 #define _CCP2Y 0x10
3190 #define _DC2B0 0x10
3191 #define _DCCP2X 0x20
3192 #define _CCP2X 0x20
3193 #define _DC2B1 0x20
3195 //==============================================================================
3197 extern __at(0x0FBB) __sfr CCPR2;
3198 extern __at(0x0FBB) __sfr CCPR2L;
3199 extern __at(0x0FBC) __sfr CCPR2H;
3201 //==============================================================================
3202 // CCP1CON Bits
3204 extern __at(0x0FBD) __sfr CCP1CON;
3206 typedef union
3208 struct
3210 unsigned CCP1M0 : 1;
3211 unsigned CCP1M1 : 1;
3212 unsigned CCP1M2 : 1;
3213 unsigned CCP1M3 : 1;
3214 unsigned DCCP1Y : 1;
3215 unsigned DCCP1X : 1;
3216 unsigned : 1;
3217 unsigned : 1;
3220 struct
3222 unsigned : 1;
3223 unsigned : 1;
3224 unsigned : 1;
3225 unsigned : 1;
3226 unsigned CCP1Y : 1;
3227 unsigned CCP1X : 1;
3228 unsigned : 1;
3229 unsigned : 1;
3232 struct
3234 unsigned : 1;
3235 unsigned : 1;
3236 unsigned : 1;
3237 unsigned : 1;
3238 unsigned DC1B0 : 1;
3239 unsigned DC1B1 : 1;
3240 unsigned : 1;
3241 unsigned : 1;
3244 struct
3246 unsigned CCP1M : 4;
3247 unsigned : 4;
3250 struct
3252 unsigned : 4;
3253 unsigned DC1B : 2;
3254 unsigned : 2;
3256 } __CCP1CONbits_t;
3258 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
3260 #define _CCP1M0 0x01
3261 #define _CCP1M1 0x02
3262 #define _CCP1M2 0x04
3263 #define _CCP1M3 0x08
3264 #define _DCCP1Y 0x10
3265 #define _CCP1Y 0x10
3266 #define _DC1B0 0x10
3267 #define _DCCP1X 0x20
3268 #define _CCP1X 0x20
3269 #define _DC1B1 0x20
3271 //==============================================================================
3273 extern __at(0x0FBE) __sfr CCPR1;
3274 extern __at(0x0FBE) __sfr CCPR1L;
3275 extern __at(0x0FBF) __sfr CCPR1H;
3277 //==============================================================================
3278 // ADCON2 Bits
3280 extern __at(0x0FC0) __sfr ADCON2;
3282 typedef union
3284 struct
3286 unsigned ADCS0 : 1;
3287 unsigned ADCS1 : 1;
3288 unsigned ADCS2 : 1;
3289 unsigned ACQT0 : 1;
3290 unsigned ACQT1 : 1;
3291 unsigned ACQT2 : 1;
3292 unsigned : 1;
3293 unsigned ADFM : 1;
3296 struct
3298 unsigned ADCS : 3;
3299 unsigned : 5;
3302 struct
3304 unsigned : 3;
3305 unsigned ACQT : 3;
3306 unsigned : 2;
3308 } __ADCON2bits_t;
3310 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
3312 #define _ADCS0 0x01
3313 #define _ADCS1 0x02
3314 #define _ADCS2 0x04
3315 #define _ACQT0 0x08
3316 #define _ACQT1 0x10
3317 #define _ACQT2 0x20
3318 #define _ADFM 0x80
3320 //==============================================================================
3323 //==============================================================================
3324 // ADCON1 Bits
3326 extern __at(0x0FC1) __sfr ADCON1;
3328 typedef union
3330 struct
3332 unsigned PCFG0 : 1;
3333 unsigned PCFG1 : 1;
3334 unsigned PCFG2 : 1;
3335 unsigned PCFG3 : 1;
3336 unsigned VCFG0 : 1;
3337 unsigned VCFG1 : 1;
3338 unsigned : 1;
3339 unsigned : 1;
3342 struct
3344 unsigned PCFG : 4;
3345 unsigned : 4;
3348 struct
3350 unsigned : 4;
3351 unsigned VCFG : 2;
3352 unsigned : 2;
3354 } __ADCON1bits_t;
3356 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
3358 #define _PCFG0 0x01
3359 #define _PCFG1 0x02
3360 #define _PCFG2 0x04
3361 #define _PCFG3 0x08
3362 #define _VCFG0 0x10
3363 #define _VCFG1 0x20
3365 //==============================================================================
3368 //==============================================================================
3369 // ADCON0 Bits
3371 extern __at(0x0FC2) __sfr ADCON0;
3373 typedef union
3375 struct
3377 unsigned ADON : 1;
3378 unsigned GO_NOT_DONE : 1;
3379 unsigned CHS0 : 1;
3380 unsigned CHS1 : 1;
3381 unsigned CHS2 : 1;
3382 unsigned CHS3 : 1;
3383 unsigned : 1;
3384 unsigned : 1;
3387 struct
3389 unsigned : 1;
3390 unsigned GO_DONE : 1;
3391 unsigned : 1;
3392 unsigned : 1;
3393 unsigned : 1;
3394 unsigned : 1;
3395 unsigned : 1;
3396 unsigned : 1;
3399 struct
3401 unsigned : 1;
3402 unsigned DONE : 1;
3403 unsigned : 1;
3404 unsigned : 1;
3405 unsigned : 1;
3406 unsigned : 1;
3407 unsigned : 1;
3408 unsigned : 1;
3411 struct
3413 unsigned : 1;
3414 unsigned GO : 1;
3415 unsigned : 1;
3416 unsigned : 1;
3417 unsigned : 1;
3418 unsigned : 1;
3419 unsigned : 1;
3420 unsigned : 1;
3423 struct
3425 unsigned : 1;
3426 unsigned NOT_DONE : 1;
3427 unsigned : 1;
3428 unsigned : 1;
3429 unsigned : 1;
3430 unsigned : 1;
3431 unsigned : 1;
3432 unsigned : 1;
3435 struct
3437 unsigned : 2;
3438 unsigned CHS : 4;
3439 unsigned : 2;
3441 } __ADCON0bits_t;
3443 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
3445 #define _ADON 0x01
3446 #define _GO_NOT_DONE 0x02
3447 #define _GO_DONE 0x02
3448 #define _DONE 0x02
3449 #define _GO 0x02
3450 #define _NOT_DONE 0x02
3451 #define _CHS0 0x04
3452 #define _CHS1 0x08
3453 #define _CHS2 0x10
3454 #define _CHS3 0x20
3456 //==============================================================================
3458 extern __at(0x0FC3) __sfr ADRES;
3459 extern __at(0x0FC3) __sfr ADRESL;
3460 extern __at(0x0FC4) __sfr ADRESH;
3462 //==============================================================================
3463 // SSPCON2 Bits
3465 extern __at(0x0FC5) __sfr SSPCON2;
3467 typedef struct
3469 unsigned SEN : 1;
3470 unsigned RSEN : 1;
3471 unsigned PEN : 1;
3472 unsigned RCEN : 1;
3473 unsigned ACKEN : 1;
3474 unsigned ACKDT : 1;
3475 unsigned ACKSTAT : 1;
3476 unsigned GCEN : 1;
3477 } __SSPCON2bits_t;
3479 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
3481 #define _SEN 0x01
3482 #define _RSEN 0x02
3483 #define _PEN 0x04
3484 #define _RCEN 0x08
3485 #define _ACKEN 0x10
3486 #define _ACKDT 0x20
3487 #define _ACKSTAT 0x40
3488 #define _GCEN 0x80
3490 //==============================================================================
3493 //==============================================================================
3494 // SSPCON1 Bits
3496 extern __at(0x0FC6) __sfr SSPCON1;
3498 typedef union
3500 struct
3502 unsigned SSPM0 : 1;
3503 unsigned SSPM1 : 1;
3504 unsigned SSPM2 : 1;
3505 unsigned SSPM3 : 1;
3506 unsigned CKP : 1;
3507 unsigned SSPEN : 1;
3508 unsigned SSPOV : 1;
3509 unsigned WCOL : 1;
3512 struct
3514 unsigned SSPM : 4;
3515 unsigned : 4;
3517 } __SSPCON1bits_t;
3519 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
3521 #define _SSPM0 0x01
3522 #define _SSPM1 0x02
3523 #define _SSPM2 0x04
3524 #define _SSPM3 0x08
3525 #define _CKP 0x10
3526 #define _SSPEN 0x20
3527 #define _SSPOV 0x40
3528 #define _WCOL 0x80
3530 //==============================================================================
3533 //==============================================================================
3534 // SSPSTAT Bits
3536 extern __at(0x0FC7) __sfr SSPSTAT;
3538 typedef union
3540 struct
3542 unsigned BF : 1;
3543 unsigned UA : 1;
3544 unsigned R_NOT_W : 1;
3545 unsigned S : 1;
3546 unsigned P : 1;
3547 unsigned D_NOT_A : 1;
3548 unsigned CKE : 1;
3549 unsigned SMP : 1;
3552 struct
3554 unsigned : 1;
3555 unsigned : 1;
3556 unsigned R_W : 1;
3557 unsigned I2C_START : 1;
3558 unsigned I2C_STOP : 1;
3559 unsigned D_A : 1;
3560 unsigned : 1;
3561 unsigned : 1;
3564 struct
3566 unsigned : 1;
3567 unsigned : 1;
3568 unsigned I2C_READ : 1;
3569 unsigned : 1;
3570 unsigned : 1;
3571 unsigned I2C_DAT : 1;
3572 unsigned : 1;
3573 unsigned : 1;
3576 struct
3578 unsigned : 1;
3579 unsigned : 1;
3580 unsigned NOT_W : 1;
3581 unsigned : 1;
3582 unsigned : 1;
3583 unsigned NOT_A : 1;
3584 unsigned : 1;
3585 unsigned : 1;
3588 struct
3590 unsigned : 1;
3591 unsigned : 1;
3592 unsigned NOT_WRITE : 1;
3593 unsigned : 1;
3594 unsigned : 1;
3595 unsigned NOT_ADDRESS : 1;
3596 unsigned : 1;
3597 unsigned : 1;
3600 struct
3602 unsigned : 1;
3603 unsigned : 1;
3604 unsigned READ_WRITE : 1;
3605 unsigned : 1;
3606 unsigned : 1;
3607 unsigned DATA_ADDRESS : 1;
3608 unsigned : 1;
3609 unsigned : 1;
3612 struct
3614 unsigned : 1;
3615 unsigned : 1;
3616 unsigned R : 1;
3617 unsigned : 1;
3618 unsigned : 1;
3619 unsigned D : 1;
3620 unsigned : 1;
3621 unsigned : 1;
3623 } __SSPSTATbits_t;
3625 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
3627 #define _BF 0x01
3628 #define _UA 0x02
3629 #define _R_NOT_W 0x04
3630 #define _R_W 0x04
3631 #define _I2C_READ 0x04
3632 #define _NOT_W 0x04
3633 #define _NOT_WRITE 0x04
3634 #define _READ_WRITE 0x04
3635 #define _R 0x04
3636 #define _S 0x08
3637 #define _I2C_START 0x08
3638 #define _P 0x10
3639 #define _I2C_STOP 0x10
3640 #define _D_NOT_A 0x20
3641 #define _D_A 0x20
3642 #define _I2C_DAT 0x20
3643 #define _NOT_A 0x20
3644 #define _NOT_ADDRESS 0x20
3645 #define _DATA_ADDRESS 0x20
3646 #define _D 0x20
3647 #define _CKE 0x40
3648 #define _SMP 0x80
3650 //==============================================================================
3652 extern __at(0x0FC8) __sfr SSPADD;
3653 extern __at(0x0FC9) __sfr SSPBUF;
3655 //==============================================================================
3656 // T2CON Bits
3658 extern __at(0x0FCA) __sfr T2CON;
3660 typedef union
3662 struct
3664 unsigned T2CKPS0 : 1;
3665 unsigned T2CKPS1 : 1;
3666 unsigned TMR2ON : 1;
3667 unsigned T2OUTPS0 : 1;
3668 unsigned T2OUTPS1 : 1;
3669 unsigned T2OUTPS2 : 1;
3670 unsigned T2OUTPS3 : 1;
3671 unsigned : 1;
3674 struct
3676 unsigned T2CKPS : 2;
3677 unsigned : 6;
3680 struct
3682 unsigned : 3;
3683 unsigned T2OUTPS : 4;
3684 unsigned : 1;
3686 } __T2CONbits_t;
3688 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
3690 #define _T2CKPS0 0x01
3691 #define _T2CKPS1 0x02
3692 #define _TMR2ON 0x04
3693 #define _T2OUTPS0 0x08
3694 #define _T2OUTPS1 0x10
3695 #define _T2OUTPS2 0x20
3696 #define _T2OUTPS3 0x40
3698 //==============================================================================
3700 extern __at(0x0FCB) __sfr PR2;
3701 extern __at(0x0FCC) __sfr TMR2;
3703 //==============================================================================
3704 // T1CON Bits
3706 extern __at(0x0FCD) __sfr T1CON;
3708 typedef union
3710 struct
3712 unsigned TMR1ON : 1;
3713 unsigned TMR1CS : 1;
3714 unsigned NOT_T1SYNC : 1;
3715 unsigned T1OSCEN : 1;
3716 unsigned T1CKPS0 : 1;
3717 unsigned T1CKPS1 : 1;
3718 unsigned T1RUN : 1;
3719 unsigned RD16 : 1;
3722 struct
3724 unsigned : 1;
3725 unsigned : 1;
3726 unsigned T1INSYNC : 1;
3727 unsigned : 1;
3728 unsigned : 1;
3729 unsigned : 1;
3730 unsigned : 1;
3731 unsigned : 1;
3734 struct
3736 unsigned : 1;
3737 unsigned : 1;
3738 unsigned T1SYNC : 1;
3739 unsigned : 1;
3740 unsigned : 1;
3741 unsigned : 1;
3742 unsigned : 1;
3743 unsigned : 1;
3746 struct
3748 unsigned : 4;
3749 unsigned T1CKPS : 2;
3750 unsigned : 2;
3752 } __T1CONbits_t;
3754 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
3756 #define _TMR1ON 0x01
3757 #define _TMR1CS 0x02
3758 #define _NOT_T1SYNC 0x04
3759 #define _T1INSYNC 0x04
3760 #define _T1SYNC 0x04
3761 #define _T1OSCEN 0x08
3762 #define _T1CKPS0 0x10
3763 #define _T1CKPS1 0x20
3764 #define _T1RUN 0x40
3765 #define _RD16 0x80
3767 //==============================================================================
3769 extern __at(0x0FCE) __sfr TMR1;
3770 extern __at(0x0FCE) __sfr TMR1L;
3771 extern __at(0x0FCF) __sfr TMR1H;
3773 //==============================================================================
3774 // RCON Bits
3776 extern __at(0x0FD0) __sfr RCON;
3778 typedef union
3780 struct
3782 unsigned NOT_BOR : 1;
3783 unsigned NOT_POR : 1;
3784 unsigned NOT_PD : 1;
3785 unsigned NOT_TO : 1;
3786 unsigned NOT_RI : 1;
3787 unsigned : 1;
3788 unsigned SBOREN : 1;
3789 unsigned IPEN : 1;
3792 struct
3794 unsigned BOR : 1;
3795 unsigned POR : 1;
3796 unsigned PD : 1;
3797 unsigned TO : 1;
3798 unsigned RI : 1;
3799 unsigned : 1;
3800 unsigned : 1;
3801 unsigned : 1;
3803 } __RCONbits_t;
3805 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
3807 #define _NOT_BOR 0x01
3808 #define _BOR 0x01
3809 #define _NOT_POR 0x02
3810 #define _POR 0x02
3811 #define _NOT_PD 0x04
3812 #define _PD 0x04
3813 #define _NOT_TO 0x08
3814 #define _TO 0x08
3815 #define _NOT_RI 0x10
3816 #define _RI 0x10
3817 #define _SBOREN 0x40
3818 #define _IPEN 0x80
3820 //==============================================================================
3823 //==============================================================================
3824 // WDTCON Bits
3826 extern __at(0x0FD1) __sfr WDTCON;
3828 typedef union
3830 struct
3832 unsigned SWDTEN : 1;
3833 unsigned : 1;
3834 unsigned : 1;
3835 unsigned : 1;
3836 unsigned : 1;
3837 unsigned : 1;
3838 unsigned : 1;
3839 unsigned : 1;
3842 struct
3844 unsigned SWDTE : 1;
3845 unsigned : 1;
3846 unsigned : 1;
3847 unsigned : 1;
3848 unsigned : 1;
3849 unsigned : 1;
3850 unsigned : 1;
3851 unsigned : 1;
3853 } __WDTCONbits_t;
3855 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
3857 #define _SWDTEN 0x01
3858 #define _SWDTE 0x01
3860 //==============================================================================
3863 //==============================================================================
3864 // HLVDCON Bits
3866 extern __at(0x0FD2) __sfr HLVDCON;
3868 typedef union
3870 struct
3872 unsigned HLVDL0 : 1;
3873 unsigned HLVDL1 : 1;
3874 unsigned HLVDL2 : 1;
3875 unsigned HLVDL3 : 1;
3876 unsigned HLVDEN : 1;
3877 unsigned IRVST : 1;
3878 unsigned : 1;
3879 unsigned VDIRMAG : 1;
3882 struct
3884 unsigned LVDL0 : 1;
3885 unsigned LVDL1 : 1;
3886 unsigned LVDL2 : 1;
3887 unsigned LVDL3 : 1;
3888 unsigned LVDEN : 1;
3889 unsigned BGST : 1;
3890 unsigned : 1;
3891 unsigned : 1;
3894 struct
3896 unsigned LVV0 : 1;
3897 unsigned LVV1 : 1;
3898 unsigned LVV2 : 1;
3899 unsigned LVV3 : 1;
3900 unsigned : 1;
3901 unsigned : 1;
3902 unsigned : 1;
3903 unsigned : 1;
3906 struct
3908 unsigned LVDL : 4;
3909 unsigned : 4;
3912 struct
3914 unsigned HLVDL : 4;
3915 unsigned : 4;
3918 struct
3920 unsigned LVV : 4;
3921 unsigned : 4;
3923 } __HLVDCONbits_t;
3925 extern __at(0x0FD2) volatile __HLVDCONbits_t HLVDCONbits;
3927 #define _HLVDL0 0x01
3928 #define _LVDL0 0x01
3929 #define _LVV0 0x01
3930 #define _HLVDL1 0x02
3931 #define _LVDL1 0x02
3932 #define _LVV1 0x02
3933 #define _HLVDL2 0x04
3934 #define _LVDL2 0x04
3935 #define _LVV2 0x04
3936 #define _HLVDL3 0x08
3937 #define _LVDL3 0x08
3938 #define _LVV3 0x08
3939 #define _HLVDEN 0x10
3940 #define _LVDEN 0x10
3941 #define _IRVST 0x20
3942 #define _BGST 0x20
3943 #define _VDIRMAG 0x80
3945 //==============================================================================
3948 //==============================================================================
3949 // LVDCON Bits
3951 extern __at(0x0FD2) __sfr LVDCON;
3953 typedef union
3955 struct
3957 unsigned HLVDL0 : 1;
3958 unsigned HLVDL1 : 1;
3959 unsigned HLVDL2 : 1;
3960 unsigned HLVDL3 : 1;
3961 unsigned HLVDEN : 1;
3962 unsigned IRVST : 1;
3963 unsigned : 1;
3964 unsigned VDIRMAG : 1;
3967 struct
3969 unsigned LVDL0 : 1;
3970 unsigned LVDL1 : 1;
3971 unsigned LVDL2 : 1;
3972 unsigned LVDL3 : 1;
3973 unsigned LVDEN : 1;
3974 unsigned BGST : 1;
3975 unsigned : 1;
3976 unsigned : 1;
3979 struct
3981 unsigned LVV0 : 1;
3982 unsigned LVV1 : 1;
3983 unsigned LVV2 : 1;
3984 unsigned LVV3 : 1;
3985 unsigned : 1;
3986 unsigned : 1;
3987 unsigned : 1;
3988 unsigned : 1;
3991 struct
3993 unsigned LVV : 4;
3994 unsigned : 4;
3997 struct
3999 unsigned HLVDL : 4;
4000 unsigned : 4;
4003 struct
4005 unsigned LVDL : 4;
4006 unsigned : 4;
4008 } __LVDCONbits_t;
4010 extern __at(0x0FD2) volatile __LVDCONbits_t LVDCONbits;
4012 #define _LVDCON_HLVDL0 0x01
4013 #define _LVDCON_LVDL0 0x01
4014 #define _LVDCON_LVV0 0x01
4015 #define _LVDCON_HLVDL1 0x02
4016 #define _LVDCON_LVDL1 0x02
4017 #define _LVDCON_LVV1 0x02
4018 #define _LVDCON_HLVDL2 0x04
4019 #define _LVDCON_LVDL2 0x04
4020 #define _LVDCON_LVV2 0x04
4021 #define _LVDCON_HLVDL3 0x08
4022 #define _LVDCON_LVDL3 0x08
4023 #define _LVDCON_LVV3 0x08
4024 #define _LVDCON_HLVDEN 0x10
4025 #define _LVDCON_LVDEN 0x10
4026 #define _LVDCON_IRVST 0x20
4027 #define _LVDCON_BGST 0x20
4028 #define _LVDCON_VDIRMAG 0x80
4030 //==============================================================================
4033 //==============================================================================
4034 // OSCCON Bits
4036 extern __at(0x0FD3) __sfr OSCCON;
4038 typedef union
4040 struct
4042 unsigned SCS0 : 1;
4043 unsigned SCS1 : 1;
4044 unsigned IOFS : 1;
4045 unsigned OSTS : 1;
4046 unsigned IRCF0 : 1;
4047 unsigned IRCF1 : 1;
4048 unsigned IRCF2 : 1;
4049 unsigned IDLEN : 1;
4052 struct
4054 unsigned : 1;
4055 unsigned : 1;
4056 unsigned FLTS : 1;
4057 unsigned : 1;
4058 unsigned : 1;
4059 unsigned : 1;
4060 unsigned : 1;
4061 unsigned : 1;
4064 struct
4066 unsigned SCS : 2;
4067 unsigned : 6;
4070 struct
4072 unsigned : 4;
4073 unsigned IRCF : 3;
4074 unsigned : 1;
4076 } __OSCCONbits_t;
4078 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
4080 #define _SCS0 0x01
4081 #define _SCS1 0x02
4082 #define _IOFS 0x04
4083 #define _FLTS 0x04
4084 #define _OSTS 0x08
4085 #define _IRCF0 0x10
4086 #define _IRCF1 0x20
4087 #define _IRCF2 0x40
4088 #define _IDLEN 0x80
4090 //==============================================================================
4093 //==============================================================================
4094 // T0CON Bits
4096 extern __at(0x0FD5) __sfr T0CON;
4098 typedef union
4100 struct
4102 unsigned T0PS0 : 1;
4103 unsigned T0PS1 : 1;
4104 unsigned T0PS2 : 1;
4105 unsigned PSA : 1;
4106 unsigned T0SE : 1;
4107 unsigned T0CS : 1;
4108 unsigned T08BIT : 1;
4109 unsigned TMR0ON : 1;
4112 struct
4114 unsigned T0PS : 3;
4115 unsigned : 5;
4117 } __T0CONbits_t;
4119 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
4121 #define _T0PS0 0x01
4122 #define _T0PS1 0x02
4123 #define _T0PS2 0x04
4124 #define _PSA 0x08
4125 #define _T0SE 0x10
4126 #define _T0CS 0x20
4127 #define _T08BIT 0x40
4128 #define _TMR0ON 0x80
4130 //==============================================================================
4132 extern __at(0x0FD6) __sfr TMR0;
4133 extern __at(0x0FD6) __sfr TMR0L;
4134 extern __at(0x0FD7) __sfr TMR0H;
4136 //==============================================================================
4137 // STATUS Bits
4139 extern __at(0x0FD8) __sfr STATUS;
4141 typedef struct
4143 unsigned C : 1;
4144 unsigned DC : 1;
4145 unsigned Z : 1;
4146 unsigned OV : 1;
4147 unsigned N : 1;
4148 unsigned : 1;
4149 unsigned : 1;
4150 unsigned : 1;
4151 } __STATUSbits_t;
4153 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
4155 #define _C 0x01
4156 #define _DC 0x02
4157 #define _Z 0x04
4158 #define _OV 0x08
4159 #define _N 0x10
4161 //==============================================================================
4163 extern __at(0x0FD9) __sfr FSR2L;
4164 extern __at(0x0FDA) __sfr FSR2H;
4165 extern __at(0x0FDB) __sfr PLUSW2;
4166 extern __at(0x0FDC) __sfr PREINC2;
4167 extern __at(0x0FDD) __sfr POSTDEC2;
4168 extern __at(0x0FDE) __sfr POSTINC2;
4169 extern __at(0x0FDF) __sfr INDF2;
4170 extern __at(0x0FE0) __sfr BSR;
4171 extern __at(0x0FE1) __sfr FSR1L;
4172 extern __at(0x0FE2) __sfr FSR1H;
4173 extern __at(0x0FE3) __sfr PLUSW1;
4174 extern __at(0x0FE4) __sfr PREINC1;
4175 extern __at(0x0FE5) __sfr POSTDEC1;
4176 extern __at(0x0FE6) __sfr POSTINC1;
4177 extern __at(0x0FE7) __sfr INDF1;
4178 extern __at(0x0FE8) __sfr WREG;
4179 extern __at(0x0FE9) __sfr FSR0L;
4180 extern __at(0x0FEA) __sfr FSR0H;
4181 extern __at(0x0FEB) __sfr PLUSW0;
4182 extern __at(0x0FEC) __sfr PREINC0;
4183 extern __at(0x0FED) __sfr POSTDEC0;
4184 extern __at(0x0FEE) __sfr POSTINC0;
4185 extern __at(0x0FEF) __sfr INDF0;
4187 //==============================================================================
4188 // INTCON3 Bits
4190 extern __at(0x0FF0) __sfr INTCON3;
4192 typedef union
4194 struct
4196 unsigned INT1IF : 1;
4197 unsigned INT2IF : 1;
4198 unsigned INT3IF : 1;
4199 unsigned INT1IE : 1;
4200 unsigned INT2IE : 1;
4201 unsigned INT3IE : 1;
4202 unsigned INT1IP : 1;
4203 unsigned INT2IP : 1;
4206 struct
4208 unsigned INT1F : 1;
4209 unsigned INT2F : 1;
4210 unsigned INT3F : 1;
4211 unsigned INT1E : 1;
4212 unsigned INT2E : 1;
4213 unsigned INT3E : 1;
4214 unsigned INT1P : 1;
4215 unsigned INT2P : 1;
4217 } __INTCON3bits_t;
4219 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
4221 #define _INT1IF 0x01
4222 #define _INT1F 0x01
4223 #define _INT2IF 0x02
4224 #define _INT2F 0x02
4225 #define _INT3IF 0x04
4226 #define _INT3F 0x04
4227 #define _INT1IE 0x08
4228 #define _INT1E 0x08
4229 #define _INT2IE 0x10
4230 #define _INT2E 0x10
4231 #define _INT3IE 0x20
4232 #define _INT3E 0x20
4233 #define _INT1IP 0x40
4234 #define _INT1P 0x40
4235 #define _INT2IP 0x80
4236 #define _INT2P 0x80
4238 //==============================================================================
4241 //==============================================================================
4242 // INTCON2 Bits
4244 extern __at(0x0FF1) __sfr INTCON2;
4246 typedef union
4248 struct
4250 unsigned RBIP : 1;
4251 unsigned INT3IP : 1;
4252 unsigned TMR0IP : 1;
4253 unsigned INTEDG3 : 1;
4254 unsigned INTEDG2 : 1;
4255 unsigned INTEDG1 : 1;
4256 unsigned INTEDG0 : 1;
4257 unsigned NOT_RBPU : 1;
4260 struct
4262 unsigned : 1;
4263 unsigned INT3P : 1;
4264 unsigned T0IP : 1;
4265 unsigned : 1;
4266 unsigned : 1;
4267 unsigned : 1;
4268 unsigned : 1;
4269 unsigned RBPU : 1;
4271 } __INTCON2bits_t;
4273 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
4275 #define _RBIP 0x01
4276 #define _INT3IP 0x02
4277 #define _INT3P 0x02
4278 #define _TMR0IP 0x04
4279 #define _T0IP 0x04
4280 #define _INTEDG3 0x08
4281 #define _INTEDG2 0x10
4282 #define _INTEDG1 0x20
4283 #define _INTEDG0 0x40
4284 #define _NOT_RBPU 0x80
4285 #define _RBPU 0x80
4287 //==============================================================================
4290 //==============================================================================
4291 // INTCON Bits
4293 extern __at(0x0FF2) __sfr INTCON;
4295 typedef union
4297 struct
4299 unsigned RBIF : 1;
4300 unsigned INT0IF : 1;
4301 unsigned TMR0IF : 1;
4302 unsigned RBIE : 1;
4303 unsigned INT0IE : 1;
4304 unsigned TMR0IE : 1;
4305 unsigned PEIE_GIEL : 1;
4306 unsigned GIE_GIEH : 1;
4309 struct
4311 unsigned : 1;
4312 unsigned INT0F : 1;
4313 unsigned T0IF : 1;
4314 unsigned : 1;
4315 unsigned INT0E : 1;
4316 unsigned T0IE : 1;
4317 unsigned PEIE : 1;
4318 unsigned GIE : 1;
4321 struct
4323 unsigned : 1;
4324 unsigned : 1;
4325 unsigned : 1;
4326 unsigned : 1;
4327 unsigned : 1;
4328 unsigned : 1;
4329 unsigned GIEL : 1;
4330 unsigned GIEH : 1;
4332 } __INTCONbits_t;
4334 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
4336 #define _RBIF 0x01
4337 #define _INT0IF 0x02
4338 #define _INT0F 0x02
4339 #define _TMR0IF 0x04
4340 #define _T0IF 0x04
4341 #define _RBIE 0x08
4342 #define _INT0IE 0x10
4343 #define _INT0E 0x10
4344 #define _TMR0IE 0x20
4345 #define _T0IE 0x20
4346 #define _PEIE_GIEL 0x40
4347 #define _PEIE 0x40
4348 #define _GIEL 0x40
4349 #define _GIE_GIEH 0x80
4350 #define _GIE 0x80
4351 #define _GIEH 0x80
4353 //==============================================================================
4355 extern __at(0x0FF3) __sfr PROD;
4356 extern __at(0x0FF3) __sfr PRODL;
4357 extern __at(0x0FF4) __sfr PRODH;
4358 extern __at(0x0FF5) __sfr TABLAT;
4359 extern __at(0x0FF6) __sfr TBLPTR;
4360 extern __at(0x0FF6) __sfr TBLPTRL;
4361 extern __at(0x0FF7) __sfr TBLPTRH;
4362 extern __at(0x0FF8) __sfr TBLPTRU;
4363 extern __at(0x0FF9) __sfr PC;
4364 extern __at(0x0FF9) __sfr PCL;
4365 extern __at(0x0FFA) __sfr PCLATH;
4366 extern __at(0x0FFB) __sfr PCLATU;
4368 //==============================================================================
4369 // STKPTR Bits
4371 extern __at(0x0FFC) __sfr STKPTR;
4373 typedef union
4375 struct
4377 unsigned STKPTR0 : 1;
4378 unsigned STKPTR1 : 1;
4379 unsigned STKPTR2 : 1;
4380 unsigned STKPTR3 : 1;
4381 unsigned STKPTR4 : 1;
4382 unsigned : 1;
4383 unsigned STKUNF : 1;
4384 unsigned STKFUL : 1;
4387 struct
4389 unsigned : 1;
4390 unsigned : 1;
4391 unsigned : 1;
4392 unsigned : 1;
4393 unsigned : 1;
4394 unsigned : 1;
4395 unsigned : 1;
4396 unsigned STKOVF : 1;
4399 struct
4401 unsigned STKPTR : 5;
4402 unsigned : 3;
4404 } __STKPTRbits_t;
4406 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
4408 #define _STKPTR0 0x01
4409 #define _STKPTR1 0x02
4410 #define _STKPTR2 0x04
4411 #define _STKPTR3 0x08
4412 #define _STKPTR4 0x10
4413 #define _STKUNF 0x40
4414 #define _STKFUL 0x80
4415 #define _STKOVF 0x80
4417 //==============================================================================
4419 extern __at(0x0FFD) __sfr TOS;
4420 extern __at(0x0FFD) __sfr TOSL;
4421 extern __at(0x0FFE) __sfr TOSH;
4422 extern __at(0x0FFF) __sfr TOSU;
4424 //==============================================================================
4426 // Configuration Bits
4428 //==============================================================================
4430 #define __CONFIG1H 0x300001
4431 #define __CONFIG2L 0x300002
4432 #define __CONFIG2H 0x300003
4433 #define __CONFIG3L 0x300004
4434 #define __CONFIG3H 0x300005
4435 #define __CONFIG4L 0x300006
4436 #define __CONFIG5L 0x300008
4437 #define __CONFIG7L 0x30000C
4439 //----------------------------- CONFIG1H Options -------------------------------
4441 #define _OSC_LP_1H 0xF0 // LP oscillator.
4442 #define _OSC_XT_1H 0xF1 // XT oscillator.
4443 #define _OSC_HS_1H 0xF2 // HS oscillator.
4444 #define _OSC_RC_1H 0xF3 // External RC oscillator, CLKO function on RA6.
4445 #define _OSC_EC_1H 0xF4 // EC oscillator, CLKO function on RA6.
4446 #define _OSC_ECIO_1H 0xF5 // EC oscillator, port function on RA6.
4447 #define _OSC_HSPLL_1H 0xF6 // HS oscillator, PLL enabled (clock frequency = 4 x FOSC1).
4448 #define _OSC_RCIO_1H 0xF7 // External RC oscillator, port function on RA6.
4449 #define _OSC_INTIO67_1H 0xF8 // Internal oscillator block, port function on RA6 and RA7.
4450 #define _OSC_INTIO7_1H 0xF9 // Internal oscillator block, CLKO function on RA6, port function on RA7.
4451 #define _FCMEN_OFF_1H 0xBF // Fail-Safe Clock Monitor disabled.
4452 #define _FCMEN_ON_1H 0xFF // Fail-Safe Clock Monitor enabled.
4453 #define _IESO_OFF_1H 0x7F // Oscillator Switchover mode disabled.
4454 #define _IESO_ON_1H 0xFF // Oscillator Switchover mode enabled.
4456 //----------------------------- CONFIG2L Options -------------------------------
4458 #define _PWRT_ON_2L 0xFE // PWRT enabled.
4459 #define _PWRT_OFF_2L 0xFF // PWRT disabled.
4460 #define _BOREN_OFF_2L 0xF9 // Brown-out Reset disabled in hardware and software.
4461 #define _BOREN_ON_2L 0xFB // Brown-out Reset enabled and controlled by software (SBOREN is enabled).
4462 #define _BOREN_NOSLP_2L 0xFD // Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled).
4463 #define _BOREN_SBORDIS_2L 0xFF // Brown-out Reset enabled in hardware only (SBOREN is disabled).
4464 #define _BORV_0_2L 0xE7 // VBOR set to 4.6V.
4465 #define _BORV_1_2L 0xEF // VBOR set to 4.3V.
4466 #define _BORV_2_2L 0xF7 // VBOR set to 2.8V.
4467 #define _BORV_3_2L 0xFF // VBOR set to 2.1V.
4469 //----------------------------- CONFIG2H Options -------------------------------
4471 #define _WDT_OFF_2H 0xFE // WDT disabled (control is placed on the SWDTEN bit).
4472 #define _WDT_ON_2H 0xFF // WDT enabled.
4473 #define _WDTPS_1_2H 0xE1 // 1:1.
4474 #define _WDTPS_2_2H 0xE3 // 1:2.
4475 #define _WDTPS_4_2H 0xE5 // 1:4.
4476 #define _WDTPS_8_2H 0xE7 // 1:8.
4477 #define _WDTPS_16_2H 0xE9 // 1:16.
4478 #define _WDTPS_32_2H 0xEB // 1:32.
4479 #define _WDTPS_64_2H 0xED // 1:64.
4480 #define _WDTPS_128_2H 0xEF // 1:128.
4481 #define _WDTPS_256_2H 0xF1 // 1:256.
4482 #define _WDTPS_512_2H 0xF3 // 1:512.
4483 #define _WDTPS_1024_2H 0xF5 // 1:1024.
4484 #define _WDTPS_2048_2H 0xF7 // 1:2048.
4485 #define _WDTPS_4096_2H 0xF9 // 1:4096.
4486 #define _WDTPS_8192_2H 0xFB // 1:8192.
4487 #define _WDTPS_16384_2H 0xFD // 1:16384.
4488 #define _WDTPS_32768_2H 0xFF // 1:32768.
4490 //----------------------------- CONFIG3L Options -------------------------------
4492 #define _PM_EM_3L 0xFC // Extended Microcontroller mode.
4493 #define _PM_MPB_3L 0xFD // Microprocessor with Boot Block mode.
4494 #define _PM_MP_3L 0xFE // Microprocessor mode.
4495 #define _PM_MC_3L 0xFF // Microcontroller mode.
4496 #define _BW_8_3L 0xBF // 8-bit External Bus Data Width.
4497 #define _BW_16_3L 0xFF // 16-bit External Bus Data Width.
4498 #define _WAIT_ON_3L 0x7F // Wait programmed by WAIT1 and WAIT0 bits of MEMCOM register (MEMCOM<5:4>).
4499 #define _WAIT_OFF_3L 0xFF // Wait selections unavailable, device will not wait.
4501 //----------------------------- CONFIG3H Options -------------------------------
4503 #define _CCP2MX_PORTBE_3H 0xFE // CCP2 is multiplexed with RB3 in Extended Microcontroller, Microprocessor or Microprocessor with Boot Block mode. Or with RE7 in Microcontroller mode.
4504 #define _CCP2MX_PORTC_3H 0xFF // CCP2 input/output is multiplexed with RC1.
4505 #define _LPT1OSC_OFF_3H 0xFB // Timer1 configured for higher power operation.
4506 #define _LPT1OSC_ON_3H 0xFF // Timer1 configured for low-power operation.
4507 #define _MCLRE_OFF_3H 0x7F // RG5 input pin enabled; MCLR disabled.
4508 #define _MCLRE_ON_3H 0xFF // MCLR pin enabled; RG5 input pin disabled.
4510 //----------------------------- CONFIG4L Options -------------------------------
4512 #define _STVREN_OFF_4L 0xFE // Stack full/underflow will not cause Reset.
4513 #define _STVREN_ON_4L 0xFF // Stack full/underflow will cause Reset.
4514 #define _XINST_OFF_4L 0xBF // Instruction set extension and Indexed Addressing mode disabled (Legacy mode).
4515 #define _XINST_ON_4L 0xFF // Instruction set extension and Indexed Addressing mode enabled.
4516 #define _DEBUG_ON_4L 0x7F // Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug.
4517 #define _DEBUG_OFF_4L 0xFF // Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins.
4519 //----------------------------- CONFIG5L Options -------------------------------
4521 #define _CP_ON_5L 0xFE // Program memory block code-protected.
4522 #define _CP_OFF_5L 0xFF // Program memory block not code-protected.
4524 //----------------------------- CONFIG7L Options -------------------------------
4526 #define _EBTR_ON_7L 0xFE // Internal program memory block protected from table reads executed from external memory block.
4527 #define _EBTR_OFF_7L 0xFF // Internal program memory block not protected from table reads executed from external memory block.
4529 //==============================================================================
4531 #define __DEVID1 0x3FFFFE
4532 #define __DEVID2 0x3FFFFF
4534 #define __IDLOC0 0x200000
4535 #define __IDLOC1 0x200001
4536 #define __IDLOC2 0x200002
4537 #define __IDLOC3 0x200003
4538 #define __IDLOC4 0x200004
4539 #define __IDLOC5 0x200005
4540 #define __IDLOC6 0x200006
4541 #define __IDLOC7 0x200007
4543 #endif // #ifndef __PIC18F8310_H__