Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16lf707.h
blob57ae488fb220cff00f400c41549bfa941b52c997
1 /*
2 * This declarations of the PIC16LF707 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 __PIC16LF707_H__
26 #define __PIC16LF707_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 : 1;
732 unsigned : 1;
735 struct
737 unsigned : 4;
738 unsigned T1CKPS : 2;
739 unsigned : 2;
742 struct
744 unsigned : 6;
745 unsigned TMRCS : 2;
747 } __T1CONbits_t;
749 extern __at(0x0010) volatile __T1CONbits_t T1CONbits;
751 #define _TMR1ON 0x01
752 #define _NOT_T1SYNC 0x04
753 #define _T1SYNC 0x04
754 #define _T1OSCEN 0x08
755 #define _T1CKPS0 0x10
756 #define _T1CKPS1 0x20
757 #define _TMRCS0 0x40
758 #define _TMRCS1 0x80
760 //==============================================================================
762 extern __at(0x0011) __sfr TMR2;
764 //==============================================================================
765 // T2CON Bits
767 extern __at(0x0012) __sfr T2CON;
769 typedef union
771 struct
773 unsigned T2CKPS0 : 1;
774 unsigned T2CKPS1 : 1;
775 unsigned TMR2ON : 1;
776 unsigned TOUTPS0 : 1;
777 unsigned TOUTPS1 : 1;
778 unsigned TOUTPS2 : 1;
779 unsigned TOUTPS3 : 1;
780 unsigned : 1;
783 struct
785 unsigned T2CKPS : 2;
786 unsigned : 6;
789 struct
791 unsigned : 3;
792 unsigned TOUTPS : 4;
793 unsigned : 1;
795 } __T2CONbits_t;
797 extern __at(0x0012) volatile __T2CONbits_t T2CONbits;
799 #define _T2CKPS0 0x01
800 #define _T2CKPS1 0x02
801 #define _TMR2ON 0x04
802 #define _TOUTPS0 0x08
803 #define _TOUTPS1 0x10
804 #define _TOUTPS2 0x20
805 #define _TOUTPS3 0x40
807 //==============================================================================
809 extern __at(0x0013) __sfr SSPBUF;
811 //==============================================================================
812 // SSPCON Bits
814 extern __at(0x0014) __sfr SSPCON;
816 typedef union
818 struct
820 unsigned SSPM0 : 1;
821 unsigned SSPM1 : 1;
822 unsigned SSPM2 : 1;
823 unsigned SSPM3 : 1;
824 unsigned CKP : 1;
825 unsigned SSPEN : 1;
826 unsigned SSPOV : 1;
827 unsigned WCOL : 1;
830 struct
832 unsigned SSPM : 4;
833 unsigned : 4;
835 } __SSPCONbits_t;
837 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits;
839 #define _SSPM0 0x01
840 #define _SSPM1 0x02
841 #define _SSPM2 0x04
842 #define _SSPM3 0x08
843 #define _CKP 0x10
844 #define _SSPEN 0x20
845 #define _SSPOV 0x40
846 #define _WCOL 0x80
848 //==============================================================================
850 extern __at(0x0015) __sfr CCPR1;
851 extern __at(0x0015) __sfr CCPR1L;
852 extern __at(0x0016) __sfr CCPR1H;
854 //==============================================================================
855 // CCP1CON Bits
857 extern __at(0x0017) __sfr CCP1CON;
859 typedef union
861 struct
863 unsigned CCP1M0 : 1;
864 unsigned CCP1M1 : 1;
865 unsigned CCP1M2 : 1;
866 unsigned CCP1M3 : 1;
867 unsigned DC1B0 : 1;
868 unsigned DC1B1 : 1;
869 unsigned : 1;
870 unsigned : 1;
873 struct
875 unsigned CCP1M : 4;
876 unsigned : 4;
879 struct
881 unsigned : 4;
882 unsigned DC1B : 2;
883 unsigned : 2;
885 } __CCP1CONbits_t;
887 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits;
889 #define _CCP1M0 0x01
890 #define _CCP1M1 0x02
891 #define _CCP1M2 0x04
892 #define _CCP1M3 0x08
893 #define _DC1B0 0x10
894 #define _DC1B1 0x20
896 //==============================================================================
899 //==============================================================================
900 // RCSTA Bits
902 extern __at(0x0018) __sfr RCSTA;
904 typedef struct
906 unsigned RX9D : 1;
907 unsigned OERR : 1;
908 unsigned FERR : 1;
909 unsigned ADDEN : 1;
910 unsigned CREN : 1;
911 unsigned SREN : 1;
912 unsigned RX9 : 1;
913 unsigned SPEN : 1;
914 } __RCSTAbits_t;
916 extern __at(0x0018) volatile __RCSTAbits_t RCSTAbits;
918 #define _RX9D 0x01
919 #define _OERR 0x02
920 #define _FERR 0x04
921 #define _ADDEN 0x08
922 #define _CREN 0x10
923 #define _SREN 0x20
924 #define _RX9 0x40
925 #define _SPEN 0x80
927 //==============================================================================
929 extern __at(0x0019) __sfr TXREG;
930 extern __at(0x001A) __sfr RCREG;
931 extern __at(0x001B) __sfr CCPR2;
932 extern __at(0x001B) __sfr CCPR2L;
933 extern __at(0x001C) __sfr CCPR2H;
935 //==============================================================================
936 // CCP2CON Bits
938 extern __at(0x001D) __sfr CCP2CON;
940 typedef union
942 struct
944 unsigned CCP2M0 : 1;
945 unsigned CCP2M1 : 1;
946 unsigned CCP2M2 : 1;
947 unsigned CCP2M3 : 1;
948 unsigned DC2B0 : 1;
949 unsigned DC2B1 : 1;
950 unsigned : 1;
951 unsigned : 1;
954 struct
956 unsigned CCP2M : 4;
957 unsigned : 4;
960 struct
962 unsigned : 4;
963 unsigned DC2B : 2;
964 unsigned : 2;
966 } __CCP2CONbits_t;
968 extern __at(0x001D) volatile __CCP2CONbits_t CCP2CONbits;
970 #define _CCP2M0 0x01
971 #define _CCP2M1 0x02
972 #define _CCP2M2 0x04
973 #define _CCP2M3 0x08
974 #define _DC2B0 0x10
975 #define _DC2B1 0x20
977 //==============================================================================
979 extern __at(0x001E) __sfr ADRES;
981 //==============================================================================
982 // ADCON0 Bits
984 extern __at(0x001F) __sfr ADCON0;
986 typedef union
988 struct
990 unsigned ADON : 1;
991 unsigned GO_NOT_DONE : 1;
992 unsigned CHS0 : 1;
993 unsigned CHS1 : 1;
994 unsigned CHS2 : 1;
995 unsigned CHS3 : 1;
996 unsigned : 1;
997 unsigned : 1;
1000 struct
1002 unsigned : 2;
1003 unsigned CHS : 4;
1004 unsigned : 2;
1006 } __ADCON0bits_t;
1008 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits;
1010 #define _ADON 0x01
1011 #define _GO_NOT_DONE 0x02
1012 #define _CHS0 0x04
1013 #define _CHS1 0x08
1014 #define _CHS2 0x10
1015 #define _CHS3 0x20
1017 //==============================================================================
1020 //==============================================================================
1021 // OPTION_REG Bits
1023 extern __at(0x0081) __sfr OPTION_REG;
1025 typedef union
1027 struct
1029 unsigned PS0 : 1;
1030 unsigned PS1 : 1;
1031 unsigned PS2 : 1;
1032 unsigned PSA : 1;
1033 unsigned TMR0SE : 1;
1034 unsigned TMR0CS : 1;
1035 unsigned INTEDG : 1;
1036 unsigned NOT_RBPU : 1;
1039 struct
1041 unsigned : 1;
1042 unsigned : 1;
1043 unsigned : 1;
1044 unsigned : 1;
1045 unsigned T0SE : 1;
1046 unsigned T0CS : 1;
1047 unsigned : 1;
1048 unsigned : 1;
1051 struct
1053 unsigned PS : 3;
1054 unsigned : 5;
1056 } __OPTION_REGbits_t;
1058 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits;
1060 #define _PS0 0x01
1061 #define _PS1 0x02
1062 #define _PS2 0x04
1063 #define _PSA 0x08
1064 #define _TMR0SE 0x10
1065 #define _T0SE 0x10
1066 #define _TMR0CS 0x20
1067 #define _T0CS 0x20
1068 #define _INTEDG 0x40
1069 #define _NOT_RBPU 0x80
1071 //==============================================================================
1074 //==============================================================================
1075 // TRISA Bits
1077 extern __at(0x0085) __sfr TRISA;
1079 typedef struct
1081 unsigned TRISA0 : 1;
1082 unsigned TRISA1 : 1;
1083 unsigned TRISA2 : 1;
1084 unsigned TRISA3 : 1;
1085 unsigned TRISA4 : 1;
1086 unsigned TRISA5 : 1;
1087 unsigned TRISA6 : 1;
1088 unsigned TRISA7 : 1;
1089 } __TRISAbits_t;
1091 extern __at(0x0085) volatile __TRISAbits_t TRISAbits;
1093 #define _TRISA0 0x01
1094 #define _TRISA1 0x02
1095 #define _TRISA2 0x04
1096 #define _TRISA3 0x08
1097 #define _TRISA4 0x10
1098 #define _TRISA5 0x20
1099 #define _TRISA6 0x40
1100 #define _TRISA7 0x80
1102 //==============================================================================
1105 //==============================================================================
1106 // TRISB Bits
1108 extern __at(0x0086) __sfr TRISB;
1110 typedef struct
1112 unsigned TRISB0 : 1;
1113 unsigned TRISB1 : 1;
1114 unsigned TRISB2 : 1;
1115 unsigned TRISB3 : 1;
1116 unsigned TRISB4 : 1;
1117 unsigned TRISB5 : 1;
1118 unsigned TRISB6 : 1;
1119 unsigned TRISB7 : 1;
1120 } __TRISBbits_t;
1122 extern __at(0x0086) volatile __TRISBbits_t TRISBbits;
1124 #define _TRISB0 0x01
1125 #define _TRISB1 0x02
1126 #define _TRISB2 0x04
1127 #define _TRISB3 0x08
1128 #define _TRISB4 0x10
1129 #define _TRISB5 0x20
1130 #define _TRISB6 0x40
1131 #define _TRISB7 0x80
1133 //==============================================================================
1136 //==============================================================================
1137 // TRISC Bits
1139 extern __at(0x0087) __sfr TRISC;
1141 typedef struct
1143 unsigned TRISC0 : 1;
1144 unsigned TRISC1 : 1;
1145 unsigned TRISC2 : 1;
1146 unsigned TRISC3 : 1;
1147 unsigned TRISC4 : 1;
1148 unsigned TRISC5 : 1;
1149 unsigned TRISC6 : 1;
1150 unsigned TRISC7 : 1;
1151 } __TRISCbits_t;
1153 extern __at(0x0087) volatile __TRISCbits_t TRISCbits;
1155 #define _TRISC0 0x01
1156 #define _TRISC1 0x02
1157 #define _TRISC2 0x04
1158 #define _TRISC3 0x08
1159 #define _TRISC4 0x10
1160 #define _TRISC5 0x20
1161 #define _TRISC6 0x40
1162 #define _TRISC7 0x80
1164 //==============================================================================
1167 //==============================================================================
1168 // TRISD Bits
1170 extern __at(0x0088) __sfr TRISD;
1172 typedef struct
1174 unsigned TRISD0 : 1;
1175 unsigned TRISD1 : 1;
1176 unsigned TRISD2 : 1;
1177 unsigned TRISD3 : 1;
1178 unsigned TRISD4 : 1;
1179 unsigned TRISD5 : 1;
1180 unsigned TRISD6 : 1;
1181 unsigned TRISD7 : 1;
1182 } __TRISDbits_t;
1184 extern __at(0x0088) volatile __TRISDbits_t TRISDbits;
1186 #define _TRISD0 0x01
1187 #define _TRISD1 0x02
1188 #define _TRISD2 0x04
1189 #define _TRISD3 0x08
1190 #define _TRISD4 0x10
1191 #define _TRISD5 0x20
1192 #define _TRISD6 0x40
1193 #define _TRISD7 0x80
1195 //==============================================================================
1198 //==============================================================================
1199 // TRISE Bits
1201 extern __at(0x0089) __sfr TRISE;
1203 typedef union
1205 struct
1207 unsigned TRISE0 : 1;
1208 unsigned TRISE1 : 1;
1209 unsigned TRISE2 : 1;
1210 unsigned TRISE3 : 1;
1211 unsigned : 1;
1212 unsigned : 1;
1213 unsigned : 1;
1214 unsigned : 1;
1217 struct
1219 unsigned TRISE : 4;
1220 unsigned : 4;
1222 } __TRISEbits_t;
1224 extern __at(0x0089) volatile __TRISEbits_t TRISEbits;
1226 #define _TRISE0 0x01
1227 #define _TRISE1 0x02
1228 #define _TRISE2 0x04
1229 #define _TRISE3 0x08
1231 //==============================================================================
1234 //==============================================================================
1235 // PIE1 Bits
1237 extern __at(0x008C) __sfr PIE1;
1239 typedef struct
1241 unsigned TMR1IE : 1;
1242 unsigned TMR2IE : 1;
1243 unsigned CCP1IE : 1;
1244 unsigned SSPIE : 1;
1245 unsigned TXIE : 1;
1246 unsigned RCIE : 1;
1247 unsigned ADIE : 1;
1248 unsigned TMR1GIE : 1;
1249 } __PIE1bits_t;
1251 extern __at(0x008C) volatile __PIE1bits_t PIE1bits;
1253 #define _TMR1IE 0x01
1254 #define _TMR2IE 0x02
1255 #define _CCP1IE 0x04
1256 #define _SSPIE 0x08
1257 #define _TXIE 0x10
1258 #define _RCIE 0x20
1259 #define _ADIE 0x40
1260 #define _TMR1GIE 0x80
1262 //==============================================================================
1265 //==============================================================================
1266 // PIE2 Bits
1268 extern __at(0x008D) __sfr PIE2;
1270 typedef struct
1272 unsigned CCP2IE : 1;
1273 unsigned : 1;
1274 unsigned : 1;
1275 unsigned : 1;
1276 unsigned TMRAIE : 1;
1277 unsigned TMRBIE : 1;
1278 unsigned TMR3IE : 1;
1279 unsigned TMR3GIE : 1;
1280 } __PIE2bits_t;
1282 extern __at(0x008D) volatile __PIE2bits_t PIE2bits;
1284 #define _CCP2IE 0x01
1285 #define _TMRAIE 0x10
1286 #define _TMRBIE 0x20
1287 #define _TMR3IE 0x40
1288 #define _TMR3GIE 0x80
1290 //==============================================================================
1293 //==============================================================================
1294 // PCON Bits
1296 extern __at(0x008E) __sfr PCON;
1298 typedef struct
1300 unsigned NOT_BOR : 1;
1301 unsigned NOT_POR : 1;
1302 unsigned : 1;
1303 unsigned : 1;
1304 unsigned : 1;
1305 unsigned : 1;
1306 unsigned : 1;
1307 unsigned : 1;
1308 } __PCONbits_t;
1310 extern __at(0x008E) volatile __PCONbits_t PCONbits;
1312 #define _NOT_BOR 0x01
1313 #define _NOT_POR 0x02
1315 //==============================================================================
1318 //==============================================================================
1319 // T1GCON Bits
1321 extern __at(0x008F) __sfr T1GCON;
1323 typedef union
1325 struct
1327 unsigned T1GSS0 : 1;
1328 unsigned T1GSS1 : 1;
1329 unsigned T1GVAL : 1;
1330 unsigned T1GGO_NOT_DONE : 1;
1331 unsigned T1GSPM : 1;
1332 unsigned T1GTM : 1;
1333 unsigned T1GPOL : 1;
1334 unsigned TMR1GE : 1;
1337 struct
1339 unsigned T1GSS : 2;
1340 unsigned : 6;
1342 } __T1GCONbits_t;
1344 extern __at(0x008F) volatile __T1GCONbits_t T1GCONbits;
1346 #define _T1GSS0 0x01
1347 #define _T1GSS1 0x02
1348 #define _T1GVAL 0x04
1349 #define _T1GGO_NOT_DONE 0x08
1350 #define _T1GSPM 0x10
1351 #define _T1GTM 0x20
1352 #define _T1GPOL 0x40
1353 #define _TMR1GE 0x80
1355 //==============================================================================
1358 //==============================================================================
1359 // OSCCON Bits
1361 extern __at(0x0090) __sfr OSCCON;
1363 typedef union
1365 struct
1367 unsigned : 1;
1368 unsigned : 1;
1369 unsigned ICSS : 1;
1370 unsigned ICSL : 1;
1371 unsigned IRCF0 : 1;
1372 unsigned IRCF1 : 1;
1373 unsigned : 1;
1374 unsigned : 1;
1377 struct
1379 unsigned : 4;
1380 unsigned IRCF : 2;
1381 unsigned : 2;
1383 } __OSCCONbits_t;
1385 extern __at(0x0090) volatile __OSCCONbits_t OSCCONbits;
1387 #define _ICSS 0x04
1388 #define _ICSL 0x08
1389 #define _IRCF0 0x10
1390 #define _IRCF1 0x20
1392 //==============================================================================
1394 extern __at(0x0091) __sfr OSCTUNE;
1395 extern __at(0x0092) __sfr PR2;
1396 extern __at(0x0093) __sfr SSPADD;
1397 extern __at(0x0093) __sfr SSPMSK;
1399 //==============================================================================
1400 // SSPSTAT Bits
1402 extern __at(0x0094) __sfr SSPSTAT;
1404 typedef struct
1406 unsigned BF : 1;
1407 unsigned UA : 1;
1408 unsigned R_NOT_W : 1;
1409 unsigned S : 1;
1410 unsigned P : 1;
1411 unsigned D_NOT_A : 1;
1412 unsigned CKE : 1;
1413 unsigned SMP : 1;
1414 } __SSPSTATbits_t;
1416 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits;
1418 #define _BF 0x01
1419 #define _UA 0x02
1420 #define _R_NOT_W 0x04
1421 #define _S 0x08
1422 #define _P 0x10
1423 #define _D_NOT_A 0x20
1424 #define _CKE 0x40
1425 #define _SMP 0x80
1427 //==============================================================================
1430 //==============================================================================
1431 // WPUB Bits
1433 extern __at(0x0095) __sfr WPUB;
1435 typedef struct
1437 unsigned WPUB0 : 1;
1438 unsigned WPUB1 : 1;
1439 unsigned WPUB2 : 1;
1440 unsigned WPUB3 : 1;
1441 unsigned WPUB4 : 1;
1442 unsigned WPUB5 : 1;
1443 unsigned WPUB6 : 1;
1444 unsigned WPUB7 : 1;
1445 } __WPUBbits_t;
1447 extern __at(0x0095) volatile __WPUBbits_t WPUBbits;
1449 #define _WPUB0 0x01
1450 #define _WPUB1 0x02
1451 #define _WPUB2 0x04
1452 #define _WPUB3 0x08
1453 #define _WPUB4 0x10
1454 #define _WPUB5 0x20
1455 #define _WPUB6 0x40
1456 #define _WPUB7 0x80
1458 //==============================================================================
1461 //==============================================================================
1462 // IOCB Bits
1464 extern __at(0x0096) __sfr IOCB;
1466 typedef struct
1468 unsigned IOCB0 : 1;
1469 unsigned IOCB1 : 1;
1470 unsigned IOCB2 : 1;
1471 unsigned IOCB3 : 1;
1472 unsigned IOCB4 : 1;
1473 unsigned IOCB5 : 1;
1474 unsigned IOCB6 : 1;
1475 unsigned IOCB7 : 1;
1476 } __IOCBbits_t;
1478 extern __at(0x0096) volatile __IOCBbits_t IOCBbits;
1480 #define _IOCB0 0x01
1481 #define _IOCB1 0x02
1482 #define _IOCB2 0x04
1483 #define _IOCB3 0x08
1484 #define _IOCB4 0x10
1485 #define _IOCB5 0x20
1486 #define _IOCB6 0x40
1487 #define _IOCB7 0x80
1489 //==============================================================================
1492 //==============================================================================
1493 // T3CON Bits
1495 extern __at(0x0097) __sfr T3CON;
1497 typedef union
1499 struct
1501 unsigned TMR3ON : 1;
1502 unsigned : 1;
1503 unsigned T3SYNC : 1;
1504 unsigned : 1;
1505 unsigned T3CKPS0 : 1;
1506 unsigned T3CKPS1 : 1;
1507 unsigned TMR3CS0 : 1;
1508 unsigned TMR3CS1 : 1;
1511 struct
1513 unsigned : 4;
1514 unsigned T3CKPS : 2;
1515 unsigned : 2;
1518 struct
1520 unsigned : 6;
1521 unsigned TMR3CS : 2;
1523 } __T3CONbits_t;
1525 extern __at(0x0097) volatile __T3CONbits_t T3CONbits;
1527 #define _TMR3ON 0x01
1528 #define _T3SYNC 0x04
1529 #define _T3CKPS0 0x10
1530 #define _T3CKPS1 0x20
1531 #define _TMR3CS0 0x40
1532 #define _TMR3CS1 0x80
1534 //==============================================================================
1537 //==============================================================================
1538 // TXSTA Bits
1540 extern __at(0x0098) __sfr TXSTA;
1542 typedef struct
1544 unsigned TX9D : 1;
1545 unsigned TRMT : 1;
1546 unsigned BRGH : 1;
1547 unsigned : 1;
1548 unsigned SYNC : 1;
1549 unsigned TXEN : 1;
1550 unsigned TX9 : 1;
1551 unsigned CSRC : 1;
1552 } __TXSTAbits_t;
1554 extern __at(0x0098) volatile __TXSTAbits_t TXSTAbits;
1556 #define _TX9D 0x01
1557 #define _TRMT 0x02
1558 #define _BRGH 0x04
1559 #define _SYNC 0x10
1560 #define _TXEN 0x20
1561 #define _TX9 0x40
1562 #define _CSRC 0x80
1564 //==============================================================================
1566 extern __at(0x0099) __sfr SPBRG;
1567 extern __at(0x009A) __sfr TMR3;
1568 extern __at(0x009A) __sfr TMR3L;
1569 extern __at(0x009B) __sfr TMR3H;
1571 //==============================================================================
1572 // APFCON Bits
1574 extern __at(0x009C) __sfr APFCON;
1576 typedef struct
1578 unsigned CCP2SEL : 1;
1579 unsigned SSSEL : 1;
1580 unsigned : 1;
1581 unsigned : 1;
1582 unsigned : 1;
1583 unsigned : 1;
1584 unsigned : 1;
1585 unsigned : 1;
1586 } __APFCONbits_t;
1588 extern __at(0x009C) volatile __APFCONbits_t APFCONbits;
1590 #define _CCP2SEL 0x01
1591 #define _SSSEL 0x02
1593 //==============================================================================
1596 //==============================================================================
1597 // FVRCON Bits
1599 extern __at(0x009D) __sfr FVRCON;
1601 typedef union
1603 struct
1605 unsigned ADFVR0 : 1;
1606 unsigned ADFVR1 : 1;
1607 unsigned CDAFVR0 : 1;
1608 unsigned CDAFVR1 : 1;
1609 unsigned : 1;
1610 unsigned : 1;
1611 unsigned FVREN : 1;
1612 unsigned FVRRDY : 1;
1615 struct
1617 unsigned ADFVR : 2;
1618 unsigned : 6;
1621 struct
1623 unsigned : 2;
1624 unsigned CDAFVR : 2;
1625 unsigned : 4;
1627 } __FVRCONbits_t;
1629 extern __at(0x009D) volatile __FVRCONbits_t FVRCONbits;
1631 #define _ADFVR0 0x01
1632 #define _ADFVR1 0x02
1633 #define _CDAFVR0 0x04
1634 #define _CDAFVR1 0x08
1635 #define _FVREN 0x40
1636 #define _FVRRDY 0x80
1638 //==============================================================================
1641 //==============================================================================
1642 // T3GCON Bits
1644 extern __at(0x009E) __sfr T3GCON;
1646 typedef union
1648 struct
1650 unsigned T3GSS0 : 1;
1651 unsigned T3GSS1 : 1;
1652 unsigned T3GVAL : 1;
1653 unsigned T3GGO_NOT_DONE : 1;
1654 unsigned T3GSPM : 1;
1655 unsigned T3GTM : 1;
1656 unsigned T3GPOL : 1;
1657 unsigned TMR3GE : 1;
1660 struct
1662 unsigned T3GSS : 2;
1663 unsigned : 6;
1665 } __T3GCONbits_t;
1667 extern __at(0x009E) volatile __T3GCONbits_t T3GCONbits;
1669 #define _T3GSS0 0x01
1670 #define _T3GSS1 0x02
1671 #define _T3GVAL 0x04
1672 #define _T3GGO_NOT_DONE 0x08
1673 #define _T3GSPM 0x10
1674 #define _T3GTM 0x20
1675 #define _T3GPOL 0x40
1676 #define _TMR3GE 0x80
1678 //==============================================================================
1681 //==============================================================================
1682 // ADCON1 Bits
1684 extern __at(0x009F) __sfr ADCON1;
1686 typedef union
1688 struct
1690 unsigned ADREF0 : 1;
1691 unsigned ADREF1 : 1;
1692 unsigned : 1;
1693 unsigned : 1;
1694 unsigned ADCS0 : 1;
1695 unsigned ADCS1 : 1;
1696 unsigned ADCS2 : 1;
1697 unsigned : 1;
1700 struct
1702 unsigned ADREF : 2;
1703 unsigned : 6;
1706 struct
1708 unsigned : 4;
1709 unsigned ADCS : 3;
1710 unsigned : 1;
1712 } __ADCON1bits_t;
1714 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits;
1716 #define _ADREF0 0x01
1717 #define _ADREF1 0x02
1718 #define _ADCS0 0x10
1719 #define _ADCS1 0x20
1720 #define _ADCS2 0x40
1722 //==============================================================================
1725 //==============================================================================
1726 // TACON Bits
1728 extern __at(0x0105) __sfr TACON;
1730 typedef union
1732 struct
1734 unsigned TAPS0 : 1;
1735 unsigned TAPS1 : 1;
1736 unsigned TAPS2 : 1;
1737 unsigned TAPSA : 1;
1738 unsigned TASE : 1;
1739 unsigned TACS : 1;
1740 unsigned : 1;
1741 unsigned TMRAON : 1;
1744 struct
1746 unsigned TMRAPS0 : 1;
1747 unsigned TMRAPS1 : 1;
1748 unsigned TMRAPS2 : 1;
1749 unsigned TMRAPSA : 1;
1750 unsigned TMRASE : 1;
1751 unsigned TMRACS : 1;
1752 unsigned : 1;
1753 unsigned : 1;
1756 struct
1758 unsigned TMRAPS : 3;
1759 unsigned : 5;
1762 struct
1764 unsigned TAPS : 3;
1765 unsigned : 5;
1767 } __TACONbits_t;
1769 extern __at(0x0105) volatile __TACONbits_t TACONbits;
1771 #define _TAPS0 0x01
1772 #define _TMRAPS0 0x01
1773 #define _TAPS1 0x02
1774 #define _TMRAPS1 0x02
1775 #define _TAPS2 0x04
1776 #define _TMRAPS2 0x04
1777 #define _TAPSA 0x08
1778 #define _TMRAPSA 0x08
1779 #define _TASE 0x10
1780 #define _TMRASE 0x10
1781 #define _TACS 0x20
1782 #define _TMRACS 0x20
1783 #define _TMRAON 0x80
1785 //==============================================================================
1788 //==============================================================================
1789 // CPSBCON0 Bits
1791 extern __at(0x0106) __sfr CPSBCON0;
1793 typedef union
1795 struct
1797 unsigned TBXCS : 1;
1798 unsigned CPSBOUT : 1;
1799 unsigned CPSBRNG0 : 1;
1800 unsigned CPSBRNG1 : 1;
1801 unsigned : 1;
1802 unsigned : 1;
1803 unsigned CPSBRM : 1;
1804 unsigned CPSBON : 1;
1807 struct
1809 unsigned : 2;
1810 unsigned CPSBRNG : 2;
1811 unsigned : 4;
1813 } __CPSBCON0bits_t;
1815 extern __at(0x0106) volatile __CPSBCON0bits_t CPSBCON0bits;
1817 #define _TBXCS 0x01
1818 #define _CPSBOUT 0x02
1819 #define _CPSBRNG0 0x04
1820 #define _CPSBRNG1 0x08
1821 #define _CPSBRM 0x40
1822 #define _CPSBON 0x80
1824 //==============================================================================
1827 //==============================================================================
1828 // CPSBCON1 Bits
1830 extern __at(0x0107) __sfr CPSBCON1;
1832 typedef union
1834 struct
1836 unsigned CPSBCH0 : 1;
1837 unsigned CPSBCH1 : 1;
1838 unsigned CPSBCH2 : 1;
1839 unsigned CPSBCH3 : 1;
1840 unsigned : 1;
1841 unsigned : 1;
1842 unsigned : 1;
1843 unsigned : 1;
1846 struct
1848 unsigned CPSBCH : 4;
1849 unsigned : 4;
1851 } __CPSBCON1bits_t;
1853 extern __at(0x0107) volatile __CPSBCON1bits_t CPSBCON1bits;
1855 #define _CPSBCH0 0x01
1856 #define _CPSBCH1 0x02
1857 #define _CPSBCH2 0x04
1858 #define _CPSBCH3 0x08
1860 //==============================================================================
1863 //==============================================================================
1864 // CPSACON0 Bits
1866 extern __at(0x0108) __sfr CPSACON0;
1868 typedef union
1870 struct
1872 unsigned TAXCS : 1;
1873 unsigned CPSAOUT : 1;
1874 unsigned CPSARNG0 : 1;
1875 unsigned CPSARNG1 : 1;
1876 unsigned : 1;
1877 unsigned : 1;
1878 unsigned CPSARM : 1;
1879 unsigned CPSAON : 1;
1882 struct
1884 unsigned : 2;
1885 unsigned CPSARNG : 2;
1886 unsigned : 4;
1888 } __CPSACON0bits_t;
1890 extern __at(0x0108) volatile __CPSACON0bits_t CPSACON0bits;
1892 #define _TAXCS 0x01
1893 #define _CPSAOUT 0x02
1894 #define _CPSARNG0 0x04
1895 #define _CPSARNG1 0x08
1896 #define _CPSARM 0x40
1897 #define _CPSAON 0x80
1899 //==============================================================================
1902 //==============================================================================
1903 // CPSACON1 Bits
1905 extern __at(0x0109) __sfr CPSACON1;
1907 typedef union
1909 struct
1911 unsigned CPSACH0 : 1;
1912 unsigned CPSACH1 : 1;
1913 unsigned CPSACH2 : 1;
1914 unsigned CPSACH3 : 1;
1915 unsigned : 1;
1916 unsigned : 1;
1917 unsigned : 1;
1918 unsigned : 1;
1921 struct
1923 unsigned CPSACH : 4;
1924 unsigned : 4;
1926 } __CPSACON1bits_t;
1928 extern __at(0x0109) volatile __CPSACON1bits_t CPSACON1bits;
1930 #define _CPSACH0 0x01
1931 #define _CPSACH1 0x02
1932 #define _CPSACH2 0x04
1933 #define _CPSACH3 0x08
1935 //==============================================================================
1937 extern __at(0x010C) __sfr PMDATL;
1938 extern __at(0x010D) __sfr PMADRL;
1939 extern __at(0x010E) __sfr PMDATH;
1940 extern __at(0x010F) __sfr PMADRH;
1941 extern __at(0x0110) __sfr TMRA;
1943 //==============================================================================
1944 // TBCON Bits
1946 extern __at(0x0111) __sfr TBCON;
1948 typedef union
1950 struct
1952 unsigned TBPS0 : 1;
1953 unsigned TBPS1 : 1;
1954 unsigned TBPS2 : 1;
1955 unsigned TBPSA : 1;
1956 unsigned TBSE : 1;
1957 unsigned TBCS : 1;
1958 unsigned : 1;
1959 unsigned TMRBON : 1;
1962 struct
1964 unsigned TMRBPS0 : 1;
1965 unsigned TMRBPS1 : 1;
1966 unsigned TMRBPS2 : 1;
1967 unsigned TMRBPSA : 1;
1968 unsigned TMRBSE : 1;
1969 unsigned TMRBCS : 1;
1970 unsigned : 1;
1971 unsigned : 1;
1974 struct
1976 unsigned TMRBPS : 3;
1977 unsigned : 5;
1980 struct
1982 unsigned TBPS : 3;
1983 unsigned : 5;
1985 } __TBCONbits_t;
1987 extern __at(0x0111) volatile __TBCONbits_t TBCONbits;
1989 #define _TBPS0 0x01
1990 #define _TMRBPS0 0x01
1991 #define _TBPS1 0x02
1992 #define _TMRBPS1 0x02
1993 #define _TBPS2 0x04
1994 #define _TMRBPS2 0x04
1995 #define _TBPSA 0x08
1996 #define _TMRBPSA 0x08
1997 #define _TBSE 0x10
1998 #define _TMRBSE 0x10
1999 #define _TBCS 0x20
2000 #define _TMRBCS 0x20
2001 #define _TMRBON 0x80
2003 //==============================================================================
2005 extern __at(0x0112) __sfr TMRB;
2007 //==============================================================================
2008 // DACCON0 Bits
2010 extern __at(0x0113) __sfr DACCON0;
2012 typedef union
2014 struct
2016 unsigned : 1;
2017 unsigned : 1;
2018 unsigned DACPSS0 : 1;
2019 unsigned DACPSS1 : 1;
2020 unsigned : 1;
2021 unsigned DACOE : 1;
2022 unsigned DACLPS : 1;
2023 unsigned DACEN : 1;
2026 struct
2028 unsigned : 2;
2029 unsigned DACPSS : 2;
2030 unsigned : 4;
2032 } __DACCON0bits_t;
2034 extern __at(0x0113) volatile __DACCON0bits_t DACCON0bits;
2036 #define _DACPSS0 0x04
2037 #define _DACPSS1 0x08
2038 #define _DACOE 0x20
2039 #define _DACLPS 0x40
2040 #define _DACEN 0x80
2042 //==============================================================================
2045 //==============================================================================
2046 // DACCON1 Bits
2048 extern __at(0x0114) __sfr DACCON1;
2050 typedef union
2052 struct
2054 unsigned DACR0 : 1;
2055 unsigned DACR1 : 1;
2056 unsigned DACR2 : 1;
2057 unsigned DACR3 : 1;
2058 unsigned DACR4 : 1;
2059 unsigned : 1;
2060 unsigned : 1;
2061 unsigned : 1;
2064 struct
2066 unsigned DACR : 5;
2067 unsigned : 3;
2069 } __DACCON1bits_t;
2071 extern __at(0x0114) volatile __DACCON1bits_t DACCON1bits;
2073 #define _DACR0 0x01
2074 #define _DACR1 0x02
2075 #define _DACR2 0x04
2076 #define _DACR3 0x08
2077 #define _DACR4 0x10
2079 //==============================================================================
2082 //==============================================================================
2083 // ANSELA Bits
2085 extern __at(0x0185) __sfr ANSELA;
2087 typedef struct
2089 unsigned ANSA0 : 1;
2090 unsigned ANSA1 : 1;
2091 unsigned ANSA2 : 1;
2092 unsigned ANSA3 : 1;
2093 unsigned ANSA4 : 1;
2094 unsigned ANSA5 : 1;
2095 unsigned ANSA6 : 1;
2096 unsigned ANSA7 : 1;
2097 } __ANSELAbits_t;
2099 extern __at(0x0185) volatile __ANSELAbits_t ANSELAbits;
2101 #define _ANSA0 0x01
2102 #define _ANSA1 0x02
2103 #define _ANSA2 0x04
2104 #define _ANSA3 0x08
2105 #define _ANSA4 0x10
2106 #define _ANSA5 0x20
2107 #define _ANSA6 0x40
2108 #define _ANSA7 0x80
2110 //==============================================================================
2113 //==============================================================================
2114 // ANSELB Bits
2116 extern __at(0x0186) __sfr ANSELB;
2118 typedef struct
2120 unsigned ANSB0 : 1;
2121 unsigned ANSB1 : 1;
2122 unsigned ANSB2 : 1;
2123 unsigned ANSB3 : 1;
2124 unsigned ANSB4 : 1;
2125 unsigned ANSB5 : 1;
2126 unsigned ANSB6 : 1;
2127 unsigned ANSB7 : 1;
2128 } __ANSELBbits_t;
2130 extern __at(0x0186) volatile __ANSELBbits_t ANSELBbits;
2132 #define _ANSB0 0x01
2133 #define _ANSB1 0x02
2134 #define _ANSB2 0x04
2135 #define _ANSB3 0x08
2136 #define _ANSB4 0x10
2137 #define _ANSB5 0x20
2138 #define _ANSB6 0x40
2139 #define _ANSB7 0x80
2141 //==============================================================================
2144 //==============================================================================
2145 // ANSELC Bits
2147 extern __at(0x0187) __sfr ANSELC;
2149 typedef struct
2151 unsigned ANSC0 : 1;
2152 unsigned ANSC1 : 1;
2153 unsigned ANSC2 : 1;
2154 unsigned : 1;
2155 unsigned : 1;
2156 unsigned ANSC5 : 1;
2157 unsigned ANSC6 : 1;
2158 unsigned ANSC7 : 1;
2159 } __ANSELCbits_t;
2161 extern __at(0x0187) volatile __ANSELCbits_t ANSELCbits;
2163 #define _ANSC0 0x01
2164 #define _ANSC1 0x02
2165 #define _ANSC2 0x04
2166 #define _ANSC5 0x20
2167 #define _ANSC6 0x40
2168 #define _ANSC7 0x80
2170 //==============================================================================
2173 //==============================================================================
2174 // ANSELD Bits
2176 extern __at(0x0188) __sfr ANSELD;
2178 typedef struct
2180 unsigned ANSD0 : 1;
2181 unsigned ANSD1 : 1;
2182 unsigned ANSD2 : 1;
2183 unsigned ANSD3 : 1;
2184 unsigned ANSD4 : 1;
2185 unsigned ANSD5 : 1;
2186 unsigned ANSD6 : 1;
2187 unsigned ANSD7 : 1;
2188 } __ANSELDbits_t;
2190 extern __at(0x0188) volatile __ANSELDbits_t ANSELDbits;
2192 #define _ANSD0 0x01
2193 #define _ANSD1 0x02
2194 #define _ANSD2 0x04
2195 #define _ANSD3 0x08
2196 #define _ANSD4 0x10
2197 #define _ANSD5 0x20
2198 #define _ANSD6 0x40
2199 #define _ANSD7 0x80
2201 //==============================================================================
2204 //==============================================================================
2205 // ANSELE Bits
2207 extern __at(0x0189) __sfr ANSELE;
2209 typedef union
2211 struct
2213 unsigned ANSE0 : 1;
2214 unsigned ANSE1 : 1;
2215 unsigned ANSE2 : 1;
2216 unsigned : 1;
2217 unsigned : 1;
2218 unsigned : 1;
2219 unsigned : 1;
2220 unsigned : 1;
2223 struct
2225 unsigned ANSE : 3;
2226 unsigned : 5;
2228 } __ANSELEbits_t;
2230 extern __at(0x0189) volatile __ANSELEbits_t ANSELEbits;
2232 #define _ANSE0 0x01
2233 #define _ANSE1 0x02
2234 #define _ANSE2 0x04
2236 //==============================================================================
2239 //==============================================================================
2240 // PMCON1 Bits
2242 extern __at(0x018C) __sfr PMCON1;
2244 typedef struct
2246 unsigned RD : 1;
2247 unsigned : 1;
2248 unsigned : 1;
2249 unsigned : 1;
2250 unsigned : 1;
2251 unsigned : 1;
2252 unsigned : 1;
2253 unsigned : 1;
2254 } __PMCON1bits_t;
2256 extern __at(0x018C) volatile __PMCON1bits_t PMCON1bits;
2258 #define _RD 0x01
2260 //==============================================================================
2263 //==============================================================================
2265 // Configuration Bits
2267 //==============================================================================
2269 #define _CONFIG 0x2007
2270 #define _CONFIG2 0x2008
2272 //----------------------------- CONFIG Options -------------------------------
2274 #define _FOSC_LP_OSC 0x3FF8 // LP oscillator: Low-power crystal on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2275 #define _LP_OSC 0x3FF8 // LP oscillator: Low-power crystal on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2276 #define _FOSC_XT_OSC 0x3FF9 // XT oscillator: Crystal/resonator on RA6/OSC2/CLKIN and RA7/OSC1/CLKIN.
2277 #define _XT_OSC 0x3FF9 // XT oscillator: Crystal/resonator on RA6/OSC2/CLKIN and RA7/OSC1/CLKIN.
2278 #define _FOSC_HS_OSC 0x3FFA // HS oscillator: High Speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2279 #define _HS_OSC 0x3FFA // HS oscillator: High Speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2280 #define _FOSC_EC_OSC 0x3FFB // EC oscillator: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN.
2281 #define _EC_OSC 0x3FFB // EC oscillator: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN.
2282 #define _FOSC_INTOSCIO 0x3FFC // INTOSCIO oscillator: I/O function on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN pins.
2283 #define _INTOSCIO 0x3FFC // INTOSCIO oscillator: I/O function on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN pins.
2284 #define _FOSC_INTOSC 0x3FFD // INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN.
2285 #define _INTOSC 0x3FFD // INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN.
2286 #define _FOSC_EXTRCIO 0x3FFE // RCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2287 #define _EXTRCIO 0x3FFE // RCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2288 #define _FOSC_EXTRC 0x3FFF // RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2289 #define _EXTRC 0x3FFF // RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2290 #define _WDTE_OFF 0x3FF7 // WDT disabled and can be enabled by SWDTEN bit of the WDTCON register.
2291 #define _WDT_OFF 0x3FF7 // WDT disabled and can be enabled by SWDTEN bit of the WDTCON register.
2292 #define _WDTE_ON 0x3FFF // WDT enabled.
2293 #define _WDT_ON 0x3FFF // WDT enabled.
2294 #define _PWRTE_ON 0x3FEF // PWRT enabled.
2295 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
2296 #define _MCLRE_OFF 0x3FDF // RE3/MCLR pin function is digital input, MCLR internally tied to VDD.
2297 #define _MCLRE_ON 0x3FFF // RE3/MCLR pin function is MCLR.
2298 #define _CP_ON 0x3FBF // Program memory code protection is enabled.
2299 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
2300 #define _BOREN_OFF 0x3CFF // BOR disabled (Preconditioned State).
2301 #define _BOREN_NSLEEP 0x3EFF // BOR enabled during operation and disabled in Sleep.
2302 #define _BOREN_ON 0x3FFF // BOR enabled.
2303 #define _BORV_25 0x3BFF // Brown-out Reset Voltage (VBOR) set to 2.5 V nominal.
2304 #define _BORV_19 0x3FFF // Brown-out Reset Voltage (VBOR) set to 1.9 V nominal.
2305 #define _PLLEN_OFF 0x2FFF // INTOSC Frequency is 500 kHz.
2306 #define _PLLEN_ON 0x3FFF // INTOSC Frequency is 16 MHz (32x).
2308 //==============================================================================
2310 #define _DEVID1 0x2006
2312 #define _IDLOC0 0x2000
2313 #define _IDLOC1 0x2001
2314 #define _IDLOC2 0x2002
2315 #define _IDLOC3 0x2003
2317 //==============================================================================
2319 #ifndef NO_BIT_DEFINES
2321 #define ADON ADCON0bits.ADON // bit 0
2322 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1
2323 #define CHS0 ADCON0bits.CHS0 // bit 2
2324 #define CHS1 ADCON0bits.CHS1 // bit 3
2325 #define CHS2 ADCON0bits.CHS2 // bit 4
2326 #define CHS3 ADCON0bits.CHS3 // bit 5
2328 #define ADREF0 ADCON1bits.ADREF0 // bit 0
2329 #define ADREF1 ADCON1bits.ADREF1 // bit 1
2330 #define ADCS0 ADCON1bits.ADCS0 // bit 4
2331 #define ADCS1 ADCON1bits.ADCS1 // bit 5
2332 #define ADCS2 ADCON1bits.ADCS2 // bit 6
2334 #define ANSA0 ANSELAbits.ANSA0 // bit 0
2335 #define ANSA1 ANSELAbits.ANSA1 // bit 1
2336 #define ANSA2 ANSELAbits.ANSA2 // bit 2
2337 #define ANSA3 ANSELAbits.ANSA3 // bit 3
2338 #define ANSA4 ANSELAbits.ANSA4 // bit 4
2339 #define ANSA5 ANSELAbits.ANSA5 // bit 5
2340 #define ANSA6 ANSELAbits.ANSA6 // bit 6
2341 #define ANSA7 ANSELAbits.ANSA7 // bit 7
2343 #define ANSB0 ANSELBbits.ANSB0 // bit 0
2344 #define ANSB1 ANSELBbits.ANSB1 // bit 1
2345 #define ANSB2 ANSELBbits.ANSB2 // bit 2
2346 #define ANSB3 ANSELBbits.ANSB3 // bit 3
2347 #define ANSB4 ANSELBbits.ANSB4 // bit 4
2348 #define ANSB5 ANSELBbits.ANSB5 // bit 5
2349 #define ANSB6 ANSELBbits.ANSB6 // bit 6
2350 #define ANSB7 ANSELBbits.ANSB7 // bit 7
2352 #define ANSC0 ANSELCbits.ANSC0 // bit 0
2353 #define ANSC1 ANSELCbits.ANSC1 // bit 1
2354 #define ANSC2 ANSELCbits.ANSC2 // bit 2
2355 #define ANSC5 ANSELCbits.ANSC5 // bit 5
2356 #define ANSC6 ANSELCbits.ANSC6 // bit 6
2357 #define ANSC7 ANSELCbits.ANSC7 // bit 7
2359 #define ANSD0 ANSELDbits.ANSD0 // bit 0
2360 #define ANSD1 ANSELDbits.ANSD1 // bit 1
2361 #define ANSD2 ANSELDbits.ANSD2 // bit 2
2362 #define ANSD3 ANSELDbits.ANSD3 // bit 3
2363 #define ANSD4 ANSELDbits.ANSD4 // bit 4
2364 #define ANSD5 ANSELDbits.ANSD5 // bit 5
2365 #define ANSD6 ANSELDbits.ANSD6 // bit 6
2366 #define ANSD7 ANSELDbits.ANSD7 // bit 7
2368 #define ANSE0 ANSELEbits.ANSE0 // bit 0
2369 #define ANSE1 ANSELEbits.ANSE1 // bit 1
2370 #define ANSE2 ANSELEbits.ANSE2 // bit 2
2372 #define CCP2SEL APFCONbits.CCP2SEL // bit 0
2373 #define SSSEL APFCONbits.SSSEL // bit 1
2375 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
2376 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
2377 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
2378 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
2379 #define DC1B0 CCP1CONbits.DC1B0 // bit 4
2380 #define DC1B1 CCP1CONbits.DC1B1 // bit 5
2382 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
2383 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
2384 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
2385 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
2386 #define DC2B0 CCP2CONbits.DC2B0 // bit 4
2387 #define DC2B1 CCP2CONbits.DC2B1 // bit 5
2389 #define TAXCS CPSACON0bits.TAXCS // bit 0
2390 #define CPSAOUT CPSACON0bits.CPSAOUT // bit 1
2391 #define CPSARNG0 CPSACON0bits.CPSARNG0 // bit 2
2392 #define CPSARNG1 CPSACON0bits.CPSARNG1 // bit 3
2393 #define CPSARM CPSACON0bits.CPSARM // bit 6
2394 #define CPSAON CPSACON0bits.CPSAON // bit 7
2396 #define CPSACH0 CPSACON1bits.CPSACH0 // bit 0
2397 #define CPSACH1 CPSACON1bits.CPSACH1 // bit 1
2398 #define CPSACH2 CPSACON1bits.CPSACH2 // bit 2
2399 #define CPSACH3 CPSACON1bits.CPSACH3 // bit 3
2401 #define TBXCS CPSBCON0bits.TBXCS // bit 0
2402 #define CPSBOUT CPSBCON0bits.CPSBOUT // bit 1
2403 #define CPSBRNG0 CPSBCON0bits.CPSBRNG0 // bit 2
2404 #define CPSBRNG1 CPSBCON0bits.CPSBRNG1 // bit 3
2405 #define CPSBRM CPSBCON0bits.CPSBRM // bit 6
2406 #define CPSBON CPSBCON0bits.CPSBON // bit 7
2408 #define CPSBCH0 CPSBCON1bits.CPSBCH0 // bit 0
2409 #define CPSBCH1 CPSBCON1bits.CPSBCH1 // bit 1
2410 #define CPSBCH2 CPSBCON1bits.CPSBCH2 // bit 2
2411 #define CPSBCH3 CPSBCON1bits.CPSBCH3 // bit 3
2413 #define DACPSS0 DACCON0bits.DACPSS0 // bit 2
2414 #define DACPSS1 DACCON0bits.DACPSS1 // bit 3
2415 #define DACOE DACCON0bits.DACOE // bit 5
2416 #define DACLPS DACCON0bits.DACLPS // bit 6
2417 #define DACEN DACCON0bits.DACEN // bit 7
2419 #define DACR0 DACCON1bits.DACR0 // bit 0
2420 #define DACR1 DACCON1bits.DACR1 // bit 1
2421 #define DACR2 DACCON1bits.DACR2 // bit 2
2422 #define DACR3 DACCON1bits.DACR3 // bit 3
2423 #define DACR4 DACCON1bits.DACR4 // bit 4
2425 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
2426 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
2427 #define CDAFVR0 FVRCONbits.CDAFVR0 // bit 2
2428 #define CDAFVR1 FVRCONbits.CDAFVR1 // bit 3
2429 #define FVREN FVRCONbits.FVREN // bit 6
2430 #define FVRRDY FVRCONbits.FVRRDY // bit 7
2432 #define RBIF INTCONbits.RBIF // bit 0
2433 #define INTF INTCONbits.INTF // bit 1
2434 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
2435 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
2436 #define RBIE INTCONbits.RBIE // bit 3
2437 #define INTE INTCONbits.INTE // bit 4
2438 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
2439 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
2440 #define PEIE INTCONbits.PEIE // bit 6
2441 #define GIE INTCONbits.GIE // bit 7
2443 #define IOCB0 IOCBbits.IOCB0 // bit 0
2444 #define IOCB1 IOCBbits.IOCB1 // bit 1
2445 #define IOCB2 IOCBbits.IOCB2 // bit 2
2446 #define IOCB3 IOCBbits.IOCB3 // bit 3
2447 #define IOCB4 IOCBbits.IOCB4 // bit 4
2448 #define IOCB5 IOCBbits.IOCB5 // bit 5
2449 #define IOCB6 IOCBbits.IOCB6 // bit 6
2450 #define IOCB7 IOCBbits.IOCB7 // bit 7
2452 #define PS0 OPTION_REGbits.PS0 // bit 0
2453 #define PS1 OPTION_REGbits.PS1 // bit 1
2454 #define PS2 OPTION_REGbits.PS2 // bit 2
2455 #define PSA OPTION_REGbits.PSA // bit 3
2456 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
2457 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
2458 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
2459 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
2460 #define INTEDG OPTION_REGbits.INTEDG // bit 6
2461 #define NOT_RBPU OPTION_REGbits.NOT_RBPU // bit 7
2463 #define ICSS OSCCONbits.ICSS // bit 2
2464 #define ICSL OSCCONbits.ICSL // bit 3
2465 #define IRCF0 OSCCONbits.IRCF0 // bit 4
2466 #define IRCF1 OSCCONbits.IRCF1 // bit 5
2468 #define NOT_BOR PCONbits.NOT_BOR // bit 0
2469 #define NOT_POR PCONbits.NOT_POR // bit 1
2471 #define TMR1IE PIE1bits.TMR1IE // bit 0
2472 #define TMR2IE PIE1bits.TMR2IE // bit 1
2473 #define CCP1IE PIE1bits.CCP1IE // bit 2
2474 #define SSPIE PIE1bits.SSPIE // bit 3
2475 #define TXIE PIE1bits.TXIE // bit 4
2476 #define RCIE PIE1bits.RCIE // bit 5
2477 #define ADIE PIE1bits.ADIE // bit 6
2478 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
2480 #define CCP2IE PIE2bits.CCP2IE // bit 0
2481 #define TMRAIE PIE2bits.TMRAIE // bit 4
2482 #define TMRBIE PIE2bits.TMRBIE // bit 5
2483 #define TMR3IE PIE2bits.TMR3IE // bit 6
2484 #define TMR3GIE PIE2bits.TMR3GIE // bit 7
2486 #define TMR1IF PIR1bits.TMR1IF // bit 0
2487 #define TMR2IF PIR1bits.TMR2IF // bit 1
2488 #define CCP1IF PIR1bits.CCP1IF // bit 2
2489 #define SSPIF PIR1bits.SSPIF // bit 3
2490 #define TXIF PIR1bits.TXIF // bit 4
2491 #define RCIF PIR1bits.RCIF // bit 5
2492 #define ADIF PIR1bits.ADIF // bit 6
2493 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
2495 #define CCP2IF PIR2bits.CCP2IF // bit 0
2496 #define TMRAIF PIR2bits.TMRAIF // bit 4
2497 #define TMRBIF PIR2bits.TMRBIF // bit 5
2498 #define TMR3IF PIR2bits.TMR3IF // bit 6
2499 #define TMR3GIF PIR2bits.TMR3GIF // bit 7
2501 #define RD PMCON1bits.RD // bit 0
2503 #define RA0 PORTAbits.RA0 // bit 0, shadows bit in PORTAbits
2504 #define AN0 PORTAbits.AN0 // bit 0, shadows bit in PORTAbits
2505 #define RA1 PORTAbits.RA1 // bit 1, shadows bit in PORTAbits
2506 #define AN1 PORTAbits.AN1 // bit 1, shadows bit in PORTAbits
2507 #define CPSA0 PORTAbits.CPSA0 // bit 1, shadows bit in PORTAbits
2508 #define RA2 PORTAbits.RA2 // bit 2, shadows bit in PORTAbits
2509 #define AN2 PORTAbits.AN2 // bit 2, shadows bit in PORTAbits
2510 #define CPSA1 PORTAbits.CPSA1 // bit 2, shadows bit in PORTAbits
2511 #define DACOUT PORTAbits.DACOUT // bit 2, shadows bit in PORTAbits
2512 #define RA3 PORTAbits.RA3 // bit 3, shadows bit in PORTAbits
2513 #define AN3 PORTAbits.AN3 // bit 3, shadows bit in PORTAbits
2514 #define CPSA2 PORTAbits.CPSA2 // bit 3, shadows bit in PORTAbits
2515 #define RA4 PORTAbits.RA4 // bit 4, shadows bit in PORTAbits
2516 #define CPSA3 PORTAbits.CPSA3 // bit 4, shadows bit in PORTAbits
2517 #define T0CKI PORTAbits.T0CKI // bit 4, shadows bit in PORTAbits
2518 #define TACKI PORTAbits.TACKI // bit 4, shadows bit in PORTAbits
2519 #define RA5 PORTAbits.RA5 // bit 5, shadows bit in PORTAbits
2520 #define AN4 PORTAbits.AN4 // bit 5, shadows bit in PORTAbits
2521 #define CPSA4 PORTAbits.CPSA4 // bit 5, shadows bit in PORTAbits
2522 #define RA6 PORTAbits.RA6 // bit 6, shadows bit in PORTAbits
2523 #define OSC2 PORTAbits.OSC2 // bit 6, shadows bit in PORTAbits
2524 #define CPSB1 PORTAbits.CPSB1 // bit 6, shadows bit in PORTAbits
2525 #define CLKOUT PORTAbits.CLKOUT // bit 6, shadows bit in PORTAbits
2526 #define RA7 PORTAbits.RA7 // bit 7, shadows bit in PORTAbits
2527 #define OSC1 PORTAbits.OSC1 // bit 7, shadows bit in PORTAbits
2528 #define CPSB0 PORTAbits.CPSB0 // bit 7, shadows bit in PORTAbits
2529 #define CLKIN PORTAbits.CLKIN // bit 7, shadows bit in PORTAbits
2531 #define RB0 PORTBbits.RB0 // bit 0, shadows bit in PORTBbits
2532 #define AN12 PORTBbits.AN12 // bit 0, shadows bit in PORTBbits
2533 #define CPSB8 PORTBbits.CPSB8 // bit 0, shadows bit in PORTBbits
2534 #define RB1 PORTBbits.RB1 // bit 1, shadows bit in PORTBbits
2535 #define AN10 PORTBbits.AN10 // bit 1, shadows bit in PORTBbits
2536 #define CPSB9 PORTBbits.CPSB9 // bit 1, shadows bit in PORTBbits
2537 #define RB2 PORTBbits.RB2 // bit 2, shadows bit in PORTBbits
2538 #define AN8 PORTBbits.AN8 // bit 2, shadows bit in PORTBbits
2539 #define CPSB10 PORTBbits.CPSB10 // bit 2, shadows bit in PORTBbits
2540 #define RB3 PORTBbits.RB3 // bit 3, shadows bit in PORTBbits
2541 #define AN9 PORTBbits.AN9 // bit 3, shadows bit in PORTBbits
2542 #define CPSB11 PORTBbits.CPSB11 // bit 3, shadows bit in PORTBbits
2543 #define CCP2 PORTBbits.CCP2 // bit 3, shadows bit in PORTBbits
2544 #define RB4 PORTBbits.RB4 // bit 4, shadows bit in PORTBbits
2545 #define AN11 PORTBbits.AN11 // bit 4, shadows bit in PORTBbits
2546 #define CPSB12 PORTBbits.CPSB12 // bit 4, shadows bit in PORTBbits
2547 #define RB5 PORTBbits.RB5 // bit 5, shadows bit in PORTBbits
2548 #define AN13 PORTBbits.AN13 // bit 5, shadows bit in PORTBbits
2549 #define CPSB13 PORTBbits.CPSB13 // bit 5, shadows bit in PORTBbits
2550 #define T1G PORTBbits.T1G // bit 5, shadows bit in PORTBbits
2551 #define T3CKI PORTBbits.T3CKI // bit 5, shadows bit in PORTBbits
2552 #define RB6 PORTBbits.RB6 // bit 6, shadows bit in PORTBbits
2553 #define CPSB14 PORTBbits.CPSB14 // bit 6, shadows bit in PORTBbits
2554 #define RB7 PORTBbits.RB7 // bit 7, shadows bit in PORTBbits
2555 #define CPSB15 PORTBbits.CPSB15 // bit 7, shadows bit in PORTBbits
2557 #define RD0 PORTDbits.RD0 // bit 0, shadows bit in PORTDbits
2558 #define CPSB5 PORTDbits.CPSB5 // bit 0, shadows bit in PORTDbits
2559 #define T3G PORTDbits.T3G // bit 0, shadows bit in PORTDbits
2560 #define RD1 PORTDbits.RD1 // bit 1, shadows bit in PORTDbits
2561 #define CPSB6 PORTDbits.CPSB6 // bit 1, shadows bit in PORTDbits
2562 #define RD2 PORTDbits.RD2 // bit 2, shadows bit in PORTDbits
2563 #define CPSB7 PORTDbits.CPSB7 // bit 2, shadows bit in PORTDbits
2564 #define RD3 PORTDbits.RD3 // bit 3, shadows bit in PORTDbits
2565 #define CPSA8 PORTDbits.CPSA8 // bit 3, shadows bit in PORTDbits
2566 #define RD4 PORTDbits.RD4 // bit 4, shadows bit in PORTDbits
2567 #define CPSA12 PORTDbits.CPSA12 // bit 4, shadows bit in PORTDbits
2568 #define RD5 PORTDbits.RD5 // bit 5, shadows bit in PORTDbits
2569 #define CPSA13 PORTDbits.CPSA13 // bit 5, shadows bit in PORTDbits
2570 #define RD6 PORTDbits.RD6 // bit 6, shadows bit in PORTDbits
2571 #define CPSA14 PORTDbits.CPSA14 // bit 6, shadows bit in PORTDbits
2572 #define RD7 PORTDbits.RD7 // bit 7, shadows bit in PORTDbits
2573 #define CPSA15 PORTDbits.CPSA15 // bit 7, shadows bit in PORTDbits
2575 #define RE0 PORTEbits.RE0 // bit 0, shadows bit in PORTEbits
2576 #define AN5 PORTEbits.AN5 // bit 0, shadows bit in PORTEbits
2577 #define CPSA5 PORTEbits.CPSA5 // bit 0, shadows bit in PORTEbits
2578 #define RE1 PORTEbits.RE1 // bit 1, shadows bit in PORTEbits
2579 #define AN6 PORTEbits.AN6 // bit 1, shadows bit in PORTEbits
2580 #define CPSA6 PORTEbits.CPSA6 // bit 1, shadows bit in PORTEbits
2581 #define RE2 PORTEbits.RE2 // bit 2, shadows bit in PORTEbits
2582 #define AN7 PORTEbits.AN7 // bit 2, shadows bit in PORTEbits
2583 #define CPSA7 PORTEbits.CPSA7 // bit 2, shadows bit in PORTEbits
2584 #define RE3 PORTEbits.RE3 // bit 3, shadows bit in PORTEbits
2585 #define NOT_MCLR PORTEbits.NOT_MCLR // bit 3, shadows bit in PORTEbits
2587 #define RX9D RCSTAbits.RX9D // bit 0
2588 #define OERR RCSTAbits.OERR // bit 1
2589 #define FERR RCSTAbits.FERR // bit 2
2590 #define ADDEN RCSTAbits.ADDEN // bit 3
2591 #define CREN RCSTAbits.CREN // bit 4
2592 #define SREN RCSTAbits.SREN // bit 5
2593 #define RX9 RCSTAbits.RX9 // bit 6
2594 #define SPEN RCSTAbits.SPEN // bit 7
2596 #define SSPM0 SSPCONbits.SSPM0 // bit 0
2597 #define SSPM1 SSPCONbits.SSPM1 // bit 1
2598 #define SSPM2 SSPCONbits.SSPM2 // bit 2
2599 #define SSPM3 SSPCONbits.SSPM3 // bit 3
2600 #define CKP SSPCONbits.CKP // bit 4
2601 #define SSPEN SSPCONbits.SSPEN // bit 5
2602 #define SSPOV SSPCONbits.SSPOV // bit 6
2603 #define WCOL SSPCONbits.WCOL // bit 7
2605 #define BF SSPSTATbits.BF // bit 0
2606 #define UA SSPSTATbits.UA // bit 1
2607 #define R_NOT_W SSPSTATbits.R_NOT_W // bit 2
2608 #define S SSPSTATbits.S // bit 3
2609 #define P SSPSTATbits.P // bit 4
2610 #define D_NOT_A SSPSTATbits.D_NOT_A // bit 5
2611 #define CKE SSPSTATbits.CKE // bit 6
2612 #define SMP SSPSTATbits.SMP // bit 7
2614 #define C STATUSbits.C // bit 0
2615 #define DC STATUSbits.DC // bit 1
2616 #define Z STATUSbits.Z // bit 2
2617 #define NOT_PD STATUSbits.NOT_PD // bit 3
2618 #define NOT_TO STATUSbits.NOT_TO // bit 4
2619 #define RP0 STATUSbits.RP0 // bit 5
2620 #define RP1 STATUSbits.RP1 // bit 6
2621 #define IRP STATUSbits.IRP // bit 7
2623 #define TMR1ON T1CONbits.TMR1ON // bit 0
2624 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2, shadows bit in T1CONbits
2625 #define T1SYNC T1CONbits.T1SYNC // bit 2, shadows bit in T1CONbits
2626 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
2627 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
2628 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
2629 #define TMRCS0 T1CONbits.TMRCS0 // bit 6
2630 #define TMRCS1 T1CONbits.TMRCS1 // bit 7
2632 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0
2633 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1
2634 #define T1GVAL T1GCONbits.T1GVAL // bit 2
2635 #define T1GGO_NOT_DONE T1GCONbits.T1GGO_NOT_DONE // bit 3
2636 #define T1GSPM T1GCONbits.T1GSPM // bit 4
2637 #define T1GTM T1GCONbits.T1GTM // bit 5
2638 #define T1GPOL T1GCONbits.T1GPOL // bit 6
2639 #define TMR1GE T1GCONbits.TMR1GE // bit 7
2641 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
2642 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
2643 #define TMR2ON T2CONbits.TMR2ON // bit 2
2644 #define TOUTPS0 T2CONbits.TOUTPS0 // bit 3
2645 #define TOUTPS1 T2CONbits.TOUTPS1 // bit 4
2646 #define TOUTPS2 T2CONbits.TOUTPS2 // bit 5
2647 #define TOUTPS3 T2CONbits.TOUTPS3 // bit 6
2649 #define TMR3ON T3CONbits.TMR3ON // bit 0
2650 #define T3SYNC T3CONbits.T3SYNC // bit 2
2651 #define T3CKPS0 T3CONbits.T3CKPS0 // bit 4
2652 #define T3CKPS1 T3CONbits.T3CKPS1 // bit 5
2653 #define TMR3CS0 T3CONbits.TMR3CS0 // bit 6
2654 #define TMR3CS1 T3CONbits.TMR3CS1 // bit 7
2656 #define T3GSS0 T3GCONbits.T3GSS0 // bit 0
2657 #define T3GSS1 T3GCONbits.T3GSS1 // bit 1
2658 #define T3GVAL T3GCONbits.T3GVAL // bit 2
2659 #define T3GGO_NOT_DONE T3GCONbits.T3GGO_NOT_DONE // bit 3
2660 #define T3GSPM T3GCONbits.T3GSPM // bit 4
2661 #define T3GTM T3GCONbits.T3GTM // bit 5
2662 #define T3GPOL T3GCONbits.T3GPOL // bit 6
2663 #define TMR3GE T3GCONbits.TMR3GE // bit 7
2665 #define TAPS0 TACONbits.TAPS0 // bit 0, shadows bit in TACONbits
2666 #define TMRAPS0 TACONbits.TMRAPS0 // bit 0, shadows bit in TACONbits
2667 #define TAPS1 TACONbits.TAPS1 // bit 1, shadows bit in TACONbits
2668 #define TMRAPS1 TACONbits.TMRAPS1 // bit 1, shadows bit in TACONbits
2669 #define TAPS2 TACONbits.TAPS2 // bit 2, shadows bit in TACONbits
2670 #define TMRAPS2 TACONbits.TMRAPS2 // bit 2, shadows bit in TACONbits
2671 #define TAPSA TACONbits.TAPSA // bit 3, shadows bit in TACONbits
2672 #define TMRAPSA TACONbits.TMRAPSA // bit 3, shadows bit in TACONbits
2673 #define TASE TACONbits.TASE // bit 4, shadows bit in TACONbits
2674 #define TMRASE TACONbits.TMRASE // bit 4, shadows bit in TACONbits
2675 #define TACS TACONbits.TACS // bit 5, shadows bit in TACONbits
2676 #define TMRACS TACONbits.TMRACS // bit 5, shadows bit in TACONbits
2677 #define TMRAON TACONbits.TMRAON // bit 7
2679 #define TBPS0 TBCONbits.TBPS0 // bit 0, shadows bit in TBCONbits
2680 #define TMRBPS0 TBCONbits.TMRBPS0 // bit 0, shadows bit in TBCONbits
2681 #define TBPS1 TBCONbits.TBPS1 // bit 1, shadows bit in TBCONbits
2682 #define TMRBPS1 TBCONbits.TMRBPS1 // bit 1, shadows bit in TBCONbits
2683 #define TBPS2 TBCONbits.TBPS2 // bit 2, shadows bit in TBCONbits
2684 #define TMRBPS2 TBCONbits.TMRBPS2 // bit 2, shadows bit in TBCONbits
2685 #define TBPSA TBCONbits.TBPSA // bit 3, shadows bit in TBCONbits
2686 #define TMRBPSA TBCONbits.TMRBPSA // bit 3, shadows bit in TBCONbits
2687 #define TBSE TBCONbits.TBSE // bit 4, shadows bit in TBCONbits
2688 #define TMRBSE TBCONbits.TMRBSE // bit 4, shadows bit in TBCONbits
2689 #define TBCS TBCONbits.TBCS // bit 5, shadows bit in TBCONbits
2690 #define TMRBCS TBCONbits.TMRBCS // bit 5, shadows bit in TBCONbits
2691 #define TMRBON TBCONbits.TMRBON // bit 7
2693 #define TRISA0 TRISAbits.TRISA0 // bit 0
2694 #define TRISA1 TRISAbits.TRISA1 // bit 1
2695 #define TRISA2 TRISAbits.TRISA2 // bit 2
2696 #define TRISA3 TRISAbits.TRISA3 // bit 3
2697 #define TRISA4 TRISAbits.TRISA4 // bit 4
2698 #define TRISA5 TRISAbits.TRISA5 // bit 5
2699 #define TRISA6 TRISAbits.TRISA6 // bit 6
2700 #define TRISA7 TRISAbits.TRISA7 // bit 7
2702 #define TRISB0 TRISBbits.TRISB0 // bit 0
2703 #define TRISB1 TRISBbits.TRISB1 // bit 1
2704 #define TRISB2 TRISBbits.TRISB2 // bit 2
2705 #define TRISB3 TRISBbits.TRISB3 // bit 3
2706 #define TRISB4 TRISBbits.TRISB4 // bit 4
2707 #define TRISB5 TRISBbits.TRISB5 // bit 5
2708 #define TRISB6 TRISBbits.TRISB6 // bit 6
2709 #define TRISB7 TRISBbits.TRISB7 // bit 7
2711 #define TRISC0 TRISCbits.TRISC0 // bit 0
2712 #define TRISC1 TRISCbits.TRISC1 // bit 1
2713 #define TRISC2 TRISCbits.TRISC2 // bit 2
2714 #define TRISC3 TRISCbits.TRISC3 // bit 3
2715 #define TRISC4 TRISCbits.TRISC4 // bit 4
2716 #define TRISC5 TRISCbits.TRISC5 // bit 5
2717 #define TRISC6 TRISCbits.TRISC6 // bit 6
2718 #define TRISC7 TRISCbits.TRISC7 // bit 7
2720 #define TRISD0 TRISDbits.TRISD0 // bit 0
2721 #define TRISD1 TRISDbits.TRISD1 // bit 1
2722 #define TRISD2 TRISDbits.TRISD2 // bit 2
2723 #define TRISD3 TRISDbits.TRISD3 // bit 3
2724 #define TRISD4 TRISDbits.TRISD4 // bit 4
2725 #define TRISD5 TRISDbits.TRISD5 // bit 5
2726 #define TRISD6 TRISDbits.TRISD6 // bit 6
2727 #define TRISD7 TRISDbits.TRISD7 // bit 7
2729 #define TRISE0 TRISEbits.TRISE0 // bit 0
2730 #define TRISE1 TRISEbits.TRISE1 // bit 1
2731 #define TRISE2 TRISEbits.TRISE2 // bit 2
2732 #define TRISE3 TRISEbits.TRISE3 // bit 3
2734 #define TX9D TXSTAbits.TX9D // bit 0
2735 #define TRMT TXSTAbits.TRMT // bit 1
2736 #define BRGH TXSTAbits.BRGH // bit 2
2737 #define SYNC TXSTAbits.SYNC // bit 4
2738 #define TXEN TXSTAbits.TXEN // bit 5
2739 #define TX9 TXSTAbits.TX9 // bit 6
2740 #define CSRC TXSTAbits.CSRC // bit 7
2742 #define WPUB0 WPUBbits.WPUB0 // bit 0
2743 #define WPUB1 WPUBbits.WPUB1 // bit 1
2744 #define WPUB2 WPUBbits.WPUB2 // bit 2
2745 #define WPUB3 WPUBbits.WPUB3 // bit 3
2746 #define WPUB4 WPUBbits.WPUB4 // bit 4
2747 #define WPUB5 WPUBbits.WPUB5 // bit 5
2748 #define WPUB6 WPUBbits.WPUB6 // bit 6
2749 #define WPUB7 WPUBbits.WPUB7 // bit 7
2751 #endif // #ifndef NO_BIT_DEFINES
2753 #endif // #ifndef __PIC16LF707_H__