Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f87k22.h
blobbf2e93559f0f23ce9f29ef99738d2f10c6ce9668
1 /*
2 * This declarations of the PIC18F87K22 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:40 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 __PIC18F87K22_H__
26 #define __PIC18F87K22_H__
28 //==============================================================================
30 //==============================================================================
32 // Register Definitions
34 //==============================================================================
37 //==============================================================================
38 // PMD3 Bits
40 extern __at(0x0F16) __sfr PMD3;
42 typedef struct
44 unsigned TMR12MD : 1;
45 unsigned CCP4MD : 1;
46 unsigned CCP5MD : 1;
47 unsigned CCP6MD : 1;
48 unsigned CCP7MD : 1;
49 unsigned CCP8MD : 1;
50 unsigned CCP9MD : 1;
51 unsigned CCP10MD : 1;
52 } __PMD3bits_t;
54 extern __at(0x0F16) volatile __PMD3bits_t PMD3bits;
56 #define _TMR12MD 0x01
57 #define _CCP4MD 0x02
58 #define _CCP5MD 0x04
59 #define _CCP6MD 0x08
60 #define _CCP7MD 0x10
61 #define _CCP8MD 0x20
62 #define _CCP9MD 0x40
63 #define _CCP10MD 0x80
65 //==============================================================================
68 //==============================================================================
69 // PMD2 Bits
71 extern __at(0x0F17) __sfr PMD2;
73 typedef struct
75 unsigned CMP1MD : 1;
76 unsigned CMP2MD : 1;
77 unsigned CMP3MD : 1;
78 unsigned TMR5MD : 1;
79 unsigned TMR6MD : 1;
80 unsigned TMR7MD : 1;
81 unsigned TMR8MD : 1;
82 unsigned TMR10MD : 1;
83 } __PMD2bits_t;
85 extern __at(0x0F17) volatile __PMD2bits_t PMD2bits;
87 #define _CMP1MD 0x01
88 #define _CMP2MD 0x02
89 #define _CMP3MD 0x04
90 #define _TMR5MD 0x08
91 #define _TMR6MD 0x10
92 #define _TMR7MD 0x20
93 #define _TMR8MD 0x40
94 #define _TMR10MD 0x80
96 //==============================================================================
99 //==============================================================================
100 // PMD1 Bits
102 extern __at(0x0F18) __sfr PMD1;
104 typedef struct
106 unsigned EMBMD : 1;
107 unsigned TMR1MD : 1;
108 unsigned TMR2MD : 1;
109 unsigned TMR3MD : 1;
110 unsigned TMR4MD : 1;
111 unsigned RTCCMD : 1;
112 unsigned CTMUMD : 1;
113 unsigned PSPMD : 1;
114 } __PMD1bits_t;
116 extern __at(0x0F18) volatile __PMD1bits_t PMD1bits;
118 #define _EMBMD 0x01
119 #define _TMR1MD 0x02
120 #define _TMR2MD 0x04
121 #define _TMR3MD 0x08
122 #define _TMR4MD 0x10
123 #define _RTCCMD 0x20
124 #define _CTMUMD 0x40
125 #define _PSPMD 0x80
127 //==============================================================================
130 //==============================================================================
131 // PMD0 Bits
133 extern __at(0x0F19) __sfr PMD0;
135 typedef struct
137 unsigned ADCMD : 1;
138 unsigned SSP1MD : 1;
139 unsigned SSP2MD : 1;
140 unsigned UART1MD : 1;
141 unsigned UART2MD : 1;
142 unsigned CCP1MD : 1;
143 unsigned CCP2MD : 1;
144 unsigned CCP3MD : 1;
145 } __PMD0bits_t;
147 extern __at(0x0F19) volatile __PMD0bits_t PMD0bits;
149 #define _ADCMD 0x01
150 #define _SSP1MD 0x02
151 #define _SSP2MD 0x04
152 #define _UART1MD 0x08
153 #define _UART2MD 0x10
154 #define _CCP1MD 0x20
155 #define _CCP2MD 0x40
156 #define _CCP3MD 0x80
158 //==============================================================================
161 //==============================================================================
162 // PSTR3CON Bits
164 extern __at(0x0F1A) __sfr PSTR3CON;
166 typedef union
168 struct
170 unsigned STRA : 1;
171 unsigned STRB : 1;
172 unsigned STRC : 1;
173 unsigned STRD : 1;
174 unsigned STRSYNC : 1;
175 unsigned : 1;
176 unsigned CMPL0 : 1;
177 unsigned CMPL1 : 1;
180 struct
182 unsigned : 6;
183 unsigned CMPL : 2;
185 } __PSTR3CONbits_t;
187 extern __at(0x0F1A) volatile __PSTR3CONbits_t PSTR3CONbits;
189 #define _PSTR3CON_STRA 0x01
190 #define _PSTR3CON_STRB 0x02
191 #define _PSTR3CON_STRC 0x04
192 #define _PSTR3CON_STRD 0x08
193 #define _PSTR3CON_STRSYNC 0x10
194 #define _PSTR3CON_CMPL0 0x40
195 #define _PSTR3CON_CMPL1 0x80
197 //==============================================================================
200 //==============================================================================
201 // PSTR2CON Bits
203 extern __at(0x0F1B) __sfr PSTR2CON;
205 typedef union
207 struct
209 unsigned STRA : 1;
210 unsigned STRB : 1;
211 unsigned STRC : 1;
212 unsigned STRD : 1;
213 unsigned STRSYNC : 1;
214 unsigned : 1;
215 unsigned CMPL0 : 1;
216 unsigned CMPL1 : 1;
219 struct
221 unsigned : 6;
222 unsigned CMPL : 2;
224 } __PSTR2CONbits_t;
226 extern __at(0x0F1B) volatile __PSTR2CONbits_t PSTR2CONbits;
228 #define _PSTR2CON_STRA 0x01
229 #define _PSTR2CON_STRB 0x02
230 #define _PSTR2CON_STRC 0x04
231 #define _PSTR2CON_STRD 0x08
232 #define _PSTR2CON_STRSYNC 0x10
233 #define _PSTR2CON_CMPL0 0x40
234 #define _PSTR2CON_CMPL1 0x80
236 //==============================================================================
238 extern __at(0x0F1C) __sfr TXREG2;
239 extern __at(0x0F1D) __sfr RCREG2;
240 extern __at(0x0F1E) __sfr SPBRG2;
241 extern __at(0x0F1F) __sfr SPBRGH2;
243 //==============================================================================
244 // BAUDCON2 Bits
246 extern __at(0x0F20) __sfr BAUDCON2;
248 typedef struct
250 unsigned ABDEN : 1;
251 unsigned WUE : 1;
252 unsigned : 1;
253 unsigned BRG16 : 1;
254 unsigned TXCKP : 1;
255 unsigned RXDTP : 1;
256 unsigned RCIDL : 1;
257 unsigned ABDOVF : 1;
258 } __BAUDCON2bits_t;
260 extern __at(0x0F20) volatile __BAUDCON2bits_t BAUDCON2bits;
262 #define _BAUDCON2_ABDEN 0x01
263 #define _BAUDCON2_WUE 0x02
264 #define _BAUDCON2_BRG16 0x08
265 #define _BAUDCON2_TXCKP 0x10
266 #define _BAUDCON2_RXDTP 0x20
267 #define _BAUDCON2_RCIDL 0x40
268 #define _BAUDCON2_ABDOVF 0x80
270 //==============================================================================
273 //==============================================================================
274 // TXSTA2 Bits
276 extern __at(0x0F21) __sfr TXSTA2;
278 typedef union
280 struct
282 unsigned TX9D : 1;
283 unsigned TRMT : 1;
284 unsigned BRGH : 1;
285 unsigned SENDB : 1;
286 unsigned SYNC : 1;
287 unsigned TXEN : 1;
288 unsigned TX9 : 1;
289 unsigned CSRC : 1;
292 struct
294 unsigned TX9D2 : 1;
295 unsigned TRMT2 : 1;
296 unsigned BRGH2 : 1;
297 unsigned SENDB2 : 1;
298 unsigned SYNC2 : 1;
299 unsigned TXEN2 : 1;
300 unsigned TX92 : 1;
301 unsigned CSRC2 : 1;
303 } __TXSTA2bits_t;
305 extern __at(0x0F21) volatile __TXSTA2bits_t TXSTA2bits;
307 #define _TXSTA2_TX9D 0x01
308 #define _TXSTA2_TX9D2 0x01
309 #define _TXSTA2_TRMT 0x02
310 #define _TXSTA2_TRMT2 0x02
311 #define _TXSTA2_BRGH 0x04
312 #define _TXSTA2_BRGH2 0x04
313 #define _TXSTA2_SENDB 0x08
314 #define _TXSTA2_SENDB2 0x08
315 #define _TXSTA2_SYNC 0x10
316 #define _TXSTA2_SYNC2 0x10
317 #define _TXSTA2_TXEN 0x20
318 #define _TXSTA2_TXEN2 0x20
319 #define _TXSTA2_TX9 0x40
320 #define _TXSTA2_TX92 0x40
321 #define _TXSTA2_CSRC 0x80
322 #define _TXSTA2_CSRC2 0x80
324 //==============================================================================
327 //==============================================================================
328 // RCSTA2 Bits
330 extern __at(0x0F22) __sfr RCSTA2;
332 typedef union
334 struct
336 unsigned RX9D : 1;
337 unsigned OERR : 1;
338 unsigned FERR : 1;
339 unsigned ADDEN : 1;
340 unsigned CREN : 1;
341 unsigned SREN : 1;
342 unsigned RX9 : 1;
343 unsigned SPEN : 1;
346 struct
348 unsigned RX9D2 : 1;
349 unsigned OERR2 : 1;
350 unsigned FERR2 : 1;
351 unsigned ADDEN2 : 1;
352 unsigned CREN2 : 1;
353 unsigned SREN2 : 1;
354 unsigned RX92 : 1;
355 unsigned SPEN2 : 1;
357 } __RCSTA2bits_t;
359 extern __at(0x0F22) volatile __RCSTA2bits_t RCSTA2bits;
361 #define _RCSTA2_RX9D 0x01
362 #define _RCSTA2_RX9D2 0x01
363 #define _RCSTA2_OERR 0x02
364 #define _RCSTA2_OERR2 0x02
365 #define _RCSTA2_FERR 0x04
366 #define _RCSTA2_FERR2 0x04
367 #define _RCSTA2_ADDEN 0x08
368 #define _RCSTA2_ADDEN2 0x08
369 #define _RCSTA2_CREN 0x10
370 #define _RCSTA2_CREN2 0x10
371 #define _RCSTA2_SREN 0x20
372 #define _RCSTA2_SREN2 0x20
373 #define _RCSTA2_RX9 0x40
374 #define _RCSTA2_RX92 0x40
375 #define _RCSTA2_SPEN 0x80
376 #define _RCSTA2_SPEN2 0x80
378 //==============================================================================
381 //==============================================================================
382 // ANCON2 Bits
384 extern __at(0x0F23) __sfr ANCON2;
386 typedef struct
388 unsigned ANSEL16 : 1;
389 unsigned ANSEL17 : 1;
390 unsigned ANSEL18 : 1;
391 unsigned ANSEL19 : 1;
392 unsigned ANSEL20 : 1;
393 unsigned ANSEL21 : 1;
394 unsigned ANSEL22 : 1;
395 unsigned ANSEL23 : 1;
396 } __ANCON2bits_t;
398 extern __at(0x0F23) volatile __ANCON2bits_t ANCON2bits;
400 #define _ANSEL16 0x01
401 #define _ANSEL17 0x02
402 #define _ANSEL18 0x04
403 #define _ANSEL19 0x08
404 #define _ANSEL20 0x10
405 #define _ANSEL21 0x20
406 #define _ANSEL22 0x40
407 #define _ANSEL23 0x80
409 //==============================================================================
412 //==============================================================================
413 // ANCON1 Bits
415 extern __at(0x0F24) __sfr ANCON1;
417 typedef struct
419 unsigned ANSEL8 : 1;
420 unsigned ANSEL9 : 1;
421 unsigned ANSEL10 : 1;
422 unsigned ANSEL11 : 1;
423 unsigned ANSEL12 : 1;
424 unsigned ANSEL13 : 1;
425 unsigned ANSEL14 : 1;
426 unsigned ANSEL15 : 1;
427 } __ANCON1bits_t;
429 extern __at(0x0F24) volatile __ANCON1bits_t ANCON1bits;
431 #define _ANSEL8 0x01
432 #define _ANSEL9 0x02
433 #define _ANSEL10 0x04
434 #define _ANSEL11 0x08
435 #define _ANSEL12 0x10
436 #define _ANSEL13 0x20
437 #define _ANSEL14 0x40
438 #define _ANSEL15 0x80
440 //==============================================================================
443 //==============================================================================
444 // ANCON0 Bits
446 extern __at(0x0F25) __sfr ANCON0;
448 typedef struct
450 unsigned ANSEL0 : 1;
451 unsigned ANSEL1 : 1;
452 unsigned ANSEL2 : 1;
453 unsigned ANSEL3 : 1;
454 unsigned ANSEL4 : 1;
455 unsigned ANSEL5 : 1;
456 unsigned ANSEL6 : 1;
457 unsigned ANSEL7 : 1;
458 } __ANCON0bits_t;
460 extern __at(0x0F25) volatile __ANCON0bits_t ANCON0bits;
462 #define _ANSEL0 0x01
463 #define _ANSEL1 0x02
464 #define _ANSEL2 0x04
465 #define _ANSEL3 0x08
466 #define _ANSEL4 0x10
467 #define _ANSEL5 0x20
468 #define _ANSEL6 0x40
469 #define _ANSEL7 0x80
471 //==============================================================================
474 //==============================================================================
475 // MEMCON Bits
477 extern __at(0x0F26) __sfr MEMCON;
479 typedef union
481 struct
483 unsigned WM0 : 1;
484 unsigned WM1 : 1;
485 unsigned : 1;
486 unsigned : 1;
487 unsigned WAIT0 : 1;
488 unsigned WAIT1 : 1;
489 unsigned : 1;
490 unsigned EBDIS : 1;
493 struct
495 unsigned WM : 2;
496 unsigned : 6;
499 struct
501 unsigned : 4;
502 unsigned WAIT : 2;
503 unsigned : 2;
505 } __MEMCONbits_t;
507 extern __at(0x0F26) volatile __MEMCONbits_t MEMCONbits;
509 #define _WM0 0x01
510 #define _WM1 0x02
511 #define _WAIT0 0x10
512 #define _WAIT1 0x20
513 #define _EBDIS 0x80
515 //==============================================================================
518 //==============================================================================
519 // ODCON3 Bits
521 extern __at(0x0F27) __sfr ODCON3;
523 typedef struct
525 unsigned CTMUDS : 1;
526 unsigned : 1;
527 unsigned : 1;
528 unsigned : 1;
529 unsigned : 1;
530 unsigned : 1;
531 unsigned U1OD : 1;
532 unsigned U2OD : 1;
533 } __ODCON3bits_t;
535 extern __at(0x0F27) volatile __ODCON3bits_t ODCON3bits;
537 #define _CTMUDS 0x01
538 #define _U1OD 0x40
539 #define _U2OD 0x80
541 //==============================================================================
544 //==============================================================================
545 // ODCON2 Bits
547 extern __at(0x0F28) __sfr ODCON2;
549 typedef struct
551 unsigned CCP3OD : 1;
552 unsigned CCP4OD : 1;
553 unsigned CCP5OD : 1;
554 unsigned CCP6OD : 1;
555 unsigned CCP7OD : 1;
556 unsigned CCP8OD : 1;
557 unsigned CCP9OD : 1;
558 unsigned CCP10OD : 1;
559 } __ODCON2bits_t;
561 extern __at(0x0F28) volatile __ODCON2bits_t ODCON2bits;
563 #define _CCP3OD 0x01
564 #define _CCP4OD 0x02
565 #define _CCP5OD 0x04
566 #define _CCP6OD 0x08
567 #define _CCP7OD 0x10
568 #define _CCP8OD 0x20
569 #define _CCP9OD 0x40
570 #define _CCP10OD 0x80
572 //==============================================================================
575 //==============================================================================
576 // ODCON1 Bits
578 extern __at(0x0F29) __sfr ODCON1;
580 typedef struct
582 unsigned SPI2OD : 1;
583 unsigned : 1;
584 unsigned : 1;
585 unsigned : 1;
586 unsigned : 1;
587 unsigned CCP1OD : 1;
588 unsigned CCP2OD : 1;
589 unsigned SPI1OD : 1;
590 } __ODCON1bits_t;
592 extern __at(0x0F29) volatile __ODCON1bits_t ODCON1bits;
594 #define _SPI2OD 0x01
595 #define _CCP1OD 0x20
596 #define _CCP2OD 0x40
597 #define _SPI1OD 0x80
599 //==============================================================================
602 //==============================================================================
603 // REFOCON Bits
605 extern __at(0x0F2A) __sfr REFOCON;
607 typedef union
609 struct
611 unsigned RODIV0 : 1;
612 unsigned RODIV1 : 1;
613 unsigned RODIV2 : 1;
614 unsigned RODIV3 : 1;
615 unsigned ROSEL : 1;
616 unsigned ROSSLP : 1;
617 unsigned : 1;
618 unsigned ROON : 1;
621 struct
623 unsigned RODIV : 4;
624 unsigned : 4;
626 } __REFOCONbits_t;
628 extern __at(0x0F2A) volatile __REFOCONbits_t REFOCONbits;
630 #define _RODIV0 0x01
631 #define _RODIV1 0x02
632 #define _RODIV2 0x04
633 #define _RODIV3 0x08
634 #define _ROSEL 0x10
635 #define _ROSSLP 0x20
636 #define _ROON 0x80
638 //==============================================================================
641 //==============================================================================
642 // CCPTMRS2 Bits
644 extern __at(0x0F2B) __sfr CCPTMRS2;
646 typedef union
648 struct
650 unsigned C8TSEL0 : 1;
651 unsigned C8TSEL1 : 1;
652 unsigned C9TSEL0 : 1;
653 unsigned : 1;
654 unsigned C10TSEL0 : 1;
655 unsigned : 1;
656 unsigned : 1;
657 unsigned : 1;
660 struct
662 unsigned C8TSEL : 2;
663 unsigned : 6;
665 } __CCPTMRS2bits_t;
667 extern __at(0x0F2B) volatile __CCPTMRS2bits_t CCPTMRS2bits;
669 #define _C8TSEL0 0x01
670 #define _C8TSEL1 0x02
671 #define _C9TSEL0 0x04
672 #define _C10TSEL0 0x10
674 //==============================================================================
677 //==============================================================================
678 // CCPTMRS1 Bits
680 extern __at(0x0F2C) __sfr CCPTMRS1;
682 typedef union
684 struct
686 unsigned C4TSEL0 : 1;
687 unsigned C4TSEL1 : 1;
688 unsigned C5TSEL0 : 1;
689 unsigned : 1;
690 unsigned C6TSEL0 : 1;
691 unsigned : 1;
692 unsigned C7TSEL0 : 1;
693 unsigned C7TSEL1 : 1;
696 struct
698 unsigned C4TSEL : 2;
699 unsigned : 6;
702 struct
704 unsigned : 6;
705 unsigned C7TSEL : 2;
707 } __CCPTMRS1bits_t;
709 extern __at(0x0F2C) volatile __CCPTMRS1bits_t CCPTMRS1bits;
711 #define _C4TSEL0 0x01
712 #define _C4TSEL1 0x02
713 #define _C5TSEL0 0x04
714 #define _C6TSEL0 0x10
715 #define _C7TSEL0 0x40
716 #define _C7TSEL1 0x80
718 //==============================================================================
721 //==============================================================================
722 // CCPTMRS0 Bits
724 extern __at(0x0F2D) __sfr CCPTMRS0;
726 typedef union
728 struct
730 unsigned C1TSEL0 : 1;
731 unsigned C1TSEL1 : 1;
732 unsigned C1TSEL2 : 1;
733 unsigned C2TSEL0 : 1;
734 unsigned C2TSEL1 : 1;
735 unsigned C2TSEL2 : 1;
736 unsigned C3TSEL0 : 1;
737 unsigned C3TSEL1 : 1;
740 struct
742 unsigned C1TSEL : 3;
743 unsigned : 5;
746 struct
748 unsigned : 3;
749 unsigned C2TSEL : 3;
750 unsigned : 2;
753 struct
755 unsigned : 6;
756 unsigned C3TSEL : 2;
758 } __CCPTMRS0bits_t;
760 extern __at(0x0F2D) volatile __CCPTMRS0bits_t CCPTMRS0bits;
762 #define _C1TSEL0 0x01
763 #define _C1TSEL1 0x02
764 #define _C1TSEL2 0x04
765 #define _C2TSEL0 0x08
766 #define _C2TSEL1 0x10
767 #define _C2TSEL2 0x20
768 #define _C3TSEL0 0x40
769 #define _C3TSEL1 0x80
771 //==============================================================================
774 //==============================================================================
775 // CM3CON Bits
777 extern __at(0x0F2E) __sfr CM3CON;
779 typedef union
781 struct
783 unsigned CCH0 : 1;
784 unsigned CCH1 : 1;
785 unsigned CREF : 1;
786 unsigned EVPOL0 : 1;
787 unsigned EVPOL1 : 1;
788 unsigned CPOL : 1;
789 unsigned COE : 1;
790 unsigned CON : 1;
793 struct
795 unsigned CCH : 2;
796 unsigned : 6;
799 struct
801 unsigned : 3;
802 unsigned EVPOL : 2;
803 unsigned : 3;
805 } __CM3CONbits_t;
807 extern __at(0x0F2E) volatile __CM3CONbits_t CM3CONbits;
809 #define _CM3CON_CCH0 0x01
810 #define _CM3CON_CCH1 0x02
811 #define _CM3CON_CREF 0x04
812 #define _CM3CON_EVPOL0 0x08
813 #define _CM3CON_EVPOL1 0x10
814 #define _CM3CON_CPOL 0x20
815 #define _CM3CON_COE 0x40
816 #define _CM3CON_CON 0x80
818 //==============================================================================
821 //==============================================================================
822 // CM3CON1 Bits
824 extern __at(0x0F2E) __sfr CM3CON1;
826 typedef union
828 struct
830 unsigned CCH0 : 1;
831 unsigned CCH1 : 1;
832 unsigned CREF : 1;
833 unsigned EVPOL0 : 1;
834 unsigned EVPOL1 : 1;
835 unsigned CPOL : 1;
836 unsigned COE : 1;
837 unsigned CON : 1;
840 struct
842 unsigned CCH : 2;
843 unsigned : 6;
846 struct
848 unsigned : 3;
849 unsigned EVPOL : 2;
850 unsigned : 3;
852 } __CM3CON1bits_t;
854 extern __at(0x0F2E) volatile __CM3CON1bits_t CM3CON1bits;
856 #define _CM3CON1_CCH0 0x01
857 #define _CM3CON1_CCH1 0x02
858 #define _CM3CON1_CREF 0x04
859 #define _CM3CON1_EVPOL0 0x08
860 #define _CM3CON1_EVPOL1 0x10
861 #define _CM3CON1_CPOL 0x20
862 #define _CM3CON1_COE 0x40
863 #define _CM3CON1_CON 0x80
865 //==============================================================================
868 //==============================================================================
869 // CM2CON Bits
871 extern __at(0x0F2F) __sfr CM2CON;
873 typedef union
875 struct
877 unsigned CCH0 : 1;
878 unsigned CCH1 : 1;
879 unsigned CREF : 1;
880 unsigned EVPOL0 : 1;
881 unsigned EVPOL1 : 1;
882 unsigned CPOL : 1;
883 unsigned COE : 1;
884 unsigned CON : 1;
887 struct
889 unsigned CCH : 2;
890 unsigned : 6;
893 struct
895 unsigned : 3;
896 unsigned EVPOL : 2;
897 unsigned : 3;
899 } __CM2CONbits_t;
901 extern __at(0x0F2F) volatile __CM2CONbits_t CM2CONbits;
903 #define _CM2CON_CCH0 0x01
904 #define _CM2CON_CCH1 0x02
905 #define _CM2CON_CREF 0x04
906 #define _CM2CON_EVPOL0 0x08
907 #define _CM2CON_EVPOL1 0x10
908 #define _CM2CON_CPOL 0x20
909 #define _CM2CON_COE 0x40
910 #define _CM2CON_CON 0x80
912 //==============================================================================
915 //==============================================================================
916 // CM2CON1 Bits
918 extern __at(0x0F2F) __sfr CM2CON1;
920 typedef union
922 struct
924 unsigned CCH0 : 1;
925 unsigned CCH1 : 1;
926 unsigned CREF : 1;
927 unsigned EVPOL0 : 1;
928 unsigned EVPOL1 : 1;
929 unsigned CPOL : 1;
930 unsigned COE : 1;
931 unsigned CON : 1;
934 struct
936 unsigned CCH : 2;
937 unsigned : 6;
940 struct
942 unsigned : 3;
943 unsigned EVPOL : 2;
944 unsigned : 3;
946 } __CM2CON1bits_t;
948 extern __at(0x0F2F) volatile __CM2CON1bits_t CM2CON1bits;
950 #define _CM2CON1_CCH0 0x01
951 #define _CM2CON1_CCH1 0x02
952 #define _CM2CON1_CREF 0x04
953 #define _CM2CON1_EVPOL0 0x08
954 #define _CM2CON1_EVPOL1 0x10
955 #define _CM2CON1_CPOL 0x20
956 #define _CM2CON1_COE 0x40
957 #define _CM2CON1_CON 0x80
959 //==============================================================================
962 //==============================================================================
963 // T12CON Bits
965 extern __at(0x0F30) __sfr T12CON;
967 typedef union
969 struct
971 unsigned T12CKPS0 : 1;
972 unsigned T12CKPS1 : 1;
973 unsigned TMR12ON : 1;
974 unsigned T12OUTPS0 : 1;
975 unsigned T12OUTPS1 : 1;
976 unsigned T12OUTPS2 : 1;
977 unsigned T12OUTPS3 : 1;
978 unsigned : 1;
981 struct
983 unsigned T12CKPS : 2;
984 unsigned : 6;
987 struct
989 unsigned : 3;
990 unsigned T12OUTPS : 4;
991 unsigned : 1;
993 } __T12CONbits_t;
995 extern __at(0x0F30) volatile __T12CONbits_t T12CONbits;
997 #define _T12CKPS0 0x01
998 #define _T12CKPS1 0x02
999 #define _TMR12ON 0x04
1000 #define _T12OUTPS0 0x08
1001 #define _T12OUTPS1 0x10
1002 #define _T12OUTPS2 0x20
1003 #define _T12OUTPS3 0x40
1005 //==============================================================================
1007 extern __at(0x0F31) __sfr PR12;
1008 extern __at(0x0F32) __sfr TMR12;
1010 //==============================================================================
1011 // T10CON Bits
1013 extern __at(0x0F33) __sfr T10CON;
1015 typedef union
1017 struct
1019 unsigned T10CKPS0 : 1;
1020 unsigned T10CKPS1 : 1;
1021 unsigned TMR10ON : 1;
1022 unsigned T10OUTPS0 : 1;
1023 unsigned T10OUTPS1 : 1;
1024 unsigned T10OUTPS2 : 1;
1025 unsigned T10OUTPS3 : 1;
1026 unsigned : 1;
1029 struct
1031 unsigned T10CKPS : 2;
1032 unsigned : 6;
1035 struct
1037 unsigned : 3;
1038 unsigned T10OUTPS : 4;
1039 unsigned : 1;
1041 } __T10CONbits_t;
1043 extern __at(0x0F33) volatile __T10CONbits_t T10CONbits;
1045 #define _T10CKPS0 0x01
1046 #define _T10CKPS1 0x02
1047 #define _TMR10ON 0x04
1048 #define _T10OUTPS0 0x08
1049 #define _T10OUTPS1 0x10
1050 #define _T10OUTPS2 0x20
1051 #define _T10OUTPS3 0x40
1053 //==============================================================================
1055 extern __at(0x0F34) __sfr PR10;
1056 extern __at(0x0F35) __sfr TMR10;
1058 //==============================================================================
1059 // T8CON Bits
1061 extern __at(0x0F36) __sfr T8CON;
1063 typedef union
1065 struct
1067 unsigned T8CKPS0 : 1;
1068 unsigned T8CKPS1 : 1;
1069 unsigned TMR8ON : 1;
1070 unsigned T8OUTPS0 : 1;
1071 unsigned T8OUTPS1 : 1;
1072 unsigned T8OUTPS2 : 1;
1073 unsigned T8OUTPS3 : 1;
1074 unsigned : 1;
1077 struct
1079 unsigned T8CKPS : 2;
1080 unsigned : 6;
1083 struct
1085 unsigned : 3;
1086 unsigned T8OUTPS : 4;
1087 unsigned : 1;
1089 } __T8CONbits_t;
1091 extern __at(0x0F36) volatile __T8CONbits_t T8CONbits;
1093 #define _T8CKPS0 0x01
1094 #define _T8CKPS1 0x02
1095 #define _TMR8ON 0x04
1096 #define _T8OUTPS0 0x08
1097 #define _T8OUTPS1 0x10
1098 #define _T8OUTPS2 0x20
1099 #define _T8OUTPS3 0x40
1101 //==============================================================================
1103 extern __at(0x0F37) __sfr PR8;
1104 extern __at(0x0F38) __sfr TMR8;
1106 //==============================================================================
1107 // T6CON Bits
1109 extern __at(0x0F39) __sfr T6CON;
1111 typedef union
1113 struct
1115 unsigned T6CKPS0 : 1;
1116 unsigned T6CKPS1 : 1;
1117 unsigned TMR6ON : 1;
1118 unsigned T6OUTPS0 : 1;
1119 unsigned T6OUTPS1 : 1;
1120 unsigned T6OUTPS2 : 1;
1121 unsigned T6OUTPS3 : 1;
1122 unsigned : 1;
1125 struct
1127 unsigned T6CKPS : 2;
1128 unsigned : 6;
1131 struct
1133 unsigned : 3;
1134 unsigned T6OUTPS : 4;
1135 unsigned : 1;
1137 } __T6CONbits_t;
1139 extern __at(0x0F39) volatile __T6CONbits_t T6CONbits;
1141 #define _T6CKPS0 0x01
1142 #define _T6CKPS1 0x02
1143 #define _TMR6ON 0x04
1144 #define _T6OUTPS0 0x08
1145 #define _T6OUTPS1 0x10
1146 #define _T6OUTPS2 0x20
1147 #define _T6OUTPS3 0x40
1149 //==============================================================================
1151 extern __at(0x0F3A) __sfr PR6;
1152 extern __at(0x0F3B) __sfr TMR6;
1154 //==============================================================================
1155 // T7GCON Bits
1157 extern __at(0x0F3C) __sfr T7GCON;
1159 typedef union
1161 struct
1163 unsigned T7GSS0 : 1;
1164 unsigned T7GSS1 : 1;
1165 unsigned T7GVAL : 1;
1166 unsigned T7GGO_NOT_T7DONE : 1;
1167 unsigned T7GSPM : 1;
1168 unsigned T7GTM : 1;
1169 unsigned T7GPOL : 1;
1170 unsigned TMR7GE : 1;
1173 struct
1175 unsigned : 1;
1176 unsigned : 1;
1177 unsigned : 1;
1178 unsigned T7GGO : 1;
1179 unsigned : 1;
1180 unsigned : 1;
1181 unsigned : 1;
1182 unsigned : 1;
1185 struct
1187 unsigned : 1;
1188 unsigned : 1;
1189 unsigned : 1;
1190 unsigned NOT_T7DONE : 1;
1191 unsigned : 1;
1192 unsigned : 1;
1193 unsigned : 1;
1194 unsigned : 1;
1197 struct
1199 unsigned T7GSS : 2;
1200 unsigned : 6;
1202 } __T7GCONbits_t;
1204 extern __at(0x0F3C) volatile __T7GCONbits_t T7GCONbits;
1206 #define _T7GSS0 0x01
1207 #define _T7GSS1 0x02
1208 #define _T7GVAL 0x04
1209 #define _T7GGO_NOT_T7DONE 0x08
1210 #define _T7GGO 0x08
1211 #define _NOT_T7DONE 0x08
1212 #define _T7GSPM 0x10
1213 #define _T7GTM 0x20
1214 #define _T7GPOL 0x40
1215 #define _TMR7GE 0x80
1217 //==============================================================================
1220 //==============================================================================
1221 // T7CON Bits
1223 extern __at(0x0F3D) __sfr T7CON;
1225 typedef union
1227 struct
1229 unsigned TMR7ON : 1;
1230 unsigned RD16 : 1;
1231 unsigned NOT_T7SYNC : 1;
1232 unsigned SOSCEN : 1;
1233 unsigned T7CKPS0 : 1;
1234 unsigned T7CKPS1 : 1;
1235 unsigned TMR7CS0 : 1;
1236 unsigned TMR7CS1 : 1;
1239 struct
1241 unsigned : 4;
1242 unsigned T7CKPS : 2;
1243 unsigned : 2;
1246 struct
1248 unsigned : 6;
1249 unsigned TMR7CS : 2;
1251 } __T7CONbits_t;
1253 extern __at(0x0F3D) volatile __T7CONbits_t T7CONbits;
1255 #define _T7CON_TMR7ON 0x01
1256 #define _T7CON_RD16 0x02
1257 #define _T7CON_NOT_T7SYNC 0x04
1258 #define _T7CON_SOSCEN 0x08
1259 #define _T7CON_T7CKPS0 0x10
1260 #define _T7CON_T7CKPS1 0x20
1261 #define _T7CON_TMR7CS0 0x40
1262 #define _T7CON_TMR7CS1 0x80
1264 //==============================================================================
1266 extern __at(0x0F3E) __sfr TMR7;
1267 extern __at(0x0F3E) __sfr TMR7L;
1268 extern __at(0x0F3F) __sfr TMR7H;
1270 //==============================================================================
1271 // CCP10CON Bits
1273 extern __at(0x0F40) __sfr CCP10CON;
1275 typedef union
1277 struct
1279 unsigned CCP10M0 : 1;
1280 unsigned CCP10M1 : 1;
1281 unsigned CCP10M2 : 1;
1282 unsigned CCP10M3 : 1;
1283 unsigned DC10B0 : 1;
1284 unsigned DC10B1 : 1;
1285 unsigned : 1;
1286 unsigned : 1;
1289 struct
1291 unsigned : 1;
1292 unsigned : 1;
1293 unsigned : 1;
1294 unsigned : 1;
1295 unsigned CCP10Y : 1;
1296 unsigned CCP10X : 1;
1297 unsigned : 1;
1298 unsigned : 1;
1301 struct
1303 unsigned CCP10M : 4;
1304 unsigned : 4;
1307 struct
1309 unsigned : 4;
1310 unsigned DC10B : 2;
1311 unsigned : 2;
1313 } __CCP10CONbits_t;
1315 extern __at(0x0F40) volatile __CCP10CONbits_t CCP10CONbits;
1317 #define _CCP10M0 0x01
1318 #define _CCP10M1 0x02
1319 #define _CCP10M2 0x04
1320 #define _CCP10M3 0x08
1321 #define _DC10B0 0x10
1322 #define _CCP10Y 0x10
1323 #define _DC10B1 0x20
1324 #define _CCP10X 0x20
1326 //==============================================================================
1328 extern __at(0x0F41) __sfr CCPR10;
1329 extern __at(0x0F41) __sfr CCPR10L;
1330 extern __at(0x0F42) __sfr CCPR10H;
1332 //==============================================================================
1333 // CCP9CON Bits
1335 extern __at(0x0F43) __sfr CCP9CON;
1337 typedef union
1339 struct
1341 unsigned CCP9M0 : 1;
1342 unsigned CCP9M1 : 1;
1343 unsigned CCP9M2 : 1;
1344 unsigned CCP9M3 : 1;
1345 unsigned DC9B0 : 1;
1346 unsigned DC9B1 : 1;
1347 unsigned : 1;
1348 unsigned : 1;
1351 struct
1353 unsigned : 1;
1354 unsigned : 1;
1355 unsigned : 1;
1356 unsigned : 1;
1357 unsigned CCP9Y : 1;
1358 unsigned CCP9X : 1;
1359 unsigned : 1;
1360 unsigned : 1;
1363 struct
1365 unsigned CCP9M : 4;
1366 unsigned : 4;
1369 struct
1371 unsigned : 4;
1372 unsigned DC9B : 2;
1373 unsigned : 2;
1375 } __CCP9CONbits_t;
1377 extern __at(0x0F43) volatile __CCP9CONbits_t CCP9CONbits;
1379 #define _CCP9M0 0x01
1380 #define _CCP9M1 0x02
1381 #define _CCP9M2 0x04
1382 #define _CCP9M3 0x08
1383 #define _DC9B0 0x10
1384 #define _CCP9Y 0x10
1385 #define _DC9B1 0x20
1386 #define _CCP9X 0x20
1388 //==============================================================================
1390 extern __at(0x0F44) __sfr CCPR9;
1391 extern __at(0x0F44) __sfr CCPR9L;
1392 extern __at(0x0F45) __sfr CCPR9H;
1394 //==============================================================================
1395 // CCP8CON Bits
1397 extern __at(0x0F46) __sfr CCP8CON;
1399 typedef union
1401 struct
1403 unsigned CCP8M0 : 1;
1404 unsigned CCP8M1 : 1;
1405 unsigned CCP8M2 : 1;
1406 unsigned CCP8M3 : 1;
1407 unsigned DC8B0 : 1;
1408 unsigned DC8B1 : 1;
1409 unsigned : 1;
1410 unsigned : 1;
1413 struct
1415 unsigned : 1;
1416 unsigned : 1;
1417 unsigned : 1;
1418 unsigned : 1;
1419 unsigned CCP8Y : 1;
1420 unsigned CCP8X : 1;
1421 unsigned : 1;
1422 unsigned : 1;
1425 struct
1427 unsigned CCP8M : 4;
1428 unsigned : 4;
1431 struct
1433 unsigned : 4;
1434 unsigned DC8B : 2;
1435 unsigned : 2;
1437 } __CCP8CONbits_t;
1439 extern __at(0x0F46) volatile __CCP8CONbits_t CCP8CONbits;
1441 #define _CCP8M0 0x01
1442 #define _CCP8M1 0x02
1443 #define _CCP8M2 0x04
1444 #define _CCP8M3 0x08
1445 #define _DC8B0 0x10
1446 #define _CCP8Y 0x10
1447 #define _DC8B1 0x20
1448 #define _CCP8X 0x20
1450 //==============================================================================
1452 extern __at(0x0F47) __sfr CCPR8;
1453 extern __at(0x0F47) __sfr CCPR8L;
1454 extern __at(0x0F48) __sfr CCPR8H;
1456 //==============================================================================
1457 // CCP3CON Bits
1459 extern __at(0x0F49) __sfr CCP3CON;
1461 typedef union
1463 struct
1465 unsigned CCP3M0 : 1;
1466 unsigned CCP3M1 : 1;
1467 unsigned CCP3M2 : 1;
1468 unsigned CCP3M3 : 1;
1469 unsigned DC3B0 : 1;
1470 unsigned DC3B1 : 1;
1471 unsigned P3M0 : 1;
1472 unsigned P3M1 : 1;
1475 struct
1477 unsigned CCP3M : 4;
1478 unsigned : 4;
1481 struct
1483 unsigned : 4;
1484 unsigned DC3B : 2;
1485 unsigned : 2;
1488 struct
1490 unsigned : 6;
1491 unsigned P3M : 2;
1493 } __CCP3CONbits_t;
1495 extern __at(0x0F49) volatile __CCP3CONbits_t CCP3CONbits;
1497 #define _CCP3M0 0x01
1498 #define _CCP3M1 0x02
1499 #define _CCP3M2 0x04
1500 #define _CCP3M3 0x08
1501 #define _DC3B0 0x10
1502 #define _DC3B1 0x20
1503 #define _P3M0 0x40
1504 #define _P3M1 0x80
1506 //==============================================================================
1508 extern __at(0x0F4A) __sfr CCPR3;
1509 extern __at(0x0F4A) __sfr CCPR3L;
1510 extern __at(0x0F4B) __sfr CCPR3H;
1512 //==============================================================================
1513 // ECCP3DEL Bits
1515 extern __at(0x0F4C) __sfr ECCP3DEL;
1517 typedef union
1519 struct
1521 unsigned P3DC0 : 1;
1522 unsigned P3DC1 : 1;
1523 unsigned P3DC2 : 1;
1524 unsigned P3DC3 : 1;
1525 unsigned P3DC4 : 1;
1526 unsigned P3DC5 : 1;
1527 unsigned P3DC6 : 1;
1528 unsigned P3RSEN : 1;
1531 struct
1533 unsigned P3DC : 7;
1534 unsigned : 1;
1536 } __ECCP3DELbits_t;
1538 extern __at(0x0F4C) volatile __ECCP3DELbits_t ECCP3DELbits;
1540 #define _P3DC0 0x01
1541 #define _P3DC1 0x02
1542 #define _P3DC2 0x04
1543 #define _P3DC3 0x08
1544 #define _P3DC4 0x10
1545 #define _P3DC5 0x20
1546 #define _P3DC6 0x40
1547 #define _P3RSEN 0x80
1549 //==============================================================================
1552 //==============================================================================
1553 // ECCP3AS Bits
1555 extern __at(0x0F4D) __sfr ECCP3AS;
1557 typedef union
1559 struct
1561 unsigned PSS3BD0 : 1;
1562 unsigned PSS3BD1 : 1;
1563 unsigned PSS3AC0 : 1;
1564 unsigned PSS3AC1 : 1;
1565 unsigned ECCP3AS0 : 1;
1566 unsigned ECCP3AS1 : 1;
1567 unsigned ECCP3AS2 : 1;
1568 unsigned ECCP3ASE : 1;
1571 struct
1573 unsigned PSS3BD : 2;
1574 unsigned : 6;
1577 struct
1579 unsigned : 2;
1580 unsigned PSS3AC : 2;
1581 unsigned : 4;
1584 struct
1586 unsigned : 4;
1587 unsigned ECCP3AS : 3;
1588 unsigned : 1;
1590 } __ECCP3ASbits_t;
1592 extern __at(0x0F4D) volatile __ECCP3ASbits_t ECCP3ASbits;
1594 #define _PSS3BD0 0x01
1595 #define _PSS3BD1 0x02
1596 #define _PSS3AC0 0x04
1597 #define _PSS3AC1 0x08
1598 #define _ECCP3AS0 0x10
1599 #define _ECCP3AS1 0x20
1600 #define _ECCP3AS2 0x40
1601 #define _ECCP3ASE 0x80
1603 //==============================================================================
1606 //==============================================================================
1607 // CCP2CON Bits
1609 extern __at(0x0F4E) __sfr CCP2CON;
1611 typedef union
1613 struct
1615 unsigned CCP2M0 : 1;
1616 unsigned CCP2M1 : 1;
1617 unsigned CCP2M2 : 1;
1618 unsigned CCP2M3 : 1;
1619 unsigned DC2B0 : 1;
1620 unsigned DC2B1 : 1;
1621 unsigned P2M0 : 1;
1622 unsigned P2M1 : 1;
1625 struct
1627 unsigned : 1;
1628 unsigned : 1;
1629 unsigned : 1;
1630 unsigned : 1;
1631 unsigned CCP2Y : 1;
1632 unsigned CCP2X : 1;
1633 unsigned : 1;
1634 unsigned : 1;
1637 struct
1639 unsigned CCP2M : 4;
1640 unsigned : 4;
1643 struct
1645 unsigned : 4;
1646 unsigned DC2B : 2;
1647 unsigned : 2;
1650 struct
1652 unsigned : 6;
1653 unsigned P2M : 2;
1655 } __CCP2CONbits_t;
1657 extern __at(0x0F4E) volatile __CCP2CONbits_t CCP2CONbits;
1659 #define _CCP2M0 0x01
1660 #define _CCP2M1 0x02
1661 #define _CCP2M2 0x04
1662 #define _CCP2M3 0x08
1663 #define _DC2B0 0x10
1664 #define _CCP2Y 0x10
1665 #define _DC2B1 0x20
1666 #define _CCP2X 0x20
1667 #define _P2M0 0x40
1668 #define _P2M1 0x80
1670 //==============================================================================
1673 //==============================================================================
1674 // ECCP2CON Bits
1676 extern __at(0x0F4E) __sfr ECCP2CON;
1678 typedef union
1680 struct
1682 unsigned CCP2M0 : 1;
1683 unsigned CCP2M1 : 1;
1684 unsigned CCP2M2 : 1;
1685 unsigned CCP2M3 : 1;
1686 unsigned DC2B0 : 1;
1687 unsigned DC2B1 : 1;
1688 unsigned P2M0 : 1;
1689 unsigned P2M1 : 1;
1692 struct
1694 unsigned : 1;
1695 unsigned : 1;
1696 unsigned : 1;
1697 unsigned : 1;
1698 unsigned CCP2Y : 1;
1699 unsigned CCP2X : 1;
1700 unsigned : 1;
1701 unsigned : 1;
1704 struct
1706 unsigned CCP2M : 4;
1707 unsigned : 4;
1710 struct
1712 unsigned : 4;
1713 unsigned DC2B : 2;
1714 unsigned : 2;
1717 struct
1719 unsigned : 6;
1720 unsigned P2M : 2;
1722 } __ECCP2CONbits_t;
1724 extern __at(0x0F4E) volatile __ECCP2CONbits_t ECCP2CONbits;
1726 #define _ECCP2CON_CCP2M0 0x01
1727 #define _ECCP2CON_CCP2M1 0x02
1728 #define _ECCP2CON_CCP2M2 0x04
1729 #define _ECCP2CON_CCP2M3 0x08
1730 #define _ECCP2CON_DC2B0 0x10
1731 #define _ECCP2CON_CCP2Y 0x10
1732 #define _ECCP2CON_DC2B1 0x20
1733 #define _ECCP2CON_CCP2X 0x20
1734 #define _ECCP2CON_P2M0 0x40
1735 #define _ECCP2CON_P2M1 0x80
1737 //==============================================================================
1739 extern __at(0x0F4F) __sfr CCPR2;
1740 extern __at(0x0F4F) __sfr CCPR2L;
1741 extern __at(0x0F50) __sfr CCPR2H;
1743 //==============================================================================
1744 // ECCP2DEL Bits
1746 extern __at(0x0F51) __sfr ECCP2DEL;
1748 typedef union
1750 struct
1752 unsigned P2DC0 : 1;
1753 unsigned P2DC1 : 1;
1754 unsigned P2DC2 : 1;
1755 unsigned P2DC3 : 1;
1756 unsigned P2DC4 : 1;
1757 unsigned P2DC5 : 1;
1758 unsigned P2DC6 : 1;
1759 unsigned P2RSEN : 1;
1762 struct
1764 unsigned P2DC : 7;
1765 unsigned : 1;
1767 } __ECCP2DELbits_t;
1769 extern __at(0x0F51) volatile __ECCP2DELbits_t ECCP2DELbits;
1771 #define _P2DC0 0x01
1772 #define _P2DC1 0x02
1773 #define _P2DC2 0x04
1774 #define _P2DC3 0x08
1775 #define _P2DC4 0x10
1776 #define _P2DC5 0x20
1777 #define _P2DC6 0x40
1778 #define _P2RSEN 0x80
1780 //==============================================================================
1783 //==============================================================================
1784 // PWM2CON Bits
1786 extern __at(0x0F51) __sfr PWM2CON;
1788 typedef union
1790 struct
1792 unsigned P2DC0 : 1;
1793 unsigned P2DC1 : 1;
1794 unsigned P2DC2 : 1;
1795 unsigned P2DC3 : 1;
1796 unsigned P2DC4 : 1;
1797 unsigned P2DC5 : 1;
1798 unsigned P2DC6 : 1;
1799 unsigned P2RSEN : 1;
1802 struct
1804 unsigned P2DC : 7;
1805 unsigned : 1;
1807 } __PWM2CONbits_t;
1809 extern __at(0x0F51) volatile __PWM2CONbits_t PWM2CONbits;
1811 #define _PWM2CON_P2DC0 0x01
1812 #define _PWM2CON_P2DC1 0x02
1813 #define _PWM2CON_P2DC2 0x04
1814 #define _PWM2CON_P2DC3 0x08
1815 #define _PWM2CON_P2DC4 0x10
1816 #define _PWM2CON_P2DC5 0x20
1817 #define _PWM2CON_P2DC6 0x40
1818 #define _PWM2CON_P2RSEN 0x80
1820 //==============================================================================
1823 //==============================================================================
1824 // ECCP2AS Bits
1826 extern __at(0x0F52) __sfr ECCP2AS;
1828 typedef union
1830 struct
1832 unsigned PSS2BD0 : 1;
1833 unsigned PSS2BD1 : 1;
1834 unsigned PSS2AC0 : 1;
1835 unsigned PSS2AC1 : 1;
1836 unsigned ECCP2AS0 : 1;
1837 unsigned ECCP2AS1 : 1;
1838 unsigned ECCP2AS2 : 1;
1839 unsigned ECCP2ASE : 1;
1842 struct
1844 unsigned PSS2BD : 2;
1845 unsigned : 6;
1848 struct
1850 unsigned : 2;
1851 unsigned PSS2AC : 2;
1852 unsigned : 4;
1855 struct
1857 unsigned : 4;
1858 unsigned ECCP2AS : 3;
1859 unsigned : 1;
1861 } __ECCP2ASbits_t;
1863 extern __at(0x0F52) volatile __ECCP2ASbits_t ECCP2ASbits;
1865 #define _PSS2BD0 0x01
1866 #define _PSS2BD1 0x02
1867 #define _PSS2AC0 0x04
1868 #define _PSS2AC1 0x08
1869 #define _ECCP2AS0 0x10
1870 #define _ECCP2AS1 0x20
1871 #define _ECCP2AS2 0x40
1872 #define _ECCP2ASE 0x80
1874 //==============================================================================
1877 //==============================================================================
1878 // PADCFG1 Bits
1880 extern __at(0x0F53) __sfr PADCFG1;
1882 typedef union
1884 struct
1886 unsigned : 1;
1887 unsigned RTSECSEL0 : 1;
1888 unsigned RTSECSEL1 : 1;
1889 unsigned : 1;
1890 unsigned : 1;
1891 unsigned RJPU : 1;
1892 unsigned REPU : 1;
1893 unsigned RDPU : 1;
1896 struct
1898 unsigned : 1;
1899 unsigned RTSECSEL : 2;
1900 unsigned : 5;
1902 } __PADCFG1bits_t;
1904 extern __at(0x0F53) volatile __PADCFG1bits_t PADCFG1bits;
1906 #define _RTSECSEL0 0x02
1907 #define _RTSECSEL1 0x04
1908 #define _RJPU 0x20
1909 #define _REPU 0x40
1910 #define _RDPU 0x80
1912 //==============================================================================
1915 //==============================================================================
1916 // CM1CON Bits
1918 extern __at(0x0F54) __sfr CM1CON;
1920 typedef union
1922 struct
1924 unsigned CCH0 : 1;
1925 unsigned CCH1 : 1;
1926 unsigned CREF : 1;
1927 unsigned EVPOL0 : 1;
1928 unsigned EVPOL1 : 1;
1929 unsigned CPOL : 1;
1930 unsigned COE : 1;
1931 unsigned CON : 1;
1934 struct
1936 unsigned CCH : 2;
1937 unsigned : 6;
1940 struct
1942 unsigned : 3;
1943 unsigned EVPOL : 2;
1944 unsigned : 3;
1946 } __CM1CONbits_t;
1948 extern __at(0x0F54) volatile __CM1CONbits_t CM1CONbits;
1950 #define _CCH0 0x01
1951 #define _CCH1 0x02
1952 #define _CREF 0x04
1953 #define _EVPOL0 0x08
1954 #define _EVPOL1 0x10
1955 #define _CPOL 0x20
1956 #define _COE 0x40
1957 #define _CON 0x80
1959 //==============================================================================
1962 //==============================================================================
1963 // CM1CON1 Bits
1965 extern __at(0x0F54) __sfr CM1CON1;
1967 typedef union
1969 struct
1971 unsigned CCH0 : 1;
1972 unsigned CCH1 : 1;
1973 unsigned CREF : 1;
1974 unsigned EVPOL0 : 1;
1975 unsigned EVPOL1 : 1;
1976 unsigned CPOL : 1;
1977 unsigned COE : 1;
1978 unsigned CON : 1;
1981 struct
1983 unsigned CCH : 2;
1984 unsigned : 6;
1987 struct
1989 unsigned : 3;
1990 unsigned EVPOL : 2;
1991 unsigned : 3;
1993 } __CM1CON1bits_t;
1995 extern __at(0x0F54) volatile __CM1CON1bits_t CM1CON1bits;
1997 #define _CM1CON1_CCH0 0x01
1998 #define _CM1CON1_CCH1 0x02
1999 #define _CM1CON1_CREF 0x04
2000 #define _CM1CON1_EVPOL0 0x08
2001 #define _CM1CON1_EVPOL1 0x10
2002 #define _CM1CON1_CPOL 0x20
2003 #define _CM1CON1_COE 0x40
2004 #define _CM1CON1_CON 0x80
2006 //==============================================================================
2009 //==============================================================================
2010 // CTMUICON Bits
2012 extern __at(0x0F55) __sfr CTMUICON;
2014 typedef union
2016 struct
2018 unsigned IRNG0 : 1;
2019 unsigned IRNG1 : 1;
2020 unsigned ITRIM0 : 1;
2021 unsigned ITRIM1 : 1;
2022 unsigned ITRIM2 : 1;
2023 unsigned ITRIM3 : 1;
2024 unsigned ITRIM4 : 1;
2025 unsigned ITRIM5 : 1;
2028 struct
2030 unsigned IRNG : 2;
2031 unsigned : 6;
2034 struct
2036 unsigned : 2;
2037 unsigned ITRIM : 6;
2039 } __CTMUICONbits_t;
2041 extern __at(0x0F55) volatile __CTMUICONbits_t CTMUICONbits;
2043 #define _IRNG0 0x01
2044 #define _IRNG1 0x02
2045 #define _ITRIM0 0x04
2046 #define _ITRIM1 0x08
2047 #define _ITRIM2 0x10
2048 #define _ITRIM3 0x20
2049 #define _ITRIM4 0x40
2050 #define _ITRIM5 0x80
2052 //==============================================================================
2055 //==============================================================================
2056 // CTMUCONL Bits
2058 extern __at(0x0F56) __sfr CTMUCONL;
2060 typedef union
2062 struct
2064 unsigned EDG1STAT : 1;
2065 unsigned EDG2STAT : 1;
2066 unsigned EDG1SEL0 : 1;
2067 unsigned EDG1SEL1 : 1;
2068 unsigned EDG1POL : 1;
2069 unsigned EDG2SEL0 : 1;
2070 unsigned EDG2SEL1 : 1;
2071 unsigned EDG2POL : 1;
2074 struct
2076 unsigned : 2;
2077 unsigned EDG1SEL : 2;
2078 unsigned : 4;
2081 struct
2083 unsigned : 5;
2084 unsigned EDG2SEL : 2;
2085 unsigned : 1;
2087 } __CTMUCONLbits_t;
2089 extern __at(0x0F56) volatile __CTMUCONLbits_t CTMUCONLbits;
2091 #define _EDG1STAT 0x01
2092 #define _EDG2STAT 0x02
2093 #define _EDG1SEL0 0x04
2094 #define _EDG1SEL1 0x08
2095 #define _EDG1POL 0x10
2096 #define _EDG2SEL0 0x20
2097 #define _EDG2SEL1 0x40
2098 #define _EDG2POL 0x80
2100 //==============================================================================
2103 //==============================================================================
2104 // CTMUCONH Bits
2106 extern __at(0x0F57) __sfr CTMUCONH;
2108 typedef struct
2110 unsigned CTTRIG : 1;
2111 unsigned IDISSEN : 1;
2112 unsigned EDGSEQEN : 1;
2113 unsigned EDGEN : 1;
2114 unsigned TGEN : 1;
2115 unsigned CTMUSIDL : 1;
2116 unsigned : 1;
2117 unsigned CTMUEN : 1;
2118 } __CTMUCONHbits_t;
2120 extern __at(0x0F57) volatile __CTMUCONHbits_t CTMUCONHbits;
2122 #define _CTTRIG 0x01
2123 #define _IDISSEN 0x02
2124 #define _EDGSEQEN 0x04
2125 #define _EDGEN 0x08
2126 #define _TGEN 0x10
2127 #define _CTMUSIDL 0x20
2128 #define _CTMUEN 0x80
2130 //==============================================================================
2132 extern __at(0x0F58) __sfr ALRMVAL;
2133 extern __at(0x0F58) __sfr ALRMVALL;
2134 extern __at(0x0F59) __sfr ALRMVALH;
2136 //==============================================================================
2137 // ALRMRPT Bits
2139 extern __at(0x0F5A) __sfr ALRMRPT;
2141 typedef struct
2143 unsigned ARPT0 : 1;
2144 unsigned ARPT1 : 1;
2145 unsigned ARPT2 : 1;
2146 unsigned ARPT3 : 1;
2147 unsigned ARPT4 : 1;
2148 unsigned ARPT5 : 1;
2149 unsigned ARPT6 : 1;
2150 unsigned ARPT7 : 1;
2151 } __ALRMRPTbits_t;
2153 extern __at(0x0F5A) volatile __ALRMRPTbits_t ALRMRPTbits;
2155 #define _ARPT0 0x01
2156 #define _ARPT1 0x02
2157 #define _ARPT2 0x04
2158 #define _ARPT3 0x08
2159 #define _ARPT4 0x10
2160 #define _ARPT5 0x20
2161 #define _ARPT6 0x40
2162 #define _ARPT7 0x80
2164 //==============================================================================
2167 //==============================================================================
2168 // ALRMCFG Bits
2170 extern __at(0x0F5B) __sfr ALRMCFG;
2172 typedef union
2174 struct
2176 unsigned ALRMPTR0 : 1;
2177 unsigned ALRMPTR1 : 1;
2178 unsigned AMASK0 : 1;
2179 unsigned AMASK1 : 1;
2180 unsigned AMASK2 : 1;
2181 unsigned AMASK3 : 1;
2182 unsigned CHIME : 1;
2183 unsigned ALRMEN : 1;
2186 struct
2188 unsigned ALRMPTR : 2;
2189 unsigned : 6;
2192 struct
2194 unsigned : 2;
2195 unsigned AMASK : 4;
2196 unsigned : 2;
2198 } __ALRMCFGbits_t;
2200 extern __at(0x0F5B) volatile __ALRMCFGbits_t ALRMCFGbits;
2202 #define _ALRMPTR0 0x01
2203 #define _ALRMPTR1 0x02
2204 #define _AMASK0 0x04
2205 #define _AMASK1 0x08
2206 #define _AMASK2 0x10
2207 #define _AMASK3 0x20
2208 #define _CHIME 0x40
2209 #define _ALRMEN 0x80
2211 //==============================================================================
2213 extern __at(0x0F5C) __sfr RTCVAL;
2214 extern __at(0x0F5C) __sfr RTCVALL;
2215 extern __at(0x0F5D) __sfr RTCVALH;
2217 //==============================================================================
2218 // RTCCAL Bits
2220 extern __at(0x0F5E) __sfr RTCCAL;
2222 typedef struct
2224 unsigned CAL0 : 1;
2225 unsigned CAL1 : 1;
2226 unsigned CAL2 : 1;
2227 unsigned CAL3 : 1;
2228 unsigned CAL4 : 1;
2229 unsigned CAL5 : 1;
2230 unsigned CAL6 : 1;
2231 unsigned CAL7 : 1;
2232 } __RTCCALbits_t;
2234 extern __at(0x0F5E) volatile __RTCCALbits_t RTCCALbits;
2236 #define _CAL0 0x01
2237 #define _CAL1 0x02
2238 #define _CAL2 0x04
2239 #define _CAL3 0x08
2240 #define _CAL4 0x10
2241 #define _CAL5 0x20
2242 #define _CAL6 0x40
2243 #define _CAL7 0x80
2245 //==============================================================================
2248 //==============================================================================
2249 // RTCCFG Bits
2251 extern __at(0x0F5F) __sfr RTCCFG;
2253 typedef union
2255 struct
2257 unsigned RTCPTR0 : 1;
2258 unsigned RTCPTR1 : 1;
2259 unsigned RTCOE : 1;
2260 unsigned HALFSEC : 1;
2261 unsigned RTCSYNC : 1;
2262 unsigned RTCWREN : 1;
2263 unsigned : 1;
2264 unsigned RTCEN : 1;
2267 struct
2269 unsigned RTCPTR : 2;
2270 unsigned : 6;
2272 } __RTCCFGbits_t;
2274 extern __at(0x0F5F) volatile __RTCCFGbits_t RTCCFGbits;
2276 #define _RTCPTR0 0x01
2277 #define _RTCPTR1 0x02
2278 #define _RTCOE 0x04
2279 #define _HALFSEC 0x08
2280 #define _RTCSYNC 0x10
2281 #define _RTCWREN 0x20
2282 #define _RTCEN 0x80
2284 //==============================================================================
2287 //==============================================================================
2288 // PIE6 Bits
2290 extern __at(0x0F60) __sfr PIE6;
2292 typedef struct
2294 unsigned CMP1IE : 1;
2295 unsigned CMP2IE : 1;
2296 unsigned CMP3IE : 1;
2297 unsigned : 1;
2298 unsigned EEIE : 1;
2299 unsigned : 1;
2300 unsigned : 1;
2301 unsigned : 1;
2302 } __PIE6bits_t;
2304 extern __at(0x0F60) volatile __PIE6bits_t PIE6bits;
2306 #define _CMP1IE 0x01
2307 #define _CMP2IE 0x02
2308 #define _CMP3IE 0x04
2309 #define _EEIE 0x10
2311 //==============================================================================
2313 extern __at(0x0F61) __sfr EEDATA;
2314 extern __at(0x0F62) __sfr EEADR;
2315 extern __at(0x0F63) __sfr EEADRH;
2317 //==============================================================================
2318 // OSCCON2 Bits
2320 extern __at(0x0F64) __sfr OSCCON2;
2322 typedef struct
2324 unsigned MFIOSEL : 1;
2325 unsigned MFIOFS : 1;
2326 unsigned : 1;
2327 unsigned SOSCGO : 1;
2328 unsigned : 1;
2329 unsigned : 1;
2330 unsigned SOSCRUN : 1;
2331 unsigned : 1;
2332 } __OSCCON2bits_t;
2334 extern __at(0x0F64) volatile __OSCCON2bits_t OSCCON2bits;
2336 #define _MFIOSEL 0x01
2337 #define _MFIOFS 0x02
2338 #define _SOSCGO 0x08
2339 #define _SOSCRUN 0x40
2341 //==============================================================================
2344 //==============================================================================
2345 // BAUDCON Bits
2347 extern __at(0x0F65) __sfr BAUDCON;
2349 typedef struct
2351 unsigned ABDEN : 1;
2352 unsigned WUE : 1;
2353 unsigned : 1;
2354 unsigned BRG16 : 1;
2355 unsigned TXCKP : 1;
2356 unsigned RXDTP : 1;
2357 unsigned RCIDL : 1;
2358 unsigned ABDOVF : 1;
2359 } __BAUDCONbits_t;
2361 extern __at(0x0F65) volatile __BAUDCONbits_t BAUDCONbits;
2363 #define _ABDEN 0x01
2364 #define _WUE 0x02
2365 #define _BRG16 0x08
2366 #define _TXCKP 0x10
2367 #define _RXDTP 0x20
2368 #define _RCIDL 0x40
2369 #define _ABDOVF 0x80
2371 //==============================================================================
2374 //==============================================================================
2375 // BAUDCON1 Bits
2377 extern __at(0x0F65) __sfr BAUDCON1;
2379 typedef struct
2381 unsigned ABDEN : 1;
2382 unsigned WUE : 1;
2383 unsigned : 1;
2384 unsigned BRG16 : 1;
2385 unsigned TXCKP : 1;
2386 unsigned RXDTP : 1;
2387 unsigned RCIDL : 1;
2388 unsigned ABDOVF : 1;
2389 } __BAUDCON1bits_t;
2391 extern __at(0x0F65) volatile __BAUDCON1bits_t BAUDCON1bits;
2393 #define _BAUDCON1_ABDEN 0x01
2394 #define _BAUDCON1_WUE 0x02
2395 #define _BAUDCON1_BRG16 0x08
2396 #define _BAUDCON1_TXCKP 0x10
2397 #define _BAUDCON1_RXDTP 0x20
2398 #define _BAUDCON1_RCIDL 0x40
2399 #define _BAUDCON1_ABDOVF 0x80
2401 //==============================================================================
2404 //==============================================================================
2405 // BAUDCTL Bits
2407 extern __at(0x0F65) __sfr BAUDCTL;
2409 typedef struct
2411 unsigned ABDEN : 1;
2412 unsigned WUE : 1;
2413 unsigned : 1;
2414 unsigned BRG16 : 1;
2415 unsigned TXCKP : 1;
2416 unsigned RXDTP : 1;
2417 unsigned RCIDL : 1;
2418 unsigned ABDOVF : 1;
2419 } __BAUDCTLbits_t;
2421 extern __at(0x0F65) volatile __BAUDCTLbits_t BAUDCTLbits;
2423 #define _BAUDCTL_ABDEN 0x01
2424 #define _BAUDCTL_WUE 0x02
2425 #define _BAUDCTL_BRG16 0x08
2426 #define _BAUDCTL_TXCKP 0x10
2427 #define _BAUDCTL_RXDTP 0x20
2428 #define _BAUDCTL_RCIDL 0x40
2429 #define _BAUDCTL_ABDOVF 0x80
2431 //==============================================================================
2434 //==============================================================================
2435 // SSP2CON2 Bits
2437 extern __at(0x0F66) __sfr SSP2CON2;
2439 typedef union
2441 struct
2443 unsigned SEN : 1;
2444 unsigned RSEN : 1;
2445 unsigned PEN : 1;
2446 unsigned RCEN : 1;
2447 unsigned ACKEN : 1;
2448 unsigned ACKDT : 1;
2449 unsigned ACKSTAT : 1;
2450 unsigned GCEN : 1;
2453 struct
2455 unsigned : 1;
2456 unsigned ADMSK1 : 1;
2457 unsigned ADMSK2 : 1;
2458 unsigned ADMSK3 : 1;
2459 unsigned ADMSK4 : 1;
2460 unsigned ADMSK5 : 1;
2461 unsigned : 1;
2462 unsigned : 1;
2464 } __SSP2CON2bits_t;
2466 extern __at(0x0F66) volatile __SSP2CON2bits_t SSP2CON2bits;
2468 #define _SSP2CON2_SEN 0x01
2469 #define _SSP2CON2_RSEN 0x02
2470 #define _SSP2CON2_ADMSK1 0x02
2471 #define _SSP2CON2_PEN 0x04
2472 #define _SSP2CON2_ADMSK2 0x04
2473 #define _SSP2CON2_RCEN 0x08
2474 #define _SSP2CON2_ADMSK3 0x08
2475 #define _SSP2CON2_ACKEN 0x10
2476 #define _SSP2CON2_ADMSK4 0x10
2477 #define _SSP2CON2_ACKDT 0x20
2478 #define _SSP2CON2_ADMSK5 0x20
2479 #define _SSP2CON2_ACKSTAT 0x40
2480 #define _SSP2CON2_GCEN 0x80
2482 //==============================================================================
2485 //==============================================================================
2486 // SSP2CON1 Bits
2488 extern __at(0x0F67) __sfr SSP2CON1;
2490 typedef union
2492 struct
2494 unsigned SSPM0 : 1;
2495 unsigned SSPM1 : 1;
2496 unsigned SSPM2 : 1;
2497 unsigned SSPM3 : 1;
2498 unsigned CKP : 1;
2499 unsigned SSPEN : 1;
2500 unsigned SSPOV : 1;
2501 unsigned WCOL : 1;
2504 struct
2506 unsigned SSPM : 4;
2507 unsigned : 4;
2509 } __SSP2CON1bits_t;
2511 extern __at(0x0F67) volatile __SSP2CON1bits_t SSP2CON1bits;
2513 #define _SSP2CON1_SSPM0 0x01
2514 #define _SSP2CON1_SSPM1 0x02
2515 #define _SSP2CON1_SSPM2 0x04
2516 #define _SSP2CON1_SSPM3 0x08
2517 #define _SSP2CON1_CKP 0x10
2518 #define _SSP2CON1_SSPEN 0x20
2519 #define _SSP2CON1_SSPOV 0x40
2520 #define _SSP2CON1_WCOL 0x80
2522 //==============================================================================
2525 //==============================================================================
2526 // SSP2STAT Bits
2528 extern __at(0x0F68) __sfr SSP2STAT;
2530 typedef union
2532 struct
2534 unsigned BF : 1;
2535 unsigned UA : 1;
2536 unsigned R_NOT_W : 1;
2537 unsigned S : 1;
2538 unsigned P : 1;
2539 unsigned D_NOT_A : 1;
2540 unsigned CKE : 1;
2541 unsigned SMP : 1;
2544 struct
2546 unsigned : 1;
2547 unsigned : 1;
2548 unsigned R : 1;
2549 unsigned I2C_START : 1;
2550 unsigned I2C_STOP : 1;
2551 unsigned D : 1;
2552 unsigned : 1;
2553 unsigned : 1;
2556 struct
2558 unsigned : 1;
2559 unsigned : 1;
2560 unsigned R_W : 1;
2561 unsigned : 1;
2562 unsigned : 1;
2563 unsigned D_A : 1;
2564 unsigned : 1;
2565 unsigned : 1;
2568 struct
2570 unsigned : 1;
2571 unsigned : 1;
2572 unsigned NOT_W : 1;
2573 unsigned : 1;
2574 unsigned : 1;
2575 unsigned NOT_A : 1;
2576 unsigned : 1;
2577 unsigned : 1;
2580 struct
2582 unsigned : 1;
2583 unsigned : 1;
2584 unsigned NOT_WRITE : 1;
2585 unsigned : 1;
2586 unsigned : 1;
2587 unsigned NOT_ADDRESS : 1;
2588 unsigned : 1;
2589 unsigned : 1;
2592 struct
2594 unsigned : 1;
2595 unsigned : 1;
2596 unsigned READ_WRITE : 1;
2597 unsigned : 1;
2598 unsigned : 1;
2599 unsigned DATA_ADDRESS : 1;
2600 unsigned : 1;
2601 unsigned : 1;
2604 struct
2606 unsigned : 1;
2607 unsigned : 1;
2608 unsigned I2C_READ : 1;
2609 unsigned : 1;
2610 unsigned : 1;
2611 unsigned I2C_DAT : 1;
2612 unsigned : 1;
2613 unsigned : 1;
2615 } __SSP2STATbits_t;
2617 extern __at(0x0F68) volatile __SSP2STATbits_t SSP2STATbits;
2619 #define _SSP2STAT_BF 0x01
2620 #define _SSP2STAT_UA 0x02
2621 #define _SSP2STAT_R_NOT_W 0x04
2622 #define _SSP2STAT_R 0x04
2623 #define _SSP2STAT_R_W 0x04
2624 #define _SSP2STAT_NOT_W 0x04
2625 #define _SSP2STAT_NOT_WRITE 0x04
2626 #define _SSP2STAT_READ_WRITE 0x04
2627 #define _SSP2STAT_I2C_READ 0x04
2628 #define _SSP2STAT_S 0x08
2629 #define _SSP2STAT_I2C_START 0x08
2630 #define _SSP2STAT_P 0x10
2631 #define _SSP2STAT_I2C_STOP 0x10
2632 #define _SSP2STAT_D_NOT_A 0x20
2633 #define _SSP2STAT_D 0x20
2634 #define _SSP2STAT_D_A 0x20
2635 #define _SSP2STAT_NOT_A 0x20
2636 #define _SSP2STAT_NOT_ADDRESS 0x20
2637 #define _SSP2STAT_DATA_ADDRESS 0x20
2638 #define _SSP2STAT_I2C_DAT 0x20
2639 #define _SSP2STAT_CKE 0x40
2640 #define _SSP2STAT_SMP 0x80
2642 //==============================================================================
2644 extern __at(0x0F69) __sfr SSP2ADD;
2646 //==============================================================================
2647 // SSP2MSK Bits
2649 extern __at(0x0F69) __sfr SSP2MSK;
2651 typedef struct
2653 unsigned MSK0 : 1;
2654 unsigned MSK1 : 1;
2655 unsigned MSK2 : 1;
2656 unsigned MSK3 : 1;
2657 unsigned MSK4 : 1;
2658 unsigned MSK5 : 1;
2659 unsigned MSK6 : 1;
2660 unsigned MSK7 : 1;
2661 } __SSP2MSKbits_t;
2663 extern __at(0x0F69) volatile __SSP2MSKbits_t SSP2MSKbits;
2665 #define _SSP2MSK_MSK0 0x01
2666 #define _SSP2MSK_MSK1 0x02
2667 #define _SSP2MSK_MSK2 0x04
2668 #define _SSP2MSK_MSK3 0x08
2669 #define _SSP2MSK_MSK4 0x10
2670 #define _SSP2MSK_MSK5 0x20
2671 #define _SSP2MSK_MSK6 0x40
2672 #define _SSP2MSK_MSK7 0x80
2674 //==============================================================================
2676 extern __at(0x0F6A) __sfr SSP2BUF;
2678 //==============================================================================
2679 // T4CON Bits
2681 extern __at(0x0F6B) __sfr T4CON;
2683 typedef union
2685 struct
2687 unsigned T4CKPS0 : 1;
2688 unsigned T4CKPS1 : 1;
2689 unsigned TMR4ON : 1;
2690 unsigned T4OUTPS0 : 1;
2691 unsigned T4OUTPS1 : 1;
2692 unsigned T4OUTPS2 : 1;
2693 unsigned T4OUTPS3 : 1;
2694 unsigned : 1;
2697 struct
2699 unsigned T4CKPS : 2;
2700 unsigned : 6;
2703 struct
2705 unsigned : 3;
2706 unsigned T4OUTPS : 4;
2707 unsigned : 1;
2709 } __T4CONbits_t;
2711 extern __at(0x0F6B) volatile __T4CONbits_t T4CONbits;
2713 #define _T4CKPS0 0x01
2714 #define _T4CKPS1 0x02
2715 #define _TMR4ON 0x04
2716 #define _T4OUTPS0 0x08
2717 #define _T4OUTPS1 0x10
2718 #define _T4OUTPS2 0x20
2719 #define _T4OUTPS3 0x40
2721 //==============================================================================
2723 extern __at(0x0F6C) __sfr PR4;
2724 extern __at(0x0F6D) __sfr TMR4;
2726 //==============================================================================
2727 // CCP7CON Bits
2729 extern __at(0x0F6E) __sfr CCP7CON;
2731 typedef union
2733 struct
2735 unsigned CCP7M0 : 1;
2736 unsigned CCP7M1 : 1;
2737 unsigned CCP7M2 : 1;
2738 unsigned CCP7M3 : 1;
2739 unsigned DC7B0 : 1;
2740 unsigned DC7B1 : 1;
2741 unsigned : 1;
2742 unsigned : 1;
2745 struct
2747 unsigned : 1;
2748 unsigned : 1;
2749 unsigned : 1;
2750 unsigned : 1;
2751 unsigned CCP7Y : 1;
2752 unsigned CCP7X : 1;
2753 unsigned : 1;
2754 unsigned : 1;
2757 struct
2759 unsigned CCP7M : 4;
2760 unsigned : 4;
2763 struct
2765 unsigned : 4;
2766 unsigned DC7B : 2;
2767 unsigned : 2;
2769 } __CCP7CONbits_t;
2771 extern __at(0x0F6E) volatile __CCP7CONbits_t CCP7CONbits;
2773 #define _CCP7M0 0x01
2774 #define _CCP7M1 0x02
2775 #define _CCP7M2 0x04
2776 #define _CCP7M3 0x08
2777 #define _DC7B0 0x10
2778 #define _CCP7Y 0x10
2779 #define _DC7B1 0x20
2780 #define _CCP7X 0x20
2782 //==============================================================================
2784 extern __at(0x0F6F) __sfr CCPR7;
2785 extern __at(0x0F6F) __sfr CCPR7L;
2786 extern __at(0x0F70) __sfr CCPR7H;
2788 //==============================================================================
2789 // CCP6CON Bits
2791 extern __at(0x0F71) __sfr CCP6CON;
2793 typedef union
2795 struct
2797 unsigned CCP6M0 : 1;
2798 unsigned CCP6M1 : 1;
2799 unsigned CCP6M2 : 1;
2800 unsigned CCP6M3 : 1;
2801 unsigned DC6B0 : 1;
2802 unsigned DC6B1 : 1;
2803 unsigned : 1;
2804 unsigned : 1;
2807 struct
2809 unsigned : 1;
2810 unsigned : 1;
2811 unsigned : 1;
2812 unsigned : 1;
2813 unsigned CCP6Y : 1;
2814 unsigned CCP6X : 1;
2815 unsigned : 1;
2816 unsigned : 1;
2819 struct
2821 unsigned CCP6M : 4;
2822 unsigned : 4;
2825 struct
2827 unsigned : 4;
2828 unsigned DC6B : 2;
2829 unsigned : 2;
2831 } __CCP6CONbits_t;
2833 extern __at(0x0F71) volatile __CCP6CONbits_t CCP6CONbits;
2835 #define _CCP6M0 0x01
2836 #define _CCP6M1 0x02
2837 #define _CCP6M2 0x04
2838 #define _CCP6M3 0x08
2839 #define _DC6B0 0x10
2840 #define _CCP6Y 0x10
2841 #define _DC6B1 0x20
2842 #define _CCP6X 0x20
2844 //==============================================================================
2846 extern __at(0x0F72) __sfr CCPR6;
2847 extern __at(0x0F72) __sfr CCPR6L;
2848 extern __at(0x0F73) __sfr CCPR6H;
2850 //==============================================================================
2851 // CCP5CON Bits
2853 extern __at(0x0F74) __sfr CCP5CON;
2855 typedef union
2857 struct
2859 unsigned CCP5M0 : 1;
2860 unsigned CCP5M1 : 1;
2861 unsigned CCP5M2 : 1;
2862 unsigned CCP5M3 : 1;
2863 unsigned DC5B0 : 1;
2864 unsigned DC5B1 : 1;
2865 unsigned : 1;
2866 unsigned : 1;
2869 struct
2871 unsigned : 1;
2872 unsigned : 1;
2873 unsigned : 1;
2874 unsigned : 1;
2875 unsigned CCP5Y : 1;
2876 unsigned CCP5X : 1;
2877 unsigned : 1;
2878 unsigned : 1;
2881 struct
2883 unsigned CCP5M : 4;
2884 unsigned : 4;
2887 struct
2889 unsigned : 4;
2890 unsigned DC5B : 2;
2891 unsigned : 2;
2893 } __CCP5CONbits_t;
2895 extern __at(0x0F74) volatile __CCP5CONbits_t CCP5CONbits;
2897 #define _CCP5M0 0x01
2898 #define _CCP5M1 0x02
2899 #define _CCP5M2 0x04
2900 #define _CCP5M3 0x08
2901 #define _DC5B0 0x10
2902 #define _CCP5Y 0x10
2903 #define _DC5B1 0x20
2904 #define _CCP5X 0x20
2906 //==============================================================================
2908 extern __at(0x0F75) __sfr CCPR5;
2909 extern __at(0x0F75) __sfr CCPR5L;
2910 extern __at(0x0F76) __sfr CCPR5H;
2912 //==============================================================================
2913 // CCP4CON Bits
2915 extern __at(0x0F77) __sfr CCP4CON;
2917 typedef union
2919 struct
2921 unsigned CCP4M0 : 1;
2922 unsigned CCP4M1 : 1;
2923 unsigned CCP4M2 : 1;
2924 unsigned CCP4M3 : 1;
2925 unsigned DC4B0 : 1;
2926 unsigned DC4B1 : 1;
2927 unsigned : 1;
2928 unsigned : 1;
2931 struct
2933 unsigned : 1;
2934 unsigned : 1;
2935 unsigned : 1;
2936 unsigned : 1;
2937 unsigned CCP4Y : 1;
2938 unsigned CCP4X : 1;
2939 unsigned : 1;
2940 unsigned : 1;
2943 struct
2945 unsigned CCP4M : 4;
2946 unsigned : 4;
2949 struct
2951 unsigned : 4;
2952 unsigned DC4B : 2;
2953 unsigned : 2;
2955 } __CCP4CONbits_t;
2957 extern __at(0x0F77) volatile __CCP4CONbits_t CCP4CONbits;
2959 #define _CCP4M0 0x01
2960 #define _CCP4M1 0x02
2961 #define _CCP4M2 0x04
2962 #define _CCP4M3 0x08
2963 #define _DC4B0 0x10
2964 #define _CCP4Y 0x10
2965 #define _DC4B1 0x20
2966 #define _CCP4X 0x20
2968 //==============================================================================
2970 extern __at(0x0F78) __sfr CCPR4;
2971 extern __at(0x0F78) __sfr CCPR4L;
2972 extern __at(0x0F79) __sfr CCPR4H;
2974 //==============================================================================
2975 // T5GCON Bits
2977 extern __at(0x0F7A) __sfr T5GCON;
2979 typedef union
2981 struct
2983 unsigned T5GSS0 : 1;
2984 unsigned T5GSS1 : 1;
2985 unsigned T5GVAL : 1;
2986 unsigned T5GGO_NOT_T5DONE : 1;
2987 unsigned T5GSPM : 1;
2988 unsigned T5GTM : 1;
2989 unsigned T5GPOL : 1;
2990 unsigned TMR5GE : 1;
2993 struct
2995 unsigned : 1;
2996 unsigned : 1;
2997 unsigned : 1;
2998 unsigned T5GGO : 1;
2999 unsigned : 1;
3000 unsigned : 1;
3001 unsigned : 1;
3002 unsigned : 1;
3005 struct
3007 unsigned : 1;
3008 unsigned : 1;
3009 unsigned : 1;
3010 unsigned NOT_T5DONE : 1;
3011 unsigned : 1;
3012 unsigned : 1;
3013 unsigned : 1;
3014 unsigned : 1;
3017 struct
3019 unsigned T5GSS : 2;
3020 unsigned : 6;
3022 } __T5GCONbits_t;
3024 extern __at(0x0F7A) volatile __T5GCONbits_t T5GCONbits;
3026 #define _T5GSS0 0x01
3027 #define _T5GSS1 0x02
3028 #define _T5GVAL 0x04
3029 #define _T5GGO_NOT_T5DONE 0x08
3030 #define _T5GGO 0x08
3031 #define _NOT_T5DONE 0x08
3032 #define _T5GSPM 0x10
3033 #define _T5GTM 0x20
3034 #define _T5GPOL 0x40
3035 #define _TMR5GE 0x80
3037 //==============================================================================
3040 //==============================================================================
3041 // T5CON Bits
3043 extern __at(0x0F7B) __sfr T5CON;
3045 typedef union
3047 struct
3049 unsigned TMR5ON : 1;
3050 unsigned RD16 : 1;
3051 unsigned NOT_T5SYNC : 1;
3052 unsigned SOSCEN : 1;
3053 unsigned T5CKPS0 : 1;
3054 unsigned T5CKPS1 : 1;
3055 unsigned TMR5CS0 : 1;
3056 unsigned TMR5CS1 : 1;
3059 struct
3061 unsigned : 4;
3062 unsigned T5CKPS : 2;
3063 unsigned : 2;
3066 struct
3068 unsigned : 6;
3069 unsigned TMR5CS : 2;
3071 } __T5CONbits_t;
3073 extern __at(0x0F7B) volatile __T5CONbits_t T5CONbits;
3075 #define _T5CON_TMR5ON 0x01
3076 #define _T5CON_RD16 0x02
3077 #define _T5CON_NOT_T5SYNC 0x04
3078 #define _T5CON_SOSCEN 0x08
3079 #define _T5CON_T5CKPS0 0x10
3080 #define _T5CON_T5CKPS1 0x20
3081 #define _T5CON_TMR5CS0 0x40
3082 #define _T5CON_TMR5CS1 0x80
3084 //==============================================================================
3086 extern __at(0x0F7C) __sfr TMR5;
3087 extern __at(0x0F7C) __sfr TMR5L;
3088 extern __at(0x0F7D) __sfr TMR5H;
3089 extern __at(0x0F7E) __sfr EECON2;
3091 //==============================================================================
3092 // EECON1 Bits
3094 extern __at(0x0F7F) __sfr EECON1;
3096 typedef struct
3098 unsigned RD : 1;
3099 unsigned WR : 1;
3100 unsigned WREN : 1;
3101 unsigned WRERR : 1;
3102 unsigned FREE : 1;
3103 unsigned : 1;
3104 unsigned CFGS : 1;
3105 unsigned EEPGD : 1;
3106 } __EECON1bits_t;
3108 extern __at(0x0F7F) volatile __EECON1bits_t EECON1bits;
3110 #define _RD 0x01
3111 #define _WR 0x02
3112 #define _WREN 0x04
3113 #define _WRERR 0x08
3114 #define _FREE 0x10
3115 #define _CFGS 0x40
3116 #define _EEPGD 0x80
3118 //==============================================================================
3121 //==============================================================================
3122 // PORTA Bits
3124 extern __at(0x0F80) __sfr PORTA;
3126 typedef union
3128 struct
3130 unsigned RA0 : 1;
3131 unsigned RA1 : 1;
3132 unsigned RA2 : 1;
3133 unsigned RA3 : 1;
3134 unsigned RA4 : 1;
3135 unsigned RA5 : 1;
3136 unsigned RA6 : 1;
3137 unsigned RA7 : 1;
3140 struct
3142 unsigned AN0 : 1;
3143 unsigned AN1 : 1;
3144 unsigned AN2 : 1;
3145 unsigned AN3 : 1;
3146 unsigned T0CKI : 1;
3147 unsigned AN4 : 1;
3148 unsigned OSC2 : 1;
3149 unsigned OSC1 : 1;
3152 struct
3154 unsigned ULPWU : 1;
3155 unsigned : 1;
3156 unsigned VREF_MINUS : 1;
3157 unsigned VREF_PLUS : 1;
3158 unsigned : 1;
3159 unsigned T1CKI : 1;
3160 unsigned CLKO : 1;
3161 unsigned CLKI : 1;
3164 struct
3166 unsigned : 1;
3167 unsigned : 1;
3168 unsigned : 1;
3169 unsigned : 1;
3170 unsigned : 1;
3171 unsigned T3G : 1;
3172 unsigned : 1;
3173 unsigned : 1;
3176 struct
3178 unsigned : 1;
3179 unsigned : 1;
3180 unsigned : 1;
3181 unsigned : 1;
3182 unsigned : 1;
3183 unsigned HLVDIN : 1;
3184 unsigned : 1;
3185 unsigned : 1;
3187 } __PORTAbits_t;
3189 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
3191 #define _RA0 0x01
3192 #define _AN0 0x01
3193 #define _ULPWU 0x01
3194 #define _RA1 0x02
3195 #define _AN1 0x02
3196 #define _RA2 0x04
3197 #define _AN2 0x04
3198 #define _VREF_MINUS 0x04
3199 #define _RA3 0x08
3200 #define _AN3 0x08
3201 #define _VREF_PLUS 0x08
3202 #define _RA4 0x10
3203 #define _T0CKI 0x10
3204 #define _RA5 0x20
3205 #define _AN4 0x20
3206 #define _T1CKI 0x20
3207 #define _T3G 0x20
3208 #define _HLVDIN 0x20
3209 #define _RA6 0x40
3210 #define _OSC2 0x40
3211 #define _CLKO 0x40
3212 #define _RA7 0x80
3213 #define _OSC1 0x80
3214 #define _CLKI 0x80
3216 //==============================================================================
3219 //==============================================================================
3220 // PORTB Bits
3222 extern __at(0x0F81) __sfr PORTB;
3224 typedef union
3226 struct
3228 unsigned RB0 : 1;
3229 unsigned RB1 : 1;
3230 unsigned RB2 : 1;
3231 unsigned RB3 : 1;
3232 unsigned RB4 : 1;
3233 unsigned RB5 : 1;
3234 unsigned RB6 : 1;
3235 unsigned RB7 : 1;
3238 struct
3240 unsigned INT0 : 1;
3241 unsigned INT1 : 1;
3242 unsigned INT2 : 1;
3243 unsigned INT3 : 1;
3244 unsigned KBI0 : 1;
3245 unsigned KBI1 : 1;
3246 unsigned KBI2 : 1;
3247 unsigned KBI3 : 1;
3250 struct
3252 unsigned FLT0 : 1;
3253 unsigned : 1;
3254 unsigned CTED1 : 1;
3255 unsigned CTED2 : 1;
3256 unsigned : 1;
3257 unsigned T3CKI : 1;
3258 unsigned PGC : 1;
3259 unsigned PGD : 1;
3262 struct
3264 unsigned : 1;
3265 unsigned : 1;
3266 unsigned : 1;
3267 unsigned CCP2_P2A : 1;
3268 unsigned : 1;
3269 unsigned T1G : 1;
3270 unsigned : 1;
3271 unsigned : 1;
3274 struct
3276 unsigned : 1;
3277 unsigned : 1;
3278 unsigned : 1;
3279 unsigned : 1;
3280 unsigned : 1;
3281 unsigned PGM : 1;
3282 unsigned : 1;
3283 unsigned : 1;
3286 struct
3288 unsigned INT : 4;
3289 unsigned : 4;
3292 struct
3294 unsigned : 4;
3295 unsigned KBI : 4;
3297 } __PORTBbits_t;
3299 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
3301 #define _RB0 0x01
3302 #define _INT0 0x01
3303 #define _FLT0 0x01
3304 #define _RB1 0x02
3305 #define _INT1 0x02
3306 #define _RB2 0x04
3307 #define _INT2 0x04
3308 #define _CTED1 0x04
3309 #define _RB3 0x08
3310 #define _INT3 0x08
3311 #define _CTED2 0x08
3312 #define _CCP2_P2A 0x08
3313 #define _RB4 0x10
3314 #define _KBI0 0x10
3315 #define _RB5 0x20
3316 #define _KBI1 0x20
3317 #define _T3CKI 0x20
3318 #define _T1G 0x20
3319 #define _PGM 0x20
3320 #define _RB6 0x40
3321 #define _KBI2 0x40
3322 #define _PGC 0x40
3323 #define _RB7 0x80
3324 #define _KBI3 0x80
3325 #define _PGD 0x80
3327 //==============================================================================
3330 //==============================================================================
3331 // PORTC Bits
3333 extern __at(0x0F82) __sfr PORTC;
3335 typedef union
3337 struct
3339 unsigned RC0 : 1;
3340 unsigned RC1 : 1;
3341 unsigned RC2 : 1;
3342 unsigned RC3 : 1;
3343 unsigned RC4 : 1;
3344 unsigned RC5 : 1;
3345 unsigned RC6 : 1;
3346 unsigned RC7 : 1;
3349 struct
3351 unsigned SOSCO : 1;
3352 unsigned SOSCI : 1;
3353 unsigned CCP1 : 1;
3354 unsigned SCK1 : 1;
3355 unsigned SDI1 : 1;
3356 unsigned SDO1 : 1;
3357 unsigned TX1 : 1;
3358 unsigned RX1 : 1;
3361 struct
3363 unsigned SCKLI : 1;
3364 unsigned CCP2 : 1;
3365 unsigned P1A : 1;
3366 unsigned SCL1 : 1;
3367 unsigned SDA1 : 1;
3368 unsigned : 1;
3369 unsigned CK1 : 1;
3370 unsigned DT1 : 1;
3373 struct
3375 unsigned : 1;
3376 unsigned P2A : 1;
3377 unsigned : 1;
3378 unsigned : 1;
3379 unsigned : 1;
3380 unsigned : 1;
3381 unsigned : 1;
3382 unsigned : 1;
3384 } __PORTCbits_t;
3386 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
3388 #define _RC0 0x01
3389 #define _SOSCO 0x01
3390 #define _SCKLI 0x01
3391 #define _RC1 0x02
3392 #define _SOSCI 0x02
3393 #define _CCP2 0x02
3394 #define _P2A 0x02
3395 #define _RC2 0x04
3396 #define _CCP1 0x04
3397 #define _P1A 0x04
3398 #define _RC3 0x08
3399 #define _SCK1 0x08
3400 #define _SCL1 0x08
3401 #define _RC4 0x10
3402 #define _SDI1 0x10
3403 #define _SDA1 0x10
3404 #define _RC5 0x20
3405 #define _SDO1 0x20
3406 #define _RC6 0x40
3407 #define _TX1 0x40
3408 #define _CK1 0x40
3409 #define _RC7 0x80
3410 #define _RX1 0x80
3411 #define _DT1 0x80
3413 //==============================================================================
3416 //==============================================================================
3417 // PORTD Bits
3419 extern __at(0x0F83) __sfr PORTD;
3421 typedef union
3423 struct
3425 unsigned RD0 : 1;
3426 unsigned RD1 : 1;
3427 unsigned RD2 : 1;
3428 unsigned RD3 : 1;
3429 unsigned RD4 : 1;
3430 unsigned RD5 : 1;
3431 unsigned RD6 : 1;
3432 unsigned RD7 : 1;
3435 struct
3437 unsigned AD0 : 1;
3438 unsigned AD1 : 1;
3439 unsigned AD2 : 1;
3440 unsigned AD3 : 1;
3441 unsigned AD4 : 1;
3442 unsigned AD5 : 1;
3443 unsigned AD6 : 1;
3444 unsigned AD7 : 1;
3447 struct
3449 unsigned PSP0 : 1;
3450 unsigned PSP1 : 1;
3451 unsigned PSP2 : 1;
3452 unsigned PSP3 : 1;
3453 unsigned PSP4 : 1;
3454 unsigned PSP5 : 1;
3455 unsigned PSP6 : 1;
3456 unsigned PSP7 : 1;
3459 struct
3461 unsigned CTPLS : 1;
3462 unsigned T5CKI : 1;
3463 unsigned : 1;
3464 unsigned : 1;
3465 unsigned SDO2 : 1;
3466 unsigned SDI2 : 1;
3467 unsigned SCK2 : 1;
3468 unsigned NOT_SS2 : 1;
3471 struct
3473 unsigned : 1;
3474 unsigned T7G : 1;
3475 unsigned : 1;
3476 unsigned : 1;
3477 unsigned : 1;
3478 unsigned SDA2 : 1;
3479 unsigned SCL2 : 1;
3480 unsigned : 1;
3482 } __PORTDbits_t;
3484 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
3486 #define _RD0 0x01
3487 #define _AD0 0x01
3488 #define _PSP0 0x01
3489 #define _CTPLS 0x01
3490 #define _RD1 0x02
3491 #define _AD1 0x02
3492 #define _PSP1 0x02
3493 #define _T5CKI 0x02
3494 #define _T7G 0x02
3495 #define _RD2 0x04
3496 #define _AD2 0x04
3497 #define _PSP2 0x04
3498 #define _RD3 0x08
3499 #define _AD3 0x08
3500 #define _PSP3 0x08
3501 #define _RD4 0x10
3502 #define _AD4 0x10
3503 #define _PSP4 0x10
3504 #define _SDO2 0x10
3505 #define _RD5 0x20
3506 #define _AD5 0x20
3507 #define _PSP5 0x20
3508 #define _SDI2 0x20
3509 #define _SDA2 0x20
3510 #define _RD6 0x40
3511 #define _AD6 0x40
3512 #define _PSP6 0x40
3513 #define _SCK2 0x40
3514 #define _SCL2 0x40
3515 #define _RD7 0x80
3516 #define _AD7 0x80
3517 #define _PSP7 0x80
3518 #define _NOT_SS2 0x80
3520 //==============================================================================
3523 //==============================================================================
3524 // PORTE Bits
3526 extern __at(0x0F84) __sfr PORTE;
3528 typedef union
3530 struct
3532 unsigned RE0 : 1;
3533 unsigned RE1 : 1;
3534 unsigned RE2 : 1;
3535 unsigned RE3 : 1;
3536 unsigned RE4 : 1;
3537 unsigned RE5 : 1;
3538 unsigned RE6 : 1;
3539 unsigned RE7 : 1;
3542 struct
3544 unsigned AD8 : 1;
3545 unsigned AD9 : 1;
3546 unsigned AD10 : 1;
3547 unsigned AD11 : 1;
3548 unsigned AD12 : 1;
3549 unsigned AD13 : 1;
3550 unsigned AD14 : 1;
3551 unsigned AD15 : 1;
3554 struct
3556 unsigned P2D : 1;
3557 unsigned P2C : 1;
3558 unsigned P2B : 1;
3559 unsigned P3C : 1;
3560 unsigned P3B : 1;
3561 unsigned P1C : 1;
3562 unsigned P1B : 1;
3563 unsigned P2A : 1;
3566 struct
3568 unsigned NOT_RD : 1;
3569 unsigned NOT_WR : 1;
3570 unsigned CCP10 : 1;
3571 unsigned CCP9 : 1;
3572 unsigned CCP8 : 1;
3573 unsigned CCP7 : 1;
3574 unsigned CCP6 : 1;
3575 unsigned CCP2 : 1;
3578 struct
3580 unsigned : 1;
3581 unsigned : 1;
3582 unsigned NOT_CS : 1;
3583 unsigned REFO : 1;
3584 unsigned : 1;
3585 unsigned : 1;
3586 unsigned : 1;
3587 unsigned : 1;
3589 } __PORTEbits_t;
3591 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
3593 #define _PORTE_RE0 0x01
3594 #define _PORTE_AD8 0x01
3595 #define _PORTE_P2D 0x01
3596 #define _PORTE_NOT_RD 0x01
3597 #define _PORTE_RE1 0x02
3598 #define _PORTE_AD9 0x02
3599 #define _PORTE_P2C 0x02
3600 #define _PORTE_NOT_WR 0x02
3601 #define _PORTE_RE2 0x04
3602 #define _PORTE_AD10 0x04
3603 #define _PORTE_P2B 0x04
3604 #define _PORTE_CCP10 0x04
3605 #define _PORTE_NOT_CS 0x04
3606 #define _PORTE_RE3 0x08
3607 #define _PORTE_AD11 0x08
3608 #define _PORTE_P3C 0x08
3609 #define _PORTE_CCP9 0x08
3610 #define _PORTE_REFO 0x08
3611 #define _PORTE_RE4 0x10
3612 #define _PORTE_AD12 0x10
3613 #define _PORTE_P3B 0x10
3614 #define _PORTE_CCP8 0x10
3615 #define _PORTE_RE5 0x20
3616 #define _PORTE_AD13 0x20
3617 #define _PORTE_P1C 0x20
3618 #define _PORTE_CCP7 0x20
3619 #define _PORTE_RE6 0x40
3620 #define _PORTE_AD14 0x40
3621 #define _PORTE_P1B 0x40
3622 #define _PORTE_CCP6 0x40
3623 #define _PORTE_RE7 0x80
3624 #define _PORTE_AD15 0x80
3625 #define _PORTE_P2A 0x80
3626 #define _PORTE_CCP2 0x80
3628 //==============================================================================
3631 //==============================================================================
3632 // PORTF Bits
3634 extern __at(0x0F85) __sfr PORTF;
3636 typedef union
3638 struct
3640 unsigned : 1;
3641 unsigned RF1 : 1;
3642 unsigned RF2 : 1;
3643 unsigned RF3 : 1;
3644 unsigned RF4 : 1;
3645 unsigned RF5 : 1;
3646 unsigned RF6 : 1;
3647 unsigned RF7 : 1;
3650 struct
3652 unsigned : 1;
3653 unsigned AN6 : 1;
3654 unsigned AN7 : 1;
3655 unsigned AN8 : 1;
3656 unsigned AN9 : 1;
3657 unsigned AN10 : 1;
3658 unsigned AN11 : 1;
3659 unsigned AN5 : 1;
3662 struct
3664 unsigned : 1;
3665 unsigned C2OUT : 1;
3666 unsigned C1OUT : 1;
3667 unsigned C2INB : 1;
3668 unsigned C2INA : 1;
3669 unsigned C1INB : 1;
3670 unsigned C1INA : 1;
3671 unsigned SS1 : 1;
3674 struct
3676 unsigned : 1;
3677 unsigned CTDIN : 1;
3678 unsigned : 1;
3679 unsigned CTMUI : 1;
3680 unsigned : 1;
3681 unsigned CVREF : 1;
3682 unsigned : 1;
3683 unsigned : 1;
3685 } __PORTFbits_t;
3687 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
3689 #define _RF1 0x02
3690 #define _AN6 0x02
3691 #define _C2OUT 0x02
3692 #define _CTDIN 0x02
3693 #define _RF2 0x04
3694 #define _AN7 0x04
3695 #define _C1OUT 0x04
3696 #define _RF3 0x08
3697 #define _AN8 0x08
3698 #define _C2INB 0x08
3699 #define _CTMUI 0x08
3700 #define _RF4 0x10
3701 #define _AN9 0x10
3702 #define _C2INA 0x10
3703 #define _RF5 0x20
3704 #define _AN10 0x20
3705 #define _C1INB 0x20
3706 #define _CVREF 0x20
3707 #define _RF6 0x40
3708 #define _AN11 0x40
3709 #define _C1INA 0x40
3710 #define _RF7 0x80
3711 #define _AN5 0x80
3712 #define _SS1 0x80
3714 //==============================================================================
3717 //==============================================================================
3718 // PORTG Bits
3720 extern __at(0x0F86) __sfr PORTG;
3722 typedef union
3724 struct
3726 unsigned RG0 : 1;
3727 unsigned RG1 : 1;
3728 unsigned RG2 : 1;
3729 unsigned RG3 : 1;
3730 unsigned RG4 : 1;
3731 unsigned RG5 : 1;
3732 unsigned : 1;
3733 unsigned : 1;
3736 struct
3738 unsigned CCP3 : 1;
3739 unsigned C3OUT : 1;
3740 unsigned C3INA : 1;
3741 unsigned C3INB : 1;
3742 unsigned C3INC : 1;
3743 unsigned : 1;
3744 unsigned : 1;
3745 unsigned : 1;
3748 struct
3750 unsigned PA3 : 1;
3751 unsigned TX2 : 1;
3752 unsigned RX2 : 1;
3753 unsigned PD3 : 1;
3754 unsigned PD1 : 1;
3755 unsigned : 1;
3756 unsigned : 1;
3757 unsigned : 1;
3760 struct
3762 unsigned : 1;
3763 unsigned AN19 : 1;
3764 unsigned AN18 : 1;
3765 unsigned AN17 : 1;
3766 unsigned AN16 : 1;
3767 unsigned : 1;
3768 unsigned : 1;
3769 unsigned : 1;
3772 struct
3774 unsigned : 1;
3775 unsigned CK2 : 1;
3776 unsigned DT2 : 1;
3777 unsigned CCP4 : 1;
3778 unsigned CCP5 : 1;
3779 unsigned : 1;
3780 unsigned : 1;
3781 unsigned : 1;
3784 struct
3786 unsigned : 1;
3787 unsigned : 1;
3788 unsigned : 1;
3789 unsigned : 1;
3790 unsigned T7CKI : 1;
3791 unsigned : 1;
3792 unsigned : 1;
3793 unsigned : 1;
3796 struct
3798 unsigned : 1;
3799 unsigned : 1;
3800 unsigned : 1;
3801 unsigned : 1;
3802 unsigned T5G : 1;
3803 unsigned : 1;
3804 unsigned : 1;
3805 unsigned : 1;
3808 struct
3810 unsigned : 1;
3811 unsigned : 1;
3812 unsigned : 1;
3813 unsigned : 1;
3814 unsigned RTCC : 1;
3815 unsigned : 1;
3816 unsigned : 1;
3817 unsigned : 1;
3820 struct
3822 unsigned RG : 6;
3823 unsigned : 2;
3825 } __PORTGbits_t;
3827 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
3829 #define _RG0 0x01
3830 #define _CCP3 0x01
3831 #define _PA3 0x01
3832 #define _RG1 0x02
3833 #define _C3OUT 0x02
3834 #define _TX2 0x02
3835 #define _AN19 0x02
3836 #define _CK2 0x02
3837 #define _RG2 0x04
3838 #define _C3INA 0x04
3839 #define _RX2 0x04
3840 #define _AN18 0x04
3841 #define _DT2 0x04
3842 #define _RG3 0x08
3843 #define _C3INB 0x08
3844 #define _PD3 0x08
3845 #define _AN17 0x08
3846 #define _CCP4 0x08
3847 #define _RG4 0x10
3848 #define _C3INC 0x10
3849 #define _PD1 0x10
3850 #define _AN16 0x10
3851 #define _CCP5 0x10
3852 #define _T7CKI 0x10
3853 #define _T5G 0x10
3854 #define _RTCC 0x10
3855 #define _RG5 0x20
3857 //==============================================================================
3860 //==============================================================================
3861 // PORTH Bits
3863 extern __at(0x0F87) __sfr PORTH;
3865 typedef union
3867 struct
3869 unsigned RH0 : 1;
3870 unsigned RH1 : 1;
3871 unsigned RH2 : 1;
3872 unsigned RH3 : 1;
3873 unsigned RH4 : 1;
3874 unsigned RH5 : 1;
3875 unsigned RH6 : 1;
3876 unsigned RH7 : 1;
3879 struct
3881 unsigned AN23 : 1;
3882 unsigned AN22 : 1;
3883 unsigned AN21 : 1;
3884 unsigned AN20 : 1;
3885 unsigned AN12 : 1;
3886 unsigned AN13 : 1;
3887 unsigned AN14 : 1;
3888 unsigned AN15 : 1;
3891 struct
3893 unsigned A16 : 1;
3894 unsigned A17 : 1;
3895 unsigned A18 : 1;
3896 unsigned A19 : 1;
3897 unsigned CCP9 : 1;
3898 unsigned CCP8 : 1;
3899 unsigned CCP7 : 1;
3900 unsigned CCP6 : 1;
3903 struct
3905 unsigned : 1;
3906 unsigned : 1;
3907 unsigned : 1;
3908 unsigned : 1;
3909 unsigned PC3 : 1;
3910 unsigned PB3 : 1;
3911 unsigned PC1 : 1;
3912 unsigned PB1 : 1;
3915 struct
3917 unsigned : 1;
3918 unsigned : 1;
3919 unsigned : 1;
3920 unsigned : 1;
3921 unsigned C2INC : 1;
3922 unsigned C2IND : 1;
3923 unsigned C1INC : 1;
3924 unsigned : 1;
3926 } __PORTHbits_t;
3928 extern __at(0x0F87) volatile __PORTHbits_t PORTHbits;
3930 #define _PORTH_RH0 0x01
3931 #define _PORTH_AN23 0x01
3932 #define _PORTH_A16 0x01
3933 #define _PORTH_RH1 0x02
3934 #define _PORTH_AN22 0x02
3935 #define _PORTH_A17 0x02
3936 #define _PORTH_RH2 0x04
3937 #define _PORTH_AN21 0x04
3938 #define _PORTH_A18 0x04
3939 #define _PORTH_RH3 0x08
3940 #define _PORTH_AN20 0x08
3941 #define _PORTH_A19 0x08
3942 #define _PORTH_RH4 0x10
3943 #define _PORTH_AN12 0x10
3944 #define _PORTH_CCP9 0x10
3945 #define _PORTH_PC3 0x10
3946 #define _PORTH_C2INC 0x10
3947 #define _PORTH_RH5 0x20
3948 #define _PORTH_AN13 0x20
3949 #define _PORTH_CCP8 0x20
3950 #define _PORTH_PB3 0x20
3951 #define _PORTH_C2IND 0x20
3952 #define _PORTH_RH6 0x40
3953 #define _PORTH_AN14 0x40
3954 #define _PORTH_CCP7 0x40
3955 #define _PORTH_PC1 0x40
3956 #define _PORTH_C1INC 0x40
3957 #define _PORTH_RH7 0x80
3958 #define _PORTH_AN15 0x80
3959 #define _PORTH_CCP6 0x80
3960 #define _PORTH_PB1 0x80
3962 //==============================================================================
3965 //==============================================================================
3966 // PORTJ Bits
3968 extern __at(0x0F88) __sfr PORTJ;
3970 typedef union
3972 struct
3974 unsigned RJ0 : 1;
3975 unsigned RJ1 : 1;
3976 unsigned RJ2 : 1;
3977 unsigned RJ3 : 1;
3978 unsigned RJ4 : 1;
3979 unsigned RJ5 : 1;
3980 unsigned RJ6 : 1;
3981 unsigned RJ7 : 1;
3984 struct
3986 unsigned ALE : 1;
3987 unsigned OE : 1;
3988 unsigned WRL : 1;
3989 unsigned WRH : 1;
3990 unsigned BA0 : 1;
3991 unsigned CE : 1;
3992 unsigned LB : 1;
3993 unsigned UB : 1;
3995 } __PORTJbits_t;
3997 extern __at(0x0F88) volatile __PORTJbits_t PORTJbits;
3999 #define _RJ0 0x01
4000 #define _ALE 0x01
4001 #define _RJ1 0x02
4002 #define _OE 0x02
4003 #define _RJ2 0x04
4004 #define _WRL 0x04
4005 #define _RJ3 0x08
4006 #define _WRH 0x08
4007 #define _RJ4 0x10
4008 #define _BA0 0x10
4009 #define _RJ5 0x20
4010 #define _CE 0x20
4011 #define _RJ6 0x40
4012 #define _LB 0x40
4013 #define _RJ7 0x80
4014 #define _UB 0x80
4016 //==============================================================================
4019 //==============================================================================
4020 // LATA Bits
4022 extern __at(0x0F89) __sfr LATA;
4024 typedef struct
4026 unsigned LATA0 : 1;
4027 unsigned LATA1 : 1;
4028 unsigned LATA2 : 1;
4029 unsigned LATA3 : 1;
4030 unsigned LATA4 : 1;
4031 unsigned LATA5 : 1;
4032 unsigned LATA6 : 1;
4033 unsigned LATA7 : 1;
4034 } __LATAbits_t;
4036 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
4038 #define _LATA0 0x01
4039 #define _LATA1 0x02
4040 #define _LATA2 0x04
4041 #define _LATA3 0x08
4042 #define _LATA4 0x10
4043 #define _LATA5 0x20
4044 #define _LATA6 0x40
4045 #define _LATA7 0x80
4047 //==============================================================================
4050 //==============================================================================
4051 // LATB Bits
4053 extern __at(0x0F8A) __sfr LATB;
4055 typedef struct
4057 unsigned LATB0 : 1;
4058 unsigned LATB1 : 1;
4059 unsigned LATB2 : 1;
4060 unsigned LATB3 : 1;
4061 unsigned LATB4 : 1;
4062 unsigned LATB5 : 1;
4063 unsigned LATB6 : 1;
4064 unsigned LATB7 : 1;
4065 } __LATBbits_t;
4067 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
4069 #define _LATB0 0x01
4070 #define _LATB1 0x02
4071 #define _LATB2 0x04
4072 #define _LATB3 0x08
4073 #define _LATB4 0x10
4074 #define _LATB5 0x20
4075 #define _LATB6 0x40
4076 #define _LATB7 0x80
4078 //==============================================================================
4081 //==============================================================================
4082 // LATC Bits
4084 extern __at(0x0F8B) __sfr LATC;
4086 typedef struct
4088 unsigned LATC0 : 1;
4089 unsigned LATC1 : 1;
4090 unsigned LATC2 : 1;
4091 unsigned LATC3 : 1;
4092 unsigned LATC4 : 1;
4093 unsigned LATC5 : 1;
4094 unsigned LATC6 : 1;
4095 unsigned LATC7 : 1;
4096 } __LATCbits_t;
4098 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
4100 #define _LATC0 0x01
4101 #define _LATC1 0x02
4102 #define _LATC2 0x04
4103 #define _LATC3 0x08
4104 #define _LATC4 0x10
4105 #define _LATC5 0x20
4106 #define _LATC6 0x40
4107 #define _LATC7 0x80
4109 //==============================================================================
4112 //==============================================================================
4113 // LATD Bits
4115 extern __at(0x0F8C) __sfr LATD;
4117 typedef struct
4119 unsigned LATD0 : 1;
4120 unsigned LATD1 : 1;
4121 unsigned LATD2 : 1;
4122 unsigned LATD3 : 1;
4123 unsigned LATD4 : 1;
4124 unsigned LATD5 : 1;
4125 unsigned LATD6 : 1;
4126 unsigned LATD7 : 1;
4127 } __LATDbits_t;
4129 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
4131 #define _LATD0 0x01
4132 #define _LATD1 0x02
4133 #define _LATD2 0x04
4134 #define _LATD3 0x08
4135 #define _LATD4 0x10
4136 #define _LATD5 0x20
4137 #define _LATD6 0x40
4138 #define _LATD7 0x80
4140 //==============================================================================
4143 //==============================================================================
4144 // LATE Bits
4146 extern __at(0x0F8D) __sfr LATE;
4148 typedef struct
4150 unsigned LATE0 : 1;
4151 unsigned LATE1 : 1;
4152 unsigned LATE2 : 1;
4153 unsigned LATE3 : 1;
4154 unsigned LATE4 : 1;
4155 unsigned LATE5 : 1;
4156 unsigned LATE6 : 1;
4157 unsigned LATE7 : 1;
4158 } __LATEbits_t;
4160 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
4162 #define _LATE0 0x01
4163 #define _LATE1 0x02
4164 #define _LATE2 0x04
4165 #define _LATE3 0x08
4166 #define _LATE4 0x10
4167 #define _LATE5 0x20
4168 #define _LATE6 0x40
4169 #define _LATE7 0x80
4171 //==============================================================================
4174 //==============================================================================
4175 // LATF Bits
4177 extern __at(0x0F8E) __sfr LATF;
4179 typedef struct
4181 unsigned : 1;
4182 unsigned LATF1 : 1;
4183 unsigned LATF2 : 1;
4184 unsigned LATF3 : 1;
4185 unsigned LATF4 : 1;
4186 unsigned LATF5 : 1;
4187 unsigned LATF6 : 1;
4188 unsigned LATF7 : 1;
4189 } __LATFbits_t;
4191 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
4193 #define _LATF1 0x02
4194 #define _LATF2 0x04
4195 #define _LATF3 0x08
4196 #define _LATF4 0x10
4197 #define _LATF5 0x20
4198 #define _LATF6 0x40
4199 #define _LATF7 0x80
4201 //==============================================================================
4204 //==============================================================================
4205 // LATG Bits
4207 extern __at(0x0F8F) __sfr LATG;
4209 typedef union
4211 struct
4213 unsigned LATG0 : 1;
4214 unsigned LATG1 : 1;
4215 unsigned LATG2 : 1;
4216 unsigned LATG3 : 1;
4217 unsigned LATG4 : 1;
4218 unsigned : 1;
4219 unsigned : 1;
4220 unsigned : 1;
4223 struct
4225 unsigned LATG : 5;
4226 unsigned : 3;
4228 } __LATGbits_t;
4230 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
4232 #define _LATG0 0x01
4233 #define _LATG1 0x02
4234 #define _LATG2 0x04
4235 #define _LATG3 0x08
4236 #define _LATG4 0x10
4238 //==============================================================================
4241 //==============================================================================
4242 // LATH Bits
4244 extern __at(0x0F90) __sfr LATH;
4246 typedef struct
4248 unsigned LATH0 : 1;
4249 unsigned LATH1 : 1;
4250 unsigned LATH2 : 1;
4251 unsigned LATH3 : 1;
4252 unsigned LATH4 : 1;
4253 unsigned LATH5 : 1;
4254 unsigned LATH6 : 1;
4255 unsigned LATH7 : 1;
4256 } __LATHbits_t;
4258 extern __at(0x0F90) volatile __LATHbits_t LATHbits;
4260 #define _LATH0 0x01
4261 #define _LATH1 0x02
4262 #define _LATH2 0x04
4263 #define _LATH3 0x08
4264 #define _LATH4 0x10
4265 #define _LATH5 0x20
4266 #define _LATH6 0x40
4267 #define _LATH7 0x80
4269 //==============================================================================
4272 //==============================================================================
4273 // LATJ Bits
4275 extern __at(0x0F91) __sfr LATJ;
4277 typedef struct
4279 unsigned LATJ0 : 1;
4280 unsigned LATJ1 : 1;
4281 unsigned LATJ2 : 1;
4282 unsigned LATJ3 : 1;
4283 unsigned LATJ4 : 1;
4284 unsigned LATJ5 : 1;
4285 unsigned LATJ6 : 1;
4286 unsigned LATJ7 : 1;
4287 } __LATJbits_t;
4289 extern __at(0x0F91) volatile __LATJbits_t LATJbits;
4291 #define _LATJ0 0x01
4292 #define _LATJ1 0x02
4293 #define _LATJ2 0x04
4294 #define _LATJ3 0x08
4295 #define _LATJ4 0x10
4296 #define _LATJ5 0x20
4297 #define _LATJ6 0x40
4298 #define _LATJ7 0x80
4300 //==============================================================================
4303 //==============================================================================
4304 // TRISA Bits
4306 extern __at(0x0F92) __sfr TRISA;
4308 typedef struct
4310 unsigned TRISA0 : 1;
4311 unsigned TRISA1 : 1;
4312 unsigned TRISA2 : 1;
4313 unsigned TRISA3 : 1;
4314 unsigned TRISA4 : 1;
4315 unsigned TRISA5 : 1;
4316 unsigned TRISA6 : 1;
4317 unsigned TRISA7 : 1;
4318 } __TRISAbits_t;
4320 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
4322 #define _TRISA0 0x01
4323 #define _TRISA1 0x02
4324 #define _TRISA2 0x04
4325 #define _TRISA3 0x08
4326 #define _TRISA4 0x10
4327 #define _TRISA5 0x20
4328 #define _TRISA6 0x40
4329 #define _TRISA7 0x80
4331 //==============================================================================
4334 //==============================================================================
4335 // TRISB Bits
4337 extern __at(0x0F93) __sfr TRISB;
4339 typedef struct
4341 unsigned TRISB0 : 1;
4342 unsigned TRISB1 : 1;
4343 unsigned TRISB2 : 1;
4344 unsigned TRISB3 : 1;
4345 unsigned TRISB4 : 1;
4346 unsigned TRISB5 : 1;
4347 unsigned TRISB6 : 1;
4348 unsigned TRISB7 : 1;
4349 } __TRISBbits_t;
4351 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
4353 #define _TRISB0 0x01
4354 #define _TRISB1 0x02
4355 #define _TRISB2 0x04
4356 #define _TRISB3 0x08
4357 #define _TRISB4 0x10
4358 #define _TRISB5 0x20
4359 #define _TRISB6 0x40
4360 #define _TRISB7 0x80
4362 //==============================================================================
4365 //==============================================================================
4366 // TRISC Bits
4368 extern __at(0x0F94) __sfr TRISC;
4370 typedef struct
4372 unsigned TRISC0 : 1;
4373 unsigned TRISC1 : 1;
4374 unsigned TRISC2 : 1;
4375 unsigned TRISC3 : 1;
4376 unsigned TRISC4 : 1;
4377 unsigned TRISC5 : 1;
4378 unsigned TRISC6 : 1;
4379 unsigned TRISC7 : 1;
4380 } __TRISCbits_t;
4382 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
4384 #define _TRISC0 0x01
4385 #define _TRISC1 0x02
4386 #define _TRISC2 0x04
4387 #define _TRISC3 0x08
4388 #define _TRISC4 0x10
4389 #define _TRISC5 0x20
4390 #define _TRISC6 0x40
4391 #define _TRISC7 0x80
4393 //==============================================================================
4396 //==============================================================================
4397 // TRISD Bits
4399 extern __at(0x0F95) __sfr TRISD;
4401 typedef struct
4403 unsigned TRISD0 : 1;
4404 unsigned TRISD1 : 1;
4405 unsigned TRISD2 : 1;
4406 unsigned TRISD3 : 1;
4407 unsigned TRISD4 : 1;
4408 unsigned TRISD5 : 1;
4409 unsigned TRISD6 : 1;
4410 unsigned TRISD7 : 1;
4411 } __TRISDbits_t;
4413 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
4415 #define _TRISD0 0x01
4416 #define _TRISD1 0x02
4417 #define _TRISD2 0x04
4418 #define _TRISD3 0x08
4419 #define _TRISD4 0x10
4420 #define _TRISD5 0x20
4421 #define _TRISD6 0x40
4422 #define _TRISD7 0x80
4424 //==============================================================================
4427 //==============================================================================
4428 // TRISE Bits
4430 extern __at(0x0F96) __sfr TRISE;
4432 typedef struct
4434 unsigned TRISE0 : 1;
4435 unsigned TRISE1 : 1;
4436 unsigned TRISE2 : 1;
4437 unsigned TRISE3 : 1;
4438 unsigned TRISE4 : 1;
4439 unsigned TRISE5 : 1;
4440 unsigned TRISE6 : 1;
4441 unsigned TRISE7 : 1;
4442 } __TRISEbits_t;
4444 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
4446 #define _TRISE0 0x01
4447 #define _TRISE1 0x02
4448 #define _TRISE2 0x04
4449 #define _TRISE3 0x08
4450 #define _TRISE4 0x10
4451 #define _TRISE5 0x20
4452 #define _TRISE6 0x40
4453 #define _TRISE7 0x80
4455 //==============================================================================
4458 //==============================================================================
4459 // TRISF Bits
4461 extern __at(0x0F97) __sfr TRISF;
4463 typedef struct
4465 unsigned : 1;
4466 unsigned TRISF1 : 1;
4467 unsigned TRISF2 : 1;
4468 unsigned TRISF3 : 1;
4469 unsigned TRISF4 : 1;
4470 unsigned TRISF5 : 1;
4471 unsigned TRISF6 : 1;
4472 unsigned TRISF7 : 1;
4473 } __TRISFbits_t;
4475 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
4477 #define _TRISF1 0x02
4478 #define _TRISF2 0x04
4479 #define _TRISF3 0x08
4480 #define _TRISF4 0x10
4481 #define _TRISF5 0x20
4482 #define _TRISF6 0x40
4483 #define _TRISF7 0x80
4485 //==============================================================================
4488 //==============================================================================
4489 // TRISG Bits
4491 extern __at(0x0F98) __sfr TRISG;
4493 typedef union
4495 struct
4497 unsigned TRISG0 : 1;
4498 unsigned TRISG1 : 1;
4499 unsigned TRISG2 : 1;
4500 unsigned TRISG3 : 1;
4501 unsigned TRISG4 : 1;
4502 unsigned : 1;
4503 unsigned : 1;
4504 unsigned : 1;
4507 struct
4509 unsigned TRISG : 5;
4510 unsigned : 3;
4512 } __TRISGbits_t;
4514 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
4516 #define _TRISG0 0x01
4517 #define _TRISG1 0x02
4518 #define _TRISG2 0x04
4519 #define _TRISG3 0x08
4520 #define _TRISG4 0x10
4522 //==============================================================================
4525 //==============================================================================
4526 // TRISH Bits
4528 extern __at(0x0F99) __sfr TRISH;
4530 typedef struct
4532 unsigned TRISH0 : 1;
4533 unsigned TRISH1 : 1;
4534 unsigned TRISH2 : 1;
4535 unsigned TRISH3 : 1;
4536 unsigned TRISH4 : 1;
4537 unsigned TRISH5 : 1;
4538 unsigned TRISH6 : 1;
4539 unsigned TRISH7 : 1;
4540 } __TRISHbits_t;
4542 extern __at(0x0F99) volatile __TRISHbits_t TRISHbits;
4544 #define _TRISH0 0x01
4545 #define _TRISH1 0x02
4546 #define _TRISH2 0x04
4547 #define _TRISH3 0x08
4548 #define _TRISH4 0x10
4549 #define _TRISH5 0x20
4550 #define _TRISH6 0x40
4551 #define _TRISH7 0x80
4553 //==============================================================================
4556 //==============================================================================
4557 // TRISJ Bits
4559 extern __at(0x0F9A) __sfr TRISJ;
4561 typedef struct
4563 unsigned TRISJ0 : 1;
4564 unsigned TRISJ1 : 1;
4565 unsigned TRISJ2 : 1;
4566 unsigned TRISJ3 : 1;
4567 unsigned TRISJ4 : 1;
4568 unsigned TRISJ5 : 1;
4569 unsigned TRISJ6 : 1;
4570 unsigned TRISJ7 : 1;
4571 } __TRISJbits_t;
4573 extern __at(0x0F9A) volatile __TRISJbits_t TRISJbits;
4575 #define _TRISJ0 0x01
4576 #define _TRISJ1 0x02
4577 #define _TRISJ2 0x04
4578 #define _TRISJ3 0x08
4579 #define _TRISJ4 0x10
4580 #define _TRISJ5 0x20
4581 #define _TRISJ6 0x40
4582 #define _TRISJ7 0x80
4584 //==============================================================================
4587 //==============================================================================
4588 // OSCTUNE Bits
4590 extern __at(0x0F9B) __sfr OSCTUNE;
4592 typedef union
4594 struct
4596 unsigned TUN0 : 1;
4597 unsigned TUN1 : 1;
4598 unsigned TUN2 : 1;
4599 unsigned TUN3 : 1;
4600 unsigned TUN4 : 1;
4601 unsigned TUN5 : 1;
4602 unsigned PLLEN : 1;
4603 unsigned INTSRC : 1;
4606 struct
4608 unsigned TUN : 6;
4609 unsigned : 2;
4611 } __OSCTUNEbits_t;
4613 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
4615 #define _TUN0 0x01
4616 #define _TUN1 0x02
4617 #define _TUN2 0x04
4618 #define _TUN3 0x08
4619 #define _TUN4 0x10
4620 #define _TUN5 0x20
4621 #define _PLLEN 0x40
4622 #define _INTSRC 0x80
4624 //==============================================================================
4627 //==============================================================================
4628 // PSTR1CON Bits
4630 extern __at(0x0F9C) __sfr PSTR1CON;
4632 typedef union
4634 struct
4636 unsigned STRA : 1;
4637 unsigned STRB : 1;
4638 unsigned STRC : 1;
4639 unsigned STRD : 1;
4640 unsigned STRSYNC : 1;
4641 unsigned : 1;
4642 unsigned CMPL0 : 1;
4643 unsigned CMPL1 : 1;
4646 struct
4648 unsigned : 6;
4649 unsigned CMPL : 2;
4651 } __PSTR1CONbits_t;
4653 extern __at(0x0F9C) volatile __PSTR1CONbits_t PSTR1CONbits;
4655 #define _STRA 0x01
4656 #define _STRB 0x02
4657 #define _STRC 0x04
4658 #define _STRD 0x08
4659 #define _STRSYNC 0x10
4660 #define _CMPL0 0x40
4661 #define _CMPL1 0x80
4663 //==============================================================================
4666 //==============================================================================
4667 // PIE1 Bits
4669 extern __at(0x0F9D) __sfr PIE1;
4671 typedef union
4673 struct
4675 unsigned TMR1IE : 1;
4676 unsigned TMR2IE : 1;
4677 unsigned TMR1GIE : 1;
4678 unsigned SSP1IE : 1;
4679 unsigned TX1IE : 1;
4680 unsigned RC1IE : 1;
4681 unsigned ADIE : 1;
4682 unsigned PSPIE : 1;
4685 struct
4687 unsigned : 1;
4688 unsigned : 1;
4689 unsigned : 1;
4690 unsigned SSPIE : 1;
4691 unsigned TXIE : 1;
4692 unsigned RCIE : 1;
4693 unsigned : 1;
4694 unsigned : 1;
4696 } __PIE1bits_t;
4698 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
4700 #define _TMR1IE 0x01
4701 #define _TMR2IE 0x02
4702 #define _TMR1GIE 0x04
4703 #define _SSP1IE 0x08
4704 #define _SSPIE 0x08
4705 #define _TX1IE 0x10
4706 #define _TXIE 0x10
4707 #define _RC1IE 0x20
4708 #define _RCIE 0x20
4709 #define _ADIE 0x40
4710 #define _PSPIE 0x80
4712 //==============================================================================
4715 //==============================================================================
4716 // PIR1 Bits
4718 extern __at(0x0F9E) __sfr PIR1;
4720 typedef union
4722 struct
4724 unsigned TMR1IF : 1;
4725 unsigned TMR2IF : 1;
4726 unsigned TMR1GIF : 1;
4727 unsigned SSP1IF : 1;
4728 unsigned TX1IF : 1;
4729 unsigned RC1IF : 1;
4730 unsigned ADIF : 1;
4731 unsigned PSPIF : 1;
4734 struct
4736 unsigned : 1;
4737 unsigned : 1;
4738 unsigned : 1;
4739 unsigned SSPIF : 1;
4740 unsigned TXIF : 1;
4741 unsigned RCIF : 1;
4742 unsigned : 1;
4743 unsigned : 1;
4745 } __PIR1bits_t;
4747 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4749 #define _TMR1IF 0x01
4750 #define _TMR2IF 0x02
4751 #define _TMR1GIF 0x04
4752 #define _SSP1IF 0x08
4753 #define _SSPIF 0x08
4754 #define _TX1IF 0x10
4755 #define _TXIF 0x10
4756 #define _RC1IF 0x20
4757 #define _RCIF 0x20
4758 #define _ADIF 0x40
4759 #define _PSPIF 0x80
4761 //==============================================================================
4764 //==============================================================================
4765 // IPR1 Bits
4767 extern __at(0x0F9F) __sfr IPR1;
4769 typedef union
4771 struct
4773 unsigned TMR1IP : 1;
4774 unsigned TMR2IP : 1;
4775 unsigned TMR1GIP : 1;
4776 unsigned SSP1IP : 1;
4777 unsigned TX1IP : 1;
4778 unsigned RC1IP : 1;
4779 unsigned ADIP : 1;
4780 unsigned PSPIP : 1;
4783 struct
4785 unsigned : 1;
4786 unsigned : 1;
4787 unsigned : 1;
4788 unsigned SSPIP : 1;
4789 unsigned TXIP : 1;
4790 unsigned RCIP : 1;
4791 unsigned : 1;
4792 unsigned : 1;
4794 } __IPR1bits_t;
4796 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4798 #define _TMR1IP 0x01
4799 #define _TMR2IP 0x02
4800 #define _TMR1GIP 0x04
4801 #define _SSP1IP 0x08
4802 #define _SSPIP 0x08
4803 #define _TX1IP 0x10
4804 #define _TXIP 0x10
4805 #define _RC1IP 0x20
4806 #define _RCIP 0x20
4807 #define _ADIP 0x40
4808 #define _PSPIP 0x80
4810 //==============================================================================
4813 //==============================================================================
4814 // PIE2 Bits
4816 extern __at(0x0FA0) __sfr PIE2;
4818 typedef union
4820 struct
4822 unsigned TMR3GIE : 1;
4823 unsigned TMR3IE : 1;
4824 unsigned HLVDIE : 1;
4825 unsigned BCL1IE : 1;
4826 unsigned BCL2IE : 1;
4827 unsigned SSP2IE : 1;
4828 unsigned : 1;
4829 unsigned OSCFIE : 1;
4832 struct
4834 unsigned : 1;
4835 unsigned : 1;
4836 unsigned LVDIE : 1;
4837 unsigned BCLIE : 1;
4838 unsigned : 1;
4839 unsigned : 1;
4840 unsigned : 1;
4841 unsigned : 1;
4843 } __PIE2bits_t;
4845 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4847 #define _TMR3GIE 0x01
4848 #define _TMR3IE 0x02
4849 #define _HLVDIE 0x04
4850 #define _LVDIE 0x04
4851 #define _BCL1IE 0x08
4852 #define _BCLIE 0x08
4853 #define _BCL2IE 0x10
4854 #define _SSP2IE 0x20
4855 #define _OSCFIE 0x80
4857 //==============================================================================
4860 //==============================================================================
4861 // PIR2 Bits
4863 extern __at(0x0FA1) __sfr PIR2;
4865 typedef union
4867 struct
4869 unsigned TMR3GIF : 1;
4870 unsigned TMR3IF : 1;
4871 unsigned HLVDIF : 1;
4872 unsigned BCL1IF : 1;
4873 unsigned BCL2IF : 1;
4874 unsigned SSP2IF : 1;
4875 unsigned : 1;
4876 unsigned OSCFIF : 1;
4879 struct
4881 unsigned : 1;
4882 unsigned : 1;
4883 unsigned LVDIF : 1;
4884 unsigned BCLIF : 1;
4885 unsigned : 1;
4886 unsigned : 1;
4887 unsigned : 1;
4888 unsigned : 1;
4890 } __PIR2bits_t;
4892 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4894 #define _TMR3GIF 0x01
4895 #define _TMR3IF 0x02
4896 #define _HLVDIF 0x04
4897 #define _LVDIF 0x04
4898 #define _BCL1IF 0x08
4899 #define _BCLIF 0x08
4900 #define _BCL2IF 0x10
4901 #define _SSP2IF 0x20
4902 #define _OSCFIF 0x80
4904 //==============================================================================
4907 //==============================================================================
4908 // IPR2 Bits
4910 extern __at(0x0FA2) __sfr IPR2;
4912 typedef union
4914 struct
4916 unsigned TMR3GIP : 1;
4917 unsigned TMR3IP : 1;
4918 unsigned HLVDIP : 1;
4919 unsigned BCL1IP : 1;
4920 unsigned BCL2IP : 1;
4921 unsigned SSP2IP : 1;
4922 unsigned : 1;
4923 unsigned OSCFIP : 1;
4926 struct
4928 unsigned : 1;
4929 unsigned : 1;
4930 unsigned LVDIP : 1;
4931 unsigned BCLIP : 1;
4932 unsigned : 1;
4933 unsigned : 1;
4934 unsigned : 1;
4935 unsigned : 1;
4937 } __IPR2bits_t;
4939 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4941 #define _TMR3GIP 0x01
4942 #define _TMR3IP 0x02
4943 #define _HLVDIP 0x04
4944 #define _LVDIP 0x04
4945 #define _BCL1IP 0x08
4946 #define _BCLIP 0x08
4947 #define _BCL2IP 0x10
4948 #define _SSP2IP 0x20
4949 #define _OSCFIP 0x80
4951 //==============================================================================
4954 //==============================================================================
4955 // PIE3 Bits
4957 extern __at(0x0FA3) __sfr PIE3;
4959 typedef struct
4961 unsigned RTCCIE : 1;
4962 unsigned CCP1IE : 1;
4963 unsigned CCP2IE : 1;
4964 unsigned CTMUIE : 1;
4965 unsigned TX2IE : 1;
4966 unsigned RC2IE : 1;
4967 unsigned : 1;
4968 unsigned TMR5GIE : 1;
4969 } __PIE3bits_t;
4971 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4973 #define _RTCCIE 0x01
4974 #define _CCP1IE 0x02
4975 #define _CCP2IE 0x04
4976 #define _CTMUIE 0x08
4977 #define _TX2IE 0x10
4978 #define _RC2IE 0x20
4979 #define _TMR5GIE 0x80
4981 //==============================================================================
4984 //==============================================================================
4985 // PIR3 Bits
4987 extern __at(0x0FA4) __sfr PIR3;
4989 typedef struct
4991 unsigned RTCCIF : 1;
4992 unsigned CCP1IF : 1;
4993 unsigned CCP2IF : 1;
4994 unsigned CTMUIF : 1;
4995 unsigned TX2IF : 1;
4996 unsigned RC2IF : 1;
4997 unsigned : 1;
4998 unsigned TMR5GIF : 1;
4999 } __PIR3bits_t;
5001 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
5003 #define _RTCCIF 0x01
5004 #define _CCP1IF 0x02
5005 #define _CCP2IF 0x04
5006 #define _CTMUIF 0x08
5007 #define _TX2IF 0x10
5008 #define _RC2IF 0x20
5009 #define _TMR5GIF 0x80
5011 //==============================================================================
5014 //==============================================================================
5015 // IPR3 Bits
5017 extern __at(0x0FA5) __sfr IPR3;
5019 typedef struct
5021 unsigned RTCCIP : 1;
5022 unsigned CCP1IP : 1;
5023 unsigned CCP2IP : 1;
5024 unsigned CTMUIP : 1;
5025 unsigned TX2IP : 1;
5026 unsigned RC2IP : 1;
5027 unsigned : 1;
5028 unsigned TMR5GIP : 1;
5029 } __IPR3bits_t;
5031 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
5033 #define _RTCCIP 0x01
5034 #define _CCP1IP 0x02
5035 #define _CCP2IP 0x04
5036 #define _CTMUIP 0x08
5037 #define _TX2IP 0x10
5038 #define _RC2IP 0x20
5039 #define _TMR5GIP 0x80
5041 //==============================================================================
5044 //==============================================================================
5045 // PIR6 Bits
5047 extern __at(0x0FA6) __sfr PIR6;
5049 typedef struct
5051 unsigned CMP1IF : 1;
5052 unsigned CMP2IF : 1;
5053 unsigned CMP3IF : 1;
5054 unsigned : 1;
5055 unsigned EEIF : 1;
5056 unsigned : 1;
5057 unsigned : 1;
5058 unsigned : 1;
5059 } __PIR6bits_t;
5061 extern __at(0x0FA6) volatile __PIR6bits_t PIR6bits;
5063 #define _CMP1IF 0x01
5064 #define _CMP2IF 0x02
5065 #define _CMP3IF 0x04
5066 #define _EEIF 0x10
5068 //==============================================================================
5071 //==============================================================================
5072 // PSPCON Bits
5074 extern __at(0x0FA7) __sfr PSPCON;
5076 typedef struct
5078 unsigned : 1;
5079 unsigned : 1;
5080 unsigned : 1;
5081 unsigned : 1;
5082 unsigned PSPMODE : 1;
5083 unsigned IBOV : 1;
5084 unsigned OBF : 1;
5085 unsigned IBF : 1;
5086 } __PSPCONbits_t;
5088 extern __at(0x0FA7) volatile __PSPCONbits_t PSPCONbits;
5090 #define _PSPMODE 0x10
5091 #define _IBOV 0x20
5092 #define _OBF 0x40
5093 #define _IBF 0x80
5095 //==============================================================================
5098 //==============================================================================
5099 // HLVDCON Bits
5101 extern __at(0x0FA8) __sfr HLVDCON;
5103 typedef union
5105 struct
5107 unsigned HLVDL0 : 1;
5108 unsigned HLVDL1 : 1;
5109 unsigned HLVDL2 : 1;
5110 unsigned HLVDL3 : 1;
5111 unsigned HLVDEN : 1;
5112 unsigned IRVST : 1;
5113 unsigned BGVST : 1;
5114 unsigned VDIRMAG : 1;
5117 struct
5119 unsigned HLVDL : 4;
5120 unsigned : 4;
5122 } __HLVDCONbits_t;
5124 extern __at(0x0FA8) volatile __HLVDCONbits_t HLVDCONbits;
5126 #define _HLVDL0 0x01
5127 #define _HLVDL1 0x02
5128 #define _HLVDL2 0x04
5129 #define _HLVDL3 0x08
5130 #define _HLVDEN 0x10
5131 #define _IRVST 0x20
5132 #define _BGVST 0x40
5133 #define _VDIRMAG 0x80
5135 //==============================================================================
5138 //==============================================================================
5139 // IPR6 Bits
5141 extern __at(0x0FA9) __sfr IPR6;
5143 typedef struct
5145 unsigned CMP1IP : 1;
5146 unsigned CMP2IP : 1;
5147 unsigned CMP3IP : 1;
5148 unsigned : 1;
5149 unsigned EEIP : 1;
5150 unsigned : 1;
5151 unsigned : 1;
5152 unsigned : 1;
5153 } __IPR6bits_t;
5155 extern __at(0x0FA9) volatile __IPR6bits_t IPR6bits;
5157 #define _CMP1IP 0x01
5158 #define _CMP2IP 0x02
5159 #define _CMP3IP 0x04
5160 #define _EEIP 0x10
5162 //==============================================================================
5165 //==============================================================================
5166 // T1GCON Bits
5168 extern __at(0x0FAA) __sfr T1GCON;
5170 typedef union
5172 struct
5174 unsigned T1GSS0 : 1;
5175 unsigned T1GSS1 : 1;
5176 unsigned T1GVAL : 1;
5177 unsigned T1GGO_NOT_T1DONE : 1;
5178 unsigned T1GSPM : 1;
5179 unsigned T1GTM : 1;
5180 unsigned T1GPOL : 1;
5181 unsigned TMR1GE : 1;
5184 struct
5186 unsigned : 1;
5187 unsigned : 1;
5188 unsigned : 1;
5189 unsigned T1GGO : 1;
5190 unsigned : 1;
5191 unsigned : 1;
5192 unsigned : 1;
5193 unsigned : 1;
5196 struct
5198 unsigned : 1;
5199 unsigned : 1;
5200 unsigned : 1;
5201 unsigned NOT_T1DONE : 1;
5202 unsigned : 1;
5203 unsigned : 1;
5204 unsigned : 1;
5205 unsigned : 1;
5208 struct
5210 unsigned T1GSS : 2;
5211 unsigned : 6;
5213 } __T1GCONbits_t;
5215 extern __at(0x0FAA) volatile __T1GCONbits_t T1GCONbits;
5217 #define _T1GSS0 0x01
5218 #define _T1GSS1 0x02
5219 #define _T1GVAL 0x04
5220 #define _T1GGO_NOT_T1DONE 0x08
5221 #define _T1GGO 0x08
5222 #define _NOT_T1DONE 0x08
5223 #define _T1GSPM 0x10
5224 #define _T1GTM 0x20
5225 #define _T1GPOL 0x40
5226 #define _TMR1GE 0x80
5228 //==============================================================================
5231 //==============================================================================
5232 // RCSTA Bits
5234 extern __at(0x0FAB) __sfr RCSTA;
5236 typedef union
5238 struct
5240 unsigned RX9D : 1;
5241 unsigned OERR : 1;
5242 unsigned FERR : 1;
5243 unsigned ADDEN : 1;
5244 unsigned CREN : 1;
5245 unsigned SREN : 1;
5246 unsigned RX9 : 1;
5247 unsigned SPEN : 1;
5250 struct
5252 unsigned RCD8 : 1;
5253 unsigned OERR1 : 1;
5254 unsigned FERR1 : 1;
5255 unsigned ADEN : 1;
5256 unsigned CREN1 : 1;
5257 unsigned SREN1 : 1;
5258 unsigned RC9 : 1;
5259 unsigned SPEN1 : 1;
5262 struct
5264 unsigned RX9D1 : 1;
5265 unsigned : 1;
5266 unsigned : 1;
5267 unsigned ADDEN1 : 1;
5268 unsigned : 1;
5269 unsigned : 1;
5270 unsigned NOT_RC8 : 1;
5271 unsigned : 1;
5274 struct
5276 unsigned : 1;
5277 unsigned : 1;
5278 unsigned : 1;
5279 unsigned : 1;
5280 unsigned : 1;
5281 unsigned : 1;
5282 unsigned RC8_9 : 1;
5283 unsigned : 1;
5286 struct
5288 unsigned : 1;
5289 unsigned : 1;
5290 unsigned : 1;
5291 unsigned : 1;
5292 unsigned : 1;
5293 unsigned : 1;
5294 unsigned RX91 : 1;
5295 unsigned : 1;
5297 } __RCSTAbits_t;
5299 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
5301 #define _RX9D 0x01
5302 #define _RCD8 0x01
5303 #define _RX9D1 0x01
5304 #define _OERR 0x02
5305 #define _OERR1 0x02
5306 #define _FERR 0x04
5307 #define _FERR1 0x04
5308 #define _ADDEN 0x08
5309 #define _ADEN 0x08
5310 #define _ADDEN1 0x08
5311 #define _CREN 0x10
5312 #define _CREN1 0x10
5313 #define _SREN 0x20
5314 #define _SREN1 0x20
5315 #define _RX9 0x40
5316 #define _RC9 0x40
5317 #define _NOT_RC8 0x40
5318 #define _RC8_9 0x40
5319 #define _RX91 0x40
5320 #define _SPEN 0x80
5321 #define _SPEN1 0x80
5323 //==============================================================================
5326 //==============================================================================
5327 // RCSTA1 Bits
5329 extern __at(0x0FAB) __sfr RCSTA1;
5331 typedef union
5333 struct
5335 unsigned RX9D : 1;
5336 unsigned OERR : 1;
5337 unsigned FERR : 1;
5338 unsigned ADDEN : 1;
5339 unsigned CREN : 1;
5340 unsigned SREN : 1;
5341 unsigned RX9 : 1;
5342 unsigned SPEN : 1;
5345 struct
5347 unsigned RCD8 : 1;
5348 unsigned OERR1 : 1;
5349 unsigned FERR1 : 1;
5350 unsigned ADEN : 1;
5351 unsigned CREN1 : 1;
5352 unsigned SREN1 : 1;
5353 unsigned RC9 : 1;
5354 unsigned SPEN1 : 1;
5357 struct
5359 unsigned RX9D1 : 1;
5360 unsigned : 1;
5361 unsigned : 1;
5362 unsigned ADDEN1 : 1;
5363 unsigned : 1;
5364 unsigned : 1;
5365 unsigned NOT_RC8 : 1;
5366 unsigned : 1;
5369 struct
5371 unsigned : 1;
5372 unsigned : 1;
5373 unsigned : 1;
5374 unsigned : 1;
5375 unsigned : 1;
5376 unsigned : 1;
5377 unsigned RC8_9 : 1;
5378 unsigned : 1;
5381 struct
5383 unsigned : 1;
5384 unsigned : 1;
5385 unsigned : 1;
5386 unsigned : 1;
5387 unsigned : 1;
5388 unsigned : 1;
5389 unsigned RX91 : 1;
5390 unsigned : 1;
5392 } __RCSTA1bits_t;
5394 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
5396 #define _RCSTA1_RX9D 0x01
5397 #define _RCSTA1_RCD8 0x01
5398 #define _RCSTA1_RX9D1 0x01
5399 #define _RCSTA1_OERR 0x02
5400 #define _RCSTA1_OERR1 0x02
5401 #define _RCSTA1_FERR 0x04
5402 #define _RCSTA1_FERR1 0x04
5403 #define _RCSTA1_ADDEN 0x08
5404 #define _RCSTA1_ADEN 0x08
5405 #define _RCSTA1_ADDEN1 0x08
5406 #define _RCSTA1_CREN 0x10
5407 #define _RCSTA1_CREN1 0x10
5408 #define _RCSTA1_SREN 0x20
5409 #define _RCSTA1_SREN1 0x20
5410 #define _RCSTA1_RX9 0x40
5411 #define _RCSTA1_RC9 0x40
5412 #define _RCSTA1_NOT_RC8 0x40
5413 #define _RCSTA1_RC8_9 0x40
5414 #define _RCSTA1_RX91 0x40
5415 #define _RCSTA1_SPEN 0x80
5416 #define _RCSTA1_SPEN1 0x80
5418 //==============================================================================
5421 //==============================================================================
5422 // TXSTA Bits
5424 extern __at(0x0FAC) __sfr TXSTA;
5426 typedef union
5428 struct
5430 unsigned TX9D : 1;
5431 unsigned TRMT : 1;
5432 unsigned BRGH : 1;
5433 unsigned SENDB : 1;
5434 unsigned SYNC : 1;
5435 unsigned TXEN : 1;
5436 unsigned TX9 : 1;
5437 unsigned CSRC : 1;
5440 struct
5442 unsigned TXD8 : 1;
5443 unsigned TRMT1 : 1;
5444 unsigned BRGH1 : 1;
5445 unsigned SENDB1 : 1;
5446 unsigned SYNC1 : 1;
5447 unsigned TXEN1 : 1;
5448 unsigned TX8_9 : 1;
5449 unsigned CSRC1 : 1;
5452 struct
5454 unsigned TX9D1 : 1;
5455 unsigned : 1;
5456 unsigned : 1;
5457 unsigned : 1;
5458 unsigned : 1;
5459 unsigned : 1;
5460 unsigned NOT_TX8 : 1;
5461 unsigned : 1;
5464 struct
5466 unsigned : 1;
5467 unsigned : 1;
5468 unsigned : 1;
5469 unsigned : 1;
5470 unsigned : 1;
5471 unsigned : 1;
5472 unsigned TX91 : 1;
5473 unsigned : 1;
5475 } __TXSTAbits_t;
5477 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
5479 #define _TX9D 0x01
5480 #define _TXD8 0x01
5481 #define _TX9D1 0x01
5482 #define _TRMT 0x02
5483 #define _TRMT1 0x02
5484 #define _BRGH 0x04
5485 #define _BRGH1 0x04
5486 #define _SENDB 0x08
5487 #define _SENDB1 0x08
5488 #define _SYNC 0x10
5489 #define _SYNC1 0x10
5490 #define _TXEN 0x20
5491 #define _TXEN1 0x20
5492 #define _TX9 0x40
5493 #define _TX8_9 0x40
5494 #define _NOT_TX8 0x40
5495 #define _TX91 0x40
5496 #define _CSRC 0x80
5497 #define _CSRC1 0x80
5499 //==============================================================================
5502 //==============================================================================
5503 // TXSTA1 Bits
5505 extern __at(0x0FAC) __sfr TXSTA1;
5507 typedef union
5509 struct
5511 unsigned TX9D : 1;
5512 unsigned TRMT : 1;
5513 unsigned BRGH : 1;
5514 unsigned SENDB : 1;
5515 unsigned SYNC : 1;
5516 unsigned TXEN : 1;
5517 unsigned TX9 : 1;
5518 unsigned CSRC : 1;
5521 struct
5523 unsigned TXD8 : 1;
5524 unsigned TRMT1 : 1;
5525 unsigned BRGH1 : 1;
5526 unsigned SENDB1 : 1;
5527 unsigned SYNC1 : 1;
5528 unsigned TXEN1 : 1;
5529 unsigned TX8_9 : 1;
5530 unsigned CSRC1 : 1;
5533 struct
5535 unsigned TX9D1 : 1;
5536 unsigned : 1;
5537 unsigned : 1;
5538 unsigned : 1;
5539 unsigned : 1;
5540 unsigned : 1;
5541 unsigned NOT_TX8 : 1;
5542 unsigned : 1;
5545 struct
5547 unsigned : 1;
5548 unsigned : 1;
5549 unsigned : 1;
5550 unsigned : 1;
5551 unsigned : 1;
5552 unsigned : 1;
5553 unsigned TX91 : 1;
5554 unsigned : 1;
5556 } __TXSTA1bits_t;
5558 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
5560 #define _TXSTA1_TX9D 0x01
5561 #define _TXSTA1_TXD8 0x01
5562 #define _TXSTA1_TX9D1 0x01
5563 #define _TXSTA1_TRMT 0x02
5564 #define _TXSTA1_TRMT1 0x02
5565 #define _TXSTA1_BRGH 0x04
5566 #define _TXSTA1_BRGH1 0x04
5567 #define _TXSTA1_SENDB 0x08
5568 #define _TXSTA1_SENDB1 0x08
5569 #define _TXSTA1_SYNC 0x10
5570 #define _TXSTA1_SYNC1 0x10
5571 #define _TXSTA1_TXEN 0x20
5572 #define _TXSTA1_TXEN1 0x20
5573 #define _TXSTA1_TX9 0x40
5574 #define _TXSTA1_TX8_9 0x40
5575 #define _TXSTA1_NOT_TX8 0x40
5576 #define _TXSTA1_TX91 0x40
5577 #define _TXSTA1_CSRC 0x80
5578 #define _TXSTA1_CSRC1 0x80
5580 //==============================================================================
5582 extern __at(0x0FAD) __sfr TXREG;
5583 extern __at(0x0FAD) __sfr TXREG1;
5584 extern __at(0x0FAE) __sfr RCREG;
5585 extern __at(0x0FAE) __sfr RCREG1;
5586 extern __at(0x0FAF) __sfr SPBRG;
5587 extern __at(0x0FAF) __sfr SPBRG1;
5589 //==============================================================================
5590 // T3GCON Bits
5592 extern __at(0x0FB0) __sfr T3GCON;
5594 typedef union
5596 struct
5598 unsigned T3GSS0 : 1;
5599 unsigned T3GSS1 : 1;
5600 unsigned T3GVAL : 1;
5601 unsigned T3GGO_NOT_T3DONE : 1;
5602 unsigned T3GSPM : 1;
5603 unsigned T3GTM : 1;
5604 unsigned T3GPOL : 1;
5605 unsigned TMR3GE : 1;
5608 struct
5610 unsigned : 1;
5611 unsigned : 1;
5612 unsigned : 1;
5613 unsigned T3GGO : 1;
5614 unsigned : 1;
5615 unsigned : 1;
5616 unsigned : 1;
5617 unsigned : 1;
5620 struct
5622 unsigned : 1;
5623 unsigned : 1;
5624 unsigned : 1;
5625 unsigned NOT_T3DONE : 1;
5626 unsigned : 1;
5627 unsigned : 1;
5628 unsigned : 1;
5629 unsigned : 1;
5632 struct
5634 unsigned T3GSS : 2;
5635 unsigned : 6;
5637 } __T3GCONbits_t;
5639 extern __at(0x0FB0) volatile __T3GCONbits_t T3GCONbits;
5641 #define _T3GSS0 0x01
5642 #define _T3GSS1 0x02
5643 #define _T3GVAL 0x04
5644 #define _T3GGO_NOT_T3DONE 0x08
5645 #define _T3GGO 0x08
5646 #define _NOT_T3DONE 0x08
5647 #define _T3GSPM 0x10
5648 #define _T3GTM 0x20
5649 #define _T3GPOL 0x40
5650 #define _TMR3GE 0x80
5652 //==============================================================================
5655 //==============================================================================
5656 // T3CON Bits
5658 extern __at(0x0FB1) __sfr T3CON;
5660 typedef union
5662 struct
5664 unsigned TMR3ON : 1;
5665 unsigned RD16 : 1;
5666 unsigned NOT_T3SYNC : 1;
5667 unsigned SOSCEN : 1;
5668 unsigned T3CKPS0 : 1;
5669 unsigned T3CKPS1 : 1;
5670 unsigned TMR3CS0 : 1;
5671 unsigned TMR3CS1 : 1;
5674 struct
5676 unsigned : 4;
5677 unsigned T3CKPS : 2;
5678 unsigned : 2;
5681 struct
5683 unsigned : 6;
5684 unsigned TMR3CS : 2;
5686 } __T3CONbits_t;
5688 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
5690 #define _T3CON_TMR3ON 0x01
5691 #define _T3CON_RD16 0x02
5692 #define _T3CON_NOT_T3SYNC 0x04
5693 #define _T3CON_SOSCEN 0x08
5694 #define _T3CON_T3CKPS0 0x10
5695 #define _T3CON_T3CKPS1 0x20
5696 #define _T3CON_TMR3CS0 0x40
5697 #define _T3CON_TMR3CS1 0x80
5699 //==============================================================================
5701 extern __at(0x0FB2) __sfr TMR3;
5702 extern __at(0x0FB2) __sfr TMR3L;
5703 extern __at(0x0FB3) __sfr TMR3H;
5705 //==============================================================================
5706 // CMSTAT Bits
5708 extern __at(0x0FB4) __sfr CMSTAT;
5710 typedef struct
5712 unsigned : 1;
5713 unsigned : 1;
5714 unsigned : 1;
5715 unsigned : 1;
5716 unsigned : 1;
5717 unsigned CMP1OUT : 1;
5718 unsigned CMP2OUT : 1;
5719 unsigned CMP3OUT : 1;
5720 } __CMSTATbits_t;
5722 extern __at(0x0FB4) volatile __CMSTATbits_t CMSTATbits;
5724 #define _CMP1OUT 0x20
5725 #define _CMP2OUT 0x40
5726 #define _CMP3OUT 0x80
5728 //==============================================================================
5731 //==============================================================================
5732 // CMSTATUS Bits
5734 extern __at(0x0FB4) __sfr CMSTATUS;
5736 typedef struct
5738 unsigned : 1;
5739 unsigned : 1;
5740 unsigned : 1;
5741 unsigned : 1;
5742 unsigned : 1;
5743 unsigned CMP1OUT : 1;
5744 unsigned CMP2OUT : 1;
5745 unsigned CMP3OUT : 1;
5746 } __CMSTATUSbits_t;
5748 extern __at(0x0FB4) volatile __CMSTATUSbits_t CMSTATUSbits;
5750 #define _CMSTATUS_CMP1OUT 0x20
5751 #define _CMSTATUS_CMP2OUT 0x40
5752 #define _CMSTATUS_CMP3OUT 0x80
5754 //==============================================================================
5757 //==============================================================================
5758 // CVRCON Bits
5760 extern __at(0x0FB5) __sfr CVRCON;
5762 typedef union
5764 struct
5766 unsigned CVR0 : 1;
5767 unsigned CVR1 : 1;
5768 unsigned CVR2 : 1;
5769 unsigned CVR3 : 1;
5770 unsigned CVR4 : 1;
5771 unsigned CVRSS : 1;
5772 unsigned CVROE : 1;
5773 unsigned CVREN : 1;
5776 struct
5778 unsigned CVR : 5;
5779 unsigned : 3;
5781 } __CVRCONbits_t;
5783 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
5785 #define _CVR0 0x01
5786 #define _CVR1 0x02
5787 #define _CVR2 0x04
5788 #define _CVR3 0x08
5789 #define _CVR4 0x10
5790 #define _CVRSS 0x20
5791 #define _CVROE 0x40
5792 #define _CVREN 0x80
5794 //==============================================================================
5797 //==============================================================================
5798 // PIE4 Bits
5800 extern __at(0x0FB6) __sfr PIE4;
5802 typedef struct
5804 unsigned CCP3IE : 1;
5805 unsigned CCP4IE : 1;
5806 unsigned CCP5IE : 1;
5807 unsigned CCP6IE : 1;
5808 unsigned CCP7IE : 1;
5809 unsigned CCP8IE : 1;
5810 unsigned CCP9IE : 1;
5811 unsigned CCP10IE : 1;
5812 } __PIE4bits_t;
5814 extern __at(0x0FB6) volatile __PIE4bits_t PIE4bits;
5816 #define _CCP3IE 0x01
5817 #define _CCP4IE 0x02
5818 #define _CCP5IE 0x04
5819 #define _CCP6IE 0x08
5820 #define _CCP7IE 0x10
5821 #define _CCP8IE 0x20
5822 #define _CCP9IE 0x40
5823 #define _CCP10IE 0x80
5825 //==============================================================================
5828 //==============================================================================
5829 // PIR4 Bits
5831 extern __at(0x0FB7) __sfr PIR4;
5833 typedef struct
5835 unsigned CCP3IF : 1;
5836 unsigned CCP4IF : 1;
5837 unsigned CCP5IF : 1;
5838 unsigned CCP6IF : 1;
5839 unsigned CCP7IF : 1;
5840 unsigned CCP8IF : 1;
5841 unsigned CCP9IF : 1;
5842 unsigned CCP10IF : 1;
5843 } __PIR4bits_t;
5845 extern __at(0x0FB7) volatile __PIR4bits_t PIR4bits;
5847 #define _CCP3IF 0x01
5848 #define _CCP4IF 0x02
5849 #define _CCP5IF 0x04
5850 #define _CCP6IF 0x08
5851 #define _CCP7IF 0x10
5852 #define _CCP8IF 0x20
5853 #define _CCP9IF 0x40
5854 #define _CCP10IF 0x80
5856 //==============================================================================
5859 //==============================================================================
5860 // IPR4 Bits
5862 extern __at(0x0FB8) __sfr IPR4;
5864 typedef struct
5866 unsigned CCP3IP : 1;
5867 unsigned CCP4IP : 1;
5868 unsigned CCP5IP : 1;
5869 unsigned CCP6IP : 1;
5870 unsigned CCP7IP : 1;
5871 unsigned CCP8IP : 1;
5872 unsigned CCP9IP : 1;
5873 unsigned CCP10IP : 1;
5874 } __IPR4bits_t;
5876 extern __at(0x0FB8) volatile __IPR4bits_t IPR4bits;
5878 #define _CCP3IP 0x01
5879 #define _CCP4IP 0x02
5880 #define _CCP5IP 0x04
5881 #define _CCP6IP 0x08
5882 #define _CCP7IP 0x10
5883 #define _CCP8IP 0x20
5884 #define _CCP9IP 0x40
5885 #define _CCP10IP 0x80
5887 //==============================================================================
5890 //==============================================================================
5891 // PIE5 Bits
5893 extern __at(0x0FB9) __sfr PIE5;
5895 typedef struct
5897 unsigned TMR4IE : 1;
5898 unsigned TMR5IE : 1;
5899 unsigned TMR6IE : 1;
5900 unsigned TMR7IE : 1;
5901 unsigned TMR8IE : 1;
5902 unsigned TMR10IE : 1;
5903 unsigned TMR12IE : 1;
5904 unsigned TMR7GIE : 1;
5905 } __PIE5bits_t;
5907 extern __at(0x0FB9) volatile __PIE5bits_t PIE5bits;
5909 #define _TMR4IE 0x01
5910 #define _TMR5IE 0x02
5911 #define _TMR6IE 0x04
5912 #define _TMR7IE 0x08
5913 #define _TMR8IE 0x10
5914 #define _TMR10IE 0x20
5915 #define _TMR12IE 0x40
5916 #define _TMR7GIE 0x80
5918 //==============================================================================
5921 //==============================================================================
5922 // PIR5 Bits
5924 extern __at(0x0FBA) __sfr PIR5;
5926 typedef struct
5928 unsigned TMR4IF : 1;
5929 unsigned TMR5IF : 1;
5930 unsigned TMR6IF : 1;
5931 unsigned TMR7IF : 1;
5932 unsigned TMR8IF : 1;
5933 unsigned TMR10IF : 1;
5934 unsigned TMR12IF : 1;
5935 unsigned TMR7GIF : 1;
5936 } __PIR5bits_t;
5938 extern __at(0x0FBA) volatile __PIR5bits_t PIR5bits;
5940 #define _TMR4IF 0x01
5941 #define _TMR5IF 0x02
5942 #define _TMR6IF 0x04
5943 #define _TMR7IF 0x08
5944 #define _TMR8IF 0x10
5945 #define _TMR10IF 0x20
5946 #define _TMR12IF 0x40
5947 #define _TMR7GIF 0x80
5949 //==============================================================================
5952 //==============================================================================
5953 // CCP1CON Bits
5955 extern __at(0x0FBB) __sfr CCP1CON;
5957 typedef union
5959 struct
5961 unsigned CCP1M0 : 1;
5962 unsigned CCP1M1 : 1;
5963 unsigned CCP1M2 : 1;
5964 unsigned CCP1M3 : 1;
5965 unsigned DC1B0 : 1;
5966 unsigned DC1B1 : 1;
5967 unsigned P1M0 : 1;
5968 unsigned P1M1 : 1;
5971 struct
5973 unsigned : 1;
5974 unsigned : 1;
5975 unsigned : 1;
5976 unsigned : 1;
5977 unsigned CCP1Y : 1;
5978 unsigned CCP1X : 1;
5979 unsigned : 1;
5980 unsigned : 1;
5983 struct
5985 unsigned CCP1M : 4;
5986 unsigned : 4;
5989 struct
5991 unsigned : 4;
5992 unsigned DC1B : 2;
5993 unsigned : 2;
5996 struct
5998 unsigned : 6;
5999 unsigned P1M : 2;
6001 } __CCP1CONbits_t;
6003 extern __at(0x0FBB) volatile __CCP1CONbits_t CCP1CONbits;
6005 #define _CCP1M0 0x01
6006 #define _CCP1M1 0x02
6007 #define _CCP1M2 0x04
6008 #define _CCP1M3 0x08
6009 #define _DC1B0 0x10
6010 #define _CCP1Y 0x10
6011 #define _DC1B1 0x20
6012 #define _CCP1X 0x20
6013 #define _P1M0 0x40
6014 #define _P1M1 0x80
6016 //==============================================================================
6019 //==============================================================================
6020 // ECCP1CON Bits
6022 extern __at(0x0FBB) __sfr ECCP1CON;
6024 typedef union
6026 struct
6028 unsigned CCP1M0 : 1;
6029 unsigned CCP1M1 : 1;
6030 unsigned CCP1M2 : 1;
6031 unsigned CCP1M3 : 1;
6032 unsigned DC1B0 : 1;
6033 unsigned DC1B1 : 1;
6034 unsigned P1M0 : 1;
6035 unsigned P1M1 : 1;
6038 struct
6040 unsigned : 1;
6041 unsigned : 1;
6042 unsigned : 1;
6043 unsigned : 1;
6044 unsigned CCP1Y : 1;
6045 unsigned CCP1X : 1;
6046 unsigned : 1;
6047 unsigned : 1;
6050 struct
6052 unsigned CCP1M : 4;
6053 unsigned : 4;
6056 struct
6058 unsigned : 4;
6059 unsigned DC1B : 2;
6060 unsigned : 2;
6063 struct
6065 unsigned : 6;
6066 unsigned P1M : 2;
6068 } __ECCP1CONbits_t;
6070 extern __at(0x0FBB) volatile __ECCP1CONbits_t ECCP1CONbits;
6072 #define _ECCP1CON_CCP1M0 0x01
6073 #define _ECCP1CON_CCP1M1 0x02
6074 #define _ECCP1CON_CCP1M2 0x04
6075 #define _ECCP1CON_CCP1M3 0x08
6076 #define _ECCP1CON_DC1B0 0x10
6077 #define _ECCP1CON_CCP1Y 0x10
6078 #define _ECCP1CON_DC1B1 0x20
6079 #define _ECCP1CON_CCP1X 0x20
6080 #define _ECCP1CON_P1M0 0x40
6081 #define _ECCP1CON_P1M1 0x80
6083 //==============================================================================
6085 extern __at(0x0FBC) __sfr CCPR1;
6086 extern __at(0x0FBC) __sfr CCPR1L;
6087 extern __at(0x0FBD) __sfr CCPR1H;
6089 //==============================================================================
6090 // ECCP1DEL Bits
6092 extern __at(0x0FBE) __sfr ECCP1DEL;
6094 typedef union
6096 struct
6098 unsigned P1DC0 : 1;
6099 unsigned P1DC1 : 1;
6100 unsigned P1DC2 : 1;
6101 unsigned P1DC3 : 1;
6102 unsigned P1DC4 : 1;
6103 unsigned P1DC5 : 1;
6104 unsigned P1DC6 : 1;
6105 unsigned P1RSEN : 1;
6108 struct
6110 unsigned P1DC : 7;
6111 unsigned : 1;
6113 } __ECCP1DELbits_t;
6115 extern __at(0x0FBE) volatile __ECCP1DELbits_t ECCP1DELbits;
6117 #define _P1DC0 0x01
6118 #define _P1DC1 0x02
6119 #define _P1DC2 0x04
6120 #define _P1DC3 0x08
6121 #define _P1DC4 0x10
6122 #define _P1DC5 0x20
6123 #define _P1DC6 0x40
6124 #define _P1RSEN 0x80
6126 //==============================================================================
6129 //==============================================================================
6130 // PWM1CON Bits
6132 extern __at(0x0FBE) __sfr PWM1CON;
6134 typedef union
6136 struct
6138 unsigned P1DC0 : 1;
6139 unsigned P1DC1 : 1;
6140 unsigned P1DC2 : 1;
6141 unsigned P1DC3 : 1;
6142 unsigned P1DC4 : 1;
6143 unsigned P1DC5 : 1;
6144 unsigned P1DC6 : 1;
6145 unsigned P1RSEN : 1;
6148 struct
6150 unsigned P1DC : 7;
6151 unsigned : 1;
6153 } __PWM1CONbits_t;
6155 extern __at(0x0FBE) volatile __PWM1CONbits_t PWM1CONbits;
6157 #define _PWM1CON_P1DC0 0x01
6158 #define _PWM1CON_P1DC1 0x02
6159 #define _PWM1CON_P1DC2 0x04
6160 #define _PWM1CON_P1DC3 0x08
6161 #define _PWM1CON_P1DC4 0x10
6162 #define _PWM1CON_P1DC5 0x20
6163 #define _PWM1CON_P1DC6 0x40
6164 #define _PWM1CON_P1RSEN 0x80
6166 //==============================================================================
6169 //==============================================================================
6170 // ECCP1AS Bits
6172 extern __at(0x0FBF) __sfr ECCP1AS;
6174 typedef union
6176 struct
6178 unsigned PSS1BD0 : 1;
6179 unsigned PSS1BD1 : 1;
6180 unsigned PSS1AC0 : 1;
6181 unsigned PSS1AC1 : 1;
6182 unsigned ECCP1AS0 : 1;
6183 unsigned ECCP1AS1 : 1;
6184 unsigned ECCP1AS2 : 1;
6185 unsigned ECCP1ASE : 1;
6188 struct
6190 unsigned PSS1BD : 2;
6191 unsigned : 6;
6194 struct
6196 unsigned : 2;
6197 unsigned PSS1AC : 2;
6198 unsigned : 4;
6201 struct
6203 unsigned : 4;
6204 unsigned ECCP1AS : 3;
6205 unsigned : 1;
6207 } __ECCP1ASbits_t;
6209 extern __at(0x0FBF) volatile __ECCP1ASbits_t ECCP1ASbits;
6211 #define _PSS1BD0 0x01
6212 #define _PSS1BD1 0x02
6213 #define _PSS1AC0 0x04
6214 #define _PSS1AC1 0x08
6215 #define _ECCP1AS0 0x10
6216 #define _ECCP1AS1 0x20
6217 #define _ECCP1AS2 0x40
6218 #define _ECCP1ASE 0x80
6220 //==============================================================================
6223 //==============================================================================
6224 // ADCON2 Bits
6226 extern __at(0x0FC0) __sfr ADCON2;
6228 typedef union
6230 struct
6232 unsigned ADCS0 : 1;
6233 unsigned ADCS1 : 1;
6234 unsigned ADCS2 : 1;
6235 unsigned ACQT0 : 1;
6236 unsigned ACQT1 : 1;
6237 unsigned ACQT2 : 1;
6238 unsigned : 1;
6239 unsigned ADFM : 1;
6242 struct
6244 unsigned ADCS : 3;
6245 unsigned : 5;
6248 struct
6250 unsigned : 3;
6251 unsigned ACQT : 3;
6252 unsigned : 2;
6254 } __ADCON2bits_t;
6256 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
6258 #define _ADCS0 0x01
6259 #define _ADCS1 0x02
6260 #define _ADCS2 0x04
6261 #define _ACQT0 0x08
6262 #define _ACQT1 0x10
6263 #define _ACQT2 0x20
6264 #define _ADFM 0x80
6266 //==============================================================================
6269 //==============================================================================
6270 // ADCON1 Bits
6272 extern __at(0x0FC1) __sfr ADCON1;
6274 typedef union
6276 struct
6278 unsigned CHSN0 : 1;
6279 unsigned CHSN1 : 1;
6280 unsigned CHSN2 : 1;
6281 unsigned VNCFG : 1;
6282 unsigned VCFG0 : 1;
6283 unsigned VCFG1 : 1;
6284 unsigned TRIGSEL0 : 1;
6285 unsigned TRIGSEL1 : 1;
6288 struct
6290 unsigned CHSN : 3;
6291 unsigned : 5;
6294 struct
6296 unsigned : 4;
6297 unsigned VCFG : 2;
6298 unsigned : 2;
6301 struct
6303 unsigned : 6;
6304 unsigned TRIGSEL : 2;
6306 } __ADCON1bits_t;
6308 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
6310 #define _CHSN0 0x01
6311 #define _CHSN1 0x02
6312 #define _CHSN2 0x04
6313 #define _VNCFG 0x08
6314 #define _VCFG0 0x10
6315 #define _VCFG1 0x20
6316 #define _TRIGSEL0 0x40
6317 #define _TRIGSEL1 0x80
6319 //==============================================================================
6322 //==============================================================================
6323 // ADCON0 Bits
6325 extern __at(0x0FC2) __sfr ADCON0;
6327 typedef union
6329 struct
6331 unsigned ADON : 1;
6332 unsigned GO_NOT_DONE : 1;
6333 unsigned CHS0 : 1;
6334 unsigned CHS1 : 1;
6335 unsigned CHS2 : 1;
6336 unsigned CHS3 : 1;
6337 unsigned CHS4 : 1;
6338 unsigned : 1;
6341 struct
6343 unsigned : 1;
6344 unsigned DONE : 1;
6345 unsigned : 1;
6346 unsigned : 1;
6347 unsigned : 1;
6348 unsigned : 1;
6349 unsigned : 1;
6350 unsigned : 1;
6353 struct
6355 unsigned : 1;
6356 unsigned GO : 1;
6357 unsigned : 1;
6358 unsigned : 1;
6359 unsigned : 1;
6360 unsigned : 1;
6361 unsigned : 1;
6362 unsigned : 1;
6365 struct
6367 unsigned : 1;
6368 unsigned NOT_DONE : 1;
6369 unsigned : 1;
6370 unsigned : 1;
6371 unsigned : 1;
6372 unsigned : 1;
6373 unsigned : 1;
6374 unsigned : 1;
6377 struct
6379 unsigned : 2;
6380 unsigned CHS : 5;
6381 unsigned : 1;
6383 } __ADCON0bits_t;
6385 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
6387 #define _ADON 0x01
6388 #define _GO_NOT_DONE 0x02
6389 #define _DONE 0x02
6390 #define _GO 0x02
6391 #define _NOT_DONE 0x02
6392 #define _CHS0 0x04
6393 #define _CHS1 0x08
6394 #define _CHS2 0x10
6395 #define _CHS3 0x20
6396 #define _CHS4 0x40
6398 //==============================================================================
6400 extern __at(0x0FC3) __sfr ADRES;
6401 extern __at(0x0FC3) __sfr ADRESL;
6402 extern __at(0x0FC4) __sfr ADRESH;
6404 //==============================================================================
6405 // SSP1CON2 Bits
6407 extern __at(0x0FC5) __sfr SSP1CON2;
6409 typedef union
6411 struct
6413 unsigned SEN : 1;
6414 unsigned RSEN : 1;
6415 unsigned PEN : 1;
6416 unsigned RCEN : 1;
6417 unsigned ACKEN : 1;
6418 unsigned ACKDT : 1;
6419 unsigned ACKSTAT : 1;
6420 unsigned GCEN : 1;
6423 struct
6425 unsigned : 1;
6426 unsigned ADMSK1 : 1;
6427 unsigned ADMSK2 : 1;
6428 unsigned ADMSK3 : 1;
6429 unsigned ADMSK4 : 1;
6430 unsigned ADMSK5 : 1;
6431 unsigned : 1;
6432 unsigned : 1;
6434 } __SSP1CON2bits_t;
6436 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
6438 #define _SEN 0x01
6439 #define _RSEN 0x02
6440 #define _ADMSK1 0x02
6441 #define _PEN 0x04
6442 #define _ADMSK2 0x04
6443 #define _RCEN 0x08
6444 #define _ADMSK3 0x08
6445 #define _ACKEN 0x10
6446 #define _ADMSK4 0x10
6447 #define _ACKDT 0x20
6448 #define _ADMSK5 0x20
6449 #define _ACKSTAT 0x40
6450 #define _GCEN 0x80
6452 //==============================================================================
6455 //==============================================================================
6456 // SSPCON2 Bits
6458 extern __at(0x0FC5) __sfr SSPCON2;
6460 typedef union
6462 struct
6464 unsigned SEN : 1;
6465 unsigned RSEN : 1;
6466 unsigned PEN : 1;
6467 unsigned RCEN : 1;
6468 unsigned ACKEN : 1;
6469 unsigned ACKDT : 1;
6470 unsigned ACKSTAT : 1;
6471 unsigned GCEN : 1;
6474 struct
6476 unsigned : 1;
6477 unsigned ADMSK1 : 1;
6478 unsigned ADMSK2 : 1;
6479 unsigned ADMSK3 : 1;
6480 unsigned ADMSK4 : 1;
6481 unsigned ADMSK5 : 1;
6482 unsigned : 1;
6483 unsigned : 1;
6485 } __SSPCON2bits_t;
6487 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
6489 #define _SSPCON2_SEN 0x01
6490 #define _SSPCON2_RSEN 0x02
6491 #define _SSPCON2_ADMSK1 0x02
6492 #define _SSPCON2_PEN 0x04
6493 #define _SSPCON2_ADMSK2 0x04
6494 #define _SSPCON2_RCEN 0x08
6495 #define _SSPCON2_ADMSK3 0x08
6496 #define _SSPCON2_ACKEN 0x10
6497 #define _SSPCON2_ADMSK4 0x10
6498 #define _SSPCON2_ACKDT 0x20
6499 #define _SSPCON2_ADMSK5 0x20
6500 #define _SSPCON2_ACKSTAT 0x40
6501 #define _SSPCON2_GCEN 0x80
6503 //==============================================================================
6506 //==============================================================================
6507 // SSP1CON1 Bits
6509 extern __at(0x0FC6) __sfr SSP1CON1;
6511 typedef union
6513 struct
6515 unsigned SSPM0 : 1;
6516 unsigned SSPM1 : 1;
6517 unsigned SSPM2 : 1;
6518 unsigned SSPM3 : 1;
6519 unsigned CKP : 1;
6520 unsigned SSPEN : 1;
6521 unsigned SSPOV : 1;
6522 unsigned WCOL : 1;
6525 struct
6527 unsigned SSPM : 4;
6528 unsigned : 4;
6530 } __SSP1CON1bits_t;
6532 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
6534 #define _SSPM0 0x01
6535 #define _SSPM1 0x02
6536 #define _SSPM2 0x04
6537 #define _SSPM3 0x08
6538 #define _CKP 0x10
6539 #define _SSPEN 0x20
6540 #define _SSPOV 0x40
6541 #define _WCOL 0x80
6543 //==============================================================================
6546 //==============================================================================
6547 // SSPCON1 Bits
6549 extern __at(0x0FC6) __sfr SSPCON1;
6551 typedef union
6553 struct
6555 unsigned SSPM0 : 1;
6556 unsigned SSPM1 : 1;
6557 unsigned SSPM2 : 1;
6558 unsigned SSPM3 : 1;
6559 unsigned CKP : 1;
6560 unsigned SSPEN : 1;
6561 unsigned SSPOV : 1;
6562 unsigned WCOL : 1;
6565 struct
6567 unsigned SSPM : 4;
6568 unsigned : 4;
6570 } __SSPCON1bits_t;
6572 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
6574 #define _SSPCON1_SSPM0 0x01
6575 #define _SSPCON1_SSPM1 0x02
6576 #define _SSPCON1_SSPM2 0x04
6577 #define _SSPCON1_SSPM3 0x08
6578 #define _SSPCON1_CKP 0x10
6579 #define _SSPCON1_SSPEN 0x20
6580 #define _SSPCON1_SSPOV 0x40
6581 #define _SSPCON1_WCOL 0x80
6583 //==============================================================================
6586 //==============================================================================
6587 // SSP1STAT Bits
6589 extern __at(0x0FC7) __sfr SSP1STAT;
6591 typedef union
6593 struct
6595 unsigned BF : 1;
6596 unsigned UA : 1;
6597 unsigned R_NOT_W : 1;
6598 unsigned S : 1;
6599 unsigned P : 1;
6600 unsigned D_NOT_A : 1;
6601 unsigned CKE : 1;
6602 unsigned SMP : 1;
6605 struct
6607 unsigned : 1;
6608 unsigned : 1;
6609 unsigned R : 1;
6610 unsigned I2C_START : 1;
6611 unsigned I2C_STOP : 1;
6612 unsigned D : 1;
6613 unsigned : 1;
6614 unsigned : 1;
6617 struct
6619 unsigned : 1;
6620 unsigned : 1;
6621 unsigned R_W : 1;
6622 unsigned : 1;
6623 unsigned : 1;
6624 unsigned D_A : 1;
6625 unsigned : 1;
6626 unsigned : 1;
6629 struct
6631 unsigned : 1;
6632 unsigned : 1;
6633 unsigned NOT_W : 1;
6634 unsigned : 1;
6635 unsigned : 1;
6636 unsigned NOT_A : 1;
6637 unsigned : 1;
6638 unsigned : 1;
6641 struct
6643 unsigned : 1;
6644 unsigned : 1;
6645 unsigned NOT_WRITE : 1;
6646 unsigned : 1;
6647 unsigned : 1;
6648 unsigned NOT_ADDRESS : 1;
6649 unsigned : 1;
6650 unsigned : 1;
6653 struct
6655 unsigned : 1;
6656 unsigned : 1;
6657 unsigned READ_WRITE : 1;
6658 unsigned : 1;
6659 unsigned : 1;
6660 unsigned DATA_ADDRESS : 1;
6661 unsigned : 1;
6662 unsigned : 1;
6665 struct
6667 unsigned : 1;
6668 unsigned : 1;
6669 unsigned I2C_READ : 1;
6670 unsigned : 1;
6671 unsigned : 1;
6672 unsigned I2C_DAT : 1;
6673 unsigned : 1;
6674 unsigned : 1;
6676 } __SSP1STATbits_t;
6678 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
6680 #define _BF 0x01
6681 #define _UA 0x02
6682 #define _R_NOT_W 0x04
6683 #define _R 0x04
6684 #define _R_W 0x04
6685 #define _NOT_W 0x04
6686 #define _NOT_WRITE 0x04
6687 #define _READ_WRITE 0x04
6688 #define _I2C_READ 0x04
6689 #define _S 0x08
6690 #define _I2C_START 0x08
6691 #define _P 0x10
6692 #define _I2C_STOP 0x10
6693 #define _D_NOT_A 0x20
6694 #define _D 0x20
6695 #define _D_A 0x20
6696 #define _NOT_A 0x20
6697 #define _NOT_ADDRESS 0x20
6698 #define _DATA_ADDRESS 0x20
6699 #define _I2C_DAT 0x20
6700 #define _CKE 0x40
6701 #define _SMP 0x80
6703 //==============================================================================
6706 //==============================================================================
6707 // SSPSTAT Bits
6709 extern __at(0x0FC7) __sfr SSPSTAT;
6711 typedef union
6713 struct
6715 unsigned BF : 1;
6716 unsigned UA : 1;
6717 unsigned R_NOT_W : 1;
6718 unsigned S : 1;
6719 unsigned P : 1;
6720 unsigned D_NOT_A : 1;
6721 unsigned CKE : 1;
6722 unsigned SMP : 1;
6725 struct
6727 unsigned : 1;
6728 unsigned : 1;
6729 unsigned R : 1;
6730 unsigned I2C_START : 1;
6731 unsigned I2C_STOP : 1;
6732 unsigned D : 1;
6733 unsigned : 1;
6734 unsigned : 1;
6737 struct
6739 unsigned : 1;
6740 unsigned : 1;
6741 unsigned R_W : 1;
6742 unsigned : 1;
6743 unsigned : 1;
6744 unsigned D_A : 1;
6745 unsigned : 1;
6746 unsigned : 1;
6749 struct
6751 unsigned : 1;
6752 unsigned : 1;
6753 unsigned NOT_W : 1;
6754 unsigned : 1;
6755 unsigned : 1;
6756 unsigned NOT_A : 1;
6757 unsigned : 1;
6758 unsigned : 1;
6761 struct
6763 unsigned : 1;
6764 unsigned : 1;
6765 unsigned NOT_WRITE : 1;
6766 unsigned : 1;
6767 unsigned : 1;
6768 unsigned NOT_ADDRESS : 1;
6769 unsigned : 1;
6770 unsigned : 1;
6773 struct
6775 unsigned : 1;
6776 unsigned : 1;
6777 unsigned READ_WRITE : 1;
6778 unsigned : 1;
6779 unsigned : 1;
6780 unsigned DATA_ADDRESS : 1;
6781 unsigned : 1;
6782 unsigned : 1;
6785 struct
6787 unsigned : 1;
6788 unsigned : 1;
6789 unsigned I2C_READ : 1;
6790 unsigned : 1;
6791 unsigned : 1;
6792 unsigned I2C_DAT : 1;
6793 unsigned : 1;
6794 unsigned : 1;
6796 } __SSPSTATbits_t;
6798 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
6800 #define _SSPSTAT_BF 0x01
6801 #define _SSPSTAT_UA 0x02
6802 #define _SSPSTAT_R_NOT_W 0x04
6803 #define _SSPSTAT_R 0x04
6804 #define _SSPSTAT_R_W 0x04
6805 #define _SSPSTAT_NOT_W 0x04
6806 #define _SSPSTAT_NOT_WRITE 0x04
6807 #define _SSPSTAT_READ_WRITE 0x04
6808 #define _SSPSTAT_I2C_READ 0x04
6809 #define _SSPSTAT_S 0x08
6810 #define _SSPSTAT_I2C_START 0x08
6811 #define _SSPSTAT_P 0x10
6812 #define _SSPSTAT_I2C_STOP 0x10
6813 #define _SSPSTAT_D_NOT_A 0x20
6814 #define _SSPSTAT_D 0x20
6815 #define _SSPSTAT_D_A 0x20
6816 #define _SSPSTAT_NOT_A 0x20
6817 #define _SSPSTAT_NOT_ADDRESS 0x20
6818 #define _SSPSTAT_DATA_ADDRESS 0x20
6819 #define _SSPSTAT_I2C_DAT 0x20
6820 #define _SSPSTAT_CKE 0x40
6821 #define _SSPSTAT_SMP 0x80
6823 //==============================================================================
6825 extern __at(0x0FC8) __sfr SSP1ADD;
6827 //==============================================================================
6828 // SSP1MSK Bits
6830 extern __at(0x0FC8) __sfr SSP1MSK;
6832 typedef struct
6834 unsigned MSK0 : 1;
6835 unsigned MSK1 : 1;
6836 unsigned MSK2 : 1;
6837 unsigned MSK3 : 1;
6838 unsigned MSK4 : 1;
6839 unsigned MSK5 : 1;
6840 unsigned MSK6 : 1;
6841 unsigned MSK7 : 1;
6842 } __SSP1MSKbits_t;
6844 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
6846 #define _MSK0 0x01
6847 #define _MSK1 0x02
6848 #define _MSK2 0x04
6849 #define _MSK3 0x08
6850 #define _MSK4 0x10
6851 #define _MSK5 0x20
6852 #define _MSK6 0x40
6853 #define _MSK7 0x80
6855 //==============================================================================
6857 extern __at(0x0FC8) __sfr SSPADD;
6858 extern __at(0x0FC9) __sfr SSP1BUF;
6859 extern __at(0x0FC9) __sfr SSPBUF;
6861 //==============================================================================
6862 // T2CON Bits
6864 extern __at(0x0FCA) __sfr T2CON;
6866 typedef union
6868 struct
6870 unsigned T2CKPS0 : 1;
6871 unsigned T2CKPS1 : 1;
6872 unsigned TMR2ON : 1;
6873 unsigned T2OUTPS0 : 1;
6874 unsigned T2OUTPS1 : 1;
6875 unsigned T2OUTPS2 : 1;
6876 unsigned T2OUTPS3 : 1;
6877 unsigned : 1;
6880 struct
6882 unsigned T2CKPS : 2;
6883 unsigned : 6;
6886 struct
6888 unsigned : 3;
6889 unsigned T2OUTPS : 4;
6890 unsigned : 1;
6892 } __T2CONbits_t;
6894 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
6896 #define _T2CKPS0 0x01
6897 #define _T2CKPS1 0x02
6898 #define _TMR2ON 0x04
6899 #define _T2OUTPS0 0x08
6900 #define _T2OUTPS1 0x10
6901 #define _T2OUTPS2 0x20
6902 #define _T2OUTPS3 0x40
6904 //==============================================================================
6906 extern __at(0x0FCB) __sfr PR2;
6907 extern __at(0x0FCC) __sfr TMR2;
6909 //==============================================================================
6910 // T1CON Bits
6912 extern __at(0x0FCD) __sfr T1CON;
6914 typedef union
6916 struct
6918 unsigned TMR1ON : 1;
6919 unsigned RD16 : 1;
6920 unsigned NOT_T1SYNC : 1;
6921 unsigned SOSCEN : 1;
6922 unsigned T1CKPS0 : 1;
6923 unsigned T1CKPS1 : 1;
6924 unsigned TMR1CS0 : 1;
6925 unsigned TMR1CS1 : 1;
6928 struct
6930 unsigned : 4;
6931 unsigned T1CKPS : 2;
6932 unsigned : 2;
6935 struct
6937 unsigned : 6;
6938 unsigned TMR1CS : 2;
6940 } __T1CONbits_t;
6942 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6944 #define _TMR1ON 0x01
6945 #define _RD16 0x02
6946 #define _NOT_T1SYNC 0x04
6947 #define _SOSCEN 0x08
6948 #define _T1CKPS0 0x10
6949 #define _T1CKPS1 0x20
6950 #define _TMR1CS0 0x40
6951 #define _TMR1CS1 0x80
6953 //==============================================================================
6955 extern __at(0x0FCE) __sfr TMR1;
6956 extern __at(0x0FCE) __sfr TMR1L;
6957 extern __at(0x0FCF) __sfr TMR1H;
6959 //==============================================================================
6960 // RCON Bits
6962 extern __at(0x0FD0) __sfr RCON;
6964 typedef union
6966 struct
6968 unsigned NOT_BOR : 1;
6969 unsigned NOT_POR : 1;
6970 unsigned NOT_PD : 1;
6971 unsigned NOT_TO : 1;
6972 unsigned NOT_RI : 1;
6973 unsigned NOT_CM : 1;
6974 unsigned SBOREN : 1;
6975 unsigned IPEN : 1;
6978 struct
6980 unsigned BOR : 1;
6981 unsigned POR : 1;
6982 unsigned PD : 1;
6983 unsigned TO : 1;
6984 unsigned RI : 1;
6985 unsigned CM : 1;
6986 unsigned : 1;
6987 unsigned : 1;
6989 } __RCONbits_t;
6991 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6993 #define _NOT_BOR 0x01
6994 #define _BOR 0x01
6995 #define _NOT_POR 0x02
6996 #define _POR 0x02
6997 #define _NOT_PD 0x04
6998 #define _PD 0x04
6999 #define _NOT_TO 0x08
7000 #define _TO 0x08
7001 #define _NOT_RI 0x10
7002 #define _RI 0x10
7003 #define _NOT_CM 0x20
7004 #define _CM 0x20
7005 #define _SBOREN 0x40
7006 #define _IPEN 0x80
7008 //==============================================================================
7011 //==============================================================================
7012 // WDTCON Bits
7014 extern __at(0x0FD1) __sfr WDTCON;
7016 typedef union
7018 struct
7020 unsigned SWDTEN : 1;
7021 unsigned ULPSINK : 1;
7022 unsigned ULPEN : 1;
7023 unsigned : 1;
7024 unsigned SRETEN : 1;
7025 unsigned ULPLVL : 1;
7026 unsigned : 1;
7027 unsigned REGSLP : 1;
7030 struct
7032 unsigned SWDTE : 1;
7033 unsigned : 1;
7034 unsigned : 1;
7035 unsigned : 1;
7036 unsigned : 1;
7037 unsigned : 1;
7038 unsigned : 1;
7039 unsigned : 1;
7041 } __WDTCONbits_t;
7043 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
7045 #define _SWDTEN 0x01
7046 #define _SWDTE 0x01
7047 #define _ULPSINK 0x02
7048 #define _ULPEN 0x04
7049 #define _SRETEN 0x10
7050 #define _ULPLVL 0x20
7051 #define _REGSLP 0x80
7053 //==============================================================================
7056 //==============================================================================
7057 // IPR5 Bits
7059 extern __at(0x0FD2) __sfr IPR5;
7061 typedef struct
7063 unsigned TMR4IP : 1;
7064 unsigned TMR5IP : 1;
7065 unsigned TMR6IP : 1;
7066 unsigned TMR7IP : 1;
7067 unsigned TMR8IP : 1;
7068 unsigned TMR10IP : 1;
7069 unsigned TMR12IP : 1;
7070 unsigned TMR7GIP : 1;
7071 } __IPR5bits_t;
7073 extern __at(0x0FD2) volatile __IPR5bits_t IPR5bits;
7075 #define _TMR4IP 0x01
7076 #define _TMR5IP 0x02
7077 #define _TMR6IP 0x04
7078 #define _TMR7IP 0x08
7079 #define _TMR8IP 0x10
7080 #define _TMR10IP 0x20
7081 #define _TMR12IP 0x40
7082 #define _TMR7GIP 0x80
7084 //==============================================================================
7087 //==============================================================================
7088 // OSCCON Bits
7090 extern __at(0x0FD3) __sfr OSCCON;
7092 typedef union
7094 struct
7096 unsigned SCS0 : 1;
7097 unsigned SCS1 : 1;
7098 unsigned HFIOFS : 1;
7099 unsigned OSTS : 1;
7100 unsigned IRCF0 : 1;
7101 unsigned IRCF1 : 1;
7102 unsigned IRCF2 : 1;
7103 unsigned IDLEN : 1;
7106 struct
7108 unsigned SCS : 2;
7109 unsigned : 6;
7112 struct
7114 unsigned : 4;
7115 unsigned IRCF : 3;
7116 unsigned : 1;
7118 } __OSCCONbits_t;
7120 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
7122 #define _SCS0 0x01
7123 #define _SCS1 0x02
7124 #define _HFIOFS 0x04
7125 #define _OSTS 0x08
7126 #define _IRCF0 0x10
7127 #define _IRCF1 0x20
7128 #define _IRCF2 0x40
7129 #define _IDLEN 0x80
7131 //==============================================================================
7133 extern __at(0x0FD4) __sfr SPBRGH1;
7135 //==============================================================================
7136 // T0CON Bits
7138 extern __at(0x0FD5) __sfr T0CON;
7140 typedef union
7142 struct
7144 unsigned T0PS0 : 1;
7145 unsigned T0PS1 : 1;
7146 unsigned T0PS2 : 1;
7147 unsigned PSA : 1;
7148 unsigned T0SE : 1;
7149 unsigned T0CS : 1;
7150 unsigned T08BIT : 1;
7151 unsigned TMR0ON : 1;
7154 struct
7156 unsigned T0PS : 3;
7157 unsigned : 5;
7159 } __T0CONbits_t;
7161 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
7163 #define _T0PS0 0x01
7164 #define _T0PS1 0x02
7165 #define _T0PS2 0x04
7166 #define _PSA 0x08
7167 #define _T0SE 0x10
7168 #define _T0CS 0x20
7169 #define _T08BIT 0x40
7170 #define _TMR0ON 0x80
7172 //==============================================================================
7174 extern __at(0x0FD6) __sfr TMR0;
7175 extern __at(0x0FD6) __sfr TMR0L;
7176 extern __at(0x0FD7) __sfr TMR0H;
7178 //==============================================================================
7179 // STATUS Bits
7181 extern __at(0x0FD8) __sfr STATUS;
7183 typedef struct
7185 unsigned C : 1;
7186 unsigned DC : 1;
7187 unsigned Z : 1;
7188 unsigned OV : 1;
7189 unsigned N : 1;
7190 unsigned : 1;
7191 unsigned : 1;
7192 unsigned : 1;
7193 } __STATUSbits_t;
7195 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
7197 #define _C 0x01
7198 #define _DC 0x02
7199 #define _Z 0x04
7200 #define _OV 0x08
7201 #define _N 0x10
7203 //==============================================================================
7205 extern __at(0x0FD9) __sfr FSR2L;
7206 extern __at(0x0FDA) __sfr FSR2H;
7207 extern __at(0x0FDB) __sfr PLUSW2;
7208 extern __at(0x0FDC) __sfr PREINC2;
7209 extern __at(0x0FDD) __sfr POSTDEC2;
7210 extern __at(0x0FDE) __sfr POSTINC2;
7211 extern __at(0x0FDF) __sfr INDF2;
7212 extern __at(0x0FE0) __sfr BSR;
7213 extern __at(0x0FE1) __sfr FSR1L;
7214 extern __at(0x0FE2) __sfr FSR1H;
7215 extern __at(0x0FE3) __sfr PLUSW1;
7216 extern __at(0x0FE4) __sfr PREINC1;
7217 extern __at(0x0FE5) __sfr POSTDEC1;
7218 extern __at(0x0FE6) __sfr POSTINC1;
7219 extern __at(0x0FE7) __sfr INDF1;
7220 extern __at(0x0FE8) __sfr WREG;
7221 extern __at(0x0FE9) __sfr FSR0L;
7222 extern __at(0x0FEA) __sfr FSR0H;
7223 extern __at(0x0FEB) __sfr PLUSW0;
7224 extern __at(0x0FEC) __sfr PREINC0;
7225 extern __at(0x0FED) __sfr POSTDEC0;
7226 extern __at(0x0FEE) __sfr POSTINC0;
7227 extern __at(0x0FEF) __sfr INDF0;
7229 //==============================================================================
7230 // INTCON3 Bits
7232 extern __at(0x0FF0) __sfr INTCON3;
7234 typedef union
7236 struct
7238 unsigned INT1IF : 1;
7239 unsigned INT2IF : 1;
7240 unsigned INT3IF : 1;
7241 unsigned INT1IE : 1;
7242 unsigned INT2IE : 1;
7243 unsigned INT3IE : 1;
7244 unsigned INT1IP : 1;
7245 unsigned INT2IP : 1;
7248 struct
7250 unsigned INT1F : 1;
7251 unsigned INT2F : 1;
7252 unsigned INT3F : 1;
7253 unsigned INT1E : 1;
7254 unsigned INT2E : 1;
7255 unsigned INT3E : 1;
7256 unsigned INT1P : 1;
7257 unsigned INT2P : 1;
7259 } __INTCON3bits_t;
7261 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
7263 #define _INT1IF 0x01
7264 #define _INT1F 0x01
7265 #define _INT2IF 0x02
7266 #define _INT2F 0x02
7267 #define _INT3IF 0x04
7268 #define _INT3F 0x04
7269 #define _INT1IE 0x08
7270 #define _INT1E 0x08
7271 #define _INT2IE 0x10
7272 #define _INT2E 0x10
7273 #define _INT3IE 0x20
7274 #define _INT3E 0x20
7275 #define _INT1IP 0x40
7276 #define _INT1P 0x40
7277 #define _INT2IP 0x80
7278 #define _INT2P 0x80
7280 //==============================================================================
7283 //==============================================================================
7284 // INTCON2 Bits
7286 extern __at(0x0FF1) __sfr INTCON2;
7288 typedef union
7290 struct
7292 unsigned RBIP : 1;
7293 unsigned INT3IP : 1;
7294 unsigned TMR0IP : 1;
7295 unsigned INTEDG3 : 1;
7296 unsigned INTEDG2 : 1;
7297 unsigned INTEDG1 : 1;
7298 unsigned INTEDG0 : 1;
7299 unsigned NOT_RBPU : 1;
7302 struct
7304 unsigned : 1;
7305 unsigned INT3P : 1;
7306 unsigned T0IP : 1;
7307 unsigned : 1;
7308 unsigned : 1;
7309 unsigned : 1;
7310 unsigned : 1;
7311 unsigned RBPU : 1;
7313 } __INTCON2bits_t;
7315 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
7317 #define _RBIP 0x01
7318 #define _INT3IP 0x02
7319 #define _INT3P 0x02
7320 #define _TMR0IP 0x04
7321 #define _T0IP 0x04
7322 #define _INTEDG3 0x08
7323 #define _INTEDG2 0x10
7324 #define _INTEDG1 0x20
7325 #define _INTEDG0 0x40
7326 #define _NOT_RBPU 0x80
7327 #define _RBPU 0x80
7329 //==============================================================================
7332 //==============================================================================
7333 // INTCON Bits
7335 extern __at(0x0FF2) __sfr INTCON;
7337 typedef union
7339 struct
7341 unsigned RBIF : 1;
7342 unsigned INT0IF : 1;
7343 unsigned TMR0IF : 1;
7344 unsigned RBIE : 1;
7345 unsigned INT0IE : 1;
7346 unsigned TMR0IE : 1;
7347 unsigned PEIE_GIEL : 1;
7348 unsigned GIE_GIEH : 1;
7351 struct
7353 unsigned : 1;
7354 unsigned INT0F : 1;
7355 unsigned T0IF : 1;
7356 unsigned : 1;
7357 unsigned INT0E : 1;
7358 unsigned T0IE : 1;
7359 unsigned PEIE : 1;
7360 unsigned GIE : 1;
7363 struct
7365 unsigned : 1;
7366 unsigned : 1;
7367 unsigned : 1;
7368 unsigned : 1;
7369 unsigned : 1;
7370 unsigned : 1;
7371 unsigned GIEL : 1;
7372 unsigned GIEH : 1;
7374 } __INTCONbits_t;
7376 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
7378 #define _RBIF 0x01
7379 #define _INT0IF 0x02
7380 #define _INT0F 0x02
7381 #define _TMR0IF 0x04
7382 #define _T0IF 0x04
7383 #define _RBIE 0x08
7384 #define _INT0IE 0x10
7385 #define _INT0E 0x10
7386 #define _TMR0IE 0x20
7387 #define _T0IE 0x20
7388 #define _PEIE_GIEL 0x40
7389 #define _PEIE 0x40
7390 #define _GIEL 0x40
7391 #define _GIE_GIEH 0x80
7392 #define _GIE 0x80
7393 #define _GIEH 0x80
7395 //==============================================================================
7397 extern __at(0x0FF3) __sfr PROD;
7398 extern __at(0x0FF3) __sfr PRODL;
7399 extern __at(0x0FF4) __sfr PRODH;
7400 extern __at(0x0FF5) __sfr TABLAT;
7401 extern __at(0x0FF6) __sfr TBLPTR;
7402 extern __at(0x0FF6) __sfr TBLPTRL;
7403 extern __at(0x0FF7) __sfr TBLPTRH;
7404 extern __at(0x0FF8) __sfr TBLPTRU;
7405 extern __at(0x0FF9) __sfr PC;
7406 extern __at(0x0FF9) __sfr PCL;
7407 extern __at(0x0FFA) __sfr PCLATH;
7408 extern __at(0x0FFB) __sfr PCLATU;
7410 //==============================================================================
7411 // STKPTR Bits
7413 extern __at(0x0FFC) __sfr STKPTR;
7415 typedef union
7417 struct
7419 unsigned SP0 : 1;
7420 unsigned SP1 : 1;
7421 unsigned SP2 : 1;
7422 unsigned SP3 : 1;
7423 unsigned SP4 : 1;
7424 unsigned : 1;
7425 unsigned STKUNF : 1;
7426 unsigned STKFUL : 1;
7429 struct
7431 unsigned : 1;
7432 unsigned : 1;
7433 unsigned : 1;
7434 unsigned : 1;
7435 unsigned : 1;
7436 unsigned : 1;
7437 unsigned : 1;
7438 unsigned STKOVF : 1;
7441 struct
7443 unsigned SP : 5;
7444 unsigned : 3;
7446 } __STKPTRbits_t;
7448 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
7450 #define _SP0 0x01
7451 #define _SP1 0x02
7452 #define _SP2 0x04
7453 #define _SP3 0x08
7454 #define _SP4 0x10
7455 #define _STKUNF 0x40
7456 #define _STKFUL 0x80
7457 #define _STKOVF 0x80
7459 //==============================================================================
7461 extern __at(0x0FFD) __sfr TOS;
7462 extern __at(0x0FFD) __sfr TOSL;
7463 extern __at(0x0FFE) __sfr TOSH;
7464 extern __at(0x0FFF) __sfr TOSU;
7466 //==============================================================================
7468 // Configuration Bits
7470 //==============================================================================
7472 #define __CONFIG1L 0x300000
7473 #define __CONFIG1H 0x300001
7474 #define __CONFIG2L 0x300002
7475 #define __CONFIG2H 0x300003
7476 #define __CONFIG3L 0x300004
7477 #define __CONFIG3H 0x300005
7478 #define __CONFIG4L 0x300006
7479 #define __CONFIG5L 0x300008
7480 #define __CONFIG5H 0x300009
7481 #define __CONFIG6L 0x30000A
7482 #define __CONFIG6H 0x30000B
7483 #define __CONFIG7L 0x30000C
7484 #define __CONFIG7H 0x30000D
7486 //----------------------------- CONFIG1L Options -------------------------------
7488 #define _RETEN_OFF_1L 0xFE // Disabled - Controlled by SRETEN bit.
7489 #define _RETEN_ON_1L 0xFF // Enabled.
7490 #define _INTOSCSEL_LOW_1L 0xFB // LF-INTOSC in Low-power mode during Sleep.
7491 #define _INTOSCSEL_HIGH_1L 0xFF // LF-INTOSC in High-power mode during Sleep.
7492 #define _SOSCSEL_LOW_1L 0xEF // Low Power SOSC circuit selected.
7493 #define _SOSCSEL_DIG_1L 0xF7 // Digital (SCLKI) mode.
7494 #define _SOSCSEL_HIGH_1L 0xFF // High Power SOSC circuit selected.
7495 #define _XINST_OFF_1L 0xBF // Disabled.
7496 #define _XINST_ON_1L 0xFF // Enabled.
7498 //----------------------------- CONFIG1H Options -------------------------------
7500 #define _FOSC_LP_1H 0xF0 // LP oscillator.
7501 #define _FOSC_XT_1H 0xF1 // XT oscillator.
7502 #define _FOSC_HS2_1H 0xF2 // HS oscillator (High power, 16 MHz - 25 MHz).
7503 #define _FOSC_HS1_1H 0xF3 // HS oscillator (Medium power, 4 MHz - 16 MHz).
7504 #define _FOSC_EC3IO_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (High power, 16 MHz - 64 MHz).
7505 #define _FOSC_EC3_1H 0xF5 // EC oscillator (High power, 16 MHz - 64 MHz).
7506 #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
7507 #define _FOSC_RCIO_1H 0xF7 // External RC oscillator.
7508 #define _FOSC_INTIO2_1H 0xF8 // Internal RC oscillator.
7509 #define _FOSC_INTIO1_1H 0xF9 // Internal RC oscillator, CLKOUT function on OSC2.
7510 #define _FOSC_EC2IO_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (Medium power, 160 kHz - 16 MHz).
7511 #define _FOSC_EC2_1H 0xFB // EC oscillator (Medium power, 160 kHz - 16 MHz).
7512 #define _FOSC_EC1IO_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (Low power, DC - 160 kHz).
7513 #define _FOSC_EC1_1H 0xFD // EC oscillator (Low power, DC - 160 kHz).
7514 #define _PLLCFG_OFF_1H 0xEF // Disabled.
7515 #define _PLLCFG_ON_1H 0xFF // Enabled.
7516 #define _FCMEN_OFF_1H 0xBF // Disabled.
7517 #define _FCMEN_ON_1H 0xFF // Enabled.
7518 #define _IESO_OFF_1H 0x7F // Disabled.
7519 #define _IESO_ON_1H 0xFF // Enabled.
7521 //----------------------------- CONFIG2L Options -------------------------------
7523 #define _PWRTEN_ON_2L 0xFE // Enabled.
7524 #define _PWRTEN_OFF_2L 0xFF // Disabled.
7525 #define _BOREN_OFF_2L 0xF9 // Disabled in hardware, SBOREN disabled.
7526 #define _BOREN_ON_2L 0xFB // Controlled with SBOREN bit.
7527 #define _BOREN_NOSLP_2L 0xFD // Enabled while active, disabled in SLEEP, SBOREN disabled.
7528 #define _BOREN_SBORDIS_2L 0xFF // Enabled in hardware, SBOREN disabled.
7529 #define _BORV_0_2L 0xE7 // 3.0V.
7530 #define _BORV_1_2L 0xEF // 2.7V.
7531 #define _BORV_2_2L 0xF7 // 2.0V.
7532 #define _BORV_3_2L 0xFF // 1.8V.
7533 #define _BORPWR_LOW_2L 0x9F // BORMV set to low power level.
7534 #define _BORPWR_MEDIUM_2L 0xBF // BORMV set to medium power level.
7535 #define _BORPWR_HIGH_2L 0xDF // BORMV set to high power level.
7536 #define _BORPWR_ZPBORMV_2L 0xFF // ZPBORMV instead of BORMV is selected.
7538 //----------------------------- CONFIG2H Options -------------------------------
7540 #define _WDTEN_OFF_2H 0xFC // WDT disabled in hardware; SWDTEN bit disabled.
7541 #define _WDTEN_NOSLP_2H 0xFD // WDT enabled only while device is active and disabled in Sleep mode; SWDTEN bit disabled.
7542 #define _WDTEN_ON_2H 0xFE // WDT controlled by SWDTEN bit setting.
7543 #define _WDTEN_SWDTDIS_2H 0xFF // WDT enabled in hardware; SWDTEN bit disabled.
7544 #define _WDTPS_1_2H 0x83 // 1:1.
7545 #define _WDTPS_2_2H 0x87 // 1:2.
7546 #define _WDTPS_4_2H 0x8B // 1:4.
7547 #define _WDTPS_8_2H 0x8F // 1:8.
7548 #define _WDTPS_16_2H 0x93 // 1:16.
7549 #define _WDTPS_32_2H 0x97 // 1:32.
7550 #define _WDTPS_64_2H 0x9B // 1:64.
7551 #define _WDTPS_128_2H 0x9F // 1:128.
7552 #define _WDTPS_256_2H 0xA3 // 1:256.
7553 #define _WDTPS_512_2H 0xA7 // 1:512.
7554 #define _WDTPS_1024_2H 0xAB // 1:1024.
7555 #define _WDTPS_2048_2H 0xAF // 1:2048.
7556 #define _WDTPS_4096_2H 0xB3 // 1:4096.
7557 #define _WDTPS_8192_2H 0xB7 // 1:8192.
7558 #define _WDTPS_16384_2H 0xBB // 1:16384.
7559 #define _WDTPS_32768_2H 0xBF // 1:32768.
7560 #define _WDTPS_65536_2H 0xC3 // 1:65536.
7561 #define _WDTPS_131072_2H 0xC7 // 1:131072.
7562 #define _WDTPS_262144_2H 0xCB // 1:262144.
7563 #define _WDTPS_524288_2H 0xCF // 1:524288.
7564 #define _WDTPS_1048576_2H 0xFF // 1:1048576.
7566 //----------------------------- CONFIG3L Options -------------------------------
7568 #define _RTCOSC_INTOSCREF_3L 0xFE // RTCC uses INTRC.
7569 #define _RTCOSC_SOSCREF_3L 0xFF // RTCC uses SOSC.
7570 #define _EASHFT_OFF_3L 0xF7 // Address Shifting disabled.
7571 #define _EASHFT_ON_3L 0xFF // Address Shifting enabled.
7572 #define _ABW_XM20_3L 0xCF // 20-bit address bus.
7573 #define _ABW_XM16_3L 0xDF // 16-bit address bus.
7574 #define _ABW_XM12_3L 0xEF // 12-bit address bus.
7575 #define _ABW_MM_3L 0xFF // 8-bit address bus.
7576 #define _BW_8_3L 0xBF // 8-bit external bus mode.
7577 #define _BW_16_3L 0xFF // 16-bit external bus mode.
7578 #define _WAIT_ON_3L 0x7F // Enabled.
7579 #define _WAIT_OFF_3L 0xFF // Disabled.
7581 //----------------------------- CONFIG3H Options -------------------------------
7583 #define _CCP2MX_PORTBE_3H 0xFE // RE7-Microcontroller Mode/RB3-All other modes.
7584 #define _CCP2MX_PORTC_3H 0xFF // RC1.
7585 #define _ECCPMX_PORTH_3H 0xFD // Enhanced CCP1/3 [P1B/P1C/P3B/P3C] muxed with RH7/RH6/RH5/RH4.
7586 #define _ECCPMX_PORTE_3H 0xFF // Enhanced CCP1/3 [P1B/P1C/P3B/P3C] muxed with RE6/RE5/RE4/RE3.
7587 #define _MSSPMSK_MSK5_3H 0xF7 // 5 bit address masking mode.
7588 #define _MSSPMSK_MSK7_3H 0xFF // 7 Bit address masking mode.
7589 #define _MCLRE_OFF_3H 0x7F // MCLR Disabled, RG5 Enabled.
7590 #define _MCLRE_ON_3H 0xFF // MCLR Enabled, RG5 Disabled.
7592 //----------------------------- CONFIG4L Options -------------------------------
7594 #define _STVREN_OFF_4L 0xFE // Disabled.
7595 #define _STVREN_ON_4L 0xFF // Enabled.
7596 #define _BBSIZ_BB1K_4L 0xEF // 1K word Boot Block size.
7597 #define _BBSIZ_BB2K_4L 0xFF // 2K word Boot Block size.
7598 #define _DEBUG_ON_4L 0x7F // Enabled.
7599 #define _DEBUG_OFF_4L 0xFF // Disabled.
7601 //----------------------------- CONFIG5L Options -------------------------------
7603 #define _CP0_ON_5L 0xFE // Enabled.
7604 #define _CP0_OFF_5L 0xFF // Disabled.
7605 #define _CP1_ON_5L 0xFD // Enabled.
7606 #define _CP1_OFF_5L 0xFF // Disabled.
7607 #define _CP2_ON_5L 0xFB // Enabled.
7608 #define _CP2_OFF_5L 0xFF // Disabled.
7609 #define _CP3_ON_5L 0xF7 // Enabled.
7610 #define _CP3_OFF_5L 0xFF // Disabled.
7611 #define _CP4_ON_5L 0xEF // Enabled.
7612 #define _CP4_OFF_5L 0xFF // Disabled.
7613 #define _CP5_ON_5L 0xDF // Enabled.
7614 #define _CP5_OFF_5L 0xFF // Disabled.
7615 #define _CP6_ON_5L 0xBF // Enabled.
7616 #define _CP6_OFF_5L 0xFF // Disabled.
7617 #define _CP7_ON_5L 0x7F // Enabled.
7618 #define _CP7_OFF_5L 0xFF // Disabled.
7620 //----------------------------- CONFIG5H Options -------------------------------
7622 #define _CPB_ON_5H 0xBF // Enabled.
7623 #define _CPB_OFF_5H 0xFF // Disabled.
7624 #define _CPD_ON_5H 0x7F // Enabled.
7625 #define _CPD_OFF_5H 0xFF // Disabled.
7627 //----------------------------- CONFIG6L Options -------------------------------
7629 #define _WRT0_ON_6L 0xFE // Enabled.
7630 #define _WRT0_OFF_6L 0xFF // Disabled.
7631 #define _WRT1_ON_6L 0xFD // Enabled.
7632 #define _WRT1_OFF_6L 0xFF // Disabled.
7633 #define _WRT2_ON_6L 0xFB // Enabled.
7634 #define _WRT2_OFF_6L 0xFF // Disabled.
7635 #define _WRT3_ON_6L 0xF7 // Enabled.
7636 #define _WRT3_OFF_6L 0xFF // Disabled.
7637 #define _WRT4_ON_6L 0xEF // Enabled.
7638 #define _WRT4_OFF_6L 0xFF // Disabled.
7639 #define _WRT5_ON_6L 0xDF // Enabled.
7640 #define _WRT5_OFF_6L 0xFF // Disabled.
7641 #define _WRT6_ON_6L 0xBF // Enabled.
7642 #define _WRT6_OFF_6L 0xFF // Disabled.
7643 #define _WRT7_ON_6L 0x7F // Enabled.
7644 #define _WRT7_OFF_6L 0xFF // Disabled.
7646 //----------------------------- CONFIG6H Options -------------------------------
7648 #define _WRTC_ON_6H 0xDF // Enabled.
7649 #define _WRTC_OFF_6H 0xFF // Disabled.
7650 #define _WRTB_ON_6H 0xBF // Enabled.
7651 #define _WRTB_OFF_6H 0xFF // Disabled.
7652 #define _WRTD_ON_6H 0x7F // Enabled.
7653 #define _WRTD_OFF_6H 0xFF // Disabled.
7655 //----------------------------- CONFIG7L Options -------------------------------
7657 #define _EBRT0_ON_7L 0xFE // Enabled.
7658 #define _EBRT0_OFF_7L 0xFF // Disabled.
7659 #define _EBRT1_ON_7L 0xFD // Enabled.
7660 #define _EBRT1_OFF_7L 0xFF // Disabled.
7661 #define _EBRT2_ON_7L 0xFB // Enabled.
7662 #define _EBRT2_OFF_7L 0xFF // Disabled.
7663 #define _EBRT3_ON_7L 0xF7 // Enabled.
7664 #define _EBRT3_OFF_7L 0xFF // Disabled.
7665 #define _EBRT4_ON_7L 0xEF // Enabled.
7666 #define _EBRT4_OFF_7L 0xFF // Disabled.
7667 #define _EBRT5_ON_7L 0xDF // Enabled.
7668 #define _EBRT5_OFF_7L 0xFF // Disabled.
7669 #define _EBRT6_ON_7L 0xBF // Enabled.
7670 #define _EBRT6_OFF_7L 0xFF // Disabled.
7671 #define _EBRT7_ON_7L 0x7F // Enabled.
7672 #define _EBRT7_OFF_7L 0xFF // Disabled.
7674 //----------------------------- CONFIG7H Options -------------------------------
7676 #define _EBRTB_ON_7H 0xBF // Enabled.
7677 #define _EBRTB_OFF_7H 0xFF // Disabled.
7679 //==============================================================================
7681 #define __DEVID1 0x3FFFFE
7682 #define __DEVID2 0x3FFFFF
7684 #define __IDLOC0 0x200000
7685 #define __IDLOC1 0x200001
7686 #define __IDLOC2 0x200002
7687 #define __IDLOC3 0x200003
7688 #define __IDLOC4 0x200004
7689 #define __IDLOC5 0x200005
7690 #define __IDLOC6 0x200006
7691 #define __IDLOC7 0x200007
7693 #endif // #ifndef __PIC18F87K22_H__