Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16lf1516.h
blobe5928631d2c1188c8ce282ddaba5673bc9a1243c
1 /*
2 * This declarations of the PIC16LF1516 MCU.
4 * This file is part of the GNU PIC library for SDCC, originally
5 * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
7 * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:06 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 __PIC16LF1516_H__
26 #define __PIC16LF1516_H__
28 //==============================================================================
30 // Register Addresses
32 //==============================================================================
34 #ifndef NO_ADDR_DEFINES
36 #define INDF0_ADDR 0x0000
37 #define INDF1_ADDR 0x0001
38 #define PCL_ADDR 0x0002
39 #define STATUS_ADDR 0x0003
40 #define FSR0_ADDR 0x0004
41 #define FSR0L_ADDR 0x0004
42 #define FSR0H_ADDR 0x0005
43 #define FSR1_ADDR 0x0006
44 #define FSR1L_ADDR 0x0006
45 #define FSR1H_ADDR 0x0007
46 #define BSR_ADDR 0x0008
47 #define WREG_ADDR 0x0009
48 #define PCLATH_ADDR 0x000A
49 #define INTCON_ADDR 0x000B
50 #define PORTA_ADDR 0x000C
51 #define PORTB_ADDR 0x000D
52 #define PORTC_ADDR 0x000E
53 #define PORTE_ADDR 0x0010
54 #define PIR1_ADDR 0x0011
55 #define PIR2_ADDR 0x0012
56 #define TMR0_ADDR 0x0015
57 #define TMR1_ADDR 0x0016
58 #define TMR1L_ADDR 0x0016
59 #define TMR1H_ADDR 0x0017
60 #define T1CON_ADDR 0x0018
61 #define T1GCON_ADDR 0x0019
62 #define TMR2_ADDR 0x001A
63 #define PR2_ADDR 0x001B
64 #define T2CON_ADDR 0x001C
65 #define TRISA_ADDR 0x008C
66 #define TRISB_ADDR 0x008D
67 #define TRISC_ADDR 0x008E
68 #define TRISE_ADDR 0x0090
69 #define PIE1_ADDR 0x0091
70 #define PIE2_ADDR 0x0092
71 #define OPTION_REG_ADDR 0x0095
72 #define PCON_ADDR 0x0096
73 #define WDTCON_ADDR 0x0097
74 #define OSCCON_ADDR 0x0099
75 #define OSCSTAT_ADDR 0x009A
76 #define ADRES_ADDR 0x009B
77 #define ADRESL_ADDR 0x009B
78 #define ADRESH_ADDR 0x009C
79 #define ADCON0_ADDR 0x009D
80 #define ADCON1_ADDR 0x009E
81 #define LATA_ADDR 0x010C
82 #define LATB_ADDR 0x010D
83 #define LATC_ADDR 0x010E
84 #define BORCON_ADDR 0x0116
85 #define FVRCON_ADDR 0x0117
86 #define APFCON_ADDR 0x011D
87 #define ANSELA_ADDR 0x018C
88 #define ANSELB_ADDR 0x018D
89 #define ANSELC_ADDR 0x018E
90 #define PMADR_ADDR 0x0191
91 #define PMADRL_ADDR 0x0191
92 #define PMADRH_ADDR 0x0192
93 #define PMDAT_ADDR 0x0193
94 #define PMDATL_ADDR 0x0193
95 #define PMDATH_ADDR 0x0194
96 #define PMCON1_ADDR 0x0195
97 #define PMCON2_ADDR 0x0196
98 #define RCREG_ADDR 0x0199
99 #define TXREG_ADDR 0x019A
100 #define SP1BRG_ADDR 0x019B
101 #define SP1BRGL_ADDR 0x019B
102 #define SPBRG_ADDR 0x019B
103 #define SPBRGL_ADDR 0x019B
104 #define SP1BRGH_ADDR 0x019C
105 #define SPBRGH_ADDR 0x019C
106 #define RCSTA_ADDR 0x019D
107 #define TXSTA_ADDR 0x019E
108 #define BAUDCON_ADDR 0x019F
109 #define WPUB_ADDR 0x020D
110 #define WPUE_ADDR 0x0210
111 #define SSP1BUF_ADDR 0x0211
112 #define SSPBUF_ADDR 0x0211
113 #define SSP1ADD_ADDR 0x0212
114 #define SSPADD_ADDR 0x0212
115 #define SSP1MSK_ADDR 0x0213
116 #define SSPMSK_ADDR 0x0213
117 #define SSP1STAT_ADDR 0x0214
118 #define SSPSTAT_ADDR 0x0214
119 #define SSP1CON1_ADDR 0x0215
120 #define SSPCON_ADDR 0x0215
121 #define SSPCON1_ADDR 0x0215
122 #define SSP1CON2_ADDR 0x0216
123 #define SSPCON2_ADDR 0x0216
124 #define SSP1CON3_ADDR 0x0217
125 #define SSPCON3_ADDR 0x0217
126 #define CCPR1_ADDR 0x0291
127 #define CCPR1L_ADDR 0x0291
128 #define CCPR1H_ADDR 0x0292
129 #define CCP1CON_ADDR 0x0293
130 #define CCPR2_ADDR 0x0298
131 #define CCPR2L_ADDR 0x0298
132 #define CCPR2H_ADDR 0x0299
133 #define CCP2CON_ADDR 0x029A
134 #define IOCBP_ADDR 0x0394
135 #define IOCBN_ADDR 0x0395
136 #define IOCBF_ADDR 0x0396
137 #define STATUS_SHAD_ADDR 0x0FE4
138 #define WREG_SHAD_ADDR 0x0FE5
139 #define BSR_SHAD_ADDR 0x0FE6
140 #define PCLATH_SHAD_ADDR 0x0FE7
141 #define FSR0L_SHAD_ADDR 0x0FE8
142 #define FSR0H_SHAD_ADDR 0x0FE9
143 #define FSR1L_SHAD_ADDR 0x0FEA
144 #define FSR1H_SHAD_ADDR 0x0FEB
145 #define STKPTR_ADDR 0x0FED
146 #define TOSL_ADDR 0x0FEE
147 #define TOSH_ADDR 0x0FEF
149 #endif // #ifndef NO_ADDR_DEFINES
151 //==============================================================================
153 // Register Definitions
155 //==============================================================================
157 extern __at(0x0000) __sfr INDF0;
158 extern __at(0x0001) __sfr INDF1;
159 extern __at(0x0002) __sfr PCL;
161 //==============================================================================
162 // STATUS Bits
164 extern __at(0x0003) __sfr STATUS;
166 typedef struct
168 unsigned C : 1;
169 unsigned DC : 1;
170 unsigned Z : 1;
171 unsigned NOT_PD : 1;
172 unsigned NOT_TO : 1;
173 unsigned : 1;
174 unsigned : 1;
175 unsigned : 1;
176 } __STATUSbits_t;
178 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
180 #define _C 0x01
181 #define _DC 0x02
182 #define _Z 0x04
183 #define _NOT_PD 0x08
184 #define _NOT_TO 0x10
186 //==============================================================================
188 extern __at(0x0004) __sfr FSR0;
189 extern __at(0x0004) __sfr FSR0L;
190 extern __at(0x0005) __sfr FSR0H;
191 extern __at(0x0006) __sfr FSR1;
192 extern __at(0x0006) __sfr FSR1L;
193 extern __at(0x0007) __sfr FSR1H;
195 //==============================================================================
196 // BSR Bits
198 extern __at(0x0008) __sfr BSR;
200 typedef union
202 struct
204 unsigned BSR0 : 1;
205 unsigned BSR1 : 1;
206 unsigned BSR2 : 1;
207 unsigned BSR3 : 1;
208 unsigned BSR4 : 1;
209 unsigned : 1;
210 unsigned : 1;
211 unsigned : 1;
214 struct
216 unsigned BSR : 5;
217 unsigned : 3;
219 } __BSRbits_t;
221 extern __at(0x0008) volatile __BSRbits_t BSRbits;
223 #define _BSR0 0x01
224 #define _BSR1 0x02
225 #define _BSR2 0x04
226 #define _BSR3 0x08
227 #define _BSR4 0x10
229 //==============================================================================
231 extern __at(0x0009) __sfr WREG;
232 extern __at(0x000A) __sfr PCLATH;
234 //==============================================================================
235 // INTCON Bits
237 extern __at(0x000B) __sfr INTCON;
239 typedef union
241 struct
243 unsigned IOCIF : 1;
244 unsigned INTF : 1;
245 unsigned TMR0IF : 1;
246 unsigned IOCIE : 1;
247 unsigned INTE : 1;
248 unsigned TMR0IE : 1;
249 unsigned PEIE : 1;
250 unsigned GIE : 1;
253 struct
255 unsigned : 1;
256 unsigned : 1;
257 unsigned T0IF : 1;
258 unsigned : 1;
259 unsigned : 1;
260 unsigned T0IE : 1;
261 unsigned : 1;
262 unsigned : 1;
264 } __INTCONbits_t;
266 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
268 #define _IOCIF 0x01
269 #define _INTF 0x02
270 #define _TMR0IF 0x04
271 #define _T0IF 0x04
272 #define _IOCIE 0x08
273 #define _INTE 0x10
274 #define _TMR0IE 0x20
275 #define _T0IE 0x20
276 #define _PEIE 0x40
277 #define _GIE 0x80
279 //==============================================================================
282 //==============================================================================
283 // PORTA Bits
285 extern __at(0x000C) __sfr PORTA;
287 typedef struct
289 unsigned RA0 : 1;
290 unsigned RA1 : 1;
291 unsigned RA2 : 1;
292 unsigned RA3 : 1;
293 unsigned RA4 : 1;
294 unsigned RA5 : 1;
295 unsigned RA6 : 1;
296 unsigned RA7 : 1;
297 } __PORTAbits_t;
299 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
301 #define _RA0 0x01
302 #define _RA1 0x02
303 #define _RA2 0x04
304 #define _RA3 0x08
305 #define _RA4 0x10
306 #define _RA5 0x20
307 #define _RA6 0x40
308 #define _RA7 0x80
310 //==============================================================================
313 //==============================================================================
314 // PORTB Bits
316 extern __at(0x000D) __sfr PORTB;
318 typedef struct
320 unsigned RB0 : 1;
321 unsigned RB1 : 1;
322 unsigned RB2 : 1;
323 unsigned RB3 : 1;
324 unsigned RB4 : 1;
325 unsigned RB5 : 1;
326 unsigned RB6 : 1;
327 unsigned RB7 : 1;
328 } __PORTBbits_t;
330 extern __at(0x000D) volatile __PORTBbits_t PORTBbits;
332 #define _RB0 0x01
333 #define _RB1 0x02
334 #define _RB2 0x04
335 #define _RB3 0x08
336 #define _RB4 0x10
337 #define _RB5 0x20
338 #define _RB6 0x40
339 #define _RB7 0x80
341 //==============================================================================
344 //==============================================================================
345 // PORTC Bits
347 extern __at(0x000E) __sfr PORTC;
349 typedef struct
351 unsigned RC0 : 1;
352 unsigned RC1 : 1;
353 unsigned RC2 : 1;
354 unsigned RC3 : 1;
355 unsigned RC4 : 1;
356 unsigned RC5 : 1;
357 unsigned RC6 : 1;
358 unsigned RC7 : 1;
359 } __PORTCbits_t;
361 extern __at(0x000E) volatile __PORTCbits_t PORTCbits;
363 #define _RC0 0x01
364 #define _RC1 0x02
365 #define _RC2 0x04
366 #define _RC3 0x08
367 #define _RC4 0x10
368 #define _RC5 0x20
369 #define _RC6 0x40
370 #define _RC7 0x80
372 //==============================================================================
375 //==============================================================================
376 // PORTE Bits
378 extern __at(0x0010) __sfr PORTE;
380 typedef struct
382 unsigned : 1;
383 unsigned : 1;
384 unsigned : 1;
385 unsigned RE3 : 1;
386 unsigned : 1;
387 unsigned : 1;
388 unsigned : 1;
389 unsigned : 1;
390 } __PORTEbits_t;
392 extern __at(0x0010) volatile __PORTEbits_t PORTEbits;
394 #define _RE3 0x08
396 //==============================================================================
399 //==============================================================================
400 // PIR1 Bits
402 extern __at(0x0011) __sfr PIR1;
404 typedef struct
406 unsigned TMR1IF : 1;
407 unsigned TMR2IF : 1;
408 unsigned CCP1IF : 1;
409 unsigned SSPIF : 1;
410 unsigned TXIF : 1;
411 unsigned RCIF : 1;
412 unsigned ADIF : 1;
413 unsigned TMR1GIF : 1;
414 } __PIR1bits_t;
416 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
418 #define _TMR1IF 0x01
419 #define _TMR2IF 0x02
420 #define _CCP1IF 0x04
421 #define _SSPIF 0x08
422 #define _TXIF 0x10
423 #define _RCIF 0x20
424 #define _ADIF 0x40
425 #define _TMR1GIF 0x80
427 //==============================================================================
430 //==============================================================================
431 // PIR2 Bits
433 extern __at(0x0012) __sfr PIR2;
435 typedef struct
437 unsigned CCP2IF : 1;
438 unsigned : 1;
439 unsigned : 1;
440 unsigned BCLIF : 1;
441 unsigned : 1;
442 unsigned : 1;
443 unsigned : 1;
444 unsigned OSFIF : 1;
445 } __PIR2bits_t;
447 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
449 #define _CCP2IF 0x01
450 #define _BCLIF 0x08
451 #define _OSFIF 0x80
453 //==============================================================================
455 extern __at(0x0015) __sfr TMR0;
456 extern __at(0x0016) __sfr TMR1;
457 extern __at(0x0016) __sfr TMR1L;
458 extern __at(0x0017) __sfr TMR1H;
460 //==============================================================================
461 // T1CON Bits
463 extern __at(0x0018) __sfr T1CON;
465 typedef union
467 struct
469 unsigned TMR1ON : 1;
470 unsigned : 1;
471 unsigned NOT_T1SYNC : 1;
472 unsigned T1OSCEN : 1;
473 unsigned T1CKPS0 : 1;
474 unsigned T1CKPS1 : 1;
475 unsigned TMR1CS0 : 1;
476 unsigned TMR1CS1 : 1;
479 struct
481 unsigned : 4;
482 unsigned T1CKPS : 2;
483 unsigned : 2;
486 struct
488 unsigned : 6;
489 unsigned TMR1CS : 2;
491 } __T1CONbits_t;
493 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
495 #define _TMR1ON 0x01
496 #define _NOT_T1SYNC 0x04
497 #define _T1OSCEN 0x08
498 #define _T1CKPS0 0x10
499 #define _T1CKPS1 0x20
500 #define _TMR1CS0 0x40
501 #define _TMR1CS1 0x80
503 //==============================================================================
506 //==============================================================================
507 // T1GCON Bits
509 extern __at(0x0019) __sfr T1GCON;
511 typedef union
513 struct
515 unsigned T1GSS0 : 1;
516 unsigned T1GSS1 : 1;
517 unsigned T1GVAL : 1;
518 unsigned T1GGO_NOT_DONE : 1;
519 unsigned T1GSPM : 1;
520 unsigned T1GTM : 1;
521 unsigned T1GPOL : 1;
522 unsigned TMR1GE : 1;
525 struct
527 unsigned T1GSS : 2;
528 unsigned : 6;
530 } __T1GCONbits_t;
532 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
534 #define _T1GSS0 0x01
535 #define _T1GSS1 0x02
536 #define _T1GVAL 0x04
537 #define _T1GGO_NOT_DONE 0x08
538 #define _T1GSPM 0x10
539 #define _T1GTM 0x20
540 #define _T1GPOL 0x40
541 #define _TMR1GE 0x80
543 //==============================================================================
545 extern __at(0x001A) __sfr TMR2;
546 extern __at(0x001B) __sfr PR2;
548 //==============================================================================
549 // T2CON Bits
551 extern __at(0x001C) __sfr T2CON;
553 typedef union
555 struct
557 unsigned T2CKPS0 : 1;
558 unsigned T2CKPS1 : 1;
559 unsigned TMR2ON : 1;
560 unsigned T2OUTPS0 : 1;
561 unsigned T2OUTPS1 : 1;
562 unsigned T2OUTPS2 : 1;
563 unsigned T2OUTPS3 : 1;
564 unsigned : 1;
567 struct
569 unsigned T2CKPS : 2;
570 unsigned : 6;
573 struct
575 unsigned : 3;
576 unsigned T2OUTPS : 4;
577 unsigned : 1;
579 } __T2CONbits_t;
581 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
583 #define _T2CKPS0 0x01
584 #define _T2CKPS1 0x02
585 #define _TMR2ON 0x04
586 #define _T2OUTPS0 0x08
587 #define _T2OUTPS1 0x10
588 #define _T2OUTPS2 0x20
589 #define _T2OUTPS3 0x40
591 //==============================================================================
594 //==============================================================================
595 // TRISA Bits
597 extern __at(0x008C) __sfr TRISA;
599 typedef struct
601 unsigned TRISA0 : 1;
602 unsigned TRISA1 : 1;
603 unsigned TRISA2 : 1;
604 unsigned TRISA3 : 1;
605 unsigned TRISA4 : 1;
606 unsigned TRISA5 : 1;
607 unsigned TRISA6 : 1;
608 unsigned TRISA7 : 1;
609 } __TRISAbits_t;
611 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
613 #define _TRISA0 0x01
614 #define _TRISA1 0x02
615 #define _TRISA2 0x04
616 #define _TRISA3 0x08
617 #define _TRISA4 0x10
618 #define _TRISA5 0x20
619 #define _TRISA6 0x40
620 #define _TRISA7 0x80
622 //==============================================================================
625 //==============================================================================
626 // TRISB Bits
628 extern __at(0x008D) __sfr TRISB;
630 typedef struct
632 unsigned TRISB0 : 1;
633 unsigned TRISB1 : 1;
634 unsigned TRISB2 : 1;
635 unsigned TRISB3 : 1;
636 unsigned TRISB4 : 1;
637 unsigned TRISB5 : 1;
638 unsigned TRISB6 : 1;
639 unsigned TRISB7 : 1;
640 } __TRISBbits_t;
642 extern __at(0x008D) volatile __TRISBbits_t TRISBbits;
644 #define _TRISB0 0x01
645 #define _TRISB1 0x02
646 #define _TRISB2 0x04
647 #define _TRISB3 0x08
648 #define _TRISB4 0x10
649 #define _TRISB5 0x20
650 #define _TRISB6 0x40
651 #define _TRISB7 0x80
653 //==============================================================================
656 //==============================================================================
657 // TRISC Bits
659 extern __at(0x008E) __sfr TRISC;
661 typedef struct
663 unsigned TRISC0 : 1;
664 unsigned TRISC1 : 1;
665 unsigned TRISC2 : 1;
666 unsigned TRISC3 : 1;
667 unsigned TRISC4 : 1;
668 unsigned TRISC5 : 1;
669 unsigned TRISC6 : 1;
670 unsigned TRISC7 : 1;
671 } __TRISCbits_t;
673 extern __at(0x008E) volatile __TRISCbits_t TRISCbits;
675 #define _TRISC0 0x01
676 #define _TRISC1 0x02
677 #define _TRISC2 0x04
678 #define _TRISC3 0x08
679 #define _TRISC4 0x10
680 #define _TRISC5 0x20
681 #define _TRISC6 0x40
682 #define _TRISC7 0x80
684 //==============================================================================
686 extern __at(0x0090) __sfr TRISE;
688 //==============================================================================
689 // PIE1 Bits
691 extern __at(0x0091) __sfr PIE1;
693 typedef struct
695 unsigned TMR1IE : 1;
696 unsigned TMR2IE : 1;
697 unsigned CCP1IE : 1;
698 unsigned SSPIE : 1;
699 unsigned TXIE : 1;
700 unsigned RCIE : 1;
701 unsigned ADIE : 1;
702 unsigned TMR1GIE : 1;
703 } __PIE1bits_t;
705 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
707 #define _TMR1IE 0x01
708 #define _TMR2IE 0x02
709 #define _CCP1IE 0x04
710 #define _SSPIE 0x08
711 #define _TXIE 0x10
712 #define _RCIE 0x20
713 #define _ADIE 0x40
714 #define _TMR1GIE 0x80
716 //==============================================================================
719 //==============================================================================
720 // PIE2 Bits
722 extern __at(0x0092) __sfr PIE2;
724 typedef struct
726 unsigned CCP2IE : 1;
727 unsigned : 1;
728 unsigned : 1;
729 unsigned BCLIE : 1;
730 unsigned : 1;
731 unsigned : 1;
732 unsigned : 1;
733 unsigned OSFIE : 1;
734 } __PIE2bits_t;
736 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
738 #define _CCP2IE 0x01
739 #define _BCLIE 0x08
740 #define _OSFIE 0x80
742 //==============================================================================
745 //==============================================================================
746 // OPTION_REG Bits
748 extern __at(0x0095) __sfr OPTION_REG;
750 typedef union
752 struct
754 unsigned PS0 : 1;
755 unsigned PS1 : 1;
756 unsigned PS2 : 1;
757 unsigned PSA : 1;
758 unsigned TMR0SE : 1;
759 unsigned TMR0CS : 1;
760 unsigned INTEDG : 1;
761 unsigned NOT_WPUEN : 1;
764 struct
766 unsigned : 1;
767 unsigned : 1;
768 unsigned : 1;
769 unsigned : 1;
770 unsigned T0SE : 1;
771 unsigned T0CS : 1;
772 unsigned : 1;
773 unsigned : 1;
776 struct
778 unsigned PS : 3;
779 unsigned : 5;
781 } __OPTION_REGbits_t;
783 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
785 #define _PS0 0x01
786 #define _PS1 0x02
787 #define _PS2 0x04
788 #define _PSA 0x08
789 #define _TMR0SE 0x10
790 #define _T0SE 0x10
791 #define _TMR0CS 0x20
792 #define _T0CS 0x20
793 #define _INTEDG 0x40
794 #define _NOT_WPUEN 0x80
796 //==============================================================================
799 //==============================================================================
800 // PCON Bits
802 extern __at(0x0096) __sfr PCON;
804 typedef struct
806 unsigned NOT_BOR : 1;
807 unsigned NOT_POR : 1;
808 unsigned NOT_RI : 1;
809 unsigned NOT_RMCLR : 1;
810 unsigned NOT_RWDT : 1;
811 unsigned : 1;
812 unsigned STKUNF : 1;
813 unsigned STKOVF : 1;
814 } __PCONbits_t;
816 extern __at(0x0096) volatile __PCONbits_t PCONbits;
818 #define _NOT_BOR 0x01
819 #define _NOT_POR 0x02
820 #define _NOT_RI 0x04
821 #define _NOT_RMCLR 0x08
822 #define _NOT_RWDT 0x10
823 #define _STKUNF 0x40
824 #define _STKOVF 0x80
826 //==============================================================================
829 //==============================================================================
830 // WDTCON Bits
832 extern __at(0x0097) __sfr WDTCON;
834 typedef union
836 struct
838 unsigned SWDTEN : 1;
839 unsigned WDTPS0 : 1;
840 unsigned WDTPS1 : 1;
841 unsigned WDTPS2 : 1;
842 unsigned WDTPS3 : 1;
843 unsigned WDTPS4 : 1;
844 unsigned : 1;
845 unsigned : 1;
848 struct
850 unsigned : 1;
851 unsigned WDTPS : 5;
852 unsigned : 2;
854 } __WDTCONbits_t;
856 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
858 #define _SWDTEN 0x01
859 #define _WDTPS0 0x02
860 #define _WDTPS1 0x04
861 #define _WDTPS2 0x08
862 #define _WDTPS3 0x10
863 #define _WDTPS4 0x20
865 //==============================================================================
868 //==============================================================================
869 // OSCCON Bits
871 extern __at(0x0099) __sfr OSCCON;
873 typedef union
875 struct
877 unsigned SCS0 : 1;
878 unsigned SCS1 : 1;
879 unsigned : 1;
880 unsigned IRCF0 : 1;
881 unsigned IRCF1 : 1;
882 unsigned IRCF2 : 1;
883 unsigned IRCF3 : 1;
884 unsigned : 1;
887 struct
889 unsigned SCS : 2;
890 unsigned : 6;
893 struct
895 unsigned : 3;
896 unsigned IRCF : 4;
897 unsigned : 1;
899 } __OSCCONbits_t;
901 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
903 #define _SCS0 0x01
904 #define _SCS1 0x02
905 #define _IRCF0 0x08
906 #define _IRCF1 0x10
907 #define _IRCF2 0x20
908 #define _IRCF3 0x40
910 //==============================================================================
913 //==============================================================================
914 // OSCSTAT Bits
916 extern __at(0x009A) __sfr OSCSTAT;
918 typedef union
920 struct
922 unsigned HFIOFS : 1;
923 unsigned LFIOFR : 1;
924 unsigned : 1;
925 unsigned : 1;
926 unsigned HFIOFR : 1;
927 unsigned OSTS : 1;
928 unsigned : 1;
929 unsigned SOSCR : 1;
932 struct
934 unsigned : 1;
935 unsigned : 1;
936 unsigned : 1;
937 unsigned : 1;
938 unsigned : 1;
939 unsigned : 1;
940 unsigned : 1;
941 unsigned T1OSCR : 1;
943 } __OSCSTATbits_t;
945 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
947 #define _HFIOFS 0x01
948 #define _LFIOFR 0x02
949 #define _HFIOFR 0x10
950 #define _OSTS 0x20
951 #define _SOSCR 0x80
952 #define _T1OSCR 0x80
954 //==============================================================================
956 extern __at(0x009B) __sfr ADRES;
957 extern __at(0x009B) __sfr ADRESL;
958 extern __at(0x009C) __sfr ADRESH;
960 //==============================================================================
961 // ADCON0 Bits
963 extern __at(0x009D) __sfr ADCON0;
965 typedef union
967 struct
969 unsigned ADON : 1;
970 unsigned GO_NOT_DONE : 1;
971 unsigned CHS0 : 1;
972 unsigned CHS1 : 1;
973 unsigned CHS2 : 1;
974 unsigned CHS3 : 1;
975 unsigned CHS4 : 1;
976 unsigned : 1;
979 struct
981 unsigned : 1;
982 unsigned ADGO : 1;
983 unsigned : 1;
984 unsigned : 1;
985 unsigned : 1;
986 unsigned : 1;
987 unsigned : 1;
988 unsigned : 1;
991 struct
993 unsigned : 1;
994 unsigned GO : 1;
995 unsigned : 1;
996 unsigned : 1;
997 unsigned : 1;
998 unsigned : 1;
999 unsigned : 1;
1000 unsigned : 1;
1003 struct
1005 unsigned : 2;
1006 unsigned CHS : 5;
1007 unsigned : 1;
1009 } __ADCON0bits_t;
1011 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1013 #define _ADON 0x01
1014 #define _GO_NOT_DONE 0x02
1015 #define _ADGO 0x02
1016 #define _GO 0x02
1017 #define _CHS0 0x04
1018 #define _CHS1 0x08
1019 #define _CHS2 0x10
1020 #define _CHS3 0x20
1021 #define _CHS4 0x40
1023 //==============================================================================
1026 //==============================================================================
1027 // ADCON1 Bits
1029 extern __at(0x009E) __sfr ADCON1;
1031 typedef union
1033 struct
1035 unsigned ADPREF0 : 1;
1036 unsigned ADPREF1 : 1;
1037 unsigned : 1;
1038 unsigned : 1;
1039 unsigned ADCS0 : 1;
1040 unsigned ADCS1 : 1;
1041 unsigned ADCS2 : 1;
1042 unsigned ADFM : 1;
1045 struct
1047 unsigned ADPREF : 2;
1048 unsigned : 6;
1051 struct
1053 unsigned : 4;
1054 unsigned ADCS : 3;
1055 unsigned : 1;
1057 } __ADCON1bits_t;
1059 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1061 #define _ADPREF0 0x01
1062 #define _ADPREF1 0x02
1063 #define _ADCS0 0x10
1064 #define _ADCS1 0x20
1065 #define _ADCS2 0x40
1066 #define _ADFM 0x80
1068 //==============================================================================
1071 //==============================================================================
1072 // LATA Bits
1074 extern __at(0x010C) __sfr LATA;
1076 typedef struct
1078 unsigned LATA0 : 1;
1079 unsigned LATA1 : 1;
1080 unsigned LATA2 : 1;
1081 unsigned LATA3 : 1;
1082 unsigned LATA4 : 1;
1083 unsigned LATA5 : 1;
1084 unsigned LATA6 : 1;
1085 unsigned LATA7 : 1;
1086 } __LATAbits_t;
1088 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1090 #define _LATA0 0x01
1091 #define _LATA1 0x02
1092 #define _LATA2 0x04
1093 #define _LATA3 0x08
1094 #define _LATA4 0x10
1095 #define _LATA5 0x20
1096 #define _LATA6 0x40
1097 #define _LATA7 0x80
1099 //==============================================================================
1102 //==============================================================================
1103 // LATB Bits
1105 extern __at(0x010D) __sfr LATB;
1107 typedef struct
1109 unsigned LATB0 : 1;
1110 unsigned LATB1 : 1;
1111 unsigned LATB2 : 1;
1112 unsigned LATB3 : 1;
1113 unsigned LATB4 : 1;
1114 unsigned LATB5 : 1;
1115 unsigned LATB6 : 1;
1116 unsigned LATB7 : 1;
1117 } __LATBbits_t;
1119 extern __at(0x010D) volatile __LATBbits_t LATBbits;
1121 #define _LATB0 0x01
1122 #define _LATB1 0x02
1123 #define _LATB2 0x04
1124 #define _LATB3 0x08
1125 #define _LATB4 0x10
1126 #define _LATB5 0x20
1127 #define _LATB6 0x40
1128 #define _LATB7 0x80
1130 //==============================================================================
1133 //==============================================================================
1134 // LATC Bits
1136 extern __at(0x010E) __sfr LATC;
1138 typedef struct
1140 unsigned LATC0 : 1;
1141 unsigned LATC1 : 1;
1142 unsigned LATC2 : 1;
1143 unsigned LATC3 : 1;
1144 unsigned LATC4 : 1;
1145 unsigned LATC5 : 1;
1146 unsigned LATC6 : 1;
1147 unsigned LATC7 : 1;
1148 } __LATCbits_t;
1150 extern __at(0x010E) volatile __LATCbits_t LATCbits;
1152 #define _LATC0 0x01
1153 #define _LATC1 0x02
1154 #define _LATC2 0x04
1155 #define _LATC3 0x08
1156 #define _LATC4 0x10
1157 #define _LATC5 0x20
1158 #define _LATC6 0x40
1159 #define _LATC7 0x80
1161 //==============================================================================
1164 //==============================================================================
1165 // BORCON Bits
1167 extern __at(0x0116) __sfr BORCON;
1169 typedef struct
1171 unsigned BORRDY : 1;
1172 unsigned : 1;
1173 unsigned : 1;
1174 unsigned : 1;
1175 unsigned : 1;
1176 unsigned : 1;
1177 unsigned BORFS : 1;
1178 unsigned SBOREN : 1;
1179 } __BORCONbits_t;
1181 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1183 #define _BORRDY 0x01
1184 #define _BORFS 0x40
1185 #define _SBOREN 0x80
1187 //==============================================================================
1190 //==============================================================================
1191 // FVRCON Bits
1193 extern __at(0x0117) __sfr FVRCON;
1195 typedef union
1197 struct
1199 unsigned ADFVR0 : 1;
1200 unsigned ADFVR1 : 1;
1201 unsigned : 1;
1202 unsigned : 1;
1203 unsigned TSRNG : 1;
1204 unsigned TSEN : 1;
1205 unsigned FVRRDY : 1;
1206 unsigned FVREN : 1;
1209 struct
1211 unsigned ADFVR : 2;
1212 unsigned : 6;
1214 } __FVRCONbits_t;
1216 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1218 #define _ADFVR0 0x01
1219 #define _ADFVR1 0x02
1220 #define _TSRNG 0x10
1221 #define _TSEN 0x20
1222 #define _FVRRDY 0x40
1223 #define _FVREN 0x80
1225 //==============================================================================
1228 //==============================================================================
1229 // APFCON Bits
1231 extern __at(0x011D) __sfr APFCON;
1233 typedef struct
1235 unsigned CCP2SEL : 1;
1236 unsigned SSSEL : 1;
1237 unsigned : 1;
1238 unsigned : 1;
1239 unsigned : 1;
1240 unsigned : 1;
1241 unsigned : 1;
1242 unsigned : 1;
1243 } __APFCONbits_t;
1245 extern __at(0x011D) volatile __APFCONbits_t APFCONbits;
1247 #define _CCP2SEL 0x01
1248 #define _SSSEL 0x02
1250 //==============================================================================
1253 //==============================================================================
1254 // ANSELA Bits
1256 extern __at(0x018C) __sfr ANSELA;
1258 typedef struct
1260 unsigned ANSA0 : 1;
1261 unsigned ANSA1 : 1;
1262 unsigned ANSA2 : 1;
1263 unsigned ANSA3 : 1;
1264 unsigned : 1;
1265 unsigned ANSA5 : 1;
1266 unsigned : 1;
1267 unsigned : 1;
1268 } __ANSELAbits_t;
1270 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1272 #define _ANSA0 0x01
1273 #define _ANSA1 0x02
1274 #define _ANSA2 0x04
1275 #define _ANSA3 0x08
1276 #define _ANSA5 0x20
1278 //==============================================================================
1281 //==============================================================================
1282 // ANSELB Bits
1284 extern __at(0x018D) __sfr ANSELB;
1286 typedef union
1288 struct
1290 unsigned ANSB0 : 1;
1291 unsigned ANSB1 : 1;
1292 unsigned ANSB2 : 1;
1293 unsigned ANSB3 : 1;
1294 unsigned ANSB4 : 1;
1295 unsigned ANSB5 : 1;
1296 unsigned : 1;
1297 unsigned : 1;
1300 struct
1302 unsigned ANSB : 6;
1303 unsigned : 2;
1305 } __ANSELBbits_t;
1307 extern __at(0x018D) volatile __ANSELBbits_t ANSELBbits;
1309 #define _ANSB0 0x01
1310 #define _ANSB1 0x02
1311 #define _ANSB2 0x04
1312 #define _ANSB3 0x08
1313 #define _ANSB4 0x10
1314 #define _ANSB5 0x20
1316 //==============================================================================
1319 //==============================================================================
1320 // ANSELC Bits
1322 extern __at(0x018E) __sfr ANSELC;
1324 typedef struct
1326 unsigned : 1;
1327 unsigned : 1;
1328 unsigned ANSC2 : 1;
1329 unsigned ANSC3 : 1;
1330 unsigned ANSC4 : 1;
1331 unsigned ANSC5 : 1;
1332 unsigned ANSC6 : 1;
1333 unsigned ANSC7 : 1;
1334 } __ANSELCbits_t;
1336 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits;
1338 #define _ANSC2 0x04
1339 #define _ANSC3 0x08
1340 #define _ANSC4 0x10
1341 #define _ANSC5 0x20
1342 #define _ANSC6 0x40
1343 #define _ANSC7 0x80
1345 //==============================================================================
1347 extern __at(0x0191) __sfr PMADR;
1348 extern __at(0x0191) __sfr PMADRL;
1349 extern __at(0x0192) __sfr PMADRH;
1350 extern __at(0x0193) __sfr PMDAT;
1351 extern __at(0x0193) __sfr PMDATL;
1352 extern __at(0x0194) __sfr PMDATH;
1354 //==============================================================================
1355 // PMCON1 Bits
1357 extern __at(0x0195) __sfr PMCON1;
1359 typedef struct
1361 unsigned RD : 1;
1362 unsigned WR : 1;
1363 unsigned WREN : 1;
1364 unsigned WRERR : 1;
1365 unsigned FREE : 1;
1366 unsigned LWLO : 1;
1367 unsigned CFGS : 1;
1368 unsigned : 1;
1369 } __PMCON1bits_t;
1371 extern __at(0x0195) volatile __PMCON1bits_t PMCON1bits;
1373 #define _RD 0x01
1374 #define _WR 0x02
1375 #define _WREN 0x04
1376 #define _WRERR 0x08
1377 #define _FREE 0x10
1378 #define _LWLO 0x20
1379 #define _CFGS 0x40
1381 //==============================================================================
1383 extern __at(0x0196) __sfr PMCON2;
1384 extern __at(0x0199) __sfr RCREG;
1385 extern __at(0x019A) __sfr TXREG;
1386 extern __at(0x019B) __sfr SP1BRG;
1387 extern __at(0x019B) __sfr SP1BRGL;
1388 extern __at(0x019B) __sfr SPBRG;
1389 extern __at(0x019B) __sfr SPBRGL;
1390 extern __at(0x019C) __sfr SP1BRGH;
1391 extern __at(0x019C) __sfr SPBRGH;
1393 //==============================================================================
1394 // RCSTA Bits
1396 extern __at(0x019D) __sfr RCSTA;
1398 typedef struct
1400 unsigned RX9D : 1;
1401 unsigned OERR : 1;
1402 unsigned FERR : 1;
1403 unsigned ADDEN : 1;
1404 unsigned CREN : 1;
1405 unsigned SREN : 1;
1406 unsigned RX9 : 1;
1407 unsigned SPEN : 1;
1408 } __RCSTAbits_t;
1410 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
1412 #define _RX9D 0x01
1413 #define _OERR 0x02
1414 #define _FERR 0x04
1415 #define _ADDEN 0x08
1416 #define _CREN 0x10
1417 #define _SREN 0x20
1418 #define _RX9 0x40
1419 #define _SPEN 0x80
1421 //==============================================================================
1424 //==============================================================================
1425 // TXSTA Bits
1427 extern __at(0x019E) __sfr TXSTA;
1429 typedef struct
1431 unsigned TX9D : 1;
1432 unsigned TRMT : 1;
1433 unsigned BRGH : 1;
1434 unsigned SENDB : 1;
1435 unsigned SYNC : 1;
1436 unsigned TXEN : 1;
1437 unsigned TX9 : 1;
1438 unsigned CSRC : 1;
1439 } __TXSTAbits_t;
1441 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
1443 #define _TX9D 0x01
1444 #define _TRMT 0x02
1445 #define _BRGH 0x04
1446 #define _SENDB 0x08
1447 #define _SYNC 0x10
1448 #define _TXEN 0x20
1449 #define _TX9 0x40
1450 #define _CSRC 0x80
1452 //==============================================================================
1455 //==============================================================================
1456 // BAUDCON Bits
1458 extern __at(0x019F) __sfr BAUDCON;
1460 typedef struct
1462 unsigned ABDEN : 1;
1463 unsigned WUE : 1;
1464 unsigned : 1;
1465 unsigned BRG16 : 1;
1466 unsigned SCKP : 1;
1467 unsigned : 1;
1468 unsigned RCIDL : 1;
1469 unsigned ABDOVF : 1;
1470 } __BAUDCONbits_t;
1472 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
1474 #define _ABDEN 0x01
1475 #define _WUE 0x02
1476 #define _BRG16 0x08
1477 #define _SCKP 0x10
1478 #define _RCIDL 0x40
1479 #define _ABDOVF 0x80
1481 //==============================================================================
1484 //==============================================================================
1485 // WPUB Bits
1487 extern __at(0x020D) __sfr WPUB;
1489 typedef struct
1491 unsigned WPUB0 : 1;
1492 unsigned WPUB1 : 1;
1493 unsigned WPUB2 : 1;
1494 unsigned WPUB3 : 1;
1495 unsigned WPUB4 : 1;
1496 unsigned WPUB5 : 1;
1497 unsigned WPUB6 : 1;
1498 unsigned WPUB7 : 1;
1499 } __WPUBbits_t;
1501 extern __at(0x020D) volatile __WPUBbits_t WPUBbits;
1503 #define _WPUB0 0x01
1504 #define _WPUB1 0x02
1505 #define _WPUB2 0x04
1506 #define _WPUB3 0x08
1507 #define _WPUB4 0x10
1508 #define _WPUB5 0x20
1509 #define _WPUB6 0x40
1510 #define _WPUB7 0x80
1512 //==============================================================================
1515 //==============================================================================
1516 // WPUE Bits
1518 extern __at(0x0210) __sfr WPUE;
1520 typedef struct
1522 unsigned : 1;
1523 unsigned : 1;
1524 unsigned : 1;
1525 unsigned WPUE3 : 1;
1526 unsigned : 1;
1527 unsigned : 1;
1528 unsigned : 1;
1529 unsigned : 1;
1530 } __WPUEbits_t;
1532 extern __at(0x0210) volatile __WPUEbits_t WPUEbits;
1534 #define _WPUE3 0x08
1536 //==============================================================================
1538 extern __at(0x0211) __sfr SSP1BUF;
1539 extern __at(0x0211) __sfr SSPBUF;
1540 extern __at(0x0212) __sfr SSP1ADD;
1541 extern __at(0x0212) __sfr SSPADD;
1542 extern __at(0x0213) __sfr SSP1MSK;
1543 extern __at(0x0213) __sfr SSPMSK;
1545 //==============================================================================
1546 // SSP1STAT Bits
1548 extern __at(0x0214) __sfr SSP1STAT;
1550 typedef struct
1552 unsigned BF : 1;
1553 unsigned UA : 1;
1554 unsigned R_NOT_W : 1;
1555 unsigned S : 1;
1556 unsigned P : 1;
1557 unsigned D_NOT_A : 1;
1558 unsigned CKE : 1;
1559 unsigned SMP : 1;
1560 } __SSP1STATbits_t;
1562 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
1564 #define _BF 0x01
1565 #define _UA 0x02
1566 #define _R_NOT_W 0x04
1567 #define _S 0x08
1568 #define _P 0x10
1569 #define _D_NOT_A 0x20
1570 #define _CKE 0x40
1571 #define _SMP 0x80
1573 //==============================================================================
1576 //==============================================================================
1577 // SSPSTAT Bits
1579 extern __at(0x0214) __sfr SSPSTAT;
1581 typedef struct
1583 unsigned BF : 1;
1584 unsigned UA : 1;
1585 unsigned R_NOT_W : 1;
1586 unsigned S : 1;
1587 unsigned P : 1;
1588 unsigned D_NOT_A : 1;
1589 unsigned CKE : 1;
1590 unsigned SMP : 1;
1591 } __SSPSTATbits_t;
1593 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
1595 #define _SSPSTAT_BF 0x01
1596 #define _SSPSTAT_UA 0x02
1597 #define _SSPSTAT_R_NOT_W 0x04
1598 #define _SSPSTAT_S 0x08
1599 #define _SSPSTAT_P 0x10
1600 #define _SSPSTAT_D_NOT_A 0x20
1601 #define _SSPSTAT_CKE 0x40
1602 #define _SSPSTAT_SMP 0x80
1604 //==============================================================================
1607 //==============================================================================
1608 // SSP1CON1 Bits
1610 extern __at(0x0215) __sfr SSP1CON1;
1612 typedef union
1614 struct
1616 unsigned SSPM0 : 1;
1617 unsigned SSPM1 : 1;
1618 unsigned SSPM2 : 1;
1619 unsigned SSPM3 : 1;
1620 unsigned CKP : 1;
1621 unsigned SSPEN : 1;
1622 unsigned SSPOV : 1;
1623 unsigned WCOL : 1;
1626 struct
1628 unsigned SSPM : 4;
1629 unsigned : 4;
1631 } __SSP1CON1bits_t;
1633 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
1635 #define _SSPM0 0x01
1636 #define _SSPM1 0x02
1637 #define _SSPM2 0x04
1638 #define _SSPM3 0x08
1639 #define _CKP 0x10
1640 #define _SSPEN 0x20
1641 #define _SSPOV 0x40
1642 #define _WCOL 0x80
1644 //==============================================================================
1647 //==============================================================================
1648 // SSPCON Bits
1650 extern __at(0x0215) __sfr SSPCON;
1652 typedef union
1654 struct
1656 unsigned SSPM0 : 1;
1657 unsigned SSPM1 : 1;
1658 unsigned SSPM2 : 1;
1659 unsigned SSPM3 : 1;
1660 unsigned CKP : 1;
1661 unsigned SSPEN : 1;
1662 unsigned SSPOV : 1;
1663 unsigned WCOL : 1;
1666 struct
1668 unsigned SSPM : 4;
1669 unsigned : 4;
1671 } __SSPCONbits_t;
1673 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
1675 #define _SSPCON_SSPM0 0x01
1676 #define _SSPCON_SSPM1 0x02
1677 #define _SSPCON_SSPM2 0x04
1678 #define _SSPCON_SSPM3 0x08
1679 #define _SSPCON_CKP 0x10
1680 #define _SSPCON_SSPEN 0x20
1681 #define _SSPCON_SSPOV 0x40
1682 #define _SSPCON_WCOL 0x80
1684 //==============================================================================
1687 //==============================================================================
1688 // SSPCON1 Bits
1690 extern __at(0x0215) __sfr SSPCON1;
1692 typedef union
1694 struct
1696 unsigned SSPM0 : 1;
1697 unsigned SSPM1 : 1;
1698 unsigned SSPM2 : 1;
1699 unsigned SSPM3 : 1;
1700 unsigned CKP : 1;
1701 unsigned SSPEN : 1;
1702 unsigned SSPOV : 1;
1703 unsigned WCOL : 1;
1706 struct
1708 unsigned SSPM : 4;
1709 unsigned : 4;
1711 } __SSPCON1bits_t;
1713 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
1715 #define _SSPCON1_SSPM0 0x01
1716 #define _SSPCON1_SSPM1 0x02
1717 #define _SSPCON1_SSPM2 0x04
1718 #define _SSPCON1_SSPM3 0x08
1719 #define _SSPCON1_CKP 0x10
1720 #define _SSPCON1_SSPEN 0x20
1721 #define _SSPCON1_SSPOV 0x40
1722 #define _SSPCON1_WCOL 0x80
1724 //==============================================================================
1727 //==============================================================================
1728 // SSP1CON2 Bits
1730 extern __at(0x0216) __sfr SSP1CON2;
1732 typedef struct
1734 unsigned SEN : 1;
1735 unsigned RSEN : 1;
1736 unsigned PEN : 1;
1737 unsigned RCEN : 1;
1738 unsigned ACKEN : 1;
1739 unsigned ACKDT : 1;
1740 unsigned ACKSTAT : 1;
1741 unsigned GCEN : 1;
1742 } __SSP1CON2bits_t;
1744 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
1746 #define _SEN 0x01
1747 #define _RSEN 0x02
1748 #define _PEN 0x04
1749 #define _RCEN 0x08
1750 #define _ACKEN 0x10
1751 #define _ACKDT 0x20
1752 #define _ACKSTAT 0x40
1753 #define _GCEN 0x80
1755 //==============================================================================
1758 //==============================================================================
1759 // SSPCON2 Bits
1761 extern __at(0x0216) __sfr SSPCON2;
1763 typedef struct
1765 unsigned SEN : 1;
1766 unsigned RSEN : 1;
1767 unsigned PEN : 1;
1768 unsigned RCEN : 1;
1769 unsigned ACKEN : 1;
1770 unsigned ACKDT : 1;
1771 unsigned ACKSTAT : 1;
1772 unsigned GCEN : 1;
1773 } __SSPCON2bits_t;
1775 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
1777 #define _SSPCON2_SEN 0x01
1778 #define _SSPCON2_RSEN 0x02
1779 #define _SSPCON2_PEN 0x04
1780 #define _SSPCON2_RCEN 0x08
1781 #define _SSPCON2_ACKEN 0x10
1782 #define _SSPCON2_ACKDT 0x20
1783 #define _SSPCON2_ACKSTAT 0x40
1784 #define _SSPCON2_GCEN 0x80
1786 //==============================================================================
1789 //==============================================================================
1790 // SSP1CON3 Bits
1792 extern __at(0x0217) __sfr SSP1CON3;
1794 typedef struct
1796 unsigned DHEN : 1;
1797 unsigned AHEN : 1;
1798 unsigned SBCDE : 1;
1799 unsigned SDAHT : 1;
1800 unsigned BOEN : 1;
1801 unsigned SCIE : 1;
1802 unsigned PCIE : 1;
1803 unsigned ACKTIM : 1;
1804 } __SSP1CON3bits_t;
1806 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
1808 #define _DHEN 0x01
1809 #define _AHEN 0x02
1810 #define _SBCDE 0x04
1811 #define _SDAHT 0x08
1812 #define _BOEN 0x10
1813 #define _SCIE 0x20
1814 #define _PCIE 0x40
1815 #define _ACKTIM 0x80
1817 //==============================================================================
1820 //==============================================================================
1821 // SSPCON3 Bits
1823 extern __at(0x0217) __sfr SSPCON3;
1825 typedef struct
1827 unsigned DHEN : 1;
1828 unsigned AHEN : 1;
1829 unsigned SBCDE : 1;
1830 unsigned SDAHT : 1;
1831 unsigned BOEN : 1;
1832 unsigned SCIE : 1;
1833 unsigned PCIE : 1;
1834 unsigned ACKTIM : 1;
1835 } __SSPCON3bits_t;
1837 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
1839 #define _SSPCON3_DHEN 0x01
1840 #define _SSPCON3_AHEN 0x02
1841 #define _SSPCON3_SBCDE 0x04
1842 #define _SSPCON3_SDAHT 0x08
1843 #define _SSPCON3_BOEN 0x10
1844 #define _SSPCON3_SCIE 0x20
1845 #define _SSPCON3_PCIE 0x40
1846 #define _SSPCON3_ACKTIM 0x80
1848 //==============================================================================
1850 extern __at(0x0291) __sfr CCPR1;
1851 extern __at(0x0291) __sfr CCPR1L;
1852 extern __at(0x0292) __sfr CCPR1H;
1854 //==============================================================================
1855 // CCP1CON Bits
1857 extern __at(0x0293) __sfr CCP1CON;
1859 typedef union
1861 struct
1863 unsigned CCP1M0 : 1;
1864 unsigned CCP1M1 : 1;
1865 unsigned CCP1M2 : 1;
1866 unsigned CCP1M3 : 1;
1867 unsigned DC1B0 : 1;
1868 unsigned DC1B1 : 1;
1869 unsigned : 1;
1870 unsigned : 1;
1873 struct
1875 unsigned CCP1M : 4;
1876 unsigned : 4;
1879 struct
1881 unsigned : 4;
1882 unsigned DC1B : 2;
1883 unsigned : 2;
1885 } __CCP1CONbits_t;
1887 extern __at(0x0293) volatile __CCP1CONbits_t CCP1CONbits;
1889 #define _CCP1M0 0x01
1890 #define _CCP1M1 0x02
1891 #define _CCP1M2 0x04
1892 #define _CCP1M3 0x08
1893 #define _DC1B0 0x10
1894 #define _DC1B1 0x20
1896 //==============================================================================
1898 extern __at(0x0298) __sfr CCPR2;
1899 extern __at(0x0298) __sfr CCPR2L;
1900 extern __at(0x0299) __sfr CCPR2H;
1902 //==============================================================================
1903 // CCP2CON Bits
1905 extern __at(0x029A) __sfr CCP2CON;
1907 typedef union
1909 struct
1911 unsigned CCP2M0 : 1;
1912 unsigned CCP2M1 : 1;
1913 unsigned CCP2M2 : 1;
1914 unsigned CCP2M3 : 1;
1915 unsigned DC2B0 : 1;
1916 unsigned DC2B1 : 1;
1917 unsigned : 1;
1918 unsigned : 1;
1921 struct
1923 unsigned CCP2M : 4;
1924 unsigned : 4;
1927 struct
1929 unsigned : 4;
1930 unsigned DC2B : 2;
1931 unsigned : 2;
1933 } __CCP2CONbits_t;
1935 extern __at(0x029A) volatile __CCP2CONbits_t CCP2CONbits;
1937 #define _CCP2M0 0x01
1938 #define _CCP2M1 0x02
1939 #define _CCP2M2 0x04
1940 #define _CCP2M3 0x08
1941 #define _DC2B0 0x10
1942 #define _DC2B1 0x20
1944 //==============================================================================
1947 //==============================================================================
1948 // IOCBP Bits
1950 extern __at(0x0394) __sfr IOCBP;
1952 typedef struct
1954 unsigned IOCBP0 : 1;
1955 unsigned IOCBP1 : 1;
1956 unsigned IOCBP2 : 1;
1957 unsigned IOCBP3 : 1;
1958 unsigned IOCBP4 : 1;
1959 unsigned IOCBP5 : 1;
1960 unsigned IOCBP6 : 1;
1961 unsigned IOCBP7 : 1;
1962 } __IOCBPbits_t;
1964 extern __at(0x0394) volatile __IOCBPbits_t IOCBPbits;
1966 #define _IOCBP0 0x01
1967 #define _IOCBP1 0x02
1968 #define _IOCBP2 0x04
1969 #define _IOCBP3 0x08
1970 #define _IOCBP4 0x10
1971 #define _IOCBP5 0x20
1972 #define _IOCBP6 0x40
1973 #define _IOCBP7 0x80
1975 //==============================================================================
1978 //==============================================================================
1979 // IOCBN Bits
1981 extern __at(0x0395) __sfr IOCBN;
1983 typedef struct
1985 unsigned IOCBN0 : 1;
1986 unsigned IOCBN1 : 1;
1987 unsigned IOCBN2 : 1;
1988 unsigned IOCBN3 : 1;
1989 unsigned IOCBN4 : 1;
1990 unsigned IOCBN5 : 1;
1991 unsigned IOCBN6 : 1;
1992 unsigned IOCBN7 : 1;
1993 } __IOCBNbits_t;
1995 extern __at(0x0395) volatile __IOCBNbits_t IOCBNbits;
1997 #define _IOCBN0 0x01
1998 #define _IOCBN1 0x02
1999 #define _IOCBN2 0x04
2000 #define _IOCBN3 0x08
2001 #define _IOCBN4 0x10
2002 #define _IOCBN5 0x20
2003 #define _IOCBN6 0x40
2004 #define _IOCBN7 0x80
2006 //==============================================================================
2009 //==============================================================================
2010 // IOCBF Bits
2012 extern __at(0x0396) __sfr IOCBF;
2014 typedef struct
2016 unsigned IOCBF0 : 1;
2017 unsigned IOCBF1 : 1;
2018 unsigned IOCBF2 : 1;
2019 unsigned IOCBF3 : 1;
2020 unsigned IOCBF4 : 1;
2021 unsigned IOCBF5 : 1;
2022 unsigned IOCBF6 : 1;
2023 unsigned IOCBF7 : 1;
2024 } __IOCBFbits_t;
2026 extern __at(0x0396) volatile __IOCBFbits_t IOCBFbits;
2028 #define _IOCBF0 0x01
2029 #define _IOCBF1 0x02
2030 #define _IOCBF2 0x04
2031 #define _IOCBF3 0x08
2032 #define _IOCBF4 0x10
2033 #define _IOCBF5 0x20
2034 #define _IOCBF6 0x40
2035 #define _IOCBF7 0x80
2037 //==============================================================================
2040 //==============================================================================
2041 // STATUS_SHAD Bits
2043 extern __at(0x0FE4) __sfr STATUS_SHAD;
2045 typedef struct
2047 unsigned C_SHAD : 1;
2048 unsigned DC_SHAD : 1;
2049 unsigned Z_SHAD : 1;
2050 unsigned : 1;
2051 unsigned : 1;
2052 unsigned : 1;
2053 unsigned : 1;
2054 unsigned : 1;
2055 } __STATUS_SHADbits_t;
2057 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
2059 #define _C_SHAD 0x01
2060 #define _DC_SHAD 0x02
2061 #define _Z_SHAD 0x04
2063 //==============================================================================
2065 extern __at(0x0FE5) __sfr WREG_SHAD;
2066 extern __at(0x0FE6) __sfr BSR_SHAD;
2067 extern __at(0x0FE7) __sfr PCLATH_SHAD;
2068 extern __at(0x0FE8) __sfr FSR0L_SHAD;
2069 extern __at(0x0FE9) __sfr FSR0H_SHAD;
2070 extern __at(0x0FEA) __sfr FSR1L_SHAD;
2071 extern __at(0x0FEB) __sfr FSR1H_SHAD;
2072 extern __at(0x0FED) __sfr STKPTR;
2073 extern __at(0x0FEE) __sfr TOSL;
2074 extern __at(0x0FEF) __sfr TOSH;
2076 //==============================================================================
2078 // Configuration Bits
2080 //==============================================================================
2082 #define _CONFIG1 0x8007
2083 #define _CONFIG2 0x8008
2085 //----------------------------- CONFIG1 Options -------------------------------
2087 #define _FOSC_LP 0x3FF8 // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins.
2088 #define _FOSC_XT 0x3FF9 // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins.
2089 #define _FOSC_HS 0x3FFA // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins.
2090 #define _FOSC_EXTRC 0x3FFB // EXTRC oscillator: External RC circuit connected to CLKIN pin.
2091 #define _FOSC_INTOSC 0x3FFC // INTOSC oscillator: I/O function on CLKIN pin.
2092 #define _FOSC_ECL 0x3FFD // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin.
2093 #define _FOSC_ECM 0x3FFE // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin.
2094 #define _FOSC_ECH 0x3FFF // ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pin.
2095 #define _WDTE_OFF 0x3FE7 // WDT disabled.
2096 #define _WDTE_SWDTEN 0x3FEF // WDT controlled by the SWDTEN bit in the WDTCON register.
2097 #define _WDTE_NSLEEP 0x3FF7 // WDT enabled while running and disabled in Sleep.
2098 #define _WDTE_ON 0x3FFF // WDT enabled.
2099 #define _PWRTE_ON 0x3FDF // PWRT enabled.
2100 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
2101 #define _MCLRE_OFF 0x3FBF // MCLR/VPP pin function is digital input.
2102 #define _MCLRE_ON 0x3FFF // MCLR/VPP pin function is MCLR.
2103 #define _CP_ON 0x3F7F // Program memory code protection is enabled.
2104 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
2105 #define _BOREN_OFF 0x39FF // Brown-out Reset disabled.
2106 #define _BOREN_SBODEN 0x3BFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
2107 #define _BOREN_NSLEEP 0x3DFF // Brown-out Reset enabled while running and disabled in Sleep.
2108 #define _BOREN_ON 0x3FFF // Brown-out Reset enabled.
2109 #define _CLKOUTEN_ON 0x37FF // CLKOUT function is enabled on the CLKOUT pin.
2110 #define _CLKOUTEN_OFF 0x3FFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
2111 #define _IESO_OFF 0x2FFF // Internal/External Switchover mode is disabled.
2112 #define _IESO_ON 0x3FFF // Internal/External Switchover mode is enabled.
2113 #define _FCMEN_OFF 0x1FFF // Fail-Safe Clock Monitor is disabled.
2114 #define _FCMEN_ON 0x3FFF // Fail-Safe Clock Monitor is enabled.
2116 //----------------------------- CONFIG2 Options -------------------------------
2118 #define _WRT_ALL 0x3FFC // 000h to 1FFFh write protected, no addresses may be modified by EECON control.
2119 #define _WRT_HALF 0x3FFD // 000h to FFFh write protected, 1000h to 1FFFh may be modified by EECON control.
2120 #define _WRT_BOOT 0x3FFE // 000h to 1FFh write protected, 200h to 1FFFh may be modified by EECON control.
2121 #define _WRT_OFF 0x3FFF // Write protection off.
2122 #define _STVREN_OFF 0x3DFF // Stack Overflow or Underflow will not cause a Reset.
2123 #define _STVREN_ON 0x3FFF // Stack Overflow or Underflow will cause a Reset.
2124 #define _BORV_HI 0x3BFF // Brown-out Reset Voltage (Vbor), high trip point selected.
2125 #define _BORV_LO 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
2126 #define _BORV_19 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
2127 #define _LPBOR_ON 0x37FF // Low-Power BOR is enabled.
2128 #define _LPBOR_OFF 0x3FFF // Low-Power BOR is disabled.
2129 #define _DEBUG_ON 0x2FFF // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
2130 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
2131 #define _LVP_OFF 0x1FFF // High-voltage on MCLR/VPP must be used for programming.
2132 #define _LVP_ON 0x3FFF // Low-voltage programming enabled.
2134 //==============================================================================
2136 #define _DEVID1 0x8006
2138 #define _IDLOC0 0x8000
2139 #define _IDLOC1 0x8001
2140 #define _IDLOC2 0x8002
2141 #define _IDLOC3 0x8003
2143 //==============================================================================
2145 #ifndef NO_BIT_DEFINES
2147 #define ADON ADCON0bits.ADON // bit 0
2148 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
2149 #define ADGO ADCON0bits.ADGO // bit 1, shadows bit in ADCON0bits
2150 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
2151 #define CHS0 ADCON0bits.CHS0 // bit 2
2152 #define CHS1 ADCON0bits.CHS1 // bit 3
2153 #define CHS2 ADCON0bits.CHS2 // bit 4
2154 #define CHS3 ADCON0bits.CHS3 // bit 5
2155 #define CHS4 ADCON0bits.CHS4 // bit 6
2157 #define ADPREF0 ADCON1bits.ADPREF0 // bit 0
2158 #define ADPREF1 ADCON1bits.ADPREF1 // bit 1
2159 #define ADCS0 ADCON1bits.ADCS0 // bit 4
2160 #define ADCS1 ADCON1bits.ADCS1 // bit 5
2161 #define ADCS2 ADCON1bits.ADCS2 // bit 6
2162 #define ADFM ADCON1bits.ADFM // bit 7
2164 #define ANSA0 ANSELAbits.ANSA0 // bit 0
2165 #define ANSA1 ANSELAbits.ANSA1 // bit 1
2166 #define ANSA2 ANSELAbits.ANSA2 // bit 2
2167 #define ANSA3 ANSELAbits.ANSA3 // bit 3
2168 #define ANSA5 ANSELAbits.ANSA5 // bit 5
2170 #define ANSB0 ANSELBbits.ANSB0 // bit 0
2171 #define ANSB1 ANSELBbits.ANSB1 // bit 1
2172 #define ANSB2 ANSELBbits.ANSB2 // bit 2
2173 #define ANSB3 ANSELBbits.ANSB3 // bit 3
2174 #define ANSB4 ANSELBbits.ANSB4 // bit 4
2175 #define ANSB5 ANSELBbits.ANSB5 // bit 5
2177 #define ANSC2 ANSELCbits.ANSC2 // bit 2
2178 #define ANSC3 ANSELCbits.ANSC3 // bit 3
2179 #define ANSC4 ANSELCbits.ANSC4 // bit 4
2180 #define ANSC5 ANSELCbits.ANSC5 // bit 5
2181 #define ANSC6 ANSELCbits.ANSC6 // bit 6
2182 #define ANSC7 ANSELCbits.ANSC7 // bit 7
2184 #define CCP2SEL APFCONbits.CCP2SEL // bit 0
2185 #define SSSEL APFCONbits.SSSEL // bit 1
2187 #define ABDEN BAUDCONbits.ABDEN // bit 0
2188 #define WUE BAUDCONbits.WUE // bit 1
2189 #define BRG16 BAUDCONbits.BRG16 // bit 3
2190 #define SCKP BAUDCONbits.SCKP // bit 4
2191 #define RCIDL BAUDCONbits.RCIDL // bit 6
2192 #define ABDOVF BAUDCONbits.ABDOVF // bit 7
2194 #define BORRDY BORCONbits.BORRDY // bit 0
2195 #define BORFS BORCONbits.BORFS // bit 6
2196 #define SBOREN BORCONbits.SBOREN // bit 7
2198 #define BSR0 BSRbits.BSR0 // bit 0
2199 #define BSR1 BSRbits.BSR1 // bit 1
2200 #define BSR2 BSRbits.BSR2 // bit 2
2201 #define BSR3 BSRbits.BSR3 // bit 3
2202 #define BSR4 BSRbits.BSR4 // bit 4
2204 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
2205 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
2206 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
2207 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
2208 #define DC1B0 CCP1CONbits.DC1B0 // bit 4
2209 #define DC1B1 CCP1CONbits.DC1B1 // bit 5
2211 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
2212 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
2213 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
2214 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
2215 #define DC2B0 CCP2CONbits.DC2B0 // bit 4
2216 #define DC2B1 CCP2CONbits.DC2B1 // bit 5
2218 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
2219 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
2220 #define TSRNG FVRCONbits.TSRNG // bit 4
2221 #define TSEN FVRCONbits.TSEN // bit 5
2222 #define FVRRDY FVRCONbits.FVRRDY // bit 6
2223 #define FVREN FVRCONbits.FVREN // bit 7
2225 #define IOCIF INTCONbits.IOCIF // bit 0
2226 #define INTF INTCONbits.INTF // bit 1
2227 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
2228 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
2229 #define IOCIE INTCONbits.IOCIE // bit 3
2230 #define INTE INTCONbits.INTE // bit 4
2231 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
2232 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
2233 #define PEIE INTCONbits.PEIE // bit 6
2234 #define GIE INTCONbits.GIE // bit 7
2236 #define IOCBF0 IOCBFbits.IOCBF0 // bit 0
2237 #define IOCBF1 IOCBFbits.IOCBF1 // bit 1
2238 #define IOCBF2 IOCBFbits.IOCBF2 // bit 2
2239 #define IOCBF3 IOCBFbits.IOCBF3 // bit 3
2240 #define IOCBF4 IOCBFbits.IOCBF4 // bit 4
2241 #define IOCBF5 IOCBFbits.IOCBF5 // bit 5
2242 #define IOCBF6 IOCBFbits.IOCBF6 // bit 6
2243 #define IOCBF7 IOCBFbits.IOCBF7 // bit 7
2245 #define IOCBN0 IOCBNbits.IOCBN0 // bit 0
2246 #define IOCBN1 IOCBNbits.IOCBN1 // bit 1
2247 #define IOCBN2 IOCBNbits.IOCBN2 // bit 2
2248 #define IOCBN3 IOCBNbits.IOCBN3 // bit 3
2249 #define IOCBN4 IOCBNbits.IOCBN4 // bit 4
2250 #define IOCBN5 IOCBNbits.IOCBN5 // bit 5
2251 #define IOCBN6 IOCBNbits.IOCBN6 // bit 6
2252 #define IOCBN7 IOCBNbits.IOCBN7 // bit 7
2254 #define IOCBP0 IOCBPbits.IOCBP0 // bit 0
2255 #define IOCBP1 IOCBPbits.IOCBP1 // bit 1
2256 #define IOCBP2 IOCBPbits.IOCBP2 // bit 2
2257 #define IOCBP3 IOCBPbits.IOCBP3 // bit 3
2258 #define IOCBP4 IOCBPbits.IOCBP4 // bit 4
2259 #define IOCBP5 IOCBPbits.IOCBP5 // bit 5
2260 #define IOCBP6 IOCBPbits.IOCBP6 // bit 6
2261 #define IOCBP7 IOCBPbits.IOCBP7 // bit 7
2263 #define LATA0 LATAbits.LATA0 // bit 0
2264 #define LATA1 LATAbits.LATA1 // bit 1
2265 #define LATA2 LATAbits.LATA2 // bit 2
2266 #define LATA3 LATAbits.LATA3 // bit 3
2267 #define LATA4 LATAbits.LATA4 // bit 4
2268 #define LATA5 LATAbits.LATA5 // bit 5
2269 #define LATA6 LATAbits.LATA6 // bit 6
2270 #define LATA7 LATAbits.LATA7 // bit 7
2272 #define LATB0 LATBbits.LATB0 // bit 0
2273 #define LATB1 LATBbits.LATB1 // bit 1
2274 #define LATB2 LATBbits.LATB2 // bit 2
2275 #define LATB3 LATBbits.LATB3 // bit 3
2276 #define LATB4 LATBbits.LATB4 // bit 4
2277 #define LATB5 LATBbits.LATB5 // bit 5
2278 #define LATB6 LATBbits.LATB6 // bit 6
2279 #define LATB7 LATBbits.LATB7 // bit 7
2281 #define LATC0 LATCbits.LATC0 // bit 0
2282 #define LATC1 LATCbits.LATC1 // bit 1
2283 #define LATC2 LATCbits.LATC2 // bit 2
2284 #define LATC3 LATCbits.LATC3 // bit 3
2285 #define LATC4 LATCbits.LATC4 // bit 4
2286 #define LATC5 LATCbits.LATC5 // bit 5
2287 #define LATC6 LATCbits.LATC6 // bit 6
2288 #define LATC7 LATCbits.LATC7 // bit 7
2290 #define PS0 OPTION_REGbits.PS0 // bit 0
2291 #define PS1 OPTION_REGbits.PS1 // bit 1
2292 #define PS2 OPTION_REGbits.PS2 // bit 2
2293 #define PSA OPTION_REGbits.PSA // bit 3
2294 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
2295 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
2296 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
2297 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
2298 #define INTEDG OPTION_REGbits.INTEDG // bit 6
2299 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7
2301 #define SCS0 OSCCONbits.SCS0 // bit 0
2302 #define SCS1 OSCCONbits.SCS1 // bit 1
2303 #define IRCF0 OSCCONbits.IRCF0 // bit 3
2304 #define IRCF1 OSCCONbits.IRCF1 // bit 4
2305 #define IRCF2 OSCCONbits.IRCF2 // bit 5
2306 #define IRCF3 OSCCONbits.IRCF3 // bit 6
2308 #define HFIOFS OSCSTATbits.HFIOFS // bit 0
2309 #define LFIOFR OSCSTATbits.LFIOFR // bit 1
2310 #define HFIOFR OSCSTATbits.HFIOFR // bit 4
2311 #define OSTS OSCSTATbits.OSTS // bit 5
2312 #define SOSCR OSCSTATbits.SOSCR // bit 7, shadows bit in OSCSTATbits
2313 #define T1OSCR OSCSTATbits.T1OSCR // bit 7, shadows bit in OSCSTATbits
2315 #define NOT_BOR PCONbits.NOT_BOR // bit 0
2316 #define NOT_POR PCONbits.NOT_POR // bit 1
2317 #define NOT_RI PCONbits.NOT_RI // bit 2
2318 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3
2319 #define NOT_RWDT PCONbits.NOT_RWDT // bit 4
2320 #define STKUNF PCONbits.STKUNF // bit 6
2321 #define STKOVF PCONbits.STKOVF // bit 7
2323 #define TMR1IE PIE1bits.TMR1IE // bit 0
2324 #define TMR2IE PIE1bits.TMR2IE // bit 1
2325 #define CCP1IE PIE1bits.CCP1IE // bit 2
2326 #define SSPIE PIE1bits.SSPIE // bit 3
2327 #define TXIE PIE1bits.TXIE // bit 4
2328 #define RCIE PIE1bits.RCIE // bit 5
2329 #define ADIE PIE1bits.ADIE // bit 6
2330 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
2332 #define CCP2IE PIE2bits.CCP2IE // bit 0
2333 #define BCLIE PIE2bits.BCLIE // bit 3
2334 #define OSFIE PIE2bits.OSFIE // bit 7
2336 #define TMR1IF PIR1bits.TMR1IF // bit 0
2337 #define TMR2IF PIR1bits.TMR2IF // bit 1
2338 #define CCP1IF PIR1bits.CCP1IF // bit 2
2339 #define SSPIF PIR1bits.SSPIF // bit 3
2340 #define TXIF PIR1bits.TXIF // bit 4
2341 #define RCIF PIR1bits.RCIF // bit 5
2342 #define ADIF PIR1bits.ADIF // bit 6
2343 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
2345 #define CCP2IF PIR2bits.CCP2IF // bit 0
2346 #define BCLIF PIR2bits.BCLIF // bit 3
2347 #define OSFIF PIR2bits.OSFIF // bit 7
2349 #define RD PMCON1bits.RD // bit 0
2350 #define WR PMCON1bits.WR // bit 1
2351 #define WREN PMCON1bits.WREN // bit 2
2352 #define WRERR PMCON1bits.WRERR // bit 3
2353 #define FREE PMCON1bits.FREE // bit 4
2354 #define LWLO PMCON1bits.LWLO // bit 5
2355 #define CFGS PMCON1bits.CFGS // bit 6
2357 #define RA0 PORTAbits.RA0 // bit 0
2358 #define RA1 PORTAbits.RA1 // bit 1
2359 #define RA2 PORTAbits.RA2 // bit 2
2360 #define RA3 PORTAbits.RA3 // bit 3
2361 #define RA4 PORTAbits.RA4 // bit 4
2362 #define RA5 PORTAbits.RA5 // bit 5
2363 #define RA6 PORTAbits.RA6 // bit 6
2364 #define RA7 PORTAbits.RA7 // bit 7
2366 #define RB0 PORTBbits.RB0 // bit 0
2367 #define RB1 PORTBbits.RB1 // bit 1
2368 #define RB2 PORTBbits.RB2 // bit 2
2369 #define RB3 PORTBbits.RB3 // bit 3
2370 #define RB4 PORTBbits.RB4 // bit 4
2371 #define RB5 PORTBbits.RB5 // bit 5
2372 #define RB6 PORTBbits.RB6 // bit 6
2373 #define RB7 PORTBbits.RB7 // bit 7
2375 #define RC0 PORTCbits.RC0 // bit 0
2376 #define RC1 PORTCbits.RC1 // bit 1
2377 #define RC2 PORTCbits.RC2 // bit 2
2378 #define RC3 PORTCbits.RC3 // bit 3
2379 #define RC4 PORTCbits.RC4 // bit 4
2380 #define RC5 PORTCbits.RC5 // bit 5
2381 #define RC6 PORTCbits.RC6 // bit 6
2382 #define RC7 PORTCbits.RC7 // bit 7
2384 #define RE3 PORTEbits.RE3 // bit 3
2386 #define RX9D RCSTAbits.RX9D // bit 0
2387 #define OERR RCSTAbits.OERR // bit 1
2388 #define FERR RCSTAbits.FERR // bit 2
2389 #define ADDEN RCSTAbits.ADDEN // bit 3
2390 #define CREN RCSTAbits.CREN // bit 4
2391 #define SREN RCSTAbits.SREN // bit 5
2392 #define RX9 RCSTAbits.RX9 // bit 6
2393 #define SPEN RCSTAbits.SPEN // bit 7
2395 #define SSPM0 SSP1CON1bits.SSPM0 // bit 0
2396 #define SSPM1 SSP1CON1bits.SSPM1 // bit 1
2397 #define SSPM2 SSP1CON1bits.SSPM2 // bit 2
2398 #define SSPM3 SSP1CON1bits.SSPM3 // bit 3
2399 #define CKP SSP1CON1bits.CKP // bit 4
2400 #define SSPEN SSP1CON1bits.SSPEN // bit 5
2401 #define SSPOV SSP1CON1bits.SSPOV // bit 6
2402 #define WCOL SSP1CON1bits.WCOL // bit 7
2404 #define SEN SSP1CON2bits.SEN // bit 0
2405 #define RSEN SSP1CON2bits.RSEN // bit 1
2406 #define PEN SSP1CON2bits.PEN // bit 2
2407 #define RCEN SSP1CON2bits.RCEN // bit 3
2408 #define ACKEN SSP1CON2bits.ACKEN // bit 4
2409 #define ACKDT SSP1CON2bits.ACKDT // bit 5
2410 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6
2411 #define GCEN SSP1CON2bits.GCEN // bit 7
2413 #define DHEN SSP1CON3bits.DHEN // bit 0
2414 #define AHEN SSP1CON3bits.AHEN // bit 1
2415 #define SBCDE SSP1CON3bits.SBCDE // bit 2
2416 #define SDAHT SSP1CON3bits.SDAHT // bit 3
2417 #define BOEN SSP1CON3bits.BOEN // bit 4
2418 #define SCIE SSP1CON3bits.SCIE // bit 5
2419 #define PCIE SSP1CON3bits.PCIE // bit 6
2420 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7
2422 #define BF SSP1STATbits.BF // bit 0
2423 #define UA SSP1STATbits.UA // bit 1
2424 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2
2425 #define S SSP1STATbits.S // bit 3
2426 #define P SSP1STATbits.P // bit 4
2427 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5
2428 #define CKE SSP1STATbits.CKE // bit 6
2429 #define SMP SSP1STATbits.SMP // bit 7
2431 #define C STATUSbits.C // bit 0
2432 #define DC STATUSbits.DC // bit 1
2433 #define Z STATUSbits.Z // bit 2
2434 #define NOT_PD STATUSbits.NOT_PD // bit 3
2435 #define NOT_TO STATUSbits.NOT_TO // bit 4
2437 #define C_SHAD STATUS_SHADbits.C_SHAD // bit 0
2438 #define DC_SHAD STATUS_SHADbits.DC_SHAD // bit 1
2439 #define Z_SHAD STATUS_SHADbits.Z_SHAD // bit 2
2441 #define TMR1ON T1CONbits.TMR1ON // bit 0
2442 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
2443 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
2444 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
2445 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
2446 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6
2447 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7
2449 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0
2450 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1
2451 #define T1GVAL T1GCONbits.T1GVAL // bit 2
2452 #define T1GGO_NOT_DONE T1GCONbits.T1GGO_NOT_DONE // bit 3
2453 #define T1GSPM T1GCONbits.T1GSPM // bit 4
2454 #define T1GTM T1GCONbits.T1GTM // bit 5
2455 #define T1GPOL T1GCONbits.T1GPOL // bit 6
2456 #define TMR1GE T1GCONbits.TMR1GE // bit 7
2458 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
2459 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
2460 #define TMR2ON T2CONbits.TMR2ON // bit 2
2461 #define T2OUTPS0 T2CONbits.T2OUTPS0 // bit 3
2462 #define T2OUTPS1 T2CONbits.T2OUTPS1 // bit 4
2463 #define T2OUTPS2 T2CONbits.T2OUTPS2 // bit 5
2464 #define T2OUTPS3 T2CONbits.T2OUTPS3 // bit 6
2466 #define TRISA0 TRISAbits.TRISA0 // bit 0
2467 #define TRISA1 TRISAbits.TRISA1 // bit 1
2468 #define TRISA2 TRISAbits.TRISA2 // bit 2
2469 #define TRISA3 TRISAbits.TRISA3 // bit 3
2470 #define TRISA4 TRISAbits.TRISA4 // bit 4
2471 #define TRISA5 TRISAbits.TRISA5 // bit 5
2472 #define TRISA6 TRISAbits.TRISA6 // bit 6
2473 #define TRISA7 TRISAbits.TRISA7 // bit 7
2475 #define TRISB0 TRISBbits.TRISB0 // bit 0
2476 #define TRISB1 TRISBbits.TRISB1 // bit 1
2477 #define TRISB2 TRISBbits.TRISB2 // bit 2
2478 #define TRISB3 TRISBbits.TRISB3 // bit 3
2479 #define TRISB4 TRISBbits.TRISB4 // bit 4
2480 #define TRISB5 TRISBbits.TRISB5 // bit 5
2481 #define TRISB6 TRISBbits.TRISB6 // bit 6
2482 #define TRISB7 TRISBbits.TRISB7 // bit 7
2484 #define TRISC0 TRISCbits.TRISC0 // bit 0
2485 #define TRISC1 TRISCbits.TRISC1 // bit 1
2486 #define TRISC2 TRISCbits.TRISC2 // bit 2
2487 #define TRISC3 TRISCbits.TRISC3 // bit 3
2488 #define TRISC4 TRISCbits.TRISC4 // bit 4
2489 #define TRISC5 TRISCbits.TRISC5 // bit 5
2490 #define TRISC6 TRISCbits.TRISC6 // bit 6
2491 #define TRISC7 TRISCbits.TRISC7 // bit 7
2493 #define TX9D TXSTAbits.TX9D // bit 0
2494 #define TRMT TXSTAbits.TRMT // bit 1
2495 #define BRGH TXSTAbits.BRGH // bit 2
2496 #define SENDB TXSTAbits.SENDB // bit 3
2497 #define SYNC TXSTAbits.SYNC // bit 4
2498 #define TXEN TXSTAbits.TXEN // bit 5
2499 #define TX9 TXSTAbits.TX9 // bit 6
2500 #define CSRC TXSTAbits.CSRC // bit 7
2502 #define SWDTEN WDTCONbits.SWDTEN // bit 0
2503 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
2504 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
2505 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
2506 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
2507 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5
2509 #define WPUB0 WPUBbits.WPUB0 // bit 0
2510 #define WPUB1 WPUBbits.WPUB1 // bit 1
2511 #define WPUB2 WPUBbits.WPUB2 // bit 2
2512 #define WPUB3 WPUBbits.WPUB3 // bit 3
2513 #define WPUB4 WPUBbits.WPUB4 // bit 4
2514 #define WPUB5 WPUBbits.WPUB5 // bit 5
2515 #define WPUB6 WPUBbits.WPUB6 // bit 6
2516 #define WPUB7 WPUBbits.WPUB7 // bit 7
2518 #define WPUE3 WPUEbits.WPUE3 // bit 3
2520 #endif // #ifndef NO_BIT_DEFINES
2522 #endif // #ifndef __PIC16LF1516_H__