struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / non-free / include / pic14 / pic16f1516.h
blob5f753f52165743102ba579c4536305b0db87bd96
1 /*
2 * This declarations of the PIC16F1516 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 __PIC16F1516_H__
26 #define __PIC16F1516_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 VREGCON_ADDR 0x0197
99 #define RCREG_ADDR 0x0199
100 #define TXREG_ADDR 0x019A
101 #define SP1BRG_ADDR 0x019B
102 #define SP1BRGL_ADDR 0x019B
103 #define SPBRG_ADDR 0x019B
104 #define SPBRGL_ADDR 0x019B
105 #define SP1BRGH_ADDR 0x019C
106 #define SPBRGH_ADDR 0x019C
107 #define RCSTA_ADDR 0x019D
108 #define TXSTA_ADDR 0x019E
109 #define BAUDCON_ADDR 0x019F
110 #define WPUB_ADDR 0x020D
111 #define WPUE_ADDR 0x0210
112 #define SSP1BUF_ADDR 0x0211
113 #define SSPBUF_ADDR 0x0211
114 #define SSP1ADD_ADDR 0x0212
115 #define SSPADD_ADDR 0x0212
116 #define SSP1MSK_ADDR 0x0213
117 #define SSPMSK_ADDR 0x0213
118 #define SSP1STAT_ADDR 0x0214
119 #define SSPSTAT_ADDR 0x0214
120 #define SSP1CON1_ADDR 0x0215
121 #define SSPCON_ADDR 0x0215
122 #define SSPCON1_ADDR 0x0215
123 #define SSP1CON2_ADDR 0x0216
124 #define SSPCON2_ADDR 0x0216
125 #define SSP1CON3_ADDR 0x0217
126 #define SSPCON3_ADDR 0x0217
127 #define CCPR1_ADDR 0x0291
128 #define CCPR1L_ADDR 0x0291
129 #define CCPR1H_ADDR 0x0292
130 #define CCP1CON_ADDR 0x0293
131 #define CCPR2_ADDR 0x0298
132 #define CCPR2L_ADDR 0x0298
133 #define CCPR2H_ADDR 0x0299
134 #define CCP2CON_ADDR 0x029A
135 #define IOCBP_ADDR 0x0394
136 #define IOCBN_ADDR 0x0395
137 #define IOCBF_ADDR 0x0396
138 #define STATUS_SHAD_ADDR 0x0FE4
139 #define WREG_SHAD_ADDR 0x0FE5
140 #define BSR_SHAD_ADDR 0x0FE6
141 #define PCLATH_SHAD_ADDR 0x0FE7
142 #define FSR0L_SHAD_ADDR 0x0FE8
143 #define FSR0H_SHAD_ADDR 0x0FE9
144 #define FSR1L_SHAD_ADDR 0x0FEA
145 #define FSR1H_SHAD_ADDR 0x0FEB
146 #define STKPTR_ADDR 0x0FED
147 #define TOSL_ADDR 0x0FEE
148 #define TOSH_ADDR 0x0FEF
150 #endif // #ifndef NO_ADDR_DEFINES
152 //==============================================================================
154 // Register Definitions
156 //==============================================================================
158 extern __at(0x0000) __sfr INDF0;
159 extern __at(0x0001) __sfr INDF1;
160 extern __at(0x0002) __sfr PCL;
162 //==============================================================================
163 // STATUS Bits
165 extern __at(0x0003) __sfr STATUS;
167 typedef struct
169 unsigned C : 1;
170 unsigned DC : 1;
171 unsigned Z : 1;
172 unsigned NOT_PD : 1;
173 unsigned NOT_TO : 1;
174 unsigned : 1;
175 unsigned : 1;
176 unsigned : 1;
177 } __STATUSbits_t;
179 extern __at(0x0003) volatile __STATUSbits_t STATUSbits;
181 #define _C 0x01
182 #define _DC 0x02
183 #define _Z 0x04
184 #define _NOT_PD 0x08
185 #define _NOT_TO 0x10
187 //==============================================================================
189 extern __at(0x0004) __sfr FSR0;
190 extern __at(0x0004) __sfr FSR0L;
191 extern __at(0x0005) __sfr FSR0H;
192 extern __at(0x0006) __sfr FSR1;
193 extern __at(0x0006) __sfr FSR1L;
194 extern __at(0x0007) __sfr FSR1H;
196 //==============================================================================
197 // BSR Bits
199 extern __at(0x0008) __sfr BSR;
201 typedef union
203 struct
205 unsigned BSR0 : 1;
206 unsigned BSR1 : 1;
207 unsigned BSR2 : 1;
208 unsigned BSR3 : 1;
209 unsigned BSR4 : 1;
210 unsigned : 1;
211 unsigned : 1;
212 unsigned : 1;
215 struct
217 unsigned BSR : 5;
218 unsigned : 3;
220 } __BSRbits_t;
222 extern __at(0x0008) volatile __BSRbits_t BSRbits;
224 #define _BSR0 0x01
225 #define _BSR1 0x02
226 #define _BSR2 0x04
227 #define _BSR3 0x08
228 #define _BSR4 0x10
230 //==============================================================================
232 extern __at(0x0009) __sfr WREG;
233 extern __at(0x000A) __sfr PCLATH;
235 //==============================================================================
236 // INTCON Bits
238 extern __at(0x000B) __sfr INTCON;
240 typedef union
242 struct
244 unsigned IOCIF : 1;
245 unsigned INTF : 1;
246 unsigned TMR0IF : 1;
247 unsigned IOCIE : 1;
248 unsigned INTE : 1;
249 unsigned TMR0IE : 1;
250 unsigned PEIE : 1;
251 unsigned GIE : 1;
254 struct
256 unsigned : 1;
257 unsigned : 1;
258 unsigned T0IF : 1;
259 unsigned : 1;
260 unsigned : 1;
261 unsigned T0IE : 1;
262 unsigned : 1;
263 unsigned : 1;
265 } __INTCONbits_t;
267 extern __at(0x000B) volatile __INTCONbits_t INTCONbits;
269 #define _IOCIF 0x01
270 #define _INTF 0x02
271 #define _TMR0IF 0x04
272 #define _T0IF 0x04
273 #define _IOCIE 0x08
274 #define _INTE 0x10
275 #define _TMR0IE 0x20
276 #define _T0IE 0x20
277 #define _PEIE 0x40
278 #define _GIE 0x80
280 //==============================================================================
283 //==============================================================================
284 // PORTA Bits
286 extern __at(0x000C) __sfr PORTA;
288 typedef struct
290 unsigned RA0 : 1;
291 unsigned RA1 : 1;
292 unsigned RA2 : 1;
293 unsigned RA3 : 1;
294 unsigned RA4 : 1;
295 unsigned RA5 : 1;
296 unsigned RA6 : 1;
297 unsigned RA7 : 1;
298 } __PORTAbits_t;
300 extern __at(0x000C) volatile __PORTAbits_t PORTAbits;
302 #define _RA0 0x01
303 #define _RA1 0x02
304 #define _RA2 0x04
305 #define _RA3 0x08
306 #define _RA4 0x10
307 #define _RA5 0x20
308 #define _RA6 0x40
309 #define _RA7 0x80
311 //==============================================================================
314 //==============================================================================
315 // PORTB Bits
317 extern __at(0x000D) __sfr PORTB;
319 typedef struct
321 unsigned RB0 : 1;
322 unsigned RB1 : 1;
323 unsigned RB2 : 1;
324 unsigned RB3 : 1;
325 unsigned RB4 : 1;
326 unsigned RB5 : 1;
327 unsigned RB6 : 1;
328 unsigned RB7 : 1;
329 } __PORTBbits_t;
331 extern __at(0x000D) volatile __PORTBbits_t PORTBbits;
333 #define _RB0 0x01
334 #define _RB1 0x02
335 #define _RB2 0x04
336 #define _RB3 0x08
337 #define _RB4 0x10
338 #define _RB5 0x20
339 #define _RB6 0x40
340 #define _RB7 0x80
342 //==============================================================================
345 //==============================================================================
346 // PORTC Bits
348 extern __at(0x000E) __sfr PORTC;
350 typedef struct
352 unsigned RC0 : 1;
353 unsigned RC1 : 1;
354 unsigned RC2 : 1;
355 unsigned RC3 : 1;
356 unsigned RC4 : 1;
357 unsigned RC5 : 1;
358 unsigned RC6 : 1;
359 unsigned RC7 : 1;
360 } __PORTCbits_t;
362 extern __at(0x000E) volatile __PORTCbits_t PORTCbits;
364 #define _RC0 0x01
365 #define _RC1 0x02
366 #define _RC2 0x04
367 #define _RC3 0x08
368 #define _RC4 0x10
369 #define _RC5 0x20
370 #define _RC6 0x40
371 #define _RC7 0x80
373 //==============================================================================
376 //==============================================================================
377 // PORTE Bits
379 extern __at(0x0010) __sfr PORTE;
381 typedef struct
383 unsigned : 1;
384 unsigned : 1;
385 unsigned : 1;
386 unsigned RE3 : 1;
387 unsigned : 1;
388 unsigned : 1;
389 unsigned : 1;
390 unsigned : 1;
391 } __PORTEbits_t;
393 extern __at(0x0010) volatile __PORTEbits_t PORTEbits;
395 #define _RE3 0x08
397 //==============================================================================
400 //==============================================================================
401 // PIR1 Bits
403 extern __at(0x0011) __sfr PIR1;
405 typedef struct
407 unsigned TMR1IF : 1;
408 unsigned TMR2IF : 1;
409 unsigned CCP1IF : 1;
410 unsigned SSPIF : 1;
411 unsigned TXIF : 1;
412 unsigned RCIF : 1;
413 unsigned ADIF : 1;
414 unsigned TMR1GIF : 1;
415 } __PIR1bits_t;
417 extern __at(0x0011) volatile __PIR1bits_t PIR1bits;
419 #define _TMR1IF 0x01
420 #define _TMR2IF 0x02
421 #define _CCP1IF 0x04
422 #define _SSPIF 0x08
423 #define _TXIF 0x10
424 #define _RCIF 0x20
425 #define _ADIF 0x40
426 #define _TMR1GIF 0x80
428 //==============================================================================
431 //==============================================================================
432 // PIR2 Bits
434 extern __at(0x0012) __sfr PIR2;
436 typedef struct
438 unsigned CCP2IF : 1;
439 unsigned : 1;
440 unsigned : 1;
441 unsigned BCLIF : 1;
442 unsigned : 1;
443 unsigned : 1;
444 unsigned : 1;
445 unsigned OSFIF : 1;
446 } __PIR2bits_t;
448 extern __at(0x0012) volatile __PIR2bits_t PIR2bits;
450 #define _CCP2IF 0x01
451 #define _BCLIF 0x08
452 #define _OSFIF 0x80
454 //==============================================================================
456 extern __at(0x0015) __sfr TMR0;
457 extern __at(0x0016) __sfr TMR1;
458 extern __at(0x0016) __sfr TMR1L;
459 extern __at(0x0017) __sfr TMR1H;
461 //==============================================================================
462 // T1CON Bits
464 extern __at(0x0018) __sfr T1CON;
466 typedef union
468 struct
470 unsigned TMR1ON : 1;
471 unsigned : 1;
472 unsigned NOT_T1SYNC : 1;
473 unsigned T1OSCEN : 1;
474 unsigned T1CKPS0 : 1;
475 unsigned T1CKPS1 : 1;
476 unsigned TMR1CS0 : 1;
477 unsigned TMR1CS1 : 1;
480 struct
482 unsigned : 4;
483 unsigned T1CKPS : 2;
484 unsigned : 2;
487 struct
489 unsigned : 6;
490 unsigned TMR1CS : 2;
492 } __T1CONbits_t;
494 extern __at(0x0018) volatile __T1CONbits_t T1CONbits;
496 #define _TMR1ON 0x01
497 #define _NOT_T1SYNC 0x04
498 #define _T1OSCEN 0x08
499 #define _T1CKPS0 0x10
500 #define _T1CKPS1 0x20
501 #define _TMR1CS0 0x40
502 #define _TMR1CS1 0x80
504 //==============================================================================
507 //==============================================================================
508 // T1GCON Bits
510 extern __at(0x0019) __sfr T1GCON;
512 typedef union
514 struct
516 unsigned T1GSS0 : 1;
517 unsigned T1GSS1 : 1;
518 unsigned T1GVAL : 1;
519 unsigned T1GGO_NOT_DONE : 1;
520 unsigned T1GSPM : 1;
521 unsigned T1GTM : 1;
522 unsigned T1GPOL : 1;
523 unsigned TMR1GE : 1;
526 struct
528 unsigned T1GSS : 2;
529 unsigned : 6;
531 } __T1GCONbits_t;
533 extern __at(0x0019) volatile __T1GCONbits_t T1GCONbits;
535 #define _T1GSS0 0x01
536 #define _T1GSS1 0x02
537 #define _T1GVAL 0x04
538 #define _T1GGO_NOT_DONE 0x08
539 #define _T1GSPM 0x10
540 #define _T1GTM 0x20
541 #define _T1GPOL 0x40
542 #define _TMR1GE 0x80
544 //==============================================================================
546 extern __at(0x001A) __sfr TMR2;
547 extern __at(0x001B) __sfr PR2;
549 //==============================================================================
550 // T2CON Bits
552 extern __at(0x001C) __sfr T2CON;
554 typedef union
556 struct
558 unsigned T2CKPS0 : 1;
559 unsigned T2CKPS1 : 1;
560 unsigned TMR2ON : 1;
561 unsigned T2OUTPS0 : 1;
562 unsigned T2OUTPS1 : 1;
563 unsigned T2OUTPS2 : 1;
564 unsigned T2OUTPS3 : 1;
565 unsigned : 1;
568 struct
570 unsigned T2CKPS : 2;
571 unsigned : 6;
574 struct
576 unsigned : 3;
577 unsigned T2OUTPS : 4;
578 unsigned : 1;
580 } __T2CONbits_t;
582 extern __at(0x001C) volatile __T2CONbits_t T2CONbits;
584 #define _T2CKPS0 0x01
585 #define _T2CKPS1 0x02
586 #define _TMR2ON 0x04
587 #define _T2OUTPS0 0x08
588 #define _T2OUTPS1 0x10
589 #define _T2OUTPS2 0x20
590 #define _T2OUTPS3 0x40
592 //==============================================================================
595 //==============================================================================
596 // TRISA Bits
598 extern __at(0x008C) __sfr TRISA;
600 typedef struct
602 unsigned TRISA0 : 1;
603 unsigned TRISA1 : 1;
604 unsigned TRISA2 : 1;
605 unsigned TRISA3 : 1;
606 unsigned TRISA4 : 1;
607 unsigned TRISA5 : 1;
608 unsigned TRISA6 : 1;
609 unsigned TRISA7 : 1;
610 } __TRISAbits_t;
612 extern __at(0x008C) volatile __TRISAbits_t TRISAbits;
614 #define _TRISA0 0x01
615 #define _TRISA1 0x02
616 #define _TRISA2 0x04
617 #define _TRISA3 0x08
618 #define _TRISA4 0x10
619 #define _TRISA5 0x20
620 #define _TRISA6 0x40
621 #define _TRISA7 0x80
623 //==============================================================================
626 //==============================================================================
627 // TRISB Bits
629 extern __at(0x008D) __sfr TRISB;
631 typedef struct
633 unsigned TRISB0 : 1;
634 unsigned TRISB1 : 1;
635 unsigned TRISB2 : 1;
636 unsigned TRISB3 : 1;
637 unsigned TRISB4 : 1;
638 unsigned TRISB5 : 1;
639 unsigned TRISB6 : 1;
640 unsigned TRISB7 : 1;
641 } __TRISBbits_t;
643 extern __at(0x008D) volatile __TRISBbits_t TRISBbits;
645 #define _TRISB0 0x01
646 #define _TRISB1 0x02
647 #define _TRISB2 0x04
648 #define _TRISB3 0x08
649 #define _TRISB4 0x10
650 #define _TRISB5 0x20
651 #define _TRISB6 0x40
652 #define _TRISB7 0x80
654 //==============================================================================
657 //==============================================================================
658 // TRISC Bits
660 extern __at(0x008E) __sfr TRISC;
662 typedef struct
664 unsigned TRISC0 : 1;
665 unsigned TRISC1 : 1;
666 unsigned TRISC2 : 1;
667 unsigned TRISC3 : 1;
668 unsigned TRISC4 : 1;
669 unsigned TRISC5 : 1;
670 unsigned TRISC6 : 1;
671 unsigned TRISC7 : 1;
672 } __TRISCbits_t;
674 extern __at(0x008E) volatile __TRISCbits_t TRISCbits;
676 #define _TRISC0 0x01
677 #define _TRISC1 0x02
678 #define _TRISC2 0x04
679 #define _TRISC3 0x08
680 #define _TRISC4 0x10
681 #define _TRISC5 0x20
682 #define _TRISC6 0x40
683 #define _TRISC7 0x80
685 //==============================================================================
687 extern __at(0x0090) __sfr TRISE;
689 //==============================================================================
690 // PIE1 Bits
692 extern __at(0x0091) __sfr PIE1;
694 typedef struct
696 unsigned TMR1IE : 1;
697 unsigned TMR2IE : 1;
698 unsigned CCP1IE : 1;
699 unsigned SSPIE : 1;
700 unsigned TXIE : 1;
701 unsigned RCIE : 1;
702 unsigned ADIE : 1;
703 unsigned TMR1GIE : 1;
704 } __PIE1bits_t;
706 extern __at(0x0091) volatile __PIE1bits_t PIE1bits;
708 #define _TMR1IE 0x01
709 #define _TMR2IE 0x02
710 #define _CCP1IE 0x04
711 #define _SSPIE 0x08
712 #define _TXIE 0x10
713 #define _RCIE 0x20
714 #define _ADIE 0x40
715 #define _TMR1GIE 0x80
717 //==============================================================================
720 //==============================================================================
721 // PIE2 Bits
723 extern __at(0x0092) __sfr PIE2;
725 typedef struct
727 unsigned CCP2IE : 1;
728 unsigned : 1;
729 unsigned : 1;
730 unsigned BCLIE : 1;
731 unsigned : 1;
732 unsigned : 1;
733 unsigned : 1;
734 unsigned OSFIE : 1;
735 } __PIE2bits_t;
737 extern __at(0x0092) volatile __PIE2bits_t PIE2bits;
739 #define _CCP2IE 0x01
740 #define _BCLIE 0x08
741 #define _OSFIE 0x80
743 //==============================================================================
746 //==============================================================================
747 // OPTION_REG Bits
749 extern __at(0x0095) __sfr OPTION_REG;
751 typedef union
753 struct
755 unsigned PS0 : 1;
756 unsigned PS1 : 1;
757 unsigned PS2 : 1;
758 unsigned PSA : 1;
759 unsigned TMR0SE : 1;
760 unsigned TMR0CS : 1;
761 unsigned INTEDG : 1;
762 unsigned NOT_WPUEN : 1;
765 struct
767 unsigned : 1;
768 unsigned : 1;
769 unsigned : 1;
770 unsigned : 1;
771 unsigned T0SE : 1;
772 unsigned T0CS : 1;
773 unsigned : 1;
774 unsigned : 1;
777 struct
779 unsigned PS : 3;
780 unsigned : 5;
782 } __OPTION_REGbits_t;
784 extern __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits;
786 #define _PS0 0x01
787 #define _PS1 0x02
788 #define _PS2 0x04
789 #define _PSA 0x08
790 #define _TMR0SE 0x10
791 #define _T0SE 0x10
792 #define _TMR0CS 0x20
793 #define _T0CS 0x20
794 #define _INTEDG 0x40
795 #define _NOT_WPUEN 0x80
797 //==============================================================================
800 //==============================================================================
801 // PCON Bits
803 extern __at(0x0096) __sfr PCON;
805 typedef struct
807 unsigned NOT_BOR : 1;
808 unsigned NOT_POR : 1;
809 unsigned NOT_RI : 1;
810 unsigned NOT_RMCLR : 1;
811 unsigned NOT_RWDT : 1;
812 unsigned : 1;
813 unsigned STKUNF : 1;
814 unsigned STKOVF : 1;
815 } __PCONbits_t;
817 extern __at(0x0096) volatile __PCONbits_t PCONbits;
819 #define _NOT_BOR 0x01
820 #define _NOT_POR 0x02
821 #define _NOT_RI 0x04
822 #define _NOT_RMCLR 0x08
823 #define _NOT_RWDT 0x10
824 #define _STKUNF 0x40
825 #define _STKOVF 0x80
827 //==============================================================================
830 //==============================================================================
831 // WDTCON Bits
833 extern __at(0x0097) __sfr WDTCON;
835 typedef union
837 struct
839 unsigned SWDTEN : 1;
840 unsigned WDTPS0 : 1;
841 unsigned WDTPS1 : 1;
842 unsigned WDTPS2 : 1;
843 unsigned WDTPS3 : 1;
844 unsigned WDTPS4 : 1;
845 unsigned : 1;
846 unsigned : 1;
849 struct
851 unsigned : 1;
852 unsigned WDTPS : 5;
853 unsigned : 2;
855 } __WDTCONbits_t;
857 extern __at(0x0097) volatile __WDTCONbits_t WDTCONbits;
859 #define _SWDTEN 0x01
860 #define _WDTPS0 0x02
861 #define _WDTPS1 0x04
862 #define _WDTPS2 0x08
863 #define _WDTPS3 0x10
864 #define _WDTPS4 0x20
866 //==============================================================================
869 //==============================================================================
870 // OSCCON Bits
872 extern __at(0x0099) __sfr OSCCON;
874 typedef union
876 struct
878 unsigned SCS0 : 1;
879 unsigned SCS1 : 1;
880 unsigned : 1;
881 unsigned IRCF0 : 1;
882 unsigned IRCF1 : 1;
883 unsigned IRCF2 : 1;
884 unsigned IRCF3 : 1;
885 unsigned : 1;
888 struct
890 unsigned SCS : 2;
891 unsigned : 6;
894 struct
896 unsigned : 3;
897 unsigned IRCF : 4;
898 unsigned : 1;
900 } __OSCCONbits_t;
902 extern __at(0x0099) volatile __OSCCONbits_t OSCCONbits;
904 #define _SCS0 0x01
905 #define _SCS1 0x02
906 #define _IRCF0 0x08
907 #define _IRCF1 0x10
908 #define _IRCF2 0x20
909 #define _IRCF3 0x40
911 //==============================================================================
914 //==============================================================================
915 // OSCSTAT Bits
917 extern __at(0x009A) __sfr OSCSTAT;
919 typedef union
921 struct
923 unsigned HFIOFS : 1;
924 unsigned LFIOFR : 1;
925 unsigned : 1;
926 unsigned : 1;
927 unsigned HFIOFR : 1;
928 unsigned OSTS : 1;
929 unsigned : 1;
930 unsigned SOSCR : 1;
933 struct
935 unsigned : 1;
936 unsigned : 1;
937 unsigned : 1;
938 unsigned : 1;
939 unsigned : 1;
940 unsigned : 1;
941 unsigned : 1;
942 unsigned T1OSCR : 1;
944 } __OSCSTATbits_t;
946 extern __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits;
948 #define _HFIOFS 0x01
949 #define _LFIOFR 0x02
950 #define _HFIOFR 0x10
951 #define _OSTS 0x20
952 #define _SOSCR 0x80
953 #define _T1OSCR 0x80
955 //==============================================================================
957 extern __at(0x009B) __sfr ADRES;
958 extern __at(0x009B) __sfr ADRESL;
959 extern __at(0x009C) __sfr ADRESH;
961 //==============================================================================
962 // ADCON0 Bits
964 extern __at(0x009D) __sfr ADCON0;
966 typedef union
968 struct
970 unsigned ADON : 1;
971 unsigned GO_NOT_DONE : 1;
972 unsigned CHS0 : 1;
973 unsigned CHS1 : 1;
974 unsigned CHS2 : 1;
975 unsigned CHS3 : 1;
976 unsigned CHS4 : 1;
977 unsigned : 1;
980 struct
982 unsigned : 1;
983 unsigned ADGO : 1;
984 unsigned : 1;
985 unsigned : 1;
986 unsigned : 1;
987 unsigned : 1;
988 unsigned : 1;
989 unsigned : 1;
992 struct
994 unsigned : 1;
995 unsigned GO : 1;
996 unsigned : 1;
997 unsigned : 1;
998 unsigned : 1;
999 unsigned : 1;
1000 unsigned : 1;
1001 unsigned : 1;
1004 struct
1006 unsigned : 2;
1007 unsigned CHS : 5;
1008 unsigned : 1;
1010 } __ADCON0bits_t;
1012 extern __at(0x009D) volatile __ADCON0bits_t ADCON0bits;
1014 #define _ADON 0x01
1015 #define _GO_NOT_DONE 0x02
1016 #define _ADGO 0x02
1017 #define _GO 0x02
1018 #define _CHS0 0x04
1019 #define _CHS1 0x08
1020 #define _CHS2 0x10
1021 #define _CHS3 0x20
1022 #define _CHS4 0x40
1024 //==============================================================================
1027 //==============================================================================
1028 // ADCON1 Bits
1030 extern __at(0x009E) __sfr ADCON1;
1032 typedef union
1034 struct
1036 unsigned ADPREF0 : 1;
1037 unsigned ADPREF1 : 1;
1038 unsigned : 1;
1039 unsigned : 1;
1040 unsigned ADCS0 : 1;
1041 unsigned ADCS1 : 1;
1042 unsigned ADCS2 : 1;
1043 unsigned ADFM : 1;
1046 struct
1048 unsigned ADPREF : 2;
1049 unsigned : 6;
1052 struct
1054 unsigned : 4;
1055 unsigned ADCS : 3;
1056 unsigned : 1;
1058 } __ADCON1bits_t;
1060 extern __at(0x009E) volatile __ADCON1bits_t ADCON1bits;
1062 #define _ADPREF0 0x01
1063 #define _ADPREF1 0x02
1064 #define _ADCS0 0x10
1065 #define _ADCS1 0x20
1066 #define _ADCS2 0x40
1067 #define _ADFM 0x80
1069 //==============================================================================
1072 //==============================================================================
1073 // LATA Bits
1075 extern __at(0x010C) __sfr LATA;
1077 typedef struct
1079 unsigned LATA0 : 1;
1080 unsigned LATA1 : 1;
1081 unsigned LATA2 : 1;
1082 unsigned LATA3 : 1;
1083 unsigned LATA4 : 1;
1084 unsigned LATA5 : 1;
1085 unsigned LATA6 : 1;
1086 unsigned LATA7 : 1;
1087 } __LATAbits_t;
1089 extern __at(0x010C) volatile __LATAbits_t LATAbits;
1091 #define _LATA0 0x01
1092 #define _LATA1 0x02
1093 #define _LATA2 0x04
1094 #define _LATA3 0x08
1095 #define _LATA4 0x10
1096 #define _LATA5 0x20
1097 #define _LATA6 0x40
1098 #define _LATA7 0x80
1100 //==============================================================================
1103 //==============================================================================
1104 // LATB Bits
1106 extern __at(0x010D) __sfr LATB;
1108 typedef struct
1110 unsigned LATB0 : 1;
1111 unsigned LATB1 : 1;
1112 unsigned LATB2 : 1;
1113 unsigned LATB3 : 1;
1114 unsigned LATB4 : 1;
1115 unsigned LATB5 : 1;
1116 unsigned LATB6 : 1;
1117 unsigned LATB7 : 1;
1118 } __LATBbits_t;
1120 extern __at(0x010D) volatile __LATBbits_t LATBbits;
1122 #define _LATB0 0x01
1123 #define _LATB1 0x02
1124 #define _LATB2 0x04
1125 #define _LATB3 0x08
1126 #define _LATB4 0x10
1127 #define _LATB5 0x20
1128 #define _LATB6 0x40
1129 #define _LATB7 0x80
1131 //==============================================================================
1134 //==============================================================================
1135 // LATC Bits
1137 extern __at(0x010E) __sfr LATC;
1139 typedef struct
1141 unsigned LATC0 : 1;
1142 unsigned LATC1 : 1;
1143 unsigned LATC2 : 1;
1144 unsigned LATC3 : 1;
1145 unsigned LATC4 : 1;
1146 unsigned LATC5 : 1;
1147 unsigned LATC6 : 1;
1148 unsigned LATC7 : 1;
1149 } __LATCbits_t;
1151 extern __at(0x010E) volatile __LATCbits_t LATCbits;
1153 #define _LATC0 0x01
1154 #define _LATC1 0x02
1155 #define _LATC2 0x04
1156 #define _LATC3 0x08
1157 #define _LATC4 0x10
1158 #define _LATC5 0x20
1159 #define _LATC6 0x40
1160 #define _LATC7 0x80
1162 //==============================================================================
1165 //==============================================================================
1166 // BORCON Bits
1168 extern __at(0x0116) __sfr BORCON;
1170 typedef struct
1172 unsigned BORRDY : 1;
1173 unsigned : 1;
1174 unsigned : 1;
1175 unsigned : 1;
1176 unsigned : 1;
1177 unsigned : 1;
1178 unsigned BORFS : 1;
1179 unsigned SBOREN : 1;
1180 } __BORCONbits_t;
1182 extern __at(0x0116) volatile __BORCONbits_t BORCONbits;
1184 #define _BORRDY 0x01
1185 #define _BORFS 0x40
1186 #define _SBOREN 0x80
1188 //==============================================================================
1191 //==============================================================================
1192 // FVRCON Bits
1194 extern __at(0x0117) __sfr FVRCON;
1196 typedef union
1198 struct
1200 unsigned ADFVR0 : 1;
1201 unsigned ADFVR1 : 1;
1202 unsigned : 1;
1203 unsigned : 1;
1204 unsigned TSRNG : 1;
1205 unsigned TSEN : 1;
1206 unsigned FVRRDY : 1;
1207 unsigned FVREN : 1;
1210 struct
1212 unsigned ADFVR : 2;
1213 unsigned : 6;
1215 } __FVRCONbits_t;
1217 extern __at(0x0117) volatile __FVRCONbits_t FVRCONbits;
1219 #define _ADFVR0 0x01
1220 #define _ADFVR1 0x02
1221 #define _TSRNG 0x10
1222 #define _TSEN 0x20
1223 #define _FVRRDY 0x40
1224 #define _FVREN 0x80
1226 //==============================================================================
1229 //==============================================================================
1230 // APFCON Bits
1232 extern __at(0x011D) __sfr APFCON;
1234 typedef struct
1236 unsigned CCP2SEL : 1;
1237 unsigned SSSEL : 1;
1238 unsigned : 1;
1239 unsigned : 1;
1240 unsigned : 1;
1241 unsigned : 1;
1242 unsigned : 1;
1243 unsigned : 1;
1244 } __APFCONbits_t;
1246 extern __at(0x011D) volatile __APFCONbits_t APFCONbits;
1248 #define _CCP2SEL 0x01
1249 #define _SSSEL 0x02
1251 //==============================================================================
1254 //==============================================================================
1255 // ANSELA Bits
1257 extern __at(0x018C) __sfr ANSELA;
1259 typedef struct
1261 unsigned ANSA0 : 1;
1262 unsigned ANSA1 : 1;
1263 unsigned ANSA2 : 1;
1264 unsigned ANSA3 : 1;
1265 unsigned : 1;
1266 unsigned ANSA5 : 1;
1267 unsigned : 1;
1268 unsigned : 1;
1269 } __ANSELAbits_t;
1271 extern __at(0x018C) volatile __ANSELAbits_t ANSELAbits;
1273 #define _ANSA0 0x01
1274 #define _ANSA1 0x02
1275 #define _ANSA2 0x04
1276 #define _ANSA3 0x08
1277 #define _ANSA5 0x20
1279 //==============================================================================
1282 //==============================================================================
1283 // ANSELB Bits
1285 extern __at(0x018D) __sfr ANSELB;
1287 typedef union
1289 struct
1291 unsigned ANSB0 : 1;
1292 unsigned ANSB1 : 1;
1293 unsigned ANSB2 : 1;
1294 unsigned ANSB3 : 1;
1295 unsigned ANSB4 : 1;
1296 unsigned ANSB5 : 1;
1297 unsigned : 1;
1298 unsigned : 1;
1301 struct
1303 unsigned ANSB : 6;
1304 unsigned : 2;
1306 } __ANSELBbits_t;
1308 extern __at(0x018D) volatile __ANSELBbits_t ANSELBbits;
1310 #define _ANSB0 0x01
1311 #define _ANSB1 0x02
1312 #define _ANSB2 0x04
1313 #define _ANSB3 0x08
1314 #define _ANSB4 0x10
1315 #define _ANSB5 0x20
1317 //==============================================================================
1320 //==============================================================================
1321 // ANSELC Bits
1323 extern __at(0x018E) __sfr ANSELC;
1325 typedef struct
1327 unsigned : 1;
1328 unsigned : 1;
1329 unsigned ANSC2 : 1;
1330 unsigned ANSC3 : 1;
1331 unsigned ANSC4 : 1;
1332 unsigned ANSC5 : 1;
1333 unsigned ANSC6 : 1;
1334 unsigned ANSC7 : 1;
1335 } __ANSELCbits_t;
1337 extern __at(0x018E) volatile __ANSELCbits_t ANSELCbits;
1339 #define _ANSC2 0x04
1340 #define _ANSC3 0x08
1341 #define _ANSC4 0x10
1342 #define _ANSC5 0x20
1343 #define _ANSC6 0x40
1344 #define _ANSC7 0x80
1346 //==============================================================================
1348 extern __at(0x0191) __sfr PMADR;
1349 extern __at(0x0191) __sfr PMADRL;
1350 extern __at(0x0192) __sfr PMADRH;
1351 extern __at(0x0193) __sfr PMDAT;
1352 extern __at(0x0193) __sfr PMDATL;
1353 extern __at(0x0194) __sfr PMDATH;
1355 //==============================================================================
1356 // PMCON1 Bits
1358 extern __at(0x0195) __sfr PMCON1;
1360 typedef struct
1362 unsigned RD : 1;
1363 unsigned WR : 1;
1364 unsigned WREN : 1;
1365 unsigned WRERR : 1;
1366 unsigned FREE : 1;
1367 unsigned LWLO : 1;
1368 unsigned CFGS : 1;
1369 unsigned : 1;
1370 } __PMCON1bits_t;
1372 extern __at(0x0195) volatile __PMCON1bits_t PMCON1bits;
1374 #define _RD 0x01
1375 #define _WR 0x02
1376 #define _WREN 0x04
1377 #define _WRERR 0x08
1378 #define _FREE 0x10
1379 #define _LWLO 0x20
1380 #define _CFGS 0x40
1382 //==============================================================================
1384 extern __at(0x0196) __sfr PMCON2;
1386 //==============================================================================
1387 // VREGCON Bits
1389 extern __at(0x0197) __sfr VREGCON;
1391 typedef struct
1393 unsigned reserved : 1;
1394 unsigned VREGPM : 1;
1395 unsigned : 1;
1396 unsigned : 1;
1397 unsigned : 1;
1398 unsigned : 1;
1399 unsigned : 1;
1400 unsigned : 1;
1401 } __VREGCONbits_t;
1403 extern __at(0x0197) volatile __VREGCONbits_t VREGCONbits;
1405 #define _reserved 0x01
1406 #define _VREGPM 0x02
1408 //==============================================================================
1410 extern __at(0x0199) __sfr RCREG;
1411 extern __at(0x019A) __sfr TXREG;
1412 extern __at(0x019B) __sfr SP1BRG;
1413 extern __at(0x019B) __sfr SP1BRGL;
1414 extern __at(0x019B) __sfr SPBRG;
1415 extern __at(0x019B) __sfr SPBRGL;
1416 extern __at(0x019C) __sfr SP1BRGH;
1417 extern __at(0x019C) __sfr SPBRGH;
1419 //==============================================================================
1420 // RCSTA Bits
1422 extern __at(0x019D) __sfr RCSTA;
1424 typedef struct
1426 unsigned RX9D : 1;
1427 unsigned OERR : 1;
1428 unsigned FERR : 1;
1429 unsigned ADDEN : 1;
1430 unsigned CREN : 1;
1431 unsigned SREN : 1;
1432 unsigned RX9 : 1;
1433 unsigned SPEN : 1;
1434 } __RCSTAbits_t;
1436 extern __at(0x019D) volatile __RCSTAbits_t RCSTAbits;
1438 #define _RX9D 0x01
1439 #define _OERR 0x02
1440 #define _FERR 0x04
1441 #define _ADDEN 0x08
1442 #define _CREN 0x10
1443 #define _SREN 0x20
1444 #define _RX9 0x40
1445 #define _SPEN 0x80
1447 //==============================================================================
1450 //==============================================================================
1451 // TXSTA Bits
1453 extern __at(0x019E) __sfr TXSTA;
1455 typedef struct
1457 unsigned TX9D : 1;
1458 unsigned TRMT : 1;
1459 unsigned BRGH : 1;
1460 unsigned SENDB : 1;
1461 unsigned SYNC : 1;
1462 unsigned TXEN : 1;
1463 unsigned TX9 : 1;
1464 unsigned CSRC : 1;
1465 } __TXSTAbits_t;
1467 extern __at(0x019E) volatile __TXSTAbits_t TXSTAbits;
1469 #define _TX9D 0x01
1470 #define _TRMT 0x02
1471 #define _BRGH 0x04
1472 #define _SENDB 0x08
1473 #define _SYNC 0x10
1474 #define _TXEN 0x20
1475 #define _TX9 0x40
1476 #define _CSRC 0x80
1478 //==============================================================================
1481 //==============================================================================
1482 // BAUDCON Bits
1484 extern __at(0x019F) __sfr BAUDCON;
1486 typedef struct
1488 unsigned ABDEN : 1;
1489 unsigned WUE : 1;
1490 unsigned : 1;
1491 unsigned BRG16 : 1;
1492 unsigned SCKP : 1;
1493 unsigned : 1;
1494 unsigned RCIDL : 1;
1495 unsigned ABDOVF : 1;
1496 } __BAUDCONbits_t;
1498 extern __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits;
1500 #define _ABDEN 0x01
1501 #define _WUE 0x02
1502 #define _BRG16 0x08
1503 #define _SCKP 0x10
1504 #define _RCIDL 0x40
1505 #define _ABDOVF 0x80
1507 //==============================================================================
1510 //==============================================================================
1511 // WPUB Bits
1513 extern __at(0x020D) __sfr WPUB;
1515 typedef struct
1517 unsigned WPUB0 : 1;
1518 unsigned WPUB1 : 1;
1519 unsigned WPUB2 : 1;
1520 unsigned WPUB3 : 1;
1521 unsigned WPUB4 : 1;
1522 unsigned WPUB5 : 1;
1523 unsigned WPUB6 : 1;
1524 unsigned WPUB7 : 1;
1525 } __WPUBbits_t;
1527 extern __at(0x020D) volatile __WPUBbits_t WPUBbits;
1529 #define _WPUB0 0x01
1530 #define _WPUB1 0x02
1531 #define _WPUB2 0x04
1532 #define _WPUB3 0x08
1533 #define _WPUB4 0x10
1534 #define _WPUB5 0x20
1535 #define _WPUB6 0x40
1536 #define _WPUB7 0x80
1538 //==============================================================================
1541 //==============================================================================
1542 // WPUE Bits
1544 extern __at(0x0210) __sfr WPUE;
1546 typedef struct
1548 unsigned : 1;
1549 unsigned : 1;
1550 unsigned : 1;
1551 unsigned WPUE3 : 1;
1552 unsigned : 1;
1553 unsigned : 1;
1554 unsigned : 1;
1555 unsigned : 1;
1556 } __WPUEbits_t;
1558 extern __at(0x0210) volatile __WPUEbits_t WPUEbits;
1560 #define _WPUE3 0x08
1562 //==============================================================================
1564 extern __at(0x0211) __sfr SSP1BUF;
1565 extern __at(0x0211) __sfr SSPBUF;
1566 extern __at(0x0212) __sfr SSP1ADD;
1567 extern __at(0x0212) __sfr SSPADD;
1568 extern __at(0x0213) __sfr SSP1MSK;
1569 extern __at(0x0213) __sfr SSPMSK;
1571 //==============================================================================
1572 // SSP1STAT Bits
1574 extern __at(0x0214) __sfr SSP1STAT;
1576 typedef struct
1578 unsigned BF : 1;
1579 unsigned UA : 1;
1580 unsigned R_NOT_W : 1;
1581 unsigned S : 1;
1582 unsigned P : 1;
1583 unsigned D_NOT_A : 1;
1584 unsigned CKE : 1;
1585 unsigned SMP : 1;
1586 } __SSP1STATbits_t;
1588 extern __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits;
1590 #define _BF 0x01
1591 #define _UA 0x02
1592 #define _R_NOT_W 0x04
1593 #define _S 0x08
1594 #define _P 0x10
1595 #define _D_NOT_A 0x20
1596 #define _CKE 0x40
1597 #define _SMP 0x80
1599 //==============================================================================
1602 //==============================================================================
1603 // SSPSTAT Bits
1605 extern __at(0x0214) __sfr SSPSTAT;
1607 typedef struct
1609 unsigned BF : 1;
1610 unsigned UA : 1;
1611 unsigned R_NOT_W : 1;
1612 unsigned S : 1;
1613 unsigned P : 1;
1614 unsigned D_NOT_A : 1;
1615 unsigned CKE : 1;
1616 unsigned SMP : 1;
1617 } __SSPSTATbits_t;
1619 extern __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits;
1621 #define _SSPSTAT_BF 0x01
1622 #define _SSPSTAT_UA 0x02
1623 #define _SSPSTAT_R_NOT_W 0x04
1624 #define _SSPSTAT_S 0x08
1625 #define _SSPSTAT_P 0x10
1626 #define _SSPSTAT_D_NOT_A 0x20
1627 #define _SSPSTAT_CKE 0x40
1628 #define _SSPSTAT_SMP 0x80
1630 //==============================================================================
1633 //==============================================================================
1634 // SSP1CON1 Bits
1636 extern __at(0x0215) __sfr SSP1CON1;
1638 typedef union
1640 struct
1642 unsigned SSPM0 : 1;
1643 unsigned SSPM1 : 1;
1644 unsigned SSPM2 : 1;
1645 unsigned SSPM3 : 1;
1646 unsigned CKP : 1;
1647 unsigned SSPEN : 1;
1648 unsigned SSPOV : 1;
1649 unsigned WCOL : 1;
1652 struct
1654 unsigned SSPM : 4;
1655 unsigned : 4;
1657 } __SSP1CON1bits_t;
1659 extern __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits;
1661 #define _SSPM0 0x01
1662 #define _SSPM1 0x02
1663 #define _SSPM2 0x04
1664 #define _SSPM3 0x08
1665 #define _CKP 0x10
1666 #define _SSPEN 0x20
1667 #define _SSPOV 0x40
1668 #define _WCOL 0x80
1670 //==============================================================================
1673 //==============================================================================
1674 // SSPCON Bits
1676 extern __at(0x0215) __sfr SSPCON;
1678 typedef union
1680 struct
1682 unsigned SSPM0 : 1;
1683 unsigned SSPM1 : 1;
1684 unsigned SSPM2 : 1;
1685 unsigned SSPM3 : 1;
1686 unsigned CKP : 1;
1687 unsigned SSPEN : 1;
1688 unsigned SSPOV : 1;
1689 unsigned WCOL : 1;
1692 struct
1694 unsigned SSPM : 4;
1695 unsigned : 4;
1697 } __SSPCONbits_t;
1699 extern __at(0x0215) volatile __SSPCONbits_t SSPCONbits;
1701 #define _SSPCON_SSPM0 0x01
1702 #define _SSPCON_SSPM1 0x02
1703 #define _SSPCON_SSPM2 0x04
1704 #define _SSPCON_SSPM3 0x08
1705 #define _SSPCON_CKP 0x10
1706 #define _SSPCON_SSPEN 0x20
1707 #define _SSPCON_SSPOV 0x40
1708 #define _SSPCON_WCOL 0x80
1710 //==============================================================================
1713 //==============================================================================
1714 // SSPCON1 Bits
1716 extern __at(0x0215) __sfr SSPCON1;
1718 typedef union
1720 struct
1722 unsigned SSPM0 : 1;
1723 unsigned SSPM1 : 1;
1724 unsigned SSPM2 : 1;
1725 unsigned SSPM3 : 1;
1726 unsigned CKP : 1;
1727 unsigned SSPEN : 1;
1728 unsigned SSPOV : 1;
1729 unsigned WCOL : 1;
1732 struct
1734 unsigned SSPM : 4;
1735 unsigned : 4;
1737 } __SSPCON1bits_t;
1739 extern __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits;
1741 #define _SSPCON1_SSPM0 0x01
1742 #define _SSPCON1_SSPM1 0x02
1743 #define _SSPCON1_SSPM2 0x04
1744 #define _SSPCON1_SSPM3 0x08
1745 #define _SSPCON1_CKP 0x10
1746 #define _SSPCON1_SSPEN 0x20
1747 #define _SSPCON1_SSPOV 0x40
1748 #define _SSPCON1_WCOL 0x80
1750 //==============================================================================
1753 //==============================================================================
1754 // SSP1CON2 Bits
1756 extern __at(0x0216) __sfr SSP1CON2;
1758 typedef struct
1760 unsigned SEN : 1;
1761 unsigned RSEN : 1;
1762 unsigned PEN : 1;
1763 unsigned RCEN : 1;
1764 unsigned ACKEN : 1;
1765 unsigned ACKDT : 1;
1766 unsigned ACKSTAT : 1;
1767 unsigned GCEN : 1;
1768 } __SSP1CON2bits_t;
1770 extern __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits;
1772 #define _SEN 0x01
1773 #define _RSEN 0x02
1774 #define _PEN 0x04
1775 #define _RCEN 0x08
1776 #define _ACKEN 0x10
1777 #define _ACKDT 0x20
1778 #define _ACKSTAT 0x40
1779 #define _GCEN 0x80
1781 //==============================================================================
1784 //==============================================================================
1785 // SSPCON2 Bits
1787 extern __at(0x0216) __sfr SSPCON2;
1789 typedef struct
1791 unsigned SEN : 1;
1792 unsigned RSEN : 1;
1793 unsigned PEN : 1;
1794 unsigned RCEN : 1;
1795 unsigned ACKEN : 1;
1796 unsigned ACKDT : 1;
1797 unsigned ACKSTAT : 1;
1798 unsigned GCEN : 1;
1799 } __SSPCON2bits_t;
1801 extern __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits;
1803 #define _SSPCON2_SEN 0x01
1804 #define _SSPCON2_RSEN 0x02
1805 #define _SSPCON2_PEN 0x04
1806 #define _SSPCON2_RCEN 0x08
1807 #define _SSPCON2_ACKEN 0x10
1808 #define _SSPCON2_ACKDT 0x20
1809 #define _SSPCON2_ACKSTAT 0x40
1810 #define _SSPCON2_GCEN 0x80
1812 //==============================================================================
1815 //==============================================================================
1816 // SSP1CON3 Bits
1818 extern __at(0x0217) __sfr SSP1CON3;
1820 typedef struct
1822 unsigned DHEN : 1;
1823 unsigned AHEN : 1;
1824 unsigned SBCDE : 1;
1825 unsigned SDAHT : 1;
1826 unsigned BOEN : 1;
1827 unsigned SCIE : 1;
1828 unsigned PCIE : 1;
1829 unsigned ACKTIM : 1;
1830 } __SSP1CON3bits_t;
1832 extern __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits;
1834 #define _DHEN 0x01
1835 #define _AHEN 0x02
1836 #define _SBCDE 0x04
1837 #define _SDAHT 0x08
1838 #define _BOEN 0x10
1839 #define _SCIE 0x20
1840 #define _PCIE 0x40
1841 #define _ACKTIM 0x80
1843 //==============================================================================
1846 //==============================================================================
1847 // SSPCON3 Bits
1849 extern __at(0x0217) __sfr SSPCON3;
1851 typedef struct
1853 unsigned DHEN : 1;
1854 unsigned AHEN : 1;
1855 unsigned SBCDE : 1;
1856 unsigned SDAHT : 1;
1857 unsigned BOEN : 1;
1858 unsigned SCIE : 1;
1859 unsigned PCIE : 1;
1860 unsigned ACKTIM : 1;
1861 } __SSPCON3bits_t;
1863 extern __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits;
1865 #define _SSPCON3_DHEN 0x01
1866 #define _SSPCON3_AHEN 0x02
1867 #define _SSPCON3_SBCDE 0x04
1868 #define _SSPCON3_SDAHT 0x08
1869 #define _SSPCON3_BOEN 0x10
1870 #define _SSPCON3_SCIE 0x20
1871 #define _SSPCON3_PCIE 0x40
1872 #define _SSPCON3_ACKTIM 0x80
1874 //==============================================================================
1876 extern __at(0x0291) __sfr CCPR1;
1877 extern __at(0x0291) __sfr CCPR1L;
1878 extern __at(0x0292) __sfr CCPR1H;
1880 //==============================================================================
1881 // CCP1CON Bits
1883 extern __at(0x0293) __sfr CCP1CON;
1885 typedef union
1887 struct
1889 unsigned CCP1M0 : 1;
1890 unsigned CCP1M1 : 1;
1891 unsigned CCP1M2 : 1;
1892 unsigned CCP1M3 : 1;
1893 unsigned DC1B0 : 1;
1894 unsigned DC1B1 : 1;
1895 unsigned : 1;
1896 unsigned : 1;
1899 struct
1901 unsigned CCP1M : 4;
1902 unsigned : 4;
1905 struct
1907 unsigned : 4;
1908 unsigned DC1B : 2;
1909 unsigned : 2;
1911 } __CCP1CONbits_t;
1913 extern __at(0x0293) volatile __CCP1CONbits_t CCP1CONbits;
1915 #define _CCP1M0 0x01
1916 #define _CCP1M1 0x02
1917 #define _CCP1M2 0x04
1918 #define _CCP1M3 0x08
1919 #define _DC1B0 0x10
1920 #define _DC1B1 0x20
1922 //==============================================================================
1924 extern __at(0x0298) __sfr CCPR2;
1925 extern __at(0x0298) __sfr CCPR2L;
1926 extern __at(0x0299) __sfr CCPR2H;
1928 //==============================================================================
1929 // CCP2CON Bits
1931 extern __at(0x029A) __sfr CCP2CON;
1933 typedef union
1935 struct
1937 unsigned CCP2M0 : 1;
1938 unsigned CCP2M1 : 1;
1939 unsigned CCP2M2 : 1;
1940 unsigned CCP2M3 : 1;
1941 unsigned DC2B0 : 1;
1942 unsigned DC2B1 : 1;
1943 unsigned : 1;
1944 unsigned : 1;
1947 struct
1949 unsigned CCP2M : 4;
1950 unsigned : 4;
1953 struct
1955 unsigned : 4;
1956 unsigned DC2B : 2;
1957 unsigned : 2;
1959 } __CCP2CONbits_t;
1961 extern __at(0x029A) volatile __CCP2CONbits_t CCP2CONbits;
1963 #define _CCP2M0 0x01
1964 #define _CCP2M1 0x02
1965 #define _CCP2M2 0x04
1966 #define _CCP2M3 0x08
1967 #define _DC2B0 0x10
1968 #define _DC2B1 0x20
1970 //==============================================================================
1973 //==============================================================================
1974 // IOCBP Bits
1976 extern __at(0x0394) __sfr IOCBP;
1978 typedef struct
1980 unsigned IOCBP0 : 1;
1981 unsigned IOCBP1 : 1;
1982 unsigned IOCBP2 : 1;
1983 unsigned IOCBP3 : 1;
1984 unsigned IOCBP4 : 1;
1985 unsigned IOCBP5 : 1;
1986 unsigned IOCBP6 : 1;
1987 unsigned IOCBP7 : 1;
1988 } __IOCBPbits_t;
1990 extern __at(0x0394) volatile __IOCBPbits_t IOCBPbits;
1992 #define _IOCBP0 0x01
1993 #define _IOCBP1 0x02
1994 #define _IOCBP2 0x04
1995 #define _IOCBP3 0x08
1996 #define _IOCBP4 0x10
1997 #define _IOCBP5 0x20
1998 #define _IOCBP6 0x40
1999 #define _IOCBP7 0x80
2001 //==============================================================================
2004 //==============================================================================
2005 // IOCBN Bits
2007 extern __at(0x0395) __sfr IOCBN;
2009 typedef struct
2011 unsigned IOCBN0 : 1;
2012 unsigned IOCBN1 : 1;
2013 unsigned IOCBN2 : 1;
2014 unsigned IOCBN3 : 1;
2015 unsigned IOCBN4 : 1;
2016 unsigned IOCBN5 : 1;
2017 unsigned IOCBN6 : 1;
2018 unsigned IOCBN7 : 1;
2019 } __IOCBNbits_t;
2021 extern __at(0x0395) volatile __IOCBNbits_t IOCBNbits;
2023 #define _IOCBN0 0x01
2024 #define _IOCBN1 0x02
2025 #define _IOCBN2 0x04
2026 #define _IOCBN3 0x08
2027 #define _IOCBN4 0x10
2028 #define _IOCBN5 0x20
2029 #define _IOCBN6 0x40
2030 #define _IOCBN7 0x80
2032 //==============================================================================
2035 //==============================================================================
2036 // IOCBF Bits
2038 extern __at(0x0396) __sfr IOCBF;
2040 typedef struct
2042 unsigned IOCBF0 : 1;
2043 unsigned IOCBF1 : 1;
2044 unsigned IOCBF2 : 1;
2045 unsigned IOCBF3 : 1;
2046 unsigned IOCBF4 : 1;
2047 unsigned IOCBF5 : 1;
2048 unsigned IOCBF6 : 1;
2049 unsigned IOCBF7 : 1;
2050 } __IOCBFbits_t;
2052 extern __at(0x0396) volatile __IOCBFbits_t IOCBFbits;
2054 #define _IOCBF0 0x01
2055 #define _IOCBF1 0x02
2056 #define _IOCBF2 0x04
2057 #define _IOCBF3 0x08
2058 #define _IOCBF4 0x10
2059 #define _IOCBF5 0x20
2060 #define _IOCBF6 0x40
2061 #define _IOCBF7 0x80
2063 //==============================================================================
2066 //==============================================================================
2067 // STATUS_SHAD Bits
2069 extern __at(0x0FE4) __sfr STATUS_SHAD;
2071 typedef struct
2073 unsigned C_SHAD : 1;
2074 unsigned DC_SHAD : 1;
2075 unsigned Z_SHAD : 1;
2076 unsigned : 1;
2077 unsigned : 1;
2078 unsigned : 1;
2079 unsigned : 1;
2080 unsigned : 1;
2081 } __STATUS_SHADbits_t;
2083 extern __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits;
2085 #define _C_SHAD 0x01
2086 #define _DC_SHAD 0x02
2087 #define _Z_SHAD 0x04
2089 //==============================================================================
2091 extern __at(0x0FE5) __sfr WREG_SHAD;
2092 extern __at(0x0FE6) __sfr BSR_SHAD;
2093 extern __at(0x0FE7) __sfr PCLATH_SHAD;
2094 extern __at(0x0FE8) __sfr FSR0L_SHAD;
2095 extern __at(0x0FE9) __sfr FSR0H_SHAD;
2096 extern __at(0x0FEA) __sfr FSR1L_SHAD;
2097 extern __at(0x0FEB) __sfr FSR1H_SHAD;
2098 extern __at(0x0FED) __sfr STKPTR;
2099 extern __at(0x0FEE) __sfr TOSL;
2100 extern __at(0x0FEF) __sfr TOSH;
2102 //==============================================================================
2104 // Configuration Bits
2106 //==============================================================================
2108 #define _CONFIG1 0x8007
2109 #define _CONFIG2 0x8008
2111 //----------------------------- CONFIG1 Options -------------------------------
2113 #define _FOSC_LP 0x3FF8 // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins.
2114 #define _FOSC_XT 0x3FF9 // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins.
2115 #define _FOSC_HS 0x3FFA // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins.
2116 #define _FOSC_EXTRC 0x3FFB // EXTRC oscillator: External RC circuit connected to CLKIN pin.
2117 #define _FOSC_INTOSC 0x3FFC // INTOSC oscillator: I/O function on CLKIN pin.
2118 #define _FOSC_ECL 0x3FFD // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin.
2119 #define _FOSC_ECM 0x3FFE // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin.
2120 #define _FOSC_ECH 0x3FFF // ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pin.
2121 #define _WDTE_OFF 0x3FE7 // WDT disabled.
2122 #define _WDTE_SWDTEN 0x3FEF // WDT controlled by the SWDTEN bit in the WDTCON register.
2123 #define _WDTE_NSLEEP 0x3FF7 // WDT enabled while running and disabled in Sleep.
2124 #define _WDTE_ON 0x3FFF // WDT enabled.
2125 #define _PWRTE_ON 0x3FDF // PWRT enabled.
2126 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
2127 #define _MCLRE_OFF 0x3FBF // MCLR/VPP pin function is digital input.
2128 #define _MCLRE_ON 0x3FFF // MCLR/VPP pin function is MCLR.
2129 #define _CP_ON 0x3F7F // Program memory code protection is enabled.
2130 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
2131 #define _BOREN_OFF 0x39FF // Brown-out Reset disabled.
2132 #define _BOREN_SBODEN 0x3BFF // Brown-out Reset controlled by the SBOREN bit in the BORCON register.
2133 #define _BOREN_NSLEEP 0x3DFF // Brown-out Reset enabled while running and disabled in Sleep.
2134 #define _BOREN_ON 0x3FFF // Brown-out Reset enabled.
2135 #define _CLKOUTEN_ON 0x37FF // CLKOUT function is enabled on the CLKOUT pin.
2136 #define _CLKOUTEN_OFF 0x3FFF // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin.
2137 #define _IESO_OFF 0x2FFF // Internal/External Switchover mode is disabled.
2138 #define _IESO_ON 0x3FFF // Internal/External Switchover mode is enabled.
2139 #define _FCMEN_OFF 0x1FFF // Fail-Safe Clock Monitor is disabled.
2140 #define _FCMEN_ON 0x3FFF // Fail-Safe Clock Monitor is enabled.
2142 //----------------------------- CONFIG2 Options -------------------------------
2144 #define _WRT_ALL 0x3FFC // 000h to 1FFFh write protected, no addresses may be modified by EECON control.
2145 #define _WRT_HALF 0x3FFD // 000h to FFFh write protected, 1000h to 1FFFh may be modified by EECON control.
2146 #define _WRT_BOOT 0x3FFE // 000h to 1FFh write protected, 200h to 1FFFh may be modified by EECON control.
2147 #define _WRT_OFF 0x3FFF // Write protection off.
2148 #define _VCAPEN_ON 0x3FEF // VCAP pin function enabled.
2149 #define _VCAPEN_OFF 0x3FFF // VCAP pin function disabled.
2150 #define _STVREN_OFF 0x3DFF // Stack Overflow or Underflow will not cause a Reset.
2151 #define _STVREN_ON 0x3FFF // Stack Overflow or Underflow will cause a Reset.
2152 #define _BORV_HI 0x3BFF // Brown-out Reset Voltage (Vbor), high trip point selected.
2153 #define _BORV_LO 0x3FFF // Brown-out Reset Voltage (Vbor), low trip point selected.
2154 #define _LPBOR_ON 0x37FF // Low-Power BOR is enabled.
2155 #define _LPBOR_OFF 0x3FFF // Low-Power BOR is disabled.
2156 #define _DEBUG_ON 0x2FFF // In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger.
2157 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins.
2158 #define _LVP_OFF 0x1FFF // High-voltage on MCLR/VPP must be used for programming.
2159 #define _LVP_ON 0x3FFF // Low-voltage programming enabled.
2161 //==============================================================================
2163 #define _DEVID1 0x8006
2165 #define _IDLOC0 0x8000
2166 #define _IDLOC1 0x8001
2167 #define _IDLOC2 0x8002
2168 #define _IDLOC3 0x8003
2170 //==============================================================================
2172 #ifndef NO_BIT_DEFINES
2174 #define ADON ADCON0bits.ADON // bit 0
2175 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
2176 #define ADGO ADCON0bits.ADGO // bit 1, shadows bit in ADCON0bits
2177 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
2178 #define CHS0 ADCON0bits.CHS0 // bit 2
2179 #define CHS1 ADCON0bits.CHS1 // bit 3
2180 #define CHS2 ADCON0bits.CHS2 // bit 4
2181 #define CHS3 ADCON0bits.CHS3 // bit 5
2182 #define CHS4 ADCON0bits.CHS4 // bit 6
2184 #define ADPREF0 ADCON1bits.ADPREF0 // bit 0
2185 #define ADPREF1 ADCON1bits.ADPREF1 // bit 1
2186 #define ADCS0 ADCON1bits.ADCS0 // bit 4
2187 #define ADCS1 ADCON1bits.ADCS1 // bit 5
2188 #define ADCS2 ADCON1bits.ADCS2 // bit 6
2189 #define ADFM ADCON1bits.ADFM // bit 7
2191 #define ANSA0 ANSELAbits.ANSA0 // bit 0
2192 #define ANSA1 ANSELAbits.ANSA1 // bit 1
2193 #define ANSA2 ANSELAbits.ANSA2 // bit 2
2194 #define ANSA3 ANSELAbits.ANSA3 // bit 3
2195 #define ANSA5 ANSELAbits.ANSA5 // bit 5
2197 #define ANSB0 ANSELBbits.ANSB0 // bit 0
2198 #define ANSB1 ANSELBbits.ANSB1 // bit 1
2199 #define ANSB2 ANSELBbits.ANSB2 // bit 2
2200 #define ANSB3 ANSELBbits.ANSB3 // bit 3
2201 #define ANSB4 ANSELBbits.ANSB4 // bit 4
2202 #define ANSB5 ANSELBbits.ANSB5 // bit 5
2204 #define ANSC2 ANSELCbits.ANSC2 // bit 2
2205 #define ANSC3 ANSELCbits.ANSC3 // bit 3
2206 #define ANSC4 ANSELCbits.ANSC4 // bit 4
2207 #define ANSC5 ANSELCbits.ANSC5 // bit 5
2208 #define ANSC6 ANSELCbits.ANSC6 // bit 6
2209 #define ANSC7 ANSELCbits.ANSC7 // bit 7
2211 #define CCP2SEL APFCONbits.CCP2SEL // bit 0
2212 #define SSSEL APFCONbits.SSSEL // bit 1
2214 #define ABDEN BAUDCONbits.ABDEN // bit 0
2215 #define WUE BAUDCONbits.WUE // bit 1
2216 #define BRG16 BAUDCONbits.BRG16 // bit 3
2217 #define SCKP BAUDCONbits.SCKP // bit 4
2218 #define RCIDL BAUDCONbits.RCIDL // bit 6
2219 #define ABDOVF BAUDCONbits.ABDOVF // bit 7
2221 #define BORRDY BORCONbits.BORRDY // bit 0
2222 #define BORFS BORCONbits.BORFS // bit 6
2223 #define SBOREN BORCONbits.SBOREN // bit 7
2225 #define BSR0 BSRbits.BSR0 // bit 0
2226 #define BSR1 BSRbits.BSR1 // bit 1
2227 #define BSR2 BSRbits.BSR2 // bit 2
2228 #define BSR3 BSRbits.BSR3 // bit 3
2229 #define BSR4 BSRbits.BSR4 // bit 4
2231 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
2232 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
2233 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
2234 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
2235 #define DC1B0 CCP1CONbits.DC1B0 // bit 4
2236 #define DC1B1 CCP1CONbits.DC1B1 // bit 5
2238 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
2239 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
2240 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
2241 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
2242 #define DC2B0 CCP2CONbits.DC2B0 // bit 4
2243 #define DC2B1 CCP2CONbits.DC2B1 // bit 5
2245 #define ADFVR0 FVRCONbits.ADFVR0 // bit 0
2246 #define ADFVR1 FVRCONbits.ADFVR1 // bit 1
2247 #define TSRNG FVRCONbits.TSRNG // bit 4
2248 #define TSEN FVRCONbits.TSEN // bit 5
2249 #define FVRRDY FVRCONbits.FVRRDY // bit 6
2250 #define FVREN FVRCONbits.FVREN // bit 7
2252 #define IOCIF INTCONbits.IOCIF // bit 0
2253 #define INTF INTCONbits.INTF // bit 1
2254 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
2255 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
2256 #define IOCIE INTCONbits.IOCIE // bit 3
2257 #define INTE INTCONbits.INTE // bit 4
2258 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
2259 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
2260 #define PEIE INTCONbits.PEIE // bit 6
2261 #define GIE INTCONbits.GIE // bit 7
2263 #define IOCBF0 IOCBFbits.IOCBF0 // bit 0
2264 #define IOCBF1 IOCBFbits.IOCBF1 // bit 1
2265 #define IOCBF2 IOCBFbits.IOCBF2 // bit 2
2266 #define IOCBF3 IOCBFbits.IOCBF3 // bit 3
2267 #define IOCBF4 IOCBFbits.IOCBF4 // bit 4
2268 #define IOCBF5 IOCBFbits.IOCBF5 // bit 5
2269 #define IOCBF6 IOCBFbits.IOCBF6 // bit 6
2270 #define IOCBF7 IOCBFbits.IOCBF7 // bit 7
2272 #define IOCBN0 IOCBNbits.IOCBN0 // bit 0
2273 #define IOCBN1 IOCBNbits.IOCBN1 // bit 1
2274 #define IOCBN2 IOCBNbits.IOCBN2 // bit 2
2275 #define IOCBN3 IOCBNbits.IOCBN3 // bit 3
2276 #define IOCBN4 IOCBNbits.IOCBN4 // bit 4
2277 #define IOCBN5 IOCBNbits.IOCBN5 // bit 5
2278 #define IOCBN6 IOCBNbits.IOCBN6 // bit 6
2279 #define IOCBN7 IOCBNbits.IOCBN7 // bit 7
2281 #define IOCBP0 IOCBPbits.IOCBP0 // bit 0
2282 #define IOCBP1 IOCBPbits.IOCBP1 // bit 1
2283 #define IOCBP2 IOCBPbits.IOCBP2 // bit 2
2284 #define IOCBP3 IOCBPbits.IOCBP3 // bit 3
2285 #define IOCBP4 IOCBPbits.IOCBP4 // bit 4
2286 #define IOCBP5 IOCBPbits.IOCBP5 // bit 5
2287 #define IOCBP6 IOCBPbits.IOCBP6 // bit 6
2288 #define IOCBP7 IOCBPbits.IOCBP7 // bit 7
2290 #define LATA0 LATAbits.LATA0 // bit 0
2291 #define LATA1 LATAbits.LATA1 // bit 1
2292 #define LATA2 LATAbits.LATA2 // bit 2
2293 #define LATA3 LATAbits.LATA3 // bit 3
2294 #define LATA4 LATAbits.LATA4 // bit 4
2295 #define LATA5 LATAbits.LATA5 // bit 5
2296 #define LATA6 LATAbits.LATA6 // bit 6
2297 #define LATA7 LATAbits.LATA7 // bit 7
2299 #define LATB0 LATBbits.LATB0 // bit 0
2300 #define LATB1 LATBbits.LATB1 // bit 1
2301 #define LATB2 LATBbits.LATB2 // bit 2
2302 #define LATB3 LATBbits.LATB3 // bit 3
2303 #define LATB4 LATBbits.LATB4 // bit 4
2304 #define LATB5 LATBbits.LATB5 // bit 5
2305 #define LATB6 LATBbits.LATB6 // bit 6
2306 #define LATB7 LATBbits.LATB7 // bit 7
2308 #define LATC0 LATCbits.LATC0 // bit 0
2309 #define LATC1 LATCbits.LATC1 // bit 1
2310 #define LATC2 LATCbits.LATC2 // bit 2
2311 #define LATC3 LATCbits.LATC3 // bit 3
2312 #define LATC4 LATCbits.LATC4 // bit 4
2313 #define LATC5 LATCbits.LATC5 // bit 5
2314 #define LATC6 LATCbits.LATC6 // bit 6
2315 #define LATC7 LATCbits.LATC7 // bit 7
2317 #define PS0 OPTION_REGbits.PS0 // bit 0
2318 #define PS1 OPTION_REGbits.PS1 // bit 1
2319 #define PS2 OPTION_REGbits.PS2 // bit 2
2320 #define PSA OPTION_REGbits.PSA // bit 3
2321 #define TMR0SE OPTION_REGbits.TMR0SE // bit 4, shadows bit in OPTION_REGbits
2322 #define T0SE OPTION_REGbits.T0SE // bit 4, shadows bit in OPTION_REGbits
2323 #define TMR0CS OPTION_REGbits.TMR0CS // bit 5, shadows bit in OPTION_REGbits
2324 #define T0CS OPTION_REGbits.T0CS // bit 5, shadows bit in OPTION_REGbits
2325 #define INTEDG OPTION_REGbits.INTEDG // bit 6
2326 #define NOT_WPUEN OPTION_REGbits.NOT_WPUEN // bit 7
2328 #define SCS0 OSCCONbits.SCS0 // bit 0
2329 #define SCS1 OSCCONbits.SCS1 // bit 1
2330 #define IRCF0 OSCCONbits.IRCF0 // bit 3
2331 #define IRCF1 OSCCONbits.IRCF1 // bit 4
2332 #define IRCF2 OSCCONbits.IRCF2 // bit 5
2333 #define IRCF3 OSCCONbits.IRCF3 // bit 6
2335 #define HFIOFS OSCSTATbits.HFIOFS // bit 0
2336 #define LFIOFR OSCSTATbits.LFIOFR // bit 1
2337 #define HFIOFR OSCSTATbits.HFIOFR // bit 4
2338 #define OSTS OSCSTATbits.OSTS // bit 5
2339 #define SOSCR OSCSTATbits.SOSCR // bit 7, shadows bit in OSCSTATbits
2340 #define T1OSCR OSCSTATbits.T1OSCR // bit 7, shadows bit in OSCSTATbits
2342 #define NOT_BOR PCONbits.NOT_BOR // bit 0
2343 #define NOT_POR PCONbits.NOT_POR // bit 1
2344 #define NOT_RI PCONbits.NOT_RI // bit 2
2345 #define NOT_RMCLR PCONbits.NOT_RMCLR // bit 3
2346 #define NOT_RWDT PCONbits.NOT_RWDT // bit 4
2347 #define STKUNF PCONbits.STKUNF // bit 6
2348 #define STKOVF PCONbits.STKOVF // bit 7
2350 #define TMR1IE PIE1bits.TMR1IE // bit 0
2351 #define TMR2IE PIE1bits.TMR2IE // bit 1
2352 #define CCP1IE PIE1bits.CCP1IE // bit 2
2353 #define SSPIE PIE1bits.SSPIE // bit 3
2354 #define TXIE PIE1bits.TXIE // bit 4
2355 #define RCIE PIE1bits.RCIE // bit 5
2356 #define ADIE PIE1bits.ADIE // bit 6
2357 #define TMR1GIE PIE1bits.TMR1GIE // bit 7
2359 #define CCP2IE PIE2bits.CCP2IE // bit 0
2360 #define BCLIE PIE2bits.BCLIE // bit 3
2361 #define OSFIE PIE2bits.OSFIE // bit 7
2363 #define TMR1IF PIR1bits.TMR1IF // bit 0
2364 #define TMR2IF PIR1bits.TMR2IF // bit 1
2365 #define CCP1IF PIR1bits.CCP1IF // bit 2
2366 #define SSPIF PIR1bits.SSPIF // bit 3
2367 #define TXIF PIR1bits.TXIF // bit 4
2368 #define RCIF PIR1bits.RCIF // bit 5
2369 #define ADIF PIR1bits.ADIF // bit 6
2370 #define TMR1GIF PIR1bits.TMR1GIF // bit 7
2372 #define CCP2IF PIR2bits.CCP2IF // bit 0
2373 #define BCLIF PIR2bits.BCLIF // bit 3
2374 #define OSFIF PIR2bits.OSFIF // bit 7
2376 #define RD PMCON1bits.RD // bit 0
2377 #define WR PMCON1bits.WR // bit 1
2378 #define WREN PMCON1bits.WREN // bit 2
2379 #define WRERR PMCON1bits.WRERR // bit 3
2380 #define FREE PMCON1bits.FREE // bit 4
2381 #define LWLO PMCON1bits.LWLO // bit 5
2382 #define CFGS PMCON1bits.CFGS // bit 6
2384 #define RA0 PORTAbits.RA0 // bit 0
2385 #define RA1 PORTAbits.RA1 // bit 1
2386 #define RA2 PORTAbits.RA2 // bit 2
2387 #define RA3 PORTAbits.RA3 // bit 3
2388 #define RA4 PORTAbits.RA4 // bit 4
2389 #define RA5 PORTAbits.RA5 // bit 5
2390 #define RA6 PORTAbits.RA6 // bit 6
2391 #define RA7 PORTAbits.RA7 // bit 7
2393 #define RB0 PORTBbits.RB0 // bit 0
2394 #define RB1 PORTBbits.RB1 // bit 1
2395 #define RB2 PORTBbits.RB2 // bit 2
2396 #define RB3 PORTBbits.RB3 // bit 3
2397 #define RB4 PORTBbits.RB4 // bit 4
2398 #define RB5 PORTBbits.RB5 // bit 5
2399 #define RB6 PORTBbits.RB6 // bit 6
2400 #define RB7 PORTBbits.RB7 // bit 7
2402 #define RC0 PORTCbits.RC0 // bit 0
2403 #define RC1 PORTCbits.RC1 // bit 1
2404 #define RC2 PORTCbits.RC2 // bit 2
2405 #define RC3 PORTCbits.RC3 // bit 3
2406 #define RC4 PORTCbits.RC4 // bit 4
2407 #define RC5 PORTCbits.RC5 // bit 5
2408 #define RC6 PORTCbits.RC6 // bit 6
2409 #define RC7 PORTCbits.RC7 // bit 7
2411 #define RE3 PORTEbits.RE3 // bit 3
2413 #define RX9D RCSTAbits.RX9D // bit 0
2414 #define OERR RCSTAbits.OERR // bit 1
2415 #define FERR RCSTAbits.FERR // bit 2
2416 #define ADDEN RCSTAbits.ADDEN // bit 3
2417 #define CREN RCSTAbits.CREN // bit 4
2418 #define SREN RCSTAbits.SREN // bit 5
2419 #define RX9 RCSTAbits.RX9 // bit 6
2420 #define SPEN RCSTAbits.SPEN // bit 7
2422 #define SSPM0 SSP1CON1bits.SSPM0 // bit 0
2423 #define SSPM1 SSP1CON1bits.SSPM1 // bit 1
2424 #define SSPM2 SSP1CON1bits.SSPM2 // bit 2
2425 #define SSPM3 SSP1CON1bits.SSPM3 // bit 3
2426 #define CKP SSP1CON1bits.CKP // bit 4
2427 #define SSPEN SSP1CON1bits.SSPEN // bit 5
2428 #define SSPOV SSP1CON1bits.SSPOV // bit 6
2429 #define WCOL SSP1CON1bits.WCOL // bit 7
2431 #define SEN SSP1CON2bits.SEN // bit 0
2432 #define RSEN SSP1CON2bits.RSEN // bit 1
2433 #define PEN SSP1CON2bits.PEN // bit 2
2434 #define RCEN SSP1CON2bits.RCEN // bit 3
2435 #define ACKEN SSP1CON2bits.ACKEN // bit 4
2436 #define ACKDT SSP1CON2bits.ACKDT // bit 5
2437 #define ACKSTAT SSP1CON2bits.ACKSTAT // bit 6
2438 #define GCEN SSP1CON2bits.GCEN // bit 7
2440 #define DHEN SSP1CON3bits.DHEN // bit 0
2441 #define AHEN SSP1CON3bits.AHEN // bit 1
2442 #define SBCDE SSP1CON3bits.SBCDE // bit 2
2443 #define SDAHT SSP1CON3bits.SDAHT // bit 3
2444 #define BOEN SSP1CON3bits.BOEN // bit 4
2445 #define SCIE SSP1CON3bits.SCIE // bit 5
2446 #define PCIE SSP1CON3bits.PCIE // bit 6
2447 #define ACKTIM SSP1CON3bits.ACKTIM // bit 7
2449 #define BF SSP1STATbits.BF // bit 0
2450 #define UA SSP1STATbits.UA // bit 1
2451 #define R_NOT_W SSP1STATbits.R_NOT_W // bit 2
2452 #define S SSP1STATbits.S // bit 3
2453 #define P SSP1STATbits.P // bit 4
2454 #define D_NOT_A SSP1STATbits.D_NOT_A // bit 5
2455 #define CKE SSP1STATbits.CKE // bit 6
2456 #define SMP SSP1STATbits.SMP // bit 7
2458 #define C STATUSbits.C // bit 0
2459 #define DC STATUSbits.DC // bit 1
2460 #define Z STATUSbits.Z // bit 2
2461 #define NOT_PD STATUSbits.NOT_PD // bit 3
2462 #define NOT_TO STATUSbits.NOT_TO // bit 4
2464 #define C_SHAD STATUS_SHADbits.C_SHAD // bit 0
2465 #define DC_SHAD STATUS_SHADbits.DC_SHAD // bit 1
2466 #define Z_SHAD STATUS_SHADbits.Z_SHAD // bit 2
2468 #define TMR1ON T1CONbits.TMR1ON // bit 0
2469 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2
2470 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
2471 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
2472 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
2473 #define TMR1CS0 T1CONbits.TMR1CS0 // bit 6
2474 #define TMR1CS1 T1CONbits.TMR1CS1 // bit 7
2476 #define T1GSS0 T1GCONbits.T1GSS0 // bit 0
2477 #define T1GSS1 T1GCONbits.T1GSS1 // bit 1
2478 #define T1GVAL T1GCONbits.T1GVAL // bit 2
2479 #define T1GGO_NOT_DONE T1GCONbits.T1GGO_NOT_DONE // bit 3
2480 #define T1GSPM T1GCONbits.T1GSPM // bit 4
2481 #define T1GTM T1GCONbits.T1GTM // bit 5
2482 #define T1GPOL T1GCONbits.T1GPOL // bit 6
2483 #define TMR1GE T1GCONbits.TMR1GE // bit 7
2485 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
2486 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
2487 #define TMR2ON T2CONbits.TMR2ON // bit 2
2488 #define T2OUTPS0 T2CONbits.T2OUTPS0 // bit 3
2489 #define T2OUTPS1 T2CONbits.T2OUTPS1 // bit 4
2490 #define T2OUTPS2 T2CONbits.T2OUTPS2 // bit 5
2491 #define T2OUTPS3 T2CONbits.T2OUTPS3 // bit 6
2493 #define TRISA0 TRISAbits.TRISA0 // bit 0
2494 #define TRISA1 TRISAbits.TRISA1 // bit 1
2495 #define TRISA2 TRISAbits.TRISA2 // bit 2
2496 #define TRISA3 TRISAbits.TRISA3 // bit 3
2497 #define TRISA4 TRISAbits.TRISA4 // bit 4
2498 #define TRISA5 TRISAbits.TRISA5 // bit 5
2499 #define TRISA6 TRISAbits.TRISA6 // bit 6
2500 #define TRISA7 TRISAbits.TRISA7 // bit 7
2502 #define TRISB0 TRISBbits.TRISB0 // bit 0
2503 #define TRISB1 TRISBbits.TRISB1 // bit 1
2504 #define TRISB2 TRISBbits.TRISB2 // bit 2
2505 #define TRISB3 TRISBbits.TRISB3 // bit 3
2506 #define TRISB4 TRISBbits.TRISB4 // bit 4
2507 #define TRISB5 TRISBbits.TRISB5 // bit 5
2508 #define TRISB6 TRISBbits.TRISB6 // bit 6
2509 #define TRISB7 TRISBbits.TRISB7 // bit 7
2511 #define TRISC0 TRISCbits.TRISC0 // bit 0
2512 #define TRISC1 TRISCbits.TRISC1 // bit 1
2513 #define TRISC2 TRISCbits.TRISC2 // bit 2
2514 #define TRISC3 TRISCbits.TRISC3 // bit 3
2515 #define TRISC4 TRISCbits.TRISC4 // bit 4
2516 #define TRISC5 TRISCbits.TRISC5 // bit 5
2517 #define TRISC6 TRISCbits.TRISC6 // bit 6
2518 #define TRISC7 TRISCbits.TRISC7 // bit 7
2520 #define TX9D TXSTAbits.TX9D // bit 0
2521 #define TRMT TXSTAbits.TRMT // bit 1
2522 #define BRGH TXSTAbits.BRGH // bit 2
2523 #define SENDB TXSTAbits.SENDB // bit 3
2524 #define SYNC TXSTAbits.SYNC // bit 4
2525 #define TXEN TXSTAbits.TXEN // bit 5
2526 #define TX9 TXSTAbits.TX9 // bit 6
2527 #define CSRC TXSTAbits.CSRC // bit 7
2529 #define reserved VREGCONbits.reserved // bit 0
2530 #define VREGPM VREGCONbits.VREGPM // bit 1
2532 #define SWDTEN WDTCONbits.SWDTEN // bit 0
2533 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
2534 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
2535 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
2536 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
2537 #define WDTPS4 WDTCONbits.WDTPS4 // bit 5
2539 #define WPUB0 WPUBbits.WPUB0 // bit 0
2540 #define WPUB1 WPUBbits.WPUB1 // bit 1
2541 #define WPUB2 WPUBbits.WPUB2 // bit 2
2542 #define WPUB3 WPUBbits.WPUB3 // bit 3
2543 #define WPUB4 WPUBbits.WPUB4 // bit 4
2544 #define WPUB5 WPUBbits.WPUB5 // bit 5
2545 #define WPUB6 WPUBbits.WPUB6 // bit 6
2546 #define WPUB7 WPUBbits.WPUB7 // bit 7
2548 #define WPUE3 WPUEbits.WPUE3 // bit 3
2550 #endif // #ifndef NO_BIT_DEFINES
2552 #endif // #ifndef __PIC16F1516_H__