Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f45j10.h
blob3b9e5b8b1e23b2ffc23ed093bf37f6de26942081
1 /*
2 * This declarations of the PIC18F45J10 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:29 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 __PIC18F45J10_H__
26 #define __PIC18F45J10_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // PORTA Bits
40 extern __at(0x0F80) __sfr PORTA;
42 typedef union
44 struct
46 unsigned RA0 : 1;
47 unsigned RA1 : 1;
48 unsigned RA2 : 1;
49 unsigned RA3 : 1;
50 unsigned : 1;
51 unsigned RA5 : 1;
52 unsigned : 1;
53 unsigned : 1;
56 struct
58 unsigned AN0 : 1;
59 unsigned AN1 : 1;
60 unsigned AN2 : 1;
61 unsigned AN3 : 1;
62 unsigned : 1;
63 unsigned AN4 : 1;
64 unsigned : 1;
65 unsigned : 1;
68 struct
70 unsigned : 1;
71 unsigned : 1;
72 unsigned VREFM : 1;
73 unsigned VREFP : 1;
74 unsigned : 1;
75 unsigned SS1 : 1;
76 unsigned : 1;
77 unsigned : 1;
80 struct
82 unsigned : 1;
83 unsigned : 1;
84 unsigned CVREF : 1;
85 unsigned : 1;
86 unsigned : 1;
87 unsigned C2OUT : 1;
88 unsigned : 1;
89 unsigned : 1;
92 struct
94 unsigned : 1;
95 unsigned : 1;
96 unsigned : 1;
97 unsigned : 1;
98 unsigned : 1;
99 unsigned NOT_SS1 : 1;
100 unsigned : 1;
101 unsigned : 1;
103 } __PORTAbits_t;
105 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
107 #define _PORTA_RA0 0x01
108 #define _PORTA_AN0 0x01
109 #define _PORTA_RA1 0x02
110 #define _PORTA_AN1 0x02
111 #define _PORTA_RA2 0x04
112 #define _PORTA_AN2 0x04
113 #define _PORTA_VREFM 0x04
114 #define _PORTA_CVREF 0x04
115 #define _PORTA_RA3 0x08
116 #define _PORTA_AN3 0x08
117 #define _PORTA_VREFP 0x08
118 #define _PORTA_RA5 0x20
119 #define _PORTA_AN4 0x20
120 #define _PORTA_SS1 0x20
121 #define _PORTA_C2OUT 0x20
122 #define _PORTA_NOT_SS1 0x20
124 //==============================================================================
127 //==============================================================================
128 // PORTB Bits
130 extern __at(0x0F81) __sfr PORTB;
132 typedef union
134 struct
136 unsigned RB0 : 1;
137 unsigned RB1 : 1;
138 unsigned RB2 : 1;
139 unsigned RB3 : 1;
140 unsigned RB4 : 1;
141 unsigned RB5 : 1;
142 unsigned RB6 : 1;
143 unsigned RB7 : 1;
146 struct
148 unsigned INT0 : 1;
149 unsigned INT1 : 1;
150 unsigned INT2 : 1;
151 unsigned CCP2 : 1;
152 unsigned KBI0 : 1;
153 unsigned KBI1 : 1;
154 unsigned KBI2 : 1;
155 unsigned KBI3 : 1;
158 struct
160 unsigned AN12 : 1;
161 unsigned AN10 : 1;
162 unsigned AN8 : 1;
163 unsigned AN9 : 1;
164 unsigned AN11 : 1;
165 unsigned T0CKI : 1;
166 unsigned PGC : 1;
167 unsigned PGD : 1;
170 struct
172 unsigned FLT0 : 1;
173 unsigned : 1;
174 unsigned : 1;
175 unsigned : 1;
176 unsigned : 1;
177 unsigned C1OUT : 1;
178 unsigned : 1;
179 unsigned : 1;
182 struct
184 unsigned INT : 3;
185 unsigned : 5;
188 struct
190 unsigned : 4;
191 unsigned KBI : 4;
193 } __PORTBbits_t;
195 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
197 #define _PORTB_RB0 0x01
198 #define _PORTB_INT0 0x01
199 #define _PORTB_AN12 0x01
200 #define _PORTB_FLT0 0x01
201 #define _PORTB_RB1 0x02
202 #define _PORTB_INT1 0x02
203 #define _PORTB_AN10 0x02
204 #define _PORTB_RB2 0x04
205 #define _PORTB_INT2 0x04
206 #define _PORTB_AN8 0x04
207 #define _PORTB_RB3 0x08
208 #define _PORTB_CCP2 0x08
209 #define _PORTB_AN9 0x08
210 #define _PORTB_RB4 0x10
211 #define _PORTB_KBI0 0x10
212 #define _PORTB_AN11 0x10
213 #define _PORTB_RB5 0x20
214 #define _PORTB_KBI1 0x20
215 #define _PORTB_T0CKI 0x20
216 #define _PORTB_C1OUT 0x20
217 #define _PORTB_RB6 0x40
218 #define _PORTB_KBI2 0x40
219 #define _PORTB_PGC 0x40
220 #define _PORTB_RB7 0x80
221 #define _PORTB_KBI3 0x80
222 #define _PORTB_PGD 0x80
224 //==============================================================================
227 //==============================================================================
228 // PORTC Bits
230 extern __at(0x0F82) __sfr PORTC;
232 typedef union
234 struct
236 unsigned RC0 : 1;
237 unsigned RC1 : 1;
238 unsigned RC2 : 1;
239 unsigned RC3 : 1;
240 unsigned RC4 : 1;
241 unsigned RC5 : 1;
242 unsigned RC6 : 1;
243 unsigned RC7 : 1;
246 struct
248 unsigned T1OSO : 1;
249 unsigned T1OSI : 1;
250 unsigned CCP1 : 1;
251 unsigned SCK1 : 1;
252 unsigned SDI1 : 1;
253 unsigned SDO1 : 1;
254 unsigned TX : 1;
255 unsigned RX : 1;
258 struct
260 unsigned T1CKI : 1;
261 unsigned CCP2 : 1;
262 unsigned P1A : 1;
263 unsigned SCL1 : 1;
264 unsigned SDA1 : 1;
265 unsigned SDO : 1;
266 unsigned CK : 1;
267 unsigned : 1;
270 struct
272 unsigned : 1;
273 unsigned : 1;
274 unsigned : 1;
275 unsigned SCK : 1;
276 unsigned SDI : 1;
277 unsigned : 1;
278 unsigned : 1;
279 unsigned : 1;
282 struct
284 unsigned : 1;
285 unsigned : 1;
286 unsigned : 1;
287 unsigned SCL : 1;
288 unsigned SDA : 1;
289 unsigned : 1;
290 unsigned : 1;
291 unsigned : 1;
293 } __PORTCbits_t;
295 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
297 #define _PORTC_RC0 0x01
298 #define _PORTC_T1OSO 0x01
299 #define _PORTC_T1CKI 0x01
300 #define _PORTC_RC1 0x02
301 #define _PORTC_T1OSI 0x02
302 #define _PORTC_CCP2 0x02
303 #define _PORTC_RC2 0x04
304 #define _PORTC_CCP1 0x04
305 #define _PORTC_P1A 0x04
306 #define _PORTC_RC3 0x08
307 #define _PORTC_SCK1 0x08
308 #define _PORTC_SCL1 0x08
309 #define _PORTC_SCK 0x08
310 #define _PORTC_SCL 0x08
311 #define _PORTC_RC4 0x10
312 #define _PORTC_SDI1 0x10
313 #define _PORTC_SDA1 0x10
314 #define _PORTC_SDI 0x10
315 #define _PORTC_SDA 0x10
316 #define _PORTC_RC5 0x20
317 #define _PORTC_SDO1 0x20
318 #define _PORTC_SDO 0x20
319 #define _PORTC_RC6 0x40
320 #define _PORTC_TX 0x40
321 #define _PORTC_CK 0x40
322 #define _PORTC_RC7 0x80
323 #define _PORTC_RX 0x80
325 //==============================================================================
328 //==============================================================================
329 // PORTD Bits
331 extern __at(0x0F83) __sfr PORTD;
333 typedef union
335 struct
337 unsigned RD0 : 1;
338 unsigned RD1 : 1;
339 unsigned RD2 : 1;
340 unsigned RD3 : 1;
341 unsigned RD4 : 1;
342 unsigned RD5 : 1;
343 unsigned RD6 : 1;
344 unsigned RD7 : 1;
347 struct
349 unsigned PSP0 : 1;
350 unsigned PSP1 : 1;
351 unsigned PSP2 : 1;
352 unsigned PSP3 : 1;
353 unsigned PSP4 : 1;
354 unsigned PSP5 : 1;
355 unsigned PSP6 : 1;
356 unsigned PSP7 : 1;
359 struct
361 unsigned SCK2 : 1;
362 unsigned SDI2 : 1;
363 unsigned SDO2 : 1;
364 unsigned SS2 : 1;
365 unsigned : 1;
366 unsigned P1B : 1;
367 unsigned P1C : 1;
368 unsigned P1D : 1;
371 struct
373 unsigned SCL2 : 1;
374 unsigned SDA2 : 1;
375 unsigned : 1;
376 unsigned NOT_SS2 : 1;
377 unsigned : 1;
378 unsigned : 1;
379 unsigned : 1;
380 unsigned : 1;
382 } __PORTDbits_t;
384 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
386 #define _PORTD_RD0 0x01
387 #define _PORTD_PSP0 0x01
388 #define _PORTD_SCK2 0x01
389 #define _PORTD_SCL2 0x01
390 #define _PORTD_RD1 0x02
391 #define _PORTD_PSP1 0x02
392 #define _PORTD_SDI2 0x02
393 #define _PORTD_SDA2 0x02
394 #define _PORTD_RD2 0x04
395 #define _PORTD_PSP2 0x04
396 #define _PORTD_SDO2 0x04
397 #define _PORTD_RD3 0x08
398 #define _PORTD_PSP3 0x08
399 #define _PORTD_SS2 0x08
400 #define _PORTD_NOT_SS2 0x08
401 #define _PORTD_RD4 0x10
402 #define _PORTD_PSP4 0x10
403 #define _PORTD_RD5 0x20
404 #define _PORTD_PSP5 0x20
405 #define _PORTD_P1B 0x20
406 #define _PORTD_RD6 0x40
407 #define _PORTD_PSP6 0x40
408 #define _PORTD_P1C 0x40
409 #define _PORTD_RD7 0x80
410 #define _PORTD_PSP7 0x80
411 #define _PORTD_P1D 0x80
413 //==============================================================================
416 //==============================================================================
417 // PORTE Bits
419 extern __at(0x0F84) __sfr PORTE;
421 typedef union
423 struct
425 unsigned RE0 : 1;
426 unsigned RE1 : 1;
427 unsigned RE2 : 1;
428 unsigned : 1;
429 unsigned : 1;
430 unsigned : 1;
431 unsigned : 1;
432 unsigned : 1;
435 struct
437 unsigned AN5 : 1;
438 unsigned AN6 : 1;
439 unsigned AN7 : 1;
440 unsigned : 1;
441 unsigned : 1;
442 unsigned : 1;
443 unsigned : 1;
444 unsigned : 1;
447 struct
449 unsigned RD : 1;
450 unsigned WR : 1;
451 unsigned CS : 1;
452 unsigned : 1;
453 unsigned : 1;
454 unsigned : 1;
455 unsigned : 1;
456 unsigned : 1;
459 struct
461 unsigned NOT_RD : 1;
462 unsigned NOT_WR : 1;
463 unsigned NOT_CS : 1;
464 unsigned : 1;
465 unsigned : 1;
466 unsigned : 1;
467 unsigned : 1;
468 unsigned : 1;
471 struct
473 unsigned RE : 3;
474 unsigned : 5;
476 } __PORTEbits_t;
478 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
480 #define _PORTE_RE0 0x01
481 #define _PORTE_AN5 0x01
482 #define _PORTE_RD 0x01
483 #define _PORTE_NOT_RD 0x01
484 #define _PORTE_RE1 0x02
485 #define _PORTE_AN6 0x02
486 #define _PORTE_WR 0x02
487 #define _PORTE_NOT_WR 0x02
488 #define _PORTE_RE2 0x04
489 #define _PORTE_AN7 0x04
490 #define _PORTE_CS 0x04
491 #define _PORTE_NOT_CS 0x04
493 //==============================================================================
496 //==============================================================================
497 // SSP2CON2 Bits
499 extern __at(0x0F85) __sfr SSP2CON2;
501 typedef struct
503 unsigned SEN : 1;
504 unsigned RSEN : 1;
505 unsigned PEN : 1;
506 unsigned RCEN : 1;
507 unsigned ACKEN : 1;
508 unsigned ACKDT : 1;
509 unsigned ACKSTAT : 1;
510 unsigned GCEN : 1;
511 } __SSP2CON2bits_t;
513 extern __at(0x0F85) volatile __SSP2CON2bits_t SSP2CON2bits;
515 #define _SSP2CON2_SEN 0x01
516 #define _SSP2CON2_RSEN 0x02
517 #define _SSP2CON2_PEN 0x04
518 #define _SSP2CON2_RCEN 0x08
519 #define _SSP2CON2_ACKEN 0x10
520 #define _SSP2CON2_ACKDT 0x20
521 #define _SSP2CON2_ACKSTAT 0x40
522 #define _SSP2CON2_GCEN 0x80
524 //==============================================================================
527 //==============================================================================
528 // SSP2CON1 Bits
530 extern __at(0x0F86) __sfr SSP2CON1;
532 typedef union
534 struct
536 unsigned SSPM0 : 1;
537 unsigned SSPM1 : 1;
538 unsigned SSPM2 : 1;
539 unsigned SSPM3 : 1;
540 unsigned CKP : 1;
541 unsigned SSPEN : 1;
542 unsigned SSPOV : 1;
543 unsigned WCOL : 1;
546 struct
548 unsigned SSPM : 4;
549 unsigned : 4;
551 } __SSP2CON1bits_t;
553 extern __at(0x0F86) volatile __SSP2CON1bits_t SSP2CON1bits;
555 #define _SSP2CON1_SSPM0 0x01
556 #define _SSP2CON1_SSPM1 0x02
557 #define _SSP2CON1_SSPM2 0x04
558 #define _SSP2CON1_SSPM3 0x08
559 #define _SSP2CON1_CKP 0x10
560 #define _SSP2CON1_SSPEN 0x20
561 #define _SSP2CON1_SSPOV 0x40
562 #define _SSP2CON1_WCOL 0x80
564 //==============================================================================
567 //==============================================================================
568 // SSP2STAT Bits
570 extern __at(0x0F87) __sfr SSP2STAT;
572 typedef union
574 struct
576 unsigned BF : 1;
577 unsigned UA : 1;
578 unsigned R_NOT_W : 1;
579 unsigned S : 1;
580 unsigned P : 1;
581 unsigned D_NOT_A : 1;
582 unsigned CKE : 1;
583 unsigned SMP : 1;
586 struct
588 unsigned : 1;
589 unsigned : 1;
590 unsigned R_W : 1;
591 unsigned I2C_START : 1;
592 unsigned I2C_STOP : 1;
593 unsigned D_A : 1;
594 unsigned : 1;
595 unsigned : 1;
598 struct
600 unsigned : 1;
601 unsigned : 1;
602 unsigned I2C_READ : 1;
603 unsigned : 1;
604 unsigned : 1;
605 unsigned I2C_DAT : 1;
606 unsigned : 1;
607 unsigned : 1;
610 struct
612 unsigned : 1;
613 unsigned : 1;
614 unsigned NOT_W : 1;
615 unsigned : 1;
616 unsigned : 1;
617 unsigned NOT_A : 1;
618 unsigned : 1;
619 unsigned : 1;
622 struct
624 unsigned : 1;
625 unsigned : 1;
626 unsigned NOT_WRITE : 1;
627 unsigned : 1;
628 unsigned : 1;
629 unsigned NOT_ADDRESS : 1;
630 unsigned : 1;
631 unsigned : 1;
634 struct
636 unsigned : 1;
637 unsigned : 1;
638 unsigned READ_WRITE : 1;
639 unsigned : 1;
640 unsigned : 1;
641 unsigned DATA_ADDRESS : 1;
642 unsigned : 1;
643 unsigned : 1;
646 struct
648 unsigned : 1;
649 unsigned : 1;
650 unsigned R : 1;
651 unsigned : 1;
652 unsigned : 1;
653 unsigned D : 1;
654 unsigned : 1;
655 unsigned : 1;
657 } __SSP2STATbits_t;
659 extern __at(0x0F87) volatile __SSP2STATbits_t SSP2STATbits;
661 #define _SSP2STAT_BF 0x01
662 #define _SSP2STAT_UA 0x02
663 #define _SSP2STAT_R_NOT_W 0x04
664 #define _SSP2STAT_R_W 0x04
665 #define _SSP2STAT_I2C_READ 0x04
666 #define _SSP2STAT_NOT_W 0x04
667 #define _SSP2STAT_NOT_WRITE 0x04
668 #define _SSP2STAT_READ_WRITE 0x04
669 #define _SSP2STAT_R 0x04
670 #define _SSP2STAT_S 0x08
671 #define _SSP2STAT_I2C_START 0x08
672 #define _SSP2STAT_P 0x10
673 #define _SSP2STAT_I2C_STOP 0x10
674 #define _SSP2STAT_D_NOT_A 0x20
675 #define _SSP2STAT_D_A 0x20
676 #define _SSP2STAT_I2C_DAT 0x20
677 #define _SSP2STAT_NOT_A 0x20
678 #define _SSP2STAT_NOT_ADDRESS 0x20
679 #define _SSP2STAT_DATA_ADDRESS 0x20
680 #define _SSP2STAT_D 0x20
681 #define _SSP2STAT_CKE 0x40
682 #define _SSP2STAT_SMP 0x80
684 //==============================================================================
686 extern __at(0x0F88) __sfr SSP2ADD;
688 //==============================================================================
689 // LATA Bits
691 extern __at(0x0F89) __sfr LATA;
693 typedef struct
695 unsigned LATA0 : 1;
696 unsigned LATA1 : 1;
697 unsigned LATA2 : 1;
698 unsigned LATA3 : 1;
699 unsigned : 1;
700 unsigned LATA5 : 1;
701 unsigned : 1;
702 unsigned : 1;
703 } __LATAbits_t;
705 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
707 #define _LATA0 0x01
708 #define _LATA1 0x02
709 #define _LATA2 0x04
710 #define _LATA3 0x08
711 #define _LATA5 0x20
713 //==============================================================================
716 //==============================================================================
717 // LATB Bits
719 extern __at(0x0F8A) __sfr LATB;
721 typedef struct
723 unsigned LATB0 : 1;
724 unsigned LATB1 : 1;
725 unsigned LATB2 : 1;
726 unsigned LATB3 : 1;
727 unsigned LATB4 : 1;
728 unsigned LATB5 : 1;
729 unsigned LATB6 : 1;
730 unsigned LATB7 : 1;
731 } __LATBbits_t;
733 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
735 #define _LATB0 0x01
736 #define _LATB1 0x02
737 #define _LATB2 0x04
738 #define _LATB3 0x08
739 #define _LATB4 0x10
740 #define _LATB5 0x20
741 #define _LATB6 0x40
742 #define _LATB7 0x80
744 //==============================================================================
747 //==============================================================================
748 // LATC Bits
750 extern __at(0x0F8B) __sfr LATC;
752 typedef struct
754 unsigned LATC0 : 1;
755 unsigned LATC1 : 1;
756 unsigned LATC2 : 1;
757 unsigned LATC3 : 1;
758 unsigned LATC4 : 1;
759 unsigned LATC5 : 1;
760 unsigned LATC6 : 1;
761 unsigned LATC7 : 1;
762 } __LATCbits_t;
764 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
766 #define _LATC0 0x01
767 #define _LATC1 0x02
768 #define _LATC2 0x04
769 #define _LATC3 0x08
770 #define _LATC4 0x10
771 #define _LATC5 0x20
772 #define _LATC6 0x40
773 #define _LATC7 0x80
775 //==============================================================================
778 //==============================================================================
779 // LATD Bits
781 extern __at(0x0F8C) __sfr LATD;
783 typedef struct
785 unsigned LATD0 : 1;
786 unsigned LATD1 : 1;
787 unsigned LATD2 : 1;
788 unsigned LATD3 : 1;
789 unsigned LATD4 : 1;
790 unsigned LATD5 : 1;
791 unsigned LATD6 : 1;
792 unsigned LATD7 : 1;
793 } __LATDbits_t;
795 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
797 #define _LATD0 0x01
798 #define _LATD1 0x02
799 #define _LATD2 0x04
800 #define _LATD3 0x08
801 #define _LATD4 0x10
802 #define _LATD5 0x20
803 #define _LATD6 0x40
804 #define _LATD7 0x80
806 //==============================================================================
809 //==============================================================================
810 // LATE Bits
812 extern __at(0x0F8D) __sfr LATE;
814 typedef union
816 struct
818 unsigned LATE0 : 1;
819 unsigned LATE1 : 1;
820 unsigned LATE2 : 1;
821 unsigned : 1;
822 unsigned : 1;
823 unsigned : 1;
824 unsigned : 1;
825 unsigned : 1;
828 struct
830 unsigned LATE : 3;
831 unsigned : 5;
833 } __LATEbits_t;
835 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
837 #define _LATE0 0x01
838 #define _LATE1 0x02
839 #define _LATE2 0x04
841 //==============================================================================
843 extern __at(0x0F8E) __sfr SSP2BUF;
845 //==============================================================================
846 // DDRA Bits
848 extern __at(0x0F92) __sfr DDRA;
850 typedef union
852 struct
854 unsigned TRISA0 : 1;
855 unsigned TRISA1 : 1;
856 unsigned TRISA2 : 1;
857 unsigned TRISA3 : 1;
858 unsigned : 1;
859 unsigned TRISA5 : 1;
860 unsigned : 1;
861 unsigned : 1;
864 struct
866 unsigned RA0 : 1;
867 unsigned RA1 : 1;
868 unsigned RA2 : 1;
869 unsigned RA3 : 1;
870 unsigned : 1;
871 unsigned RA5 : 1;
872 unsigned : 1;
873 unsigned : 1;
875 } __DDRAbits_t;
877 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
879 #define _TRISA0 0x01
880 #define _RA0 0x01
881 #define _TRISA1 0x02
882 #define _RA1 0x02
883 #define _TRISA2 0x04
884 #define _RA2 0x04
885 #define _TRISA3 0x08
886 #define _RA3 0x08
887 #define _TRISA5 0x20
888 #define _RA5 0x20
890 //==============================================================================
893 //==============================================================================
894 // TRISA Bits
896 extern __at(0x0F92) __sfr TRISA;
898 typedef union
900 struct
902 unsigned TRISA0 : 1;
903 unsigned TRISA1 : 1;
904 unsigned TRISA2 : 1;
905 unsigned TRISA3 : 1;
906 unsigned : 1;
907 unsigned TRISA5 : 1;
908 unsigned : 1;
909 unsigned : 1;
912 struct
914 unsigned RA0 : 1;
915 unsigned RA1 : 1;
916 unsigned RA2 : 1;
917 unsigned RA3 : 1;
918 unsigned : 1;
919 unsigned RA5 : 1;
920 unsigned : 1;
921 unsigned : 1;
923 } __TRISAbits_t;
925 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
927 #define _TRISA_TRISA0 0x01
928 #define _TRISA_RA0 0x01
929 #define _TRISA_TRISA1 0x02
930 #define _TRISA_RA1 0x02
931 #define _TRISA_TRISA2 0x04
932 #define _TRISA_RA2 0x04
933 #define _TRISA_TRISA3 0x08
934 #define _TRISA_RA3 0x08
935 #define _TRISA_TRISA5 0x20
936 #define _TRISA_RA5 0x20
938 //==============================================================================
941 //==============================================================================
942 // DDRB Bits
944 extern __at(0x0F93) __sfr DDRB;
946 typedef union
948 struct
950 unsigned TRISB0 : 1;
951 unsigned TRISB1 : 1;
952 unsigned TRISB2 : 1;
953 unsigned TRISB3 : 1;
954 unsigned TRISB4 : 1;
955 unsigned TRISB5 : 1;
956 unsigned TRISB6 : 1;
957 unsigned TRISB7 : 1;
960 struct
962 unsigned RB0 : 1;
963 unsigned RB1 : 1;
964 unsigned RB2 : 1;
965 unsigned RB3 : 1;
966 unsigned RB4 : 1;
967 unsigned RB5 : 1;
968 unsigned RB6 : 1;
969 unsigned RB7 : 1;
971 } __DDRBbits_t;
973 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
975 #define _TRISB0 0x01
976 #define _RB0 0x01
977 #define _TRISB1 0x02
978 #define _RB1 0x02
979 #define _TRISB2 0x04
980 #define _RB2 0x04
981 #define _TRISB3 0x08
982 #define _RB3 0x08
983 #define _TRISB4 0x10
984 #define _RB4 0x10
985 #define _TRISB5 0x20
986 #define _RB5 0x20
987 #define _TRISB6 0x40
988 #define _RB6 0x40
989 #define _TRISB7 0x80
990 #define _RB7 0x80
992 //==============================================================================
995 //==============================================================================
996 // TRISB Bits
998 extern __at(0x0F93) __sfr TRISB;
1000 typedef union
1002 struct
1004 unsigned TRISB0 : 1;
1005 unsigned TRISB1 : 1;
1006 unsigned TRISB2 : 1;
1007 unsigned TRISB3 : 1;
1008 unsigned TRISB4 : 1;
1009 unsigned TRISB5 : 1;
1010 unsigned TRISB6 : 1;
1011 unsigned TRISB7 : 1;
1014 struct
1016 unsigned RB0 : 1;
1017 unsigned RB1 : 1;
1018 unsigned RB2 : 1;
1019 unsigned RB3 : 1;
1020 unsigned RB4 : 1;
1021 unsigned RB5 : 1;
1022 unsigned RB6 : 1;
1023 unsigned RB7 : 1;
1025 } __TRISBbits_t;
1027 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
1029 #define _TRISB_TRISB0 0x01
1030 #define _TRISB_RB0 0x01
1031 #define _TRISB_TRISB1 0x02
1032 #define _TRISB_RB1 0x02
1033 #define _TRISB_TRISB2 0x04
1034 #define _TRISB_RB2 0x04
1035 #define _TRISB_TRISB3 0x08
1036 #define _TRISB_RB3 0x08
1037 #define _TRISB_TRISB4 0x10
1038 #define _TRISB_RB4 0x10
1039 #define _TRISB_TRISB5 0x20
1040 #define _TRISB_RB5 0x20
1041 #define _TRISB_TRISB6 0x40
1042 #define _TRISB_RB6 0x40
1043 #define _TRISB_TRISB7 0x80
1044 #define _TRISB_RB7 0x80
1046 //==============================================================================
1049 //==============================================================================
1050 // DDRC Bits
1052 extern __at(0x0F94) __sfr DDRC;
1054 typedef union
1056 struct
1058 unsigned TRISC0 : 1;
1059 unsigned TRISC1 : 1;
1060 unsigned TRISC2 : 1;
1061 unsigned TRISC3 : 1;
1062 unsigned TRISC4 : 1;
1063 unsigned TRISC5 : 1;
1064 unsigned TRISC6 : 1;
1065 unsigned TRISC7 : 1;
1068 struct
1070 unsigned RC0 : 1;
1071 unsigned RC1 : 1;
1072 unsigned RC2 : 1;
1073 unsigned RC3 : 1;
1074 unsigned RC4 : 1;
1075 unsigned RC5 : 1;
1076 unsigned RC6 : 1;
1077 unsigned RC7 : 1;
1079 } __DDRCbits_t;
1081 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
1083 #define _TRISC0 0x01
1084 #define _RC0 0x01
1085 #define _TRISC1 0x02
1086 #define _RC1 0x02
1087 #define _TRISC2 0x04
1088 #define _RC2 0x04
1089 #define _TRISC3 0x08
1090 #define _RC3 0x08
1091 #define _TRISC4 0x10
1092 #define _RC4 0x10
1093 #define _TRISC5 0x20
1094 #define _RC5 0x20
1095 #define _TRISC6 0x40
1096 #define _RC6 0x40
1097 #define _TRISC7 0x80
1098 #define _RC7 0x80
1100 //==============================================================================
1103 //==============================================================================
1104 // TRISC Bits
1106 extern __at(0x0F94) __sfr TRISC;
1108 typedef union
1110 struct
1112 unsigned TRISC0 : 1;
1113 unsigned TRISC1 : 1;
1114 unsigned TRISC2 : 1;
1115 unsigned TRISC3 : 1;
1116 unsigned TRISC4 : 1;
1117 unsigned TRISC5 : 1;
1118 unsigned TRISC6 : 1;
1119 unsigned TRISC7 : 1;
1122 struct
1124 unsigned RC0 : 1;
1125 unsigned RC1 : 1;
1126 unsigned RC2 : 1;
1127 unsigned RC3 : 1;
1128 unsigned RC4 : 1;
1129 unsigned RC5 : 1;
1130 unsigned RC6 : 1;
1131 unsigned RC7 : 1;
1133 } __TRISCbits_t;
1135 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
1137 #define _TRISC_TRISC0 0x01
1138 #define _TRISC_RC0 0x01
1139 #define _TRISC_TRISC1 0x02
1140 #define _TRISC_RC1 0x02
1141 #define _TRISC_TRISC2 0x04
1142 #define _TRISC_RC2 0x04
1143 #define _TRISC_TRISC3 0x08
1144 #define _TRISC_RC3 0x08
1145 #define _TRISC_TRISC4 0x10
1146 #define _TRISC_RC4 0x10
1147 #define _TRISC_TRISC5 0x20
1148 #define _TRISC_RC5 0x20
1149 #define _TRISC_TRISC6 0x40
1150 #define _TRISC_RC6 0x40
1151 #define _TRISC_TRISC7 0x80
1152 #define _TRISC_RC7 0x80
1154 //==============================================================================
1157 //==============================================================================
1158 // DDRD Bits
1160 extern __at(0x0F95) __sfr DDRD;
1162 typedef union
1164 struct
1166 unsigned TRISD0 : 1;
1167 unsigned TRISD1 : 1;
1168 unsigned TRISD2 : 1;
1169 unsigned TRISD3 : 1;
1170 unsigned TRISD4 : 1;
1171 unsigned TRISD5 : 1;
1172 unsigned TRISD6 : 1;
1173 unsigned TRISD7 : 1;
1176 struct
1178 unsigned RD0 : 1;
1179 unsigned RD1 : 1;
1180 unsigned RD2 : 1;
1181 unsigned RD3 : 1;
1182 unsigned RD4 : 1;
1183 unsigned RD5 : 1;
1184 unsigned RD6 : 1;
1185 unsigned RD7 : 1;
1187 } __DDRDbits_t;
1189 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
1191 #define _TRISD0 0x01
1192 #define _RD0 0x01
1193 #define _TRISD1 0x02
1194 #define _RD1 0x02
1195 #define _TRISD2 0x04
1196 #define _RD2 0x04
1197 #define _TRISD3 0x08
1198 #define _RD3 0x08
1199 #define _TRISD4 0x10
1200 #define _RD4 0x10
1201 #define _TRISD5 0x20
1202 #define _RD5 0x20
1203 #define _TRISD6 0x40
1204 #define _RD6 0x40
1205 #define _TRISD7 0x80
1206 #define _RD7 0x80
1208 //==============================================================================
1211 //==============================================================================
1212 // TRISD Bits
1214 extern __at(0x0F95) __sfr TRISD;
1216 typedef union
1218 struct
1220 unsigned TRISD0 : 1;
1221 unsigned TRISD1 : 1;
1222 unsigned TRISD2 : 1;
1223 unsigned TRISD3 : 1;
1224 unsigned TRISD4 : 1;
1225 unsigned TRISD5 : 1;
1226 unsigned TRISD6 : 1;
1227 unsigned TRISD7 : 1;
1230 struct
1232 unsigned RD0 : 1;
1233 unsigned RD1 : 1;
1234 unsigned RD2 : 1;
1235 unsigned RD3 : 1;
1236 unsigned RD4 : 1;
1237 unsigned RD5 : 1;
1238 unsigned RD6 : 1;
1239 unsigned RD7 : 1;
1241 } __TRISDbits_t;
1243 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
1245 #define _TRISD_TRISD0 0x01
1246 #define _TRISD_RD0 0x01
1247 #define _TRISD_TRISD1 0x02
1248 #define _TRISD_RD1 0x02
1249 #define _TRISD_TRISD2 0x04
1250 #define _TRISD_RD2 0x04
1251 #define _TRISD_TRISD3 0x08
1252 #define _TRISD_RD3 0x08
1253 #define _TRISD_TRISD4 0x10
1254 #define _TRISD_RD4 0x10
1255 #define _TRISD_TRISD5 0x20
1256 #define _TRISD_RD5 0x20
1257 #define _TRISD_TRISD6 0x40
1258 #define _TRISD_RD6 0x40
1259 #define _TRISD_TRISD7 0x80
1260 #define _TRISD_RD7 0x80
1262 //==============================================================================
1265 //==============================================================================
1266 // DDRE Bits
1268 extern __at(0x0F96) __sfr DDRE;
1270 typedef union
1272 struct
1274 unsigned TRISE0 : 1;
1275 unsigned TRISE1 : 1;
1276 unsigned TRISE2 : 1;
1277 unsigned RE3 : 1;
1278 unsigned PSPMODE : 1;
1279 unsigned IBOV : 1;
1280 unsigned OBF : 1;
1281 unsigned IBF : 1;
1284 struct
1286 unsigned RE0 : 1;
1287 unsigned RE1 : 1;
1288 unsigned RE2 : 1;
1289 unsigned : 1;
1290 unsigned : 1;
1291 unsigned : 1;
1292 unsigned : 1;
1293 unsigned : 1;
1296 struct
1298 unsigned RE : 4;
1299 unsigned : 4;
1302 struct
1304 unsigned TRISE : 3;
1305 unsigned : 5;
1307 } __DDREbits_t;
1309 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
1311 #define _TRISE0 0x01
1312 #define _RE0 0x01
1313 #define _TRISE1 0x02
1314 #define _RE1 0x02
1315 #define _TRISE2 0x04
1316 #define _RE2 0x04
1317 #define _RE3 0x08
1318 #define _PSPMODE 0x10
1319 #define _IBOV 0x20
1320 #define _OBF 0x40
1321 #define _IBF 0x80
1323 //==============================================================================
1326 //==============================================================================
1327 // TRISE Bits
1329 extern __at(0x0F96) __sfr TRISE;
1331 typedef union
1333 struct
1335 unsigned TRISE0 : 1;
1336 unsigned TRISE1 : 1;
1337 unsigned TRISE2 : 1;
1338 unsigned RE3 : 1;
1339 unsigned PSPMODE : 1;
1340 unsigned IBOV : 1;
1341 unsigned OBF : 1;
1342 unsigned IBF : 1;
1345 struct
1347 unsigned RE0 : 1;
1348 unsigned RE1 : 1;
1349 unsigned RE2 : 1;
1350 unsigned : 1;
1351 unsigned : 1;
1352 unsigned : 1;
1353 unsigned : 1;
1354 unsigned : 1;
1357 struct
1359 unsigned TRISE : 3;
1360 unsigned : 5;
1363 struct
1365 unsigned RE : 4;
1366 unsigned : 4;
1368 } __TRISEbits_t;
1370 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
1372 #define _TRISE_TRISE0 0x01
1373 #define _TRISE_RE0 0x01
1374 #define _TRISE_TRISE1 0x02
1375 #define _TRISE_RE1 0x02
1376 #define _TRISE_TRISE2 0x04
1377 #define _TRISE_RE2 0x04
1378 #define _TRISE_RE3 0x08
1379 #define _TRISE_PSPMODE 0x10
1380 #define _TRISE_IBOV 0x20
1381 #define _TRISE_OBF 0x40
1382 #define _TRISE_IBF 0x80
1384 //==============================================================================
1387 //==============================================================================
1388 // OSCTUNE Bits
1390 extern __at(0x0F9B) __sfr OSCTUNE;
1392 typedef struct
1394 unsigned : 1;
1395 unsigned : 1;
1396 unsigned : 1;
1397 unsigned : 1;
1398 unsigned : 1;
1399 unsigned : 1;
1400 unsigned PLLEN : 1;
1401 unsigned : 1;
1402 } __OSCTUNEbits_t;
1404 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
1406 #define _PLLEN 0x40
1408 //==============================================================================
1411 //==============================================================================
1412 // PIE1 Bits
1414 extern __at(0x0F9D) __sfr PIE1;
1416 typedef union
1418 struct
1420 unsigned TMR1IE : 1;
1421 unsigned TMR2IE : 1;
1422 unsigned CCP1IE : 1;
1423 unsigned SSP1IE : 1;
1424 unsigned TXIE : 1;
1425 unsigned RCIE : 1;
1426 unsigned ADIE : 1;
1427 unsigned PSPIE : 1;
1430 struct
1432 unsigned : 1;
1433 unsigned : 1;
1434 unsigned : 1;
1435 unsigned SSPIE : 1;
1436 unsigned TX1IE : 1;
1437 unsigned RC1IE : 1;
1438 unsigned : 1;
1439 unsigned : 1;
1441 } __PIE1bits_t;
1443 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
1445 #define _TMR1IE 0x01
1446 #define _TMR2IE 0x02
1447 #define _CCP1IE 0x04
1448 #define _SSP1IE 0x08
1449 #define _SSPIE 0x08
1450 #define _TXIE 0x10
1451 #define _TX1IE 0x10
1452 #define _RCIE 0x20
1453 #define _RC1IE 0x20
1454 #define _ADIE 0x40
1455 #define _PSPIE 0x80
1457 //==============================================================================
1460 //==============================================================================
1461 // PIR1 Bits
1463 extern __at(0x0F9E) __sfr PIR1;
1465 typedef union
1467 struct
1469 unsigned TMR1IF : 1;
1470 unsigned TMR2IF : 1;
1471 unsigned CCP1IF : 1;
1472 unsigned SSP1IF : 1;
1473 unsigned TXIF : 1;
1474 unsigned RCIF : 1;
1475 unsigned ADIF : 1;
1476 unsigned PSPIF : 1;
1479 struct
1481 unsigned : 1;
1482 unsigned : 1;
1483 unsigned : 1;
1484 unsigned SSPIF : 1;
1485 unsigned TX1IF : 1;
1486 unsigned RC1IF : 1;
1487 unsigned : 1;
1488 unsigned : 1;
1490 } __PIR1bits_t;
1492 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
1494 #define _TMR1IF 0x01
1495 #define _TMR2IF 0x02
1496 #define _CCP1IF 0x04
1497 #define _SSP1IF 0x08
1498 #define _SSPIF 0x08
1499 #define _TXIF 0x10
1500 #define _TX1IF 0x10
1501 #define _RCIF 0x20
1502 #define _RC1IF 0x20
1503 #define _ADIF 0x40
1504 #define _PSPIF 0x80
1506 //==============================================================================
1509 //==============================================================================
1510 // IPR1 Bits
1512 extern __at(0x0F9F) __sfr IPR1;
1514 typedef union
1516 struct
1518 unsigned TMR1IP : 1;
1519 unsigned TMR2IP : 1;
1520 unsigned CCP1IP : 1;
1521 unsigned SSP1IP : 1;
1522 unsigned TXIP : 1;
1523 unsigned RCIP : 1;
1524 unsigned ADIP : 1;
1525 unsigned PSPIP : 1;
1528 struct
1530 unsigned : 1;
1531 unsigned : 1;
1532 unsigned : 1;
1533 unsigned SSPIP : 1;
1534 unsigned TX1IP : 1;
1535 unsigned RC1IP : 1;
1536 unsigned : 1;
1537 unsigned : 1;
1539 } __IPR1bits_t;
1541 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
1543 #define _TMR1IP 0x01
1544 #define _TMR2IP 0x02
1545 #define _CCP1IP 0x04
1546 #define _SSP1IP 0x08
1547 #define _SSPIP 0x08
1548 #define _TXIP 0x10
1549 #define _TX1IP 0x10
1550 #define _RCIP 0x20
1551 #define _RC1IP 0x20
1552 #define _ADIP 0x40
1553 #define _PSPIP 0x80
1555 //==============================================================================
1558 //==============================================================================
1559 // PIE2 Bits
1561 extern __at(0x0FA0) __sfr PIE2;
1563 typedef union
1565 struct
1567 unsigned CCP2IE : 1;
1568 unsigned : 1;
1569 unsigned : 1;
1570 unsigned BCL1IE : 1;
1571 unsigned : 1;
1572 unsigned : 1;
1573 unsigned CMIE : 1;
1574 unsigned OSCFIE : 1;
1577 struct
1579 unsigned : 1;
1580 unsigned : 1;
1581 unsigned : 1;
1582 unsigned BCLIE : 1;
1583 unsigned : 1;
1584 unsigned : 1;
1585 unsigned : 1;
1586 unsigned : 1;
1588 } __PIE2bits_t;
1590 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
1592 #define _CCP2IE 0x01
1593 #define _BCL1IE 0x08
1594 #define _BCLIE 0x08
1595 #define _CMIE 0x40
1596 #define _OSCFIE 0x80
1598 //==============================================================================
1601 //==============================================================================
1602 // PIR2 Bits
1604 extern __at(0x0FA1) __sfr PIR2;
1606 typedef union
1608 struct
1610 unsigned CCP2IF : 1;
1611 unsigned : 1;
1612 unsigned : 1;
1613 unsigned BCL1IF : 1;
1614 unsigned : 1;
1615 unsigned : 1;
1616 unsigned CMIF : 1;
1617 unsigned OSCFIF : 1;
1620 struct
1622 unsigned : 1;
1623 unsigned : 1;
1624 unsigned : 1;
1625 unsigned BCLIF : 1;
1626 unsigned : 1;
1627 unsigned : 1;
1628 unsigned : 1;
1629 unsigned : 1;
1631 } __PIR2bits_t;
1633 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
1635 #define _CCP2IF 0x01
1636 #define _BCL1IF 0x08
1637 #define _BCLIF 0x08
1638 #define _CMIF 0x40
1639 #define _OSCFIF 0x80
1641 //==============================================================================
1644 //==============================================================================
1645 // IPR2 Bits
1647 extern __at(0x0FA2) __sfr IPR2;
1649 typedef union
1651 struct
1653 unsigned CCP2IP : 1;
1654 unsigned : 1;
1655 unsigned : 1;
1656 unsigned BCL1IP : 1;
1657 unsigned : 1;
1658 unsigned : 1;
1659 unsigned CMIP : 1;
1660 unsigned OSCFIP : 1;
1663 struct
1665 unsigned : 1;
1666 unsigned : 1;
1667 unsigned : 1;
1668 unsigned BCLIP : 1;
1669 unsigned : 1;
1670 unsigned : 1;
1671 unsigned : 1;
1672 unsigned : 1;
1674 } __IPR2bits_t;
1676 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
1678 #define _CCP2IP 0x01
1679 #define _BCL1IP 0x08
1680 #define _BCLIP 0x08
1681 #define _CMIP 0x40
1682 #define _OSCFIP 0x80
1684 //==============================================================================
1687 //==============================================================================
1688 // PIE3 Bits
1690 extern __at(0x0FA3) __sfr PIE3;
1692 typedef struct
1694 unsigned : 1;
1695 unsigned : 1;
1696 unsigned : 1;
1697 unsigned : 1;
1698 unsigned : 1;
1699 unsigned : 1;
1700 unsigned BCL2IE : 1;
1701 unsigned SSP2IE : 1;
1702 } __PIE3bits_t;
1704 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
1706 #define _BCL2IE 0x40
1707 #define _SSP2IE 0x80
1709 //==============================================================================
1712 //==============================================================================
1713 // PIR3 Bits
1715 extern __at(0x0FA4) __sfr PIR3;
1717 typedef struct
1719 unsigned : 1;
1720 unsigned : 1;
1721 unsigned : 1;
1722 unsigned : 1;
1723 unsigned : 1;
1724 unsigned : 1;
1725 unsigned BCL2IF : 1;
1726 unsigned SSP2IF : 1;
1727 } __PIR3bits_t;
1729 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
1731 #define _BCL2IF 0x40
1732 #define _SSP2IF 0x80
1734 //==============================================================================
1737 //==============================================================================
1738 // IPR3 Bits
1740 extern __at(0x0FA5) __sfr IPR3;
1742 typedef struct
1744 unsigned : 1;
1745 unsigned : 1;
1746 unsigned : 1;
1747 unsigned : 1;
1748 unsigned : 1;
1749 unsigned : 1;
1750 unsigned BCL2IP : 1;
1751 unsigned SSP2IP : 1;
1752 } __IPR3bits_t;
1754 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
1756 #define _BCL2IP 0x40
1757 #define _SSP2IP 0x80
1759 //==============================================================================
1762 //==============================================================================
1763 // EECON1 Bits
1765 extern __at(0x0FA6) __sfr EECON1;
1767 typedef struct
1769 unsigned : 1;
1770 unsigned WR : 1;
1771 unsigned WREN : 1;
1772 unsigned WRERR : 1;
1773 unsigned FREE : 1;
1774 unsigned : 1;
1775 unsigned : 1;
1776 unsigned : 1;
1777 } __EECON1bits_t;
1779 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
1781 #define _WR 0x02
1782 #define _WREN 0x04
1783 #define _WRERR 0x08
1784 #define _FREE 0x10
1786 //==============================================================================
1788 extern __at(0x0FA7) __sfr EECON2;
1790 //==============================================================================
1791 // RCSTA Bits
1793 extern __at(0x0FAB) __sfr RCSTA;
1795 typedef union
1797 struct
1799 unsigned RX9D : 1;
1800 unsigned OERR : 1;
1801 unsigned FERR : 1;
1802 unsigned ADDEN : 1;
1803 unsigned CREN : 1;
1804 unsigned SREN : 1;
1805 unsigned RX9 : 1;
1806 unsigned SPEN : 1;
1809 struct
1811 unsigned RCD8 : 1;
1812 unsigned OERR1 : 1;
1813 unsigned FERR1 : 1;
1814 unsigned ADEN : 1;
1815 unsigned CREN1 : 1;
1816 unsigned SREN1 : 1;
1817 unsigned RC9 : 1;
1818 unsigned SPEN1 : 1;
1821 struct
1823 unsigned RX9D1 : 1;
1824 unsigned : 1;
1825 unsigned : 1;
1826 unsigned ADDEN1 : 1;
1827 unsigned : 1;
1828 unsigned : 1;
1829 unsigned NOT_RC8 : 1;
1830 unsigned : 1;
1833 struct
1835 unsigned : 1;
1836 unsigned : 1;
1837 unsigned : 1;
1838 unsigned : 1;
1839 unsigned : 1;
1840 unsigned : 1;
1841 unsigned RC8_9 : 1;
1842 unsigned : 1;
1845 struct
1847 unsigned : 1;
1848 unsigned : 1;
1849 unsigned : 1;
1850 unsigned : 1;
1851 unsigned : 1;
1852 unsigned : 1;
1853 unsigned RX91 : 1;
1854 unsigned : 1;
1856 } __RCSTAbits_t;
1858 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
1860 #define _RX9D 0x01
1861 #define _RCD8 0x01
1862 #define _RX9D1 0x01
1863 #define _OERR 0x02
1864 #define _OERR1 0x02
1865 #define _FERR 0x04
1866 #define _FERR1 0x04
1867 #define _ADDEN 0x08
1868 #define _ADEN 0x08
1869 #define _ADDEN1 0x08
1870 #define _CREN 0x10
1871 #define _CREN1 0x10
1872 #define _SREN 0x20
1873 #define _SREN1 0x20
1874 #define _RX9 0x40
1875 #define _RC9 0x40
1876 #define _NOT_RC8 0x40
1877 #define _RC8_9 0x40
1878 #define _RX91 0x40
1879 #define _SPEN 0x80
1880 #define _SPEN1 0x80
1882 //==============================================================================
1885 //==============================================================================
1886 // RCSTA1 Bits
1888 extern __at(0x0FAB) __sfr RCSTA1;
1890 typedef union
1892 struct
1894 unsigned RX9D : 1;
1895 unsigned OERR : 1;
1896 unsigned FERR : 1;
1897 unsigned ADDEN : 1;
1898 unsigned CREN : 1;
1899 unsigned SREN : 1;
1900 unsigned RX9 : 1;
1901 unsigned SPEN : 1;
1904 struct
1906 unsigned RCD8 : 1;
1907 unsigned OERR1 : 1;
1908 unsigned FERR1 : 1;
1909 unsigned ADEN : 1;
1910 unsigned CREN1 : 1;
1911 unsigned SREN1 : 1;
1912 unsigned RC9 : 1;
1913 unsigned SPEN1 : 1;
1916 struct
1918 unsigned RX9D1 : 1;
1919 unsigned : 1;
1920 unsigned : 1;
1921 unsigned ADDEN1 : 1;
1922 unsigned : 1;
1923 unsigned : 1;
1924 unsigned NOT_RC8 : 1;
1925 unsigned : 1;
1928 struct
1930 unsigned : 1;
1931 unsigned : 1;
1932 unsigned : 1;
1933 unsigned : 1;
1934 unsigned : 1;
1935 unsigned : 1;
1936 unsigned RC8_9 : 1;
1937 unsigned : 1;
1940 struct
1942 unsigned : 1;
1943 unsigned : 1;
1944 unsigned : 1;
1945 unsigned : 1;
1946 unsigned : 1;
1947 unsigned : 1;
1948 unsigned RX91 : 1;
1949 unsigned : 1;
1951 } __RCSTA1bits_t;
1953 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
1955 #define _RCSTA1_RX9D 0x01
1956 #define _RCSTA1_RCD8 0x01
1957 #define _RCSTA1_RX9D1 0x01
1958 #define _RCSTA1_OERR 0x02
1959 #define _RCSTA1_OERR1 0x02
1960 #define _RCSTA1_FERR 0x04
1961 #define _RCSTA1_FERR1 0x04
1962 #define _RCSTA1_ADDEN 0x08
1963 #define _RCSTA1_ADEN 0x08
1964 #define _RCSTA1_ADDEN1 0x08
1965 #define _RCSTA1_CREN 0x10
1966 #define _RCSTA1_CREN1 0x10
1967 #define _RCSTA1_SREN 0x20
1968 #define _RCSTA1_SREN1 0x20
1969 #define _RCSTA1_RX9 0x40
1970 #define _RCSTA1_RC9 0x40
1971 #define _RCSTA1_NOT_RC8 0x40
1972 #define _RCSTA1_RC8_9 0x40
1973 #define _RCSTA1_RX91 0x40
1974 #define _RCSTA1_SPEN 0x80
1975 #define _RCSTA1_SPEN1 0x80
1977 //==============================================================================
1980 //==============================================================================
1981 // TXSTA Bits
1983 extern __at(0x0FAC) __sfr TXSTA;
1985 typedef union
1987 struct
1989 unsigned TX9D : 1;
1990 unsigned TRMT : 1;
1991 unsigned BRGH : 1;
1992 unsigned SENDB : 1;
1993 unsigned SYNC : 1;
1994 unsigned TXEN : 1;
1995 unsigned TX9 : 1;
1996 unsigned CSRC : 1;
1999 struct
2001 unsigned TXD8 : 1;
2002 unsigned TRMT1 : 1;
2003 unsigned BRGH1 : 1;
2004 unsigned SENDB1 : 1;
2005 unsigned SYNC1 : 1;
2006 unsigned TXEN1 : 1;
2007 unsigned TX8_9 : 1;
2008 unsigned CSRC1 : 1;
2011 struct
2013 unsigned TX9D1 : 1;
2014 unsigned : 1;
2015 unsigned : 1;
2016 unsigned : 1;
2017 unsigned : 1;
2018 unsigned : 1;
2019 unsigned NOT_TX8 : 1;
2020 unsigned : 1;
2023 struct
2025 unsigned : 1;
2026 unsigned : 1;
2027 unsigned : 1;
2028 unsigned : 1;
2029 unsigned : 1;
2030 unsigned : 1;
2031 unsigned TX91 : 1;
2032 unsigned : 1;
2034 } __TXSTAbits_t;
2036 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
2038 #define _TX9D 0x01
2039 #define _TXD8 0x01
2040 #define _TX9D1 0x01
2041 #define _TRMT 0x02
2042 #define _TRMT1 0x02
2043 #define _BRGH 0x04
2044 #define _BRGH1 0x04
2045 #define _SENDB 0x08
2046 #define _SENDB1 0x08
2047 #define _SYNC 0x10
2048 #define _SYNC1 0x10
2049 #define _TXEN 0x20
2050 #define _TXEN1 0x20
2051 #define _TX9 0x40
2052 #define _TX8_9 0x40
2053 #define _NOT_TX8 0x40
2054 #define _TX91 0x40
2055 #define _CSRC 0x80
2056 #define _CSRC1 0x80
2058 //==============================================================================
2061 //==============================================================================
2062 // TXSTA1 Bits
2064 extern __at(0x0FAC) __sfr TXSTA1;
2066 typedef union
2068 struct
2070 unsigned TX9D : 1;
2071 unsigned TRMT : 1;
2072 unsigned BRGH : 1;
2073 unsigned SENDB : 1;
2074 unsigned SYNC : 1;
2075 unsigned TXEN : 1;
2076 unsigned TX9 : 1;
2077 unsigned CSRC : 1;
2080 struct
2082 unsigned TXD8 : 1;
2083 unsigned TRMT1 : 1;
2084 unsigned BRGH1 : 1;
2085 unsigned SENDB1 : 1;
2086 unsigned SYNC1 : 1;
2087 unsigned TXEN1 : 1;
2088 unsigned TX8_9 : 1;
2089 unsigned CSRC1 : 1;
2092 struct
2094 unsigned TX9D1 : 1;
2095 unsigned : 1;
2096 unsigned : 1;
2097 unsigned : 1;
2098 unsigned : 1;
2099 unsigned : 1;
2100 unsigned NOT_TX8 : 1;
2101 unsigned : 1;
2104 struct
2106 unsigned : 1;
2107 unsigned : 1;
2108 unsigned : 1;
2109 unsigned : 1;
2110 unsigned : 1;
2111 unsigned : 1;
2112 unsigned TX91 : 1;
2113 unsigned : 1;
2115 } __TXSTA1bits_t;
2117 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
2119 #define _TXSTA1_TX9D 0x01
2120 #define _TXSTA1_TXD8 0x01
2121 #define _TXSTA1_TX9D1 0x01
2122 #define _TXSTA1_TRMT 0x02
2123 #define _TXSTA1_TRMT1 0x02
2124 #define _TXSTA1_BRGH 0x04
2125 #define _TXSTA1_BRGH1 0x04
2126 #define _TXSTA1_SENDB 0x08
2127 #define _TXSTA1_SENDB1 0x08
2128 #define _TXSTA1_SYNC 0x10
2129 #define _TXSTA1_SYNC1 0x10
2130 #define _TXSTA1_TXEN 0x20
2131 #define _TXSTA1_TXEN1 0x20
2132 #define _TXSTA1_TX9 0x40
2133 #define _TXSTA1_TX8_9 0x40
2134 #define _TXSTA1_NOT_TX8 0x40
2135 #define _TXSTA1_TX91 0x40
2136 #define _TXSTA1_CSRC 0x80
2137 #define _TXSTA1_CSRC1 0x80
2139 //==============================================================================
2141 extern __at(0x0FAD) __sfr TXREG;
2142 extern __at(0x0FAD) __sfr TXREG1;
2143 extern __at(0x0FAE) __sfr RCREG;
2144 extern __at(0x0FAE) __sfr RCREG1;
2145 extern __at(0x0FAF) __sfr SPBRG;
2146 extern __at(0x0FAF) __sfr SPBRG1;
2147 extern __at(0x0FB0) __sfr SPBRGH;
2149 //==============================================================================
2150 // CMCON Bits
2152 extern __at(0x0FB4) __sfr CMCON;
2154 typedef union
2156 struct
2158 unsigned CM0 : 1;
2159 unsigned CM1 : 1;
2160 unsigned CM2 : 1;
2161 unsigned CIS : 1;
2162 unsigned C1INV : 1;
2163 unsigned C2INV : 1;
2164 unsigned C1OUT : 1;
2165 unsigned C2OUT : 1;
2168 struct
2170 unsigned CM : 3;
2171 unsigned : 5;
2173 } __CMCONbits_t;
2175 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
2177 #define _CM0 0x01
2178 #define _CM1 0x02
2179 #define _CM2 0x04
2180 #define _CIS 0x08
2181 #define _C1INV 0x10
2182 #define _C2INV 0x20
2183 #define _C1OUT 0x40
2184 #define _C2OUT 0x80
2186 //==============================================================================
2189 //==============================================================================
2190 // CVRCON Bits
2192 extern __at(0x0FB5) __sfr CVRCON;
2194 typedef union
2196 struct
2198 unsigned CVR0 : 1;
2199 unsigned CVR1 : 1;
2200 unsigned CVR2 : 1;
2201 unsigned CVR3 : 1;
2202 unsigned CVRSS : 1;
2203 unsigned CVRR : 1;
2204 unsigned CVROE : 1;
2205 unsigned CVREN : 1;
2208 struct
2210 unsigned CVR : 4;
2211 unsigned : 4;
2213 } __CVRCONbits_t;
2215 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
2217 #define _CVR0 0x01
2218 #define _CVR1 0x02
2219 #define _CVR2 0x04
2220 #define _CVR3 0x08
2221 #define _CVRSS 0x10
2222 #define _CVRR 0x20
2223 #define _CVROE 0x40
2224 #define _CVREN 0x80
2226 //==============================================================================
2229 //==============================================================================
2230 // ECCP1AS Bits
2232 extern __at(0x0FB6) __sfr ECCP1AS;
2234 typedef union
2236 struct
2238 unsigned PSSBD0 : 1;
2239 unsigned PSSBD1 : 1;
2240 unsigned PSSAC0 : 1;
2241 unsigned PSSAC1 : 1;
2242 unsigned ECCPAS0 : 1;
2243 unsigned ECCPAS1 : 1;
2244 unsigned ECCPAS2 : 1;
2245 unsigned ECCPASE : 1;
2248 struct
2250 unsigned PSSBD : 2;
2251 unsigned : 6;
2254 struct
2256 unsigned : 2;
2257 unsigned PSSAC : 2;
2258 unsigned : 4;
2261 struct
2263 unsigned : 4;
2264 unsigned ECCPAS : 3;
2265 unsigned : 1;
2267 } __ECCP1ASbits_t;
2269 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
2271 #define _PSSBD0 0x01
2272 #define _PSSBD1 0x02
2273 #define _PSSAC0 0x04
2274 #define _PSSAC1 0x08
2275 #define _ECCPAS0 0x10
2276 #define _ECCPAS1 0x20
2277 #define _ECCPAS2 0x40
2278 #define _ECCPASE 0x80
2280 //==============================================================================
2283 //==============================================================================
2284 // ECCP1DEL Bits
2286 extern __at(0x0FB7) __sfr ECCP1DEL;
2288 typedef union
2290 struct
2292 unsigned PDC0 : 1;
2293 unsigned PDC1 : 1;
2294 unsigned PDC2 : 1;
2295 unsigned PDC3 : 1;
2296 unsigned PDC4 : 1;
2297 unsigned PDC5 : 1;
2298 unsigned PDC6 : 1;
2299 unsigned PRSEN : 1;
2302 struct
2304 unsigned PDC : 7;
2305 unsigned : 1;
2307 } __ECCP1DELbits_t;
2309 extern __at(0x0FB7) volatile __ECCP1DELbits_t ECCP1DELbits;
2311 #define _PDC0 0x01
2312 #define _PDC1 0x02
2313 #define _PDC2 0x04
2314 #define _PDC3 0x08
2315 #define _PDC4 0x10
2316 #define _PDC5 0x20
2317 #define _PDC6 0x40
2318 #define _PRSEN 0x80
2320 //==============================================================================
2323 //==============================================================================
2324 // PWM1CON Bits
2326 extern __at(0x0FB7) __sfr PWM1CON;
2328 typedef union
2330 struct
2332 unsigned PDC0 : 1;
2333 unsigned PDC1 : 1;
2334 unsigned PDC2 : 1;
2335 unsigned PDC3 : 1;
2336 unsigned PDC4 : 1;
2337 unsigned PDC5 : 1;
2338 unsigned PDC6 : 1;
2339 unsigned PRSEN : 1;
2342 struct
2344 unsigned PDC : 7;
2345 unsigned : 1;
2347 } __PWM1CONbits_t;
2349 extern __at(0x0FB7) volatile __PWM1CONbits_t PWM1CONbits;
2351 #define _PWM1CON_PDC0 0x01
2352 #define _PWM1CON_PDC1 0x02
2353 #define _PWM1CON_PDC2 0x04
2354 #define _PWM1CON_PDC3 0x08
2355 #define _PWM1CON_PDC4 0x10
2356 #define _PWM1CON_PDC5 0x20
2357 #define _PWM1CON_PDC6 0x40
2358 #define _PWM1CON_PRSEN 0x80
2360 //==============================================================================
2363 //==============================================================================
2364 // BAUDCON Bits
2366 extern __at(0x0FB8) __sfr BAUDCON;
2368 typedef union
2370 struct
2372 unsigned ABDEN : 1;
2373 unsigned WUE : 1;
2374 unsigned : 1;
2375 unsigned BRG16 : 1;
2376 unsigned SCKP : 1;
2377 unsigned : 1;
2378 unsigned RCMT : 1;
2379 unsigned ABDOVF : 1;
2382 struct
2384 unsigned : 1;
2385 unsigned : 1;
2386 unsigned : 1;
2387 unsigned : 1;
2388 unsigned : 1;
2389 unsigned : 1;
2390 unsigned RCIDL : 1;
2391 unsigned : 1;
2393 } __BAUDCONbits_t;
2395 extern __at(0x0FB8) volatile __BAUDCONbits_t BAUDCONbits;
2397 #define _ABDEN 0x01
2398 #define _WUE 0x02
2399 #define _BRG16 0x08
2400 #define _SCKP 0x10
2401 #define _RCMT 0x40
2402 #define _RCIDL 0x40
2403 #define _ABDOVF 0x80
2405 //==============================================================================
2408 //==============================================================================
2409 // BAUDCTL Bits
2411 extern __at(0x0FB8) __sfr BAUDCTL;
2413 typedef union
2415 struct
2417 unsigned ABDEN : 1;
2418 unsigned WUE : 1;
2419 unsigned : 1;
2420 unsigned BRG16 : 1;
2421 unsigned SCKP : 1;
2422 unsigned : 1;
2423 unsigned RCMT : 1;
2424 unsigned ABDOVF : 1;
2427 struct
2429 unsigned : 1;
2430 unsigned : 1;
2431 unsigned : 1;
2432 unsigned : 1;
2433 unsigned : 1;
2434 unsigned : 1;
2435 unsigned RCIDL : 1;
2436 unsigned : 1;
2438 } __BAUDCTLbits_t;
2440 extern __at(0x0FB8) volatile __BAUDCTLbits_t BAUDCTLbits;
2442 #define _BAUDCTL_ABDEN 0x01
2443 #define _BAUDCTL_WUE 0x02
2444 #define _BAUDCTL_BRG16 0x08
2445 #define _BAUDCTL_SCKP 0x10
2446 #define _BAUDCTL_RCMT 0x40
2447 #define _BAUDCTL_RCIDL 0x40
2448 #define _BAUDCTL_ABDOVF 0x80
2450 //==============================================================================
2453 //==============================================================================
2454 // CCP2CON Bits
2456 extern __at(0x0FBA) __sfr CCP2CON;
2458 typedef union
2460 struct
2462 unsigned CCP2M0 : 1;
2463 unsigned CCP2M1 : 1;
2464 unsigned CCP2M2 : 1;
2465 unsigned CCP2M3 : 1;
2466 unsigned DC2B0 : 1;
2467 unsigned DC2B1 : 1;
2468 unsigned : 1;
2469 unsigned : 1;
2472 struct
2474 unsigned : 1;
2475 unsigned : 1;
2476 unsigned : 1;
2477 unsigned : 1;
2478 unsigned CCP2Y : 1;
2479 unsigned CCP2X : 1;
2480 unsigned : 1;
2481 unsigned : 1;
2484 struct
2486 unsigned CCP2M : 4;
2487 unsigned : 4;
2490 struct
2492 unsigned : 4;
2493 unsigned DC2B : 2;
2494 unsigned : 2;
2496 } __CCP2CONbits_t;
2498 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
2500 #define _CCP2M0 0x01
2501 #define _CCP2M1 0x02
2502 #define _CCP2M2 0x04
2503 #define _CCP2M3 0x08
2504 #define _DC2B0 0x10
2505 #define _CCP2Y 0x10
2506 #define _DC2B1 0x20
2507 #define _CCP2X 0x20
2509 //==============================================================================
2511 extern __at(0x0FBB) __sfr CCPR2;
2512 extern __at(0x0FBB) __sfr CCPR2L;
2513 extern __at(0x0FBC) __sfr CCPR2H;
2515 //==============================================================================
2516 // CCP1CON Bits
2518 extern __at(0x0FBD) __sfr CCP1CON;
2520 typedef union
2522 struct
2524 unsigned CCP1M0 : 1;
2525 unsigned CCP1M1 : 1;
2526 unsigned CCP1M2 : 1;
2527 unsigned CCP1M3 : 1;
2528 unsigned DC1B0 : 1;
2529 unsigned DC1B1 : 1;
2530 unsigned P1M0 : 1;
2531 unsigned P1M1 : 1;
2534 struct
2536 unsigned : 1;
2537 unsigned : 1;
2538 unsigned : 1;
2539 unsigned : 1;
2540 unsigned CCP1Y : 1;
2541 unsigned CCP1X : 1;
2542 unsigned : 1;
2543 unsigned : 1;
2546 struct
2548 unsigned CCP1M : 4;
2549 unsigned : 4;
2552 struct
2554 unsigned : 4;
2555 unsigned DC1B : 2;
2556 unsigned : 2;
2559 struct
2561 unsigned : 6;
2562 unsigned P1M : 2;
2564 } __CCP1CONbits_t;
2566 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
2568 #define _CCP1M0 0x01
2569 #define _CCP1M1 0x02
2570 #define _CCP1M2 0x04
2571 #define _CCP1M3 0x08
2572 #define _DC1B0 0x10
2573 #define _CCP1Y 0x10
2574 #define _DC1B1 0x20
2575 #define _CCP1X 0x20
2576 #define _P1M0 0x40
2577 #define _P1M1 0x80
2579 //==============================================================================
2582 //==============================================================================
2583 // ECCP1CON Bits
2585 extern __at(0x0FBD) __sfr ECCP1CON;
2587 typedef union
2589 struct
2591 unsigned CCP1M0 : 1;
2592 unsigned CCP1M1 : 1;
2593 unsigned CCP1M2 : 1;
2594 unsigned CCP1M3 : 1;
2595 unsigned DC1B0 : 1;
2596 unsigned DC1B1 : 1;
2597 unsigned P1M0 : 1;
2598 unsigned P1M1 : 1;
2601 struct
2603 unsigned : 1;
2604 unsigned : 1;
2605 unsigned : 1;
2606 unsigned : 1;
2607 unsigned CCP1Y : 1;
2608 unsigned CCP1X : 1;
2609 unsigned : 1;
2610 unsigned : 1;
2613 struct
2615 unsigned CCP1M : 4;
2616 unsigned : 4;
2619 struct
2621 unsigned : 4;
2622 unsigned DC1B : 2;
2623 unsigned : 2;
2626 struct
2628 unsigned : 6;
2629 unsigned P1M : 2;
2631 } __ECCP1CONbits_t;
2633 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
2635 #define _ECCP1CON_CCP1M0 0x01
2636 #define _ECCP1CON_CCP1M1 0x02
2637 #define _ECCP1CON_CCP1M2 0x04
2638 #define _ECCP1CON_CCP1M3 0x08
2639 #define _ECCP1CON_DC1B0 0x10
2640 #define _ECCP1CON_CCP1Y 0x10
2641 #define _ECCP1CON_DC1B1 0x20
2642 #define _ECCP1CON_CCP1X 0x20
2643 #define _ECCP1CON_P1M0 0x40
2644 #define _ECCP1CON_P1M1 0x80
2646 //==============================================================================
2648 extern __at(0x0FBE) __sfr CCPR1;
2649 extern __at(0x0FBE) __sfr CCPR1L;
2650 extern __at(0x0FBF) __sfr CCPR1H;
2652 //==============================================================================
2653 // ADCON2 Bits
2655 extern __at(0x0FC0) __sfr ADCON2;
2657 typedef union
2659 struct
2661 unsigned ADCS0 : 1;
2662 unsigned ADCS1 : 1;
2663 unsigned ADCS2 : 1;
2664 unsigned ACQT0 : 1;
2665 unsigned ACQT1 : 1;
2666 unsigned ACQT2 : 1;
2667 unsigned : 1;
2668 unsigned ADFM : 1;
2671 struct
2673 unsigned ADCS : 3;
2674 unsigned : 5;
2677 struct
2679 unsigned : 3;
2680 unsigned ACQT : 3;
2681 unsigned : 2;
2683 } __ADCON2bits_t;
2685 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
2687 #define _ADCS0 0x01
2688 #define _ADCS1 0x02
2689 #define _ADCS2 0x04
2690 #define _ACQT0 0x08
2691 #define _ACQT1 0x10
2692 #define _ACQT2 0x20
2693 #define _ADFM 0x80
2695 //==============================================================================
2698 //==============================================================================
2699 // ADCON1 Bits
2701 extern __at(0x0FC1) __sfr ADCON1;
2703 typedef union
2705 struct
2707 unsigned PCFG0 : 1;
2708 unsigned PCFG1 : 1;
2709 unsigned PCFG2 : 1;
2710 unsigned PCFG3 : 1;
2711 unsigned VCFG0 : 1;
2712 unsigned VCFG1 : 1;
2713 unsigned : 1;
2714 unsigned : 1;
2717 struct
2719 unsigned PCFG : 4;
2720 unsigned : 4;
2723 struct
2725 unsigned : 4;
2726 unsigned VCFG : 2;
2727 unsigned : 2;
2729 } __ADCON1bits_t;
2731 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
2733 #define _PCFG0 0x01
2734 #define _PCFG1 0x02
2735 #define _PCFG2 0x04
2736 #define _PCFG3 0x08
2737 #define _VCFG0 0x10
2738 #define _VCFG1 0x20
2740 //==============================================================================
2743 //==============================================================================
2744 // ADCON0 Bits
2746 extern __at(0x0FC2) __sfr ADCON0;
2748 typedef union
2750 struct
2752 unsigned ADON : 1;
2753 unsigned GO_NOT_DONE : 1;
2754 unsigned CHS0 : 1;
2755 unsigned CHS1 : 1;
2756 unsigned CHS2 : 1;
2757 unsigned CHS3 : 1;
2758 unsigned : 1;
2759 unsigned ADCAL : 1;
2762 struct
2764 unsigned : 1;
2765 unsigned DONE : 1;
2766 unsigned : 1;
2767 unsigned : 1;
2768 unsigned : 1;
2769 unsigned : 1;
2770 unsigned : 1;
2771 unsigned : 1;
2774 struct
2776 unsigned : 1;
2777 unsigned GO_DONE : 1;
2778 unsigned : 1;
2779 unsigned : 1;
2780 unsigned : 1;
2781 unsigned : 1;
2782 unsigned : 1;
2783 unsigned : 1;
2786 struct
2788 unsigned : 1;
2789 unsigned GO : 1;
2790 unsigned : 1;
2791 unsigned : 1;
2792 unsigned : 1;
2793 unsigned : 1;
2794 unsigned : 1;
2795 unsigned : 1;
2798 struct
2800 unsigned : 1;
2801 unsigned NOT_DONE : 1;
2802 unsigned : 1;
2803 unsigned : 1;
2804 unsigned : 1;
2805 unsigned : 1;
2806 unsigned : 1;
2807 unsigned : 1;
2810 struct
2812 unsigned : 2;
2813 unsigned CHS : 4;
2814 unsigned : 2;
2816 } __ADCON0bits_t;
2818 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
2820 #define _ADON 0x01
2821 #define _GO_NOT_DONE 0x02
2822 #define _DONE 0x02
2823 #define _GO_DONE 0x02
2824 #define _GO 0x02
2825 #define _NOT_DONE 0x02
2826 #define _CHS0 0x04
2827 #define _CHS1 0x08
2828 #define _CHS2 0x10
2829 #define _CHS3 0x20
2830 #define _ADCAL 0x80
2832 //==============================================================================
2834 extern __at(0x0FC3) __sfr ADRES;
2835 extern __at(0x0FC3) __sfr ADRESL;
2836 extern __at(0x0FC4) __sfr ADRESH;
2838 //==============================================================================
2839 // SSP1CON2 Bits
2841 extern __at(0x0FC5) __sfr SSP1CON2;
2843 typedef struct
2845 unsigned SEN : 1;
2846 unsigned RSEN : 1;
2847 unsigned PEN : 1;
2848 unsigned RCEN : 1;
2849 unsigned ACKEN : 1;
2850 unsigned ACKDT : 1;
2851 unsigned ACKSTAT : 1;
2852 unsigned GCEN : 1;
2853 } __SSP1CON2bits_t;
2855 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
2857 #define _SEN 0x01
2858 #define _RSEN 0x02
2859 #define _PEN 0x04
2860 #define _RCEN 0x08
2861 #define _ACKEN 0x10
2862 #define _ACKDT 0x20
2863 #define _ACKSTAT 0x40
2864 #define _GCEN 0x80
2866 //==============================================================================
2869 //==============================================================================
2870 // SSPCON2 Bits
2872 extern __at(0x0FC5) __sfr SSPCON2;
2874 typedef struct
2876 unsigned SEN : 1;
2877 unsigned RSEN : 1;
2878 unsigned PEN : 1;
2879 unsigned RCEN : 1;
2880 unsigned ACKEN : 1;
2881 unsigned ACKDT : 1;
2882 unsigned ACKSTAT : 1;
2883 unsigned GCEN : 1;
2884 } __SSPCON2bits_t;
2886 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
2888 #define _SSPCON2_SEN 0x01
2889 #define _SSPCON2_RSEN 0x02
2890 #define _SSPCON2_PEN 0x04
2891 #define _SSPCON2_RCEN 0x08
2892 #define _SSPCON2_ACKEN 0x10
2893 #define _SSPCON2_ACKDT 0x20
2894 #define _SSPCON2_ACKSTAT 0x40
2895 #define _SSPCON2_GCEN 0x80
2897 //==============================================================================
2900 //==============================================================================
2901 // SSP1CON1 Bits
2903 extern __at(0x0FC6) __sfr SSP1CON1;
2905 typedef union
2907 struct
2909 unsigned SSPM0 : 1;
2910 unsigned SSPM1 : 1;
2911 unsigned SSPM2 : 1;
2912 unsigned SSPM3 : 1;
2913 unsigned CKP : 1;
2914 unsigned SSPEN : 1;
2915 unsigned SSPOV : 1;
2916 unsigned WCOL : 1;
2919 struct
2921 unsigned SSPM : 4;
2922 unsigned : 4;
2924 } __SSP1CON1bits_t;
2926 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
2928 #define _SSPM0 0x01
2929 #define _SSPM1 0x02
2930 #define _SSPM2 0x04
2931 #define _SSPM3 0x08
2932 #define _CKP 0x10
2933 #define _SSPEN 0x20
2934 #define _SSPOV 0x40
2935 #define _WCOL 0x80
2937 //==============================================================================
2940 //==============================================================================
2941 // SSPCON1 Bits
2943 extern __at(0x0FC6) __sfr SSPCON1;
2945 typedef union
2947 struct
2949 unsigned SSPM0 : 1;
2950 unsigned SSPM1 : 1;
2951 unsigned SSPM2 : 1;
2952 unsigned SSPM3 : 1;
2953 unsigned CKP : 1;
2954 unsigned SSPEN : 1;
2955 unsigned SSPOV : 1;
2956 unsigned WCOL : 1;
2959 struct
2961 unsigned SSPM : 4;
2962 unsigned : 4;
2964 } __SSPCON1bits_t;
2966 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
2968 #define _SSPCON1_SSPM0 0x01
2969 #define _SSPCON1_SSPM1 0x02
2970 #define _SSPCON1_SSPM2 0x04
2971 #define _SSPCON1_SSPM3 0x08
2972 #define _SSPCON1_CKP 0x10
2973 #define _SSPCON1_SSPEN 0x20
2974 #define _SSPCON1_SSPOV 0x40
2975 #define _SSPCON1_WCOL 0x80
2977 //==============================================================================
2980 //==============================================================================
2981 // SSP1STAT Bits
2983 extern __at(0x0FC7) __sfr SSP1STAT;
2985 typedef union
2987 struct
2989 unsigned BF : 1;
2990 unsigned UA : 1;
2991 unsigned R_NOT_W : 1;
2992 unsigned S : 1;
2993 unsigned P : 1;
2994 unsigned D_NOT_A : 1;
2995 unsigned CKE : 1;
2996 unsigned SMP : 1;
2999 struct
3001 unsigned : 1;
3002 unsigned : 1;
3003 unsigned R_W : 1;
3004 unsigned I2C_START : 1;
3005 unsigned I2C_STOP : 1;
3006 unsigned D_A : 1;
3007 unsigned : 1;
3008 unsigned : 1;
3011 struct
3013 unsigned : 1;
3014 unsigned : 1;
3015 unsigned I2C_READ : 1;
3016 unsigned : 1;
3017 unsigned : 1;
3018 unsigned I2C_DAT : 1;
3019 unsigned : 1;
3020 unsigned : 1;
3023 struct
3025 unsigned : 1;
3026 unsigned : 1;
3027 unsigned NOT_W : 1;
3028 unsigned : 1;
3029 unsigned : 1;
3030 unsigned NOT_A : 1;
3031 unsigned : 1;
3032 unsigned : 1;
3035 struct
3037 unsigned : 1;
3038 unsigned : 1;
3039 unsigned NOT_WRITE : 1;
3040 unsigned : 1;
3041 unsigned : 1;
3042 unsigned NOT_ADDRESS : 1;
3043 unsigned : 1;
3044 unsigned : 1;
3047 struct
3049 unsigned : 1;
3050 unsigned : 1;
3051 unsigned READ_WRITE : 1;
3052 unsigned : 1;
3053 unsigned : 1;
3054 unsigned DATA_ADDRESS : 1;
3055 unsigned : 1;
3056 unsigned : 1;
3059 struct
3061 unsigned : 1;
3062 unsigned : 1;
3063 unsigned R : 1;
3064 unsigned : 1;
3065 unsigned : 1;
3066 unsigned D : 1;
3067 unsigned : 1;
3068 unsigned : 1;
3070 } __SSP1STATbits_t;
3072 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
3074 #define _BF 0x01
3075 #define _UA 0x02
3076 #define _R_NOT_W 0x04
3077 #define _R_W 0x04
3078 #define _I2C_READ 0x04
3079 #define _NOT_W 0x04
3080 #define _NOT_WRITE 0x04
3081 #define _READ_WRITE 0x04
3082 #define _R 0x04
3083 #define _S 0x08
3084 #define _I2C_START 0x08
3085 #define _P 0x10
3086 #define _I2C_STOP 0x10
3087 #define _D_NOT_A 0x20
3088 #define _D_A 0x20
3089 #define _I2C_DAT 0x20
3090 #define _NOT_A 0x20
3091 #define _NOT_ADDRESS 0x20
3092 #define _DATA_ADDRESS 0x20
3093 #define _D 0x20
3094 #define _CKE 0x40
3095 #define _SMP 0x80
3097 //==============================================================================
3100 //==============================================================================
3101 // SSPSTAT Bits
3103 extern __at(0x0FC7) __sfr SSPSTAT;
3105 typedef union
3107 struct
3109 unsigned BF : 1;
3110 unsigned UA : 1;
3111 unsigned R_NOT_W : 1;
3112 unsigned S : 1;
3113 unsigned P : 1;
3114 unsigned D_NOT_A : 1;
3115 unsigned CKE : 1;
3116 unsigned SMP : 1;
3119 struct
3121 unsigned : 1;
3122 unsigned : 1;
3123 unsigned R_W : 1;
3124 unsigned I2C_START : 1;
3125 unsigned I2C_STOP : 1;
3126 unsigned D_A : 1;
3127 unsigned : 1;
3128 unsigned : 1;
3131 struct
3133 unsigned : 1;
3134 unsigned : 1;
3135 unsigned I2C_READ : 1;
3136 unsigned : 1;
3137 unsigned : 1;
3138 unsigned I2C_DAT : 1;
3139 unsigned : 1;
3140 unsigned : 1;
3143 struct
3145 unsigned : 1;
3146 unsigned : 1;
3147 unsigned NOT_W : 1;
3148 unsigned : 1;
3149 unsigned : 1;
3150 unsigned NOT_A : 1;
3151 unsigned : 1;
3152 unsigned : 1;
3155 struct
3157 unsigned : 1;
3158 unsigned : 1;
3159 unsigned NOT_WRITE : 1;
3160 unsigned : 1;
3161 unsigned : 1;
3162 unsigned NOT_ADDRESS : 1;
3163 unsigned : 1;
3164 unsigned : 1;
3167 struct
3169 unsigned : 1;
3170 unsigned : 1;
3171 unsigned READ_WRITE : 1;
3172 unsigned : 1;
3173 unsigned : 1;
3174 unsigned DATA_ADDRESS : 1;
3175 unsigned : 1;
3176 unsigned : 1;
3179 struct
3181 unsigned : 1;
3182 unsigned : 1;
3183 unsigned R : 1;
3184 unsigned : 1;
3185 unsigned : 1;
3186 unsigned D : 1;
3187 unsigned : 1;
3188 unsigned : 1;
3190 } __SSPSTATbits_t;
3192 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
3194 #define _SSPSTAT_BF 0x01
3195 #define _SSPSTAT_UA 0x02
3196 #define _SSPSTAT_R_NOT_W 0x04
3197 #define _SSPSTAT_R_W 0x04
3198 #define _SSPSTAT_I2C_READ 0x04
3199 #define _SSPSTAT_NOT_W 0x04
3200 #define _SSPSTAT_NOT_WRITE 0x04
3201 #define _SSPSTAT_READ_WRITE 0x04
3202 #define _SSPSTAT_R 0x04
3203 #define _SSPSTAT_S 0x08
3204 #define _SSPSTAT_I2C_START 0x08
3205 #define _SSPSTAT_P 0x10
3206 #define _SSPSTAT_I2C_STOP 0x10
3207 #define _SSPSTAT_D_NOT_A 0x20
3208 #define _SSPSTAT_D_A 0x20
3209 #define _SSPSTAT_I2C_DAT 0x20
3210 #define _SSPSTAT_NOT_A 0x20
3211 #define _SSPSTAT_NOT_ADDRESS 0x20
3212 #define _SSPSTAT_DATA_ADDRESS 0x20
3213 #define _SSPSTAT_D 0x20
3214 #define _SSPSTAT_CKE 0x40
3215 #define _SSPSTAT_SMP 0x80
3217 //==============================================================================
3219 extern __at(0x0FC8) __sfr SSP1ADD;
3220 extern __at(0x0FC8) __sfr SSPADD;
3221 extern __at(0x0FC9) __sfr SSP1BUF;
3222 extern __at(0x0FC9) __sfr SSPBUF;
3224 //==============================================================================
3225 // T2CON Bits
3227 extern __at(0x0FCA) __sfr T2CON;
3229 typedef union
3231 struct
3233 unsigned T2CKPS0 : 1;
3234 unsigned T2CKPS1 : 1;
3235 unsigned TMR2ON : 1;
3236 unsigned T2OUTPS0 : 1;
3237 unsigned T2OUTPS1 : 1;
3238 unsigned T2OUTPS2 : 1;
3239 unsigned T2OUTPS3 : 1;
3240 unsigned : 1;
3243 struct
3245 unsigned : 1;
3246 unsigned : 1;
3247 unsigned : 1;
3248 unsigned TOUTPS0 : 1;
3249 unsigned TOUTPS1 : 1;
3250 unsigned TOUTPS2 : 1;
3251 unsigned TOUTPS3 : 1;
3252 unsigned : 1;
3255 struct
3257 unsigned T2CKPS : 2;
3258 unsigned : 6;
3261 struct
3263 unsigned : 3;
3264 unsigned T2OUTPS : 4;
3265 unsigned : 1;
3268 struct
3270 unsigned : 3;
3271 unsigned TOUTPS : 4;
3272 unsigned : 1;
3274 } __T2CONbits_t;
3276 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
3278 #define _T2CKPS0 0x01
3279 #define _T2CKPS1 0x02
3280 #define _TMR2ON 0x04
3281 #define _T2OUTPS0 0x08
3282 #define _TOUTPS0 0x08
3283 #define _T2OUTPS1 0x10
3284 #define _TOUTPS1 0x10
3285 #define _T2OUTPS2 0x20
3286 #define _TOUTPS2 0x20
3287 #define _T2OUTPS3 0x40
3288 #define _TOUTPS3 0x40
3290 //==============================================================================
3292 extern __at(0x0FCB) __sfr PR2;
3293 extern __at(0x0FCC) __sfr TMR2;
3295 //==============================================================================
3296 // T1CON Bits
3298 extern __at(0x0FCD) __sfr T1CON;
3300 typedef union
3302 struct
3304 unsigned TMR1ON : 1;
3305 unsigned TMR1CS : 1;
3306 unsigned NOT_T1SYNC : 1;
3307 unsigned T1OSCEN : 1;
3308 unsigned T1CKPS0 : 1;
3309 unsigned T1CKPS1 : 1;
3310 unsigned T1RUN : 1;
3311 unsigned RD16 : 1;
3314 struct
3316 unsigned : 1;
3317 unsigned : 1;
3318 unsigned T1SYNC : 1;
3319 unsigned : 1;
3320 unsigned : 1;
3321 unsigned : 1;
3322 unsigned : 1;
3323 unsigned : 1;
3326 struct
3328 unsigned : 1;
3329 unsigned : 1;
3330 unsigned T1INSYNC : 1;
3331 unsigned : 1;
3332 unsigned : 1;
3333 unsigned : 1;
3334 unsigned : 1;
3335 unsigned : 1;
3338 struct
3340 unsigned : 4;
3341 unsigned T1CKPS : 2;
3342 unsigned : 2;
3344 } __T1CONbits_t;
3346 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
3348 #define _TMR1ON 0x01
3349 #define _TMR1CS 0x02
3350 #define _NOT_T1SYNC 0x04
3351 #define _T1SYNC 0x04
3352 #define _T1INSYNC 0x04
3353 #define _T1OSCEN 0x08
3354 #define _T1CKPS0 0x10
3355 #define _T1CKPS1 0x20
3356 #define _T1RUN 0x40
3357 #define _RD16 0x80
3359 //==============================================================================
3361 extern __at(0x0FCE) __sfr TMR1;
3362 extern __at(0x0FCE) __sfr TMR1L;
3363 extern __at(0x0FCF) __sfr TMR1H;
3365 //==============================================================================
3366 // RCON Bits
3368 extern __at(0x0FD0) __sfr RCON;
3370 typedef union
3372 struct
3374 unsigned NOT_BOR : 1;
3375 unsigned NOT_POR : 1;
3376 unsigned NOT_PD : 1;
3377 unsigned NOT_TO : 1;
3378 unsigned NOT_RI : 1;
3379 unsigned : 1;
3380 unsigned : 1;
3381 unsigned IPEN : 1;
3384 struct
3386 unsigned BOR : 1;
3387 unsigned POR : 1;
3388 unsigned PD : 1;
3389 unsigned TO : 1;
3390 unsigned RI : 1;
3391 unsigned : 1;
3392 unsigned : 1;
3393 unsigned : 1;
3395 } __RCONbits_t;
3397 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
3399 #define _NOT_BOR 0x01
3400 #define _BOR 0x01
3401 #define _NOT_POR 0x02
3402 #define _POR 0x02
3403 #define _NOT_PD 0x04
3404 #define _PD 0x04
3405 #define _NOT_TO 0x08
3406 #define _TO 0x08
3407 #define _NOT_RI 0x10
3408 #define _RI 0x10
3409 #define _IPEN 0x80
3411 //==============================================================================
3414 //==============================================================================
3415 // WDTCON Bits
3417 extern __at(0x0FD1) __sfr WDTCON;
3419 typedef union
3421 struct
3423 unsigned SWDTEN : 1;
3424 unsigned : 1;
3425 unsigned : 1;
3426 unsigned : 1;
3427 unsigned : 1;
3428 unsigned : 1;
3429 unsigned : 1;
3430 unsigned : 1;
3433 struct
3435 unsigned SWDTE : 1;
3436 unsigned : 1;
3437 unsigned : 1;
3438 unsigned : 1;
3439 unsigned : 1;
3440 unsigned : 1;
3441 unsigned : 1;
3442 unsigned : 1;
3444 } __WDTCONbits_t;
3446 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
3448 #define _SWDTEN 0x01
3449 #define _SWDTE 0x01
3451 //==============================================================================
3454 //==============================================================================
3455 // OSCCON Bits
3457 extern __at(0x0FD3) __sfr OSCCON;
3459 typedef union
3461 struct
3463 unsigned SCS0 : 1;
3464 unsigned SCS1 : 1;
3465 unsigned : 1;
3466 unsigned OSTS : 1;
3467 unsigned : 1;
3468 unsigned : 1;
3469 unsigned : 1;
3470 unsigned IDLEN : 1;
3473 struct
3475 unsigned SCS : 2;
3476 unsigned : 6;
3478 } __OSCCONbits_t;
3480 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
3482 #define _SCS0 0x01
3483 #define _SCS1 0x02
3484 #define _OSTS 0x08
3485 #define _IDLEN 0x80
3487 //==============================================================================
3490 //==============================================================================
3491 // T0CON Bits
3493 extern __at(0x0FD5) __sfr T0CON;
3495 typedef union
3497 struct
3499 unsigned T0PS0 : 1;
3500 unsigned T0PS1 : 1;
3501 unsigned T0PS2 : 1;
3502 unsigned PSA : 1;
3503 unsigned T0SE : 1;
3504 unsigned T0CS : 1;
3505 unsigned T08BIT : 1;
3506 unsigned TMR0ON : 1;
3509 struct
3511 unsigned T0PS : 3;
3512 unsigned : 5;
3514 } __T0CONbits_t;
3516 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
3518 #define _T0PS0 0x01
3519 #define _T0PS1 0x02
3520 #define _T0PS2 0x04
3521 #define _PSA 0x08
3522 #define _T0SE 0x10
3523 #define _T0CS 0x20
3524 #define _T08BIT 0x40
3525 #define _TMR0ON 0x80
3527 //==============================================================================
3529 extern __at(0x0FD6) __sfr TMR0;
3530 extern __at(0x0FD6) __sfr TMR0L;
3531 extern __at(0x0FD7) __sfr TMR0H;
3533 //==============================================================================
3534 // STATUS Bits
3536 extern __at(0x0FD8) __sfr STATUS;
3538 typedef struct
3540 unsigned C : 1;
3541 unsigned DC : 1;
3542 unsigned Z : 1;
3543 unsigned OV : 1;
3544 unsigned N : 1;
3545 unsigned : 1;
3546 unsigned : 1;
3547 unsigned : 1;
3548 } __STATUSbits_t;
3550 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
3552 #define _C 0x01
3553 #define _DC 0x02
3554 #define _Z 0x04
3555 #define _OV 0x08
3556 #define _N 0x10
3558 //==============================================================================
3560 extern __at(0x0FD9) __sfr FSR2L;
3561 extern __at(0x0FDA) __sfr FSR2H;
3562 extern __at(0x0FDB) __sfr PLUSW2;
3563 extern __at(0x0FDC) __sfr PREINC2;
3564 extern __at(0x0FDD) __sfr POSTDEC2;
3565 extern __at(0x0FDE) __sfr POSTINC2;
3566 extern __at(0x0FDF) __sfr INDF2;
3567 extern __at(0x0FE0) __sfr BSR;
3568 extern __at(0x0FE1) __sfr FSR1L;
3569 extern __at(0x0FE2) __sfr FSR1H;
3570 extern __at(0x0FE3) __sfr PLUSW1;
3571 extern __at(0x0FE4) __sfr PREINC1;
3572 extern __at(0x0FE5) __sfr POSTDEC1;
3573 extern __at(0x0FE6) __sfr POSTINC1;
3574 extern __at(0x0FE7) __sfr INDF1;
3575 extern __at(0x0FE8) __sfr WREG;
3576 extern __at(0x0FE9) __sfr FSR0L;
3577 extern __at(0x0FEA) __sfr FSR0H;
3578 extern __at(0x0FEB) __sfr PLUSW0;
3579 extern __at(0x0FEC) __sfr PREINC0;
3580 extern __at(0x0FED) __sfr POSTDEC0;
3581 extern __at(0x0FEE) __sfr POSTINC0;
3582 extern __at(0x0FEF) __sfr INDF0;
3584 //==============================================================================
3585 // INTCON3 Bits
3587 extern __at(0x0FF0) __sfr INTCON3;
3589 typedef union
3591 struct
3593 unsigned INT1IF : 1;
3594 unsigned INT2IF : 1;
3595 unsigned : 1;
3596 unsigned INT1IE : 1;
3597 unsigned INT2IE : 1;
3598 unsigned : 1;
3599 unsigned INT1IP : 1;
3600 unsigned INT2IP : 1;
3603 struct
3605 unsigned INT1F : 1;
3606 unsigned INT2F : 1;
3607 unsigned : 1;
3608 unsigned INT1E : 1;
3609 unsigned INT2E : 1;
3610 unsigned : 1;
3611 unsigned INT1P : 1;
3612 unsigned INT2P : 1;
3614 } __INTCON3bits_t;
3616 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
3618 #define _INT1IF 0x01
3619 #define _INT1F 0x01
3620 #define _INT2IF 0x02
3621 #define _INT2F 0x02
3622 #define _INT1IE 0x08
3623 #define _INT1E 0x08
3624 #define _INT2IE 0x10
3625 #define _INT2E 0x10
3626 #define _INT1IP 0x40
3627 #define _INT1P 0x40
3628 #define _INT2IP 0x80
3629 #define _INT2P 0x80
3631 //==============================================================================
3634 //==============================================================================
3635 // INTCON2 Bits
3637 extern __at(0x0FF1) __sfr INTCON2;
3639 typedef union
3641 struct
3643 unsigned RBIP : 1;
3644 unsigned : 1;
3645 unsigned TMR0IP : 1;
3646 unsigned : 1;
3647 unsigned INTEDG2 : 1;
3648 unsigned INTEDG1 : 1;
3649 unsigned INTEDG0 : 1;
3650 unsigned NOT_RBPU : 1;
3653 struct
3655 unsigned : 1;
3656 unsigned : 1;
3657 unsigned T0IP : 1;
3658 unsigned : 1;
3659 unsigned : 1;
3660 unsigned : 1;
3661 unsigned : 1;
3662 unsigned RBPU : 1;
3664 } __INTCON2bits_t;
3666 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
3668 #define _RBIP 0x01
3669 #define _TMR0IP 0x04
3670 #define _T0IP 0x04
3671 #define _INTEDG2 0x10
3672 #define _INTEDG1 0x20
3673 #define _INTEDG0 0x40
3674 #define _NOT_RBPU 0x80
3675 #define _RBPU 0x80
3677 //==============================================================================
3680 //==============================================================================
3681 // INTCON Bits
3683 extern __at(0x0FF2) __sfr INTCON;
3685 typedef union
3687 struct
3689 unsigned RBIF : 1;
3690 unsigned INT0IF : 1;
3691 unsigned TMR0IF : 1;
3692 unsigned RBIE : 1;
3693 unsigned INT0IE : 1;
3694 unsigned TMR0IE : 1;
3695 unsigned PEIE_GIEL : 1;
3696 unsigned GIE_GIEH : 1;
3699 struct
3701 unsigned : 1;
3702 unsigned INT0F : 1;
3703 unsigned T0IF : 1;
3704 unsigned : 1;
3705 unsigned INT0E : 1;
3706 unsigned T0IE : 1;
3707 unsigned PEIE : 1;
3708 unsigned GIE : 1;
3711 struct
3713 unsigned : 1;
3714 unsigned : 1;
3715 unsigned : 1;
3716 unsigned : 1;
3717 unsigned : 1;
3718 unsigned : 1;
3719 unsigned GIEL : 1;
3720 unsigned GIEH : 1;
3722 } __INTCONbits_t;
3724 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
3726 #define _RBIF 0x01
3727 #define _INT0IF 0x02
3728 #define _INT0F 0x02
3729 #define _TMR0IF 0x04
3730 #define _T0IF 0x04
3731 #define _RBIE 0x08
3732 #define _INT0IE 0x10
3733 #define _INT0E 0x10
3734 #define _TMR0IE 0x20
3735 #define _T0IE 0x20
3736 #define _PEIE_GIEL 0x40
3737 #define _PEIE 0x40
3738 #define _GIEL 0x40
3739 #define _GIE_GIEH 0x80
3740 #define _GIE 0x80
3741 #define _GIEH 0x80
3743 //==============================================================================
3745 extern __at(0x0FF3) __sfr PROD;
3746 extern __at(0x0FF3) __sfr PRODL;
3747 extern __at(0x0FF4) __sfr PRODH;
3748 extern __at(0x0FF5) __sfr TABLAT;
3749 extern __at(0x0FF6) __sfr TBLPTR;
3750 extern __at(0x0FF6) __sfr TBLPTRL;
3751 extern __at(0x0FF7) __sfr TBLPTRH;
3752 extern __at(0x0FF8) __sfr TBLPTRU;
3753 extern __at(0x0FF9) __sfr PC;
3754 extern __at(0x0FF9) __sfr PCL;
3755 extern __at(0x0FFA) __sfr PCLATH;
3756 extern __at(0x0FFB) __sfr PCLATU;
3758 //==============================================================================
3759 // STKPTR Bits
3761 extern __at(0x0FFC) __sfr STKPTR;
3763 typedef union
3765 struct
3767 unsigned STKPTR0 : 1;
3768 unsigned STKPTR1 : 1;
3769 unsigned STKPTR2 : 1;
3770 unsigned STKPTR3 : 1;
3771 unsigned STKPTR4 : 1;
3772 unsigned : 1;
3773 unsigned STKUNF : 1;
3774 unsigned STKFUL : 1;
3777 struct
3779 unsigned : 1;
3780 unsigned : 1;
3781 unsigned : 1;
3782 unsigned : 1;
3783 unsigned : 1;
3784 unsigned : 1;
3785 unsigned : 1;
3786 unsigned STKOVF : 1;
3789 struct
3791 unsigned STKPTR : 5;
3792 unsigned : 3;
3794 } __STKPTRbits_t;
3796 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
3798 #define _STKPTR0 0x01
3799 #define _STKPTR1 0x02
3800 #define _STKPTR2 0x04
3801 #define _STKPTR3 0x08
3802 #define _STKPTR4 0x10
3803 #define _STKUNF 0x40
3804 #define _STKFUL 0x80
3805 #define _STKOVF 0x80
3807 //==============================================================================
3809 extern __at(0x0FFD) __sfr TOS;
3810 extern __at(0x0FFD) __sfr TOSL;
3811 extern __at(0x0FFE) __sfr TOSH;
3812 extern __at(0x0FFF) __sfr TOSU;
3814 //==============================================================================
3816 // Configuration Addresses
3818 //==============================================================================
3820 #define __CONFIG1L 0x007FF8
3821 #define __CONFIG1H 0x007FF9
3822 #define __CONFIG2L 0x007FFA
3823 #define __CONFIG2H 0x007FFB
3824 #define __CONFIG3L 0x007FFC
3825 #define __CONFIG3H 0x007FFD
3827 //==============================================================================
3829 #endif // #ifndef __PIC18F45J10_H__