struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic16 / pic18f66k22.h
blob60d244357ee356f201af71fdf97ac161b8353f76
1 /*
2 * This declarations of the PIC18F66K22 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:34 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 __PIC18F66K22_H__
26 #define __PIC18F66K22_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 : 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 _TMR1MD 0x02
119 #define _TMR2MD 0x04
120 #define _TMR3MD 0x08
121 #define _TMR4MD 0x10
122 #define _RTCCMD 0x20
123 #define _CTMUMD 0x40
124 #define _PSPMD 0x80
126 //==============================================================================
129 //==============================================================================
130 // PMD0 Bits
132 extern __at(0x0F19) __sfr PMD0;
134 typedef struct
136 unsigned ADCMD : 1;
137 unsigned SSP1MD : 1;
138 unsigned SSP2MD : 1;
139 unsigned UART1MD : 1;
140 unsigned UART2MD : 1;
141 unsigned CCP1MD : 1;
142 unsigned CCP2MD : 1;
143 unsigned CCP3MD : 1;
144 } __PMD0bits_t;
146 extern __at(0x0F19) volatile __PMD0bits_t PMD0bits;
148 #define _ADCMD 0x01
149 #define _SSP1MD 0x02
150 #define _SSP2MD 0x04
151 #define _UART1MD 0x08
152 #define _UART2MD 0x10
153 #define _CCP1MD 0x20
154 #define _CCP2MD 0x40
155 #define _CCP3MD 0x80
157 //==============================================================================
160 //==============================================================================
161 // PSTR3CON Bits
163 extern __at(0x0F1A) __sfr PSTR3CON;
165 typedef union
167 struct
169 unsigned STRA : 1;
170 unsigned STRB : 1;
171 unsigned STRC : 1;
172 unsigned STRD : 1;
173 unsigned STRSYNC : 1;
174 unsigned : 1;
175 unsigned CMPL0 : 1;
176 unsigned CMPL1 : 1;
179 struct
181 unsigned : 6;
182 unsigned CMPL : 2;
184 } __PSTR3CONbits_t;
186 extern __at(0x0F1A) volatile __PSTR3CONbits_t PSTR3CONbits;
188 #define _PSTR3CON_STRA 0x01
189 #define _PSTR3CON_STRB 0x02
190 #define _PSTR3CON_STRC 0x04
191 #define _PSTR3CON_STRD 0x08
192 #define _PSTR3CON_STRSYNC 0x10
193 #define _PSTR3CON_CMPL0 0x40
194 #define _PSTR3CON_CMPL1 0x80
196 //==============================================================================
199 //==============================================================================
200 // PSTR2CON Bits
202 extern __at(0x0F1B) __sfr PSTR2CON;
204 typedef union
206 struct
208 unsigned STRA : 1;
209 unsigned STRB : 1;
210 unsigned STRC : 1;
211 unsigned STRD : 1;
212 unsigned STRSYNC : 1;
213 unsigned : 1;
214 unsigned CMPL0 : 1;
215 unsigned CMPL1 : 1;
218 struct
220 unsigned : 6;
221 unsigned CMPL : 2;
223 } __PSTR2CONbits_t;
225 extern __at(0x0F1B) volatile __PSTR2CONbits_t PSTR2CONbits;
227 #define _PSTR2CON_STRA 0x01
228 #define _PSTR2CON_STRB 0x02
229 #define _PSTR2CON_STRC 0x04
230 #define _PSTR2CON_STRD 0x08
231 #define _PSTR2CON_STRSYNC 0x10
232 #define _PSTR2CON_CMPL0 0x40
233 #define _PSTR2CON_CMPL1 0x80
235 //==============================================================================
237 extern __at(0x0F1C) __sfr TXREG2;
238 extern __at(0x0F1D) __sfr RCREG2;
239 extern __at(0x0F1E) __sfr SPBRG2;
240 extern __at(0x0F1F) __sfr SPBRGH2;
242 //==============================================================================
243 // BAUDCON2 Bits
245 extern __at(0x0F20) __sfr BAUDCON2;
247 typedef struct
249 unsigned ABDEN : 1;
250 unsigned WUE : 1;
251 unsigned : 1;
252 unsigned BRG16 : 1;
253 unsigned TXCKP : 1;
254 unsigned RXDTP : 1;
255 unsigned RCIDL : 1;
256 unsigned ABDOVF : 1;
257 } __BAUDCON2bits_t;
259 extern __at(0x0F20) volatile __BAUDCON2bits_t BAUDCON2bits;
261 #define _BAUDCON2_ABDEN 0x01
262 #define _BAUDCON2_WUE 0x02
263 #define _BAUDCON2_BRG16 0x08
264 #define _BAUDCON2_TXCKP 0x10
265 #define _BAUDCON2_RXDTP 0x20
266 #define _BAUDCON2_RCIDL 0x40
267 #define _BAUDCON2_ABDOVF 0x80
269 //==============================================================================
272 //==============================================================================
273 // TXSTA2 Bits
275 extern __at(0x0F21) __sfr TXSTA2;
277 typedef union
279 struct
281 unsigned TX9D : 1;
282 unsigned TRMT : 1;
283 unsigned BRGH : 1;
284 unsigned SENDB : 1;
285 unsigned SYNC : 1;
286 unsigned TXEN : 1;
287 unsigned TX9 : 1;
288 unsigned CSRC : 1;
291 struct
293 unsigned TX9D2 : 1;
294 unsigned TRMT2 : 1;
295 unsigned BRGH2 : 1;
296 unsigned SENDB2 : 1;
297 unsigned SYNC2 : 1;
298 unsigned TXEN2 : 1;
299 unsigned TX92 : 1;
300 unsigned CSRC2 : 1;
302 } __TXSTA2bits_t;
304 extern __at(0x0F21) volatile __TXSTA2bits_t TXSTA2bits;
306 #define _TXSTA2_TX9D 0x01
307 #define _TXSTA2_TX9D2 0x01
308 #define _TXSTA2_TRMT 0x02
309 #define _TXSTA2_TRMT2 0x02
310 #define _TXSTA2_BRGH 0x04
311 #define _TXSTA2_BRGH2 0x04
312 #define _TXSTA2_SENDB 0x08
313 #define _TXSTA2_SENDB2 0x08
314 #define _TXSTA2_SYNC 0x10
315 #define _TXSTA2_SYNC2 0x10
316 #define _TXSTA2_TXEN 0x20
317 #define _TXSTA2_TXEN2 0x20
318 #define _TXSTA2_TX9 0x40
319 #define _TXSTA2_TX92 0x40
320 #define _TXSTA2_CSRC 0x80
321 #define _TXSTA2_CSRC2 0x80
323 //==============================================================================
326 //==============================================================================
327 // RCSTA2 Bits
329 extern __at(0x0F22) __sfr RCSTA2;
331 typedef union
333 struct
335 unsigned RX9D : 1;
336 unsigned OERR : 1;
337 unsigned FERR : 1;
338 unsigned ADDEN : 1;
339 unsigned CREN : 1;
340 unsigned SREN : 1;
341 unsigned RX9 : 1;
342 unsigned SPEN : 1;
345 struct
347 unsigned RX9D2 : 1;
348 unsigned OERR2 : 1;
349 unsigned FERR2 : 1;
350 unsigned ADDEN2 : 1;
351 unsigned CREN2 : 1;
352 unsigned SREN2 : 1;
353 unsigned RX92 : 1;
354 unsigned SPEN2 : 1;
356 } __RCSTA2bits_t;
358 extern __at(0x0F22) volatile __RCSTA2bits_t RCSTA2bits;
360 #define _RCSTA2_RX9D 0x01
361 #define _RCSTA2_RX9D2 0x01
362 #define _RCSTA2_OERR 0x02
363 #define _RCSTA2_OERR2 0x02
364 #define _RCSTA2_FERR 0x04
365 #define _RCSTA2_FERR2 0x04
366 #define _RCSTA2_ADDEN 0x08
367 #define _RCSTA2_ADDEN2 0x08
368 #define _RCSTA2_CREN 0x10
369 #define _RCSTA2_CREN2 0x10
370 #define _RCSTA2_SREN 0x20
371 #define _RCSTA2_SREN2 0x20
372 #define _RCSTA2_RX9 0x40
373 #define _RCSTA2_RX92 0x40
374 #define _RCSTA2_SPEN 0x80
375 #define _RCSTA2_SPEN2 0x80
377 //==============================================================================
380 //==============================================================================
381 // ANCON2 Bits
383 extern __at(0x0F23) __sfr ANCON2;
385 typedef struct
387 unsigned ANSEL16 : 1;
388 unsigned ANSEL17 : 1;
389 unsigned ANSEL18 : 1;
390 unsigned ANSEL19 : 1;
391 unsigned : 1;
392 unsigned : 1;
393 unsigned : 1;
394 unsigned : 1;
395 } __ANCON2bits_t;
397 extern __at(0x0F23) volatile __ANCON2bits_t ANCON2bits;
399 #define _ANSEL16 0x01
400 #define _ANSEL17 0x02
401 #define _ANSEL18 0x04
402 #define _ANSEL19 0x08
404 //==============================================================================
407 //==============================================================================
408 // ANCON1 Bits
410 extern __at(0x0F24) __sfr ANCON1;
412 typedef struct
414 unsigned ANSEL8 : 1;
415 unsigned ANSEL9 : 1;
416 unsigned ANSEL10 : 1;
417 unsigned ANSEL11 : 1;
418 unsigned : 1;
419 unsigned : 1;
420 unsigned : 1;
421 unsigned : 1;
422 } __ANCON1bits_t;
424 extern __at(0x0F24) volatile __ANCON1bits_t ANCON1bits;
426 #define _ANSEL8 0x01
427 #define _ANSEL9 0x02
428 #define _ANSEL10 0x04
429 #define _ANSEL11 0x08
431 //==============================================================================
434 //==============================================================================
435 // ANCON0 Bits
437 extern __at(0x0F25) __sfr ANCON0;
439 typedef struct
441 unsigned ANSEL0 : 1;
442 unsigned ANSEL1 : 1;
443 unsigned ANSEL2 : 1;
444 unsigned ANSEL3 : 1;
445 unsigned ANSEL4 : 1;
446 unsigned ANSEL5 : 1;
447 unsigned ANSEL6 : 1;
448 unsigned ANSEL7 : 1;
449 } __ANCON0bits_t;
451 extern __at(0x0F25) volatile __ANCON0bits_t ANCON0bits;
453 #define _ANSEL0 0x01
454 #define _ANSEL1 0x02
455 #define _ANSEL2 0x04
456 #define _ANSEL3 0x08
457 #define _ANSEL4 0x10
458 #define _ANSEL5 0x20
459 #define _ANSEL6 0x40
460 #define _ANSEL7 0x80
462 //==============================================================================
465 //==============================================================================
466 // ODCON3 Bits
468 extern __at(0x0F27) __sfr ODCON3;
470 typedef struct
472 unsigned CTMUDS : 1;
473 unsigned : 1;
474 unsigned : 1;
475 unsigned : 1;
476 unsigned : 1;
477 unsigned : 1;
478 unsigned U1OD : 1;
479 unsigned U2OD : 1;
480 } __ODCON3bits_t;
482 extern __at(0x0F27) volatile __ODCON3bits_t ODCON3bits;
484 #define _CTMUDS 0x01
485 #define _U1OD 0x40
486 #define _U2OD 0x80
488 //==============================================================================
491 //==============================================================================
492 // ODCON2 Bits
494 extern __at(0x0F28) __sfr ODCON2;
496 typedef struct
498 unsigned CCP3OD : 1;
499 unsigned CCP4OD : 1;
500 unsigned CCP5OD : 1;
501 unsigned CCP6OD : 1;
502 unsigned CCP7OD : 1;
503 unsigned CCP8OD : 1;
504 unsigned CCP9OD : 1;
505 unsigned CCP10OD : 1;
506 } __ODCON2bits_t;
508 extern __at(0x0F28) volatile __ODCON2bits_t ODCON2bits;
510 #define _CCP3OD 0x01
511 #define _CCP4OD 0x02
512 #define _CCP5OD 0x04
513 #define _CCP6OD 0x08
514 #define _CCP7OD 0x10
515 #define _CCP8OD 0x20
516 #define _CCP9OD 0x40
517 #define _CCP10OD 0x80
519 //==============================================================================
522 //==============================================================================
523 // ODCON1 Bits
525 extern __at(0x0F29) __sfr ODCON1;
527 typedef struct
529 unsigned SPI2OD : 1;
530 unsigned : 1;
531 unsigned : 1;
532 unsigned : 1;
533 unsigned : 1;
534 unsigned CCP1OD : 1;
535 unsigned CCP2OD : 1;
536 unsigned SPI1OD : 1;
537 } __ODCON1bits_t;
539 extern __at(0x0F29) volatile __ODCON1bits_t ODCON1bits;
541 #define _SPI2OD 0x01
542 #define _CCP1OD 0x20
543 #define _CCP2OD 0x40
544 #define _SPI1OD 0x80
546 //==============================================================================
549 //==============================================================================
550 // REFOCON Bits
552 extern __at(0x0F2A) __sfr REFOCON;
554 typedef union
556 struct
558 unsigned RODIV0 : 1;
559 unsigned RODIV1 : 1;
560 unsigned RODIV2 : 1;
561 unsigned RODIV3 : 1;
562 unsigned ROSEL : 1;
563 unsigned ROSSLP : 1;
564 unsigned : 1;
565 unsigned ROON : 1;
568 struct
570 unsigned RODIV : 4;
571 unsigned : 4;
573 } __REFOCONbits_t;
575 extern __at(0x0F2A) volatile __REFOCONbits_t REFOCONbits;
577 #define _RODIV0 0x01
578 #define _RODIV1 0x02
579 #define _RODIV2 0x04
580 #define _RODIV3 0x08
581 #define _ROSEL 0x10
582 #define _ROSSLP 0x20
583 #define _ROON 0x80
585 //==============================================================================
588 //==============================================================================
589 // CCPTMRS2 Bits
591 extern __at(0x0F2B) __sfr CCPTMRS2;
593 typedef union
595 struct
597 unsigned C8TSEL0 : 1;
598 unsigned C8TSEL1 : 1;
599 unsigned C9TSEL0 : 1;
600 unsigned : 1;
601 unsigned C10TSEL0 : 1;
602 unsigned : 1;
603 unsigned : 1;
604 unsigned : 1;
607 struct
609 unsigned C8TSEL : 2;
610 unsigned : 6;
612 } __CCPTMRS2bits_t;
614 extern __at(0x0F2B) volatile __CCPTMRS2bits_t CCPTMRS2bits;
616 #define _C8TSEL0 0x01
617 #define _C8TSEL1 0x02
618 #define _C9TSEL0 0x04
619 #define _C10TSEL0 0x10
621 //==============================================================================
624 //==============================================================================
625 // CCPTMRS1 Bits
627 extern __at(0x0F2C) __sfr CCPTMRS1;
629 typedef union
631 struct
633 unsigned C4TSEL0 : 1;
634 unsigned C4TSEL1 : 1;
635 unsigned C5TSEL0 : 1;
636 unsigned : 1;
637 unsigned C6TSEL0 : 1;
638 unsigned : 1;
639 unsigned C7TSEL0 : 1;
640 unsigned C7TSEL1 : 1;
643 struct
645 unsigned C4TSEL : 2;
646 unsigned : 6;
649 struct
651 unsigned : 6;
652 unsigned C7TSEL : 2;
654 } __CCPTMRS1bits_t;
656 extern __at(0x0F2C) volatile __CCPTMRS1bits_t CCPTMRS1bits;
658 #define _C4TSEL0 0x01
659 #define _C4TSEL1 0x02
660 #define _C5TSEL0 0x04
661 #define _C6TSEL0 0x10
662 #define _C7TSEL0 0x40
663 #define _C7TSEL1 0x80
665 //==============================================================================
668 //==============================================================================
669 // CCPTMRS0 Bits
671 extern __at(0x0F2D) __sfr CCPTMRS0;
673 typedef union
675 struct
677 unsigned C1TSEL0 : 1;
678 unsigned C1TSEL1 : 1;
679 unsigned C1TSEL2 : 1;
680 unsigned C2TSEL0 : 1;
681 unsigned C2TSEL1 : 1;
682 unsigned C2TSEL2 : 1;
683 unsigned C3TSEL0 : 1;
684 unsigned C3TSEL1 : 1;
687 struct
689 unsigned C1TSEL : 3;
690 unsigned : 5;
693 struct
695 unsigned : 3;
696 unsigned C2TSEL : 3;
697 unsigned : 2;
700 struct
702 unsigned : 6;
703 unsigned C3TSEL : 2;
705 } __CCPTMRS0bits_t;
707 extern __at(0x0F2D) volatile __CCPTMRS0bits_t CCPTMRS0bits;
709 #define _C1TSEL0 0x01
710 #define _C1TSEL1 0x02
711 #define _C1TSEL2 0x04
712 #define _C2TSEL0 0x08
713 #define _C2TSEL1 0x10
714 #define _C2TSEL2 0x20
715 #define _C3TSEL0 0x40
716 #define _C3TSEL1 0x80
718 //==============================================================================
721 //==============================================================================
722 // CM3CON Bits
724 extern __at(0x0F2E) __sfr CM3CON;
726 typedef union
728 struct
730 unsigned CCH0 : 1;
731 unsigned CCH1 : 1;
732 unsigned CREF : 1;
733 unsigned EVPOL0 : 1;
734 unsigned EVPOL1 : 1;
735 unsigned CPOL : 1;
736 unsigned COE : 1;
737 unsigned CON : 1;
740 struct
742 unsigned CCH : 2;
743 unsigned : 6;
746 struct
748 unsigned : 3;
749 unsigned EVPOL : 2;
750 unsigned : 3;
752 } __CM3CONbits_t;
754 extern __at(0x0F2E) volatile __CM3CONbits_t CM3CONbits;
756 #define _CM3CON_CCH0 0x01
757 #define _CM3CON_CCH1 0x02
758 #define _CM3CON_CREF 0x04
759 #define _CM3CON_EVPOL0 0x08
760 #define _CM3CON_EVPOL1 0x10
761 #define _CM3CON_CPOL 0x20
762 #define _CM3CON_COE 0x40
763 #define _CM3CON_CON 0x80
765 //==============================================================================
768 //==============================================================================
769 // CM3CON1 Bits
771 extern __at(0x0F2E) __sfr CM3CON1;
773 typedef union
775 struct
777 unsigned CCH0 : 1;
778 unsigned CCH1 : 1;
779 unsigned CREF : 1;
780 unsigned EVPOL0 : 1;
781 unsigned EVPOL1 : 1;
782 unsigned CPOL : 1;
783 unsigned COE : 1;
784 unsigned CON : 1;
787 struct
789 unsigned CCH : 2;
790 unsigned : 6;
793 struct
795 unsigned : 3;
796 unsigned EVPOL : 2;
797 unsigned : 3;
799 } __CM3CON1bits_t;
801 extern __at(0x0F2E) volatile __CM3CON1bits_t CM3CON1bits;
803 #define _CM3CON1_CCH0 0x01
804 #define _CM3CON1_CCH1 0x02
805 #define _CM3CON1_CREF 0x04
806 #define _CM3CON1_EVPOL0 0x08
807 #define _CM3CON1_EVPOL1 0x10
808 #define _CM3CON1_CPOL 0x20
809 #define _CM3CON1_COE 0x40
810 #define _CM3CON1_CON 0x80
812 //==============================================================================
815 //==============================================================================
816 // CM2CON Bits
818 extern __at(0x0F2F) __sfr CM2CON;
820 typedef union
822 struct
824 unsigned CCH0 : 1;
825 unsigned CCH1 : 1;
826 unsigned CREF : 1;
827 unsigned EVPOL0 : 1;
828 unsigned EVPOL1 : 1;
829 unsigned CPOL : 1;
830 unsigned COE : 1;
831 unsigned CON : 1;
834 struct
836 unsigned CCH : 2;
837 unsigned : 6;
840 struct
842 unsigned : 3;
843 unsigned EVPOL : 2;
844 unsigned : 3;
846 } __CM2CONbits_t;
848 extern __at(0x0F2F) volatile __CM2CONbits_t CM2CONbits;
850 #define _CM2CON_CCH0 0x01
851 #define _CM2CON_CCH1 0x02
852 #define _CM2CON_CREF 0x04
853 #define _CM2CON_EVPOL0 0x08
854 #define _CM2CON_EVPOL1 0x10
855 #define _CM2CON_CPOL 0x20
856 #define _CM2CON_COE 0x40
857 #define _CM2CON_CON 0x80
859 //==============================================================================
862 //==============================================================================
863 // CM2CON1 Bits
865 extern __at(0x0F2F) __sfr CM2CON1;
867 typedef union
869 struct
871 unsigned CCH0 : 1;
872 unsigned CCH1 : 1;
873 unsigned CREF : 1;
874 unsigned EVPOL0 : 1;
875 unsigned EVPOL1 : 1;
876 unsigned CPOL : 1;
877 unsigned COE : 1;
878 unsigned CON : 1;
881 struct
883 unsigned CCH : 2;
884 unsigned : 6;
887 struct
889 unsigned : 3;
890 unsigned EVPOL : 2;
891 unsigned : 3;
893 } __CM2CON1bits_t;
895 extern __at(0x0F2F) volatile __CM2CON1bits_t CM2CON1bits;
897 #define _CM2CON1_CCH0 0x01
898 #define _CM2CON1_CCH1 0x02
899 #define _CM2CON1_CREF 0x04
900 #define _CM2CON1_EVPOL0 0x08
901 #define _CM2CON1_EVPOL1 0x10
902 #define _CM2CON1_CPOL 0x20
903 #define _CM2CON1_COE 0x40
904 #define _CM2CON1_CON 0x80
906 //==============================================================================
909 //==============================================================================
910 // T12CON Bits
912 extern __at(0x0F30) __sfr T12CON;
914 typedef union
916 struct
918 unsigned T12CKPS0 : 1;
919 unsigned T12CKPS1 : 1;
920 unsigned TMR12ON : 1;
921 unsigned T12OUTPS0 : 1;
922 unsigned T12OUTPS1 : 1;
923 unsigned T12OUTPS2 : 1;
924 unsigned T12OUTPS3 : 1;
925 unsigned : 1;
928 struct
930 unsigned T12CKPS : 2;
931 unsigned : 6;
934 struct
936 unsigned : 3;
937 unsigned T12OUTPS : 4;
938 unsigned : 1;
940 } __T12CONbits_t;
942 extern __at(0x0F30) volatile __T12CONbits_t T12CONbits;
944 #define _T12CKPS0 0x01
945 #define _T12CKPS1 0x02
946 #define _TMR12ON 0x04
947 #define _T12OUTPS0 0x08
948 #define _T12OUTPS1 0x10
949 #define _T12OUTPS2 0x20
950 #define _T12OUTPS3 0x40
952 //==============================================================================
954 extern __at(0x0F31) __sfr PR12;
955 extern __at(0x0F32) __sfr TMR12;
957 //==============================================================================
958 // T10CON Bits
960 extern __at(0x0F33) __sfr T10CON;
962 typedef union
964 struct
966 unsigned T10CKPS0 : 1;
967 unsigned T10CKPS1 : 1;
968 unsigned TMR10ON : 1;
969 unsigned T10OUTPS0 : 1;
970 unsigned T10OUTPS1 : 1;
971 unsigned T10OUTPS2 : 1;
972 unsigned T10OUTPS3 : 1;
973 unsigned : 1;
976 struct
978 unsigned T10CKPS : 2;
979 unsigned : 6;
982 struct
984 unsigned : 3;
985 unsigned T10OUTPS : 4;
986 unsigned : 1;
988 } __T10CONbits_t;
990 extern __at(0x0F33) volatile __T10CONbits_t T10CONbits;
992 #define _T10CKPS0 0x01
993 #define _T10CKPS1 0x02
994 #define _TMR10ON 0x04
995 #define _T10OUTPS0 0x08
996 #define _T10OUTPS1 0x10
997 #define _T10OUTPS2 0x20
998 #define _T10OUTPS3 0x40
1000 //==============================================================================
1002 extern __at(0x0F34) __sfr PR10;
1003 extern __at(0x0F35) __sfr TMR10;
1005 //==============================================================================
1006 // T8CON Bits
1008 extern __at(0x0F36) __sfr T8CON;
1010 typedef union
1012 struct
1014 unsigned T8CKPS0 : 1;
1015 unsigned T8CKPS1 : 1;
1016 unsigned TMR8ON : 1;
1017 unsigned T8OUTPS0 : 1;
1018 unsigned T8OUTPS1 : 1;
1019 unsigned T8OUTPS2 : 1;
1020 unsigned T8OUTPS3 : 1;
1021 unsigned : 1;
1024 struct
1026 unsigned T8CKPS : 2;
1027 unsigned : 6;
1030 struct
1032 unsigned : 3;
1033 unsigned T8OUTPS : 4;
1034 unsigned : 1;
1036 } __T8CONbits_t;
1038 extern __at(0x0F36) volatile __T8CONbits_t T8CONbits;
1040 #define _T8CKPS0 0x01
1041 #define _T8CKPS1 0x02
1042 #define _TMR8ON 0x04
1043 #define _T8OUTPS0 0x08
1044 #define _T8OUTPS1 0x10
1045 #define _T8OUTPS2 0x20
1046 #define _T8OUTPS3 0x40
1048 //==============================================================================
1050 extern __at(0x0F37) __sfr PR8;
1051 extern __at(0x0F38) __sfr TMR8;
1053 //==============================================================================
1054 // T6CON Bits
1056 extern __at(0x0F39) __sfr T6CON;
1058 typedef union
1060 struct
1062 unsigned T6CKPS0 : 1;
1063 unsigned T6CKPS1 : 1;
1064 unsigned TMR6ON : 1;
1065 unsigned T6OUTPS0 : 1;
1066 unsigned T6OUTPS1 : 1;
1067 unsigned T6OUTPS2 : 1;
1068 unsigned T6OUTPS3 : 1;
1069 unsigned : 1;
1072 struct
1074 unsigned T6CKPS : 2;
1075 unsigned : 6;
1078 struct
1080 unsigned : 3;
1081 unsigned T6OUTPS : 4;
1082 unsigned : 1;
1084 } __T6CONbits_t;
1086 extern __at(0x0F39) volatile __T6CONbits_t T6CONbits;
1088 #define _T6CKPS0 0x01
1089 #define _T6CKPS1 0x02
1090 #define _TMR6ON 0x04
1091 #define _T6OUTPS0 0x08
1092 #define _T6OUTPS1 0x10
1093 #define _T6OUTPS2 0x20
1094 #define _T6OUTPS3 0x40
1096 //==============================================================================
1098 extern __at(0x0F3A) __sfr PR6;
1099 extern __at(0x0F3B) __sfr TMR6;
1101 //==============================================================================
1102 // T7GCON Bits
1104 extern __at(0x0F3C) __sfr T7GCON;
1106 typedef union
1108 struct
1110 unsigned T7GSS0 : 1;
1111 unsigned T7GSS1 : 1;
1112 unsigned T7GVAL : 1;
1113 unsigned T7GGO_NOT_T7DONE : 1;
1114 unsigned T7GSPM : 1;
1115 unsigned T7GTM : 1;
1116 unsigned T7GPOL : 1;
1117 unsigned TMR7GE : 1;
1120 struct
1122 unsigned : 1;
1123 unsigned : 1;
1124 unsigned : 1;
1125 unsigned T7GGO : 1;
1126 unsigned : 1;
1127 unsigned : 1;
1128 unsigned : 1;
1129 unsigned : 1;
1132 struct
1134 unsigned : 1;
1135 unsigned : 1;
1136 unsigned : 1;
1137 unsigned NOT_T7DONE : 1;
1138 unsigned : 1;
1139 unsigned : 1;
1140 unsigned : 1;
1141 unsigned : 1;
1144 struct
1146 unsigned T7GSS : 2;
1147 unsigned : 6;
1149 } __T7GCONbits_t;
1151 extern __at(0x0F3C) volatile __T7GCONbits_t T7GCONbits;
1153 #define _T7GSS0 0x01
1154 #define _T7GSS1 0x02
1155 #define _T7GVAL 0x04
1156 #define _T7GGO_NOT_T7DONE 0x08
1157 #define _T7GGO 0x08
1158 #define _NOT_T7DONE 0x08
1159 #define _T7GSPM 0x10
1160 #define _T7GTM 0x20
1161 #define _T7GPOL 0x40
1162 #define _TMR7GE 0x80
1164 //==============================================================================
1167 //==============================================================================
1168 // T7CON Bits
1170 extern __at(0x0F3D) __sfr T7CON;
1172 typedef union
1174 struct
1176 unsigned TMR7ON : 1;
1177 unsigned RD16 : 1;
1178 unsigned NOT_T7SYNC : 1;
1179 unsigned SOSCEN : 1;
1180 unsigned T7CKPS0 : 1;
1181 unsigned T7CKPS1 : 1;
1182 unsigned TMR7CS0 : 1;
1183 unsigned TMR7CS1 : 1;
1186 struct
1188 unsigned : 4;
1189 unsigned T7CKPS : 2;
1190 unsigned : 2;
1193 struct
1195 unsigned : 6;
1196 unsigned TMR7CS : 2;
1198 } __T7CONbits_t;
1200 extern __at(0x0F3D) volatile __T7CONbits_t T7CONbits;
1202 #define _T7CON_TMR7ON 0x01
1203 #define _T7CON_RD16 0x02
1204 #define _T7CON_NOT_T7SYNC 0x04
1205 #define _T7CON_SOSCEN 0x08
1206 #define _T7CON_T7CKPS0 0x10
1207 #define _T7CON_T7CKPS1 0x20
1208 #define _T7CON_TMR7CS0 0x40
1209 #define _T7CON_TMR7CS1 0x80
1211 //==============================================================================
1213 extern __at(0x0F3E) __sfr TMR7;
1214 extern __at(0x0F3E) __sfr TMR7L;
1215 extern __at(0x0F3F) __sfr TMR7H;
1217 //==============================================================================
1218 // CCP10CON Bits
1220 extern __at(0x0F40) __sfr CCP10CON;
1222 typedef union
1224 struct
1226 unsigned CCP10M0 : 1;
1227 unsigned CCP10M1 : 1;
1228 unsigned CCP10M2 : 1;
1229 unsigned CCP10M3 : 1;
1230 unsigned DC10B0 : 1;
1231 unsigned DC10B1 : 1;
1232 unsigned : 1;
1233 unsigned : 1;
1236 struct
1238 unsigned : 1;
1239 unsigned : 1;
1240 unsigned : 1;
1241 unsigned : 1;
1242 unsigned CCP10Y : 1;
1243 unsigned CCP10X : 1;
1244 unsigned : 1;
1245 unsigned : 1;
1248 struct
1250 unsigned CCP10M : 4;
1251 unsigned : 4;
1254 struct
1256 unsigned : 4;
1257 unsigned DC10B : 2;
1258 unsigned : 2;
1260 } __CCP10CONbits_t;
1262 extern __at(0x0F40) volatile __CCP10CONbits_t CCP10CONbits;
1264 #define _CCP10M0 0x01
1265 #define _CCP10M1 0x02
1266 #define _CCP10M2 0x04
1267 #define _CCP10M3 0x08
1268 #define _DC10B0 0x10
1269 #define _CCP10Y 0x10
1270 #define _DC10B1 0x20
1271 #define _CCP10X 0x20
1273 //==============================================================================
1275 extern __at(0x0F41) __sfr CCPR10;
1276 extern __at(0x0F41) __sfr CCPR10L;
1277 extern __at(0x0F42) __sfr CCPR10H;
1279 //==============================================================================
1280 // CCP9CON Bits
1282 extern __at(0x0F43) __sfr CCP9CON;
1284 typedef union
1286 struct
1288 unsigned CCP9M0 : 1;
1289 unsigned CCP9M1 : 1;
1290 unsigned CCP9M2 : 1;
1291 unsigned CCP9M3 : 1;
1292 unsigned DC9B0 : 1;
1293 unsigned DC9B1 : 1;
1294 unsigned : 1;
1295 unsigned : 1;
1298 struct
1300 unsigned : 1;
1301 unsigned : 1;
1302 unsigned : 1;
1303 unsigned : 1;
1304 unsigned CCP9Y : 1;
1305 unsigned CCP9X : 1;
1306 unsigned : 1;
1307 unsigned : 1;
1310 struct
1312 unsigned CCP9M : 4;
1313 unsigned : 4;
1316 struct
1318 unsigned : 4;
1319 unsigned DC9B : 2;
1320 unsigned : 2;
1322 } __CCP9CONbits_t;
1324 extern __at(0x0F43) volatile __CCP9CONbits_t CCP9CONbits;
1326 #define _CCP9M0 0x01
1327 #define _CCP9M1 0x02
1328 #define _CCP9M2 0x04
1329 #define _CCP9M3 0x08
1330 #define _DC9B0 0x10
1331 #define _CCP9Y 0x10
1332 #define _DC9B1 0x20
1333 #define _CCP9X 0x20
1335 //==============================================================================
1337 extern __at(0x0F44) __sfr CCPR9;
1338 extern __at(0x0F44) __sfr CCPR9L;
1339 extern __at(0x0F45) __sfr CCPR9H;
1341 //==============================================================================
1342 // CCP8CON Bits
1344 extern __at(0x0F46) __sfr CCP8CON;
1346 typedef union
1348 struct
1350 unsigned CCP8M0 : 1;
1351 unsigned CCP8M1 : 1;
1352 unsigned CCP8M2 : 1;
1353 unsigned CCP8M3 : 1;
1354 unsigned DC8B0 : 1;
1355 unsigned DC8B1 : 1;
1356 unsigned : 1;
1357 unsigned : 1;
1360 struct
1362 unsigned : 1;
1363 unsigned : 1;
1364 unsigned : 1;
1365 unsigned : 1;
1366 unsigned CCP8Y : 1;
1367 unsigned CCP8X : 1;
1368 unsigned : 1;
1369 unsigned : 1;
1372 struct
1374 unsigned CCP8M : 4;
1375 unsigned : 4;
1378 struct
1380 unsigned : 4;
1381 unsigned DC8B : 2;
1382 unsigned : 2;
1384 } __CCP8CONbits_t;
1386 extern __at(0x0F46) volatile __CCP8CONbits_t CCP8CONbits;
1388 #define _CCP8M0 0x01
1389 #define _CCP8M1 0x02
1390 #define _CCP8M2 0x04
1391 #define _CCP8M3 0x08
1392 #define _DC8B0 0x10
1393 #define _CCP8Y 0x10
1394 #define _DC8B1 0x20
1395 #define _CCP8X 0x20
1397 //==============================================================================
1399 extern __at(0x0F47) __sfr CCPR8;
1400 extern __at(0x0F47) __sfr CCPR8L;
1401 extern __at(0x0F48) __sfr CCPR8H;
1403 //==============================================================================
1404 // CCP3CON Bits
1406 extern __at(0x0F49) __sfr CCP3CON;
1408 typedef union
1410 struct
1412 unsigned CCP3M0 : 1;
1413 unsigned CCP3M1 : 1;
1414 unsigned CCP3M2 : 1;
1415 unsigned CCP3M3 : 1;
1416 unsigned DC3B0 : 1;
1417 unsigned DC3B1 : 1;
1418 unsigned P3M0 : 1;
1419 unsigned P3M1 : 1;
1422 struct
1424 unsigned CCP3M : 4;
1425 unsigned : 4;
1428 struct
1430 unsigned : 4;
1431 unsigned DC3B : 2;
1432 unsigned : 2;
1435 struct
1437 unsigned : 6;
1438 unsigned P3M : 2;
1440 } __CCP3CONbits_t;
1442 extern __at(0x0F49) volatile __CCP3CONbits_t CCP3CONbits;
1444 #define _CCP3M0 0x01
1445 #define _CCP3M1 0x02
1446 #define _CCP3M2 0x04
1447 #define _CCP3M3 0x08
1448 #define _DC3B0 0x10
1449 #define _DC3B1 0x20
1450 #define _P3M0 0x40
1451 #define _P3M1 0x80
1453 //==============================================================================
1455 extern __at(0x0F4A) __sfr CCPR3;
1456 extern __at(0x0F4A) __sfr CCPR3L;
1457 extern __at(0x0F4B) __sfr CCPR3H;
1459 //==============================================================================
1460 // ECCP3DEL Bits
1462 extern __at(0x0F4C) __sfr ECCP3DEL;
1464 typedef union
1466 struct
1468 unsigned P3DC0 : 1;
1469 unsigned P3DC1 : 1;
1470 unsigned P3DC2 : 1;
1471 unsigned P3DC3 : 1;
1472 unsigned P3DC4 : 1;
1473 unsigned P3DC5 : 1;
1474 unsigned P3DC6 : 1;
1475 unsigned P3RSEN : 1;
1478 struct
1480 unsigned P3DC : 7;
1481 unsigned : 1;
1483 } __ECCP3DELbits_t;
1485 extern __at(0x0F4C) volatile __ECCP3DELbits_t ECCP3DELbits;
1487 #define _P3DC0 0x01
1488 #define _P3DC1 0x02
1489 #define _P3DC2 0x04
1490 #define _P3DC3 0x08
1491 #define _P3DC4 0x10
1492 #define _P3DC5 0x20
1493 #define _P3DC6 0x40
1494 #define _P3RSEN 0x80
1496 //==============================================================================
1499 //==============================================================================
1500 // ECCP3AS Bits
1502 extern __at(0x0F4D) __sfr ECCP3AS;
1504 typedef union
1506 struct
1508 unsigned PSS3BD0 : 1;
1509 unsigned PSS3BD1 : 1;
1510 unsigned PSS3AC0 : 1;
1511 unsigned PSS3AC1 : 1;
1512 unsigned ECCP3AS0 : 1;
1513 unsigned ECCP3AS1 : 1;
1514 unsigned ECCP3AS2 : 1;
1515 unsigned ECCP3ASE : 1;
1518 struct
1520 unsigned PSS3BD : 2;
1521 unsigned : 6;
1524 struct
1526 unsigned : 2;
1527 unsigned PSS3AC : 2;
1528 unsigned : 4;
1531 struct
1533 unsigned : 4;
1534 unsigned ECCP3AS : 3;
1535 unsigned : 1;
1537 } __ECCP3ASbits_t;
1539 extern __at(0x0F4D) volatile __ECCP3ASbits_t ECCP3ASbits;
1541 #define _PSS3BD0 0x01
1542 #define _PSS3BD1 0x02
1543 #define _PSS3AC0 0x04
1544 #define _PSS3AC1 0x08
1545 #define _ECCP3AS0 0x10
1546 #define _ECCP3AS1 0x20
1547 #define _ECCP3AS2 0x40
1548 #define _ECCP3ASE 0x80
1550 //==============================================================================
1553 //==============================================================================
1554 // CCP2CON Bits
1556 extern __at(0x0F4E) __sfr CCP2CON;
1558 typedef union
1560 struct
1562 unsigned CCP2M0 : 1;
1563 unsigned CCP2M1 : 1;
1564 unsigned CCP2M2 : 1;
1565 unsigned CCP2M3 : 1;
1566 unsigned DC2B0 : 1;
1567 unsigned DC2B1 : 1;
1568 unsigned P2M0 : 1;
1569 unsigned P2M1 : 1;
1572 struct
1574 unsigned : 1;
1575 unsigned : 1;
1576 unsigned : 1;
1577 unsigned : 1;
1578 unsigned CCP2Y : 1;
1579 unsigned CCP2X : 1;
1580 unsigned : 1;
1581 unsigned : 1;
1584 struct
1586 unsigned CCP2M : 4;
1587 unsigned : 4;
1590 struct
1592 unsigned : 4;
1593 unsigned DC2B : 2;
1594 unsigned : 2;
1597 struct
1599 unsigned : 6;
1600 unsigned P2M : 2;
1602 } __CCP2CONbits_t;
1604 extern __at(0x0F4E) volatile __CCP2CONbits_t CCP2CONbits;
1606 #define _CCP2M0 0x01
1607 #define _CCP2M1 0x02
1608 #define _CCP2M2 0x04
1609 #define _CCP2M3 0x08
1610 #define _DC2B0 0x10
1611 #define _CCP2Y 0x10
1612 #define _DC2B1 0x20
1613 #define _CCP2X 0x20
1614 #define _P2M0 0x40
1615 #define _P2M1 0x80
1617 //==============================================================================
1620 //==============================================================================
1621 // ECCP2CON Bits
1623 extern __at(0x0F4E) __sfr ECCP2CON;
1625 typedef union
1627 struct
1629 unsigned CCP2M0 : 1;
1630 unsigned CCP2M1 : 1;
1631 unsigned CCP2M2 : 1;
1632 unsigned CCP2M3 : 1;
1633 unsigned DC2B0 : 1;
1634 unsigned DC2B1 : 1;
1635 unsigned P2M0 : 1;
1636 unsigned P2M1 : 1;
1639 struct
1641 unsigned : 1;
1642 unsigned : 1;
1643 unsigned : 1;
1644 unsigned : 1;
1645 unsigned CCP2Y : 1;
1646 unsigned CCP2X : 1;
1647 unsigned : 1;
1648 unsigned : 1;
1651 struct
1653 unsigned CCP2M : 4;
1654 unsigned : 4;
1657 struct
1659 unsigned : 4;
1660 unsigned DC2B : 2;
1661 unsigned : 2;
1664 struct
1666 unsigned : 6;
1667 unsigned P2M : 2;
1669 } __ECCP2CONbits_t;
1671 extern __at(0x0F4E) volatile __ECCP2CONbits_t ECCP2CONbits;
1673 #define _ECCP2CON_CCP2M0 0x01
1674 #define _ECCP2CON_CCP2M1 0x02
1675 #define _ECCP2CON_CCP2M2 0x04
1676 #define _ECCP2CON_CCP2M3 0x08
1677 #define _ECCP2CON_DC2B0 0x10
1678 #define _ECCP2CON_CCP2Y 0x10
1679 #define _ECCP2CON_DC2B1 0x20
1680 #define _ECCP2CON_CCP2X 0x20
1681 #define _ECCP2CON_P2M0 0x40
1682 #define _ECCP2CON_P2M1 0x80
1684 //==============================================================================
1686 extern __at(0x0F4F) __sfr CCPR2;
1687 extern __at(0x0F4F) __sfr CCPR2L;
1688 extern __at(0x0F50) __sfr CCPR2H;
1690 //==============================================================================
1691 // ECCP2DEL Bits
1693 extern __at(0x0F51) __sfr ECCP2DEL;
1695 typedef union
1697 struct
1699 unsigned P2DC0 : 1;
1700 unsigned P2DC1 : 1;
1701 unsigned P2DC2 : 1;
1702 unsigned P2DC3 : 1;
1703 unsigned P2DC4 : 1;
1704 unsigned P2DC5 : 1;
1705 unsigned P2DC6 : 1;
1706 unsigned P2RSEN : 1;
1709 struct
1711 unsigned P2DC : 7;
1712 unsigned : 1;
1714 } __ECCP2DELbits_t;
1716 extern __at(0x0F51) volatile __ECCP2DELbits_t ECCP2DELbits;
1718 #define _P2DC0 0x01
1719 #define _P2DC1 0x02
1720 #define _P2DC2 0x04
1721 #define _P2DC3 0x08
1722 #define _P2DC4 0x10
1723 #define _P2DC5 0x20
1724 #define _P2DC6 0x40
1725 #define _P2RSEN 0x80
1727 //==============================================================================
1730 //==============================================================================
1731 // PWM2CON Bits
1733 extern __at(0x0F51) __sfr PWM2CON;
1735 typedef union
1737 struct
1739 unsigned P2DC0 : 1;
1740 unsigned P2DC1 : 1;
1741 unsigned P2DC2 : 1;
1742 unsigned P2DC3 : 1;
1743 unsigned P2DC4 : 1;
1744 unsigned P2DC5 : 1;
1745 unsigned P2DC6 : 1;
1746 unsigned P2RSEN : 1;
1749 struct
1751 unsigned P2DC : 7;
1752 unsigned : 1;
1754 } __PWM2CONbits_t;
1756 extern __at(0x0F51) volatile __PWM2CONbits_t PWM2CONbits;
1758 #define _PWM2CON_P2DC0 0x01
1759 #define _PWM2CON_P2DC1 0x02
1760 #define _PWM2CON_P2DC2 0x04
1761 #define _PWM2CON_P2DC3 0x08
1762 #define _PWM2CON_P2DC4 0x10
1763 #define _PWM2CON_P2DC5 0x20
1764 #define _PWM2CON_P2DC6 0x40
1765 #define _PWM2CON_P2RSEN 0x80
1767 //==============================================================================
1770 //==============================================================================
1771 // ECCP2AS Bits
1773 extern __at(0x0F52) __sfr ECCP2AS;
1775 typedef union
1777 struct
1779 unsigned PSS2BD0 : 1;
1780 unsigned PSS2BD1 : 1;
1781 unsigned PSS2AC0 : 1;
1782 unsigned PSS2AC1 : 1;
1783 unsigned ECCP2AS0 : 1;
1784 unsigned ECCP2AS1 : 1;
1785 unsigned ECCP2AS2 : 1;
1786 unsigned ECCP2ASE : 1;
1789 struct
1791 unsigned PSS2BD : 2;
1792 unsigned : 6;
1795 struct
1797 unsigned : 2;
1798 unsigned PSS2AC : 2;
1799 unsigned : 4;
1802 struct
1804 unsigned : 4;
1805 unsigned ECCP2AS : 3;
1806 unsigned : 1;
1808 } __ECCP2ASbits_t;
1810 extern __at(0x0F52) volatile __ECCP2ASbits_t ECCP2ASbits;
1812 #define _PSS2BD0 0x01
1813 #define _PSS2BD1 0x02
1814 #define _PSS2AC0 0x04
1815 #define _PSS2AC1 0x08
1816 #define _ECCP2AS0 0x10
1817 #define _ECCP2AS1 0x20
1818 #define _ECCP2AS2 0x40
1819 #define _ECCP2ASE 0x80
1821 //==============================================================================
1824 //==============================================================================
1825 // PADCFG1 Bits
1827 extern __at(0x0F53) __sfr PADCFG1;
1829 typedef union
1831 struct
1833 unsigned : 1;
1834 unsigned RTSECSEL0 : 1;
1835 unsigned RTSECSEL1 : 1;
1836 unsigned : 1;
1837 unsigned : 1;
1838 unsigned : 1;
1839 unsigned REPU : 1;
1840 unsigned RDPU : 1;
1843 struct
1845 unsigned : 1;
1846 unsigned RTSECSEL : 2;
1847 unsigned : 5;
1849 } __PADCFG1bits_t;
1851 extern __at(0x0F53) volatile __PADCFG1bits_t PADCFG1bits;
1853 #define _RTSECSEL0 0x02
1854 #define _RTSECSEL1 0x04
1855 #define _REPU 0x40
1856 #define _RDPU 0x80
1858 //==============================================================================
1861 //==============================================================================
1862 // CM1CON Bits
1864 extern __at(0x0F54) __sfr CM1CON;
1866 typedef union
1868 struct
1870 unsigned CCH0 : 1;
1871 unsigned CCH1 : 1;
1872 unsigned CREF : 1;
1873 unsigned EVPOL0 : 1;
1874 unsigned EVPOL1 : 1;
1875 unsigned CPOL : 1;
1876 unsigned COE : 1;
1877 unsigned CON : 1;
1880 struct
1882 unsigned CCH : 2;
1883 unsigned : 6;
1886 struct
1888 unsigned : 3;
1889 unsigned EVPOL : 2;
1890 unsigned : 3;
1892 } __CM1CONbits_t;
1894 extern __at(0x0F54) volatile __CM1CONbits_t CM1CONbits;
1896 #define _CCH0 0x01
1897 #define _CCH1 0x02
1898 #define _CREF 0x04
1899 #define _EVPOL0 0x08
1900 #define _EVPOL1 0x10
1901 #define _CPOL 0x20
1902 #define _COE 0x40
1903 #define _CON 0x80
1905 //==============================================================================
1908 //==============================================================================
1909 // CM1CON1 Bits
1911 extern __at(0x0F54) __sfr CM1CON1;
1913 typedef union
1915 struct
1917 unsigned CCH0 : 1;
1918 unsigned CCH1 : 1;
1919 unsigned CREF : 1;
1920 unsigned EVPOL0 : 1;
1921 unsigned EVPOL1 : 1;
1922 unsigned CPOL : 1;
1923 unsigned COE : 1;
1924 unsigned CON : 1;
1927 struct
1929 unsigned CCH : 2;
1930 unsigned : 6;
1933 struct
1935 unsigned : 3;
1936 unsigned EVPOL : 2;
1937 unsigned : 3;
1939 } __CM1CON1bits_t;
1941 extern __at(0x0F54) volatile __CM1CON1bits_t CM1CON1bits;
1943 #define _CM1CON1_CCH0 0x01
1944 #define _CM1CON1_CCH1 0x02
1945 #define _CM1CON1_CREF 0x04
1946 #define _CM1CON1_EVPOL0 0x08
1947 #define _CM1CON1_EVPOL1 0x10
1948 #define _CM1CON1_CPOL 0x20
1949 #define _CM1CON1_COE 0x40
1950 #define _CM1CON1_CON 0x80
1952 //==============================================================================
1955 //==============================================================================
1956 // CTMUICON Bits
1958 extern __at(0x0F55) __sfr CTMUICON;
1960 typedef union
1962 struct
1964 unsigned IRNG0 : 1;
1965 unsigned IRNG1 : 1;
1966 unsigned ITRIM0 : 1;
1967 unsigned ITRIM1 : 1;
1968 unsigned ITRIM2 : 1;
1969 unsigned ITRIM3 : 1;
1970 unsigned ITRIM4 : 1;
1971 unsigned ITRIM5 : 1;
1974 struct
1976 unsigned IRNG : 2;
1977 unsigned : 6;
1980 struct
1982 unsigned : 2;
1983 unsigned ITRIM : 6;
1985 } __CTMUICONbits_t;
1987 extern __at(0x0F55) volatile __CTMUICONbits_t CTMUICONbits;
1989 #define _IRNG0 0x01
1990 #define _IRNG1 0x02
1991 #define _ITRIM0 0x04
1992 #define _ITRIM1 0x08
1993 #define _ITRIM2 0x10
1994 #define _ITRIM3 0x20
1995 #define _ITRIM4 0x40
1996 #define _ITRIM5 0x80
1998 //==============================================================================
2001 //==============================================================================
2002 // CTMUCONL Bits
2004 extern __at(0x0F56) __sfr CTMUCONL;
2006 typedef union
2008 struct
2010 unsigned EDG1STAT : 1;
2011 unsigned EDG2STAT : 1;
2012 unsigned EDG1SEL0 : 1;
2013 unsigned EDG1SEL1 : 1;
2014 unsigned EDG1POL : 1;
2015 unsigned EDG2SEL0 : 1;
2016 unsigned EDG2SEL1 : 1;
2017 unsigned EDG2POL : 1;
2020 struct
2022 unsigned : 2;
2023 unsigned EDG1SEL : 2;
2024 unsigned : 4;
2027 struct
2029 unsigned : 5;
2030 unsigned EDG2SEL : 2;
2031 unsigned : 1;
2033 } __CTMUCONLbits_t;
2035 extern __at(0x0F56) volatile __CTMUCONLbits_t CTMUCONLbits;
2037 #define _EDG1STAT 0x01
2038 #define _EDG2STAT 0x02
2039 #define _EDG1SEL0 0x04
2040 #define _EDG1SEL1 0x08
2041 #define _EDG1POL 0x10
2042 #define _EDG2SEL0 0x20
2043 #define _EDG2SEL1 0x40
2044 #define _EDG2POL 0x80
2046 //==============================================================================
2049 //==============================================================================
2050 // CTMUCONH Bits
2052 extern __at(0x0F57) __sfr CTMUCONH;
2054 typedef struct
2056 unsigned CTTRIG : 1;
2057 unsigned IDISSEN : 1;
2058 unsigned EDGSEQEN : 1;
2059 unsigned EDGEN : 1;
2060 unsigned TGEN : 1;
2061 unsigned CTMUSIDL : 1;
2062 unsigned : 1;
2063 unsigned CTMUEN : 1;
2064 } __CTMUCONHbits_t;
2066 extern __at(0x0F57) volatile __CTMUCONHbits_t CTMUCONHbits;
2068 #define _CTTRIG 0x01
2069 #define _IDISSEN 0x02
2070 #define _EDGSEQEN 0x04
2071 #define _EDGEN 0x08
2072 #define _TGEN 0x10
2073 #define _CTMUSIDL 0x20
2074 #define _CTMUEN 0x80
2076 //==============================================================================
2078 extern __at(0x0F58) __sfr ALRMVAL;
2079 extern __at(0x0F58) __sfr ALRMVALL;
2080 extern __at(0x0F59) __sfr ALRMVALH;
2082 //==============================================================================
2083 // ALRMRPT Bits
2085 extern __at(0x0F5A) __sfr ALRMRPT;
2087 typedef struct
2089 unsigned ARPT0 : 1;
2090 unsigned ARPT1 : 1;
2091 unsigned ARPT2 : 1;
2092 unsigned ARPT3 : 1;
2093 unsigned ARPT4 : 1;
2094 unsigned ARPT5 : 1;
2095 unsigned ARPT6 : 1;
2096 unsigned ARPT7 : 1;
2097 } __ALRMRPTbits_t;
2099 extern __at(0x0F5A) volatile __ALRMRPTbits_t ALRMRPTbits;
2101 #define _ARPT0 0x01
2102 #define _ARPT1 0x02
2103 #define _ARPT2 0x04
2104 #define _ARPT3 0x08
2105 #define _ARPT4 0x10
2106 #define _ARPT5 0x20
2107 #define _ARPT6 0x40
2108 #define _ARPT7 0x80
2110 //==============================================================================
2113 //==============================================================================
2114 // ALRMCFG Bits
2116 extern __at(0x0F5B) __sfr ALRMCFG;
2118 typedef union
2120 struct
2122 unsigned ALRMPTR0 : 1;
2123 unsigned ALRMPTR1 : 1;
2124 unsigned AMASK0 : 1;
2125 unsigned AMASK1 : 1;
2126 unsigned AMASK2 : 1;
2127 unsigned AMASK3 : 1;
2128 unsigned CHIME : 1;
2129 unsigned ALRMEN : 1;
2132 struct
2134 unsigned ALRMPTR : 2;
2135 unsigned : 6;
2138 struct
2140 unsigned : 2;
2141 unsigned AMASK : 4;
2142 unsigned : 2;
2144 } __ALRMCFGbits_t;
2146 extern __at(0x0F5B) volatile __ALRMCFGbits_t ALRMCFGbits;
2148 #define _ALRMPTR0 0x01
2149 #define _ALRMPTR1 0x02
2150 #define _AMASK0 0x04
2151 #define _AMASK1 0x08
2152 #define _AMASK2 0x10
2153 #define _AMASK3 0x20
2154 #define _CHIME 0x40
2155 #define _ALRMEN 0x80
2157 //==============================================================================
2159 extern __at(0x0F5C) __sfr RTCVAL;
2160 extern __at(0x0F5C) __sfr RTCVALL;
2161 extern __at(0x0F5D) __sfr RTCVALH;
2163 //==============================================================================
2164 // RTCCAL Bits
2166 extern __at(0x0F5E) __sfr RTCCAL;
2168 typedef struct
2170 unsigned CAL0 : 1;
2171 unsigned CAL1 : 1;
2172 unsigned CAL2 : 1;
2173 unsigned CAL3 : 1;
2174 unsigned CAL4 : 1;
2175 unsigned CAL5 : 1;
2176 unsigned CAL6 : 1;
2177 unsigned CAL7 : 1;
2178 } __RTCCALbits_t;
2180 extern __at(0x0F5E) volatile __RTCCALbits_t RTCCALbits;
2182 #define _CAL0 0x01
2183 #define _CAL1 0x02
2184 #define _CAL2 0x04
2185 #define _CAL3 0x08
2186 #define _CAL4 0x10
2187 #define _CAL5 0x20
2188 #define _CAL6 0x40
2189 #define _CAL7 0x80
2191 //==============================================================================
2194 //==============================================================================
2195 // RTCCFG Bits
2197 extern __at(0x0F5F) __sfr RTCCFG;
2199 typedef union
2201 struct
2203 unsigned RTCPTR0 : 1;
2204 unsigned RTCPTR1 : 1;
2205 unsigned RTCOE : 1;
2206 unsigned HALFSEC : 1;
2207 unsigned RTCSYNC : 1;
2208 unsigned RTCWREN : 1;
2209 unsigned : 1;
2210 unsigned RTCEN : 1;
2213 struct
2215 unsigned RTCPTR : 2;
2216 unsigned : 6;
2218 } __RTCCFGbits_t;
2220 extern __at(0x0F5F) volatile __RTCCFGbits_t RTCCFGbits;
2222 #define _RTCPTR0 0x01
2223 #define _RTCPTR1 0x02
2224 #define _RTCOE 0x04
2225 #define _HALFSEC 0x08
2226 #define _RTCSYNC 0x10
2227 #define _RTCWREN 0x20
2228 #define _RTCEN 0x80
2230 //==============================================================================
2233 //==============================================================================
2234 // PIE6 Bits
2236 extern __at(0x0F60) __sfr PIE6;
2238 typedef struct
2240 unsigned CMP1IE : 1;
2241 unsigned CMP2IE : 1;
2242 unsigned CMP3IE : 1;
2243 unsigned : 1;
2244 unsigned EEIE : 1;
2245 unsigned : 1;
2246 unsigned : 1;
2247 unsigned : 1;
2248 } __PIE6bits_t;
2250 extern __at(0x0F60) volatile __PIE6bits_t PIE6bits;
2252 #define _CMP1IE 0x01
2253 #define _CMP2IE 0x02
2254 #define _CMP3IE 0x04
2255 #define _EEIE 0x10
2257 //==============================================================================
2259 extern __at(0x0F61) __sfr EEDATA;
2260 extern __at(0x0F62) __sfr EEADR;
2261 extern __at(0x0F63) __sfr EEADRH;
2263 //==============================================================================
2264 // OSCCON2 Bits
2266 extern __at(0x0F64) __sfr OSCCON2;
2268 typedef struct
2270 unsigned MFIOSEL : 1;
2271 unsigned MFIOFS : 1;
2272 unsigned : 1;
2273 unsigned SOSCGO : 1;
2274 unsigned : 1;
2275 unsigned : 1;
2276 unsigned SOSCRUN : 1;
2277 unsigned : 1;
2278 } __OSCCON2bits_t;
2280 extern __at(0x0F64) volatile __OSCCON2bits_t OSCCON2bits;
2282 #define _MFIOSEL 0x01
2283 #define _MFIOFS 0x02
2284 #define _SOSCGO 0x08
2285 #define _SOSCRUN 0x40
2287 //==============================================================================
2290 //==============================================================================
2291 // BAUDCON Bits
2293 extern __at(0x0F65) __sfr BAUDCON;
2295 typedef struct
2297 unsigned ABDEN : 1;
2298 unsigned WUE : 1;
2299 unsigned : 1;
2300 unsigned BRG16 : 1;
2301 unsigned TXCKP : 1;
2302 unsigned RXDTP : 1;
2303 unsigned RCIDL : 1;
2304 unsigned ABDOVF : 1;
2305 } __BAUDCONbits_t;
2307 extern __at(0x0F65) volatile __BAUDCONbits_t BAUDCONbits;
2309 #define _ABDEN 0x01
2310 #define _WUE 0x02
2311 #define _BRG16 0x08
2312 #define _TXCKP 0x10
2313 #define _RXDTP 0x20
2314 #define _RCIDL 0x40
2315 #define _ABDOVF 0x80
2317 //==============================================================================
2320 //==============================================================================
2321 // BAUDCON1 Bits
2323 extern __at(0x0F65) __sfr BAUDCON1;
2325 typedef struct
2327 unsigned ABDEN : 1;
2328 unsigned WUE : 1;
2329 unsigned : 1;
2330 unsigned BRG16 : 1;
2331 unsigned TXCKP : 1;
2332 unsigned RXDTP : 1;
2333 unsigned RCIDL : 1;
2334 unsigned ABDOVF : 1;
2335 } __BAUDCON1bits_t;
2337 extern __at(0x0F65) volatile __BAUDCON1bits_t BAUDCON1bits;
2339 #define _BAUDCON1_ABDEN 0x01
2340 #define _BAUDCON1_WUE 0x02
2341 #define _BAUDCON1_BRG16 0x08
2342 #define _BAUDCON1_TXCKP 0x10
2343 #define _BAUDCON1_RXDTP 0x20
2344 #define _BAUDCON1_RCIDL 0x40
2345 #define _BAUDCON1_ABDOVF 0x80
2347 //==============================================================================
2350 //==============================================================================
2351 // BAUDCTL Bits
2353 extern __at(0x0F65) __sfr BAUDCTL;
2355 typedef struct
2357 unsigned ABDEN : 1;
2358 unsigned WUE : 1;
2359 unsigned : 1;
2360 unsigned BRG16 : 1;
2361 unsigned TXCKP : 1;
2362 unsigned RXDTP : 1;
2363 unsigned RCIDL : 1;
2364 unsigned ABDOVF : 1;
2365 } __BAUDCTLbits_t;
2367 extern __at(0x0F65) volatile __BAUDCTLbits_t BAUDCTLbits;
2369 #define _BAUDCTL_ABDEN 0x01
2370 #define _BAUDCTL_WUE 0x02
2371 #define _BAUDCTL_BRG16 0x08
2372 #define _BAUDCTL_TXCKP 0x10
2373 #define _BAUDCTL_RXDTP 0x20
2374 #define _BAUDCTL_RCIDL 0x40
2375 #define _BAUDCTL_ABDOVF 0x80
2377 //==============================================================================
2380 //==============================================================================
2381 // SSP2CON2 Bits
2383 extern __at(0x0F66) __sfr SSP2CON2;
2385 typedef union
2387 struct
2389 unsigned SEN : 1;
2390 unsigned RSEN : 1;
2391 unsigned PEN : 1;
2392 unsigned RCEN : 1;
2393 unsigned ACKEN : 1;
2394 unsigned ACKDT : 1;
2395 unsigned ACKSTAT : 1;
2396 unsigned GCEN : 1;
2399 struct
2401 unsigned : 1;
2402 unsigned ADMSK1 : 1;
2403 unsigned ADMSK2 : 1;
2404 unsigned ADMSK3 : 1;
2405 unsigned ADMSK4 : 1;
2406 unsigned ADMSK5 : 1;
2407 unsigned : 1;
2408 unsigned : 1;
2410 } __SSP2CON2bits_t;
2412 extern __at(0x0F66) volatile __SSP2CON2bits_t SSP2CON2bits;
2414 #define _SSP2CON2_SEN 0x01
2415 #define _SSP2CON2_RSEN 0x02
2416 #define _SSP2CON2_ADMSK1 0x02
2417 #define _SSP2CON2_PEN 0x04
2418 #define _SSP2CON2_ADMSK2 0x04
2419 #define _SSP2CON2_RCEN 0x08
2420 #define _SSP2CON2_ADMSK3 0x08
2421 #define _SSP2CON2_ACKEN 0x10
2422 #define _SSP2CON2_ADMSK4 0x10
2423 #define _SSP2CON2_ACKDT 0x20
2424 #define _SSP2CON2_ADMSK5 0x20
2425 #define _SSP2CON2_ACKSTAT 0x40
2426 #define _SSP2CON2_GCEN 0x80
2428 //==============================================================================
2431 //==============================================================================
2432 // SSP2CON1 Bits
2434 extern __at(0x0F67) __sfr SSP2CON1;
2436 typedef union
2438 struct
2440 unsigned SSPM0 : 1;
2441 unsigned SSPM1 : 1;
2442 unsigned SSPM2 : 1;
2443 unsigned SSPM3 : 1;
2444 unsigned CKP : 1;
2445 unsigned SSPEN : 1;
2446 unsigned SSPOV : 1;
2447 unsigned WCOL : 1;
2450 struct
2452 unsigned SSPM : 4;
2453 unsigned : 4;
2455 } __SSP2CON1bits_t;
2457 extern __at(0x0F67) volatile __SSP2CON1bits_t SSP2CON1bits;
2459 #define _SSP2CON1_SSPM0 0x01
2460 #define _SSP2CON1_SSPM1 0x02
2461 #define _SSP2CON1_SSPM2 0x04
2462 #define _SSP2CON1_SSPM3 0x08
2463 #define _SSP2CON1_CKP 0x10
2464 #define _SSP2CON1_SSPEN 0x20
2465 #define _SSP2CON1_SSPOV 0x40
2466 #define _SSP2CON1_WCOL 0x80
2468 //==============================================================================
2471 //==============================================================================
2472 // SSP2STAT Bits
2474 extern __at(0x0F68) __sfr SSP2STAT;
2476 typedef union
2478 struct
2480 unsigned BF : 1;
2481 unsigned UA : 1;
2482 unsigned R_NOT_W : 1;
2483 unsigned S : 1;
2484 unsigned P : 1;
2485 unsigned D_NOT_A : 1;
2486 unsigned CKE : 1;
2487 unsigned SMP : 1;
2490 struct
2492 unsigned : 1;
2493 unsigned : 1;
2494 unsigned R : 1;
2495 unsigned I2C_START : 1;
2496 unsigned I2C_STOP : 1;
2497 unsigned D : 1;
2498 unsigned : 1;
2499 unsigned : 1;
2502 struct
2504 unsigned : 1;
2505 unsigned : 1;
2506 unsigned R_W : 1;
2507 unsigned : 1;
2508 unsigned : 1;
2509 unsigned D_A : 1;
2510 unsigned : 1;
2511 unsigned : 1;
2514 struct
2516 unsigned : 1;
2517 unsigned : 1;
2518 unsigned NOT_W : 1;
2519 unsigned : 1;
2520 unsigned : 1;
2521 unsigned NOT_A : 1;
2522 unsigned : 1;
2523 unsigned : 1;
2526 struct
2528 unsigned : 1;
2529 unsigned : 1;
2530 unsigned NOT_WRITE : 1;
2531 unsigned : 1;
2532 unsigned : 1;
2533 unsigned NOT_ADDRESS : 1;
2534 unsigned : 1;
2535 unsigned : 1;
2538 struct
2540 unsigned : 1;
2541 unsigned : 1;
2542 unsigned READ_WRITE : 1;
2543 unsigned : 1;
2544 unsigned : 1;
2545 unsigned DATA_ADDRESS : 1;
2546 unsigned : 1;
2547 unsigned : 1;
2550 struct
2552 unsigned : 1;
2553 unsigned : 1;
2554 unsigned I2C_READ : 1;
2555 unsigned : 1;
2556 unsigned : 1;
2557 unsigned I2C_DAT : 1;
2558 unsigned : 1;
2559 unsigned : 1;
2561 } __SSP2STATbits_t;
2563 extern __at(0x0F68) volatile __SSP2STATbits_t SSP2STATbits;
2565 #define _SSP2STAT_BF 0x01
2566 #define _SSP2STAT_UA 0x02
2567 #define _SSP2STAT_R_NOT_W 0x04
2568 #define _SSP2STAT_R 0x04
2569 #define _SSP2STAT_R_W 0x04
2570 #define _SSP2STAT_NOT_W 0x04
2571 #define _SSP2STAT_NOT_WRITE 0x04
2572 #define _SSP2STAT_READ_WRITE 0x04
2573 #define _SSP2STAT_I2C_READ 0x04
2574 #define _SSP2STAT_S 0x08
2575 #define _SSP2STAT_I2C_START 0x08
2576 #define _SSP2STAT_P 0x10
2577 #define _SSP2STAT_I2C_STOP 0x10
2578 #define _SSP2STAT_D_NOT_A 0x20
2579 #define _SSP2STAT_D 0x20
2580 #define _SSP2STAT_D_A 0x20
2581 #define _SSP2STAT_NOT_A 0x20
2582 #define _SSP2STAT_NOT_ADDRESS 0x20
2583 #define _SSP2STAT_DATA_ADDRESS 0x20
2584 #define _SSP2STAT_I2C_DAT 0x20
2585 #define _SSP2STAT_CKE 0x40
2586 #define _SSP2STAT_SMP 0x80
2588 //==============================================================================
2590 extern __at(0x0F69) __sfr SSP2ADD;
2592 //==============================================================================
2593 // SSP2MSK Bits
2595 extern __at(0x0F69) __sfr SSP2MSK;
2597 typedef struct
2599 unsigned MSK0 : 1;
2600 unsigned MSK1 : 1;
2601 unsigned MSK2 : 1;
2602 unsigned MSK3 : 1;
2603 unsigned MSK4 : 1;
2604 unsigned MSK5 : 1;
2605 unsigned MSK6 : 1;
2606 unsigned MSK7 : 1;
2607 } __SSP2MSKbits_t;
2609 extern __at(0x0F69) volatile __SSP2MSKbits_t SSP2MSKbits;
2611 #define _SSP2MSK_MSK0 0x01
2612 #define _SSP2MSK_MSK1 0x02
2613 #define _SSP2MSK_MSK2 0x04
2614 #define _SSP2MSK_MSK3 0x08
2615 #define _SSP2MSK_MSK4 0x10
2616 #define _SSP2MSK_MSK5 0x20
2617 #define _SSP2MSK_MSK6 0x40
2618 #define _SSP2MSK_MSK7 0x80
2620 //==============================================================================
2622 extern __at(0x0F6A) __sfr SSP2BUF;
2624 //==============================================================================
2625 // T4CON Bits
2627 extern __at(0x0F6B) __sfr T4CON;
2629 typedef union
2631 struct
2633 unsigned T4CKPS0 : 1;
2634 unsigned T4CKPS1 : 1;
2635 unsigned TMR4ON : 1;
2636 unsigned T4OUTPS0 : 1;
2637 unsigned T4OUTPS1 : 1;
2638 unsigned T4OUTPS2 : 1;
2639 unsigned T4OUTPS3 : 1;
2640 unsigned : 1;
2643 struct
2645 unsigned T4CKPS : 2;
2646 unsigned : 6;
2649 struct
2651 unsigned : 3;
2652 unsigned T4OUTPS : 4;
2653 unsigned : 1;
2655 } __T4CONbits_t;
2657 extern __at(0x0F6B) volatile __T4CONbits_t T4CONbits;
2659 #define _T4CKPS0 0x01
2660 #define _T4CKPS1 0x02
2661 #define _TMR4ON 0x04
2662 #define _T4OUTPS0 0x08
2663 #define _T4OUTPS1 0x10
2664 #define _T4OUTPS2 0x20
2665 #define _T4OUTPS3 0x40
2667 //==============================================================================
2669 extern __at(0x0F6C) __sfr PR4;
2670 extern __at(0x0F6D) __sfr TMR4;
2672 //==============================================================================
2673 // CCP7CON Bits
2675 extern __at(0x0F6E) __sfr CCP7CON;
2677 typedef union
2679 struct
2681 unsigned CCP7M0 : 1;
2682 unsigned CCP7M1 : 1;
2683 unsigned CCP7M2 : 1;
2684 unsigned CCP7M3 : 1;
2685 unsigned DC7B0 : 1;
2686 unsigned DC7B1 : 1;
2687 unsigned : 1;
2688 unsigned : 1;
2691 struct
2693 unsigned : 1;
2694 unsigned : 1;
2695 unsigned : 1;
2696 unsigned : 1;
2697 unsigned CCP7Y : 1;
2698 unsigned CCP7X : 1;
2699 unsigned : 1;
2700 unsigned : 1;
2703 struct
2705 unsigned CCP7M : 4;
2706 unsigned : 4;
2709 struct
2711 unsigned : 4;
2712 unsigned DC7B : 2;
2713 unsigned : 2;
2715 } __CCP7CONbits_t;
2717 extern __at(0x0F6E) volatile __CCP7CONbits_t CCP7CONbits;
2719 #define _CCP7M0 0x01
2720 #define _CCP7M1 0x02
2721 #define _CCP7M2 0x04
2722 #define _CCP7M3 0x08
2723 #define _DC7B0 0x10
2724 #define _CCP7Y 0x10
2725 #define _DC7B1 0x20
2726 #define _CCP7X 0x20
2728 //==============================================================================
2730 extern __at(0x0F6F) __sfr CCPR7;
2731 extern __at(0x0F6F) __sfr CCPR7L;
2732 extern __at(0x0F70) __sfr CCPR7H;
2734 //==============================================================================
2735 // CCP6CON Bits
2737 extern __at(0x0F71) __sfr CCP6CON;
2739 typedef union
2741 struct
2743 unsigned CCP6M0 : 1;
2744 unsigned CCP6M1 : 1;
2745 unsigned CCP6M2 : 1;
2746 unsigned CCP6M3 : 1;
2747 unsigned DC6B0 : 1;
2748 unsigned DC6B1 : 1;
2749 unsigned : 1;
2750 unsigned : 1;
2753 struct
2755 unsigned : 1;
2756 unsigned : 1;
2757 unsigned : 1;
2758 unsigned : 1;
2759 unsigned CCP6Y : 1;
2760 unsigned CCP6X : 1;
2761 unsigned : 1;
2762 unsigned : 1;
2765 struct
2767 unsigned CCP6M : 4;
2768 unsigned : 4;
2771 struct
2773 unsigned : 4;
2774 unsigned DC6B : 2;
2775 unsigned : 2;
2777 } __CCP6CONbits_t;
2779 extern __at(0x0F71) volatile __CCP6CONbits_t CCP6CONbits;
2781 #define _CCP6M0 0x01
2782 #define _CCP6M1 0x02
2783 #define _CCP6M2 0x04
2784 #define _CCP6M3 0x08
2785 #define _DC6B0 0x10
2786 #define _CCP6Y 0x10
2787 #define _DC6B1 0x20
2788 #define _CCP6X 0x20
2790 //==============================================================================
2792 extern __at(0x0F72) __sfr CCPR6;
2793 extern __at(0x0F72) __sfr CCPR6L;
2794 extern __at(0x0F73) __sfr CCPR6H;
2796 //==============================================================================
2797 // CCP5CON Bits
2799 extern __at(0x0F74) __sfr CCP5CON;
2801 typedef union
2803 struct
2805 unsigned CCP5M0 : 1;
2806 unsigned CCP5M1 : 1;
2807 unsigned CCP5M2 : 1;
2808 unsigned CCP5M3 : 1;
2809 unsigned DC5B0 : 1;
2810 unsigned DC5B1 : 1;
2811 unsigned : 1;
2812 unsigned : 1;
2815 struct
2817 unsigned : 1;
2818 unsigned : 1;
2819 unsigned : 1;
2820 unsigned : 1;
2821 unsigned CCP5Y : 1;
2822 unsigned CCP5X : 1;
2823 unsigned : 1;
2824 unsigned : 1;
2827 struct
2829 unsigned CCP5M : 4;
2830 unsigned : 4;
2833 struct
2835 unsigned : 4;
2836 unsigned DC5B : 2;
2837 unsigned : 2;
2839 } __CCP5CONbits_t;
2841 extern __at(0x0F74) volatile __CCP5CONbits_t CCP5CONbits;
2843 #define _CCP5M0 0x01
2844 #define _CCP5M1 0x02
2845 #define _CCP5M2 0x04
2846 #define _CCP5M3 0x08
2847 #define _DC5B0 0x10
2848 #define _CCP5Y 0x10
2849 #define _DC5B1 0x20
2850 #define _CCP5X 0x20
2852 //==============================================================================
2854 extern __at(0x0F75) __sfr CCPR5;
2855 extern __at(0x0F75) __sfr CCPR5L;
2856 extern __at(0x0F76) __sfr CCPR5H;
2858 //==============================================================================
2859 // CCP4CON Bits
2861 extern __at(0x0F77) __sfr CCP4CON;
2863 typedef union
2865 struct
2867 unsigned CCP4M0 : 1;
2868 unsigned CCP4M1 : 1;
2869 unsigned CCP4M2 : 1;
2870 unsigned CCP4M3 : 1;
2871 unsigned DC4B0 : 1;
2872 unsigned DC4B1 : 1;
2873 unsigned : 1;
2874 unsigned : 1;
2877 struct
2879 unsigned : 1;
2880 unsigned : 1;
2881 unsigned : 1;
2882 unsigned : 1;
2883 unsigned CCP4Y : 1;
2884 unsigned CCP4X : 1;
2885 unsigned : 1;
2886 unsigned : 1;
2889 struct
2891 unsigned CCP4M : 4;
2892 unsigned : 4;
2895 struct
2897 unsigned : 4;
2898 unsigned DC4B : 2;
2899 unsigned : 2;
2901 } __CCP4CONbits_t;
2903 extern __at(0x0F77) volatile __CCP4CONbits_t CCP4CONbits;
2905 #define _CCP4M0 0x01
2906 #define _CCP4M1 0x02
2907 #define _CCP4M2 0x04
2908 #define _CCP4M3 0x08
2909 #define _DC4B0 0x10
2910 #define _CCP4Y 0x10
2911 #define _DC4B1 0x20
2912 #define _CCP4X 0x20
2914 //==============================================================================
2916 extern __at(0x0F78) __sfr CCPR4;
2917 extern __at(0x0F78) __sfr CCPR4L;
2918 extern __at(0x0F79) __sfr CCPR4H;
2920 //==============================================================================
2921 // T5GCON Bits
2923 extern __at(0x0F7A) __sfr T5GCON;
2925 typedef union
2927 struct
2929 unsigned T5GSS0 : 1;
2930 unsigned T5GSS1 : 1;
2931 unsigned T5GVAL : 1;
2932 unsigned T5GGO_NOT_T5DONE : 1;
2933 unsigned T5GSPM : 1;
2934 unsigned T5GTM : 1;
2935 unsigned T5GPOL : 1;
2936 unsigned TMR5GE : 1;
2939 struct
2941 unsigned : 1;
2942 unsigned : 1;
2943 unsigned : 1;
2944 unsigned T5GGO : 1;
2945 unsigned : 1;
2946 unsigned : 1;
2947 unsigned : 1;
2948 unsigned : 1;
2951 struct
2953 unsigned : 1;
2954 unsigned : 1;
2955 unsigned : 1;
2956 unsigned NOT_T5DONE : 1;
2957 unsigned : 1;
2958 unsigned : 1;
2959 unsigned : 1;
2960 unsigned : 1;
2963 struct
2965 unsigned T5GSS : 2;
2966 unsigned : 6;
2968 } __T5GCONbits_t;
2970 extern __at(0x0F7A) volatile __T5GCONbits_t T5GCONbits;
2972 #define _T5GSS0 0x01
2973 #define _T5GSS1 0x02
2974 #define _T5GVAL 0x04
2975 #define _T5GGO_NOT_T5DONE 0x08
2976 #define _T5GGO 0x08
2977 #define _NOT_T5DONE 0x08
2978 #define _T5GSPM 0x10
2979 #define _T5GTM 0x20
2980 #define _T5GPOL 0x40
2981 #define _TMR5GE 0x80
2983 //==============================================================================
2986 //==============================================================================
2987 // T5CON Bits
2989 extern __at(0x0F7B) __sfr T5CON;
2991 typedef union
2993 struct
2995 unsigned TMR5ON : 1;
2996 unsigned RD16 : 1;
2997 unsigned NOT_T5SYNC : 1;
2998 unsigned SOSCEN : 1;
2999 unsigned T5CKPS0 : 1;
3000 unsigned T5CKPS1 : 1;
3001 unsigned TMR5CS0 : 1;
3002 unsigned TMR5CS1 : 1;
3005 struct
3007 unsigned : 4;
3008 unsigned T5CKPS : 2;
3009 unsigned : 2;
3012 struct
3014 unsigned : 6;
3015 unsigned TMR5CS : 2;
3017 } __T5CONbits_t;
3019 extern __at(0x0F7B) volatile __T5CONbits_t T5CONbits;
3021 #define _T5CON_TMR5ON 0x01
3022 #define _T5CON_RD16 0x02
3023 #define _T5CON_NOT_T5SYNC 0x04
3024 #define _T5CON_SOSCEN 0x08
3025 #define _T5CON_T5CKPS0 0x10
3026 #define _T5CON_T5CKPS1 0x20
3027 #define _T5CON_TMR5CS0 0x40
3028 #define _T5CON_TMR5CS1 0x80
3030 //==============================================================================
3032 extern __at(0x0F7C) __sfr TMR5;
3033 extern __at(0x0F7C) __sfr TMR5L;
3034 extern __at(0x0F7D) __sfr TMR5H;
3035 extern __at(0x0F7E) __sfr EECON2;
3037 //==============================================================================
3038 // EECON1 Bits
3040 extern __at(0x0F7F) __sfr EECON1;
3042 typedef struct
3044 unsigned RD : 1;
3045 unsigned WR : 1;
3046 unsigned WREN : 1;
3047 unsigned WRERR : 1;
3048 unsigned FREE : 1;
3049 unsigned : 1;
3050 unsigned CFGS : 1;
3051 unsigned EEPGD : 1;
3052 } __EECON1bits_t;
3054 extern __at(0x0F7F) volatile __EECON1bits_t EECON1bits;
3056 #define _RD 0x01
3057 #define _WR 0x02
3058 #define _WREN 0x04
3059 #define _WRERR 0x08
3060 #define _FREE 0x10
3061 #define _CFGS 0x40
3062 #define _EEPGD 0x80
3064 //==============================================================================
3067 //==============================================================================
3068 // PORTA Bits
3070 extern __at(0x0F80) __sfr PORTA;
3072 typedef union
3074 struct
3076 unsigned RA0 : 1;
3077 unsigned RA1 : 1;
3078 unsigned RA2 : 1;
3079 unsigned RA3 : 1;
3080 unsigned RA4 : 1;
3081 unsigned RA5 : 1;
3082 unsigned RA6 : 1;
3083 unsigned RA7 : 1;
3086 struct
3088 unsigned AN0 : 1;
3089 unsigned AN1 : 1;
3090 unsigned AN2 : 1;
3091 unsigned AN3 : 1;
3092 unsigned T0CKI : 1;
3093 unsigned AN4 : 1;
3094 unsigned OSC2 : 1;
3095 unsigned OSC1 : 1;
3098 struct
3100 unsigned ULPWU : 1;
3101 unsigned : 1;
3102 unsigned VREF_MINUS : 1;
3103 unsigned VREF_PLUS : 1;
3104 unsigned : 1;
3105 unsigned T1CKI : 1;
3106 unsigned CLKO : 1;
3107 unsigned CLKI : 1;
3110 struct
3112 unsigned : 1;
3113 unsigned : 1;
3114 unsigned : 1;
3115 unsigned : 1;
3116 unsigned : 1;
3117 unsigned T3G : 1;
3118 unsigned : 1;
3119 unsigned : 1;
3122 struct
3124 unsigned : 1;
3125 unsigned : 1;
3126 unsigned : 1;
3127 unsigned : 1;
3128 unsigned : 1;
3129 unsigned HLVDIN : 1;
3130 unsigned : 1;
3131 unsigned : 1;
3133 } __PORTAbits_t;
3135 extern __at(0x0F80) volatile __PORTAbits_t PORTAbits;
3137 #define _RA0 0x01
3138 #define _AN0 0x01
3139 #define _ULPWU 0x01
3140 #define _RA1 0x02
3141 #define _AN1 0x02
3142 #define _RA2 0x04
3143 #define _AN2 0x04
3144 #define _VREF_MINUS 0x04
3145 #define _RA3 0x08
3146 #define _AN3 0x08
3147 #define _VREF_PLUS 0x08
3148 #define _RA4 0x10
3149 #define _T0CKI 0x10
3150 #define _RA5 0x20
3151 #define _AN4 0x20
3152 #define _T1CKI 0x20
3153 #define _T3G 0x20
3154 #define _HLVDIN 0x20
3155 #define _RA6 0x40
3156 #define _OSC2 0x40
3157 #define _CLKO 0x40
3158 #define _RA7 0x80
3159 #define _OSC1 0x80
3160 #define _CLKI 0x80
3162 //==============================================================================
3165 //==============================================================================
3166 // PORTB Bits
3168 extern __at(0x0F81) __sfr PORTB;
3170 typedef union
3172 struct
3174 unsigned RB0 : 1;
3175 unsigned RB1 : 1;
3176 unsigned RB2 : 1;
3177 unsigned RB3 : 1;
3178 unsigned RB4 : 1;
3179 unsigned RB5 : 1;
3180 unsigned RB6 : 1;
3181 unsigned RB7 : 1;
3184 struct
3186 unsigned INT0 : 1;
3187 unsigned INT1 : 1;
3188 unsigned INT2 : 1;
3189 unsigned INT3 : 1;
3190 unsigned KBI0 : 1;
3191 unsigned KBI1 : 1;
3192 unsigned KBI2 : 1;
3193 unsigned KBI3 : 1;
3196 struct
3198 unsigned FLT0 : 1;
3199 unsigned : 1;
3200 unsigned CTED1 : 1;
3201 unsigned CTED2 : 1;
3202 unsigned : 1;
3203 unsigned T3CKI : 1;
3204 unsigned PGC : 1;
3205 unsigned PGD : 1;
3208 struct
3210 unsigned : 1;
3211 unsigned : 1;
3212 unsigned : 1;
3213 unsigned CCP2_P2A : 1;
3214 unsigned : 1;
3215 unsigned T1G : 1;
3216 unsigned : 1;
3217 unsigned : 1;
3220 struct
3222 unsigned : 1;
3223 unsigned : 1;
3224 unsigned : 1;
3225 unsigned : 1;
3226 unsigned : 1;
3227 unsigned PGM : 1;
3228 unsigned : 1;
3229 unsigned : 1;
3232 struct
3234 unsigned INT : 4;
3235 unsigned : 4;
3238 struct
3240 unsigned : 4;
3241 unsigned KBI : 4;
3243 } __PORTBbits_t;
3245 extern __at(0x0F81) volatile __PORTBbits_t PORTBbits;
3247 #define _RB0 0x01
3248 #define _INT0 0x01
3249 #define _FLT0 0x01
3250 #define _RB1 0x02
3251 #define _INT1 0x02
3252 #define _RB2 0x04
3253 #define _INT2 0x04
3254 #define _CTED1 0x04
3255 #define _RB3 0x08
3256 #define _INT3 0x08
3257 #define _CTED2 0x08
3258 #define _CCP2_P2A 0x08
3259 #define _RB4 0x10
3260 #define _KBI0 0x10
3261 #define _RB5 0x20
3262 #define _KBI1 0x20
3263 #define _T3CKI 0x20
3264 #define _T1G 0x20
3265 #define _PGM 0x20
3266 #define _RB6 0x40
3267 #define _KBI2 0x40
3268 #define _PGC 0x40
3269 #define _RB7 0x80
3270 #define _KBI3 0x80
3271 #define _PGD 0x80
3273 //==============================================================================
3276 //==============================================================================
3277 // PORTC Bits
3279 extern __at(0x0F82) __sfr PORTC;
3281 typedef union
3283 struct
3285 unsigned RC0 : 1;
3286 unsigned RC1 : 1;
3287 unsigned RC2 : 1;
3288 unsigned RC3 : 1;
3289 unsigned RC4 : 1;
3290 unsigned RC5 : 1;
3291 unsigned RC6 : 1;
3292 unsigned RC7 : 1;
3295 struct
3297 unsigned SOSCO : 1;
3298 unsigned SOSCI : 1;
3299 unsigned CCP1 : 1;
3300 unsigned SCK1 : 1;
3301 unsigned SDI1 : 1;
3302 unsigned SDO1 : 1;
3303 unsigned TX1 : 1;
3304 unsigned RX1 : 1;
3307 struct
3309 unsigned SCKLI : 1;
3310 unsigned CCP2 : 1;
3311 unsigned P1A : 1;
3312 unsigned SCL1 : 1;
3313 unsigned SDA1 : 1;
3314 unsigned : 1;
3315 unsigned CK1 : 1;
3316 unsigned DT1 : 1;
3319 struct
3321 unsigned : 1;
3322 unsigned P2A : 1;
3323 unsigned : 1;
3324 unsigned : 1;
3325 unsigned : 1;
3326 unsigned : 1;
3327 unsigned : 1;
3328 unsigned : 1;
3330 } __PORTCbits_t;
3332 extern __at(0x0F82) volatile __PORTCbits_t PORTCbits;
3334 #define _RC0 0x01
3335 #define _SOSCO 0x01
3336 #define _SCKLI 0x01
3337 #define _RC1 0x02
3338 #define _SOSCI 0x02
3339 #define _CCP2 0x02
3340 #define _P2A 0x02
3341 #define _RC2 0x04
3342 #define _CCP1 0x04
3343 #define _P1A 0x04
3344 #define _RC3 0x08
3345 #define _SCK1 0x08
3346 #define _SCL1 0x08
3347 #define _RC4 0x10
3348 #define _SDI1 0x10
3349 #define _SDA1 0x10
3350 #define _RC5 0x20
3351 #define _SDO1 0x20
3352 #define _RC6 0x40
3353 #define _TX1 0x40
3354 #define _CK1 0x40
3355 #define _RC7 0x80
3356 #define _RX1 0x80
3357 #define _DT1 0x80
3359 //==============================================================================
3362 //==============================================================================
3363 // PORTD Bits
3365 extern __at(0x0F83) __sfr PORTD;
3367 typedef union
3369 struct
3371 unsigned RD0 : 1;
3372 unsigned RD1 : 1;
3373 unsigned RD2 : 1;
3374 unsigned RD3 : 1;
3375 unsigned RD4 : 1;
3376 unsigned RD5 : 1;
3377 unsigned RD6 : 1;
3378 unsigned RD7 : 1;
3381 struct
3383 unsigned AD0 : 1;
3384 unsigned AD1 : 1;
3385 unsigned AD2 : 1;
3386 unsigned AD3 : 1;
3387 unsigned AD4 : 1;
3388 unsigned AD5 : 1;
3389 unsigned AD6 : 1;
3390 unsigned AD7 : 1;
3393 struct
3395 unsigned PSP0 : 1;
3396 unsigned PSP1 : 1;
3397 unsigned PSP2 : 1;
3398 unsigned PSP3 : 1;
3399 unsigned PSP4 : 1;
3400 unsigned PSP5 : 1;
3401 unsigned PSP6 : 1;
3402 unsigned PSP7 : 1;
3405 struct
3407 unsigned CTPLS : 1;
3408 unsigned T5CKI : 1;
3409 unsigned : 1;
3410 unsigned : 1;
3411 unsigned SDO2 : 1;
3412 unsigned SDI2 : 1;
3413 unsigned SCK2 : 1;
3414 unsigned NOT_SS2 : 1;
3417 struct
3419 unsigned : 1;
3420 unsigned T7G : 1;
3421 unsigned : 1;
3422 unsigned : 1;
3423 unsigned : 1;
3424 unsigned SDA2 : 1;
3425 unsigned SCL2 : 1;
3426 unsigned : 1;
3428 } __PORTDbits_t;
3430 extern __at(0x0F83) volatile __PORTDbits_t PORTDbits;
3432 #define _RD0 0x01
3433 #define _AD0 0x01
3434 #define _PSP0 0x01
3435 #define _CTPLS 0x01
3436 #define _RD1 0x02
3437 #define _AD1 0x02
3438 #define _PSP1 0x02
3439 #define _T5CKI 0x02
3440 #define _T7G 0x02
3441 #define _RD2 0x04
3442 #define _AD2 0x04
3443 #define _PSP2 0x04
3444 #define _RD3 0x08
3445 #define _AD3 0x08
3446 #define _PSP3 0x08
3447 #define _RD4 0x10
3448 #define _AD4 0x10
3449 #define _PSP4 0x10
3450 #define _SDO2 0x10
3451 #define _RD5 0x20
3452 #define _AD5 0x20
3453 #define _PSP5 0x20
3454 #define _SDI2 0x20
3455 #define _SDA2 0x20
3456 #define _RD6 0x40
3457 #define _AD6 0x40
3458 #define _PSP6 0x40
3459 #define _SCK2 0x40
3460 #define _SCL2 0x40
3461 #define _RD7 0x80
3462 #define _AD7 0x80
3463 #define _PSP7 0x80
3464 #define _NOT_SS2 0x80
3466 //==============================================================================
3469 //==============================================================================
3470 // PORTE Bits
3472 extern __at(0x0F84) __sfr PORTE;
3474 typedef union
3476 struct
3478 unsigned RE0 : 1;
3479 unsigned RE1 : 1;
3480 unsigned RE2 : 1;
3481 unsigned RE3 : 1;
3482 unsigned RE4 : 1;
3483 unsigned RE5 : 1;
3484 unsigned RE6 : 1;
3485 unsigned RE7 : 1;
3488 struct
3490 unsigned AD8 : 1;
3491 unsigned AD9 : 1;
3492 unsigned AD10 : 1;
3493 unsigned AD11 : 1;
3494 unsigned AD12 : 1;
3495 unsigned AD13 : 1;
3496 unsigned AD14 : 1;
3497 unsigned AD15 : 1;
3500 struct
3502 unsigned P2D : 1;
3503 unsigned P2C : 1;
3504 unsigned P2B : 1;
3505 unsigned P3C : 1;
3506 unsigned P3B : 1;
3507 unsigned P1C : 1;
3508 unsigned P1B : 1;
3509 unsigned P2A : 1;
3512 struct
3514 unsigned NOT_RD : 1;
3515 unsigned NOT_WR : 1;
3516 unsigned CCP10 : 1;
3517 unsigned CCP9 : 1;
3518 unsigned CCP8 : 1;
3519 unsigned CCP7 : 1;
3520 unsigned CCP6 : 1;
3521 unsigned CCP2 : 1;
3524 struct
3526 unsigned : 1;
3527 unsigned : 1;
3528 unsigned NOT_CS : 1;
3529 unsigned REFO : 1;
3530 unsigned : 1;
3531 unsigned : 1;
3532 unsigned : 1;
3533 unsigned : 1;
3535 } __PORTEbits_t;
3537 extern __at(0x0F84) volatile __PORTEbits_t PORTEbits;
3539 #define _PORTE_RE0 0x01
3540 #define _PORTE_AD8 0x01
3541 #define _PORTE_P2D 0x01
3542 #define _PORTE_NOT_RD 0x01
3543 #define _PORTE_RE1 0x02
3544 #define _PORTE_AD9 0x02
3545 #define _PORTE_P2C 0x02
3546 #define _PORTE_NOT_WR 0x02
3547 #define _PORTE_RE2 0x04
3548 #define _PORTE_AD10 0x04
3549 #define _PORTE_P2B 0x04
3550 #define _PORTE_CCP10 0x04
3551 #define _PORTE_NOT_CS 0x04
3552 #define _PORTE_RE3 0x08
3553 #define _PORTE_AD11 0x08
3554 #define _PORTE_P3C 0x08
3555 #define _PORTE_CCP9 0x08
3556 #define _PORTE_REFO 0x08
3557 #define _PORTE_RE4 0x10
3558 #define _PORTE_AD12 0x10
3559 #define _PORTE_P3B 0x10
3560 #define _PORTE_CCP8 0x10
3561 #define _PORTE_RE5 0x20
3562 #define _PORTE_AD13 0x20
3563 #define _PORTE_P1C 0x20
3564 #define _PORTE_CCP7 0x20
3565 #define _PORTE_RE6 0x40
3566 #define _PORTE_AD14 0x40
3567 #define _PORTE_P1B 0x40
3568 #define _PORTE_CCP6 0x40
3569 #define _PORTE_RE7 0x80
3570 #define _PORTE_AD15 0x80
3571 #define _PORTE_P2A 0x80
3572 #define _PORTE_CCP2 0x80
3574 //==============================================================================
3577 //==============================================================================
3578 // PORTF Bits
3580 extern __at(0x0F85) __sfr PORTF;
3582 typedef union
3584 struct
3586 unsigned : 1;
3587 unsigned RF1 : 1;
3588 unsigned RF2 : 1;
3589 unsigned RF3 : 1;
3590 unsigned RF4 : 1;
3591 unsigned RF5 : 1;
3592 unsigned RF6 : 1;
3593 unsigned RF7 : 1;
3596 struct
3598 unsigned : 1;
3599 unsigned AN6 : 1;
3600 unsigned AN7 : 1;
3601 unsigned AN8 : 1;
3602 unsigned AN9 : 1;
3603 unsigned AN10 : 1;
3604 unsigned AN11 : 1;
3605 unsigned AN5 : 1;
3608 struct
3610 unsigned : 1;
3611 unsigned C2OUT : 1;
3612 unsigned C1OUT : 1;
3613 unsigned C2INB : 1;
3614 unsigned C2INA : 1;
3615 unsigned C1INB : 1;
3616 unsigned C1INA : 1;
3617 unsigned SS1 : 1;
3620 struct
3622 unsigned : 1;
3623 unsigned CTDIN : 1;
3624 unsigned : 1;
3625 unsigned CTMUI : 1;
3626 unsigned : 1;
3627 unsigned CVREF : 1;
3628 unsigned : 1;
3629 unsigned : 1;
3631 } __PORTFbits_t;
3633 extern __at(0x0F85) volatile __PORTFbits_t PORTFbits;
3635 #define _RF1 0x02
3636 #define _AN6 0x02
3637 #define _C2OUT 0x02
3638 #define _CTDIN 0x02
3639 #define _RF2 0x04
3640 #define _AN7 0x04
3641 #define _C1OUT 0x04
3642 #define _RF3 0x08
3643 #define _AN8 0x08
3644 #define _C2INB 0x08
3645 #define _CTMUI 0x08
3646 #define _RF4 0x10
3647 #define _AN9 0x10
3648 #define _C2INA 0x10
3649 #define _RF5 0x20
3650 #define _AN10 0x20
3651 #define _C1INB 0x20
3652 #define _CVREF 0x20
3653 #define _RF6 0x40
3654 #define _AN11 0x40
3655 #define _C1INA 0x40
3656 #define _RF7 0x80
3657 #define _AN5 0x80
3658 #define _SS1 0x80
3660 //==============================================================================
3663 //==============================================================================
3664 // PORTG Bits
3666 extern __at(0x0F86) __sfr PORTG;
3668 typedef union
3670 struct
3672 unsigned RG0 : 1;
3673 unsigned RG1 : 1;
3674 unsigned RG2 : 1;
3675 unsigned RG3 : 1;
3676 unsigned RG4 : 1;
3677 unsigned RG5 : 1;
3678 unsigned : 1;
3679 unsigned : 1;
3682 struct
3684 unsigned CCP3 : 1;
3685 unsigned C3OUT : 1;
3686 unsigned C3INA : 1;
3687 unsigned C3INB : 1;
3688 unsigned C3INC : 1;
3689 unsigned : 1;
3690 unsigned : 1;
3691 unsigned : 1;
3694 struct
3696 unsigned PA3 : 1;
3697 unsigned TX2 : 1;
3698 unsigned RX2 : 1;
3699 unsigned PD3 : 1;
3700 unsigned PD1 : 1;
3701 unsigned : 1;
3702 unsigned : 1;
3703 unsigned : 1;
3706 struct
3708 unsigned : 1;
3709 unsigned AN19 : 1;
3710 unsigned AN18 : 1;
3711 unsigned AN17 : 1;
3712 unsigned AN16 : 1;
3713 unsigned : 1;
3714 unsigned : 1;
3715 unsigned : 1;
3718 struct
3720 unsigned : 1;
3721 unsigned CK2 : 1;
3722 unsigned DT2 : 1;
3723 unsigned CCP4 : 1;
3724 unsigned CCP5 : 1;
3725 unsigned : 1;
3726 unsigned : 1;
3727 unsigned : 1;
3730 struct
3732 unsigned : 1;
3733 unsigned : 1;
3734 unsigned : 1;
3735 unsigned : 1;
3736 unsigned T7CKI : 1;
3737 unsigned : 1;
3738 unsigned : 1;
3739 unsigned : 1;
3742 struct
3744 unsigned : 1;
3745 unsigned : 1;
3746 unsigned : 1;
3747 unsigned : 1;
3748 unsigned T5G : 1;
3749 unsigned : 1;
3750 unsigned : 1;
3751 unsigned : 1;
3754 struct
3756 unsigned : 1;
3757 unsigned : 1;
3758 unsigned : 1;
3759 unsigned : 1;
3760 unsigned RTCC : 1;
3761 unsigned : 1;
3762 unsigned : 1;
3763 unsigned : 1;
3766 struct
3768 unsigned RG : 6;
3769 unsigned : 2;
3771 } __PORTGbits_t;
3773 extern __at(0x0F86) volatile __PORTGbits_t PORTGbits;
3775 #define _RG0 0x01
3776 #define _CCP3 0x01
3777 #define _PA3 0x01
3778 #define _RG1 0x02
3779 #define _C3OUT 0x02
3780 #define _TX2 0x02
3781 #define _AN19 0x02
3782 #define _CK2 0x02
3783 #define _RG2 0x04
3784 #define _C3INA 0x04
3785 #define _RX2 0x04
3786 #define _AN18 0x04
3787 #define _DT2 0x04
3788 #define _RG3 0x08
3789 #define _C3INB 0x08
3790 #define _PD3 0x08
3791 #define _AN17 0x08
3792 #define _CCP4 0x08
3793 #define _RG4 0x10
3794 #define _C3INC 0x10
3795 #define _PD1 0x10
3796 #define _AN16 0x10
3797 #define _CCP5 0x10
3798 #define _T7CKI 0x10
3799 #define _T5G 0x10
3800 #define _RTCC 0x10
3801 #define _RG5 0x20
3803 //==============================================================================
3806 //==============================================================================
3807 // LATA Bits
3809 extern __at(0x0F89) __sfr LATA;
3811 typedef struct
3813 unsigned LATA0 : 1;
3814 unsigned LATA1 : 1;
3815 unsigned LATA2 : 1;
3816 unsigned LATA3 : 1;
3817 unsigned LATA4 : 1;
3818 unsigned LATA5 : 1;
3819 unsigned LATA6 : 1;
3820 unsigned LATA7 : 1;
3821 } __LATAbits_t;
3823 extern __at(0x0F89) volatile __LATAbits_t LATAbits;
3825 #define _LATA0 0x01
3826 #define _LATA1 0x02
3827 #define _LATA2 0x04
3828 #define _LATA3 0x08
3829 #define _LATA4 0x10
3830 #define _LATA5 0x20
3831 #define _LATA6 0x40
3832 #define _LATA7 0x80
3834 //==============================================================================
3837 //==============================================================================
3838 // LATB Bits
3840 extern __at(0x0F8A) __sfr LATB;
3842 typedef struct
3844 unsigned LATB0 : 1;
3845 unsigned LATB1 : 1;
3846 unsigned LATB2 : 1;
3847 unsigned LATB3 : 1;
3848 unsigned LATB4 : 1;
3849 unsigned LATB5 : 1;
3850 unsigned LATB6 : 1;
3851 unsigned LATB7 : 1;
3852 } __LATBbits_t;
3854 extern __at(0x0F8A) volatile __LATBbits_t LATBbits;
3856 #define _LATB0 0x01
3857 #define _LATB1 0x02
3858 #define _LATB2 0x04
3859 #define _LATB3 0x08
3860 #define _LATB4 0x10
3861 #define _LATB5 0x20
3862 #define _LATB6 0x40
3863 #define _LATB7 0x80
3865 //==============================================================================
3868 //==============================================================================
3869 // LATC Bits
3871 extern __at(0x0F8B) __sfr LATC;
3873 typedef struct
3875 unsigned LATC0 : 1;
3876 unsigned LATC1 : 1;
3877 unsigned LATC2 : 1;
3878 unsigned LATC3 : 1;
3879 unsigned LATC4 : 1;
3880 unsigned LATC5 : 1;
3881 unsigned LATC6 : 1;
3882 unsigned LATC7 : 1;
3883 } __LATCbits_t;
3885 extern __at(0x0F8B) volatile __LATCbits_t LATCbits;
3887 #define _LATC0 0x01
3888 #define _LATC1 0x02
3889 #define _LATC2 0x04
3890 #define _LATC3 0x08
3891 #define _LATC4 0x10
3892 #define _LATC5 0x20
3893 #define _LATC6 0x40
3894 #define _LATC7 0x80
3896 //==============================================================================
3899 //==============================================================================
3900 // LATD Bits
3902 extern __at(0x0F8C) __sfr LATD;
3904 typedef struct
3906 unsigned LATD0 : 1;
3907 unsigned LATD1 : 1;
3908 unsigned LATD2 : 1;
3909 unsigned LATD3 : 1;
3910 unsigned LATD4 : 1;
3911 unsigned LATD5 : 1;
3912 unsigned LATD6 : 1;
3913 unsigned LATD7 : 1;
3914 } __LATDbits_t;
3916 extern __at(0x0F8C) volatile __LATDbits_t LATDbits;
3918 #define _LATD0 0x01
3919 #define _LATD1 0x02
3920 #define _LATD2 0x04
3921 #define _LATD3 0x08
3922 #define _LATD4 0x10
3923 #define _LATD5 0x20
3924 #define _LATD6 0x40
3925 #define _LATD7 0x80
3927 //==============================================================================
3930 //==============================================================================
3931 // LATE Bits
3933 extern __at(0x0F8D) __sfr LATE;
3935 typedef struct
3937 unsigned LATE0 : 1;
3938 unsigned LATE1 : 1;
3939 unsigned LATE2 : 1;
3940 unsigned LATE3 : 1;
3941 unsigned LATE4 : 1;
3942 unsigned LATE5 : 1;
3943 unsigned LATE6 : 1;
3944 unsigned LATE7 : 1;
3945 } __LATEbits_t;
3947 extern __at(0x0F8D) volatile __LATEbits_t LATEbits;
3949 #define _LATE0 0x01
3950 #define _LATE1 0x02
3951 #define _LATE2 0x04
3952 #define _LATE3 0x08
3953 #define _LATE4 0x10
3954 #define _LATE5 0x20
3955 #define _LATE6 0x40
3956 #define _LATE7 0x80
3958 //==============================================================================
3961 //==============================================================================
3962 // LATF Bits
3964 extern __at(0x0F8E) __sfr LATF;
3966 typedef struct
3968 unsigned : 1;
3969 unsigned LATF1 : 1;
3970 unsigned LATF2 : 1;
3971 unsigned LATF3 : 1;
3972 unsigned LATF4 : 1;
3973 unsigned LATF5 : 1;
3974 unsigned LATF6 : 1;
3975 unsigned LATF7 : 1;
3976 } __LATFbits_t;
3978 extern __at(0x0F8E) volatile __LATFbits_t LATFbits;
3980 #define _LATF1 0x02
3981 #define _LATF2 0x04
3982 #define _LATF3 0x08
3983 #define _LATF4 0x10
3984 #define _LATF5 0x20
3985 #define _LATF6 0x40
3986 #define _LATF7 0x80
3988 //==============================================================================
3991 //==============================================================================
3992 // LATG Bits
3994 extern __at(0x0F8F) __sfr LATG;
3996 typedef union
3998 struct
4000 unsigned LATG0 : 1;
4001 unsigned LATG1 : 1;
4002 unsigned LATG2 : 1;
4003 unsigned LATG3 : 1;
4004 unsigned LATG4 : 1;
4005 unsigned : 1;
4006 unsigned : 1;
4007 unsigned : 1;
4010 struct
4012 unsigned LATG : 5;
4013 unsigned : 3;
4015 } __LATGbits_t;
4017 extern __at(0x0F8F) volatile __LATGbits_t LATGbits;
4019 #define _LATG0 0x01
4020 #define _LATG1 0x02
4021 #define _LATG2 0x04
4022 #define _LATG3 0x08
4023 #define _LATG4 0x10
4025 //==============================================================================
4028 //==============================================================================
4029 // TRISA Bits
4031 extern __at(0x0F92) __sfr TRISA;
4033 typedef struct
4035 unsigned TRISA0 : 1;
4036 unsigned TRISA1 : 1;
4037 unsigned TRISA2 : 1;
4038 unsigned TRISA3 : 1;
4039 unsigned TRISA4 : 1;
4040 unsigned TRISA5 : 1;
4041 unsigned TRISA6 : 1;
4042 unsigned TRISA7 : 1;
4043 } __TRISAbits_t;
4045 extern __at(0x0F92) volatile __TRISAbits_t TRISAbits;
4047 #define _TRISA0 0x01
4048 #define _TRISA1 0x02
4049 #define _TRISA2 0x04
4050 #define _TRISA3 0x08
4051 #define _TRISA4 0x10
4052 #define _TRISA5 0x20
4053 #define _TRISA6 0x40
4054 #define _TRISA7 0x80
4056 //==============================================================================
4059 //==============================================================================
4060 // TRISB Bits
4062 extern __at(0x0F93) __sfr TRISB;
4064 typedef struct
4066 unsigned TRISB0 : 1;
4067 unsigned TRISB1 : 1;
4068 unsigned TRISB2 : 1;
4069 unsigned TRISB3 : 1;
4070 unsigned TRISB4 : 1;
4071 unsigned TRISB5 : 1;
4072 unsigned TRISB6 : 1;
4073 unsigned TRISB7 : 1;
4074 } __TRISBbits_t;
4076 extern __at(0x0F93) volatile __TRISBbits_t TRISBbits;
4078 #define _TRISB0 0x01
4079 #define _TRISB1 0x02
4080 #define _TRISB2 0x04
4081 #define _TRISB3 0x08
4082 #define _TRISB4 0x10
4083 #define _TRISB5 0x20
4084 #define _TRISB6 0x40
4085 #define _TRISB7 0x80
4087 //==============================================================================
4090 //==============================================================================
4091 // TRISC Bits
4093 extern __at(0x0F94) __sfr TRISC;
4095 typedef struct
4097 unsigned TRISC0 : 1;
4098 unsigned TRISC1 : 1;
4099 unsigned TRISC2 : 1;
4100 unsigned TRISC3 : 1;
4101 unsigned TRISC4 : 1;
4102 unsigned TRISC5 : 1;
4103 unsigned TRISC6 : 1;
4104 unsigned TRISC7 : 1;
4105 } __TRISCbits_t;
4107 extern __at(0x0F94) volatile __TRISCbits_t TRISCbits;
4109 #define _TRISC0 0x01
4110 #define _TRISC1 0x02
4111 #define _TRISC2 0x04
4112 #define _TRISC3 0x08
4113 #define _TRISC4 0x10
4114 #define _TRISC5 0x20
4115 #define _TRISC6 0x40
4116 #define _TRISC7 0x80
4118 //==============================================================================
4121 //==============================================================================
4122 // TRISD Bits
4124 extern __at(0x0F95) __sfr TRISD;
4126 typedef struct
4128 unsigned TRISD0 : 1;
4129 unsigned TRISD1 : 1;
4130 unsigned TRISD2 : 1;
4131 unsigned TRISD3 : 1;
4132 unsigned TRISD4 : 1;
4133 unsigned TRISD5 : 1;
4134 unsigned TRISD6 : 1;
4135 unsigned TRISD7 : 1;
4136 } __TRISDbits_t;
4138 extern __at(0x0F95) volatile __TRISDbits_t TRISDbits;
4140 #define _TRISD0 0x01
4141 #define _TRISD1 0x02
4142 #define _TRISD2 0x04
4143 #define _TRISD3 0x08
4144 #define _TRISD4 0x10
4145 #define _TRISD5 0x20
4146 #define _TRISD6 0x40
4147 #define _TRISD7 0x80
4149 //==============================================================================
4152 //==============================================================================
4153 // TRISE Bits
4155 extern __at(0x0F96) __sfr TRISE;
4157 typedef struct
4159 unsigned TRISE0 : 1;
4160 unsigned TRISE1 : 1;
4161 unsigned TRISE2 : 1;
4162 unsigned TRISE3 : 1;
4163 unsigned TRISE4 : 1;
4164 unsigned TRISE5 : 1;
4165 unsigned TRISE6 : 1;
4166 unsigned TRISE7 : 1;
4167 } __TRISEbits_t;
4169 extern __at(0x0F96) volatile __TRISEbits_t TRISEbits;
4171 #define _TRISE0 0x01
4172 #define _TRISE1 0x02
4173 #define _TRISE2 0x04
4174 #define _TRISE3 0x08
4175 #define _TRISE4 0x10
4176 #define _TRISE5 0x20
4177 #define _TRISE6 0x40
4178 #define _TRISE7 0x80
4180 //==============================================================================
4183 //==============================================================================
4184 // TRISF Bits
4186 extern __at(0x0F97) __sfr TRISF;
4188 typedef struct
4190 unsigned : 1;
4191 unsigned TRISF1 : 1;
4192 unsigned TRISF2 : 1;
4193 unsigned TRISF3 : 1;
4194 unsigned TRISF4 : 1;
4195 unsigned TRISF5 : 1;
4196 unsigned TRISF6 : 1;
4197 unsigned TRISF7 : 1;
4198 } __TRISFbits_t;
4200 extern __at(0x0F97) volatile __TRISFbits_t TRISFbits;
4202 #define _TRISF1 0x02
4203 #define _TRISF2 0x04
4204 #define _TRISF3 0x08
4205 #define _TRISF4 0x10
4206 #define _TRISF5 0x20
4207 #define _TRISF6 0x40
4208 #define _TRISF7 0x80
4210 //==============================================================================
4213 //==============================================================================
4214 // TRISG Bits
4216 extern __at(0x0F98) __sfr TRISG;
4218 typedef union
4220 struct
4222 unsigned TRISG0 : 1;
4223 unsigned TRISG1 : 1;
4224 unsigned TRISG2 : 1;
4225 unsigned TRISG3 : 1;
4226 unsigned TRISG4 : 1;
4227 unsigned : 1;
4228 unsigned : 1;
4229 unsigned : 1;
4232 struct
4234 unsigned TRISG : 5;
4235 unsigned : 3;
4237 } __TRISGbits_t;
4239 extern __at(0x0F98) volatile __TRISGbits_t TRISGbits;
4241 #define _TRISG0 0x01
4242 #define _TRISG1 0x02
4243 #define _TRISG2 0x04
4244 #define _TRISG3 0x08
4245 #define _TRISG4 0x10
4247 //==============================================================================
4250 //==============================================================================
4251 // OSCTUNE Bits
4253 extern __at(0x0F9B) __sfr OSCTUNE;
4255 typedef union
4257 struct
4259 unsigned TUN0 : 1;
4260 unsigned TUN1 : 1;
4261 unsigned TUN2 : 1;
4262 unsigned TUN3 : 1;
4263 unsigned TUN4 : 1;
4264 unsigned TUN5 : 1;
4265 unsigned PLLEN : 1;
4266 unsigned INTSRC : 1;
4269 struct
4271 unsigned TUN : 6;
4272 unsigned : 2;
4274 } __OSCTUNEbits_t;
4276 extern __at(0x0F9B) volatile __OSCTUNEbits_t OSCTUNEbits;
4278 #define _TUN0 0x01
4279 #define _TUN1 0x02
4280 #define _TUN2 0x04
4281 #define _TUN3 0x08
4282 #define _TUN4 0x10
4283 #define _TUN5 0x20
4284 #define _PLLEN 0x40
4285 #define _INTSRC 0x80
4287 //==============================================================================
4290 //==============================================================================
4291 // PSTR1CON Bits
4293 extern __at(0x0F9C) __sfr PSTR1CON;
4295 typedef union
4297 struct
4299 unsigned STRA : 1;
4300 unsigned STRB : 1;
4301 unsigned STRC : 1;
4302 unsigned STRD : 1;
4303 unsigned STRSYNC : 1;
4304 unsigned : 1;
4305 unsigned CMPL0 : 1;
4306 unsigned CMPL1 : 1;
4309 struct
4311 unsigned : 6;
4312 unsigned CMPL : 2;
4314 } __PSTR1CONbits_t;
4316 extern __at(0x0F9C) volatile __PSTR1CONbits_t PSTR1CONbits;
4318 #define _STRA 0x01
4319 #define _STRB 0x02
4320 #define _STRC 0x04
4321 #define _STRD 0x08
4322 #define _STRSYNC 0x10
4323 #define _CMPL0 0x40
4324 #define _CMPL1 0x80
4326 //==============================================================================
4329 //==============================================================================
4330 // PIE1 Bits
4332 extern __at(0x0F9D) __sfr PIE1;
4334 typedef union
4336 struct
4338 unsigned TMR1IE : 1;
4339 unsigned TMR2IE : 1;
4340 unsigned TMR1GIE : 1;
4341 unsigned SSP1IE : 1;
4342 unsigned TX1IE : 1;
4343 unsigned RC1IE : 1;
4344 unsigned ADIE : 1;
4345 unsigned PSPIE : 1;
4348 struct
4350 unsigned : 1;
4351 unsigned : 1;
4352 unsigned : 1;
4353 unsigned SSPIE : 1;
4354 unsigned TXIE : 1;
4355 unsigned RCIE : 1;
4356 unsigned : 1;
4357 unsigned : 1;
4359 } __PIE1bits_t;
4361 extern __at(0x0F9D) volatile __PIE1bits_t PIE1bits;
4363 #define _TMR1IE 0x01
4364 #define _TMR2IE 0x02
4365 #define _TMR1GIE 0x04
4366 #define _SSP1IE 0x08
4367 #define _SSPIE 0x08
4368 #define _TX1IE 0x10
4369 #define _TXIE 0x10
4370 #define _RC1IE 0x20
4371 #define _RCIE 0x20
4372 #define _ADIE 0x40
4373 #define _PSPIE 0x80
4375 //==============================================================================
4378 //==============================================================================
4379 // PIR1 Bits
4381 extern __at(0x0F9E) __sfr PIR1;
4383 typedef union
4385 struct
4387 unsigned TMR1IF : 1;
4388 unsigned TMR2IF : 1;
4389 unsigned TMR1GIF : 1;
4390 unsigned SSP1IF : 1;
4391 unsigned TX1IF : 1;
4392 unsigned RC1IF : 1;
4393 unsigned ADIF : 1;
4394 unsigned PSPIF : 1;
4397 struct
4399 unsigned : 1;
4400 unsigned : 1;
4401 unsigned : 1;
4402 unsigned SSPIF : 1;
4403 unsigned TXIF : 1;
4404 unsigned RCIF : 1;
4405 unsigned : 1;
4406 unsigned : 1;
4408 } __PIR1bits_t;
4410 extern __at(0x0F9E) volatile __PIR1bits_t PIR1bits;
4412 #define _TMR1IF 0x01
4413 #define _TMR2IF 0x02
4414 #define _TMR1GIF 0x04
4415 #define _SSP1IF 0x08
4416 #define _SSPIF 0x08
4417 #define _TX1IF 0x10
4418 #define _TXIF 0x10
4419 #define _RC1IF 0x20
4420 #define _RCIF 0x20
4421 #define _ADIF 0x40
4422 #define _PSPIF 0x80
4424 //==============================================================================
4427 //==============================================================================
4428 // IPR1 Bits
4430 extern __at(0x0F9F) __sfr IPR1;
4432 typedef union
4434 struct
4436 unsigned TMR1IP : 1;
4437 unsigned TMR2IP : 1;
4438 unsigned TMR1GIP : 1;
4439 unsigned SSP1IP : 1;
4440 unsigned TX1IP : 1;
4441 unsigned RC1IP : 1;
4442 unsigned ADIP : 1;
4443 unsigned PSPIP : 1;
4446 struct
4448 unsigned : 1;
4449 unsigned : 1;
4450 unsigned : 1;
4451 unsigned SSPIP : 1;
4452 unsigned TXIP : 1;
4453 unsigned RCIP : 1;
4454 unsigned : 1;
4455 unsigned : 1;
4457 } __IPR1bits_t;
4459 extern __at(0x0F9F) volatile __IPR1bits_t IPR1bits;
4461 #define _TMR1IP 0x01
4462 #define _TMR2IP 0x02
4463 #define _TMR1GIP 0x04
4464 #define _SSP1IP 0x08
4465 #define _SSPIP 0x08
4466 #define _TX1IP 0x10
4467 #define _TXIP 0x10
4468 #define _RC1IP 0x20
4469 #define _RCIP 0x20
4470 #define _ADIP 0x40
4471 #define _PSPIP 0x80
4473 //==============================================================================
4476 //==============================================================================
4477 // PIE2 Bits
4479 extern __at(0x0FA0) __sfr PIE2;
4481 typedef union
4483 struct
4485 unsigned TMR3GIE : 1;
4486 unsigned TMR3IE : 1;
4487 unsigned HLVDIE : 1;
4488 unsigned BCL1IE : 1;
4489 unsigned BCL2IE : 1;
4490 unsigned SSP2IE : 1;
4491 unsigned : 1;
4492 unsigned OSCFIE : 1;
4495 struct
4497 unsigned : 1;
4498 unsigned : 1;
4499 unsigned LVDIE : 1;
4500 unsigned BCLIE : 1;
4501 unsigned : 1;
4502 unsigned : 1;
4503 unsigned : 1;
4504 unsigned : 1;
4506 } __PIE2bits_t;
4508 extern __at(0x0FA0) volatile __PIE2bits_t PIE2bits;
4510 #define _TMR3GIE 0x01
4511 #define _TMR3IE 0x02
4512 #define _HLVDIE 0x04
4513 #define _LVDIE 0x04
4514 #define _BCL1IE 0x08
4515 #define _BCLIE 0x08
4516 #define _BCL2IE 0x10
4517 #define _SSP2IE 0x20
4518 #define _OSCFIE 0x80
4520 //==============================================================================
4523 //==============================================================================
4524 // PIR2 Bits
4526 extern __at(0x0FA1) __sfr PIR2;
4528 typedef union
4530 struct
4532 unsigned TMR3GIF : 1;
4533 unsigned TMR3IF : 1;
4534 unsigned HLVDIF : 1;
4535 unsigned BCL1IF : 1;
4536 unsigned BCL2IF : 1;
4537 unsigned SSP2IF : 1;
4538 unsigned : 1;
4539 unsigned OSCFIF : 1;
4542 struct
4544 unsigned : 1;
4545 unsigned : 1;
4546 unsigned LVDIF : 1;
4547 unsigned BCLIF : 1;
4548 unsigned : 1;
4549 unsigned : 1;
4550 unsigned : 1;
4551 unsigned : 1;
4553 } __PIR2bits_t;
4555 extern __at(0x0FA1) volatile __PIR2bits_t PIR2bits;
4557 #define _TMR3GIF 0x01
4558 #define _TMR3IF 0x02
4559 #define _HLVDIF 0x04
4560 #define _LVDIF 0x04
4561 #define _BCL1IF 0x08
4562 #define _BCLIF 0x08
4563 #define _BCL2IF 0x10
4564 #define _SSP2IF 0x20
4565 #define _OSCFIF 0x80
4567 //==============================================================================
4570 //==============================================================================
4571 // IPR2 Bits
4573 extern __at(0x0FA2) __sfr IPR2;
4575 typedef union
4577 struct
4579 unsigned TMR3GIP : 1;
4580 unsigned TMR3IP : 1;
4581 unsigned HLVDIP : 1;
4582 unsigned BCL1IP : 1;
4583 unsigned BCL2IP : 1;
4584 unsigned SSP2IP : 1;
4585 unsigned : 1;
4586 unsigned OSCFIP : 1;
4589 struct
4591 unsigned : 1;
4592 unsigned : 1;
4593 unsigned LVDIP : 1;
4594 unsigned BCLIP : 1;
4595 unsigned : 1;
4596 unsigned : 1;
4597 unsigned : 1;
4598 unsigned : 1;
4600 } __IPR2bits_t;
4602 extern __at(0x0FA2) volatile __IPR2bits_t IPR2bits;
4604 #define _TMR3GIP 0x01
4605 #define _TMR3IP 0x02
4606 #define _HLVDIP 0x04
4607 #define _LVDIP 0x04
4608 #define _BCL1IP 0x08
4609 #define _BCLIP 0x08
4610 #define _BCL2IP 0x10
4611 #define _SSP2IP 0x20
4612 #define _OSCFIP 0x80
4614 //==============================================================================
4617 //==============================================================================
4618 // PIE3 Bits
4620 extern __at(0x0FA3) __sfr PIE3;
4622 typedef struct
4624 unsigned RTCCIE : 1;
4625 unsigned CCP1IE : 1;
4626 unsigned CCP2IE : 1;
4627 unsigned CTMUIE : 1;
4628 unsigned TX2IE : 1;
4629 unsigned RC2IE : 1;
4630 unsigned : 1;
4631 unsigned TMR5GIE : 1;
4632 } __PIE3bits_t;
4634 extern __at(0x0FA3) volatile __PIE3bits_t PIE3bits;
4636 #define _RTCCIE 0x01
4637 #define _CCP1IE 0x02
4638 #define _CCP2IE 0x04
4639 #define _CTMUIE 0x08
4640 #define _TX2IE 0x10
4641 #define _RC2IE 0x20
4642 #define _TMR5GIE 0x80
4644 //==============================================================================
4647 //==============================================================================
4648 // PIR3 Bits
4650 extern __at(0x0FA4) __sfr PIR3;
4652 typedef struct
4654 unsigned RTCCIF : 1;
4655 unsigned CCP1IF : 1;
4656 unsigned CCP2IF : 1;
4657 unsigned CTMUIF : 1;
4658 unsigned TX2IF : 1;
4659 unsigned RC2IF : 1;
4660 unsigned : 1;
4661 unsigned TMR5GIF : 1;
4662 } __PIR3bits_t;
4664 extern __at(0x0FA4) volatile __PIR3bits_t PIR3bits;
4666 #define _RTCCIF 0x01
4667 #define _CCP1IF 0x02
4668 #define _CCP2IF 0x04
4669 #define _CTMUIF 0x08
4670 #define _TX2IF 0x10
4671 #define _RC2IF 0x20
4672 #define _TMR5GIF 0x80
4674 //==============================================================================
4677 //==============================================================================
4678 // IPR3 Bits
4680 extern __at(0x0FA5) __sfr IPR3;
4682 typedef struct
4684 unsigned RTCCIP : 1;
4685 unsigned CCP1IP : 1;
4686 unsigned CCP2IP : 1;
4687 unsigned CTMUIP : 1;
4688 unsigned TX2IP : 1;
4689 unsigned RC2IP : 1;
4690 unsigned : 1;
4691 unsigned TMR5GIP : 1;
4692 } __IPR3bits_t;
4694 extern __at(0x0FA5) volatile __IPR3bits_t IPR3bits;
4696 #define _RTCCIP 0x01
4697 #define _CCP1IP 0x02
4698 #define _CCP2IP 0x04
4699 #define _CTMUIP 0x08
4700 #define _TX2IP 0x10
4701 #define _RC2IP 0x20
4702 #define _TMR5GIP 0x80
4704 //==============================================================================
4707 //==============================================================================
4708 // PIR6 Bits
4710 extern __at(0x0FA6) __sfr PIR6;
4712 typedef struct
4714 unsigned CMP1IF : 1;
4715 unsigned CMP2IF : 1;
4716 unsigned CMP3IF : 1;
4717 unsigned : 1;
4718 unsigned EEIF : 1;
4719 unsigned : 1;
4720 unsigned : 1;
4721 unsigned : 1;
4722 } __PIR6bits_t;
4724 extern __at(0x0FA6) volatile __PIR6bits_t PIR6bits;
4726 #define _CMP1IF 0x01
4727 #define _CMP2IF 0x02
4728 #define _CMP3IF 0x04
4729 #define _EEIF 0x10
4731 //==============================================================================
4734 //==============================================================================
4735 // PSPCON Bits
4737 extern __at(0x0FA7) __sfr PSPCON;
4739 typedef struct
4741 unsigned : 1;
4742 unsigned : 1;
4743 unsigned : 1;
4744 unsigned : 1;
4745 unsigned PSPMODE : 1;
4746 unsigned IBOV : 1;
4747 unsigned OBF : 1;
4748 unsigned IBF : 1;
4749 } __PSPCONbits_t;
4751 extern __at(0x0FA7) volatile __PSPCONbits_t PSPCONbits;
4753 #define _PSPMODE 0x10
4754 #define _IBOV 0x20
4755 #define _OBF 0x40
4756 #define _IBF 0x80
4758 //==============================================================================
4761 //==============================================================================
4762 // HLVDCON Bits
4764 extern __at(0x0FA8) __sfr HLVDCON;
4766 typedef union
4768 struct
4770 unsigned HLVDL0 : 1;
4771 unsigned HLVDL1 : 1;
4772 unsigned HLVDL2 : 1;
4773 unsigned HLVDL3 : 1;
4774 unsigned HLVDEN : 1;
4775 unsigned IRVST : 1;
4776 unsigned BGVST : 1;
4777 unsigned VDIRMAG : 1;
4780 struct
4782 unsigned HLVDL : 4;
4783 unsigned : 4;
4785 } __HLVDCONbits_t;
4787 extern __at(0x0FA8) volatile __HLVDCONbits_t HLVDCONbits;
4789 #define _HLVDL0 0x01
4790 #define _HLVDL1 0x02
4791 #define _HLVDL2 0x04
4792 #define _HLVDL3 0x08
4793 #define _HLVDEN 0x10
4794 #define _IRVST 0x20
4795 #define _BGVST 0x40
4796 #define _VDIRMAG 0x80
4798 //==============================================================================
4801 //==============================================================================
4802 // IPR6 Bits
4804 extern __at(0x0FA9) __sfr IPR6;
4806 typedef struct
4808 unsigned CMP1IP : 1;
4809 unsigned CMP2IP : 1;
4810 unsigned CMP3IP : 1;
4811 unsigned : 1;
4812 unsigned EEIP : 1;
4813 unsigned : 1;
4814 unsigned : 1;
4815 unsigned : 1;
4816 } __IPR6bits_t;
4818 extern __at(0x0FA9) volatile __IPR6bits_t IPR6bits;
4820 #define _CMP1IP 0x01
4821 #define _CMP2IP 0x02
4822 #define _CMP3IP 0x04
4823 #define _EEIP 0x10
4825 //==============================================================================
4828 //==============================================================================
4829 // T1GCON Bits
4831 extern __at(0x0FAA) __sfr T1GCON;
4833 typedef union
4835 struct
4837 unsigned T1GSS0 : 1;
4838 unsigned T1GSS1 : 1;
4839 unsigned T1GVAL : 1;
4840 unsigned T1GGO_NOT_T1DONE : 1;
4841 unsigned T1GSPM : 1;
4842 unsigned T1GTM : 1;
4843 unsigned T1GPOL : 1;
4844 unsigned TMR1GE : 1;
4847 struct
4849 unsigned : 1;
4850 unsigned : 1;
4851 unsigned : 1;
4852 unsigned T1GGO : 1;
4853 unsigned : 1;
4854 unsigned : 1;
4855 unsigned : 1;
4856 unsigned : 1;
4859 struct
4861 unsigned : 1;
4862 unsigned : 1;
4863 unsigned : 1;
4864 unsigned NOT_T1DONE : 1;
4865 unsigned : 1;
4866 unsigned : 1;
4867 unsigned : 1;
4868 unsigned : 1;
4871 struct
4873 unsigned T1GSS : 2;
4874 unsigned : 6;
4876 } __T1GCONbits_t;
4878 extern __at(0x0FAA) volatile __T1GCONbits_t T1GCONbits;
4880 #define _T1GSS0 0x01
4881 #define _T1GSS1 0x02
4882 #define _T1GVAL 0x04
4883 #define _T1GGO_NOT_T1DONE 0x08
4884 #define _T1GGO 0x08
4885 #define _NOT_T1DONE 0x08
4886 #define _T1GSPM 0x10
4887 #define _T1GTM 0x20
4888 #define _T1GPOL 0x40
4889 #define _TMR1GE 0x80
4891 //==============================================================================
4894 //==============================================================================
4895 // RCSTA Bits
4897 extern __at(0x0FAB) __sfr RCSTA;
4899 typedef union
4901 struct
4903 unsigned RX9D : 1;
4904 unsigned OERR : 1;
4905 unsigned FERR : 1;
4906 unsigned ADDEN : 1;
4907 unsigned CREN : 1;
4908 unsigned SREN : 1;
4909 unsigned RX9 : 1;
4910 unsigned SPEN : 1;
4913 struct
4915 unsigned RCD8 : 1;
4916 unsigned OERR1 : 1;
4917 unsigned FERR1 : 1;
4918 unsigned ADEN : 1;
4919 unsigned CREN1 : 1;
4920 unsigned SREN1 : 1;
4921 unsigned RC9 : 1;
4922 unsigned SPEN1 : 1;
4925 struct
4927 unsigned RX9D1 : 1;
4928 unsigned : 1;
4929 unsigned : 1;
4930 unsigned ADDEN1 : 1;
4931 unsigned : 1;
4932 unsigned : 1;
4933 unsigned NOT_RC8 : 1;
4934 unsigned : 1;
4937 struct
4939 unsigned : 1;
4940 unsigned : 1;
4941 unsigned : 1;
4942 unsigned : 1;
4943 unsigned : 1;
4944 unsigned : 1;
4945 unsigned RC8_9 : 1;
4946 unsigned : 1;
4949 struct
4951 unsigned : 1;
4952 unsigned : 1;
4953 unsigned : 1;
4954 unsigned : 1;
4955 unsigned : 1;
4956 unsigned : 1;
4957 unsigned RX91 : 1;
4958 unsigned : 1;
4960 } __RCSTAbits_t;
4962 extern __at(0x0FAB) volatile __RCSTAbits_t RCSTAbits;
4964 #define _RX9D 0x01
4965 #define _RCD8 0x01
4966 #define _RX9D1 0x01
4967 #define _OERR 0x02
4968 #define _OERR1 0x02
4969 #define _FERR 0x04
4970 #define _FERR1 0x04
4971 #define _ADDEN 0x08
4972 #define _ADEN 0x08
4973 #define _ADDEN1 0x08
4974 #define _CREN 0x10
4975 #define _CREN1 0x10
4976 #define _SREN 0x20
4977 #define _SREN1 0x20
4978 #define _RX9 0x40
4979 #define _RC9 0x40
4980 #define _NOT_RC8 0x40
4981 #define _RC8_9 0x40
4982 #define _RX91 0x40
4983 #define _SPEN 0x80
4984 #define _SPEN1 0x80
4986 //==============================================================================
4989 //==============================================================================
4990 // RCSTA1 Bits
4992 extern __at(0x0FAB) __sfr RCSTA1;
4994 typedef union
4996 struct
4998 unsigned RX9D : 1;
4999 unsigned OERR : 1;
5000 unsigned FERR : 1;
5001 unsigned ADDEN : 1;
5002 unsigned CREN : 1;
5003 unsigned SREN : 1;
5004 unsigned RX9 : 1;
5005 unsigned SPEN : 1;
5008 struct
5010 unsigned RCD8 : 1;
5011 unsigned OERR1 : 1;
5012 unsigned FERR1 : 1;
5013 unsigned ADEN : 1;
5014 unsigned CREN1 : 1;
5015 unsigned SREN1 : 1;
5016 unsigned RC9 : 1;
5017 unsigned SPEN1 : 1;
5020 struct
5022 unsigned RX9D1 : 1;
5023 unsigned : 1;
5024 unsigned : 1;
5025 unsigned ADDEN1 : 1;
5026 unsigned : 1;
5027 unsigned : 1;
5028 unsigned NOT_RC8 : 1;
5029 unsigned : 1;
5032 struct
5034 unsigned : 1;
5035 unsigned : 1;
5036 unsigned : 1;
5037 unsigned : 1;
5038 unsigned : 1;
5039 unsigned : 1;
5040 unsigned RC8_9 : 1;
5041 unsigned : 1;
5044 struct
5046 unsigned : 1;
5047 unsigned : 1;
5048 unsigned : 1;
5049 unsigned : 1;
5050 unsigned : 1;
5051 unsigned : 1;
5052 unsigned RX91 : 1;
5053 unsigned : 1;
5055 } __RCSTA1bits_t;
5057 extern __at(0x0FAB) volatile __RCSTA1bits_t RCSTA1bits;
5059 #define _RCSTA1_RX9D 0x01
5060 #define _RCSTA1_RCD8 0x01
5061 #define _RCSTA1_RX9D1 0x01
5062 #define _RCSTA1_OERR 0x02
5063 #define _RCSTA1_OERR1 0x02
5064 #define _RCSTA1_FERR 0x04
5065 #define _RCSTA1_FERR1 0x04
5066 #define _RCSTA1_ADDEN 0x08
5067 #define _RCSTA1_ADEN 0x08
5068 #define _RCSTA1_ADDEN1 0x08
5069 #define _RCSTA1_CREN 0x10
5070 #define _RCSTA1_CREN1 0x10
5071 #define _RCSTA1_SREN 0x20
5072 #define _RCSTA1_SREN1 0x20
5073 #define _RCSTA1_RX9 0x40
5074 #define _RCSTA1_RC9 0x40
5075 #define _RCSTA1_NOT_RC8 0x40
5076 #define _RCSTA1_RC8_9 0x40
5077 #define _RCSTA1_RX91 0x40
5078 #define _RCSTA1_SPEN 0x80
5079 #define _RCSTA1_SPEN1 0x80
5081 //==============================================================================
5084 //==============================================================================
5085 // TXSTA Bits
5087 extern __at(0x0FAC) __sfr TXSTA;
5089 typedef union
5091 struct
5093 unsigned TX9D : 1;
5094 unsigned TRMT : 1;
5095 unsigned BRGH : 1;
5096 unsigned SENDB : 1;
5097 unsigned SYNC : 1;
5098 unsigned TXEN : 1;
5099 unsigned TX9 : 1;
5100 unsigned CSRC : 1;
5103 struct
5105 unsigned TXD8 : 1;
5106 unsigned TRMT1 : 1;
5107 unsigned BRGH1 : 1;
5108 unsigned SENDB1 : 1;
5109 unsigned SYNC1 : 1;
5110 unsigned TXEN1 : 1;
5111 unsigned TX8_9 : 1;
5112 unsigned CSRC1 : 1;
5115 struct
5117 unsigned TX9D1 : 1;
5118 unsigned : 1;
5119 unsigned : 1;
5120 unsigned : 1;
5121 unsigned : 1;
5122 unsigned : 1;
5123 unsigned NOT_TX8 : 1;
5124 unsigned : 1;
5127 struct
5129 unsigned : 1;
5130 unsigned : 1;
5131 unsigned : 1;
5132 unsigned : 1;
5133 unsigned : 1;
5134 unsigned : 1;
5135 unsigned TX91 : 1;
5136 unsigned : 1;
5138 } __TXSTAbits_t;
5140 extern __at(0x0FAC) volatile __TXSTAbits_t TXSTAbits;
5142 #define _TX9D 0x01
5143 #define _TXD8 0x01
5144 #define _TX9D1 0x01
5145 #define _TRMT 0x02
5146 #define _TRMT1 0x02
5147 #define _BRGH 0x04
5148 #define _BRGH1 0x04
5149 #define _SENDB 0x08
5150 #define _SENDB1 0x08
5151 #define _SYNC 0x10
5152 #define _SYNC1 0x10
5153 #define _TXEN 0x20
5154 #define _TXEN1 0x20
5155 #define _TX9 0x40
5156 #define _TX8_9 0x40
5157 #define _NOT_TX8 0x40
5158 #define _TX91 0x40
5159 #define _CSRC 0x80
5160 #define _CSRC1 0x80
5162 //==============================================================================
5165 //==============================================================================
5166 // TXSTA1 Bits
5168 extern __at(0x0FAC) __sfr TXSTA1;
5170 typedef union
5172 struct
5174 unsigned TX9D : 1;
5175 unsigned TRMT : 1;
5176 unsigned BRGH : 1;
5177 unsigned SENDB : 1;
5178 unsigned SYNC : 1;
5179 unsigned TXEN : 1;
5180 unsigned TX9 : 1;
5181 unsigned CSRC : 1;
5184 struct
5186 unsigned TXD8 : 1;
5187 unsigned TRMT1 : 1;
5188 unsigned BRGH1 : 1;
5189 unsigned SENDB1 : 1;
5190 unsigned SYNC1 : 1;
5191 unsigned TXEN1 : 1;
5192 unsigned TX8_9 : 1;
5193 unsigned CSRC1 : 1;
5196 struct
5198 unsigned TX9D1 : 1;
5199 unsigned : 1;
5200 unsigned : 1;
5201 unsigned : 1;
5202 unsigned : 1;
5203 unsigned : 1;
5204 unsigned NOT_TX8 : 1;
5205 unsigned : 1;
5208 struct
5210 unsigned : 1;
5211 unsigned : 1;
5212 unsigned : 1;
5213 unsigned : 1;
5214 unsigned : 1;
5215 unsigned : 1;
5216 unsigned TX91 : 1;
5217 unsigned : 1;
5219 } __TXSTA1bits_t;
5221 extern __at(0x0FAC) volatile __TXSTA1bits_t TXSTA1bits;
5223 #define _TXSTA1_TX9D 0x01
5224 #define _TXSTA1_TXD8 0x01
5225 #define _TXSTA1_TX9D1 0x01
5226 #define _TXSTA1_TRMT 0x02
5227 #define _TXSTA1_TRMT1 0x02
5228 #define _TXSTA1_BRGH 0x04
5229 #define _TXSTA1_BRGH1 0x04
5230 #define _TXSTA1_SENDB 0x08
5231 #define _TXSTA1_SENDB1 0x08
5232 #define _TXSTA1_SYNC 0x10
5233 #define _TXSTA1_SYNC1 0x10
5234 #define _TXSTA1_TXEN 0x20
5235 #define _TXSTA1_TXEN1 0x20
5236 #define _TXSTA1_TX9 0x40
5237 #define _TXSTA1_TX8_9 0x40
5238 #define _TXSTA1_NOT_TX8 0x40
5239 #define _TXSTA1_TX91 0x40
5240 #define _TXSTA1_CSRC 0x80
5241 #define _TXSTA1_CSRC1 0x80
5243 //==============================================================================
5245 extern __at(0x0FAD) __sfr TXREG;
5246 extern __at(0x0FAD) __sfr TXREG1;
5247 extern __at(0x0FAE) __sfr RCREG;
5248 extern __at(0x0FAE) __sfr RCREG1;
5249 extern __at(0x0FAF) __sfr SPBRG;
5250 extern __at(0x0FAF) __sfr SPBRG1;
5252 //==============================================================================
5253 // T3GCON Bits
5255 extern __at(0x0FB0) __sfr T3GCON;
5257 typedef union
5259 struct
5261 unsigned T3GSS0 : 1;
5262 unsigned T3GSS1 : 1;
5263 unsigned T3GVAL : 1;
5264 unsigned T3GGO_NOT_T3DONE : 1;
5265 unsigned T3GSPM : 1;
5266 unsigned T3GTM : 1;
5267 unsigned T3GPOL : 1;
5268 unsigned TMR3GE : 1;
5271 struct
5273 unsigned : 1;
5274 unsigned : 1;
5275 unsigned : 1;
5276 unsigned T3GGO : 1;
5277 unsigned : 1;
5278 unsigned : 1;
5279 unsigned : 1;
5280 unsigned : 1;
5283 struct
5285 unsigned : 1;
5286 unsigned : 1;
5287 unsigned : 1;
5288 unsigned NOT_T3DONE : 1;
5289 unsigned : 1;
5290 unsigned : 1;
5291 unsigned : 1;
5292 unsigned : 1;
5295 struct
5297 unsigned T3GSS : 2;
5298 unsigned : 6;
5300 } __T3GCONbits_t;
5302 extern __at(0x0FB0) volatile __T3GCONbits_t T3GCONbits;
5304 #define _T3GSS0 0x01
5305 #define _T3GSS1 0x02
5306 #define _T3GVAL 0x04
5307 #define _T3GGO_NOT_T3DONE 0x08
5308 #define _T3GGO 0x08
5309 #define _NOT_T3DONE 0x08
5310 #define _T3GSPM 0x10
5311 #define _T3GTM 0x20
5312 #define _T3GPOL 0x40
5313 #define _TMR3GE 0x80
5315 //==============================================================================
5318 //==============================================================================
5319 // T3CON Bits
5321 extern __at(0x0FB1) __sfr T3CON;
5323 typedef union
5325 struct
5327 unsigned TMR3ON : 1;
5328 unsigned RD16 : 1;
5329 unsigned NOT_T3SYNC : 1;
5330 unsigned SOSCEN : 1;
5331 unsigned T3CKPS0 : 1;
5332 unsigned T3CKPS1 : 1;
5333 unsigned TMR3CS0 : 1;
5334 unsigned TMR3CS1 : 1;
5337 struct
5339 unsigned : 4;
5340 unsigned T3CKPS : 2;
5341 unsigned : 2;
5344 struct
5346 unsigned : 6;
5347 unsigned TMR3CS : 2;
5349 } __T3CONbits_t;
5351 extern __at(0x0FB1) volatile __T3CONbits_t T3CONbits;
5353 #define _T3CON_TMR3ON 0x01
5354 #define _T3CON_RD16 0x02
5355 #define _T3CON_NOT_T3SYNC 0x04
5356 #define _T3CON_SOSCEN 0x08
5357 #define _T3CON_T3CKPS0 0x10
5358 #define _T3CON_T3CKPS1 0x20
5359 #define _T3CON_TMR3CS0 0x40
5360 #define _T3CON_TMR3CS1 0x80
5362 //==============================================================================
5364 extern __at(0x0FB2) __sfr TMR3;
5365 extern __at(0x0FB2) __sfr TMR3L;
5366 extern __at(0x0FB3) __sfr TMR3H;
5368 //==============================================================================
5369 // CMSTAT Bits
5371 extern __at(0x0FB4) __sfr CMSTAT;
5373 typedef struct
5375 unsigned : 1;
5376 unsigned : 1;
5377 unsigned : 1;
5378 unsigned : 1;
5379 unsigned : 1;
5380 unsigned CMP1OUT : 1;
5381 unsigned CMP2OUT : 1;
5382 unsigned CMP3OUT : 1;
5383 } __CMSTATbits_t;
5385 extern __at(0x0FB4) volatile __CMSTATbits_t CMSTATbits;
5387 #define _CMP1OUT 0x20
5388 #define _CMP2OUT 0x40
5389 #define _CMP3OUT 0x80
5391 //==============================================================================
5394 //==============================================================================
5395 // CMSTATUS Bits
5397 extern __at(0x0FB4) __sfr CMSTATUS;
5399 typedef struct
5401 unsigned : 1;
5402 unsigned : 1;
5403 unsigned : 1;
5404 unsigned : 1;
5405 unsigned : 1;
5406 unsigned CMP1OUT : 1;
5407 unsigned CMP2OUT : 1;
5408 unsigned CMP3OUT : 1;
5409 } __CMSTATUSbits_t;
5411 extern __at(0x0FB4) volatile __CMSTATUSbits_t CMSTATUSbits;
5413 #define _CMSTATUS_CMP1OUT 0x20
5414 #define _CMSTATUS_CMP2OUT 0x40
5415 #define _CMSTATUS_CMP3OUT 0x80
5417 //==============================================================================
5420 //==============================================================================
5421 // CVRCON Bits
5423 extern __at(0x0FB5) __sfr CVRCON;
5425 typedef union
5427 struct
5429 unsigned CVR0 : 1;
5430 unsigned CVR1 : 1;
5431 unsigned CVR2 : 1;
5432 unsigned CVR3 : 1;
5433 unsigned CVR4 : 1;
5434 unsigned CVRSS : 1;
5435 unsigned CVROE : 1;
5436 unsigned CVREN : 1;
5439 struct
5441 unsigned CVR : 5;
5442 unsigned : 3;
5444 } __CVRCONbits_t;
5446 extern __at(0x0FB5) volatile __CVRCONbits_t CVRCONbits;
5448 #define _CVR0 0x01
5449 #define _CVR1 0x02
5450 #define _CVR2 0x04
5451 #define _CVR3 0x08
5452 #define _CVR4 0x10
5453 #define _CVRSS 0x20
5454 #define _CVROE 0x40
5455 #define _CVREN 0x80
5457 //==============================================================================
5460 //==============================================================================
5461 // PIE4 Bits
5463 extern __at(0x0FB6) __sfr PIE4;
5465 typedef struct
5467 unsigned CCP3IE : 1;
5468 unsigned CCP4IE : 1;
5469 unsigned CCP5IE : 1;
5470 unsigned CCP6IE : 1;
5471 unsigned CCP7IE : 1;
5472 unsigned CCP8IE : 1;
5473 unsigned CCP9IE : 1;
5474 unsigned CCP10IE : 1;
5475 } __PIE4bits_t;
5477 extern __at(0x0FB6) volatile __PIE4bits_t PIE4bits;
5479 #define _CCP3IE 0x01
5480 #define _CCP4IE 0x02
5481 #define _CCP5IE 0x04
5482 #define _CCP6IE 0x08
5483 #define _CCP7IE 0x10
5484 #define _CCP8IE 0x20
5485 #define _CCP9IE 0x40
5486 #define _CCP10IE 0x80
5488 //==============================================================================
5491 //==============================================================================
5492 // PIR4 Bits
5494 extern __at(0x0FB7) __sfr PIR4;
5496 typedef struct
5498 unsigned CCP3IF : 1;
5499 unsigned CCP4IF : 1;
5500 unsigned CCP5IF : 1;
5501 unsigned CCP6IF : 1;
5502 unsigned CCP7IF : 1;
5503 unsigned CCP8IF : 1;
5504 unsigned CCP9IF : 1;
5505 unsigned CCP10IF : 1;
5506 } __PIR4bits_t;
5508 extern __at(0x0FB7) volatile __PIR4bits_t PIR4bits;
5510 #define _CCP3IF 0x01
5511 #define _CCP4IF 0x02
5512 #define _CCP5IF 0x04
5513 #define _CCP6IF 0x08
5514 #define _CCP7IF 0x10
5515 #define _CCP8IF 0x20
5516 #define _CCP9IF 0x40
5517 #define _CCP10IF 0x80
5519 //==============================================================================
5522 //==============================================================================
5523 // IPR4 Bits
5525 extern __at(0x0FB8) __sfr IPR4;
5527 typedef struct
5529 unsigned CCP3IP : 1;
5530 unsigned CCP4IP : 1;
5531 unsigned CCP5IP : 1;
5532 unsigned CCP6IP : 1;
5533 unsigned CCP7IP : 1;
5534 unsigned CCP8IP : 1;
5535 unsigned CCP9IP : 1;
5536 unsigned CCP10IP : 1;
5537 } __IPR4bits_t;
5539 extern __at(0x0FB8) volatile __IPR4bits_t IPR4bits;
5541 #define _CCP3IP 0x01
5542 #define _CCP4IP 0x02
5543 #define _CCP5IP 0x04
5544 #define _CCP6IP 0x08
5545 #define _CCP7IP 0x10
5546 #define _CCP8IP 0x20
5547 #define _CCP9IP 0x40
5548 #define _CCP10IP 0x80
5550 //==============================================================================
5553 //==============================================================================
5554 // PIE5 Bits
5556 extern __at(0x0FB9) __sfr PIE5;
5558 typedef struct
5560 unsigned TMR4IE : 1;
5561 unsigned TMR5IE : 1;
5562 unsigned TMR6IE : 1;
5563 unsigned TMR7IE : 1;
5564 unsigned TMR8IE : 1;
5565 unsigned TMR10IE : 1;
5566 unsigned TMR12IE : 1;
5567 unsigned TMR7GIE : 1;
5568 } __PIE5bits_t;
5570 extern __at(0x0FB9) volatile __PIE5bits_t PIE5bits;
5572 #define _TMR4IE 0x01
5573 #define _TMR5IE 0x02
5574 #define _TMR6IE 0x04
5575 #define _TMR7IE 0x08
5576 #define _TMR8IE 0x10
5577 #define _TMR10IE 0x20
5578 #define _TMR12IE 0x40
5579 #define _TMR7GIE 0x80
5581 //==============================================================================
5584 //==============================================================================
5585 // PIR5 Bits
5587 extern __at(0x0FBA) __sfr PIR5;
5589 typedef struct
5591 unsigned TMR4IF : 1;
5592 unsigned TMR5IF : 1;
5593 unsigned TMR6IF : 1;
5594 unsigned TMR7IF : 1;
5595 unsigned TMR8IF : 1;
5596 unsigned TMR10IF : 1;
5597 unsigned TMR12IF : 1;
5598 unsigned TMR7GIF : 1;
5599 } __PIR5bits_t;
5601 extern __at(0x0FBA) volatile __PIR5bits_t PIR5bits;
5603 #define _TMR4IF 0x01
5604 #define _TMR5IF 0x02
5605 #define _TMR6IF 0x04
5606 #define _TMR7IF 0x08
5607 #define _TMR8IF 0x10
5608 #define _TMR10IF 0x20
5609 #define _TMR12IF 0x40
5610 #define _TMR7GIF 0x80
5612 //==============================================================================
5615 //==============================================================================
5616 // CCP1CON Bits
5618 extern __at(0x0FBB) __sfr CCP1CON;
5620 typedef union
5622 struct
5624 unsigned CCP1M0 : 1;
5625 unsigned CCP1M1 : 1;
5626 unsigned CCP1M2 : 1;
5627 unsigned CCP1M3 : 1;
5628 unsigned DC1B0 : 1;
5629 unsigned DC1B1 : 1;
5630 unsigned P1M0 : 1;
5631 unsigned P1M1 : 1;
5634 struct
5636 unsigned : 1;
5637 unsigned : 1;
5638 unsigned : 1;
5639 unsigned : 1;
5640 unsigned CCP1Y : 1;
5641 unsigned CCP1X : 1;
5642 unsigned : 1;
5643 unsigned : 1;
5646 struct
5648 unsigned CCP1M : 4;
5649 unsigned : 4;
5652 struct
5654 unsigned : 4;
5655 unsigned DC1B : 2;
5656 unsigned : 2;
5659 struct
5661 unsigned : 6;
5662 unsigned P1M : 2;
5664 } __CCP1CONbits_t;
5666 extern __at(0x0FBB) volatile __CCP1CONbits_t CCP1CONbits;
5668 #define _CCP1M0 0x01
5669 #define _CCP1M1 0x02
5670 #define _CCP1M2 0x04
5671 #define _CCP1M3 0x08
5672 #define _DC1B0 0x10
5673 #define _CCP1Y 0x10
5674 #define _DC1B1 0x20
5675 #define _CCP1X 0x20
5676 #define _P1M0 0x40
5677 #define _P1M1 0x80
5679 //==============================================================================
5682 //==============================================================================
5683 // ECCP1CON Bits
5685 extern __at(0x0FBB) __sfr ECCP1CON;
5687 typedef union
5689 struct
5691 unsigned CCP1M0 : 1;
5692 unsigned CCP1M1 : 1;
5693 unsigned CCP1M2 : 1;
5694 unsigned CCP1M3 : 1;
5695 unsigned DC1B0 : 1;
5696 unsigned DC1B1 : 1;
5697 unsigned P1M0 : 1;
5698 unsigned P1M1 : 1;
5701 struct
5703 unsigned : 1;
5704 unsigned : 1;
5705 unsigned : 1;
5706 unsigned : 1;
5707 unsigned CCP1Y : 1;
5708 unsigned CCP1X : 1;
5709 unsigned : 1;
5710 unsigned : 1;
5713 struct
5715 unsigned CCP1M : 4;
5716 unsigned : 4;
5719 struct
5721 unsigned : 4;
5722 unsigned DC1B : 2;
5723 unsigned : 2;
5726 struct
5728 unsigned : 6;
5729 unsigned P1M : 2;
5731 } __ECCP1CONbits_t;
5733 extern __at(0x0FBB) volatile __ECCP1CONbits_t ECCP1CONbits;
5735 #define _ECCP1CON_CCP1M0 0x01
5736 #define _ECCP1CON_CCP1M1 0x02
5737 #define _ECCP1CON_CCP1M2 0x04
5738 #define _ECCP1CON_CCP1M3 0x08
5739 #define _ECCP1CON_DC1B0 0x10
5740 #define _ECCP1CON_CCP1Y 0x10
5741 #define _ECCP1CON_DC1B1 0x20
5742 #define _ECCP1CON_CCP1X 0x20
5743 #define _ECCP1CON_P1M0 0x40
5744 #define _ECCP1CON_P1M1 0x80
5746 //==============================================================================
5748 extern __at(0x0FBC) __sfr CCPR1;
5749 extern __at(0x0FBC) __sfr CCPR1L;
5750 extern __at(0x0FBD) __sfr CCPR1H;
5752 //==============================================================================
5753 // ECCP1DEL Bits
5755 extern __at(0x0FBE) __sfr ECCP1DEL;
5757 typedef union
5759 struct
5761 unsigned P1DC0 : 1;
5762 unsigned P1DC1 : 1;
5763 unsigned P1DC2 : 1;
5764 unsigned P1DC3 : 1;
5765 unsigned P1DC4 : 1;
5766 unsigned P1DC5 : 1;
5767 unsigned P1DC6 : 1;
5768 unsigned P1RSEN : 1;
5771 struct
5773 unsigned P1DC : 7;
5774 unsigned : 1;
5776 } __ECCP1DELbits_t;
5778 extern __at(0x0FBE) volatile __ECCP1DELbits_t ECCP1DELbits;
5780 #define _P1DC0 0x01
5781 #define _P1DC1 0x02
5782 #define _P1DC2 0x04
5783 #define _P1DC3 0x08
5784 #define _P1DC4 0x10
5785 #define _P1DC5 0x20
5786 #define _P1DC6 0x40
5787 #define _P1RSEN 0x80
5789 //==============================================================================
5792 //==============================================================================
5793 // PWM1CON Bits
5795 extern __at(0x0FBE) __sfr PWM1CON;
5797 typedef union
5799 struct
5801 unsigned P1DC0 : 1;
5802 unsigned P1DC1 : 1;
5803 unsigned P1DC2 : 1;
5804 unsigned P1DC3 : 1;
5805 unsigned P1DC4 : 1;
5806 unsigned P1DC5 : 1;
5807 unsigned P1DC6 : 1;
5808 unsigned P1RSEN : 1;
5811 struct
5813 unsigned P1DC : 7;
5814 unsigned : 1;
5816 } __PWM1CONbits_t;
5818 extern __at(0x0FBE) volatile __PWM1CONbits_t PWM1CONbits;
5820 #define _PWM1CON_P1DC0 0x01
5821 #define _PWM1CON_P1DC1 0x02
5822 #define _PWM1CON_P1DC2 0x04
5823 #define _PWM1CON_P1DC3 0x08
5824 #define _PWM1CON_P1DC4 0x10
5825 #define _PWM1CON_P1DC5 0x20
5826 #define _PWM1CON_P1DC6 0x40
5827 #define _PWM1CON_P1RSEN 0x80
5829 //==============================================================================
5832 //==============================================================================
5833 // ECCP1AS Bits
5835 extern __at(0x0FBF) __sfr ECCP1AS;
5837 typedef union
5839 struct
5841 unsigned PSS1BD0 : 1;
5842 unsigned PSS1BD1 : 1;
5843 unsigned PSS1AC0 : 1;
5844 unsigned PSS1AC1 : 1;
5845 unsigned ECCP1AS0 : 1;
5846 unsigned ECCP1AS1 : 1;
5847 unsigned ECCP1AS2 : 1;
5848 unsigned ECCP1ASE : 1;
5851 struct
5853 unsigned PSS1BD : 2;
5854 unsigned : 6;
5857 struct
5859 unsigned : 2;
5860 unsigned PSS1AC : 2;
5861 unsigned : 4;
5864 struct
5866 unsigned : 4;
5867 unsigned ECCP1AS : 3;
5868 unsigned : 1;
5870 } __ECCP1ASbits_t;
5872 extern __at(0x0FBF) volatile __ECCP1ASbits_t ECCP1ASbits;
5874 #define _PSS1BD0 0x01
5875 #define _PSS1BD1 0x02
5876 #define _PSS1AC0 0x04
5877 #define _PSS1AC1 0x08
5878 #define _ECCP1AS0 0x10
5879 #define _ECCP1AS1 0x20
5880 #define _ECCP1AS2 0x40
5881 #define _ECCP1ASE 0x80
5883 //==============================================================================
5886 //==============================================================================
5887 // ADCON2 Bits
5889 extern __at(0x0FC0) __sfr ADCON2;
5891 typedef union
5893 struct
5895 unsigned ADCS0 : 1;
5896 unsigned ADCS1 : 1;
5897 unsigned ADCS2 : 1;
5898 unsigned ACQT0 : 1;
5899 unsigned ACQT1 : 1;
5900 unsigned ACQT2 : 1;
5901 unsigned : 1;
5902 unsigned ADFM : 1;
5905 struct
5907 unsigned ADCS : 3;
5908 unsigned : 5;
5911 struct
5913 unsigned : 3;
5914 unsigned ACQT : 3;
5915 unsigned : 2;
5917 } __ADCON2bits_t;
5919 extern __at(0x0FC0) volatile __ADCON2bits_t ADCON2bits;
5921 #define _ADCS0 0x01
5922 #define _ADCS1 0x02
5923 #define _ADCS2 0x04
5924 #define _ACQT0 0x08
5925 #define _ACQT1 0x10
5926 #define _ACQT2 0x20
5927 #define _ADFM 0x80
5929 //==============================================================================
5932 //==============================================================================
5933 // ADCON1 Bits
5935 extern __at(0x0FC1) __sfr ADCON1;
5937 typedef union
5939 struct
5941 unsigned CHSN0 : 1;
5942 unsigned CHSN1 : 1;
5943 unsigned CHSN2 : 1;
5944 unsigned VNCFG : 1;
5945 unsigned VCFG0 : 1;
5946 unsigned VCFG1 : 1;
5947 unsigned TRIGSEL0 : 1;
5948 unsigned TRIGSEL1 : 1;
5951 struct
5953 unsigned CHSN : 3;
5954 unsigned : 5;
5957 struct
5959 unsigned : 4;
5960 unsigned VCFG : 2;
5961 unsigned : 2;
5964 struct
5966 unsigned : 6;
5967 unsigned TRIGSEL : 2;
5969 } __ADCON1bits_t;
5971 extern __at(0x0FC1) volatile __ADCON1bits_t ADCON1bits;
5973 #define _CHSN0 0x01
5974 #define _CHSN1 0x02
5975 #define _CHSN2 0x04
5976 #define _VNCFG 0x08
5977 #define _VCFG0 0x10
5978 #define _VCFG1 0x20
5979 #define _TRIGSEL0 0x40
5980 #define _TRIGSEL1 0x80
5982 //==============================================================================
5985 //==============================================================================
5986 // ADCON0 Bits
5988 extern __at(0x0FC2) __sfr ADCON0;
5990 typedef union
5992 struct
5994 unsigned ADON : 1;
5995 unsigned GO_NOT_DONE : 1;
5996 unsigned CHS0 : 1;
5997 unsigned CHS1 : 1;
5998 unsigned CHS2 : 1;
5999 unsigned CHS3 : 1;
6000 unsigned CHS4 : 1;
6001 unsigned : 1;
6004 struct
6006 unsigned : 1;
6007 unsigned DONE : 1;
6008 unsigned : 1;
6009 unsigned : 1;
6010 unsigned : 1;
6011 unsigned : 1;
6012 unsigned : 1;
6013 unsigned : 1;
6016 struct
6018 unsigned : 1;
6019 unsigned GO : 1;
6020 unsigned : 1;
6021 unsigned : 1;
6022 unsigned : 1;
6023 unsigned : 1;
6024 unsigned : 1;
6025 unsigned : 1;
6028 struct
6030 unsigned : 1;
6031 unsigned NOT_DONE : 1;
6032 unsigned : 1;
6033 unsigned : 1;
6034 unsigned : 1;
6035 unsigned : 1;
6036 unsigned : 1;
6037 unsigned : 1;
6040 struct
6042 unsigned : 2;
6043 unsigned CHS : 5;
6044 unsigned : 1;
6046 } __ADCON0bits_t;
6048 extern __at(0x0FC2) volatile __ADCON0bits_t ADCON0bits;
6050 #define _ADON 0x01
6051 #define _GO_NOT_DONE 0x02
6052 #define _DONE 0x02
6053 #define _GO 0x02
6054 #define _NOT_DONE 0x02
6055 #define _CHS0 0x04
6056 #define _CHS1 0x08
6057 #define _CHS2 0x10
6058 #define _CHS3 0x20
6059 #define _CHS4 0x40
6061 //==============================================================================
6063 extern __at(0x0FC3) __sfr ADRES;
6064 extern __at(0x0FC3) __sfr ADRESL;
6065 extern __at(0x0FC4) __sfr ADRESH;
6067 //==============================================================================
6068 // SSP1CON2 Bits
6070 extern __at(0x0FC5) __sfr SSP1CON2;
6072 typedef union
6074 struct
6076 unsigned SEN : 1;
6077 unsigned RSEN : 1;
6078 unsigned PEN : 1;
6079 unsigned RCEN : 1;
6080 unsigned ACKEN : 1;
6081 unsigned ACKDT : 1;
6082 unsigned ACKSTAT : 1;
6083 unsigned GCEN : 1;
6086 struct
6088 unsigned : 1;
6089 unsigned ADMSK1 : 1;
6090 unsigned ADMSK2 : 1;
6091 unsigned ADMSK3 : 1;
6092 unsigned ADMSK4 : 1;
6093 unsigned ADMSK5 : 1;
6094 unsigned : 1;
6095 unsigned : 1;
6097 } __SSP1CON2bits_t;
6099 extern __at(0x0FC5) volatile __SSP1CON2bits_t SSP1CON2bits;
6101 #define _SEN 0x01
6102 #define _RSEN 0x02
6103 #define _ADMSK1 0x02
6104 #define _PEN 0x04
6105 #define _ADMSK2 0x04
6106 #define _RCEN 0x08
6107 #define _ADMSK3 0x08
6108 #define _ACKEN 0x10
6109 #define _ADMSK4 0x10
6110 #define _ACKDT 0x20
6111 #define _ADMSK5 0x20
6112 #define _ACKSTAT 0x40
6113 #define _GCEN 0x80
6115 //==============================================================================
6118 //==============================================================================
6119 // SSPCON2 Bits
6121 extern __at(0x0FC5) __sfr SSPCON2;
6123 typedef union
6125 struct
6127 unsigned SEN : 1;
6128 unsigned RSEN : 1;
6129 unsigned PEN : 1;
6130 unsigned RCEN : 1;
6131 unsigned ACKEN : 1;
6132 unsigned ACKDT : 1;
6133 unsigned ACKSTAT : 1;
6134 unsigned GCEN : 1;
6137 struct
6139 unsigned : 1;
6140 unsigned ADMSK1 : 1;
6141 unsigned ADMSK2 : 1;
6142 unsigned ADMSK3 : 1;
6143 unsigned ADMSK4 : 1;
6144 unsigned ADMSK5 : 1;
6145 unsigned : 1;
6146 unsigned : 1;
6148 } __SSPCON2bits_t;
6150 extern __at(0x0FC5) volatile __SSPCON2bits_t SSPCON2bits;
6152 #define _SSPCON2_SEN 0x01
6153 #define _SSPCON2_RSEN 0x02
6154 #define _SSPCON2_ADMSK1 0x02
6155 #define _SSPCON2_PEN 0x04
6156 #define _SSPCON2_ADMSK2 0x04
6157 #define _SSPCON2_RCEN 0x08
6158 #define _SSPCON2_ADMSK3 0x08
6159 #define _SSPCON2_ACKEN 0x10
6160 #define _SSPCON2_ADMSK4 0x10
6161 #define _SSPCON2_ACKDT 0x20
6162 #define _SSPCON2_ADMSK5 0x20
6163 #define _SSPCON2_ACKSTAT 0x40
6164 #define _SSPCON2_GCEN 0x80
6166 //==============================================================================
6169 //==============================================================================
6170 // SSP1CON1 Bits
6172 extern __at(0x0FC6) __sfr SSP1CON1;
6174 typedef union
6176 struct
6178 unsigned SSPM0 : 1;
6179 unsigned SSPM1 : 1;
6180 unsigned SSPM2 : 1;
6181 unsigned SSPM3 : 1;
6182 unsigned CKP : 1;
6183 unsigned SSPEN : 1;
6184 unsigned SSPOV : 1;
6185 unsigned WCOL : 1;
6188 struct
6190 unsigned SSPM : 4;
6191 unsigned : 4;
6193 } __SSP1CON1bits_t;
6195 extern __at(0x0FC6) volatile __SSP1CON1bits_t SSP1CON1bits;
6197 #define _SSPM0 0x01
6198 #define _SSPM1 0x02
6199 #define _SSPM2 0x04
6200 #define _SSPM3 0x08
6201 #define _CKP 0x10
6202 #define _SSPEN 0x20
6203 #define _SSPOV 0x40
6204 #define _WCOL 0x80
6206 //==============================================================================
6209 //==============================================================================
6210 // SSPCON1 Bits
6212 extern __at(0x0FC6) __sfr SSPCON1;
6214 typedef union
6216 struct
6218 unsigned SSPM0 : 1;
6219 unsigned SSPM1 : 1;
6220 unsigned SSPM2 : 1;
6221 unsigned SSPM3 : 1;
6222 unsigned CKP : 1;
6223 unsigned SSPEN : 1;
6224 unsigned SSPOV : 1;
6225 unsigned WCOL : 1;
6228 struct
6230 unsigned SSPM : 4;
6231 unsigned : 4;
6233 } __SSPCON1bits_t;
6235 extern __at(0x0FC6) volatile __SSPCON1bits_t SSPCON1bits;
6237 #define _SSPCON1_SSPM0 0x01
6238 #define _SSPCON1_SSPM1 0x02
6239 #define _SSPCON1_SSPM2 0x04
6240 #define _SSPCON1_SSPM3 0x08
6241 #define _SSPCON1_CKP 0x10
6242 #define _SSPCON1_SSPEN 0x20
6243 #define _SSPCON1_SSPOV 0x40
6244 #define _SSPCON1_WCOL 0x80
6246 //==============================================================================
6249 //==============================================================================
6250 // SSP1STAT Bits
6252 extern __at(0x0FC7) __sfr SSP1STAT;
6254 typedef union
6256 struct
6258 unsigned BF : 1;
6259 unsigned UA : 1;
6260 unsigned R_NOT_W : 1;
6261 unsigned S : 1;
6262 unsigned P : 1;
6263 unsigned D_NOT_A : 1;
6264 unsigned CKE : 1;
6265 unsigned SMP : 1;
6268 struct
6270 unsigned : 1;
6271 unsigned : 1;
6272 unsigned R : 1;
6273 unsigned I2C_START : 1;
6274 unsigned I2C_STOP : 1;
6275 unsigned D : 1;
6276 unsigned : 1;
6277 unsigned : 1;
6280 struct
6282 unsigned : 1;
6283 unsigned : 1;
6284 unsigned R_W : 1;
6285 unsigned : 1;
6286 unsigned : 1;
6287 unsigned D_A : 1;
6288 unsigned : 1;
6289 unsigned : 1;
6292 struct
6294 unsigned : 1;
6295 unsigned : 1;
6296 unsigned NOT_W : 1;
6297 unsigned : 1;
6298 unsigned : 1;
6299 unsigned NOT_A : 1;
6300 unsigned : 1;
6301 unsigned : 1;
6304 struct
6306 unsigned : 1;
6307 unsigned : 1;
6308 unsigned NOT_WRITE : 1;
6309 unsigned : 1;
6310 unsigned : 1;
6311 unsigned NOT_ADDRESS : 1;
6312 unsigned : 1;
6313 unsigned : 1;
6316 struct
6318 unsigned : 1;
6319 unsigned : 1;
6320 unsigned READ_WRITE : 1;
6321 unsigned : 1;
6322 unsigned : 1;
6323 unsigned DATA_ADDRESS : 1;
6324 unsigned : 1;
6325 unsigned : 1;
6328 struct
6330 unsigned : 1;
6331 unsigned : 1;
6332 unsigned I2C_READ : 1;
6333 unsigned : 1;
6334 unsigned : 1;
6335 unsigned I2C_DAT : 1;
6336 unsigned : 1;
6337 unsigned : 1;
6339 } __SSP1STATbits_t;
6341 extern __at(0x0FC7) volatile __SSP1STATbits_t SSP1STATbits;
6343 #define _BF 0x01
6344 #define _UA 0x02
6345 #define _R_NOT_W 0x04
6346 #define _R 0x04
6347 #define _R_W 0x04
6348 #define _NOT_W 0x04
6349 #define _NOT_WRITE 0x04
6350 #define _READ_WRITE 0x04
6351 #define _I2C_READ 0x04
6352 #define _S 0x08
6353 #define _I2C_START 0x08
6354 #define _P 0x10
6355 #define _I2C_STOP 0x10
6356 #define _D_NOT_A 0x20
6357 #define _D 0x20
6358 #define _D_A 0x20
6359 #define _NOT_A 0x20
6360 #define _NOT_ADDRESS 0x20
6361 #define _DATA_ADDRESS 0x20
6362 #define _I2C_DAT 0x20
6363 #define _CKE 0x40
6364 #define _SMP 0x80
6366 //==============================================================================
6369 //==============================================================================
6370 // SSPSTAT Bits
6372 extern __at(0x0FC7) __sfr SSPSTAT;
6374 typedef union
6376 struct
6378 unsigned BF : 1;
6379 unsigned UA : 1;
6380 unsigned R_NOT_W : 1;
6381 unsigned S : 1;
6382 unsigned P : 1;
6383 unsigned D_NOT_A : 1;
6384 unsigned CKE : 1;
6385 unsigned SMP : 1;
6388 struct
6390 unsigned : 1;
6391 unsigned : 1;
6392 unsigned R : 1;
6393 unsigned I2C_START : 1;
6394 unsigned I2C_STOP : 1;
6395 unsigned D : 1;
6396 unsigned : 1;
6397 unsigned : 1;
6400 struct
6402 unsigned : 1;
6403 unsigned : 1;
6404 unsigned R_W : 1;
6405 unsigned : 1;
6406 unsigned : 1;
6407 unsigned D_A : 1;
6408 unsigned : 1;
6409 unsigned : 1;
6412 struct
6414 unsigned : 1;
6415 unsigned : 1;
6416 unsigned NOT_W : 1;
6417 unsigned : 1;
6418 unsigned : 1;
6419 unsigned NOT_A : 1;
6420 unsigned : 1;
6421 unsigned : 1;
6424 struct
6426 unsigned : 1;
6427 unsigned : 1;
6428 unsigned NOT_WRITE : 1;
6429 unsigned : 1;
6430 unsigned : 1;
6431 unsigned NOT_ADDRESS : 1;
6432 unsigned : 1;
6433 unsigned : 1;
6436 struct
6438 unsigned : 1;
6439 unsigned : 1;
6440 unsigned READ_WRITE : 1;
6441 unsigned : 1;
6442 unsigned : 1;
6443 unsigned DATA_ADDRESS : 1;
6444 unsigned : 1;
6445 unsigned : 1;
6448 struct
6450 unsigned : 1;
6451 unsigned : 1;
6452 unsigned I2C_READ : 1;
6453 unsigned : 1;
6454 unsigned : 1;
6455 unsigned I2C_DAT : 1;
6456 unsigned : 1;
6457 unsigned : 1;
6459 } __SSPSTATbits_t;
6461 extern __at(0x0FC7) volatile __SSPSTATbits_t SSPSTATbits;
6463 #define _SSPSTAT_BF 0x01
6464 #define _SSPSTAT_UA 0x02
6465 #define _SSPSTAT_R_NOT_W 0x04
6466 #define _SSPSTAT_R 0x04
6467 #define _SSPSTAT_R_W 0x04
6468 #define _SSPSTAT_NOT_W 0x04
6469 #define _SSPSTAT_NOT_WRITE 0x04
6470 #define _SSPSTAT_READ_WRITE 0x04
6471 #define _SSPSTAT_I2C_READ 0x04
6472 #define _SSPSTAT_S 0x08
6473 #define _SSPSTAT_I2C_START 0x08
6474 #define _SSPSTAT_P 0x10
6475 #define _SSPSTAT_I2C_STOP 0x10
6476 #define _SSPSTAT_D_NOT_A 0x20
6477 #define _SSPSTAT_D 0x20
6478 #define _SSPSTAT_D_A 0x20
6479 #define _SSPSTAT_NOT_A 0x20
6480 #define _SSPSTAT_NOT_ADDRESS 0x20
6481 #define _SSPSTAT_DATA_ADDRESS 0x20
6482 #define _SSPSTAT_I2C_DAT 0x20
6483 #define _SSPSTAT_CKE 0x40
6484 #define _SSPSTAT_SMP 0x80
6486 //==============================================================================
6488 extern __at(0x0FC8) __sfr SSP1ADD;
6490 //==============================================================================
6491 // SSP1MSK Bits
6493 extern __at(0x0FC8) __sfr SSP1MSK;
6495 typedef struct
6497 unsigned MSK0 : 1;
6498 unsigned MSK1 : 1;
6499 unsigned MSK2 : 1;
6500 unsigned MSK3 : 1;
6501 unsigned MSK4 : 1;
6502 unsigned MSK5 : 1;
6503 unsigned MSK6 : 1;
6504 unsigned MSK7 : 1;
6505 } __SSP1MSKbits_t;
6507 extern __at(0x0FC8) volatile __SSP1MSKbits_t SSP1MSKbits;
6509 #define _MSK0 0x01
6510 #define _MSK1 0x02
6511 #define _MSK2 0x04
6512 #define _MSK3 0x08
6513 #define _MSK4 0x10
6514 #define _MSK5 0x20
6515 #define _MSK6 0x40
6516 #define _MSK7 0x80
6518 //==============================================================================
6520 extern __at(0x0FC8) __sfr SSPADD;
6521 extern __at(0x0FC9) __sfr SSP1BUF;
6522 extern __at(0x0FC9) __sfr SSPBUF;
6524 //==============================================================================
6525 // T2CON Bits
6527 extern __at(0x0FCA) __sfr T2CON;
6529 typedef union
6531 struct
6533 unsigned T2CKPS0 : 1;
6534 unsigned T2CKPS1 : 1;
6535 unsigned TMR2ON : 1;
6536 unsigned T2OUTPS0 : 1;
6537 unsigned T2OUTPS1 : 1;
6538 unsigned T2OUTPS2 : 1;
6539 unsigned T2OUTPS3 : 1;
6540 unsigned : 1;
6543 struct
6545 unsigned T2CKPS : 2;
6546 unsigned : 6;
6549 struct
6551 unsigned : 3;
6552 unsigned T2OUTPS : 4;
6553 unsigned : 1;
6555 } __T2CONbits_t;
6557 extern __at(0x0FCA) volatile __T2CONbits_t T2CONbits;
6559 #define _T2CKPS0 0x01
6560 #define _T2CKPS1 0x02
6561 #define _TMR2ON 0x04
6562 #define _T2OUTPS0 0x08
6563 #define _T2OUTPS1 0x10
6564 #define _T2OUTPS2 0x20
6565 #define _T2OUTPS3 0x40
6567 //==============================================================================
6569 extern __at(0x0FCB) __sfr PR2;
6570 extern __at(0x0FCC) __sfr TMR2;
6572 //==============================================================================
6573 // T1CON Bits
6575 extern __at(0x0FCD) __sfr T1CON;
6577 typedef union
6579 struct
6581 unsigned TMR1ON : 1;
6582 unsigned RD16 : 1;
6583 unsigned NOT_T1SYNC : 1;
6584 unsigned SOSCEN : 1;
6585 unsigned T1CKPS0 : 1;
6586 unsigned T1CKPS1 : 1;
6587 unsigned TMR1CS0 : 1;
6588 unsigned TMR1CS1 : 1;
6591 struct
6593 unsigned : 4;
6594 unsigned T1CKPS : 2;
6595 unsigned : 2;
6598 struct
6600 unsigned : 6;
6601 unsigned TMR1CS : 2;
6603 } __T1CONbits_t;
6605 extern __at(0x0FCD) volatile __T1CONbits_t T1CONbits;
6607 #define _TMR1ON 0x01
6608 #define _RD16 0x02
6609 #define _NOT_T1SYNC 0x04
6610 #define _SOSCEN 0x08
6611 #define _T1CKPS0 0x10
6612 #define _T1CKPS1 0x20
6613 #define _TMR1CS0 0x40
6614 #define _TMR1CS1 0x80
6616 //==============================================================================
6618 extern __at(0x0FCE) __sfr TMR1;
6619 extern __at(0x0FCE) __sfr TMR1L;
6620 extern __at(0x0FCF) __sfr TMR1H;
6622 //==============================================================================
6623 // RCON Bits
6625 extern __at(0x0FD0) __sfr RCON;
6627 typedef union
6629 struct
6631 unsigned NOT_BOR : 1;
6632 unsigned NOT_POR : 1;
6633 unsigned NOT_PD : 1;
6634 unsigned NOT_TO : 1;
6635 unsigned NOT_RI : 1;
6636 unsigned NOT_CM : 1;
6637 unsigned SBOREN : 1;
6638 unsigned IPEN : 1;
6641 struct
6643 unsigned BOR : 1;
6644 unsigned POR : 1;
6645 unsigned PD : 1;
6646 unsigned TO : 1;
6647 unsigned RI : 1;
6648 unsigned CM : 1;
6649 unsigned : 1;
6650 unsigned : 1;
6652 } __RCONbits_t;
6654 extern __at(0x0FD0) volatile __RCONbits_t RCONbits;
6656 #define _NOT_BOR 0x01
6657 #define _BOR 0x01
6658 #define _NOT_POR 0x02
6659 #define _POR 0x02
6660 #define _NOT_PD 0x04
6661 #define _PD 0x04
6662 #define _NOT_TO 0x08
6663 #define _TO 0x08
6664 #define _NOT_RI 0x10
6665 #define _RI 0x10
6666 #define _NOT_CM 0x20
6667 #define _CM 0x20
6668 #define _SBOREN 0x40
6669 #define _IPEN 0x80
6671 //==============================================================================
6674 //==============================================================================
6675 // WDTCON Bits
6677 extern __at(0x0FD1) __sfr WDTCON;
6679 typedef union
6681 struct
6683 unsigned SWDTEN : 1;
6684 unsigned ULPSINK : 1;
6685 unsigned ULPEN : 1;
6686 unsigned : 1;
6687 unsigned SRETEN : 1;
6688 unsigned ULPLVL : 1;
6689 unsigned : 1;
6690 unsigned REGSLP : 1;
6693 struct
6695 unsigned SWDTE : 1;
6696 unsigned : 1;
6697 unsigned : 1;
6698 unsigned : 1;
6699 unsigned : 1;
6700 unsigned : 1;
6701 unsigned : 1;
6702 unsigned : 1;
6704 } __WDTCONbits_t;
6706 extern __at(0x0FD1) volatile __WDTCONbits_t WDTCONbits;
6708 #define _SWDTEN 0x01
6709 #define _SWDTE 0x01
6710 #define _ULPSINK 0x02
6711 #define _ULPEN 0x04
6712 #define _SRETEN 0x10
6713 #define _ULPLVL 0x20
6714 #define _REGSLP 0x80
6716 //==============================================================================
6719 //==============================================================================
6720 // IPR5 Bits
6722 extern __at(0x0FD2) __sfr IPR5;
6724 typedef struct
6726 unsigned TMR4IP : 1;
6727 unsigned TMR5IP : 1;
6728 unsigned TMR6IP : 1;
6729 unsigned TMR7IP : 1;
6730 unsigned TMR8IP : 1;
6731 unsigned TMR10IP : 1;
6732 unsigned TMR12IP : 1;
6733 unsigned TMR7GIP : 1;
6734 } __IPR5bits_t;
6736 extern __at(0x0FD2) volatile __IPR5bits_t IPR5bits;
6738 #define _TMR4IP 0x01
6739 #define _TMR5IP 0x02
6740 #define _TMR6IP 0x04
6741 #define _TMR7IP 0x08
6742 #define _TMR8IP 0x10
6743 #define _TMR10IP 0x20
6744 #define _TMR12IP 0x40
6745 #define _TMR7GIP 0x80
6747 //==============================================================================
6750 //==============================================================================
6751 // OSCCON Bits
6753 extern __at(0x0FD3) __sfr OSCCON;
6755 typedef union
6757 struct
6759 unsigned SCS0 : 1;
6760 unsigned SCS1 : 1;
6761 unsigned HFIOFS : 1;
6762 unsigned OSTS : 1;
6763 unsigned IRCF0 : 1;
6764 unsigned IRCF1 : 1;
6765 unsigned IRCF2 : 1;
6766 unsigned IDLEN : 1;
6769 struct
6771 unsigned SCS : 2;
6772 unsigned : 6;
6775 struct
6777 unsigned : 4;
6778 unsigned IRCF : 3;
6779 unsigned : 1;
6781 } __OSCCONbits_t;
6783 extern __at(0x0FD3) volatile __OSCCONbits_t OSCCONbits;
6785 #define _SCS0 0x01
6786 #define _SCS1 0x02
6787 #define _HFIOFS 0x04
6788 #define _OSTS 0x08
6789 #define _IRCF0 0x10
6790 #define _IRCF1 0x20
6791 #define _IRCF2 0x40
6792 #define _IDLEN 0x80
6794 //==============================================================================
6796 extern __at(0x0FD4) __sfr SPBRGH1;
6798 //==============================================================================
6799 // T0CON Bits
6801 extern __at(0x0FD5) __sfr T0CON;
6803 typedef union
6805 struct
6807 unsigned T0PS0 : 1;
6808 unsigned T0PS1 : 1;
6809 unsigned T0PS2 : 1;
6810 unsigned PSA : 1;
6811 unsigned T0SE : 1;
6812 unsigned T0CS : 1;
6813 unsigned T08BIT : 1;
6814 unsigned TMR0ON : 1;
6817 struct
6819 unsigned T0PS : 3;
6820 unsigned : 5;
6822 } __T0CONbits_t;
6824 extern __at(0x0FD5) volatile __T0CONbits_t T0CONbits;
6826 #define _T0PS0 0x01
6827 #define _T0PS1 0x02
6828 #define _T0PS2 0x04
6829 #define _PSA 0x08
6830 #define _T0SE 0x10
6831 #define _T0CS 0x20
6832 #define _T08BIT 0x40
6833 #define _TMR0ON 0x80
6835 //==============================================================================
6837 extern __at(0x0FD6) __sfr TMR0;
6838 extern __at(0x0FD6) __sfr TMR0L;
6839 extern __at(0x0FD7) __sfr TMR0H;
6841 //==============================================================================
6842 // STATUS Bits
6844 extern __at(0x0FD8) __sfr STATUS;
6846 typedef struct
6848 unsigned C : 1;
6849 unsigned DC : 1;
6850 unsigned Z : 1;
6851 unsigned OV : 1;
6852 unsigned N : 1;
6853 unsigned : 1;
6854 unsigned : 1;
6855 unsigned : 1;
6856 } __STATUSbits_t;
6858 extern __at(0x0FD8) volatile __STATUSbits_t STATUSbits;
6860 #define _C 0x01
6861 #define _DC 0x02
6862 #define _Z 0x04
6863 #define _OV 0x08
6864 #define _N 0x10
6866 //==============================================================================
6868 extern __at(0x0FD9) __sfr FSR2L;
6869 extern __at(0x0FDA) __sfr FSR2H;
6870 extern __at(0x0FDB) __sfr PLUSW2;
6871 extern __at(0x0FDC) __sfr PREINC2;
6872 extern __at(0x0FDD) __sfr POSTDEC2;
6873 extern __at(0x0FDE) __sfr POSTINC2;
6874 extern __at(0x0FDF) __sfr INDF2;
6875 extern __at(0x0FE0) __sfr BSR;
6876 extern __at(0x0FE1) __sfr FSR1L;
6877 extern __at(0x0FE2) __sfr FSR1H;
6878 extern __at(0x0FE3) __sfr PLUSW1;
6879 extern __at(0x0FE4) __sfr PREINC1;
6880 extern __at(0x0FE5) __sfr POSTDEC1;
6881 extern __at(0x0FE6) __sfr POSTINC1;
6882 extern __at(0x0FE7) __sfr INDF1;
6883 extern __at(0x0FE8) __sfr WREG;
6884 extern __at(0x0FE9) __sfr FSR0L;
6885 extern __at(0x0FEA) __sfr FSR0H;
6886 extern __at(0x0FEB) __sfr PLUSW0;
6887 extern __at(0x0FEC) __sfr PREINC0;
6888 extern __at(0x0FED) __sfr POSTDEC0;
6889 extern __at(0x0FEE) __sfr POSTINC0;
6890 extern __at(0x0FEF) __sfr INDF0;
6892 //==============================================================================
6893 // INTCON3 Bits
6895 extern __at(0x0FF0) __sfr INTCON3;
6897 typedef union
6899 struct
6901 unsigned INT1IF : 1;
6902 unsigned INT2IF : 1;
6903 unsigned INT3IF : 1;
6904 unsigned INT1IE : 1;
6905 unsigned INT2IE : 1;
6906 unsigned INT3IE : 1;
6907 unsigned INT1IP : 1;
6908 unsigned INT2IP : 1;
6911 struct
6913 unsigned INT1F : 1;
6914 unsigned INT2F : 1;
6915 unsigned INT3F : 1;
6916 unsigned INT1E : 1;
6917 unsigned INT2E : 1;
6918 unsigned INT3E : 1;
6919 unsigned INT1P : 1;
6920 unsigned INT2P : 1;
6922 } __INTCON3bits_t;
6924 extern __at(0x0FF0) volatile __INTCON3bits_t INTCON3bits;
6926 #define _INT1IF 0x01
6927 #define _INT1F 0x01
6928 #define _INT2IF 0x02
6929 #define _INT2F 0x02
6930 #define _INT3IF 0x04
6931 #define _INT3F 0x04
6932 #define _INT1IE 0x08
6933 #define _INT1E 0x08
6934 #define _INT2IE 0x10
6935 #define _INT2E 0x10
6936 #define _INT3IE 0x20
6937 #define _INT3E 0x20
6938 #define _INT1IP 0x40
6939 #define _INT1P 0x40
6940 #define _INT2IP 0x80
6941 #define _INT2P 0x80
6943 //==============================================================================
6946 //==============================================================================
6947 // INTCON2 Bits
6949 extern __at(0x0FF1) __sfr INTCON2;
6951 typedef union
6953 struct
6955 unsigned RBIP : 1;
6956 unsigned INT3IP : 1;
6957 unsigned TMR0IP : 1;
6958 unsigned INTEDG3 : 1;
6959 unsigned INTEDG2 : 1;
6960 unsigned INTEDG1 : 1;
6961 unsigned INTEDG0 : 1;
6962 unsigned NOT_RBPU : 1;
6965 struct
6967 unsigned : 1;
6968 unsigned INT3P : 1;
6969 unsigned T0IP : 1;
6970 unsigned : 1;
6971 unsigned : 1;
6972 unsigned : 1;
6973 unsigned : 1;
6974 unsigned RBPU : 1;
6976 } __INTCON2bits_t;
6978 extern __at(0x0FF1) volatile __INTCON2bits_t INTCON2bits;
6980 #define _RBIP 0x01
6981 #define _INT3IP 0x02
6982 #define _INT3P 0x02
6983 #define _TMR0IP 0x04
6984 #define _T0IP 0x04
6985 #define _INTEDG3 0x08
6986 #define _INTEDG2 0x10
6987 #define _INTEDG1 0x20
6988 #define _INTEDG0 0x40
6989 #define _NOT_RBPU 0x80
6990 #define _RBPU 0x80
6992 //==============================================================================
6995 //==============================================================================
6996 // INTCON Bits
6998 extern __at(0x0FF2) __sfr INTCON;
7000 typedef union
7002 struct
7004 unsigned RBIF : 1;
7005 unsigned INT0IF : 1;
7006 unsigned TMR0IF : 1;
7007 unsigned RBIE : 1;
7008 unsigned INT0IE : 1;
7009 unsigned TMR0IE : 1;
7010 unsigned PEIE_GIEL : 1;
7011 unsigned GIE_GIEH : 1;
7014 struct
7016 unsigned : 1;
7017 unsigned INT0F : 1;
7018 unsigned T0IF : 1;
7019 unsigned : 1;
7020 unsigned INT0E : 1;
7021 unsigned T0IE : 1;
7022 unsigned PEIE : 1;
7023 unsigned GIE : 1;
7026 struct
7028 unsigned : 1;
7029 unsigned : 1;
7030 unsigned : 1;
7031 unsigned : 1;
7032 unsigned : 1;
7033 unsigned : 1;
7034 unsigned GIEL : 1;
7035 unsigned GIEH : 1;
7037 } __INTCONbits_t;
7039 extern __at(0x0FF2) volatile __INTCONbits_t INTCONbits;
7041 #define _RBIF 0x01
7042 #define _INT0IF 0x02
7043 #define _INT0F 0x02
7044 #define _TMR0IF 0x04
7045 #define _T0IF 0x04
7046 #define _RBIE 0x08
7047 #define _INT0IE 0x10
7048 #define _INT0E 0x10
7049 #define _TMR0IE 0x20
7050 #define _T0IE 0x20
7051 #define _PEIE_GIEL 0x40
7052 #define _PEIE 0x40
7053 #define _GIEL 0x40
7054 #define _GIE_GIEH 0x80
7055 #define _GIE 0x80
7056 #define _GIEH 0x80
7058 //==============================================================================
7060 extern __at(0x0FF3) __sfr PROD;
7061 extern __at(0x0FF3) __sfr PRODL;
7062 extern __at(0x0FF4) __sfr PRODH;
7063 extern __at(0x0FF5) __sfr TABLAT;
7064 extern __at(0x0FF6) __sfr TBLPTR;
7065 extern __at(0x0FF6) __sfr TBLPTRL;
7066 extern __at(0x0FF7) __sfr TBLPTRH;
7067 extern __at(0x0FF8) __sfr TBLPTRU;
7068 extern __at(0x0FF9) __sfr PC;
7069 extern __at(0x0FF9) __sfr PCL;
7070 extern __at(0x0FFA) __sfr PCLATH;
7071 extern __at(0x0FFB) __sfr PCLATU;
7073 //==============================================================================
7074 // STKPTR Bits
7076 extern __at(0x0FFC) __sfr STKPTR;
7078 typedef union
7080 struct
7082 unsigned SP0 : 1;
7083 unsigned SP1 : 1;
7084 unsigned SP2 : 1;
7085 unsigned SP3 : 1;
7086 unsigned SP4 : 1;
7087 unsigned : 1;
7088 unsigned STKUNF : 1;
7089 unsigned STKFUL : 1;
7092 struct
7094 unsigned : 1;
7095 unsigned : 1;
7096 unsigned : 1;
7097 unsigned : 1;
7098 unsigned : 1;
7099 unsigned : 1;
7100 unsigned : 1;
7101 unsigned STKOVF : 1;
7104 struct
7106 unsigned SP : 5;
7107 unsigned : 3;
7109 } __STKPTRbits_t;
7111 extern __at(0x0FFC) volatile __STKPTRbits_t STKPTRbits;
7113 #define _SP0 0x01
7114 #define _SP1 0x02
7115 #define _SP2 0x04
7116 #define _SP3 0x08
7117 #define _SP4 0x10
7118 #define _STKUNF 0x40
7119 #define _STKFUL 0x80
7120 #define _STKOVF 0x80
7122 //==============================================================================
7124 extern __at(0x0FFD) __sfr TOS;
7125 extern __at(0x0FFD) __sfr TOSL;
7126 extern __at(0x0FFE) __sfr TOSH;
7127 extern __at(0x0FFF) __sfr TOSU;
7129 //==============================================================================
7131 // Configuration Bits
7133 //==============================================================================
7135 #define __CONFIG1L 0x300000
7136 #define __CONFIG1H 0x300001
7137 #define __CONFIG2L 0x300002
7138 #define __CONFIG2H 0x300003
7139 #define __CONFIG3L 0x300004
7140 #define __CONFIG3H 0x300005
7141 #define __CONFIG4L 0x300006
7142 #define __CONFIG5L 0x300008
7143 #define __CONFIG5H 0x300009
7144 #define __CONFIG6L 0x30000A
7145 #define __CONFIG6H 0x30000B
7146 #define __CONFIG7L 0x30000C
7147 #define __CONFIG7H 0x30000D
7149 //----------------------------- CONFIG1L Options -------------------------------
7151 #define _RETEN_OFF_1L 0xFE // Disabled - Controlled by SRETEN bit.
7152 #define _RETEN_ON_1L 0xFF // Enabled.
7153 #define _INTOSCSEL_LOW_1L 0xFB // LF-INTOSC in Low-power mode during Sleep.
7154 #define _INTOSCSEL_HIGH_1L 0xFF // LF-INTOSC in High-power mode during Sleep.
7155 #define _SOSCSEL_LOW_1L 0xEF // Low Power SOSC circuit selected.
7156 #define _SOSCSEL_DIG_1L 0xF7 // Digital (SCLKI) mode.
7157 #define _SOSCSEL_HIGH_1L 0xFF // High Power SOSC circuit selected.
7158 #define _XINST_OFF_1L 0xBF // Disabled.
7159 #define _XINST_ON_1L 0xFF // Enabled.
7161 //----------------------------- CONFIG1H Options -------------------------------
7163 #define _FOSC_LP_1H 0xF0 // LP oscillator.
7164 #define _FOSC_XT_1H 0xF1 // XT oscillator.
7165 #define _FOSC_HS2_1H 0xF2 // HS oscillator (High power, 16 MHz - 25 MHz).
7166 #define _FOSC_HS1_1H 0xF3 // HS oscillator (Medium power, 4 MHz - 16 MHz).
7167 #define _FOSC_EC3IO_1H 0xF4 // EC oscillator, CLKOUT function on OSC2 (High power, 16 MHz - 64 MHz).
7168 #define _FOSC_EC3_1H 0xF5 // EC oscillator (High power, 16 MHz - 64 MHz).
7169 #define _FOSC_RC_1H 0xF6 // External RC oscillator, CLKOUT function on OSC2.
7170 #define _FOSC_RCIO_1H 0xF7 // External RC oscillator.
7171 #define _FOSC_INTIO2_1H 0xF8 // Internal RC oscillator.
7172 #define _FOSC_INTIO1_1H 0xF9 // Internal RC oscillator, CLKOUT function on OSC2.
7173 #define _FOSC_EC2IO_1H 0xFA // EC oscillator, CLKOUT function on OSC2 (Medium power, 160 kHz - 16 MHz).
7174 #define _FOSC_EC2_1H 0xFB // EC oscillator (Medium power, 160 kHz - 16 MHz).
7175 #define _FOSC_EC1IO_1H 0xFC // EC oscillator, CLKOUT function on OSC2 (Low power, DC - 160 kHz).
7176 #define _FOSC_EC1_1H 0xFD // EC oscillator (Low power, DC - 160 kHz).
7177 #define _PLLCFG_OFF_1H 0xEF // Disabled.
7178 #define _PLLCFG_ON_1H 0xFF // Enabled.
7179 #define _FCMEN_OFF_1H 0xBF // Disabled.
7180 #define _FCMEN_ON_1H 0xFF // Enabled.
7181 #define _IESO_OFF_1H 0x7F // Disabled.
7182 #define _IESO_ON_1H 0xFF // Enabled.
7184 //----------------------------- CONFIG2L Options -------------------------------
7186 #define _PWRTEN_ON_2L 0xFE // Enabled.
7187 #define _PWRTEN_OFF_2L 0xFF // Disabled.
7188 #define _BOREN_OFF_2L 0xF9 // Disabled in hardware, SBOREN disabled.
7189 #define _BOREN_ON_2L 0xFB // Controlled with SBOREN bit.
7190 #define _BOREN_NOSLP_2L 0xFD // Enabled while active, disabled in SLEEP, SBOREN disabled.
7191 #define _BOREN_SBORDIS_2L 0xFF // Enabled in hardware, SBOREN disabled.
7192 #define _BORV_0_2L 0xE7 // 3.0V.
7193 #define _BORV_1_2L 0xEF // 2.7V.
7194 #define _BORV_2_2L 0xF7 // 2.0V.
7195 #define _BORV_3_2L 0xFF // 1.8V.
7196 #define _BORPWR_LOW_2L 0x9F // BORMV set to low power level.
7197 #define _BORPWR_MEDIUM_2L 0xBF // BORMV set to medium power level.
7198 #define _BORPWR_HIGH_2L 0xDF // BORMV set to high power level.
7199 #define _BORPWR_ZPBORMV_2L 0xFF // ZPBORMV instead of BORMV is selected.
7201 //----------------------------- CONFIG2H Options -------------------------------
7203 #define _WDTEN_OFF_2H 0xFC // WDT disabled in hardware; SWDTEN bit disabled.
7204 #define _WDTEN_NOSLP_2H 0xFD // WDT enabled only while device is active and disabled in Sleep mode; SWDTEN bit disabled.
7205 #define _WDTEN_ON_2H 0xFE // WDT controlled by SWDTEN bit setting.
7206 #define _WDTEN_SWDTDIS_2H 0xFF // WDT enabled in hardware; SWDTEN bit disabled.
7207 #define _WDTPS_1_2H 0x83 // 1:1.
7208 #define _WDTPS_2_2H 0x87 // 1:2.
7209 #define _WDTPS_4_2H 0x8B // 1:4.
7210 #define _WDTPS_8_2H 0x8F // 1:8.
7211 #define _WDTPS_16_2H 0x93 // 1:16.
7212 #define _WDTPS_32_2H 0x97 // 1:32.
7213 #define _WDTPS_64_2H 0x9B // 1:64.
7214 #define _WDTPS_128_2H 0x9F // 1:128.
7215 #define _WDTPS_256_2H 0xA3 // 1:256.
7216 #define _WDTPS_512_2H 0xA7 // 1:512.
7217 #define _WDTPS_1024_2H 0xAB // 1:1024.
7218 #define _WDTPS_2048_2H 0xAF // 1:2048.
7219 #define _WDTPS_4096_2H 0xB3 // 1:4096.
7220 #define _WDTPS_8192_2H 0xB7 // 1:8192.
7221 #define _WDTPS_16384_2H 0xBB // 1:16384.
7222 #define _WDTPS_32768_2H 0xBF // 1:32768.
7223 #define _WDTPS_65536_2H 0xC3 // 1:65536.
7224 #define _WDTPS_131072_2H 0xC7 // 1:131072.
7225 #define _WDTPS_262144_2H 0xCB // 1:262144.
7226 #define _WDTPS_524288_2H 0xCF // 1:524288.
7227 #define _WDTPS_1048576_2H 0xFF // 1:1048576.
7229 //----------------------------- CONFIG3L Options -------------------------------
7231 #define _RTCOSC_INTOSCREF_3L 0xFE // RTCC uses INTRC.
7232 #define _RTCOSC_SOSCREF_3L 0xFF // RTCC uses SOSC.
7234 //----------------------------- CONFIG3H Options -------------------------------
7236 #define _CCP2MX_PORTBE_3H 0xFE // RE7-Microcontroller Mode/RB3-All other modes.
7237 #define _CCP2MX_PORTC_3H 0xFF // RC1.
7238 #define _MSSPMSK_MSK5_3H 0xF7 // 5 bit address masking mode.
7239 #define _MSSPMSK_MSK7_3H 0xFF // 7 Bit address masking mode.
7240 #define _MCLRE_OFF_3H 0x7F // MCLR Disabled, RG5 Enabled.
7241 #define _MCLRE_ON_3H 0xFF // MCLR Enabled, RG5 Disabled.
7243 //----------------------------- CONFIG4L Options -------------------------------
7245 #define _STVREN_OFF_4L 0xFE // Disabled.
7246 #define _STVREN_ON_4L 0xFF // Enabled.
7247 #define _BBSIZ_BB1K_4L 0xEF // 1K word Boot Block size.
7248 #define _BBSIZ_BB2K_4L 0xFF // 2K word Boot Block size.
7249 #define _DEBUG_ON_4L 0x7F // Enabled.
7250 #define _DEBUG_OFF_4L 0xFF // Disabled.
7252 //----------------------------- CONFIG5L Options -------------------------------
7254 #define _CP0_ON_5L 0xFE // Enabled.
7255 #define _CP0_OFF_5L 0xFF // Disabled.
7256 #define _CP1_ON_5L 0xFD // Enabled.
7257 #define _CP1_OFF_5L 0xFF // Disabled.
7258 #define _CP2_ON_5L 0xFB // Enabled.
7259 #define _CP2_OFF_5L 0xFF // Disabled.
7260 #define _CP3_ON_5L 0xF7 // Enabled.
7261 #define _CP3_OFF_5L 0xFF // Disabled.
7263 //----------------------------- CONFIG5H Options -------------------------------
7265 #define _CPB_ON_5H 0xBF // Enabled.
7266 #define _CPB_OFF_5H 0xFF // Disabled.
7267 #define _CPD_ON_5H 0x7F // Enabled.
7268 #define _CPD_OFF_5H 0xFF // Disabled.
7270 //----------------------------- CONFIG6L Options -------------------------------
7272 #define _WRT0_ON_6L 0xFE // Enabled.
7273 #define _WRT0_OFF_6L 0xFF // Disabled.
7274 #define _WRT1_ON_6L 0xFD // Enabled.
7275 #define _WRT1_OFF_6L 0xFF // Disabled.
7276 #define _WRT2_ON_6L 0xFB // Enabled.
7277 #define _WRT2_OFF_6L 0xFF // Disabled.
7278 #define _WRT3_ON_6L 0xF7 // Enabled.
7279 #define _WRT3_OFF_6L 0xFF // Disabled.
7281 //----------------------------- CONFIG6H Options -------------------------------
7283 #define _WRTC_ON_6H 0xDF // Enabled.
7284 #define _WRTC_OFF_6H 0xFF // Disabled.
7285 #define _WRTB_ON_6H 0xBF // Enabled.
7286 #define _WRTB_OFF_6H 0xFF // Disabled.
7287 #define _WRTD_ON_6H 0x7F // Enabled.
7288 #define _WRTD_OFF_6H 0xFF // Disabled.
7290 //----------------------------- CONFIG7L Options -------------------------------
7292 #define _EBRT0_ON_7L 0xFE // Enabled.
7293 #define _EBRT0_OFF_7L 0xFF // Disabled.
7294 #define _EBRT1_ON_7L 0xFD // Enabled.
7295 #define _EBRT1_OFF_7L 0xFF // Disabled.
7296 #define _EBRT2_ON_7L 0xFB // Enabled.
7297 #define _EBRT2_OFF_7L 0xFF // Disabled.
7298 #define _EBRT3_ON_7L 0xF7 // Enabled.
7299 #define _EBRT3_OFF_7L 0xFF // Disabled.
7301 //----------------------------- CONFIG7H Options -------------------------------
7303 #define _EBRTB_ON_7H 0xBF // Enabled.
7304 #define _EBRTB_OFF_7H 0xFF // Disabled.
7306 //==============================================================================
7308 #define __DEVID1 0x3FFFFE
7309 #define __DEVID2 0x3FFFFF
7311 #define __IDLOC0 0x200000
7312 #define __IDLOC1 0x200001
7313 #define __IDLOC2 0x200002
7314 #define __IDLOC3 0x200003
7315 #define __IDLOC4 0x200004
7316 #define __IDLOC5 0x200005
7317 #define __IDLOC6 0x200006
7318 #define __IDLOC7 0x200007
7320 #endif // #ifndef __PIC18F66K22_H__