Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16f707.h
blob37472a4b3f5b16f9d03cb6f1dcfcd5141b9289ed
1 /*
2 * This declarations of the PIC16F707 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:22:57 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 __PIC16F707_H__
26 #define __PIC16F707_H__
28 //==============================================================================
30 // Register Addresses
32 //==============================================================================
34 #ifndef NO_ADDR_DEFINES
36 #define INDF_ADDR 0x0000
37 #define TMR0_ADDR 0x0001
38 #define PCL_ADDR 0x0002
39 #define STATUS_ADDR 0x0003
40 #define FSR_ADDR 0x0004
41 #define PORTA_ADDR 0x0005
42 #define PORTB_ADDR 0x0006
43 #define PORTC_ADDR 0x0007
44 #define PORTD_ADDR 0x0008
45 #define PORTE_ADDR 0x0009
46 #define PCLATH_ADDR 0x000A
47 #define INTCON_ADDR 0x000B
48 #define PIR1_ADDR 0x000C
49 #define PIR2_ADDR 0x000D
50 #define TMR1_ADDR 0x000E
51 #define TMR1L_ADDR 0x000E
52 #define TMR1H_ADDR 0x000F
53 #define T1CON_ADDR 0x0010
54 #define TMR2_ADDR 0x0011
55 #define T2CON_ADDR 0x0012
56 #define SSPBUF_ADDR 0x0013
57 #define SSPCON_ADDR 0x0014
58 #define CCPR1_ADDR 0x0015
59 #define CCPR1L_ADDR 0x0015
60 #define CCPR1H_ADDR 0x0016
61 #define CCP1CON_ADDR 0x0017
62 #define RCSTA_ADDR 0x0018
63 #define TXREG_ADDR 0x0019
64 #define RCREG_ADDR 0x001A
65 #define CCPR2_ADDR 0x001B
66 #define CCPR2L_ADDR 0x001B
67 #define CCPR2H_ADDR 0x001C
68 #define CCP2CON_ADDR 0x001D
69 #define ADRES_ADDR 0x001E
70 #define ADCON0_ADDR 0x001F
71 #define OPTION_REG_ADDR 0x0081
72 #define TRISA_ADDR 0x0085
73 #define TRISB_ADDR 0x0086
74 #define TRISC_ADDR 0x0087
75 #define TRISD_ADDR 0x0088
76 #define TRISE_ADDR 0x0089
77 #define PIE1_ADDR 0x008C
78 #define PIE2_ADDR 0x008D
79 #define PCON_ADDR 0x008E
80 #define T1GCON_ADDR 0x008F
81 #define OSCCON_ADDR 0x0090
82 #define OSCTUNE_ADDR 0x0091
83 #define PR2_ADDR 0x0092
84 #define SSPADD_ADDR 0x0093
85 #define SSPMSK_ADDR 0x0093
86 #define SSPSTAT_ADDR 0x0094
87 #define WPUB_ADDR 0x0095
88 #define IOCB_ADDR 0x0096
89 #define T3CON_ADDR 0x0097
90 #define TXSTA_ADDR 0x0098
91 #define SPBRG_ADDR 0x0099
92 #define TMR3_ADDR 0x009A
93 #define TMR3L_ADDR 0x009A
94 #define TMR3H_ADDR 0x009B
95 #define APFCON_ADDR 0x009C
96 #define FVRCON_ADDR 0x009D
97 #define T3GCON_ADDR 0x009E
98 #define ADCON1_ADDR 0x009F
99 #define TACON_ADDR 0x0105
100 #define CPSBCON0_ADDR 0x0106
101 #define CPSBCON1_ADDR 0x0107
102 #define CPSACON0_ADDR 0x0108
103 #define CPSACON1_ADDR 0x0109
104 #define PMDATL_ADDR 0x010C
105 #define PMADRL_ADDR 0x010D
106 #define PMDATH_ADDR 0x010E
107 #define PMADRH_ADDR 0x010F
108 #define TMRA_ADDR 0x0110
109 #define TBCON_ADDR 0x0111
110 #define TMRB_ADDR 0x0112
111 #define DACCON0_ADDR 0x0113
112 #define DACCON1_ADDR 0x0114
113 #define ANSELA_ADDR 0x0185
114 #define ANSELB_ADDR 0x0186
115 #define ANSELC_ADDR 0x0187
116 #define ANSELD_ADDR 0x0188
117 #define ANSELE_ADDR 0x0189
118 #define PMCON1_ADDR 0x018C
120 #endif // #ifndef NO_ADDR_DEFINES
122 //==============================================================================
124 // Register Definitions
126 //==============================================================================
128 extern __at(0x0000) __sfr INDF;
129 extern __at(0x0001) __sfr TMR0;
130 extern __at(0x0002) __sfr PCL;
132 //==============================================================================
133 // STATUS Bits
135 extern __at(0x0003) __sfr STATUS;
137 typedef union
139 struct
141 unsigned C : 1;
142 unsigned DC : 1;
143 unsigned Z : 1;
144 unsigned NOT_PD : 1;
145 unsigned NOT_TO : 1;
146 unsigned RP0 : 1;
147 unsigned RP1 : 1;
148 unsigned IRP : 1;
151 struct
153 unsigned : 5;
154 unsigned RP : 2;
155 unsigned : 1;
157 } __STATUSbits_t;
159 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
161 #define _C 0x01
162 #define _DC 0x02
163 #define _Z 0x04
164 #define _NOT_PD 0x08
165 #define _NOT_TO 0x10
166 #define _RP0 0x20
167 #define _RP1 0x40
168 #define _IRP 0x80
170 //==============================================================================
172 extern __at(0x0004) __sfr FSR;
174 //==============================================================================
175 // PORTA Bits
177 extern __at(0x0005) __sfr PORTA;
179 typedef union
181 struct
183 unsigned RA0 : 1;
184 unsigned RA1 : 1;
185 unsigned RA2 : 1;
186 unsigned RA3 : 1;
187 unsigned RA4 : 1;
188 unsigned RA5 : 1;
189 unsigned RA6 : 1;
190 unsigned RA7 : 1;
193 struct
195 unsigned AN0 : 1;
196 unsigned AN1 : 1;
197 unsigned AN2 : 1;
198 unsigned AN3 : 1;
199 unsigned CPSA3 : 1;
200 unsigned AN4 : 1;
201 unsigned OSC2 : 1;
202 unsigned OSC1 : 1;
205 struct
207 unsigned : 1;
208 unsigned CPSA0 : 1;
209 unsigned CPSA1 : 1;
210 unsigned CPSA2 : 1;
211 unsigned T0CKI : 1;
212 unsigned CPSA4 : 1;
213 unsigned CPSB1 : 1;
214 unsigned CPSB0 : 1;
217 struct
219 unsigned : 1;
220 unsigned : 1;
221 unsigned DACOUT : 1;
222 unsigned : 1;
223 unsigned TACKI : 1;
224 unsigned : 1;
225 unsigned CLKOUT : 1;
226 unsigned CLKIN : 1;
229 struct
231 unsigned : 1;
232 unsigned CPSA : 5;
233 unsigned : 2;
235 } __PORTAbits_t;
237 extern __at(0x0005) volatile __PORTAbits_t PORTAbits;
239 #define _RA0 0x01
240 #define _AN0 0x01
241 #define _RA1 0x02
242 #define _AN1 0x02
243 #define _CPSA0 0x02
244 #define _RA2 0x04
245 #define _AN2 0x04
246 #define _CPSA1 0x04
247 #define _DACOUT 0x04
248 #define _RA3 0x08
249 #define _AN3 0x08
250 #define _CPSA2 0x08
251 #define _RA4 0x10
252 #define _CPSA3 0x10
253 #define _T0CKI 0x10
254 #define _TACKI 0x10
255 #define _RA5 0x20
256 #define _AN4 0x20
257 #define _CPSA4 0x20
258 #define _RA6 0x40
259 #define _OSC2 0x40
260 #define _CPSB1 0x40
261 #define _CLKOUT 0x40
262 #define _RA7 0x80
263 #define _OSC1 0x80
264 #define _CPSB0 0x80
265 #define _CLKIN 0x80
267 //==============================================================================
270 //==============================================================================
271 // PORTB Bits
273 extern __at(0x0006) __sfr PORTB;
275 typedef union
277 struct
279 unsigned RB0 : 1;
280 unsigned RB1 : 1;
281 unsigned RB2 : 1;
282 unsigned RB3 : 1;
283 unsigned RB4 : 1;
284 unsigned RB5 : 1;
285 unsigned RB6 : 1;
286 unsigned RB7 : 1;
289 struct
291 unsigned AN12 : 1;
292 unsigned AN10 : 1;
293 unsigned AN8 : 1;
294 unsigned AN9 : 1;
295 unsigned AN11 : 1;
296 unsigned AN13 : 1;
297 unsigned CPSB14 : 1;
298 unsigned CPSB15 : 1;
301 struct
303 unsigned CPSB8 : 1;
304 unsigned CPSB9 : 1;
305 unsigned CPSB10 : 1;
306 unsigned CPSB11 : 1;
307 unsigned CPSB12 : 1;
308 unsigned CPSB13 : 1;
309 unsigned : 1;
310 unsigned : 1;
313 struct
315 unsigned : 1;
316 unsigned : 1;
317 unsigned : 1;
318 unsigned CCP2 : 1;
319 unsigned : 1;
320 unsigned T1G : 1;
321 unsigned : 1;
322 unsigned : 1;
325 struct
327 unsigned : 1;
328 unsigned : 1;
329 unsigned : 1;
330 unsigned : 1;
331 unsigned : 1;
332 unsigned T3CKI : 1;
333 unsigned : 1;
334 unsigned : 1;
336 } __PORTBbits_t;
338 extern __at(0x0006) volatile __PORTBbits_t PORTBbits;
340 #define _RB0 0x01
341 #define _AN12 0x01
342 #define _CPSB8 0x01
343 #define _RB1 0x02
344 #define _AN10 0x02
345 #define _CPSB9 0x02
346 #define _RB2 0x04
347 #define _AN8 0x04
348 #define _CPSB10 0x04
349 #define _RB3 0x08
350 #define _AN9 0x08
351 #define _CPSB11 0x08
352 #define _CCP2 0x08
353 #define _RB4 0x10
354 #define _AN11 0x10
355 #define _CPSB12 0x10
356 #define _RB5 0x20
357 #define _AN13 0x20
358 #define _CPSB13 0x20
359 #define _T1G 0x20
360 #define _T3CKI 0x20
361 #define _RB6 0x40
362 #define _CPSB14 0x40
363 #define _RB7 0x80
364 #define _CPSB15 0x80
366 //==============================================================================
369 //==============================================================================
370 // PORTC Bits
372 extern __at(0x0007) __sfr PORTC;
374 typedef union
376 struct
378 unsigned RC0 : 1;
379 unsigned RC1 : 1;
380 unsigned RC2 : 1;
381 unsigned RC3 : 1;
382 unsigned RC4 : 1;
383 unsigned RC5 : 1;
384 unsigned RC6 : 1;
385 unsigned RC7 : 1;
388 struct
390 unsigned CPSB2 : 1;
391 unsigned CPSB3 : 1;
392 unsigned CPSB4 : 1;
393 unsigned SCK : 1;
394 unsigned SDI : 1;
395 unsigned CPSA9 : 1;
396 unsigned CPSA10 : 1;
397 unsigned CPSA11 : 1;
400 struct
402 unsigned T1OSO : 1;
403 unsigned T1OSI : 1;
404 unsigned TBCKI : 1;
405 unsigned SCL : 1;
406 unsigned SDA : 1;
407 unsigned SDO : 1;
408 unsigned TX : 1;
409 unsigned RX : 1;
412 struct
414 unsigned T1CKI : 1;
415 unsigned CCP2 : 1;
416 unsigned CCP1 : 1;
417 unsigned : 1;
418 unsigned : 1;
419 unsigned : 1;
420 unsigned CK : 1;
421 unsigned : 1;
423 } __PORTCbits_t;
425 extern __at(0x0007) volatile __PORTCbits_t PORTCbits;
427 #define _PORTC_RC0 0x01
428 #define _PORTC_CPSB2 0x01
429 #define _PORTC_T1OSO 0x01
430 #define _PORTC_T1CKI 0x01
431 #define _PORTC_RC1 0x02
432 #define _PORTC_CPSB3 0x02
433 #define _PORTC_T1OSI 0x02
434 #define _PORTC_CCP2 0x02
435 #define _PORTC_RC2 0x04
436 #define _PORTC_CPSB4 0x04
437 #define _PORTC_TBCKI 0x04
438 #define _PORTC_CCP1 0x04
439 #define _PORTC_RC3 0x08
440 #define _PORTC_SCK 0x08
441 #define _PORTC_SCL 0x08
442 #define _PORTC_RC4 0x10
443 #define _PORTC_SDI 0x10
444 #define _PORTC_SDA 0x10
445 #define _PORTC_RC5 0x20
446 #define _PORTC_CPSA9 0x20
447 #define _PORTC_SDO 0x20
448 #define _PORTC_RC6 0x40
449 #define _PORTC_CPSA10 0x40
450 #define _PORTC_TX 0x40
451 #define _PORTC_CK 0x40
452 #define _PORTC_RC7 0x80
453 #define _PORTC_CPSA11 0x80
454 #define _PORTC_RX 0x80
456 //==============================================================================
459 //==============================================================================
460 // PORTD Bits
462 extern __at(0x0008) __sfr PORTD;
464 typedef union
466 struct
468 unsigned RD0 : 1;
469 unsigned RD1 : 1;
470 unsigned RD2 : 1;
471 unsigned RD3 : 1;
472 unsigned RD4 : 1;
473 unsigned RD5 : 1;
474 unsigned RD6 : 1;
475 unsigned RD7 : 1;
478 struct
480 unsigned CPSB5 : 1;
481 unsigned CPSB6 : 1;
482 unsigned CPSB7 : 1;
483 unsigned CPSA8 : 1;
484 unsigned CPSA12 : 1;
485 unsigned CPSA13 : 1;
486 unsigned CPSA14 : 1;
487 unsigned CPSA15 : 1;
490 struct
492 unsigned T3G : 1;
493 unsigned : 1;
494 unsigned : 1;
495 unsigned : 1;
496 unsigned : 1;
497 unsigned : 1;
498 unsigned : 1;
499 unsigned : 1;
501 } __PORTDbits_t;
503 extern __at(0x0008) volatile __PORTDbits_t PORTDbits;
505 #define _RD0 0x01
506 #define _CPSB5 0x01
507 #define _T3G 0x01
508 #define _RD1 0x02
509 #define _CPSB6 0x02
510 #define _RD2 0x04
511 #define _CPSB7 0x04
512 #define _RD3 0x08
513 #define _CPSA8 0x08
514 #define _RD4 0x10
515 #define _CPSA12 0x10
516 #define _RD5 0x20
517 #define _CPSA13 0x20
518 #define _RD6 0x40
519 #define _CPSA14 0x40
520 #define _RD7 0x80
521 #define _CPSA15 0x80
523 //==============================================================================
526 //==============================================================================
527 // PORTE Bits
529 extern __at(0x0009) __sfr PORTE;
531 typedef union
533 struct
535 unsigned RE0 : 1;
536 unsigned RE1 : 1;
537 unsigned RE2 : 1;
538 unsigned RE3 : 1;
539 unsigned : 1;
540 unsigned : 1;
541 unsigned : 1;
542 unsigned : 1;
545 struct
547 unsigned AN5 : 1;
548 unsigned AN6 : 1;
549 unsigned AN7 : 1;
550 unsigned NOT_MCLR : 1;
551 unsigned : 1;
552 unsigned : 1;
553 unsigned : 1;
554 unsigned : 1;
557 struct
559 unsigned CPSA5 : 1;
560 unsigned CPSA6 : 1;
561 unsigned CPSA7 : 1;
562 unsigned : 1;
563 unsigned : 1;
564 unsigned : 1;
565 unsigned : 1;
566 unsigned : 1;
569 struct
571 unsigned RE : 4;
572 unsigned : 4;
574 } __PORTEbits_t;
576 extern __at(0x0009) volatile __PORTEbits_t PORTEbits;
578 #define _RE0 0x01
579 #define _AN5 0x01
580 #define _CPSA5 0x01
581 #define _RE1 0x02
582 #define _AN6 0x02
583 #define _CPSA6 0x02
584 #define _RE2 0x04
585 #define _AN7 0x04
586 #define _CPSA7 0x04
587 #define _RE3 0x08
588 #define _NOT_MCLR 0x08
590 //==============================================================================
592 extern __at(0x000A) __sfr PCLATH;
594 //==============================================================================
595 // INTCON Bits
597 extern __at(0x000B) __sfr INTCON;
599 typedef union
601 struct
603 unsigned RBIF : 1;
604 unsigned INTF : 1;
605 unsigned TMR0IF : 1;
606 unsigned RBIE : 1;
607 unsigned INTE : 1;
608 unsigned TMR0IE : 1;
609 unsigned PEIE : 1;
610 unsigned GIE : 1;
613 struct
615 unsigned : 1;
616 unsigned : 1;
617 unsigned T0IF : 1;
618 unsigned : 1;
619 unsigned : 1;
620 unsigned T0IE : 1;
621 unsigned : 1;
622 unsigned : 1;
624 } __INTCONbits_t;
626 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
628 #define _RBIF 0x01
629 #define _INTF 0x02
630 #define _TMR0IF 0x04
631 #define _T0IF 0x04
632 #define _RBIE 0x08
633 #define _INTE 0x10
634 #define _TMR0IE 0x20
635 #define _T0IE 0x20
636 #define _PEIE 0x40
637 #define _GIE 0x80
639 //==============================================================================
642 //==============================================================================
643 // PIR1 Bits
645 extern __at(0x000C) __sfr PIR1;
647 typedef struct
649 unsigned TMR1IF : 1;
650 unsigned TMR2IF : 1;
651 unsigned CCP1IF : 1;
652 unsigned SSPIF : 1;
653 unsigned TXIF : 1;
654 unsigned RCIF : 1;
655 unsigned ADIF : 1;
656 unsigned TMR1GIF : 1;
657 } __PIR1bits_t;
659 extern __at(0x000C) volatile __PIR1bits_t PIR1bits;
661 #define _TMR1IF 0x01
662 #define _TMR2IF 0x02
663 #define _CCP1IF 0x04
664 #define _SSPIF 0x08
665 #define _TXIF 0x10
666 #define _RCIF 0x20
667 #define _ADIF 0x40
668 #define _TMR1GIF 0x80
670 //==============================================================================
673 //==============================================================================
674 // PIR2 Bits
676 extern __at(0x000D) __sfr PIR2;
678 typedef struct
680 unsigned CCP2IF : 1;
681 unsigned : 1;
682 unsigned : 1;
683 unsigned : 1;
684 unsigned TMRAIF : 1;
685 unsigned TMRBIF : 1;
686 unsigned TMR3IF : 1;
687 unsigned TMR3GIF : 1;
688 } __PIR2bits_t;
690 extern __at(0x000D) volatile __PIR2bits_t PIR2bits;
692 #define _CCP2IF 0x01
693 #define _TMRAIF 0x10
694 #define _TMRBIF 0x20
695 #define _TMR3IF 0x40
696 #define _TMR3GIF 0x80
698 //==============================================================================
700 extern __at(0x000E) __sfr TMR1;
701 extern __at(0x000E) __sfr TMR1L;
702 extern __at(0x000F) __sfr TMR1H;
704 //==============================================================================
705 // T1CON Bits
707 extern __at(0x0010) __sfr T1CON;
709 typedef union
711 struct
713 unsigned TMR1ON : 1;
714 unsigned : 1;
715 unsigned NOT_T1SYNC : 1;
716 unsigned T1OSCEN : 1;
717 unsigned T1CKPS0 : 1;
718 unsigned T1CKPS1 : 1;
719 unsigned TMRCS0 : 1;
720 unsigned TMRCS1 : 1;
723 struct
725 unsigned : 1;
726 unsigned : 1;
727 unsigned T1SYNC : 1;
728 unsigned : 1;
729 unsigned : 1;
730 unsigned : 1;
731 unsigned TMR1CS0 : 1;
732 unsigned TMR1CS1 : 1;
735 struct
737 unsigned : 4;
738 unsigned T1CKPS : 2;
739 unsigned : 2;
742 struct
744 unsigned : 6;
745 unsigned TMR1CS : 2;
748 struct
750 unsigned : 6;
751 unsigned TMRCS : 2;
753 } __T1CONbits_t;
755 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
757 #define _TMR1ON 0x01
758 #define _NOT_T1SYNC 0x04
759 #define _T1SYNC 0x04
760 #define _T1OSCEN 0x08
761 #define _T1CKPS0 0x10
762 #define _T1CKPS1 0x20
763 #define _TMRCS0 0x40
764 #define _TMR1CS0 0x40
765 #define _TMRCS1 0x80
766 #define _TMR1CS1 0x80
768 //==============================================================================
770 extern __at(0x0011) __sfr TMR2;
772 //==============================================================================
773 // T2CON Bits
775 extern __at(0x0012) __sfr T2CON;
777 typedef union
779 struct
781 unsigned T2CKPS0 : 1;
782 unsigned T2CKPS1 : 1;
783 unsigned TMR2ON : 1;
784 unsigned TOUTPS0 : 1;
785 unsigned TOUTPS1 : 1;
786 unsigned TOUTPS2 : 1;
787 unsigned TOUTPS3 : 1;
788 unsigned : 1;
791 struct
793 unsigned T2CKPS : 2;
794 unsigned : 6;
797 struct
799 unsigned : 3;
800 unsigned TOUTPS : 4;
801 unsigned : 1;
803 } __T2CONbits_t;
805 extern __at(0x0012) volatile __T2CONbits_t T2CONbits;
807 #define _T2CKPS0 0x01
808 #define _T2CKPS1 0x02
809 #define _TMR2ON 0x04
810 #define _TOUTPS0 0x08
811 #define _TOUTPS1 0x10
812 #define _TOUTPS2 0x20
813 #define _TOUTPS3 0x40
815 //==============================================================================
817 extern __at(0x0013) __sfr SSPBUF;
819 //==============================================================================
820 // SSPCON Bits
822 extern __at(0x0014) __sfr SSPCON;
824 typedef union
826 struct
828 unsigned SSPM0 : 1;
829 unsigned SSPM1 : 1;
830 unsigned SSPM2 : 1;
831 unsigned SSPM3 : 1;
832 unsigned CKP : 1;
833 unsigned SSPEN : 1;
834 unsigned SSPOV : 1;
835 unsigned WCOL : 1;
838 struct
840 unsigned SSPM : 4;
841 unsigned : 4;
843 } __SSPCONbits_t;
845 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
847 #define _SSPM0 0x01
848 #define _SSPM1 0x02
849 #define _SSPM2 0x04
850 #define _SSPM3 0x08
851 #define _CKP 0x10
852 #define _SSPEN 0x20
853 #define _SSPOV 0x40
854 #define _WCOL 0x80
856 //==============================================================================
858 extern __at(0x0015) __sfr CCPR1;
859 extern __at(0x0015) __sfr CCPR1L;
860 extern __at(0x0016) __sfr CCPR1H;
862 //==============================================================================
863 // CCP1CON Bits
865 extern __at(0x0017) __sfr CCP1CON;
867 typedef union
869 struct
871 unsigned CCP1M0 : 1;
872 unsigned CCP1M1 : 1;
873 unsigned CCP1M2 : 1;
874 unsigned CCP1M3 : 1;
875 unsigned DC1B0 : 1;
876 unsigned DC1B1 : 1;
877 unsigned : 1;
878 unsigned : 1;
881 struct
883 unsigned CCP1M : 4;
884 unsigned : 4;
887 struct
889 unsigned : 4;
890 unsigned DC1B : 2;
891 unsigned : 2;
893 } __CCP1CONbits_t;
895 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits;
897 #define _CCP1M0 0x01
898 #define _CCP1M1 0x02
899 #define _CCP1M2 0x04
900 #define _CCP1M3 0x08
901 #define _DC1B0 0x10
902 #define _DC1B1 0x20
904 //==============================================================================
907 //==============================================================================
908 // RCSTA Bits
910 extern __at(0x0018) __sfr RCSTA;
912 typedef struct
914 unsigned RX9D : 1;
915 unsigned OERR : 1;
916 unsigned FERR : 1;
917 unsigned ADDEN : 1;
918 unsigned CREN : 1;
919 unsigned SREN : 1;
920 unsigned RX9 : 1;
921 unsigned SPEN : 1;
922 } __RCSTAbits_t;
924 extern __at(0x0018) volatile __RCSTAbits_t RCSTAbits;
926 #define _RX9D 0x01
927 #define _OERR 0x02
928 #define _FERR 0x04
929 #define _ADDEN 0x08
930 #define _CREN 0x10
931 #define _SREN 0x20
932 #define _RX9 0x40
933 #define _SPEN 0x80
935 //==============================================================================
937 extern __at(0x0019) __sfr TXREG;
938 extern __at(0x001A) __sfr RCREG;
939 extern __at(0x001B) __sfr CCPR2;
940 extern __at(0x001B) __sfr CCPR2L;
941 extern __at(0x001C) __sfr CCPR2H;
943 //==============================================================================
944 // CCP2CON Bits
946 extern __at(0x001D) __sfr CCP2CON;
948 typedef union
950 struct
952 unsigned CCP2M0 : 1;
953 unsigned CCP2M1 : 1;
954 unsigned CCP2M2 : 1;
955 unsigned CCP2M3 : 1;
956 unsigned DC2B0 : 1;
957 unsigned DC2B1 : 1;
958 unsigned : 1;
959 unsigned : 1;
962 struct
964 unsigned CCP2M : 4;
965 unsigned : 4;
968 struct
970 unsigned : 4;
971 unsigned DC2B : 2;
972 unsigned : 2;
974 } __CCP2CONbits_t;
976 extern __at(0x001D) volatile __CCP2CONbits_t CCP2CONbits;
978 #define _CCP2M0 0x01
979 #define _CCP2M1 0x02
980 #define _CCP2M2 0x04
981 #define _CCP2M3 0x08
982 #define _DC2B0 0x10
983 #define _DC2B1 0x20
985 //==============================================================================
987 extern __at(0x001E) __sfr ADRES;
989 //==============================================================================
990 // ADCON0 Bits
992 extern __at(0x001F) __sfr ADCON0;
994 typedef union
996 struct
998 unsigned ADON : 1;
999 unsigned GO_NOT_DONE : 1;
1000 unsigned CHS0 : 1;
1001 unsigned CHS1 : 1;
1002 unsigned CHS2 : 1;
1003 unsigned CHS3 : 1;
1004 unsigned : 1;
1005 unsigned : 1;
1008 struct
1010 unsigned : 2;
1011 unsigned CHS : 4;
1012 unsigned : 2;
1014 } __ADCON0bits_t;
1016 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits;
1018 #define _ADON 0x01
1019 #define _GO_NOT_DONE 0x02
1020 #define _CHS0 0x04
1021 #define _CHS1 0x08
1022 #define _CHS2 0x10
1023 #define _CHS3 0x20
1025 //==============================================================================
1028 //==============================================================================
1029 // OPTION_REG Bits
1031 extern __at(0x0081) __sfr OPTION_REG;
1033 typedef union
1035 struct
1037 unsigned PS0 : 1;
1038 unsigned PS1 : 1;
1039 unsigned PS2 : 1;
1040 unsigned PSA : 1;
1041 unsigned TMR0SE : 1;
1042 unsigned TMR0CS : 1;
1043 unsigned INTEDG : 1;
1044 unsigned NOT_RBPU : 1;
1047 struct
1049 unsigned : 1;
1050 unsigned : 1;
1051 unsigned : 1;
1052 unsigned : 1;
1053 unsigned T0SE : 1;
1054 unsigned T0CS : 1;
1055 unsigned : 1;
1056 unsigned : 1;
1059 struct
1061 unsigned PS : 3;
1062 unsigned : 5;
1064 } __OPTION_REGbits_t;
1066 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
1068 #define _PS0 0x01
1069 #define _PS1 0x02
1070 #define _PS2 0x04
1071 #define _PSA 0x08
1072 #define _TMR0SE 0x10
1073 #define _T0SE 0x10
1074 #define _TMR0CS 0x20
1075 #define _T0CS 0x20
1076 #define _INTEDG 0x40
1077 #define _NOT_RBPU 0x80
1079 //==============================================================================
1082 //==============================================================================
1083 // TRISA Bits
1085 extern __at(0x0085) __sfr TRISA;
1087 typedef struct
1089 unsigned TRISA0 : 1;
1090 unsigned TRISA1 : 1;
1091 unsigned TRISA2 : 1;
1092 unsigned TRISA3 : 1;
1093 unsigned TRISA4 : 1;
1094 unsigned TRISA5 : 1;
1095 unsigned TRISA6 : 1;
1096 unsigned TRISA7 : 1;
1097 } __TRISAbits_t;
1099 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
1101 #define _TRISA0 0x01
1102 #define _TRISA1 0x02
1103 #define _TRISA2 0x04
1104 #define _TRISA3 0x08
1105 #define _TRISA4 0x10
1106 #define _TRISA5 0x20
1107 #define _TRISA6 0x40
1108 #define _TRISA7 0x80
1110 //==============================================================================
1113 //==============================================================================
1114 // TRISB Bits
1116 extern __at(0x0086) __sfr TRISB;
1118 typedef struct
1120 unsigned TRISB0 : 1;
1121 unsigned TRISB1 : 1;
1122 unsigned TRISB2 : 1;
1123 unsigned TRISB3 : 1;
1124 unsigned TRISB4 : 1;
1125 unsigned TRISB5 : 1;
1126 unsigned TRISB6 : 1;
1127 unsigned TRISB7 : 1;
1128 } __TRISBbits_t;
1130 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
1132 #define _TRISB0 0x01
1133 #define _TRISB1 0x02
1134 #define _TRISB2 0x04
1135 #define _TRISB3 0x08
1136 #define _TRISB4 0x10
1137 #define _TRISB5 0x20
1138 #define _TRISB6 0x40
1139 #define _TRISB7 0x80
1141 //==============================================================================
1144 //==============================================================================
1145 // TRISC Bits
1147 extern __at(0x0087) __sfr TRISC;
1149 typedef struct
1151 unsigned TRISC0 : 1;
1152 unsigned TRISC1 : 1;
1153 unsigned TRISC2 : 1;
1154 unsigned TRISC3 : 1;
1155 unsigned TRISC4 : 1;
1156 unsigned TRISC5 : 1;
1157 unsigned TRISC6 : 1;
1158 unsigned TRISC7 : 1;
1159 } __TRISCbits_t;
1161 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
1163 #define _TRISC0 0x01
1164 #define _TRISC1 0x02
1165 #define _TRISC2 0x04
1166 #define _TRISC3 0x08
1167 #define _TRISC4 0x10
1168 #define _TRISC5 0x20
1169 #define _TRISC6 0x40
1170 #define _TRISC7 0x80
1172 //==============================================================================
1175 //==============================================================================
1176 // TRISD Bits
1178 extern __at(0x0088) __sfr TRISD;
1180 typedef struct
1182 unsigned TRISD0 : 1;
1183 unsigned TRISD1 : 1;
1184 unsigned TRISD2 : 1;
1185 unsigned TRISD3 : 1;
1186 unsigned TRISD4 : 1;
1187 unsigned TRISD5 : 1;
1188 unsigned TRISD6 : 1;
1189 unsigned TRISD7 : 1;
1190 } __TRISDbits_t;
1192 extern __at(0x0088) volatile __TRISDbits_t TRISDbits;
1194 #define _TRISD0 0x01
1195 #define _TRISD1 0x02
1196 #define _TRISD2 0x04
1197 #define _TRISD3 0x08
1198 #define _TRISD4 0x10
1199 #define _TRISD5 0x20
1200 #define _TRISD6 0x40
1201 #define _TRISD7 0x80
1203 //==============================================================================
1206 //==============================================================================
1207 // TRISE Bits
1209 extern __at(0x0089) __sfr TRISE;
1211 typedef union
1213 struct
1215 unsigned TRISE0 : 1;
1216 unsigned TRISE1 : 1;
1217 unsigned TRISE2 : 1;
1218 unsigned TRISE3 : 1;
1219 unsigned : 1;
1220 unsigned : 1;
1221 unsigned : 1;
1222 unsigned : 1;
1225 struct
1227 unsigned TRISE : 4;
1228 unsigned : 4;
1230 } __TRISEbits_t;
1232 extern __at(0x0089) volatile __TRISEbits_t TRISEbits;
1234 #define _TRISE0 0x01
1235 #define _TRISE1 0x02
1236 #define _TRISE2 0x04
1237 #define _TRISE3 0x08
1239 //==============================================================================
1242 //==============================================================================
1243 // PIE1 Bits
1245 extern __at(0x008C) __sfr PIE1;
1247 typedef struct
1249 unsigned TMR1IE : 1;
1250 unsigned TMR2IE : 1;
1251 unsigned CCP1IE : 1;
1252 unsigned SSPIE : 1;
1253 unsigned TXIE : 1;
1254 unsigned RCIE : 1;
1255 unsigned ADIE : 1;
1256 unsigned TMR1GIE : 1;
1257 } __PIE1bits_t;
1259 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
1261 #define _TMR1IE 0x01
1262 #define _TMR2IE 0x02
1263 #define _CCP1IE 0x04
1264 #define _SSPIE 0x08
1265 #define _TXIE 0x10
1266 #define _RCIE 0x20
1267 #define _ADIE 0x40
1268 #define _TMR1GIE 0x80
1270 //==============================================================================
1273 //==============================================================================
1274 // PIE2 Bits
1276 extern __at(0x008D) __sfr PIE2;
1278 typedef struct
1280 unsigned CCP2IE : 1;
1281 unsigned : 1;
1282 unsigned : 1;
1283 unsigned : 1;
1284 unsigned TMRAIE : 1;
1285 unsigned TMRBIE : 1;
1286 unsigned TMR3IE : 1;
1287 unsigned TMR3GIE : 1;
1288 } __PIE2bits_t;
1290 extern __at(0x008D) volatile __PIE2bits_t PIE2bits;
1292 #define _CCP2IE 0x01
1293 #define _TMRAIE 0x10
1294 #define _TMRBIE 0x20
1295 #define _TMR3IE 0x40
1296 #define _TMR3GIE 0x80
1298 //==============================================================================
1301 //==============================================================================
1302 // PCON Bits
1304 extern __at(0x008E) __sfr PCON;
1306 typedef struct
1308 unsigned NOT_BOR : 1;
1309 unsigned NOT_POR : 1;
1310 unsigned : 1;
1311 unsigned : 1;
1312 unsigned : 1;
1313 unsigned : 1;
1314 unsigned : 1;
1315 unsigned : 1;
1316 } __PCONbits_t;
1318 extern __at(0x008E) volatile __PCONbits_t PCONbits;
1320 #define _NOT_BOR 0x01
1321 #define _NOT_POR 0x02
1323 //==============================================================================
1326 //==============================================================================
1327 // T1GCON Bits
1329 extern __at(0x008F) __sfr T1GCON;
1331 typedef union
1333 struct
1335 unsigned T1GSS0 : 1;
1336 unsigned T1GSS1 : 1;
1337 unsigned T1GVAL : 1;
1338 unsigned T1GGO_NOT_DONE : 1;
1339 unsigned T1GSPM : 1;
1340 unsigned T1GTM : 1;
1341 unsigned T1GPOL : 1;
1342 unsigned TMR1GE : 1;
1345 struct
1347 unsigned T1GSS : 2;
1348 unsigned : 6;
1350 } __T1GCONbits_t;
1352 extern __at(0x008F) volatile __T1GCONbits_t T1GCONbits;
1354 #define _T1GSS0 0x01
1355 #define _T1GSS1 0x02
1356 #define _T1GVAL 0x04
1357 #define _T1GGO_NOT_DONE 0x08
1358 #define _T1GSPM 0x10
1359 #define _T1GTM 0x20
1360 #define _T1GPOL 0x40
1361 #define _TMR1GE 0x80
1363 //==============================================================================
1366 //==============================================================================
1367 // OSCCON Bits
1369 extern __at(0x0090) __sfr OSCCON;
1371 typedef union
1373 struct
1375 unsigned : 1;
1376 unsigned : 1;
1377 unsigned ICSS : 1;
1378 unsigned ICSL : 1;
1379 unsigned IRCF0 : 1;
1380 unsigned IRCF1 : 1;
1381 unsigned : 1;
1382 unsigned : 1;
1385 struct
1387 unsigned : 4;
1388 unsigned IRCF : 2;
1389 unsigned : 2;
1391 } __OSCCONbits_t;
1393 extern __at(0x0090) volatile __OSCCONbits_t OSCCONbits;
1395 #define _ICSS 0x04
1396 #define _ICSL 0x08
1397 #define _IRCF0 0x10
1398 #define _IRCF1 0x20
1400 //==============================================================================
1402 extern __at(0x0091) __sfr OSCTUNE;
1403 extern __at(0x0092) __sfr PR2;
1404 extern __at(0x0093) __sfr SSPADD;
1405 extern __at(0x0093) __sfr SSPMSK;
1407 //==============================================================================
1408 // SSPSTAT Bits
1410 extern __at(0x0094) __sfr SSPSTAT;
1412 typedef struct
1414 unsigned BF : 1;
1415 unsigned UA : 1;
1416 unsigned R_NOT_W : 1;
1417 unsigned S : 1;
1418 unsigned P : 1;
1419 unsigned D_NOT_A : 1;
1420 unsigned CKE : 1;
1421 unsigned SMP : 1;
1422 } __SSPSTATbits_t;
1424 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
1426 #define _BF 0x01
1427 #define _UA 0x02
1428 #define _R_NOT_W 0x04
1429 #define _S 0x08
1430 #define _P 0x10
1431 #define _D_NOT_A 0x20
1432 #define _CKE 0x40
1433 #define _SMP 0x80
1435 //==============================================================================
1438 //==============================================================================
1439 // WPUB Bits
1441 extern __at(0x0095) __sfr WPUB;
1443 typedef struct
1445 unsigned WPUB0 : 1;
1446 unsigned WPUB1 : 1;
1447 unsigned WPUB2 : 1;
1448 unsigned WPUB3 : 1;
1449 unsigned WPUB4 : 1;
1450 unsigned WPUB5 : 1;
1451 unsigned WPUB6 : 1;
1452 unsigned WPUB7 : 1;
1453 } __WPUBbits_t;
1455 extern __at(0x0095) volatile __WPUBbits_t WPUBbits;
1457 #define _WPUB0 0x01
1458 #define _WPUB1 0x02
1459 #define _WPUB2 0x04
1460 #define _WPUB3 0x08
1461 #define _WPUB4 0x10
1462 #define _WPUB5 0x20
1463 #define _WPUB6 0x40
1464 #define _WPUB7 0x80
1466 //==============================================================================
1469 //==============================================================================
1470 // IOCB Bits
1472 extern __at(0x0096) __sfr IOCB;
1474 typedef struct
1476 unsigned IOCB0 : 1;
1477 unsigned IOCB1 : 1;
1478 unsigned IOCB2 : 1;
1479 unsigned IOCB3 : 1;
1480 unsigned IOCB4 : 1;
1481 unsigned IOCB5 : 1;
1482 unsigned IOCB6 : 1;
1483 unsigned IOCB7 : 1;
1484 } __IOCBbits_t;
1486 extern __at(0x0096) volatile __IOCBbits_t IOCBbits;
1488 #define _IOCB0 0x01
1489 #define _IOCB1 0x02
1490 #define _IOCB2 0x04
1491 #define _IOCB3 0x08
1492 #define _IOCB4 0x10
1493 #define _IOCB5 0x20
1494 #define _IOCB6 0x40
1495 #define _IOCB7 0x80
1497 //==============================================================================
1500 //==============================================================================
1501 // T3CON Bits
1503 extern __at(0x0097) __sfr T3CON;
1505 typedef union
1507 struct
1509 unsigned TMR3ON : 1;
1510 unsigned : 1;
1511 unsigned T3SYNC : 1;
1512 unsigned : 1;
1513 unsigned T3CKPS0 : 1;
1514 unsigned T3CKPS1 : 1;
1515 unsigned TMR3CS0 : 1;
1516 unsigned TMR3CS1 : 1;
1519 struct
1521 unsigned : 4;
1522 unsigned T3CKPS : 2;
1523 unsigned : 2;
1526 struct
1528 unsigned : 6;
1529 unsigned TMR3CS : 2;
1531 } __T3CONbits_t;
1533 extern __at(0x0097) volatile __T3CONbits_t T3CONbits;
1535 #define _TMR3ON 0x01
1536 #define _T3SYNC 0x04
1537 #define _T3CKPS0 0x10
1538 #define _T3CKPS1 0x20
1539 #define _TMR3CS0 0x40
1540 #define _TMR3CS1 0x80
1542 //==============================================================================
1545 //==============================================================================
1546 // TXSTA Bits
1548 extern __at(0x0098) __sfr TXSTA;
1550 typedef struct
1552 unsigned TX9D : 1;
1553 unsigned TRMT : 1;
1554 unsigned BRGH : 1;
1555 unsigned : 1;
1556 unsigned SYNC : 1;
1557 unsigned TXEN : 1;
1558 unsigned TX9 : 1;
1559 unsigned CSRC : 1;
1560 } __TXSTAbits_t;
1562 extern __at(0x0098) volatile __TXSTAbits_t TXSTAbits;
1564 #define _TX9D 0x01
1565 #define _TRMT 0x02
1566 #define _BRGH 0x04
1567 #define _SYNC 0x10
1568 #define _TXEN 0x20
1569 #define _TX9 0x40
1570 #define _CSRC 0x80
1572 //==============================================================================
1574 extern __at(0x0099) __sfr SPBRG;
1575 extern __at(0x009A) __sfr TMR3;
1576 extern __at(0x009A) __sfr TMR3L;
1577 extern __at(0x009B) __sfr TMR3H;
1579 //==============================================================================
1580 // APFCON Bits
1582 extern __at(0x009C) __sfr APFCON;
1584 typedef struct
1586 unsigned CCP2SEL : 1;
1587 unsigned SSSEL : 1;
1588 unsigned : 1;
1589 unsigned : 1;
1590 unsigned : 1;
1591 unsigned : 1;
1592 unsigned : 1;
1593 unsigned : 1;
1594 } __APFCONbits_t;
1596 extern __at(0x009C) volatile __APFCONbits_t APFCONbits;
1598 #define _CCP2SEL 0x01
1599 #define _SSSEL 0x02
1601 //==============================================================================
1604 //==============================================================================
1605 // FVRCON Bits
1607 extern __at(0x009D) __sfr FVRCON;
1609 typedef union
1611 struct
1613 unsigned ADFVR0 : 1;
1614 unsigned ADFVR1 : 1;
1615 unsigned CDAFVR0 : 1;
1616 unsigned CDAFVR1 : 1;
1617 unsigned : 1;
1618 unsigned : 1;
1619 unsigned FVREN : 1;
1620 unsigned FVRRDY : 1;
1623 struct
1625 unsigned ADFVR : 2;
1626 unsigned : 6;
1629 struct
1631 unsigned : 2;
1632 unsigned CDAFVR : 2;
1633 unsigned : 4;
1635 } __FVRCONbits_t;
1637 extern __at(0x009D) volatile __FVRCONbits_t FVRCONbits;
1639 #define _ADFVR0 0x01
1640 #define _ADFVR1 0x02
1641 #define _CDAFVR0 0x04
1642 #define _CDAFVR1 0x08
1643 #define _FVREN 0x40
1644 #define _FVRRDY 0x80
1646 //==============================================================================
1649 //==============================================================================
1650 // T3GCON Bits
1652 extern __at(0x009E) __sfr T3GCON;
1654 typedef union
1656 struct
1658 unsigned T3GSS0 : 1;
1659 unsigned T3GSS1 : 1;
1660 unsigned T3GVAL : 1;
1661 unsigned T3GGO_NOT_DONE : 1;
1662 unsigned T3GSPM : 1;
1663 unsigned T3GTM : 1;
1664 unsigned T3GPOL : 1;
1665 unsigned TMR3GE : 1;
1668 struct
1670 unsigned T3GSS : 2;
1671 unsigned : 6;
1673 } __T3GCONbits_t;
1675 extern __at(0x009E) volatile __T3GCONbits_t T3GCONbits;
1677 #define _T3GSS0 0x01
1678 #define _T3GSS1 0x02
1679 #define _T3GVAL 0x04
1680 #define _T3GGO_NOT_DONE 0x08
1681 #define _T3GSPM 0x10
1682 #define _T3GTM 0x20
1683 #define _T3GPOL 0x40
1684 #define _TMR3GE 0x80
1686 //==============================================================================
1689 //==============================================================================
1690 // ADCON1 Bits
1692 extern __at(0x009F) __sfr ADCON1;
1694 typedef union
1696 struct
1698 unsigned ADREF0 : 1;
1699 unsigned ADREF1 : 1;
1700 unsigned : 1;
1701 unsigned : 1;
1702 unsigned ADCS0 : 1;
1703 unsigned ADCS1 : 1;
1704 unsigned ADCS2 : 1;
1705 unsigned : 1;
1708 struct
1710 unsigned ADREF : 2;
1711 unsigned : 6;
1714 struct
1716 unsigned : 4;
1717 unsigned ADCS : 3;
1718 unsigned : 1;
1720 } __ADCON1bits_t;
1722 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits;
1724 #define _ADREF0 0x01
1725 #define _ADREF1 0x02
1726 #define _ADCS0 0x10
1727 #define _ADCS1 0x20
1728 #define _ADCS2 0x40
1730 //==============================================================================
1733 //==============================================================================
1734 // TACON Bits
1736 extern __at(0x0105) __sfr TACON;
1738 typedef union
1740 struct
1742 unsigned TAPS0 : 1;
1743 unsigned TAPS1 : 1;
1744 unsigned TAPS2 : 1;
1745 unsigned TAPSA : 1;
1746 unsigned TASE : 1;
1747 unsigned TACS : 1;
1748 unsigned : 1;
1749 unsigned TMRAON : 1;
1752 struct
1754 unsigned TMRAPS0 : 1;
1755 unsigned TMRAPS1 : 1;
1756 unsigned TMRAPS2 : 1;
1757 unsigned TMRAPSA : 1;
1758 unsigned TMRASE : 1;
1759 unsigned TMRACS : 1;
1760 unsigned : 1;
1761 unsigned : 1;
1764 struct
1766 unsigned TAPS : 3;
1767 unsigned : 5;
1770 struct
1772 unsigned TMRAPS : 3;
1773 unsigned : 5;
1775 } __TACONbits_t;
1777 extern __at(0x0105) volatile __TACONbits_t TACONbits;
1779 #define _TAPS0 0x01
1780 #define _TMRAPS0 0x01
1781 #define _TAPS1 0x02
1782 #define _TMRAPS1 0x02
1783 #define _TAPS2 0x04
1784 #define _TMRAPS2 0x04
1785 #define _TAPSA 0x08
1786 #define _TMRAPSA 0x08
1787 #define _TASE 0x10
1788 #define _TMRASE 0x10
1789 #define _TACS 0x20
1790 #define _TMRACS 0x20
1791 #define _TMRAON 0x80
1793 //==============================================================================
1796 //==============================================================================
1797 // CPSBCON0 Bits
1799 extern __at(0x0106) __sfr CPSBCON0;
1801 typedef union
1803 struct
1805 unsigned TBXCS : 1;
1806 unsigned CPSBOUT : 1;
1807 unsigned CPSBRNG0 : 1;
1808 unsigned CPSBRNG1 : 1;
1809 unsigned : 1;
1810 unsigned : 1;
1811 unsigned CPSBRM : 1;
1812 unsigned CPSBON : 1;
1815 struct
1817 unsigned : 2;
1818 unsigned CPSBRNG : 2;
1819 unsigned : 4;
1821 } __CPSBCON0bits_t;
1823 extern __at(0x0106) volatile __CPSBCON0bits_t CPSBCON0bits;
1825 #define _TBXCS 0x01
1826 #define _CPSBOUT 0x02
1827 #define _CPSBRNG0 0x04
1828 #define _CPSBRNG1 0x08
1829 #define _CPSBRM 0x40
1830 #define _CPSBON 0x80
1832 //==============================================================================
1835 //==============================================================================
1836 // CPSBCON1 Bits
1838 extern __at(0x0107) __sfr CPSBCON1;
1840 typedef union
1842 struct
1844 unsigned CPSBCH0 : 1;
1845 unsigned CPSBCH1 : 1;
1846 unsigned CPSBCH2 : 1;
1847 unsigned CPSBCH3 : 1;
1848 unsigned : 1;
1849 unsigned : 1;
1850 unsigned : 1;
1851 unsigned : 1;
1854 struct
1856 unsigned CPSBCH : 4;
1857 unsigned : 4;
1859 } __CPSBCON1bits_t;
1861 extern __at(0x0107) volatile __CPSBCON1bits_t CPSBCON1bits;
1863 #define _CPSBCH0 0x01
1864 #define _CPSBCH1 0x02
1865 #define _CPSBCH2 0x04
1866 #define _CPSBCH3 0x08
1868 //==============================================================================
1871 //==============================================================================
1872 // CPSACON0 Bits
1874 extern __at(0x0108) __sfr CPSACON0;
1876 typedef union
1878 struct
1880 unsigned TAXCS : 1;
1881 unsigned CPSAOUT : 1;
1882 unsigned CPSARNG0 : 1;
1883 unsigned CPSARNG1 : 1;
1884 unsigned : 1;
1885 unsigned : 1;
1886 unsigned CPSARM : 1;
1887 unsigned CPSAON : 1;
1890 struct
1892 unsigned : 2;
1893 unsigned CPSARNG : 2;
1894 unsigned : 4;
1896 } __CPSACON0bits_t;
1898 extern __at(0x0108) volatile __CPSACON0bits_t CPSACON0bits;
1900 #define _TAXCS 0x01
1901 #define _CPSAOUT 0x02
1902 #define _CPSARNG0 0x04
1903 #define _CPSARNG1 0x08
1904 #define _CPSARM 0x40
1905 #define _CPSAON 0x80
1907 //==============================================================================
1910 //==============================================================================
1911 // CPSACON1 Bits
1913 extern __at(0x0109) __sfr CPSACON1;
1915 typedef union
1917 struct
1919 unsigned CPSACH0 : 1;
1920 unsigned CPSACH1 : 1;
1921 unsigned CPSACH2 : 1;
1922 unsigned CPSACH3 : 1;
1923 unsigned : 1;
1924 unsigned : 1;
1925 unsigned : 1;
1926 unsigned : 1;
1929 struct
1931 unsigned CPSACH : 4;
1932 unsigned : 4;
1934 } __CPSACON1bits_t;
1936 extern __at(0x0109) volatile __CPSACON1bits_t CPSACON1bits;
1938 #define _CPSACH0 0x01
1939 #define _CPSACH1 0x02
1940 #define _CPSACH2 0x04
1941 #define _CPSACH3 0x08
1943 //==============================================================================
1945 extern __at(0x010C) __sfr PMDATL;
1946 extern __at(0x010D) __sfr PMADRL;
1947 extern __at(0x010E) __sfr PMDATH;
1948 extern __at(0x010F) __sfr PMADRH;
1949 extern __at(0x0110) __sfr TMRA;
1951 //==============================================================================
1952 // TBCON Bits
1954 extern __at(0x0111) __sfr TBCON;
1956 typedef union
1958 struct
1960 unsigned TBPS0 : 1;
1961 unsigned TBPS1 : 1;
1962 unsigned TBPS2 : 1;
1963 unsigned TBPSA : 1;
1964 unsigned TBSE : 1;
1965 unsigned TBCS : 1;
1966 unsigned : 1;
1967 unsigned TMRBON : 1;
1970 struct
1972 unsigned TMRBPS0 : 1;
1973 unsigned TMRBPS1 : 1;
1974 unsigned TMRBPS2 : 1;
1975 unsigned TMRBPSA : 1;
1976 unsigned TMRBSE : 1;
1977 unsigned TMRBCS : 1;
1978 unsigned : 1;
1979 unsigned : 1;
1982 struct
1984 unsigned TMRBPS : 3;
1985 unsigned : 5;
1988 struct
1990 unsigned TBPS : 3;
1991 unsigned : 5;
1993 } __TBCONbits_t;
1995 extern __at(0x0111) volatile __TBCONbits_t TBCONbits;
1997 #define _TBPS0 0x01
1998 #define _TMRBPS0 0x01
1999 #define _TBPS1 0x02
2000 #define _TMRBPS1 0x02
2001 #define _TBPS2 0x04
2002 #define _TMRBPS2 0x04
2003 #define _TBPSA 0x08
2004 #define _TMRBPSA 0x08
2005 #define _TBSE 0x10
2006 #define _TMRBSE 0x10
2007 #define _TBCS 0x20
2008 #define _TMRBCS 0x20
2009 #define _TMRBON 0x80
2011 //==============================================================================
2013 extern __at(0x0112) __sfr TMRB;
2015 //==============================================================================
2016 // DACCON0 Bits
2018 extern __at(0x0113) __sfr DACCON0;
2020 typedef union
2022 struct
2024 unsigned : 1;
2025 unsigned : 1;
2026 unsigned DACPSS0 : 1;
2027 unsigned DACPSS1 : 1;
2028 unsigned : 1;
2029 unsigned DACOE : 1;
2030 unsigned DACLPS : 1;
2031 unsigned DACEN : 1;
2034 struct
2036 unsigned : 2;
2037 unsigned DACPSS : 2;
2038 unsigned : 4;
2040 } __DACCON0bits_t;
2042 extern __at(0x0113) volatile __DACCON0bits_t DACCON0bits;
2044 #define _DACPSS0 0x04
2045 #define _DACPSS1 0x08
2046 #define _DACOE 0x20
2047 #define _DACLPS 0x40
2048 #define _DACEN 0x80
2050 //==============================================================================
2053 //==============================================================================
2054 // DACCON1 Bits
2056 extern __at(0x0114) __sfr DACCON1;
2058 typedef union
2060 struct
2062 unsigned DACR0 : 1;
2063 unsigned DACR1 : 1;
2064 unsigned DACR2 : 1;
2065 unsigned DACR3 : 1;
2066 unsigned DACR4 : 1;
2067 unsigned : 1;
2068 unsigned : 1;
2069 unsigned : 1;
2072 struct
2074 unsigned DACR : 5;
2075 unsigned : 3;
2077 } __DACCON1bits_t;
2079 extern __at(0x0114) volatile __DACCON1bits_t DACCON1bits;
2081 #define _DACR0 0x01
2082 #define _DACR1 0x02
2083 #define _DACR2 0x04
2084 #define _DACR3 0x08
2085 #define _DACR4 0x10
2087 //==============================================================================
2090 //==============================================================================
2091 // ANSELA Bits
2093 extern __at(0x0185) __sfr ANSELA;
2095 typedef struct
2097 unsigned ANSA0 : 1;
2098 unsigned ANSA1 : 1;
2099 unsigned ANSA2 : 1;
2100 unsigned ANSA3 : 1;
2101 unsigned ANSA4 : 1;
2102 unsigned ANSA5 : 1;
2103 unsigned ANSA6 : 1;
2104 unsigned ANSA7 : 1;
2105 } __ANSELAbits_t;
2107 extern __at(0x0185) volatile __ANSELAbits_t ANSELAbits;
2109 #define _ANSA0 0x01
2110 #define _ANSA1 0x02
2111 #define _ANSA2 0x04
2112 #define _ANSA3 0x08
2113 #define _ANSA4 0x10
2114 #define _ANSA5 0x20
2115 #define _ANSA6 0x40
2116 #define _ANSA7 0x80
2118 //==============================================================================
2121 //==============================================================================
2122 // ANSELB Bits
2124 extern __at(0x0186) __sfr ANSELB;
2126 typedef struct
2128 unsigned ANSB0 : 1;
2129 unsigned ANSB1 : 1;
2130 unsigned ANSB2 : 1;
2131 unsigned ANSB3 : 1;
2132 unsigned ANSB4 : 1;
2133 unsigned ANSB5 : 1;
2134 unsigned ANSB6 : 1;
2135 unsigned ANSB7 : 1;
2136 } __ANSELBbits_t;
2138 extern __at(0x0186) volatile __ANSELBbits_t ANSELBbits;
2140 #define _ANSB0 0x01
2141 #define _ANSB1 0x02
2142 #define _ANSB2 0x04
2143 #define _ANSB3 0x08
2144 #define _ANSB4 0x10
2145 #define _ANSB5 0x20
2146 #define _ANSB6 0x40
2147 #define _ANSB7 0x80
2149 //==============================================================================
2152 //==============================================================================
2153 // ANSELC Bits
2155 extern __at(0x0187) __sfr ANSELC;
2157 typedef struct
2159 unsigned ANSC0 : 1;
2160 unsigned ANSC1 : 1;
2161 unsigned ANSC2 : 1;
2162 unsigned : 1;
2163 unsigned : 1;
2164 unsigned ANSC5 : 1;
2165 unsigned ANSC6 : 1;
2166 unsigned ANSC7 : 1;
2167 } __ANSELCbits_t;
2169 extern __at(0x0187) volatile __ANSELCbits_t ANSELCbits;
2171 #define _ANSC0 0x01
2172 #define _ANSC1 0x02
2173 #define _ANSC2 0x04
2174 #define _ANSC5 0x20
2175 #define _ANSC6 0x40
2176 #define _ANSC7 0x80
2178 //==============================================================================
2181 //==============================================================================
2182 // ANSELD Bits
2184 extern __at(0x0188) __sfr ANSELD;
2186 typedef struct
2188 unsigned ANSD0 : 1;
2189 unsigned ANSD1 : 1;
2190 unsigned ANSD2 : 1;
2191 unsigned ANSD3 : 1;
2192 unsigned ANSD4 : 1;
2193 unsigned ANSD5 : 1;
2194 unsigned ANSD6 : 1;
2195 unsigned ANSD7 : 1;
2196 } __ANSELDbits_t;
2198 extern __at(0x0188) volatile __ANSELDbits_t ANSELDbits;
2200 #define _ANSD0 0x01
2201 #define _ANSD1 0x02
2202 #define _ANSD2 0x04
2203 #define _ANSD3 0x08
2204 #define _ANSD4 0x10
2205 #define _ANSD5 0x20
2206 #define _ANSD6 0x40
2207 #define _ANSD7 0x80
2209 //==============================================================================
2212 //==============================================================================
2213 // ANSELE Bits
2215 extern __at(0x0189) __sfr ANSELE;
2217 typedef union
2219 struct
2221 unsigned ANSE0 : 1;
2222 unsigned ANSE1 : 1;
2223 unsigned ANSE2 : 1;
2224 unsigned : 1;
2225 unsigned : 1;
2226 unsigned : 1;
2227 unsigned : 1;
2228 unsigned : 1;
2231 struct
2233 unsigned ANSE : 3;
2234 unsigned : 5;
2236 } __ANSELEbits_t;
2238 extern __at(0x0189) volatile __ANSELEbits_t ANSELEbits;
2240 #define _ANSE0 0x01
2241 #define _ANSE1 0x02
2242 #define _ANSE2 0x04
2244 //==============================================================================
2247 //==============================================================================
2248 // PMCON1 Bits
2250 extern __at(0x018C) __sfr PMCON1;
2252 typedef struct
2254 unsigned RD : 1;
2255 unsigned : 1;
2256 unsigned : 1;
2257 unsigned : 1;
2258 unsigned : 1;
2259 unsigned : 1;
2260 unsigned : 1;
2261 unsigned : 1;
2262 } __PMCON1bits_t;
2264 extern __at(0x018C) volatile __PMCON1bits_t PMCON1bits;
2266 #define _RD 0x01
2268 //==============================================================================
2271 //==============================================================================
2273 // Configuration Bits
2275 //==============================================================================
2277 #define _CONFIG 0x2007
2278 #define _CONFIG2 0x2008
2280 //----------------------------- CONFIG Options -------------------------------
2282 #define _FOSC_LP_OSC 0x3FF8 // LP oscillator: Low-power crystal on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2283 #define _LP_OSC 0x3FF8 // LP oscillator: Low-power crystal on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2284 #define _FOSC_XT_OSC 0x3FF9 // XT oscillator: Crystal/resonator on RA6/OSC2/CLKIN and RA7/OSC1/CLKIN.
2285 #define _XT_OSC 0x3FF9 // XT oscillator: Crystal/resonator on RA6/OSC2/CLKIN and RA7/OSC1/CLKIN.
2286 #define _FOSC_HS_OSC 0x3FFA // HS oscillator: High Speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2287 #define _HS_OSC 0x3FFA // HS oscillator: High Speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2288 #define _FOSC_EC_OSC 0x3FFB // EC oscillator: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN.
2289 #define _EC_OSC 0x3FFB // EC oscillator: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN.
2290 #define _FOSC_INTOSCIO 0x3FFC // INTOSCIO oscillator: I/O function on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN pins.
2291 #define _INTOSCIO 0x3FFC // INTOSCIO oscillator: I/O function on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN pins.
2292 #define _FOSC_INTOSC 0x3FFD // INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN.
2293 #define _INTOSC 0x3FFD // INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN.
2294 #define _FOSC_EXTRCIO 0x3FFE // RCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2295 #define _EXTRCIO 0x3FFE // RCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2296 #define _FOSC_EXTRC 0x3FFF // RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2297 #define _EXTRC 0x3FFF // RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2298 #define _WDTE_OFF 0x3FF7 // WDT disabled and can be enabled by SWDTEN bit of the WDTCON register.
2299 #define _WDT_OFF 0x3FF7 // WDT disabled and can be enabled by SWDTEN bit of the WDTCON register.
2300 #define _WDTE_ON 0x3FFF // WDT enabled.
2301 #define _WDT_ON 0x3FFF // WDT enabled.
2302 #define _PWRTE_ON 0x3FEF // PWRT enabled.
2303 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
2304 #define _MCLRE_OFF 0x3FDF // RE3/MCLR pin function is digital input, MCLR internally tied to VDD.
2305 #define _MCLRE_ON 0x3FFF // RE3/MCLR pin function is MCLR.
2306 #define _CP_ON 0x3FBF // Program memory code protection is enabled.
2307 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
2308 #define _BOREN_OFF 0x3CFF // BOR disabled (Preconditioned State).
2309 #define _BOREN_NSLEEP 0x3EFF // BOR enabled during operation and disabled in Sleep.
2310 #define _BOREN_ON 0x3FFF // BOR enabled.
2311 #define _BORV_25 0x3BFF // Brown-out Reset Voltage (VBOR) set to 2.5 V nominal.
2312 #define _BORV_19 0x3FFF // Brown-out Reset Voltage (VBOR) set to 1.9 V nominal.
2313 #define _PLLEN_OFF 0x2FFF // INTOSC Frequency is 500 kHz.
2314 #define _PLLEN_ON 0x3FFF // INTOSC Frequency is 16 MHz (32x).
2316 //----------------------------- CONFIG2 Options -------------------------------
2318 #define _VCAPEN_RA0 0x3FCF // VCAP functionality is enabled on RA0.
2319 #define _VCAPEN_RA5 0x3FDF // VCAP functionality is enabled on RA5.
2320 #define _VCAPEN_RA6 0x3FEF // VCAP functionality is enabled on RA6.
2321 #define _VCAPEN_OFF 0x3FFF // All VCAP pin functions are disabled.
2323 //==============================================================================
2325 #define _DEVID1 0x2006
2327 #define _IDLOC0 0x2000
2328 #define _IDLOC1 0x2001
2329 #define _IDLOC2 0x2002
2330 #define _IDLOC3 0x2003
2332 //==============================================================================
2334 #ifndef NO_BIT_DEFINES
2336 #define ADON ADCON0bits.ADON // bit 0
2337 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1
2338 #define CHS0 ADCON0bits.CHS0 // bit 2
2339 #define CHS1 ADCON0bits.CHS1 // bit 3
2340 #define CHS2 ADCON0bits.CHS2 // bit 4
2341 #define CHS3 ADCON0bits.CHS3 // bit 5
2343 #define ADREF0 ADCON1bits.ADREF0 // bit 0
2344 #define ADREF1 ADCON1bits.ADREF1 // bit 1
2345 #define ADCS0 ADCON1bits.ADCS0 // bit 4
2346 #define ADCS1 ADCON1bits.ADCS1 // bit 5
2347 #define ADCS2 ADCON1bits.ADCS2 // bit 6
2349 #define ANSA0 ANSELAbits.ANSA0 // bit 0
2350 #define ANSA1 ANSELAbits.ANSA1 // bit 1
2351 #define ANSA2 ANSELAbits.ANSA2 // bit 2
2352 #define ANSA3 ANSELAbits.ANSA3 // bit 3
2353 #define ANSA4 ANSELAbits.ANSA4 // bit 4
2354 #define ANSA5 ANSELAbits.ANSA5 // bit 5
2355 #define ANSA6 ANSELAbits.ANSA6 // bit 6
2356 #define ANSA7 ANSELAbits.ANSA7 // bit 7
2358 #define ANSB0 ANSELBbits.ANSB0 // bit 0
2359 #define ANSB1 ANSELBbits.ANSB1 // bit 1
2360 #define ANSB2 ANSELBbits.ANSB2 // bit 2
2361 #define ANSB3 ANSELBbits.ANSB3 // bit 3
2362 #define ANSB4 ANSELBbits.ANSB4 // bit 4
2363 #define ANSB5 ANSELBbits.ANSB5 // bit 5
2364 #define ANSB6 ANSELBbits.ANSB6 // bit 6
2365 #define ANSB7 ANSELBbits.ANSB7 // bit 7
2367 #define ANSC0 ANSELCbits.ANSC0 // bit 0
2368 #define ANSC1 ANSELCbits.ANSC1 // bit 1
2369 #define ANSC2 ANSELCbits.ANSC2 // bit 2
2370 #define ANSC5 ANSELCbits.ANSC5 // bit 5
2371 #define ANSC6 ANSELCbits.ANSC6 // bit 6
2372 #define ANSC7 ANSELCbits.ANSC7 // bit 7
2374 #define ANSD0 ANSELDbits.ANSD0 // bit 0
2375 #define ANSD1 ANSELDbits.ANSD1 // bit 1
2376 #define ANSD2 ANSELDbits.ANSD2 // bit 2
2377 #define ANSD3 ANSELDbits.ANSD3 // bit 3
2378 #define ANSD4 ANSELDbits.ANSD4 // bit 4
2379 #define ANSD5 ANSELDbits.ANSD5 // bit 5
2380 #define ANSD6 ANSELDbits.ANSD6 // bit 6
2381 #define ANSD7 ANSELDbits.ANSD7 // bit 7
2383 #define ANSE0 ANSELEbits.ANSE0 // bit 0
2384 #define ANSE1 ANSELEbits.ANSE1 // bit 1
2385 #define ANSE2 ANSELEbits.ANSE2 // bit 2
2387 #define CCP2SEL APFCONbits.CCP2SEL // bit 0
2388 #define SSSEL APFCONbits.SSSEL // bit 1
2390 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
2391 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
2392 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
2393 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
2394 #define DC1B0 CCP1CONbits.DC1B0 // bit 4
2395 #define DC1B1 CCP1CONbits.DC1B1 // bit 5
2397 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
2398 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
2399 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
2400 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
2401 #define DC2B0 CCP2CONbits.DC2B0 // bit 4
2402 #define DC2B1 CCP2CONbits.DC2B1 // bit 5
2404 #define TAXCS CPSACON0bits.TAXCS // bit 0
2405 #define CPSAOUT CPSACON0bits.CPSAOUT // bit 1
2406 #define CPSARNG0 CPSACON0bits.CPSARNG0 // bit 2
2407 #define CPSARNG1 CPSACON0bits.CPSARNG1 // bit 3
2408 #define CPSARM CPSACON0bits.CPSARM // bit 6
2409 #define CPSAON CPSACON0bits.CPSAON // bit 7
2411 #define CPSACH0 CPSACON1bits.CPSACH0 // bit 0
2412 #define CPSACH1 CPSACON1bits.CPSACH1 // bit 1
2413 #define CPSACH2 CPSACON1bits.CPSACH2 // bit 2
2414 #define CPSACH3 CPSACON1bits.CPSACH3 // bit 3
2416 #define TBXCS CPSBCON0bits.TBXCS // bit 0
2417 #define CPSBOUT CPSBCON0bits.CPSBOUT // bit 1
2418 #define CPSBRNG0 CPSBCON0bits.CPSBRNG0 // bit 2
2419 #define CPSBRNG1 CPSBCON0bits.CPSBRNG1 // bit 3
2420 #define CPSBRM CPSBCON0bits.CPSBRM // bit 6
2421 #define CPSBON CPSBCON0bits.CPSBON // bit 7
2423 #define CPSBCH0 CPSBCON1bits.CPSBCH0 // bit 0
2424 #define CPSBCH1 CPSBCON1bits.CPSBCH1 // bit 1
2425 #define CPSBCH2 CPSBCON1bits.CPSBCH2 // bit 2
2426 #define CPSBCH3 CPSBCON1bits.CPSBCH3 // bit 3
2428 #define DACPSS0 DACCON0bits.DACPSS0 // bit 2
2429 #define DACPSS1 DACCON0bits.DACPSS1 // bit 3
2430 #define DACOE DACCON0bits.DACOE // bit 5
2431 #define DACLPS DACCON0bits.DACLPS // bit 6
2432 #define DACEN DACCON0bits.DACEN // bit 7
2434 #define DACR0 DACCON1bits.DACR0 // bit 0
2435 #define DACR1 DACCON1bits.DACR1 // bit 1
2436 #define DACR2 DACCON1bits.DACR2 // bit 2
2437 #define DACR3 DACCON1bits.DACR3 // bit 3
2438 #define DACR4 DACCON1bits.DACR4 // bit 4
2440 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
2441 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
2442 #define CDAFVR0 FVRCONbits.CDAFVR0 // bit 2
2443 #define CDAFVR1 FVRCONbits.CDAFVR1 // bit 3
2444 #define FVREN FVRCONbits.FVREN // bit 6
2445 #define FVRRDY FVRCONbits.FVRRDY // bit 7
2447 #define RBIF INTCONbits.RBIF // bit 0
2448 #define INTF INTCONbits.INTF // bit 1
2449 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
2450 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
2451 #define RBIE INTCONbits.RBIE // bit 3
2452 #define INTE INTCONbits.INTE // bit 4
2453 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
2454 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
2455 #define PEIE INTCONbits.PEIE // bit 6
2456 #define GIE INTCONbits.GIE // bit 7
2458 #define IOCB0 IOCBbits.IOCB0 // bit 0
2459 #define IOCB1 IOCBbits.IOCB1 // bit 1
2460 #define IOCB2 IOCBbits.IOCB2 // bit 2
2461 #define IOCB3 IOCBbits.IOCB3 // bit 3
2462 #define IOCB4 IOCBbits.IOCB4 // bit 4
2463 #define IOCB5 IOCBbits.IOCB5 // bit 5
2464 #define IOCB6 IOCBbits.IOCB6 // bit 6
2465 #define IOCB7 IOCBbits.IOCB7 // bit 7
2467 #define PS0 OPTION_REGbits.PS0 // bit 0
2468 #define PS1 OPTION_REGbits.PS1 // bit 1
2469 #define PS2 OPTION_REGbits.PS2 // bit 2
2470 #define PSA OPTION_REGbits.PSA // bit 3
2471 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
2472 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
2473 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
2474 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
2475 #define INTEDG OPTION_REGbits.INTEDG // bit 6
2476 #define NOT_RBPU OPTION_REGbits.NOT_RBPU // bit 7
2478 #define ICSS OSCCONbits.ICSS // bit 2
2479 #define ICSL OSCCONbits.ICSL // bit 3
2480 #define IRCF0 OSCCONbits.IRCF0 // bit 4
2481 #define IRCF1 OSCCONbits.IRCF1 // bit 5
2483 #define NOT_BOR PCONbits.NOT_BOR // bit 0
2484 #define NOT_POR PCONbits.NOT_POR // bit 1
2486 #define TMR1IE PIE1bits.TMR1IE // bit 0
2487 #define TMR2IE PIE1bits.TMR2IE // bit 1
2488 #define CCP1IE PIE1bits.CCP1IE // bit 2
2489 #define SSPIE PIE1bits.SSPIE // bit 3
2490 #define TXIE PIE1bits.TXIE // bit 4
2491 #define RCIE PIE1bits.RCIE // bit 5
2492 #define ADIE PIE1bits.ADIE // bit 6
2493 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
2495 #define CCP2IE PIE2bits.CCP2IE // bit 0
2496 #define TMRAIE PIE2bits.TMRAIE // bit 4
2497 #define TMRBIE PIE2bits.TMRBIE // bit 5
2498 #define TMR3IE PIE2bits.TMR3IE // bit 6
2499 #define TMR3GIE PIE2bits.TMR3GIE // bit 7
2501 #define TMR1IF PIR1bits.TMR1IF // bit 0
2502 #define TMR2IF PIR1bits.TMR2IF // bit 1
2503 #define CCP1IF PIR1bits.CCP1IF // bit 2
2504 #define SSPIF PIR1bits.SSPIF // bit 3
2505 #define TXIF PIR1bits.TXIF // bit 4
2506 #define RCIF PIR1bits.RCIF // bit 5
2507 #define ADIF PIR1bits.ADIF // bit 6
2508 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
2510 #define CCP2IF PIR2bits.CCP2IF // bit 0
2511 #define TMRAIF PIR2bits.TMRAIF // bit 4
2512 #define TMRBIF PIR2bits.TMRBIF // bit 5
2513 #define TMR3IF PIR2bits.TMR3IF // bit 6
2514 #define TMR3GIF PIR2bits.TMR3GIF // bit 7
2516 #define RD PMCON1bits.RD // bit 0
2518 #define RA0 PORTAbits.RA0 // bit 0, shadows bit in PORTAbits
2519 #define AN0 PORTAbits.AN0 // bit 0, shadows bit in PORTAbits
2520 #define RA1 PORTAbits.RA1 // bit 1, shadows bit in PORTAbits
2521 #define AN1 PORTAbits.AN1 // bit 1, shadows bit in PORTAbits
2522 #define CPSA0 PORTAbits.CPSA0 // bit 1, shadows bit in PORTAbits
2523 #define RA2 PORTAbits.RA2 // bit 2, shadows bit in PORTAbits
2524 #define AN2 PORTAbits.AN2 // bit 2, shadows bit in PORTAbits
2525 #define CPSA1 PORTAbits.CPSA1 // bit 2, shadows bit in PORTAbits
2526 #define DACOUT PORTAbits.DACOUT // bit 2, shadows bit in PORTAbits
2527 #define RA3 PORTAbits.RA3 // bit 3, shadows bit in PORTAbits
2528 #define AN3 PORTAbits.AN3 // bit 3, shadows bit in PORTAbits
2529 #define CPSA2 PORTAbits.CPSA2 // bit 3, shadows bit in PORTAbits
2530 #define RA4 PORTAbits.RA4 // bit 4, shadows bit in PORTAbits
2531 #define CPSA3 PORTAbits.CPSA3 // bit 4, shadows bit in PORTAbits
2532 #define T0CKI PORTAbits.T0CKI // bit 4, shadows bit in PORTAbits
2533 #define TACKI PORTAbits.TACKI // bit 4, shadows bit in PORTAbits
2534 #define RA5 PORTAbits.RA5 // bit 5, shadows bit in PORTAbits
2535 #define AN4 PORTAbits.AN4 // bit 5, shadows bit in PORTAbits
2536 #define CPSA4 PORTAbits.CPSA4 // bit 5, shadows bit in PORTAbits
2537 #define RA6 PORTAbits.RA6 // bit 6, shadows bit in PORTAbits
2538 #define OSC2 PORTAbits.OSC2 // bit 6, shadows bit in PORTAbits
2539 #define CPSB1 PORTAbits.CPSB1 // bit 6, shadows bit in PORTAbits
2540 #define CLKOUT PORTAbits.CLKOUT // bit 6, shadows bit in PORTAbits
2541 #define RA7 PORTAbits.RA7 // bit 7, shadows bit in PORTAbits
2542 #define OSC1 PORTAbits.OSC1 // bit 7, shadows bit in PORTAbits
2543 #define CPSB0 PORTAbits.CPSB0 // bit 7, shadows bit in PORTAbits
2544 #define CLKIN PORTAbits.CLKIN // bit 7, shadows bit in PORTAbits
2546 #define RB0 PORTBbits.RB0 // bit 0, shadows bit in PORTBbits
2547 #define AN12 PORTBbits.AN12 // bit 0, shadows bit in PORTBbits
2548 #define CPSB8 PORTBbits.CPSB8 // bit 0, shadows bit in PORTBbits
2549 #define RB1 PORTBbits.RB1 // bit 1, shadows bit in PORTBbits
2550 #define AN10 PORTBbits.AN10 // bit 1, shadows bit in PORTBbits
2551 #define CPSB9 PORTBbits.CPSB9 // bit 1, shadows bit in PORTBbits
2552 #define RB2 PORTBbits.RB2 // bit 2, shadows bit in PORTBbits
2553 #define AN8 PORTBbits.AN8 // bit 2, shadows bit in PORTBbits
2554 #define CPSB10 PORTBbits.CPSB10 // bit 2, shadows bit in PORTBbits
2555 #define RB3 PORTBbits.RB3 // bit 3, shadows bit in PORTBbits
2556 #define AN9 PORTBbits.AN9 // bit 3, shadows bit in PORTBbits
2557 #define CPSB11 PORTBbits.CPSB11 // bit 3, shadows bit in PORTBbits
2558 #define CCP2 PORTBbits.CCP2 // bit 3, shadows bit in PORTBbits
2559 #define RB4 PORTBbits.RB4 // bit 4, shadows bit in PORTBbits
2560 #define AN11 PORTBbits.AN11 // bit 4, shadows bit in PORTBbits
2561 #define CPSB12 PORTBbits.CPSB12 // bit 4, shadows bit in PORTBbits
2562 #define RB5 PORTBbits.RB5 // bit 5, shadows bit in PORTBbits
2563 #define AN13 PORTBbits.AN13 // bit 5, shadows bit in PORTBbits
2564 #define CPSB13 PORTBbits.CPSB13 // bit 5, shadows bit in PORTBbits
2565 #define T1G PORTBbits.T1G // bit 5, shadows bit in PORTBbits
2566 #define T3CKI PORTBbits.T3CKI // bit 5, shadows bit in PORTBbits
2567 #define RB6 PORTBbits.RB6 // bit 6, shadows bit in PORTBbits
2568 #define CPSB14 PORTBbits.CPSB14 // bit 6, shadows bit in PORTBbits
2569 #define RB7 PORTBbits.RB7 // bit 7, shadows bit in PORTBbits
2570 #define CPSB15 PORTBbits.CPSB15 // bit 7, shadows bit in PORTBbits
2572 #define RD0 PORTDbits.RD0 // bit 0, shadows bit in PORTDbits
2573 #define CPSB5 PORTDbits.CPSB5 // bit 0, shadows bit in PORTDbits
2574 #define T3G PORTDbits.T3G // bit 0, shadows bit in PORTDbits
2575 #define RD1 PORTDbits.RD1 // bit 1, shadows bit in PORTDbits
2576 #define CPSB6 PORTDbits.CPSB6 // bit 1, shadows bit in PORTDbits
2577 #define RD2 PORTDbits.RD2 // bit 2, shadows bit in PORTDbits
2578 #define CPSB7 PORTDbits.CPSB7 // bit 2, shadows bit in PORTDbits
2579 #define RD3 PORTDbits.RD3 // bit 3, shadows bit in PORTDbits
2580 #define CPSA8 PORTDbits.CPSA8 // bit 3, shadows bit in PORTDbits
2581 #define RD4 PORTDbits.RD4 // bit 4, shadows bit in PORTDbits
2582 #define CPSA12 PORTDbits.CPSA12 // bit 4, shadows bit in PORTDbits
2583 #define RD5 PORTDbits.RD5 // bit 5, shadows bit in PORTDbits
2584 #define CPSA13 PORTDbits.CPSA13 // bit 5, shadows bit in PORTDbits
2585 #define RD6 PORTDbits.RD6 // bit 6, shadows bit in PORTDbits
2586 #define CPSA14 PORTDbits.CPSA14 // bit 6, shadows bit in PORTDbits
2587 #define RD7 PORTDbits.RD7 // bit 7, shadows bit in PORTDbits
2588 #define CPSA15 PORTDbits.CPSA15 // bit 7, shadows bit in PORTDbits
2590 #define RE0 PORTEbits.RE0 // bit 0, shadows bit in PORTEbits
2591 #define AN5 PORTEbits.AN5 // bit 0, shadows bit in PORTEbits
2592 #define CPSA5 PORTEbits.CPSA5 // bit 0, shadows bit in PORTEbits
2593 #define RE1 PORTEbits.RE1 // bit 1, shadows bit in PORTEbits
2594 #define AN6 PORTEbits.AN6 // bit 1, shadows bit in PORTEbits
2595 #define CPSA6 PORTEbits.CPSA6 // bit 1, shadows bit in PORTEbits
2596 #define RE2 PORTEbits.RE2 // bit 2, shadows bit in PORTEbits
2597 #define AN7 PORTEbits.AN7 // bit 2, shadows bit in PORTEbits
2598 #define CPSA7 PORTEbits.CPSA7 // bit 2, shadows bit in PORTEbits
2599 #define RE3 PORTEbits.RE3 // bit 3, shadows bit in PORTEbits
2600 #define NOT_MCLR PORTEbits.NOT_MCLR // bit 3, shadows bit in PORTEbits
2602 #define RX9D RCSTAbits.RX9D // bit 0
2603 #define OERR RCSTAbits.OERR // bit 1
2604 #define FERR RCSTAbits.FERR // bit 2
2605 #define ADDEN RCSTAbits.ADDEN // bit 3
2606 #define CREN RCSTAbits.CREN // bit 4
2607 #define SREN RCSTAbits.SREN // bit 5
2608 #define RX9 RCSTAbits.RX9 // bit 6
2609 #define SPEN RCSTAbits.SPEN // bit 7
2611 #define SSPM0 SSPCONbits.SSPM0 // bit 0
2612 #define SSPM1 SSPCONbits.SSPM1 // bit 1
2613 #define SSPM2 SSPCONbits.SSPM2 // bit 2
2614 #define SSPM3 SSPCONbits.SSPM3 // bit 3
2615 #define CKP SSPCONbits.CKP // bit 4
2616 #define SSPEN SSPCONbits.SSPEN // bit 5
2617 #define SSPOV SSPCONbits.SSPOV // bit 6
2618 #define WCOL SSPCONbits.WCOL // bit 7
2620 #define BF SSPSTATbits.BF // bit 0
2621 #define UA SSPSTATbits.UA // bit 1
2622 #define R_NOT_W SSPSTATbits.R_NOT_W // bit 2
2623 #define S SSPSTATbits.S // bit 3
2624 #define P SSPSTATbits.P // bit 4
2625 #define D_NOT_A SSPSTATbits.D_NOT_A // bit 5
2626 #define CKE SSPSTATbits.CKE // bit 6
2627 #define SMP SSPSTATbits.SMP // bit 7
2629 #define C STATUSbits.C // bit 0
2630 #define DC STATUSbits.DC // bit 1
2631 #define Z STATUSbits.Z // bit 2
2632 #define NOT_PD STATUSbits.NOT_PD // bit 3
2633 #define NOT_TO STATUSbits.NOT_TO // bit 4
2634 #define RP0 STATUSbits.RP0 // bit 5
2635 #define RP1 STATUSbits.RP1 // bit 6
2636 #define IRP STATUSbits.IRP // bit 7
2638 #define TMR1ON T1CONbits.TMR1ON // bit 0
2639 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2, shadows bit in T1CONbits
2640 #define T1SYNC T1CONbits.T1SYNC // bit 2, shadows bit in T1CONbits
2641 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
2642 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
2643 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
2644 #define TMRCS0 T1CONbits.TMRCS0 // bit 6, shadows bit in T1CONbits
2645 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6, shadows bit in T1CONbits
2646 #define TMRCS1 T1CONbits.TMRCS1 // bit 7, shadows bit in T1CONbits
2647 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7, shadows bit in T1CONbits
2649 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0
2650 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1
2651 #define T1GVAL T1GCONbits.T1GVAL // bit 2
2652 #define T1GGO_NOT_DONE T1GCONbits.T1GGO_NOT_DONE // bit 3
2653 #define T1GSPM T1GCONbits.T1GSPM // bit 4
2654 #define T1GTM T1GCONbits.T1GTM // bit 5
2655 #define T1GPOL T1GCONbits.T1GPOL // bit 6
2656 #define TMR1GE T1GCONbits.TMR1GE // bit 7
2658 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
2659 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
2660 #define TMR2ON T2CONbits.TMR2ON // bit 2
2661 #define TOUTPS0 T2CONbits.TOUTPS0 // bit 3
2662 #define TOUTPS1 T2CONbits.TOUTPS1 // bit 4
2663 #define TOUTPS2 T2CONbits.TOUTPS2 // bit 5
2664 #define TOUTPS3 T2CONbits.TOUTPS3 // bit 6
2666 #define TMR3ON T3CONbits.TMR3ON // bit 0
2667 #define T3SYNC T3CONbits.T3SYNC // bit 2
2668 #define T3CKPS0 T3CONbits.T3CKPS0 // bit 4
2669 #define T3CKPS1 T3CONbits.T3CKPS1 // bit 5
2670 #define TMR3CS0 T3CONbits.TMR3CS0 // bit 6
2671 #define TMR3CS1 T3CONbits.TMR3CS1 // bit 7
2673 #define T3GSS0 T3GCONbits.T3GSS0 // bit 0
2674 #define T3GSS1 T3GCONbits.T3GSS1 // bit 1
2675 #define T3GVAL T3GCONbits.T3GVAL // bit 2
2676 #define T3GGO_NOT_DONE T3GCONbits.T3GGO_NOT_DONE // bit 3
2677 #define T3GSPM T3GCONbits.T3GSPM // bit 4
2678 #define T3GTM T3GCONbits.T3GTM // bit 5
2679 #define T3GPOL T3GCONbits.T3GPOL // bit 6
2680 #define TMR3GE T3GCONbits.TMR3GE // bit 7
2682 #define TAPS0 TACONbits.TAPS0 // bit 0, shadows bit in TACONbits
2683 #define TMRAPS0 TACONbits.TMRAPS0 // bit 0, shadows bit in TACONbits
2684 #define TAPS1 TACONbits.TAPS1 // bit 1, shadows bit in TACONbits
2685 #define TMRAPS1 TACONbits.TMRAPS1 // bit 1, shadows bit in TACONbits
2686 #define TAPS2 TACONbits.TAPS2 // bit 2, shadows bit in TACONbits
2687 #define TMRAPS2 TACONbits.TMRAPS2 // bit 2, shadows bit in TACONbits
2688 #define TAPSA TACONbits.TAPSA // bit 3, shadows bit in TACONbits
2689 #define TMRAPSA TACONbits.TMRAPSA // bit 3, shadows bit in TACONbits
2690 #define TASE TACONbits.TASE // bit 4, shadows bit in TACONbits
2691 #define TMRASE TACONbits.TMRASE // bit 4, shadows bit in TACONbits
2692 #define TACS TACONbits.TACS // bit 5, shadows bit in TACONbits
2693 #define TMRACS TACONbits.TMRACS // bit 5, shadows bit in TACONbits
2694 #define TMRAON TACONbits.TMRAON // bit 7
2696 #define TBPS0 TBCONbits.TBPS0 // bit 0, shadows bit in TBCONbits
2697 #define TMRBPS0 TBCONbits.TMRBPS0 // bit 0, shadows bit in TBCONbits
2698 #define TBPS1 TBCONbits.TBPS1 // bit 1, shadows bit in TBCONbits
2699 #define TMRBPS1 TBCONbits.TMRBPS1 // bit 1, shadows bit in TBCONbits
2700 #define TBPS2 TBCONbits.TBPS2 // bit 2, shadows bit in TBCONbits
2701 #define TMRBPS2 TBCONbits.TMRBPS2 // bit 2, shadows bit in TBCONbits
2702 #define TBPSA TBCONbits.TBPSA // bit 3, shadows bit in TBCONbits
2703 #define TMRBPSA TBCONbits.TMRBPSA // bit 3, shadows bit in TBCONbits
2704 #define TBSE TBCONbits.TBSE // bit 4, shadows bit in TBCONbits
2705 #define TMRBSE TBCONbits.TMRBSE // bit 4, shadows bit in TBCONbits
2706 #define TBCS TBCONbits.TBCS // bit 5, shadows bit in TBCONbits
2707 #define TMRBCS TBCONbits.TMRBCS // bit 5, shadows bit in TBCONbits
2708 #define TMRBON TBCONbits.TMRBON // bit 7
2710 #define TRISA0 TRISAbits.TRISA0 // bit 0
2711 #define TRISA1 TRISAbits.TRISA1 // bit 1
2712 #define TRISA2 TRISAbits.TRISA2 // bit 2
2713 #define TRISA3 TRISAbits.TRISA3 // bit 3
2714 #define TRISA4 TRISAbits.TRISA4 // bit 4
2715 #define TRISA5 TRISAbits.TRISA5 // bit 5
2716 #define TRISA6 TRISAbits.TRISA6 // bit 6
2717 #define TRISA7 TRISAbits.TRISA7 // bit 7
2719 #define TRISB0 TRISBbits.TRISB0 // bit 0
2720 #define TRISB1 TRISBbits.TRISB1 // bit 1
2721 #define TRISB2 TRISBbits.TRISB2 // bit 2
2722 #define TRISB3 TRISBbits.TRISB3 // bit 3
2723 #define TRISB4 TRISBbits.TRISB4 // bit 4
2724 #define TRISB5 TRISBbits.TRISB5 // bit 5
2725 #define TRISB6 TRISBbits.TRISB6 // bit 6
2726 #define TRISB7 TRISBbits.TRISB7 // bit 7
2728 #define TRISC0 TRISCbits.TRISC0 // bit 0
2729 #define TRISC1 TRISCbits.TRISC1 // bit 1
2730 #define TRISC2 TRISCbits.TRISC2 // bit 2
2731 #define TRISC3 TRISCbits.TRISC3 // bit 3
2732 #define TRISC4 TRISCbits.TRISC4 // bit 4
2733 #define TRISC5 TRISCbits.TRISC5 // bit 5
2734 #define TRISC6 TRISCbits.TRISC6 // bit 6
2735 #define TRISC7 TRISCbits.TRISC7 // bit 7
2737 #define TRISD0 TRISDbits.TRISD0 // bit 0
2738 #define TRISD1 TRISDbits.TRISD1 // bit 1
2739 #define TRISD2 TRISDbits.TRISD2 // bit 2
2740 #define TRISD3 TRISDbits.TRISD3 // bit 3
2741 #define TRISD4 TRISDbits.TRISD4 // bit 4
2742 #define TRISD5 TRISDbits.TRISD5 // bit 5
2743 #define TRISD6 TRISDbits.TRISD6 // bit 6
2744 #define TRISD7 TRISDbits.TRISD7 // bit 7
2746 #define TRISE0 TRISEbits.TRISE0 // bit 0
2747 #define TRISE1 TRISEbits.TRISE1 // bit 1
2748 #define TRISE2 TRISEbits.TRISE2 // bit 2
2749 #define TRISE3 TRISEbits.TRISE3 // bit 3
2751 #define TX9D TXSTAbits.TX9D // bit 0
2752 #define TRMT TXSTAbits.TRMT // bit 1
2753 #define BRGH TXSTAbits.BRGH // bit 2
2754 #define SYNC TXSTAbits.SYNC // bit 4
2755 #define TXEN TXSTAbits.TXEN // bit 5
2756 #define TX9 TXSTAbits.TX9 // bit 6
2757 #define CSRC TXSTAbits.CSRC // bit 7
2759 #define WPUB0 WPUBbits.WPUB0 // bit 0
2760 #define WPUB1 WPUBbits.WPUB1 // bit 1
2761 #define WPUB2 WPUBbits.WPUB2 // bit 2
2762 #define WPUB3 WPUBbits.WPUB3 // bit 3
2763 #define WPUB4 WPUBbits.WPUB4 // bit 4
2764 #define WPUB5 WPUBbits.WPUB5 // bit 5
2765 #define WPUB6 WPUBbits.WPUB6 // bit 6
2766 #define WPUB7 WPUBbits.WPUB7 // bit 7
2768 #endif // #ifndef NO_BIT_DEFINES
2770 #endif // #ifndef __PIC16F707_H__