struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f87j10.h
blobabc0ccad806b1b761c4583e9e0f13378319195b1
1 /*
2 * This declarations of the PIC18F87J10 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:39 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 __PIC18F87J10_H__
26 #define __PIC18F87J10_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // SSP2CON2 Bits
40 extern __at(0x0F62) __sfr SSP2CON2;
42 typedef union
44 struct
46 unsigned SEN : 1;
47 unsigned RSEN : 1;
48 unsigned PEN : 1;
49 unsigned RCEN : 1;
50 unsigned ACKEN : 1;
51 unsigned ACKDT : 1;
52 unsigned ACKSTAT : 1;
53 unsigned GCEN : 1;
56 struct
58 unsigned : 1;
59 unsigned ADMSK1 : 1;
60 unsigned ADMSK2 : 1;
61 unsigned ADMSK3 : 1;
62 unsigned ADMSK4 : 1;
63 unsigned ADMSK5 : 1;
64 unsigned : 1;
65 unsigned : 1;
67 } __SSP2CON2bits_t;
69 extern __at(0x0F62) volatile __SSP2CON2bits_t SSP2CON2bits;
71 #define _SSP2CON2_SEN 0x01
72 #define _SSP2CON2_RSEN 0x02
73 #define _SSP2CON2_ADMSK1 0x02
74 #define _SSP2CON2_PEN 0x04
75 #define _SSP2CON2_ADMSK2 0x04
76 #define _SSP2CON2_RCEN 0x08
77 #define _SSP2CON2_ADMSK3 0x08
78 #define _SSP2CON2_ACKEN 0x10
79 #define _SSP2CON2_ADMSK4 0x10
80 #define _SSP2CON2_ACKDT 0x20
81 #define _SSP2CON2_ADMSK5 0x20
82 #define _SSP2CON2_ACKSTAT 0x40
83 #define _SSP2CON2_GCEN 0x80
85 //==============================================================================
88 //==============================================================================
89 // SSP2CON1 Bits
91 extern __at(0x0F63) __sfr SSP2CON1;
93 typedef union
95 struct
97 unsigned SSPM0 : 1;
98 unsigned SSPM1 : 1;
99 unsigned SSPM2 : 1;
100 unsigned SSPM3 : 1;
101 unsigned CKP : 1;
102 unsigned SSPEN : 1;
103 unsigned SSPOV : 1;
104 unsigned WCOL : 1;
107 struct
109 unsigned SSPM : 4;
110 unsigned : 4;
112 } __SSP2CON1bits_t;
114 extern __at(0x0F63) volatile __SSP2CON1bits_t SSP2CON1bits;
116 #define _SSP2CON1_SSPM0 0x01
117 #define _SSP2CON1_SSPM1 0x02
118 #define _SSP2CON1_SSPM2 0x04
119 #define _SSP2CON1_SSPM3 0x08
120 #define _SSP2CON1_CKP 0x10
121 #define _SSP2CON1_SSPEN 0x20
122 #define _SSP2CON1_SSPOV 0x40
123 #define _SSP2CON1_WCOL 0x80
125 //==============================================================================
128 //==============================================================================
129 // SSP2STAT Bits
131 extern __at(0x0F64) __sfr SSP2STAT;
133 typedef union
135 struct
137 unsigned BF : 1;
138 unsigned UA : 1;
139 unsigned R_NOT_W : 1;
140 unsigned S : 1;
141 unsigned P : 1;
142 unsigned D_NOT_A : 1;
143 unsigned CKE : 1;
144 unsigned SMP : 1;
147 struct
149 unsigned : 1;
150 unsigned : 1;
151 unsigned R_W : 1;
152 unsigned I2C_START : 1;
153 unsigned I2C_STOP : 1;
154 unsigned D_A : 1;
155 unsigned : 1;
156 unsigned : 1;
159 struct
161 unsigned : 1;
162 unsigned : 1;
163 unsigned I2C_READ : 1;
164 unsigned : 1;
165 unsigned : 1;
166 unsigned I2C_DAT : 1;
167 unsigned : 1;
168 unsigned : 1;
171 struct
173 unsigned : 1;
174 unsigned : 1;
175 unsigned NOT_W : 1;
176 unsigned : 1;
177 unsigned : 1;
178 unsigned NOT_A : 1;
179 unsigned : 1;
180 unsigned : 1;
183 struct
185 unsigned : 1;
186 unsigned : 1;
187 unsigned NOT_WRITE : 1;
188 unsigned : 1;
189 unsigned : 1;
190 unsigned NOT_ADDRESS : 1;
191 unsigned : 1;
192 unsigned : 1;
195 struct
197 unsigned : 1;
198 unsigned : 1;
199 unsigned READ_WRITE : 1;
200 unsigned : 1;
201 unsigned : 1;
202 unsigned DATA_ADDRESS : 1;
203 unsigned : 1;
204 unsigned : 1;
207 struct
209 unsigned : 1;
210 unsigned : 1;
211 unsigned R : 1;
212 unsigned : 1;
213 unsigned : 1;
214 unsigned D : 1;
215 unsigned : 1;
216 unsigned : 1;
218 } __SSP2STATbits_t;
220 extern __at(0x0F64) volatile __SSP2STATbits_t SSP2STATbits;
222 #define _SSP2STAT_BF 0x01
223 #define _SSP2STAT_UA 0x02
224 #define _SSP2STAT_R_NOT_W 0x04
225 #define _SSP2STAT_R_W 0x04
226 #define _SSP2STAT_I2C_READ 0x04
227 #define _SSP2STAT_NOT_W 0x04
228 #define _SSP2STAT_NOT_WRITE 0x04
229 #define _SSP2STAT_READ_WRITE 0x04
230 #define _SSP2STAT_R 0x04
231 #define _SSP2STAT_S 0x08
232 #define _SSP2STAT_I2C_START 0x08
233 #define _SSP2STAT_P 0x10
234 #define _SSP2STAT_I2C_STOP 0x10
235 #define _SSP2STAT_D_NOT_A 0x20
236 #define _SSP2STAT_D_A 0x20
237 #define _SSP2STAT_I2C_DAT 0x20
238 #define _SSP2STAT_NOT_A 0x20
239 #define _SSP2STAT_NOT_ADDRESS 0x20
240 #define _SSP2STAT_DATA_ADDRESS 0x20
241 #define _SSP2STAT_D 0x20
242 #define _SSP2STAT_CKE 0x40
243 #define _SSP2STAT_SMP 0x80
245 //==============================================================================
247 extern __at(0x0F65) __sfr SSP2ADD;
248 extern __at(0x0F66) __sfr SSP2BUF;
250 //==============================================================================
251 // ECCP2DEL Bits
253 extern __at(0x0F67) __sfr ECCP2DEL;
255 typedef union
257 struct
259 unsigned PDC0 : 1;
260 unsigned PDC1 : 1;
261 unsigned PDC2 : 1;
262 unsigned PDC3 : 1;
263 unsigned PDC4 : 1;
264 unsigned PDC5 : 1;
265 unsigned PDC6 : 1;
266 unsigned PRSEN : 1;
269 struct
271 unsigned P2DC0 : 1;
272 unsigned P2DC1 : 1;
273 unsigned P2DC2 : 1;
274 unsigned P2DC3 : 1;
275 unsigned P2DC4 : 1;
276 unsigned P2DC5 : 1;
277 unsigned P2DC6 : 1;
278 unsigned P2RSEN : 1;
281 struct
283 unsigned P2DC : 7;
284 unsigned : 1;
287 struct
289 unsigned PDC : 7;
290 unsigned : 1;
292 } __ECCP2DELbits_t;
294 extern __at(0x0F67) volatile __ECCP2DELbits_t ECCP2DELbits;
296 #define _ECCP2DEL_PDC0 0x01
297 #define _ECCP2DEL_P2DC0 0x01
298 #define _ECCP2DEL_PDC1 0x02
299 #define _ECCP2DEL_P2DC1 0x02
300 #define _ECCP2DEL_PDC2 0x04
301 #define _ECCP2DEL_P2DC2 0x04
302 #define _ECCP2DEL_PDC3 0x08
303 #define _ECCP2DEL_P2DC3 0x08
304 #define _ECCP2DEL_PDC4 0x10
305 #define _ECCP2DEL_P2DC4 0x10
306 #define _ECCP2DEL_PDC5 0x20
307 #define _ECCP2DEL_P2DC5 0x20
308 #define _ECCP2DEL_PDC6 0x40
309 #define _ECCP2DEL_P2DC6 0x40
310 #define _ECCP2DEL_PRSEN 0x80
311 #define _ECCP2DEL_P2RSEN 0x80
313 //==============================================================================
316 //==============================================================================
317 // ECCP2AS Bits
319 extern __at(0x0F68) __sfr ECCP2AS;
321 typedef union
323 struct
325 unsigned PSSBD0 : 1;
326 unsigned PSSBD1 : 1;
327 unsigned PSSAC0 : 1;
328 unsigned PSSAC1 : 1;
329 unsigned ECCPAS0 : 1;
330 unsigned ECCPAS1 : 1;
331 unsigned ECCPAS2 : 1;
332 unsigned ECCPASE : 1;
335 struct
337 unsigned PSS2BD0 : 1;
338 unsigned PSS2BD1 : 1;
339 unsigned PSS2AC0 : 1;
340 unsigned PSS2AC1 : 1;
341 unsigned ECCP2AS0 : 1;
342 unsigned ECCP2AS1 : 1;
343 unsigned ECCP2AS2 : 1;
344 unsigned ECCP2ASE : 1;
347 struct
349 unsigned PSS2BD : 2;
350 unsigned : 6;
353 struct
355 unsigned PSSBD : 2;
356 unsigned : 6;
359 struct
361 unsigned : 2;
362 unsigned PSSAC : 2;
363 unsigned : 4;
366 struct
368 unsigned : 2;
369 unsigned PSS2AC : 2;
370 unsigned : 4;
373 struct
375 unsigned : 4;
376 unsigned ECCP2AS : 3;
377 unsigned : 1;
380 struct
382 unsigned : 4;
383 unsigned ECCPAS : 3;
384 unsigned : 1;
386 } __ECCP2ASbits_t;
388 extern __at(0x0F68) volatile __ECCP2ASbits_t ECCP2ASbits;
390 #define _ECCP2AS_PSSBD0 0x01
391 #define _ECCP2AS_PSS2BD0 0x01
392 #define _ECCP2AS_PSSBD1 0x02
393 #define _ECCP2AS_PSS2BD1 0x02
394 #define _ECCP2AS_PSSAC0 0x04
395 #define _ECCP2AS_PSS2AC0 0x04
396 #define _ECCP2AS_PSSAC1 0x08
397 #define _ECCP2AS_PSS2AC1 0x08
398 #define _ECCP2AS_ECCPAS0 0x10
399 #define _ECCP2AS_ECCP2AS0 0x10
400 #define _ECCP2AS_ECCPAS1 0x20
401 #define _ECCP2AS_ECCP2AS1 0x20
402 #define _ECCP2AS_ECCPAS2 0x40
403 #define _ECCP2AS_ECCP2AS2 0x40
404 #define _ECCP2AS_ECCPASE 0x80
405 #define _ECCP2AS_ECCP2ASE 0x80
407 //==============================================================================
410 //==============================================================================
411 // ECCP3DEL Bits
413 extern __at(0x0F69) __sfr ECCP3DEL;
415 typedef union
417 struct
419 unsigned PDC0 : 1;
420 unsigned PDC1 : 1;
421 unsigned PDC2 : 1;
422 unsigned PDC3 : 1;
423 unsigned PDC4 : 1;
424 unsigned PDC5 : 1;
425 unsigned PDC6 : 1;
426 unsigned PRSEN : 1;
429 struct
431 unsigned P3DC0 : 1;
432 unsigned P3DC1 : 1;
433 unsigned P3DC2 : 1;
434 unsigned P3DC3 : 1;
435 unsigned P3DC4 : 1;
436 unsigned P3DC5 : 1;
437 unsigned P3DC6 : 1;
438 unsigned P3RSEN : 1;
441 struct
443 unsigned PDC : 7;
444 unsigned : 1;
447 struct
449 unsigned P3DC : 7;
450 unsigned : 1;
452 } __ECCP3DELbits_t;
454 extern __at(0x0F69) volatile __ECCP3DELbits_t ECCP3DELbits;
456 #define _ECCP3DEL_PDC0 0x01
457 #define _ECCP3DEL_P3DC0 0x01
458 #define _ECCP3DEL_PDC1 0x02
459 #define _ECCP3DEL_P3DC1 0x02
460 #define _ECCP3DEL_PDC2 0x04
461 #define _ECCP3DEL_P3DC2 0x04
462 #define _ECCP3DEL_PDC3 0x08
463 #define _ECCP3DEL_P3DC3 0x08
464 #define _ECCP3DEL_PDC4 0x10
465 #define _ECCP3DEL_P3DC4 0x10
466 #define _ECCP3DEL_PDC5 0x20
467 #define _ECCP3DEL_P3DC5 0x20
468 #define _ECCP3DEL_PDC6 0x40
469 #define _ECCP3DEL_P3DC6 0x40
470 #define _ECCP3DEL_PRSEN 0x80
471 #define _ECCP3DEL_P3RSEN 0x80
473 //==============================================================================
476 //==============================================================================
477 // ECCP3AS Bits
479 extern __at(0x0F6A) __sfr ECCP3AS;
481 typedef union
483 struct
485 unsigned PSSBD0 : 1;
486 unsigned PSSBD1 : 1;
487 unsigned PSSAC0 : 1;
488 unsigned PSSAC1 : 1;
489 unsigned ECCPAS0 : 1;
490 unsigned ECCPAS1 : 1;
491 unsigned ECCPAS2 : 1;
492 unsigned ECCPASE : 1;
495 struct
497 unsigned PSS3BD0 : 1;
498 unsigned PSS3BD1 : 1;
499 unsigned PSS3AC0 : 1;
500 unsigned PSS3AC1 : 1;
501 unsigned ECCP3AS0 : 1;
502 unsigned ECCP3AS1 : 1;
503 unsigned ECCP3AS2 : 1;
504 unsigned ECCP3ASE : 1;
507 struct
509 unsigned PSS3BD : 2;
510 unsigned : 6;
513 struct
515 unsigned PSSBD : 2;
516 unsigned : 6;
519 struct
521 unsigned : 2;
522 unsigned PSS3AC : 2;
523 unsigned : 4;
526 struct
528 unsigned : 2;
529 unsigned PSSAC : 2;
530 unsigned : 4;
533 struct
535 unsigned : 4;
536 unsigned ECCP3AS : 3;
537 unsigned : 1;
540 struct
542 unsigned : 4;
543 unsigned ECCPAS : 3;
544 unsigned : 1;
546 } __ECCP3ASbits_t;
548 extern __at(0x0F6A) volatile __ECCP3ASbits_t ECCP3ASbits;
550 #define _ECCP3AS_PSSBD0 0x01
551 #define _ECCP3AS_PSS3BD0 0x01
552 #define _ECCP3AS_PSSBD1 0x02
553 #define _ECCP3AS_PSS3BD1 0x02
554 #define _ECCP3AS_PSSAC0 0x04
555 #define _ECCP3AS_PSS3AC0 0x04
556 #define _ECCP3AS_PSSAC1 0x08
557 #define _ECCP3AS_PSS3AC1 0x08
558 #define _ECCP3AS_ECCPAS0 0x10
559 #define _ECCP3AS_ECCP3AS0 0x10
560 #define _ECCP3AS_ECCPAS1 0x20
561 #define _ECCP3AS_ECCP3AS1 0x20
562 #define _ECCP3AS_ECCPAS2 0x40
563 #define _ECCP3AS_ECCP3AS2 0x40
564 #define _ECCP3AS_ECCPASE 0x80
565 #define _ECCP3AS_ECCP3ASE 0x80
567 //==============================================================================
570 //==============================================================================
571 // RCSTA2 Bits
573 extern __at(0x0F6B) __sfr RCSTA2;
575 typedef union
577 struct
579 unsigned RX9D : 1;
580 unsigned OERR : 1;
581 unsigned FERR : 1;
582 unsigned ADDEN : 1;
583 unsigned CREN : 1;
584 unsigned SREN : 1;
585 unsigned RX9 : 1;
586 unsigned SPEN : 1;
589 struct
591 unsigned RCD8 : 1;
592 unsigned OERR2 : 1;
593 unsigned FERR2 : 1;
594 unsigned ADDEN2 : 1;
595 unsigned CREN2 : 1;
596 unsigned SREN2 : 1;
597 unsigned RC9 : 1;
598 unsigned SPEN2 : 1;
601 struct
603 unsigned RX9D2 : 1;
604 unsigned : 1;
605 unsigned : 1;
606 unsigned : 1;
607 unsigned : 1;
608 unsigned : 1;
609 unsigned NOT_RC8 : 1;
610 unsigned : 1;
613 struct
615 unsigned : 1;
616 unsigned : 1;
617 unsigned : 1;
618 unsigned : 1;
619 unsigned : 1;
620 unsigned : 1;
621 unsigned RC8_9 : 1;
622 unsigned : 1;
625 struct
627 unsigned : 1;
628 unsigned : 1;
629 unsigned : 1;
630 unsigned : 1;
631 unsigned : 1;
632 unsigned : 1;
633 unsigned RX92 : 1;
634 unsigned : 1;
636 } __RCSTA2bits_t;
638 extern __at(0x0F6B) volatile __RCSTA2bits_t RCSTA2bits;
640 #define _RCSTA2_RX9D 0x01
641 #define _RCSTA2_RCD8 0x01
642 #define _RCSTA2_RX9D2 0x01
643 #define _RCSTA2_OERR 0x02
644 #define _RCSTA2_OERR2 0x02
645 #define _RCSTA2_FERR 0x04
646 #define _RCSTA2_FERR2 0x04
647 #define _RCSTA2_ADDEN 0x08
648 #define _RCSTA2_ADDEN2 0x08
649 #define _RCSTA2_CREN 0x10
650 #define _RCSTA2_CREN2 0x10
651 #define _RCSTA2_SREN 0x20
652 #define _RCSTA2_SREN2 0x20
653 #define _RCSTA2_RX9 0x40
654 #define _RCSTA2_RC9 0x40
655 #define _RCSTA2_NOT_RC8 0x40
656 #define _RCSTA2_RC8_9 0x40
657 #define _RCSTA2_RX92 0x40
658 #define _RCSTA2_SPEN 0x80
659 #define _RCSTA2_SPEN2 0x80
661 //==============================================================================
664 //==============================================================================
665 // TXSTA2 Bits
667 extern __at(0x0F6C) __sfr TXSTA2;
669 typedef union
671 struct
673 unsigned TX9D : 1;
674 unsigned TRMT : 1;
675 unsigned BRGH : 1;
676 unsigned SENDB : 1;
677 unsigned SYNC : 1;
678 unsigned TXEN : 1;
679 unsigned TX9 : 1;
680 unsigned CSRC : 1;
683 struct
685 unsigned TXD8 : 1;
686 unsigned TRMT2 : 1;
687 unsigned BRGH2 : 1;
688 unsigned SENDB2 : 1;
689 unsigned SYNC2 : 1;
690 unsigned TXEN2 : 1;
691 unsigned TX8_9 : 1;
692 unsigned CSRC2 : 1;
695 struct
697 unsigned TX9D2 : 1;
698 unsigned : 1;
699 unsigned : 1;
700 unsigned : 1;
701 unsigned : 1;
702 unsigned : 1;
703 unsigned NOT_TX8 : 1;
704 unsigned : 1;
707 struct
709 unsigned : 1;
710 unsigned : 1;
711 unsigned : 1;
712 unsigned : 1;
713 unsigned : 1;
714 unsigned : 1;
715 unsigned TX92 : 1;
716 unsigned : 1;
718 } __TXSTA2bits_t;
720 extern __at(0x0F6C) volatile __TXSTA2bits_t TXSTA2bits;
722 #define _TXSTA2_TX9D 0x01
723 #define _TXSTA2_TXD8 0x01
724 #define _TXSTA2_TX9D2 0x01
725 #define _TXSTA2_TRMT 0x02
726 #define _TXSTA2_TRMT2 0x02
727 #define _TXSTA2_BRGH 0x04
728 #define _TXSTA2_BRGH2 0x04
729 #define _TXSTA2_SENDB 0x08
730 #define _TXSTA2_SENDB2 0x08
731 #define _TXSTA2_SYNC 0x10
732 #define _TXSTA2_SYNC2 0x10
733 #define _TXSTA2_TXEN 0x20
734 #define _TXSTA2_TXEN2 0x20
735 #define _TXSTA2_TX9 0x40
736 #define _TXSTA2_TX8_9 0x40
737 #define _TXSTA2_NOT_TX8 0x40
738 #define _TXSTA2_TX92 0x40
739 #define _TXSTA2_CSRC 0x80
740 #define _TXSTA2_CSRC2 0x80
742 //==============================================================================
744 extern __at(0x0F6D) __sfr TXREG2;
745 extern __at(0x0F6E) __sfr RCREG2;
746 extern __at(0x0F6F) __sfr SPBRG2;
748 //==============================================================================
749 // CCP5CON Bits
751 extern __at(0x0F70) __sfr CCP5CON;
753 typedef union
755 struct
757 unsigned CCP5M0 : 1;
758 unsigned CCP5M1 : 1;
759 unsigned CCP5M2 : 1;
760 unsigned CCP5M3 : 1;
761 unsigned DCCP5Y : 1;
762 unsigned DCCP5X : 1;
763 unsigned : 1;
764 unsigned : 1;
767 struct
769 unsigned : 1;
770 unsigned : 1;
771 unsigned : 1;
772 unsigned : 1;
773 unsigned DC5B0 : 1;
774 unsigned DC5B1 : 1;
775 unsigned : 1;
776 unsigned : 1;
779 struct
781 unsigned CCP5M : 4;
782 unsigned : 4;
785 struct
787 unsigned : 4;
788 unsigned DC5B : 2;
789 unsigned : 2;
791 } __CCP5CONbits_t;
793 extern __at(0x0F70) volatile __CCP5CONbits_t CCP5CONbits;
795 #define _CCP5M0 0x01
796 #define _CCP5M1 0x02
797 #define _CCP5M2 0x04
798 #define _CCP5M3 0x08
799 #define _DCCP5Y 0x10
800 #define _DC5B0 0x10
801 #define _DCCP5X 0x20
802 #define _DC5B1 0x20
804 //==============================================================================
806 extern __at(0x0F71) __sfr CCPR5;
807 extern __at(0x0F71) __sfr CCPR5L;
808 extern __at(0x0F72) __sfr CCPR5H;
810 //==============================================================================
811 // CCP4CON Bits
813 extern __at(0x0F73) __sfr CCP4CON;
815 typedef union
817 struct
819 unsigned CCP4M0 : 1;
820 unsigned CCP4M1 : 1;
821 unsigned CCP4M2 : 1;
822 unsigned CCP4M3 : 1;
823 unsigned DCCP4Y : 1;
824 unsigned DCCP4X : 1;
825 unsigned : 1;
826 unsigned : 1;
829 struct
831 unsigned : 1;
832 unsigned : 1;
833 unsigned : 1;
834 unsigned : 1;
835 unsigned DC4B0 : 1;
836 unsigned DC4B1 : 1;
837 unsigned : 1;
838 unsigned : 1;
841 struct
843 unsigned CCP4M : 4;
844 unsigned : 4;
847 struct
849 unsigned : 4;
850 unsigned DC4B : 2;
851 unsigned : 2;
853 } __CCP4CONbits_t;
855 extern __at(0x0F73) volatile __CCP4CONbits_t CCP4CONbits;
857 #define _CCP4M0 0x01
858 #define _CCP4M1 0x02
859 #define _CCP4M2 0x04
860 #define _CCP4M3 0x08
861 #define _DCCP4Y 0x10
862 #define _DC4B0 0x10
863 #define _DCCP4X 0x20
864 #define _DC4B1 0x20
866 //==============================================================================
868 extern __at(0x0F74) __sfr CCPR4;
869 extern __at(0x0F74) __sfr CCPR4L;
870 extern __at(0x0F75) __sfr CCPR4H;
872 //==============================================================================
873 // T4CON Bits
875 extern __at(0x0F76) __sfr T4CON;
877 typedef union
879 struct
881 unsigned T4CKPS0 : 1;
882 unsigned T4CKPS1 : 1;
883 unsigned TMR4ON : 1;
884 unsigned T4OUTPS0 : 1;
885 unsigned T4OUTPS1 : 1;
886 unsigned T4OUTPS2 : 1;
887 unsigned T4OUTPS3 : 1;
888 unsigned : 1;
891 struct
893 unsigned T4CKPS : 2;
894 unsigned : 6;
897 struct
899 unsigned : 3;
900 unsigned T4OUTPS : 4;
901 unsigned : 1;
903 } __T4CONbits_t;
905 extern __at(0x0F76) volatile __T4CONbits_t T4CONbits;
907 #define _T4CKPS0 0x01
908 #define _T4CKPS1 0x02
909 #define _TMR4ON 0x04
910 #define _T4OUTPS0 0x08
911 #define _T4OUTPS1 0x10
912 #define _T4OUTPS2 0x20
913 #define _T4OUTPS3 0x40
915 //==============================================================================
917 extern __at(0x0F77) __sfr PR4;
918 extern __at(0x0F78) __sfr TMR4;
920 //==============================================================================
921 // ECCP1DEL Bits
923 extern __at(0x0F79) __sfr ECCP1DEL;
925 typedef union
927 struct
929 unsigned PDC0 : 1;
930 unsigned PDC1 : 1;
931 unsigned PDC2 : 1;
932 unsigned PDC3 : 1;
933 unsigned PDC4 : 1;
934 unsigned PDC5 : 1;
935 unsigned PDC6 : 1;
936 unsigned PRSEN : 1;
939 struct
941 unsigned P1DC0 : 1;
942 unsigned P1DC1 : 1;
943 unsigned P1DC2 : 1;
944 unsigned P1DC3 : 1;
945 unsigned P1DC4 : 1;
946 unsigned P1DC5 : 1;
947 unsigned P1DC6 : 1;
948 unsigned P1RSEN : 1;
951 struct
953 unsigned PDC : 7;
954 unsigned : 1;
957 struct
959 unsigned P1DC : 7;
960 unsigned : 1;
962 } __ECCP1DELbits_t;
964 extern __at(0x0F79) volatile __ECCP1DELbits_t ECCP1DELbits;
966 #define _PDC0 0x01
967 #define _P1DC0 0x01
968 #define _PDC1 0x02
969 #define _P1DC1 0x02
970 #define _PDC2 0x04
971 #define _P1DC2 0x04
972 #define _PDC3 0x08
973 #define _P1DC3 0x08
974 #define _PDC4 0x10
975 #define _P1DC4 0x10
976 #define _PDC5 0x20
977 #define _P1DC5 0x20
978 #define _PDC6 0x40
979 #define _P1DC6 0x40
980 #define _PRSEN 0x80
981 #define _P1RSEN 0x80
983 //==============================================================================
986 //==============================================================================
987 // BAUDCON2 Bits
989 extern __at(0x0F7C) __sfr BAUDCON2;
991 typedef union
993 struct
995 unsigned ABDEN : 1;
996 unsigned WUE : 1;
997 unsigned : 1;
998 unsigned BRG16 : 1;
999 unsigned SCKP : 1;
1000 unsigned : 1;
1001 unsigned RCMT : 1;
1002 unsigned ABDOVF : 1;
1005 struct
1007 unsigned : 1;
1008 unsigned : 1;
1009 unsigned : 1;
1010 unsigned : 1;
1011 unsigned : 1;
1012 unsigned : 1;
1013 unsigned RCIDL : 1;
1014 unsigned : 1;
1016 } __BAUDCON2bits_t;
1018 extern __at(0x0F7C) volatile __BAUDCON2bits_t BAUDCON2bits;
1020 #define _BAUDCON2_ABDEN 0x01
1021 #define _BAUDCON2_WUE 0x02
1022 #define _BAUDCON2_BRG16 0x08
1023 #define _BAUDCON2_SCKP 0x10
1024 #define _BAUDCON2_RCMT 0x40
1025 #define _BAUDCON2_RCIDL 0x40
1026 #define _BAUDCON2_ABDOVF 0x80
1028 //==============================================================================
1030 extern __at(0x0F7D) __sfr SPBRGH2;
1032 //==============================================================================
1033 // BAUDCON Bits
1035 extern __at(0x0F7E) __sfr BAUDCON;
1037 typedef union
1039 struct
1041 unsigned ABDEN : 1;
1042 unsigned WUE : 1;
1043 unsigned : 1;
1044 unsigned BRG16 : 1;
1045 unsigned SCKP : 1;
1046 unsigned : 1;
1047 unsigned RCMT : 1;
1048 unsigned ABDOVF : 1;
1051 struct
1053 unsigned : 1;
1054 unsigned : 1;
1055 unsigned : 1;
1056 unsigned : 1;
1057 unsigned : 1;
1058 unsigned : 1;
1059 unsigned RCIDL : 1;
1060 unsigned : 1;
1062 } __BAUDCONbits_t;
1064 extern __at(0x0F7E) volatile __BAUDCONbits_t BAUDCONbits;
1066 #define _ABDEN 0x01
1067 #define _WUE 0x02
1068 #define _BRG16 0x08
1069 #define _SCKP 0x10
1070 #define _RCMT 0x40
1071 #define _RCIDL 0x40
1072 #define _ABDOVF 0x80
1074 //==============================================================================
1077 //==============================================================================
1078 // BAUDCON1 Bits
1080 extern __at(0x0F7E) __sfr BAUDCON1;
1082 typedef union
1084 struct
1086 unsigned ABDEN : 1;
1087 unsigned WUE : 1;
1088 unsigned : 1;
1089 unsigned BRG16 : 1;
1090 unsigned SCKP : 1;
1091 unsigned : 1;
1092 unsigned RCMT : 1;
1093 unsigned ABDOVF : 1;
1096 struct
1098 unsigned : 1;
1099 unsigned : 1;
1100 unsigned : 1;
1101 unsigned : 1;
1102 unsigned : 1;
1103 unsigned : 1;
1104 unsigned RCIDL : 1;
1105 unsigned : 1;
1107 } __BAUDCON1bits_t;
1109 extern __at(0x0F7E) volatile __BAUDCON1bits_t BAUDCON1bits;
1111 #define _BAUDCON1_ABDEN 0x01
1112 #define _BAUDCON1_WUE 0x02
1113 #define _BAUDCON1_BRG16 0x08
1114 #define _BAUDCON1_SCKP 0x10
1115 #define _BAUDCON1_RCMT 0x40
1116 #define _BAUDCON1_RCIDL 0x40
1117 #define _BAUDCON1_ABDOVF 0x80
1119 //==============================================================================
1121 extern __at(0x0F7F) __sfr SPBRGH1;
1123 //==============================================================================
1124 // PORTA Bits
1126 extern __at(0x0F80) __sfr PORTA;
1128 typedef union
1130 struct
1132 unsigned RA0 : 1;
1133 unsigned RA1 : 1;
1134 unsigned RA2 : 1;
1135 unsigned RA3 : 1;
1136 unsigned RA4 : 1;
1137 unsigned RA5 : 1;
1138 unsigned OSC2 : 1;
1139 unsigned : 1;
1142 struct
1144 unsigned AN0 : 1;
1145 unsigned AN1 : 1;
1146 unsigned AN2 : 1;
1147 unsigned AN3 : 1;
1148 unsigned T0CKI : 1;
1149 unsigned AN4 : 1;
1150 unsigned CLKO : 1;
1151 unsigned : 1;
1154 struct
1156 unsigned : 1;
1157 unsigned : 1;
1158 unsigned VREFM : 1;
1159 unsigned VREFP : 1;
1160 unsigned : 1;
1161 unsigned : 1;
1162 unsigned : 1;
1163 unsigned : 1;
1166 struct
1168 unsigned RA : 6;
1169 unsigned : 2;
1171 } __PORTAbits_t;
1173 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
1175 #define _PORTA_RA0 0x01
1176 #define _PORTA_AN0 0x01
1177 #define _PORTA_RA1 0x02
1178 #define _PORTA_AN1 0x02
1179 #define _PORTA_RA2 0x04
1180 #define _PORTA_AN2 0x04
1181 #define _PORTA_VREFM 0x04
1182 #define _PORTA_RA3 0x08
1183 #define _PORTA_AN3 0x08
1184 #define _PORTA_VREFP 0x08
1185 #define _PORTA_RA4 0x10
1186 #define _PORTA_T0CKI 0x10
1187 #define _PORTA_RA5 0x20
1188 #define _PORTA_AN4 0x20
1189 #define _PORTA_OSC2 0x40
1190 #define _PORTA_CLKO 0x40
1192 //==============================================================================
1195 //==============================================================================
1196 // PORTB Bits
1198 extern __at(0x0F81) __sfr PORTB;
1200 typedef union
1202 struct
1204 unsigned RB0 : 1;
1205 unsigned RB1 : 1;
1206 unsigned RB2 : 1;
1207 unsigned RB3 : 1;
1208 unsigned RB4 : 1;
1209 unsigned RB5 : 1;
1210 unsigned RB6 : 1;
1211 unsigned RB7 : 1;
1214 struct
1216 unsigned INT0 : 1;
1217 unsigned INT1 : 1;
1218 unsigned INT2 : 1;
1219 unsigned INT3 : 1;
1220 unsigned KBI0 : 1;
1221 unsigned KBI1 : 1;
1222 unsigned KBI2 : 1;
1223 unsigned KBI3 : 1;
1226 struct
1228 unsigned : 1;
1229 unsigned : 1;
1230 unsigned : 1;
1231 unsigned : 1;
1232 unsigned : 1;
1233 unsigned : 1;
1234 unsigned PGC : 1;
1235 unsigned PGD : 1;
1238 struct
1240 unsigned INT : 4;
1241 unsigned : 4;
1244 struct
1246 unsigned : 4;
1247 unsigned KBI : 4;
1249 } __PORTBbits_t;
1251 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
1253 #define _PORTB_RB0 0x01
1254 #define _PORTB_INT0 0x01
1255 #define _PORTB_RB1 0x02
1256 #define _PORTB_INT1 0x02
1257 #define _PORTB_RB2 0x04
1258 #define _PORTB_INT2 0x04
1259 #define _PORTB_RB3 0x08
1260 #define _PORTB_INT3 0x08
1261 #define _PORTB_RB4 0x10
1262 #define _PORTB_KBI0 0x10
1263 #define _PORTB_RB5 0x20
1264 #define _PORTB_KBI1 0x20
1265 #define _PORTB_RB6 0x40
1266 #define _PORTB_KBI2 0x40
1267 #define _PORTB_PGC 0x40
1268 #define _PORTB_RB7 0x80
1269 #define _PORTB_KBI3 0x80
1270 #define _PORTB_PGD 0x80
1272 //==============================================================================
1275 //==============================================================================
1276 // PORTC Bits
1278 extern __at(0x0F82) __sfr PORTC;
1280 typedef union
1282 struct
1284 unsigned RC0 : 1;
1285 unsigned RC1 : 1;
1286 unsigned RC2 : 1;
1287 unsigned RC3 : 1;
1288 unsigned RC4 : 1;
1289 unsigned RC5 : 1;
1290 unsigned RC6 : 1;
1291 unsigned RC7 : 1;
1294 struct
1296 unsigned T1OSO : 1;
1297 unsigned T1OSI : 1;
1298 unsigned CCP1 : 1;
1299 unsigned SCK : 1;
1300 unsigned SDI : 1;
1301 unsigned SDO : 1;
1302 unsigned TX : 1;
1303 unsigned RX : 1;
1306 struct
1308 unsigned T13CKI : 1;
1309 unsigned CCP2 : 1;
1310 unsigned : 1;
1311 unsigned SCL : 1;
1312 unsigned SDA : 1;
1313 unsigned : 1;
1314 unsigned CK : 1;
1315 unsigned : 1;
1317 } __PORTCbits_t;
1319 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
1321 #define _PORTC_RC0 0x01
1322 #define _PORTC_T1OSO 0x01
1323 #define _PORTC_T13CKI 0x01
1324 #define _PORTC_RC1 0x02
1325 #define _PORTC_T1OSI 0x02
1326 #define _PORTC_CCP2 0x02
1327 #define _PORTC_RC2 0x04
1328 #define _PORTC_CCP1 0x04
1329 #define _PORTC_RC3 0x08
1330 #define _PORTC_SCK 0x08
1331 #define _PORTC_SCL 0x08
1332 #define _PORTC_RC4 0x10
1333 #define _PORTC_SDI 0x10
1334 #define _PORTC_SDA 0x10
1335 #define _PORTC_RC5 0x20
1336 #define _PORTC_SDO 0x20
1337 #define _PORTC_RC6 0x40
1338 #define _PORTC_TX 0x40
1339 #define _PORTC_CK 0x40
1340 #define _PORTC_RC7 0x80
1341 #define _PORTC_RX 0x80
1343 //==============================================================================
1346 //==============================================================================
1347 // PORTD Bits
1349 extern __at(0x0F83) __sfr PORTD;
1351 typedef union
1353 struct
1355 unsigned RD0 : 1;
1356 unsigned RD1 : 1;
1357 unsigned RD2 : 1;
1358 unsigned RD3 : 1;
1359 unsigned RD4 : 1;
1360 unsigned RD5 : 1;
1361 unsigned RD6 : 1;
1362 unsigned RD7 : 1;
1365 struct
1367 unsigned PSP0 : 1;
1368 unsigned PSP1 : 1;
1369 unsigned PSP2 : 1;
1370 unsigned PSP3 : 1;
1371 unsigned PSP4 : 1;
1372 unsigned PSP5 : 1;
1373 unsigned PSP6 : 1;
1374 unsigned PSP7 : 1;
1377 struct
1379 unsigned AD00 : 1;
1380 unsigned AD01 : 1;
1381 unsigned AD02 : 1;
1382 unsigned AD03 : 1;
1383 unsigned AD04 : 1;
1384 unsigned AD05 : 1;
1385 unsigned AD06 : 1;
1386 unsigned AD07 : 1;
1389 struct
1391 unsigned : 1;
1392 unsigned : 1;
1393 unsigned : 1;
1394 unsigned : 1;
1395 unsigned SDO2 : 1;
1396 unsigned SDA2 : 1;
1397 unsigned SCL2 : 1;
1398 unsigned SS2 : 1;
1401 struct
1403 unsigned : 1;
1404 unsigned : 1;
1405 unsigned : 1;
1406 unsigned : 1;
1407 unsigned : 1;
1408 unsigned SDI2 : 1;
1409 unsigned SCK2 : 1;
1410 unsigned : 1;
1412 } __PORTDbits_t;
1414 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
1416 #define _PORTD_RD0 0x01
1417 #define _PORTD_PSP0 0x01
1418 #define _PORTD_AD00 0x01
1419 #define _PORTD_RD1 0x02
1420 #define _PORTD_PSP1 0x02
1421 #define _PORTD_AD01 0x02
1422 #define _PORTD_RD2 0x04
1423 #define _PORTD_PSP2 0x04
1424 #define _PORTD_AD02 0x04
1425 #define _PORTD_RD3 0x08
1426 #define _PORTD_PSP3 0x08
1427 #define _PORTD_AD03 0x08
1428 #define _PORTD_RD4 0x10
1429 #define _PORTD_PSP4 0x10
1430 #define _PORTD_AD04 0x10
1431 #define _PORTD_SDO2 0x10
1432 #define _PORTD_RD5 0x20
1433 #define _PORTD_PSP5 0x20
1434 #define _PORTD_AD05 0x20
1435 #define _PORTD_SDA2 0x20
1436 #define _PORTD_SDI2 0x20
1437 #define _PORTD_RD6 0x40
1438 #define _PORTD_PSP6 0x40
1439 #define _PORTD_AD06 0x40
1440 #define _PORTD_SCL2 0x40
1441 #define _PORTD_SCK2 0x40
1442 #define _PORTD_RD7 0x80
1443 #define _PORTD_PSP7 0x80
1444 #define _PORTD_AD07 0x80
1445 #define _PORTD_SS2 0x80
1447 //==============================================================================
1450 //==============================================================================
1451 // PORTE Bits
1453 extern __at(0x0F84) __sfr PORTE;
1455 typedef union
1457 struct
1459 unsigned RE0 : 1;
1460 unsigned RE1 : 1;
1461 unsigned RE2 : 1;
1462 unsigned RE3 : 1;
1463 unsigned RE4 : 1;
1464 unsigned RE5 : 1;
1465 unsigned RE6 : 1;
1466 unsigned RE7 : 1;
1469 struct
1471 unsigned RD : 1;
1472 unsigned WR : 1;
1473 unsigned CS : 1;
1474 unsigned AD11 : 1;
1475 unsigned AD12 : 1;
1476 unsigned AD13 : 1;
1477 unsigned AD14 : 1;
1478 unsigned AD15 : 1;
1481 struct
1483 unsigned AD8 : 1;
1484 unsigned AD9 : 1;
1485 unsigned AD10 : 1;
1486 unsigned : 1;
1487 unsigned : 1;
1488 unsigned : 1;
1489 unsigned : 1;
1490 unsigned : 1;
1492 } __PORTEbits_t;
1494 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
1496 #define _PORTE_RE0 0x01
1497 #define _PORTE_RD 0x01
1498 #define _PORTE_AD8 0x01
1499 #define _PORTE_RE1 0x02
1500 #define _PORTE_WR 0x02
1501 #define _PORTE_AD9 0x02
1502 #define _PORTE_RE2 0x04
1503 #define _PORTE_CS 0x04
1504 #define _PORTE_AD10 0x04
1505 #define _PORTE_RE3 0x08
1506 #define _PORTE_AD11 0x08
1507 #define _PORTE_RE4 0x10
1508 #define _PORTE_AD12 0x10
1509 #define _PORTE_RE5 0x20
1510 #define _PORTE_AD13 0x20
1511 #define _PORTE_RE6 0x40
1512 #define _PORTE_AD14 0x40
1513 #define _PORTE_RE7 0x80
1514 #define _PORTE_AD15 0x80
1516 //==============================================================================
1519 //==============================================================================
1520 // PORTF Bits
1522 extern __at(0x0F85) __sfr PORTF;
1524 typedef union
1526 struct
1528 unsigned : 1;
1529 unsigned RF1 : 1;
1530 unsigned RF2 : 1;
1531 unsigned RF3 : 1;
1532 unsigned RF4 : 1;
1533 unsigned RF5 : 1;
1534 unsigned RF6 : 1;
1535 unsigned RF7 : 1;
1538 struct
1540 unsigned : 1;
1541 unsigned AN6 : 1;
1542 unsigned AN7 : 1;
1543 unsigned AN8 : 1;
1544 unsigned AN9 : 1;
1545 unsigned AN10 : 1;
1546 unsigned AN11 : 1;
1547 unsigned SS : 1;
1550 struct
1552 unsigned : 1;
1553 unsigned : 1;
1554 unsigned : 1;
1555 unsigned CVREF : 1;
1556 unsigned : 1;
1557 unsigned : 1;
1558 unsigned : 1;
1559 unsigned : 1;
1561 } __PORTFbits_t;
1563 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
1565 #define _PORTF_RF1 0x02
1566 #define _PORTF_AN6 0x02
1567 #define _PORTF_RF2 0x04
1568 #define _PORTF_AN7 0x04
1569 #define _PORTF_RF3 0x08
1570 #define _PORTF_AN8 0x08
1571 #define _PORTF_CVREF 0x08
1572 #define _PORTF_RF4 0x10
1573 #define _PORTF_AN9 0x10
1574 #define _PORTF_RF5 0x20
1575 #define _PORTF_AN10 0x20
1576 #define _PORTF_RF6 0x40
1577 #define _PORTF_AN11 0x40
1578 #define _PORTF_RF7 0x80
1579 #define _PORTF_SS 0x80
1581 //==============================================================================
1584 //==============================================================================
1585 // PORTG Bits
1587 extern __at(0x0F86) __sfr PORTG;
1589 typedef union
1591 struct
1593 unsigned RG0 : 1;
1594 unsigned RG1 : 1;
1595 unsigned RG2 : 1;
1596 unsigned RG3 : 1;
1597 unsigned RG4 : 1;
1598 unsigned RJPU : 1;
1599 unsigned REPU : 1;
1600 unsigned RDPU : 1;
1603 struct
1605 unsigned CCP3 : 1;
1606 unsigned TX2 : 1;
1607 unsigned RX2 : 1;
1608 unsigned CCP4 : 1;
1609 unsigned CCP5 : 1;
1610 unsigned : 1;
1611 unsigned : 1;
1612 unsigned : 1;
1615 struct
1617 unsigned : 1;
1618 unsigned CK2 : 1;
1619 unsigned DT2 : 1;
1620 unsigned : 1;
1621 unsigned : 1;
1622 unsigned : 1;
1623 unsigned : 1;
1624 unsigned : 1;
1627 struct
1629 unsigned RG : 5;
1630 unsigned : 3;
1632 } __PORTGbits_t;
1634 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
1636 #define _PORTG_RG0 0x01
1637 #define _PORTG_CCP3 0x01
1638 #define _PORTG_RG1 0x02
1639 #define _PORTG_TX2 0x02
1640 #define _PORTG_CK2 0x02
1641 #define _PORTG_RG2 0x04
1642 #define _PORTG_RX2 0x04
1643 #define _PORTG_DT2 0x04
1644 #define _PORTG_RG3 0x08
1645 #define _PORTG_CCP4 0x08
1646 #define _PORTG_RG4 0x10
1647 #define _PORTG_CCP5 0x10
1648 #define _PORTG_RJPU 0x20
1649 #define _PORTG_REPU 0x40
1650 #define _PORTG_RDPU 0x80
1652 //==============================================================================
1655 //==============================================================================
1656 // PORTH Bits
1658 extern __at(0x0F87) __sfr PORTH;
1660 typedef union
1662 struct
1664 unsigned RH0 : 1;
1665 unsigned RH1 : 1;
1666 unsigned RH2 : 1;
1667 unsigned RH3 : 1;
1668 unsigned RH4 : 1;
1669 unsigned RH5 : 1;
1670 unsigned RH6 : 1;
1671 unsigned RH7 : 1;
1674 struct
1676 unsigned AD16 : 1;
1677 unsigned AD17 : 1;
1678 unsigned AD18 : 1;
1679 unsigned AD19 : 1;
1680 unsigned AN12 : 1;
1681 unsigned AN13 : 1;
1682 unsigned AN14 : 1;
1683 unsigned AN15 : 1;
1685 } __PORTHbits_t;
1687 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
1689 #define _PORTH_RH0 0x01
1690 #define _PORTH_AD16 0x01
1691 #define _PORTH_RH1 0x02
1692 #define _PORTH_AD17 0x02
1693 #define _PORTH_RH2 0x04
1694 #define _PORTH_AD18 0x04
1695 #define _PORTH_RH3 0x08
1696 #define _PORTH_AD19 0x08
1697 #define _PORTH_RH4 0x10
1698 #define _PORTH_AN12 0x10
1699 #define _PORTH_RH5 0x20
1700 #define _PORTH_AN13 0x20
1701 #define _PORTH_RH6 0x40
1702 #define _PORTH_AN14 0x40
1703 #define _PORTH_RH7 0x80
1704 #define _PORTH_AN15 0x80
1706 //==============================================================================
1709 //==============================================================================
1710 // PORTJ Bits
1712 extern __at(0x0F88) __sfr PORTJ;
1714 typedef union
1716 struct
1718 unsigned RJ0 : 1;
1719 unsigned RJ1 : 1;
1720 unsigned RJ2 : 1;
1721 unsigned RJ3 : 1;
1722 unsigned RJ4 : 1;
1723 unsigned RJ5 : 1;
1724 unsigned RJ6 : 1;
1725 unsigned RJ7 : 1;
1728 struct
1730 unsigned ALE : 1;
1731 unsigned OE : 1;
1732 unsigned WRL : 1;
1733 unsigned WRH : 1;
1734 unsigned BA0 : 1;
1735 unsigned CE : 1;
1736 unsigned LB : 1;
1737 unsigned UB : 1;
1739 } __PORTJbits_t;
1741 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
1743 #define _PORTJ_RJ0 0x01
1744 #define _PORTJ_ALE 0x01
1745 #define _PORTJ_RJ1 0x02
1746 #define _PORTJ_OE 0x02
1747 #define _PORTJ_RJ2 0x04
1748 #define _PORTJ_WRL 0x04
1749 #define _PORTJ_RJ3 0x08
1750 #define _PORTJ_WRH 0x08
1751 #define _PORTJ_RJ4 0x10
1752 #define _PORTJ_BA0 0x10
1753 #define _PORTJ_RJ5 0x20
1754 #define _PORTJ_CE 0x20
1755 #define _PORTJ_RJ6 0x40
1756 #define _PORTJ_LB 0x40
1757 #define _PORTJ_RJ7 0x80
1758 #define _PORTJ_UB 0x80
1760 //==============================================================================
1763 //==============================================================================
1764 // LATA Bits
1766 extern __at(0x0F89) __sfr LATA;
1768 typedef union
1770 struct
1772 unsigned LATA0 : 1;
1773 unsigned LATA1 : 1;
1774 unsigned LATA2 : 1;
1775 unsigned LATA3 : 1;
1776 unsigned LATA4 : 1;
1777 unsigned LATA5 : 1;
1778 unsigned : 1;
1779 unsigned : 1;
1782 struct
1784 unsigned LATA : 6;
1785 unsigned : 2;
1787 } __LATAbits_t;
1789 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
1791 #define _LATA0 0x01
1792 #define _LATA1 0x02
1793 #define _LATA2 0x04
1794 #define _LATA3 0x08
1795 #define _LATA4 0x10
1796 #define _LATA5 0x20
1798 //==============================================================================
1801 //==============================================================================
1802 // LATB Bits
1804 extern __at(0x0F8A) __sfr LATB;
1806 typedef struct
1808 unsigned LATB0 : 1;
1809 unsigned LATB1 : 1;
1810 unsigned LATB2 : 1;
1811 unsigned LATB3 : 1;
1812 unsigned LATB4 : 1;
1813 unsigned LATB5 : 1;
1814 unsigned LATB6 : 1;
1815 unsigned LATB7 : 1;
1816 } __LATBbits_t;
1818 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
1820 #define _LATB0 0x01
1821 #define _LATB1 0x02
1822 #define _LATB2 0x04
1823 #define _LATB3 0x08
1824 #define _LATB4 0x10
1825 #define _LATB5 0x20
1826 #define _LATB6 0x40
1827 #define _LATB7 0x80
1829 //==============================================================================
1832 //==============================================================================
1833 // LATC Bits
1835 extern __at(0x0F8B) __sfr LATC;
1837 typedef struct
1839 unsigned LATC0 : 1;
1840 unsigned LATC1 : 1;
1841 unsigned LATC2 : 1;
1842 unsigned LATC3 : 1;
1843 unsigned LATC4 : 1;
1844 unsigned LATC5 : 1;
1845 unsigned LATC6 : 1;
1846 unsigned LATC7 : 1;
1847 } __LATCbits_t;
1849 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
1851 #define _LATC0 0x01
1852 #define _LATC1 0x02
1853 #define _LATC2 0x04
1854 #define _LATC3 0x08
1855 #define _LATC4 0x10
1856 #define _LATC5 0x20
1857 #define _LATC6 0x40
1858 #define _LATC7 0x80
1860 //==============================================================================
1863 //==============================================================================
1864 // LATD Bits
1866 extern __at(0x0F8C) __sfr LATD;
1868 typedef struct
1870 unsigned LATD0 : 1;
1871 unsigned LATD1 : 1;
1872 unsigned LATD2 : 1;
1873 unsigned LATD3 : 1;
1874 unsigned LATD4 : 1;
1875 unsigned LATD5 : 1;
1876 unsigned LATD6 : 1;
1877 unsigned LATD7 : 1;
1878 } __LATDbits_t;
1880 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
1882 #define _LATD0 0x01
1883 #define _LATD1 0x02
1884 #define _LATD2 0x04
1885 #define _LATD3 0x08
1886 #define _LATD4 0x10
1887 #define _LATD5 0x20
1888 #define _LATD6 0x40
1889 #define _LATD7 0x80
1891 //==============================================================================
1894 //==============================================================================
1895 // LATE Bits
1897 extern __at(0x0F8D) __sfr LATE;
1899 typedef struct
1901 unsigned LATE0 : 1;
1902 unsigned LATE1 : 1;
1903 unsigned LATE2 : 1;
1904 unsigned LATE3 : 1;
1905 unsigned LATE4 : 1;
1906 unsigned LATE5 : 1;
1907 unsigned LATE6 : 1;
1908 unsigned LATE7 : 1;
1909 } __LATEbits_t;
1911 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
1913 #define _LATE0 0x01
1914 #define _LATE1 0x02
1915 #define _LATE2 0x04
1916 #define _LATE3 0x08
1917 #define _LATE4 0x10
1918 #define _LATE5 0x20
1919 #define _LATE6 0x40
1920 #define _LATE7 0x80
1922 //==============================================================================
1925 //==============================================================================
1926 // LATF Bits
1928 extern __at(0x0F8E) __sfr LATF;
1930 typedef struct
1932 unsigned : 1;
1933 unsigned LATF1 : 1;
1934 unsigned LATF2 : 1;
1935 unsigned LATF3 : 1;
1936 unsigned LATF4 : 1;
1937 unsigned LATF5 : 1;
1938 unsigned LATF6 : 1;
1939 unsigned LATF7 : 1;
1940 } __LATFbits_t;
1942 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
1944 #define _LATF1 0x02
1945 #define _LATF2 0x04
1946 #define _LATF3 0x08
1947 #define _LATF4 0x10
1948 #define _LATF5 0x20
1949 #define _LATF6 0x40
1950 #define _LATF7 0x80
1952 //==============================================================================
1955 //==============================================================================
1956 // LATG Bits
1958 extern __at(0x0F8F) __sfr LATG;
1960 typedef union
1962 struct
1964 unsigned LATG0 : 1;
1965 unsigned LATG1 : 1;
1966 unsigned LATG2 : 1;
1967 unsigned LATG3 : 1;
1968 unsigned LATG4 : 1;
1969 unsigned : 1;
1970 unsigned : 1;
1971 unsigned : 1;
1974 struct
1976 unsigned LATG : 5;
1977 unsigned : 3;
1979 } __LATGbits_t;
1981 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
1983 #define _LATG0 0x01
1984 #define _LATG1 0x02
1985 #define _LATG2 0x04
1986 #define _LATG3 0x08
1987 #define _LATG4 0x10
1989 //==============================================================================
1992 //==============================================================================
1993 // LATH Bits
1995 extern __at(0x0F90) __sfr LATH;
1997 typedef struct
1999 unsigned LATH0 : 1;
2000 unsigned LATH1 : 1;
2001 unsigned LATH2 : 1;
2002 unsigned LATH3 : 1;
2003 unsigned LATH4 : 1;
2004 unsigned LATH5 : 1;
2005 unsigned LATH6 : 1;
2006 unsigned LATH7 : 1;
2007 } __LATHbits_t;
2009 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
2011 #define _LATH0 0x01
2012 #define _LATH1 0x02
2013 #define _LATH2 0x04
2014 #define _LATH3 0x08
2015 #define _LATH4 0x10
2016 #define _LATH5 0x20
2017 #define _LATH6 0x40
2018 #define _LATH7 0x80
2020 //==============================================================================
2023 //==============================================================================
2024 // LATJ Bits
2026 extern __at(0x0F91) __sfr LATJ;
2028 typedef struct
2030 unsigned LATJ0 : 1;
2031 unsigned LATJ1 : 1;
2032 unsigned LATJ2 : 1;
2033 unsigned LATJ3 : 1;
2034 unsigned LATJ4 : 1;
2035 unsigned LATJ5 : 1;
2036 unsigned LATJ6 : 1;
2037 unsigned LATJ7 : 1;
2038 } __LATJbits_t;
2040 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
2042 #define _LATJ0 0x01
2043 #define _LATJ1 0x02
2044 #define _LATJ2 0x04
2045 #define _LATJ3 0x08
2046 #define _LATJ4 0x10
2047 #define _LATJ5 0x20
2048 #define _LATJ6 0x40
2049 #define _LATJ7 0x80
2051 //==============================================================================
2054 //==============================================================================
2055 // DDRA Bits
2057 extern __at(0x0F92) __sfr DDRA;
2059 typedef union
2061 struct
2063 unsigned TRISA0 : 1;
2064 unsigned TRISA1 : 1;
2065 unsigned TRISA2 : 1;
2066 unsigned TRISA3 : 1;
2067 unsigned TRISA4 : 1;
2068 unsigned TRISA5 : 1;
2069 unsigned : 1;
2070 unsigned : 1;
2073 struct
2075 unsigned RA0 : 1;
2076 unsigned RA1 : 1;
2077 unsigned RA2 : 1;
2078 unsigned RA3 : 1;
2079 unsigned RA4 : 1;
2080 unsigned RA5 : 1;
2081 unsigned : 1;
2082 unsigned : 1;
2085 struct
2087 unsigned RA : 6;
2088 unsigned : 2;
2091 struct
2093 unsigned TRISA : 6;
2094 unsigned : 2;
2096 } __DDRAbits_t;
2098 extern __at(0x0F92) volatile __DDRAbits_t DDRAbits;
2100 #define _TRISA0 0x01
2101 #define _RA0 0x01
2102 #define _TRISA1 0x02
2103 #define _RA1 0x02
2104 #define _TRISA2 0x04
2105 #define _RA2 0x04
2106 #define _TRISA3 0x08
2107 #define _RA3 0x08
2108 #define _TRISA4 0x10
2109 #define _RA4 0x10
2110 #define _TRISA5 0x20
2111 #define _RA5 0x20
2113 //==============================================================================
2116 //==============================================================================
2117 // TRISA Bits
2119 extern __at(0x0F92) __sfr TRISA;
2121 typedef union
2123 struct
2125 unsigned TRISA0 : 1;
2126 unsigned TRISA1 : 1;
2127 unsigned TRISA2 : 1;
2128 unsigned TRISA3 : 1;
2129 unsigned TRISA4 : 1;
2130 unsigned TRISA5 : 1;
2131 unsigned : 1;
2132 unsigned : 1;
2135 struct
2137 unsigned RA0 : 1;
2138 unsigned RA1 : 1;
2139 unsigned RA2 : 1;
2140 unsigned RA3 : 1;
2141 unsigned RA4 : 1;
2142 unsigned RA5 : 1;
2143 unsigned : 1;
2144 unsigned : 1;
2147 struct
2149 unsigned RA : 6;
2150 unsigned : 2;
2153 struct
2155 unsigned TRISA : 6;
2156 unsigned : 2;
2158 } __TRISAbits_t;
2160 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
2162 #define _TRISA_TRISA0 0x01
2163 #define _TRISA_RA0 0x01
2164 #define _TRISA_TRISA1 0x02
2165 #define _TRISA_RA1 0x02
2166 #define _TRISA_TRISA2 0x04
2167 #define _TRISA_RA2 0x04
2168 #define _TRISA_TRISA3 0x08
2169 #define _TRISA_RA3 0x08
2170 #define _TRISA_TRISA4 0x10
2171 #define _TRISA_RA4 0x10
2172 #define _TRISA_TRISA5 0x20
2173 #define _TRISA_RA5 0x20
2175 //==============================================================================
2178 //==============================================================================
2179 // DDRB Bits
2181 extern __at(0x0F93) __sfr DDRB;
2183 typedef union
2185 struct
2187 unsigned TRISB0 : 1;
2188 unsigned TRISB1 : 1;
2189 unsigned TRISB2 : 1;
2190 unsigned TRISB3 : 1;
2191 unsigned TRISB4 : 1;
2192 unsigned TRISB5 : 1;
2193 unsigned TRISB6 : 1;
2194 unsigned TRISB7 : 1;
2197 struct
2199 unsigned RB0 : 1;
2200 unsigned RB1 : 1;
2201 unsigned RB2 : 1;
2202 unsigned RB3 : 1;
2203 unsigned RB4 : 1;
2204 unsigned RB5 : 1;
2205 unsigned RB6 : 1;
2206 unsigned RB7 : 1;
2208 } __DDRBbits_t;
2210 extern __at(0x0F93) volatile __DDRBbits_t DDRBbits;
2212 #define _TRISB0 0x01
2213 #define _RB0 0x01
2214 #define _TRISB1 0x02
2215 #define _RB1 0x02
2216 #define _TRISB2 0x04
2217 #define _RB2 0x04
2218 #define _TRISB3 0x08
2219 #define _RB3 0x08
2220 #define _TRISB4 0x10
2221 #define _RB4 0x10
2222 #define _TRISB5 0x20
2223 #define _RB5 0x20
2224 #define _TRISB6 0x40
2225 #define _RB6 0x40
2226 #define _TRISB7 0x80
2227 #define _RB7 0x80
2229 //==============================================================================
2232 //==============================================================================
2233 // TRISB Bits
2235 extern __at(0x0F93) __sfr TRISB;
2237 typedef union
2239 struct
2241 unsigned TRISB0 : 1;
2242 unsigned TRISB1 : 1;
2243 unsigned TRISB2 : 1;
2244 unsigned TRISB3 : 1;
2245 unsigned TRISB4 : 1;
2246 unsigned TRISB5 : 1;
2247 unsigned TRISB6 : 1;
2248 unsigned TRISB7 : 1;
2251 struct
2253 unsigned RB0 : 1;
2254 unsigned RB1 : 1;
2255 unsigned RB2 : 1;
2256 unsigned RB3 : 1;
2257 unsigned RB4 : 1;
2258 unsigned RB5 : 1;
2259 unsigned RB6 : 1;
2260 unsigned RB7 : 1;
2262 } __TRISBbits_t;
2264 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
2266 #define _TRISB_TRISB0 0x01
2267 #define _TRISB_RB0 0x01
2268 #define _TRISB_TRISB1 0x02
2269 #define _TRISB_RB1 0x02
2270 #define _TRISB_TRISB2 0x04
2271 #define _TRISB_RB2 0x04
2272 #define _TRISB_TRISB3 0x08
2273 #define _TRISB_RB3 0x08
2274 #define _TRISB_TRISB4 0x10
2275 #define _TRISB_RB4 0x10
2276 #define _TRISB_TRISB5 0x20
2277 #define _TRISB_RB5 0x20
2278 #define _TRISB_TRISB6 0x40
2279 #define _TRISB_RB6 0x40
2280 #define _TRISB_TRISB7 0x80
2281 #define _TRISB_RB7 0x80
2283 //==============================================================================
2286 //==============================================================================
2287 // DDRC Bits
2289 extern __at(0x0F94) __sfr DDRC;
2291 typedef union
2293 struct
2295 unsigned TRISC0 : 1;
2296 unsigned TRISC1 : 1;
2297 unsigned TRISC2 : 1;
2298 unsigned TRISC3 : 1;
2299 unsigned TRISC4 : 1;
2300 unsigned TRISC5 : 1;
2301 unsigned TRISC6 : 1;
2302 unsigned TRISC7 : 1;
2305 struct
2307 unsigned RC0 : 1;
2308 unsigned RC1 : 1;
2309 unsigned RC2 : 1;
2310 unsigned RC3 : 1;
2311 unsigned RC4 : 1;
2312 unsigned RC5 : 1;
2313 unsigned RC6 : 1;
2314 unsigned RC7 : 1;
2316 } __DDRCbits_t;
2318 extern __at(0x0F94) volatile __DDRCbits_t DDRCbits;
2320 #define _TRISC0 0x01
2321 #define _RC0 0x01
2322 #define _TRISC1 0x02
2323 #define _RC1 0x02
2324 #define _TRISC2 0x04
2325 #define _RC2 0x04
2326 #define _TRISC3 0x08
2327 #define _RC3 0x08
2328 #define _TRISC4 0x10
2329 #define _RC4 0x10
2330 #define _TRISC5 0x20
2331 #define _RC5 0x20
2332 #define _TRISC6 0x40
2333 #define _RC6 0x40
2334 #define _TRISC7 0x80
2335 #define _RC7 0x80
2337 //==============================================================================
2340 //==============================================================================
2341 // TRISC Bits
2343 extern __at(0x0F94) __sfr TRISC;
2345 typedef union
2347 struct
2349 unsigned TRISC0 : 1;
2350 unsigned TRISC1 : 1;
2351 unsigned TRISC2 : 1;
2352 unsigned TRISC3 : 1;
2353 unsigned TRISC4 : 1;
2354 unsigned TRISC5 : 1;
2355 unsigned TRISC6 : 1;
2356 unsigned TRISC7 : 1;
2359 struct
2361 unsigned RC0 : 1;
2362 unsigned RC1 : 1;
2363 unsigned RC2 : 1;
2364 unsigned RC3 : 1;
2365 unsigned RC4 : 1;
2366 unsigned RC5 : 1;
2367 unsigned RC6 : 1;
2368 unsigned RC7 : 1;
2370 } __TRISCbits_t;
2372 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
2374 #define _TRISC_TRISC0 0x01
2375 #define _TRISC_RC0 0x01
2376 #define _TRISC_TRISC1 0x02
2377 #define _TRISC_RC1 0x02
2378 #define _TRISC_TRISC2 0x04
2379 #define _TRISC_RC2 0x04
2380 #define _TRISC_TRISC3 0x08
2381 #define _TRISC_RC3 0x08
2382 #define _TRISC_TRISC4 0x10
2383 #define _TRISC_RC4 0x10
2384 #define _TRISC_TRISC5 0x20
2385 #define _TRISC_RC5 0x20
2386 #define _TRISC_TRISC6 0x40
2387 #define _TRISC_RC6 0x40
2388 #define _TRISC_TRISC7 0x80
2389 #define _TRISC_RC7 0x80
2391 //==============================================================================
2394 //==============================================================================
2395 // DDRD Bits
2397 extern __at(0x0F95) __sfr DDRD;
2399 typedef union
2401 struct
2403 unsigned TRISD0 : 1;
2404 unsigned TRISD1 : 1;
2405 unsigned TRISD2 : 1;
2406 unsigned TRISD3 : 1;
2407 unsigned TRISD4 : 1;
2408 unsigned TRISD5 : 1;
2409 unsigned TRISD6 : 1;
2410 unsigned TRISD7 : 1;
2413 struct
2415 unsigned RD0 : 1;
2416 unsigned RD1 : 1;
2417 unsigned RD2 : 1;
2418 unsigned RD3 : 1;
2419 unsigned RD4 : 1;
2420 unsigned RD5 : 1;
2421 unsigned RD6 : 1;
2422 unsigned RD7 : 1;
2424 } __DDRDbits_t;
2426 extern __at(0x0F95) volatile __DDRDbits_t DDRDbits;
2428 #define _TRISD0 0x01
2429 #define _RD0 0x01
2430 #define _TRISD1 0x02
2431 #define _RD1 0x02
2432 #define _TRISD2 0x04
2433 #define _RD2 0x04
2434 #define _TRISD3 0x08
2435 #define _RD3 0x08
2436 #define _TRISD4 0x10
2437 #define _RD4 0x10
2438 #define _TRISD5 0x20
2439 #define _RD5 0x20
2440 #define _TRISD6 0x40
2441 #define _RD6 0x40
2442 #define _TRISD7 0x80
2443 #define _RD7 0x80
2445 //==============================================================================
2448 //==============================================================================
2449 // TRISD Bits
2451 extern __at(0x0F95) __sfr TRISD;
2453 typedef union
2455 struct
2457 unsigned TRISD0 : 1;
2458 unsigned TRISD1 : 1;
2459 unsigned TRISD2 : 1;
2460 unsigned TRISD3 : 1;
2461 unsigned TRISD4 : 1;
2462 unsigned TRISD5 : 1;
2463 unsigned TRISD6 : 1;
2464 unsigned TRISD7 : 1;
2467 struct
2469 unsigned RD0 : 1;
2470 unsigned RD1 : 1;
2471 unsigned RD2 : 1;
2472 unsigned RD3 : 1;
2473 unsigned RD4 : 1;
2474 unsigned RD5 : 1;
2475 unsigned RD6 : 1;
2476 unsigned RD7 : 1;
2478 } __TRISDbits_t;
2480 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
2482 #define _TRISD_TRISD0 0x01
2483 #define _TRISD_RD0 0x01
2484 #define _TRISD_TRISD1 0x02
2485 #define _TRISD_RD1 0x02
2486 #define _TRISD_TRISD2 0x04
2487 #define _TRISD_RD2 0x04
2488 #define _TRISD_TRISD3 0x08
2489 #define _TRISD_RD3 0x08
2490 #define _TRISD_TRISD4 0x10
2491 #define _TRISD_RD4 0x10
2492 #define _TRISD_TRISD5 0x20
2493 #define _TRISD_RD5 0x20
2494 #define _TRISD_TRISD6 0x40
2495 #define _TRISD_RD6 0x40
2496 #define _TRISD_TRISD7 0x80
2497 #define _TRISD_RD7 0x80
2499 //==============================================================================
2502 //==============================================================================
2503 // DDRE Bits
2505 extern __at(0x0F96) __sfr DDRE;
2507 typedef union
2509 struct
2511 unsigned TRISE0 : 1;
2512 unsigned TRISE1 : 1;
2513 unsigned TRISE2 : 1;
2514 unsigned TRISE3 : 1;
2515 unsigned TRISE4 : 1;
2516 unsigned TRISE5 : 1;
2517 unsigned TRISE6 : 1;
2518 unsigned TRISE7 : 1;
2521 struct
2523 unsigned RE0 : 1;
2524 unsigned RE1 : 1;
2525 unsigned RE2 : 1;
2526 unsigned RE3 : 1;
2527 unsigned RE4 : 1;
2528 unsigned RE5 : 1;
2529 unsigned RE6 : 1;
2530 unsigned RE7 : 1;
2532 } __DDREbits_t;
2534 extern __at(0x0F96) volatile __DDREbits_t DDREbits;
2536 #define _TRISE0 0x01
2537 #define _RE0 0x01
2538 #define _TRISE1 0x02
2539 #define _RE1 0x02
2540 #define _TRISE2 0x04
2541 #define _RE2 0x04
2542 #define _TRISE3 0x08
2543 #define _RE3 0x08
2544 #define _TRISE4 0x10
2545 #define _RE4 0x10
2546 #define _TRISE5 0x20
2547 #define _RE5 0x20
2548 #define _TRISE6 0x40
2549 #define _RE6 0x40
2550 #define _TRISE7 0x80
2551 #define _RE7 0x80
2553 //==============================================================================
2556 //==============================================================================
2557 // TRISE Bits
2559 extern __at(0x0F96) __sfr TRISE;
2561 typedef union
2563 struct
2565 unsigned TRISE0 : 1;
2566 unsigned TRISE1 : 1;
2567 unsigned TRISE2 : 1;
2568 unsigned TRISE3 : 1;
2569 unsigned TRISE4 : 1;
2570 unsigned TRISE5 : 1;
2571 unsigned TRISE6 : 1;
2572 unsigned TRISE7 : 1;
2575 struct
2577 unsigned RE0 : 1;
2578 unsigned RE1 : 1;
2579 unsigned RE2 : 1;
2580 unsigned RE3 : 1;
2581 unsigned RE4 : 1;
2582 unsigned RE5 : 1;
2583 unsigned RE6 : 1;
2584 unsigned RE7 : 1;
2586 } __TRISEbits_t;
2588 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
2590 #define _TRISE_TRISE0 0x01
2591 #define _TRISE_RE0 0x01
2592 #define _TRISE_TRISE1 0x02
2593 #define _TRISE_RE1 0x02
2594 #define _TRISE_TRISE2 0x04
2595 #define _TRISE_RE2 0x04
2596 #define _TRISE_TRISE3 0x08
2597 #define _TRISE_RE3 0x08
2598 #define _TRISE_TRISE4 0x10
2599 #define _TRISE_RE4 0x10
2600 #define _TRISE_TRISE5 0x20
2601 #define _TRISE_RE5 0x20
2602 #define _TRISE_TRISE6 0x40
2603 #define _TRISE_RE6 0x40
2604 #define _TRISE_TRISE7 0x80
2605 #define _TRISE_RE7 0x80
2607 //==============================================================================
2610 //==============================================================================
2611 // DDRF Bits
2613 extern __at(0x0F97) __sfr DDRF;
2615 typedef union
2617 struct
2619 unsigned : 1;
2620 unsigned TRISF1 : 1;
2621 unsigned TRISF2 : 1;
2622 unsigned TRISF3 : 1;
2623 unsigned TRISF4 : 1;
2624 unsigned TRISF5 : 1;
2625 unsigned TRISF6 : 1;
2626 unsigned TRISF7 : 1;
2629 struct
2631 unsigned : 1;
2632 unsigned RF1 : 1;
2633 unsigned RF2 : 1;
2634 unsigned RF3 : 1;
2635 unsigned RF4 : 1;
2636 unsigned RF5 : 1;
2637 unsigned RF6 : 1;
2638 unsigned RF7 : 1;
2640 } __DDRFbits_t;
2642 extern __at(0x0F97) volatile __DDRFbits_t DDRFbits;
2644 #define _TRISF1 0x02
2645 #define _RF1 0x02
2646 #define _TRISF2 0x04
2647 #define _RF2 0x04
2648 #define _TRISF3 0x08
2649 #define _RF3 0x08
2650 #define _TRISF4 0x10
2651 #define _RF4 0x10
2652 #define _TRISF5 0x20
2653 #define _RF5 0x20
2654 #define _TRISF6 0x40
2655 #define _RF6 0x40
2656 #define _TRISF7 0x80
2657 #define _RF7 0x80
2659 //==============================================================================
2662 //==============================================================================
2663 // TRISF Bits
2665 extern __at(0x0F97) __sfr TRISF;
2667 typedef union
2669 struct
2671 unsigned : 1;
2672 unsigned TRISF1 : 1;
2673 unsigned TRISF2 : 1;
2674 unsigned TRISF3 : 1;
2675 unsigned TRISF4 : 1;
2676 unsigned TRISF5 : 1;
2677 unsigned TRISF6 : 1;
2678 unsigned TRISF7 : 1;
2681 struct
2683 unsigned : 1;
2684 unsigned RF1 : 1;
2685 unsigned RF2 : 1;
2686 unsigned RF3 : 1;
2687 unsigned RF4 : 1;
2688 unsigned RF5 : 1;
2689 unsigned RF6 : 1;
2690 unsigned RF7 : 1;
2692 } __TRISFbits_t;
2694 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
2696 #define _TRISF_TRISF1 0x02
2697 #define _TRISF_RF1 0x02
2698 #define _TRISF_TRISF2 0x04
2699 #define _TRISF_RF2 0x04
2700 #define _TRISF_TRISF3 0x08
2701 #define _TRISF_RF3 0x08
2702 #define _TRISF_TRISF4 0x10
2703 #define _TRISF_RF4 0x10
2704 #define _TRISF_TRISF5 0x20
2705 #define _TRISF_RF5 0x20
2706 #define _TRISF_TRISF6 0x40
2707 #define _TRISF_RF6 0x40
2708 #define _TRISF_TRISF7 0x80
2709 #define _TRISF_RF7 0x80
2711 //==============================================================================
2714 //==============================================================================
2715 // DDRG Bits
2717 extern __at(0x0F98) __sfr DDRG;
2719 typedef union
2721 struct
2723 unsigned TRISG0 : 1;
2724 unsigned TRISG1 : 1;
2725 unsigned TRISG2 : 1;
2726 unsigned TRISG3 : 1;
2727 unsigned TRISG4 : 1;
2728 unsigned : 1;
2729 unsigned : 1;
2730 unsigned : 1;
2733 struct
2735 unsigned RG0 : 1;
2736 unsigned RG1 : 1;
2737 unsigned RG2 : 1;
2738 unsigned RG3 : 1;
2739 unsigned RG4 : 1;
2740 unsigned : 1;
2741 unsigned : 1;
2742 unsigned : 1;
2745 struct
2747 unsigned TRISG : 5;
2748 unsigned : 3;
2751 struct
2753 unsigned RG : 5;
2754 unsigned : 3;
2756 } __DDRGbits_t;
2758 extern __at(0x0F98) volatile __DDRGbits_t DDRGbits;
2760 #define _TRISG0 0x01
2761 #define _RG0 0x01
2762 #define _TRISG1 0x02
2763 #define _RG1 0x02
2764 #define _TRISG2 0x04
2765 #define _RG2 0x04
2766 #define _TRISG3 0x08
2767 #define _RG3 0x08
2768 #define _TRISG4 0x10
2769 #define _RG4 0x10
2771 //==============================================================================
2774 //==============================================================================
2775 // TRISG Bits
2777 extern __at(0x0F98) __sfr TRISG;
2779 typedef union
2781 struct
2783 unsigned TRISG0 : 1;
2784 unsigned TRISG1 : 1;
2785 unsigned TRISG2 : 1;
2786 unsigned TRISG3 : 1;
2787 unsigned TRISG4 : 1;
2788 unsigned : 1;
2789 unsigned : 1;
2790 unsigned : 1;
2793 struct
2795 unsigned RG0 : 1;
2796 unsigned RG1 : 1;
2797 unsigned RG2 : 1;
2798 unsigned RG3 : 1;
2799 unsigned RG4 : 1;
2800 unsigned : 1;
2801 unsigned : 1;
2802 unsigned : 1;
2805 struct
2807 unsigned TRISG : 5;
2808 unsigned : 3;
2811 struct
2813 unsigned RG : 5;
2814 unsigned : 3;
2816 } __TRISGbits_t;
2818 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
2820 #define _TRISG_TRISG0 0x01
2821 #define _TRISG_RG0 0x01
2822 #define _TRISG_TRISG1 0x02
2823 #define _TRISG_RG1 0x02
2824 #define _TRISG_TRISG2 0x04
2825 #define _TRISG_RG2 0x04
2826 #define _TRISG_TRISG3 0x08
2827 #define _TRISG_RG3 0x08
2828 #define _TRISG_TRISG4 0x10
2829 #define _TRISG_RG4 0x10
2831 //==============================================================================
2834 //==============================================================================
2835 // DDRH Bits
2837 extern __at(0x0F99) __sfr DDRH;
2839 typedef union
2841 struct
2843 unsigned TRISH0 : 1;
2844 unsigned TRISH1 : 1;
2845 unsigned TRISH2 : 1;
2846 unsigned TRISH3 : 1;
2847 unsigned TRISH4 : 1;
2848 unsigned TRISH5 : 1;
2849 unsigned TRISH6 : 1;
2850 unsigned TRISH7 : 1;
2853 struct
2855 unsigned RH0 : 1;
2856 unsigned RH1 : 1;
2857 unsigned RH2 : 1;
2858 unsigned RH3 : 1;
2859 unsigned RH4 : 1;
2860 unsigned RH5 : 1;
2861 unsigned RH6 : 1;
2862 unsigned RH7 : 1;
2864 } __DDRHbits_t;
2866 extern __at(0x0F99) volatile __DDRHbits_t DDRHbits;
2868 #define _TRISH0 0x01
2869 #define _RH0 0x01
2870 #define _TRISH1 0x02
2871 #define _RH1 0x02
2872 #define _TRISH2 0x04
2873 #define _RH2 0x04
2874 #define _TRISH3 0x08
2875 #define _RH3 0x08
2876 #define _TRISH4 0x10
2877 #define _RH4 0x10
2878 #define _TRISH5 0x20
2879 #define _RH5 0x20
2880 #define _TRISH6 0x40
2881 #define _RH6 0x40
2882 #define _TRISH7 0x80
2883 #define _RH7 0x80
2885 //==============================================================================
2888 //==============================================================================
2889 // TRISH Bits
2891 extern __at(0x0F99) __sfr TRISH;
2893 typedef union
2895 struct
2897 unsigned TRISH0 : 1;
2898 unsigned TRISH1 : 1;
2899 unsigned TRISH2 : 1;
2900 unsigned TRISH3 : 1;
2901 unsigned TRISH4 : 1;
2902 unsigned TRISH5 : 1;
2903 unsigned TRISH6 : 1;
2904 unsigned TRISH7 : 1;
2907 struct
2909 unsigned RH0 : 1;
2910 unsigned RH1 : 1;
2911 unsigned RH2 : 1;
2912 unsigned RH3 : 1;
2913 unsigned RH4 : 1;
2914 unsigned RH5 : 1;
2915 unsigned RH6 : 1;
2916 unsigned RH7 : 1;
2918 } __TRISHbits_t;
2920 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
2922 #define _TRISH_TRISH0 0x01
2923 #define _TRISH_RH0 0x01
2924 #define _TRISH_TRISH1 0x02
2925 #define _TRISH_RH1 0x02
2926 #define _TRISH_TRISH2 0x04
2927 #define _TRISH_RH2 0x04
2928 #define _TRISH_TRISH3 0x08
2929 #define _TRISH_RH3 0x08
2930 #define _TRISH_TRISH4 0x10
2931 #define _TRISH_RH4 0x10
2932 #define _TRISH_TRISH5 0x20
2933 #define _TRISH_RH5 0x20
2934 #define _TRISH_TRISH6 0x40
2935 #define _TRISH_RH6 0x40
2936 #define _TRISH_TRISH7 0x80
2937 #define _TRISH_RH7 0x80
2939 //==============================================================================
2942 //==============================================================================
2943 // DDRJ Bits
2945 extern __at(0x0F9A) __sfr DDRJ;
2947 typedef union
2949 struct
2951 unsigned TRISJ0 : 1;
2952 unsigned TRISJ1 : 1;
2953 unsigned TRISJ2 : 1;
2954 unsigned TRISJ3 : 1;
2955 unsigned TRISJ4 : 1;
2956 unsigned TRISJ5 : 1;
2957 unsigned TRISJ6 : 1;
2958 unsigned TRISJ7 : 1;
2961 struct
2963 unsigned RJ0 : 1;
2964 unsigned RJ1 : 1;
2965 unsigned RJ2 : 1;
2966 unsigned RJ3 : 1;
2967 unsigned RJ4 : 1;
2968 unsigned RJ5 : 1;
2969 unsigned RJ6 : 1;
2970 unsigned RJ7 : 1;
2972 } __DDRJbits_t;
2974 extern __at(0x0F9A) volatile __DDRJbits_t DDRJbits;
2976 #define _TRISJ0 0x01
2977 #define _RJ0 0x01
2978 #define _TRISJ1 0x02
2979 #define _RJ1 0x02
2980 #define _TRISJ2 0x04
2981 #define _RJ2 0x04
2982 #define _TRISJ3 0x08
2983 #define _RJ3 0x08
2984 #define _TRISJ4 0x10
2985 #define _RJ4 0x10
2986 #define _TRISJ5 0x20
2987 #define _RJ5 0x20
2988 #define _TRISJ6 0x40
2989 #define _RJ6 0x40
2990 #define _TRISJ7 0x80
2991 #define _RJ7 0x80
2993 //==============================================================================
2996 //==============================================================================
2997 // TRISJ Bits
2999 extern __at(0x0F9A) __sfr TRISJ;
3001 typedef union
3003 struct
3005 unsigned TRISJ0 : 1;
3006 unsigned TRISJ1 : 1;
3007 unsigned TRISJ2 : 1;
3008 unsigned TRISJ3 : 1;
3009 unsigned TRISJ4 : 1;
3010 unsigned TRISJ5 : 1;
3011 unsigned TRISJ6 : 1;
3012 unsigned TRISJ7 : 1;
3015 struct
3017 unsigned RJ0 : 1;
3018 unsigned RJ1 : 1;
3019 unsigned RJ2 : 1;
3020 unsigned RJ3 : 1;
3021 unsigned RJ4 : 1;
3022 unsigned RJ5 : 1;
3023 unsigned RJ6 : 1;
3024 unsigned RJ7 : 1;
3026 } __TRISJbits_t;
3028 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
3030 #define _TRISJ_TRISJ0 0x01
3031 #define _TRISJ_RJ0 0x01
3032 #define _TRISJ_TRISJ1 0x02
3033 #define _TRISJ_RJ1 0x02
3034 #define _TRISJ_TRISJ2 0x04
3035 #define _TRISJ_RJ2 0x04
3036 #define _TRISJ_TRISJ3 0x08
3037 #define _TRISJ_RJ3 0x08
3038 #define _TRISJ_TRISJ4 0x10
3039 #define _TRISJ_RJ4 0x10
3040 #define _TRISJ_TRISJ5 0x20
3041 #define _TRISJ_RJ5 0x20
3042 #define _TRISJ_TRISJ6 0x40
3043 #define _TRISJ_RJ6 0x40
3044 #define _TRISJ_TRISJ7 0x80
3045 #define _TRISJ_RJ7 0x80
3047 //==============================================================================
3050 //==============================================================================
3051 // OSCTUNE Bits
3053 extern __at(0x0F9B) __sfr OSCTUNE;
3055 typedef struct
3057 unsigned : 1;
3058 unsigned : 1;
3059 unsigned : 1;
3060 unsigned : 1;
3061 unsigned : 1;
3062 unsigned : 1;
3063 unsigned PLLEN : 1;
3064 unsigned : 1;
3065 } __OSCTUNEbits_t;
3067 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
3069 #define _PLLEN 0x40
3071 //==============================================================================
3074 //==============================================================================
3075 // MEMCON Bits
3077 extern __at(0x0F9C) __sfr MEMCON;
3079 typedef union
3081 struct
3083 unsigned WM0 : 1;
3084 unsigned WM1 : 1;
3085 unsigned : 1;
3086 unsigned : 1;
3087 unsigned WAIT0 : 1;
3088 unsigned WAIT1 : 1;
3089 unsigned : 1;
3090 unsigned EBDIS : 1;
3093 struct
3095 unsigned WM : 2;
3096 unsigned : 6;
3099 struct
3101 unsigned : 4;
3102 unsigned WAIT : 2;
3103 unsigned : 2;
3105 } __MEMCONbits_t;
3107 extern __at(0x0F9C) volatile __MEMCONbits_t MEMCONbits;
3109 #define _WM0 0x01
3110 #define _WM1 0x02
3111 #define _WAIT0 0x10
3112 #define _WAIT1 0x20
3113 #define _EBDIS 0x80
3115 //==============================================================================
3118 //==============================================================================
3119 // PIE1 Bits
3121 extern __at(0x0F9D) __sfr PIE1;
3123 typedef union
3125 struct
3127 unsigned TMR1IE : 1;
3128 unsigned TMR2IE : 1;
3129 unsigned CCP1IE : 1;
3130 unsigned SSP1IE : 1;
3131 unsigned TX1IE : 1;
3132 unsigned RC1IE : 1;
3133 unsigned ADIE : 1;
3134 unsigned PSPIE : 1;
3137 struct
3139 unsigned : 1;
3140 unsigned : 1;
3141 unsigned CCPIE : 1;
3142 unsigned SSPIE : 1;
3143 unsigned TXIE : 1;
3144 unsigned RCIE : 1;
3145 unsigned : 1;
3146 unsigned : 1;
3148 } __PIE1bits_t;
3150 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
3152 #define _TMR1IE 0x01
3153 #define _TMR2IE 0x02
3154 #define _CCP1IE 0x04
3155 #define _CCPIE 0x04
3156 #define _SSP1IE 0x08
3157 #define _SSPIE 0x08
3158 #define _TX1IE 0x10
3159 #define _TXIE 0x10
3160 #define _RC1IE 0x20
3161 #define _RCIE 0x20
3162 #define _ADIE 0x40
3163 #define _PSPIE 0x80
3165 //==============================================================================
3168 //==============================================================================
3169 // PIR1 Bits
3171 extern __at(0x0F9E) __sfr PIR1;
3173 typedef union
3175 struct
3177 unsigned TMR1IF : 1;
3178 unsigned TMR2IF : 1;
3179 unsigned CCP1IF : 1;
3180 unsigned SSP1IF : 1;
3181 unsigned TX1IF : 1;
3182 unsigned RC1IF : 1;
3183 unsigned ADIF : 1;
3184 unsigned PSPIF : 1;
3187 struct
3189 unsigned : 1;
3190 unsigned : 1;
3191 unsigned CCPIF : 1;
3192 unsigned SSPIF : 1;
3193 unsigned TXIF : 1;
3194 unsigned RCIF : 1;
3195 unsigned : 1;
3196 unsigned : 1;
3198 } __PIR1bits_t;
3200 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
3202 #define _TMR1IF 0x01
3203 #define _TMR2IF 0x02
3204 #define _CCP1IF 0x04
3205 #define _CCPIF 0x04
3206 #define _SSP1IF 0x08
3207 #define _SSPIF 0x08
3208 #define _TX1IF 0x10
3209 #define _TXIF 0x10
3210 #define _RC1IF 0x20
3211 #define _RCIF 0x20
3212 #define _ADIF 0x40
3213 #define _PSPIF 0x80
3215 //==============================================================================
3218 //==============================================================================
3219 // IPR1 Bits
3221 extern __at(0x0F9F) __sfr IPR1;
3223 typedef union
3225 struct
3227 unsigned TMR1IP : 1;
3228 unsigned TMR2IP : 1;
3229 unsigned CCP1IP : 1;
3230 unsigned SSP1IP : 1;
3231 unsigned TX1IP : 1;
3232 unsigned RC1IP : 1;
3233 unsigned ADIP : 1;
3234 unsigned PSPIP : 1;
3237 struct
3239 unsigned : 1;
3240 unsigned : 1;
3241 unsigned CCPIP : 1;
3242 unsigned SSPIP : 1;
3243 unsigned TXIP : 1;
3244 unsigned RCIP : 1;
3245 unsigned : 1;
3246 unsigned : 1;
3248 } __IPR1bits_t;
3250 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
3252 #define _TMR1IP 0x01
3253 #define _TMR2IP 0x02
3254 #define _CCP1IP 0x04
3255 #define _CCPIP 0x04
3256 #define _SSP1IP 0x08
3257 #define _SSPIP 0x08
3258 #define _TX1IP 0x10
3259 #define _TXIP 0x10
3260 #define _RC1IP 0x20
3261 #define _RCIP 0x20
3262 #define _ADIP 0x40
3263 #define _PSPIP 0x80
3265 //==============================================================================
3268 //==============================================================================
3269 // PIE2 Bits
3271 extern __at(0x0FA0) __sfr PIE2;
3273 typedef union
3275 struct
3277 unsigned CCP2IE : 1;
3278 unsigned TMR3IE : 1;
3279 unsigned : 1;
3280 unsigned BCL1IE : 1;
3281 unsigned : 1;
3282 unsigned : 1;
3283 unsigned CMIE : 1;
3284 unsigned OSCFIE : 1;
3287 struct
3289 unsigned : 1;
3290 unsigned : 1;
3291 unsigned : 1;
3292 unsigned BCLIE : 1;
3293 unsigned : 1;
3294 unsigned : 1;
3295 unsigned : 1;
3296 unsigned : 1;
3298 } __PIE2bits_t;
3300 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
3302 #define _CCP2IE 0x01
3303 #define _TMR3IE 0x02
3304 #define _BCL1IE 0x08
3305 #define _BCLIE 0x08
3306 #define _CMIE 0x40
3307 #define _OSCFIE 0x80
3309 //==============================================================================
3312 //==============================================================================
3313 // PIR2 Bits
3315 extern __at(0x0FA1) __sfr PIR2;
3317 typedef union
3319 struct
3321 unsigned CCP2IF : 1;
3322 unsigned TMR3IF : 1;
3323 unsigned : 1;
3324 unsigned BCL1IF : 1;
3325 unsigned : 1;
3326 unsigned : 1;
3327 unsigned CMIF : 1;
3328 unsigned OSCFIF : 1;
3331 struct
3333 unsigned : 1;
3334 unsigned : 1;
3335 unsigned : 1;
3336 unsigned BCLIF : 1;
3337 unsigned : 1;
3338 unsigned : 1;
3339 unsigned : 1;
3340 unsigned : 1;
3342 } __PIR2bits_t;
3344 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
3346 #define _CCP2IF 0x01
3347 #define _TMR3IF 0x02
3348 #define _BCL1IF 0x08
3349 #define _BCLIF 0x08
3350 #define _CMIF 0x40
3351 #define _OSCFIF 0x80
3353 //==============================================================================
3356 //==============================================================================
3357 // IPR2 Bits
3359 extern __at(0x0FA2) __sfr IPR2;
3361 typedef union
3363 struct
3365 unsigned CCP2IP : 1;
3366 unsigned TMR3IP : 1;
3367 unsigned : 1;
3368 unsigned BCL1IP : 1;
3369 unsigned : 1;
3370 unsigned : 1;
3371 unsigned CMIP : 1;
3372 unsigned OSCFIP : 1;
3375 struct
3377 unsigned : 1;
3378 unsigned : 1;
3379 unsigned : 1;
3380 unsigned BCLIP : 1;
3381 unsigned : 1;
3382 unsigned : 1;
3383 unsigned : 1;
3384 unsigned : 1;
3386 } __IPR2bits_t;
3388 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
3390 #define _CCP2IP 0x01
3391 #define _TMR3IP 0x02
3392 #define _BCL1IP 0x08
3393 #define _BCLIP 0x08
3394 #define _CMIP 0x40
3395 #define _OSCFIP 0x80
3397 //==============================================================================
3400 //==============================================================================
3401 // PIE3 Bits
3403 extern __at(0x0FA3) __sfr PIE3;
3405 typedef struct
3407 unsigned CCP3IE : 1;
3408 unsigned CCP4IE : 1;
3409 unsigned CCP5IE : 1;
3410 unsigned TMR4IE : 1;
3411 unsigned TX2IE : 1;
3412 unsigned RC2IE : 1;
3413 unsigned BCL2IE : 1;
3414 unsigned SSP2IE : 1;
3415 } __PIE3bits_t;
3417 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
3419 #define _CCP3IE 0x01
3420 #define _CCP4IE 0x02
3421 #define _CCP5IE 0x04
3422 #define _TMR4IE 0x08
3423 #define _TX2IE 0x10
3424 #define _RC2IE 0x20
3425 #define _BCL2IE 0x40
3426 #define _SSP2IE 0x80
3428 //==============================================================================
3431 //==============================================================================
3432 // PIR3 Bits
3434 extern __at(0x0FA4) __sfr PIR3;
3436 typedef struct
3438 unsigned CCP3IF : 1;
3439 unsigned CCP4IF : 1;
3440 unsigned CCP5IF : 1;
3441 unsigned TMR4IF : 1;
3442 unsigned TX2IF : 1;
3443 unsigned RC2IF : 1;
3444 unsigned BCL2IF : 1;
3445 unsigned SSP2IF : 1;
3446 } __PIR3bits_t;
3448 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
3450 #define _CCP3IF 0x01
3451 #define _CCP4IF 0x02
3452 #define _CCP5IF 0x04
3453 #define _TMR4IF 0x08
3454 #define _TX2IF 0x10
3455 #define _RC2IF 0x20
3456 #define _BCL2IF 0x40
3457 #define _SSP2IF 0x80
3459 //==============================================================================
3462 //==============================================================================
3463 // IPR3 Bits
3465 extern __at(0x0FA5) __sfr IPR3;
3467 typedef struct
3469 unsigned CCP3IP : 1;
3470 unsigned CCP4IP : 1;
3471 unsigned CCP5IP : 1;
3472 unsigned TMR4IP : 1;
3473 unsigned TX2IP : 1;
3474 unsigned RC2IP : 1;
3475 unsigned BCL2IP : 1;
3476 unsigned SSP2IP : 1;
3477 } __IPR3bits_t;
3479 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
3481 #define _CCP3IP 0x01
3482 #define _CCP4IP 0x02
3483 #define _CCP5IP 0x04
3484 #define _TMR4IP 0x08
3485 #define _TX2IP 0x10
3486 #define _RC2IP 0x20
3487 #define _BCL2IP 0x40
3488 #define _SSP2IP 0x80
3490 //==============================================================================
3493 //==============================================================================
3494 // EECON1 Bits
3496 extern __at(0x0FA6) __sfr EECON1;
3498 typedef struct
3500 unsigned : 1;
3501 unsigned WR : 1;
3502 unsigned WREN : 1;
3503 unsigned WRERR : 1;
3504 unsigned FREE : 1;
3505 unsigned : 1;
3506 unsigned : 1;
3507 unsigned : 1;
3508 } __EECON1bits_t;
3510 extern __at(0x0FA6) volatile __EECON1bits_t EECON1bits;
3512 #define _WR 0x02
3513 #define _WREN 0x04
3514 #define _WRERR 0x08
3515 #define _FREE 0x10
3517 //==============================================================================
3519 extern __at(0x0FA7) __sfr EECON2;
3521 //==============================================================================
3522 // RCSTA Bits
3524 extern __at(0x0FAB) __sfr RCSTA;
3526 typedef union
3528 struct
3530 unsigned RX9D : 1;
3531 unsigned OERR : 1;
3532 unsigned FERR : 1;
3533 unsigned ADDEN : 1;
3534 unsigned CREN : 1;
3535 unsigned SREN : 1;
3536 unsigned RX9 : 1;
3537 unsigned SPEN : 1;
3540 struct
3542 unsigned RCD8 : 1;
3543 unsigned OERR1 : 1;
3544 unsigned FERR1 : 1;
3545 unsigned ADDEN1 : 1;
3546 unsigned CREN1 : 1;
3547 unsigned SREN1 : 1;
3548 unsigned RC9 : 1;
3549 unsigned SPEN1 : 1;
3552 struct
3554 unsigned RX9D1 : 1;
3555 unsigned : 1;
3556 unsigned : 1;
3557 unsigned : 1;
3558 unsigned : 1;
3559 unsigned : 1;
3560 unsigned NOT_RC8 : 1;
3561 unsigned : 1;
3564 struct
3566 unsigned : 1;
3567 unsigned : 1;
3568 unsigned : 1;
3569 unsigned : 1;
3570 unsigned : 1;
3571 unsigned : 1;
3572 unsigned RC8_9 : 1;
3573 unsigned : 1;
3576 struct
3578 unsigned : 1;
3579 unsigned : 1;
3580 unsigned : 1;
3581 unsigned : 1;
3582 unsigned : 1;
3583 unsigned : 1;
3584 unsigned RX91 : 1;
3585 unsigned : 1;
3587 } __RCSTAbits_t;
3589 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
3591 #define _RX9D 0x01
3592 #define _RCD8 0x01
3593 #define _RX9D1 0x01
3594 #define _OERR 0x02
3595 #define _OERR1 0x02
3596 #define _FERR 0x04
3597 #define _FERR1 0x04
3598 #define _ADDEN 0x08
3599 #define _ADDEN1 0x08
3600 #define _CREN 0x10
3601 #define _CREN1 0x10
3602 #define _SREN 0x20
3603 #define _SREN1 0x20
3604 #define _RX9 0x40
3605 #define _RC9 0x40
3606 #define _NOT_RC8 0x40
3607 #define _RC8_9 0x40
3608 #define _RX91 0x40
3609 #define _SPEN 0x80
3610 #define _SPEN1 0x80
3612 //==============================================================================
3615 //==============================================================================
3616 // RCSTA1 Bits
3618 extern __at(0x0FAB) __sfr RCSTA1;
3620 typedef union
3622 struct
3624 unsigned RX9D : 1;
3625 unsigned OERR : 1;
3626 unsigned FERR : 1;
3627 unsigned ADDEN : 1;
3628 unsigned CREN : 1;
3629 unsigned SREN : 1;
3630 unsigned RX9 : 1;
3631 unsigned SPEN : 1;
3634 struct
3636 unsigned RCD8 : 1;
3637 unsigned OERR1 : 1;
3638 unsigned FERR1 : 1;
3639 unsigned ADDEN1 : 1;
3640 unsigned CREN1 : 1;
3641 unsigned SREN1 : 1;
3642 unsigned RC9 : 1;
3643 unsigned SPEN1 : 1;
3646 struct
3648 unsigned RX9D1 : 1;
3649 unsigned : 1;
3650 unsigned : 1;
3651 unsigned : 1;
3652 unsigned : 1;
3653 unsigned : 1;
3654 unsigned NOT_RC8 : 1;
3655 unsigned : 1;
3658 struct
3660 unsigned : 1;
3661 unsigned : 1;
3662 unsigned : 1;
3663 unsigned : 1;
3664 unsigned : 1;
3665 unsigned : 1;
3666 unsigned RC8_9 : 1;
3667 unsigned : 1;
3670 struct
3672 unsigned : 1;
3673 unsigned : 1;
3674 unsigned : 1;
3675 unsigned : 1;
3676 unsigned : 1;
3677 unsigned : 1;
3678 unsigned RX91 : 1;
3679 unsigned : 1;
3681 } __RCSTA1bits_t;
3683 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
3685 #define _RCSTA1_RX9D 0x01
3686 #define _RCSTA1_RCD8 0x01
3687 #define _RCSTA1_RX9D1 0x01
3688 #define _RCSTA1_OERR 0x02
3689 #define _RCSTA1_OERR1 0x02
3690 #define _RCSTA1_FERR 0x04
3691 #define _RCSTA1_FERR1 0x04
3692 #define _RCSTA1_ADDEN 0x08
3693 #define _RCSTA1_ADDEN1 0x08
3694 #define _RCSTA1_CREN 0x10
3695 #define _RCSTA1_CREN1 0x10
3696 #define _RCSTA1_SREN 0x20
3697 #define _RCSTA1_SREN1 0x20
3698 #define _RCSTA1_RX9 0x40
3699 #define _RCSTA1_RC9 0x40
3700 #define _RCSTA1_NOT_RC8 0x40
3701 #define _RCSTA1_RC8_9 0x40
3702 #define _RCSTA1_RX91 0x40
3703 #define _RCSTA1_SPEN 0x80
3704 #define _RCSTA1_SPEN1 0x80
3706 //==============================================================================
3709 //==============================================================================
3710 // TXSTA Bits
3712 extern __at(0x0FAC) __sfr TXSTA;
3714 typedef union
3716 struct
3718 unsigned TX9D : 1;
3719 unsigned TRMT : 1;
3720 unsigned BRGH : 1;
3721 unsigned SENDB : 1;
3722 unsigned SYNC : 1;
3723 unsigned TXEN : 1;
3724 unsigned TX9 : 1;
3725 unsigned CSRC : 1;
3728 struct
3730 unsigned TXD8 : 1;
3731 unsigned TRMT1 : 1;
3732 unsigned BRGH1 : 1;
3733 unsigned SENDB1 : 1;
3734 unsigned SYNC1 : 1;
3735 unsigned TXEN1 : 1;
3736 unsigned TX8_9 : 1;
3737 unsigned CSRC1 : 1;
3740 struct
3742 unsigned TX9D1 : 1;
3743 unsigned : 1;
3744 unsigned : 1;
3745 unsigned : 1;
3746 unsigned : 1;
3747 unsigned : 1;
3748 unsigned NOT_TX8 : 1;
3749 unsigned : 1;
3752 struct
3754 unsigned : 1;
3755 unsigned : 1;
3756 unsigned : 1;
3757 unsigned : 1;
3758 unsigned : 1;
3759 unsigned : 1;
3760 unsigned TX91 : 1;
3761 unsigned : 1;
3763 } __TXSTAbits_t;
3765 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
3767 #define _TX9D 0x01
3768 #define _TXD8 0x01
3769 #define _TX9D1 0x01
3770 #define _TRMT 0x02
3771 #define _TRMT1 0x02
3772 #define _BRGH 0x04
3773 #define _BRGH1 0x04
3774 #define _SENDB 0x08
3775 #define _SENDB1 0x08
3776 #define _SYNC 0x10
3777 #define _SYNC1 0x10
3778 #define _TXEN 0x20
3779 #define _TXEN1 0x20
3780 #define _TX9 0x40
3781 #define _TX8_9 0x40
3782 #define _NOT_TX8 0x40
3783 #define _TX91 0x40
3784 #define _CSRC 0x80
3785 #define _CSRC1 0x80
3787 //==============================================================================
3790 //==============================================================================
3791 // TXSTA1 Bits
3793 extern __at(0x0FAC) __sfr TXSTA1;
3795 typedef union
3797 struct
3799 unsigned TX9D : 1;
3800 unsigned TRMT : 1;
3801 unsigned BRGH : 1;
3802 unsigned SENDB : 1;
3803 unsigned SYNC : 1;
3804 unsigned TXEN : 1;
3805 unsigned TX9 : 1;
3806 unsigned CSRC : 1;
3809 struct
3811 unsigned TXD8 : 1;
3812 unsigned TRMT1 : 1;
3813 unsigned BRGH1 : 1;
3814 unsigned SENDB1 : 1;
3815 unsigned SYNC1 : 1;
3816 unsigned TXEN1 : 1;
3817 unsigned TX8_9 : 1;
3818 unsigned CSRC1 : 1;
3821 struct
3823 unsigned TX9D1 : 1;
3824 unsigned : 1;
3825 unsigned : 1;
3826 unsigned : 1;
3827 unsigned : 1;
3828 unsigned : 1;
3829 unsigned NOT_TX8 : 1;
3830 unsigned : 1;
3833 struct
3835 unsigned : 1;
3836 unsigned : 1;
3837 unsigned : 1;
3838 unsigned : 1;
3839 unsigned : 1;
3840 unsigned : 1;
3841 unsigned TX91 : 1;
3842 unsigned : 1;
3844 } __TXSTA1bits_t;
3846 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
3848 #define _TXSTA1_TX9D 0x01
3849 #define _TXSTA1_TXD8 0x01
3850 #define _TXSTA1_TX9D1 0x01
3851 #define _TXSTA1_TRMT 0x02
3852 #define _TXSTA1_TRMT1 0x02
3853 #define _TXSTA1_BRGH 0x04
3854 #define _TXSTA1_BRGH1 0x04
3855 #define _TXSTA1_SENDB 0x08
3856 #define _TXSTA1_SENDB1 0x08
3857 #define _TXSTA1_SYNC 0x10
3858 #define _TXSTA1_SYNC1 0x10
3859 #define _TXSTA1_TXEN 0x20
3860 #define _TXSTA1_TXEN1 0x20
3861 #define _TXSTA1_TX9 0x40
3862 #define _TXSTA1_TX8_9 0x40
3863 #define _TXSTA1_NOT_TX8 0x40
3864 #define _TXSTA1_TX91 0x40
3865 #define _TXSTA1_CSRC 0x80
3866 #define _TXSTA1_CSRC1 0x80
3868 //==============================================================================
3870 extern __at(0x0FAD) __sfr TXREG;
3871 extern __at(0x0FAD) __sfr TXREG1;
3872 extern __at(0x0FAE) __sfr RCREG;
3873 extern __at(0x0FAE) __sfr RCREG1;
3874 extern __at(0x0FAF) __sfr SPBRG;
3875 extern __at(0x0FAF) __sfr SPBRG1;
3877 //==============================================================================
3878 // PSPCON Bits
3880 extern __at(0x0FB0) __sfr PSPCON;
3882 typedef struct
3884 unsigned : 1;
3885 unsigned : 1;
3886 unsigned : 1;
3887 unsigned : 1;
3888 unsigned PSPMODE : 1;
3889 unsigned IBOV : 1;
3890 unsigned OBF : 1;
3891 unsigned IBF : 1;
3892 } __PSPCONbits_t;
3894 extern __at(0x0FB0) volatile __PSPCONbits_t PSPCONbits;
3896 #define _PSPMODE 0x10
3897 #define _IBOV 0x20
3898 #define _OBF 0x40
3899 #define _IBF 0x80
3901 //==============================================================================
3904 //==============================================================================
3905 // T3CON Bits
3907 extern __at(0x0FB1) __sfr T3CON;
3909 typedef union
3911 struct
3913 unsigned TMR3ON : 1;
3914 unsigned TMR3CS : 1;
3915 unsigned NOT_T3SYNC : 1;
3916 unsigned T3CCP1 : 1;
3917 unsigned T3CKPS0 : 1;
3918 unsigned T3CKPS1 : 1;
3919 unsigned T3CCP2 : 1;
3920 unsigned RD16 : 1;
3923 struct
3925 unsigned : 1;
3926 unsigned : 1;
3927 unsigned T3SYNC : 1;
3928 unsigned : 1;
3929 unsigned : 1;
3930 unsigned : 1;
3931 unsigned : 1;
3932 unsigned : 1;
3935 struct
3937 unsigned : 1;
3938 unsigned : 1;
3939 unsigned T3INSYNC : 1;
3940 unsigned : 1;
3941 unsigned : 1;
3942 unsigned : 1;
3943 unsigned : 1;
3944 unsigned : 1;
3947 struct
3949 unsigned : 4;
3950 unsigned T3CKPS : 2;
3951 unsigned : 2;
3953 } __T3CONbits_t;
3955 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
3957 #define _T3CON_TMR3ON 0x01
3958 #define _T3CON_TMR3CS 0x02
3959 #define _T3CON_NOT_T3SYNC 0x04
3960 #define _T3CON_T3SYNC 0x04
3961 #define _T3CON_T3INSYNC 0x04
3962 #define _T3CON_T3CCP1 0x08
3963 #define _T3CON_T3CKPS0 0x10
3964 #define _T3CON_T3CKPS1 0x20
3965 #define _T3CON_T3CCP2 0x40
3966 #define _T3CON_RD16 0x80
3968 //==============================================================================
3970 extern __at(0x0FB2) __sfr TMR3;
3971 extern __at(0x0FB2) __sfr TMR3L;
3972 extern __at(0x0FB3) __sfr TMR3H;
3974 //==============================================================================
3975 // CMCON Bits
3977 extern __at(0x0FB4) __sfr CMCON;
3979 typedef union
3981 struct
3983 unsigned CM0 : 1;
3984 unsigned CM1 : 1;
3985 unsigned CM2 : 1;
3986 unsigned CIS : 1;
3987 unsigned C1INV : 1;
3988 unsigned C2INV : 1;
3989 unsigned C1OUT : 1;
3990 unsigned C2OUT : 1;
3993 struct
3995 unsigned CM : 3;
3996 unsigned : 5;
3998 } __CMCONbits_t;
4000 extern __at(0x0FB4) volatile __CMCONbits_t CMCONbits;
4002 #define _CM0 0x01
4003 #define _CM1 0x02
4004 #define _CM2 0x04
4005 #define _CIS 0x08
4006 #define _C1INV 0x10
4007 #define _C2INV 0x20
4008 #define _C1OUT 0x40
4009 #define _C2OUT 0x80
4011 //==============================================================================
4014 //==============================================================================
4015 // CVRCON Bits
4017 extern __at(0x0FB5) __sfr CVRCON;
4019 typedef union
4021 struct
4023 unsigned CVR0 : 1;
4024 unsigned CVR1 : 1;
4025 unsigned CVR2 : 1;
4026 unsigned CVR3 : 1;
4027 unsigned CVRSS : 1;
4028 unsigned CVRR : 1;
4029 unsigned CVROE : 1;
4030 unsigned CVREN : 1;
4033 struct
4035 unsigned CVR : 4;
4036 unsigned : 4;
4038 } __CVRCONbits_t;
4040 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
4042 #define _CVR0 0x01
4043 #define _CVR1 0x02
4044 #define _CVR2 0x04
4045 #define _CVR3 0x08
4046 #define _CVRSS 0x10
4047 #define _CVRR 0x20
4048 #define _CVROE 0x40
4049 #define _CVREN 0x80
4051 //==============================================================================
4054 //==============================================================================
4055 // ECCP1AS Bits
4057 extern __at(0x0FB6) __sfr ECCP1AS;
4059 typedef union
4061 struct
4063 unsigned PSSBD0 : 1;
4064 unsigned PSSBD1 : 1;
4065 unsigned PSSAC0 : 1;
4066 unsigned PSSAC1 : 1;
4067 unsigned ECCPAS0 : 1;
4068 unsigned ECCPAS1 : 1;
4069 unsigned ECCPAS2 : 1;
4070 unsigned ECCPASE : 1;
4073 struct
4075 unsigned PSS1BD0 : 1;
4076 unsigned PSS1BD1 : 1;
4077 unsigned PSS1AC0 : 1;
4078 unsigned PSS1AC1 : 1;
4079 unsigned ECCP1AS0 : 1;
4080 unsigned ECCP1AS1 : 1;
4081 unsigned ECCP1AS2 : 1;
4082 unsigned ECCP1ASE : 1;
4085 struct
4087 unsigned PSSBD : 2;
4088 unsigned : 6;
4091 struct
4093 unsigned PSS1BD : 2;
4094 unsigned : 6;
4097 struct
4099 unsigned : 2;
4100 unsigned PSSAC : 2;
4101 unsigned : 4;
4104 struct
4106 unsigned : 2;
4107 unsigned PSS1AC : 2;
4108 unsigned : 4;
4111 struct
4113 unsigned : 4;
4114 unsigned ECCPAS : 3;
4115 unsigned : 1;
4118 struct
4120 unsigned : 4;
4121 unsigned ECCP1AS : 3;
4122 unsigned : 1;
4124 } __ECCP1ASbits_t;
4126 extern __at(0x0FB6) volatile __ECCP1ASbits_t ECCP1ASbits;
4128 #define _PSSBD0 0x01
4129 #define _PSS1BD0 0x01
4130 #define _PSSBD1 0x02
4131 #define _PSS1BD1 0x02
4132 #define _PSSAC0 0x04
4133 #define _PSS1AC0 0x04
4134 #define _PSSAC1 0x08
4135 #define _PSS1AC1 0x08
4136 #define _ECCPAS0 0x10
4137 #define _ECCP1AS0 0x10
4138 #define _ECCPAS1 0x20
4139 #define _ECCP1AS1 0x20
4140 #define _ECCPAS2 0x40
4141 #define _ECCP1AS2 0x40
4142 #define _ECCPASE 0x80
4143 #define _ECCP1ASE 0x80
4145 //==============================================================================
4148 //==============================================================================
4149 // CCP3CON Bits
4151 extern __at(0x0FB7) __sfr CCP3CON;
4153 typedef union
4155 struct
4157 unsigned CCP3M0 : 1;
4158 unsigned CCP3M1 : 1;
4159 unsigned CCP3M2 : 1;
4160 unsigned CCP3M3 : 1;
4161 unsigned DC3B0 : 1;
4162 unsigned DC3B1 : 1;
4163 unsigned P3M0 : 1;
4164 unsigned P3M1 : 1;
4167 struct
4169 unsigned : 1;
4170 unsigned : 1;
4171 unsigned : 1;
4172 unsigned : 1;
4173 unsigned CCP3Y : 1;
4174 unsigned CCP3X : 1;
4175 unsigned : 1;
4176 unsigned : 1;
4179 struct
4181 unsigned CCP3M : 4;
4182 unsigned : 4;
4185 struct
4187 unsigned : 4;
4188 unsigned DC3B : 2;
4189 unsigned : 2;
4192 struct
4194 unsigned : 6;
4195 unsigned P3M : 2;
4197 } __CCP3CONbits_t;
4199 extern __at(0x0FB7) volatile __CCP3CONbits_t CCP3CONbits;
4201 #define _CCP3M0 0x01
4202 #define _CCP3M1 0x02
4203 #define _CCP3M2 0x04
4204 #define _CCP3M3 0x08
4205 #define _DC3B0 0x10
4206 #define _CCP3Y 0x10
4207 #define _DC3B1 0x20
4208 #define _CCP3X 0x20
4209 #define _P3M0 0x40
4210 #define _P3M1 0x80
4212 //==============================================================================
4215 //==============================================================================
4216 // ECCP3CON Bits
4218 extern __at(0x0FB7) __sfr ECCP3CON;
4220 typedef union
4222 struct
4224 unsigned CCP3M0 : 1;
4225 unsigned CCP3M1 : 1;
4226 unsigned CCP3M2 : 1;
4227 unsigned CCP3M3 : 1;
4228 unsigned DC3B0 : 1;
4229 unsigned DC3B1 : 1;
4230 unsigned P3M0 : 1;
4231 unsigned P3M1 : 1;
4234 struct
4236 unsigned : 1;
4237 unsigned : 1;
4238 unsigned : 1;
4239 unsigned : 1;
4240 unsigned CCP3Y : 1;
4241 unsigned CCP3X : 1;
4242 unsigned : 1;
4243 unsigned : 1;
4246 struct
4248 unsigned CCP3M : 4;
4249 unsigned : 4;
4252 struct
4254 unsigned : 4;
4255 unsigned DC3B : 2;
4256 unsigned : 2;
4259 struct
4261 unsigned : 6;
4262 unsigned P3M : 2;
4264 } __ECCP3CONbits_t;
4266 extern __at(0x0FB7) volatile __ECCP3CONbits_t ECCP3CONbits;
4268 #define _ECCP3CON_CCP3M0 0x01
4269 #define _ECCP3CON_CCP3M1 0x02
4270 #define _ECCP3CON_CCP3M2 0x04
4271 #define _ECCP3CON_CCP3M3 0x08
4272 #define _ECCP3CON_DC3B0 0x10
4273 #define _ECCP3CON_CCP3Y 0x10
4274 #define _ECCP3CON_DC3B1 0x20
4275 #define _ECCP3CON_CCP3X 0x20
4276 #define _ECCP3CON_P3M0 0x40
4277 #define _ECCP3CON_P3M1 0x80
4279 //==============================================================================
4281 extern __at(0x0FB8) __sfr CCPR3;
4282 extern __at(0x0FB8) __sfr CCPR3L;
4283 extern __at(0x0FB9) __sfr CCPR3H;
4285 //==============================================================================
4286 // CCP2CON Bits
4288 extern __at(0x0FBA) __sfr CCP2CON;
4290 typedef union
4292 struct
4294 unsigned CCP2M0 : 1;
4295 unsigned CCP2M1 : 1;
4296 unsigned CCP2M2 : 1;
4297 unsigned CCP2M3 : 1;
4298 unsigned DC2B0 : 1;
4299 unsigned DC2B1 : 1;
4300 unsigned P2M0 : 1;
4301 unsigned P2M1 : 1;
4304 struct
4306 unsigned : 1;
4307 unsigned : 1;
4308 unsigned : 1;
4309 unsigned : 1;
4310 unsigned CCP2Y : 1;
4311 unsigned CCP2X : 1;
4312 unsigned : 1;
4313 unsigned : 1;
4316 struct
4318 unsigned CCP2M : 4;
4319 unsigned : 4;
4322 struct
4324 unsigned : 4;
4325 unsigned DC2B : 2;
4326 unsigned : 2;
4329 struct
4331 unsigned : 6;
4332 unsigned P2M : 2;
4334 } __CCP2CONbits_t;
4336 extern __at(0x0FBA) volatile __CCP2CONbits_t CCP2CONbits;
4338 #define _CCP2M0 0x01
4339 #define _CCP2M1 0x02
4340 #define _CCP2M2 0x04
4341 #define _CCP2M3 0x08
4342 #define _DC2B0 0x10
4343 #define _CCP2Y 0x10
4344 #define _DC2B1 0x20
4345 #define _CCP2X 0x20
4346 #define _P2M0 0x40
4347 #define _P2M1 0x80
4349 //==============================================================================
4352 //==============================================================================
4353 // ECCP2CON Bits
4355 extern __at(0x0FBA) __sfr ECCP2CON;
4357 typedef union
4359 struct
4361 unsigned CCP2M0 : 1;
4362 unsigned CCP2M1 : 1;
4363 unsigned CCP2M2 : 1;
4364 unsigned CCP2M3 : 1;
4365 unsigned DC2B0 : 1;
4366 unsigned DC2B1 : 1;
4367 unsigned P2M0 : 1;
4368 unsigned P2M1 : 1;
4371 struct
4373 unsigned : 1;
4374 unsigned : 1;
4375 unsigned : 1;
4376 unsigned : 1;
4377 unsigned CCP2Y : 1;
4378 unsigned CCP2X : 1;
4379 unsigned : 1;
4380 unsigned : 1;
4383 struct
4385 unsigned CCP2M : 4;
4386 unsigned : 4;
4389 struct
4391 unsigned : 4;
4392 unsigned DC2B : 2;
4393 unsigned : 2;
4396 struct
4398 unsigned : 6;
4399 unsigned P2M : 2;
4401 } __ECCP2CONbits_t;
4403 extern __at(0x0FBA) volatile __ECCP2CONbits_t ECCP2CONbits;
4405 #define _ECCP2CON_CCP2M0 0x01
4406 #define _ECCP2CON_CCP2M1 0x02
4407 #define _ECCP2CON_CCP2M2 0x04
4408 #define _ECCP2CON_CCP2M3 0x08
4409 #define _ECCP2CON_DC2B0 0x10
4410 #define _ECCP2CON_CCP2Y 0x10
4411 #define _ECCP2CON_DC2B1 0x20
4412 #define _ECCP2CON_CCP2X 0x20
4413 #define _ECCP2CON_P2M0 0x40
4414 #define _ECCP2CON_P2M1 0x80
4416 //==============================================================================
4418 extern __at(0x0FBB) __sfr CCPR2;
4419 extern __at(0x0FBB) __sfr CCPR2L;
4420 extern __at(0x0FBC) __sfr CCPR2H;
4422 //==============================================================================
4423 // CCP1CON Bits
4425 extern __at(0x0FBD) __sfr CCP1CON;
4427 typedef union
4429 struct
4431 unsigned CCP1M0 : 1;
4432 unsigned CCP1M1 : 1;
4433 unsigned CCP1M2 : 1;
4434 unsigned CCP1M3 : 1;
4435 unsigned DC1B0 : 1;
4436 unsigned DC1B1 : 1;
4437 unsigned P1M0 : 1;
4438 unsigned P1M1 : 1;
4441 struct
4443 unsigned : 1;
4444 unsigned : 1;
4445 unsigned : 1;
4446 unsigned : 1;
4447 unsigned CCP1Y : 1;
4448 unsigned CCP1X : 1;
4449 unsigned : 1;
4450 unsigned : 1;
4453 struct
4455 unsigned CCP1M : 4;
4456 unsigned : 4;
4459 struct
4461 unsigned : 4;
4462 unsigned DC1B : 2;
4463 unsigned : 2;
4466 struct
4468 unsigned : 6;
4469 unsigned P1M : 2;
4471 } __CCP1CONbits_t;
4473 extern __at(0x0FBD) volatile __CCP1CONbits_t CCP1CONbits;
4475 #define _CCP1M0 0x01
4476 #define _CCP1M1 0x02
4477 #define _CCP1M2 0x04
4478 #define _CCP1M3 0x08
4479 #define _DC1B0 0x10
4480 #define _CCP1Y 0x10
4481 #define _DC1B1 0x20
4482 #define _CCP1X 0x20
4483 #define _P1M0 0x40
4484 #define _P1M1 0x80
4486 //==============================================================================
4489 //==============================================================================
4490 // ECCP1CON Bits
4492 extern __at(0x0FBD) __sfr ECCP1CON;
4494 typedef union
4496 struct
4498 unsigned CCP1M0 : 1;
4499 unsigned CCP1M1 : 1;
4500 unsigned CCP1M2 : 1;
4501 unsigned CCP1M3 : 1;
4502 unsigned DC1B0 : 1;
4503 unsigned DC1B1 : 1;
4504 unsigned P1M0 : 1;
4505 unsigned P1M1 : 1;
4508 struct
4510 unsigned : 1;
4511 unsigned : 1;
4512 unsigned : 1;
4513 unsigned : 1;
4514 unsigned CCP1Y : 1;
4515 unsigned CCP1X : 1;
4516 unsigned : 1;
4517 unsigned : 1;
4520 struct
4522 unsigned CCP1M : 4;
4523 unsigned : 4;
4526 struct
4528 unsigned : 4;
4529 unsigned DC1B : 2;
4530 unsigned : 2;
4533 struct
4535 unsigned : 6;
4536 unsigned P1M : 2;
4538 } __ECCP1CONbits_t;
4540 extern __at(0x0FBD) volatile __ECCP1CONbits_t ECCP1CONbits;
4542 #define _ECCP1CON_CCP1M0 0x01
4543 #define _ECCP1CON_CCP1M1 0x02
4544 #define _ECCP1CON_CCP1M2 0x04
4545 #define _ECCP1CON_CCP1M3 0x08
4546 #define _ECCP1CON_DC1B0 0x10
4547 #define _ECCP1CON_CCP1Y 0x10
4548 #define _ECCP1CON_DC1B1 0x20
4549 #define _ECCP1CON_CCP1X 0x20
4550 #define _ECCP1CON_P1M0 0x40
4551 #define _ECCP1CON_P1M1 0x80
4553 //==============================================================================
4555 extern __at(0x0FBE) __sfr CCPR1;
4556 extern __at(0x0FBE) __sfr CCPR1L;
4557 extern __at(0x0FBF) __sfr CCPR1H;
4559 //==============================================================================
4560 // ADCON2 Bits
4562 extern __at(0x0FC0) __sfr ADCON2;
4564 typedef union
4566 struct
4568 unsigned ADCS0 : 1;
4569 unsigned ADCS1 : 1;
4570 unsigned ADCS2 : 1;
4571 unsigned ACQT0 : 1;
4572 unsigned ACQT1 : 1;
4573 unsigned ACQT2 : 1;
4574 unsigned : 1;
4575 unsigned ADFM : 1;
4578 struct
4580 unsigned ADCS : 3;
4581 unsigned : 5;
4584 struct
4586 unsigned : 3;
4587 unsigned ACQT : 3;
4588 unsigned : 2;
4590 } __ADCON2bits_t;
4592 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
4594 #define _ADCS0 0x01
4595 #define _ADCS1 0x02
4596 #define _ADCS2 0x04
4597 #define _ACQT0 0x08
4598 #define _ACQT1 0x10
4599 #define _ACQT2 0x20
4600 #define _ADFM 0x80
4602 //==============================================================================
4605 //==============================================================================
4606 // ADCON1 Bits
4608 extern __at(0x0FC1) __sfr ADCON1;
4610 typedef union
4612 struct
4614 unsigned PCFG0 : 1;
4615 unsigned PCFG1 : 1;
4616 unsigned PCFG2 : 1;
4617 unsigned PCFG3 : 1;
4618 unsigned VCFG0 : 1;
4619 unsigned VCFG1 : 1;
4620 unsigned : 1;
4621 unsigned : 1;
4624 struct
4626 unsigned PCFG : 4;
4627 unsigned : 4;
4630 struct
4632 unsigned : 4;
4633 unsigned VCFG : 2;
4634 unsigned : 2;
4636 } __ADCON1bits_t;
4638 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
4640 #define _PCFG0 0x01
4641 #define _PCFG1 0x02
4642 #define _PCFG2 0x04
4643 #define _PCFG3 0x08
4644 #define _VCFG0 0x10
4645 #define _VCFG1 0x20
4647 //==============================================================================
4650 //==============================================================================
4651 // ADCON0 Bits
4653 extern __at(0x0FC2) __sfr ADCON0;
4655 typedef union
4657 struct
4659 unsigned ADON : 1;
4660 unsigned GO_NOT_DONE : 1;
4661 unsigned CHS0 : 1;
4662 unsigned CHS1 : 1;
4663 unsigned CHS2 : 1;
4664 unsigned CHS3 : 1;
4665 unsigned : 1;
4666 unsigned ADCAL : 1;
4669 struct
4671 unsigned : 1;
4672 unsigned DONE : 1;
4673 unsigned : 1;
4674 unsigned : 1;
4675 unsigned : 1;
4676 unsigned : 1;
4677 unsigned : 1;
4678 unsigned : 1;
4681 struct
4683 unsigned : 1;
4684 unsigned GO_DONE : 1;
4685 unsigned : 1;
4686 unsigned : 1;
4687 unsigned : 1;
4688 unsigned : 1;
4689 unsigned : 1;
4690 unsigned : 1;
4693 struct
4695 unsigned : 1;
4696 unsigned GO : 1;
4697 unsigned : 1;
4698 unsigned : 1;
4699 unsigned : 1;
4700 unsigned : 1;
4701 unsigned : 1;
4702 unsigned : 1;
4705 struct
4707 unsigned : 1;
4708 unsigned NOT_DONE : 1;
4709 unsigned : 1;
4710 unsigned : 1;
4711 unsigned : 1;
4712 unsigned : 1;
4713 unsigned : 1;
4714 unsigned : 1;
4717 struct
4719 unsigned : 2;
4720 unsigned CHS : 4;
4721 unsigned : 2;
4723 } __ADCON0bits_t;
4725 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
4727 #define _ADON 0x01
4728 #define _GO_NOT_DONE 0x02
4729 #define _DONE 0x02
4730 #define _GO_DONE 0x02
4731 #define _GO 0x02
4732 #define _NOT_DONE 0x02
4733 #define _CHS0 0x04
4734 #define _CHS1 0x08
4735 #define _CHS2 0x10
4736 #define _CHS3 0x20
4737 #define _ADCAL 0x80
4739 //==============================================================================
4741 extern __at(0x0FC3) __sfr ADRES;
4742 extern __at(0x0FC3) __sfr ADRESL;
4743 extern __at(0x0FC4) __sfr ADRESH;
4745 //==============================================================================
4746 // SSP1CON2 Bits
4748 extern __at(0x0FC5) __sfr SSP1CON2;
4750 typedef union
4752 struct
4754 unsigned SEN : 1;
4755 unsigned RSEN : 1;
4756 unsigned PEN : 1;
4757 unsigned RCEN : 1;
4758 unsigned ACKEN : 1;
4759 unsigned ACKDT : 1;
4760 unsigned ACKSTAT : 1;
4761 unsigned GCEN : 1;
4764 struct
4766 unsigned : 1;
4767 unsigned ADMSK1 : 1;
4768 unsigned ADMSK2 : 1;
4769 unsigned ADMSK3 : 1;
4770 unsigned ADMSK4 : 1;
4771 unsigned ADMSK5 : 1;
4772 unsigned : 1;
4773 unsigned : 1;
4775 } __SSP1CON2bits_t;
4777 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
4779 #define _SEN 0x01
4780 #define _RSEN 0x02
4781 #define _ADMSK1 0x02
4782 #define _PEN 0x04
4783 #define _ADMSK2 0x04
4784 #define _RCEN 0x08
4785 #define _ADMSK3 0x08
4786 #define _ACKEN 0x10
4787 #define _ADMSK4 0x10
4788 #define _ACKDT 0x20
4789 #define _ADMSK5 0x20
4790 #define _ACKSTAT 0x40
4791 #define _GCEN 0x80
4793 //==============================================================================
4796 //==============================================================================
4797 // SSPCON2 Bits
4799 extern __at(0x0FC5) __sfr SSPCON2;
4801 typedef union
4803 struct
4805 unsigned SEN : 1;
4806 unsigned RSEN : 1;
4807 unsigned PEN : 1;
4808 unsigned RCEN : 1;
4809 unsigned ACKEN : 1;
4810 unsigned ACKDT : 1;
4811 unsigned ACKSTAT : 1;
4812 unsigned GCEN : 1;
4815 struct
4817 unsigned : 1;
4818 unsigned ADMSK1 : 1;
4819 unsigned ADMSK2 : 1;
4820 unsigned ADMSK3 : 1;
4821 unsigned ADMSK4 : 1;
4822 unsigned ADMSK5 : 1;
4823 unsigned : 1;
4824 unsigned : 1;
4826 } __SSPCON2bits_t;
4828 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
4830 #define _SSPCON2_SEN 0x01
4831 #define _SSPCON2_RSEN 0x02
4832 #define _SSPCON2_ADMSK1 0x02
4833 #define _SSPCON2_PEN 0x04
4834 #define _SSPCON2_ADMSK2 0x04
4835 #define _SSPCON2_RCEN 0x08
4836 #define _SSPCON2_ADMSK3 0x08
4837 #define _SSPCON2_ACKEN 0x10
4838 #define _SSPCON2_ADMSK4 0x10
4839 #define _SSPCON2_ACKDT 0x20
4840 #define _SSPCON2_ADMSK5 0x20
4841 #define _SSPCON2_ACKSTAT 0x40
4842 #define _SSPCON2_GCEN 0x80
4844 //==============================================================================
4847 //==============================================================================
4848 // SSP1CON1 Bits
4850 extern __at(0x0FC6) __sfr SSP1CON1;
4852 typedef union
4854 struct
4856 unsigned SSPM0 : 1;
4857 unsigned SSPM1 : 1;
4858 unsigned SSPM2 : 1;
4859 unsigned SSPM3 : 1;
4860 unsigned CKP : 1;
4861 unsigned SSPEN : 1;
4862 unsigned SSPOV : 1;
4863 unsigned WCOL : 1;
4866 struct
4868 unsigned SSPM : 4;
4869 unsigned : 4;
4871 } __SSP1CON1bits_t;
4873 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
4875 #define _SSPM0 0x01
4876 #define _SSPM1 0x02
4877 #define _SSPM2 0x04
4878 #define _SSPM3 0x08
4879 #define _CKP 0x10
4880 #define _SSPEN 0x20
4881 #define _SSPOV 0x40
4882 #define _WCOL 0x80
4884 //==============================================================================
4887 //==============================================================================
4888 // SSPCON1 Bits
4890 extern __at(0x0FC6) __sfr SSPCON1;
4892 typedef union
4894 struct
4896 unsigned SSPM0 : 1;
4897 unsigned SSPM1 : 1;
4898 unsigned SSPM2 : 1;
4899 unsigned SSPM3 : 1;
4900 unsigned CKP : 1;
4901 unsigned SSPEN : 1;
4902 unsigned SSPOV : 1;
4903 unsigned WCOL : 1;
4906 struct
4908 unsigned SSPM : 4;
4909 unsigned : 4;
4911 } __SSPCON1bits_t;
4913 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
4915 #define _SSPCON1_SSPM0 0x01
4916 #define _SSPCON1_SSPM1 0x02
4917 #define _SSPCON1_SSPM2 0x04
4918 #define _SSPCON1_SSPM3 0x08
4919 #define _SSPCON1_CKP 0x10
4920 #define _SSPCON1_SSPEN 0x20
4921 #define _SSPCON1_SSPOV 0x40
4922 #define _SSPCON1_WCOL 0x80
4924 //==============================================================================
4927 //==============================================================================
4928 // SSP1STAT Bits
4930 extern __at(0x0FC7) __sfr SSP1STAT;
4932 typedef union
4934 struct
4936 unsigned BF : 1;
4937 unsigned UA : 1;
4938 unsigned R_NOT_W : 1;
4939 unsigned S : 1;
4940 unsigned P : 1;
4941 unsigned D_NOT_A : 1;
4942 unsigned CKE : 1;
4943 unsigned SMP : 1;
4946 struct
4948 unsigned : 1;
4949 unsigned : 1;
4950 unsigned R_W : 1;
4951 unsigned I2C_START : 1;
4952 unsigned I2C_STOP : 1;
4953 unsigned D_A : 1;
4954 unsigned : 1;
4955 unsigned : 1;
4958 struct
4960 unsigned : 1;
4961 unsigned : 1;
4962 unsigned I2C_READ : 1;
4963 unsigned : 1;
4964 unsigned : 1;
4965 unsigned I2C_DAT : 1;
4966 unsigned : 1;
4967 unsigned : 1;
4970 struct
4972 unsigned : 1;
4973 unsigned : 1;
4974 unsigned NOT_W : 1;
4975 unsigned : 1;
4976 unsigned : 1;
4977 unsigned NOT_A : 1;
4978 unsigned : 1;
4979 unsigned : 1;
4982 struct
4984 unsigned : 1;
4985 unsigned : 1;
4986 unsigned NOT_WRITE : 1;
4987 unsigned : 1;
4988 unsigned : 1;
4989 unsigned NOT_ADDRESS : 1;
4990 unsigned : 1;
4991 unsigned : 1;
4994 struct
4996 unsigned : 1;
4997 unsigned : 1;
4998 unsigned READ_WRITE : 1;
4999 unsigned : 1;
5000 unsigned : 1;
5001 unsigned DATA_ADDRESS : 1;
5002 unsigned : 1;
5003 unsigned : 1;
5006 struct
5008 unsigned : 1;
5009 unsigned : 1;
5010 unsigned R : 1;
5011 unsigned : 1;
5012 unsigned : 1;
5013 unsigned D : 1;
5014 unsigned : 1;
5015 unsigned : 1;
5017 } __SSP1STATbits_t;
5019 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
5021 #define _BF 0x01
5022 #define _UA 0x02
5023 #define _R_NOT_W 0x04
5024 #define _R_W 0x04
5025 #define _I2C_READ 0x04
5026 #define _NOT_W 0x04
5027 #define _NOT_WRITE 0x04
5028 #define _READ_WRITE 0x04
5029 #define _R 0x04
5030 #define _S 0x08
5031 #define _I2C_START 0x08
5032 #define _P 0x10
5033 #define _I2C_STOP 0x10
5034 #define _D_NOT_A 0x20
5035 #define _D_A 0x20
5036 #define _I2C_DAT 0x20
5037 #define _NOT_A 0x20
5038 #define _NOT_ADDRESS 0x20
5039 #define _DATA_ADDRESS 0x20
5040 #define _D 0x20
5041 #define _CKE 0x40
5042 #define _SMP 0x80
5044 //==============================================================================
5047 //==============================================================================
5048 // SSPSTAT Bits
5050 extern __at(0x0FC7) __sfr SSPSTAT;
5052 typedef union
5054 struct
5056 unsigned BF : 1;
5057 unsigned UA : 1;
5058 unsigned R_NOT_W : 1;
5059 unsigned S : 1;
5060 unsigned P : 1;
5061 unsigned D_NOT_A : 1;
5062 unsigned CKE : 1;
5063 unsigned SMP : 1;
5066 struct
5068 unsigned : 1;
5069 unsigned : 1;
5070 unsigned R_W : 1;
5071 unsigned I2C_START : 1;
5072 unsigned I2C_STOP : 1;
5073 unsigned D_A : 1;
5074 unsigned : 1;
5075 unsigned : 1;
5078 struct
5080 unsigned : 1;
5081 unsigned : 1;
5082 unsigned I2C_READ : 1;
5083 unsigned : 1;
5084 unsigned : 1;
5085 unsigned I2C_DAT : 1;
5086 unsigned : 1;
5087 unsigned : 1;
5090 struct
5092 unsigned : 1;
5093 unsigned : 1;
5094 unsigned NOT_W : 1;
5095 unsigned : 1;
5096 unsigned : 1;
5097 unsigned NOT_A : 1;
5098 unsigned : 1;
5099 unsigned : 1;
5102 struct
5104 unsigned : 1;
5105 unsigned : 1;
5106 unsigned NOT_WRITE : 1;
5107 unsigned : 1;
5108 unsigned : 1;
5109 unsigned NOT_ADDRESS : 1;
5110 unsigned : 1;
5111 unsigned : 1;
5114 struct
5116 unsigned : 1;
5117 unsigned : 1;
5118 unsigned READ_WRITE : 1;
5119 unsigned : 1;
5120 unsigned : 1;
5121 unsigned DATA_ADDRESS : 1;
5122 unsigned : 1;
5123 unsigned : 1;
5126 struct
5128 unsigned : 1;
5129 unsigned : 1;
5130 unsigned R : 1;
5131 unsigned : 1;
5132 unsigned : 1;
5133 unsigned D : 1;
5134 unsigned : 1;
5135 unsigned : 1;
5137 } __SSPSTATbits_t;
5139 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
5141 #define _SSPSTAT_BF 0x01
5142 #define _SSPSTAT_UA 0x02
5143 #define _SSPSTAT_R_NOT_W 0x04
5144 #define _SSPSTAT_R_W 0x04
5145 #define _SSPSTAT_I2C_READ 0x04
5146 #define _SSPSTAT_NOT_W 0x04
5147 #define _SSPSTAT_NOT_WRITE 0x04
5148 #define _SSPSTAT_READ_WRITE 0x04
5149 #define _SSPSTAT_R 0x04
5150 #define _SSPSTAT_S 0x08
5151 #define _SSPSTAT_I2C_START 0x08
5152 #define _SSPSTAT_P 0x10
5153 #define _SSPSTAT_I2C_STOP 0x10
5154 #define _SSPSTAT_D_NOT_A 0x20
5155 #define _SSPSTAT_D_A 0x20
5156 #define _SSPSTAT_I2C_DAT 0x20
5157 #define _SSPSTAT_NOT_A 0x20
5158 #define _SSPSTAT_NOT_ADDRESS 0x20
5159 #define _SSPSTAT_DATA_ADDRESS 0x20
5160 #define _SSPSTAT_D 0x20
5161 #define _SSPSTAT_CKE 0x40
5162 #define _SSPSTAT_SMP 0x80
5164 //==============================================================================
5166 extern __at(0x0FC8) __sfr SSP1ADD;
5167 extern __at(0x0FC8) __sfr SSPADD;
5168 extern __at(0x0FC9) __sfr SSP1BUF;
5169 extern __at(0x0FC9) __sfr SSPBUF;
5171 //==============================================================================
5172 // T2CON Bits
5174 extern __at(0x0FCA) __sfr T2CON;
5176 typedef union
5178 struct
5180 unsigned T2CKPS0 : 1;
5181 unsigned T2CKPS1 : 1;
5182 unsigned TMR2ON : 1;
5183 unsigned T2OUTPS0 : 1;
5184 unsigned T2OUTPS1 : 1;
5185 unsigned T2OUTPS2 : 1;
5186 unsigned T2OUTPS3 : 1;
5187 unsigned : 1;
5190 struct
5192 unsigned T2CKPS : 2;
5193 unsigned : 6;
5196 struct
5198 unsigned : 3;
5199 unsigned T2OUTPS : 4;
5200 unsigned : 1;
5202 } __T2CONbits_t;
5204 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
5206 #define _T2CKPS0 0x01
5207 #define _T2CKPS1 0x02
5208 #define _TMR2ON 0x04
5209 #define _T2OUTPS0 0x08
5210 #define _T2OUTPS1 0x10
5211 #define _T2OUTPS2 0x20
5212 #define _T2OUTPS3 0x40
5214 //==============================================================================
5216 extern __at(0x0FCB) __sfr PR2;
5217 extern __at(0x0FCC) __sfr TMR2;
5219 //==============================================================================
5220 // T1CON Bits
5222 extern __at(0x0FCD) __sfr T1CON;
5224 typedef union
5226 struct
5228 unsigned TMR1ON : 1;
5229 unsigned TMR1CS : 1;
5230 unsigned NOT_T1SYNC : 1;
5231 unsigned T1OSCEN : 1;
5232 unsigned T1CKPS0 : 1;
5233 unsigned T1CKPS1 : 1;
5234 unsigned T1RUN : 1;
5235 unsigned RD16 : 1;
5238 struct
5240 unsigned : 1;
5241 unsigned : 1;
5242 unsigned T1SYNC : 1;
5243 unsigned : 1;
5244 unsigned : 1;
5245 unsigned : 1;
5246 unsigned : 1;
5247 unsigned : 1;
5250 struct
5252 unsigned : 1;
5253 unsigned : 1;
5254 unsigned T1INSYNC : 1;
5255 unsigned : 1;
5256 unsigned : 1;
5257 unsigned : 1;
5258 unsigned : 1;
5259 unsigned : 1;
5262 struct
5264 unsigned : 4;
5265 unsigned T1CKPS : 2;
5266 unsigned : 2;
5268 } __T1CONbits_t;
5270 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
5272 #define _TMR1ON 0x01
5273 #define _TMR1CS 0x02
5274 #define _NOT_T1SYNC 0x04
5275 #define _T1SYNC 0x04
5276 #define _T1INSYNC 0x04
5277 #define _T1OSCEN 0x08
5278 #define _T1CKPS0 0x10
5279 #define _T1CKPS1 0x20
5280 #define _T1RUN 0x40
5281 #define _RD16 0x80
5283 //==============================================================================
5285 extern __at(0x0FCE) __sfr TMR1;
5286 extern __at(0x0FCE) __sfr TMR1L;
5287 extern __at(0x0FCF) __sfr TMR1H;
5289 //==============================================================================
5290 // RCON Bits
5292 extern __at(0x0FD0) __sfr RCON;
5294 typedef union
5296 struct
5298 unsigned NOT_BOR : 1;
5299 unsigned NOT_POR : 1;
5300 unsigned NOT_PD : 1;
5301 unsigned NOT_TO : 1;
5302 unsigned NOT_RI : 1;
5303 unsigned : 1;
5304 unsigned : 1;
5305 unsigned IPEN : 1;
5308 struct
5310 unsigned BOR : 1;
5311 unsigned POR : 1;
5312 unsigned PD : 1;
5313 unsigned TO : 1;
5314 unsigned RI : 1;
5315 unsigned : 1;
5316 unsigned : 1;
5317 unsigned : 1;
5319 } __RCONbits_t;
5321 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
5323 #define _NOT_BOR 0x01
5324 #define _BOR 0x01
5325 #define _NOT_POR 0x02
5326 #define _POR 0x02
5327 #define _NOT_PD 0x04
5328 #define _PD 0x04
5329 #define _NOT_TO 0x08
5330 #define _TO 0x08
5331 #define _NOT_RI 0x10
5332 #define _RI 0x10
5333 #define _IPEN 0x80
5335 //==============================================================================
5338 //==============================================================================
5339 // WDTCON Bits
5341 extern __at(0x0FD1) __sfr WDTCON;
5343 typedef union
5345 struct
5347 unsigned SWDTEN : 1;
5348 unsigned : 1;
5349 unsigned : 1;
5350 unsigned : 1;
5351 unsigned : 1;
5352 unsigned : 1;
5353 unsigned : 1;
5354 unsigned : 1;
5357 struct
5359 unsigned SWDTE : 1;
5360 unsigned : 1;
5361 unsigned : 1;
5362 unsigned : 1;
5363 unsigned : 1;
5364 unsigned : 1;
5365 unsigned : 1;
5366 unsigned : 1;
5368 } __WDTCONbits_t;
5370 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
5372 #define _SWDTEN 0x01
5373 #define _SWDTE 0x01
5375 //==============================================================================
5378 //==============================================================================
5379 // OSCCON Bits
5381 extern __at(0x0FD3) __sfr OSCCON;
5383 typedef union
5385 struct
5387 unsigned SCS0 : 1;
5388 unsigned SCS1 : 1;
5389 unsigned : 1;
5390 unsigned OSTS : 1;
5391 unsigned : 1;
5392 unsigned : 1;
5393 unsigned : 1;
5394 unsigned IDLEN : 1;
5397 struct
5399 unsigned SCS : 2;
5400 unsigned : 6;
5402 } __OSCCONbits_t;
5404 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
5406 #define _SCS0 0x01
5407 #define _SCS1 0x02
5408 #define _OSTS 0x08
5409 #define _IDLEN 0x80
5411 //==============================================================================
5414 //==============================================================================
5415 // T0CON Bits
5417 extern __at(0x0FD5) __sfr T0CON;
5419 typedef union
5421 struct
5423 unsigned T0PS0 : 1;
5424 unsigned T0PS1 : 1;
5425 unsigned T0PS2 : 1;
5426 unsigned PSA : 1;
5427 unsigned T0SE : 1;
5428 unsigned T0CS : 1;
5429 unsigned T08BIT : 1;
5430 unsigned TMR0ON : 1;
5433 struct
5435 unsigned : 1;
5436 unsigned : 1;
5437 unsigned : 1;
5438 unsigned T0PS3 : 1;
5439 unsigned : 1;
5440 unsigned : 1;
5441 unsigned : 1;
5442 unsigned : 1;
5445 struct
5447 unsigned T0PS : 4;
5448 unsigned : 4;
5450 } __T0CONbits_t;
5452 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
5454 #define _T0PS0 0x01
5455 #define _T0PS1 0x02
5456 #define _T0PS2 0x04
5457 #define _PSA 0x08
5458 #define _T0PS3 0x08
5459 #define _T0SE 0x10
5460 #define _T0CS 0x20
5461 #define _T08BIT 0x40
5462 #define _TMR0ON 0x80
5464 //==============================================================================
5466 extern __at(0x0FD6) __sfr TMR0;
5467 extern __at(0x0FD6) __sfr TMR0L;
5468 extern __at(0x0FD7) __sfr TMR0H;
5470 //==============================================================================
5471 // STATUS Bits
5473 extern __at(0x0FD8) __sfr STATUS;
5475 typedef struct
5477 unsigned C : 1;
5478 unsigned DC : 1;
5479 unsigned Z : 1;
5480 unsigned OV : 1;
5481 unsigned N : 1;
5482 unsigned : 1;
5483 unsigned : 1;
5484 unsigned : 1;
5485 } __STATUSbits_t;
5487 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
5489 #define _C 0x01
5490 #define _DC 0x02
5491 #define _Z 0x04
5492 #define _OV 0x08
5493 #define _N 0x10
5495 //==============================================================================
5497 extern __at(0x0FD9) __sfr FSR2L;
5498 extern __at(0x0FDA) __sfr FSR2H;
5499 extern __at(0x0FDB) __sfr PLUSW2;
5500 extern __at(0x0FDC) __sfr PREINC2;
5501 extern __at(0x0FDD) __sfr POSTDEC2;
5502 extern __at(0x0FDE) __sfr POSTINC2;
5503 extern __at(0x0FDF) __sfr INDF2;
5504 extern __at(0x0FE0) __sfr BSR;
5505 extern __at(0x0FE1) __sfr FSR1L;
5506 extern __at(0x0FE2) __sfr FSR1H;
5507 extern __at(0x0FE3) __sfr PLUSW1;
5508 extern __at(0x0FE4) __sfr PREINC1;
5509 extern __at(0x0FE5) __sfr POSTDEC1;
5510 extern __at(0x0FE6) __sfr POSTINC1;
5511 extern __at(0x0FE7) __sfr INDF1;
5512 extern __at(0x0FE8) __sfr WREG;
5513 extern __at(0x0FE9) __sfr FSR0L;
5514 extern __at(0x0FEA) __sfr FSR0H;
5515 extern __at(0x0FEB) __sfr PLUSW0;
5516 extern __at(0x0FEC) __sfr PREINC0;
5517 extern __at(0x0FED) __sfr POSTDEC0;
5518 extern __at(0x0FEE) __sfr POSTINC0;
5519 extern __at(0x0FEF) __sfr INDF0;
5521 //==============================================================================
5522 // INTCON3 Bits
5524 extern __at(0x0FF0) __sfr INTCON3;
5526 typedef union
5528 struct
5530 unsigned INT1IF : 1;
5531 unsigned INT2IF : 1;
5532 unsigned INT3IF : 1;
5533 unsigned INT1IE : 1;
5534 unsigned INT2IE : 1;
5535 unsigned INT3IE : 1;
5536 unsigned INT1IP : 1;
5537 unsigned INT2IP : 1;
5540 struct
5542 unsigned INT1F : 1;
5543 unsigned INT2F : 1;
5544 unsigned INT3F : 1;
5545 unsigned INT1E : 1;
5546 unsigned INT2E : 1;
5547 unsigned INT3E : 1;
5548 unsigned INT1P : 1;
5549 unsigned INT2P : 1;
5551 } __INTCON3bits_t;
5553 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
5555 #define _INT1IF 0x01
5556 #define _INT1F 0x01
5557 #define _INT2IF 0x02
5558 #define _INT2F 0x02
5559 #define _INT3IF 0x04
5560 #define _INT3F 0x04
5561 #define _INT1IE 0x08
5562 #define _INT1E 0x08
5563 #define _INT2IE 0x10
5564 #define _INT2E 0x10
5565 #define _INT3IE 0x20
5566 #define _INT3E 0x20
5567 #define _INT1IP 0x40
5568 #define _INT1P 0x40
5569 #define _INT2IP 0x80
5570 #define _INT2P 0x80
5572 //==============================================================================
5575 //==============================================================================
5576 // INTCON2 Bits
5578 extern __at(0x0FF1) __sfr INTCON2;
5580 typedef union
5582 struct
5584 unsigned RBIP : 1;
5585 unsigned INT3IP : 1;
5586 unsigned TMR0IP : 1;
5587 unsigned INTEDG3 : 1;
5588 unsigned INTEDG2 : 1;
5589 unsigned INTEDG1 : 1;
5590 unsigned INTEDG0 : 1;
5591 unsigned NOT_RBPU : 1;
5594 struct
5596 unsigned : 1;
5597 unsigned INT3P : 1;
5598 unsigned T0IP : 1;
5599 unsigned : 1;
5600 unsigned : 1;
5601 unsigned : 1;
5602 unsigned : 1;
5603 unsigned RBPU : 1;
5605 } __INTCON2bits_t;
5607 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
5609 #define _RBIP 0x01
5610 #define _INT3IP 0x02
5611 #define _INT3P 0x02
5612 #define _TMR0IP 0x04
5613 #define _T0IP 0x04
5614 #define _INTEDG3 0x08
5615 #define _INTEDG2 0x10
5616 #define _INTEDG1 0x20
5617 #define _INTEDG0 0x40
5618 #define _NOT_RBPU 0x80
5619 #define _RBPU 0x80
5621 //==============================================================================
5624 //==============================================================================
5625 // INTCON Bits
5627 extern __at(0x0FF2) __sfr INTCON;
5629 typedef union
5631 struct
5633 unsigned RBIF : 1;
5634 unsigned INT0IF : 1;
5635 unsigned TMR0IF : 1;
5636 unsigned RBIE : 1;
5637 unsigned INT0IE : 1;
5638 unsigned TMR0IE : 1;
5639 unsigned PEIE_GIEL : 1;
5640 unsigned GIE_GIEH : 1;
5643 struct
5645 unsigned : 1;
5646 unsigned INT0F : 1;
5647 unsigned T0IF : 1;
5648 unsigned : 1;
5649 unsigned INT0E : 1;
5650 unsigned T0IE : 1;
5651 unsigned PEIE : 1;
5652 unsigned GIE : 1;
5655 struct
5657 unsigned : 1;
5658 unsigned : 1;
5659 unsigned : 1;
5660 unsigned : 1;
5661 unsigned : 1;
5662 unsigned : 1;
5663 unsigned GIEL : 1;
5664 unsigned GIEH : 1;
5666 } __INTCONbits_t;
5668 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
5670 #define _RBIF 0x01
5671 #define _INT0IF 0x02
5672 #define _INT0F 0x02
5673 #define _TMR0IF 0x04
5674 #define _T0IF 0x04
5675 #define _RBIE 0x08
5676 #define _INT0IE 0x10
5677 #define _INT0E 0x10
5678 #define _TMR0IE 0x20
5679 #define _T0IE 0x20
5680 #define _PEIE_GIEL 0x40
5681 #define _PEIE 0x40
5682 #define _GIEL 0x40
5683 #define _GIE_GIEH 0x80
5684 #define _GIE 0x80
5685 #define _GIEH 0x80
5687 //==============================================================================
5689 extern __at(0x0FF3) __sfr PROD;
5690 extern __at(0x0FF3) __sfr PRODL;
5691 extern __at(0x0FF4) __sfr PRODH;
5692 extern __at(0x0FF5) __sfr TABLAT;
5693 extern __at(0x0FF6) __sfr TBLPTR;
5694 extern __at(0x0FF6) __sfr TBLPTRL;
5695 extern __at(0x0FF7) __sfr TBLPTRH;
5696 extern __at(0x0FF8) __sfr TBLPTRU;
5697 extern __at(0x0FF9) __sfr PC;
5698 extern __at(0x0FF9) __sfr PCL;
5699 extern __at(0x0FFA) __sfr PCLATH;
5700 extern __at(0x0FFB) __sfr PCLATU;
5702 //==============================================================================
5703 // STKPTR Bits
5705 extern __at(0x0FFC) __sfr STKPTR;
5707 typedef union
5709 struct
5711 unsigned STKPTR0 : 1;
5712 unsigned STKPTR1 : 1;
5713 unsigned STKPTR2 : 1;
5714 unsigned STKPTR3 : 1;
5715 unsigned STKPTR4 : 1;
5716 unsigned : 1;
5717 unsigned STKUNF : 1;
5718 unsigned STKFUL : 1;
5721 struct
5723 unsigned SP0 : 1;
5724 unsigned SP1 : 1;
5725 unsigned SP2 : 1;
5726 unsigned SP3 : 1;
5727 unsigned SP4 : 1;
5728 unsigned : 1;
5729 unsigned : 1;
5730 unsigned STKOVF : 1;
5733 struct
5735 unsigned STKPTR : 5;
5736 unsigned : 3;
5739 struct
5741 unsigned SP : 5;
5742 unsigned : 3;
5744 } __STKPTRbits_t;
5746 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
5748 #define _STKPTR0 0x01
5749 #define _SP0 0x01
5750 #define _STKPTR1 0x02
5751 #define _SP1 0x02
5752 #define _STKPTR2 0x04
5753 #define _SP2 0x04
5754 #define _STKPTR3 0x08
5755 #define _SP3 0x08
5756 #define _STKPTR4 0x10
5757 #define _SP4 0x10
5758 #define _STKUNF 0x40
5759 #define _STKFUL 0x80
5760 #define _STKOVF 0x80
5762 //==============================================================================
5764 extern __at(0x0FFD) __sfr TOS;
5765 extern __at(0x0FFD) __sfr TOSL;
5766 extern __at(0x0FFE) __sfr TOSH;
5767 extern __at(0x0FFF) __sfr TOSU;
5769 //==============================================================================
5771 // Configuration Addresses
5773 //==============================================================================
5775 #define __CONFIG1L 0x01FFF8
5776 #define __CONFIG1H 0x01FFF9
5777 #define __CONFIG2L 0x01FFFA
5778 #define __CONFIG2H 0x01FFFB
5779 #define __CONFIG3L 0x01FFFC
5780 #define __CONFIG3H 0x01FFFD
5782 //==============================================================================
5784 #endif // #ifndef __PIC18F87J10_H__